Merge branch 'master' of github.com:easysoft/zentaopms

This commit is contained in:
xia0ta0
2014-03-24 14:25:40 +08:00
39 changed files with 105 additions and 158 deletions
-1
View File
@@ -1,2 +1 @@
ALTER TABLE `zt_project` DROP `goal`;
ALTER TABLE `zt_build` ADD `packageType` varchar(10) COLLATE 'utf8_general_ci' NOT NULL DEFAULT 'path' AFTER `scmPath`;
-1
View File
@@ -67,7 +67,6 @@ CREATE TABLE IF NOT EXISTS `zt_build` (
`project` mediumint(8) unsigned NOT NULL default '0',
`name` char(150) NOT NULL,
`scmPath` char(255) NOT NULL,
`packageType` varchar(10) COLLATE 'utf8_general_ci' NOT NULL DEFAULT 'path',
`filePath` char(255) NOT NULL,
`date` date NOT NULL,
`stories` text NOT NULL,
+1
View File
@@ -784,6 +784,7 @@ EOT;
$jsConfig->submitting = $lang->submitting;
$jsConfig->save = $lang->save;
$jsConfig->router = $app->server->PHP_SELF;
$jsConfig->timeout = $lang->timeout;
$js = self::start(false);
$js .= 'var config=' . json_encode($jsConfig);
+8 -3
View File
@@ -836,9 +836,11 @@ class bug extends control
if($this->post->bugIDList)
{
$bugIDList = $this->post->bugIDList;
foreach($_POST as $postKey => $postValue) unset($_POST[$postKey]);
$bugs = $this->bug->getList($bugIDList);
/* Reset $_POST. Do not unset that because the function of close need that in model. */
$_POST = array();
$bugs = $this->bug->getByList($bugIDList);
foreach($bugs as $bugID => $bug)
{
if($bug->status != 'resolved')
@@ -1031,6 +1033,9 @@ class bug extends control
*/
public function sendmail($bugID, $actionID)
{
/* Reset $this->output. */
$this->clear();
/* Set toList and ccList. */
$bug = $this->bug->getByID($bugID);
$productName = $this->products[$bug->product];
@@ -1067,7 +1072,7 @@ class bug extends control
$this->view->bug = $bug;
$this->view->action = $action;
$this->view->users = $this->user->getPairs('noletter');
$this->clear();
$mailContent = $this->parse($this->moduleName, 'sendmail');
/* Send it. */
+2 -2
View File
@@ -1,4 +1,4 @@
body{background:white; overflow:hidden;}
.btn-group .btn{display: block;width: 80px;text-align: center;margin-top: -1px;}
.btn-group .btn{display: block;width: 60px;text-align: center; padding: 4px; margin-bottom:2px;}
.btn-group .btn:hover{z-index: 9999;}
.btn-group .btn i{line-height: 21px;}
.btn-group .btn i{line-height: 21px;}
+4 -3
View File
@@ -78,6 +78,7 @@ class bugModel extends model
$data = fixer::input('post')->get();
$actions = array();
/* Get pairs(moduleID => moduleOwner) for bug. */
$stmt = $this->dbh->query($this->loadModel('tree')->buildMenuQuery($productID, 'bug', $startModuleID = 0));
$moduleOwners = array();
while($module = $stmt->fetch()) $moduleOwners[$module->id] = $module->owner;
@@ -201,7 +202,7 @@ class bugModel extends model
* @access public
* @return array
*/
public function getList($bugIDList = 0)
public function getByList($bugIDList = 0)
{
return $this->dao->select('*')->from(TABLE_BUG)
->where('deleted')->eq(0)
@@ -422,7 +423,7 @@ class bugModel extends model
public function batchConfirm($bugIDList)
{
$now = helper::now();
$bugs = $this->getList($bugIDList);
$bugs = $this->getByList($bugIDList);
foreach($bugIDList as $bugID)
{
if($bugs[$bugID]->confirmed) continue;
@@ -482,7 +483,7 @@ class bugModel extends model
public function batchResolve($bugIDList, $resolution, $resolvedBuild)
{
$now = helper::now();
$bugs = $this->getList($bugIDList);
$bugs = $this->getByList($bugIDList);
foreach($bugIDList as $bugID)
{
$oldBug = $bugs[$bugID];
+1 -1
View File
@@ -40,7 +40,7 @@ js::set('customed', $customed);
<?php
echo '<span class="link-button dropButton">';
echo html::a("#", "<i class='icon-upload-alt'></i> " . $lang->export, '', "id='exportAction' onclick=\"toggleSubMenu(this.id,'bottom',0)\" title='{$lang->export}'");
echo html::a("#", "<i class='icon-upload-alt'></i> " . $lang->export, '', "id='exportAction' onclick=\"toggleSubMenu(this.id,'bottom',0)\"");
echo '</span>';
common::printIcon('bug', 'report', "productID=$productID&browseType=$browseType&moduleID=$moduleID");
+1 -9
View File
@@ -24,15 +24,7 @@ if($onlybody) $_GET['onlybody'] = 'no';
<td>
<fieldset>
<legend><?php echo $lang->bug->legendSteps;?></legend>
<div class='content'>
<?php
if(strpos($bug->steps, 'src="data/upload'))
{
$bug->steps = preg_replace('/<img (.*)src="/', '<img $1 src="http://' . $this->server->http_host . $this->config->webRoot, $bug->steps);
}
echo $bug->steps;
?>
</div>
<div class='content'><?php echo $bug->steps;?></div>
</fieldset>
</td>
</tr>
-22
View File
@@ -1,22 +0,0 @@
$(document).ready(function()
{
$("a.preview").colorbox({width:1000, height:550, iframe:true, transition:'none', scrolling:true});
if(typeof(packageType) != 'undefined')
{
var hiddenDom = packageType == 'filePath' ? 'fileform' : 'filePath';
$('#' + hiddenDom).parents('tr').addClass('hidden');
}
$("input[name='packageType']").bind('click', function()
{
if($(this).val() == 'path')
{
$('#filePath').parents('tr').removeClass('hidden');
$('#fileform').parents('tr').addClass('hidden');
}
else
{
$('#filePath').parents('tr').addClass('hidden');
$('#fileform').parents('tr').removeClass('hidden');
}
})
})
-4
View File
@@ -37,10 +37,6 @@ $lang->build->linkStories = 'Stories';
$lang->build->linkBugs = 'Bugs';
$lang->build->stories = 'Linked stories';
$lang->build->bugs = 'Linked bugs';
$lang->build->packageType = 'Package type';
$lang->build->finishStories = 'The total demand for a complete %s';
$lang->build->resolvedBugs = 'The total solution of bug%s';
$lang->build->packageTypeList['path'] = 'Shared file';
$lang->build->packageTypeList['file'] = 'Upload file';
+1 -5
View File
@@ -28,7 +28,7 @@ $lang->build->name = '名称编号';
$lang->build->date = '打包日期';
$lang->build->builder = '构建者';
$lang->build->scmPath = '源代码地址';
$lang->build->filePath = '存储地址';
$lang->build->filePath = '下载地址';
$lang->build->desc = '描述';
$lang->build->files = '上传发行包';
$lang->build->last = '上个版本';
@@ -37,10 +37,6 @@ $lang->build->linkStories = '相关需求';
$lang->build->linkBugs = '相关Bug';
$lang->build->stories = '已关联需求';
$lang->build->bugs = '已关联Bug';
$lang->build->packageType = '发行包方式';
$lang->build->finishStories = '本次共完成需求%s个';
$lang->build->resolvedBugs = '本次共解决Bug%s个';
$lang->build->packageTypeList['path'] = '文件共享';
$lang->build->packageTypeList['file'] = '上传附件';
-4
View File
@@ -160,8 +160,6 @@ class buildModel extends model
->remove('resolvedBy,allchecker,files,labels')
->get();
if($build->packageType == 'path') unset($_FILES);
$this->dao->insert(TABLE_BUILD)->data($build)->autoCheck()->batchCheck($this->config->build->create->requiredFields, 'notempty')->check('name', 'unique', "product = {$build->product}")->exec();
if(!dao::isError())
{
@@ -191,8 +189,6 @@ class buildModel extends model
->remove('allchecker,resolvedBy,files,labels')
->get();
if($build->packageType == 'path') unset($_FILES);
$this->dao->update(TABLE_BUILD)->data($build)
->autoCheck()
->batchCheck($this->config->build->edit->requiredFields, 'notempty')
-5
View File
@@ -39,10 +39,6 @@
<th class='rowhead'><?php echo $lang->build->scmPath;?></th>
<td><?php echo html::input('scmPath', '', "class='text-1'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->build->packageType;?></th>
<td><?php echo html::radio('packageType', $lang->build->packageTypeList, 'path');?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->build->filePath;?></th>
<td><?php echo html::input('filePath', '', "class='text-1'");?></td>
@@ -118,5 +114,4 @@
<tr><td colspan='2' class='a-center'><?php echo html::submitButton() . html::backButton();?></td></tr>
</table>
</form>
<?php js::set('packageType', 'filePath')?>
<?php include '../../common/view/footer.html.php';?>
-5
View File
@@ -36,10 +36,6 @@
<th class='rowhead'><?php echo $lang->build->scmPath;?></th>
<td><?php echo html::input('scmPath', $build->scmPath, "class='text-1'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->build->packageType;?></th>
<td><?php echo html::radio('packageType', $lang->build->packageTypeList, $build->packageType);?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->build->filePath;?></th>
<td><?php echo html::input('filePath', $build->filePath, "class='text-1'");?></td>
@@ -134,5 +130,4 @@
<tr><td colspan='2' class='a-center'><?php echo html::submitButton() . html::backButton() .html::hidden('project', $build->project);?></td></tr>
</table>
</form>
<?php js::set('packageType', $build->packageType == 'file' ? 'fileform' : 'filePath')?>
<?php include '../../common/view/footer.html.php';?>
+1 -4
View File
@@ -47,6 +47,7 @@ $lang->goback = 'Back';
$lang->goPC = 'PC';
$lang->go = 'GO';
$lang->more = 'More';
$lang->day = 'Day';
$lang->actions = 'Actions';
$lang->comment = 'Comment';
@@ -366,10 +367,6 @@ $lang->suhosinInfo = "Warming:data is too large! Please enlarge the setting of <
$lang->noResultsMatch = "No results match";
$lang->chooseUsersToMail = "Choose users to mail...";
$lang->date = new stdclass();
$lang->date->day = 'Day';
$lang->date->month = 'Month';
/* Date times. */
define('DT_DATETIME1', 'Y-m-d H:i:s');
define('DT_DATETIME2', 'y-m-d H:i');
+1 -4
View File
@@ -47,6 +47,7 @@ $lang->goback = '返回';
$lang->goPC = 'PC版';
$lang->go = 'GO';
$lang->more = '更多';
$lang->day = '天';
$lang->actions = '操作';
$lang->comment = '备注';
@@ -366,10 +367,6 @@ $lang->suhosinInfo = "警告:数据太多,请在php.ini中修改<font color=
$lang->noResultsMatch = "没有匹配结果";
$lang->chooseUsersToMail = "选择要发信通知的用户...";
$lang->date = new stdclass();
$lang->date->day = '天';
$lang->date->month = '月';
/* 时间格式设置。*/
define('DT_DATETIME1', 'Y-m-d H:i:s');
define('DT_DATETIME2', 'y-m-d H:i');
+1 -1
View File
@@ -1,5 +1,5 @@
<?php if($extView = $this->getExtViewFile(__FILE__)){include $extView; return helper::cd();}?>
<?php js::set('timeout', $this->lang->timeout)?>
<?php
js::import($jsRoot . 'jquery/form/min.js');
js::import($jsRoot . 'jquery/form/zentao.js');
?>
+1 -1
View File
@@ -11,7 +11,7 @@ $clientTheme = $this->app->getClientTheme();
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
<?php
echo html::title($title . ' - ' . $lang->zentaoPMS);
+5 -2
View File
@@ -12,6 +12,9 @@
?>
<?php include '../../common/view/header.lite.html.php';?>
<?php include '../../common/view/colorbox.html.php';?>
<style>
body{padding-bottom:0px}
</style>
<script>
function setFileName()
@@ -27,11 +30,11 @@ function closeWindow()
}
</script>
<form method='post' target='hiddenwin' onsubmit='setFileName();' id='dataform'>
<form method='post' target='hiddenwin' onsubmit='setFileName();'>
<table class='table-1'>
<caption><?php echo $lang->file->inputFileName;?></caption>
<tr>
<td class='a-center' style='padding-top:30px;'>
<td class='a-center v-middle' height='50'>
<?php echo html::input('fileName', $file->title) . "<strong>.{$file->extension}</strong>";?>
<?php echo html::submitButton();?>
</td>
+1 -1
View File
@@ -5,7 +5,7 @@ $sessionString .= session_name() . '=' . session_id();
<style>.button-c {padding:1px}</style>
<script language='Javascript'>
$(function(){
$(".edit").colorbox({width:400, height:230, iframe:true, transition:'none', scrolling:true});
$(".edit").colorbox({width:350, height:160, iframe:true, transition:'none', scrolling:true});
})
/* Delete a file. */
+3
View File
@@ -272,6 +272,9 @@ class mailModel extends model
$this->clear();
/* Replace full webPath image for mail. */
if(strpos($body, 'src="data/upload')) $body = preg_replace('/<img (.*)src="/', '<img $1 src="http://' . $this->server->http_host . $this->config->webRoot, $body);
try
{
$this->mta->setFrom($this->config->mail->fromAddress, $this->convertCharset($this->config->mail->fromName));
+1 -1
View File
@@ -31,7 +31,7 @@
<div class='f-right'>
<?php
echo '<span class="link-button dropButton">';
echo html::a("#", "<i class='icon-upload-alt'></i> " . $lang->export, '', "id='exportAction' onclick='toggleSubMenu(this.id,\"bottom\",0)' title='{$lang->export}'");
echo html::a("#", "<i class='icon-upload-alt'></i> " . $lang->export, '', "id='exportAction' onclick='toggleSubMenu(this.id,\"bottom\",0)'");
echo '</span>';
common::printIcon('story', 'report', "productID=$productID&browseType=$browseType&moduleID=$moduleID");
+6 -3
View File
@@ -708,7 +708,7 @@ class project extends control
$charts = $this->report->createJSChartFlot($project->name, $flotJSON, 900, 400);
$dayList = array_fill(1, floor(count($dateList) / $this->config->project->maxBurnDay) + 5, '');
foreach($dayList as $key => $val) $dayList[$key] = ($key + 1) . $this->lang->date->day;
foreach($dayList as $key => $val) $dayList[$key] = $this->lang->project->interval . ($key + 1) . $this->lang->day;
/* Assign. */
$this->view->title = $title;
@@ -718,7 +718,7 @@ class project extends control
$this->view->projectID = $projectID;
$this->view->type = $type;
$this->view->interval = $interval;
$this->view->dayList = array('full' => 1 . $this->lang->date->day) + $dayList;
$this->view->dayList = array('full' => $this->lang->project->interval . 1 . $this->lang->day) + $dayList;
$this->display();
}
@@ -1170,6 +1170,9 @@ class project extends control
*/
public function sendmail($taskID, $actionID)
{
/* Reset $this->output. */
$this->clear();
/* Set toList and ccList. */
$task = $this->loadModel('task')->getById($taskID);
$projectName = $this->project->getById($task->project)->name;
@@ -1204,7 +1207,7 @@ class project extends control
/* Create the email content. */
$this->view->task = $task;
$this->view->action = $action;
$this->clear();
$mailContent = $this->parse($this->moduleName, 'sendmail');
/* Send emails. */
+2 -6
View File
@@ -15,16 +15,12 @@
<script>$('#burnTab').addClass('active');</script>
<table width='950' align='center' class='bd-none' id='burn'>
<tr>
<td class='a-right pr-25px' style='vertical-align:middle'>
<td class='a-right pr-25px v-middle'>
<?php
$checked = ($type == 'noweekend') ? '' : "weekend";
echo html::checkbox('', array('weekend' => $lang->project->weekend), $checked);
if($interval)
{
echo $lang->project->interval;
echo html::select('interval', $dayList, $interval);
}
if($interval) echo html::select('interval', $dayList, $interval);
common::printLink('project', 'computeBurn', 'reload=yes', $lang->project->computeBurn, 'hiddenwin', "title='{$lang->project->computeBurn}{$lang->project->burn}' class='btn' id='computeBurn'");
echo $lang->project->howToUpdateBurn;
+1 -9
View File
@@ -24,15 +24,7 @@ if($onlybody) $_GET['onlybody'] = 'no';
<td>
<fieldset>
<legend><?php echo $lang->task->legendDesc;?></legend>
<div class='content'>
<?php
if(strpos($task->desc, 'src="data/upload'))
{
$task->desc = preg_replace('/<img (.*)src="/', '<img $1 src="http://' . $this->server->http_host . $this->config->webRoot, $task->desc);
}
echo $task->desc;
?>
</div>
<div class='content'><?php echo $task->desc;?></div>
</fieldset>
</td>
</tr>
+2 -2
View File
@@ -24,11 +24,11 @@
common::printIcon('task', 'report', "project=$projectID&browseType=$browseType");
echo '<span class="link-button dropButton">';
echo html::a("#", "<i class='icon-upload-alt'></i> " . $lang->export, '', "id='exportAction' onclick=\"toggleSubMenu(this.id,'bottom',0)\" title='{$lang->export}'");
echo html::a("#", "<i class='icon-upload-alt'></i> " . $lang->export, '', "id='exportAction' onclick=\"toggleSubMenu(this.id,'bottom',0)\"");
echo '</span>';
echo '<span class="link-button dropButton">';
echo html::a("#", "<i class='icon-download-alt'></i> " . $lang->import, '', "id='importAction' onclick=\"toggleSubMenu(this.id,'bottom',0)\" title='{$lang->import}'");
echo html::a("#", "<i class='icon-download-alt'></i> " . $lang->import, '', "id='importAction' onclick=\"toggleSubMenu(this.id,'bottom',0)\"");
echo '</span>';
common::printIcon('task', 'batchCreate', "projectID=$projectID");
+5 -3
View File
@@ -23,7 +23,7 @@ class releaseModel extends model
*/
public function getByID($releaseID, $setImgSize = false)
{
$release = $this->dao->select('t1.*, t2.id as buildID, t2.packageType, t2.filePath, t2.scmPath, t2.name as buildName, t3.name as productName')
$release = $this->dao->select('t1.*, t2.id as buildID, t2.filePath, t2.scmPath, t2.name as buildName, t3.name as productName')
->from(TABLE_RELEASE)->alias('t1')
->leftJoin(TABLE_BUILD)->alias('t2')->on('t1.build = t2.id')
->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product = t3.id')
@@ -32,8 +32,9 @@ class releaseModel extends model
->fetch();
if(!$release) return false;
$release->files = $this->loadModel('file')->getByObject('release', $releaseID);
if($release->packageType == 'file' and empty($release->files)) $release->files = $this->loadModel('file')->getByObject('build', $release->buildID);
$this->loadModel('file');
$release->files = $this->file->getByObject('release', $releaseID);
if(empty($release->files))$release->files = $this->file->getByObject('build', $release->buildID);
if($setImgSize) $release->desc = $this->file->setImgSize($release->desc);
return $release;
}
@@ -95,6 +96,7 @@ class releaseModel extends model
*/
public function create($productID)
{
$buildID = 0;
if($this->post->build == false)
{
$build = fixer::input('post')
+3 -1
View File
@@ -153,6 +153,9 @@ class report extends control
foreach($reminder as $user => $mail)
{
/* Reset $this->output. */
$this->clear();
/* Get email content and title.*/
$this->view->mail = $mail;
$mailContent = $this->parse('report', 'dailyreminder');
@@ -161,7 +164,6 @@ class report extends control
$mailTitle .= isset($mail->tasks) ? sprintf($this->lang->report->mailtitle->task, count($mail->tasks)) : '';
$mailTitle .= isset($mail->todos) ? sprintf($this->lang->report->mailtitle->todo, count($mail->todos)) : '';
$mailTitle = rtrim($mailTitle, ',');
$this->clear();
/* Send email.*/
echo date('Y-m-d H:i:s') . " sending to $user, ";
+5 -13
View File
@@ -101,8 +101,7 @@ $(function ()
var baseline = $baselineJSON;
var dateList = $dateListJSON;
var ticks = $ticksJSON;
var firstMon = 0;
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
var firstDay = 0;
function showTooltip(x, y, contents)
{
$('<div id="tooltip">' + contents + '</div>').css
@@ -132,20 +131,13 @@ $(function ()
{
var month = tick.getMonth() + 1;
var dateTail = '';
if(firstMon != month)
if(firstDay != month)
{
dateTail = '<br />/' + month;
firstMon = month;
dateTail = '/' + month;
firstDay = month;
}
if(config.clientLang == 'en')
{
title = months[month-1] + ' ' + tick.getDate();
}
else
{
title = month + '{$this->lang->date->month}' + tick.getDate();
}
title = tick.getFullYear() + '/' + month + '/' + tick.getDate();
if(ticks.length <= 30) dateTail = '/' + month;
return '<span title="' + title + '">' + tick.getDate() + dateTail + '</span>';
+4 -1
View File
@@ -854,6 +854,9 @@ class story extends control
*/
public function sendmail($storyID, $actionID)
{
/* Reset $this->output. */
$this->clear();
$story = $this->story->getById($storyID);
$productName = $this->product->getById($story->product)->name;
@@ -903,7 +906,7 @@ class story extends control
$this->view->story = $story;
$this->view->action = $action;
$this->view->users = $this->user->getPairs('noletter');
$this->clear();
$mailContent = $this->parse($this->moduleName, 'sendmail');
/* Send it. */
+31 -8
View File
@@ -57,6 +57,23 @@ class storyModel extends model
return $story;
}
/**
* Get stories by idList.
*
* @param int|array|string $storyIDList
* @access public
* @return array
*/
public function getByList($storyIDList = 0)
{
return $this->dao->select('t1.*, t2.spec, t2.verify')->from(TABLE_STORY)->alias('t1')
->leftJoin(TABLE_STORYSPEC)->alias('t2')->on('t1.id=t2.story')
->where('t1.deleted')->eq(0)
->andWhere('t1.version=t2.version')
->beginIF($storyIDList)->andWhere('t1.id')->in($storyIDList)->fi()
->fetchAll('id');
}
/**
* Get affected things.
*
@@ -374,9 +391,10 @@ class storyModel extends model
/* Init $stories. */
if(!empty($storyIDList))
{
$oldStories = $this->getByList($storyIDList);
foreach($storyIDList as $storyID)
{
$oldStory = $this->getById($storyID);
$oldStory = $oldStories[$storyID];
$story = new stdclass();
$story->lastEditedBy = $this->app->user->account;
@@ -408,7 +426,7 @@ class storyModel extends model
foreach($stories as $storyID => $story)
{
$oldStory = $this->getById($storyID);
$oldStory = $oldStories[$storyID];
$this->dao->update(TABLE_STORY)->data($story)
->autoCheck()
@@ -510,9 +528,11 @@ class storyModel extends model
$date = helper::today();
$actions = array();
$this->loadModel('action');
$oldStories = $this->getByList($storyIDList);
foreach($storyIDList as $storyID)
{
$oldStory = $this->getById($storyID);
$oldStory = $oldStories[$storyID];
if($oldStory->status != 'draft' and $oldStory->status != 'changed') continue;
$story = new stdClass();
@@ -533,7 +553,7 @@ class storyModel extends model
$this->dao->update(TABLE_STORY)->data($story)->autoCheck()->where('id')->eq($storyID)->exec();
$this->setStage($storyID);
if(strpos('done,postponed', $reason) !== false) $result = 'pass';
if($reason and strpos('done,postponed', $reason) !== false) $result = 'pass';
$actions[$storyID] = $this->action->create('story', $storyID, 'Reviewed', '', ucfirst($result));
$this->action->logHistory($actions[$storyID], array());
}
@@ -591,9 +611,10 @@ class storyModel extends model
/* Adjust whether the post data is complete, if not, remove the last element of $storyIDList. */
if($this->session->showSuhosinInfo) array_pop($storyIDList);
$oldStories = $this->getByList($storyIDList);
foreach($storyIDList as $storyID)
{
$oldStory = $this->getById($storyID);
$oldStory = $oldStories[$storyID];
if($oldStory->status == 'closed') continue;
$story = new stdclass();
@@ -620,7 +641,7 @@ class storyModel extends model
{
if(!$story->closedReason) continue;
$oldStory = $this->getById($storyID);
$oldStory = $oldStories[$storyID];
$this->dao->update(TABLE_STORY)->data($story)
->autoCheck()
@@ -653,9 +674,10 @@ class storyModel extends model
{
$now = helper::now();
$allChanges = array();
$oldStories = $this->getByList($storyIDList);
foreach($storyIDList as $storyID)
{
$oldStory = $this->getById($storyID);
$oldStory = $oldStories[$storyID];
$story = new stdclass();
$story->lastEditedBy = $this->app->user->account;
@@ -681,9 +703,10 @@ class storyModel extends model
{
$now = helper::now();
$allChanges = array();
$oldStories = $this->getByList($storyIDList);
foreach($storyIDList as $storyID)
{
$oldStory = $this->getById($storyID);
$oldStory = $oldStories[$storyID];
if($oldStory->status == 'draft') continue;
$story = new stdclass();
+1 -9
View File
@@ -24,15 +24,7 @@ if($onlybody) $_GET['onlybody'] = 'no';
<td>
<fieldset>
<legend><?php echo $lang->story->legendSpec;?></legend>
<div class='content'>
<?php
if(strpos($story->spec, 'src="data/upload'))
{
$story->spec = preg_replace('/<img (.*)src="/', '<img $1 src="http://' . $this->server->http_host . $this->config->webRoot, $story->spec);
}
echo $story->spec;
?>
</div>
<div class='content'><?php echo $story->spec;?></div>
</fieldset>
</td>
</tr>
+5 -2
View File
@@ -641,7 +641,7 @@ class task extends control
unset($_POST['taskIDList']);
$this->loadModel('action');
$tasks = $this->task->getList($taskIDList);
$tasks = $this->task->getByList($taskIDList);
foreach($tasks as $taskID => $task)
{
if($task->status == 'wait' or $task->status == 'doing')
@@ -769,6 +769,9 @@ class task extends control
*/
public function sendmail($taskID, $actionID)
{
/* Reset $this->output. */
$this->clear();
/* Set toList and ccList. */
$task = $this->task->getById($taskID);
$projectName = $this->project->getById($task->project)->name;
@@ -805,7 +808,7 @@ class task extends control
$this->view->task = $task;
$this->view->action = $action;
$this->view->users = $users;
$this->clear();
$mailContent = $this->parse($this->moduleName, 'sendmail');
/* Send emails. */
+1 -1
View File
@@ -684,7 +684,7 @@ class taskModel extends model
* @access public
* @return array
*/
public function getList($taskIDList = 0)
public function getByList($taskIDList = 0)
{
return $this->dao->select('*')->from(TABLE_TASK)
->where('deleted')->eq(0)
+1 -9
View File
@@ -24,15 +24,7 @@ if($onlybody) $_GET['onlybody'] = 'no';
<td>
<fieldset>
<legend><?php echo $lang->task->legendDesc;?></legend>
<div class='content'>
<?php
if(strpos($task->desc, 'src="data/upload'))
{
$task->desc = preg_replace('/<img (.*)src="/', '<img $1 src="http://' . $this->server->http_host . $this->config->webRoot, $task->desc);
}
echo $task->desc;
?>
</div>
<div class='content'><?php echo $task->desc;?></div>
</fieldset>
</td>
</tr>
+1 -1
View File
@@ -34,7 +34,7 @@ js::set('confirmDelete', $lang->testcase->confirmDelete);
common::printIcon('testcase', 'import', "productID=$productID", '', 'button', '', '', 'export cboxElement');
echo '<span class="link-button dropButton">';
echo html::a("#", "<i class='icon-green-common-export'></i>" . $lang->export, '', "id='exportAction' onclick=\"toggleSubMenu(this.id,'bottom',0)\" title='{$lang->export}'");
echo html::a("#", "<i class='icon-green-common-export'></i>" . $lang->export, '', "id='exportAction' onclick=\"toggleSubMenu(this.id,'bottom',0)\"");
echo '</span>';
common::printIcon('testcase', 'batchCreate', "productID=$productID&moduleID=$moduleID");
+3 -1
View File
@@ -766,6 +766,9 @@ class testtask extends control
*/
public function sendmail($testtaskID, $actionID, $actionType)
{
/* Reset $this->output. */
$this->clear();
$testtask = $this->testtask->getByID($testtaskID);
$action = $this->action->getById($actionID);
$users = $this->loadModel('user')->getPairs('noletter');
@@ -773,7 +776,6 @@ class testtask extends control
$this->view->testtask = $testtask;
$this->view->action = $action;
$this->view->users = $users;
$this->clear();
$mailContent = $this->parse($this->moduleName, 'sendmail');
+1 -9
View File
@@ -24,15 +24,7 @@ if($onlybody) $_GET['onlybody'] = 'no';
<td>
<fieldset>
<legend><?php echo $lang->testtask->desc;?></legend>
<div class='content'>
<?php
if(strpos($testtask->desc, 'src="data/upload'))
{
$testtask->desc = preg_replace('/<img (.*)src="/', '<img $1 src="http://' . $this->server->http_host . $this->config->webRoot, $testtask->desc);
}
echo $testtask->desc;
?>
</div>
<div class='content'><?php echo $testtask->desc;?></div>
</fieldset>
</td>
</tr>
+1 -1
View File
@@ -85,7 +85,7 @@ $.extend(
error:function(jqXHR, textStatus, errorThrown)
{
$.enableForm(formID);
if(textStatus == 'timeout' || textStatus == 'error') return alert(timeout);
if(textStatus == 'timeout' || textStatus == 'error') return alert(config.timeout);
alert(jqXHR.responseText + textStatus + errorThrown);
}
};