index.html.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?php
  2. /**
  3. * The index file of workestimation 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 workestimation
  9. * @link https://www.zentao.net
  10. */
  11. namespace zin;
  12. jsVar('scale', $scale);
  13. $canModify = common::canModify('project', $project);
  14. $productivityLable = $lang->hourCommon;
  15. if($hourPoint == 1) $productivityLable = $lang->custom->unitList['efficiency'] . $lang->hourCommon;
  16. if($hourPoint == 2) $productivityLable = $lang->custom->unitList['manhour'] . $lang->custom->unitList['loc'];
  17. formPanel
  18. (
  19. set::title($title),
  20. set::layout('horz'),
  21. formGroup
  22. (
  23. set::width($canModify && $scale ? '800px' : '400px'),
  24. set::label($lang->workestimation->scale),
  25. set::required(true),
  26. inputGroup(input
  27. (
  28. setData(array('on' => 'change', 'call' => 'computeDuration')),
  29. set::name('scale'),
  30. set::value(zget($budget, 'scale', '')),
  31. set::type('number'),
  32. set::min(0),
  33. set::step(0.01)
  34. ), inputGroupAddon($lang->hourCommon, setClass('w-24 center'))),
  35. $canModify && $scale ? div
  36. (
  37. setClass('flex h-8 items-center pl-4'), html(sprintf($lang->workestimation->scaleTip, $scale)),
  38. setStyle(array('width' => '400px'))
  39. ) : null
  40. ),
  41. formGroup
  42. (
  43. set::width('400px'),
  44. set::label($lang->workestimation->productivity),
  45. set::hidden($hourPoint == 0),
  46. set::required(true),
  47. inputGroup
  48. (
  49. input
  50. (
  51. setData(array('on' => 'change', 'call' => 'computeDuration')),
  52. set::name('productivity'),
  53. set::value(zget($budget, 'productivity', ''))
  54. ),
  55. inputGroupAddon($productivityLable, setClass('w-24 center'))
  56. )
  57. ),
  58. formGroup
  59. (
  60. set::width('400px'),
  61. set::label($lang->workestimation->duration),
  62. set::required(true),
  63. inputGroup
  64. (
  65. input
  66. (
  67. setData(array('on' => 'change', 'call' => 'computeTotal')),
  68. set::name('duration'),
  69. set::disabled(true),
  70. set::value(zget($budget, 'duration', ''))
  71. ),
  72. inputGroupAddon($lang->workestimation->hour, setClass('w-24 center'))
  73. )
  74. ),
  75. formGroup
  76. (
  77. set::width('400px'),
  78. set::label($lang->workestimation->unitLaborCost),
  79. set::required(true),
  80. inputGroup
  81. (
  82. input
  83. (
  84. setData(array('on' => 'change', 'call' => 'computeTotal')),
  85. set::name('unitLaborCost'),
  86. set::value(zget($budget, 'unitLaborCost', '')),
  87. set::type('number'),
  88. set::min(0),
  89. set::step(0.01)
  90. ),
  91. inputGroupAddon($lang->custom->unitList['cost'], setClass('w-24 center'))
  92. )
  93. ),
  94. formGroup
  95. (
  96. set::width('400px'),
  97. set::label($lang->workestimation->totalLaborCost),
  98. set::required(true),
  99. set::name('totalLaborCost'),
  100. set::control(array('control' => 'input', 'type' => 'number', 'min' => 0, 'step' => '0.01')),
  101. set::value(zget($budget, 'totalLaborCost', ''))
  102. ),
  103. formGroup
  104. (
  105. set::width('400px'),
  106. set::label($lang->workestimation->dayHour),
  107. set::name('dayHour'),
  108. set::control(array('control' => 'input', 'type' => 'number', 'min' => 0, 'step' => '0.01')),
  109. set::value(zget($budget, 'dayHour', ''))
  110. )
  111. );
  112. query('.form-row')->after(html("<div class='p-4 bg-secondary-100 text-primary'>" . $lang->workestimation->tips . "</div>"));