{*Edit post form*} {script} {literal} $("a.ticket_delete_attachment").each(function(){ var container_handler = $(this).closest(".attachment_container"); $(this).click(function(){ if ( confirm(OW.getLanguageText('iisticketing', 'confirm_delete_attachment')) ) { var attachment_id = $(this).data("aid"); var attachmentDeleteCode = $(this).attr("code"); var params = {}; var url = "{/literal}{url_for_route for='iisticketing.delete_attachment'}{literal}"; params['attachmentId'] = attachment_id; if(attachmentDeleteCode!=null && attachmentDeleteCode!=undefined) { params['attachmentDeleteCode'] = attachmentDeleteCode; } $.ajaxSetup({dataType: 'json'}); $.post(url, params, function(data){ if ( data.result == true ) { OW.info(data.msg); container_handler.remove(); } else if (data.error != undefined) { OW.warning(data.error); } }); } else { return false; } }); }); {/literal} {/script}
{form name='edit-post-form'}
{input name='text' class="ow_smallmargin" id='post_body'}
{error name='text'}
{if isset($extendedText)}
{$extendedText}
{/if} {*capture assign='postId'}{$post->id}{/capture*} {if isset($attachments[$postId])}
{foreach from=$attachments[$postId] item='attm'}
{if $attm.downloadUrl != ''}{$attm.fileName}{else}{$attm.fileName}{/if} ({$attm.fileSize}Kb)
{if isset($attachmentDeleteCode)} {else} {/if}
{/foreach}
{/if}
{$attachmentsCmp}
{submit name='save' class='ow_ic_save ow_positive'}
{submit name='cancel'}
{/form}