Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

2506 Posts in 649 Topics- by 1316 Members - Latest Member: kortuem

eTicket CommunityDevelopmentCore System Development (Moderators: jason, Hummdis)Topic: [RESOLVED] Looking for a little guidance
Pages: [1]   Go Down
Print
Author Topic: [RESOLVED] Looking for a little guidance  (Read 2322 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
eTicket CommunityDevelopmentCore System Development (Moderators: jason, Hummdis)Topic: [RESOLVED] Looking for a little guidance
Jump to: