* Adjust the program and project operation buttons.
This commit is contained in:
@@ -219,11 +219,11 @@ class program extends control
|
||||
*/
|
||||
public function PGMClose($programID)
|
||||
{
|
||||
$program = $this->program->getPGMByID($programID);
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->loadModel('action');
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->loadModel('action');
|
||||
$changes = $this->project->close($programID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
@@ -237,14 +237,47 @@ class program extends control
|
||||
|
||||
$this->view->title = $this->lang->program->PGMClose;
|
||||
$this->view->position[] = $this->lang->program->PGMClose;
|
||||
|
||||
$this->view->project = $program;
|
||||
$this->view->project = $this->program->getPGMByID($programID);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->actions = $this->loadModel('action')->getList('program', $programID);
|
||||
$this->view->actions = $this->action->getList('program', $programID);
|
||||
|
||||
$this->display('project', 'close');
|
||||
}
|
||||
|
||||
/**
|
||||
* Start program.
|
||||
*
|
||||
* @param int $programID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function PGMStart($programID)
|
||||
{
|
||||
$this->lang->navGroup->program = 'program';
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->loadModel('action');
|
||||
$changes = $this->project->start($programID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
if($this->post->comment != '' or !empty($changes))
|
||||
{
|
||||
$actionID = $this->action->create('program', $programID, 'Started', $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
$this->executeHooks($programID);
|
||||
die(js::reload('parent.parent'));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->project->start;
|
||||
$this->view->position[] = $this->lang->project->start;
|
||||
$this->view->program = $this->program->getPGMByID($programID);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->actions = $this->loadModel('action')->getList('program', $programID);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate a program.
|
||||
*
|
||||
@@ -254,11 +287,12 @@ class program extends control
|
||||
*/
|
||||
public function PGMActivate($programID = 0)
|
||||
{
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$this->loadModel('action');
|
||||
$program = $this->program->getPGMByID($programID);
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->loadModel('action');
|
||||
$changes = $this->project->activate($programID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
@@ -276,10 +310,9 @@ class program extends control
|
||||
|
||||
$this->view->title = $this->lang->program->PGMActivate;
|
||||
$this->view->position[] = $this->lang->program->PGMActivate;
|
||||
|
||||
$this->view->program = $program;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->actions = $this->loadModel('action')->getList('program', $programID);
|
||||
$this->view->actions = $this->action->getList('program', $programID);
|
||||
$this->view->newBegin = $newBegin;
|
||||
$this->view->newEnd = $newEnd;
|
||||
$this->display();
|
||||
@@ -295,11 +328,10 @@ class program extends control
|
||||
public function PGMSuspend($programID)
|
||||
{
|
||||
$this->lang->navGroup->program = 'program';
|
||||
$program = $this->program->getPGMByID($programID);
|
||||
$this->loadModel('action');
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->loadModel('action');
|
||||
$changes = $this->project->suspend($programID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
@@ -315,8 +347,8 @@ class program extends control
|
||||
$this->view->title = $this->lang->project->suspend;
|
||||
$this->view->position[] = $this->lang->project->suspend;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->actions = $this->loadModel('action')->getList('project', $programID);
|
||||
$this->view->project = $program;
|
||||
$this->view->actions = $this->action->getList('program', $programID);
|
||||
$this->view->project = $this->program->getPGMByID($programID);
|
||||
|
||||
$this->display('project', 'suspend');
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ $lang->program->PGMCategory = 'Type';
|
||||
$lang->program->PGMDesc = 'Description';
|
||||
$lang->program->PGMCopy = 'Copy Program';
|
||||
$lang->program->PGMStatus = 'Status';
|
||||
$lang->program->PGMPM = 'Program manager';
|
||||
$lang->program->PGMPM = 'Manager';
|
||||
$lang->program->PGMBudget = 'Budget';
|
||||
$lang->program->PGMProgress = 'Progress';
|
||||
$lang->program->PGMChildren = 'Child';
|
||||
|
||||
@@ -211,7 +211,7 @@ $lang->program->PGMCategory = 'Type';
|
||||
$lang->program->PGMDesc = 'Description';
|
||||
$lang->program->PGMCopy = 'Copy Program';
|
||||
$lang->program->PGMStatus = 'Status';
|
||||
$lang->program->PGMPM = 'Program manager';
|
||||
$lang->program->PGMPM = 'Manager';
|
||||
$lang->program->PGMBudget = 'Budget';
|
||||
$lang->program->PGMProgress = 'Progress';
|
||||
$lang->program->PGMChildren = 'Child';
|
||||
|
||||
@@ -211,7 +211,7 @@ $lang->program->PGMCategory = 'Type';
|
||||
$lang->program->PGMDesc = 'Description';
|
||||
$lang->program->PGMCopy = 'Copy Program';
|
||||
$lang->program->PGMStatus = 'Status';
|
||||
$lang->program->PGMPM = 'Program manager';
|
||||
$lang->program->PGMPM = 'Manager';
|
||||
$lang->program->PGMBudget = 'Budget';
|
||||
$lang->program->PGMProgress = 'Progress';
|
||||
$lang->program->PGMChildren = 'Child';
|
||||
|
||||
@@ -211,7 +211,7 @@ $lang->program->PGMCategory = 'Type';
|
||||
$lang->program->PGMDesc = 'Description';
|
||||
$lang->program->PGMCopy = 'Copy Program';
|
||||
$lang->program->PGMStatus = 'Status';
|
||||
$lang->program->PGMPM = 'Program manager';
|
||||
$lang->program->PGMPM = 'Manager';
|
||||
$lang->program->PGMBudget = 'Budget';
|
||||
$lang->program->PGMProgress = 'Progress';
|
||||
$lang->program->PGMChildren = 'Child';
|
||||
|
||||
@@ -211,7 +211,7 @@ $lang->program->PGMCategory = '项目集类型';
|
||||
$lang->program->PGMDesc = '项目集描述';
|
||||
$lang->program->PGMCopy = '复制项目集';
|
||||
$lang->program->PGMStatus = '状态';
|
||||
$lang->program->PGMPM = '项目集负责人';
|
||||
$lang->program->PGMPM = '负责人';
|
||||
$lang->program->PGMBudget = '预算';
|
||||
$lang->program->PGMProgress = '项目进度';
|
||||
$lang->program->PGMChildren = '子项目集';
|
||||
|
||||
@@ -214,7 +214,7 @@ $lang->program->PGMCategory = '項目集類型';
|
||||
$lang->program->PGMDesc = '項目集描述';
|
||||
$lang->program->PGMCopy = '複製項目集';
|
||||
$lang->program->PGMStatus = '狀態';
|
||||
$lang->program->PGMPM = '項目集負責人';
|
||||
$lang->program->PGMPM = '負責人';
|
||||
$lang->program->PGMBudget = '預算';
|
||||
$lang->program->PGMProgress = '項目進度';
|
||||
$lang->program->PGMChildren = '子項目集';
|
||||
|
||||
@@ -556,6 +556,7 @@ class programModel extends model
|
||||
|
||||
if($action == 'pgmclose') return $program->status != 'closed';
|
||||
if($action == 'pgmactivate') return $program->status == 'done' or $program->status == 'closed';
|
||||
if($action == 'pgmsuspend') return $program->status == 'wait' or $program->status == 'doing';
|
||||
|
||||
if($action == 'prjstart') return $program->status == 'wait' or $program->status == 'suspended';
|
||||
if($action == 'prjfinish') return $program->status == 'wait' or $program->status == 'doing';
|
||||
|
||||
@@ -58,13 +58,15 @@
|
||||
<td><?php echo $program->end == LONG_TIME ? $lang->program->PRJLongTime : $program->end;?></td>
|
||||
<td class='c-actions'>
|
||||
<?php if($program->type == 'program'):?>
|
||||
<?php common::printIcon('program', 'PRJStart', "programID=$program->id", $program, 'list', 'play', '', 'iframe', true, '', $this->lang->program->PGMStart);?>
|
||||
<?php if($program->status == 'wait' || $program->status == 'suspended') common::printIcon('program', 'PGMStart', "programID=$program->id", $program, 'list', 'play', '', 'iframe', true, '', $this->lang->program->PGMStart);?>
|
||||
<?php if($program->status == 'doing') common::printIcon('program', 'PGMClose', "programID=$program->id", $program, 'list', 'off', '', 'iframe', true);?>
|
||||
<?php if($program->status == 'closed') common::printIcon('program', 'PGMActivate', "programID=$program->id", $program, 'list', 'magic', '', 'iframe', true);?>
|
||||
<div class='btn-group'>
|
||||
<button type='button' class='btn icon-caret-down dropdown-toggle' data-toggle='dropdown' title="<?php echo $this->lang->more;?>"></button>
|
||||
<ul class='dropdown-menu pull-right' role='menu'>
|
||||
<?php common::printIcon('program', 'PGMActivate', "programID=$program->id", $program, 'list', 'magic', '', 'iframe', true);?>
|
||||
<ul class='dropdown-menu pull-right text-center' role='menu'>
|
||||
<?php common::printIcon('program', 'PGMSuspend', "programID=$program->id", $program, 'list', 'pause', '', 'iframe', true, '', $this->lang->program->PGMSuspend);?>
|
||||
<?php common::printIcon('program', 'PGMClose', "programID=$program->id", $program, 'list', 'off', '', 'iframe', true);?>
|
||||
<?php if($program->status != 'doing') common::printIcon('program', 'PGMClose', "programID=$program->id", $program, 'list', 'off', '', 'iframe', true);?>
|
||||
<?php if($program->status != 'closed') common::printIcon('program', 'PGMActivate', "programID=$program->id", $program, 'list', 'magic', '', 'iframe', true);?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php if(common::hasPriv('program', 'PGMEdit')) echo html::a($this->createLink("program", "pgmedit", "programID=$program->id"), "<i class='icon-edit'></i>", '', "class='btn' title='{$this->lang->program->PGMEdit}'");?>
|
||||
@@ -72,13 +74,15 @@
|
||||
<?php if(common::hasPriv('program', 'PGMDelete')) echo html::a($this->createLink("program", "pgmdelete", "programID=$program->id"), "<i class='icon-trash'></i>", 'hiddenwin', "class='btn' title='{$this->lang->program->PGMDelete}'");?>
|
||||
|
||||
<?php else:?>
|
||||
<?php common::printIcon('program', 'PRJStart', "projectID=$program->id", $program, 'list', 'play', '', 'iframe', true);?>
|
||||
<?php if($program->status == 'wait' || $program->status == 'suspended') common::printIcon('program', 'PRJStart', "projectID=$program->id", $program, 'list', 'play', '', 'iframe', true);?>
|
||||
<?php if($program->status == 'doing') common::printIcon('program', 'PRJClose', "projectID=$program->id", $program, 'list', 'off', '', 'iframe', true);?>
|
||||
<?php if($program->status == 'closed') common::printIcon('program', 'PRJActivate', "projectID=$program->id", $program, 'list', 'magic', '', 'iframe', true);?>
|
||||
<div class='btn-group'>
|
||||
<button type='button' class='btn icon-caret-down dropdown-toggle' data-toggle='dropdown' title="<?php echo $this->lang->more;?>"></button>
|
||||
<ul class='dropdown-menu pull-right' role='menu'>
|
||||
<?php common::printIcon('program', 'PRJActivate', "projectID=$program->id", $program, 'list', 'magic', '', 'iframe', true);?>
|
||||
<ul class='dropdown-menu pull-right text-center' role='menu'>
|
||||
<?php common::printIcon('program', 'PRJSuspend', "projectID=$program->id", $program, 'list', 'pause', '', 'iframe', true);?>
|
||||
<?php common::printIcon('program', 'PRJClose', "projectID=$program->id", $program, 'list', 'off', '', 'iframe', true);?>
|
||||
<?php if($program->status != 'doing') common::printIcon('program', 'PRJClose', "projectID=$program->id", $program, 'list', 'off', '', 'iframe', true);?>
|
||||
<?php if($program->status != 'closed') common::printIcon('program', 'PRJActivate', "projectID=$program->id", $program, 'list', 'magic', '', 'iframe', true);?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php if(common::hasPriv('program','PRJEdit')) echo html::a($this->createLink("program", "prjedit", "projectID=$program->id"), "<i class='icon-edit'></i>", '', "class='btn' title='{$this->lang->program->PRJEdit}'");?>
|
||||
@@ -86,7 +90,7 @@
|
||||
<?php common::printIcon('program', 'PRJGroup', "projectID=$program->id", $program, 'list', 'icon icon-lock');?>
|
||||
<div class='btn-group'>
|
||||
<button type='button' class='btn icon-more-circle dropdown-toggle' data-toggle='dropdown' title="<?php echo $this->lang->more;?>"></button>
|
||||
<ul class='dropdown-menu pull-right' role='menu'>
|
||||
<ul class='dropdown-menu pull-right text-center' role='menu'>
|
||||
<?php common::printIcon('program', 'PRJManageProducts', "projectID=$program->id", $program, 'list', 'icon icon-menu-project');?>
|
||||
<?php common::printIcon('program', 'PRJWhitelist', "projectID=$program->id", $program, 'list', 'group');?>
|
||||
<?php if(common::hasPriv('program','PRJDelete')) echo html::a($this->createLink("program", "prjdelete", "projectID=$program->id"), "<i class='icon-trash'></i>", 'hiddenwin', "class='btn' title='{$this->lang->program->PRJDelete}'");?>
|
||||
@@ -104,7 +108,6 @@
|
||||
#programTableList.sortable-sorting > tr.drag-row {opacity: 1;}
|
||||
#programTableList > tr.drop-not-allowed {opacity: 0.1!important}
|
||||
#programList .c-actions {overflow: visible;}
|
||||
#programList .c-actions .dropdown-menu {padding-right: 8px; margin-top: -4px;}
|
||||
#programTableList > tr:last-child .c-actions .dropdown-menu {top: auto; bottom: 100%; margin-bottom: -5px;}
|
||||
</style>
|
||||
<?php js::set('originOrders', $originOrders);?>
|
||||
|
||||
50
module/program/view/pgmstart.html.php
Normal file
50
module/program/view/pgmstart.html.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* The prjstart view file of program 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 Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package program
|
||||
* @version $Id: prjstart.html.php 4769 2013-05-05 07:24:21Z wwccss $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='main-header'>
|
||||
<h2>
|
||||
<span class='prefix label-id'><strong><?php echo $program->id;?></strong></span>
|
||||
<?php echo isonlybody() ? ("<span title='$program->name'>" . $program->name . '</span>') : html::a($this->createLink('project', 'view', 'project=' . $program->id), $program->name, '_blank');?>
|
||||
<?php if(!isonlybody()):?>
|
||||
<small><?php echo $lang->arrow . $lang->project->start;?></small>
|
||||
<?php endif;?>
|
||||
</h2>
|
||||
</div>
|
||||
<form class='load-indicator main-form' method='post' target='hiddenwin'>
|
||||
<table class='table table-form'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class='w-100px'><?php echo $lang->program->realBegan;?></th>
|
||||
<td><?php echo html::input('realBegan', helper::today(), "class='form-control form-date'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='w-40px'><?php echo $lang->comment;?></th>
|
||||
<td colspan='2'><?php echo html::textarea('comment', '', "rows='6' class='form-control kindeditor' hidefocus='true'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='3' class='text-center form-actions'>
|
||||
<?php echo html::submitButton($lang->project->start);?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<hr class='small' />
|
||||
<div class='main'>
|
||||
<?php include '../../common/view/action.html.php';?>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
Reference in New Issue
Block a user