Merge branch 'zentaopms_239_task_#73988_#74180' into 'zentaopms_239'

* Fix for #73988, #74180.

See merge request easycorp/zentaopms!6023
This commit is contained in:
王 于听
2022-11-03 08:53:34 +00:00
5 changed files with 10 additions and 15 deletions
+1 -1
View File
@@ -650,7 +650,7 @@ class custom extends control
$this->view->position[] = $this->lang->custom->common;
$this->view->position[] = $this->view->title;
$this->view->mode = $mode;
$this->view->program = $this->loadModel('program')->getTopPairs('', 'noclosed', true);
$this->view->programs = $this->loadModel('program')->getTopPairs('', 'noclosed', true);
$this->view->programID = isset($this->config->global->defaultProgram) ? $this->config->global->defaultProgram : 0;
$this->display();
+1 -1
View File
@@ -14,7 +14,7 @@ $(function()
var selectedMode = $('[name=mode]:checked').val();
if(mode == selectedMode) return false;
if(selectedMode == 'light')
if(selectedMode == 'light' && hasProgram)
{
$('#selectProgramModal').modal('show');
}
+2 -1
View File
@@ -13,6 +13,7 @@
<?php include '../../common/view/header.html.php';?>
<?php js::set('changeModeTips', sprintf($lang->custom->changeModeTips, $lang->custom->modeList[$mode == 'light' ? 'ALM' : 'light']));?>
<?php js::set('mode', $mode);?>
<?php js::set('hasProgram', !empty($programs));?>
<div id='mainContent' class='main-content'>
<form id='modeForm' class="load-indicator main-form form-ajax" method='post'>
<div class='main-header'>
@@ -134,7 +135,7 @@
<table class='table table-form'>
<tr>
<th><?php echo $lang->custom->defaultProgram;?></th>
<td><?php echo html::select('program', $program, $programID, "class='form-control chosen'");?></td>
<td><?php echo html::select('program', $programs, $programID, "class='form-control chosen'");?></td>
</tr>
</table>
</div>
+2 -2
View File
@@ -41,7 +41,7 @@ $(function()
{
var current = $(this).val();
var last = $(this).attr('data-last');
var lastBranch = $(this).attr('data-lastBranch');
var lastBranch = $(this).attr('data-lastBranch') !== undefined ? $(this).attr('data-lastBranch') : 0;
$(this).attr('data-last', current);
@@ -58,7 +58,7 @@ $(function()
if(current != last && $.inArray(last, unmodifiableProducts) != -1)
{
if(lastBranch)
if(lastBranch != 0)
{
if($.inArray(lastBranch, unmodifiableBranches) != -1)
{
+4 -10
View File
@@ -43,8 +43,8 @@ $(function()
$(this).attr('data-last', current);
var $branch = $(this).closest('.has-branch').find("[name^='branch']");
if($branch !== undefined)
var $branch = $(this).closest('.has-branch').find("[name^='branch']");
if($branch.length)
{
var branchID = $branch.val();
$(this).attr('data-lastBranch', branchID);
@@ -56,15 +56,9 @@ $(function()
if(current != last && $.inArray(last, unmodifiableProducts) != -1)
{
if(lastBranch)
if(lastBranch != 0)
{
if($.inArray(lastBranch, unmodifiableBranches) != -1)
{
if((lastBranch == 0 && unmodifiableMainBranches[last]) || lastBranch != 0)
{
bootbox.alert(unLinkProductTip.replace("%s", allProducts[last]));
}
}
if($.inArray(lastBranch, unmodifiableBranches) != -1) bootbox.alert(unLinkProductTip.replace("%s", allProducts[last] + branchGroups[last][lastBranch]));
}
else
{