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
  (#1) Old
deeps Offline
New Member
 
Posts: 25
Join Date: Aug 2007
Increasing available information on 'edit users' page - 18-09-2007, 04:50 PM

SupportSuite version 3.11.01 stable

This modification will let you see more information about a user account, as well as putting the currently unused 'phone' field to use (see your database, check out the [prefix]users table (default: swusers), you'll notice a couple of interesting things ).

Basically, this will let you:
- See and alter a user's phone number (only 1 allowed per user, if you need more, you're gonna need to use contacts or hack this up better)
- See a user's current password (this may break in future if Kayako stops storing the user's password in plain text in the database - a good idea!)

Changes
/path/to/kayako/modules/core/staff_users.php:
line ~685, change from:
PHP Code:
updateUserStaffCP($_user["userid"], $_POST["password"], $_POST["usergroupid"], $_POST["fullname"], iif($_POST["ismanager"]==1truefalse)); 
to:
PHP Code:
updateUserStaffCP($_user["userid"], $_POST["password"], $_POST["usergroupid"], $_POST["fullname"], $_POST["phone"], iif($_POST["ismanager"]==1truefalse)); 
(This is the bit that allows you to set and update a phone number for a user)

/path/to/includes/functions_users.php:
(in diff format as there's a few changes and I'm too lazy to write it out by hand)
Code:
$ cat functions_users.diff
*** /home/deeps/kayako/trunk/upload/includes/functions_users.php        2007-09-18 09:06:10.000000000 +0200
--- includes/functions_users.php        2007-09-18 17:30:09.000000000 +0200
***************
*** 225,231 ****
  /**
  * Update Existing User
  */
! function updateUserStaffCP($userid, $password, $usergroupid, $fullname, $ismanager)
  {
        global $dbCore, $_SWIFT;

--- 225,231 ----
  /**
  * Update Existing User
  */
! function updateUserStaffCP($userid, $password, $usergroupid, $fullname, $phone, $ismanager)
  {
        global $dbCore, $_SWIFT;

***************
*** 236,242 ****
                unset($passwordsql);
        }

!       $dbCore->query("UPDATE `". TABLE_PREFIX ."users` SET `usergroupid` = '". intval($usergroupid) ."', `fullname` = '". $dbCore->escape($fullname) ."', `ismanager` = '". iif($ismanager==true, "1", "0") ."'". $passwordsql ." WHERE `userid` = '". intval($userid) ."';");

        return true;
  }
--- 236,242 ----
                unset($passwordsql);
        }

!       $dbCore->query("UPDATE `". TABLE_PREFIX ."users` SET `usergroupid` = '". intval($usergroupid) ."', `fullname` = '". $dbCore->escape($fullname) ."', `phone` = '". $dbCore->escape($phone) ."', `ismanager` = '". iif($ismanager==true, "1", "0") ."'". $passwordsql ." WHERE `userid` = '". intval($userid) ."';");

        return true;
  }
***************
*** 699,704 ****
--- 699,707 ----
        }

        printTextRow("fullname", $_SWIFT["language"]["usrfullname"], $_SWIFT["language"]["desc_usrfullname"], "text", $_POST["fullname"]);
+         printTextRow("phone", "Phone number", "Enter the user's phone number for alerts", "text", $_POST["phone"]);
+       printDefaultRow('<span class="tabletitle">Current Password</span><BR /><span class="tabledescription">User\'s current password</span>', $_POST["userpasswordtxt"]);
+

        if ($type == INSERT)
        {
Almost all of that is relating to updating the user's phone number. Only the last bit includes a line for viewing the current password. If that's all you want, just add that line to your functions_users.php.

Again, not thoroughly tested, but I'm violating various rules and assuming this trivial change wont break anything horribly - it hasn't for me, your mileage may vary.

Deeps.
Attached Images
File Type: png kayako_user_phone_and_password.png (129.8 KB, 76 views)

Last edited by deeps; 18-09-2007 at 04:55 PM. Reason: Added screenshot
   
Reply With Quote
  (#2) Old
deeps Offline
New Member
 
Posts: 25
Join Date: Aug 2007
19-09-2007, 12:00 PM

Limitations discovered already: only works on existing users. When creating a new user, if you fill in the phone number field, it doesn't update on creating a new user, however it will if you edit the user.

It's not difficult to update the insert user function as well, as long as you understand what you've done to update the edit user field, and the underlying code. I might post the updated changes if there's actually any interest.
   
Reply With Quote
  (#3) Old
no0ne2k Offline
New Member
 
Posts: 22
Join Date: Sep 2007
02-10-2007, 11:07 PM

I'm really curious as to why Kayako includes the phone field in the standard database, but doesn't provide any inherent method to store/update this value. To me, a phone # is a critical piece of information. I have added it using the Custom Fields, but wonder if there is a better way now....

I am interested in your total fix once you have it in place. I may look to move away from this custom field and use your suggestions.

Thanks!
   
Reply With Quote
  (#4) Old
Siora Offline
Member
 
Siora's Avatar
 
Posts: 1,283
Join Date: Apr 2007
Location: Toronto Canada
02-10-2007, 11:55 PM

Same here but I don't think Deeps is finishing this off as he stated that if you understand what he has already done, it would be easy for us to finish ourselves.


Siora Solutions Inc.
www.sioraIT.com
   
Reply With Quote
  (#5) Old
deeps Offline
New Member
 
Posts: 25
Join Date: Aug 2007
03-10-2007, 03:35 PM

Heh, adjusting the 'insertUser' stuff requires a f**ktonne more changes around the place, as there are a lot of other places where the insertUser function is used.
Using it the way it is above is probably the easiest way... that you can add phone numbers to existing users, storing it in the phone field on the users atble.

I have since updated my local copy, however, to include changes to everything. I'm happy to give access to my SVN repository and you can look through that, assuming you understand how to use SVN, and I can work out how to block out my key and config files ;-)
   
Reply With Quote
  (#6) Old
eugenevdm Offline
New Member
 
Posts: 23
Join Date: Mar 2005
26-10-2007, 02:59 PM

deeps,

I encourage you to continue this work.

Furthermore I encourage Kayako to implement the telephone number in their front-end. This is such a critical piece of information that will make our help desk run smoother. At present we are trying to integrate caller ID with Kayako and in it's current form it's near impossible. Thank you deeps for the work you have done so far.

kind regards,
Eugene van der Merwe
   
Reply With Quote
Reply

Tags
edit, increasing, information

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
New fields in 'edit users' page deeps How do I? 6 18-09-2007 05:16 PM
Custom Fields Custom fields -> Ability to prevent users editing them caitlyntw Feature Requests 2 29-06-2007 04:14 AM
Disable Users Being Able To Edit Ticket Properties markh How do I? 3 13-06-2007 09:37 AM



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