Ejemplo n.º 1
0
 public function execute($request)
 {
     parent::execute($request);
     if ($request->isMethod('post')) {
         $this->form->bind($request->getPostParameters());
         if ($this->form->isValid()) {
             $this->processForm();
             $this->resource->save();
             $this->redirect(array($this->resource, 'module' => 'function'));
         }
     }
     QubitDescription::addAssets($this->response);
 }
Ejemplo n.º 2
0
 public function execute($request)
 {
     parent::execute($request);
     if ($request->hasParameter('csvimport')) {
         $this->form->bind($request->getParameterHolder()->getAll());
         if ($this->form->isValid()) {
             $this->processForm();
             $type = $request->getParameter('type');
             if (!empty($type)) {
                 $this->resource->setTypeByName($type);
             }
             $this->resource->save();
             if ($this->request->contact_type || $this->request->contactPerson || $this->request->streetAddress || $this->request->city || $this->request->region || $this->request->countryCode || $this->request->postalCode || $this->request->telephone || $this->request->fax || $this->request->email || $this->request->website) {
                 $contactInformation = new QubitContactInformation();
                 $contactInformation->actor = $this->resource;
                 $contactInformation->contactType = $this->request->contactType;
                 $contactInformation->contactPerson = $this->request->contactPerson;
                 $contactInformation->streetAddress = $this->request->streetAddress;
                 $contactInformation->city = $this->request->city;
                 $contactInformation->region = $this->request->region;
                 $contactInformation->countryCode = $this->request->countryCode;
                 $contactInformation->postalCode = $this->request->postalCode;
                 $contactInformation->telephone = $this->request->telephone;
                 $contactInformation->fax = $this->request->fax;
                 $contactInformation->email = $this->request->email;
                 $contactInformation->website = $this->request->website;
                 $contactInformation->note = $this->request->contactInformationNote;
                 $contactInformation->save();
                 if ($this->request->primaryContact) {
                     $contactInformation->makePrimaryContact();
                 }
             }
         }
     } elseif ($request->isMethod('post')) {
         $this->form->bind($request->getPostParameters());
         if ($this->form->isValid()) {
             $this->contactInformationEditComponent->processForm();
             $this->processForm();
             $this->resource->save();
             $this->redirect(array($this->resource, 'module' => 'repository'));
         }
     }
     QubitDescription::addAssets($this->response);
 }
Ejemplo n.º 3
0
 public function execute($request)
 {
     $this->form = new sfForm();
     $this->form->getValidatorSchema()->setOption('allow_extra_fields', true);
     $this->menu = new QubitMenu();
     if (isset($request->id)) {
         $this->menu = QubitMenu::getById($request->id);
         if (!isset($this->menu)) {
             $this->forward404();
         }
     }
     foreach ($this::$NAMES as $name) {
         $this->addField($name);
     }
     // Handle POST data (form submit)
     if ($request->isMethod('post')) {
         $this->form->bind($request->getPostParameters());
         if ($this->form->isValid()) {
             $this->processForm();
             $this->menu->save();
             // Remove cache
             if ($this->context->getViewCacheManager() !== null) {
                 $this->context->getViewCacheManager()->remove('@sf_cache_partial?module=menu&action=_browseMenu&sf_cache_key=*');
                 $this->context->getViewCacheManager()->remove('@sf_cache_partial?module=menu&action=_mainMenu&sf_cache_key=*');
             }
             $this->redirect(array('module' => 'menu', 'action' => 'list'));
         }
     }
     QubitDescription::addAssets($this->response);
 }
Ejemplo n.º 4
0
 public function execute($request)
 {
     parent::execute($request);
     if ($request->hasParameter('csvimport')) {
         // if a parent ID is set, use that for parenting
         $parentId = $request->getParameter('parent', null);
         if (!empty($parentId)) {
             $request->getParameterHolder()->remove('parent');
         }
         // make sure we don't pass the import ID
         $request->getParameterHolder()->remove('id');
         $this->form->bind($request->getParameterHolder()->getAll());
         if ($this->form->isValid()) {
             $this->processForm();
             if (!empty($parentId)) {
                 $this->resource->parent = QubitInformationObject::getById($parentId);
             } else {
                 $this->resource->parent = QubitInformationObject::getById(QubitInformationObject::ROOT_ID);
             }
             $this->resource->save();
             return;
             // don't bother adding assets etc. for output
         }
     } elseif ($request->isMethod('post')) {
         $this->form->bind($request->getPostParameters());
         if ($this->form->isValid()) {
             $this->processForm();
             $this->resource->save();
             $this->redirect(array($this->resource, 'module' => 'informationobject'));
         }
     }
     QubitDescription::addAssets($this->response);
     QubitImageFlow::addAssets($this->response);
     QubitTreeView::addAssets($this->response);
 }
Ejemplo n.º 5
0
 public function execute($request)
 {
     parent::execute($request);
     if ($request->isMethod('post')) {
         $this->form->bind($request->getPostParameters());
         if ($this->form->isValid()) {
             $this->relatedDonorComponent->processForm();
             $this->rightEditComponent->processForm();
             if (isset($this->request->deleteRelations)) {
                 foreach ($this->request->deleteRelations as $item) {
                     $params = $this->context->routing->parse(Qubit::pathInfo($item));
                     $params['_sf_route']->resource->delete();
                 }
             }
             $this->processForm();
             $this->resource->save();
             $this->redirect(array($this->resource, 'module' => 'accession'));
         }
     }
     QubitDescription::addAssets($this->response);
 }