Exemple #1
0
 function doDelete()
 {
     parent::doDelete();
     $dialog = CValue::post("dialog");
     if ($dialog) {
         $this->redirectDelete .= "&name=" . $this->_obj->nom . "&firstName=" . $this->_obj->prenom . "&id=0";
     }
 }
 /**
  * @see parent::doStore()
  */
 function doStore()
 {
     if (isset($_FILES['attachment'])) {
         $mail_id = CValue::post('mail_id');
         $mail = new CUserMail();
         $mail->load($mail_id);
         $files = array();
         foreach ($_FILES['attachment']['error'] as $key => $file_error) {
             if (isset($_FILES['attachment']['name'][$key])) {
                 $files[] = array('name' => $_FILES['attachment']['name'][$key], 'tmp_name' => $_FILES['attachment']['tmp_name'][$key], 'error' => $_FILES['attachment']['error'][$key], 'size' => $_FILES['attachment']['size'][$key]);
             }
         }
         foreach ($files as $_key => $_file) {
             if ($_file['error'] == UPLOAD_ERR_NO_FILE) {
                 continue;
             }
             if ($_file['error'] != 0) {
                 CAppUI::setMsg(CAppUI::tr("CFile-msg-upload-error-" . $_file["error"]), UI_MSG_ERROR);
                 continue;
             }
             $attachment = new CMailAttachments();
             $attachment->name = $_file['name'];
             $content_type = mime_content_type($_file['tmp_name']);
             $attachment->type = $attachment->getTypeInt($content_type);
             $attachment->bytes = $_file['size'];
             $attachment->mail_id = $mail_id;
             $content_type = explode('/', $content_type);
             $attachment->subtype = strtoupper($content_type[1]);
             $attachment->disposition = 'ATTACHMENT';
             $attachment->extension = substr(strrchr($attachment->name, '.'), 1);
             $attachment->part = $mail->countBackRefs('mail_attachments') + 1;
             $attachment->store();
             $file = new CFile();
             $file->setObject($attachment);
             $file->author_id = CAppUI::$user->_id;
             $file->file_name = $attachment->name;
             $file->file_date = CMbDT::dateTime();
             $file->fillFields();
             $file->updateFormFields();
             $file->doc_size = $attachment->bytes;
             $file->file_type = mime_content_type($_file['tmp_name']);
             $file->moveFile($_file, true);
             if ($msg = $file->store()) {
                 CAppUI::setMsg(CAppUI::tr('CMailAttachments-error-upload-file') . ':' . CAppUI::tr($msg), UI_MSG_ERROR);
                 CApp::rip();
             }
             $attachment->file_id = $file->_id;
             if ($msg = $attachment->store()) {
                 CAppUI::setMsg($msg, UI_MSG_ERROR);
                 CApp::rip();
             }
         }
         CAppUI::setMsg('CMailAttachments-msg-added', UI_MSG_OK);
     } else {
         parent::doStore();
     }
 }
