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/usps.php

Annotated File View

hpdl
620
1 <?php
2 /*
3   $Id: usps.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_usps extends osC_Shipping_Admin {
14     var $icon;
15
16     var $_title,
17         $_code = 'usps',
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_usps() {
25       global $osC_Language;
26
27       $this->icon = DIR_WS_IMAGES . 'icons/shipping_usps.gif';
28
29       $this->_title = $osC_Language->get('shipping_usps_title');
30       $this->_description = $osC_Language->get('shipping_usps_description');
31       $this->_status = (defined('MODULE_SHIPPING_USPS_STATUS') && (MODULE_SHIPPING_USPS_STATUS == 'True') ? true : false);
32       $this->_sort_order = (defined('MODULE_SHIPPING_USPS_SORT_ORDER') ? MODULE_SHIPPING_USPS_SORT_ORDER : null);
33     }
34
35 // class methods
36     function isInstalled() {
37       return (bool)defined('MODULE_SHIPPING_USPS_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 USPS Shipping', 'MODULE_SHIPPING_USPS_STATUS', 'True', 'Do you want to offer USPS 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 ('Enter the USPS User ID', 'MODULE_SHIPPING_USPS_USERID', 'NONE', 'Enter the USPS USERID assigned to you.', '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 ('Enter the USPS Password', 'MODULE_SHIPPING_USPS_PASSWORD', 'NONE', 'See USERID, above.', '6', '0', now())");
hpdl
758
48       $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 ('Which server to use', 'MODULE_SHIPPING_USPS_SERVER', 'production', 'An account at USPS is needed to use the Production server', '6', '0', 'osc_cfg_set_boolean_value(array(\'test\', \'production\'))', 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 ('Handling Fee', 'MODULE_SHIPPING_USPS_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
hpdl
758
50       $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_USPS_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())");
51       $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_USPS_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
52       $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_USPS_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
53     }
54
55     function getKeys() {
56       if (!isset($this->_keys)) {
57         $this->_keys = array('MODULE_SHIPPING_USPS_STATUS',
58                              'MODULE_SHIPPING_USPS_USERID',
59                              'MODULE_SHIPPING_USPS_PASSWORD',
60                              'MODULE_SHIPPING_USPS_SERVER',
61                              'MODULE_SHIPPING_USPS_HANDLING',
62                              'MODULE_SHIPPING_USPS_TAX_CLASS',
63                              'MODULE_SHIPPING_USPS_ZONE',
64                              'MODULE_SHIPPING_USPS_SORT_ORDER');
65       }
66
67       return $this->_keys;
68     }
69   }
70 ?>