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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • CiviCase + Drupal Views3 integration
Pages: [1]

Author Topic: CiviCase + Drupal Views3 integration  (Read 1107 times)

bazhob

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 4.3.3
  • CMS version: Drupal
  • MySQL version: 5.1.68-cll
  • PHP version: 5.3.21
CiviCase + Drupal Views3 integration
June 08, 2013, 02:03:22 pm
Dear community,

I'm preparing a project which includes publishing information on CiviCases publically in various forms. I noticed that the Views3 integration module is missing CiviCase. The latest information regarding this in the forum dates back to 2009: http://forum.civicrm.org/index.php?topic=6645.0 - as far as I can see, the support is still lacking, correct? Or is somebody working on that at the moment?

So anyway I started to write it, does not seem difficult, and if you are interested I can send you patches in a couple of days.

There is one minor but interesting problem which I just stumbled upon - I am not a PHP developer by trade, so please excuse me if this is something obvious:

For some reason, the case_type_id which I get using $values->{$this->field_alias} in the Views integration module handler function civicrm_handler_field_pseudo_constant::render() has three bytes for one digit, and therefore does not match the keys in the array of case_type_ids returned by CRM_Case_PseudoConstant::caseType. Of course, I noticed that pretty late, as the output looks just like a normal digit.

For example, I get "1", but the "1" is infact encoded using \x01 \x49 \x01. This is not the case for activity_type_ids which also run through civicrm_handler_field_pseudo_constant. When I noticed that there are three bytes I thought of some unicode encoding, but 01 as far as I know is not a standard BOM, and anyway UTF-8 for "1" would be one byte.

The solution was to add a line $val = str_replace("\x01", '', $val); - but this can only be a temporary hack. Any ideas regarding the real issue?

Thank you.
Tobias






bazhob

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 4.3.3
  • CMS version: Drupal
  • MySQL version: 5.1.68-cll
  • PHP version: 5.3.21
Re: CiviCase + Drupal Views3 integration
June 08, 2013, 02:23:45 pm
Problem solved by IRC, I had learned the hard way about the subtype separator character (case_type_ids could theoretically be multivalued)

bazhob

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 4.3.3
  • CMS version: Drupal
  • MySQL version: 5.1.68-cll
  • PHP version: 5.3.21
Re: CiviCase + Drupal Views3 integration
June 18, 2013, 11:49:45 am
Dear community,

I posted a working patch to: http://issues.civicrm.org/jira/browse/CRM-12853

It might need a bit of clean up by someone CiviCRM savy, though.

All the best! Tobias

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • CiviCase + Drupal Views3 integration

This forum was archived on 2017-11-26.