+ Add new page for project dynamic.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
.date-block {max-height: 60px;}
|
||||
.date-block .btn-link {background-color: var(--nav-active-bg); width: 28px; height: 28px;}
|
||||
.date-block:after {content: ' '; display: block; position: relative; right: -1.6rem; top: 0px; height: 2px; width: 1rem; background-color: rgb(var(--color-gray-200-rgb));}
|
||||
.date-block.border-secondary:after {background-color: rgba(var(--color-secondary-500-rgb),var(--tw-border-opacity));}
|
||||
|
||||
.timeline .collapsed .icon {transform: rotate(270deg);}
|
||||
.timeline .collapsed .alert {display: none;}
|
||||
|
||||
.timeline > li + li:after {position: absolute; top: 90px; bottom: 20px; left: 40px; z-index: 1; display: block; content: ' '; border-left: 2px solid #eee;}
|
||||
@@ -0,0 +1,12 @@
|
||||
window.changeUser = function()
|
||||
{
|
||||
const picker = $('#user').zui('picker');
|
||||
const user = picker ? picker.$.value : '';
|
||||
const type = user ? 'account' : 'today';
|
||||
loadPage($.createLink('project', 'dynamic', `productID=${projectID}&type=${type}¶m=${user}`));
|
||||
}
|
||||
|
||||
window.toggleCollapse = function()
|
||||
{
|
||||
$(this).parent().toggleClass('collapsed');
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The dynamic view file of project 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 Yanyi Cao <caoyanyi@easycorp.ltd>
|
||||
* @package project
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
namespace zin;
|
||||
|
||||
jsVar('projectID', $projectID);
|
||||
/* zin: Define the feature bar on main menu. */
|
||||
featureBar
|
||||
(
|
||||
set::current($type),
|
||||
set::linkParams("projectID={$projectID}&type={key}"),
|
||||
li
|
||||
(
|
||||
setClass('w-40'),
|
||||
picker
|
||||
(
|
||||
setID('user'),
|
||||
set::name('user'),
|
||||
set::placeholder($lang->execution->viewByUser),
|
||||
set::items($userIdPairs),
|
||||
set::value($param),
|
||||
on::change('changeUser'),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$content = null;
|
||||
if(empty($dateGroups))
|
||||
{
|
||||
$content = div
|
||||
(
|
||||
setClass('flex items-center justify-center h-64'),
|
||||
span
|
||||
(
|
||||
setClass('text-gray'),
|
||||
$lang->action->noDynamic
|
||||
),
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$content = array();
|
||||
$firstAction = '';
|
||||
foreach($dateGroups as $date => $actions)
|
||||
{
|
||||
$isToday = date(DT_DATE4) == $date;
|
||||
$content[] = li
|
||||
(
|
||||
div
|
||||
(
|
||||
setClass('my-4 cursor-pointer'),
|
||||
icon('angle-down text-primary border-2 rounded-full toolbar z-10 bg-canvas'),
|
||||
span
|
||||
(
|
||||
setClass('article-h3 ml-2'),
|
||||
$isToday ? $lang->action->dynamic->today : $date,
|
||||
),
|
||||
on::click('toggleCollapse')
|
||||
),
|
||||
div
|
||||
(
|
||||
setClass('flex-auto mx-6 mt-2 px-4 alert lighter'),
|
||||
setClass($type == 'today' ? 'border-secondary' : ''),
|
||||
dynamic
|
||||
(
|
||||
set::dynamics($actions),
|
||||
set::users($accountPairs),
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$content = ul
|
||||
(
|
||||
setClass('timeline'),
|
||||
$content
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
panel($content);
|
||||
|
||||
if(!empty($firstAction))
|
||||
{
|
||||
$firstDate = date('Y-m-d', strtotime($firstAction->originalDate) + 24 * 3600);
|
||||
$lastDate = substr($action->originalDate, 0, 10);
|
||||
$hasPre = $this->action->hasPreOrNext($firstDate, 'pre');
|
||||
$hasNext = $this->action->hasPreOrNext($lastDate, 'next');
|
||||
$preLink = $hasPre ? inlink('dynamic', "projectID=$projectID&type=$type¶m=$param&recTotal={$pager->recTotal}&date=" . strtotime($firstDate) . '&direction=pre') : 'javascript:;';
|
||||
$nextLink = $hasNext ? inlink('dynamic', "projectID=$projectID&type=$type¶m=$param&recTotal={$pager->recTotal}&date=" . strtotime($lastDate) . '&direction=next') : 'javascript:;';
|
||||
|
||||
if($hasPre || $hasNext)
|
||||
{
|
||||
floatPreNextBtn
|
||||
(
|
||||
empty($hasPre) ? null : set::preLink($preLink),
|
||||
empty($hasNext) ? null : set::nextLink($nextLink)
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user