/**
  * Adds default configuration from a configuration by service
  *
  * @param string $path
  * @param string $name
  *
  * @return void
  */
 function addDefaultConfigForGroups($path, $name)
 {
     $config = CConfigService::getConfigGroupForAllGroups($name);
     foreach ($config as $group_id => $value) {
         $query = "INSERT INTO `configuration` (`feature`, `value`, `object_id`, `object_class`)\n        VALUES ('{$path}', '{$value}', '{$group_id}', 'CGroups')";
         $this->addQuery($query);
     }
     $query = "DELETE FROM `config_service` WHERE `name` = '{$name}'";
     $this->addQuery($query);
 }
Example #2
0
 /**
  * @see parent::store()
  */
 function store()
 {
     $is_new = !$this->_id;
     if ($msg = parent::store()) {
         return $msg;
     }
     if ($is_new) {
         CConfigService::emptySHM();
         CConfigMomentUnitaire::emptySHM();
     }
     return null;
 }
 /**
  * @see parent::store()
  */
 function store()
 {
     $is_new = !$this->_id;
     if ($msg = parent::store()) {
         return $msg;
     }
     if ($is_new) {
         CConfiguration::clearDataCache();
         if (CModule::getActive("dPprescription")) {
             CConfigService::emptySHM();
             CConfigMomentUnitaire::emptySHM();
         }
     }
     return null;
 }
 $prescription->type = "sejour";
 $prescription->loadMatchingObject();
 // Chargement de toutes les planifs systemes si celles-ci ne sont pas deja chargées
 $prescription->calculAllPlanifSysteme();
 // Chargement des configs de service
 $sejour->loadRefCurrAffectation($date);
 if (!$sejour->_ref_curr_affectation->_id) {
     $sejour->loadRefsAffectations();
     $sejour->_ref_curr_affectation = $sejour->_ref_last_affectation;
 }
 if ($sejour->_ref_curr_affectation->_id) {
     $service_id = $sejour->_ref_curr_affectation->service_id;
 } else {
     $service_id = "none";
 }
 $configs = CConfigService::getAllFor($service_id);
 if (!$nb_decalage) {
     $nb_decalage = $configs["Nombre postes avant"];
 }
 if (!$without_check_date && !($object_id && $object_class) && !$chapitre) {
     // Si la date actuelle est inférieure a l'heure affichée sur le plan de soins, on affiche le plan de soins de la veille
     $datetime_limit = CMbDT::dateTime($configs["Poste 1"] . ":00:00");
     if (CMbDT::dateTime() < $datetime_limit) {
         $date = CMbDT::date("- 1 DAY");
     } else {
         $date = CMbDT::date();
     }
 }
 $prescription->loadJourOp($date);
 $composition_dossier = array();
 $bornes_composition_dossier = array();