Exemplo n.º 1
0
 public function setModel(\Application\Form\Form $form, \Model\Currency $model)
 {
     $values = $form->getValue("basic");
     $model->name = $values['name'];
     $model->active = $values['active'];
     $model->rate = $values['rate'];
 }
Exemplo n.º 2
0
 public function setModel(\Application\Form\Form $form, \Model\Product $model)
 {
     $em = EntityManager::getInstance();
     $values = $form->getValue("basic");
     $model->name = $values['name'];
     $model->description = $values['description'];
     $model->partner = $em->find("Partner", $values['partner']);
     $model->currency = $em->find("Currency", $values['currency']);
     $model->contactPerson = $em->find("ContactPerson", $values['contact_person']);
     $model->type = $em->find("ProductType", $values['product_type']);
     $model->active = $values['active'];
     $values = $form->getValue("settlement");
     $model->settlementType = $em->find("SettlementType", $values['settlement_type']);
     $model->sellerPercent = $values['seller_percent'];
     $model->percents = new \Application\Model\Collection\Collection();
     unset($values['settlement_type']);
     unset($values['seller_percent']);
     foreach ($values as $key => $productSettlementPercent) {
         $percent = $em->create("ProductSettlementPercent");
         $percent->product = $model;
         $employeePositionId = str_replace("employee_position_", "", $key);
         $percent->employeePosition = $em->find("EmployeePosition", $employeePositionId);
         $percent->value = $productSettlementPercent;
         $model->percents->push($percent);
     }
 }
Exemplo n.º 3
0
 public function setModel(\Application\Form\Form $form, \Model\Customer $model)
 {
     $em = EntityManager::getInstance();
     $values = $form->getValue("basic");
     $model->firstname = $values['firstname'];
     $model->lastname = $values['lastname'];
     $model->email = $values['email'];
     $model->phoneNumber = $values['phone_number'];
     $model->cellPhoneNumber = $values['cell_phone_number'];
     $model->group = $em->find("CustomerGroup", $values['customer_group']);
     $model->male = $values['male'];
     $model->employee = $em->find("Employee", $values['employee']);
     $model->status = $em->find("CustomerStatus", $values['customer_status']);
     $model->recommendingPerson = $values['recommending_person'];
     $model->dateOfLastAnalysis = $values['date_of_last_analysis'];
     $model->numberOfLastAnalysis = $values['number_of_last_analysis'];
     $model->active = $values['active'];
     $values = $form->getValue("additional");
     $model->birthDate = $values['birth_date'];
     $model->birthCity = $values['birth_city'];
     $model->identityCard = $values['identity_card'];
     $model->pesel = $values['pesel'];
     $model->nip = $values['nip'];
     $model->regon = $values['regon'];
 }
 public function setModel(\Application\Form\Form $form, \Model\ApplicationStatus $model)
 {
     $values = $form->getValue("basic");
     $model->name = $values['name'];
     $model->active = $values['active'];
     $model->takenToSettle = $values['taken_to_settle'];
 }
Exemplo n.º 5
0
 public function setModel(\Application\Form\Form $form, \Model\Application $model)
 {
     $em = EntityManager::getInstance();
     $values = $form->getValue("basic");
     $model->innerNumber = $values['inner_number'];
     $model->outerNumber = $values['outer_number'];
     $model->description = $values['description'];
     $model->status = $em->find("ApplicationStatus", $values['status']);
     $model->customer = $em->find("Customer", $values['customer']);
     $model->employee = $em->find("Employee", $values['employee']);
     $model->seller = $em->find("Employee", $values['seller']);
     $model->partner = $em->find("Partner", $values['partner']);
     $model->product = $em->find("Product", $values['product']);
     $values = $form->getValue("settlement");
     $model->insuranceSum = $values['insurance_sum'];
     $model->premiumType = $em->find("PremiumType", $values['premium_type']);
     $model->premium = $values['premium'];
     $model->amount = $values['amount'];
     $model->settlementType = $em->find("SettlementType", $values['settlement_type']);
     $model->currency = $em->find("Currency", $values['currency']);
     $model->currencyRate = $values['currency_rate'];
     $model->investmentTarget = $values['investment_target'];
     $model->conclusionDateStart = $values['conclusion_date_start'];
     $model->conclusionDateEnd = $values['conclusion_date_end'];
     $model->margin = $values['margin'];
     $model->costOfRepayment = $values['cost_of_repayment'];
     $model->settled = 0;
 }
