• [MOD] Support Ticket System 5 0 5 1
Currently:  

Author Topic: [MOD] Support Ticket System  (Read 96892 times)

0 Members and 1 Guest are viewing this topic.

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
Re: [MOD] Support Ticket System
« Reply #15 on: September 04, 2008, 03:56:44 AM »
Hehe,

thank you very much. I will go to sleep now because I am very tired. Bye Bye and good night!

Offline Deskcom

  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: [MOD] Support Ticket System
« Reply #16 on: September 04, 2008, 03:59:57 AM »
Lol, you get some sleep, nini

Offline Deskcom

  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: [MOD] Support Ticket System
« Reply #17 on: September 06, 2008, 01:57:21 AM »
Update New Feature: Blinking indication when ticket has been updated.

Master Code has been updated with this new feature. If you have installed the support script already. Use the steps below to add this feature to your existing code. If you have not installed the support system yet. Then you dont need to do these steps, the script has already been updated to include this feature.


Step 1a. Open includes/page_header.php
Find A Remove:
Code: [Select]
  "lang_support_view" => $lang['support_view'],

Step 1b.
Find:
Code: [Select]
  $total_categories = $data['total_categories'];
  $auth_cat_sql['auth_viewcat']['IN'] = $data['auth_viewcat']['IN'];
  $auth_cat_sql['auth_viewcat']['NOTIN'] = $data['auth_viewcat']['NOTIN'];
}

Paste After:
Code: [Select]
$url_support_check_ticket = "";
if(new_ticket_check($user_info['user_id'],$user_info['user_name'])){
  $url_support_check_ticket .= "<script language=\"JavaScript\">\n<!--\n var flg2=0;\n function new_tick_blink(){\n var myElement=document.getElementById('blnk2');\n flg2^=1;\n if(flg2==1){\n myElement.style.visibility='hidden';\n }\n else{\n myElement.style.visibility='visible';\n }\n timerID = setTimeout( 'new_tick_blink()' , 500 );\n }\n //-->\n</script>\n";
  $url_support_check_ticket .= "<span id=\"blnk2\"><a href=\"".$site_sess->url(ROOT_PATH."support.php")."\">".$lang['support_view']."</a></span></a><script language=\"JavaScript\">new_tick_blink();</script>";
  }


Step 1c.
Find
Code: [Select]
   "url_support_ticket" => (!empty($url_support_ticket)) ? $site_sess->url($url_support_ticket) : $site_sess->url(ROOT_PATH."support.php"),
Replace with:
Code: [Select]
"url_support_ticket" => (!empty($url_support_check_ticket)) ? $site_sess->url($url_support_check_ticket) : "<a href=\"".$site_sess->url(ROOT_PATH."support.php")."\">".$lang['support_view']."</a>",

Step 2. Open /template/YOUR TEMPLATE/user_logininfo.html
Find:
Code: [Select]
  &raquo; <a href="{url_support_ticket}">{lang_support_view}</a><br />
Replace with:
Code: [Select]
  &raquo; {url_support_ticket}<br />

Step 3a. Open includes/functions.php
Find:
Code: [Select]
function post_ticket($id="",$status="",$subject="none",$message="none",$priority="low",$catagory="none",$attachment="") {
  global $user_info, $site_db, $session_info, $config;
  $user_info_id = "";
  $current_time = "";
  $user_name = $user_info['user_name'];
  $user_info_id = $user_info['user_id'];
  if($id==""){$current_time = time();}
  if($config['trouble_ticket_ip_log'] && $user_info['user_level'] != ADMIN){$ip_info=$session_info['session_ip'];}
  else{$ip_info="";}
  $sql = "INSERT INTO ".SUPPORT_TABLE." (`id` ,`status` ,`create_date` ,`last_update` ,`user_id` ,`catagory` ,`message` ,`priority` ,`ip`,`attachment`,`last_reply`,`subject`,`reply_id`)
          VALUES('','$status','$current_time','".time()."','$user_info_id','$catagory','$message','$priority','$ip_info','$attachment','$user_name','$subject','$id')";  
  if ($site_db->query($sql)) {
  if ($id=="") {return true;}
  else{
  $sql = "UPDATE ".SUPPORT_TABLE."
            SET last_update = ".time()." , last_reply = '".$user_info['user_name']."'
            WHERE id = $id";
  if ($site_db->query($sql)){return true;}
  else{return false;}
  }
  }
  else{return false;}
  }

