{*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
{capture assign=attachTitle}{ts}Attachment(s){/ts}{/capture}
{/if}
{if !$noexpand}
- <div class="crm-accordion-wrapper {if $context NEQ 'pcpCampaign'}collapsed{/if}">
+ <div class="crm-accordion-wrapper {if $context NEQ 'pcpCampaign' AND !$currentAttachmentInfo}collapsed{/if}">
<div class="crm-accordion-header">
{$attachTitle}
</div><!-- /.crm-accordion-header -->
<table class="form-layout-compressed">
{if $form.attachFile_1}
{if $context EQ 'pcpCampaign'}
- <div class="description">{ts}You can upload a picture or image to include on your page. Your file should be in .jpg, .gif, or .png format. Recommended image size is 250 x 250 pixels. Maximum size is 360 x 360 pixels.{/ts}</div>
+ <div class="description">{ts}You can upload a picture or image to include on your page. Your file should be in .jpg, .gif, or .png format. Recommended image size is 250 x 250 pixels. Images over 360 pixels wide will be automatically resized to fit.{/ts}</div>
{/if}
<tr>
<td class="label">{$form.attachFile_1.label}</td>
- <td>{$form.attachFile_1.html} {$form.attachDesc_1.html}<span class="crm-clear-link">(<a href="#" onclick="clearAttachment( '#attachFile_1', '#attachDesc_1' ); return false;">{ts}clear{/ts}</a>)</span><br />
- <span class="description">{ts}Browse to the <strong>file</strong> you want to upload.{/ts}{if $maxAttachments GT 1} {ts 1=$maxAttachments}You can have a maximum of %1 attachment(s).{/ts}{/if} Each file must be less than {$config->maxFileSize}M in size. You can also add a short description.</span>
+ <td>{$form.attachFile_1.html} {$form.attachDesc_1.html}<a href="#" class="crm-hover-button" title="{ts}Clear{/ts}" onclick="clearAttachment( '#attachFile_1', '#attachDesc_1' ); return false;"><span class="icon close-icon"></span></a><br />
+ <span class="description">{ts}Browse to the <strong>file</strong> you want to upload.{/ts}{if $maxAttachments GT 1} {ts 1=$maxAttachments}You can have a maximum of %1 attachment(s).{/ts}{/if} {ts 1=$config->maxFileSize}Each file must be less than %1M in size. You can also add a short description.{/ts}</span>
</td>
</tr>
{if $form.tag_1.html}
<tr>
- <td></td>
- <td><label>{$form.tag_1.label}</label> <div class="crm-select-container crm-attachment-tags">{$form.tag_1.html}</div></td>
+ <td class="label">{$form.tag_1.label}</td>
+ <td><div class="crm-select-container crm-attachment-tags">{$form.tag_1.html}</div></td>
</tr>
{/if}
- {if $tagsetInfo_attachment}
- <tr><td></td><td>{include file="CRM/common/Tag.tpl" tagsetType='attachment' tagsetNumber=1 }</td></tr>
+ {if $tagsetInfo.file}
+ <tr>{include file="CRM/common/Tagset.tpl" tagsetType='file' tableLayout=true tagsetElementName="file_taglist_1"}</tr>
{/if}
{section name=attachLoop start=2 loop=$numAttachments+1}
{assign var=index value=$smarty.section.attachLoop.index}
<tr class="attachment-fieldset"><td colspan="2"></td></tr>
<tr>
<td class="label">{$form.attachFile_1.label}</td>
- <td>{$form.$attachName.html} {$form.$attachDesc.html}<span class="crm-clear-link">(<a href="#" onclick="clearAttachment( '#{$attachName}' ); return false;">{ts}clear{/ts}</a>)</span></td>
+ <td>{$form.$attachName.html} {$form.$attachDesc.html}<a href="#" class="crm-hover-button" title="{ts}Clear{/ts}" onclick="clearAttachment( '#{$attachName}' ); return false;"><span class="icon close-icon"></span></a></td>
</tr>
<tr>
- <td></td>
- <td><label>{$form.$tagElement.label}</label> <div class="crm-select-container crm-attachment-tags">{$form.$tagElement.html}</div></td>
+ <td class="label">{$form.$tagElement.label}</td>
+ <td><div class="crm-select-container crm-attachment-tags">{$form.$tagElement.html}</div></td>
</tr>
- {if $tagsetInfo_attachment}
- <tr><td></td><td>{include file="CRM/common/Tag.tpl" tagsetType='attachment' tagsetNumber=$index}</td></tr>
+ {if $tagsetInfo.file}
+ <tr>{include file="CRM/common/Tagset.tpl" tagsetType='file' tableLayout=true tagsetElementName="file_taglist_$index"}</tr>
{/if}
{/section}
- {literal}
- <script type="text/javascript">
- cj(".crm-attachment-tags select[multiple]").crmasmSelect({
- addItemTarget: 'bottom',
- animate: true,
- highlight: true,
- sortable: true,
- respectParents: true
- });
- </script>
- {/literal}
{/if}
{if $currentAttachmentInfo}
<tr class="attachment-fieldset"><td colspan="2"></td></tr>
<td class="label">{ts}Current Attachment(s){/ts}</td>
<td class="view-value">
{foreach from=$currentAttachmentInfo key=attKey item=attVal}
- <div id="attachStatusMesg" class="status hiddenElement"></div>
- <div id="attachFileRecord_{$attVal.fileID}">
- <strong><a href="{$attVal.url}">{$attVal.cleanName}</a></strong>
+ <div class="crm-attachment-wrapper crm-entity" id="file_{$attVal.fileID}">
+ <strong><a class="crm-attachment" href="{$attVal.url}">{$attVal.cleanName}</a></strong>
{if $attVal.description} - {$attVal.description}{/if}
{if $attVal.deleteURLArgs}
- <a href="#" onclick="showDelete('{$attVal.cleanName}', '{$attVal.deleteURLArgs}', {$attVal.fileID}); return false;" title="{ts}Delete this attachment{/ts}"><span class="icon red-icon delete-icon" style="margin:0px 0px -5px 20px" title="{ts}Delete this attachment{/ts}"></span></a>
+ <a href="#" class="crm-hover-button delete-attachment" data-filename="{$attVal.cleanName}" data-args="{$attVal.deleteURLArgs}" title="{ts}Delete File{/ts}"><span class="icon delete-icon"></span></a>
{/if}
{if !empty($attVal.tag)}
<br/>
</tr>
<tr>
<td class="label"> </td>
- <td>{$form.is_delete_attachment.html} {$form.is_delete_attachment.label}<br />
- <span class="description">{ts}Click the red trash-can next to a file name to delete a specific attachment. If you want to delete ALL attachments, check the box above and click Save.{/ts}</span>
+ <td>{$form.is_delete_attachment.html} {$form.is_delete_attachment.label}
</td>
</tr>
{/if}
</div>
</div><!-- /.crm-accordion-body -->
</div><!-- /.crm-accordion-wrapper -->
- {if !$noexpand}
- {literal}
- <script type="text/javascript">
- cj(function() {
- cj().crmAccordions();
- });
- </script>
- {/literal}
- {/if}
{literal}
<script type="text/javascript">
function clearAttachment( element, desc ) {
</script>
{/literal}
{/if} {* edit/add if*}
-{if $currentAttachmentInfo}
-<script type="text/javascript">
-{literal}
- function hideStatus( ) {
- cj( '#attachStatusMesg' ).hide( );
- }
-
- function showDelete( fileName, postURLData, fileID ) {
- var confirmMsg = '{/literal}{ts escape="js"}Are you sure you want to delete attachment: {/ts}{literal}' + fileName + ' <a href="#" onclick="deleteAttachment( \'' + postURLData + '\',' + fileID + ' ); return false;" style="text-decoration: underline;">{/literal}{ts escape='js'}Yes{/ts}{literal}</a> <a href="#" onclick="hideStatus( ); return false;" style="text-decoration: underline;">{/literal}{ts escape='js'}No{/ts}{literal}</a>';
- cj( '#attachStatusMesg' ).show( ).html( confirmMsg );
- }
- function deleteAttachment( postURLData, fileID ) {
- var postUrl = {/literal}"{crmURL p='civicrm/file/delete' h=0 }"{literal};
- cj.ajax({
- type: "GET",
- data: postURLData,
- url: postUrl,
- success: function(html){
- var resourceBase = {/literal}"{$config->resourceBase}"{literal};
- var successMsg = '{/literal}{ts escape="js"}The selected attachment has been deleted.{/ts}{literal} <a href="#" onclick="hideStatus( ); return false;"><img title="{/literal}{ts escape='js'}close{/ts}{literal}" src="' +resourceBase+'i/close.png"/></a>';
- cj( '#attachFileRecord_' + fileID ).hide( );
- cj( '#attachStatusMesg' ).show( ).html( successMsg );
- }
- });
- }
-{/literal}
-</script>
+{if $currentAttachmentInfo}
+{include file="CRM/Form/attachmentjs.tpl"}
{/if}
+
{/if} {* top level if *}