Merge branch 'master' of https://git.zcorp.cc/easycorp/zentaopms
This commit is contained in:
@@ -33,3 +33,4 @@ CodeSniffer.conf
|
||||
test/runtime/*
|
||||
test/www
|
||||
!/**/.gitkeep
|
||||
.scannerwork
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
global $lang, $app;
|
||||
$app->loadLang('project');
|
||||
$app->loadLang('task');
|
||||
$config->block->dtable = new stdclass();
|
||||
$config->block->dtable->project = new stdclass();
|
||||
$config->block->dtable->project->fieldList['name']['name'] = 'name';
|
||||
$config->block->dtable->project->fieldList['name']['title'] = $lang->project->name;
|
||||
$config->block->dtable->project->fieldList['name']['flex'] = 1;
|
||||
$config->block->dtable->project->fieldList['name']['align'] = 'center';
|
||||
$config->block->dtable->project->fieldList['name']['type'] = 'link';
|
||||
$config->block->dtable->project->fieldList['name']['sortType'] = true;
|
||||
|
||||
$config->block->dtable->project->fieldList['PM']['name'] = 'PM';
|
||||
$config->block->dtable->project->fieldList['PM']['title'] = $lang->project->PM;
|
||||
$config->block->dtable->project->fieldList['PM']['width'] = 80;
|
||||
$config->block->dtable->project->fieldList['PM']['align'] = 'center';
|
||||
$config->block->dtable->project->fieldList['PM']['sortType'] = true;
|
||||
|
||||
$config->block->dtable->project->fieldList['status']['name'] = 'status';
|
||||
$config->block->dtable->project->fieldList['status']['title'] = $lang->project->status;
|
||||
$config->block->dtable->project->fieldList['status']['width'] = 80;
|
||||
$config->block->dtable->project->fieldList['status']['align'] = 'center';
|
||||
$config->block->dtable->project->fieldList['status']['sortType'] = true;
|
||||
|
||||
$config->block->dtable->project->fieldList['teamCount']['name'] = 'teamCount';
|
||||
$config->block->dtable->project->fieldList['teamCount']['title'] = $lang->project->teamCount;
|
||||
$config->block->dtable->project->fieldList['teamCount']['width'] = 80;
|
||||
$config->block->dtable->project->fieldList['teamCount']['align'] = 'center';
|
||||
$config->block->dtable->project->fieldList['teamCount']['sortType'] = true;
|
||||
|
||||
$config->block->dtable->project->fieldList['consumed']['name'] = 'consumed';
|
||||
$config->block->dtable->project->fieldList['consumed']['title'] = $lang->task->consumed;
|
||||
$config->block->dtable->project->fieldList['consumed']['width'] = 80;
|
||||
$config->block->dtable->project->fieldList['consumed']['align'] = 'center';
|
||||
$config->block->dtable->project->fieldList['consumed']['sortType'] = true;
|
||||
|
||||
$config->block->dtable->project->fieldList['budget']['name'] = 'budget';
|
||||
$config->block->dtable->project->fieldList['budget']['title'] = $lang->project->budget;
|
||||
$config->block->dtable->project->fieldList['budget']['width'] = 80;
|
||||
$config->block->dtable->project->fieldList['budget']['align'] = 'center';
|
||||
$config->block->dtable->project->fieldList['budget']['sortType'] = true;
|
||||
|
||||
$config->block->dtable->project->fieldList['leftStories']['name'] = 'leftStories';
|
||||
$config->block->dtable->project->fieldList['leftStories']['title'] = $lang->project->leftStories;
|
||||
$config->block->dtable->project->fieldList['leftStories']['width'] = 80;
|
||||
$config->block->dtable->project->fieldList['leftStories']['align'] = 'center';
|
||||
$config->block->dtable->project->fieldList['leftStories']['sortType'] = true;
|
||||
|
||||
$config->block->dtable->project->fieldList['leftTasks']['name'] = 'leftTasks';
|
||||
$config->block->dtable->project->fieldList['leftTasks']['title'] = $lang->project->leftTasks;
|
||||
$config->block->dtable->project->fieldList['leftTasks']['width'] = 80;
|
||||
$config->block->dtable->project->fieldList['leftTasks']['align'] = 'center';
|
||||
$config->block->dtable->project->fieldList['leftTasks']['sortType'] = true;
|
||||
|
||||
$config->block->dtable->project->fieldList['leftBugs']['name'] = 'leftBugs';
|
||||
$config->block->dtable->project->fieldList['leftBugs']['title'] = $lang->project->leftBugs;
|
||||
$config->block->dtable->project->fieldList['leftBugs']['width'] = 80;
|
||||
$config->block->dtable->project->fieldList['leftBugs']['align'] = 'center';
|
||||
$config->block->dtable->project->fieldList['leftBugs']['sortType'] = true;
|
||||
+16
-15
@@ -280,16 +280,6 @@ class block extends control
|
||||
$html = "<div class='panel-body'><div class='article-content'>" . $block->params->html . '</div></div>';
|
||||
}
|
||||
}
|
||||
elseif($block->source != '')
|
||||
{
|
||||
$this->get->set('mode', 'getblockdata');
|
||||
$this->get->set('blockTitle', $block->title);
|
||||
$this->get->set('module', $block->module);
|
||||
$this->get->set('source', $block->source);
|
||||
$this->get->set('blockid', $block->code);
|
||||
$this->get->set('param', base64_encode(json_encode($block->params)));
|
||||
$html = $this->fetch('block', 'main', "module={$block->source}&id=$id");
|
||||
}
|
||||
elseif($block->code == 'dynamic')
|
||||
{
|
||||
$html = $this->fetch('block', 'dynamic');
|
||||
@@ -311,6 +301,16 @@ class block extends control
|
||||
{
|
||||
$html = $this->fetch('block', 'contribute');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->get->set('mode', 'getblockdata');
|
||||
$this->get->set('blockTitle', $block->title);
|
||||
$this->get->set('module', $block->module);
|
||||
$this->get->set('source', $block->source);
|
||||
$this->get->set('blockid', $block->code);
|
||||
$this->get->set('param', base64_encode(json_encode($block->params)));
|
||||
$html = $this->fetch('block', 'main', "module={$block->source}&id=$id");
|
||||
}
|
||||
echo $html;
|
||||
}
|
||||
|
||||
@@ -320,8 +320,9 @@ class block extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function main($module = '', $id = 0)
|
||||
public function main($module = '', $blockID = 0)
|
||||
{
|
||||
$blockID = (int)$blockID;
|
||||
if(!$this->selfCall)
|
||||
{
|
||||
$lang = str_replace('_', '-', $this->get->lang);
|
||||
@@ -367,10 +368,10 @@ class block extends control
|
||||
$this->view->sign = strpos($sso, '?') === false ? '?' : '&';
|
||||
}
|
||||
|
||||
if($id) $block = $this->block->getByID($id);
|
||||
$this->view->longBlock = $this->block->isLongBlock($id ? $block : $params);
|
||||
if($blockID) $block = $this->block->getByID($blockID);
|
||||
$this->view->longBlock = $this->block->isLongBlock($blockID ? $block : $params);
|
||||
$this->view->selfCall = $this->selfCall;
|
||||
$this->view->block = $id ? $block : '';
|
||||
$this->view->block = $blockID ? $block : '';
|
||||
|
||||
$this->viewType = (isset($params->viewType) and $params->viewType == 'json') ? 'json' : 'html';
|
||||
$this->params = $params;
|
||||
@@ -409,7 +410,7 @@ class block extends control
|
||||
return print(json_encode($output));
|
||||
}
|
||||
|
||||
$this->display();
|
||||
$this->display('block', $code . 'block');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The project block view file of block module of ZenTaoPMS.
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Wangyuting <wangyuting@easycorp.ltd>
|
||||
* @package block
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
|
||||
namespace zin;
|
||||
|
||||
$isChinese = in_array($this->app->getClientLang(), array('zh-cn','zh-tw'));
|
||||
|
||||
foreach($projects as $project)
|
||||
{
|
||||
$programBudget = $isChinese ? round((float)$project->budget / 10000, 2) . $this->lang->project->tenThousand : round((float)$project->budget, 2);
|
||||
|
||||
$project->PM = zget($users, $project->PM, $project->PM);
|
||||
$project->status = zget($lang->project->statusList, $project->status);
|
||||
$project->consumed .=$lang->execution->workHourUnit;
|
||||
$project->budget = $project->budget != 0 ? zget($lang->project->currencySymbol, $project->budgetUnit) . ' ' . $programBudget : $lang->project->future;
|
||||
}
|
||||
|
||||
dtable
|
||||
(
|
||||
set::width('100%'),
|
||||
set::height('auto'),
|
||||
set::cols(array_values($config->block->dtable->project->fieldList)),
|
||||
set::data(array_values($projects)),
|
||||
set::footPager(usePager()),
|
||||
set::footer(array('flex', 'pager'))
|
||||
);
|
||||
|
||||
|
||||
render();
|
||||
Reference in New Issue
Block a user