-
Notifications
You must be signed in to change notification settings - Fork 4
/
contactinactive.php
65 lines (58 loc) · 2.11 KB
/
contactinactive.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/*-------------------------------------------------------+
| SYSTOPIA - Contact Inactive |
| Copyright (C) 2017 SYSTOPIA |
| Author: M. Wire ([email protected]) |
| http://www.systopia.de/ |
+--------------------------------------------------------+
| This program is released as free software under the |
| Affero GPL license. You can redistribute it and/or |
| modify it under the terms of this license which you |
| can read by viewing the included agpl.txt or online |
| at www.gnu.org/licenses/agpl.html. Removal of this |
| copyright header is strictly prohibited without |
| written permission from the original author(s). |
+--------------------------------------------------------*/
require_once 'contactinactive.civix.php';
/**
* Implements hook_civicrm_config().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_config
*/
function contactinactive_civicrm_config(&$config) {
_contactinactive_civix_civicrm_config($config);
}
/**
* Implements hook_civicrm_install().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_install
*/
function contactinactive_civicrm_install() {
_contactinactive_civix_civicrm_install();
}
/**
* Implements hook_civicrm_enable().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_enable
*/
function contactinactive_civicrm_enable() {
_contactinactive_civix_civicrm_enable();
}
function contactinactive_civicrm_summaryActions(&$actions, $contactId) {
$actions['contactinactive'] = [
'title' => 'Set to Inactive',
'weight' => max(array_column($actions, 'weight')) + 999,
'ref' => 'contact-inactive',
'key' => 'contact-inactive',
'href' => CRM_Utils_System::url('civicrm/contact/setinactive', "cid=$contactId"),
'tab' => 'summary',
];
}
function contactinactive_civicrm_searchTasks( $objectName, &$tasks ){
if($objectName == 'contact'){
$tasks[] = [
'title' => 'Set to Inactive',
'class' => 'CRM_Contactinactive_Form_Set'
];
}
}