From 76bec9f7ce8111bbd6410f51d4e4e35ee23fc2da Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 8 Dec 2014 23:36:03 -0500 Subject: [PATCH] CRM-13611 - Fix case detail report --- CRM/Case/Page/AJAX.php | 9 +- CRM/Report/Form/Case/Detail.php | 8 +- templates/CRM/Report/Form/Case/Detail.tpl | 283 +--------------------- 3 files changed, 13 insertions(+), 287 deletions(-) diff --git a/CRM/Case/Page/AJAX.php b/CRM/Case/Page/AJAX.php index 30b5f08232..e685b96e18 100644 --- a/CRM/Case/Page/AJAX.php +++ b/CRM/Case/Page/AJAX.php @@ -140,10 +140,15 @@ class CRM_Case_Page_AJAX { " . ts('Case Status') . "{$cs} " . ts('Case Start Date') . "" . CRM_Utils_Date::customFormat($dao->start_date) . " " . ts('Case End Date') . "" . CRM_Utils_Date::customFormat($dao->end_date) . ""; - echo $caseDetails; + if (CRM_Utils_Array::value('snippet', $_GET) == 'json') { + CRM_Core_Page_AJAX::returnJsonResponse($caseDetails); + } + else { + echo $caseDetails; + } } else { - echo ts('Could not find valid Case!'); + CRM_Core_Error::fatal('Could not find valid Case.'); } CRM_Utils_System::civiExit(); } diff --git a/CRM/Report/Form/Case/Detail.php b/CRM/Report/Form/Case/Detail.php index 0d88234558..6596df1a85 100644 --- a/CRM/Report/Form/Case/Detail.php +++ b/CRM/Report/Form/Case/Detail.php @@ -600,9 +600,11 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { } if (array_key_exists('civicrm_case_subject', $row)) { if ($value = $row['civicrm_case_subject']) { - $caseId = $row['civicrm_case_id']; - $contactId = $row['civicrm_contact_id']; - $rows[$rowNum]['civicrm_case_subject'] = "$value"; + $url = CRM_Utils_System::url("civicrm/case/ajax/details", + "caseId={$row['civicrm_case_id']}&contactId={$row['civicrm_contact_id']}", + $this->_absoluteUrl + ); + $rows[$rowNum]['civicrm_case_subject'] = "$value"; $rows[$rowNum]['civicrm_case_subject_hover'] = ts('View Details of Case.'); $entryFound = TRUE; diff --git a/templates/CRM/Report/Form/Case/Detail.tpl b/templates/CRM/Report/Form/Case/Detail.tpl index 6767c16e5d..9d72b48002 100644 --- a/templates/CRM/Report/Form/Case/Detail.tpl +++ b/templates/CRM/Report/Form/Case/Detail.tpl @@ -23,285 +23,4 @@ | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ *} -{if $section eq 1} -
- {*include the graph*} - {include file="CRM/Report/Form/Layout/Graph.tpl"} -
- {elseif $section eq 2} -
- {*include the table layout*} - {include file="CRM/Report/Form/Layout/Table.tpl"} -
- {else} -
- - {if !$printOnly} {* NO print section starts *} -
{* criteria section starts *} -
-
- {ts}Report Criteria{/ts} -
-
-
{* search section starts *} - - {if $colGroups} - {if $componentName eq 'Grant'} -

{ts}Include these Statistics{/ts}

- {else} -

Display Columns

- {/if} - {foreach from=$colGroups item=grpFields key=dnc} - {assign var="count" value="0"} - {* Wrap custom field sets in collapsed accordion pane. *} - {if $grpFields.group_title} - - {/if} - {/foreach} - - - {foreach from=$caseDetailExtra key=field item=fieldDetail} - - - - {/foreach} -
{$fieldDetail.title} {$form.case_detail_extra.$field.html}
- {/if} - - {if $groupByElements} -

Group by Columns

- {assign var="count" value="0"} - - - {foreach from=$groupByElements item=gbElem key=dnc} - {assign var="count" value=`$count+1`} - - {if $count is div by 4} - - {/if} - {/foreach} - {if $count is not div by 4} - - {/if} - -
- {$form.group_bys[$gbElem].html} - {if $form.group_bys_freq[$gbElem].html}:
-   {$form.group_bys_freq[$gbElem].label} {$form.group_bys_freq[$gbElem].html} - {/if} -
- {/if} - - {if $form.options.html || $form.options.html} -

Other Options

- - - - {if $form.blank_column_end} - - {/if} - -
{$form.options.html}{$form.blank_column_end.label}  {$form.blank_column_end.html}
- {/if} - - {if $filters} -

Set Filters

- - {assign var="counter" value=1} - {foreach from=$filters item=table key=tableName} - {assign var="filterCount" value=$table|@count} - {* Wrap custom field sets in collapsed accordion pane. *} - {if $colGroups.$tableName.group_title and $filterCount gte 1} - {* we should close table that contains other filter elements before we start building custom group accordian *} - {if $counter eq 1} -
- {assign var="counter" value=0} - {/if} - - {assign var=closed value=1"} {*-- ie table tags are closed-- *} - {else} - {assign var=closed value=0"} {*-- ie table tags are not closed-- *} - {/if} - - {/foreach} - {if $closed eq 0 }{/if} - {/if} - - {literal} - - {/literal} - -
{$form.buttons.html}
-
{* search div section ends *} -
-
-
{* criteria section ends *} - - {if $instanceForm OR $instanceFormError} {* settings section starts *} -
-
- {if $mode eq 'template'}{ts}Create Report{/ts}{else}{ts}Report Settings{/ts}{/if} -
-
-
-
- {include file="CRM/Report/Form/Instance.tpl"} - {assign var=save value="_qf_"|cat:$form.formName|cat:"_submit_save"} -
- {$form.$save.html} -
-
-
-
-
- {if $updateReportButton} -
- {$form.$save.html} -
- {/if} - {/if} {* settings section ends *} - - {/if} {* NO print section ends *} - - -
- -
- {*include actions*} - {include file="CRM/Report/Form/Actions.tpl"} - - {*Statistics at the Top of the page*} - {include file="CRM/Report/Form/Statistics.tpl" top=true} - - {*include the graph*} - {include file="CRM/Report/Form/Layout/Graph.tpl"} - - {*include the table layout*} - {include file="CRM/Report/Form/Layout/Table.tpl"} -
- {*Statistics at the bottom of the page*} - {include file="CRM/Report/Form/Statistics.tpl" bottom=true} - - {include file="CRM/Report/Form/ErrorMessage.tpl"} -
-{/if} - -
-{literal} - -{/literal} +{include file="CRM/Report/Form.tpl"} -- 2.25.1