setting.notification.php 5.0 KB

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