/**
 * 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}");
}
 function doStore()
 {
     parent::doStore();
     $dialog = CValue::post("dialog");
     $isNew = !CValue::post("patient_id");
     $patient_id = $this->_obj->patient_id;
     if ($isNew) {
         $this->redirectStore .= "&patient_id={$patient_id}&created={$patient_id}";
     } elseif ($dialog) {
         $this->redirectStore .= "&name=" . $this->_obj->nom . "&firstname=" . $this->_obj->prenom;
     }
 }
 function doBind()
 {
     $this->ajax = CValue::post("ajax");
     $this->suppressHeaders = CValue::post("suppressHeaders");
     $this->callBack = CValue::post("callback");
     unset($_POST["ajax"]);
     unset($_POST["suppressHeaders"]);
     unset($_POST["callback"]);
     // Object binding
     $this->_obj->bind($_POST["suivi"]);
     $this->_old->load($this->_obj->_id);
 }
 function doBind()
 {
     parent::doBind();
     // recuperation du sejour_id
     $_sejour_id = CValue::post("_sejour_id", null);
     // si pas de sejour_id, redirection
     if (!$_sejour_id) {
         $this->doRedirect();
     }
     // Creation du nouvel antecedent
     unset($_POST["antecedent_id"]);
     $this->_obj = $this->_old;
     $this->_obj->_id = null;
     $this->_obj->antecedent_id = null;
     // Calcul de la valeur de l'id du dossier_medical du sejour
     $this->_obj->dossier_medical_id = CDossierMedical::dossierMedicalId($_sejour_id, "CSejour");
 }
/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage SalleOp
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
$object_id = CValue::post("object_id");
$object_class = CValue::post("object_class");
$chir_id = CValue::post("chir_id");
$anesth_id = CValue::post("anesth_id");
$password_activite_1 = CValue::post("password_activite_1");
$password_activite_4 = CValue::post("password_activite_4");
/** @var COperation|CSejour $object */
$object = new $object_class();
$object->load($object_id);
if ($password_activite_1) {
    $chir = new CMediusers();
    $chir->load($chir_id);
    if (!CUser::checkPassword($chir->_user_username, $password_activite_1)) {
        CAppUI::setMsg("Mot de passe incorrect", UI_MSG_ERROR);
        echo CAppUI::getMsg();
        CApp::rip();
    }
    $object->cloture_activite_1 = 1;
    if ($msg = $object->store()) {
        CAppUI::setMsg($msg, UI_MSG_ERROR);
    } else {
<?php

/**
 * $Id$
 *
 * @category Password Keeper
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @link     http://www.mediboard.org */
CPasswordKeeper::checkHTTPS();
CCanDo::checkAdmin();
$password_keeper_id = CValue::postOrSession("password_keeper_id");
$_passphrase = CValue::post("passphrase");
$deletion = CValue::post("deletion");
$user = CMediusers::get();
$keeper = new CPasswordKeeper();
$keeper->load($password_keeper_id);
if ($keeper->_id && $keeper->user_id != $user->_id) {
    $msg = "Vous n'avez pas droit d'accéder à ce trousseau.";
    CAppUI::stepAjax($msg, UI_MSG_ERROR);
}
// Second passage, après avoir saisi la phrase de passe
if ($keeper->_id && $_passphrase) {
    if (!$keeper->testSample($_passphrase)) {
        $msg = "Phrase de passe incorrecte.";
        CAppUI::stepAjax($msg, UI_MSG_ERROR);
    }
    // Ecrit la phrase de passe en session
    CValue::setSessionAbs("passphrase", $_passphrase);
}
<?php

/**
 * $Id$
 *
 * @category HL7
 * @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
 */
$cn_receiver_guid = CValue::post("cn_receiver_guid");
if ($cn_receiver_guid == "none") {
    unset($_SESSION["cn_receiver_guid"]);
    return;
}
CValue::setSessionAbs("cn_receiver_guid", $cn_receiver_guid);
     }
     break;
 case "A13":
     $sejour_id = CValue::post("sejour_id");
     $sejour = new CSejour();
     $sejour->load($sejour_id);
     $sejour->sortie_reelle = "";
     if ($msg = $sejour->store()) {
         CAppUI::stepAjax($msg, UI_MSG_ERROR);
     }
     break;
 case "INSERT":
     $sejour_id = CValue::post("sejour_id");
     $sejour = new CSejour();
     $sejour->load($sejour_id);
     $sejour->type = CValue::post("type");
     if ($sejour->type == "ambu" || $sejour->type == "urg") {
         $sejour->sortie_prevue = CMbDT::dateTime("+4 HOURS", $sejour->entree);
         if ($sejour->sortie_reelle) {
             $sejour->sortie_reelle = CMbDT::dateTime("+4 HOURS", $sejour->entree);
         }
         /* TODO Supprimer ceci après l'ajout des times picker */
         $sejour->_hour_entree_prevue = null;
         $sejour->_min_entree_prevue = null;
         $sejour->_hour_sortie_prevue = null;
         $sejour->_min_sortie_prevue = null;
     } elseif ($sejour->type == "comp") {
         $sejour->sortie_prevue = CMbDT::dateTime("+72 HOURS", $sejour->entree);
         if ($sejour->sortie_reelle) {
             $sejour->sortie_reelle = CMbDT::dateTime("+72 HOURS", $sejour->entree);
         }
Exemple #11
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");
}
Exemple #12
0
 * @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
 */
// post values
$dispo = CValue::post("tab_disposition");
$user_id = CValue::post("user_id");
$cat_id = CValue::post("category_id");
$print = CValue::post("print", 0);
// files
$file_array = CValue::post("file");
$data = $file_array[$dispo];
// context
$object_guid = CValue::post("context_guid");
$context = CMbObject::loadFromGuid($object_guid);
// get data uri
foreach ($data as $_key => &$_data) {
    $file = new CFile();
    $file->load($_data["file_id"]);
    $file->getDataURI();
    $_data["file_uri"] = $file->_data_uri;
}
//user
$user = CMediusers::get($user_id);
// file
$file = new CFile();
$file->setObject($context);
$file->file_name = CAppUI::tr("CFile-create-mozaic") . " de " . CAppUI::tr($context->_class) . " du " . CMbDT::dateToLocale(CMbDT::date()) . ".pdf";
$file->file_type = "application/pdf";
<?php

/**
 * $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
 */
$password = trim(CValue::post('password'));
$lock = CValue::post('lock');
if ($lock) {
    $_SESSION['locked'] = true;
    return;
} else {
    if (!$password) {
        CAppUI::setMsg("Auth-failed-nopassword", UI_MSG_ERROR);
    }
    if (!CUser::checkPassword(CUser::get()->user_username, $password)) {
        CAppUI::setMsg("Auth-failed-combination", UI_MSG_ERROR);
    }
    if ($msg = CAppUI::getMsg()) {
        echo $msg;
        return;
    } else {
        CAppUI::callbackAjax('Session.unlock');
        $_SESSION['locked'] = false;
    }
 */
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);
}
//récupération de l'identifiant du séjour à fusionner
$sejour_id_merge = CValue::post("sejour_id_merge");
// Récupération du rpu
$rpu_id = CValue::post("rpu_id");
$rpu = new CRPU();
$rpu->load($rpu_id);
$sejour = $rpu->loadRefSejour();
$sejour_rpu = $sejour;
$properties_sejour = $sejour->getProperties();
//Cas d'une collision ou d'un rattachement d'un séjour
if ($sejour_id_merge) {
    $sejour_merge = new CSejour();
    $sejour_merge->load($sejour_id_merge);
    $sejour_merge->entree_reelle = $sejour->entree_reelle;
    $sejour_merge->mode_entree_id = $sejour->mode_entree_id;
    $sejour_merge->mode_entree = $sejour->mode_entree;
    $sejour_merge->provenance = $sejour->provenance;
    $msg = $sejour_merge->merge(array($sejour));
    viewMsg($msg, "Fusion");
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage dPcabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
// Praticien courant pour les prises de rendez-vous suivantes
if ($chir_id = CValue::post("chir_id")) {
    CValue::setSession("chir_id", $chir_id);
}
// Consultation courante dans edit_consulation
if (CValue::post("del")) {
    CValue::setSession("selConsult");
}
// before basic job, do the multiple consultations
CAppUI::requireModuleFile("dPcabinet", "controllers/do_consultation_multiple");
// Cas de l'annulation / rétablissement / supression multiple
if ($consultation_ids = CValue::post("consultation_ids")) {
    $_POST = array("consultation_ids" => CValue::post("consultation_ids"), "motif_annulation" => CValue::post("motif_annulation"), "annule" => CValue::post("annule", 0), "del" => CValue::post("del"), "sejour_id" => CValue::post("sejour_id"), "postRedirect" => CValue::post("postRedirect"));
}
//consult n°1, classic use
$do = new CDoObjectAddEdit("CConsultation");
$do->doIt();
/**
 * Script de nettoyage des correspondants patients: supprime les doublons de correspondants totalement identiques
 *
 * $Id: do_cleanup_correspondant_patient.php 22475 2014-03-18 10:30:30Z mytto $
 *
 * @package    Mediboard
 * @subpackage Patients
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 22475 $
 */
CCanDo::checkAdmin();
CApp::setTimeLimit(600);
$count_min = CValue::post("count_min", 1);
$merge_dates = CValue::post("merge_dates", 0);
$dry_run = CValue::post("dry_run");
// Ignore handlers
global $dPconfig;
$dPconfig["object_handlers"] = array();
CMbObject::$useObjectCache = false;
$correspondant = new CCorrespondantPatient();
$fields = array_keys($correspondant->getPlainFields());
$spec = $correspondant->_spec;
// Don't group by key... of course
CMbArray::removeValue($spec->key, $fields);
// Don't group by date
if ($merge_dates) {
    CMbArray::removeValue("date_debut", $fields);
}
$select = $fields;
$select["TOTAL"] = "COUNT(*)";
Exemple #17
0
<?php

/* $Id $ */
/**
 * @package Mediboard
 * @subpackage hl7
 * @version $Revision: 15455 $
 * @author SARL OpenXtrem
 * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 */
$er7 = CValue::post("er7");
$query = CValue::post("query");
$hl7_message = new CHL7v2Message();
$hl7_message->parse($er7);
$xml = $hl7_message->toXML();
if ($query) {
    $xpath = new CMbXPath($xml);
    $results = @$xpath->query("//{$query}");
    $nodes = array();
    // Création du template
    $smarty = new CSmartyDP();
    if ($results) {
        foreach ($results as $result) {
            $nodes[] = CMbString::highlightCode("xml", $xml->saveXML($result));
        }
    }
    $smarty->assign("nodes", $nodes);
    $smarty->display("inc_er7_xml_result.tpl");
} else {
    ob_clean();
    header("Content-Type: text/xml");
         }
         if (isset($_POST["sc_venue_id"])) {
             $mbSejour->_NDA = $_POST["sc_venue_id"];
         }
         if (isset($_POST["cmca_uf_code"])) {
             $object->code_uf = $_POST["cmca_uf_code"];
         }
         if (isset($_POST["cmca_uf_libelle"])) {
             $object->libelle_uf = $_POST["cmca_uf_libelle"];
         }
     }
     break;
 case "CSejour":
     $object = new CSejour();
     // Chargement du séjour et génération du document
     $sejour_id = CValue::post("mb_sejour_id", CValue::getOrSession("object_id"));
     if ($object->load($sejour_id)) {
         $object->loadRefs();
         $object->loadRefDossierMedical();
         $object->loadNDA();
         $NDA = $object->_NDA;
         $object->_ref_patient->loadIPP();
         $IPP = $object->_ref_patient->_IPP;
         if (isset($_POST["sc_patient_id"])) {
             $object->_ref_patient->_IPP = $_POST["sc_patient_id"];
         }
         if (isset($_POST["sc_venue_id"])) {
             $object->_NDA = $_POST["sc_venue_id"];
         }
     }
     break;
 * $Id: do_import_patient.php 4983 2013-12-12 17:09:40Z charly $
 *
 * @package    Mediboard
 * @subpackage dPpatients
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GPLv2
 * @version    $Revision: 4983 $
 */
CCanDo::checkAdmin();
ini_set("auto_detect_line_endings", true);
global $dPconfig;
$dPconfig["object_handlers"] = array();
CAppUI::stepAjax("Désactivation du gestionnaire", UI_MSG_OK);
$start = CValue::post("start");
$count = CValue::post("count");
$callback = CValue::post("callback");
$date = CMbDT::date();
CApp::setTimeLimit(600);
CApp::setMemoryLimit("512M");
CMbObject::$useObjectCache = false;
$file_import = fopen(CAppUI::conf("root_dir") . "/tmp/rapport_import_patient_{$date}.txt", "a");
importFile(CAppUI::conf("dPpatients imports pat_csv_path"), $start, $count, $file_import);
fclose($file_import);
$start += $count;
file_put_contents(CAppUI::conf("root_dir") . "/tmp/import_patient.txt", "{$start};{$count}");
if ($callback) {
    CAppUI::js("{$callback}({$start},{$count})");
}
echo "<tr><td colspan=\"2\">MEMORY: " . memory_get_peak_usage(true) / (1024 * 1024) . " MB" . "</td>";
CMbObject::$useObjectCache = true;
CApp::rip();
<?php

/**
 * $Id$
 * 
 * @package    Mediboard
 * @subpackage dPcabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
$consultation_id = CValue::post("consultation_id");
$plageconsult_id = CValue::post("plageconsult_id");
$heure = CValue::post("heure");
$consult = new CConsultation();
$consult->load($consultation_id);
$new_consult = new CConsultation();
$new_consult->plageconsult_id = $plageconsult_id;
$new_consult->heure = $heure;
$new_consult->chrono = CConsultation::PLANIFIE;
$new_consult->patient_id = $consult->patient_id;
$new_consult->categorie_id = $consult->categorie_id;
$msg = $new_consult->store();
if ($msg) {
    CAppUI::setMsg($msg, UI_MSG_ERROR);
} else {
    CAppUI::setMsg(CAppUI::tr("CConsultation-msg-create"), UI_MSG_OK);
}
echo CAppUI::getMsg();
CApp::rip();
<?php

/* $Id $ */
/**
 * @package Mediboard
 * @subpackage hl7
 * @version $Revision: 15199 $
 * @author SARL OpenXtrem
 * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 */
