Overview

Namespaces

  • FlexiPeeHP
    • Bricks
    • ui
  • None
  • Orderer
  • PHP
  • SpojeNet
    • System
      • ui

Classes

  • DatePeriod
  • FlexiPeeHP\Bricks\Convertor
  • FlexiPeeHP\Bricks\Customer
  • FlexiPeeHP\Bricks\HookReciever
  • FlexiPeeHP\Bricks\ParovacFaktur
  • FlexiPeeHP\Bricks\PotvrzeniUhrady
  • FlexiPeeHP\Bricks\Upominac
  • FlexiPeeHP\Bricks\Upominka
  • FlexiPeeHP\Bricks\WebHookHandler
  • FlexiPeeHP\Bricks\XSLT
  • FlexiPeeHP\ui\AdresarForm
  • FlexiPeeHP\ui\CompanyLogo
  • FlexiPeeHP\ui\ConnectionForm
  • FlexiPeeHP\ui\DownloadInvoiceButton
  • FlexiPeeHP\ui\EmbedResponsive
  • FlexiPeeHP\ui\EmbedResponsiveHTML
  • FlexiPeeHP\ui\EmbedResponsivePDF
  • FlexiPeeHP\ui\KontaktForm
  • FlexiPeeHP\ui\OrderListingItem
  • FlexiPeeHP\ui\OrdersListing
  • FlexiPeeHP\ui\RecordTypeSelect
  • FlexiPeeHP\ui\SearchBox
  • FlexiPeeHP\ui\StatusInfoBox
  • SpojeNet\System\ui\VATSwitch

Interfaces

  • Traversable

Functions

  • apiUrlToLink
  • createYearsFrom
  • exchange
  • logOperationResult
  • Orderer\deleteAllBetween
  • parseCmdline
  • SpojeNet\System\operationsMenu
  • Overview
  • Namespace
  • Class
  • Tree
 1:  2:  3:  4:  5:  6:  7:  8:  9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 
<?php
/**
 * FlexiBee-Bricks - přepínač daně položky
 *
 * @author Vítězslav Dvořák <info@vitexsoftware.cz>
 * @copyright  2018 Vitex Software
 */

namespace SpojeNet\System\ui;

/**
 * Description of VATSwitch
 *
 * @author Vítězslav Dvořák <info@vitexsoftware.cz>
 */
class VATSwitch extends TWBSwitch
{

    /**
     * Document Item VAT Type
     * 
     * @param string $name
     * @param string $checked typCeny.sDph|typCeny.bezDph
     * @param array  $properties
     */
    public function __construct($name = 'typCenyDphK', $checked = null,
                                $properties = null)
    {
        if (empty($checked)) {
            $checked = 'typCeny.sDph';
        }

        if (!isset($properties['onText'])) {
            $properties['onText'] = _('with VAT');
        }
        if (!isset($properties['offText'])) {
            $properties['offText'] = _('without VAT');
        }

        $properties['value'] = $checked;

        parent::__construct($name, $checked == 'typCeny.sDph', $checked,
            $properties);
    }

    public function finalize()
    {
        parent::finalize();
        $this->addJavaScript('
 $(\'input[name="'.$this->getTagName().'"]\').on(\'switchChange.bootstrapSwitch\', function(event, state) {
  console.log(this); // DOM element
  console.log(event); // jQuery event
  console.log(state); // true | false
  if(state){
    $(\'input[name="'.$this->getTagName().'"]\').val("typCeny.sDph");
  } else {
    $(\'input[name="'.$this->getTagName().'"]\').val("typCeny.bezDph");
  }
 
});                       
');
    }
}
FlexiPeeHP-Bricks API documentation generated by ApiGen