Esempio n. 1
0
 /**
  * Store
  *
  * @return void
  */
 function doStore()
 {
     // keep track of former values for fieldModified below
     $obj = $this->_obj;
     $old = $obj->loadOldObject();
     if ($msg = $obj->store()) {
         CAppUI::setMsg($msg, UI_MSG_ERROR);
         if ($this->redirectError) {
             CAppUI::redirect($this->redirectError);
         }
     } else {
         // Keep trace for redirections
         CValue::setSession($this->objectKey, $obj->_id);
         // Insert new group and function permission
         if ($obj->fieldModified("function_id") || !$old->_id) {
             $obj->insFunctionPermission();
             $obj->insGroupPermission();
         }
         // Message
         CAppUI::setMsg($old->_id ? $this->modifyMsg : $this->createMsg, UI_MSG_OK);
         // Redirection
         if ($this->redirectStore) {
             CAppUI::redirect($this->redirectStore);
         }
     }
 }
/**
 * Redirect to the last page
 *
 * @return void
 */
function redirect()
{
    if (CValue::post("ajax")) {
        echo CAppUI::getMsg();
        CApp::rip();
    }
    $m = CValue::post("m");
    $tab = CValue::post("tab");
    CAppUI::redirect("m={$m}&tab={$tab}");
}
/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Urgences
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
function viewMsg($msg, $action, $txt = "")
{
    global $m, $tab;
    $action = CAppUI::tr($action);
    if ($msg) {
        CAppUI::setMsg("{$action}: {$msg}", UI_MSG_ERROR);
        CAppUI::redirect("m={$m}&tab={$tab}");
        return;
    }
    CAppUI::setMsg("{$action} {$txt}", UI_MSG_OK);
}
Esempio n. 4
0
/**
 * Returns the CMbObject with given GET or SESSION params keys,
 * if it doesn't exist, a redirect is made
 *
 * @param string $class_key The class name of the object
 * @param string $id_key    The object ID
 * @param string $guid_key  The object GUID (classname-id)
 *
 * @return CMbObject The object loaded or nothing
 **/
function mbGetObjectFromGetOrSession($class_key, $id_key, $guid_key = null)
{
    $object_class = CValue::getOrSession($class_key);
    $object_id = CValue::getOrSession($id_key);
    $object_guid = "{$object_class}-{$object_id}";
    if ($guid_key) {
        $object_guid = CValue::getOrSession($guid_key, $object_guid);
    }
    $object = CMbObject::loadFromGuid($object_guid);
    // Redirection
    if (!$object || !$object->_id) {
        global $ajax;
        CAppUI::redirect("ajax={$ajax}" . "&suppressHeaders=1" . "&m=system" . "&a=object_not_found" . "&object_guid={$object_guid}");
    }
    return $object;
}
Esempio n. 5
0
 /**
  * Redirection facility
  *  
  * @param string $action Action view     
  * @param string $params HTTP GET styled paramters
  * 
  * @return void
  */
 function redirect($action = "access_denied", $params = null)
 {
     global $actionType;
     // on passe a null soit "tab" soit "a" selon ou l'on se trouve
     CValue::setSession($actionType);
     if ($this->setValues) {
         if (is_scalar($this->setValues)) {
             CValue::setSession($this->setValues);
         } else {
             foreach ($this->setValues as $key => $value) {
                 CValue::setSession($key, $value);
             }
         }
     }
     $action_params = "";
     foreach (array("wsdl", "info", "ajax", "raw", "dialog") as $_action_type) {
         $_action_flag = CValue::get($_action_type);
         if ($_action_flag) {
             $action_params .= "&{$_action_type}={$_action_flag}";
         }
     }
     $context_param = $this->context ? "&context={$this->context}" : "";
     CAppUI::redirect("m=system&a={$action}" . $context_param . $action_params . $params);
 }
