Merge branch '20.x' of https://github.com/easysoft/zentaopms into 20.x
This commit is contained in:
+7
-4
@@ -239,10 +239,10 @@ CREATE TABLE IF NOT EXISTS `zt_holiday` (
|
||||
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(30) NOT NULL DEFAULT '',
|
||||
`type` enum('holiday', 'working') NOT NULL DEFAULT 'holiday',
|
||||
`desc` text NOT NULL,
|
||||
`year` char(4) NOT NULL,
|
||||
`begin` date NOT NULL,
|
||||
`end` date NOT NULL,
|
||||
`desc` text NOT NULL,
|
||||
`year` char(4) NOT NULL,
|
||||
`begin` date NOT NULL,
|
||||
`end` date NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `year` (`year`),
|
||||
KEY `name` (`name`)
|
||||
@@ -285,3 +285,6 @@ CREATE TABLE `zt_weeklyreport`(
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `week` (`program`,`weekStart`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
ALTER TABLE `zt_project` ADD `path` varchar(255) NOT NULL AFTER `parent`;
|
||||
ALTER TABLE `zt_project` ADD `grade` tinyint unsigned NOT NULL AFTER `path`;
|
||||
|
||||
@@ -1471,18 +1471,17 @@ class block extends control
|
||||
*/
|
||||
public function printScrumtestBlock()
|
||||
{
|
||||
$this->view->program = $this->loadModel('project')->getByID($this->session->program);
|
||||
|
||||
$this->session->set('testtaskList', $this->app->getURI(true));
|
||||
if(preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) die();
|
||||
$this->app->loadLang('testtask');
|
||||
$this->view->testtasks = $this->dao->select('t1.*,t2.name as productName,t3.name as buildName,t4.name as projectName')->from(TABLE_TESTTASK)->alias('t1')
|
||||
$this->view->testtasks = $this->dao->select('t1.*,t2.name as productName,t3.name as buildName,t4.name as projectName')
|
||||
->from(TABLE_TESTTASK)->alias('t1')
|
||||
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')
|
||||
->leftJoin(TABLE_BUILD)->alias('t3')->on('t1.build=t3.id')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t4')->on('t1.project=t4.id')
|
||||
->leftJoin(TABLE_PROJECTPRODUCT)->alias('t5')->on('t1.project=t5.project')
|
||||
->where('t1.deleted')->eq('0')
|
||||
->beginIF(!$this->app->user->admin)->andWhere('t1.product')->in($this->app->user->view->products)->fi()
|
||||
->andWhere('t1.product')->eq($this->session->program)->fi()
|
||||
->andWhere('t1.product = t5.product')
|
||||
->beginIF($this->params->type != 'all')->andWhere('t1.status')->eq($this->params->type)->fi()
|
||||
->orderBy('t1.id desc')
|
||||
|
||||
@@ -117,6 +117,10 @@ $lang->block->default['scrum']['program']['4']['title'] = '待测版本';
|
||||
$lang->block->default['scrum']['program']['4']['block'] = 'scrumtest';
|
||||
$lang->block->default['scrum']['program']['4']['grid'] = 8;
|
||||
|
||||
$lang->block->default['scrum']['program']['4']['params']['type'] = 'all';
|
||||
$lang->block->default['scrum']['program']['4']['params']['num'] = '15';
|
||||
$lang->block->default['scrum']['program']['4']['params']['orderBy'] = 'id_desc';
|
||||
|
||||
$lang->block->default['scrum']['program']['5']['title'] = '产品总览';
|
||||
$lang->block->default['scrum']['program']['5']['block'] = 'scrumproduct';
|
||||
$lang->block->default['scrum']['program']['5']['grid'] = 4;
|
||||
@@ -126,7 +130,7 @@ $lang->block->default['scrum']['program']['6']['block'] = 'scrumproject';
|
||||
$lang->block->default['scrum']['program']['6']['grid'] = 4;
|
||||
|
||||
$lang->block->default['scrum']['program']['7']['title'] = '最新动态';
|
||||
$lang->block->default['scrum']['program']['7']['block'] = 'scrumoverview';
|
||||
$lang->block->default['scrum']['program']['7']['block'] = 'scrumdynamic';
|
||||
$lang->block->default['scrum']['program']['7']['grid'] = 4;
|
||||
|
||||
$lang->block->default['product']['1']['title'] = $lang->productCommon . '统计';
|
||||
@@ -315,6 +319,18 @@ $lang->block->moduleList['product'] = $lang->productCommon;
|
||||
$lang->block->moduleList['project'] = $lang->projectCommon;
|
||||
$lang->block->moduleList['qa'] = '测试';
|
||||
$lang->block->moduleList['todo'] = '待办';
|
||||
$lang->block->moduleList['program'] = '项目';
|
||||
|
||||
|
||||
$lang->block->modules['program'] = new stdclass();
|
||||
$lang->block->modules['program']->availableBlocks = new stdclass();
|
||||
$lang->block->modules['program']->availableBlocks->scrumoverall = '项目整体情况';
|
||||
$lang->block->modules['program']->availableBlocks->scrumprogress = '进行中的迭代';
|
||||
$lang->block->modules['program']->availableBlocks->scrumproject = '迭代总览';
|
||||
$lang->block->modules['program']->availableBlocks->scrumproduct = '产品总览';
|
||||
$lang->block->modules['program']->availableBlocks->scrumtest = '待测版本';
|
||||
$lang->block->modules['program']->availableBlocks->scrumroadmap = '产品路线图';
|
||||
$lang->block->modules['program']->availableBlocks->scrumdynamic = '最新动态';
|
||||
|
||||
$lang->block->modules['product'] = new stdclass();
|
||||
$lang->block->modules['product']->availableBlocks = new stdclass();
|
||||
|
||||
@@ -661,4 +661,25 @@ class blockModel extends model
|
||||
|
||||
return $key == $hash;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get testtask params.
|
||||
*▫
|
||||
* @param string $module▫
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getScrumtestParams($module = '')
|
||||
{
|
||||
$params = new stdclass();
|
||||
$params->type['name'] = $this->lang->block->type;
|
||||
$params->type['options'] = $this->lang->block->typeList->testtask;
|
||||
$params->type['control'] = 'select';
|
||||
|
||||
$params->num['name'] = $this->lang->block->num;
|
||||
$params->num['default'] = 20;
|
||||
$params->num['control'] = 'input';
|
||||
|
||||
return json_encode($params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,16 +17,15 @@
|
||||
<table class='table table-borderless table-hover table-fixed-head tablesorter block-testtask table-fixed'>
|
||||
<thead>
|
||||
<tr class='text-center'>
|
||||
<?php if($longBlock):?>
|
||||
<th class='w-id'><?php echo $lang->idAB?></th>
|
||||
<th class='text-left'><?php echo $lang->testtask->product;?></th>
|
||||
<?php endif;?>
|
||||
<th class='text-left'><?php echo $lang->testtask->name;?></th>
|
||||
<?php if($longBlock):?>
|
||||
<th class='text-left'><?php echo $lang->testtask->project . '/' . $lang->testtask->build;?></th>
|
||||
<th class='text-left'><?php echo $lang->testtask->product;?></th>
|
||||
<?php endif;?>
|
||||
<th class='w-date'><?php echo $lang->testtask->begin;?></th>
|
||||
<th class='w-date'><?php echo $lang->testtask->end;?></th>
|
||||
<?php if($longBlock):?>
|
||||
<th class='text-left'><?php echo $lang->testtask->project?></th>
|
||||
<?php endif;?>
|
||||
<th class='text-left'><?php echo $lang->testtask->build;?></th>
|
||||
<th class='w-date'><?php echo $lang->testtask->status;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -36,16 +35,15 @@
|
||||
$viewLink = $this->createLink('testtask', 'view', "testtaskID={$testtask->id}");
|
||||
?>
|
||||
<tr class='text-center' data-url='<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink); ?>' <?php echo $appid?>>
|
||||
<?php if($longBlock):?>
|
||||
<td><?php echo sprintf('%03d', $testtask->id);?></td>
|
||||
<td class='text-left' title='<?php echo $testtask->productName?>'><?php echo $testtask->productName?></td>
|
||||
<?php endif;?>
|
||||
<td class='text-left' title='<?php echo $testtask->name?>'><?php echo $testtask->name?></td>
|
||||
<?php if($longBlock):?>
|
||||
<td class='text-left' title='<?php echo $testtask->projectName . '/' . $testtask->buildName?>'><?php echo $testtask->projectName . '/' . $testtask->buildName?></td>
|
||||
<td class='text-left' title='<?php echo $testtask->productName?>'><?php echo $testtask->productName?></td>
|
||||
<?php endif;?>
|
||||
<td><?php echo $testtask->begin?></td>
|
||||
<td><?php echo $testtask->end?></td>
|
||||
<?php if($longBlock):?>
|
||||
<td class='text-left' title='<?php echo $testtask->projectName?>'><?php echo $testtask->projectName?></td>
|
||||
<?php endif;?>
|
||||
<td class='text-left' title='<?php echo $testtask->buildName?>'><?php echo $testtask->buildName?></td>
|
||||
<td><?php echo zget($lang->testtask->statusList, $testtask->status)?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
|
||||
+107
-30
@@ -1,7 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* The control file of design currentModule 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 design
|
||||
* @version $Id: control.php 5107 2013-07-12 01:46:12Z chencongzhi520@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
class design extends control
|
||||
{
|
||||
public function browse($productID = 0,$type = 'all', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
/**
|
||||
* Browse designs.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param string $type
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function browse($productID = 0, $type = 'all', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
$productID = $this->loadModel('product')->saveState($productID, $this->product->getPairs('nocode'));
|
||||
|
||||
@@ -33,27 +55,38 @@ class design extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a design.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param string $prevModule
|
||||
* @param int $prevID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function create($productID = 0, $prevModule = '', $prevID = 0)
|
||||
{
|
||||
$productID = $this->loadModel('product')->saveState($productID, $this->product->getPairs('nocode'));
|
||||
|
||||
$this->design->setProductMenu($productID);
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$productID = $_POST['product'];
|
||||
$productID = $this->post->product;
|
||||
|
||||
$designID = $this->design->create();
|
||||
if($designID)
|
||||
if(dao::isError())
|
||||
{
|
||||
$this->loadModel('action')->create('design', $designID, 'created');
|
||||
|
||||
$response['result'] = 'success';
|
||||
$response['message'] = $this->lang->saveSuccess;
|
||||
$response['locate'] = $this->createLink('design', 'browse', "productID=$productID");
|
||||
$response['result'] = 'fail';
|
||||
$response['message'] = dao::getError();
|
||||
$this->send($response);
|
||||
}
|
||||
|
||||
$response['result'] = 'fail';
|
||||
$response['message'] = dao::getError();
|
||||
$this->loadModel('action')->create('design', $designID, 'created');
|
||||
|
||||
$response['result'] = 'success';
|
||||
$response['message'] = $this->lang->saveSuccess;
|
||||
$response['locate'] = $this->createLink('design', 'browse', "productID=$productID");
|
||||
$this->send($response);
|
||||
}
|
||||
|
||||
@@ -69,26 +102,40 @@ class design extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* View a design.
|
||||
*
|
||||
* @param int $designID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function view($designID = 0)
|
||||
{
|
||||
$data = $this->design->getById($designID);
|
||||
$data->productName = $this->dao->findByID($data->product)->from(TABLE_PRODUCT)->fetch('name');
|
||||
$data->files = $this->loadModel('file')->getByObject('design', $designID);
|
||||
$design = $this->design->getById($designID);
|
||||
$design->productName = $this->dao->findByID($design->product)->from(TABLE_PRODUCT)->fetch('name');
|
||||
$design->files = $this->loadModel('file')->getByObject('design', $designID);
|
||||
|
||||
$relations = $this->loadModel('common')->getRelations('design', $data->id, 'commit');
|
||||
$data->commit = '';
|
||||
foreach($relations as $relation) $data->commit .= html::a(helper::createLink('design', 'revision', "repoID=$relation->BID", '', true), "#$relation->BID", '', "class='iframe' data-width='80%' data-height='550'");
|
||||
$relations = $this->loadModel('common')->getRelations('design', $design->id, 'commit');
|
||||
$storyTitle = $this->dao->findByID($design->story)->from(TABLE_STORY)->fetch('title');
|
||||
$design->commit = '';
|
||||
if(!empty($_GET['onlybody']))
|
||||
{
|
||||
foreach($relations as $relation) $design->commit .= " #$relation->BID";
|
||||
$design->story = $storyTitle;
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($relations as $relation) $design->commit .= html::a(helper::createLink('design', 'revision', "repoID=$relation->BID", '', true), "#$relation->BID", '', "class='iframe' data-width='80%' data-height='550'");
|
||||
$design->story = $storyTitle ? html::a($this->createLink('story', 'view', "id=$design->story"), $storyTitle) : '';
|
||||
}
|
||||
|
||||
$storyTitle = $this->dao->findByID($data->story)->from(TABLE_STORY)->fetch('title');
|
||||
$data->story = $storyTitle ? html::a($this->createLink('story', 'view', "id=$data->story"), $storyTitle) : '';
|
||||
|
||||
$actions = $this->loadModel('action')->getList('design', $data->id);
|
||||
$actions = $this->loadModel('action')->getList('design', $design->id);
|
||||
|
||||
$this->view->title = $this->lang->design->designView;
|
||||
$this->view->position[] = $this->lang->design->designView;
|
||||
|
||||
$this->view->productID = $data->product;
|
||||
$this->view->data = $data;
|
||||
$this->view->productID = $design->product;
|
||||
$this->view->design = $design;
|
||||
$this->view->relations = $relations;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->actions = $actions;
|
||||
@@ -96,6 +143,13 @@ class design extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a design.
|
||||
*
|
||||
* @param int $designID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function edit($designID = 0)
|
||||
{
|
||||
$design = $this->design->getByID($designID);
|
||||
@@ -105,13 +159,16 @@ class design extends control
|
||||
if($_POST)
|
||||
{
|
||||
$changes = $this->design->update($designID);
|
||||
if($changes)
|
||||
if(dao::isError())
|
||||
{
|
||||
$actionID = $this->loadModel('action')->create('design', $designID, 'changed');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
|
||||
$response['result'] = 'fail';
|
||||
$response['message'] = dao::getError();
|
||||
$this->send($response);
|
||||
}
|
||||
|
||||
$actionID = $this->loadModel('action')->create('design', $designID, 'changed');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
|
||||
$response['result'] = 'success';
|
||||
$response['message'] = $this->lang->saveSuccess;
|
||||
$response['locate'] = $this->createLink('design', 'view', "id=$design->id");
|
||||
@@ -129,18 +186,30 @@ class design extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Commit a design.
|
||||
*
|
||||
* @param int $designID
|
||||
* @param string $begin
|
||||
* @param string $end
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function commit($designID, $begin = '', $end = '', $recTotal = 0, $recPerPage = 50, $pageID = 1)
|
||||
{
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
$program = $this->loadModel('project')->getByID($this->session->program);
|
||||
$begin = $begin ? date('Y-m-d', strtotime($begin)) : $program->begin;
|
||||
$end = $end ? date('Y-m-d', strtotime($end)) : helper::today();
|
||||
|
||||
$repoID = $this->session->repoID;
|
||||
$repo = $this->loadModel('repo')->getRepoByID($repoID);
|
||||
$revisions = $this->repo->getCommits($repo, '', 'HEAD', '', $pager, $begin, $end);
|
||||
$repoID = $this->session->repoID;
|
||||
$repo = $this->loadModel('repo')->getRepoByID($repoID);
|
||||
$revisions = $this->repo->getCommits($repo, '', 'HEAD', '', $pager, $begin, $end);
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
@@ -172,6 +241,14 @@ class design extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a design.
|
||||
*
|
||||
* @param int $designID
|
||||
* @param string $confirm
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function delete($designID, $confirm = 'no')
|
||||
{
|
||||
if($confirm == 'no')
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
#featurebar{display:inline-block;}
|
||||
.modal-dialog{width:70% !important}
|
||||
table td{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}
|
||||
@@ -0,0 +1 @@
|
||||
.tabs .tab-pane .table{border: 1px solid #ddd; border-top: none}
|
||||
@@ -3,3 +3,14 @@ $(document).on('click', '.ajaxPager', function()
|
||||
$('#logBox').load($(this).attr('href'));
|
||||
return false;
|
||||
})
|
||||
$('#product').change(function()
|
||||
{
|
||||
productID = $(this).val();
|
||||
var link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID);
|
||||
$.post(link, function(data)
|
||||
{
|
||||
$('#story').replaceWith(data);
|
||||
$('#story_chosen').remove();
|
||||
$('#story').chosen();
|
||||
})
|
||||
})
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
$('.main-actions').width($('.main-col').outerWidth());
|
||||
if(showAction == 'hidden')
|
||||
{
|
||||
$('.main-actions').remove();
|
||||
$('.pull-left').children('a').remove();
|
||||
};
|
||||
+80
-39
@@ -1,6 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* The model file of design 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 design
|
||||
* @version $Id: model.php 5079 2013-07-10 00:44:34Z chencongzhi520@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
class designModel extends model
|
||||
{
|
||||
/**
|
||||
* Create a design.
|
||||
*
|
||||
* @access public
|
||||
* @return int|bool
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$design = fixer::input('post')
|
||||
@@ -16,7 +34,7 @@ class designModel extends model
|
||||
$this->dao->insert(TABLE_DESIGN)->data($design)->autoCheck()->batchCheck('name,type', 'notempty')->exec();
|
||||
|
||||
if(!dao::isError())
|
||||
{
|
||||
{
|
||||
$designID = $this->dao->lastInsertID();
|
||||
$this->file->updateObjectID($this->post->uid, $designID, 'design');
|
||||
$files = $this->file->saveUpload('design', $designID);
|
||||
@@ -30,11 +48,18 @@ class designModel extends model
|
||||
$this->dao->insert(TABLE_DESIGNSPEC)->data($spec)->exec();
|
||||
|
||||
return $designID;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a design.
|
||||
*
|
||||
* @param int $designID
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function update($designID)
|
||||
{
|
||||
$oldDesign = $this->getByID($designID);
|
||||
@@ -57,7 +82,7 @@ class designModel extends model
|
||||
if($designChanged)
|
||||
{
|
||||
$design = $this->getByID($designID);
|
||||
$version = $design->version + 1;
|
||||
$version = $design->version + 1;
|
||||
$spec = new stdclass();
|
||||
$spec->design = $designID;
|
||||
$spec->version = $version;
|
||||
@@ -70,16 +95,23 @@ class designModel extends model
|
||||
}
|
||||
|
||||
return common::createChanges($oldDesign, $design);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* LinkCommit a design.
|
||||
*
|
||||
* @param int $designID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function linkCommit($designID)
|
||||
{
|
||||
$this->dao->delete()->from(TABLE_RELATION)->where('AType')->eq('design')->andWhere('AID')->eq($designID)->andWhere('BType')->eq('commit')->andWhere('relation')->eq('completedin')->exec();
|
||||
$this->dao->delete()->from(TABLE_RELATION)->where('AType')->eq('commit')->andWhere('BID')->eq($designID)->andWhere('BType')->eq('design')->andWhere('relation')->eq('completedfrom')->exec();
|
||||
$revisions = $_POST['revision'];
|
||||
$revisions = $_POST['revision'];
|
||||
|
||||
foreach($revisions as $revision)
|
||||
{
|
||||
@@ -105,38 +137,15 @@ class designModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
public function setFlowActionFields($module, $action)
|
||||
{
|
||||
$flow = $this->loadModel('workflow', 'flow')->getByModule($module);
|
||||
$action = $this->loadModel('workflowaction', 'flow')->getByModuleAndAction($flow->module, $action);
|
||||
$fields = $this->workflowaction->getFields($flow->module, $action->action);
|
||||
|
||||
return array($flow, $action, $fields);
|
||||
}
|
||||
|
||||
public function setFlowChild($module, $action, $fields, $dataID = 0)
|
||||
{
|
||||
$this->loadModel('workflowlayout', 'flow');
|
||||
|
||||
$childFields = array();
|
||||
$childDatas = array();
|
||||
$childModules = $this->loadModel('workflow', 'flow')->getList($module, 'table');
|
||||
foreach($childModules as $childModule)
|
||||
{
|
||||
$key = 'sub_' . $childModule->module;
|
||||
|
||||
if(isset($fields[$key]) && $fields[$key]->show)
|
||||
{
|
||||
$childFields[$key] = $this->workflowaction->getFields($childModule->module, $action);
|
||||
$childDatas[$key] = $this->flow->getDataList($childModule, '', 0, $dataID);
|
||||
}
|
||||
}
|
||||
|
||||
return array($childFields, $childDatas);
|
||||
}
|
||||
|
||||
/**
|
||||
* SetProductMenu
|
||||
*
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setProductMenu($productID = 0)
|
||||
{
|
||||
{
|
||||
$programID = $this->session->program;
|
||||
$products = $this->loadModel('product')->getPairs($programID);
|
||||
$productID = in_array($productID, array_keys($products)) ? $productID : key($products);
|
||||
@@ -145,12 +154,27 @@ class designModel extends model
|
||||
$this->loadModel('product')->setMenu($products, $productID);
|
||||
}
|
||||
|
||||
/**
|
||||
* GetByID
|
||||
*
|
||||
* @param int $designID
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getByID($designID)
|
||||
{
|
||||
$design = $this->dao->select('*')->from(TABLE_DESIGN)->where('id')->eq($designID)->fetch();
|
||||
return $this->loadModel('file')->replaceImgURL($design, 'desc');
|
||||
}
|
||||
|
||||
/**
|
||||
* GetDesignPairs
|
||||
*
|
||||
* @param int $productID
|
||||
* @param string $type
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getDesignPairs($productID = 0, $type = 'detailed')
|
||||
{
|
||||
$designs = $this->dao->select('id, name')->from(TABLE_DESIGN)
|
||||
@@ -158,13 +182,20 @@ class designModel extends model
|
||||
->andWhere('deleted')->eq(0)
|
||||
->andWhere('type')->eq($type)
|
||||
->fetchPairs();
|
||||
foreach($designs as $id => $name) $designs[$id] = $id . ':' . $name;
|
||||
foreach($designs as $id => $name) $designs[$id] = $id . ':' . $name;
|
||||
|
||||
return $designs;
|
||||
}
|
||||
|
||||
/**
|
||||
* GetAffectedScope
|
||||
*
|
||||
* @param int $design
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getAffectedScope($design)
|
||||
{
|
||||
{
|
||||
/* Get affected tasks. */
|
||||
$design->tasks = $this->dao->select('*')->from(TABLE_TASK)
|
||||
->where('deleted')->eq(0)
|
||||
@@ -175,6 +206,16 @@ class designModel extends model
|
||||
return $design;
|
||||
}
|
||||
|
||||
/**
|
||||
* GetList
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $type
|
||||
* @param int $orderBy
|
||||
* @param int $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getList($productID, $type, $orderBy, $pager)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_DESIGN)
|
||||
|
||||
@@ -1,32 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* The browse view file of flow module of RanZhi.
|
||||
* The browse view file of design module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2016 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license 商业软件,非开源软件
|
||||
* @author Gang Liu <liugang@cnezsoft.com>
|
||||
* @package flow
|
||||
* @version $Id$
|
||||
* @link http://www.ranzhico.com
|
||||
* @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 design
|
||||
* @version $Id: browse.html.php 5102 2013-07-12 00:59:54Z chencongzhi520@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
if(!empty($dataList))
|
||||
{
|
||||
foreach($dataList as $data)
|
||||
{
|
||||
$relations = $this->loadModel('common')->getRelations('design', $data->id, 'commit');
|
||||
$data->commit = '';
|
||||
foreach($relations as $relation) $data->commit .= html::a(helper::createLink('design', 'revision', "repoID=$relation->BID", '', true), "#$relation->BID", '', "class='iframe' data-width='80%' data-height='550'");
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php include '../../' . 'common/view/header.html.php';?>
|
||||
<style>
|
||||
#featurebar{display:inline-block;}
|
||||
.modal-dialog{width:70% !important}
|
||||
table td{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}
|
||||
</style>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/sortable.html.php';?>
|
||||
<?php js::set('productID', $productID);?>
|
||||
<?php
|
||||
@@ -37,23 +21,21 @@ js::set('showSubHeader', $showSubHeader);
|
||||
<div class='btn-toolbar pull-left'>
|
||||
<?php
|
||||
$recTotalLabel = " <span class='label label-light label-badge'>{$pager->recTotal}</span>";
|
||||
echo html::a(inlink('browse', "productID={$productID}&type=all"), "<span class='text'>{$lang->design->typeList['all']}</span>" . ($type == 'all' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'all' ? ' btn-active-text' : '') . "'");
|
||||
echo html::a(inlink('browse', "productID={$productID}&type=HLDS"), "<span class='text'>{$lang->design->typeList['HLDS']}</span>" . ($type == 'HLDS' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'HLDS' ? ' btn-active-text' : '') . "'");
|
||||
echo html::a(inlink('browse', "productID={$productID}&type=DDS"), "<span class='text'>{$lang->design->typeList['DDS']}</span>" . ($type == 'DDS' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'DDS' ? ' btn-active-text' : '') . "'");
|
||||
echo html::a(inlink('browse', "productID={$productID}&type=DBDS"), "<span class='text'>{$lang->design->typeList['DBDS']}</span>" . ($type == 'DBDS' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'DBDS' ? ' btn-active-text' : '') . "'");
|
||||
echo html::a(inlink('browse', "productID={$productID}&type=ADS"), "<span class='text'>{$lang->design->typeList['ADS']}</span>" . ($type == 'ADS' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'ADS' ? ' btn-active-text' : '') . "'");
|
||||
echo html::a(inlink('browse', "productID={$productID}&type=all"), "<span class='text'>{$lang->design->typeList['all']}</span>" . ($type == 'all' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'all' ? ' btn-active-text' : '') . "'");
|
||||
echo html::a(inlink('browse', "productID={$productID}&type=HLDS"), "<span class='text'>{$lang->design->typeList['HLDS']}</span>" . ($type == 'HLDS' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'HLDS' ? ' btn-active-text' : '') . "'");
|
||||
echo html::a(inlink('browse', "productID={$productID}&type=DDS"), "<span class='text'>{$lang->design->typeList['DDS']}</span>" . ($type == 'DDS' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'DDS' ? ' btn-active-text' : '') . "'");
|
||||
echo html::a(inlink('browse', "productID={$productID}&type=DBDS"), "<span class='text'>{$lang->design->typeList['DBDS']}</span>" . ($type == 'DBDS' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'DBDS' ? ' btn-active-text' : '') . "'");
|
||||
echo html::a(inlink('browse', "productID={$productID}&type=ADS"), "<span class='text'>{$lang->design->typeList['ADS']}</span>" . ($type == 'ADS' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'ADS' ? ' btn-active-text' : '') . "'");
|
||||
?>
|
||||
</div>
|
||||
<div class='btn-toolbar pull-right'>
|
||||
<?php
|
||||
if(common::hasPriv('design', 'create')) echo html::a($this->createLink('design', 'create', "productID=$productID&designID=0"), "<i class='icon icon-plus'></i> {$lang->design->create}", '', "class='btn btn-primary'");
|
||||
?>
|
||||
<?php if(common::hasPriv('design', 'create')) echo html::a($this->createLink('design', 'create', "productID=$productID&designID=0"), "<i class='icon icon-plus'></i> {$lang->design->create}", '', "class='btn btn-primary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mainContent" class="main-row fade in">
|
||||
<?php if(empty($designs)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p><span class="text-muted"><?php echo $lang->design->noDesign;?></span></p>
|
||||
<p><span class="text-muted"><?php echo $lang->design->noDesign;?></span></p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<form id='designFrom' method='post' class="main-table">
|
||||
@@ -61,34 +43,15 @@ js::set('showSubHeader', $showSubHeader);
|
||||
<?php $vars = "productID=$productID&orderBy=%s&recTotal=$pager->recTotal&recPerPage=$pager->recPerPage&pageID=$pager->pageID";?>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left w-120px">
|
||||
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll;?>"></div>
|
||||
<?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
|
||||
</th>
|
||||
<th class="text-left w-120px">
|
||||
<?php common::printOrderLink('type', $orderBy, $vars, $lang->design->type);?>
|
||||
</th>
|
||||
<th class="text-left">
|
||||
<?php common::printOrderLink('name', $orderBy, $vars, $lang->design->name);?>
|
||||
</th>
|
||||
<th class="text-left w-130px">
|
||||
<?php common::printOrderLink('commit', $orderBy, $vars, $lang->design->submission);?>
|
||||
</th>
|
||||
<th class="text-left w-70px">
|
||||
<?php common::printOrderLink('version', $orderBy, $vars, $lang->design->version);?>
|
||||
</th>
|
||||
<th class="text-left w-120px">
|
||||
<?php common::printOrderLink('createdBy', $orderBy, $vars, $lang->design->createdBy);?>
|
||||
</th>
|
||||
<th class="text-left w-150px">
|
||||
<?php common::printOrderLink('createdDate', $orderBy, $vars, $lang->design->createdDate);?>
|
||||
</th>
|
||||
<th class="text-left w-120px">
|
||||
<?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->design->assignedTo);?>
|
||||
</th>
|
||||
<th class="text-center w-100px">
|
||||
<?php echo $lang->design->actions;?>
|
||||
</th>
|
||||
<th class="text-left w-120px"> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th class="text-left w-120px"> <?php common::printOrderLink('type', $orderBy, $vars, $lang->design->type);?></th>
|
||||
<th class="text-left"> <?php common::printOrderLink('name', $orderBy, $vars, $lang->design->name);?></th>
|
||||
<th class="text-left w-130px"> <?php common::printOrderLink('commit', $orderBy, $vars, $lang->design->submission);?></th>
|
||||
<th class="text-left w-70px"> <?php common::printOrderLink('version', $orderBy, $vars, $lang->design->version);?></th>
|
||||
<th class="text-left w-120px"> <?php common::printOrderLink('createdBy', $orderBy, $vars, $lang->design->createdBy);?></th>
|
||||
<th class="text-left w-150px"> <?php common::printOrderLink('createdDate', $orderBy, $vars, $lang->design->createdDate);?></th>
|
||||
<th class="text-left w-120px"> <?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->design->assignedTo);?></th>
|
||||
<th class="text-center w-100px"><?php echo $lang->design->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -103,21 +66,21 @@ js::set('showSubHeader', $showSubHeader);
|
||||
<td class='text-left'><?php echo $design->createdDate;?></td>
|
||||
<td class='text-left'><?php echo $design->assignedTo;?></td>
|
||||
<td class='c-actions text-center'>
|
||||
<?php
|
||||
$vars = "design={$design->id}";
|
||||
common::printIcon('design', 'edit', $vars, $design, 'list', 'fork', '', '', '', '', '', $design->program);
|
||||
common::printIcon('design', 'commit', $vars, $design, 'list', 'link', '', 'iframe showinonlybody', true);
|
||||
common::printIcon('design', 'delete', $vars, $design, 'list', 'trash', 'hiddenwin', '', '', '', '', $design->program);
|
||||
?>
|
||||
<?php
|
||||
$vars = "design={$design->id}";
|
||||
common::printIcon('design', 'edit', $vars, $design, 'list', 'fork', '', '', '', '', '', $design->program);
|
||||
common::printIcon('design', 'commit', $vars, $design, 'list', 'link', '', 'iframe showinonlybody', true);
|
||||
common::printIcon('design', 'delete', $vars, $design, 'list', 'trash', 'hiddenwin', '', '', '', '', $design->program);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class='table-footer'>
|
||||
<?php $pager->show('right', 'pagerjs');?>
|
||||
<?php $pager->show('right', 'pagerjs');?>
|
||||
</div>
|
||||
</form>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php include '../../' . 'common/view/footer.html.php';?>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* The commit view of design 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 design
|
||||
* @version $Id: commit.html.php 4903 2013-06-26 05:32:59Z wyd621@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.lite.html.php';?>
|
||||
<style>.m-design-commit{padding-left: 0px;}</style>
|
||||
<div class='main-content' id='mainContent'>
|
||||
<div class='main-header'>
|
||||
<h2>
|
||||
@@ -9,9 +20,9 @@
|
||||
</h2>
|
||||
</div>
|
||||
<div class='searchBox'>
|
||||
<h4><?php echo $lang->design->commitDate . ':';?></h4>
|
||||
<?php echo html::input('begin', $begin, "class='form-control form-date srearch-date'");?>
|
||||
<span>~</span>
|
||||
<h4><?php echo $lang->design->commitDate . ':';?></h4>
|
||||
<?php echo html::input('begin', $begin, "class='form-control form-date srearch-date'");?>
|
||||
<span>~</span>
|
||||
<?php echo html::input('end', $end, "class='form-control form-date srearch-date'");?>
|
||||
</div>
|
||||
<form id='logForm' class='main-table form-ajax' data-ride='table' action=<?php echo inlink('commit', "designID=$designID");?> method='post'>
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* The create view of design 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 design
|
||||
* @version $Id: create.html.php 4903 2013-06-26 05:32:59Z wyd621@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<?php
|
||||
@@ -19,9 +31,7 @@ js::set('showSubHeader', $showSubHeader);
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php if($program->category == 'single'):?>
|
||||
<?php echo html::hidden('product', $productID);?>
|
||||
<?php endif;?>
|
||||
<?php if($program->category == 'single') echo html::hidden('product', $productID);?>
|
||||
<tr>
|
||||
<th class='w-120px'><?php echo $lang->design->story;?></th>
|
||||
<td><?php echo html::select('story', empty($stories) ? '' : $stories, '', "class='form-control chosen'");?></td>
|
||||
@@ -54,18 +64,6 @@ js::set('showSubHeader', $showSubHeader);
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#product').change(function()
|
||||
{
|
||||
productID = $(this).val();
|
||||
var link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID);
|
||||
$.post(link, function(data)
|
||||
{
|
||||
$('#story').replaceWith(data);
|
||||
$('#story_chosen').remove();
|
||||
$('#story').chosen();
|
||||
})
|
||||
})
|
||||
|
||||
if(showSubHeader == 'hidden') $("#subHeader").remove();
|
||||
</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -1,10 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* The edit view of design 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 design
|
||||
* @version $Id: edit.html.php 4903 2013-06-26 05:32:59Z wyd621@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<?php
|
||||
$showSubHeader = $program->category == 'single' ? 'hidden' : 'show';
|
||||
js::set('showSubHeader', $showSubHeader);
|
||||
?>
|
||||
<style> .tabs .tab-pane .table{border: 1px solid #ddd; border-top: none} </style>
|
||||
<div id="mainContent" class="main-content fade">
|
||||
<div class="center-block">
|
||||
<div class="main-header">
|
||||
@@ -90,18 +101,6 @@ js::set('showSubHeader', $showSubHeader);
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#product').change(function()
|
||||
{
|
||||
productID = $(this).val();
|
||||
var link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID);
|
||||
$.post(link, function(data)
|
||||
{
|
||||
$('#story').replaceWith(data);
|
||||
$('#story_chosen').remove();
|
||||
$('#story').chosen();
|
||||
})
|
||||
})
|
||||
|
||||
if(showSubHeader == 'hidden') $("#subHeader").remove();
|
||||
</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -1,19 +1,23 @@
|
||||
<?php include '../../' . 'common/view/header.html.php';?>
|
||||
<?php
|
||||
if(!empty($_GET['onlybody']))
|
||||
{
|
||||
$data->commit = '';
|
||||
foreach($relations as $relation) $data->commit .= " #$relation->BID";
|
||||
$data->story = $storyTitle;
|
||||
}
|
||||
/**
|
||||
* The view of design 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 design
|
||||
* @version $Id: view.html.php 4903 2013-06-26 05:32:59Z wyd621@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div class="btn-toolbar pull-left">
|
||||
<?php echo html::a($this->createLink('design', 'browse', "productID=$productID"), '<i class="icon icon-back icon-sm"></i> ' . $lang->goback, '', "class='btn btn-secondary'");?>
|
||||
<div class="divider"></div>
|
||||
<div class="page-title">
|
||||
<span class="label label-id"><?php echo $data->id?></span>
|
||||
<span class="text" title="<?php echo $data->name;?>"><?php echo $data->name;?></span>
|
||||
<span class="label label-id"><?php echo $design->id?></span>
|
||||
<span class="text" title="<?php echo $design->name;?>"><?php echo $design->name;?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -23,8 +27,8 @@ if(!empty($_GET['onlybody']))
|
||||
<div class="detail">
|
||||
<div class="detail-title"><?php echo $lang->design->desc;?></div>
|
||||
<div class="detail-content article-content">
|
||||
<?php echo $data->desc;?>
|
||||
<?php echo $this->fetch('file', 'printFiles', array('files' => $data->files, 'fieldset' => 'true'));?>
|
||||
<?php echo $design->desc;?>
|
||||
<?php echo $this->fetch('file', 'printFiles', array('files' => $design->files, 'fieldset' => 'true'));?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -33,13 +37,13 @@ if(!empty($_GET['onlybody']))
|
||||
<div class="btn-toolbar">
|
||||
<?php common::printBack($this->session->designList);?>
|
||||
<?php if(!isonlybody()) echo "<div class='divider'></div>";?>
|
||||
<?php if(!$data->deleted):?>
|
||||
<?php if(!$design->deleted):?>
|
||||
<?php
|
||||
common::printIcon('design', 'commit',"designID=$data->id", $data, 'button', 'link', '', 'iframe showinonlybody', true);
|
||||
common::printIcon('design', 'edit', "designID=$data->id", $data, 'button', '', '', '', true);
|
||||
common::printIcon('design', 'delete', "designID=$data->id", $data, 'button', 'trash', 'hiddenwin');
|
||||
common::printIcon('design', 'commit', "designID=$design->id", $design, 'button', 'link', '', 'iframe showinonlybody', true);
|
||||
common::printIcon('design', 'edit', "designID=$design->id", $design, 'button', '', '', '', true);
|
||||
common::printIcon('design', 'delete', "designID=$design->id", $design, 'button', 'trash', 'hiddenwin');
|
||||
?>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -49,39 +53,31 @@ if(!empty($_GET['onlybody']))
|
||||
<table class='table table-data'>
|
||||
<tr>
|
||||
<th><?php echo $lang->design->type;?></th>
|
||||
<td><?php echo zget($lang->design->typeList, $data->type);?></td>
|
||||
<td><?php echo zget($lang->design->typeList, $design->type);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->design->product;?></th>
|
||||
<td><?php echo $data->productName;?></td>
|
||||
<td><?php echo $design->productName;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->design->story;?></th>
|
||||
<td><?php echo $data->story;?></td>
|
||||
<td><?php echo $design->story;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->design->commit;?></th>
|
||||
<td><?php echo $data->commit;?></td>
|
||||
<td><?php echo $design->commit;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->design->createdBy;?></th>
|
||||
<td><?php echo zget($users, $data->createdBy);?></td>
|
||||
<td><?php echo zget($users, $design->createdBy);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->design->createdDate;?></th>
|
||||
<td><?php echo $data->createdDate;?></td>
|
||||
<td><?php echo $design->createdDate;?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('.main-actions').width($('.main-col').outerWidth());
|
||||
if(showAction == 'hidden')
|
||||
{
|
||||
$('.main-actions').remove();
|
||||
$('.pull-left').children('a').remove();
|
||||
};
|
||||
</script>
|
||||
<?php include '../../' . 'common/view/footer.html.php';?>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -87,20 +87,19 @@ class program extends control
|
||||
/**
|
||||
* Create a program.
|
||||
*
|
||||
* @param varchar $template
|
||||
* @param int $copyProgramID
|
||||
* @param string $template
|
||||
* @param int $programID
|
||||
* @param int $copyProgramID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function create($template = 'cmmi', $copyProgramID = '')
|
||||
public function create($template = 'cmmi', $programID = 0, $copyProgramID = '')
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$projectID = $this->program->create();
|
||||
if(dao::isError())
|
||||
{
|
||||
$this->send(array('result' => 'fail', 'message' => $this->processErrors(dao::getError())));
|
||||
}
|
||||
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('browse', array('status' => 'wait', 'orderBy' => 'order_desc'))));
|
||||
}
|
||||
@@ -111,6 +110,19 @@ class program extends control
|
||||
$whitelist = '';
|
||||
$acl = 'open';
|
||||
$privway = 'extend';
|
||||
|
||||
if($programID)
|
||||
{
|
||||
$program = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($programID)->fetch();
|
||||
if($this->program->checkHasContent($programID))
|
||||
{
|
||||
echo js::alert($this->lang->program->cannotCreateChild);
|
||||
die(js::locate('back'));
|
||||
}
|
||||
|
||||
if(empty($template)) $template = $program->template;
|
||||
}
|
||||
|
||||
if($copyProgramID)
|
||||
{
|
||||
$copyProgram = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($copyProgramID)->fetch();
|
||||
@@ -120,6 +132,7 @@ class program extends control
|
||||
$acl = $copyProgram->acl;
|
||||
$privway = $copyProgram->privway;
|
||||
$whitelist = $copyProgram->whitelist;
|
||||
if(empty($template)) $template = $copyProgram->template;
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->program->create;
|
||||
@@ -134,6 +147,7 @@ class program extends control
|
||||
$this->view->acl = $acl;
|
||||
$this->view->privway = $privway;
|
||||
$this->view->whitelist = $whitelist;
|
||||
$this->view->programID = $programID;
|
||||
$this->view->copyProgramID = $copyProgramID;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -25,3 +25,5 @@
|
||||
#cards .project-detail .progress-text-left .progress-text {width: 50px; left: -50px;}
|
||||
#cards .pager {margin: 0; float: right;}
|
||||
#cards .pager .btn{border: none}
|
||||
|
||||
.w-215px{width:215px;}
|
||||
|
||||
@@ -3,7 +3,7 @@ $(function()
|
||||
$('#copyProjects a').click(function(){setCopyProject($(this).data('id')); $('#copyProjectModal').modal('hide')});
|
||||
});
|
||||
|
||||
function setCopyProject(programID)
|
||||
function setCopyProject(copiedProgramID)
|
||||
{
|
||||
location.href = createLink('program', 'create', 'template=' + template + '©ProgramID=' + programID);
|
||||
location.href = createLink('program', 'create', 'template=' + template + '&programID=' + programID + '©ProgramID=' + copiedProgramID);
|
||||
}
|
||||
|
||||
@@ -85,3 +85,4 @@ $lang->program->scrumDesc = '<strong>简介:</strong>小步迭代,
|
||||
$lang->program->cmmi = '瀑布';
|
||||
$lang->program->cmmiTitle = '瀑布式项目管理';
|
||||
$lang->program->cmmiDesc = '<strong>简介:</strong>按阶段规范化管理<br><strong>包含功能点:</strong>估算、计划、阶段、报告';
|
||||
$lang->program->cannotCreateChild = '该项目已经有实际的内容,无法直接添加子项目。您可以为当前项目创建一个父项目,然后在新的父项目下面添加子项目。';
|
||||
|
||||
@@ -5,6 +5,7 @@ class programModel extends model
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_PROJECT)
|
||||
->where('iscat')->eq(0)
|
||||
->andWhere('template')->ne('')
|
||||
->andWhere('program')->eq(0)
|
||||
->andWhere('deleted')->eq(0)
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->programs)->fi()
|
||||
@@ -93,6 +94,12 @@ class programModel extends model
|
||||
$this->dao->update(TABLE_PROJECT)->set('`order`')->eq($programID * 5)->where('id')->eq($programID)->exec();
|
||||
$this->file->updateObjectID($this->post->uid, $programID, 'project');
|
||||
|
||||
if($project->parent > 0)
|
||||
{
|
||||
$this->dao->update(TABLE_PROJECT)->set('isCat')->eq(1)->where('id')->eq($project->parent)->exec();
|
||||
$this->fixPath($programID);
|
||||
}
|
||||
|
||||
/* Add program admin.*/
|
||||
$groupPriv = $this->dao->select('t1.*')->from(TABLE_USERGROUP)->alias('t1')
|
||||
->leftJoin(TABLE_GROUP)->alias('t2')->on('t1.group = t2.id')
|
||||
@@ -189,4 +196,49 @@ class programModel extends model
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_PRODUCT)->where('project')->eq($program)->fetchAll('id');
|
||||
}
|
||||
|
||||
public function checkHasContent($programID)
|
||||
{
|
||||
$count = 0;
|
||||
$count += $this->dao->select('count(*) as count')->from(TABLE_BUDGET)->where('program')->eq($programID)->fetch('count');
|
||||
$count += $this->dao->select('count(*) as count')->from(TABLE_BUG)->where('program')->eq($programID)->fetch('count');
|
||||
$count += $this->dao->select('count(*) as count')->from(TABLE_CASE)->where('program')->eq($programID)->fetch('count');
|
||||
$count += $this->dao->select('count(*) as count')->from(TABLE_DESIGN)->where('program')->eq($programID)->fetch('count');
|
||||
$count += $this->dao->select('count(*) as count')->from(TABLE_DOC)->where('program')->eq($programID)->fetch('count');
|
||||
$count += $this->dao->select('count(*) as count')->from(TABLE_DURATIONESTIMATION)->where('program')->eq($programID)->fetch('count');
|
||||
$count += $this->dao->select('count(*) as count')->from(TABLE_ISSUE)->where('program')->eq($programID)->fetch('count');
|
||||
$count += $this->dao->select('count(*) as count')->from(TABLE_PROJECT)->where('program')->eq($programID)->fetch('count');
|
||||
$count += $this->dao->select('count(*) as count')->from(TABLE_RELATION)->where('program')->eq($programID)->fetch('count');
|
||||
$count += $this->dao->select('count(*) as count')->from(TABLE_RELEASE)->where('program')->eq($programID)->fetch('count');
|
||||
$count += $this->dao->select('count(*) as count')->from(TABLE_REPO)->where('program')->eq($programID)->fetch('count');
|
||||
$count += $this->dao->select('count(*) as count')->from(TABLE_RISK)->where('program')->eq($programID)->fetch('count');
|
||||
$count += $this->dao->select('count(*) as count')->from(TABLE_STORY)->where('program')->eq($programID)->fetch('count');
|
||||
$count += $this->dao->select('count(*) as count')->from(TABLE_TESTREPORT)->where('program')->eq($programID)->fetch('count');
|
||||
$count += $this->dao->select('count(*) as count')->from(TABLE_TESTSUITE)->where('program')->eq($programID)->fetch('count');
|
||||
$count += $this->dao->select('count(*) as count')->from(TABLE_TESTTASK)->where('program')->eq($programID)->fetch('count');
|
||||
$count += $this->dao->select('count(*) as count')->from(TABLE_WORKESTIMATION)->where('program')->eq($programID)->fetch('count');
|
||||
|
||||
return $count > 0;
|
||||
}
|
||||
|
||||
public function fixPath($programID)
|
||||
{
|
||||
$path = array();
|
||||
$program = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($programID)->fetch();
|
||||
if($program->parent == 0)
|
||||
{
|
||||
$path['path'] = ",{$program->id},";
|
||||
$path['grade'] = 1;
|
||||
$this->dao->update(TABLE_PROJECT)->set('path')->eq($path['path'])->set('grade')->eq($path['grade'])->where('id')->eq($program->id)->exec();
|
||||
}
|
||||
else
|
||||
{
|
||||
$path = $this->fixPath($program->parent);
|
||||
$path['path'] .= "{$program->id},";
|
||||
$path['grade'] += 1;
|
||||
$this->dao->update(TABLE_PROJECT)->set('path')->eq($path['path'])->set('grade')->eq($path['grade'])->where('id')->eq($program->id)->exec();
|
||||
}
|
||||
|
||||
return $path;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<th class='w-100px'><?php common::printOrderLink('end', $orderBy, $vars, $lang->program->end);?></th>
|
||||
<th class='w-100px'><?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='text-center w-200px'><?php echo $lang->actions;?></th>
|
||||
<th class='text-center w-215px'><?php echo $lang->actions;?></th>
|
||||
<?php if($canOrder):?>
|
||||
<th class='w-60px sort-default'><?php common::printOrderLink('order', $orderBy, $vars, $lang->project->orderAB);?></th>
|
||||
<?php endif;?>
|
||||
@@ -43,6 +43,7 @@
|
||||
<?php common::printIcon('program', 'suspend', "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}'");?>
|
||||
<?php common::printIcon('program', 'create', "template=&projectID=$project->id", '', 'list', 'treemap-alt', '', '', '', '', $this->lang->program->children);?>
|
||||
</td>
|
||||
<?php if($canOrder):?>
|
||||
<td class='sort-handler'><i class="icon icon-move"></i></td>
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
<tr class='hide'>
|
||||
<th><?php echo $lang->project->status;?></th>
|
||||
<td><?php echo html::hidden('status', 'wait');?></td>
|
||||
<td><?php echo html::hidden('template', $template);?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
@@ -129,6 +129,10 @@
|
||||
<td colspan='4' class='text-center form-actions'>
|
||||
<?php echo html::submitButton();?>
|
||||
<?php echo html::backButton();?>
|
||||
<?php
|
||||
echo html::hidden('template', $template);
|
||||
echo html::hidden('parent', $programID);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -165,4 +169,5 @@
|
||||
</div>
|
||||
</div>
|
||||
<?php js::set('template', $template);?>
|
||||
<?php js::set('programID', $programID);?>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -81,6 +81,7 @@ class task extends control
|
||||
}
|
||||
|
||||
$project = $this->project->getById($projectID);
|
||||
|
||||
$taskLink = $this->createLink('project', 'browse', "projectID=$projectID&tab=task");
|
||||
$storyLink = $this->session->storyList ? $this->session->storyList : $this->createLink('project', 'story', "projectID=$projectID");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user