" ; $nom_fichier_transfert_ftp = "unimarc".(defined("LOCATION")?"_".constant("LOCATION"):"").".fic"; $tmp_file = $_FILES['userfile']['tmp_name']; if (!isset($from_file)) $from_file = $_FILES['userfile']['name']; $to_file = $base_path.'/temp/'.basename($tmp_file); if ($sub == "import_expl") { echo window_title($msg[520].$msg[1003].$msg[1001]); /* the name of the lender is read in the table */ if ($book_lender_id!="") { $sql_rech="select lender_libelle from lenders where idlender = '".$book_lender_id."' "; $sql_result_rech = mysql_query($sql_rech) or die ("Couldn't select lenders ! = ".$sql_rech); if (mysql_num_rows($sql_result_rech)==0) { $book_lender_name = $msg[561]; } else { $book_lender_name = mysql_result ($sql_result_rech,0,"lender_libelle"); } } else { $book_lender_name = $msg[561]; } // ------------------------------------- LLIUREX 02/02/2015-------------------------------------- } else if ($sub == "import_reb"){ echo window_title($msg["import_reb"].$msg[1003].$msg[1001]); // ------------------------------------- FIN LLIUREX 02/02/2015 -------------------------------- }else{ echo window_title($msg[500].$msg[1003].$msg[1001]); } switch ($action) { case 'beforeupload': if ($sub == "import_expl") { $book_lender_id = ""; $book_statut_id = ""; print $tpl_beforeupload_expl ; // ------------------------------------- LLIUREX 02/02/2015-------------------------------------- } else if ($sub == "import_reb") { print $tpl_beforeupload_reb ; // ------------------------------------- FIN LLIUREX 02/02/2015---------------------------------- } else { // import de notice print $tpl_beforeupload_notices ; } break; case 'afterupload': if (!$statutnot) $statutnot = 1 ; if ($sub == "import_expl") { if ($book_lender_id==0 || $book_lender_id=="") { print $msg[561]; break; } if ($book_statut_id==0 || $book_statut_id=="") { print $msg[561]; break; } if ($tmp_file=="") { printf ($msg[503],$from_file); /* wrong permissions to copy the file %s ... Contact your admin... */ break; } if (!move_uploaded_file($tmp_file,$to_file)) { printf ($msg[504],$from_file); /* Fail to copy %s, Contact your admin... */ } else { printf ($msg[505],$from_file); /* File transfered, Loading is about to go on */ print "
"; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
"; print ""; } // ------------------------------------- LLIUREX 02/02/2015-------------------------------------- } else if ($sub == "import_reb") { // import de rebeca if ($to_file=="") { printf ($msg[503],$from_file); /* wrong permissions to copy the file %s ... Contact your admin... */ break; } //if (strrpos(strtolower($from_file), ".reb") == false) { // printf ($msg['import_reb_fail_reb'],$from_file); /* wrong rebeca file %s ... Contact your admin... */ // break; //} if (!move_uploaded_file($tmp_file,$to_file)) { printf ($msg[504],$from_file); /* Fail to copy %s, Contact your admin... */ } else { printf ($msg[505],$from_file); /* File transfered, Loading is about to go on */ print "
"; print ""; print ""; print ""; print ""; print "
"; print ""; } // ------------------------------------- FIN LLIUREX 02/02/2015-------------------------------------- } else { // import de notice if ($to_file=="") { printf ($msg[503],$from_file); /* wrong permissions to copy the file %s ... Contact your admin... */ break; } if (!move_uploaded_file($tmp_file,$to_file)) { printf ($msg[504],$from_file); /* Fail to copy %s, Contact your admin... */ } else { printf ($msg[505],$from_file); /* File transfered, Loading is about to go on */ print "
"; print ""; print ""; print ""; print ""; print ""; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
"; print ""; } } break; case 'preload': if ($sub == "import_expl") { /* Does the file exist ? */ if ($file_submit=="") { /* l'utilisateur n'est pas passé par le téléchargement du fichier */ // ------------------------------------- LLIUREX 02/02/2015-------------------------------------- // Cambiando la ruta de lectura del fichero a leer // Previamente se ha modificado folow_import.php para escribir en esta nueva ruta //$filename = $base_path."/admin/import/".$nom_fichier_transfert_ftp; $filename = $base_path."/temp/".$nom_fichier_transfert_ftp; // ------------------------------------- FIN LLIUREX 02/02/2015-------------------------------------- $from_file = "unimarc".(defined("LOCATION")?"_".constant("LOCATION"):"").".fic"; } else { $filename=$file_submit; } if ($book_lender_id=="" || $book_statut_id=="" || $isbn_mandatory=="" || $cote_mandatory=="" || $book_location_id=="" || $statutnot=="") { /* l'utilisateur n'est pas passé par le téléchargement du fichier, il faut qu'il choisisse un prêteur s'il n'en a pas communiqué auparavant */ print "

