titre = stripslashes($tit); $sug->editeur = stripslashes($edi); $sug->auteur = stripslashes($aut); $sug->code = stripslashes($cod); $sug->num_notice=$id_notice; $pri = str_replace(',','.',$pri); if (is_numeric($pri)) $sug->prix = $pri; $sug->url_suggestion = stripslashes($url_sug); $sug->commentaires = stripslashes($com); $sug->commentaires_gestion = stripslashes($com_gestion); $sug->nb=$nombre_expl; $sug->date_publi = $date_publi; $sug->sugg_src = $sug_src; $q = "select count(1) from docs_location where idlocation = '".$sugg_location_id."' "; $r = pmb_mysql_query($q); if ($sugg_location_id && pmb_mysql_result($r, 0, 0)) { $sug->sugg_location=$sugg_location_id; } else { $sug->sugg_location=0; } // chargement de la PJ $explnum_doc = ""; if($_FILES['piece_jointe_sug']['name']){ $explnum_doc = new explnum_doc(); $explnum_doc->load_file($_FILES['piece_jointe_sug']); $explnum_doc->analyse_file(); } if (!$id_sug) { $sug->statut = $sug_map->getFirstStateId(); $sug->date_creation = today(); if ($num_categ && suggestions_categ::exists($num_categ)) { $sug->num_categ=$num_categ; } else { $sug->num_categ='1'; } $sug->save($explnum_doc); $sug_orig = new suggestions_origine($orig, $sug->id_suggestion); $sug_orig->type_origine = $typ; $sug_orig->save(); } else { if ($num_categ && suggestions_categ::exists($num_categ)) { $sug->num_categ=$num_categ; } $sug->save($explnum_doc); if($creator_orig_id){ $sug_orig = new suggestions_origine($creator_orig_id, $sug->id_suggestion); $sug_orig->type_origine = $typ; $sug_orig->save(); } } } //Fusionne les suggestions cochées //En cours/Validées function sug_fusChk(){ global $dbh; global $msg, $charset; global $error; global $current_module; global $chk; global $bt_fusVal, $script; global $sug_map; $tab_enc = array(); $tab_val = array(); foreach($chk as $key=>$id_sug) { $sug = new suggestions($id_sug); $state_name = $sug_map->getStateNameFromId($sug->statut); $merge=$sug_map->getState_MERGE($state_name); if ($merge == 'FROM') $tab_enc[] = $sug; if ($merge == 'TO') $tab_val[] = $sug; } $titre = htmlentities($msg['acquisition_sug_fus'].' : '.$msg['acquisition_sug'], ENT_QUOTES, $charset); $action ="./acquisition.php?categ=sug&action=fusVal"; print "
"; print $script; } //Valide la fusion de suggestions function sug_fusVal(){ global $dbh; global $msg, $charset; global $chk, $sug; $fus = new suggestions($chk[0]); $q = suggestions_origine::listOccurences($chk[0], 1); $tab_orig = pmb_mysql_query($q, $dbh); $row_orig = pmb_mysql_fetch_object($tab_orig); $orig = $row_orig->origine; foreach($sug as $key=>$id_sug) { if ($id_sug != $chk[0]){ suggestions::delete($id_sug); suggestions_origine::fusionne($orig, $id_sug, $chk[0]); } } } //Recuperation du statut session d'affichage des suggestions function getSessionSugState() { global $deflt3sug_statut; if ((!isset($_SESSION['sug_statut']) || !$_SESSION['sug_statut']) && $deflt3sug_statut) { $_SESSION['sug_statut']=$deflt3sug_statut; } return $_SESSION['sug_statut']; } //Definition du statut session d'affichage des suggestions function setSessionSugState($statut) { $_SESSION['sug_statut']=$statut; return; } //Catalogue la notice à partir du blob unimarc function save_unimarc_notice(){ global $msg, $idbibli, $id_sug, $dbh; $req_uni = "select notice_unimarc from suggestions where id_suggestion='".$id_sug."'"; $res = pmb_mysql_query($req_uni,$dbh); if(pmb_mysql_num_rows($res)){ $notice_uni = pmb_mysql_result($res,0,0); } $z=new z3950_notice("form"); if($notice_uni) $z->notice = $notice_uni; $ret=$z->insert_in_database(); if ($ret[0]) { if($z->bull_id && $z->perio_id){ $notice_display=new serial_display($ret[1],6); } else $notice_display=new mono_display($ret[1],6); $retour = "