setting.notification.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <?php
  2. global $myUser;
  3. global $conf;
  4. require_once(__DIR__.SLASH.'Notification.class.php');
  5. User::check_access('notification','configure');
  6. $types = array();
  7. ?>
  8. <div class="row">
  9. <div class="col-md-12" id="notification_preference">
  10. <br>
  11. <h3>Notifications</h3>
  12. <div class="clear"></div>
  13. <hr>
  14. <p>Dans cette section, vous pouvez créer une notification pour les utilisateurs et types concernés</p>
  15. <div class="row">
  16. <div class="col-md-6">
  17. <label for="recipients">Destinataires </label> <small class="text-muted"> - Laisser vide pour envoyer à tout le monde</small>
  18. <input type="text" class="form-control" id="recipients" data-type="user" data-multiple>
  19. </div>
  20. <div class="col-md-1 mt-4 text-center">
  21. <span class="font-weight-bold">OU</span>
  22. </div>
  23. <div class="col-md-5 mt-4">
  24. <label for="pinned" class="pointer"><input type="checkbox" class="form-control" id="pinned" data-type="checkbox"> Epingler <small class="text-muted"> - Concerne tout le monde</small> </label>
  25. </div>
  26. </div>
  27. <div class="row">
  28. <div class="col-md-6">
  29. <label for="start">Lancer la notification le </label> <small class="text-muted"> - Laisser à vide pour envoyer tout de suite</small>
  30. <input type="text" class="form-control" id="start" data-type="date">
  31. </div>
  32. <div class="col-md-6">
  33. <label for="end">Jusqu'au </label> <small class="text-muted"> - Par défaut 3 mois</small>
  34. <input type="text" class="form-control" id="end" data-type="date">
  35. </div>
  36. </div>
  37. <div class="row">
  38. <div class="col-md-6">
  39. <label for="type">Type de notification </label>
  40. <select class="form-control" id="type">
  41. <?php foreach(Notification::types() as $slug=>$type):
  42. //utilisé pour la recherche par type en bas de page
  43. $types[$slug] = $type['label'];
  44. ?>
  45. <option value="<?php echo $slug;?>"><?php echo $type['label']; ?></option>
  46. <?php endforeach; ?>
  47. </select>
  48. </div>
  49. <div class="col-md-6">
  50. <label for="label">Sujet </label>
  51. <input type="text" class="form-control" id="label">
  52. </div>
  53. </div>
  54. <textarea class="form-control" id="html" data-type="wysiwyg"></textarea>
  55. <div class="btn btn-success" onclick="notification_send()"><i class="fas fa-check"></i> Envoyer</div>
  56. </div>
  57. </div>
  58. <div class="row mt-5">
  59. <div class="col-md-12">
  60. <h3>Notifications épinglées</h3>
  61. <select id="filters" data-type="filter" data-label="Recherche" data-join="and" data-function="notification_search">
  62. <option value="label" data-filter-type="text">Libellé</option>
  63. <option value="start" data-filter-type="date">Date Début</option>
  64. <option value="end" data-filter-type="date">Date Fin</option>
  65. <option value="type" data-filter-type="dictionnary" data-filter-source='<?php echo json_encode($types); ?>'>Type</option>
  66. </select>
  67. </div>
  68. </div>
  69. <br/>
  70. <h4 class="results-count"><span></span> Résultat(s)</h4>
  71. <div class="row">
  72. <!-- search results -->
  73. <div class="col-xl-12">
  74. <table id="notifications-pinned" class="table table-striped " data-entity-search="notification_notification_search">
  75. <thead>
  76. <tr>
  77. <th>#</th>
  78. <th data-sortable="type">Type</th>
  79. <th data-sortable="label">label</th>
  80. <th data-sortable="start">Début</th>
  81. <th data-sortable="end">Fin</th>
  82. <th >Contenu</th>
  83. <th></th>
  84. </tr>
  85. </thead>
  86. <tbody>
  87. <tr data-id="{{id}}" class="hidden">
  88. <td>{{id}}</td>
  89. <td><i class="{{type.icon}}"></i> {{type.label}}</td>
  90. <td>{{label}}</td>
  91. <td>{{start}}</td>
  92. <td>{{end}}</td>
  93. <td>{{html}}</td>
  94. <td>
  95. <div class="btn-group btn-group-sm" role="group">
  96. <div class="btn btn-danger " onclick="notification_delete(this);"><i class="far fa-trash-alt"></i></div>
  97. </div>
  98. </td>
  99. </tr>
  100. </tbody>
  101. </table>
  102. <!-- Pagination (data-range définit le nombre de pages max affichées avant et après la page courante) -->
  103. <ul class="pagination justify-content-center" data-range="5">
  104. <li class="page-item hidden" data-value="{{value}}" title="Voir la page {{label}}" onclick="$(this).parent().find('li').removeClass('active');$(this).addClass('active');notification_notification_search();">
  105. <span class="page-link">{{label}}</span>
  106. </li>
  107. </ul>
  108. </div>
  109. </div>