".$msg['import_expl_form_titre']."



 
".gen_liste_multiple ("select id_notice_statut, gestion_libelle from notice_statut order by 2", "id_notice_statut", "gestion_libelle", "id_notice_statut", "statutnot", "", 1, "", "","","",0)."

 
 
 

 
 
 

".origin::gen_combo_box("authorities","authorities_default_origin")."
 

". lender::gen_combo_box($book_lender_id)."  ". docs_statut::gen_combo_box($book_statut_id)."
". docs_location::gen_combo_box($deflt_docs_location)."

$msg[40] $msg[39]

".$msg["import_expl_codage_proprio"]." ".$msg["import_expl_codage_generique"]."
".$msg["import_expl_codage_proprio"]." ".$msg["import_expl_codage_generique"]."
".$msg["import_expl_codage_proprio"]." ".$msg["import_expl_codage_generique"]."
"; break; } loadfile_in_table() ; if ($pb_fini=="EOF") { $formulaire="
"; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.=""; $formulaire.="\n"; $formulaire.= "\n"; $formulaire.= "\n"; $formulaire.= "\n"; $formulaire.="
"; printf ($msg[512], $from_file); /* File %s... . End of preload... */ $fo = fopen("$base_path/temp/liste_id".SESSid.".txt","w"); fwrite($fo,""); fclose($fo); //file_put_contents("$base_path/temp/liste_id".SESSid.".txt",""); $script = ""; } else { $formulaire="
"; $formulaire.= ""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.=""; $formulaire.="\n"; $formulaire.= "\n"; $formulaire.= "\n"; $formulaire.= "\n"; $formulaire.="
"; $script = ""; } print $formulaire; print $script; // ------------------------------------- LLIUREX 02/02/2015-------------------------------------- } else if ($sub == "import_reb") { // import de notice /* Does the file exist ? */ if ($file_submit=="") $filename = "unimarc".(defined("LOCATION")?"_".constant("LOCATION"):"").".fic"; else $filename=$file_submit; if ($noticenumber=="") $noticenumber=0; if (!file_exists($filename)) { printf ($msg[506],$filename); /* The file %s doesn't exist... */ return; } if (filesize($filename)==0) { printf ($msg[507],$filename); /* The file % is empty, it's going to be deleted */ unlink ($filename); return; } $handle = fopen ($filename, "rb"); if (!$handle) { printf ($msg[508],$filename); /* Unable to open the file %s ... */ return; } exec("yaz-marcdump -o marc -s ".$base_path."/temp/rebdump ".$filename." >/dev/null", $output, $return_var); if ($return_var) { printf ($msg['import_reb_fail_dump'],$filename); /* dump failed */ unlink ($filename); return; } $formulaire="
"; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.="
"; printf ($msg[509].$msg[512], $filename, $filename); /* File %s... . End of preload... */ $script = ""; print $formulaire; print $script; // ------------------------------------- FIN LLIUREX 02/02/2015-------------------------------------- } else { // import de notice /* Does the file exist ? */ if ($file_submit=="") { // ------------------------------------- LLIUREX 02/02/2015-------------------------------------- // Cambiando la ruta de lectura del fichero a leer // Previamente se ha modificado folow_import.php para escribir en esta nueva ruta //$filename = $base_path."/admin/import/".$nom_fichier_transfert_ftp; $filename = $base_path."/temp/".$nom_fichier_transfert_ftp; // ------------------------------------- FIN LLIUREX 02/02/2015-------------------------------------- $from_file = "unimarc".(defined("LOCATION")?"_".constant("LOCATION"):"").".fic"; } else { $filename=$file_submit; } if ($isbn_mandatory=="") { /* l'utilisateur n'est pas passé par le téléchargement du fichier, il faut qu'il nous dise si l'ISBN est obligatoire */ print "

