From 0cd7af7c4fe2682317158a4da3bdd706f55057c0 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sun, 28 Feb 2016 16:26:58 +0000 Subject: [PATCH] change file load widget in excel_import forms (#116) used jasny-bootstrap --- application/controllers/Customers.php | 33 ++++++++++---------- application/controllers/Items.php | 4 +-- application/language/de-CH/common_lang.php | 4 ++- application/language/en/common_lang.php | 4 ++- application/language/es/common_lang.php | 4 ++- application/language/fr/common_lang.php | 4 ++- application/language/id/common_lang.php | 4 ++- application/language/nl-BE/common_lang.php | 4 ++- application/language/ru/common_lang.php | 4 ++- application/language/th/common_lang.php | 4 ++- application/language/tr/common_lang.php | 4 ++- application/language/zh/common_lang.php | 4 ++- application/views/customers/excel_import.php | 14 ++++----- application/views/items/excel_import.php | 16 +++++----- translations/common_lang.csv | 4 ++- 15 files changed, 67 insertions(+), 44 deletions(-) diff --git a/application/controllers/Customers.php b/application/controllers/Customers.php index c7ac10d82..473325e6d 100644 --- a/application/controllers/Customers.php +++ b/application/controllers/Customers.php @@ -142,6 +142,7 @@ class Customers extends Person_controller { $msg = $this->lang->line('items_excel_import_failed'); echo json_encode( array('success'=>false,'message'=>$msg) ); + return; } else @@ -155,22 +156,22 @@ class Customers extends Person_controller while (($data = fgetcsv($handle)) !== FALSE) { $person_data = array( - 'first_name'=>$data[0], - 'last_name'=>$data[1], - 'gender'=>$data[2], - 'email'=>$data[3], - 'phone_number'=>$data[4], - 'address_1'=>$data[5], - 'address_2'=>$data[6], - 'city'=>$data[7], - 'state'=>$data[8], - 'zip'=>$data[9], - 'country'=>$data[10], - 'comments'=>$data[11] + 'first_name'=>$data[0], + 'last_name'=>$data[1], + 'gender'=>$data[2], + 'email'=>$data[3], + 'phone_number'=>$data[4], + 'address_1'=>$data[5], + 'address_2'=>$data[6], + 'city'=>$data[7], + 'state'=>$data[8], + 'zip'=>$data[9], + 'country'=>$data[10], + 'comments'=>$data[11] ); $customer_data=array( - 'taxable'=>$data[13]=='' ? 0:1 + 'taxable'=>$data[13]=='' ? 0:1 ); $account_number = $data[12]; @@ -191,7 +192,8 @@ class Customers extends Person_controller } else { - echo json_encode( array('success'=>false,'message'=>'Your upload file has no data or not in supported format.') ); + echo json_encode( array('success'=>false, 'message'=>'Your upload file has no data or not in supported format.') ); + return; } } @@ -207,8 +209,7 @@ class Customers extends Person_controller $msg = "Import Customers successful"; } - echo json_encode( array('success'=>$success,'message'=>$msg) ); + echo json_encode( array('success'=>$success, 'message'=>$msg) ); } - } ?> \ No newline at end of file diff --git a/application/controllers/Items.php b/application/controllers/Items.php index b4a00bbc3..199cb0def 100644 --- a/application/controllers/Items.php +++ b/application/controllers/Items.php @@ -757,8 +757,9 @@ class Items extends Secure_area implements iData_controller { $failCodes[] = $i; } + + $i++; } - $i++; } else { @@ -781,6 +782,5 @@ class Items extends Secure_area implements iData_controller echo json_encode( array('success'=>$success, 'message'=>$msg) ); } - } ?> diff --git a/application/language/de-CH/common_lang.php b/application/language/de-CH/common_lang.php index a13b5adb3..6f5022861 100644 --- a/application/language/de-CH/common_lang.php +++ b/application/language/de-CH/common_lang.php @@ -51,9 +51,11 @@ $lang["common_you_are_using_ospos"] = "Sie verwenden Open Source Point Of Sales $lang["common_zip"] = "PLZ"; $lang["common_import"] = "Import"; $lang["common_download_import_template"] = "Download Import Excel Voralge (CSV)"; -$lang["common_import_file_path"] = "Dateipfad"; $lang["common_import_excel"] = "Excel Import"; $lang["common_import_full_path"] = "Voller Dateipfad zum Excel File notwendig"; +$lang["common_import_select_file"] = ""; +$lang["common_import_change_file"] = ""; +$lang["common_import_remove_file"] = ""; $lang["common_required"] = "Erforderlich"; $lang["common_days_sunday"] = "Sonntag"; $lang["common_days_monday"] = "Montag"; diff --git a/application/language/en/common_lang.php b/application/language/en/common_lang.php index 79df3b450..1086cdb5f 100644 --- a/application/language/en/common_lang.php +++ b/application/language/en/common_lang.php @@ -51,9 +51,11 @@ $lang["common_you_are_using_ospos"] = "You are using Open Source Point Of Sale V $lang["common_zip"] = "Zip"; $lang["common_import"] = "Import"; $lang["common_download_import_template"] = "Download Import Excel Template (CSV)"; -$lang["common_import_file_path"] = "file path"; $lang["common_import_excel"] = "Excel Import"; $lang["common_import_full_path"] = "Full path to excel file required"; +$lang["common_import_select_file"] = "Select file"; +$lang["common_import_change_file"] = "Change"; +$lang["common_import_remove_file"] = "Remove"; $lang["common_required"] = "Required"; $lang["common_days_sunday"] = "Sunday"; $lang["common_days_monday"] = "Monday"; diff --git a/application/language/es/common_lang.php b/application/language/es/common_lang.php index 50025021d..565ddc12d 100644 --- a/application/language/es/common_lang.php +++ b/application/language/es/common_lang.php @@ -51,9 +51,11 @@ $lang["common_you_are_using_ospos"] = "Estás usando Open Source Point Of Sale V $lang["common_zip"] = "Código Postal"; $lang["common_import"] = "Importar"; $lang["common_download_import_template"] = "Descargar Plantilla de Importación de Excel (CSV)"; -$lang["common_import_file_path"] = "Ruta del archivo"; $lang["common_import_excel"] = "Importar Excel"; $lang["common_import_full_path"] = "Requerida la ruta completa del archivo"; +$lang["common_import_select_file"] = ""; +$lang["common_import_change_file"] = ""; +$lang["common_import_remove_file"] = ""; $lang["common_required"] = "Requerido"; $lang["common_days_sunday"] = "Domingo"; $lang["common_days_monday"] = "Lunes"; diff --git a/application/language/fr/common_lang.php b/application/language/fr/common_lang.php index cf83ef857..4471688be 100644 --- a/application/language/fr/common_lang.php +++ b/application/language/fr/common_lang.php @@ -51,9 +51,11 @@ $lang["common_you_are_using_ospos"] = "Vous utilisez Open Source Point Of Sale V $lang["common_zip"] = "Zip"; $lang["common_import"] = "Import"; $lang["common_download_import_template"] = "Download Import Excel Template (CSV)"; -$lang["common_import_file_path"] = "file path"; $lang["common_import_excel"] = "Excel Import"; $lang["common_import_full_path"] = "Full path to excel file required"; +$lang["common_import_select_file"] = ""; +$lang["common_import_change_file"] = ""; +$lang["common_import_remove_file"] = ""; $lang["common_required"] = "Required"; $lang["common_days_sunday"] = "Dimanche"; $lang["common_days_monday"] = "Lundi"; diff --git a/application/language/id/common_lang.php b/application/language/id/common_lang.php index 01a6cf74d..9dd343e6f 100644 --- a/application/language/id/common_lang.php +++ b/application/language/id/common_lang.php @@ -51,9 +51,11 @@ $lang["common_you_are_using_ospos"] = "Anda menggunakan Open Source Point Of Sal $lang["common_zip"] = "Kode POS"; $lang["common_import"] = "Import"; $lang["common_download_import_template"] = "Download Import Excel Template (CSV)"; -$lang["common_import_file_path"] = "file path"; $lang["common_import_excel"] = "Excel Import"; $lang["common_import_full_path"] = "Full path to excel file required"; +$lang["common_import_select_file"] = ""; +$lang["common_import_change_file"] = ""; +$lang["common_import_remove_file"] = ""; $lang["common_required"] = "Required"; $lang["common_days_sunday"] = ""; $lang["common_days_monday"] = ""; diff --git a/application/language/nl-BE/common_lang.php b/application/language/nl-BE/common_lang.php index 19a509e51..41921f5d5 100755 --- a/application/language/nl-BE/common_lang.php +++ b/application/language/nl-BE/common_lang.php @@ -51,9 +51,11 @@ $lang["common_you_are_using_ospos"] = "You are using Open Source Point Of Sale V $lang["common_zip"] = "Postcode"; $lang["common_import"] = "Import"; $lang["common_download_import_template"] = "Download Import Excel Template (CSV)"; -$lang["common_import_file_path"] = "file path"; $lang["common_import_excel"] = "Excel Import"; $lang["common_import_full_path"] = "Full path to excel file required"; +$lang["common_import_select_file"] = ""; +$lang["common_import_change_file"] = ""; +$lang["common_import_remove_file"] = ""; $lang["common_required"] = "Required"; $lang["common_days_sunday"] = "Zondag"; $lang["common_days_monday"] = "Maandag"; diff --git a/application/language/ru/common_lang.php b/application/language/ru/common_lang.php index b213ab924..abec81889 100644 --- a/application/language/ru/common_lang.php +++ b/application/language/ru/common_lang.php @@ -51,9 +51,11 @@ $lang["common_you_are_using_ospos"] = "Вы использоваете Open Sour $lang["common_zip"] = "Почтовый индекс"; $lang["common_import"] = "Import"; $lang["common_download_import_template"] = "Download Import Excel Template (CSV)"; -$lang["common_import_file_path"] = "file path"; $lang["common_import_excel"] = "Excel Import"; $lang["common_import_full_path"] = "Full path to excel file required"; +$lang["common_import_select_file"] = ""; +$lang["common_import_change_file"] = ""; +$lang["common_import_remove_file"] = ""; $lang["common_required"] = "Required"; $lang["common_days_sunday"] = ""; $lang["common_days_monday"] = ""; diff --git a/application/language/th/common_lang.php b/application/language/th/common_lang.php index ffa0ffff4..da52093b2 100644 --- a/application/language/th/common_lang.php +++ b/application/language/th/common_lang.php @@ -51,9 +51,11 @@ $lang["common_you_are_using_ospos"] = "คุณกำลังใช้ Opensou $lang["common_zip"] = "รหัสไปรษณีย์"; $lang["common_import"] = "นำเข้า"; $lang["common_download_import_template"] = "Download Import Excel Template (CSV)"; -$lang["common_import_file_path"] = "file path"; $lang["common_import_excel"] = "Excel Import"; $lang["common_import_full_path"] = "Full path to excel file required"; +$lang["common_import_select_file"] = ""; +$lang["common_import_change_file"] = ""; +$lang["common_import_remove_file"] = ""; $lang["common_required"] = "ต้องกรอก"; $lang["common_days_sunday"] = ""; $lang["common_days_monday"] = ""; diff --git a/application/language/tr/common_lang.php b/application/language/tr/common_lang.php index b9a2ebd7e..4930464a8 100644 --- a/application/language/tr/common_lang.php +++ b/application/language/tr/common_lang.php @@ -51,9 +51,11 @@ $lang["common_you_are_using_ospos"] = "Kullandığınız sürüm"; $lang["common_zip"] = "Şehir Kodu"; $lang["common_import"] = "Import"; $lang["common_download_import_template"] = "Download Import Excel Template (CSV)"; -$lang["common_import_file_path"] = "file path"; $lang["common_import_excel"] = "Excel Import"; $lang["common_import_full_path"] = "Full path to excel file required"; +$lang["common_import_select_file"] = ""; +$lang["common_import_change_file"] = ""; +$lang["common_import_remove_file"] = ""; $lang["common_required"] = "Required"; $lang["common_days_sunday"] = ""; $lang["common_days_monday"] = ""; diff --git a/application/language/zh/common_lang.php b/application/language/zh/common_lang.php index 0717398a7..94c5f3ad7 100755 --- a/application/language/zh/common_lang.php +++ b/application/language/zh/common_lang.php @@ -51,9 +51,11 @@ $lang["common_you_are_using_ospos"] = "您正在使用 Open Source Point of Sale $lang["common_zip"] = "郵遞區號"; $lang["common_import"] = "Import"; $lang["common_download_import_template"] = "Download Import Excel Template (CSV)"; -$lang["common_import_file_path"] = "file path"; $lang["common_import_excel"] = "Excel Import"; $lang["common_import_full_path"] = "Full path to excel file required"; +$lang["common_import_select_file"] = ""; +$lang["common_import_change_file"] = ""; +$lang["common_import_remove_file"] = ""; $lang["common_required"] = "Required"; $lang["common_days_sunday"] = ""; $lang["common_days_monday"] = ""; diff --git a/application/views/customers/excel_import.php b/application/views/customers/excel_import.php index 55c06c8e3..cd95101a1 100644 --- a/application/views/customers/excel_import.php +++ b/application/views/customers/excel_import.php @@ -5,18 +5,18 @@ 'item_form', 'class'=>'form-horizontal')); ?>
-
- lang->line('common_import_file_path'), 'name', array('class'=>'control-label col-xs-3')); ?> -
- +
+
+
+ lang->line("common_import_select_file"); ?>lang->line("common_import_change_file"); ?> + lang->line("common_import_remove_file"); ?> +
diff --git a/application/views/items/excel_import.php b/application/views/items/excel_import.php index 6746fd79f..0e9c42f9e 100644 --- a/application/views/items/excel_import.php +++ b/application/views/items/excel_import.php @@ -2,21 +2,21 @@ -'item_form', 'class' => 'form-horizontal')); ?> +'item_form', 'class'=>'form-horizontal')); ?>
-
- lang->line('common_import_file_path'), 'name', array('class'=>'control-label col-xs-3')); ?> -
- +
+
+
+ lang->line("common_import_select_file"); ?>lang->line("common_import_change_file"); ?> + lang->line("common_import_remove_file"); ?> +
diff --git a/translations/common_lang.csv b/translations/common_lang.csv index 820ac38a8..f26120a41 100644 --- a/translations/common_lang.csv +++ b/translations/common_lang.csv @@ -50,9 +50,11 @@ common_you_are_using_ospos,Sie verwenden Open Source Point Of Sales Version,You common_zip,PLZ,Postcode,Código Postal,Zip,Zip,郵遞區號,Почтовый индекс,รหัสไปรษณีย์,Şehir Kodu,Kode POS common_import,Import,Import,Importar,Import,Import,Import,Import,นำเข้า,Import,Import common_download_import_template,Download Import Excel Voralge (CSV),Download Import Excel Template (CSV),Descargar Plantilla de Importación de Excel (CSV),Download Import Excel Template (CSV),Download Import Excel Template (CSV),Download Import Excel Template (CSV),Download Import Excel Template (CSV),Download Import Excel Template (CSV),Download Import Excel Template (CSV),Download Import Excel Template (CSV) -common_import_file_path,Dateipfad,file path,Ruta del archivo,file path,file path,file path,file path,file path,file path,file path common_import_excel,Excel Import,Excel Import,Importar Excel,Excel Import,Excel Import,Excel Import,Excel Import,Excel Import,Excel Import,Excel Import common_import_full_path,Voller Dateipfad zum Excel File notwendig,Full path to excel file required,Requerida la ruta completa del archivo,Full path to excel file required,Full path to excel file required,Full path to excel file required,Full path to excel file required,Full path to excel file required,Full path to excel file required,Full path to excel file required +common_import_select_file,,,,Select file,,,,,, +common_import_change_file,,,,Change,,,,,, +common_import_remove_file,,,,Remove,,,,,, common_required,Erforderlich,Required,Requerido,Required,Required,Required,Required,ต้องกรอก,Required,Required common_days_sunday,Sonntag,Zondag,Domingo,Sunday,Dimanche,,,,, common_days_monday,Montag,Maandag,Lunes,Monday,Lundi,,,,,