- |
+ |
team->totalHours . ':' . "$totalHours{$lang->project->workHour}";?>
|
diff --git a/module/project/view/testtask.html.php b/module/project/view/testtask.html.php
index e24aec46b0..d565654f6e 100644
--- a/module/project/view/testtask.html.php
+++ b/module/project/view/testtask.html.php
@@ -50,12 +50,12 @@
testtask->statusList[$task->status];?> |
id", '', 'list', 'sitemap');
- common::printIcon('testtask', 'linkCase', "taskID=$task->id", '', 'list', 'link');
- common::printIcon('testtask', 'edit', "taskID=$task->id", '', 'list');
- common::printIcon('testreport', 'create', "objectID=$task->id&objectType=testtask", '', 'list','flag');
+ common::printIcon('testtask', 'cases', "taskID=$task->id", $task, 'list', 'sitemap');
+ common::printIcon('testtask', 'linkCase', "taskID=$task->id", $task, 'list', 'link');
+ common::printIcon('testtask', 'edit', "taskID=$task->id", $task, 'list');
+ common::printIcon('testreport', 'create', "objectID=$task->id&objectType=testtask", $task, 'list','flag');
- if(common::hasPriv('testtask', 'delete'))
+ if(common::hasPriv('testtask', 'delete', $task))
{
$deleteURL = $this->createLink('testtask', 'delete', "taskID=$task->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"taskList\",confirmDelete)", '', '', "class='btn-icon' title='{$lang->testtask->delete}'");
diff --git a/module/project/view/view.html.php b/module/project/view/view.html.php
index fd98bd41df..388c7a333e 100644
--- a/module/project/view/view.html.php
+++ b/module/project/view/view.html.php
@@ -35,8 +35,8 @@
echo '';
echo " ";
- common::printIcon('project', 'edit', $params);
- common::printIcon('project', 'delete', $params, '', 'button', '', 'hiddenwin');
+ common::printIcon('project', 'edit', $params, $project);
+ common::printIcon('project', 'delete', $params, $project, 'button', '', 'hiddenwin');
echo ' ';
common::printRPN($browseLink);
diff --git a/module/release/model.php b/module/release/model.php
index d7fdf1153d..728a02ae97 100644
--- a/module/release/model.php
+++ b/module/release/model.php
@@ -319,4 +319,19 @@ class releaseModel extends model
$this->dao->update(TABLE_RELEASE)->set('status')->eq($status)->where('id')->eq($releaseID)->exec();
return dao::isError();
}
+
+ /**
+ * Judge an action is clickable or not.
+ *-
+ * @param object $product-
+ * @param string $action-
+ * @access public
+ * @return void
+ */
+ public static function isClickable($release, $action)
+ {
+ if(!common::limitedUser($release)) return false;
+
+ return true;
+ }
}
diff --git a/module/release/view/browse.html.php b/module/release/view/browse.html.php
index 1e346bfd4f..4aa6700a97 100644
--- a/module/release/view/browse.html.php
+++ b/module/release/view/browse.html.php
@@ -53,13 +53,13 @@
id&type=story&link=true"), ' ', '', "class='btn-icon' title='{$lang->release->linkStory}'");
if(common::hasPriv('release', 'linkBug') and $this->config->global->flow != 'onlyStory') echo html::a(inlink('view', "releaseID=$release->id&type=bug&link=true"), ' ', '', "class='btn-icon' title='{$lang->release->linkBug}'");
- if(common::hasPriv('release', 'changeStatus'))
+ if(common::hasPriv('release', 'changeStatus', $release))
{
$changedStatus = $release->status == 'normal' ? 'terminate' : 'normal';
echo html::a(inlink('changeStatus', "releaseID=$release->id&status=$changedStatus"), ' ', 'hiddenwin', "class='btn-icon' title='{$lang->release->changeStatusList[$changedStatus]}'");
}
- common::printIcon('release', 'edit', "release=$release->id", '', 'list');
- if(common::hasPriv('release', 'delete'))
+ common::printIcon('release', 'edit', "release=$release->id", $release, 'list');
+ if(common::hasPriv('release', 'delete', $release))
{
$deleteURL = $this->createLink('release', 'delete', "releaseID=$release->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"releaseList\",confirmDelete)", '', '', "class='btn-icon' title='{$lang->release->delete}'");
diff --git a/module/release/view/view.html.php b/module/release/view/view.html.php
index 55ce0def71..4a2359fabb 100644
--- a/module/release/view/view.html.php
+++ b/module/release/view/view.html.php
@@ -29,7 +29,7 @@
ob_start();
echo "";
- if(common::hasPriv('release', 'changeStatus'))
+ if(common::hasPriv('release', 'changeStatus', $release))
{
$changedStatus = $release->status == 'normal' ? 'terminate' : 'normal';
echo html::a(inlink('changeStatus', "releaseID=$release->id&type=$changedStatus"), ' ' . $lang->release->changeStatusList[$changedStatus], 'hiddenwin', "class='btn'");
@@ -39,8 +39,8 @@
echo ' ';
echo "";
- common::printIcon('release', 'edit', "releaseID=$release->id");
- common::printIcon('release', 'delete', "releaseID=$release->id", '', 'button', '', 'hiddenwin');
+ common::printIcon('release', 'edit', "releaseID=$release->id", $release);
+ common::printIcon('release', 'delete', "releaseID=$release->id", $release, 'button', '', 'hiddenwin');
echo ' ';
echo "";
diff --git a/module/story/lang/en.php b/module/story/lang/en.php
index 7c70ef37d0..0311f26085 100644
--- a/module/story/lang/en.php
+++ b/module/story/lang/en.php
@@ -90,6 +90,7 @@ $lang->story->keywords = 'Keywords';
$lang->story->newStory = 'Continue adding Story.';
$lang->story->colorTag = 'Color Tag';
$lang->story->files = 'Files';
+$lang->story->copy = "Duplicate a Story";
$lang->story->ditto = 'Ditto';
$lang->story->dittoNotice = 'This Story does not belong to the same Product as the last Story does!';
diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php
index 7410cc1dfb..e260cbdde6 100644
--- a/module/story/lang/zh-cn.php
+++ b/module/story/lang/zh-cn.php
@@ -90,6 +90,7 @@ $lang->story->keywords = '关键词';
$lang->story->newStory = '继续添加需求';
$lang->story->colorTag = '颜色标签';
$lang->story->files = '附件';
+$lang->story->copy = "复制需求";
$lang->story->ditto = '同上';
$lang->story->dittoNotice = '该需求与上一需求不属于同一产品!';
diff --git a/module/story/lang/zh-tw.php b/module/story/lang/zh-tw.php
index e2bb29bed1..f439ea47f6 100644
--- a/module/story/lang/zh-tw.php
+++ b/module/story/lang/zh-tw.php
@@ -90,6 +90,7 @@ $lang->story->keywords = '關鍵詞';
$lang->story->newStory = '繼續添加需求';
$lang->story->colorTag = '顏色標籤';
$lang->story->files = '附件';
+$lang->story->copy = "復制需求";
$lang->story->ditto = '同上';
$lang->story->dittoNotice = '該需求與上一需求不屬於同一產品!';
diff --git a/module/story/model.php b/module/story/model.php
index 601c73318d..645cbc5dd0 100644
--- a/module/story/model.php
+++ b/module/story/model.php
@@ -1456,19 +1456,19 @@ class storyModel extends model
/**
* Get stories through search.
- *
+ *
* @access public
- * @param int $productID
- * @param int $queryID
- * @param string $orderBy
- * @param object $pager
- * @param string $projectID
+ * @param int $productID
+ * @param int $queryID
+ * @param string $orderBy
+ * @param object $pager
+ * @param string $projectID
* @access public
* @return array
*/
public function getBySearch($productID, $queryID, $orderBy, $pager = null, $projectID = '', $branch = 0)
{
- if($projectID != '')
+ if($projectID != '')
{
$products = $this->loadModel('project')->getProducts($projectID);
}
@@ -1668,11 +1668,11 @@ class storyModel extends model
/**
* Get stories list of a plan.
- *
- * @param int $planID
- * @param string $status
- * @param string $orderBy
- * @param object $pager
+ *
+ * @param int $planID
+ * @param string $status
+ * @param string $orderBy
+ * @param object $pager
* @access public
* @return array
*/
@@ -1683,19 +1683,19 @@ class storyModel extends model
->beginIF($status and $status != 'all')->andWhere('status')->in($status)->fi()
->andWhere('deleted')->eq(0)
->orderBy($orderBy)->page($pager)->fetchAll('id');
-
+
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story');
-
+
return $stories;
}
/**
* Get stories pairs of a plan.
- *
- * @param int $planID
- * @param string $status
- * @param string $orderBy
- * @param object $pager
+ *
+ * @param int $planID
+ * @param string $status
+ * @param string $orderBy
+ * @param object $pager
* @access public
* @return array
*/
@@ -2186,6 +2186,8 @@ class storyModel extends model
{
$action = strtolower($action);
+ if(!common::limitedUser($story)) return false;
+
if($action == 'change') return $story->status != 'closed';
if($action == 'review') return $story->status == 'draft' or $story->status == 'changed';
if($action == 'close') return $story->status != 'closed';
diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php
index 99cccbf9ab..85d9b06c77 100644
--- a/module/story/view/view.html.php
+++ b/module/story/view/view.html.php
@@ -41,8 +41,8 @@
ob_start();
echo " ";
- common::printIcon('story', 'change', "storyID=$story->id", $story);
- common::printIcon('story', 'review', "storyID=$story->id", $story);
+ common::printIcon('story', 'change', "storyID=$story->id", $story);
+ common::printIcon('story', 'review', "storyID=$story->id", $story);
if($story->status != 'closed' and !isonlybody())
{
@@ -51,8 +51,8 @@
if(common::hasPriv('story', 'batchCreate')) echo html::a($link, " " . $lang->story->subdivide, '', $misc);
}
- common::printIcon('story', 'close', "storyID=$story->id", $story, 'button', '', '', 'iframe text-danger', true);
- common::printIcon('story', 'activate', "storyID=$story->id", $story, 'button', '', '', 'iframe text-success', true);
+ common::printIcon('story', 'close', "storyID=$story->id", $story, 'button', '', '', 'iframe text-danger', true);
+ common::printIcon('story', 'activate', "storyID=$story->id", $story, 'button', '', '', 'iframe text-success', true);
if($this->config->global->flow != 'onlyStory' and !isonlybody() and (common::hasPriv('testcase', 'create') or common::hasPriv('testcase', 'batchCreate')))
{
@@ -64,7 +64,7 @@
echo " ";
}
- if($from == 'project') common::printIcon('task', 'create', "project=$param&storyID=$story->id&moduleID=$story->module", '', 'button', 'smile');
+ if($from == 'project') common::printIcon('task', 'create', "project=$param&storyID=$story->id&moduleID=$story->module", $story, 'button', 'smile');
echo ' ';
echo "";
- common::printIcon('story', 'edit', "storyID=$story->id");
- common::printCommentIcon('story');
- common::printIcon('story', 'create', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", '', 'button', 'copy');
- common::printIcon('story', 'delete', "storyID=$story->id", '', 'button', '', 'hiddenwin');
+ common::printIcon('story', 'edit', "storyID=$story->id", $story);
+ common::printCommentIcon('story', $story);
+ common::printIcon('story', 'create', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", $story, 'button', 'copy');
+ common::printIcon('story', 'delete', "storyID=$story->id", $story, 'button', '', 'hiddenwin');
echo ' ';
echo "";
@@ -354,7 +354,7 @@
linkStories) ;
+ $linkStories = explode(',', $story->linkStories) ;
foreach($linkStories as $linkStoryID)
{
if(isset($story->extraStories[$linkStoryID])) echo '- ' . html::a(inlink('view', "storyID=$linkStoryID"), "#$linkStoryID " . $story->extraStories[$linkStoryID]) . '
';
@@ -368,7 +368,7 @@
childStories) ;
+ $childStories = explode(',', $story->childStories) ;
foreach($childStories as $childStoryID)
{
if(isset($story->extraStories[$childStoryID])) echo '- ' . html::a(inlink('view', "storyID=$childStoryID"), "#$childStoryID " . $story->extraStories[$childStoryID]) . '
';
diff --git a/module/task/model.php b/module/task/model.php
index 3e4294abd6..d61af2cf2c 100644
--- a/module/task/model.php
+++ b/module/task/model.php
@@ -1593,6 +1593,8 @@ class taskModel extends model
{
$action = strtolower($action);
+ if(!common::limitedUser($task, 'task')) return false;
+
if($action == 'assignto') return $task->status != 'closed' and $task->status != 'cancel';
if($action == 'start') return $task->status == 'wait';
if($action == 'restart') return $task->status == 'pause';
diff --git a/module/task/view/view.html.php b/module/task/view/view.html.php
index 1d47c06c8a..e7cec9645a 100644
--- a/module/task/view/view.html.php
+++ b/module/task/view/view.html.php
@@ -43,10 +43,10 @@
echo '';
echo "";
- common::printIcon('task', 'edit', "taskID=$task->id");
- common::printCommentIcon('task');
- common::printIcon('task', 'create', "productID=0&storyID=0&moduleID=0&taskID=$task->id", '', 'button', 'copy');
- common::printIcon('task', 'delete', "projectID=$task->project&taskID=$task->id", '', 'button', '', 'hiddenwin');
+ common::printIcon('task', 'edit', "taskID=$task->id", $task);
+ common::printCommentIcon('task', $task);
+ common::printIcon('task', 'create', "productID=0&storyID=0&moduleID=0&taskID=$task->id", $task, 'button', 'copy');
+ common::printIcon('task', 'delete', "projectID=$task->project&taskID=$task->id", $task, 'button', '', 'hiddenwin');
echo ' ';
echo "";
diff --git a/module/testcase/model.php b/module/testcase/model.php
index d677682bb0..1912604acc 100644
--- a/module/testcase/model.php
+++ b/module/testcase/model.php
@@ -932,6 +932,8 @@ class testcaseModel extends model
{
$action = strtolower($action);
+ if(!common::limitedUser($case)) return false;
+
if($action == 'createbug') return $case->caseFails > 0;
if($action == 'review') return $case->status == 'wait';
diff --git a/module/testcase/view/browsedata.html.php b/module/testcase/view/browsedata.html.php
index 30c6d5733e..121fbd0548 100644
--- a/module/testcase/view/browsedata.html.php
+++ b/module/testcase/view/browsedata.html.php
@@ -77,13 +77,13 @@
stepNumber;?> |
id&version=$case->version", '', 'list', 'play', '', 'runCase iframe', false, "data-width='95%'");
- common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", '', 'list', 'list-alt', '', 'results iframe', false, "data-width='95%'");
+ common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", $case, 'list', 'play', '', 'runCase iframe', false, "data-width='95%'");
+ common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", $case, 'list', 'list-alt', '', 'results iframe', false, "data-width='95%'");
if($config->testcase->needReview or !empty($config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'list', 'review', '', 'iframe');
common::printIcon('testcase', 'edit', "caseID=$case->id", $case, 'list');
common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$case->id", $case, 'list', 'copy');
- if(common::hasPriv('testcase', 'delete'))
+ if(common::hasPriv('testcase', 'delete', $case))
{
$deleteURL = $this->createLink('testcase', 'delete', "caseID=$case->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"caseList\",confirmDelete)", '', '', "title='{$lang->testcase->delete}' class='btn-icon'");
diff --git a/module/testcase/view/view.html.php b/module/testcase/view/view.html.php
index 9ab3491bbd..8dfc0b1984 100644
--- a/module/testcase/view/view.html.php
+++ b/module/testcase/view/view.html.php
@@ -45,22 +45,22 @@
echo " ";
if(!$isLibCase)
{
- common::printIcon('testtask', 'runCase', "runID=$runID&caseID=$case->id&version=$case->currentVersion", '', 'button', '', '', 'runCase', false, "data-width='95%'");
- common::printIcon('testtask', 'results', "runID=$runID&caseID=$case->id&version=$case->version", '', 'button', '', '', 'results', false, "data-width='95%'");
+ common::printIcon('testtask', 'runCase', "runID=$runID&caseID=$case->id&version=$case->currentVersion", $case, 'button', '', '', 'runCase', false, "data-width='95%'");
+ common::printIcon('testtask', 'results', "runID=$runID&caseID=$case->id&version=$case->version", $case, 'button', '', '', 'results', false, "data-width='95%'");
- if($caseFails > 0) common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=$runID", '', 'button', 'bug', '', 'iframe', '', "data-width='90%'");
+ if($caseFails > 0) common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=$runID", $case, 'button', 'bug', '', 'iframe', '', "data-width='90%'");
}
if($config->testcase->needReview or !empty($config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'button', 'review', '', 'iframe');
echo ' ';
echo "";
- common::printIcon('testcase', 'edit',"caseID=$case->id");
- common::printCommentIcon('testcase');
- if(!$isLibCase) common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$case->id", '', 'button', 'copy');
- if($isLibCase and common::hasPriv('testsuite', 'createCase')) echo html::a($this->createLink('testsuite', 'createCase', "libID=$case->lib&moduleID=$case->module¶m=$case->id"), "", '', "class='btn' title='{$lang->testcase->copy}'");
- common::printIcon('testcase', 'delete', "caseID=$case->id", '', 'button', '', 'hiddenwin');
+ common::printIcon('testcase', 'edit',"caseID=$case->id", $case);
+ common::printCommentIcon('testcase', $case);
+ if(!$isLibCase) common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$case->id", $case, 'button', 'copy');
+ if($isLibCase and common::hasPriv('testsuite', 'createCase')) echo html::a($this->createLink('testsuite', 'createCase', "libID=$case->lib&moduleID=$case->module¶m=$case->id", $case), "", '', "class='btn' title='{$lang->testcase->copy}'");
+ common::printIcon('testcase', 'delete', "caseID=$case->id", $case, 'button', '', 'hiddenwin');
echo ' ';
-
+
echo "";
common::printRPN($browseLink, $preAndNext, inlink('view', "caseID=%s&version=0&testtask=$from&taskID=$taskID"));
echo ' ';
diff --git a/module/testsuite/model.php b/module/testsuite/model.php
index f2a1f288d7..090da3af16 100644
--- a/module/testsuite/model.php
+++ b/module/testsuite/model.php
@@ -804,4 +804,19 @@ class testsuiteModel extends model
}
}
}
+
+ /**
+ * Judge an action is clickable or not.
+ *-
+ * @param object $product-
+ * @param string $action-
+ * @access public
+ * @return void
+ */
+ public static function isClickable($testsuite, $action)
+ {
+ if(!common::limitedUser($testsuite)) return false;
+
+ return true;
+ }
}
diff --git a/module/testsuite/view/browse.html.php b/module/testsuite/view/browse.html.php
index 5ee5104c39..5de87fc912 100644
--- a/module/testsuite/view/browse.html.php
+++ b/module/testsuite/view/browse.html.php
@@ -45,10 +45,10 @@
| addedDate;?> |
id", '', 'list', 'link');
- common::printIcon('testsuite', 'edit', "suiteID=$suite->id", '', 'list');
+ common::printIcon('testsuite', 'linkCase', "suiteID=$suite->id", $suite, 'list', 'link');
+ common::printIcon('testsuite', 'edit', "suiteID=$suite->id", $suite, 'list');
- if(common::hasPriv('testsuite', 'delete'))
+ if(common::hasPriv('testsuite', 'delete', $suite))
{
$deleteURL = $this->createLink('testsuite', 'delete', "suiteID=$suite->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"suiteList\",confirmDelete)", '', '', "title='{$lang->testsuite->delete}' class='btn-icon'");
diff --git a/module/testsuite/view/view.html.php b/module/testsuite/view/view.html.php
index 03dba03eb8..64043ae6a5 100644
--- a/module/testsuite/view/view.html.php
+++ b/module/testsuite/view/view.html.php
@@ -105,13 +105,13 @@
| stepNumber;?> |
createLink('testsuite', 'unlinkCase', "suiteID=$suite->id&caseID=$case->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$unlinkURL\",\"caseList\",confirmUnlink)", '', '', "title='{$lang->testsuite->unlinkCase}' class='btn-icon'");
}
- common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", '', 'list', 'play', '', 'runCase iframe', false, "data-width='95%'");
- common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", '', 'list', 'list-alt', '', 'results iframe', false, "data-width='95%'");
+ common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", $suite, 'list', 'play', '', 'runCase iframe', false, "data-width='95%'");
+ common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", $suite, 'list', 'list-alt', '', 'results iframe', false, "data-width='95%'");
?>
|
diff --git a/module/testtask/model.php b/module/testtask/model.php
index 104de76185..61ff1bb631 100644
--- a/module/testtask/model.php
+++ b/module/testtask/model.php
@@ -1099,6 +1099,8 @@ class testtaskModel extends model
{
$action = strtolower($action);
+ if(!common::limitedUser($testtask)) return false;
+
if($action == 'start') return $testtask->status == 'wait';
if($action == 'block') return ($testtask->status == 'doing' || $testtask->status == 'wait');
if($action == 'activate') return ($testtask->status == 'blocked' || $testtask->status == 'done');
diff --git a/module/testtask/view/browse.html.php b/module/testtask/view/browse.html.php
index 0bdeeb7a3f..4df556fd65 100644
--- a/module/testtask/view/browse.html.php
+++ b/module/testtask/view/browse.html.php
@@ -86,13 +86,13 @@ $status = $this->session->testTaskVersionStatus;
testtask->statusList[$task->status];?> |
id", 'play', 'list', 'sitemap');
+ common::printIcon('testtask', 'cases', "taskID=$task->id", $task, 'list', 'sitemap');
common::printIcon('testtask', 'view', "taskID=$task->id", '', 'list', 'file','','iframe',true);
- common::printIcon('testtask', 'linkCase', "taskID=$task->id", '', 'list', 'link');
- common::printIcon('testtask', 'edit', "taskID=$task->id", '', 'list','','','iframe',true);
- common::printIcon('testreport', 'browse', "objectID=$task->product&objectType=product&extra=$task->id", '', 'list','flag');
+ common::printIcon('testtask', 'linkCase', "taskID=$task->id", $task, 'list', 'link');
+ common::printIcon('testtask', 'edit', "taskID=$task->id", $task, 'list','','','iframe',true);
+ common::printIcon('testreport', 'browse', "objectID=$task->product&objectType=product&extra=$task->id", $task, 'list','flag');
- if(common::hasPriv('testtask', 'delete'))
+ if(common::hasPriv('testtask', 'delete', $task))
{
$deleteURL = $this->createLink('testtask', 'delete', "taskID=$task->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"taskList\",confirmDelete)", '', '', "title='{$lang->testtask->delete}' class='btn-icon'");
diff --git a/module/testtask/view/casesdata.html.php b/module/testtask/view/casesdata.html.php
index 4ece30abcb..a172a05b70 100644
--- a/module/testtask/view/casesdata.html.php
+++ b/module/testtask/view/casesdata.html.php
@@ -61,10 +61,10 @@
| stepNumber;?> |
id", '', 'list', '', '', 'runCase iframe', false, "data-width='95%'");
- common::printIcon('testtask', 'results', "id=$run->id", '', 'list', '', '', 'iframe', '', "data-width='90%'");
+ common::printIcon('testtask', 'runCase', "id=$run->id", $run, 'list', '', '', 'runCase iframe', false, "data-width='95%'");
+ common::printIcon('testtask', 'results', "id=$run->id", $run, 'list', '', '', 'iframe', '', "data-width='90%'");
- if(common::hasPriv('testtask', 'unlinkCase'))
+ if(common::hasPriv('testtask', 'unlinkCase', $run))
{
$unlinkURL = $this->createLink('testtask', 'unlinkCase', "caseID=$run->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$unlinkURL\",\"caseList\",confirmUnlink)", '', '', "title='{$lang->testtask->unlinkCase}' class='btn-icon'");
diff --git a/module/testtask/view/view.html.php b/module/testtask/view/view.html.php
index 1e40dfd314..5cce7d152b 100644
--- a/module/testtask/view/view.html.php
+++ b/module/testtask/view/view.html.php
@@ -38,8 +38,8 @@
echo '';
echo " ";
- common::printIcon('testtask', 'edit', "taskID=$task->id");
- common::printIcon('testtask', 'delete', "taskID=$task->id", '', 'button', '', 'hiddenwin');
+ common::printIcon('testtask', 'edit', "taskID=$task->id", $task);
+ common::printIcon('testtask', 'delete', "taskID=$task->id", $task, 'button', '', 'hiddenwin');
echo ' ';
echo "";
diff --git a/module/user/config.php b/module/user/config.php
index b4211a351f..47ab768e3e 100644
--- a/module/user/config.php
+++ b/module/user/config.php
@@ -6,8 +6,8 @@ $config->user->edit = new stdclass();
$config->user->create->requiredFields = 'account,realname,password,password1,password2';
$config->user->edit->requiredFields = 'account,realname';
-$config->user->customBatchCreateFields = 'dept,email,gender,commiter,join,skype,qq,yahoo,gtalk,wangwang,mobile,phone,address,zipcode';
-$config->user->customBatchEditFields = 'dept,email,commiter,join,skype,qq,yahoo,gtalk,wangwang,mobile,phone,address,zipcode';
+$config->user->customBatchCreateFields = 'dept,email,gender,commiter,join,skype,qq,yahoo,gtalk,wangwang,mobile,phone,address,zipcode,limitedUser';
+$config->user->customBatchEditFields = 'dept,email,commiter,join,skype,qq,yahoo,gtalk,wangwang,mobile,phone,address,zipcode,limitedUser';
$config->user->custom = new stdclass();
$config->user->custom->batchCreateFields = 'dept,email,gender';
diff --git a/module/user/lang/zh-cn.php b/module/user/lang/zh-cn.php
index 6c0fee5f61..f9a04cff6e 100644
--- a/module/user/lang/zh-cn.php
+++ b/module/user/lang/zh-cn.php
@@ -97,6 +97,10 @@ $lang->user->lockWarning = "您还有%s次尝试机会。";
$lang->user->loginLocked = "密码尝试次数太多,请联系管理员解锁,或%s分钟后重试。";
$lang->user->weakPassword = "您的密码强度小于系统设定。";
+$lang->user->limitedUser = '受限用户';
+$lang->user->limitedUserList['no'] = '否';
+$lang->user->limitedUserList['yes'] = '是';
+
$lang->user->roleList[''] = '';
$lang->user->roleList['dev'] = '研发';
$lang->user->roleList['qa'] = '测试';
@@ -128,12 +132,13 @@ $lang->user->tpl->content = '内容';
$lang->user->tpl->public = '是否公开';
$lang->user->placeholder = new stdclass();
-$lang->user->placeholder->account = '英文、数字和下划线的组合,三位以上';
-$lang->user->placeholder->password1 = '六位以上';
-$lang->user->placeholder->role = '职位影响内容和用户列表的顺序。';
-$lang->user->placeholder->group = '分组决定用户的权限列表。';
-$lang->user->placeholder->commiter = '版本控制系统(subversion)中的帐号';
-$lang->user->placeholder->verify = '需要输入你的密码加以验证';
+$lang->user->placeholder->account = '英文、数字和下划线的组合,三位以上';
+$lang->user->placeholder->password1 = '六位以上';
+$lang->user->placeholder->role = '职位影响内容和用户列表的顺序。';
+$lang->user->placeholder->group = '分组决定用户的权限列表。';
+$lang->user->placeholder->commiter = '版本控制系统(subversion)中的帐号';
+$lang->user->placeholder->verify = '需要输入你的密码加以验证';
+$lang->user->placeholder->limitedUser = '只能编辑与自己相关的内容。';
$lang->user->placeholder->passwordStrength[1] = '6位以上,包含大小写字母,数字。';
$lang->user->placeholder->passwordStrength[2] = '10位以上,包含大小写字母,数字,特殊字符。';
diff --git a/module/user/model.php b/module/user/model.php
index 8e2f464ebb..1f2ed14d4a 100644
--- a/module/user/model.php
+++ b/module/user/model.php
@@ -200,7 +200,7 @@ class userModel extends model
/**
* Create a user.
- *
+ *
* @access public
* @return void
*/
@@ -298,6 +298,8 @@ class userModel extends model
$data[$i]->address = $users->address[$i];
$data[$i]->zipcode = $users->zipcode[$i];
+ $data[$i]->limitedUser = $users->limitedUser[$i];
+
/* Change for append field, such as feedback.*/
if(!empty($this->config->user->batchAppendFields))
{
@@ -465,6 +467,7 @@ class userModel extends model
$users[$id]['phone'] = $data->phone[$id];
$users[$id]['address'] = $data->address[$id];
$users[$id]['zipcode'] = $data->zipcode[$id];
+ $users[$id]['limitedUser'] = $data->limitedUser[$id];
$users[$id]['dept'] = $data->dept[$id] == 'ditto' ? (isset($prev['dept']) ? $prev['dept'] : 0) : $data->dept[$id];
$users[$id]['role'] = $data->role[$id] == 'ditto' ? (isset($prev['role']) ? $prev['role'] : 0) : $data->role[$id];
@@ -518,7 +521,7 @@ class userModel extends model
public function updatePassword($userID)
{
if(!$this->checkPassword()) return;
-
+
$user = fixer::input('post')
->setIF($this->post->password1 != false, 'password', md5($this->post->password1))
->remove('account, password1, password2, originalPassword')
@@ -581,7 +584,7 @@ class userModel extends model
}
return !dao::isError();
}
-
+
/**
* Identify a user.
*
@@ -593,7 +596,7 @@ class userModel extends model
public function identify($account, $password)
{
if(!$account or !$password) return false;
-
+
/* Get the user first. If $password length is 32, don't add the password condition. */
$record = $this->dao->select('*')->from(TABLE_USER)
->where('account')->eq($account)
diff --git a/module/user/view/batchcreate.html.php b/module/user/view/batchcreate.html.php
index 9989a3a032..1a06e6e8ca 100644
--- a/module/user/view/batchcreate.html.php
+++ b/module/user/view/batchcreate.html.php
@@ -55,6 +55,7 @@ $minWidth = (count($visibleFields) > 5) ? 'w-150px' : '';
'> user->phone;?> |
'> user->address;?> |
'> user->zipcode;?> |
+ '> user->limitedUser;?> |
$lang->user->ditto)?>
@@ -89,7 +90,8 @@ $minWidth = (count($visibleFields) > 5) ? 'w-150px' : '';
'> |
'> |
'> |
-
+ > user->limitedUserList, 'no');?> |
+
| user->verifyPassword?> |
diff --git a/module/user/view/batchedit.html.php b/module/user/view/batchedit.html.php
index ee2624613e..c3a89db2ed 100644
--- a/module/user/view/batchedit.html.php
+++ b/module/user/view/batchedit.html.php
@@ -51,6 +51,7 @@ $minWidth = (count($visibleFields) > 7) ? 'w-120px' : '';
'> user->phone;?> |
'> user->address;?> |
'> user->zipcode;?> |
+ '> user->limitedUser;?> |
$lang->user->ditto) + $depts;?>
@@ -80,6 +81,7 @@ $minWidth = (count($visibleFields) > 7) ? 'w-120px' : '';
'> id]", $user->phone, "class='form-control' autocomplete='off'");?> |
'> id]", $user->address, "class='form-control' autocomplete='off'");?> |
'> id]", $user->zipcode, "class='form-control' autocomplete='off'");?> |
+ > id]", $lang->user->limitedUserList, $user->limitedUser);?> |
diff --git a/module/user/view/create.html.php b/module/user/view/create.html.php
index 95d34dd32f..db58bf376d 100644
--- a/module/user/view/create.html.php
+++ b/module/user/view/create.html.php
@@ -61,6 +61,11 @@
|
user->placeholder->group?> |
+
+ | user->limitedUser;?> |
+ user->limitedUserList, 'no');?> |
+ user->placeholder->limitedUser?> |
+
| user->email;?> |
|
diff --git a/module/user/view/edit.html.php b/module/user/view/edit.html.php
index 4a03320217..30f6be8ccd 100644
--- a/module/user/view/edit.html.php
+++ b/module/user/view/edit.html.php
@@ -71,6 +71,8 @@
| user->commiter;?> |
commiter, "class='form-control' autocomplete='off'");?> |
+ user->limitedUser;?> |
+ user->limitedUserList, $user->limitedUser);?> |
| | | |