First commit

This commit is contained in:
Theodotos Andreou 2018-01-14 13:10:16 +00:00
commit c6e2478c40
13918 changed files with 2303184 additions and 0 deletions

View file

@ -0,0 +1,109 @@
{*
+--------------------------------------------------------------------+
| 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-negative-title"}
{ts}Negative Amounts{/ts}
{/htxt}
{htxt id="id-negative"}
{ts}You may enter a negative amount value if the field or option is being used to discount the total price. Use a price of 1 and Display Amount off (unchecked) to allow a user to enter a contribution amount in a Text / Numeric Quantity field.{/ts}
{/htxt}
{htxt id="id-negative-options-title"}
{ts}Negative Options{/ts}
{/htxt}
{htxt id="id-negative-options"}
{ts}You may enter a negative amount value if the field or option is being used to discount the total price.{/ts}
{/htxt}
{htxt id="id-visibility-options-title"}
{ts}Visibility per Option{/ts}
{/htxt}
{htxt id="id-visibility-options"}
{ts}Select between Admin/Public for each option. 'Public' will show the option to all users accessing the price set. Use 'Admin' to limit the option to users with the 'CiviEvent: edit event participants permission (when viewing the field via the event registration pages) or the CiviContribute: edit contributions permission (when accessing the field through a contribution page).{/ts}
{/htxt}
{htxt id="id-participant-count-title"}
{ts}Participant Count{/ts}
{/htxt}
{htxt id="id-participant-count"}
<p>{ts}Enter a value here if you want to increment the number of registered participants per unit against the maximum number of participants allowed for this event. For example, if this price field is for a table at a fundraiser which seats eight people, you would set Participant Count to 8.{/ts}</p>
<p>{ts}If you do not want this option to increment the participant count for the event you can still restrict how many times this particular option can be chosen. Leave this field empty and enter a value in the adjacent Max Participants box. For example, if you leave this empty and set the adjacent Max Participant = 20, only 20 registrants can choose this option before it becomes unavailable to online registrants.{/ts}</p>
{/htxt}
{htxt id="id-participant-max-title"}
{ts}Participant Limit{/ts}
{/htxt}
{htxt id="id-participant-max"}
{ts}If you want to limit the number of participants who can chose this option, enter that number here. This limit is separate from the maximum number of participants allowed to register for the event (you can set that number from Configure Event > Info and Settings). {/ts}
{/htxt}
{htxt id="id-visibility-title"}
{ts}Visibility{/ts}
{/htxt}
{htxt id="id-visibility"}
{ts}Fields with 'Public' visibility will be displayed on your Event Information page AND will be available in the online registration (self-service) form. For some events you may want to allow staff to select special options with special pricing and / or discounts (using negative price set field values). Select 'Admin' visibility for these Price Fields. They will only be included when staff or volunteers are registering participants from the back-office 'Register Event Participants' screen. If the parent price field visibility is Public then it should be possible to set individual price options as 'Admin', but it should have at least one 'Public' option. If the parent price field visibility is 'Admin', then all the price field options should be set to 'Admin', including any new options added to the form.{/ts}
{/htxt}
{htxt id="id-member-price-options-title"}
{ts}Price Options{/ts}
{/htxt}
{htxt id="id-member-price-options"}
<p>
{ts}Create an option row for each membership type you want to offer as a choice. The option Label and Amount columns will be automatically filled with the selected membership type name and associated fee. However you can over-ride these values as needed. For example, you can create an option for a special discount on a particular membership.{/ts}
</p>
<p>
{ts}Leave the Membership Type blank for additional non-membership options (e.g. magazine subscription).{/ts}
</p>
<p>
{ts}Generally you will create a separate price field for each non-overlapping "class" of membership (e.g. National membership vs. Local Chapter membership).{/ts}<br />
{ts}EXAMPLE: A price set with 3 price fields. National membership (with 3 price options - radio button style), Regional membership (checkbox), and an optional magazine subscription.{/ts}
<br />
<table>
<tr>
<td>{ts}National Membership{/ts} :</td><td>[ x ] {ts}General{/ts} $ 125.00</td>
</tr>
<tr><td></td><td>[ ] {ts}Student{/ts} $ 50.00</td></tr>
<tr><td></td><td>[ ] {ts}Senior{/ts} $ 75.00</td></tr>
<tr><td colspan=2></td></tr>
<tr><td>{ts}Join your local chapter{/ts}</td><td>[ x ] $15.00</td></tr>
<tr><td>{ts}Subscribe to Green Times{/ts}</td><td>[ x ] $35.00</td></tr>
</table>
</p>
<p>
{ts}Auto-renew Memberships - You can offer constituents the option to have their membership renewed automatically AND use the membership price set feature if:{/ts} <ul>
<li>{ts}You are using a payment processor that supports auto-renewals.{/ts}</li>
<li>{ts}All membership types in the price set have the auto-renew feature enabled (Administer > CiviMember > Membership Types){/ts}.</li>
<li>{ts}All membership types in the price set have the same duration (e.g. they are one year memberships).{/ts}<li>
</ul>
{ts}These constraints are due to the fact that when a constituent signs up for multiple memberships using a price set - a single recurring payment record is created which covers the total fees for all selected memberships.{/ts}
</p>
{/htxt}
{htxt id="id-membership-type-title"}
{ts}Membership Type{/ts}
{/htxt}
{htxt id="id-membership-type"}
{ts}If you select a membership type, a membership will be created or renewed when users select this option. Leave this column blank for non-membership options (e.g. magazine subscription).{/ts}
{/htxt}

View file

@ -0,0 +1,114 @@
{*
+--------------------------------------------------------------------+
| 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) and !$isReserved}
{include file="CRM/Price/Form/Field.tpl"}
{elseif $action eq 8 and !$usedBy and !$isReserved}
{include file="CRM/Price/Form/DeleteField.tpl"}
{elseif $action eq 1024 }
{include file="CRM/Price/Form/Preview.tpl"}
{elseif ($usedBy and $action eq 8) or $usedBy.civicrm_event or $usedBy.civicrm_contribution_page}
<div id="price_set_used_by" class="messages status no-popup">
<div class="icon inform-icon"></div>
{if $action eq 8}
{ts 1=$usedPriceSetTitle}Unable to delete the '%1' Price Field - it is currently in use by one or more active events or contribution pages or contributions or event templates.{/ts}
{/if}
{if $usedBy.civicrm_event or $usedBy.civicrm_contribution_page or $usedBy.civicrm_event_template}
{include file="CRM/Price/Page/table.tpl"}
{/if}
</div>
{/if}
{if $action NEQ 8 and $priceField}
<div class="action-link">
{if !$isReserved}
{crmButton q="reset=1&action=add&sid=$sid" id="newPriceField" icon="plus-circle"}{ts}Add Price Field{/ts}{/crmButton}
{/if}
{crmButton p="civicrm/admin/price" q="action=preview&sid=`$sid`&reset=1&context=field" icon="television"}{ts}Preview (all fields){/ts}{/crmButton}
</div>
<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}Field Type{/ts}</th>
<th>{ts}Order{/ts}</th>
<th>{ts}Req?{/ts}</th>
<th>{ts}Enabled?{/ts}</th>
<th>{ts}Active On{/ts}</th>
<th>{ts}Expire On{/ts}</th>
<th>{ts}Price{/ts}</th>
{if $getTaxDetails}
<th>{ts}Tax Label{/ts}</th>
<th>{ts}Tax Amount{/ts}</th>
{/if}
<th></th>
</tr>
</thead>
{foreach from=$priceField key=fid item=row}
<tr id="price_field-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
<td class="crm-editable" data-field="label">{$row.label}</td>
<td>{$row.html_type_display}</td>
<td class="nowrap">{$row.weight}</td>
<td class="crm-editable" data-field="is_required" data-type="boolean">{if $row.is_required eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</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.active_on}{$row.active_on|date_format:"%Y-%m-%d %T"}{/if}</td>
<td>{if $row.expire_on}{$row.expire_on|date_format:"%Y-%m-%d %T"}{/if}</td>
<td>{if $row.html_type eq "Text"}{$row.price|crmMoney}{else}<a class="action-item" href="{crmURL p="civicrm/admin/price/field/option" q="action=browse&reset=1&sid=$sid&fid=$fid"}">{if $isReserved}{ts}View Price Options{/ts}{else}{ts}Edit Price Options{/ts}{/if}</a>{/if}</td>
{if $getTaxDetails}
<td>{if $row.tax_rate != '' && $row.html_type eq "Text / Numeric Quantity"}
{$taxTerm} ({$row.tax_rate|string_format:"%.2f"}%)
{/if}
</td>
<td>{if $row.html_type eq "Text / Numeric Quantity" }{$row.tax_amount|crmMoney}{/if}</td>
{/if}
<td class="field-action">{$row.action|replace:'xx':$row.id}</td>
</tr>
{/foreach}
</table>
{/strip}
</div>
<div class="action-link">
{if !$isReserved}
{crmButton q="reset=1&action=add&sid=$sid" id="newPriceField" icon="plus-circle"}{ts}Add Price Field{/ts}{/crmButton}
{/if}
{crmButton p="civicrm/admin/price" q="action=preview&sid=`$sid`&reset=1&context=field" icon="television"}{ts}Preview (all fields){/ts}{/crmButton}
</div>
{else}
{if $action eq 16}
<div class="messages status no-popup crm-empty-table">
<div class="icon inform-icon"></div>
{ts}None found.{/ts}
</div>
<div class="action-link">
{crmButton q="reset=1&action=add&sid=$sid" id="newPriceField" icon="plus-circle"}{ts}Add Price Field{/ts}{/crmButton}
</div>
{/if}
{/if}

