示例#1
0
 /**
  * constructor
  *
  * @param string      $guid           guid
  * @param string      $date           [day h:m:s]
  * @param int         $length         length of the event (minutes)
  * @param string      $title          title displayed of the event
  * @param null        $color          background color of the event
  * @param bool        $important      is the event important
  * @param null|string $css_class      css class
  * @param null        $draggable_guid is the guid dragable
  * @param bool        $html_escape    do I escape the html from title
  */
 function __construct($guid, $date, $length = 0, $title = "", $color = null, $important = true, $css_class = null, $draggable_guid = null, $html_escape = true)
 {
     $this->guid = $guid;
     $this->draggable_guid = $draggable_guid;
     $this->internal_id = "CPlanningEvent-" . md5(uniqid(null, true));
     $this->start = $date;
     $this->length = $length;
     $this->title = $html_escape ? CMbString::htmlEntities($title) : $title;
     $this->color = $color;
     $this->important = $important;
     $this->css_class = is_array($css_class) ? implode(" ", $css_class) : $css_class;
     $this->mb_object = array("id" => "", "guid" => "", "view" => "");
     if (preg_match("/[0-9]+ /", $this->start)) {
         $parts = explode(" ", $this->start);
         $this->end = "{$parts[0]} " . CMbDT::time("+{$this->length} MINUTES", $parts[1]);
         $this->day = $parts[0];
         $this->hour = CMbDT::format($parts[1], "%H");
         $this->minutes = CMbDT::format($parts[1], "%M");
     } else {
         $this->day = CMbDT::date($date);
         $this->end = CMbDT::dateTime("+{$this->length} MINUTES", $date);
         $this->hour = CMbDT::format($date, "%H");
         $this->minutes = CMbDT::format($date, "%M");
     }
 }
 /**
  * Range constructor
  *
  * @param string $guid      GUID
  * @param string $date      Date
  * @param int    $length    Length
  * @param string $title     Title
  * @param null   $color     Color
  * @param null   $css_class CSS class
  */
 function __construct($guid, $date, $length = 0, $title = "", $color = null, $css_class = null)
 {
     $this->guid = $guid;
     $this->internal_id = "CPlanningRange-" . uniqid();
     $this->start = $date;
     $this->length = $length;
     $this->title = CMbString::htmlEntities($title);
     $this->color = $color;
     $this->css_class = is_array($css_class) ? implode(" ", $css_class) : $css_class;
     if (preg_match("/[0-9]+ /", $this->start)) {
         $parts = split(" ", $this->start);
         $this->end = "{$parts[0]} " . CMbDT::time("+{$this->length} MINUTES", $parts[1]);
         $this->day = $parts[0];
         $this->hour = CMbDT::format($parts[1], "%H");
         $this->minutes = CMbDT::format($parts[1], "%M");
     } else {
         $this->day = CMbDT::date($date);
         $this->end = CMbDT::dateTime("+{$this->length} MINUTES", $date);
         $this->hour = CMbDT::format($date, "%H");
         $this->minutes = CMbDT::format($date, "%M");
     }
 }
