* Add menu active.

This commit is contained in:
Yagami
2020-09-22 15:45:07 +08:00
parent 0f66457e03
commit c1d1d71eaf
10 changed files with 95 additions and 258 deletions
+3 -3
View File
@@ -123,7 +123,7 @@ $lang->common->common = '公有模块';
$lang->mainNav = new stdclass();
$lang->mainNav->my = '<i class="icon icon-menu-my"></i> 地盘|my|index|';
$lang->mainNav->program = '<i class="icon icon-stack"></i> 项目集|program|pgmindex|';
$lang->mainNav->product = '<i class="icon icon-menu-project"></i> 产品|product|productlist|';
$lang->mainNav->product = '<i class="icon icon-menu-project"></i> 产品|product|index|';
$lang->mainNav->project = '<i class="icon icon-menu-doc"></i> 项目|program|prjbrowse|';
$lang->mainNav->system = '<i class="icon icon-menu-users"></i> 组织|custom|estimate|';
$lang->mainNav->admin = '<i class="icon icon-menu-backend"></i> 后台|admin|index|';
@@ -135,7 +135,7 @@ $lang->dividerMenu = ',admin,';
$lang->program = new stdclass();
$lang->program->menu = new stdclass();
$lang->program->menu->index = '主页|program|pgmindex|';
$lang->program->menu->browse = array('link' => '项目集|program|pgmbrowse|', 'alias' => 'pgmcreate,pgmedit');
$lang->program->menu->browse = array('link' => '项目集|program|pgmbrowse|', 'alias' => 'pgmcreate,pgmedit,pgmgroup,pgmmanagepriv,pgmmanageview,pgmmanagemembers');
$lang->program->viewMenu = new stdclass();
$lang->program->viewMenu->view = '概况|program|pgmview|program=%s';
@@ -146,7 +146,7 @@ $lang->program->viewMenu->project = array('link' => "$lang->projectCommon|progra
$lang->product = new stdclass();
$lang->product->menu = new stdclass();
$lang->product->menu->home = '主页|product|index|';
$lang->product->menu->list = $lang->productCommon . '|product|productlist|';
$lang->product->menu->list = $lang->productCommon . '|product|all|';
/* System menu. */
$lang->system = new stdclass();
+17 -58
View File
@@ -31,7 +31,7 @@ class product extends control
/* Get all products, if no, goto the create page. */
$this->products = $this->product->getPairs('nocode', $this->session->program);
if(empty($this->products) and strpos(',productlist,create,index,showerrornone,', $this->methodName) === false and $this->app->getViewType() != 'mhtml') $this->locate($this->createLink('product', 'create'));
if(empty($this->products) and strpos(',all,create,index,showerrornone,', $this->methodName) === false and $this->app->getViewType() != 'mhtml') $this->locate($this->createLink('product', 'create'));
$this->view->products = $this->products;
}
@@ -718,11 +718,11 @@ class product extends control
}
/**
* All product.
* Products under project set.
*
* @param int $productID
* @param int $line
* @param string $status
* @param int $programID
* @param string $browseType
* @param int $param
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
@@ -730,31 +730,28 @@ class product extends control
* @access public
* @return void
*/
public function all($productID = 0, $line = 0, $status = 'noclosed', $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 10, $pageID = 1)
public function all($programID = 0, $browseType = 'noclosed', $param = 0, $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1)
{
$this->session->set('productList', $this->app->getURI(true));
$productID = $this->product->saveState($productID, $this->products);
$this->product->setMenu($this->products, $productID);
$this->session->set('program', $programID);
$this->loadModel('program');
/* Load pager and get tasks. */
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
/* Save this url to session. */
$uri = $this->app->getURI(true);
$this->app->session->set('lineList', $uri);
$program = $programID ? $this->program->getPGMByID($programID) : 0;
$this->app->loadLang('my');
$this->view->title = $this->lang->product->allProduct;
$this->view->position[] = $this->lang->product->allProduct;
$this->view->productStats = $this->product->getStats($orderBy, $pager, $status, $line);
$this->view->lineTree = $this->loadModel('tree')->getTreeMenu(0, $viewType = 'line', $startModuleID = 0, array('treeModel', 'createLineLink'), array('productID' => $productID, 'status' => $status));
$this->view->title = $this->lang->product->common;
$this->view->position[] = $this->lang->product->common;
$this->view->productStats = $this->product->getStats($orderBy, $pager, $browseType);
$this->view->lines = array('') + $this->tree->getLinePairs();
$this->view->productID = $productID;
$this->view->line = $line;
$this->view->status = $status;
$this->view->orderBy = $orderBy;
$this->view->pager = $pager;
$this->view->programTree = $this->program->getPGMTreeMenu($programID, 'product');
$this->view->programID = $programID;
$this->view->program = $program;
$this->view->browseType = $browseType;
$this->display();
}
@@ -871,42 +868,4 @@ class product extends control
$this->session->set('product', (int)$productID);
$this->send(array('result' => 'success', 'productID' => $this->session->product));
}
/**
* Products under project set.
*
* @param int $programID
* @param string $browseType
* @param int $param
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
public function productList($programID = 0, $browseType = 'all', $param = 0, $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1)
{
$this->session->set('program', $programID);
$this->loadModel('program');
/* Load pager and get tasks. */
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$program = $programID ? $this->program->getPGMByID($programID) : 0;
$this->view->title = $this->lang->product->common;
$this->view->position[] = $this->lang->product->common;
$this->view->productStats = $this->product->getStats($orderBy, $pager, $browseType);
$this->view->lines = array('') + $this->tree->getLinePairs();
$this->view->orderBy = $orderBy;
$this->view->pager = $pager;
$this->view->programTree = $this->program->getPGMTreeMenu($programID, true);
$this->view->programID = $programID;
$this->view->program = $program;
$this->view->browseType = $browseType;
$this->display();
}
}
+35 -1
View File
@@ -1 +1,35 @@
.alert>[class*="icon-"]+.content {padding-left: 20px;}
.side-col .detail-content{padding-left: 10px; margin-top: 0px}
.tree li.has-list.open:before {border-left: none;}
#programTree li {padding: 0 0 0 8px;}
#programTree li.has-list {padding-left: 20px;}
#programTree li > a {display: block; padding: 5px 0; border-radius: 2px; padding-left: 6px; height: 30px;}
#programTree li > a > span {display: inline-block;}
#programTree li > a > span + span {margin-left: 8px;}
#programTree li.selected > a {background-color: #E8F3FC;}
#programTree li.selected > a > span.title {color: #006AF1;}
#programTree .label-id {border-color: #cbd0db; color: #7d8599}
#programTree .label.label-type {background: #fff; border: 1px solid #7d8599; color:#7d8599}
#programTree li > a > span.title {color: #3C4353; white-space: nowrap; max-width: 60%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;}
#programTree li > a > span.user {color: #838a9d;}
#programTree li > a > span.user > .icon-person {font-size: 14px; position: relative; top: -1px; color: #a6aab8}
#programTree li > .list-toggle {transform: rotate(0deg); width: 16px; height: 16px; border: 4px solid #a6aab8; border-radius: 2px; top: 7px;}
#programTree li > .list-toggle:before {content: ' '; display: block; position: absolute; border: 1px solid #a6aab8; top: 2px; left: -3px; right: -3px; bottom: 2px; min-width: 0; transition: all .2s;}
#programTree li > .list-toggle:hover:before,
#programTree li > .list-toggle:hover {border-color: #006AF1;}
#programTree li.open > .list-toggle {width: 12px; height: 12px; top: 9px; background-color: #a6aab8; border-width: 3px; left: 3px;}
#programTree li.open > .list-toggle:before {border: none; height: 2px; width: 6px; left: 0; top: 2px; background: #fff;}
#programTree li.open > .list-toggle:hover {background: #006AF1;}
#programTree ul > li:after {display: block; position: absolute; content: ' '; border-top: 2px solid #cbd0db; top: 14px; left: -12px; z-index: 1; width: 10px;}
#programTree ul > li:before,
#programTree ul > li.has-list:before {background: none; content: ' '; display: block; position: absolute; width: auto; height: auto; border: none; border-left: 2px solid #cbd0db; top: -13px; bottom: 12px; left: -12px;}
#programTree ul > li:last-child:before {bottom: auto; height: 29px;}
#programTree ul > li:first-child:before {top: -9px;}
#programTree ul > li.has-list:first-child:before {top: -13px;}
#programTree ul > li.tree-single-item:before {height: 23px;}
#programTree ul > li.has-list:after {width: 14px;}
#programTree ul > li.item-meas a.selected{color: #0c64eb;}
.side-col {padding-right: 20px; width: 18%}
#sidebar>.cell {width: 100%;}
-35
View File
@@ -1,35 +0,0 @@
.side-col .detail-content{padding-left: 10px; margin-top: 0px}
.tree li.has-list.open:before {border-left: none;}
#programTree li {padding: 0 0 0 8px;}
#programTree li.has-list {padding-left: 20px;}
#programTree li > a {display: block; padding: 5px 0; border-radius: 2px; padding-left: 6px; height: 30px;}
#programTree li > a > span {display: inline-block;}
#programTree li > a > span + span {margin-left: 8px;}
#programTree li.selected > a {background-color: #E8F3FC;}
#programTree li.selected > a > span.title {color: #006AF1;}
#programTree .label-id {border-color: #cbd0db; color: #7d8599}
#programTree .label.label-type {background: #fff; border: 1px solid #7d8599; color:#7d8599}
#programTree li > a > span.title {color: #3C4353; white-space: nowrap; max-width: 60%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;}
#programTree li > a > span.user {color: #838a9d;}
#programTree li > a > span.user > .icon-person {font-size: 14px; position: relative; top: -1px; color: #a6aab8}
#programTree li > .list-toggle {transform: rotate(0deg); width: 16px; height: 16px; border: 4px solid #a6aab8; border-radius: 2px; top: 7px;}
#programTree li > .list-toggle:before {content: ' '; display: block; position: absolute; border: 1px solid #a6aab8; top: 2px; left: -3px; right: -3px; bottom: 2px; min-width: 0; transition: all .2s;}
#programTree li > .list-toggle:hover:before,
#programTree li > .list-toggle:hover {border-color: #006AF1;}
#programTree li.open > .list-toggle {width: 12px; height: 12px; top: 9px; background-color: #a6aab8; border-width: 3px; left: 3px;}
#programTree li.open > .list-toggle:before {border: none; height: 2px; width: 6px; left: 0; top: 2px; background: #fff;}
#programTree li.open > .list-toggle:hover {background: #006AF1;}
#programTree ul > li:after {display: block; position: absolute; content: ' '; border-top: 2px solid #cbd0db; top: 14px; left: -12px; z-index: 1; width: 10px;}
#programTree ul > li:before,
#programTree ul > li.has-list:before {background: none; content: ' '; display: block; position: absolute; width: auto; height: auto; border: none; border-left: 2px solid #cbd0db; top: -13px; bottom: 12px; left: -12px;}
#programTree ul > li:last-child:before {bottom: auto; height: 29px;}
#programTree ul > li:first-child:before {top: -9px;}
#programTree ul > li.has-list:first-child:before {top: -13px;}
#programTree ul > li.tree-single-item:before {height: 23px;}
#programTree ul > li.has-list:after {width: 14px;}
#programTree ul > li.item-meas a.selected{color: #0c64eb;}
.side-col {padding-right: 20px; width: 18%}
#sidebar>.cell {width: 100%;}
+4
View File
@@ -1,3 +1,7 @@
$("#" + browseType + "Tab").addClass('btn-active-text');
$('#programTree').tree();
$('#program' + programID).addClass('active');
$(".tree .active").parent('li').addClass('active');
$(function()
{
$('#productTableList').on('sort.sortable', function(e, data)
-13
View File
@@ -1,13 +0,0 @@
$("#" + browseType + "Tab").addClass('btn-active-text');
$('#programTree').tree();
$('#program' + programID).addClass('active');
$(".tree .active").parent('li').addClass('active');
$(function()
{
$('#productTableList').on('sort.sortable', function(e, data)
{
var list = '';
for(i = 0; i < data.list.length; i++) list += $(data.list[i].item).attr('data-id') + ',';
$.post(createLink('product', 'updateOrder'), {'products' : list, 'orderBy' : orderBy});
});
});
+1 -1
View File
@@ -92,7 +92,7 @@ class productModel extends model
}
else
{
if($project->product == 'multiple')
if(isset($project->product) and $project->product == 'multiple')
{
$label = $this->lang->product->index;
$pageNav = '<div class="btn-group angle-btn' . ($currentMethod == 'index' ? ' active' : '') . '"><div class="btn-group"><button data-toggle="dropdown" type="button" class="btn">' . $label . ' <span class="caret"></span></button>';
+28 -28
View File
@@ -1,54 +1,52 @@
<?php
/**
* The html template file of all method of product module of ZenTaoPMS.
* The html productlist file of productlist method of product module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Yangyang Shi <shiyangyang@cnezsoft.com>
* @package ZenTaoPMS
* @version $Id$
* @version $Id
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/sortable.html.php';?>
<div id="mainMenu" class="clearfix">
<div id="sidebarHeader">
<div class="title">
<?php echo empty($program) ? $lang->program->PGMCommon : $program->name;?>
<?php if($programID) echo html::a(inLink('all', 'programID=0'), "<i class='icon icon-sm icon-close'></i>", '', 'class="text-muted"');?>
</div>
</div>
<div class="btn-toolbar pull-left">
<?php
foreach($lang->product->featureBar['all'] as $key => $label)
{
if(is_string($label)) $link = inlink("all", "productID={$productID}&line=&status={$key}");
if(is_array($label))
{
$link = zget($label, 'link', '');
$label = zget($label, 'label', '');
if(!$link or !$label) continue;
}
$label = "<span class='text'>{$label}</span>";
$label .= $key == $status ? " <span class='label label-light label-badge'>{$pager->recTotal}</span>" : '';
$active = $key == $status ? 'btn-active-text' : '';
echo html::a($link, $label, '', "class='btn btn-link {$active}' id='{$key}'");
}
?>
<?php foreach($lang->product->featureBar['all'] as $key => $label):?>
<?php echo html::a(inlink("all", "programID=$programID&browseType=$key&orderBy=$orderBy"), "<span class='text'>{$label}</span>", '', "class='btn btn-link' id='{$key}Tab'");?>
<?php endforeach;?>
</div>
<div class="btn-toolbar pull-right">
<?php common::printLink('product', 'export', "status=$status&orderBy=$orderBy", "<i class='icon-export muted'> </i>" . $lang->export, '', "class='btn btn-link export'")?>
<?php common::printLink('product', 'create', '', "<i class='icon-plus'></i> " . $lang->product->create, '', "class='btn btn-primary'") ?>
<?php common::printLink('product', 'create', "programID=$programID", '<i class="icon icon-plus"></i>' . $lang->product->create, '', 'class="btn btn-primary"');?>
</div>
</div>
<div id="mainContent" class="main-row fade">
<div id="sidebar" class="side-col">
<div class="sidebar-toggle"><i class="icon icon-angle-left"></i></div>
<div class="cell">
<?php echo $programTree;?>
</div>
</div>
<div class="main-col">
<form class="main-table table-product" data-ride="table" method="post" id='productsForm' action='<?php echo inLink('batchEdit', "productID=$productID");?>'>
<?php $canOrder = (common::hasPriv('product', 'updateOrder'))?>
<?php $canBatchEdit = common::hasPriv('product', 'batchEdit'); ?>
<table class="table has-sort-head table-fixed" id='productList'>
<?php $vars = "productID=$productID&line=$line&status=$status&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<form class="main-table table-product" data-ride="table" id="productListForm" method="post" action='<?php echo inLink('batchEdit', "programID=$programID");?>'>
<?php $canOrder = common::hasPriv('product', 'updataOrder');?>
<?php $canBatchEdit = common::hasPriv('product', 'batchEdit');?>
<table id="productList" class="table has-sort-head table-fixed">
<?php $vars = "programID&$programID&browseType=$browseType&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<thead>
<tr>
<th class='c-id'>
<?php if($canBatchEdit):?>
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
<label></label>
</div>
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll;?>">
<label></label>
</div>
<?php endif;?>
<?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
</th>
@@ -109,4 +107,6 @@
</div>
</div>
<?php js::set('orderBy', $orderBy)?>
<?php js::set('programID', $programID)?>
<?php js::set('browseType', $browseType)?>
<?php include '../../common/view/footer.html.php';?>
-112
View File
@@ -1,112 +0,0 @@
<?php
/**
* The html productlist file of productlist method of product module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Yangyang Shi <shiyangyang@cnezsoft.com>
* @package ZenTaoPMS
* @version $Id
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/sortable.html.php';?>
<div id="mainMenu" class="clearfix">
<div id="sidebarHeader">
<div class="title">
<?php echo empty($program) ? $lang->program->PGMCommon : $program->name;?>
<?php if($programID) echo html::a(inLink('productlist', 'programID=0'), "<i class='icon icon-sm icon-close'></i>", '', 'class="text-muted"');?>
</div>
</div>
<div class="btn-toolbar pull-left">
<?php foreach($lang->product->featureBar['all'] as $key => $label):?>
<?php echo html::a(inlink("productlist", "programID=$programID&browseType=$key&orderBy=$orderBy"), "<span class='text'>{$label}</span>", '', "class='btn btn-link' id='{$key}Tab'");?>
<?php endforeach;?>
</div>
<div class="btn-toolbar pull-right">
<?php common::printLink('product', 'create', "programID=$programID", '<i class="icon icon-plus"></i>' . $lang->product->create, '', 'class="btn btn-primary"');?>
</div>
</div>
<div id="mainContent" class="main-row fade">
<div id="sidebar" class="side-col">
<div class="sidebar-toggle"><i class="icon icon-angle-left"></i></div>
<div class="cell">
<?php echo $programTree;?>
</div>
</div>
<div class="main-col">
<form class="main-table table-product" data-ride="table" id="productListForm" method="post" action='<?php echo inLink('batchEdit', "programID=$programID");?>'>
<?php $canOrder = common::hasPriv('product', 'updataOrder');?>
<?php $canBatchEdit = common::hasPriv('product', 'batchEdit');?>
<table id="productList" class="table has-sort-head table-fixed">
<?php $vars = "programID&$programID&browseType=$browseType&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<thead>
<tr>
<th class='c-id'>
<?php if($canBatchEdit):?>
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll;?>">
<label></label>
</div>
<?php endif;?>
<?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
</th>
<th><?php common::printOrderLink('name', $orderBy, $vars, $lang->product->name);?></th>
<th class='w-110px text-left'><?php common::printOrderLink('line', $orderBy, $vars, $lang->product->line);?></th>
<th class='w-80px' title='<?php echo $lang->product->activeStoriesTitle;?>'><?php echo $lang->product->activeStories;?></th>
<th class='w-90px' title='<?php echo $lang->product->changedStoriesTitle;?>'><?php echo $lang->product->changedStories;?></th>
<th class='w-70px' title='<?php echo $lang->product->draftStoriesTitle;?>'><?php echo $lang->product->draftStories;?></th>
<th class='w-90px' title='<?php echo $lang->product->closedStoriesTitle;?>'><?php echo $lang->product->closedStories;?></th>
<th class='w-70px' title='<?php echo $lang->product->plans;?>'><?php echo $lang->product->plans;?></th>
<th class='w-70px' title='<?php echo $lang->product->releases;?>'><?php echo $lang->product->releases;?></th>
<th class='w-80px' title='<?php echo $lang->product->unResolvedBugsTitle;?>'><?php echo $lang->product->unResolvedBugs;?></th>
<th class='w-110px' title='<?php echo $lang->product->assignToNullBugsTitle;?>'><?php echo $lang->product->assignToNullBugs;?></th>
<?php if($canOrder):?>
<th class='w-70px sort-default'><?php common::printOrderLink('order', $orderBy, $vars, $lang->product->updateOrder);?></th>
<?php endif;?>
</tr>
</thead>
<tbody class="sortable" id="productTableList">
<?php foreach($productStats as $product):?>
<tr data-id='<?php echo $product->id ?>' data-order='<?php echo $product->code;?>'>
<td class='c-id'>
<?php if($canBatchEdit):?>
<?php echo html::checkbox('productIDList', array($product->id => sprintf('%03d', $product->id)));?>
<?php else:?>
<?php printf('%03d', $product->id);?>
<?php endif;?>
</td>
<td class="c-name" title='<?php echo $product->name?>'><?php echo html::a($this->createLink('product', 'index', 'locate=no&product=' . $product->id), $product->name);?></td>
<td title='<?php echo zget($lines, $product->line, '')?>'><?php echo zget($lines, $product->line, '');?></td>
<td class='text-center'><?php echo $product->stories['active'];?></td>
<td class='text-center'><?php echo $product->stories['changed'];?></td>
<td class='text-center'><?php echo $product->stories['draft'];?></td>
<td class='text-center'><?php echo $product->stories['closed'];?></td>
<td class='text-center'><?php echo $product->plans;?></td>
<td class='text-center'><?php echo $product->releases;?></td>
<td class='text-center'><?php echo $product->unResolved;?></td>
<td class='text-center'><?php echo $product->assignToNull;?></td>
<?php if($canOrder):?>
<td class='c-actions sort-handler'><i class="icon icon-move"></i></td>
<?php endif;?>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php if($productStats):?>
<div class="table-footer">
<?php if($canBatchEdit):?>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<div class="table-actions btn-toolbar">
<?php echo html::submitButton($lang->edit, '', 'btn');?>
</div>
<?php endif;?>
<?php $pager->show('right', 'pagerjs');?>
</div>
<?php endif;?>
</form>
</div>
</div>
<?php js::set('orderBy', $orderBy)?>
<?php js::set('programID', $programID)?>
<?php js::set('browseType', $browseType)?>
<?php include '../../common/view/footer.html.php';?>
+7 -7
View File
@@ -703,8 +703,7 @@ class programModel extends model
$dropMenuLink = helper::createLink('program', 'ajaxGetPGMDropMenu', "objectID=$programID&module=$currentModule&method=$currentMethod");
$output = "<div class='btn-group' id='swapper'><button data-toggle='dropdown' type='button' class='btn btn-limit' id='currentItem' title='{$currentProgramName}'>{$currentProgramName} <i class='icon icon-swap'></i></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>";
$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;
}
@@ -717,19 +716,20 @@ class programModel extends model
* @access public
* @return string
*/
public function getPGMTreeMenu($programID = 0, $productList = false)
public function getPGMTreeMenu($programID = 0, $from = 'program')
{
$programMenu = array();
$query = $this->dao->select('*')->from(TABLE_PROJECT)
->where('type')->eq('program')
->where('deleted')->eq('0')
->beginIF($from == 'program')->andWhere('type')->in('program,project')->fi()
->beginIF($from == 'product')->andWhere('type')->eq('program')->fi()
->beginIF(!$this->cookie->showClosed)->andWhere('status')->ne('closed')->fi()
->orderBy('grade desc, `order`')->get();
$stmt = $this->dbh->query($query);
$stmt = $this->dbh->query($query);
while($program = $stmt->fetch())
{
$link = helper::createLink('program', 'pgmview', "programID=$program->id", '', '', $program->id);
if($productList) $link = helper::createLink('product', 'productlist', "programID=$program->id", '', '', $program->id);
$link = $from == 'program' ? helper::createLink('program', 'pgmview', "programID=$program->id", '', '', $program->id) : helper::createLink('product', 'all', "programID=$program->id", '', '', $program->id);
$linkHtml = html::a($link, "<i class='icon icon-stack'></i> " . $program->name, '', "id='program$program->id'");
if(isset($programMenu[$program->id]) and !empty($programMenu[$program->id]))