view.html.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. /**
  3. * The view view file of researchreport module of ZenTaoPMS.
  4. * @copyright Copyright 2009-2026 禅道软件(青岛)有限公司(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 Shujie Tian <tianshujie@chandao.com>
  7. * @package researchreport
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. $operateList = !$report->deleted ? $this->loadModel('common')->buildOperateMenu($report) : array();
  12. $actions = !empty($operateList['suffixActions']) ? $operateList['suffixActions'] : array();
  13. $basicInfoItems = array();
  14. $basicInfoItems[$lang->researchreport->author] = array('control' => 'text', 'text' => zget($users, $report->author));
  15. $basicInfoItems[$lang->researchreport->relatedPlan] = array('control' => 'link', 'text' => zget($planPairs, $report->relatedPlan), 'url' => hasPriv('researchplan', 'view') ? createLink('researchplan', 'view', "planID=$report->relatedPlan") : '');
  16. $basicInfoItems[$lang->researchreport->customer] = array('control' => 'text', 'text' => $report->customer);
  17. $basicInfoItems[$lang->researchreport->researchObjects] = array('control' => 'text', 'text' => $report->researchObjects);
  18. $basicInfoItems[$lang->researchreport->researchTime] = array('control' => 'text', 'text' => (!helper::isZeroDate($report->begin) and !helper::isZeroDate($report->end)) ? substr($report->begin, 0, 16) . ' ~ ' . substr($report->end, 0, 16) : '');
  19. $basicInfoItems[$lang->researchreport->location] = array('control' => 'text', 'text' => $report->location);
  20. $basicInfoItems[$lang->researchreport->method] = array('control' => 'text', 'text' => zget($lang->researchreport->methodList, $report->method));
  21. $basicInfo = datalist
  22. (
  23. set::className('researchreport-basic-info'),
  24. set::items($basicInfoItems)
  25. );
  26. $lifeTimeItems = array();
  27. $lifeTimeItems[$lang->researchreport->createdBy] = array('control' => 'text', 'text' => zget($users, $report->createdBy));
  28. $lifeTimeItems[$lang->researchreport->createdDate] = array('control' => 'text', 'text' => $report->createdDate);
  29. $lifeTimeItems[$lang->researchreport->editedBy] = array('control' => 'text', 'text' => zget($users, $report->editedBy));
  30. $lifeTimeItems[$lang->researchreport->editedDate] = array('control' => 'text', 'text' => helper::isZeroDate($report->editedDate) ? '' : $report->editedDate);
  31. $lifeTime = datalist
  32. (
  33. set::className('researchreport-lift-item'),
  34. set::items($lifeTimeItems)
  35. );
  36. $URItems = array();
  37. foreach($relatedUR as $id => $title)
  38. {
  39. $URText = '#' . $id . ' ' . $title;
  40. $URItems[] = (object)array('id' => $id, 'title' => $URText);
  41. }
  42. $canViewUR = hasPriv('requirement', 'view');
  43. $relativeItems[] = array('title' => $lang->researchreport->legendFromUR, 'hint' => $lang->researchreport->legendFromUR, 'items' => $URItems, 'url' => $canViewUR ? createLink('requirement', 'view', "id={id}") : null, 'data-toggle' => 'modal', 'data-size' => 'lg');
  44. $tabs = array();
  45. $tabs[] = setting()
  46. ->group('basic')
  47. ->title($lang->researchreport->basicInfo)
  48. ->children(wg($basicInfo));
  49. $tabs[] = setting()
  50. ->group('basic')
  51. ->title($lang->researchreport->lifeTime)
  52. ->children(wg($lifeTime));
  53. $tabs[] = setting()
  54. ->group('relatives')
  55. ->title($lang->researchreport->legendRelated)
  56. ->control('relatedList')
  57. ->showIDLabel(false)
  58. ->data($relativeItems);
  59. $sections = array();
  60. $sections[] = setting()
  61. ->title($lang->researchreport->content)
  62. ->control('html')
  63. ->content($report->content);
  64. detail
  65. (
  66. set::objectType('report'),
  67. set::objectID($report->id),
  68. set::sections($sections),
  69. set::tabs($tabs),
  70. set::actions(array_values($actions))
  71. );