import torrus 1.0.9
[freeside.git] / httemplate / edit / process / svc_phone.html
1 <% include( 'elements/svc_Common.html',
2                'table'    => 'svc_phone',
3                'args_callback' => $args_callback,
4                'value_callback' => $value_callback,
5            )
6 %>
7 <%init>
8
9 die "access denied"
10   unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
11
12 my $args_callback = sub {
13   my( $cgi, $object ) = @_;
14
15   my %opt = ();
16   if ( $cgi->param('locationnum') == -1 ) {
17     my $cust_location = new FS::cust_location {
18       map { $_ => scalar($cgi->param($_)) }
19           qw( custnum address1 address2 city county state zip country )
20     };
21     $opt{'cust_location'} = $cust_location;
22   }
23
24   %opt;
25
26 };
27
28 my $value_callback = sub {
29      my ($field, $value) = @_;
30      ($field =~ /_date$/) ? parse_datetime($value) : $value;
31 };
32
33 </%init>