if (!empty($tags)) {
$this->add('select', 'tag', ts('Tags'), $tags, FALSE,
- array('id' => 'tags', 'multiple' => 'multiple', 'title' => ts('- select -'))
+ array('id' => 'tags', 'multiple' => 'multiple', 'class' => 'crm-select2')
);
}
$contactTypes = CRM_Contact_BAO_ContactType::getSelectElements();
$form->add('select', 'contact_type', ts('Contact Type(s)'), $contactTypes, FALSE,
- array('id' => 'contact_type', 'multiple' => 'multiple', 'title' => ts('- select -'))
+ array('id' => 'contact_type', 'multiple' => 'multiple', 'class' => 'crm-select2')
);
$groups = CRM_Core_PseudoConstant::group();
$form->add('select', 'group', ts('Groups'), $groups, FALSE,
- array('id' => 'group', 'multiple' => 'multiple', 'title' => ts('- select -'))
+ array('id' => 'group', 'multiple' => 'multiple', 'class' => 'crm-select2')
);
$showInterviewer = FALSE;
$tags = CRM_Core_BAO_Tag::getTags('civicrm_case');
if (!empty($tags)) {
$this->add('select', 'tag', ts('Select Tags'), $tags, FALSE,
- array('id' => 'tags', 'multiple' => 'multiple', 'title' => ts('- select -'))
+ array('id' => 'tags', 'multiple' => 'multiple', 'class' => 'crm-select2')
);
}
if (!empty($allTags)) {
$this->add('select', 'case_tag', ts('Tags'), $allTags, FALSE,
- array('id' => 'tags', 'multiple' => 'multiple', 'title' => ts('- select -'))
+ array('id' => 'tags', 'multiple' => 'multiple', 'class' => 'crm-select2')
);
$tags = CRM_Core_BAO_EntityTag::getTag($this->_caseID, 'civicrm_case');
}
// subtype is a common field. lets keep it here
- $subtypes = CRM_Contact_BAO_ContactType::subTypePairs($this->_contactType);
+ $subtypes = CRM_Contact_BAO_Contact::buildOptions('contact_sub_type', 'create', array('contact_type' => $this->_contactType));
if (!empty($subtypes)) {
$sel = $this->add('select', 'contact_sub_type', ts('Contact Type'),
$subtypes, FALSE,
array(
'id' => 'contact_sub_type',
'multiple' => 'multiple',
- 'title' => '- ' . ts('select') . ' -',
- 'class' => $buildCustomData,
+ 'class' => $buildCustomData . ' crm-select2',
)
);
}
// build tags and groups
CRM_Contact_Form_Edit_TagsAndGroups::buildQuickForm($this, 0, CRM_Contact_Form_Edit_TagsAndGroups::ALL,
- FALSE, NULL, 'Group(s)', 'Tag(s)', NULL, 'crmasmSelect');
+ FALSE, NULL, 'Group(s)', 'Tag(s)', NULL, 'select');
// build location blocks.
CRM_Contact_Form_Edit_Lock::buildQuickForm($this);
continue;
}
- if ($groupElementType == 'crmasmSelect') {
+ if ($groupElementType == 'select') {
$groupsOptions[$id] = $group['title'];
}
else {
}
}
- if ($groupElementType == 'crmasmSelect' && !empty($groupsOptions)) {
+ if ($groupElementType == 'select' && !empty($groupsOptions)) {
$form->add('select', $fName, ts('%1', array(1 => $groupName)), $groupsOptions, FALSE,
- array('id' => $fName, 'multiple' => 'multiple', 'title' => ts('- select -'))
+ array('id' => $fName, 'multiple' => 'multiple', 'class' => 'crm-select2')
);
$form->assign('groupCount', count($groupsOptions));
}
$contactGroup = CRM_Contact_BAO_GroupContact::getContactGroup($id, 'Added', NULL, FALSE, TRUE);
if ($contactGroup) {
foreach ($contactGroup as $group) {
- if ($groupElementType == 'crmasmSelect') {
+ if ($groupElementType == 'select') {
$defaults[$fName][] = $group['group_id'];
}
else {
// set the group and tag ids
$groupElementType = 'checkbox';
if (CRM_Utils_System::getClassName($form) == 'CRM_Contact_Form_Contact') {
- $groupElementType = 'crmasmSelect';
+ $groupElementType = 'select';
}
self::setDefaults($form->_contactId, $defaults, self::ALL, NULL, $groupElementType);
}
ts('Currency Type'),
array(
'' => ts('- any -')) +
- CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', array('labelColumn' => 'name'))
+ CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', array('labelColumn' => 'name')),
+ FALSE, array('class' => 'crm-select2')
);
// CRM-13848
$form->add('select', 'financial_type_id',
ts('Financial Type'),
CRM_Contribute_PseudoConstant::financialType(), FALSE,
- array('id' => 'financial_type_id', 'multiple' => 'multiple', 'title' => ts('- select -'))
+ array('id' => 'financial_type_id', 'multiple' => 'multiple', 'class' => 'crm-select2')
);
$form->add('select', 'contribution_page_id',
ts('Contribution Page'),
array(
'' => ts('- any -')) +
- CRM_Contribute_PseudoConstant::contributionPage()
+ CRM_Contribute_PseudoConstant::contributionPage(),
+ FALSE, array('class' => 'crm-select2')
);
ts('Payment Instrument'),
array(
'' => ts('- any -')) +
- CRM_Contribute_PseudoConstant::paymentInstrument()
+ CRM_Contribute_PseudoConstant::paymentInstrument(),
+ FALSE, array('class' => 'crm-select2')
);
$form->add('select', 'contribution_pcp_made_through_id',
ts('Personal Campaign Page'),
array(
'' => ts('- any -')) +
- CRM_Contribute_PseudoConstant::pcPage()
+ CRM_Contribute_PseudoConstant::pcPage(),
+ FALSE, array('class' => 'crm-select2')
);
$status = array();
if ( !empty( $batches ) ) {
$form->add('select', 'contribution_batch_id',
ts('Batch Name'),
- array( '' => ts('- any -')) + $batches );
+ array('' => ts('- any -')) + $batches,
+ FALSE, array('class' => 'crm-select2')
+ );
}
$form->assign('validCiviContribute', TRUE);
array(
'id' => 'soft_credit_types',
'multiple' => 'multiple',
- 'title' => '- ' . ts('select') . ' -',
+ 'class' => 'crm-select2',
)
);
// multiselect for groups
if ($this->_group) {
$this->add('select', 'group', ts('Groups'), $this->_group, FALSE,
- array('id' => 'group', 'multiple' => 'multiple', 'title' => ts('- select -'))
+ array('id' => 'group', 'multiple' => 'multiple', 'class' => 'crm-select2')
);
}
// multiselect for tags
- require_once 'CRM/Core/BAO/Tag.php';
$contactTags = CRM_Core_BAO_Tag::getTags();
if ($contactTags) {
$this->add('select', 'contact_tags', ts('Tags'), $contactTags, FALSE,
- array('id' => 'contact_tags', 'multiple' => 'multiple', 'title' => ts('- select -'))
+ array('id' => 'contact_tags', 'multiple' => 'multiple', 'class' => 'crm-select2')
);
}
if (!empty($tags)) {
$form->add('select', "tag_$i", ts('Tags'), $tags, FALSE,
- array('id' => "tags_$i", 'multiple' => 'multiple', 'title' => ts('- select -'))
+ array('id' => "tags_$i", 'multiple' => 'multiple', 'class' => 'crm-select2')
);
}
}
"js/Common.js",
"js/jquery/jquery.crmeditable.js",
- "js/jquery/jquery.crmasmselect.js",
);
// Add localized jQuery UI files
// multiselect for groups
if ($this->_group) {
$this->add('select', 'group', ts('Groups'), $this->_group, FALSE,
- array('id' => 'group', 'multiple' => 'multiple', 'title' => ts('- select -'))
+ array('id' => 'group', 'multiple' => 'multiple', 'class' => 'crm-select2')
);
}
$contactTags = CRM_Core_BAO_Tag::getTags();
if ($contactTags) {
$this->add('select', 'contact_tags', ts('Tags'), $contactTags, FALSE,
- array('id' => 'contact_tags', 'multiple' => 'multiple', 'title' => ts('- select -'))
+ array('id' => 'contact_tags', 'multiple' => 'multiple', 'class' => 'crm-select2')
);
}
CRM_Contribute_BAO_Query::buildSearchForm($this);
$grantType = CRM_Core_OptionGroup::values('grant_type');
$form->add('select', 'grant_type_id', ts('Grant Type'),
- array(
- '' => ts('- any -')) + $grantType
+ array('' => ts('- any -')) + $grantType,
+ FALSE, array('class' => 'crm-select2')
);
$grantStatus = CRM_Core_OptionGroup::values('grant_status');
$form->add('select', 'grant_status_id', ts('Grant Status'),
- array(
- '' => ts('- any -')) + $grantStatus
+ array('' => ts('- any -')) + $grantStatus,
+ FALSE, array('class' => 'crm-select2')
);
$form->addDate('grant_application_received_date_low', ts('App. Received Date - From'), FALSE, array('formatType' => 'searchDate'));
if (!empty($mailings)) {
$form->add('select', 'mailing_id', ts('Mailing Name(s)'), $mailings, FALSE,
- array('id' => 'mailing_id', 'multiple' => 'multiple', 'title' => ts('- select -'))
+ array('id' => 'mailing_id', 'multiple' => 'multiple', 'class' => 'crm-select2')
);
}
array('keyColumn' => 'id', 'labelColumn' => 'name')
);
$form->add('select', 'mailing_bounce_types', ts('Bounce Types'), $mailingBounceTypes, FALSE,
- array('id' => 'mailing_bounce_types', 'multiple' => 'multiple', 'title' => ts('- select -'))
+ array('id' => 'mailing_bounce_types', 'multiple' => 'multiple', 'class' => 'crm-select2')
);
// event filters
$form->add('select', 'pledge_financial_type_id',
ts( 'Financial Type' ),
- array(
- '' => ts('- select -')) +
- CRM_Contribute_PseudoConstant::financialType()
+ array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::financialType(),
+ FALSE, array('class' => 'crm-select2')
);
$form->add('select', 'pledge_contribution_page_id',
ts('Contribution Page'),
- array(
- '' => ts('- any -')) +
- CRM_Contribute_PseudoConstant::contributionPage()
+ array('' => ts('- any -')) + CRM_Contribute_PseudoConstant::contributionPage(),
+ FALSE, array('class' => 'crm-select2')
);
//add fields for pledge frequency
$form->add('select', 'pledge_frequency_unit',
ts('Pledge Frequency'),
- array(
- '' => ts('- any -')) + $freqUnitsDisplay
+ array('' => ts('- any -')) + $freqUnitsDisplay
);
// add all the custom searchable fields
color: #3E3E3E;
}
-/* crm advanced select styling */
-.crm-container .crmasmContainer,
-.crm-container .crmasmSelect,
-.crm-container .crmasmSelectCampaigns,
-.crm-container .crmtagContainer,
-.crm-container .crmtagSelect {
- width: 160px;
-}
-
-.crm-container .crmasmSelect,
-.crm-container .crmtagSelect,
-.crm-container .crmasmSelectCampaigns {
- padding: 2px;
-}
-
-.crm-container .crmasmSelect .child-1 {
- padding-left: 1em;
-}
-.crm-container .crmasmSelect .child-2 {
- padding-left: 2em;
-}
-
-.crm-container .crmasmHighlight,
-.crm-container .crmtagHighlight {
- display: block;
- padding: 2px 4px;
- background-color: #EEF4B8;
-}
-
-.crm-container .crmasmList,
-.crm-container .crmtagList {
- margin: 0px;
- padding: 0px;
-}
-
-.crm-container .crmasmList li,
-.crm-container .crmtagList li {
- background-color: #3E3E3E;
- background-image: none;
- padding: 2px 4px;
- list-style-type: none;
- margin: 1px 0px;
- color: #F5F6F1;
-}
-
-.crm-container .crmasmListItem,
-.crm-container .crmtagListItem {
- position: relative;
-}
-
-.crm-container .crmasmListItemRemove,
-.crm-container .crmtagListItemRemove {
- padding: 5px;
- position: absolute;
- right: 5px;
- top: 2px;
- font-size: 11px;
- margin: 0px;
- padding: 0px;
-}
-
.crm-container textarea {
border: 1px solid #999;
}
}
/* select2 */
+.crm-select2 {
+ width: 15em;
+}
+.crm-container .select2-container {
+ min-width: 15em !important;
+}
/* Move background image into outer container so we can place an icon in the inner container */
.crm-container .select2-container-multi {
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eee), color-stop(15%, #fff));
background-image: linear-gradient(top, #eee 1%, #fff 15%);
}
.crm-container .select2-container-multi .select2-choices {
+ background: url("../i/TreeMinus.gif") no-repeat scroll right 5px;
+}
+.crm-container .select2-container-multi.select2-container-active .select2-choices {
background: url("../packages/jquery/plugins/select2/select2.png") no-repeat scroll right -22px;
}
$(this).remove();
});
var options = $(this).data('select2') || {};
- $(this).removeClass('crm-select2').select2(options);
+ $(this).select2(options).removeClass('crm-select2');
});
});
{if $form.tag.html}
<tr class="crm-activity-form-block-tag">
<td class="label">{$form.tag.label}</td>
- <td class="view-value"><div class="crm-select-container">{$form.tag.html}</div>
- {literal}
- <script type="text/javascript">
- cj(".crm-activity-form-block-tag select[multiple]").crmasmSelect({
- addItemTarget: 'bottom',
- animate: true,
- highlight: true,
- sortable: true,
- respectParents: true
- });
- </script>
- {/literal}
+ <td class="view-value">
+ <div class="crm-select-container">{$form.tag.html}</div>
</td>
</tr>
{/if}
</td>
<td><label>{ts}Contact Type(s){/ts}</label><br />
{$form.contact_type.html}
- {literal}
- <script type="text/javascript">
- cj("select#contact_type").crmasmSelect({
- addItemTarget: 'bottom',
- animate: false,
- highlight: true,
- sortable: true,
- respectParents: true
- });
- </script>
- {/literal}
</td>
<td><label>{ts}Group(s){/ts}</label>
{$form.group.html}
- {literal}
- <script type="text/javascript">
- cj("select#group").crmasmSelect({
- addItemTarget: 'bottom',
- animate: false,
- highlight: true,
- sortable: true,
- respectParents: true,
- selectClass:'campaignGroupsSelect'
- });
- </script>
- {/literal}
</td>
</tr>
<tr>
function( data ) {
if ( data.status != 'success' ) return;
- var selectName = 'campaignGroupsSelect';
- var groupSelect = cj("select[id^=" + selectName + "]");
- var groupSelectCountId = cj( groupSelect ).attr( 'id' ).replace( selectName, '' );
-
//first remove all groups for given survey.
- cj( "#group" ).find('option').remove( );
- cj( groupSelect ).find('option').remove( );
- cj( '#crmasmContainer' + groupSelectCountId ).find( 'span' ).remove( );
- cj( '#crmasmList' + groupSelectCountId ).find( 'li' ).remove( );
+ cj("#group").find('option').remove();
var groups = data.groups;
//build the new group options.
var optCount = 0;
for ( group in groups ) {
- title = groups[group].title;
- value = groups[group].value;
- if ( !title ) continue;
- var crmOptCount = 'asm' + groupSelectCountId + 'option' + optCount;
+ var title = groups[group].title;
+ var value = groups[group].value;
+ if ( !value ) continue;
//add options to main group select.
- cj( "#group" ).append( cj('<option></option>').val( value ).html( title ).attr( 'id', crmOptCount ) );
-
- //add option to crm multi select ul.
- cj( groupSelect ).append( cj('<option></option>').val(value).html(title).attr( 'rel', crmOptCount ) );
+ cj( "#group" ).append( cj('<option></option>').val( value ).html(title));
optCount++;
}
+ cj("#group").trigger('change');
},
'json');
}
{if $form.tag.html}
<tr class="crm-case-activity-form-block-tag">
<td class="label">{$form.tag.label}</td>
- <td class="view-value"><div class="crm-select-container">{$form.tag.html}</div>
- {literal}
- <script type="text/javascript">
- cj(".crm-case-activity-form-block-tag select[multiple]").crmasmSelect({
- addItemTarget: 'bottom',
- animate: true,
- highlight: true,
- sortable: true,
- respectParents: true
- });
- </script>
- {/literal}
-
+ <td class="view-value">
+ <div class="crm-select-container">{$form.tag.html}</div>
</td>
</tr>
{/if}
<tr class="crm-case-form-block-tag">
<td class="label">{$form.tag.label}</td>
<td class="view-value"><div class="crm-select-container">{$form.tag.html}</div>
-{literal}
-<script type="text/javascript">
-cj(".crm-case-form-block-tag select[multiple]").crmasmSelect({
- addItemTarget: 'bottom',
- animate: true,
- highlight: true,
- sortable: true,
- respectParents: true
-});
-</script>
-{/literal}
</td>
</tr>
{/if}
{literal}
<script type="text/javascript">
-cj("#manageTags select[multiple]").crmasmSelect({
- addItemTarget: 'bottom',
- animate: true,
- highlight: true,
- sortable: true,
- respectParents: true
-});
cj("#manageTags").hide( );
function addTags() {
return true;
});
{/literal}{/if}{literal}
-
- $("select#contact_sub_type").crmasmSelect({
- addItemTarget: 'bottom',
- animate: false,
- highlight: true,
- respectParents: true
- });
});
</script>
{/if}
<table class="form-layout-compressed{if $context EQ 'profile'} crm-profile-tagsandgroups{/if}">
<tr>
- {if $groupElementType eq 'crmasmSelect'}
+ {if $groupElementType eq 'select'}
<td><span class="label">{if $title}{$form.group.label}{/if}</span>
{$form.group.html}
- {literal}
- <script type="text/javascript">
- cj(function(){
- cj("select#group").crmasmSelect({
- respectParents: true
- });
- });
- </script>
- {/literal}
</td>
{/if}
{foreach key=key item=item from=$tagGroup}
return false;
})
- cj("select#soft_credit_types").crmasmSelect({
- addItemTarget: 'bottom',
- animate: false,
- highlight: true,
- respectParents: true
- });
{/literal}
</script>
{if $form.contact_tags}
<td><label>{ts}Contributor Tag(s){/ts}</label>
{$form.contact_tags.html}
- {literal}
- <script type="text/javascript">
-
- cj("select#contact_tags").crmasmSelect({
- addItemTarget: 'bottom',
- animate: false,
- highlight: true,
- sortable: true,
- respectParents: true
- });
- </script>
- {/literal}
</td>
{else}
<td> </td>
{if $form.group}
<td><label>{ts}Contributor Group(s){/ts}</label>
{$form.group.html}
- {literal}
- <script type="text/javascript">
- cj("select#group").crmasmSelect({
- addItemTarget: 'bottom',
- animate: false,
- highlight: true,
- sortable: true,
- respectParents: true
- });
-
- </script>
- {/literal}
</td>
{else}
<td> </td>
<td>
<div class="float-left">
<label>{ts}Payment Method{/ts}</label> <br />
- {$form.contribution_payment_instrument_id.html}
+ {$form.contribution_payment_instrument_id.html|crmAddClass:twenty}
</div>
<div class="float-left" id="contribution_check_number_wrapper">
{$form.contribution_check_number.label} <br />
<td>
<label>{ts}Financial Type{/ts}</label> <br />
{$form.financial_type_id.html|crmAddClass:twenty}
- {* CRM-13848 *}
- {literal}
- <script type="text/javascript">
- cj("select#financial_type_id").crmasmSelect({
- addItemTarget: 'bottom',
- animate: false,
- highlight: true,
- sortable: true,
- respectParents: true
- });
- </script>
- {/literal}
</td>
<td>
<label>{ts}Contribution Page{/ts}</label> <br />
<tr>
<td>
<label>{ts}Currency{/ts}</label> <br />
- {$form.contribution_currency_type.html}
+ {$form.contribution_currency_type.html|crmAddClass:twenty}
</td>
{if $form.contribution_batch_id.html }
<td>
{if $form.contact_tags}
<td><label>{ts}Contributor Tag(s){/ts}</label>
{$form.contact_tags.html}
- {literal}
- <script type="text/javascript">
- cj("select#contact_tags").crmasmSelect({
- addItemTarget: 'bottom',
- animate: false,
- highlight: true,
- sortable: true,
- respectParents: true
- });
- </script>
- {/literal}
</td>
{else}
<td> </td>
{if $form.group}
<td><label>{ts}Contributor Group(s){/ts}</label>
{$form.group.html}
- {literal}
- <script type="text/javascript">
- cj("select#group").crmasmSelect({
- addItemTarget: 'bottom',
- animate: false,
- highlight: true,
- sortable: true,
- respectParents: true
- });
-
- </script>
- {/literal}
</td>
{else}
<td> </td>
{/if}
{/section}
- {literal}
- <script type="text/javascript">
- cj(".crm-attachment-tags select[multiple]").crmasmSelect({
- addItemTarget: 'bottom',
- animate: true,
- highlight: true,
- sortable: true,
- respectParents: true
- });
- </script>
- {/literal}
{/if}
{if $currentAttachmentInfo}
<tr class="attachment-fieldset"><td colspan="2"></td></tr>
{$form.mailing_id.label}
<br />
{$form.mailing_id.html}
- {literal}
- <script type="text/javascript">
- cj("select#mailing_id").crmasmSelect({
- addItemTarget: 'bottom',
- animate: false,
- highlight: true,
- sortable: true
- });
- </script>
- {/literal}
</td>
<td>
{$form.mailing_job_status.label}
<br />
{$form.mailing_bounce_types.label}
{$form.mailing_bounce_types.html}
- {literal}
- <script type="text/javascript">
- cj("select#mailing_bounce_types").crmasmSelect({
- addItemTarget: 'bottom',
- animate: false,
- highlight: true,
- sortable: true
- });
- </script>
- {/literal}
</td>
<td>
{$form.mailing_open_status.label}