ajaxbuildzentaomeasurementconfig.html.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. /**
  3. * The buildzentaoconfig view file of document module of ZenTaoPMS.
  4. * @copyright Copyright 2009-2025 禅道软件(青岛)有限公司(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 Tingting Dai <daitingting@easycorp.ltd>
  7. * @package doc
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. $formRows = array();
  12. $formGroups = array();
  13. foreach($conditionFields as $conditionField)
  14. {
  15. $required = false;
  16. if($module == 'weekly' && $measurementKey == 'term') $required = true;
  17. $conditionField['required'] = $required;
  18. if(!$isTemplate && $conditionField['control'] == 'datepicker')
  19. {
  20. $fieldName = $conditionField['name'];
  21. $formGroups[] = formGroup
  22. (
  23. set::label($conditionField['label']),
  24. set::required($conditionField['required']),
  25. set::width('1/2'),
  26. inputGroup
  27. (
  28. datePicker
  29. (
  30. set::name("{$fieldName}[begin]"),
  31. set::value(zget($conditionField['value'], 'begin', ''))
  32. ),
  33. $lang->to,
  34. datePicker
  35. (
  36. set::name("{$fieldName}[end]"),
  37. set::value(zget($conditionField['value'], 'end', ''))
  38. )
  39. )
  40. );
  41. if(count($formGroups) == 2)
  42. {
  43. $formRows[] = formRow($formGroups);
  44. $formGroups = array();
  45. }
  46. }
  47. else
  48. {
  49. $formGroups[] = formGroup(set($conditionField));
  50. if(count($formGroups) == 2)
  51. {
  52. $formRows[] = formRow($formGroups);
  53. $formGroups = array();
  54. }
  55. }
  56. }
  57. if($formGroups) $formRows[] = formRow($formGroups);
  58. formPanel
  59. (
  60. setID('buildZentaoConfig'),
  61. set::action(inlink($this->app->rawMethod, "type={$type}&oldBlockID={$blockID}")),
  62. set::ajax(array('beforeSubmit' => jsRaw('clickSubmitForZentaoConfig'))),
  63. set::title($title),
  64. to::titleSuffix
  65. (
  66. span
  67. (
  68. setClass('text-muted text-sm text-gray-600 font-light'),
  69. span(setClass('text-warning mr-1'), icon('help'), set::title($lang->reporttemplate->noneConditionTips)),
  70. $lang->reporttemplate->noneConditionTips
  71. )
  72. ),
  73. $formRows,
  74. $isTemplate ? null : formHidden('project', $project),
  75. formHidden('templateID', '')
  76. );