Esempio n. 6
0
 function doRedirect($demandeSynchro = false)
 {
     if ($this->ajax) {
         if ($this->synchro) {
             $del = CValue::post("del", 0);
             $tmp_repas_id = CValue::post("_tmp_repas_id", 0);
             $msgSystem = CAppUI::getMsg();
             $smarty = new CSmartyDP("modules/dPrepas");
             $smarty->assign("del", $del);
             $smarty->assign("tmp_repas_id", $tmp_repas_id);
             $smarty->assign("demandeSynchro", $demandeSynchro);
             $smarty->assign("msgSystem", $msgSystem);
             $smarty->assign("callBack", $this->callBack);
             if ($demandeSynchro) {
                 $smarty->assign("object", $this->_old);
             }
             $smarty->display("add_del_repas_offline.tpl");
         }
         CApp::rip();
     }
     if ($this->redirect !== null) {
         CAppUI::redirect($this->redirect);
     }
 }
function clash_cancel(CAppUI $AppUI)
{
    global $a;
    $a = $_SESSION['add_event_caller'];
    clear_clash();
    $AppUI->setMsg($AppUI->_('Event Cancelled'), UI_MSG_ALERT);
    $AppUI->redirect();
}
 /**
  * Redirect at the end of the request
  *
  * @return void
  */
 function doRedirect()
 {
     if ($this->redirect === null) {
         return;
     }
     // Cas ajax
     if ($this->ajax) {
         $this->doCallback();
     }
     // Cas normal
     CAppUI::redirect($this->redirect);
 }
Esempio n. 9
0
        if ($plageAfter->_id) {
            $plageBefore->fin = $plageAfter->debut;
        } else {
            $plageBefore->fin = max($plageBefore->fin, $hour_next);
        }
        $plage =& $plageBefore;
    } elseif ($plageAfter->_id) {
        $plageAfter->debut = min($plageAfter->debut, $hour_now);
        $plage =& $plageAfter;
    } else {
        $plage->chir_id = $prat_id;
        $plage->date = $day_now;
        $plage->freq = "00:" . CPlageconsult::$minutes_interval . ":00";
        $plage->debut = $hour_now;
        $plage->fin = $hour_next;
        $plage->libelle = "automatique";
    }
    $plage->updateFormFields();
    if ($msg = $plage->store()) {
        CAppUI::setMsg($msg, UI_MSG_ERROR);
    }
}
$consult->plageconsult_id = $plage->_id;
if ($msg = $consult->store()) {
    CAppUI::setMsg($msg, UI_MSG_ERROR);
}
if ($current_m == "dPurgences") {
    CAppUI::redirect("m=dPurgences&tab=edit_consultation&selConsult={$consult->_id}&ajax={$ajax}");
} else {
    CAppUI::redirect("m=dPcabinet&tab=edit_consultation&selConsult={$consult->_id}&ajax={$ajax}");
}
Esempio n. 10
0
} else {
    $affectation->loadRefSejour();
    $affectation->loadRefLit();
    $affectation->_ref_lit->loadCompleteView();
    $canAffectation = $affectation->canDo();
    if (!$canAffectation->read || !$affectation->_ref_sejour->sejour_id || $affectation->_ref_sejour->type == "ambu") {
        // Droit Interdit ou Ambulatoire
        CValue::setSession("affectation_id", null);
        $affectation_id = null;
        if (!$affectation->_canRead) {
            $msg = "Vous n'avez pas les droit suffisant pour cette affectation";
        } else {
            $msg = "Vous ne pouvez pas plannifier de repas pour cette affectation";
        }
        CAppUI::setMsg($msg, UI_MSG_ALERT);
        CAppUI::redirect("m=dPrepas&tab=vw_planning_repas");
    }
    // Chargement des Repas
    $listRepas = $listRepas->loadByDate($date, $typerepas_id);
    // Chargement Du Repas
    $affectation->loadMenu($date);
    $repas =& $affectation->_list_repas[$date][$typerepas_id];
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("affectation", $affectation);
$smarty->assign("typerepas_id", $typerepas_id);
$smarty->assign("date", $date);
$smarty->assign("listRepas", $listRepas);
$smarty->assign("repas", $repas);
$smarty->assign("typeRepas", $typeRepas);
Esempio n. 11
0
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 19840 $
 */
CCanDo::checkRead();
$sejour_id = CValue::get("sejour_id");
$patient_id = CValue::get("patient_id");
// Chargement du patient
$patient = new CPatient();
$patient->load($patient_id);
$patient->loadRefsCorrespondantsPatient();
// On récupére le séjour
$sejour = new CSejour();
if ($sejour_id) {
    $sejour->load($sejour_id);
    // On vérifie que l'utilisateur a les droits sur le sejour
    if (!$sejour->_canRead) {
        global $m, $tab;
        CAppUI::setMsg("Vous n'avez pas accés à ce séjour", UI_MSG_WARNING);
        CAppUI::redirect("m={$m}&tab={$tab}&sejour_id=0");
    }
    $patient = $sejour->_ref_patient;
} else {
    $sejour->patient_id = $patient->_id;
    $sejour->_ref_patient = $patient;
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("sejour", $sejour);
$smarty->assign("patient", $patient);
$smarty->assign("form", "editSejour");
$smarty->display("inc_vw_assurances.tpl");
Esempio n. 12
0
            CAppUI::setMsg($msg, UI_MSG_ERROR);
        } else {
            CAppUI::setMsg("Manipulateur ajouté", UI_MSG_OK);
        }
    }
    foreach ($del_personnel as $_personnel_id) {
        if ($_personnel_id) {
            $affectation_personnel = new CAffectationPersonnel();
            $affectation_personnel->object_class = $obj->_class;
            $affectation_personnel->object_id = $obj->_id;
            $affectation_personnel->personnel_id = $_personnel_id;
            $affectation_personnel->loadMatchingObject();
            if ($affectation_personnel->_id) {
                if ($msg = $affectation_personnel->delete()) {
                    CAppui::setMsg($msg, UI_MSG_ERROR);
                } else {
                    CAppUI::setMsg("Personnel supprimé");
                }
            }
        }
    }
}
if ($ajax) {
    echo CAppUI::getMsg();
    CApp::rip();
}
if ($otherm = CValue::post("otherm", 0)) {
    $m = $otherm;
}
CAppUI::redirect("m={$m}");
Esempio n. 13
0
 * @subpackage Cabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 24175 $
 */
