RT# 74666 - updated some UI and description field location.
[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                                 'quotation_description' => 'Description',
13                                 ($can_disable ? ('disabled'     => 'Disabled') : ()),
14                               },
15                  'fields'  => [
16                    { field=>'prospectnum',           type=>'fixed-prospect_main' },
17                    { field=>'custnum',               type=>'fixed-cust_main' },
18                    { field=>'_date',                 type=>'fixed-date' },
19                    { field=>'quotation_description', type=>'text', size=>50 },
20                    { field=>'close_date',            type=>'input-date-field' },
21                    { field=>'confidence',            type=>'text', size=>3, postfix=>'%' },
22                    ($can_disable ? { field=>'disabled', type=>'checkbox', value=>'Y'} : ()),
23                               ],
24                  #XXX some way to disable the "view all"
25                  'new_callback' => sub { my( $cgi, $quotation) = @_;
26                                          $quotation->$_( $cgi->param($_) )
27                                            foreach qw( prospectnum custnum );
28                                          $quotation->_date(time);
29                                        },
30            )
31 %>
32 <%init>
33
34 die "access denied"
35   unless $FS::CurrentUser::CurrentUser->access_right('Generate quotation');
36
37 my $can_disable = $FS::CurrentUser::CurrentUser->access_right('Disable quotation');
38
39 </%init>