1 <script type="text/javascript">
3 function hideStatusAttachment( divName ) {
7 function showDeleteAttachment( fileName, postURLData, fileID, divName, divFile ) {
8 var confirmMsg = '<div>{/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}</div><div>{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></div>';
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}';
21 cj(divFile + ',' + divName).hide();
22 CRM.alert(successMsg, '{/literal}{ts escape="js"}Removed{/ts}{literal}', 'success');