Quick Search:

View

Revision:

Diff

Diff from 1165 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/osCommerce/branches/frank/osc-tickets/admin/includes/modules/shipping/flat.php

Annotated File View

hpdl
620
1 <?php
2 /*
3   $Id: flat.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_flat extends osC_Shipping_Admin {
14     var $icon;
15
16     var $_title,
17         $_code = 'flat',
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_flat() {
25       global $osC_Language;
26
27       $this->icon = '';
28
29       $this->_title = $osC_Language->get('shipping_flat_title');
30       $this->_description = $osC_Language->get('shipping_flat_description');
31       $this->_status = (defined('MODULE_SHIPPING_FLAT_STATUS') && (MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
32       $this->_sort_order = (defined('MODULE_SHIPPING_FLAT_SORT_ORDER') ? MODULE_SHIPPING_FLAT_SORT_ORDER : null);
33     }
34
35 // class methods
36     function isInstalled() {
37       return (bool)defined('MODULE_SHIPPING_FLAT_STATUS');
38     }
39
40     function install() {
41       global $osC_Database;
42
43       parent::install();
44
hpdl
758
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 Flat Shipping', 'MODULE_SHIPPING_FLAT_STATUS', 'True', 'Do you want to offer flat rate shipping?', '6', '0', 'osc_cfg_set_boolean_value(array(\'True\', \'False\'))', now())");
hpdl
620
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_FLAT_COST', '5.00', 'The shipping cost for all orders using this shipping method.', '6', '0', now())");
hpdl
758
47       $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_FLAT_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'osc_cfg_use_get_tax_class_title', 'osc_cfg_set_tax_classes_pull_down_menu', 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 ('Shipping Zone', 'MODULE_SHIPPING_FLAT_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'osc_cfg_use_get_zone_class_title', 'osc_cfg_set_zone_classes_pull_down_menu', now())");
hpdl
620
49       $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_FLAT_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
50     }
51
52     function getKeys() {
53       if (!isset($this->_keys)) {
54         $this->_keys = array('MODULE_SHIPPING_FLAT_STATUS',
55                              'MODULE_SHIPPING_FLAT_COST',
56                              'MODULE_SHIPPING_FLAT_TAX_CLASS',
57                              'MODULE_SHIPPING_FLAT_ZONE',
58                              'MODULE_SHIPPING_FLAT_SORT_ORDER');
59       }
60
61       return $this->_keys;
62     }
63   }
64 ?>