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

This commit is contained in:
xia0ta0
2013-08-02 15:55:48 +08:00
26 changed files with 49 additions and 23 deletions
+1
View File
@@ -9,6 +9,7 @@ $config->url->extension = 'http://www.zentao.net/extension-browse.html';
$config->url->donation = 'http://www.zentao.net/help-donation.html';
$config->url->service = 'http://www.cnezsoft.com/article-browse-1078.html';
$config->win2Unix = new stdclass();
$config->win2Unix->renameTables = array(
'zt_casestep' => 'zt_caseStep' ,
'zt_doclib' => 'zt_docLib' ,
+1 -2
View File
@@ -353,7 +353,7 @@ class bug extends control
if(!empty($_POST))
{
$actions = $this->bug->batchCreate($productID);
foreach($actions as $bugID => $action) $this->sendmail($bugID, $actionID);
foreach($actions as $bugID => $actionID) $this->sendmail($bugID, $actionID);
die(js::locate($this->session->bugList, 'parent'));
}
@@ -377,7 +377,6 @@ class bug extends control
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->bug->batchCreate;
$this->view->projectBuilds = $projectBuilds;
$this->view->productID = $productID;
$this->view->stories = $stories;
$this->view->builds = $builds;
+1
View File
@@ -286,6 +286,7 @@ class bugModel extends model
{
$oldBug = $this->getByID($bugID);
$bug = new stdclass();
$bug->lastEditedBy = $this->app->user->account;
$bug->lastEditedDate = $now;
$bug->type = $this->post->types[$bugID];
+8 -3
View File
@@ -113,6 +113,7 @@ class buildModel extends model
*/
public function create($projectID)
{
$build = new stdclass();
$build->stories = '';
$build->bugs = '';
@@ -169,16 +170,20 @@ class buildModel extends model
*/
public function updateLinkedBug($build)
{
$bugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($build->bugs)->fetchAll();
$bugs = empty($build->bugs) ? '' : $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($build->bugs)->fetchAll();
$now = helper::now();
$resolvedPairs = array();
foreach($this->post->bugs as $key => $bugID)
if(isset($_POST['bugs']))
{
if(isset($_POST['resolvedBy'][$key]))$resolvedPairs[$bugID] = $this->post->resolvedBy[$key];
foreach($this->post->bugs as $key => $bugID)
{
if(isset($_POST['resolvedBy'][$key]))$resolvedPairs[$bugID] = $this->post->resolvedBy[$key];
}
}
$this->loadModel('action');
if(!$bugs) return false;
foreach($bugs as $bug)
{
if($bug->status == 'resolved') continue;
+1 -1
View File
@@ -63,7 +63,7 @@
echo "{$lang->extension->compatible}: {$lang->extension->compatibleList[$currentRelease->compatible]} ";
echo "{$lang->extension->grade}: ", html::printStars($extension->stars);
echo " {$lang->extension->depends}: ";
if($currentRelease->depends)
if(!empty($currentRelease->depends))
{
foreach(json_decode($currentRelease->depends) as $code => $limit)
{
+6 -2
View File
@@ -224,7 +224,8 @@ class groupModel extends model
{
foreach($moduleActions as $actionName)
{
$data->group = $groupID;
$data = new stdclass();
$data->group = $groupID;
$data->module = $moduleName;
$data->method = $actionName;
$this->dao->replace(TABLE_GROUPPRIV)->data($data)->exec();
@@ -244,7 +245,8 @@ class groupModel extends model
{
foreach($moduleActions as $actionName)
{
$data->group = $groupID;
$data = new stdclass();
$data->group = $groupID;
$data->module = $moduleName;
$data->method = $actionName;
$this->dao->insert(TABLE_GROUPPRIV)->data($data)->exec();
@@ -268,6 +270,7 @@ class groupModel extends model
{
foreach($this->post->groups as $group)
{
$data = new stdclass();
$data->group = $group;
$data->module = $this->post->module;
$data->method = $action;
@@ -293,6 +296,7 @@ class groupModel extends model
if($this->post->members == false) return;
foreach($this->post->members as $account)
{
$data = new stdclass();
$data->account = $account;
$data->group = $groupID;
$this->dao->insert(TABLE_USERGROUP)->data($data)->exec();
+1 -1
View File
@@ -62,7 +62,7 @@
<td><?php echo $users[$case->lastRunner];?></td>
<td><?php if(!helper::isZeroDate($case->lastRunDate)) echo date(DT_MONTHTIME1, strtotime($case->lastRunDate));?></td>
<td class='<?php echo $case->lastRunResult;?>'><?php if($case->lastRunResult) echo $lang->testcase->resultList[$case->lastRunResult];?></td>
<td class='<?php echo $run->status;?>'><?php echo $lang->testcase->statusList[$case->status];?></td>
<td class='<?php if(isset($run)) echo $run->status;?>'><?php echo $lang->testcase->statusList[$case->status];?></td>
<td>
<?php
common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", '', 'list', '', '', 'iframe');
+2 -1
View File
@@ -604,8 +604,9 @@ class productModel extends model
}
$cases = $this->dao->select('DISTINCT story')->from(TABLE_CASE)->where('story')->in($storyIDs)->fetchAll();
$rate = count($stories) == 0 ? 0 : round(count($cases) / count($stories), 2);
return sprintf($this->lang->product->storySummary, count($stories), $totalEstimate, round(count($cases) / count($stories), 2) * 100 . "%");
return sprintf($this->lang->product->storySummary, count($stories), $totalEstimate, $rate * 100 . "%");
}
/**
+1 -1
View File
@@ -121,7 +121,7 @@ var browseType = '<?php echo $browseType;?>';
$disabled = $canBatchEdit ? '' : "disabled='disabled'";
$actionLink = $this->createLink('story', 'batchEdit', "productID=$productID&projectID=0");
echo "<div class='groupButton'>";
echo "<div class='groupButton dropButton'>";
echo html::commonButton($lang->edit, "onclick=\"changeAction('$actionLink')\" $disabled");
echo "<button id='moreAction' type='button' onclick=\"toggleSubMenu(this.id, 'top', 0)\"><span class='caret'></span></button>";
echo "</div>";
+1 -2
View File
@@ -16,7 +16,6 @@
<?php include '../../common/view/treeview.html.php';?>
<?php include './taskheader.html.php';?>
<?php js::set('moduleID', $moduleID);?>
<?php js::set('productID', $productID);?>
<script language='Javascript'>
var browseType = '<?php echo $browseType;?>';
</script>
@@ -151,7 +150,7 @@ var browseType = '<?php echo $browseType;?>';
$actionLink = $this->createLink('task', 'batchEdit', "projectID=$projectID");
$misc = $canBatchEdit ? "onclick=changeAction('$actionLink')" : "disabled='disabled'";
echo "<div class='groupButton'>";
echo "<div class='groupButton dropButton'>";
echo html::commonButton($lang->edit, "onclick=\"changeAction('projectTaskForm', 'batchEdit', '$actionLink')\" $misc");
echo "<button id='moreAction' type='button' onclick=\"toggleSubMenu(this.id, 'top', 0)\"><span class='caret'></span></button>";
echo "</div>";
+1 -1
View File
@@ -24,7 +24,7 @@
common::printIcon('task', 'report', "project=$projectID&browseType=$browseType");
if($browseType != 'needconfirm') common::printIcon('task', 'export', "projectID=$projectID&orderBy=$orderBy");
echo '<span class="link-button">';
echo '<span class="link-button dropButton">';
echo html::a("#", "&nbsp;", '', "id='importAction' class='icon-green-task-import' onclick=toggleSubMenu(this.id,'bottom',0) title='{$lang->import}'");
echo html::a("#", $lang->import, '', "id='importAction' onclick=toggleSubMenu(this.id,'bottom',0) title='{$lang->import}'");
echo '</span>';
+1
View File
@@ -9,5 +9,6 @@
* @version $Id: en.php 4129 2013-01-18 01:58:14Z wwccss $
* @link http://www.zentao.net
*/
$lang->qa = new stdclass();
$lang->qa->common = 'Test';
$lang->qa->index = "Index";
+1
View File
@@ -9,5 +9,6 @@
* @version $Id: zh-cn.php 4129 2013-01-18 01:58:14Z wwccss $
* @link http://www.zentao.net
*/
$lang->qa = new stdclass();
$lang->qa->common = '测试视图';
$lang->qa->index = "测试首页";
+1 -1
View File
@@ -98,7 +98,7 @@ class releaseModel extends model
$this->dao->insert(TABLE_RELEASE)->data($release)->autoCheck()->batchCheck($this->config->release->create->requiredFields, 'notempty')->check('name','unique')->exec();
$releaseID = $this->dao->lastInsertID();
$this->dao->update(TABLE_STORY)->set('stage')->eq('released')->where('id')->in($release->stories)->exec();
if($release->stories) $this->dao->update(TABLE_STORY)->set('stage')->eq('released')->where('id')->in($release->stories)->exec();
if(!dao::isError()) return $releaseID;
}
+1
View File
@@ -288,6 +288,7 @@ EOT;
{
if($bug->project)
{
$projects[$bug->project] = new stdclass();
$projects[$bug->project]->bugs = isset($projects[$bug->project]->bugs) ? $projects[$bug->project]->bugs + 1 : 1;
}
}
+2
View File
@@ -1,3 +1,5 @@
<?php
$config->sso->create = new stdclass();
$config->sso->create->requiredFields = 'title,code,key,ip';
$config->sso->edit = new stdclass();
$config->sso->edit->requiredFields = 'title,key,ip';
+1 -1
View File
@@ -9,7 +9,7 @@ class sso extends control
*/
public function browse()
{
$this->view->title = $this->lang->sso->common . $lang->colon . $this->lang->sso->browse;
$this->view->title = $this->lang->sso->common . $this->lang->colon . $this->lang->sso->browse;
$this->view->position[] = $this->lang->sso->common;
$this->view->position[] = $this->lang->sso->browse;
$this->view->auths = $this->sso->getAuths();
+2
View File
@@ -222,6 +222,7 @@ class storyModel extends model
$storyID = $this->dao->lastInsertID();
$this->setStage($storyID);
$specData[$i] = new stdclass();
$specData[$i]->story = $storyID;
$specData[$i]->version = 1;
$specData[$i]->title = htmlspecialchars($stories->title[$i]);
@@ -230,6 +231,7 @@ class storyModel extends model
$this->loadModel('action');
$actionID = $this->action->create('story', $storyID, 'Opened', '');
$mails[$i] = new stdclass();
$mails[$i]->storyID = $storyID;
$mails[$i]->actionID = $actionID;
}
+1
View File
@@ -616,6 +616,7 @@ class task extends control
$this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID);
}
if(isonlybody()) die(js::closeColorbox('parent.parent'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
}
+2
View File
@@ -239,6 +239,7 @@ class taskModel extends model
{
$oldTask = $this->getById($taskID);
$task = new stdclass();
$task->name = htmlspecialchars($this->post->names[$taskID]);
$task->module = isset($this->post->modules[$taskID]) ? $this->post->modules[$taskID] : 0;
$task->type = $this->post->types[$taskID];
@@ -439,6 +440,7 @@ class taskModel extends model
{
if(!$record->consumed[$id]) die(js::alert($this->lang->task->error->consumedThisTime));
if($record->left[$id] === '') die(js::alert($this->lang->task->error->left));
$estimates[$id] = new stdclass();
$estimates[$id]->date = $record->dates[$id];
$estimates[$id]->task = $taskID;
$estimates[$id]->consumed = $record->consumed[$id];
+3 -2
View File
@@ -285,14 +285,15 @@ class testcaseModel extends model
/* Initialize cases from the post data.*/
foreach($caseIDList as $caseID)
{
$case = new stdclass();
$case->lastEditedBy = $this->app->user->account;
$caee->lastEditedDate = $now;
$case->lastEditedDate = $now;
$case->pri = $this->post->pris[$caseID];
$case->status = $this->post->statuses[$caseID];
$case->module = $this->post->modules[$caseID];
$case->title = htmlspecialchars($this->post->titles[$caseID]);
$case->type = $this->post->types[$caseID];
$case->stage = implode(',', $this->post->stages[$caseID]);
$case->stage = empty($this->post->stages[$caseID]) ? '' : implode(',', $this->post->stages[$caseID]);
$cases[$caseID] = $case;
unset($case);
+3 -3
View File
@@ -35,9 +35,9 @@
?>
<tr>
<th><?php echo $i;?></th>
<td><?php echo nl2br($stepResult['desc']);?></td>
<td><?php echo nl2br($stepResult['expect']);?></td>
<?php if(!empty($result->stepResults)):?>
<td><?php if(isset($stepResult['desc'])) echo nl2br($stepResult['desc']);?></td>
<td><?php if(isset($stepResult['expect'])) echo nl2br($stepResult['expect']);?></td>
<?php if(!empty($stepResult['result'])):?>
<td class='<?php echo $stepResult['result'];?> a-center'><?php echo $lang->testcase->resultList[$stepResult['result']];?></td>
<td><?php echo $stepResult['real'];?></td>
</tr>
+1 -1
View File
@@ -13,7 +13,7 @@
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<div id='titlebar'>
<div id='main' <?php if($task->deleted) echo "class='deleted'";?>>TESTTASK #<?php echo $task->id . ' ' . $task->title;?></div>
<div id='main' <?php if($task->deleted) echo "class='deleted'";?>>TESTTASK #<?php echo $task->id . ' ' . $task->name;?></div>
<div>
<?php
$browseLink = $this->session->testtaskList ? $this->session->testtaskList : $this->createLink('testtask', 'browse', "productID=$task->product");
+1 -1
View File
@@ -59,7 +59,7 @@ class todo extends control
$this->view->position[] = $this->lang->todo->common;
$this->view->position[] = $this->lang->todo->create;
$this->view->date = strftime("%Y-%m-%d", strtotime($date));
$this->view->time = date::buildTimeList($this->config->todo->times->begin, $this->config->todo->times->end, $this->config->todo->times->delta);
$this->view->times = date::buildTimeList($this->config->todo->times->begin, $this->config->todo->times->end, $this->config->todo->times->delta);
$this->view->time = date::now();
$this->display();
}
+1
View File
@@ -329,6 +329,7 @@ class userModel extends model
$this->dao->delete()->from(TABLE_USERGROUP)->where('account')->eq($oldUser->account)->exec();
foreach($this->post->groups as $groupID)
{
$data = new stdclass();
$data->account = $this->post->account;
$data->group = $groupID;
$this->dao->insert(TABLE_USERGROUP)->data($data)->exec();
+4
View File
@@ -57,3 +57,7 @@ function toggleSubMenu(currentID, position, menuIndex)
$('#' + currentID + 'Menu').toggle();
}
$(function()
{
$(document).click(function(e){if($(e.target).parent(".dropButton").length==0){ $("div[id$='ActionMenu']").hide();}})
})