4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Deskcom on September 03, 2008, 06:31:55 AM

Title: [MOD] Support Ticket System
Post by: Deskcom on September 03, 2008, 06:31:55 AM
NOTE: Nov 26 2012
All further support and development for this addon have been moved over to Sumale.nin. Which will provide support and furture development. Thank you for all your support guys and wish you all the best of luck.


Description:
This script is designed to give your users the ability to make trouble tickets when problems occur on your gallery. All data is kept in MYSQL tables and can be viewed later for future reference in case the problem arises again. Below is a list of features and tested version(s) of the 4image gallery.

Features:
--Individual User Access(Only the user that makes the ticket can view it, except in control panel)
--Customizable Category Fields
--Logs User's IP(s) of all replies and tickets
--Able to Close,Open Tickets
--Lock Tickets from being reopen
--When ticket is close, it may be allowed to reopen in case if problem is not completed.
--Remove specific users from using ticket system
--Supports Captcha to reduce spamming
--Able to hide closed tickets by default in the ticket console.
--Separate Ticket Console to View/Edit tickets.
--Status Marker Posts to show any changes to the physical ticket.
--Enable and Disable Ticket System via Admin Settings.
--Ability to upload images(JPG only) for screenshot purposes
--Ability to search for tickets by(Priority, Status, Category, Ticket ID, User ID, Subject, Date Created)
--Paging on Ticket List
--View Ticket Link will blink when tickets have been updated, but not read yet.

Tested on:
1.7.6 - 1.7.7


Updated on: 9/5/08
9/2 - Simplified Step 7a(Thanks to:Phisker B)
9/3 - Added German Translation(Thanks to:Phisker B)
9/3 - Supports Backup of the table files
9/5 - Blinking indication of an updated ticket.


Add On:
Spellchecker Mod by Phisker B (http://www.4homepages.de/forum/index.php?topic=22624.msg123526#msg123526)


Modded Files:
include/constants.php
include/page_header.php
include/functions.php

admin/settings.php
admin/index.php
admin/users.php
admin/backup.php

lang/english/admin.php
lang/english/main.php

/template/YOUR TEMPLATE/style.css
/template/YOUR TEMPLATE/user_logininfo.html


New Files:
/template/YOUR TEMPLATE/Support.html
/template/YOUR TEMPLATE/ticket_bit.html
/template/YOUR TEMPLATE/support_new_ticket.html
/template/YOUR TEMPLATE/support_menu.html
/template/YOUR TEMPLATE/support_read_ticket.html
/template/YOUR TEMPLATE/reply_bit.html

support.php
support_install.php
admin/support.php


Mods You Will Need:
[MOD] Drop down options for custom database fields  (http://www.4homepages.de/forum/index.php?topic=7112.0)




WARNING: PLEASE BACKUP DATABASE AND WEBSITE DATA.




Step 1. Download the file support_files at the bottom of this post and place the files in the order below.

./template/YOUR TEMPLATE/Support.html
./template/YOUR TEMPLATE/ticket_bit.html
./template/YOUR TEMPLATE/support_new_ticket.html
./template/YOUR TEMPLATE/support_menu.html
./template/YOUR TEMPLATE/support_read_ticket.html
./template/YOUR TEMPLATE/reply_bit.html

./support.php
./support_install.php

./admin/support.php



Step 2. Openincludes/constants.php

Find:
Code: [Select]
define('LIGHTBOXES_TABLE', $table_prefix.'lightboxes');
Paste After:
Code: [Select]
define('SUPPORT_TABLE', $table_prefix.'support');

Step 3a. Open includes/page_header.php

Find:
Code: [Select]
 "url_lightbox" => $site_sess->url(ROOT_PATH."lightbox.php"),
Paste After:
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>",
   "url_support_ticket_new" => (!empty($url_support_ticket)) ? $site_sess->url($url_support_ticket) : $site_sess->url(ROOT_PATH."support.php?action=newticket"),
   "support_ticket_activ" => $config['trouble_ticket_activate'],


Step 3b.

Find:
Code: [Select]
 "lang_advanced_search" => $lang['advanced_search'],
  "lang_lightbox" => $lang['lightbox'],

Paste After:
Code: [Select]
 "lang_support_new" => $lang['support_new'],

Step 3c.

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 4. Open includes/functions.php

Before ?> at the end of the file. Paste:
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;}
  }

function get_total_user_tickets($user) {
global $site_db;
  $sql = "SELECT *
          FROM ".SUPPORT_TABLE."
          WHERE user_id = $user AND reply_id = 0";  
$result = $site_db->query($sql);
return $site_db->get_numrows($result);
}

function check_closed_ticket($id) {
global $site_db;
  $sql = "SELECT status
          FROM ".SUPPORT_TABLE."
          WHERE id = $id";  
$status_row = $site_db->query_firstrow($sql);
return ($status_row['status'] == "Closed") ? 1 : 0;
}
function reopen_ticket($id) {
global $site_db,$user_info;
  $sql = "UPDATE ".SUPPORT_TABLE."
            SET status = 'Reopen'
            WHERE id = $id";
  $ticket_msg = "***Reopend Request Placed By: ".$user_info['user_name']."***";
  if ($site_db->query($sql)){
  if (post_ticket($id,"","**REOPENED**",$ticket_msg,"","","")){
  return true;
  }
  else{return false;}
  }
  else{return false;}
}
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 5. Open admin/settings.php

The XX need to be replaced with 8, BUT if you have installed other mods that have been placed in here look for the last "show_table_separator($setting_group" and there will be a number in the [] brackets. Take that number and add one to it and place it in place of the XX. Make sure you keep the number, you will need it later.

Find:
Code: [Select]
 show_form_footer($lang['save_changes'], "", 2);
Before it Paste:
Code: [Select]
 show_table_separator($setting_group[XX], 2, "setting_group_XX");
  show_setting_row("trouble_ticket_activate", "radio");
  show_setting_row("trouble_ticket_ip_log", "radio");
  show_setting_row("trouble_ticket_attachment", "radio");
  show_setting_row("trouble_ticket_captcha", "radio");
  show_setting_row("hide_closed_tickets", "radio");
  show_setting_row("trouble_ticket_img_size");
  show_setting_row("trouble_ticket_catagories");
  show_setting_row("trouble_ticket_priority");


Step 6. Open admin/index.php

Find:
Code: [Select]
         show_nav_option($lang['nav_general_settings'], "settings.php?action=modifysettings");
Paste After:
Code: [Select]
 show_nav_option($lang['nav_general_tickets'], "support.php");

Step 7a. Open admin/users.php