".$msg['import_noti_form_titre']."



 
".gen_liste_multiple ("select id_notice_statut, gestion_libelle from notice_statut order by 2", "id_notice_statut", "gestion_libelle", "id_notice_statut", "statutnot", "", 1, "", "","","",0)."

 
 
 

 
 
 

".origin::gen_combo_box("authorities","authorities_default_origin")."
 
"; break; } loadfile_in_table() ; if ($pb_fini=="EOF") { $formulaire="
"; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.=""; $formulaire.="\n"; $formulaire.="\n"; $formulaire.= "\n"; $formulaire.= "\n"; $formulaire.="
"; printf ($msg[509].$msg[512], $from_file, $from_file); /* File %s... . End of preload... */ $fo = fopen("$base_path/temp/liste_id".SESSid.".txt","w"); fwrite($fo,""); fclose($fo); //file_put_contents("$base_path/temp/liste_id".SESSid.".txt",""); $script = ""; } else { $formulaire="
"; $formulaire.= ""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.=""; $formulaire.="\n"; $formulaire.="\n"; $formulaire.= "\n"; $formulaire.= "\n"; $formulaire.="
"; $script = ""; } print $formulaire; print $script; } break; case 'load': // ------------------------------------- LLIUREX 02/02/2015-------------------------------------- if ($sub == "import_reb") { include("$class_path/audit.class.php"); require ($base_path."/catalog/z3950/notice.inc.php"); include("$include_path/templates/expl.tpl.php"); include ("$class_path/z3950_notice.class.php"); require_once($base_path."/catalog/z3950/func_other.inc.php"); $integration_OK=0; $integration_UP=0; $dirrec=scandir($base_path."/temp/"); foreach($dirrec as $file) { if ( (strpos($file, "rebdump")) !== false ) { $fp = fopen ($base_path."/temp/".$file,"r"); $buffer=""; while (!feof($fp)) { $buffer.= fread($fp, 4096); } fclose($fp); unlink($base_path."/temp/".$file); $notice = new z3950_notice ("usmarc", $buffer); $res_integration = $notice->insert_in_database($show=false); $new_notice=$res_integration[0]; $num_notice=$res_integration[1]; //if (($new_notice==0) && ($num_notice==0)) $integration_OK="ECHEC"; //if (($new_notice==0) && ($num_notice!=0)) $integration_OK="EXISTAIT"; if (($new_notice==1) && ($num_notice!=0)) $integration_OK++; if (($new_notice==2) && ($num_notice!=0)) $integration_UP++; //if (($new_notice==1) && ($num_notice==0)) $integration_OK="NEWRATEE"; } } unlink($filename); printf ($msg['import_reb_ok'], $integration_OK); printf ($msg['import_reb_up'], $integration_UP); return; } // ------------------------------------FIN LLIUREX 02/02/2015-------------------------------------- if (!$statutnot) $statutnot=1; printf ($msg[509], $from_file); if ($nbtot_notice=="") { $sql = "select count(1) from import_marc where origine='".addslashes(SESSid)."' "; $sql_result = mysql_query($sql) or die ("Couldn't select count(1) from import table !"); $nbtot_notice=mysql_result($sql_result, 0, 0); } if ($sub == "import_expl") { $section_995_=new marc_list("section_995"); $section_995=$section_995_->table; $typdoc_995_=new marc_list("typdoc_995"); $typdoc_995=$typdoc_995_->table; $codstatdoc_995_=new marc_list("codstatdoc_995"); $codstatdoc_995=$codstatdoc_995_->table; /* let's initialize the counters if necessary */ if ($nb_expl_ignores == "") $nb_expl_ignores=0; printf ($msg[511], "\"".$book_lender_name."\"") ; } $sql = "select notice, id_import from import_marc where origine='".addslashes(SESSid)."' ORDER BY id_import limit $pmb_import_limit_record_load "; $sql_result_import = mysql_query($sql) or die ("Couldn't select import table !"); $n_notice=mysql_num_rows($sql_result_import); if ($notice_deja_presente=="") { $notice_deja_presente=0; } $inotice=0; $txt=""; while (($notobj = mysql_fetch_object($sql_result_import))) { $notice=$notobj->notice ; $idnotice_import=$notobj->id_import ; $inotice++; $res_lecture = recup_noticeunimarc($notice) ; if($link_generate) $res_link = recup_noticeunimarc_link($notice); if (!$res_lecture || !$tit_200a[0]) { $res_lecture = 0; // ".$inotice." $fp = fopen ("../../temp/err_import.unimarc","a+"); fwrite ($fp, $notice); fclose ($fp); $notice_rejetee++; } if ($res_lecture) { recup_noticeunimarc_suite($notice) ; /* We've got everything, let's have a look if ISBN already exists in notices table */ if($isbn[0]=="NULL") $isbn[0]=""; // si isbn vide, on va tenter de prendre l'EAN stocké en 345$b if ($isbn[0]=="") $isbn[0]=$EAN[0] ; // si isbn vide, on va tenter de prendre le serial en 011 if ($isbn[0]=="") $isbn[0]=$issn_011[0]; // si ISBN obligatoire et isbn toujours vide : if ($isbn_mandatory == 1 && $isbn[0]=="") { // on va tenter de prendre l'ISSN stocké en 225$x $isbn[0]=$collection_225[0]['x'] ; // si isbn toujours vide, on va tenter de prendre l'ISSN stocké en 410$x if ($isbn[0]=="") $isbn[0]=$collection_410[0]['x'] ; } // on commence par voir ce que le code est (basé sur la recherche par code du module catalogage $ex_query = clean_string($isbn[0]); $EAN = ''; $isbn = ''; $code = ''; $code10 = '' ; if(isEAN($ex_query)) { // la saisie est un EAN -> on tente de le formater en ISBN $EAN=$ex_query; $isbn = EANtoISBN($ex_query); // si échec, on prend l'EAN comme il vient if(!$isbn) $code = str_replace("*","%",$ex_query); else { $code=$isbn; $code10=formatISBN($code,10); } } else { if(isISBN($ex_query)) { // si la saisie est un ISBN $isbn = formatISBN($ex_query); // si échec, ISBN erroné on le prend sous cette forme if(!$isbn) $code = str_replace("*","%",$ex_query); else { $code10=$isbn ; $code=formatISBN($code10,13); } } else { // ce n'est rien de tout ça, on prend la saisie telle quelle $code = str_replace("*","%",$ex_query); } } $isbn_OK=$code; $new_notice = 0; $notice_id = 0 ; // le paramétrage est-il : dédoublonnage sur code ? / Ne dédoublonner que sur code ISBN (ignorer les ISSN) ? if ((($isbn_dedoublonnage)&&(!$isbn_only))||(($isbn_dedoublonnage)&&($isbn_only)&&(isISBN($isbn)))) { $trouvees=0; if ($EAN && $isbn) { // cas des EAN purs : constitution de la requête $requete = "SELECT distinct notice_id FROM notices "; $requete.= " WHERE notices.code in ('$code','$EAN'".($code10?",'$code10'":"").") limit 1"; $myQuery = mysql_query($requete, $dbh); $trouvees=mysql_num_rows($myQuery); } elseif ($isbn) { // recherche d'un isbn $requete = "SELECT distinct notice_id FROM notices "; $requete.= " WHERE notices.code in ('$code'".($code10?",'$code10'":"").") limit 1"; $myQuery = mysql_query($requete, $dbh); $trouvees=mysql_num_rows($myQuery); } elseif ($code) { // note : le code est recherché dans le champ code des notices // (cas des code-barres disques qui échappent à l'EAN) // $requete = "SELECT notice_id FROM notices "; $requete.= " WHERE notices.code like '$code' limit 10"; $myQuery = mysql_query($requete, $dbh); $trouvees=mysql_num_rows($myQuery); } // dédoublonnage sur isbn if ($EAN || $isbn || $code) { if ($trouvees==0) { $new_notice=1; } else { $new_notice=0; $notice_id = mysql_result ($myQuery,0,"notice_id"); $sql_log = mysql_query("insert into error_log (error_origin, error_text) values ('import_expl_".addslashes(SESSid).".inc', '".$msg[542]." $EAN || $isbn || $code ".addslashes($tit[0]['a'])."') ") ; } } else { if ($isbn_mandatory == 1) { $sql_log = mysql_query("insert into error_log (error_origin, error_text) values ('import_".addslashes(SESSid).".inc', '".$msg[543]."') ") ; } else { $new_notice = 1; $sql_log = mysql_query("insert into error_log (error_origin, error_text) values ('import_".addslashes(SESSid).".inc', '".$msg[565]."') ") ; } } } else { // pas de dédoublonnage if ($isbn_mandatory == 1 && $isbn_OK=="") { $sql_log = mysql_query("insert into error_log (error_origin, error_text) values ('import_".addslashes(SESSid).".inc', '".$msg[543]."') ") ; }elseif($isbn_OK){ $new_notice = 1; }else{ $new_notice = 1; $sql_log = mysql_query("insert into error_log (error_origin, error_text) values ('import_".addslashes(SESSid).".inc', '".$msg[565]."') ") ; } } /* the notice is new, we are going to import it... */ if ($new_notice==1) { import_new_notice() ; if($link_generate) import_notice_link(); import_new_notice_suite() ; // Mise à jour de la table "notices_global_index" notice::majNoticesGlobalIndex($notice_id); // Mise à jour de la table "notices_mots_global_index" notice::majNoticesMotsGlobalIndex($notice_id); } else { $notice_deja_presente++; //TRAITEMENT DES DOCS NUMERIQUES SUR NOTICE EXISTANTE if ($add_explnum===TRUE) ajoute_explnum(); } // TRAITEMENT DES EXEMPLAIRES ICI if ($sub == "import_expl") { traite_exemplaires () ; } // fin if $sub=import_expl } /* this has been succesfuly read, it can be deleted */ $sql_del = "delete from import_marc where id_import = '".$idnotice_import."' "; $sql_result_del = mysql_query($sql_del) or die ("Couldn't delete import_marc $idnotice_import !"); } /* end while records in import table */ $sql = "select count(1) as reste from import_marc where origine='".addslashes(SESSid)."'"; $sql_result = mysql_query($sql) or die ("Couldn't select count import table !"); $reste=mysql_result($sql_result,0,"reste"); if ($sub == "import_expl") { if ($reste > 0 ) { $formulaire="
\n"; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.= "\n"; $formulaire.= "\n"; $formulaire.="
"; //On enregistre les ids utilisés avant le rechargement global $notices_crees, $notices_a_creer,$bulletins_crees,$bulletins_a_creer; $tabimport_id['notices_existantes'] = $notices_crees; $tabimport_id['notices_a_creer'] = $notices_a_creer; $tabimport_id['bulletins_crees'] = $bulletins_crees; $tabimport_id['bulletins_a_creer'] = $bulletins_a_creer; $fo = fopen("$base_path/temp/liste_id".SESSid.".txt","w"); fwrite($fo,serialize($tabimport_id)); $formulaire.="\n"; printf ($msg[513], $reste, $nbtot_notice); /* File %s ... . Still %s notices to load (total = %s) ... */ if ($notice_deja_presente==1) { printf ($msg[514],$notice_deja_presente) ; /*
($notice_deja_presente notice already in the database has been ignored since the begining) */ } elseif ($notice_deja_presente>1) { printf ($msg[515],$notice_deja_presente) ; /*
($notice_deja_presente notices already in the database have been ignored since the begining) */ } if ($notice_rejetee>0) { print "
".$notice_rejetee." ".$msg['notices_invalides']; } printf ($msg[521], $nb_expl_ignores); /* ## exemplaire(s) ignoré(s) */ } else { $formulaire=""; $script=""; printf ($msg[516], $nbtot_notice); /* There were $nbtot_notice notice(s) to load, everything is OK... */ if ($notice_deja_presente==1) { printf ($msg[517], $notice_deja_presente); /* $notice_deja_presente notice already in the database has been ignored... */ } elseif ($notice_deja_presente>1) { printf ($msg[518], $notice_deja_presente); /* dont $notice_deja_presente notices already in the database have been ignored... */ } if ($notice_rejetee>0) { print "
".$notice_rejetee." ".$msg['notices_invalides']; } printf ($msg[521], $nb_expl_ignores); /* ## exemplaire(s) ignoré(s) */ /* ajouter ici SELECT error_origin, error_text, count(*) FROM error_log group by error_origin, error_text */ $gen_liste_log=""; $resultat_liste=mysql_query("SELECT error_origin, error_text, count(*) as nb_error FROM error_log where error_origin in ('expl_".addslashes(SESSid).".class','import_expl_".addslashes(SESSid).".inc','iimport_expl_".addslashes(SESSid).".inc','import_".addslashes(SESSid).".inc.php','import_".addslashes(SESSid).".inc','import_func_".addslashes(SESSid).".inc.php') group by error_origin, error_text" ); $nb_liste=mysql_numrows($resultat_liste); if ($nb_liste>0) { $gen_liste_log = "

".$msg[538]."
" ; $gen_liste_log.=""; $i_log=0; while ($i_log<$nb_liste) { $gen_liste_log.=""; $gen_liste_log.="" ; $gen_liste_log.="" ; $gen_liste_log.="" ; $gen_liste_log.="" ; $i_log++; } } $gen_liste_str.="
".$msg[539]."".$msg[540]."".$msg[541]."
".mysql_result($resultat_liste,$i_log,"error_origin")."".mysql_result($resultat_liste,$i_log,"error_text")."".mysql_result($resultat_liste,$i_log,"nb_error")."
\n" ; print $gen_liste_log; @unlink("$base_path/temp/liste_id".SESSid.".txt"); } print $formulaire; print $script; } else { // import de notices if ($reste > 0 ) { $formulaire="
\n"; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.=""; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.="\n"; $formulaire.= "\n"; $formulaire.= "\n"; $formulaire.="
"; //On enregistre les ids utilisés avant le rechargement global $notices_crees, $notices_a_creer,$bulletins_crees,$bulletins_a_creer; $tabimport_id['notices_existantes'] = $notices_crees; $tabimport_id['notices_a_creer'] = $notices_a_creer; $tabimport_id['bulletins_crees'] = $bulletins_crees; $tabimport_id['bulletins_a_creer'] = $bulletins_a_creer; $fo = fopen("$base_path/temp/liste_id".SESSid.".txt","w"); fwrite($fo,serialize($tabimport_id)); $formulaire.="\n"; printf ($msg[509].$msg[513],$from_file, $reste, $nbtot_notice); /* File %s ... . Still %s notices to load (total = %s) ... */ if ($notice_deja_presente==1) { printf ($msg[514],$notice_deja_presente) ; /*
($notice_deja_presente notice already in the database has been ignored since the begining) */ } elseif ($notice_deja_presente>1) { printf ($msg[515],$notice_deja_presente) ; /*
($notice_deja_presente notices already in the database have been ignored since the begining) */ } if ($notice_rejetee>0) { print "
".$notice_rejetee." ".$msg['notices_invalides']; } } else { $formulaire=""; $script=""; printf ($msg[509].$msg[516], $from_file, $nbtot_notice); /* There were $nbtot_notice notice(s) to load, everything is OK... */ if ($notice_deja_presente==1) { printf ($msg[517], $notice_deja_presente); /* $notice_deja_presente notice already in the database has been ignored... */ } elseif ($notice_deja_presente>1) { printf ($msg[518], $notice_deja_presente); /* dont $notice_deja_presente notices already in the database have been ignored... */ } if ($notice_rejetee>0) { print "
".$notice_rejetee." ".$msg['notices_invalides'] ; } /* ajouter ici SELECT error_origin, error_text, count(*) FROM error_log group by error_origin, error_text */ $gen_liste_log=""; $resultat_liste=mysql_query("SELECT error_origin, error_text, count(*) as nb_error FROM error_log where error_origin in ('expl_".addslashes(SESSid).".class','import_expl_".addslashes(SESSid).".inc','iimport_expl_".addslashes(SESSid).".inc','import_".addslashes(SESSid).".inc.php', 'import_".addslashes(SESSid).".inc','import_func_".addslashes(SESSid).".inc.php') group by error_origin, error_text" ); $nb_liste=mysql_numrows($resultat_liste); if ($nb_liste>0) { $gen_liste_log = "

".$msg[538]."
" ; $gen_liste_log.=""; $i_log=0; while ($i_log<$nb_liste) { $gen_liste_log.=""; $gen_liste_log.="" ; $gen_liste_log.="" ; $gen_liste_log.="" ; $gen_liste_log.="" ; $i_log++; } } $gen_liste_str.="
".$msg[539]."".$msg[540]."".$msg[541]."
".mysql_result($resultat_liste,$i_log,"error_origin")."".mysql_result($resultat_liste,$i_log,"error_text")."".mysql_result($resultat_liste,$i_log,"nb_error")."
\n" ; print $gen_liste_log; @unlink("$base_path/temp/liste_id".SESSid.".txt"); } print $formulaire; print $script; } break; default: $formulaire="
"; $formulaire.=""; $formulaire.=""; $form_text=""; if ($sub == "import_expl"){ $formulaire.=""; $form_text=file_get_contents("$include_path/messages/help/$lang/import_expl.txt"); } // ------------------------------------- LLIUREX 02/02/2015-------------------------------------- else if ($sub == "import_reb") { $formulaire.=""; $form_text=file_get_contents("$include_path/messages/help/$lang/import_reb.txt") ; } // ------------------------------------ FIN LLIUREX 02/02/2015-------------------------------------- else{ $formulaire.=""; $form_text=file_get_contents("$include_path/messages/help/$lang/import.txt"); } $formulaire.=str_replace(array("!!nom_fic!!","!!nom_bouton!!"),array(htmlentities($nom_fichier_transfert_ftp,ENT_QUOTES,$charset),htmlentities($msg["admin_import_notice_prechargement"],ENT_QUOTES,$charset)),$form_text); if(!$table_list_func_import){ if(file_exists("func_import_subst.xml")){ $table_list_func_import=_parser_text_no_function_(file_get_contents("func_import_subst.xml"),"CATALOG"); }elseif(file_exists("func_import.xml")){ $table_list_func_import=_parser_text_no_function_(file_get_contents("func_import.xml"),"CATALOG"); } } $code_js=$selecteur_fic=""; if(is_array($table_list_func_import["ITEM"]) && count($table_list_func_import["ITEM"])){ $incr=0; $text_desc_func_import=""; $code_js.=""; } $selecteur_encodage="

"; // ------------------------------------- LLIUREX 02/02/2015-------------------------------------- //-- $formulaire.=$selecteur_fic; //-- $formulaire.="
\n"; //-- $formulaire.=$selecteur_encodage; //-- $formulaire.=""; //-- $formulaire.=""; if ($sub <> "import_reb") $formulaire.=$selecteur_fic; if ($sub <> "import_reb") $formulaire.="

\n"; $formulaire.=""; if ($sub <> "import_reb") $formulaire.=""; // ------------------------------------------ FIN LLIUREX 02/02/2015-------------------------------------- $formulaire.="
\n"; $formulaire.=$code_js; print $formulaire; break; } print "
";