tag yet. echo '
'; if ($total > 0) { /* This query string will be used to browse pages */ if ($href == 'show_tickets.php') { #$query = 'status='.$status; $query = ''; $query .= 's' . implode('=1&s',array_keys($status)) . '=1'; $query .= '&p' . implode('=1&p',array_keys($priority)) . '=1'; $query .= '&category='.$category; $query .= '&sort='.$sort; $query .= '&asc='.$asc; $query .= '&limit='.$maxresults; $query .= '&archive='.$archive[1]; $query .= '&s_my='.$s_my[1]; $query .= '&s_ot='.$s_ot[1]; $query .= '&s_un='.$s_un[1]; $query .= '&cot='.$cot; $query .= '&g='.$group; $query .= '&page='; } else { $query = 'q='.$q; $query .= '&what='.$what; $query .= '&category='.$category; $query .= '&dt='.urlencode($date_input); $query .= '&sort='.$sort; $query .= '&asc='.$asc; $query .= '&limit='.$maxresults; $query .= '&archive='.$archive[2]; $query .= '&s_my='.$s_my[2]; $query .= '&s_ot='.$s_ot[2]; $query .= '&s_un='.$s_un[2]; $query .= '&page='; } $pages = ceil($total/$maxresults) or $pages = 1; if ($page > $pages) { $page = $pages; } $limit_down = ($page * $maxresults) - $maxresults; $prev_page = ($page - 1 <= 0) ? 0 : $page - 1; $next_page = ($page + 1 > $pages) ? 0 : $page + 1; $autorefreshInSeconds = $_SESSION['autorefresh']/1000; $autorefresh = ''; if ($autorefreshInSeconds >= MINIMUM_REFRESH_THRESHOLD_IN_SECONDS) { $autorefresh = ' | '.$hesklang['autorefresh'].' '.$autorefreshInSeconds.' '.$hesklang['abbr']['second']; ?> '; if ($pages > 1) { /* List pages */ echo '
    '; if ($pages > 7) { if ($page > 2) { echo '
  • «
  • '; // << } if ($prev_page) { echo '
  • '; // < } } for ($i=1; $i<=$pages; $i++) { if ($i <= ($page+5) && $i >= ($page-5)) { if ($i == $page) { echo '
  • '.$i.'
  • '; } else { echo '
  • '.$i.'
  • '; } } } if ($pages > 7) { if ($next_page) { echo '
  • '; // > } if ($page < ($pages - 1)) { echo '
  • »
  • '; // >> } } echo '
'.$hesklang['jump_page'].'
'; } /* We have the full SQL query now, get tickets */ $sql .= " LIMIT ".hesk_dbEscape($limit_down)." , ".hesk_dbEscape($maxresults)." "; $result = hesk_dbQuery($sql); /* Uncomment for debugging */ # echo "SQL: $sql\n
"; /* This query string will be used to order and reverse display */ if ($href == 'show_tickets.php') { #$query = 'status='.$status; $query = ''; $query .= 's' . implode('=1&s',array_keys($status)) . '=1'; $query .= '&p' . implode('=1&p',array_keys($priority)) . '=1'; $query .= '&category='.$category; #$query .= '&asc='.(isset($is_default) ? 1 : $asc_rev); $query .= '&limit='.$maxresults; $query .= '&archive='.$archive[1]; $query .= '&s_my='.$s_my[1]; $query .= '&s_ot='.$s_ot[1]; $query .= '&s_un='.$s_un[1]; $query .= '&page=1'; #$query .= '&sort='; $query .= '&cot='.$cot; $query .= '&g='.$group; } else { $query = 'q='.$q; $query .= '&what='.$what; $query .= '&category='.$category; $query .= '&dt='.urlencode($date_input); #$query .= '&asc='.$asc; $query .= '&limit='.$maxresults; $query .= '&archive='.$archive[2]; $query .= '&s_my='.$s_my[2]; $query .= '&s_ot='.$s_ot[2]; $query .= '&s_un='.$s_un[2]; $query .= '&page=1'; #$query .= '&sort='; } $query .= '&asc='; /* Print the table with tickets */ $random=rand(10000,99999); ?>
'; $first_line = $hesklang['tasy2'] . " \n\n"; } elseif ($ticket['owner']) { if (!isset($admins[$ticket['owner']])) { $admins[$ticket['owner']] = $hesklang['e_udel']; } $owner = ' '; $first_line = $hesklang['taso3'] . ' ' . $admins[$ticket['owner']] . " \n\n"; } $tagged = ''; if ($ticket['archive']) { $tagged = ' '; } $statusName = hesk_dbFetchAssoc(hesk_dbQuery("SELECT `ShortNameContentKey`, `TextColor` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE ID = ".$ticket['status'])); $ticket['status']=''.$hesklang[$statusName['ShortNameContentKey']].''; switch ($ticket['priority']) { case 0: $ticket['priority']=''; $color = 'danger'; break; case 1: $ticket['priority']=''; $color = 'warning'; break; case 2: $ticket['priority']=''; break; default: $ticket['priority']=''; } $ticket['lastchange']=hesk_time_since(strtotime($ticket['lastchange'])); if ($ticket['lastreplier']) { $ticket['repliername'] = isset($admins[$ticket['replierid']]) ? $admins[$ticket['replierid']] : $hesklang['staff']; } else { $ticket['repliername'] = $ticket['name']; } $ticket['archive'] = !($ticket['archive']) ? $hesklang['no'] : $hesklang['yes']; $ticket['message'] = $first_line . substr(strip_tags($ticket['message']),0,200).'...'; $ownerColumn = $ticket['owner'] != 0 ? $admins[$ticket['owner']] : '('.$hesklang['unas'].')'; $customFieldsHtml = ''; for ($i = 1; $i <= 20; $i++) { if ($hesk_settings['custom_fields']['custom'.$i]['use']) { $display = 'display: none'; if ((isset($_GET['sort']) && $_GET['sort'] == 'custom'.$i) || (isset($_GET['what']) && $_GET['what'] == 'custom'.$i)) { $display = ''; } $customFieldsHtml .= ''.$ticket['custom'.$i].''; } } echo <<   $ticket[trackid] $ticket[lastchange] $ticket[name] $tagged$owner$ticket[subject] $ticket[status]  $ticket[repliername] $ticket[priority] $ownerColumn $customFieldsHtml EOC; } // End while ?>
 
0 else { echo '
'; $autorefreshInSeconds = $_SESSION['autorefresh']/1000; if ($autorefreshInSeconds >= MINIMUM_REFRESH_THRESHOLD_IN_SECONDS) { echo $hesklang['autorefresh'].' '.$autorefreshInSeconds.' '.$hesklang['abbr']['second']; ?> '.$hesklang['nti'].''); } else { hesk_show_notice($hesklang['no_tickets_open'].''.$hesklang['nti'].''); } echo '
'; } echo ' '; function hesk_print_list_head() { global $href, $query, $sort_possible, $hesklang, $hesk_settings; ?>
'.$hesk_settings['custom_fields']['custom'.$i]['name'].''; } } ?> O: $original (".date('Y-m-d H:i:s',$original).")"; return "0".$hesklang['abbr']['second']; } $since = $mysql_time - $original; // $j saves performing the count function each time around the loop for ($i = 0, $j = count($chunks); $i < $j; $i++) { $seconds = $chunks[$i][0]; $name = $chunks[$i][1]; // finding the biggest chunk (if the chunk fits, break) if (($count = floor($since / $seconds)) != 0) { // DEBUG print "\n"; break; } } $print = "$count{$name}"; if ($i + 1 < $j) { // now getting the second item $seconds2 = $chunks[$i + 1][0]; $name2 = $chunks[$i + 1][1]; // add second item if it's greater than 0 if (($count2 = floor(($since - ($seconds * $count)) / $seconds2)) != 0) { $print .= "$count2{$name2}"; } } return $print; } // END hesk_time_since()