Ejemplo n.º 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);
 }
Ejemplo n.º 2
0
 public function deleteAction()
 {
     $em = EntityManager::getInstance();
     $model = $em->find("ShipmentType", $this->_getParam("id"));
     $em->delete($model);
     $this->_redirect("/shipment-types");
 }
Ejemplo n.º 3
0
 public function deleteAction()
 {
     $em = EntityManager::getInstance();
     $model = $em->find("Employee", $this->_getParam("id"));
     $em->delete($model);
     $this->_redirect("/employees");
 }
Ejemplo n.º 4
0
 public function deleteAction()
 {
     $em = EntityManager::getInstance();
     $model = $em->find("Recruit", $this->_getParam("id"));
     $em->delete($model);
     $this->_redirect("/recruitment");
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 6
0
 public function deleteAction()
 {
     $em = EntityManager::getInstance();
     $model = $em->find("Training", $this->_getParam("id"));
     $em->delete($model);
     $this->_redirect("/trainings");
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 8
0
 public function deleteAction()
 {
     $em = EntityManager::getInstance();
     $model = $em->find("CustomerStatus", $this->_getParam("id"));
     $em->delete($model);
     $this->_redirect("/customer-statuses");
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 11
0
 public function deleteAction()
 {
     $em = EntityManager::getInstance();
     $model = $em->find("Application", $this->_getParam("id"));
     $em->delete($model);
     $this->_redirect("/applications");
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 13
0
 public function deleteAction()
 {
     $em = EntityManager::getInstance();
     $model = $em->find("Product", $this->_getParam("id"));
     EntityManager::getInstance()->delete($model);
     $this->_redirect("/products");
 }
Ejemplo n.º 14
0
 public function deleteAction()
 {
     $em = EntityManager::getInstance();
     $model = $em->find("CustomerCredit", $this->_getParam("id"));
     $em->delete($model);
     $this->getHelper("formAction")->simpleEndAction();
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 17
0
 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 25
0
 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }