Completed booking wizard translation.

This commit is contained in:
alextselegidis@gmail.com 2013-12-18 17:05:39 +00:00
parent 49dbe9cfba
commit 9cd9558f55
8 changed files with 62 additions and 47 deletions

Binary file not shown.

View file

@ -86,7 +86,7 @@ $config['url_suffix'] = '';
| than english. | than english.
| |
*/ */
$config['language'] = 'german';//'english'; $config['language'] = 'greek';//'english';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View file

@ -10,13 +10,13 @@ require_once dirname(__FILE__) . '/external/class.phpmailer.php';
* during the execution of each class methods. * during the execution of each class methods.
*/ */
class Notifications { class Notifications {
private $CI; private $ci;
/** /**
* Class Constructor * Class Constructor
*/ */
public function __construct() { public function __construct() {
$this->CI =& get_instance(); $this->ci =& get_instance();
} }
/** /**
@ -84,17 +84,17 @@ class Notifications {
'$customer_address' => $customer_data['address'], '$customer_address' => $customer_data['address'],
// Translations // Translations
'Appointment Details' => $this->lang->line('fe_appointment_details_title'), 'Appointment Details' => $this->ci->lang->line('fe_appointment_details_title'),
'Service' => $this->lang->line('fe_service'), 'Service' => $this->ci->lang->line('fe_service'),
'Provider' => $this->lang->line('fe_provider'), 'Provider' => $this->ci->lang->line('fe_provider'),
'Start' => $this->lang->line('fe_start'), 'Start' => $this->ci->lang->line('fe_start'),
'End' => $this->lang->line('fe_end'), 'End' => $this->ci->lang->line('fe_end'),
'Customer Details' => $this->lang->line('fe_customer_details_title'), 'Customer Details' => $this->ci->lang->line('fe_customer_details_title'),
'Name' => $this->lang->line('fe_start'), 'Name' => $this->ci->lang->line('fe_name'),
'Email' => $this->lang->line('fe_start'), 'Email' => $this->ci->lang->line('fe_email'),
'Phone' => $this->lang->line('fe_start'), 'Phone' => $this->ci->lang->line('fe_phone'),
'Address' => $this->lang->line('fe_start'), 'Address' => $this->ci->lang->line('fe_address'),
'Start' => $this->lang->line('fe_start'), 'Appointment Link' => $this->ci->lang->line('fe_appointment_link_title')
); );
$email_html = file_get_contents(dirname(dirname(__FILE__)) $email_html = file_get_contents(dirname(dirname(__FILE__))
@ -142,7 +142,8 @@ class Notifications {
$service_data, $customer_data, $company_settings, $to_address, $reason) { $service_data, $customer_data, $company_settings, $to_address, $reason) {
// :: PREPARE EMAIL REPLACE ARRAY // :: PREPARE EMAIL REPLACE ARRAY
$replace_array = array( $replace_array = array(
'$email_title' => 'Appointment Cancelled', '$email_title' => $this->ci->lang->line('fe_appointment_cancelled_title'),
'$email_message' => $this->ci->lang->line('fe_appointment_removed_from_schedule'),
'$appointment_service' => $service_data['name'], '$appointment_service' => $service_data['name'],
'$appointment_provider' => $provider_data['first_name'] . ' ' . $provider_data['last_name'], '$appointment_provider' => $provider_data['first_name'] . ' ' . $provider_data['last_name'],
'$appointment_date' => date('d/m/Y H:i', strtotime($appointment_data['start_datetime'])), '$appointment_date' => date('d/m/Y H:i', strtotime($appointment_data['start_datetime'])),
@ -153,7 +154,21 @@ class Notifications {
'$customer_email' => $customer_data['email'], '$customer_email' => $customer_data['email'],
'$customer_phone' => $customer_data['phone_number'], '$customer_phone' => $customer_data['phone_number'],
'$customer_address' => $customer_data['address'], '$customer_address' => $customer_data['address'],
'$reason' => $reason '$reason' => $reason,
// Translations
'Appointment Details' => $this->ci->lang->line('fe_appointment_details_title'),
'Service' => $this->ci->lang->line('fe_service'),
'Provider' => $this->ci->lang->line('fe_provider'),
'Date' => $this->ci->lang->line('fe_start'),
'Duration' => $this->ci->lang->line('fe_duration'),
'Customer Details' => $this->ci->lang->line('fe_customer_details_title'),
'Name' => $this->ci->lang->line('fe_name'),
'Email' => $this->ci->lang->line('fe_email'),
'Phone' => $this->ci->lang->line('fe_phone'),
'Address' => $this->ci->lang->line('fe_address'),
'Reason' => $this->ci->lang->line('fe_reason')
); );
$email_html = file_get_contents(dirname(dirname(__FILE__)) $email_html = file_get_contents(dirname(dirname(__FILE__))
@ -167,7 +182,7 @@ class Notifications {
$mail->AddAddress($to_address); // "Name" argument crushes the phpmailer class. $mail->AddAddress($to_address); // "Name" argument crushes the phpmailer class.
$mail->IsHTML(true); $mail->IsHTML(true);
$mail->CharSet = 'UTF-8'; $mail->CharSet = 'UTF-8';
$mail->Subject = 'Appointment Cancelled'; $mail->Subject = $this->ci->lang->line('fe_appointment_cancelled_title');
$mail->Body = $email_html; $mail->Body = $email_html;
if (!$mail->Send()) { if (!$mail->Send()) {
@ -186,13 +201,12 @@ class Notifications {
*/ */
public function send_password($password, $email, $company_settings) { public function send_password($password, $email, $company_settings) {
$replace_array = array( $replace_array = array(
'$email_title' => 'New Account Password', '$email_title' => $this->ci->lang->line('be_new_account_password'),
'$email_message' => 'Your new account password is <strong>' . $password . '</strong>. ' '$email_message' => $this->ci->lang->line('be_new_password_is'),
. 'Please store this email to be able to retrieve your password if necessary. '
. 'You can also change this password with a new one in the settings page.',
'$company_name' => $company_settings['company_name'], '$company_name' => $company_settings['company_name'],
'$company_email' => $company_settings['company_email'], '$company_email' => $company_settings['company_email'],
'$company_link' => $company_settings['company_link'] '$company_link' => $company_settings['company_link'],
'$password' => '<strong>' . $password . '</strong>'
); );
$email_html = file_get_contents(dirname(dirname(__FILE__)) $email_html = file_get_contents(dirname(dirname(__FILE__))
@ -206,7 +220,7 @@ class Notifications {
$mail->AddAddress($email); // "Name" argument crushes the phpmailer class. $mail->AddAddress($email); // "Name" argument crushes the phpmailer class.
$mail->IsHTML(true); $mail->IsHTML(true);
$mail->CharSet = 'UTF-8'; $mail->CharSet = 'UTF-8';
$mail->Subject = 'New Account Password'; $mail->Subject = $this->ci->lang->line('be_new_account_password');
$mail->Body = $email_html; $mail->Body = $email_html;
if (!$mail->Send()) { if (!$mail->Send()) {
@ -233,8 +247,8 @@ class Notifications {
$mail->IsHTML(true); $mail->IsHTML(true);
$mail->CharSet = 'UTF-8'; $mail->CharSet = 'UTF-8';
$mail->Subject = 'New Easy!Appointments Installation'; $mail->Subject = 'New Easy!Appointments Installation';
$mail->Body = 'Base URL: ' . $this->CI->config->item('base_url') . '<br>' $mail->Body = 'Base URL: ' . $this->ci->config->item('base_url') . '<br>'
. 'E!A Version: ' . $this->CI->config->item('ea_version') . '<br>' . 'E!A Version: ' . $this->ci->config->item('ea_version') . '<br>'
. 'Company Name: ' . $company_name . '<br>' . 'Company Name: ' . $company_name . '<br>'
. 'Company Email: ' . $company_email . '<br>' . 'Company Email: ' . $company_email . '<br>'
. 'Company Link: ' . $company_link . '<br>'; . 'Company Link: ' . $company_link . '<br>';

View file

@ -128,15 +128,15 @@
if ($manage_mode === TRUE) { if ($manage_mode === TRUE) {
echo ' echo '
<div id="cancel-appointment-frame"> <div id="cancel-appointment-frame">
<p>' . <p class="pull-left">' .
$this->lang->line('fe_cancel_appointment_hint') . $this->lang->line('fe_cancel_appointment_hint') .
'</p> '</p>
<form id="cancel-appointment-form" method="post" <form id="cancel-appointment-form" method="post" class="pull-right"
action="' . $this->config->item('base_url') action="' . $this->config->item('base_url')
. 'appointments/cancel/' . $appointment_data['hash'] . '"> . 'appointments/cancel/' . $appointment_data['hash'] . '">
<textarea name="cancel_reason" style="display:none"></textarea> <textarea name="cancel_reason" style="display:none"></textarea>
<button id="cancel-appointment" class="btn btn-inverse"> <button id="cancel-appointment" class="btn btn-inverse">' .
Cancel</button> $this->lang->line('fe_cancel') . '</button>
</form> </form>
</div>'; </div>';
} }

View file

@ -13,9 +13,7 @@
<div id="content" style="padding: 10px 15px;"> <div id="content" style="padding: 10px 15px;">
<h2>$email_title</h2> <h2>$email_title</h2>
<p> <p>$email_message</p>
The following appointment was removed from the company's schedule.
</p>
<h2>Appointment Details</h2> <h2>Appointment Details</h2>
<table id="appointment-details"> <table id="appointment-details">

View file

@ -79,12 +79,14 @@
}; };
$('.alert').addClass('hidden'); $('.alert').addClass('hidden');
$('#get-new-password').prop('disabled', true);
$.post(postUrl, postData, function(response) { $.post(postUrl, postData, function(response) {
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////
console.log('Regenerate Password Response: ', response); console.log('Regenerate Password Response: ', response);
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////
$('#get-new-password').prop('disabled', false);
if (!GeneralFunctions.handleAjaxExceptions(response)) return; if (!GeneralFunctions.handleAjaxExceptions(response)) return;
if (response == GlobalVariables.AJAX_SUCCESS) { if (response == GlobalVariables.AJAX_SUCCESS) {

View file

@ -169,15 +169,17 @@ body {
/* CANCEL APPOINTMENT /* CANCEL APPOINTMENT
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#cancel-appointment-frame { #cancel-appointment-frame {
padding: 12px 17px; padding: 12px 17px 0;
background: #FAFAFA; background: #FAFAFA;
border-bottom: 1px solid #E2E2E2; border-bottom: 1px solid #E2E2E2;
overflow: auto;
} }
#cancel-appointment-frame p { #cancel-appointment-frame p {
display: inline-block; display: inline-block;
margin-right: 10px; margin-right: 10px;
margin-bottom: 0; margin-bottom: 0;
width: 515px;
} }
#cancel-appointment-frame form { #cancel-appointment-frame form {

View file

@ -196,23 +196,22 @@ var FrontendBook = {
$('#cancel-appointment').click(function() { $('#cancel-appointment').click(function() {
event.preventDefault(); event.preventDefault();
var dialogButtons = { var dialogButtons = {};
'OK': function() { dialogButtons['OK'] = function() {
if ($('#cancel-reason').val() === '') { if ($('#cancel-reason').val() === '') {
$('#cancel-reason').css('border', '2px solid red'); $('#cancel-reason').css('border', '2px solid red');
return; return;
}
$('#cancel-appointment-form textarea').val($('#cancel-reason').val());
$('#cancel-appointment-form').submit();
},
'Cancel': function() {
$('#message_box').dialog('close');
} }
$('#cancel-appointment-form textarea').val($('#cancel-reason').val());
$('#cancel-appointment-form').submit();
};
dialogButtons[EALang['fe_cancel']] = function() {
$('#message_box').dialog('close');
}; };
GeneralFunctions.displayMessageBox('Cancel Appointment', 'Please take a ' GeneralFunctions.displayMessageBox(EALang['fe_cancel_appointment_title'],
+ 'minute to write the reason you are cancelling the appointment:', EALang['be_write_appointment_removal_reason'], dialogButtons);
dialogButtons);
$('#message_box').append('<textarea id="cancel-reason" rows="3"></textarea>'); $('#message_box').append('<textarea id="cancel-reason" rows="3"></textarea>');
$('#cancel-reason').css('width', '353px'); $('#cancel-reason').css('width', '353px');