--------------------------------------------------------------------------------
Copyright (c) 2014 Kavarna SARL
*/
+?>
+
+<?php
+
+if (isset ($_REQUEST['go'])) {
+ $_SESSION['tripar'] = $_REQUEST['tripar'];
+ $_SESSION['filter_deb'] = $_REQUEST['events_date_debut'];
+ $_SESSION['filter_fin'] = $_REQUEST['events_date_fin'];
+ $_SESSION['nonread'] = $_REQUEST['nonread'] ? true : null;
+ $_SESSION['nottype'] = $_REQUEST['nottype'] != '' ? $_REQUEST['nottype'] : null;
+ header('Location: '.$_SERVER['REQUEST_URI']);
+ exit;
+}
+if (isset ($_REQUEST['reset'])) {
+ $_SESSION['tripar'] = 'not_date_evenement';
+ unset($_SESSION['nonread']);
+ unset($_SESSION['nottype']);
+ unset($_SESSION['filter_deb']);
+ unset($_SESSION['filter_fin']);
+ header('Location: '.$_SERVER['REQUEST_URI']);
+ exit;
+}
+
?>
<script type="text/javascript">
$(document).ready (function () {
function affiche_notes_reception () {
global $base;
// Page de pagination
+ echo '<form method="post" action="'.$_SERVER['REQUEST_URI'].'">';
+ echo '<fieldset><legend>Recherche</legend>';
$p = isset ($_GET['p']) ? $_GET['p'] : '1';
- $nnotes = $base->notes_note_boite_reception_liste ($_SESSION['token'], $base->count());
- $notes = $base->notes_note_boite_reception_liste ($_SESSION['token'], $base->order ('not_date_evenement', 'DESC'), $base->limit (NPAGES, ($p-1)*NPAGES));
+
+ if (!isset ($_SESSION['filter_deb'])) {
+ $_SESSION['filter_deb'] = date ('Y/m/d');
+ }
+ $startDate = $_SESSION['filter_deb'];
+ $endDate = arrval ($_SESSION, 'filter_fin');
+
+ echo '<div class="choix_vue" id="periode">';
+ echo '<h2>Période</h2>';
+ echo '<h3>Du </h3>';
+ echo '<input name="events_date_debut" type="text" size="9" class="datepicker" value="'.$startDate.'"/>';
+ echo '<br />';
+ echo '<h3>Au </h3>';
+ echo '<input name="events_date_fin" type="text" size="9" class="datepicker" value="'.$endDate.'"/>';
+ echo '</div>';
+
+ echo ' Tri par : <select name="tripar"><option value="not_date_evenement"'.(arrval ($_SESSION, 'tripar') == 'not_date_evenement' ? ' selected': '').'>Date de l\'événement</option><option value="not_date_saisie"'.(arrval ($_SESSION, 'tripar') == 'not_date_saisie' ? ' selected': '').'>Date de soumission</option></select>';
+ echo ' <label for="nonread">Non lues uniquement</label> <input name="nonread" id="nonread" type="checkbox" '.($_SESSION['nonread'] ? 'checked' : '').'>';
+ echo ' Type : <select name="nottype"><option value="">Toutes</option><option value="action"'.(arrval ($_SESSION, 'nottype') == 'action' ? ' selected': '').'>Pour action</option><option value="info"'.(arrval ($_SESSION, 'nottype') == 'info' ? ' selected': '').'>Pour information</option></select>';
+ echo '<input type="submit" name="go" value="OK"></input>';
+ echo '</fieldset>';
+ echo '</form><br/>';
+ $nnotes = $base->notes_note_boite_reception_liste ($_SESSION['token'], $startDate, $endDate, $_SESSION['nonread'], $_SESSION['nottype'], $base->count());
+ $notes = $base->notes_note_boite_reception_liste ($_SESSION['token'], $startDate, $endDate, $_SESSION['nonread'], $_SESSION['nottype'], $base->order ('not_date_evenement', 'DESC'), $base->limit (NPAGES, ($p-1)*NPAGES));
echo '<table width="100%" class="t1"><tr><th width="150">Date<br>Expéditeur</th><th width="70">Reçu pour</th><th width="150">Usagers</th><th>Note</th><th width="150">Autres destinataires</th></tr>';
$impair = true;
if ($note['not_objet']) {
echo '<strong>'.textprotect($note['not_objet']).'</strong><br>';
}
- echo textprotect($note['not_texte']);
+ echo '<pre>'.wordwrap (textprotect($note['not_texte'])).'</pre>';
echo '</td>';
echo '<td>';
if (is_array ($destinataires)) {