From 600a0939e7e7e589dae4f4f5bfef3650728940b7 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 8 Mar 2006 10:05:01 +0000 Subject: Add a new table for inventory with for DIDs/serials/etc., and an additional new table for inventory category (i.e. to distinguish DIDs, serials, MACs, etc.) --- httemplate/edit/elements/edit.html | 118 +++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 httemplate/edit/elements/edit.html (limited to 'httemplate/edit/elements/edit.html') diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html new file mode 100644 index 000000000..ce6e2dbb1 --- /dev/null +++ b/httemplate/edit/elements/edit.html @@ -0,0 +1,118 @@ +<% + + # options example... + # + # 'name' => + # 'table' => + # #? 'primary_key' => #required when the dbdef doesn't know...??? + # 'labels' => { + # 'column' => 'Label', + # } + # + # listref - each item is a literal column name (or method) or (notyet) coderef + # if not specified all columns (except for the primary key) will be editable + # 'fields' => [ + # ] + # + # 'menubar' => '', #menubar arrayref + + my(%opt) = @_; + + #false laziness w/process.html + my $table = $opt{'table'}; + my $class = "FS::$table"; + my $pkey = dbdef->table($table)->primary_key; #? $opt{'primary_key'} || + my $fields = $opt{'fields'} + #|| [ grep { $_ ne $pkey } dbdef->table($table)->columns ]; + || [ grep { $_ ne $pkey } fields($table) ]; + + my $object; + if ( $cgi->param('error') ) { + + $object = $class->new( { + map { $_ => scalar($cgi->param($_)) } fields($table) + }); + + } elsif ( $cgi->keywords ) { #editing + + my( $query ) = $cgi->keywords; + $query =~ /^(\d+)$/; + $object = qsearchs( $table, { $pkey => $1 } ); + + } else { #adding + + $object = $class->new( {} ); + + } + + my $action = $object->$pkey() ? 'Edit' : 'Add'; + + my $title = "$action $opt{'name'}"; + + my @menubar = (); + if ( $opt{'menubar'} ) { + @menubar = @{ $opt{'menubar'} }; + } else { + @menubar = ( + 'Main menu' => $p, #eventually get rid of this when the ACL/UI update is done + "View all $opt{'name'}s" => "${p}search/$table.html", #eventually use Lingua::bs to pluralize + ); + } + +%> + + +<%= include("/elements/header.html", $title, + include( '/elements/menubar.html', @menubar ) + ) +%> + +<% if ( $cgi->param('error') ) { %> + Error: <%= $cgi->param('error') %> +

