Draft: fix(disabled): added param to set_disabled
1 unresolved thread
1 unresolved thread
Merge request reports
Activity
Filter activity
157 157 } 158 158 159 159 /** 160 * @param bool $bool 161 * 160 162 * @return $this 161 163 */ 162 public function set_disabled() { 163 $this->attributes['disabled'] = true; 164 public function set_disabled( $bool = true ) { Ok, to może wyjaśnie. Musze dodać do deklaracji set_disabled jeżeli jakiś jest tam warunek.
( new InputTextField() ) ->set_name( 'invoice_date_of_sale_label' ) ->set_disabled() ->set_label( __( 'Label for Date of Sale', 'flexible-invoices-core' ) ) ->set_default_value( __( 'Date of sale', 'flexible-invoices-core' ) ) ->set_description( __( 'Enter the label for "date of sale" visible on the PDF invoice, i.e. "date of delivery". It will be used on all new and edited invoices.', 'flexible-invoices-core' ) ),
Wiec mógłbym tutaj zrobić dekoratora, albo zmiany w bibliotece. Dekorator przyjmowałby ten obiekt i dodawał set_disabled jeżeli warunek był”y true.
By Piotr Po on 2020-11-05T10:35:42 (imported from GitLab)
możesz też wrzucić
( $stefan = new InputTextField() ) ->set_name( 'invoice_date_of_sale_label' ) ->set_label( __( 'Label for Date of Sale', 'flexible-invoices-core' ) ) ->set_default_value( __( 'Date of sale', 'flexible-invoices-core' ) ) ->set_description( __( 'Enter the label for "date of sale" visible on the PDF invoice, i.e. "date of delivery". It will be used on all new and edited invoices.', 'flexible-invoices-core' ) ), ... if (costam) $stefan->set_disabled()
By Dyszczo on 2020-11-05T10:43:38 (imported from GitLab)
assigned to @dyszczo
By Piotr Po on 2020-11-05T11:00:10 (imported from GitLab)
unassigned @dyszczo
By Dyszczo on 2020-11-05T11:01:02 (imported from GitLab)