diff -urN pmb/admin/convert/folow_import.php pmb_arreglao/admin/convert/folow_import.php
--- pmb/admin/convert/folow_import.php 2007-02-23 14:49:10.000000000 +0100
+++ pmb_arreglao/admin/convert/folow_import.php 2008-03-10 12:27:58.000000000 +0100
@@ -42,11 +42,16 @@
@readfile("$base_path/temp/$file_out");
@unlink("$base_path/temp/$file_out");
} else {
- //@copy("$base_path/temp/$file_out","$base_path/admin/import/unimarc.fic");
- @copy("$base_path/temp/$file_out","$base_path/admin/import/unimarc".(defined("LOCATION")?"_".constant("LOCATION"):"").".fic");
+ //@copy("$base_path/temp/$file_out","$base_path/admin/import/unimarc.fic");
+
+
+//-------------------------------------> L L I U R E X <--------------------------------------
+ @copy("$base_path/temp/$file_out","$base_path/temp/unimarc".(defined("LOCATION")?"_".constant("LOCATION"):"").".fic");
+//-------------------------------------> L L I U R E X <--------------------------------------
+
@unlink("$base_path/temp/$file_out");
if ($deliver==1) $sub="import"; else $sub="import_expl";
echo "";
}
-?>
\ No hay ningún carácter de nueva lÃnea al final del fichero
+?>
diff -urN pmb/admin/convert/start_import.php pmb_arreglao/admin/convert/start_import.php
--- pmb/admin/convert/start_import.php 2007-08-25 08:45:30.000000000 +0200
+++ pmb_arreglao/admin/convert/start_import.php 2008-03-06 09:52:56.000000000 +0100
@@ -157,8 +157,33 @@
$fo = fopen("$base_path/temp/".$file_out, "w+");
+
+//-------------------------------------> L L I U R E X <--------------------------------------
+ //Cambiamos codificacion y modificamos el texto del campo unimarc (si fuese xml)
+ $fi = fopen("$base_path/temp/".$file_in, "r+");
+ while (!feof($fi)){ //metemos el fichero en una variable
+ $linea.=fgets($fi);
+ }
+ $linea= str_replace("encoding=\"ISO-8859-1\"", "encoding=\"UTF-8\"", $linea);
+ $fitemp = fopen("$base_path/temp/tempo", "w+");
+ fwrite($fitemp, $linea);
+ fclose($fitemp);
+ $fitemp = fopen("$base_path/temp/tempo", "r");
+ fclose($fi);
+ unlink("$base_path/temp/".$file_in);
+ $fi = fopen("$base_path/temp/".$file_in, "w");
+ $bool=recode_file("iso-8859-1..utf-8", $fitemp, $fi);
+ fclose($fitemp);
+ fclose($fi);
+ unlink("$base_path/temp/tempo");
+//-------------------------------------> L L I U R E X <--------------------------------------
+
+
//Ouverture du fichier d'origine
$fi = fopen("$base_path/temp/".$file_in, "r");
+
+
+
//Récupération du nombre de notices et enregistrement dans la base de données des notices
$index = _get_n_notices_($fi, "$base_path/temp/".$file_in, $input_params,$origine);
@@ -277,4 +302,4 @@
fclose($fo);
echo "";
}
-?>
\ No hay ningún carácter de nueva lÃnea al final del fichero
+?>
diff -urN pmb/admin/empr/main.inc.php pmb_arreglao/admin/empr/main.inc.php
--- pmb/admin/empr/main.inc.php 2007-05-17 09:08:38.000000000 +0200
+++ pmb_arreglao/admin/empr/main.inc.php 2008-01-25 14:08:45.000000000 +0100
@@ -30,8 +30,8 @@
$admin_layout = str_replace('!!menu_sous_rub!!', $msg["import_lec_lien"], $admin_layout);
print $admin_layout;
echo window_title($database_window_title.$msg["import_lec_lien"].$msg[1003].$msg[1001]);
- if ($pmb_import_modele_lecteur) $import_modele=$pmb_import_modele_lecteur; else $import_modele="import_empr.inc.php";
- include("./admin/empr/$import_modele");
+ if ($pmb_import_modele_lecteur) $import_modele=$pmb_import_modele_lecteur; else $import_modele="usur_imp.php";
+ include("$import_modele");
break;
case 'ldap':
$admin_layout = str_replace('!!menu_sous_rub!!', $msg["import_ldap"], $admin_layout);
diff -urN pmb/admin/import/iimport_expl.php pmb_arreglao/admin/import/iimport_expl.php
--- pmb/admin/import/iimport_expl.php 2007-10-26 11:26:44.000000000 +0200
+++ pmb_arreglao/admin/import/iimport_expl.php 2008-03-06 09:57:36.000000000 +0100
@@ -40,8 +40,20 @@
$nom_fichier_transfert_ftp = "unimarc".(defined("LOCATION")?"_".constant("LOCATION"):"").".fic";
-$userfile_name = $_FILES['userfile']['name'] ;
+$userfile_name = $_FILES['userfile']['name'] ;
+
+
+//-------------------------------------> L L I U R E X <--------------------------------------
+//cambiamos la ruta para que escriba en el temporal
+if ((stripos($userfile_name, "/temp/"))===false){
+$userfile_name=$base_path."/temp/".$userfile_name;
+}
+//-------------------------------------> L L I U R E X <--------------------------------------
+
+
+
$userfile = $_FILES['userfile']['tmp_name'] ;
+
/* this script does nearly the same thing that import.inc does,
the difference is between the loading of the exemplaires table.
@@ -97,7 +109,8 @@
//if (!is_writeable($userfile)) {
// printf ($msg[503],$userfile_name); /* wrong permissions to copy the file %s ... Contact your admin... */
// break;
- // }
+ // }
+
if (!move_uploaded_file($userfile,$userfile_name)) {
printf ($msg[504],$userfile_name); /* Fail to copy %s, Contact your admin... */
} else {
@@ -120,7 +133,8 @@
print "\n";
print "\n";
print "";
- print "";
+ print "";
+
}
} else {
// import de notice
@@ -146,16 +160,21 @@
print "\n";
print "\n";
print "";
- 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 */
- $filename = "unimarc".(defined("LOCATION")?"_".constant("LOCATION"):"").".fic";
+ /* l'utilisateur n'est pas passé par le téléchargement du fichier */
+
+//-------------------------------------> L L I U R E X <--------------------------------------
+//el fichero se encuentra en el temporal, lo referenciamos.
+ $filename = "$base_path/temp/unimarc".(defined("LOCATION")?"_".constant("LOCATION"):"").".fic";
+// $filename = "$base_path/temp/unimarc_pmb.fic";
+//-------------------------------------> L L I U R E X <--------------------------------------
} else {
$filename=$file_submit;
}
@@ -239,8 +258,8 @@
";
break;
- }
- loadfile_in_table() ;
+ }
+ loadfile_in_table() ;
if ($pb_fini=="EOF") {
$formulaire="