Commit 056e339d authored by jaapjansma's avatar jaapjansma
Browse files

Removed the title attribute from the outputs as those don't make sense.

parent 46f224b8
......@@ -12,6 +12,7 @@
* Added filter for searching contacts with a certain tag.
* Added filter for searching contacts with a certain type.
* Added filter to respect the ACL. So that a user only sees the contacts he is allowed to see.
* Removed the title attribute from the outputs as those don't make sense.
# Version 1.0.7
......
......@@ -34,18 +34,6 @@ class CRM_Contact_DataProcessorContactSearch implements UIOutputInterface {
$field = $outputFieldHandler->getOutputFieldSpecification();
$fields[$field->alias] = $field->title;
}
$form->add('text', 'title', E::ts('Title'),NULL, true);
// form elements for adding Dashlet
// $output['dashlet'] 1-> Yes 2->No
if(isset($output['dashlet']) && $output['dashlet']==1){
$form->add('text', 'dashlet_title', E::ts('Dashlet Title'), NULL, true);
$form->add('text', 'dashlet_name', E::ts('Dashlet Name (system name)'), NULL, true);
$form->add('select', 'dashlet_active', E::ts('Is Dashlet Active ?'), array(1=>'Yes', 0=> 'No'), true);
}
$form->add('select','permission', E::ts('Permission'), \CRM_Core_Permission::basicPermissions(), true, array(
'style' => 'min-width:250px',
'class' => 'crm-select2 huge',
......@@ -74,11 +62,6 @@ class CRM_Contact_DataProcessorContactSearch implements UIOutputInterface {
if (isset($output['permission'])) {
$defaults['permission'] = $output['permission'];
}
if (isset($output['dashlet_name'])) {
$defaults['dashlet_name'] = $output['dashlet_name'];
$defaults['dashlet_title'] = $output['dashlet_title'];
$defaults['dashlet_active'] = $output['dashlet_active'];
}
if (isset($output['configuration']) && is_array($output['configuration'])) {
if (isset($output['configuration']['contact_id_field'])) {
$defaults['contact_id_field'] = $output['configuration']['contact_id_field'];
......@@ -86,9 +69,6 @@ class CRM_Contact_DataProcessorContactSearch implements UIOutputInterface {
if (isset($output['configuration']['navigation_id'])) {
$defaults['navigation_parent_path'] = $navigation->getNavigationParentPathById($output['configuration']['navigation_id']);
}
if (isset($output['configuration']['title'])) {
$defaults['title'] = $output['configuration']['title'];
}
if (isset($output['configuration']['hide_id_field'])) {
$defaults['hide_id_field'] = $output['configuration']['hide_id_field'];
}
......@@ -100,9 +80,6 @@ class CRM_Contact_DataProcessorContactSearch implements UIOutputInterface {
if (!isset($defaults['permission'])) {
$defaults['permission'] = 'access CiviCRM';
}
if (empty($defaults['title'])) {
$defaults['title'] = civicrm_api3('DataProcessor', 'getvalue', array('id' => $output['data_processor_id'], 'return' => 'title'));
}
$form->setDefaults($defaults);
}
......@@ -127,7 +104,6 @@ class CRM_Contact_DataProcessorContactSearch implements UIOutputInterface {
*/
public function processConfiguration($submittedValues, &$output) {
$output['permission'] = $submittedValues['permission'];
$configuration['title'] = $submittedValues['title'];
$configuration['contact_id_field'] = $submittedValues['contact_id_field'];
$configuration['navigation_parent_path'] = $submittedValues['navigation_parent_path'];
$configuration['hide_id_field'] = $submittedValues['hide_id_field'];
......@@ -164,7 +140,7 @@ class CRM_Contact_DataProcessorContactSearch implements UIOutputInterface {
* @return string
*/
public function getTitleForUiLink($output, $dataProcessor) {
return isset($output['configuration']['title']) ? $output['configuration']['title'] : $dataProcessor['title'];
return $dataProcessor['title'];
}
/**
......
......@@ -97,7 +97,6 @@ class CRM_Contact_DataProcessorContactSummaryTab implements UIOutputInterface {
public function buildConfigurationForm(\CRM_Core_Form $form, $output = []) {
$fieldSelect = \CRM_Dataprocessor_Utils_DataSourceFields::getAvailableFilterFieldsInDataSources($output['data_processor_id']);
$form->add('text', 'title', E::ts('Title'), true);
$form->add('select','permission', E::ts('Permission'), \CRM_Core_Permission::basicPermissions(), true, array(
'style' => 'min-width:250px',
'class' => 'crm-select2 huge',
......@@ -122,9 +121,6 @@ class CRM_Contact_DataProcessorContactSummaryTab implements UIOutputInterface {
$defaults['permission'] = $output['permission'];
}
if (isset($output['configuration']) && is_array($output['configuration'])) {
if (isset($output['configuration']['title'])) {
$defaults['title'] = $output['configuration']['title'];
}
if (isset($output['configuration']['help_text'])) {
$defaults['help_text'] = $output['configuration']['help_text'];
}
......@@ -145,9 +141,6 @@ class CRM_Contact_DataProcessorContactSummaryTab implements UIOutputInterface {
if (!isset($defaults['permission'])) {
$defaults['permission'] = 'access CiviCRM';
}
if (empty($defaults['title'])) {
$defaults['title'] = civicrm_api3('DataProcessor', 'getvalue', array('id' => $output['data_processor_id'], 'return' => 'title'));
}
if (!isset($defaults['no_result_text'])) {
$defaults['no_result_text'] = E::ts('No records');
}
......@@ -178,7 +171,6 @@ class CRM_Contact_DataProcessorContactSummaryTab implements UIOutputInterface {
*/
public function processConfiguration($submittedValues, &$output) {
$output['permission'] = $submittedValues['permission'];
$configuration['title'] = $submittedValues['title'];
$configuration['contact_id_field'] = $submittedValues['contact_id_field'];
$configuration['help_text'] = $submittedValues['help_text'];
$configuration['no_result_text'] = $submittedValues['no_result_text'];
......@@ -217,7 +209,7 @@ class CRM_Contact_DataProcessorContactSummaryTab implements UIOutputInterface {
* @return string
*/
public function getTitleForUiLink($output, $dataProcessor) {
return isset($output['configuration']['title']) ? $output['configuration']['title'] : $dataProcessor['title'];
return $dataProcessor['title'];
}
/**
......
......@@ -43,9 +43,6 @@ class CRM_Dataprocessor_Form_Output extends CRM_Core_Form {
$this->id = CRM_Utils_Request::retrieve('id', 'Integer');
$this->assign('id', $this->id);
$dashlet = CRM_Utils_Request::retrieve('dashlet', 'Integer');
// dashlet 1->Yes 2->No
if ($this->id) {
$this->output = civicrm_api3('DataProcessorOutput', 'getsingle', array('id' => $this->id));
$this->assign('output', $this->output);
......@@ -62,10 +59,6 @@ class CRM_Dataprocessor_Form_Output extends CRM_Core_Form {
if (!$this->output) {
$this->output['data_processor_id'] = $this->dataProcessorId;
}
if($dashlet){
$this->dashlet = $dashlet;
$this->output['dashlet'] = $this->dashlet;
}
$title = E::ts('Data Processor Output');
CRM_Utils_System::setTitle($title);
......
......@@ -25,7 +25,6 @@ class CRM_DataprocessorDashlet_Dashlet implements Civi\DataProcessor\Output\Outp
* @param array $output
*/
public function buildConfigurationForm(\CRM_Core_Form $form, $output = []) {
$form->add('text', 'title', E::ts('Title'), true);
$form->add('select','permission', E::ts('Permission'), \CRM_Core_Permission::basicPermissions(), true, array(
'style' => 'min-width:250px',
'class' => 'crm-select2 huge',
......@@ -40,9 +39,6 @@ class CRM_DataprocessorDashlet_Dashlet implements Civi\DataProcessor\Output\Outp
$defaults['permission'] = $output['permission'];
}
if (isset($output['configuration']) && is_array($output['configuration'])) {
if (isset($output['configuration']['title'])) {
$defaults['title'] = $output['configuration']['title'];
}
if (isset($output['configuration']['default_limit'])) {
$defaults['default_limit'] = $output['configuration']['default_limit'];
}
......@@ -54,9 +50,6 @@ class CRM_DataprocessorDashlet_Dashlet implements Civi\DataProcessor\Output\Outp
if (!isset($defaults['permission'])) {
$defaults['permission'] = 'access CiviCRM';
}
if (empty($defaults['title'])) {
$defaults['title'] = civicrm_api3('DataProcessor', 'getvalue', array('id' => $output['data_processor_id'], 'return' => 'title'));
}
if (empty($defaults['default_limit'])) {
$defaults['default_limit'] = 10;
}
......@@ -90,7 +83,7 @@ class CRM_DataprocessorDashlet_Dashlet implements Civi\DataProcessor\Output\Outp
$dashletParams['url'] = $dashletUrl;
$dashletParams['fullscreen_url'] = $fullScreenUrl;
$dashletParams['name'] = $dashletName;
$dashletParams['label'] = $submittedValues['title'];
$dashletParams['label'] = $dataProcessor['title'];
$dashletParams['permission'] = $submittedValues['permission'];
$dashletParams['is_active'] = 1;
$dashletParams['cache_minutes'] = 60;
......@@ -107,7 +100,6 @@ class CRM_DataprocessorDashlet_Dashlet implements Civi\DataProcessor\Output\Outp
civicrm_api3('Dashboard', 'create', $dashletParams);
$output['permission'] = $submittedValues['permission'];
$configuration['title'] = $submittedValues['title'];
$configuration['default_limit'] = $submittedValues['default_limit'];
$configuration['help_text'] = $submittedValues['help_text'];
return $configuration;
......
......@@ -36,8 +36,6 @@ class CRM_DataprocessorSearch_ActivitySearch implements UIOutputInterface {
$fields[$field->alias] = $field->title;
}
$form->add('text', 'title', E::ts('Title'), true);
$form->add('select','permission', E::ts('Permission'), \CRM_Core_Permission::basicPermissions(), true, array(
'style' => 'min-width:250px',
'class' => 'crm-select2 huge',
......@@ -72,9 +70,6 @@ class CRM_DataprocessorSearch_ActivitySearch implements UIOutputInterface {
if (isset($output['configuration']['navigation_id'])) {
$defaults['navigation_parent_path'] = $navigation->getNavigationParentPathById($output['configuration']['navigation_id']);
}
if (isset($output['configuration']['title'])) {
$defaults['title'] = $output['configuration']['title'];
}
if (isset($output['configuration']['hide_id_field'])) {
$defaults['hide_id_field'] = $output['configuration']['hide_id_field'];
}
......@@ -86,9 +81,6 @@ class CRM_DataprocessorSearch_ActivitySearch implements UIOutputInterface {
if (!isset($defaults['permission'])) {
$defaults['permission'] = 'access CiviCRM';
}
if (empty($defaults['title'])) {
$defaults['title'] = civicrm_api3('DataProcessor', 'getvalue', array('id' => $output['data_processor_id'], 'return' => 'title'));
}
$form->setDefaults($defaults);
}
......@@ -112,7 +104,6 @@ class CRM_DataprocessorSearch_ActivitySearch implements UIOutputInterface {
*/
public function processConfiguration($submittedValues, &$output) {
$output['permission'] = $submittedValues['permission'];
$configuration['title'] = $submittedValues['title'];
$configuration['activity_id_field'] = $submittedValues['activity_id_field'];
$configuration['navigation_parent_path'] = $submittedValues['navigation_parent_path'];
$configuration['hide_id_field'] = $submittedValues['hide_id_field'];
......@@ -149,7 +140,7 @@ class CRM_DataprocessorSearch_ActivitySearch implements UIOutputInterface {
* @return string
*/
public function getTitleForUiLink($output, $dataProcessor) {
return isset($output['configuration']['title']) ? $output['configuration']['title'] : $dataProcessor['title'];
return $dataProcessor['title'];
}
/**
......
......@@ -36,8 +36,6 @@ class CRM_DataprocessorSearch_CaseSearch implements UIOutputInterface {
$fields[$field->alias] = $field->title;
}
$form->add('text', 'title', E::ts('Title'), true);
$form->add('select','permission', E::ts('Permission'), \CRM_Core_Permission::basicPermissions(), true, array(
'style' => 'min-width:250px',
'class' => 'crm-select2 huge',
......@@ -80,9 +78,6 @@ class CRM_DataprocessorSearch_CaseSearch implements UIOutputInterface {
if (isset($output['configuration']['navigation_id'])) {
$defaults['navigation_parent_path'] = $navigation->getNavigationParentPathById($output['configuration']['navigation_id']);
}
if (isset($output['configuration']['title'])) {
$defaults['title'] = $output['configuration']['title'];
}
if (isset($output['configuration']['hide_id_fields'])) {
$defaults['hide_id_fields'] = $output['configuration']['hide_id_fields'];
}
......@@ -94,9 +89,6 @@ class CRM_DataprocessorSearch_CaseSearch implements UIOutputInterface {
if (!isset($defaults['permission'])) {
$defaults['permission'] = 'access CiviCRM';
}
if (empty($defaults['title'])) {
$defaults['title'] = civicrm_api3('DataProcessor', 'getvalue', array('id' => $output['data_processor_id'], 'return' => 'title'));
}
$form->setDefaults($defaults);
}
......@@ -120,7 +112,6 @@ class CRM_DataprocessorSearch_CaseSearch implements UIOutputInterface {
*/
public function processConfiguration($submittedValues, &$output) {
$output['permission'] = $submittedValues['permission'];
$configuration['title'] = $submittedValues['title'];
$configuration['contact_id_field'] = $submittedValues['contact_id_field'];
$configuration['case_id_field'] = $submittedValues['case_id_field'];
$configuration['navigation_parent_path'] = $submittedValues['navigation_parent_path'];
......@@ -158,7 +149,7 @@ class CRM_DataprocessorSearch_CaseSearch implements UIOutputInterface {
* @return string
*/
public function getTitleForUiLink($output, $dataProcessor) {
return isset($output['configuration']['title']) ? $output['configuration']['title'] : $dataProcessor['title'];
return $dataProcessor['title'];
}
/**
......
......@@ -463,7 +463,7 @@ abstract class CRM_DataprocessorSearch_Form_AbstractSearch extends CRM_Dataproce
*/
public function getTitle() {
$this->loadDataProcessor();
return $this->dataProcessorOutput['configuration']['title'];
return $this->dataProcessor['title'];
}
/**
......
......@@ -37,8 +37,6 @@ class CRM_DataprocessorSearch_ParticipantSearch implements UIOutputInterface {
$fields[$field->alias] = $field->title;
}
$form->add('text', 'title', E::ts('Title'), NULL,true);
$form->add('select','permission', E::ts('Permission'), \CRM_Core_Permission::basicPermissions(), true, array(
'style' => 'min-width:250px',
'class' => 'crm-select2 huge',
......@@ -73,9 +71,6 @@ class CRM_DataprocessorSearch_ParticipantSearch implements UIOutputInterface {
if (isset($output['configuration']['navigation_id'])) {
$defaults['navigation_parent_path'] = $navigation->getNavigationParentPathById($output['configuration']['navigation_id']);
}
if (isset($output['configuration']['title'])) {
$defaults['title'] = $output['configuration']['title'];
}
if (isset($output['configuration']['hide_id_field'])) {
$defaults['hide_id_field'] = $output['configuration']['hide_id_field'];
}
......@@ -87,9 +82,6 @@ class CRM_DataprocessorSearch_ParticipantSearch implements UIOutputInterface {
if (!isset($defaults['permission'])) {
$defaults['permission'] = 'access CiviCRM';
}
if (empty($defaults['title'])) {
$defaults['title'] = civicrm_api3('DataProcessor', 'getvalue', array('id' => $output['data_processor_id'], 'return' => 'title'));
}
$form->setDefaults($defaults);
}
......@@ -113,7 +105,6 @@ class CRM_DataprocessorSearch_ParticipantSearch implements UIOutputInterface {
*/
public function processConfiguration($submittedValues, &$output) {
$output['permission'] = $submittedValues['permission'];
$configuration['title'] = $submittedValues['title'];
$configuration['participant_id_field'] = $submittedValues['participant_id_field'];
$configuration['navigation_parent_path'] = $submittedValues['navigation_parent_path'];
$configuration['hide_id_field'] = $submittedValues['hide_id_field'];
......@@ -150,7 +141,7 @@ class CRM_DataprocessorSearch_ParticipantSearch implements UIOutputInterface {
* @return string
*/
public function getTitleForUiLink($output, $dataProcessor) {
return isset($output['configuration']['title']) ? $output['configuration']['title'] : $dataProcessor['title'];
return $dataProcessor['title'];
}
/**
......
......@@ -37,8 +37,6 @@ class CRM_DataprocessorSearch_Search implements UIOutputInterface {
$fields[$field->alias] = $field->title;
}
$form->add('text', 'title', E::ts('Title'), true);
$form->add('select','permission', E::ts('Permission'), \CRM_Core_Permission::basicPermissions(), true, array(
'style' => 'min-width:250px',
'class' => 'crm-select2 huge',
......@@ -73,9 +71,6 @@ class CRM_DataprocessorSearch_Search implements UIOutputInterface {
if (isset($output['configuration']['navigation_id'])) {
$defaults['navigation_parent_path'] = $navigation->getNavigationParentPathById($output['configuration']['navigation_id']);
}
if (isset($output['configuration']['title'])) {
$defaults['title'] = $output['configuration']['title'];
}
if (isset($output['configuration']['hide_id_field'])) {
$defaults['hide_id_field'] = $output['configuration']['hide_id_field'];
}
......@@ -87,9 +82,6 @@ class CRM_DataprocessorSearch_Search implements UIOutputInterface {
if (!isset($defaults['permission'])) {
$defaults['permission'] = 'access CiviCRM';
}
if (empty($defaults['title'])) {
$defaults['title'] = civicrm_api3('DataProcessor', 'getvalue', array('id' => $output['data_processor_id'], 'return' => 'title'));
}
$form->setDefaults($defaults);
}
......@@ -113,7 +105,6 @@ class CRM_DataprocessorSearch_Search implements UIOutputInterface {
*/
public function processConfiguration($submittedValues, &$output) {
$output['permission'] = $submittedValues['permission'];
$configuration['title'] = $submittedValues['title'];
$configuration['id_field'] = $submittedValues['id_field'];
$configuration['navigation_parent_path'] = $submittedValues['navigation_parent_path'];
$configuration['hide_id_field'] = $submittedValues['hide_id_field'];
......@@ -150,7 +141,7 @@ class CRM_DataprocessorSearch_Search implements UIOutputInterface {
* @return string
*/
public function getTitleForUiLink($output, $dataProcessor) {
return isset($output['configuration']['title']) ? $output['configuration']['title'] : $dataProcessor['title'];
return $dataProcessor['title'];
}
/**
......
......@@ -121,7 +121,7 @@ class Factory {
$this->addOutput('api', 'Civi\DataProcessor\Output\Api', E::ts('API'));
$this->addOutput('contact_summary_tab', 'CRM_Contact_DataProcessorContactSummaryTab', E::ts('Tab on contact summary'));
$this->addOutput('dashlet', 'CRM_DataprocessorDashlet_Dashlet', E::ts('Dashlet'));
$this->addOutput('search', 'CRM_DataprocessorSearch_Search', E::ts('Search'));
$this->addOutput('search', 'CRM_DataprocessorSearch_Search', E::ts('Search / Report'));
$this->addOutput('contact_search', 'CRM_Contact_DataProcessorContactSearch', E::ts('Contact Search'));
$this->addOutput('activity_search', 'CRM_DataprocessorSearch_ActivitySearch', E::ts('Activity Search'));
$this->addOutput('case_search', 'CRM_DataprocessorSearch_CaseSearch', E::ts('Case Search'));
......
......@@ -183,8 +183,10 @@ abstract class AbstractProcessorType {
* @throws \Exception
*/
public function setDefaultFilterValues() {
foreach($this->filterHandlers as $filterHandler) {
$filterHandler->setDefaultFilterValues();
if ($this->filterHandlers && is_array($this->filterHandlers)) {
foreach ($this->filterHandlers as $filterHandler) {
$filterHandler->setDefaultFilterValues();
}
}
}
......
{crmScope extensionKey='dataprocessor'}
<div class="crm-section">
<div class="label">{$form.title.label}</div>
<div class="content">{$form.title.html}</div>
<div class="clear"></div>
</div>
<div class="crm-section">
<div class="label">{$form.navigation_parent_path.label}</div>
<div class="content">{$form.navigation_parent_path.html}</div>
......
{crmScope extensionKey='dataprocessor'}
<div class="crm-section">
<div class="label">{$form.title.label}</div>
<div class="content">{$form.title.html}</div>
<div class="clear"></div>
</div>
<div class="crm-section">
<div class="label">{$form.permission.label}</div>
<div class="content">{$form.permission.html}</div>
......
{crmScope extensionKey='dataprocessor'}
<div class="crm-section">
<div class="label">{$form.title.label}</div>
<div class="content">{$form.title.html}</div>
<div class="clear"></div>
</div>
<div class="crm-section">
<div class="label">{$form.permission.label}</div>
<div class="content">{$form.permission.html}</div>
......
{crmScope extensionKey='dataprocessor'}
<div class="crm-section">
<div class="label">{$form.title.label}</div>
<div class="content">{$form.title.html}</div>
<div class="clear"></div>
</div>
<div class="crm-section">
<div class="label">{$form.navigation_parent_path.label}</div>
<div class="content">{$form.navigation_parent_path.html}</div>
......@@ -29,4 +24,4 @@
<div class="content">{$form.help_text.html}</div>
<div class="clear"></div>
</div>
{/crmScope}
\ No newline at end of file
{/crmScope}
{crmScope extensionKey='dataprocessor'}
<div class="crm-section">
<div class="label">{$form.title.label}</div>
<div class="content">{$form.title.html}</div>
<div class="clear"></div>
</div>
<div class="crm-section">
<div class="label">{$form.navigation_parent_path.label}</div>
<div class="content">{$form.navigation_parent_path.html}</div>
......@@ -34,4 +29,4 @@
<div class="content">{$form.help_text.html}</div>
<div class="clear"></div>
</div>
{/crmScope}
\ No newline at end of file
{/crmScope}
{crmScope extensionKey='dataprocessor'}
<div class="crm-section">
<div class="label">{$form.title.label}</div>
<div class="content">{$form.title.html}</div>
<div class="clear"></div>
</div>
<div class="crm-section">
<div class="label">{$form.navigation_parent_path.label}</div>
<div class="content">{$form.navigation_parent_path.html}</div>
......@@ -29,4 +24,4 @@
<div class="content">{$form.help_text.html}</div>
<div class="clear"></div>
</div>
{/crmScope}
\ No newline at end of file
{/crmScope}
{crmScope extensionKey='dataprocessor'}
<div class="crm-section">
<div class="label">{$form.title.label}</div>
<div class="content">{$form.title.html}</div>
<div class="clear"></div>
</div>
<div class="crm-section">
<div class="label">{$form.navigation_parent_path.label}</div>
<div class="content">{$form.navigation_parent_path.html}</div>
......@@ -29,4 +24,4 @@
<div class="content">{$form.help_text.html}</div>
<div class="clear"></div>
</div>
{/crmScope}
\ No newline at end of file
{/crmScope}
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