Exemplo n.º 1
0
 function loadLockedUsers()
 {
     $user_id = JFactory::getUser()->id;
     foreach ($this->tickets as $ticket) {
         $cotime = FSS_Helper::GetDBTime() - strtotime($ticket->checked_out_time);
         if ($cotime < FSS_Settings::get('support_lock_time') && $ticket->checked_out != $user_id) {
             $ticket->co_user = JFactory::getUser($ticket->checked_out);
         }
     }
 }
Exemplo n.º 2
0
 static function forAdmin(&$parser, $ticket = null, $custom_fields = null)
 {
     $parser->Clear();
     self::core($parser, $ticket, $custom_fields);
     if ($ticket) {
         $title = $ticket->getTitle();
         $parser->SetVar('link', FSSRoute::_('index.php?option=com_fss&view=admin_support&layout=ticket&ticketid=' . $ticket->id));
         $parser->SetVar('checkbox', "<input type='checkbox' class='ticket_cb' style='display: none' id='ticket_cb_{$ticket->id}' name='ticket_{$ticket->id}'>");
         $parser->SetVar('subject', "<input type='checkbox' class='ticket_cb' style='display: none' id='ticket_cb_{$ticket->id}' name='ticket_{$ticket->id}'><a href='" . FSSRoute::_('index.php?option=com_fss&view=admin_support&layout=ticket&ticketid=' . $ticket->id) . "'>" . $title . "</a>");
         $parser->SetVar('subject_text', $title);
         $cotime = FSS_Helper::GetDBTime() - strtotime($ticket->checked_out_time);
         if ($cotime < FSS_Settings::get('support_lock_time') && $ticket->checked_out != JFactory::getUser()->id && $ticket->checked_out > 0) {
             $html = "<div>" . $ticket->co_user->name . " (" . $ticket->co_user->email . ")</div>";
             $parser->SetVar('lock', "<img class='fssTip' title='<b>Ticket locked</b><br />" . htmlentities($html, ENT_QUOTES, "utf-8") . "' src='" . JURI::root(true) . "/components/com_fss/assets/images/lock.png'>");
         }
         if (!FSS_Settings::get('support_hide_tags')) {
             if (isset($ticket->tags) && count($ticket->tags) > 0) {
                 $html = "";
                 foreach ($ticket->tags as $tag) {
                     $html .= "<div>" . $tag . "</div>";
                 }
                 $parser->SetVar('tags', "<img class='fssTip' title='" . htmlentities($html, ENT_QUOTES, "utf-8") . "' src='" . JURI::root(true) . "/components/com_fss/assets/images/tag.png'>");
             }
         }
         if (isset($ticket->attach) && count($ticket->attach) > 0) {
             $html = "";
             foreach ($ticket->attach as $attach) {
                 $html .= "<div>" . $attach->filename . " (" . FSS_Helper::display_filesize($attach->size) . ")</div>";
             }
             $parser->SetVar('attach', "<img class='fssTip' title='" . htmlentities($html, ENT_QUOTES, "utf-8") . "' src='" . JURI::root(true) . "/components/com_fss/assets/images/attach.png'>");
         }
         $parser->SetVar('icons', '');
         if (FSS_Settings::get('support_show_msg_counts')) {
             $parser->SetVar("msgcount_total", $ticket->msgcount['total']);
             $parser->SetVar("msgcount_user", $ticket->msgcount['0']);
             $parser->SetVar("msgcount_handler", $ticket->msgcount['1']);
             $parser->SetVar("msgcount_private", $ticket->msgcount['2']);
             $parser->SetVar("msgcount_draft", $ticket->msgcount['4']);
             $tip = "<strong>" . $ticket->msgcount['total'] . " " . JText::_('MESSAGES') . ":</strong><br>";
             if ($ticket->msgcount['0'] > 0) {
                 $tip .= $ticket->msgcount['0'] . " " . JText::_('USER') . "<br>";
             }
             if ($ticket->msgcount['1'] > 0) {
                 $tip .= $ticket->msgcount['1'] . " " . JText::_('HANDLER') . "<br>";
             }
             if ($ticket->msgcount['2'] > 0) {
                 $tip .= $ticket->msgcount['2'] . " " . JText::_('PRIVATE') . "<br>";
             }
             if ($ticket->msgcount['4'] > 0) {
                 $tip .= $ticket->msgcount['4'] . " " . JText::_('DRAFT') . "<br>";
             }
             $parser->SetVar('msgcnt', "<span class='fssTip label label-default' title='" . htmlentities($tip, ENT_QUOTES, "utf-8") . "'>" . $ticket->msgcount['total'] . "</span>");
         }
         $parser->SetVar("source", $ticket->source);
         $delete = "<a class='pull-right btn btn-default btn-mini' href='" . FSSRoute::_('index.php?option=com_fss&view=admin_support&task=archive.delete&tickets=' . FSS_Input::getCmd('tickets') . '&ticketid=' . $ticket->id) . "'>";
         $delete .= JText::_("DELETE") . "</a>";
         $parser->SetVar('deletebutton', $delete);
         $archive = "<a class='pull-right btn btn-default btn-mini' href='" . FSSRoute::_('index.php?option=com_fss&view=admin_support&task=archive.archive&tickets=' . FSS_Input::getCmd('tickets') . '&ticketid=' . $ticket->id) . "'>";
         $archive .= JText::_("ARCHIVE") . "</a>";
         $parser->SetVar('archivebutton', $archive);
         $handler_highlight = '<span class="fssTip label label-warning pull-right" title="' . JText::_('UNASSIGNED_TICKET') . '">' . $parser->GetVar('handlername') . '</span>';
         if ($ticket->admin_id == JFactory::getUser()->id) {
             $handler_highlight = '<span class="fssTip label label-success pull-right" title="' . JText::_('MY_TICKET') . '">' . $parser->GetVar('handlername') . '</span>';
         } else {
             if ($ticket->admin_id > 0) {
                 $handler_highlight = '<span class="fssTip label label-info pull-right" title="' . JText::_('OTHER_HANDLERS_TICKET') . '">' . $parser->GetVar('handlername') . '</span>';
             }
         }
         $parser->SetVar('handler_tag', $handler_highlight);
         $style = "";
         //$trhl = " onmouseover='highlightticket({$ticket->id})' onmouseout='unhighlightticket({$ticket->id})' ";
         $trhl = " ";
         // no longer highlighting tickets!
         $priority = $ticket->getPriority();
         if ($priority->backcolor) {
             $style .= "background-color: {$priority->backcolor};";
         }
         if (FSS_Settings::get('support_entire_row')) {
             $style .= "cursor: pointer;";
             $trhl .= " onclick='window.location=\"" . FSSRoute::_('index.php?option=com_fss&view=admin_support&layout=ticket&ticketid=' . $ticket->id) . "\"' ";
         }
         $trhl .= " style='{$style}' ";
         $parser->SetVar('trhl', $trhl);
         $parser->SetVar('class', static::$rowclass . " ticket_{$ticket->id}");
         if (static::$rowclass == "odd") {
             static::$rowclass = "even";
         } else {
             static::$rowclass = "odd";
         }
     }
     $parser->SetVar("hidehandler", FSS_Settings::get('support_hide_handler') == 1);
     $parser->SetVar("candelete", FSS_Settings::get('support_delete'));
 }
Exemplo n.º 3
0
 function isLocked()
 {
     if (empty($this->locked)) {
         $cotime = FSS_Helper::GetDBTime();
         -strtotime($this->checked_out_time);
         $this->locked = false;
         if ($cotime < FSS_Settings::get('support_lock_time') && $this->checked_out != JFactory::getUser()->id && $this->checked_out != 0) {
             $this->locked = true;
         }
     }
     return $this->locked;
 }