category problem

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
wedlock
Posts: 19
Joined: Sun Feb 08, 2009 10:43 am

category problem

Post by wedlock »

Version of script: 2.2
Write your message below:

hello, I would want that how much the staff opens new ticket or visible only authorized categories dall' administrator. Currently all are looked at.

i think modifying this is file /admin/new_ticket.php?

Code: Select all

	<!-- Department and priority -->
	<table border="0" width="100%">
	<tr>
	<td style="text-align:right" width="150"><?php echo $hesklang['category']; ?>: <font class="important">*</font></td>
	<td width="80%"><select name="category">
	<?php
	if (!empty($_GET['catid']))
	{
		$_SESSION['as_category'] = intval($_GET['catid']);
	}

	$sql = 'SELECT * FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'categories` ORDER BY `cat_order` ASC';
	$result = hesk_dbQuery($sql);
	while ($row=hesk_dbFetchAssoc($result))
	{
	    if (isset($_SESSION['as_category']) && $_SESSION['as_category'] == $row['id']) {$selected = ' selected="selected"';}
	    else {$selected = '';}
	    echo '<option value="'.$row['id'].'"'.$selected.'>'.$row['name'].'</option>';
	}

	?>
	</select></td>
	</tr>
thankyou
wedlock
Posts: 19
Joined: Sun Feb 08, 2009 10:43 am

Re: category problem

Post by wedlock »

resolved.

find

Code: Select all

	$sql = 'SELECT * FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'categories` ORDER BY `cat_order` ASC';
	$result = hesk_dbQuery($sql);
replace with

Code: Select all

	$sql_private = 'SELECT * FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'categories` WHERE ';
    $sql_private .= hesk_myCategories('id');
    $sql_private .= ' ORDER BY `cat_order` ASC';
	
		$result = hesk_dbQuery($sql_private);
Post Reply