| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- <?php
- /**
- * The dynamic view file of company 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 Mengyi Liu <liumengyi@easycorp.ltd>
- * @package company
- * @link https://www.zentao.net
- */
- namespace zin;
- jsVar('browseType', $browseType);
- /* zin: Define the feature bar on main menu. */
- featureBar
- (
- set::current($browseType),
- set::linkParams("browseType={key}¶m={$param}&recTotal=0&date=&direction=next&userID={$userID}&productID={$productID}&projectID={$projectID}&executionID={$executionID}&orderBy={$orderBy}"),
- set::labelCount($recTotal < \actionModel::MAXCOUNT ? $recTotal : (\actionModel::MAXCOUNT - 1) . '+'),
- li
- (
- setClass('w-28 ml-4'),
- picker
- (
- setID('user'),
- set::name('user'),
- set::placeholder($lang->user->common),
- set::items($userIdPairs),
- set::value($userID),
- on::change('changeItem')
- )
- ),
- $this->config->vision == 'rnd' ? li
- (
- setClass('w-28 ml-4'),
- picker
- (
- setID('product'),
- set::name('product'),
- set::placeholder($lang->product->common),
- set::items($products),
- set::value($productID),
- set::required(true),
- on::change('changeItem')
- )
- ) : null,
- li
- (
- setClass('w-28 ml-4'),
- picker
- (
- setID('project'),
- set::name('project'),
- set::placeholder($lang->project->common),
- set::items($projects),
- set::value($projectID),
- set::required(true),
- on::change('changeItem')
- )
- ),
- li
- (
- setClass('w-28 ml-4'),
- picker
- (
- setID('execution'),
- set::name('execution'),
- set::placeholder($lang->execution->common),
- set::items($executions),
- set::value($executionID),
- set::required(true),
- on::change('changeItem')
- )
- ),
- li(setClass('ml-4'), searchToggle(set::module('action'), set::open($browseType == 'bysearch')))
- );
- $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 = '';
- $lastAction = '';
- foreach($dateGroups as $date => $actions)
- {
- $lastAction = end($actions);
- $isToday = date(DT_DATE3) == $date;
- if(empty($firstAction)) $firstAction = reset($actions);
- $content[] = li
- (
- div
- (
- setClass('cursor-pointer leading-5'),
- span
- (
- icon('angle-down text-primary border-2 rounded-full z-10 bg-canvas align-middle')
- ),
- span
- (
- setClass('ml-2'),
- $isToday ? $lang->today : $date
- ),
- on::click('toggleCollapse')
- ),
- div
- (
- setClass('border-l border-l-1 mx-2 px-4 py-3'),
- div
- (
- setClass('flex-auto px-4 alert actions-box'),
- setClass($browseType == 'today' ? 'border-secondary' : ''),
- dynamic
- (
- set::dynamics($actions),
- set::users($accountPairs)
- )
- )
- )
- );
- }
- global $app;
- $hasMore = $app->control->loadModel('action')->hasMoreAction($lastAction);
- if($hasMore)
- {
- $content[] = li
- (
- a
- (
- setID('showMoreDynamic'),
- setClass('block text-center'),
- setData(array('lastid' => $lastAction->id)),
- set::href('###'),
- on::click('showMore'),
- icon('chevron-double-down')
- )
- );
- }
- $content = ul
- (
- setClass('timeline list-none p-0'),
- $content
- );
- }
- panel
- (
- setID('companyDynamic'),
- $content
- );
- if(!empty($firstAction))
- {
- $firstDate = date('Y-m-d', strtotime($firstAction->originalDate) + 24 * 3600);
- $lastDate = substr($lastAction->originalDate, 0, 10);
- $hasPre = $this->action->hasPreOrNext($firstDate, 'pre', $browseType);
- $hasNext = $this->action->hasPreOrNext($lastDate, 'next', $browseType);
- $preLink = $hasPre ? inlink('dynamic', "browseType={$browseType}¶m={$param}&recTotal=0&date=" . strtotime($firstDate) . "&direction=pre&userID={$userID}&productID={$productID}&projectID={$projectID}&executionID={$executionID}") : 'javascript:;';
- $nextLink = $hasNext ? inlink('dynamic', "browseType={$browseType}¶m={$param}&recTotal=0&date=" . strtotime($lastDate) . "&direction=next&userID={$userID}&productID={$productID}&projectID={$projectID}&executionID={$executionID}") : 'javascript:;';
- if($hasPre || $hasNext)
- {
- floatPreNextBtn
- (
- empty($hasNext) ? null : set::preLink($nextLink),
- empty($hasPre) ? null : set::nextLink($preLink)
- );
- }
- }
|