Book Image

CiviCRM Cookbook

Book Image

CiviCRM Cookbook

Overview of this book

CiviCRM is a web-based, open source, Constituent Relationship Management (CRM) software geared toward meeting the needs of non-profit and other civic-sector organizations.Organizations realize their mission via CiviCRM through contact management, fundraising, event management, member management, mass e-mail marketing, peer-to-peer campaigns, case management, and much more.CiviCRM is localized in over 20 languages including: Chinese (Taiwan, China), Dutch, English (Australia, Canada, U.S., UK), French (France, Canada), German, Italian, Japanese, Russian, and Swedish.CiviCRM Cookbook will enhance your CiviCRM skills. It has recipes to help you use CiviCRM more efficiently, integrate it with CMSs, and also develop CiviCRM.This book begins with recipes that help save time and effort with CiviCRM. This is followed by recipes for organizing data more efficiently and managing profiles.Then you will learn authentication and authorization and managing communication with contacts.Then you will be guided on using the searching feature and preparing reports. We will then talk about integrating Drupal and CiviCRM. You will also be taught to manage events effectively. Finally, learn about CiviCampaign, Civimember, and developing CiviCRM.
Table of Contents (19 chapters)
CiviCRM Cookbook
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding an extra display field to a report template


There may be instances when you wish to add display fields to a CiviCRM report that is not available on the report template. For example, you might want to add the external identifier field.

How to do it…

In this example we will add the external identifier as a display option for a report.

  1. Set up a custom report template and register it with CiviCRM.

  2. Open the report PHP file. In this example we will use the special.php template created in the Adding custom fields to a report recipe in this chapter.

    Around line 49 we can see the code that generates the Contact checkboxes.

    protected $_customGroupGroupBy = FALSE; function __construct() {
        $this->_columns = array(
          'civicrm_contact' =>
          array(
            'dao' => 'CRM_Contact_DAO_Contact',
            'fields' =>
            array(
              'sort_name' =>
              array('title' => ts('Contact Name'),
                'required' => TRUE,
                'default' => TRUE,
          ...