Skip to content

Commit

Permalink
ER:Add a diagnostic page (data and config).
Browse files Browse the repository at this point in the history
  • Loading branch information
bbalet committed Feb 21, 2016
1 parent 526d8bb commit 9d1e734
Show file tree
Hide file tree
Showing 32 changed files with 2,487 additions and 1,638 deletions.
15 changes: 9 additions & 6 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@ I tried to sort them out by priority and to explicitly explain what is out of sc
## v0.4.6

- [X] i18n: Use locale for m/d start/end periods in contracts list.
- [ ] i18n: Last 3 columns in Reports/Leaves.
- [X] i18n: reports_leaves_field_leave_requests / All
- [X] Add a version for JS libs (avoid cache problems).
- [X] Use open formats for Spreadsheet exports.
- [X] Add a "All" option into Reports/Leaves.
- [ ] Add requests list into Reports/Leaves.
- [ ] Remove duplicated string defs (moved into global): users_create_popup_manager_button_ok
- [X] Migrate all datatables to the new language initiatlization.
- [X] Add shortcuts to ICS feeds into My leaves/My collaborators.
- [X] HR/Employees: reset filters on entry date (post pend).
- [X] Add a diagnostic page (check configuration and data).

## v0.4.7
- [X] TBT: Add a "All" option into Reports/Leaves.
- [X] TBT: Add requests list into Reports/Leaves.
- [ ] Remove duplicated string defs (moved into global): users_create_popup_manager_button_ok
- [ ] i18n: Last 3 columns in Reports/Leaves.
- [ ] Maybe: Filter Excel export on visible rows (lot of security backend).
- [ ] Maybe: user/index Ajaxload.
- [ ] Maybe: series of leave requests (Employees / Multiple edit). and...
- [ ] Compute automatically: length of multiple leave requests.
- [ ] Maybe: series of leave requests (Employees / Multiple edit); take into account days off. and...
- [ ] Maybe: swap a leave request / ask for change (-> back to Planned status or formal swap ?).

## v0.5.0 or later
Expand Down
1 change: 1 addition & 0 deletions application/config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
//Admin : global features
$route['admin/qrcode'] = 'admin/qrCode';
$route['admin/settings'] = 'admin/settings';
$route['admin/diagnostic'] = 'admin/diagnostic';
$route['admin'] = 'admin/settings';

//_______________________________________________
Expand Down
135 changes: 79 additions & 56 deletions application/controllers/admin.php
Original file line number Diff line number Diff line change
@@ -1,56 +1,79 @@
<?php
/**
* This controller serves the administration pages
* @copyright Copyright (c) 2014-2016 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.4.2
*/

if (!defined('BASEPATH')) { exit('No direct script access allowed'); }

/**
* This class serves the administration pages (readonly settings page for the moment).
* In Jorani the settings are set into a configuration file and not into DB.
*/
class Admin extends CI_Controller {

/**
* Default constructor
* @author Benjamin BALET <benjamin.balet@gmail.com>
*/
public function __construct() {
parent::__construct();
setUserContext($this);
$this->lang->load('global', $this->language);
}

/**
* Display the settings of the system (extract of config.php)
* @author Benjamin BALET <benjamin.balet@gmail.com>
*/
public function settings() {
$this->auth->checkIfOperationIsAllowed('list_settings');
$data = getUserContext($this);
$data['title'] = 'application/config/config.php';
$data['help'] = $this->help->create_help_link('global_link_doc_page_settings');
$this->load->view('templates/header', $data);
$this->load->view('menu/index', $data);
$this->load->view('admin/settings', $data);
$this->load->view('templates/footer');
}

/**
* Output a QRCode containing the URL of the Jorani instance and the e-mail of the connected user
* @author Benjamin BALET <benjamin.balet@gmail.com>
*/
public function qrCode() {
require_once(APPPATH . 'third_party/QRCode.php');
$this->load->model('users_model');
$user = $this->users_model->getUsers($this->user_id);
$qr = new QRCode();
$qr = QRCode::getMinimumQRCode(base_url() . '#' . $user['login'] .
'#' . $user['email'], QR_ERROR_CORRECT_LEVEL_L);
echo $qr->printHTML();
}
}
<?php
/**
* This controller serves the administration pages
* @copyright Copyright (c) 2014-2016 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.4.2
*/

