* Unify the count of assigntome block,
This commit is contained in:
@@ -11,6 +11,7 @@ ALTER TABLE `zt_block` MODIFY `vision` varchar(10) NOT NULL DEFAULT 'rnd' AFTER
|
||||
UPDATE `zt_block` SET `dashboard` = CONCAT(`module`, `type`);
|
||||
UPDATE `zt_block` SET `module` = IF(`source` != '', `source`, `code`);
|
||||
UPDATE `zt_block` SET `width` = IF(`grid` > 4, '2', '1');
|
||||
UPDATE `zt_block` SET `params` = '{"count":"20"}' WHERE `module` = 'assigntome' AND `code` = 'assigntome';
|
||||
DROP INDEX account_vision_module_type_order ON `zt_block`;
|
||||
|
||||
ALTER TABLE `zt_block` DROP COLUMN `source`;
|
||||
|
||||
+1
-43
@@ -187,49 +187,7 @@ $config->block->params['execution']->type['control'] = 'picker';
|
||||
$config->block->params['execution']->count = $config->block->params['default']->count;
|
||||
|
||||
$config->block->params['assigntome'] = new stdclass();
|
||||
$config->block->params['assigntome']->todoCount['name'] = $this->lang->block->todoCount;
|
||||
$config->block->params['assigntome']->todoCount['default'] = 20;
|
||||
$config->block->params['assigntome']->todoCount['control'] = 'input';
|
||||
$config->block->params['assigntome']->taskCount['name'] = $this->lang->block->taskCount;
|
||||
$config->block->params['assigntome']->taskCount['default'] = 20;
|
||||
$config->block->params['assigntome']->taskCount['control'] = 'input';
|
||||
$config->block->params['assigntome']->bugCount['name'] = $this->lang->block->bugCount;
|
||||
$config->block->params['assigntome']->bugCount['default'] = 20;
|
||||
$config->block->params['assigntome']->bugCount['control'] = 'input';
|
||||
if($config->edition == 'max')
|
||||
{
|
||||
if(helper::hasFeature('risk'))
|
||||
{
|
||||
$config->block->params['assigntome']->riskCount['name'] = $this->lang->block->riskCount;
|
||||
$config->block->params['assigntome']->riskCount['default'] = 20;
|
||||
$config->block->params['assigntome']->riskCount['control'] = 'input';
|
||||
}
|
||||
|
||||
if(helper::hasFeature('issue'))
|
||||
{
|
||||
$config->block->params['assigntome']->issueCount['name'] = $this->lang->block->issueCount;
|
||||
$config->block->params['assigntome']->issueCount['default'] = 20;
|
||||
$config->block->params['assigntome']->issueCount['control'] = 'input';
|
||||
}
|
||||
|
||||
if(helper::hasFeature('meeting'))
|
||||
{
|
||||
$config->block->params['assigntome']->meetingCount['name'] = $this->lang->block->meetingCount;
|
||||
$config->block->params['assigntome']->meetingCount['default'] = 20;
|
||||
$config->block->params['assigntome']->meetingCount['control'] = 'input';
|
||||
}
|
||||
|
||||
$config->block->params['assigntome']->feedbackCount['name'] = $this->lang->block->feedbackCount;
|
||||
$config->block->params['assigntome']->feedbackCount['default'] = 20;
|
||||
$config->block->params['assigntome']->feedbackCount['control'] = 'input';
|
||||
}
|
||||
|
||||
$config->block->params['assigntome']->storyCount['name'] = $this->lang->block->storyCount;
|
||||
$config->block->params['assigntome']->storyCount['default'] = 20;
|
||||
$config->block->params['assigntome']->storyCount['control'] = 'input';
|
||||
$config->block->params['assigntome']->reviewCount['name'] = $this->lang->block->reviewCount;
|
||||
$config->block->params['assigntome']->reviewCount['default'] = 20;
|
||||
$config->block->params['assigntome']->reviewCount['control'] = 'input';
|
||||
$config->block->params['assigntome']->count = $config->block->params['default']->count;
|
||||
|
||||
$config->block->params['scrumtest'] = new stdclass();
|
||||
$config->block->params['scrumtest']->type['name'] = $lang->block->type;
|
||||
|
||||
@@ -25,7 +25,7 @@ $blockSize = !empty($config->block->size[$module][$code]) ? $config->block->si
|
||||
/* 根据区块的可选尺寸生成区块的可选宽度列表。 */
|
||||
$widthOptions = array();
|
||||
foreach(array_keys($blockSize) as $width) $widthOptions[$width] = zget($this->lang->block->widthOptions, $width);
|
||||
$defaultWidth = reset(array_keys($blockSize));
|
||||
$defaultWidth = reset($widthOptions);
|
||||
row
|
||||
(
|
||||
set::id('blockCreateForm'),
|
||||
|
||||
+16
-34
@@ -1984,16 +1984,17 @@ class blockZen extends block
|
||||
*/
|
||||
protected function printAssignToMeBlock(object $block): void
|
||||
{
|
||||
$hasIssue = helper::hasFeature('issue');
|
||||
$hasRisk = helper::hasFeature('risk');
|
||||
$hasMeeting = helper::hasFeature('meeting');
|
||||
|
||||
$hasIssue = helper::hasFeature('issue');
|
||||
$hasRisk = helper::hasFeature('risk');
|
||||
$hasMeeting = helper::hasFeature('meeting');
|
||||
$hasViewPriv = array();
|
||||
if(common::hasPriv('todo', 'view')) $hasViewPriv['todo'] = true;
|
||||
|
||||
$limitCount = !empty($params->reviewCount) ? $params->reviewCount : 20;
|
||||
$count = array();
|
||||
$params = $block->params;
|
||||
$limitCount = zget($params, 'count', $this->config->block->params['assigntome']->count['default']);
|
||||
|
||||
$this->app->loadClass('pager', true);
|
||||
$pager = new pager(0, $limitCount, 1);
|
||||
$pager = new pager(0, $limitCount, 1);
|
||||
$reviews = $this->loadModel('my')->getReviewingList('all', 'time_desc', $pager);
|
||||
if($reviews)
|
||||
{
|
||||
@@ -2007,6 +2008,7 @@ class blockZen extends block
|
||||
}
|
||||
}
|
||||
|
||||
if(common::hasPriv('todo', 'view')) $hasViewPriv['todo'] = true;
|
||||
if(common::hasPriv('task', 'view')) $hasViewPriv['task'] = true;
|
||||
if(common::hasPriv('story', 'view') && $this->config->vision != 'lite') $hasViewPriv['story'] = true;
|
||||
if($this->config->URAndSR && common::hasPriv('story', 'view') && $this->config->vision != 'lite') $hasViewPriv['requirement'] = true;
|
||||
@@ -2019,42 +2021,23 @@ class blockZen extends block
|
||||
if(common::hasPriv('feedback', 'view') && in_array($this->config->edition, array('max', 'biz'))) $hasViewPriv['feedback'] = true;
|
||||
if(common::hasPriv('ticket', 'view') && in_array($this->config->edition, array('max', 'biz'))) $hasViewPriv['ticket'] = true;
|
||||
|
||||
$params = $block->params;
|
||||
$count = array();
|
||||
$objectList = array('todo' => 'todos', 'task' => 'tasks', 'bug' => 'bugs', 'story' => 'stories', 'requirement' => 'requirements');
|
||||
$objectCountList = array('todo' => 'todoCount', 'task' => 'taskCount', 'bug' => 'bugCount', 'story' => 'storyCount', 'requirement' => 'requirementCount');
|
||||
$objectList = array('todo' => 'todos', 'task' => 'tasks', 'bug' => 'bugs', 'story' => 'stories', 'requirement' => 'requirements');
|
||||
if($this->config->edition == 'max')
|
||||
{
|
||||
if($hasRisk)
|
||||
{
|
||||
$objectList += array('risk' => 'risks');
|
||||
$objectCountList += array('risk' => 'riskCount');
|
||||
}
|
||||
|
||||
if($hasIssue)
|
||||
{
|
||||
$objectList += array('issue' => 'issues');
|
||||
$objectCountList += array('issue' => 'issueCount');
|
||||
}
|
||||
|
||||
$objectList += array('feedback' => 'feedbacks', 'ticket' => 'tickets');
|
||||
$objectCountList += array('feedback' => 'feedbackCount', 'ticket' => 'ticketCount');
|
||||
if($hasRisk) $objectList += array('risk' => 'risks');
|
||||
if($hasIssue) $objectList += array('issue' => 'issues');
|
||||
$objectList += array('feedback' => 'feedbacks', 'ticket' => 'tickets');
|
||||
}
|
||||
|
||||
if($this->config->edition == 'biz')
|
||||
{
|
||||
$objectList += array('feedback' => 'feedbacks', 'ticket' => 'tickets');
|
||||
$objectCountList += array('feedback' => 'feedbackCount', 'ticket' => 'ticketCount');
|
||||
}
|
||||
if($this->config->edition == 'biz') $objectList += array('feedback' => 'feedbacks', 'ticket' => 'tickets');
|
||||
|
||||
$tasks = $this->loadModel('task')->getUserSuspendedTasks($this->app->user->account);
|
||||
foreach($objectCountList as $objectType => $objectCount)
|
||||
foreach(array_keys($objectList) as $objectType)
|
||||
{
|
||||
if(!isset($hasViewPriv[$objectType])) continue;
|
||||
|
||||
$table = $objectType == 'requirement' ? TABLE_STORY : $this->config->objectTables[$objectType];
|
||||
$orderBy = $objectType == 'todo' ? '`date` desc' : 'id_desc';
|
||||
$limitCount = isset($params->{$objectCount}) ? $params->{$objectCount} : 0;
|
||||
$objects = $this->dao->select('t1.*')->from($table)->alias('t1')
|
||||
->beginIF($objectType == 'story' || $objectType == 'requirement')->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')->fi()
|
||||
->beginIF($objectType == 'bug')->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')->fi()
|
||||
@@ -2135,7 +2118,6 @@ class blockZen extends block
|
||||
$this->app->loadLang('meeting');
|
||||
$today = helper::today();
|
||||
$now = date('H:i:s', strtotime(helper::now()));
|
||||
$meetingCount = isset($params->meetingCount) ? isset($params->meetingCount) : 0;
|
||||
|
||||
$meetings = $this->dao->select('*')->from(TABLE_MEETING)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
|
||||
@@ -2149,7 +2131,7 @@ class blockZen extends block
|
||||
->orWhere('t1.participant')->in($this->app->user->account)
|
||||
->markRight(1)
|
||||
->orderBy('t1.id_desc')
|
||||
->beginIF($meetingCount)->limit($meetingCount)->fi()
|
||||
->beginIF($limitCount)->limit($limitCount)->fi()
|
||||
->fetchAll();
|
||||
|
||||
$count['meeting'] = count($meetings);
|
||||
|
||||
Reference in New Issue
Block a user