Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/155-dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Zen4All committed Apr 8, 2016
2 parents 4d3a430 + 7d7f164 commit 5c8b0a6
Show file tree
Hide file tree
Showing 10 changed files with 977 additions and 869 deletions.
117 changes: 89 additions & 28 deletions 1_modified_core_files/YOUR_ADMIN/customers.php

Large diffs are not rendered by default.

405 changes: 316 additions & 89 deletions 1_modified_core_files/YOUR_ADMIN/includes/functions/general.php

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions 1_modified_core_files/YOUR_ADMIN/languages.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
/**
* @package admin
* @copyright Copyright 2003-2014 Zen Cart Development Team
* @copyright Copyright 2003-2016 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version GIT: $Id: Author: DrByte Jun 30 2014 Modified in v1.5.4 $
* @version $Id: Author: DrByte Wed Apr 15 17:51:01 2015 -0400 Modified in v1.5.5 $
*/

require('includes/application_top.php');
Expand All @@ -27,10 +27,10 @@
values ('" . zen_db_input($name) . "', '" . zen_db_input($code) . "',
'" . zen_db_input($image) . "', '" . zen_db_input($directory) . "',
'" . zen_db_input($sort_order) . "')");
zen_record_admin_activity('Language [' . $code . '] added', 'info');

$insert_id = $db->Insert_ID();

zen_record_admin_activity('Language [' . $code . '] added', 'info');

// set default, if selected
if (isset($_POST['default']) && ($_POST['default'] == 'on')) {
$db->Execute("update " . TABLE_CONFIGURATION . "
Expand Down
383 changes: 0 additions & 383 deletions 1_modified_core_files/YOUR_ADMIN/linkpoint_review.php

This file was deleted.

202 changes: 106 additions & 96 deletions 1_modified_core_files/includes/classes/order.php

Large diffs are not rendered by default.

100 changes: 64 additions & 36 deletions 1_modified_core_files/includes/functions/functions_lookups.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
/**
* functions_lookups.php
* Lookup Functions for various Zen Cart activities such as countries, prices, products, product types, etc
* Lookup Functions for various core activities related to countries, prices, products, product types, etc
*
* @package functions
* @copyright Copyright 2003-2013 Zen Cart Development Team
* @copyright Copyright 2003-2016 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version GIT: $Id: Author: DrByte Tue Jul 23 19:29:41 2013 -0400 Modified in v1.5.2 $
* @version $Id: Author: mc12345678 Tue Feb 2 16:23:08 2016 -0500 Modified in v1.5.5 $
*/

/**
Expand Down Expand Up @@ -159,9 +159,9 @@ function zen_get_products_name($product_id, $language = '') {


/**
* Return a product's stock count.
* Return a product's stock-on-hand
*
* @param int The product id of the product who's stock we want
* @param int $products_id The product id of the product whose stock we want
*/
function zen_get_products_stock($products_id) {
global $db;
Expand All @@ -177,23 +177,15 @@ function zen_get_products_stock($products_id) {

/**
* Check if the required stock is available.
*
* If insufficent stock is available return an out of stock message
*
* @param int The product id of the product whos's stock is to be checked
* @param int Is this amount of stock available
*
* @TODO naughty html in a function
* @param int $products_id The product id of the product whose stock is to be checked
* @param int $products_quantity Quantity to compare against
*/
function zen_check_stock($products_id, $products_quantity) {
$stock_left = zen_get_products_stock($products_id) - $products_quantity;
$out_of_stock = '';

if ($stock_left < 0) {
$out_of_stock = '<span class="markProductOutOfStock">' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . '</span>';
}

return $out_of_stock;
return ($stock_left < 0) ? '<span class="markProductOutOfStock">' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . '</span>' : '';
}

/*
Expand Down Expand Up @@ -253,6 +245,49 @@ function zen_has_product_attributes($products_id, $not_readonly = 'true') {
}
}

/*
* Check if option name is not expected to have an option value (ie. text field, or File upload field)
*/
function zen_option_name_base_expects_no_values($option_name_id) {
global $db, $zco_notifier;

$option_name_no_value = true;
if (!is_array($option_name_id)) {
$option_name_id = array($option_name_id);
}

$sql = "SELECT products_options_type FROM " . TABLE_PRODUCTS_OPTIONS . " WHERE products_options_id :option_name_id:";
if (sizeof($option_name_id) > 1 ) {
$sql2 = 'in (';
foreach($option_name_id as $option_id) {
$sql2 .= ':option_id:,';
$sql2 = $db->bindVars($sql2, ':option_id:', $option_id, 'integer');
}
$sql2 = rtrim($sql2, ','); // Need to remove the final comma off of the above.
$sql2 = ')';
} else {
$sql2 = ' = :option_id:';
$sql2 = $db->bindVars($sql2, ':option_id:', $option_name_id[0], 'integer');
}

$sql = $db->bindVars($sql, ':option_name_id:', $sql2, 'noquotestring');

$sql_result = $db->Execute($sql);

foreach($sql_result as $opt_type) {

$test_var = true; // Set to false in observer if the name is not supposed to have a value associated
$zco_notifier->notify('FUNCTIONS_LOOKUPS_OPTION_NAME_NO_VALUES_OPT_TYPE', $opt_type, $test_var);

if ($test_var && $opt_type['products_options_type'] != PRODUCTS_OPTIONS_TYPE_TEXT && $opt_type['products_options_type'] != PRODUCTS_OPTIONS_TYPE_FILE) {
$option_name_no_value = false;
break;
}
}

return $option_name_no_value;
}

/*
* Check if product has attributes values
*/
Expand Down Expand Up @@ -869,26 +904,21 @@ function zen_get_products_new_timelimit($time_limit = false) {
////
// check if Product is set to use downloads
// does not validate download filename
function zen_has_product_attributes_downloads_status($products_id) {
global $db;
if (DOWNLOAD_ENABLED == 'true') {
$download_display_query_raw ="select pa.products_attributes_id, pad.products_attributes_filename
from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
where pa.products_id='" . (int)$products_id . "'
and pad.products_attributes_id= pa.products_attributes_id";

$download_display = $db->Execute($download_display_query_raw);
if ($download_display->RecordCount() != 0) {
$valid_downloads = false;
} else {
$valid_downloads = true;
}
} else {
$valid_downloads = false;
}
return $valid_downloads;
function zen_has_product_attributes_downloads_status($products_id) {
if (!defined('DOWNLOAD_ENABLED') || DOWNLOAD_ENABLED != 'true') {
return false;
}

$query = "select pad.products_attributes_id
from " . TABLE_PRODUCTS_ATTRIBUTES . " pa
inner join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
on pad.products_attributes_id = pa.products_attributes_id
where pa.products_id = " . (int) $products_id;

global $db;
return ($db->Execute($query)->RecordCount() > 0);
}

// build date range for new products
function zen_get_new_date_range($time_limit = false) {
if ($time_limit == false) {
Expand Down Expand Up @@ -935,5 +965,3 @@ function zen_get_upcoming_date_range() {

return $new_range;
}

?>
Loading

0 comments on commit 5c8b0a6

Please sign in to comment.