From ab65b049d7c68109c553c086b3b6f4429cb8aeca Mon Sep 17 00:00:00 2001
From: Jaap Jansma <jaap.jansma@civicoop.org>
Date: Tue, 2 Apr 2019 21:22:38 +0200
Subject: [PATCH] Updated added a manage data processor page

---
 .../Form/ManageDataProcessors.php             |  75 ++++++
 .../Form/Search/DataProcessor.mgd.php         |  19 --
 .../Form/Search/DataProcessor.php             | 221 ------------------
 dataprocessor.php                             |   8 +-
 .../Form/ManageDataProcessors.tpl             | 108 +++++++++
 .../Form/Search/DataProcessor.tpl             |  93 --------
 .../Form/Search/DataProcessorCriteria.tpl     |  63 -----
 xml/Menu/dataprocessor.xml                    |   7 +
 8 files changed, 193 insertions(+), 401 deletions(-)
 create mode 100644 CRM/Dataprocessor/Form/ManageDataProcessors.php
 delete mode 100644 CRM/Dataprocessor/Form/Search/DataProcessor.mgd.php
 delete mode 100644 CRM/Dataprocessor/Form/Search/DataProcessor.php
 create mode 100644 templates/CRM/Dataprocessor/Form/ManageDataProcessors.tpl
 delete mode 100644 templates/CRM/Dataprocessor/Form/Search/DataProcessor.tpl
 delete mode 100644 templates/CRM/Dataprocessor/Form/Search/DataProcessorCriteria.tpl

