* Fix bug #44296.
This commit is contained in:
@@ -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'"));
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
<?php if(isset($unauthorizedPrograms[$products[$productID]->program])):?>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'program', ' hidden')?>' style='overflow:visible'><?php echo html::select("programs[$productID]", $unauthorizedPrograms, $products[$productID]->program, "class='form-control' disabled");?></td>
|
||||
<?php else:?>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'program', ' hidden')?>' style='overflow:visible'><?php echo html::select("programs[$productID]", $programs, $products[$productID]->program, "class='form-control picker-select' onchange='loadProductLines(this.value, $productID)'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'program', ' hidden')?>' style='overflow:visible'><?php echo html::select("programs[$productID]", $programs, $products[$productID]->program, "class='form-control picker-select' data-allow_single_deselect='false' onchange='loadProductLines(this.value, $productID)'");?></td>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
<td title='<?php echo $products[$productID]->name?>'><?php echo html::input("names[$productID]", $products[$productID]->name, "class='form-control'");?></td>
|
||||
|
||||
Reference in New Issue
Block a user