Quick Search:

View

Revision:

Diff

Diff from 637 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/osCommerce/branches/frank/tinymce/admin/includes/modules/shipping/item.php

Annotated File View

hpdl
620
1 <?php
2 /*
3   $Id: item.php 440 2006-02-19 18:40:20Z hpdl $
4
5   osCommerce, Open Source E-Commerce Solutions
6   http://www.oscommerce.com
7
8   Copyright (c) 2006 osCommerce
9
10   Released under the GNU General Public License
11 */
12
13   class osC_Shipping_item extends osC_Shipping_Admin {
14     var $icon;
15
16     var $_title,
17         $_code = 'item',
18         $_author_name = 'osCommerce',
19         $_author_www = 'http://www.oscommerce.com',
20         $_status = false,
21         $_sort_order;
22
23 // class constructor
24     function osC_Shipping_item() {
25       global $osC_Language;
26
27       $this->icon = '';
28
29       $this->_title = $osC_Language->get('shipping_item_title');
30       $this->_description = $osC_Language->get('shipping_item_description');
31       $this->_status = (defined('MODULE_SHIPPING_ITEM_STATUS') && (MODULE_SHIPPING_ITEM_STATUS == 'True') ? true : false);
32       $this->_sort_order = (defined('MODULE_SHIPPING_ITEM_SORT_ORDER') ? MODULE_SHIPPING_ITEM_SORT_ORDER : null);
33     }
34
35 // class methods
36     function isInstalled() {
37       return (bool)defined('MODULE_SHIPPING_ITEM_STATUS');
38     }
39
40     function install() {
41       global $osC_Database;
42
43       parent::install();
44
45       $osC_Database->simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Item Shipping', 'MODULE_SHIPPING_ITEM_STATUS', 'True', 'Do you want to offer per item rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
46       $osC_Database->simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost', 'MODULE_SHIPPING_ITEM_COST', '2.50', 'The shipping cost will be multiplied by the number of items in an order that uses this shipping method.', '6', '0', now())");
47       $osC_Database->simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_ITEM_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
48       $osC_Database->simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_ITEM_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
49       $osC_Database->simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_ITEM_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
50       $osC_Database->simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_ITEM_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
51     }
52
53     function getKeys() {
54       if (!isset($this->_keys)) {
55         $this->_keys = array('MODULE_SHIPPING_ITEM_STATUS',
56                              'MODULE_SHIPPING_ITEM_COST',
57                              'MODULE_SHIPPING_ITEM_HANDLING',
58                              'MODULE_SHIPPING_ITEM_TAX_CLASS',
59                              'MODULE_SHIPPING_ITEM_ZONE',
60                              'MODULE_SHIPPING_ITEM_SORT_ORDER');
61       }
62
63       return $this->_keys;
64     }
65   }
66 ?>