get_subfield("900","a","l","n"); } function param_perso_form(&$p_perso) { global $dbh; global $param_perso_900; for($i=0;$iidchamp){ if($perso->type == 'list'){ $requete="select notices_custom_list_value from notices_custom_lists where notices_custom_list_lib='".addslashes($param_perso_900[$i]['a'])."' and notices_custom_champ=$perso->idchamp"; $resultat=pmb_mysql_query($requete); if (pmb_mysql_num_rows($resultat)) { $value=pmb_mysql_result($resultat,0,0); } else { $requete="select max(notices_custom_list_value*1) from notices_custom_lists where notices_custom_champ=$perso->idchamp"; $resultat=pmb_mysql_query($requete); $max=@pmb_mysql_result($resultat,0,0); $n=$max+1; $requete="insert into notices_custom_lists (notices_custom_champ,notices_custom_list_value,notices_custom_list_lib) values($perso->idchamp,$n,'".addslashes($param_perso_900[$i]['a'])."')"; pmb_mysql_query($requete); $value=$n; } $p_perso->values[$perso->idchamp][]=$value; } elseif($perso->type == 'date_box'){ $p_perso->values[$perso->idchamp][]=dateFrToMysql($param_perso_900[$i]['a']); } else { $p_perso->values[$perso->idchamp][]=$param_perso_900[$i]['a']; } } } } } function dateFrToMysql($value){ if(preg_match('`^(\d{2})\/(\d{2})\/(\d{4})$`',$value,$out)){ return $out[3]."-".$out[2]."-".$out[1]; }else{ return $value; } } // enregistrement de la notices dans les catégories function traite_categories_enreg($notice_retour, $categories, $thesaurus_traite = 0) { // si $thesaurus_traite fourni, on ne delete que les catégories de ce thesaurus, sinon on efface toutes // les indexations de la notice sans distinction de thesaurus if (empty($thesaurus_traite)) { $rqt_del = "delete from notices_categories where notcateg_notice='$notice_retour' "; } else { $rqt_del = "delete from notices_categories where notcateg_notice='$notice_retour' and num_noeud in (select id_noeud from noeuds where num_thesaurus='$thesaurus_traite' and id_noeud=notices_categories.num_noeud) "; } $res_del = @pmb_mysql_query($rqt_del); $rqt_ins = "insert into notices_categories (notcateg_notice, num_noeud, ordre_categorie) VALUES "; $nb_categories = count($categories); for ($i = 0; $i < $nb_categories; $i++) { $id_categ = $categories[$i]['categ_id']; if (!empty($id_categ)) { $rqt = $rqt_ins . " ('$notice_retour','$id_categ', $i) "; $res_ins = @pmb_mysql_query($rqt); } } } function traite_categories_for_form($tableau_600 = array(), $tableau_601 = array(), $tableau_602 = array(), $tableau_605 = array(), $tableau_606 = array(), $tableau_607 = array(), $tableau_608 = array()) { global $charset, $msg, $pmb_keyword_sep, $rameau; $rameau = "" ; $info_606_a = $tableau_606["info_606_a"] ; $info_606_j = $tableau_606["info_606_j"] ; $info_606_x = $tableau_606["info_606_x"] ; $info_606_y = $tableau_606["info_606_y"] ; $info_606_z = $tableau_606["info_606_z"] ; $champ_rameau=""; for ($a=0; $a "", "message" => htmlentities($msg['traite_categ_ignore'].$champ_rameau,ENT_QUOTES,$charset) ); } function traite_categories_from_form() { global $max_categ ; $categories = array () ; for ($i=0; $i< $max_categ ; $i++) { $var_categ = "f_categ_id$i" ; global ${$var_categ} ; if (${$var_categ}) $categories[] = array('categ_id' => ${$var_categ} ); } return $categories ; } function traite_concepts_for_form($tableau_606 = array()) { global $charset, $msg, $pmb_keyword_sep, $rameau; $rameau = "" ; $info_606_a = $tableau_606["info_606_a"] ; $info_606_j = $tableau_606["info_606_j"] ; $info_606_x = $tableau_606["info_606_x"] ; $info_606_y = $tableau_606["info_606_y"] ; $info_606_z = $tableau_606["info_606_z"] ; $champ_rameau=""; for ($a=0; $a "", "message" => htmlentities($champ_rameau,ENT_QUOTES,$charset) ); }