Ejemplo n.º 1
0
function buildAdminTicketListArray($result)
{
    global $departmentsarray;
    global $tabledata;
    global $aInt;
    global $tickets;
    while ($data = mysql_fetch_array($result)) {
        $id = $data['id'];
        $ticketnumber = $data['tid'];
        $did = $data['did'];
        $puserid = $data['userid'];
        $name = $data['name'];
        $email = $data['email'];
        $date = $data['date'];
        $title = $data['title'];
        $message = $data['message'];
        $tstatus = $data['status'];
        $priority = $data['urgency'];
        $rawlastactivity = $data['lastreply'];
        $flag = $data['flag'];
        $firstname = $data['firstname'];
        $lastname = $data['lastname'];
        $companyname = $data['companyname'];
        $groupid = $data['groupid'];
        $adminread = $data['adminunread'];
        $adminread = explode(",", $adminread);
        $tickets->addTagCloudID($id);
        if (!in_array($_SESSION['adminid'], $adminread)) {
            $unread = 1;
        } else {
            $unread = 0;
        }
        $alttitle = "";
        $title = trim($title);
        if (!$title) {
            $title = " - " . $aInt->lang("emails", "nosubject") . " - ";
        }
        if (80 < strlen($title)) {
            $alttitle = $title;
            $title = substr($title, 0, 80) . "...";
        }
        if ($alttitle) {
            $alttitle .= "\r\n";
        }
        $alttitle .= trim(ticketsummary($message, 250));
        $flaggedto = "";
        if ($flag == $_SESSION['adminid']) {
            $showflag = "user";
        } else {
            if ($flag == 0) {
                $showflag = "none";
            } else {
                $showflag = "other";
                $flaggedto = getAdminName($flag);
            }
        }
        $department = $departmentsarray[$did];
        if ($flaggedto) {
            $department .= " (" . $flaggedto . ")";
        }
        $date = fromMySQLDate($date, "time");
        $lastactivity = fromMySQLDate($rawlastactivity, "time");
        $tstatus = getStatusColour($tstatus);
        $lastreply = getShortLastReplyTime($rawlastactivity);
        $title = "#" . $ticketnumber . " - " . $title;
        if ($unread) {
            $title = "<strong>" . $title . "</strong>";
        }
        $clientinfo = $puserid != "0" ? $aInt->outputClientLink($puserid, $firstname, $lastname, $companyname, $groupid) : $name;
        $ticketlink = "<a href=\"?action=viewticket&id=" . $id . "\"" . ($alttitle ? " title=\"" . $alttitle . "\"" : "") . "" . $ainject . ">";
        $tabledata[] = array("<input type=\"checkbox\" name=\"selectedtickets[]\" value=\"" . $id . "\" class=\"checkall\">", "<img src=\"images/" . strtolower($priority) . ("priority.gif\" width=\"16\" height=\"16\" alt=\"" . $priority . "\" class=\"absmiddle\" />"), $department, "<div style=\"text-align:left;\">" . $ticketlink . $title . "</a></div>", $clientinfo, $tstatus, $lastreply);
    }
}
Ejemplo n.º 2
0
     } else {
         if ($flag == 0) {
             $showflag = "none";
         } else {
             $showflag = "other";
             $flaggedto = getAdminName($flag);
         }
     }
     $department = $departmentsarray[$did];
     if ($flaggedto) {
         $department .= " (" . $flaggedto . ")";
     }
     $date = fromMySQLDate($date, "time");
     $lastactivity = fromMySQLDate($rawlastactivity, "time");
     $tstatus = getStatusColour($tstatus);
     $lastreply = getShortLastReplyTime($rawlastactivity);
     $flagstyle = $showflag == "user" ? "<span class=\"ticketflag\">" : "";
     $title = "#" . $ticketnumber . " - " . $title;
     if ($unread || $showflag == "user") {
         $title = "<strong>" . $title . "</strong>";
     }
     $ticketlink = "<a href=\"" . $PHP_SELF . "?action=viewticket&id=" . $id . "\"" . $ainject . ">";
     $tabledata[] = array("<img src=\"images/" . strtolower($priority) . ("priority.gif\" width=\"16\" height=\"16\" alt=\"" . $priority . "\" class=\"absmiddle\" />"), $flagstyle . $date, $flagstyle . $department, "<div style=\"text-align:left;\">" . $flagstyle . $ticketlink . $title . "</a></div>", $flagstyle . $tstatus, $flagstyle . $lastreply);
 }
 echo $aInt->sortableTable(array("", $aInt->lang("support", "datesubmitted"), $aInt->lang("support", "department"), $aInt->lang("fields", "subject"), $aInt->lang("fields", "status"), $aInt->lang("support", "lastreply")), $tabledata);
 echo "<table width=\"80%\" align=\"center\"><tr><td style=\"text-align:left;\">";
 if (0 < $offset) {
     echo "<a href=\"#\" onclick=\"loadTab(" . $target . ",'tickets'," . ($offset - $qlimit) . ");return false\">";
 }
 echo "&laquo; Previous</a></td><td style=\"text-align:right;\">";
 if ($endnum < $totaltickets) {