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 005f775c1..c42d12efb 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 @@ -60,9 +60,10 @@ class Support_Group{ * @return a string that specifies if it was a success or not (SUCCESS, SIZE_ERROR, NAME_TAKEN or TAG_TAKEN ) */ public static function createSupportGroup( $name, $tag, $groupemail, $imap_mailserver, $imap_username, $imap_password) { - - if(strlen($name) < 21 && strlen($name) > 4 &&strlen($tag) < 8 && strlen($tag) > 1 ){ + error_log( "Error at line " . __LINE__ . " in file " . __FILE__); + if(strlen($name) <= 21 && strlen($name) >= 4 &&strlen($tag) <= 8 && strlen($tag) >= 2 ){ $notExists = self::supportGroup_EntryNotExists($name, $tag); + error_log( "Error at line " . __LINE__ . " in file " . __FILE__); if ( $notExists == "SUCCESS" ){ $sGroup = new self(); $values = array('Name' => $name, 'Tag' => $tag, 'GroupEmail' => $groupemail, 'IMAP_MailServer' => $imap_mailserver, 'IMAP_Username' => $imap_username, 'IMAP_Password' => $imap_password); @@ -79,12 +80,14 @@ class Support_Group{ $sGroup->setIMAP_Password($enc_password); $sGroup->create(); - return "SUCCESS"; + error_log( "Error at line " . __LINE__ . " in file " . __FILE__); }else{ + error_log( "Error at line " . __LINE__ . " in file " . __FILE__); //return NAME_TAKEN or TAG_TAKEN return $notExists; } }else{ + error_log( "Error at line " . __LINE__ . " in file " . __FILE__); //RETURN ERROR that indicates SIZE return "SIZE_ERROR"; } diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue.php index e72f1024d..03b2d6729 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue.php +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue.php @@ -84,14 +84,18 @@ class Ticket_Queue{ if($who == "user"){ $selectfrom = "SELECT * FROM `ticket` t LEFT JOIN `assigned` a ON t.TId = a.Ticket LEFT JOIN `ticket_user` tu ON tu.TUserId = a.User"; - if ($how == "assigned"){ + if ($how == "both"){ + $assign = ""; + }else if ($how == "assigned"){ $assign = "tu.TUserId = :id" ; }else if ($how == "not_assigned"){ $assign = "(tu.TUserId != :id OR a.Ticket IS NULL)"; } }else if ($who == "support_group"){ $selectfrom = "SELECT * FROM `ticket` t LEFT JOIN `assigned` a ON t.TId = a.Ticket LEFT JOIN `ticket_user` tu ON tu.TUserId = a.User LEFT JOIN `forwarded` f ON t.TId = f.Ticket"; - if ($how == "assigned"){ + if ($how == "both"){ + $assign = ""; + }else if ($how == "assigned"){ $assign = "f.Group = :id"; }else if ($how == "not_assigned"){ $assign = "(f.Group != :id OR f.Ticket IS NULL)" ; @@ -101,23 +105,34 @@ class Ticket_Queue{ if ($what == "waiting_for_support"){ $status = "t.Status = 1"; - }else if ($what == "waiting_for_user"){ + }else if ($what == "waiting_for_users"){ $status = "t.Status = 0"; }else if ($what == "closed"){ $status = "t.Status = 3"; } - $query = $selectfrom ." WHERE " . $assign; - if(isset($status)){ - $query = $query . " AND " . $status; + if ($assign == "") { + $query = $selectfrom; + if(isset($status)){ + $query = $query . " WHERE " . $status; + } + } else { + $query = $selectfrom ." WHERE " . $assign; + if(isset($status)){ + $query = $query . " AND " . $status; + } } + + if($who == "user"){ $params = array('id' => $userid); }else if ($who == "support_group"){ $params = array('id' => $groupid); } + $this->query = $query; $this->params = $params; + //print_r($this); } diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/sgroup_list.tpl b/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/sgroup_list.tpl index 3a6dcc52f..3008b320e 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/sgroup_list.tpl +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/sgroup_list.tpl @@ -35,7 +35,7 @@

Add a Support group

-
+
diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/func/add_sgroup.php b/code/ryzom/tools/server/ryzom_ams/www/html/func/add_sgroup.php index 14a9b9f87..22fab8102 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/func/add_sgroup.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/func/add_sgroup.php @@ -23,20 +23,20 @@ function add_sgroup(){ //create a new support group $result['RESULT_OF_ADDING'] = Support_Group::createSupportGroup($name, $tag, $groupemail, $imap_mailserver, $imap_username, $imap_password); - //$result['permission'] = unserialize($_SESSION['ticket_user'])->getPermission(); - //$result['no_visible_elements'] = 'FALSE'; - //$result['username'] = $_SESSION['user']; - //global $SITEBASE; - //require($SITEBASE . '/inc/sgroup_list.php'); - //$result= array_merge($result, sgroup_list()); - //return helpers :: loadtemplate( 'sgroup_list', $result, true); - if (Helpers::check_if_game_client()) { + $result['permission'] = unserialize($_SESSION['ticket_user'])->getPermission(); + $result['no_visible_elements'] = 'FALSE'; + $result['username'] = $_SESSION['user']; + global $SITEBASE; + require($SITEBASE . '/inc/sgroup_list.php'); + $result= array_merge($result, sgroup_list()); + return $result; + /*if (Helpers::check_if_game_client()) { header("Location: ".$INGAME_WEBPATH."?page=sgroup_list"); }else{ header("Location: ".$WEBPATH."?page=sgroup_list"); } exit; - + */ }else{ //ERROR: No access! $_SESSION['error_code'] = "403"; diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_sgroup.php b/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_sgroup.php index 76dbe7b18..b35802551 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_sgroup.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_sgroup.php @@ -47,6 +47,16 @@ function show_sgroup(){ } global $INGAME_WEBPATH; $result['ingame_webpath'] = $INGAME_WEBPATH; + $result['teamlist'] = Gui_Elements::make_table(Ticket_User::getModsAndAdmins(), Array("getTUserId","getExternId"), Array("tUserId","externId")); + $i = 0; + foreach( $result['teamlist'] as $member){ + $web_teammember = new Webusers($member['externId']); + if (!In_Support_Group::userExistsInSGroup($member['externId'], $result['target_id'])) { + $result['users'][$i]['name'] = $web_teammember->getUsername(); + } + $i++; + } + return $result; diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/settings.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/settings.tpl index 599427946..4ea75af12 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/settings.tpl +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/settings.tpl @@ -125,6 +125,10 @@ + + +
+

Ticket updates

@@ -132,6 +136,8 @@
+ +
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 a139aec34..a8df71bd8 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 @@ -51,7 +51,7 @@
- + Add a support group diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_queue.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_queue.tpl index 5c8c9c31a..273322db6 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_queue.tpl +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_queue.tpl @@ -16,32 +16,33 @@ Show tickets to - + - + 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 index 921b0edd1..061731eab 100644 --- 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 @@ -54,9 +54,11 @@
-
- -
+
@@ -95,6 +97,9 @@
+ +
+

Modify Email Settings

@@ -172,7 +177,8 @@
-
+
+ {/if}