review.html.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /**
  3. * The change view file of story 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 Wang Yidong <yidong@easycorp.ltd>
  7. * @package story
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. include './affected.html.php';
  12. data('activeMenuID', $story->type);
  13. jsVar('storyID', $story->id);
  14. jsVar('storyType', $story->type);
  15. jsVar('rawModule', $this->app->rawModule);
  16. jsVar('isMultiple', count($reviewers) > 1);
  17. jsVar('isLastOne', $isLastOne);
  18. if($story->isParent == '1') $fields['estimate']['readonly'] = true;
  19. $formItems = array();
  20. foreach($fields as $field => $attr)
  21. {
  22. $width = zget($attr, 'width', '1/3');
  23. $fieldName = zget($attr, 'name', $field);
  24. $control = array();
  25. $control['type'] = $attr['control'];
  26. if(!empty($attr['options'])) $control['items'] = $attr['options'];
  27. if($field == 'duplicateStory')
  28. {
  29. $control['items'] = createLink('story', 'ajaxGetDuplicatedStories', "storyID=$story->id&productID=$story->product");
  30. $control['required'] = false;
  31. $control['maxItemsCount'] = 100;
  32. }
  33. $value = $field == 'estimate' ? helper::formatHours($attr['default']) : $attr['default'];
  34. $formItems[$field] = formRow
  35. (
  36. in_array($field, array('assignedTo', 'duplicateStory', 'pri', 'estimate')) ? setID($field . 'Box') : null,
  37. in_array($field, array('closedReason', 'duplicateStory', 'pri', 'estimate', 'status')) ? set::hidden(true) : null,
  38. $field == 'closedReason' ? setID('rejectedReasonBox') : null,
  39. $field == 'assignedTo' ? set::hidden(!$isLastOne) : null,
  40. $field == 'result' ? on::change('switchShow(e.target);') : null,
  41. $field == 'closedReason' ? on::change('setStory(e.target);') : null,
  42. formGroup
  43. (
  44. set::width($width),
  45. set::name($fieldName),
  46. set::label($attr['title']),
  47. set::control($control),
  48. set::value($value),
  49. set::required($attr['required']),
  50. set::readonly(!empty($attr['readonly']))
  51. )
  52. );
  53. }
  54. if(strpos('or,lite', $this->config->vision) === false) $formItems['affected'] = $getAffectedTabs($story, $users);
  55. modalHeader();
  56. div
  57. (
  58. setClass('panel-form mx-auto'),
  59. formPanel($formItems),
  60. h::hr(setClass('mt-6 mb-6')),
  61. history(set::objectID($story->id))
  62. );
  63. render();