From: levinse Date: Mon, 16 May 2011 19:47:20 +0000 (+0000) Subject: internationalization/localization, RT12515 X-Git-Tag: freeside_2_3_0~251 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=d21d7864c1f1bc4fed05a01c0b037628a4ca5b99 internationalization/localization, RT12515 --- diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index e561c703e..49d6ff4cd 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -478,4 +478,9 @@ sub translate_payby_refund { $payby; }; +sub areyousure_link { + my ($url,$msg,$title,$label) = (shift,shift,shift,shift); + ' ('.$label.')'; +} + diff --git a/httemplate/view/cust_main/payment_history/credit.html b/httemplate/view/cust_main/payment_history/credit.html index ae388eb54..ffe613340 100644 --- a/httemplate/view/cust_main/payment_history/credit.html +++ b/httemplate/view/cust_main/payment_history/credit.html @@ -121,32 +121,21 @@ if ( scalar(@cust_credit_bill) == 0 } # my $delete = ''; -if ( $cust_credit->closed !~ /^Y/i - - #s'pose deleting a credit isn't bad like deleting a payment - # and this needs to be generally available until we have credit voiding.. - #&& $conf->exists('deletecredits') - - && $curuser->access_right('Delete credit') - ) -{ - $delete = qq! (!. - qq!delete)!; -} +$delete = areyousure_link("${p}misc/delete-cust_credit.cgi?".$cust_credit->crednum, + mt('Are you sure you want to delete this credit?'), + '', + mt('delete') + ) +if ( $cust_credit->closed !~ /^Y/i && $curuser->access_right('Delete credit') ); my $unapply = ''; -if ( $cust_credit->closed !~ /^Y/i - && scalar(@cust_credit_bill) - && $curuser->access_right('Unapply credit') - ) -{ - $unapply = qq! (!. - qq!unapply)!; -} +$unapply = areyousure_link("${p}misc/unapply-cust_credit.cgi?".$cust_credit->crednum, + mt('Are you sure you want to unapply this credit?'), + '', + mt('unapply') + ) +if ( $cust_credit->closed !~ /^Y/i && scalar(@cust_credit_bill) + && $curuser->access_right('Unapply credit') ); my $reason = $cust_credit->reason ? ' ('. $cust_credit->reason. ')' diff --git a/httemplate/view/cust_main/payment_history/invoice.html b/httemplate/view/cust_main/payment_history/invoice.html index fe14d3e54..29389ef77 100644 --- a/httemplate/view/cust_main/payment_history/invoice.html +++ b/httemplate/view/cust_main/payment_history/invoice.html @@ -20,13 +20,12 @@ my $link = $curuser->access_right('View invoices') : ''; my $delete = ''; -if ( $opt{'deleteinvoices'} && $curuser->access_right('Delete invoices') ) { - $delete = qq! ()'; -} +$delete = areyousure_link("${p}misc/delete-cust_bill.html?$invnum", + mt('Are you sure you want to delete this invoice?'), + mt('Delete this invoice from the database completely'), + mt('delete') + ) + if ( $opt{'deleteinvoices'} && $curuser->access_right('Delete invoices') ); my $events = ''; #1.9 diff --git a/httemplate/view/cust_main/payment_history/payment.html b/httemplate/view/cust_main/payment_history/payment.html index 61486518e..7df16cf87 100644 --- a/httemplate/view/cust_main/payment_history/payment.html +++ b/httemplate/view/cust_main/payment_history/payment.html @@ -169,7 +169,15 @@ if ( $cust_pay->closed !~ /^Y/i } my $void = ''; -if ( $cust_pay->closed !~ /^Y/i +my $voidmsg = $cust_pay->payby =~ /^(CARD|CHEK)$/ + ? ' (' . mt('do not send anything to the payment gateway').')' + : ''; +$void = areyousure_link("${p}misc/void-cust_pay.cgi?".$cust_pay->paynum, + mt('Are you sure you want to void this payment?'), + mt('Void this payment from the database') . $voidmsg, + mt('void') + ) + if ( $cust_pay->closed !~ /^Y/i && ( ( $cust_pay->payby eq 'CARD' && $curuser->access_right('Credit card void') ) @@ -180,43 +188,24 @@ if ( $cust_pay->closed !~ /^Y/i && $curuser->access_right('Regular void') ) ) - ) -{ - $void = qq! (void)!; -} + ); my $delete = ''; -if ( $cust_pay->closed !~ /^Y/i - && $opt{'deletepayments'} - && $curuser->access_right('Delete payment') - ) -{ - $delete = qq! (delete)!; -} +$delete = areyousure_link("${p}misc/delete-cust_pay.cgi?".$cust_pay->paynum, + mt('Are you sure you want to delete this payment?'), + mt('Delete this payment from the database completely - not recommended'), + mt('delete') + ) + if ( $cust_pay->closed !~ /^Y/i && $opt{'deletepayments'} + && $curuser->access_right('Delete payment') ); my $unapply = ''; -if ( $cust_pay->closed !~ /^Y/i - && scalar(@cust_bill_pay) - && $curuser->access_right('Unapply payment') - ) -{ - $unapply = qq! (unapply)!; -} +$unapply = areyousure_link("${p}misc/unapply-cust_pay.cgi?".$cust_pay->paynum, + mt('Are you sure you want to unapply this payment?'), + mt('Keep this payment, but dissociate it from the invoices it is currently applied against'), + mt('unapply') + ) + if ( $cust_pay->closed !~ /^Y/i && scalar(@cust_bill_pay) + && $curuser->access_right('Unapply payment') ); diff --git a/httemplate/view/cust_main/payment_history/refund.html b/httemplate/view/cust_main/payment_history/refund.html index 154525d54..813836b64 100644 --- a/httemplate/view/cust_main/payment_history/refund.html +++ b/httemplate/view/cust_main/payment_history/refund.html @@ -1,6 +1,6 @@ -<% $refund %> -(<% $payby. $payinfo %>) -<% mt('by') |h %> <% $cust_refund->otaker %><% $view %><% $delete %> +<% $refund %> +(<% "$payby$payinfo" %>) +<% "$view$delete" %> <%init> my( $cust_refund, %opt ) = @_; @@ -14,8 +14,10 @@ my $payinfo = $payby eq 'CARD' $payby = translate_payby_refund($payby,$payinfo); -my $refund = mt('Refund'); -$refund = '' . mt('Unapplied Refund') . '' +my $refund = mt("Refund by [_1]",$cust_refund->otaker); +$refund = '' + . mt("Unapplied Refund by [_1]",$cust_refund->otaker) + . '' if $cust_refund->unapplied > 0; my $view = @@ -29,17 +31,13 @@ my $view = my $delete = ''; -if ( $cust_refund->closed !~ /^Y/i - && $opt{'deleterefunds'} - && $curuser->access_right('Delete refund') - ) -{ - $delete = qq! (".mt('delete').")"; -} +$delete = areyousure_link("${p}misc/delete-cust_refund.cgi?".$cust_refund->refundnum, + mt('Are you sure you want to delete this refund?'), + mt('Delete this refund from the database completely - not recommended'), + mt('delete') + ) + if ( $cust_refund->closed !~ /^Y/i && $opt{'deleterefunds'} + && $curuser->access_right('Delete refund') ); diff --git a/httemplate/view/cust_main/payment_history/voided_payment.html b/httemplate/view/cust_main/payment_history/voided_payment.html index 0a8cd1077..f4ffc23bd 100644 --- a/httemplate/view/cust_main/payment_history/voided_payment.html +++ b/httemplate/view/cust_main/payment_history/voided_payment.html @@ -34,19 +34,14 @@ if ( $opt{'pkg-balances'} && $cust_pay_void->pkgnum ) { } my $unvoid = ''; -if ( $cust_pay_void->closed !~ /^Y/i - && $curuser->access_right('Unvoid') - ) -{ - $unvoid = qq! ('.mt('unvoid').')'; -} + : ''; +$unvoid = areyousure_link("${p}misc/unvoid-cust_pay_void.cgi?".$cust_pay_void->paynum, + mt('Are you sure you want to unvoid this payment?'), + mt('Unvoid this payment from the database') . $unvoidmsg, + mt('unvoid') + ) + if ( $cust_pay_void->closed !~ /^Y/i && $curuser->access_right('Unvoid') );