diff --git a/module/product/control.php b/module/product/control.php index 6d2facfea4..9930dd5c16 100755 --- a/module/product/control.php +++ b/module/product/control.php @@ -637,13 +637,14 @@ class product extends control $unauthorizedPrograms = array(); if(in_array($this->config->systemMode, array('ALM', 'PLM'))) { - $programs = $this->loadModel('program')->getTopPairs(); + $this->app->loadLang('project'); + $programs = $this->loadModel('program')->getTopPairs() + array(0 => $this->lang->project->future); /* Get unauthorized programs. */ $programIDList = array(); foreach($products as $product) { - if($product->program and !isset($programs[$product->program]) and !in_array($product->program, $programIDList)) $programIDList[] = $product->program; + if(!isset($programs[$product->program]) and !in_array($product->program, $programIDList)) $programIDList[] = $product->program; } $unauthorizedPrograms = $this->program->getPairsByList($programIDList); @@ -651,12 +652,12 @@ class product extends control $lines = array(0 => ''); foreach($programs + $unauthorizedPrograms as $id => $program) { - $lines[$id] = array('') + $this->product->getLinePairs($id); + $lines[$id] = array('') + $this->product->getLinePairs($id, true); } } else { - $lines = array('') + $this->product->getLinePairs(); + $lines = array('') + $this->product->getLinePairs(0, true); } $this->view->title = $this->lang->product->batchEdit; @@ -1126,7 +1127,7 @@ class product extends control public function ajaxGetLine($programID, $productID = 0) { $lines = array(); - if(empty($productID) or $programID) $lines = $this->product->getLinePairs($programID, true); + $lines = $this->product->getLinePairs($programID, true); if($productID) return print(html::select("lines[$productID]", array('' => '') + $lines, '', "class='form-control picker-select'")); if(!$productID) return print(html::select('line', array('' => '') + $lines, '', "class='form-control picker-select'")); diff --git a/module/product/js/batchedit.js b/module/product/js/batchedit.js index 7349ccdd1a..9c4c29d153 100644 --- a/module/product/js/batchedit.js +++ b/module/product/js/batchedit.js @@ -21,6 +21,7 @@ $(function() */ function loadProductLines(programID, productID) { + if(!programID) programID = 0; var link = createLink('product', 'ajaxGetLine', 'programID=' + programID + '&productID=' + productID); $('#line_' + productID).load(link, function() { diff --git a/module/product/view/batchedit.html.php b/module/product/view/batchedit.html.php index 50021ed318..b107aa203d 100755 --- a/module/product/view/batchedit.html.php +++ b/module/product/view/batchedit.html.php @@ -85,7 +85,7 @@ program])):?> ' style='overflow:visible'>program, "class='form-control' disabled");?> - ' style='overflow:visible'>program, "class='form-control picker-select' onchange='loadProductLines(this.value, $productID)'");?> + ' style='overflow:visible'>program, "class='form-control picker-select' data-allow_single_deselect='false' onchange='loadProductLines(this.value, $productID)'");?> name, "class='form-control'");?>