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.63 2007-04-11 08:30:12 neiluj Exp $
|
22 |
// CVS : $Id: bazar.fonct.php,v 1.64 2007-06-04 15:25:39 alexandre_tb 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.63 $ $Date: 2007-04-11 08:30:12 $
|
34 |
*@version $Revision: 1.64 $ $Date: 2007-06-04 15:25:39 $
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
36 |
*/
|
36 |
*/
|
Line 37... |
Line 37... |
37 |
|
37 |
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
Line 660... |
Line 660... |
660 |
if ( $tableau[$i]['type']=='liste' || $tableau[$i]['type']=='checkbox' ) {
|
660 |
if ( $tableau[$i]['type']=='liste' || $tableau[$i]['type']=='checkbox' ) {
|
661 |
$def=$tableau[$i]['type'].$tableau[$i]['nom_bdd'];
|
661 |
$def=$tableau[$i]['type'].$tableau[$i]['nom_bdd'];
|
662 |
}
|
662 |
}
|
663 |
elseif ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' || $tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin' ) {
|
663 |
elseif ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' || $tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin' ) {
|
664 |
$def=$tableau[$i]['nom_bdd'];
|
664 |
$def=$tableau[$i]['nom_bdd'];
|
- |
|
665 |
} elseif ($tableau[$i]['type']=='carte_google') {
|
- |
|
666 |
$def = 'carte_google';
|
- |
|
667 |
$valeurs_par_defaut[$def] = array ('latitude' => $valeurs_par_defaut['bf_latitude'], 'longitude' => $valeurs_par_defaut['bf_longitude']);
|
665 |
}
|
668 |
}
|
666 |
$tableau[$i]['type']($formtemplate, $tableau[$i]['nom_bdd'], $tableau[$i]['label'], $tableau[$i]['limite1'],
|
669 |
$tableau[$i]['type']($formtemplate, $tableau[$i]['nom_bdd'], $tableau[$i]['label'], $tableau[$i]['limite1'],
|
667 |
$tableau[$i]['limite2'], $valeurs_par_defaut[$def], $tableau[$i]['table_source'], $tableau[$i]['obligatoire']) ;
|
670 |
$tableau[$i]['limite2'], $valeurs_par_defaut[$def], $tableau[$i]['table_source'], $tableau[$i]['obligatoire']) ;
|
668 |
}
|
671 |
}
|
669 |
}
|
672 |
}
|
Line 783... |
Line 786... |
783 |
$titre=baz_titre_wiki($valeur["bf_titre"]);
|
786 |
$titre=baz_titre_wiki($valeur["bf_titre"]);
|
784 |
//création du wiki
|
787 |
//création du wiki
|
785 |
$valeur=array ("action"=> "nouveau_v", "code_alpha_wikini"=>$titre, "page"=>"AccueiL", "bdd_hote"=> "",
|
788 |
$valeur=array ("action"=> "nouveau_v", "code_alpha_wikini"=>$titre, "page"=>"AccueiL", "bdd_hote"=> "",
|
786 |
"bdd_nom"=> "", "bdd_utilisateur"=> "", "bdd_mdp" => "", "table_prefix"=> "", "chemin" => "wikini/".$titre, "valider"=> "Valider");
|
789 |
"bdd_nom"=> "", "bdd_utilisateur"=> "", "bdd_mdp" => "", "table_prefix"=> "", "chemin" => "wikini/".$titre, "valider"=> "Valider");
|
787 |
$val = insertion($valeur, $GLOBALS['_BAZAR_']['db']);
|
790 |
$val = insertion($valeur, $GLOBALS['_BAZAR_']['db']);
|
788 |
}
|
791 |
}
|
- |
|
792 |
// Cas de la carte google
|
- |
|
793 |
elseif ($tableau[$i]['type'] == 'carte_google') {
|
- |
|
794 |
$requete .= 'bf_latitude="'.$valeur['latitude'].'", bf_longitude="'.$valeur['longitude'].'",';
|
- |
|
795 |
}
|
789 |
}
|
796 |
}
|
790 |
$requete.=' bf_date_maj_fiche=NOW()';
|
797 |
$requete.=' bf_date_maj_fiche=NOW()';
|
791 |
return $requete;
|
798 |
return $requete;
|
792 |
}
|
799 |
}
|
Line 852... |
Line 859... |
852 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
859 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
853 |
}
|
860 |
}
|
854 |
if ($resultat->numRows()==0) {
|
861 |
if ($resultat->numRows()==0) {
|
855 |
$chemin_destination=BAZ_CHEMIN_APPLI.'upload/'.$_FILES[$nom_fichier]['name'];
|
862 |
$chemin_destination=BAZ_CHEMIN_APPLI.'upload/'.$_FILES[$nom_fichier]['name'];
|
856 |
move_uploaded_file($_FILES[$nom_fichier]['tmp_name'], $chemin_destination);
|
863 |
move_uploaded_file($_FILES[$nom_fichier]['tmp_name'], $chemin_destination);
|
- |
|
864 |
chmod ($chemin_destination, 0755);
|
857 |
}
|
865 |
}
|
858 |
$id_fichier_joint = baz_nextId('bazar_fichier_joint', 'bfj_id_fichier', $GLOBALS['_BAZAR_']['db']) ;
|
866 |
$id_fichier_joint = baz_nextId('bazar_fichier_joint', 'bfj_id_fichier', $GLOBALS['_BAZAR_']['db']) ;
|
859 |
$requete = 'INSERT INTO bazar_fichier_joint SET bfj_id_fichier='.$id_fichier_joint.', bfj_ce_fiche='.$idfiche.
|
867 |
$requete = 'INSERT INTO bazar_fichier_joint SET bfj_id_fichier='.$id_fichier_joint.', bfj_ce_fiche='.$idfiche.
|
860 |
', bfj_description="'.addslashes($fichier_description).'", bfj_fichier="'.$_FILES[$nom_fichier]['name'].'"';
|
868 |
', bfj_description="'.addslashes($fichier_description).'", bfj_fichier="'.$_FILES[$nom_fichier]['name'].'"';
|
861 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
869 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
Line 879... |
Line 887... |
879 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
887 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
880 |
}
|
888 |
}
|
881 |
if ($resultat->numRows()==0) {
|
889 |
if ($resultat->numRows()==0) {
|
882 |
$chemin_destination=BAZ_CHEMIN_APPLI.'upload/'.$_FILES['image']['name'];
|
890 |
$chemin_destination=BAZ_CHEMIN_APPLI.'upload/'.$_FILES['image']['name'];
|
883 |
move_uploaded_file($_FILES['image']['tmp_name'], $chemin_destination);
|
891 |
move_uploaded_file($_FILES['image']['tmp_name'], $chemin_destination);
|
- |
|
892 |
chmod ($chemin_destination, 0755);
|
884 |
}
|
893 |
}
|
885 |
return 'bf_url_image="'.$_FILES['image']['name'].'", ' ;
|
894 |
return 'bf_url_image="'.$_FILES['image']['name'].'", ' ;
|
886 |
}
|
895 |
}
|
Line 1207... |
Line 1216... |
1207 |
}
|
1216 |
}
|
1208 |
$valeurs_fiche[$tableau[$i]['type'].$tableau[$i]['nom_bdd']] = $val;
|
1217 |
$valeurs_fiche[$tableau[$i]['type'].$tableau[$i]['nom_bdd']] = $val;
|
1209 |
}
|
1218 |
}
|
1210 |
elseif ($tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' || $tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin') {
|
1219 |
elseif ($tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' || $tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin') {
|
1211 |
$valeurs_fiche[$tableau[$i]['nom_bdd']] = stripslashes($ligne[$tableau[$i]['nom_bdd']]);
|
1220 |
$valeurs_fiche[$tableau[$i]['nom_bdd']] = stripslashes($ligne[$tableau[$i]['nom_bdd']]);
|
- |
|
1221 |
} elseif ($tableau[$i]['type']=='carte_google') {
|
- |
|
1222 |
$valeurs_fiche['bf_latitude'] = $ligne['bf_latitude'];
|
- |
|
1223 |
$valeurs_fiche['bf_longitude'] = $ligne['bf_longitude'];
|
1212 |
}
|
1224 |
}
|
1213 |
}
|
1225 |
}
|
1214 |
return $valeurs_fiche;
|
1226 |
return $valeurs_fiche;
|
1215 |
}
|
1227 |
}
|
Line 1292... |
Line 1304... |
1292 |
}
|
1304 |
}
|
Line 1293... |
Line 1305... |
1293 |
|
1305 |
|
1294 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
1306 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
1295 |
*
|
1307 |
*
|
- |
|
1308 |
* $Log: not supported by cvs2svn $
|
- |
|
1309 |
* Revision 1.63 2007/04/11 08:30:12 neiluj
|
- |
|
1310 |
* remise en état du CVS...
|
1296 |
* $Log: not supported by cvs2svn $
|
1311 |
*
|
1297 |
* Revision 1.57.2.12 2007/03/16 14:49:24 alexandre_tb
|
1312 |
* 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
|
1313 |
* 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)
|
1314 |
* la meme date dans les deux champs (coherence)
|
1300 |
*
|
1315 |
*
|