CCanDo::checkRead();
// Utilisateur sélectionné ou utilisateur courant
$prat_id = CValue::getOrSession("chirSel", 0);
$userSel = CMediusers::get($prat_id);
$userSel->loadRefs();
$canUserSel = $userSel->canDo();
// Vérification des droits sur les praticiens
$listChir = CConsultation::loadPraticiens(PERM_EDIT);
if (!$userSel->isMedical()) {
    CAppUI::setMsg("Vous devez selectionner un professionnel de santé", UI_MSG_ALERT);
    CAppUI::redirect("m=dPcabinet&tab=0");
}
$canUserSel->needsEdit();
$selConsult = CValue::getOrSession("selConsult", 0);
$dossier_anesth_id = CValue::getOrSession("dossier_anesth_id", 0);
if (isset($_GET["date"])) {
    $selConsult = null;
    CValue::setSession("selConsult", 0);
}
$anesth = new CTypeAnesth();
$anesth = $anesth->loadGroupList();
// Consultation courante
$consult = new CConsultation();
$consult->_ref_chir = $userSel;
if ($selConsult) {
    $consult->load($selConsult);
Esempio n. 14
0
CCanDo::checkRead();
$group_id = CGroups::loadCurrent()->_id;
$sejour_id = CValue::getOrSession("sejour_id");
$user = CMediusers::get();
$prats = $user->loadPraticiens(PERM_READ);
$service = new CService();
$where = array("group_id" => "= '{$group_id}'");
$order = "nom";
$services = $service->loadListWithPerms(PERM_READ, $where, $order);
$sejour = new CSejour();
$sejour->load($sejour_id);
$sejour->loadRefsNotes();
$sejour->loadRefsDocItems();
if ($sejour_id && !$sejour->_id) {
    CAppUI::setMsg(CAppUI::tr("CSejour-unavailable"), UI_MSG_WARNING);
    CAppUI::redirect("m=ssr&tab=vw_aed_sejour&sejour_id=0");
}
$fiche_autonomie = new CFicheAutonomie();
$patient = new CPatient();
$bilan = new CBilanSSR();
$prescription = null;
$lines = array();
$medecin_adresse_par = "";
$correspondantsMedicaux = array();
if ($sejour->_id) {
    $sejour->loadRefPatient();
    $sejour->loadNDA();
    // Chargement du patient
    $patient = $sejour->_ref_patient;
    $patient->loadIPP();
    $patient->loadRefsCorrespondants();
Esempio n. 15
0
            }
            if ($success == 1) {
                $fileconvert = $file->loadPDFconverted();
                header("Location: lib/phpThumb/phpThumb.php?src={$fileconvert->_file_path}" . $finUrl);
            } else {
                header("Location: images/pictures/medifile.png");
            }
        } else {
            header("Location: images/pictures/medifile.png");
        }
    } else {
        // BEGIN extra headers to resolve IE caching bug (JRP 9 Feb 2003)
        // [http://bugs.php.net/bug.php?id=16173]
        header("Pragma: ");
        header("Cache-Control: ");
        header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
        header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
        header("Cache-Control: no-store, no-cache, must-revalidate");
        //HTTP/1.1
        header("Cache-Control: post-check=0, pre-check=0", false);
        // END extra headers to resolve IE caching bug
        header("MIME-Version: 1.0");
        header("Content-length: {$file->doc_size}");
        header("Content-type: {$file->file_type}");
        header('Content-disposition: ' . $disposition . '; filename="' . $file->file_name . '"');
        readfile($file->_file_path);
    }
} else {
    CAppUI::setMsg("fileIdError", UI_MSG_ERROR);
    CAppUI::redirect();
}
Esempio n. 16
0
if ($contactListByUsername != 'User Not Found') {
    error_reporting(0);
    echo "<script language='javascript'>\n          alert('The username you selected already exists, please select another or if that user name is yours request the password recovery through the dedicated link.');\n          history.go(-2);\n        </script>";
    die;
}
$email = w2PgetParam($_POST, 'contact_email', 0);
$contactListByEmail = CContact::getContactByEmail($email);
if ($contactListByEmail != 'User Not Found') {
    error_reporting(0);
    echo "<script language='javascript'>\n          alert('The email you selected already exists, please select another or if that email is yours request the password recovery through the dedicated link.');\n          history.go(-2);\n        </script>";
    die;
}
$user = new CUser();
if (!$user->bind($_POST)) {
    $AppUI->setMsg($user->getError(), UI_MSG_ERROR);
    $AppUI->redirect();
}
$contact = new CContact();
if (!$contact->bind($_POST)) {
    $AppUI->setMsg($contact->getError(), UI_MSG_ERROR);
    $AppUI->redirect();
}
// prepare (and translate) the module name ready for the suffix
$AppUI->setMsg('User');
$isNewUser = !w2PgetParam($_REQUEST, 'user_id', 0);
if ($isNewUser) {
    // check if a user with the param Username already exists
    if (is_array($contactListByUsername)) {
        $AppUI->setMsg('This username is not available, please try another.', UI_MSG_ERROR, true);
        $AppUI->redirect();
    } else {
Esempio n. 17
0
    }
    CApp::rip();
}
if (!CUser::checkPassword($praticien->_user_username, $password)) {
    CAppUI::setMsg("Mot de passe incorrect", UI_MSG_ERROR);
    echo CAppUI::getMsg();
    if ($redirectUrl) {
        CAppUI::redirect($redirectUrl);
    }
    CApp::rip();
}
// Chargement des actes CCAM à modifier
$acte_ccam = new CActeCCAM();
$acte_ccam->object_id = $object_id;
$acte_ccam->object_class = $object_class;
$acte_ccam->executant_id = $praticien->_id;
$acte_ccam->signe = 0;
/** @var CActeCCAM[] $actes_ccam */
$actes_ccam = $acte_ccam->loadMatchingList();
// Modification des actes CCAM
foreach ($actes_ccam as $key => $_acte_ccam) {
    $_acte_ccam->signe = 1;
    $msg = $_acte_ccam->store();
    if ($msg) {
        CAppUI::setMsg($msg, UI_MSG_ERROR);
    }
}
if ($redirectUrl) {
    CAppUI::redirect($redirectUrl);
}
CApp::rip();
Esempio n. 18
0
 * @version    $Revision: 28555 $
 */
