getRole($thisstaff) : $thisstaff->getRole(); if ($role && !$role->hasPerm(Ticket::PERM_CLOSE)) return; // Map states to actions $actions= array( 'closed' => array( 'icon' => 'icon-ok-circle', 'action' => 'close', 'href' => 'tickets.php' ), 'open' => array( 'icon' => 'icon-undo', 'action' => 'reopen' ), ); $states = array('open'); if (!$ticket || $ticket->isCloseable()) $states[] = 'closed'; $statusId = $ticket ? $ticket->getStatusId() : 0; $nextStatuses = array(); foreach (TicketStatusList::getStatuses( array('states' => $states)) as $status) { if (!isset($actions[$status->getState()]) || $statusId == $status->getId()) continue; $nextStatuses[] = $status; } if (!$nextStatuses) return; ?>