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)
( $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)
idea była taka, że jeśli będzie taka potrzeba to dodamy set_enabled :)
By Dyszczo on 2020-11-05T10:32:02 (imported from GitLab)
Ok, to może wyjaśnie. Musze dodać do deklaracji set_disabled jeżeli jakiś jest tam warunek.
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ć
By Dyszczo on 2020-11-05T10:43:38 (imported from GitLab)