effortcalendar.html.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * The calendar view file of execution module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2026 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
  6. * @license ZPL (http://zpl.pub/page/zplv12.html)
  7. * @author Hao Sun <sunhao@chandao.com>
  8. * @package execution
  9. * @version $Id: editrelation.html.php 935 2024-08-08 15:14:24Z $
  10. * @link https://www.zentao.net
  11. */
  12. namespace zin;
  13. $filterItems = [];
  14. foreach($this->lang->execution->featureBar['effortcalendar'] as $period => $label)
  15. {
  16. if($period != 'calendar' and !hasPriv('execution', 'effort')) break;
  17. $method = $period == 'calendar' ? 'effortcalendar' : 'effort';
  18. $vars = $period == 'calendar' ? "executionID=$executionID" : "executionID=$executionID&date=$period";
  19. $filterItems[] = ['text' => $label, 'url' => inlink($method, $vars), 'active' => $period == 'calendar'];
  20. }
  21. featureBar
  22. (
  23. set::items($filterItems),
  24. picker(setClass('ml-4'), set::width(150), set::placeholder($users['']), set::items($users), set::value($userID), set::onChange(jsRaw("(val) => changeUser($executionID, val)")))
  25. );
  26. $toolbarItems = [];
  27. if(hasPriv('effort', 'export')) $toolbarItems[] = ['type' => 'ghost', 'text' => $lang->effort->export, 'icon' => 'import', 'zui-on-click' => ['call' => 'exportCalendar', 'params' => [createLink('effort', 'export', "userID=$userID&orderBy=date_desc&date=_date_&executionID=$executionID")]]];
  28. toolbar(set::items($toolbarItems));
  29. panel
  30. (
  31. zui::calendar
  32. (
  33. set::_id('calendar'),
  34. set::hideEmptyWeekends(),
  35. set::ajaxGetEffortsUrl(createLink('execution', 'ajaxGetEfforts', "executionID=$executionID&userID=$userID&year={year}")),
  36. set::effortViewUrl(createLink('effort', 'view', 'id={id}')),
  37. set::textNetworkError($lang->textNetworkError),
  38. set('$options', jsRaw('window.setCalendarOptions'))
  39. )
  40. );