Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Developer Documentation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Documentation
Docs
Developer Documentation
Commits
8865a6f6
Commit
8865a6f6
authored
5 years ago
by
mfb
Browse files
Options
Downloads
Patches
Plain Diff
Rename object variable for clarity.
parent
51de129f
No related branches found
Branches containing commit
No related tags found
1 merge request
!758
Remove pass-by-reference from object variable.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/hooks/hook_civicrm_alterReportVar.md
+6
-6
6 additions, 6 deletions
docs/hooks/hook_civicrm_alterReportVar.md
with
6 additions
and
6 deletions
docs/hooks/hook_civicrm_alterReportVar.md
+
6
−
6
View file @
8865a6f6
...
...
@@ -6,7 +6,7 @@ This hook is used to add or modify display columns and filters.
## Definition
alterReportVar($varType, &$var, $
object
) {
alterReportVar($varType, &$var, $
reportForm
) {
## Parameters
...
...
@@ -14,7 +14,7 @@ This hook is used to add or modify display columns and filters.
"sql", depending on where the hook is called.
-
&$var - a mixed var containing the columns, rows, or SQL, depending
on where the hook is called
-
$
object
- a reference to the CRM_Report_Form object.
-
$
reportForm
- a reference to the CRM_Report_Form object.
## Returns
...
...
@@ -32,8 +32,8 @@ columns appropriately.
/**
* Implementation of hook_civicrm_alterReportVar
*/
function mte_civicrm_alterReportVar($varType, &$var, $
object
) {
$instanceValue = $
object
->getVar('_instanceValues');
function mte_civicrm_alterReportVar($varType, &$var, $
reportForm
) {
$instanceValue = $
reportForm
->getVar('_instanceValues');
if (!empty($instanceValue) &&
in_array(
$instanceValue['report_id'],
...
...
@@ -78,7 +78,7 @@ columns appropriately.
$mail->auto_responder = FALSE;
$mail->open_tracking = TRUE;
$mail->find(true);
if (array_key_exists('civicrm_mailing_mailing_name', $
object
->_columnHeaders)) {
if (array_key_exists('civicrm_mailing_mailing_name', $
reportForm
->_columnHeaders)) {
foreach ($var as $key => $value) {
if (!empty($value['civicrm_mandrill_activity_id']) && $mail->id == $value['civicrm_mailing_id']) {
$var[$key]['civicrm_mailing_mailing_name_link'] = CRM_Utils_System::url(
...
...
@@ -88,7 +88,7 @@ columns appropriately.
$var[$key]['civicrm_mailing_mailing_name_hover'] = ts('View Transactional Email');
}
}
unset($
object
->_columnHeaders['civicrm_mandrill_activity_id'], $
object
->_columnHeaders['civicrm_mailing_id']);
unset($
reportForm
->_columnHeaders['civicrm_mandrill_activity_id'], $
reportForm
->_columnHeaders['civicrm_mailing_id']);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment