{* Include Javascript to hide and display the appropriate blocks as directed by the php code *}
{*include file="CRM/common/showHide.tpl"*}
{if $locEvents}
+ {* include common additional blocks tpl *}
+ {include file="CRM/common/additionalBlocks.tpl"}
+
<script type="text/javascript">
{literal}
var locUsedMsgTxt = {/literal}"{$locUsedMsgTxt}"{literal};
}
cj(document).ready(function() {
+ //FIX ME: by default load 2 blocks and hide add and delete links
+ //we should make additional block function more flexible to set max block limit
+ buildAdditionalBlocks('Email', 'CRM_Event_Form_ManageEvent_Location');
+ buildAdditionalBlocks('Phone', 'CRM_Event_Form_ManageEvent_Location');
+ hideAddDeleteLinks();
+ function hideAddDeleteLinks() {
+ cj('#addEmail').hide();
+ cj('#addPhone').hide();
+ cj('[id=Email_Block_2] a:last').hide();
+ cj('[id=Phone_Block_2] a:last').hide();
+ }
+
cj('#loc_event_id').change(function() {
cj.ajax({
url: CRM.url('civicrm/ajax/locBlock', 'reset=1'),
displayMessage( false );
}
} else {
- cj('#'+i).val(data[i]);
+ if (i == 'phone_1_phone_type_id' || i == 'phone_2_phone_type_id') {
+ cj('#'+i).select2('val', data[i]);
+ }
+ else {
+ cj('#'+i).val(data[i]);
+ }
}
}
}
</script>
{/if}
-{* include common additional blocks tpl *}
-{include file="CRM/common/additionalBlocks.tpl"}
-
{/if} {* add block if end*}