12 |
label is _('Instance identifier'), |
label is _('Instance identifier'), |
13 |
is mandatory, |
is mandatory, |
14 |
type is 'text', |
type is 'text', |
15 |
|
is ajax_validates, |
16 |
refers_to A3C::Model::StrixInstance by 'instance'; |
refers_to A3C::Model::StrixInstance by 'instance'; |
17 |
|
|
18 |
column by_user => |
column by_user => |
34 |
my $strix = A3C::Model::StrixInstanceSelection->new; |
my $strix = A3C::Model::StrixInstanceSelection->new; |
35 |
$strix->load_by_cols( instance => $instance ); |
$strix->load_by_cols( instance => $instance ); |
36 |
|
|
37 |
return ( 0, _('Instance %1 is allready selected', $instance) ) if $strix->id; |
if ( $strix->id ) { |
38 |
return 1; |
return ( 0, _('Instance %1 allready selected', $instance) ); |
39 |
|
} else { |
40 |
|
eval { |
41 |
|
Strix->dbh( $instance ); |
42 |
|
}; |
43 |
|
return 1 unless $@; |
44 |
|
return ( 0, $@ ); |
45 |
|
} |
46 |
} |
} |
47 |
|
|
48 |
sub current_user_can { |
sub current_user_can { |