Results 1 to 7 of 7

Thread: Datetime field displays value but can't be modified

  1. #1
    EPMichael is offline Member
    Join Date
    Jan 2009
    Location
    France, Montrouge
    Posts
    7

    Default Datetime field displays value but can't be modified

    Second problem I meet while trying to customise SugarCRM 5 CE. Thank you for your help.

    For the Notes module I need to record the date and time for the action. This data could be modified by the user.
    I added a new custom field - type date - with Studio. Then, following forum and wiki informations, I edited some files to force datetime type into database with vardefs.php.
    What I can get :
    - the date with calendar field showing only the date while field type is datetime. So I miss the time value.
    - or, the datetimecombo field (with dropdown list javascript modified to select every minute and not only 1/4 hour) showing the date and time value. But it does not record the change made on drop-down hour and minute lists.

    What I would like to obtain : a single field with date time ("YYYY/MM/JJ HH:mm") where we can change the value manually or through the calendar.
    Is there a howto about this, or can you give me the recommended way to do this ?

    Thanks;

  2. #2
    SugarDev.net is offline Sugar Community Member
    Join Date
    Feb 2008
    Posts
    1,401

    Default Re: Datetime field displays value but can't be modified

    I think it would be very hard to customize the JS calendar to support that field. Or maybe not, the docs are here: http://www.dynarch.com/projects/calendar/. You could do anything with customCode in editviewdefs.php.

    Do you have a working datetimecombo box, with the minutes dropdown as the only problem? Have you rebuild/enabled developer mode? Are you modifying the dropdown by studio? Try manually.
    Developers go here
    Businesses go there (Dutch)

    Modules:
    SugarDev.net Developer Tools | Config | Dutch Language Pack
    "Nothing gets fixed unless there is a bug"

  3. #3
    EPMichael is offline Member
    Join Date
    Jan 2009
    Location
    France, Montrouge
    Posts
    7

    Default Re: Datetime field displays value but can't be modified

    Hum, thank you.
    I will try again with the datetimecombo but that is not really easy to use. This is just an ergonomic problem I meet. Or I will find a SugarCRM specialist to do the job cause I have spend too much time on this

  4. #4
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Re: Datetime field displays value but can't be modified

    Quote Originally Posted by EPMichael View Post
    Second problem I meet while trying to customise SugarCRM 5 CE. Thank you for your help.

    For the Notes module I need to record the date and time for the action. This data could be modified by the user.
    I added a new custom field - type date - with Studio. Then, following forum and wiki informations, I edited some files to force datetime type into database with vardefs.php.
    What I can get :
    - the date with calendar field showing only the date while field type is datetime. So I miss the time value.
    - or, the datetimecombo field (with dropdown list javascript modified to select every minute and not only 1/4 hour) showing the date and time value. But it does not record the change made on drop-down hour and minute lists.

    What I would like to obtain : a single field with date time ("YYYY/MM/JJ HH:mm") where we can change the value manually or through the calendar.
    Is there a howto about this, or can you give me the recommended way to do this ?

    Thanks;
    I modified datetimecombo to replace the dropdown with a text box with time

    let me know if this is of any use to you and I will attach the code
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

  5. #5
    EPMichael is offline Member
    Join Date
    Jan 2009
    Location
    France, Montrouge
    Posts
    7

    Default Re: Datetime field displays value but can't be modified

    Quote Originally Posted by mikesolomon View Post
    let me know if this is of any use to you and I will attach the code
    Sure I am interrested ! Thanks for your help.

  6. #6
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Re: Datetime field displays value but can't be modified

    Quote Originally Posted by EPMichael View Post
    Sure I am interrested ! Thanks for your help.
    OK files attached

    Just put them in include/SugarFields/Fields

    Then in your editviewdefs replace datetimecombo with datetimecombostart

    Not the neatest of code as it was the first thing I did with sugar

    Note - your timeformat must be set to 23:00 for this to work
    Attached Files Attached Files
    Last edited by mikesolomon; 2009-02-16 at 04:34 PM. Reason: added note
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

  7. #7
    EPMichael is offline Member
    Join Date
    Jan 2009
    Location
    France, Montrouge
    Posts
    7

    Default Re: Datetime field displays value but can't be modified

    Thanks. Your files helped.

    First I changed the database format from date to datetime. Yes, I was thinking that changing it in /custom/Extension/modules/Notes/Ext/Vardefs/vardefs.php was enough has I've seen in the wiki, but that was not the case . I changed it directly into the database.

    With your example I see where we can modify the fields. So I created as you done my own Datetimemerged as a copy from Datetime. In the /include/SugarFields/Fields/Datetimemerged/EditView.tpl I then simply change "size="16" maxlength="16"" for the input field and I add Smarty options to hide seconds on "value="{$date_value|truncate:16:"":true}"". So, now I have a complete YYYY-MM-DD hh:mm field without dropdown lists.

    The only thing I could improve is the calendar : when we use it the field display only YYYY-MM-DD. One day I will try to add default hh:mm ...

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. DateTime Custom Field ?
    By spencer134 in forum Help
    Replies: 3
    Last Post: 2010-01-28, 07:20 PM
  2. Replies: 4
    Last Post: 2008-12-05, 01:11 AM
  3. datetime field and combot
    By daschn2 in forum Developer Help
    Replies: 1
    Last Post: 2008-10-25, 07:02 PM
  4. Replies: 2
    Last Post: 2007-10-22, 07:44 PM
  5. custom field -> dateTIME not just date
    By elRey in forum Developer Help
    Replies: 6
    Last Post: 2006-11-20, 10:06 PM

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
  •