diff --git a/db/update12.4.4.sql b/db/update12.4.4.sql
index 6db33edf22..a09eaaad24 100644
--- a/db/update12.4.4.sql
+++ b/db/update12.4.4.sql
@@ -1,4 +1,5 @@
-ALTER TABLE `zt_doc` ADD `mailto` text AFTER `editedDate`;
+ALTER TABLE `zt_job` ADD `customParam` text AFTER `lastTag`;
+ALTER TABLE `zt_doc` ADD `mailto` text AFTER `editedDate`;
ALTER TABLE `zt_task` CHANGE `realStarted` `realStarted` datetime NOT NULL AFTER `estStarted`;
ALTER TABLE `zt_group` CHANGE `program` `PRJ` mediumint(8) unsigned NOT NULL DEFAULT 0;
diff --git a/db/zentao.sql b/db/zentao.sql
index 905e0a125d..1a33e6149f 100644
--- a/db/zentao.sql
+++ b/db/zentao.sql
@@ -466,6 +466,7 @@ CREATE TABLE IF NOT EXISTS `zt_job` (
`lastExec` datetime DEFAULT NULL,
`lastStatus` varchar(255) DEFAULT NULL,
`lastTag` varchar(255) DEFAULT NULL,
+ `customParam` text NOT NULL,
`deleted` enum('0','1') NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
diff --git a/module/bug/model.php b/module/bug/model.php
index 9f6c64d0a5..dfd5705ccd 100644
--- a/module/bug/model.php
+++ b/module/bug/model.php
@@ -1417,10 +1417,12 @@ class bugModel extends model
* @param int $account
* @param bool $appendProduct
* @param int $limit
+ * @param array $skipProductIDList
+ * @param array $skipProjectIDList
* @access public
* @return array
*/
- public function getUserBugPairs($account, $appendProduct = true, $limit = 0)
+ public function getUserBugPairs($account, $appendProduct = true, $limit = 0, $skipProductIDList = array(), $skipProjectIDList = array())
{
$bugs = array();
$stmt = $this->dao->select('t1.id, t1.title, t2.name as product')
@@ -1429,6 +1431,8 @@ class bugModel extends model
->on('t1.product=t2.id')
->where('t1.assignedTo')->eq($account)
->beginIF(!$this->app->user->admin)->andWhere('t1.project')->in('0,' . $this->app->user->view->projects)->fi()
+ ->beginIF(!empty($skipProductIDList))->andWhere('t1.product')->notin($skipProductIDList)->fi()
+ ->beginIF(!empty($skipProjectIDList))->andWhere('t1.project')->notin($skipProjectIDList)->fi()
->andWhere('t1.deleted')->eq(0)
->orderBy('id desc')
->beginIF($limit > 0)->limit($limit)->fi()
@@ -2505,14 +2509,14 @@ class bugModel extends model
/* Check the product is closed. */
$changeAllowed = common::checkObjectChangeAllowed('bug', $bug);
- $canBatchEdit = common::hasPriv('bug', 'batchEdit');
- $canBatchConfirm = common::hasPriv('bug', 'batchConfirm');
+ $canBatchEdit = ($changeAllowed and common::hasPriv('bug', 'batchEdit'));
+ $canBatchConfirm = ($changeAllowed and common::hasPriv('bug', 'batchConfirm'));
$canBatchClose = common::hasPriv('bug', 'batchClose');
- $canBatchActivate = common::hasPriv('bug', 'batchActivate');
- $canBatchChangeBranch = common::hasPriv('bug', 'batchChangeBranch');
- $canBatchChangeModule = common::hasPriv('bug', 'batchChangeModule');
- $canBatchResolve = common::hasPriv('bug', 'batchResolve');
- $canBatchAssignTo = common::hasPriv('bug', 'batchAssignTo');
+ $canBatchActivate = ($changeAllowed and common::hasPriv('bug', 'batchActivate'));
+ $canBatchChangeBranch = ($changeAllowed and common::hasPriv('bug', 'batchChangeBranch'));
+ $canBatchChangeModule = ($changeAllowed and common::hasPriv('bug', 'batchChangeModule'));
+ $canBatchResolve = ($changeAllowed and common::hasPriv('bug', 'batchResolve'));
+ $canBatchAssignTo = ($changeAllowed and common::hasPriv('bug', 'batchAssignTo'));
$canBatchAction = ($canBatchEdit or $canBatchConfirm or $canBatchClose or $canBatchActivate or $canBatchChangeBranch or $canBatchChangeModule or $canBatchResolve or $canBatchAssignTo);
@@ -2574,8 +2578,7 @@ class bugModel extends model
case 'id':
if($canBatchAction)
{
- $disabled = $changeAllowed ? '' : 'disabled';
- echo html::checkbox('bugIDList', array($bug->id => ''), '', $disabled) . html::a(helper::createLink('bug', 'view', "bugID=$bug->id"), sprintf('%03d', $bug->id));
+ echo html::checkbox('bugIDList', array($bug->id => ''), '') . html::a(helper::createLink('bug', 'view', "bugID=$bug->id"), sprintf('%03d', $bug->id));
}
else
{
@@ -2726,15 +2729,19 @@ class bugModel extends model
echo substr($bug->lastEditedDate, 5, 11);
break;
case 'actions':
+ $params = "bugID=$bug->id";
if($changeAllowed)
{
- $params = "bugID=$bug->id";
common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'confirm', '', 'iframe', true);
common::printIcon('bug', 'resolve', $params, $bug, 'list', 'checked', '', 'iframe', true);
common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true);
common::printIcon('bug', 'edit', $params, $bug, 'list');
common::printIcon('bug', 'create', "product=$bug->product&branch=$bug->branch&extra=$params", $bug, 'list', 'copy');
}
+ else
+ {
+ common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true);
+ }
break;
}
echo '';
diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php
index b901159e36..b37104f9d1 100644
--- a/module/bug/view/browse.html.php
+++ b/module/bug/view/browse.html.php
@@ -211,14 +211,15 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow
$widths = $this->datatable->setFixedFieldWidth($setting);
$columns = 0;
- $canBatchEdit = common::hasPriv('bug', 'batchEdit');
- $canBatchConfirm = common::hasPriv('bug', 'batchConfirm');
+ $changeAllowed = (empty($config->global->closedProductStatus) or $product->status != 'closed');
+ $canBatchEdit = ($changeAllowed and common::hasPriv('bug', 'batchEdit'));
+ $canBatchConfirm = ($changeAllowed and common::hasPriv('bug', 'batchConfirm'));
$canBatchClose = common::hasPriv('bug', 'batchClose');
- $canBatchActivate = common::hasPriv('bug', 'batchActivate');
- $canBatchChangeBranch = common::hasPriv('bug', 'batchChangeBranch');
- $canBatchChangeModule = common::hasPriv('bug', 'batchChangeModule');
- $canBatchResolve = common::hasPriv('bug', 'batchResolve');
- $canBatchAssignTo = common::hasPriv('bug', 'batchAssignTo');
+ $canBatchActivate = ($changeAllowed and common::hasPriv('bug', 'batchActivate'));
+ $canBatchChangeBranch = ($changeAllowed and common::hasPriv('bug', 'batchChangeBranch'));
+ $canBatchChangeModule = ($changeAllowed and common::hasPriv('bug', 'batchChangeModule'));
+ $canBatchResolve = ($changeAllowed and common::hasPriv('bug', 'batchResolve'));
+ $canBatchAssignTo = ($changeAllowed and common::hasPriv('bug', 'batchAssignTo'));
$canBatchAction = ($canBatchEdit or $canBatchConfirm or $canBatchClose or $canBatchActivate or $canBatchChangeBranch or $canBatchChangeModule or $canBatchResolve or $canBatchAssignTo);
?>
diff --git a/module/common/model.php b/module/common/model.php
index 9f4897a508..f64440276f 100644
--- a/module/common/model.php
+++ b/module/common/model.php
@@ -1490,7 +1490,7 @@ EOD;
global $app, $lang;
/* Check the parent object is closed. */
- if(!commonModel::checkObjectChangeAllowed($module, $object)) return false;
+ if(strpos('close|batchClose', $method) === false and !commonModel::checkObjectChangeAllowed($module, $object)) return false;
/* Check is the super admin or not. */
if(!empty($app->user->admin) || strpos($app->company->admins, ",{$app->user->account},") !== false) return true;
@@ -1855,32 +1855,18 @@ EOD;
global $app, $config;
/* Check the product is closed. */
- if(!empty($object->product) and !empty($config->global->closedProductStatus))
+ if(!empty($object->product) and is_numeric($object->product) and !empty($config->global->closedProductStatus))
{
$productID = trim($object->product, ',');
$product = $app->control->loadModel('product')->getByID($productID);
if($product->status == 'closed') return false;
-
- /* Get the projects associated with the story. */
- if($module == 'story' and empty($object->project))
- {
- $projects = $app->dbh->query('SELECT project FROM ' . TABLE_PROJECTSTORY . " WHERE `story` = '$object->id'")->fetchAll();
- $projectIDList = array();
- foreach($projects as $project) $projectIDList[] = $project->project;
-
- $object->project = implode(',', $projectIDList);
- }
}
/* Check the project is closed. */
- if(!empty($object->project) and !empty($config->global->closedProjectStatus))
+ if(strpos('story|bug|testtask', $module) === false and !empty($object->project) and is_numeric($object->project) and !empty($config->global->closedProjectStatus))
{
- $projectIDList = explode(',', $object->project);
- $projects = $app->control->loadModel('project')->getByIDList($projectIDList);
- foreach($projects as $project)
- {
- if($project->status == 'closed') return false;
- }
+ $project = $app->control->loadModel('project')->getByID($object->project);
+ if($project->status == 'closed') return false;
}
return true;
diff --git a/module/doc/control.php b/module/doc/control.php
index 3947ea8fcb..260e11bd74 100644
--- a/module/doc/control.php
+++ b/module/doc/control.php
@@ -446,9 +446,11 @@ class doc extends control
{
$hyperdown = $this->app->loadClass('hyperdown');
$doc->content = $hyperdown->makeHtml($doc->content);
+
/* Add a newline attribute to the table. */
$doc->content = str_replace("
", " | ", $doc->content);
$doc->content = str_replace(" | ", " | ", $doc->content);
+
$doc->digest = $hyperdown->makeHtml($doc->digest);
}
diff --git a/module/doc/model.php b/module/doc/model.php
index a399234707..baee999320 100644
--- a/module/doc/model.php
+++ b/module/doc/model.php
@@ -1658,6 +1658,7 @@ class docModel extends model
$doc->content = str_replace(" | ", " | ", $doc->content);
$doc->content = str_replace(" | ", " | ", $doc->content);
}
+
/* Get action info. */
$action = $this->loadModel('action')->getById($actionID);
$history = $this->action->getHistory($actionID);
diff --git a/module/doc/view/browse.html.php b/module/doc/view/browse.html.php
index 67417d0e2e..4c0978103c 100644
--- a/module/doc/view/browse.html.php
+++ b/module/doc/view/browse.html.php
@@ -74,7 +74,7 @@ var browseType = '';
doc->noDoc;?>
-
+
createLink('doc', 'create', "libID={$libID}&moduleID=$moduleID"), " " . $lang->doc->create, '', "class='btn btn-info'");?>
diff --git a/module/doc/view/showfiles.html.php b/module/doc/view/showfiles.html.php
index 70c7d48be7..46eab0d8e8 100644
--- a/module/doc/view/showfiles.html.php
+++ b/module/doc/view/showfiles.html.php
@@ -79,7 +79,7 @@
|
id", '', "data-toggle='modal'", "class='btn' title={$lang->doc->download}", true, false, $file);
- common::printLink('file', 'delete', "fileID=$file->id", '', 'hiddenwin', "class='btn' title={$lang->delete}", true, false, $file);
+ if($changeAllowed) common::printLink('file', 'delete', "fileID=$file->id", '', 'hiddenwin', "class='btn' title={$lang->delete}", true, false, $file);
?>
|
diff --git a/module/git/model.php b/module/git/model.php
index 365b101fe4..9a3dda53e6 100644
--- a/module/git/model.php
+++ b/module/git/model.php
@@ -187,6 +187,7 @@ class gitModel extends model
}
}
+
$this->repo->updateCommitCount($repo->id, $commits);
$this->dao->update(TABLE_REPO)->set('lastSync')->eq(helper::now())->where('id')->eq($repo->id)->exec();
if($isPrintLog) $this->printLog("\n\nrepo #" . $repo->id . ': ' . $repo->path . " finished");
diff --git a/module/job/css/create.css b/module/job/css/create.css
index d0fd86e9f7..84c9e88638 100644
--- a/module/job/css/create.css
+++ b/module/job/css/create.css
@@ -5,3 +5,4 @@
#jkHost_chosen .chosen-single{border-right:0px;}
#jkJobBox{width:385px;}
#svnDirBox .input-group{width:unset !important}
+#paramDiv .input-group{padding:3px}
diff --git a/module/job/css/edit.css b/module/job/css/edit.css
index 18378d434c..6ce26cba1e 100644
--- a/module/job/css/edit.css
+++ b/module/job/css/edit.css
@@ -5,3 +5,4 @@
#jkHost_chosen .chosen-single{border-right:0px;}
#jkJobBox{width:385px;}
#svnDirBox .input-group{width:unset !important}
+#paramDiv .input-group{padding:3px}
diff --git a/module/job/js/common.js b/module/job/js/common.js
new file mode 100644
index 0000000000..716f6af921
--- /dev/null
+++ b/module/job/js/common.js
@@ -0,0 +1,26 @@
+/**
+ * Add item.
+ *
+ * @param obj $obj
+ * @access public
+ * @return void
+ */
+function addItem(obj)
+{
+ var $inputgroup = $(obj).closest('.input-group').clone();
+ $inputgroup.find('input').val('');
+ $(obj).closest('.input-group').after($inputgroup);
+}
+
+/**
+ * Delete item.
+ *
+ * @param obj $obj
+ * @access public
+ * @return void
+ */
+function deleteItem(obj)
+{
+ if($('#paramDiv').find("input").size() <= 2) return;
+ $(obj).closest('.input-group').remove();
+}
diff --git a/module/job/lang/de.php b/module/job/lang/de.php
index 01cca081b9..aec57830bd 100644
--- a/module/job/lang/de.php
+++ b/module/job/lang/de.php
@@ -26,6 +26,9 @@ $lang->job->atTime = 'At Time';
$lang->job->lastStatus = 'Last Status';
$lang->job->lastExec = 'Last Executed';
$lang->job->comment = 'Match Keywords';
+$lang->job->customParam = 'Benutzerdefinierte Bauparameter';
+$lang->job->paramName = 'Name';
+$lang->job->paramValue = 'Wert';
$lang->job->lblBasic = 'Basic Info';
@@ -33,6 +36,7 @@ $lang->job->example = 'e.g.';
$lang->job->commitEx = "Used to match the keywords used to create a compile. Multiple keywords are separated by ','";
$lang->job->cronSample = 'e.g. 0 0 2 * * 2-6/1 means 2:00 a.m. every weekday.';
$lang->job->sendExec = 'Send execute request success.';
+$lang->job->inputName = 'Bitte geben Sie den Parameternamen ein.';
$lang->job->buildTypeList['build'] = 'Only Build';
$lang->job->buildTypeList['buildAndDeploy'] = 'Build And Deploy';
diff --git a/module/job/lang/en.php b/module/job/lang/en.php
index 01cca081b9..f84bf57191 100644
--- a/module/job/lang/en.php
+++ b/module/job/lang/en.php
@@ -26,6 +26,9 @@ $lang->job->atTime = 'At Time';
$lang->job->lastStatus = 'Last Status';
$lang->job->lastExec = 'Last Executed';
$lang->job->comment = 'Match Keywords';
+$lang->job->customParam = 'Custom build parameters';
+$lang->job->paramName = 'Name';
+$lang->job->paramValue = 'Value';
$lang->job->lblBasic = 'Basic Info';
@@ -33,6 +36,7 @@ $lang->job->example = 'e.g.';
$lang->job->commitEx = "Used to match the keywords used to create a compile. Multiple keywords are separated by ','";
$lang->job->cronSample = 'e.g. 0 0 2 * * 2-6/1 means 2:00 a.m. every weekday.';
$lang->job->sendExec = 'Send execute request success.';
+$lang->job->inputName = 'Please enter parameter name.';
$lang->job->buildTypeList['build'] = 'Only Build';
$lang->job->buildTypeList['buildAndDeploy'] = 'Build And Deploy';
diff --git a/module/job/lang/fr.php b/module/job/lang/fr.php
index d8d497a70a..cb3df596b4 100644
--- a/module/job/lang/fr.php
+++ b/module/job/lang/fr.php
@@ -26,6 +26,9 @@ $lang->job->atTime = 'heure';
$lang->job->lastStatus = 'Dern Statut';
$lang->job->lastExec = 'Dern Exec';
$lang->job->comment = 'Corres Mots cl閟';
+$lang->job->customParam = 'Paramètres de construction personnalisés';
+$lang->job->paramName = 'Nom';
+$lang->job->paramValue = 'PH';
$lang->job->lblBasic = 'Infos de Base';
@@ -33,6 +36,7 @@ $lang->job->example = 'ex.';
$lang->job->commitEx = "Utilis pour faire correspondre les mots cl閟 utilis閟 pour cr閑r une compilation. Plusieurs mots cl閟 sont s閜ar閟 par ','";
$lang->job->cronSample = 'ex: 0 0 2 * * 2-6/1 signifie 2:00 a.m. chaque jour de la semaine.';
$lang->job->sendExec = "Envoi de la demande d'ex閏ution r閡ssie.";
+$lang->job->inputName = 'Veuillez saisir le nom du paramètre.';
$lang->job->buildTypeList['build'] = 'Seulement Build';
$lang->job->buildTypeList['buildAndDeploy'] = 'Build et D閜loiement';
diff --git a/module/job/lang/vi.php b/module/job/lang/vi.php
index 7330d8447a..961222932a 100644
--- a/module/job/lang/vi.php
+++ b/module/job/lang/vi.php
@@ -26,6 +26,9 @@ $lang->job->atTime = 'Vào lúc';
$lang->job->lastStatus = 'Tình trạng cuối';
$lang->job->lastExec = 'Xử lý cuối';
$lang->job->comment = 'Từ khóa phù hợp';
+$lang->job->customParam = 'Tham số tự chọn';
+$lang->job->paramName = 'Tên';
+$lang->job->paramValue = 'giá';
$lang->job->lblBasic = 'Basic Info';
@@ -33,6 +36,7 @@ $lang->job->example = 'ví dụ: ';
$lang->job->commitEx = "Used to match the keywords used to create a compile. Multiple keywords are separated by ','";
$lang->job->cronSample = 'ví dụ: 0 0 2 * * 2-6/1 means 2:00 a.m. every weekday.';
$lang->job->sendExec = 'Gửi execute request success.';
+$lang->job->inputName = 'Hãy nhập tên tham số.';
$lang->job->buildTypeList['build'] = 'Chỉ bản dựng';
$lang->job->buildTypeList['buildAndDeploy'] = 'Bản dựng và triển khai';
diff --git a/module/job/lang/zh-cn.php b/module/job/lang/zh-cn.php
index f51a8b3b69..65e5453f1e 100644
--- a/module/job/lang/zh-cn.php
+++ b/module/job/lang/zh-cn.php
@@ -26,6 +26,9 @@ $lang->job->atTime = '执行时间';
$lang->job->lastStatus = '最后执行状态';
$lang->job->lastExec = '最后执行时间';
$lang->job->comment = '匹配关键字';
+$lang->job->customParam = '自定义构建参数';
+$lang->job->paramName = '名称';
+$lang->job->paramValue = '值';
$lang->job->lblBasic = '基本信息';
@@ -33,6 +36,7 @@ $lang->job->example = '举例';
$lang->job->commitEx = "用于匹配创建构建任务的关键字,多个关键字用','分割";
$lang->job->cronSample = '如 0 0 2 * * 2-6/1 表示每个工作日凌晨2点';
$lang->job->sendExec = '发送执行请求成功!执行结果:%s';
+$lang->job->inputName = '请输入参数名称。';
$lang->job->buildTypeList['build'] = '仅构建';
$lang->job->buildTypeList['buildAndDeploy'] = '构建部署';
diff --git a/module/job/lang/zh-tw.php b/module/job/lang/zh-tw.php
index b9a37b2ea9..6498ae41ca 100644
--- a/module/job/lang/zh-tw.php
+++ b/module/job/lang/zh-tw.php
@@ -26,6 +26,9 @@ $lang->job->atTime = '執行時間';
$lang->job->lastStatus = '最後執行狀態';
$lang->job->lastExec = '最後執行時間';
$lang->job->comment = '匹配關鍵字';
+$lang->job->customParam = '自定義構建參數';
+$lang->job->paramName = '名稱';
+$lang->job->paramValue = '值';
$lang->job->lblBasic = '基本信息';
@@ -33,6 +36,7 @@ $lang->job->example = '舉例';
$lang->job->commitEx = "用於匹配創建構建任務的關鍵字,多個關鍵字用','分割";
$lang->job->cronSample = '如 0 0 2 * * 2-6/1 表示每個工作日凌晨2點';
$lang->job->sendExec = '發送執行請求成功!執行結果:%s';
+$lang->job->inputName = '請輸入參數名稱。';
$lang->job->buildTypeList['build'] = '僅構建';
$lang->job->buildTypeList['buildAndDeploy'] = '構建部署';
diff --git a/module/job/model.php b/module/job/model.php
index bb77d9cb2b..e97931de37 100644
--- a/module/job/model.php
+++ b/module/job/model.php
@@ -128,6 +128,23 @@ class jobModel extends model
if($job->svnDir == '/' and $_POST['svnDir']) $job->svnDir = array_pop($_POST['svnDir']);
}
+ $customParam = array();
+ foreach($job->paramName as $key => $paramName)
+ {
+ $paramValue = zget($job->paramValue, $key, '');
+
+ if(empty($paramName) and !empty($paramValue))
+ {
+ dao::$errors[] = $this->lang->job->inputName;
+ return false;
+ }
+
+ if(!empty($paramName)) $customParam[$paramName] = $paramValue;
+ }
+ unset($job->paramName);
+ unset($job->paramValue);
+ $job->customParam = json_encode($customParam);
+
$this->dao->insert(TABLE_JOB)->data($job)
->batchCheck($this->config->job->create->requiredFields, 'notempty')
@@ -171,6 +188,23 @@ class jobModel extends model
if($job->svnDir == '/' and $_POST['svnDir']) $job->svnDir = array_pop($_POST['svnDir']);
}
+ $customParam = array();
+ foreach($job->paramName as $key => $paramName)
+ {
+ $paramValue = zget($job->paramValue, $key, '');
+
+ if(empty($paramName) and !empty($paramValue))
+ {
+ dao::$errors[] = $this->lang->job->inputName;
+ return false;
+ }
+
+ if(!empty($paramName)) $customParam[$paramName] = $paramValue;
+ }
+ unset($job->paramName);
+ unset($job->paramValue);
+ $job->customParam = json_encode($customParam);
+
$this->dao->update(TABLE_JOB)->data($job)
->batchCheck($this->config->job->edit->requiredFields, 'notempty')
@@ -240,7 +274,7 @@ class jobModel extends model
*/
public function exec($id)
{
- $job = $this->dao->select('t1.id,t1.name,t1.repo,t1.jkJob,t1.triggerType,t1.atTime,t2.name as jenkinsName,t2.url,t2.account,t2.token,t2.password')
+ $job = $this->dao->select('t1.id,t1.name,t1.repo,t1.jkJob,t1.triggerType,t1.atTime,t1.customParam,t2.name as jenkinsName,t2.url,t2.account,t2.token,t2.password')
->from(TABLE_JOB)->alias('t1')
->leftJoin(TABLE_JENKINS)->alias('t2')->on('t1.jkHost=t2.id')
->where('t1.id')->eq($id)
@@ -298,6 +332,10 @@ class jobModel extends model
$compileID = $this->dao->lastInsertId();
$data->ZENTAO_DATA = "compile={$compileID}";
+
+ //Add custom parameters to the data.
+ foreach(json_decode($job->customParam) as $paramName => $paramValue) $data->$paramName = $paramValue;
+
$compile = new stdclass();
$compile->queue = $this->loadModel('ci')->sendRequest($url->url, $data, $url->userPWD);
$compile->status = $compile->queue ? 'created' : 'create_fail';
diff --git a/module/job/view/create.html.php b/module/job/view/create.html.php
index f25dd6dd54..57f0345e31 100644
--- a/module/job/view/create.html.php
+++ b/module/job/view/create.html.php
@@ -86,6 +86,19 @@
+
+ | job->customParam;?> |
+
+
+ |
+
|
diff --git a/module/job/view/edit.html.php b/module/job/view/edit.html.php
index fbc5a36da6..0baae7783a 100644
--- a/module/job/view/edit.html.php
+++ b/module/job/view/edit.html.php
@@ -109,6 +109,21 @@
|
+
+ | job->customParam;?> |
+
+ customParam) as $paramName => $paramValue):?>
+
+
+ |
+
|
diff --git a/module/job/view/view.html.php b/module/job/view/view.html.php
index 23b0e7153d..10d564da1d 100644
--- a/module/job/view/view.html.php
+++ b/module/job/view/view.html.php
@@ -97,6 +97,14 @@
?>
|
+
+ | job->customParam;?> |
+
+ customParam) as $paramName => $paramValue):?>
+
+
+ |
+
diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php
index 05a1e4be15..3068fc47e1 100644
--- a/module/product/view/browse.html.php
+++ b/module/product/view/browse.html.php
@@ -189,14 +189,15 @@ js::set('foldAll', $lang->project->treeLevel['root']);
$widths = $this->datatable->setFixedFieldWidth($setting);
$columns = 0;
- $canBatchEdit = common::hasPriv('story', 'batchEdit');
- $canBatchClose = common::hasPriv('story', 'batchClose') and strtolower($browseType) != 'closedbyme' and strtolower($browseType) != 'closedstory';
- $canBatchReview = common::hasPriv('story', 'batchReview');
- $canBatchChangeStage = common::hasPriv('story', 'batchChangeStage');
- $canBatchChangeBranch = common::hasPriv('story', 'batchChangeBranch');
- $canBatchChangeModule = common::hasPriv('story', 'batchChangeModule');
- $canBatchChangePlan = common::hasPriv('story', 'batchChangePlan');
- $canBatchAssignTo = common::hasPriv('story', 'batchAssignTo');
+ $changeAllowed = (empty($config->global->closedProductStatus) or $product->status != 'closed');
+ $canBatchEdit = ($changeAllowed and common::hasPriv('story', 'batchEdit'));
+ $canBatchClose = (common::hasPriv('story', 'batchClose') and strtolower($browseType) != 'closedbyme' and strtolower($browseType) != 'closedstory');
+ $canBatchReview = ($changeAllowed and common::hasPriv('story', 'batchReview'));
+ $canBatchChangeStage = ($changeAllowed and common::hasPriv('story', 'batchChangeStage'));
+ $canBatchChangeBranch = ($changeAllowed and common::hasPriv('story', 'batchChangeBranch'));
+ $canBatchChangeModule = ($changeAllowed and common::hasPriv('story', 'batchChangeModule'));
+ $canBatchChangePlan = ($changeAllowed and common::hasPriv('story', 'batchChangePlan'));
+ $canBatchAssignTo = ($changeAllowed and common::hasPriv('story', 'batchAssignTo'));
$canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchReview or $canBatchChangeStage or $canBatchChangeModule or $canBatchChangePlan or $canBatchAssignTo);
?>
diff --git a/module/project/control.php b/module/project/control.php
index 7672abbd4e..18b28157d9 100644
--- a/module/project/control.php
+++ b/module/project/control.php
@@ -696,6 +696,10 @@ class project extends control
$project = $this->commonAction($projectID);
$projectID = $project->id;
+ /* Determines whether an object is editable. */
+ $changeAllowed = true;
+ if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $changeAllowed = false;
+
/* Load pager. */
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
@@ -756,24 +760,25 @@ class project extends control
if($productPairs) $productID = key($productPairs);
/* Assign. */
- $this->view->title = $title;
- $this->view->position = $position;
- $this->view->productID = $productID;
- $this->view->project = $project;
- $this->view->stories = $stories;
- $this->view->allPlans = $allPlans;
- $this->view->summary = $this->product->summary($stories);
- $this->view->orderBy = $orderBy;
- $this->view->type = $this->session->projectStoryBrowseType;
- $this->view->param = $param;
- $this->view->moduleTree = $this->loadModel('tree')->getProjectStoryTreeMenu($projectID, $startModuleID = 0, array('treeModel', 'createProjectStoryLink'));
- $this->view->tabID = 'story';
- $this->view->storyTasks = $storyTasks;
- $this->view->storyBugs = $storyBugs;
- $this->view->storyCases = $storyCases;
- $this->view->users = $users;
- $this->view->pager = $pager;
- $this->view->branchGroups = $branchGroups;
+ $this->view->title = $title;
+ $this->view->position = $position;
+ $this->view->productID = $productID;
+ $this->view->project = $project;
+ $this->view->stories = $stories;
+ $this->view->allPlans = $allPlans;
+ $this->view->summary = $this->product->summary($stories);
+ $this->view->orderBy = $orderBy;
+ $this->view->type = $this->session->projectStoryBrowseType;
+ $this->view->param = $param;
+ $this->view->moduleTree = $this->loadModel('tree')->getProjectStoryTreeMenu($projectID, $startModuleID = 0, array('treeModel', 'createProjectStoryLink'));
+ $this->view->tabID = 'story';
+ $this->view->storyTasks = $storyTasks;
+ $this->view->storyBugs = $storyBugs;
+ $this->view->storyCases = $storyCases;
+ $this->view->users = $users;
+ $this->view->pager = $pager;
+ $this->view->branchGroups = $branchGroups;
+ $this->view->changeAllowed = $changeAllowed;
$this->display();
}
@@ -933,6 +938,10 @@ class project extends control
$project = $this->commonAction($projectID);
$projectID = $project->id;
+ /* Determines whether an object is editable. */
+ $changeAllowed = true;
+ if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $changeAllowed = false;
+
/* Load pager. */
$this->app->loadClass('pager', $static = true);
$pager = pager::init($recTotal, $recPerPage, $pageID);
@@ -942,17 +951,18 @@ class project extends control
$tasks = $this->testtask->getProjectTasks($projectID, $orderBy, $pager);
foreach($tasks as $key => $task) $productTasks[$task->product][] = $task;
- $this->view->title = $this->projects[$projectID] . $this->lang->colon . $this->lang->testtask->common;
- $this->view->position[] = html::a($this->createLink('project', 'testtask', "projectID=$projectID"), $this->projects[$projectID]);
- $this->view->position[] = $this->lang->testtask->common;
- $this->view->project = $project;
- $this->view->projectID = $projectID;
- $this->view->projectName = $this->projects[$projectID];
- $this->view->pager = $pager;
- $this->view->orderBy = $orderBy;
- $this->view->tasks = $productTasks;
- $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
- $this->view->products = $this->loadModel('product')->getPairs();
+ $this->view->title = $this->projects[$projectID] . $this->lang->colon . $this->lang->testtask->common;
+ $this->view->position[] = html::a($this->createLink('project', 'testtask', "projectID=$projectID"), $this->projects[$projectID]);
+ $this->view->position[] = $this->lang->testtask->common;
+ $this->view->project = $project;
+ $this->view->projectID = $projectID;
+ $this->view->projectName = $this->projects[$projectID];
+ $this->view->pager = $pager;
+ $this->view->orderBy = $orderBy;
+ $this->view->tasks = $productTasks;
+ $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
+ $this->view->products = $this->loadModel('product')->getPairs();
+ $this->view->changeAllowed = $changeAllowed;
$this->display();
}
diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php
index 40811dea4c..4807371c69 100644
--- a/module/project/view/story.html.php
+++ b/module/project/view/story.html.php
@@ -119,7 +119,7 @@
$canBatchUnlink = common::hasPriv('project', 'batchUnlinkStory');
$canBatchToTask = common::hasPriv('story', 'batchToTask');
- $canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchChangeStage or $canBatchUnlink or $canBatchToTask);
+ $canBatchAction = ($changeAllowed and ($canBatchEdit or $canBatchClose or $canBatchChangeStage or $canBatchUnlink or $canBatchToTask));
?>
id}&orderBy=%s&type=$type¶m=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
@@ -149,16 +149,13 @@
|
$story):?>
createLink('story', 'view', "storyID=$story->id&version=$story->version&from=project¶m=$project->id");
$totalEstimate += $story->estimate;
?>
|
- id => ''), '', $disabled) . html::a(helper::createLink('story', 'view', "storyID=$story->id"), sprintf('%03d', $story->id));?>
+ id => '')) . html::a(helper::createLink('story', 'view', "storyID=$story->id"), sprintf('%03d', $story->id));?>
id);?>
@@ -199,9 +196,9 @@
|
id}&story={$story->id}&moduleID={$story->module}";
$lang->task->create = $lang->project->wbs;
@@ -221,7 +218,7 @@
$lang->testcase->batchCreate = $lang->testcase->create;
if($productID && $hasDBPriv) common::printIcon('testcase', 'batchCreate', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", '', 'list', 'sitemap');
- if(common::hasPriv('project', 'unlinkStory', $project))
+ if($changeAllowed and common::hasPriv('project', 'unlinkStory', $project))
{
$unlinkURL = $this->createLink('project', 'unlinkStory', "projectID=$project->id&storyID=$story->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"storyList\", confirmUnlinkStory)", '', '', "class='btn' title='{$lang->project->unlinkStory}'");
@@ -310,7 +307,7 @@
|