Minor code format corrections.

This commit is contained in:
Alex Tselegidis 2015-12-30 12:02:14 +01:00
parent 739368c00f
commit af976440f8
8 changed files with 316 additions and 281 deletions

View file

@ -72,7 +72,6 @@ class Backend extends CI_Controller {
$view['secretary_providers'] = array(); $view['secretary_providers'] = array();
} }
$results = $this->appointments_model->get_batch(array('hash' => $appointment_hash)); $results = $this->appointments_model->get_batch(array('hash' => $appointment_hash));
if ($appointment_hash != '' && count($results) > 0) { if ($appointment_hash != '' && count($results) > 0) {
$appointment = $results[0]; $appointment = $results[0];
@ -232,6 +231,7 @@ class Backend extends CI_Controller {
* @param bool $redirect (OPTIONAL - TRUE) If the user has not the required privileges * @param bool $redirect (OPTIONAL - TRUE) If the user has not the required privileges
* (either not logged in or insufficient role privileges) then the user will be redirected * (either not logged in or insufficient role privileges) then the user will be redirected
* to another page. Set this argument to FALSE when using ajax. * to another page. Set this argument to FALSE when using ajax.
*
* @return bool Returns whether the user has the required privileges to view the page or * @return bool Returns whether the user has the required privileges to view the page or
* not. If the user is not logged in then he will be prompted to log in. If he hasn't the * not. If the user is not logged in then he will be prompted to log in. If he hasn't the
* required privileges then an info message will be displayed. * required privileges then an info message will be displayed.

View file

@ -48,10 +48,10 @@ class Backend_api extends CI_Controller {
* This method returns the database appointments and unavailable periods for the * This method returns the database appointments and unavailable periods for the
* user selected date period and record type (provider or service). * user selected date period and record type (provider or service).
* *
* @param {numeric} $_POST['record_id'] Selected record id. * @param numeric $_POST['record_id'] Selected record id.
* @param {string} $_POST['filter_type'] Could be either FILTER_TYPE_PROVIDER or FILTER_TYPE_SERVICE. * @param string $_POST['filter_type'] Could be either FILTER_TYPE_PROVIDER or FILTER_TYPE_SERVICE.
* @param {string} $_POST['start_date'] The user selected start date. * @param string $_POST['start_date'] The user selected start date.
* @param {string} $_POST['end_date'] The user selected end date. * @param string $_POST['end_date'] The user selected end date.
*/ */
public function ajax_get_calendar_appointments() { public function ajax_get_calendar_appointments() {
try { try {
@ -113,13 +113,10 @@ class Backend_api extends CI_Controller {
} }
/** /**
* [AJAX] Save appointment changes that are made from the backend calendar * [AJAX] Save appointment changes that are made from the backend calendar page.
* page.
* *
* @param array $_POST['appointment_data'] (OPTIONAL) Array with the * @param array $_POST['appointment_data'] (OPTIONAL) Array with the appointment data.
* appointment data. * @param array $_POST['customer_data'] (OPTIONAL) Array with the customer data.
* @param array $_POST['customer_data'] (OPTIONAL) Array with the customer
* data.
*/ */
public function ajax_save_appointment() { public function ajax_save_appointment() {
try { try {
@ -374,7 +371,6 @@ class Backend_api extends CI_Controller {
if (!isset($_POST['provider_id'])) if (!isset($_POST['provider_id']))
throw new Exception('Provider id not specified.'); throw new Exception('Provider id not specified.');
if ($this->privileges[PRIV_USERS]['edit'] == FALSE if ($this->privileges[PRIV_USERS]['edit'] == FALSE
&& $this->session->userdata('user_id') != $_POST['provider_id']) { && $this->session->userdata('user_id') != $_POST['provider_id']) {
throw new Exception('You do not have the required privileges for this task.'); throw new Exception('You do not have the required privileges for this task.');
@ -398,7 +394,8 @@ class Backend_api extends CI_Controller {
/** /**
* [AJAX] Filter the customer records with the given key string. * [AJAX] Filter the customer records with the given key string.
* *
* @param string $_POST['key'] The filter key string * @param string $_POST['key'] The filter key string.
*
* @return array Returns the search results. * @return array Returns the search results.
*/ */
public function ajax_filter_customers() { public function ajax_filter_customers() {
@ -666,6 +663,7 @@ class Backend_api extends CI_Controller {
* [AJAX] Filter service records by given key string. * [AJAX] Filter service records by given key string.
* *
* @param string $_POST['key'] Key string used to filter the records. * @param string $_POST['key'] Key string used to filter the records.
*
* @return array Returns a json encoded array back to client. * @return array Returns a json encoded array back to client.
*/ */
public function ajax_filter_services() { public function ajax_filter_services() {
@ -744,6 +742,7 @@ class Backend_api extends CI_Controller {
* [AJAX] Filter services categories with key string. * [AJAX] Filter services categories with key string.
* *
* @param string $_POST['key'] The key string used to filter the records. * @param string $_POST['key'] The key string used to filter the records.
*
* @return array Returns a json encoded array back to client with the category records. * @return array Returns a json encoded array back to client with the category records.
*/ */
public function ajax_filter_service_categories() { public function ajax_filter_service_categories() {
@ -768,6 +767,7 @@ class Backend_api extends CI_Controller {
* [AJAX] Filter admin records with string key. * [AJAX] Filter admin records with string key.
* *
* @param string $_POST['key'] The key string used to filter the records. * @param string $_POST['key'] The key string used to filter the records.
*
* @return array Returns a json encoded array back to client with the admin records. * @return array Returns a json encoded array back to client with the admin records.
*/ */
public function ajax_filter_admins() { public function ajax_filter_admins() {
@ -798,6 +798,7 @@ class Backend_api extends CI_Controller {
* *
* @param array $_POST['admin'] A json encoded array that contains the admin data. If an 'id' * @param array $_POST['admin'] A json encoded array that contains the admin data. If an 'id'
* value is provided then the record is going to be updated. * value is provided then the record is going to be updated.
*
* @return array Returns an array with the operation status and the record id that was * @return array Returns an array with the operation status and the record id that was
* saved into the database. * saved into the database.
*/ */
@ -832,6 +833,7 @@ class Backend_api extends CI_Controller {
* [AJAX] Delete an admin record from the database. * [AJAX] Delete an admin record from the database.
* *
* @param numeric $_POST['admin_id'] The id of the record to be deleted. * @param numeric $_POST['admin_id'] The id of the record to be deleted.
*
* @return string Returns the operation result constant (AJAX_SUCESS or AJAX_FAILURE). * @return string Returns the operation result constant (AJAX_SUCESS or AJAX_FAILURE).
*/ */
public function ajax_delete_admin() { public function ajax_delete_admin() {
@ -854,6 +856,7 @@ class Backend_api extends CI_Controller {
* [AJAX] Filter provider records with string key. * [AJAX] Filter provider records with string key.
* *
* @param string $_POST['key'] The key string used to filter the records. * @param string $_POST['key'] The key string used to filter the records.
*
* @return array Returns a json encoded array back to client with the provider records. * @return array Returns a json encoded array back to client with the provider records.
*/ */
public function ajax_filter_providers() { public function ajax_filter_providers() {
@ -884,6 +887,7 @@ class Backend_api extends CI_Controller {
* *
* @param array $_POST['provider'] A json encoded array that contains the provider data. If an 'id' * @param array $_POST['provider'] A json encoded array that contains the provider data. If an 'id'
* value is provided then the record is going to be updated. * value is provided then the record is going to be updated.
*
* @return string Returns the success contant 'AJAX_SUCCESS' so javascript knows that * @return string Returns the success contant 'AJAX_SUCCESS' so javascript knows that
* everything completed successfully. * everything completed successfully.
*/ */
@ -923,6 +927,7 @@ class Backend_api extends CI_Controller {
* [AJAX] Delete a provider record from the database. * [AJAX] Delete a provider record from the database.
* *
* @param numeric $_POST['provider_id'] The id of the record to be deleted. * @param numeric $_POST['provider_id'] The id of the record to be deleted.
*
* @return string Returns the operation result constant (AJAX_SUCESS or AJAX_FAILURE). * @return string Returns the operation result constant (AJAX_SUCESS or AJAX_FAILURE).
*/ */
public function ajax_delete_provider() { public function ajax_delete_provider() {
@ -945,6 +950,7 @@ class Backend_api extends CI_Controller {
* [AJAX] Filter secretary records with string key. * [AJAX] Filter secretary records with string key.
* *
* @param string $_POST['key'] The key string used to filter the records. * @param string $_POST['key'] The key string used to filter the records.
*
* @return array Returns a json encoded array back to client with the secretary records. * @return array Returns a json encoded array back to client with the secretary records.
*/ */
public function ajax_filter_secretaries() { public function ajax_filter_secretaries() {
@ -975,6 +981,7 @@ class Backend_api extends CI_Controller {
* *
* @param array $_POST['secretary'] A json encoded array that contains the secretary data. * @param array $_POST['secretary'] A json encoded array that contains the secretary data.
* If an 'id' value is provided then the record is going to be updated. * If an 'id' value is provided then the record is going to be updated.
*
* @return string Returns the success contant 'AJAX_SUCCESS' so javascript knows that * @return string Returns the success contant 'AJAX_SUCCESS' so javascript knows that
* everything completed successfully. * everything completed successfully.
*/ */
@ -1007,6 +1014,7 @@ class Backend_api extends CI_Controller {
* [AJAX] Delete a secretary record from the database. * [AJAX] Delete a secretary record from the database.
* *
* @param numeric $_POST['secretary_id'] The id of the record to be deleted. * @param numeric $_POST['secretary_id'] The id of the record to be deleted.
*
* @return string Returns the operation result constant (AJAX_SUCESS or AJAX_FAILURE). * @return string Returns the operation result constant (AJAX_SUCESS or AJAX_FAILURE).
*/ */
public function ajax_delete_secretary() { public function ajax_delete_secretary() {

View file

@ -17,6 +17,9 @@
* @package Controllers * @package Controllers
*/ */
class Errors extends CI_Controller { class Errors extends CI_Controller {
/**
* Class Constructor
*/
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
$this->load->library('session'); $this->load->library('session');

View file

@ -14,9 +14,14 @@
/** /**
* Google Controller * Google Controller
* *
* This controller handles the Google Calendar synchronization operations.
*
* @package Controllers * @package Controllers
*/ */
class Google extends CI_Controller { class Google extends CI_Controller {
/**
* Class Constructor
*/
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
} }

View file

@ -19,7 +19,6 @@
* @package Controllers * @package Controllers
*/ */
class Installation extends CI_Controller { class Installation extends CI_Controller {
/** /**
* Class Constructor * Class Constructor
*/ */
@ -37,7 +36,6 @@ class Installation extends CI_Controller {
} }
} }
/** /**
* Display the installation page. * Display the installation page.
*/ */

View file

@ -14,6 +14,10 @@
/** /**
* Test Controller * Test Controller
* *
* NOTICE: This controller is outdated and must not be used.
*
* @deprecated v1.1.0
*
* @package Controllers * @package Controllers
*/ */
class Test extends CI_Controller { class Test extends CI_Controller {

View file

@ -17,6 +17,9 @@
* @package Controllers * @package Controllers
*/ */
class User extends CI_Controller { class User extends CI_Controller {
/**
* Class Constructor
*/
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
$this->load->library('session'); $this->load->library('session');
@ -30,10 +33,18 @@ class User extends CI_Controller {
} }
} }
/**
* Default Method
*
* The default method will redirect the browser to the user/login URL.
*/
public function index() { public function index() {
header('Location: ' . $this->config->item('base_url') . '/index.php/user/login'); header('Location: ' . $this->config->item('base_url') . '/index.php/user/login');
} }
/**
* Display the login page.
*/
public function login() { public function login() {
$this->load->model('settings_model'); $this->load->model('settings_model');
@ -48,6 +59,9 @@ class User extends CI_Controller {
$this->load->view('user/login', $view); $this->load->view('user/login', $view);
} }
/**
* Display the logout page.
*/
public function logout() { public function logout() {
$this->load->model('settings_model'); $this->load->model('settings_model');
@ -62,6 +76,9 @@ class User extends CI_Controller {
$this->load->view('user/logout', $view); $this->load->view('user/logout', $view);
} }
/**
* Display the forgot password page.
*/
public function forgot_password() { public function forgot_password() {
$this->load->model('settings_model'); $this->load->model('settings_model');
$view['base_url'] = $this->config->item('base_url'); $view['base_url'] = $this->config->item('base_url');
@ -80,10 +97,10 @@ class User extends CI_Controller {
* [AJAX] Check whether the user has entered the correct login credentials. * [AJAX] Check whether the user has entered the correct login credentials.
* *
* The session data of a logged in user are the following: * The session data of a logged in user are the following:
* 'user_id' * - 'user_id'
* 'user_email' * - 'user_email'
* 'role_slug' * - 'role_slug'
* 'dest_url' * - 'dest_url'
*/ */
public function ajax_check_login() { public function ajax_check_login() {
try { try {

View file

@ -13,7 +13,6 @@ root {
display: block; display: block;
} }
html, html,
body { body {
height: 100%; height: 100%;
@ -241,6 +240,7 @@ body {
margin-bottom: 0; margin-bottom: 0;
} }
/* MOBILE DEVICES /* MOBILE DEVICES
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
@media(max-width:768px) { @media(max-width:768px) {