* Finish task #56455.
This commit is contained in:
@@ -15,3 +15,21 @@ $config->productplan->editor->view = array('id' => 'lastComment', 'tools' => '
|
||||
$config->productplan->laneColorList = array('#32C5FF', '#006AF1', '#9D28B2', '#FF8F26', '#FFC20E', '#00A78E', '#7FBB00', '#424BAC', '#C0E9FF', '#EC2761');
|
||||
|
||||
$config->productplan->future = '2030-01-01';
|
||||
|
||||
global $app, $lang;
|
||||
$app->loadLang('productplan');
|
||||
$config->productplan->search['module'] = 'productplan';
|
||||
|
||||
$config->productplan->search['fields']['id'] = $lang->productplan->id;
|
||||
$config->productplan->search['fields']['title'] = $lang->productplan->title;
|
||||
$config->productplan->search['fields']['branch'] = $lang->productplan->branch;
|
||||
$config->productplan->search['fields']['status'] = $lang->productplan->status;
|
||||
$config->productplan->search['fields']['begin'] = $lang->productplan->begin;
|
||||
$config->productplan->search['fields']['end'] = $lang->productplan->end;
|
||||
|
||||
$config->productplan->search['params']['id'] = array('operator' => '=', 'control' => 'input', 'values' => '');
|
||||
$config->productplan->search['params']['title'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
|
||||
$config->productplan->search['params']['branch'] = array('operator' => '=', 'control' => 'select', 'values' => '');
|
||||
$config->productplan->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->productplan->statusList);
|
||||
$config->productplan->search['params']['begin'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
|
||||
$config->productplan->search['params']['end'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
|
||||
|
||||
@@ -283,15 +283,16 @@ class productplan extends control
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param string $orderBy
|
||||
* @param string $browseType
|
||||
* @param int $queryID
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function browse($productID = 0, $branch = '', $browseType = 'undone', $orderBy = 'begin_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1 )
|
||||
public function browse($productID = 0, $branch = '', $browseType = 'undone', $queryID = 0, $orderBy = 'begin_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1 )
|
||||
{
|
||||
$branchID = $branch === '' ? 'all' : $branch;
|
||||
if(!$branch) $branch = 0;
|
||||
@@ -313,6 +314,11 @@ class productplan extends control
|
||||
$branchStatusList = array();
|
||||
foreach($branchList as $productBranch) $branchStatusList[$productBranch->id] = $productBranch->status;
|
||||
|
||||
/* Build the search form. */
|
||||
$queryID = $browseType == 'bySearch' ? (int)$queryID : 0;
|
||||
$actionURL = $this->createLink('productplan', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=$queryID&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID");
|
||||
$this->productplan->buildSearchForm($queryID, $actionURL, $productID);
|
||||
|
||||
if($viewType == 'kanban')
|
||||
{
|
||||
$branches = array();
|
||||
@@ -353,10 +359,11 @@ class productplan extends control
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->viewType = $viewType;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->plans = $this->productplan->getList($productID, $branch, $browseType, $pager, $sort);
|
||||
$this->view->plans = $this->productplan->getList($productID, $branch, $browseType, $pager, $sort, "", $queryID);
|
||||
$this->view->pager = $pager;
|
||||
$this->view->projects = $this->product->getProjectPairsByProduct($productID, $branch);
|
||||
$this->view->statusList = $this->lang->productplan->featureBar['browse'];
|
||||
$this->view->queryID = $queryID;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* The model file of productplan 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) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package productplan
|
||||
* @version $Id: model.php 4639 2013-04-11 02:06:35Z chencongzhi520@gmail.com $
|
||||
@@ -78,14 +78,35 @@ class productplanModel extends model
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getList($product = 0, $branch = 0, $browseType = 'undone', $pager = null, $orderBy = 'begin_desc', $param = '')
|
||||
public function getList($product = 0, $branch = 0, $browseType = 'undone', $pager = null, $orderBy = 'begin_desc', $param = '', $queryID = 0)
|
||||
{
|
||||
if(!empty($queryID))
|
||||
{
|
||||
$query = $this->loadModel('search')->getQuery($queryID);
|
||||
if($query)
|
||||
{
|
||||
$this->session->set('productplanQuery', $query->sql);
|
||||
$this->session->set('productplanForm', $query->form);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set('productplanQuery', ' 1 = 1');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if($this->session->productplanQuery == false) $this->session->set('productplanQuery', ' 1 = 1');
|
||||
}
|
||||
|
||||
$productplanQuery = $this->session->productplanQuery;
|
||||
|
||||
$date = date('Y-m-d');
|
||||
$plans = $this->dao->select('*')->from(TABLE_PRODUCTPLAN)->where('product')->eq($product)
|
||||
->andWhere('deleted')->eq(0)
|
||||
->beginIF(!empty($branch) and $branch != 'all')->andWhere('branch')->eq($branch)->fi()
|
||||
->beginIF(strpos(',all,undone,', ",$browseType,") === false)->andWhere('status')->eq($browseType)->fi()
|
||||
->beginIF(strpos(',all,undone,bySearch,', ",$browseType,") === false)->andWhere('status')->eq($browseType)->fi()
|
||||
->beginIF($browseType == 'undone')->andWhere('status')->in('wait,doing')->fi()
|
||||
->beginIF($browseType == 'bySearch')->andWhere($productplanQuery)->fi()
|
||||
->beginIF(strpos($param, 'skipparent') !== false)->andWhere('parent')->ne(-1)->fi()
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
@@ -1182,4 +1203,22 @@ class productplanModel extends model
|
||||
|
||||
return $menu;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build search form.
|
||||
*
|
||||
* @param int $queryID
|
||||
* @param string $actionURL
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function buildSearchForm($queryID, $actionURL, $productID)
|
||||
{
|
||||
$this->config->productplan->search['actionURL'] = $actionURL;
|
||||
$this->config->productplan->search['queryID'] = $queryID;
|
||||
|
||||
$this->config->productplan->search['params']['branch']['values'] = array('' => '', '0' => $this->lang->branch->main) + $this->loadModel('branch')->getPairs($productID, 'noempty');
|
||||
$this->loadModel('search')->setSearchParams($this->config->productplan->search);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
<?php $active = $menuItem->name == $browseType ? 'btn-active-text' : '';?>
|
||||
<?php echo html::a($this->inlink('browse', "productID=$productID&branch=&browseType={$menuItem->name}"), $label, '', "class='btn btn-link $active' id='{$menuItem->name}'");?>
|
||||
<?php endforeach;?>
|
||||
<a class="btn btn-link querybox-toggle" id='bysearchTab'><i class="icon icon-search muted"></i><?php echo $lang->searchAB;?></a>
|
||||
</div>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<div class="btn-group panel-actions">
|
||||
@@ -30,6 +31,7 @@
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell<?php if($browseType == 'bySearch') echo ' show';?>" id="queryBox" data-module='productplan'></div>
|
||||
<div id="mainContent">
|
||||
<?php if(empty($plans)):?>
|
||||
<div class="table-empty-tip">
|
||||
@@ -44,7 +46,7 @@
|
||||
<form class='main-table table-productplan' data-ride='table' method='post' id='productplanForm' action='<?php echo inlink('batchEdit', "productID=$product->id&branch=$branch")?>'>
|
||||
<table class='table has-sort-head' id="productplanList">
|
||||
<thead>
|
||||
<?php $vars = "productID=$productID&branch=$branch&browseType=$browseType&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
|
||||
<?php $vars = "productID=$productID&branch=$branch&browseType=$browseType&queryID=$queryID&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
|
||||
<tr>
|
||||
<th class='c-id'>
|
||||
<?php if(common::hasPriv('productplan', 'batchEdit') or common::hasPriv('productplan', 'batchChangeStatus')):?>
|
||||
|
||||
Reference in New Issue
Block a user