effortcalendar.html.php 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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-icon btn-mini btn-prev"><i class="icon-chevron-left"></i></button>
  21. <button type="button" class="btn btn-info btn-mini btn-today"><?php echo $lang->today;?></button>
  22. <button type="button" class="btn btn-info btn-icon btn-mini btn-next"><i class="icon-chevron-right"></i></button>
  23. <span class="calendar-caption"></span>
  24. <?php echo html::a($this->createLink('user', 'todo', "userID={$user->id}&type=all"), $lang->todo->all, '', "class='btn btn-link' id='todoTab'")?>
  25. <?php echo html::a($this->createLink('user', 'effort', "userID={$user->id}&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. <?php if(common::hasPriv('user', 'todocalendar')):?>
  30. <li><?php echo html::a($this->createLink('user', 'todocalendar', "userID={$user->id}"), $lang->todo->common);?></li>
  31. <?php elseif(common::hasPriv('user', 'todo')):?>
  32. <li><?php echo html::a($this->createLink('user', 'todo', "userID={$user->id}"), $lang->todo->common);?></li>
  33. <?php endif;?>
  34. <li class="active"><?php echo html::a($this->createLink('user', 'effortcalendar', "userID={$user->id}"), $lang->effort->common);?></li>
  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 $efforts?>;
  44. $('#calendar').calendar({
  45. hideEmptyWeekends: true,
  46. dragThenDrop:false,
  47. data:
  48. {
  49. calendars:
  50. {
  51. defaultCal: {color: '#fff'}
  52. },
  53. events: tasks
  54. },
  55. eventCreator: function(event, $cell, calendar)
  56. {
  57. var $event = $('<div title="' + event.title + '" data-id="' + (event.id || '') + '" class="event has-time" title="' + (event.desc || '') + '"><span class="title">' + event.title + '</span><span class="time">' + event.consumed + 'h</span></div>');
  58. return $event;
  59. },
  60. clickEvent: function(event)
  61. {
  62. event = event.event;
  63. if(event.url)
  64. {
  65. var modalTrigger = new $.zui.ModalTrigger({width: '80%', url: event.url, type:'iframe'});
  66. modalTrigger.show();
  67. }
  68. }
  69. });
  70. });
  71. <?php if(common::hasPriv('effort', 'export')):?>
  72. $(function()
  73. {
  74. $('#featurebar .actions').prepend(<?php echo json_encode(html::a('javascript:exportCalendar("' . $this->createLink('effort', 'export', "userID={$user->id}&orderBy=date_asc,begin_asc&date=_date_") . '")', $lang->export, '', "class='btn'"));?>);
  75. })
  76. <?php endif;?>
  77. </script>
  78. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>