Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-792

Make backdate configurable and put values in DB.

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 1.3
    • Fix Version/s: Unscheduled
    • Labels:
      None

      Description

      My suggestion to Lobo that will make the backdate configurable
      is as follows:

      I would suggest that you not use
      minOffset and maxOffset for
      birthdays but rather bMinOffset and bMaxOffset.

      This of course would not be backward
      compatable, but it would begin to reign
      in the uncontrolable nature of the settings
      file.

      Alternativly, you could assign minOffset
      and maxOffset the perameters of the
      changes when they are needed.

      minOffset = bMinOffset
      maxOffset = bMaxOffset for birthdays

      minOffset = calMinOffset
      maxOffset = calMaxOffset for calendars

      and so on. This would allow you to
      change your hard coded perameters
      to soft code perameters.

      So your hard code would go from
      minOffset = "1"; to minOffset = "calMinOffset";

      In this way, you would not be doing
      a whole lot of changes to the basic
      script, but simply adding functionality.
      The various minOffset and maxOffset perameters
      could then be stored in the db and allow
      the user to change settings where necessary.

      Scott

      The following lines are Lobo's suggested hack
      to Angie so that she could backdate to 2005.
      >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
      Angie:

      Sorry, this is not configurable (for
      now!)

      However, you can accomplish this by making a tiny code
      change in the CiviCRM code base

      file: CRM/Core/SelectValues.php, line:
      342
      (approx)

      Change this block

      FROM:

      } elseif ($type == 'datetime')

      { require_once 'CRM/Utils/Date.php'; $newDate['format'] = CRM_Utils_Date::posixToPhp($config->dateformatQfDatetime); $newDate['optionIncrement']['i'] = 15; $minOffset = 0; $maxOffset = 3; }

      elseif ($type =='duration')

      { TO: }

      elseif ($type == 'datetime')

      { require_once 'CRM/Utils/Date.php'; $newDate['format'] = CRM_Utils_Date::posixToPhp($config->dateformatQfDatetime); $newDate['optionIncrement']['i'] = 15; // change this to 1 so folks can at least go back 1 calendar year $minOffset = 1; $maxOffset = 3; }

      elseif ($type =='duration') {

      (minOffset hsa been changed to 1, rest of the lines is for context only )
      u can ask your tech folks to contact me on IRC if they
      have any questions about the above change

      lobo
      >>>>>>>>>>>>>>>>>>>>>>>>
      The following is the request from Angie.

      Currently we are not able to backdate any activities
      to 2005. We only have 2006-2009. Is there any way to add 2005
      to this drop down? I checked with our tech people and they said this was
      not a customizable feature. Thanks.
      Angie
      >>>>>>>>>>>>>>>>>>>>>>>>>>

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              satovey Scott A Tovey
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 3 weeks
                3w
                Remaining:
                Remaining Estimate - 3 weeks
                3w
                Logged:
                Time Spent - Not Specified
                Not Specified