Results 1 to 2 of 2

Thread: ConvertLead - automatic set current date + 5 workdays

  1. #1
    jrp918 is offline Senior Member
    Join Date
    Aug 2010
    Location
    Phoenix Arizona
    Posts
    27

    Default ConvertLead - automatic set current date + 5 workdays

    Hello

    using sugar 5.5

    getWideFormBody section
    in the OpportunitiesFormBase.PHP file, I need to set the date to automatically populate the "current date + 5 workdays" into the date box automatically. this is to happen during the convert lead process. It doesnt appear that the OpportunitiesFormBase.PHP file contains any variables that will extract the date from the server.

    And in the
    getWideFormBody section
    in the CallFormBase.PHP file it appears the code is already written to autopopulate the date box using this value="${default_date_start}

    this variable $default_date_start is tied directly to another variable called $timedate

    How can I change both of these PHP files so that they will each populate the "current date + 5 workdays" into each of those boxes during the convert lead process


    Sincerely,
    Jeff

  2. #2
    jrp918 is offline Senior Member
    Join Date
    Aug 2010
    Location
    Phoenix Arizona
    Posts
    27

    Default Re: ConvertLead - automatic set current date + 5 workdays

    For Opportunities to auto populate the Current Date during ConvertLead I needed to modify the OpportunityFormBase.PHP file, here is the code and the location for editing

    ADD TO getFormBody, getWideFormBody

    global $timedate;
    $date = gmdate($GLOBALS['timedate']->get_db_date_time_format());
    $ntc_date_format = '('.$timedate->get_user_date_format(). ')';
    // $ntc_time_format = '('.$timedate->get_user_time_format(). ')'for implementing time functions in the future;
    $cal_dateformat = $timedate->get_cal_date_format();
    $default_date_closed = $timedate->to_display_date($date,false);
    $cal_lang = "en";


    ADD span class to $lbl_date_closed in getWideFormBody
    <tr>
    <td scope="row">$lbl_date_closed&nbsp;<span class="required">$lbl_required_symbol</span>&nbsp;<span class="dateFormat">$ntc_date_format</span></td>
    </tr>


    ADD span class to $lbl_date_closed in getFormBody

    $the_form .= <<<EOQ
    $lbl_date_closed&nbsp;<span class="required">$lbl_required_symbol</span><br><span class="dateFormat">$ntc_date_format</span><br>


    ADD TO GetWideFormBody
    require_once('include/time.php');


    ADD to Function HandleSave
    global $timedate;


    ADD value="${default_date_closed}" in getWideFormBody

    <tr>
    <td ><input name='{$prefix}date_closed' onblur="parseDate(this, '$cal_dateformat');" size='12' maxlength='10' id='${prefix}jscal_field' type="text" value="${default_date_closed}">&nbsp;<img src="{$jsCalendarImage}" alt="{$app_strings['LBL_ENTER_DATE']}" id="${prefix}jscal_trigger" align="absmiddle"></td>
    </tr>


    ADD value="${default_date_closed}" in getFormBody

    <input name='{$prefix}date_closed' size='12' maxlength='10' id='{$prefix}jscal_field' type="text" value="${default_date_closed}"> <img src="{$jsCalendarImage}" alt="{$app_strings['LBL_ENTER_DATE']}" id="jscal_trigger" align="absmiddle"><br>

    ---------------------------------------
    This Question Still Remains?
    HOW can I modify either of the variables below to give me the current date plus 5 workdays? I have looked in the sugardev site and I see a refence to $use_offset variable but I dont see how to add or fix this....

    $date = gmdate($GLOBALS['timedate']->get_db_date_time_format());
    or
    $default_date_closed = $timedate->to_display_date($date,false);

    Thanks for your help
    Jeff

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 2010-10-12, 04:01 PM
  2. Current date
    By nanduruchi in forum Developer Help
    Replies: 1
    Last Post: 2010-09-14, 09:14 PM
  3. Replies: 5
    Last Post: 2009-01-22, 12:02 PM
  4. Replies: 0
    Last Post: 2009-01-21, 08:10 AM
  5. ZucckerReports Current date help
    By kinshibuya in forum Help
    Replies: 0
    Last Post: 2008-08-19, 12:25 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
  •