Kayako logo
Modifications & Addon Releases Modification guides and addons are posted here to share with the community. Do not post requests in here!

Notices

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  (#16) Old
Sheep Offline
Member
 
Sheep's Avatar
 
Posts: 350
Join Date: Feb 2007
Location: Lyon, France
30-07-2007, 09:50 AM

This one is a bit more advanced (code speaking)

Feature request:
Client side: the IRS doesn't search in KB title

Modifications:
first, you have to modify the database

execute the following queries (change the prefix if yours is not sw)
Quote:
ALTER TABLE `swkbarticles` TYPE = MyISAM;
ALTER TABLE `swkbarticles` ADD FULLTEXT `subject` (`subject`);

in modules/knowledgebase/functions_irs.php
find near line 65
PHP Code:
$dbCore->query("SELECT kbarticlelinks.kbarticleid, MATCH(kbarticledata.contents) AGAINST ('"$dbCore->escape($_finalworddata) ."') AS relevance FROM `"TABLE_PREFIX ."kbarticledata` AS kbarticledata LEFT JOIN `"TABLE_PREFIX ."kbarticlelinks` AS kbarticlelinks ON (kbarticledata.kbarticleid = kbarticlelinks.kbarticleid) LEFT JOIN `"TABLE_PREFIX ."tgroupassigns` AS tgroupassigns ON (kbarticlelinks.kbcategoryid = tgroupassigns.toassignid AND tgroupassigns.type = '"TGROUP_KNOWLEDGEBASE ."') WHERE tgroupassigns.tgroupid = '"intval($_SWIFT["tgroup"]["tgroupid"]) ."' AND MATCH(kbarticledata.contents) AGAINST('"$dbCore->escape($_finalworddata) ."') LIMIT 5;"); 
replace by
PHP Code:
$dbCore->query("SELECT kbarticlelinks.kbarticleid, MATCH(kbarticledata.contents) AGAINST ('"$dbCore->escape($_finalworddata) ."') AS relevance, MATCH(kbarticles.subject) AGAINST ('"$dbCore->escape($_finalworddata) ."') AS relevancetitle  FROM `"TABLE_PREFIX ."kbarticledata` AS kbarticledata LEFT JOIN `"TABLE_PREFIX ."kbarticlelinks` AS kbarticlelinks ON (kbarticledata.kbarticleid = kbarticlelinks.kbarticleid) LEFT JOIN `"TABLE_PREFIX ."tgroupassigns` AS tgroupassigns  ON (kbarticlelinks.kbcategoryid = tgroupassigns.toassignid AND tgroupassigns.type = '"TGROUP_KNOWLEDGEBASE ."') LEFT JOIN `"TABLE_PREFIX ."kbarticles` AS kbarticles ON kbarticledata.kbarticleid=kbarticles.kbarticleid WHERE tgroupassigns.tgroupid = '"intval($_SWIFT["tgroup"]["tgroupid"]) ."' AND (MATCH(kbarticledata.contents) AGAINST('"$dbCore->escape($_finalworddata) ."') OR MATCH (kbarticles.subject) AGAINST ('"$dbCore->escape($_finalworddata) ."')) LIMIT 5 "); 

if you're using SERM
replace
PHP Code:
$dbCore->query("SELECT kbarticlelinks.kbarticleid, MATCH(kbarticledata.contents) AGAINST ('"$dbCore->escape($_finalworddata) ."') AS relevance FROM `"TABLE_PREFIX ."kbarticledata` AS kbarticledata LEFT JOIN `"TABLE_PREFIX ."kbarticlelinks` AS kbarticlelinks ON (kbarticledata.kbarticleid = kbarticlelinks.kbarticleid) LEFT JOIN `"TABLE_PREFIX ."tgroupassigns` AS tgroupassigns ON (kbarticlelinks.kbcategoryid = tgroupassigns.toassignid AND tgroupassigns.type = '"TGROUP_KNOWLEDGEBASE ."') WHERE "sermFilterAsQuery('kbcategoryid',$_SWIFT["user"]["usergroupid"],'kb')." AND tgroupassigns.tgroupid = '"intval($_SWIFT["tgroup"]["tgroupid"]) ."' AND MATCH(kbarticledata.contents) AGAINST('"$dbCore->escape($_finalworddata) ."') LIMIT 5;"); 
by
PHP Code:
$dbCore->query("SELECT kbarticlelinks.kbarticleid, MATCH(kbarticledata.contents) AGAINST ('"$dbCore->escape($_finalworddata) ."') AS relevance, MATCH(kbarticles.subject) AGAINST ('"$dbCore->escape($_finalworddata) ."') AS relevancetitle  FROM `"TABLE_PREFIX ."kbarticledata` AS kbarticledata LEFT JOIN `"TABLE_PREFIX ."kbarticlelinks` AS kbarticlelinks ON (kbarticledata.kbarticleid = kbarticlelinks.kbarticleid) LEFT JOIN `"TABLE_PREFIX ."tgroupassigns` AS tgroupassigns  ON (kbarticlelinks.kbcategoryid = tgroupassigns.toassignid AND tgroupassigns.type = '"TGROUP_KNOWLEDGEBASE ."') LEFT JOIN `"TABLE_PREFIX ."kbarticles` AS kbarticles ON kbarticledata.kbarticleid=kbarticles.kbarticleid WHERE "sermFilterAsQuery('kbcategoryid',$_SWIFT["user"]["usergroupid"],'kb')." AND tgroupassigns.tgroupid = '"intval($_SWIFT["tgroup"]["tgroupid"]) ."' AND (MATCH(kbarticledata.contents) AGAINST('"$dbCore->escape($_finalworddata) ."') OR MATCH (kbarticles.subject) AGAINST ('"$dbCore->escape($_finalworddata) ."')) LIMIT 5 "); 

a bit further
replace
PHP Code:
  while ($dbCore->nextRecord())
  {
   
$_kbarticleidlist[] = $dbCore->Record["kbarticleid"];
   
$_relevance[] = $dbCore->Record["relevance"];
   
$_relevancepointer[$dbCore->Record["kbarticleid"]] = $dbCore->Record["relevance"];
  } 
by
PHP Code:
  while ($dbCore->nextRecord())
  {
   
$_kbarticleidlist[] = $dbCore->Record["kbarticleid"];
   if (
$dbCore->Record["relevance"]>$dbCore->Record["relevancetitle"])
                
$relevance=$dbCore->Record["relevance"];
            else
                
$relevance=$dbCore->Record["relevancetitle"];
   
$_relevance[] = $relevance;
   
$_relevancepointer[$dbCore->Record["kbarticleid"]] = $relevance;
  } 


Antoine "Sheep" BERMON
-- Lurking around there --
   
Reply With Quote
  (#17) Old
craigbrass Offline
Senior Member
 
Posts: 5,762
Join Date: Jun 2005
Location: Cumbria, UK
30-07-2007, 09:57 AM

Thanks for sharing Antoine.


Craig Brass - Kayako Forum Squatter (Note: I am NOT a staff member)

Icon Headquarters - Its Elixir - Web2Messenger
   
Reply With Quote
  (#18) Old
Sheep Offline
Member
 
Sheep's Avatar
 
Posts: 350
Join Date: Feb 2007
Location: Lyon, France
30-07-2007, 02:43 PM

updated QMS1, i found how to sort troubleshooters steps.


Antoine "Sheep" BERMON
-- Lurking around there --
   
Reply With Quote
  (#19) Old
Sheep Offline
Member
 
Sheep's Avatar
 
Posts: 350
Join Date: Feb 2007
Location: Lyon, France
02-08-2007, 05:04 PM

Strange that this isn't by default

Feature request:
When Ticket Setting "HTML Conversion" is set to STRIP. Some default tags (b,u etc..) should stay. Lets use the parameters of the mail parser.

Modifications:
in modules/tickets/functions_ticketmain.php
find near line 2470
PHP Code:
  } else if ($_SWIFT["settings"]["t_chtml"] == "strip") {
   return 
getProcessedHTML(strip_tags($content)); 
replace by
PHP Code:
  } else if ($_SWIFT["settings"]["t_chtml"] == "strip") {
   return 
getProcessedHTML(strip_tags($content,$_SWIFT["settings"]["pr_allowabletags"])); 
Edit:
In fact i've done something else
Code -> strip_tags is such a pain


Antoine "Sheep" BERMON
-- Lurking around there --

Last edited by Sheep; 03-08-2007 at 02:20 PM.
   
Reply With Quote
  (#20) Old
Matthew Offline
Member
 
Matthew's Avatar
 
Posts: 195
Join Date: Oct 2007
Location: Jakarta, Indonesia
Sheep's QuickLinks Mod - Revisited - 15-02-2008, 08:50 AM

Quote:
Originally Posted by Sheep View Post
Feature request:
Staff pannel, creating/editing a kb article: I'd like to have a quick box like in the new ticket, that allows me to quick create a link to a download file

Animation:
See results here:
http://www.sheep.fr/EONA/Kayako-Supp...y/QMS/QMS2.htm
I wanted to be able to do the same thing when creating Troubleshooters for both Downloads and Knowledgebase articles. I reasoned that it's better for a troubleshooter to reference an existing KB article rather than create the same or similar content in both the TS and the KB. I also wanted to be able to link one KB article with another KB article. The results are provided below.

While the code for creating the KB menu is basically the same as for the DL menu, the original function that inserts the KB link does not include a parameter for the article title. So instead of an article title, you get a link saying, See Knowledgebase Article ID x. Just change the text to the article title, if that's what you want, or maybe someone can figure out how to insert it automatically.

I've also modified Sheep's code very slightly, making the links to the icon images relative rather than absolute (so they don't reference the Iona site), and adding a bit of space between icon and text. Other than that, this is mostly copy-paste work. (Edit 2008-04-08: I've also updated the code slightly to work with v3.20.02)

Here's the complete mod:

Modifications:
In modules/troubleshooter/functions_knowledgebase.php
Near line 914, find:
PHP Code:
printhtmlAreaRow("contents"$_SWIFT["language"]["contents"], $_POST["contents"]); 
Insert before it:

PHP Code:
    //Quicklinks Mod
    
echo '<script type="text/javascript">
    selectedTab = "kbedit";
    </script>'

        echo 
'<tr class="'getRowBG() .'">
    <td width="100" align="left" id="fmenuref"><span class="tabletitle">QuickLink To:</span></td>
    <td align="left"><a href="#" title="Knowledgebase" id="fkbcachelink" onClick="javascript:CustomPopupRef(\'kbcachemenu\', event, \'fkbcachelink\', \'kbcachemenu\', \'fmenuref\', kbmenuloaded);this.blur();" onMouseUp="javascript:this.blur();"><img src="'
$_SWIFT["themepath"] .'icon_quickinsert.gif" border="0" align="absmiddle" />&nbsp;Knowledgebase&nbsp;<img src="'$_SWIFT["themepath"] .'menudrop.gif" border="0" align="absmiddle" /></a>&nbsp;&nbsp;&nbsp;</td>
    </tr>; 

    <tr class="'
getRowBG() .'">
    <td width="100" align="left" id="fmenuref"><span class="tabletitle">&nbsp;</span></td>
    <td align="left"><a href="#" title="Downloads" id="fdlcachelink" onClick="javascript:CustomPopupRef(\'dlcachemenu\', event, \'fdlcachelink\', \'dlcachemenu\', \'fmenuref\', dlmenuloaded);this.blur();" onMouseUp="javascript:this.blur();"><img src="'
$_SWIFT["themepath"] .'icon_quickinsert.gif" border="0" align="absmiddle" />&nbsp;Downloads&nbsp;<img src="'$_SWIFT["themepath"] .'menudrop.gif" border="0" align="absmiddle" /></a>&nbsp;&nbsp;&nbsp;
    </td>
    </tr>'
;  
    
//End Quicklinks Mod 
In modules/troubleshooter/functions_troubleshooter.php
Find near line 324:
PHP Code:
printhtmlAreaRow("contents"$_SWIFT["language"]["contents"], $_POST["contents"], 25getTRHtmlArea()); 
Insert before the line:

PHP Code:
    //Quicklinks mod
    
echo '<script type="text/javascript">
    selectedTab = "kbedit";
    </script>'

        echo 
'<tr class="'getRowBG() .'">
    <td width="100" align="left" id="fmenuref"><span class="tabletitle">QuickLink To:</span></td>
    <td align="left"><a href="#" title="Knowledgebase" id="fkbcachelink" onClick="javascript:CustomPopupRef(\'kbcachemenu\', event, \'fkbcachelink\', \'kbcachemenu\', \'fmenuref\', kbmenuloaded);this.blur();" onMouseUp="javascript:this.blur();"><img src="'
$_SWIFT["themepath"] .'icon_quickinsert.gif" border="0" align="absmiddle" />&nbsp;Knowledgebase&nbsp;<img src="'$_SWIFT["themepath"] .'menudrop.gif" border="0" align="absmiddle" /></a>&nbsp;&nbsp;&nbsp;</td>
    </tr>; 

    <tr class="'
getRowBG() .'">
    <td width="100" align="left" id="fmenuref"><span class="tabletitle">&nbsp;</span></td>
    <td align="left"><a href="#" title="Downloads" id="fdlcachelink" onClick="javascript:CustomPopupRef(\'dlcachemenu\', event, \'fdlcachelink\', \'dlcachemenu\', \'fmenuref\', dlmenuloaded);this.blur();" onMouseUp="javascript:this.blur();"><img src="'
$_SWIFT["themepath"] .'icon_quickinsert.gif" border="0" align="absmiddle" />&nbsp;Downloads&nbsp;<img src="'$_SWIFT["themepath"] .'menudrop.gif" border="0" align="absmiddle" /></a>&nbsp;&nbsp;&nbsp;
    </td>
    </tr>'

    
//End Quicklinks mod 
In themes/admin_default/main.js

In function autoInsertKB(), find:
PHP Code:
} else {
        
fetchData("kb"kbarticleid); 
Insert before the line:

PHP Code:
    // Insert KB Quicklink mod
    
} else if (formname=="swiftform") {
       
editor.setHTML(editor.getHTML()+'<img src="/themes/client_default/mimeico_blank.gif" border="0" />&nbsp;<a href="../index.php?_m=knowledgebase&_a=viewarticle&kbarticleid='+kbarticleid+'&nav=0,5">See Knowledgebase Article ID '+kbarticleid+'</a>');
    
// end KB Quicklink mod 
In function autoInsertDL(), find:

PHP Code:
} else if (link != "") { 
Insert before the line:
PHP Code:
    // Insert DL Quicklink mod
     
} else if (formname=="swiftform") {
        
editor.setHTML(editor.getHTML()+'<img src="/themes/client_default/mimeico_blank.gif" border="0" />&nbsp;<a href="../index.php?_m=downloads&_a=viewdownload&downloaditemid='+downloaditemid+'&nav=0">'+title+'</a>');    } else if (link != "") {
    
// End DL Quicklink mod 
Further down, in function getActiveFormName(), find:
PHP Code:
  } else {
  
formname "replyform";
 } 
Insert before the line:
PHP Code:
    // Quicklink mods
    
} else if (selectedTab == "kbedit") { 
        
formname "swiftform";
    
// End Quicklink mods 
This is is a nice little mod. Enjoy!


Matthew Arciniega
+ Free: Ticket List & Search Mods
| Dept. Display Names
+ Free: (Almost) Perfect Outlook/HTML Tickets
+ Tutorials: SLA System Explained
| Using Template Groups
Kayako v3.20.02 | PHP: 5.2.6 | MySQL: 5.0.58 | CentOS 4

Last edited by Matthew; 08-04-2008 at 12:58 PM. Reason: Error corrections and updates for v3.20.02
   
Reply With Quote
  (#21) Old
Mikie Offline
Member
 
Posts: 153
Join Date: Jan 2004
16-02-2008, 08:44 AM

These changes can be made ONLY if you have the code and since Kayako is so problematic i cant see myself upgrading to get the source code. Its one thing if their support didnt suck as bad as it does and its another if they were at least hald respondant. Then and only then i would consider upgrading just to get the code. But at this time, they can forget it.
   
Reply With Quote
  (#22) Old
Sheep Offline
Member
 
Sheep's Avatar
 
Posts: 350
Join Date: Feb 2007
Location: Lyon, France
16-02-2008, 05:24 PM

Good job matthew! I've edited my post to link to your improvment.

Mikie > please don't waste your hate in this thread, because i'm getting notifications emails. Thanks


Antoine "Sheep" BERMON
-- Lurking around there --

Last edited by Sheep; 16-02-2008 at 05:28 PM.
   
Reply With Quote
  (#23) Old
Mikie Offline
Member
 
Posts: 153
Join Date: Jan 2004
18-02-2008, 08:18 AM

Im saying thank you to you. Im also saying that unless you have the code these modification cant be made.
   
Reply With Quote
  (#24) Old
tom@ecentralsto Offline
New Member
 
tom@ecentralsto's Avatar
 
Posts: 15
Join Date: Sep 2007
Location: Florida
14-03-2008, 06:13 PM

Dear Antoine,

Thanks for sharing this improvement to the support suite. I've installed the mod and am very happy with the added functionality. I would like to note that your directions were somewhat limited. And ran into an issue because the code states yourdomain.com which is great and all, but you never notifed the user that this needs to be edited. Only took a second to figure out this and your default link to the images needs to also be edited to the installation directory on the users server, this was never mentioned. Just thought I would inform the kayako community. So, If the image is blank check the paths on the code in this file functions_knowledgebase.php, also if the link in the staff view links you to the download section and doesn't add to the article text box you should check the URL paths in the file functions_knowledgebase.php

Hope this helps someone,


Thomas Pursifull
tom@ecentralstores.com
   
Reply With Quote
  (#25) Old
Sheep Offline
Member
 
Sheep's Avatar
 
Posts: 350
Join Date: Feb 2007
Location: Lyon, France
14-03-2008, 06:42 PM

Eh, i've been getting a lot a notifications emails lately (even job offers ...)

Hello tom,

Are you refering to QMS2? (DL quicklinks)
Matthew fixed it & month ago (and his fix is linked in QMS2 description).


Sorry for the lack of guidelines, but it's just a "quick share" (it has not been done for kayako's community at first and it's "developers oriented").

I hope you'll enjoy the other mods.

Greetings
Antoine


Antoine "Sheep" BERMON
-- Lurking around there --
   
Reply With Quote
  (#26) Old
craigbrass Offline
Senior Member
 
Posts: 5,762
Join Date: Jun 2005
Location: Cumbria, UK
14-03-2008, 08:22 PM

Quote:
(even job offers ...)
That isn't surprising. You have proved you know your way around PHP and Kayako's software. People prefer to use people who have proved themselves.


Craig Brass - Kayako Forum Squatter (Note: I am NOT a staff member)

Icon Headquarters - Its Elixir - Web2Messenger
   
Reply With Quote
  (#27) Old
Matthew Offline
Member
 
Matthew's Avatar
 
Posts: 195
Join Date: Oct 2007
Location: Jakarta, Indonesia
Quicklinks mod updated - 08-04-2008, 01:07 PM

I've updated the Quicklinks Mod (see this post) to work with v3.20.02.

Enjoy the results. One of my favorite mods, and guaranteed to be one of yours, too. Sheep is my Kayako God. I'm still waiting for the Second Coming...


Matthew Arciniega
+ Free: Ticket List & Search Mods
| Dept. Display Names
+ Free: (Almost) Perfect Outlook/HTML Tickets
+ Tutorials: SLA System Explained
| Using Template Groups
Kayako v3.20.02 | PHP: 5.2.6 | MySQL: 5.0.58 | CentOS 4
   
Reply With Quote
  (#28) Old
tom@ecentralsto Offline
New Member
 
tom@ecentralsto's Avatar
 
Posts: 15
Join Date: Sep 2007
Location: Florida
18-04-2008, 05:04 PM

Dear Antoine "Sheep" BERMON,

I was refering to the QMS2 (DL quicklinks in the Knowledge base )

Sorry, was not clear on this.

I will say that you seem to have a great understanding of the software, and was hoping for a similar modification. We would like to have a modification to the status's of tickets.

Currently, you are unable to select mutiple departments for a custom status.
This looks like a similar modification like I've seen out there for the live chat modification to allow for multiple departments for the live chat tag generator in the Staff CP.

Just thought I would ask you, for you seem to know much about modifications.

I've looking for this on the forum only seen a few post about people ask about doing this, I haven't seen any modification posted yet.

Thanks for your time and efforts!


Thomas Pursifull
tom@ecentralstores.com
   
Reply With Quote
  (#29) Old
Sheep Offline
Member
 
Sheep's Avatar
 
Posts: 350
Join Date: Feb 2007
Location: Lyon, France
23-04-2008, 10:58 PM

Sorry, i'm not doing work related to supporsuite anymore (except one last thing i promised i'd do).

Sincerely,
Antoine


Antoine "Sheep" BERMON
-- Lurking around there --
   
Reply With Quote
Reply

Tags
modifs, quick, sheep, thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tickets -> Ability to delete thread from within a ticket mtalebi SupportSuite, eSupport and LiveResponse 0 09-06-2008 07:08 PM



Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47