PDA

View Full Version : status checkbox and buttons on customer side???


ggbig
01-06-2008, 12:48 PM
From what i can tell these pieces of the code are used in creating the checkbox and status buttons to change the status of a ticket on the admin side (includes/staff/tickets.inc.php) and would like a bit of help porting it to the customers side (includes/client/tickets.inc.php). Thanks!

--------------------------------------------------

$status=null;
switch(strtolower($_REQUEST['status'])){
case 'open':
$status='Open';
break;
case 'closed':
$status='Closed';
break;
case 'overdue':
$status='Open';
$showoverdue=true;
$results_type='Overdue Tickets';
break;
case 'assigned':
$status='Open';
$staffId=$thisuser->getId();
break;
default:
if(!$search)
$status='Open';
}

--------------------------------------------------

//STATUS
if($status){
$qwhere.=' AND status='.db_input($status);
}

--------------------------------------------------

$qselect = 'SELECT ticket.ticket_id,lock_id,ticketID,ticket.dept_id,t icket.staff_id,subject,name,email,dept_name '.
',status,source,isoverdue,ticket.created,pri.*';

--------------------------------------------------

$canDelete=$canClose=false;
$canDelete=$thisuser->canDeleteTickets();
$canClose=$thisuser->canCloseTickets();

--------------------------------------------------

onSubmit="return checkbox_checker(this,1,0)

--------------------------------------------------

<input type="hidden" name="status" value="<?=$statusss?>" >

--------------------------------------------------

<?if($canDelete || $canClose) {?>
<th width="8px">&nbsp;</th>
<?}?>

--------------------------------------------------

<?if($canDelete || $canClose) {?>
<td align="center" class="nohover">
<input type="checkbox" name="tids[]" value="<?=$row['ticket_id']?>" onClick="highLight(this.value,this.checked);">
</td>
<?}?>

--------------------------------------------------

<?if($canDelete || $canClose) { ?>
Select:
<a href="#" onclick="return select_all(document.forms['tickets'],true)">All</a>&nbsp;
<a href="#" onclick="return reset_all(document.forms['tickets'])">None</a>&nbsp;
<a href="#" onclick="return toogle_all(document.forms['tickets'],true)">Toggle</a>&nbsp;
<?}?>

--------------------------------------------------

<? if($canClose or $canDelete) { ?>
<tr><td align="center"> <br>
<?
//If the user can close the ticket...mass reopen is allowed.
//If they can delete tickets...they are allowed to close--reopen..etc.
switch ($status) {
case "Closed": ?>
<input class="button" type="submit" name="reopen" value="Reopen"
onClick=' return confirm("Are you sure you want to reopen selected tickets?");'>
<?
break;
case "Open":?>
<input class="button" type="submit" name="overdue" value="Overdue"
onClick=' return confirm("Are you sure you want to mark selected tickets overdue/stale?");'>
<input class="button" type="submit" name="close" value="Close"
onClick=' return confirm("Are you sure you want to close selected tickets?");'>
<?
break;
default: //search??
?>
<input class="button" type="submit" name="close" value="Close"
onClick=' return confirm("Are you sure you want to close selected tickets?");'>
<input class="button" type="submit" name="reopen" value="Reopen"
onClick=' return confirm("Are you sure you want to reopen selected tickets?");'>
<?
}
if($canDelete) {?>
<input class="button" type="submit" name="delete" value="Delete"
onClick=' return confirm("Are you sure you want to DELETE selected tickets?");'>
<?}?>
</td></tr>
<? }
} ?>

--------------------------------------------------

so with this someone should be able to help port the checkbox and the status buttons to the customer side? Thanks a million!