From: eileen Date: Mon, 14 Sep 2020 04:44:43 +0000 (+1200) Subject: dev/core#2017 remove unused SearchTaskHookSample.php X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9a0fec655f8a81dde9344a35d75395617f437e35;p=civicrm-core.git dev/core#2017 remove unused SearchTaskHookSample.php This appears to be unused demo code. Interested to see if any intrepid sleuths can fix any alternate explanation --- diff --git a/CRM/Activity/Form/Task/SearchTaskHookSample.php b/CRM/Activity/Form/Task/SearchTaskHookSample.php deleted file mode 100644 index 003dd58c7e..0000000000 --- a/CRM/Activity/Form/Task/SearchTaskHookSample.php +++ /dev/null @@ -1,73 +0,0 @@ -_activityHolderIds); - - $activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); - $sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); - $query = " - SELECT at.subject as subject, - ov.label as activity_type, - at.activity_date_time as activity_date, - ct.display_name as display_name - FROM civicrm_activity at -LEFT JOIN civicrm_activity_contact ac ON ( ac.activity_id = at.id AND ac.record_type_id = {$sourceID} ) -INNER JOIN civicrm_contact ct ON ( ac.contact_id = ct.id ) - LEFT JOIN civicrm_option_group og ON ( og.name = 'activity_type' ) - LEFT JOIN civicrm_option_value ov ON (at.activity_type_id = ov.value AND og.id = ov.option_group_id ) - WHERE at.id IN ( $activityIDs )"; - - $dao = CRM_Core_DAO::executeQuery($query); - - while ($dao->fetch()) { - $rows[] = [ - 'subject' => $dao->subject, - 'activity_type' => $dao->activity_type, - 'activity_date' => $dao->activity_date, - 'display_name' => $dao->display_name, - ]; - } - $this->assign('rows', $rows); - } - - /** - * Build the form object. - */ - public function buildQuickForm() { - $this->addButtons([ - [ - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ], - ]); - } - -} diff --git a/CRM/Case/Form/Task/SearchTaskHookSample.php b/CRM/Case/Form/Task/SearchTaskHookSample.php deleted file mode 100644 index df83772a1f..0000000000 --- a/CRM/Case/Form/Task/SearchTaskHookSample.php +++ /dev/null @@ -1,68 +0,0 @@ -_entityIds); - $statusId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'case_status', 'id', 'name'); - $query = " -SELECT ct.display_name as display_name, - cs.start_date as start_date, - ov.label as status - -FROM civicrm_case cs -INNER JOIN civicrm_case_contact cc ON ( cs.id = cc.case_id) -INNER JOIN civicrm_contact ct ON ( cc.contact_id = ct.id) -LEFT JOIN civicrm_option_value ov ON (cs.status_id = ov.value AND ov.option_group_id = {$statusId} ) -WHERE cs.id IN ( {$caseIDs} )"; - - $dao = CRM_Core_DAO::executeQuery($query); - while ($dao->fetch()) { - $rows[] = [ - 'display_name' => $dao->display_name, - 'start_date' => CRM_Utils_Date::customFormat($dao->start_date), - 'status' => $dao->status, - ]; - } - $this->assign('rows', $rows); - } - - /** - * Build the form object. - */ - public function buildQuickForm() { - $this->addButtons([ - [ - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ], - ]); - } - -} diff --git a/CRM/Contribute/Form/Task/SearchTaskHookSample.php b/CRM/Contribute/Form/Task/SearchTaskHookSample.php deleted file mode 100644 index 0e081647bb..0000000000 --- a/CRM/Contribute/Form/Task/SearchTaskHookSample.php +++ /dev/null @@ -1,68 +0,0 @@ -_contributionIds); - - $query = " - SELECT co.total_amount as amount, - co.receive_date as receive_date, - co.source as source, - ct.display_name as display_name - FROM civicrm_contribution co -INNER JOIN civicrm_contact ct ON ( co.contact_id = ct.id ) - WHERE co.id IN ( $contribIDs )"; - - $dao = CRM_Core_DAO::executeQuery($query); - - while ($dao->fetch()) { - $rows[] = [ - 'display_name' => $dao->display_name, - 'amount' => $dao->amount, - 'source' => $dao->source, - 'receive_date' => $dao->receive_date, - ]; - } - $this->assign('rows', $rows); - } - - /** - * Build the form object. - */ - public function buildQuickForm() { - $this->addButtons([ - [ - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ], - ]); - } - -} diff --git a/CRM/Event/Form/Task/SearchTaskHookSample.php b/CRM/Event/Form/Task/SearchTaskHookSample.php deleted file mode 100644 index efc940e574..0000000000 --- a/CRM/Event/Form/Task/SearchTaskHookSample.php +++ /dev/null @@ -1,71 +0,0 @@ -_participantIds); - - $query = " - SELECT p.fee_amount as amount, - p.register_date as register_date, - p.source as source, - ct.display_name as display_name - FROM civicrm_participant p - INNER JOIN civicrm_contact ct ON ( p.contact_id = ct.id ) - WHERE p.id IN ( $participantIDs )"; - - $dao = CRM_Core_DAO::executeQuery($query); - while ($dao->fetch()) { - $rows[] = [ - 'display_name' => $dao->display_name, - 'amount' => $dao->amount, - 'register_date' => CRM_Utils_Date::customFormat($dao->register_date), - 'source' => $dao->source, - ]; - } - $this->assign('rows', $rows); - } - - /** - * Build the form object. - * - * @return void - */ - public function buildQuickForm() { - $this->addButtons([ - [ - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ], - ]); - } - -} diff --git a/CRM/Grant/Form/Task/SearchTaskHookSample.php b/CRM/Grant/Form/Task/SearchTaskHookSample.php deleted file mode 100644 index 01ce981f45..0000000000 --- a/CRM/Grant/Form/Task/SearchTaskHookSample.php +++ /dev/null @@ -1,72 +0,0 @@ -_grantIds); - - $query = " - SELECT grt.decision_date as decision_date, - grt.amount_total as amount_total, - grt.amount_granted as amount_granted, - ct.display_name as display_name - FROM civicrm_grant grt -INNER JOIN civicrm_contact ct ON ( grt.contact_id = ct.id ) - WHERE grt.id IN ( $grantIDs )"; - - $dao = CRM_Core_DAO::executeQuery($query); - - while ($dao->fetch()) { - $rows[] = [ - 'display_name' => $dao->display_name, - 'decision_date' => $dao->decision_date, - 'amount_requested' => $dao->amount_total, - 'amount_granted' => $dao->amount_granted, - ]; - } - $this->assign('rows', $rows); - } - - /** - * Build the form object. - * - * @return void - */ - public function buildQuickForm() { - $this->addButtons([ - [ - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ], - ]); - } - -} diff --git a/CRM/Member/Form/Task/SearchTaskHookSample.php b/CRM/Member/Form/Task/SearchTaskHookSample.php deleted file mode 100644 index d73ffc549f..0000000000 --- a/CRM/Member/Form/Task/SearchTaskHookSample.php +++ /dev/null @@ -1,71 +0,0 @@ -_memberIds); - - $query = " - SELECT mem.start_date as start_date, - mem.end_date as end_date, - mem.source as source, - ct.display_name as display_name -FROM civicrm_membership mem -INNER JOIN civicrm_contact ct ON ( mem.contact_id = ct.id ) -WHERE mem.id IN ( $memberIDs )"; - - $dao = CRM_Core_DAO::executeQuery($query); - while ($dao->fetch()) { - $rows[] = [ - 'display_name' => $dao->display_name, - 'start_date' => CRM_Utils_Date::customFormat($dao->start_date), - 'end_date' => CRM_Utils_Date::customFormat($dao->end_date), - 'source' => $dao->source, - ]; - } - $this->assign('rows', $rows); - } - - /** - * Build the form object. - * - * @return void - */ - public function buildQuickForm() { - $this->addButtons([ - [ - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ], - ]); - } - -} diff --git a/CRM/Pledge/Form/Task/SearchTaskHookSample.php b/CRM/Pledge/Form/Task/SearchTaskHookSample.php deleted file mode 100644 index 5af8bf1e5b..0000000000 --- a/CRM/Pledge/Form/Task/SearchTaskHookSample.php +++ /dev/null @@ -1,65 +0,0 @@ -_pledgeIds); - - $query = " - SELECT plg.amount as amount, - plg.create_date as create_date, - ct.display_name as display_name - FROM civicrm_pledge plg -INNER JOIN civicrm_contact ct ON ( plg.contact_id = ct.id ) - WHERE plg.id IN ( $pledgeIDs )"; - - $dao = CRM_Core_DAO::executeQuery($query); - while ($dao->fetch()) { - $rows[] = [ - 'display_name' => $dao->display_name, - 'amount' => $dao->amount, - 'create_date' => CRM_Utils_Date::customFormat($dao->create_date), - ]; - } - $this->assign('rows', $rows); - } - - /** - * Build the form object. - */ - public function buildQuickForm() { - $this->addButtons([ - [ - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ], - ]); - } - -} diff --git a/templates/CRM/Case/Form/Task/SearchTaskHookSample.tpl b/templates/CRM/Case/Form/Task/SearchTaskHookSample.tpl deleted file mode 100644 index cff2cc5fb0..0000000000 --- a/templates/CRM/Case/Form/Task/SearchTaskHookSample.tpl +++ /dev/null @@ -1,36 +0,0 @@ -{if $rows} -
- {include file="CRM/common/formButtons.tpl" location="top"} -
- -
- -
-
- - - - - - - - {foreach from=$rows item=row} - - - - - - {/foreach} -
{ts}Display Name{/ts}{ts}Start Date{/ts}{ts}Status{/ts}
{$row.display_name}{$row.start_date}{$row.status}
-
- -
- {include file="CRM/common/formButtons.tpl" location="bottom"} -
- -{else} -
- {icon icon="fa-info-circle"}{/icon} - {ts}There are no records selected.{/ts} -
-{/if} diff --git a/templates/CRM/Contribute/Form/Task/SearchTaskHookSample.tpl b/templates/CRM/Contribute/Form/Task/SearchTaskHookSample.tpl deleted file mode 100644 index a14a183b17..0000000000 --- a/templates/CRM/Contribute/Form/Task/SearchTaskHookSample.tpl +++ /dev/null @@ -1,38 +0,0 @@ -{if $rows} -
- {$form.buttons.html} -
- -
- -
-
- - - - - - - - - {foreach from=$rows item=row} - - - - - - - {/foreach} -
{ts}Display Name{/ts}{ts}Amount{/ts}{ts}Source{/ts}{ts}Receive Date{/ts}
{$row.display_name}{$row.amount}{$row.source}{$row.receive_date}
-
- -
- {$form.buttons.html} -
- -{else} -
- {icon icon="fa-info-circle"}{/icon} - {ts}There are no records selected.{/ts} -
-{/if} diff --git a/templates/CRM/Event/Form/Task/SearchTaskHookSample.tpl b/templates/CRM/Event/Form/Task/SearchTaskHookSample.tpl deleted file mode 100644 index 9cfdab0008..0000000000 --- a/templates/CRM/Event/Form/Task/SearchTaskHookSample.tpl +++ /dev/null @@ -1,36 +0,0 @@ -{if $rows} -
- {include file="CRM/common/formButtons.tpl" location="top"} -
- -
-
-
- - - - - - - - - {foreach from=$rows item=row} - - - - - - - {/foreach} -
{ts}Display Name{/ts}{ts}Amount{/ts}{ts}Register Date{/ts}{ts}Source{/ts}
{$row.display_name}{$row.amount}{$row.register_date}{$row.source}
-
- -
- {include file="CRM/common/formButtons.tpl" location="bottom"} -
- -{else} -
- {icon icon="fa-info-circle"}{/icon}{ts}There are no records selected.{/ts} -
-{/if} diff --git a/templates/CRM/Grant/Form/Task/SearchTaskHookSample.tpl b/templates/CRM/Grant/Form/Task/SearchTaskHookSample.tpl deleted file mode 100644 index 144ad174ca..0000000000 --- a/templates/CRM/Grant/Form/Task/SearchTaskHookSample.tpl +++ /dev/null @@ -1,34 +0,0 @@ -{if $rows} -
{include file="CRM/common/formButtons.tpl" location="top"}
- -
- -
-
- - - - - - - - - {foreach from=$rows item=row} - - - - - - - {/foreach} -
{ts}Display Name{/ts}{ts}Decision Date{/ts}{ts}Amount Requested{/ts}{ts}Amount Granted{/ts}
{$row.display_name}{$row.decision_date}{$row.amount_requested}{$row.amount_granted}
-
- -
{include file="CRM/common/formButtons.tpl" location="bottom"}
- -{else} -
- {icon icon="fa-info-circle"}{/icon} - {ts}There are no records selected.{/ts} -
-{/if}