CCanDo::checkRead();
$user = CMediusers::get();
$patient_id = CValue::getOrSession("patient_id", 0);
$vw_cancelled = CValue::get("vw_cancelled", 0);
// recuperation des id dans le cas d'une recherche de dossiers cliniques
$consultation_id = CValue::get("consultation_id", 0);
$sejour_id = CValue::get("sejour_id", 0);
$operation_id = CValue::get("operation_id", 0);
// Récuperation du patient sélectionné
$patient = new CPatient();
$patient->load($patient_id);
if (!$patient->_id || $patient->_vip) {
    CAppUI::setMsg("Vous devez selectionner un patient", UI_MSG_ALERT);
    CAppUI::redirect("m=patients&tab=vw_idx_patients");
}
// Save history
$params = array("patient_id" => $patient_id, "vw_cancelled" => $vw_cancelled, "consultation_id" => $consultation_id, "sejour_id" => $sejour_id, "operation_id" => $operation_id);
CViewHistory::save($patient, CViewHistory::TYPE_VIEW, $params);
$patient->loadDossierComplet(PERM_READ, false);
$patient->_nb_files_docs -= $patient->_nb_cancelled_files;
// Chargement de l'IPP
$patient->loadIPP();
$patient->countINS();
// Chargement du dossier medical du patient
$dossier_medical = $patient->loadRefDossierMedical();
$dossier_medical->loadComplete();
$nb_consults_annulees = 0;
// Suppression des consultations d'urgences
foreach ($patient->_ref_consultations as $consult) {
Esempio n. 19
0
        }
        // In case the setup has added some user prefs
        CAppUI::buildPrefs();
        break;
    case "upgrade":
        if ($module->mod_version = $setup->upgrade($module->mod_version)) {
            $module->mod_type = $setup->mod_type;
            $module->store();
            if ($setup->mod_version == $module->mod_version) {
                CAppUI::setMsg("Installation de '%s' à la version %s", UI_MSG_OK, $module->mod_name, $setup->mod_version);
            } else {
                CAppUI::setMsg("Installation de '{$module->mod_name}' à la version {$module->mod_version} sur {$setup->mod_version}", UI_MSG_WARNING, true);
            }
        } else {
            CAppUI::setMsg("Module '%s' non mis à jour", UI_MSG_WARNING, $module->mod_name);
        }
        // In case the setup has added some user prefs
        CAppUI::buildPrefs();
        break;
    default:
        CAppUI::setMsg("Unknown Command", UI_MSG_ERROR);
}
// en cas d'un appel en Ajax (mobile)
if (CValue::get("ajax") || CValue::post("ajax")) {
    echo CAppUI::getMsg();
    CApp::rip();
}
SHM::rem("modules");
if (!$mobile) {
    CAppUI::redirect("m=system&tab=view_modules");
}
Esempio n. 20
0
     CValue::setSession("chir_id", $op->chir_id);
 }
 if (CBrisDeGlace::isBrisDeGlaceRequired()) {
     $canAccess = CAccessMedicalData::checkForSejour($op->_ref_sejour);
     if (!$canAccess) {
         if (!$op->canDo()->read) {
             global $m, $tab;
             CAppUI::setMsg("Vous n'avez pas accés à cette intervention hors plage", UI_MSG_WARNING);
             CAppUI::redirect("m={$m}&tab={$tab}&operation_id=0");
         }
     }
 } else {
     if (!$op->canDo()->read) {
         global $m, $tab;
         CAppUI::setMsg("Vous n'avez pas accés à cette intervention hors plage", UI_MSG_WARNING);
         CAppUI::redirect("m={$m}&tab={$tab}&operation_id=0");
     }
 }
 // Chargement des régérences
 $op->loadRefs();
 $op->loadRefsNotes();
 $op->_ref_chir->loadRefFunction();
 $op->loadRefs();
 foreach ($op->_ref_actes_ccam as $acte) {
     $acte->loadRefExecutant();
 }
 $sejour = $op->_ref_sejour;
 $sejour->loadRefsFwd();
 $sejour->loadRefCurrAffectation()->loadRefService();
 $sejour->_ref_praticien->canDo();
 $sejour->makeCancelAlerts($op->_id);
