Пример #1
0
 public function __construct($options = null)
 {
     if (isset($options['isXmlHttpRequest']) && $options['isXmlHttpRequest']) {
         $this->_disabledDefaultActions = true;
     }
     $this->_disabledLangSwitcher = true;
     if (!empty($options['object'])) {
         $this->_object = $options['object'];
         unset($options['object']);
     }
     parent::__construct($options);
 }
Пример #2
0
 public function populate(array $values)
 {
     $baseDir = $this->getView()->BaseUrl();
     $content = '';
     $isSaved = false;
     $currentYear = date('Y', time());
     if (empty($values['MP_YearsParticipate'])) {
         $values['MP_YearsParticipate'] = $currentYear . ',';
     }
     $isSaved = preg_match('/' . $currentYear . '/', $values['MP_YearsParticipate']);
     if (!$isSaved && $values['MP_Category'] == 46) {
         $lastChar = strrpos($values['MP_YearsParticipate'], ',', -1);
         if (!$lastChar) {
             $values['MP_YearsParticipate'] .= ',';
         }
         $values['MP_YearsParticipate'] .= $currentYear . ',';
     }
     parent::populate($values);
     if (!empty($values['firstP'])) {
         $subject = '##ROLE## : ' . $this->getView()->link('##HREF##', '##FNAME## ##LNAME##');
         if ($values['firstP'][4]) {
             $subject .= " (reçu pour impôts)";
         }
         $href = $baseDir . '/users/index/general/actionKey/edit/id/' . $values['firstP']['1'];
         $values['firstP']['1'] = $href;
         $content = str_replace(array('##ROLE##', '##HREF##', '##FNAME##', '##LNAME##'), $values['firstP'], $subject);
     }
     if (!empty($values['secP'])) {
         $subject = '##ROLE## : ' . $this->getView()->link('##HREF##', '##FNAME## ##LNAME##');
         if ($values['secP'][4]) {
             $subject .= " (reçu pour impôts)";
         }
         $href = $baseDir . '/users/index/general/actionKey/edit/id/' . $values['secP']['1'];
         $values['secP']['1'] = $href;
         $content .= '<br />';
         $content .= str_replace(array('##ROLE##', '##HREF##', '##FNAME##', '##LNAME##'), $values['secP'], $subject);
     }
     if (empty($values['firstP']) || empty($values['secP'])) {
         //            $img = <img title="Supprimer" alt="" src="">
         $img = $this->getView()->image('/extranet/icons/button_add.png', array('title' => 'Ajouter'));
         $href = $this->getView()->BaseUrl() . '/parent/index/list/actionKey/add/child/' . $values['MP_GenericProfileId'];
         $link = $this->getView()->link($href, $img . 'Ajouter les parents / représentants légaux', array('class' => 'addParents'));
         if (!empty($content)) {
             $content .= '<br />';
         }
         $content .= $link;
     }
     $firstP = new Cible_Form_Element_Html('parents', array('value' => $content));
     $firstP->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'left clearLeft'))));
     $this->getDisplayGroup('other')->addElement($firstP);
     $firstP->setOrder(1);
 }
Пример #3
0
 public function __construct($options = null)
 {
     //        $formDataName = 'reportsForm';
     $this->_disabledDefaultActions = false;
     $this->_addSubmitSaveClose = true;
     $this->_disabledLangSwitcher = true;
     if (!empty($options['object'])) {
         $this->_object = $options['object'];
         unset($options['object']);
     }
     parent::__construct($options);
     $this->setAttrib('id', 'reports');
     $this->addDisplayGroup(array('RE_Label'), 'reportsData');
     $this->getDisplayGroup('reportsData')->setAttrib('class', 'infosFieldset')->removeDecorator('DtDdWrapper');
 }
