public function _typeMedicSrc($meta = array())
 {
     $src = array();
     $oRef = new ReferencesObject();
     $refs = $oRef->getRefByType('medic');
     foreach ($refs as $ref) {
         $src[$ref['R_ID']] = $ref['RI_Value'];
     }
     return $src;
 }
Example #2
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     $labelCSS = Cible_FunctionsGeneral::getLanguageLabelColor($options);
     $imageSrc = $options['imageSrc'];
     $dataId = $options['dataId'];
     $imgField = $options['imgField'];
     $isNewImage = $options['isNewImage'];
     $moduleName = $options['moduleName'];
     if ($dataId == '') {
         $pathTmp = "../../../../../data/images/" . $moduleName . "/tmp";
     } else {
         $pathTmp = "../../../../../data/images/" . $moduleName . "/" . $dataId . "/tmp";
     }
     // hidden specify if new image for the news
     //        $newImage = new Zend_Form_Element_Hidden('isNewImage', array('value' => $isNewImage));
     //        $newImage->removeDecorator('Label');
     //        $this->addElement($newImage);
     // Value of the reference
     $value = new Zend_Form_Element_Text('RI_Value');
     $value->setLabel($this->getView()->getCibleText('form_reference_value_label'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array('Errors', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'stdTextInput');
     $label = $value->getDecorator('Label');
     $label->setOption('class', $this->_labelCSS);
     $this->addElement($value);
     // List of Type
     $type = new Zend_Form_Element_Select('R_TypeRef');
     $type->setLabel($this->getView()->getCibleText('form_reference_type_label'))->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdSelect')->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array('Errors', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))));
     $oRef = new ReferencesObject();
     $enums = $oRef->getEnum('R_TypeRef');
     $multiOptions = array();
     foreach ($enums as $enum) {
         $multiOptions[$enum] = $this->getView()->getCibleText('form_enum_' . $enum);
     }
     $type->addMultiOptions($multiOptions);
     $this->addElement($type);
     // Value of the reference
     $seq = new Zend_Form_Element_Text('RI_Seq');
     $seq->setLabel($this->getView()->getCibleText('form_reference_seq_label'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array('Errors', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'stdTextInput');
     $label = $seq->getDecorator('Label');
     $label->setOption('class', $this->_labelCSS);
     $this->addElement($seq);
 }
 public function __construct($options = null)
 {
     $this->_disabledDefaultActions = true;
     parent::__construct($options);
     // email
     $regexValidate = new Cible_Validate_Email();
     $regexValidate->setMessage($this->getView()->getCibleText('validation_message_emailAddressInvalid'), 'regexNotMatch');
     $email = new Zend_Form_Element_Text('email');
     $this->setAttrib('class', 'zendFormNewsletter');
     $email->setLabel($this->getView()->getCibleText('form_label_email'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addFilter('StringToLower')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->addValidator($regexValidate)->setAttrib('class', 'stdTextInput');
     $this->addElement($email);
     //unsubscription reason
     $reason = new Zend_Form_Element_Select('reason');
     $this->setAttrib('class', 'zendFormNewsletter');
     $reason->setLabel($this->getView()->getCibleText('form_label_unsubscribe_reason'))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array('Errors', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'reasonSelect', 'id' => ''))))->setAttrib('class', 'stdSelect');
     $selectoptions = array();
     $oRef = new ReferencesObject();
     $options = $oRef->getRefByType('unsubscrArg');
     foreach ($options as $option) {
         $value = $option['R_TypeRef'] . '-' . $option['R_ID'];
         $selectoptions[$option['R_ID']] = $option['RI_Value'];
     }
     $reason->addMultiOptions($selectoptions);
     $reason->addMultiOption(0, 'Autre');
     $this->addElement($reason);
     //unsubscription reason
     $reasonOther = new Zend_Form_Element_Textarea('reasonOther');
     $this->setAttrib('class', 'zendFormNewsletter');
     $reasonOther->addFilter('StripTags')->addFilter('StringTrim')->addFilter('StringToLower')->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array('Errors', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'reasonOther hidden', 'id' => ''))))->setAttrib('class', 'reasonTextarea');
     $this->addElement($reasonOther);
     $unsubscribeButton = new Zend_Form_Element_Submit('unsubscribe');
     $unsubscribeButton->setLabel($this->getView()->getCibleText('newsletter_title_desabonnement_text'))->setAttrib('id', 'unsubmitSave')->setAttrib('class', 'unsubscribeButton1')->removeDecorator('Label')->removeDecorator('DtDdWrapper');
     $this->addElement($unsubscribeButton);
     $this->addDisplayGroup(array('unsubscribe'), 'actions');
     $actions = $this->getDisplayGroup('actions');
     $this->setDisplayGroupDecorators(array('formElements', 'fieldset', array(array('outerHtmlTag' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'dd-unsubscribe-button'))));
     $requiredFields = new Zend_Form_Element_Hidden('RequiredFields');
     $requiredFields->setLabel('<span class="field_required">*</span>' . $this->getView()->getCibleText('form_field_required_label') . '<br /><br />');
     $requiredFields->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_required_fields'))));
     $this->addElement($requiredFields);
     $this->setDecorators(array('FormElements', 'Form'));
 }
Example #4
0
 /**
  * Dispatches actions for the references.
  *
  * @access public
  *
  * @return void
  */
 public function referencesAction($getParams = false)
 {
     if ($this->view->aclIsAllowed($this->_moduleTitle, 'edit', true)) {
         //            $this->_disableExportToExcel = true;
         $this->_colTitle = array('R_ID' => array('width' => '150px'), 'R_TypeRef' => array('width' => '150px'), 'RI_Value' => array('width' => '150px'));
         $this->_setFilters = true;
         $oRef = new ReferencesObject();
         $data = $oRef->getAll($this->_defaultEditLanguage);
         $choices = array();
         $choices[''] = $this->view->getCibleText('filter_empty_label');
         foreach ($data as $ref) {
             $choices[$ref['R_TypeRef']] = $this->view->getCibleText('form_enum_' . $ref['R_TypeRef']);
         }
         $this->_filterParams = array('references-status-filter' => array('label' => 'Filtre 1', 'default_value' => null, 'associatedTo' => 'R_TypeRef', 'choices' => array_unique($choices)));
         if ($getParams) {
             $params = array('columns' => $this->_colTitle, 'joinTables' => $this->_joinTables);
             return $params;
         }
         $this->_formName = 'FormReferences';
         $this->_redirectAction();
     }
 }
Example #5
0
 public function toExcelAction()
 {
     $this->filename = 'benevolesList.xls';
     $this->type = 'Excel5';
     $generic = new GenericProfilesObject();
     $generic->setOrderBy('GP_LastName');
     $profile = new VolunteersProfilesObject();
     $oRef = new ReferencesObject();
     $this->select = $profile->getAll(null, false);
     $this->select->joinLeft($generic->getDataTableName(), $profile->getDataId() . ' = ' . $generic->getDataId(), array('lastName' => 'GP_LastName', 'firstName' => 'GP_FirstName', 'email' => 'GP_Email', 'member_id' => 'GP_MemberID'));
     $this->select->joinLeft($oRef->getDataTableName(), $oRef->getDataId() . ' = VP_Job', array('R_TypeRef'));
     $this->select->joinLeft($oRef->getIndexTableName(), $oRef->getIndexId() . ' = ' . $oRef->getDataId(), array('VP_Job' => 'RI_Value'));
     $this->tables = array('GenericProfiles' => array('GP_LastName', 'GP_FirstName', 'GP_Email'), 'VolunteersProfile' => array('VP_GenericProfileId', 'VP_Job'), $oRef->getDataTableName() => array('R_TypeRef'), $oRef->getIndexTableName() => array('RI_Value'));
     $this->fields = array('firstName' => array('width' => '250px'), 'lastName' => array('width' => '250px'), 'email' => array('width' => '250px'), 'VP_Job' => array('width' => '250px'));
     $this->filters = array();
     parent::toExcelAction();
 }
