edit.html.php 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * The edit view file of issue 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 Shujie Tian <tianshujie@easycorp.ltd>
  7. * @package issue
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. $fields = useFields('issue.edit');
  12. $fields->orders('type,project');
  13. $projectChange = jsCallback()
  14. ->const('projectID', $issue->project)
  15. ->do(<<<'JS'
  16. const currentProjectID = $element.find('[name=project]').val();
  17. const loadExecutionUrl = $.createLink('project', 'ajaxGetExecutions', 'project=' + currentProjectID + '&mode=leaf');
  18. $.getJSON(loadExecutionUrl, function(data)
  19. {
  20. const $executionPicker = $element.find('[name=execution]').zui('picker');
  21. const executionID = $element.find('[name=execution]').val();
  22. $executionPicker.render({items: data.items});
  23. $executionPicker.$.setValue(executionID);
  24. $('[data-name=execution]').toggleClass('hidden', !data.multiple);
  25. });
  26. JS
  27. );
  28. formGridPanel(on::change('[name=project]', $projectChange), set::title($lang->issue->edit), set::modeSwitcher(false), set::fields($fields));