Skip to content

Commit 5ae7ffb

Browse files
authored
Merge pull request #471 from haraldpdl/cleanup
Cleanup
2 parents cb6ae86 + 355bcdc commit 5ae7ffb

File tree

12 files changed

+574
-265
lines changed

12 files changed

+574
-265
lines changed

catalog/admin/online_update.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175

176176
if (FileSystem::isWritable(OSCOM::BASE_DIR . 'Work/OnlineUpdates', true)) {
177177
if (!is_dir(OSCOM::BASE_DIR . 'Work/OnlineUpdates')) {
178-
mkdir(OSCOM::BASE_DIR . 'Work/OnlineUdates', 0777, true);
178+
mkdir(OSCOM::BASE_DIR . 'Work/OnlineUpdates', 0777, true);
179179
}
180180

181181
$filepath = OSCOM::BASE_DIR . 'Work/OnlineUpdates/' . $_POST['version'] . '-update.zip';

catalog/admin/specials.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,14 +270,23 @@
270270

271271
$contents[] = array('align' => 'center', 'text' => HTML::button(OSCOM::getDef('image_edit'), 'fa fa-edit', OSCOM::link(FILENAME_SPECIALS, 'page=' . $_GET['page'] . '&sID=' . $sInfo->specials_id . '&action=edit')) . HTML::button(OSCOM::getDef('image_delete'), 'fa fa-trash', OSCOM::link(FILENAME_SPECIALS, 'page=' . $_GET['page'] . '&sID=' . $sInfo->specials_id . '&action=delete')));
272272
$contents[] = array('text' => '<br />' . OSCOM::getDef('text_info_date_added') . ' ' . DateTime::toShort($sInfo->specials_date_added));
273-
$contents[] = array('text' => '' . OSCOM::getDef('text_info_last_modified') . ' ' . DateTime::toShort($sInfo->specials_last_modified));
273+
274+
if (isset($sInfo->specials_last_modified)) {
275+
$contents[] = array('text' => '' . OSCOM::getDef('text_info_last_modified') . ' ' . DateTime::toShort($sInfo->specials_last_modified));
276+
}
277+
274278
$contents[] = array('align' => 'center', 'text' => '<br />' . tep_info_image($sInfo->products_image, $sInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT));
275279
$contents[] = array('text' => '<br />' . OSCOM::getDef('text_info_original_price') . ' ' . $currencies->format($sInfo->products_price));
276280
$contents[] = array('text' => '' . OSCOM::getDef('text_info_new_price') . ' ' . $currencies->format($sInfo->specials_new_products_price));
277281
$contents[] = array('text' => '' . OSCOM::getDef('text_info_percentage') . ' ' . number_format(100 - (($sInfo->specials_new_products_price / $sInfo->products_price) * 100)) . '%');
278282

279-
$contents[] = array('text' => '<br />' . OSCOM::getDef('text_info_expires_date') . ' <strong>' . DateTime::toShort($sInfo->expires_date) . '</strong>');
280-
$contents[] = array('text' => '' . OSCOM::getDef('text_info_status_change') . ' ' . DateTime::toShort($sInfo->date_status_change));
283+
if (isset($sInfo->expires_date)) {
284+
$contents[] = array('text' => '<br />' . OSCOM::getDef('text_info_expires_date') . ' <strong>' . DateTime::toShort($sInfo->expires_date) . '</strong>');
285+
}
286+
287+
if (isset($sInfo->date_status_change)) {
288+
$contents[] = array('text' => '' . OSCOM::getDef('text_info_status_change') . ' ' . DateTime::toShort($sInfo->date_status_change));
289+
}
281290
}
282291
break;
283292
}