Replace with:
Code: [Select]
function post_ticket($id="",$status="",$subject="none",$message="none",$priority="low",$catagory="none",$attachment="") {
  global $user_info, $site_db, $session_info, $config;
  $user_info_id = "";
  $current_time = "";
  $user_name = $user_info['user_name'];
  $user_info_id = $user_info['user_id'];
  if($id==$user_info['user_name']){$current_time = time();}
  if($config['trouble_ticket_ip_log'] && $user_info['user_level'] != ADMIN){$ip_info=$session_info['session_ip'];}
  else{$ip_info="";}
  $sql = "INSERT INTO ".SUPPORT_TABLE." (`id` ,`status` ,`create_date` ,`last_update` ,`user_id` ,`catagory` ,`message` ,`priority` ,`ip`,`attachment`,`last_reply`,`subject`,`reply_id`)
          VALUES('','$status','$current_time','".time()."','$user_info_id','$catagory','$message','$priority','$ip_info','$attachment','$user_name','$subject','$id')";  
  if ($site_db->query($sql)) {
  if ($id=="") {return true;}
  else{
  $sql = "UPDATE ".SUPPORT_TABLE."
            SET last_update = ".time()." , last_reply = '".$user_info['user_name']."', is_read = '0'
            WHERE id = $id";
  if ($site_db->query($sql)){return true;}
  else{return false;}
  }
  }
  else{return false;}
  }


Step 3b.
At the end, but before the ?> Paste:
Code: [Select]
function new_ticket_check($user_id,$user_name){
global $site_db;
  $sql = "SELECT *
          FROM ".SUPPORT_TABLE."
          WHERE user_id = '$user_id' AND is_read = '0' AND last_reply != '$user_name'"; 
$result = $site_db->query($sql);
$num_tick = $site_db->get_numrows($result);
if($num_tick != 0){
return true;
}
else{
return false;
}

}


Step 4.
Download the files attached to this post and replace the support.php in your root directory and run the update_support.php

Now your done. Remember only do this if you have installed the support script allready. I have updated the codes and files to include this.

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
Re: [MOD] Support Ticket System
« Reply #18 on: September 06, 2008, 03:45:45 AM »
Nice Dude!

Can you make a Blinking Text by New Ticket, only for Admin too?

Offline Deskcom

  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: [MOD] Support Ticket System
« Reply #19 on: September 06, 2008, 03:52:08 AM »
Nice Dude!

Can you make a Blinking Text by New Ticket, only for Admin too?

Do you mean make the Trouble Ticket System link in the Admin Control Panel Blink?

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
Re: [MOD] Support Ticket System
« Reply #20 on: September 06, 2008, 10:45:39 PM »
Sorry for my english:
[translate]

No, I mean this the text in the User_logininfo for only the admin flashes. It is like at the code of KurtW. Member more newly applies, one it flashes in the user_loginfo but for which only if admin.

Like this:
http://www.4homepages.de/forum/index.php?topic=21590.0

Offline Deskcom

  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: [MOD] Support Ticket System
« Reply #21 on: September 07, 2008, 12:31:50 AM »
Ok, I see, I will have a modified version and i will post it soon

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
Re: [MOD] Support Ticket System
« Reply #22 on: September 07, 2008, 02:23:44 AM »
Wow, very nice Dude!

Offline Deskcom

  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: [MOD] Support Ticket System
