view.html.php 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /**
  3. * The view view file of researchplan module of ZenTaoPMS.
  4. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
  5. * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  6. * @author Yidong Wang<yidong@chandao.net>
  7. * @package researchplan
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. $actions = !$plan->deleted ? $this->loadModel('common')->buildOperateMenu($plan) : array();
  12. $actions = zget($actions, 'suffixActions', array());
  13. /* 初始化主栏内容。Init sections in main column. */
  14. $sections = array();
  15. $sections[] = setting()
  16. ->title($lang->researchplan->outline)
  17. ->control('html')
  18. ->content(empty($plan->outline) ? $lang->noDesc : $plan->outline);
  19. $sections[] = setting()
  20. ->title($lang->researchplan->schedule)
  21. ->control('html')
  22. ->content(empty($plan->schedule) ? $lang->noDesc : $plan->schedule);
  23. $stakeholders = implode(' ', array_map(function($stakeholder) use ($users) { return zget($users, $stakeholder); }, explode(',', $plan->stakeholder)));
  24. $teamUser = '';
  25. foreach(explode(',', $plan->team) as $user) $teamUser .= zget($users, $user) . ' ';
  26. $basicInfo = array();
  27. $basicInfo[$lang->researchplan->customer] = $plan->customer;
  28. $basicInfo[$lang->researchplan->stakeholder] = implode(' ', array_map(function($stakeholder) use ($users) { return zget($users, $stakeholder); }, explode(',', $plan->stakeholder)));
  29. $basicInfo[$lang->researchplan->objective] = $plan->objective;
  30. $basicInfo[$lang->researchplan->location] = $plan->location;
  31. $basicInfo[$lang->researchplan->begin] = helper::isZeroDate($plan->begin) ? '' : $plan->begin;
  32. $basicInfo[$lang->researchplan->end] = helper::isZeroDate($plan->end) ? '' : $plan->end;
  33. $basicInfo[$lang->researchplan->team] = implode(' ', array_map(function($team) use ($users) { return zget($users, $team); }, explode(',', $plan->team)));
  34. $basicInfo[$lang->researchplan->method] = zget($lang->researchplan->methodList, $plan->method, '');
  35. $lifeTime = array();
  36. $lifeTime[$lang->researchplan->createdBy] = zget($users, $plan->createdBy);
  37. $lifeTime[$lang->researchplan->createdDate] = $plan->createdDate;
  38. $lifeTime[$lang->researchplan->editedBy] = zget($users, $plan->editedBy);
  39. $lifeTime[$lang->researchplan->editedDate] = $plan->editedDate;
  40. /* 初始化侧边栏标签页。Init sidebar tabs. */
  41. $tabs = array();
  42. /* 基本信息。Legend basic items. */
  43. $tabs[] = setting()
  44. ->group('basic')
  45. ->title($lang->researchplan->basicInfo)
  46. ->control('datalist')
  47. ->style(array('--datalist-label-width' => '80px'))
  48. ->items($basicInfo);
  49. /* 一生信息。Legend life items. */
  50. $tabs[] = setting()
  51. ->group('life')
  52. ->title($lang->researchplan->lifeTime)
  53. ->control('datalist')
  54. ->items($lifeTime);
  55. detail
  56. (
  57. set::object($plan),
  58. set::urlFormatter(array('{id}' => $plan->id)),
  59. set::sections($sections),
  60. set::tabs($tabs),
  61. set::actions(array_values($actions))
  62. );