Subversion Repositories Applications.bazar

Compare Revisions

Ignore whitespace Rev 102 → Rev 103

/trunk/bibliotheque/bazar.fonct.php
19,7 → 19,7
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: bazar.fonct.php,v 1.40 2006-02-06 09:33:00 alexandre_tb Exp $
// CVS : $Id: bazar.fonct.php,v 1.41 2006-03-01 16:05:51 florian Exp $
/**
*
* Fonctions du module bazar
31,7 → 31,7
*@author Florian Schmitt <florian@ecole-et-nature.org>
//Autres auteurs :
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.40 $ $Date: 2006-02-06 09:33:00 $
*@version $Revision: 1.41 $ $Date: 2006-03-01 16:05:51 $
// +------------------------------------------------------------------------------------------------------+
*/
 
534,7 → 534,7
}
}
}
else return BAZ_IDENTIFIEZ_VOUS_POUR_SAISIR;
else $res .= BAZ_IDENTIFIEZ_VOUS_POUR_SAISIR;
return $res;
}
 
804,12 → 804,20
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
}
}
//cas des fichiers
elseif ($tableau[$i]['type']=='fichier') {
baz_insertion_fichier($valeur['texte_fichier'.$tableau[$i]['nom_bdd']], $GLOBALS['_BAZAR_']['id_fiche'], 'fichier'.$tableau[$i]['nom_bdd']);
}
//cas des urls
elseif ($tableau[$i]['type']=='url') {
baz_insertion_url($valeur['url_texte'.$tableau[$i]['nom_bdd']], $valeur['url_lien'.$tableau[$i]['nom_bdd']], $GLOBALS['_BAZAR_']['id_fiche']);
}
else {
//cas des dates
if (($tableau[$i]['type']=='listedatedeb')or($tableau[$i]['type']=='listedatefin')) {
$val=$valeur[$tableau[$i]['nom_bdd']]['Y'].'-'.$valeur[$tableau[$i]['nom_bdd']]['m'].'-'.$valeur[$tableau[$i]['nom_bdd']]['d'] ;
}
else {
elseif (($tableau[$i]['type']=='texte')or($tableau[$i]['type']=='textelong')) {
//on mets les slashes pour les saisies dans les champs texte et textearea
$val=addslashes($valeur[$tableau[$i]['nom_bdd']]) ;
}
874,21 → 882,21
* @global integer L'identifiant de la fiche
* @return void
*/
function baz_insertion_fichier($fichier_description, $idfiche) {
function baz_insertion_fichier($fichier_description, $idfiche, $nom_fichier='fichier_joint') {
//verification de la presence de ce fichier
$requete = 'SELECT bfj_id_fichier FROM bazar_fichier_joint WHERE bfj_fichier="'.$_FILES['fichier_joint']['name'].'"';
$requete = 'SELECT bfj_id_fichier FROM bazar_fichier_joint WHERE bfj_fichier="'.$_FILES[$nom_fichier]['name'].'"';
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
if (DB::isError($resultat)) {
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
}
if ($resultat->numRows()==0) {
$chemin_destination=BAZ_CHEMIN_APPLI.'upload/'.$_FILES['fichier_joint']['name'];
move_uploaded_file($_FILES['fichier_joint']['tmp_name'], $chemin_destination);
$chemin_destination=BAZ_CHEMIN_APPLI.'upload/'.$_FILES[$nom_fichier]['name'];
move_uploaded_file($_FILES[$nom_fichier]['tmp_name'], $chemin_destination);
}
else echo BAZ_FICHIER_EXISTANT;
//else echo BAZ_FICHIER_EXISTANT;
$id_fichier_joint = baz_nextId('bazar_fichier_joint', 'bfj_id_fichier', $GLOBALS['_BAZAR_']['db']) ;
$requete = 'INSERT INTO bazar_fichier_joint SET bfj_id_fichier='.$id_fichier_joint.', bfj_ce_fiche='.$idfiche.
', bfj_description="'.addslashes($fichier_description).'", bfj_fichier="'.$_FILES['fichier_joint']['name'].'"';
', bfj_description="'.addslashes($fichier_description).'", bfj_fichier="'.$_FILES[$nom_fichier]['name'].'"';
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
if (DB::isError($resultat)) {
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
1296,6 → 1304,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.40 2006/02/06 09:33:00 alexandre_tb
* correction de bug
*
* Revision 1.39 2006/01/30 17:25:38 alexandre_tb
* correction de bugs
*