batchcreate.html.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * The batch create stakeholder view of stakeholder module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author Chunsheng Wang <chunsheng@cnezsoft.com>
  8. * @package product
  9. * @version $Id: browse.html.php 5096 2013-07-11 07:02:43Z chencongzhi520@gmail.com $
  10. * @link https://www.zentao.net
  11. */
  12. namespace zin;
  13. $data = array();
  14. foreach($stakeholders as $stakeholder)
  15. {
  16. if(!isset($users[$stakeholder->user])) continue;
  17. $data[$stakeholder->user]['accounts'] = $stakeholder->user;
  18. }
  19. foreach($parentStakeholders as $stakeholder)
  20. {
  21. if(!isset($users[$stakeholder->account])) continue;
  22. $data[$stakeholder->account]['accounts'] = $stakeholder->account;
  23. }
  24. foreach($deptUsers as $deptAccount => $userName)
  25. {
  26. if(!isset($users[$deptAccount])) continue;
  27. $data[$deptAccount]['accounts'] = $deptAccount;
  28. }
  29. jsVar('projectID', $projectID);
  30. formBatchPanel
  31. (
  32. set::className('batchcreate-stakeholder-panel'),
  33. set::width('1/2'),
  34. to::heading
  35. (
  36. div(setClass('panel-title text-lg'), $lang->program->createStakeholder),
  37. inputGroup($lang->execution->selectDept, picker
  38. (
  39. set::name('dept'),
  40. set::items($depts),
  41. set::value($dept),
  42. set::width('200px'),
  43. setData('placeholder', $lang->execution->selectDeptTitle),
  44. on::change("setDeptUsers")
  45. )),
  46. $project->parent ? btn(set::url($this->createLink('stakeholder', 'batchcreate', "projectID={$projectID}&dept=&parent=$project->parent")), setClass('primary'), $lang->program->importStakeholder) : null
  47. ),
  48. set::minRows(count($data) + 5),
  49. set::bodyClass('w-1/2'),
  50. set::data(array_values($data)),
  51. formBatchItem
  52. (
  53. set::name('accounts'),
  54. set::label($lang->team->account),
  55. set::control('picker'),
  56. set::items($users)
  57. )
  58. );