Results 1 to 7 of 7

Thread: Location of "Time zone prompt" field in database

  1. #1
    hadoob024's Avatar
    hadoob024 is offline Sugar Community Member
    Join Date
    Mar 2010
    Posts
    137

    Default Location of "Time zone prompt" field in database

    We had an issue where the "Time zone prompt" field got checked for all our users. This causes our system to crash. Where in the database is this field located so that I can update this value for all our users at once? I just had to manually update this setting for 100+ users because I couldn't figure out how to run an UPDATE script on our db because I can't find that field. Thanks in advance!
    -hadoob024-


    Windows 7 SP1
    PHP 5.2.17
    SQL Server 2008 R2
    IIS 7.5
    Sugar Professional Version 5.5.1

  2. #2
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: Location of "Time zone prompt" field in database

    Just check the code of modules/Users/SetTimezone.php...
    Harald Kuske
    Pre-Sales Engineer Central Europe

    SUGARCRM Deutschland GmbH
    Erika-Mann-Str. 53, 80636 Munich, Germany
    Email: hkuske@sugarcrm.com
    Home: http://www.sugarcrm.com


  3. #3
    hadoob024's Avatar
    hadoob024 is offline Sugar Community Member
    Join Date
    Mar 2010
    Posts
    137

    Default Re: Location of "Time zone prompt" field in database

    I'm looking at it now, but still can't see where that information is collected and stored.
    -hadoob024-


    Windows 7 SP1
    PHP 5.2.17
    SQL Server 2008 R2
    IIS 7.5
    Sugar Professional Version 5.5.1

  4. #4
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: Location of "Time zone prompt" field in database

    Ok, did you see the setPreferences function?
    That's exactly the functionality you need.
    All these functions can bee found in modules/UserPrefences/UserPrefences.php.

    The data is stored in an encoded field of the userprefences database table
    Harald Kuske
    Pre-Sales Engineer Central Europe

    SUGARCRM Deutschland GmbH
    Erika-Mann-Str. 53, 80636 Munich, Germany
    Email: hkuske@sugarcrm.com
    Home: http://www.sugarcrm.com


  5. #5
    hadoob024's Avatar
    hadoob024 is offline Sugar Community Member
    Join Date
    Mar 2010
    Posts
    137

    Default Re: Location of "Time zone prompt" field in database

    Got it. Thanks. So basically, I need to create a new script that basically calls the setPreference() function.

    Quick follow-up. Do you know what the value for $name would be? Is this the field name? Is that different from the name of the setting/preference? If I use Firebug on the page where I'm editing a user, I can see that the name for "Time zone prompt" is "ut". Is that the value that I pass as $name?
    -hadoob024-


    Windows 7 SP1
    PHP 5.2.17
    SQL Server 2008 R2
    IIS 7.5
    Sugar Professional Version 5.5.1

  6. #6
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: Location of "Time zone prompt" field in database

    $current_user->setPreference('timezone',$timezone) sets the timezone of the current user.
    $current_user->setPreference('ut',1) promts the user on next login to enter his timezone.
    $timezone values can be found in /include/language/en_us.lang.php
    Harald Kuske
    Pre-Sales Engineer Central Europe

    SUGARCRM Deutschland GmbH
    Erika-Mann-Str. 53, 80636 Munich, Germany
    Email: hkuske@sugarcrm.com
    Home: http://www.sugarcrm.com


  7. #7
    hadoob024's Avatar
    hadoob024 is offline Sugar Community Member
    Join Date
    Mar 2010
    Posts
    137

    Default Re: Location of "Time zone prompt" field in database

    Perfect! Thanks!
    -hadoob024-


    Windows 7 SP1
    PHP 5.2.17
    SQL Server 2008 R2
    IIS 7.5
    Sugar Professional Version 5.5.1

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 2010-06-16, 05:31 AM
  2. Replies: 3
    Last Post: 2009-07-14, 11:28 AM
  3. how to creat custom field which is type "time"?
    By shyam007 in forum Developer Help
    Replies: 1
    Last Post: 2009-04-13, 11:27 AM
  4. how to create "date & time" field for cases
    By teldarren in forum Help
    Replies: 2
    Last Post: 2009-03-06, 03:22 AM
  5. Replies: 0
    Last Post: 2006-09-13, 11:04 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •