From 62e1e7fe5f48061020c8d9fe712093d509953abf Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 22 May 2013 17:40:07 -0500 Subject: [PATCH] Remove ICIRR module CRM-9794 ---------------------------------------- * CRM-9794: http://issues.civicrm.org/jira/browse/CRM-9794 --- .../civicrm_ICIRR/ICIRR/Form/Profile.php | 89 ----- .../modules/civicrm_ICIRR/civicrm_ICIRR.info | 6 - .../civicrm_ICIRR/civicrm_ICIRR.module | 158 -------- .../CRM/Activity/Form/Activity.extra.tpl | 96 ----- .../templates/CRM/Activity/Form/Activity.tpl | 364 ------------------ .../templates/ICIRR/Form/Profile.tpl | 68 ---- 6 files changed, 781 deletions(-) delete mode 100644 tools/drupal/modules/civicrm_ICIRR/ICIRR/Form/Profile.php delete mode 100644 tools/drupal/modules/civicrm_ICIRR/civicrm_ICIRR.info delete mode 100644 tools/drupal/modules/civicrm_ICIRR/civicrm_ICIRR.module delete mode 100644 tools/drupal/modules/civicrm_ICIRR/templates/CRM/Activity/Form/Activity.extra.tpl delete mode 100644 tools/drupal/modules/civicrm_ICIRR/templates/CRM/Activity/Form/Activity.tpl delete mode 100644 tools/drupal/modules/civicrm_ICIRR/templates/ICIRR/Form/Profile.tpl diff --git a/tools/drupal/modules/civicrm_ICIRR/ICIRR/Form/Profile.php b/tools/drupal/modules/civicrm_ICIRR/ICIRR/Form/Profile.php deleted file mode 100644 index 491a043232..0000000000 --- a/tools/drupal/modules/civicrm_ICIRR/ICIRR/Form/Profile.php +++ /dev/null @@ -1,89 +0,0 @@ -_profileFields = CRM_Core_BAO_UFGroup::getFields($profileId, FALSE, CRM_Core_Action::VIEW); - - $form->addElement('hidden', 'profile_id', $profileId); - - // build profile - foreach ($form->_profileFields as $name => $field) { - $profileTitle = $field['groupTitle']; - CRM_Core_BAO_UFGroup::buildProfile($form, $field, NULL); - } - - $form->assign('profileTitle', $profileTitle); - $form->assign('profileFields', $form->_profileFields); - - // set defaults in profile - self::setProfileDefaults($form->_profileFields, $form); - } - - function setProfileDefaults(&$fields, &$form) { - $defaults = array(); - $activityId = CRM_Utils_Request::retrieve('activity_id', 'Positive', $form); - if ($activityId) { - // get the target contact id - $contactId = CRM_Core_DAO::getFieldValue('CRM_Activity_DAO_ActivityTarget', $activityId, 'target_contact_id', 'activity_id'); - if ($contactId) { - CRM_Core_BAO_UFGroup::setProfileDefaults($contactId, $fields, $profileDefaults, FALSE); - foreach ($profileDefaults as $key => $value) { - $index = substr(str_replace("field[$contactId][", '', $key), 0, -1); - $defaults[$index] = $value; - } - $form->setDefaults($defaults); - } - } - } -} - diff --git a/tools/drupal/modules/civicrm_ICIRR/civicrm_ICIRR.info b/tools/drupal/modules/civicrm_ICIRR/civicrm_ICIRR.info deleted file mode 100644 index 564c814e7c..0000000000 --- a/tools/drupal/modules/civicrm_ICIRR/civicrm_ICIRR.info +++ /dev/null @@ -1,6 +0,0 @@ -name = CiviCRM ICIRR -description = "This module contains implementation of civicrm hooks specific to ICIRR needs." -dependencies[] = civicrm -package = CiviCRM -core = 6.x -version = 3.4 diff --git a/tools/drupal/modules/civicrm_ICIRR/civicrm_ICIRR.module b/tools/drupal/modules/civicrm_ICIRR/civicrm_ICIRR.module deleted file mode 100644 index 9f341a358f..0000000000 --- a/tools/drupal/modules/civicrm_ICIRR/civicrm_ICIRR.module +++ /dev/null @@ -1,158 +0,0 @@ -getVar('_gid'); - $contactId = $form->getVar('_id'); - // if gid = 31 then redirect to new activity - if (($formName == 'CRM_Profile_Form_Edit') && $profileId == 31) { - // build activity url, activity type id = 51 for NAI Open - // redirect to activity url - $url = CRM_Utils_System::url('civicrm/activity/add', 'action=add&reset=1&selectedChild=activity&atype=51&cid=' . $contactId); - CRM_Utils_System::redirect($url); - } - elseif ($formName == 'CRM_Activity_Form_Activity') { - $params = $form->exportValues(); - $profileId = CRM_Utils_Array::value('profile_id', $params); - - if (!$profileId) { - return; - } - - //build contact params - $contactParams = array(); - foreach ($params as $key => $value) { - if (array_key_exists($key, $form->_profileFields)) { - $contactParams[$key] = $value; - } - } - - $contactParams['preserveDBName'] = TRUE; - - $contactId = $params['target_contact_id']; - if ($contactId && !empty($contactParams)) { - //crm_core_error::debug( 'c', $contactParams ); - require_once 'CRM/Contact/BAO/Contact.php'; - CRM_Contact_BAO_Contact::createProfileContact($contactParams, $form->_profileFields, $contactId); - } - } -} - -/** - * Implementation of civicrn postProcess hook - * - * @return void - * @access public - */ -function civicrm_ICIRR_civicrm_buildForm($formName, &$form) { - if ($formName == 'CRM_Activity_Form_Activity') { - if ($form->_action & (CRM_Core_Action::DELETE | CRM_Core_Action::RENEW)) { - return; - } - - $includeProfile = CRM_Utils_Array::value('includeProfile', $_GET); - $form->assign('includeProfile', FALSE); - - if ($includeProfile) { - $form->assign('includeProfile', TRUE); - $form->assign('suppressForm', TRUE); - require_once 'ICIRR/Form/Profile.php'; - ICIRR_Form_Profile::buildProfile($form); - } - else { - require_once 'ICIRR/Form/Profile.php'; - ICIRR_Form_Profile::buildProfile($form); - } - } -} - -/** - * Implementation of civicrn validate hook - * - * @return void - * @access public - */ -function civicrm_ICIRR_civicrm_validate($formName, &$fields, &$files, &$form) { - if ($formName == 'CRM_Activity_Form_Activity') { - if ($form->_action & (CRM_Core_Action::DELETE | CRM_Core_Action::RENEW)) { - return TRUE; - } - - if (in_array($form->_activityTypeId, array(51, 47, 48, 49, 50))) { - // make sure only one target contact is selected - $targetContacts = explode(',', $fields['target_contact_id']); - $errors = array(); - if (empty($targetContacts[0])) { - $errors['target_contact_id'] = ts('You need to select at least one With Contact.'); - } - elseif (count($targetContacts) > 1) { - $errors['target_contact_id'] = ts('You cannot selected more than one With Contact.'); - } - return empty($errors) ? TRUE : $errors; - } - } -} - -/** - * Implementation of config hook to set custom template - * - * @return void - * @access public - */ -function civicrm_ICIRR_civicrm_config(&$config) { - $template = &CRM_Core_Smarty::singleton(); - - $currentRoot = dirname(__FILE__); - - $currentDir = $currentRoot . DIRECTORY_SEPARATOR . 'templates'; - - if (is_array($template->template_dir)) { - array_unshift($template->template_dir, $currentDir); - } - else { - $template->template_dir = array($currentDir, $template->template_dir); - } - - // also fix php include path - $include_path = $currentRoot . PATH_SEPARATOR . get_include_path(); - set_include_path($include_path); -} - diff --git a/tools/drupal/modules/civicrm_ICIRR/templates/CRM/Activity/Form/Activity.extra.tpl b/tools/drupal/modules/civicrm_ICIRR/templates/CRM/Activity/Form/Activity.extra.tpl deleted file mode 100644 index 36d88f1b21..0000000000 --- a/tools/drupal/modules/civicrm_ICIRR/templates/CRM/Activity/Form/Activity.extra.tpl +++ /dev/null @@ -1,96 +0,0 @@ -{if $smarty.get.snippet neq 4} -{literal} - -{/literal} -{/if} diff --git a/tools/drupal/modules/civicrm_ICIRR/templates/CRM/Activity/Form/Activity.tpl b/tools/drupal/modules/civicrm_ICIRR/templates/CRM/Activity/Form/Activity.tpl deleted file mode 100644 index 2887c152e1..0000000000 --- a/tools/drupal/modules/civicrm_ICIRR/templates/CRM/Activity/Form/Activity.tpl +++ /dev/null @@ -1,364 +0,0 @@ -{* - +--------------------------------------------------------------------+ - | CiviCRM version 4.1 | - +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2011 | - +--------------------------------------------------------------------+ - | 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 | - +--------------------------------------------------------------------+ -*} -{* this template is used for adding/editing other (custom) activities. *} -{if $includeProfile} - {include file='ICIRR/Form/Profile.tpl'} -{elseif $cdType } - {include file="CRM/Custom/Form/CustomData.tpl"} -{else} - {if $action eq 4} -
- {else} - {if $context NEQ 'standalone'} -

