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}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue