CatalystX-ListFramework
view release on metacpan or search on metacpan
lib/CatalystX/ListFramework.pm view on Meta::CPAN
sub get :Local {
my ($self, $c, $kind, $id) = @_;
my $lf = CatalystX::ListFramework->new($kind, $c);
$lf->stash_infoboxes({'me.id' => $id});
$c->stash->{kind} = $kind;
$c->stash->{id} = $id; # the update form adds this to the URL
$c->stash->{template} = 'detail.tt';
}
sub update :Local {
my ($self, $c, $kind, $id) = @_;
my $lf = CatalystX::ListFramework->new($kind, $c);
$lf->update_from_query({'me.id' => $id});
$c->res->redirect("/listandsearch/$kind");
}
sub create :Local {
my ($self, $c, $kind) = @_;
my $lf = CatalystX::ListFramework->new($kind, $c);
my $id = $lf->create_new;
lib/CatalystX/ListFramework.pm view on Meta::CPAN
<=>
$self->{formdef}->{infobox_order}->{$b->{id}}
} @$box_metadata;
}
$c->stash->{box_metadata} = $box_metadata;
$c->stash->{box_data} = $box_data;
return 1;
}
sub update_from_query { # Update a record. Probably called from an infobox screen
my ($self, $search) = @_;
my $c = $self->{c};
my $rs = $c->model($self->{formdef}->{model})->search($search, {}); # NB: no joins. We'll assume we're looking locally for an id
my $db_row_obj = $rs->first;
unless (ref $db_row_obj) { confess "No such object found"; }
# All editable fields must be listed in the infobox section
my $all_cols;
foreach my $box (keys %{$self->{formdef}->{infoboxes}}) {
my $columns = $self->{formdef}->{infoboxes}->{$box};
t/lib/TestApp/Controller/Root.pm view on Meta::CPAN
# $c->stash->{add_to_create} = $id;
# In one project, we used this to make the create-new userprefs_* link /create/userprefs*/userid so that
# the newly created thing would be associated with the user we were looking at (&create() took an extra arg).
# So, TODO We need a proper way of telling the /create form to set 'fromalbum' to the album we're editing.
$c->stash->{"myprefixoptions"}->{deletable} = 1;
}
$c->view('TT')->process($c);
}
sub update :Path('/update') {
my ($self, $c, $kind, $id) = @_;
my $lf = CatalystX::ListFramework->new($kind, $c);
$lf->update_from_query({'me.id' => [{'=' => $id}]});
$c->stash->{template} = 'refreshopener.tt';
$c->view('TT')->process($c);
}
sub create :Path('/create') {
my ($self, $c, $kind) = @_;
my $lf = CatalystX::ListFramework->new($kind, $c);
( run in 0.545 second using v1.01-cache-2.11-cpan-4d4bc49f3ae )