-
Notifications
You must be signed in to change notification settings - Fork 68
NEW : v20 dropdown compatibility #446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NEW : v20 dropdown compatibility #446
Conversation
| let tr = '<tr><td>'+jsConf.langs.SubtotalOptions+'</td><td>'; | ||
| tr+= '<label><input type="checkbox" value="1" name="subtotal_add_title_bloc_from_orderstoinvoice" checked="checked" /> '+jsConf.langs.AddTitleBlocFromOrdersToInvoice+'</label>'; | ||
| if(jsConf.isModShippingEnable){ | ||
| tr+= '<br/><label><input type="checkbox" value="1" name="subtotal_add_shipping_list_to_title_desc" /> '+jsConf.langs.AddShippingListToTile+' <i class="fa fa-question-circle" title="'+jsConf.langs.UseHiddenConfToAutoCheck+' SUBTOTAL_DEFAULT_CHECK_SHIPPING_LIST_FOR_TITLE_DESC"></label>'; | ||
| } | ||
| tr+= '<td></tr>'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pour la lisibilité (je sais pas si ça vaut vraiment le coup, mais je trouve ça plus simple à comprendre).
J'ai pas testé encore, mais en principe, ça ne doit rien changer.
| let tr = '<tr><td>'+jsConf.langs.SubtotalOptions+'</td><td>'; | |
| tr+= '<label><input type="checkbox" value="1" name="subtotal_add_title_bloc_from_orderstoinvoice" checked="checked" /> '+jsConf.langs.AddTitleBlocFromOrdersToInvoice+'</label>'; | |
| if(jsConf.isModShippingEnable){ | |
| tr+= '<br/><label><input type="checkbox" value="1" name="subtotal_add_shipping_list_to_title_desc" /> '+jsConf.langs.AddShippingListToTile+' <i class="fa fa-question-circle" title="'+jsConf.langs.UseHiddenConfToAutoCheck+' SUBTOTAL_DEFAULT_CHECK_SHIPPING_LIST_FOR_TITLE_DESC"></label>'; | |
| } | |
| tr+= '<td></tr>'; | |
| const checkboxWithLabel = (name, label, checked = false) => `<label><input type="checkbox" value="1" name="${name}" ${checked ? 'checked="checked"' : ''} />${label}</label>`; | |
| const buildInfoHelp = (helpText, faClass='fa-question-circle') => `<i class="fa ${faClass}" title="${helpText}"></i>`; | |
| let optCheckboxes = checkboxWithLabel('subtotal_add_title_bloc_from_orderstoinvoice', jsConf.langs.AddTitleBlocFromOrdersToInvoice, true); | |
| if (jsConf.isModShippingEnable) { | |
| optCheckboxes += checkboxWithLabel( | |
| 'subtotal_add_shipping_list_to_title_desc', | |
| buildInfoHelp(jsConf.langs.UseHiddenConfToAutoCheck + ' SUBTOTAL_DEFAULT_CHECK_SHIPPING_LIST_FOR_TITLE_DESC') | |
| ); | |
| } | |
| const tr = `<tr><td>${jsConf.langs.SubtotalOptions}</td><td>${optCheckboxes}</td></tr>`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Franchement je ne sais pas non plus, au début j'avais fait un peu comme toi mais après j'ai changé pour remettre un truc plus "à l'ancienne" car je me suis dit que ce serait plus compréhensible, mais je me suis peut-être fait des idées...
Du coup je ne sais pas. Mais vu que c'est toi maintenant le mainteneur du module, je dirais que c'est toi qui choisis ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tu sais quoi ? Je vais merger tel quel et quand j'aurai du temps pour faire des tests et de la refacto, je reprendrai ça… au moins je prends aucun risque.
Co-authored-by: Florian Mortgat <[email protected]>
Co-authored-by: Florian Mortgat <[email protected]>
Co-authored-by: Florian Mortgat <[email protected]>
Co-authored-by: Florian Mortgat <[email protected]>
Co-authored-by: Florian Mortgat <[email protected]>
Co-authored-by: Florian Mortgat <[email protected]>
Need #441 before.
c'est possible grâce à la PR coeur suivante : Dolibarr/dolibarr#31266
Cette PR permet de réduire le nombre de bouton "sous total" sur les documents et simplifier cette zone...