Bugzilla – Attachment 83701 Details for
Bug 21605
Cannot create EDI account
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21605: (follow-up) Simple ternary boolean to number conversion
Bug-21605-follow-up-Simple-ternary-boolean-to-numb.patch (text/plain), 1.95 KB, created by
Martin Renvoize
on 2019-01-07 18:11:44 UTC
(
hide
)
Description:
Bug 21605: (follow-up) Simple ternary boolean to number conversion
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2019-01-07 18:11:44 UTC
Size:
1.95 KB
patch
obsolete
>From a454735178e1858cd932db3aa60ac1089b3b2970 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 13 Dec 2018 14:59:38 +0100 >Subject: [PATCH] Bug 21605: (follow-up) Simple ternary boolean to number > conversion > >Imo it is much easier to do just "$a ? 1 : 0" than testing defined($a) etc. >in the additional loop. >Less code, more readable? > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > admin/edi_accounts.pl | 13 +++++-------- > 1 file changed, 5 insertions(+), 8 deletions(-) > >diff --git a/admin/edi_accounts.pl b/admin/edi_accounts.pl >index 3eccb5320b..a6beaf0149 100755 >--- a/admin/edi_accounts.pl >+++ b/admin/edi_accounts.pl >@@ -81,17 +81,14 @@ else { > download_directory => scalar $input->param('download_directory'), > san => scalar $input->param('san'), > transport => scalar $input->param('transport'), >+ quotes_enabled => $input->param('quotes_enabled') ? 1 : 0, >+ invoices_enabled => $input->param('invoices_enabled') ? 1 : 0, >+ orders_enabled => $input->param('orders_enabled') ? 1 : 0, >+ responses_enabled => $input->param('responses_enabled') ? 1 : 0, >+ auto_orders => $input->param('auto_orders') ? 1 : 0, > id_code_qualifier => scalar $input->param('id_code_qualifier'), > plugin => scalar $input->param('plugin'), > }; >- # ensure all capability fields set to binary 0 or 1 >- foreach my $capability >- (qw( quotes_enabled invoices_enabled orders_enabled responses_enabled auto_orders)) { >- $fields->{$capability} = defined $input->param($capability); >- if ($fields->{$capability} != 1) { >- $fields->{$capability} = 0; >- } >- } > > if ($id) { > $schema->resultset('VendorEdiAccount')->search( >-- >2.19.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21605
:
81262
|
83167
|
83168
|
83700
| 83701