First commit
This commit is contained in:
commit
c6e2478c40
13918 changed files with 2303184 additions and 0 deletions
|
@ -0,0 +1,62 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
<div class="crm-block crm-form-block crm-custom-field-form-block">
|
||||
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
|
||||
<div class='status'><div class="icon inform-icon"></div>
|
||||
{ts}Warning: This functionality is currently in beta stage. Consider backing up your database before using it. Click "Cancel" to return to the "edit custom field" form without making changes.{/ts}
|
||||
</div>
|
||||
<table class="form-layout">
|
||||
<tr class="crm-custom-src-field-form-block-label">
|
||||
<td class="label">{$form.src_html_type.label}</td>
|
||||
<td class="html-adjust">{$form.src_html_type.html}</td>
|
||||
</tr>
|
||||
<tr class="crm-custom-dst-field-form-block-label">
|
||||
<td class="label">{$form.dst_html_type.label}</td>
|
||||
<td class="html-adjust">{$form.dst_html_type.html}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
|
||||
</div>
|
||||
{literal}
|
||||
<script type="text/Javascript">
|
||||
function checkCustomDataField( ) {
|
||||
var srcHtmlType = '{/literal}{$srcHtmlType}{literal}';
|
||||
var singleValOps = ['Text', 'Select', 'Radio', 'Autocomplete-Select'];
|
||||
var multiValOps = ['CheckBox', 'Multi-Select', 'AdvMulti-Select'];
|
||||
var dstHtmlType = cj('#dst_html_type').val( );
|
||||
if ( !dstHtmlType ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( ( cj.inArray(srcHtmlType, multiValOps) > -1 ) &&
|
||||
( cj.inArray(dstHtmlType, singleValOps) > -1 ) ) {
|
||||
return confirm( "{/literal}{ts escape='js'}Changing a 'multi option' html type to a 'single option' html type, might results in a data loss. Please consider to take db backup before change the html type. Click 'Ok' to continue.{/ts}{literal}" );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
{/literal}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
{* Js needed to initialize custom field of type ContactReference *}
|
||||
{if empty($form.$element_name.frozen)}
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
CRM.$(function($) {
|
||||
var $field = $("{/literal}#{$element_name|replace:']':''|replace:'[':'_'}{literal}");
|
||||
|
||||
$field.crmSelect2({
|
||||
placeholder: {/literal}'{ts escape="js"}- select contact -{/ts}'{literal},
|
||||
minimumInputLength: 1,
|
||||
ajax: {
|
||||
url: {/literal}"{$customUrls.$element_name}"{literal},
|
||||
quietMillis: 300,
|
||||
data: function(term) {
|
||||
return {term: term};
|
||||
},
|
||||
results: function(response) {
|
||||
return {results: response};
|
||||
}
|
||||
},
|
||||
initSelection: function($el, callback) {
|
||||
callback($el.data('entity-value'));
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/literal}
|
||||
{/if}
|
|
@ -0,0 +1,115 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
{* Custom Data form*}
|
||||
{if $formEdit}
|
||||
{if $cd_edit.help_pre}
|
||||
<div class="messages help">{$cd_edit.help_pre}</div>
|
||||
{/if}
|
||||
<table class="form-layout-compressed">
|
||||
{foreach from=$cd_edit.fields item=element key=field_id}
|
||||
{include file="CRM/Custom/Form/CustomField.tpl"}
|
||||
{/foreach}
|
||||
</table>
|
||||
<div class="spacer"></div>
|
||||
{if $cd_edit.help_post}
|
||||
<div class="messages help">{$cd_edit.help_post}</div>
|
||||
{/if}
|
||||
{if $cd_edit.is_multiple and ( ( $cd_edit.max_multiple eq '' ) or ( $cd_edit.max_multiple > 0 and $cd_edit.max_multiple > $cgCount ) ) }
|
||||
<div id="add-more-link-{$cgCount}" class="add-more-link-{$group_id} add-more-link-{$group_id}-{$cgCount}">
|
||||
<a href="#" class="crm-hover-button" onclick="CRM.buildCustomData('{$cd_edit.extends}',{if $cd_edit.subtype}'{$cd_edit.subtype}'{else}'{$cd_edit.extends_entity_column_id}'{/if}, '', {$cgCount}, {$group_id}, true ); return false;">
|
||||
<i class="crm-i fa-plus-circle"></i>
|
||||
{ts 1=$cd_edit.title}Another %1 record{/ts}
|
||||
</a>
|
||||
</div>
|
||||
{/if}
|
||||
{else}
|
||||
{foreach from=$groupTree item=cd_edit key=group_id name=custom_sets}
|
||||
{if $cd_edit.is_multiple and $multiRecordDisplay eq 'single'}
|
||||
<div class="custom-group custom-group-{$cd_edit.name}">
|
||||
{if $cd_edit.help_pre}
|
||||
<div class="messages help">{$cd_edit.help_pre}</div>
|
||||
{/if}
|
||||
<table>
|
||||
{foreach from=$cd_edit.fields item=element key=field_id}
|
||||
{include file="CRM/Custom/Form/CustomField.tpl"}
|
||||
{/foreach}
|
||||
</table>
|
||||
<div class="spacer"></div>
|
||||
{if $cd_edit.help_post}
|
||||
<div class="messages help">{$cd_edit.help_post}</div>
|
||||
{/if}
|
||||
</div>
|
||||
{else}
|
||||
<div class="custom-group custom-group-{$cd_edit.name} crm-accordion-wrapper crm-custom-accordion {if $cd_edit.collapse_display and !$skipTitle}collapsed{/if}">
|
||||
{if !$skipTitle}
|
||||
<div class="crm-accordion-header">
|
||||
{$cd_edit.title}
|
||||
</div><!-- /.crm-accordion-header -->
|
||||
{/if}
|
||||
<div class="crm-accordion-body">
|
||||
{if $cd_edit.is_multiple eq 1 and $cd_edit.table_id and $contactId and !$skipTitle and $cd_edit.style eq 'Inline'}
|
||||
{assign var=tableID value=$cd_edit.table_id}
|
||||
<a href="#" class="crm-hover-button crm-custom-value-del" title="{ts 1=$cd_edit.title}Delete %1{/ts}"
|
||||
data-post='{ldelim}"valueID": "{$tableID}", "groupID": "{$group_id}", "contactId": "{$contactId}", "key": "{crmKey name='civicrm/ajax/customvalue'}"{rdelim}'>
|
||||
<span class="icon delete-icon"></span> {ts}Delete{/ts}
|
||||
</a>
|
||||
{/if}
|
||||
{if $cd_edit.help_pre}
|
||||
<div class="messages help">{$cd_edit.help_pre}</div>
|
||||
{/if}
|
||||
<table class="form-layout-compressed">
|
||||
{foreach from=$cd_edit.fields item=element key=field_id}
|
||||
{include file="CRM/Custom/Form/CustomField.tpl"}
|
||||
{/foreach}
|
||||
</table>
|
||||
<div class="spacer"></div>
|
||||
{if $cd_edit.help_post}
|
||||
<div class="messages help">{$cd_edit.help_post}</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{if $cd_edit.is_multiple and ( ( $cd_edit.max_multiple eq '' ) or ( $cd_edit.max_multiple > 0 and $cd_edit.max_multiple > $cgCount ) ) }
|
||||
{if $skipTitle}
|
||||
{* We don't yet support adding new records in inline-edit forms *}
|
||||
<div class="messages help">
|
||||
<em>{ts 1=$cd_edit.title}Click "Edit Contact" to add more %1 records{/ts}</em>
|
||||
</div>
|
||||
{else}
|
||||
<div id="add-more-link-{$cgCount}" class="add-more-link-{$group_id} add-more-link-{$group_id}-{$cgCount}">
|
||||
<a href="#" class="crm-hover-button" onclick="CRM.buildCustomData('{$cd_edit.extends}',{if $cd_edit.subtype}'{$cd_edit.subtype}'{else}'{$cd_edit.extends_entity_column_id}'{/if}, '', {$cgCount}, {$group_id}, true ); return false;">
|
||||
<i class="crm-i fa-plus-circle"></i>
|
||||
{ts 1=$cd_edit.title}Another %1 record{/ts}
|
||||
</a>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
{/if}
|
||||
<div id="custom_group_{$group_id}_{$cgCount}"></div>
|
||||
{/foreach}
|
||||
|
||||
{/if}
|
||||
|
||||
{include file="CRM/Form/attachmentjs.tpl"}
|
|
@ -0,0 +1 @@
|
|||
{include file="CRM/Custom/Form/CustomData.tpl"}
|
|
@ -0,0 +1,30 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
{* Dynamically fetch the help text for a custom field *}
|
||||
{htxt id=$id}
|
||||
{crmAPI var='result' entity='CustomField' action='getsingle' id=$id}
|
||||
{$result.help_post}
|
||||
{/htxt}
|
|
@ -0,0 +1,95 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
{assign var="element_name" value=$element.element_name}
|
||||
|
||||
{if $element.help_pre}
|
||||
<tr class="custom_field-help-pre-row {$element.element_name}-row-help-pre">
|
||||
<td> </td>
|
||||
<td class="html-adjust description">{$element.help_pre}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $element.options_per_line != 0 }
|
||||
<tr class="custom_field-row {$element.element_name}-row">
|
||||
<td class="label">{$form.$element_name.label}{if $element.help_post}{help id=$element.id file="CRM/Custom/Form/CustomField.hlp" title=$element.label}{/if}</td>
|
||||
<td class="html-adjust">
|
||||
{assign var="count" value="1"}
|
||||
<table class="form-layout-compressed" style="margin-top: -0.5em;">
|
||||
<tr>
|
||||
{* sort by fails for option per line. Added a variable to iterate through the element array*}
|
||||
{assign var="index" value="1"}
|
||||
{foreach name=outer key=key item=item from=$form.$element_name}
|
||||
{if $index < 10}
|
||||
{assign var="index" value=`$index+1`}
|
||||
{else}
|
||||
<td class="labels font-light">{$form.$element_name.$key.html}</td>
|
||||
{if $count == $element.options_per_line}
|
||||
</tr>
|
||||
<tr>
|
||||
{assign var="count" value="1"}
|
||||
{else}
|
||||
{assign var="count" value=`$count+1`}
|
||||
{/if}
|
||||
{/if}
|
||||
{/foreach}
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{else}
|
||||
<tr class="custom_field-row {$element.element_name}-row">
|
||||
<td class="label">{$form.$element_name.label}{if $element.help_post}{help id=$element.id file="CRM/Custom/Form/CustomField.hlp" title=$element.label}{/if}</td>
|
||||
<td class="html-adjust">
|
||||
{$form.$element_name.html}
|
||||
{if $element.data_type eq 'File'}
|
||||
{if $element.element_value.data}
|
||||
<div class="crm-attachment-wrapper crm-entity" id="file_{$element_name}">
|
||||
<span class="html-adjust"><br />
|
||||
{ts}Attached File{/ts}:
|
||||
{if $element.element_value.displayURL}
|
||||
<a href="{$element.element_value.displayURL}" class='crm-image-popup crm-attachment'>
|
||||
<img src="{$element.element_value.displayURL}"
|
||||
height = "{$element.element_value.imageThumbHeight}"
|
||||
width="{$element.element_value.imageThumbWidth}">
|
||||
</a>
|
||||
{else}
|
||||
<a class="crm-attachment" href="{$element.element_value.fileURL}">{$element.element_value.fileName}</a>
|
||||
{/if}
|
||||
{if $element.element_value.deleteURL}
|
||||
<a href="#" class="crm-hover-button delete-attachment" data-filename="{$element.element_value.fileName}" data-args="{$element.element_value.deleteURLArgs}" title="{ts}Delete File{/ts}"><span class="icon delete-icon"></span></a>
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
{/if}
|
||||
{elseif $element.html_type eq 'Autocomplete-Select'}
|
||||
{if $element.data_type eq 'ContactReference'}
|
||||
{include file="CRM/Custom/Form/ContactReference.tpl"}
|
||||
{/if}
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{/if}
|
|
@ -0,0 +1,33 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 confirmation of delete for a Fields *}
|
||||
<div class="crm-block crm-form-block crm-custom-deletefield-form-block">
|
||||
<div class="messages status no-popup">
|
||||
<div class="icon inform-icon"></div>
|
||||
{ts 1=$title}WARNING: Deleting this custom field will result in the loss of all '%1' data. Any Profile form and listings field(s) linked with '%1' will also be deleted.{/ts} {ts}This action cannot be undone.{/ts} {ts}Do you want to continue?{/ts}
|
||||
</div>
|
||||
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
|
||||
</div>
|
|
@ -0,0 +1,38 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 confirmation of delete for a file *}
|
||||
<fieldset><legend>{ts}Delete Attached File{/ts}</legend>
|
||||
<div class="status">
|
||||
<dl>
|
||||
<dt><div class="icon inform-icon"></div></dt>
|
||||
<dd>
|
||||
{ts}WARNING: Are you sure you want to delete the attached file?{/ts}
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<dl><dt></dt><dd>{$form.buttons.html}</dd></dl>
|
||||
</fieldset>
|
|
@ -0,0 +1,39 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 confirmation of delete for a custom field set *}
|
||||
<div class="crm-block crm-form-block crm-custom-deletegroup-form-block">
|
||||
<div class="crm-submit-buttons">
|
||||
{include file="CRM/common/formButtons.tpl" location="top"}
|
||||
</div>
|
||||
<div class="messages status no-popup">
|
||||
<div class="icon inform-icon"></div>
|
||||
{ts 1=$title}WARNING: Deleting this custom field set will result in the loss of all '%1' data.{/ts} {ts}This action cannot be undone.{/ts} {ts}Do you want to continue?{/ts}
|
||||
</div>
|
||||
<div class="crm-submit-buttons">
|
||||
{include file="CRM/common/formButtons.tpl" location="bottom"}
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,28 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
{htxt id="id-in_selector"}
|
||||
{ts}Display in Table controls which columns are included in the listing of custom data records. If your custom data set has a large number of fields, uncheck this box to exclude less important fields from the listing. All fields will still be included when viewing a single record. You may also want to exclude Note type fields from the table listing.{/ts}
|
||||
{/htxt}
|
354
sites/all/modules/civicrm/templates/CRM/Custom/Form/Field.tpl
Normal file
354
sites/all/modules/civicrm/templates/CRM/Custom/Form/Field.tpl
Normal file
|
@ -0,0 +1,354 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
{*Javascript function controls showing and hiding of form elements based on html type.*}
|
||||
{literal}
|
||||
<script type="text/Javascript">
|
||||
function custom_option_html_type( ) {
|
||||
var html_type_name = document.getElementsByName("data_type[1]")[0].value;
|
||||
var data_type_id = document.getElementsByName("data_type[0]")[0].value;
|
||||
|
||||
if ( !html_type_name && !data_type_id ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( data_type_id == 11) {
|
||||
toggleContactRefFilter( );
|
||||
} else {
|
||||
cj('#field_advance_filter').hide();
|
||||
cj('#contact_reference_group').hide();
|
||||
}
|
||||
|
||||
if ( data_type_id < 4 ) {
|
||||
if ( html_type_name != "Text" ) {
|
||||
cj("#showoption").show();
|
||||
cj("#hideDefault").hide();
|
||||
cj("#hideDesc").hide();
|
||||
cj("#searchByRange").hide();
|
||||
cj("#searchable").show();
|
||||
} else {
|
||||
cj("#showoption").hide();
|
||||
cj("#hideDefault").show();
|
||||
cj("#hideDesc").show();
|
||||
cj("#searchable").show();
|
||||
}
|
||||
} else {
|
||||
if ( data_type_id == 9 ) {
|
||||
document.getElementById("default_value").value = '';
|
||||
cj("#hideDefault").hide();
|
||||
cj("#searchable").hide();
|
||||
cj("#hideDesc").hide();
|
||||
} else if ( data_type_id == 11 ) {
|
||||
cj("#hideDefault").hide();
|
||||
} else {
|
||||
cj("#hideDefault").show();
|
||||
cj("#searchable").show();
|
||||
cj("#hideDesc").show();
|
||||
}
|
||||
cj("#showoption").hide();
|
||||
}
|
||||
|
||||
var radioOption, checkBoxOption;
|
||||
|
||||
for ( var i=1; i<=11; i++) {
|
||||
radioOption = 'radio'+i;
|
||||
checkBoxOption = 'checkbox'+i
|
||||
if ( data_type_id < 4 ) {
|
||||
if ( html_type_name != "Text") {
|
||||
if ( html_type_name == "CheckBox" || html_type_name == "Multi-Select") {
|
||||
cj("#"+checkBoxOption).show();
|
||||
cj("#"+radioOption).hide();
|
||||
} else {
|
||||
cj("#"+radioOption).show();
|
||||
cj("#"+checkBoxOption).hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( data_type_id < 4 ) {
|
||||
if (html_type_name == "CheckBox" || html_type_name == "Radio") {
|
||||
cj("#optionsPerLine").show();
|
||||
} else {
|
||||
cj("#optionsPerLine").hide();
|
||||
}
|
||||
}
|
||||
|
||||
if ( data_type_id == 5) {
|
||||
cj("#startDateRange").show();
|
||||
cj("#endDateRange").show();
|
||||
cj("#includedDatePart").show();
|
||||
} else {
|
||||
cj("#startDateRange").hide();
|
||||
cj("#endDateRange").hide();
|
||||
cj("#includedDatePart").hide();
|
||||
}
|
||||
|
||||
if ( data_type_id == 0 ) {
|
||||
cj("#textLength").show();
|
||||
} else {
|
||||
cj("#textLength").hide();
|
||||
}
|
||||
|
||||
if ( data_type_id == 4 ) {
|
||||
cj("#noteColumns").show();
|
||||
cj("#noteRows").show();
|
||||
cj("#noteLength").show();
|
||||
} else {
|
||||
cj("#noteColumns").hide();
|
||||
cj("#noteRows").hide();
|
||||
cj("#noteLength").hide();
|
||||
}
|
||||
|
||||
if ( data_type_id > 3) {
|
||||
cj("#optionsPerLine").hide();
|
||||
}
|
||||
|
||||
{/literal}{if $action eq 1}{literal}
|
||||
clearSearchBoxes( );
|
||||
{/literal}{/if}{literal}
|
||||
}
|
||||
</script>
|
||||
{/literal}
|
||||
<div class="crm-block crm-form-block crm-custom-field-form-block">
|
||||
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
|
||||
<table class="form-layout">
|
||||
<tr class="crm-custom-field-form-block-label">
|
||||
<td class="label">{$form.label.label}
|
||||
{if $action == 2}
|
||||
{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_custom_field' field='label' id=$id}
|
||||
{/if}
|
||||
</td>
|
||||
<td class="html-adjust">{$form.label.html}</td>
|
||||
</tr>
|
||||
<tr class="crm-custom-field-form-block-data_type">
|
||||
<td class="label">{$form.data_type.label}</td>
|
||||
<td class="html-adjust">{$form.data_type.html}
|
||||
{if $action neq 4 and $action neq 2}
|
||||
<br /><span class="description">{ts}Select the type of data you want to collect and store for this contact. Then select from the available HTML input field types (choices are based on the type of data being collected).{/ts}</span>
|
||||
{/if}
|
||||
{if $action eq 2 and $changeFieldType}
|
||||
<br />
|
||||
<a class="action-item crm-hover-button" href='{crmURL p="civicrm/admin/custom/group/field/changetype" q="reset=1&id=`$id`"}'>
|
||||
<i class="crm-i fa-wrench"></i>
|
||||
{ts}Change Input Field Type{/ts}
|
||||
</a>
|
||||
<div class='clear'></div>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{if $form.in_selector}
|
||||
<tr class='crm-custom-field-form-block-in_selector'>
|
||||
<td class='label'>{$form.in_selector.label}</td>
|
||||
<td class='html-adjust'>{$form.in_selector.html} {help id="id-in_selector"}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr class="crm-custom-field-form-block-text_length" id="textLength" {if !( $action eq 1 || $action eq 2 ) && ($form.data_type.value.0.0 != 0)}class="hiddenElement"{/if}>
|
||||
<td class="label">{$form.text_length.label}</td>
|
||||
<td class="html-adjust">{$form.text_length.html}</td>
|
||||
</tr>
|
||||
|
||||
<tr id='showoption' {if $action eq 1 or $action eq 2 }class="hiddenElement"{/if}>
|
||||
<td colspan="2">
|
||||
<table class="form-layout-compressed">
|
||||
{* Conditionally show table for setting up selection options - for field types = radio, checkbox or select *}
|
||||
{include file="CRM/Custom/Form/Optionfields.tpl"}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id='contact_reference_group'>
|
||||
<td class="label">{$form.group_id.label}</td>
|
||||
<td class="html-adjust">
|
||||
{$form.group_id.html}
|
||||
<span><a href="#" onclick="toggleContactRefFilter('Advance'); return false;">{ts}Advanced Filter{/ts}</a></span>
|
||||
{capture assign=searchPreferences}{crmURL p="civicrm/admin/setting/search" q="reset=1"}{/capture}
|
||||
<div class="messages status no-popup"><i class="crm-i fa-exclamation-triangle"></i> {ts 1=$searchPreferences}If you are planning on using this field in front-end profile, event registration or contribution forms, you should 'Limit List to Group' or configure an 'Advanced Filter' (so that you do not unintentionally expose your entire set of contacts). Users must have either 'access contact reference fields' OR 'access CiviCRM' permission in order to use contact reference autocomplete fields. You can assign 'access contact reference fields' to the anonymous role if you want un-authenticated visitors to use this field. Use <a href='%1'>Search Preferences - Contact Reference Options</a> to control the fields included in the search results.{/ts}
|
||||
</td>
|
||||
</tr>
|
||||
<tr id='field_advance_filter'>
|
||||
<td class="label">{$form.filter.label}</td>
|
||||
<td class="html-adjust">
|
||||
{$form.filter.html}
|
||||
<span><a href="#" onclick="toggleContactRefFilter('Group'); return false;">{ts}Filter by Group{/ts}</a></span>
|
||||
<br />
|
||||
<span class="description">{ts}Filter contact search results for this field using Contact get API parameters. EXAMPLE: To list Students in group 3:{/ts} "action=get&group=3&contact_sub_type=Student" {docURL page="Using the API" resource="wiki"}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="crm-custom-field-form-block-options_per_line" id="optionsPerLine" {if $action neq 2 && ($form.data_type.value.0.0 >= 4 && $form.data_type.value.1.0 neq 'CheckBox' || $form.data_type.value.1.0 neq 'Radio' )}class="hiddenElement"{/if}>
|
||||
<td class="label">{$form.options_per_line.label}</td>
|
||||
<td class="html-adjust">{$form.options_per_line.html|crmAddClass:two}</td>
|
||||
</tr>
|
||||
<tr class="crm-custom-field-form-block-start_date_years" id="startDateRange" {if $action neq 2 && ($form.data_type.value.0.0 != 5)}class="hiddenElement"{/if}>
|
||||
<td class="label">{$form.start_date_years.label}</td>
|
||||
<td class="html-adjust">{$form.start_date_years.html} {ts}years prior to current date.{/ts}</td>
|
||||
</tr>
|
||||
<tr class="crm-custom-field-form-block-end_date_years" id="endDateRange" {if $action neq 2 && ($form.data_type.value.0.0 != 5)}class="hiddenElement"{/if}>
|
||||
<td class="label">{$form.end_date_years.label}</td>
|
||||
<td class="html-adjust">{$form.end_date_years.html} {ts}years after the current date.{/ts}</td>
|
||||
</tr>
|
||||
<tr class="crm-custom-field-form-block-date_format" id="includedDatePart" {if $action neq 2 && ($form.data_type.value.0.0 != 5)}class="hiddenElement"{/if}>
|
||||
<td class="label">{$form.date_format.label}</td>
|
||||
<td class="html-adjust">{$form.date_format.html} {$form.time_format.label} {$form.time_format.html}</td>
|
||||
</tr>
|
||||
<tr class="crm-custom-field-form-block-note_rows" id="noteRows" {if $action neq 2 && ($form.data_type.value.0.0 != 4)}class="hiddenElement"{/if}>
|
||||
<td class="label">{$form.note_rows.label}</td>
|
||||
<td class="html-adjust">{$form.note_rows.html}</td>
|
||||
</tr>
|
||||
<tr class="crm-custom-field-form-block-note_columns" id="noteColumns" {if $action neq 2 && ($form.data_type.value.0.0 != 4)}class="hiddenElement"{/if}>
|
||||
<td class="label">{$form.note_columns.label}</td>
|
||||
<td class="html-adjust">{$form.note_columns.html}</td>
|
||||
</tr>
|
||||
<tr class="crm-custom-field-form-block-note_length" id="noteLength" {if $action neq 2 && ($form.data_type.value.0.0 != 4)}class="hiddenElement"{/if}>
|
||||
<td class="label">{$form.note_length.label}</td>
|
||||
<td class="html-adjust">{$form.note_length.html} <span class="description">{ts}Leave blank for unlimited. This limit is not implemented by all browsers and rich text editors.{/ts}</span></td>
|
||||
</tr>
|
||||
<tr class="crm-custom-field-form-block-weight" >
|
||||
<td class="label">{$form.weight.label}</td>
|
||||
<td>{$form.weight.html|crmAddClass:two}
|
||||
{if $action neq 4}
|
||||
<span class="description">{ts}Weight controls the order in which fields are displayed in a group. Enter a positive or negative integer - lower numbers are displayed ahead of higher numbers.{/ts}</span>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="crm-custom-field-form-block-default_value" id="hideDefault" {if $action eq 2 && ($form.data_type.value.0.0 < 4 && $form.data_type.value.1.0 NEQ 'Text')}class="hiddenElement"{/if}>
|
||||
<td title="hideDefaultValTxt" class="label">{$form.default_value.label}</td>
|
||||
<td title="hideDefaultValDef" class="html-adjust">{$form.default_value.html}</td>
|
||||
</tr>
|
||||
<tr class="crm-custom-field-form-block-description" id="hideDesc" {if $action neq 4 && $action eq 2 && ($form.data_type.value.0.0 < 4 && $form.data_type.value.1.0 NEQ 'Text')}class="hiddenElement"{/if}>
|
||||
<td title="hideDescTxt" class="label"> </td>
|
||||
<td title="hideDescDef" class="html-adjust"><span class="description">{ts}If you want to provide a default value for this field, enter it here. For date fields, format is YYYY-MM-DD.{/ts}</span></td>
|
||||
</tr>
|
||||
<tr class="crm-custom-field-form-block-help_pre">
|
||||
<td class="label">{$form.help_pre.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_custom_field' field='help_pre' id=$id}{/if}</td>
|
||||
<td class="html-adjust">{$form.help_pre.html|crmAddClass:huge}</td>
|
||||
</tr>
|
||||
<tr class="crm-custom-field-form-block-help_post">
|
||||
<td class="label">{$form.help_post.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_custom_field' field='help_post' id=$id}{/if}</td>
|
||||
<td class="html-adjust">{$form.help_post.html|crmAddClass:huge}
|
||||
{if $action neq 4}
|
||||
<span class="description">{ts}Explanatory text displayed on back-end forms. Pre help is displayed inline on the form (above the field). Post help is displayed in a pop-up - users click the help balloon to view help text.{/ts}</span>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="crm-custom-field-form-block-is_required">
|
||||
<td class="label">{$form.is_required.label}</td>
|
||||
<td class="html-adjust">{$form.is_required.html}
|
||||
{if $action neq 4}
|
||||
<br /><span class="description">{ts}Do not make custom fields required unless you want to force all users to enter a value anytime they add or edit this type of record. You can always make the field required when used in a specific Profile form.{/ts}</span>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr id ="searchable" class="crm-custom-field-form-block-is_searchable">
|
||||
<td class="label">{$form.is_searchable.label}</td>
|
||||
<td class="html-adjust">{$form.is_searchable.html}
|
||||
{if $action neq 4}
|
||||
<br /><span class="description">{ts}Can you search on this field in the Advanced and component search forms? Also determines whether you can include this field as a display column and / or filter in related detail reports.{/ts}</span>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="searchByRange" class="crm-custom-field-form-block-is_search_range">
|
||||
<td class="label">{$form.is_search_range.label}</td>
|
||||
<td class="html-adjust">{$form.is_search_range.html}</td>
|
||||
</tr>
|
||||
<tr class="crm-custom-field-form-block-is_active">
|
||||
<td class="label">{$form.is_active.label}</td>
|
||||
<td class="html-adjust">{$form.is_active.html}</td>
|
||||
</tr>
|
||||
<tr class="crm-custom-field-form-block-is_view">
|
||||
<td class="label">{$form.is_view.label}</td>
|
||||
<td class="html-adjust">{$form.is_view.html}
|
||||
<span class="description">{ts}Is this field set by PHP code (via a custom hook). This field will not be updated by CiviCRM.{/ts}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{if $action ne 4}
|
||||
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
|
||||
{else}
|
||||
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
|
||||
{/if} {* $action ne view *}
|
||||
</div>
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
CRM.$(function($) {
|
||||
var $form = $('form.{/literal}{$form.formClass}{literal}'),
|
||||
deprecatedNotice;
|
||||
function deprecatedWidgets() {
|
||||
deprecatedNotice && deprecatedNotice.close && deprecatedNotice.close();
|
||||
switch ($('#data_type_1', $form).val()) {
|
||||
case 'AdvMulti-Select':
|
||||
deprecatedNotice = CRM.alert({/literal}'{ts escape="js"}The old "Advance Multi-Select" widget is being phased out and will be removed in a future version of CiviCRM. "Multi-Select" is the recommended substitute.{/ts}', '{ts escape="js"}Obsolete widget{/ts}'{literal}, 'alert', {expires: 0});
|
||||
break;
|
||||
}
|
||||
}
|
||||
$('#data_type_1', $form).each(deprecatedWidgets).change(deprecatedWidgets);
|
||||
});
|
||||
|
||||
//when page is reload, build show hide boxes
|
||||
//as per data type and html type selected.
|
||||
custom_option_html_type( );
|
||||
|
||||
function showSearchRange(chkbox) {
|
||||
var html_type = document.getElementsByName("data_type[1]")[0].value;
|
||||
var data_type = document.getElementsByName("data_type[0]")[0].value;
|
||||
|
||||
if ( ((data_type == 1 || data_type == 2 || data_type == 3) && (html_type == "Text")) || data_type == 5) {
|
||||
if (chkbox.checked) {
|
||||
document.getElementsByName("is_search_range")[0].checked = true;
|
||||
cj("#searchByRange").show();
|
||||
} else {
|
||||
clearSearchBoxes( );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//should not clear search boxes for update mode.
|
||||
function clearSearchBoxes( ) {
|
||||
document.getElementsByName("is_searchable")[0].checked = false;
|
||||
document.getElementsByName("is_search_range")[1].checked = true;
|
||||
cj("#searchByRange").hide();
|
||||
}
|
||||
|
||||
function toggleContactRefFilter(setSelected) {
|
||||
if ( !setSelected ) {
|
||||
setSelected = cj('#filter_selected').val();
|
||||
} else {
|
||||
cj('#filter_selected').val(setSelected);
|
||||
}
|
||||
if ( setSelected == 'Advance' ) {
|
||||
cj('#contact_reference_group').hide( );
|
||||
cj('#field_advance_filter').show( );
|
||||
} else {
|
||||
cj('#field_advance_filter').hide( );
|
||||
cj('#contact_reference_group').show( );
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{/literal}
|
||||
{* Give link to view/edit choice options if in edit mode and html_type is one of the multiple choice types *}
|
||||
{if $action eq 2 AND ($form.data_type.value.1.0 eq 'CheckBox' OR ($form.data_type.value.1.0 eq 'Radio' AND $form.data_type.value.0.0 neq 6) OR $form.data_type.value.1.0 eq 'Select' OR ($form.data_type.value.1.0 eq 'Multi-Select' AND $dontShowLink neq 1 ) ) }
|
||||
<div class="action-link">
|
||||
{crmButton p="civicrm/admin/custom/group/field/option" q="reset=1&action=browse&fid=`$id`&gid=`$gid`" icon="pencil"}{ts}View / Edit Multiple Choice Options{/ts}{/crmButton}
|
||||
</div>
|
||||
{/if}
|
201
sites/all/modules/civicrm/templates/CRM/Custom/Form/Group.tpl
Normal file
201
sites/all/modules/civicrm/templates/CRM/Custom/Form/Group.tpl
Normal file
|
@ -0,0 +1,201 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
{* add/update/view custom data group *}
|
||||
<div class="crm-block crm-form-block">
|
||||
<div class="help">{ts}Use Custom Field Sets to add logically related fields for a specific type of CiviCRM record (e.g. contact records, contribution records, etc.).{/ts} {help id="id-group_intro"}</div>
|
||||
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
|
||||
<table class="form-layout">
|
||||
<tr>
|
||||
<td class="label">{$form.title.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_custom_group' field='title' id=$gid}{/if}</td>
|
||||
<td class="html-adjust">{$form.title.html} {help id="id-title"}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">{$form.extends.label}</td>
|
||||
<td>{$form.extends.html} {help id="id-extends"}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">{$form.weight.label}</td>
|
||||
<td>{$form.weight.html} {help id="id-weight"}</td>
|
||||
</tr>
|
||||
<tr id="is_multiple_row" class="hiddenElement"> {* This section shown only when Used For = Contact, Individ, Org or Household. *}
|
||||
<td></td>
|
||||
<td class="html-adjust">{$form.is_multiple.html} {$form.is_multiple.label} {help id="id-is_multiple"}</td>
|
||||
</tr>
|
||||
<tr id="multiple_row" class="hiddenElement">
|
||||
<td class="label">{$form.max_multiple.label}</td>
|
||||
<td>{$form.max_multiple.html} {help id="id-max_multiple"}</td>
|
||||
</tr>
|
||||
<tr id="style_row" class="hiddenElement">
|
||||
<td class="label">{$form.style.label}</td>
|
||||
<td>{$form.style.html} {help id="id-display_style"}</td>
|
||||
</tr>
|
||||
<tr class="html-adjust">
|
||||
<td> </td>
|
||||
<td>{$form.collapse_display.html} {$form.collapse_display.label} {help id="id-collapse"}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>{$form.collapse_adv_display.html} {$form.collapse_adv_display.label} {help id="id-collapse-adv"}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>{$form.is_active.html} {$form.is_active.label}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>{$form.is_public.html} {$form.is_public.label}</td>
|
||||
</tr>
|
||||
<tr class="html-adjust">
|
||||
<td class="label">{$form.help_pre.label} <!--{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_custom_group' field='help_pre' id=$gid}{/if}-->{help id="id-help_pre"}</td>
|
||||
<td>{$form.help_pre.html}</td>
|
||||
</tr>
|
||||
<tr class="html-adjust">
|
||||
<td class="label">{$form.help_post.label} <!--{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_custom_group' field='help_post' id=$gid}{/if}-->{help id="id-help_post"}</td>
|
||||
<td>{$form.help_post.html}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
|
||||
</div>
|
||||
{if $action eq 2 or $action eq 4} {* Update or View*}
|
||||
<p></p>
|
||||
<div class="action-link">
|
||||
{crmButton p='civicrm/admin/custom/group/field' q="action=browse&reset=1&gid=$gid" icon="th-list"}{ts}Custom Fields for this Set{/ts}{/crmButton}
|
||||
</div>
|
||||
{/if}
|
||||
{$initHideBlocks}
|
||||
{literal}
|
||||
<script type="text/Javascript">
|
||||
CRM.$(function($) {
|
||||
var tabWithTableOption;
|
||||
|
||||
$('#extends_0').each(showHideStyle).change(showHideStyle);
|
||||
|
||||
var isGroupEmpty = "{/literal}{$isGroupEmpty}{literal}";
|
||||
if (isGroupEmpty) {
|
||||
showRange(true);
|
||||
}
|
||||
$('input#is_multiple').change(showRange);
|
||||
|
||||
// "Collapse" is a bad default for "Tab" display
|
||||
$("select#style").change(function() {
|
||||
if ($(this).val() == 'Tab') {
|
||||
$('#collapse_display').prop('checked', false);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Check if this is a contact-related set and show/hide other options accordingly
|
||||
*/
|
||||
function showHideStyle() {
|
||||
var
|
||||
extend = $(this).val(),
|
||||
contactTypes = {/literal}{$contactTypes}{literal},
|
||||
showStyle = "{/literal}{$showStyle}{literal}",
|
||||
showMultiple = "{/literal}{$showMultiple}{literal}",
|
||||
showMaxMultiple = "{/literal}{$showMaxMultiple}{literal}",
|
||||
isContact = ($.inArray(extend, contactTypes) >= 0);
|
||||
|
||||
if (isContact) {
|
||||
$("tr#style_row, tr#is_multiple_row").show();
|
||||
if ($('#is_multiple :checked').length) {
|
||||
$("tr#multiple_row").show();
|
||||
}
|
||||
}
|
||||
else {
|
||||
$("tr#style_row, tr#is_multiple_row, tr#multiple_row").hide();
|
||||
}
|
||||
|
||||
if (showStyle) {
|
||||
$("tr#style_row").show();
|
||||
}
|
||||
|
||||
if (showMultiple) {
|
||||
$("tr#style_row, tr#is_multiple_row").show();
|
||||
}
|
||||
|
||||
if (!showMaxMultiple) {
|
||||
$("tr#multiple_row").hide();
|
||||
}
|
||||
else if ($('#is_multiple').prop('checked')) {
|
||||
$("tr#multiple_row").show();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if this set supports multiple records and adjust other options accordingly
|
||||
*
|
||||
* @param onFormLoad
|
||||
*/
|
||||
function showRange(onFormLoad) {
|
||||
if($("#is_multiple").is(':checked')) {
|
||||
$("tr#multiple_row").show();
|
||||
if (onFormLoad !== true) {
|
||||
$('#collapse_display').prop('checked', false);
|
||||
$("select#style").append(tabWithTableOption);
|
||||
$("select#style").val('Tab with table');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$("tr#multiple_row").hide();
|
||||
if ($("select#style").val() === 'Tab with table') {
|
||||
$("select#style").val('Inline');
|
||||
}
|
||||
tabWithTableOption = $("select#style option[value='Tab with table']").detach();
|
||||
}
|
||||
}
|
||||
|
||||
// In update mode, when 'extends' is set to an option which doesn't have
|
||||
// any options in 2nd selector (for subtypes)
|
||||
var subtypes = document.getElementById('extends_1');
|
||||
if (subtypes) {
|
||||
if (subtypes.options.length <= 0) {
|
||||
subtypes.style.display = 'none';
|
||||
}
|
||||
else {
|
||||
subtypes.style.display = 'inline';
|
||||
}
|
||||
}
|
||||
|
||||
// When removing sub-types
|
||||
$('.crm-warnDataLoss').on('click', function() {
|
||||
var submittedSubtypes = $('#extends_1').val();
|
||||
var defaultSubtypes = {/literal}{$defaultSubtypes}{literal};
|
||||
|
||||
var warning = false;
|
||||
$.each(defaultSubtypes, function(index, subtype) {
|
||||
if ($.inArray(subtype, submittedSubtypes) < 0) {
|
||||
warning = true;
|
||||
}
|
||||
});
|
||||
|
||||
if (warning) {
|
||||
return confirm({/literal}'{ts escape='js'}Warning: You have chosen to remove one or more subtypes. This will cause any custom data records associated with those subtypes to be removed as long as the contact does not have a contact subtype still selected.{/ts}'{literal});
|
||||
}
|
||||
return true;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/literal}
|
|
@ -0,0 +1,37 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
|
||||
<div class="crm-block crm-form-block crm-move-field-block">
|
||||
<table class="form-layout-compressed">
|
||||
<tr><td class="label">{$form.dst_group_id.label}</td>
|
||||
<td>{$form.dst_group_id.html}<br />
|
||||
<span class="description">{ts}Select a different Custom Data Set for this field.{/ts}
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="label">{$form.is_copy.label}</td><td>{$form.is_copy.html}</td></tr>
|
||||
</table>
|
||||
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
|
||||
</div>
|
|
@ -0,0 +1,39 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
CRM.$(function($) {
|
||||
function showHideOperator() {
|
||||
var val = $(this).val();
|
||||
$(this).siblings("span.crm-multivalue-search-op").toggle(!!(val && val.length > 1));
|
||||
}
|
||||
$("span.crm-multivalue-search-op").siblings('select')
|
||||
.off('.crmMultiValue')
|
||||
.on('change.crmMultiValue', showHideOperator)
|
||||
.each(showHideOperator);
|
||||
});
|
||||
</script>
|
||||
{/literal}
|
|
@ -0,0 +1,66 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
<div class="crm-block {if $action eq 4}crm-content-block {else}crm-form-block {/if}crm-custom_option-form-block">
|
||||
<h3>{if $action eq 4 }{ts}View Option{/ts}{elseif $action eq 2}{ts}Edit Option{/ts}{elseif $action eq 8}{ts 1=$label}Delete Option "%1"{/ts}{else}{ts}Add Option{/ts}{/if}</h3>
|
||||
{if $action ne 4 AND $action ne 8}
|
||||
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
|
||||
{/if} {* $action ne view *}
|
||||
{if $action eq 8}
|
||||
<div class="messages status no-popup">
|
||||
<div class="icon inform-icon"></div>
|
||||
{ts}WARNING: Deleting this custom field option will result in the loss of all related data.{/ts} {ts}This action cannot be undone.{/ts} {ts}Do you want to continue?{/ts}
|
||||
</div>
|
||||
{else}
|
||||
<table class="{if $action eq 4}crm-info-panel{else}form-layout{/if}">
|
||||
<tr class="crm-custom_option-form-block-label">
|
||||
<td class="label">{$form.label.label}{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_option_value' field='label' id=$id}{/if}</td>
|
||||
<td>{$form.label.html}</td>
|
||||
</tr>
|
||||
<tr class="crm-custom_option-form-block-value">
|
||||
<td class="label">{$form.value.label}</td>
|
||||
<td>{$form.value.html}</td>
|
||||
<tr class="crm-custom_option-form-block-weight">
|
||||
<td class="label">{$form.weight.label}</td>
|
||||
<td>{$form.weight.html}</td>
|
||||
</tr>
|
||||
<tr class="crm-custom_option-form-block-is_active">
|
||||
<td class="label">{$form.is_active.label}</td>
|
||||
<td>{$form.is_active.html}</td>
|
||||
</tr>
|
||||
<tr class="crm-custom_option-form-block-default_value">
|
||||
<td class="label">{$form.default_value.label}</td>
|
||||
<td>{$form.default_value.html}<br />
|
||||
<span class="description">{ts}Make this option value 'selected' by default?{/ts}</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
{/if}
|
||||
|
||||
{if $action ne 4}
|
||||
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
|
||||
{else}
|
||||
<div class="crm-submit-buttons">{$form.done.html}</div>
|
||||
{/if} {* $action ne view *}
|
||||
</div>
|
|
@ -0,0 +1,121 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
{* Included in Custom/Form/Field.tpl - used for fields with multiple choice options. *}
|
||||
<tr>
|
||||
<td class="label">{$form.option_type.label}</td>
|
||||
<td class="html-adjust">{$form.option_type.html}<br />
|
||||
<span class="description">{ts}You can create new multiple choice options for this field, or select an existing set of options which you've already created for another custom field.{/ts}</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="option_group" {if !$form.option_group_id}class="hiddenElement"{/if}>
|
||||
<td class="label">{$form.option_group_id.label}</td>
|
||||
<td class="html-adjust">{$form.option_group_id.html}</td>
|
||||
</tr>
|
||||
|
||||
<tr id="multiple">
|
||||
<td colspan="2" class="html-adjust">
|
||||
<fieldset><legend>{ts}Multiple Choice Options{/ts}</legend>
|
||||
<span class="description">
|
||||
{ts}Enter up to ten (10) multiple choice options in this table (click 'another choice' for each additional choice). If you need more than ten options, you can create an unlimited number of additional choices using the Edit Multiple Choice Options link after saving this new field. If desired, you can mark one of the choices as the default choice. The option 'label' is displayed on the form, while the option 'value' is stored in the contact record. The label and value may be the same or different. Inactive options are hidden when the field is presented.{/ts}
|
||||
</span>
|
||||
{strip}
|
||||
<table id="optionField">
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th> {ts}Default{/ts}</th>
|
||||
<th> {ts}Label{/ts}</th>
|
||||
<th> {ts}Value{/ts}</th>
|
||||
<th> {ts}Order{/ts}</th>
|
||||
<th> {ts}Active?{/ts}</th>
|
||||
</tr>
|
||||
|
||||
{section name=rowLoop start=1 loop=12}
|
||||
{assign var=index value=$smarty.section.rowLoop.index}
|
||||
<tr id="optionField_{$index}" class="form-item {cycle values="odd-row,even-row"}">
|
||||
<td>
|
||||
{if $index GT 1}
|
||||
<a onclick="showHideRow({$index}); return false;" name="optionField_{$index}" href="#" class="form-link"><i class="crm-i fa-trash" title="{ts}hide field or section{/ts}"></i></a>
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
<div id="radio{$index}" style="display:none">
|
||||
{$form.default_option[$index].html}
|
||||
</div>
|
||||
<div id="checkbox{$index}" style="display:none">
|
||||
{$form.default_checkbox_option.$index.html}
|
||||
</div>
|
||||
</td>
|
||||
<td> {$form.option_label.$index.html}</td>
|
||||
<td> {$form.option_value.$index.html}</td>
|
||||
<td> {$form.option_weight.$index.html}</td>
|
||||
<td> {$form.option_status.$index.html}</td>
|
||||
</tr>
|
||||
{/section}
|
||||
</table>
|
||||
<div id="optionFieldLink" class="add-remove-link">
|
||||
<a onclick="showHideRow(); return false;" name="optionFieldLink" href="#" class="form-link"><i class="crm-i fa-plus-circle"></i> {ts}add another choice{/ts}</a>
|
||||
</div>
|
||||
<span id="additionalOption" class="description">
|
||||
{ts}If you need additional options - you can add them after you Save your current entries.{/ts}
|
||||
</span>
|
||||
{/strip}
|
||||
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
<script type="text/javascript">
|
||||
var showRows = new Array({$showBlocks});
|
||||
var hideBlocks = new Array({$hideBlocks});
|
||||
var rowcounter = 0;
|
||||
{literal}
|
||||
if (navigator.appName == "Microsoft Internet Explorer") {
|
||||
for ( var count = 0; count < hideBlocks.length; count++ ) {
|
||||
var r = document.getElementById(hideBlocks[count]);
|
||||
r.style.display = 'none';
|
||||
}
|
||||
}
|
||||
{/literal}
|
||||
{* hide and display the appropriate blocks as directed by the php code *}
|
||||
on_load_init_blocks( showRows, hideBlocks, '' );
|
||||
|
||||
{if $form.option_group_id}
|
||||
{literal}
|
||||
function showOptionSelect( ) {
|
||||
if ( document.getElementsByName("option_type")[0].checked ) {
|
||||
cj('#multiple').show();
|
||||
cj('#option_group').hide();
|
||||
} else {
|
||||
cj('#multiple').hide();
|
||||
cj('#option_group').show();
|
||||
}
|
||||
}
|
||||
showOptionSelect( );
|
||||
{/literal}
|
||||
{/if}
|
||||
</script>
|
||||
|
||||
|
104
sites/all/modules/civicrm/templates/CRM/Custom/Form/Preview.tpl
Normal file
104
sites/all/modules/civicrm/templates/CRM/Custom/Form/Preview.tpl
Normal file
|
@ -0,0 +1,104 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
{capture assign=infoTitle}{ts}Preview Mode{/ts}{/capture}
|
||||
{assign var="infoType" value="info"}
|
||||
{if $preview_type eq 'group'}
|
||||
{capture assign=infoMessage}{ts}Showing the custom data group (fieldset) as it will be displayed within an edit form.{/ts}{/capture}
|
||||
{capture name=legend}
|
||||
{foreach from=$groupTree item=fieldName}
|
||||
{$fieldName.title}
|
||||
{/foreach}
|
||||
{/capture}
|
||||
{else}
|
||||
{capture assign=infoMessage}{ts}Showing this field as it will be displayed in an edit form.{/ts}{/capture}
|
||||
{/if}
|
||||
{include file="CRM/common/info.tpl"}
|
||||
<div class="crm-block crm-form-block crm-custom-preview-form-block">
|
||||
{strip}
|
||||
|
||||
{foreach from=$groupTree item=cd_edit key=group_id}
|
||||
<p></p>
|
||||
<fieldset>{if $preview_type eq 'group'}<legend>{$smarty.capture.legend}</legend>{/if}
|
||||
{if $cd_edit.help_pre}<div class="messages help">{$cd_edit.help_pre}</div><br />{/if}
|
||||
<table class="form-layout-compressed">
|
||||
{foreach from=$cd_edit.fields item=element key=field_id}
|
||||
{if $element.is_view eq 0}{* fix for CRM-2699 *}
|
||||
{if $element.help_pre}
|
||||
<tr><td class="label"></td><td class="description">{$element.help_pre}</td></tr>
|
||||
{/if}
|
||||
{if $element.options_per_line }
|
||||
{*assign var="element_name" value=$element.custom_group_id|cat:_|cat:$field_id|cat:_|cat:$element.name*}
|
||||
{assign var="element_name" value=$element.element_name}
|
||||
<tr>
|
||||
<td class="label">{$form.$element_name.label}{if $element.help_post}{help id=$element.id file="CRM/Custom/Form/CustomField.hlp" title=$form.$element_name.label}{/if}</td>
|
||||
<td>
|
||||
{assign var="count" value="1"}
|
||||
<table class="form-layout-compressed">
|
||||
<tr>
|
||||
{* sort by fails for option per line. Added a variable to iterate through the element array*}
|
||||
{assign var="index" value="1"}
|
||||
{foreach name=outer key=key item=item from=$form.$element_name}
|
||||
{if $index < 10}
|
||||
{assign var="index" value=`$index+1`}
|
||||
{else}
|
||||
<td class="labels font-light">{$form.$element_name.$key.html}</td>
|
||||
{if $count == $element.options_per_line}
|
||||
{assign var="count" value="1"}
|
||||
</tr>
|
||||
{else}
|
||||
{assign var="count" value=`$count+1`}
|
||||
{/if}
|
||||
{/if}
|
||||
{/foreach}
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
{else}
|
||||
{assign var="name" value=`$element.name`}
|
||||
{*assign var="element_name" value=$group_id|cat:_|cat:$field_id|cat:_|cat:$element.name*}
|
||||
{assign var="element_name" value=$element.element_name}
|
||||
<tr>
|
||||
<td class="label">{$form.$element_name.label}{if $element.help_post}{help id=$element.id file="CRM/Custom/Form/CustomField.hlp" title=$form.$element_name.label}{/if}</td>
|
||||
<td>
|
||||
{$form.$element_name.html}
|
||||
{if $element.html_type eq 'Autocomplete-Select'}
|
||||
{if $element.data_type eq 'ContactReference'}
|
||||
{include file="CRM/Custom/Form/ContactReference.tpl"}
|
||||
{/if}
|
||||
{/if}
|
||||
</td>
|
||||
{/if}
|
||||
{/if}
|
||||
{/foreach}
|
||||
</table>
|
||||
{if $cd_edit.help_post}<br /><div class="messages help">{$cd_edit.help_post}</div>{/if}
|
||||
</fieldset>
|
||||
{/foreach}
|
||||
{/strip}
|
||||
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 $groupTree}
|
||||
{foreach from=$groupTree item=cd_edit key=group_id}
|
||||
|
||||
<div class="crm-accordion-wrapper crm-contactDetails-accordion {if $form.formName eq 'Advanced' AND $cd_edit.collapse_adv_display eq 1}collapsed{/if}" id="{$cd_edit.name}" >
|
||||
<div class="crm-accordion-header">
|
||||
{$cd_edit.title}
|
||||
</div>
|
||||
<div class="crm-accordion-body">
|
||||
<table class="form-layout-compressed">
|
||||
{foreach from=$cd_edit.fields item=element key=field_id}
|
||||
{assign var="type" value=`$element.html_type`}
|
||||
{assign var="element_name" value='custom_'|cat:$field_id}
|
||||
{assign var="operator_name" value='custom_'|cat:$field_id|cat:'_operator'}
|
||||
{if $element.is_search_range}
|
||||
{assign var="element_name_from" value=$element_name|cat:"_from"}
|
||||
{assign var="element_name_to" value=$element_name|cat:"_to"}
|
||||
<tr>
|
||||
{if $element.data_type neq 'Date'}
|
||||
<td class="label">{$form.$element_name_from.label}</td><td>
|
||||
{$form.$element_name_from.html|crmAddClass:six}
|
||||
{$form.$element_name_to.label} {$form.$element_name_to.html|crmAddClass:six}
|
||||
{elseif $element.skip_calendar NEQ true }
|
||||
<td class="label"><label for='{$element_name}'>{$element.label}</label>
|
||||
{include file="CRM/Core/DateRange.tpl" fieldName=$element_name from='_from' to='_to'}</td><td>
|
||||
{/if}
|
||||
{else}
|
||||
<td class="label">{$form.$element_name.label}</td><td>
|
||||
{$form.$element_name.html}
|
||||
{if !empty($form.$operator_name)}
|
||||
<span class="crm-multivalue-search-op" for="{$element_name}">{$form.$operator_name.html}</span>
|
||||
{assign var="add_multivalue_js" value=true}
|
||||
{/if}
|
||||
{/if}
|
||||
{if $element.html_type eq 'Autocomplete-Select'}
|
||||
{if $element.data_type eq 'ContactReference'}
|
||||
{include file="CRM/Custom/Form/ContactReference.tpl"}
|
||||
{/if}
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
</div><!-- /.crm-accordion-body -->
|
||||
</div><!-- /.crm-accordion-wrapper -->
|
||||
|
||||
{/foreach}
|
||||
{if !empty($add_multivalue_js)}
|
||||
{include file="CRM/Custom/Form/MultiValueSearch.js.tpl"}
|
||||
{/if}
|
||||
{/if}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
{htxt id="upload-title"}
|
||||
{ts}Importing Multi-value Custom Data{/ts}
|
||||
{/htxt}
|
||||
{htxt id="upload"}
|
||||
{ts}The import file should contain a row for each set of custom data fields. For example, if you are importing employment history for a group of contacts, each row might contain columns for Employer, Start Date, End Date, and Position. You will also need a column containing the CiviCRM Contact ID which is used to match each row to the corresponding (existing) CiviCRM contact record. NOTE: Contact IDs are included by default when exporting contacts from CiviCRM.{/ts}
|
||||
{/htxt}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
|
||||
{* Multi-value Custom Data Import Wizard - Step 1 (upload data file) *}
|
||||
{* @var $form Contains the array for the form elements and other form associated information assigned to the template by the controller *}
|
||||
|
||||
<div class="crm-block crm-form-block crm-custom-import-uploadfile-form-block">
|
||||
{* WizardHeader.tpl provides visual display of steps thru the wizard as well as title for current step *}
|
||||
{include file="CRM/common/WizardHeader.tpl"}
|
||||
|
||||
<div class="help">
|
||||
{ts}The Multi-value Custom Data Import Wizard allows you to easily upload data to populate multi-value custom data records (such as employment or education history) for existing contacts.{/ts}
|
||||
{ts}Files to be imported must be in the 'comma-separated-values' format (CSV) and must contain data needed to match the incoming data to an existing contact record in your CiviCRM database.{/ts} {help id='upload'}
|
||||
</div>
|
||||
<div id="upload-file" class="form-item">
|
||||
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
|
||||
<table class="form-layout">
|
||||
<tr class="crm-custom-import-entity-form-block-entity">
|
||||
<td class="label">{$form.entity.label}</td>
|
||||
<td>{$form.entity.html}</td>
|
||||
</tr>
|
||||
<tr class="crm-custom-import-uploadfile-form-block-uploadFile">
|
||||
<td class="label">{$form.uploadFile.label}</td>
|
||||
<td>{$form.uploadFile.html}<br />
|
||||
<span class="description">
|
||||
{ts}File format must be comma-separated-values (CSV).{/ts}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>{ts 1=$uploadSize}Maximum Upload File Size: %1 MB{/ts}</td>
|
||||
</tr>
|
||||
<tr class="crm-import-form-block-skipColumnHeader">
|
||||
<td> </td>
|
||||
<td>{$form.skipColumnHeader.html} {$form.skipColumnHeader.label}<br />
|
||||
<span class="description">
|
||||
{ts}Check this box if the first row of your file consists of field names (Example: "Contact ID", "Participant Role").{/ts}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="crm-custom-import-uploadfile-form-block-multipleCustomData">
|
||||
<td class="label">{$form.multipleCustomData.label}</dt>
|
||||
<td><span>{$form.multipleCustomData.html}</span> </td>
|
||||
</tr>
|
||||
<tr class="crm-custom-import-uploadfile-from-block-contactType">
|
||||
<td class="label">{$form.contactType.label}</td>
|
||||
<td>{$form.contactType.html}<br />
|
||||
<span class="description">
|
||||
{ts}Select 'Individual' if you are importing custom data for individual persons.{/ts}
|
||||
{ts}Select 'Organization' or 'Household' if you are importing custom data . (NOTE: Some built-in contact types may not be enabled for your site.){/ts}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="crm-import-datasource-form-block-fieldSeparator">
|
||||
<td class="label">{$form.fieldSeparator.label} {help id='id-fieldSeparator' file='CRM/Contact/Import/Form/DataSource'}</td>
|
||||
<td>{$form.fieldSeparator.html}</td>
|
||||
</tr>
|
||||
<tr class="crm-custom-import-uploadfile-form-block-date_format">
|
||||
{include file="CRM/Core/Date.tpl"}
|
||||
</tr>
|
||||
{if $savedMapping}
|
||||
<tr class="crm-custom-import-uploadfile-form-block-savedMapping">
|
||||
<td class="label">{if $loadedMapping}{ts}Select a Different Field Mapping{/ts}{else}{ts}Load Saved Field Mapping{/ts}{/if}</dt>
|
||||
<td><span>{$form.savedMapping.html}</span> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td class="description">{ts}Select Saved Mapping, or leave blank to create a new mapping.{/ts}</td>
|
||||
{/if}
|
||||
</tr>
|
||||
</table>
|
||||
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,26 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
{include file="CRM/Contact/Import/Form/MapField.tpl"}
|
|
@ -0,0 +1,26 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
{include file="CRM/Contribute/Import/Form/Preview.tpl"}
|
|
@ -0,0 +1,26 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
{include file="CRM/Contact/Import/Form/Summary.tpl"}
|
|
@ -0,0 +1,192 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
{* Custom Data view mode*}
|
||||
{assign var="showEdit" value=1}
|
||||
{assign var="rowCount" value=1}
|
||||
{foreach from=$viewCustomData item=customValues key=customGroupId}
|
||||
{foreach from=$customValues item=cd_edit key=cvID}
|
||||
{crmRegion name="custom-data-view-`$cd_edit.name`"}
|
||||
{if $cd_edit.help_pre}
|
||||
<div class="messages help">{$cd_edit.help_pre}</div>
|
||||
{/if}
|
||||
{if $multiRecordDisplay neq 'single'}
|
||||
<table class="no-border">
|
||||
{assign var='index' value=$groupId|cat:"_$cvID"}
|
||||
{if ($showEdit && $cd_edit.editable && $groupId) && ($editOwnCustomData or $editCustomData)}
|
||||
<tr>
|
||||
<td>
|
||||
<a
|
||||
href="{crmURL p="civicrm/contact/view/cd/edit" q="tableId=`$contactId`&cid=`$contactId`&groupID=`$groupId`&action=update&reset=1"}"
|
||||
class="button" style="margin-left: 6px;"><span><i class="crm-i fa-pencil"></i> {ts 1=$cd_edit.title}Edit %1{/ts}</span></a><br/><br/>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{assign var="showEdit" value=0}
|
||||
<tr>
|
||||
<td id="{$cd_edit.name}_{$index}" class="section-shown form-item">
|
||||
<div class="crm-accordion-wrapper {if $cd_edit.collapse_display eq 0 or $skipTitle} {else}collapsed{/if}">
|
||||
{if !$skipTitle}
|
||||
<div class="crm-accordion-header">
|
||||
{$cd_edit.title}
|
||||
</div>
|
||||
{/if}
|
||||
<div class="crm-accordion-body">
|
||||
{if $groupId and $cvID and $editCustomData and $cd_edit.editable}
|
||||
<div class="crm-submit-buttons">
|
||||
<a href="#" class="crm-hover-button crm-custom-value-del"
|
||||
data-post='{ldelim}"valueID": "{$cvID}", "groupID": "{$customGroupId}", "contactId": "{$contactId}", "key": "{crmKey name='civicrm/ajax/customvalue'}"{rdelim}'
|
||||
title="{ts 1=$cd_edit.title|cat:" `$rowCount`"}Delete %1{/ts}">
|
||||
<i class="crm-i fa-trash"></i> {ts}Delete{/ts}
|
||||
</a>
|
||||
</div>
|
||||
{/if}
|
||||
{foreach from=$cd_edit.fields item=element key=field_id}
|
||||
<table class="crm-info-panel">
|
||||
<tr>
|
||||
{if $element.options_per_line != 0}
|
||||
<td class="label">{$element.field_title}</td>
|
||||
<td class="html-adjust">
|
||||
{* sort by fails for option per line. Added a variable to iterate through the element array*}
|
||||
{foreach from=$element.field_value item=val}
|
||||
{$val}
|
||||
<br/>
|
||||
{/foreach}
|
||||
</td>
|
||||
{else}
|
||||
<td class="label">{$element.field_title}</td>
|
||||
{if $element.field_data_type == 'Money'}
|
||||
{if $element.field_type == 'Text'}
|
||||
<td class="html-adjust">{$element.field_value|crmMoney}</td>
|
||||
{else}
|
||||
<td class="html-adjust">{$element.field_value}</td>
|
||||
{/if}
|
||||
{else}
|
||||
<td class="html-adjust">
|
||||
{if $element.contact_ref_id}
|
||||
<a href='{crmURL p="civicrm/contact/view" q="reset=1&cid=`$element.contact_ref_id`"}'>
|
||||
{/if}
|
||||
{if $element.field_data_type == 'Memo'}
|
||||
{$element.field_value|nl2br}
|
||||
{else}
|
||||
{$element.field_value}
|
||||
{/if}
|
||||
{if $element.contact_ref_id}
|
||||
</a>
|
||||
{/if}
|
||||
</td>
|
||||
{/if}
|
||||
{/if}
|
||||
</tr>
|
||||
</table>
|
||||
{/foreach}
|
||||
{assign var="rowCount" value=$rowCount+1}
|
||||
</div>
|
||||
<!-- end of body -->
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<!-- end of main accordion -->
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{else}
|
||||
{foreach from=$cd_edit.fields item=element key=field_id}
|
||||
<div class="crm-section">
|
||||
{if $element.options_per_line != 0}
|
||||
<div class="label">{$element.field_title}</div>
|
||||
<div class="content">
|
||||
{* sort by fails for option per line. Added a variable to iterate through the element array*}
|
||||
{foreach from=$element.field_value item=val}
|
||||
{$val}
|
||||
<br/>
|
||||
{/foreach}
|
||||
</div>
|
||||
{else}
|
||||
<div class="label">{$element.field_title}</div>
|
||||
{if $element.field_type == 'File'}
|
||||
<div class="content">
|
||||
{if $element.field_value}
|
||||
{$element.field_value}
|
||||
{else}
|
||||
<br/>
|
||||
{/if}
|
||||
</div>
|
||||
{else}
|
||||
{if $element.field_data_type == 'Money'}
|
||||
{if $element.field_type == 'Text'}
|
||||
<div class="content">{if $element.field_value}{$element.field_value|crmMoney}{else}<br/>{/if}</div>
|
||||
{else}
|
||||
<div class="content">{if $element.field_value}{$element.field_value}{else}<br/>{/if}</div>
|
||||
{/if}
|
||||
{else}
|
||||
<div class="content">
|
||||
{if $element.contact_ref_id}
|
||||
<a href='{crmURL p="civicrm/contact/view" q="reset=1&cid=`$element.contact_ref_id`"}'>
|
||||
{/if}
|
||||
{if $element.field_data_type == 'Memo'}
|
||||
{$element.field_value|nl2br}
|
||||
{else}
|
||||
{if $element.field_value}{$element.field_value} {else}<br/>{/if}
|
||||
{/if}
|
||||
{if $element.contact_ref_id}
|
||||
</a>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
{if $cd_edit.help_post}
|
||||
<div class="messages help">{$cd_edit.help_post}</div>
|
||||
{/if}
|
||||
{/crmRegion}
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
{*currently delete is available only for tab custom data*}
|
||||
{if $groupId}
|
||||
<script type="text/javascript">
|
||||
{literal}
|
||||
CRM.$(function($) {
|
||||
// Handle delete of multi-record custom data
|
||||
$('#crm-container')
|
||||
.off('.customValueDel')
|
||||
.on('click.customValueDel', '.crm-custom-value-del', function(e) {
|
||||
e.preventDefault();
|
||||
var $el = $(this),
|
||||
msg = '{/literal}{ts escape="js"}The record will be deleted immediately. This action cannot be undone.{/ts}{literal}';
|
||||
CRM.confirm({title: $el.attr('title'), message: msg})
|
||||
.on('crmConfirm:yes', function() {
|
||||
var url = CRM.url('civicrm/ajax/customvalue');
|
||||
var request = $.post(url, $el.data('post'))
|
||||
.done(CRM.refreshParent($el));
|
||||
CRM.status({success: '{/literal}{ts escape="js"}Record Deleted{/ts}{literal}'}, request);
|
||||
});
|
||||
});
|
||||
});
|
||||
{/literal}
|
||||
</script>
|
||||
{/if}
|
|
@ -0,0 +1,83 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 $action eq 1 or $action eq 2 or $action eq 4}
|
||||
{include file="CRM/Custom/Form/Field.tpl"}
|
||||
{elseif $action eq 8}
|
||||
{include file="CRM/Custom/Form/DeleteField.tpl"}
|
||||
{elseif $action eq 1024 }
|
||||
{include file="CRM/Custom/Form/Preview.tpl"}
|
||||
{else}
|
||||
{if $customField}
|
||||
|
||||
<div id="field_page">
|
||||
{strip}
|
||||
{* handle enable/disable actions*}
|
||||
{include file="CRM/common/enableDisableApi.tpl"}
|
||||
<table id="options" class="row-highlight">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{ts}Field Label{/ts}</th>
|
||||
<th>{ts}Data Type{/ts}</th>
|
||||
<th>{ts}Field Type{/ts}</th>
|
||||
<th>{ts}Order{/ts}</th>
|
||||
<th>{ts}Req?{/ts}</th>
|
||||
<th>{ts}Searchable?{/ts}</th>
|
||||
<th>{ts}Enabled?{/ts}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$customField item=row}
|
||||
<tr id="CustomField-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"}{if NOT $row.is_active} disabled{/if}">
|
||||
<td class="crm-editable" data-field="label">{$row.label}</td>
|
||||
<td>{$row.data_type}</td>
|
||||
<td>{$row.html_type}</td>
|
||||
<td class="nowrap">{$row.weight}</td>
|
||||
<td class="crm-editable" data-type="boolean" data-field="is_required">{if $row.is_required eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
|
||||
<td class="crm-editable" data-type="boolean" data-field="is_searchable">{if $row.is_searchable eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
|
||||
<td>{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
|
||||
<td>{$row.action|replace:'xx':$row.id}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{/strip}
|
||||
|
||||
</div>
|
||||
|
||||
{else}
|
||||
{if $action eq 16}
|
||||
<div class="messages status no-popup crm-empty-table">
|
||||
<img src="{$config->resourceBase}i/Inform.gif" alt="{ts}status{/ts}"/>
|
||||
{ts}None found.{/ts}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
<div class="action-link">
|
||||
{crmButton p='civicrm/admin/custom/group/field/add' q="reset=1&action=add&gid=$gid" id="newCustomField" class="action-item" icon="plus-circle"}{ts}Add Custom Field{/ts}{/crmButton}
|
||||
{crmButton p="civicrm/admin/custom/group" q="reset=1" class="cancel" icon="times"}{ts}Done{/ts}{/crmButton}
|
||||
</div>
|
||||
{/if}
|
115
sites/all/modules/civicrm/templates/CRM/Custom/Page/Group.hlp
Normal file
115
sites/all/modules/civicrm/templates/CRM/Custom/Page/Group.hlp
Normal file
|
@ -0,0 +1,115 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
{htxt id="id-group_intro-title"}
|
||||
{ts}Custom Fields{/ts}
|
||||
{/htxt}
|
||||
{htxt id="id-group_intro"}
|
||||
{ts}Use this form to set the title, the type of record the fields will be used for, and set-level help. You will then be able to add any number of fields to the set.{/ts} {docURL page="user/organising-your-data/custom-fields"}
|
||||
{/htxt}
|
||||
|
||||
{htxt id="id-title-title"}
|
||||
{ts}Title{/ts}
|
||||
{/htxt}
|
||||
{htxt id="id-title"}
|
||||
{ts}For 'inline' display custom sets, this title will appear as the fieldset legend. If you choose the 'tab' display style (which is available for Contact record custom fields), the title will be used for the navigation tab.{/ts}
|
||||
{/htxt}
|
||||
|
||||
{htxt id="id-display_style-title"}
|
||||
{ts}Display Style{/ts}
|
||||
{/htxt}
|
||||
{htxt id="id-display_style"}
|
||||
{ts}Select 'Inline' to include this set of fields in the main contact Add/Edit form and Contact Summary screens. Select 'Tab' or 'Tab with Table' to create a separate navigation tab for display and editing these values (generally for less frequently accessed and/or larger sets of fields). 'Tab with Table' is recommended for customs data sets which allow multiple records.{/ts}
|
||||
<p class="font-italic">{ts}NOTE: This setting applies only to custom sets used for Contact records (e.g. Individuals, Households, Organizations, or ALL contact types).{/ts}</p>
|
||||
{/htxt}
|
||||
|
||||
{htxt id="id-extends-title"}
|
||||
{ts}Entity Type{/ts}
|
||||
{/htxt}
|
||||
{htxt id="id-extends"}
|
||||
{ts}Select the type of record that this set of custom fields is applicable for. You can configure custom data for a specific type of contact (e.g. Individuals but NOT Organizations), ANY type of contact, or other record types such as activities, contributions, memberships and event participants.{/ts}
|
||||
<p>{ts}EXAMPLE: If you are using CiviEvent, and you want to collect information from people registering for your events, select "Participants". If the information is specific to one type of participant (e.g. event volunteers), select "Participants (role)" and then select the role (e.g. 'Volunteer').{/ts}</p>
|
||||
<p>{ts}If your site uses Contact Subtypes, you can assign this set of custom fields to a specific subtype (e.g. 'Student'), OR you can select '- Any -' which makes the fields available to contacts of the parent type (e.g. 'Individual') as well as to any subtypes.{/ts}</p>
|
||||
{/htxt}
|
||||
|
||||
{capture assign=importMultipleURL}{crmURL p="civicrm/import/custom" q="reset=1"}{/capture}
|
||||
{htxt id=id-is_multiple-title"}
|
||||
{ts}Allow Multiple Records{/ts}
|
||||
{/htxt}
|
||||
{htxt id=id-is_multiple"}
|
||||
<p>{ts}Checking this box allows you to enter multiple sets of values for a given contact.{/ts}</p>
|
||||
<p>{ts}<strong>EXAMPLE:</strong> When creating a set of custom fields used to collect <strong>Employment History</strong> - you might have fields for Job Title, Start Date, End Date, and Reason for Leaving. Checking the "multiple records" box allows you to collect information for multiple jobs.{/ts}</p>
|
||||
<p>{ts}You can also set the maximum number of records which can be recorded per contact. Using the previous example, you might only want data for the three most recent jobs.{/ts}</p>
|
||||
<p>{ts 1=$importMultipleURL}Use the <a href="%1">Multi-value Custom Data Import tool</a> to import data into multiple record custom fields (contact records must already exist).{/ts}</p>
|
||||
<p>
|
||||
{ts}CAUTION: The following features are NOT available for custom fields in 'multiple record' custom set:{/ts}
|
||||
<ul>
|
||||
<li>{ts}They can not be Exported{/ts}</li>
|
||||
<li>{ts}If they are included in a report as a display column, only the first set of values are shown.{/ts}</li>
|
||||
</ul>
|
||||
</p>
|
||||
{/htxt}
|
||||
|
||||
{htxt id=id-max_multiple-title"}
|
||||
{ts}Maximum Records{/ts}
|
||||
{/htxt}
|
||||
{htxt id=id-max_multiple"}
|
||||
{ts}If you want to set a specific limit on the maximum number of records, enter that number. Otherwise leave this field blank.{/ts}
|
||||
{/htxt}
|
||||
|
||||
{htxt id="id-weight-title"}
|
||||
{ts}Weight{/ts}
|
||||
{/htxt}
|
||||
{htxt id="id-weight"}
|
||||
{ts}Weight controls the order in which custom field sets are presented when there are more than one. Enter a positive or negative integer - lower numbers are displayed ahead of higher numbers.{/ts}
|
||||
{/htxt}
|
||||
|
||||
{htxt id="id-collapse-title"}
|
||||
{ts}Collapsed on Page{/ts}
|
||||
{/htxt}
|
||||
{htxt id="id-collapse"}
|
||||
{ts}Check this box if you want only the title for this fieldset to be displayed when the page is initially loaded (fields are hidden).{/ts}
|
||||
{/htxt}
|
||||
|
||||
{htxt id="id-collapse-adv-title"}
|
||||
{ts}Collapsed on Search{/ts}
|
||||
{/htxt}
|
||||
{htxt id="id-collapse-adv"}
|
||||
{ts}Check this box if you want only the title for this fieldset to be displayed when the page is initially loaded (fields are hidden) on advanced search.{/ts}
|
||||
{/htxt}
|
||||
|
||||
{htxt id="id-help_pre-title"}
|
||||
{ts}Pre Help{/ts}
|
||||
{/htxt}
|
||||
{htxt id="id-help_pre"}
|
||||
{ts}Explanatory text displayed at the beginning of this sets of fields.{/ts}
|
||||
{/htxt}
|
||||
|
||||
{htxt id="id-help_post-title"}
|
||||
{ts}Post Help{/ts}
|
||||
{/htxt}
|
||||
{htxt id="id-help_post"}
|
||||
{ts}Explanatory text displayed below this set of fields.{/ts}
|
||||
{/htxt}
|
|
@ -0,0 +1,89 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
{* The name "custom data group" is replaced by "custom data set" *}
|
||||
{if $action eq 1 or $action eq 2 or $action eq 4}
|
||||
{include file="CRM/Custom/Form/Group.tpl"}
|
||||
{elseif $action eq 1024}
|
||||
{include file="CRM/Custom/Form/Preview.tpl"}
|
||||
{elseif $action eq 8}
|
||||
{include file="CRM/Custom/Form/DeleteGroup.tpl"}
|
||||
{else}
|
||||
<div class="help">
|
||||
{ts}Custom data is stored in custom fields. Custom fields are organized into logically related custom data sets (e.g. Volunteer Info). Use custom fields to collect and store custom data which are not included in the standard CiviCRM forms. You can create one or many sets of custom fields.{/ts} {docURL page="user/organising-your-data/custom-fields"}
|
||||
</div>
|
||||
|
||||
{if $rows}
|
||||
<div class="crm-content-block crm-block">
|
||||
<div id="custom_group">
|
||||
{strip}
|
||||
{* handle enable/disable actions*}
|
||||
{include file="CRM/common/enableDisableApi.tpl"}
|
||||
<table id="options" class="row-highlight">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{ts}Set{/ts}</th>
|
||||
<th>{ts}Enabled?{/ts}</th>
|
||||
<th>{ts}Used For{/ts}</th>
|
||||
<th>{ts}Type{/ts}</th>
|
||||
<th>{ts}Order{/ts}</th>
|
||||
<th>{ts}Style{/ts}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$rows item=row}
|
||||
<tr id="CustomGroup-{$row.id}" data-action="setvalue" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
|
||||
<td class="crmf-title crm-editable">{$row.title}</td>
|
||||
<td id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
|
||||
<td>{if $row.extends eq 'Contact'}{ts}All Contact Types{/ts}{else}{$row.extends_display}{/if}</td>
|
||||
<td>{$row.extends_entity_column_value}</td>
|
||||
<td class="nowrap">{$row.weight}</td>
|
||||
<td>{$row.style_display}</td>
|
||||
<td>{$row.action|replace:'xx':$row.id}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{if NOT ($action eq 1 or $action eq 2) }
|
||||
<div class="action-link">
|
||||
{crmButton p='civicrm/admin/custom/group' q="action=add&reset=1" id="newCustomDataGroup" icon="plus-circle"}{ts}Add Set of Custom Fields{/ts}{/crmButton}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{/strip}
|
||||
</div>
|
||||
</div>
|
||||
{else}
|
||||
{if $action ne 1} {* When we are adding an item, we should not display this message *}
|
||||
<div class="messages status no-popup">
|
||||
<img src="{$config->resourceBase}i/Inform.gif" alt="{ts}status{/ts}"/>
|
||||
{capture assign=crmURL}{crmURL p='civicrm/admin/custom/group' q='action=add&reset=1'}{/capture}
|
||||
{ts 1=$crmURL}No custom data groups have been created yet. You can <a id="newCustomDataGroup" href='%1'>add one</a>.{/ts}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
{/if}
|
166
sites/all/modules/civicrm/templates/CRM/Custom/Page/Option.tpl
Normal file
166
sites/all/modules/civicrm/templates/CRM/Custom/Page/Option.tpl
Normal file
|
@ -0,0 +1,166 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 $action eq 1 or $action eq 2 or $action eq 4 or $action eq 8}
|
||||
{include file="CRM/Custom/Form/Option.tpl"}
|
||||
{else}
|
||||
{if $reusedNames}
|
||||
<div class="message status">
|
||||
<div class="icon inform-icon"></div> {ts 1=$reusedNames}These Multiple Choice Options are shared by the following custom fields: %1{/ts}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div id="field_page">
|
||||
<p></p>
|
||||
<div class="form-item">
|
||||
{* handle enable/disable actions*}
|
||||
{include file="CRM/common/enableDisableApi.tpl"}
|
||||
<table class="crm-option-selector">
|
||||
<thead>
|
||||
<tr class="columnheader">
|
||||
<th class='crm-custom_option-label'>{ts}Label{/ts}</th>
|
||||
<th class='crm-custom_option-value'>{ts}Value{/ts}</th>
|
||||
<th class='crm-custom_option-default_value'>{ts}Default{/ts}</th>
|
||||
<th class='crm-custom_option-is_active'>{ts}Enabled?{/ts}</th>
|
||||
<th class='crm-custom_option-links'> </th>
|
||||
<th class='hiddenElement'> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
CRM.$(function($) {
|
||||
var crmOptionSelector;
|
||||
|
||||
buildOptions();
|
||||
|
||||
function buildOptions() {
|
||||
var sourceUrl = {/literal}'{crmURL p="civicrm/ajax/optionlist" h=0 q="snippet=4&fid=$fid&gid=$gid"}'{literal};
|
||||
var $context = $('.crm-container');
|
||||
var ZeroRecordText = {/literal}'{ts escape="js"}None found.{/ts}'{literal};
|
||||
|
||||
crmOptionSelector = $('table.crm-option-selector', $context).dataTable({
|
||||
"destroy" : true,
|
||||
"bFilter" : false,
|
||||
"bAutoWidth" : false,
|
||||
"aaSorting" : [],
|
||||
"aoColumns" : [
|
||||
{sClass:'crm-custom_option-label'},
|
||||
{sClass:'crm-custom_option-value'},
|
||||
{sClass:'crm-custom_option-default_value'},
|
||||
{sClass:'crm-custom_option-is_active'},
|
||||
{sClass:'crm-custom_option-links'},
|
||||
{sClass:'hiddenElement'}
|
||||
],
|
||||
"bProcessing": true,
|
||||
"asStripClasses" : [ "odd-row", "even-row" ],
|
||||
"sPaginationType": "full_numbers",
|
||||
"sDom" : '<"crm-datatable-pager-top"lfp>rt<"crm-datatable-pager-bottom"ip>',
|
||||
"bServerSide": true,
|
||||
"bJQueryUI": true,
|
||||
"bSort" : false,
|
||||
"sAjaxSource": sourceUrl,
|
||||
"iDisplayLength": 10,
|
||||
"oLanguage": {
|
||||
"sZeroRecords": ZeroRecordText,
|
||||
"sProcessing": {/literal}"{ts escape='js'}Processing...{/ts}"{literal},
|
||||
"sLengthMenu": {/literal}"{ts escape='js'}Show _MENU_ entries{/ts}"{literal},
|
||||
"sInfo": {/literal}"{ts escape='js'}Showing _START_ to _END_ of _TOTAL_ entries{/ts}"{literal},
|
||||
"oPaginate": {
|
||||
"sFirst": {/literal}"{ts escape='js'}First{/ts}"{literal},
|
||||
"sPrevious": {/literal}"{ts escape='js'}Previous{/ts}"{literal},
|
||||
"sNext": {/literal}"{ts escape='js'}Next{/ts}"{literal},
|
||||
"sLast": {/literal}"{ts escape='js'}Last{/ts}"{literal}
|
||||
}
|
||||
},
|
||||
"fnRowCallback": function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
|
||||
var id = $('td:last', nRow).text().split(',')[0];
|
||||
var cl = $('td:last', nRow).text().split(',')[1];
|
||||
$(nRow).addClass(cl).attr({id: 'OptionValue-' + id});
|
||||
$('td:eq(0)', nRow).wrapInner('<span class="crm-editable crmf-label" />');
|
||||
$('td:eq(0)', nRow).prepend('<span class="crm-i fa-arrows crm-grip" />');
|
||||
$('td:eq(2)', nRow).addClass('crmf-default_value');
|
||||
return nRow;
|
||||
},
|
||||
"fnDrawCallback": function() {
|
||||
$(this).trigger('crmLoad');
|
||||
},
|
||||
|
||||
"fnServerData": function ( sSource, aoData, fnCallback ) {
|
||||
$.ajax( {
|
||||
"dataType": 'json',
|
||||
"type": "POST",
|
||||
"url": sSource,
|
||||
"data": aoData,
|
||||
"success": fnCallback
|
||||
} );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var startPosition;
|
||||
var endPosition;
|
||||
var gid = {/literal}'{$optionGroupID}'{literal};
|
||||
|
||||
$("table.crm-option-selector tbody").sortable({
|
||||
handle: ".fa-arrows",
|
||||
cursor: "move",
|
||||
start:function(event, ui) {
|
||||
var oSettings = $('table.crm-option-selector').dataTable().fnSettings();
|
||||
var index = oSettings._iDisplayStart;
|
||||
startPosition = index + ui.item.prevAll().length + 1;
|
||||
},
|
||||
update: function(event, ui) {
|
||||
var oSettings = $('table.crm-option-selector').dataTable().fnSettings();
|
||||
var index = oSettings._iDisplayStart;
|
||||
endPosition = index + ui.item.prevAll().length + 1;
|
||||
|
||||
CRM.status({}, $.getJSON(CRM.url('civicrm/ajax/reorder'), {
|
||||
returnFormat:'JSON',
|
||||
start:startPosition,
|
||||
end: endPosition,
|
||||
gid: gid
|
||||
}))
|
||||
.success(function() {
|
||||
$("table.crm-option-selector tbody tr").each(function(i) {
|
||||
$(this).removeClass('odd even').addClass(i % 2 ? 'even' : 'odd');
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
{/literal}
|
||||
|
||||
<div class="action-link">
|
||||
{crmButton q="reset=1&action=map&fid=$fid&gid=$gid" class="action-item open-inline-noreturn" icon="sort-alpha-asc"}{ts}Alphabetize Options{/ts}{/crmButton}
|
||||
{crmButton q="reset=1&action=add&fid=$fid&gid=$gid" class="action-item" icon="plus-circle"}{ts}Add Option{/ts}{/crmButton}
|
||||
{crmButton p="civicrm/admin/custom/group/field" q="reset=1&action=browse&gid=$gid" class="action-item cancel" icon="times"}{ts}Done{/ts}{/crmButton}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
Loading…
Add table
Add a link
Reference in a new issue