//get the campaign groups.
$groups = CRM_Core_PseudoConstant::group();
- $inG = &$this->addElement('advmultiselect', 'includeGroups',
- ts('Include Group(s)') . ' ',
+ $this->add('select', 'includeGroups',
+ ts('Include Group(s)'),
$groups,
+ FALSE,
array(
- 'size' => 5,
- 'style' => 'width:240px',
- 'class' => 'advmultiselect',
+ 'multiple' => TRUE,
+ 'class' => 'crm-select2 huge',
+ 'placeholder' => ts('- none -'),
)
);
- $inG->setButtonAttributes('add', array('value' => ts('Add >>')));
- $inG->setButtonAttributes('remove', array('value' => ts('<< Remove')));
$this->addWysiwyg('goal_general', ts('Campaign Goals'), array('rows' => 2, 'cols' => 40));
$this->add('text', 'goal_revenue', ts('Revenue Goal'), array('size' => 8, 'maxlength' => 12));
*
* @return array of case and related data keyed on case id
*/
- static function getUnclosedCases($params = array(), $excludeCaseIds = array(), $excludeDeleted = TRUE) {
+ static function getUnclosedCases($params = array(), $excludeCaseIds = array(), $excludeDeleted = TRUE, $includeClosed = FALSE) {
//params from ajax call.
- $where = array('( ca.end_date is null )');
+ $where = array($includeClosed ? '(1)' : '(ca.end_date is null)');
if ($caseType = CRM_Utils_Array::value('case_type', $params)) {
$where[] = "( civicrm_case_type.title LIKE '%$caseType%' )";
}
$search = ($config->includeWildCardInName) ? "%$sortName%" : "$sortName%";
$where[] = "( sort_name LIKE '$search' )";
}
+ if ($cid = CRM_Utils_Array::value('contact_id', $params)) {
+ $where[] = " c.id = $cid ";
+ }
if (is_array($excludeCaseIds) &&
!CRM_Utils_System::isNull($excludeCaseIds)
) {
ca.id,
ca.subject as case_subject,
civicrm_case_type.title as case_type,
- ca.start_date as start_date
+ ca.start_date as start_date,
+ ca.end_date as end_date,
+ ca.status_id
FROM civicrm_case ca INNER JOIN civicrm_case_contact cc ON ca.id=cc.case_id
INNER JOIN civicrm_contact c ON cc.contact_id=c.id
INNER JOIN civicrm_case_type ON ca.case_type_id = civicrm_case_type.id
WHERE {$whereClause}
- ORDER BY c.sort_name
+ ORDER BY c.sort_name, ca.end_date
{$limitClause}
";
$dao = CRM_Core_DAO::executeQuery($query);
+ $statuses = CRM_Case_PseudoConstant::caseStatus();
$unclosedCases = array();
while ($dao->fetch()) {
if ($doFilterCases && !array_key_exists($dao->id, $filterCases)) {
'case_type' => $dao->case_type,
'contact_id' => $dao->contact_id,
'start_date' => $dao->start_date,
+ 'end_date' => $dao->end_date,
'case_subject' => $dao->case_subject,
+ 'case_status' => $statuses[$dao->status_id],
);
}
$dao->free();
$defaults['file_on_case_activity_subject'] = $defaults['subject'];
$defaults['file_on_case_target_contact_id'] = $defaults['target_contact'];
+ $cid = CRM_Utils_Request::retrieve('cid', 'Integer');
+ if ($cid) {
+ $cases = CRM_Case_BAO_Case::getUnclosedCases(array('contact_id' => $cid), $this->_currentCaseId);
+ foreach ($cases as $id => $details) {
+ $defaults['file_on_case_unclosed_case_id'] = $id;
+ $value = array('label' => $details['sort_name'] . ' - ' . $details['case_type']);
+ $this->updateElementAttr('file_on_case_unclosed_case_id', array('data-value' => json_encode($value)));
+ break;
+ }
+ }
+
return $defaults;
}
if (!empty($_GET['excludeCaseIds'])) {
$excludeCaseIds = explode(',', CRM_Utils_Type::escape($_GET['excludeCaseIds'], 'String'));
}
- $unclosedCases = CRM_Case_BAO_Case::getUnclosedCases($params, $excludeCaseIds);
+ $unclosedCases = CRM_Case_BAO_Case::getUnclosedCases($params, $excludeCaseIds, TRUE, TRUE);
$results = array();
foreach ($unclosedCases as $caseId => $details) {
$results[] = array(
'id' => $caseId,
- 'text' => $details['sort_name'] . ' (' . $details['case_type'] . ': ' . $details['case_subject'] . ')',
+ 'label' => $details['sort_name'] . ' - ' . $details['case_type'] . ($details['end_date'] ? ' (' . ts('closed') . ')' : ''),
+ 'label_class' => $details['end_date'] ? 'strikethrough' : '',
+ 'description' => array($details['case_subject'] . ' (' . $details['case_status'] . ')'),
'extra' => $details,
);
}
CRM_Core_Error::fatal(ts('The other contact record does not exist'));
}
- $subtypes = CRM_Contact_BAO_ContactType::subTypePairs(NULL, TRUE, '');
-
$this->assign('contact_type', $main['contact_type']);
- if (!empty($main['contact_sub_type'])) {
- $this->assign('main_contact_subtype',
- CRM_Utils_Array::value($main['contact_sub_type'][0], $subtypes)
- );
- }
- if (!empty($other['contact_sub_type'])) {
- $this->assign('other_contact_subtype',
- CRM_Utils_Array::value($other['contact_sub_type'][0], $subtypes)
- );
- }
$this->assign('main_name', $main['display_name']);
$this->assign('other_name', $other['display_name']);
$this->assign('main_cid', $main['contact_id']);
}
/**
- * @param $form
+ * @param CRM_Core_Form $form
*/
function buildForm(&$form) {
$form->addDate('start_date', ts('Start Date'), FALSE, array('formatType' => 'custom'));
$form->addDate('end_date', ts('End Date'), FALSE, array('formatType' => 'custom'));
$groups = CRM_Core_PseudoConstant::group();
- $inG = &$form->addElement('advmultiselect', 'includeGroups',
- ts('Include Group(s)') . ' ', $groups,
- array(
- 'size' => 5,
- 'style' => 'width:240px',
- 'class' => 'advmultiselect',
- )
+
+ $select2style = array(
+ 'multiple' => TRUE,
+ 'style' => 'width: 100%; max-width: 60em;',
+ 'class' => 'crm-select2',
+ 'placeholder' => ts('- select -'),
);
- $outG = &$form->addElement('advmultiselect', 'excludeGroups',
- ts('Exclude Group(s)') . ' ', $groups,
- array(
- 'size' => 5,
- 'style' => 'width:240px',
- 'class' => 'advmultiselect',
- )
+ $form->add('select', 'includeGroups',
+ ts('Include Group(s)'),
+ $groups,
+ FALSE,
+ $select2style
);
- $inG->setButtonAttributes('add', array('value' => ts('Add >>')));
- $outG->setButtonAttributes('add', array('value' => ts('Add >>')));
- $inG->setButtonAttributes('remove', array('value' => ts('<< Remove')));
- $outG->setButtonAttributes('remove', array('value' => ts('<< Remove')));
+ $form->add('select', 'excludeGroups',
+ ts('Exclude Group(s)'),
+ $groups,
+ FALSE,
+ $select2style
+ );
$this->setTitle('Search by date added to CiviCRM');
}
/**
- * @param $form
+ * @param CRM_Core_Form $form
*/
function buildForm(&$form) {
CRM_Utils_System::redirect($url);
}
- $inG = &$form->addElement('advmultiselect', 'includeGroups',
- ts('Include Group(s)') . ' ', $groups,
- array(
- 'size' => 5,
- 'style' => 'width:240px',
- 'class' => 'advmultiselect',
- )
+ $select2style = array(
+ 'multiple' => TRUE,
+ 'style' => 'width: 100%; max-width: 60em;',
+ 'class' => 'crm-select2',
+ 'placeholder' => ts('- select -'),
);
- $outG = &$form->addElement('advmultiselect', 'excludeGroups',
- ts('Exclude Group(s)') . ' ', $groups,
- array(
- 'size' => 5,
- 'style' => 'width:240px',
- 'class' => 'advmultiselect',
- )
+ $form->add('select', 'includeGroups',
+ ts('Include Group(s)'),
+ $groups,
+ FALSE,
+ $select2style
+ );
+
+ $form->add('select', 'excludeGroups',
+ ts('Exclude Group(s)'),
+ $groups,
+ FALSE,
+ $select2style
);
$andOr = array(
);
$form->addRadio('andOr', ts('AND/OR'), $andOr, NULL, '<br />', TRUE);
- $int = &$form->addElement('advmultiselect', 'includeTags',
- ts('Include Tag(s)') . ' ', $tags,
- array(
- 'size' => 5,
- 'style' => 'width:240px',
- 'class' => 'advmultiselect',
- )
+ $form->add('select', 'includeTags',
+ ts('Include Tag(s)'),
+ $tags,
+ FALSE,
+ $select2style
);
- $outt = &$form->addElement('advmultiselect', 'excludeTags',
- ts('Exclude Tag(s)') . ' ', $tags,
- array(
- 'size' => 5,
- 'style' => 'width:240px',
- 'class' => 'advmultiselect',
- )
+ $form->add('select', 'excludeTags',
+ ts('Exclude Tag(s)'),
+ $tags,
+ FALSE,
+ $select2style
);
- //add/remove buttons for groups
- $inG->setButtonAttributes('add', array('value' => ts('Add >>')));;
- $outG->setButtonAttributes('add', array('value' => ts('Add >>')));;
- $inG->setButtonAttributes('remove', array('value' => ts('<< Remove')));;
- $outG->setButtonAttributes('remove', array('value' => ts('<< Remove')));;
-
- //add/remove buttons for tags
- $int->setButtonAttributes('add', array('value' => ts('Add >>')));;
- $outt->setButtonAttributes('add', array('value' => ts('Add >>')));;
- $int->setButtonAttributes('remove', array('value' => ts('<< Remove')));;
- $outt->setButtonAttributes('remove', array('value' => ts('<< Remove')));;
-
/**
* if you are using the standard template, this array tells the template what elements
* are part of the search criteria
}
/**
- * @param $form
+ * @param CRM_Core_Form $form
*/
function buildForm(&$form) {
$form->add('text',
);
$groups = CRM_Core_PseudoConstant::group();
- $inG = &$form->addElement('advmultiselect', 'includeGroups',
- ts('Include Group(s)') . ' ', $groups,
- array(
- 'size' => 5,
- 'style' => 'width:240px',
- 'class' => 'advmultiselect',
- )
+
+ $select2style = array(
+ 'multiple' => TRUE,
+ 'style' => 'width: 100%; max-width: 60em;',
+ 'class' => 'crm-select2',
+ 'placeholder' => ts('- select -'),
);
- $outG = &$form->addElement('advmultiselect', 'excludeGroups',
- ts('Exclude Group(s)') . ' ', $groups,
- array(
- 'size' => 5,
- 'style' => 'width:240px',
- 'class' => 'advmultiselect',
- )
+ $form->add('select', 'includeGroups',
+ ts('Include Group(s)'),
+ $groups,
+ FALSE,
+ $select2style
);
- $inG->setButtonAttributes('add', array('value' => ts('Add >>')));
- $outG->setButtonAttributes('add', array('value' => ts('Add >>')));
- $inG->setButtonAttributes('remove', array('value' => ts('<< Remove')));
- $outG->setButtonAttributes('remove', array('value' => ts('<< Remove')));
+ $form->add('select', 'excludeGroups',
+ ts('Exclude Group(s)'),
+ $groups,
+ FALSE,
+ $select2style
+ );
$this->setTitle('Create a random segment of contacts');
CRM_Core_DAO::freeResult();
}
+ // get all contact subtypes
+ $contactSubTypes = CRM_Contact_BAO_ContactType::subTypePairs(NULL, TRUE, '');
+
// FIXME: there must be a better way
foreach (array('main', 'other') as $moniker) {
$contact = &$$moniker;
$value = empty($preferred_communication_method) ? array() : $preferred_communication_method;
$specialValues[$moniker] = array(
'preferred_communication_method' => $value,
+ 'contact_sub_type' => $value,
+ 'communication_style_id' => $value,
);
if (!empty($contact['preferred_communication_method'])){
),
);
CRM_Core_OptionGroup::lookupValues($specialValues[$moniker], $names);
+
+ if (!empty($contact['contact_sub_type'])) {
+ $specialValues[$moniker]['contact_sub_type'] = implode(CRM_Core_DAO::VALUE_SEPARATOR, $contact['contact_sub_type']);
+
+ // fix contact sub type label for contact with sub type
+ $subtypes = array();
+ foreach ($contact['contact_sub_type'] as $key => $value) {
+ $subtypes[] = CRM_Utils_Array::retrieveValueRecursive($contactSubTypes, $value);
+ }
+ $contact['contact_sub_type_display'] = $specialValues[$moniker]['contact_sub_type_display'] = implode(', ', $subtypes);
+ }
+
+ if (!empty($contact['communication_style'])) {
+ $specialValues[$moniker]['communication_style_id_display'] = $contact['communication_style'];
+ }
}
static $optionValueFields = array();
foreach ($submitted as $key => $value) {
if (substr($key, 0, 7) == 'custom_') {
$fid = (int) substr($key, 7);
+ if (empty($cFields[$fid])) {
+ continue;
+ }
$htmlType = $cFields[$fid]['attributes']['html_type'];
switch ($htmlType) {
case 'File':
extract( ( is_null($configs) ) ? self::getProfileSelectorTypes() : $configs );
$element = $prefix . "custom_post_id_multiple[$count]";
$label .= '<br />'.ts('(bottom of page)');
- $form->addProfileSelector( $element, $label, $allowCoreTypes, $allowSubTypes, $profileEntitites);
+ $form->addProfileSelector( $element, $label, $allowCoreTypes, $allowSubTypes, $profileEntities);
}
/**
background-position: -101px -222px;background-image: url("../i/icons/jquery-ui-3E3E3E.gif");
}
-.crm-container .survey-completed {
+.crm-container .survey-completed,
+.crm-container .strikethrough {
text-decoration: line-through;
}
}
},
minimumInputLength: 1,
- formatResult: formatSelect2Result,
+ formatResult: CRM.utils.formatSelect2Result,
formatSelection: function(row) {
return row.label;
},
});
};
- function formatSelect2Result(row) {
+ CRM.utils.formatSelect2Result = function (row) {
var markup = '<div class="crm-select2-row">';
if (row.image !== undefined) {
markup += '<div class="crm-select2-image"><img src="' + row.image + '"/></div>';
else if (row.icon_class) {
markup += '<div class="crm-select2-icon"><div class="crm-icon ' + row.icon_class + '-icon"></div></div>';
}
- markup += '<div><div class="crm-select2-row-label">' + row.label + '</div>';
+ markup += '<div><div class="crm-select2-row-label '+(row.label_class || '')+'">' + row.label + '</div>';
markup += '<div class="crm-select2-row-description">';
$.each(row.description || [], function(k, text) {
markup += '<p>' + text + '</p>';
});
markup += '</div></div></div>';
return markup;
- }
+ };
function formatSelect2CreateLinks($el) {
var
$('input[name=unclosed_case_id]', $form).crmSelect2({
placeholder: {/literal}'{ts escape="js"}- select case -{/ts}'{literal},
minimumInputLength: 1,
+ formatResult: CRM.utils.formatSelect2Result,
+ formatSelection: function(row) {
+ return row.label;
+ },
ajax: {
url: {/literal}"{crmURL p='civicrm/case/ajax/unclosed' h=0}"{literal},
data: function(term) {
$('input[name=link_to_case_id]', $form).crmSelect2({
placeholder: {/literal}'{ts escape="js"}- select case -{/ts}'{literal},
minimumInputLength: 1,
+ formatResult: CRM.utils.formatSelect2Result,
+ formatSelection: function(row) {
+ return row.label;
+ },
ajax: {
url: {/literal}"{crmURL p='civicrm/case/ajax/unclosed' h=0}"{literal},
data: function(term) {
$('input[name=file_on_case_unclosed_case_id]', '#fileOnCaseDialog').crmSelect2({
placeholder: {/literal}'{ts escape="js"}- select case -{/ts}'{literal},
minimumInputLength: 1,
+ formatResult: CRM.utils.formatSelect2Result,
+ formatSelection: function(row) {
+ return row.label;
+ },
+ initSelection: function($el, callback) {
+ callback($el.data('value'));
+ },
ajax: {
url: {/literal}"{crmURL p='civicrm/case/ajax/unclosed' h=0}"{literal},
data: function(term) {
<a id='notDuplicate' href="#" title={ts}Mark this pair as not a duplicate.{/ts} onClick="processDupes( {$main_cid}, {$other_cid}, 'dupe-nondupe', 'merge-contact', '{crmURL p="civicrm/contact/dedupefind" q="reset=1&action=update&rgid=$rgid"}' );return false;">» {ts}Mark this pair as not a duplicate.{/ts}</a>
</div>
-<table>
+<table class="row-highlight">
<tr class="columnheader">
<th> </th>
<th><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=$other_cid"}">{$other_name}</a> ({ts}duplicate{/ts})</th>
{', '|implode:$row.other}
{/if}
</td>
- <td style='white-space: nowrap'>{if $form.$field}=={$form.$field.html}==>{/if}</td>
+ <td style='white-space: nowrap'>{if $form.$field}=={$form.$field.html|crmAddClass:"select-row"}==>{/if}</td>
<td>
{if $row.title|substr:0:5 == "Email" OR
$row.title|substr:0:7 == "Address" OR
{foreach from=$rel_tables item=params key=paramName}
{if $paramName eq 'move_rel_table_users'}
<tr class="{cycle values="even-row,odd-row"}">
- <th>{ts}Move related...{/ts}</th><td>{if $otherUfId}<a target="_blank" href="{$params.other_url}">{$otherUfName}</a></td><td style='white-space: nowrap'>=={$form.$paramName.html}==>{else}<td style='white-space: nowrap'></td>{/if}</td><td>{if $mainUfId}<a target="_blank" href="{$params.main_url}">{$mainUfName}</a>{/if}</td>
+ <td><strong>{ts}Move related...{/ts}</strong></td><td>{if $otherUfId}<a target="_blank" href="{$params.other_url}">{$otherUfName}</a></td><td style='white-space: nowrap'>=={$form.$paramName.html|crmAddClass:"select-row"}==>{else}<td style='white-space: nowrap'></td>{/if}</td><td>{if $mainUfId}<a target="_blank" href="{$params.main_url}">{$mainUfName}</a>{/if}</td>
</tr>
{else}
<tr class="{cycle values="even-row,odd-row"}">
- <th>{ts}Move related...{/ts}</th><td><a href="{$params.other_url}">{$params.title}</a></td><td style='white-space: nowrap'>=={$form.$paramName.html}==></td><td><a href="{$params.main_url}">{$params.title}</a>{if $form.operation.$paramName.add.html} {$form.operation.$paramName.add.html}{/if}</td>
+ <td><strong>{ts}Move related...{/ts}</strong></td><td><a href="{$params.other_url}">{$params.title}</a></td><td style='white-space: nowrap'>=={$form.$paramName.html|crmAddClass:"select-row"}==></td><td><a href="{$params.main_url}">{$params.title}</a>{if $form.operation.$paramName.add.html} {$form.operation.$paramName.add.html}{/if}</td>
</tr>
{/if}
{/foreach}
The user record associated with the duplicate contact will not be deleted, but will be un-linked from the associated contact record (which will be deleted).
You will need to manually delete that user (click on the link to open Drupal User account in new screen). You may need to give thought to how you handle any content or contents associated with that user.{/ts}</strong></p>
{/if}
- {if $other_contact_subtype}
- <p><strong>The duplicate contact (the one that will be deleted) is a <em>{$other_contact_subtype}</em>. Any data related to this will be lost forever (there is no undo) if you complete the merge.</strong></p>
- {/if}
</div>
<div class="crm-submit-buttons">{if $prev}<a href="{$prev}" class="button"><span>{ts}<< Prev{/ts}</span></a>{/if}{include file="CRM/common/formButtons.tpl" location="bottom"}{if $next}<a href="{$next}" class="button"><span>{ts}Next >>{/ts}</span></a>{/if}</div>
+++ /dev/null
-{*
- +--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
- +--------------------------------------------------------------------+
- | 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 $validQuest}
- <div id="questForm">
- <table class="form-layout">
- {include file="CRM/Quest/Form/Search/Common.tpl"}
- </table>
- </div>
- {/if}
-
+++ /dev/null
-{*
- +--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
- +--------------------------------------------------------------------+
- | 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 |
- +--------------------------------------------------------------------+
-*}
-<form {$form.attributes}>
-
-{include file="CRM/Form/body.tpl"}
-
-{include file=$tplFile}
-
-</form>
+++ /dev/null
-<?xml version="1.0" encoding="iso-8859-1" ?>
-
-<database xmlns:xi="http://www.w3.org/2001/XInclude">
-<name>civicrm</name>
-<character_set>utf8</character_set>
-<collate>utf8_unicode_ci</collate>
-<table_type>InnoDB</table_type>
-<comment>Schema for CiviCRM</comment>
-
-<xi:include href="Core/files.xml" parse="xml" />
-<xi:include href="ACL/files.xml" parse="xml" />
-<xi:include href="Contact/files.xml" parse="xml" />
-<xi:include href="Mailing/files.xml" parse="xml" />
-<xi:include href="Mailing/Event/files.xml" parse="xml" />
-<xi:include href="Contribute/files.xml" parse="xml" />
-<xi:include href="SMS/files.xml" parse="xml" />
-<xi:include href="Project/files.xml" parse="xml" />
-<xi:include href="Member/files.xml" parse="xml" />
-<xi:include href="Activity/files.xml" parse="xml" />
-<xi:include href="Event/files.xml" parse="xml" />
-<xi:include href="Dedupe/files.xml" parse="xml" />
-<xi:include href="Quest/files.xml" parse="xml" />
-<xi:include href="Case/files.xml" parse="xml" />
-</database>