[freeside-commits] freeside/httemplate/edit/process/elements
process.html, 1.5, 1.6 svc_Common.html, 1.1, 1.2
Ivan,,,
ivan at wavetail.420.am
Wed Aug 23 15:25:39 PDT 2006
- Previous message: [freeside-commits]
freeside/httemplate/edit/elements edit.html, 1.7,
1.8 svc_Common.html, 1.1, 1.2
- Next message: [freeside-commits]
freeside/httemplate/browse access_group.html, 1.2,
1.3 access_user.html, 1.3, 1.4 addr_block.cgi, 1.2,
1.3 agent.cgi, 1.33, 1.34 agent_type.cgi, 1.16,
1.17 cust_main_county.cgi, 1.14, 1.15 cust_pay_batch.cgi, 1.11,
1.12 inventory_class.html, 1.2, 1.3 msgcat.cgi, 1.4,
1.5 nas.cgi, 1.7, 1.8 part_bill_event.cgi, 1.11,
1.12 part_export.cgi, 1.4, 1.5 part_pkg.cgi, 1.34,
1.35 part_referral.html, 1.4, 1.5 part_svc.cgi, 1.26,
1.27 part_virtual_field.cgi, 1.4, 1.5 payment_gateway.html,
1.3, 1.4 pkg_class.html, 1.1, 1.2 rate.cgi, 1.3,
1.4 router.cgi, 1.6, 1.7 svc_acct_pop.cgi, 1.17, 1.18
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/httemplate/edit/process/elements
In directory wavetail:/tmp/cvs-serv18630/httemplate/edit/process/elements
Modified Files:
process.html svc_Common.html
Log Message:
Will things ever be the same again?
It's the final masonize
Index: svc_Common.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/elements/svc_Common.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- svc_Common.html 12 Jul 2006 00:20:22 -0000 1.1
+++ svc_Common.html 23 Aug 2006 22:25:37 -0000 1.2
@@ -1,11 +1,12 @@
-<%
-
- my %opt = @_;
- my $table = $opt{'table'};
- $opt{'fields'} ||= [ fields($table) ];
- push @{ $opt{'fields'} }, qw( pkgnum svcpart );
-
-%><%= include( 'process.html',
+%
+%
+% my %opt = @_;
+% my $table = $opt{'table'};
+% $opt{'fields'} ||= [ fields($table) ];
+% push @{ $opt{'fields'} }, qw( pkgnum svcpart );
+%
+%
+<% include( 'process.html',
'edit_ext' => 'cgi',
'redirect' => popurl(3)."view/$table.cgi?",
%opt,
Index: process.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/elements/process.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- process.html 12 Jul 2006 00:20:22 -0000 1.5
+++ process.html 23 Aug 2006 22:25:37 -0000 1.6
@@ -1,91 +1,92 @@
-<%
-
- # options example...
- #
- ###
- ##req
- ##
- #
- # 'table' =>
- #
- # #? 'primary_key' => #required when the dbdef doesn't know...???
- # #? 'fields' => []
- #
- ###
- ##opt
- ###
- #
- # 'viewall_dir' => '', #'search' or 'browse', defaults to 'search'
- # OR
- # 'redirect' => 'view/table.cgi?', # value of primary key is appended
- #
- # 'edit_ext' => 'html', #defaults to 'html', you might want 'cgi' while the
- # #naming is still inconsistent
- #
- # 'process_m2m' => { 'link_table' => 'link_table_name',
- # 'target_table' => 'target_table_name',
- # },
- # 'process_m2name' => { 'link_table' => 'link_table_name',
- # 'link_static' => { 'column' => 'value' },
- # 'num_col' => 'column', #if column name is different in
- # #link_table than source_table
- # 'name_col' => 'name_column',
- # 'names_list' => [ 'list', 'names' ],
- # },
-
- my(%opt) = @_;
-
- #false laziness w/edit.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 ];
- || [ fields($table) ];
-
- my $pkeyvalue = $cgi->param($pkey);
-
- my $old = qsearchs( $table, { $pkey => $pkeyvalue } ) if $pkeyvalue;
-
- my $new = $class->new( {
- map {
- $_, scalar($cgi->param($_));
- } @$fields
- } );
-
- my $error;
- if ( $pkeyvalue ) {
- $error = $new->replace($old);
- } else {
- $error = $new->insert;
- $pkeyvalue = $new->getfield($pkey);
- }
-
- if ( !$error && $opt{'process_m2m'} ) {
- $error = $new->process_m2m( %{ $opt{'process_m2m'} },
- 'params' => scalar($cgi->Vars),
- );
- }
-
- if ( !$error && $opt{'process_m2name'} ) {
- $error = $new->process_m2name( %{ $opt{'process_m2name'} },
- 'params' => scalar($cgi->Vars),
- );
- }
-
- # XXX print?!?!
-
- if ( $error ) {
- $cgi->param('error', $error);
- my $edit_ext = $opt{'edit_ext'} || 'html';
- print $cgi->redirect(popurl(2). "$table.$edit_ext?". $cgi->query_string );
- } elsif ( $opt{'redirect'} ) {
- print $cgi->redirect( $opt{'redirect'}. $pkeyvalue );
- } else {
- print $cgi->redirect( popurl(3).
- ( $opt{'viewall_dir'} || 'search' ).
- "/$table.html"
- );
- }
+%
+%
+% # options example...
+% #
+% ###
+% ##req
+% ##
+% #
+% # 'table' =>
+% #
+% # #? 'primary_key' => #required when the dbdef doesn't know...???
+% # #? 'fields' => []
+% #
+% ###
+% ##opt
+% ###
+% #
+% # 'viewall_dir' => '', #'search' or 'browse', defaults to 'search'
+% # OR
+% # 'redirect' => 'view/table.cgi?', # value of primary key is appended
+% #
+% # 'edit_ext' => 'html', #defaults to 'html', you might want 'cgi' while the
+% # #naming is still inconsistent
+% #
+% # 'process_m2m' => { 'link_table' => 'link_table_name',
+% # 'target_table' => 'target_table_name',
+% # },
+% # 'process_m2name' => { 'link_table' => 'link_table_name',
+% # 'link_static' => { 'column' => 'value' },
+% # 'num_col' => 'column', #if column name is different in
+% # #link_table than source_table
+% # 'name_col' => 'name_column',
+% # 'names_list' => [ 'list', 'names' ],
+% # },
+%
+% my(%opt) = @_;
+%
+% #false laziness w/edit.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 ];
+% || [ fields($table) ];
+%
+% my $pkeyvalue = $cgi->param($pkey);
+%
+% my $old = qsearchs( $table, { $pkey => $pkeyvalue } ) if $pkeyvalue;
+%
+% my $new = $class->new( {
+% map {
+% $_, scalar($cgi->param($_));
+% } @$fields
+% } );
+%
+% my $error;
+% if ( $pkeyvalue ) {
+% $error = $new->replace($old);
+% } else {
+% $error = $new->insert;
+% $pkeyvalue = $new->getfield($pkey);
+% }
+%
+% if ( !$error && $opt{'process_m2m'} ) {
+% $error = $new->process_m2m( %{ $opt{'process_m2m'} },
+% 'params' => scalar($cgi->Vars),
+% );
+% }
+%
+% if ( !$error && $opt{'process_m2name'} ) {
+% $error = $new->process_m2name( %{ $opt{'process_m2name'} },
+% 'params' => scalar($cgi->Vars),
+% );
+% }
+%
+% # XXX print?!?!
+%
+% if ( $error ) {
+% $cgi->param('error', $error);
+% my $edit_ext = $opt{'edit_ext'} || 'html';
+% print $cgi->redirect(popurl(2). "$table.$edit_ext?". $cgi->query_string );
+% } elsif ( $opt{'redirect'} ) {
+% print $cgi->redirect( $opt{'redirect'}. $pkeyvalue );
+% } else {
+% print $cgi->redirect( popurl(3).
+% ( $opt{'viewall_dir'} || 'search' ).
+% "/$table.html"
+% );
+% }
+%
+%
-%>
- Previous message: [freeside-commits]
freeside/httemplate/edit/elements edit.html, 1.7,
1.8 svc_Common.html, 1.1, 1.2
- Next message: [freeside-commits]
freeside/httemplate/browse access_group.html, 1.2,
1.3 access_user.html, 1.3, 1.4 addr_block.cgi, 1.2,
1.3 agent.cgi, 1.33, 1.34 agent_type.cgi, 1.16,
1.17 cust_main_county.cgi, 1.14, 1.15 cust_pay_batch.cgi, 1.11,
1.12 inventory_class.html, 1.2, 1.3 msgcat.cgi, 1.4,
1.5 nas.cgi, 1.7, 1.8 part_bill_event.cgi, 1.11,
1.12 part_export.cgi, 1.4, 1.5 part_pkg.cgi, 1.34,
1.35 part_referral.html, 1.4, 1.5 part_svc.cgi, 1.26,
1.27 part_virtual_field.cgi, 1.4, 1.5 payment_gateway.html,
1.3, 1.4 pkg_class.html, 1.1, 1.2 rate.cgi, 1.3,
1.4 router.cgi, 1.6, 1.7 svc_acct_pop.cgi, 1.17, 1.18
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list