Example #1
0
 public function executeEdit(sfWebRequest $request)
 {
     if ($login = $request->getParameter("login")) {
         try {
             $ginger = new \Ginger\Client\GingerClient(sfConfig::get('app_portail_ginger_key'));
             $this->cotisant = $ginger->getUser($login);
             $this->cotisations = $ginger->getCotisations($login);
         } catch (\Ginger\Client\ApiException $ex) {
             if ($ex->getCode() == 404) {
                 $this->error = "Utilisateur non trouvé";
             } else {
                 $this->error = $ex->getCode() . " - " . $ex->getMessage();
             }
         }
         $this->formcotisation = new CotisantsCotiserForm();
         $this->formcotisation->setDefault('login', $login);
         if ($this->cotisant->is_cotisant) {
             $this->cotisant->is_cotisant_texte = "Oui";
             // On retire le champ montant
             $this->formcotisation->hideMontant();
         } else {
             $this->cotisant->is_cotisant_texte = "Non";
         }
     }
 }