This commit is contained in:
holan20180123
2020-08-17 16:58:59 +08:00
24 changed files with 1070 additions and 26 deletions
+4 -2
View File
@@ -193,8 +193,10 @@ define('TABLE_RELATION', '`' . $config->db->prefix . 'relation`');
define('TABLE_REPOHISTORY', '`' . $config->db->prefix . 'repohistory`');
define('TABLE_REPOFILES', '`' . $config->db->prefix . 'repofiles`');
define('TABLE_REPOBRANCH', '`' . $config->db->prefix . 'repobranch`');
if(!defined('TABLE_LANG')) define('TABLE_LANG', '`' . $config->db->prefix . 'lang`');
if(!defined('TABLE_STAGE')) define('TABLE_STAGE', '`' . $config->db->prefix . 'stage`');
if(!defined('TABLE_LANG')) define('TABLE_LANG', '`' . $config->db->prefix . 'lang`');
if(!defined('TABLE_STAGE')) define('TABLE_STAGE', '`' . $config->db->prefix . 'stage`');
if(!defined('TABLE_DESIGN')) define('TABLE_DESIGN', '`' . $config->db->prefix . 'design`');
if(!defined('TABLE_DESIGNSPEC')) define('TABLE_DESIGNSPEC', '`' . $config->db->prefix . 'designspec`');
$config->objectTables['product'] = TABLE_PRODUCT;
$config->objectTables['story'] = TABLE_STORY;
+37
View File
@@ -57,3 +57,40 @@ INSERT INTO `zt_stage` (`name`,`percent`,`type`,`createdBy`,`createdDate`,`edite
('测试','15','qa','admin','2020-02-08 21:08:30','admin','2020-02-12 13:50:27','0'),
('发布','10','release','admin','2020-02-08 21:08:30','admin','2020-02-12 13:50:27','0'),
('总结评审','5','review','admin','2020-02-08 21:08:45','admin','2020-02-12 13:50:27','0');
-- DROP TABLE IF EXISTS `zt_flow_design`;
CREATE TABLE `zt_design` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`program` varchar(255) NOT NULL,
`product` varchar(255) NOT NULL,
`commit` varchar(30) NOT NULL,
`project` mediumint(9) NOT NULL DEFAULT '0',
`name` varchar(255) NOT NULL,
`parent` mediumint(8) unsigned NOT NULL,
`status` varchar(30) NOT NULL,
`subStatus` varchar(30) NOT NULL,
`createdBy` varchar(30) NOT NULL,
`createdDate` datetime NOT NULL,
`editedBy` varchar(30) NOT NULL,
`editedDate` datetime NOT NULL,
`commitBy` varchar(30) NOT NULL,
`commitDate` datetime NOT NULL,
`assignedTo` varchar(30) NOT NULL,
`assignedBy` varchar(30) NOT NULL,
`assignedDate` datetime NOT NULL,
`deleted` enum('0','1') NOT NULL DEFAULT '0',
`story` char(30) NOT NULL,
`desc` text NOT NULL,
`version` smallint(6) NOT NULL,
`type` char(30) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `zt_designspec` (
`design` mediumint(8) NOT NULL,
`version` smallint(6) NOT NULL,
`name` varchar(255) NOT NULL,
`desc` text NOT NULL,
`files` varchar(255) NOT NULL,
UNIQUE KEY `design` (`design`,`version`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-23
View File
@@ -1106,7 +1106,6 @@ if(isset($config->global->flow) and $config->global->flow == 'onlyTest')
$lang->menu->cmmi = new stdclass();
$lang->menu->cmmi->programplan = array('link' => '计划|programplan|browse|program={PROGRAM}', 'subModule' => 'programplan');
$lang->menu->cmmi->project = array('link' => $lang->projectCommon . '|project|task|projectID={PROJECT}', 'subModule' => ',project,task,');
$lang->menu->cmmi->review = array('link' => '评审|review|browse|program={PROGRAM}', 'subModule' => ',reviewissue,');
$lang->menu->cmmi->weekly = array('link' => '报告|weekly|index|program={PROGRAM}', 'subModule' => ',milestone,');
$lang->menu->cmmi->doc = array('link' => '文档|doc|index|program={PROGRAM}');
$lang->menu->cmmi->product = array('link' => '需求|product|browse|product={PRODUCT}&branch=&browseType=unclosed&queryID=0&storyType=requirement', 'subModule' => ',story,');
@@ -1116,17 +1115,12 @@ $lang->menu->cmmi->qa = array('link' => '测试|bug|browse|product={
$lang->menu->cmmi->release = array('link' => '发布|release|browse|product={PRODUCT}', 'subModule' => 'release');
$lang->menu->cmmi->issue = '问题|issue|browse|';
$lang->menu->cmmi->risk = '风险|risk|browse|';
$lang->menu->cmmi->report = array('link' => '度量|report|programsummary|program={PROGRAM}', 'subModule' => ',report,measrecord,');
$lang->menu->cmmi->auditplan = array('link' => 'QA|auditplan|browse|', 'subModule' => 'nc');
$lang->menu->cmmi->cm = array('link' => '配置|cm|browse|program={PROGRAM}', 'subModule' => 'cm');
$lang->menu->cmmi->list = array('link' => '更多|workestimation|index|program={PROGRAM}', 'class' => 'dropdown dropdown-hover cmmi-list', 'subModule' => 'stakeholder,workestimation,durationestimation,budget,pssp,stakeholder');
$lang->cmmi = new stdclass();
$lang->cmmi->subMenu = new stdclass();
$lang->cmmi->subMenu->list = new stdclass();
$lang->cmmi->subMenu->list->workestimation = array('link' => '估算|workestimation|index|program=%s', 'subModule' => 'durationestimation,budget');
$lang->cmmi->subMenu->list->pssp = '过程|pssp|browse|program=%s';
$lang->cmmi->subMenu->list->stakeholder = array('link' => '干系人|stakeholder|browse|', 'subModule' => 'stakeholder');
$lang->cmmi->subMenu->list->program = '项目|||';
$lang->cmmiproduct = new stdclass();
@@ -1172,12 +1166,6 @@ $lang->budget->menu = $lang->workestimation->menu;
$lang->programplan->menu->gantt = array('link' => '甘特图|programplan|browse|programID={PROGRAM}&productID={PRODUCT}&type=gantt');
$lang->programplan->menu->lists = array('link' => '阶段列表|programplan|browse|programID={PROGRAM}&productID={PRODUCT}&type=lists', 'alias' => 'create');
$lang->review->menu->review = array('link' => '基线评审列表|review|browse|program={PROGRAM}', 'subModule' => 'review');
$lang->review->menu->issue = array('link' => '问题列表|reviewissue|issue|program={PROGRAM}', 'subModule' => 'reviewissue');
$lang->reviewissue = new stdclass();
$lang->reviewissue->menu = $lang->review->menu;
$lang->weekly->menu->browse = '周报|weekly|index|program={PROGRAM}';
$lang->weekly->menu->issue = '里程碑报告|milestone|index|program={PROGRAM}';
@@ -1186,20 +1174,9 @@ $lang->cmmiproduct->menu->requirement = '用户需求|product|browse|product={PR
$lang->cmmiproduct->menu->story = '软件需求|product|browse|product={PRODUCT}&branch=&browseType=unclosed&queryID=0&storyType=story';
$lang->cmmiproduct->menu->track = '跟踪矩阵|story|track|product={PRODUCT}';
$lang->auditplan->menu->browse = array('link' => '质量保证计划|auditplan|browse|', 'subModule' => 'auditplan');
$lang->auditplan->menu->nc = array('link' => '不符合项|nc|browse|program={PROGRAM}', 'subModule' => 'nc');
$lang->story->menu = $lang->cmmiproduct->menu;
$lang->milestone->menu = $lang->weekly->menu;
$lang->nc->menu = $lang->auditplan->menu;
$lang->cm->menu->browse = array('link' => '基线|cm|browse|program={PROGRAM}', 'alias' => 'create,edit,view');
$lang->cm->menu->report = '基线状态报告|cm|report|program={PROGRAM}';
$lang->stakeholder->menu->plan = array('link' => '介入计划|stakeholder|plan|');
$lang->stakeholder->menu->expectation = array('link' => '期望管理|stakeholder|expectation|', 'alias' => 'createexpect');
$lang->stakeholder->menu->issue = array('link' => '问题管理|stakeholder|issue|');
$lang->stakeholder->menu->list = array('link' => '干系人列表|stakeholder|browse|', 'alias' => 'create,edit,view');
$lang->noMenuModule = array('my', 'todo', 'effort', 'program', 'attend', 'leave', 'makeup', 'overtime', 'lieu', 'holiday', 'custom', 'auditcl', 'subject', 'admin', 'mail', 'extension', 'dev', 'backup', 'action', 'cron', 'issue', 'risk', 'pssp', 'sms', 'message', 'webhook', 'search');
$lang->haveMenuMethod = array('custom');
+5
View File
@@ -0,0 +1,5 @@
<?php
class design extends control
{
}
+7
View File
@@ -0,0 +1,7 @@
<?php
$config->design = new stdclass();
$config->design->editor = new stdclass();
$config->design->editor->create = array('id' => 'desc', 'tools' => 'simpleTools');
$config->design->editor->edit = array('id' => 'desc', 'tools' => 'simpleTools');
$config->design->affectedFixedNum = 7;
+50
View File
@@ -0,0 +1,50 @@
<?php
class design extends control
{
public function browse($productID = 0, $mode = 'browse', $label = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$this->design->setProductMenu($productID);
$product = $this->loadModel('product')->getById($productID);
$project = $this->loadModel('project')->getById($product->program);
$module = 'design';
$action = 'browse';
list($flow, $action, $fields) = $this->design->setFlowActionFields($module, $action);
$this->view->title = $action->name;
$this->view->flow = $flow;
$this->view->fields = $fields;
if($action->action == 'view') $this->view->flowAction = $action;
if($action->action != 'view') $this->view->action = $action;
$this->loadModel('flow')->checkPrivilege($flow, $action);
$this->flow->setSearchParams($flow);
$labels = $this->loadModel('workflowlabel', 'flow')->getList($flow->module);
if(!$label)
{
reset($labels);
$label = current($labels)->id;
}
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$dataList = $this->flow->getDataList($flow, $mode, $label, 0, $orderBy, $pager);
$this->view->dataList = $dataList;
$this->view->valueFields = $this->loadModel('workflowfield', 'flow')->getValueFields($flow->module);
$this->view->moduleMenu = $this->flow->getModuleMenu($flow, $labels);
$this->view->batchActions = $this->flow->buildBatchActions($flow);
$this->view->summary = $this->flow->getSummary($dataList, $fields);
$this->view->mode = $mode;
$this->view->label = $label;
$this->view->allLabel = reset($labels)->id == $label ? 1 : 0;
$this->view->designType = reset($labels)->id == $label ? 'all' : $labels[$label]->params[1]['value'];
$this->view->orderBy = $orderBy;
$this->view->pager = $pager;
$this->view->productID = $productID;
$this->view->program = $project;
$this->display();
}
}
+44
View File
@@ -0,0 +1,44 @@
<?php
class design extends control
{
public function commit($designID, $begin = '', $end = '', $recTotal = 0, $recPerPage = 50, $pageID = 1)
{
$this->app->loadClass('pager', $static = true);
$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);
if($_POST)
{
$this->design->linkCommit($designID);
$result['result'] = 'success';
$result['message'] = $this->lang->saveSuccess;
$result['locate'] = 'parent';
$this->send($result);
}
$linkedRevisions = array();
$relations = $this->loadModel('common')->getRelations('design', $designID, 'commit');
foreach($relations as $relation) $linkedRevisions[] = $relation->BID;
$this->view->title = $this->lang->design->commit;
$this->view->position[] = $this->lang->design->commit;
$this->view->repoID = $repoID;
$this->view->repo = $repo;
$this->view->revisions = $revisions;
$this->view->linkedRevisions = $linkedRevisions;
$this->view->designID = $designID;
$this->view->begin = $begin;
$this->view->end = $end;
$this->view->design = $this->design->getByID($designID);
$this->view->pager = $pager;
$this->display();
}
}
+37
View File
@@ -0,0 +1,37 @@
<?php
class design extends control
{
public function create($productID = 0, $prevModule = '', $prevID = 0)
{
$this->design->setProductMenu($productID);
if($_POST)
{
$productID = $_POST['product'];
$designID = $this->design->create();
if($designID)
{
$this->loadModel('action')->create('design', $designID, 'create');
$response['result'] = 'success';
$response['message'] = $this->lang->saveSuccess;
$response['locate'] = $this->createLink('design', 'browse', "productID=$productID");
$this->send($response);
}
$response['result'] = 'fail';
$response['message'] = dao::getError();
$this->send($response);
}
$this->view->title = $this->lang->design->create;
$this->view->position[] = $this->lang->design->create;
$this->view->users = $this->loadModel('user')->getPairs('noclosed');
$this->view->stories = $this->loadModel('story')->getProductStoryPairs($productID);
$this->view->products = $this->loadModel('product')->getPairs($this->session->program);
$this->view->productID = $productID;
$this->view->program = $this->loadModel('project')->getByID($this->session->program);
$this->display();
}
}
+35
View File
@@ -0,0 +1,35 @@
<?php
class design extends control
{
public function edit($designID = 0)
{
$design = $this->design->getByID($designID);
$design = $this->design->getAffectedScope($design);
$this->design->setProductMenu($design->product);
if($_POST)
{
$changes = $this->design->update($designID);
if($changes)
{
$actionID = $this->loadModel('action')->create('design', $designID, 'edit');
$this->action->logHistory($actionID, $changes);
}
$response['result'] = 'success';
$response['message'] = $this->lang->saveSuccess;
$response['locate'] = $this->createLink('design', 'view', "id=$design->id");
$this->send($response);
}
$this->view->title = $this->lang->design->edit;
$this->view->position[] = $this->lang->design->edit;
$this->view->design = $design;
$this->view->products = $this->loadModel('product')->getPairs($this->session->program);
$this->view->program = $this->loadModel('project')->getByID($this->session->program);
$this->view->stories = $this->loadModel('story')->getProductStoryPairs($design->product);
$this->display();
}
}
+10
View File
@@ -0,0 +1,10 @@
<?php
class design extends control
{
public function revision($repoID)
{
$repo = $this->dao->select('*')->from(TABLE_REPOHISTORY)->where('id')->eq($repoID)->fetch();
$repoURL = $this->createLink('repo', 'revision', "repoID=$repo->repo&revistion=$repo->revision");
header("location:" . $repoURL);
}
}
+24
View File
@@ -0,0 +1,24 @@
<?php
class design extends control
{
public function submit($productID = 0, $designID = 0, $allLabel = 0, $designType = 'all')
{
if($_POST)
{
$object = $this->post->object;
$reviewRange = $this->post->range;
$designID = $this->post->designID;
$product = $this->loadModel('product')->getByID($productID);
$programID = isset($product->project) ? $product->project : $this->session->program;
$reviewRange == 'all' ? $checkedItem = '' : $checkedItem = $designID;
if($reviewRange == 'assign' && empty($checkedItem)) die(js::alert($this->lang->design->errorSelection));
die(js::locate($this->createLink('review', 'create', "program={$programID}&object=$object&productID=$productID&reviewRange=$reviewRange&checkedItem={$checkedItem}"), 'parent'));
}
if($allLabel) unset($this->lang->design->rangeList['assign']);
$this->view->designType = $designType;
$this->display();
}
}
+7
View File
@@ -0,0 +1,7 @@
.searchBox{min-height: 45px;}
.searchBox .srearch-date{float: left; width: 20%}
.searchBox h4{float:left;display: inline-block}
.searchBox span{float:left;line-height:30px}
#logForm .table thead th{background: #efefef}
#begin{margin-right:5px}
#end{margin-left:5px}
+20
View File
@@ -0,0 +1,20 @@
$('#begin, #end').change(function()
{
var begin = $('#begin').val();
var end = $('#end').val();
if(begin.indexOf('-') != -1)
{
var beginarray = begin.split("-");
var begin = '';
for(i = 0; i < beginarray.length; i++) begin = begin + beginarray[i];
}
if(end.indexOf('-') != -1)
{
var endarray = end.split("-");
var end = '';
for(i = 0 ; i < endarray.length ; i++) end = end + endarray[i];
}
location.href = createLink('design', 'commit', "designID=" + designID + '&begin=' + begin + '&end=' + end);
})
+5
View File
@@ -0,0 +1,5 @@
$(document).on('click', '.ajaxPager', function()
{
$('#logBox').load($(this).attr('href'));
return false;
})
+32
View File
@@ -0,0 +1,32 @@
<?php
$lang->design->commit = '关联提交';
$lang->design->type = '设计类型';
$lang->design->name = '设计名称';
$lang->design->create = '创建设计';
$lang->design->edit = '编辑设计';
$lang->design->products = '所属产品';
$lang->design->story = '相关需求';
$lang->design->file = '附件';
$lang->design->desc = '设计描述';
$lang->design->product = '所属产品';
$lang->design->basicInfo = '基础信息';
$lang->design->commitDate = '提交时间';
$lang->design->affectedStory = "影响{$lang->storyCommon}";
$lang->design->affectedTasks = '影响任务';
$lang->design->submit = '提交评审';
$lang->design->revision = '查看关联代码';
$lang->design->reviewObject = '评审对象';
$lang->design->createdBy = '由谁创建';
$lang->design->createdDate = '创建时间';
$lang->design->typeList['HLDS'] = '概要设计';
$lang->design->typeList['DDS'] = '详细设计';
$lang->design->typeList['DBDS'] = '数据库设计';
$lang->design->typeList['ADS'] = '接口设计';
$lang->design->range = '影响范围';
$lang->design->errorSelection = '还没有选中记录!';
$lang->design->rangeList = array();
$lang->design->rangeList['all'] = '全部记录';
$lang->design->rangeList['assign'] = '选中记录';
@@ -0,0 +1,16 @@
<?php
$featurebar = "<div class='btn-toolbar pull-left'>";
$labelPairs = $this->loadModel('workflowlabel')->getPairs($this->app->rawModule);
foreach($labelPairs as $labelID => $labelTitle)
{
$class = ($mode == 'browse' and $labelID == $label) ? "btn-active-text" : '';
$params = "productID=$productID&mode=browse&label=$labelID&orderBy=$orderBy";
$featurebar .= html::a($this->createLink($flow->module, 'browse', $params), "<span class='text'>" . $labelTitle . "</span>", '', "class='btn btn-link $class'");
}
?>
<script>
/* Add list label. */
$('#main #mainMenu').prepend(<?php echo helper::jsonEncode($featurebar);?>);
</script>
+191
View File
@@ -0,0 +1,191 @@
<?php
/**
* The browse view file of flow module of RanZhi.
*
* @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
*/
?>
<?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 $needOrder = ($flow->module == 'process' || $flow->module == 'activity' || $flow->module == 'output');?>
<?php if($needOrder):?>
<?php include '../../../common/view/sortable.html.php';?>
<?php endif;?>
<?php js::set('productID', $productID);?>
<?php js::set('mode', $mode);?>
<?php js::set('module', $flow->module);?>
<?php js::set('label', $label);?>
<?php
$showSubHeader = $program->category == 'single' ? 'hidden' : 'show';
js::set('showSubHeader', $showSubHeader);
?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-right'>
<?php
if(common::hasPriv('design', 'submit')) echo html::a($this->createLink('design', 'submit', "productID=$productID&designID=0&allLabel=$allLabel&designType=$designType"), "<i class='icon icon-plus'></i> {$lang->design->submit}", '', "class='btn btn-secondary iframe' data-width='30%' id='toReview'");
echo $this->flow->buildOperateMenu($flow, $data = null, $type = 'menu');
?>
</div>
</div>
<div id="mainContent" class="main-row fade in">
<div class="main-col">
<div class='main-table' data-ride='table'>
<?php if($batchActions && $dataList):?>
<form id='batchOperateForm' method='post'>
<?php endif;?>
<table class='table has-sort-head' id="<?php echo $flow->module;?>Table">
<thead>
<tr class='text-center'>
<?php $vars = "productID=$productID&mode=$mode&label=$label&orderBy=%s&recTotal=$pager->recTotal&recPerPage=$pager->recPerPage&pageID=$pager->pageID";?>
<?php $index = 1;?>
<?php foreach($fields as $field):?>
<?php if(!$field->show) continue;?>
<?php $width = $field->width && $field->width != 'auto' ? $field->width . 'px' : $field->width;?>
<th class="text-<?php echo $field->position;?>" style="width:<?php echo $width;?>">
<?php if($field->field == 'id' && $allLabel == 0):?>
<div class='checkbox-primary check-all' title='<?php echo $this->lang->selectAll;?>'><label></label></div>
<?php endif;?>
<?php
if($field->field == 'desc' || $field->field == 'asc' || $field->field == 'actions')
{
echo $field->name;
}
else
{
commonModel::printOrderLink($field->field, $orderBy, $vars, $field->name, $flow->module, 'browse');
}
?>
</th>
<?php $index++;?>
<?php endforeach;?>
<?php if($needOrder):?>
<th class='w-60px sort-default text-left'><?php echo $lang->flow->orderAB;?></th>
<?php endif;?>
</tr>
</thead>
<tbody <?php if($needOrder) echo "class='sortable' id='orderTableList'"?>>
<?php foreach($dataList as $data):?>
<tr <?php if($needOrder) echo "data-id=$data->id data-order=$data->order"?>>
<?php $index = 1;?>
<?php foreach($fields as $field):?>
<?php if(!$field->show || $field->field == 'actions') continue;?>
<?php
$output = '';
if(is_array($data->{$field->field}))
{
foreach($data->{$field->field} as $value) $output .= zget($field->options, $value) . ' ';
}
else
{
if($field->field == 'id')
{
if(commonModel::hasPriv($flow->module, 'view'))
{
$output = baseHTML::a(helper::createLink($flow->module, 'view', "dataID={$data->id}"), $data->id);
}
else
{
$output = $data->id;
}
}
elseif($field->field == 'name')
{
$output = html::a(helper::createLink($flow->module, 'view', "id={$data->id}"), $data->{$field->field});
}
else
{
$output = zget($field->options, $data->{$field->field});
}
}
?>
<?php if($field->field == 'id' && $allLabel == 0):?>
<td><?php echo html::checkbox('auditIDList', array($data->id => '')) . html::a($this->createLink('design', 'view', "id=$data->id"), sprintf('%03d', $data->id))?></td>
<?php else:?>
<td class="text-<?php echo $field->position;?>" title='<?php echo strip_tags(str_replace("</p>", "\n", str_replace(array("\n", "\r"), "", $output)));?>'>
<?php if($index == 1 && $batchActions):?>
<div class='checkbox-primary'><input type='checkbox' name='dataIDList[]' value='<?php echo $data->id;?>' id='dataIDList<?php echo $data->id;?>'>
<label for='dataIDList<?php echo $data->id;?>'></label>
</div>
<?php endif;?>
<?php echo $output;?>
</td>
<?php endif;?>
<?php $index++;?>
<?php endforeach;?>
<td class="nowrap text-center"><?php echo $this->flow->buildOperateMenu($flow, $data, $type = 'browse');?></td>
<?php if($needOrder):?>
<td class='sort-handler'><i class="icon icon-move"></i></td>
<?php endif;?>
</tr>
<?php endforeach;?>
</tbody>
</table>
<div class='table-footer'>
<?php if($batchActions && $dataList):?>
<div class='checkbox-primary check-all'><label><?php echo $lang->selectAll?></label></div>
<div class='table-actions btn-toolbar'>
<?php echo $batchActions;?>
</div>
<?php endif;?>
<?php if($summary):?>
<div class='table-statistic'>
<?php echo $lang->workflowlayout->totalShow . '(' . rtrim($summary, ',') . ')';?>
</div>
<?php endif;?>
<?php $pager->show('right', 'pagerjs');?>
</div>
<?php if($batchActions && $dataList):?>
</form>
<?php endif;?>
</div>
</div>
</div>
<?php
js::set('orderBy', $orderBy);
js::set('designCreateLink', $this->createLink('design', 'create', "product=$productID"));
?>
<script>
$('#mainMenu .pull-right a[href*="batchcreate"]').remove();
link = designCreateLink;
$('#mainMenu .pull-right a[href*="create"]').attr('href', link);
$('#toReview').click(function()
{
var designID = '';
$('input:checkbox[name="auditIDList[]"]:checked').each(function(i)
{
if(i == 0)
{
designID = $(this).val();
}
else
{
designID += (',' + $(this).val());
}
});
$.cookie('submitDesignID', designID, { expires: 1, path: '/' });
});
if(showSubHeader == 'hidden') $("#subHeader").remove();
</script>
<?php include '../../../' . 'common/view/footer.html.php';?>
+63
View File
@@ -0,0 +1,63 @@
<?php include '../../../common/view/header.lite.html.php';?>
<?php js::set('showSubHeader', 0);?>
<style>.m-design-commit{padding-left: 0px;}</style>
<div class='main-content' id='mainContent'>
<div class='main-header'>
<h2>
<span class='label label-id'><?php echo $design->id;?></span>
<span title='<?php echo $design->name?>'><?php echo $design->name?></span>
<small><?php echo $lang->arrow . $lang->design->commit;?></small>
</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>
<?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'>
<table class='table'>
<thead>
<tr>
<th class='w-40px'></th>
<th class='w-80px'><?php echo $lang->repo->revisionA?></th>
<?php if(isset($repo->SCM) and $repo->SCM == 'Git'):?>
<th class='w-70px'><?php echo $lang->repo->commit?></th>
<?php endif;?>
<th class='w-120px'><?php echo $lang->repo->time?></th>
<th class='w-100px'><?php echo $lang->repo->committer?></th>
<th><?php echo $lang->repo->comment?></th>
</tr>
</thead>
<tbody>
<?php foreach($revisions as $log):?>
<tr>
<td>
<div class='checkbox-primary'>
<input type='checkbox' name='revision[]' value="<?php echo $log->id?>" <?php if(in_array($log->revision, $linkedRevisions)) echo 'checked="checked"'?>/>
<label></label>
</div>
</td>
<td class='versions'><span class="revision"><?php echo html::a($this->repo->createLink('revision', "repoID=$repoID&revision={$log->revision}"), $repo->SCM == 'Git' ? substr($log->revision, 0, 10) : $log->revision);?></span></td>
<?php if($repo->SCM == 'Git'):?>
<td><?php echo $log->commit?></td>
<?php endif;?>
<td><?php echo substr($log->time, 0, 10);?></td>
<td><?php echo $log->committer;?></td>
<?php $comment = htmlspecialchars($log->comment, ENT_QUOTES);?>
<td title='<?php echo $comment?>' class='comment'><?php echo $log->comment?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<div class='table-footer'>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<div class="table-actions btn-toolbar">
<?php echo html::submitButton('', '', 'btn btn-primary')?>
</div>
<?php $pager->show('right', 'pagerjs');?>
</div>
</form>
</div>
<?php js::set('designID', $designID);?>
<?php include '../../../common/view/footer.lite.html.php';?>
+71
View File
@@ -0,0 +1,71 @@
<?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);
?>
<div id="mainContent" class="main-content fade">
<div class="center-block">
<div class="main-header">
<h2><?php echo $lang->design->create;?></h2>
</div>
<form class="load-indicator main-form form-ajax" method='post' enctype='multipart/form-data' id='dataform'>
<table class="table table-form">
<tbody>
<?php if($program->category == 'multiple'):?>
<tr>
<th class='w-120px'><?php echo $lang->design->product;?></th>
<td><?php echo html::select('product', $products, $productID, "class='form-control chosen'");?></td>
<td></td>
</tr>
<?php endif;?>
<?php if($program->category == 'single'):?>
<?php echo html::hidden('product', $productID);?>
<?php endif;?>
<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>
<td></td>
</tr>
<tr>
<th><?php echo $lang->design->type;?></th>
<td><?php echo html::select('type', $lang->design->typeList, '', "class='form-control chosen'");?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->design->name;?></th>
<td><?php echo html::input('name', '', "class='form-control'");?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->design->desc;?></th>
<td colspan='2'><?php echo html::textarea('desc', '', "class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->design->file;?></th>
<td colspan='2'><?php echo $this->fetch('file', 'buildform', 'fileCount=1&percent=0.85');?></td>
</tr>
<tr>
<td colspan='3' class='text-center form-actions'><?php echo html::submitButton() . html::backButton();?></td>
</tr>
</tbody>
</table>
</form>
</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';?>
+107
View File
@@ -0,0 +1,107 @@
<?php include '../../../common/view/header.html.php';?>
<?php include '../../../common/view/kindeditor.html.php';?>
<style> .tabs .tab-pane .table{border: 1px solid #ddd; border-top: none} </style>
<?php
$showSubHeader = $program->category == 'single' ? 'hidden' : 'show';
js::set('showSubHeader', $showSubHeader);
?>
<div id="mainContent" class="main-content fade">
<div class="center-block">
<div class="main-header">
<h2><?php echo $lang->design->edit;?></h2>
</div>
<form class="load-indicator main-form form-ajax" method='post' enctype='multipart/form-data' id='dataform'>
<table class="table table-form">
<tbody>
<?php if($program->category == 'multiple'):?>
<tr>
<th class='w-120px'><?php echo $lang->design->product;?></th>
<td><?php echo html::select('product', $products, $design->product, "class='form-control chosen'");?></td>
<td></td>
</tr>
<?php endif;?>
<tr>
<th class='w-120px'><?php echo $lang->design->story;?></th>
<td><?php echo html::select('story', empty($stories) ? '' : $stories, $design->story, "class='form-control chosen'");?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->design->type;?></th>
<td><?php echo html::select('type', $lang->design->typeList, $design->type, "class='form-control chosen'");?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->design->name;?></th>
<td><?php echo html::input('name', $design->name, "class='form-control'");?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->design->desc;?></th>
<td colspan='2'><?php echo html::textarea('desc', $design->desc, "class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->design->file;?></th>
<td colspan='2'><?php echo $this->fetch('file', 'buildform', 'fileCount=1&percent=0.85');?></td>
</tr>
<tr>
<th><?php echo $lang->story->checkAffection;?></th>
<td colspan='2'>
<div class='tabs'>
<ul class='nav nav-tabs'>
<li class='active'><a data-toggle='tab' href='#affectedTasks'><?php echo $lang->design->affectedTasks;?><span class='label label-danger label-badge label-circle'><?php echo count($design->tasks);?></span></a></li>
</ul>
<div class='tab-content'>
<div class='tab-pane active' id='affectedTasks'>
<table class='table'>
<thead>
<tr class='text-center'>
<th class='c-id'><?php echo $lang->task->id;?></th>
<th class='text-left'><?php echo $lang->task->name;?></th>
<th class='w-100px'><?php echo $lang->task->assignedTo;?></th>
<th class='c-status'><?php echo $lang->task->status;?></th>
<th class='w-100px'><?php echo $lang->task->consumed;?></th>
<th class='w-90px'><?php echo $lang->task->left;?></th>
</tr>
</thead>
<tbody>
<?php foreach($design->tasks as $task):?>
<tr class='text-center'>
<td><?php $task->id?></td>
<td class='text-left'><?php echo html::a($this->createLink('task', 'view', "taskID=$task->id"), $task->name, '_blank');?></td>;
<td><?php echo zget($users, $task->assignedTo);?></td>
<td><span class='status-task status-<?php echo $task->status;?>'><?php $this->processStatus('task', $task);?></span></td>
<td><?php echo $task->consumed;?></td>
<td><?php echo $task->left;?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
</div>
</div>
</td>
</tr>
<tr>
<td colspan='3' class='text-center form-actions'><?php echo html::submitButton() . html::backButton();?></td>
</tr>
</tbody>
</table>
</form>
</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';?>
+35
View File
@@ -0,0 +1,35 @@
<?php include '../../../common/view/header.lite.html.php';?>
<main id="main">
<div class="container">
<div id="mainContent" class='main-content load-indicator'>
<div class='main-header'>
<h2><?php echo $lang->design->submit;?></h2>
</div>
<form class='main-form' method='post' target='hiddenwin'>
<table class="table table-form">
<tr>
<th><?php echo $lang->design->reviewObject;?></th>
<td>
<?php echo html::select('object', $lang->design->typeList, $designType, "class='form-control'");?>
</td>
</tr>
<tr>
<th><?php echo $lang->design->range;?></th>
<td>
<?php echo html::select('range', $lang->design->rangeList, '', "class='form-control'");?>
</td>
</tr>
<tr>
<th></th>
<?php echo html::hidden('designID', '');?>
<td><?php echo html::submitButton('', '', 'btn btn-primary');?></td>
</tr>
</table>
</form>
</div>
</div>
<script>
var designID = $.cookie('submitDesignID');
$("#designID").val(designID);
</script>
</main>
+93
View File
@@ -0,0 +1,93 @@
<?php include '../../../' . 'common/view/header.html.php';?>
<?php include '../lang/zh-cn/cmmi.php';?>
<?php js::set('linkType', '');?>
<?php js::set('viewMode', 'view');?>
<?php
$productID = $data->product;
$data->product = $this->dao->findByID($productID)->from(TABLE_PRODUCT)->fetch('name');
$this->loadModel('design');
$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'");
$storyTitle = $this->dao->findByID($data->story)->from(TABLE_STORY)->fetch('title');
$data->story = $storyTitle ? html::a($this->createLink('story', 'view', "id=$data->story"), $storyTitle) : '';
$showAction = empty($_GET['onlybody']) ? 'show' : 'hidden';
js::set('showAction', $showAction);
if(!empty($_GET['onlybody']))
{
$data->commit = '';
foreach($relations as $relation) $data->commit .= " #$relation->BID";
$data->story = $storyTitle;
}
?>
<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>
</div>
</div>
</div>
<div id="mainContent" class="main-row">
<div class="main-col col-8">
<div class="cell">
<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' => 'false'));?>
</div>
</div>
</div>
<?php $actions = $this->loadModel('action')->getList($flow->module, $data->id);?>
<div class='cell'><?php include '../../../common/view/action.html.php';?></div>
<?php echo $this->flow->buildOperateMenu($flow, $data, $type = 'view');?>
</div>
<div class='side-col col4'>
<div class='cell'>
<div class="detail">
<table class='table table-data'>
<tr>
<th><?php echo $lang->design->type;?></th>
<td><?php echo zget($fields['type']->options, $data->type);?></td>
</tr>
<tr>
<th><?php echo $lang->design->product;?></th>
<td><?php echo $data->product;?></td>
</tr>
<tr>
<th><?php echo $lang->design->story;?></th>
<td><?php echo $data->story;?></td>
</tr>
<tr>
<th><?php echo $lang->design->commit;?></th>
<td><?php echo $data->commit;?></td>
</tr>
<tr>
<th><?php echo $lang->design->createdBy;?></th>
<td><?php echo zget($users, $data->createdBy);?></td>
</tr>
<tr>
<th><?php echo $lang->design->createdDate;?></th>
<td><?php echo $data->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';?>
+176
View File
@@ -0,0 +1,176 @@
<?php
class designModel extends model
{
public function create()
{
$design = fixer::input('post')
->stripTags('desc', $this->config->allowedTags)
->add('createdBy', $this->app->user->account)
->add('createdDate', helper::now())
->add('program', $this->session->program)
->add('version', 1)
->remove('file,files,labels,children, toList')
->get();
$design = $this->loadModel('file')->processImgURL($design, 'desc', $this->post->uid);
$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);
$spec = new stdclass();
$spec->design = $designID;
$spec->version = 1;
$spec->name = $design->name;
$spec->desc = $design->desc;
$spec->files = empty($files) ? '' : implode(',', array_keys($files));
$this->dao->insert(TABLE_DESIGNSPEC)->data($spec)->exec();
return $designID;
}
return false;
}
public function update($designID)
{
$oldDesign = $this->getByID($designID);
$design = fixer::input('post')
->stripTags('desc', $this->config->allowedTags)
->add('editedBy', $this->app->user->account)
->add('editedDate', helper::now())
->remove('file,files,labels,children, toList')
->get();
$design = $this->loadModel('file')->processImgURL($design, 'desc', $this->post->uid);
$this->dao->update(TABLE_DESIGN)->data($design)->autoCheck()->batchCheck('name,type', 'notempty')->where('id')->eq($designID)->exec();
if(!dao::isError())
{
$this->file->updateObjectID($this->post->uid, $designID, 'design');
$files = $this->file->saveUpload('design', $designID);
$designChanged = ($oldDesign->name != $design->name || $oldDesign->desc != $design->desc || !empty($files));
if($designChanged)
{
$design = $this->getByID($designID);
$version = $design->version + 1;
$spec = new stdclass();
$spec->design = $designID;
$spec->version = $version;
$spec->name = $design->name;
$spec->desc = $design->desc;
$spec->files = empty($files) ? '' : implode(',', array_keys($files));
$this->dao->insert(TABLE_DESIGNSPEC)->data($spec)->exec();
$this->dao->update(TABLE_DESIGN)->set('version')->eq($version)->where('id')->eq($designID)->exec();
}
return common::createChanges($oldDesign, $design);
}
return false;
}
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'];
foreach($revisions as $revision)
{
$data = new stdclass();
$data->program = $this->session->program;
$data->product = $this->session->product;
$data->AType = 'design';
$data->AID = $designID;
$data->BType = 'commit';
$data->BID = $revision;
$data->relation = 'completedin';
$data->extra = $this->session->repoID;
$this->dao->replace(TABLE_RELATION)->data($data)->autoCheck()->exec();
$data->AType = 'commit';
$data->AID = $revision;
$data->BType = 'design';
$data->BID = $designID;
$data->relation = 'completedfrom';
$this->dao->replace(TABLE_RELATION)->data($data)->autoCheck()->exec();
}
}
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);
}
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);
$productID = $this->loadModel('product')->saveState($productID, $products);
$this->loadModel('product')->setMenu($products, $productID);
}
public function getByID($designID)
{
return $this->dao->select('*')->from(TABLE_DESIGN)->where('id')->eq($designID)->fetch();
}
public function getDesignPairs($productID = 0, $type = 'detailed')
{
$designs = $this->dao->select('id, name')->from(TABLE_DESIGN)
->where('product')->eq($productID)
->andWhere('deleted')->eq(0)
->andWhere('type')->eq($type)
->fetchPairs();
foreach($designs as $id => $name) $designs[$id] = $id . ':' . $name;
return $designs;
}
public function getAffectedScope($design)
{
/* Get affected tasks. */
$design->tasks = $this->dao->select('*')->from(TABLE_TASK)
->where('deleted')->eq(0)
->andWhere('status')->ne('closed')
->andWhere('design')->eq($design->id)
->orderBy('id desc')->fetchAll();
return $design;
}
}
+1 -1
View File
@@ -49,7 +49,7 @@
<th class='w-200px'><?php echo $lang->install->company;?></th>
<td class='w-300px'><?php echo html::input('company', '', "class='form-control'");?></td>
</tr>
<tr>
<tr class='hidden'>
<th><?php echo $lang->install->working;?></th>
<td><?php echo html::select('flow', $lang->install->workingList, 'full', "class='form-control chosen'");?></td>
</tr>