X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fattachments.html;h=1ad857e472e0b6dc4b29d2283fee06c3d96d9a46;hb=d0c5ddbd31af8b1747d447f31623e1af05961eb4;hp=53635fd6269385ba41c7d16122308dc7a885b959;hpb=ae898cc8e6de40fbecb30c973f91cd955434b159;p=freeside.git
diff --git a/httemplate/view/cust_main/attachments.html b/httemplate/view/cust_main/attachments.html
index 53635fd62..1ad857e47 100755
--- a/httemplate/view/cust_main/attachments.html
+++ b/httemplate/view/cust_main/attachments.html
@@ -1,18 +1,19 @@
% if ( scalar(@attachments) ) {
- <% include('/elements/init_overlib.html') %>
+ <& /elements/init_overlib.html &>
- <% include("/elements/table-grid.html") %>
+ <& /elements/table-grid.html &>
- Date |
+ <% mt('Date') |h %> |
% if ( $conf->exists('cust_main_note-display_times') ) {
- Time |
+ <% mt('Time') |h %> |
% }
- Person |
- Filename |
- Type |
- Size |
+ <% mt('Person') |h %> |
+ <% mt('Filename') |h %> |
+ <% mt('Description') |h %> |
+ <% mt('Type') |h %> |
+ <% mt('Size') |h %> |
|
@@ -47,44 +48,48 @@
% my $clickjs = popup('edit/process/cust_main_attach.cgi?'.
% "custnum=$custnum;attachnum=$attachnum;".
% "undelete=1",
-% 'Undelete attachment');
-% $edit .= qq! (undelete)!;
+% emt('Undelete attachment'));
+% $edit .= linkstr($clickjs, emt('undelete'));
% }
% 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! (purge)!;
+% emt('Purge attachment'),
+% emt('Permanently remove this file?') );
+% $edit .= linkstr($clickjs,emt('purge'));
% }
% }
% else { # you can download or edit it
% if ($curuser->access_right('Edit attachment') ) {
% my $clickjs = popup('edit/cust_main_attach.cgi?'.
% "custnum=$custnum;attachnum=$attachnum",
-% 'Edit attachment properties');
-% $edit .= qq! (edit)!;
+% emt('Edit attachment properties'));
+% $edit .= linkstr($clickjs,emt('edit'));
% }
% if($curuser->access_right('Delete attachment') ) {
% my $clickjs = popup('edit/process/cust_main_attach.cgi?'.
-% "custnum=$custnum;attachnum=$attachnum;".
-% "delete=1",
-% 'Delete attachment');
-% $edit .= qq! (delete)!;
+% "custnum=$custnum;attachnum=$attachnum;delete=1",
+% 'Delete attachment',
+% 'Delete this file?');
+% $edit .= linkstr($clickjs,emt('delete'));
% }
% if ($curuser->access_right('Download attachment') ) {
-% $edit .= qq! (download)!;
+% $edit .= qq! (!
+% . emt('download') .')';
% }
% }
<% note_datestr($attach,$conf,$bgcolor) %>
- <% $attach->otaker%>
+ <% $attach->usernum ? $attach->access_user->name : $attach->otaker %>
|
<% $attach->filename %>
|
+
+ <% $attach->title %>
|
<% $attach->mime_type %>
|
@@ -105,7 +110,7 @@
my $conf = new FS::Conf;
my $curuser = $FS::CurrentUser::CurrentUser;
-
+die "access denied" if !$curuser->access_right('View attachments');
my(%opt) = @_;
my $custnum = $opt{'custnum'};
@@ -127,6 +132,11 @@ sub note_datestr {
$strip;
}
+sub linkstr {
+ my ($clickjs, $label) = (shift,shift);
+ ' (' . emt($label) . ')';
+}
+
sub size_units {
my $bytes = shift;
return $bytes if $bytes < 1024;
@@ -135,15 +145,16 @@ sub size_units {
}
sub popup {
- my ($url, $label) = @_;
+ my ($url, $label, $confirm) = @_;
my $onclick =
include('/elements/popup_link_onclick.html',
'action' => popurl(2).$url,
'actionlabel' => $label,
- 'width' => 616,
- 'height' => 408,
+ 'width' => 510,
+ 'height' => 315,
'frame' => 'top',
);
+ $onclick = qq!if(confirm('$confirm')) { $onclick }! if $confirm;
return qq!onclick="$onclick"!;
}