View file

@ -0,0 +1,163 @@
{*
+--------------------------------------------------------------------+
| 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 |
+--------------------------------------------------------------------+
*}
{* Displays contribution/event fees when price set is used. *}
{foreach from=$lineItem item=value key=priceset}
{if $value neq 'skip'}
{if $lineItem|@count GT 1} {* Header for multi participant registration cases. *}
{if $priceset GT 0}
<br />
{/if}
<strong>{ts}Participant {$priceset+1}{/ts}</strong> {$part.$priceset.info}
{/if}
<table>
<tr class="columnheader">
<th>{ts}Item{/ts}</th>
{if $displayLineItemFinancialType}
<th>{ts}Financial Type{/ts}</th>
{/if}
{if $context EQ "Membership"}
<th class="right">{ts}Fee{/ts}</th>
{else}
<th class="right">{ts}Qty{/ts}</th>
<th class="right">{ts}Unit Price{/ts}</th>
{if !$getTaxDetails}
<th class="right">{ts}Total Price{/ts}</th>
{/if}
{/if}
{if $getTaxDetails}
<th class="right">{ts}Subtotal{/ts}</th>
<th class="right">{ts}Tax Rate{/ts}</th>
<th class="right">{ts}Tax Amount{/ts}</th>
<th class="right">{ts}Total Amount{/ts}</th>
{/if}
{if $pricesetFieldsCount}
<th class="right">{ts}Total Participants{/ts}</th>
{/if}
</tr>
{foreach from=$value item=line}
<tr{if $line.qty EQ 0} class="cancelled"{/if}>
<td>{if $line.field_title && $line.html_type neq 'Text'}{$line.field_title} &ndash; {$line.label}{else}{$line.label}{/if} {if $line.description}<div class="description">{$line.description}</div>{/if}</td>
{if $displayLineItemFinancialType}
<td>{$line.financial_type}</td>
{/if}
{if $context NEQ "Membership"}
<td class="right">{$line.qty}</td>
<td class="right">{$line.unit_price|crmMoney}</td>
{else}
<td class="right">{$line.line_total|crmMoney}</td>
{/if}
{if !$getTaxDetails && $context NEQ "Membership"}
<td class="right">{$line.line_total|crmMoney}</td>
{/if}
{if $getTaxDetails}
<td class="right">{$line.line_total|crmMoney}</td>
{if $line.tax_rate != "" || $line.tax_amount != ""}
<td class="right">{$taxTerm} ({$line.tax_rate}%)</td>
<td class="right">{$line.tax_amount|crmMoney}</td>
{else}
<td></td>
<td></td>
{/if}
<td class="right">{$line.line_total+$line.tax_amount|crmMoney}</td>
{/if}
{if $pricesetFieldsCount}
<td class="right">{$line.participant_count}</td>
{/if}
</tr>
{/foreach}
</table>
{/if}
{/foreach}
<div class="crm-section no-label total_amount-section">
<div class="content bold">
{if $getTaxDetails && $totalTaxAmount}
{ts 1=$taxTerm}Total %1 Amount{/ts}: {$totalTaxAmount|crmMoney}<br />
{/if}
{if $context EQ "Contribution"}
{ts}Contribution Total{/ts}:
{elseif $context EQ "Event"}
{if $totalTaxAmount}
{ts}Event SubTotal: {$totalAmount-$totalTaxAmount|crmMoney}{/ts}<br />
{/if}
{ts}Event Total{/ts}:
{elseif $context EQ "Membership"}
{ts}Membership Fee Total{/ts}:
{else}
{ts}Total Amount{/ts}:
{/if}
{$totalAmount|crmMoney}
</div>
<div class="clear"></div>
<div class="content bold">
{if $pricesetFieldsCount}
{ts}Total Participants{/ts}:
{foreach from=$lineItem item=pcount}
{if $pcount neq 'skip'}
{assign var="lineItemCount" value=0}
{foreach from=$pcount item=p_count}
{assign var="lineItemCount" value=$lineItemCount+$p_count.participant_count}
{/foreach}
{if $lineItemCount < 1 }
{assign var="lineItemCount" value=1}
{/if}
{assign var="totalcount" value=$totalcount+$lineItemCount}
{/if}
{/foreach}
{$totalcount}
{/if}
</div>
<div class="clear"></div>
</div>
{if $hookDiscount.message}
<div class="crm-section hookDiscount-section">
<em>({$hookDiscount.message})</em>
</div>
{/if}
{literal}
<script type="text/javascript">
CRM.$(function($) {
{/literal}
var comma = '{$config->monetaryThousandSeparator}';
var dot = '{$config->monetaryDecimalPoint}';
var format = '{$config->moneyformat}';
var currency = '{$currency}';
var currencySymbol = '{$currencySymbol}';
{literal}
// Todo: This function should be a utility
function moneyFormat(amount) {
amount = parseFloat(amount).toFixed(2);
amount = amount.replace(',', 'comma').replace('.', 'dot');
amount = amount.replace('comma', comma).replace('dot', dot);
return format.replace('%C', currency).replace('%c', currencySymbol).replace('%a', amount);
}});
</script>
{/literal}

