Skip to content

Commit

Permalink
Merge branch 'release/2.0.0-beta.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
Zen4All committed Dec 15, 2019
2 parents af1e38d + a282ddd commit 112fd8e
Show file tree
Hide file tree
Showing 14 changed files with 480 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,20 @@
<div class="row">
<div class="col-sm-4">
<?php echo zen_image(DIR_WS_IMAGES . 'icon_yellow_on.gif', IMAGE_ICON_LINKED); ?>&nbsp;&nbsp;<strong><?php echo TEXT_MASTER_CATEGORIES_ID; ?></strong>
<?php echo zen_draw_pull_down_menu('master_category', zen_get_master_categories_pulldown($_GET['pID']), $pInfo->master_categories_id, 'class="form-control"'); ?>
<?php echo zen_draw_pull_down_menu('master_category', zen_get_master_categories_pulldown($_GET['pID']), $productInfo['master_categories_id']['value'], 'class="form-control"'); ?>
</div>
<?php
if ($pInfo->master_categories_id <= 0) {
echo '</div><div class="col-sm-4 text-wanring">' . WARNING_MASTER_CATEGORIES_ID . '</div>';
}
?>
<?php if ($productInfo['master_categories_id']['value'] <= 0) { ?>
<div class="col-sm-4 text-warning"><?php echo WARNING_MASTER_CATEGORIES_ID; ?></div>
<?php } ?>
<div class="col-sm-4"><?php echo TEXT_INFO_LINKED_TO_COUNT . $products_list->RecordCount(); ?></div>
</div>
<?php } else { ?>
<div class="row">
<p>
<?php
echo TEXT_MASTER_CATEGORIES_ID;
echo TEXT_INFO_ID . ($_GET['pID'] > 0 ? $pInfo->master_categories_id . ' ' . zen_get_category_name($pInfo->master_categories_id, $_SESSION['languages_id']) : $current_category_id . ' ' . zen_get_category_name($current_category_id, $_SESSION['languages_id']));
?>
<?php
echo TEXT_MASTER_CATEGORIES_ID;
echo TEXT_INFO_ID . ($_GET['pID'] > 0 ? $productInfo['master_categories_id']['value'] . ' ' . zen_get_category_name($productInfo['master_categories_id']['value'], $_SESSION['languages_id']) : $current_category_id . ' ' . zen_get_category_name($current_category_id, $_SESSION['languages_id']));
?>
</p>
</div>
<?php } ?>
Expand Down Expand Up @@ -79,13 +77,13 @@
echo '<tr>';
}
echo ' <td align="right">' . $categories_list->fields['categories_id'] . '</td>' . "\n";
if ($pInfo->master_categories_id == $categories_list->fields['categories_id']) {
if ($productInfo['master_categories_id']['value'] == $categories_list->fields['categories_id']) {
echo ' <td align="left">' . zen_image(DIR_WS_IMAGES . 'icon_yellow_on.gif', IMAGE_ICON_LINKED) . '&nbsp;' . $categories_list->fields['categories_name'] . zen_draw_hidden_field('current_master_categories_id', $categories_list->fields['categories_id']) . '</td>' . "\n";
} else {
echo ' <td align="left">' . ($selected ? '<strong>' : '') . $zc_categories_checkbox . '&nbsp;' . $categories_list->fields['categories_name'] . ($selected ? '</strong>' : '') . '</td>' . "\n";
}
$categories_list->MoveNext();
if ($cnt_columns == MAX_DISPLAY_PRODUCTS_TO_CATEGORIES_COLUMNS or $categories_list->EOF) {
if ($cnt_columns == MAX_DISPLAY_PRODUCTS_TO_CATEGORIES_COLUMNS || $categories_list->EOF) {
if ($categories_list->EOF and $cnt_columns != MAX_DISPLAY_PRODUCTS_TO_CATEGORIES_COLUMNS) {
while ($cnt_columns < MAX_DISPLAY_PRODUCTS_TO_CATEGORIES_COLUMNS) {
$cnt_columns++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
?>
<div class="form-group">
<ul class="list-group col-sm-3">
<li class="list-group-item justify-content-between">Numbers in stock:<span class="badge badge-default badge-pill"><?php echo $pInfo->products_quantity; ?></span></li>
<li class="list-group-item justify-content-between">Numbers in stock:<span class="badge badge-default badge-pill"><?php echo $productInfo['products_quantity']['value']; ?></span></li>
<li class="list-group-item justify-content-between">Numbers sold: <span class="badge badge-default badge-pill"><?php echo $ordered->fields['products_ordered']; ?></span></li>
<li class="list-group-item justify-content-between">Times viewed:
<?php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
'discount_qty' => $item['discount_qty'],
'discount_price' => $item['discount_price']];
}
} elseif (isset($pInfo->discount_qty) && $pInfo->discount_qty != '') {
$tempDiscountQty = $pInfo->discount_qty;
$tempDiscountPrice = $pInfo->discount_price;
} elseif (isset($productInfo['discount_qty']['value']) && $productInfo['discount_qty']['value'] != '') {
$tempDiscountQty = $productInfo['discount_qty']['value'];
$tempDiscountPrice = $productInfo['discount_price']['value'];
for ($i = 0, $n = sizeof($tempDiscountQty); $i < $n; $i++) {
$tempDiscount[$i + 1] = array(
'discount_qty' => $tempDiscountQty[$i + 1],
Expand Down Expand Up @@ -77,10 +77,10 @@
<?php echo TEXT_DISCOUNT_TYPE_INFO; ?>
</td>
<td colspan="2" class="main">
<?php echo TEXT_DISCOUNT_TYPE . ' ' . zen_draw_pull_down_menu('products_discount_type', $discount_type_array, $pInfo->products_discount_type, 'class="form-control"'); ?>
<?php echo TEXT_DISCOUNT_TYPE . ' ' . zen_draw_pull_down_menu('products_discount_type', $discount_type_array, $productInfo['products_discount_type']['value'], 'class="form-control"'); ?>
</td>
<td colspan="2" class="main">
<?php echo TEXT_DISCOUNT_TYPE_FROM . ' ' . zen_draw_pull_down_menu('products_discount_type_from', $discount_type_from_array, $pInfo->products_discount_type_from, 'class="form-control"'); ?>
<?php echo TEXT_DISCOUNT_TYPE_FROM . ' ' . zen_draw_pull_down_menu('products_discount_type_from', $discount_type_from_array, $productInfo['products_discount_type_from']['value'], 'class="form-control"'); ?>
</td>
</tr>
<tr>
Expand All @@ -102,14 +102,14 @@
<tbody>
<?php
foreach ($discount_name as $row) {
switch ($pInfo->products_discount_type) {
switch ($productInfo['products_discount_type']['value']) {
// none
case '0':
$discounted_price = 0;
break;
// percentage discount
case '1':
if ($pInfo->products_discount_type_from == '0') {
if ($productInfo['products_discount_type_from']['value'] == '0') {
$discounted_price = $display_price - ($display_price * ($row['discount_price'] / 100));
} else {
if (!$display_specials_price) {
Expand All @@ -122,15 +122,15 @@
break;
// actual price
case '2':
if ($pInfo->products_discount_type_from == '0') {
if ($productInfo['products_discount_type_from']['value'] == '0') {
$discounted_price = $row['discount_price'];
} else {
$discounted_price = $row['discount_price'];
}
break;
// amount offprice
case '3':
if ($pInfo->products_discount_type_from == '0') {
if ($productInfo['products_discount_type_from']['value'] == '0') {
$discounted_price = $display_price - $row['discount_price'];
} else {
if (!$display_specials_price) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

/**
* 2_0_0-beta_7.php
*
* @copyright Copyright 2003-2018 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 Author: Zen4All
*/
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ function getMessageStack() {
}).done(function (resultArray) {
//console.log(resultArray);
if (resultArray) {
$('#collectInfoMessageStackText').html(resultArray.modalMessageStack);
$('#collectInfoMessageStack').modal('show');
$('#MessageStackText').html(resultArray.modalMessageStack);
$('#MessageStackModal').modal('show');
setTimeout(function () {
$('#collectInfoMessageStack').modal('hide');
$('#MessageStackModal').modal('hide');
}, 4000);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ function setProductFlag(productId, flag) {
}
}).done(function () {
if (flag == '1') {
$('#pFlag_' + productId).removeClass('btn-danger').addClass('btn-success').attr('title', '<?php echo IMAGE_ICON_STATUS_ON; ?>').attr('onclick', 'setProductFlag(\'' + productId + '\', \'0\')');
$('#pFlag_' + productId).removeClass('txt-status-off').addClass('txt-status-on').attr('title', '<?php echo IMAGE_ICON_STATUS_ON; ?>').attr('onclick', 'setProductFlag(\'' + productId + '\', \'0\')');
} else {
$('#pFlag_' + productId).removeClass('btn-success').addClass('btn-danger').attr('title', '<?php echo IMAGE_ICON_STATUS_OFF; ?>').attr('onclick', 'setProductFlag(\'' + productId + '\', \'1\')');
$('#pFlag_' + productId).removeClass('txt-status-on').addClass('txt-status-off').attr('title', '<?php echo IMAGE_ICON_STATUS_OFF; ?>').attr('onclick', 'setProductFlag(\'' + productId + '\', \'1\')');
}
});
}
Expand Down Expand Up @@ -107,9 +107,9 @@ function setCategoryFlagConfirm() {
$('#FlagRadioHasCategorySubcategories').empty();
$('#FlagRadioGetProductsToCategories').empty();
if (resultArray.newFlag == '1') {
$('#cFlag_' + resultArray.categoryId).removeClass('btn-danger').addClass('btn-success').attr('title', '<?php echo IMAGE_ICON_STATUS_ON; ?>').attr('onclick', 'setCategoryFlag(\'' + resultArray.categoryId + '\', \'' + resultArray.cPath + '\', \'1\')');
$('#cFlag_' + resultArray.categoryId).removeClass('txt-status-off').addClass('txt-status-on').attr('title', '<?php echo IMAGE_ICON_STATUS_ON; ?>').attr('onclick', 'setCategoryFlag(\'' + resultArray.categoryId + '\', \'' + resultArray.cPath + '\', \'1\')');
} else {
$('#cFlag_' + resultArray.categoryId).removeClass('btn-success').addClass('btn-danger').attr('title', '<?php echo IMAGE_ICON_STATUS_OFF; ?>').attr('onclick', 'setCategoryFlag(\'' + resultArray.categoryId + '\', \'' + resultArray.cPath + '\', \'0\')');
$('#cFlag_' + resultArray.categoryId).removeClass('txt-status-on').addClass('txt-status-off').attr('title', '<?php echo IMAGE_ICON_STATUS_OFF; ?>').attr('onclick', 'setCategoryFlag(\'' + resultArray.categoryId + '\', \'' + resultArray.cPath + '\', \'0\')');
}
$('tr#cID_' + resultArray.categoryId + ' td.ColumnQuantity').html(resultArray.totalProductsOn + '<?php echo TEXT_PRODUCTS_STATUS_ON_OF; ?>' + resultArray.totalProducts + '<?php echo TEXT_PRODUCTS_STATUS_ACTIVE; ?>');
});
Expand Down Expand Up @@ -261,19 +261,73 @@ function moveProductConfirm() {
}).done(function (resultArray) {
$('#moveProductModal').modal('hide');
$('#pID_' + resultArray.pID).empty();
getMessageStack()
});
}));
}
function copyProduct(productId, productType) {
$('#copyProductId').val(productId);
$('#copyProductType').val(productType)
zcJS.ajax({
url: 'ajax.php?act=ajaxAdminCategoriesProductListing&method=copyProduct',
data: {
'productId': productId
}
}).done(function (resultArray) {
console.log(resultArray);
$('#copyProductCurrentInfo').html(resultArray.productModel + ' - ' + resultArray.productName + '[ ID#' + resultArray.productId + ' ]');
$('#copyProdModalCurrentCat').html('<strong>' + resultArray.currentCategories + '</strong>');
if(resultArray.productHasAttributes == false){
$('#copyProductModalAttributes').hide();
$('#copyProductModalAttributes :radio').attr('disabled', true);
}
if(resultArray.metatagsDefined == false){
$('#copyProductModalMetaTags').hide();
$('#copyProductModalMetaTags :radio').attr('disabled', true);
}
if(resultArray.productIsLinked == false){
$('#copyProductModalLinked').hide();
$('#copyProductModalLinked :radio').attr('disabled', true);
}
if(resultArray.productHasDiscounts == false){
$('#copyProductModalDiscounts').hide();
$('#copyProductModalDiscounts :radio').attr('disabled', true);
}
});
$('#copyProductModal').on('hidden.bs.modal', function () {
$('#copyProductModalAttributes').show();
$('#copyProductModalAttributes :radio').attr('disabled', false);
$('#copyProductModalMetaTags').show();
$('#copyProductModalMetaTags :radio').attr('disabled', false);
$('#copyProductModalLinked').show();
$('#copyProductModalLinked :radio').attr('disabled', false);
$('#copyProductModalDiscounts').show();
$('#copyProductModalDiscounts :radio').attr('disabled', false);
});
}
function copyProductConfirm() {
$("#copyProductForm").off('submit').on('submit', (function (e) {
e.preventDefault();
var formData;
formData = $('#copyProductForm').serializeArray();
zcJS.ajax({
url: 'ajax.php?act=ajaxAdminCategoriesProductListing&method=copyProductConfirm',
data: formData
}).done(function (resultArray) {
$('#copyProductModal').modal('hide');
getMessageStack()
});
}));
getMessageStack()
}
function getMessageStack() {
zcJS.ajax({
url: 'ajax.php?act=ajaxAdminCategoriesProductListing&method=messageStack'
}).done(function (resultArray) {
if (resultArray) {
$('#categoriesProductListingMessageStackText').html(resultArray.modalMessageStack);
$('#categoriesProductListingMessageStack').modal('show');
$('#MessageStackText').html(resultArray.modalMessageStack);
$('#MessageStackModal').modal('show');
setTimeout(function () {
$('#collectInfoMessageStack').modal('hide');
$('#MessageStackModal').modal('hide');
}, 4000);
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
?>
<div id="copyProductModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<i class="fa fa-times" aria-hidden="true"></i>
<span class="sr-only"><?php echo TEXT_CLOSE; ?></span>
</button>
<h4 class="modal-title" id="copyProductHeading"><?php echo TEXT_INFO_HEADING_COPY_TO; ?></h4>
</div>
<form name="formCopyProductConfirm" method="post" enctype="multipart/form-data" id="copyProductForm" class="form-horizontal">
<?php echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']); ?>
<div class="modal-body">
<?php echo zen_draw_hidden_field('products_id', '', 'id="copyProductId"'); ?>
<?php echo zen_draw_hidden_field('product_type', '', 'id="copyProductType"'); ?>
<div class="form-group">
<label class="control-label col-sm-3"><?php echo TEXT_INFO_CURRENT_PRODUCT; ?></label>
<div class="col-sm-9"><strong><span id="copyProductCurrentInfo"></span></strong></div>
</div>
<div id="copyProductNewCat" class="form-group">
<?php echo zen_draw_label(TXT_LABEL_SELECT_NEW_CAT, 'categories_id', 'class="control-label col-sm-3"'); ?>
<div class="col-sm-9">
<?php echo zen_draw_pull_down_menu('categories_id', zen_get_category_tree(), $current_category_id, 'id="copyToCategoryId" class="form-control"'); ?>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3"><?php echo TEXT_INFO_CURRENT_CATEGORIES; ?></label>
<div id="copyProdModalCurrentCat" class="col-sm-9"></div>
</div>
<div class="form-group">
<label class="control-label col-sm-3"><?php echo TEXT_HOW_TO_COPY; ?></label>
<div class="col-sm-9">
<div class="radio">
<label><?php echo zen_draw_radio_field('copy_as', 'link', true) . TEXT_COPY_AS_LINK; ?></label>
</div>
<div class="radio">
<label><?php echo zen_draw_radio_field('copy_as', 'duplicate') . TEXT_COPY_AS_DUPLICATE; ?></label>
</div>
</div>
</div>
<div id="copyProductModalAttributes" class="form-group">
<label class="control-label col-sm-3"><?php echo TEXT_COPY_ATTRIBUTES; ?></label>
<div class="col-sm-9">
<div class="radio">
<label><?php echo zen_draw_radio_field('copy_attributes', 'copy_attributes_yes', true) . TEXT_YES; ?></label>
</div>
<div class="radio">
<label><?php echo zen_draw_radio_field('copy_attributes', 'copy_attributes_no') . TEXT_NO; ?></label>
</div>
</div>
</div>
<div id="copyProductModalMetaTags" class="form-group">
<label class="control-label col-sm-3"><?php echo TEXT_COPY_METATAGS; ?></label>
<div class="col-sm-9">
<div class="radio">
<label><?php echo zen_draw_radio_field('copy_metatags', 'copy_metatags_yes', true) . TEXT_YES; ?></label>
</div>
<div class="radio">
<label><?php echo zen_draw_radio_field('copy_metatags', 'copy_metatags_no') . TEXT_NO; ?></label>
</div>
</div>
</div>
<div id="copyProductModalLinked" class="form-group">
<label class="control-label col-sm-3"><?php echo TEXT_COPY_LINKED_CATEGORIES; ?></label>
<div class="col-sm-9">
<div class="radio">
<label><?php echo zen_draw_radio_field('copy_linked_categories', 'copy_linked_categories_yes', true) . TEXT_YES; ?></label>
</div>
<div class="radio">
<label><?php echo zen_draw_radio_field('copy_linked_categories', 'copy_linked_categories_no') . TEXT_NO; ?></label>
</div>
</div>
</div>
<div id="copyProductModalDiscounts" class="form-group">
<label class="control-label col-sm-3"><?php echo TEXT_COPY_DISCOUNTS; ?></label>
<div class="col-sm-9">
<div class="radio">
<label><?php echo zen_draw_radio_field('copy_discounts', 'copy_discounts_yes', true) . TEXT_YES; ?></label>
</div>
<div class="radio">
<label><?php echo zen_draw_radio_field('copy_discounts', 'copy_discounts_no') . TEXT_NO; ?></label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-12 text-center">
<button type="submit" class="btn btn-danger" onclick="moveProductConfirm();"><?php echo IMAGE_MOVE; ?></button> <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo IMAGE_CANCEL; ?></button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
Loading

0 comments on commit 112fd8e

Please sign in to comment.