Reformatted code files.

This commit is contained in:
alext 2018-01-23 10:08:37 +01:00
parent 610fc54a09
commit e013943fde
114 changed files with 2056 additions and 1892 deletions

View file

@ -1,4 +1,5 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| AUTO-LOADER
@ -37,7 +38,7 @@
|
*/
$autoload['packages'] = array();
$autoload['packages'] = [];
/*
@ -52,7 +53,7 @@ $autoload['packages'] = array();
| $autoload['libraries'] = array('database', 'session', 'xmlrpc');
*/
$autoload['libraries'] = array('database');
$autoload['libraries'] = ['database'];
/*
@ -64,7 +65,7 @@ $autoload['libraries'] = array('database');
| $autoload['helper'] = array('url', 'file');
*/
$autoload['helper'] = array('custom_exceptions', 'url', 'file', 'language', 'asset', 'config');
$autoload['helper'] = ['custom_exceptions', 'url', 'file', 'language', 'asset', 'config'];
/*
@ -80,7 +81,7 @@ $autoload['helper'] = array('custom_exceptions', 'url', 'file', 'language', 'ass
|
*/
$autoload['config'] = array();
$autoload['config'] = [];
/*
@ -96,7 +97,7 @@ $autoload['config'] = array();
|
*/
$autoload['language'] = array();
$autoload['language'] = [];
/*
@ -109,7 +110,7 @@ $autoload['language'] = array();
|
*/
$autoload['model'] = array();
$autoload['model'] = [];
/* End of file autoload.php */

View file

@ -1,4 +1,4 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
@ -8,8 +8,8 @@
| Declare some of the global config values of Easy!Appointments.
|
*/
$config['version'] = '1.3.0'; // This must be changed manually.
$config['release_label'] = 'Beta'; // Leave empty for no title or add Alpha, Beta etc ...
$config['version'] = '1.3.0'; // This must be changed manually.
$config['release_label'] = 'Beta'; // Leave empty for no title or add Alpha, Beta etc ...
$config['google_sync_feature'] = Config::GOOGLE_SYNC_FEATURE;
/*
@ -26,7 +26,7 @@ $config['google_sync_feature'] = Config::GOOGLE_SYNC_FEATURE;
| path to your installation.
|
*/
$config['base_url'] = Config::BASE_URL;
$config['base_url'] = Config::BASE_URL;
/*
|--------------------------------------------------------------------------
@ -56,7 +56,7 @@ $config['index_page'] = 'index.php';
| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO
|
*/
$config['uri_protocol'] = 'AUTO';
$config['uri_protocol'] = 'AUTO';
/*
|--------------------------------------------------------------------------
@ -94,7 +94,7 @@ $config['language'] = defined('Config::LANGUAGE') ? Config::LANGUAGE : 'english'
| of these languages.
|
*/
$config['available_languages'] = array(
$config['available_languages'] = [
'arabic',
'bulgarian',
'chinese',
@ -117,7 +117,7 @@ $config['available_languages'] = array(
'slovak',
'spanish',
'turkish'
);
];
/*
|--------------------------------------------------------------------------
@ -202,11 +202,11 @@ $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
| use segment based URLs.
|
*/
$config['allow_get_array'] = TRUE;
$config['allow_get_array'] = TRUE;
$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd'; // experimental not currently in use
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd'; // experimental not currently in use
/*
|--------------------------------------------------------------------------
@ -304,12 +304,12 @@ $config['encryption_key'] = Config::BASE_URL;
| 'sess_time_to_update' = how many seconds between CI refreshing Session Information
|
*/
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ea_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = __DIR__ . '/../../storage/sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ea_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = __DIR__ . '/../../storage/sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
/*
@ -323,10 +323,10 @@ $config['sess_regenerate_destroy'] = FALSE;
| 'cookie_secure' = Cookies will only be set if a secure HTTPS connection exists.
|
*/
$config['cookie_prefix'] = "";
$config['cookie_domain'] = "";
$config['cookie_path'] = "/";
$config['cookie_secure'] = FALSE;
$config['cookie_prefix'] = "";
$config['cookie_domain'] = "";
$config['cookie_path'] = "/";
$config['cookie_secure'] = FALSE;
/*
|--------------------------------------------------------------------------

View file

@ -1,4 +1,4 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
@ -27,14 +27,14 @@ define('DIR_WRITE_MODE', 0777);
|
*/
define('FOPEN_READ', 'rb');
define('FOPEN_READ_WRITE', 'r+b');
define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
define('FOPEN_WRITE_CREATE', 'ab');
define('FOPEN_READ_WRITE_CREATE', 'a+b');
define('FOPEN_WRITE_CREATE_STRICT', 'xb');
define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
define('FOPEN_READ', 'rb');
define('FOPEN_READ_WRITE', 'r+b');
define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
define('FOPEN_WRITE_CREATE', 'ab');
define('FOPEN_READ_WRITE_CREATE', 'a+b');
define('FOPEN_WRITE_CREATE_STRICT', 'xb');
define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
/*
@ -78,8 +78,8 @@ define('DATE_FORMAT_YMD', 'YMD');
define('MIN_PASSWORD_LENGTH', 7);
define('ANY_PROVIDER', 'any-provider');
define('CALENDAR_VIEW_DEFAULT', 'default');
define('CALENDAR_VIEW_TABLE', 'table');
define('CALENDAR_VIEW_DEFAULT', 'default');
define('CALENDAR_VIEW_TABLE', 'table');
define('AVAILABILITIES_TYPE_FLEXIBLE', 'flexible');
define('AVAILABILITIES_TYPE_FIXED', 'fixed');

View file

@ -1,4 +1,5 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
@ -48,7 +49,7 @@
$active_group = 'default';
$query_builder = TRUE;
$db['default']['hostname'] = Config::DB_HOST;
$db['default']['hostname'] = Config::DB_HOST;
$db['default']['username'] = Config::DB_USERNAME;
$db['default']['password'] = Config::DB_PASSWORD;
$db['default']['database'] = Config::DB_NAME;

View file

@ -1,15 +1,15 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') OR exit('No direct script access allowed');
$_doctypes = array(
'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
'xhtml1-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
'xhtml1-trans' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
'xhtml1-frame' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
'html5' => '<!DOCTYPE html>',
'html4-strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
'html4-trans' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
'html4-frame' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">'
);
$_doctypes = [
'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
'xhtml1-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
'xhtml1-trans' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
'xhtml1-frame' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
'html5' => '<!DOCTYPE html>',
'html4-strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
'html4-trans' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
'html4-frame' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">'
];
/* End of file doctypes.php */
/* Location: ./application/config/doctypes.php */
/* Location: ./application/config/doctypes.php */

View file

@ -1,10 +1,10 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') OR exit('No direct script access allowed');
// Add custom values by settings them to the $config array.
// Example: $config['smtp_host'] = 'smtp.gmail.com';
// @link https://codeigniter.com/user_guide/libraries/email.html
$config['useragent'] = 'Easy!Appointments';
$config['useragent'] = 'Easy!Appointments';
$config['protocol'] = 'mail'; // or 'smtp'
$config['mailtype'] = 'html'; // or 'text'
// $config['smtp_host'] = '';

View file

@ -1,4 +1,5 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| Foreign Characters
@ -7,58 +8,58 @@
| conversion used by the Text helper
|
*/
$foreign_characters = array(
'/ä|æ|ǽ/' => 'ae',
'/ö|œ/' => 'oe',
'/ü/' => 'ue',
'/Ä/' => 'Ae',
'/Ü/' => 'Ue',
'/Ö/' => 'Oe',
'/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ/' => 'A',
'/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª/' => 'a',
'/Ç|Ć|Ĉ|Ċ|Č/' => 'C',
'/ç|ć|ĉ|ċ|č/' => 'c',
'/Ð|Ď|Đ/' => 'D',
'/ð|ď|đ/' => 'd',
'/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě/' => 'E',
'/è|é|ê|ë|ē|ĕ|ė|ę|ě/' => 'e',
'/Ĝ|Ğ|Ġ|Ģ/' => 'G',
'/ĝ|ğ|ġ|ģ/' => 'g',
'/Ĥ|Ħ/' => 'H',
'/ĥ|ħ/' => 'h',
'/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ/' => 'I',
'/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı/' => 'i',
'/Ĵ/' => 'J',
'/ĵ/' => 'j',
'/Ķ/' => 'K',
'/ķ/' => 'k',
'/Ĺ|Ļ|Ľ|Ŀ|Ł/' => 'L',
'/ĺ|ļ|ľ|ŀ|ł/' => 'l',
'/Ñ|Ń|Ņ|Ň/' => 'N',
'/ñ|ń|ņ|ň|ʼn/' => 'n',
'/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ/' => 'O',
'/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º/' => 'o',
'/Ŕ|Ŗ|Ř/' => 'R',
'/ŕ|ŗ|ř/' => 'r',
'/Ś|Ŝ|Ş|Š/' => 'S',
'/ś|ŝ|ş|š|ſ/' => 's',
'/Ţ|Ť|Ŧ/' => 'T',
'/ţ|ť|ŧ/' => 't',
'/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ/' => 'U',
'/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ/' => 'u',
'/Ý|Ÿ|Ŷ/' => 'Y',
'/ý|ÿ|ŷ/' => 'y',
'/Ŵ/' => 'W',
'/ŵ/' => 'w',
'/Ź|Ż|Ž/' => 'Z',
'/ź|ż|ž/' => 'z',
'/Æ|Ǽ/' => 'AE',
'/ß/'=> 'ss',
'/IJ/' => 'IJ',
'/ij/' => 'ij',
'/Œ/' => 'OE',
'/ƒ/' => 'f'
);
$foreign_characters = [
'/ä|æ|ǽ/' => 'ae',
'/ö|œ/' => 'oe',
'/ü/' => 'ue',
'/Ä/' => 'Ae',
'/Ü/' => 'Ue',
'/Ö/' => 'Oe',
'/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ/' => 'A',
'/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª/' => 'a',
'/Ç|Ć|Ĉ|Ċ|Č/' => 'C',
'/ç|ć|ĉ|ċ|č/' => 'c',
'/Ð|Ď|Đ/' => 'D',
'/ð|ď|đ/' => 'd',
'/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě/' => 'E',
'/è|é|ê|ë|ē|ĕ|ė|ę|ě/' => 'e',
'/Ĝ|Ğ|Ġ|Ģ/' => 'G',
'/ĝ|ğ|ġ|ģ/' => 'g',
'/Ĥ|Ħ/' => 'H',
'/ĥ|ħ/' => 'h',
'/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ/' => 'I',
'/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı/' => 'i',
'/Ĵ/' => 'J',
'/ĵ/' => 'j',
'/Ķ/' => 'K',
'/ķ/' => 'k',
'/Ĺ|Ļ|Ľ|Ŀ|Ł/' => 'L',
'/ĺ|ļ|ľ|ŀ|ł/' => 'l',
'/Ñ|Ń|Ņ|Ň/' => 'N',
'/ñ|ń|ņ|ň|ʼn/' => 'n',
'/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ/' => 'O',
'/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º/' => 'o',
'/Ŕ|Ŗ|Ř/' => 'R',
'/ŕ|ŗ|ř/' => 'r',
'/Ś|Ŝ|Ş|Š/' => 'S',
'/ś|ŝ|ş|š|ſ/' => 's',
'/Ţ|Ť|Ŧ/' => 'T',
'/ţ|ť|ŧ/' => 't',
'/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ/' => 'U',
'/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ/' => 'u',
'/Ý|Ÿ|Ŷ/' => 'Y',
'/ý|ÿ|ŷ/' => 'y',
'/Ŵ/' => 'W',
'/ŵ/' => 'w',
'/Ź|Ż|Ž/' => 'Z',
'/ź|ż|ž/' => 'z',
'/Æ|Ǽ/' => 'AE',
'/ß/' => 'ss',
'/IJ/' => 'IJ',
'/ij/' => 'ij',
'/Œ/' => 'OE',
'/ƒ/' => 'f'
];
/* End of file foreign_chars.php */
/* Location: ./application/config/foreign_chars.php */
/* Location: ./application/config/foreign_chars.php */

View file

@ -1,4 +1,5 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Hooks
@ -11,4 +12,4 @@
*/
/* End of file hooks.php */
/* Location: ./application/config/hooks.php */
/* Location: ./application/config/hooks.php */

View file

@ -1,10 +1,10 @@
<html>
<head>
<title>403 Forbidden</title>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
</html>

View file

@ -1,4 +1,5 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Enable/Disable Migrations

View file

@ -1,5 +1,4 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
@ -9,159 +8,257 @@ defined('BASEPATH') OR exit('No direct script access allowed');
| Upload class to help identify allowed file types.
|
*/
return array(
'hqx' => array('application/mac-binhex40', 'application/mac-binhex', 'application/x-binhex40', 'application/x-mac-binhex40'),
'cpt' => 'application/mac-compactpro',
'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain'),
'bin' => array('application/macbinary', 'application/mac-binary', 'application/octet-stream', 'application/x-binary', 'application/x-macbinary'),
'dms' => 'application/octet-stream',
'lha' => 'application/octet-stream',
'lzh' => 'application/octet-stream',
'exe' => array('application/octet-stream', 'application/x-msdownload'),
'class' => 'application/octet-stream',
'psd' => array('application/x-photoshop', 'image/vnd.adobe.photoshop'),
'so' => 'application/octet-stream',
'sea' => 'application/octet-stream',
'dll' => 'application/octet-stream',
'oda' => 'application/oda',
'pdf' => array('application/pdf', 'application/force-download', 'application/x-download', 'binary/octet-stream'),
'ai' => array('application/pdf', 'application/postscript'),
'eps' => 'application/postscript',
'ps' => 'application/postscript',
'smi' => 'application/smil',
'smil' => 'application/smil',
'mif' => 'application/vnd.mif',
'xls' => array('application/vnd.ms-excel', 'application/msexcel', 'application/x-msexcel', 'application/x-ms-excel', 'application/x-excel', 'application/x-dos_ms_excel', 'application/xls', 'application/x-xls', 'application/excel', 'application/download', 'application/vnd.ms-office', 'application/msword'),
'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint', 'application/vnd.ms-office', 'application/msword'),
'pptx' => array('application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/x-zip', 'application/zip'),
'wbxml' => 'application/wbxml',
'wmlc' => 'application/wmlc',
'dcr' => 'application/x-director',
'dir' => 'application/x-director',
'dxr' => 'application/x-director',
'dvi' => 'application/x-dvi',
'gtar' => 'application/x-gtar',
'gz' => 'application/x-gzip',
'gzip' => 'application/x-gzip',
'php' => array('application/x-httpd-php', 'application/php', 'application/x-php', 'text/php', 'text/x-php', 'application/x-httpd-php-source'),
'php4' => 'application/x-httpd-php',
'php3' => 'application/x-httpd-php',
'phtml' => 'application/x-httpd-php',
'phps' => 'application/x-httpd-php-source',
'js' => array('application/x-javascript', 'text/plain'),
'swf' => 'application/x-shockwave-flash',
'sit' => 'application/x-stuffit',
'tar' => 'application/x-tar',
'tgz' => array('application/x-tar', 'application/x-gzip-compressed'),
'z' => 'application/x-compress',
'xhtml' => 'application/xhtml+xml',
'xht' => 'application/xhtml+xml',
'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed', 'application/s-compressed', 'multipart/x-zip'),
'rar' => array('application/x-rar', 'application/rar', 'application/x-rar-compressed'),
'mid' => 'audio/midi',
'midi' => 'audio/midi',
'mpga' => 'audio/mpeg',
'mp2' => 'audio/mpeg',
'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'),
'aif' => array('audio/x-aiff', 'audio/aiff'),
'aiff' => array('audio/x-aiff', 'audio/aiff'),
'aifc' => 'audio/x-aiff',
'ram' => 'audio/x-pn-realaudio',
'rm' => 'audio/x-pn-realaudio',
'rpm' => 'audio/x-pn-realaudio-plugin',
'ra' => 'audio/x-realaudio',
'rv' => 'video/vnd.rn-realvideo',
'wav' => array('audio/x-wav', 'audio/wave', 'audio/wav'),
'bmp' => array('image/bmp', 'image/x-bmp', 'image/x-bitmap', 'image/x-xbitmap', 'image/x-win-bitmap', 'image/x-windows-bmp', 'image/ms-bmp', 'image/x-ms-bmp', 'application/bmp', 'application/x-bmp', 'application/x-win-bitmap'),
'gif' => 'image/gif',
'jpeg' => array('image/jpeg', 'image/pjpeg'),
'jpg' => array('image/jpeg', 'image/pjpeg'),
'jpe' => array('image/jpeg', 'image/pjpeg'),
'jp2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'j2k' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'jpf' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'jpg2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'jpx' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'jpm' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'mj2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'mjp2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'png' => array('image/png', 'image/x-png'),
'tiff' => 'image/tiff',
'tif' => 'image/tiff',
'css' => array('text/css', 'text/plain'),
'html' => array('text/html', 'text/plain'),
'htm' => array('text/html', 'text/plain'),
'shtml' => array('text/html', 'text/plain'),
'txt' => 'text/plain',
'text' => 'text/plain',
'log' => array('text/plain', 'text/x-log'),
'rtx' => 'text/richtext',
'rtf' => 'text/rtf',
'xml' => array('application/xml', 'text/xml', 'text/plain'),
'xsl' => array('application/xml', 'text/xsl', 'text/xml'),
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'mpe' => 'video/mpeg',
'qt' => 'video/quicktime',
'mov' => 'video/quicktime',
'avi' => array('video/x-msvideo', 'video/msvideo', 'video/avi', 'application/x-troff-msvideo'),
'movie' => 'video/x-sgi-movie',
'doc' => array('application/msword', 'application/vnd.ms-office'),
'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword', 'application/x-zip'),
'dot' => array('application/msword', 'application/vnd.ms-office'),
'dotx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword'),
'xlsx' => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip', 'application/vnd.ms-excel', 'application/msword', 'application/x-zip'),
'word' => array('application/msword', 'application/octet-stream'),
'xl' => 'application/excel',
'eml' => 'message/rfc822',
'json' => array('application/json', 'text/json'),
'pem' => array('application/x-x509-user-cert', 'application/x-pem-file', 'application/octet-stream'),
'p10' => array('application/x-pkcs10', 'application/pkcs10'),
'p12' => 'application/x-pkcs12',
'p7a' => 'application/x-pkcs7-signature',
'p7c' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
'p7m' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
'p7r' => 'application/x-pkcs7-certreqresp',
'p7s' => 'application/pkcs7-signature',
'crt' => array('application/x-x509-ca-cert', 'application/x-x509-user-cert', 'application/pkix-cert'),
'crl' => array('application/pkix-crl', 'application/pkcs-crl'),
'der' => 'application/x-x509-ca-cert',
'kdb' => 'application/octet-stream',
'pgp' => 'application/pgp',
'gpg' => 'application/gpg-keys',
'sst' => 'application/octet-stream',
'csr' => 'application/octet-stream',
'rsa' => 'application/x-pkcs7',
'cer' => array('application/pkix-cert', 'application/x-x509-ca-cert'),
'3g2' => 'video/3gpp2',
'3gp' => array('video/3gp', 'video/3gpp'),
'mp4' => 'video/mp4',
'm4a' => 'audio/x-m4a',
'f4v' => array('video/mp4', 'video/x-f4v'),
'flv' => 'video/x-flv',
'webm' => 'video/webm',
'aac' => 'audio/x-acc',
'm4u' => 'application/vnd.mpegurl',
'm3u' => 'text/plain',
'xspf' => 'application/xspf+xml',
'vlc' => 'application/videolan',
'wmv' => array('video/x-ms-wmv', 'video/x-ms-asf'),
'au' => 'audio/x-au',
'ac3' => 'audio/ac3',
'flac' => 'audio/x-flac',
'ogg' => array('audio/ogg', 'video/ogg', 'application/ogg'),
'kmz' => array('application/vnd.google-earth.kmz', 'application/zip', 'application/x-zip'),
'kml' => array('application/vnd.google-earth.kml+xml', 'application/xml', 'text/xml'),
'ics' => 'text/calendar',
'ical' => 'text/calendar',
'zsh' => 'text/x-scriptzsh',
'7zip' => array('application/x-compressed', 'application/x-zip-compressed', 'application/zip', 'multipart/x-zip'),
'cdr' => array('application/cdr', 'application/coreldraw', 'application/x-cdr', 'application/x-coreldraw', 'image/cdr', 'image/x-cdr', 'zz-application/zz-winassoc-cdr'),
'wma' => array('audio/x-ms-wma', 'video/x-ms-asf'),
'jar' => array('application/java-archive', 'application/x-java-application', 'application/x-jar', 'application/x-compressed'),
'svg' => array('image/svg+xml', 'application/xml', 'text/xml'),
'vcf' => 'text/x-vcard',
'srt' => array('text/srt', 'text/plain'),
'vtt' => array('text/vtt', 'text/plain'),
'ico' => array('image/x-icon', 'image/x-ico', 'image/vnd.microsoft.icon')
);
return [
'hqx' => [
'application/mac-binhex40',
'application/mac-binhex',
'application/x-binhex40',
'application/x-mac-binhex40'
],
'cpt' => 'application/mac-compactpro',
'csv' => [
'text/x-comma-separated-values',
'text/comma-separated-values',
'application/octet-stream',
'application/vnd.ms-excel',
'application/x-csv',
'text/x-csv',
'text/csv',
'application/csv',
'application/excel',
'application/vnd.msexcel',
'text/plain'
],
'bin' => [
'application/macbinary',
'application/mac-binary',
'application/octet-stream',
'application/x-binary',
'application/x-macbinary'
],
'dms' => 'application/octet-stream',
'lha' => 'application/octet-stream',
'lzh' => 'application/octet-stream',
'exe' => ['application/octet-stream', 'application/x-msdownload'],
'class' => 'application/octet-stream',
'psd' => ['application/x-photoshop', 'image/vnd.adobe.photoshop'],
'so' => 'application/octet-stream',
'sea' => 'application/octet-stream',
'dll' => 'application/octet-stream',
'oda' => 'application/oda',
'pdf' => ['application/pdf', 'application/force-download', 'application/x-download', 'binary/octet-stream'],
'ai' => ['application/pdf', 'application/postscript'],
'eps' => 'application/postscript',
'ps' => 'application/postscript',
'smi' => 'application/smil',
'smil' => 'application/smil',
'mif' => 'application/vnd.mif',
'xls' => [
'application/vnd.ms-excel',
'application/msexcel',
'application/x-msexcel',
'application/x-ms-excel',
'application/x-excel',
'application/x-dos_ms_excel',
'application/xls',
'application/x-xls',
'application/excel',
'application/download',
'application/vnd.ms-office',
'application/msword'
],
'ppt' => [
'application/powerpoint',
'application/vnd.ms-powerpoint',
'application/vnd.ms-office',
'application/msword'
],
'pptx' => [
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'application/x-zip',
'application/zip'
],
'wbxml' => 'application/wbxml',
'wmlc' => 'application/wmlc',
'dcr' => 'application/x-director',
'dir' => 'application/x-director',
'dxr' => 'application/x-director',
'dvi' => 'application/x-dvi',
'gtar' => 'application/x-gtar',
'gz' => 'application/x-gzip',
'gzip' => 'application/x-gzip',
'php' => [
'application/x-httpd-php',
'application/php',
'application/x-php',
'text/php',
'text/x-php',
'application/x-httpd-php-source'
],
'php4' => 'application/x-httpd-php',
'php3' => 'application/x-httpd-php',
'phtml' => 'application/x-httpd-php',
'phps' => 'application/x-httpd-php-source',
'js' => ['application/x-javascript', 'text/plain'],
'swf' => 'application/x-shockwave-flash',
'sit' => 'application/x-stuffit',
'tar' => 'application/x-tar',
'tgz' => ['application/x-tar', 'application/x-gzip-compressed'],
'z' => 'application/x-compress',
'xhtml' => 'application/xhtml+xml',
'xht' => 'application/xhtml+xml',
'zip' => [
'application/x-zip',
'application/zip',
'application/x-zip-compressed',
'application/s-compressed',
'multipart/x-zip'
],
'rar' => ['application/x-rar', 'application/rar', 'application/x-rar-compressed'],
'mid' => 'audio/midi',
'midi' => 'audio/midi',
'mpga' => 'audio/mpeg',
'mp2' => 'audio/mpeg',
'mp3' => ['audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'],
'aif' => ['audio/x-aiff', 'audio/aiff'],
'aiff' => ['audio/x-aiff', 'audio/aiff'],
'aifc' => 'audio/x-aiff',
'ram' => 'audio/x-pn-realaudio',
'rm' => 'audio/x-pn-realaudio',
'rpm' => 'audio/x-pn-realaudio-plugin',
'ra' => 'audio/x-realaudio',
'rv' => 'video/vnd.rn-realvideo',
'wav' => ['audio/x-wav', 'audio/wave', 'audio/wav'],
'bmp' => [
'image/bmp',
'image/x-bmp',
'image/x-bitmap',
'image/x-xbitmap',
'image/x-win-bitmap',
'image/x-windows-bmp',
'image/ms-bmp',
'image/x-ms-bmp',
'application/bmp',
'application/x-bmp',
'application/x-win-bitmap'
],
'gif' => 'image/gif',
'jpeg' => ['image/jpeg', 'image/pjpeg'],
'jpg' => ['image/jpeg', 'image/pjpeg'],
'jpe' => ['image/jpeg', 'image/pjpeg'],
'jp2' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
'j2k' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
'jpf' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
'jpg2' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
'jpx' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
'jpm' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
'mj2' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
'mjp2' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
'png' => ['image/png', 'image/x-png'],
'tiff' => 'image/tiff',
'tif' => 'image/tiff',
'css' => ['text/css', 'text/plain'],
'html' => ['text/html', 'text/plain'],
'htm' => ['text/html', 'text/plain'],
'shtml' => ['text/html', 'text/plain'],
'txt' => 'text/plain',
'text' => 'text/plain',
'log' => ['text/plain', 'text/x-log'],
'rtx' => 'text/richtext',
'rtf' => 'text/rtf',
'xml' => ['application/xml', 'text/xml', 'text/plain'],
'xsl' => ['application/xml', 'text/xsl', 'text/xml'],
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'mpe' => 'video/mpeg',
'qt' => 'video/quicktime',
'mov' => 'video/quicktime',
'avi' => ['video/x-msvideo', 'video/msvideo', 'video/avi', 'application/x-troff-msvideo'],
'movie' => 'video/x-sgi-movie',
'doc' => ['application/msword', 'application/vnd.ms-office'],
'docx' => [
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/zip',
'application/msword',
'application/x-zip'
],
'dot' => ['application/msword', 'application/vnd.ms-office'],
'dotx' => [
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/zip',
'application/msword'
],
'xlsx' => [
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'application/zip',
'application/vnd.ms-excel',
'application/msword',
'application/x-zip'
],
'word' => ['application/msword', 'application/octet-stream'],
'xl' => 'application/excel',
'eml' => 'message/rfc822',
'json' => ['application/json', 'text/json'],
'pem' => ['application/x-x509-user-cert', 'application/x-pem-file', 'application/octet-stream'],
'p10' => ['application/x-pkcs10', 'application/pkcs10'],
'p12' => 'application/x-pkcs12',
'p7a' => 'application/x-pkcs7-signature',
'p7c' => ['application/pkcs7-mime', 'application/x-pkcs7-mime'],
'p7m' => ['application/pkcs7-mime', 'application/x-pkcs7-mime'],
'p7r' => 'application/x-pkcs7-certreqresp',
'p7s' => 'application/pkcs7-signature',
'crt' => ['application/x-x509-ca-cert', 'application/x-x509-user-cert', 'application/pkix-cert'],
'crl' => ['application/pkix-crl', 'application/pkcs-crl'],
'der' => 'application/x-x509-ca-cert',
'kdb' => 'application/octet-stream',
'pgp' => 'application/pgp',
'gpg' => 'application/gpg-keys',
'sst' => 'application/octet-stream',
'csr' => 'application/octet-stream',
'rsa' => 'application/x-pkcs7',
'cer' => ['application/pkix-cert', 'application/x-x509-ca-cert'],
'3g2' => 'video/3gpp2',
'3gp' => ['video/3gp', 'video/3gpp'],
'mp4' => 'video/mp4',
'm4a' => 'audio/x-m4a',
'f4v' => ['video/mp4', 'video/x-f4v'],
'flv' => 'video/x-flv',
'webm' => 'video/webm',
'aac' => 'audio/x-acc',
'm4u' => 'application/vnd.mpegurl',
'm3u' => 'text/plain',
'xspf' => 'application/xspf+xml',
'vlc' => 'application/videolan',
'wmv' => ['video/x-ms-wmv', 'video/x-ms-asf'],
'au' => 'audio/x-au',
'ac3' => 'audio/ac3',
'flac' => 'audio/x-flac',
'ogg' => ['audio/ogg', 'video/ogg', 'application/ogg'],
'kmz' => ['application/vnd.google-earth.kmz', 'application/zip', 'application/x-zip'],
'kml' => ['application/vnd.google-earth.kml+xml', 'application/xml', 'text/xml'],
'ics' => 'text/calendar',
'ical' => 'text/calendar',
'zsh' => 'text/x-scriptzsh',
'7zip' => ['application/x-compressed', 'application/x-zip-compressed', 'application/zip', 'multipart/x-zip'],
'cdr' => [
'application/cdr',
'application/coreldraw',
'application/x-cdr',
'application/x-coreldraw',
'image/cdr',
'image/x-cdr',
'zz-application/zz-winassoc-cdr'
],
'wma' => ['audio/x-ms-wma', 'video/x-ms-asf'],
'jar' => [
'application/java-archive',
'application/x-java-application',
'application/x-jar',
'application/x-compressed'
],
'svg' => ['image/svg+xml', 'application/xml', 'text/xml'],
'vcf' => 'text/x-vcard',
'srt' => ['text/srt', 'text/plain'],
'vtt' => ['text/vtt', 'text/plain'],
'ico' => ['image/x-icon', 'image/x-ico', 'image/vnd.microsoft.icon']
];