+<% } %> + +
+ +<%= ( $opt{labels} && exists $opt{labels}->{$pkey} ) + ? $opt{labels}->{$pkey} + : $pkey +%> +#<%= $object->$pkey() || "(NEW)" %> + +<%= ntable("#cccccc",2) %> + +<% foreach my $field ( @$fields ) { %> + + + + + <%= ( $opt{labels} && exists $opt{labels}->{$field} ) + ? $opt{labels}->{$field} + : $field + %> + + + <% + #just text in one size for now... eventually more options for + # uneditable, hidden, + + + + +<% } %> + + + +
+ +"> + +
+ +<%= include("/elements/footer.html") %> + -- cgit v1.2.1 From 1a033848671cad2cbe7687b37fc718b3b2a68b83 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 22 Apr 2006 00:58:40 +0000 Subject: start of package class web UI (add/edit package classes, package class selection in package def edit) --- httemplate/edit/elements/edit.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'httemplate/edit/elements/edit.html') diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index ce6e2dbb1..5486b4b00 100644 --- a/httemplate/edit/elements/edit.html +++ b/httemplate/edit/elements/edit.html @@ -15,6 +15,8 @@ # ] # # 'menubar' => '', #menubar arrayref + # + # 'viewall_dir' => '', #'search' or 'browse', defaults to 'search' my(%opt) = @_; @@ -55,7 +57,9 @@ } else { @menubar = ( 'Main menu' => $p, #eventually get rid of this when the ACL/UI update is done - "View all $opt{'name'}s" => "${p}search/$table.html", #eventually use Lingua::bs to pluralize + #eventually use Lingua::bs to pluralize + "View all $opt{'name'}s" => $p. ( $opt{'viewall_dir'} || 'search' ). + "/$table.html", ); } -- cgit v1.2.1 From 2c757d7db4cb6a7b9655de13206fcc84fb7ce61f Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 14 May 2006 16:47:31 +0000 Subject: first part of ACL and re-skinning work and some other small stuff --- httemplate/edit/elements/edit.html | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'httemplate/edit/elements/edit.html') diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index 5486b4b00..120c03a3c 100644 --- a/httemplate/edit/elements/edit.html +++ b/httemplate/edit/elements/edit.html @@ -17,6 +17,13 @@ # 'menubar' => '', #menubar arrayref # # 'viewall_dir' => '', #'search' or 'browse', defaults to 'search' + # + # 'html_bottom' => '', #string + # 'html_bottom' => sub { + # my $object = shift; + # # ... + # "html_string"; + # }, my(%opt) = @_; @@ -27,6 +34,7 @@ my $fields = $opt{'fields'} #|| [ grep { $_ ne $pkey } dbdef->table($table)->columns ]; || [ grep { $_ ne $pkey } fields($table) ]; + #my @actualfields = map { ref($_) ? $_->{'field'} : $_ } @$fields; my $object; if ( $cgi->param('error') ) { @@ -63,10 +71,7 @@ ); } -%> - - -<%= include("/elements/header.html", $title, +%><%= include("/elements/header.html", $title, include( '/elements/menubar.html', @menubar ) ) %> @@ -86,7 +91,18 @@ <%= ntable("#cccccc",2) %> -<% foreach my $field ( @$fields ) { %> +<% foreach my $f ( @$fields ) { + + my( $field, $type); + if ( ref($f) ) { + $field = $f->{'field'}, + $type = $f->{'type'} || 'text', + } else { + $field = $f; + $type = 'text'; + } + +%> @@ -98,12 +114,11 @@ <% - #just text in one size for now... eventually more options for - # uneditable, hidden, , etc. fields %> - + @@ -112,6 +127,11 @@ +<%= ref( $opt{'html_bottom'} ) + ? &{ $opt{'html_bottom'} }( $object ) + : $opt{'html_bottom'} +%> +
"> -- cgit v1.2.1 From c738a3c4923774b64960aa87fa58bd0751487edb Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 18 Jun 2006 12:54:49 +0000 Subject: ACLs: finish group edit (agents + rights) & browse --- httemplate/edit/elements/edit.html | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'httemplate/edit/elements/edit.html') diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index 120c03a3c..94bf6eecd 100644 --- a/httemplate/edit/elements/edit.html +++ b/httemplate/edit/elements/edit.html @@ -16,6 +16,18 @@ # # 'menubar' => '', #menubar arrayref # + # #run when re-displaying with an error + # 'error_callback' => sub { my $cgi, $object = @_; }, + # + # #run when editing + # 'edit_callback' => sub { my $cgi, $object = @_; }, + # + # #run when adding + # 'new_callback' => sub { my $cgi, $object = @_; }, + # + # #broken'html_table_bottom' => '', #string or listref of additinal HTML to + # #add before + # # 'viewall_dir' => '', #'search' or 'browse', defaults to 'search' # # 'html_bottom' => '', #string @@ -43,16 +55,25 @@ map { $_ => scalar($cgi->param($_)) } fields($table) }); + &{$opt{'error_callback'}}($cgi, $object) + if $opt{'error_callback'}; + } elsif ( $cgi->keywords ) { #editing my( $query ) = $cgi->keywords; $query =~ /^(\d+)$/; $object = qsearchs( $table, { $pkey => $1 } ); + &{$opt{'edit_callback'}}($cgi, $object) + if $opt{'edit_callback'}; + } else { #adding $object = $class->new( {} ); + &{$opt{'new_callback'}}($cgi, $object) + if $opt{'new_callback'}; + } my $action = $object->$pkey() ? 'Edit' : 'Add'; -- cgit v1.2.1 From bb65b62d3d68ac0788f230fe2e35ebe1913fc0f5 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 18 Jun 2006 12:56:20 +0000 Subject: well, it isn't broken... --- httemplate/edit/elements/edit.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/elements/edit.html') diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index 94bf6eecd..6fa2b3b6e 100644 --- a/httemplate/edit/elements/edit.html +++ b/httemplate/edit/elements/edit.html @@ -25,8 +25,9 @@ # #run when adding # 'new_callback' => sub { my $cgi, $object = @_; }, # - # #broken'html_table_bottom' => '', #string or listref of additinal HTML to - # #add before + # #uninmplemented + # #'html_table_bottom' => '', #string or listref of additinal HTML to + # # #add before # # 'viewall_dir' => '', #'search' or 'browse', defaults to 'search' # -- cgit v1.2.1 From 1053db7f76169cbbc87840539959a4c362aff242 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 12 Jul 2006 00:20:23 +0000 Subject: svc_phone service and CDR billing from imported CDRs --- httemplate/edit/elements/edit.html | 68 +++++++++++++++++++++++++++----------- 1 file changed, 48 insertions(+), 20 deletions(-) (limited to 'httemplate/edit/elements/edit.html') diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index 6fa2b3b6e..f79cc0b24 100644 --- a/httemplate/edit/elements/edit.html +++ b/httemplate/edit/elements/edit.html @@ -9,25 +9,35 @@ # 'column' => 'Label', # } # - # listref - each item is a literal column name (or method) or (notyet) coderef + # listref - each item is a literal column name (or method) or hashref + # or (notyet) coderef # if not specified all columns (except for the primary key) will be editable # 'fields' => [ + # 'columname', + # { 'field' => 'another_columname', + # 'type' => 'text', #text, fixed, hidden + # }, # ] # # 'menubar' => '', #menubar arrayref # # #run when re-displaying with an error - # 'error_callback' => sub { my $cgi, $object = @_; }, + # 'error_callback' => sub { my( $cgi, $object ) = @_; }, # # #run when editing - # 'edit_callback' => sub { my $cgi, $object = @_; }, + # 'edit_callback' => sub { my( $cgi, $object ) = @_; }, + # + # # returns a hashref for the new object + # 'new_hashref_callback' # # #run when adding - # 'new_callback' => sub { my $cgi, $object = @_; }, + # 'new_callback' => sub { my( $cgi, $object ) = @_; }, + # + # #XXX describe + # 'field_callback' => sub { }, # - # #uninmplemented - # #'html_table_bottom' => '', #string or listref of additinal HTML to - # # #add before + # #string or coderef of additional HTML to add before + # 'html_table_bottom' => '', # # 'viewall_dir' => '', #'search' or 'browse', defaults to 'search' # @@ -64,13 +74,19 @@ my( $query ) = $cgi->keywords; $query =~ /^(\d+)$/; $object = qsearchs( $table, { $pkey => $1 } ); + warn "$table $pkey => $1" + if $opt{'debug'}; &{$opt{'edit_callback'}}($cgi, $object) if $opt{'edit_callback'}; } else { #adding - $object = $class->new( {} ); + my $hashref = $opt{'new_hashref_callback'} + ? &{$opt{'new_hashref_callback'}} + : {}; + + $object = $class->new( $hashref ); &{$opt{'new_callback'}}($cgi, $object) if $opt{'new_callback'}; @@ -113,16 +129,15 @@ <%= ntable("#cccccc",2) %> -<% foreach my $f ( @$fields ) { +<% foreach my $f ( map { ref($_) ? $_ : {'field'=>$_} } + @$fields + ) { - my( $field, $type); - if ( ref($f) ) { - $field = $f->{'field'}, - $type = $f->{'type'} || 'text', - } else { - $field = $f; - $type = 'text'; - } + &{ $opt{'field_callback'} }( $f ) + if $opt{'field_callback'}; + + my $field = $f->{'field'}; + my $type = $f->{'type'} ||= 'text'; %> @@ -137,16 +152,29 @@ <% #eventually more options for - + <%= $f->{'value'} %> + + + <% } else { %> + + + + + + <% } %> <% } %> +<%= ref( $opt{'html_table_bottom'} ) + ? &{ $opt{'html_table_bottom'} }( $object ) + : $opt{'html_table_bottom'} +%> + <%= ref( $opt{'html_bottom'} ) -- cgit v1.2.1 From 7aae40398f1c8ed42424f1694640c9796a580d22 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 7 Aug 2006 02:44:29 +0000 Subject: add internal user disable-ing --- httemplate/edit/elements/edit.html | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'httemplate/edit/elements/edit.html') diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index f79cc0b24..c40a00492 100644 --- a/httemplate/edit/elements/edit.html +++ b/httemplate/edit/elements/edit.html @@ -15,7 +15,9 @@ # 'fields' => [ # 'columname', # { 'field' => 'another_columname', - # 'type' => 'text', #text, fixed, hidden + # 'type' => 'text', #text, fixed, hidden, checkbox + # #eventually more for , etc. fields - if ( $type eq 'fixed' ) { - %> + <% if ( $type eq 'fixed' ) { %> <%= $f->{'value'} %> + <% } elsif ( $type eq 'checkbox' ) { %> + + + $field() eq $f->{'value'} ? ' CHECKED' : '' %>> + + <% } else { %> -- cgit v1.2.1 From 3ce7691203a7737406bf2d4442f7fd84b81f847e Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 23 Aug 2006 22:25:39 +0000 Subject: Will things ever be the same again? It's the final masonize --- httemplate/edit/elements/edit.html | 298 +++++++++++++++++++------------------ 1 file changed, 150 insertions(+), 148 deletions(-) (limited to 'httemplate/edit/elements/edit.html') diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index c40a00492..ac00fc5f0 100644 --- a/httemplate/edit/elements/edit.html +++ b/httemplate/edit/elements/edit.html @@ -1,197 +1,199 @@ -<% - - # options example... - # - # 'name' => - # 'table' => - # #? 'primary_key' => #required when the dbdef doesn't know...??? - # 'labels' => { - # 'column' => 'Label', - # } - # - # listref - each item is a literal column name (or method) or hashref - # or (notyet) coderef - # if not specified all columns (except for the primary key) will be editable - # 'fields' => [ - # 'columname', - # { 'field' => 'another_columname', - # 'type' => 'text', #text, fixed, hidden, checkbox - # #eventually more for , etc. +% # 'value' => 'Y', #only for checkbox +% # }, +% # ] +% # +% # 'menubar' => '', #menubar arrayref +% # +% # #run when re-displaying with an error +% # 'error_callback' => sub { my( $cgi, $object ) = @_; }, +% # +% # #run when editing +% # 'edit_callback' => sub { my( $cgi, $object ) = @_; }, +% # +% # # returns a hashref for the new object +% # 'new_hashref_callback' +% # +% # #run when adding +% # 'new_callback' => sub { my( $cgi, $object ) = @_; }, +% # +% # #XXX describe +% # 'field_callback' => sub { }, +% # +% # #string or coderef of additional HTML to add before +% # 'html_table_bottom' => '', +% # +% # 'viewall_dir' => '', #'search' or 'browse', defaults to 'search' +% # +% # 'html_bottom' => '', #string +% # 'html_bottom' => sub { +% # my $object = shift; +% # # ... +% # "html_string"; +% # }, +% +% my(%opt) = @_; +% +% #false laziness w/process.html +% my $table = $opt{'table'}; +% my $class = "FS::$table"; +% my $pkey = dbdef->table($table)->primary_key; #? $opt{'primary_key'} || +% my $fields = $opt{'fields'} +% #|| [ grep { $_ ne $pkey } dbdef->table($table)->columns ]; +% || [ grep { $_ ne $pkey } fields($table) ]; +% #my @actualfields = map { ref($_) ? $_->{'field'} : $_ } @$fields; +% +% my $object; +% if ( $cgi->param('error') ) { +% +% $object = $class->new( { +% map { $_ => scalar($cgi->param($_)) } fields($table) +% }); +% +% &{$opt{'error_callback'}}($cgi, $object) +% if $opt{'error_callback'}; +% +% } elsif ( $cgi->keywords ) { #editing +% +% my( $query ) = $cgi->keywords; +% $query =~ /^(\d+)$/; +% $object = qsearchs( $table, { $pkey => $1 } ); +% warn "$table $pkey => $1" +% if $opt{'debug'}; +% +% &{$opt{'edit_callback'}}($cgi, $object) +% if $opt{'edit_callback'}; +% +% } else { #adding +% +% my $hashref = $opt{'new_hashref_callback'} +% ? &{$opt{'new_hashref_callback'}} +% : {}; +% +% $object = $class->new( $hashref ); +% +% &{$opt{'new_callback'}}($cgi, $object) +% if $opt{'new_callback'}; +% +% } +% +% my $action = $object->$pkey() ? 'Edit' : 'Add'; +% +% my $title = "$action $opt{'name'}"; +% +% my @menubar = (); +% if ( $opt{'menubar'} ) { +% @menubar = @{ $opt{'menubar'} }; +% } else { +% @menubar = ( +% 'Main menu' => $p, #eventually get rid of this when the ACL/UI update is done +% #eventually use Lingua::bs to pluralize +% "View all $opt{'name'}s" => $p. ( $opt{'viewall_dir'} || 'search' ). +% "/$table.html", +% ); +% } +% +% +<% include("/elements/header.html", $title, include( '/elements/menubar.html', @menubar ) ) %> +% if ( $cgi->param('error') ) { -<% if ( $cgi->param('error') ) { %> - Error: <%= $cgi->param('error') %> + Error: <% $cgi->param('error') %>

