});
function buildBatchSelector( filterSearch ) {
- var status = {/literal}{$status}{literal};
+ var status = {/literal}{if !empty($status)}{$status}{else}0{/if}{literal};
if (filterSearch) {
crmBatchSelector.fnDestroy();
var ZeroRecordText = '<div class="status messages">{/literal}{ts escape="js"}No matching Data Entry Batches found for your search criteria.{/ts}{literal}</li></ul></div>';
<tr id="option_value-{$row.id}" class="crm-entity crm-admin-options_{$row.id} {if NOT $row.is_active} disabled{/if}">
<td class="crm-admin-options-label crm-editable" data-field="label">{$row.label}</td>
<td class="crm-admin-options-value">{$row.value}</td>
- <td class="crm-admin-options-description">{$row.description}</td>
+ <td class="crm-admin-options-description">{if !empty($row.description)}{$row.description}{/if}</td>
<td class="nowrap crm-admin-options-order">{$row.weight}</td>
<td class="crm-admin-options-is_reserved">{if $row.is_reserved eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
<td class="crm-admin-options-is_active" id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
<tr class="crm-dedupe-rules-form-block-is_reserved">
<td class="label">{$form.is_reserved.label}</td>
<td>{$form.is_reserved.html}
- {if !$isReserved}
+ {if empty($isReserved)}
<br />
<span class="description">{ts}WARNING: Once a rule is marked as reserved it can not be deleted and the fields and weights can not be modified.{/ts}</span>
{/if}
<td>
<table class="form-layout-compressed">
{* Hide fields and document match criteria for optimized reserved rules. *}
- {if $ruleName EQ 'IndividualSupervised' OR $ruleName EQ 'IndividualUnsupervised' OR $ruleName EQ 'IndividualGeneral'}
+ {if !empty($ruleName) and ($ruleName EQ 'IndividualSupervised' OR $ruleName EQ 'IndividualUnsupervised' OR $ruleName EQ 'IndividualGeneral')}
<tr>
<td>
<div class="status message">
</td>
</tr>
{else}
- {if $isReserved}
+ {if !empty($isReserved)}
<tr>
<td>
<div class="status message">
{ts}From Address{/ts}
{/htxt}
{htxt id="id-from_email"}
-{if $params.logged_in_email_setting == "1"}
+{if !empty($params.logged_in_email_setting) and $params.logged_in_email_setting == "1"}
<p>{ts}By default, CiviCRM uses the primary email address of the logged in user as the FROM address when sending emails to contacts. However, users with Administer CiviCRM permission can configure one or more general email addresses that can be selected as an alternative. EXAMPLE: "Client Services" <clientservices@example.org>{/ts}</p>
{else}
<p>{ts}CiviCRM is currently configured to only use the defined From Email addresses. If you wish to be able to use the email address of the logged in user as the From Address you will need to set the setting "Allow mail from loged in contact" setting. Users with Administer CiviCRM can set this setting in the SMTP settings.{/ts}<p>
- {if $params.isAdmin}
+ {if !empty($params.isAdmin)}
{capture assign="smtpUrl"}{crmURL p="civicrm/admin/setting/smtp" q="reset=1"}{/capture}
<p>{ts 1=$smtpUrl}Go to <a href='%1'>Settings - Outbound Mail</a> to enable the usage of the logged in contact's email address as the from email{/ts}</p>
{/if}
{/if}
-{if $params.isAdmin}
+{if !empty($params.isAdmin)}
{capture assign="fromConfig"}{crmURL p="civicrm/admin/options/from_email_address" q="reset=1"}{/capture}
<p>{ts 1=$fromConfig}Go to <a href='%1'>Administer CiviCRM » Communications » FROM Email Addresses</a> to add or edit general email addresses. Make sure these email addresses are valid email accounts with your email service provider.{/ts}</p>
{/if}
<p>{ts}Use tokens when you are sending mail to a number of recipients, and want to include their name and / or other values from their contact record automatically within your message.{/ts}</p>
<p>{ts 1='{contact.first_name}'}EXAMPLE: If you want your message to begin with "Dear " followed by the recipient's first name, you can use the %1 token in your message. <em>Dear %1</em>{/ts}</p>
<p>{ts}Place your cursor within the Message box where you want to the token to be inserted. Then click the "Insert Tokens" link in the upper right corner of the message box to see a list of available tokens. Insert the token by clicking the desired token name in the list (for example, click "First Name").{/ts}</p>
-{if $params.tplFile EQ 'CRM/Mailing/Form/Upload.tpl'}
+{if !empty($params.tplFile) and $params.tplFile EQ 'CRM/Mailing/Form/Upload.tpl'}
<p>
{ts}You will also use tokens to insert Unsubscribe, Opt out and Forwarding links in your message.{/ts}
</p>
<p>{ts}Use tokens when you are sending mail or generating PDF letters for a number of recipients, and want to include their name and / or other values from their contact record automatically within your message.{/ts}</p>
<p>{ts 1='{contact.first_name}'}EXAMPLE: If you want your message to begin with "Dear " followed by the recipient's first name, you can use the %1 token in your message. <em>Dear %1</em>{/ts}</p>
<p>{ts}Place your cursor within the Message box where you want to the token to be inserted. Then click the "Insert Tokens" link in the upper right corner of the message box to see a list of available tokens. Insert the token by clicking the desired token name in the list (for example, click "First Name").{/ts}</p>
-{if $params.tplFile EQ 'CRM/Mailing/Form/Upload.tpl'}
+{if !empty($params.tplFile) and $params.tplFile EQ 'CRM/Mailing/Form/Upload.tpl'}
<p>
{ts}You will also use tokens to insert Unsubscribe, Opt out and Forwarding links in your message.{/ts}
{ts}Use these steps to insert clickable action links:{/ts}
</div>
<div class="clear"></div>
<div class='html'>
- {if $editor EQ 'textarea'}
+ {if !empty($editor) and $editor EQ 'textarea'}
<div class="help description">{ts}NOTE: If you are composing HTML-formatted messages, you may want to enable a Rich Text (WYSIWYG) editor (Administer » Customize Data & Screens » Display Preferences).{/ts}</div>
{/if}
{$form.html_message.html}<br />
<p>{ts}You can upload an image from your computer OR enter a URL for an image already on the Web. If you chose to upload an image file, a 'thumbnail' version will be automatically created for you. If you don't have an image available at this time, you may also choose to display a 'No Image Available' icon by selecting the 'default image'.{/ts}</p>
</div>
<table class="form-layout-compressed">
- {if $thumbnailUrl}<tr class="odd-row"><td class="describe-image" colspan="2"><strong>Current Image Thumbnail</strong><br /><img src="{$thumbnailUrl}" /></td></tr>{/if}
+ {if !empty($thumbnailUrl)}<tr class="odd-row"><td class="describe-image" colspan="2"><strong>Current Image Thumbnail</strong><br /><img src="{$thumbnailUrl}" /></td></tr>{/if}
<tr class="crm-contribution-form-block-imageOption"><td>{$form.imageOption.image.html}</td><td>{$form.uploadFile.html}</td></tr>
<tr class="crm-contribution-form-block-imageOption-thumbnail"><td colspan="2">{$form.imageOption.thumbnail.html}</td></tr>
<tr id="imageURL"{if $action neq 2} class="hiddenElement"{/if}>
<tr class="crm-contribution-form-block-financial_type">
<td class="label">{$form.financial_type_id.label}</td>
<td class="html-adjust">
- {if !$financialType}
+ {if empty($financialType)}
{capture assign=ftUrl}{crmURL p='civicrm/admin/financial/financialType' q="reset=1"}{/capture}
{ts 1=$ftUrl}There are no financial types configured with linked 'Cost of Sales Premiums' and 'Premiums Inventory Account' accounts. If you want to generate accounting transactions which track the cost of premiums used <a href='%1'>click here</a> to configure financial types and accounts.{/ts}
{else}
{foreach from=$contribute_rows item=row}
<tr id='rowid{$row.contribution_id}'
- class="{cycle values="odd-row,even-row"}{if $row.cancel_date} disabled{/if}">
- <td>{$row.total_amount|crmMoney:$row.currency} {if $row.amount_level && !is_array($row.amount_level)} - {$row.amount_level} {/if}
- {if $row.contribution_recur_id}
+ class="{cycle values="odd-row,even-row"}{if !empty($row.cancel_date)} disabled{/if}">
+ <td>{$row.total_amount|crmMoney:$row.currency} {if !empty($row.amount_level) && !is_array($row.amount_level)} - {$row.amount_level} {/if}
+ {if !empty($row.contribution_recur_id)}
<br/>
{ts}(Recurring Contribution){/ts}
{/if}
<a class="button no-popup nowrap"
href="{crmURL p='civicrm/contribute/invoice' q=$urlParams}">
<i class="crm-i fa-print" aria-hidden="true"></i>
- {if $row.contribution_status_name != 'Refunded' && $row.contribution_status_name != 'Cancelled' }
+ {if empty($row.contribution_status_name) || (!empty($row.contribution_status_name) && $row.contribution_status_name != 'Refunded' && $row.contribution_status_name != 'Cancelled') }
<span>{ts}Print Invoice{/ts}</span>
{else}
<span>{ts}Print Invoice and Credit Note{/ts}</span>
{/if}
</td>
{/if}
+ {if !empty($row.buttons)}
<td>
{foreach from=$row.buttons item=button}
<a class="{$button.class}" href="{$button.url}"><span class='nowrap'>{$button.label}</span></a>
{/foreach}
</td>
+ {/if}
</tr>
{/foreach}
</table>
{/strip}
- {if $contributionSummary.total.count gt 12}
+ {if !empty($contributionSummary.total) and $contributionSummary.total.count gt 12}
{ts}Contact us for information about contributions prior to those listed above.{/ts}
{/if}
{else}
{/if}
- {if $honor}
+ {if !empty($honor)}
{if $honorRows}
{strip}
<div class="help">
{/if}
{/if}
- {if $recur}
+ {if !empty($recur)}
{if $recurRows}
{strip}
<div><label>{ts}Recurring Contribution(s){/ts}</label></div>
</td>
<td class="crm-participant-participant_status">{$row.participant_status}</td>
<td class="crm-participant-showConfirmUrl">
- {if $row.showConfirmUrl}
+ {if !empty($row.showConfirmUrl)}
<a href="{crmURL p='civicrm/event/confirm' q="reset=1&participantId=`$row.participant_id`"}">{ts}Confirm Registration{/ts}</a>
{/if}
</td>
*}
{* Financial search component. *}
+{if !isset($batchStatus)}
+ {assign var="batchStatus" value="open"}
+{/if}
<div id="enableDisableStatusMsg" class="crm-container" style="display:none"></div>
<div class="action-link">
<a accesskey="N" href="{crmURL p='civicrm/financial/batch' q="reset=1&action=add&context=$batchStatus"}" id="newBatch" class="button"><span><i class="crm-i fa-plus-circle" aria-hidden="true"></i> {ts}New Accounting Batch{/ts}</span></a>
<div class="crm-accordion-body">
<div id="financial-search-form" class="crm-block crm-form-block">
<table class="form-layout-compressed">
+ {if !empty($elements)}
{* Loop through all defined search criteria fields (defined in the buildForm() function). *}
{foreach from=$elements item=element}
<tr class="crm-financial-search-form-block-{$element}">
<td>{$form.$element.html}</td>
</tr>
{/foreach}
+ {/if}
</table>
</div>
</div>
</div>
</div>
-<div class="form-layout-compressed">{$form.batch_update.html} {$form.submit.html}</div><br/>
+{if !empty($form.batch_update)}<div class="form-layout-compressed">{$form.batch_update.html} {$form.submit.html}</div><br/>{/if}
<table id="crm-batch-selector-{$batchStatus}" class="row-highlight">
<thead>
<tr>
- <th class="crm-batch-checkbox">{$form.toggleSelect.html}</th>
+ <th class="crm-batch-checkbox">{if !empty($form.toggleSelect.html)}{$form.toggleSelect.html}{/if}</th>
<th class="crm-batch-name">{ts}Batch Name{/ts}</th>
<th class="crm-batch-payment_instrument">{ts}Payment Method{/ts}</th>
<th class="crm-batch-item_count">{ts}Item Count{/ts}</th>
<th></th>
</thead>
{foreach from=$rows item=row}
- <tr id="financial_account-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
+ <tr id="financial_account-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {if !empty($row.class)}{$row.class}{/if}{if NOT $row.is_active} disabled{/if}">
<td class="crm-editable" data-field="name">{$row.name}</td>
- <td class="crm-editable" data-field="description" data-type="textarea">{$row.description}</td>
+ <td class="crm-editable" data-field="description" data-type="textarea">{if !empty($row.description)}{$row.description}{/if}</td>
<td class="crm-editable" data-field="accounting_code">{$row.accounting_code}</td>
<td>{$row.financial_account_type_id}{if $row.account_type_code} ({$row.account_type_code}){/if}</td>
<td>{if $row.is_deductible eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
<th></th>
</thead>
{foreach from=$rows item=row}
- <tr id="financial_type-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
+ <tr id="financial_type-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {if !empty($row.class)}{$row.class}{/if}{if NOT $row.is_active} disabled{/if}">
<td class="crm-editable" data-field="name">{$row.name}</td>
- <td class="crm-editable" data-field="description" data-type="textarea">{$row.description}</td>
+ <td class="crm-editable" data-field="description" data-type="textarea">{if !empty($row.description)}{$row.description}{/if}</td>
<td>{$row.financial_account}</td>
<td class="crm-editable" data-field="is_deductible" data-type="boolean">{if $row.is_deductible eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
<td>{if $row.is_reserved eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
$expectedStrings = [
'Your Contribution(s)',
'<table class="selector"><tr class="columnheader"><th>Total Amount</th><th>Financial Type</th><th>Received date</th><th>Receipt Sent</th><th>Balance</th><th>Status</th><th></th>',
- '<td>Completed</td><td><a class="button no-popup nowrap"href="/index.php?q=civicrm/contribute/invoice&reset=1&id=1&cid=' . $this->contactID . '"><i class="crm-i fa-print" aria-hidden="true"></i><span>Print Invoice</span></a></td><td></td></tr><tr id=\'rowid2\'',
+ '<td>Completed</td><td><a class="button no-popup nowrap"href="/index.php?q=civicrm/contribute/invoice&reset=1&id=1&cid=' . $this->contactID . '"><i class="crm-i fa-print" aria-hidden="true"></i><span>Print Invoice</span></a></td></tr><tr id=\'rowid2\'',
'Pay Now',
];