[Rt-commit] rt branch, admin_ui, updated. 5b1759830a85701df6cbf716e01238259d6d7126
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Fri Jan 1 00:17:20 EST 2010
The branch, admin_ui has been updated
via 5b1759830a85701df6cbf716e01238259d6d7126 (commit)
from 48610699edac8b1cc2c91f0d21ef5336bb9a3fe4 (commit)
Summary of changes:
lib/RT/View/CRUD.pm | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
- Log -----------------------------------------------------------------
commit 5b1759830a85701df6cbf716e01238259d6d7126
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Jan 1 13:16:47 2010 +0800
/admin/.../edit page
diff --git a/lib/RT/View/CRUD.pm b/lib/RT/View/CRUD.pm
index a00d846..4b2e2f2 100644
--- a/lib/RT/View/CRUD.pm
+++ b/lib/RT/View/CRUD.pm
@@ -70,6 +70,9 @@ template 'index.html' => page {
}
};
+# no popup update link
+private template view_item_controls => sub { };
+
sub view_via_callback {
my $self = shift;
my %args = @_;
@@ -209,5 +212,21 @@ sub custom_field_columns {
return map { 'cf_' . $_->id } @{ $cfs->items_array_ref };
}
+# we can't use jifty's default update is because that's a json one
+# which is not capable since we may have file cf
+template 'edit' => page { title => _( 'Update ' . shift->object_type ), }
+content {
+ my $self = shift;
+ my $class = 'RT::Model::' . $self->object_type;
+ my $object = $class->new;
+ $object->load( get('id') );
+
+ my $moniker = 'update_' . lc $self->object_type;
+ my $action = $object->as_update_action( moniker => $moniker, );
+ with( name => $moniker ), form {
+ render_action($action);
+ form_submit( label => _('Save') );
+ };
+};
1;
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list