Find:
Code: [Select]
 $user_invisible = intval($HTTP_POST_VARS['user_invisible']);
Paste After:
Code: [Select]
 $user_support = intval($HTTP_POST_VARS['user_support']);


Step 7b. (Updated 9/3/08 Step Simplified)

Find:
Code: [Select]
"user_icq")." = '$user_icq'
Paste After:
Code: [Select]
, user_support = '$user_support'


Step 7c.

Find:
Code: [Select]
 show_radio_row($lang['field_invisible'], "user_invisible", $user_row['user_invisible']);
Paste After:
Code: [Select]
 show_radio_row($lang['nav_general_tickets'], "user_support", $user_row['user_support']);

Step 8.

English: Open lang/LANGUAGE/main.php

Before the ?> at the end of the file paste:
Code: [Select]
//-----------------------------------------------------
//--- Sopport Ticket ----------------------------------
//-----------------------------------------------------
$lang['support_register_no_priv'] = "You must register or log in to view your support ticket(s)";
$lang['stream_support'] = "Support Ticket System";
$lang['support_view'] = "View Support Ticket(s)";
$lang['support_new'] = "Start New Ticket";
$lang['new_support_ticket'] = "New Ticket";
$lang['catagory'] = "Catagory";
$lang['priority'] = "Priority";
$lang['ticket_status'] = "Current ticket status:";
$lang['attachments'] = "Attachemnts";
$lang['support_register_no_activ'] = "Trouble Ticket System is Disabled";
$lang['ticket_subject_required'] = "Subject is required before submiting";
$lang['ticket_message_required'] = "Message is required before submiting";
$lang['ticket_error_upload'] = "Error: A problem occurred during file upload!";
$lang['ticket_error_rename'] = "Error: Please rename your file.";
$lang['ticket_error_size'] = "Error: Only .jpg images under {max_size} are accepted for upload";
$lang['ticket_error_unknown'] = "Error: Please Contact Admin or Try back later";
$lang['ticket_new_passed'] = "<center>Your ticket has been successfully added. We process tickets as they come in. Please be patient. To view your tickets <a href=\"{url_support_ticket}\">Click Here</a>  or visit the `View Support Ticket(s)` in your control panel.</center>";
$lang['ticket_last_reply'] = "Last Replier";
$lang['ticket_last_update'] = "Last Update Date";
$lang['ticket_create_date'] = "Ticket Create Date";
$lang['ticket_last_reply'] = "Replied By:";
$lang['click_for_img'] = "Click for attached Image";
$lang['ticket_reopen_passed'] = "Your ticket has been reopened. An Administrator will view it as soon as possible.";
$lang['ticket_error_reopen'] = "There was an error when reopening your ticket. Try again later";
$lang['close_ticket_disclose'] = "<p style=\"font-weight:bold\" align=\"center\">Your ticket is currently closed out. This states that the problem has been corrected and this ticket no longer needs to be noticed. The admin will no longer view this ticket and all methods of replying have been disabled.</br></br>If you feel the problem has not been corrected or the problem continues. Click the button bellow to reopen the ticket and reply with the description of the problem. An Administrator will view it as soon as possible.</p></br>";
$lang['perm_locked'] = "<p style=\"font-weight:bold\" align=\"center\">Your ticket has been closed and locked from any type of reopening. The information will continue to be stored here for future reference if the problem would occur in the future. DO NOT submit another ticket in reference to this problem. Thank you for notifing us of this problem.</p></br>";
$lang['support_register_ban'] = "You have been locked out of the Support Ticket System, this may have occured due to harassment or spamming of the system. You will be locked out until further notice from the admin. Please contact admin for questions on the reason for the ban.";


German: Open lang/LANGUAGE/main.php

Before the ?> at the end of the file paste:
Code: [Select]
$lang['support_register_no_priv'] = "Du musst eingeloggt sein um deine Support Tickets zu sehen!";
$lang['stream_support'] = "Support Ticket System";
$lang['support_view'] = "Support Tickes ansehen";
$lang['support_new'] = "Neues Ticket starten";
$lang['new_support_ticket'] = "Neues Ticket";
$lang['catagory'] = "Kategorie";
$lang['priority'] = "Priorit&auml;t";
$lang['ticket_status'] = "Aktueller Ticketstatus:";
$lang['attachments'] = "Attachemnts";
$lang['support_register_no_activ'] = "Support Ticket System ist deaktiviert!";
$lang['ticket_subject_required'] = "Es muss ein Betreff gew&auml;lt werden!";
$lang['ticket_message_required'] = "Es muss eine Nachricht angegeben werden!";
$lang['ticket_error_upload'] = "Ooops!: Ein Problem beim Upload ist aufgetreten!";
$lang['ticket_error_rename'] = "Ooops!: Benenne deine Datei um.";
$lang['ticket_error_size'] = "Ooops!: Nur *.jpg Dateien unter {max_size} sind erlaubt!";
$lang['ticket_error_unknown'] = "Ooops!: Kontaktiere den Webmaster oder versuche es sp&auml;ter nocheinmal!";
$lang['ticket_new_passed'] = "<center>Dein Ticket wurde erfolgreich aufgenommen. Wir bearbeiten die Tickets schnellst m&ouml;glich. Bitte habe etwas Geduld. Um deine Tickets anzusehen, <a href=\"{url_support_ticket}\">Klicke hier</a>  oder klicke im Controlpanel auf `Support Tickets ansehen`!</center>";
$lang['ticket_last_reply'] = "Letzte Antwort";
$lang['ticket_last_update'] = "Letzter Update Tag";
$lang['ticket_create_date'] = "Tag der erstellung";
$lang['ticket_last_reply'] = "Geantwortet von:";
$lang['click_for_img'] = "Klicke f&uuml;r beigef&uuml;gte Datei";
$lang['ticket_reopen_passed'] = "Dein Ticket ist wieder eröffnet worden. Ein Administrator betrachtet es sobald wie m&ouml;glich.";
$lang['ticket_error_reopen'] = "Ooops! Es gab ein Fehler beim &ouml;ffnen deines Tickets. Bitte komme sp&auml;ter wieder!";
$lang['close_ticket_disclose'] = "<p style=\"font-weight:bold\" align=\"center\">Dein Ticket wurde nun geschlossen. Dies gibt an, dass das Problem korrigiert worden ist, und dieses Ticket nicht mehr beachtet werden muss. Wenn du der Meinung bist, dass dein Problem nicht gel&ouml;st worden ist, dann klicke auf auf wieder &ouml;ffnen des Tickets mit Angabe warum und ein Admin wird sich um das Problem bem&uuml;hen!</p></br>";
$lang['perm_locked'] = "<p style=\"font-weight:bold\" align=\"center\">Dein Ticket wurde gscchlossen und kann nicht mehr ge&ouml;ffnet werden! Das Ticket wird aber f&uuml;r eine Gewisse Zeit gespeichert, falls ein Problem gleichermassen auftreten sollte, damit man dieses Ticket noch einmal abfangen kann! Bitte er&ouml;ffne kein weiteres Ticket f&ouml;r das gleiche Problem. Wir danken f&uuml;r dein Verst&auml;ndniss!</p></br>";
$lang['support_register_ban'] = "Du wurdest vom Ticketsystem ausgeschlossen! Dies kann mehrere Gr&uuml;nde haben und liegt allein im Interesse der Administration!";