if (!defined('BASEPATH')) { exit('No direct script access allowed'); }

/**
* This class serves the administration pages (readonly settings page for the moment).
* In Jorani the settings are set into a configuration file and not into DB.
*/
class Admin extends CI_Controller {

/**
* Default constructor
* @author Benjamin BALET <benjamin.balet@gmail.com>
*/
public function __construct() {
parent::__construct();
setUserContext($this);
$this->lang->load('global', $this->language);
$this->lang->load('admin', $this->language);
}

/**
* Display the settings of the system (extract of config.php)
* @author Benjamin BALET <benjamin.balet@gmail.com>
*/
public function settings() {
$this->auth->checkIfOperationIsAllowed('list_settings');
$data = getUserContext($this);
$data['title'] = 'application/config/config.php';
$data['help'] = $this->help->create_help_link('global_link_doc_page_settings');
$this->load->view('templates/header', $data);
$this->load->view('menu/index', $data);
$this->load->view('admin/settings', $data);
$this->load->view('templates/footer');
}

/**
* Display the diagnostic of the content (duplicated requests, etc.) and configuration
* @author Benjamin BALET <benjamin.balet@gmail.com>
*/
public function diagnostic() {
$this->auth->checkIfOperationIsAllowed('list_settings');
$data = getUserContext($this);
$data['title'] =lang('admin_diagnostic_title');
$data['help'] = '';
$this->load->model('leaves_model');
$this->load->model('entitleddays_model');
$this->load->model('dayoffs_model');
$data['duplicatedLeaves'] = $this->leaves_model->detectDuplicatedRequests();
$data['wrongDateType'] = $this->leaves_model->detectWrongDateTypes();
$data['entitlmentOverflow'] = $this->entitleddays_model->detectOverflow();
$data['daysOffYears'] = $this->dayoffs_model->checkIfDefined(date("Y"));
$this->load->view('templates/header', $data);
$this->load->view('menu/index', $data);
$this->load->view('admin/diagnostic', $data);
$this->load->view('templates/footer');
}

/**
* Output a QRCode containing the URL of the Jorani instance and the e-mail of the connected user
* @author Benjamin BALET <benjamin.balet@gmail.com>
*/
public function qrCode() {
require_once(APPPATH . 'third_party/QRCode.php');
$this->load->model('users_model');
$user = $this->users_model->getUsers($this->user_id);
$qr = new QRCode();
$qr = QRCode::getMinimumQRCode(base_url() . '#' . $user['login'] .
'#' . $user['email'], QR_ERROR_CORRECT_LEVEL_L);
echo $qr->printHTML();
}
}
48 changes: 48 additions & 0 deletions application/language/dutch/admin_lang.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
/**
* Translation file
* @copyright Copyright (c) 2014-2016 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.4.6
*/

$lang['admin_diagnostic_title'] = 'Data & Config Diagnostic';
$lang['admin_diagnostic_description'] = 'Detection of configuration and data problems';
$lang['admin_diagnostic_no_error'] = 'No error';

$lang['admin_diagnostic_requests_tab'] = 'Leave Requests';
$lang['admin_diagnostic_requests_description'] = 'Accepted but duplicated Leave Requests';
$lang['admin_diagnostic_requests_thead_id'] = 'ID';
$lang['admin_diagnostic_requests_thead_employee'] = 'Employee';
$lang['admin_diagnostic_requests_thead_start_date'] = 'Start Date';
$lang['admin_diagnostic_requests_thead_status'] = 'Status';
$lang['admin_diagnostic_requests_thead_type'] = 'Type';

