page.list.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <?php
  2. global $myUser, $conf;
  3. User::check_access('planning','read');
  4. require_once(__DIR__.SLASH.'Planning.class.php');
  5. require_once(__DIR__.SLASH.'PlanningEventType.class.php');
  6. ?>
  7. <div class="planning-page"
  8. data-planning-share="<?php echo $conf->get('planning_allow_share')==true ? 1:0; ?>"
  9. data-event-editable="<?php echo $conf->get('planning_allow_event_edit')==true ? 1:0; ?>"
  10. >
  11. <div class="row " >
  12. <!-- search results -->
  13. <div class="col-md-12"><div class="planning-loader hidden"><i class="fas fa-circle-notch fa-spin"></i></div></div>
  14. <div class='planning-title' data-id='1'></div>
  15. <div class="col-xl-12 clo-md-12 planning-view">
  16. <div id='planning-calendars'>
  17. <div id="planning-datepicker" class="shadow-sm"></div>
  18. <?php if($myUser->can('planning', 'edit')): ?>
  19. <div class="btn btn-primary mt-3 w-100" onclick="planning_edit();"><i class="far fa-calendar-plus"></i> Ajouter un agenda</div>
  20. <?php endif; ?>
  21. <hr>
  22. <h4 class="pointer user-select-none" onclick="$('#plannings').slideToggle(150); $(this).find('>i').toggleClass('fa-angle-right')">Mes agendas <i class="right pointer fas fa-angle-down"></i></h4>
  23. <ul id="plannings" class="planning-list user-select-none">
  24. <li class="hidden" data-id="{{id}}" data-default="{{default}}">
  25. <label>
  26. <div class="planning-box" style="background-color:{{color}}"><input type="checkbox" onclick="planning_select()" data-type="checkbox"></div>
  27. <div class="d-inline-block">
  28. <div>{{{label}}}</div>
  29. <div class="planning-owner text-muted">{{ownerName}}</div>
  30. </div>
  31. </label>
  32. <div class="planning-option-btn">
  33. <?php if($myUser->can('planning', 'edit')): ?>
  34. <i onclick="planning_edit(this)" title="Configurer" class="fas fa-cog"></i>
  35. <?php endif; ?>
  36. <?php if($myUser->can('planning', 'delete')): ?>
  37. {{#editable}}
  38. <i onclick="planning_delete(this)" title="Supprimer" class="far fa-trash-alt"></i>
  39. {{/editable}}
  40. <?php endif; ?>
  41. </div>
  42. </li>
  43. </ul>
  44. <div class="shared-plannings-block">
  45. <h4 class="pointer user-select-none" onclick="$('#shared-plannings').slideToggle(150); $(this).find('>i').toggleClass('fa-angle-right')">Agendas partagés <i class="right pointer fas fa-angle-down"></i></h4>
  46. <ul id="shared-plannings" class="planning-list"></ul>
  47. </div>
  48. </div>
  49. <div id='planning' style="width:100%!important"
  50. data-user="<?php echo $myUser->login; ?>"
  51. data-start-hour="<?php echo $conf->get('planning_day_start'); ?>"
  52. data-end-hour="<?php echo $conf->get('planning_day_end'); ?>"
  53. data-view="<?php echo empty($conf->get('planning_default_view'))? 'dayGridMonth': $conf->get('planning_default_view'); ?>"
  54. ></div>
  55. </div>
  56. </div>
  57. <?php require_once(__DIR__.SLASH.'event.modal.php'); ?>
  58. <!-- Edition de calendrier -->
  59. <div class="modal fade" id="planningModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  60. <div class="modal-dialog modal-lg" role="document">
  61. <div class="modal-content">
  62. </div>
  63. </div>
  64. </div>
  65. <!-- teammate view -->
  66. <div class="planning-teammate-view hidden">
  67. <table class="fc-teammate">
  68. <thead class="fc-head fc-widget-header fc-head-container">
  69. <tr>
  70. <th>Equipe</th>
  71. </tr>
  72. </thead>
  73. <tbody class="fc-body fc-widget-content">
  74. </tbody>
  75. <tfoot class="fc-footer">
  76. <tr>
  77. <td><div class="btn btn-light btn-teammate-add w-100"><i class="fas fa-user-plus"></i> Equipiers</div></td>
  78. <td colspan="7"></td>
  79. </tr>
  80. </tfoot>
  81. </table>
  82. </div>
  83. <!-- Modal equipiers -->
  84. <div class="modal fade" id="teammate-modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  85. <div class="modal-dialog" role="document">
  86. <div class="modal-content">
  87. <div class="modal-header">
  88. <h5 class="modal-title" id="exampleModalLabel">Affichage des équipiers</h5>
  89. </div>
  90. <div class="modal-body">
  91. <div class="input-group col-md-12">
  92. <label><input type="checkbox" data-type="checkbox" onclick="$('.teammate-picker input').trigger('click');"><small class="text-muted pointer">Tout (dé)cocher</small></label>
  93. <div class="teammate-picker">
  94. <ul>
  95. <?php foreach (User::getAll() as $user):
  96. $user->password= '';
  97. ?>
  98. <li><label><input type="checkbox" data-type="checkbox" data-login="<?php echo $user->login; ?>" data-name="<?php echo $user->name; ?>" data-firstname="<?php echo $user->firstname; ?>" data-avatar="<?php echo $user->getAvatar(); ?>"><?php echo $user->fullName(); ?></label></li>
  99. <?php endforeach; ?>
  100. </ul>
  101. </div>
  102. </div>
  103. </div>
  104. <div class="modal-footer">
  105. <button type="button" class="btn btn-secondary" data-dismiss="modal">Fermer</button>
  106. <button type="button" class="btn btn-primary btn-save">Enregistrer</button>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. <!-- Modal choix de groupe evenement -->
  112. <div class="modal fade" id="event-group-modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  113. <div class="modal-dialog" role="document">
  114. <div class="modal-content">
  115. <div class="modal-header">
  116. <h5 class="modal-title" id="exampleModalLabel">Effectuer cette action pour...</h5>
  117. </div>
  118. <div class="modal-body">
  119. <div class="input-group col-md-12">
  120. <div class="event-group-option">
  121. <ul>
  122. <li data-target="group"><i class="far fa-calendar-alt"></i>
  123. La série
  124. <small class="text-muted">Concernera tous les évenements lié à cet évenement</small>
  125. </li>
  126. <li data-target="event">
  127. <i class="far fa-calendar-check"></i>
  128. Cet évenement
  129. <small class="text-muted">Ne concernera que cet évenement précis</small>
  130. </li>
  131. </ul>
  132. </div>
  133. </div>
  134. </div>
  135. <div class="modal-footer">
  136. <button type="button" class="btn btn-secondary" data-dismiss="modal">Fermer</button>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. <!-- /teammate view -->
  142. <div class="planning-teammates hidden"><?php
  143. $response = array();
  144. $teammates = $myUser->preference('planning_teammate')!='' ? explode(',',$myUser->preference('planning_teammate')) : array();
  145. foreach ($teammates as $login) {
  146. $user = User::byLogin($login);
  147. $user->password = '';
  148. $row = $user->toArray();
  149. $row['avatar'] = $user->getAvatar();
  150. $response[] = $row;
  151. }
  152. echo json_encode($response);
  153. ?></div>
  154. </div>