$tarifs = array();
 $order = "description";
 $where = array();
 $where["chir_id"] = "= '{$chir->_id}'";
 $tarifs["user"] = $tarif->loadList($where, $order);
 foreach ($tarifs["user"] as $_tarif) {
     /**@var CTarif $_tarif */
     $_tarif->getPrecodeReady();
 }
 $where = array();
 $where["function_id"] = "= '{$chir->function_id}'";
 $tarifs["func"] = $tarif->loadList($where, $order);
 foreach ($tarifs["func"] as $_tarif) {
     $_tarif->getPrecodeReady();
 }
 if (CAppui::conf("dPcabinet Tarifs show_tarifs_etab")) {
     $where = array();
     $where["group_id"] = "= '" . CGroups::loadCurrent()->_id . "'";
     $tarifs["group"] = $tarif->loadList($where, $order);
     foreach ($tarifs["group"] as $_tarif) {
         $_tarif->getPrecodeReady();
     }
 }
 $consult = new CConsultation();
 if ($consult_id) {
     $consult->load($consult_id);
 }
 $smarty = new CSmartyDP();
 $smarty->assign("consult", $consult);
 $smarty->assign("sejour", $sejour);
 $smarty->assign("tarifs", $tarifs);
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
$step = CValue::get("step", 0);
$aff_pers = new CAffectationPersonnel();
$where = array();
$where["object_class"] = "= 'CPlageOp'";
$affs = $aff_pers->loadList($where, null, "{$step},1000");
/**@var $_aff CAffectationPersonnel */
foreach ($affs as $_aff) {
    $plage = $_aff->loadRefObject();
    $ops = $plage->loadBackIds("operations");
    foreach ($ops as $_op) {
        $affectation = new CAffectationPersonnel();
        $whereAff = array();
        $whereAff["personnel_id"] = "= '{$_aff->personnel_id}'";
        $whereAff["object_class"] = "= 'COperation'";
        $whereAff["object_id"] = "= '{$_op}'";
        $whereAff["parent_affectation_id"] = "IS NULL";
        if ($affectation->loadObject($whereAff)) {
            $affectation->parent_affectation_id = $_aff->_id;
            $msg = $affectation->store();
            CAppUI::stepAjax($msg ? $msg : "Affectation modifiée", $msg ? UI_MSG_ERROR : UI_MSG_OK);
        }
    }
}
CAppui::js('if (' . count($affs) . ' > 0) { 
  $V(getForm("Configure").step, parseInt($V(getForm("Configure").step))+1000);
  affUpdate();
 }');
function managePersonnel($obj)
{
    global $_iade_id, $_aideop_id, $_op_panseuse_id, $_sagefemme_id, $_manipulateur_id, $del_personnel;
    if ($_iade_id) {
        $affectation_personnel = new CAffectationPersonnel();
        $affectation_personnel->object_class = $obj->_class;
        $affectation_personnel->object_id = $obj->_id;
        $affectation_personnel->personnel_id = $_iade_id;
        if ($msg = $affectation_personnel->store()) {
            CAppUI::setMsg($msg, UI_MSG_ERROR);
        } else {
            CAppUI::setMsg("IADE ajoutée", UI_MSG_OK);
        }
    }
    if ($_aideop_id) {
        $affectation_personnel = new CAffectationPersonnel();
        $affectation_personnel->object_class = $obj->_class;
        $affectation_personnel->object_id = $obj->_id;
        $affectation_personnel->personnel_id = $_aideop_id;
        if ($msg = $affectation_personnel->store()) {
            CAppUI::setMsg($msg, UI_MSG_ERROR);
        } else {
            CAppUI::setMsg("Aide opératoire ajoutée", UI_MSG_OK);
        }
    }
    if ($_op_panseuse_id) {
        $affectation_personnel = new CAffectationPersonnel();
        $affectation_personnel->object_class = $obj->_class;
        $affectation_personnel->object_id = $obj->_id;
        $affectation_personnel->personnel_id = $_op_panseuse_id;
        if ($msg = $affectation_personnel->store()) {
            CAppUI::setMsg($msg, UI_MSG_ERROR);
        } else {
            CAppUI::setMsg("Panseuse ajoutée", UI_MSG_OK);
        }
    }
    if ($_sagefemme_id) {
        $affectation_personnel = new CAffectationPersonnel();
        $affectation_personnel->object_class = $obj->_class;
        $affectation_personnel->object_id = $obj->_id;
        $affectation_personnel->personnel_id = $_sagefemme_id;
        if ($msg = $affectation_personnel->store()) {
            CAppUI::setMsg($msg, UI_MSG_ERROR);
        } else {
            CAppUI::setMsg("Sage femme ajoutée", UI_MSG_OK);
        }
    }
    if ($_manipulateur_id) {
        $affectation_personnel = new CAffectationPersonnel();
        $affectation_personnel->object_class = $obj->_class;
        $affectation_personnel->object_id = $obj->_id;
        $affectation_personnel->personnel_id = $_manipulateur_id;
        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é");
                }
            }
        }
    }
}
示例#4
0
<?php

/**
 * $Id: vw_codes_tarif.php 19425 2013-06-04 18:04:05Z mytto $
 *
 * @package    Mediboard
 * @subpackage Cabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 19425 $
 */
