本文整理汇总了PHP中CStoredObject类的典型用法代码示例。如果您正苦于以下问题:PHP CStoredObject类的具体用法?PHP CStoredObject怎么用?PHP CStoredObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CStoredObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getObject
/**
* Get target object
*
* @return CMbObject
*/
function getObject()
{
if (!$this->object) {
$this->object = CStoredObject::loadFromGuid($this->object_guid);
}
if ($this->object) {
$this->object->loadComplete();
}
return $this->object;
}
示例2: CReglement
$where["reglement.object_class"] = " = 'CFactureCabinet'";
$reglement = new CReglement();
/** @var CReglement[] $reglements */
$reglements = $reglement->loadList($where, " facture_cabinet.facture_id, reglement.date", null, null, $ljoin);
$reglement = new CReglement();
// Calcul du récapitulatif
// Initialisation du tableau de reglements
$recapReglement["total"] = array("nb_consultations" => "0", "du_patient" => "0", "du_tiers" => "0", "nb_reglement_patient" => "0", "nb_reglement_tiers" => "0", "secteur1" => "0", "secteur2" => "0", "secteur3" => "0", "du_tva" => "0");
foreach (array_merge($reglement->_specs["mode"]->_list, array("")) as $_mode) {
$recapReglement[$_mode] = array("du_patient" => "0", "du_tiers" => "0", "nb_reglement_patient" => "0", "nb_reglement_tiers" => "0");
}
$listReglements = array();
$listConsults = array();
$factures = CStoredObject::massLoadFwdRef($reglements, "object_id");
$patients = CStoredObject::massLoadFwdRef($factures, "patient_id");
CStoredObject::massCountBackRefs($factures, "notes");
foreach ($reglements as $_reglement) {
$facture = $_reglement->loadRefFacture();
$facture->loadRefGroup();
$facture->loadRefsNotes();
$facture->loadRefsConsultation();
$facture->loadRefsReglements();
if (count($facture->_ref_consults)) {
if (CAppUI::conf("dPccam CCodeCCAM use_cotation_ccam")) {
foreach ($facture->_ref_consults as $_consult) {
if (!array_key_exists($_consult->_id, $listConsults)) {
$listConsults[$_consult->_id] = $_consult;
$recapReglement["total"]["secteur1"] += $_consult->secteur1;
$recapReglement["total"]["secteur2"] += $_consult->secteur2;
$recapReglement["total"]["secteur3"] += $_consult->secteur3;
$recapReglement["total"]["du_tva"] += $_consult->du_tva;
示例3: mapDocs
function mapDocs($object, $with_cancelled, $tri)
{
// Documents et fichiers
$object->loadRefsDocItems($with_cancelled);
CStoredObject::massLoadFwdRef($object->_ref_documents, "file_category_id");
foreach ($object->_ref_documents as $_doc) {
CDocumentItem::makeIconName($_doc);
$_doc->loadContent(false);
$_doc->loadRefCategory();
$_doc->_ref_object = $object;
$this->_all_docs[$this->makePrefix($tri, $object, $_doc)][] = $_doc;
}
CStoredObject::massLoadFwdRef($object->_ref_files, "file_category_id");
foreach ($object->_ref_files as $_file) {
CDocumentItem::makeIconName($_file);
$_file->loadRefCategory();
$_file->_ref_object = $object;
$this->_all_docs[$this->makePrefix($tri, $object, $_file)][] = $_file;
}
// Formulaires
$ex_link = new CExLink();
$ex_link->setObject($object);
$ex_link->level = "object";
$ex_links = $ex_link->loadMatchingList();
$ex_objects = CExLink::massLoadExObjects($ex_links);
CStoredObject::massLoadFwdRef($ex_objects, "object_id");
foreach ($ex_links as $_link) {
$_ex = $_link->loadRefExObject();
$_ex->updateCreationFields();
$object = $_ex->loadTargetObject();
$_ex->_ex_class_id = $_link->ex_class_id;
$_ex->loadRefExClass();
CDocumentItem::makeIconName($_ex->_ref_ex_class);
$this->_all_docs[$this->makePrefix($tri, $object, $_ex)][] = $_link;
}
}
示例4: CConsultation
}
/* @var CConsultation[] $consultations*/
$consultation = new CConsultation();
$consultations = $consultation->loadList($where, null, null, null, $ljoin);
$totals["consultations"] = count($consultations);
/** @var CPlageConsult[] $plages */
$plages = CStoredObject::massLoadFwdRef($consultations, "plageconsult_id");
CStoredObject::massLoadFwdRef($consultations, "sejour_id");
CStoredObject::massLoadFwdRef($consultations, "patient_id");
// Pré-chargement des users
$where = array("user_id" => CSQLDataSource::prepareIn(CMbArray::pluck($plages, "chir_id")));
$user->loadList($where);
/** @var CMediusers[] $chirs */
$chirs = CStoredObject::massLoadFwdRef($plages, "chir_id");
CStoredObject::massLoadFwdRef($chirs, "function_id");
CStoredObject::massLoadBackRefs($consultations, "actes_ccam");
foreach ($consultations as $key => $_consult) {
// Chargemement des codes CCAM
$_consult->loadExtCodesCCAM();
$codes_ccam = $_consult->_ext_codes_ccam;
// Nombre d'acte cotés par le praticien et réinitialisation du count pour le cache
$nb_actes_ccam = count($_consult->loadRefsActesCCAM());
// Aucun acte prévu ou coté
if (!count($codes_ccam) && !$_consult->_count_actes) {
$_consult->loadRefSejour();
$_consult->loadRefPraticien()->loadRefFunction();
$_consult->loadRefPatient();
continue;
}
// Actes prévus restant en suspend
$activites = CMbArray::pluck($codes_ccam, "activites");
示例5: array
}
// Can create new
if ($detail <= 0.5) {
// Loading the events
if ($ex_class_events === null) {
$_ex_class_creation = array();
$ex_class_events = array();
foreach (CExClass::$_list_cache as $_ex_class_id => $_ex_class) {
if (!$_ex_class->conditional && (!$cross_context_class || $cross_context_class == $_ex_class->cross_context_class)) {
$_ex_class_creation[] = $_ex_class_id;
}
}
$where = array("ex_class_event.ex_class_id" => $ex_class_event->getDS()->prepareIn($_ex_class_creation), "ex_class_event.disabled" => "= '0'");
/** @var CExClassEvent[] $ex_class_events_by_ref */
$ex_class_events_by_ref = $ex_class_event->loadList($where);
CStoredObject::massLoadBackRefs($ex_class_events_by_ref, "constraints");
foreach ($ex_class_events_by_ref as $_ex_class_event) {
$_key = "{$_ex_class_event->host_class}/{$_ex_class_event->ex_class_id}";
/** @var CExClassEvent[] $_ex_class_events */
if (!array_key_exists($_key, $ex_class_events)) {
$ex_class_events[$_key] = array();
}
$ex_class_events[$_key][] = $_ex_class_event;
}
}
foreach ($_ex_class_creation as $_ex_class_id) {
if (!isset($ex_class_events["{$creation_context->_class}/{$_ex_class_id}"])) {
continue;
}
$_ex_class_events = $ex_class_events["{$creation_context->_class}/{$_ex_class_id}"];
// TODO canCreateNew
示例6: COperation
*/
CCanDo::checkRead();
$praticien_id = CValue::getOrSession("praticien_id");
$function_id = CValue::getOrSession("function_id");
$filter = new COperation();
$filter->_date_min = CValue::getOrSession("_date_min", CMbDT::date("-7 day"));
$filter->_date_max = CValue::getOrSession("_date_max", CMbDT::date());
$blocs = CGroups::loadCurrent()->loadBlocs(PERM_READ, null, "nom");
$bloc_id = CValue::getOrSession("bloc_id", reset($blocs)->_id);
$bloc = new CBlocOperatoire();
$bloc->load($bloc_id);
// Récupération des opérations
$ljoin = array();
$ljoin["plagesop"] = "operations.plageop_id = plagesop.plageop_id";
$salles = $bloc->loadRefsSalles();
CStoredObject::filterByPerm($salles, PERM_READ);
$in_salles = CSQLDataSource::prepareIn(array_keys($salles));
$where = array();
$where[] = "plagesop.salle_id {$in_salles} OR operations.salle_id {$in_salles}";
$where["materiel"] = "!= ''";
$where["operations.date"] = "BETWEEN '{$filter->_date_min}' AND '{$filter->_date_max}'";
if ($praticien_id) {
$where["operations.chir_id"] = " = '{$praticien_id}'";
} elseif ($function_id) {
$mediuser = new CMediusers();
$users = $mediuser->loadProfessionnelDeSante(PERM_READ, $function_id);
$where["operations.chir_id"] = CSQLDataSource::prepareIn(array_keys($users));
}
$order = "operations.date, rank";
$operation = new COperation();
$ops = $operation->loadList($where, $order, null, null, $ljoin);
示例7: addObservationDataToTemplate
/**
* Ajoute les données des graphiques de supervision
*
* @param CTemplateManager $template The template manager
* @param CMbObject $object The host object
* @param string $name The field name
*
* @return void
*/
static function addObservationDataToTemplate(CTemplateManager $template, CMbObject $object, $name)
{
$prefix = "Supervision";
$group_id = CGroups::loadCurrent()->_id;
$results = array();
$times = array();
if ($object->_id) {
list($results, $times) = CObservationResultSet::getResultsFor($object, false);
$times = array_combine($times, $times);
}
// CSupervisionGraphAxis
$axis = new CSupervisionGraphAxis();
$ds = $axis->getDS();
$where = array("supervision_graph_axis.in_doc_template" => "= '1'", "supervision_graph.owner_class" => "= 'CGroups'", "supervision_graph.owner_id" => $ds->prepare("= ?", $group_id));
$ljoin = array("supervision_graph" => "supervision_graph.supervision_graph_id = supervision_graph_axis.supervision_graph_id");
$order = array("supervision_graph.title", "supervision_graph_axis.title");
/** @var CSupervisionGraphAxis[] $axes */
$axes = $axis->loadList($where, $order, null, null, $ljoin);
CStoredObject::massLoadFwdRef($axes, "supervision_graph_id", null, true);
foreach ($axes as $_axis) {
$_graph = $_axis->loadRefGraph();
$_series = $_axis->loadRefsSeries();
$_axis->loadRefsLabels();
$_data = array_fill_keys($times, array());
foreach ($_series as $_serie) {
$_unit_id = $_serie->value_unit_id ?: "none";
$_unit_label = $_serie->loadRefValueUnit();
if (!isset($results[$_serie->value_type_id][$_unit_id])) {
continue;
}
foreach ($results[$_serie->value_type_id][$_unit_id] as $_value) {
foreach ($times as $_time) {
if ($_value["datetime"] != $_time) {
continue;
}
$_value["unit"] = $_unit_label->label;
$_data["{$_time}"][$_serie->_id] = $_value;
break;
}
}
}
$view = "";
if (count($_data)) {
$smarty = new CSmartyDP("modules/dPsalleOp");
$smarty->assign("data", $_data);
$smarty->assign("series", $_series);
$smarty->assign("times", $times);
$view = $smarty->fetch("inc_print_observation_result_set.tpl", '', '', 0);
$view = preg_replace('`([\\n\\r])`', '', $view);
}
$template->addProperty("{$name} - {$prefix} - {$_graph->title} - {$_axis->title}", trim($view), "", false);
}
// CSupervisionTimedPicture
// CSupervisionTimedData
$data = array("CSupervisionTimedPicture", "CSupervisionTimedData");
foreach ($data as $_class) {
/** @var CSupervisionTimedPicture|CSupervisionTimedData $_object */
$_object = new $_class();
$_table = $_object->_spec->table;
$_ds = $_object->getDS();
$where = array("{$_table}.in_doc_template" => "= '1'", "{$_table}.owner_class" => "= 'CGroups'", "{$_table}.owner_id" => $_ds->prepare("= ?", $group_id));
$order = "title";
/** @var CSupervisionTimedPicture[]|CSupervisionTimedData[] $_objects */
$_objects = $_object->loadList($where, $order);
foreach ($_objects as $_timed) {
$_data = array_fill_keys($times, null);
if (!isset($results[$_timed->value_type_id])) {
continue;
}
foreach ($results[$_timed->value_type_id]["none"] as $_value) {
foreach ($times as $_time) {
if ($_value["datetime"] != $_time) {
continue;
}
if ($_value["file_id"]) {
$_file = new CFile();
$_file->load($_value["file_id"]);
$_value["datauri"] = $_file->getDataURI();
$_value["file"] = $_file;
}
$_data["{$_time}"] = $_value;
break;
}
}
$view = "";
if (count($_data)) {
$smarty = new CSmartyDP("modules/dPsalleOp");
$smarty->assign("data", $_data);
$smarty->assign("times", $times);
$smarty->assign("timed_data", true);
$view = $smarty->fetch("inc_print_observation_result_set.tpl", '', '', 0);
//.........这里部分代码省略.........
示例8: CConstantesMedicales
* $Id$
*
* @package Mediboard
* @subpackage dPpatients
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
*/
CSessionHandler::writeClose();
$const = new CConstantesMedicales();
$perms = $const->canDo();
if (!$perms->read) {
$perms->redirect();
}
$context_guid = CValue::get('context_guid');
$context = CStoredObject::loadFromGuid($context_guid);
$ranks = CConstantesMedicales::getConstantsByRank('graph', false, CConstantesMedicales::guessHost($context));
$list_cste = array();
$list_cumul = array();
$cste_nb = 0;
$cumul_nb = 0;
if (array_key_exists(1, $ranks['all'])) {
/* We only display constants with rank 1 */
foreach ($ranks['all'][1] as $_cste) {
if (substr($_cste, 0, 1) === "_") {
continue;
}
/* We display at most 4 graph with cumuled constants */
if (isset(CConstantesMedicales::$list_constantes[$_cste]['cumul_reset_config'])) {
if ($cumul_nb < 4) {
$list_cumul[] = $_cste;
示例9: array
/** @var CSejour[] $sejours */
$sejours = $sejour->loadList($where, $order, null, null, $ljoin);
$patients = CStoredObject::massLoadFwdRef($sejours, "patient_id");
CStoredObject::massLoadFwdRef($sejours, "etablissement_sortie_id");
CStoredObject::massLoadFwdRef($sejours, "service_sortie_id");
$praticiens = CStoredObject::massLoadFwdRef($sejours, "praticien_id");
$functions = CStoredObject::massLoadFwdRef($praticiens, "function_id");
CStoredObject::massLoadBackRefs($sejours, "affectations");
// Chargement optimisée des prestations
CSejour::massCountPrestationSouhaitees($sejours);
CStoredObject::massLoadBackRefs($sejours, "notes");
CStoredObject::massLoadBackRefs($patients, "dossier_medical");
$operations = CStoredObject::massLoadBackRefs($sejours, "operations", "date ASC", array("annulee" => "= '0'"));
CStoredObject::massLoadBackRefs($operations, "actes_ngap", "lettre_cle DESC");
$order = "code_association, code_acte,code_activite, code_phase, acte_id";
CStoredObject::massLoadBackRefs($operations, "actes_ccam", $order);
// Chargement des NDA
CSejour::massLoadNDA($sejours);
// Chargement des IPP
CPatient::massLoadIPP($patients);
$maternite_active = CModule::getActive("maternite");
foreach ($sejours as $sejour_id => $_sejour) {
// Filtre sur la fonction du praticien
$praticien = $_sejour->loadRefPraticien(1);
if ($filterFunction && $filterFunction != $praticien->function_id) {
unset($sejours[$sejour_id]);
continue;
}
// Chargement du patient
$_sejour->loadRefPatient();
// Chargements des notes sur le séjour
示例10: array_merge
$error_logs[] = $error_log;
$user_ids = array_merge($user_ids, $error_log->_similar_user_ids);
$list_ids = array_merge($list_ids, $error_log->_similar_ids);
}
// Load users for similar groupings
$user_ids = array_unique($user_ids);
$user = new CUser();
$users = $user->loadAll($user_ids);
} else {
$total = $error_log->countList($where);
$error_logs = $error_log->loadList($where, $order, $limit, $groupby);
$list_ids = CMbArray::pluck($error_logs, "_id");
$users = CStoredObject::massLoadFwdRef($error_logs, "user_id");
}
// Get all data
CStoredObject::massLoadFwdRef($error_logs, "stacktrace_id");
CStoredObject::massLoadFwdRef($error_logs, "param_GET_id");
CStoredObject::massLoadFwdRef($error_logs, "param_POST_id");
CStoredObject::massLoadFwdRef($error_logs, "session_data_id");
foreach ($error_logs as $_error_log) {
$_error_log->loadComplete();
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("error_logs", $error_logs);
$smarty->assign("list_ids", $list_ids);
$smarty->assign("total", $total);
$smarty->assign("start", $start);
$smarty->assign("users", $users);
$smarty->assign("group_similar", $group_similar);
$smarty->display('inc_list_error_logs.tpl');
示例11: loadBlocs
/**
* Load blocs operatoires with given permission
*
* @param int $permType Permission level
* @param bool $load_salles Load salles
* @param string $order Ordre de chargmeent SQL
* @param array $where SQL WHERE parameters
*
* @return CBlocOperatoire[]
*/
function loadBlocs($permType = PERM_READ, $load_salles = true, $order = "nom", $where = array())
{
$bloc = new CBlocOperatoire();
$whereGroup = array('group_id' => "= '{$this->_id}'");
$where = array_merge($where, $whereGroup);
/** @var CBlocOperatoire[] $blocs */
$blocs = $bloc->loadListWithPerms($permType, $where, $order);
if ($load_salles) {
CStoredObject::massLoadBackRefs($blocs, "salles", "nom");
foreach ($blocs as $_bloc) {
$_bloc->loadRefsSalles();
}
}
return $this->_ref_blocs = $blocs;
}
示例12: foreach
foreach ($consultations as $_consultation) {
if ($_consultation->sejour_id != $_sejour->_id) {
continue;
}
if ($_consultation->type == "entree") {
continue;
}
$_consultation->loadRefPraticien()->loadRefFunction();
$patients_offline[$patient->_guid]["consultations"][$_consultation->_ref_chir->function_id] = $_consultation;
}
array_multisort(CMbArray::pluck($patients_offline[$patient->_guid]["consultations"], "_datetime"), SORT_DESC, $patients_offline[$patient->_guid]["consultations"]);
// Constantes
$patients_offline[$patient->_guid]["constantes"] = "";
$cstes = array_reverse($_sejour->loadListConstantesMedicales($where_cste));
if (count($cstes)) {
CStoredObject::massLoadFwdRef($cstes, "user_id");
foreach ($cstes as $_cste) {
$_cste->loadRefUser();
}
$smarty_cstes->assign("constantes_medicales_grid", CConstantesMedicales::buildGrid($cstes, false));
$smarty_cstes->assign("sejour", $_sejour);
$patients_offline[$patient->_guid]["constantes"] = $smarty_cstes->fetch("print_constantes.tpl", '', '', 0);
}
// Plan de soins
$page_break = 0;
if (count($patients_offline[$patient->_guid]["transmissions"]) || count($patients_offline[$patient->_guid]["observations"]) || count($patients_offline[$patient->_guid]["consultations"]) || $patients_offline[$patient->_guid]["constantes"]) {
$page_break = 1;
}
$params = array("sejours_ids" => $_sejour->_id, "date" => $date, "hours_before" => "2", "hours_after" => "2", "empty_lines" => "2", "dialog" => 1, "mode_lite" => 1, "page_break" => $page_break);
$patients_offline[$patient->_guid]["plan_soins"] = CApp::fetch("soins", "offline_plan_soins", $params);
// Pour IE9 qui a des soucis avec les espaces entre une fermeture et une ouverture de td
示例13: str_replace
if (!is_dir($directory)) {
CAppUI::stepAjax("'%s' is not a directory", UI_MSG_WARNING, $directory);
return;
}
if ($files_directory && !is_dir($files_directory)) {
CAppUI::stepAjax("'%s' is not a directory", UI_MSG_WARNING, $files_directory);
return;
}
$directory = str_replace("\\\\", "\\", $directory);
$files_directory = str_replace("\\\\", "\\", $files_directory);
CValue::setSession("step", $step);
CValue::setSession("start", $start);
CValue::setSession("directory", $directory);
CValue::setSession("files_directory", $files_directory);
$step = min($step, 1000);
CStoredObject::$useObjectCache = false;
// Import ...
$iterator = new DirectoryIterator($directory);
$count_dirs = 0;
$i = 0;
foreach ($iterator as $_fileinfo) {
if ($_fileinfo->isDot()) {
continue;
}
if ($_fileinfo->isDir() && strpos($_fileinfo->getFilename(), "CPatient-") === 0) {
$i++;
if ($i <= $start) {
continue;
}
if ($i > $start + $step) {
break;
示例14: reset
$plageSel->loadRefChir();
$plageSel->loadRefRemplacant();
$plageSel->loadRefPourCompte();
$plageSel->loadRefsNotes();
$plageSel->loadRefsBack($show_annulees, true, $show_payees);
if ($plageSel->_affected && count($plageSel->_ref_consultations)) {
$firstconsult = reset($plageSel->_ref_consultations);
$_firstconsult_time = substr($firstconsult->heure, 0, 5);
$lastconsult = end($plageSel->_ref_consultations);
$_lastconsult_time = substr($lastconsult->heure, 0, 5);
}
$consults = $plageSel->_ref_consultations;
CStoredObject::massLoadFwdRef($consults, "sejour_id");
$patients = CMbObject::massLoadFwdRef($consults, "patient_id");
CStoredObject::massCountBackRefs($patients, "notes");
CStoredObject::massLoadFwdRef($consults, "categorie_id");
// Détails sur les consultation affichées
foreach ($plageSel->_ref_consultations as $keyConsult => &$consultation) {
$consultation->_ref_plageconsult = $plageSel;
$consultation->loadRefSejour();
$consultation->loadRefPatient()->loadRefsNotes();
$consultation->loadRefCategorie();
$consultation->countDocItems();
$consultation->_view = "Consult. de " . $consultation->_ref_patient->_view;
$consultation->_view .= " (" . CMbDT::format($plageSel->date, "%d/%m/%Y") . ")";
//check 3333tel
if (CModule::getActive("3333tel")) {
C3333TelTools::checkConsults($consultation, $plageSel->_ref_chir->function_id);
}
}
if ($plageSel->chir_id != $chirSel && $plageSel->remplacant_id != $chirSel && $plageSel->pour_compte_id != $chirSel) {
示例15: getSpec
/**
* @see parent::getSpec()
*/
function getSpec()
{
$spec = parent::getSpec();
$spec->dsn = 'cdarr';
$spec->incremented = false;
return $spec;
}