Beispiel #1
0
 public function init()
 {
     $em = EntityManager::getInstance();
     $element = $this->createElement("text", "street");
     $element->setRequired()->addValidator(new Zend_Validate_StringLength(array("max" => 255)))->addFilter(new Zend_Filter_StringTrim())->setLabel("Ulica")->setValue($this->getModel()->street);
     $this->addElement($element);
     $element = $this->createElement("text", "house_number");
     $element->setRequired()->addFilter(new Zend_Filter_StringTrim())->setLabel("Nr domu")->setValue($this->getModel()->houseNumber);
     $this->addElement($element);
     $element = $this->createElement("text", "flat_number");
     $element->addFilter(new Zend_Filter_StringTrim())->setLabel("Nr mieszkania")->setValue($this->getModel()->flatNumber);
     $this->addElement($element);
     $element = $this->createElement("text", "city");
     $element->setRequired()->addValidator(new Zend_Validate_StringLength(array("max" => 255)))->addFilter(new Zend_Filter_StringTrim())->setLabel("Miasto")->setValue($this->getModel()->city);
     $this->addElement($element);
     $element = $this->createElement("text", "postcode");
     $element->setRequired()->addValidator(new Zend_Validate_PostCode(Zend_Registry::get(\Application\Registry\Registry::LOCALE)))->addFilter(new Zend_Filter_StringTrim())->setLabel("Kod pocztowy")->setValue($this->getModel()->postcode);
     $this->addElement($element);
     $states = $em->findAll("State");
     $element = $this->createElement("select", "state");
     $element->setRequired()->addValidator(new Zend_Validate_Int())->addFilter(new Zend_Filter_Null())->setLabel("Województwo")->setValue($this->getModel()->state->getIdentifier())->setMultiOptions($this->getMultiOptions($states, "name"));
     $this->addElement($element);
     $element = $this->createElement("select", "address_type");
     $element->setRequired()->setMultiOptions(array(\Model\EmployeeAddress::BILLING_ADDRESS => "do płatności", \Model\EmployeeAddress::SHIPPING_ADDRESS => "do wysyłki"))->setLabel("Typ adresu")->setValue($this->getModel()->type);
     $this->addElement($element);
 }
 public function deleteAction()
 {
     $em = EntityManager::getInstance();
     $model = $em->find("ShipmentType", $this->_getParam("id"));
     $em->delete($model);
     $this->_redirect("/shipment-types");
 }
Beispiel #3
0
 public function deleteAction()
 {
     $em = EntityManager::getInstance();
     $model = $em->find("Employee", $this->_getParam("id"));
     $em->delete($model);
     $this->_redirect("/employees");
 }
 public function deleteAction()
 {
     $em = EntityManager::getInstance();
     $model = $em->find("Recruit", $this->_getParam("id"));
     $em->delete($model);
     $this->_redirect("/recruitment");
 }
Beispiel #5
0
 public function init()
 {
     $element = $this->createElement("text", "firstname");
     $element->setRequired()->addValidator(new Zend_Validate_Alpha(array("allowWhiteSpace" => true)))->addValidator(new Zend_Validate_StringLength(array("max" => 255)))->addFilter(new Zend_Filter_StringTrim())->setLabel("Imię")->setValue($this->getModel()->firstname);
     $this->addElement($element);
     $element = $this->createElement("text", "lastname");
     $element->setRequired()->addValidator(new Zend_Validate_Alpha(array("allowWhiteSpace" => true)))->addValidator(new Zend_Validate_StringLength(array("max" => 255)))->addFilter(new Zend_Filter_StringTrim())->setLabel("Nazwisko")->setValue($this->getModel()->lastname);
     $this->addElement($element);
     $element = $this->createElement("text", "street");
     $element->setRequired()->addValidator(new Zend_Validate_StringLength(array("max" => 255)))->addFilter(new Zend_Filter_StringTrim())->setLabel("Ulica")->setValue($this->getModel()->street);
     $this->addElement($element);
     $element = $this->createElement("text", "city");
     $element->setRequired()->addValidator(new Zend_Validate_StringLength(array("max" => 255)))->addFilter(new Zend_Filter_StringTrim())->setLabel("Miasto")->setValue($this->getModel()->city);
     $this->addElement($element);
     $element = $this->createElement("text", "postcode");
     $element->setRequired()->addValidator(new Zend_Validate_PostCode(Zend_Registry::get(\Application\Registry\Registry::LOCALE)))->addFilter(new Zend_Filter_StringTrim())->setLabel("Kod pocztowy")->setValue($this->getModel()->postcode);
     $this->addElement($element);
     $states = \Application\Entity\EntityManager::getInstance()->findAll("State");
     $element = $this->createElement("select", "state");
     $element->setRequired()->addValidator(new Zend_Validate_Int())->addFilter(new Zend_Filter_Null())->setLabel("Województwo")->setValue($this->getModel()->state->getIdentifier())->setMultiOptions($this->getMultiOptions($states, "name"));
     $this->addElement($element);
     $element = $this->createElement("text", "phone_number");
     $element->setRequired()->addFilter(new Zend_Filter_StringTrim())->setlabel('Numer telefonu')->setValue($this->getModel()->phoneNumber);
     $this->addElement($element);
     $element = $this->createElement("text", "email");
     $element->setRequired()->addValidator(new Zend_Validate_EmailAddress())->addValidator(new Zend_Validate_StringLength(array("max" => 255)))->addFilter(new Zend_Filter_StringTrim())->setLabel("Email")->setValue($this->getModel()->email);
     $this->addElement($element);
     $element = $this->createElement("text", "position");
     $element->addValidator(new Zend_Validate_StringLength(array("max" => 255)))->addFilter(new Zend_Filter_StringTrim())->setLabel("Stanowisko")->setValue($this->getModel()->position);
     $this->addElement($element);
     $element = $this->createElement("checkbox", "active");
     $element->setRequired()->setLabel("Aktywność")->setChecked($this->getModel()->active);
     $this->addElement($element);
 }
Beispiel #6
0
 public function deleteAction()
 {
     $em = EntityManager::getInstance();
     $model = $em->find("Training", $this->_getParam("id"));
     $em->delete($model);
     $this->_redirect("/trainings");
 }
Beispiel #7
0
 public function init()
 {
     $em = EntityManager::getInstance();
     $shipmentTypes = $em->findAllActive("ShipmentType");
     $element = $this->createElement("select", "type");
     $element->setRequired()->addValidator(new Zend_Validate_Int())->addFilter(new Zend_Filter_Null())->setLabel("Typ")->setValue($this->getModel()->type)->setMultiOptions($this->getMultiOptions($shipmentTypes, "name"));
     $this->addElement($element);
     $this->getModel()->{$element} = $this->createElement("text", "street");
     $element->setRequired()->addValidator(new Zend_Validate_Alnum(array("allowWhiteSpace" => true)))->addValidator(new Zend_Validate_StringLength(array("max" => 255)))->addFilter(new Zend_Filter_StringTrim())->setLabel("Ulica")->setValue($this->getModel()->street);
     $this->addElement($element);
     $element = $this->createElement("text", "city");
     $element->setRequired()->addValidator(new Zend_Validate_StringLength(array("max" => 255)))->addFilter(new Zend_Filter_StringTrim())->setLabel("Miasto")->setValue($this->getModel()->city);
     $this->addElement($element);
     $element = $this->createElement("text", "postcode");
     $element->setRequired()->addValidator(new Zend_Validate_PostCode(Zend_Registry::get(\Application\Registry\Registry::LOCALE)))->addFilter(new Zend_Filter_StringTrim())->setLabel("Kod pocztowy")->setValue($this->getModel()->postcode);
     $this->addElement($element);
     $states = $em->findAll("State");
     $element = $this->createElement("select", "state");
     $element->setRequired()->addValidator(new Zend_Validate_Int())->addFilter(new Zend_Filter_Null())->setLabel("Województwo")->setValue($this->getModel()->state->getIdentifier())->setMultiOptions($this->getMultiOptions($states, "name"));
     $this->addElement($element);
     $element = $this->createElement("text", "phone_number");
     $element->setRequired()->addFilter(new Zend_Filter_StringTrim())->setlabel('Numer telefonu')->setValue($this->getModel()->phoneNumber);
     $this->addElement($element);
     $element = $this->createElement("text", "email");
     $element->setRequired()->addValidator(new Zend_Validate_EmailAddress())->addFilter(new Zend_Filter_StringTrim())->setLabel("Email")->setValue($this->getModel()->email);
     $this->addElement($element);
 }
 public function deleteAction()
 {
     $em = EntityManager::getInstance();
     $model = $em->find("CustomerStatus", $this->_getParam("id"));
     $em->delete($model);
     $this->_redirect("/customer-statuses");
 }
