index.html.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * The index file of durationestimation module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
  6. * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author Yuting Wang<wangyuting@easycorp.ltd>
  8. * @package durationestimation
  9. * @link https://www.zentao.net
  10. */
  11. namespace zin;
  12. foreach($stages as $stage)
  13. {
  14. $estimation = zget($estimationList, $stage->id, array());
  15. $stage->workload = zget($estimation, 'workload', '') . '%';
  16. $stage->worktimeRate = zget($estimation, 'worktimeRate', '') . '%';
  17. $stage->people = zget($estimation, 'people', '');
  18. $stage->startDate = zget($estimation, 'startDate', '');
  19. $stage->endDate = zget($estimation, 'endDate', '');
  20. }
  21. $cols = array();
  22. $cols['name'] = array('title' => $lang->durationestimation->stage, 'name' => 'name', 'type' => 'category', 'group' => 1);
  23. $cols['workload'] = array('title' => $lang->durationestimation->workload, 'name' => 'workload', 'type' => 'category', 'group' => 1);
  24. $cols['worktimeRate'] = array('title' => $lang->durationestimation->worktimeRate, 'name' => 'worktimeRate', 'type' => 'category', 'group' => 1);
  25. $cols['people'] = array('title' => $lang->durationestimation->people, 'name' => 'people', 'type' => 'category', 'group' => 1);
  26. $cols['startDate'] = array('title' => $lang->durationestimation->startDate, 'name' => 'startDate', 'type' => 'category', 'group' => 1);
  27. $cols['endDate'] = array('title' => $lang->durationestimation->endDate, 'name' => 'endDate', 'type' => 'category', 'group' => 1);
  28. common::canModify('project', $project) && common::hasPriv('durationestimation', 'create') ? toolbar
  29. (
  30. setClass('w-full flex justify-end'),
  31. item(set(array('text' => $lang->durationestimation->setting, 'url' => inlink('create', "projectID={$project->id}"), 'class' => 'btn primary', 'icon' => 'backend')))
  32. ) : null;
  33. dtable
  34. (
  35. set::cols($cols),
  36. set::data(array_values($stages))
  37. );