Page 3 of 6
Posted: Wed Apr 25, 2007 8:14 am
by Poooh
Hi,
After upgrading a working installation it showed a blank page. The bug was in the hesk_settings.inc.php in this line:
Code: Select all
$hesk_settings['server_path']="/home/mysite/public_html/hesk";
I had an extra comma inserted and it looked like this:
Code: Select all
$hesk_settings['server_path']=''/home/mysite/public_html/hesk';
Could someone confirm this bug?
Thanks!
Posted: Wed Apr 25, 2007 11:09 am
by Klemen
Don't see a reason why this should happen, certainly not something I can find in the code. Anyone else experienced this?
Posted: Thu May 31, 2007 6:20 pm
by tsjaar
Well, I know this is not really a bug, but when deleting a ticket, the attachments are not beeing deleted. Is this on purpose, or is this a feature

?
It's hard to find out what attachments can be deleted after a while.
Do you think you will be including this in a next version?
It should be something in delete_tickets.php. I think there are 2 options:
- Read the database for attachments (hesk_tickets, hesk_replies), and delete them one by one.
- Brute force read all files, and if a file starts with the ticket ID, delete it
Wich way do you think is faster? (probably depends on how many attachements there are)
Posted: Fri Jun 01, 2007 6:50 am
by tsjaar
I've been coding this bit for myself.
Can you tell me what you think of this solution?
delete_tickets.php
Code: Select all
$i=0;
$numFilesDeleted = 0;
$msgAttDeleted = '';
/* DELETE */
if ($_POST['a']=="delete") {
$title = $hesklang['tickets_deleted'];
$msg = $hesklang['num_tickets_deleted'];
foreach ($_POST['id'] as $this_id)
{
$this_id=hesk_isNumber($this_id,$hesklang['id_not_valid']);
//get track id for deleting attachments
$sql = "SELECT trackid FROM `hesk_tickets` WHERE `id`=$this_id LIMIT 1";
$result = hesk_dbQuery($sql) or hesk_error("$hesklang[cant_sql]: $sql</p><p>$hesklang[mysql_said]:<br>".mysql_error()."</p><p>$hesklang[contact_webmsater] $hesk_settings[webmaster_mail]");
$ticket = hesk_dbFetchAssoc($result);
$trackID = $ticket[trackid];
$sql="DELETE FROM `hesk_tickets` WHERE `id`=$this_id LIMIT 1";
hesk_dbQuery($sql) or hesk_error("$hesklang[cant_sql]: $sql</p><p>$hesklang[mysql_said]:<br>".mysql_error()."</p><p>$hesklang[contact_webmsater] $hesk_settings[webmaster_mail]");
$sql="DELETE FROM `hesk_replies` WHERE `replyto`=$this_id";
hesk_dbQuery($sql) or hesk_error("$hesklang[cant_sql]: $sql</p><p>$hesklang[mysql_said]:<br>".mysql_error()."</p><p>$hesklang[contact_webmsater] $hesk_settings[webmaster_mail]");
$i++;
//delete files starting with $this_id
if ($handle = opendir($hesk_settings['server_path'].'/attachments/')) {
while (false !== ($file = readdir($handle))) {
if (substr($file, 0, 11) == $trackID .'_') {
$numFilesDeleted ++;
unlink($hesk_settings['server_path'].'/attachments/'.$file);
}
}
closedir($handle);
}
}
$msgAttDeleted = ' (' . $hesklang['attachments'] . ':' . $numFilesDeleted . ')';
}
and add the message to the original message:
Code: Select all
<p align="center"><b><?php printf($msg,$i); echo $msgAttDeleted; ?>.</p>
Posted: Fri Jun 01, 2007 1:13 pm
by Klemen
Will make something for the next version, until I do use whatever works for you
Reading names from DB and deleting the know files would probably be better than brute-force search of attachments folder.
Posted: Sat Jun 02, 2007 10:06 am
by crbmarketing
I believe this is a bug.
we have the main administrator and more than one person doing support and each has assigned categories.
if an account is set as admin then they get notices of ALL mails it totally ignores the click here to be notified only of tickets to your categories option. if you are not admin then you cant access canned responses.
we have tried everything we can think of to fix it even adding the code for category to the submit and reply files in the main and mail folders. that just showed %%CATEGORIES%% in the emails is sent and not the actual category
Posted: Sat Jun 02, 2007 7:39 pm
by Klemen
Admins have access to all categories (not just individual ones) so they are notified of all responses.
And yes, only admins have access to managing canned responses, you can allow all staff there by removing
from manage_canned.php
And where did you get the info that %%CATEGORIES%% actually shows category in the e-mail? It doesn't and it's not listed as a special tag in readme file. It needs editing to allow something like that, there's another post about it but still needs some work.
Posted: Sat Jun 02, 2007 7:53 pm
by crbmarketing
I found the tag $category in several places in the files so I
edited the submit_ticket.php file to ad this in both places
$message=str_replace('%%CATEGORY%%',$category,$message);
and placed this in new_ticket_staff.php
Category: %%CATEGORY%%
but when i get the email it shows Category: %%CATEGORY%% not the category like the other similar codes do.
Posted: Mon Jun 04, 2007 9:33 am
by Klemen
Well that isn't a bug with Hesk, it's a bug with YOUR modifications which don't work, so it doesn't belong to Hesk bug reports topic.
Just a a guideline you need to place $message=str_replace('%%CATEGORY%%',$category,$message); TWICE inside submit_ticket.php file. The first mail is generated for the customer, the second time it's for the staff (you probably only have it the first time).
Also that alone won't do, it will just print out category ID number, not name. You will also need this:
viewtopic.php?p=6316#6316
It's not verry secure
Posted: Mon Jan 07, 2008 1:34 pm
by Phost
(Removed by Klemen)
Posted: Mon Jan 07, 2008 9:30 pm
by Klemen
You are right, will add some checking in the next version. This shouldn't be viewable to all.
Re: It's not verry secure
Posted: Wed Feb 13, 2008 9:29 pm
by Phost
Phost wrote:(Removed by Klemen)
Always not fixed...
Please fixe it !
Posted: Wed Feb 13, 2008 9:32 pm
by Klemen
You can expect a new version hopefully by the end of February.
Posted: Wed Feb 13, 2008 9:52 pm
by Klemen
And before the new version is out you can use this fix:
http://www.phpjunkyard.com/extras/att_check.zip
small bug
Posted: Tue Jun 24, 2008 2:01 pm
by tzes
Version 0941, os:Linux
if Ticket status is: Waiting reply from customer
and Staff or customer closes ticket, then reopens it
Status changes to: Waiting reply from staff