diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/config.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/config.php index 739ed8d02..ad9a05462 100644 --- a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/config.php +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/config.php @@ -73,7 +73,7 @@ $AMS_LIB = dirname( __FILE__ ) . '/ams_lib'; $AMS_TRANS = $AMS_LIB . '/translations'; $AMS_CACHEDIR = $AMS_LIB . '/cache'; $SITEBASE = dirname( __FILE__ ); -$WEBPATH ='http://localhost:40917' ; +$WEBPATH ='http://localhost:40917/drupal/sites/all/modules/ryzommanage/' ; //defines the default language $DEFAULT_LANGUAGE = 'en'; diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_queue.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_queue.php new file mode 100644 index 000000000..1567f8fa8 --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_queue.php @@ -0,0 +1,129 @@ +getTUserId(); + $queueArray = array(); + $queue_handler = new Ticket_Queue_handler(); + + //Pagination Base Links + $result['pagination_base_link'] = "ams?page=show_queue&get=".$result['queue_view'] ; + + //form url to keep the getters constant + $result['getURL'] = "ams?page=show_queue&get=" . $result['queue_view']; + if(isset($_GET['pagenum'])){ + $result['getURL'] = $result['getURL'] . "&pagenum=".$_GET['pagenum']; + } + + if(isset($_GET['get']) && ($_GET['get'] == "create") && isset($_GET['userid']) && isset($_GET['groupid']) && isset($_GET['what']) && isset($_GET['how']) && isset($_GET['who'])){ + $userid = filter_var($_GET['userid'], FILTER_SANITIZE_NUMBER_INT); + $groupid = filter_var($_GET['groupid'], FILTER_SANITIZE_NUMBER_INT); + $what = filter_var($_GET['what'], FILTER_SANITIZE_STRING); + $how = filter_var($_GET['how'], FILTER_SANITIZE_STRING); + $who = filter_var($_GET['who'], FILTER_SANITIZE_STRING); + $queue_handler->CreateQueue($userid, $groupid, $what, $how, $who); + $result['pagination_base_link'] = "ams?page=show_queue&get=create&userid=".$userid."&groupid=".$groupid."&what=".$what."&how=".$how."&who=".$who; + $result['prev_created_userid'] = $userid; + $result['prev_created_groupid'] = $groupid; + $result['prev_created_what'] = $what; + $result['prev_created_how'] = $how; + $result['prev_created_who'] = $who; + + $result['getURL'] = $result['getURL'] . "&userid=".$userid."&groupid=".$groupid."&what=".$what."&how=".$how."&who=".$who; + + } + + //if an action is set + if(isset($_POST['action'])){ + switch($_POST['action']){ + case "assignTicket": + $ticket_id = filter_var($_POST['ticket_id'], FILTER_SANITIZE_NUMBER_INT); + $result['ACTION_RESULT'] = Ticket::assignTicket($user_id, $ticket_id); + break; + + case "unAssignTicket": + $ticket_id = filter_var($_POST['ticket_id'], FILTER_SANITIZE_NUMBER_INT); + $result['ACTION_RESULT'] = Ticket::unAssignTicket($user_id, $ticket_id); + break; + + case "create_queue": + $userid = filter_var($_POST['userid'], FILTER_SANITIZE_NUMBER_INT); + $groupid = filter_var($_POST['groupid'], FILTER_SANITIZE_NUMBER_INT); + $what = filter_var($_POST['what'], FILTER_SANITIZE_STRING); + $how = filter_var($_POST['how'], FILTER_SANITIZE_STRING); + $who = filter_var($_POST['who'], FILTER_SANITIZE_STRING); + $queue_handler->CreateQueue($userid, $groupid, $what, $how, $who); + $result['pagination_base_link'] = "ams?page=show_queue&get=create&userid=".$userid."&groupid=".$groupid."&what=".$what."&how=".$how."&who=".$who; + $result['prev_created_userid'] = $userid; + $result['prev_created_groupid'] = $groupid; + $result['prev_created_what'] = $what; + $result['prev_created_how'] = $how; + $result['prev_created_who'] = $who; + $result['getURL'] = $result['getURL'] . "&userid=".$userid."&groupid=".$groupid."&what=".$what."&how=".$how."&who=".$who; + + break; + + } + } + + $queueArray = $queue_handler->getTickets($result['queue_view'], $user_id); + + //pagination + $result['links'] = $queue_handler->getPagination()->getLinks(5); + $result['lastPage'] = $queue_handler->getPagination()->getLast(); + $result['currentPage'] = $queue_handler->getPagination()->getCurrent(); + + + //if queue_view is a valid parameter value + if ($queueArray != "ERROR"){ + $result['tickets'] = Gui_Elements::make_table($queueArray, Array("getTId","getTitle","getTimestamp","getAuthor()->getExternId","getTicket_Category()->getName","getStatus","getStatusText","getAssigned","getForwardedGroupName","getForwardedGroupId"), Array("tId","title","timestamp","authorExtern","category","status","statusText","assigned","forwardedGroupName","forwardedGroupId")); + $i = 0; + foreach( $result['tickets'] as $ticket){ + $web_author = new WebUsers($ticket['authorExtern']); + $result['tickets'][$i]['author'] = $web_author->getUsername(); + $web_assigned = new WebUsers($ticket['assigned']); + $result['tickets'][$i]['assignedText'] = $web_assigned->getUsername(); + $result['tickets'][$i]['timestamp_elapsed'] = Gui_Elements::time_elapsed_string($ticket['timestamp']); + $i++; + } + $result['user_id'] = unserialize($_SESSION['ticket_user'])->getTUserId(); + + //Queue creator field info + $result['grouplist'] = Gui_Elements::make_table(Support_Group::getGroups(), Array("getSGroupId","getName"), Array("sGroupId","name")); + $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']); + $result['teamlist'][$i]['name'] = $web_teammember->getUsername(); + $i++; + } + return $result; + + }else{ + + //ERROR: Doesn't exist! + $_SESSION['error_code'] = "404"; + header("Location: ams?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/drupal_module/ryzommanage/inc/show_ticket_info.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_ticket_info.php new file mode 100644 index 000000000..1750d4058 --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_ticket_info.php @@ -0,0 +1,53 @@ +load_With_TId($result['ticket_id']); + + if( $target_ticket->hasInfo() && (($target_ticket->getAuthor() == unserialize($_SESSION['ticket_user'])->getTUserId()) || Ticket_User::isMod(unserialize($_SESSION['ticket_user']) ))){ + $result['ticket_title'] = $target_ticket->getTitle(); + $result['ticket_author'] = $target_ticket->getAuthor(); + + $ticket_info = new Ticket_Info(); + $ticket_info->load_With_Ticket($result['ticket_id']); + $result['shard_id'] = $ticket_info->getShardId(); + $result['user_position'] = $ticket_info->getUser_Position(); + $result['view_position'] = $ticket_info->getView_Position(); + $result['client_version'] = $ticket_info->getClient_Version(); + $result['patch_version'] = $ticket_info->getPatch_Version(); + $result['server_tick'] = $ticket_info->getServer_Tick(); + $result['connect_state'] = $ticket_info->getConnect_State(); + $result['local_address'] = $ticket_info->getLocal_Address(); + $result['memory'] = $ticket_info->getMemory(); + $result['os'] = $ticket_info->getOS(); + $result['processor'] = $ticket_info->getProcessor(); + $result['cpu_id'] = $ticket_info->getCPUId(); + $result['cpu_mask'] = $ticket_info->getCPU_Mask(); + $result['ht'] = $ticket_info->getHT(); + $result['nel3d'] = $ticket_info->getNel3D(); + $result['user_id'] = $ticket_info->getUser_Id(); + global $WEBPATH; + $result['WEBPATH'] = $WEBPATH; + + if(Ticket_User::isMod(unserialize($_SESSION['ticket_user']))){ + $result['isMod'] = "TRUE"; + } + return $result; + + }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/drupal_module/ryzommanage/ryzommanage.module b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ryzommanage.module index 20d3e1569..04bdefb14 100644 --- a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ryzommanage.module +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ryzommanage.module @@ -22,6 +22,7 @@ global $cfg; global $TICKET_LOGGING; global $TIME_FORMAT; global $TICKET_MAILING_SUPPORT; +global $WEBPATH; require 'ams_lib/libinclude.php'; spl_autoload_register('__autoload'); diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/templates/show_queue.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/templates/show_queue.tpl new file mode 100644 index 000000000..2a274f47e --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/templates/show_queue.tpl @@ -0,0 +1,204 @@ +{block name=content} +

