Subversion Repositories Applications.bazar

Rev

Rev 205 | Rev 250 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 205 Rev 225
Line 17... Line 17...
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: bazar.fonct.php,v 1.62 2007-03-08 15:12:13 jp_milcent Exp $
22
// CVS : $Id: bazar.fonct.php,v 1.63 2007-04-11 08:30:12 neiluj Exp $
23
/**
23
/**
24
*
24
*
25
* Fonctions du module bazar
25
* Fonctions du module bazar
26
* 
26
* 
27
*
27
*
Line 29... Line 29...
29
//Auteur original :
29
//Auteur original :
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
31
*@author        Florian Schmitt <florian@ecole-et-nature.org>
31
*@author        Florian Schmitt <florian@ecole-et-nature.org>
32
//Autres auteurs :
32
//Autres auteurs :
33
*@copyright     Tela-Botanica 2000-2004
33
*@copyright     Tela-Botanica 2000-2004
34
*@version       $Revision: 1.62 $ $Date: 2007-03-08 15:12:13 $
34
*@version       $Revision: 1.63 $ $Date: 2007-04-11 08:30:12 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
Line 37... Line 37...
37
 
37
 
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
Line 416... Line 416...
416
					                     '<a href='.$lien_passer_redacteur->getURL().'>'.BAZ_DROIT_REDACTEUR.'</a>',
416
					                     '<a href='.$lien_passer_redacteur->getURL().'>'.BAZ_DROIT_REDACTEUR.'</a>',
417
							     '<a href='.$lien_passer_admin->getURL().'>'.BAZ_DROIT_ADMIN.'</a>'));
417
							     '<a href='.$lien_passer_admin->getURL().'>'.BAZ_DROIT_ADMIN.'</a>'));
Line 418... Line 418...
418
					
418
					
419
				}
419
				}
-
 
420
			}
420
			}
421
			
421
			$table->altRowAttributes(1, array('class' => 'ligne_impaire'), array('class' => 'ligne_paire'));
422
			$table->altRowAttributes(1, array('class' => 'ligne_impaire'), array('class' => 'ligne_paire'));
422
			$table->updateColAttributes(0, array('align' => 'left'));
423
			$table->updateColAttributes(0, array('align' => 'left'));
423
			$table->updateColAttributes(1, array('align' => 'left'));
424
			$table->updateColAttributes(1, array('align' => 'left'));
424
			$table->updateColAttributes(2, array('align' => 'left'));
425
			$table->updateColAttributes(2, array('align' => 'left'));
Line 553... Line 554...
553
		//AFFICHAGE DU FORMULAIRE CORRESPONDANT AU TYPE DE L'ANNONCE CHOISI PAR L'UTILISATEUR
554
		//AFFICHAGE DU FORMULAIRE CORRESPONDANT AU TYPE DE L'ANNONCE CHOISI PAR L'UTILISATEUR
554
		//------------------------------------------------------------------------------------------------
555
		//------------------------------------------------------------------------------------------------
555
		if ($mode == BAZ_ACTION_NOUVEAU) {
556
		if ($mode == BAZ_ACTION_NOUVEAU) {
556
			unset ($_SESSION['formulaire_annonce_valide']) ;
557
			unset ($_SESSION['formulaire_annonce_valide']) ;
557
			$lien_formulaire->addQueryString('action', BAZ_ACTION_NOUVEAU_V);
558
			$lien_formulaire->addQueryString('action', BAZ_ACTION_NOUVEAU_V);
558
			$formtemplate->updateAttributes(array('action' => str_replace('&amp;', '&', $lien_formulaire->getURL())));	
559
			$formtemplate->updateAttributes(array('action' => str_replace('&amp;', '&', $lien_formulaire->getURL())));
-
 
560
 
559
			$res = baz_afficher_formulaire_annonce('insertion',$formtemplate);	
561
			$res = baz_afficher_formulaire_annonce('insertion',$formtemplate);	
560
		}
562
		}
Line 561... Line 563...
561
	
563
	
562
		//------------------------------------------------------------------------------------------------
564
		//------------------------------------------------------------------------------------------------
Line 606... Line 608...
606
                        <input type="password" id="password" name="password" maxlength="80" tabindex="2" value="mot de passe" />                    
608
                        <input type="password" id="password" name="password" maxlength="80" tabindex="2" value="mot de passe" />                    
607
                        <input type="submit" id="connexion" name="connexion" tabindex="3" value="ok" />                    
609
                        <input type="submit" id="connexion" name="connexion" tabindex="3" value="ok" />                    
608
                </fieldset>
610
                </fieldset>
609
                </form>';
611
                </form>';
610
	}
612
	}
-
 
613
 
611
	return $res;
614
	return $res;
612
}
615
}
Line 613... Line 616...
613
 
616
 
614
/** baz_afficher_formulaire_annonce() - Genere le formulaire de saisie d'une annonce
617
/** baz_afficher_formulaire_annonce() - Genere le formulaire de saisie d'une annonce
Line 746... Line 749...
746
				$requete .= baz_insertion_image($GLOBALS['_BAZAR_']['id_fiche']);
749
				$requete .= baz_insertion_image($GLOBALS['_BAZAR_']['id_fiche']);
747
			}
750
			}
748
		}
751
		}
749
		//cas des dates
752
		//cas des dates
750
		elseif ( $tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin' ) {
753
		elseif ( $tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin' ) {
-
 
754
			
-
 
755
			// On construit la date selon le format YYYY-mm-dd
-
 
756
			$date = $valeur[$tableau[$i]['nom_bdd']]['Y'].'-'.$valeur[$tableau[$i]['nom_bdd']]['m'].'-'.$valeur[$tableau[$i]['nom_bdd']]['d'] ;
-
 
757
			
-
 
758
			// si la date de fin evenement est anterieure a la date de debut, on met la date de debut
-
 
759
			// pour eviter les incoherence
-
 
760
			
-
 
761
			if ($tableau[$i]['nom_bdd'] == 'bf_date_fin_evenement' &&
-
 
762
					mktime(0,0,0, $valeur['bf_date_debut_evenement']['m'], $valeur['bf_date_debut_evenement']['d'], $valeur['bf_date_debut_evenement']['Y']) >
-
 
763
					mktime(0,0,0, $valeur['bf_date_fin_evenement']['m'], $valeur['bf_date_fin_evenement']['d'], $valeur['bf_date_fin_evenement']['Y'])) {
-
 
764
				$val = $valeur['bf_date_debut_evenement']['Y'].'-'.$valeur['bf_date_debut_evenement']['m'].'-'.$valeur['bf_date_debut_evenement']['d'] ;
-
 
765
			} else {
751
			$val=$valeur[$tableau[$i]['nom_bdd']]['Y'].'-'.$valeur[$tableau[$i]['nom_bdd']]['m'].'-'.$valeur[$tableau[$i]['nom_bdd']]['d'] ;
766
				$val = $valeur[$tableau[$i]['nom_bdd']]['Y'].'-'.$valeur[$tableau[$i]['nom_bdd']]['m'].'-'.$valeur[$tableau[$i]['nom_bdd']]['d'] ;
-
 
767
			}
752
			$requete .= $tableau[$i]['nom_bdd'].'="'.$val.'", ' ;					
768
			$requete .= $tableau[$i]['nom_bdd'].'="'.$val.'", ' ;					
753
		}
769
		}
754
		//cas des champs texte
770
		//cas des champs texte
755
		elseif ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' ) {
771
		elseif ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' ) {
756
			//on mets les slashes pour les saisies dans les champs texte et textearea
772
			//on mets les slashes pour les saisies dans les champs texte et textearea
Line 1276... Line 1292...
1276
}
1292
}
Line 1277... Line 1293...
1277
 
1293
 
1278
/* +--Fin du code ----------------------------------------------------------------------------------------+
1294
/* +--Fin du code ----------------------------------------------------------------------------------------+
1279
*
1295
*
-
 
1296
* $Log: not supported by cvs2svn $
-
 
1297
* Revision 1.57.2.12  2007/03/16 14:49:24  alexandre_tb
-
 
1298
* si la date de debut d evenement est superieure a la date de fin alors on met
-
 
1299
* la meme date dans les deux champs (coherence)
1280
* $Log: not supported by cvs2svn $
1300
*
1281
* Revision 1.57.2.11  2007/03/07 17:40:57  jp_milcent
1301
* Revision 1.57.2.11  2007/03/07 17:40:57  jp_milcent
1282
* Ajout d'id sur les colonnes et gestion par les CSS des styles du tableau des abonnements.
1302
* Ajout d'id sur les colonnes et gestion par les CSS des styles du tableau des abonnements.
1283
*
1303
*
1284
* Revision 1.57.2.10  2007/03/07 17:20:19  jp_milcent
1304
* Revision 1.57.2.10  2007/03/07 17:20:19  jp_milcent
Line 1291... Line 1311...
1291
* Suppression de l'appel à Mes_Fiches dans la fonction baz_formulaire
1311
* Suppression de l'appel à Mes_Fiches dans la fonction baz_formulaire
1292
*
1312
*
1293
* Revision 1.57.2.7  2007/03/05 10:28:03  alexandre_tb
1313
* Revision 1.57.2.7  2007/03/05 10:28:03  alexandre_tb
1294
* correction d un commentaire
1314
* correction d un commentaire
1295
*
1315
*
1296
* Revision 1.61  2007/02/28 10:23:46  alexandre_tb
-
 
1297
* backport de bug depuis menes
-
 
1298
*
-
 
1299
* Revision 1.60  2007/02/15 14:18:38  jp_milcent
-
 
1300
* Fusion avec la livraison Menes : 15 février 2007
-
 
1301
*
-
 
1302
* Revision 1.59  2007/01/22 16:05:56  alexandre_tb
-
 
1303
* backport : insertion de la date du jour dans bf_date_debut_validite_fiche quand il n'y a pas ce champs dans le formulaire (évite le 0000-00-00)
-
 
1304
*
-
 
1305
* Revision 1.57.2.6  2007/02/15 13:42:16  jp_milcent
1316
* Revision 1.57.2.6  2007/02/15 13:42:16  jp_milcent
1306
* Utilisation de IN à la place du = dans les requêtes traitant les catégories de fiches.
1317
* Utilisation de IN à la place du = dans les requêtes traitant les catégories de fiches.
1307
* Permet d'utiliser la syntaxe 1,2,3 dans la configuration de categorie_nature.
1318
* Permet d'utiliser la syntaxe 1,2,3 dans la configuration de categorie_nature.
1308
*
1319
*
1309
* Revision 1.57.2.5  2007/02/12 16:16:31  alexandre_tb
1320
* Revision 1.57.2.5  2007/02/12 16:16:31  alexandre_tb