Exemple #1
0
 /**
  * PartnerForm success event handler
  * @param Form $form
  */
 public function partnerFormSuccessHandle(Form $form)
 {
     $values = $form->getValues();
     try {
         switch ($form->getMode()) {
             case FormMode::CREATE_MODE:
                 $this->createPartnerHandle($values);
                 break;
             case FormMode::UPDATE_MODE:
                 $this->updatePartnerHandle($values);
                 break;
         }
     } catch (Exceptions\DuplicateEntryException $ex) {
         $form->addError("partnersModule.partnerForm.partnerNameAlreadyExist");
     }
 }
Exemple #2
0
 /**
  * PaymentForm onSuccess event handler
  * @param Form $form
  */
 public function paymentFormSubmitHandle(Form $form)
 {
     $values = $form->getValues();
     switch ($form->getMode()) {
         case FormMode::CREATE_MODE:
             //		$oSelId = $values[PaymentForm::PAYMENT_OWNER_TYPE_SELECT_ID];
             //		switch ($oSelId) {
             //		    case PaymentOwnerType::GROUP:
             //			$groupId = $values[PaymentForm::OWNER_TYPE_GROUP];
             //			try {
             //			    $users = $this->getPositionService()->getUsersWithinGroup($groupId);
             //			    $this->createMultiPaymentHandle($values, $users);
             //			} catch (Exceptions\DataErrorException $ex) {
             //			    $this->handleDataLoad(null, "this", $ex);
             //			}
             //			break;
             //		    case PaymentOwnerType::SELECT:
             $ids = $values[PaymentForm::OWNER_TYPE_SELECT];
             $this->createMultiPaymentHandle($values, $ids);
             break;
             //		}
             break;
         case FormMode::UPDATE_MODE:
             $this->updatePaymentHandle($values);
             break;
     }
 }
Exemple #3
0
 public function seasonApplicationFormSubmitHandle(Form $form)
 {
     $values = $form->getValues();
     try {
         switch ($form->getMode()) {
             case FormMode::CREATE_MODE:
                 $users = $values->owner;
                 $values->offsetUnset("owner");
                 foreach ($users as $u) {
                     $values["owner"] = $u;
                     $this->createSeasonApplicationHandle($values);
                 }
                 break;
             case FormMode::UPDATE_MODE:
                 $this->updateSeasonApplicationHandle($values);
                 break;
         }
     } catch (Exceptions\NoResultException $ex) {
         $this->logWarning($ex);
         $form->addError($this->tt("seasonsModule.admin.error.noTaxForSeasonAndGroup"));
     } catch (Exceptions\InvalidStateException $ex) {
         $this->logWarning("SeasonApplicationForm /// " . $ex);
         $form->addError($this->tt("seasonsModule.admin.error.appDeadlineExpired"));
     } catch (Exceptions\DuplicateEntryException $ex) {
         $this->logWarning($ex);
         $form->addError($this->tt("seasonsModule.admin.error.seasonAppUniqueExist"), self::FM_ERROR);
     }
 }
Exemple #4
0
 public function motEntryFormSuccessHandle(Form $form)
 {
     $values = $form->getValues();
     switch ($form->getMode()) {
         case FormMode::CREATE_MODE:
             $ids = $values->offsetGet(MotivationEntryForm::MULTI_OWNER_ID);
             $values->offsetUnset(MotivationEntryForm::MULTI_OWNER_ID);
             $this->createEntry($values, $ids);
             break;
         case FormMode::UPDATE_MODE:
             $this->updateEntry($values);
             break;
     }
 }
Exemple #5
0
 public function searchFormSuccess(Form $form)
 {
     $values = $form->getValues();
     switch ($form->getMode()) {
         case FormMode::CREATE_MODE:
             $this->redirect(":System:Search:default", $values->keyword);
             break;
         case FormMode::UPDATE_MODE:
             break;
     }
 }
Exemple #6
0
 public function forumThreadFormSuccess(Form $form)
 {
     $values = $form->getValues();
     try {
         switch ($form->getMode()) {
             case FormMode::CREATE_MODE:
                 $this->createForumThread($values);
                 break;
             case FormMode::UPDATE_MODE:
                 break;
         }
     } catch (Exceptions\DuplicateEntryException $ex) {
         $form->addError("communicationModule.club.forumThreadAlreadyExist");
     }
 }
Exemple #7
0
 /** 
  * Article form success handler
  * @param Form $form
  */
 public function articleFormSubmitted(Form $form)
 {
     $values = $form->getValues();
     try {
         switch ($form->getMode()) {
             case FormMode::CREATE_MODE:
                 $this->createArticle($values);
                 break;
             case FormMode::UPDATE_MODE:
                 $this->updateArticle($values);
                 break;
         }
     } catch (Exceptions\DuplicateEntryException $ex) {
         $form->addError("articlesModule.admin.articleForm.errors.articleAlreadyExist");
     }
 }
Exemple #8
0
 /**
  * CommentForm onSuccess event handler
  * @param Form $form
  */
 public function commentFormSuccess(Form $form)
 {
     $values = $form->getValues();
     switch ($form->getMode()) {
         case FormMode::CREATE_MODE:
             if ($this->isCommenting()) {
                 $this->presenter->addComment($values);
             }
             break;
         case FormMode::UPDATE_MODE:
             $this->presenter->updateComment($values);
             break;
     }
     if ($this->presenter->isAjax()) {
         unset($this->template->showSimpleForm);
         $this->redrawControl("commentsData");
     }
 }
Exemple #9
0
 public function forumThreadFormSuccess(Form $form)
 {
     $values = $form->getValues();
     try {
         switch ($form->getMode()) {
             case FormMode::CREATE_MODE:
                 $this->createForumThread($values);
                 break;
             case FormMode::UPDATE_MODE:
                 $this->updateForumThread($values);
                 break;
         }
     } catch (Exceptions\DuplicateEntryException $ex) {
         $form->addError("forumModule.admin.forThrForm.errors.forumThrAlreadyExist");
     }
 }