* finish task#1366.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
$config->project = new stdclass();
|
||||
$config->project->defaultWorkhours = 7;
|
||||
$config->project->orderBy = 'isDone, `order`, status';
|
||||
$config->project->orderBy = 'isDone, status';
|
||||
$config->project->maxBurnDay = '30';
|
||||
|
||||
global $lang, $app;
|
||||
|
||||
@@ -1105,28 +1105,6 @@ class project extends control
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Order project
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function order($projectID)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$this->project->saveOrder();
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
$project = $this->commonAction($projectID);
|
||||
$this->project->setMenu($this->projects, $project->id);
|
||||
$this->view->title = $project->name . $this->lang->colon . $this->lang->project->order;
|
||||
$this->view->projects = $this->project->getList();
|
||||
$this->view->projectID = $project->id;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Send email.
|
||||
*
|
||||
|
||||
@@ -199,20 +199,6 @@ class projectModel extends model
|
||||
return $this->session->project;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save order
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function saveOrder()
|
||||
{
|
||||
foreach($_POST as $projectID => $order)
|
||||
{
|
||||
$this->dao->update(TABLE_PROJECT)->set('`order`')->eq($order)->where('id')->eq($projectID)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a project.
|
||||
*
|
||||
@@ -449,7 +435,7 @@ class projectModel extends model
|
||||
*/
|
||||
public function getPairs($mode = '')
|
||||
{
|
||||
$orderBy = !empty($this->config->project->orderBy) ? $this->config->project->orderBy : 'isDone, `order`, status';
|
||||
$orderBy = !empty($this->config->project->orderBy) ? $this->config->project->orderBy : 'isDone, status';
|
||||
$mode .= $this->cookie->projectMode;
|
||||
/* Order by status's content whether or not done */
|
||||
$projects = $this->dao->select('*, IF(INSTR(" done", status) < 2, 0, 1) AS isDone')->from(TABLE_PROJECT)
|
||||
@@ -503,7 +489,7 @@ class projectModel extends model
|
||||
->andWhere('t2.iscat')->eq(0)
|
||||
->beginIF($status == 'undone')->andWhere('t2.status')->ne('done')->fi()
|
||||
->beginIF($status != 'all' and $status != 'undone')->andWhere('status')->in($status)->fi()
|
||||
->orderBy('`order`, status')
|
||||
->orderBy('status')
|
||||
->beginIF($limit)->limit($limit)->fi()
|
||||
->fetchAll('id');
|
||||
}
|
||||
@@ -530,7 +516,6 @@ class projectModel extends model
|
||||
$list = $this->dao->select('t1.id, t1.name,t1.status, t2.product')->from(TABLE_PROJECT)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECTPRODUCT)->alias('t2')->on('t1.id = t2.project')
|
||||
->where('t1.deleted')->eq(0)
|
||||
->orderBy('t1.order')
|
||||
->fetchGroup('product');
|
||||
|
||||
$noProducts = array();
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The order view file of project module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2013 QingDao Nature Easy Soft Network Technology Co,LTD (www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Yidong Wang <yidong@cnezsoft.com>
|
||||
* @package project
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<table align='center' class='table-5'>
|
||||
<caption><?php echo $lang->project->unDoneProjects?></caption>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->project->id?></th>
|
||||
<th><?php echo $lang->project->name?></th>
|
||||
<th class='w-80px'><?php echo $lang->project->status?></th>
|
||||
<th class='w-80px'><?php echo $lang->project->order?></th>
|
||||
</tr>
|
||||
<?php foreach($projects as $project):?>
|
||||
<?php if($project->status == 'done') continue;?>
|
||||
<tr class='a-center'>
|
||||
<td><?php echo $project->id?></td>
|
||||
<td class='a-left'><?php echo $project->name?></td>
|
||||
<td><?php echo $lang->project->statusList[$project->status]?></td>
|
||||
<td><?php echo html::input($project->id, $project->order, "size='5'")?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
<tr><td colspan='4' align='center'><?php echo html::submitButton() . html::backButton()?></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<table align='center' class='table-5'>
|
||||
<caption><?php echo $lang->project->doneProjects?></caption>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->project->id?></th>
|
||||
<th><?php echo $lang->project->name?></th>
|
||||
<th class='w-80px'><?php echo $lang->project->order?></th>
|
||||
</tr>
|
||||
<?php foreach($projects as $project):?>
|
||||
<?php if($project->status != 'done') continue;?>
|
||||
<tr class='a-center'>
|
||||
<td><?php echo $project->id?></td>
|
||||
<td class='a-left'><?php echo $project->name?></td>
|
||||
<td><?php echo html::input($project->id, $project->order, "size='5'")?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
<tr><td colspan='3' align='center'><?php echo html::submitButton() . html::backButton()?></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
Reference in New Issue
Block a user