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 @@