view.html.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * The view file of projectchange 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 projectchange
  9. * @link https://www.zentao.net
  10. */
  11. namespace zin;
  12. $operateList = $this->loadModel('common')->buildOperateMenu($projectchange);
  13. $actions = $operateList['mainActions'];
  14. if(!empty($operateList['suffixActions'])) $actions = array_merge($actions, $actions ? array(array('type' => 'divider')) : array(), $operateList['suffixActions']);
  15. /* 初始化主栏内容。Init sections in main column. */
  16. $sections = array();
  17. $sections[] = setting()->title($lang->projectchange->deliverable)->control(array('control' => 'dtable', 'cols' => array_values($config->projectchange->deliverable->dtable->fieldList), 'data' => array_values($deliverables), 'userMap' => $users));
  18. $sections[] = setting()->title($lang->projectchange->reason)->control('html')->content($projectchange->reason);
  19. $sections[] = setting()->title($lang->projectchange->desc)->control('html')->content($projectchange->desc);
  20. if(!empty($projectchange->files)) $sections[] = setting()->control('fileList')->files($projectchange->files)->object($projectchange)->padding(false);
  21. $items = array();
  22. $items[$lang->projectchange->urgency] = zget($lang->projectchange->urgencyList, $projectchange->urgency, $projectchange->urgency);
  23. $items[$lang->projectchange->type] = zget($lang->projectchange->typeList, $projectchange->type, $projectchange->type);
  24. $items[$lang->projectchange->owner] = zget($users, $projectchange->owner, '');
  25. $items[$lang->projectchange->status] = zget($lang->projectchange->statusList, $projectchange->status, '');
  26. $items[$lang->projectchange->deadline] = substr($projectchange->deadline, 0, 10);
  27. $items[$lang->projectchange->createdBy] = zget($users, $projectchange->createdBy) . (formatTime($projectchange->createdDate) ? $lang->at . $projectchange->createdDate : '');
  28. $tabs[] = setting()
  29. ->group('basic')
  30. ->title($lang->projectchange->basicInfo)
  31. ->control('datalist')
  32. ->items($items)
  33. ->labelWidth(80);
  34. detail
  35. (
  36. set::object($projectchange),
  37. set::urlFormatter(array('{id}' => $projectchange->id, '{approval}' => $projectchange->approval, '{reviewID}' => $projectchange->reviewID)),
  38. set::sections($sections),
  39. set::tabs($tabs),
  40. set::actions(array_values($actions)),
  41. set::backBtn(array('url' => createLink('projectchange', 'browse', "projectID={$projectchange->project}")))
  42. );