-<% } %> +% } -
- -<%= ( $opt{labels} && exists $opt{labels}->{$pkey} ) + + + +<% ( $opt{labels} && exists $opt{labels}->{$pkey} ) ? $opt{labels}->{$pkey} : $pkey %> -#<%= $object->$pkey() || "(NEW)" %> - -<%= ntable("#cccccc",2) %> - -<% foreach my $f ( map { ref($_) ? $_ : {'field'=>$_} } - @$fields - ) { +#<% $object->$pkey() || "(NEW)" %> + +<% ntable("#cccccc",2) %> +% foreach my $f ( map { ref($_) ? $_ : {'field'=>$_} } +% @$fields +% ) { +% +% &{ $opt{'field_callback'} }( $f ) +% if $opt{'field_callback'}; +% +% my $field = $f->{'field'}; +% my $type = $f->{'type'} ||= 'text'; +% +% - &{ $opt{'field_callback'} }( $f ) - if $opt{'field_callback'}; - - my $field = $f->{'field'}; - my $type = $f->{'type'} ||= 'text'; - -%> - <%= ( $opt{labels} && exists $opt{labels}->{$field} ) + <% ( $opt{labels} && exists $opt{labels}->{$field} ) ? $opt{labels}->{$field} : $field %> +% if ( $type eq 'fixed' ) { - <% if ( $type eq 'fixed' ) { %> - <%= $f->{'value'} %> - + <% $f->{'value'} %> + +% } elsif ( $type eq 'checkbox' ) { - <% } elsif ( $type eq 'checkbox' ) { %> - $field() eq $f->{'value'} ? ' CHECKED' : '' %>> + $field() eq $f->{'value'} ? ' CHECKED' : '' %>> +% } else { - <% } else { %> - + +% } - <% } %> +% } -<% } %> -<%= ref( $opt{'html_table_bottom'} ) +<% ref( $opt{'html_table_bottom'} ) ? &{ $opt{'html_table_bottom'} }( $object ) : $opt{'html_table_bottom'} %> -<%= ref( $opt{'html_bottom'} ) +<% ref( $opt{'html_bottom'} ) ? &{ $opt{'html_bottom'} }( $object ) : $opt{'html_bottom'} %>
-"> +">
-<%= include("/elements/footer.html") %> +<% include("/elements/footer.html") %> -- cgit v1.2.1 From 52281cbeaf8d4e02345eca3c1aa0500133823558 Mon Sep 17 00:00:00 2001 From: jeff Date: Wed, 18 Oct 2006 23:07:08 +0000 Subject: suspension and cancellation reasons --- httemplate/edit/elements/edit.html | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'httemplate/edit/elements/edit.html') diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index ac00fc5f0..750e62f97 100644 --- a/httemplate/edit/elements/edit.html +++ b/httemplate/edit/elements/edit.html @@ -71,9 +71,10 @@ % &{$opt{'error_callback'}}($cgi, $object) % if $opt{'error_callback'}; % -% } elsif ( $cgi->keywords ) { #editing +% } elsif ( $cgi->keywords || $cgi->param($pkey) ) { #editing % % my( $query ) = $cgi->keywords; +% $query = $cgi->param($pkey) unless $query; % $query =~ /^(\d+)$/; % $object = qsearchs( $table, { $pkey => $1 } ); % warn "$table $pkey => $1" @@ -99,6 +100,9 @@ % % my $title = "$action $opt{'name'}"; % +% my $viewall_url = $p . ( $opt{'viewall_dir'} || 'search' ) . "/$table.html"; +% $viewall_url = $opt{'viewall_url'} if $opt{'viewall_url'}; +% % my @menubar = (); % if ( $opt{'menubar'} ) { % @menubar = @{ $opt{'menubar'} }; @@ -106,8 +110,7 @@ % @menubar = ( % 'Main menu' => $p, #eventually get rid of this when the ACL/UI update is done % #eventually use Lingua::bs to pluralize -% "View all $opt{'name'}s" => $p. ( $opt{'viewall_dir'} || 'search' ). -% "/$table.html", +% "View all $opt{'name'}s" => $viewall_url, % ); % } % @@ -157,6 +160,10 @@ <% $f->{'value'} %> + +% } elsif ( $type eq 'fixedhidden' ) { + + % } elsif ( $type eq 'checkbox' ) { @@ -164,6 +171,18 @@ $field() eq $f->{'value'} ? ' CHECKED' : '' %>> +% } elsif ( $type eq 'select' ) { + + + % } else { -- cgit v1.2.1 From 6e3477c3068b88ad702316cd2d57e04c52de5855 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 29 Dec 2006 07:23:21 +0000 Subject: document field types --- httemplate/edit/elements/edit.html | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'httemplate/edit/elements/edit.html') diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index 750e62f97..c2ea22f27 100644 --- a/httemplate/edit/elements/edit.html +++ b/httemplate/edit/elements/edit.html @@ -15,9 +15,13 @@ % # 'fields' => [ % # 'columname', % # { 'field' => 'another_columname', -% # 'type' => 'text', #text, fixed, hidden, checkbox -% # #eventually more for -% } elsif ( $type eq 'fixedhidden' ) { +% } elsif ( $type eq 'fixedhidden' ) { -% } elsif ( $type eq 'checkbox' ) { +% } elsif ( $type eq 'checkbox' ) { $field() eq $f->{'value'} ? ' CHECKED' : '' %>> + % } elsif ( $type eq 'select' ) { + -% } else { +% } else { -% } +% } -% } +% } <% ref( $opt{'html_table_bottom'} ) ? &{ $opt{'html_table_bottom'} }( $object ) -- cgit v1.2.1 From 633c48448d9468690b7ad77eb6ff7c660a286658 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 29 Dec 2006 08:51:34 +0000 Subject: service refactor! --- httemplate/edit/elements/edit.html | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'httemplate/edit/elements/edit.html') diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index c2ea22f27..17c5ad3eb 100644 --- a/httemplate/edit/elements/edit.html +++ b/httemplate/edit/elements/edit.html @@ -53,6 +53,9 @@ % # # ... % # "html_string"; % # }, +% # +% # # overrides default popurl(1)."process/$table.html" +% # 'post_url' => popurl(1).'process/something', % % my(%opt) = @_; % @@ -77,9 +80,14 @@ % % } elsif ( $cgi->keywords || $cgi->param($pkey) ) { #editing % -% my( $query ) = $cgi->keywords; -% $query = $cgi->param($pkey) unless $query; -% $query =~ /^(\d+)$/; +% my $value; +% if ( $cgi->param($pkey) ) { +% $value = $cgi->param($pkey) +% } else { +% my( $query ) = $cgi->keywords; +% $value = $query; +% } +% $value =~ /^(\d+)$/ or die "unparsable $pkey"; % $object = qsearchs( $table, { $pkey => $1 } ); % warn "$table $pkey => $1" % if $opt{'debug'}; @@ -129,8 +137,10 @@

% } +% my $url = $opt{'post_url'} || popurl(1)."process/$table.html"; -
+ + <% ( $opt{labels} && exists $opt{labels}->{$pkey} ) ? $opt{labels}->{$pkey} -- cgit v1.2.1