$lang['admin_diagnostic_datetype_tab'] = 'Afternoon/Morning';
$lang['admin_diagnostic_datetype_description'] = 'Leave Requests with a wrong start/end type.';
$lang['admin_diagnostic_datetype_thead_id'] = 'ID';
$lang['admin_diagnostic_datetype_thead_employee'] = 'Employee';
$lang['admin_diagnostic_datetype_thead_start_date'] = 'Date';
$lang['admin_diagnostic_datetype_thead_start_type'] = 'Start';
$lang['admin_diagnostic_datetype_thead_end_type'] = 'End';
$lang['admin_diagnostic_datetype_thead_status'] = 'Status';

$lang['admin_diagnostic_entitlements_tab'] = 'Entitled days';
$lang['admin_diagnostic_entitlements_description'] = 'List of contracts and employees having entitlements for more than one year.';
$lang['admin_diagnostic_entitlements_thead_id'] = 'ID';
$lang['admin_diagnostic_entitlements_thead_type'] = 'Type';
$lang['admin_diagnostic_entitlements_thead_name'] = 'Name';
$lang['admin_diagnostic_entitlements_thead_start_date'] = 'Start Date';
$lang['admin_diagnostic_entitlements_thead_end_date'] = 'End Date';
$lang['admin_diagnostic_entitlements_type_contract'] = 'Contract';
$lang['admin_diagnostic_entitlements_type_employee'] = 'Employee';
$lang['admin_diagnostic_entitlements_deletion_problem'] = 'Incomplete deletion into database.' ;

$lang['admin_diagnostic_daysoff_tab'] = 'Non-working days';
$lang['admin_diagnostic_daysoff_description'] = 'Number of days (per contract) for which a non-working duration has been defined.';
$lang['admin_diagnostic_daysoff_thead_id'] = 'ID';
$lang['admin_diagnostic_daysoff_thead_name'] = 'Name';
$lang['admin_diagnostic_daysoff_thead_ym1'] = 'Last year';
$lang['admin_diagnostic_daysoff_thead_y'] = 'This year';
$lang['admin_diagnostic_daysoff_thead_yp1'] = 'Next year';
125 changes: 63 additions & 62 deletions application/language/dutch/menu_lang.php
Original file line number Diff line number Diff line change
@@ -1,62 +1,63 @@
<?php
/**
* Translation file
* @copyright Copyright (c) 2014-2016 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.1.0
* @author Roger WOLFS
*/

$lang['menu_banner_change_password'] = 'Nieuw wachtwoord';
$lang['menu_banner_welcome'] = 'Welkom';
$lang['menu_banner_logout'] = 'Uitloggen';
$lang['menu_banner_tip_myprofile'] = 'Bekijk persoonlijke informatie';
$lang['menu_banner_tip_reset'] = 'Reset wachtwoord';

$lang['menu_password_popup_title'] = 'Nieuw wachtwoord';
$lang['menu_password_popup_button_cancel'] = 'Annuleren';

$lang['menu_admin_title'] = 'Admin';
$lang['menu_admin_list_users'] = 'Lijst gebruikers';
$lang['menu_admin_add_user'] = 'Maak gebruiker aan';
$lang['menu_admin_settings_divider'] = 'Settings';
$lang['menu_admin_settings'] = 'Settings';

$lang['menu_hr_title'] = 'HR';
$lang['menu_hr_employees_divider'] = 'Werknemers';
$lang['menu_hr_list_organization'] = 'Organisatie';
$lang['menu_hr_list_employees'] = 'Lijst werknemers';
$lang['menu_hr_contracts_divider'] = 'Contracten';
$lang['menu_hr_list_contracts'] = 'Lijst contracten';
$lang['menu_hr_list_positions'] = 'Lijst functies';
$lang['menu_hr_leaves_type_divider'] = 'Afwezigheid';
$lang['menu_hr_list_leaves_type'] = 'Lijst types';
$lang['menu_hr_reports_divider'] = 'Rapporten';
$lang['menu_hr_report_leave_balance'] = 'Afwezigheidssaldo';
$lang['menu_hr_report_leaves'] = 'Leave requests';

