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) »
  • CiviCase "Medium" and other Open Case customisations
Pages: [1] 2

Author Topic: CiviCase "Medium" and other Open Case customisations  (Read 3351 times)

FadeOUT

  • I post occasionally
  • **
  • Posts: 69
  • Karma: 0
  • IT Development at UK Charity
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 7.14
  • MySQL version: 5.1.57-community
  • PHP version: 5.3
CiviCase "Medium" and other Open Case customisations
July 16, 2012, 08:56:10 am
Hi,

Is the "Medium" drop down in CiviCase still fixed? I.e. (without attacking the code or database), an element with fixed contents and a required form elements that cannot be turned off?

Is there any way to alter the default CiviCase form (I would expect to see Case Type at the top, for instance) without code tweaking? Can the page be overridden with a template, for example?

Thanks..!

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: CiviCase "Medium" and other Open Case customisations
July 17, 2012, 02:48:39 am
Hi,

Code: [Select]
Is the "Medium" drop down in CiviCase still fixed? I.e. (without attacking the code or database), an element with fixed contents and a required form elements that cannot be turned off?

It is pretty simple to do by adding a couple of lines of jQuery to set default values and hide elements http://civicrm.org/blogs/dave-greenberg/now-its-easier-add-custom-behaviors-templates. I wouldn't call this 'attacking' since it is quite easy to do and mantain and you aren't causing any long term damage / doing anything that will be hard to undo in the future.

Quote
Is there any way to alter the default CiviCase form (I would expect to see Case Type at the top, for instance) without code tweaking? Can the page be overridden with a template, for example?

Yes - see above.  Similar to adding the extra file that could include jQuery, you can override the file in the custom templates directory.  This PDF gives a good introduction to that http://sf2012.civicrm.org/sites/default/files/slides/Contribution%20Forms%20Wild.pdf.  It is for contribution forms, not the case form, but the same principle applies.

Also, I agree with you that I would expect to see case at the top.  I'd also like Medium to be renamed source.  That would make the CiviCase interface look more like other component interfaces (if you have seen source somewhere else, you'll recognise it again when you come to civicase, etc.).  Admittedly, that is only two people so far, but you know...

If you are considering making this modifications, you should also consider suggesting them as modifications to core :) since if they are accepted, when you come to upgrade you won't need to reapply these modifications + other will benefit as well.
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

FadeOUT

  • I post occasionally
  • **
  • Posts: 69
  • Karma: 0
  • IT Development at UK Charity
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 7.14
  • MySQL version: 5.1.57-community
  • PHP version: 5.3
Re: CiviCase "Medium" and other Open Case customisations
July 17, 2012, 08:02:08 am
Wow, thank you for a most useful reply - I will thoroughly investigate your suggestions! I certainly wouldn't call a JavaScript solution "attacking" the system, although I am always a little wary of relying upon client-side code in that way (although I realise that the whole system is close to non-functional without JS).

In an ideal world, I suppose, the entire CiviCase front end would be customisable on a per-case type basis as a standard part of the CiviCase customisation, such that another tab was automatically added to the Contact record for each new type of interaction, bypassing the need to choose a case type at the point of use ("medium" would also be optional). That would be great for a lot of uses of CiviCase, anyway. But I realise that would be a significant undertaking. In the mean time, I guess it's a matter of rolling your own if you have the time / skills.

FadeOUT

  • I post occasionally
  • **
  • Posts: 69
  • Karma: 0
  • IT Development at UK Charity
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 7.14
  • MySQL version: 5.1.57-community
  • PHP version: 5.3
Re: CiviCase "Medium" and other Open Case customisations
July 17, 2012, 08:45:02 am
Oh and it would make more sense to have "Subject" above "Details", wouldn't it? Never mind, I'm sure it's like that for a reason  :)

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: CiviCase "Medium" and other Open Case customisations
July 17, 2012, 08:45:27 am
Quote
Wow, thank you for a most useful reply
no probs :)
Quote
I am always a little wary of relying upon client-side code in that way (although I realise that the whole system is close to non-functional without JS)
There is a buildForm hook that you could use to remove the form element before it gets to the browser. You might have to edit the template as well to get it to look nice. The Javascript way is simpler but might not be as good for your use case.
Quote
such that another tab was automatically added to the Contact record for each new type of interaction
Definitley agree with that.  Also, it would cool to mimic the Contact subtype menus so that instead of choosing new case from the menu, you can directly choose the case type.  This makes sense if you have a lot of different people doing different types of case that don't interact.  I am not sure if you can pass a case type param to civicrm/case/add?reset=1&action=add&atype=13&context=standalone.  If you could do that, it would be easy to set the type.
You could do that easily enough with the build Form hook and an extra param in the URL case_type_id.  or you could patch the class directly and submit as a patch.  I think that would be generally useful and the first step in going straight to a case type.
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: CiviCase "Medium" and other Open Case customisations
July 17, 2012, 08:48:58 am
Quote
I'm sure it's like that for a reason 
But is a good reason?!  I would definitely explore patching core to make it more inline with other interface elements.  There are a few key people who'd have an opinion on that. Seeings as you are doing it anyway, if you want to submit a patch we can discuss :)
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

FadeOUT

  • I post occasionally
  • **
  • Posts: 69
  • Karma: 0
  • IT Development at UK Charity
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 7.14
  • MySQL version: 5.1.57-community
  • PHP version: 5.3
