Merge branch '12.x' of github.com:easysoft/zentaopms into 12.x

This commit is contained in:
z
2020-11-16 09:00:56 +08:00
45 changed files with 364 additions and 136 deletions
+2 -1
View File
@@ -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;
+1
View File
@@ -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;
+18 -11
View File
@@ -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 '</td>';
+8 -7
View File
@@ -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);
?>
+5 -19
View File
@@ -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;
+2
View File
@@ -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("<th>", "<th style='word-break: break-word;'>", $doc->content);
$doc->content = str_replace("<td>", "<td style='word-break: break-word;'>", $doc->content);
$doc->digest = $hyperdown->makeHtml($doc->digest);
}
+1
View File
@@ -1658,6 +1658,7 @@ class docModel extends model
$doc->content = str_replace("<th>", "<th style='word-break: break-word; border:1px solid #000;'>", $doc->content);
$doc->content = str_replace("<td>", "<td style='word-break: break-word; border:1px solid #000;'>", $doc->content);
}
/* Get action info. */
$action = $this->loadModel('action')->getById($actionID);
$history = $this->action->getHistory($actionID);
+1 -1
View File
@@ -74,7 +74,7 @@ var browseType = '<?php echo $browseType;?>';
<p>
<?php if($libID):?>
<span class="text-muted"><?php echo $lang->doc->noDoc;?></span>
<?php if(common::hasPriv('doc', 'create')):?>
<?php if(common::hasPriv('doc', 'create') and common::checkObjectChangeAllowed('doc', $currentLib)):?>
<?php echo html::a($this->createLink('doc', 'create', "libID={$libID}&moduleID=$moduleID"), "<i class='icon icon-plus'></i> " . $lang->doc->create, '', "class='btn btn-info'");?>
<?php endif;?>
<?php elseif($browseType == 'byediteddate'):?>
+1 -1
View File
@@ -79,7 +79,7 @@
<td class="c-actions">
<?php
common::printLink('file', 'download', "fileID=$file->id", '<i class="icon-import"></i>', "data-toggle='modal'", "class='btn' title={$lang->doc->download}", true, false, $file);
common::printLink('file', 'delete', "fileID=$file->id", '<i class="icon-trash"></i>', 'hiddenwin', "class='btn' title={$lang->delete}", true, false, $file);
if($changeAllowed) common::printLink('file', 'delete', "fileID=$file->id", '<i class="icon-trash"></i>', 'hiddenwin', "class='btn' title={$lang->delete}", true, false, $file);
?>
</td>
</tr>
+1
View File
@@ -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");
+1
View File
@@ -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}
+1
View File
@@ -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}
+26
View File
@@ -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();
}
+4
View File
@@ -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';
+4
View File
@@ -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';
+4
View File
@@ -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';
+4
View File
@@ -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';
+4
View File
@@ -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'] = '构建部署';
+4
View File
@@ -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'] = '構建部署';
+39 -1
View File
@@ -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';
+13
View File
@@ -86,6 +86,19 @@
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->job->customParam;?></th>
<td colspan='2' id='paramDiv'>
<div class='table-row input-group'>
<span class='input-group-addon w-50px'><?php echo $lang->job->paramName; ?></span>
<?php echo html::input('paramName[]', '', "class='form-control id='test''"); ?>
<span class='input-group-addon w-40px'><?php echo $lang->job->paramValue; ?></span>
<?php echo html::input('paramValue[]', '', "class='form-control'"); ?>
<span class='input-group-addon w-40px'><a href='javascript:;' onclick='addItem(this);'><i class='icon icon-plus'></i></a></span>
<span class='input-group-addon w-40px'><a href='javascript:;' onclick='deleteItem(this)'><i class='icon icon-close'></i></a></span>
</div>
</td>
</tr>
<tr>
<th></th>
<td class='text-center form-actions'>
+15
View File
@@ -109,6 +109,21 @@
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->job->customParam;?></th>
<td colspan='2' id='paramDiv'>
<?php foreach(json_decode($job->customParam) as $paramName => $paramValue):?>
<div class='table-row input-group'>
<span class='input-group-addon w-50px'><?php echo $lang->job->paramName; ?></span>
<?php echo html::input('paramName[]', $paramName, "class='form-control'"); ?>
<span class='input-group-addon w-40px'><?php echo $lang->job->paramValue; ?></span>
<?php echo html::input('paramValue[]', $paramValue, "class='form-control'"); ?>
<span class='input-group-addon w-40px'><a href='javascript:;' onclick='addItem(this);'><i class='icon icon-plus'></i></a></span>
<span class='input-group-addon w-40px'><a href='javascript:;' onclick='deleteItem(this)'><i class='icon icon-close'></i></a></span>
</div>
<?php endforeach;?>
</td>
</tr>
<tr>
<th></th>
<td colspan="2" class='text-center form-actions'>
+8
View File
@@ -97,6 +97,14 @@
?>
</td>
</tr>
<tr>
<th><?php echo $lang->job->customParam;?></th>
<td>
<?php foreach(json_decode($job->customParam) as $paramName => $paramValue):?>
<div><?php echo $paramName . ' : ' . $paramValue;?></div>
<?php endforeach;?>
</td>
</tr>
</table>
</div>
</div>
+9 -8
View File
@@ -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);
?>
+39 -29
View File
@@ -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();
}
+10 -9
View File
@@ -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));
?>
<?php $vars = "projectID={$project->id}&orderBy=%s&type=$type&param=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
<th class='c-id {sorter:false}'>
@@ -149,16 +149,13 @@
<tbody id='storyTableList' class='sortable'>
<?php foreach($stories as $key => $story):?>
<?php
$changeAllowed = common::checkObjectChangeAllowed('story', $story);
$disabled = $changeAllowed ? '' : 'disabled';
$storyLink = $this->createLink('story', 'view', "storyID=$story->id&version=$story->version&from=project&param=$project->id");
$totalEstimate += $story->estimate;
?>
<tr id="story<?php echo $story->id;?>" data-id='<?php echo $story->id;?>' data-order='<?php echo $story->order ?>' data-estimate='<?php echo $story->estimate?>' data-cases='<?php echo zget($storyCases, $story->id, 0)?>'>
<td class='cell-id'>
<?php if($canBatchAction):?>
<?php echo html::checkbox('storyIdList', array($story->id => ''), '', $disabled) . html::a(helper::createLink('story', 'view', "storyID=$story->id"), sprintf('%03d', $story->id));?>
<?php echo html::checkbox('storyIdList', array($story->id => '')) . html::a(helper::createLink('story', 'view', "storyID=$story->id"), sprintf('%03d', $story->id));?>
<?php else:?>
<?php printf('%03d', $story->id);?>
<?php endif;?>
@@ -199,9 +196,9 @@
</td>
<td class='c-actions'>
<?php
$hasDBPriv = common::hasDBPriv($project, 'project');
if($changeAllowed)
{
$hasDBPriv = common::hasDBPriv($project, 'project');
$param = "projectID={$project->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)", '<i class="icon-unlink"></i>', '', "class='btn' title='{$lang->project->unlinkStory}'");
@@ -310,7 +307,7 @@
</div>
<div class="modal fade" id="batchToTask">
<div class="modal-dialog mw-500px">
<div class="modal-dialog mw-600px">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="icon icon-close"></i></button>
@@ -327,13 +324,17 @@
<?php if($lang->hourCommon !== $lang->workingHour):?>
<tr>
<th><?php echo $lang->story->oneUnit . $lang->hourCommon?></th>
<td class="col-main"><?php echo html::input('hourPointValue', '', "class='form-control' required");?></td>
<td><?php echo html::input('hourPointValue', '', "class='form-control' required");?></td>
<td><?php echo $lang->project->burnYUnit?></td>
</tr>
<?php endif;?>
<tr>
<td><?php echo html::hidden('storyIdList', '');?></td>
</tr>
<tr>
<th><?php echo $lang->story->field;?></th>
<td colspan='2'><?php echo html::select('field[]', $lang->story->convertToTask->fieldList, array_keys($lang->story->convertToTask->fieldList), "class='form-control chosen' multiple");?></td>
</tr>
<tr>
<td colspan='3' class='text-center'>
<?php echo html::submitButton($lang->story->toTask, '', 'btn btn-primary');?>
+2 -6
View File
@@ -49,7 +49,7 @@
<table class="table table-grouped has-sort-head" id='taskList'>
<thead>
<?php $vars = "projectID=$projectID&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<?php $canTestReport = common::hasPriv('testreport', 'browse');?>
<?php $canTestReport = ($changeAllowed and common::hasPriv('testreport', 'browse'));?>
<tr class='<?php if($total) echo 'divider'; ?>'>
<th class='c-side text-center'><?php common::printOrderLink('product', $orderBy, $vars, $lang->testtask->product);?></th>
<th class="c-id">
@@ -73,10 +73,6 @@
<?php foreach($tasks as $product => $productTasks):?>
<?php $productName = zget($products, $product, '');?>
<?php foreach($productTasks as $task):?>
<?php
$changeAllowed = common::checkObjectChangeAllowed('task', $task);
$disabled = $changeAllowed ? '' : 'disabled';
?>
<tr data-id='<?php echo $product;?>' <?php if($task == reset($productTasks)) echo "class='divider-top'";?>>
<?php if($task == reset($productTasks)):?>
<td rowspan='<?php echo count($productTasks);?>' class='c-side text-left group-toggle'>
@@ -86,7 +82,7 @@
<?php endif;?>
<td class="c-id">
<?php if($canTestReport):?>
<?php echo html::checkbox('taskIdList', array($task->id => sprintf('%03d', $task->id)), '', $disabled);?>
<?php echo html::checkbox('taskIdList', array($task->id => sprintf('%03d', $task->id)));?>
<?php else:?>
<?php printf('%03d', $task->id);?>
<?php endif;?>
+1 -1
View File
@@ -1077,7 +1077,7 @@ class story extends control
if(dao::isError()) die(js::error(dao::getError()) . js::locate('back'));
if(!dao::isError()) die(js::alert($this->lang->saveSuccess) . js::locate($this->createLink('project', 'story', "projectID=$projectID"), 'parent'));
if(!dao::isError()) die(js::alert($this->lang->saveSuccess) . js::locate($this->createLink('project', 'task', "projectID=$projectID"), 'parent'));
}
}
+10 -1
View File
@@ -63,7 +63,7 @@ $lang->story->batchToTask = 'Batch Convert to Task';
$lang->story->skipStory = '%s is a parent story. It cannot be closed.';
$lang->story->closedStory = 'Story %s is closed and will not be closed.';
$lang->story->batchToTaskTips = "This action will create a task with the same name as the selected {$lang->storyCommon} and link {$lang->storyCommon} to the task.";
$lang->story->batchToTaskTips = "This action will create a task with the same name as the selected {$lang->storyCommon} and link {$lang->storyCommon} to the task. The closed {$lang->storyCommon} will not be converted into tasks.";
$lang->story->common = 'Story';
$lang->story->id = 'ID';
@@ -126,6 +126,7 @@ $lang->story->unclosed = 'Nicht geschlossen';
$lang->story->deleted = 'Gelöscht';
$lang->story->released = 'Released Linked Stories';
$lang->story->oneUnit = 'One Unit';
$lang->story->field = 'Synchronized fields';
$lang->story->ditto = 'Dito';
$lang->story->dittoNotice = 'Die Story gehört nicht zum Projekt wie die vorherige!';
@@ -342,3 +343,11 @@ $lang->story->chosen->reviewedBy = 'Prüfer wählen';
$lang->story->notice = new stdClass();
$lang->story->notice->closed = 'Die ausgewählten Storys wurden bereits geschlossen!';
$lang->story->convertToTask = new stdClass();
$lang->story->convertToTask->fieldList = array();
$lang->story->convertToTask->fieldList['module'] = 'Module';
$lang->story->convertToTask->fieldList['spec'] = "Description";
$lang->story->convertToTask->fieldList['pri'] = 'Priority';
$lang->story->convertToTask->fieldList['mailto'] = 'Mailto';
$lang->story->convertToTask->fieldList['assignedTo'] = 'AssignTo';
+10 -1
View File
@@ -63,7 +63,7 @@ $lang->story->batchToTask = 'Batch Convert to Task';
$lang->story->skipStory = '%s is a parent story. It cannot be closed.';
$lang->story->closedStory = 'Story %s is closed and will not be closed.';
$lang->story->batchToTaskTips = "This action will create a task with the same name as the selected {$lang->storyCommon} and link {$lang->storyCommon} to the task.";
$lang->story->batchToTaskTips = "This action will create a task with the same name as the selected {$lang->storyCommon} and link {$lang->storyCommon} to the task. The closed {$lang->storyCommon} will not be converted into tasks.";
$lang->story->common = 'Story';
$lang->story->id = 'ID';
@@ -126,6 +126,7 @@ $lang->story->unclosed = 'Unclosed';
$lang->story->deleted = 'Deleted';
$lang->story->released = 'Released Stories';
$lang->story->oneUnit = 'One Unit';
$lang->story->field = 'Synchronized fields';
$lang->story->ditto = 'Ditto';
$lang->story->dittoNotice = 'This story is not linked to the same product as the last one is!';
@@ -342,3 +343,11 @@ $lang->story->chosen->reviewedBy = 'Choose ReviewedBy';
$lang->story->notice = new stdClass();
$lang->story->notice->closed = 'Story that you select is closed!';
$lang->story->convertToTask = new stdClass();
$lang->story->convertToTask->fieldList = array();
$lang->story->convertToTask->fieldList['module'] = 'Module';
$lang->story->convertToTask->fieldList['spec'] = "Description";
$lang->story->convertToTask->fieldList['pri'] = 'Priority';
$lang->story->convertToTask->fieldList['mailto'] = 'Mailto';
$lang->story->convertToTask->fieldList['assignedTo'] = 'AssignTo';
+10 -1
View File
@@ -63,7 +63,7 @@ $lang->story->batchToTask = 'Batch Convert to Task';
$lang->story->skipStory = '%s is a parent story. It cannot be closed.';
$lang->story->closedStory = 'Story %s is closed and will not be closed.';
$lang->story->batchToTaskTips = "This action will create a task with the same name as the selected {$lang->storyCommon} and link {$lang->storyCommon} to the task.";
$lang->story->batchToTaskTips = "This action will create a task with the same name as the selected {$lang->storyCommon} and link {$lang->storyCommon} to the task. The closed {$lang->storyCommon} will not be converted into tasks.";
$lang->story->common = 'Story';
$lang->story->id = 'ID';
@@ -126,6 +126,7 @@ $lang->story->unclosed = 'Non Fermées';
$lang->story->deleted = 'Supprimée';
$lang->story->released = 'Stories Versionnées';
$lang->story->oneUnit = 'One Unit';
$lang->story->field = 'Synchronized fields';
$lang->story->ditto = 'Idem';
$lang->story->dittoNotice = "La story n'est pas associée au même product que la précédente !";
@@ -342,3 +343,11 @@ $lang->story->chosen->reviewedBy = 'Choisir valideur';
$lang->story->notice = new stdClass();
$lang->story->notice->closed = 'La Story que vous avez sélectionnée est malheureusement fermée !';
$lang->story->convertToTask = new stdClass();
$lang->story->convertToTask->fieldList = array();
$lang->story->convertToTask->fieldList['module'] = 'Module';
$lang->story->convertToTask->fieldList['spec'] = "Description";
$lang->story->convertToTask->fieldList['pri'] = 'Priority';
$lang->story->convertToTask->fieldList['mailto'] = 'Mailto';
$lang->story->convertToTask->fieldList['assignedTo'] = 'AssignTo';
+10 -1
View File
@@ -63,7 +63,7 @@ $lang->story->batchToTask = 'Batch Convert to Task';
$lang->story->skipStory = '%s is a parent story. It cannot be closed.';
$lang->story->closedStory = 'Story %s is closed and will not be closed.';
$lang->story->batchToTaskTips = "This action will create a task with the same name as the selected {$lang->storyCommon} and link {$lang->storyCommon} to the task.";
$lang->story->batchToTaskTips = "This action will create a task with the same name as the selected {$lang->storyCommon} and link {$lang->storyCommon} to the task. The closed {$lang->storyCommon} will not be converted into tasks.";
$lang->story->common = 'Câu chuyện';
$lang->story->id = 'ID';
@@ -126,6 +126,7 @@ $lang->story->unclosed = 'Chưa đóng';
$lang->story->deleted = 'Đã xóa';
$lang->story->released = 'Đã phát hành';
$lang->story->oneUnit = 'One Unit';
$lang->story->field = 'Synchronized fields';
$lang->story->ditto = 'Như trên';
$lang->story->dittoNotice = 'Câu chuyện này chưa liên kết tới cùng sản phẩm bởi bởi vì nó là cuối cùng!';
@@ -342,3 +343,11 @@ $lang->story->chosen->reviewedBy = 'Chọn xét duyệt bởi';
$lang->story->notice = new stdClass();
$lang->story->notice->closed = 'Câu chuyện mà bạn chọn đã đóng!';
$lang->story->convertToTask = new stdClass();
$lang->story->convertToTask->fieldList = array();
$lang->story->convertToTask->fieldList['module'] = 'Module';
$lang->story->convertToTask->fieldList['spec'] = "Description";
$lang->story->convertToTask->fieldList['pri'] = 'Priority';
$lang->story->convertToTask->fieldList['mailto'] = 'Mailto';
$lang->story->convertToTask->fieldList['assignedTo'] = 'AssignTo';
+10 -1
View File
@@ -63,7 +63,7 @@ $lang->story->batchToTask = '批量转任务';
$lang->story->skipStory = '需求:%s 为父需求,将不会被关闭。';
$lang->story->closedStory = '需求:%s 已关闭,将不会被关闭。';
$lang->story->batchToTaskTips = "此操作会创建与所选{$lang->storyCommon}同名的任务,并将{$lang->storyCommon}关联到任务中";
$lang->story->batchToTaskTips = "此操作会创建与所选{$lang->storyCommon}同名的任务,并将{$lang->storyCommon}关联到任务中,已关闭的需求不会转为任务。";
$lang->story->common = $lang->storyCommon;
$lang->story->id = '编号';
@@ -126,6 +126,7 @@ $lang->story->unclosed = '未关闭';
$lang->story->deleted = '已删除';
$lang->story->released = "已发布{$lang->storyCommon}数";
$lang->story->oneUnit = '一个单位';
$lang->story->field = '同步的字段';
$lang->story->ditto = '同上';
$lang->story->dittoNotice = "该{$lang->storyCommon}与上一{$lang->storyCommon}不属于同一产品!";
@@ -342,3 +343,11 @@ $lang->story->chosen->reviewedBy = '选择评审人...';
$lang->story->notice = new stdClass();
$lang->story->notice->closed = "您选择的{$lang->storyCommon}已经被关闭了!";
$lang->story->convertToTask = new stdClass();
$lang->story->convertToTask->fieldList = array();
$lang->story->convertToTask->fieldList['module'] = '所属模块';
$lang->story->convertToTask->fieldList['spec'] = "{$lang->storyCommon}描述";
$lang->story->convertToTask->fieldList['pri'] = '优先级';
$lang->story->convertToTask->fieldList['mailto'] = '抄送给';
$lang->story->convertToTask->fieldList['assignedTo'] = '指派给';
+31 -12
View File
@@ -1421,9 +1421,10 @@ class storyModel extends model
*/
public function batchToTask($projectID)
{
/* load Module and get the data from the post. */
/* load Module and get the data from the post and get the current time. */
$this->loadModel('action');
$data = fixer::input('post')->get();
$now = helper::now();
/* Judge required. */
$message = '';
@@ -1432,19 +1433,32 @@ class storyModel extends model
if($message) die(js::error($message) . js::locate(helper::createLink('project', 'story', "projectID=$projectID"), 'parent'));
/* Create tasks. */
$stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($data->storyIdList)->fetchAll();
$stories = $this->getByList($data->storyIdList);
foreach($stories as $story)
{
if($story->status == 'closed') continue;
$task = new stdclass();
$task->project = $projectID;
$task->name = $story->title;
$task->module = $story->module;
$task->story = $story->id;
$task->type = $data->type;
$task->pri = $story->pri;
$task->estimate = isset($data->hourPointValue) ? ($story->estimate * $data->hourPointValue) : $story->estimate;
$task->openedBy = $this->app->user->account;
$task->openedDate = helper::now();
$task->openedDate = $now;
foreach($data->field as $field)
{
$task->$field = $story->$field;
if($field == 'assignedTo') $task->assignedDate = $now;
if($field == 'spec')
{
unset($task->$field);
$task->desc = $story->$field;
}
}
$this->dao->insert(TABLE_TASK)->data($task)
->autoCheck()
@@ -2345,19 +2359,21 @@ class storyModel extends model
/**
* Get story pairs of a user.
*
* @param string $account
* @param string $limit
* @param string $type requirement|story
* @param string $account
* @param string $limit
* @param string $type requirement|story
* @param array $skipProductIDList
* @access public
* @return array
*/
public function getUserStoryPairs($account, $limit = 10, $type = 'story')
public function getUserStoryPairs($account, $limit = 10, $type = 'story', $skipProductIDList = array())
{
return $this->dao->select('id, title')
->from(TABLE_STORY)
->where('deleted')->eq(0)
->andWhere('type')->eq($type)
->andWhere('assignedTo')->eq($account)
->beginIF(!empty($skipProductIDList))->andWhere('product')->notin($skipProductIDList)->fi()
->orderBy('id_desc')
->limit($limit)
->fetchPairs('id', 'title');
@@ -3091,8 +3107,7 @@ class storyModel extends model
case 'id':
if($canBatchAction)
{
$disabled = $changeAllowed ? '' : 'disabled';
echo html::checkbox('storyIdList', array($story->id => ''), '', $disabled) . html::a(helper::createLink('story', 'view', "storyID=$story->id"), sprintf('%03d', $story->id));
echo html::checkbox('storyIdList', array($story->id => ''), '') . html::a(helper::createLink('story', 'view', "storyID=$story->id"), sprintf('%03d', $story->id));
}
else
{
@@ -3213,9 +3228,9 @@ class storyModel extends model
echo $story->version;
break;
case 'actions':
$vars = "story={$story->id}";
if($changeAllowed)
{
$vars = "story={$story->id}";
common::printIcon('story', 'change', $vars, $story, 'list', 'fork');
common::printIcon('story', 'review', $vars, $story, 'list', 'glasses');
common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true);
@@ -3223,6 +3238,10 @@ class storyModel extends model
if($this->config->global->flow != 'onlyStory') common::printIcon('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=&param=0&$vars", $story, 'list', 'sitemap');
common::printIcon('story', 'batchCreate', "productID=$story->product&branch=$story->branch&module=0&storyID=$story->id", $story, 'list', 'treemap-alt', '', '', '', '', $this->lang->story->subdivide);
}
else
{
common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true);
}
break;
}
echo '</td>';
+3 -1
View File
@@ -1995,10 +1995,11 @@ class taskModel extends model
*
* @param string $account
* @param string $status
* @param array $skipProjectIDList
* @access public
* @return array
*/
public function getUserTaskPairs($account, $status = 'all')
public function getUserTaskPairs($account, $status = 'all', $skipProjectIDList = array())
{
$stmt = $this->dao->select('t1.id, t1.name, t2.name as project')
->from(TABLE_TASK)->alias('t1')
@@ -2006,6 +2007,7 @@ class taskModel extends model
->where('t1.assignedTo')->eq($account)
->andWhere('t1.deleted')->eq(0)
->beginIF($status != 'all')->andWhere('t1.status')->in($status)->fi()
->beginIF(!empty($skipProjectIDList))->andWhere('t1.project')->notin($skipProjectIDList)->fi()
->query();
$tasks = array();
-2
View File
@@ -136,13 +136,11 @@ function showAppointDate(switcher)
{
if(switcher.checked)
{
$('#date').attr('disabled','disabled');
$('#dayInput').attr('disabled','disabled');
$('.appoint').removeClass('hidden');
}
else
{
$('#date').removeAttr('disabled');
$('#dayInput').removeAttr('disabled');
$('.appoint').addClass('hidden');
}
+27 -4
View File
@@ -47,7 +47,7 @@ class todoModel extends model
if(empty($todo->cycle)) unset($todo->config);
if(!empty($todo->cycle))
{
if(isset($todo->config['appointDate'])) $todo->date = date('Y-m-d');
$todo->date = date('Y-m-d');
$todo->config['begin'] = $todo->date;
if($todo->config['type'] == 'day')
@@ -194,7 +194,7 @@ class todoModel extends model
if(!empty($oldTodo->cycle))
{
if(isset($todo->config['appointDate'])) $todo->date = date('Y-m-d');
$todo->date = date('Y-m-d');
$todo->config['begin'] = $todo->date;
if($todo->config['type'] == 'day')
@@ -570,16 +570,39 @@ class todoModel extends model
$day = (int)$todo->config->day;
if($day <= 0) continue;
if(empty($lastCycle)) $date = date('Y-m-d', strtotime("{$today} +" . $day . " days"));
if(!empty($lastCycle->date)) $date = date('Y-m-d', strtotime("{$lastCycle->date} +{$day} days"));
/* If no data, judge the interval from the begin time. */
if(empty($lastCycle))
{
$todayTime = new DateTime($today);
$beginTime = new DateTime($todo->config->begin);
$interval = $todayTime->diff($beginTime)->days;
if($interval != $day) continue;
$date = $today;
}
/* If have data, judge the interval from the last cycle time. */
if(!empty($lastCycle->date))
{
$todayTime = new DateTime($today);
$lastCycleTime = new DateTime($lastCycle->date);
$interval = $todayTime->diff($lastCycleTime)->days;
if($interval != $day) continue;
$date = date('Y-m-d', strtotime("{$lastCycle->date} +{$day} days"));
}
}
if(isset($todo->config->appointDate))
{
$date = $today;
$appointDate = $todo->config->appoint->month . '-' . $todo->config->appoint->day;
// If not set cycle every year and have data, continue.
if(!empty($lastCycle) and !isset($todo->config->cycleYear)) continue;
// If set appoint date, only judge month and day.
if(date('m-d', strtotime($date)) != $appointDate) continue;
}
}
+1 -1
View File
@@ -34,7 +34,7 @@
</span>
<span class='input-group-addon'>
<div class='checkbox-primary'>
<input type='checkbox' id='cycle' name='cycle' value='1' />
<input type='checkbox' id='cycle' name='cycle' value='1' onclick='switchDateTodo(this);' />
<label for='cycle'><?php echo $lang->todo->cycle;?></label>
</div>
</span>
+2
View File
@@ -63,6 +63,8 @@ $lang->user->unlock = "Entsperren";
$lang->user->delete = "Löschen";
$lang->user->unbind = "Zdoo verbindung aufheben";
$lang->user->login = "Anmelden";
$lang->user->bind = "Bind existing account";
$lang->user->oauthRegister = "Register a new account";
$lang->user->mobileLogin = "Mobil";
$lang->user->editProfile = "Bearbeiten";
$lang->user->deny = "Zugriff verweigert.";
+2
View File
@@ -63,6 +63,8 @@ $lang->user->unlock = "Unlock User";
$lang->user->delete = "Delete User";
$lang->user->unbind = "Unbind from Zdoo";
$lang->user->login = "Login";
$lang->user->bind = "Bind existing account";
$lang->user->oauthRegister = "Register a new account";
$lang->user->mobileLogin = "Mobile";
$lang->user->editProfile = "Edit Profile";
$lang->user->deny = "Your access is denied.";
+2
View File
@@ -63,6 +63,8 @@ $lang->user->unlock = "Débloquer Utilisateur";
$lang->user->delete = "Supprimer Utilisateur";
$lang->user->unbind = "Dissocier de Zdoo";
$lang->user->login = "Login";
$lang->user->bind = "Bind existing account";
$lang->user->oauthRegister = "Register a new account";
$lang->user->mobileLogin = "Mobile";
$lang->user->editProfile = "Editer Profil";
$lang->user->deny = "Your access is denied.";
+2
View File
@@ -63,6 +63,8 @@ $lang->user->unlock = "Mở khóa người dùng";
$lang->user->delete = "Xóa người dùng";
$lang->user->unbind = "Gỡ kết nối từ Zdoo";
$lang->user->login = "Đăng nhập";
$lang->user->bind = "Bind existing account";
$lang->user->oauthRegister = "Register a new account";
$lang->user->mobileLogin = "Di động";
$lang->user->editProfile = "Sửa hồ sơ";
$lang->user->deny = "Truy cập của bạn bị từ chối.";
-1
View File
@@ -198,7 +198,6 @@ $lang->user->contacts->common = '联系人';
$lang->user->contacts->listName = '列表名称';
$lang->user->contacts->userList = '用户列表';
$lang->user->contacts->manage = '维护列表';
$lang->user->contacts->contactsList = '已有列表';
$lang->user->contacts->selectedUsers = '选择用户';
+1 -1
View File
@@ -871,7 +871,7 @@ class userModel extends model
*
* @param object $user
* @access public
* @return void
* @return bool|object
*/
public function login($user)
{
+15 -15
View File
File diff suppressed because one or more lines are too long