$er7 = CValue::post("er7");
$exchange_id = CValue::post("exchange_id");
$exchange = new CExchangeHL7v2();
$exchange->load($exchange_id);
$exchange->loadRefsInteropActor();
if ($exchange->receiver_id) {
    /** @var CInteropReceiver $actor */
    $actor = $exchange->_ref_receiver;
    $actor->loadConfigValues();
} else {
    /** @var CInteropSender $actor */
    $actor = $exchange->_ref_sender;
    $actor->getConfigs($exchange);
}
$hl7_message = new CHL7v2Message();
$hl7_message->parse($er7);
/** @var CHL7v2MessageXML $xml */
$xml = $hl7_message->toXML(null, false);
$MSH = $xml->queryNode("MSH");
$EVN = $xml->queryNode("EVN");
$PID = $xml->queryNode("PID");
<?php

/**
 * $Id: do_consult_anesth_aed.php 19253 2013-05-24 07:18:23Z aurelie17 $
 *
 * @package    Mediboard
 * @subpackage dPcabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 19253 $
 */
if ($chir_id = CValue::post("chir_id")) {
    CValue::setSession("chir_id", $chir_id);
}
$do = new CDoObjectAddEdit("CConsultAnesth");
$do->doIt();
Exemple #23
0
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage System
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkAdmin();
// for now
$data = CValue::post("data");
$data = stripslashes($data);
mbLog(json_decode($data, true));
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage dPhospi
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkAdmin();
$original_trigger_code = CValue::post("original_trigger_code");
$do_it = CValue::post("do_it");
$count = CValue::post("count", 10);
$auto = CValue::post("auto");
$request = new CRequest();
$request->addSelect(array("CAST(GROUP_CONCAT(movement_id) AS CHAR) AS ids", "original_trigger_code", "start_of_movement", "sejour_id"))->addTable("movement")->addWhere(array("original_trigger_code" => "= '{$original_trigger_code}'"))->addGroup(array("original_trigger_code", "start_of_movement", "sejour_id"))->addHaving("COUNT(movement_id) > 1");
if ($do_it) {
    $request->setLimit($count);
}
$mov = new CMovement();
$query = $request->makeSelect();
$list = $mov->_spec->ds->loadList($query);
if (!$do_it) {
    CAppUI::setMsg(count($list) . " doublons à traiter");
} else {
    foreach ($list as $_mvt) {
        $ids = explode(",", $_mvt["ids"]);
        sort($ids);
        // IMPORTANT, must use the first movement created as a reference
<?php

/**
 * $Id$
 *  
 * @category Forms
 * @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
 */
$event_name = CValue::post("event_name");
$object_class = CValue::post("object_class");
$form_name = CValue::post("form_name");
$ids = CValue::post("ids");
CSessionHandler::writeClose();
//CExObject::$_load_lite = true;
$ex_class_event = new CExClassEvent();
$ds = $ex_class_event->getDS();
$group_id = CGroups::loadCurrent()->_id;
$where = array("ex_class_event.host_class" => $ds->prepare("=%", $object_class), "ex_class_event.event_name" => $ds->prepare("=%", $event_name), "ex_class.conditional" => $ds->prepare("=%", 0), $ds->prepare("ex_class.group_id = % OR ex_class.group_id IS NULL", $group_id));
$ljoin = array("ex_class" => "ex_class.ex_class_id = ex_class_event.ex_class_id");
/** @var CExClassEvent[] $ex_class_events */
$ex_class_events = $ex_class_event->loadList($where, null, null, null, $ljoin);
$ex_classes = array();
$ex_objects = array();
$count_available = count($ex_class_events);
foreach ($ex_class_events as $_ex_class_event) {
    $_ex_class = $_ex_class_event->loadRefExClass();
    $_ex_class->getFormulaField();
Exemple #26
0
<?php

/**
 * $Id$
 *
 * @category Files
 * @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
 */
$file_data = base64_decode(CValue::post("file_data"));
$pdf_path = CValue::post("pdf_path");
$temp_name_from = tempnam("./tmp", "from");
file_put_contents($temp_name_from, $file_data);
$path_python = CAppUI::conf("dPfiles CFile python_path") ? CAppUI::conf("dPfiles CFile python_path") . "/" : "";
$res = exec("{$path_python}python ./modules/dPfiles/script/doctopdf.py {$temp_name_from} {$pdf_path}");
@unlink($temp_name_from);
echo $res;
Exemple #27
0
/**
 * Envoi d'un docitem par mail
 *
 * @category CompteRendu
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  SVN: $Id:\$
 * @link     http://www.mediboard.org
 */
CCanDo::checkRead();
$nom = CValue::post("nom");
$email = CValue::post("email");
$subject = CValue::post("subject");
$body = CValue::post("body");
$object_guid = CValue::post("object_guid");
$object = CMbObject::loadFromGuid($object_guid);
/** @var $exchange_source CSourceSMTP */
$exchange_source = CExchangeSource::get("mediuser-" . CMediusers::get()->_id, "smtp");
$exchange_source->init();
if (CAppUI::pref('hprim_med_header')) {
    $body = $object->makeHprimHeader($exchange_source->email, $email) . "\n" . $body;
}
try {
    $exchange_source->setRecipient($email, $nom);
    $exchange_source->setSubject($subject);
    $exchange_source->setBody(nl2br($body));
    switch ($object->_class) {
        case "CCompteRendu":
            /** @var $object CCompteRendu */
            $object->makePDFpreview(true);
Exemple #28
0
<?php

/**
 * dPccam
 *
 * @category Ccam
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  SVN: $Id: do_favoris_aed.php 19221 2013-05-21 14:24:43Z rhum1 $
 * @link     http://www.mediboard.org
 */
$do = new CDoObjectAddEdit("CFavoriCCAM", "favoris_id");
// Amélioration des textes
if ($favori_user = CValue::post("favoris_user")) {
    $user = new CMediusers();
    $user->load($favori_user);
    $for = " pour {$user->_view}";
    $do->createMsg .= $for;
    $do->modifyMsg .= $for;
    $do->deleteMsg .= $for;
}
$do->redirect = null;
$do->doIt();
if (CAppUI::pref("new_search_ccam") == 1) {
    echo CAppUI::getMsg();
    CApp::rip();
}
Exemple #29
0
<?php

/**
 * $Id: ajax_login_as.php 20443 2013-09-23 13:48:21Z phenxdesign $
 *
 * @category Admin
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision: 20443 $
 * @link     http://www.mediboard.org
 */
$user = CUser::get();
$username = trim(CValue::post('username'));
$password = trim(CValue::post('password'));
// If substitution happens when a session is locked
$is_locked = CValue::get("is_locked");
if ($is_locked) {
    $_SESSION['locked'] = false;
}
$ldap_connection = CAppUI::conf("admin LDAP ldap_connection");
$allow_login_as_ldap = CAppUI::conf("admin LDAP allow_login_as_admin");
if (!$username) {
    CAppUI::setMsg("Auth-failed-nousername", UI_MSG_ERROR);
} else {
    if ($user->user_type == 1 && (!$ldap_connection || $allow_login_as_ldap)) {
        // If admin: no need to give a password
        $_REQUEST['loginas'] = $username;
        CAppUI::login();
    } else {
        if (!$password) {
        if ($msg = $affectation_personnel->store()) {
            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}");