本文整理汇总了PHP中CMbObject::loadFromGuid方法的典型用法代码示例。如果您正苦于以下问题:PHP CMbObject::loadFromGuid方法的具体用法?PHP CMbObject::loadFromGuid怎么用?PHP CMbObject::loadFromGuid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMbObject
的用法示例。
在下文中一共展示了CMbObject::loadFromGuid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkForSejour
/**
* check access for a sejour
*
* @param string|CMbObject $sejour
*/
static function checkForSejour($sejour, $modal = true)
{
if (is_string($sejour)) {
$sejour = CMbObject::loadFromGuid($sejour);
}
$canAccess = CBrisDeGlace::checkForSejour($sejour, $modal);
CLogAccessMedicalData::logForSejour($sejour);
return $canAccess;
}
示例2: mbGetObjectFromGetOrSession
/**
* 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;
}
示例3: str_replace
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version SVN: $Id:$
* @link http://www.mediboard.org
*/
CCanDo::checkAdmin();
$exchange_guid = CValue::post("exchange_guid");
$_message = CValue::post("_message");
$segment_terminator = CValue::post("segment_terminator");
$_message = str_replace("\\\\", "\\", $_message);
$_message = str_replace('\\"', '"', $_message);
$map = array("CR" => "\r", "LF" => "\n", "CRLF" => "\r\n");
$segment_terminator = CValue::read($map, $segment_terminator);
if ($segment_terminator) {
$lines = preg_split("/(\r\n|\r|\n)/", $_message);
$_message = implode($segment_terminator, $lines);
}
/**
* @var CExchangeDataFormat
*/
$exchange = CMbObject::loadFromGuid($exchange_guid);
if ($exchange->_id) {
$exchange->_message = $_message;
if ($msg = $exchange->store()) {
CAppUI::setMsg($msg, UI_MSG_ERROR);
} else {
CAppUI::setMsg("{$exchange->_class}-msg-modify");
}
}
echo CAppUI::getMsg();
CApp::rip();
示例4: loadRefSource
/**
* Charge la source d'impression
*
* @return CSourcePrinter
*/
function loadRefSource()
{
$source_guid = $this->object_class . '-' . $this->object_id;
return $this->_ref_source = CMbObject::loadFromGuid($source_guid);
}
示例5: CFile
$draw_id = CValue::get('id');
$context_guid = CValue::get("context_guid");
$draw = new CFile();
$draw->load($draw_id);
$draw->loadRefsNotes();
$draw->loadRefAuthor();
$draw->loadRefsNotes();
$draw->getBinaryContent();
$user = CMediusers::get();
$user->loadRefFunction();
$functions = $user->loadRefsSecondaryFunctions();
$admin = $user->isAdmin();
$files_in_context = array();
$object = null;
if ($context_guid) {
$object = CMbObject::loadFromGuid($context_guid);
if ($object->_id) {
$object->loadRefsFiles();
foreach ($object->_ref_files as $file_id => $_file) {
if (strpos($_file->file_type, "image/") === false || $_file->file_type == "image/fabricjs" || $_file->annule) {
unset($object->_ref_files[$file_id]);
}
}
}
}
// creation
if (!$draw->_id) {
// author = self
$draw->author_id = $user->_id;
$draw->_ref_author = $user;
$draw->file_type = "image/svg+xml";
示例6: array
$const_id = CValue::get('const_id', 0);
$context_guid = CValue::get('context_guid');
$patient_id = CValue::get('patient_id');
$can_edit = CValue::get('can_edit');
$selection = CValue::get('selection');
$host_guid = CValue::get('host_guid');
$display_graph = CValue::get('display_graph', 1);
$unique_id = CValue::get('unique_id', '');
$context = null;
if ($context_guid) {
$context = CMbObject::loadFromGuid($context_guid);
}
/** @var CGroups|CService|CRPU $host */
// On cherche le meilleur "herbegement" des constantes, pour charger les configuration adequat
if ($host_guid) {
$host = CMbObject::loadFromGuid($host_guid);
} else {
$host = CConstantesMedicales::guessHost($context);
}
$show_cat_tabs = CConstantesMedicales::getHostConfig("show_cat_tabs", $host);
$show_enable_all_button = CConstantesMedicales::getHostConfig("show_enable_all_button", $host);
$dates = array();
if (!$selection) {
$selection = CConstantesMedicales::getConstantsByRank('form', true, $host);
} else {
$selection = CConstantesMedicales::selectConstants($selection, 'form');
}
foreach (CConstantesMedicales::$list_constantes as $key => $cst) {
$dates["{$key}"] = CMbDT::format(null, '%d/%m/%y');
}
$patient_id = $constantes->patient_id ? $constantes->patient_id : $patient_id;
示例7:
<?php
/**
* $Id$
*
* @category dPurgences
* @package Mediboard
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
* @link http://www.mediboard.org
*/
$sejour_guid = CValue::post("sejour_guid");
/** @var CSejour $sejour */
$sejour = CMbObject::loadFromGuid($sejour_guid);
if ($sejour && !$sejour->_id) {
CAppUI::setMsg("Sejour non renseigné", UI_MSG_ERROR);
}
$rpu = $sejour->loadRefRPU();
$sejour_mutation = $rpu->loadRefSejourMutation();
//Envoie d'un A07 que si le A06 a été envoyé
if ($sejour->sortie_reelle) {
$sejour_mutation->_cancel_hospitalization = true;
}
//On annule le relicat
$sejour->mode_sortie = "";
$sejour->entree_reelle = "";
$sejour->annule = "1";
if ($msg = $sejour->store()) {
CAppUI::setMsg($msg, UI_MSG_ERROR);
return;
示例8: getForObject
/**
* Get events for an object
*
* @param CMbObject|string $object Object or GUID
* @param string $event_name Event name
* @param string $type Type: required, disabled or conditional
* @param array $exclude_ex_class_event_ids List of class events' ids
*
* @return CExClassEvent[]
*/
static function getForObject($object, $event_name, $type = "required", $exclude_ex_class_event_ids = array())
{
static $events_cache = array();
if (is_string($object)) {
$object = CMbObject::loadFromGuid($object);
}
if ($type == "required" && !CValue::read($object->_spec->events[$event_name], "auto", false)) {
return array();
}
$ex_class_event = new self();
$group_id = CGroups::loadCurrent()->_id;
$ds = $ex_class_event->_spec->ds;
$key = "{$object->_class}/{$event_name}/{$group_id}/{$type}";
if (isset($events_cache[$key])) {
$ex_class_events = $events_cache[$key];
} else {
$where = array("ex_class_event.host_class" => $ds->prepare("=%", $object->_class), "ex_class_event.event_name" => $ds->prepare("=%", $event_name), "ex_class_event.disabled" => $ds->prepare("=%", 0), "ex_class.conditional" => $ds->prepare("=%", 0), $ds->prepare("ex_class.group_id = % OR group_id IS NULL", $group_id));
$ljoin = array("ex_class" => "ex_class.ex_class_id = ex_class_event.ex_class_id");
switch ($type) {
case "disabled":
$where["ex_class_event.disabled"] = 1;
break;
case "conditional":
$where["ex_class.conditional"] = 1;
break;
}
/** @var CExClassEvent[] $ex_class_events */
$ex_class_events = $ex_class_event->loadList($where, null, null, null, $ljoin);
$events_cache[$key] = $ex_class_events;
}
foreach ($ex_class_events as $_id => $_ex_class_event) {
if (isset($exclude_ex_class_event_ids[$_id]) || !$_ex_class_event->checkConstraints($object)) {
unset($ex_class_events[$_id]);
} else {
$_ex_class_event->_host_object = $object;
}
}
return $ex_class_events;
}
示例9: loadTargetObject
/**
* Load target object, similar to CMbMetaObject's
*
* @return CMbObject
*/
function loadTargetObject()
{
$this->loadRefExClassEvent();
$this->completeField("field", "value");
if (!$this->_id) {
return $this->_ref_target_object = new CMbObject();
}
$ref_object = new $this->_ref_ex_class_event->host_class();
$spec = $this->resolveSpec($ref_object);
if ($spec instanceof CRefSpec && $this->value && preg_match("/[a-z][a-z0-9_]+-[0-9]+/i", $this->value)) {
$this->_ref_target_object = CMbObject::loadFromGuid($this->value);
} else {
// empty object
$this->_ref_target_object = new CMbObject();
}
$this->_ref_target_spec = $spec;
return $this->_ref_target_object;
}
示例10: CReglement
<?php
/**
* $Id: ajax_reglements_fact_etab.php 28346 2015-05-21 08:49:27Z aurelie17 $
*
* @package Mediboard
* @subpackage dPfacturation
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision: 28346 $
*/
CCanDo::checkEdit();
$facture_guid = CValue::get("object_guid");
/* @var CFactureEtablissement $facture*/
$facture = CMbObject::loadFromGuid($facture_guid);
$facture->loadRefsObjects();
$facture->updateMontants();
$facture->loadRefsReglements();
// Ajout de reglements
$facture->_new_reglement_patient = new CReglement();
$facture->_new_reglement_patient->setObject($facture);
$facture->_new_reglement_patient->montant = $facture->_du_restant;
$use_mode_default = CAppUI::conf("dPfacturation CReglement use_mode_default");
$facture->_new_reglement_patient->mode = $use_mode_default != "none" ? $use_mode_default : "autre";
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("facture", $facture);
$smarty->assign("reload", 1);
$smarty->display("inc_vw_reglements_etab.tpl");
示例11: CCodageCCAM
*
* @package Mediboard
* @subpackage ccam
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
* @link http://www.mediboard.org
*/
$praticien_id = CValue::get('praticien_id');
$codable_class = CValue::get('codable_class');
$codable_id = CValue::get('codable_id');
$date = Cvalue::get('date');
$lock = CValue::get('lock', 1);
$user = CMediusers::get();
/** @var CCodable $codable */
$codable = CMbObject::loadFromGuid("{$codable_class}-{$codable_id}");
$codage = CCodageCCAM::get($codable, $praticien_id, 1, $date);
if (CAppUI::conf('ccam CCodable lock_codage_ccam') != 'password' && $codable_class != 'CSejour') {
$codage = new CCodageCCAM();
$codage->praticien_id = $praticien_id;
$codage->codable_class = $codable_class;
$codage->codable_id = $codable_id;
$codages = $codage->loadMatchingList();
foreach ($codages as $_codage) {
$_codage->locked = $lock;
$_codage->store();
}
$msg = $lock ? 'CCodageCCAM-msg-codage_locked' : 'CCodageCCAM-msg-codage_unlocked';
CAppUI::setMsg($msg, UI_MSG_OK);
echo CAppUI::getMsg();
CApp::rip();
示例12: onAfterMerge
/**
* Trigger after event merge
*
* @param CMbObject $mbObject Object
*
* @throws CMbException
*
* @return bool
*/
function onAfterMerge(CMbObject $mbObject)
{
if (!$this->isHandled($mbObject)) {
return false;
}
$patient = $mbObject;
$patient->check();
$patient->updateFormFields();
$receiver = $mbObject->_receiver;
// Si Client
if (!CAppUI::conf('sip server')) {
foreach ($mbObject->_fusion as $group_id => $infos_fus) {
if ($receiver->group_id != $group_id) {
continue;
}
/** @var CInteropSender $sender */
$sender = $mbObject->_eai_sender_guid ? CMbObject::loadFromGuid($mbObject->_eai_sender_guid) : null;
if ($sender && $sender->group_id == $receiver->group_id) {
continue;
}
$patient1_ipp = $patient->_IPP = $infos_fus["patient1_ipp"];
$patient_eliminee = $infos_fus["patientElimine"];
$patient2_ipp = $patient_eliminee->_IPP = $infos_fus["patient2_ipp"];
// Cas 0 IPP : Aucune notification envoyée
if (!$patient1_ipp && !$patient2_ipp) {
continue;
}
// Cas 1 IPP : Pas de message de fusion mais d'une modification du patient
if (!$patient1_ipp && $patient2_ipp || $patient1_ipp && !$patient2_ipp) {
if ($patient2_ipp) {
$patient->_IPP = $patient2_ipp;
}
$this->sendEvenementPatient("CHPrimXMLEnregistrementPatient", $patient);
continue;
}
// Cas 2 IPPs : Message de fusion
if ($patient1_ipp && $patient2_ipp) {
$patient->_patient_elimine = $patient_eliminee;
$this->sendEvenementPatient("CHPrimXMLFusionPatient", $patient);
continue;
}
}
}
return true;
}
示例13: array
}
$lettre = CValue::get("lettre");
$category_id = CValue::getOrSession("category_id", CAppUI::conf('dPmedicament CBcbProduitLivretTherapeutique product_category_id'));
$listProduits = array();
// Chargement des functions
$function = new CFunctions();
$functions = $function->loadSpecialites(PERM_EDIT);
// Si on est admin ou que $functions contient plus d'un élément,
// on récupère la fonction en session
if (CAppUI::$user->isAdmin() || count($functions) > 1) {
$function_guid = CValue::getOrSession("function_guid", reset($functions)->_guid);
} else {
// Sinon, c'est la fonction de l'utilisateur
$function_guid = "CFunctions-" . CAppUI::$user->function_id;
}
$function = CMbObject::loadFromGuid($function_guid);
// Chargement des produits du livret therapeutique
$produits_livret = CBcbProduit::loadRefLivretTherapeutique($function->_guid);
$tabLettre = range('A', 'Z');
// --- Chargement de l'arbre ATC ---
$codeATC = CValue::get("codeATC");
$classeATC = new CBcbClasseATC();
$chapitreATC = $codeATC ? $classeATC->getLibelle($codeATC) : '';
// Nom du chapitre selectionné
$arbreATC = $classeATC->loadArbre($codeATC);
// Chargements des sous chapitres
$categories = array();
if (CModule::getActive("dPstock")) {
$category = new CProductCategory();
$categories = $category->loadList(null, "name");
}
示例14: CFile
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
* @link http://www.mediboard.org
*/
$default_disposition = CValue::get("disposition", CAppUI::pref("mozaic_disposition", "2x2"));
$context = CValue::get("context_guid");
$doc = new CFile();
$doc->canDo();
if (!$doc->_can->edit) {
CAppUI::stepAjax("pas le droit de créer un CFile", UI_MSG_ERROR);
}
if (!$context) {
CAppUI::stepAjax("no_context_provided", UI_MSG_ERROR);
}
$context = CMbObject::loadFromGuid($context);
if (!$context->_id) {
CAppUI::stepAjax("unexisting", UI_MSG_ERROR);
}
$context->canDo();
if (!$context->_can->read) {
CAppUI::stepAjax("No right", UI_MSG_ERROR);
}
switch ($context->_class) {
case 'CPatient':
$patient = $context;
break;
case 'CSejour':
/** @var CSejour $context */
$patient = $context->loadRefPatient();
break;
示例15: json_decode
<?php
/**
* $Id$
*
* @package Mediboard
* @subpackage patients
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
* @link http://www.mediboard.org
*/
$selection = json_decode(stripslashes(CValue::get('constants', '[]')));
$patient_id = CValue::get('patient_id');
$context_guid = CValue::get('context_guid');
$period = CValue::get('period', 'month');
$patient = CMbObject::loadFromGuid("CPatient-{$patient_id}");
$smarty = new CSmartyDP();
$smarty->assign('patient', $patient);
$smarty->assign('context_guid', $context_guid);
$smarty->assign('constants', json_encode($selection));
$smarty->assign('period', $period);
$smarty->display('inc_select_constants_graph_period.tpl');