* Finish task #7119.

This commit is contained in:
Yagami
2020-05-06 11:13:13 +08:00
parent bf33d10b9d
commit 6d1a047b02
17 changed files with 904 additions and 18 deletions
+5
View File
@@ -0,0 +1,5 @@
ALTER TABLE `zt_project`
CHANGE `type` `type` varchar(20) COLLATE 'utf8_general_ci' NOT NULL DEFAULT 'waterfall' AFTER `catID`,
ADD `program` mediumint(8) NOT NULL DEFAULT '0' AFTER `type`,
ADD `budget` varchar(30) NOT NULL DEFAULT '0' AFTER `program`,
ADD `budgetUnit` char(30) NOT NULL DEFAULT 'yuan' AFTER `budget`;
+9 -8
View File
@@ -1,14 +1,15 @@
<?php
/* Sort of main menu. */
$lang->menuOrder[5] = 'my';
$lang->menuOrder[10] = 'product';
$lang->menuOrder[15] = 'project';
$lang->menuOrder[20] = 'qa';
$lang->menuOrder[25] = 'ci';
$lang->menuOrder[30] = 'doc';
$lang->menuOrder[35] = 'report';
$lang->menuOrder[40] = 'company';
$lang->menuOrder[45] = 'admin';
$lang->menuOrder[10] = 'program';
$lang->menuOrder[15] = 'product';
$lang->menuOrder[20] = 'project';
$lang->menuOrder[25] = 'qa';
$lang->menuOrder[30] = 'ci';
$lang->menuOrder[35] = 'doc';
$lang->menuOrder[40] = 'report';
$lang->menuOrder[45] = 'company';
$lang->menuOrder[50] = 'admin';
/* index menu order. */
$lang->index->menuOrder[5] = 'product';
+28 -8
View File
@@ -118,17 +118,20 @@ $lang->common = new stdclass();
$lang->common->common = '公有模块';
/* 主导航菜单。*/
$lang->menu = new stdclass();
$lang->menu->my = '<i class="icon icon-menu-my"></i> 地盘|my|index';
$lang->menu->product = '<i class="icon icon-menu-project"></i> 项目|product|index|locate=no';
$lang->menu->doc = '<i class="icon icon-menu-doc"></i> 文档|doc|index';
$lang->menu->report = '<i class="icon icon-menu-report"></i> 报表|report|index';
$lang->menu->company = '<i class="icon icon-menu-users"></i> 组织|company|index';
$lang->menu->admin = '<i class="icon icon-menu-backend"></i> 后台|admin|index';
$lang->menu->recent = '<i class="icon icon-menu-recent"></i> 近期|recent|index';
$lang->mainNav = new stdclass();
$lang->mainNav->my = '<i class="icon icon-menu-my"></i> 地盘|my|index|';
$lang->mainNav->program = '<i class="icon icon-menu-project"></i> 项目|program|index|';
$lang->mainNav->doc = '<i class="icon icon-menu-doc"></i> 文档|doc|index|';
$lang->mainNav->report = '<i class="icon icon-menu-report"></i> 报表|report|index|';
$lang->mainNav->company = '<i class="icon icon-menu-users"></i> 组织|company|index|';
$lang->mainNav->admin = '<i class="icon icon-menu-backend"></i> 后台|admin|index|';
$lang->mainNav->recent = '<i class="icon icon-menu-recent"></i> 近期|recent|index|';
$lang->dividerMenu = ',admin,recent,';
$lang->menu = new stdclass();
$lang->menu->project = new stdclass();
/* 查询条中可以选择的对象列表。*/
$lang->searchObjects['bug'] = 'Bug';
$lang->searchObjects['story'] = "{$lang->storyCommon}";
@@ -501,6 +504,23 @@ $lang->menugroup->jenkins = 'ci';
$lang->menugroup->compile = 'ci';
$lang->menugroup->job = 'ci';
$lang->navGroup = array();
$lang->navGroup['product'] = 'program';
$lang->navGroup['story'] = 'program';
$lang->navGroup['productplan'] = 'program';
$lang->navGroup['release'] = 'program';
$lang->navGroup['tree'] = 'program';
$lang->navGroup['project'] = 'program';
$lang->navGroup['task'] = 'program';
$lang->navGroup['qa'] = 'program';
$lang->navGroup['bug'] = 'program';
$lang->navGroup['testcase'] = 'program';
$lang->navGroup['testtask'] = 'program';
$lang->navGroup['testreport'] = 'program';
$lang->navGroup['testsuite'] = 'program';
$lang->navGroup['caselib'] = 'program';
$lang->navGroup['feedback'] = 'program';
/* 错误提示信息。*/
$lang->error = new stdclass();
$lang->error->companyNotFound = "您访问的域名 %s 没有对应的公司。";
+26
View File
@@ -437,6 +437,32 @@ class commonModel extends model
}
}
/**
* Print the main nav.
*
* @param string $moduleName
* @param string $methodName
*
* @static
* @access public
* @return void
*/
public static function printMainNav($moduleName, $methodName = '')
{
global $app, $lang;
echo "<ul class='nav nav-default'>\n";
foreach($lang->mainNav as $group => $nav)
{
$active = '';
list($title, $currentModule, $currentMethod, $vars) = explode('|', $nav);
if($moduleName == $group) $active = 'active';
if(zget($lang->navGroup, $moduleName, '') == $group) $active = 'active';
if(common::hasPriv($currentModule, $currentMethod)) echo "<li class=$active>" . html::a(helper::createLink($currentModule, $currentMethod, $vars), $title) . '</li>';
}
echo "</ul>\n";
}
/**
* Print the main menu.
*
+5 -2
View File
@@ -14,12 +14,13 @@ if($extHookFiles) foreach($extHookFiles as $extHookFile) include $extHookFile;
<?php if(empty($_GET['onlybody']) or $_GET['onlybody'] != 'yes'):?>
<?php $this->app->loadConfig('sso');?>
<?php if(!empty($config->sso->redirect)) js::set('ssoRedirect', $config->sso->redirect);?>
<?php $isProgram = (isset($lang->navGroup[$moduleName]) && $lang->navGroup[$this->moduleName] == 'program');?>
<div id='menu'>
<div id='menuHeader'>
<?php $heading = $app->company->name;?>
<h1 id='companyName' title='<?php echo $heading;?>'<?php if(strlen($heading) > 36) echo " class='long-name'" ?>><?php echo html::a(helper::createLink('index'), $heading);?></h1>
</div>
<nav id='menuNav'><?php commonModel::printMainmenu($this->moduleName);?></nav>
<nav id='menuNav'><?php commonModel::printMainNav($this->moduleName);?></nav>
<div id='menuFooter'>
<button type='button' id='menuToggle'><i class='icon icon-sm icon-menu-collapse'></i></button>
</div>
@@ -30,7 +31,7 @@ if($extHookFiles) foreach($extHookFiles as $extHookFile) include $extHookFile;
<hgroup id='heading'>
<h1 id='companyname' title='<?php echo $heading;?>'<?php if(strlen($heading) > 36) echo " class='long-name'" ?>><?php echo html::a(helper::createLink('index'), $heading);?></h1>
</hgroup>
<nav id='navbar'><?php commonModel::printMainmenu($this->moduleName);?></nav>
<nav id='navbar'><?php $isProgram ? commonModel::printMainmenu($this->moduleName) : common::printModuleMenu($this->moduleName);?></nav>
<div id='toolbar'>
<div id="userMenu">
<?php common::printSearchBox();?>
@@ -41,6 +42,7 @@ if($extHookFiles) foreach($extHookFiles as $extHookFile) include $extHookFile;
</div>
</div>
</div>
<?php if($isProgram):?>
<div id='subHeader'>
<div class='container'>
<div id="pageNav" class='btn-toolbar'><?php if(isset($lang->modulePageNav)) echo $lang->modulePageNav;?></div>
@@ -48,6 +50,7 @@ if($extHookFiles) foreach($extHookFiles as $extHookFile) include $extHookFile;
<div id="pageActions"><div class='btn-toolbar'><?php if(isset($lang->modulePageActions)) echo $lang->modulePageActions;?></div></div>
</div>
</div>
<?php endif;?>
<?php
if(!empty($config->sso->redirect))
{
+10
View File
@@ -0,0 +1,10 @@
<?php
$config->program = new stdclass();
$config->program->editor = new stdclass();
$config->program->editor->create = array('id' => 'desc', 'tools' => 'simpleTools');
$config->program->editor->edit = array('id' => 'desc', 'tools' => 'simpleTools');
$config->program->editor->close = array('id' => 'comment', 'tools' => 'simpleTools');
$config->program->editor->start = array('id' => 'comment', 'tools' => 'simpleTools');
$config->program->editor->activate = array('id' => 'comment', 'tools' => 'simpleTools');
$config->program->editor->finish = array('id' => 'comment', 'tools' => 'simpleTools');
$config->program->editor->suspend = array('id' => 'comment', 'tools' => 'simpleTools');
+262
View File
@@ -0,0 +1,262 @@
<?php
class program extends control
{
public function __construct($moduleName = '', $methodName = '')
{
parent::__construct($moduleName, $methodName);
$this->loadModel('project');
}
public function index($status = 'all', $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 10, $pageID = 1)
{
if(common::hasPriv('program', 'create')) $this->lang->pageActions = html::a($this->createLink('program', 'create'), "<i class='icon icon-sm icon-plus'></i> " . $this->lang->program->create, '', "class='btn btn-primary'");
//$programType = $this->cookie->programType;
$programType = 'bylist';
if($programType == 'bylist')
{
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$projectList = $this->project->getProjectStats($status, 0, 0, 30, $orderBy, $pager, 'program');
$this->view->pager = $pager;
}
if(!$programType || $programType == 'bygrid') $projectList = $this->project->getList($status, 0, 0, 0, 'program');
$this->view->projectList = $projectList;
$this->view->status = $status;
$this->view->orderBy = $orderBy;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->title = $this->lang->program->index;
$this->view->position[] = $this->lang->program->index;
$this->view->programType = $programType;
$this->display();
}
public function create()
{
if($_POST)
{
$projectID = $this->program->create();
if(dao::isError())
{
$this->send(array('result' => 'fail', 'message' => $this->processErrors(dao::getError())));
}
$this->loadModel('action')->create('project', $projectID, 'opened');
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('index')));
}
$this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst');
$this->view->title = $this->lang->program->create;
$this->view->position[] = $this->lang->program->create;
$this->view->groups = $this->loadModel('group')->getPairs();
$this->display();
}
public function edit($projectID = 0)
{
$project = $this->project->getByID($projectID);
if($_POST)
{
$changes = $this->project->update($projectID);
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => $this->processErrors(dao::getError())));
if($changes)
{
$actionID = $this->loadModel('action')->create('project', $projectID, 'edited');
$this->action->logHistory($actionID, $changes);
}
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('index')));
}
$this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst', $project->PM);
$this->view->title = $this->lang->project->edit;
$this->view->position[] = $this->lang->project->edit;
$this->view->project = $project;
$this->view->groups = $this->loadModel('group')->getPairs();
$this->display();
}
/**
* Start project.
*
* @param int $projectID
* @access public
* @return void
*/
public function start($projectID)
{
$project = $this->project->getByID($projectID);
$projectID = $project->id;
if(!empty($_POST))
{
$this->loadModel('action');
$changes = $this->project->start($projectID);
if(dao::isError()) die(js::error(dao::getError()));
if($this->post->comment != '' or !empty($changes))
{
$actionID = $this->action->create('project', $projectID, 'Started', $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
$this->executeHooks($projectID);
die(js::reload('parent.parent'));
}
$this->view->title = $this->lang->project->start;
$this->view->position[] = $this->lang->project->start;
$this->view->project = $project;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->actions = $this->loadModel('action')->getList('project', $projectID);
$this->display();
}
/**
* Finish project.
*
* @param int $projectID
* @access public
* @return void
*/
public function finish($projectID)
{
$project = $this->project->getByID($projectID);
$projectID = $project->id;
if(!empty($_POST))
{
$this->loadModel('action');
$changes = $this->project->finish($projectID);
if(dao::isError()) die(js::error(dao::getError()));
if($this->post->comment != '' or !empty($changes))
{
$actionID = $this->action->create('project', $projectID, 'Finished', $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
$this->executeHooks($projectID);
die(js::reload('parent.parent'));
}
$this->view->title = $this->lang->project->finish;
$this->view->position[] = $this->lang->project->finish;
$this->view->project = $project;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->actions = $this->loadModel('action')->getList('project', $projectID);
$this->display();
}
public function delete($projectID, $confirm = 'no')
{
if($confirm == 'no')
{
echo js::confirm(sprintf($this->lang->project->confirmDelete, $this->projects[$projectID]), $this->createLink('project', 'delete', "projectID=$projectID&confirm=yes"));
exit;
}
else
{
$this->project->delete(TABLE_PROJECT, $projectID);
die(js::locate(inlink('index'), 'parent'));
}
}
public function suspend($projectID)
{
$project = $this->project->getByID($projectID);
if(!empty($_POST))
{
$this->loadModel('action');
$changes = $this->project->suspend($projectID);
if(dao::isError()) die(js::error(dao::getError()));
if($this->post->comment != '' or !empty($changes))
{
$actionID = $this->action->create('project', $projectID, 'Suspended', $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
$this->executeHooks($projectID);
die(js::reload('parent.parent'));
}
$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', $projectID);
$this->view->project = $project;
$this->display('project', 'suspend');
}
public function activate($projectID)
{
$project = $this->project->getByID($projectID);
if(!empty($_POST))
{
$this->loadModel('action');
$changes = $this->project->activate($projectID);
if(dao::isError()) die(js::error(dao::getError()));
if($this->post->comment != '' or !empty($changes))
{
$actionID = $this->action->create('project', $projectID, 'Activated', $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
$this->executeHooks($projectID);
die(js::reload('parent.parent'));
}
$newBegin = date('Y-m-d');
$dateDiff = helper::diffDate($newBegin, $project->begin);
$newEnd = date('Y-m-d', strtotime($project->end) + $dateDiff * 24 * 3600);
$this->view->title = $this->lang->project->activate;
$this->view->position[] = $this->lang->project->activate;
$this->view->project = $project;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->actions = $this->loadModel('action')->getList('project', $projectID);
$this->view->newBegin = $newBegin;
$this->view->newEnd = $newEnd;
$this->view->project = $project;
$this->display('project', 'activate');
}
public function close($projectID)
{
$project = $this->project->getByID($projectID);
if(!empty($_POST))
{
$this->loadModel('action');
$changes = $this->project->close($projectID);
if(dao::isError()) die(js::error(dao::getError()));
if($this->post->comment != '' or !empty($changes))
{
$actionID = $this->action->create('project', $projectID, 'Closed', $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
$this->executeHooks($projectID);
die(js::reload('parent.parent'));
}
$this->view->title = $this->lang->project->close;
$this->view->position[] = $this->lang->project->close;
$this->view->project = $project;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->actions = $this->loadModel('action')->getList('project', $projectID);
$this->display('project', 'close');
}
public function processErrors($errors)
{
foreach($errors as $field => $error)
{
$errors[$field] = str_replace($this->lang->program->stage, $this->lang->program->common, $error);
}
return $errors;
}
}
+7
View File
@@ -0,0 +1,7 @@
#whitelistBox .checkbox-inline, #whitelistBox .radio-inline
{
margin-left: 10px;
display: inline-block;
padding-left: 0px;
padding-right: 10px;
}
+3
View File
@@ -0,0 +1,3 @@
.panel-title {height:55px; padding:10px;}
.main-table.flow-block {height:203px;}
.main-table.panel-heading > strong,.main-table.panel-heading > span {margin-bottom:5px}
+16
View File
@@ -0,0 +1,16 @@
$().ready(function()
{
$('#navbar').find('li').removeClass('active');
if(typeof(status) == 'undefined' || !status) status = 'all';
$('#navbar').find('a[href*=' + status + ']').parent().addClass('active');
});
function setWhite(acl)
{
acl == 'custom' ? $('#whitelistBox').removeClass('hidden') : $('#whitelistBox').addClass('hidden');
}
function setProgramType(type)
{
$.cookie('programType', type, {expires:config.cookieLife, path:config.webRoot});
location.href = location.href;
}
+35
View File
@@ -0,0 +1,35 @@
<?php
$lang->program->index = '项目主页';
$lang->program->common = '项目';
$lang->program->stage = '阶段';
$lang->program->name = '项目名称';
$lang->program->type = '项目类型';
$lang->program->desc = '项目描述';
$lang->program->code = '项目代号';
$lang->program->begin = '计划开始日期';
$lang->program->end = '计划完成日期';
$lang->program->PM = '项目负责人';
$lang->program->create = '添加项目';
$lang->program->edit = '编辑项目';
$lang->program->all = '所有项目';
$lang->program->start = '启动';
$lang->program->finish = '完成';
$lang->program->suspend = '挂起';
$lang->program->delete = '删除';
$lang->program->close = '关闭';
$lang->program->activate = '激活';
$lang->program->budget = '项目预算';
$lang->program->dateRange = '起止时间';
$lang->program->to = '至';
$lang->program->realFinished = '实际完成日期';
$lang->program->realStarted = '实际开始日期';
$lang->program->durationEstimation = '工作量估算';
$lang->program->noProgram = '暂时没有项目';
$lang->program->unitList[''] = '';
$lang->program->unitList['yuan'] = '元';
$lang->program->unitList['dollar'] = 'Dollars';
$lang->program->typeList['scrum'] = "Scrum";
$lang->program->typeList['cmmi'] = "瀑布";
+90
View File
@@ -0,0 +1,90 @@
<?php
class programModel extends model
{
public function create()
{
$this->lang->project->team = $this->lang->project->teamname;
$project = fixer::input('post')
->setDefault('status', 'wait')
->setDefault('type', 'program')
->setIF($this->post->acl != 'custom', 'whitelist', '')
->setDefault('openedBy', $this->app->user->account)
->setDefault('openedDate', helper::now())
->setDefault('team', substr($this->post->name,0, 30))
->join('whitelist', ',')
->cleanInt('budget')
->stripTags($this->config->project->editor->create['id'], $this->config->allowedTags)
->remove('products, workDays, delta, branch, uid, plans')
->get();
$project = $this->loadModel('file')->processImgURL($project, $this->config->project->editor->create['id'], $this->post->uid);
$this->dao->insert(TABLE_PROJECT)->data($project)
->autoCheck()
->batchcheck($this->config->project->create->requiredFields, 'notempty')
->check('name', 'unique', "deleted='0'")
->check('code', 'unique', "deleted='0'")
->exec();
/* Add the creater to the team. */
if(!dao::isError())
{
$projectID = $this->dao->lastInsertId();
$today = helper::today();
/* Save order. */
$this->dao->update(TABLE_PROJECT)->set('`order`')->eq($projectID * 5)->where('id')->eq($projectID)->exec();
$this->file->updateObjectID($this->post->uid, $projectID, 'project');
$product = new stdclass();
$product->name = $project->name;
$product->project = $projectID;
$product->status = 'normal';
$product->createdBy = $this->app->user->account;
$product->createdDate = helper::now();
$this->dao->insert(TABLE_PRODUCT)->data($product)->exec();
$productID = $this->dao->lastInsertId();
$this->dao->update(TABLE_PRODUCT)->set('`order`')->eq($productID * 5)->where('id')->eq($productID)->exec();
/* Create doc lib. */
$this->app->loadLang('doc');
$lib = new stdclass();
$lib->product = $productID;
$lib->name = $this->lang->doclib->main['product'];
$lib->type = 'product';
$lib->main = '1';
$lib->acl = 'default';
$this->dao->insert(TABLE_DOCLIB)->data($lib)->exec();
$docLibID = $this->dao->lastInsertId();
$this->loadModel('doc')->syncDocModule($docLibID);
/* Insert into projectproduct. */
//$data = new stdclass();
//$data->project = $projectID;
//$data->product = $productID;
//$this->dao->insert(TABLE_PROJECTPRODUCT)->data($data)->exec();
return $projectID;
}
}
public static function isClickable($project, $action)
{
$action = strtolower($action);
if($action == 'start') return $project->status == 'wait' or $project->status == 'suspended';
if($action == 'finish') return $project->status == 'wait' or $project->status == 'doing';
if($action == 'close') return $project->status != 'closed';
if($action == 'suspend') return $project->status == 'wait' or $project->status == 'doing';
if($action == 'activate') return $project->status == 'done';
return true;
}
public function getProducts($program)
{
return $this->dao->select('*')->from(TABLE_PRODUCT)->where('project')->eq($program)->fetchAll('id');
}
}
+114
View File
@@ -0,0 +1,114 @@
<?php
/**
* The create view of project 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 project
* @version $Id: create.html.php 4728 2013-05-03 06:14:34Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
?>
<?php if(isset($tips)):?>
<?php $defaultURL = $this-> createLink('project', 'task', 'projectID=' . $projectID);?>
<?php include '../../common/view/header.lite.html.php';?>
<body>
<div class='modal-dialog mw-500px' id='tipsModal'>
<div class='modal-header'>
<a href='<?php echo $defaultURL;?>' class='close'><i class="icon icon-close"></i></a>
<h4 class='modal-title' id='myModalLabel'><?php echo $lang->project->tips;?></h4>
</div>
<div class='modal-body'>
<?php echo $tips;?>
</div>
</div>
</body>
</html>
<?php exit;?>
<?php endif;?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php js::import($jsRoot . 'misc/date.js');?>
<?php js::set('weekend', $config->project->weekend);?>
<?php js::set('holders', $lang->project->placeholder);?>
<?php js::set('errorSameProducts', $lang->project->errorSameProducts);?>
<div id='mainContent' class='main-content'>
<div class='center-block'>
<div class='main-header'>
<h2><?php echo $lang->program->create;?></h2>
</div>
<form class='form-indicator main-form form-ajax' method='post' target='hiddenwin' id='dataform'>
<table class='table table-form'>
<tr>
<th class='w-120px'><?php echo $lang->program->type;?></th>
<td><?php echo html::select('type', $lang->program->typeList, '', "class='form-control'");?></td><td></td><td></td>
</tr>
<tr>
<th><?php echo $lang->program->name;?></th>
<td class="col-main"><?php echo html::input('name', '', "class='form-control' required");?></td>
<td></td><td></td>
</tr>
<tr>
<th><?php echo $lang->program->code;?></th>
<td><?php echo html::input('code', '', "class='form-control' required");?></td><td></td><td></td>
</tr>
<tr>
<th><?php echo $lang->program->PM;?></th>
<td><?php echo html::select('PM', $pmUsers, '', "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->program->budget;?></th>
<td><?php echo html::input('budget', '', "class='form-control'");?></td>
<td style='float:left'><?php echo html::select('budgetUnit', $lang->program->unitList, 'yuan', "class='form-control'");?></td><td></td>
</tr>
<tr>
<th><?php echo $lang->program->dateRange;?></th>
<td>
<div class='input-group'>
<?php echo html::input('begin', date('Y-m-d'), "class='form-control form-date' placeholder='" . $lang->program->begin . "' required");?>
<span class='input-group-addon'><?php echo $lang->program->to;?></span>
<?php echo html::input('end', '', "class='form-control form-date' placeholder='" . $lang->program->end . "' required");?>
</div>
</td>
<td colspan='2'></td>
</tr>
<tr>
<th><?php echo $lang->project->teamname;?></th>
<td><?php echo html::input('team', '', "class='form-control'");?></td><td></td><td></td>
</tr>
<tr class='hide'>
<th><?php echo $lang->project->status;?></th>
<td><?php echo html::hidden('status', 'wait');?></td>
<td></td>
<td></td>
</tr>
<?php $this->printExtendFields('', 'table');?>
<tr>
<th><?php echo $lang->program->desc;?></th>
<td colspan='3'>
<?php echo $this->fetch('user', 'ajaxPrintTemplates', 'type=project&link=desc');?>
<?php echo html::textarea('desc', '', "rows='6' class='form-control kindeditor' hidefocus='true'");?>
</td>
</tr>
<tr>
<th><?php echo $lang->project->acl;?></th>
<td colspan='3'><?php echo nl2br(html::radio('acl', $lang->project->aclList, 'open', "onclick='setWhite(this.value);'", 'block'));?></td>
</tr>
<tr id='whitelistBox' class='hidden'>
<th><?php echo $lang->project->whitelist;?></th>
<td colspan='3'><?php echo html::checkbox('whitelist', $groups, '', '', '', 'inline');?></td>
</tr>
<tr>
<td colspan='4' class='text-center form-actions'>
<?php echo html::submitButton();?>
<?php echo html::backButton();?>
</td>
</tr>
</table>
<?php echo html::hidden('products[]') . html::hidden('plans[]');?>
</form>
</div>
</div>
<?php include '../../common/view/footer.html.php';?>
+97
View File
@@ -0,0 +1,97 @@
<?php
/**
* The create view of project 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 project
* @version $Id: create.html.php 4728 2013-05-03 06:14:34Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
?>
<?php $projectTemplates = $this->project->getTemplateOptions();?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<div id='mainContent' class='main-content'>
<div class='center-block'>
<div class='main-header'>
<h2><?php echo $lang->program->edit;?></h2>
</div>
<form class='form-indicator main-form form-ajax' method='post' target='hiddenwin' id='dataform'>
<table class='table table-form'>
<tr>
<th class='w-120px'><?php echo $lang->project->template;?></th>
<td class="col-main"><?php echo html::select('parent', $projectTemplates, $project->parent, "class='form-control' required");?></td>
<td></td><td></td>
</tr>
<tr>
<th class='w-120px'><?php echo $lang->program->name;?></th>
<td class="col-main"><?php echo html::input('name', $project->name, "class='form-control' required");?></td>
<td></td><td></td>
</tr>
<tr>
<th><?php echo $lang->program->code;?></th>
<td><?php echo html::input('code', $project->code, "class='form-control' required");?></td><td></td><td></td>
</tr>
<tr>
<th><?php echo $lang->program->category;?></th>
<td><?php echo html::select('category', $lang->program->categoryList, $project->category, "class='form-control'");?></td><td></td><td></td>
</tr>
<tr>
<th><?php echo $lang->program->PM;?></th>
<td><?php echo html::select('PM', $pmUsers, $project->PM, "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->program->budget;?></th>
<td><?php echo html::input('budget', $project->budget, "class='form-control'");?></td>
<td style='float:left'><?php echo html::select('budgetUnit', $lang->program->unitList, $project->budgetUnit, "class='form-control'");?></td><td></td>
</tr>
<tr>
<th><?php echo $lang->program->dateRange;?></th>
<td>
<div class='input-group'>
<?php echo html::input('begin', $project->begin, "class='form-control form-date' placeholder='" . $lang->program->begin . "' required");?>
<span class='input-group-addon'><?php echo $lang->program->to;?></span>
<?php echo html::input('end', $project->end, "class='form-control form-date' placeholder='" . $lang->program->end . "' required");?>
</div>
</td>
<td colspan='2'></td>
</tr>
<tr>
<th><?php echo $lang->project->teamname;?></th>
<td><?php echo html::input('team', $project->team, "class='form-control'");?></td><td></td><td></td>
</tr>
<tr class='hide'>
<th><?php echo $lang->project->status;?></th>
<td><?php echo html::hidden('status', 'wait');?></td>
<td></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->program->desc;?></th>
<td colspan='3'>
<?php echo $this->fetch('user', 'ajaxPrintTemplates', 'type=project&link=desc');?>
<?php echo html::textarea('desc', $project->desc, "rows='6' class='form-control kindeditor' hidefocus='true'");?>
</td>
</tr>
<tr>
<th><?php echo $lang->project->acl;?></th>
<td colspan='3'><?php echo nl2br(html::radio('acl', $lang->project->aclList, $project->acl, "onclick='setWhite(this.value);'", 'block'));?></td>
</tr>
<tr id='whitelistBox' class='hidden'>
<th><?php echo $lang->project->whitelist;?></th>
<td colspan='3'><?php echo html::checkbox('whitelist', $groups, $project->whitelist, '', '', 'inline');?></td>
</tr>
<tr>
<td colspan='4' class='text-center form-actions'>
<?php echo html::submitButton();?>
<?php echo html::backButton();?>
</td>
</tr>
</table>
<?php echo html::hidden('products[]') . html::hidden('plans[]');?>
</form>
</div>
</div>
<?php include '../../common/view/footer.html.php';?>
+36
View File
@@ -0,0 +1,36 @@
<?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 $project->id;?></strong></span>
<?php echo isonlybody() ? ("<span title='$project->name'>" . $project->name . '</span>') : html::a($this->createLink('project', 'view', 'project=' . $project->id), $project->name, '_blank');?>
<?php if(!isonlybody()):?>
<small><?php echo $lang->arrow . $lang->project->finish;?></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->realFinished;?></th>
<td><?php echo html::input('realFinished', 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->finish) . ' ' . html::linkButton($lang->goback, $this->session->taskList, 'self', '', 'btn btn-wide'); ?></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';?>
+125
View File
@@ -0,0 +1,125 @@
<?php
/**
* The html template file of index method of index 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 ZenTaoPMS
* @version $Id: index.html.php 5094 2013-07-10 08:46:15Z chencongzhi520@gmail.com $
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('status', $status);?>
<style>
.footerbar .right-info{position: absolute; bottom: 10px; right: 10px;}
.footerbar .left-info{position: absolute; bottom: 15px; left: 20px;}
.flow-block {height: 230px;}
.panel-body .card-content{overflow-y: scroll; height: 100px;}
</style>
<?php if($programType == 'bygrid'):?>
<style>
#mainMenu{padding-left: 10px; padding-right: 10px;}
</style>
<?php endif;?>
<div id='mainMenu' class='clearfix'>
<div class="btn-group pull-left">
<?php echo html::a('javascript:setProgramType("bygrid")', "<i class='icon icon-cards-view'></i>", '', "title='看板' class='btn btn-icon " . ($programType == 'bygrid' ? 'text-primary' : '') . "'");?>
<?php echo html::a('javascript:setProgramType("bylist")', "<i class='icon icon-bars'></i>", '', "title='列表' class='btn btn-icon " . ($programType == 'bylist' ? 'text-primary' : '') . "'");?>
</div>
<div class='pull-right'><?php echo $lang->pageActions;?></div>
</div>
<div id='mainContent' class='main-row'>
<?php if(empty($projectList)):?>
<div class="table-empty-tip">
<p><span class="text-muted"><?php echo $lang->program->noProgram;?></span> <?php common::printLink('program', 'create', '', "<i class='icon icon-plus'></i> " . $lang->program->create, '', "class='btn btn-info'");?></p>
</div>
<?php else:?>
<div class='main-col'>
<?php if($programType == 'bygrid'):?>
<?php foreach ($projectList as $projectID => $project):?>
<div class='col-sm-6 col-md-4' data-id='<?php echo $projectID?>'>
<div class='main-table panel flow-block'>
<div class='main-table panel-heading'>
<strong title='<?php echo $project->name;?>'><?php echo $project->name;?></strong>
<span class="label label-primary label-outline"><?php echo zget($templates, $project->parent);?></span>
<span class="label label-success label-outline"><?php echo zget($lang->project->statusList, $project->status);?></span>
<span class="label label-danger label-outline"><?php echo zget($users,$project->PM);?></span>
<span class="label label-warning label-outline"><?php echo $project->budget . ' ' . zget($lang->program->unitList, $project->budgetUnit);?></span>
<nav class='panel-actions nav nav-default'>
<li class='dropdown'>
<a href='javascript:;' data-toggle='dropdown' class='panel-action'><i class='icon icon-ellipsis-v'></i></a>
<ul class='dropdown-menu pull-right'>
<li><?php common::printicon('program', 'activate', "projectid=$project->id", $project, 'button', '', '', 'iframe', true);?></li>
<li><?php if(common::hasPriv('program', 'edit')) echo html::a($this->createLink("program", "edit", "projectID=$project->id"), "<i class='icon-edit'></i> " . $lang->edit, '', "class='btn btn-link'");?></li>
<li><?php common::printIcon('program', 'start', "projectID=$project->id", $project, 'button', '', '', 'iframe', true);?></li>
<li><?php common::printIcon('program', 'suspend', "projectID=$project->id", $project, 'button', '', '', 'iframe', true);?></li>
<li><?php common::printIcon('program', 'finish', "projectID=$project->id", $project, 'button', '', '', 'iframe', true);?></li>
<li><?php common::printIcon('program', 'close', "projectID=$project->id", $project, 'button', '', '', 'iframe', true);?></li>
<li><?php if(common::hasPriv('program', 'delete')) echo html::a($this->createLink("project", "delete", "projectID=$project->id"), "<i class='icon-trash'></i> " . $lang->delete, 'hiddenwin', "class='btn btn-link'");?></li>
</ul>
</li>
</nav>
</div>
<div class='main-table panel-body'>
<div class='card-content text-muted scrollbar-hover'><?php echo $project->desc;?></div>
<div class='footerbar'>
<div class='right-info'>
<?php common::printLink('programplan', 'browse', "programplan=$project->id", $lang->project->enter, '', "class='btn btn-primary'");?>
</div>
</div>
</div>
</div>
</div>
<?php endforeach;?>
<?php else:?>
<div class='main-table'>
<table class='table has-sort-head table-fixed' id='projectList'>
<?php $vars = "status=$status&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<thead>
<tr>
<th class='c-id'>
<?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
</th>
<th><?php common::printOrderLink('name', $orderBy, $vars, $lang->program->name);?></th>
<th class='w-120px'><?php common::printOrderLink('code', $orderBy, $vars, $lang->program->code);?></th>
<th class='w-120px'><?php common::printOrderLink('budget', $orderBy, $vars, $lang->program->budget);?></th>
<th class='w-100px'><?php common::printOrderLink('PM', $orderBy, $vars, $lang->program->PM);?></th>
<th class='w-200px text-left'><?php echo $lang->program->desc;?></th>
<th class='text-center w-200px'><?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody class='sortable' id='projectTableList'>
<?php foreach($projectList as $project):?>
<tr data-id='<?php echo $project->id ?>' data-order='<?php echo $project->order ?>'>
<td class='c-id'>
<?php printf('%03d', $project->id);?>
</td>
<td class='text-left' title='<?php echo $project->name?>'>
<?php echo html::a($this->createLink('project', 'task', 'projectID=' . $project->id), $project->name);?>
</td>
<td class='text-left'><?php echo $project->code;?></td>
<td class='text-left'><?php echo $project->budget . ' ' . zget($lang->program->unitList, $project->budgetUnit);?></td>
<td><?php echo zget($users, $project->PM);?></td>
<td title='<?php echo strip_tags($project->desc);?>'><?php echo strip_tags($project->desc);?></td>
<td class='text-center c-actions'>
<?php common::printIcon('program', 'start', "projectID=$project->id", $project, 'list', '', '', 'iframe', true);?>
<?php common::printIcon('program', 'activate', "projectID=$project->id", $project, 'list', '', '', 'iframe', true);?>
<?php common::printIcon('program', 'suspend', "projectID=$project->id", $project, 'list', '', '', 'iframe', true);?>
<?php common::printIcon('program', 'finish', "projectID=$project->id", $project, 'list', '', '', 'iframe', true);?>
<?php common::printIcon('program', 'close', "projectID=$project->id", $project, 'list', '', '', 'iframe', true);?>
<?php if(common::hasPriv('program', 'edit')) echo html::a($this->createLink("program", "edit", "projectID=$project->id"), "<i class='icon-edit'></i>", '', "class='btn' title='{$lang->edit}'");?>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<div class='table-footer'>
<?php $pager->show('right', 'pagerjs');?>
</div>
</div>
<?php endif;?>
</div>
<?php endif;?>
</div>
<?php include '../../common/view/footer.html.php';?>
+36
View File
@@ -0,0 +1,36 @@
<?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 $project->id;?></strong></span>
<?php echo isonlybody() ? ("<span title='$project->name'>" . $project->name . '</span>') : html::a($this->createLink('project', 'view', 'project=' . $project->id), $project->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->realStarted;?></th>
<td><?php echo html::input('realStarted', 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) . ' ' . html::linkButton($lang->goback, $this->session->taskList, 'self', '', 'btn btn-wide'); ?></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';?>