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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Adding Donation Data to the Summary Tab using crmAPI
Pages: [1]

Author Topic: Adding Donation Data to the Summary Tab using crmAPI  (Read 677 times)

gplace

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.22
  • MySQL version: 5.1.49-1ubuntu8.1
  • PHP version: 5.3.3-1ubuntu9.3
Adding Donation Data to the Summary Tab using crmAPI
February 09, 2011, 12:22:32 pm
Hello,

Let me first say that CiviCRM is potentially saving our small non-profit about $1,000 compared to the GiftWorks solution our fundraising person wanted to purchase.

I am in the final stages of setting it up for her, and she is asking for the summary tab to display a profile for the contact including their notes, relationships, contributions, etc. I have managed all but the contributions. I have set up a custom template and have written some code, but can't get donations to display on the page. I am not a full-fledged developer so I'm sure I'm missing a piece or pieces. I have attached what i have so far... (the board wouldn't let me paste it under the code tags...)

I tried to mirror some of the other examples I have seen in tutorials, but have been unsuccessful. Does anyone know where I went wrong? I really appreciate it!

Rajan Mayekar

  • I post frequently
  • ***
  • Posts: 177
  • Karma: 20
    • Rajan's Blogs
Re: Adding Donation Data to the Summary Tab using crmAPI
February 09, 2011, 08:09:34 pm
Using report data may be the easy solution in this case,  You can populate report of that contact and display it on contact summary page.

I think Constituent Report (Detail) ( civicrm/report/instance/2&reset=1 ),  will be more useful for you.
You can update this report ( or create new report from template civicrm/report/contact/detail&reset=1 ) according to your need.

Following diff will help you

Code: [Select]
Index: templates/CRM/Contact/Page/View/Summary.tpl
===================================================================
--- templates/CRM/Contact/Page/View/Summary.tpl (revision 32315)
+++ templates/CRM/Contact/Page/View/Summary.tpl (working copy)
@@ -454,3 +454,18 @@
 {/if}
 <div class="clear"></div>
 </div><!-- /.crm-content-block -->
+<div id='reportdata'>
+</div>
+
+{literal}
+<script type="text/javascript">
+ var dataURL = {/literal}"{crmURL p='civicrm/report/instance/2' q='reset=1&snippet=4&section=4' h=0 }"{literal};
+ dataURL     += '&id_op=eq&id_value='+{/literal}{$contactId}{literal};
+ cj.ajax({
+ url: dataURL,
+ success: function( content ) {
+ cj('#reportdata').show( ).html( content );
+ }
+ });
+</script>
+{/literal}

Also you can modify template of report (templates/CRM/Report/Form/Contact/Detail.tpl ) accordingly.
 
Here is my post regarding displaying CiviReport data http://bit.ly/eGbUBe

Hope this will help you :)

Rajan

gplace

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.22
  • MySQL version: 5.1.49-1ubuntu8.1
  • PHP version: 5.3.3-1ubuntu9.3
Re: Adding Donation Data to the Summary Tab using crmAPI
February 10, 2011, 12:02:10 pm
thank you for your help, i did not even consider that i could display report data in the summary screens....

i noticed on your link that it is directed at drupal. I am running civicrm on joomla, will this method still work?

I looked up the constituent detail report, and it would be AWESOME if i could simplay display this data for each contact in the summary tab, my fundraising person would be thrilled

gplace

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.22
  • MySQL version: 5.1.49-1ubuntu8.1
  • PHP version: 5.3.3-1ubuntu9.3
Re: Adding Donation Data to the Summary Tab using crmAPI
February 10, 2011, 12:32:39 pm
wow, I figured it out. That is absolutely what i wanted, thank you for sharing this trick with me!!!

gplace

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.22
  • MySQL version: 5.1.49-1ubuntu8.1
  • PHP version: 5.3.3-1ubuntu9.3
Re: Adding Donation Data to the Summary Tab using crmAPI
February 10, 2011, 01:08:27 pm
OK, so I am thrilled with the results, but I have one more question: is there any way to remove the little header bar at the top of the report that is aimed at printing that report? I have attached what I am talking about. If there isn't, this is still a wonderful solution.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Adding Donation Data to the Summary Tab using crmAPI

This forum was archived on 2017-11-26.