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) »
  • creating customized screen for each Activity in Civicase
Pages: [1]

Author Topic: creating customized screen for each Activity in Civicase  (Read 1788 times)

leapywca

  • Guest
creating customized screen for each Activity in Civicase
October 14, 2009, 03:00:00 pm
hi,
I'm new to CiviCRM & CiviCase and had a question. I am using CiviCase for managing various programs for a non-profit organization. Each program is modelled as a case with various activities and each participant is enrolled to a program.

I was looking to customize screens for each activity. I have created custom data for each activity but wanted to modify fields which CiviCase puts in. So I wanted a few fields(eg. Medium, Location) which are not relevent to an activity(but relevent in other activities) to be supressed for few activities and not suppressed for others. Also making Medium a required field in few activities and not a required in others. Do I create .tpl file for each activity to achieve activity specific screens?

Thanks for any feedback!

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: creating customized screen for each Activity in Civicase
October 14, 2009, 10:56:54 pm
I think you should be able to accomplish this by implementing the buildForm hook in a custom additional module (and hence w/o modifying core PHP or TPL files).

This will require some PHP skills (and will be easier if you're already familiar with Drupal hooks).

http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+hook+specification

Ping us on IRC if you need help getting started.
Protect your investment in CiviCRM by  becoming a Member!

leapywca

  • Guest
Re: creating customized screen for each Activity in Civicase
October 19, 2009, 10:53:28 am
Thanks for your reply Dave. I am trying to use buildForm hook to make the activity page customizable. I created a new module with .info and .module files. However I am running in difficulties. I am really new to CiviCRM and dont know where these functions in the hooks get the $formName and $form values from. Can I use these variables to check if user is in a specific activity? or there are other variables for activities?

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: creating customized screen for each Activity in Civicase
October 19, 2009, 01:33:43 pm
Try CRM_Core_Error::debug_log_message(print_r($form, true)) in your module. This will show you the structure of the form object by outputting it into civicrm.log in sites/default/files/civicrm/upload.

Also you may be able to do some, but probably not all, of what you want with the existing activity extension mechanism. Take a look at CRM/Case/Form/Activity/XXX for an example of how they modify the activity form. It's done by naming convention - the filename should correspond to the activity type.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCase (Moderator: Dave Greenberg) »
  • creating customized screen for each Activity in Civicase

This forum was archived on 2017-11-26.