Beispiel #9
0
 public function init()
 {
     $em = EntityManager::getInstance();
     $element = $this->createElement("text", "name");
     $element->setRequired()->addValidator(new Zend_Validate_StringLength(array("max" => 255)))->addFilter(new Zend_Filter_StringTrim())->setLabel("Nazwa")->setValue($this->getModel()->name);
     $this->addElement($element);
     $element = $this->createElement("textarea", "description");
     $element->addFilter(new Zend_Filter_StringTrim())->setLabel("Opis")->setValue($this->getModel()->description);
     $this->addElement($element);
     $partners = $em->findAllActive("Partner");
     $element = $this->createElement("select", "partner");
     $element->setRequired()->addValidator(new Zend_Validate_Int())->addFilter(new Zend_Filter_Null())->setLabel("Partner")->setValue($this->getModel()->partner->getIdentifier())->setMultiOptions($this->getMultiOptions($partners, "name"));
     $this->addElement($element);
     $currency = $em->findAllActive("Currency");
     $element = $this->createElement("select", "currency");
     $element->setRequired()->addValidator(new Zend_Validate_Int())->addFilter(new Zend_Filter_Null())->setLabel("Waluta")->setValue($this->getModel()->currency->getIdentifier())->setMultiOptions($this->getMultiOptions($currency, "name"));
     $this->addElement($element);
     $contactPersons = $em->findAllActive("ContactPerson");
     $element = $this->createElement("select", "contact_person");
     $element->setRequired()->addValidator(new Zend_Validate_Int())->addFilter(new Zend_Filter_Null())->setLabel("Kontakt")->setMultiOptions($this->getMultiOptions($contactPersons, array("lastname", "firstname")))->setValue($this->getModel()->contactPerson->getIdentifier());
     $this->addElement($element);
     $productTypes = $em->findAllActive("ProductType");
     $element = $this->createElement("select", "product_type");
     $element->setRequired()->addValidator(new Zend_Validate_Int())->addFilter(new Zend_Filter_Null())->setLabel("Typ")->setValue($this->getModel()->type->getIdentifier())->setMultiOptions($this->getMultiOptions($productTypes, "name"));
     $this->addElement($element);
     $element = $this->createElement("checkbox", "active");
     $element->setRequired()->addValidator(new Zend_Validate_Int())->setLabel("Aktywność")->setChecked($this->getModel()->active);
     $this->addElement($element);
 }
Beispiel #10
0
 public function __construct($entityClass, $where = null, $sort = null, $order = null)
 {
     $this->_dataMapper = EntityManager::getInstance()->getDataMapper($entityClass);
     $this->_where = $where;
     $this->_sort = $sort;
     $this->_order = $order;
 }
 public function deleteAction()
 {
     $em = EntityManager::getInstance();
     $model = $em->find("Application", $this->_getParam("id"));
     $em->delete($model);
     $this->_redirect("/applications");
 }