CCanDo::checkEdit();
$tarif_id = CValue::getOrSession("tarif_id");
$tarif = new CTarif();
$tarif->load($tarif_id);
$tarif->loadActes();
$tab = array();
if (CAppui::conf("dPccam CCodeCCAM use_cotation_ccam")) {
    $tab["ccam"] = "_ref_code_ccam";
    $tab["ngap"] = "_libelle";
}
if (CModule::getActive("tarmed") && CAppui::conf("tarmed CCodeTarmed use_cotation_tarmed")) {
    $tab["tarmed"] = "_ref_tarmed";
    $tab["caisse"] = "_ref_prestation_caisse";
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("tarif", $tarif);
$smarty->assign("tab", $tab);
$smarty->display("vw_codes_tarif.tpl");
示例#5
0
    foreach ($tarifs["func"] as $_tarif) {
        $_tarif->getPrecodeReady();
    }
    if (CAppui::conf("dPcabinet Tarifs show_tarifs_etab")) {
        $where = array();
        $where["group_id"] = "= '" . CGroups::loadCurrent()->_id . "'";
        $tarifs["group"] = $tarif->loadList($where, $order);
        foreach ($tarifs["group"] as $_tarif) {
            $_tarif->getPrecodeReady();
        }
    }
}
//Recherche de la facture pour cette consultation
$facture = $consult->_ref_facture;
$divers = array();
if (CAppui::conf("dPccam CCodable use_frais_divers CConsultation")) {
    $divers = $consult->loadRefsFraisDivers(count($consult->_ref_factures) + 1);
    $consult->loadRefsFraisDivers(null);
}
//Si on a pas de facture on recherche d'une facture ouverte
if (!$facture->_id && CAppUI::conf("ref_pays") == 2) {
    $where = array();
    $where["patient_id"] = "= '{$consult->patient_id}'";
    $plage = $consult->_ref_plageconsult;
    $praticien_id = $plage->pour_compte_id ? $plage->pour_compte_id : $prat_id;
    $where["praticien_id"] = "= '{$praticien_id}'";
    $where["cloture"] = " IS NULL";
    $facture->loadObject($where);
}
if ($facture->_id) {
    $facture->loadRefPatient();
 /**
  * Returns the field's main locale
  *
  * @param string $field Field name
  *
  * @return string The locale
  */
 function getLocale($field)
 {
     return CAppui::tr("{$this->_class}-{$field}");
 }
示例#7
0
$name_short = CValue::post("name_short");
$name_long = CValue::post("name_long");
$license = CValue::post("license");
$licenses = array("GNU GPL" => "GNU General Public License, see http://www.gnu.org/licenses/gpl.html", "OXOL" => "OXOL, see http://www.mediboard.org/public/OXOL");
$license = CValue::read($licenses, $license, $licenses["GNU GPL"]);
// Only alphanumeric caracters
$name_canonical = preg_replace("/[^\\w\\s]/", "", $name_canonical);
$name_short = CMbString::purifyHTML($name_short);
$name_long = CMbString::purifyHTML($name_long);
if (is_dir("modules/{$name_canonical}")) {
    CAppui::stepAjax("Module '{$name_canonical}' existe déjà", UI_MSG_ERROR);
}
$zip_path = "dev/sample_module.zip";
$destination = "tmp/sample_module";
if (false == ($files_count = CMbPath::extract($zip_path, $destination))) {
    CAppui::stepAjax("Impossible d'extraire l'archive '{$zip_path}'</div>", UI_MSG_ERROR);
}
rename("{$destination}/sample_module", "{$destination}/{$name_canonical}");
$path = "{$destination}/{$name_canonical}";
$files = array_merge(glob("{$path}/*"), glob("{$path}/classes/*"), glob("{$path}/locales/*"), glob("{$path}/templates/*"));
$translate = array('{NAME_CANONICAL}' => $name_canonical, '{NAME_SHORT}' => $name_short, '{NAME_LONG}' => $name_long, '{LICENSE}' => $license);
foreach ($files as $_file) {
    if (is_dir($_file)) {
        continue;
    }
    file_put_contents($_file, strtr(file_get_contents($_file), $translate));
}
rename("{$destination}/{$name_canonical}", "modules/{$name_canonical}");
CAppUI::setMsg("Module '{$name_canonical}' créé", UI_MSG_OK);
CAppUI::js("location.reload()");
CApp::rip();
示例#8
0
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage SSR
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
$sejour_ids = CValue::post("sejour_ids");
$date_monday = CValue::post("date_monday");
$all_rhs = CValue::post("all_rhs");
$where["sejour_id"] = CSQLDataSource::prepareIn($sejour_ids);
$where["date_monday"] = $all_rhs ? ">= '{$date_monday}'" : "= '{$date_monday}'";
$order = "sejour_id, date_monday";
$rhs = new CRHS();
/** @var CRHS[] $rhss */
$rhss = $rhs->loadList($where, $order);
if (count($rhss)) {
    foreach ($rhss as $_rhs) {
        $_rhs->facture = CValue::post("facture");
        $msg = $_rhs->store();
        CAppUI::displayMsg($msg, "CRHS-msg-modify");
    }
} else {
    CAppui::setMsg("CRHS.none", UI_MSG_WARNING);
}
echo CAppUI::getMsg();
CApp::rip();