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) »
  • case activity subject lines
Pages: [1]

Author Topic: case activity subject lines  (Read 1666 times)

irvken

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 1
case activity subject lines
November 20, 2012, 03:25:15 am
 is it possible to populate the subject line for case activities in a time line from the xml file
<subject>subject</subject> gets ignored!
should it?

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: case activity subject lines
November 23, 2012, 09:27:30 am
I don't believe there is such a feature. They just have blank subjects.

You could prepopulate it at the time of the first edit using one of the hooks (buildForm probably), or if you're also adding other type-specific functionality then you could use <custom_php_dir>/CRM/Case/Form/Activity/<type>.php

ChrisChinchilla

  • I post occasionally
  • **
  • Posts: 104
  • Karma: 3
  • CiviCRM version: 4.1.2
  • CMS version: Drupal 6 & 7
Re: case activity subject lines
July 30, 2013, 06:53:52 pm
For anyone else looking, I found a fix for this.

It's to do with the XML processor for activities that get created, if it's not an open case task it doesn't add a subject. Which makes sense, but my client had a justification for this not being the case.

So create a copy of CRM/Case/XMLProcessor/Process.php

and at line 350, simply add

'subject' => CRM_Utils_Array::value('subject', $params) ? $params['subject'] : $activityTypeName,

Basically a straight copy and past from line 331 above.
Melbourne CiviCRM meetup group - http://www.meetup.com/MelbourneCiviCRM/

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: case activity subject lines
February 03, 2014, 09:26:06 am
Hi Chris,

Was it a reason not to include it into the core? Seems it's generic enough to be able to have an optional <subject> on each activity in the timeline.

And because optional, wouldn't break anything.

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: case activity subject lines
February 03, 2014, 10:49:45 am
seems like a good addition to me
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

ChrisChinchilla

  • I post occasionally
  • **
  • Posts: 104
  • Karma: 3
  • CiviCRM version: 4.1.2
  • CMS version: Drupal 6 & 7
Re: case activity subject lines
February 03, 2014, 03:49:44 pm
I don't know… I just proposed a solution, not sure about what people thought of it. I also did this quite a while ago, so not sure if it worked well etc…
Melbourne CiviCRM meetup group - http://www.meetup.com/MelbourneCiviCRM/

Richard Bramley

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 4.4.0
  • CMS version: Drupal 7
  • MySQL version: 5.6.13
  • PHP version: 5.4.16
Re: case activity subject lines
February 13, 2014, 02:50:48 am
I'm not sure if things have changed since the solution was posted, but I don't think that it resolves irvken's question.

The given solution gives the created activities the subject from the request to add the activities, not from the Case XML file.  When creating a standard timeline for a new case, the subject will be the subject entered into the new case form.  When adding a timeline to an existing case, no subject is entered and so the activities will have no subject.

To get the subject from the XML file amend the line in the given solution to:

    'subject' => (string) $activityTypeXML->subject,

MickC

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.0
  • PHP version: 5.0
Re: case activity subject lines
November 19, 2014, 04:21:50 am
This totally works to give individual activities their own subjects:

- add <subject> and even <detail> tags to your xml into your Activity Set->Activity Types
- copy process.php to your custom php path
- modify code as follows

Add this around line 350 (my row numbers are different to those mentioned above):

    if (isset($activityTypeXML->subject)) {
      $subject = (string) $activityTypeXML->subject;
    }
    else {
      $subject = $activityTypeName;
    }

    if (isset($activityTypeXML->details)) {
      $details = (string) $activityTypeXML->details;
    }
    else {
      $details = '';
    }


Add this around 398

        'subject' => $subject ,
        'details' => $details ,

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: case activity subject lines
November 21, 2014, 10:19:37 am
Hi MickC,

Could you create an issue and create a pull request to add you improvement to the core?
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

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

This forum was archived on 2017-11-26.