* Adjust the code.
This commit is contained in:
@@ -206,7 +206,7 @@ class personnel extends control
|
||||
{
|
||||
$this->loadModel('program');
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID);
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID, true);
|
||||
$this->program->setPGMViewMenu($programID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -467,7 +467,8 @@ class productModel extends model
|
||||
$currentModule = $this->app->moduleName;
|
||||
$currentMethod = $this->app->methodName;
|
||||
|
||||
$output = "<div class='btn-group header-angle-btn' id='pgmCommonAction'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$this->lang->product->all}'><span class='text'>{$this->lang->product->all}</span> <span class='caret'></span></button>";
|
||||
$active = empty($productID) ? 'active' : '';
|
||||
$output = "<div class='btn-group header-angle-btn $active' id='pgmCommonAction'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$this->lang->product->all}'><span class='text'>{$this->lang->product->all}</span> <span class='caret'></span></button>";
|
||||
$output .= '<ul class="dropdown-menu">';
|
||||
$output .= '<li>' . html::a(helper::createLink('product', 'index'), "<i class='icon icon-home'></i> " . $this->lang->product->index) . '</li>';
|
||||
$output .= '<li>' . html::a(helper::createLink('product', 'all'), "<i class='icon icon-cards-view'></i> " . $this->lang->product->all) . '</li>';
|
||||
@@ -485,8 +486,10 @@ class productModel extends model
|
||||
$currentProductName = $currentProduct->name;
|
||||
}
|
||||
|
||||
$active = isset($currentProduct->type) && $currentProduct->type != 'normal' ? '' : 'active';
|
||||
|
||||
$dropMenuLink = helper::createLink('product', 'ajaxGetDropMenu', "objectID=$productID&module=$currentModule&method=$currentMethod&extra=$extra");
|
||||
$output .= "<div class='btn-group header-angle-btn' id='swapper'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$currentProductName}'><span class='text'>{$currentProductName}</span> <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
|
||||
$output .= "<div class='btn-group header-angle-btn $active' id='swapper'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$currentProductName}'><span class='text'>{$currentProductName}</span> <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
|
||||
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>';
|
||||
$output .= "</div></div>";
|
||||
|
||||
@@ -497,7 +500,7 @@ class productModel extends model
|
||||
$branchName = isset($branches[$branch]) ? $branches[$branch] : $branches[0];
|
||||
$dropMenuLink = helper::createLink('branch', 'ajaxGetDropMenu', "objectID=$productID&module=$currentModule&method=$currentMethod&extra=$extra");
|
||||
|
||||
$output .= "<div class='btn-group header-angle-btn'><button id='currentBranch' data-toggle='dropdown' type='button' class='btn'><span class='text'>{$branchName}</span> <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
|
||||
$output .= "<div class='btn-group header-angle-btn active'><button id='currentBranch' data-toggle='dropdown' type='button' class='btn'><span class='text'>{$branchName}</span> <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
|
||||
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>';
|
||||
$output .= "</div></div>";
|
||||
}
|
||||
|
||||
+10
-10
@@ -41,7 +41,7 @@ class program extends control
|
||||
public function PGMIndex()
|
||||
{
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction();
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction(0, true);
|
||||
|
||||
$this->view->title = $this->lang->program->PGMIndex;
|
||||
$this->view->position[] = $this->lang->program->PGMIndex;
|
||||
@@ -62,7 +62,7 @@ class program extends control
|
||||
public function PGMBrowse($status = 'all', $orderBy = 'order_asc')
|
||||
{
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction();
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction(0, true);
|
||||
|
||||
if(common::hasPriv('program', 'pgmcreate')) $this->lang->pageActions = html::a($this->createLink('program', 'pgmcreate'), "<i class='icon icon-sm icon-plus'></i> " . $this->lang->program->PGMCreate, '', "class='btn btn-secondary'");
|
||||
|
||||
@@ -106,7 +106,7 @@ class program extends control
|
||||
public function PGMProduct($programID = 0, $browseType = 'noclosed', $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1)
|
||||
{
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID);
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID, true);
|
||||
$this->program->setPGMViewMenu($programID);
|
||||
|
||||
/* Load pager and get tasks. */
|
||||
@@ -145,7 +145,7 @@ class program extends control
|
||||
public function PGMCreate($parentProgramID = 0)
|
||||
{
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction();
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction(0, true);
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
@@ -178,7 +178,7 @@ class program extends control
|
||||
public function PGMEdit($programID = 0)
|
||||
{
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction();
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction(0, true);
|
||||
|
||||
$program = $this->program->getPGMByID($programID);
|
||||
|
||||
@@ -220,7 +220,7 @@ class program extends control
|
||||
public function PGMView($programID = 0)
|
||||
{
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID);
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID, true);
|
||||
$this->program->setPGMViewMenu($programID);
|
||||
|
||||
$program = $this->program->getPGMByID($programID);
|
||||
@@ -345,7 +345,7 @@ class program extends control
|
||||
public function PGMProject($programID = 0, $browseType = 'doing', $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1)
|
||||
{
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID);
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID, true);
|
||||
$this->program->setPGMViewMenu($programID);
|
||||
|
||||
$this->loadModel('datatable');
|
||||
@@ -389,7 +389,7 @@ class program extends control
|
||||
{
|
||||
$this->loadModel('user');
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID);
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID, true);
|
||||
$this->program->setPGMViewMenu($programID);
|
||||
|
||||
/* Load pager and get tasks. */
|
||||
@@ -426,7 +426,7 @@ class program extends control
|
||||
|
||||
$this->loadModel('user');
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID);
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID, true);
|
||||
$this->program->setPGMViewMenu($programID);
|
||||
|
||||
$this->loadModel('dept');
|
||||
@@ -706,7 +706,7 @@ class program extends control
|
||||
else
|
||||
{
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction();
|
||||
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction(0, true);
|
||||
}
|
||||
|
||||
if($_POST)
|
||||
|
||||
@@ -287,12 +287,14 @@ class programModel extends model
|
||||
* Get program swapper.
|
||||
*
|
||||
* @param int $programID
|
||||
* @param bool $active
|
||||
* @access private
|
||||
* @return void
|
||||
*/
|
||||
public function getPGMCommonAction($programID = 0)
|
||||
public function getPGMCommonAction($programID = 0, $active = false)
|
||||
{
|
||||
$output = "<div class='btn-group header-angle-btn' id='pgmCommonAction'><button data-toggle='dropdown' type='button' class='btn' title='{$this->lang->program->PGMCommon}'><span class='text'>{$this->lang->program->PGMCommon}</span> <span class='caret'></span></button>";
|
||||
$active = $active ? 'active' : '';
|
||||
$output = "<div class='btn-group header-angle-btn $active' id='pgmCommonAction'><button data-toggle='dropdown' type='button' class='btn' title='{$this->lang->program->PGMCommon}'><span class='text'>{$this->lang->program->PGMCommon}</span> <span class='caret'></span></button>";
|
||||
$output .= '<ul class="dropdown-menu">';
|
||||
$output .= '<li>' . html::a(helper::createLink('program', 'pgmindex'), "<i class='icon icon-home'></i> " . $this->lang->program->PGMIndex) . '</li>';
|
||||
$output .= '<li>' . html::a(helper::createLink('program', 'pgmbrowse'), "<i class='icon icon-cards-view'></i> " . $this->lang->program->PGMBrowse) . '</li>';
|
||||
@@ -307,15 +309,18 @@ class programModel extends model
|
||||
* Get program swapper.
|
||||
*
|
||||
* @param int $programID
|
||||
* @param bool $active
|
||||
* @access private
|
||||
* @return void
|
||||
*/
|
||||
public function getPGMSwitcher($programID = 0)
|
||||
public function getPGMSwitcher($programID = 0, $active = false)
|
||||
{
|
||||
$currentProgramName = '';
|
||||
$currentModule = $this->app->moduleName;
|
||||
$currentMethod = $this->app->methodName;
|
||||
|
||||
$active = $active ? 'active' : '';
|
||||
|
||||
if($programID)
|
||||
{
|
||||
setCookie("lastProgram", $programID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
@@ -328,7 +333,7 @@ class programModel extends model
|
||||
}
|
||||
|
||||
$dropMenuLink = helper::createLink('program', 'ajaxGetPGMDropMenu', "objectID=$programID&module=$currentModule&method=$currentMethod");
|
||||
$output = "<div class='btn-group header-angle-btn' id='swapper'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$currentProgramName}'><span class='text'>{$currentProgramName}</span> <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
|
||||
$output = "<div class='btn-group header-angle-btn $active' id='swapper'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$currentProgramName}'><span class='text'>{$currentProgramName}</span> <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
|
||||
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>'; $output .= "</div></div>";
|
||||
|
||||
return $output;
|
||||
@@ -692,12 +697,14 @@ class programModel extends model
|
||||
/*
|
||||
* Get project swapper.
|
||||
*
|
||||
* @param bool $active
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function printPRJCommonAction()
|
||||
public function printPRJCommonAction($active = false)
|
||||
{
|
||||
$output = "<div class='btn-group header-angle-btn' id='pgmCommonAction'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$this->lang->program->PRJAll}'><span class='text'>{$this->lang->program->PRJAll}</span> <span class='caret'></span></button>";
|
||||
$active = $active ? 'active' : '';
|
||||
$output = "<div class='btn-group header-angle-btn $active' id='pgmCommonAction'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$this->lang->program->PRJAll}'><span class='text'>{$this->lang->program->PRJAll}</span> <span class='caret'></span></button>";
|
||||
$output .= '<ul class="dropdown-menu">';
|
||||
$output .= '<li>' . html::a(helper::createLink('program', 'prjbrowse'), "<i class='icon icon-cards-view'></i> " . $this->lang->program->PRJAll) . '</li>';
|
||||
$output .= '<li>' . html::a(helper::createLink('program', 'createGuide'), "<i class='icon icon-plus'></i> " . $this->lang->program->PRJCreate, '', 'data-toggle="modal" data-target="#guideDialog"') . '</li>';
|
||||
@@ -717,7 +724,9 @@ class programModel extends model
|
||||
*/
|
||||
public function getPRJSwitcher($projectID, $currentModule, $currentMethod)
|
||||
{
|
||||
$this->printPRJCommonAction();
|
||||
$active = strpos($currentMethod, 'prj') !== false ? true : false;
|
||||
$this->printPRJCommonAction($active);
|
||||
|
||||
if($currentModule == 'program' && $currentMethod != 'index') return;
|
||||
|
||||
$this->loadModel('project');
|
||||
@@ -729,7 +738,7 @@ class programModel extends model
|
||||
}
|
||||
|
||||
$dropMenuLink = helper::createLink('program', 'ajaxGetPRJDropMenu', "objectID=$projectID&module=$currentModule&method=$currentMethod");
|
||||
$output = "<div class='btn-group header-angle-btn' id='swapper'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$currentProjectName}'><span class='text'>{$currentProjectName}</span> <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
|
||||
$output = "<div class='btn-group header-angle-btn active' id='swapper'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$currentProjectName}'><span class='text'>{$currentProjectName}</span> <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
|
||||
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>';
|
||||
$output .= "</div></div>";
|
||||
|
||||
|
||||
@@ -844,6 +844,4 @@ $(document).ready(function()
|
||||
revertModuleCookie();
|
||||
|
||||
$(document).on('click', '#helpMenuItem .close-help-tab', function(){$('#helpMenuItem').prev().remove();$('#helpMenuItem').remove();});
|
||||
|
||||
$('.btn-group.header-angle-btn:last').addClass('active');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user