View file

@ -1,4 +1,5 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Profiler Sections
@ -12,6 +13,5 @@
*/
/* End of file profiler.php */
/* Location: ./application/config/profiler.php */
/* Location: ./application/config/profiler.php */

View file

@ -1,4 +1,5 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| URI ROUTING
@ -55,19 +56,20 @@ $route['404_override'] = 'errors/error404';
$resources = [
'appointments',
'unavailabilities',
'customers',
'customers',
'services',
'categories',
'admins',
'providers',
'providers',
'secretaries'
];
foreach($resources as $resource) {
foreach ($resources as $resource)
{
$route['api/v1/' . $resource]['post'] = 'api/v1/' . $resource . '/post';
$route['api/v1/' . $resource . '/(:num)']['put'] = 'api/v1/' . $resource . '/put/$1';
$route['api/v1/' . $resource . '/(:num)']['delete'] = 'api/v1/' . $resource . '/delete/$1';
$route['api/v1/' . $resource]['get'] = 'api/v1/' . $resource . '/get';
$route['api/v1/' . $resource]['get'] = 'api/v1/' . $resource . '/get';
$route['api/v1/' . $resource . '/(:num)']['get'] = 'api/v1/' . $resource . '/get/$1';
}

View file

@ -1,4 +1,5 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| SMILEYS
@ -12,55 +13,55 @@
|
*/
$smileys = array(
$smileys = [
// smiley image name width height alt
':-)' => array('grin.gif', '19', '19', 'grin'),
':lol:' => array('lol.gif', '19', '19', 'LOL'),
':cheese:' => array('cheese.gif', '19', '19', 'cheese'),
':)' => array('smile.gif', '19', '19', 'smile'),
';-)' => array('wink.gif', '19', '19', 'wink'),
';)' => array('wink.gif', '19', '19', 'wink'),
':smirk:' => array('smirk.gif', '19', '19', 'smirk'),
':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'),
':-S' => array('confused.gif', '19', '19', 'confused'),
':wow:' => array('surprise.gif', '19', '19', 'surprised'),
':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'),
':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'),
'%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'),
';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'),
':P' => array('raspberry.gif', '19', '19', 'raspberry'),
':blank:' => array('blank.gif', '19', '19', 'blank stare'),
':long:' => array('longface.gif', '19', '19', 'long face'),
':ohh:' => array('ohh.gif', '19', '19', 'ohh'),
':grrr:' => array('grrr.gif', '19', '19', 'grrr'),
':gulp:' => array('gulp.gif', '19', '19', 'gulp'),
'8-/' => array('ohoh.gif', '19', '19', 'oh oh'),
':down:' => array('downer.gif', '19', '19', 'downer'),
':red:' => array('embarrassed.gif', '19', '19', 'red face'),
':sick:' => array('sick.gif', '19', '19', 'sick'),
':shut:' => array('shuteye.gif', '19', '19', 'shut eye'),
':-/' => array('hmm.gif', '19', '19', 'hmmm'),
'>:(' => array('mad.gif', '19', '19', 'mad'),
':mad:' => array('mad.gif', '19', '19', 'mad'),
'>:-(' => array('angry.gif', '19', '19', 'angry'),
':angry:' => array('angry.gif', '19', '19', 'angry'),
':zip:' => array('zip.gif', '19', '19', 'zipper'),
':kiss:' => array('kiss.gif', '19', '19', 'kiss'),
':ahhh:' => array('shock.gif', '19', '19', 'shock'),
':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'),
':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'),
':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'),
':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'),
':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'),
':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'),
':vampire:' => array('vampire.gif', '19', '19', 'vampire'),
':snake:' => array('snake.gif', '19', '19', 'snake'),
':exclaim:' => array('exclaim.gif', '19', '19', 'excaim'),
':question:' => array('question.gif', '19', '19', 'question') // no comma after last item
':-)' => ['grin.gif', '19', '19', 'grin'],
':lol:' => ['lol.gif', '19', '19', 'LOL'],
':cheese:' => ['cheese.gif', '19', '19', 'cheese'],
':)' => ['smile.gif', '19', '19', 'smile'],
';-)' => ['wink.gif', '19', '19', 'wink'],
';)' => ['wink.gif', '19', '19', 'wink'],
':smirk:' => ['smirk.gif', '19', '19', 'smirk'],
':roll:' => ['rolleyes.gif', '19', '19', 'rolleyes'],
':-S' => ['confused.gif', '19', '19', 'confused'],
':wow:' => ['surprise.gif', '19', '19', 'surprised'],
':bug:' => ['bigsurprise.gif', '19', '19', 'big surprise'],
':-P' => ['tongue_laugh.gif', '19', '19', 'tongue laugh'],
'%-P' => ['tongue_rolleye.gif', '19', '19', 'tongue rolleye'],
';-P' => ['tongue_wink.gif', '19', '19', 'tongue wink'],
':P' => ['raspberry.gif', '19', '19', 'raspberry'],
':blank:' => ['blank.gif', '19', '19', 'blank stare'],
':long:' => ['longface.gif', '19', '19', 'long face'],
':ohh:' => ['ohh.gif', '19', '19', 'ohh'],
':grrr:' => ['grrr.gif', '19', '19', 'grrr'],
':gulp:' => ['gulp.gif', '19', '19', 'gulp'],
'8-/' => ['ohoh.gif', '19', '19', 'oh oh'],
':down:' => ['downer.gif', '19', '19', 'downer'],
':red:' => ['embarrassed.gif', '19', '19', 'red face'],
':sick:' => ['sick.gif', '19', '19', 'sick'],
':shut:' => ['shuteye.gif', '19', '19', 'shut eye'],
':-/' => ['hmm.gif', '19', '19', 'hmmm'],
'>:(' => ['mad.gif', '19', '19', 'mad'],
':mad:' => ['mad.gif', '19', '19', 'mad'],
'>:-(' => ['angry.gif', '19', '19', 'angry'],
':angry:' => ['angry.gif', '19', '19', 'angry'],
':zip:' => ['zip.gif', '19', '19', 'zipper'],
':kiss:' => ['kiss.gif', '19', '19', 'kiss'],
':ahhh:' => ['shock.gif', '19', '19', 'shock'],
':coolsmile:' => ['shade_smile.gif', '19', '19', 'cool smile'],
':coolsmirk:' => ['shade_smirk.gif', '19', '19', 'cool smirk'],
':coolgrin:' => ['shade_grin.gif', '19', '19', 'cool grin'],
':coolhmm:' => ['shade_hmm.gif', '19', '19', 'cool hmm'],
':coolmad:' => ['shade_mad.gif', '19', '19', 'cool mad'],
':coolcheese:' => ['shade_cheese.gif', '19', '19', 'cool cheese'],
':vampire:' => ['vampire.gif', '19', '19', 'vampire'],
':snake:' => ['snake.gif', '19', '19', 'snake'],
':exclaim:' => ['exclaim.gif', '19', '19', 'excaim'],
':question:' => ['question.gif', '19', '19', 'question'] // no comma after last item
);
];
/* End of file smileys.php */
/* Location: ./application/config/smileys.php */
/* Location: ./application/config/smileys.php */

View file