diff --git a/CRM/Dataprocessor/Form/ManageDataProcessors.php b/CRM/Dataprocessor/Form/ManageDataProcessors.php
new file mode 100644
index 00000000..c5645cc0
--- /dev/null
+++ b/CRM/Dataprocessor/Form/ManageDataProcessors.php
@@ -0,0 +1,75 @@
+<?php
+/**
+ * @author Jaap Jansma <jaap.jansma@civicoop.org>
+ * @license AGPL-3.0
+ */
+
+use CRM_Dataprocessor_ExtensionUtil as E;
+
+class CRM_Dataprocessor_Form_ManageDataProcessors extends CRM_Core_Form {
+
+  public function preProcess() {
+    parent::preProcess();
+
+    $formValues = $this->getSubmitValues();
+
+    $this->setTitle(E::ts('Manage Data Processors'));
+
+    $whereClauses = array("1");
+    if (isset($formValues['title']) && !empty($formValues['title'])) {
+      $whereClauses[] = "`title` LIKE '%". CRM_Utils_Type::escape($formValues['title'], 'String')."%'";
+    }
+    if (isset($formValues['description']) && !empty($formValues['description'])) {
+      $whereClauses[]  = "`description` LIKE '%". CRM_Utils_Type::escape($formValues['description'], 'String')."%'";
+    }
+    if (isset($formValues['is_active']) && $formValues['is_active'] == '0') {
+      $whereClauses[] = "`is_active` = 0";
+    } elseif (isset($formValues['is_active']) && $formValues['is_active'] == '1') {
+      $whereClauses[] = "`is_active` = 1";
+    }
+
+    $whereStatement = implode(" AND ", $whereClauses);
+    $sql = "SELECT * FROM civicrm_data_processor WHERE {$whereStatement} ORDER BY is_active, title";
+    $dataProcessors = array();
+    $dao = CRM_Core_DAO::executeQuery($sql, array(), false, 'CRM_Dataprocessor_DAO_DataProcessor');
+    while($dao->fetch()) {
+      $row = array();
+      CRM_Dataprocessor_DAO_DataProcessor::storeValues($dao, $row);
+      switch ($row['status']) {
+        case CRM_Dataprocessor_DAO_DataProcessor::STATUS_IN_CODE:
+          $row['status_label'] = E::ts('In code');
+          break;
+        case CRM_Dataprocessor_DAO_DataProcessor::STATUS_OVERRIDDEN:
+          $row['status_label'] = E::ts('Overridden');
+          break;
+        case CRM_Dataprocessor_DAO_DataProcessor::STATUS_IN_DATABASE:
+          $row['status_label'] = E::ts('In database');
+          break;
+      }
+      $dataProcessors[] = $row;
+    }
+    $this->assign('data_processors', $dataProcessors);
+  }
+
+  public function buildQuickForm() {
+    parent::buildQuickForm();
+
+    $this->add('text', 'title', E::ts('Title contains'), array('class' => 'huge'));
+    $this->add('text', 'description', E::ts('Description contains'), array('class' => 'huge'));
+
+    $this->addYesNo('is_active', E::ts('Is active'), true);
+
+    $this->addButtons(array(
+      array(
+        'type' => 'refresh',
+        'name' => E::ts('Search'),
+        'isDefault' => TRUE,
+      ),
+    ));
+  }
+
+  public function postProcess() {
+
+  }
+
+}
\ No newline at end of file
diff --git a/CRM/Dataprocessor/Form/Search/DataProcessor.mgd.php b/CRM/Dataprocessor/Form/Search/DataProcessor.mgd.php
deleted file mode 100644
index 00c80fcb..00000000
--- a/CRM/Dataprocessor/Form/Search/DataProcessor.mgd.php
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-// This file declares a managed database record of type "CustomSearch".
-// The record will be automatically inserted, updated, or deleted from the
-// database as appropriate. For more details, see "hook_civicrm_managed" at:
-// http://wiki.civicrm.org/confluence/display/CRMDOC42/Hook+Reference
-return array (
-  0 => 
-  array (
-    'name' => 'CRM_Dataprocessor_Form_Search_DataProcessor',
-    'entity' => 'CustomSearch',
-    'params' => 
-    array (
-      'version' => 3,
-      'label' => 'DataProcessor',
-      'description' => 'DataProcessor (dataprocessor)',
-      'class_name' => 'CRM_Dataprocessor_Form_Search_DataProcessor',
-    ),
-  ),
-);
diff --git a/CRM/Dataprocessor/Form/Search/DataProcessor.php b/CRM/Dataprocessor/Form/Search/DataProcessor.php
deleted file mode 100644
index cb7d09d1..00000000
--- a/CRM/Dataprocessor/Form/Search/DataProcessor.php
+++ /dev/null
@@ -1,221 +0,0 @@
-<?php
-use CRM_Dataprocessor_ExtensionUtil as E;
-
-/**
- * A custom contact search
- */
-class CRM_Dataprocessor_Form_Search_DataProcessor extends CRM_Contact_Form_Search_Custom_Base implements CRM_Contact_Form_Search_Interface {
-
-  public static function findCustomSearchId() {
-    try {
-      return civicrm_api3('OptionValue', 'getvalue', array(
-        'option_group_id' => 'custom_search',
-        'name' => 'CRM_Dataprocessor_Form_Search_DataProcessor',
-        'return' => 'value'
-      ));
-    } catch (CiviCRM_API3_Exception $ex) {
-      return FALSE;
-    }
-  }
-
-  function __construct(&$formValues) {
-    // Set the user context
-    $session = CRM_Core_Session::singleton();
-    $url = CRM_Utils_System::getUrlPath();
-    $query['csid'] = CRM_Utils_Request::retrieve('csid', 'Integer');
-    if (empty($query['csid']) && isset($formValues['csid'])) {
-      $query['csid'] = $formValues['csid'];
-    }
-    $query['reset'] = 1;
-    $userContext = CRM_Utils_System::url($url,$query);
-    $session->pushUserContext($userContext);
-    parent::__construct($formValues);
-  }
-
-  /**
-   * Prepare a set of search fields
-   *
-   * @param CRM_Core_Form $form modifiable
-   * @return void
-   */
-  function buildForm(&$form) {
-    CRM_Utils_System::setTitle(E::ts('Data Processor'));
-
-    $onlyActive = array(
-      '1' => ts('Only active Data Processors)'),
-      '0' => ts('All Data Processors'),
-    );
-    $form->addRadio('only_active', ts('Find only active Data Processors?'), $onlyActive, NULL, '<br />', TRUE);
-    $defaults['only_active'] = 1;
-    $form->setDefaults($defaults);
-
-    /**
-     * if you are using the standard template, this array tells the template what elements
-     * are part of the search criteria
-     */
-    $form->assign('elements', array('only_active'));
-  }
-
-  /**
-   * Get a list of summary data points
-   *
-   * @return mixed; NULL or array with keys:
-   *  - summary: string
-   *  - total: numeric
-   */
-  function summary() {
-    return NULL;
-    // return array(
-    //   'summary' => 'This is a summary',
-    //   'total' => 50.0,
-    // );
-  }
-
-  /**
-   * Get a list of displayable columns
-   *
-   * @return array, keys are printable column headers and values are SQL column names
-   */
-  function &columns() {
-    // return by reference
-    $columns = array(
-      'data_processor_id' => 'data_processor_id',
-      'is_active_value' => 'is_active_value',
-      'status_value' => 'status_value',
-      E::ts('Data Processor') => 'title',
-      E::ts('Description') => 'description',
-      E::ts('Is active') => 'is_active',
-      E::ts('Status') => 'status',
-    );
-    return $columns;
-  }
-
-  /**
-   * Construct a full SQL query which returns one page worth of results
-   *
-   * @param int $offset
-   * @param int $rowcount
-   * @param null $sort
-   * @param bool $includeContactIDs
-   * @param bool $justIDs
-   * @return string, sql
-   */
-  function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE) {
-    // delegate to $this->sql(), $this->select(), $this->from(), $this->where(), etc.
-    return $this->sql($this->select(), $offset, $rowcount, $sort, $includeContactIDs, NULL);
-  }
-
-  /**
-   * @inheritDoc
-   */
-  public function count() {
-    $sql = $this->sql("COUNT(*) as total", 0, 0, null, FALSE, NULL);
-
-    $dao = CRM_Core_DAO::executeQuery($sql,
-      CRM_Core_DAO::$_nullArray
-    );
-    return $dao->N;
-  }
-
-  /**
-   * @param int $offset
-   * @param int $rowcount
-   * @param null $sort
-   * @param bool $returnSQL Not used; included for consistency with parent; SQL is always returned
-   *
-   * @return string
-   */
-  public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = TRUE) {
-    return $this->all($offset, $rowcount, $sort, FALSE, TRUE);
-  }
-
-  /**
-   * Construct a SQL SELECT clause
-   *
-   * @return string, sql fragment with SELECT arguments
-   */
-  function select() {
-    return "
-      data_processor.id           as data_processor_id  ,
-      data_processor.title as title,
-      data_processor.description    as description,
-      data_processor.is_active    as is_active,
-      data_processor.is_active    as is_active_value,
-      data_processor.status as status,
-      data_processor.status as status_value
-      
-    ";
-  }
-
-  /**
-   * Construct a SQL FROM clause
-   *
-   * @return string, sql fragment with FROM and JOIN clauses
-   */
-  function from() {
-    return "
-      FROM      civicrm_data_processor data_processor
-    ";
-  }
-
-  /**
-   * Construct a SQL WHERE clause
-   *
-   * @param bool $includeContactIDs
-   * @return string, sql fragment with conditional expressions
-   */
-  function where($includeContactIDs = FALSE) {
-    $params = array();
-    $index = 1;
-    $clauses = array();
-
-    $onlyActive = CRM_Utils_Array::value('only_active', $this->_formValues);
-    if ($onlyActive == 1) {
-      $clauses[] = "data_processor.is_active = %{$index}";
-      $params[$index] = array(1, 'Integer');
-      $index++;
-    }
-
-    if (!empty($clauses)) {
-      $where = implode(' AND ', $clauses);
-      return $this->whereClause($where, $params);
-    }
-
-    return "";
-
-  }
-
-  /**
-   * Determine the Smarty template for the search screen
-   *
-   * @return string, template path (findable through Smarty template path)
-   */
-  function templateFile() {
-    return 'CRM/Dataprocessor/Form/Search/DataProcessor.tpl';
-  }
-
-  /**
-   * Modify the content of each row
-   *
-   * @param array $row modifiable SQL result row
-   * @return void
-   */
-  function alterRow(&$row) {
-    if ($row['is_active'] == 1) {
-      $row['is_active'] = E::ts("Yes");
-    } else {
-      $row['is_active'] = E::ts("No");
-    }
-    switch ($row['status']) {
-      case CRM_Dataprocessor_DAO_DataProcessor::STATUS_IN_CODE:
-        $row['status'] = E::ts('In code');
-        break;
-      case CRM_Dataprocessor_DAO_DataProcessor::STATUS_OVERRIDDEN:
-        $row['status'] = E::ts('Overridden');
-        break;
-      case CRM_Dataprocessor_DAO_DataProcessor::STATUS_IN_DATABASE:
-        $row['status'] = E::ts('In database');
-        break;
-    }
-  }
-}
diff --git a/dataprocessor.php b/dataprocessor.php
index be48abda..aecd09d6 100644
--- a/dataprocessor.php
+++ b/dataprocessor.php
@@ -255,8 +255,6 @@ function dataprocessor_civicrm_preProcess($formName, &$form) {
  * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_navigationMenu
  */
 function dataprocessor_civicrm_navigationMenu(&$menu) {
-  $customSearchID = CRM_Dataprocessor_Form_Search_DataProcessor::findCustomSearchId();
-
   _dataprocessor_civix_insert_navigation_menu($menu, 'Administer', array(
     'label' => E::ts('Data Processor'),
     'name' => 'data_processor',
@@ -266,9 +264,9 @@ function dataprocessor_civicrm_navigationMenu(&$menu) {
     'separator' => 0
   ));
   _dataprocessor_civix_insert_navigation_menu($menu, 'Administer/data_processor', array(
-    'label' => E::ts('Find Data Processors'),
-    'name' => 'find_data_processors',
-    'url' => CRM_Utils_System::url('civicrm/contact/search/custom', 'reset=1&csid=' . $customSearchID, true),
+    'label' => E::ts('Manage Data Processors'),
+    'name' => 'manage_data_processors',
+    'url' => CRM_Utils_System::url('civicrm/dataprocessor/manage', 'reset=1', true),
     'permission' => 'administer CiviCRM',
     'operator' => 'OR',
     'separator' => 0,
diff --git a/templates/CRM/Dataprocessor/Form/ManageDataProcessors.tpl b/templates/CRM/Dataprocessor/Form/ManageDataProcessors.tpl
new file mode 100644
index 00000000..69688cca
--- /dev/null
+++ b/templates/CRM/Dataprocessor/Form/ManageDataProcessors.tpl
@@ -0,0 +1,108 @@
+{crmScope extensionKey='dataprocessor'}
+
+<div class="crm-content-block">
+
+    <div class="crm-block crm-form-block crm-basic-criteria-form-block">
+        <div class="crm-accordion-wrapper crm-data-processor_search-accordion collapsed">
+            <div class="crm-accordion-header crm-master-accordion-header">{ts}Search data processors{/ts}</div><!-- /.crm-accordion-header -->
+            <div class="crm-accordion-body">
+                <table class="form-layout">
+                    <tbody>
+                        <tr>
+                            <td style="width: 25%;">
+                                <label>{$form.title.label}</label><br>
+                                {$form.title.html}
+                            </td>
+                            <td style="width: 25%;">
+                                <label>{$form.is_active.label}</label><br>
+                                {$form.is_active.html}
+                            </td>
+                            <td style="width: 25%;"></td>
+                            <td style="width: 25%;"></td>
+                        </tr>
+                        <tr>
+                            <td>
+                                <label>{$form.description.label}</label><br>
+                                {$form.description.html}
+                            </td>
+                            <td></td>
+                            <td></td>
+                            <td></td>
+                        </tr>
+                    </tbody>
+                </table>
+                <div class="crm-submit-buttons">
+                    {include file="CRM/common/formButtons.tpl"}
+                </div>
+            </div><!- /.crm-accordion-body -->
+        </div><!-- /.crm-accordion-wrapper -->
+    </div><!-- /.crm-form-block -->
+
+
+    <div class="action-link">
+        <a class="button" href="{crmURL p="civicrm/dataprocessor/form/edit" q="reset=1&action=add" }">
+            <i class="crm-i fa-plus-circle">&nbsp;</i>
+            {ts}Add dataprocessor{/ts}
+        </a>
+        <a class="button" href="{crmURL p="civicrm/dataprocessor/form/import" q="reset=1&action=add" }">
+            <i class="crm-i fa-upload">&nbsp;</i>
+            {ts}Import data processor{/ts}
+        </a>
+    </div>
+
+    <div class="clear"></div>
+
+    <div class="crm-results-block">
+        {include file="CRM/common/pager.tpl" location="top"}
+
+        <div class="crm-search-results">
+            <table class="selector row-highlight">
+                <thead class="sticky">
+                <tr>
+                    <th scope="col" >{ts}Data Processor{/ts}</th>
+                    <th scope="col" >{ts}Description{/ts}</th>
+                    <th scope="col" >{ts}Is active{/ts}</th>
+                    <th scope="col" >{ts}Status{/ts}</th>
+                    <th>&nbsp;</th>
+                </tr>
+                </thead>
+                {foreach from=$data_processors item=data_processor}
+                    <tr>
+                        <td>{$data_processor.title}</td>
+                        <td>{$data_processor.description}</td>
+                        {if $data_processor.is_active eq 1}
+                            <td><span><a href="{crmURL p='civicrm/dataprocessor/form/edit' q="reset=1&action=disable&id=`$data_processor.id`"}"
+                                         class="" title="{ts}Disable Data Processor{/ts}">{ts}Enabled{/ts}</a></span></td>
+                        {else}
+                            <td><span><a href="{crmURL p='civicrm/dataprocessor/form/edit' q="reset=1&action=enable&id=`$data_processor.id`"}"
+                                         class="" title="{ts}Enable Data Processor{/ts}">{ts}Disabled{/ts}</a></span></td>
+                        {/if}
+                        <td>
+                            {$data_processor.status_label}
+                            {if ($data_provessor.status eq 3)}
+                                <span>
+                                    <a href="{crmURL p='civicrm/dataprocessor/form/edit' q="reset=1&action=revert&id=`$data_processor.id`"}"  class="" title="{ts}Revert Data Processor{/ts}">
+                                        {ts}Revert{/ts}
+                                    </a>
+                                </span>
+                            {/if}
+                        </td>
+                        <td>
+                            <span>
+                            <a href="{crmURL p='civicrm/dataprocessor/form/edit' q="reset=1&action=update&id=`$data_processor.id`"}"
+                                     class="action-item crm-hover-button" title="{ts}Edit Data Processor{/ts}">{ts}Edit{/ts}</a>
+                            <a href="{crmURL p='civicrm/dataprocessor/form/edit' q="reset=1&action=export&id=`$data_processor.id`"}"
+                                     class="action-item crm-hover-button" title="{ts}Export Data Processor{/ts}">{ts}Export{/ts}</a>
+                            <a href="{crmURL p='civicrm/dataprocessor/form/edit' q="reset=1&action=delete&id=`$data_processor.id`"}"
+                                 class="action-item crm-hover-button" title="{ts}Delete Data Processor{/ts}">{ts}Delete{/ts}</a></span>
+
+                        </td>
+                    </tr>
+                {/foreach}
+            </table>
+        </div>
+
+        {include file="CRM/common/pager.tpl" location="bottom"}
+    </div>
+</div>
+{/crmScope}
\ No newline at end of file
diff --git a/templates/CRM/Dataprocessor/Form/Search/DataProcessor.tpl b/templates/CRM/Dataprocessor/Form/Search/DataProcessor.tpl
deleted file mode 100644
index 4d35e9f6..00000000
--- a/templates/CRM/Dataprocessor/Form/Search/DataProcessor.tpl
+++ /dev/null
@@ -1,93 +0,0 @@
-{crmScope extensionKey='dataprocessor'}
-
-{assign var="showBlock" value="'searchForm'"}
-{assign var="hideBlock" value="'searchForm_show','searchForm_hide'"}
-
-{include file="CRM/Dataprocessor/Form/Search/DataProcessorCriteria.tpl"}
-
-{if $rowsEmpty}
-    {include file="CRM/Contact/Form/Search/Custom/EmptyResults.tpl"}
-{/if}
-
-{if $summary}
-    {$summary.summary}: {$summary.total}
-{/if}
-
-{if $rows}
-    {* Search request has returned 1 or more matching rows. Display results and collapse the search criteria fieldset. *}
-    {assign var="showBlock" value="'searchForm_show'"}
-    {assign var="hideBlock" value="'searchForm'"}
-
-    <fieldset>
-
-        {* This section displays the rows along and includes the paging controls *}
-        <p>
-
-            {include file="CRM/common/pager.tpl" location="top"}
-
-            {include file="CRM/common/pagerAToZ.tpl"}
-
-            {strip}
-        <table class="selector" summary="{ts}Search results listings.{/ts}">
-            <thead class="sticky">
-            {foreach from=$columnHeaders item=header}
-                {if $header.name ne "data_processor_id" and $header.name ne 'is_active_value' and $header.name ne 'status_value'}
-                    <th scope="col">
-                        {if $header.sort}
-                            {assign var='key' value=$header.sort}
-                            {$sort->_response.$key.link}
-                        {else}
-                            {$header.name}
-                        {/if}
-                    </th>
-                {/if}
-            {/foreach}
-            <th></th>
-            <th></th>
-            <th></th>
-            <th></th>
-            <th></th>
-            </thead>
-
-            {counter start=0 skip=1 print=false}
-            {foreach from=$rows item=row}
-                <tr id='rowid{$row.contact_id}' class="{cycle values="odd-row,even-row"}">
-                    {foreach from=$columnHeaders item=header}
-                        {assign var=fName value=$header.sort}
-                        {if $fName ne 'data_processor_id' and $fName ne 'is_active_value' and $fName ne 'status_value'}
-                            <td>
-                                {$row.$fName}
-                            </td>
-                        {/if}
-                    {/foreach}
-                    <td><span><a href="{crmURL p='civicrm/dataprocessor/form/edit' q="reset=1&action=update&id=`$row.data_processor_id`"}"
-                                 class="" title="{ts}Edit Data Processor{/ts}">{ts}Edit{/ts}</a></span></td>
-                    <td><span><a href="{crmURL p='civicrm/dataprocessor/form/edit' q="reset=1&action=export&id=`$row.data_processor_id`"}"
-                                 class="" title="{ts}Export Data Processor{/ts}">{ts}Export{/ts}</a></span></td>
-                    {if $row.is_active_value eq 1}
-                        <td><span><a href="{crmURL p='civicrm/dataprocessor/form/edit' q="reset=1&action=disable&id=`$row.data_processor_id`"}"
-                                     class="" title="{ts}Disable Data Processor{/ts}">{ts}Disable{/ts}</a></span></td>
-                    {else}
-                        <td><span><a href="{crmURL p='civicrm/dataprocessor/form/edit' q="reset=1&action=enable&id=`$row.data_processor_id`"}"
-                                     class="" title="{ts}Enable Data Processor{/ts}">{ts}Enable{/ts}</a></span></td>
-                    {/if}
-                    {if $row.status_value eq 3}
-                        <td><span><a href="{crmURL p='civicrm/dataprocessor/form/edit' q="reset=1&action=revert&id=`$row.data_processor_id`"}"
-                                     class="" title="{ts}Revert Data Processor{/ts}">{ts}Revert{/ts}</a></span></td>
-                    {else}
-                        <td></td>
-                    {/if}
-                    <td><span><a href="{crmURL p='civicrm/dataprocessor/form/edit' q="reset=1&action=delete&id=`$row.data_processor_id`"}"
-                                 class="" title="{ts}Delete Data Processor{/ts}">{ts}Delete{/ts}</a></span></td>
-                </tr>
-            {/foreach}
-        </table>
-        {/strip}
-
-        {include file="CRM/common/pager.tpl" location="bottom"}
-
-        </p>
-    </fieldset>
-    {* END Actions/Results section *}
-{/if}
-{/crmScope}
\ No newline at end of file
diff --git a/templates/CRM/Dataprocessor/Form/Search/DataProcessorCriteria.tpl b/templates/CRM/Dataprocessor/Form/Search/DataProcessorCriteria.tpl
deleted file mode 100644
index ab15a2e2..00000000
--- a/templates/CRM/Dataprocessor/Form/Search/DataProcessorCriteria.tpl
+++ /dev/null
@@ -1,63 +0,0 @@
-{crmScope extensionKey='dataprocessor'}
-{*
- +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM.                                    |
- |                                                                    |
- | CiviCRM is free software; you can copy, modify, and distribute it  |
- | under the terms of the GNU Affero General Public License           |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
- |                                                                    |
- | CiviCRM is distributed in the hope that it will be useful, but     |
- | WITHOUT ANY WARRANTY; without even the implied warranty of         |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
- | See the GNU Affero General Public License for more details.        |
- |                                                                    |
- | You should have received a copy of the GNU Affero General Public   |
- | License and the CiviCRM Licensing Exception along                  |
- | with this program; if not, contact CiviCRM LLC                     |
- | at info[AT]civicrm[DOT]org. If you have questions about the        |
- | GNU Affero General Public License or the licensing of CiviCRM,     |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
- +--------------------------------------------------------------------+
-*}
-{* Search criteria form elements - Find Experts *}
-
-{* Set title for search criteria accordion *}
-{capture assign=editTitle}{ts}Edit Search Criteria for Data Processor(s){/ts}{/capture}
-
-{strip}
-    <div class="crm-block crm-form-block crm-basic-criteria-form-block">
-        <div class="crm-accordion-wrapper crm-case_search-accordion {if $rows}collapsed{/if}">
-            <div class="crm-accordion-header crm-master-accordion-header">{$editTitle}</div><!-- /.crm-accordion-header -->
-            <div class="crm-accordion-body">
-                <table class="form-layout">
-                    <tbody>
-                    {if $form.only_active}
-                        <tr>
-                            <td><label for="only_active_rules">{$form.only_active.label}</label></td>
-                            <td>{$form.only_active.html}</td>
-                        </tr>
-                    {/if}
-                    </tbody>
-                </table>
-                <div class="crm-submit-buttons">
-                    {include file="CRM/common/formButtons.tpl"}
-                </div>
-            </div><!- /.crm-accordion-body -->
-        </div><!-- /.crm-accordion-wrapper -->
-    </div><!-- /.crm-form-block -->
-
-    <br />
-    <div class="crm-block">
-        <div class="action-link">
-            <a class="button" href="{crmURL p="civicrm/dataprocessor/form/edit" q="reset=1&action=add" }">{ts}Add dataprocessor{/ts}</a>
-            <a class="button" href="{crmURL p="civicrm/dataprocessor/form/import" q="reset=1&action=add" }">{ts}Import data processor{/ts}</a>
-        </div>
-    </div>
-{/strip}
-{/crmScope}
-
diff --git a/xml/Menu/dataprocessor.xml b/xml/Menu/dataprocessor.xml
index a99d0c1a..309d1945 100644
--- a/xml/Menu/dataprocessor.xml
+++ b/xml/Menu/dataprocessor.xml
@@ -1,5 +1,12 @@
 <?xml version="1.0"?>
 <menu>
+  <item>
+    <path>civicrm/dataprocessor/manage</path>
+    <page_callback>CRM_Dataprocessor_Form_ManageDataProcessors</page_callback>
+    <title>DataProcessor</title>
+    <access_arguments>access CiviCRM</access_arguments>
+    <access_arguments>administer CiviCRM</access_arguments>
+  </item>
   <item>
     <path>civicrm/dataprocessor/form/edit</path>
     <page_callback>CRM_Dataprocessor_Form_DataProcessor</page_callback>
-- 
GitLab