Exemplo n.º 6
0
 public function setModel(\Application\Form\Form $form, \Model\Partner $model)
 {
     $em = EntityManager::getInstance();
     $values = $form->getValue("basic");
     $model->name = $values['name'];
     $model->description = $values['description'];
     $model->contactPerson = $em->find("ContactPerson", $values['contact_person']);
     $model->active = $values['active'];
 }
Exemplo n.º 7
0
 public function setModel(\Application\Form\Form $form, \Model\Configuration $model)
 {
     $values = $form->getValue("incaso");
     $model->incasoParts = $values['incaso_parts'];
     $values = $form->getValue("storno");
     $model->stornoInterval = $values['storno_interval'];
     $model->stornoFirstPartPercent = $values['storno_first_part_percent'];
     $model->stornoSecondPartPercent = $values['storno_second_part_percent'];
     $values = $form->getValue("tax-free");
     $model->taxFreeAllowance = $values['tax_free_allowance'];
     $model->taxPercent = $values['tax_percent'];
 }
Exemplo n.º 8
0
 public function setModel(\Application\Form\Form $form, \Model\Training $model)
 {
     $em = EntityManager::getInstance();
     $values = $form->getValue("basic");
     $model->title = $values['title'];
     $model->description = $values['description'];
     $model->active = $values['active'];
     if (!empty($values['employee_id'])) {
         $model->employee = $em->find("Employee", $values['employee']);
     } else {
         $model->employee = new \Model\Employee();
     }
 }
Exemplo n.º 9
0
 public function setModel(\Application\Form\Form $form, \Model\EmployeeAddress $model)
 {
     $em = EntityManager::getInstance();
     $values = $form->getValue("employee-address");
     $model->city = $values['city'];
     $model->postcode = $values['postcode'];
     $model->state = $em->find("State", $values['state']);
     $model->street = $values['street'];
     $model->addressType = $values['address_type'];
     $model->houseNumber = $values['house_number'];
     $model->flatNumber = $values['flat_number'];
     $model->employee = $em->find("Employee", $form->getValue("parent"));
 }
Exemplo n.º 10
0
 public function setModel(\Application\Form\Form $form, \Model\ContactPerson $model)
 {
     $values = $form->getValue("basic");
     $model->firstname = $values['firstname'];
     $model->lastname = $values['lastname'];
     $model->street = $values['street'];
     $model->city = $values['city'];
     $model->postcode = $values['postcode'];
     $model->state = EntityManager::getInstance()->find("State", $values['state']);
     $model->phoneNumber = $values['phone_number'];
     $model->email = $values['email'];
     $model->position = $values['position'];
     $model->active = $values['active'];
 }
Exemplo n.º 11
0
 public function setModel(\Application\Form\Form $form, \Model\Recruit $model)
 {
     $em = EntityManager::getInstance();
     $values = $form->getValue("basic");
     $model->firstname = $values['firstname'];
     $model->lastname = $values['lastname'];
     $model->description = $values['description'];
     $model->parentEmployee = $em->find("Employee", $values['parent_employee']);
     $model->email = $values['email'];
     $model->phoneNumber = $values['phone_number'];
     $model->position = $em->find("EmployeePosition", $values['employee_position']);
     $model->recommendingPerson = $values['recommending_person'];
     $model->active = $values['active'];
 }
