todocalendar.html.php 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. /**
  3. * The view file of my module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2012 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license business(商业软件)
  7. * @author Yangyang Shi <shiyangyang@cnezsoft.com>
  8. * @package calendar
  9. * @version $Id$
  10. * @link http://www.zentao.net
  11. */
  12. ?>
  13. <?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
  14. <?php include '../../../common/ext/view/calendar.html.php'?>
  15. <?php include $this->app->getModuleRoot() . 'user/view/featurebar.html.php';?>
  16. <div id='mainContent'>
  17. <div class='calendar' id='calendar'>
  18. <header class="calender-header table-row">
  19. <div class="btn-toolbar col-4 table-col text-middle">
  20. <button type="button" class="btn btn-info btn-mini btn-today"><?php echo $lang->today;?></button>
  21. <button type="button" class="btn btn-info btn-icon btn-mini btn-prev"><i class="icon-chevron-left"></i></button>
  22. <span id="date" class="calendar-caption"></span>
  23. <button type="button" class="btn btn-info btn-icon btn-mini btn-next"><i class="icon-chevron-right"></i></button>
  24. <?php echo html::a($this->createLink('user', 'todo', "userID=$userID&type=all"), $lang->todo->all, '', "class='btn btn-link' id='todoTab'")?>
  25. <?php echo html::a($this->createLink('user', 'effort', "userID=$userID&type=all"), $lang->effort->all, '', "class='btn btn-link' id='effortTab'")?>
  26. </div>
  27. <div class="col-4 text-center table-col">
  28. <ul class="nav nav-primary">
  29. <li class="active"><?php echo html::a($this->createLink('user', 'todocalendar', "userID=$userID"), $lang->todo->common);?></li>
  30. <?php if(common::hasPriv('user', 'effortcalendar')):?>
  31. <li><?php echo html::a($this->createLink('user', 'effortcalendar', "userID=$userID"), $lang->effort->common);?></li>
  32. <?php elseif(common::hasPriv('user', 'effort')):?>
  33. <li><?php echo html::a($this->createLink('user', 'effort', "userID=$userID"), $lang->effort->common);?></li>
  34. <?php endif;?>
  35. </ul>
  36. </div>
  37. <div class="col-4 table-col"></div>
  38. </header>
  39. </div>
  40. </div>
  41. <script language='javascript'>
  42. $(document).ready(function() {
  43. var tasks = <?php echo $todos?>;
  44. $('#calendar').calendar(
  45. {
  46. hideEmptyWeekends: true,
  47. dragThenDrop:false,
  48. data:
  49. {
  50. calendars:
  51. {
  52. defaultCal: {color: '#fff'}
  53. },
  54. events: tasks
  55. },
  56. eventCreator: function(event, $cell, calendar)
  57. {
  58. var pri = event.pri != '' ? '(' + event.pri + ')' : '';
  59. var $event = $('<div title="' + pri + event.title + '" data-id="' + (event.id || '') + '" class="event">' + (event.finish ? '<i class="icon todo-check icon-check-circle"></i>' : '<i class="icon todo-check icon-check-circle-empty"></i>') + '<span class="title">' + pri + event.title + '</span>' + (event.allDay ? '' : '<span class="time">' + event.start.format('hh:mm') + '</span>') + '</div>');
  60. $event.toggleClass('has-time', !event.allDay)
  61. .toggleClass('expired', !event.finish && !$cell.hasClass('future'));
  62. return $event;
  63. },
  64. clickEvent: function(event)
  65. {
  66. event = event.event;
  67. if(event.url)
  68. {
  69. var modalTrigger = new $.zui.ModalTrigger({width: '80%', url: event.url, type:'iframe'});
  70. modalTrigger.show();
  71. }
  72. }
  73. });
  74. });
  75. </script>
  76. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>