Пример #1
0
 /**
  * @see parent::check()
  */
 function check()
 {
     // Test si la consultation est validée
     if ($msg = $this->checkCoded()) {
         return $msg;
     }
     // Test si on n'a pas d'incompatibilité avec les autres codes
     if ($msg = $this->checkCompat()) {
         return $msg;
     }
     if ($msg = $this->checkEnoughCodes()) {
         // Ajoute le code si besoins à l'objet
         if ($this->_adapt_object || $this->_forwardRefMerging) {
             $this->_ref_object->_codes_ccam[] = $this->code_acte;
             $this->_ref_object->updateDBCodesCCAMField();
             /*if ($this->_forwardRefMerging) {
                 $this->_ref_object->_merging = true;
               }*/
             return $this->_ref_object->store();
         }
         return $msg;
     }
     if ($msg = $this->checkExclusiveModifiers()) {
         return $msg;
     }
     if (CAppUI::conf('dPccam CCodeCCAM use_new_association_rules')) {
         $codage_ccam = CCodageCCAM::get($this->_ref_object, $this->executant_id, $this->code_activite, CMbDT::date(null, $this->execution));
         if (!$codage_ccam->_id) {
             if ($msg = $codage_ccam->store()) {
                 return $msg;
             }
         }
     }
     return parent::check();
     // datetime_execution: attention à rester dans la plage de l'opération
 }
Пример #2
0
 /**
  * @see parent::check()
  */
 function check()
 {
     if ($msg = $this->checkCoded()) {
         return $msg;
     }
     if ($this->code) {
         /* Check if the act exists */
         $ds = CSQLDataSource::get("ccamV2");
         $query = "SELECT *\r\n      FROM `codes_ngap`\r\n      WHERE `code` = ?;";
         $query = $ds->prepare($query, $this->code);
         $res = $ds->loadResult($query);
         if (empty($res)) {
             return 'CActeNGAP-unknown';
         }
         /* Check if the act is deprecated */
         $query = "SELECT COUNT(t.`code`)\r\n      FROM `codes_ngap` as c, `tarif_ngap` as t\r\n      WHERE c.`code` = ? AND t.`code` = c.`code`;";
         $query = $ds->prepare($query, $this->code);
         $res = $ds->loadResult($query);
         if ($res == 0) {
             CAppUI::setMsg('CActeNGAP-deprecated', UI_MSG_WARNING, $this->code);
         }
     }
     return parent::check();
 }