Step 9.

English: Open lang/LANGUAGE/admin.php

The number in the step 5, I aksed you to remember, replace the XX with that number.
Before the ?> at the end of the file paste:
Code: [Select]
/*-- Setting-Group XX --*/
$setting_group[XX]="Trouble Ticket System";
$setting['trouble_ticket_activate'] = "Enable Trouble Ticket System";
$setting['trouble_ticket_catagories'] = "Trouble Ticket Catagories List<br /><span class=\"smalltext\">Seperate catagories with a , between them</span>";
$setting['trouble_ticket_priority'] = "Trouble Ticket Priority List<br /><span class=\"smalltext\">Seperate catagories with a , between them and they will be sorted based on the order they are in</span>";
$setting['trouble_ticket_ip_log'] = "Log IP Address on all submited tickets";
$setting['trouble_ticket_attachment'] = "Allow users to upload attachments<br /><span class=\"smalltext\">JPEG attachments only, Just for screenshot purposes</span>";
$setting['trouble_ticket_captcha'] = "Uses Captcha when submiting a new ticket<br /><span class=\"smalltext\">Enabling helps reduce spam tickets showing up in the list</span>";
$setting['trouble_ticket_img_size'] = "MAX File size that can be uploaded in KB's";
$setting['hide_closed_tickets'] = "Hide closed tickets by default<br /><span class=\"smalltext\">This feature will auto hide all closed tickets. If you use search to view closed tickets it will show closed tickets the results.</span>";

$lang['nav_general_tickets'] = "Trouble Ticket System";
$lang['ticket_id'] = "Ticket ID";
$lang['ticket_subject'] = "Subject";
$lang['date_created'] = "Date Created";
$lang['date_updated'] = "Last Updated";
$lang['ticket_user_id'] = "User ID";
$lang['ticket_status'] = "Status";
$lang['ticket_cat'] = "Catagory";
$lang['ticket_prio'] = "Priority";
$lang['ticket_ip'] = "User IP";
$lang['ticket_replies'] = "Ticket Replies";
$lang['ticket_reply_to'] = "Rpley To Ticket";
$lang['ticket_search_header'] = "Search Ticket System";
$lang['status_any'] = "Any";
$lang['status_open'] = "Open";
$lang['field_closed'] = "Closed";
$lang['no_log_ip'] = "No Loged IP";
$lang['status_reopen'] = "Reopen";
$lang['update_ticket'] = "Update Ticket";
$lang['ticket_attachment'] = "Attachment";
$lang['perm_lock'] = "Permanently Locked";


German: Open lang/LANGUAGE/admin.php

The number in the step 5, I aksed you to remember, replace the XX with that number.
Before the ?> at the end of the file paste:
Code: [Select]
/*-- Setting-Group xx --*/
$setting_group[xx]="Support Ticket System";
$setting['trouble_ticket_activate'] = "Schalte das Ticket System ein";
$setting['trouble_ticket_catagories'] = "Ticket Kategorien<br /><span class=\"smalltext\">Mit einem , (KOMMA) werden die Kategorien getrennt</span>";
$setting['trouble_ticket_priority'] = "Ticket Pr&auml;oritäts Liste<br /><span class=\"smalltext\">Mit einem , (KOMMA) werden die Pr&auml;orit&auml;ten getrennt und sie werden auf Grundlage von der ausgew&auml;hlten Kategorie sortiert</span>";
$setting['trouble_ticket_ip_log'] = "Logge bei jedem Ticke die IP mit";
$setting['trouble_ticket_attachment'] = "Erlaube den Usern ein Datei mitzusenden<br /><span class=\"smalltext\">Nur JPG Dateien sind erlaubt, da nur Screenshots akzeptiert werden</span>";
$setting['trouble_ticket_captcha'] = "Benutze den Captchacode f&uuml;r die Tickets<br /><span class=\"smalltext\">Dies beugt Spam vor und sollte eingeschaltet sein</span>";
$setting['trouble_ticket_img_size'] = "MAXIMALE Dateigr&ouml;sse die erlaubt ist. Angabe in KB";
$setting['hide_closed_tickets'] = "Blende geschlossene Tickets aus<br /><span class=\"smalltext\">Diese Option blendet geschlossen Tickest aus. K&ouml;nnen aber dennoch eingesehen werden!</span>";

$lang['nav_general_tickets'] = "Support Ticket System";
$lang['ticket_id'] = "Ticket ID";
$lang['ticket_subject'] = "Betreff";
$lang['date_created'] = "Erstellungsdatum";
$lang['date_updated'] = "Letztes Update";
$lang['ticket_user_id'] = "User ID";
$lang['ticket_status'] = "Status";
$lang['ticket_cat'] = "Kategorie";
$lang['ticket_prio'] = "Pr&auml;riot&auml;t";
$lang['ticket_ip'] = "User IP";
$lang['ticket_replies'] = "Ticket Antworten";
$lang['ticket_reply_to'] = "Rpley To Ticket";
$lang['ticket_search_header'] = "Durchsuche das Ticket System";
$lang['status_any'] = "Irgendwelche";
$lang['status_open'] = "Offen";
$lang['field_closed'] = "Geschlossen";
$lang['no_log_ip'] = "Keine IP geloggt";
$lang['status_reopen'] = "Neu-&Ouml;ffnen";
$lang['update_ticket'] = "Update Ticket";
$lang['ticket_attachment'] = "Upload";
$lang['perm_lock'] = "Permanent schliessen";


Step 10. Open /template/YOUR TEMPLATE/style.css

Paste this at the end of the file:
Code: [Select]
.open {
  font-family: Tahoma,Verdana,Arial,Helvetica,sans-serif;
  font-size: 11px;
  color: #32cd32;
}
.close {
  font-family: Tahoma,Verdana,Arial,Helvetica,sans-serif;
  font-size: 12px;
  font-weight:bold;
  color: #ff0000;
}
.wait_reply {
  font-family: Tahoma,Verdana,Arial,Helvetica,sans-serif;
  font-size: 12px;
  font-weight:bold;
}