if ($sejour_id) {
    $consult_anesth->sejour_id = $sejour_id;
}
if ($operation_id) {
    $consult_anesth->operation_id = $operation_id;
}
$msg = $consult_anesth->store();
$represcription = 0;
if ($msg) {
    CAppUI::setMsg($msg);
} else {
    CAppUI::setMsg(CAppUI::tr("CConsultAnesth-msg-duplicate"));
    //Création de la prescription de séjour selon pref user
    if ($consult_anesth->sejour_id && CAppUI::pref("show_replication_duplicate")) {
        $prescription = new CPrescription();
        $prescription->object_class = 'CSejour';
        $prescription->object_id = $consult_anesth->sejour_id;
        $prescription->type = 'sejour';
        if (!$prescription->loadMatchingObject()) {
            if ($msg = $prescription->store()) {
                CAppUI::setMsg($msg, UI_MSG_ERROR);
            }
        }
        $represcription = 1;
    }
}
echo CAppUI::getMsg();
if ($redirect) {
    CAppUI::redirect("m=cabinet&tab=edit_consultation&selConsult=" . $consult_anesth->consultation_id . "&dossier_anesth_id=" . $consult_anesth->_id . "&represcription={$represcription}");
}
CApp::rip();
Esempio n. 22
0
// Chargement du praticien
$chir = new CMediusers();
if ($chir_id) {
    $chir->load($chir_id);
}
// Vérification des droits sur les listes
$listPraticiens = $mediuser->loadPraticiens(PERM_EDIT);
$function = new CFunctions();
$listFunctions = $function->loadSpecialites(PERM_EDIT);
$protocole = new CProtocole();
if ($protocole_id) {
    $protocole->load($protocole_id);
    // On vérifie que l'utilisateur a les droits sur le protocole
    if (!$protocole->getPerm(PERM_EDIT)) {
        CAppUI::setMsg("Vous n'avez pas accès à ce protocole", UI_MSG_WARNING);
        CAppUI::redirect("m={$m}&tab={$tab}&protocole_id=0");
    }
    $protocole->loadRefs();
    $protocole->loadRefsNotes();
    $protocole->loadRefPrescriptionChir();
    $chir =& $protocole->_ref_chir;
} else {
    $protocole->temp_operation = '00:00:00';
}
// Durée d'une intervention
$start = CAppUI::conf("dPplanningOp COperation duree_deb");
$stop = CAppUI::conf("dPplanningOp COperation duree_fin");
$step = CAppUI::conf("dPplanningOp COperation min_intervalle");
// Récupération des services
$service = new CService();
$where = array();
Esempio n. 23
0
 * $Id: ajax_form_complement.php 28128 2015-04-29 13:16:11Z aurelie17 $
 *
 * @package    Mediboard
 * @subpackage Urgences
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 28128 $
 */