Re: CiviCase "Medium" and other Open Case customisations
July 17, 2012, 09:04:55 am
I'll certainly throw together a template that puts it all in an order that makes more sense to me and see what people think...

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: CiviCase "Medium" and other Open Case customisations
July 17, 2012, 10:18:56 am
Medium is short for "Encounter Medium". I don't see a problem with calling it "Source" for consistency. It's main use I believe is part of the audit trail concept where it's important to know exactly where a piece of information came from.

For form layout originally the plan was for something where you could compose compound activities out of atomic building blocks, i.e. activities (such as open case) are actually composed of smaller entities which are activities themselves. But time/budget/usability/etc...

Anyway, given that everybody wants something different, I agree with the approach in this thread to try to pick common desires as the core layout, and then customize as Michael has described. I have seen several calls for moving the details field down near the bottom, and have done this customization myself more than once.

For case type, I've seen two requests (and just recently done a customization) for the opposite of what you're describing, moving case type out of open case so that the case type isn't chosen until later in the life of the case. This would be common for any org that has front-line intake where all they do is take down some details, and then later a higher level staffer has a meeting/phone call with the client where the case type (a.k.a. service package to be provided) is determined.

Having said that, I don't see a problem with allowing choosing case type right at the menu level, but I'm not sure I follow the tab suggestion. I think I'd need to see a sample or have a specific example described in order to comment further. In any case, (pun intended) the menu params are theoretically a customization you might be able to do with the buildForm hook - just create some navigation menu entries with the url param added, and then set the default value for the field in buildForm based on the url param (there's a civi utility function for extracting url params if it's not already in the $form somewhere, can't recall it off the top of my head).

FadeOUT

  • I post occasionally
  • **
  • Posts: 69
  • Karma: 0
  • IT Development at UK Charity
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 7.14
  • MySQL version: 5.1.57-community
  • PHP version: 5.3
Re: CiviCase "Medium" and other Open Case customisations
July 18, 2012, 09:06:30 am
The current sequence makes sense for cases where the action to take is determined after the creation of the case, certainly, but when the case creation is triggered from the charity's side, being able to dive straight into a case type would, to my mind be easier for users. If the latter scenario were supported, clearly the former would have to still be available.

In my case, I'm putting together a Grant Request case type, so that users can make a request to a grant-making Trust (or similar) and record the progress of the communications from that point. It would be mos convenient to have an "Apply for Grant" tab on the contact, or something along those lines. I'll have to look at customising it, but I can imagine a sequence along these lines would be a common (potential) use.

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: CiviCase "Medium" and other Open Case customisations
July 18, 2012, 10:51:09 am
Hey FadeOUT,

You might also be interested in this post I made about a 'fundraising pipeline': http://forum.civicrm.org/index.php/topic,25014.0/topicseen.html

I'd love to get some best practice nailed down around this workflow since I think it is obviousl pretty common amongst a fairly large proportion of non profits.
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

FadeOUT

  • I post occasionally
  • **
  • Posts: 69
  • Karma: 0
  • IT Development at UK Charity
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 7.14
  • MySQL version: 5.1.57-community
  • PHP version: 5.3
Re: CiviCase "Medium" and other Open Case customisations
July 19, 2012, 06:10:49 am
Well, here's a template to rearrange the default Open Case screen a bit (see attached), for future reference...

Briefly, for anyone looking at this at some point, the Case.txt file would have to be renamed to Case.tpl and placed in the custom templates folder (as user-defined through the admin menu), as: <your custom templates folder>/CRM/Case/Form/Case.tpl

I haven't removed anything, just shuffled stuff about. I think I'll probably add a default "N/A" option to the Medium field (if I can find it in the database!) and hide that and Location using JavaScript for now, as our single case type doesn't require these fields.

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: CiviCase "Medium" and other Open Case customisations
July 19, 2012, 10:44:39 am
To me that looks like an improvement.
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

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: CiviCase "Medium" and other Open Case customisations
July 20, 2012, 07:28:46 am
For "N/A" for Medium, you don't have to go into the database, just go to http://<website>/civicrm/admin/options?reset=1 and look for Encounter Medium.

It's hard to say where custom fields should go because it depends what the custom fields are about and you can't know that in advance. In this design they would come below the duration field, but in the middle of two tag-related sections, which seems odd.

There's also this, which is similar to yours just slightly different:
http://forum.civicrm.org/index.php/topic,14012.0.html

FadeOUT

  • I post occasionally
  • **
  • Posts: 69
  • Karma: 0
  • IT Development at UK Charity
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 7.14
  • MySQL version: 5.1.57-community
  • PHP version: 5.3
Re: CiviCase "Medium" and other Open Case customisations
July 23, 2012, 02:07:30 am
Ah, "Option Groups"..! Thanks..!

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: CiviCase "Medium" and other Open Case customisations
August 26, 2012, 08:42:49 am
Hey FadeOUT and co.,

Just a quick FYI to say that we also implemented this UI improvement.  One thing it made me realise is that we'd like to make the encounter medium optional since it isn't always crucial to know what the encounter medium is.  At least I don't think it is.  Let me know what you think.

PS. reading all this again makes me realise that this is quite close to your original question, FadeOUT.

Michael
« Last Edit: August 26, 2012, 08:49:33 am by michaelmcandrew »
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCase (Moderator: Dave Greenberg) »
  • CiviCase "Medium" and other Open Case customisations

This forum was archived on 2017-11-26.