* Finish task #7760,7759.
This commit is contained in:
@@ -264,6 +264,28 @@ class design extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlink commit.
|
||||
*
|
||||
* @param int $designID
|
||||
* @param int $commitID
|
||||
* @param string $confirm
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function unlinkCommit($designID = 0, $commitID = 0, $confirm = 'no')
|
||||
{
|
||||
if($confirm == 'no')
|
||||
{
|
||||
die(js::confirm($this->lang->design->confirmUnlink, inlink('unlinkCommit', "designID=$designID&commitID=$commitID&confirm=yes")));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->design->unlinkCommit($designID, $commitID);
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A version of the code base.
|
||||
*
|
||||
@@ -278,6 +300,23 @@ class design extends control
|
||||
header("location:" . $repoURL);
|
||||
}
|
||||
|
||||
/**
|
||||
* View a design's commit.
|
||||
*
|
||||
* @param int $designID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function viewCommit($designID = 0)
|
||||
{
|
||||
$this->view->title = $this->lang->design->common . $this->lang->colon . $this->lang->design->submission;
|
||||
$this->view->position[] = $this->lang->design->submission;
|
||||
|
||||
$this->view->design = $this->design->getCommit($designID);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a design.
|
||||
*
|
||||
|
||||
+15
-12
@@ -38,17 +38,19 @@ $lang->design->basicInfo = 'Basic Information';
|
||||
$lang->design->noAssigned = 'Unassigned';
|
||||
|
||||
/* Action list. */
|
||||
$lang->design->common = 'Design';
|
||||
$lang->design->create = 'Create Design';
|
||||
$lang->design->batchCreate = 'Batch Create';
|
||||
$lang->design->edit = 'Edit';
|
||||
$lang->design->delete = 'Delete';
|
||||
$lang->design->view = 'View';
|
||||
$lang->design->browse = 'List';
|
||||
$lang->design->commit = 'Link Commit';
|
||||
$lang->design->submit = 'Submit Review';
|
||||
$lang->design->assignTo = 'Assign';
|
||||
$lang->design->revision = 'Linked Code';
|
||||
$lang->design->common = 'Design';
|
||||
$lang->design->create = 'Create Design';
|
||||
$lang->design->batchCreate = 'Batch Create';
|
||||
$lang->design->edit = 'Edit';
|
||||
$lang->design->delete = 'Delete';
|
||||
$lang->design->view = 'View';
|
||||
$lang->design->browse = 'List';
|
||||
$lang->design->viewCommit = 'View Commit';
|
||||
$lang->design->linkCommit = 'Link Commit';
|
||||
$lang->design->unlinkCommit = 'Unlink Commit';
|
||||
$lang->design->submit = 'Submit Review';
|
||||
$lang->design->assignTo = 'Assign';
|
||||
$lang->design->revision = 'Linked Code';
|
||||
|
||||
/* Field value. */
|
||||
$lang->design->typeList = array();
|
||||
@@ -69,4 +71,5 @@ $lang->design->featureBar += $lang->design->typeList;
|
||||
$lang->design->errorSelection = 'No record selected!';
|
||||
$lang->design->noDesign = 'No record.';
|
||||
$lang->design->noCommit = 'No record commited.';
|
||||
$lang->design->confirmDelete = 'Do you want to delete this design?';
|
||||
$lang->design->confirmDelete = 'Do you want to delete this design?';
|
||||
$lang->design->confirmUnlink = 'Are you sure you want to remove this submission?';
|
||||
|
||||
@@ -38,17 +38,19 @@ $lang->design->basicInfo = '基本信息';
|
||||
$lang->design->noAssigned = '未指派';
|
||||
|
||||
/* 动作列表. */
|
||||
$lang->design->common = '设计';
|
||||
$lang->design->create = '创建设计';
|
||||
$lang->design->batchCreate = '批量创建';
|
||||
$lang->design->edit = '变更';
|
||||
$lang->design->delete = '删除';
|
||||
$lang->design->view = '设计概况';
|
||||
$lang->design->browse = '浏览列表';
|
||||
$lang->design->linkCommit = '关联提交';
|
||||
$lang->design->submit = '提交评审';
|
||||
$lang->design->assignTo = '指派';
|
||||
$lang->design->revision = '查看关联代码';
|
||||
$lang->design->common = '设计';
|
||||
$lang->design->create = '创建设计';
|
||||
$lang->design->batchCreate = '批量创建';
|
||||
$lang->design->edit = '变更';
|
||||
$lang->design->delete = '删除';
|
||||
$lang->design->view = '设计概况';
|
||||
$lang->design->browse = '浏览列表';
|
||||
$lang->design->viewCommit = '查看提交';
|
||||
$lang->design->linkCommit = '关联提交';
|
||||
$lang->design->unlinkCommit = '取消关联';
|
||||
$lang->design->submit = '提交评审';
|
||||
$lang->design->assignTo = '指派';
|
||||
$lang->design->revision = '查看关联代码';
|
||||
|
||||
/* 字段取值. */
|
||||
$lang->design->typeList = array();
|
||||
@@ -70,3 +72,4 @@ $lang->design->errorSelection = '还没有选中记录!';
|
||||
$lang->design->noDesign = '暂时没有记录';
|
||||
$lang->design->noCommit = '暂时没有提交记录';
|
||||
$lang->design->confirmDelete = '您确定要删除这个设计吗?';
|
||||
$lang->design->confirmUnlink = '您确定要移除这个提交吗?';
|
||||
|
||||
+45
-10
@@ -172,8 +172,6 @@ class designModel extends model
|
||||
*/
|
||||
public function linkCommit($designID = 0, $repoID = 0)
|
||||
{
|
||||
$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)
|
||||
@@ -199,12 +197,40 @@ class designModel extends model
|
||||
$this->dao->replace(TABLE_RELATION)->data($data)->autoCheck()->exec();
|
||||
}
|
||||
$design = new stdclass();
|
||||
$design->commit = implode(",", $revisions);
|
||||
$design->commit = $this->dao->select('commit')->from(TABLE_DESIGN)->where('id')->eq($designID)->fetch('commit');
|
||||
|
||||
if($design->commit)
|
||||
{
|
||||
$design->commit = implode(",", $revisions) . "," . $design->commit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$design->commit = implode(",", $revisions);
|
||||
}
|
||||
|
||||
$design->commitDate = helper::now();
|
||||
$design->commitBy = $this->app->user->account;
|
||||
$this->dao->update(TABLE_DESIGN)->data($design)->autoCheck()->where('id')->eq($designID)->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlink commit.
|
||||
*
|
||||
* @param int $designID
|
||||
* @param int $commitID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function unlinkCommit($designID = 0, $commitID = 0)
|
||||
{
|
||||
$this->dao->delete()->from(TABLE_RELATION)->where('AType')->eq('design')->andwhere('AID')->eq($designID)->andwhere('BType')->eq('commit')->andwhere('relation')->eq('completedin')->andWhere('BID')->eq($commitID)->exec();
|
||||
$this->dao->delete()->from(TABLE_RELATION)->where('AType')->eq('commit')->andwhere('BID')->eq($designID)->andwhere('BType')->eq('design')->andwhere('relation')->eq('completedfrom')->andWhere('AID')->eq($commitID)->exec();
|
||||
|
||||
$commit = $this->dao->select('BID')->from(TABLE_RELATION)->where('AType')->eq('design')->andWhere('AID')->eq($designID)->fetchAll('BID');
|
||||
$commit = implode(",", array_keys($commit));
|
||||
$this->dao->update(TABLE_DESIGN)->set('commit')->eq($commit)->where('id')->eq($designID)->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set product menu.
|
||||
*
|
||||
@@ -312,16 +338,25 @@ class designModel extends model
|
||||
->fetchAll('id');
|
||||
}
|
||||
|
||||
foreach($designs as $id => $design)
|
||||
{
|
||||
$design->commit = '';
|
||||
$relations = $this->loadModel('common')->getRelations('design', $id, 'commit');
|
||||
foreach($relations as $relation) $design->commit .= html::a(helper::createLink('design', 'revision', "repoID=$relation->BID", '', true), "#$relation->BID", '_blank');
|
||||
}
|
||||
|
||||
return $designs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get commit.
|
||||
*
|
||||
* @param int $designID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getCommit($designID = 0)
|
||||
{
|
||||
$design = $this->dao->select('*')->from(TABLE_DESIGN)->where('id')->eq($designID)->fetch();
|
||||
|
||||
$design->commit = $design->commit ? explode(",", $design->commit) : '';
|
||||
|
||||
return $design;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get designs by search.
|
||||
*
|
||||
|
||||
@@ -42,14 +42,13 @@
|
||||
<?php $vars = "productID=$productID&type=$type¶m=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";?>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left w-60px"> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th class="text-left w-60px"> <?php common::printOrderLink('id', $orderBy, $vars, $lang->design->id);?></th>
|
||||
<th class="text-left w-100px"> <?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-150px"> <?php common::printOrderLink('commit', $orderBy, $vars, $lang->design->submission);?></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="c-assignedTo 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-center w-130px"> <?php echo $lang->design->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -58,16 +57,15 @@
|
||||
<td calss="c-id"> <?php printf('%03d', $design->id);?></td>
|
||||
<td class="c-type"> <?php echo zget($lang->design->typeList, $design->type);?></td>
|
||||
<td class="c-name" title="<?php echo $design->name;?>"><?php echo html::a($this->createLink('design', 'view', "id={$design->id}"), $design->name);?></td>
|
||||
<td class="c-commit"> <?php echo $design->commit;?></td>
|
||||
<td class="c-createdBy"> <?php echo $design->createdBy;?></td>
|
||||
<td class="c-createdDate"><?php echo substr($design->createdDate, 0, 11);?></td>
|
||||
<td class="c-assignedTo"> <?php echo $this->design->printAssignedHtml($design, $users);?></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', 'linkCommit', $vars, $design, 'list', 'link', '', 'iframe showinonlybody', true);
|
||||
common::printIcon('design', 'delete', $vars, $design, 'list', 'trash', 'hiddenwin', '', '', '', '', $design->program);
|
||||
common::printIcon('design', 'edit', $vars, $design, 'list', 'fork', '', '', '', '', '', $design->program);
|
||||
common::printIcon('design', 'viewCommit', $vars, $design, 'list', 'glasses', '', 'iframe showinonlybody', true);
|
||||
common::printIcon('design', 'delete', $vars, $design, 'list', 'trash', 'hiddenwin', '', '', '', '', $design->program);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -54,10 +54,11 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($revisions as $log):?>
|
||||
<?php if(in_array($log->id, $linkedRevisions)) continue;?>
|
||||
<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"'?>/>
|
||||
<input type='checkbox' name='revision[]' value="<?php echo $log->id?>"/>
|
||||
<label></label>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* The viewCommit 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.html.php';?>
|
||||
<div id="mainContent" class="main-table">
|
||||
<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->submission;?></small>
|
||||
</h2>
|
||||
</div>
|
||||
<?php if(empty($design->commit)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p><span class="text-muted"><?php echo $lang->design->noCommit;?></span></p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div class='btn-toolbar pull-right'>
|
||||
<?php common::printLink('design', 'linkCommit', "designID=$design->id", "<i class='icon icon-plus'></i>" . $lang->design->linkCommit, '_blank', "class='btn btn-primary'");?>
|
||||
</div>
|
||||
<table class='table table-data'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left"><?php echo $lang->design->submission;?></th>
|
||||
<th class="text-left"><?php echo $lang->design->commitBy;?></th>
|
||||
<th class="text-left"><?php echo $lang->design->commitDate;?></th>
|
||||
<th class="text-center w-50px"> <?php echo $lang->design->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($design->commit as $commit):?>
|
||||
<tr>
|
||||
<td><?php echo html::a(helper::createLink('design', 'revision', "repoID=$commit"), "#$commit", '_blank');?></td>
|
||||
<td><?php echo $design->commitBy;?></td>
|
||||
<td><?php echo substr($design->commitDate, 0, 11);?></td>
|
||||
<td class="c-actions">
|
||||
<?php common::printIcon('design', 'unlinkCommit', "designID=$design->id&commitID=$commit", $design, 'list', 'unlink', 'hiddenwin', 'iframe showinonlybody', true);?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
Reference in New Issue
Block a user