* Set default program.
This commit is contained in:
@@ -343,6 +343,7 @@ class product extends control
|
||||
$this->view->title = $this->lang->product->create;
|
||||
$this->view->position[] = $this->view->title;
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
$this->view->programID = $programID;
|
||||
$this->view->poUsers = $poUsers;
|
||||
$this->view->qdUsers = $qdUsers;
|
||||
$this->view->rdUsers = $rdUsers;
|
||||
|
||||
@@ -14,6 +14,18 @@ function loadProductLines(rootID)
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Set parent program.
|
||||
*
|
||||
* @param $parentProgram
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setParentProgram(parentProgram)
|
||||
{
|
||||
location.href = createLink('product', 'create', 'programID=' + parentProgram);
|
||||
}
|
||||
|
||||
$('#program').change(function()
|
||||
{
|
||||
var programID = $(this).val();
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<?php if($this->config->systemMode == 'new'):?>
|
||||
<tr>
|
||||
<th class='w-140px'><?php echo $lang->program->common;?></th>
|
||||
<td><?php echo html::select('program', $programs, '', "class='form-control chosen' required");?></td><td></td>
|
||||
<td><?php echo html::select('program', $programs, $programID, "class='form-control chosen' required onchange='setParentProgram(this.value)'");?></td><td></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
|
||||
@@ -27,12 +27,12 @@ $(function()
|
||||
/**
|
||||
* Set parent program.
|
||||
*
|
||||
* @param $parentProgram
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setParentProgram()
|
||||
function setParentProgram(parentProgram)
|
||||
{
|
||||
var parentProgram = $("#parent").val();
|
||||
location.href = createLink('project', 'create', 'model=' + model + '&programID=' + parentProgram);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user