/[A3C]/lib/A3C/Model/StrixInstanceSelection.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/A3C/Model/StrixInstanceSelection.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 185 by dpavlin, Mon Jun 16 16:48:16 2008 UTC revision 186 by dpavlin, Mon Jun 16 22:56:14 2008 UTC
# Line 12  use A3C::Record schema { Line 12  use A3C::Record schema {
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 =>
# Line 33  sub validate_instance { Line 34  sub validate_instance {
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 {

Legend:
Removed from v.185  
changed lines
  Added in v.186

  ViewVC Help
Powered by ViewVC 1.1.26