var $lock_spec = null; // Cron specification for record locking.
var $workday_minutes = 480; // Number of work minutes in a regular day.
var $rights = 0; // A mask of user rights.
+ var $rights_array = array(); // An array of user rights, planned replacement of array mask.
// Constructor.
function __construct($login, $id = null) {
// Set user rights.
if ($this->role == ROLE_USER) {
$this->rights = right_data_entry|right_view_charts|right_view_reports;
+ // TODO: get customized rights from the database instead.
+ $this->rights_array[] = "data_entry"; // Right to enter time and expense records into Time Tracker.
+ $this->rights_array[] = "view_own_reports"; // Right to view own reports (for a specific user).
+ $this->rights_array[] = "view_own_charts"; // Right to view own charts (for a specific user).
} elseif ($this->role == ROLE_CLIENT) {
$this->rights = right_view_reports|right_view_invoices; // TODO: how about right_view_charts, too?
+ $this->rights_array[] = "view_client_reports"; // Right to view reports for a specific client.
+ $this->rights_array[] = "view_client_charts"; // Right to view charts for a specific client.
+ $this->rights_array[] = "view_client_invoices"; // Right to view invoices for a specific client.
} elseif ($this->role == ROLE_COMANAGER) {
$this->rights = right_data_entry|right_view_charts|right_view_reports|right_view_invoices|right_manage_team;
} elseif ($this->role == ROLE_MANAGER) {
$this->rights = right_administer_site;
}
+/*
+// TODO: redesign of user rights and roles is currently ongoing.
+// As we run our of bits for sure at some point, rights should be strings instead,
+// for example: "data_entry".
+// Also, we need rights editor page and team-customized roles.
+// Move this stuff from here to ttUser class.
+//
+// User access rights - bits that collectively define an access mask to the system (a role).
+// We'll have some bits here (1,2, etc...) reserved for future use.
+define('right_data_entry', 4); // Right to enter work hours and expenses.
+define('right_view_charts', 8); // Right to view charts.
+define('right_view_reports', 16); // Right to view reports.
+define('right_view_invoices', 32); // Right to view invoices.
+define('right_manage_team', 64); // Right to manage team. Note that this is not full access to team.
+define('right_assign_roles', 128); // Right to assign user roles.
+define('right_export_team', 256); // Right to export team data to a file.
+define('right_administer_site', 1024); // Admin account right to manage the application as a whole.
+
+// User roles.
+define('ROLE_USER', 4); // Regular user.
+define('ROLE_CLIENT', 16); // Client (to view reports and invoices).
+define('ROLE_COMANAGER', 68); // Team co-manager. Can do many things but not as much as team manager.
+define('ROLE_MANAGER', 324); // Team manager. Can do everything for a team.
+define('ROLE_SITE_ADMIN', 1024); // Site administrator.
+*/
+
// Adjust punch_in_mode for managers as they are allowed to overwrite start and end times.
if ($this->canManageTeam()) $this->punch_in_mode = 0;
}
'menu.tasks' => 'Compiti',
'menu.users' => 'Utenti',
'menu.teams' => 'Gruppi',
-'menu.export' => 'Esportazione', // TODO: is this correct? Also, I auto-translated some other terms in menu section. Check for accuracy.
+'menu.export' => 'Esportazione',
'menu.clients' => 'Clienti',
'menu.options' => 'Opzioni',
'error.not_equal' => 'Il campo "{0}" non è uguale al campo "{1}".',
'error.interval' => 'Il campo "{0}" deve essere maggiore di "{1}".',
'error.project' => 'Seleziona il progetto.',
-'error.task' => 'Seleziona compito.', // TODO: is this correct?
+'error.task' => 'Seleziona compito.',
'error.client' => 'Seleziona il cliente.',
'error.report' => 'Seleziona rapporto.',
'error.record' => 'Seleziona record.',
'error.auth' => 'Login o password errati.',
'error.user_exists' => 'Esiste già un utente con questo username.',
'error.project_exists' => 'Esiste già un progetto con questo nome.',
-'error.task_exists' => 'Esiste già un compito con questo nome.', // TODO: is this correct? "un compito"?
+'error.task_exists' => 'Esiste già un compito con questo nome.',
'error.client_exists' => 'Esiste già un cliente con questo nome.',
'error.invoice_exists' => 'Esiste già una fattura con questo numero.',
'error.no_invoiceable_items' => 'Non ci sono voci fatturabili.',
'label.client_address' => 'Indirizzo cliente',
'label.or' => 'o',
'label.error' => 'Errore',
-'label.ldap_hint' => 'Digita il tuo <b>Login Windows</b> e la tua <b>password</b> nei campi qui sotto.', // TODO: il tuo and then la tua? Improve?
+'label.ldap_hint' => 'Digita il tuo <b>Login Windows</b> e la tua <b>password</b> nei campi qui sotto.',
'label.required_fields' => '* campi obbligatori',
'label.on_behalf' => 'a favore di',
'label.role_manager' => '(manager)',
'label.custom_fields' => 'Campi personalizzati',
'label.monthly_quotas' => 'Quote mensili',
'label.type' => 'Tipo',
-'label.type_dropdown' => 'scelta multipla', // TODO: translation looks incorrect, a dropdown control is a single choice.
+'label.type_dropdown' => 'menu a tendina',
'label.type_text' => 'testo',
'label.required' => 'Obbligatorio',
'label.fav_report' => 'Rapporto preferito',
-// 'label.cron_schedule' => 'Cron schedule', // TODO: how about "Programma cron" here?
+'label.cron_schedule' => 'Cron programmata',
'label.what_is_it' => 'Cosa è?',
'label.expense' => 'Spesa',
'label.quantity' => 'Quantità',
'title.edit_project' => 'Modifica progetto',
'title.delete_project' => 'Elimina progetto',
'title.tasks' => 'Compiti',
-'title.add_task' => 'Aggiungi compito', // TODO: is this correct?
+'title.add_task' => 'Aggiungi compito',
'title.edit_task' => 'Modifica compito',
'title.delete_task' => 'Eliminazione compito',
'title.users' => 'Utenti',
// Profile form. See example at https://timetracker.anuko.com/profile_edit.php.
'form.profile.12_hours' => '12 ore',
'form.profile.24_hours' => '24 ore',
-// // TODO: translate the following.
-// 'form.profile.show_holidays' => 'Show holidays',
+'form.profile.show_holidays' => 'Mostra vacanze',
'form.profile.tracking_mode' => 'Modalità di registrazione',
'form.profile.mode_time' => 'tempo',
'form.profile.mode_projects' => 'progetti',
// 'form.profile.allow_overlap' => 'Allow overlap',
// 'form.profile.future_entries' => 'Future entries',
'form.profile.uncompleted_indicators' => 'Indicatori incompleti',
-// TODO: translate the following. If the translation is the same word, indicate so. Plugini, perhaps?
-// 'form.profile.plugins' => 'Plugins',
+'form.profile.plugins' => 'Plugin',
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'Da',