Skip to content
Snippets Groups Projects

Draft: fix(disabled): added param to set_disabled

Closed Krzysztof Dyszczyk requested to merge fix/set_disabled into master
1 unresolved thread

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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 ) {
  • 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.

    		( 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)

  • Please register or sign in to reply
  • Krzysztof Dyszczyk assigned to @potreb and unassigned @dyszczo

    assigned to @potreb and unassigned @dyszczo

    By Dyszczo on 2020-11-05T10:32:06 (imported from GitLab)

  • Krzysztof Dyszczyk marked this merge request as draft

    marked this merge request as draft

    By Piotr Po on 2020-11-05T11:00:08 (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)

  • Please register or sign in to reply
    Loading