From 638e9ff53568a8823a44db1e9a21130abe864ca8 Mon Sep 17 00:00:00 2001 From: RamkrishnaMondal Date: Tue, 26 Apr 2016 16:04:17 +0530 Subject: [PATCH 01/12] First commit --- application/config/autoload.php | 2 +- application/controllers/Config.php | 15 +++ application/controllers/Messages.php | 47 ++++++++++ application/helpers/table_helper.php | 60 +++++------- application/language/en/common_lang.php | 2 + application/language/en/config_lang.php | 5 + application/language/en/messages_lang.php | 3 + application/language/en/module_lang.php | 2 + application/libraries/Sms.php | 12 +++ application/views/configs/manage.php | 8 +- application/views/configs/message_config.php | 92 +++++++++++++++++++ application/views/messages/index.html | 11 +++ application/views/messages/sms-sender.php | 31 +++++++ application/views/messages/sms.php | 30 ++++++ database/database.sql | 10 +- database/tables.sql | 11 ++- images/menubar/messages.png | Bin 0 -> 1155 bytes 17 files changed, 299 insertions(+), 42 deletions(-) create mode 100644 application/controllers/Messages.php create mode 100644 application/language/en/messages_lang.php create mode 100644 application/libraries/Sms.php create mode 100755 application/views/configs/message_config.php create mode 100644 application/views/messages/index.html create mode 100755 application/views/messages/sms-sender.php create mode 100755 application/views/messages/sms.php create mode 100644 images/menubar/messages.png diff --git a/application/config/autoload.php b/application/config/autoload.php index 114114780..1da59fcb7 100644 --- a/application/config/autoload.php +++ b/application/config/autoload.php @@ -58,7 +58,7 @@ $autoload['packages'] = array(); | | $autoload['libraries'] = array('user_agent' => 'ua'); */ -$autoload['libraries'] = array('database', 'form_validation', 'session', 'user_agent', 'pagination'); +$autoload['libraries'] = array('database', 'form_validation', 'session', 'user_agent', 'pagination', 'sms'); /* | ------------------------------------------------------------------- diff --git a/application/controllers/Config.php b/application/controllers/Config.php index f874233ed..09646daa6 100644 --- a/application/controllers/Config.php +++ b/application/controllers/Config.php @@ -97,6 +97,21 @@ class Config extends Secure_area echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); } + function save_message() + { + $batch_save_data = array( + 'msg_msg'=>$this->input->post('msg_msg'), + 'msg_uid'=>$this->input->post('msg_uid'), + 'msg_pwd'=>$this->input->post('msg_pwd') + + ); + + $result = $this->Appconfig->batch_save($batch_save_data); + $success = $result ? true : false; + + echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); + } + function stock_locations() { $stock_locations = $this->Stock_location->get_all()->result_array(); diff --git a/application/controllers/Messages.php b/application/controllers/Messages.php new file mode 100644 index 000000000..425737482 --- /dev/null +++ b/application/controllers/Messages.php @@ -0,0 +1,47 @@ +get_controller_name(); + $this->load->view('messages/sms'); + + } + + + function view($person_id=-1) + { + $data['person_info']=$this->Person->get_info($person_id); + $this->load->view('messages/sms-sender',$data); + } + + + function send() + { + $uid = $this->config->item('msg_uid'); + $pwd = $this->config->item('msg_pwd'); + $phone = $this->input->post('phone'); + $msg = $this->input->post('msg'); + + $response = $this->sms->sendsms($uid,$pwd,$phone,$msg); + $this->load->view('messages/sms'); + + if('send') + { + echo "Message Submitted Successfully"; + } + else + { + echo "Message NOT Submitted Successfully"; + } + + } +} +?> diff --git a/application/helpers/table_helper.php b/application/helpers/table_helper.php index 8511d4b58..663683ad2 100644 --- a/application/helpers/table_helper.php +++ b/application/helpers/table_helper.php @@ -6,26 +6,17 @@ function get_sales_manage_table($sales, $controller) $table=''; $headers = array(' ', - $CI->lang->line('sales_receipt_number'), - $CI->lang->line('sales_sale_time'), - $CI->lang->line('customers_customer'), - $CI->lang->line('sales_amount_tendered'), - $CI->lang->line('sales_amount_due'), - $CI->lang->line('sales_change_due'), - $CI->lang->line('sales_payment')); - - if($CI->config->item('invoice_enable') == TRUE) - { - $headers[] = $CI->lang->line('sales_invoice_number'); - $headers[] = ' '; - $headers[] = ' '; - $headers[] = ' '; - } - else - { - $headers[] = ' '; - $headers[] = ' '; - } + $CI->lang->line('sales_receipt_number'), + $CI->lang->line('sales_sale_time'), + $CI->lang->line('customers_customer'), + $CI->lang->line('sales_amount_tendered'), + $CI->lang->line('sales_amount_due'), + $CI->lang->line('sales_change_due'), + $CI->lang->line('sales_payment'), + $CI->lang->line('sales_invoice_number'), + ' ', + ' ', + ' '); $table.=''; foreach($headers as $header) @@ -84,22 +75,11 @@ function get_sales_manage_sale_data_row($sale, $controller) $table_data_row.=''; $table_data_row.=''; $table_data_row.=''; - if($CI->config->item('invoice_enable') == TRUE) - { - $table_data_row.=''; - $table_data_row.=''; - } - else - { - // this size includes the 8% of invoice number and 5% of the invoice gliphicon, pluf of course the 12% for the field itself - $table_data_row.=''; - } + $table_data_row.=''; + $table_data_row.=''; $table_data_row.=''; $table_data_row.=''; - if($CI->config->item('invoice_enable') == TRUE) - { - $table_data_row.=''; - } + $table_data_row.=''; $table_data_row.=''; return $table_data_row; @@ -145,7 +125,8 @@ function get_people_manage_table($people,$controller) $CI->lang->line('common_first_name'), $CI->lang->line('common_email'), $CI->lang->line('common_phone_number'), - ' '); + $CI->lang->line('common_send_msg'), + $CI->lang->line('common_update'),); $table.=''; foreach($headers as $header) @@ -191,6 +172,7 @@ function get_person_data_row($person,$controller) $table_data_row.=''; $table_data_row.=''; $table_data_row.=''; + $table_data_row.=''; $table_data_row.=''; $table_data_row.=''; @@ -212,6 +194,9 @@ function get_detailed_data_row($row, $controller) return $table_data_row; } + + + /* Gets the html table to manage suppliers. */ @@ -227,8 +212,9 @@ function get_supplier_manage_table($suppliers,$controller) $CI->lang->line('common_first_name'), $CI->lang->line('common_email'), $CI->lang->line('common_phone_number'), + $CI->lang->line('common_send_msg'), $CI->lang->line('suppliers_supplier_id'), - ' '); + $CI->lang->line('common_update'),); $table.=''; foreach($headers as $header) @@ -276,6 +262,7 @@ function get_supplier_data_row($supplier,$controller) $table_data_row.=''; $table_data_row.=''; $table_data_row.=''; + $table_data_row.=''; $table_data_row.=''; $table_data_row.=''; $table_data_row.=''; @@ -283,6 +270,7 @@ function get_supplier_data_row($supplier,$controller) return $table_data_row; } + /* Gets the html table to manage items. */ diff --git a/application/language/en/common_lang.php b/application/language/en/common_lang.php index 9e1208b07..ac1bdafa7 100644 --- a/application/language/en/common_lang.php +++ b/application/language/en/common_lang.php @@ -60,3 +60,5 @@ $lang["common_export_excel"] = "Excel Export"; $lang["common_export_excel_yes"] = "Yes"; $lang["common_export_excel_no"] = "No"; $lang["common_required"] = "Required"; +$lang["common_send_msg"] = "SMS"; +$lang["common_update"] = "Update"; diff --git a/application/language/en/config_lang.php b/application/language/en/config_lang.php index 6688e9f97..0b984c797 100644 --- a/application/language/en/config_lang.php +++ b/application/language/en/config_lang.php @@ -93,6 +93,11 @@ $lang["config_location"] = "Stock"; $lang["config_location_configuration"] = "Stock Locations"; $lang["config_location_info"] = "Location Configuration Information"; $lang["config_logout"] = "Don't you want to make a backup before logging out? Click [OK] to backup, [Cancel] to logout"; +$lang["config_message"] = "Message"; +$lang["config_message_configuration"] = "Message Configuration"; +$lang["config_msg_msg"] = "Saved Text Message:"; +$lang["config_msg_uid"] = "SMS-API UserName:"; +$lang["config_msg_pwd"] = "SMS-API Password:"; $lang["config_number_format"] = "Number Format"; $lang["config_phone"] = "Company Phone"; $lang["config_phone_required"] = "Company phone is a required field"; diff --git a/application/language/en/messages_lang.php b/application/language/en/messages_lang.php new file mode 100644 index 000000000..752ba5373 --- /dev/null +++ b/application/language/en/messages_lang.php @@ -0,0 +1,3 @@ + diff --git a/application/views/configs/manage.php b/application/views/configs/manage.php index a61c89d96..05e7d3470 100644 --- a/application/views/configs/manage.php +++ b/application/views/configs/manage.php @@ -22,6 +22,9 @@
  • lang->line('config_invoice'); ?>
  • +
  • + lang->line('config_message'); ?> +
  • @@ -46,6 +49,9 @@
    load->view("configs/invoice_config"); ?>
    +
    + load->view("configs/message_config"); ?> +
    -load->view("partial/footer"); ?> \ No newline at end of file +load->view("partial/footer"); ?> diff --git a/application/views/configs/message_config.php b/application/views/configs/message_config.php new file mode 100755 index 000000000..21567712c --- /dev/null +++ b/application/views/configs/message_config.php @@ -0,0 +1,92 @@ +'message_config_form', 'enctype'=>'multipart/form-data', 'class'=>'form-horizontal')); ?> +
    +
    + +

    Message settings

    + +
    +
    + + + +
    + lang->line('config_msg_msg'), 'msg_msg', array('class'=>'control-label col-xs-2')); ?> +
    + 'msg_msg', + 'id'=>'msg_msg', + 'class'=>'form-control input-sm', + 'value'=>$this->config->item('msg_msg')));?> +
    + + + + + +
    + +
    + + +
    + lang->line('config_msg_uid'), 'msg_uid', array('class'=>'control-label col-xs-2')); ?> +
    + 'msg_uid', + 'id'=>'msg_uid', + 'class'=>'form-control input-sm', + 'type'=>'password', + 'value'=>$this->config->item('msg_uid')));?> +
    +
    + +
    + lang->line('config_msg_pwd'), 'msg_pwd', array('class'=>'control-label col-xs-2')); ?> +
    + 'msg_pwd', + 'id'=>'msg_pwd', + 'class'=>'form-control input-sm', + 'type'=>'password', + 'value'=>$this->config->item('msg_pwd')));?> +
    + + +
    + 'submit_form', + 'id'=>'submit_form', + 'value'=>$this->lang->line('common_submit'), + 'class'=>'btn btn-primary btn-sm pull-right'));?> +
    +
    + + + + diff --git a/application/views/messages/index.html b/application/views/messages/index.html new file mode 100644 index 000000000..b702fbc39 --- /dev/null +++ b/application/views/messages/index.html @@ -0,0 +1,11 @@ + + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + + diff --git a/application/views/messages/sms-sender.php b/application/views/messages/sms-sender.php new file mode 100755 index 000000000..4c1a5b2aa --- /dev/null +++ b/application/views/messages/sms-sender.php @@ -0,0 +1,31 @@ + + 'send_sms_form', 'enctype'=>'multipart/form-data', 'method'=>'post', 'class'=>'form-horizontal')); ?> +
    + +
    + +
    + 'form-control', 'type'=>'text','name'=>'first_name', 'value'=>$person_info->first_name));?> +
    +
    +
    + +
    + 'form-control', 'type'=>'text','name'=>'last_name', 'value'=>$person_info->last_name));?> +
    +
    +
    + +
    + 'form-control', 'type'=>'text','name'=>'phone', 'value'=>$person_info->phone_number));?> +
    +
    +
    + +
    + + (Maximum 140 characters) +
    +
    + + diff --git a/application/views/messages/sms.php b/application/views/messages/sms.php new file mode 100755 index 000000000..04cf721a1 --- /dev/null +++ b/application/views/messages/sms.php @@ -0,0 +1,30 @@ + +load->view("partial/header"); ?> + +
    + 'send_sms_form', 'enctype'=>'multipart/form-data', 'method'=>'post', 'class'=>'form-horizontal')); ?> +
    + SEND SMS +
    +
    + +
    + + ( In case of multiple recipients, enter mobile numbers separated with comma ) +
    +

    +
    + +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + +load->view("partial/footer"); ?> diff --git a/database/database.sql b/database/database.sql index 815759bcb..91a486795 100644 --- a/database/database.sql +++ b/database/database.sql @@ -64,7 +64,10 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('decimal_point', '.'), ('currency_decimals', '2'), ('tax_decimals', '2'), -('quantity_decimals', '0'); +('quantity_decimals', '0'), +('msg_msg',''), +('msg_uid', 'userName'), +('msg_pwd', 'password'); -- -------------------------------------------------------- @@ -289,12 +292,13 @@ CREATE TABLE `ospos_modules` ( -- INSERT INTO `ospos_modules` (`name_lang_key`, `desc_lang_key`, `sort`, `module_id`) VALUES -('module_config', 'module_config_desc', 100, 'config'), +('module_config', 'module_config_desc', 110, 'config'), ('module_customers', 'module_customers_desc', 10, 'customers'), ('module_employees', 'module_employees_desc', 80, 'employees'), ('module_giftcards', 'module_giftcards_desc', 90, 'giftcards'), ('module_items', 'module_items_desc', 20, 'items'), ('module_item_kits', 'module_item_kits_desc', 30, 'item_kits'), +('module_messages', 'module_messages_desc', 100, 'messages'), ('module_receivings', 'module_receivings_desc', 60, 'receivings'), ('module_reports', 'module_reports_desc', 50, 'reports'), ('module_sales', 'module_sales_desc', 70, 'sales'), @@ -365,6 +369,7 @@ INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES ('giftcards', 'giftcards'), ('items', 'items'), ('item_kits', 'item_kits'), +('messages', 'messages'), ('receivings', 'receivings'), ('reports', 'reports'), ('sales', 'sales'), @@ -410,6 +415,7 @@ INSERT INTO `ospos_grants` (`permission_id`, `person_id`) VALUES ('giftcards', 1), ('items', 1), ('item_kits', 1), +('messages', 1), ('receivings', 1), ('reports', 1), ('sales', 1), diff --git a/database/tables.sql b/database/tables.sql index 7651a1565..56871e0ab 100644 --- a/database/tables.sql +++ b/database/tables.sql @@ -64,7 +64,11 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('decimal_point', '.'), ('currency_decimals', '2'), ('tax_decimals', '2'), -('quantity_decimals', '0'); +('quantity_decimals', '0'), +('msg_msg',''), +('msg_uid', 'userName'), +('msg_pwd', 'password'); + -- -------------------------------------------------------- @@ -289,12 +293,13 @@ CREATE TABLE `ospos_modules` ( -- INSERT INTO `ospos_modules` (`name_lang_key`, `desc_lang_key`, `sort`, `module_id`) VALUES -('module_config', 'module_config_desc', 100, 'config'), +('module_config', 'module_config_desc', 110, 'config'), ('module_customers', 'module_customers_desc', 10, 'customers'), ('module_employees', 'module_employees_desc', 80, 'employees'), ('module_giftcards', 'module_giftcards_desc', 90, 'giftcards'), ('module_items', 'module_items_desc', 20, 'items'), ('module_item_kits', 'module_item_kits_desc', 30, 'item_kits'), +('module_messages', 'module_messages_desc', 100, 'messages'), ('module_receivings', 'module_receivings_desc', 60, 'receivings'), ('module_reports', 'module_reports_desc', 50, 'reports'), ('module_sales', 'module_sales_desc', 70, 'sales'), @@ -365,6 +370,7 @@ INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES ('giftcards', 'giftcards'), ('items', 'items'), ('item_kits', 'item_kits'), +('messages', 'messages'), ('receivings', 'receivings'), ('reports', 'reports'), ('sales', 'sales'), @@ -410,6 +416,7 @@ INSERT INTO `ospos_grants` (`permission_id`, `person_id`) VALUES ('giftcards', 1), ('items', 1), ('item_kits', 1), +('messages', 1), ('receivings', 1), ('reports', 1), ('sales', 1), diff --git a/images/menubar/messages.png b/images/menubar/messages.png new file mode 100644 index 0000000000000000000000000000000000000000..4a582a0a37e9784b0b8f44a5c85e4026e8171da7 GIT binary patch literal 1155 zcmV-}1bq96P)|0G}6G0Sy-9{;;kO+z>LigND7Q~B}_S9<=4zYp;Sx@Yqx0L5iT= zUOh+(;zfl-!GovtB8bKACTW@`ZR))3q}|$Ne`aTACZ-P_O%FRW@0<7L{mh$*qoX5; zleSiK3*-;7L0Bi8_W7hrxJI}_xIFu)RE~3f6TAT+0;kBI4CN(G!)_2ZkqID{k^s=1 z&J)f-yi_7wAV5@<0Dua;jb+|<|aH6 zj)i05*evG2bOz89HMGs+&c{WJW2e2mL&C$)hYoPG%hP9e{{4r~@M3lCc%sB4%-*^Y zdi4+PEy5jR?nDz9DMw^72gM265W6q(*s;FwjvXHy!ftCX^cZVz-|QqRuq1kRJO}VRkVuZq+P{8LGzc;YWk(H=27m%FfdhacYj%tZF*=k;1_Gc;UApNoI@djYG z)fS!~AOKZW06^gp1c6jV0BR~}f#70E4FRaA1OOIG1m*`71fUFxkwBMN*5dBNW33a2 zI1Ewtz8Ba~5rmk@k-2|4ikF7m%VOrsXP_{d?l{1N@uO1!Xa_|}ouI;*JE1;sTySuevD3jEv{H#ArVa^F5)JnuGNHC-DUCub)E7`X1Hx^M2VN-V!tCr8_@9ISb{qTgN+J z--d5*o;zblNi$%;4fw!5LE0p>&N550eE>hLcrv=1sVSJ5O0a&O4b&t>4@8sIE#d-k zp_jA?Zi3@j5rr=e>m>K<6vfkW6#9cbj}9Wd;Z+dvq6L)-CM?2(&)sK`X6Y0ynv7zz zv_W>i=IN3Hq>LCc>LaEJxK`ay_&@--Ko}Ks2=!nh^qZlmfs%kECm-g6&}DHtK{iUT z6qCJY!wSy?fGbYWMW@iicAeTgQ%&RI;UveWvj&Z|MLeA?@+#(DJf0r+=ktFB7yw{{ V;NB Date: Tue, 26 Apr 2016 16:38:13 +0530 Subject: [PATCH 02/12] Second commit --- application/helpers/table_helper.php | 53 ++++++++++++++++++---------- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/application/helpers/table_helper.php b/application/helpers/table_helper.php index 663683ad2..8c636aed2 100644 --- a/application/helpers/table_helper.php +++ b/application/helpers/table_helper.php @@ -6,17 +6,26 @@ function get_sales_manage_table($sales, $controller) $table='
    '.to_currency( $sale['amount_tendered'] ).''.to_currency( $sale['amount_due'] ).''.to_currency( $sale['change_due'] ).''.$sale['payment_type'].''.$sale['invoice_number'].''.$sale['payment_type'].''.$sale['payment_type'].''.$sale['invoice_number'].'
    '.character_limiter($person->first_name,13).''.mailto($person->email,character_limiter($person->email,22)).''.character_limiter($person->phone_number,13).''.anchor('Messages'."/view/$person->person_id", '', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line('messages_send_msg'))).''.anchor($controller_name."/view/$person->person_id", '', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line($controller_name.'_update'))).'
    '.character_limiter($supplier->first_name,13).''.mailto($supplier->email,character_limiter($supplier->email,22)).''.character_limiter($supplier->phone_number,13).''.anchor('Messages'."/view/$supplier->person_id", '', array('class'=>'modal-dlg modal-btn-submit' , 'title'=>$CI->lang->line('messages_send_msg'))).''.character_limiter($supplier->person_id,5).''.anchor($controller_name."/view/$supplier->person_id", '', array('class'=>"modal-dlg modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_update'))).'
    '; $headers = array(' ', - $CI->lang->line('sales_receipt_number'), - $CI->lang->line('sales_sale_time'), - $CI->lang->line('customers_customer'), - $CI->lang->line('sales_amount_tendered'), - $CI->lang->line('sales_amount_due'), - $CI->lang->line('sales_change_due'), - $CI->lang->line('sales_payment'), - $CI->lang->line('sales_invoice_number'), - ' ', - ' ', - ' '); + $CI->lang->line('sales_receipt_number'), + $CI->lang->line('sales_sale_time'), + $CI->lang->line('customers_customer'), + $CI->lang->line('sales_amount_tendered'), + $CI->lang->line('sales_amount_due'), + $CI->lang->line('sales_change_due'), + $CI->lang->line('sales_payment')); + + if($CI->config->item('invoice_enable') == TRUE) + { + $headers[] = $CI->lang->line('sales_invoice_number'); + $headers[] = ' '; + $headers[] = ' '; + $headers[] = ' '; + } + else + { + $headers[] = ' '; + $headers[] = ' '; + } $table.=''; foreach($headers as $header) @@ -75,11 +84,22 @@ function get_sales_manage_sale_data_row($sale, $controller) $table_data_row.=''; $table_data_row.=''; $table_data_row.=''; - $table_data_row.=''; - $table_data_row.=''; + if($CI->config->item('invoice_enable') == TRUE) + { + $table_data_row.=''; + $table_data_row.=''; + } + else + { + // this size includes the 8% of invoice number and 5% of the invoice gliphicon, pluf of course the 12% for the field itself + $table_data_row.=''; + } $table_data_row.=''; $table_data_row.=''; - $table_data_row.=''; + if($CI->config->item('invoice_enable') == TRUE) + { + $table_data_row.=''; + } $table_data_row.=''; return $table_data_row; @@ -194,9 +214,6 @@ function get_detailed_data_row($row, $controller) return $table_data_row; } - - - /* Gets the html table to manage suppliers. */ @@ -212,7 +229,6 @@ function get_supplier_manage_table($suppliers,$controller) $CI->lang->line('common_first_name'), $CI->lang->line('common_email'), $CI->lang->line('common_phone_number'), - $CI->lang->line('common_send_msg'), $CI->lang->line('suppliers_supplier_id'), $CI->lang->line('common_update'),); @@ -270,7 +286,6 @@ function get_supplier_data_row($supplier,$controller) return $table_data_row; } - /* Gets the html table to manage items. */ From d330472158ff90b8efca81c75e6f0fcf8ffc3379 Mon Sep 17 00:00:00 2001 From: RamkrishnaMondal Date: Tue, 26 Apr 2016 19:27:44 +0530 Subject: [PATCH 03/12] Third commit --- application/views/configs/message_config.php | 4 ++-- application/views/messages/sms-sender.php | 1 - application/views/messages/sms.php | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/application/views/configs/message_config.php b/application/views/configs/message_config.php index 21567712c..3aa9a89cb 100755 --- a/application/views/configs/message_config.php +++ b/application/views/configs/message_config.php @@ -1,8 +1,8 @@ 'message_config_form', 'enctype'=>'multipart/form-data', 'class'=>'form-horizontal')); ?> -
    +
    -

    Message settings

    +
    Note : If you wish to use SMS template, save your message here. Otherwise keep the 'Saved Text Message' box blank.


    diff --git a/application/views/messages/sms-sender.php b/application/views/messages/sms-sender.php index 4c1a5b2aa..ab7246b05 100755 --- a/application/views/messages/sms-sender.php +++ b/application/views/messages/sms-sender.php @@ -24,7 +24,6 @@
    - (Maximum 140 characters)
    diff --git a/application/views/messages/sms.php b/application/views/messages/sms.php index 04cf721a1..0971f41af 100755 --- a/application/views/messages/sms.php +++ b/application/views/messages/sms.php @@ -9,7 +9,7 @@
    - + ( In case of multiple recipients, enter mobile numbers separated with comma )

    From ee237c3c2e0c7853b744e0f74c674b8109c33f05 Mon Sep 17 00:00:00 2001 From: RamkrishnaMondal Date: Thu, 28 Apr 2016 13:22:01 +0530 Subject: [PATCH 04/12] Fourth commit --- application/config/database.php.tmpl | 6 ++--- application/controllers/Config.php | 3 ++- application/controllers/Messages.php | 16 +++---------- application/language/en/config_lang.php | 1 + application/libraries/Sms.php | 23 +++++++++++++----- application/views/configs/message_config.php | 25 +++++++++++--------- application/views/messages/sms-sender.php | 6 ++--- database/database.sql | 7 +++--- database/tables.sql | 7 +++--- 9 files changed, 51 insertions(+), 43 deletions(-) diff --git a/application/config/database.php.tmpl b/application/config/database.php.tmpl index 9f1cf6c2e..92454285a 100644 --- a/application/config/database.php.tmpl +++ b/application/config/database.php.tmpl @@ -76,9 +76,9 @@ $query_builder = TRUE; $db['default'] = array( 'dsn' => '', 'hostname' => 'localhost', - 'username' => '', - 'password' => '', - 'database' => '', + 'username' => 'root', + 'password' => 'ankit2015', + 'database' => 'tm4', 'dbdriver' => 'mysqli', 'dbprefix' => 'ospos_', 'pconnect' => FALSE, diff --git a/application/controllers/Config.php b/application/controllers/Config.php index 09646daa6..e5f47f2e5 100644 --- a/application/controllers/Config.php +++ b/application/controllers/Config.php @@ -102,7 +102,8 @@ class Config extends Secure_area $batch_save_data = array( 'msg_msg'=>$this->input->post('msg_msg'), 'msg_uid'=>$this->input->post('msg_uid'), - 'msg_pwd'=>$this->input->post('msg_pwd') + 'msg_pwd'=>$this->input->post('msg_pwd'), + 'msg_src'=>$this->input->post('msg_src') ); diff --git a/application/controllers/Messages.php b/application/controllers/Messages.php index 425737482..f781dad29 100644 --- a/application/controllers/Messages.php +++ b/application/controllers/Messages.php @@ -19,7 +19,7 @@ class Messages extends Secure_area function view($person_id=-1) { $data['person_info']=$this->Person->get_info($person_id); - $this->load->view('messages/sms-sender',$data); + $this->load->view('messages/sms-sender', $data); } @@ -27,21 +27,11 @@ class Messages extends Secure_area { $uid = $this->config->item('msg_uid'); $pwd = $this->config->item('msg_pwd'); + $src = $this->config->item('msg_src'); $phone = $this->input->post('phone'); $msg = $this->input->post('msg'); - - $response = $this->sms->sendsms($uid,$pwd,$phone,$msg); + $response = $this->sms->sendsms($uid, $pwd, $src, $phone, $msg); $this->load->view('messages/sms'); - - if('send') - { - echo "Message Submitted Successfully"; - } - else - { - echo "Message NOT Submitted Successfully"; - } - } } ?> diff --git a/application/language/en/config_lang.php b/application/language/en/config_lang.php index 0b984c797..490b44fb4 100644 --- a/application/language/en/config_lang.php +++ b/application/language/en/config_lang.php @@ -98,6 +98,7 @@ $lang["config_message_configuration"] = "Message Configuration"; $lang["config_msg_msg"] = "Saved Text Message:"; $lang["config_msg_uid"] = "SMS-API UserName:"; $lang["config_msg_pwd"] = "SMS-API Password:"; +$lang["config_msg_src"] = "SMS-API Sender ID:"; $lang["config_number_format"] = "Number Format"; $lang["config_phone"] = "Company Phone"; $lang["config_phone_required"] = "Company phone is a required field"; diff --git a/application/libraries/Sms.php b/application/libraries/Sms.php index 26cceae7d..23ee0476b 100644 --- a/application/libraries/Sms.php +++ b/application/libraries/Sms.php @@ -1,12 +1,23 @@ diff --git a/application/views/configs/message_config.php b/application/views/configs/message_config.php index 3aa9a89cb..c186aee75 100755 --- a/application/views/configs/message_config.php +++ b/application/views/configs/message_config.php @@ -1,8 +1,8 @@ 'message_config_form', 'enctype'=>'multipart/form-data', 'class'=>'form-horizontal')); ?>
    -
    +
    -
    Note : If you wish to use SMS template, save your message here. Otherwise keep the 'Saved Text Message' box blank.
    +
    Note : If you wish to use SMS template, save your message here. Otherwise keep the 'Saved Text Message' box blank.


    @@ -18,14 +18,7 @@ 'class'=>'form-control input-sm', 'value'=>$this->config->item('msg_msg')));?>
    - - - - -
    - -
    @@ -35,7 +28,7 @@ 'name'=>'msg_uid', 'id'=>'msg_uid', 'class'=>'form-control input-sm', - 'type'=>'password', + 'type'=>'text', 'value'=>$this->config->item('msg_uid')));?>
    @@ -50,8 +43,18 @@ 'type'=>'password', 'value'=>$this->config->item('msg_pwd')));?>
    + - +
    + lang->line('config_msg_src'), 'msg_src', array('class'=>'control-label col-xs-2')); ?> +
    + 'msg_src', + 'id'=>'msg_src', + 'class'=>'form-control input-sm', + 'type'=>'text', + 'value'=>$this->config->item('msg_src')));?> +
    'submit_form', diff --git a/application/views/messages/sms-sender.php b/application/views/messages/sms-sender.php index ab7246b05..4e7400374 100755 --- a/application/views/messages/sms-sender.php +++ b/application/views/messages/sms-sender.php @@ -5,19 +5,19 @@
    - 'form-control', 'type'=>'text','name'=>'first_name', 'value'=>$person_info->first_name));?> + 'form-control', 'type'=>'text','name'=>'first_name', 'readonly'=>'true', 'value'=>$person_info->first_name));?>
    - 'form-control', 'type'=>'text','name'=>'last_name', 'value'=>$person_info->last_name));?> + 'form-control', 'type'=>'text','name'=>'last_name', 'readonly'=>'true', 'value'=>$person_info->last_name));?>
    - 'form-control', 'type'=>'text','name'=>'phone', 'value'=>$person_info->phone_number));?> + 'form-control', 'type'=>'text','name'=>'phone', 'readonly'=>'true', 'value'=>$person_info->phone_number));?>
    diff --git a/database/database.sql b/database/database.sql index 91a486795..b6ce81534 100644 --- a/database/database.sql +++ b/database/database.sql @@ -65,9 +65,10 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('currency_decimals', '2'), ('tax_decimals', '2'), ('quantity_decimals', '0'), -('msg_msg',''), -('msg_uid', 'userName'), -('msg_pwd', 'password'); +('msg_msg', ''), +('msg_uid', ''), +('msg_src', ''), +('msg_pwd', ''); -- -------------------------------------------------------- diff --git a/database/tables.sql b/database/tables.sql index 56871e0ab..8de566d84 100644 --- a/database/tables.sql +++ b/database/tables.sql @@ -65,9 +65,10 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('currency_decimals', '2'), ('tax_decimals', '2'), ('quantity_decimals', '0'), -('msg_msg',''), -('msg_uid', 'userName'), -('msg_pwd', 'password'); +('msg_msg', ''), +('msg_uid', ''), +('msg_src', ''), +('msg_pwd', ''); -- -------------------------------------------------------- From cde401a0783a1485aeeb82d68fc7813a198282b1 Mon Sep 17 00:00:00 2001 From: RamkrishnaMondal Date: Thu, 28 Apr 2016 13:27:20 +0530 Subject: [PATCH 05/12] Fifth commit --- application/config/database.php.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/config/database.php.tmpl b/application/config/database.php.tmpl index 92454285a..9f1cf6c2e 100644 --- a/application/config/database.php.tmpl +++ b/application/config/database.php.tmpl @@ -76,9 +76,9 @@ $query_builder = TRUE; $db['default'] = array( 'dsn' => '', 'hostname' => 'localhost', - 'username' => 'root', - 'password' => 'ankit2015', - 'database' => 'tm4', + 'username' => '', + 'password' => '', + 'database' => '', 'dbdriver' => 'mysqli', 'dbprefix' => 'ospos_', 'pconnect' => FALSE, From d01e9ffcfee15ad205cc32df9e0d21c04251e186 Mon Sep 17 00:00:00 2001 From: RamkrishnaMondal Date: Thu, 28 Apr 2016 19:40:14 +0530 Subject: [PATCH 06/12] Sixth commit --- application/helpers/table_helper.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/helpers/table_helper.php b/application/helpers/table_helper.php index 8c636aed2..6e6dc9f48 100644 --- a/application/helpers/table_helper.php +++ b/application/helpers/table_helper.php @@ -229,6 +229,7 @@ function get_supplier_manage_table($suppliers,$controller) $CI->lang->line('common_first_name'), $CI->lang->line('common_email'), $CI->lang->line('common_phone_number'), + $CI->lang->line('common_send_msg'), $CI->lang->line('suppliers_supplier_id'), $CI->lang->line('common_update'),); From 2b9c9ce2030b9df48dc8953d8efffc02d6372e3c Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 30 Apr 2016 09:50:01 +0100 Subject: [PATCH 07/12] enable errors, refactor code, various issues fixing, upgrade database script (#472) --- application/controllers/Config.php | 7 +- application/controllers/Messages.php | 52 ++++++++++--- application/libraries/Sms.php | 33 +++++++-- application/views/configs/message_config.php | 77 ++++++++------------ application/views/employees/form.php | 17 ++--- application/views/messages/form_sms.php | 76 +++++++++++++++++++ application/views/messages/sms-sender.php | 30 -------- application/views/messages/sms.php | 74 ++++++++++++------- database/2.4_to_3.0.sql | 11 +++ 9 files changed, 241 insertions(+), 136 deletions(-) create mode 100644 application/views/messages/form_sms.php delete mode 100755 application/views/messages/sms-sender.php diff --git a/application/controllers/Config.php b/application/controllers/Config.php index e5f47f2e5..de27b36f5 100644 --- a/application/controllers/Config.php +++ b/application/controllers/Config.php @@ -91,10 +91,10 @@ class Config extends Secure_area 'quantity_decimals'=>$this->input->post('quantity_decimals') ); - $result = $this->Appconfig->batch_save($batch_save_data); - $success = $result ? true : false; + $result = $this->Appconfig->batch_save($batch_save_data); + $success = $result ? true : false; - echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); + echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); } function save_message() @@ -104,7 +104,6 @@ class Config extends Secure_area 'msg_uid'=>$this->input->post('msg_uid'), 'msg_pwd'=>$this->input->post('msg_pwd'), 'msg_src'=>$this->input->post('msg_src') - ); $result = $this->Appconfig->batch_save($batch_save_data); diff --git a/application/controllers/Messages.php b/application/controllers/Messages.php index f781dad29..023dcf5f9 100644 --- a/application/controllers/Messages.php +++ b/application/controllers/Messages.php @@ -12,26 +12,56 @@ class Messages extends Secure_area { $data['controller_name'] = $this->get_controller_name(); $this->load->view('messages/sms'); - } - function view($person_id=-1) { - $data['person_info']=$this->Person->get_info($person_id); - $this->load->view('messages/sms-sender', $data); + $data['person_info'] = $this->Person->get_info($person_id); + $this->load->view('messages/form_sms', $data); } - function send() { - $uid = $this->config->item('msg_uid'); - $pwd = $this->config->item('msg_pwd'); - $src = $this->config->item('msg_src'); + $username = $this->config->item('msg_uid'); + $password = $this->config->item('msg_pwd'); + $originator = $this->config->item('msg_src'); $phone = $this->input->post('phone'); - $msg = $this->input->post('msg'); - $response = $this->sms->sendsms($uid, $pwd, $src, $phone, $msg); - $this->load->view('messages/sms'); + $message = $this->input->post('msg'); + + $response = $this->sms->sendSMS($username, $password, $phone, $message, $originator); + + $data = array(); + + if($response) + { + $data['success'] = $this->lang->line('messages_successfully_sent') . ' ' . $phone; + } + else + { + $data['error'] = $this->lang->line('messages_unsuccessfully_sent') . ' ' . $phone; + } + + $this->load->view('messages/sms', $data); + } + + function send_form($person_id=-1) + { + $username = $this->config->item('msg_uid'); + $password = $this->config->item('msg_pwd'); + $phone = $this->input->post('phone'); + $message = $this->input->post('msg'); + $originator = $this->config->item('company'); + + $response = $this->sms->sendSMS($username, $password, $phone, $message, $originator); + + if($response) + { + echo json_encode(array('success'=>true, 'message'=>$this->lang->line('messages_successfully_sent') . ' ' . $phone, 'person_id'=>$person_id)); + } + else + { + echo json_encode(array('success'=>false, 'message'=>$this->lang->line('messages_unsuccessfully_sent') . ' ' . $phone, 'person_id'=>-1)); + } } } ?> diff --git a/application/libraries/Sms.php b/application/libraries/Sms.php index 23ee0476b..7d7910ded 100644 --- a/application/libraries/Sms.php +++ b/application/libraries/Sms.php @@ -2,22 +2,41 @@ class Sms { + /* + * SMS send function + * Example of use: $response = sendSMS('myUsername', 'myPassword', '4477777777', 'My test message', 'TextMessage'); + */ + function sendSMS($username, $password, $phone, $message, $originator) + { + if( empty($username) || empty($password) || empty($phone) || empty($message) || empty($originator) ) + { + //echo $username . ' ' . $password . ' ' . $phone . ' ' . $message . ' ' . $originator; - function sendsms($uid, $pwd, $src, $phone, $msg) - { - - //SMS Gateway API Link (Will be provided by your SMS Service Provider)// + return FALSE; + } + + // add call to send a message via 3rd party API here - $url="http://xxx.xxx.xxx.xxx/send_sms?username=$uid&password=$pwd&src=$src&dst=$phone&msg=$msg&dr=1"; // EXAMPLE OF URL LINK // + // EXAMPLE OR URL LINK + /* + $url="https://xxx.xxx.xxx.xxx/send_sms?username=$uid&password=$pwd&src=$src&dst=$phone&msg=$msg&dr=1"; $c = curl_init(); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_URL, $url); $response = curl_exec($c); curl_close($c); + */ - echo "Message Sent Successfully"; + // This is a textmarketer.co.uk API call example see: http://wiki.textmarketer.co.uk/display/DevDoc/Text+Marketer+Developer+Documentation+-+Wiki+Home + /* + $url = 'https://api.textmarketer.co.uk/gateway/'."?username=$username&password=$password&option=xml"; + $url .= "&to=$phone&message=".urlencode($message).'&orig='.urlencode($originator); + $fp = fopen($url, 'r'); + return fread($fp, 1024); + */ - } + return TRUE; + } } ?> diff --git a/application/views/configs/message_config.php b/application/views/configs/message_config.php index c186aee75..c8eea3174 100755 --- a/application/views/configs/message_config.php +++ b/application/views/configs/message_config.php @@ -1,13 +1,37 @@ 'message_config_form', 'enctype'=>'multipart/form-data', 'class'=>'form-horizontal')); ?>
    -
    - -
    Note : If you wish to use SMS template, save your message here. Otherwise keep the 'Saved Text Message' box blank.
    +
    +
    lang->line('common_fields_required_message'); ?>
    -
    -
    +
      - +
      Note : If you wish to use SMS template, save your message here. Otherwise keep the 'Saved Text Message' box blank.
      + +
      + +
      + lang->line('config_msg_uid'), 'msg_uid', array('class'=>'control-label col-xs-2')); ?> +
      + 'msg_uid', + 'id'=>'msg_uid', + 'class'=>'form-control input-sm', + 'type'=>'password', + 'value'=>$this->config->item('msg_uid')));?> +
      +
      + +
      + lang->line('config_msg_pwd'), 'msg_pwd', array('class'=>'control-label col-xs-2')); ?> +
      + 'msg_pwd', + 'id'=>'msg_pwd', + 'class'=>'form-control input-sm', + 'type'=>'password', + 'value'=>$this->config->item('msg_pwd')));?> +
      +
      lang->line('config_msg_msg'), 'msg_msg', array('class'=>'control-label col-xs-2')); ?> @@ -20,42 +44,6 @@
      - -
      - lang->line('config_msg_uid'), 'msg_uid', array('class'=>'control-label col-xs-2')); ?> -
      - 'msg_uid', - 'id'=>'msg_uid', - 'class'=>'form-control input-sm', - 'type'=>'text', - 'value'=>$this->config->item('msg_uid')));?> -
      -
      - -
      - lang->line('config_msg_pwd'), 'msg_pwd', array('class'=>'control-label col-xs-2')); ?> -
      - 'msg_pwd', - 'id'=>'msg_pwd', - 'class'=>'form-control input-sm', - 'type'=>'password', - 'value'=>$this->config->item('msg_pwd')));?> -
      -
      - -
      - lang->line('config_msg_src'), 'msg_src', array('class'=>'control-label col-xs-2')); ?> -
      - 'msg_src', - 'id'=>'msg_src', - 'class'=>'form-control input-sm', - 'type'=>'text', - 'value'=>$this->config->item('msg_src')));?> -
      -
      'submit_form', 'id'=>'submit_form', @@ -63,15 +51,12 @@ 'class'=>'btn btn-primary btn-sm pull-right'));?>
      - diff --git a/application/views/employees/form.php b/application/views/employees/form.php index 2e7eba723..d21d6ddb5 100644 --- a/application/views/employees/form.php +++ b/application/views/employees/form.php @@ -157,17 +157,16 @@ $(document).ready(function() }); $('#employee_form').validate($.extend({ - submitHandler:function(form) + submitHandler:function(form) { $(form).ajaxSubmit({ - success:function(response) - { - dialog_support.hide(); - post_person_form_submit(response); - }, - dataType:'json' - }); - + success:function(response) + { + dialog_support.hide(); + post_person_form_submit(response); + }, + dataType:'json' + }); }, rules: { diff --git a/application/views/messages/form_sms.php b/application/views/messages/form_sms.php new file mode 100644 index 000000000..b49b7c615 --- /dev/null +++ b/application/views/messages/form_sms.php @@ -0,0 +1,76 @@ +
      lang->line('common_fields_required_message'); ?>
      + + + +person_id, array('id'=>'send_sms_form', 'class'=>'form-horizontal')); ?> +
      +
      + lang->line('messages_first_name'), 'first_name_label', array('for'=>'first_name', 'class'=>'control-label col-xs-2')); ?> +
      + 'form-control input-sm', 'type'=>'text', 'name'=>'first_name', 'value'=>$person_info->first_name));?> +
      +
      +
      + lang->line('messages_last_name'), 'last_name_label', array('for'=>'last_name', 'class'=>'control-label col-xs-2')); ?> +
      + 'form-control input-sm', 'type'=>'text', 'name'=>'last_name', 'value'=>$person_info->last_name));?> +
      +
      +
      + lang->line('messages_mobile'), 'last_name_label', array('for'=>'phone', 'class'=>'control-label col-xs-2')); ?> +
      + 'form-control input-sm', 'type'=>'text', 'name'=>'phone', 'value'=>$person_info->phone_number));?> +
      +
      +
      + lang->line('messages_mesage'), 'last_name_label', array('for'=>'msg', 'class'=>'control-label col-xs-2')); ?> +
      + 'msg', 'value'=>$this->config->item('msg_msg'), 'id'=>'msg', 'class'=>'form-control input-sm'));?> +
      +
      +
      + + + \ No newline at end of file diff --git a/application/views/messages/sms-sender.php b/application/views/messages/sms-sender.php deleted file mode 100755 index 4e7400374..000000000 --- a/application/views/messages/sms-sender.php +++ /dev/null @@ -1,30 +0,0 @@ - - 'send_sms_form', 'enctype'=>'multipart/form-data', 'method'=>'post', 'class'=>'form-horizontal')); ?> -
      - -
      - -
      - 'form-control', 'type'=>'text','name'=>'first_name', 'readonly'=>'true', 'value'=>$person_info->first_name));?> -
      -
      -
      - -
      - 'form-control', 'type'=>'text','name'=>'last_name', 'readonly'=>'true', 'value'=>$person_info->last_name));?> -
      -
      -
      - -
      - 'form-control', 'type'=>'text','name'=>'phone', 'readonly'=>'true', 'value'=>$person_info->phone_number));?> -
      -
      -
      - -
      - -
      -
      - - diff --git a/application/views/messages/sms.php b/application/views/messages/sms.php index 0971f41af..213031f7f 100755 --- a/application/views/messages/sms.php +++ b/application/views/messages/sms.php @@ -1,30 +1,48 @@ - load->view("partial/header"); ?> - -
      - 'send_sms_form', 'enctype'=>'multipart/form-data', 'method'=>'post', 'class'=>'form-horizontal')); ?> -
      - SEND SMS -
      -
      - -
      - - ( In case of multiple recipients, enter mobile numbers separated with comma ) -
      -

      -
      - -
      - -
      -
      -
      -
      - -
      -
      -
      -
      -load->view("partial/footer"); ?> +".$error.""; +} + +if (!empty($warning)) +{ + echo "
      ".$warning."
      "; +} + +if (isset($success)) +{ + echo "
      ".$success."
      "; +} +?> + +
      + 'send_sms_form', 'enctype'=>'multipart/form-data', 'method'=>'post', 'class'=>'form-horizontal')); ?> +
      + SEND SMS +
      +
      + +
      + + ( In case of multiple recipients, enter mobile numbers separated with comma ) +
      +

      + +
      + +
      + +
      +
      + +
      + +
      +
      +
      + +
      + +load->view("partial/footer"); ?> diff --git a/database/2.4_to_3.0.sql b/database/2.4_to_3.0.sql index 34eb0aa66..6d403cd4e 100644 --- a/database/2.4_to_3.0.sql +++ b/database/2.4_to_3.0.sql @@ -38,4 +38,15 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('receipt_show_description', '1'), ('receipt_show_serialnumber', '1'), ('invoice_enable', '1'); + +UPDATE `ospos_modules` SET `sort` = 110 WHERE `name_lang_key` = 'module_config'; + +INSERT INTO `ospos_modules` (`name_lang_key`, `desc_lang_key`, `sort`, `module_id`) VALUES + ('module_messages', 'module_messages_desc', 100, 'messages'); + +INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES + ('messages', 'messages'); + +INSERT INTO `ospos_grants` (`permission_id`, `person_id`) VALUES + ('messages', 1); \ No newline at end of file From 5fb73ce2cb4dd9d0c49fa635098bbf4006f1eaae Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 30 Apr 2016 17:54:17 +0100 Subject: [PATCH 08/12] fixed error reporting, fixed table_helper, added translations, fixed bootstrap grid, various fixes (#472) --- application/controllers/Config.php | 22 +++--- application/controllers/Messages.php | 18 ++--- application/helpers/table_helper.php | 20 ++--- application/language/de-CH/config_lang.php | 9 +++ application/language/de-CH/messages_lang.php | 14 ++++ application/language/de-CH/module_lang.php | 2 + application/language/en/common_lang.php | 2 - application/language/en/config_lang.php | 11 ++- application/language/en/messages_lang.php | 13 +++- application/language/en/module_lang.php | 2 +- application/language/es/config_lang.php | 9 +++ application/language/es/messages_lang.php | 14 ++++ application/language/es/module_lang.php | 2 + application/language/fr/config_lang.php | 9 +++ application/language/fr/messages_lang.php | 14 ++++ application/language/fr/module_lang.php | 2 + application/language/hr-HR/config_lang.php | 9 +++ application/language/hr-HR/messages_lang.php | 14 ++++ application/language/hr-HR/module_lang.php | 2 + application/language/hu-HU/config_lang.php | 9 +++ application/language/hu-HU/messages_lang.php | 14 ++++ application/language/hu-HU/module_lang.php | 2 + application/language/id/config_lang.php | 9 +++ application/language/id/messages_lang.php | 14 ++++ application/language/id/module_lang.php | 2 + application/language/nl-BE/config_lang.php | 9 +++ application/language/nl-BE/messages_lang.php | 14 ++++ application/language/nl-BE/module_lang.php | 2 + application/language/pt-BR/common_lang.php | 2 +- application/language/pt-BR/config_lang.php | 9 +++ application/language/pt-BR/messages_lang.php | 14 ++++ application/language/pt-BR/module_lang.php | 2 + application/language/ru/config_lang.php | 9 +++ application/language/ru/messages_lang.php | 14 ++++ application/language/ru/module_lang.php | 2 + application/language/th/config_lang.php | 9 +++ application/language/th/messages_lang.php | 14 ++++ application/language/th/module_lang.php | 2 + application/language/tr/config_lang.php | 9 +++ application/language/tr/messages_lang.php | 14 ++++ application/language/tr/module_lang.php | 2 + application/language/zh/config_lang.php | 9 +++ application/language/zh/messages_lang.php | 14 ++++ application/language/zh/module_lang.php | 2 + application/libraries/Sms.php | 54 +++++++------ application/views/configs/message_config.php | 63 +++++++++++---- application/views/messages/form_sms.php | 6 +- application/views/messages/sms.php | 81 +++++++++++--------- translations/config_lang.csv | 9 +++ translations/messages_lang.csv | 13 ++++ translations/module_lang.csv | 2 + 51 files changed, 497 insertions(+), 121 deletions(-) create mode 100644 application/language/de-CH/messages_lang.php create mode 100644 application/language/es/messages_lang.php create mode 100644 application/language/fr/messages_lang.php create mode 100644 application/language/hr-HR/messages_lang.php create mode 100644 application/language/hu-HU/messages_lang.php create mode 100644 application/language/id/messages_lang.php create mode 100644 application/language/nl-BE/messages_lang.php create mode 100644 application/language/pt-BR/messages_lang.php create mode 100644 application/language/ru/messages_lang.php create mode 100644 application/language/th/messages_lang.php create mode 100644 application/language/tr/messages_lang.php create mode 100644 application/language/zh/messages_lang.php create mode 100644 translations/messages_lang.csv diff --git a/application/controllers/Config.php b/application/controllers/Config.php index de27b36f5..7b79763e1 100644 --- a/application/controllers/Config.php +++ b/application/controllers/Config.php @@ -69,13 +69,13 @@ class Config extends Secure_area 'custom10_name'=>$this->input->post('custom10_name') ); - $result = $this->Appconfig->batch_save($batch_save_data); - $success = $result ? true : false; - - echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); + $result = $this->Appconfig->batch_save($batch_save_data); + $success = $result ? true : false; + + echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); } - function save_locale() + function save_locale() { $batch_save_data = array( 'currency_symbol'=>$this->input->post('currency_symbol'), @@ -93,11 +93,11 @@ class Config extends Secure_area $result = $this->Appconfig->batch_save($batch_save_data); $success = $result ? true : false; - + echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); } - function save_message() + function save_message() { $batch_save_data = array( 'msg_msg'=>$this->input->post('msg_msg'), @@ -106,10 +106,10 @@ class Config extends Secure_area 'msg_src'=>$this->input->post('msg_src') ); - $result = $this->Appconfig->batch_save($batch_save_data); - $success = $result ? true : false; - - echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); + $result = $this->Appconfig->batch_save($batch_save_data); + $success = $result ? true : false; + + echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); } function stock_locations() diff --git a/application/controllers/Messages.php b/application/controllers/Messages.php index 023dcf5f9..f64b6ace6 100644 --- a/application/controllers/Messages.php +++ b/application/controllers/Messages.php @@ -11,12 +11,14 @@ class Messages extends Secure_area public function index() { $data['controller_name'] = $this->get_controller_name(); + $this->load->view('messages/sms'); } function view($person_id=-1) { $data['person_info'] = $this->Person->get_info($person_id); + $this->load->view('messages/form_sms', $data); } @@ -24,24 +26,20 @@ class Messages extends Secure_area { $username = $this->config->item('msg_uid'); $password = $this->config->item('msg_pwd'); - $originator = $this->config->item('msg_src'); $phone = $this->input->post('phone'); - $message = $this->input->post('msg'); + $message = $this->input->post('message'); + $originator = $this->config->item('msg_src'); $response = $this->sms->sendSMS($username, $password, $phone, $message, $originator); - $data = array(); - if($response) { - $data['success'] = $this->lang->line('messages_successfully_sent') . ' ' . $phone; + echo json_encode(array('success'=>true, 'message'=>$this->lang->line('messages_successfully_sent') . ' ' . $phone)); } else { - $data['error'] = $this->lang->line('messages_unsuccessfully_sent') . ' ' . $phone; + echo json_encode(array('success'=>false, 'message'=>$this->lang->line('messages_unsuccessfully_sent') . ' ' . $phone)); } - - $this->load->view('messages/sms', $data); } function send_form($person_id=-1) @@ -49,8 +47,8 @@ class Messages extends Secure_area $username = $this->config->item('msg_uid'); $password = $this->config->item('msg_pwd'); $phone = $this->input->post('phone'); - $message = $this->input->post('msg'); - $originator = $this->config->item('company'); + $message = $this->input->post('message'); + $originator = $this->config->item('msg_src'); $response = $this->sms->sendSMS($username, $password, $phone, $message, $originator); diff --git a/application/helpers/table_helper.php b/application/helpers/table_helper.php index 6e6dc9f48..31a2f5322 100644 --- a/application/helpers/table_helper.php +++ b/application/helpers/table_helper.php @@ -145,8 +145,8 @@ function get_people_manage_table($people,$controller) $CI->lang->line('common_first_name'), $CI->lang->line('common_email'), $CI->lang->line('common_phone_number'), - $CI->lang->line('common_send_msg'), - $CI->lang->line('common_update'),); + ' ', + ' '); $table.='
      '; foreach($headers as $header) @@ -187,13 +187,13 @@ function get_person_data_row($person,$controller) $controller_name=strtolower(get_class($CI)); $table_data_row=''; - $table_data_row.=""; + $table_data_row.=""; $table_data_row.=''; $table_data_row.=''; $table_data_row.=''; $table_data_row.=''; - $table_data_row.=''; - $table_data_row.=''; + $table_data_row.=''; + $table_data_row.=''; $table_data_row.=''; return $table_data_row; @@ -229,9 +229,9 @@ function get_supplier_manage_table($suppliers,$controller) $CI->lang->line('common_first_name'), $CI->lang->line('common_email'), $CI->lang->line('common_phone_number'), - $CI->lang->line('common_send_msg'), $CI->lang->line('suppliers_supplier_id'), - $CI->lang->line('common_update'),); + ' ', + ' '); $table.=''; foreach($headers as $header) @@ -274,13 +274,13 @@ function get_supplier_data_row($supplier,$controller) $table_data_row=''; $table_data_row.=""; $table_data_row.=''; - $table_data_row.=''; + $table_data_row.=''; $table_data_row.=''; $table_data_row.=''; $table_data_row.=''; $table_data_row.=''; - $table_data_row.=''; - $table_data_row.=''; + $table_data_row.=''; + $table_data_row.=''; $table_data_row.=''; $table_data_row.=''; diff --git a/application/language/de-CH/config_lang.php b/application/language/de-CH/config_lang.php index 1c0f4e584..39756755e 100644 --- a/application/language/de-CH/config_lang.php +++ b/application/language/de-CH/config_lang.php @@ -93,6 +93,15 @@ $lang["config_location"] = "Lagerort"; $lang["config_location_configuration"] = "Lagerort"; $lang["config_location_info"] = "Lagerort-Information"; $lang["config_logout"] = "Wollen Sie eine Sicherung machen vor dem Beenden? Klicke [OK] für Sicherung"; +$lang["config_message"] = "Message"; +$lang["config_message_configuration"] = "Message Configuration"; +$lang["config_msg_msg"] = "Saved Text Message"; +$lang["config_msg_uid"] = "SMS-API Username"; +$lang["config_msg_uid_required"] = "SMS-API Username is a required field"; +$lang["config_msg_pwd"] = "SMS-API Password"; +$lang["config_msg_pwd_required"] = "SMS-API Password is a required field"; +$lang["config_msg_src"] = "SMS-API Sender ID"; +$lang["config_msg_src_required"] = "SMS-API Sender ID is a required field"; $lang["config_number_format"] = "Zahlenformat"; $lang["config_phone"] = "Telefon"; $lang["config_phone_required"] = "Telefon ist erforderlich"; diff --git a/application/language/de-CH/messages_lang.php b/application/language/de-CH/messages_lang.php new file mode 100644 index 000000000..ed1f113a8 --- /dev/null +++ b/application/language/de-CH/messages_lang.php @@ -0,0 +1,14 @@ + diff --git a/application/views/configs/message_config.php b/application/views/configs/message_config.php index c8eea3174..60d3bcf84 100755 --- a/application/views/configs/message_config.php +++ b/application/views/configs/message_config.php @@ -2,34 +2,38 @@
      lang->line('common_fields_required_message'); ?>
      -
        -
        Note : If you wish to use SMS template, save your message here. Otherwise keep the 'Saved Text Message' box blank.
        - -
        -
        - lang->line('config_msg_uid'), 'msg_uid', array('class'=>'control-label col-xs-2')); ?> + lang->line('config_msg_uid'), 'msg_uid', array('class'=>'control-label col-xs-2 required')); ?>
        'msg_uid', 'id'=>'msg_uid', - 'class'=>'form-control input-sm', - 'type'=>'password', - 'value'=>$this->config->item('msg_uid')));?> + 'class'=>'form-control input-sm required', + 'value'=>$this->config->item('msg_uid'))); ?>
        -
        - lang->line('config_msg_pwd'), 'msg_pwd', array('class'=>'control-label col-xs-2')); ?> +
        + lang->line('config_msg_pwd'), 'msg_pwd', array('class'=>'control-label col-xs-2 required')); ?>
        - 'msg_pwd', 'id'=>'msg_pwd', - 'class'=>'form-control input-sm', - 'type'=>'password', - 'value'=>$this->config->item('msg_pwd')));?> + 'class'=>'form-control input-sm required', + 'value'=>$this->config->item('msg_pwd'))); ?> +
        +
        + +
        + lang->line('config_msg_src'), 'msg_src', array('class'=>'control-label col-xs-2 required')); ?> +
        + 'msg_src', + 'id'=>'msg_src', + 'class'=>'form-control input-sm required', + 'value'=>$this->config->item('msg_src') == null ? $this->config->item('company') : $this->config->item('msg_src')));?>
        @@ -40,7 +44,8 @@ 'name'=>'msg_msg', 'id'=>'msg_msg', 'class'=>'form-control input-sm', - 'value'=>$this->config->item('msg_msg')));?> + 'value'=>$this->config->item('msg_msg'), + 'placeholder'=>"If you wish to use a SMS template save your message here. Otherwise leave the box blank."));?>
        @@ -48,7 +53,7 @@ 'name'=>'submit_form', 'id'=>'submit_form', 'value'=>$this->lang->line('common_submit'), - 'class'=>'btn btn-primary btn-sm pull-right'));?> + 'class'=>'btn btn-primary btn-sm pull-right')); ?> @@ -72,6 +77,30 @@ $(document).ready(function() }, dataType: 'json' }); + }, + + errorClass: "has-error", + errorLabelContainer: "#general_error_message_box", + wrapper: "li", + highlight: function (e) { + $(e).closest('.form-group').addClass('has-error'); + }, + unhighlight: function (e) { + $(e).closest('.form-group').removeClass('has-error'); + }, + + rules: + { + msg_uid: "required", + msg_pwd: "required", + msg_src: "required" + }, + + messages: + { + msg_uid: "lang->line('config_msg_uid_required'); ?>", + msg_pwd: "lang->line('config_msg_pwd_required'); ?>", + msg_src: "lang->line('config_msg_src_required'); ?>" } }); }); diff --git a/application/views/messages/form_sms.php b/application/views/messages/form_sms.php index b49b7c615..9bd775ac5 100644 --- a/application/views/messages/form_sms.php +++ b/application/views/messages/form_sms.php @@ -17,15 +17,15 @@
        - lang->line('messages_mobile'), 'last_name_label', array('for'=>'phone', 'class'=>'control-label col-xs-2')); ?> + lang->line('messages_phone'), 'phone_label', array('for'=>'phone', 'class'=>'control-label col-xs-2')); ?>
        'form-control input-sm', 'type'=>'text', 'name'=>'phone', 'value'=>$person_info->phone_number));?>
        - lang->line('messages_mesage'), 'last_name_label', array('for'=>'msg', 'class'=>'control-label col-xs-2')); ?> + lang->line('messages_message'), 'message_label', array('for'=>'message', 'class'=>'control-label col-xs-2')); ?>
        - 'msg', 'value'=>$this->config->item('msg_msg'), 'id'=>'msg', 'class'=>'form-control input-sm'));?> + 'form-control input-sm', 'name'=>'message', 'id'=>'message', 'value'=>$this->config->item('msg_msg')));?>
        diff --git a/application/views/messages/sms.php b/application/views/messages/sms.php index 213031f7f..48679adba 100755 --- a/application/views/messages/sms.php +++ b/application/views/messages/sms.php @@ -1,48 +1,55 @@ load->view("partial/header"); ?> - -".$error.""; -} - -if (!empty($warning)) -{ - echo "
        ".$warning."
        "; -} - -if (isset($success)) -{ - echo "
        ".$success."
        "; -} -?> -
        +
        'send_sms_form', 'enctype'=>'multipart/form-data', 'method'=>'post', 'class'=>'form-horizontal')); ?>
        - SEND SMS -
        -
        - -
        - - ( In case of multiple recipients, enter mobile numbers separated with comma ) -
        -

        - -
        - -
        - -
        -
        - -
        - + lang->line('messages_sms_send'); ?> +
        + +
        + + lang->line('messages_multiple_phones'); ?>
        + +
        + +
        + +
        +
        + + 'submit_form', + 'id'=>'submit_form', + 'value'=>$this->lang->line('common_submit'), + 'class'=>'btn btn-primary btn-sm pull-right'));?>
        load->view("partial/footer"); ?> + + diff --git a/translations/config_lang.csv b/translations/config_lang.csv index 83b4d1623..239ce5499 100644 --- a/translations/config_lang.csv +++ b/translations/config_lang.csv @@ -92,6 +92,15 @@ config_location,Készlet,Lagerort,Stock,Inventario,Stock,Stock,Stock,Stock,Stock config_location_configuration,Készlet helye,Lagerort,Stock Locaties,Ubicación de Inventario,Stock Locations,Stock Locations,Stock Locations,Stock Locations,Stock Locations,Stock Locations,Stock Locations,Localização do Estoque,Mjesto skladišta config_location_info,Helyszin konfigurációs információk,Lagerort-Information,Instellingen Locatie,Información de Configuración de Ubicación,Location Configuration Information,Location Configuration Information,Location Configuration Information,Location Configuration Information,Location Configuration Information,Location Configuration Information,Location Configuration Information,Informações da localizaçãoo,Info o lokaciji skladišta config_logout,"Nem szeretne mentést csinálni kilépés előtt? Kattintson az [OK]-ra a mentéshez, [Mégsem] a kilépéshez",Wollen Sie eine Sicherung machen vor dem Beenden? Klicke [OK] für Sicherung,Wilt u een backup maken alvorens uit te loggen?,Desea hacer un respaldo antes de salir?,"Don't you want to make a backup before logging out? Click [OK] to backup, [Cancel] to logout",Don't you want to make a backup before logging out?,Don't you want to make a backup before logging out?,Don't you want to make a backup before logging out?,Don't you want to make a backup before logging out?,Don't you want to make a backup before logging out?,Don't you want to make a backup before logging out?,Você não quer fazer uma cópia de segurança antes de sair? Clique [OK] para fazer a cópia de segurança,"Želite napraviti arhivu prije nego izađete? Pritisnite [OK] za arhivu, [Cancel] to otkazivanje." +config_message,Message,Message,Message,Message,Message,Message,Message,Message,Message,Message,Message,Message,Message +config_message_configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration +config_msg_msg,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message +config_msg_uid,"SMS-API Username","SMS-API Username","SMS-API Username","SMS-API Username","SMS-API Username","SMS-API Username","SMS-API Username","SMS-API Username","SMS-API Username","SMS-API Username","SMS-API Username","SMS-API Username","SMS-API Username" +config_msg_uid_required,"SMS-API Username is a required field","SMS-API Username is a required field","SMS-API Username is a required field","SMS-API Username is a required field","SMS-API Username is a required field","SMS-API Username is a required field","SMS-API Username is a required field","SMS-API Username is a required field","SMS-API Username is a required field","SMS-API Username is a required field","SMS-API Username is a required field","SMS-API Username is a required field","SMS-API Username is a required field" +config_msg_pwd,"SMS-API Password","SMS-API Password","SMS-API Password","SMS-API Password","SMS-API Password","SMS-API Password","SMS-API Password","SMS-API Password","SMS-API Password","SMS-API Password","SMS-API Password","SMS-API Password","SMS-API Password" +config_msg_pwd_required,"SMS-API Password is a required field","SMS-API Password is a required field","SMS-API Password is a required field","SMS-API Password is a required field","SMS-API Password is a required field","SMS-API Password is a required field","SMS-API Password is a required field","SMS-API Password is a required field","SMS-API Password is a required field","SMS-API Password is a required field","SMS-API Password is a required field","SMS-API Password is a required field","SMS-API Password is a required field" +config_msg_src,"SMS-API Sender ID","SMS-API Sender ID","SMS-API Sender ID","SMS-API Sender ID","SMS-API Sender ID","SMS-API Sender ID","SMS-API Sender ID","SMS-API Sender ID","SMS-API Sender ID","SMS-API Sender ID","SMS-API Sender ID","SMS-API Sender ID","SMS-API Sender ID" +config_msg_src_required,"SMS-API Sender ID is a required field","SMS-API Sender ID is a required field","SMS-API Sender ID is a required field","SMS-API Sender ID is a required field","SMS-API Sender ID is a required field","SMS-API Sender ID is a required field","SMS-API Sender ID is a required field","SMS-API Sender ID is a required field","SMS-API Sender ID is a required field","SMS-API Sender ID is a required field","SMS-API Sender ID is a required field","SMS-API Sender ID is a required field","SMS-API Sender ID is a required field" config_number_format,Szám formátum,Zahlenformat,Number Format,Formato de número,Number Format,Number Format,Number Format,Number Format,รูปแบบตัวเลข,Number Format,Format Nomor,Formato do número,Format broja config_phone,Cég telefonszáma,Telefon,Telefoon,Teléfono del Comercio,Company Phone,Téléphone,電話,Телефон Компании,เบอร์โทรศัพท์,Şirket Telefonu,Telepon Perusahaan,Telefone,Telefon tvrtke config_phone_required,Cég telefonszáma kötelező mező,Telefon ist erforderlich,De telefoonnummer van het bedrijf moet ingevuld worden,Teléfono del Comercio es requerido,Company phone is a required field,Le numéro de téléphone est requis,公司電話為必填,Телефон Компании обязательный пробел,เบอร์โทรต้องกรอก,Şirket Telefonu zorunlu alandır,Telepon Perusahaan wajib diisi,Telefone da Empresa é requerido,Telefon tvrtke je potreban diff --git a/translations/messages_lang.csv b/translations/messages_lang.csv new file mode 100644 index 000000000..6d56d15fb --- /dev/null +++ b/translations/messages_lang.csv @@ -0,0 +1,13 @@ +label,hu-HU,de-CH,nl-BE,es,en,fr,zh,ru,th,tr,id,pt-BR,hr-HR +messages_sms_send,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS +messages_first_name,First name,First name,First name,First name,First name,First name,First name,First name,First name,First name,First name,First name,First name +messages_last_name,Last name,Last name,Last name,Last name,Last name,Last name,Last name,Last name,Last name,Last name,Last name,Last name,Last name +messages_phone,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number +messages_phone_placeholder,"Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here..." +messages_phone_number_required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required +messages_message,Message,Message,Message,Message,Message,Message,Message,Message,Message,Message,Message,Message +messages_message_placeholder,"Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here..." +messages_message_required,Message required,Message required,Message required,Message required,Message required,Message required,Message required,Message required,Message required,Message required,Message required,Message required,Message required +messages_multiple_phones,"(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)" +messages_successfully_sent,"Message successfully sent to: ","Message successfully sent to: ","Message successfully sent to: ","Message successfully sent to: ","Message successfully sent to: ","Message successfully sent to: ","Message successfully sent to: ","Message successfully sent to: ","Message successfully sent to: ","Message successfully sent to: ","Message successfully sent to: ","Message successfully sent to: ","Message successfully sent to: " +messages_unsuccessfully_sent,"Message unsuccessfully sent to: ","Message unsuccessfully sent to: ","Message unsuccessfully sent to: ","Message unsuccessfully sent to: ","Message unsuccessfully sent to: ","Message unsuccessfully sent to: ","Message unsuccessfully sent to: ","Message unsuccessfully sent to: ","Message unsuccessfully sent to: ","Message unsuccessfully sent to: ","Message unsuccessfully sent to: ","Message unsuccessfully sent to: ","Message unsuccessfully sent to: " diff --git a/translations/module_lang.csv b/translations/module_lang.csv index 3e2b915e9..6dbc94d4d 100644 --- a/translations/module_lang.csv +++ b/translations/module_lang.csv @@ -20,3 +20,5 @@ module_sales,Értékesítés,Verkauf,Kassa,Ventas,Sales,Ventes,出貨,Прода module_sales_desc,Termékek értékesítése és visszavétele,"Hinzufügen, Ändern, Löschen und Suchen",Verwerk aankopen en retours,Procesar ventas y devoluciones,Process sales and returns,Ventes et chiffre d'affaire,出貨與退貨,Процесс продажи и возвращается,งานขาย และ รับคืน,Satış ve iade,Proses Penjualan dan Retur,Processar vendas e devoluções,Procesi prodaje i povrata module_suppliers,Beszállítók,Lieferanten,Leveranciers,Proveedores,Suppliers,Fournisseurs,供應商,Поставщики,ผู้ผลิต,Sağlayıcılar,Pemasok,Fornecedores,Dobavljači module_suppliers_desc,"Beszállítók hozzáadása, módosítása, törlése és keresése","Hinzufügen, Ändern, Löschen und Suchen","Zoek, bewerk, verwijder en voeg leveranciers toe","Agregar, Actualizar, Borrar y Buscar proveedores","Add, Update, Delete, and Search suppliers","Ajouter, Éditer, Supprimer, et Chercher des fournisseurs",添加,更新,刪除,搜索供應商,"Добавление, обновление, удаление и поиск suppliers","เพิ่ม, อัพเดท, ลบ, และค้นหา ผู้ผลิต","Ekleme, değiştirme, silme ve arama","Tambah, Rubah, Hapus, dan Cari Pemasok","Adicionar, atualizar, excluir e Pesquisar fornecedores","Dodaj, ažuriraj, obriši ili traži dobavljače" +module_messages,Messages,Messages,Messages,Messages,Messages,Messages,Messages,Messages,Messages,Messages,Messages,Messages,Messages +module_messages_desc,"Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al." From 1f9c31da414e9206220e759e35b964f215732367 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 30 Apr 2016 18:28:28 +0100 Subject: [PATCH 09/12] regen database scripts (#472) --- database/database.sql | 1 + database/migrate_phppos_dist.sql | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/database/database.sql b/database/database.sql index b6ce81534..c7dca68b2 100644 --- a/database/database.sql +++ b/database/database.sql @@ -70,6 +70,7 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('msg_src', ''), ('msg_pwd', ''); + -- -------------------------------------------------------- -- diff --git a/database/migrate_phppos_dist.sql b/database/migrate_phppos_dist.sql index f15c0e291..c7a33b729 100644 --- a/database/migrate_phppos_dist.sql +++ b/database/migrate_phppos_dist.sql @@ -64,7 +64,12 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('decimal_point', '.'), ('currency_decimals', '2'), ('tax_decimals', '2'), -('quantity_decimals', '0'); +('quantity_decimals', '0'), +('msg_msg', ''), +('msg_uid', ''), +('msg_src', ''), +('msg_pwd', ''); + -- -------------------------------------------------------- @@ -289,12 +294,13 @@ CREATE TABLE `ospos_modules` ( -- INSERT INTO `ospos_modules` (`name_lang_key`, `desc_lang_key`, `sort`, `module_id`) VALUES -('module_config', 'module_config_desc', 100, 'config'), +('module_config', 'module_config_desc', 110, 'config'), ('module_customers', 'module_customers_desc', 10, 'customers'), ('module_employees', 'module_employees_desc', 80, 'employees'), ('module_giftcards', 'module_giftcards_desc', 90, 'giftcards'), ('module_items', 'module_items_desc', 20, 'items'), ('module_item_kits', 'module_item_kits_desc', 30, 'item_kits'), +('module_messages', 'module_messages_desc', 100, 'messages'), ('module_receivings', 'module_receivings_desc', 60, 'receivings'), ('module_reports', 'module_reports_desc', 50, 'reports'), ('module_sales', 'module_sales_desc', 70, 'sales'), @@ -365,6 +371,7 @@ INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES ('giftcards', 'giftcards'), ('items', 'items'), ('item_kits', 'item_kits'), +('messages', 'messages'), ('receivings', 'receivings'), ('reports', 'reports'), ('sales', 'sales'), @@ -410,6 +417,7 @@ INSERT INTO `ospos_grants` (`permission_id`, `person_id`) VALUES ('giftcards', 1), ('items', 1), ('item_kits', 1), +('messages', 1), ('receivings', 1), ('reports', 1), ('sales', 1), From 0eecaf4268915027debfa785194ffbfc3c59852b Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 30 Apr 2016 18:32:13 +0100 Subject: [PATCH 10/12] fixed required fields in sms_form (#472) --- application/views/messages/form_sms.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/application/views/messages/form_sms.php b/application/views/messages/form_sms.php index 9bd775ac5..d10d16d2a 100644 --- a/application/views/messages/form_sms.php +++ b/application/views/messages/form_sms.php @@ -17,15 +17,15 @@
        - lang->line('messages_phone'), 'phone_label', array('for'=>'phone', 'class'=>'control-label col-xs-2')); ?> + lang->line('messages_phone'), 'phone_label', array('for'=>'phone', 'class'=>'control-label col-xs-2 required')); ?>
        - 'form-control input-sm', 'type'=>'text', 'name'=>'phone', 'value'=>$person_info->phone_number));?> + 'form-control input-sm required', 'type'=>'text', 'name'=>'phone', 'value'=>$person_info->phone_number));?>
        - lang->line('messages_message'), 'message_label', array('for'=>'message', 'class'=>'control-label col-xs-2')); ?> + lang->line('messages_message'), 'message_label', array('for'=>'message', 'class'=>'control-label col-xs-2 required')); ?>
        - 'form-control input-sm', 'name'=>'message', 'id'=>'message', 'value'=>$this->config->item('msg_msg')));?> + 'form-control input-sm required', 'name'=>'message', 'id'=>'message', 'value'=>$this->config->item('msg_msg')));?>
        @@ -53,7 +53,7 @@ $(document).ready(function() required:true, number:true }, - msg: + message: { required:true, number:false @@ -66,7 +66,7 @@ $(document).ready(function() required:"lang->line('messages_phone_number_required'); ?>", number:"lang->line('messages_phone'); ?>" }, - msg: + message: { required:"lang->line('messages_message_required'); ?>" } From 10e2aa873cd705c0b173e8535641bf46dabab5c1 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 30 Apr 2016 18:41:54 +0100 Subject: [PATCH 11/12] fixed missing Croatian translation (#472) --- application/language/hr-HR/messages_lang.php | 2 +- translations/messages_lang.csv | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/language/hr-HR/messages_lang.php b/application/language/hr-HR/messages_lang.php index 26a6cd0e6..ed1f113a8 100644 --- a/application/language/hr-HR/messages_lang.php +++ b/application/language/hr-HR/messages_lang.php @@ -6,7 +6,7 @@ $lang["messages_last_name"] = "Last name"; $lang["messages_phone"] = "Phone number"; $lang["messages_phone_placeholder"] = "Mobile Number(s) here..."; $lang["messages_phone_number_required"] = "Phone number required"; -$lang["messages_message"] = ""; +$lang["messages_message"] = "Message"; $lang["messages_message_placeholder"] = "Your Message here..."; $lang["messages_message_required"] = "Message required"; $lang["messages_multiple_phones"] = "(In case of multiple recipients, enter mobile numbers separated by commas)"; diff --git a/translations/messages_lang.csv b/translations/messages_lang.csv index 6d56d15fb..1d7c0cc6c 100644 --- a/translations/messages_lang.csv +++ b/translations/messages_lang.csv @@ -5,7 +5,7 @@ messages_last_name,Last name,Last name,Last name,Last name,Last name,Last name,L messages_phone,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number messages_phone_placeholder,"Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here..." messages_phone_number_required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required -messages_message,Message,Message,Message,Message,Message,Message,Message,Message,Message,Message,Message,Message +messages_message,Message,Message,Message,Message,Message,Message,Message,Message,Message,Message,Message,Message,Message messages_message_placeholder,"Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here..." messages_message_required,Message required,Message required,Message required,Message required,Message required,Message required,Message required,Message required,Message required,Message required,Message required,Message required,Message required messages_multiple_phones,"(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)" From c9f8ca67715ce5ba78e471670ff9161fbc27a06b Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 30 Apr 2016 22:06:32 +0100 Subject: [PATCH 12/12] disable the feature completely in case the permission is not granted (#472) --- application/helpers/table_helper.php | 32 ++++++++++++++++++++++------ application/views/configs/manage.php | 26 ++++++++++++++++------ 2 files changed, 46 insertions(+), 12 deletions(-) diff --git a/application/helpers/table_helper.php b/application/helpers/table_helper.php index 31a2f5322..454839d3d 100644 --- a/application/helpers/table_helper.php +++ b/application/helpers/table_helper.php @@ -145,8 +145,11 @@ function get_people_manage_table($people,$controller) $CI->lang->line('common_first_name'), $CI->lang->line('common_email'), $CI->lang->line('common_phone_number'), - ' ', ' '); + if($CI->Employee->has_grant('messages', $CI->session->userdata('person_id'))) + { + $headers[] = ' '; + } $table.=''; foreach($headers as $header) @@ -192,8 +195,15 @@ function get_person_data_row($person,$controller) $table_data_row.=''; $table_data_row.=''; $table_data_row.=''; - $table_data_row.=''; - $table_data_row.=''; + if($CI->Employee->has_grant('messages', $CI->session->userdata('person_id'))) + { + $table_data_row.=''; + $table_data_row.=''; + } + else + { + $table_data_row.=''; + } $table_data_row.=''; return $table_data_row; @@ -230,8 +240,11 @@ function get_supplier_manage_table($suppliers,$controller) $CI->lang->line('common_email'), $CI->lang->line('common_phone_number'), $CI->lang->line('suppliers_supplier_id'), - ' ', ' '); + if($CI->Employee->has_grant('messages', $CI->session->userdata('person_id'))) + { + $headers[] = ' '; + } $table.=''; foreach($headers as $header) @@ -280,8 +293,15 @@ function get_supplier_data_row($supplier,$controller) $table_data_row.=''; $table_data_row.=''; $table_data_row.=''; - $table_data_row.=''; - $table_data_row.=''; + if($CI->Employee->has_grant('messages', $CI->session->userdata('person_id'))) + { + $table_data_row.=''; + $table_data_row.=''; + } + else + { + $table_data_row.=''; + } $table_data_row.=''; return $table_data_row; diff --git a/application/views/configs/manage.php b/application/views/configs/manage.php index 05e7d3470..08c615825 100644 --- a/application/views/configs/manage.php +++ b/application/views/configs/manage.php @@ -22,9 +22,16 @@
      • lang->line('config_invoice'); ?>
      • -
      • - lang->line('config_message'); ?> -
      • + Employee->has_grant('messages', $this->session->userdata('person_id'))) + { + ?> +
      • + lang->line('config_message'); ?> +
      • +
        @@ -49,9 +56,16 @@
        load->view("configs/invoice_config"); ?>
        -
        - load->view("configs/message_config"); ?> -
        + Employee->has_grant('messages', $this->session->userdata('person_id'))) + { + ?> +
        + load->view("configs/message_config"); ?> +
        +
        load->view("partial/footer"); ?>
        '.to_currency( $sale['amount_tendered'] ).''.to_currency( $sale['amount_due'] ).''.to_currency( $sale['change_due'] ).''.$sale['payment_type'].''.$sale['invoice_number'].''.$sale['payment_type'].''.$sale['invoice_number'].''.$sale['payment_type'].'
        '.character_limiter($person->last_name,13).''.character_limiter($person->first_name,13).''.mailto($person->email,character_limiter($person->email,22)).''.character_limiter($person->phone_number,13).''.anchor('Messages'."/view/$person->person_id", '', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line('messages_send_msg'))).''.anchor($controller_name."/view/$person->person_id", '', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line($controller_name.'_update'))).''.anchor("Messages/view/$person->person_id", '', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line('messages_sms_send'))).''.anchor($controller_name."/view/$person->person_id", '', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line($controller_name.'_update'))).'
        '.character_limiter($supplier->company_name,13).''.character_limiter($supplier->agency_name,13).''.character_limiter($supplier->agency_name,13).''.character_limiter($supplier->last_name,13).''.character_limiter($supplier->first_name,13).''.mailto($supplier->email,character_limiter($supplier->email,22)).''.character_limiter($supplier->phone_number,13).''.anchor('Messages'."/view/$supplier->person_id", '', array('class'=>'modal-dlg modal-btn-submit' , 'title'=>$CI->lang->line('messages_send_msg'))).''.character_limiter($supplier->person_id,5).''.character_limiter($supplier->person_id,5).''.anchor("Messages/view/$supplier->person_id", '', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line('messages_sms_send'))).''.anchor($controller_name."/view/$supplier->person_id", '', array('class'=>"modal-dlg modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_update'))).'
        '.character_limiter($person->first_name,13).''.mailto($person->email,character_limiter($person->email,22)).''.character_limiter($person->phone_number,13).''.anchor("Messages/view/$person->person_id", '', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line('messages_sms_send'))).''.anchor($controller_name."/view/$person->person_id", '', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line($controller_name.'_update'))).''.anchor("Messages/view/$person->person_id", '', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line('messages_sms_send'))).''.anchor($controller_name."/view/$person->person_id", '', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line($controller_name.'_update'))).''.anchor($controller_name."/view/$person->person_id", '', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line($controller_name.'_update'))).'
        '.mailto($supplier->email,character_limiter($supplier->email,22)).''.character_limiter($supplier->phone_number,13).''.character_limiter($supplier->person_id,5).''.anchor("Messages/view/$supplier->person_id", '', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line('messages_sms_send'))).''.anchor($controller_name."/view/$supplier->person_id", '', array('class'=>"modal-dlg modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_update'))).''.anchor("Messages/view/$supplier->person_id", '', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line('messages_sms_send'))).''.anchor($controller_name."/view/$supplier->person_id", '', array('class'=>"modal-dlg modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_update'))).''.anchor($controller_name."/view/$supplier->person_id", '', array('class'=>"modal-dlg modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_update'))).'