* Fix bug #13694.
This commit is contained in:
@@ -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'"));
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -52,7 +52,9 @@
|
||||
$full = '';
|
||||
}
|
||||
?>
|
||||
<?php if($this->config->systemMode == 'new'):?>
|
||||
<th class='w-150px<?php echo zget($visibleFields, 'program', ' hidden') . zget($requiredFields, 'program', '', ' required');?>'><?php echo $lang->product->program;?></th>
|
||||
<?php endif;?>
|
||||
<th class='required <?php echo $width;?>' style="<?php echo $full;?>"><?php echo $lang->product->name;?></th>
|
||||
<th class='w-150px<?php echo zget($visibleFields, 'line', ' hidden') . zget($requiredFields, 'line', '', ' required');?>'><?php echo $lang->product->line;?></th>
|
||||
<th class='w-150px<?php echo zget($visibleFields, 'PO', ' hidden') . zget($requiredFields, 'PO', '', ' required');?>'><?php echo $lang->product->PO;?></th>
|
||||
@@ -73,9 +75,11 @@
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo sprintf('%03d', $productID) . html::hidden("productIDList[$productID]", $productID);?></td>
|
||||
<?php if($this->config->systemMode == 'new'):?>
|
||||
<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>
|
||||
<?php endif;?>
|
||||
<td title='<?php echo $products[$productID]->name?>'><?php echo html::input("names[$productID]", $products[$productID]->name, "class='form-control'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'line', ' hidden')?>' style='overflow:visible' id="line_<?php echo $productID;?>"><?php echo html::select("lines[$productID]", isset($lines[$products[$productID]->program]) ? $lines[$products[$productID]->program] : '', $products[$productID]->line, "class='form-control picker-select'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'line', ' hidden')?>' style='overflow:visible' id="line_<?php echo $productID;?>"><?php echo html::select("lines[$productID]", $this->config->systemMode == 'new' ? $lines[$products[$productID]->program] : $lines, $products[$productID]->line, "class='form-control picker-select'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'PO', ' hidden')?>' style='overflow:visible'><?php echo html::select("POs[$productID]", $poUsers, $products[$productID]->PO, "class='form-control picker-select'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'QD', ' hidden')?>' style='overflow:visible'><?php echo html::select("QDs[$productID]", $qdUsers, $products[$productID]->QD, "class='form-control picker-select'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'RD', ' hidden')?>' style='overflow:visible'><?php echo html::select("RDs[$productID]", $rdUsers, $products[$productID]->RD, "class='form-control picker-select'");?></td>
|
||||
|
||||
Reference in New Issue
Block a user