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) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • 3.2 action buttons
Pages: [1] 2

Author Topic: 3.2 action buttons  (Read 5493 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
3.2 action buttons
August 09, 2010, 08:25:17 pm
Hi,

Just a note to say that I am REALLY enjoying the action buttons in 3.2 - they really do make navigation a LOT easier.

A minor one I would add is 'send pdf letter' to the contact summary (currently only available off contact search) and a less minor thing that would be really useful is the ability to add your own templated ones to the options - e.g. if you had a bunch of std mail or e-mail templates if you could configure some of them to appear on that tab you could possibly do one-click std e-mails.

Not that I think either of these are on anyone's priority lists - just in the ideas bin.

Eileen
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

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: 3.2 action buttons
August 10, 2010, 09:16:16 am
Glad you're enjoying the buttons (me too).

RE adding more actions, one thing you can do today is add them by creating a custom copy of the template the renders them - templates/CRM/Contact/Form/ActionsButton.tpl (just a matter of adding some more items to the "list").
Protect your investment in CiviCRM by  becoming a Member!

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: 3.2 action buttons
August 11, 2010, 09:55:43 pm
Just looking at this I can see that the tasks for contact summary are in CRM_Contact_BAO_Contact.php (line 2291) & the main difference between those ones & the ones in CRM_Contact_Task (line 135) is that the tasks called from the search are 'POSTS' with Contact Ids passed as values and the ones on the contact summary seem to be GETs - does that make it harder to add this as an action here?

It certainly doesn't seem like a copy & paste to add this in

                                  19    => array( 'title'  => ts( 'Print PDF Letter for Contacts' ),
                                                  'class'  => 'CRM_Contact_Form_Task_PDF',
                                                  'result' => true ),
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

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: 3.2 action buttons
August 13, 2010, 04:59:05 pm
Yep - that one's not available via GET (but I think it's an easy change so if I have time I might mess with that - stay tuned :-) ).
Protect your investment in CiviCRM by  becoming a Member!

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: 3.2 action buttons
August 13, 2010, 07:26:36 pm
Hi,

if you do make it available via GET it might be worth allowing the template to be passed in through the URL
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

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: 3.2 action buttons
August 22, 2010, 03:19:34 pm
I've committed code for 3.2.2 that will allow you to invoke Create PDF Letter for a single contact via URL ('GET'). The pattern is:

  civicrm/contact/pdf?action=add&reset=1&cid=$contactId&selectedChild=activity

The issue is here:
http://issues.civicrm.org/jira/browse/CRM-6703

Here's an example of adding that action to the Actions button by customizing CRM/Activity/Form/ActivityLinks.tpl:

Code: [Select]
<ul>
{foreach from=$activityTypes key=k item=link}
   <li class="crm-activity-type_{$k}"><a href="{$url}{$k}">{if $k NEQ 3}{ts}Record {/ts}{/if}{$link}</a></li>
{/foreach}
{* Adding button for Create PDF here. *}
   <li class="crm-activity-pdf">
<a href="{crmURL p='civicrm/contact/pdf' q="action=add&reset=1&cid=`$contactId`&selectedChild=activity"}" title="{ts}Create PDF Letter{/ts}">{ts}Create PDF Letter{/ts}</a>
   </li>
</ul>

I think you could also add to the Actions button using the "links" hook, but I didn't try that out.

Adding code to set a default template via URL was a bit more than I had time for (I don't think we load a default message template anywhere else - might have missed a spot though).
Protect your investment in CiviCRM by  becoming a Member!

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: 3.2 action buttons
August 22, 2010, 08:36:35 pm
That's fabulous Dave.

I'm not quite clear from your post whether it is now part of the standard contact summary or you are telling me how to add it by customisation. I would think it is a generally useful function.

I did look at the sandbox but it wasn't there but  I know the sandbox isn't always up-to-date
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: 3.2 action buttons
August 23, 2010, 03:35:07 am
It's not part of core you have to customize template and add code mentioned by Dave,


Quote
{* Adding button for Create PDF here. *}
   <li class="crm-activity-pdf">
   <a href="{crmURL p='civicrm/contact/pdf' q="action=add&reset=1&cid=`$contactId`&selectedChild=activity"}" title="{ts}Create PDF Letter{/ts}">{ts}Create PDF Letter{/ts}</a>
   </li>

Also get all the fixes that are part of above issue. ( don't forget menu rebuild )

Kurund
« Last Edit: August 23, 2010, 03:37:15 am by Kurund Jalmi »
Found this reply helpful? Support CiviCRM

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: 3.2 action buttons
August 23, 2010, 12:52:11 pm
OK - I guess the question I have is that it seems really easy to add it to Core at this stage and I think all users would find it useful to be able to write a letter to an individual contact from their contact summary so I'm wondering why you didn't think it was a good idea to put it in core. Is it because the sample code is a template add-in not 'properly' coded in? Or because you don't think it would be good in core.

ie. is this a design decision or just not something you want to use your time on? If the latter I suspect it would be as easy for me to submit a patch as to implement this for half a dozen customers via template customisation
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

jimmyjam

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 4
Re: 3.2 action buttons
August 23, 2010, 06:16:07 pm
I agree with Eileen. This is a generally useful feature that would make a great addition to core. Especially for less technical admins like me who struggle at modifying code.

Thanks,
James

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: 3.2 action buttons
August 24, 2010, 06:56:15 pm
Wow - more popular feature than we had thought :-).

The current plan is to go ahead and add to action button (and Activities dropdown in Activities tab) for 3.2.3.
Protect your investment in CiviCRM by  becoming a Member!

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: 3.2 action buttons
August 24, 2010, 06:57:04 pm
Cool!
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

jimmyjam

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 4
Re: 3.2 action buttons
August 24, 2010, 08:38:22 pm
Thanks, Dave. That's wonderful news.

James

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: 3.2 action buttons
August 24, 2010, 10:01:52 pm
You can follow that issue here:
http://issues.civicrm.org/jira/browse/CRM-6726
Protect your investment in CiviCRM by  becoming a Member!

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: 3.2 action buttons
August 24, 2010, 10:10:52 pm
I don't know if it is generally useful or not but there is also a recipe someone put on the Wiki for adding a 'print label' to the actions to print an individual label. Not sure if people like to do that sort of thing because it seems you don't load label paper to print individual labels
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] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • 3.2 action buttons

This forum was archived on 2017-11-26.