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 tab order
Pages: [1]

Author Topic: CiviCase tab order  (Read 1347 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
CiviCase tab order
July 26, 2011, 03:43:17 pm
Our customer is asking us to customise the CiviCase view (ie. this URL)

civicrm/contact/view/case?reset=1&id=100&cid=3&action=view&context=case&selectedChild=case&key=cb124e57a70e30564c893f5d2e05362d_2632

such that the default sort order is by date with no regards to status.

I can't see any moderately easy way to do this - can anyone suggest one? Maybe the buildform hook but it seems like I'd just have to a php re-order & it might not be valid if there are more rows on the case than on the activity
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: CiviCase tab order
July 26, 2011, 11:23:04 pm
Hmmmm the easiest option would be if you could tweak an ORDER BY SQL statement somewhere.....but I would not have a clue where that sits. Would it be possible to do that in the buildform?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

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 tab order
July 28, 2011, 02:28:01 pm
CRM_Case_BAO_Case::getCaseActivity()

see also http://forum.civicrm.org/index.php/topic,9300.0.html


Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: CiviCase tab order
July 28, 2011, 02:58:45 pm
Yep, but, there's no point me editing core files unless it's going to be accepted as a patch (which I don't think it will since it seems that others prefer the existing sort) so I need a way that is on the 'outside' of Civi
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

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 tab order
July 28, 2011, 08:39:40 pm
Can you inject some jquery via buildform to target the table widget and do the equivalent of clicking on the date column to sort by date?

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviCase tab order
July 28, 2011, 11:40:05 pm
I think customizing template might be better way to add custom js / jquery

Kurund
Found this reply helpful? Support CiviCRM

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: CiviCase tab order
July 29, 2011, 01:04:08 am
I'm surprised you think customising the tpl is a better option than Dave's suggestion. In my experience nursing customised tpls through upgrades is very labour intensive & I view it as a last resort.

I think Hershel advocated Dave's method in his Jquery blog
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviCase tab order
July 31, 2011, 11:14:57 pm
I am not sure how js can be implemented using buildForm hook and I think it will be combination of hook and template. unless I am wrong.
Another way would be to write js in drupal block and have it on every civicrm pages, so not much upgrade issues.

HTh
Kurund
Found this reply helpful? Support CiviCRM

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: CiviCase tab order
August 05, 2011, 01:08:01 pm
Here's an example of a function I have adding js under buildform.  Hershel's blog offers a lot more on this (including what is wrong with the below :-) http://civicrm.org/blogs/hershel/how-customize-civicrm-pages-jquery)

Code: [Select]
function civimprc_civicrm_buildForm( $formname, $form ){

   $jqueryinsert = "
      cj(document).ready( function() {
      cj('#custom_57_$instance').blur(function(){
        if(cj('#amount').attr('value') > 0){
           var newValue = cj('#custom_57_$instance').attr('value') *.05 / cj('#amount').attr('value') * 100;
           cj('#custom_207_$instance').val(newValue);
         }
      });
";
   drupal_add_js( $jqueryinsert , 'inline');
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

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

This forum was archived on 2017-11-26.