* Code for task #70490.

This commit is contained in:
曹延义
2022-09-26 14:01:25 +08:00
parent 288fcede9d
commit f23e60374f
6 changed files with 25 additions and 8 deletions
+11 -7
View File
@@ -1,13 +1,13 @@
$("#" + browseType + "Tab").addClass('btn-active-text');
$(function()
{
$('#productListForm .c-checkbox').hide();
$('#productListForm .c-checkbox, #productListForm .check-all').hide();
$('input[name^="showEdit"]').click(function()
{
$('#productListForm .c-checkbox').hide();
$('#productListForm .c-checkbox, #productListForm .check-all').hide();
var showEdit = $(this).is(':checked') ? 1 : 0;
if(showEdit) $('#productListForm .c-checkbox').show();
if(showEdit) $('#productListForm .c-checkbox, #productListForm .check-all').show();
});
/* Init table sort. */
@@ -78,17 +78,21 @@ $(function()
function addStatistic()
{
var checkedLength = $(":checkbox[name^='productIDList']:checked").length;
var summary = checkedProducts.replace('%s', checkedLength);
if(cilentLang == "en" && checkedLength < 2) summary = summary.replace('products', 'product');
var statistic = "<div id='productsSummary' class='statistic'>" + summary + "</div>";
if(checkedLength > 0)
{
var summary = checkedProducts.replace('%s', checkedLength);
if(cilentLang == "en" && checkedLength < 2) summary = summary.replace('products', 'product');
var statistic = "<div id='productsSummary' class='statistic'>" + summary + "</div>";
$('#productsCount').hide();
$('#productsSummary').remove();
$('#editBtn').after(statistic);
$('.table-actions').show();
}
else
{
$('.table-actions').hide();
$('#productsCount').show();
$('#productsSummary').addClass('hidden');
}
}
+2
View File
@@ -37,6 +37,8 @@ $lang->product->addWhitelist = 'Add Whitelist';
$lang->product->unbindWhitelist = 'Remove Whitelist';
$lang->product->track = 'View Stories Matrix';
$lang->product->checkedProducts = '%s products selected';
$lang->product->pageProducts = 'Total products: %s.';
$lang->product->pageLines = 'Total product lines: %s, Total products: %s.';
$lang->product->indexAction = "All {$lang->productCommon}";
$lang->product->closeAction = "Close {$lang->productCommon}";
+2
View File
@@ -37,6 +37,8 @@ $lang->product->addWhitelist = 'Add Whitelist';
$lang->product->unbindWhitelist = 'Unbind Whitelist';
$lang->product->track = 'View Stories Matrix';
$lang->product->checkedProducts = '%s products selected';
$lang->product->pageProducts = 'Total products: %s.';
$lang->product->pageLines = 'Total product lines: %s, Total products: %s.';
$lang->product->indexAction = "All {$lang->productCommon}";
$lang->product->closeAction = "Close {$lang->productCommon}";
+2
View File
@@ -37,6 +37,8 @@ $lang->product->addWhitelist = 'Add Whitelist';
$lang->product->unbindWhitelist = 'Remove Whitelist';
$lang->product->track = 'Consulter Stories Matrice';
$lang->product->checkedProducts = '%s produits s électionnés';
$lang->product->pageProducts = 'Total products: %s.';
$lang->product->pageLines = 'Total product lines: %s, Total products: %s.';
$lang->product->indexAction = "All {$lang->productCommon}";
$lang->product->closeAction = "Fermer {$lang->productCommon}";
+2
View File
@@ -37,6 +37,8 @@ $lang->product->addWhitelist = '添加白名单';
$lang->product->unbindWhitelist = '移除白名单';
$lang->product->track = "查看需求矩阵";
$lang->product->checkedProducts = '已选择%s项产品';
$lang->product->pageProducts = '本页共%s个产品。';
$lang->product->pageLines = '本页共%s个产品线,%s个产品。';
$lang->product->indexAction = "所有{$lang->productCommon}仪表盘";
$lang->product->closeAction = "关闭{$lang->productCommon}";
+6 -1
View File
@@ -11,6 +11,7 @@
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/sortable.html.php';?>
<?php js::set('productLines', $productLines); ?>
<?php $canBatchEdit = common::hasPriv('product', 'batchEdit'); ?>
<div id="mainMenu" class="clearfix">
<div class="btn-toolBar pull-left">
@@ -251,13 +252,17 @@
<?php echo $pager->show('left', 'pagerjs');?>
<?php if(!empty($product) and $canBatchEdit):?>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<?php
$content = empty($productLines) ? sprintf($lang->product->pageProducts, count($productStats)) : sprintf($lang->product->pageLines, count($lineNames), count($productStats));
echo "<div id='productsCount' class='statistic'>$content</div>";
?>
<div class="table-actions btn-toolbar">
<?php
$actionLink = $this->createLink('product', 'batchEdit');
echo html::commonButton($lang->edit, "id='editBtn' data-form-action='$actionLink'");
?>
<?php endif;?>
</div>
<?php endif;?>
</div>
</form>
</div>