From 619742de4e9a408d7adf88d9cc0d695fbc6f8816 Mon Sep 17 00:00:00 2001 From: objecttothis Date: Mon, 25 Nov 2019 17:27:59 +0400 Subject: [PATCH] Refactoring files and variable names in Customer/People --- application/controllers/Customers.php | 18 +++++++++--------- application/language/en-US/customers_lang.php | 10 +++++----- ...rm_excel_import.php => form_csv_import.php} | 6 +++--- application/views/items/form_csv_import.php | 6 +++--- application/views/people/manage.php | 6 +++--- 5 files changed, 23 insertions(+), 23 deletions(-) rename application/views/customers/{form_excel_import.php => form_csv_import.php} (85%) diff --git a/application/controllers/Customers.php b/application/controllers/Customers.php index 8e8ebf1f4..5f446da76 100644 --- a/application/controllers/Customers.php +++ b/application/controllers/Customers.php @@ -347,25 +347,25 @@ class Customers extends Persons } /* - Customers import from excel spreadsheet + Customers import from csv spreadsheet */ - public function excel() + public function csv() { $name = 'import_customers.csv'; $data = file_get_contents('../' . $name); force_download($name, $data); } - public function excel_import() + public function csv_import() { - $this->load->view('customers/form_excel_import', NULL); + $this->load->view('customers/form_csv_import', NULL); } - public function do_excel_import() + public function do_csv_import() { if($_FILES['file_path']['error'] != UPLOAD_ERR_OK) { - echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('customers_excel_import_failed'))); + echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('customers_csv_import_failed'))); } else { @@ -446,18 +446,18 @@ class Customers extends Persons if(count($failCodes) > 0) { - $message = $this->lang->line('customers_excel_import_partially_failed') . ' (' . count($failCodes) . '): ' . implode(', ', $failCodes); + $message = $this->lang->line('customers_csv_import_partially_failed') . ' (' . count($failCodes) . '): ' . implode(', ', $failCodes); echo json_encode(array('success' => FALSE, 'message' => $message)); } else { - echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('customers_excel_import_success'))); + echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('customers_csv_import_success'))); } } else { - echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('customers_excel_import_nodata_wrongformat'))); + echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('customers_csv_import_nodata_wrongformat'))); } } } diff --git a/application/language/en-US/customers_lang.php b/application/language/en-US/customers_lang.php index a898de4f8..a1e33d9e0 100644 --- a/application/language/en-US/customers_lang.php +++ b/application/language/en-US/customers_lang.php @@ -21,11 +21,11 @@ $lang["customers_discount_type"] = "Discount Type"; $lang["customers_email_duplicate"] = "Email Address is already present in the database."; $lang["customers_employee"] = "Employee"; $lang["customers_error_adding_updating"] = "Customer add or update failed."; -$lang["customers_excel_import_failed"] = "Excel import failed"; -$lang["customers_excel_import_nodata_wrongformat"] = "The uploaded file has no data or is incorrectly formatted."; -$lang["customers_excel_import_partially_failed"] = "Customer import successful with some failures:"; -$lang["customers_excel_import_success"] = "Customer import successful."; -$lang["customers_import_items_excel"] = "Customer Import from Excel"; +$lang["customers_csv_import_failed"] = "CSV import failed"; +$lang["customers_csv_import_nodata_wrongformat"] = "The uploaded file has no data or is incorrectly formatted."; +$lang["customers_csv_import_partially_failed"] = "Customer import successful with some failures:"; +$lang["customers_csv_import_success"] = "Customer import successful."; +$lang["customers_import_items_csv"] = "Customer Import from CSV"; $lang["customers_mailchimp_activity_click"] = "Email click"; $lang["customers_mailchimp_activity_lastopen"] = "Last open email"; $lang["customers_mailchimp_activity_open"] = "Email open"; diff --git a/application/views/customers/form_excel_import.php b/application/views/customers/form_csv_import.php similarity index 85% rename from application/views/customers/form_excel_import.php rename to application/views/customers/form_csv_import.php index 7de76791b..880b29781 100644 --- a/application/views/customers/form_excel_import.php +++ b/application/views/customers/form_csv_import.php @@ -1,10 +1,10 @@ -'excel_form', 'class'=>'form-horizontal')); ?> +'csv_form', 'class'=>'form-horizontal')); ?>
@@ -24,7 +24,7 @@ //validation and submit handling $(document).ready(function() { - $('#excel_form').validate($.extend({ + $('#csv_form').validate($.extend({ submitHandler: function(form) { $(form).ajaxSubmit({ success: function(response) diff --git a/application/views/items/form_csv_import.php b/application/views/items/form_csv_import.php index 229b414b9..adf61bbfb 100644 --- a/application/views/items/form_csv_import.php +++ b/application/views/items/form_csv_import.php @@ -1,10 +1,10 @@ -'excel_form', 'class'=>'form-horizontal')); ?> +'csv_form', 'class'=>'form-horizontal')); ?>
@@ -24,7 +24,7 @@ //validation and submit handling $(document).ready(function() { - $('#excel_form').validate($.extend({ + $('#csv_form').validate($.extend({ submitHandler: function(form) { $(form).ajaxSubmit({ success:function(response) diff --git a/application/views/people/manage.php b/application/views/people/manage.php index 6c577912c..2deaf379b 100644 --- a/application/views/people/manage.php +++ b/application/views/people/manage.php @@ -33,9 +33,9 @@ $(document).ready(function() if ($controller_name == 'customers') { ?> -