Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(514, 515, 517, 518) Resolve issues with ticket mass update, 'ticket.link' ticket placeholder value, and agent account role update; remove manage group saved reply privilege settings #519

Merged
merged 6 commits into from
Dec 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Controller/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,11 @@ public function editAgent($agentId)
$user->setEmail($data['email']);
$user->setIsEnabled(true);

$userInstance = $em->getRepository('UVDeskCoreFrameworkBundle:UserInstance')->findOneBy(array('user' => $agentId, 'supportRole' => array(2, 3)));
$userInstance = $em->getRepository('UVDeskCoreFrameworkBundle:UserInstance')->findOneBy(array('user' => $agentId, 'supportRole' => array(1, 2, 3)));

$oldSupportTeam = ($supportTeamList = $userInstance->getSupportTeams()) ? $supportTeamList->toArray() : [];
$oldSupportGroup = ($supportGroupList = $userInstance->getSupportGroups()) ? $supportGroupList->toArray() : [];
$oldSupportedPrivilege = ($supportPrivilegeList = $userInstance->getSupportPrivileges())? $supportPrivilegeList->toArray() : [];
$oldSupportTeam = ($supportTeamList = $userInstance != null ? $userInstance->getSupportTeams() : null) ? $supportTeamList->toArray() : [];
$oldSupportGroup = ($supportGroupList = $userInstance != null ? $userInstance->getSupportGroups() : null) ? $supportGroupList->toArray() : [];
$oldSupportedPrivilege = ($supportPrivilegeList = $userInstance != null ? $userInstance->getSupportPrivileges() : null)? $supportPrivilegeList->toArray() : [];

if(isset($data['role'])) {
$role = $em->getRepository('UVDeskCoreFrameworkBundle:SupportRole')->findOneBy(array('code' => $data['role']));
Expand Down
19 changes: 6 additions & 13 deletions Services/TicketService.php
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,6 @@ public function massXhrUpdate(Request $request)
$ticket->setIsTrashed(true);

$this->entityManager->persist($ticket);
$this->entityManager->flush();
}

// Trigger ticket delete event
Expand All @@ -880,15 +879,14 @@ public function massXhrUpdate(Request $request)
}

$this->entityManager->remove($ticket);
$this->entityManager->flush();


break;
case 'restored':
if (true == $ticket->getIsTrashed()) {
$ticket->setIsTrashed(false);

$this->entityManager->persist($ticket);
$this->entityManager->flush();
}
break;
case 'agent':
Expand All @@ -898,7 +896,6 @@ public function massXhrUpdate(Request $request)
$ticket->setAgent($agent);

$this->entityManager->persist($ticket);
$this->entityManager->flush();

// Trigger Agent Assign event
$event = new GenericEvent(CoreWorkflowEvents\Ticket\Agent::getId(), [
Expand All @@ -915,7 +912,6 @@ public function massXhrUpdate(Request $request)
$ticket->setStatus($status);

$this->entityManager->persist($ticket);
$this->entityManager->flush();

// Trigger ticket status event
$event = new GenericEvent(CoreWorkflowEvents\Ticket\Status::getId(), [
Expand All @@ -933,7 +929,6 @@ public function massXhrUpdate(Request $request)
$ticket->setType($type);

$this->entityManager->persist($ticket);
$this->entityManager->flush();

// Trigger ticket type event
$event = new GenericEvent(CoreWorkflowEvents\Ticket\Type::getId(), [
Expand All @@ -951,7 +946,6 @@ public function massXhrUpdate(Request $request)
$ticket->setSupportGroup($group);

$this->entityManager->persist($ticket);
$this->entityManager->flush();

// Trigger Support group event
$event = new GenericEvent(CoreWorkflowEvents\Ticket\Group::getId(), [
Expand All @@ -969,7 +963,6 @@ public function massXhrUpdate(Request $request)
$ticket->setSupportTeam($team);

$this->entityManager->persist($ticket);
$this->entityManager->flush();

// Trigger team event
$event = new GenericEvent(CoreWorkflowEvents\Ticket\Team::getId(), [
Expand All @@ -987,7 +980,6 @@ public function massXhrUpdate(Request $request)
$ticket->setPriority($priority);

$this->entityManager->persist($ticket);
$this->entityManager->flush();

// Trigger ticket Priority event
$event = new GenericEvent(CoreWorkflowEvents\Ticket\Priority::getId(), [
Expand All @@ -1006,13 +998,14 @@ public function massXhrUpdate(Request $request)
}

$this->entityManager->persist($ticket);
$this->entityManager->flush();

break;
default:
break;
}
}
}

$this->entityManager->flush();

return [
'alertClass' => 'success',
Expand Down Expand Up @@ -1666,11 +1659,11 @@ public function getSavedReplyPlaceholderValues($ticket, $type = "customer")
$router = $this->container->get('router');

if ($type == 'customer') {
$ticketListURL = $router->generate('helpdesk_member_ticket_collection', [
$ticketListURL = $router->generate('helpdesk_customer_ticket_collection', [
'id' => $ticket->getId(),
], UrlGeneratorInterface::ABSOLUTE_URL);
} else {
$ticketListURL = $router->generate('helpdesk_customer_ticket_collection', [
$ticketListURL = $router->generate('helpdesk_member_ticket_collection', [
'id' => $ticket->getId(),
], UrlGeneratorInterface::ABSOLUTE_URL);
}
Expand Down
1 change: 0 additions & 1 deletion Services/UVDeskService.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ public function getSupportPrivelegesResources()
'ROLE_AGENT_MANAGE_WORKFLOW_AUTOMATIC' => $translator->trans('Can manage Automatic workflow'),
'ROLE_AGENT_MANAGE_TAG' => $translator->trans('Can manage tags'),
'ROLE_AGENT_MANAGE_KNOWLEDGEBASE' => $translator->trans('Can manage knowledgebase'),
'ROLE_AGENT_MANAGE_GROUP_SAVED_REPLY' => $translator->trans("Can manage Group's Saved Reply"),
'ROLE_AGENT_MANAGE_AGENT_ACTIVITY' => $translator->trans("Can manage agent activity"),
'ROLE_AGENT_MANAGE_MARKETING_ANNOUNCEMENT' => $translator->trans("Can manage marketing announcement"),
]
Expand Down