storygrade.html.php 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. /**
  3. * The storygrade view file of custom 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 Sun Guangming<sunguangming@easycorp.ltd>
  7. * @package custom
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. include $app->getModuleRoot() . 'custom/ui/sidebar.html.php';
  12. jsVar('enableLang', $lang->custom->gradeStatusList['enable']);
  13. $tbody = array();
  14. foreach($storyGrades as $grade)
  15. {
  16. $items = array();
  17. $hidden = ($grade->grade == 1) ? 'hidden' : '';
  18. $hideAdd = (end($storyGrades) == $grade) ? '' : 'hidden';
  19. $items[] = array('icon' => 'plus', 'class' => "btn ghost btn-add-grade $hideAdd");
  20. if($grade->status == 'enable' && common::hasPriv('custom', 'closeGrade')) $items[] = array('icon' => 'off', 'class' => "btn ghost btn-close ajax-submit $hidden", 'url' => inlink('closeGrade', "type={$module}&id={$grade->grade}"), 'data-confirm' => $lang->custom->notice->closeGrade);
  21. if($grade->status == 'disable' && common::hasPriv('custom', 'activateGrade')) $items[] = array('icon' => 'magic', 'class' => "btn ghost btn-active ajax-submit", 'url' => inlink('activateGrade', "type={$module}&id={$grade->grade}"), 'data-confirm' => $lang->custom->notice->activateGrade);
  22. if(common::hasPriv('custom', 'deleteGrade')) $items[] = array('icon' => 'trash', 'class' => "btn ghost btn-delete-grade ajax-submit $hidden", 'url' => inlink('deleteGrade', "type={$module}&id={$grade->grade}"));
  23. $tbody[] = h::tr(
  24. setClass('gradeTr'),
  25. formHidden('grade[]', $grade->grade),
  26. h::td($grade->grade, set::width('100px'), setClass('index')),
  27. h::td(input(set::name('gradeName[]'), set::value($grade->name))),
  28. h::td(zget($lang->custom->gradeStatusList, $grade->status), set::width('80px'), setClass('grade-status')),
  29. h::td(
  30. set::width('100px'),
  31. btnGroup
  32. (
  33. set::items($items)
  34. )
  35. )
  36. );
  37. }
  38. div
  39. (
  40. setClass('row has-sidebar-left'),
  41. $sidebarMenu,
  42. formPanel(
  43. set::title($lang->custom->story->fields['storyGrade']),
  44. setClass('ml-0.5 flex-auto'),
  45. on::click('.btn-add-grade', 'addGrade'),
  46. set::actions(array()),
  47. h::table(
  48. setID('gradeList'),
  49. setClass('table table-form borderless'),
  50. h::tr(
  51. h::td($lang->story->grade),
  52. h::td($lang->story->gradeName, setClass('required')),
  53. h::td($lang->story->statusAB),
  54. h::td($lang->actions)
  55. ),
  56. $tbody,
  57. h::tfoot(
  58. h::tr(
  59. h::td(),
  60. h::td(
  61. btn(
  62. $lang->save,
  63. setClass('primary btn-wide'),
  64. set::btnType('submit')
  65. )
  66. )
  67. )
  68. )
  69. )
  70. )
  71. );