I had an issue where i wanted to only display help for certain departments within specific sections of my website. The current release of the product only lets you either have all departments available or only lets you choose a single department per support link.
The modification i have made allows you to now multiselect departments when you use the Tag Generator. From here you now have a list of departments in the <SCRIPT> block used to generate the live chat popup window link. When this window pops up it now only displays the departments chosen in the tag instead of the current all or one senerio.
From this, it will only detect and display the correct status for the selected departments.
:: EXAMPLE SENERIO ::
Your site sells car audio and car performence products. In the car audio section of your website you can now have a support link that only deals with "Car Audio Sales" and "Car Audio Support".
In turn, in the performence products section you could then have a seperate support link to deal with "Ask a pro", "Performence Parts Sales" and so on.
When a visitor click on the support link created through the Tag Generator, they will only be shown the appropriate departments for that section of your website.
:: File Modifications ::
I am by no means an established PHP developer but i know my way around it enough.
There are 9 changes in 2 files to be made.
Code:
:: FILE ::
/modules/livesupport/function_livesupport.php
change (line 342)
- else if ($dbCore->Record["departmentmodule"] == MODULE_LIVESUPPORT && $departmentid == $dbCore->Record["departmentid"])
change to
- else if ($dbCore->Record["departmentmodule"] == MODULE_LIVESUPPORT && in_array($dbCore->Record["departmentid"], explode(",", $departmentid))) {
change (line 289)
- if ($dbCore->Record["departmentid"] == $departmentid)
change to
- if (in_array($dbCore->Record["departmentid"], explode(",", $departmentid)))
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
:: FILE ::
/modules/livesupport/staff_tags.php
change (line 50)
- $htmlcode .= '<script language="javascript" src="'. $_SWIFT["swiftpath"] .'visitor/index.php?_m=livesupport&_a=htmlcode&departmentid='. $departmentid .'"></script>'.SWIFT_CRLF;
change to
- $htmlcode .= '<script language="javascript" src="'. $_SWIFT["swiftpath"] .'visitor/index.php?_m=livesupport&_a=htmlcode&departmentid='. implode(",", $departmentid) .'"></script>'.SWIFT_CRLF;
change (line 80)
- printSelectRow("departmentid", $_SWIFT["language"]["fordepartment"], $_SWIFT["language"]["desc_fordepartment"], $options);
change to
- printSelectMultipleRow("departmentid", $_SWIFT["language"]["fordepartment"], $_SWIFT["language"]["desc_fordepartment"], $options);
change (line 108)
- $htmlcode .= '<a href="'. $_SWIFT["swiftpath"] .'visitor/index.php?_m=livesupport&_a=emailchat&departmentid='. $departmentid .'"><img src="'. $_SWIFT["swiftpath"] .'visitor/index.php?_m=livesupport&_a=emailimage&departmentid='. $departmentid .'" border="0" /></a>'.SWIFT_CRLF;
change to
- $htmlcode .= '<a href="'. $_SWIFT["swiftpath"] .'visitor/index.php?_m=livesupport&_a=emailchat&departmentid='. implode(",", $departmentid) .'"><img src="'. $_SWIFT["swiftpath"] .'visitor/index.php?_m=livesupport&_a=emailimage&departmentid='. implode(",", $departmentid) .'" border="0" /></a>'.SWIFT_CRLF;
change (line 137)
- printSelectRow("departmentid", $_SWIFT["language"]["fordepartment"], $_SWIFT["language"]["desc_fordepartment"], $options);
change to
- printSelectMultipleRow("departmentid", $_SWIFT["language"]["fordepartment"], $_SWIFT["language"]["desc_fordepartment"], $options);
change (line 164)
- $htmlcode .= '<script language="javascript" src="'. $_SWIFT["swiftpath"] .'visitor/index.php?_m=livesupport&_a=htmlcode&departmentid='. $departmentid .'&custom='.urlencode($custom).'"></script>'.SWIFT_CRLF;
change to
- $htmlcode .= '<script language="javascript" src="'. $_SWIFT["swiftpath"] .'visitor/index.php?_m=livesupport&_a=htmlcode&departmentid='. implode(",", $departmentid) .'&custom='.urlencode($custom).'"></script>'.SWIFT_CRLF;
change (line 201)
- printSelectRow("departmentid", $_SWIFT["language"]["fordepartment"], $_SWIFT["language"]["desc_fordepartment"], $options);
change to
- printSelectMultipleRow("departmentid", $_SWIFT["language"]["fordepartment"], $_SWIFT["language"]["desc_fordepartment"], $options);
change (line 229)
- $htmlcode .= '<script language="javascript" src="'. $_SWIFT["swiftpath"] .'visitor/index.php?_m=livesupport&_a=htmlcode&nolink=1&departmentid='. $departmentid.'"></script>'.SWIFT_CRLF;
change to
- $htmlcode .= '<script language="javascript" src="'. $_SWIFT["swiftpath"] .'visitor/index.php?_m=livesupport&_a=htmlcode&nolink=1&departmentid='. implode(",", $departmentid).'"></script>'.SWIFT_CRLF;
I really think that this is a valuable modification and that the Kayako guys consider including this in the next release.
Thanks
Steve