eTicket Community
September 02, 2010, 03:18:01 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Want to engage your customers? eTicket  will soon be incorporated into Help Center Live!, the Live Chat leader!
 
   Home   Help Search Login Register  
Quick Register
Choose username  Email                 
Verify password    Choose password 
I agree to Registration Agreement
Pages: [1]   Go Down
  Print  
Author Topic: [RESOLVED] Looking for a little guidance  (Read 2929 times)
0 Members and 1 Guest are viewing this topic.
NewConceptTodd
New Member
*

Karma: +0/-0
Offline Offline

Posts: 3


« on: August 05, 2008, 02:57:12 AM »

Greetings,
First I want to say that I've enjoyed eticket so far.

I went ahead and registered because I'm looking for a little guidance. 

I'm looking for where the delete button is rendered for the private messages and in the view ticket screen for admin status.

Rather than describe what I've done, here's some code:

in init.php:

Code:
//Ugly Hack
<?php
$sql_del 
"SELECT value from "$db_table['settings']."  WHERE `key` = 'del_allowed'";
$a_result mysql_query($sql_del);
$allowed_del mysql_fetch_assoc($a_result);

if(
strpos($allowed_del['value'], $_SESSION['user']['id']) !== false)
{
$_SESSION['user']['allow_delete'] = '1';

}
else
{
$_SESSION['user']['allow_delete'] = '0';
}

?>


then in main.html.php

Code:
<?php // around line 57
if ($_SESSION['user']['type'] == 'admin'):
?>

<?php if ($_SESSION['user']['allow_delete'] === '1')
{
?>
<input class="inputsubmit" type="submit" id="delete" name="delete" title="<?php echo LANG_TIP_DELETE?>" onClick='if(confirm("<?php echo LANG_DELETE_CONFIRM?>")) return; else return false;' value="<?php echo LANG_DELETE?>">
<?php
}
else
{
//maybe publish a disabled button.

?>


I'd like to use this same session variable to set the availability of delete button through out the web app.

If this is unclear, please ask me to clarify.  Its 8:00am here and I'm a quart low on coffee. 

Thanks,

-Todd
« Last Edit: August 08, 2008, 06:22:04 PM by beven » Logged
NewConceptTodd
New Member
*

Karma: +0/-0
Offline Offline

Posts: 3


« Reply #1 on: August 05, 2008, 04:12:25 AM »

Before anyone else points out that I'm an Idiot, I'll do it myself Cheesy

By adding the code from my previous post, it also takes care of the buttons in both the view tickets screen and the view ticket details screen including private messages.

Cool and closed.

-Todd
Logged
beven
Project Manager/Developer
Global Moderator
Super Member
*****

Karma: +12/-4
Offline Offline

Posts: 804


WWW
« Reply #2 on: August 07, 2008, 08:22:57 AM »

From my understanding of the current code. It will only allow deletion if the logged in user id is equal to 1 or what ever you defined the ADMIN as.
Logged

Not to be confused with Bob Evans.
Ask not what eTicket community can do for you - ask what you can do for eTicket community.

Version 2 coming out shortly.
NewConceptTodd
New Member
*

Karma: +0/-0
Offline Offline

Posts: 3


« Reply #3 on: August 07, 2008, 10:34:02 AM »

The problem was that any user group I created for reps was defined as ADMIN.  I guess this post should be moved to feature request, (or maybe I just missed it while reading the manual,) To request a feature whereby a superuser can create different rep groups for particular privileges...

This would allow for more granular control of the helpdesk process.  I don't want to say that I don't trust all my representatives not to delete an item, however, a deletion of a ticket should be allowed only for the highest of privileged users.

Anyway, problem solved per earlier post. 

Thank you very much for responding.   Smiley

-Todd
Logged
eTicket Community
   

 Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.8 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 2.765 seconds with 23 queries.

Google visited last this page August 27, 2010, 05:19:03 AM