planning.modal.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?php
  2. global $myUser;
  3. require_once(__DIR__.SLASH.'Planning.class.php');
  4. $planning = Planning::provide();
  5. $planning->color = $planning->color!='' ? $planning->color : '#8bc34a';
  6. $canEdit = $myUser->login == $planning->owner || $planning->id == 0 || $myUser->superadmin;
  7. ?>
  8. <div class="modal-header">
  9. <h5 class="modal-title" id="exampleModalLabel">Réglages de calendrier</h5>
  10. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  11. <span aria-hidden="true">&times;</span>
  12. </button>
  13. </div>
  14. <div class="modal-body" id="planning-form" data-id="<?php echo $planning->id; ?>">
  15. <div class="row">
  16. <div class="input-group col-md-12">
  17. <div class="input-group-prepend">
  18. <span class="input-group-text">Titre</span>
  19. </div>
  20. <input type="text" id="planning-label" value="<?php echo htmlspecialchars($planning->label); ?>" class="form-control" placeholder="Titre de mon calendrier...">
  21. <div class="input-group-prepend">
  22. <span class="input-group-text">Couleur</span>
  23. </div>
  24. <input type="text" data-type="color" id="planning-color" class="form-control" value="<?php echo $planning->color; ?>">
  25. </div>
  26. </div>
  27. <div class="row planning-share-block">
  28. <div class="col-md-12">
  29. <div onclick="$('#planning-advanced').toggleClass('hidden')" class="btn btn-link pl-0 text-uppercase"><i class="fas fa-plus"></i> Plus d'options</div>
  30. <div id="planning-advanced" class="hidden mt-3">
  31. <h6 class="text-uppercase"><i class="fas fa-share-square"></i> Partages</h6>
  32. <p>Partagez votre calendrier avec vos collaborateurs.</p>
  33. <div class="input-group <?php echo $canEdit?'':'hidden' ?>" id="planning-share-form">
  34. <div class="input-group-prepend">
  35. <span class="input-group-text">Partage avec</span>
  36. </div>
  37. <input type="text" data-type="user" data-types="user,rank" id="recipient" class="form-control">
  38. <div class="input-group-prepend">
  39. <span class="input-group-text">
  40. <label class="mb-0 pointer user-select-none"><input id="read" type="checkbox" data-type="checkbox">Lecture</label>
  41. </span>
  42. </div>
  43. <div class="input-group-prepend">
  44. <span class="input-group-text">
  45. <label class="mb-0 pointer user-select-none"><input id="edit" type="checkbox" data-type="checkbox">Écriture</label>
  46. </span>
  47. </div>
  48. <div class="input-group-append">
  49. <span class="input-group-text btn" onclick="planning_share_save();">
  50. <i class="far fa-plus-square"></i>
  51. </span>
  52. </div>
  53. </div>
  54. <table id="planning-shares" class="table mt-2">
  55. <thead>
  56. <tr>
  57. <th scope="col">Avec</th>
  58. <th scope="col">Lecture</th>
  59. <th scope="col">Ecriture</th>
  60. <th scope="col"></th>
  61. </tr>
  62. </thead>
  63. <tbody>
  64. <tr data-id="{{id}}" class="hidden">
  65. <td>{{recipient}} <small class="text-muted">- {{recipientType}}</small></td>
  66. <td>{{#read}}<i class="fas fa-check text-success"></i>{{/read}}{{^read}}<i class="fas fa-ban text-danger"></i>{{/read}}</td>
  67. <td>{{#edit}}<i class="fas fa-check text-success"></i>{{/edit}}{{^edit}}<i class="fas fa-ban text-danger"></i>{{/edit}}</td>
  68. <td><i class="far fa-trash-alt pointer <?php echo $canEdit?'':'hidden' ?>" onclick="planning_share_delete(this);"></i></td>
  69. </tr>
  70. </tbody>
  71. </table>
  72. <h6 class=" mt-3"><i class="far fa-calendar text-uppercase"></i> Synchronisation</h6>
  73. <p>Pour synchroniser ce calendrier sur votre téléphone, entrez l'addresse suivante dans les paramètres CalDav.</p>
  74. <code><?php echo ROOT_URL; ?>/dav/planning/<?php echo $planning->owner ?>/<?php echo $planning->slug; ?>?u=<?php echo $myUser->login; ?>&p=VOTRE-MOT-DE-PASSE</code>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. <div class="modal-footer">
  80. <button type="button" class="btn btn-secondary" data-dismiss="modal">Fermer</button>
  81. <?php if($canEdit): ?>
  82. <button type="button" class="btn btn-primary" onclick="planning_save();"><i class="far fa-calendar-check"></i> Enregistrer</button>
  83. <?php endif; ?>
  84. </div>