Step 11.
Open /template/YOUR TEMPLATE/user_logininfo.html

Find:
Code: [Select]
 &raquo; <a href="{url_control_panel}">{lang_control_panel}</a><br />
      &raquo; <a href="{url_logout}">{lang_logout}</a><br />

Paste After:
Code: [Select]
 {if support_ticket_activ}
 <br />
 &raquo; {url_support_ticket}<br />
 &raquo; <a href="{url_support_ticket_new}">{lang_support_new}</a><br />
 <br />
 {endif support_ticket_activ}


Step 12. Open admin/backup.php
 (Updated 9/3/08 Added Step for Backup)
Find:
Code: [Select]
 WORDLIST_TABLE,
Paste After:
Code: [Select]
 SUPPORT_TABLE,

Step 13.

Go to your root directory where your 4image gallery is installed go to the data folder and make a folder called "support_media". This is where all images that are sent in your tickets will be stored.

Now run the support_install.php and make sure it goes thought with no errors. Once done your ready. Go to you settings section in you admin control panel and adjust the settings to suit your needs. I hope you enjoy the addition and just give a shout out if you would like to see an other mods on it.
Title: Re: [MOD] Support Ticket System
Post by: kai on September 03, 2008, 08:09:32 AM
Thank you Deskcom!
Title: Re: [MOD] Support Ticket System
Post by: Deskcom on September 03, 2008, 08:15:38 AM
Thank you Deskcom!

No Problem, Hope you enjoy. Let me know if you have any problems
Title: Re: [MOD] Support Ticket System
Post by: AKIN on September 03, 2008, 08:52:31 AM
thanks deskcom. very nice mod.good job
Title: Re: [MOD] Support Ticket System
Post by: Deskcom on September 03, 2008, 08:55:23 AM
thanks deskcom. very nice mod.good job

Thank you, Hope you enjoy
Title: Re: [MOD] Support Ticket System
Post by: Sunny C. on September 03, 2008, 07:25:55 PM
WOW !!!!! NICE!
more.. more.. more.. :D
Title: Re: [MOD] Support Ticket System
Post by: DilnüvaZ on September 03, 2008, 10:09:34 PM
Wow it is very nice mod.. thanks a lot..
 İ will modife it for my website....
Title: Re: [MOD] Support Ticket System
Post by: Deskcom on September 03, 2008, 10:20:26 PM
I will try to clean up the code and make it more sleek. New version soon to arrive.
Title: Re: [MOD] Support Ticket System
Post by: Sunny C. on September 04, 2008, 12:02:41 AM
Hello,

in Step7b in the Red-Line, please write this:

If you have already installed other modifications, then follow this step:

Find:
Code: [Select]
"user_icq")." = '$user_icq'
Add:
Code: [Select]
, user_support = '$user_support'
something like this:
Code: [Select]
"user_icq")." = '$user_icq', user_support = '$user_support'
Edit:

Change:
Step 2. Open constants.php

to:
Step 2. Open includes/constants.php

Step 3a. Open page_header.php
to
Step 3a. Open includes/page_header.php

Step 4. Open functions.php
to
Step 4. Open includes/functions.php

Beginners then understand this, too


This has become a super modification but so.
Your other modification also had turned out very well.
I look forward to further modifications!
Title: Re: [MOD] Support Ticket System
Post by: Deskcom on September 04, 2008, 12:20:17 AM
Thank you Phisker B, I have updated the mod.
Title: Re: [MOD] Support Ticket System
Post by: Sunny C. on September 04, 2008, 01:12:05 AM
No Problem.

Here is the German Translate for lang/LANGUAGE/main.php

Code: [Select]
$lang['support_register_no_priv'] = "Du musst eingeloggt sein um deine Support Tickets zu sehen!";
$lang['stream_support'] = "Support Ticket System";
$lang['support_view'] = "Support Tickes ansehen";
$lang['support_new'] = "Neues Ticket starten";
$lang['new_support_ticket'] = "Neues Ticket";
$lang['catagory'] = "Kategorie";
$lang['priority'] = "Priorit&auml;t";
$lang['ticket_status'] = "Aktueller Ticketstatus:";
$lang['attachments'] = "Attachemnts";
$lang['support_register_no_activ'] = "Support Ticket System ist deaktiviert!";
$lang['ticket_subject_required'] = "Es muss ein Betreff gew&auml;lt werden!";
$lang['ticket_message_required'] = "Es muss eine Nachricht angegeben werden!";
$lang['ticket_error_upload'] = "Ooops!: Ein Problem beim Upload ist aufgetreten!";
$lang['ticket_error_rename'] = "Ooops!: Benenne deine Datei um.";
$lang['ticket_error_size'] = "Ooops!: Nur *.jpg Dateien unter {max_size} sind erlaubt!";
$lang['ticket_error_unknown'] = "Ooops!: Kontaktiere den Webmaster oder versuche es sp&auml;ter nocheinmal!";
$lang['ticket_new_passed'] = "<center>Dein Ticket wurde erfolgreich aufgenommen. Wir bearbeiten die Tickets schnellst m&ouml;glich. Bitte habe etwas Geduld. Um deine Tickets anzusehen, <a href=\"{url_support_ticket}\">Klicke hier</a>  oder klicke im Controlpanel auf `Support Tickets ansehen`!</center>";
$lang['ticket_last_reply'] = "Letzte Antwort";
$lang['ticket_last_update'] = "Letzter Update Tag";
$lang['ticket_create_date'] = "Tag der erstellung";
$lang['ticket_last_reply'] = "Geantwortet von:";
$lang['click_for_img'] = "Klicke f&uuml;r beigef&uuml;gte Datei";
$lang['ticket_reopen_passed'] = "Dein Ticket ist wieder eröffnet worden. Ein Administrator betrachtet es sobald wie m&ouml;glich.";
$lang['ticket_error_reopen'] = "Ooops! Es gab ein Fehler beim &ouml;ffnen deines Tickets. Bitte komme sp&auml;ter wieder!";
$lang['close_ticket_disclose'] = "<p style=\"font-weight:bold\" align=\"center\">Dein Ticket wurde nun geschlossen. Dies gibt an, dass das Problem korrigiert worden ist, und dieses Ticket nicht mehr beachtet werden muss. Wenn du der Meinung bist, dass dein Problem nicht gel&ouml;st worden ist, dann klicke auf auf wieder &ouml;ffnen des Tickets mit Angabe warum und ein Admin wird sich um das Problem bem&uuml;hen!</p></br>";
$lang['perm_locked'] = "<p style=\"font-weight:bold\" align=\"center\">Dein Ticket wurde gscchlossen und kann nicht mehr ge&ouml;ffnet werden! Das Ticket wird aber f&uuml;r eine Gewisse Zeit gespeichert, falls ein Problem gleichermassen auftreten sollte, damit man dieses Ticket noch einmal abfangen kann! Bitte er&ouml;ffne kein weiteres Ticket f&ouml;r das gleiche Problem. Wir danken f&uuml;r dein Verst&auml;ndniss!</p></br>";
$lang['support_register_ban'] = "Du wurdest vom Ticketsystem ausgeschlossen! Dies kann mehrere Gr&uuml;nde haben und liegt allein im Interesse der Administration!";

