From fa7e9fa7927686d3211e06199dd016979fc5eddf Mon Sep 17 00:00:00 2001 From: holan20180123 Date: Fri, 16 Jul 2021 16:06:38 +0800 Subject: [PATCH] * Fix bug #13694. --- module/product/control.php | 22 +++++++++++++++------- module/product/js/batchedit.js | 2 +- module/product/model.php | 2 +- module/product/view/batchedit.html.php | 6 +++++- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/module/product/control.php b/module/product/control.php index 27c3e8c04e..0abd2df670 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -586,12 +586,20 @@ class product extends control $rdUsers = $this->user->getPairs('nodeleted|devfirst', $appendRdUsers); if(!empty($this->config->user->moreLink)) $this->config->moreLinks["RD"] = $this->config->user->moreLink; - /* Get product lines by programs.*/ - $programs = $this->program->getTopPairs(); - $lines = array(); - foreach($programs as $id => $program) + $programs = array(); + if($this->config->systemMode == 'new') { - $lines[$id] = array('') + $this->product->getLinePairs($id); + /* Get product lines by programs.*/ + $programs = $this->program->getTopPairs(); + $lines = array(0 => ''); + foreach($programs as $id => $program) + { + $lines[$id] = array('') + $this->product->getLinePairs($id); + } + } + else + { + $lines = array('') + $this->product->getLinePairs(); } $this->view->title = $this->lang->product->batchEdit; @@ -603,7 +611,7 @@ class product extends control $this->view->qdUsers = $qdUsers; $this->view->rdUsers = $rdUsers; $this->view->programID = $programID; - $this->view->programs = array('') + $programs; + $this->view->programs = array('' => '') + $programs; unset($this->lang->product->typeList['']); $this->display(); @@ -949,7 +957,7 @@ class product extends control $lines = array(); if(empty($productID) or $programID) $lines = $this->product->getLinePairs($programID); - if($productID) die(html::select("lines[$productID]", array('' => '') + $lines, '', "class='form-control chosen'")); + if($productID) die(html::select("lines[$productID]", array('' => '') + $lines, '', "class='form-control picker-select'")); if(!$productID) die(html::select('line', array('' => '') + $lines, '', "class='form-control chosen'")); } diff --git a/module/product/js/batchedit.js b/module/product/js/batchedit.js index f5e929189b..7349ccdd1a 100644 --- a/module/product/js/batchedit.js +++ b/module/product/js/batchedit.js @@ -24,6 +24,6 @@ function loadProductLines(programID, productID) var link = createLink('product', 'ajaxGetLine', 'programID=' + programID + '&productID=' + productID); $('#line_' + productID).load(link, function() { - $('#lines' + productID).chosen(); + $('#lines' + productID).picker(); }); } diff --git a/module/product/model.php b/module/product/model.php index 153889d8de..33f27fcb2b 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -657,7 +657,7 @@ class productModel extends model $productID = (int)$productID; $products[$productID] = new stdClass(); - $products[$productID]->program = $data->programs[$productID]; + if($this->config->systemMode == 'new') $products[$productID]->program = $data->programs[$productID]; $products[$productID]->name = $productName; $products[$productID]->line = (int)$data->lines[$productID]; $products[$productID]->PO = $data->POs[$productID]; diff --git a/module/product/view/batchedit.html.php b/module/product/view/batchedit.html.php index 3c4716187e..8ada335cef 100755 --- a/module/product/view/batchedit.html.php +++ b/module/product/view/batchedit.html.php @@ -52,7 +52,9 @@ $full = ''; } ?> + config->systemMode == 'new'):?> '>product->program;?> + product->name;?> '>product->line;?> '>product->PO;?> @@ -73,9 +75,11 @@ ?> + config->systemMode == 'new'):?> ' style='overflow:visible'>program, "class='form-control picker-select' onchange='loadProductLines(this.value, $productID)'");?> + name, "class='form-control'");?> - ' style='overflow:visible' id="line_">program]) ? $lines[$products[$productID]->program] : '', $products[$productID]->line, "class='form-control picker-select'");?> + ' style='overflow:visible' id="line_">config->systemMode == 'new' ? $lines[$products[$productID]->program] : $lines, $products[$productID]->line, "class='form-control picker-select'");?> ' style='overflow:visible'>PO, "class='form-control picker-select'");?> ' style='overflow:visible'>QD, "class='form-control picker-select'");?> ' style='overflow:visible'>RD, "class='form-control picker-select'");?>