fix version in header
[civicrm-core.git] / templates / CRM / Price / Page / Field.tpl
index 470e131067699edbfe550eba33d4bbd2fc962d94..6533b9f92d90351b9428761d29321a730c632dae 100644 (file)
@@ -1,6 +1,6 @@
 {*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  +--------------------------------------------------------------------+
 *}
 {if ($action eq 1 or $action eq 2 or $action eq 4) and !$isReserved}
-    {include file="CRM/Price/Form/Field.tpl"}
+  {include file="CRM/Price/Form/Field.tpl"}
 {elseif $action eq 8 and !$usedBy and !$isReserved}
-    {include file="CRM/Price/Form/DeleteField.tpl"}
+  {include file="CRM/Price/Form/DeleteField.tpl"}
 {elseif $action eq 1024 }
-    {include file="CRM/Price/Form/Preview.tpl"}
-{else}
-  {if ($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}
-
+  {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 $priceField}
-    <div class="action-link">
-      {if !$isReserved}
-        <a href="{crmURL q="reset=1&action=add&sid=$sid"}" id="newPriceField" class="button"><span><div class="icon add-icon"></div>{ts}Add Price Field{/ts}</span></a>
-      {/if}
-        <a href="{crmURL p="civicrm/admin/price" q="action=preview&sid=`$sid`&reset=1&context=field"}" class="button"><span><div class="icon preview-icon"></div>{ts}Preview (all fields){/ts}</span></a>
-    </div>
-    <div id="field_page">
-    {strip}
+{if $action NEQ 8 and $priceField}
+  <div class="action-link">
+    {if !$isReserved}
+      <a href="{crmURL q="reset=1&action=add&sid=$sid"}" id="newPriceField" class="button"><span><div class="icon add-icon"></div>{ts}Add Price Field{/ts}</span></a>
+    {/if}
+      <a href="{crmURL p="civicrm/admin/price" q="action=preview&sid=`$sid`&reset=1&context=field"}" class="button"><span><div class="icon preview-icon"></div>{ts}Preview (all fields){/ts}</span></a>
+  </div>
+  <div id="field_page">
+  {strip}
   {* handle enable/disable actions*}
-   {include file="CRM/common/enableDisableApi.tpl"}
-   {include file="CRM/common/crmeditable.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>
-            <th></th>
-        </tr>
-        </thead>
-        {foreach from=$priceField key=fid item=row}
+  {include file="CRM/common/enableDisableApi.tpl"}
+  {include file="CRM/common/crmeditable.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}</td>
-            <td class="nowrap">{$row.weight}</td>
-            <td>{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 / Numeric Quantity"}{$row.price|crmMoney}{else}<a 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>
-            <td class="field-action">{$row.action|replace:'xx':$row.id}</td>
-        </tr>
-        {/foreach}
-        </table>
-        {/strip}
-     </div>
-     <div class="action-link">
-      {if !$isReserved}
-         <a href="{crmURL q="reset=1&action=add&sid=$sid"}" id="newPriceField" class="button"><span><div class="icon add-icon"></div>{ts}Add Price Field{/ts}</span></a>
-   {/if}
-         <a href="{crmURL p="civicrm/admin/price" q="action=preview&sid=`$sid`&reset=1&context=field"}" class="button"><span><div class="icon preview-icon"></div>{ts}Preview (all fields){/ts}</span></a>
-     </div>
-
-  {else}
-        {if $action eq 16}
-        <div class="messages status no-popup">
-            <div class="icon inform-icon"></div>
-            {ts 1=$groupTitle 2=$crmURL}There are no fields for price set '%1'.{/ts}
-        </div>
-        <div class="action-link">
-          <a href="{crmURL q="reset=1&action=add&sid=$sid"}" id="newPriceField" class="button"><span><div class="icon add-icon"></div>{ts}Add Price Field{/ts}</span></a>
-        </div>
+        <td class="crm-editable" data-field="label">{$row.label}</td>
+        <td>{$row.html_type_display}</td>
+        <td class="nowrap">{$row.weight}</td>
+        <td>{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}
+      <a href="{crmURL q="reset=1&action=add&sid=$sid"}" id="newPriceField" class="button"><span><div class="icon add-icon"></div>{ts}Add Price Field{/ts}</span></a>
+    {/if}
+    <a href="{crmURL p="civicrm/admin/price" q="action=preview&sid=`$sid`&reset=1&context=field"}" class="button"><span><div class="icon preview-icon"></div>{ts}Preview (all fields){/ts}</span></a>
+  </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">
+      <a href="{crmURL q="reset=1&action=add&sid=$sid"}" id="newPriceField" class="button"><span><div class="icon add-icon"></div>{ts}Add Price Field{/ts}</span></a>
+    </div>
   {/if}
 {/if}