@ -1,4 +1,5 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| USER AGENT TYPES
@ -10,169 +11,169 @@
|
*/
$platforms = array (
'windows nt 6.0' => 'Windows Longhorn',
'windows nt 5.2' => 'Windows 2003',
'windows nt 5.0' => 'Windows 2000',
'windows nt 5.1' => 'Windows XP',
'windows nt 4.0' => 'Windows NT 4.0',
'winnt4.0' => 'Windows NT 4.0',
'winnt 4.0' => 'Windows NT',
'winnt' => 'Windows NT',
'windows 98' => 'Windows 98',
'win98' => 'Windows 98',
'windows 95' => 'Windows 95',
'win95' => 'Windows 95',
'windows' => 'Unknown Windows OS',
'os x' => 'Mac OS X',
'ppc mac' => 'Power PC Mac',
'freebsd' => 'FreeBSD',
'ppc' => 'Macintosh',
'linux' => 'Linux',
'debian' => 'Debian',
'sunos' => 'Sun Solaris',
'beos' => 'BeOS',
'apachebench' => 'ApacheBench',
'aix' => 'AIX',
'irix' => 'Irix',
'osf' => 'DEC OSF',
'hp-ux' => 'HP-UX',
'netbsd' => 'NetBSD',
'bsdi' => 'BSDi',
'openbsd' => 'OpenBSD',
'gnu' => 'GNU/Linux',
'unix' => 'Unknown Unix OS'
);
$platforms = [
'windows nt 6.0' => 'Windows Longhorn',
'windows nt 5.2' => 'Windows 2003',
'windows nt 5.0' => 'Windows 2000',
'windows nt 5.1' => 'Windows XP',
'windows nt 4.0' => 'Windows NT 4.0',
'winnt4.0' => 'Windows NT 4.0',
'winnt 4.0' => 'Windows NT',
'winnt' => 'Windows NT',
'windows 98' => 'Windows 98',
'win98' => 'Windows 98',
'windows 95' => 'Windows 95',
'win95' => 'Windows 95',
'windows' => 'Unknown Windows OS',
'os x' => 'Mac OS X',
'ppc mac' => 'Power PC Mac',
'freebsd' => 'FreeBSD',
'ppc' => 'Macintosh',
'linux' => 'Linux',
'debian' => 'Debian',
'sunos' => 'Sun Solaris',
'beos' => 'BeOS',
'apachebench' => 'ApacheBench',
'aix' => 'AIX',
'irix' => 'Irix',
'osf' => 'DEC OSF',
'hp-ux' => 'HP-UX',
'netbsd' => 'NetBSD',
'bsdi' => 'BSDi',
'openbsd' => 'OpenBSD',
'gnu' => 'GNU/Linux',
'unix' => 'Unknown Unix OS'
];
// The order of this array should NOT be changed. Many browsers return
// multiple browser types so we want to identify the sub-type first.
$browsers = array(
'Flock' => 'Flock',
'Chrome' => 'Chrome',
'Opera' => 'Opera',
'MSIE' => 'Internet Explorer',
'Internet Explorer' => 'Internet Explorer',
'Shiira' => 'Shiira',
'Firefox' => 'Firefox',
'Chimera' => 'Chimera',
'Phoenix' => 'Phoenix',
'Firebird' => 'Firebird',
'Camino' => 'Camino',
'Netscape' => 'Netscape',
'OmniWeb' => 'OmniWeb',
'Safari' => 'Safari',
'Mozilla' => 'Mozilla',
'Konqueror' => 'Konqueror',
'icab' => 'iCab',
'Lynx' => 'Lynx',
'Links' => 'Links',
'hotjava' => 'HotJava',
'amaya' => 'Amaya',
'IBrowse' => 'IBrowse'
);
$browsers = [
'Flock' => 'Flock',
'Chrome' => 'Chrome',
'Opera' => 'Opera',
'MSIE' => 'Internet Explorer',
'Internet Explorer' => 'Internet Explorer',
'Shiira' => 'Shiira',
'Firefox' => 'Firefox',
'Chimera' => 'Chimera',
'Phoenix' => 'Phoenix',
'Firebird' => 'Firebird',
'Camino' => 'Camino',
'Netscape' => 'Netscape',
'OmniWeb' => 'OmniWeb',
'Safari' => 'Safari',
'Mozilla' => 'Mozilla',
'Konqueror' => 'Konqueror',
'icab' => 'iCab',
'Lynx' => 'Lynx',
'Links' => 'Links',
'hotjava' => 'HotJava',
'amaya' => 'Amaya',
'IBrowse' => 'IBrowse'
];
$mobiles = array(
// legacy array, old values commented out
'mobileexplorer' => 'Mobile Explorer',
$mobiles = [
// legacy array, old values commented out
'mobileexplorer' => 'Mobile Explorer',
// 'openwave' => 'Open Wave',
// 'opera mini' => 'Opera Mini',
// 'operamini' => 'Opera Mini',
// 'elaine' => 'Palm',
'palmsource' => 'Palm',
'palmsource' => 'Palm',
// 'digital paths' => 'Palm',
// 'avantgo' => 'Avantgo',
// 'xiino' => 'Xiino',
'palmscape' => 'Palmscape',
'palmscape' => 'Palmscape',
// 'nokia' => 'Nokia',
// 'ericsson' => 'Ericsson',
// 'blackberry' => 'BlackBerry',
// 'motorola' => 'Motorola'
// Phones and Manufacturers
'motorola' => "Motorola",
'nokia' => "Nokia",
'palm' => "Palm",
'iphone' => "Apple iPhone",
'ipad' => "iPad",
'ipod' => "Apple iPod Touch",
'sony' => "Sony Ericsson",
'ericsson' => "Sony Ericsson",
'blackberry' => "BlackBerry",
'cocoon' => "O2 Cocoon",
'blazer' => "Treo",
'lg' => "LG",
'amoi' => "Amoi",
'xda' => "XDA",
'mda' => "MDA",
'vario' => "Vario",
'htc' => "HTC",
'samsung' => "Samsung",
'sharp' => "Sharp",
'sie-' => "Siemens",
'alcatel' => "Alcatel",
'benq' => "BenQ",
'ipaq' => "HP iPaq",
'mot-' => "Motorola",
'playstation portable' => "PlayStation Portable",
'hiptop' => "Danger Hiptop",
'nec-' => "NEC",
'panasonic' => "Panasonic",
'philips' => "Philips",
'sagem' => "Sagem",
'sanyo' => "Sanyo",
'spv' => "SPV",
'zte' => "ZTE",
'sendo' => "Sendo",
// Phones and Manufacturers
'motorola' => "Motorola",
'nokia' => "Nokia",
'palm' => "Palm",
'iphone' => "Apple iPhone",
'ipad' => "iPad",
'ipod' => "Apple iPod Touch",
'sony' => "Sony Ericsson",
'ericsson' => "Sony Ericsson",
'blackberry' => "BlackBerry",
'cocoon' => "O2 Cocoon",
'blazer' => "Treo",
'lg' => "LG",
'amoi' => "Amoi",
'xda' => "XDA",
'mda' => "MDA",
'vario' => "Vario",
'htc' => "HTC",
'samsung' => "Samsung",
'sharp' => "Sharp",
'sie-' => "Siemens",
'alcatel' => "Alcatel",
'benq' => "BenQ",
'ipaq' => "HP iPaq",
'mot-' => "Motorola",
'playstation portable' => "PlayStation Portable",
'hiptop' => "Danger Hiptop",
'nec-' => "NEC",
'panasonic' => "Panasonic",
'philips' => "Philips",
'sagem' => "Sagem",
'sanyo' => "Sanyo",
'spv' => "SPV",
'zte' => "ZTE",
'sendo' => "Sendo",
// Operating Systems
'symbian' => "Symbian",
'SymbianOS' => "SymbianOS",
'elaine' => "Palm",
'palm' => "Palm",
'series60' => "Symbian S60",
'windows ce' => "Windows CE",
// Operating Systems
'symbian' => "Symbian",
'SymbianOS' => "SymbianOS",
'elaine' => "Palm",
'palm' => "Palm",
'series60' => "Symbian S60",
'windows ce' => "Windows CE",
// Browsers
'obigo' => "Obigo",
'netfront' => "Netfront Browser",
'openwave' => "Openwave Browser",
'mobilexplorer' => "Mobile Explorer",
'operamini' => "Opera Mini",
'opera mini' => "Opera Mini",
// Browsers
'obigo' => "Obigo",
'netfront' => "Netfront Browser",
'openwave' => "Openwave Browser",
'mobilexplorer' => "Mobile Explorer",
'operamini' => "Opera Mini",
'opera mini' => "Opera Mini",
// Other
'digital paths' => "Digital Paths",
'avantgo' => "AvantGo",
'xiino' => "Xiino",
'novarra' => "Novarra Transcoder",
'vodafone' => "Vodafone",
'docomo' => "NTT DoCoMo",
'o2' => "O2",
// Other
'digital paths' => "Digital Paths",
'avantgo' => "AvantGo",
'xiino' => "Xiino",
'novarra' => "Novarra Transcoder",
'vodafone' => "Vodafone",
'docomo' => "NTT DoCoMo",
'o2' => "O2",
// Fallback
'mobile' => "Generic Mobile",
'wireless' => "Generic Mobile",
'j2me' => "Generic Mobile",
'midp' => "Generic Mobile",
'cldc' => "Generic Mobile",
'up.link' => "Generic Mobile",
'up.browser' => "Generic Mobile",
'smartphone' => "Generic Mobile",
'cellphone' => "Generic Mobile"
);
// Fallback
'mobile' => "Generic Mobile",
'wireless' => "Generic Mobile",
'j2me' => "Generic Mobile",
'midp' => "Generic Mobile",
'cldc' => "Generic Mobile",
'up.link' => "Generic Mobile",
'up.browser' => "Generic Mobile",
'smartphone' => "Generic Mobile",
'cellphone' => "Generic Mobile"
];
// There are hundreds of bots but these are the most common.
$robots = array(
'googlebot' => 'Googlebot',
'msnbot' => 'MSNBot',
'slurp' => 'Inktomi Slurp',
'yahoo' => 'Yahoo',
'askjeeves' => 'AskJeeves',
'fastcrawler' => 'FastCrawler',
'infoseek' => 'InfoSeek Robot 1.0',
'lycos' => 'Lycos'
);
$robots = [
'googlebot' => 'Googlebot',
'msnbot' => 'MSNBot',
'slurp' => 'Inktomi Slurp',
'yahoo' => 'Yahoo',
'askjeeves' => 'AskJeeves',
'fastcrawler' => 'FastCrawler',
'infoseek' => 'InfoSeek Robot 1.0',
'lycos' => 'Lycos'
];
/* End of file user_agents.php */
/* Location: ./application/config/user_agents.php */
/* Location: ./application/config/user_agents.php */

View file

@ -30,7 +30,8 @@ class Backend extends CI_Controller {
{
$this->config->set_item('language', $this->session->userdata('language'));
$this->lang->load('translations', $this->session->userdata('language'));
} else
}
else
{
$this->lang->load('translations', $this->config->item('language')); // default
}
@ -80,7 +81,8 @@ class Backend extends CI_Controller {
{
$secretary = $this->secretaries_model->get_row($this->session->userdata('user_id'));
$view['secretary_providers'] = $secretary['providers'];
} else
}
else
{
$view['secretary_providers'] = [];
}
@ -92,7 +94,8 @@ class Backend extends CI_Controller {
$appointment = $results[0];
$appointment['customer'] = $this->customers_model->get_row($appointment['id_users_customer']);
$view['edit_appointment'] = $appointment; // This will display the appointment edit dialog on page load.
} else
}
else
{
$view['edit_appointment'] = NULL;
}
@ -320,11 +323,11 @@ class Backend extends CI_Controller {
throw new Exception($this->migration->error_string());
}
$view = ['success' => true];
$view = ['success' => TRUE];
}
catch (Exception $exc)
{
$view = ['success' => false, 'exception' => $exc->getMessage()];
$view = ['success' => FALSE, 'exception' => $exc->getMessage()];
}
$this->load->view('general/update', $view);

View file