{if $action eq 1 or $action eq 1024}{ts 1=$activityTypeName}New %1{/ts}{elseif $action eq 8}{ts 1=$activityTypeName}Delete %1{/ts}{else}{ts 1=$activityTypeName}Edit %1{/ts}{/if}

- {/if} -
- {/if} - {* added onload javascript for source contact*} - {literal} - - {/literal} - {if !$action or ( $action eq 1 ) or ( $action eq 2 ) } -
{include file="CRM/common/formButtons.tpl" location="top"}
- {/if} - - {if $action eq 8} {* Delete action. *} - - - - - - {elseif $action eq 1 or $action eq 2 or $action eq 4 or $context eq 'search' or $context eq 'smog'} - { if $activityTypeDescription } -
{$activityTypeDescription}
- {/if} - -
-
{ts 1=$delName}Are you sure you want to delete '%1'?{/ts}
-
- - {if $action eq 4} -

{$activityTypeName}

- {else} - {if $context eq 'standalone' or $context eq 'search' or $context eq 'smog'} - - - - {/if} - {/if} - - {if $surveyActivity} - - - - {/if} - - - - - - - - {if $single eq false} - - - {elseif $action neq 4} - - - {else} - - - {/if} - - - - {if $action eq 4} - - {else} - - - {/if} - - - {if $activityTypeFile} - {include file="CRM/$crmDir/Form/Activity/$activityTypeFile.tpl"} - {/if} - - - - - - {* CRM-7362 --add campaign to activities *} - {include file="CRM/Campaign/Form/addCampaignToComponent.tpl" - campaignTrClass="crm-activity-form-block-campaign_id"} - - {* build engagement level CRM-7775 *} - {if $buildEngagementLevel} - - - - - {/if} - - - - - - - {if $action neq 4} - - {else} - - {/if} - - - - - - - - - - - {if $activityTypeName eq "Print PDF Letter"} - - {else} - - {/if} - - - - - {if $surveyActivity } - - - - {/if} - {if $form.tag.html} - - - - - {/if} - - {if $tagsetInfo_activity} - - {/if} - - {* start of code for profile injection*} - - - - {* end of code for profile injection*} - - {if $action neq 4 OR $viewCustomData} - - - - {/if} - - {if $action eq 4 AND $currentAttachmentURL} - {include file="CRM/Form/attachment.tpl"}{* For view action the include provides the row and cells. *} - {elseif $action eq 1 OR $action eq 2} - - - - {/if} - - {if $action neq 4} {* Don't include "Schedule Follow-up" section in View mode. *} - - - - {/if} - {/if} {* End Delete vs. Add / Edit action *} -
{$form.activity_type_id.label}{$form.activity_type_id.html}
{ts}Survey Title{/ts}{$surveyTitle}
{$form.source_contact_id.label} - {if $admin and $action neq 4}{$form.source_contact_id.html} {else} {$source_contact_value} {/if} -
{ts}With Contact(s){/ts}{$with|escape}{ts}With Contact{/ts}{$form.target_contact_id.html}{ts}With Contact{/ts} - {foreach from=$target_contact key=id item=name} - {$name};  - {/foreach} -
{ts}Assigned To{/ts} - {foreach from=$assignee_contact key=id item=name} - {$name};  - {/foreach} - {ts}Assigned To{/ts}{$form.assignee_contact_id.html} - {edit}{ts}You can optionally assign this activity to someone. Assigned activities will appear in their Activities listing at CiviCRM Home.{/ts} - {if $config->activityAssigneeNotification} -
{ts}A copy of this activity will be emailed to each Assignee.{/ts} - {/if} -
- {/edit} -
{$form.subject.label}{$form.subject.html|crmReplace:class:huge}
{$form.engagement_level.label}{$form.engagement_level.html}
{$form.location.label}{$form.location.html|crmReplace:class:huge}
{$form.activity_date_time.label}{include file="CRM/common/jcalendar.tpl" elementName=activity_date_time}{$form.activity_date_time.html|crmDate}
{$form.duration.label} - {$form.duration.html} - {if $action neq 4}{ts}Total time spent on this activity (in minutes).{/ts}{/if} -
{$form.status_id.label}{$form.status_id.html}
{$form.details.label} - {* If using plain textarea, assign class=huge to make input large enough. *} - {if $defaultWysiwygEditor eq 0}{$form.details.html|crmReplace:class:huge}{else}{$form.details.html}{/if} - - {* If using plain textarea, assign class=huge to make input large enough. *} - {if $defaultWysiwygEditor eq 0}{$form.details.html|crmStripAlternatives|crmReplace:class:huge}{else}{$form.details.html|crmStripAlternatives}{/if} -
{$form.priority_id.label}{$form.priority_id.html}
{$form.result.label}{$form.result.html}
{$form.tag.label}
{$form.tag.html}
- {literal} - - {/literal} -
{include file="CRM/common/Tag.tpl" tagsetType='activity'}
- {if $action eq 4} - {include file="CRM/Custom/Page/CustomDataView.tpl"} - {else} -
- {/if} -
- {include file="CRM/Form/attachment.tpl"} -
-
-
-
- {ts}Schedule Follow-up{/ts} -
-
- - - - - - - - -
{ts}Schedule Follow-up Activity{/ts}{$form.followup_activity_type_id.html} {$form.interval.label} {$form.interval.html} {$form.interval_unit.html}
{$form.followup_activity_subject.label}{$form.followup_activity_subject.html|crmReplace:class:huge}
-
-
- {literal} - - {/literal} - -
-
- {if $action eq 4 && $activityTName neq 'Inbound Email'} - {if !$context } - {assign var="context" value='activity'} - {/if} - {if $permission EQ 'edit'} - {assign var='urlParams' value="reset=1&atype=$atype&action=update&reset=1&id=$entityID&cid=$contactId&context=$context"} - {if ($context eq 'fulltext' || $context eq 'search') && $searchKey} - {assign var='urlParams' value="reset=1&atype=$atype&action=update&reset=1&id=$entityID&cid=$contactId&context=$context&key=$searchKey"} - {/if} -
{ts}Edit{/ts}
- {/if} - - {if call_user_func(array('CRM_Core_Permission','check'), 'delete activities')} - {assign var='urlParams' value="reset=1&atype=$atype&action=delete&reset=1&id=$entityID&cid=$contactId&context=$context"} - {if ($context eq 'fulltext' || $context eq 'search') && $searchKey} - {assign var='urlParams' value="reset=1&atype=$atype&action=delete&reset=1&id=$entityID&cid=$contactId&context=$context&key=$searchKey"} - {/if} -
{ts}Delete{/ts}
- {/if} - {/if} - {include file="CRM/common/formButtons.tpl" location="bottom"} -
- - {include file="CRM/Case/Form/ActivityToCase.tpl"} - - {if $action eq 1 or $action eq 2 or $context eq 'search' or $context eq 'smog'} - {*include custom data js file*} - {include file="CRM/common/customData.tpl"} - {literal} - - {/literal} - {/if} - {if ! $form.case_select} - {include file="CRM/common/formNavigate.tpl"} - {/if} -
{* end of form block*} -{/if} {* end of snippet if*} diff --git a/tools/drupal/modules/civicrm_ICIRR/templates/ICIRR/Form/Profile.tpl b/tools/drupal/modules/civicrm_ICIRR/templates/ICIRR/Form/Profile.tpl deleted file mode 100644 index 95a24a18c5..0000000000 --- a/tools/drupal/modules/civicrm_ICIRR/templates/ICIRR/Form/Profile.tpl +++ /dev/null @@ -1,68 +0,0 @@ -{* - +--------------------------------------------------------------------+ - | CiviCRM version 4.1 | - +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2011 | - +--------------------------------------------------------------------+ - | 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 | - +--------------------------------------------------------------------+ -*} - -{if $profileFields} -
-
-
- {ts}{$profileTitle}{/ts} -
-
- {* here build the profile fields *} - - {foreach from=$profileFields item=field key=fieldName} - - - - - {/foreach} -
{$form.$fieldName.label} - {if ( $field.data_type eq 'Date') or - ( $fieldName eq 'birth_date' ) or ( $fieldName eq 'deceased_date' ) } - {if $action eq 1 or $action eq 2} - {include file="CRM/common/jcalendar.tpl" elementName=$fieldName} - {else} - {$form.$fieldName.html} - {/if} - {else} - {$form.$fieldName.html} - {/if} - {if $field.html_type eq 'Autocomplete-Select'} - {include file="CRM/Custom/Form/AutoComplete.tpl" element_name = field[`$fieldName`]} - {/if} -
-
-
- - {literal} - - {/literal} -{/if} - -- 2.25.1