« Reply #23 on: September 07, 2008, 02:34:08 AM »
I am working a feature for the admin side. It will take the ticket system from the admin and make there ticket system a admin center for all tickets. So pretty much change from only seeing and making tickets on there side, it will change it to were they can view and access all tickets without having to go to the admin panel and it will be set to blink when a ticket is updated and when a new on is posted.

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
Re: [MOD] Support Ticket System
« Reply #24 on: September 07, 2008, 01:04:55 PM »
This is really Nice! Do this that way. This gets extremely good!

rinaldos

  • Guest
Re: [MOD] Support Ticket System
« Reply #25 on: September 20, 2008, 11:49:42 AM »
Very nice MOD,
but it is possible if someone had written a ticket, that i can see it without opened the ACP?

Ingo

Offline Deskcom

  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: [MOD] Support Ticket System
« Reply #26 on: September 20, 2008, 11:52:56 AM »
not at the moment, but I'm working it to were all admins will be able to look at tickets when they login to the gallery in the user info panel.

Offline Mr_LovaLove

  • Full Member
  • ***
  • Posts: 233
  • Unkown
    • View Profile
Re: [MOD] Support Ticket System
« Reply #27 on: September 21, 2008, 03:00:27 PM »
Thank you for the nice MOD

really helpful for the members and guest as well

but im facing a problem with the installation,

here is an error appears to me in the page_header

Code: [Select]
Fatal error: Call to undefined function new_ticket_check() in /home/alwasmy/public_html/143/image/includes/page_header.php on line 86

and the code in the line 86 is :

Code: [Select]
$url_support_check_ticket = "";
if(new_ticket_check($user_info['user_id'],$user_info['user_name'])){
  $url_support_check_ticket .= "<script language=\"JavaScript\">\n<!--\n var flg2=0;\n function new_tick_blink(){\n var myElement=document.getElementById('blnk2');\n flg2^=1;\n if(flg2==1){\n myElement.style.visibility='hidden';\n }\n else{\n myElement.style.visibility='visible';\n }\n timerID = setTimeout( 'new_tick_blink()' , 500 );\n }\n //-->\n</script>\n";
  $url_support_check_ticket .= "<span id=\"blnk2\"><a href=\"".$site_sess->url(ROOT_PATH."support.php")."\">".$lang['support_view']."</a></span></a><script language=\"JavaScript\">new_tick_blink();</script>";
  }
 

English Please :@

Offline Deskcom

  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: [MOD] Support Ticket System
« Reply #28 on: September 21, 2008, 04:48:56 PM »
Make sure this section of script is in your includes/function.php file. I just checked the install and seem to have not placed it in the installation setup.

Code: [Select]
function new_ticket_check($user_id,$user_name){
global $site_db;
  $sql = "SELECT *
          FROM ".SUPPORT_TABLE."
          WHERE user_id = '$user_id' AND is_read = '0' AND last_reply != '$user_name'"; 
$result = $site_db->query($sql);
$num_tick = $site_db->get_numrows($result);
if($num_tick != 0){
return true;
}
else{
return false;
}

}

Offline Mr_LovaLove

  • Full Member
  • ***
  • Posts: 233
  • Unkown
    • View Profile
Re: [MOD] Support Ticket System
« Reply #29 on: September 22, 2008, 02:11:40 PM »
thank you for the fast replay ,

the problem solved

but seem i have another problem  with the main.php

after the member post the ticket, a msg appears to him says "Your ticket has been successfully added. We process tickets as they come in. Please be patient. To view your tickets View Support Ticket(s)">Click Here or visit the `View Support Ticket(s)` in your control panel"

the url is on view Support Ticket(s)  and it must be on Click Here

anyway when i click on the Support Ticket(s) to see the ticket

it gave me wrong url


i attached the error

also,

im not sure if this mod is done 100% or its has future plans

coz must if the html files are not used ~ :S
« Last Edit: September 22, 2008, 03:01:45 PM by Mr_LovaLove »
English Please :@