1 <script type="text/javascript">
3 function hideStatusAttachment( divName ) {
7 function showDeleteAttachment( fileName, postURLData, fileID, divName, divFile ) {
8 var confirmMsg = '{/literal}{ts escape="js"}Are you sure you want to delete attachment: {/ts}{literal}' + fileName + ' <a href="#" onclick="deleteAttachment( \'' + postURLData + '\',' + fileID + ',\'' + divName + '\', \'' + divFile + '\' ); return false;" style="text-decoration: underline;">{/literal}{ts escape='js'}Yes{/ts}{literal}</a> <a href="#" onclick="hideStatusAttachment( divName ); return false;" style="text-decoration: underline;">{/literal}{ts escape='js'}No{/ts}{literal}</a>';
9 cj( divName ).show( ).html( confirmMsg );
12 function deleteAttachment( postURLData, fileID, divName, divFile ) {
13 var postUrl = {/literal}"{crmURL p='civicrm/file/delete' h=0 }"{literal};
18 success: function(html){
19 var resourceBase = {/literal}"{$config->resourceBase}"{literal};
20 var successMsg = '{/literal}{ts escape="js"}The selected attachment has been deleted.{/ts}{literal} <a href="#" onclick="hideStatusAttachment( \'' + divName + '\'); return false;"><img title="{/literal}{ts escape='js'}close{/ts}{literal}" src="' +resourceBase+'i/close.png"/></a>';
21 cj( divFile ).hide( );
22 cj( divName ).show( ).html( successMsg );