diff --git a/module/block/config/productstoryblock.php b/module/block/config/productstoryblock.php new file mode 100644 index 0000000000..be5a82156e --- /dev/null +++ b/module/block/config/productstoryblock.php @@ -0,0 +1,38 @@ +loadLang('story'); +if(!isset($config->block->dtable->stories)) $config->block->dtable->stories = new stdclass(); +$config->block->dtable->stories->fieldList['id']['name'] = 'id'; +$config->block->dtable->stories->fieldList['id']['title'] = $this->lang->story->id; +$config->block->dtable->stories->fieldList['id']['width'] = 80; +$config->block->dtable->stories->fieldList['id']['align'] = 'center'; +$config->block->dtable->stories->fieldList['id']['sortType'] = true; + +$config->block->dtable->stories->fieldList['title']['name'] = 'title'; +$config->block->dtable->stories->fieldList['title']['title'] = $this->lang->story->title; +$config->block->dtable->stories->fieldList['title']['width'] = 80; +$config->block->dtable->stories->fieldList['title']['align'] = 'center'; +$config->block->dtable->stories->fieldList['title']['sortType'] = true; + +$config->block->dtable->stories->fieldList['pri']['name'] = 'pri'; +$config->block->dtable->stories->fieldList['pri']['title'] = $this->lang->story->pri; +$config->block->dtable->stories->fieldList['pri']['width'] = 80; +$config->block->dtable->stories->fieldList['pri']['align'] = 'center'; +$config->block->dtable->stories->fieldList['pri']['sortType'] = true; + +$config->block->dtable->stories->fieldList['status']['name'] = 'status'; +$config->block->dtable->stories->fieldList['status']['title'] = $this->lang->story->statusAB; +$config->block->dtable->stories->fieldList['status']['width'] = 80; +$config->block->dtable->stories->fieldList['status']['align'] = 'center'; +$config->block->dtable->stories->fieldList['status']['sortType'] = true; + +$config->block->dtable->stories->fieldList['estimate']['name'] = 'estimate'; +$config->block->dtable->stories->fieldList['estimate']['title'] = $this->lang->story->estimateAB; +$config->block->dtable->stories->fieldList['estimate']['width'] = 80; +$config->block->dtable->stories->fieldList['estimate']['align'] = 'center'; +$config->block->dtable->stories->fieldList['estimate']['sortType'] = true; + +$config->block->dtable->stories->fieldList['stage']['name'] = 'stage'; +$config->block->dtable->stories->fieldList['stage']['title'] = $this->lang->story->stageAB; +$config->block->dtable->stories->fieldList['stage']['width'] = 80; +$config->block->dtable->stories->fieldList['stage']['align'] = 'center'; +$config->block->dtable->stories->fieldList['stage']['sortType'] = true; diff --git a/module/block/ui/storyblock.html.php b/module/block/ui/storyblock.html.php index 5df1ed0505..22a79e2bc1 100644 --- a/module/block/ui/storyblock.html.php +++ b/module/block/ui/storyblock.html.php @@ -11,14 +11,20 @@ declare(strict_types=1); namespace zin; +foreach($stories as $story) +{ + $story->status = zget($this->lang->story->statusList, $story->status); + $story->stage = zget($this->lang->story->stageList, $story->stage); +} + panel ( dtable ( set::width('100%'), set::height('auto'), - set::cols(array_values($config->block->dtable->project->fieldList)), - set::data(array_values($projects)) + set::cols(array_values($config->block->dtable->stories->fieldList)), + set::data(array_values($stories)) ) ); diff --git a/module/block/zen.php b/module/block/zen.php index b6bfa49313..d023630e4a 100644 --- a/module/block/zen.php +++ b/module/block/zen.php @@ -521,19 +521,20 @@ class blockZen extends block /** * Print story block. * + * @params object $block * @access protected * @return void */ - protected function printStoryBlock() + protected function printStoryBlock($block) :void { $this->session->set('storyList', $this->createLink('my', 'index'), 'product'); - if(preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) return; + if(preg_match('/[^a-zA-Z0-9_]/', $block->params->type)) return; $this->app->loadClass('pager', true); - $count = isset($this->params->count) ? (int)$this->params->count : 0; + $count = isset($block->params->count) ? (int)$block->params->count : 0; $pager = pager::init(0, $count , 1); - $type = isset($this->params->type) ? $this->params->type : 'assignedTo'; - $orderBy = isset($this->params->type) ? $this->params->orderBy : 'id_asc'; + $type = isset($block->params->type) ? $block->params->type : 'assignedTo'; + $orderBy = isset($block->params->type) ? $block->params->orderBy : 'id_asc'; $this->view->stories = $this->loadModel('story')->getUserStories($this->app->user->account, $type, $orderBy, $this->viewType != 'json' ? $pager : '', 'story'); } @@ -753,7 +754,7 @@ class blockZen extends block $progress = 0; if(isset($tasks[$projectID]) && ($tasks[$projectID]->totalConsumed + $tasks[$projectID]->totalLeft)) { - $progress = round($tasks[$projectID]->totalConsumed / ($tasks[$projectID]->totalConsumed + $tasks[$projectID]->totalLeft), 3) * 100; + $progress = round($tasks[$projectID]->totalConsumed / ($tasks[$projectID]->totalConsumed + $tasks[$projectID]->totalLeft), 3) * 100; } $project->current = $current;