1 | <?php |
---|
2 | // +-------------------------------------------------+ |
---|
3 | // © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net) |
---|
4 | // +-------------------------------------------------+ |
---|
5 | // $Id: end_import.php,v 1.14 2015-04-03 11:16:22 jpermanne Exp $ |
---|
6 | |
---|
7 | //Fin de la conversion |
---|
8 | $base_path = "../.."; |
---|
9 | $base_auth = "ADMINISTRATION_AUTH|CATALOGAGE_AUTH"; |
---|
10 | $base_title = "\$msg[ie_import_running]"; |
---|
11 | require ($base_path."/includes/init.inc.php"); |
---|
12 | |
---|
13 | $percent=100; |
---|
14 | echo "<center><h3>$msg[admin_conversion_end1] $import_type_l $msg[admin_conversion_end2].</h3></center><br />\n"; |
---|
15 | |
---|
16 | print " |
---|
17 | <table align=center width=100%> |
---|
18 | <tr> |
---|
19 | <td style='border-width:1px;border-style:solid;border-color:#000;'> |
---|
20 | <img src='$base_path/images/jauge.png' width='".$percent."%' height='16'> |
---|
21 | </td></tr> |
---|
22 | <tr> |
---|
23 | <td align=center>".round($percent)."%</td> |
---|
24 | </tr> |
---|
25 | </table>"; |
---|
26 | |
---|
27 | print "<center>".$n_current." ".$msg["admin_conversion_end3"]; |
---|
28 | |
---|
29 | if ($n_errors!=0) { |
---|
30 | print ", ".$n_errors." ".$msg["admin_conversion_end4"]; |
---|
31 | $requete="select error_text from error_log where error_origin='convert.log ".$origine."'"; |
---|
32 | $resultat=pmb_mysql_query($requete); |
---|
33 | while (list($err_)=pmb_mysql_fetch_row($resultat)) { |
---|
34 | $errors_msg.=$err_; |
---|
35 | } |
---|
36 | } |
---|
37 | |
---|
38 | require ($include_path."/templates/admin.tpl.php"); |
---|
39 | |
---|
40 | if (preg_match("#<!--select_func_import-->#",$admin_convert_end)) { |
---|
41 | //Ajout du selecteur de choix de fonction d'import |
---|
42 | if(file_exists($base_path."/admin/import/func_import_subst.xml")){ |
---|
43 | $table_list_func_import=_parser_text_no_function_(file_get_contents($base_path."/admin/import/func_import_subst.xml"),"CATALOG"); |
---|
44 | }elseif(file_exists($base_path."/admin/import/func_import.xml")){ |
---|
45 | $table_list_func_import=_parser_text_no_function_(file_get_contents($base_path."/admin/import/func_import.xml"),"CATALOG"); |
---|
46 | } |
---|
47 | $code_js=""; |
---|
48 | if(is_array($table_list_func_import["ITEM"]) && count($table_list_func_import["ITEM"])){ |
---|
49 | if($_SESSION["func_import_model"]){ |
---|
50 | $func_import_model=$_SESSION["func_import_model"]; |
---|
51 | }elseif(!$pmb_import_modele) { |
---|
52 | $func_import_model="func_bdp.inc.php"; |
---|
53 | } else { |
---|
54 | $func_import_model=$pmb_import_modele; |
---|
55 | } |
---|
56 | $incr=0; |
---|
57 | $text_desc_func_import=""; |
---|
58 | $name_func="func_import"; |
---|
59 | $code_js.="<script type=\"text/javascript\">\n"; |
---|
60 | $code_js.="var func_import_desc= new Array(); var func_import_value= new Array();\n"; |
---|
61 | $selecteur_fic="<label class=\"etiquette\" for=\"".$name_func."\">".htmlentities($msg["admin_import_notice_convert_choice"],ENT_QUOTES,$charset)."</label>\n"; |
---|
62 | $selecteur_fic.="<select name=\"".$name_func."\" id=\"".$name_func."\" onChange=\"affiche_description();\" >\n"; |
---|
63 | $selected_trouve=""; |
---|
64 | foreach ( $table_list_func_import["ITEM"] as $value ) { |
---|
65 | $code_js.="func_import_desc[$incr] = \"".htmlentities($value["DESCRIPTION"],ENT_QUOTES,$charset)."\";\n"; |
---|
66 | $code_js.="func_import_value[$incr] = \"".htmlentities(substr($value["FUNCTION"],0,-4),ENT_QUOTES,$charset)."\";\n"; |
---|
67 | |
---|
68 | $selecteur_fic.="<option value=\"".htmlentities(substr($value["FUNCTION"],0,-4),ENT_QUOTES,$charset)."\" "; |
---|
69 | if($func_import_model == $value["FUNCTION"]){ |
---|
70 | $selecteur_fic.="selected=\"selected\" "; |
---|
71 | $selected_trouve=$value["FUNCTION"]; |
---|
72 | $text_desc_func_import=$value["DESCRIPTION"]; |
---|
73 | } |
---|
74 | $selecteur_fic.=">".htmlentities($value["NAME"],ENT_QUOTES,$charset)."</option>\n"; |
---|
75 | $incr++; |
---|
76 | } |
---|
77 | if(!$selected_trouve || ($pmb_import_modele && $selected_trouve != $pmb_import_modele)){ |
---|
78 | $code_js.="func_import_desc[$incr] = \"\";\n"; |
---|
79 | $code_js.="func_import_value[$incr] = \"".htmlentities(substr($pmb_import_modele,0,-4),ENT_QUOTES,$charset)."\";\n"; |
---|
80 | $selecteur_fic.="<option value=\"".htmlentities(substr($pmb_import_modele,0,-4),ENT_QUOTES,$charset)."\" "; |
---|
81 | if(!$selected_trouve){ |
---|
82 | $selecteur_fic.="selected=\"selected\" "; |
---|
83 | } |
---|
84 | |
---|
85 | $selecteur_fic.=">".htmlentities($msg["admin_import_notice_defaut"],ENT_QUOTES,$charset)."</option>\n"; |
---|
86 | } |
---|
87 | $selecteur_fic.="</select> \n"; |
---|
88 | |
---|
89 | $code_js.="function affiche_description(){ |
---|
90 | var func_import=document.destfic.".$name_func."; |
---|
91 | var mon_select=false; |
---|
92 | var index_select = func_import.options[func_import.selectedIndex].value; |
---|
93 | //console.log(document.getElementById('text_desc_func_import').innerHTML); |
---|
94 | for (var i=0; i<func_import_value.length;i++){ |
---|
95 | if(func_import_value[i] == index_select){ |
---|
96 | document.getElementById('text_desc_func_import').innerHTML =func_import_desc[i]; |
---|
97 | } |
---|
98 | } |
---|
99 | }"; |
---|
100 | $code_js.="</script>"; |
---|
101 | $formulaire=$selecteur_fic; |
---|
102 | $formulaire.="<label class=\"etiquette\" for=\"".$name_func."\" id=\"text_desc_func_import\" name=\"text_desc_func_import\">".htmlentities($text_desc_func_import,ENT_QUOTES,$charset)."</label>\n"; |
---|
103 | $formulaire.=$code_js; |
---|
104 | $admin_convert_end=str_replace("<!--select_func_import-->",$formulaire,$admin_convert_end); |
---|
105 | } |
---|
106 | |
---|
107 | } |
---|
108 | |
---|
109 | print $admin_convert_end; |
---|
110 | |
---|
111 | |
---|