CCanDo::checkRead();
$rpu_id = CValue::getOrSession("rpu_id");
$sejour_id = CValue::get("sejour_id");
$rpu = new CRPU();
if ($rpu_id && !$rpu->load($rpu_id)) {
    global $m, $tab;
    CAppUI::setMsg("Ce RPU n'est pas ou plus disponible", UI_MSG_WARNING);
    CAppUI::redirect("m={$m}&tab={$tab}&rpu_id=0");
}
// Création d'un RPU pour un séjour existant
if ($sejour_id) {
    $rpu = new CRPU();
    $rpu->sejour_id = $sejour_id;
    $rpu->loadMatchingObject();
    $rpu->updateFormFields();
}
if ($rpu->_id || $rpu->sejour_id) {
    // Mise en session de l'id de la consultation, si elle existe.
    $rpu->loadRefConsult();
    if ($rpu->_ref_consult->_id) {
        CValue::setSession("selConsult", $rpu->_ref_consult->_id);
    }
    $sejour = $rpu->_ref_sejour;
Esempio n. 24
0
/**
 * $Id$
 *
 * @category Admin
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
CCanDo::checkEdit();
$user = CUser::get(CValue::getOrSession("user_id"));
$user_id = CValue::getOrSession("user_id", $user->_id);
if (!$user_id) {
    CAppUI::setMsg("Vous devez sélectionner un utilisateur");
    CAppUI::redirect("m=admin&tab=vw_edit_users");
}
$modulesInstalled = CModule::getInstalled();
$isAdminPermSet = false;
$profile = new CUser();
if ($user->profile_id) {
    $where["user_id"] = "= '{$user->profile_id}'";
    $profile->loadObject($where);
}
$order = "mod_id";
//Droit de l'utilisateur sur les modules
$whereUser = array();
$whereUser["user_id"] = "= '{$user->user_id}'";
$whereProfil = array();
$whereProfil["user_id"] = "= '{$user->profile_id}'";
// DROITS SUR LES MODULES
Esempio n. 25
0
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage GestionCab
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
$fiche_paie_id = CValue::getOrSession("fiche_paie_id", null);
$fichePaie = new CFichePaie();
$fichePaie->load($fiche_paie_id);
if (!$fichePaie->fiche_paie_id) {
    CAppUI::setMsg("Vous n'avez pas choisi de fiche de paie", UI_MSG_ERROR);
    CAppUI::redirect("m=dPgestionCab&tab=edit_paie");
}
if ($fichePaie->final_file) {
    echo $fichePaie->final_file;
} else {
    $fichePaie->loadRefsFwd();
    $fichePaie->_ref_params_paie->loadRefsFwd();
    // Création du template
    $smarty = new CSmartyDP();
    $smarty->assign("fichePaie", $fichePaie);
    $smarty->display("print_fiche.tpl");
}
Esempio n. 26
0
if ($type == "entree") {
    $consult->motif = CAppUI::conf('soins Other default_motif_observation', CGroups::loadCurrent()->_guid);
}
// Cas des urgences
if ($sejour->type == "urg") {
    // Motif de la consultation
    $consult->motif = "";
    if (CAppUI::conf('dPurgences motif_rpu_view')) {
        $consult->motif .= "RPU: ";
        $sejour->loadRefRPU();
        $consult->motif .= $sejour->_ref_rpu->diag_infirmier;
    }
}
if ($msg = $consult->store()) {
    CAppUI::setMsg($msg, UI_MSG_ERROR);
}
CAppUI::setMsg("CConsultation-msg-create", UI_MSG_OK);
// Redirect final
if ($ajax) {
    echo CAppUI::getMsg();
    if ($callback) {
        CAppUI::callbackAjax($callback, $consult->_id);
    }
    CApp::rip();
}
if ($current_m = CValue::post("_m_redirect")) {
    CAppUI::redirect("m={$current_m}");
} else {
    $current_m = $sejour->type == "urg" ? "dPurgences" : "dPcabinet";
    CAppUI::redirect("m={$current_m}&tab=edit_consultation&selConsult={$consult->consultation_id}&chirSel={$chir->user_id}");
}
<?php

/**
 * $Id$
 *  
 * @category DPpatients
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
if (!CAppUI::pref("allowed_modify_identity_status")) {
    CAppUI::redirect("m=system&a=access_denied");
}
$number_day = CValue::getOrSession("_number_day", 8);
$number_day = $number_day ?: 8;
$now = CValue::getOrSession("_date_end", CMbDT::date());
$before = CMbDT::date("-{$number_day} DAY", $now);
$csv = new CCSVFile();
$line = array("Date", CAppUI::tr("CPatient.status.PROV"), CAppUI::tr("CPatient.status.DPOT"), CAppUI::tr("CPatient.status.ANOM"), CAppUI::tr("CPatient.status.CACH"), CAppUI::tr("CPatient.status.VALI"));
$csv->writeLine($line);
$results = CPatientStateTools::getPatientStateByDate($before, $now);
$values = array();
for ($i = $number_day; $i >= 0; $i--) {
    $values[CMbDT::date("-{$i} DAY", $now)] = array("PROV" => 0, "DPOT" => 0, "ANOM" => 0, "CACH" => 0, "VALI" => 0);
}
foreach ($results as $_result) {
    $values[$_result["date"]][$_result["state"]] = $_result["total"];
}
foreach ($values as $_date => $_value) {
Esempio n. 28
0
        if ($user->_ref_user->force_change_password) {
            CAppUI::redirect("m=admin&tab=chpwd&forceChange=1");
        }
        if (CMbDT::dateTime("-" . CAppUI::conf("admin CUser password_life_duration")) > $user->_ref_user->user_password_last_change) {
            CAppUI::redirect("m=admin&tab=chpwd&forceChange=1&lifeDuration=1");
        }
    }
}
// Check CSRF protection
CCSRF::checkProtection();
// do some db work if dosql is set
if ($dosql) {
    // dP remover super hack
    if (!CModule::getInstalled($m)) {
        if (!CModule::getInstalled("dP{$m}")) {
            CAppUI::redirect("m=system&a=module_missing&mod={$m}");
        }
        $m = "dP{$m}";
    }
    // controller in controllers/ directory
    if (is_file("./modules/{$m}/controllers/{$dosql}.php")) {
        include "./modules/{$m}/controllers/{$dosql}.php";
    }
}
// Permissions checked on POST $m, but we redirect to GET $m
if ($post_request && $m_get && $m != $m_get && $m != "dP{$m_get}") {
    $m = $m_get;
}
if ($class) {
    $do = new CDoObjectAddEdit($class);
    $do->doIt();
Esempio n. 29
0
 /**
  * Link to the configure pane. Should be handled in the template
  *
  * @return void
  */
 function configure()
 {
     CAppUI::redirect("m={$this->mod_name}&a=configure");
     return true;
 }
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Patients
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
$patient_id = CValue::getOrSession("patient_id", 0);
if (!$patient_id) {
    CAppUI::setMsg("Vous devez selectionner un patient", UI_MSG_ALERT);
    CAppUI::redirect("m=dPpatients&tab=0");
}
// Récuperation du patient sélectionné
$patient = new CPatient();
$patient->load($patient_id);
$patient->loadDossierComplet(PERM_READ);
$patient->loadRefDossierMedical();
$patient->_ref_dossier_medical->loadRefsAntecedents();
$patient->_ref_dossier_medical->loadRefsTraitements();
$patient->countINS();
$userSel = CMediusers::get();
// Suppression des consultations d'urgences
foreach ($patient->_ref_consultations as $keyConsult => $consult) {
    if ($consult->motif == "Passage aux urgences") {
        unset($patient->_ref_consultations[$keyConsult]);
    }