Page 1 of 1

Suggestion: ability to group Canned messages

Posted: Wed Mar 27, 2013 4:05 pm
by srumberg
Version of script: 2.4.2
What terms did you try when SEARCHING for a solution: canned, group

Suggestion: It would be nice for the admin to be able to organize canned messages by creating groups, such as "How to", "Support options", "Links", "Ordering info", etc. Ideally, a message could be assigned to multiple groups.

Why? I have so many canned messages that it's getting difficult to locate the desired message.

Example: Admin is able to create various groups. When the admin creates a message, there is a form with checkboxes listing the groups. Admin clicks the checkboxes of those groups in which the message should appear.

P.S. I'm using the word "group" instead of "category" to avoid confusion with the existing Knowledgebase "Categories".

Re: Suggestion: ability to group Canned messages

Posted: Mon Apr 01, 2013 1:25 pm
by Lisaweb
This is how I organized them. I used a category: description nomenclature when naming them:

How to: Recharge your widgets
How to: Remove battery from widget
Links: Link to widget manual
Links: Link to widget warranty
Support: To claim a warranty repair...
Support: Please provide your model number
Support: Sorry, you are out of warranty

Re: Suggestion: ability to group Canned messages

Posted: Wed Apr 24, 2013 5:24 pm
by srumberg
I followed Lisa's suggestion and then added code to display the groups separated by a blank line. Makes the list easy to read:

I modified file /hesk/admin/admin_ticket.php, function hesk_printCanned() at approximately line 1499:

Code: Select all

	<?php
# add 1 line: add divider between categories
  $current_group_name = '';
	while ($mysaved = hesk_dbFetchRow($res))
	{
# add 8 lines: add divider between categories
      # get the group name, using the text before the colon as the name
      $group_name = preg_split('/:/', $mysaved[1]);
      # has group name changed?
      if ($group_name[0] != $current_group_name):
        # output divider and update name holder
        $can_options .= '<option value="0"> ' . "</option>\n";
        $current_group_name = $group_name[0];
      endif;

      $can_options .= '<option value="' . $mysaved[0] . '">' . $mysaved[1]. "</option>\n";
	    echo 'myMsgTxt['.$mysaved[0].']=\''.str_replace("\r\n","\\r\\n' + \r\n'", addslashes($mysaved[2]))."';\n";
	}