* When editing products, add sorting uniqueness judgment.

This commit is contained in:
tianshujie98
2020-12-30 11:28:06 +08:00
parent 71c32a05ed
commit 408a720605
7 changed files with 22 additions and 7 deletions
+1
View File
@@ -147,6 +147,7 @@ $lang->product->checkedSummary = " <strong>%total%</strong> geprüft, <strong>%e
$lang->product->noModule = '<div>Kein Modul</div><div>Jetzt verwalten</div>';
$lang->product->noProduct = 'Kein Produkt. ';
$lang->product->noMatched = '"%s" kann nicht gefunden werden.' . $lang->productCommon;
$lang->product->DuplicateOrder = "{$lang->productCommon}: The %s sort is duplicated with other {$lang->productCommon} sorts and will not be updated.";
$lang->product->featureBar['browse']['allstory'] = $lang->product->allStory;
$lang->product->featureBar['browse']['unclosed'] = $lang->product->unclosed;
+1
View File
@@ -147,6 +147,7 @@ $lang->product->checkedSummary = "<strong>%total%</strong> %storyCommon% selecte
$lang->product->noModule = '<div>You have no modules. </div><div>Manage Now</div>';
$lang->product->noProduct = "No {$lang->productCommon} yet. ";
$lang->product->noMatched = '"%s" cannot be found.' . $lang->productCommon;
$lang->product->DuplicateOrder = "{$lang->productCommon}: The %s sort is duplicated with other {$lang->productCommon} sorts and will not be updated.";
$lang->product->featureBar['browse']['allstory'] = $lang->product->allStory;
$lang->product->featureBar['browse']['unclosed'] = $lang->product->unclosed;
+1
View File
@@ -147,6 +147,7 @@ $lang->product->checkedSummary = "<strong>%total%</strong> %storyCommon% sélect
$lang->product->noModule = "<div>Vous n'avez aucun modules. </div><div>Gérer Maintenant</div>";
$lang->product->noProduct = "No {$lang->productCommon} à ce jour. ";
$lang->product->noMatched = '"%s" cannot be found.' . $lang->productCommon;
$lang->product->DuplicateOrder = "{$lang->productCommon}: The %s sort is duplicated with other {$lang->productCommon} sorts and will not be updated.";
$lang->product->featureBar['browse']['allstory'] = $lang->product->allStory;
$lang->product->featureBar['browse']['unclosed'] = $lang->product->unclosed;
+1
View File
@@ -147,6 +147,7 @@ $lang->product->checkedSummary = "<strong>%total%</strong> stories selected, Esi
$lang->product->noModule = '<div>Chưa có Module. </div><div>Quản lý ngay</div>';
$lang->product->noProduct = "Không có {$lang->productCommon} nào.";
$lang->product->noMatched = '"%s" không thể tìm thấy ' . $lang->productCommon;
$lang->product->DuplicateOrder = "{$lang->productCommon}: The %s sort is duplicated with other {$lang->productCommon} sorts and will not be updated.";
$lang->product->featureBar['browse']['allstory'] = $lang->product->allStory;
$lang->product->featureBar['browse']['unclosed'] = $lang->product->unclosed;
+1
View File
@@ -147,6 +147,7 @@ $lang->product->checkedSummary = "选中 <strong>%total%</strong> 个%storyCommo
$lang->product->noModule = "<div>您现在还没有模块信息</div><div>请维护{$lang->productCommon}模块</div>";
$lang->product->noProduct = "暂时没有{$lang->productCommon}。";
$lang->product->noMatched = '找不到包含"%s"的' . $lang->productCommon;
$lang->product->DuplicateOrder = "{$lang->productCommon} :%s排序与其他{$lang->productCommon}排序重复,将不会被更新。";
$lang->product->featureBar['browse']['allstory'] = $lang->product->allStory;
$lang->product->featureBar['browse']['unclosed'] = $lang->product->unclosed;
+16 -6
View File
@@ -608,12 +608,14 @@ class productModel extends model
*/
public function batchUpdate()
{
$products = array();
$allChanges = array();
$data = fixer::input('post')->get();
$oldProducts = $this->getByIdList($this->post->productIDList);
$nameList = array();
$codeList = array();
$products = array();
$allChanges = array();
$data = fixer::input('post')->get();
$oldProducts = $this->getByIdList($this->post->productIDList);
$nameList = array();
$codeList = array();
$message = '';
$productOrders = $this->dao->select("`id`,`order`")->from(TABLE_PRODUCT)->fetchPairs();
foreach($data->productIDList as $productID)
{
$productName = $data->names[$productID];
@@ -638,8 +640,16 @@ class productModel extends model
/* Check unique code for edited products. */
if(isset($codeList[$productCode])) dao::$errors['code'][] = 'product#' . $productID . sprintf($this->lang->error->unique, $this->lang->product->code, $productCode);
$codeList[$productCode] = $productCode;
/* Check unique order for edited products. */
foreach($productOrders as $id => $productOrder)
{
if($id == $productID) continue;
if($productOrder == $data->orders[$productID]) $message .= sprintf($this->lang->product->DuplicateOrder, $productID);
}
}
if(dao::isError()) die(js::error(dao::getError()));
if($message) echo js::alert($message);
foreach($products as $productID => $product)
{
+1 -1
View File
@@ -33,7 +33,7 @@
if($todo->type == 'story') common::printLink('story', 'view', "id={$todo->idvalue}", ' STORY#' . $todo->idvalue);
?>
</div>
<div class='detail-content'><?php echo $todo->desc;?></div>
<div class='detail-content article-content'><?php echo $todo->desc;?></div>
</div>
<?php $actionFormLink = $this->createLink('action', 'comment', "objectType=todo&objectID=$todo->id");?>
<?php include '../../common/view/action.html.php';?>