RT#38217: Send email when logging conditions are met
[freeside.git] / httemplate / edit / quotation.html
1 <% include( 'elements/edit.html',
2                  'name'    => 'Quotation',
3                  'table'   => 'quotation',
4                  'menubar' => [],
5                  'labels'  => { 
6                                 'quotationnum' => 'Quotation number',
7                                 'prospectnum'  => 'Prospect',
8                                 'custnum'      => 'Customer',
9                                 '_date'        => 'Date',
10                                 'close_date'   => 'Close Date',
11                                 'confidence'   => 'Confidence',
12                                 ($can_disable ? ('disabled'     => 'Disabled') : ()),
13                               },
14                  'fields'  => [
15                    { field=>'prospectnum', type=>'fixed-prospect_main' },
16                    { field=>'custnum',     type=>'fixed-cust_main' },
17                    { field=>'_date',       type=>'fixed-date' },
18                    { field=>'close_date',  type=>'input-date-field' },
19                    { field=>'confidence',  type=>'text', size=>3, postfix=>'%' },
20                    ($can_disable ? { field=>'disabled',    type=>'checkbox', value=>'Y'} : ()),
21                               ],
22                  #XXX some way to disable the "view all"
23                  'new_callback' => sub { my( $cgi, $quotation) = @_;
24                                          $quotation->$_( $cgi->param($_) )
25                                            foreach qw( prospectnum custnum );
26                                          $quotation->_date(time);
27                                        },
28            )
29 %>
30 <%init>
31
32 die "access denied"
33   unless $FS::CurrentUser::CurrentUser->access_right('Generate quotation');
34
35 my $can_disable = $FS::CurrentUser::CurrentUser->access_right('Disable quotation');
36
37 </%init>