Commit 55148836 authored by jaapjansma's avatar jaapjansma

made manage case configurable

parent c04d9e8e
......@@ -63,6 +63,7 @@ class CRM_DataprocessorSearch_CaseSearch implements UIFormOutputInterface {
$form->add('wysiwyg', 'help_text', E::ts('Help text for this search'), array('rows' => 6, 'cols' => 80));
$form->add('text', 'no_result_text', E::ts('No result text'), array('class' => 'huge'), false);
$form->add('checkbox', 'expanded_search', E::ts('Expand criteria form initially'));
$form->add('checkbox', 'show_manage_case', E::ts('Show manage case column'));
// navigation field
$navigationOptions = $navigation->getNavigationOptions();
......@@ -104,6 +105,9 @@ class CRM_DataprocessorSearch_CaseSearch implements UIFormOutputInterface {
if (isset($output['configuration']['expanded_search'])) {
$defaults['expanded_search'] = $output['configuration']['expanded_search'];
}
if (isset($output['configuration']['show_manage_case'])) {
$defaults['show_manage_case'] = $output['configuration']['show_manage_case'];
}
}
}
if (!isset($defaults['permission'])) {
......@@ -140,6 +144,7 @@ class CRM_DataprocessorSearch_CaseSearch implements UIFormOutputInterface {
$configuration['hide_id_fields'] = $submittedValues['hide_id_fields'];
$configuration['help_text'] = $submittedValues['help_text'];
$configuration['expanded_search'] = isset($submittedValues['expanded_search']) ? $submittedValues['expanded_search'] : false;
$configuration['show_manage_case'] = isset($submittedValues['show_manage_case']) ? $submittedValues['show_manage_case'] : false;
return $configuration;
}
......
......@@ -303,6 +303,7 @@ abstract class CRM_DataprocessorSearch_Form_AbstractSearch extends CRM_Dataproce
$this->pager = new CRM_Utils_Pager($pagerParams);
$this->assign('pager', $this->pager);
$this->controller->set('rowCount', $this->dataProcessorClass->getDataFlow()->recordCount());
$showLink = false;
$i=0;
try {
......@@ -330,6 +331,7 @@ abstract class CRM_DataprocessorSearch_Form_AbstractSearch extends CRM_Dataproce
if ($link) {
$row['url'] = $link;
$row['link_text'] = $this->linkText($row);
$showLink = true;
}
if (isset($row['checkbox'])) {
......@@ -358,6 +360,7 @@ abstract class CRM_DataprocessorSearch_Form_AbstractSearch extends CRM_Dataproce
$this->addElement('checkbox', 'toggleSelect', NULL, NULL, ['class' => 'select-rows']);
$this->assign('rows', $rows);
$this->assign('no_result_text', $this->getNoResultText());
$this->assign('showLink', $showLink);
$this->assign('debug_info', $this->dataProcessorClass->getDataFlow()->getDebugInformation());
if ($this->usePrevNextCache()) {
$cacheKey = "civicrm search {$this->controller->_key}";
......
......@@ -25,6 +25,10 @@ class CRM_DataprocessorSearch_Form_CaseSearch extends CRM_DataprocessorSearch_Fo
* @return false|string
*/
protected function link($row) {
if (empty($this->dataProcessorOutput['configuration']['show_manage_case'])) {
return false;
}
$record = $row['record'];
$idFieldName = $this->getIdFieldName();
$contactIdFieldName = $this->getContactIdFieldName();
......
......@@ -34,6 +34,11 @@
<div class="content">{$form.expanded_search.html}</div>
<div class="clear"></div>
</div>
<div class="crm-section">
<div class="label">{$form.show_manage_case.label}</div>
<div class="content">{$form.show_manage_case.html}</div>
<div class="clear"></div>
</div>
<div class="crm-section">
<div class="label">{$form.help_text.label}</div>
<div class="content">{$form.help_text.html}</div>
......
......@@ -40,7 +40,7 @@
{/if}
</th>
{/foreach}
<th scope="col"></th>
{if $showLink}{/if}<th scope="col"></th>{/if}
</tr></thead>
......@@ -55,6 +55,7 @@
<td>{$columnValue}</td>
{/foreach}
{if $showLink}
<td>
{if ($row.url)}
<a href="{$row.url}">
......@@ -62,6 +63,7 @@
</a>
{/if}
</td>
{/if}
</tr>
{/foreach}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment