-% my $download = '';
-% if($attach->disabled) {
-% my $onclick = include('/elements/popup_link_onclick.html',
-% 'action' => popurl(2).
-% 'edit/process/cust_main_attach.cgi'.
-% "?custnum=$custnum;".
-% "attachnum=$attachnum;".
-% "undelete=1",
-% 'actionlabel' => 'Undelete attachment',
-% 'width' => 616,
-% 'height' => 408,
-% 'frame' => 'top',
-% );
-% my $clickjs = qq!onclick="$onclick"!;
-% if($curuser->access_right('Edit attachment')) {
-% $edit = qq! <A HREF="javascript:void(0);" $clickjs>(undelete)</A>!;
+% if($attach->disabled) { # then you can undelete it or purge it.
+% if ($curuser->access_right('Undelete attachment')) {
+% my $clickjs = popup('edit/process/cust_main_attach.cgi?'.
+% "custnum=$custnum;attachnum=$attachnum;".
+% "undelete=1",
+% 'Undelete attachment');
+% $edit .= qq! <A HREF="javascript:void(0);" $clickjs>(undelete)</A>!;
+% }
+% if ($curuser->access_right('Purge attachment')) {
+% my $clickjs = popup('edit/process/cust_main_attach.cgi?'.
+% "custnum=$custnum;attachnum=$attachnum;".
+% "purge=1",
+% 'Purge attachment');
+% $edit .= qq! <A HREF="javascript:void(0);" $clickjs>(purge)</A>!;