예제 #1
0
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é");
                }
            }
        }
    }
}
예제 #2
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();