/**
  * Init
  */
 public function init()
 {
     parent::init();
     /**
      *
      * CHECK
      * 
      */
     $homeId = $this->getHomeId();
     if (empty($homeId)) {
         throw new Exception('');
     }
     /**
      * 
      * FIELDS
      * 
      */
     /**
      * hm_charge_night_id
      */
     $element = new Zend_Form_Element_Select('hm_charge_night_id');
     $element->setLabel('Kosten')->addMultiOption('', '...')->setRequired(true);
     $charges = Model_Hm_Charge_Night::findAvailables($this->getHomeId(), $this->getEditId())->execute();
     foreach ($charges as $charge) {
         $element->addMultiOption($charge->id, $charge->translationHandler()->title . ' (' . $charge->translationHandler()->display_title . ')');
     }
     $this->addElement($element);
     /**
      * price
      */
     $element = new Zend_Form_Element_Text('price');
     $element->setLabel('Prijs')->setValidators(array('float'))->setRequired(true);
     $this->addElement($element);
     /**
      * Submit
      */
     $element = new Zend_Form_Element_Submit('submit_chargenight');
     $element->setLabel('Verwerken')->setAttribs(array('class' => 'submit'));
     $this->addElement($element);
     /**
      * 
      * GROUPS
      * 
      */
     /**
      * Charge
      */
     $this->addDisplayGroup(array('hm_charge_night_id', 'price'), 'charenight', array('legend' => 'Kosten'));
     /**
      * Submit
      */
     $this->addDisplayGroup(array('submit_chargenight'), 'submit', array('class' => 'submit'));
     /**
      * 
      * DECORATORS
      * 
      */
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmitElement($this->getElement('submit_chargenight'));
 }
 public function init()
 {
     parent::init();
     $this->setDecorators($this->_decorators);
     $this->setElementDecorators($this->_elementDecorators);
     $this->setDisplayGroupDecorators($this->_displayGroupDecorators);
 }
 public function init()
 {
     parent::init();
     /*
      * Translations
      */
     $subForm = new Zend_Form_SubForm('Translation');
     $langs = Model_Hm_Lang::listAll();
     foreach ($langs as $lang) {
         $subSubForm = new Zend_Form_SubForm($lang->code);
         $element = new Zend_Form_Element_Text('title');
         $element->setLabel('Titel (eigen)')->setDescription('Deze titel is voor gebruik in eigen administratie.')->setRequired(true);
         $subSubForm->addElement($element);
         $element = new Zend_Form_Element_Text('display_title');
         $element->setLabel('Titel (gebruiker)')->setDescription('Deze titel krijgen de gebruikesr van het systeem te zien.')->setRequired(true);
         $subSubForm->addElement($element);
         $element = new Zend_Form_Element_Textarea('description');
         $element->setLabel('Omschrijving')->setRequired(true)->setValidators(array(array('stringLength', false, array('min' => 40))))->setAttrib('class', 'autoexpand')->setAttrib('rows', 2);
         $subSubForm->addElement($element);
         $subSubForm->addDisplayGroup(array('title', 'display_title', 'description'), $lang->code, array('legend' => $lang->name, 'class' => 'textarea'));
         $subForm->addSubForm($subSubForm, $lang->code);
         $this->bhvkSubDecorators($subSubForm);
     }
     $this->addSubForm($subForm, 'Translation');
     $this->bhvkSubDecorators($subForm);
     /*
      * Submit
      */
     $element = new Zend_Form_Element_Submit('submit_chargeoptional');
     $element->setLabel('Verwerken')->setAttrib('class', 'submit');
     $this->addElement($element);
     $this->addDisplayGroup(array('submit_chargeoptional'), 'submit', array('class' => 'submit'));
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmitElement($this->getElement('submit_chargeoptional'));
 }
 /**
  * Initializing form
  */
 public function init()
 {
     parent::init();
     $element = new Zend_Form_Element_Select('year');
     $element->setLabel('Jaar')->addMultiOption('', '...')->setDescription('Percentages zijn van toepassing op dit jaartal')->setRequired(true);
     $entries = Model_Hm_Week_Percentage::findAllByHomeId($this->getHomeId())->select('wp.year, wp.id, wp.hm_home_id')->execute(null, Doctrine_Core::HYDRATE_ARRAY);
     $availableYears = new Model_Hm_AvailableYears($entries);
     foreach ($availableYears->toArray() as $year) {
         $element->addMultiOption($year, $year);
     }
     $this->addElement($element);
     $this->addDisplayGroup(array('year'), 'year-group', array('legend' => 'Algemeen', 'class' => 'width100'));
     for ($weekNo = 01; $weekNo <= 53; $weekNo++) {
         $elementName = 'week_' . $weekNo;
         $elements[] = $elementName;
         $element = new Zend_Form_Element_Text($elementName);
         $element->setLabel('Percentage')->setValidators(array(array('Float')))->setAttribs(array('maxlength' => 6))->setRequired(true);
         $this->addElement($element);
         $this->addDisplayGroup(array($elementName), $elementName . 'group', array('class' => 'weekpercentage', 'legend' => 'Week ' . $weekNo));
     }
     $element = new Zend_Form_Element_Submit('submit_percentageweek');
     $element->setLabel('Verwerken')->setAttrib('class', 'submit');
     $this->addElement($element);
     $this->addDisplayGroup(array('submit_percentageweek'), 'submit', array('class' => 'submit'));
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmitElement($this->getElement('submit_percentageweek'));
 }
 public function init()
 {
     parent::init();
     $this->setAttrib('enctype', 'multipart/form-data');
     $element = new Zend_Form_Element_File('filename');
     $element->setLabel('Foto')->setDescription('Maximale grootte van de foto is 1mb')->setRequired(true)->setValidators(array(array('Count', false, 1), array('Size', false, 1024000), array('Extension', false, 'jpg,png,gif')))->setDestination(APPLICATION_PATH . '/../public/images/uploads/holidayhome/photos');
     $this->addElement($element);
     $this->addDisplayGroup(array('filename'), 'photogroup', array('legend' => 'Foto', 'class' => 'file'));
     $subForm = new Zend_Form_SubForm('Translation');
     foreach (Model_Hm_Lang::listAll() as $lang) {
         $subSubForm = new Zend_Form_SubForm($lang->code);
         $element = new Zend_Form_Element_Text('title');
         $element->setLabel('Titel')->setRequired(true)->setValidators(array(array('stringLength', null, array('min' => 4, 'max' => 64))));
         $subSubForm->addElement($element);
         $element = new Zend_Form_Element_Textarea('description');
         $element->setLabel('Omschrijving')->setAttrib('rows', 2)->setAttrib('class', 'autoexpand')->setRequired(true)->setValidators(array(array('stringLength', null, array('min' => 40))));
         $subSubForm->addElement($element);
         $subSubForm->addDisplayGroup(array('title', 'description'), $lang->code, array('class' => 'textarea', 'legend' => $lang->name));
         $this->bhvkSubDecorators($subSubForm);
         $subForm->addSubForm($subSubForm, $lang->code);
     }
     $this->bhvkSubDecorators($subForm);
     $this->addSubForm($subForm, 'Translation');
     $element = new Zend_Form_Element_Submit('photo_submit');
     $element->setLabel('Verwerken')->setAttrib('class', 'submit');
     $this->addElement($element);
     $this->addDisplayGroup(array('photo_submit'), 'submit', array('class' => 'submit'));
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmit('photo_submit');
     $this->bhvkDecorateFile($this->getElement('filename'));
 }
 public function init()
 {
     parent::init();
     $subForm = new Zend_Form_SubForm('Translation');
     $langs = Model_Hm_Lang::listAll();
     foreach ($langs as $lang) {
         $subSubForm = new Zend_Form_SubForm($lang->code);
         $element = new Zend_Form_Element_Text('name');
         $element->setLabel('Naam')->setAttrib('maxlength', 64)->setValidators(array(array('stringLength', false, array('min' => 4, 'max' => 64))))->setRequired(true);
         $subSubForm->addElement($element);
         $element = new Zend_Form_Element_Textarea('description');
         $element->setLabel('Omschrijving')->setRequired(true)->setValidators(array(array('stringLength', false, array('min' => 40))))->setAttrib('class', 'autoexpand')->setAttrib('rows', 2);
         $subSubForm->addElement($element);
         $subSubForm->addDisplayGroup(array('name', 'description'), $lang->code, array('legend' => $lang->name, 'class' => 'textarea'));
         $subForm->addSubForm($subSubForm, $lang->code);
         $this->bhvkSubDecorators($subSubForm);
     }
     $this->addSubForm($subForm, 'Translation');
     $this->bhvkSubDecorators($subForm);
     $element = new Zend_Form_Element_Submit('submit_category');
     $element->setLabel('Verwerken')->setAttrib('class', 'submit');
     $this->addElement($element)->addDisplayGroup(array('submit_category'), 'submit', array('class' => 'submit'));
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmit('submit_category');
 }
 public function init()
 {
     parent::init();
     if (!$this->getHmHomeId()) {
         throw new Exception();
     }
     $element = new Zend_Form_Element_Select('year');
     $element->setLabel('Jaar')->setRequired(true)->addMultiOption('', '...');
     $percentages = Model_Hm_Day_Percentage::findAllByHomeId($this->_hmHomeId)->execute(null, Doctrine_Core::HYDRATE_ARRAY);
     $availableYears = new Model_Hm_AvailableYears($percentages, 5);
     foreach ($availableYears->toArray() as $year) {
         $element->addMultiOption($year, $year);
     }
     $this->addElement($element);
     $elements[] = 'year';
     for ($i = 1; $i <= 7; $i++) {
         $elementName = $this->_labelTemplates[$i];
         $elements[] = 'day_' . $i;
         $element = new Zend_Form_Element_Text('day_' . $i);
         $element->setLabel($elementName)->setRequired(true)->setAttribs(array('maxlength' => 6))->setValidators(array(array('float'), array('stringLength', false, array('max' => 6))));
         $this->addElement($element);
     }
     $this->addDisplayGroup($elements, 'days', array('legend' => 'Percentage'));
     $element = new Zend_Form_Element_Submit('submit_percentageday');
     $element->setLabel('Verwerken')->setAttrib('class', 'submit');
     $this->addElement($element);
     $this->addDisplayGroup(array('submit_percentageday'), 'submit', array('class' => 'submit'));
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmitElement($this->getElement('submit_percentageday'));
 }
 /**
  * Init
  */
 public function init()
 {
     parent::init();
     /**
      * 
      * ELEMENTS
      * 
      */
     /**
      * Charge
      */
     $element = new Zend_Form_Element_Select('hm_charge_optional_id');
     $element->setLabel('Kosten')->addMultiOption('', '...')->setRequired(true);
     $charges = Model_Hm_Charge_Optional::findAvailables($this->getHomeId(), $this->getChargeOptional())->execute();
     foreach ($charges as $charge) {
         $element->addMultiOption($charge->id, $charge->translationHandler()->title . ' (' . $charge->translationHandler()->display_title . ')');
     }
     $this->addElement($element);
     /**
      * Price
      */
     $element = new Zend_Form_Element_Text('price');
     $element->setLabel('Stukprijs')->setRequired(true)->setValidators(array('float'));
     $this->addElement($element);
     /**
      * Submit
      */
     $element = new Zend_Form_Element_Submit('submit_chargeoptional');
     $element->setLabel('Verwerken')->setAttrib('class', 'submit');
     $this->addElement($element);
     /**
      * 
      * GROUPS
      * 
      */
     /**
      * Charge
      */
     $this->addDisplayGroup(array('hm_charge_optional_id', 'price'), 'charge', array('legend' => 'Kosten'));
     /**
      * Submit
      */
     $this->addDisplayGroup(array('submit_chargeoptional'), 'submit', array('class' => 'submit'));
     /**
      * 
      * DECORATORS
      * 
      *  
      */
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmitElement($this->getElement('submit_chargeoptional'));
 }
 public function init()
 {
     parent::init();
     $element = new Zend_Form_Element_Checkbox($this->getDate()->get("YYYY_MM_dd") . '_departure');
     $element->setLabel('Vertrek');
     $this->addElement($element);
     $element = new Zend_Form_Element_Checkbox($this->getDate()->get("YYYY_MM_dd") . '_arrival');
     $element->setLabel('Aankomst');
     $this->addElement($element);
     $this->setDecorators($this->_decorators);
     $this->setElementDecorators($this->_elementDecorators);
     $this->setDisplayGroupDecorators($this->_displayGroupDecorators);
 }
 public function init()
 {
     parent::init();
     /*
      * Options 
      */
     $element = new Zend_Form_Element_Checkbox('per_person');
     $element->setLabel('Per persoon')->setDescription('Selecteer deze optie wanneer u deze kosten 
             	per nacht per persoon wilt rekenen. Laat deze optie leeg 
             	wanneer u de kosten alleen per nacht wilt rekenen.');
     $this->addElement($element);
     $element = new Zend_Form_Element_Checkbox('visible');
     $element->setLabel('Zichtbaar')->setAttrib('checked', 'checked')->setDescription('Selecteer deze optie wanneer u wilt dat de 
             	kosten onzichtbaar worden berekend.');
     $this->addElement($element);
     $this->addDisplayGroup(array('per_person', 'visible'), 'info', array('legend' => 'Opties', 'class' => 'checkbox'));
     /*
      * Text
      */
     $element = new Zend_Form_Element_Text('exp');
     $element->setLabel('Expressies')->setDescription('Waarschuwing! Het is mogelijk om hier speciale 
             	expressies in te vullen. Indien u niet weet wat dit is, laat 
             	het veld leeg. U kunt de applicatie en betaal processen 
             	ernstige schade toebrengen.');
     $this->addElement($element);
     $this->addDisplayGroup(array('exp'), 'expas', array('legend' => 'Expressies'));
     /*
      * Translations
      */
     $subForm = new Zend_Form_SubForm('Translation');
     $langs = Model_Hm_Lang::listAll();
     foreach ($langs as $lang) {
         $subSubForm = new Zend_Form_SubForm($lang->code);
         $element = new Zend_Form_Element_Text('title');
         $element->setLabel('Titel (eigen)')->setDescription('Deze titel is voor gebruik in eigen administratie.')->setRequired(true);
         $subSubForm->addElement($element);
         $element = new Zend_Form_Element_Text('display_title');
         $element->setLabel('Titel (gebruiker)')->setDescription('Deze titel krijgen de gebruikesr van het systeem te zien.')->setRequired(true);
         $subSubForm->addElement($element);
         $element = new Zend_Form_Element_Textarea('description');
         $element->setLabel('Omschrijving')->setRequired(true)->setValidators(array(array('stringLength', false, array('min' => 40))))->setAttrib('class', 'autoexpand')->setAttrib('rows', 2);
         $subSubForm->addElement($element);
         $subSubForm->addDisplayGroup(array('title', 'display_title', 'description'), $lang->code, array('legend' => $lang->name, 'class' => 'textarea'));
         $subForm->addSubForm($subSubForm, $lang->code);
         $this->bhvkSubDecorators($subSubForm);
     }
     $this->addSubForm($subForm, 'Translation');
     $this->bhvkSubDecorators($subForm);
 }
 public function init()
 {
     parent::init();
     $username = new Zend_Form_Element_Text('login_username');
     $username->setLabel('Gebruikersnaam');
     $this->addElement($username);
     $password = new Zend_Form_Element_Password('login_password');
     $password->setLabel('Wachtwoord');
     $this->addElement($password);
     $submit = new Zend_Form_Element_Submit('login_submit');
     $submit->setLabel('Inloggen');
     $this->addElement($submit);
     $this->setDecorators(array('FormElements', 'Form'));
     $this->setElementDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'p'))));
 }
 public function init()
 {
     parent::init();
     $element = new Zend_Form_Element_Text('width');
     $element->setLabel('Breedte in cm')->setRequired(true)->setFilters(array('int'));
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('length');
     $element->setLabel('Lengte in cm')->setRequired(true)->setFilters(array('int'));
     $this->addElement($element);
     $this->addDisplayGroup(array('width', 'length'), 'bed', array('legend' => 'Bed'));
     $element = new Zend_Form_Element_Submit('submit_bed');
     $element->setLabel('Verwerken')->setAttrib('class', 'submit');
     $this->addElement($element);
     $this->addDisplayGroup(array('submit_bed'), 'submit', array('class' => 'submit'));
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmit('submit_bed');
 }
 public function init()
 {
     parent::init();
     $element = new Zend_Form_Element_Text('name');
     $element->setLabel('Taalnaam')->setRequired(true);
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('code');
     $element->setLabel('Taalcode')->setRequired(true)->setFilters(array('stringToUpper'));
     $this->addElement($element);
     $this->addDisplayGroup(array('name', 'code'), 'Taal', array('legend' => 'Taal'));
     $element = new Zend_Form_Element_Submit('submit_lang');
     $element->setLabel('Verwerken')->setAttrib('class', 'submit');
     $this->addElement($element);
     $this->addDisplayGroup(array('submit_lang'), 'lang', array('class' => 'submit'));
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmit('submit_lang');
 }
 public function init()
 {
     parent::init();
     /*
      * Code
      */
     $element = new Zend_Form_Element_Text('code');
     $element->setLabel('Landcode')->setRequired(true);
     $this->addElement($element);
     /*
      * Areacode
      */
     $element = new Zend_Form_Element_Text('area_code');
     $element->setLabel('Netnummer')->setRequired(true);
     $this->addElement($element);
     $this->addDisplayGroup(array('code', 'area_code'), 'Algemeen', array('legend' => 'Gegevens'));
     /*
      * Translations
      */
     $subForm = new Zend_Form_SubForm('Translation');
     $langs = Model_Hm_Lang::listAll();
     foreach ($langs as $lang) {
         $subSubForm = new Zend_Form_SubForm($lang->code);
         /*
          * Name field
          */
         $element = new Zend_Form_Element_Text('name');
         $element->setLabel('Naam')->setAttrib('maxlength', 64)->setValidators(array(array('stringLength', false, array('min' => 4, 'max' => 64))))->setRequired(true);
         $subSubForm->addElement($element);
         $subSubForm->addDisplayGroup(array('name'), $lang->code, array('legend' => $lang->name, 'class' => 'textarea'));
         $subForm->addSubForm($subSubForm, $lang->code);
         $this->bhvkSubDecorators($subSubForm);
     }
     $this->addSubForm($subForm, 'Translation');
     $this->bhvkSubDecorators($subForm);
     /*
      * Submit
      */
     $element = new Zend_Form_Element_Submit('submit_country');
     $element->setLabel("Verwerken")->setAttrib('class', 'submit');
     $this->addElement($element);
     $this->addDisplayGroup(array('submit_country'), 'submit', array('class' => 'submit'));
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmit('submit_country');
 }
 public function init()
 {
     parent::init();
     $element = new Zend_Form_Element_Select('hm_geo_region_id');
     $element->setLabel('Regio')->setRequired(true)->addMultiOption('', '...');
     $regions = Model_Hm_Geo_Region::findAllForAdmin()->execute();
     foreach ($regions as $region) {
         $element->addMultiOption($region->id, $region->Country->translationHandler()->name . ' - ' . $region->name);
     }
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('name');
     $element->setLabel('Naam')->setRequired(true)->setAttrib('maxlength', 128)->setValidators(array(array('stringLength', false, array('min' => 4, 'max' => 128))));
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('coordinate');
     $element->setLabel('Coordinaat')->setRequired(true)->setAttrib('maxlength', 32)->setValidators(array(array('stringLength', false, array('min' => 4, 'max' => 32))));
     $this->addElement($element);
     $this->addDisplayGroup(array('hm_geo_region_id', 'name', 'coordinate'), 'info', array('legend' => 'Algemeen'));
     /*
      * Translations
      */
     $subForm = new Zend_Form_SubForm('Translation');
     $langs = Model_Hm_Lang::listAll();
     foreach ($langs as $lang) {
         $subSubForm = new Zend_Form_SubForm($lang->code);
         /*
          * Name field
          */
         $element = new Zend_Form_Element_Textarea('description');
         $element->setLabel('Omschrijving')->setAttrib('class', 'autoexpand')->setAttrib('rows', 2)->setValidators(array(array('stringLength', false, array('min' => 40))))->setRequired(true);
         $subSubForm->addElement($element);
         $subSubForm->addDisplayGroup(array('description'), $lang->code, array('legend' => $lang->name, 'class' => 'textarea'));
         $subForm->addSubForm($subSubForm, $lang->code);
         $this->bhvkSubDecorators($subSubForm);
     }
     $this->addSubForm($subForm, 'Translation');
     $this->bhvkSubDecorators($subForm);
     $element = new Zend_Form_Element_Submit('submit_city');
     $element->setLabel('Verwerken')->setAttrib('class', 'submit');
     $this->addElement($element);
     $this->addDisplayGroup(array('submit_city'), 'submit', array('class' => 'submit'));
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmit('submit_city');
 }
 public function init()
 {
     parent::init();
     $element = new Zend_Form_Element_Select('hm_bed_id');
     $element->setLabel('Bed (bxl) in cm')->addMultiOption('', '...')->setRequired(true);
     foreach (Model_Hm_Bed::listAll()->execute() as $bed) {
         $element->addMultiOption($bed->id, $bed->width . 'x' . $bed->length);
     }
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('amount');
     $element->setLabel('Aantal')->setFilters(array(array('int')))->setValidators(array(array('digits')))->setRequired(true);
     $this->addElement($element);
     $element = new Zend_Form_Element_Submit('submit_bed_amount');
     $element->setAttrib('class', 'submit')->setLabel('Verwerken');
     $this->addElement($element);
     $this->addDisplayGroup(array('hm_bed_id', 'amount'), 'Bed', array('legend' => 'Bed'));
     $this->addDisplayGroup(array('submit_bed_amount'), 'submit', array('class' => 'submit'));
     parent::bhvkDecorators();
     parent::bhvkDecorateSubmit('submit_bed_amount');
 }
 public function init()
 {
     parent::init();
     $element = new Zend_Form_Element_Select('hm_geo_country_id');
     $element->setLabel('Land')->setRequired(true)->addMultiOption('', '...');
     $countries = Model_Hm_Geo_Country::findAll()->execute();
     foreach ($countries as $country) {
         $element->addMultiOption($country->id, $country->translationHandler()->name);
     }
     $this->addElement($element);
     $this->addDisplayGroup(array('hm_geo_country_id'), 'country', array('legend' => 'Land'));
     $element = new Zend_Form_Element_Text('name');
     $element->setLabel('Naam')->setRequired(true);
     $this->addElement($element);
     $this->addDisplayGroup(array('name'), 'info', array('legend' => 'Naam'));
     $element = new Zend_Form_Element_Submit('submit_region');
     $element->setLabel('Verwerken')->setAttrib('class', 'submit');
     $this->addElement($element);
     $this->addDisplayGroup(array('submit_region'), 'sbumit', array('class' => 'submit'));
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmit('submit_region');
 }
 public function init()
 {
     parent::init();
     $subForm = new Zend_Form_SubForm('Translation');
     foreach (Model_Hm_Lang::listAll() as $lang) {
         $subSubForm = new Zend_Form_SubForm($lang->code);
         $element = new Zend_Form_Element_Textarea('content');
         $element->setLabel('Commentaar')->setAttrib('rows', 2)->setAttrib('class', 'autoexpand')->setRequired(true)->setValidators(array(array('stringLength', null, array('min' => 40))));
         $subSubForm->addElement($element);
         $subSubForm->addDisplayGroup(array('content'), $lang->code, array('class' => 'textarea', 'legend' => $lang->name));
         $this->bhvkSubDecorators($subSubForm);
         $subForm->addSubForm($subSubForm, $lang->code);
     }
     $this->bhvkSubDecorators($subForm);
     $this->addSubForm($subForm, 'Translation');
     $element = new Zend_Form_Element_Submit('submit_comment');
     $element->setLabel('Verwerken')->setAttrib('class', 'submit');
     $this->addElement($element);
     $this->addDisplayGroup(array('submit_comment'), 'submit', array('class' => 'submit'));
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmit('submit_comment');
 }
 public function init()
 {
     parent::init();
     $subForm = new Zend_Form_SubForm('Translation');
     $langs = Model_Hm_Lang::listAll();
     foreach ($langs as $lang) {
         $element = new Zend_Form_Element_Textarea('content');
         $element->setLabel('Content')->setRequired(true)->setAttrib('class', 'autoexpand')->setAttrib('rows', 2);
         $subSubForm = new Zend_Form_SubForm($lang->code);
         $subSubForm->addElement($element)->addDisplayGroup(array('content'), $lang->code, array('legend' => $lang->name, 'class' => 'textarea'));
         $subForm->addSubForm($subSubForm, $lang->code);
         $this->bhvkSubDecorators($subSubForm);
     }
     $this->addSubForm($subForm, 'Translation');
     $this->bhvkSubDecorators($subForm);
     $element = new Zend_Form_Element_Submit('infomail_submit');
     $element->setLabel('Verwerken')->setAttrib('class', 'submit');
     $this->addElement($element);
     $this->addDisplayGroup(array('infomail_submit'), 'submit', array('class' => 'submit'));
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmit('infomail_submit');
 }
 public function init()
 {
     parent::init();
     $element = new Zend_Form_Element_Text('name');
     $element->setLabel('Landnaam')->setRequired(true);
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('numcode');
     $element->setLabel('Landcode')->setRequired(true);
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('iso2');
     $element->setLabel('ISO II')->setRequired(true);
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('iso3');
     $element->setLabel('ISO III')->setRequired(true);
     $this->addElement($element);
     $this->addDisplayGroup(array('name', 'numcode', 'iso2', 'iso3'), 'country', array('legend' => 'Landgegevens'));
     $element = new Zend_Form_Element_Submit('submit_pb_country');
     $element->setLabel('Verwerken')->setAttrib('class', 'submit');
     $this->addElement($element);
     $this->addDisplayGroup(array('submit_pb_country'), 'submit', array('class' => 'submit'));
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmit('submit_pb_country');
 }
 public function init()
 {
     parent::init();
     $calenderHelp = new Model_Calendar_Helper();
     $amountDays = cal_days_in_month(CAL_GREGORIAN, $this->getMonth(), $this->getYear());
     $zendDate = new Zend_Date($this->getYear() . '-' . $this->getMonth() . '-' . '01', 'YYYY-MM-dd');
     $emptyFields = $zendDate->get(Zend_Date::WEEKDAY_8601) - 1;
     for ($i = 0; $i < $emptyFields; $i++) {
         $emtpyForm = new Reservation_Form_Holidayhome_Empty(array('class' => 'noneday'));
         $this->addSubForm($emtpyForm, $i);
     }
     for ($i = 1; $i <= $amountDays; $i++) {
         $zendDate = new Zend_Date($this->getYear() . '-' . $this->getMonth() . '-' . $i, 'YYYY-MM-dd');
         $form = $this->getDayForm(array('legend' => $zendDate->get(Zend_Date::WEEKDAY_NAME . ' - ' . Zend_Date::DAY), 'class' => 'day', 'date' => $zendDate));
         $this->addSubForm($form, $zendDate->get('YYYY_MM_dd'));
     }
     $element = new Zend_Form_Element_Submit('submit_dates');
     $element->setLabel('Verwerken')->setAttrib('class', 'submit');
     $this->addElement($element);
     $this->addDisplayGroup(array('submit_dates'), 'submit', array('class' => 'submit'));
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmitElement($this->getElement('submit_dates'));
 }
 public function init()
 {
     parent::init();
     /**
      * Arrival date
      */
     $element = new Zend_Form_Element_Select('hm_date_arrival_id');
     $element->setLabel('Van')->addMultiOption(null, '...')->setRequired(true);
     $availableDates = new Model_Hm_AvailableDates($this->getHomeId());
     $arrivalDates = $availableDates->getArrivalDates()->execute();
     foreach ($arrivalDates as $date) {
         $element->addMultiOption($date->id, $date->zend_date);
     }
     $this->addElement($element);
     /**
      * Departure date
      */
     $element = new Zend_Form_Element_Select('hm_date_departure_id');
     $element->setLabel('Tot')->addMultiOption(null, '...')->setRegisterInArrayValidator(false)->setRequired(true);
     $this->addElement($element);
     /**
      * Submit
      */
     $element = new Zend_Form_Element_Submit('submit_block');
     $element->setLabel('Verwerken')->setAttrib('class', 'submit');
     $this->addElement($element);
     /**
      * Display groups
      */
     $this->addDisplayGroup(array('hm_date_arrival_id', 'hm_date_departure_id'), 'dates', array('legend' => 'Blokkerings data'));
     $this->addDisplayGroup(array('submit_block'), 'submit', array('class' => 'submit'));
     /**
      * Decorators
      */
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmitElement($this->getElement('submit_block'));
 }
 public function init()
 {
     parent::init();
     $element = new Zend_Form_Element_Text('date');
     $element->setLabel('Datum')->setDescription('De datum wanneer deze uitgave in rekening 
         	gebracht dient te worden. Voorbeeld: 24-08-1985')->setValidators(array(array('date', false, array('format' => 'dd-MM-YYYY')), array('stringLength', false, array('max' => 10))))->setAttribs(array('class' => 'datepicker', 'maxLength' => 10))->setRequired(true);
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('price');
     $element->setLabel('Prijs')->setRequired(true)->setValidators(array(array('float')));
     $this->addElement($element);
     $this->addDisplayGroup(array('date', 'price'), 'algemeen', array('legend' => 'Algemeen'));
     /*
      * Translations
      */
     $subForm = new Zend_Form_SubForm('Translation');
     $langs = Model_Hm_Lang::listAll();
     foreach ($langs as $lang) {
         $subSubForm = new Zend_Form_SubForm($lang->code);
         $element = new Zend_Form_Element_Textarea('description');
         $element->setLabel('Omschrijving')->setRequired(true)->setValidators(array(array('stringLength', false, array('min' => 40))))->setFilters(array('stripTags', 'htmlEntities'))->setAttrib('class', 'autoexpand')->setAttrib('rows', 2);
         $subSubForm->addElement($element);
         $subSubForm->addDisplayGroup(array('description'), $lang->code, array('legend' => $lang->name, 'class' => 'textarea'));
         $subForm->addSubForm($subSubForm, $lang->code);
         $this->bhvkSubDecorators($subSubForm);
     }
     $this->addSubForm($subForm, 'Translation');
     $this->bhvkSubDecorators($subForm);
     /*
      * 
      */
     $element = new Zend_Form_Element_Submit('submit_invoicecharge');
     $element->setLabel('Verwerken')->setAttrib('class', 'submit');
     $this->addElement($element);
     $this->addDisplayGroup(array('submit_invoicecharge'), 'submit', array('class' => 'submit'));
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmit('submit_invoicecharge');
 }
 public function init()
 {
     parent::init();
     $element = new Zend_Form_Element_Text('debtor_no');
     $element->setLabel('Debiteur nummer')->setFilters(array('int'))->setRequired(true);
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('bank_no');
     $element->setLabel('Banknummer')->setRequired(true);
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('bank_bic');
     $element->setLabel('BIC')->setRequired(true);
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('bank_iban');
     $element->setLabel('IBAN')->setRequired(true);
     $this->addElement($element);
     $element = new Zend_Form_Element_Submit('owner_submit');
     $element->setLabel('Verwerken')->setAttrib('class', 'submit');
     $this->addElement($element);
     $this->addDisplayGroup(array('user_id', 'debtor_no'), 'Algemeen', array('legend' => 'Algemeen'));
     $this->addDisplayGroup(array('bank_no', 'bank_bic', 'bank_iban'), 'Bank', array('legend' => 'Bankgegevens'));
     $this->addDisplayGroup(array('owner_submit'), 'Submit', array('class' => 'submit'));
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmit('owner_submit');
 }
 public function init()
 {
     parent::init();
     $element = new Zend_Form_Element_Text('username');
     $element->setLabel('Gebruikersnaam')->setAttrib('maxlength', 100)->setValidators(array(array('alnum', false), array('stringLength', false, array('min' => 6, 'max' => 100))));
     $this->addElement($element);
     $element = new Zend_Form_Element_Password('password');
     $element->setLabel('Wachtwoord (nieuw)')->setAttrib('maxlength', 100)->setValidators(array(array('stringLength', false, array('min' => 6, 'max' => 100))));
     $this->addElement($element);
     $element = new Zend_Form_Element_Password('password_check');
     $element->setLabel('Wachtwoord (herhaling nieuw)')->setAttrib('maxlength', 100)->addPrefixPath('Jm_Validate', 'Jm/Validate', 'validate')->setValidators(array(array('PasswordConfirm'), array('stringLength', false, array('min' => 6, 'max' => 100))));
     $this->addElement($element);
     /*
      * 
      * Person fields
      * 
      */
     // @todo: Chars
     $element = new Zend_Form_Element_Text('initials');
     $element->setLabel('Voorletters')->setRequired(true)->setAttribs(array('maxlength' => 24))->setValidators(array(array('stringLength', false, array('max' => 24))));
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('insertion');
     $element->setLabel('Tussenvoegsel')->setAttribs(array('maxlength' => 16))->setValidators(array(array('stringLength', false, array('max' => 16))));
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('surname');
     $element->setLabel('Achternaam')->setRequired(true)->setAttribs(array('maxlength' => 100))->setValidators(array(array('stringLength', false, array('min' => 2, 'max' => 100))));
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('address');
     $element->setLabel('Straatnaam')->setRequired(true)->setAttribs(array('maxlength' => 100))->setValidators(array(array('stringLength', false, array('min' => 2, 'max' => 100))));
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('number');
     $element->setLabel('Huisnummer')->setRequired(true)->setAttribs(array('maxlength' => 16))->setValidators(array(array('stringLength', false, array('max' => 16))));
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('zipcode');
     $element->setLabel('Postcode')->setRequired(true)->setAttribs(array('maxlength' => 16))->setValidators(array(array('stringLength', false, array('max' => 16))));
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('city');
     $element->setLabel('Plaats')->setRequired(true)->setAttribs(array('maxlength' => 100))->setValidators(array(array('stringLength', false, array('min' => 2, 'max' => 100))));
     $this->addElement($element);
     // @todo: multilang
     $element = new Zend_Form_Element_Select('pb_geo_country_id');
     $element->setLabel('Land')->addMultiOption('', '...')->setRequired(true);
     $countries = Doctrine_Query::create()->from('Model_Pb_Geo_Country cr')->select('cr.id, cr.name')->orderBy('cr.name ASC')->execute(null, Doctrine_Core::HYDRATE_ARRAY);
     foreach ($countries as $country) {
         $element->addMultiOption($country['id'], $country['name']);
     }
     $this->addElement($element);
     // @todo: multilang
     $element = new Zend_Form_Element_Select('pb_lang_id');
     $element->setLabel('Taal')->addMultiOption('', '...')->setRequired(true);
     $langs = Doctrine_Query::create()->from('Model_Pb_Lang lg')->select('lg.id, lg.name')->orderBy('lg.name')->execute(null, Doctrine_Core::HYDRATE_ARRAY);
     foreach ($langs as $lang) {
         $element->addMultiOption($lang['id'], $lang['name']);
     }
     $this->addElement($element);
     // @todo: multilang
     $element = new Zend_Form_Element_Select('gender');
     $element->setLabel('Geslacht')->addMultiOption('', ' ')->addMultiOption('v', 'Vrouw')->addMultiOption('m', 'Man')->setRequired(true);
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('birth_at');
     $element->setLabel('Geboortedatum')->setRequired(true)->setValidators(array(array('date')));
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('person_no');
     $element->setLabel('Persoonnummer')->setDescription('Het persoonnummer vind u op uw 
                               identiteitskaart, paspoort of rijbewijs. 
                               Persoonnummer ook bekend als: Burger Service 
                               Nummer(BSN), SOFI nummer of burgernummer.')->setRequired(true)->addValidators(array(array('stringLength', false, array('min' => '6'))));
     $this->addElement($element);
     /*
      * 
      * Contact fields
      * 
      */
     $element = new Zend_Form_Element_Text('phone_pri');
     $element->setLabel('Primair telefoonnummer')->setRequired(true)->setAttrib('maxlength', 100)->setValidators(array(array('stringLength', false, array('min' => 4, 'max' => 100))))->setDescription('Vermeld hier het telefoonnummer waarmee u makkelijk 
             			      te bereiken bent. Onze voorkeur is een mobielnummer.');
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('phone_sec');
     $element->setLabel('Secundair telefoonnummer')->setAttrib('maxlength', 100)->setValidators(array(array('stringLength', false, array('min' => 4, 'max' => 100))));
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('fax');
     $element->setLabel('Fax')->setAttrib('maxlength', 100)->setValidators(array(array('stringLength', false, array('min' => 4, 'max' => 100))));
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('email');
     $element->setLabel('Email')->setRequired(true)->setValidators(array(array('emailAddress')));
     $this->addElement($element);
     /*
      * 
      * Bank fields
      * 
      */
     $element = new Zend_Form_Element_Text('bank_no');
     $element->setLabel('Banknummer')->setDescription('')->setValidators(array(array('stringLength', false, array('min' => 4, 'max' => 100))));
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('bank_bic');
     $element->setLabel('BIC')->setDescription('Bank Identifier Code')->setValidators(array(array('alnum'), array('stringLength', false, array('min' => 4, 'max' => 100))));
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('bank_iban');
     $element->setLabel('IBAN')->setDescription('International Bank Account Number')->setValidators(array(array('alnum'), array('stringLength', false, array('min' => 4, 'max' => 100))));
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('license_plate');
     $element->setLabel('Kenteken')->setDescription('Bij enkele woningen hebben wij uw kentenplaatnummer nodig.
         		Dit vanwege automatische kentekenherkenning.');
     $this->addElement($element);
     /*
      * 
      * Submit
      * 
      */
     $element = new Zend_Form_Element_Submit('user_submit');
     $element->setLabel('Gebruiker aanpassen')->setAttrib('class', 'submit');
     $this->addElement($element);
     /*
      * 
      * Fieldsets
      * 
      */
     $this->addDisplayGroup(array('initials', 'insertion', 'surname', 'gender', 'pb_lang_id', 'person_no', 'birth_at'), 'person', array('legend' => 'Persoongegevens'));
     $this->addDisplayGroup(array('address', 'number', 'zipcode', 'city', 'pb_geo_country_id', 'email', 'phone_pri', 'phone_sec', 'fax'), 'contact', array('legend' => 'Contactgegevens'));
     $this->addDisplayGroup(array('bank_no', 'bank_bic', 'bank_iban'), 'bank', array('legend' => 'Bankgegevens', 'description' => 'Wanneer u binnen Nederland woont moet u 
             				  alleen uw banknummer opgeven. Wanneer u buiten 
             				  Nederland woont, moet u BIC en IBAN opgeven.'));
     $this->addDisplayGroup(array('username', 'password_old', 'password', 'password_check'), 'login', array('legend' => 'Logingegevens', 'description' => 'Laat de velden leeg wanneer u niks wilt veranderen aan uw logingegevens.'));
     $this->addDisplayGroup(array('license_plate'), 'etc', array('legend' => 'Overige'));
     $this->addDisplayGroup(array('user_submit'), 'submit', array('class' => 'submit'));
     /*
      * 
      * Decorators
      * 
      */
     $this->setDecorators(array('FormElements', 'Form'));
     $this->setDisplayGroupDecorators(array('Description', 'FormElements', 'Fieldset'));
     $this->setElementDecorators(array('Description', 'ViewHelper', 'Errors', array(array('p' => 'HtmlTag'), array('tag' => 'p')), array('Label', array('tag' => 'p'))));
     $submit = $this->getElement('user_submit');
     $submit->setDecorators(array('ViewHelper'));
 }
 public function init()
 {
     parent::init();
     /**
      * 
      * General
      * 
      */
     $element = new Zend_Form_Element_Select('hm_home_id');
     $element->setLabel('Vakantiewoning')->setRequired(true)->addMultiOption('', '...');
     $homes = Model_Hm_Home::findAllForSelect()->execute(null, Doctrine_Core::HYDRATE_ARRAY);
     foreach ($homes as $home) {
         $element->addMultiOption($home['id'], $home['name']);
     }
     $this->addElement($element);
     $element = new Zend_Form_Element_Select('user_id');
     $element->setLabel('Gebruiker')->setRequired(true)->addMultiOption('', '...');
     $users = Model_User::findAllForAdmin()->execute(null, Doctrine_Core::HYDRATE_ARRAY);
     foreach ($users as $user) {
         $element->addMultiOption($user['id'], $user['surname'] . ', ' . $user['initials'] . ' ' . $user['insertion']);
     }
     $this->addElement($element);
     $element = new Zend_Form_Element_Select('hm_date_arrival_id');
     $element->setLabel('Aankomst datum')->setRequired(true)->addMultiOption('', '...');
     $availabelDates = new Model_Hm_AvailableDates($this->getHomeId());
     $arrivalDates = $availabelDates->getArrivalDates()->execute(null, Doctrine_Core::HYDRATE_ARRAY);
     foreach ($arrivalDates as $date) {
         $element->addMultiOption($date['id'], $date['zend_date']);
     }
     $this->addElement($element);
     $element = new Zend_Form_Element_Select('hm_date_departure_id');
     $element->setLabel('Vertrek datum')->setRequired(true)->setRegisterInArrayValidator(false)->addMultiOption('', '...');
     $this->addElement($element);
     $this->addDisplayGroup(array('hm_home_id', 'user_id', 'hm_date_arrival_id', 'hm_date_departure_id'), 'general', array('legend' => 'Algemeen', 'order' => 1));
     /**
      * 
      * Payments
      * 
      */
     $element = new Zend_Form_Element_Checkbox('payment_first_part');
     $element->setLabel('Aanbetaling voldaan')->setDecorators($this->_elementDecorators);
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('payment_first_part_at');
     $element->setLabel('Aanbetaling op datum')->setAttrib('class', 'datepicker');
     $this->addElement($element);
     $element = new Zend_Form_Element_Checkbox('payment_last_part');
     $element->setLabel('Resterend bedrag voldaan');
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('payment_last_part_at');
     $element->setLabel('Resterend bedrag op datum')->setAttrib('class', 'datepicker');
     $this->addElement($element);
     $element = new Zend_Form_Element_Checkbox('payment_guarentee');
     $element->setLabel('Borg teruggestort');
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('payment_guarentee_at');
     $element->setLabel('Borg teruggestort op datum')->setAttrib('class', 'datepicker');
     $this->addElement($element);
     $this->addDisplayGroup(array('payment_first_part', 'payment_first_part_at', 'payment_last_part', 'payment_last_part_at', 'payment_guarentee', 'payment_guarentee_at'), 'payment_first', array('legend' => 'Betalingen', 'order' => 5));
     /**
      * Optional charges
      */
     $optionalCharges = Model_Hm_Charge_Optional_Home::findAllForReservationForm($this->getHomeId())->execute();
     if (count($optionalCharges)) {
         $optionalChargesElements = array();
         foreach ($optionalCharges as $charge) {
             $element = new Zend_Form_Element_Select($charge->id);
             $element->setLabel($charge->Charge->translationHandler()->display_title . ' (stukprijs: ' . $charge->zend_price . ')')->setDescription($charge->Charge->translationHandler()->description)->addMultiOption('', '...');
             for ($i = 1; $i <= 15; $i++) {
                 $element->addMultiOption($i, $i . ' x ' . $charge->zend_price);
             }
             $optionalChargesElements[] = $charge->id;
             $this->addElement($element);
         }
         $this->addDisplayGroup($optionalChargesElements, 'optional', array('legend' => 'Optionele kosten', 'class' => 'width100', 'order' => 3));
     }
     /**
      * 
      * Persons
      * 
      */
     $homeInfo = $this->getHomeInfo()->fetchOne();
     $persons = new Reservation_Form_Reservation_Persons(array('amount' => $homeInfo->persons, 'class' => 'persons'));
     $this->addSubForm($persons, 'Persons', 4);
     /**
      * 
      * submit
      * 
      */
     $element = new Zend_Form_Element_Submit('submit_reservation');
     $element->setLabel('Verwerken')->setAttrib('class', 'submit');
     $this->addElement($element);
     $this->addDisplayGroup(array('submit_reservation'), 'submit', array('class' => 'submit', 'order' => 6));
     /**
      * 
      * Decorators
      * 
      */
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmitElement($this->getElement('submit_reservation'));
     $el = $this->getElement('payment_first_part');
     $el->setDecorators($this->_checkboxDecorator);
     $el = $this->getElement('payment_last_part');
     $el->setDecorators($this->_checkboxDecorator);
     $el = $this->getElement('payment_guarentee');
     $el->setDecorators($this->_checkboxDecorator);
 }
 public function init()
 {
     parent::init();
 }