Ticket Queue {$queue_view}

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + +
Todo ticketsAll ticketsAll open ticketsTicket ArchiveNot Assigned Tickets
+
+
+ + + + + + + +
+ + + + + + + + + + + +
+ Show + + + + tickets + + + + to + + + + + + + + + + +
+
+ + +
+
+
+ {if isset($ACTION_RESULT) and $ACTION_RESULT eq "SUCCESS_ASSIGNED"} + + {$success_assigned} + + {else if isset($ACTION_RESULT) and $ACTION_RESULT eq "SUCCESS_UNASSIGNED"} + + {$success_unassigned} + + {else if isset($ACTION_RESULT) and $ACTION_RESULT eq "TICKET_NOT_EXISTING"} + + {$ticket_not_existing} + + {else if isset($ACTION_RESULT) and $ACTION_RESULT eq "ALREADY_ASSIGNED"} + + {$ticket_already_assigned} + + {else if isset($ACTION_RESULT) and $ACTION_RESULT eq "NOT_ASSIGNED"} + + {$ticket_not_assigned} + + {/if} +
+ + + + + + + + + + + + + + + {foreach from=$tickets item=ticket} + + + + + + + + + + + {/foreach} + + +
IDTitleAssignedTimestampCategoryStatusSupportGroupActions
{$ticket.tId}{$ticket.title}{if $ticket.assignedText neq ""} {$ticket.assignedText} {else} {$not_assigned} {/if}{$ticket.timestamp}{$ticket.category} {$ticket.statusText} + + {if $ticket.forwardedGroupName eq "0"} + {$public_sgroup} + {else} + {$ticket.forwardedGroupName} + {/if} + + + {if $ticket.assigned eq 0} +
+ + + +
+ {else if $ticket.assigned eq $user_id} +
+ + + +
+ {/if} +
+ +
+ « | + {foreach from=$links item=link} + {if $link == $currentPage}{/if}{$link}{if $link == $currentPage}{/if} | + {/foreach} + » +
+
+ + + +{/block} + diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/templates/show_ticket_info.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/templates/show_ticket_info.tpl new file mode 100644 index 000000000..6437c3f23 --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/templates/show_ticket_info.tpl @@ -0,0 +1,79 @@ +{block name=content} +

[#{$ticket_id}] {$ticket_title}

+ +

Actions

+ + + {if isset($isMod) and $isMod eq "TRUE"}{/if} + + + +
Show Ticket LogSend Other TicketShow Ticket
+ +

Additional Info

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Ingame related
Shard ID: {$shard_id}
User_Id: {$user_id}
User Position: {$user_position}
View Position: {$view_position}
Client_Version: {$client_version}
Patch_Version: {$patch_version}
Server_Tick: {$server_tick}
Hardware & Software related
Memory: {$memory}
Processor: {$processor}
Cpu_Id: {$cpu_id}
Cpu_Mask: {$cpu_mask}
HT: {$ht}
OS: {$os}
NeL3D: {$nel3d}
Network related
Connect_State: {$connect_state}
Local_Address: {$local_address}
+ +{/block} +