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

Pending Ticket Status #848

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open
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
39 changes: 39 additions & 0 deletions findtopic.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

/* File : findtopic.php */
/* Purpose: This file will help you to display the help topic */
/* automatically based on the selected department */
/* in the open or new ticket form at the client side */
/* Author : Masino Sinaga, http://www.openscriptsolution.com */
/* Created: December 2, 2009 */

require_once('main.inc.php');
if(!defined('INCLUDE_DIR')) die('Fatal Error');
define('CLIENTINC_DIR',INCLUDE_DIR.'client/');
define('OSTCLIENTINC',TRUE); //make includes happy

$topicsbydept=array();
if($dept_id=$_GET['dept_id']) {
$query="SELECT topic_id,topic FROM ".TOPIC_TABLE."
WHERE isactive=1 AND ispublic=1 AND dept_id = ".$dept_id."
ORDER BY topic";
$result=db_query($query);
while (list($id, $name) = db_fetch_row($result)){$topicsbydept[$id]=$name;}
}

?>

<select id="topicId" name="topicId" style="min-width:200px;">
<option value="" selected="selected">&mdash; Select a Help Topic &mdash;</option>
<?php
if($topics=$topicsbydept) {
foreach($topics as $id =>$name) {
echo sprintf('<option value="%d" %s>%s</option>',
$id, ($info['topicId']==$id)?'selected="selected"':'', $name);
}
}
else { ?>
<!-- <option value="0" >General Inquiry</option>-->
<?php
} ?>
</select>
8 changes: 6 additions & 2 deletions include/class.client.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,17 @@ function getTicketStats() {
}

function getNumTickets() {
return ($stats=$this->getTicketStats())?($stats['open']+$stats['closed']):0;
return ($stats=$this->getTicketStats())?($stats['open']+$stats['pending']+$stats['closed']):0;
}

function getNumOpenTickets() {
return ($stats=$this->getTicketStats())?$stats['open']:0;
}

function getNumPendingTickets() {
return ($stats=$this->getTicketStats())?$stats['pending']:0;
}

function getNumClosedTickets() {
return ($stats=$this->getTicketStats())?$stats['closed']:0;
}
Expand Down Expand Up @@ -168,7 +172,7 @@ function lookupByEmail($email) {
$errors['login'] = 'Invalid method';
elseif(!$ticketID || !Validator::is_email($email))
$errors['login'] = 'Valid email and ticket number required';

//Bail out on error.
if($errors) return false;

Expand Down
Loading