@ -54,7 +54,8 @@ class Backend_api extends CI_Controller {
{
$this->config->set_item('language', $this->session->userdata('language'));
$this->lang->load('translations', $this->session->userdata('language'));
} else
}
else
{
$this->lang->load('translations', $this->config->item('language')); // default
}
@ -191,7 +192,8 @@ class Backend_api extends CI_Controller {
if ($this->input->post('filter_type') == FILTER_TYPE_PROVIDER)
{
$where_id = 'id_users_provider';
} else
}
else
{
$where_id = 'id_services';
}
@ -328,7 +330,8 @@ class Backend_api extends CI_Controller {
$service, $customer, $company_settings);
$appointment['id_google_calendar'] = $google_event->id;
$this->appointments_model->add($appointment); // Store google calendar id.
} else
}
else
{
$this->google_sync->update_appointment($appointment, $provider,
$service, $customer, $company_settings);
@ -355,7 +358,8 @@ class Backend_api extends CI_Controller {
$customer_message = new Text($this->lang->line('thank_you_for_appointment'));
$provider_title = new Text($this->lang->line('appointment_added_to_your_plan'));
$provider_message = new Text($this->lang->line('appointment_link_description'));
} else
}
else
{
$customer_title = new Text($this->lang->line('appointment_changes_saved'));
$customer_message = new Text('');
@ -396,7 +400,8 @@ class Backend_api extends CI_Controller {
$this->output
->set_content_type('application/json')
->set_output(json_encode(AJAX_SUCCESS));
} else
}
else
{
$this->output
->set_content_type('application/json')
@ -516,7 +521,8 @@ class Backend_api extends CI_Controller {
$this->output
->set_content_type('application/json')
->set_output(json_encode(AJAX_SUCCESS));
} else
}
else
{
$this->output
->set_content_type('application/json')
@ -688,7 +694,8 @@ class Backend_api extends CI_Controller {
$google_event = $this->google_sync->add_unavailable($provider, $unavailable);
$unavailable['id_google_calendar'] = $google_event->id;
$this->appointments_model->add_unavailable($unavailable);
} else
}
else
{
$google_event = $this->google_sync->update_unavailable($provider, $unavailable);
}
@ -704,7 +711,8 @@ class Backend_api extends CI_Controller {
$this->output
->set_content_type('application/json')
->set_output(json_encode(['warnings' => $warnings]));
} else
}
else
{
$this->output
->set_content_type('application/json')
@ -767,7 +775,8 @@ class Backend_api extends CI_Controller {
$this->output
->set_content_type('application/json')
->set_output(json_encode(['warnings' => $warnings]));
} else
}
else
{
$this->output
->set_content_type('application/json')
@ -1434,7 +1443,8 @@ class Backend_api extends CI_Controller {
$this->load->model('settings_model');
$settings = json_decode($this->input->post('settings'), TRUE);
$this->settings_model->save_settings($settings);
} else
}
else
{
if ($this->input->post('type') == SETTINGS_USER)
{
@ -1566,7 +1576,8 @@ class Backend_api extends CI_Controller {
$this->output
->set_content_type('application/json')
->set_output(json_encode($calendars));
} else
}
else
{
$this->output
->set_content_type('application/json')

View file

@ -31,7 +31,8 @@ class Errors extends CI_Controller {
{
$this->config->set_item('language', $this->session->userdata('language'));
$this->lang->load('translations', $this->session->userdata('language'));
} else
}
else
{
$this->lang->load('translations', $this->config->item('language')); // default
}

View file

@ -71,11 +71,13 @@ class Google extends CI_Controller {
$this->providers_model->set_setting('google_sync', TRUE, $_SESSION['oauth_provider_id']);
$this->providers_model->set_setting('google_token', $token, $_SESSION['oauth_provider_id']);
$this->providers_model->set_setting('google_calendar', 'primary', $_SESSION['oauth_provider_id']);
} else
}
else
{
$this->output->set_output('<h1>Sync provider id not specified!</h1>');
}
} else
}
else
{
$this->output->set_output('<h1>Authorization Failed!</h1>');
}
@ -154,7 +156,8 @@ class Google extends CI_Controller {
{
$service = $this->services_model->get_row($appointment['id_services']);
$customer = $this->customers_model->get_row($appointment['id_users_customer']);
} else
}
else
{
$service = NULL;
$customer = NULL;
@ -167,7 +170,8 @@ class Google extends CI_Controller {
$service, $customer, $company_settings);
$appointment['id_google_calendar'] = $google_event->id;
$this->appointments_model->add($appointment); // Save gcal id
} else
}
else
{
// Appointment is synced with google calendar.
try

View file

@ -33,7 +33,8 @@ class Installation extends CI_Controller {
{
$this->config->set_item('language', $this->session->userdata('language'));
$this->lang->load('translations', $this->session->userdata('language'));
} else
}
else
{
$this->lang->load('translations', $this->config->item('language')); // default
}

View file

@ -33,7 +33,8 @@ class User extends CI_Controller {
{
$this->config->set_item('language', $this->session->userdata('language'));
$this->lang->load('translations', $this->session->userdata('language'));
} else
}
else
{
$this->lang->load('translations', $this->config->item('language')); // default
}
@ -135,7 +136,8 @@ class User extends CI_Controller {
$this->output
->set_content_type('application/json')
->set_output(json_encode(AJAX_SUCCESS));
} else
}
else
{
$this->output
->set_content_type('application/json')

View file

@ -51,7 +51,8 @@ class Availabilities extends API_V1_Controller {
if ($this->input->get('date'))
{
$date = new DateTime($this->input->get('date'));
} else
}
else
{
$date = new DateTime();
}
@ -238,14 +239,16 @@ class Availabilities extends API_V1_Controller {
{
// The appointment does not belong in this time period, so we
// will not change anything.
} else
}
else
{
if ($a_start <= $p_start && $a_end <= $p_end && $a_end >= $p_start)
{
// The appointment starts before the period and finishes somewhere inside.
// We will need to break this period and leave the available part.
$period['start'] = date('H:i', $a_end);
} else
}
else
{
if ($a_start >= $p_start && $a_end <= $p_end)
{
@ -260,19 +263,22 @@ class Availabilities extends API_V1_Controller {
'start' => date('H:i', $a_end),
'end' => date('H:i', $p_end)
];
} else
}
else
{
if ($a_start >= $p_start && $a_end >= $p_start && $a_start <= $p_end)
{
// The appointment starts in the period and finishes out of it. We will
// need to remove the time that is taken from the appointment.
$period['end'] = date('H:i', $a_start);
} else
}
else
{
if ($a_start >= $p_start && $a_end >= $p_end && $a_start >= $p_end)
{
// The appointment does not belong in the period so do not change anything.
} else
}
else
{
if ($a_start <= $p_start && $a_end >= $p_end && $a_start <= $p_end)
{

View file

@ -22,10 +22,11 @@
*
* @return string Returns the final asset URL.
*/
function asset_url($uri = '', $protocol = NULL) {
function asset_url($uri = '', $protocol = NULL)
{
$ci =& get_instance();
$cache_busting_token = !Config::DEBUG_MODE ? '?' . $ci->config->item('cache_busting_token') : '';
$cache_busting_token = ! Config::DEBUG_MODE ? '?' . $ci->config->item('cache_busting_token') : '';
return base_url($uri . $cache_busting_token, $protocol);
}

View file

@ -18,8 +18,9 @@
*
* @return mixed Returns the configuration value.
*/
function config($key) {
$framework = & get_instance();
function config($key)
{
$framework = &get_instance();
return $framework->config->item($key);
}

View file

@ -34,7 +34,8 @@ function date3339($timestamp = 0)
if (preg_match('/^([\-+])(\d{2})(\d{2})$/', date('O', $timestamp), $matches))
{
$date .= $matches[1] . $matches[2] . ':' . $matches[3];
} else
}
else
{
$date .= 'Z';
}

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -1,6 +1,6 @@
<html>
<head>
<title> ٤٠٣ غير مصرح للوصول هنا </title>
<title> ٤٠٣ غير مصرح للوصول هنا </title>
</head>
<body>

View file

@ -232,7 +232,7 @@ $lang['filter'] = 'تنقية/فلترة';
$lang['clear'] = 'تنظيف';
$lang['uncategorized'] = 'غير مصنّف';
$lang['username_already_exists'] = 'اسم المستخدم موجود مسبقا';
$lang['password_length_notice'] = 'حرف على الأقل $number اسم المستخدم يجب ان يكون';
$lang['password_length_notice'] = 'حرف على الأقل $number اسم المستخدم يجب ان يكون';
$lang['general_settings'] = 'الاعدادات العامة';
$lang['personal_information'] = 'المعلومات الشخصية';
$lang['system_login'] = 'تسجيل الدخول الى النظام';

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -1,7 +1,7 @@
<?php
/**
db_lang.php
email_lang.php * CodeIgniter
* db_lang.php
* email_lang.php * CodeIgniter
*
* An open source application development framework for PHP
*
@ -27,13 +27,13 @@ email_lang.php * CodeIgniter
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -1,12 +1,12 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed');
$lang['migration_none_found'] = "No se encontraron migraciones.";
$lang['migration_not_found'] = "No se pudo encontrar esta migraci&oacute;n.";
$lang['migration_multiple_version'] = "Estas son m&uacute;ltiples migraciones con el mismo n&uacute;mero de versi&oacute;n: %d.";
$lang['migration_class_doesnt_exist'] = "No existe la migraci&oacute;n clase \"%s\".";
$lang['migration_missing_up_method'] = "A la migraci&oacute;n clase \"%s\" le falta un m&eacute;todo de 'subida'.";
$lang['migration_missing_down_method'] = "A la migraci&oacute;n clase \"%s\" le falta un m&eacute;todo de 'bajada'.";
$lang['migration_invalid_filename'] = "La migraci&oacute;n \"%s\" tiene un archivo inv&aacute;lido.";
$lang['migration_none_found'] = "No se encontraron migraciones.";
$lang['migration_not_found'] = "No se pudo encontrar esta migraci&oacute;n.";
$lang['migration_multiple_version'] = "Estas son m&uacute;ltiples migraciones con el mismo n&uacute;mero de versi&oacute;n: %d.";
$lang['migration_class_doesnt_exist'] = "No existe la migraci&oacute;n clase \"%s\".";
$lang['migration_missing_up_method'] = "A la migraci&oacute;n clase \"%s\" le falta un m&eacute;todo de 'subida'.";
$lang['migration_missing_down_method'] = "A la migraci&oacute;n clase \"%s\" le falta un m&eacute;todo de 'bajada'.";
$lang['migration_invalid_filename'] = "La migraci&oacute;n \"%s\" tiene un archivo inv&aacute;lido.";
/* End of file migration_lang.php */

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -26,13 +26,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

View file

@ -1,6 +1,5 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/* ----------------------------------------------------------------------------
* Easy!Appointments - Open Source Web Scheduler
*

View file

@ -54,7 +54,8 @@ class Admins_Model extends CI_Model {
if ( ! isset($admin['id']))
{
$admin['id'] = $this->_insert($admin);
} else
}
else
{
$admin['id'] = $this->_update($admin);
}

View file

@ -37,7 +37,8 @@ class Appointments_Model extends CI_Model {
if ( ! isset($appointment['id']))
{
$appointment['id'] = $this->_insert($appointment);
} else
}
else
{
$this->_update($appointment);
}
@ -338,7 +339,7 @@ class Appointments_Model extends CI_Model {
*
* @return array Returns the rows from the database.
*/
public function get_batch($where_clause = '', $aggregates = false)
public function get_batch($where_clause = '', $aggregates = FALSE)
{
if ($where_clause != '')
{
@ -347,8 +348,10 @@ class Appointments_Model extends CI_Model {
$appointments = $this->db->get('ea_appointments')->result_array();
if ($aggregates) {
foreach($appointments as &$appointment) {
if ($aggregates)
{
foreach ($appointments as &$appointment)
{
$appointment = $this->get_aggregates($appointment);
}
}
@ -409,7 +412,8 @@ class Appointments_Model extends CI_Model {
$this->db->insert('ea_appointments', $unavailable);
$unavailable['id'] = $this->db->insert_id();
} else
}
else
{
$this->db->where(['id' => $unavailable['id']]);
$this->db->update('ea_appointments', $unavailable);
@ -490,8 +494,9 @@ class Appointments_Model extends CI_Model {
*
* @return int Returns the number of attendants for selected time period.
*/
public function get_attendants_number_for_period(DateTime $slot_start, DateTime $slot_end, $service_id) {
return(int)$this->db
public function get_attendants_number_for_period(DateTime $slot_start, DateTime $slot_end, $service_id)
{
return (int)$this->db
->select('count(*) AS attendants_number')
->from('ea_appointments')
->group_start()
@ -515,10 +520,14 @@ class Appointments_Model extends CI_Model {
*
* @return array Returns the appointment with the aggregates.
*/
private function get_aggregates(array $appointment) {
$appointment['service'] = $this->db->get_where('ea_services', ['id' => $appointment['id_services']])->row_array();
$appointment['provider'] = $this->db->get_where('ea_users', ['id' => $appointment['id_users_provider']])->row_array();
$appointment['customer'] = $this->db->get_where('ea_users', ['id' => $appointment['id_users_customer']])->row_array();
private function get_aggregates(array $appointment)
{
$appointment['service'] = $this->db->get_where('ea_services',
['id' => $appointment['id_services']])->row_array();
$appointment['provider'] = $this->db->get_where('ea_users',
['id' => $appointment['id_users_provider']])->row_array();
$appointment['customer'] = $this->db->get_where('ea_users',
['id' => $appointment['id_users_customer']])->row_array();
return $appointment;
}
}

View file

@ -44,7 +44,8 @@ class Customers_Model extends CI_Model {
if ( ! isset($customer['id']))
{
$customer['id'] = $this->_insert($customer);
} else
}
else
{
$this->_update($customer);
}

View file

@ -68,7 +68,8 @@ class Providers_Model extends CI_Model {
if ( ! isset($provider['id']))
{
$provider['id'] = $this->_insert($provider);
} else
}
else
{
$provider['id'] = $this->_update($provider);
}
@ -256,7 +257,8 @@ class Providers_Model extends CI_Model {
if ( ! isset($provider['services']) || ! is_array($provider['services']))
{
throw new Exception('Invalid provider services given: ' . print_r($provider, TRUE));
} else
}
else
{ // Check if services are valid int values.
foreach ($provider['services'] as $service_id)
{

View file

@ -56,7 +56,8 @@ class Secretaries_Model extends CI_Model {
if ( ! isset($secretary['id']))
{
$secretary['id'] = $this->_insert($secretary);
} else
}
else
{
$secretary['id'] = $this->_update($secretary);
}

View file

@ -31,7 +31,8 @@ class Services_Model extends CI_Model {
if ( ! isset($service['id']))
{
$service['id'] = $this->_insert($service);
} else
}
else
{
$this->_update($service);
}
@ -359,7 +360,8 @@ class Services_Model extends CI_Model {
{
$this->db->insert('ea_service_categories', $category);
$category['id'] = $this->db->insert_id();
} else
}
else
{
$this->db->where('id', $category['id']);
$this->db->update('ea_service_categories', $category);

View file

@ -75,7 +75,8 @@ class Settings_Model extends CI_Model {
throw new Exception('Could not update database setting.');
}
$setting_id = (int)$this->db->get_where('ea_settings', ['name' => $name])->row()->id;
} else
}
else
{
// Insert setting
$insert_data = [

View file

@ -9,8 +9,6 @@
* @since v1.0.0
* ---------------------------------------------------------------------------- */
@-moz-document url-prefix() {
body .checkbox input[type="checkbox"] {
float: left;

View file

@ -1,10 +1,10 @@
<html>
<head>
<title>403 Forbidden</title>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
</html>

View file

@ -11,34 +11,35 @@
window.Backend = window.Backend || {};
/**
* Backend
*
* This module contains functions that are used in the backend section of the application.
*
* @module Backend
*/
(function(exports) {
/**
* Backend
*
* This module contains functions that are used in the backend section of the application.
*
* @module Backend
*/
(function (exports) {
'use strict';
/**
* Main javascript code for the backend of Easy!Appointments.
*/
$(document).ready(function() {
window.console = window.console || function() {}; // IE compatibility
$(document).ready(function () {
window.console = window.console || function () {
}; // IE compatibility
$(window)
.on('resize', function() {
.on('resize', function () {
Backend.placeFooterToBottom();
})
.trigger('resize');
$(document).ajaxStart(function() {
$(document).ajaxStart(function () {
$('#loading').show();
});
$(document).ajaxStop(function() {
$(document).ajaxStop(function () {
$('#loading').hide();
});
@ -78,7 +79,7 @@ window.Backend = window.Backend || {};
/**
* Place the backend footer always on the bottom of the page.
*/
exports.placeFooterToBottom = function() {
exports.placeFooterToBottom = function () {
var $footer = $('#footer');
if (window.innerHeight > $('body').height()) {
@ -104,35 +105,35 @@ window.Backend = window.Backend || {};
* @param {Array} actions An array with custom actions that will be available to the user. Every
* array item is an object that contains the 'label' and 'function' key values.
*/
exports.displayNotification = function(message, actions) {
exports.displayNotification = function (message, actions) {
message = message || 'NO MESSAGE PROVIDED FOR THIS NOTIFICATION';
if (actions === undefined) {
actions = [];
setTimeout(function() {
setTimeout(function () {
$('#notification').fadeIn();
}, 5000);
}
var customActionsHtml = '';
$.each(actions, function(index, action) {
$.each(actions, function (index, action) {
var actionId = action.label.toLowerCase().replace(' ', '-');
customActionsHtml += '<button id="' + actionId + '" class="btn btn-default btn-xs">'
+ action.label + '</button>';
+ action.label + '</button>';
$(document).off('click', '#' + actionId);
$(document).on('click', '#' + actionId, action.function);
});
var notificationHtml =
'<div class="notification alert">' +
'<button type="button" class="close" data-dismiss="alert" aria-label="Close">' +
'<span aria-hidden="true">&times;</span>' +
'</button>' +
'<strong>' + message + '</strong>' +
customActionsHtml +
'</div>';
'<div class="notification alert">' +
'<button type="button" class="close" data-dismiss="alert" aria-label="Close">' +
'<span aria-hidden="true">&times;</span>' +
'</button>' +
'<strong>' + message + '</strong>' +
customActionsHtml +
'</div>';
$('#notification').html(notificationHtml);
$('#notification').show('fade');

View file

@ -18,7 +18,7 @@
*/
window.BackendCalendar = window.BackendCalendar || {};
(function(exports) {
(function (exports) {
'use strict';
@ -26,16 +26,16 @@ window.BackendCalendar = window.BackendCalendar || {};
* Bind common event handlers.
*/
function _bindEventHandlers() {
var $calendarPage = $('#calendar-page');
var $calendarPage = $('#calendar-page');
$calendarPage.on('click', '#toggle-fullscreen', function() {
$calendarPage.on('click', '#toggle-fullscreen', function () {
var $target = $(this);
var element = document.documentElement;
var element = document.documentElement;
var isFullScreen = (document.fullScreenElement && document.fullScreenElement !== null)
|| document.mozFullScreen
|| document.webkitIsFullScreen;
if (isFullScreen) {
if (isFullScreen) {
// Exit fullscreen mode.
if (document.exitFullscreen)
document.exitFullscreen();
@ -49,7 +49,7 @@ window.BackendCalendar = window.BackendCalendar || {};
$target
.removeClass('btn-success')
.addClass('btn-default');
} else {
// Switch to fullscreen mode.
if (element.requestFullscreen)
@ -76,10 +76,10 @@ window.BackendCalendar = window.BackendCalendar || {};
*
* @param {String} view Optional (default), the calendar view to be loaded.
*/
exports.initialize = function(view) {
exports.initialize = function (view) {
// Load and initialize the calendar view.
if (view === 'table') {
BackendCalendarTableView.initialize();
BackendCalendarTableView.initialize();
} else {
BackendCalendarDefaultView.initialize();
}

View file

@ -18,9 +18,9 @@
*/
window.BackendCalendarApi = window.BackendCalendarApi || {};
(function(exports) {
(function (exports) {
'use strict';
'use strict';
/**
* Save Appointment
@ -33,7 +33,7 @@ window.BackendCalendarApi = window.BackendCalendarApi || {};
* @param {Function} successCallback Optional, if defined, this function is going to be executed on post success.
* @param {Function} errorCallback Optional, if defined, this function is going to be executed on post failure.
*/
exports.saveAppointment = function(appointment, customer, successCallback, errorCallback) {
exports.saveAppointment = function (appointment, customer, successCallback, errorCallback) {
var url = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_appointment';
var data = {
csrfToken: GlobalVariables.csrfToken,
@ -50,12 +50,12 @@ window.BackendCalendarApi = window.BackendCalendarApi || {};
data: data,
dataType: 'json'
})
.done(function(response) {
.done(function (response) {
if (successCallback !== undefined) {
successCallback(response);
}
})
.fail(function(jqXHR, textStatus, errorThrown) {
.fail(function (jqXHR, textStatus, errorThrown) {
if (errorCallback !== undefined) {
errorCallback();
}
@ -69,7 +69,7 @@ window.BackendCalendarApi = window.BackendCalendarApi || {};
* @param {Function} successCallback The ajax success callback function.
* @param {Function} errorCallback The ajax failure callback function.
*/
exports.saveUnavailable = function(unavailable, successCallback, errorCallback) {
exports.saveUnavailable = function (unavailable, successCallback, errorCallback) {
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_unavailable';
var postData = {
csrfToken: GlobalVariables.csrfToken,

View file

@ -18,7 +18,7 @@
*/
window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModal || {};
(function(exports) {
(function (exports) {
'use strict';
@ -28,7 +28,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
*
* Closes the dialog without saving any changes to the database.
*/
$('#manage-appointment #cancel-appointment').click(function() {
$('#manage-appointment #cancel-appointment').click(function () {
$('#manage-appointment').modal('hide');
});
@ -37,7 +37,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
*
* Stores the appointment changes or inserts a new appointment depending the dialog mode.
*/
$('#manage-appointment #save-appointment').click(function() {
$('#manage-appointment #save-appointment').click(function () {
// Before doing anything the appointment data need to be validated.
if (!_validateAppointmentForm()) {
return;
@ -84,7 +84,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
}
// Define success callback.
var successCallback = function(response) {
var successCallback = function (response) {
if (!GeneralFunctions.handleAjaxExceptions(response)) {
$dialog.find('.modal-message').text(EALang.unexpected_issues_occurred);
$dialog.find('.modal-message').addClass('alert-danger').removeClass('hidden');
@ -97,7 +97,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
$dialog.find('.modal-body').scrollTop(0);
// Close the modal dialog and refresh the calendar appointments after one second.
setTimeout(function() {
setTimeout(function () {
$dialog.find('.alert').addClass('hidden');
$dialog.modal('hide');
$('#select-filter-item').trigger('change');
@ -105,7 +105,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
};
// Define error callback.
var errorCallback = function() {
var errorCallback = function () {
$dialog.find('.modal-message').text(EALang.server_communication_error);
$dialog.find('.modal-message').addClass('alert-danger').removeClass('hidden');
$dialog.find('.modal-body').scrollTop(0);
@ -121,16 +121,16 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
* When the user presses this button, the manage appointment dialog opens and lets the user to
* create a new appointment.
*/
$('#insert-appointment').click(function() {
$('#insert-appointment').click(function () {
BackendCalendarAppointmentsModal.resetAppointmentDialog();
var $dialog = $('#manage-appointment');
// Set the selected filter item and find the next appointment time as the default modal values.
if ($('#select-filter-item option:selected').attr('type') == 'provider') {
var $providerOption = $dialog.find('#select-provider option[value="'
+ $('#select-filter-item').val() + '"]');
+ $('#select-filter-item').val() + '"]');
if ($providerOption.length === 0) { // Change the services until you find the correct.
$.each($dialog.find('#select-service option'), function() {
$.each($dialog.find('#select-service option'), function () {
$(this).prop('selected', true).parent().change();
if ($providerOption.length > 0)
return false;
@ -139,11 +139,11 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
$providerOption.prop('selected', true);
} else {
$dialog.find('#select-service option[value="'
+ $('#select-filter-item').val() + '"]').prop('selected', true);
+ $('#select-filter-item').val() + '"]').prop('selected', true);
}
var serviceDuration = 0;
$.each(GlobalVariables.availableServices, function(index, service) {
$.each(GlobalVariables.availableServices, function (index, service) {
if (service.id == $dialog.find('#select-service').val()) {
serviceDuration = service.duration;
return false; // exit loop
@ -154,18 +154,18 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
var currentMin = parseInt(start.toString('mm'));
if (currentMin > 0 && currentMin < 15) {
start.set({ 'minute': 15 });
start.set({'minute': 15});
} else if (currentMin > 15 && currentMin < 30) {
start.set({ 'minute': 30 });
start.set({'minute': 30});
} else if (currentMin > 30 && currentMin < 45) {
start.set({ 'minute': 45 });
start.set({'minute': 45});
} else {
start.addHours(1).set({ 'minute': 0 });
start.addHours(1).set({'minute': 0});
}
$dialog.find('#start-datetime').val(GeneralFunctions.formatDate(start, GlobalVariables.dateFormat, true));
$dialog.find('#end-datetime').val(GeneralFunctions.formatDate(start.addMinutes(serviceDuration),
GlobalVariables.dateFormat, true));
GlobalVariables.dateFormat, true));
// Display modal form.
$dialog.find('.modal-header h3').text(EALang.new_appointment_title);
@ -175,7 +175,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
/**
* Event: Pick Existing Customer Button "Click"
*/
$('#select-customer').click(function() {
$('#select-customer').click(function () {
var $list = $('#existing-customers-list');
if (!$list.is(':visible')) {
@ -184,9 +184,9 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
$list.slideDown('slow');
$('#filter-existing-customers').fadeIn('slow');
$('#filter-existing-customers').val('');
$.each(GlobalVariables.customers, function(index, c) {
$.each(GlobalVariables.customers, function (index, c) {
$list.append('<div data-id="' + c.id + '">'
+ c.first_name + ' ' + c.last_name + '</div>');
+ c.first_name + ' ' + c.last_name + '</div>');
});
} else {
$list.slideUp('slow');
@ -198,10 +198,10 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
/**
* Event: Select Existing Customer From List "Click"
*/
$('#manage-appointment').on('click', '#existing-customers-list div', function() {
$('#manage-appointment').on('click', '#existing-customers-list div', function () {
var id = $(this).attr('data-id');
$.each(GlobalVariables.customers, function(index, c) {
$.each(GlobalVariables.customers, function (index, c) {
if (c.id == id) {
$('#customer-id').val(c.id);
$('#first-name').val(c.first_name);
@ -222,7 +222,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
/**
* Event: Filter Existing Customers "Change"
*/
$('#filter-existing-customers').keyup(function() {
$('#filter-existing-customers').keyup(function () {
var key = $(this).val().toLowerCase();
var $list = $('#existing-customers-list');
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_customers';
@ -239,36 +239,38 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
dataType: 'json',
timeout: 1000,
global: false,
success: function(response) {
success: function (response) {
$list.empty();
$.each(response, function(index, c) {
$.each(response, function (index, c) {
$list.append('<div data-id="' + c.id + '">'
+ c.first_name + ' ' + c.last_name + '</div>');
+ c.first_name + ' ' + c.last_name + '</div>');
// Verify if this customer is on the old customer list.
var result = $.grep(GlobalVariables.customers,
function(e){ return e.id == c.id; });
function (e) {
return e.id == c.id;
});
// Add it to the customer list.
if(result.length == 0){
if (result.length == 0) {
GlobalVariables.customers.push(c);
}
});
},
error: function(jqXHR, textStatus, errorThrown) {
error: function (jqXHR, textStatus, errorThrown) {
// If there is any error on the request, search by the local client database.
$list.empty();
$.each(GlobalVariables.customers, function(index, c) {
$.each(GlobalVariables.customers, function (index, c) {
if (c.first_name.toLowerCase().indexOf(key) != -1
|| c.last_name.toLowerCase().indexOf(key) != -1
|| c.email.toLowerCase().indexOf(key) != -1
|| c.phone_number.toLowerCase().indexOf(key) != -1
|| c.address.toLowerCase().indexOf(key) != -1
|| c.city.toLowerCase().indexOf(key) != -1
|| c.zip_code.toLowerCase().indexOf(key) != -1
|| c.notes.toLowerCase().indexOf(key) != -1) {
|| c.last_name.toLowerCase().indexOf(key) != -1
|| c.email.toLowerCase().indexOf(key) != -1
|| c.phone_number.toLowerCase().indexOf(key) != -1
|| c.address.toLowerCase().indexOf(key) != -1
|| c.city.toLowerCase().indexOf(key) != -1
|| c.zip_code.toLowerCase().indexOf(key) != -1
|| c.notes.toLowerCase().indexOf(key) != -1) {
$list.append('<div data-id="' + c.id + '">'
+ c.first_name + ' ' + c.last_name + '</div>');
+ c.first_name + ' ' + c.last_name + '</div>');
}
});
}
@ -281,12 +283,12 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
* When the user clicks on a service, its available providers should become visible. Also we need to
* update the start and end time of the appointment.
*/
$('#select-service').change(function() {
$('#select-service').change(function () {
var sid = $('#select-service').val();
$('#select-provider').empty();
// Automatically update the service duration.
$.each(GlobalVariables.availableServices, function(indexService, service) {
$.each(GlobalVariables.availableServices, function (indexService, service) {
if (service.id == sid) {
var start = $('#start-datetime').datetimepicker('getDate');
$('#end-datetime').datetimepicker('setDate', new Date(start.getTime() + service.duration * 60000));
@ -295,13 +297,13 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
});
// Update the providers select box.
$.each(GlobalVariables.availableProviders, function(indexProvider, provider) {
$.each(provider.services, function(indexService, serviceId) {
$.each(GlobalVariables.availableProviders, function (indexProvider, provider) {
$.each(provider.services, function (indexService, serviceId) {
// If the current provider is able to provide the selected service, add him to the listbox.
if (serviceId == sid) {
var optionHtml = '<option value="' + provider.id + '">'
+ provider.first_name + ' ' + provider.last_name
+ '</option>';
+ provider.first_name + ' ' + provider.last_name
+ '</option>';
$('#select-provider').append(optionHtml);
}
});
@ -311,9 +313,9 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
/**
* Event: Enter New Customer Button "Click"
*/
$('#new-customer').click(function() {
$('#new-customer').click(function () {
$('#manage-appointment').find('#customer-id, #first-name, #last-name, #email, '
+ '#phone-number, #address, #city, #zip-code, #customer-notes').val('');
+ '#phone-number, #address, #city, #zip-code, #customer-notes').val('');
});
}
@ -323,7 +325,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
* This method resets the manage appointment dialog modal to its initial state. After that you can make
* any modification might be necessary in order to bring the dialog to the desired state.
*/
exports.resetAppointmentDialog = function() {
exports.resetAppointmentDialog = function () {
var $dialog = $('#manage-appointment');
// Empty form fields.
@ -332,15 +334,15 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
// Prepare service and provider select boxes.
$dialog.find('#select-service').val(
$dialog.find('#select-service').eq(0).attr('value'));
$dialog.find('#select-service').eq(0).attr('value'));
// Fill the providers listbox with providers that can serve the appointment's
// service and then select the user's provider.
$dialog.find('#select-provider').empty();
$.each(GlobalVariables.availableProviders, function(index, provider) {
$.each(GlobalVariables.availableProviders, function (index, provider) {
var canProvideService = false;
$.each(provider.services, function(index, serviceId) {
$.each(provider.services, function (index, serviceId) {
if (serviceId == $dialog.find('#select-service').val()) {
canProvideService = true;
return false;
@ -349,7 +351,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
if (canProvideService) { // Add the provider to the listbox.
var option = new Option(provider.first_name
+ ' ' + provider.last_name, provider.id);
+ ' ' + provider.last_name, provider.id);
$dialog.find('#select-provider').append(option);
}
});
@ -362,7 +364,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
// Setup start and datetimepickers.
// Get the selected service duration. It will be needed in order to calculate the appointment end datetime.
var serviceDuration = 0;
$.each(GlobalVariables.availableServices, function(index, service) {
$.each(GlobalVariables.availableServices, function (index, service) {
if (service.id == $dialog.find('#select-service').val()) {
serviceDuration = service.duration;
return false;
@ -370,10 +372,10 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
});
var startDatetime = new Date().addMinutes(GlobalVariables.bookAdvanceTimeout);
var endDatetime = new Date().addMinutes(GlobalVariables.bookAdvanceTimeout).addMinutes(serviceDuration);
var endDatetime = new Date().addMinutes(GlobalVariables.bookAdvanceTimeout).addMinutes(serviceDuration);
var dateFormat;
switch(GlobalVariables.dateFormat) {
switch (GlobalVariables.dateFormat) {
case 'DMY':
dateFormat = 'dd/mm/yy';
break;
@ -393,18 +395,18 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
// Translation
dayNames: [EALang.sunday, EALang.monday, EALang.tuesday, EALang.wednesday,
EALang.thursday, EALang.friday, EALang.saturday],
dayNamesShort: [EALang.sunday.substr(0,3), EALang.monday.substr(0,3),
EALang.tuesday.substr(0,3), EALang.wednesday.substr(0,3),
EALang.thursday.substr(0,3), EALang.friday.substr(0,3),
EALang.saturday.substr(0,3)],
dayNamesMin: [EALang.sunday.substr(0,2), EALang.monday.substr(0,2),
EALang.tuesday.substr(0,2), EALang.wednesday.substr(0,2),
EALang.thursday.substr(0,2), EALang.friday.substr(0,2),
EALang.saturday.substr(0,2)],
EALang.thursday, EALang.friday, EALang.saturday],
dayNamesShort: [EALang.sunday.substr(0, 3), EALang.monday.substr(0, 3),
EALang.tuesday.substr(0, 3), EALang.wednesday.substr(0, 3),
EALang.thursday.substr(0, 3), EALang.friday.substr(0, 3),
EALang.saturday.substr(0, 3)],
dayNamesMin: [EALang.sunday.substr(0, 2), EALang.monday.substr(0, 2),
EALang.tuesday.substr(0, 2), EALang.wednesday.substr(0, 2),
EALang.thursday.substr(0, 2), EALang.friday.substr(0, 2),
EALang.saturday.substr(0, 2)],
monthNames: [EALang.january, EALang.february, EALang.march, EALang.april,
EALang.may, EALang.june, EALang.july, EALang.august, EALang.september,
EALang.october, EALang.november, EALang.december],
EALang.may, EALang.june, EALang.july, EALang.august, EALang.september,
EALang.october, EALang.november, EALang.december],
prevText: EALang.previous,
nextText: EALang.next,
currentText: EALang.now,
@ -423,18 +425,18 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
// Translation
dayNames: [EALang.sunday, EALang.monday, EALang.tuesday, EALang.wednesday,
EALang.thursday, EALang.friday, EALang.saturday],
dayNamesShort: [EALang.sunday.substr(0,3), EALang.monday.substr(0,3),
EALang.tuesday.substr(0,3), EALang.wednesday.substr(0,3),
EALang.thursday.substr(0,3), EALang.friday.substr(0,3),
EALang.saturday.substr(0,3)],
dayNamesMin: [EALang.sunday.substr(0,2), EALang.monday.substr(0,2),
EALang.tuesday.substr(0,2), EALang.wednesday.substr(0,2),
EALang.thursday.substr(0,2), EALang.friday.substr(0,2),
EALang.saturday.substr(0,2)],
EALang.thursday, EALang.friday, EALang.saturday],
dayNamesShort: [EALang.sunday.substr(0, 3), EALang.monday.substr(0, 3),
EALang.tuesday.substr(0, 3), EALang.wednesday.substr(0, 3),
EALang.thursday.substr(0, 3), EALang.friday.substr(0, 3),
EALang.saturday.substr(0, 3)],
dayNamesMin: [EALang.sunday.substr(0, 2), EALang.monday.substr(0, 2),
EALang.tuesday.substr(0, 2), EALang.wednesday.substr(0, 2),
EALang.thursday.substr(0, 2), EALang.friday.substr(0, 2),
EALang.saturday.substr(0, 2)],
monthNames: [EALang.january, EALang.february, EALang.march, EALang.april,
EALang.may, EALang.june, EALang.july, EALang.august, EALang.september,
EALang.october, EALang.november, EALang.december],
EALang.may, EALang.june, EALang.july, EALang.august, EALang.september,
EALang.october, EALang.november, EALang.december],
prevText: EALang.previous,
nextText: EALang.next,
currentText: EALang.now,
@ -465,7 +467,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
// Check required fields.
var missingRequiredField = false;
$dialog.find('.required').each(function() {
$dialog.find('.required').each(function () {
if ($(this).val() == '' || $(this).val() == null) {
$(this).closest('.form-group').addClass('has-error');
missingRequiredField = true;
@ -491,13 +493,13 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
}
return true;
} catch(exc) {
} catch (exc) {
$dialog.find('.modal-message').addClass('alert-danger').text(exc).removeClass('hidden');
return false;
}
}
exports.initialize = function() {
exports.initialize = function () {
_bindEventHandlers();
};

View file

@ -473,7 +473,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
// Display success notification to user.
var undoFunction = function () {
unavailable.end_datetime = event.data.end_datetime = Date.parseExact(
unavailable.end_datetime = event.data.end_datetime = Date.parseExact(
unavailable.end_datetime, 'yyyy-MM-dd HH:mm:ss')
.add({minutes: -delta.minutes()})
.toString('yyyy-MM-dd HH:mm:ss');
@ -1069,7 +1069,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
firstDay: 0,
snapDuration: '00:30:00',
timeFormat: 'h:mm A',
slotLabelFormat : 'h(:mm) A',
slotLabelFormat: 'h(:mm) A',
allDayText: EALang.all_day,
columnFormat: columnFormat,
titleFormat: 'MMMM YYYY',
@ -1082,7 +1082,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
// Selectable
selectable: true,
selectHelper: true,
select: function(start, end, jsEvent, view) {
select: function (start, end, jsEvent, view) {
if (!start.hasTime() || !end.hasTime()) {
return;
}

View file

@ -12,18 +12,18 @@
/**
* Backend Calendar Google Sync
*
* This module implements the Google Calendar sync operations.
* This module implements the Google Calendar sync operations.
*
* @module BackendCalendarGoogleSync
*/
window.BackendCalendarGoogleSync = window.BackendCalendarGoogleSync || {};
(function(exports) {
(function (exports) {
'use strict';
/**
* Bind event handlers.
* Bind event handlers.
*/
function _bindEventHandlers() {
/**
@ -32,57 +32,57 @@ window.BackendCalendarGoogleSync = window.BackendCalendarGoogleSync || {};
* When the user clicks on the "Enable Sync" button, a popup should appear
* that is going to follow the web server authorization flow of OAuth.
*/
$('#enable-sync').click(function() {
$('#enable-sync').click(function () {
if ($('#enable-sync').hasClass('enabled') === false) {
// Enable synchronization for selected provider.
var authUrl = GlobalVariables.baseUrl + '/index.php/google/oauth/'
+ $('#select-filter-item').val();
+ $('#select-filter-item').val();
var redirectUrl = GlobalVariables.baseUrl + '/index.php/google/oauth_callback';
var windowHandle = window.open(authUrl, 'Authorize Easy!Appointments',
'width=800, height=600');
'width=800, height=600');
var authInterval = window.setInterval(function() {
var authInterval = window.setInterval(function () {
// When the browser redirects to the google user consent page the "window.document" variable
// becomes "undefined" and when it comes back to the redirect URL it changes back. So check
// whether the variable is undefined to avoid javascript errors.
try {
if (windowHandle.document !== undefined) {
if (windowHandle.document.URL.indexOf(redirectUrl) !== -1) {
// The user has granted access to his data.
windowHandle.close();
window.clearInterval(authInterval);
$('#enable-sync').addClass('btn-danger enabled');
$('#enable-sync span:eq(1)').text(EALang.disable_sync);
$('#google-sync').prop('disabled', false);
$('#select-filter-item option:selected').attr('google-sync', 'true');
if (windowHandle.document.URL.indexOf(redirectUrl) !== -1) {
// The user has granted access to his data.
windowHandle.close();
window.clearInterval(authInterval);
$('#enable-sync').addClass('btn-danger enabled');
$('#enable-sync span:eq(1)').text(EALang.disable_sync);
$('#google-sync').prop('disabled', false);
$('#select-filter-item option:selected').attr('google-sync', 'true');
// Display the calendar selection dialog. First we will get a list of the available
// user's calendars and then we will display a selection modal so the user can select
// the sync calendar.
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_get_google_calendars';
var postData = {
csrfToken: GlobalVariables.csrfToken,
provider_id: $('#select-filter-item').val()
};
// Display the calendar selection dialog. First we will get a list of the available
// user's calendars and then we will display a selection modal so the user can select
// the sync calendar.
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_get_google_calendars';
var postData = {
csrfToken: GlobalVariables.csrfToken,
provider_id: $('#select-filter-item').val()
};
$.post(postUrl, postData, function(response) {
if (!GeneralFunctions.handleAjaxExceptions(response)) {
return;
}
$.post(postUrl, postData, function (response) {
if (!GeneralFunctions.handleAjaxExceptions(response)) {
return;
}
$('#google-calendar').empty();
$.each(response, function() {
var option = '<option value="' + this.id + '">' + this.summary + '</option>';
$('#google-calendar').append(option);
});
$('#google-calendar').empty();
$.each(response, function () {
var option = '<option value="' + this.id + '">' + this.summary + '</option>';
$('#google-calendar').append(option);
});
$('#select-google-calendar').modal('show');
}, 'json').fail(GeneralFunctions.ajaxFailureHandler);
$('#select-google-calendar').modal('show');
}, 'json').fail(GeneralFunctions.ajaxFailureHandler);
}
}
}
} catch(Error) {
} catch (Error) {
// Accessing the document object before the window is loaded throws an error, but
// it will only happen during the initialization of the window. Attaching "load"
// event handling is not possible due to CORS restrictions.
@ -93,7 +93,7 @@ window.BackendCalendarGoogleSync = window.BackendCalendarGoogleSync || {};
// Disable synchronization for selected provider.
// Update page elements and make an AJAX call to remove the google sync setting of the
// selected provider.
$.each(GlobalVariables.availableProviders, function(index, provider) {
$.each(GlobalVariables.availableProviders, function (index, provider) {
if (provider.id == $('#select-filter-item').val()) {
provider.settings.google_sync = '0';
provider.settings.google_token = null;
@ -114,14 +114,14 @@ window.BackendCalendarGoogleSync = window.BackendCalendarGoogleSync || {};
/**
* Event: Select Google Calendar "Click"
*/
$('#select-calendar').click(function() {
$('#select-calendar').click(function () {
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_select_google_calendar';
var postData = {
csrfToken: GlobalVariables.csrfToken,
provider_id: $('#select-filter-item').val(),
calendar_id: $('#google-calendar').val()
};
$.post(postUrl, postData, function(response) {
$.post(postUrl, postData, function (response) {
if (!GeneralFunctions.handleAjaxExceptions(response)) {
return;
}
@ -133,7 +133,7 @@ window.BackendCalendarGoogleSync = window.BackendCalendarGoogleSync || {};
/**
* Event: Close Google Calendar "Click"
*/
$('#close-calendar').click(function() {
$('#close-calendar').click(function () {
$('#select-google-calendar').modal('hide');
});
@ -142,7 +142,7 @@ window.BackendCalendarGoogleSync = window.BackendCalendarGoogleSync || {};
*
* Trigger the synchronization algorithm.
*/
$('#google-sync').click(function() {
$('#google-sync').click(function () {
var url = GlobalVariables.baseUrl + '/index.php/google/sync/' + $('#select-filter-item').val();
$.ajax({
@ -150,11 +150,11 @@ window.BackendCalendarGoogleSync = window.BackendCalendarGoogleSync || {};
type: 'GET',
dataType: 'json'
})
.done(function(response) {
.done(function (response) {
if (response.exceptions) {
response.exceptions = GeneralFunctions.parseExceptions(response.exceptions);
GeneralFunctions.displayMessageBox(GeneralFunctions.EXCEPTIONS_TITLE,
GeneralFunctions.EXCEPTIONS_MESSAGE);
GeneralFunctions.EXCEPTIONS_MESSAGE);
$('#message_box').append(GeneralFunctions.exceptionsToHtml(response.exceptions));
return;
}
@ -162,14 +162,14 @@ window.BackendCalendarGoogleSync = window.BackendCalendarGoogleSync || {};
if (response.warnings) {
response.warnings = GeneralFunctions.parseExceptions(response.warnings);
GeneralFunctions.displayMessageBox(GeneralFunctions.WARNINGS_TITLE,
GeneralFunctions.WARNINGS_MESSAGE);
GeneralFunctions.WARNINGS_MESSAGE);
$('#message_box').append(GeneralFunctions.exceptionsToHtml(response.warnings));
}
Backend.displayNotification(EALang.google_sync_completed);
$('#reload-appointments').trigger('click');
})
.fail(function(jqXHR, textStatus, errorThrown) {
.fail(function (jqXHR, textStatus, errorThrown) {
Backend.displayNotification(EALang.google_sync_failed);
});
});
@ -191,7 +191,7 @@ window.BackendCalendarGoogleSync = window.BackendCalendarGoogleSync || {};
provider_id: providerId
};
$.post(postUrl, postData, function(response) {
$.post(postUrl, postData, function (response) {
if (response.exceptions) {
response.exceptions = GeneralFunctions.parseExceptions(response.exceptions);
GeneralFunctions.displayMessageBox(GeneralFunctions.EXCEPTIONS_TITLE, GeneralFunctions.EXCEPTIONS_MESSAGE);
@ -201,8 +201,8 @@ window.BackendCalendarGoogleSync = window.BackendCalendarGoogleSync || {};
}
exports.initialize = function() {
_bindEventHandlers();
exports.initialize = function () {
_bindEventHandlers();
};
})(window.BackendCalendarGoogleSync);

View file

@ -18,85 +18,85 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
*
* @module BackendCalendarTableView
*/
(function(exports) {
(function (exports) {
'use strict';
/**
* Sticky Table Header Fix
*
* Sticky Table Header Fix
*
* @type {Number}
*/
var stickyTableHeaderInterval;
var stickyTableHeaderInterval;
/**
* Bind page event handlers.
* Bind page event handlers.
*/
function _bindEventHandlers() {
var $calendarToolbar = $('#calendar-toolbar');
var $calendar = $('#calendar');
var $calendar = $('#calendar');
$calendar.on('click', '.calendar-header .btn.previous', function() {
var endDate = new Date($('#calendar .date-column:first').data('date')).add({days: -1});
$calendar.on('click', '.calendar-header .btn.previous', function () {
var endDate = new Date($('#calendar .date-column:first').data('date')).add({days: -1});
var startDate = new Date(endDate.getTime()).add({days: -1 * (parseInt($('#select-filter-item').val()) - 1)});
$('.select-date').datepicker('setDate', startDate);
_createView(startDate, endDate);
});
$calendar.on('click', '.calendar-header .btn.next', function() {
var startDate = new Date($('#calendar .date-column:last').data('date')).add({days: 1});
var endDate = new Date(startDate.getTime()).add({days: parseInt($('#select-filter-item').val()) - 1});
$calendar.on('click', '.calendar-header .btn.next', function () {
var startDate = new Date($('#calendar .date-column:last').data('date')).add({days: 1});
var endDate = new Date(startDate.getTime()).add({days: parseInt($('#select-filter-item').val()) - 1});
$('.select-date').datepicker('setDate', startDate);
_createView(startDate, endDate);
});
$calendarToolbar.on('change', '#select-filter-item', function() {
var startDate = new Date($('.calendar-view .date-column:first').data('date'));
var endDate = new Date(startDate.getTime()).add({days: parseInt($(this).val()) - 1});
$calendarToolbar.on('change', '#select-filter-item', function () {
var startDate = new Date($('.calendar-view .date-column:first').data('date'));
var endDate = new Date(startDate.getTime()).add({days: parseInt($(this).val()) - 1});
_createView(startDate, endDate);
// Horizontal scrolling fix for sticky table headers.
stickyTableHeaderInterval = setInterval(function() {
stickyTableHeaderInterval = setInterval(function () {
$(window).trigger('resize.stickyTableHeaders');
}, 1000);
});
$calendarToolbar.on('click', '#reload-appointments', function() {
$calendarToolbar.on('click', '#reload-appointments', function () {
// Remove all the events from the tables.
$('.calendar-view .event').remove();
$('.calendar-view .event').remove();
// Fetch the events and place them in the existing HTML format.
var startDate = new Date($('.calendar-view .date-column:first').data('date'));
var endDate = new Date($('.calendar-view .date-column:last').data('date'));
_getCalendarEvents(startDate, endDate)
.done(function(response) {
.done(function (response) {
if (!GeneralFunctions.handleAjaxExceptions(response)) {
return;
}
var currentDate = startDate;
var currentDate = startDate;
while(currentDate <= endDate) {
$('.calendar-view .date-column').each(function(index, dateColumn) {
var $dateColumn = $(dateColumn);
while (currentDate <= endDate) {
$('.calendar-view .date-column').each(function (index, dateColumn) {
var $dateColumn = $(dateColumn);
var date = new Date($dateColumn.data('date'));
if (currentDate.getTime() !== date.getTime()) {
return true;
}
$(dateColumn).find('.provider-column').each(function(index, providerColumn) {
$(dateColumn).find('.provider-column').each(function (index, providerColumn) {
var $providerColumn = $(providerColumn);
var provider = $providerColumn.data('provider');
// Add the appointments to the column.
_createAppointments($providerColumn, response.appointments);
_createAppointments($providerColumn, response.appointments);
// Add the unavailabilities to the column.
_createUnavailabilities($providerColumn, response.unavailabilities);
_createUnavailabilities($providerColumn, response.unavailabilities);
// Add the provider breaks to the column.
var workingPlan = JSON.parse(provider.settings.working_plan);
var workingPlan = JSON.parse(provider.settings.working_plan);
var day = date.toString('dddd').toLowerCase();
if (workingPlan[day]) {
var breaks = workingPlan[day].breaks;
@ -105,22 +105,22 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
});
});
currentDate.add({days: 1});
currentDate.add({days: 1});
}
_setCalendarSize();
Backend.placeFooterToBottom();
})
.fail(GeneralFunctions.ajaxFailureHandler);
});
$calendar.on('click', '.calendar-view table td', function() {
});
$calendar.on('click', '.calendar-view table td', function () {
if ($(this).index() === 0) {
return; // Clicked on an hour slot.
}
// Open the appointments modal in the selected hour.
var hour = $(this).parent().find('td:first').text().split(':');
var hour = $(this).parent().find('td:first').text().split(':');
var date = new Date($(this).parents('.date-column').data('date'));
date.set({hour: parseInt(hour[0]), minute: parseInt(hour[1])});
@ -128,25 +128,25 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
$('#insert-appointment').trigger('click');
// Update start date field.
$('#start-datetime').datepicker('setDate', date);
$('#start-datetime').datepicker('setDate', date);
// Select Service and provider.
var $providerColumn = $(this).parents('.provider-column');
var serviceId = $providerColumn.find('thead tr:last th').eq($(this).index()).data('id');
var providerId = $providerColumn.data('provider').id;
var providerId = $providerColumn.data('provider').id;
$('#select-service').val(serviceId).trigger('change');
$('#select-provider').val(providerId).trigger('change');
});
});
var lastFocusedEventData;
/**
* Event: On Table Event Click
*
*
* @param {jQuery.Event} event
*/
$calendar.on('click', '.event', function(event) {
event.stopPropagation();
$calendar.on('click', '.event', function (event) {
event.stopPropagation();
if ($(this).hasClass('break')) {
return; // Do nothing with break events.
@ -155,61 +155,61 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
$('.popover').remove(); // Close all open popovers.
var html;
var entry = $(this).data();
var entry = $(this).data();
if ($(this).hasClass('unavailability')) {
if ($(this).hasClass('unavailability')) {
var notes = '<strong>Notes</strong> ' + entry.notes;
html =
'<style type="text/css">'
+ '.popover-content strong {min-width: 80px; display:inline-block;}'
+ '.popover-content button {margin-right: 10px;}'
+ '</style>' +
'<strong>' + EALang.start + '</strong> '
+ GeneralFunctions.formatDate(entry.start_datetime, GlobalVariables.dateFormat, true)
+ '<br>' +
'<strong>' + EALang.end + '</strong> '
+ GeneralFunctions.formatDate(entry.end_datetime, GlobalVariables.dateFormat, true)
+ '<br>'
+ notes
+ '<hr>' +
'<center>' +
'<button class="edit-popover btn btn-primary">' + EALang.edit + '</button>' +
'<button class="delete-popover btn btn-danger">' + EALang.delete + '</button>' +
'<button class="close-popover btn btn-default" data-po=' + event.target + '>' + EALang.close + '</button>' +
'</center>';
'<style type="text/css">'
+ '.popover-content strong {min-width: 80px; display:inline-block;}'
+ '.popover-content button {margin-right: 10px;}'
+ '</style>' +
'<strong>' + EALang.start + '</strong> '
+ GeneralFunctions.formatDate(entry.start_datetime, GlobalVariables.dateFormat, true)
+ '<br>' +
'<strong>' + EALang.end + '</strong> '
+ GeneralFunctions.formatDate(entry.end_datetime, GlobalVariables.dateFormat, true)
+ '<br>'
+ notes
+ '<hr>' +
'<center>' +
'<button class="edit-popover btn btn-primary">' + EALang.edit + '</button>' +
'<button class="delete-popover btn btn-danger">' + EALang.delete + '</button>' +
'<button class="close-popover btn btn-default" data-po=' + event.target + '>' + EALang.close + '</button>' +
'</center>';
} else {
html =
'<style type="text/css">'
+ '.popover-content strong {min-width: 80px; display:inline-block;}'
+ '.popover-content button {margin-right: 10px;}'
+ '</style>' +
'<strong>' + EALang.start + '</strong> '
+ GeneralFunctions.formatDate(entry.start_datetime, GlobalVariables.dateFormat, true)
+ '<br>' +
'<strong>' + EALang.end + '</strong> '
+ GeneralFunctions.formatDate(entry.end_datetime, GlobalVariables.dateFormat, true)
+ '<br>' +
'<strong>' + EALang.service + '</strong> '
+ entry.service.name
+ '<br>' +
'<strong>' + EALang.provider + '</strong> '
+ entry.provider.first_name + ' '
+ entry.provider.last_name
+ '<br>' +
'<strong>' + EALang.customer + '</strong> '
+ entry.customer.first_name + ' '
+ entry.customer.last_name
+ '<hr>' +
'<center>' +
'<button class="edit-popover btn btn-primary">' + EALang.edit + '</button>' +
'<button class="delete-popover btn btn-danger">' + EALang.delete + '</button>' +
'<button class="close-popover btn btn-default" data-po=' + event.target + '>' + EALang.close + '</button>' +
'</center>';
'<style type="text/css">'
+ '.popover-content strong {min-width: 80px; display:inline-block;}'
+ '.popover-content button {margin-right: 10px;}'
+ '</style>' +
'<strong>' + EALang.start + '</strong> '
+ GeneralFunctions.formatDate(entry.start_datetime, GlobalVariables.dateFormat, true)
+ '<br>' +
'<strong>' + EALang.end + '</strong> '
+ GeneralFunctions.formatDate(entry.end_datetime, GlobalVariables.dateFormat, true)
+ '<br>' +
'<strong>' + EALang.service + '</strong> '
+ entry.service.name
+ '<br>' +
'<strong>' + EALang.provider + '</strong> '
+ entry.provider.first_name + ' '
+ entry.provider.last_name
+ '<br>' +
'<strong>' + EALang.customer + '</strong> '
+ entry.customer.first_name + ' '
+ entry.customer.last_name
+ '<hr>' +
'<center>' +
'<button class="edit-popover btn btn-primary">' + EALang.edit + '</button>' +
'<button class="delete-popover btn btn-danger">' + EALang.delete + '</button>' +
'<button class="close-popover btn btn-default" data-po=' + event.target + '>' + EALang.close + '</button>' +
'</center>';
}
var title = entry.is_unavailable !== '0' ? EALang.unavailable : entry.service.name + ' - '
+ entry.customer.first_name + ' ' + entry.customer.last_name;
+ entry.customer.first_name + ' ' + entry.customer.last_name;
$(event.target).popover({
placement: 'top',
@ -225,7 +225,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
// Fix popover position
if ($('.popover').length > 0 && $('.popover').position().top < 200) {
$('.popover').css('top', '200px');
$('.popover').css('top', '200px');
}
});
@ -239,7 +239,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
*
* Hides the open popover element.
*/
$calendar.on('click', '.close-popover', function() {
$calendar.on('click', '.close-popover', function () {
$(this).parents().eq(2).popover('destroy');
});
@ -248,7 +248,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
*
* Enables the edit dialog of the selected table event.
*/
$calendar.on('click', '.edit-popover', function() {
$calendar.on('click', '.edit-popover', function () {
$(this).parents().eq(2).popover('destroy'); // Hide the popover
var $dialog;
@ -267,11 +267,11 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
// Set the start and end datetime of the appointment.
var startDatetime = Date.parseExact(appointment.start_datetime,
'yyyy-MM-dd HH:mm:ss');
'yyyy-MM-dd HH:mm:ss');
$dialog.find('#start-datetime').datetimepicker('setDate', startDatetime);
var endDatetime = Date.parseExact(appointment.end_datetime,
'yyyy-MM-dd HH:mm:ss');
'yyyy-MM-dd HH:mm:ss');
$dialog.find('#end-datetime').datetimepicker('setDate', endDatetime);
var customer = appointment.customer;
@ -314,22 +314,22 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
* Displays a prompt on whether the user wants the appointment to be deleted. If he confirms the
* deletion then an ajax call is made to the server and deletes the appointment from the database.
*/
$calendar.on('click', '.delete-popover', function() {
$calendar.on('click', '.delete-popover', function () {
$(this).parents().eq(2).popover('destroy'); // Hide the popover
if (lastFocusedEventData.is_unavailable == false) {
var buttons = [
{
text: 'OK',
click: function() {
click: function () {
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_appointment';
var postData = {
csrfToken: GlobalVariables.csrfToken,
appointment_id : lastFocusedEventData.id,
appointment_id: lastFocusedEventData.id,
delete_reason: $('#delete-reason').val()
};
$.post(postUrl, postData, function(response) {
$.post(postUrl, postData, function (response) {
$('#message_box').dialog('close');
if (response.exceptions) {
@ -355,14 +355,14 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
{
text: EALang.cancel,
click: function() {
click: function () {
$('#message_box').dialog('close');
}
}
];
GeneralFunctions.displayMessageBox(EALang.delete_appointment_title,
EALang.write_appointment_removal_reason, buttons);
EALang.write_appointment_removal_reason, buttons);
var $formGroup = $('<div/>', {
'class': 'form-group'
@ -379,10 +379,10 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
var url = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_unavailable';
var data = {
csrfToken: GlobalVariables.csrfToken,
unavailable_id : lastFocusedEventData.id
unavailable_id: lastFocusedEventData.id
};
$.post(url, data, function(response) {
$.post(url, data, function (response) {
$('#message_box').dialog('close');
if (response.exceptions) {
@ -406,35 +406,35 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
}
/**
* Create table view header container.
* Create table view header container.
*
* The header contains the date navigation elements (buttons and datepicker).
*/
function _createHeader() {
var $calendarFilter = $('#calendar-filter');
var $calendarFilter = $('#calendar-filter');
$calendarFilter
.find('select')
.empty()
.append(new Option('1 ' + EALang.day , 1))
.append(new Option('1 ' + EALang.day, 1))
.append(new Option('3 ' + EALang.days, 3));
var $calendarHeader = $('<div class="calendar-header" />').appendTo('#calendar');
var $calendarHeader = $('<div class="calendar-header" />').appendTo('#calendar');
$calendarHeader
.html(
'<button class="btn btn-xs btn-default previous">' +
'<span class="glyphicon glyphicon-chevron-left"></span>' +
'<span class="glyphicon glyphicon-chevron-left"></span>' +
'</button>' +
'<input type="text" class="select-date" value="' + GeneralFunctions.formatDate(new Date(), GlobalVariables.dateFormat) + '" />' +
'<button class="btn btn-xs btn-default next">' +
'<span class="glyphicon glyphicon-chevron-right"></span>' +
'<span class="glyphicon glyphicon-chevron-right"></span>' +
'</button>'
);
var dateFormat;
var dateFormat;
switch(GlobalVariables.dateFormat) {
switch (GlobalVariables.dateFormat) {
case 'DMY':
dateFormat = 'dd/mm/yy';
break;
@ -449,28 +449,28 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
default:
throw new Error('Invalid date format setting provided!', GlobalVariables.dateFormat);
}
}
$calendarHeader.find('.select-date').datepicker({
defaultDate: new Date(),
dateFormat: dateFormat,
onSelect: function(dateText, instance) {
onSelect: function (dateText, instance) {
var startDate = new Date(instance.currentYear, instance.currentMonth, instance.currentDay);
var endDate = new Date(startDate.getTime()).add({days: parseInt($('#select-filter-item').val()) - 1});
var endDate = new Date(startDate.getTime()).add({days: parseInt($('#select-filter-item').val()) - 1});
_createView(startDate, endDate);
}
}
});
}
/**
* Create table schedule view.
* Create table schedule view.
*
* This method will destroy any previous instances and create a new view for displaying the appointments in
* a table format.
*
* This method will destroy any previous instances and create a new view for displaying the appointments in
* a table format.
*
* @param {Date} startDate Start date to be displayed.
* @param {Date} endDate End date to be displayed.
* @param {Date} endDate End date to be displayed.
*/
function _createView(startDate, endDate) {
// Disable date navigation.
@ -480,7 +480,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
$('#calendar .calendar-view').remove();
var displayDate = startDate.getTime() !== endDate.getTime();
var $calendarView = $('<div class="calendar-view" />').appendTo('#calendar');
var $calendarView = $('<div class="calendar-view" />').appendTo('#calendar');
$calendarView.data({
startDate: startDate.toString('yyyy-MM-dd'),
@ -490,16 +490,16 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
var $wrapper = $('<div />').appendTo($calendarView);
_getCalendarEvents(startDate, endDate)
.done(function(response) {
.done(function (response) {
if (!GeneralFunctions.handleAjaxExceptions(response)) {
return;
}
var currentDate = startDate;
var currentDate = startDate;
while(currentDate <= endDate) {
_createDateColumn($wrapper, currentDate, response, displayDate);
currentDate.add({days: 1});
while (currentDate <= endDate) {
_createDateColumn($wrapper, currentDate, response, displayDate);
currentDate.add({days: 1});
}
_setCalendarSize();
@ -512,17 +512,17 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
}
/**
* Create Date Column Container
* Create Date Column Container
*
* This element will contain the provider columns.
*
* @param {jQuery} $wrapper The wrapper div element of the table view.
* This element will contain the provider columns.
*
* @param {jQuery} $wrapper The wrapper div element of the table view.
* @param {Date} date Selected date for the column.
* @param {Object[]} events Events to be displayed on this date.
* @param {Boolean} displayDate Whether to display the date in the column container.
* @param {Object[]} events Events to be displayed on this date.
* @param {Boolean} displayDate Whether to display the date in the column container.
*/
function _createDateColumn($wrapper, date, events, displayDate) {
var $dateColumn = $('<div class="date-column" />').appendTo($wrapper);
var $dateColumn = $('<div class="date-column" />').appendTo($wrapper);
$dateColumn.data('date', date.getTime());
@ -535,7 +535,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
if (GlobalVariables.user.role_slug === 'provider') {
GlobalVariables.availableProviders.forEach(function (provider) {
if (provider.id == GlobalVariables.user.id) {
providers = [provider];
providers = [provider];
}
});
}
@ -550,39 +550,39 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
}
for (var index in providers) {
var provider = GlobalVariables.availableProviders[index];
var provider = GlobalVariables.availableProviders[index];
_createProviderColumn($dateColumn, date, provider, events);
}
}
/**
* Create Provider Column Container
*
* Create Provider Column Container
*
* @param {jQuery} $dateColumn Element to container the provider's column.
* @param {Date} date Selected date for the column.
* @param {Object} provider Contains the provider data.
* {Object[]} events Events to be displayed on this date.
* @param {Object} provider Contains the provider data.
* {Object[]} events Events to be displayed on this date.
*/
function _createProviderColumn($dateColumn, date, provider, events) {
if (provider.services.length === 0) {
return;
}
var $providerColumn = $('<div class="provider-column" />').appendTo($dateColumn);
var $providerColumn = $('<div class="provider-column" />').appendTo($dateColumn);
$providerColumn.data('provider', provider);
$providerColumn.data('provider', provider);
// Create the table slots.
_createSlots($providerColumn, date, provider);
_createSlots($providerColumn, date, provider);
// Add the appointments to the column.
_createAppointments($providerColumn, events.appointments);
_createAppointments($providerColumn, events.appointments);
// Add the unavailabilities to the column.
_createUnavailabilities($providerColumn, events.unavailabilities);
_createUnavailabilities($providerColumn, events.unavailabilities);
// Add the provider breaks to the column.
var workingPlan = JSON.parse(provider.settings.working_plan);
var workingPlan = JSON.parse(provider.settings.working_plan);
var day = date.toString('dddd').toLowerCase();
if (workingPlan[day]) {
var breaks = workingPlan[day].breaks;
@ -591,22 +591,22 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
}
/**
* Create Table View Slots
* Create Table View Slots
*
* The time slots will be added to a specific provider's column.
*
* The time slots will be added to a specific provider's column.
*
* @param {jQuery} $providerColumn The selected provider column.
* @param {Date} date Selected date for the slot.
* @param {Object} provider Contains the provider data.
*/
function _createSlots($providerColumn, date, provider) {
var day = date.toString('dddd').toLowerCase();
var plan = JSON.parse(provider.settings.working_plan)[day];
var day = date.toString('dddd').toLowerCase();
var plan = JSON.parse(provider.settings.working_plan)[day];
if (!plan) {
$providerColumn.append('<div class="not-working">'
+ (provider.first_name + ' ' + provider.last_name).trim() +' <br> ' + EALang.not_working
+ '</div>');
$providerColumn.append('<div class="not-working">'
+ (provider.first_name + ' ' + provider.last_name).trim() + ' <br> ' + EALang.not_working
+ '</div>');
return;
}
@ -615,90 +615,90 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
.addClass('table table-condensed table-responsive table-hover table-striped')
.html(
'<thead>' +
'<tr>' +
'<th colspan="' + (provider.services.length + 1) + '">' +
(provider.first_name + ' ' + provider.last_name).trim() +
'</th>' +
'</tr>' +
'<tr>' +
'<th>' + EALang.time + '</th>' +
'</tr>' +
'<tr>' +
'<th colspan="' + (provider.services.length + 1) + '">' +
(provider.first_name + ' ' + provider.last_name).trim() +
'</th>' +
'</tr>' +
'<tr>' +
'<th>' + EALang.time + '</th>' +
'</tr>' +
'</thead>' +
'<tbody></tbody>'
);
for (var index in GlobalVariables.availableServices) {
var service = GlobalVariables.availableServices[index];
var service = GlobalVariables.availableServices[index];
if (provider.services.indexOf(service.id) > -1) {
$table.find('thead tr:last').append('<th data-id="' + service.id + '">' + service.name + '</th>');
$table.find('thead tr:last').append('<th data-id="' + service.id + '">' + service.name + '</th>');
}
}
var start = parseInt(plan.start.split(':')[0]);
var start = parseInt(plan.start.split(':')[0]);
var end = parseInt(plan.end.split(':')[0]) + 1;
var current = start;
var $tbody = $table.find('tbody');
var $tbody = $table.find('tbody');
while(current <= end) {
var $tr = $('<tr/>').appendTo($tbody);
while (current <= end) {
var $tr = $('<tr/>').appendTo($tbody);
var time = (current < 10 ? '0' + parseInt(current) : parseInt(current)) + (current % 1 === 0 ? ':00' : ':30');
var time = (current < 10 ? '0' + parseInt(current) : parseInt(current)) + (current % 1 === 0 ? ':00' : ':30');
$tr
.append('<td>' + time + '</td>')
.append('<td/>'.repeat(provider.services.length));
.append('<td/>'.repeat(provider.services.length));
current += 0.5;
current += 0.5;
}
$table.stickyTableHeaders();
}
/**
* Create Appointment Events
* Create Appointment Events
*
* This method will add the appointment events on the table view.
*
* This method will add the appointment events on the table view.
*
* @param {jQuery} $providerColumn The provider column container.
* @param {Object[]} appointments Contains the appointment events data.
* @param {Object[]} appointments Contains the appointment events data.
*/
function _createAppointments($providerColumn, appointments) {
if (appointments.length === 0) {
return;
}
var currentDate = new Date($providerColumn.parents('.date-column').data('date'));
var currentDate = new Date($providerColumn.parents('.date-column').data('date'));
var $tbody = $providerColumn.find('table tbody');
for (var index in appointments) {
var appointment = appointments[index];
var appointment = appointments[index];
if (appointment.id_users_provider !== $providerColumn.data('provider').id) {
continue;
}
var eventDate = Date.parse(appointment.start_datetime);
var $event = $('<div class="event appointment" />');
var eventDate = Date.parse(appointment.start_datetime);
var $event = $('<div class="event appointment" />');
var startDate = Date.parse(appointment.start_datetime);
var endDate = Date.parse(appointment.end_datetime);
var eventDuration = Math.round((endDate - startDate) / 60000);
$event.html(
$event.html(
appointment.customer.first_name.charAt(0) + '. ' + appointment.customer.last_name +
' <span class="hour">' + startDate.toString('h:mm tt') + '</span> '
+ (eventDuration !== parseInt(appointment.service.duration) ? '(' + eventDuration + '\')' : '')
+ (eventDuration !== parseInt(appointment.service.duration) ? '(' + eventDuration + '\')' : '')
);
$event.data(appointment);
$tbody.find('tr').each(function(index, tr) {
var $td = $(tr).find('td:first');
$tbody.find('tr').each(function (index, tr) {
var $td = $(tr).find('td:first');
var cellDate = new Date(currentDate.getTime()).set({
hour: parseInt($td.text().split(':')[0]),
minute: parseInt($td.text().split(':')[1])
});
});
if (eventDate < cellDate) {
var cellIndex = $providerColumn
@ -714,50 +714,50 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
return false;
}
});
});
}
}
/**
* Create Unavailabilities Events
* Create Unavailabilities Events
*
* This method will add the unavailability events on the table view.
*
* This method will add the unavailability events on the table view.
*
* @param {jQuery} $providerColumn The provider column container.
* @param {Object[]} unavailabilities Contains the unavailability events data.
* @param {Object[]} unavailabilities Contains the unavailability events data.
*/
function _createUnavailabilities($providerColumn, unavailabilities) {
if (unavailabilities.length === 0) {
return;
}
var currentDate = new Date($providerColumn.parents('.date-column').data('date'));
var currentDate = new Date($providerColumn.parents('.date-column').data('date'));
var $tbody = $providerColumn.find('table tbody');
for (var index in unavailabilities) {
var unavailability = unavailabilities[index];
var unavailability = unavailabilities[index];
if (unavailability.id_users_provider !== $providerColumn.data('provider').id) {
continue;
}
var eventDate = Date.parse(unavailability.start_datetime);
var eventDate = Date.parse(unavailability.start_datetime);
var endDate = Date.parse(unavailability.end_datetime);
var eventDuration = Math.round((endDate - eventDate) / 60000);
var $event = $('<div class="event unavailability" />');
var $event = $('<div class="event unavailability" />');
$event.html((unavailability.notes || EALang.unavailable) +
' <span class="hour">' + eventDate.toString('h:mm tt') + '</span> (' + eventDuration + '\')');
$event.data(unavailability);
$tbody.find('tr').each(function(index, tr) {
var $td = $(tr).find('td:first');
$tbody.find('tr').each(function (index, tr) {
var $td = $(tr).find('td:first');
var cellDate = new Date(currentDate.getTime()).set({
hour: parseInt($td.text().split(':')[0]),
minute: parseInt($td.text().split(':')[1])
});
});
if (eventDate < cellDate) {
$event.appendTo($(tr).prev().find('td').eq(1));
@ -769,13 +769,13 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
return false;
}
});
});
}
}
/**
* Create break events in the table view.
*
* Create break events in the table view.
*
* @param {jQuery} $providerColumn The provider column container.
* @param {Object[]} breaks Contains the break events data.
*/
@ -784,17 +784,17 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
return;
}
var currentDate = new Date($providerColumn.parents('.date-column').data('date'));
var currentDate = new Date($providerColumn.parents('.date-column').data('date'));
var $tbody = $providerColumn.find('table tbody');
for (var index in breaks) {
var entry = breaks[index];
var startHour = entry.start.split(':');
var eventDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate(), startHour[0], startHour[1]);
var eventDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate(), startHour[0], startHour[1]);
var endHour = entry.end.split(':');
var endDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate(), endHour[0], endHour[1]);
var endDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate(), endHour[0], endHour[1]);
var eventDuration = Math.round((endDate - eventDate) / 60000);
var $event = $('<div class="event unavailability break" />');
var $event = $('<div class="event unavailability break" />');
$event.html(
EALang.break +
@ -802,13 +802,13 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
$event.data(entry);
$tbody.find('tr').each(function(index, tr) {
var $td = $(tr).find('td:first');
$tbody.find('tr').each(function (index, tr) {
var $td = $(tr).find('td:first');
var cellDate = new Date(currentDate.getTime()).set({
hour: parseInt($td.text().split(':')[0]),
minute: parseInt($td.text().split(':')[1])
});
});
if (eventDate < cellDate) {
// Remove the hour from the event if it is the same as the row.
@ -816,24 +816,24 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
$event.find('.hour').remove();
}
$(tr).prev().find('td:gt(0)').each(function(index, td) {
$(tr).prev().find('td:gt(0)').each(function (index, td) {
$event.clone().appendTo($(td));
});
return false;
}
});
});
}
}
/**
* Set Table Calendar View
* Set Table Calendar View
*
* This method will set the optimal size in the calendar view elements in order to fit in the page without
* using scrollbars.
*/
function _setCalendarSize() {
var height = window.innerHeight - $('#header').outerHeight() - $('#footer').outerHeight()
- $('#calendar-toolbar').outerHeight() - $('.calendar-header').outerHeight() - 50;
var height = window.innerHeight - $('#header').outerHeight() - $('#footer').outerHeight()
- $('#calendar-toolbar').outerHeight() - $('.calendar-header').outerHeight() - 50;
if (height < 500) {
height = 500;
@ -843,29 +843,29 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
$('.calendar-view > div').css('min-width', '1000%');
var width = 0;
var width = 0;
$('.date-column').each(function(index, dateColumn) {
$('.date-column').each(function (index, dateColumn) {
width += $(dateColumn).outerWidth();
});
$('.calendar-view > div').css('min-width', width + 200);
var dateColumnHeight = $('.date-column').outerHeight();
$('.calendar-view .not-working').outerHeight((dateColumnHeight > height ? dateColumnHeight : height ) - 70);
$('.calendar-view .not-working').outerHeight((dateColumnHeight > height ? dateColumnHeight : height) - 70);
}
/**
* Get the calendar events.
*
* Get the calendar events.
*
* @param {Date} startDate The start date of the selected period.
* @param {Date} endDate The end date of the selected period.
*
*
* @return {jQuery.jqXHR}
*/
function _getCalendarEvents(startDate, endDate) {
var url = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_get_calendar_events';
var url = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_get_calendar_events';
var data = {
csrfToken: GlobalVariables.csrfToken,
startDate: startDate.toString('yyyy-MM-dd'),
@ -873,33 +873,33 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
};
return $.ajax({
url: url,
data: data,
url: url,
data: data,
method: 'POST',
beforeSend: function() {
beforeSend: function () {
$('#loading').css('visibility', 'hidden');
},
complete: function() {
$('#loading').css('visibility', '');
},
complete: function () {
$('#loading').css('visibility', '');
}
});
});
}
/**
* Initialize Page
* Initialize Page
*/
exports.initialize = function() {
_createHeader();
exports.initialize = function () {
_createHeader();
_createView(Date.today(), Date.today().add({days: parseInt($('#select-filter-item').val() - 1)}));
_bindEventHandlers();
// Hide Google Calendar Sync buttons cause they can not be used within this view.
$('#enable-sync, #google-sync').hide();
// Auto-reload the results every one minute.
setInterval(function() {
setInterval(function () {
$('#reload-appointments').trigger('click');
}, 20000);
}, 20000);
};
})(window.BackendCalendarTableView);

View file

@ -18,7 +18,7 @@
*/
window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabilitiesModal || {};
(function(exports) {
(function (exports) {
'use strict';
@ -28,7 +28,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
*
* Stores the unavailable period changes or inserts a new record.
*/
$('#manage-unavailable #save-unavailable').click(function() {
$('#manage-unavailable #save-unavailable').click(function () {
var $dialog = $('#manage-unavailable');
$dialog.find('.has-error').removeClass('has-error');
var start = $dialog.find('#unavailable-start').datetimepicker('getDate');
@ -58,11 +58,11 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
unavailable.id = $dialog.find('#unavailable-id').val();
}
var successCallback = function(response) {
var successCallback = function (response) {
if (response.exceptions) {
response.exceptions = GeneralFunctions.parseExceptions(response.exceptions);
GeneralFunctions.displayMessageBox(GeneralFunctions.EXCEPTIONS_TITLE,
GeneralFunctions.EXCEPTIONS_MESSAGE);
GeneralFunctions.EXCEPTIONS_MESSAGE);
$('#message_box').append(GeneralFunctions.exceptionsToHtml(response.exceptions));
$dialog.find('.modal-message')
@ -76,7 +76,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
if (response.warnings) {
response.warnings = GeneralFunctions.parseExceptions(response.warnings);
GeneralFunctions.displayMessageBox(GeneralFunctions.WARNINGS_TITLE,
GeneralFunctions.WARNINGS_MESSAGE);
GeneralFunctions.WARNINGS_MESSAGE);
$('#message_box').append(GeneralFunctions.exceptionsToHtml(response.warnings));
}
@ -87,16 +87,16 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
.removeClass('alert-danger hidden');
// Close the modal dialog and refresh the calendar appointments after one second.
setTimeout(function() {
setTimeout(function () {
$dialog.find('.alert').addClass('hidden');
$dialog.modal('hide');
$('#select-filter-item').trigger('change');
}, 2000);
};
var errorCallback = function(jqXHR, textStatus, errorThrown) {
var errorCallback = function (jqXHR, textStatus, errorThrown) {
GeneralFunctions.displayMessageBox('Communication Error', 'Unfortunately ' +
'the operation could not complete due to server communication errors.');
'the operation could not complete due to server communication errors.');
$dialog.find('.modal-message').txt(EALang.service_communication_error);
$dialog.find('.modal-message').addClass('alert-danger').removeClass('hidden');
@ -110,7 +110,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
*
* Closes the dialog without saveing any changes to the database.
*/
$('#manage-unavailable #cancel-unavailable').click(function() {
$('#manage-unavailable #cancel-unavailable').click(function () {
$('#manage-unavailable').modal('hide');
});
@ -120,7 +120,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
* When the user clicks this button a popup dialog appears and the use can set a time period where
* he cannot accept any appointments.
*/
$('#insert-unavailable').click(function() {
$('#insert-unavailable').click(function () {
BackendCalendarUnavailabilitiesModal.resetUnavailableDialog();
var $dialog = $('#manage-unavailable');
@ -129,13 +129,13 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
var currentMin = parseInt(start.toString('mm'));
if (currentMin > 0 && currentMin < 15) {
start.set({ 'minute': 15 });
start.set({'minute': 15});
} else if (currentMin > 15 && currentMin < 30) {
start.set({ 'minute': 30 });
start.set({'minute': 30});
} else if (currentMin > 30 && currentMin < 45) {
start.set({ 'minute': 45 });
start.set({'minute': 45});
} else {
start.addHours(1).set({ 'minute': 0 });
start.addHours(1).set({'minute': 0});
}
if ($('.calendar-view').length === 0) {
@ -158,7 +158,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
* Reset the "#manage-unavailable" dialog. Use this method to bring the dialog to the initial state
* before it becomes visible to the user.
*/
exports.resetUnavailableDialog = function() {
exports.resetUnavailableDialog = function () {
var $dialog = $('#manage-unavailable');
$dialog.find('#unavailable-id').val('');
@ -168,7 +168,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
var end = GeneralFunctions.formatDate(new Date().addHours(1), GlobalVariables.dateFormat, true);
var dateFormat;
switch(GlobalVariables.dateFormat) {
switch (GlobalVariables.dateFormat) {
case 'DMY':
dateFormat = 'dd/mm/yy';
break;
@ -187,18 +187,18 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
// Translation
dayNames: [EALang.sunday, EALang.monday, EALang.tuesday, EALang.wednesday,
EALang.thursday, EALang.friday, EALang.saturday],
dayNamesShort: [EALang.sunday.substr(0,3), EALang.monday.substr(0,3),
EALang.tuesday.substr(0,3), EALang.wednesday.substr(0,3),
EALang.thursday.substr(0,3), EALang.friday.substr(0,3),
EALang.saturday.substr(0,3)],
dayNamesMin: [EALang.sunday.substr(0,2), EALang.monday.substr(0,2),
EALang.tuesday.substr(0,2), EALang.wednesday.substr(0,2),
EALang.thursday.substr(0,2), EALang.friday.substr(0,2),
EALang.saturday.substr(0,2)],
EALang.thursday, EALang.friday, EALang.saturday],
dayNamesShort: [EALang.sunday.substr(0, 3), EALang.monday.substr(0, 3),
EALang.tuesday.substr(0, 3), EALang.wednesday.substr(0, 3),
EALang.thursday.substr(0, 3), EALang.friday.substr(0, 3),
EALang.saturday.substr(0, 3)],
dayNamesMin: [EALang.sunday.substr(0, 2), EALang.monday.substr(0, 2),
EALang.tuesday.substr(0, 2), EALang.wednesday.substr(0, 2),
EALang.thursday.substr(0, 2), EALang.friday.substr(0, 2),
EALang.saturday.substr(0, 2)],
monthNames: [EALang.january, EALang.february, EALang.march, EALang.april,
EALang.may, EALang.june, EALang.july, EALang.august, EALang.september,
EALang.october, EALang.november, EALang.december],
EALang.may, EALang.june, EALang.july, EALang.august, EALang.september,
EALang.october, EALang.november, EALang.december],
prevText: EALang.previous,
nextText: EALang.next,
currentText: EALang.now,
@ -217,18 +217,18 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
// Translation
dayNames: [EALang.sunday, EALang.monday, EALang.tuesday, EALang.wednesday,
EALang.thursday, EALang.friday, EALang.saturday],
dayNamesShort: [EALang.sunday.substr(0,3), EALang.monday.substr(0,3),
EALang.tuesday.substr(0,3), EALang.wednesday.substr(0,3),
EALang.thursday.substr(0,3), EALang.friday.substr(0,3),
EALang.saturday.substr(0,3)],
dayNamesMin: [EALang.sunday.substr(0,2), EALang.monday.substr(0,2),
EALang.tuesday.substr(0,2), EALang.wednesday.substr(0,2),
EALang.thursday.substr(0,2), EALang.friday.substr(0,2),
EALang.saturday.substr(0,2)],
EALang.thursday, EALang.friday, EALang.saturday],
dayNamesShort: [EALang.sunday.substr(0, 3), EALang.monday.substr(0, 3),
EALang.tuesday.substr(0, 3), EALang.wednesday.substr(0, 3),
EALang.thursday.substr(0, 3), EALang.friday.substr(0, 3),
EALang.saturday.substr(0, 3)],
dayNamesMin: [EALang.sunday.substr(0, 2), EALang.monday.substr(0, 2),
EALang.tuesday.substr(0, 2), EALang.wednesday.substr(0, 2),
EALang.thursday.substr(0, 2), EALang.friday.substr(0, 2),
EALang.saturday.substr(0, 2)],
monthNames: [EALang.january, EALang.february, EALang.march, EALang.april,
EALang.may, EALang.june, EALang.july, EALang.august, EALang.september,
EALang.october, EALang.november, EALang.december],
EALang.may, EALang.june, EALang.july, EALang.august, EALang.september,
EALang.october, EALang.november, EALang.december],
prevText: EALang.previous,
nextText: EALang.next,
currentText: EALang.now,
@ -245,11 +245,11 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
$dialog.find('#unavailable-notes').val('');
};
exports.initialize = function() {
var $unavailabilityProvider = $('#unavailable-provider');
exports.initialize = function () {
var $unavailabilityProvider = $('#unavailable-provider');
for (var index in GlobalVariables.availableProviders) {
var provider = GlobalVariables.availableProviders[index];
var provider = GlobalVariables.availableProviders[index];
$unavailabilityProvider.append(new Option(provider.first_name + ' ' + provider.last_name, provider.id));
}

View file

@ -9,7 +9,7 @@
* @since v1.0.0
* ---------------------------------------------------------------------------- */
(function() {
(function () {
'use strict';
@ -28,13 +28,13 @@
/**
* Binds the default event handlers of the categories tab.
*/
CategoriesHelper.prototype.bindEventHandlers = function() {
CategoriesHelper.prototype.bindEventHandlers = function () {
var instance = this;
/**
* Event: Filter Categories Cancel Button "Click"
*/
$('#filter-categories .clear').click(function() {
$('#filter-categories .clear').click(function () {
$('#filter-categories .key').val('');
instance.filter('');
instance.resetForm();
@ -43,7 +43,7 @@
/**
* Event: Filter Categories Form "Submit"
*/
$('#filter-categories form').submit(function() {
$('#filter-categories form').submit(function () {
var key = $('#filter-categories .key').val();
$('.selected').removeClass('selected');
instance.resetForm();
@ -56,7 +56,7 @@
*
* Displays the selected row data on the right side of the page.
*/
$(document).on('click', '.category-row', function() {
$(document).on('click', '.category-row', function () {
if ($('#filter-categories .filter').prop('disabled')) {
$('#filter-categories .results').css('color', '#AAA');
return; // exit because we are on edit mode
@ -64,7 +64,7 @@
var categoryId = $(this).attr('data-id');
var category = {};
$.each(instance.filterResults, function(index, item) {
$.each(instance.filterResults, function (index, item) {
if (item.id === categoryId) {
category = item;
return false;
@ -80,7 +80,7 @@
/**
* Event: Add Category Button "Click"
*/
$('#add-category').click(function() {
$('#add-category').click(function () {
instance.resetForm();
$('#categories .add-edit-delete-group').hide();
$('#categories .save-cancel-group').show();
@ -92,7 +92,7 @@
/**
* Event: Edit Category Button "Click"
*/
$('#edit-category').click(function() {
$('#edit-category').click(function () {
$('#categories .add-edit-delete-group').hide();
$('#categories .save-cancel-group').show();
$('#categories .record-details').find('input, textarea').prop('readonly', false);
@ -104,33 +104,33 @@
/**
* Event: Delete Category Button "Click"
*/
$('#delete-category').click(function() {
$('#delete-category').click(function () {
var categoryId = $('#category-id').val();
var buttons = [
{
text: EALang.delete,
click: function() {
click: function () {
instance.delete(categoryId);
$('#message_box').dialog('close');
}
},
{
text: EALang.cancel,
click: function() {
click: function () {
$('#message_box').dialog('close');
}
}
];
GeneralFunctions.displayMessageBox(EALang.delete_category,
EALang.delete_record_prompt, buttons);
EALang.delete_record_prompt, buttons);
});
/**
* Event: Categories Save Button "Click"
*/
$('#save-category').click(function() {
$('#save-category').click(function () {
var category = {
name: $('#category-name').val(),
description: $('#category-description').val()
@ -150,7 +150,7 @@
/**
* Event: Cancel Category Button "Click"
*/
$('#cancel-category').click(function() {
$('#cancel-category').click(function () {
var id = $('#category-id').val();
instance.resetForm();
if (id !== '') {
@ -167,14 +167,14 @@
* ID will be selected (but not displayed).
* @param {Boolean} display Optional (false), if true then the selected record will be displayed on the form.
*/
CategoriesHelper.prototype.filter = function(key, selectId, display) {
CategoriesHelper.prototype.filter = function (key, selectId, display) {
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_service_categories';
var postData = {
csrfToken: GlobalVariables.csrfToken,
key: key
};
$.post(postUrl, postData, function(response) {
$.post(postUrl, postData, function (response) {
if (!GeneralFunctions.handleAjaxExceptions(response)) {
return;
}
@ -182,7 +182,7 @@
this.filterResults = response;
$('#filter-categories .results').html('');
$.each(response, function(index, category) {
$.each(response, function (index, category) {
var html = this.getFilterHtml(category);
$('#filter-categories .results').append(html);
}.bind(this));
@ -202,14 +202,14 @@
*
* @param {Object} category Contains the category data.
*/
CategoriesHelper.prototype.save = function(category) {
CategoriesHelper.prototype.save = function (category) {
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_service_category';
var postData = {
csrfToken: GlobalVariables.csrfToken,
category: JSON.stringify(category)
};
$.post(postUrl, postData, function(response) {
$.post(postUrl, postData, function (response) {
if (!GeneralFunctions.handleAjaxExceptions(response)) {
return;
}
@ -219,7 +219,7 @@
$('#filter-categories .key').val('');
this.filter('', response.id, true);
BackendServices.updateAvailableCategories();
}. bind(this), 'json').fail(GeneralFunctions.ajaxFailureHandler);
}.bind(this), 'json').fail(GeneralFunctions.ajaxFailureHandler);
};
/**
@ -227,14 +227,14 @@
*
* @param Number} id Record ID to be deleted.
*/
CategoriesHelper.prototype.delete = function(id) {
CategoriesHelper.prototype.delete = function (id) {
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_service_category';
var postData = {
csrfToken: GlobalVariables.csrfToken,
category_id: id
};
$.post(postUrl, postData, function(response) {
$.post(postUrl, postData, function (response) {
if (!GeneralFunctions.handleAjaxExceptions(response)) {
return;
}
@ -252,7 +252,7 @@
*
* @param {Object} category Contains the category data.
*/
CategoriesHelper.prototype.display = function(category) {
CategoriesHelper.prototype.display = function (category) {
$('#category-id').val(category.id);
$('#category-name').val(category.name);
$('#category-description').val(category.description);
@ -263,13 +263,13 @@
*
* @return {Boolean} Returns the validation result.
*/
CategoriesHelper.prototype.validate = function() {
CategoriesHelper.prototype.validate = function () {
$('#categories .has-error').removeClass('has-error');
try {
var missingRequired = false;
$('#categories .required').each(function() {
$('#categories .required').each(function () {
if ($(this).val() === '' || $(this).val() === undefined) {
$(this).closest('.form-group').addClass('has-error');
missingRequired = true;
@ -281,7 +281,7 @@
}
return true;
} catch(message) {
} catch (message) {
return false;
}
};
@ -289,7 +289,7 @@
/**
* Bring the category form back to its initial state.
*/
CategoriesHelper.prototype.resetForm = function() {
CategoriesHelper.prototype.resetForm = function () {
$('#categories .add-edit-delete-group').show();
$('#categories .save-cancel-group').hide();
$('#categories .record-details').find('input, textarea').val('');
@ -308,11 +308,11 @@
*
* @return {String} Returns the record HTML code.
*/
CategoriesHelper.prototype.getFilterHtml = function(category) {
CategoriesHelper.prototype.getFilterHtml = function (category) {
var html =
'<div class="category-row entry" data-id="' + category.id + '">' +
'<strong>' + category.name + '</strong>' +
'</div><hr>';
'<div class="category-row entry" data-id="' + category.id + '">' +
'<strong>' + category.name + '</strong>' +
'</div><hr>';
return html;
};
@ -326,12 +326,12 @@
* @param {Boolean} display Optional (false), if true then the method will display the record
* on the form.
*/
CategoriesHelper.prototype.select = function(id, display) {
CategoriesHelper.prototype.select = function (id, display) {
display = display || false;
$('#filter-categories .selected').removeClass('selected');
$('#filter-categories .category-row').each(function() {
$('#filter-categories .category-row').each(function () {
if ($(this).attr('data-id') == id) {
$(this).addClass('selected');
return false;
@ -339,7 +339,7 @@
});
if (display) {
$.each(this.filterResults, function(index, category) {
$.each(this.filterResults, function (index, category) {
if (category.id == id) {
this.display(category);
$('#edit-category, #delete-category').prop('disabled', false);

View file

@ -9,7 +9,7 @@
* @since v1.0.0
* ---------------------------------------------------------------------------- */
window.BackendCustomers = window.BackendCustomers || {};
window.BackendCustomers = window.BackendCustomers || {};
/**
* Backend Customers
@ -20,7 +20,7 @@
*
* @module BackendCustomers
*/
(function(exports) {
(function (exports) {
'use strict';
@ -39,7 +39,7 @@
* @param {Boolean} defaultEventHandlers Optional (false), whether to bind the default
* event handlers or not.
*/
exports.initialize = function(defaultEventHandlers) {
exports.initialize = function (defaultEventHandlers) {
defaultEventHandlers = defaultEventHandlers || false;
helper = new CustomersHelper();
@ -47,7 +47,7 @@
helper.filter('');
if (defaultEventHandlers) {
_bindEventHandlers();
_bindEventHandlers();
}
};

View file

@ -9,7 +9,7 @@
* @since v1.0.0
* ---------------------------------------------------------------------------- */
(function() {
(function () {
'use strict';
@ -27,13 +27,13 @@
/**
* Binds the default event handlers of the backend customers page.
*/
CustomersHelper.prototype.bindEventHandlers = function() {
CustomersHelper.prototype.bindEventHandlers = function () {
var instance = this;
/**
* Event: Filter Customers Form "Submit"
*/
$('#filter-customers form').submit(function(event) {
$('#filter-customers form').submit(function (event) {
var key = $('#filter-customers .key').val();
$('#filter-customers .selected').removeClass('selected');
instance.resetForm();
@ -44,7 +44,7 @@
/**
* Event: Filter Customers Clear Button "Click"
*/
$('#filter-customers .clear').click(function() {
$('#filter-customers .clear').click(function () {
$('#filter-customers .key').val('');
instance.filter('');
instance.resetForm();
@ -55,14 +55,14 @@
*
* Display the customer data of the selected row.
*/
$(document).on('click', '.entry', function() {
$(document).on('click', '.entry', function () {
if ($('#filter-customers .filter').prop('disabled')) {
return; // Do nothing when user edits a customer record.
}
var customerId = $(this).attr('data-id');
var customer = {};
$.each(instance.filterResults, function(index, item) {
$.each(instance.filterResults, function (index, item) {
if (item.id == customerId) {
customer = item;
return false;
@ -80,7 +80,7 @@
*
* Display appointment data of the selected row.
*/
$(document).on('click', '.appointment-row', function() {
$(document).on('click', '.appointment-row', function () {
$('#customer-appointments .selected').removeClass('selected');
$(this).addClass('selected');
@ -88,9 +88,9 @@
var appointmentId = $(this).attr('data-id');
var appointment = {};
$.each(instance.filterResults, function(index, c) {
$.each(instance.filterResults, function (index, c) {
if (c.id === customerId) {
$.each(c.appointments, function(index, a) {
$.each(c.appointments, function (index, a) {
if (a.id == appointmentId) {
appointment = a;
return false;
@ -106,7 +106,7 @@
/**
* Event: Add Customer Button "Click"
*/
$('#add-customer').click(function() {
$('#add-customer').click(function () {
instance.resetForm();
$('#add-edit-delete-group').hide();
$('#save-cancel-group').show();
@ -119,7 +119,7 @@
/**
* Event: Edit Customer Button "Click"
*/
$('#edit-customer').click(function() {
$('#edit-customer').click(function () {
$('.record-details').find('input, textarea').prop('readonly', false);
$('#add-edit-delete-group').hide();
$('#save-cancel-group').show();
@ -131,7 +131,7 @@
/**
* Event: Cancel Customer Add/Edit Operation Button "Click"
*/
$('#cancel-customer').click(function() {
$('#cancel-customer').click(function () {
var id = $('#customer-id').val();
instance.resetForm();
if (id != '') {
@ -142,7 +142,7 @@
/**
* Event: Save Add/Edit Customer Operation "Click"
*/
$('#save-customer').click(function() {
$('#save-customer').click(function () {
var customer = {
first_name: $('#first-name').val(),
last_name: $('#last-name').val(),
@ -168,26 +168,26 @@
/**
* Event: Delete Customer Button "Click"
*/
$('#delete-customer').click(function() {
$('#delete-customer').click(function () {
var customerId = $('#customer-id').val();
var buttons = [
{
text: EALang.delete,
click: function() {
click: function () {
instance.delete(customerId);
$('#message_box').dialog('close');
}
},
{
text: EALang.cancel,
click: function() {
click: function () {
$('#message_box').dialog('close');
}
}
];
GeneralFunctions.displayMessageBox(EALang.delete_customer,
EALang.delete_record_prompt, buttons);
EALang.delete_record_prompt, buttons);
});
};
@ -196,14 +196,14 @@
*
* @param {Object} customer Contains the customer data.
*/
CustomersHelper.prototype.save = function(customer) {
CustomersHelper.prototype.save = function (customer) {
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_customer';
var postData = {
csrfToken: GlobalVariables.csrfToken,
customer: JSON.stringify(customer)
};
$.post(postUrl, postData, function(response) {
$.post(postUrl, postData, function (response) {
if (!GeneralFunctions.handleAjaxExceptions(response)) {
return;
}
@ -220,14 +220,14 @@
*
* @param {Number} id Record id to be deleted.
*/
CustomersHelper.prototype.delete = function(id) {
CustomersHelper.prototype.delete = function (id) {
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_customer';
var postData = {
csrfToken: GlobalVariables.csrfToken,
customer_id: id
};
$.post(postUrl, postData, function(response) {
$.post(postUrl, postData, function (response) {
if (!GeneralFunctions.handleAjaxExceptions(response)) {
return;
}
@ -241,7 +241,7 @@
/**
* Validate customer data before save (insert or update).
*/
CustomersHelper.prototype.validate = function() {
CustomersHelper.prototype.validate = function () {
$('#form-message')
.removeClass('alert-danger')
.hide();
@ -251,7 +251,7 @@
// Validate required fields.
var missingRequired = false;
$('.required').each(function() {
$('.required').each(function () {
if ($(this).val() == '') {
$(this).closest('.form-group').addClass('has-error');
missingRequired = true;
@ -269,7 +269,7 @@
}
return true;
} catch(message) {
} catch (message) {
$('#form-message')
.addClass('alert-danger')
.text(message)
@ -281,7 +281,7 @@
/**
* Bring the customer form back to its initial state.
*/
CustomersHelper.prototype.resetForm = function() {
CustomersHelper.prototype.resetForm = function () {
$('.record-details').find('input, textarea').val('');
$('.record-details').find('input, textarea').prop('readonly', true);
@ -304,7 +304,7 @@
*
* @param {Object} customer Contains the customer record data.
*/
CustomersHelper.prototype.display = function(customer) {
CustomersHelper.prototype.display = function (customer) {
$('#customer-id').val(customer.id);
$('#first-name').val(customer.first_name);
$('#last-name').val(customer.last_name);
@ -316,15 +316,15 @@
$('#notes').val(customer.notes);
$('#customer-appointments').empty();
$.each(customer.appointments, function(index, appointment) {
$.each(customer.appointments, function (index, appointment) {
var start = GeneralFunctions.formatDate(Date.parse(appointment.start_datetime), GlobalVariables.dateFormat, true);
var end = GeneralFunctions.formatDate(Date.parse(appointment.end_datetime), GlobalVariables.dateFormat, true);
var html =
'<div class="appointment-row" data-id="' + appointment.id + '">' +
start + ' - ' + end + '<br>' +
appointment.service.name + ', ' +
appointment.provider.first_name + ' ' + appointment.provider.last_name +
'</div>';
'<div class="appointment-row" data-id="' + appointment.id + '">' +
start + ' - ' + end + '<br>' +
appointment.service.name + ', ' +
appointment.provider.first_name + ' ' + appointment.provider.last_name +
'</div>';
$('#customer-appointments').append(html);
});
@ -339,7 +339,7 @@
* ID will be selected (but not displayed).
* @param {Boolean} display Optional (false), if true then the selected record will be displayed on the form.
*/
CustomersHelper.prototype.filter = function(key, selectId, display) {
CustomersHelper.prototype.filter = function (key, selectId, display) {
display = display || false;
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_customers';
@ -348,7 +348,7 @@
key: key
};
$.post(postUrl, postData, function(response) {
$.post(postUrl, postData, function (response) {
if (!GeneralFunctions.handleAjaxExceptions(response)) {
return;
}
@ -356,10 +356,10 @@
this.filterResults = response;
$('#filter-customers .results').html('');
$.each(response, function(index, customer) {
var html = this.getFilterHtml(customer);
$('#filter-customers .results').append(html);
}.bind(this));
$.each(response, function (index, customer) {
var html = this.getFilterHtml(customer);
$('#filter-customers .results').append(html);
}.bind(this));
if (response.length == 0) {
$('#filter-customers .results').html('<em>' + EALang.no_records_found + '</em>');
}
@ -378,19 +378,19 @@
*
* @return {String} Returns the record HTML code.
*/
CustomersHelper.prototype.getFilterHtml = function(customer) {
CustomersHelper.prototype.getFilterHtml = function (customer) {
var name = customer.first_name + ' ' + customer.last_name;
var info = customer.email;
info = (customer.phone_number != '' && customer.phone_number != null)
? info + ', ' + customer.phone_number : info;
? info + ', ' + customer.phone_number : info;
var html =
'<div class="entry" data-id="' + customer.id + '">' +
'<strong>' +
name +
'</strong><br>' +
info +
'</div><hr>';
'<div class="entry" data-id="' + customer.id + '">' +
'<strong>' +
name +
'</strong><br>' +
info +
'</div><hr>';
return html;
};
@ -404,12 +404,12 @@
* @param {Boolean} display Optional (false), if true then the method will display the record
* on the form.
*/
CustomersHelper.prototype.select = function(id, display) {
CustomersHelper.prototype.select = function (id, display) {
display = display || false;
$('#filter-customers .selected').removeClass('selected');
$('#filter-customers .entry').each(function() {
$('#filter-customers .entry').each(function () {
if ($(this).attr('data-id') == id) {
$(this).addClass('selected');
return false;
@ -417,7 +417,7 @@
});
if (display) {
$.each(this.filterResults, function(index, customer) {
$.each(this.filterResults, function (index, customer) {
if (customer.id == id) {
this.display(customer);
$('#edit-customer, #delete-customer').prop('disabled', false);
@ -432,16 +432,16 @@
*
* @param {Object} appointment Appointment data
*/
CustomersHelper.prototype.displayAppointment = function(appointment) {
CustomersHelper.prototype.displayAppointment = function (appointment) {
var start = GeneralFunctions.formatDate(Date.parse(appointment.start_datetime), GlobalVariables.dateFormat, true);
var end = GeneralFunctions.formatDate(Date.parse(appointment.end_datetime), GlobalVariables.dateFormat, true);
var html =
'<div>' +
'<strong>' + appointment.service.name + '</strong><br>' +
appointment.provider.first_name + ' ' + appointment.provider.last_name + '<br>' +
start + ' - ' + end + '<br>' +
'</div>';
'<div>' +
'<strong>' + appointment.service.name + '</strong><br>' +
appointment.provider.first_name + ' ' + appointment.provider.last_name + '<br>' +
start + ' - ' + end + '<br>' +
'</div>';
$('#appointment-details').html(html).removeClass('hidden');
};

View file

@ -18,7 +18,7 @@ window.BackendServices = window.BackendServices || {};
*
* @module BackendServices
*/
(function(exports) {
(function (exports) {
'use strict';
@ -29,7 +29,7 @@ window.BackendServices = window.BackendServices || {};
*/
var helper;
var servicesHelper = new ServicesHelper();
var servicesHelper = new ServicesHelper();
var categoriesHelper = new CategoriesHelper();
/**
@ -37,11 +37,11 @@ window.BackendServices = window.BackendServices || {};
*
* @param {Boolean} bindEventHandlers Optional (true), determines whether to bind the default event handlers.
*/
exports.initialize = function(bindEventHandlers) {
exports.initialize = function (bindEventHandlers) {
bindEventHandlers = bindEventHandlers || true;
// Fill available service categories listbox.
$.each(GlobalVariables.categories, function(index, category) {
$.each(GlobalVariables.categories, function (index, category) {
var option = new Option(category.name, category.id);
$('#service-category').append(option);
});
@ -68,7 +68,7 @@ window.BackendServices = window.BackendServices || {};
*
* Changes the displayed tab.
*/
$('a[data-toggle="tab"]').on('shown.bs.tab', function() {
$('a[data-toggle="tab"]').on('shown.bs.tab', function () {
if ($(this).attr('href') === '#services') {
helper = servicesHelper;
} else if ($(this).attr('href') === '#categories') {
@ -81,8 +81,8 @@ window.BackendServices = window.BackendServices || {};
Backend.placeFooterToBottom();
});
servicesHelper.bindEventHandlers();
categoriesHelper.bindEventHandlers();
servicesHelper.bindEventHandlers();
categoriesHelper.bindEventHandlers();
}
/**
@ -90,14 +90,14 @@ window.BackendServices = window.BackendServices || {};
*
* Use this method every time a change is made to the service categories db table.
*/
exports.updateAvailableCategories = function() {
exports.updateAvailableCategories = function () {
var url = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_service_categories';
var data = {
csrfToken: GlobalVariables.csrfToken,
key: ''
};
$.post(url, data, function(response) {
$.post(url, data, function (response) {
if (!GeneralFunctions.handleAjaxExceptions(response)) {
return;
}
@ -105,7 +105,7 @@ window.BackendServices = window.BackendServices || {};
GlobalVariables.categories = response;
var $select = $('#service-category');
$select.empty();
$.each(response, function(index, category) {
$.each(response, function (index, category) {
var option = new Option(category.name, category.id);
$select.append(option);
});

View file

@ -9,7 +9,7 @@
* @since v1.0.0
* ---------------------------------------------------------------------------- */
(function() {
(function () {
'use strict';
@ -24,7 +24,7 @@
this.filterResults = {};
}
ServicesHelper.prototype.bindEventHandlers = function() {
ServicesHelper.prototype.bindEventHandlers = function () {
var instance = this;
/**
@ -32,7 +32,7 @@
*
* @param {jQuery.Event} event
*/
$('#filter-services form').submit(function(event) {
$('#filter-services form').submit(function (event) {
var key = $('#filter-services .key').val();
$('#filter-services .selected').removeClass('selected');
instance.resetForm();
@ -43,7 +43,7 @@
/**
* Event: Filter Service Cancel Button "Click"
*/
$('#filter-services .clear').click(function() {
$('#filter-services .clear').click(function () {
$('#filter-services .key').val('');
instance.filter('');
instance.resetForm();
@ -54,7 +54,7 @@
*
* Display the selected service data to the user.
*/
$(document).on('click', '.service-row', function() {
$(document).on('click', '.service-row', function () {
if ($('#filter-services .filter').prop('disabled')) {
$('#filter-services .results').css('color', '#AAA');
return; // exit because we are on edit mode
@ -62,7 +62,7 @@
var serviceId = $(this).attr('data-id');
var service = {};
$.each(instance.filterResults, function(index, item) {
$.each(instance.filterResults, function (index, item) {
if (item.id === serviceId) {
service = item;
return false;
@ -87,7 +87,7 @@
/**
* Event: Add New Service Button "Click"
*/
$('#add-service').click(function() {
$('#add-service').click(function () {
instance.resetForm();
$('#services .add-edit-delete-group').hide();
$('#services .save-cancel-group').show();
@ -103,7 +103,7 @@
*
* Cancel add or edit of a service record.
*/
$('#cancel-service').click(function() {
$('#cancel-service').click(function () {
var id = $('#service-id').val();
instance.resetForm();
if (id !== '') {
@ -114,7 +114,7 @@
/**
* Event: Save Service Button "Click"
*/
$('#save-service').click(function() {
$('#save-service').click(function () {
var service = {
name: $('#service-name').val(),
duration: $('#service-duration').val(),
@ -145,7 +145,7 @@
/**
* Event: Edit Service Button "Click"
*/
$('#edit-service').click(function() {
$('#edit-service').click(function () {
$('#services .add-edit-delete-group').hide();
$('#services .save-cancel-group').show();
$('#services .record-details').find('input, textarea').prop('readonly', false);
@ -158,26 +158,26 @@
/**
* Event: Delete Service Button "Click"
*/
$('#delete-service').click(function() {
$('#delete-service').click(function () {
var serviceId = $('#service-id').val();
var buttons = [
{
text: EALang.delete,
click: function() {
click: function () {
instance.delete(serviceId);
$('#message_box').dialog('close');
}
},
{
text: EALang.cancel,
click: function() {
click: function () {
$('#message_box').dialog('close');
}
}
];
GeneralFunctions.displayMessageBox(EALang.delete_service,
EALang.delete_record_prompt, buttons);
EALang.delete_record_prompt, buttons);
});
};
@ -187,14 +187,14 @@
* @param {Object} service Contains the service record data. If an 'id' value is provided
* then the update operation is going to be executed.
*/
ServicesHelper.prototype.save = function(service) {
ServicesHelper.prototype.save = function (service) {
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_service';
var postData = {
csrfToken: GlobalVariables.csrfToken,
service: JSON.stringify(service)
};
$.post(postUrl, postData, function(response) {
$.post(postUrl, postData, function (response) {
if (!GeneralFunctions.handleAjaxExceptions(response)) {
return;
}
@ -211,14 +211,14 @@
*
* @param {Number} id Record ID to be deleted.
*/
ServicesHelper.prototype.delete = function(id) {
ServicesHelper.prototype.delete = function (id) {
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_service';
var postData = {
csrfToken: GlobalVariables.csrfToken,
service_id: id
};
$.post(postUrl, postData, function(response) {
$.post(postUrl, postData, function (response) {
if (!GeneralFunctions.handleAjaxExceptions(response)) {
return;
}
@ -235,14 +235,14 @@
*
* @return {Boolean} Returns the validation result.
*/
ServicesHelper.prototype.validate = function() {
ServicesHelper.prototype.validate = function () {
$('#services .has-error').removeClass('has-error');
try {
// validate required fields.
var missingRequired = false;
$('#services .required').each(function() {
$('#services .required').each(function () {
if ($(this).val() == '' || $(this).val() == undefined) {
$(this).closest('.form-group').addClass('has-error');
missingRequired = true;
@ -254,7 +254,7 @@
}
return true;
} catch(exc) {
} catch (exc) {
return false;
}
};
@ -262,7 +262,7 @@
/**
* Resets the service tab form back to its initial state.
*/
ServicesHelper.prototype.resetForm = function() {
ServicesHelper.prototype.resetForm = function () {
$('#services .record-details').find('input, textarea').val('');
$('#service-category').val('null');
$('#services .add-edit-delete-group').show();
@ -281,7 +281,7 @@
*
* @param {Object} service Contains the service record data.
*/
ServicesHelper.prototype.display = function(service) {
ServicesHelper.prototype.display = function (service) {
$('#service-id').val(service.id);
$('#service-name').val(service.name);
$('#service-duration').val(service.duration);
@ -303,7 +303,7 @@
* ID will be selected (but not displayed).
* @param {Boolean} display Optional (false), if true then the selected record will be displayed on the form.
*/
ServicesHelper.prototype.filter = function(key, selectId, display) {
ServicesHelper.prototype.filter = function (key, selectId, display) {
display = display || false;
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_services';
@ -312,7 +312,7 @@
key: key
};
$.post(postUrl, postData, function(response) {
$.post(postUrl, postData, function (response) {
if (!GeneralFunctions.handleAjaxExceptions(response)) {
return;
}
@ -320,7 +320,7 @@
this.filterResults = response;
$('#filter-services .results').html('');
$.each(response, function(index, service) {
$.each(response, function (index, service) {
var html = ServicesHelper.prototype.getFilterHtml(service);
$('#filter-services .results').append(html);
});
@ -344,13 +344,13 @@
*
* @return {String} The HTML code that represents the record on the filter results list.
*/
ServicesHelper.prototype.getFilterHtml = function(service) {
ServicesHelper.prototype.getFilterHtml = function (service) {
var html =
'<div class="service-row entry" data-id="' + service.id + '">' +
'<strong>' + service.name + '</strong><br>' +
service.duration + ' min - ' +
service.price + ' ' + service.currency + '<br>' +
'</div><hr>';
'<div class="service-row entry" data-id="' + service.id + '">' +
'<strong>' + service.name + '</strong><br>' +
service.duration + ' min - ' +
service.price + ' ' + service.currency + '<br>' +
'</div><hr>';
return html;
};
@ -362,12 +362,12 @@
* @param {Number} id The record id to be selected from the filter results.
* @param {Boolean} display Optional (false), if true then the method will display the record on the form.
*/
ServicesHelper.prototype.select = function(id, display) {
ServicesHelper.prototype.select = function (id, display) {
display = display || false;
$('#filter-services .selected').removeClass('selected');
$('#filter-services .service-row').each(function() {
$('#filter-services .service-row').each(function () {
if ($(this).attr('data-id') == id) {
$(this).addClass('selected');
return false;
@ -375,7 +375,7 @@
});
if (display) {
$.each(this.filterResults, function(index, service) {
$.each(this.filterResults, function (index, service) {
if (service.id == id) {
this.display(service);
$('#edit-service, #delete-service').prop('disabled', false);

View file

@ -19,7 +19,7 @@ window.BackendSettings = window.BackendSettings || {};
*
* @module BackendSettings
*/
(function(exports) {
(function (exports) {
'use strict';
@ -46,17 +46,17 @@ window.BackendSettings = window.BackendSettings || {};
*
* @param {bool} bindEventHandlers Optional (true), determines whether to bind the default event handlers.
*/
exports.initialize = function(bindEventHandlers) {
exports.initialize = function (bindEventHandlers) {
bindEventHandlers = bindEventHandlers || true;
// Apply setting values from database.
$.each(GlobalVariables.settings.system, function(index, setting) {
$.each(GlobalVariables.settings.system, function (index, setting) {
$('input[data-field="' + setting.name + '"]').val(setting.value);
$('select[data-field="' + setting.name + '"]').val(setting.value);
});
var workingPlan = {};
$.each(GlobalVariables.settings.system, function(index, setting) {
$.each(GlobalVariables.settings.system, function (index, setting) {
if (setting.name == 'company_working_plan') {
workingPlan = $.parseJSON(setting.value);
}
@ -163,7 +163,7 @@ window.BackendSettings = window.BackendSettings || {};
*
* Store the setting changes into the database.
*/
$('.save-settings').click(function() {
$('.save-settings').click(function () {
var data = settings.get();
settings.save(data);
});
@ -174,7 +174,7 @@ window.BackendSettings = window.BackendSettings || {};
* When the user leaves the username input field we will need to check if the username
* is not taken by another record in the system. Usernames must be unique.
*/
$('#username').focusout(function() {
$('#username').focusout(function () {
var $input = $(this);
if ($input.prop('readonly') == true || $input.val() == '') {
@ -188,7 +188,7 @@ window.BackendSettings = window.BackendSettings || {};
user_id: $input.parents().eq(2).find('#user-id').val()
};
$.post(postUrl, postData, function(response) {
$.post(postUrl, postData, function (response) {
if (!GeneralFunctions.handleAjaxExceptions(response)) {
return;
}

View file

@ -9,7 +9,7 @@
* @since v1.0.0
* ---------------------------------------------------------------------------- */
(function() {
(function () {
'use strict';
@ -18,7 +18,8 @@
*
* @class SystemSettings
*/
var SystemSettings = function() {};
var SystemSettings = function () {
};
/**
* Save the system settings.
@ -27,7 +28,7 @@
*
* @param {Array} settings Contains the system settings data.
*/
SystemSettings.prototype.save = function(settings) {
SystemSettings.prototype.save = function (settings) {
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_settings';
var postData = {
csrfToken: GlobalVariables.csrfToken,
@ -35,7 +36,7 @@
type: BackendSettings.SETTINGS_SYSTEM
};
$.post(postUrl, postData, function(response) {
$.post(postUrl, postData, function (response) {
if (!GeneralFunctions.handleAjaxExceptions(response)) {
return;
}
@ -60,11 +61,11 @@
*
* @return {Array} Returns the system settings array.
*/
SystemSettings.prototype.get = function() {
SystemSettings.prototype.get = function () {
var settings = [];
// General Settings Tab
$('#general').find('input, select').each(function() {
$('#general').find('input, select').each(function () {
settings.push({
name: $(this).attr('data-field'),
value: $(this).val()
@ -102,13 +103,13 @@
*
* @return {Boolean} Returns the validation result.
*/
SystemSettings.prototype.validate = function() {
SystemSettings.prototype.validate = function () {
$('#general .has-error').removeClass('has-error');
try {
// Validate required fields.
var missingRequired = false;
$('#general .required').each(function() {
$('#general .required').each(function () {
if ($(this).val() == '' || $(this).val() == undefined) {
$(this).closest('.form-group').addClass('has-error');
missingRequired = true;
@ -126,7 +127,7 @@
}
return true;
} catch(message) {
} catch (message) {
Backend.displayNotification(message);
return false;
}

View file

@ -9,7 +9,7 @@
* @since v1.0.0
* ---------------------------------------------------------------------------- */
(function() {
(function () {
'use strict';
@ -18,14 +18,15 @@
*
* @class UserSettings
*/
var UserSettings = function() {};
var UserSettings = function () {
};
/**
* Get the settings data for the user settings.
*
* @returns {Object} Returns the user settings array.
*/
UserSettings.prototype.get = function() {
UserSettings.prototype.get = function () {
var user = {
id: $('#user-id').val(),
first_name: $('#first-name').val(),
@ -57,7 +58,7 @@
*
* @param {Array} settings Contains the user settings.
*/
UserSettings.prototype.save = function(settings) {
UserSettings.prototype.save = function (settings) {
if (!this.validate(settings)) {
Backend.displayNotification(EALang.user_settings_are_invalid);
return; // Validation failed, do not proceed.
@ -70,7 +71,7 @@
settings: JSON.stringify(settings)
};
$.post(postUrl, postData, function(response) {
$.post(postUrl, postData, function (response) {
if (!GeneralFunctions.handleAjaxExceptions(response)) {
return;
}
@ -90,13 +91,13 @@
*
* @return {Boolean} Returns the validation result.
*/
UserSettings.prototype.validate = function() {
UserSettings.prototype.validate = function () {
$('#user .has-error').removeClass('has-error');
try {
// Validate required fields.
var missingRequired = false;
$('#user .required').each(function() {
$('#user .required').each(function () {
if ($(this).val() === '' || $(this).val() === undefined) {
$(this).closest('.form-group').addClass('has-error');
missingRequired = true;
@ -125,7 +126,7 @@
}
return true;
} catch(exc) {
} catch (exc) {
Backend.displayNotification(exc);
return false;
}

Some files were not shown because too many files have changed in this diff Show more