summaryrefslogtreecommitdiff
path: root/httemplate/edit/elements
diff options
context:
space:
mode:
authorjeff <jeff>2008-06-28 19:25:24 +0000
committerjeff <jeff>2008-06-28 19:25:24 +0000
commita1871d3d13c1dafa93b956762c0d23728d261da7 (patch)
treeecd799ff28ca27d5e2ef07a615bcac49621dd391 /httemplate/edit/elements
parent7588be4eb948426b972d0238dcdbb1537dc6a72a (diff)
agent virtualize address blocks and routers
Diffstat (limited to 'httemplate/edit/elements')
-rw-r--r--httemplate/edit/elements/edit.html16
-rw-r--r--httemplate/edit/elements/svc_Common.html21
2 files changed, 31 insertions, 6 deletions
diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html
index 86eb2b3..47b2464 100644
--- a/httemplate/edit/elements/edit.html
+++ b/httemplate/edit/elements/edit.html
@@ -108,8 +108,8 @@ Example:
#run before display to return a different value
'value_callback' => sub { my( $columname, $value ) = @_; },
- #XXX describe
- 'field_callback' => sub { },
+ #run before display to manipulate element of the 'fields' arrayref
+ 'field_callback' => sub { my( $cgi, $object, $field_hashref ) = @_; },
'viewall_dir' => '', #'search' or 'browse', defaults to 'search'
@@ -179,7 +179,7 @@ Example:
% @$fields
% ) {
%
-% &{ $opt{'field_callback'} }( $f )
+% my $trash = &{ $opt{'field_callback'} }( $cgi, $object, $f )
% if $opt{'field_callback'};
%
% my $field = $f->{'field'};
@@ -227,10 +227,18 @@ Example:
% 'disabled' => $f->{'disabled'},
% );
%
-% #select-table
+% #select-table, checkboxes-table
% $include_common{$_} = $f->{$_}
% foreach grep exists($f->{$_}), qw( table name_col );
%
+% #checkboxes-table
+% $include_common{$_} = $f->{$_}
+% foreach grep exists($f->{$_}), qw( target_table link_table );
+%
+% #*-table
+% $include_common{$_} = $f->{$_}
+% foreach grep exists($f->{$_}), qw( hashref agent_virt agent_null_right );
+%
% if ( $type eq 'tablebreak-tr-title' ) {
% $include_common{'table_id'} = 'TableNumber'. $tablenum++
% }
diff --git a/httemplate/edit/elements/svc_Common.html b/httemplate/edit/elements/svc_Common.html
index 72abcba..b6737c1 100644
--- a/httemplate/edit/elements/svc_Common.html
+++ b/httemplate/edit/elements/svc_Common.html
@@ -13,7 +13,7 @@
% $pkgnum = $1;
% $cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart';
% $svcpart = $1;
-% $cgi->delete_all(); #so edit.html treats this correctly as new??
+% #$cgi->delete_all(); #so edit.html treats this correctly as new??
% }
%
<% include( 'edit.html',
@@ -63,7 +63,7 @@
},
'field_callback' => sub {
- my $f = shift;
+ my ($cgi, $object, $f) = @_;
my $columndef = $part_svc->part_svc_column($f->{'field'});
my $flag = $columndef->columnflag;
if ( $flag eq 'F' ) {
@@ -72,6 +72,23 @@
}
},
+ 'html_init' => sub {
+ my $cust_main;
+ if ( $pkgnum ) {
+ my $cust_pkg = qsearchs('cust_pkg', {'pkgnum' => $pkgnum});
+ $cust_main = $cust_pkg->cust_main if $cust_pkg;
+ }
+ $cust_main
+ ? include( '/elements/small_custview.html',
+ $cust_main,
+ '',
+ 1,
+ popurl(2). "view/cust_main.cgi"
+ ). '<BR>'
+ : '';
+
+ },
+
'html_table_bottom' => sub {
my $svc_x = shift;
my $html = '';