diff --git a/rsc/db/sample-data.sql b/rsc/db/sample-data.sql index b27a88b6..c54b0f7c 100644 --- a/rsc/db/sample-data.sql +++ b/rsc/db/sample-data.sql @@ -24,6 +24,7 @@ INSERT INTO `ea_settings` (`id`, `name`, `value`) VALUES (5, 'company_link', 'http://www.abc-company.ea'), (6, 'google_analytics_code', ''); (7, 'customer_notifications', '1'); +(8, 'date_format', 'DMY'); -- -- Dumping data for table `ea_roles` diff --git a/src/application/config/constants.php b/src/application/config/constants.php index 22e445be..5a0bf60e 100644 --- a/src/application/config/constants.php +++ b/src/application/config/constants.php @@ -71,6 +71,10 @@ define('PRIV_USERS', 'users'); define('PRIV_SYSTEM_SETTINGS', 'system_settings'); define('PRIV_USER_SETTINGS', 'user_settings'); +define('DATE_FORMAT_DMY', 'DMY'); +define('DATE_FORMAT_MDY', 'MDY'); +define('DATE_FORMAT_YMD', 'YMD'); + define('MIN_PASSWORD_LENGTH', 7); define('ANY_PROVIDER', 'any-provider'); /* End of file constants.php */ diff --git a/src/application/config/migration.php b/src/application/config/migration.php index 3755216a..b1211cff 100644 --- a/src/application/config/migration.php +++ b/src/application/config/migration.php @@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE; | be upgraded / downgraded to. | */ -$config['migration_version'] = 3; // current +$config['migration_version'] = 4; // current /* diff --git a/src/application/migrations/004_add_date_format_setting.php b/src/application/migrations/004_add_date_format_setting.php new file mode 100644 index 00000000..c014f80f --- /dev/null +++ b/src/application/migrations/004_add_date_format_setting.php @@ -0,0 +1,24 @@ + + * @copyright Copyright (c) 2013 - 2015, Alex Tselegidis + * @license http://opensource.org/licenses/GPL-3.0 - GPLv3 + * @link http://easyappointments.org + * @since v1.0.0 + * ---------------------------------------------------------------------------- */ + +class Migration_Add_date_format_setting extends CI_Migration { + public function up() { + $this->load->model('settings_model'); + $this->settings_model->set_setting('date_format', DATE_FORMAT_DMY); + } + + public function down() { + $this->load->model('settings_model'); + $this->settings_model->remove_setting('date_format'); + } +} diff --git a/src/assets/sql/data.sql b/src/assets/sql/data.sql index a74ab8ff..698c323d 100644 --- a/src/assets/sql/data.sql +++ b/src/assets/sql/data.sql @@ -1,3 +1,4 @@ INSERT INTO ea_settings (name, value) VALUES ('google_analytics_code', ''), - ('customer_notifications', '1'); + ('customer_notifications', '1'), + ('date_format', 'DMY');