$lang['menu_validation_title'] = 'Validatie';
$lang['menu_validation_delegations'] = 'Delegaties';
$lang['menu_validation_collaborators'] = 'Mijn medewerkers';
$lang['menu_validation_leaves'] = 'Afwezigheid';
$lang['menu_validation_overtime'] = 'Overuren';

$lang['menu_requests_title'] = 'Verzoeken';
$lang['menu_requests_leaves'] = 'Afwezigheid';
$lang['menu_requests_overtime'] = 'Overuren';
$lang['menu_requests_list_extras'] = 'Lijst van overuren';
$lang['menu_requests_request_extra'] = 'Aanmelding overuren';

$lang['menu_leaves_counters'] = 'Tellers';
$lang['menu_leaves_list_requests'] = 'Overzicht van afwezigheidsverzoeken';
$lang['menu_leaves_create_request'] = 'Vraag afwezigheid aan';

$lang['menu_calendar_title'] = 'Agenda\'s';
$lang['menu_calendar_year'] = 'jaarkalender';
$lang['menu_calendar_individual'] = 'Mijn agenda';
$lang['menu_calendar_workmates'] = 'Mijn collega\'s';
$lang['menu_calendar_collaborators'] = 'Mijn medewerkers';
$lang['menu_calendar_department'] = 'Afdeling';
$lang['menu_calendar_organization'] = 'Globaal';
$lang['menu_calendar_tabular'] = 'Tabel';
<?php
/**
* Translation file
* @copyright Copyright (c) 2014-2016 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.1.0
* @author Roger WOLFS
*/

$lang['menu_banner_change_password'] = 'Nieuw wachtwoord';
$lang['menu_banner_welcome'] = 'Welkom';
$lang['menu_banner_logout'] = 'Uitloggen';
$lang['menu_banner_tip_myprofile'] = 'Bekijk persoonlijke informatie';
$lang['menu_banner_tip_reset'] = 'Reset wachtwoord';

$lang['menu_password_popup_title'] = 'Nieuw wachtwoord';
$lang['menu_password_popup_button_cancel'] = 'Annuleren';

$lang['menu_admin_title'] = 'Admin';
$lang['menu_admin_list_users'] = 'Lijst gebruikers';
$lang['menu_admin_add_user'] = 'Maak gebruiker aan';
$lang['menu_admin_settings_divider'] = 'Settings';
$lang['menu_admin_settings'] = 'Settings';
$lang['menu_admin_diagnostic'] = 'Diagnostic';

$lang['menu_hr_title'] = 'HR';
$lang['menu_hr_employees_divider'] = 'Werknemers';
$lang['menu_hr_list_organization'] = 'Organisatie';
$lang['menu_hr_list_employees'] = 'Lijst werknemers';
$lang['menu_hr_contracts_divider'] = 'Contracten';
$lang['menu_hr_list_contracts'] = 'Lijst contracten';
$lang['menu_hr_list_positions'] = 'Lijst functies';
$lang['menu_hr_leaves_type_divider'] = 'Afwezigheid';
$lang['menu_hr_list_leaves_type'] = 'Lijst types';
$lang['menu_hr_reports_divider'] = 'Rapporten';
$lang['menu_hr_report_leave_balance'] = 'Afwezigheidssaldo';
$lang['menu_hr_report_leaves'] = 'Leave requests';

$lang['menu_validation_title'] = 'Validatie';
$lang['menu_validation_delegations'] = 'Delegaties';
$lang['menu_validation_collaborators'] = 'Mijn medewerkers';
$lang['menu_validation_leaves'] = 'Afwezigheid';
$lang['menu_validation_overtime'] = 'Overuren';

$lang['menu_requests_title'] = 'Verzoeken';
$lang['menu_requests_leaves'] = 'Afwezigheid';
$lang['menu_requests_overtime'] = 'Overuren';
$lang['menu_requests_list_extras'] = 'Lijst van overuren';
$lang['menu_requests_request_extra'] = 'Aanmelding overuren';