Beispiel #12
0
 public function init()
 {
     $em = \Application\Entity\EntityManager::getInstance();
     $trainings = $em->findAllActive("Training");
     $element = $this->createElement("select", "training");
     $element->setRequired()->addValidator("Int")->addFilter(new Zend_Filter_Null())->setLabel("Szkolenie")->setValue($this->getModel()->training->getIdentifier())->setMultiOptions($this->getMultiOptions($trainings, "title"));
     $this->addElement($element);
     $element = $this->createElement("text", "date");
     $element->setRequired()->setLabel("Data")->setValue($this->getModel()->createDate);
     $this->addElement($element);
     $element = $this->createElement("text", "mark");
     $element->setRequired()->addValidator(new Zend_Validate_Float(array('locale' => 'en_US')))->setLabel("Ocena")->setValue($this->getModel()->mark);
     $this->addElement($element);
     $examiners = array();
     $employees = $em->findAllActive("Employee");
     $groupsOut = array("Administracja", "Doradcy Klienta", "Telemarketing");
     foreach ($employees as $index => $employee) {
         if (!in_array($employee->group->name, $groupsOut)) {
             $examiners[] = $employee;
         }
     }
     $element = $this->createElement("select", "examiner");
     $element->setRequired()->addValidator("Int")->addFilter(new Zend_Filter_Null())->setMultiOptions($this->getMultiOptions($examiners, array("lastname", "firstname")))->setLabel("Egzaminator")->setValue($this->getModel()->examiner->getIdentifier());
     $this->addElement($element);
 }
Beispiel #13
0
 public function deleteAction()
 {
     $em = EntityManager::getInstance();
     $model = $em->find("Product", $this->_getParam("id"));
     EntityManager::getInstance()->delete($model);
     $this->_redirect("/products");
 }
 public function deleteAction()
 {
     $em = EntityManager::getInstance();
     $model = $em->find("CustomerCredit", $this->_getParam("id"));
     $em->delete($model);
     $this->getHelper("formAction")->simpleEndAction();
 }
Beispiel #15
0
 public function getProductsAction()
 {
     $institutionId = $this->getRequest()->getParam("id");
     $entityManager = EntityManager::getInstance();
     $products = $entityManager->findAllActive("InstitutionProduct", "institution_id = " . $institutionId);
     $data = Collection::toArray($products);
     echo Zend_Json::encode($data);
 }
Beispiel #16
0
 public function init()
 {
     $em = EntityManager::getInstance();
     $customers = $em->findAllActive("Customer");
     $element = $this->createElement("select", "customer");
     $element->setRequired()->addValidator("Int")->addFilter(new Zend_Filter_Null())->setLabel("Klient")->setValue($this->getModel()->getIdentifier())->setMultiOptions($this->getMultiOptions($customers, array("lastname", "firstname")));
     $this->addElement($element);
 }
 public function indexAction()
 {
     $em = \Application\Entity\EntityManager::getInstance();
     $model = $em->create("Configuration");
     $form = new Configuration_Form($model);
     $this->getHelper("formAction")->action($form, $model, true);
     $this->view->form = $form;
 }
Beispiel #18
0
 protected function _doLoad($id)
 {
     $em = EntityManager::getInstance();
     $row = $this->getDbTable()->find($id)->current();
     $model = new \Model\InstitutionProduct();
     $this->_simpleMap($model, $row);
     $model->institution = $em->find("Institution", $row['institution_id']);
     return $model;
 }
Beispiel #19
0
 protected function _doLoad($id)
 {
     $em = \Application\Entity\EntityManager::getInstance();
     $row = $this->getDbTable()->find($id)->current();
     $model = new \Model\Document();
     $this->_simpleMap($model, $row);
     $model->employee = $em->find("Employee", $row['employee_id']);
     return $model;
 }
Beispiel #20
0
 protected function _doLoad($id)
 {
     $em = EntityManager::getInstance();
     $model = new \Model\RecruitDocument();
     $row = $this->getDbTable()->find($id)->current();
     $model->recruit = $em->find("Recruit", $row['recruit_id']);
     $model->document = $em->find("Document", $row['document_id']);
     return $model;
 }