Edit://

German Translate
lang/LANGUAGE/admin.php

Code: [Select]
/*-- Setting-Group xx --*/
$setting_group[xx]="Support Ticket System";
$setting['trouble_ticket_activate'] = "Schalte das Ticket System ein";
$setting['trouble_ticket_catagories'] = "Ticket Kategorien<br /><span class=\"smalltext\">Mit einem , (KOMMA) werden die Kategorien getrennt</span>";
$setting['trouble_ticket_priority'] = "Ticket Pr&auml;oritäts Liste<br /><span class=\"smalltext\">Mit einem , (KOMMA) werden die Pr&auml;orit&auml;ten getrennt und sie werden auf Grundlage von der ausgew&auml;hlten Kategorie sortiert</span>";
$setting['trouble_ticket_ip_log'] = "Logge bei jedem Ticke die IP mit";
$setting['trouble_ticket_attachment'] = "Erlaube den Usern ein Datei mitzusenden<br /><span class=\"smalltext\">Nur JPG Dateien sind erlaubt, da nur Screenshots akzeptiert werden</span>";
$setting['trouble_ticket_captcha'] = "Benutze den Captchacode f&uuml;r die Tickets<br /><span class=\"smalltext\">Dies beugt Spam vor und sollte eingeschaltet sein</span>";
$setting['trouble_ticket_img_size'] = "MAXIMALE Dateigr&ouml;sse die erlaubt ist. Angabe in KB";
$setting['hide_closed_tickets'] = "Blende geschlossene Tickets aus<br /><span class=\"smalltext\">Diese Option blendet geschlossen Tickest aus. K&ouml;nnen aber dennoch eingesehen werden!</span>";

$lang['nav_general_tickets'] = "Support Ticket System";
$lang['ticket_id'] = "Ticket ID";
$lang['ticket_subject'] = "Betreff";
$lang['date_created'] = "Erstellungsdatum";
$lang['date_updated'] = "Letztes Update";
$lang['ticket_user_id'] = "User ID";
$lang['ticket_status'] = "Status";
$lang['ticket_cat'] = "Kategorie";
$lang['ticket_prio'] = "Pr&auml;riot&auml;t";
$lang['ticket_ip'] = "User IP";
$lang['ticket_replies'] = "Ticket Antworten";
$lang['ticket_reply_to'] = "Rpley To Ticket";
$lang['ticket_search_header'] = "Durchsuche das Ticket System";
$lang['status_any'] = "Irgendwelche";
$lang['status_open'] = "Offen";
$lang['field_closed'] = "Geschlossen";
$lang['no_log_ip'] = "Keine IP geloggt";
$lang['status_reopen'] = "Neu-&Ouml;ffnen";
$lang['update_ticket'] = "Update Ticket";
$lang['ticket_attachment'] = "Upload";
$lang['perm_lock'] = "Permanent schliessen";

Edit// 2

I have an idea!
If one has received a ticket, one shall see one blinking link in the "user_logininfo.html"!

Like this Code by KurtW
http://www.4homepages.de/forum/index.php?topic=21590.0
Title: Re: [MOD] Support Ticket System
Post by: Deskcom on September 04, 2008, 02:43:35 AM
Thank you Phisker B again, I have updated the script and I will get the blinking text mod up soon.
Title: Re: [MOD] Support Ticket System
Post by: Deskcom on September 04, 2008, 03:25:15 AM
(UPDATED 9/3/08)

Updated the mod with the ability to backup the table entries when you do a backup.
Title: Addon
Post by: Sunny C. on September 04, 2008, 03:45:46 AM
Addon
Support Ticket System with my Spellchecker (http://www.4homepages.de/forum/index.php?topic=22141.0) Mod :D

Install my Mod Spellchecker (http://www.4homepages.de/forum/index.php?topic=22141.0)

Then open: templates/YOURTEMPLATE/support_new_ticket.html

Search:
Code: [Select]
<textarea rows="10" cols="30" maxlength="500" name="ticket_msg" class="input" >{ticket_msg}</textarea>
Replace with:
Code: [Select]
<textarea id="content" rows="10" cols="30" wrap="virtual" maxlength="500" name="ticket_msg" class="input" onFocus="myselection(this);" onclick="myselection(this);" onChange="myselection(this);">{ticket_msg}</textarea>
                <script type="text/javascript">
var googie1 = new GoogieSpell("spellcheck/js/", "./spellcheck/sendReq.php?lang=");
googie1.decorateTextarea("content");
  </script>
Title: Re: [MOD] Support Ticket System
Post by: Deskcom on September 04, 2008, 03:53:54 AM
It shall be added
Title: Re: [MOD] Support Ticket System
Post by: Sunny C. 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!
Title: Re: [MOD] Support Ticket System
Post by: Deskcom on September 04, 2008, 03:59:57 AM
Lol, you get some sleep, nini
Title: Re: [MOD] Support Ticket System
Post by: Deskcom 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.
Title: Re: [MOD] Support Ticket System
Post by: Sunny C. on September 06, 2008, 03:45:45 AM
Nice Dude!

Can you make a Blinking Text by New Ticket, only for Admin too?
Title: Re: [MOD] Support Ticket System
Post by: Deskcom 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?
Title: Re: [MOD] Support Ticket System
Post by: Sunny C. 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
Title: Re: [MOD] Support Ticket System
Post by: Deskcom on September 07, 2008, 12:31:50 AM
Ok, I see, I will have a modified version and i will post it soon
Title: Re: [MOD] Support Ticket System
Post by: Sunny C. on September 07, 2008, 02:23:44 AM
Wow, very nice Dude!
Title: Re: [MOD] Support Ticket System
Post by: Deskcom 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.
Title: Re: [MOD] Support Ticket System
Post by: Sunny C. on September 07, 2008, 01:04:55 PM
This is really Nice! Do this that way. This gets extremely good!
Title: Re: [MOD] Support Ticket System
Post by: rinaldos 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
Title: Re: [MOD] Support Ticket System
Post by: Deskcom 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.
Title: Re: [MOD] Support Ticket System
Post by: Mr_LovaLove 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>";
  }
 

Title: Re: [MOD] Support Ticket System
Post by: Deskcom 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;
}

}
Title: Re: [MOD] Support Ticket System
Post by: Mr_LovaLove 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
Title: Re: [MOD] Support Ticket System
Post by: Deskcom on September 22, 2008, 11:43:40 PM
lol, o my. I did not no that. I will get it fix soon.
Title: Re: [MOD] Support Ticket System
Post by: Mr_LovaLove on October 11, 2008, 02:57:47 PM
is waiting ur modification !

