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 CiviReport (Moderator: Dave Greenberg) »
  • Remove the word "view" from PDF reports
Pages: [1]

Author Topic: Remove the word "view" from PDF reports  (Read 576 times)

betalister

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: Several
  • CMS version: Drupal, WordPress
  • MySQL version: 5.5
  • PHP version: 5.3
Remove the word "view" from PDF reports
October 22, 2013, 03:26:46 pm
Is there an easy way to remove the word "view" from reports? See example of Event Participant Report (List) PDF.


hbergin

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 6
  • CiviCRM version: 3.4.5 to 4.4.1
  • CMS version: Drupal 6.28 to 7.23
  • MySQL version: 5.5.34
  • PHP version: 5.3.10
Re: Remove the word "view" from PDF reports
December 09, 2013, 02:06:10 pm
You could create a custom copy of the report.

In the copy of the ParticipantListing.php file, you could change the following lines in the alterDisplay function to remove the View link:

Delete or comment out the lines in bold:
        $participantTitle = ts('View Participant Record');

        $rows[$rowNum]['civicrm_contact_sort_name_linked'] = "<a title='$contactTitle' href=$url>$displayName</a>";

        if ($this->_outputMode !== 'csv') {
         $rows[$rowNum]['civicrm_contact_sort_name_linked'] .= "<span style='float: right;'><a title='$participantTitle' href=$viewUrl>" . ts('View') . "</a></span>";
       }


Code: [Select]
      // Convert display name to link
      if (($displayName = CRM_Utils_Array::value('civicrm_contact_sort_name_linked', $row)) &&
        ($cid = CRM_Utils_Array::value('civicrm_contact_id', $row)) &&
        ($id = CRM_Utils_Array::value('civicrm_participant_participant_record', $row))
      ) {
        $url = CRM_Report_Utils_Report::getNextUrl('contact/detail',
          "reset=1&force=1&id_op=eq&id_value=$cid",
          $this->_absoluteUrl, $this->_id, $this->_drilldownReport
        );

        $viewUrl = CRM_Utils_System::url("civicrm/contact/view/participant",
          "reset=1&id=$id&cid=$cid&action=view&context=participant"
        );

        $contactTitle = ts('View Contact Details');
        $participantTitle = ts('View Participant Record');[/b]

        $rows[$rowNum]['civicrm_contact_sort_name_linked'] = "<a title='$contactTitle' href=$url>$displayName</a>";

        if ($this->_outputMode !== 'csv') {
         $rows[$rowNum]['civicrm_contact_sort_name_linked'] .= "<span style='float: right;'><a title='$participantTitle' href=$viewUrl>" . ts('View') . "</a></span>";
        }
        $entryFound = TRUE;
      }

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Remove the word "view" from PDF reports

This forum was archived on 2017-11-26.