View file

@ -0,0 +1,120 @@
{*
+--------------------------------------------------------------------+
| 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 and !$usedBy) and !$isReserved}
{include file="CRM/Price/Form/Option.tpl"}
{elseif $usedBy}
<div class='spacer'></div>
<div id="price_set_used_by" class="messages status no-popup">
<div class="icon inform-icon"></div>
{if $action eq 8}
{ts 1=$usedPriceSetTitle}Unable to delete the '%1' Price Field Option - it is currently in use by one or more active events or contribution pages or contributions.{/ts}
{/if}
{if $usedBy.civicrm_event or $usedBy.civicrm_contribution_page}
{include file="CRM/Price/Page/table.tpl"}
{/if}
</div>
{else}
{if $customOption}
<div id="field_page">
<p></p>
{strip}
{* handle enable/disable actions*}
{include file="CRM/common/enableDisableApi.tpl"}
<table id="options" class="row-highlight">
<thead>
<tr>
<th>{ts}Option Label{/ts}</th>
<th>{ts}Option Amount{/ts}</th>
<th>{ts}Non-deductible Amount{/ts}</th>
<th>{ts}Pre Help{/ts}</th>
<th>{ts}Post Help{/ts}</th>
{if $isEvent}
<th>{ts}Participant Count{/ts}</th>
<th>{ts}Maximum{/ts}</th>
{/if}
<th>{ts}Default{/ts}</th>
<th>{ts}Financial Type{/ts}</th>
<th>{ts}Order{/ts}</th>
{if $getTaxDetails}
<th>{ts}Tax Label{/ts}</th>
<th>{ts}Tax Amount{/ts}</th>
{/if}
<th>{ts}Enabled?{/ts}</th>
<th></th>
</tr>
</thead>
<tbody>
{foreach from=$customOption item=row}
<tr id="price_field_value-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
<td class="crm-price-option-label crm-editable" data-field="label">{$row.label}</td>
<td class="crm-price-option-value">{$row.amount|crmMoney}</td>
<td class="crm-price-option-non-deductible-amount">{$row.non_deductible_amount|crmMoney}</td>
<td class="crm-price-option-pre-help">{$row.help_pre}</td>
<td class="crm-price-option-post-help">{$row.help_post}</td>
{if $isEvent}
<td class="crm-price-option-count">{$row.count}</td>
<td class="crm-price-option-max">{$row.max_value}</td>
{/if}
<td class="crm-price-option-is_default">{if $row.is_default}<img src="{$config->resourceBase}i/check.gif" alt="{ts}Default{/ts}" />{/if}</td>
<td class="nowrap crm-price-option-financial-type-id">{$row.financial_type_id}</td>
<td class="nowrap crm-price-option-order">{$row.weight}</td>
{if $getTaxDetails}
<td>{if $row.tax_rate != '' }
{$taxTerm} ({$row.tax_rate}%)
{/if}
</td>
<td>{$row.tax_amount|crmMoney}</td>
{/if}
<td id="row_{$row.id}_status" class="crm-price-option-is_active">{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">
<img src="{$config->resourceBase}i/Inform.gif" alt="{ts}status{/ts}"/>
{ts}None found.{/ts}
</div>
{/if}
{/if}
{if $addMoreFields && !$isReserved}
<div class="action-link">
{crmButton q="reset=1&action=add&fid=$fid&sid=$sid" icon="plus-circle"}{ts 1=$fieldTitle}New Option for '%1'{/ts}{/crmButton}
{crmButton p="civicrm/admin/price/field" q="reset=1&sid=$sid" class="cancel" icon="times"}{ts}Done{/ts}{/crmButton}
</div>
{/if}
{/if}

View file

@ -0,0 +1,94 @@
{*
+--------------------------------------------------------------------+
| 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/Price/Form/Set.tpl"}
{elseif $action eq 1024}
{include file="CRM/Price/Form/Preview.tpl"}
{elseif $action eq 8 and !$usedBy}
{include file="CRM/Price/Form/DeleteSet.tpl"}
{else}
<div class="help">
{ts}Price sets allow you to set up flexible multi-option pricing schemes for your contribution, event and membership pages. Use a price set if the standard pricing options are insufficient for your needs.{/ts}
</div>
{if $usedBy}
<div class='spacer'></div>
<div id="price_set_used_by" class="messages status no-popup">
<div class="icon inform-icon"></div>
{if $action eq 8}
{ts 1=$usedPriceSetTitle}Unable to delete the '%1' price set - it is currently in use by one or more active events or contribution pages or contributions or event templates.{/ts}
{/if}
{if $usedBy.civicrm_event or $usedBy.civicrm_contribution_page or $usedBy.civicrm_event_template}
{include file="CRM/Price/Page/table.tpl"}
{/if}
</div>
{/if}
{if $rows}
<div id="price_set">
<p></p>
{strip}
{* handle enable/disable actions*}
{include file="CRM/common/enableDisableApi.tpl"}
{include file="CRM/common/jsortable.tpl"}
<table id="price_set" class="display crm-price-set-listing">
<thead>
<tr>
<th id="sortable">{ts}Set Title{/ts}</th>
<th id="nosort">{ts}Used For{/ts}</th>
<th>{ts}Enabled?{/ts}</th>
<th></th>
</tr>
</thead>
{foreach from=$rows item=row}
<tr id="price_set-{$row.id}" class="crm-entity crm-price-set_{$row.id} {cycle values="even-row,odd-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
<td class="crmf-title crm-editable">{$row.title}</td>
<td class="crmf-extends">{$row.extends}</td>
<td class="crmf-is_active">{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}
</table>
{if NOT ($action eq 1 or $action eq 2) }
<div class="action-link">
{crmButton p='civicrm/admin/price' q="action=add&reset=1" id="newPriceSet" icon="plus-circle"}{ts}Add Set of Price Fields{/ts}{/crmButton}
</div>
{/if}
{/strip}
</div>
{else}
{if $action ne 1} {* When we are adding an item, we should not display this message *}
{capture assign=infoTitle}{ts}No price sets have been added yet.{/ts}{/capture}
{assign var="infoType" value="no-popup"}
{capture assign=crmURL}{crmURL p='civicrm/admin/price' q='action=add&reset=1'}{/capture}
{capture assign=infoMessage}{ts 1=$crmURL}You can <a href='%1'>create one here</a>.{/ts}{/capture}
{include file="CRM/common/info.tpl"}
{/if}
{/if}
{/if}

View file

@ -0,0 +1,97 @@
{*
+--------------------------------------------------------------------+
| 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 |
+--------------------------------------------------------------------+
*}
{foreach from=$contexts item=context}
{if $context EQ "Event"}
{if $action eq 8}
{ts}If you no longer want to use this price set, click the event title below, and modify the fees for that event.{/ts}
{else}
{ts}This price set is used by the event(s) listed below. Click the event title to change or remove the price set.{/ts}
{/if}
<br /><br />
<table class="report">
<thead class="sticky">
<th scope="col">{ts}Event{/ts}</th>
<th scope="col">{ts}Type{/ts}</th>
<th scope="col">{ts}Public{/ts}</th>
<th scope="col">{ts}Date(s){/ts}</th>
</thead>
{foreach from=$usedBy.civicrm_event item=event key=id}
<tr>
<td><a href="{crmURL p="civicrm/event/manage/fee" q="action=update&reset=1&id=`$id`"}" title="{ts}Change or remove the price set used for this event.{/ts}">{$event.title}</a></td>
<td>{$event.eventType}</td>
<td>{if $event.isPublic}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}</td>
<td>{$event.startDate|crmDate}{if $event.endDate}&nbsp;to&nbsp;{$event.endDate|crmDate}{/if}</td>
</tr>
{/foreach}
</table>
{/if}
{if $context EQ "Contribution"}
{if $action eq 8}
{ts}If you no longer want to use this price set, click the contribution page title below, and modify the Amounts or Membership tab configuration.{/ts}
{else}
{ts}This price set is used by the contribution page(s) listed below. Click the contribution page title to change or remove the price set.{/ts}
{/if}
<br /><br />
<table class="report">
<thead class="sticky">
<th scope="col">{ts}Contribution Page{/ts}</th>
<th scope="col">{ts}Type{/ts}</th>
<th scope="col">{ts}Date(s){/ts}</th>
</thead>
{foreach from=$usedBy.civicrm_contribution_page item=contributionPage key=id}
<tr>
<td><a href="{crmURL p="civicrm/admin/contribute/settings" q="action=update&reset=1&id=`$id`"}" title="{ts}Change or remove the price set used for this contribution page.{/ts}">{$contributionPage.title}</a></td>
<td>{$contributionPage.type}</td>
<td>{$contributionPage.startDate|truncate:10:''|crmDate}{if $contributionPage.endDate}&nbsp;to&nbsp;{$contributionPage.endDate|truncate:10:''|crmDate}{/if}</td>
</tr>
{/foreach}
</table>
{/if}
{if $context EQ "EventTemplate"}
{if $action eq 8}
{ts}If you no longer want to use this price set, click the event template title below, and modify the fees for that event.{/ts}
{else}
{ts}This price set is used by the event template(s) listed below. Click the event template title to change or remove the price set.{/ts}
{/if}
<br /><br />
<table class="report">
<thead class="sticky">
<th scope="col">{ts}Event Template Name{/ts}</th>
<th scope="col">{ts}Type{/ts}</th>
<th scope="col">{ts}Public{/ts}</th>
</thead>
{foreach from=$usedBy.civicrm_event_template item=eventTemplate key=id}
<tr>
<td><a href="{crmURL p="civicrm/event/manage/fee" q="action=update&reset=1&id=`$id`"}" title="{ts}Change or remove the price set used for this event template.{/ts}">{$eventTemplate.title}</a></td>
<td>{$eventTemplate.eventType}</td>
<td>{if $eventTemplate.isPublic}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}</td>
</tr>
{/foreach}
</table>
{/if}
{/foreach}