示例#3
0
    $where_conge["user_id"] = " = '{$chirSel}' ";
    /** @var CPlageConge[] $conges */
    $conges = $conge->loadList($where_conge);
    foreach ($conges as $_conge) {
        $_dates = array();
        $_dates[] = $_conge->date_debut;
        $_date = $_conge->date_debut;
        if ($_conge->date_debut != $_conge->date_fin) {
            while ($_date != $_conge->date_fin) {
                $_date = CMbDT::date("+1 DAY", $_date);
                $_dates[] = $_date;
            }
        }
        $libelle = '<h3 style="text-align: center">
    CONGES</h3>
    <p style="text-align: center">' . CMbString::htmlEntities($_conge->libelle) . '</p>';
        foreach ($_dates as $_date) {
            $event = new CPlanningEvent($_conge->_guid . $_date, $_date, 1430, $libelle, "#ddd", true, "hatching", null, false);
            $event->below = 1;
            $planning->addEvent($event);
        }
    }
}
//Operation hors plage
$operation = new COperation();
$where = array();
for ($i = 0; $i < 7; $i++) {
    $date = CMbDT::date("+{$i} day", $debut);
    $where["date"] = "= '{$date}'";
    $where["annulee"] = " = '0'";
    $where["plageop_id"] = " IS NULL";
        $_plage->loadRefSpec();
        $_plage->loadRefAnesth()->loadRefFunction();
        $debut = "{$i} " . CMbDT::time($_plage->debut);
        $duree = CMbDT::minutesRelative(CMbDT::time($_plage->debut), CMbDT::time($_plage->fin));
        //fetch
        $smarty = new CSmartyDP("modules/reservation");
        $smarty->assign("plageop", $_plage);
        $smarty_plageop = $smarty->fetch("inc_planning/libelle_plageop.tpl");
        $smarty_plageop = htmlspecialchars_decode(CMbString::htmlEntities($smarty_plageop, ENT_NOQUOTES), ENT_NOQUOTES);
        $event = new CPlanningEvent($_plage->_guid, $debut, $duree, $smarty_plageop, "#efbf99", true, null, $_plage->_guid, false);
        $event->below = true;
        $event->type = "plage_planning";
        $event->plage["id"] = $_plage->_id;
        if ($can_edit) {
            $event->addMenuItem("edit", CMbString::htmlEntities("Modifier cette plage"));
            $event->addMenuItem("list", CMbString::htmlEntities("Gestion des interventions"));
        }
        $planning->addEvent($event);
    }
}
$m = $save_m;
$planning->rearrange(true);
//ReArrange the planning
$bank_holidays = CMbDate::getHolidays($date_planning);
$smarty = new CSmartyDP();
$smarty->assign("planning", $planning);
$smarty->assign("salles", $salles);
$smarty->assign("salles_ids", $salles_ids);
$smarty->assign("date_planning", $date_planning);
$smarty->assign("scroll_top", $scroll_top);
$smarty->assign("show_cancelled", $show_cancelled);
         }
         $event = new CPlanningEvent($_consult->_guid, $debute, $_consult->duree * $_plage->_freq, $_consult->_ref_patient->_view, $color, true, null, null);
     } else {
         $color = "#faa";
         $motif = $_consult->motif ? $_consult->motif : "[PAUSE]";
         $event = new CPlanningEvent($_consult->_guid, $debute, $_consult->duree * $_plage->_freq, $motif, $color, true, null, null);
     }
     $event->type = "rdvfull";
     $event->plage["id"] = $_plage->_id;
     if ($_plage->locked == 1) {
         $event->disabled = true;
     }
     $_consult->loadRefCategorie();
     if ($_consult->categorie_id) {
         $event->icon = "./modules/dPcabinet/images/categories/" . basename($_consult->_ref_categorie->nom_icone);
         $event->icon_desc = CMbString::htmlEntities($_consult->_ref_categorie->nom_categorie);
     }
     //Ajout de l'évènement au planning
     $event->plage["color"] = $_plage->color;
     $planning->addEvent($event);
 }
 $color = "#cfc";
 if ($_plage->remplacant_id && $_plage->remplacant_id != $chir_id) {
     $color = "#FAA";
 }
 if ($_plage->remplacant_id && $_plage->remplacant_id == $chir_id) {
     $color = "#FDA";
 }
 $utilisation = $_plage->getUtilisation();
 foreach ($utilisation as $_timing => $_nb) {
     if (!$_nb) {
 /**
  * Returns an HTML tag
  * 
  * @param string  $tagName    The tag name
  * @param array   $attributes [optional]
  * @param string  $content    [optional]
  * @param boolean $short      [optional]
  * 
  * @return string The HTML source code
  */
 static function getTag($tagName, $attributes = array(), $content = "", $short = true)
 {
     $tag = "<{$tagName}";
     foreach ($attributes as $key => $value) {
         $tag .= " {$key}=\"" . CMbString::htmlEntities($value) . '"';
     }
     if ($content != "") {
         $tag .= ">{$content}</{$tagName}>";
     } else {
         if ($short) {
             $tag .= " />";
         } else {
             $tag .= "></{$tagName}>";
         }
     }
     return $tag;
 }
 /**
  * Get an HTML title label element corresponding to the bound object value
  *
  * @param object $object Object holding the field
  * @param array  $params Extra parameters
  * 
  * @return html HTML title string
  */
 function getTitleElement($object, $params)
 {
     $desc = CAppUI::tr("{$object->_class}-{$this->fieldName}-desc");
     $desc = CMbString::htmlEntities($desc);
     $title = CAppUI::tr("{$object->_class}-{$this->fieldName}-court");
     return "<label title=\"{$desc}\" >{$title}</label>";
 }
示例#8
0
 function fillLimitedTemplate(&$template)
 {
     CDestinataire::makeAllFor($this);
     $destinataires = CDestinataire::$destByClass;
     foreach ($destinataires as $_destinataires_by_class) {
         foreach ($_destinataires_by_class as $_destinataire) {
             if (!isset($_destinataire->nom) || strlen($_destinataire->nom) == 0 || $_destinataire->nom === " ") {
                 continue;
             }
             $template->destinataires[] = array("nom" => $_destinataire->nom, "email" => $_destinataire->email, "tag" => $_destinataire->tag);
         }
     }
     $this->loadRefsFwd();
     $this->loadRefLatestConstantes(null, array(), null, false);
     $this->loadIPP();
     $this->loadLastINS();
     $this->notify("BeforeFillLimitedTemplate", $template);
     $template->addProperty("Patient - article", $this->_civilite);
     $template->addProperty("Patient - article long", ucfirst($this->_civilite_long));
     $template->addProperty("Patient - article long (minuscule)", strtolower($this->_civilite_long));
     $template->addProperty("Patient - nom", $this->nom);
     $template->addProperty("Patient - nom jeune fille", $this->nom_jeune_fille);
     $template->addProperty("Patient - prénom", $this->prenom);
     $template->addProperty("Patient - adresse", $this->adresse);
     $template->addProperty("Patient - ville", $this->ville);
     $template->addProperty("Patient - cp", $this->cp);
     $template->addProperty("Patient - années", $this->_annees);
     $template->addProperty("Patient - âge", $this->_age);
     $template->addProperty("Patient - date de naissance", $this->getFormattedValue("naissance"));
     $template->addProperty("Patient - lieu de naissance", $this->lieu_naissance);
     $template->addProperty("Patient - sexe", strtolower($this->getFormattedValue("sexe")));
     $template->addProperty("Patient - sexe court", substr(strtolower($this->getFormattedValue("sexe")), 0, 1));
     $template->addProperty("Patient - numéro d'assuré", $this->getFormattedValue("matricule"));
     $template->addProperty("Patient - téléphone", $this->getFormattedValue("tel"));
     $template->addProperty("Patient - mobile", $this->getFormattedValue("tel2"));
     $template->addProperty("Patient - téléphone autre", $this->tel_autre);
     $template->addProperty("Patient - profession", $this->profession);
     $template->addProperty("Patient - IPP", $this->_IPP);
     $template->addProperty("Patient - Qualité bénéficiaire", $this->qual_beneficiaire);
     $this->guessExoneration();
     $template->addProperty("Patient - Qualité bénéficiaire - Libellé", $this->libelle_exo);
     $template->addProperty("Patient - Numéro de sécurité sociale", $this->getFormattedValue("matricule"));
     $template->addBarcode("Patient - Code barre ID", $this->_id);
     $template->addBarcode("Patient - Code barre IPP", $this->_IPP);
     $template->addBarcode("Patient - Code barre INS", $this->_ref_last_ins ? $this->_ref_last_ins->ins : "");
     if ($this->sexe === "m") {
         $template->addProperty("Patient - il/elle", "il");
         $template->addProperty("Patient - Il/Elle (majuscule)", "Il");
         $template->addProperty("Patient - le/la", "le");
         $template->addProperty("Patient - Le/La (majuscule)", "Le");
         $template->addProperty("Patient - du/de la", "du");
         $template->addProperty("Patient - au/à la", "au");
         $template->addProperty("Patient - accord genre", "");
     } else {
         $template->addProperty("Patient - il/elle", "elle");
         $template->addProperty("Patient - Il/Elle (majuscule)", "Elle");
         $template->addProperty("Patient - le/la", "la");
         $template->addProperty("Patient - Le/La (majuscule)", "La");
         $template->addProperty("Patient - du/de la", "de la");
         $template->addProperty("Patient - au/à la", "à la");
         $template->addProperty("Patient - accord genre", "e");
     }
     $medecin = $this->_ref_medecin_traitant->_id ? $this->_ref_medecin_traitant : new CMedecin();
     $template->addProperty("Patient - médecin traitant", "{$medecin->nom} {$medecin->prenom}");
     $template->addProperty("Patient - médecin traitant - Nom Prénom", "{$medecin->nom} {$medecin->prenom}");
     $template->addProperty("Patient - médecin traitant - nom", $medecin->nom);
     $template->addProperty("Patient - médecin traitant - prenom", $medecin->prenom);
     $template->addProperty("Patient - médecin traitant - adresse", "{$medecin->adresse} \n {$medecin->cp} {$medecin->ville}");
     $template->addProperty("Patient - médecin traitant - voie", $medecin->adresse);
     $template->addProperty("Patient - médecin traitant - cp", $medecin->cp);
     $template->addProperty("Patient - médecin traitant - ville", $medecin->ville);
     $template->addProperty("Patient - médecin traitant - confraternité", $medecin->_confraternite);
     $template->addProperty("Patient - médecin traitant - tel", $medecin->getFormattedValue("tel"));
     $template->addProperty("Patient - médecin traitant - fax", $medecin->getFormattedValue("fax"));
     if ($medecin->sexe == "f") {
         $template->addProperty("Patient - médecin traitant - accord genre", "e");
         $template->addProperty("Patient - médecin traitant - article long", "Mme le docteur");
     } elseif ($medecin->sexe == "m") {
         $template->addProperty("Patient - médecin traitant - accord genre", "");
         $template->addProperty("Patient - médecin traitant - article long", "Mr le docteur");
     } else {
         $template->addProperty("Patient - médecin traitant - accord genre", "");
         $template->addProperty("Patient - médecin traitant - article long", "le docteur");
     }
     // Employeur
     $this->loadRefsCorrespondantsPatient();
     $correspondants = $this->_ref_cp_by_relation;
     foreach ($correspondants as $relation => $_correspondants) {
         $_correspondant = @reset($_correspondants);
         // Dans le cas d'un modèle, création d'un correspondant pour chaque type de relation
         if (!count($_correspondants)) {
             $_correspondant = new CCorrespondantPatient();
             $_correspondant->relation = $relation;
         }
         switch ($_correspondant->relation) {
             case "employeur":
                 $template->addProperty("Patient - employeur - nom", $_correspondant->nom);
                 $template->addProperty("Patient - employeur - adresse", $_correspondant->adresse);
                 $template->addProperty("Patient - employeur - cp", $_correspondant->cp);
                 $template->addProperty("Patient - employeur - ville", $_correspondant->ville);
                 $template->addProperty("Patient - employeur - tel", $_correspondant->getFormattedValue("tel"));
                 $template->addProperty("Patient - employeur - mobile", $_correspondant->getFormattedValue("mob"));
                 $template->addProperty("Patient - employeur - urssaf", $_correspondant->urssaf);
                 break;
             case "prevenir":
                 $template->addProperty("Patient - prévenir - nom", $_correspondant->nom);
                 $template->addProperty("Patient - prévenir - prénom", $_correspondant->prenom);
                 $template->addProperty("Patient - prévenir - adresse", $_correspondant->adresse);
                 $template->addProperty("Patient - prévenir - cp", $_correspondant->cp);
                 $template->addProperty("Patient - prévenir - ville", $_correspondant->ville);
                 $template->addProperty("Patient - prévenir - tel", $_correspondant->getFormattedValue("tel"));
                 $template->addProperty("Patient - prévenir - mobile", $_correspondant->getFormattedValue("mob"));
                 $template->addProperty("Patient - prévenir - parente", $_correspondant->parente);
                 break;
             case "confiance":
                 $template->addProperty("Patient - confiance - nom", $_correspondant->nom);
                 $template->addProperty("Patient - confiance - nom de jeune fille", $_correspondant->nom_jeune_fille);
                 $template->addProperty("Patient - confiance - prénom", $_correspondant->prenom);
                 $template->addProperty("Patient - confiance - date de naissance", $_correspondant->getFormattedValue("naissance"));
                 $template->addProperty("Patient - confiance - adresse", $_correspondant->adresse);
                 $template->addProperty("Patient - confiance - cp", $_correspondant->cp);
                 $template->addProperty("Patient - confiance - ville", $_correspondant->ville);
                 $template->addProperty("Patient - confiance - tel", $_correspondant->getFormattedValue("tel"));
                 $template->addProperty("Patient - confiance - mobile", $_correspondant->getFormattedValue("mob"));
                 $template->addProperty("Patient - confiance - parente", $_correspondant->parente);
         }
     }
     // Vider les anciens holders
     for ($i = 1; $i < 4; $i++) {
         $template->addProperty("Patient - médecin correspondant {$i}");
         $template->addProperty("Patient - médecin correspondant {$i} - adresse");
         $template->addProperty("Patient - médecin correspondant {$i} - spécialité");
     }
     $this->loadRefsCorrespondants();
     $i = 0;
     $noms = array();
     foreach ($this->_ref_medecins_correspondants as $corresp) {
         $i++;
         $corresp->loadRefsFwd();
         $medecin = $corresp->_ref_medecin;
         $nom = "{$medecin->nom} {$medecin->prenom}";
         $noms[] = $nom;
         $template->addProperty("Patient - médecin correspondant {$i}", $nom);
         $template->addProperty("Patient - médecin correspondant {$i} - adresse", "{$medecin->adresse}\n{$medecin->cp} {$medecin->ville}");
         $template->addProperty("Patient - médecin correspondant {$i} - spécialité", CMbString::htmlEntities($medecin->disciplines));
     }
     $template->addProperty("Patient - médecins correspondants", implode(" - ", $noms));
     //Liste des séjours du patient
     $this->loadRefsSejours();
     if (is_array($this->_ref_sejours)) {
         foreach ($this->_ref_sejours as $_sejour) {
             $_sejour->loadRefPraticien();
         }
         $smarty = new CSmartyDP("modules/dPpatients");
         $smarty->assign("sejours", $this->_ref_sejours);
         $sejours = $smarty->fetch("print_closed_sejours.tpl", '', '', 0);
         $sejours = preg_replace('`([\\n\\r])`', '', $sejours);
     } else {
         $sejours = CAppUI::tr("CSejour.none");
     }
     $template->addProperty("Patient - liste des séjours", $sejours, '', false);
     $const_med = $this->_ref_constantes_medicales;
     $const_dates = $this->_latest_constantes_dates;
     $grid_complet = CConstantesMedicales::buildGridLatest($const_med, $const_dates, true);
     $grid_minimal = CConstantesMedicales::buildGridLatest($const_med, $const_dates, false);
     $grid_valued = CConstantesMedicales::buildGridLatest($const_med, $const_dates, false, true);
     $smarty = new CSmartyDP("modules/dPpatients");
     // Horizontal
     $smarty->assign("constantes_medicales_grid", $grid_complet);
     $constantes_complet_horiz = $smarty->fetch("print_constantes.tpl", '', '', 0);
     $constantes_complet_horiz = preg_replace('`([\\n\\r])`', '', $constantes_complet_horiz);
     $smarty->assign("constantes_medicales_grid", $grid_minimal);
     $constantes_minimal_horiz = $smarty->fetch("print_constantes.tpl", '', '', 0);
     $constantes_minimal_horiz = preg_replace('`([\\n\\r])`', '', $constantes_minimal_horiz);
     $smarty->assign("constantes_medicales_grid", $grid_valued);
     $constantes_valued_horiz = $smarty->fetch("print_constantes.tpl", '', '', 0);
     $constantes_valued_horiz = preg_replace('`([\\n\\r])`', '', $constantes_valued_horiz);
     // Vertical
     $smarty->assign("constantes_medicales_grid", $grid_complet);
     $constantes_complet_vert = $smarty->fetch("print_constantes_vert.tpl", '', '', 0);
     $constantes_complet_vert = preg_replace('`([\\n\\r])`', '', $constantes_complet_vert);
     $smarty->assign("constantes_medicales_grid", $grid_minimal);
     $constantes_minimal_vert = $smarty->fetch("print_constantes_vert.tpl", '', '', 0);
     $constantes_minimal_vert = preg_replace('`([\\n\\r])`', '', $constantes_minimal_vert);
     $smarty->assign("constantes_medicales_grid", $grid_valued);
     $constantes_valued_vert = $smarty->fetch("print_constantes_vert.tpl", '', '', 0);
     $constantes_valued_vert = preg_replace('`([\\n\\r])`', '', $constantes_valued_vert);
     // Liste des fichiers
     $this->loadRefsFiles();
     $list = CMbArray::pluck($this->_ref_files, "file_name");
     $template->addListProperty("Patient - Liste des fichiers", $list);
     // Identité
     $identite = $this->loadNamedFile("identite.jpg");
     $template->addImageProperty("Patient - Photo d'identite", $identite->_id);
     $template->addProperty("Patient - Constantes - mode complet horizontal", $constantes_complet_horiz, '', false);
     $template->addProperty("Patient - Constantes - mode minimal horizontal", $constantes_minimal_horiz, '', false);
     $template->addProperty("Patient - Constantes - mode avec valeurs horizontal", $constantes_valued_horiz, '', false);
     $template->addProperty("Patient - Constantes - mode complet vertical", $constantes_complet_vert, '', false);
     $template->addProperty("Patient - Constantes - mode minimal vertical", $constantes_minimal_vert, '', false);
     $template->addProperty("Patient - Constantes - mode avec valeurs vertical", $constantes_valued_vert, '', false);
     $template->addProperty("Patient - poids", "{$const_med->poids} kg");
     $template->addProperty("Patient - taille", "{$const_med->taille} cm");
     $template->addProperty("Patient - Pouls", $const_med->pouls);
     $template->addProperty("Patient - IMC", $const_med->_imc);
     $template->addProperty("Patient - VST", $const_med->_vst);
     $template->addProperty("Patient - température", $const_med->temperature . "°");
     $template->addProperty("Patient - TA", $const_med->ta ? "{$const_med->_ta_systole} / {$const_med->_ta_diastole}" : "");
     $template->addProperty("Patient - Saturation (spo2)", $const_med->spo2);
     // Assuré social
     $template->addProperty("Patient - Assuré social - nom", $this->assure_nom);
     $template->addProperty("Patient - Assuré social - nom jeune fille", $this->assure_nom_jeune_fille);
     $template->addProperty("Patient - Assuré social - prénom", $this->assure_prenom);
     $template->addProperty("Patient - Assuré social - date de naissance", $this->getFormattedValue("assure_naissance"));
     $template->addProperty("Patient - Assuré social - article", $this->_assure_civilite);
     $template->addProperty("Patient - Assuré social - article long", $this->_assure_civilite_long);
     $template->addProperty("Patient - Assuré social - adresse", $this->assure_adresse);
     $template->addProperty("Patient - Assuré social - ville", $this->assure_ville);
     $template->addProperty("Patient - Assuré social - cp", $this->assure_cp);
     $template->addProperty("Patient - Assuré social - pays", $this->assure_pays);
     $template->addProperty("Patient - Assuré social - téléphone", $this->assure_tel);
     $template->addProperty("Patient - Assuré social - mobile", $this->assure_tel2);
     $template->addProperty("Patient - Assuré social - cp naissance", $this->assure_cp_naissance);
     $template->addProperty("Patient - Assuré social - lieu de naissance", $this->assure_lieu_naissance);
     $template->addProperty("Patient - Assuré social - profession", $this->assure_profession);
     // Bénéficiaire de soins
     $template->addProperty("Patient - Bénéficiaire de soin - code régime", $this->code_regime);
     $template->addProperty("Patient - Bénéficiaire de soin - caisse gest", $this->caisse_gest);
     $template->addProperty("Patient - Bénéficiaire de soin - centre gest", $this->centre_gest);
     $template->addProperty("Patient - Bénéficiaire de soin - code gest", $this->code_gestion);
     $template->addProperty("Patient - Bénéficiaire de soin - régime santé", $this->regime_sante);
     $template->addDateProperty("Patient - Bénéficiaire de soin - début période", $this->deb_amo);
     $template->addDateProperty("Patient - Bénéficiaire de soin - fin période", $this->fin_amo);
     $template->addProperty("Patient - Bénéficiaire de soin - régime am", $this->getFormattedValue("regime_am"));
     $template->addProperty("Patient - Bénéficiaire de soin - ald", $this->getFormattedValue("ald"));
     $template->addProperty("Patient - Bénéficiaire de soin - incapable majeur", $this->getFormattedValue("incapable_majeur"));
     $template->addProperty("Patient - Bénéficiaire de soin - cmu", $this->getFormattedValue("cmu"));
     $template->addProperty("Patient - Bénéficiaire de soin - ATNC", $this->getFormattedValue("ATNC"));
     $template->addDateProperty("Patient - Bénéficiaire de soin - validité vitale", $this->fin_validite_vitale);
     $template->addProperty("Patient - Bénéficiaire de soin - médecin traitant déclaré", $this->getFormattedValue("medecin_traitant_declare"));
     $template->addProperty("Patient - Bénéficiaire de soin - types contrat mutuelle", addslashes($this->mutuelle_types_contrat));
     $template->addProperty("Patient - Bénéficiaire de soin - notes amo", addslashes($this->notes_amo));
     $template->addProperty("Patient - Bénéficiaire de soin - libellé exo", addslashes($this->libelle_exo));
     $template->addProperty("Patient - Bénéficiaire de soin - notes amc", addslashes($this->notes_amc));
     if (CModule::getActive("maternite")) {
         $allaitement = $this->loadLastAllaitement();
         $template->addDateProperty("Patient - Allaitement - Début", $allaitement->date_debut);
         $template->addDateProperty("Patient - Allaitement - Fin", $allaitement->date_fin);
         $grossesse = $this->loadLastGrossesse();
         $template->addDateProperty("Patient - Grossesse - Terme prévu", $grossesse->terme_prevu);
         $template->addDateProperty("Patient - Grossesse - Date des dernières règles", $grossesse->date_dernieres_regles);
         $template->addProperty("Patient - Grossesse - En cours", $grossesse->getFormattedValue("active"));
         $template->addProperty("Patient - Grossesse - Multiple", $grossesse->getFormattedValue("multiple"));
         $template->addProperty("Patient - Grossesse - Allaitement maternel", $grossesse->getFormattedValue("allaitement_maternel"));
         $template->addProperty("Patient - Grossesse - Fausse couche", $grossesse->getFormattedValue('fausse_couche'), null, false);
         $template->addProperty("Patient - Grossesse - Lieu d'accouchement", $grossesse->getFormattedValue("lieu_accouchement"));
         $template->addProperty("Patient - Grossesse - Remarques", $grossesse->rques);
     }
     if (CModule::getActive("forms")) {
         CExObject::addFormsToTemplate($template, $this, "Patient");
     }
     $this->notify("AfterFillLimitedTemplate", $template);
 }
                $event->icon_desc = CMbString::htmlEntities($_consult->_ref_categorie->nom_categorie);
            }
            if ($_consult->_id) {
                $event->draggable = $can_edit;
                $freq = $_plage->freq ? CMbDT::transform($_plage->freq, null, "%M") : 1;
                $event->hour_divider = 60 / $freq;
                if ($can_edit) {
                    $event->addMenuItem("copy", "Copier cette consultation");
                    $event->addMenuItem("cut", "Couper cette consultation");
                    if ($_consult->patient_id) {
                        $event->addMenuItem("add", "Ajouter une consultation");
                        if ($_consult->chrono == CConsultation::PLANIFIE) {
                            $event->addMenuItem("tick", CMbString::htmlEntities("Notifier l'arrivée"));
                        }
                        if ($_consult->chrono == CConsultation::PATIENT_ARRIVE) {
                            $event->addMenuItem("tick_cancel", CMbString::htmlEntities("Annuler l'arrivée"));
                        }
                    }
                }
            }
            //Ajout de l'évènement au planning
            $event->plage["color"] = $_plage->color;
            $event->below = 0;
            $planning->addEvent($event);
        }
    }
}
$planning->hour_min = $min_hour;
// conges
foreach ($conges_day as $key => $_day) {
    $conges_day[$key] = implode(", ", $_day);
 /**
  * Truncate a string, with a full string titled span if actually truncated
  * Example:  {$value|spancate}
  *
  * @param string $string      The string to truncate
  * @param int    $length      The maximum string length
  * @param string $etc         The ellipsis
  * @param bool   $break_words Break words
  * @param bool   $middle      Put the ellipsis at the middle of the string instead of at the end
  *
  * @return string
  */
 function spancate($string, $length = 80, $etc = '...', $break_words = true, $middle = false)
 {
     CAppUI::requireLibraryFile("smarty/libs/plugins/modifier.truncate");
     $string = html_entity_decode($string);
     $truncated = smarty_modifier_truncate($string, $length, $etc, $break_words, $middle);
     $truncated = CMbString::nl2bull($truncated);
     $string = CMbString::htmlEntities($string);
     return strlen($string) > $length ? "<span title=\"{$string}\">{$truncated}</span>" : $truncated;
 }
示例#11
0
 /**
  * Add message to the the system UI from Ajax call
  *
  * @param string $msg  The internationalized message
  * @param int    $type [optional] Message type as a UI constant
  * @param mixed  $_    [optional] Any number of printf-like parameters to be applied
  *
  * @return void
  * @todo rename to addAjaxMsg()
  */
 static function displayAjaxMsg($msg, $type = UI_MSG_OK, $_ = null)
 {
     $args = func_get_args();
     $msg = CAppUI::tr($msg, array_slice($args, 2));
     $msg = CMbString::htmlEntities($msg);
     $class = self::getErrorClass($type);
     self::callbackAjax('$("systemMsg").show().insert', "<div class='{$class}'>{$msg}</div>");
 }
示例#12
0
 /**
  * private function trimAccent
  * remove every special French letters
  *
  * @return void
  */
 private function trimAccent()
 {
     $this->sString = CMbString::htmlEntities(strtolower($this->sString));
     $this->sString = preg_replace("/&(.)(acute|cedil|circ|ring|tilde|uml|grave);/", "\$1", $this->sString);
     $this->sString = preg_replace("/([^a-z0-9]+)/", "-", html_entity_decode($this->sString));
     $this->sString = trim($this->sString, "-");
 }
     $msg_segment_group = $exchange->getMessage();
     if ($msg_segment_group) {
         $doc = $msg_segment_group->toXML();
         if (count($msg_segment_group->children) > $limit_size) {
             $doc->formatOutput = true;
             $msg_segment_group->_xml = "<pre>" . CMbString::htmlEntities($doc->saveXML()) . "</pre>";
         } else {
             $msg_segment_group->_xml = CMbString::highlightCode("xml", $doc->saveXML());
         }
     }
     $ack_segment_group = $exchange->getACK();
     if ($ack_segment_group) {
         $doc = $ack_segment_group->toXML();
         if (count($ack_segment_group->children) > $limit_size) {
             $doc->formatOutput = true;
             $ack_segment_group->_xml = "<pre>" . CMbString::htmlEntities($doc->saveXML()) . "</pre>";
         } else {
             $ack_segment_group->_xml = CMbString::highlightCode("xml", $doc->saveXML());
         }
     }
     $smarty->assign("msg_segment_group", $msg_segment_group);
     $smarty->assign("ack_segment_group", $ack_segment_group);
     $smarty->assign("limit_size", $limit_size);
     $smarty->display("inc_exchange_tabular_details.tpl");
     break;
 case $exchange instanceof CEchangeXML:
     $smarty->display("inc_exchange_xml_details.tpl");
     break;
 case $exchange instanceof CExchangeDicom:
     $exchange->decodeContent();
     $smarty->display("inc_exchange_dicom_details.tpl");
 function __toString()
 {
     $field = $this->getField();
     if ($this->getProps() instanceof CHL7v2DataTypeComposite) {
         $sep = $this->separator[0];
         if (CHL7v2Message::$decorateToString) {
             $sep = "<span class='{$this->separator[2]}'>{$sep}</span>";
         }
         $str = implode($sep, $this->children);
     } else {
         if ($field->keep()) {
             $str = $this->data;
         } else {
             $str = $this->getMessage()->escape($this->data);
         }
         if (CHL7v2Message::$decorateToString) {
             $str = CMbString::htmlEntities($str);
         }
     }
     if (CHL7v2Message::$decorateToString) {
         $title = $field->owner_segment->name . "." . $this->getPathString(".") . " - {$this->datatype} - {$this->description}";
         if ($this->table != 0) {
             $value_description = $this->value_description ? $this->value_description : "?";
             $title .= " [{$this->table} => {$value_description}]";
         }
         $title = CMbString::htmlEntities($title);
         $xpath = $this->getSegment()->name . "/" . $this->getPathString("/", ".", true);
         $invalid = $this->invalid ? 'invalid' : '';
         $table = $this->table != 0 ? 'table-entry' : '';
         $str = "<span class='entity {$this->separator[1]} {$invalid} {$table}' id='entity-er7-{$this->id}'\n                    data-title='{$title}' data-xpath='{$xpath}'>{$str}</span>";
     }
     return $str;
 }
function delNoScalar(&$aObjects)
{
    foreach ($aObjects as $keyObject => &$object) {
        if (!is_object($object)) {
            continue;
        }
        foreach (get_object_vars($object) as $keyVar => $value) {
            if ((!is_scalar($value) || $value === null) && $keyVar[0] == "_") {
                unset($object->{$keyVar});
            } else {
                $object->{$keyVar} = CMbString::htmlEntities($value);
            }
        }
    }
}
示例#16
0
     $headerfooter = substr($_POST["_source"], 0, $posBody);
     $index_div = strrpos($_POST["_source"], "</div>") - ($posBody + strlen($bodyTag));
     $body = substr($_POST["_source"], $posBody + strlen($bodyTag), $index_div);
 } else {
     $headerfooter = "";
     $body = $_POST["_source"];
 }
 // On fait le doBind avant le foreach si la config est à 1.
 if (CAppUI::conf("dPcompteRendu CCompteRendu multiple_doc_correspondants")) {
     $do->doBind();
 }
 $allSources = array();
 $modele_base = clone $do->_obj;
 $source_base = $body;
 foreach ($destinataires as &$curr_dest) {
     $fields = array(CMbString::htmlEntities("[Courrier - Formule de politesse - Début]"), CMbString::htmlEntities("[Courrier - Formule de politesse - Fin]"), CMbString::htmlEntities("[Courrier - nom destinataire]"), CMbString::htmlEntities("[Courrier - adresse destinataire]"), CMbString::htmlEntities("[Courrier - cp ville destinataire]"), CMbString::htmlEntities("[Courrier - confraternite]"), CMbString::htmlEntities("[Courrier - copie à - simple]"), CMbString::htmlEntities("[Courrier - copie à - simple (multiligne)]"), CMbString::htmlEntities("[Courrier - copie à - complet]"), CMbString::htmlEntities("[Courrier - copie à - complet (multiligne)]"));
     // Champ copie à : on reconstruit en omettant le destinataire.
     $confraternie = "";
     $copyTo = "";
     $copyToMulti = "";
     $copyToComplet = "";
     $copyToCompletMulti = "";
     foreach ($destinataires as $_dest) {
         if ($curr_dest[0] == $_dest[0]) {
             continue;
         }
         $_destinataire = $allDest[$_dest[1]][$_dest[2]];
         $_destinataire->nom = preg_replace("/(.*)(\\([^\\)]+\\))/", '$1', $_destinataire->nom);
         $_destinataire->confraternite = $_destinataire->confraternite ? $_destinataire->confraternite . "," : null;
         $copyTo .= $_destinataire->nom . "; ";
         $copyToMulti .= $_destinataire->nom . "<br />";
示例#17
0
 /**
  * Encodes HTML entities from a string
  *
  * @param string $string The string to encode
  *
  * @return string
  */
 static function htmlEncode($string)
 {
     // Strips MS Word entities
     $ent = array(chr(145) => '&#8216;', chr(146) => '&#8217;', chr(147) => '&#8220;', chr(148) => '&#8221;', chr(150) => '&#8211;', chr(151) => '&#8212;');
     $string = CMbString::htmlEntities($string);
     return strtr($string, $ent);
 }
 /**
  * Obtention des listes utilisées dans le document
  *
  * @param CListeChoix[] $lists Listes de choix
  *
  * @return CListeChoix[]
  */
 function getUsedLists($lists)
 {
     $this->usedLists = array();
     foreach ($lists as $value) {
         $nom = CMbString::htmlEntities(stripslashes("[Liste - {$value->nom}]"), ENT_QUOTES);
         $pos = strpos($this->document, $nom);
         if ($pos !== false) {
             $this->usedLists[$pos] = $value;
         }
     }
     ksort($this->usedLists);
     return $this->usedLists;
 }
示例#19
0
 /**
  * Add series to the list of series of the current graph
  *
  * @param array   $series        The array to which the series will be added
  * @param array   $values        The values of the constant
  * @param string  $constant_name The name of the constant
  * @param string  $constant_type The type of the constant (line, bandwidth, cumul, formula
  * @param integer $axis_id       The id of the yaxis
  * @param string  $label         The label of the series
  *
  * @return array
  */
 function addSerie($series, $values, $constant_name, $constant_type, $axis_id, $label)
 {
     /* Add the datas, and the options of the serie to the graph */
     switch ($constant_type) {
         case 'bandwidth':
             $series[] = array('data' => $values['values'], 'yaxis' => $axis_id, 'label' => $label, 'unit' => utf8_encode(CMbString::htmlEntities(CConstantesMedicales::$list_constantes[$constant_name]['unit'])), 'color' => $this->colors[$constant_name], 'bandwidth' => array('show' => true, 'lineWidth' => "6px"), 'name' => utf8_encode($constant_name));
             break;
         case 'cumul':
             $i = 0;
             foreach ($values['cumul'] as $_cumul) {
                 $series[] = array('data' => array($_cumul), 'yaxis' => $axis_id, 'label' => $i == 0 ? 'Cumul ' . $label : null, 'color' => '#4DA74D', 'unit' => utf8_encode(CMbString::htmlEntities(CConstantesMedicales::$list_constantes[$constant_name]['unit'])), 'bars' => array('show' => true, 'fill' => true, 'barWidth' => $_cumul['barWidth']));
                 $i++;
             }
             $series[] = array('data' => $values['values'], 'yaxis' => $axis_id, 'label' => $label, 'color' => $this->colors[$constant_name], 'unit' => utf8_encode(CMbString::htmlEntities(CConstantesMedicales::$list_constantes[$constant_name]['unit'])), 'lines' => array('show' => 1), 'points' => array('show' => 1), 'name' => utf8_encode($constant_name));
             break;
         case 'formula':
             $i = 0;
             foreach ($values['cumul'] as $_cumul) {
                 $series[] = array('data' => array($_cumul), 'yaxis' => $axis_id, 'label' => $i == 0 ? $label : null, 'color' => '#006EFF', 'unit' => utf8_encode(CMbString::htmlEntities(CConstantesMedicales::$list_constantes[$constant_name]['unit'])), 'bars' => array('show' => true, 'fill' => true, 'barWidth' => $_cumul['barWidth']));
                 $i++;
             }
             break;
         case 'line':
             $series[] = array('data' => $values['values'], 'yaxis' => $axis_id, 'label' => $label, 'color' => $this->colors[$constant_name], 'unit' => utf8_encode(CMbString::htmlEntities(CConstantesMedicales::$list_constantes[$constant_name]['unit'])), 'lines' => array('show' => 1), 'points' => array('show' => 1), 'name' => utf8_encode($constant_name));
             break;
     }
     return $series;
 }