modules/axletter.php | 17 -----------------
modules/events.php | 16 ----------------
modules/xnetgrp.php | 16 ----------------
templates/axletter/edit.tpl | 2 +-
templates/events/form.tpl | 4 +---
templates/xnetgrp/announce-edit.tpl | 4 +---
6 files changed, 3 insertions(+), 56 deletions(-)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1700
839d8a87-29fc-0310-9880-
83ba4fa771e5
if (!$saved) {
$select = '';
- $time = time() + 3600 * 24 * 2;
- for ($i = 0 ; $i < 15 ; $i++) {
- $time += 3600 * 24;
- $p_stamp = date('Ymd', $time);
- $year = date('Y', $time);
- $month = date('m', $time);
- $day = date('d', $time);
-
- if ($p_stamp == $echeance_date) {
- $sel = ' selected="selected"';
- } else {
- $sel = '';
- }
- $select .= "<option value=\"$p_stamp\"$sel> $day / $month / $year</option>\n";
- }
- $page->assign('echeance_date', $select);
- $select = '';
for ($i = 0 ; $i < 24 ; $i++) {
$stamp = sprintf('%02d:00:00', $i);
if ($stamp == $echeance_time) {
} elseif (!Env::v('preview')) {
$upload->rm();
}
-
- $select = '';
- for ($i = 1 ; $i < 30 ; $i++) {
- $time = time() + 3600 * 24 * $i;
- $p_stamp = date('Ymd', $time);
- $year = date('Y', $time);
- $month = date('m', $time);
- $day = date('d', $time);
-
- $select .= "<option value=\"$p_stamp\"";
- if ($p_stamp == strtr($peremption, array("-" => ""))) {
- $select .= " selected='selected'";
- }
- $select .= "> $day / $month / $year</option>\n";
- }
- $page->assign('select',$select);
}
function handler_tips(&$page, $tips = null)
}
}
- $select = '';
- for ($i = 1 ; $i < 30 ; $i++) {
- $time = time() + 3600 * 24 * $i;
- $p_stamp = date('Ymd', $time);
- $year = date('Y', $time);
- $month = date('m', $time);
- $day = date('d', $time);
-
- $select .= "<option value=\"$p_stamp\"";
- if ($p_stamp == strtr(@$art['peremption'], array("-" => ""))) {
- $select .= " selected='selected'";
- }
- $select .= "> $day / $month / $year</option>\n";
- }
- $page->assign('select', $select);
-
if (is_null($aid)) {
$events = XDB::iterator("SELECT *
FROM groupex.evenements
--- /dev/null
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2007 Polytechnique.org *
+ * http://opensource.polytechnique.org/ *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+ ***************************************************************************/
+require_once 'platal.inc.php';
+
+function smarty_function_valid_date($params, &$smarty)
+{
+ extract($params);
+
+ if (!isset($name)) {
+ $name = 'valid_date';
+ }
+ $text = "<select name=\"$name\">";
+ if (!isset($from)) {
+ $from = 1;
+ }
+ if (!isset($to)) {
+ $to = 30;
+ }
+ $value = strtr($value, array('-' => ''));
+ $time = time() + 3600 * 24 * $from;
+ $mth = '';
+ for ($i = $from ; $i <= $to ; $i++) {
+ $p_stamp = date('Ymd', $time);
+ $date = date('d / m / Y', $time);
+ $select = ($p_stamp == $value) ? 'selected="selected"' : '';
+ $month = pl_entities(strftime('%B', $time), ENT_QUOTES);
+ if ($mth != $month) {
+ if ($i != $from) {
+ $text .= '</optgroup>';
+ }
+ $text .= "<optgroup label=\"$month\">";
+ $mth = $month;
+ }
+ $time += 3600 * 24;
+ $text .= "<option value=\"$p_stamp\" $select>$date</option>";
+ }
+ return $text . "</optgroup></select>";
+}
+
+/* vim: set expandtab enc=utf-8: */
+?>
<tr>
<td class="titre">Echéance d'envoi</td>
<td>
- le <select name="echeance_date">{$echeance_date|smarty:nodefaults}</select>
+ le {valid_date name="echeance_date" value=$echeance_date from=3 to=15}
vers <select name="echeance_time">{$echeance_time|smarty:nodefaults}</select>
</td>
</tr>
Dernier jour d'affichage
</td>
<td>
- <select name="peremption">
- {$select|smarty:nodefaults}
- </select>
+ {valid_date name="peremption" value=$peremption}
</td>
</tr>
{if $admin_evts}
<tr>
<td class="titre">Date de péremption :</td>
<td>
- <select name="peremption">
- {$select|smarty:nodefaults}
- </select>
+ {valid_date name="peremption" value=$art.peremption}
</td>
</tr>
{if $events}