role.html.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * The role view file of approval flow 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 Guangming Sun <sunguangming@easycorp.ltd>
  7. * @package approvalflow
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. include $app->getModuleRoot() . 'custom/ui/sidebar.html.php';
  12. featureBar();
  13. $canCreateRole = common::hasPriv('approvalflow', 'createRole');
  14. $createItem = array('text' => $lang->approvalflow->createRole, 'url' => createLink('approvalflow', 'createRole'));
  15. toolbar($canCreateRole ? item(set($createItem + array('class' => 'btn primary', 'icon' => 'plus', 'data-toggle' => 'modal'))) : null);
  16. $cols = $config->approvalflow->dtable->role->fieldList;
  17. $roles = initTableData($roleList, $cols, $this->approvalflow);
  18. foreach($roles as $role)
  19. {
  20. $member = '';
  21. foreach(explode(',', $role->users) as $account)
  22. {
  23. if(!$account) continue;
  24. $member .= zget($users, $account) . ',';
  25. }
  26. $member = trim($member, ',');
  27. $role->member = $member;
  28. }
  29. dtable
  30. (
  31. set::cols($cols),
  32. set::data($roles),
  33. set::userMap($users),
  34. set::checkable(false)
  35. );