Example #6
0
 protected function logUnsubscribe()
 {
     $reason = $this->_params['reason']['reason'];
     $reasonValue = array();
     if ($reason == 0) {
         $reasonValue = array('reason' => 'other');
         $reasonValue['value'] = $this->_params['reason']['reasonOther'];
     } else {
         $oRef = new ReferencesObject();
         $reasonValue = $oRef->getValueById($reason);
     }
     $strData = "releaseId" . $this->pairSepar . $this->_params['releaseId'] . $this->separator . 'category' . $this->pairSepar . $this->_params['category'] . $this->separator . $reasonValue['reason'] . $this->pairSepar . $reasonValue['value'] . $this->separator;
     $data = array('L_ModuleID' => $this->_moduleID, 'L_UserID' => $this->_params['memberId'], 'L_Action' => 'unsubscribe', 'L_Data' => $strData);
     $oLog = new LogObject();
     $oLog->writeData($data);
 }
 public function _jobsListSrc($meta = array())
 {
     $src = array();
     $oRef = new ReferencesObject();
     $roles = $oRef->getRefByType('jobs');
     $src[0] = Cible_Translation::getCibleText('form_select_default_label');
     foreach ($roles as $role) {
         $src[$role['R_ID']] = $role['RI_Value'];
     }
     return $src;
 }
Example #8
0
 public function toExcelAction()
 {
     $this->filename = 'membersList.xls';
     $this->type = 'Excel5';
     $profile = new GenericProfilesObject();
     $profile->setOrderBy('GP_LastName');
     $member = new MemberProfilesObject();
     $oRef = new ReferencesObject();
     $oAddr = new AddressObject();
     $oParent = new ParentProfilesObject();
     $oParent = new ParentProfilesObject();
     $this->select = $profile->getAll(null, false);
     $this->select->columns(array('lastName' => 'GP_LastName', 'firstName' => 'GP_FirstName', 'email' => 'GP_Email', 'member_id' => 'GP_MemberID'));
     $this->select->joinRight($member->getDataTableName(), $member->getDataId() . ' = ' . $profile->getDataId());
     $this->select->joinLeft($oRef->getDataTableName(), $oRef->getDataId() . ' = MP_Section', array('R_TypeRef'));
     $this->select->joinLeft($oRef->getIndexTableName(), $oRef->getIndexId() . ' = ' . $oRef->getDataId(), array('section' => 'RI_Value'));
     $this->select->joinLeft($oParent->getDataTableName(), $oParent->getDataId() . ' = MP_FirstParent OR ' . $oParent->getDataId() . ' = MP_SecondParent');
     //            $this->select->joinLeft(
     //                    $oParent->getDataTableName(),
     //                    $oParent->getDataId() . ' = MP_SecondParent'
     //                );
     $this->select->joinLeft($oAddr->getDataTableName(), $oAddr->getDataId() . ' = PP_AddressId');
     $this->select->joinLeft($oAddr->getIndexTableName(), $oAddr->getIndexId() . ' = ' . $oAddr->getDataId());
     $this->select->joinLeft('CountriesIndex', 'CountriesIndex.CI_CountryID = A_CountryId', 'CI_Name');
     $this->select->joinLeft('StatesIndex', 'SI_StateID = A_StateId', 'SI_Name');
     $this->select->where('MP_Category in (45,46)');
     $this->select->where('MP_YearsParticipate like "%' . date('Y', time()) . '%"');
     $this->tables = array('GenericProfiles' => array('GP_LastName', 'GP_FirstName', 'GP_Email'), 'MemberProfiles' => array('MP_GenericProfileId', 'MP_Section'), $oRef->getDataTableName() => array('R_TypeRef'), $oRef->getIndexTableName() => array('RI_Value'));
     $this->fields = array('section' => array('width' => '250px'), 'CI_Name' => 'CI_Name', 'SI_Name' => 'SI_Name');
     $this->fields = array_merge($this->fields, $profile->getDataColumns(), $member->getDataColumns(), $oAddr->getDataColumns(), $oAddr->getIndexColumns(), $oParent->getDataColumns(), $oRef->getIndexColumns());
     unset($this->fields[$oRef->getDataId()]);
     unset($this->fields[$member->getDataId()]);
     unset($this->fields[$profile->getDataId()]);
     unset($this->fields['PP_AssuSocNum']);
     $this->filters = array();
     parent::toExcelAction();
 }
Example #9
0
 public function _memberCategorySrc($meta = array())
 {
     $src = array();
     $oRef = new ReferencesObject();
     $values = $oRef->getRefByType('memberCategory');
     foreach ($values as $value) {
         $src[$value['R_ID']] = $value['RI_Value'];
     }
     return $src;
 }
Example #10
0
 public function _listRespSrc($meta = array())
 {
     $src = array();
     $oRef = new ReferencesObject();
     $roles = $oRef->getRefByType('garde');
     foreach ($roles as $role) {
         $src[$role['R_ID']] = $role['RI_Value'];
     }
     return $src;
 }