Пример #4
0
 public function __construct($options = null)
 {
     $this->_disabledDefaultActions = false;
     $this->_disabledLangSwitcher = true;
     if (!empty($options['object'])) {
         $this->_object = $options['object'];
         unset($options['object']);
     }
     parent::__construct($options);
     $this->setAttrib('id', 'volunteersInfo');
     $years = new Zend_Form_Element_Text('YP_Year');
     $years->setLabel($this->getView()->getCibleText('form_label_YP_Year'))->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array('Errors', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline'))))->setAttrib('class', 'stdTextInput');
     $this->addElement($years);
     $this->addDisplayGroup(array('VP_Job', 'VP_Notes', 'YP_Year'), 'vData');
     $this->getDisplayGroup('vData')->setLegend('Informations')->setAttrib('class', 'infosFieldset')->removeDecorator('DtDdWrapper');
 }
Пример #5
0
 public function __construct($options = null)
 {
     if (!empty($options['object'])) {
         $this->_object = $options['object'];
         unset($options['object']);
     }
     // variable
     parent::__construct($options);
     $titleEditor = new Cible_Form_Element_Editor('ST_ValueTitle', array('mode' => Cible_Form_Element_Editor::ADVANCED));
     $titleEditor->setLabel($this->getView()->getCibleText('form_legend_blockData'))->setAttrib('class', 'largeEditor')->setOrder(9);
     $label = $titleEditor->getDecorator('label');
     $label->setOption('class', $this->_labelCSS);
     $this->addElement($titleEditor);
     $textEditor = new Cible_Form_Element_Editor('ST_ValueText', array('mode' => Cible_Form_Element_Editor::ADVANCED));
     $textEditor->setLabel($this->getView()->getCibleText('form_legend_blockData'))->setAttrib('class', 'largeEditor')->setOrder(7);
     $label = $textEditor->getDecorator('label');
     $label->setOption('class', $this->_labelCSS);
     $this->addElement($textEditor);
 }
Пример #6
0
 public function __construct($options = null)
 {
     $formDataName = 'staffForm';
     $this->_disabledDefaultActions = false;
     $this->_disabledLangSwitcher = true;
     if (!empty($options['object'])) {
         $this->_object = $options['object'];
         unset($options['object']);
     }
     parent::__construct($options);
     $this->setAttrib('id', 'staffInfo');
     $subForm = new Cible_Form_SubForm();
     $subForm->setName($formDataName)->removeDecorator('DtDdWrapper');
     $subForm->setLegend('Adresse');
     $address = new Cible_View_Helper_FormAddress($subForm);
     $address->enableFields(array('firstAddress' => false, 'secondAddress' => false, 'cityTxt' => false, 'zipCode' => false, 'state' => false, 'country' => false, 'firstTel' => false, 'secondTel' => false));
     $address->formAddress();
     $this->addSubForm($subForm, $formDataName);
     $this->getSubForm($formDataName)->getElement('selectedState')->getDecorator('HtmlTag')->setOption('style', 'margin: 0px;');
     $this->addDisplayGroup(array('SP_Notes'), 'staffData');
     $this->getDisplayGroup('staffData')->setLegend('Informations')->setAttrib('class', 'infosFieldset')->removeDecorator('DtDdWrapper');
 }
Пример #7
0
 public function __construct($options = null)
 {
     if (!empty($options['isXmlHttpRequest'])) {
         $this->_disabledDefaultActions = true;
     }
     $this->_disabledLangSwitcher = true;
     if (!empty($options['object'])) {
         $this->_object = $options['object'];
         unset($options['object']);
     }
     parent::__construct($options);
     $subForm = new Cible_Form_SubForm();
     $subForm->setName('parentForm')->removeDecorator('DtDdWrapper');
     $subForm->setLegend('Adresse');
     $address = new Cible_View_Helper_FormAddress($subForm);
     $address->enableFields(array('firstAddress' => false, 'secondAddress' => false, 'cityTxt' => false, 'zipCode' => false, 'state' => false, 'country' => false, 'firstTel' => false, 'secondTel' => false));
     $address->formAddress();
     $this->addSubForm($subForm, 'parentForm');
     $this->getSubForm('parentForm')->getElement('selectedState')->getDecorator('HtmlTag')->setOption('style', 'margin: 0px;');
     $this->addDisplayGroup(array('PP_Role', 'PP_TaxReceipt', 'PP_AssuSocNum', 'PP_PhoneWork', 'PP_EmploiTps', 'PP_Notes'), 'data');
     $this->getDisplayGroup('data')->setLegend('Infornations')->setAttrib('class', 'infosFieldsetParent')->removeDecorator('DtDdWrapper');
 }
Пример #8
0
 public function __construct($options = null)
 {
     $this->_disabledDefaultActions = false;
     $this->_disabledLangSwitcher = true;
     if (!empty($options['object'])) {
         $this->_object = $options['object'];
         unset($options['object']);
     }
     parent::__construct($options);
     $this->setAttrib('id', 'partnersInfo');
     $subForm = new Cible_Form_SubForm();
     $subForm->setName('partnersForm')->removeDecorator('DtDdWrapper');
     $subForm->setLegend('Adresse');
     $address = new Cible_View_Helper_FormAddress($subForm);
     $address->enableFields(array('firstAddress' => false, 'secondAddress' => false, 'cityTxt' => false, 'zipCode' => false, 'state' => false, 'country' => false, 'firstTel' => false, 'secondTel' => false));
     $address->formAddress();
     $this->addSubForm($subForm, 'partnersForm');
     $this->getSubForm('partnersForm')->getElement('selectedState')->getDecorator('HtmlTag')->setOption('style', 'margin: 0px;');
     $years = new Zend_Form_Element_Text('YP_Year');
     $years->setLabel($this->getView()->getCibleText('form_label_YP_Year'))->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array('Errors', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline'))))->setAttrib('class', 'stdTextInput');
     $this->addElement($years);
     $this->addDisplayGroup(array('PP_Function', 'PP_Company', 'PP_Notes', 'YP_Year'), 'partData');
     $this->getDisplayGroup('partData')->setLegend('Informations')->setAttrib('class', 'infosFieldset')->removeDecorator('DtDdWrapper');
 }
Пример #9
0
 public function populate(array $values)
 {
     $diseasesList = $this->_object->_diseasesSrc();
     $oDiseases = new DiseasesDetailsObject();
     $dData = $oDiseases->findData(array($oDiseases->getForeignKey() => $values[$this->_object->getForeignKey()]));
     $fieldSet = $this->getDisplayGroup('diseases');
     $i = 6;
     foreach ($diseasesList as $id => $disease) {
         $tmpForm = new FormDiseasesDetails(array('object' => $oDiseases, 'isXmlHttpRequest' => true));
         if (!empty($values['MR_Diseases']) && in_array($id, $values['MR_Diseases'])) {
             $oDiseases->setFilters(array($oDiseases->getForeignKey() => $values[$this->_object->getForeignKey()], 'DD_DiseaseId' => $id));
             $data = $oDiseases->getAll();
             $data[0]['DD_TypeMedic'] = explode(',', $data[0]['DD_TypeMedic']);
             $tmpForm->populate($data[0]);
         }
         $elems = $tmpForm->getElements();
         $test = new Zend_Form_SubForm();
         $test->setDisableLoadDefaultDecorators(true);
         $test->addElements($elems);
         $test->removeDecorator('DtDdWrapper');
         $test->setLegend('Détails pour ' . $disease);
         $test->setAttrib('class', 'infosFieldsetParent fieldsetDiseaseDetails');
         $test->setOrder($i++);
         $this->addSubForm($test, 'dd_' . $id);
     }
     parent::populate($values);
 }