if ($_FILES['piece_jointe_sug']['name']) { $explnum_doc = new explnum_doc(); $explnum_doc->load_file($_FILES['piece_jointe_sug']); $explnum_doc->analyse_file(); } if ($opac_sugg_categ == '1') { if (!suggestions_categ::exists($num_categ)) { $num_categ = $opac_sugg_categ_default; } if (!suggestions_categ::exists($num_categ)) { $num_categ = '1'; } $su->num_categ = $num_categ; } $su->sugg_location = $sugg_location_id; $su->save($explnum_doc); $orig = new suggestions_origine($userid, $su->id_suggestion); $orig->type_origine = $type; $orig->save(); //Ré-affichage de la suggestion $sug_form .= "\n\t\t<table width='60%' cellpadding='5'>\n\t\t\t<tr>\n\t\t\t\t<td >" . htmlentities($msg["empr_sugg_tit"], ENT_QUOTES, $charset) . "</td>\n\t\t\t\t<td>" . htmlentities($su->titre, ENT_QUOTES, $charset) . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td >" . htmlentities($msg["empr_sugg_aut"], ENT_QUOTES, $charset) . "</td>\n\t\t\t\t<td>" . htmlentities($su->auteur, ENT_QUOTES, $charset) . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td >" . htmlentities($msg["empr_sugg_edi"], ENT_QUOTES, $charset) . "</td>\n\t\t\t\t<td>" . htmlentities($su->editeur, ENT_QUOTES, $charset) . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td >" . htmlentities($msg["empr_sugg_code"], ENT_QUOTES, $charset) . "</td>\n\t\t\t\t<td>" . htmlentities($su->code, ENT_QUOTES, $charset) . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td >" . htmlentities($msg["empr_sugg_prix"], ENT_QUOTES, $charset) . "</td>\n\t\t\t\t<td>" . htmlentities($su->prix, ENT_QUOTES, $charset) . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td >" . htmlentities($msg['empr_sugg_url'], ENT_QUOTES, $charset) . "</td>\n\t\t\t\t<td>" . htmlentities($su->url_suggestion, ENT_QUOTES, $charset) . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . htmlentities($msg['empr_sugg_comment'], ENT_QUOTES, $charset) . "</td>\n\t\t\t\t<td>" . htmlentities($su->commentaires, ENT_QUOTES, $charset) . "</td>\n\t\t\t</tr>"; if (!$_SESSION["id_empr_session"]) { $sug_form .= "\n\t\t\t<tr>\n\t\t\t\t<td >" . htmlentities($msg["empr_sugg_mail"], ENT_QUOTES, $charset) . "</td>\n\t\t\t\t<td>" . htmlentities($mail, ENT_QUOTES, $charset) . "</td>\n\t\t\t</tr>"; } if ($opac_sugg_categ == '1') { $categ = new suggestions_categ($su->num_categ); $sug_form .= "\n\t\t\t<tr>\n\t\t\t\t<td >" . htmlentities($msg['acquisition_categ'], ENT_QUOTES, $charset) . "</td>\n\t\t\t\t<td>" . htmlentities($categ->libelle_categ, ENT_QUOTES, $charset) . "</td>\n\t\t\t</tr>"; } $sug_form .= "\n\t\t<tr>\n\t\t\t<td >" . htmlentities($msg["empr_sugg_datepubli"], ENT_QUOTES, $charset) . "</td>\n\t\t\t<td>" . htmlentities($su->date_publi, ENT_QUOTES, $charset) . "</td>\n\t\t</tr>"; $sug_form .= "\n\t\t<tr>\n\t\t\t<td >" . htmlentities($msg["empr_sugg_qte"], ENT_QUOTES, $charset) . "</td>\n\t\t\t<td>" . htmlentities($su->nb, ENT_QUOTES, $charset) . "</td>\n\t\t</tr>"; $source = new suggestion_source($su->sugg_src);
function update_sug() { global $id_bibli, $id_sug, $id_notice; global $tit, $edi, $aut, $cod, $pri, $com, $com_gestion, $date_publi; global $statut, $orig, $typ, $url_sug, $sug_src; global $sug_map; global $acquisition_sugg_categ, $acquisition_sugg_categ_default; global $num_categ; global $sugg_location_id; global $nombre_expl; global $creator_orig_id; global $dbh; if (!$id_sug && suggestions::exists($orig, $tit, $aut, $edi, $cod)) { return; } $sug = new suggestions($id_sug); $sug->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 = mysql_query($q); if ($sugg_location_id && 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(); } } }
function edit_suggestion($session_id, $suggestion) { global $dbh, $msg; if (!$session_id) { return FALSE; } $session_info = $this->retrieve_session_information($session_id); $empr_id = $session_info["empr_id"]; if (!$empr_id) { return 0; } $id = $suggestion['sugg_id'] + 0; if (!$id) { return FALSE; } $exists = suggestions_origine::exists($empr_id, $id, 1); if (!$exists) { return FALSE; } $title = $suggestion['sugg_title']; $author = $suggestion['sugg_author']; $editor = $suggestion['sugg_editor']; $isbn_or_ean = $suggestion['sugg_barcode']; $price = $suggestion['sugg_price']; $url = $suggestion['sugg_url']; $comment = $suggestion['sugg_comment']; $sugg_categ = $suggestion['sugg_category']; $sugg_source = $suggestion['sugg_source']; $sugg_location = $suggestion['sugg_location']; global $charset; if ($this->proxy_parent->input_charset != 'utf-8' && $charset == 'utf-8') { $title = utf8_encode($suggestion['sugg_title']); $author = utf8_encode($suggestion['sugg_author']); $editor = utf8_encode($suggestion['sugg_editor']); $isbn_or_ean = utf8_encode($suggestion['sugg_barcode']); $price = utf8_encode($suggestion['sugg_price']); $url = utf8_encode($suggestion['sugg_url']); $comment = utf8_encode($suggestion['sugg_comment']); $sugg_categ = utf8_encode($suggestion['sugg_category']); $sugg_source = utf8_encode($suggestion['sugg_source']); $sugg_location = utf8_encode($suggestion['sugg_location']); } else { if ($this->proxy_parent->input_charset == 'utf-8' && $charset != 'utf-8') { $title = utf8_decode($suggestion['sugg_title']); $author = utf8_decode($suggestion['sugg_author']); $editor = utf8_decode($suggestion['sugg_editor']); $isbn_or_ean = utf8_decode($suggestion['sugg_barcode']); $price = utf8_decode($suggestion['sugg_price']); $url = utf8_decode($suggestion['sugg_url']); $comment = utf8_decode($suggestion['sugg_comment']); $sugg_categ = utf8_decode($suggestion['sugg_category']); $sugg_source = utf8_decode($suggestion['sugg_source']); $sugg_location = utf8_decode($suggestion['sugg_location']); } } $sug_map = new suggestions_map(); global $opac_sugg_categ, $opac_sugg_categ_default; //copié de /opac_css/empr/make_sugg.inc.php //On évite de saisir 2 fois la même suggestion $su = new suggestions($id); $su->titre = $title; $su->editeur = $editor; $su->auteur = $author; $su->code = $isbn_or_ean; $price = str_replace(',', '.', $price); if (is_numeric($price)) { $su->prix = $price; } $su->nb = 1; $su->statut = $sug_map->getFirstStateId(); $su->url_suggestion = $url; $su->commentaires = $comment; $su->date_creation = today(); $su->sugg_src = $sugg_source; if ($opac_sugg_categ == '1') { if (!suggestions_categ::exists($sugg_categ)) { $sugg_categ = $opac_sugg_categ_default; } if (!suggestions_categ::exists($sugg_categ)) { $sugg_categ = '1'; } $su->num_categ = $sugg_categ; } $su->sugg_location = $sugg_location; $su->save(); return true; }
function changeCateg($chk, $to_categ) { foreach ($chk as $key => $id_sug) { $sug = new suggestions($id_sug); $state_name = $this->getStateNameFromId($sug->statut); if ($this->getState_CATEG($state_name) == 'YES' && suggestions_categ::exists($to_categ)) { $sug->num_categ = $to_categ; $sug->save(); } } }
notice::indexation_restaure($info); //synchro_rdf if ($pmb_synchro_rdf) { $synchro_rdf->addRdf($id, 0); } //Mise a jour de la suggestion $sug = new suggestions($id_sug); $sug->titre = stripslashes($t_notice['tit1']); $f_aut[] = array('id' => $f_aut0_id, 'fonction' => $f_f0_code, 'type' => '0'); if ($f_aut0_id) { $auteur = new auteur($f_aut0_id); $sug->auteur = $auteur->display; } if ($f_ed1_id) { $sug->editeur = stripslashes($f_ed1); } $sug->code = $t_notice['code']; $t_notice['prix'] = str_replace(',', '.', $t_notice['prix']); //float(8,2) $sug->prix = $t_notice['prix']; $sug->num_notice = $id; $sug->save(); } else { if ($f_tit1 == "") { // erreur : le champ tit1 est vide error_message($libelle, $notitle_message, 1, "./acquisition.php?categ=sug&action=modif&id_bibli=0&id_sug=" . $id_sug); } else { error_message_history($msg["notice_champs_perso"], $p_perso->error_message, 1); } } }