1 |
<%args> |
2 |
$landscape_id |
3 |
</%args> |
4 |
<%init> |
5 |
|
6 |
my $transport = Jifty->web->new_action( |
7 |
class => 'CreateTransport', |
8 |
monkier => 'create', |
9 |
); |
10 |
|
11 |
my $l = Transports::Model::Landscape->new(); |
12 |
$l->load_by_cols( id => $landscape_id ); |
13 |
|
14 |
$m->out("Can't find landscape with id $landscape_id") if (! $l->id); |
15 |
|
16 |
my $s = Transports::Model::SourceCollection->new(); |
17 |
$s->limit( |
18 |
column => 'landscape', |
19 |
value => $landscape_id, |
20 |
); |
21 |
$transport->arguments->{'source'}->{'valid_values'}->[0]->{'collection'} = $s; |
22 |
|
23 |
my $d = Transports::Model::DestinationCollection->new(); |
24 |
$d->limit( |
25 |
column => 'landscape', |
26 |
value => $landscape_id, |
27 |
); |
28 |
$transport->arguments->{'destination'}->{'valid_values'}->[0]->{'collection'} = $d; |
29 |
</%init> |
30 |
|
31 |
<h2>Enter new transport request in <% $l->name %></h2> |
32 |
|
33 |
<% Jifty->web->form->start %> |
34 |
<% Jifty->web->form->next_page( url => '/transports' ) %> |
35 |
<% $transport->form_field('class', render_as => 'radio') %> |
36 |
<% $transport->form_field('source') %> |
37 |
<% $transport->form_field('destination') %> |
38 |
<% $transport->form_field('request_nr') %> |
39 |
<% $transport->form_field('client_dependent') %> |
40 |
<% $transport->form_field('description') %> |
41 |
|
42 |
<% Jifty->web->form->submit(label => 'Add transport' ) %> |
43 |
<% Jifty->web->form->end %> |