Exemplo n.º 12
0
 public function setModel(\Application\Form\Form $form, \Model\Employee $model)
 {
     $em = EntityManager::getInstance();
     $values = $form->getValue("login-form");
     $model->login = $values['login'];
     $model->password = $values['password'];
     if (!empty($values['recruit_id'])) {
         $recruit = $em->find("Recruit", $values['recruit_id']);
         $em->delete($recruit);
     }
     $values = $form->getValue("basic");
     $model->firstname = $values['firstname'];
     $model->lastname = $values['lastname'];
     $model->description = $values['description'];
     $model->parentEmployee = $em->find("Employee", $values['parent_employee']);
     $model->email = $values['email'];
     $model->phoneNumber = $values['phone_number'];
     $model->cellPhoneNumber = $values['cell_phone_number'];
     $model->position = $em->find("EmployeePosition", $values['employee_position']);
     $model->group = $em->find("EmployeeGroup", $values['employee_group']);
     $model->recommendingPerson = $values['recommending_person'];
     $model->active = $values['active'];
     $values = $form->getValue("agreement");
     $model->agreementType = $em->find("AgreementType", $values['agreement_type']);
     $model->agreementNumber = $values['agreement_number'];
     $model->agreementStartDate = $values['agreement_start_date'];
     $model->agreementEndDate = $values['agreement_end_date'];
     $model->companyName = $values['company_name'];
     $model->studentCardExpirationDate = $values['student_card_expiration_date'];
     $model->birthDate = $values['birth_date'];
     $model->birthCity = $values['birth_city'];
     $model->motherName = $values['mother_name'];
     $model->fatherName = $values['father_name'];
     $model->identityCard = $values['identity_card'];
     $model->pesel = $values['pesel'];
     $model->nip = $values['nip'];
     $model->regon = $values['regon'];
     $model->bankName = $values['bank_name'];
     $model->bankAccount = $values['bank_account'];
     $accessValues = $form->getValue("access");
     if (isset($accessValues) && is_array($accessValues)) {
         $model->access = implode("", $accessValues);
     }
 }
Exemplo n.º 13
0
 public function setGroups(\Application\Form\Form $form, \Model\News $model)
 {
     $em = EntityManager::getInstance();
     $groupsSubForm = $form->getValue("groups");
     $groups = $groupsSubForm['group'];
     $modelGroups = array();
     foreach ($model->groups as $newsGroup) {
         $group = $newsGroup->group;
         if ($group->active && !in_array($group->getIdentifier(), $groups)) {
             $em->delete($newsGroup);
         } else {
             $modelGroups[] = $group->getIdentifier();
         }
     }
     foreach ($groups as $group) {
         if (!in_array($group, $modelGroups)) {
             $newsGroup = $em->create("NewsGroup");
             $newsGroup->news = $model;
             $newsGroup->group = $em->find("EmployeeGroup", $group);
             $em->persist($newsGroup);
         }
     }
 }
Exemplo n.º 14
0
 public function render(\Zend_View_Interface $view = null)
 {
     $request = \Zend_Controller_Front::getInstance()->getRequest();
     $hasPrivilege = \Application\Controller\Plugin\Privileges::hasPrivilige($request, Manager::ACTION_UPDATE);
     foreach ($this->getElements() as $name => $element) {
         if ($element instanceof \Zend_Form_Element_File) {
             $element->setDecorators($this->getElementDecoratorsForFile());
         }
         if ($hasPrivilege == false) {
             $element->setAttrib('readonly', true);
             $element->setAttrib('class', 'readonly');
         }
     }
     return parent::renderWithoutSubmitButton($view);
 }
Exemplo n.º 15
0
 public function setModel(\Application\Form\Form $form, \Model\Settlement $model)
 {
     $id = $this->_getParam("id");
     $em = EntityManager::getInstance();
     $values = $form->getValue("basic");
     $model->parts = $values['parts'];
     $model->amount = $values['amount'];
     $em->persist($model);
     $settlementTotal = $em->find("SettlementTotal", $id);
     $settlementTotal->total += $values['amount'];
     $em->persist($settlementTotal);
 }
Exemplo n.º 16
0
 public function setModel(\Application\Form\Form $form, \Model\EmployeePosition $model)
 {
     $values = $form->getValue("basic");
     $model->name = $values['name'];
     $model->active = $values['active'];
 }
Exemplo n.º 17
0
 public static function getMultiOptions(array $collection, $valueKey, $withEmptyOption = true)
 {
     return \Application\Form\Form::getMultiOptions($collection, $valueKey, $withEmptyOption);
 }
Exemplo n.º 18
0
 public function setModel(\Application\Form\Form $form, \Model\CustomerGroup $model)
 {
     $values = $form->getValue("basic");
     $model->name = $values['name'];
     $model->active = $values['active'];
 }
Exemplo n.º 19
0
 public function setModel(\Application\Form\Form $form, \Model\CustomerStatus $model)
 {
     $values = $form->getValue("status");
     $model->name = $values["name"];
     $model->active = $values["active"];
 }
Exemplo n.º 20
0
 public function setModel(\Application\Form\Form $form, \Model\ProductType $model)
 {
     $values = $form->getValue("basic");
     $model->name = $values['name'];
     $model->active = $values['active'];
 }