* Changed php array definition from "$var = [];" to "$var = array();".

* Added php error display in the CodeIgniter "development" environment.
* Added "$google_sync_feature" setting in the configuration file.
This commit is contained in:
alextselegidis@gmail.com 2013-10-21 12:36:40 +00:00
parent 991551a4d7
commit dc72bcbf35
8 changed files with 21 additions and 6 deletions

View file

@ -19,8 +19,19 @@ include dirname(dirname(dirname(__FILE__))) . '/configuration.php';
*/ */
require_once dirname(dirname(dirname(__FILE__))) . '/configuration.php'; require_once dirname(dirname(dirname(__FILE__))) . '/configuration.php';
$config['base_url'] = SystemConfiguration::$base_url; $config['base_url'] = SystemConfiguration::$base_url;
/*
|--------------------------------------------------------------------------
| Easy!Appointments Configuration
|--------------------------------------------------------------------------
|
| Declare some of the global config values of Easy!Appointments.
| the global "config" variable.
|
*/
$config['ea_version'] = '0.6'; // This must be changed manually. $config['ea_version'] = '0.6'; // This must be changed manually.
$config['ea_release_title'] = 'Alpha'; // Leave empty for no title or add BETA, TEST etc ... $config['ea_release_title'] = 'Alpha'; // Leave empty for no title or add BETA, TEST etc ...
$config['ea_google_sync_feature'] = SystemConfiguration::$google_sync_feature;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View file

@ -293,7 +293,7 @@ class Unit_tests_admins_model extends CI_Driver {
$model_batch = $this->ci->admins_model->get_batch(array('id' => $admin['id'])); $model_batch = $this->ci->admins_model->get_batch(array('id' => $admin['id']));
$db_batch = $this->ci->db->get_where('ea_users', array('id' => $admin['id']))->result_array(); $db_batch = $this->ci->db->get_where('ea_users', array('id' => $admin['id']))->result_array();
foreach($db_batch as &$admin) { foreach($db_batch as &$admin) {
$admin['settings'] = []; $admin['settings'] = array();
} }
$this->ci->unit->run($model_batch, $db_batch, 'Test if get_batch() with where clause ' $this->ci->unit->run($model_batch, $db_batch, 'Test if get_batch() with where clause '
@ -311,7 +311,7 @@ class Unit_tests_admins_model extends CI_Driver {
$admin = $this->default_admin; $admin = $this->default_admin;
$this->ci->db->insert('ea_users', $admin); $this->ci->db->insert('ea_users', $admin);
$admin['id'] = intval($this->ci->db->insert_id()); $admin['id'] = intval($this->ci->db->insert_id());
$admin['settings'] = []; $admin['settings'] = array();
$model_admin = $this->ci->admins_model->get_row($admin['id']); $model_admin = $this->ci->admins_model->get_row($admin['id']);
$this->ci->unit->run($model_admin, $admin, 'Test if get_row() has successfully ' $this->ci->unit->run($model_admin, $admin, 'Test if get_row() has successfully '

View file

@ -99,7 +99,7 @@ class Notifications {
$mail->Body = $email_html; $mail->Body = $email_html;
if (!$mail->Send()) { if (!$mail->Send()) {
throw new Exception('Email could not been sent. ' . 'Mailer Error (Line ' throw new Exception('Email could not been sent. Mailer Error (Line '
. __LINE__ . '): ' . $mail->ErrorInfo); . __LINE__ . '): ' . $mail->ErrorInfo);
} }

View file

@ -179,7 +179,7 @@
} }
if ($has_category) { if ($has_category) {
$grouped_services = []; $grouped_services = array();
foreach($available_services as $service) { foreach($available_services as $service) {
if ($service['category_id'] != NULL) { if ($service['category_id'] != NULL) {
@ -193,7 +193,7 @@
// We need the uncategorized services at the end of the list so // We need the uncategorized services at the end of the list so
// we will use another iteration only for the uncategorized services. // we will use another iteration only for the uncategorized services.
$grouped_services['uncategorized'] = []; $grouped_services['uncategorized'] = array();
foreach($available_services as $service) { foreach($available_services as $service) {
if ($service['category_id'] == NULL) { if ($service['category_id'] == NULL) {
$grouped_services['uncategorized'][] = $service; $grouped_services['uncategorized'][] = $service;

View file

@ -186,10 +186,12 @@
<h3>Your appointment has been successfully registered!</h3> <h3>Your appointment has been successfully registered!</h3>
<p>An email with the appointment details has been sent to you.</p> <p>An email with the appointment details has been sent to you.</p>
<?php if ($this->config->item('ea_google_sync_feature')) { ?>
<button id="add-to-google-calendar" class="btn btn-primary"> <button id="add-to-google-calendar" class="btn btn-primary">
<i class="icon-plus icon-white"></i> <i class="icon-plus icon-white"></i>
Add to Google Calendar Add to Google Calendar
</button> </button>
<?php } ?>
<?php <?php
// Display exceptions (if any). // Display exceptions (if any).

View file

@ -358,7 +358,7 @@ UserSettings.prototype.save = function(settings) {
Backend.displayNotification('Settings saved successfully!'); Backend.displayNotification('Settings saved successfully!');
// Update footer greetings. // Update footer greetings.
$('#footer-user-display-name').text('Hello, ' + $('#first-name').val() + ' ' + $('#last-name').val()); $('#footer-user-display-name').text('Hello, ' + $('#first-name').val() + ' ' + $('#last-name').val() + '!');
}, 'json'); }, 'json');
}; };

View file

@ -10,6 +10,7 @@ class SystemConfiguration {
public static $db_password = ''; public static $db_password = '';
// Google Calendar API Settings // Google Calendar API Settings
public static $google_sync_feature = FALSE; // Enter TRUE or FALSE;
public static $google_product_name = 'Easy!Appointments'; public static $google_product_name = 'Easy!Appointments';
public static $google_client_id = '396094740598-l9ohhdgs0hr6qi89628p3chf9lm59mkc.apps.googleusercontent.com'; public static $google_client_id = '396094740598-l9ohhdgs0hr6qi89628p3chf9lm59mkc.apps.googleusercontent.com';
public static $google_client_secret = '3kKEgx3mgxfFInrWf3jTUn4D'; public static $google_client_secret = '3kKEgx3mgxfFInrWf3jTUn4D';

View file

@ -34,6 +34,7 @@ if (defined('ENVIRONMENT'))
{ {
case 'development': case 'development':
error_reporting(E_ALL); error_reporting(E_ALL);
ini_set('display_errors', 1);
break; break;
case 'testing': case 'testing':