X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Fattachments.php;h=b3ad754532e165c5dab0a41bb5cb1e276962d871;hb=1ca1041c196876505cb9b591afbba34ada239682;hp=7e6ba95545251f3ddb379ce47e46652369ab6897;hpb=231a58e6564fc927a2f38c9a45871df43da14420;p=fa-stable.git diff --git a/admin/attachments.php b/admin/attachments.php index 7e6ba955..b3ad7545 100644 --- a/admin/attachments.php +++ b/admin/attachments.php @@ -141,10 +141,10 @@ if ($Mode == 'ADD_ITEM' || $Mode == 'UPDATE_ITEM') $filename, $unique_name, $filesize, $filetype); display_notification(_("Attachment has been updated.")); } + reset_form(); } refresh_pager('trans_tbl'); $Ajax->activate('_page_body'); - $Mode = 'RESET'; } if ($Mode == 'Delete') @@ -155,11 +155,16 @@ if ($Mode == 'Delete') unlink($dir."/".$row['unique_name']); delete_attachment($selected_id); display_notification(_("Attachment has been deleted.")); - $Mode = 'RESET'; + reset_form(); } if ($Mode == 'RESET') + reset_form(); + +function reset_form() { + global $selected_id; + unset($_POST['trans_no']); unset($_POST['description']); $selected_id = -1; } @@ -173,7 +178,7 @@ function viewing_controls() start_row(); systypes_list_cells(_("Type:"), 'filterType', null, true); if (list_updated('filterType')) - $selected_id = -1; + reset_form(); if(get_post('filterType') == ST_CUSTOMER ){ customer_list_cells(_("Select a customer: "), 'trans_no', null, false, true, true);