$lang['menu_leaves_counters'] = 'Tellers';
$lang['menu_leaves_list_requests'] = 'Overzicht van afwezigheidsverzoeken';
$lang['menu_leaves_create_request'] = 'Vraag afwezigheid aan';

$lang['menu_calendar_title'] = 'Agenda\'s';
$lang['menu_calendar_year'] = 'jaarkalender';
$lang['menu_calendar_individual'] = 'Mijn agenda';
$lang['menu_calendar_workmates'] = 'Mijn collega\'s';
$lang['menu_calendar_collaborators'] = 'Mijn medewerkers';
$lang['menu_calendar_department'] = 'Afdeling';
$lang['menu_calendar_organization'] = 'Globaal';
$lang['menu_calendar_tabular'] = 'Tabel';
48 changes: 48 additions & 0 deletions application/language/english/admin_lang.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
/**
* Translation file
* @copyright Copyright (c) 2014-2016 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.4.6
*/

$lang['admin_diagnostic_title'] = 'Data & Config Diagnostic';
$lang['admin_diagnostic_description'] = 'Detection of configuration and data problems';
$lang['admin_diagnostic_no_error'] = 'No error';

$lang['admin_diagnostic_requests_tab'] = 'Leave Requests';
$lang['admin_diagnostic_requests_description'] = 'Accepted but duplicated Leave Requests';
$lang['admin_diagnostic_requests_thead_id'] = 'ID';
$lang['admin_diagnostic_requests_thead_employee'] = 'Employee';
$lang['admin_diagnostic_requests_thead_start_date'] = 'Start Date';
$lang['admin_diagnostic_requests_thead_status'] = 'Status';
$lang['admin_diagnostic_requests_thead_type'] = 'Type';

$lang['admin_diagnostic_datetype_tab'] = 'Afternoon/Morning';
$lang['admin_diagnostic_datetype_description'] = 'Leave Requests with a wrong start/end type.';
$lang['admin_diagnostic_datetype_thead_id'] = 'ID';
$lang['admin_diagnostic_datetype_thead_employee'] = 'Employee';
$lang['admin_diagnostic_datetype_thead_start_date'] = 'Date';
$lang['admin_diagnostic_datetype_thead_start_type'] = 'Start';
$lang['admin_diagnostic_datetype_thead_end_type'] = 'End';
$lang['admin_diagnostic_datetype_thead_status'] = 'Status';

$lang['admin_diagnostic_entitlements_tab'] = 'Entitled days';
$lang['admin_diagnostic_entitlements_description'] = 'List of contracts and employees having entitlements for more than one year.';
$lang['admin_diagnostic_entitlements_thead_id'] = 'ID';
$lang['admin_diagnostic_entitlements_thead_type'] = 'Type';
$lang['admin_diagnostic_entitlements_thead_name'] = 'Name';
$lang['admin_diagnostic_entitlements_thead_start_date'] = 'Start Date';
$lang['admin_diagnostic_entitlements_thead_end_date'] = 'End Date';
$lang['admin_diagnostic_entitlements_type_contract'] = 'Contract';
$lang['admin_diagnostic_entitlements_type_employee'] = 'Employee';
$lang['admin_diagnostic_entitlements_deletion_problem'] = 'Incomplete deletion into database.' ;

$lang['admin_diagnostic_daysoff_tab'] = 'Non-working days';
$lang['admin_diagnostic_daysoff_description'] = 'Number of days (per contract) for which a non-working duration has been defined.';
$lang['admin_diagnostic_daysoff_thead_id'] = 'ID';
$lang['admin_diagnostic_daysoff_thead_name'] = 'Name';
$lang['admin_diagnostic_daysoff_thead_ym1'] = 'Last year';
$lang['admin_diagnostic_daysoff_thead_y'] = 'This year';
$lang['admin_diagnostic_daysoff_thead_yp1'] = 'Next year';
Loading

0 comments on commit 9d1e734

Please sign in to comment.