From 44efb05c95de2fb4b493d13ef756764eaf9eae80 Mon Sep 17 00:00:00 2001 From: Rodrigo Goncalves Date: Wed, 20 Jan 2016 07:03:57 -0200 Subject: [PATCH] Ajustes para OTRS 5.0.x --- AgentsPerQueue.sopm | 7 ++++--- CreateOpm.sh | 4 ++-- Kernel/Output/HTML/Standard/AgentsPerQueue.tt | 36 ------------------------------------ Kernel/Output/HTML/Templates/Standard/AgentsPerQueue.tt | 36 ++++++++++++++++++++++++++++++++++++ SQLs.txt | 24 ++++++++++++++++++++++++ 5 files changed, 66 insertions(+), 41 deletions(-) delete mode 100644 Kernel/Output/HTML/Standard/AgentsPerQueue.tt create mode 100644 Kernel/Output/HTML/Templates/Standard/AgentsPerQueue.tt create mode 100644 SQLs.txt diff --git a/AgentsPerQueue.sopm b/AgentsPerQueue.sopm index 27c368a..4162569 100755 --- a/AgentsPerQueue.sopm +++ b/AgentsPerQueue.sopm @@ -1,12 +1,13 @@ AgentsPerQueue - 1.1.0 - 4.0.x + 1.2.0 + 5.0.x SeTIC - UFSC http://setic.ufsc.br GPLv2 Agents per queue + Adjustments for OTRS 5.0.x Adjustments for OTRS 4.0.4 Agents per queue module Agents per queue module installed successfully! @@ -16,6 +17,6 @@ - + \ No newline at end of file diff --git a/CreateOpm.sh b/CreateOpm.sh index 4d3c82e..81a42e9 100755 --- a/CreateOpm.sh +++ b/CreateOpm.sh @@ -1,5 +1,5 @@ #!/bin/bash LOCAL="$PWD" -cd /opt/otrs/bin -./otrs.PackageManager.pl -a build -p "$LOCAL"/AgentsPerQueue.sopm -o "$LOCAL"/ +cd /opt/otrs +bin/otrs.Console.pl Dev::Package::Build "$LOCAL"/AgentsPerQueue.sopm "$LOCAL"/ cd $LOCAL diff --git a/Kernel/Output/HTML/Standard/AgentsPerQueue.tt b/Kernel/Output/HTML/Standard/AgentsPerQueue.tt deleted file mode 100644 index 5874936..0000000 --- a/Kernel/Output/HTML/Standard/AgentsPerQueue.tt +++ /dev/null @@ -1,36 +0,0 @@ -# -- -# ResponsibilityMatrix.tt - provides HTML for ResponsibilityMatrix -# -# Copyright (C) 2014 SeTIC - UFSC - http://setic.ufsc.br/ -# Version 01/15/2015 - Adjustments for OTRS 4 -# -# -# This software comes with ABSOLUTELY NO WARRANTY. For details, see -# the enclosed file COPYING for license information (AGPL). If you -# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. -# -- -# - -

[% Translate("Queues per agent") | html %]

- - - - - - - - - - -[% RenderBlockStart("QueuesPerAgent") %] - - - - -[% RenderBlockEnd("QueuesPerAgent") %] - -
[% Translate("ID") | html %][% Translate("Agent") | html %][% Translate("Paths") | html %][% Translate("Queues") | html %]
[% Data.ID %][% Data.Agent %] -
[% Data.Paths %]
-
-
[% Data.Queues %]
-
\ No newline at end of file diff --git a/Kernel/Output/HTML/Templates/Standard/AgentsPerQueue.tt b/Kernel/Output/HTML/Templates/Standard/AgentsPerQueue.tt new file mode 100644 index 0000000..5874936 --- /dev/null +++ b/Kernel/Output/HTML/Templates/Standard/AgentsPerQueue.tt @@ -0,0 +1,36 @@ +# -- +# ResponsibilityMatrix.tt - provides HTML for ResponsibilityMatrix +# +# Copyright (C) 2014 SeTIC - UFSC - http://setic.ufsc.br/ +# Version 01/15/2015 - Adjustments for OTRS 4 +# +# +# This software comes with ABSOLUTELY NO WARRANTY. For details, see +# the enclosed file COPYING for license information (AGPL). If you +# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. +# -- +# + +

[% Translate("Queues per agent") | html %]

+ + + + + + + + + + +[% RenderBlockStart("QueuesPerAgent") %] + + + + +[% RenderBlockEnd("QueuesPerAgent") %] + +
[% Translate("ID") | html %][% Translate("Agent") | html %][% Translate("Paths") | html %][% Translate("Queues") | html %]
[% Data.ID %][% Data.Agent %] +
[% Data.Paths %]
+
+
[% Data.Queues %]
+
\ No newline at end of file diff --git a/SQLs.txt b/SQLs.txt new file mode 100644 index 0000000..d42e7be --- /dev/null +++ b/SQLs.txt @@ -0,0 +1,24 @@ +select + 'Manage' AS `type`, + concat(`d`.`first_name`,' ',`d`.`last_name`) AS `user`, + `a`.`name` AS `queue` +from + (((`queue` `a` join `group_role` `b` on((`b`.`group_id` = `a`.`group_id`))) + join `role_user` `c` on((`c`.`role_id` = `b`.`role_id`))) + join `users` `d` on((`d`.`id` = `c`.`user_id`))) +where + ((`a`.`valid_id` = 1) and (`b`.`permission_key` = 'rw') and + (`b`.`permission_value` = 1) and ((`a`.`name` like 'N3%') or (`a`.`name` like 'N2%')) and (`d`.`valid_id` = 1)) +union + select 'Path' AS `type`,concat(`d`.`first_name`,' ',`d`.`last_name`) AS `user`, + `a`.`name` AS `queue` from (((`queue` `a` join `group_role` `b` on((`b`.`group_id` = `a`.`group_id`))) + join `role_user` `c` on((`c`.`role_id` = `b`.`role_id`))) join `users` `d` on((`d`.`id` = `c`.`user_id`))) + where ((`a`.`valid_id` = 1) and (`d`.`valid_id` = 1) and (`b`.`permission_key` = 'move_into') + and (`b`.`permission_value` = 1) and (`a`.`name` like 'N2%') and (not(exists(select `a1`.`id` + from ((`queue` `a1` join `group_role` `b1` on((`b1`.`group_id` = `a1`.`group_id`))) + join `role_user` `c1` on((`c1`.`role_id` = `b1`.`role_id`))) where ((`a1`.`valid_id` = 1) + and (`b1`.`permission_key` = 'rw') and (`b1`.`permission_value` = 1) and (`a1`.`name` like 'N2%') and + (`c1`.`user_id` = `d`.`id`))))) and (not(exists(select `a1`.`id` from ((`queue` `a1` join `group_role` `b1` + on((`b1`.`group_id` = `a1`.`group_id`))) join `role_user` `c1` on((`c1`.`role_id` = `b1`.`role_id`))) + where ((`a1`.`valid_id` = 1) and (`b1`.`permission_key` = 'rw') and (`b1`.`permission_value` = 1) + and (`a1`.`name` like 'Primeiro%') and (`c1`.`user_id` = `d`.`id`)))))) -- libgit2 0.21.2