From 2d45373a520993b33e18b28db6a9db71bc3bd8e4 Mon Sep 17 00:00:00 2001 From: tetragon Date: Tue, 11 Sep 2007 14:00:28 +0000 Subject: Adding elements.html (name-value ids for radios variant from patch 1791319) Adjusting the GL report to not require HTML no_escape git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1561 4979c152-3d1c-0410-bac9-87ea11338e46 --- UI/elements.html | 200 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ UI/gl-report.csv | 4 +- UI/gl-report.html | 36 +++++----- bin/gl.pl | 146 +++++++++++++++++++-------------------- 4 files changed, 293 insertions(+), 93 deletions(-) create mode 100644 UI/elements.html diff --git a/UI/elements.html b/UI/elements.html new file mode 100644 index 00000000..19570e62 --- /dev/null +++ b/UI/elements.html @@ -0,0 +1,200 @@ + '60' + } + + #password + password_defaults = { + size = '60' + } + + # text + text_defaults = { + size = '60', + maxlength = '255' + } + + # textarea + textarea_defaults = { + rows = '5', + cols = '60' + } + + #button + button_defaults = { + type = 'submit' + } + +?> + + + + + + + + /> + + + + + + + > + + + + + + + > + + + + + + + + + + > + + + + + + + > + + + + + + + > + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/UI/gl-report.csv b/UI/gl-report.csv index 83dc27ce..fc2e4b16 100644 --- a/UI/gl-report.csv +++ b/UI/gl-report.csv @@ -1,3 +1,3 @@ -~ -~ +~ +~ ~ diff --git a/UI/gl-report.html b/UI/gl-report.html index 69e2d866..031ef009 100644 --- a/UI/gl-report.html +++ b/UI/gl-report.html @@ -11,9 +11,7 @@ - - - + @@ -28,8 +26,11 @@
- - + + + + + @@ -52,7 +53,12 @@ + + + + + + @@ -73,19 +79,13 @@
- - + - - - - - - - - + 'hidden', name => hidden.0, value => hidden.1} ?> + + 'hidden', name => 'callback', value => form.callback} ?> + + diff --git a/bin/gl.pl b/bin/gl.pl index 16871f25..11476444 100644 --- a/bin/gl.pl +++ b/bin/gl.pl @@ -597,49 +597,28 @@ sub generate_report { $href .= "&category=$form->{category}"; $column_header{id} = - ""; + {text => $locale->text('ID'), href=> "$href&sort=id"}; $column_header{transdate} = - ""; + {text => $locale->text('Date'), href=> "$href&sort=transdate"}; $column_header{reference} = - ""; + {text => $locale->text('Reference'), href=> "$href&sort=reference"}; $column_header{source} = - ""; + {text => $locale->text('Source'), href=> "$href&sort=source"}; $column_header{memo} = - ""; + {text => $locale->text('Memo'), href=> "$href&sort=memo"}; $column_header{description} = - ""; + {text => $locale->text('Description'), href=> "$href&sort=description"}; $column_header{department} = - ""; - $column_header{notes} = - ""; - $column_header{debit} = - ""; - $column_header{credit} = - ""; + {text => $locale->text('Department'), href=> "$href&sort=department"}; + $column_header{notes} = $locale->text('Notes'); + $column_header{debit} = $locale->text('Debit'); + $column_header{credit} = $locale->text('Credit'); $column_header{accno} = - ""; + {text => $locale->text('Account'), href=> "$href&sort=accno"}; $column_header{gifi_accno} = - ""; - $column_header{balance} = ""; - $column_header{cleared} = qq||; + {text => $locale->text('GIFI'), href=> "$href&sort=gifi_accno"}; + $column_header{balance} = $locale->text('Balance'); + $column_header{cleared} = $locale->text('R'); # add sort to callback $form->{callback} = "$callback&sort=$form->{sort}"; @@ -691,16 +670,17 @@ sub generate_report { $totalcredit += $ref->{credit}; $ref->{debit} = - $form->format_amount( \%myconfig, $ref->{debit}, 2, " " ); + $form->format_amount( \%myconfig, $ref->{debit}, 2, " " ); $ref->{credit} = - $form->format_amount( \%myconfig, $ref->{credit}, 2, " " ); + $form->format_amount( \%myconfig, $ref->{credit}, 2, " " ); for (qw(id transdate)) { $column_data{$_} = "$ref->{$_}" } $column_data{reference} = -"{module}.pl?action=edit&id=$ref->{id}&path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}&callback=$callback>$ref->{reference}"; + {href => "$ref->{module}.pl?action=edit&id=$ref->{id}&path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}&callback=$callback", + text => $ref->{reference}}; - $ref->{notes} =~ s/\r?\n/
/g; + #$ref->{notes} =~ s/\r?\n/
/g; for (qw(description source memo notes department)) { $column_data{$_} = "$ref->{$_} "; } @@ -709,9 +689,11 @@ sub generate_report { $column_data{credit} = "$ref->{credit}"; $column_data{accno} = -"
{accno}&callback=$callback>$ref->{accno} $ref->{accname}"; + {href => "$href&accno=$ref->{accno}&callback=$callback", + text => "$ref->{accno} $ref->{accname}"}; $column_data{gifi_accno} = -"{gifi_accno}&callback=$callback>$ref->{gifi_accno} "; + {href => "$href&gifi_accno=$ref->{gifi_accno}&callback=$callback", + text => $ref->{gifi_accno}}; $column_data{balance} = $form->format_amount( \%myconfig, $form->{balance} * $ml * $cml, 2, 0 ); $column_data{cleared} = @@ -731,41 +713,52 @@ sub generate_report { for (@column_index) { $column_data{$_} = " " } - $column_data{debit} = $form->format_amount( \%myconfig, $totaldebit, 2, " " ); - $column_data{credit} = $form->format_amount( \%myconfig, $totalcredit, 2, " " ); + $column_data{debit} = $form->format_amount( \%myconfig, $totaldebit, 2, " " ); + $column_data{credit} = $form->format_amount( \%myconfig, $totalcredit, 2, " " ); $column_data{balance} = $form->format_amount( \%myconfig, $form->{balance} * $ml * $cml, 2, 0 ); $i = 1; + my %button; if ( $myconfig{acs} !~ /General Ledger--General Ledger/ ) { - $button{'General Ledger--Add Transaction'}{code} = -qq| |; - $button{'General Ledger--Add Transaction'}{order} = $i++; + $button{'General Ledger--Add Transaction'} = { + name => 'action', + value => 'gl_transaction', + text => $locale->text('GL Transaction'), + type => 'submit', + class => 'submit', + order => $i++}; } if ( $myconfig{acs} !~ /AR--AR/ ) { - $button{'AR--Add Transaction'}{code} = -qq| |; - $button{'AR--Add Transaction'}{order} = $i++; - $button{'AR--Sales Invoice'}{code} = -qq| |; - $button{'AR--Sales Invoice'}{order} = $i++; + $button{'AR--Add Transaction'} = { + name => 'action', + value => 'ar_transaction', + text => $locale->text('AR Transaction'), + type => 'submit', + class => 'submit', + order => $i++}; + $button{'AR--Sales Invoice'} = { + name => 'action', + value => 'sales_invoice_', + text => $locale->text('Sales Invoice'), + type => 'submit', + class => 'submit', + order => $i++}; } if ( $myconfig{acs} !~ /AP--AP/ ) { - $button{'AP--Add Transaction'}{code} = -qq| |; - $button{'AP--Add Transaction'}{order} = $i++; - $button{'AP--Vendor Invoice'}{code} = -qq| |; - $button{'AP--Vendor Invoice'}{order} = $i++; + $button{'AP--Add Transaction'} = { + name => 'action', + value => 'ap_transaction', + text => $locale->text('AP Transaction'), + type => 'submit', + class => 'submit', + order => $i++}; + $button{'AP--Vendor Invoice'} = { + name => 'action', + value => 'vendor_invoice_', + text => $locale->text('Vendor Invoice'), + type => 'submit', + class => 'submit', + order => $i++}; } foreach $item ( split /;/, $myconfig{acs} ) { @@ -773,9 +766,16 @@ qq|
-
" - . $locale->text('ID') - . "" - . $locale->text('Date') - . "" - . $locale->text('Reference') - . "" - . $locale->text('Source') - . "" - . $locale->text('Memo') - . "" - . $locale->text('Description') - . "" - . $locale->text('Department') - . "" . $locale->text('Notes') . "" . $locale->text('Debit') . "" . $locale->text('Credit') . "" - . $locale->text('Account') - . "" - . $locale->text('GIFI') - . "" . $locale->text('Balance') . "| . $locale->text('R') . qq|