Title: Re: [MOD] Support Ticket System
Post by: Nicky on October 12, 2008, 05:44:48 PM
painless way ;)

main.php

change
Code: [Select]
$lang['ticket_new_passed'] = "<center>Your ticket has been successfully added. We process tickets as they come in. Please be patient. To view your tickets <a href=\"{url_support_ticket}\">Click Here</a>  or visit the `View Support Ticket(s)` in your control panel.</center>";

to

Code: [Select]
$lang['ticket_new_passed'] = "<center>Your ticket has been successfully added. We process tickets as they come in. Please be patient. To view your tickets click on {url_support_ticket} or visit the `View Support Ticket(s)` in your control panel.</center>";
Title: Re: [MOD] Support Ticket System
Post by: Nicky on October 13, 2008, 11:17:40 AM
hi Deskcom,

i noticed some "bugs" :)

1.) "Date Created" will be always "01/01/70 01:00"
2.) Format of date is not how i set it in 4images settings
3.) "Message:" will be shown in one line

lang files:
1.) "Catagory" should be "Category"
2.) "Rpley To Ticket" should be "Reply To Ticket"
3.) "Waiting for Admin Replay" should be "Waiting for Admin Reply"

should be added:
"Delete Ticket"

btw. Nice MOD!
Title: Re: [MOD] Support Ticket System
Post by: Deskcom on October 15, 2008, 12:28:44 AM
Sorry about the delay, I have been on another project that I had to get done by Oct 10. I will have an update of the fixes and also the admin ticket mod that I pomised not to far back. Please check back. I will begin work on it tonight.

Thank you
Title: Re: [MOD] Support Ticket System
Post by: kai on October 15, 2008, 07:54:23 AM
I will have an update of the fixes and also the admin ticket mod that I pomised not to far back. Please check back. I will begin work on it tonight.
Great news. Thank you!
Title: Re: [MOD] Support Ticket System
Post by: Deskcom on October 22, 2008, 10:44:00 AM
Quote
1.) "Date Created" will be always "01/01/70 01:00"

Hey Nicky,

I tried to duplicate the same problem with the date. And i do not see it doing to the same on my size. I might be missing it some where. If you or anyone is still seeing the error. Can you please post a screen shot so i can find it.

Thank you

BTW. I set the message on the first box to be the first message that is posted.

Post Edit!!
Title: Re: [MOD] Support Ticket System
Post by: Mimiru on October 22, 2008, 12:29:59 PM
Another little "bug" when you send Ticket (page with: your ticket added bla-bla-bla) and refresh page. New ticket will be created. And if user will "sleep" on F5...
Title: Re: [MOD] Support Ticket System
Post by: Deskcom on October 22, 2008, 05:04:00 PM
I can setup an anti-spam system to it. It will delay you creating a ticket within so many minutes, which can be set in the admin panel
Title: Re: [MOD] Support Ticket System
Post by: Mimiru on October 22, 2008, 06:01:40 PM
I can setup an anti-spam system to it. It will delay you creating a ticket within so many minutes, which can be set in the admin panel
Well... In "good code" all data must be terminated after sending. And it may redirect to "thanks" page. If user refresh page he will get an error page.
Maybe I write this fix by myself, but now I have a little time. So if anyone would like to fix it, please.
Title: Re: [MOD] Support Ticket System
Post by: Deskcom on October 22, 2008, 07:08:19 PM
I can setup an anti-spam system to it. It will delay you creating a ticket within so many minutes, which can be set in the admin panel
Well... In "good code" all data must be terminated after sending. And it may redirect to "thanks" page. If user refresh page he will get an error page.
Maybe I write this fix by myself, but now I have a little time. So if anyone would like to fix it, please.

Even with redirect, most browsers will cache the data. All a user will need to do is back the page 1 - 2 times and resend the data. To stop it from posting all together it may be best to use a time delay to not allow any sending of tickets for a certain time frame. I most cases a user should not need to send more than one ticket at a time. Even still if he does need to send it in. It takes some time to write a new one, giving it time for the delay to run out.
Title: Re: [MOD] Support Ticket System
Post by: Nicky on October 22, 2008, 07:41:38 PM
Descom,

just look into details.php, maybe this you can add into support.php too

Code: [Select]
    // Flood Check
    $sql = "SELECT comment_ip, comment_date
            FROM ".COMMENTS_TABLE."
            WHERE image_id = $id
            ORDER BY comment_date DESC
            LIMIT 1";
    $spam_row = $site_db->query_firstrow($sql);
    $spamtime = $spam_row['comment_date'] + 180;

    if ($session_info['session_ip'] == $spam_row['comment_ip'] && time() <= $spamtime && $user_info['user_level'] != ADMIN)  {
      $msg .= (($msg != "") ? "<br />" : "").$lang['spamming'];
      $error = 1;
    }
Title: Re: [MOD] Support Ticket System
Post by: Mimiru on October 22, 2008, 11:39:25 PM
Even with redirect, most browsers will cache the data. All a user will need to do is back the page 1 - 2 times and resend the data. To stop it from posting all together it may be best to use a time delay to not allow any sending of tickets for a certain time frame. I most cases a user should not need to send more than one ticket at a time. Even still if he does need to send it in. It takes some time to write a new one, giving it time for the delay to run out.
You probably right. "normal" user won't refresh page a 1xxx times, but restrict posting time not good too. Even if anybody found a bug, and then another he must get access to send ticket immediatly (what if this is mega-urgent bug? =) ). But this is more retoric question... o.O
Like a alternate way I can offer to limit a count of tickets per user. ;)
Title: Re: [MOD] Support Ticket System
Post by: Bommel on January 11, 2010, 09:51:46 AM
Hallo allerseits,

