| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- <?php
- /**
- * The annualworkload 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 Yuting Wang <wangyuting@easycorp.ltd>
- * @package block
- * @link https://www.zentao.net
- */
- namespace zin;
- $spanWidth = (strlen((string)($maxStoryEstimate)) * 0.425 + 0.125) . 'rem';
- $doneStoryEstimateRows = array();
- foreach($doneStoryEstimate as $productID => $storyEstimate)
- {
- $doneStoryEstimateRows[] = cell
- (
- setClass('flex py-1.5 pr-4 text-sm'),
- cell
- (
- setClass('ellipsis overflow-hidden whitespace-nowrap mr-1 text-right'),
- set::width('50%'),
- span
- (
- set::title(zget($products, $productID)),
- zget($products, $productID)
- )
- ),
- cell
- (
- set::width('50%'),
- setClass('flex items-center'),
- div
- (
- width("calc(calc(100% - {$spanWidth}) * " . ($maxStoryEstimate ? $storyEstimate / $maxStoryEstimate : 0) . ')'),
- setClass('progress progress-bar h-2'),
- set('role', 'progressbar'),
- setStyle(array('background' => 'var(--color-primary-300)'))
- ),
- span
- (
- setClass('pl-0.5'),
- $storyEstimate
- )
- )
- );
- }
- $spanWidth = (strlen((string)($maxStoryCount)) * 0.425 + 0.125) . 'rem';
- $doneStoryCountRows = array();
- foreach($doneStoryCount as $productID => $storyCount)
- {
- $doneStoryCountRows[] = cell
- (
- setClass('flex py-1.5 pr-4 text-sm'),
- cell
- (
- setClass('ellipsis overflow-hidden whitespace-nowrap mr-1 text-right'),
- set::width('50%'),
- span(zget($products, $productID))
- ),
- cell
- (
- set::width('50%'),
- setClass('flex items-center'),
- div
- (
- width("calc(calc(100% - {$spanWidth}) * " . ($maxStoryCount ? $storyCount / $maxStoryCount : 0) . ')'),
- setClass('progress progress-bar h-2'),
- set('role', 'progressbar'),
- setStyle(array('background' => 'var(--color-primary-300)'))
- ),
- span
- (
- setClass('pl-0.5'),
- $storyCount
- )
- )
- );
- }
- $spanWidth = (strlen((string)($maxBugCount)) * 0.425 + 0.125) . 'rem';
- $resolvedBugCountRows = array();
- foreach($resolvedBugCount as $productID => $bugCount)
- {
- $resolvedBugCountRows[] = cell
- (
- setClass('flex py-1.5 pr-4 text-sm'),
- cell
- (
- setClass('ellipsis overflow-hidden whitespace-nowrap mr-1 text-right'),
- set::width('50%'),
- span(zget($products, $productID))
- ),
- cell
- (
- set::width('50%'),
- setClass('flex items-center'),
- div
- (
- width("calc(calc(100% - {$spanWidth}) * " . ($maxBugCount ? $bugCount / $maxBugCount : 0) . ')'),
- setClass('progress progress-bar h-2'),
- set('role', 'progressbar'),
- setStyle(array('background' => 'var(--color-primary-300)'))
- ),
- span
- (
- setClass('pl-0.5'),
- $bugCount
- )
- )
- );
- }
- blockPanel
- (
- to::titleSuffix
- (
- icon
- (
- setClass('text-light text-sm cursor-pointer'),
- toggle::tooltip
- (
- array
- (
- 'title' => sprintf($lang->block->tooltips['metricTime'], $metricTime),
- 'placement' => 'bottom',
- 'type' => 'white',
- 'className' => 'text-dark border border-light leading-5'
- )
- ),
- 'help'
- )
- ),
- div
- (
- setClass('flex h-full w-full' . ($longBlock ? ' flex-nowrap' : ' flex-wrap')),
- cell
- (
- setClass('flex flex-wrap overflow-hidden px-4 ' . ($longBlock ? 'py-2' : 'py-1 w-full mb-2')),
- set::width($longBlock ? '1/3' : '100%'),
- cell
- (
- setClass('w-full font-bold'),
- icon('card-archive mr-1 mb-2'),
- span($lang->block->annualworkload->doneStoryEstimate)
- ),
- cell
- (
- setClass('w-full overflow-y-auto' . ($longBlock ? ' h-64' : ' h-48')),
- $doneStoryEstimateRows
- )
- ),
- cell
- (
- setClass('flex flex-wrap overflow-hidden px-4 ' . ($longBlock ? 'py-2' : 'py-3 w-full my-2 border-t')),
- set::width($longBlock ? '1/3' : '100%'),
- cell
- (
- setClass('w-full font-bold'),
- icon('sub-review mr-1 mb-2'),
- span($lang->block->annualworkload->doneStoryCount)
- ),
- cell
- (
- setClass('w-full overflow-y-auto' . ($longBlock ? ' h-64' : ' h-48')),
- $doneStoryCountRows
- )
- ),
- cell
- (
- setClass('flex flex-wrap overflow-hidden px-4 ' . ($longBlock ? 'py-2' : 'py-3 w-full my-2 border-t')),
- set::width($longBlock ? '1/3' : '100%'),
- cell
- (
- setClass('w-full font-bold'),
- icon('bug mr-1 mb-2'),
- span($lang->block->annualworkload->resolvedBugCount)
- ),
- cell
- (
- setClass('w-full overflow-y-auto' . ($longBlock ? ' h-64' : ' h-48')),
- $resolvedBugCountRows
- )
- )
- )
- );
- render();
|