/[A3C]/lib/A3C/View/Strix.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/View/Strix.pm

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

revision 217 by dpavlin, Fri Jun 20 22:37:33 2008 UTC revision 221 by dpavlin, Mon Jun 23 00:12:56 2008 UTC
# Line 158  Execute SQL query on instance Line 158  Execute SQL query on instance
158    
159  template 'execute-sql' => sub {  template 'execute-sql' => sub {
160    
161            my $sql = get('sql') || Jifty->web->session->get('sql');
162            warn ">>>> sql = $sql";
163            my $instance = get('instance');
164            warn ">>>> instance = $instance";
165    
166          my $action = new_action(          my $action = new_action(
167                  class   => 'StrixSQL',                  class   => 'StrixSQL',
168                  moniker => 'strix-sql',                  moniker => 'strix-sql',
169                  sticky_on_success => 1,                  sticky_on_success => 1,
170                  sticky_on_failure => 1,                  sticky_on_failure => 1,
171                  arguments => {                  arguments => {
172                          instance => get('instance')                          instance => $instance,
173                  }                          sql => $sql,
174                    },
175          );          );
176    
177          form {          form {
178                  render_action( $action => [ 'instance', 'sql' ] );                  render_action( $action, [ 'instance', 'sql' ] );
179                  form_submit( label => _('Execute SQL') );                  form_submit( label => _('Execute SQL') );
180          };          };
181    
182          if ( my $sql = $action->result->content('sql') ) {          if ( my $sql = $action->result->content('sql') ) {
183                  div { _('Found %1 results', $sql->count ) }                  Jifty->web->session->set( sql => $sql->query );
184                    div { _('Found %1 results for %2', $sql->count, $instance ) }
185                  table {                  table {
186                          row { map { th { $_ } } $sql->_column_names };                          row { map { th { $_ } } $sql->_column_names };
187                          while (my $row = $sql->next) {                          while (my $row = $sql->next) {
# Line 186  template 'execute-sql' => sub { Line 193  template 'execute-sql' => sub {
193                          }                          }
194                  }                  }
195          }          }
196            warn ">>>> sql (at end) = ",Jifty->web->session->get('sql');
197  };  };
198    
199  =head2 search-instances  =head2 search-instances

Legend:
Removed from v.217  
changed lines
  Added in v.221

  ViewVC Help
Powered by ViewVC 1.1.26