Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms into sprint/master_lanzongjun_fixbug
This commit is contained in:
@@ -80,6 +80,14 @@
|
||||
<?php echo strpos('draft,changing', $story->status) !== false ? html::textarea('spec', htmlSpecialString($story->spec), "rows='5' class='form-control'") : $story->spec;?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='detail'>
|
||||
<div class='detail-title'><?php echo $lang->attatch;?></div>
|
||||
<div class='form-group'>
|
||||
<?php $canChangeFile = strpos('draft,changing', $story->status) !== false ? true : false;?>
|
||||
<?php echo $this->fetch('file', 'printFiles', array('files' => $files, 'fieldset' => 'false', 'object' => $story, 'method' => 'edit', 'showDelete' => $canChangeFile));?>
|
||||
<?php echo $canChangeFile ? $this->fetch('file', 'buildform') : '';?>
|
||||
</div>
|
||||
</div>
|
||||
<?php $this->printExtendFields($story, 'div', 'position=left');?>
|
||||
<div class='detail'>
|
||||
<div class='detail-title'><?php echo $lang->story->comment;?></div>
|
||||
|
||||
@@ -99,7 +99,8 @@ $lang->collapse = 'Zuklappen';
|
||||
$lang->saveSuccess = 'Gespeichert';
|
||||
$lang->importSuccess = 'Gespeichert';
|
||||
$lang->fail = 'Fehlgeschlagen';
|
||||
$lang->addFiles = 'Hinzufügen';
|
||||
$lang->addFiles = 'Hinzufügen ';
|
||||
$lang->deleteFiles = 'Anhang gelöscht ';
|
||||
$lang->files = 'Datei ';
|
||||
$lang->pasteText = 'Einfügen';
|
||||
$lang->uploadImages = 'Hochladen';
|
||||
|
||||
@@ -99,7 +99,8 @@ $lang->collapse = 'Collapse';
|
||||
$lang->saveSuccess = 'Saved';
|
||||
$lang->importSuccess = 'Saved';
|
||||
$lang->fail = 'Fail';
|
||||
$lang->addFiles = 'Added Files';
|
||||
$lang->addFiles = 'Added Files ';
|
||||
$lang->deleteFiles = 'Deleted Files ';
|
||||
$lang->files = 'Files ';
|
||||
$lang->pasteText = 'Multi-line Paste';
|
||||
$lang->uploadImages = 'Multi-image Upload';
|
||||
|
||||
@@ -100,6 +100,7 @@ $lang->saveSuccess = 'Sauvegardé';
|
||||
$lang->importSuccess = 'Sauvé';
|
||||
$lang->fail = 'Echec';
|
||||
$lang->addFiles = 'Fichiers ajoutés ';
|
||||
$lang->deleteFiles = 'Pièce jointe supprimée ';
|
||||
$lang->files = 'Fichiers ';
|
||||
$lang->pasteText = 'Collage Multi-lignes';
|
||||
$lang->uploadImages = 'Upload Multi-images';
|
||||
|
||||
@@ -78,7 +78,8 @@ $lang->collapse = 'Co lại';
|
||||
$lang->saveSuccess = 'Đã lưu';
|
||||
$lang->importSuccess = 'Đã lưu';
|
||||
$lang->fail = 'Thất bại';
|
||||
$lang->addFiles = 'Tập tin đã thêm';
|
||||
$lang->addFiles = 'Tập tin đã thêm ';
|
||||
$lang->deleteFiles = 'Tháo ảnh ';
|
||||
$lang->files = 'Files ';
|
||||
$lang->pasteText = 'Dán nhiều dòng';
|
||||
$lang->uploadImages = 'Tải lên nhiều ảnh';
|
||||
|
||||
@@ -100,6 +100,7 @@ $lang->saveSuccess = '保存成功';
|
||||
$lang->importSuccess = '导入成功';
|
||||
$lang->fail = '失败';
|
||||
$lang->addFiles = '上传了附件 ';
|
||||
$lang->deleteFiles = '删除了附件 ';
|
||||
$lang->files = '附件 ';
|
||||
$lang->pasteText = '多项录入';
|
||||
$lang->uploadImages = '多图上传 ';
|
||||
|
||||
@@ -1457,7 +1457,7 @@ class commonModel extends model
|
||||
echo "<a href='javascript:;'>" . "<i class='icon icon-download'></i> " . $lang->clientName . "</a><ul class='dropdown-menu pull-left'>";
|
||||
echo '<li>' . html::a(helper::createLink('misc', 'downloadClient', '', '', true), $lang->downloadClient, '', "title='$lang->downloadClient' class='iframe text-ellipsis' data-width='600'") . '</li>';
|
||||
echo "<li class='dropdown-submenu' id='downloadMobile'><a href='javascript:;'>" . $lang->downloadMobile . "</a><ul class='dropdown-menu pull-left''>";
|
||||
echo "<li><div class='mobile-qrcode'><img src='{$config->webRoot}theme/default/images/main/mobile_qrcode.png' /><div class='mobile-version'><span>v1.2</span></div></div></li>";
|
||||
echo "<li><div class='mobile-qrcode'><iframe src='https://www.zentao.net/page/appqrcode.html?v={$config->version}' frameborder='0' scrolling='no' seamless></iframe></div></li>";
|
||||
echo "</ul></li>";
|
||||
echo '<li>' . html::a($lang->clientHelpLink, $lang->clientHelp, '', "title='$lang->clientHelp' target='_blank'") . '</li>';
|
||||
echo '</ul></li>';
|
||||
|
||||
@@ -63,9 +63,7 @@ function computeWorkDays(currentID)
|
||||
isBactchEdit = false;
|
||||
if(currentID)
|
||||
{
|
||||
index = currentID.replace('begins[', '');
|
||||
index = index.replace('ends[', '');
|
||||
index = index.replace(']', '');
|
||||
index = currentID.replace(/\w*\[|\]/g, '');
|
||||
if(!isNaN(index)) isBactchEdit = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ $(function()
|
||||
var planID = $('#plan').val();
|
||||
if(planID)
|
||||
{
|
||||
parent.location.href = createLink('execution', 'importPlanStories', 'executionID=' + executionID + '&planID=' + planID);
|
||||
location.href = createLink('execution', 'importPlanStories', 'executionID=' + executionID + '&planID=' + planID);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -387,8 +387,8 @@ $lang->execution->errorSameProducts = "{$lang->executionCommon} Kann n
|
||||
$lang->execution->errorSameBranches = "{$lang->executionCommon} cannot be linked to the same branch twice";
|
||||
$lang->execution->errorBegin = "The start time of {$lang->executionCommon} cannot be less than the start time of the project %s.";
|
||||
$lang->execution->errorEnd = "The end time of {$lang->executionCommon} cannot be greater than the end time %s of the project.";
|
||||
$lang->execution->errorLetterProject = "The start time of stage cannot be less than the start time of the project %s.";
|
||||
$lang->execution->errorGreaterProject = "The end time of stage cannot be greater than the end time %s of the project.";
|
||||
$lang->execution->errorLetterProject = "The start time of {$lang->executionCommon} cannot be less than the start time of the project %s.";
|
||||
$lang->execution->errorGreaterProject = "The end time of {$lang->executionCommon} cannot be greater than the end time %s of the project.";
|
||||
$lang->execution->errorCommonBegin = 'The start date of ' . $lang->executionCommon . ' should be ≥ the start date of project : %s.';
|
||||
$lang->execution->errorCommonEnd = 'The deadline of ' . $lang->executionCommon . ' should be ≤ the deadline of project : %s.';
|
||||
$lang->execution->accessDenied = "Zugriff zu {$lang->executionCommon} verweigert!";
|
||||
|
||||
@@ -387,8 +387,8 @@ $lang->execution->errorSameProducts = "{$lang->executionCommon} cannot
|
||||
$lang->execution->errorSameBranches = "{$lang->executionCommon} cannot be linked to the same branch twice";
|
||||
$lang->execution->errorBegin = "The start time of {$lang->executionCommon} cannot be less than the start time of the project %s.";
|
||||
$lang->execution->errorEnd = "The end time of {$lang->executionCommon} cannot be greater than the end time %s of the project.";
|
||||
$lang->execution->errorLetterProject = "The start time of stage cannot be less than the start time of the project %s.";
|
||||
$lang->execution->errorGreaterProject = "The end time of stage cannot be greater than the end time %s of the project.";
|
||||
$lang->execution->errorLetterProject = "The start time of {$lang->executionCommon} cannot be less than the start time of the project %s.";
|
||||
$lang->execution->errorGreaterProject = "The end time of {$lang->executionCommon} cannot be greater than the end time %s of the project.";
|
||||
$lang->execution->errorCommonBegin = 'The start date of ' . $lang->executionCommon . ' should be ≥ the start date of project : %s.';
|
||||
$lang->execution->errorCommonEnd = 'The deadline of ' . $lang->executionCommon . ' should be ≤ the deadline of project : %s.';
|
||||
$lang->execution->accessDenied = "Your access to {$lang->executionCommon} is denied!";
|
||||
|
||||
@@ -387,8 +387,8 @@ $lang->execution->errorSameProducts = "Ce {$lang->executionCommon} ne
|
||||
$lang->execution->errorSameBranches = "{$lang->executionCommon} cannot be linked to the same branch twice";
|
||||
$lang->execution->errorBegin = "The start time of {$lang->executionCommon} cannot be less than the start time of the project %s.";
|
||||
$lang->execution->errorEnd = "The end time of {$lang->executionCommon} cannot be greater than the end time %s of the project.";
|
||||
$lang->execution->errorLetterProject = "The start time of stage cannot be less than the start time of the project %s.";
|
||||
$lang->execution->errorGreaterProject = "The end time of stage cannot be greater than the end time %s of the project.";
|
||||
$lang->execution->errorLetterProject = "The start time of {$lang->executionCommon} cannot be less than the start time of the project %s.";
|
||||
$lang->execution->errorGreaterProject = "The end time of {$lang->executionCommon} cannot be greater than the end time %s of the project.";
|
||||
$lang->execution->errorCommonBegin = 'The start date of ' . $lang->executionCommon . ' should be ≥ the start date of project : %s.';
|
||||
$lang->execution->errorCommonEnd = 'The deadline of ' . $lang->executionCommon . ' should be ≤ the deadline of project : %s.';
|
||||
$lang->execution->accessDenied = "Votre accès au {$lang->executionCommon} est refusé ! Désolé.";
|
||||
|
||||
@@ -387,8 +387,8 @@ $lang->execution->errorSameProducts = "{$lang->executionCommon}不能
|
||||
$lang->execution->errorSameBranches = "{$lang->executionCommon}不能关联多个相同的分支。";
|
||||
$lang->execution->errorBegin = "{$lang->executionCommon}的开始时间不能小于所属项目的开始时间%s。";
|
||||
$lang->execution->errorEnd = "{$lang->executionCommon}的截止时间不能大于所属项目的结束时间%s。";
|
||||
$lang->execution->errorLetterProject = "阶段的计划开始时间不能小于所属项目的计划开始时间%s。";
|
||||
$lang->execution->errorGreaterProject = "阶段的计划完成时间不能大于所属项目的计划完成时间%s。";
|
||||
$lang->execution->errorLetterProject = "{$lang->executionCommon}的计划开始时间不能小于所属项目的计划开始时间%s。";
|
||||
$lang->execution->errorGreaterProject = "{$lang->executionCommon}的计划完成时间不能大于所属项目的计划完成时间%s。";
|
||||
$lang->execution->errorCommonBegin = $lang->executionCommon . '开始日期应大于等于项目的开始日期:%s。';
|
||||
$lang->execution->errorCommonEnd = $lang->executionCommon . '截止日期应小于等于项目的截止日期:%s。';
|
||||
$lang->execution->accessDenied = "您无权访问该{$lang->executionCommon}!";
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
<?php if($config->systemMode == 'new' and isset($project) and $project->model == 'scrum'):?>
|
||||
<td class='text-left' style='overflow:visible'><?php echo html::select("projects[$executionID]", $allProjects, $executions[$executionID]->project, "class='form-control picker-select' data-lastselected='{$executions[$executionID]->project}' onchange='changeProject(this, $executionID, {$executions[$executionID]->project})'");?></td>
|
||||
<?php endif;?>
|
||||
<td title='<?php echo $executions[$executionID]->name?>'><?php echo html::input("names[$executionID]", $executions[$executionID]->name, "id='names{$executionID}' class='form-control'");?></td>
|
||||
<td title='<?php echo $executions[$executionID]->name?>'><?php echo html::input("names[$executionID]", $executions[$executionID]->name, "class='form-control'");?></td>
|
||||
<?php if(!isset($config->setCode) or $config->setCode == 1):?>
|
||||
<td><?php echo html::input("codes[$executionID]", $executions[$executionID]->code, "class='form-control'");?></td>
|
||||
<?php endif;?>
|
||||
@@ -106,8 +106,8 @@
|
||||
?>
|
||||
</td>
|
||||
<td class='<?php echo zget($visibleFields, 'status', 'hidden')?>'><?php echo html::select("statuses[$executionID]", $lang->execution->statusList, $executions[$executionID]->status, 'class=form-control');?></td>
|
||||
<td><?php echo html::input("begins[$executionID]", $executions[$executionID]->begin, "id='begins{$executionID}' class='form-control form-date' onchange='computeWorkDays(this.id)'");?></td>
|
||||
<td><?php echo html::input("ends[$executionID]", $executions[$executionID]->end, "id='ends{$executionID}' class='form-control form-date' onchange='computeWorkDays(this.id)'");?></td>
|
||||
<td><?php echo html::input("begins[$executionID]", $executions[$executionID]->begin, "class='form-control form-date' onchange='computeWorkDays(this.id)'");?></td>
|
||||
<td><?php echo html::input("ends[$executionID]", $executions[$executionID]->end, "class='form-control form-date' onchange='computeWorkDays(this.id)'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'desc', 'hidden')?>'> <?php echo html::textarea("descs[$executionID]", $executions[$executionID]->desc, "rows='1' class='form-control autosize'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'teamname', 'hidden')?>'><?php echo html::input("teams[$executionID]", $executions[$executionID]->team, "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'days', 'hidden')?>'>
|
||||
@@ -154,26 +154,22 @@ $('#executionForm').submit(function()
|
||||
/* Clear all error messages. */
|
||||
$('input[name^=begins]').each(function()
|
||||
{
|
||||
var beginDateID = $(this).attr('id');
|
||||
var endDateID = beginDateID.replace('begins', 'ends');
|
||||
$('#help' + beginDateID).remove();
|
||||
$('#help' + endDateID).remove();
|
||||
var executionID = $(this).attr('id').replace(/\w*\[|\]/g, '');
|
||||
$('#helpbegins' + executionID).remove();
|
||||
$('#helpends' + executionID).remove();
|
||||
});
|
||||
|
||||
var submitForm = true;
|
||||
$('input[name^=begins]').each(function()
|
||||
{
|
||||
var beginDate = $(this).val();
|
||||
var beginDateID = $(this).attr('id');
|
||||
var executionID = $(this).attr('id').replace(/\w*\[|\]/g, '');
|
||||
|
||||
var nameID = beginDateID.replace('begins', 'names');
|
||||
var endDateID = beginDateID.replace('begins', 'ends');
|
||||
var executionID = beginDateID.replace('begins', '');
|
||||
$('#help' + beginDateID).remove();
|
||||
$('#help' + endDateID).remove();
|
||||
$('#helpbegins' + executionID).remove();
|
||||
$('#helpends' + executionID).remove();
|
||||
|
||||
/* Invalid data is skipped. */
|
||||
var nameVal = $('#' + nameID).val()
|
||||
var nameVal = $("[name='names[" + executionID + "]']").val()
|
||||
if(!nameVal) return;
|
||||
|
||||
var projectBeginDate = '0000-00-00';
|
||||
@@ -199,18 +195,18 @@ $('#executionForm').submit(function()
|
||||
if(!beginDate)
|
||||
{
|
||||
submitForm = false;
|
||||
var emptyBeginHtml = '<div id="help' + beginDateID + '" class="text-danger help-text">' + emptyBegin + '</div>';
|
||||
var emptyBeginHtml = '<div id="helpbegins' + executionID + '" class="text-danger help-text">' + emptyBegin + '</div>';
|
||||
$(this).after(emptyBeginHtml);
|
||||
alert(emptyBegin);
|
||||
return false;
|
||||
}
|
||||
|
||||
var endDate = $('#' + endDateID).val();
|
||||
var endDate = $("[name='ends[" + executionID + "]']").val();
|
||||
if(!endDate)
|
||||
{
|
||||
submitForm = false;
|
||||
var emptyEndHtml = '<div id="help' + endDateID + '" class="text-danger help-text">' + emptyEnd + '</div>';
|
||||
$('#' + endDateID).after(emptyEndHtml);
|
||||
var emptyEndHtml = '<div id="helpends' + executionID + '" class="text-danger help-text">' + emptyEnd + '</div>';
|
||||
$("[name='ends[" + executionID + "]']").after(emptyEndHtml);
|
||||
alert(emptyEnd);
|
||||
return false;
|
||||
}
|
||||
@@ -218,8 +214,8 @@ $('#executionForm').submit(function()
|
||||
if(endDate < beginDate)
|
||||
{
|
||||
submitForm = false;
|
||||
var emptyEndHtml = '<div id="help' + endDateID + '" class="text-danger help-text">' + planFinishSmall + '</div>';
|
||||
$('#' + endDateID).after(emptyEndHtml);
|
||||
var emptyEndHtml = '<div id="helpends' + executionID + '" class="text-danger help-text">' + planFinishSmall + '</div>';
|
||||
$("[name='ends[" + executionID + "]']").after(emptyEndHtml);
|
||||
alert(planFinishSmall);
|
||||
return false;
|
||||
}
|
||||
@@ -228,8 +224,8 @@ $('#executionForm').submit(function()
|
||||
{
|
||||
submitForm = false;
|
||||
var errorBeginTip = errorBegin.replace('%s', projectBeginDate);
|
||||
var errorBeginHtml = '<div id="help' + beginDateID + '" class="text-danger help-text">' + errorBeginTip + '</div>';
|
||||
$('#' + beginDateID).after(errorBeginHtml);
|
||||
var errorBeginHtml = '<div id="helpbegins' + executionID + '" class="text-danger help-text">' + errorBeginTip + '</div>';
|
||||
$("[name='begins[" + executionID + "]']").after(errorBeginHtml);
|
||||
alert(errorBeginTip);
|
||||
return false;
|
||||
}
|
||||
@@ -238,8 +234,8 @@ $('#executionForm').submit(function()
|
||||
{
|
||||
submitForm = false;
|
||||
var errorEndTip = errorEnd.replace('%s', projectEndDate);
|
||||
var errorEndHtml = '<div id="help' + endDateID + '" class="text-danger help-text">' + errorEndTip + '</div>';
|
||||
$('#' + endDateID).after(errorEndHtml);
|
||||
var errorEndHtml = '<div id="helpends' + executionID + '" class="text-danger help-text">' + errorEndTip + '</div>';
|
||||
$("[name='ends[" + executionID + "]']").after(errorEndHtml);
|
||||
alert(errorEndTip);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -306,17 +306,19 @@ class file extends control
|
||||
* @param string $fieldset
|
||||
* @param object $object
|
||||
* @param string $method
|
||||
* @param bool $showDelete
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function printFiles($files, $fieldset, $object = null, $method = 'view')
|
||||
public function printFiles($files, $fieldset, $object = null, $method = 'view', $showDelete = true)
|
||||
{
|
||||
$this->view->files = $files;
|
||||
$this->view->fieldset = $fieldset;
|
||||
$this->view->object = $object;
|
||||
$this->view->method = $method;
|
||||
$this->view->files = $files;
|
||||
$this->view->fieldset = $fieldset;
|
||||
$this->view->object = $object;
|
||||
$this->view->method = $method;
|
||||
$this->view->showDelete = $showDelete;
|
||||
|
||||
if($method == 'view') return $this->display('file', 'viewfiles');
|
||||
if(strpos('view,edit', $method) !== false) return $this->display('file', 'viewfiles');
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
+60
-2
@@ -46,8 +46,9 @@ class fileModel extends model
|
||||
->where('objectType')->eq($objectType)
|
||||
->andWhere('objectID')->eq((int)$objectID)
|
||||
->andWhere('extra')->ne('editor')
|
||||
->beginIF($objectType == 'story' and $extra)->andWhere('extra')->like("%,$extra,%")->fi()
|
||||
->beginIF($objectType != 'story' and $extra)->andWhere('extra')->eq($extra)->fi()
|
||||
->andWhere('deleted')->eq('0')
|
||||
->beginIF($extra)->andWhere('extra')->eq($extra)
|
||||
->orderBy('id')
|
||||
->fetchAll('id');
|
||||
|
||||
@@ -1097,7 +1098,6 @@ class fileModel extends model
|
||||
{
|
||||
return $this->dao->select("id,$value")->from(TABLE_FILE)
|
||||
->where('id')->in($IDs)
|
||||
->andWhere('deleted')->eq('0')
|
||||
->fetchPairs();
|
||||
}
|
||||
|
||||
@@ -1119,4 +1119,62 @@ class fileModel extends model
|
||||
$this->dao->update(TABLE_CASE)->set('`fromCaseVersion`')->eq($fromcaseVersion)->where('`fromCaseID`')->eq($file->objectID)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update version of story files.
|
||||
*
|
||||
* @param int $storyID
|
||||
* @param int $storyVersion
|
||||
* @param array $deleteFiles
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function updateStoryFileVersion($storyID, $storyVersion, $deleteFiles = array())
|
||||
{
|
||||
$oldStoryVersion = $storyVersion - 1;
|
||||
$this->dao->dbh($this->dbh)->update(TABLE_FILE)->set("extra = CONCAT(extra, '$storyVersion,')")
|
||||
->where('objectType')->eq('story')
|
||||
->andWhere('objectID')->eq($storyID)
|
||||
->andWhere('extra')->like("%,$oldStoryVersion,%")
|
||||
->beginIF(!empty($deleteFiles))->andWhere('id')->notin($deleteFiles)->fi()
|
||||
->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete story file.
|
||||
*
|
||||
* @param int $storyID
|
||||
* @param int $storyVersion
|
||||
* @param array $deleteFiles
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function deleteStoryFile($storyID, $storyVersion, $deleteFiles = array())
|
||||
{
|
||||
$deleteFileList = $this->dao->select('*')->from(TABLE_FILE)
|
||||
->where('objectType')->eq('story')
|
||||
->andWhere('objectID')->eq($storyID)
|
||||
->andWhere('extra')->eq(",$storyVersion,")
|
||||
->beginIF(!empty($deleteFiles))->andWhere('id')->in($deleteFiles)->fi()
|
||||
->fetchAll('id');
|
||||
|
||||
if(!empty($deleteFileList))
|
||||
{
|
||||
$this->dao->delete()->from(TABLE_FILE)->where('id')->in(array_keys($deleteFileList))->exec();
|
||||
|
||||
foreach($deleteFileList as $file)
|
||||
{
|
||||
$realPathName = $this->getRealPathName($file->pathname);
|
||||
@unlink($realPathName);
|
||||
}
|
||||
}
|
||||
|
||||
/* When the file is in multiple story versions, 'extra' need delete the version to be deleted. */
|
||||
$this->dao->update(TABLE_FILE)->set("extra = REPLACE(extra, '$storyVersion,', '')")
|
||||
->where('objectType')->eq('story')
|
||||
->andWhere('objectID')->eq($storyID)
|
||||
->andWhere('extra')->like("%,$storyVersion,%")
|
||||
->beginIF(!empty($deleteFiles))->andWhere('id')->in($deleteFiles)->fi()
|
||||
->exec();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
if(common::hasPriv($objectType, 'edit', $object))
|
||||
{
|
||||
echo "<span class='right-icon'> ";
|
||||
if($method != 'storyChange') common::printLink('file', 'edit', "fileID=$file->id", $lang->file->edit, '', "data-width='400' class='fileAction btn btn-link edit iframe text-primary' title='{$lang->file->edit}'");
|
||||
common::printLink('file', 'edit', "fileID=$file->id", $lang->file->edit, '', "data-width='400' class='fileAction btn btn-link edit iframe text-primary' title='{$lang->file->edit}'");
|
||||
if(common::hasPriv('file', 'delete')) echo html::a('###', $lang->delete, '', "class='fileAction btn btn-link text-primary' onclick='deleteFile($file->id)' title='$lang->delete'");
|
||||
echo '</span>';
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<?php endif;?>
|
||||
<style>
|
||||
.file {padding-top: 2px;}
|
||||
ul.files-list {margin-bottom: unset}
|
||||
.files-list>li>a {display: inline; word-wrap: break-word;}
|
||||
.files-list>li>.right-icon {opacity: 1;}
|
||||
.fileAction {color: #0c64eb !important;}
|
||||
@@ -15,7 +16,7 @@
|
||||
.renameFile .icon {margin-top: 8px;}
|
||||
.renameFile .input-group-addon {width: 60px;}
|
||||
.backgroundColor {background: #eff5ff; }
|
||||
.icon.icon-file-text {margin-left: 4px;}
|
||||
.icon.icon-file-text {padding-left: 7px}
|
||||
.right-icon .btn {padding: 0 6px;}
|
||||
</style>
|
||||
<script>
|
||||
@@ -38,13 +39,20 @@ $(document).ready(function()
|
||||
* Delete a file.
|
||||
*
|
||||
* @param int $fileID
|
||||
* @param object $obj
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function deleteFile(fileID)
|
||||
function deleteFile(fileID, obj)
|
||||
{
|
||||
if(!fileID) return;
|
||||
|
||||
<?php if($showDelete and $method == 'edit'):?>
|
||||
$('<input />').attr('type', 'hidden').attr('name', 'deleteFiles[' + fileID + ']').attr('value', fileID).appendTo('ul.files-list');
|
||||
$(obj).closest('li.file').addClass('hidden');
|
||||
<?php else:?>
|
||||
hiddenwin.location.href = createLink('file', 'delete', 'fileID=' + fileID);
|
||||
<?php endif;?>
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,7 +103,7 @@ function downloadFile(fileID, extension, imageWidth, fileTitle)
|
||||
function showRenameBox(fileID)
|
||||
{
|
||||
$('#renameFile' + fileID).closest('li').addClass('hidden');
|
||||
$('#renameBox' + fileID).removeClass('hidden');
|
||||
$('#renameBox' + fileID).closest('li').removeClass('hidden');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +115,7 @@ function showRenameBox(fileID)
|
||||
*/
|
||||
function showFile(fileID)
|
||||
{
|
||||
$('#renameBox' + fileID).addClass('hidden');
|
||||
$('#renameBox' + fileID).closest('li').addClass('hidden');
|
||||
$('#renameFile' + fileID).closest('li').removeClass('hidden');
|
||||
}
|
||||
|
||||
@@ -123,7 +131,6 @@ function setFileName(fileID)
|
||||
var fileName = $('#fileName' + fileID).val();
|
||||
var extension = $('#extension' + fileID).val();
|
||||
var postData = {'fileName' : fileName, 'extension' : extension};
|
||||
$('#renameBox' + fileID ).addClass('hidden');
|
||||
$.ajax(
|
||||
{
|
||||
url:createLink('file', 'edit', 'fileID=' + fileID),
|
||||
@@ -134,7 +141,7 @@ function setFileName(fileID)
|
||||
{
|
||||
$('#fileTitle' + fileID).html("<i class='icon icon-file-text'></i> " + data['title']);
|
||||
$('#renameFile' + fileID).closest('li').removeClass('hidden');
|
||||
$('#renameBox' + fileID).addClass('hidden');
|
||||
$('#renameBox' + fileID).closest('li').addClass('hidden');
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -212,12 +219,12 @@ function setFileName(fileID)
|
||||
|
||||
common::printLink('file', 'download', "fileID=$file->id", "<i class='icon icon-download'></i>", '_blank', "class='fileAction btn btn-link text-primary' title='{$lang->file->downloadFile}'");
|
||||
if(common::hasPriv('file', 'edit')) echo html::a('###', "<i class='icon icon-pencil-alt'></i>", '', "id='renameFile$file->id' class='fileAction btn btn-link edit text-primary' onclick='showRenameBox($file->id)' title='{$lang->file->edit}'");
|
||||
if(common::hasPriv('file', 'delete')) echo html::a('###', "<i class='icon icon-trash'></i>", '', "class='fileAction btn btn-link text-primary' onclick='deleteFile($file->id)' title='$lang->delete'");
|
||||
if($showDelete and common::hasPriv('file', 'delete')) echo html::a('###', "<i class='icon icon-trash'></i>", '', "class='fileAction btn btn-link text-primary' onclick='deleteFile($file->id, this)' title='$lang->delete'");
|
||||
echo '</span>';
|
||||
}
|
||||
echo '</li>';?>
|
||||
|
||||
<li class='file'>
|
||||
<li class='file hidden'>
|
||||
<div>
|
||||
<?php
|
||||
if(strrpos($file->title, '.') !== false)
|
||||
@@ -230,11 +237,11 @@ function setFileName(fileID)
|
||||
$file->title = join('.', $title);
|
||||
}
|
||||
?>
|
||||
<div class='hidden renameFile w-300px' id='renameBox<?php echo $file->id;?>'>
|
||||
<div class='renameFile w-300px' id='renameBox<?php echo $file->id;?>'>
|
||||
<i class='icon icon-file-text'></i>
|
||||
<div class='input-group'>
|
||||
<?php echo html::input('fileName' . $file->id, $file->title, "class='form-control' size='40'");?>
|
||||
<input type="hidden" name="extension" id="extension<?php echo $file->id?>" value="<?php echo $file->extension;?>"/>
|
||||
<input type="text" id="<?php echo 'fileName' . $file->id?>" value="<?php echo $file->title;?>" class='form-control'/>
|
||||
<input type="hidden" id="extension<?php echo $file->id?>" value="<?php echo $file->extension;?>"/>
|
||||
<strong class='input-group-addon'>.<?php echo $file->extension;?></strong>
|
||||
</div>
|
||||
<div class="input-group-btn">
|
||||
|
||||
+27
-15
@@ -747,17 +747,25 @@ class story extends control
|
||||
*/
|
||||
public function edit($storyID, $kanbanGroup = 'default', $storyType = 'story')
|
||||
{
|
||||
$this->loadModel('file');
|
||||
$this->app->loadLang('bug');
|
||||
$story = $this->story->getById($storyID, 0, true);
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$changes = $this->story->update($storyID);
|
||||
$deleteFiles = isset($_POST['deleteFiles']) ? $this->file->getPairs($_POST['deleteFiles'], 'title') : array();
|
||||
$changes = $this->story->update($storyID);
|
||||
if(dao::isError()) return print(js::error(dao::getError()));
|
||||
if($this->post->comment != '' or !empty($changes))
|
||||
|
||||
$files = $this->file->saveUpload($story->type, $storyID, ",$story->version,");
|
||||
if(empty($files) and $this->post->uid != '' and isset($_SESSION['album']['used'][$this->post->uid])) $files = $this->file->getPairs($_SESSION['album']['used'][$this->post->uid]);
|
||||
|
||||
if($this->post->comment != '' or !empty($changes) or !empty($files) or !empty($deleteFiles))
|
||||
{
|
||||
$action = !empty($changes) ? 'Edited' : 'Commented';
|
||||
$actionID = $this->action->create('story', $storyID, $action, $this->post->comment);
|
||||
$action = (!empty($changes) or !empty($files)) ? 'Edited' : 'Commented';
|
||||
$fileAction = empty($files) ? '' : $this->lang->addFiles . join(',', $files) . "\n" ;
|
||||
$fileAction .= empty($deleteFiles) ? '' : $this->lang->deleteFiles . join(',', $deleteFiles) . "\n";
|
||||
$actionID = $this->action->create('story', $storyID, $action, $fileAction . $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
|
||||
$editedStory = $this->dao->findById($storyID)->from(TABLE_STORY)->fetch();
|
||||
@@ -871,6 +879,7 @@ class story extends control
|
||||
$this->view->reviewers = array_keys($reviewerList);
|
||||
$this->view->reviewedReviewer = $reviewedReviewer;
|
||||
$this->view->productReviewers = $this->user->getPairs('noclosed|nodeleted', array_keys($reviewerList), 0, $productReviewers);
|
||||
$this->view->files = $this->file->getByObject($story->type, $storyID, $story->version);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -1084,26 +1093,28 @@ class story extends control
|
||||
*/
|
||||
public function change($storyID, $from = '', $storyType = 'story')
|
||||
{
|
||||
$this->loadModel('file');
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$changes = $this->story->change($storyID);
|
||||
$deleteFiles = isset($_POST['deleteFiles']) ? $this->file->getPairs($_POST['deleteFiles'], 'title') : array();
|
||||
$changes = $this->story->change($storyID);
|
||||
if(dao::isError())
|
||||
{
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'message' => dao::getError()));
|
||||
return print(js::error(dao::getError()));
|
||||
}
|
||||
|
||||
$story = $this->story->getByID($storyID);
|
||||
$version = $this->dao->findById($storyID)->from(TABLE_STORY)->fetch('version');
|
||||
$files = $this->loadModel('file')->saveUpload($story->type, $storyID, $version);
|
||||
|
||||
$files = $this->file->saveUpload($story->type, $storyID, ",$version,");
|
||||
if(empty($files) and $this->post->uid != '' and isset($_SESSION['album']['used'][$this->post->uid])) $files = $this->file->getPairs($_SESSION['album']['used'][$this->post->uid]);
|
||||
|
||||
if($this->post->comment != '' or !empty($changes) or !empty($files))
|
||||
if($this->post->comment != '' or !empty($changes) or !empty($files) or !empty($deleteFiles))
|
||||
{
|
||||
$action = (!empty($changes) or !empty($files)) ? 'Changed' : 'Commented';
|
||||
$fileAction = '';
|
||||
if(!empty($files)) $fileAction = $this->lang->addFiles . join(',', $files) . "\n" ;
|
||||
$actionID = $this->action->create('story', $storyID, $action, $fileAction . $this->post->comment);
|
||||
$action = (!empty($changes) or !empty($files)) ? 'Changed' : 'Commented';
|
||||
$fileAction = empty($files) ? '' : $this->lang->addFiles . join(',', $files) . "\n" ;
|
||||
$fileAction .= empty($deleteFiles) ? '' : $this->lang->deleteFiles . join(',', $deleteFiles) . "\n";
|
||||
$actionID = $this->action->create('story', $storyID, $action, $fileAction . $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
@@ -1168,7 +1179,7 @@ class story extends control
|
||||
$this->view->needReview = (($this->app->user->account == $this->view->product->PO or $this->config->story->needReview == 0) and empty($reviewer)) ? "checked='checked'" : "";
|
||||
$this->view->reviewer = implode(',', array_keys($reviewer));
|
||||
$this->view->productReviewers = $this->user->getPairs('noclosed|nodeleted', $reviewer, 0, $productReviewers);
|
||||
$this->view->files = $this->loadModel('file')->getByObject($story->type, $storyID);
|
||||
$this->view->files = $this->file->getByObject($story->type, $storyID, $story->version);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -1247,6 +1258,7 @@ class story extends control
|
||||
|
||||
$storyID = (int)$storyID;
|
||||
$story = $this->story->getById($storyID, $version, true);
|
||||
$version = empty($version) ? $story->version : $version;
|
||||
$linkModuleName = $this->config->vision == 'lite' ? 'project' : 'product';
|
||||
if(!$story) return print(js::error($this->lang->notFound) . js::locate($this->createLink($linkModuleName, 'index')));
|
||||
|
||||
@@ -1254,7 +1266,7 @@ class story extends control
|
||||
|
||||
$this->story->replaceURLang($story->type);
|
||||
|
||||
$story->files = $this->loadModel('file')->getByObject($story->type, $storyID);
|
||||
$story->files = $this->loadModel('file')->getByObject($story->type, $storyID, $version);
|
||||
$product = $this->dao->findById($story->product)->from(TABLE_PRODUCT)->fields('name, id, type, status')->fetch();
|
||||
$plan = $this->dao->findById($story->plan)->from(TABLE_PRODUCTPLAN)->fetch('title');
|
||||
$bugs = $this->dao->select('id,title,status,pri,severity')->from(TABLE_BUG)->where('story')->eq($storyID)->andWhere('deleted')->eq(0)->fetchAll();
|
||||
@@ -1318,7 +1330,7 @@ class story extends control
|
||||
$this->view->storyModule = $storyModule;
|
||||
$this->view->modulePath = $modulePath;
|
||||
$this->view->storyProducts = $storyProducts;
|
||||
$this->view->version = $version == 0 ? $story->version : $version;
|
||||
$this->view->version = $version;
|
||||
$this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('story', $storyID);
|
||||
$this->view->from = $from;
|
||||
$this->view->param = $param;
|
||||
|
||||
+15
-8
@@ -265,7 +265,7 @@ class storyModel extends model
|
||||
}
|
||||
|
||||
$this->file->updateObjectID($this->post->uid, $storyID, $story->type);
|
||||
$this->file->saveUpload($story->type, $storyID, $extra = 1);
|
||||
$this->file->saveUpload($story->type, $storyID, ',1,');
|
||||
|
||||
if(!empty($story->plan))
|
||||
{
|
||||
@@ -685,7 +685,7 @@ class storyModel extends model
|
||||
$oldStoryReviewers = $this->getReviewerPairs($storyID, $oldStory->version);
|
||||
$_POST['reviewer'] = isset($_POST['reviewer']) ? $_POST['reviewer'] : array();
|
||||
$reviewerHasChanged = (array_diff(array_keys($oldStoryReviewers), $_POST['reviewer']) or array_diff($_POST['reviewer'], array_keys($oldStoryReviewers)));
|
||||
if($story->spec != $oldStory->spec or $story->verify != $oldStory->verify or $story->title != $oldStory->title or $this->loadModel('file')->getCount() or $reviewerHasChanged) $specChanged = true;
|
||||
if($story->spec != $oldStory->spec or $story->verify != $oldStory->verify or $story->title != $oldStory->title or $this->loadModel('file')->getCount() or $reviewerHasChanged or isset($_POST['deleteFiles'])) $specChanged = true;
|
||||
|
||||
$now = helper::now();
|
||||
$story = fixer::input('post')
|
||||
@@ -703,7 +703,7 @@ class storyModel extends model
|
||||
->setIF($specChanged and $oldStory->closedBy, 'closedDate', '0000-00-00')
|
||||
->setIF(!$specChanged, 'status', $oldStory->status)
|
||||
->stripTags($this->config->story->editor->change['id'], $this->config->allowedTags)
|
||||
->remove('files,labels,reviewer,comment,needNotReview,uid')
|
||||
->remove('files,labels,reviewer,comment,needNotReview,uid,deleteFiles')
|
||||
->get();
|
||||
|
||||
$story = $this->loadModel('file')->processImgURL($story, $this->config->story->editor->change['id'], $this->post->uid);
|
||||
@@ -760,6 +760,10 @@ class storyModel extends model
|
||||
$oldStory->reviewers = implode(',', array_keys($oldStoryReviewers));
|
||||
$story->reviewers = implode(',', $_POST['reviewer']);
|
||||
}
|
||||
|
||||
$deleteFiles = isset($_POST['deleteFiles']) ? $_POST['deleteFiles'] : array();
|
||||
if(!empty($deleteFiles)) $this->file->deleteStoryFile($story->id, $story->version, $deleteFiles);
|
||||
$this->file->updateStoryFileVersion($story->id, $story->version, $deleteFiles);
|
||||
}
|
||||
|
||||
$this->file->updateObjectID($this->post->uid, $storyID, 'story');
|
||||
@@ -824,7 +828,7 @@ class storyModel extends model
|
||||
->join('linkStories', ',')
|
||||
->join('linkRequirements', ',')
|
||||
->join('childStories', ',')
|
||||
->remove('files,labels,comment,contactListMenu,stages,reviewer,needNotReview')
|
||||
->remove('files,labels,comment,contactListMenu,stages,reviewer,needNotReview,deleteFiles')
|
||||
->get();
|
||||
|
||||
if($oldStory->type == 'story' and !isset($story->linkStories)) $story->linkStories = '';
|
||||
@@ -1031,6 +1035,9 @@ class storyModel extends model
|
||||
$this->dao->update(TABLE_STORY)->set($linkStoryField)->eq(implode(',', $linkStories))->where('id')->eq((int)$changeStoryID)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['deleteFiles'])) $this->file->deleteStoryFile($storyID, $oldStory->version, $_POST['deleteFiles']);
|
||||
$this->file->updateObjectID($this->post->uid, $storyID, 'story');
|
||||
return common::createChanges($oldStory, $story);
|
||||
}
|
||||
}
|
||||
@@ -1478,7 +1485,7 @@ class storyModel extends model
|
||||
$this->dao->delete()->from(TABLE_STORYREVIEW)->where('story')->eq($storyID)->andWhere('version')->in($deleteVersion)->exec();
|
||||
}
|
||||
|
||||
$this->dao->delete()->from(TABLE_FILE)->where('objectType')->eq('story')->andWhere('objectID')->eq($storyID)->andWhere('extra')->eq($oldStory->version)->exec();
|
||||
$this->file->deleteStoryFile($storyID, $oldStory->version);
|
||||
}
|
||||
if($this->post->result != 'reject') $this->setStage($storyID);
|
||||
|
||||
@@ -1585,10 +1592,10 @@ class storyModel extends model
|
||||
*/
|
||||
public function recallChange($storyID)
|
||||
{
|
||||
$story = $this->getById($storyID);
|
||||
$preVersion = $story->version - 1;
|
||||
$story = $this->getById($storyID);
|
||||
|
||||
/* Update story title and version and status. */
|
||||
$preVersion = $story->version - 1;
|
||||
$preTitle = $this->dao->select('title')->from(TABLE_STORYSPEC)->where('story')->eq($storyID)->andWHere('version')->eq($preVersion)->fetch('title');
|
||||
$this->dao->update(TABLE_STORY)->set('title')->eq($preTitle)->set('version')->eq($preVersion)->set('status')->eq('active')->where('id')->eq($storyID)->exec();
|
||||
|
||||
@@ -1596,7 +1603,7 @@ class storyModel extends model
|
||||
$this->dao->delete()->from(TABLE_STORYSPEC)->where('story')->eq($storyID)->andWHere('version')->eq($story->version)->exec();
|
||||
$this->dao->delete()->from(TABLE_STORYREVIEW)->where('story')->eq($storyID)->andWhere('version')->eq($story->version)->exec();
|
||||
|
||||
$this->dao->delete()->from(TABLE_FILE)->where('objectType')->eq('story')->andWhere('objectID')->eq($storyID)->andWhere('extra')->eq($story->version)->exec();
|
||||
$this->loadModel('file')->deleteStoryFile($storyID, $story->version);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
<tr>
|
||||
<th><?php echo $lang->attatch;?></th>
|
||||
<td>
|
||||
<?php echo $this->fetch('file', 'printFiles', array('files' => $files, 'fieldset' => 'true', 'object' => $story, 'method' => 'storyChange'));?>
|
||||
<?php echo $this->fetch('file', 'printFiles', array('files' => $files, 'fieldset' => 'false', 'object' => $story, 'method' => 'edit'));?>
|
||||
<?php echo $this->fetch('file', 'buildform');?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -85,6 +85,14 @@
|
||||
<?php echo strpos('draft,changing', $story->status) !== false ? html::textarea('verify', htmlSpecialString($story->verify), "rows='5' class='form-control'") : $story->verify;?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='detail'>
|
||||
<div class='detail-title'><?php echo $lang->attatch;?></div>
|
||||
<div class='form-group'>
|
||||
<?php $canChangeFile = strpos('draft,changing', $story->status) !== false ? true : false;?>
|
||||
<?php echo $this->fetch('file', 'printFiles', array('files' => $files, 'fieldset' => 'false', 'object' => $story, 'method' => 'edit', 'showDelete' => $canChangeFile));?>
|
||||
<?php echo $canChangeFile ? $this->fetch('file', 'buildform') : '';?>
|
||||
</div>
|
||||
</div>
|
||||
<?php $this->printExtendFields($story, 'div', 'position=left');?>
|
||||
<div class='detail'>
|
||||
<div class='detail-title'><?php echo $lang->story->comment;?></div>
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
-->
|
||||
<?php echo $this->fetch('file', 'printFiles', array('files' => $story->files, 'fieldset' => 'true', 'object' => $story));?>
|
||||
<?php echo $this->fetch('file', 'printFiles', array('files' => $story->files, 'fieldset' => 'true', 'object' => $story, 'method' => 'view', 'showDelete' => false));?>
|
||||
<?php
|
||||
$canBeChanged = common::canBeChanged('story', $story);
|
||||
if($canBeChanged) $actionFormLink = $this->createLink('action', 'comment', "objectType=story&objectID=$story->id");
|
||||
|
||||
@@ -549,6 +549,9 @@ class upgradeModel extends model
|
||||
$this->updateStoryStatus();
|
||||
if(strpos($fromVersion, 'max') !== false) $this->syncCase2Project();
|
||||
break;
|
||||
case '17_6':
|
||||
$this->updateStoryFile();
|
||||
break;
|
||||
}
|
||||
|
||||
$this->deletePatch();
|
||||
@@ -7204,4 +7207,38 @@ class upgradeModel extends model
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update story file version.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function updateStoryFile()
|
||||
{
|
||||
$storyFileList = $this->dao->select('*')->from(TABLE_FILE)->where('objectType')->eq('story')->andWhere('extra')->ne('editor')->fetchAll('id');
|
||||
|
||||
/* Get story version. */
|
||||
$storyIDList = array();
|
||||
foreach($storyFileList as $file) $storyIDList[$file->objectID] = $file->objectID;
|
||||
$storyVersionList = $this->dao->select('id,version')->from(TABLE_STORY)->where('id')->in($storyIDList)->fetchPairs();
|
||||
|
||||
foreach($storyFileList as $file)
|
||||
{
|
||||
if(!is_numeric($file->extra)) continue;
|
||||
|
||||
$fileExtra = '';
|
||||
$storyVersion = $storyVersionList[$file->objectID];
|
||||
if($file->extra != $storyVersion)
|
||||
{
|
||||
for($i = $file->extra; $i <= $storyVersion; $i ++) $fileExtra .= ",$i";
|
||||
$fileExtra .= ',';
|
||||
}
|
||||
if(empty($fileExtra)) $fileExtra = ",$file->extra,";
|
||||
|
||||
$this->dao->update(TABLE_FILE)->set('extra')->eq($fileExtra)->where('id')->eq($file->id)->exec();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1393,13 +1393,14 @@ class bugTest
|
||||
/**
|
||||
* Test get bug pairs of a product.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $productID
|
||||
* @param int|string $branch
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getProductBugPairsTest($productID)
|
||||
public function getProductBugPairsTest($productID, $branch = '')
|
||||
{
|
||||
$array = $this->objectModel->getProductBugPairs($productID);
|
||||
$array = $this->objectModel->getProductBugPairs($productID, $branch);
|
||||
|
||||
$title = '';
|
||||
foreach($array as $bug) $title .= ',' . $bug;
|
||||
|
||||
@@ -450,12 +450,17 @@ class taskTest
|
||||
* Test get tasks of a execution.
|
||||
*
|
||||
* @param int $executionID
|
||||
* @param int $productID
|
||||
* @param string $type
|
||||
* @param string $modules
|
||||
* @param string $orderBy
|
||||
* @param string $count
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getExecutionTasksTest($executionID,$count)
|
||||
public function getExecutionTasksTest($executionID, $productID = 0, $type = 'all', $modules = 0, $orderBy = 'status_asc, id_desc', $count = '0')
|
||||
{
|
||||
$object = $this->objectModel->getExecutionTasks($executionID);
|
||||
$object = $this->objectModel->getExecutionTasks($executionID, $productID, $type, $modules, $orderBy);
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
|
||||
@@ -16,16 +16,21 @@ pid=1
|
||||
测试获取productID为5的bug >> 15:缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();15,14:BUG14,13:BUG13
|
||||
测试获取productID为6的bug >> 18:BUG18,17:BUG17,16:bug16
|
||||
测试获取不存在的product的bug >> 0
|
||||
测试获取productID为45,主干分支的bug >> 133:BUG133
|
||||
测试获取productID为45,分支为9的bug >> 134:BUG134
|
||||
|
||||
*/
|
||||
|
||||
$productIDList = array('1', '2', '3', '4','5', '6', '1000001');
|
||||
$productIDList = array('1', '2', '3', '4','5', '6', '1000001', '45');
|
||||
$branchIDList = array('9');
|
||||
|
||||
$bug=new bugTest();
|
||||
r($bug->getProductBugPairsTest($productIDList[0])) && p() && e('3:BUG3,2:BUG2,1:BUG1'); // 测试获取productID为1的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[1])) && p() && e('6:BUG6,5:BUG5,4:BUG4'); // 测试获取productID为2的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[2])) && p() && e('9:BUG9,8:bug8,7:缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7'); // 测试获取productID为3的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[3])) && p() && e('12:BUG12,11:BUG11,10:BUG10'); // 测试获取productID为4的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[4])) && p() && e('15:缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();15,14:BUG14,13:BUG13'); // 测试获取productID为5的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[5])) && p() && e('18:BUG18,17:BUG17,16:bug16'); // 测试获取productID为6的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[6])) && p() && e('0'); // 测试获取不存在的product的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[0])) && p() && e('3:BUG3,2:BUG2,1:BUG1'); // 测试获取productID为1的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[1])) && p() && e('6:BUG6,5:BUG5,4:BUG4'); // 测试获取productID为2的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[2])) && p() && e('9:BUG9,8:bug8,7:缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7'); // 测试获取productID为3的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[3])) && p() && e('12:BUG12,11:BUG11,10:BUG10'); // 测试获取productID为4的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[4])) && p() && e('15:缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();15,14:BUG14,13:BUG13'); // 测试获取productID为5的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[5])) && p() && e('18:BUG18,17:BUG17,16:bug16'); // 测试获取productID为6的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[6])) && p() && e('0'); // 测试获取不存在的product的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[7], 0)) && p() && e('133:BUG133'); // 测试获取productID为45,主干分支的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[7], $branchIDList[0])) && p() && e('134:BUG134'); // 测试获取productID为45,分支为9的bug
|
||||
|
||||
@@ -12,12 +12,23 @@ pid=1
|
||||
|
||||
根据执行id获取任务列表 >> 开发任务11
|
||||
根据执行id获取任务数量 >> 4
|
||||
根据执行id,按pri升序获取第一个任务pri >> 3
|
||||
根据执行id,按pri降序获取第一个任务pri >> 1
|
||||
|
||||
*/
|
||||
|
||||
$executionID = '101';
|
||||
$productID = 0;
|
||||
$type = 'all';
|
||||
$modules = 0;
|
||||
$orderBy = array('status_asc, id_desc', 'pri_desc', 'pri_asc');
|
||||
$count = array('0','1');
|
||||
|
||||
$task = new taskTest();
|
||||
r($task->getExecutionTasksTest($executionID,$count[0])) && p('1:name') && e('开发任务11'); //根据执行id获取任务列表
|
||||
r($task->getExecutionTasksTest($executionID,$count[1])) && p() && e('4'); //根据执行id获取任务数量
|
||||
$priDescTasks = $task->getExecutionTasksTest($executionID, $productID, $type, $modules, $orderBy[1]);
|
||||
$priAscTasks = $task->getExecutionTasksTest($executionID, $productID, $type, $modules, $orderBy[2]);
|
||||
|
||||
r($task->getExecutionTasksTest($executionID)) && p('1:name') && e('开发任务11'); //根据执行id获取任务列表
|
||||
r($task->getExecutionTasksTest($executionID, $productID, $type, $modules, $orderBy[0], $count[1])) && p() && e('4'); //根据执行id获取任务数量
|
||||
r(array_shift($priDescTasks)) && p('pri') && e('3'); //根据执行id,按pri升序获取第一个任务pri
|
||||
r(array_shift($priAscTasks)) && p('pri') && e('1'); //根据执行id,按pri降序获取第一个任务pri
|
||||
|
||||
@@ -106,6 +106,7 @@ body.xxc-embed.m-productplan-view,body.xxc-embed.m-bug-browse,body.xxc-embed.m-p
|
||||
.xxc-embed .modal-iframe .modal-header .close {font-size: 28px !important;}
|
||||
|
||||
#downloadMobile .dropdown-menu {top: -31px !important; min-width: 130px; padding: 0;}
|
||||
#downloadMobile .dropdown-menu .mobile-qrcode {padding: 15px 5px 0 5px;}
|
||||
#downloadMobile .dropdown-menu .mobile-qrcode {padding: 15px 0px 0 10px;}
|
||||
#downloadMobile .dropdown-menu .mobile-qrcode iframe {width: 110px; height: 120px; text-align: center;}
|
||||
#downloadMobile .dropdown-menu .mobile-version {text-align: center;}
|
||||
#downloadMobile .dropdown-menu .mobile-version span {color: #0c64eb; font-size: 12px; font-weight: 700;}
|
||||
|
||||
Reference in New Issue
Block a user