CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCase (Moderator: Dave Greenberg) »
  • default values in civicase
Pages: [1]

Author Topic: default values in civicase  (Read 1030 times)

josue

  • I post occasionally
  • **
  • Posts: 81
  • Karma: 7
    • PTP
  • CiviCRM version: 3.4.4, 4.1.1
  • CMS version: Drupal 6.24, Drupal 7.12
  • MySQL version: 5.0
  • PHP version: 5.2
default values in civicase
July 21, 2010, 07:51:43 am
hey folks,

i needed to set the subject in a civicase activity to a default value.

in OpenCase.php, inside function setDefaultValues( &$form ) i added
        $defaults['activity_subject'] = 'Case Intake';

i also changed the default for Medium by commenting out all the logic and just choosing the first option:
        // set default encounter medium, location type and phone type defaults are set in DB
        //require_once "CRM/Core/OptionGroup.php";
        //$medium = CRM_Core_OptionGroup::values('encounter_medium', false, false, false, 'AND is_default = 1');
        //if ( count($medium) == 1 ) {
            $defaults['medium_id'] = 1;
        //}

is there something wrong with the above solutions?

is there a way to do this so that i don't lose it when i upgrade?

thx

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: default values in civicase
July 21, 2010, 02:23:51 pm
For the subject, you can try this:
http://wiki.civicrm.org/confluence/display/CRMUPCOMING/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmbuildForm

For the medium, you can change the default entry in the database directly (civicrm_option_values table). That should survive upgrade. Don't seem to be able to do it in the UI.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCase (Moderator: Dave Greenberg) »
  • default values in civicase

This forum was archived on 2017-11-26.