catalog/includes/modules/shipping/flat.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ function __construct() {
2222
$this->code = 'flat';
2323
$this->title = OSCOM::getDef('module_shipping_flat_text_title');
2424
$this->description = OSCOM::getDef('module_shipping_flat_text_description');
25-
$this->sort_order = MODULE_SHIPPING_FLAT_SORT_ORDER;
25+
$this->sort_order = defined('MODULE_SHIPPING_FLAT_SORT_ORDER') ? (int)MODULE_SHIPPING_FLAT_SORT_ORDER : 0;
2626
$this->icon = '';
27-
$this->tax_class = MODULE_SHIPPING_FLAT_TAX_CLASS;
28-
$this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
27+
$this->tax_class = defined('MODULE_SHIPPING_FLAT_TAX_CLASS') ? MODULE_SHIPPING_FLAT_TAX_CLASS : 0;
28+
$this->enabled = (defined('MODULE_SHIPPING_FLAT_STATUS') && (MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
2929

3030
if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {
3131
$check_flag = false;

catalog/includes/modules/shipping/item.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ function __construct() {
2222
$this->code = 'item';
2323
$this->title = OSCOM::getDef('module_shipping_item_text_title');
2424
$this->description = OSCOM::getDef('module_shipping_item_text_description');
25-
$this->sort_order = MODULE_SHIPPING_ITEM_SORT_ORDER;
25+
$this->sort_order = defined('MODULE_SHIPPING_ITEM_SORT_ORDER') ? (int)MODULE_SHIPPING_ITEM_SORT_ORDER : 0;
2626
$this->icon = '';
27-
$this->tax_class = MODULE_SHIPPING_ITEM_TAX_CLASS;
28-
$this->enabled = ((MODULE_SHIPPING_ITEM_STATUS == 'True') ? true : false);
27+
$this->tax_class = defined('MODULE_SHIPPING_ITEM_TAX_CLASS') ? MODULE_SHIPPING_ITEM_TAX_CLASS : 0;
28+
$this->enabled = (defined('MODULE_SHIPPING_ITEM_STATUS') && (MODULE_SHIPPING_ITEM_STATUS == 'True') ? true : false);
2929

3030
if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_ITEM_ZONE > 0) ) {
3131
$check_flag = false;

catalog/includes/modules/shipping/table.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ function __construct() {
2222
$this->code = 'table';
2323
$this->title = OSCOM::getDef('module_shipping_table_text_title');
2424
$this->description = OSCOM::getDef('module_shipping_table_text_description');
25-
$this->sort_order = MODULE_SHIPPING_TABLE_SORT_ORDER;
25+
$this->sort_order = defined('MODULE_SHIPPING_TABLE_SORT_ORDER') ? (int)MODULE_SHIPPING_TABLE_SORT_ORDER : 0;
2626
$this->icon = '';
27-
$this->tax_class = MODULE_SHIPPING_TABLE_TAX_CLASS;
28-
$this->enabled = ((MODULE_SHIPPING_TABLE_STATUS == 'True') ? true : false);
27+
$this->tax_class = defined('MODULE_SHIPPING_TABLE_TAX_CLASS') ? MODULE_SHIPPING_TABLE_TAX_CLASS : 0;
28+
$this->enabled = (defined('MODULE_SHIPPING_TABLE_STATUS') && (MODULE_SHIPPING_TABLE_STATUS == 'True') ? true : false);
2929

3030
if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_TABLE_ZONE > 0) ) {
3131
$check_flag = false;

catalog/includes/modules/shipping/zones.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ function __construct() {
103103
$this->code = 'zones';
104104
$this->title = OSCOM::getDef('module_shipping_zones_text_title');
105105
$this->description = OSCOM::getDef('module_shipping_zones_text_description');
106-
$this->sort_order = MODULE_SHIPPING_ZONES_SORT_ORDER;
106+
$this->sort_order = defined('MODULE_SHIPPING_ZONES_SORT_ORDER') ? (int)MODULE_SHIPPING_ZONES_SORT_ORDER : 0;
107107
$this->icon = '';
108-
$this->tax_class = MODULE_SHIPPING_ZONES_TAX_CLASS;
109-
$this->enabled = ((MODULE_SHIPPING_ZONES_STATUS == 'True') ? true : false);
108+
$this->tax_class = defined('MODULE_SHIPPING_ZONES_TAX_CLASS') ? MODULE_SHIPPING_ZONES_TAX_CLASS : 0;
109+
$this->enabled = (defined('MODULE_SHIPPING_ZONES_STATUS') && (MODULE_SHIPPING_ZONES_STATUS == 'True') ? true : false);
110110

111111
// CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
112112
$this->num_zones = 1;

0 commit comments

Comments
 (0)