|
![]() |
| | LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
(#1)
|
| New Member Posts: 25 Join Date: Aug 2007 SupportSuite Owned License | Yet another mod to the user lookup facility when creating a new ticket -
18-09-2007, 08:46 AM
SupportSuite version 3.11.01 stable When creating a new ticket, you can search for the user (or contact) the ticket relates to, and it'll typically show their name and email address(es). When creating a new phone ticket, you can click the search button next to phone number, type in user/contact name, and click an email address and have that inserted as a phone number. Oops! This mod prevents that from happening, forcing user email addresses to only ever be inserted in the email address field. Similarly, clicking phone numbers (see below) will also only be put in the phone number field. This mod only affects users, not contacts. However, it's not too big a task to expand this concept to contacts too. In my particular situation, I don't have more than one phone number per user, so I'm using 'phone' field in the 'users' table to specify a phone number. Doing this manually via SQL at the moment (see New fields in 'edit users' page). Assuming a user has - A name - A phone number - An email address clicking their name in the search box will result in all 3 fields being filled out! If they don't have one of the above fields registered, it'll still try. In my tests in Firefox 2.0.0.6, this didn't result in any errors, however, your mileage may vary. Changes provided in form of diff/patch files again, both attached and included below. Code: patch /path/to/kayako/modules/core/functions_userlookup.php userlookup.diff.txt Code: deeps@tickets:~/kayako$ cat userlookup.diff
*** trunk/upload/modules/core/functions_userlookup.php 2007-09-18 09:06:11.000000000 +0200
--- branches/deepsdev/upload/modules/core/functions_userlookup.php 2007-09-18 09:21:04.000000000 +0200
***************
*** 44,50 ****
}
// Ok, now build the user list
! $dbCore->query("SELECT users.userid, users.fullname FROM `". TABLE_PREFIX ."users` AS users WHERE users.userid IN (". buildIN($_useridlist) .");");
while ($dbCore->nextRecord())
{
$_userlist[$dbCore->Record["userid"]] = $dbCore->Record;
--- 44,50 ----
}
// Ok, now build the user list
! $dbCore->query("SELECT users.userid, users.fullname, users.phone FROM `". TABLE_PREFIX ."users` AS users WHERE users.userid IN (". buildIN($_useridlist) .");");
while ($dbCore->nextRecord())
{
$_userlist[$dbCore->Record["userid"]] = $dbCore->Record;
***************
*** 69,83 ****
} else {
$usericon = 'icon_yellowbigdot.gif';
}
! $_usernode = &$usersnode->addItem(new HTML_TreeNode(array('text' => " ". addslashes($val["fullname"]) ." ". iif($emailcount>1, '('.intval($emailcount).')'), 'link' => "javascript:windowPlaceEmail(\'". addslashes($val["emails"][0]) ."\', \'".addslashes($_GET["formname"])."\', \'". addslashes($_GET["formfield"]) ."\')", 'icon' => $usericon, 'expandedIcon' => $usericon, 'expanded' => true)));
if ($emailcount > 0)
{
foreach ($val["emails"] as $emailkey=>$emailval)
{
! $_emailnode = &$_usernode->addItem(new HTML_TreeNode(array('text' => " ". addslashes($emailval), 'link' => "javascript:windowPlaceEmail(\'". addslashes($emailval) ."\', \'".addslashes($_GET["formname"])."\', \'". addslashes($_GET["formfield"]) ."\')", 'icon' => "icon_msgsmallyellow.gif", 'expandedIcon' => "icon_msgsmallyellow.gif", 'expanded' => true)));
}
}
}
if ($module->isRegistered(MODULE_TEAMWORK))
--- 69,87 ----
} else {
$usericon = 'icon_yellowbigdot.gif';
}
! $_usernode = &$usersnode->addItem(new HTML_TreeNode(array('text' => " ". addslashes($val["fullname"]) ." ". iif($emailcount>1, '('.intval($emailcount).')'), 'link' => "javascript:windowPlaceEmail(\'". addslashes($val["fullname"]) ."\', \'".addslashes($_GET["formname"])."\', \'opt_username\');javascript:windowPlaceEmail(\'". addslashes($val["emails"][0]) ."\', \'".addslashes($_GET["formname"])."\', \'opt_useremail\');javascript:windowPlaceEmail(\'". addslashes($val["phone"]) ."\', \'".addslashes($_GET["formname"])."\', \'opt_userphone\')", 'icon' => $usericon, 'expandedIcon' => $usericon, 'expanded' => true)));
if ($emailcount > 0)
{
foreach ($val["emails"] as $emailkey=>$emailval)
{
! $_emailnode = &$_usernode->addItem(new HTML_TreeNode(array('text' => " ". addslashes($emailval), 'link' => "javascript:windowPlaceEmail(\'". addslashes($emailval) ."\', \'".addslashes($_GET["formname"])."\', \'opt_useremail\')", 'icon' => "icon_msgsmallyellow.gif", 'expandedIcon' => "icon_msgsmallyellow.gif", 'expanded' => true)));
}
}
+ if (!empty($val["phone"]))
+ {
+ $_emailnode = &$_usernode->addItem(new HTML_TreeNode(array('text' => " ". $_SWIFT["language"]["c_mobile"].addslashes($val["phone"]), 'link' => "javascript:windowPlaceEmail(\'". addslashes($val["phone"]) ."\', \'".addslashes($_GET["formname"])."\', \'opt_userphone\')", 'icon' => "icon_ticketphone.gif", 'expandedIcon' => "icon_ticketphone.gif", 'expanded' => true)));
+ }
}
if ($module->isRegistered(MODULE_TEAMWORK)) ![]() Deeps. |
| | |
(#2)
|
| Senior Member Posts: 4,951 Join Date: Jun 2005 Location: Cumbria, UK SupportSuite Owned License |
18-09-2007, 09:01 AM
Another great share, well done! Icon Headquarters - Its Elixir - Web2Messenger |
| | |
(#3)
|
(#4)
|
| Senior Member Posts: 4,951 Join Date: Jun 2005 Location: Cumbria, UK SupportSuite Owned License |
18-09-2007, 01:30 PM
You use SSH on your server and run like patch /path/to/kayako/modules/core/functions_userlookup.php userlookup.diff.txt. It changes the file for you. Icon Headquarters - Its Elixir - Web2Messenger |
| | |
(#5)
|
(#6)
|
(#7)
|
(#8)
|
| Senior Member Posts: 4,951 Join Date: Jun 2005 Location: Cumbria, UK SupportSuite Owned License |
18-09-2007, 02:22 PM
It was the same situation for me a few years ago until I started using X-Cart which uses it for upgrades. I am personally not a fan and would rather modify by hand. Icon Headquarters - Its Elixir - Web2Messenger |
| | |
(#9)
|
(#10)
|
(#11)
|
(#12)
|
(#13)
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
| |
Kayako provides online help desk software and support solutions; enabling companies to improve their support and reduce costs.
Our three main products include: SupportSuite, eSupport and LiveResponse