Beispiel #21
0
 protected function _doLoad($id)
 {
     $em = EntityManager::getInstance();
     $policy = new \Model\Policy();
     $row = $this->getDbTable()->find($id)->current();
     $this->_simpleMap($policy, $row);
     $policy->application = $em->find("Application", $row['application_id']);
     return $policy;
 }
Beispiel #22
0
 protected function _doLoad($id)
 {
     $em = EntityManager::getInstance();
     $model = new \Model\EmployeeDocument();
     $row = $this->getDbTable()->find($id)->current();
     $model->employee = $em->find("Employee", $row['employee_id']);
     $model->document = $em->find("Document", $row['document_id']);
     return $model;
 }
Beispiel #23
0
 protected function _doLoad($id)
 {
     $em = EntityManager::getInstance();
     $model = new \Model\ApplicationDocument();
     $row = $this->getDbTable()->find($id)->current();
     $model->application = $em->find("Application", $row['customer_id']);
     $model->document = $em->find("Document", $row['document_id']);
     return $model;
 }
Beispiel #24
0
 protected function _doLoad($id)
 {
     $em = EntityManager::getInstance();
     $model = new \Model\ApplicationShipment();
     $row = $this->getDbTable()->find($id)->current();
     $this->_simpleMap($model, $row);
     $model->application = $em->find("Application", $row['application_id']);
     $model->shipment = $em->find("Shipment", $row['shipment_id']);
     return $model;
 }
 protected function _doLoad($id)
 {
     $em = EntityManager::getInstance();
     $model = new \Model\ProductSettlementPercent();
     $row = $this->getDbTable()->find($id)->current();
     $this->_simpleMap($model, $row);
     $model->product = $em->find("Product", $row['product_id']);
     $model->employeePosition = $em->find("EmployeePosition", $row['employee_position_id']);
     return $model;
 }
Beispiel #26
0
 protected function _doLoad($id)
 {
     $em = EntityManager::getInstance();
     $row = $this->getDbTable()->find($id)->current();
     $employeeAddress = new \Model\EmployeeAddress();
     $this->_simpleMap($employeeAddress, $row);
     $employeeAddress->employee = $em->find("Employee", $row['employee_id']);
     $employeeAddress->state = $em->find("State", $row["state_id"]);
     return $employeeAddress;
 }
Beispiel #27
0
 protected function _doLoad($id)
 {
     $newsGroup = new \Model\NewsGroup();
     $row = $this->getDbTable()->find($id)->current();
     $this->_simpleMap($newsGroup, $row);
     $em = EntityManager::getInstance();
     $newsGroup->news = $em->find("News", $row['news_id']);
     $newsGroup->group = $em->find("EmployeeGroup", $row['employee_group_id']);
     return $newsGroup;
 }
Beispiel #28
0
 protected function _doLoad($id)
 {
     $em = EntityManager::getInstance();
     $model = new \Model\ApplicationSettlement();
     $row = $this->getDbTable()->find($id)->current();
     $this->_simpleMap($model, $row);
     $model->application = $em->find("Application", $row['application_id']);
     $model->configuration = unserialize($model->configuration);
     return $model;
 }
Beispiel #29
0
 protected function _doLoad($id)
 {
     $em = EntityManager::getInstance();
     $model = new \Model\CustomerAddress();
     $row = $this->getDbTable()->find($id)->current();
     $this->_simpleMap($model, $row);
     $model->customer = $em->find("Customer", $row['customer_id']);
     $model->state = $em->find("State", $row['state_id']);
     return $model;
 }
Beispiel #30
0
 protected function _doLoad($id)
 {
     $em = EntityManager::getInstance();
     $model = new \Model\CustomerHistory();
     $row = $this->getDbTable()->find($id)->current();
     $this->_simpleMap($model, $row);
     $model->customer = $em->find("Customer", $row['customer_id']);
     $model->instruction = $em->find("Instruction", $row['instruction_id']);
     return $model;
 }