Update of /home/spip-cvs/spip
In directory alan:/tmp/cvs-serv11828
Modified Files:
inc-criteres.php3
Log Message:
Finalement rédiger de la doc c'est pas mal: ça donne des idées pour améliorer l'interface
Index: inc-criteres.php3
RCS file: /home/spip-cvs/spip/inc-criteres.php3,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -d -r1.90 -r1.91
--- inc-criteres.php3 21 Jul 2005 15:37:56 -0000 1.90
+++ inc-criteres.php3 24 Jul 2005 13:44:33 -0000 1.91
@@ -287,16 +287,30 @@
function critere_agenda($idb, &$boucles, $crit)
{
$params = $crit->param;
- $args = array();
+ $parent = $boucles[$idb]->id_parent;
+
// les valeur $date et $type doivent etre connus à la compilation
// autrement dit ne pas être des champs
- foreach ($params as $tri) {
- if ($tri[0]->type != 'texte')
- $args[] = calculer_liste($tri, array(), $boucles, $boucles[$idb]->id_parent);
- else
- $args[] = $tri[0]->texte;
- }
- list($date, $annee, $mois, $jour, $type) = $args;
+ $date = array_shift($params);
+ $date = $date[0]->texte;
+
+ $annee = array_shift($params);
+ $annee = "\n" . '((($x = ' .
+ calculer_liste($annee, array(), $boucles, $parent) .
+ ') !== "") ? $x : date("Y"))';
+
+ $mois = array_shift($params);
+ $mois = "\n" . '(($x = ' .
+ calculer_liste($mois, array(), $boucles, $parent) .
+ ') ? $x : date("m"))';
+
+ $jour = array_shift($params);
+ $jour = "\n" . '(($x = ' .
+ calculer_liste($jour, array(), $boucles, $parent) .
+ ') ? $x : date("d"))';
+
+ $type = array_shift($params);
+ $type = $type[0]->texte;
$boucle = &$boucles[$idb];
$date = $boucle->id_table . ".$date";
@@ -415,6 +429,7 @@
$op = $crit->op;
$col = array_shift($params);
+
$col = $col[0]->texte;
// fonction SQL ?
if (ereg("([A-Za-z_]+)\(([a-z_]+)\)", $col,$match3)) {