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' => 'user'));
         }
     }
 }
 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);
 }
 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();
             if (null !== ($next = $this->form->getValue('next'))) {
                 $this->redirect($next);
             }
             $this->redirect(array($this->resource, 'module' => 'physicalobject'));
         }
     }
 }
 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);
 }
 public function execute($request)
 {
     parent::execute($request);
     $this->relations = QubitRelation::getRelationsByObjectId($this->resource->id, array('typeId' => QubitTerm::HAS_PHYSICAL_OBJECT_ID));
     if ($request->isMethod('post')) {
         $this->form->bind($request->getPostParameters());
         if ($this->form->isValid()) {
             $this->processForm();
             $this->resource->save();
             $this->redirect(array($this->resource, 'module' => 'informationobject'));
         }
     }
 }
 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);
 }
 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);
 }