zuerst einmal ein Danke für diese MOD.  :thumbup:

Nun meine Problemstellung. In dieser MOD ist ja auch die Funktion vorhanden, dass dieser MOD aktiviert bzw. deaktiviert werden kann. In den entsprechenden Templates gibt es dazu auch die Anfrage:


Wie kann ich jetzt diese Abfrage:

Code: [Select]
{if user_loggedin}
{if support_ticket_activ}
<li><a class="common" href="{url_support_ticket_new}">Neues Support-Ticket</a></li>
<li><a class="common" href="./support.php">Meine Support-Tickets</a></li>
{endif support_ticket_activ}
{endif user_loggedin}
{if user_loggedout}
<li><a class="common" href="https://www.meine-domain.de/contact.php">Kontakt</a></li>
{endif user_loggedout}

im Template so erweitern, dass bei deaktivierten MOD anstelle dessen Link, der Link zum normalen Kontakt-Formular angezeigt wird? Dass es hierzu die Erweiterung "else" gibt, ist mir als Laie klar. Doch was muss wie geändert werden?

Freundliche Grüße, Bommel
Title: Re: [MOD] Support Ticket System
Post by: Jan-Lukas on January 11, 2010, 03:16:14 PM
wo kann man sich den Mod denn mal ansehen ?
Title: Re: [MOD] Support Ticket System
Post by: Bommel on January 11, 2010, 04:06:12 PM
Hallo Jan-Lukas,

im ersten Beitrag dieses Threads: http://www.4homepages.de/forum/index.php?topic=22624.msg123454#msg123454

ganz unten die angehängten Bilder. ;)

Freundliche Grüße, Bommel
Title: Re: [MOD] Support Ticket System
Post by: Jan-Lukas on January 11, 2010, 06:51:58 PM
Hi Bommel,
Danke, aber stehe heute neben die Schuhe, kann mir z.Z. nicht viel unter dem Ticket System vorstellen  :oops:
Ist halt alles in einer toten Sprache geschrieben  :lol:

LG Harald
Title: Re: [MOD] Support Ticket System
Post by: Bommel on January 11, 2010, 07:24:56 PM
...kann mir z.Z. nicht viel unter dem Ticket System vorstellen  :oops:...
Eigentlich müsste es ja Issue-Tracking-System heißen, doch es gibt da so viele Bezeichnungen. Schaue mal hier in der Wikipedia, vielleicht hilft dir das weiter:

http://de.wikipedia.org/wiki/Issue-Tracking-System

Achja, neben den Schuhen stehe ich auch öfters... z.B. bevor ich an die frische Luft gehen will. ;)

Freundliche Grüße, Bommel
Title: Re: [MOD] Support Ticket System
Post by: Jan-Lukas on January 11, 2010, 07:59:15 PM
OK, jetzt dämmert es  :wink:

Danke für den Link

LG Harald
Title: Re: [MOD] Support Ticket System
Post by: Jan-Lukas on January 17, 2010, 01:21:11 PM
bekomme bei der Standart Installation diese Fehlermeldung

Als Admin Eingeloggt:
DB Error: Bad SQL Query: SELECT * FROM 4images_support WHERE user_id = '1' AND is_read = '0' AND last_reply != 'Jan-Lukas'
Unknown column 'is_read' in 'where clause'

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /srv/www/vhosts/ue-ei-portal-sammlerkatalog.de/httpdocs/includes/db_mysql.php on line 116

Als User eingeloggt:

An unexpected error occured. Please try again later.

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /srv/www/vhosts/ue-ei-portal-sammlerkatalog.de/httpdocs/includes/db_mysql.php on line 116


LG Harald

Edit: muss ein Eintrag in der page_header sein, wenn ich die Originale hochlade, ist der Fehler weg

Edit: 2
OK, liegt hier mal wieder daran, das aktuelle Änderungen nicht im 1 Posting editiert wurden, es fehlte der Datenbankeintrag aus diesem Posting
http://www.4homepages.de/forum/index.php?topic=22624.msg123642#msg123642

sollte im 1 Posting mal geändert werden.

LG
Title: Re: [MOD] Support Ticket System
Post by: Jan-Lukas on January 18, 2010, 05:29:55 PM
hi Deskcom,

i noticed some "bugs" :)

1.) "Date Created" will be always "01/01/70 01:00"
2.) Format of date is not how i set it in 4images settings
3.) "Message:" will be shown in one line

lang files:
1.) "Catagory" should be "Category"
2.) "Rpley To Ticket" should be "Reply To Ticket"
3.) "Waiting for Admin Replay" should be "Waiting for Admin Reply"

should be added:
"Delete Ticket"

btw. Nice MOD!


Hi Nicky,
Der Datumsbug ist leider immer noch drin, kannst Du da evtl. mal nach schauen? Die Rechtschreibungsfehler werde ich wohl schaffen ;)

@all
Was ich bis jetzt noch nicht verstanden habe, wie erfährt der Admin, das ein neues Ticket eingegangen ist, muss er immer im Admin nachsehen ?? Das könnte man doch mit dem Blinktext regeln, das für den Admin dann ein Link blinkt (siehe Mod von Kurt (neue Bilder))
Dann ist mir bis heute nicht gelungen ein Bild mit hochzuladen, aber es muss klappen, da ein anderer Admin ja ein Bild mit hochgeladen hat.
Ich habe zwar versucht das gleiche Bild zu nehmen, aber ich bekomme immer nur die Meldung das nur .jpg Bilder genommen werden dürfen *grübel*

LG Harald
Title: Re: [MOD] Support Ticket System
Post by: Sunny C. on January 18, 2010, 08:22:25 PM
Ist doch Blinktext drinne!
Bei mir jedenfalls!
Title: Re: [MOD] Support Ticket System
Post by: Bommel on January 18, 2010, 10:01:30 PM
Hallo allerseits,

die Sache mit der Benachrichtigung für den Admin habe ich so verstanden, dass der Admin in seinem Account nicht über vorliegende Tickets anderer Benutzer informiert wird. Der Blinktext wird dann aktiv, wenn eine Antwort auf ein eigenes Ticket im Sytem vorliegt. Da der Admin aber keine eigene Tickets erstellt hat, wird er auch nicht über eine Antwort auf vorliegende Tickets anderer Benutzer informiert. Obwohl er natürlich beteiligt ist.

Mein Vorschlag hierzu wäre, dass im ACP auf der Startseite oberhalb von "Wer ist online" die letzten 5-10 Tickets angezeigt werden, die neu erstellt wurden oder wo eine neue Nachricht vorliegt. Ebenso könnte auch im normalen Admin-Account im Benutzerlogin-Infobereich eine Anzeigefunktion eingerichtet werden, die mitteilt wenn neue Tickets oder Antworten vorliegen. So ähnlich wie hier im Forum der Nachrichtenstatus oben links im Bereich "User-Info".

Freundliche Grüße, Bommel
Title: Re: [MOD] Support Ticket System
Post by: Jan-Lukas on January 18, 2010, 10:20:32 PM
Sorry, dieser Mod ist doch ein Support Ticket, das heisst, die User kommen mit Problemen zum Admin, zu wem sollten sie sonst mit ihrem Anliegen kommen.
Was hätte dieser Mod sonst für einen Sinn, oder können andere auch auf ein Ticket antworten ? Dann wäre der Titel "Support Ticket" falsch gewählt, und ich würde es wieder deaktivieren.
Title: Re: [MOD] Support Ticket System
Post by: Bommel on January 18, 2010, 10:40:07 PM
Hallo Jan-Lukas,

ich sage es mal so - es ist ein Schönheitsfehler, der aber nicht wirklich stört. Ich selber habe im ACP-Navigationsmenü den Menüpunkt für die MOD aus dem Bereich "Allgemein" ausgegliedert und einen eigenen Bereich zugewiesen. Dieser steht direkt an erster Stelle im Navigationsmenü und soll mich daran erinnern, dort immer als erstes hineinzuschauen ob eventuell Tickets vorliegen. Genauso habe ich für Moderatoren die Berechtigung erweitert, so dass ich einzelnen Moderatoren Zugriff auf diese MOD im ACP geben kann.

Diese MOD ist schon eine sinnvolle Erweiterung, da es mir bei der Ordnung dieser Angelegenheiten bestens entgegenkommt. ;)

Freundliche Grüße, Bommel
Title: Re: [MOD] Support Ticket System
Post by: zhono on November 12, 2010, 07:38:02 AM
Great mod. I'm using it on a wallpaper site so people can report "stolen" wallpapers. But I'm having a few problem.

I'm having the problem mentioned by Nicky: "Date Created" will be always "01/01/70 01:00"

And also, when the "View Support Ticket(s)" link in the user info is blinking, you can't click on it. Well you can, but have have to click on it a bunch of times, really fast, and hope it hits one time. Is there an easy way to disable the blinking? I don't really need it. I'm using 4images 1.7.7


*EDIT*

Fixed the blinking thing. Just removed this from the page_header.php:

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>";
  }

Still need to fix the creation date problem though. Also noticed that when you view a ticket in the admincp, when reading the replies, there's nothing there to tell you which user each message belongs to. It makes it look a little confusing, especially if more than one admin responds to the ticket.
Title: Re: [MOD] Support Ticket System
Post by: clubbu on September 15, 2011, 03:21:09 PM
Hello.

I have a problem whit this mod.

When a user open a ticket, I look this opened date: 01/01/70 01:00 it's possibile fix this bug?

Another question.. is possible send and email whit an user open a new ticket?

Title: Re: [MOD] Support Ticket System
Post by: ante226 on September 12, 2012, 07:28:57 PM
Hallo

wenn ich auf support erstellen gehen habe ich nur ein weisses bild  ???
wenn ich aber Ticket Kategorien & Ticket Präoritäts Liste lösche im Admin bereich geht alles ???

könnte mir einer sagen wo der fehler ist

und wie bekomme ich das inleben der support box größer


m-f-g
ante

Title: Re: [MOD] Support Ticket System
Post by: ante226 on September 26, 2012, 03:14:19 PM
schade das keiner mehr helfen kan
Title: Re: [MOD] Support Ticket System
Post by: nobby on September 26, 2012, 03:24:15 PM
schade das keiner mehr helfen kan

Hallo,

warum immer so ungeduldig  8O

95 Pronzent der User hier im Forum haben immer nur Fragen. Die wenigsten machen hier überhaupt mit.

Und die letzten 5 Prozent sollen alles Wissen und Beantworten, das geht irgendwie wohl nicht auf, oder....

Und die müssen auch noch Arbeiten oder sind anderweitig Beschäftigt....

Das kann halt mal länger Dauern....

nobby
Title: Re: [MOD] Support Ticket System
Post by: MrAndrew on November 02, 2012, 04:12:32 PM
Please, tell me how to add additional fields? Thx!
Title: Re: [MOD] Support Ticket System
Post by: alexxa on January 11, 2013, 02:42:25 PM
Hi, great mod it works just fine. I have one question:
Where can I change the code to allow pdf upload not only jpg.

Thanks
Title: Re: [MOD] Support Ticket System
Post by: SolidSnake0308 on September 01, 2013, 06:26:34 PM
Fatal error: Call to undefined function get_dropdown_options() in /www/htdocs/.../admin/support.php on line 174
AFTER CLICK in Admin Panel

Fatal error: Call to undefined function get_dropdown_options() in /www/htdocs/.../support.php on line 187
AFTER Click Start New Ticket


PLEASE HELP
Title: Re: [MOD] Support Ticket System
Post by: senloel on September 01, 2013, 09:24:45 PM
Fatal error: Call to undefined function get_dropdown_options() in /www/htdocs/.../admin/support.php on line 174
AFTER CLICK in Admin Panel

Fatal error: Call to undefined function get_dropdown_options() in /www/htdocs/.../support.php on line 187
AFTER Click Start New Ticket


PLEASE HELP

http://www.4homepages.de/forum/index.php?topic=7112.0 (http://www.4homepages.de/forum/index.php?topic=7112.0)

installed this MOD?
Title: Re: [MOD] Support Ticket System
Post by: SolidSnake0308 on September 01, 2013, 10:52:35 PM
Fatal error: Call to undefined function get_dropdown_options() in /www/htdocs/.../admin/support.php on line 174
AFTER CLICK in Admin Panel

Fatal error: Call to undefined function get_dropdown_options() in /www/htdocs/.../support.php on line 187
AFTER Click Start New Ticket


PLEASE HELP

http://www.4homepages.de/forum/index.php?topic=7112.0 (http://www.4homepages.de/forum/index.php?topic=7112.0)

installed this MOD?


No, till now.

Thanks, it works.
Title: Re: [MOD] Support Ticket System
Post by: mac420 on June 25, 2014, 08:37:49 AM
Hello.

When a user open a ticket, I look this opened date: 01/01/70 01:00 it's possibile fix this bug?



Open: includes/functions.php

Find:
Code: [Select]
  $user_info_id = "";
  $current_time = "";

Replace:
Code: [Select]
  $user_info_id = "";
  $current_time = time();


_mac