From 4f881e939586d30868fb977a61ce6cfe264d473f Mon Sep 17 00:00:00 2001 From: Quitta Date: Mon, 15 Jul 2013 21:18:51 +0200 Subject: [PATCH] Show single group and there users almost done --- .../ams_lib/autoload/support_group.php | 11 +++ .../ryzom_ams/ams_lib/translations/en.ini | 2 + .../ryzom_ams/ams_lib/translations/fr.ini | 2 + .../ryzom_ams/www/html/inc/sgroup_list.php | 4 +- .../ryzom_ams/www/html/inc/show_sgroup.php | 36 +++++++ .../www/html/templates/sgroup_list.tpl | 3 +- .../www/html/templates/show_sgroup.tpl | 97 +++++++++++++++++++ 7 files changed, 150 insertions(+), 5 deletions(-) create mode 100644 code/ryzom/tools/server/ryzom_ams/www/html/inc/show_sgroup.php create mode 100644 code/ryzom/tools/server/ryzom_ams/www/html/templates/show_sgroup.tpl diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/support_group.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/support_group.php index b70d93666..be4399a75 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/support_group.php +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/support_group.php @@ -8,6 +8,17 @@ class Support_Group{ ////////////////////////////////////////////Functions//////////////////////////////////////////////////// + //return all groups + public static function getGroup($id) { + $dbl = new DBLayer("lib"); + $statement = $dbl->execute("SELECT * FROM support_group WHERE SGroupId = :id", array('id' => $id)); + $row = $statement->fetch(); + $instanceGroup = new self(); + $instanceGroup->set($row); + return $instanceGroup; + + } + //return all groups public static function getGroups() { $dbl = new DBLayer("lib"); diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/en.ini b/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/en.ini index d44423e22..babd587e0 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/en.ini +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/en.ini @@ -31,6 +31,8 @@ t_send = "Send reply" [show_queue] +[show_sgroup] + [sgroup_list] group_success = "The group has been created!" group_name_taken = "The groupname was already used!" diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/fr.ini b/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/fr.ini index fde9c20a5..c9d6d64c0 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/fr.ini +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/fr.ini @@ -31,6 +31,8 @@ t_send = "Envoyer la reponse" [show_queue] +[show_sgroup] + [sgroup_list] group_success = "le group est cree!" group_name_taken = "le nom pour le group est deja utilise!" diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/inc/sgroup_list.php b/code/ryzom/tools/server/ryzom_ams/www/html/inc/sgroup_list.php index 590b56ef0..061fa3daf 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/inc/sgroup_list.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/inc/sgroup_list.php @@ -1,13 +1,11 @@ getName(); + $result['grouplist'] = Gui_Elements::make_table(Support_Group::getGroups(), Array("getSGroupId","getName","getTag"), Array("sGroupId","name","tag")); + return $result; + + }else{ + + //ERROR: No page specified! + $_SESSION['error_code'] = "404"; + header("Location: index.php?page=error"); + exit; + } + + }else{ + //ERROR: No access! + $_SESSION['error_code'] = "403"; + header("Location: index.php?page=error"); + exit; + } + }else{ + //ERROR: not logged in! + header("Location: index.php"); + exit; + } + +} \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/sgroup_list.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/sgroup_list.tpl index 9a3bc2e07..75595f230 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/sgroup_list.tpl +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/sgroup_list.tpl @@ -34,7 +34,6 @@ -
@@ -92,7 +91,7 @@ {foreach from=$grouplist item=group} {$group.sGroupId} - {$group.name} + {$group.name} {$group.tag} Delete diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_sgroup.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_sgroup.tpl new file mode 100644 index 000000000..7e7a3e413 --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_sgroup.tpl @@ -0,0 +1,97 @@ +{block name=content} +
+
+
+

Add User

+
+ + +
+
+
+
+ +
+ + Add a user to the group '{$groupsname}' + +
+ +
+
+ +
+
+
+ + + +
+ +
+ +
+
+ + {if isset($RESULT_OF_ADDING) and $RESULT_OF_ADDING eq "SUCCESS"} +
+ {$group_success} +
+ {else if isset($RESULT_OF_ADDING) and $RESULT_OF_ADDING eq "NAME_TAKEN"} +
+ {$group_name_taken} +
+ {else if isset($RESULT_OF_ADDING) and $RESULT_OF_ADDING eq "TAG_TAKEN"} +
+ {$group_tag_taken} +
+ {else if isset($RESULT_OF_ADDING) and $RESULT_OF_ADDING eq "SIZE_ERROR"} +
+ {$group_size_error} +
+ {/if} +
+ +
+
+
+
+ +
+
+
+

{$groupsname} List

+
+ + +
+
+
+
+ All support groups + + + + + + + + + + {foreach from=$grouplist item=group} + + + + + + + {/foreach} + + +
IDName
{$group.sGroupId}{$group.name}{$group.tag} Delete
+
+
+
+
+{/block} +