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