From: Nik Okuntseff Date: Thu, 22 Feb 2018 21:28:50 +0000 (+0000) Subject: Added description field to tt_roles. X-Git-Tag: timetracker_1.19-1~1095 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=2dbf96e395377914a401aa3a635fce1120780b8f;p=timetracker.git Added description field to tt_roles. --- diff --git a/WEB-INF/lib/ttTeamHelper.class.php b/WEB-INF/lib/ttTeamHelper.class.php index 2ae75923..e306ced8 100644 --- a/WEB-INF/lib/ttTeamHelper.class.php +++ b/WEB-INF/lib/ttTeamHelper.class.php @@ -269,7 +269,7 @@ class ttTeamHelper { $result = array(); $mdb2 = getConnection(); - $sql = "select id, name, rights from tt_roles where team_id = $team_id and status = 1 order by upper(name)"; + $sql = "select id, name, description from tt_roles where team_id = $team_id and status = 1 order by upper(name)"; $res = $mdb2->query($sql); $result = array(); if (!is_a($res, 'PEAR_Error')) { @@ -286,7 +286,7 @@ class ttTeamHelper { $result = array(); $mdb2 = getConnection(); - $sql = "select id, name, rights from tt_roles + $sql = "select id, name, description from tt_roles where team_id = $team_id and status = 0 order by upper(name)"; $res = $mdb2->query($sql); $result = array(); diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index e2efb0c9..baedc2cb 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- - + @@ -19,9 +19,9 @@ {foreach $active_roles as $role} - - - + + + {/foreach} {/if} @@ -40,7 +40,7 @@ - + @@ -48,8 +48,8 @@ - - + + {/foreach}
 Anuko Time Tracker 1.17.29.4016 | Copyright © Anuko | +  Anuko Time Tracker 1.17.30.4017 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/roles.tpl b/WEB-INF/templates/roles.tpl index b93d0ef2..51c8d99e 100644 --- a/WEB-INF/templates/roles.tpl +++ b/WEB-INF/templates/roles.tpl @@ -11,7 +11,7 @@ {/if}
{$i18n.label.thing_name}{$i18n.form.roles.rights}{$i18n.label.description} {$i18n.label.edit} {$i18n.label.delete}
{$role.name|escape}{$role.rights|escape}{$i18n.label.edit}{$i18n.label.delete}{$role.description|escape}{$i18n.label.edit}{$i18n.label.delete}
{$i18n.form.roles.inactive_roles}
{$i18n.label.thing_name}{$i18n.form.roles.rights}{$i18n.label.description} {$i18n.label.edit} {$i18n.label.delete}
{$role.name|escape} {$role.rights|escape}{$i18n.label.edit}{$i18n.label.delete}{$i18n.label.edit}{$i18n.label.delete}
diff --git a/dbinstall.php b/dbinstall.php index 491330f2..6dc831ae 100755 --- a/dbinstall.php +++ b/dbinstall.php @@ -709,7 +709,7 @@ if ($_POST) { setChange("ALTER TABLE `tt_log` ADD `paid` tinyint(4) NULL default '0' AFTER `billable`"); } - if ($_POST["convert11400to11728"]) { + if ($_POST["convert11400to11730"]) { setChange("ALTER TABLE `tt_teams` DROP `address`"); setChange("ALTER TABLE `tt_fav_reports` ADD `report_spec` text default NULL AFTER `user_id`"); setChange("ALTER TABLE `tt_fav_reports` ADD `paid_status` tinyint(4) default NULL AFTER `invoice`"); @@ -731,6 +731,7 @@ if ($_POST) { setChange("ALTER TABLE `tt_tmp_refs` MODIFY `timestamp` timestamp default CURRENT_TIMESTAMP"); setChange("CREATE TABLE `tt_roles` (`id` int(11) NOT NULL auto_increment, `team_id` int(11) NOT NULL, `name` varchar(80) default NULL, `rank` int(11) default 0, `rights` text default NULL, `status` tinyint(4) default 1, PRIMARY KEY (`id`))"); setChange("create unique index role_idx on tt_roles(team_id, rank, status)"); + setChange("ALTER TABLE `tt_roles` ADD `description` varchar(255) default NULL AFTER `name`"); } if ($_POST["cleanup"]) { @@ -776,7 +777,7 @@ if ($_POST) {

DB Install

-
Create database structure (v1.17.28) + Create database structure (v1.17.30)
(applies only to new installations, do not execute when updating)
@@ -812,8 +813,8 @@ if ($_POST) {
- Update database structure (v1.14 to v1.17.28) -
+ Update database structure (v1.14 to v1.17.30) +
diff --git a/mysql.sql b/mysql.sql index 8bfc2219..a69387b3 100644 --- a/mysql.sql +++ b/mysql.sql @@ -386,21 +386,22 @@ ALTER TABLE `tt_monthly_quotas` # Structure for table tt_roles. This table stores customized team roles. # CREATE TABLE `tt_roles` ( - `id` int(11) NOT NULL auto_increment, # Role id. Identifies roles for all groups on the server. - `team_id` int(11) NOT NULL, # Team id the role is defined for. - `name` varchar(80) default NULL, # Role name - custom role name. In case we are editing a - # predefined role (USER, etc.), we can rename the role here. - `rank` int(11) default 0, # Role rank, an integer value between 0-324. Predefined role ranks: - # USER - 4, CLIENT - 16, COMANAGER - 68, MANAGER - 324. - # Rank is used to determine what "lesser roles" are in each group - # for sutuations such as "manage_users". - # It also identifies a role within a team (by its "rank"). - # Value of rank is to be used in role field in tt_users table, - # just like standard roles now. - `rights` text default NULL, # Comma-separated list of rights assigned to a role. - # NULL here for predefined roles (4, 16, 68, 324 - manager) - # means a hard-coded set of default access rights. - `status` tinyint(4) default 1, # Role status. + `id` int(11) NOT NULL auto_increment, # Role id. Identifies roles for all groups on the server. + `team_id` int(11) NOT NULL, # Team id the role is defined for. + `name` varchar(80) default NULL, # Role name - custom role name. In case we are editing a + # predefined role (USER, etc.), we can rename the role here. + `description` varchar(255) default NULL, # Role description. + `rank` int(11) default 0, # Role rank, an integer value between 0-324. Predefined role ranks: + # USER - 4, CLIENT - 16, COMANAGER - 68, MANAGER - 324. + # Rank is used to determine what "lesser roles" are in each group + # for sutuations such as "manage_users". + # It also identifies a role within a team (by its "rank"). + # Value of rank is to be used in role field in tt_users table, + # just like standard roles now. + `rights` text default NULL, # Comma-separated list of rights assigned to a role. + # NULL here for predefined roles (4, 16, 68, 324 - manager) + # means a hard-coded set of default access rights. + `status` tinyint(4) default 1, # Role status. PRIMARY KEY (`id`) );