本文整理汇总了PHP中CModule::getInstalled方法的典型用法代码示例。如果您正苦于以下问题:PHP CModule::getInstalled方法的具体用法?PHP CModule::getInstalled怎么用?PHP CModule::getInstalled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CModule
的用法示例。
在下文中一共展示了CModule::getInstalled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CPatient
$rel_patient->loadIPP();
} else {
$rel_patient = new CPatient();
if ($preview) {
$rel_patient->_view = "Patient exemple";
$rel_patient->_IPP = "0123456";
$ex_object->_ref_object->_view = CAppUI::tr($ex_object->_ref_object->_class) . " test";
}
}
$ex_object->_rel_patient = $rel_patient;
}
$can_delete = false;
if ($ex_object->_id) {
$can_delete = $ex_object->owner_id == CUser::get()->_id;
}
$can_delete = $can_delete || CModule::getInstalled("forms")->canAdmin();
// Load IPP and NDA
$ref_objects = array($ex_object->_ref_object, $ex_object->_ref_reference_object_1, $ex_object->_ref_reference_object_2);
foreach ($ref_objects as $_object) {
if ($_object instanceof CPatient) {
$_object->loadIPP();
continue;
}
if ($_object instanceof CSejour) {
$_object->loadNDA();
$_object->loadRefCurrAffectation($creation_date);
continue;
}
}
/** @var CExConcept[] $concepts */
$concepts = CStoredObject::massLoadFwdRef($fields, "concept_id");
示例2: CUser
*
* @category Admin
* @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
*/
CCanDo::checkEdit();
$user = CUser::get(CValue::getOrSession("user_id"));
$user_id = CValue::getOrSession("user_id", $user->_id);
if (!$user_id) {
CAppUI::setMsg("Vous devez sélectionner un utilisateur");
CAppUI::redirect("m=admin&tab=vw_edit_users");
}
$modulesInstalled = CModule::getInstalled();
$isAdminPermSet = false;
$profile = new CUser();
if ($user->profile_id) {
$where["user_id"] = "= '{$user->profile_id}'";
$profile->loadObject($where);
}
$order = "mod_id";
//Droit de l'utilisateur sur les modules
$whereUser = array();
$whereUser["user_id"] = "= '{$user->user_id}'";
$whereProfil = array();
$whereProfil["user_id"] = "= '{$user->profile_id}'";
// DROITS SUR LES MODULES
$permModule = new CPermModule();
$permsModule = array();
示例3: upgrade
/**
* Launches module upgrade process
*
* @param string $oldRevision Revision before upgrade
* @param bool $core_upgrade True if it's a core module upgrade
*
* @return string|null New revision, null on error
*/
function upgrade($oldRevision, $core_upgrade = false)
{
/*if (array_key_exists($this->mod_version, $this->queries)) {
CAppUI::setMsg("Latest revision '%s' should not have upgrade queries", UI_MSG_ERROR, $this->mod_version);
return;
}*/
if (!array_key_exists($oldRevision, $this->queries) && !array_key_exists($oldRevision, $this->config_moves) && !array_key_exists($oldRevision, $this->functions)) {
CAppUI::setMsg("No queries, functions or config moves for '%s' setup at revision '%s'", UI_MSG_WARNING, $this->mod_name, $oldRevision);
return null;
}
// Point to the current revision
reset($this->revisions);
while ($oldRevision != ($currRevision = current($this->revisions))) {
next($this->revisions);
}
$depFailed = false;
do {
// Check for dependencies
foreach ($this->dependencies[$currRevision] as $dependency) {
$module = @CModule::getInstalled($dependency->module);
if (!$module || $module->mod_version < $dependency->revision) {
$depFailed = true;
CAppUI::setMsg("Failed module depency for '%s' at revision '%s'", UI_MSG_WARNING, $dependency->module, $dependency->revision);
}
}
if ($depFailed) {
return $currRevision;
}
// Set Time Limit
if ($this->timeLimit[$currRevision]) {
CApp::setTimeLimit($this->timeLimit[$currRevision]);
}
// Query upgrading
foreach ($this->queries[$currRevision] as $_query) {
list($query, $ignore_errors, $dsn) = $_query;
$ds = $dsn ? CSQLDataSource::get($dsn) : $this->ds;
if (!$ds->exec($query)) {
if ($ignore_errors) {
CAppUI::setMsg("Errors ignored for revision '%s'", UI_MSG_OK, $currRevision);
continue;
}
CAppUI::setMsg("Error in queries for revision '%s': see logs", UI_MSG_ERROR, $currRevision);
return $currRevision;
}
}
// Callback upgrading
foreach ($this->functions[$currRevision] as $function) {
if (!call_user_func($function)) {
$function_name = get_class($function[0]) . "->" . $function[1];
CAppUI::setMsg("Error in function '%s' call back for revision '%s': see logs", UI_MSG_ERROR, $function_name, $currRevision);
return $currRevision;
}
}
// Preferences
foreach ($this->preferences[$currRevision] as $_pref) {
list($_name, $_default, $_restricted) = $_pref;
// Former pure SQL system
// Cannot check against module version or fresh install will generate errors
if (self::isOldPrefSystem($core_upgrade)) {
$query = "SELECT * FROM `user_preferences` WHERE `pref_user` = '0' AND `pref_name` = '{$_name}'";
$result = $this->ds->exec($query);
if (!$this->ds->numRows($result)) {
$query = "INSERT INTO `user_preferences` (`pref_user` , `pref_name` , `pref_value`)\n VALUES ('0', '{$_name}', '{$_default}');";
$this->ds->exec($query);
}
} else {
$pref = new CPreferences();
$where = array();
$where["user_id"] = " IS NULL";
$where["key"] = " = '{$_name}'";
if (!$pref->loadObject($where)) {
$pref->key = $_name;
$pref->value = $_default;
$pref->restricted = $_restricted ? "1" : "0";
$pref->store();
}
}
}
// Config moves
if (count($this->config_moves[$currRevision])) {
foreach ($this->config_moves[$currRevision] as $config) {
CAppUI::setConf($config[1], CAppUI::conf($config[0]));
}
}
} while ($currRevision = next($this->revisions));
return $this->mod_version;
}
示例4: __construct
//.........这里部分代码省略.........
$this->makeRevision("0.32");
$query = "ALTER TABLE `pack`\r\n ADD `object_class` ENUM('CPatient','CConsultAnesth','COperation','CConsultation','CSejour') NOT NULL DEFAULT 'COperation';";
$this->addQuery($query);
$this->makeRevision("0.33");
$query = "UPDATE aide_saisie\r\n SET `depend_value` = `class`,\r\n `class` = 'CCompteRendu',\r\n `field` = 'source'\r\n WHERE `field` = 'compte_rendu';";
$this->addQuery($query);
$this->makeRevision("0.34");
$query = "ALTER TABLE `compte_rendu` \r\n ADD `type` ENUM ('header','body','footer'),\r\n CHANGE `valide` `valide` ENUM ('0','1'),\r\n ADD `header_id` INT (11) UNSIGNED,\r\n ADD `footer_id` INT (11) UNSIGNED,\r\n ADD INDEX (`header_id`),\r\n ADD INDEX (`footer_id`)";
$this->addQuery($query);
$this->makeRevision("0.35");
$query = "UPDATE `compte_rendu` \r\n SET `type` = 'body'\r\n WHERE `object_id` IS NULL";
$this->addQuery($query);
$this->makeRevision("0.36");
$query = "UPDATE `compte_rendu` \r\n SET `object_class` = 'CSejour'\r\n WHERE `file_category_id` = 3\r\n AND `object_class` = 'COperation'\r\n AND `object_id` IS NULL;";
$this->addQuery($query);
$this->makeRevision("0.37");
$query = "ALTER TABLE `compte_rendu` \r\n ADD `height` FLOAT;";
$this->addQuery($query);
$this->makeRevision("0.38");
$query = "ALTER TABLE `compte_rendu` \r\n ADD `group_id` INT (11) UNSIGNED;";
$this->addQuery($query);
$query = "ALTER TABLE `compte_rendu` \r\n ADD INDEX (`group_id`);";
$this->addQuery($query);
$this->makeRevision("0.39");
$this->addPrefQuery("saveOnPrint", 1);
$this->makeRevision("0.40");
$query = "UPDATE `compte_rendu` \r\n SET `source` = REPLACE(`source`, '<br style=\"page-break-after: always;\" />', '<hr class=\"pagebreak\" />')";
// attention: dans le code source de la classe Cpack, on a :
// <br style='page-break-after:always' />
// Mais FCKeditor le transforme en :
// <br style="page-break-after: always;" />
// Apres verification, c'est toujours comme ça quil a transformé, donc c'est OK.
$this->addQuery($query);
if (CModule::getInstalled('dPcabinet') && CModule::getInstalled('dPpatients')) {
$this->addDependency("dPcabinet", "0.79");
$this->addDependency("dPpatients", "0.73");
}
$this->makeRevision("0.41");
$query = "ALTER TABLE `aide_saisie` \r\n CHANGE `depend_value` `depend_value_1` VARCHAR (255),\r\n ADD `depend_value_2` VARCHAR (255);";
$this->addQuery($query);
$this->makeRevision("0.42");
$query = "ALTER TABLE `compte_rendu` \r\n ADD `etat_envoi` ENUM ('oui','non','obsolete') NOT NULL default 'non';";
$this->addQuery($query);
$this->makeRevision("0.43");
$this->setTimeLimit(1800);
$query = "ALTER TABLE `compte_rendu` \r\n CHANGE `object_class` `object_class` ENUM ('CPatient','CConsultation','CConsultAnesth','COperation','CSejour','CPrescription')\r\n NOT NULL;";
$this->addQuery($query);
$this->makeRevision("0.44");
$this->setTimeLimit(1800);
$query = "ALTER TABLE `compte_rendu` \r\n CHANGE `object_class` `object_class` VARCHAR (80) NOT NULL;";
$this->addQuery($query);
$this->makeRevision("0.45");
$query = "ALTER TABLE `liste_choix` ADD `group_id` INT (11) UNSIGNED";
$this->addQuery($query);
$query = "ALTER TABLE `liste_choix` ADD INDEX (`group_id`)";
$this->addQuery($query);
$this->makeRevision("0.46");
$query = "ALTER TABLE `aide_saisie` ADD `group_id` INT (11) UNSIGNED AFTER `function_id`";
$this->addQuery($query);
$query = "ALTER TABLE `aide_saisie` \r\n ADD INDEX (`user_id`),\r\n ADD INDEX (`function_id`),\r\n ADD INDEX (`group_id`)";
$this->addQuery($query);
$this->makeRevision("0.47");
$query = self::renameTemplateFieldQuery("Opération - personnel prévu - Panseuse", "Opération - personnel prévu - Panseur");
$this->addQuery($query);
$query = self::renameTemplateFieldQuery("Opération - personnel réel - Panseuse", "Opération - personnel réel - Panseur");
$this->addQuery($query);
示例5: array
$patient_nda = CValue::get("patient_nda");
$useVitale = CValue::get("useVitale", CModule::getActive("fse") && CAppUI::pref('LogicielLectureVitale') != 'none' ? 1 : 0);
$prat_id = CValue::get("prat_id");
$patient_sexe = CValue::get("sexe");
$useCovercard = CValue::get("usecovercard", CModule::getActive("fse") && CModule::getActive("covercard") ? 1 : 0);
$patient_nom_search = null;
$patient_prenom_search = null;
// Save history
$params = array("new" => $new, "patient_id" => $patient_id, "nom" => $patient_nom, "prenom" => $patient_prenom, "ville" => $patient_ville, "cp" => $patient_cp, "Date_Day" => $patient_day, "Date_Month" => $patient_month, "Date_Year" => $patient_year, "patient_ipp" => $patient_ipp, "patient_nda" => $patient_nda, "prat_id" => $prat_id, "sexe" => $patient_sexe);
CViewHistory::save($patient, CViewHistory::TYPE_SEARCH, $params);
$patVitale = new CPatient();
// Liste des praticiens
$prats = $mediuser->loadPraticiens();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("dPsanteInstalled", CModule::getInstalled("dPsante400"));
$smarty->assign("nom", $patient_nom);
$smarty->assign("prenom", $patient_prenom);
$smarty->assign("naissance", $patient_naissance);
$smarty->assign("ville", $patient_ville);
$smarty->assign("cp", $patient_cp);
$smarty->assign("nom_search", $patient_nom_search);
$smarty->assign("prenom_search", $patient_prenom_search);
$smarty->assign("covercard", CValue::get("covercard", ""));
$smarty->assign("sexe", $patient_sexe);
$smarty->assign("prat_id", $prat_id);
$smarty->assign("prats", $prats);
$smarty->assign("patient", $patient);
$smarty->assign("useVitale", $useVitale);
$smarty->assign("useCoverCard", $useCovercard);
$smarty->assign("patVitale", $patVitale);
示例6:
<?php
/**
* $Id: index.php 23860 2014-07-04 12:02:15Z alexis_granger $
*
* @category Soins
* @package Mediboard
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision: 23860 $
* @link http://www.mediboard.org
*/
$module = CModule::getInstalled(basename(__DIR__));
if (CAppUI::pref("vue_sejours") == "standard") {
$module->registerTab("vw_idx_sejour", TAB_READ);
} else {
$module->registerTab("vw_sejours", TAB_READ);
}
$current_group = CGroups::loadCurrent();
if (CModule::getActive('dPprescription')) {
$module->registerTab("vw_pancarte_service", TAB_READ);
$module->registerTab("vw_bilan_prescription", TAB_READ);
$module->registerTab("vw_plan_soins_service", TAB_READ);
if (CAppUI::conf("soins Other show_charge_soins", $current_group)) {
$module->registerTab("vw_ressources_soins", TAB_READ);
}
//$module->registerTab("vw_dossier_sejour" , TAB_READ);
}
if (CModule::getActive('pharmacie') && CAppUI::conf("pharmacie enable_v2") && CAppUI::conf("pharmacie Display show_dispensation_dossier_soins", $current_group)) {
$module->registerTab("vw_dispensation", TAB_READ);
}
示例7: merge
/**
* Merge an array of objects
*
* @param self[] $objects An array of CMbObject to merge
* @param bool $fast Tell wether to use SQL (fast) or PHP (slow but checked and logged) algorithm
*
* @return string|null
*/
function merge($objects, $fast = false)
{
$alternative_mode = $this->_id != null;
// Modes and object count check
if ($alternative_mode && count($objects) > 1) {
return "mergeAlternativeTooManyObjects";
}
if (!$alternative_mode && count($objects) < 2) {
return "mergeTooFewObjects";
}
// Trigger before event
$this->notify("BeforeMerge");
if (!$this->_id && ($msg = $this->store())) {
$this->notify("MergeFailure");
return $msg;
}
foreach ($objects as $object) {
$this->_merging[$object->_id] = $object;
}
foreach ($objects as &$object) {
$msg = $fast ? $this->fastTransferBackRefsFrom($object) : $this->transferBackRefsFrom($object);
if ($msg) {
$this->notify("MergeFailure");
return $msg;
}
$object_id = $object->_id;
$object->_mergeDeletion = true;
if ($msg = $object->delete()) {
return $msg;
}
// If external IDs are available, we save old objects' id as external IDs
if (CModule::getInstalled("dPsante400")) {
$idex = new CIdSante400();
$idex->setObject($this);
$idex->tag = "merged";
$idex->id400 = $object_id;
$idex->last_update = CMbDT::dateTime();
$idex->store();
}
}
// Trigger after event
$this->notify("AfterMerge");
return $this->store();
}
示例8: foreach
foreach ($listCategories as $keyCat => $_categorie) {
foreach ($fiche->_ref_items as $keyItem => $_item) {
if ($_item->ei_categorie_id == $keyCat) {
if (!isset($catFiche[$_categorie->nom])) {
$catFiche[$_categorie->nom] = array();
}
$catFiche[$_categorie->nom][] = $_item;
}
}
}
}
$user = new CMediusers();
/** @var CMediusers[] $listUsersTermine */
$listUsersTermine = $user->loadListFromType();
// Chargement de la liste des Chef de services / utilisateur
$module = CModule::getInstalled("dPqualite");
$perm = new CPermModule();
/** @var CMediusers[] $listUsersEdit */
$listUsersEdit = $user->loadListFromType(null, PERM_READ);
foreach ($listUsersEdit as $keyUser => $_user) {
if (!$perm->getInfoModule("permission", $module->mod_id, PERM_EDIT, $keyUser)) {
unset($listUsersEdit[$keyUser]);
}
}
/** @var CEiItem[] $items */
$items = array();
if ($evenements) {
$where = array();
$where["ei_categorie_id"] = " = '{$evenements}'";
$item = new CEiItem();
$items = $item->loadList($where);
示例9: foreach
$dossier_medical = $patient->loadRefDossierMedical();
if ($dossier_medical->_id) {
$dossier_medical->loadRefsAllergies();
$dossier_medical->loadRefsAntecedents();
$dossier_medical->countAntecedents();
$dossier_medical->countAllergies();
}
$sejour->loadRefPraticien();
$sejour->loadRefsOperations();
$sejour->loadRefsConsultations();
foreach ($sejour->_ref_consultations as $_consult) {
$_consult->loadRefBrancardage();
}
// personne qui a autorisé la sortie
$sejour->loadRefConfirmeUser()->loadRefFunction();
$prescription_active = CModule::getInstalled("dPprescription");
// Gestion des macro-cible seulement si prescription disponible
$cible_importante = $prescription_active;
$date_transmission = CAppUI::conf("soins synthese transmission_date_limit", $group->_guid) ? CMbDT::dateTime() : null;
$sejour->loadRefsTransmissions($cible_importante, true, false, null, $date_transmission);
$sejour->loadRefsObservations(true);
$sejour->loadRefsTasks();
$sejour->loadRefsNotes();
foreach ($sejour->_ref_tasks as $key => $_task) {
if ($_task->realise) {
unset($sejour->_ref_tasks[$key]);
continue;
}
$_task->loadRefPrescriptionLineElement();
$_task->setDateAndAuthor();
$_task->loadRefAuthor();
示例10: loadRefMediuser
/**
* @return CMediusers
*/
function loadRefMediuser()
{
$mediuser = new CMediusers();
if (CModule::getInstalled("mediusers")) {
$mediuser->load($this->_id);
$this->_ref_mediuser = $mediuser;
}
return $mediuser;
}
示例11: array
*/
CCanDo::checkEdit();
global $language;
$module = CValue::getOrSession("module", "system");
$language = CValue::getOrSession("language", "fr");
if ($module != "common") {
$classes = CModule::getClassesFor($module);
// Hack to have CModule in system locale file
if ($module == "system") {
$classes[] = "CModule";
}
} else {
$classes = array();
}
// liste des dossiers modules + common et styles
$modules = array_keys(CModule::getInstalled());
$modules[] = "common";
sort($modules);
// Dossier des traductions
$localesDirs = array();
if ($module != "common") {
$files = glob("modules/{$module}/locales/*");
foreach ($files as $file) {
$name = basename($file, ".php");
$localesDirs[$name] = $file;
}
} else {
$files = glob("locales/*/common.php");
foreach ($files as $file) {
$name = basename(dirname($file));
$localesDirs[$name] = $file;
示例12: array
$event->title .= "<small>";
$event->title .= "<br/>{$title}";
if ($function_id) {
$event->title .= " - " . $_prat->_shortview . "";
}
$event->title .= "<br/> Durée cumulée : ";
$event->title .= $_plage->_cumulative_minutes ? CMbDT::time("+ {$_plage->_cumulative_minutes} MINUTES", "00:00:00") : "—";
$event->title .= "</small>";
$event->type = $_plage->_class;
$event->datas = array("id" => $_plage->_id);
$event->css_class = $_plage->_class;
$event->setObject($_plage);
$calendar->days[$_plage->date][$_plage->_guid] = $event;
}
// plages op
if (CModule::getInstalled('dPbloc')) {
$plage = new CPlageOp();
$plages_op = $plage->loadForDays($_prat->_id, $calendar->date_min, $calendar->date_max);
/** @var CPlageOp[] $plages_op */
foreach ($plages_op as $_plage) {
$_plage->loadRefsOperations(false);
$_plage->loadRefSalle();
$event = new CPlanningEvent($_plage->_guid, $_plage->date);
$title = CAppUI::tr($_plage->_class);
if ($_plage->spec_id) {
$event->title .= "<img src=\"images/icons/user-function.png\" style=\" float:right;\" alt=\"\"/>";
}
$event->title .= "\n <strong>" . CMbDT::format($_plage->debut, "%H:%M") . " - " . CMbDT::format($_plage->fin, "%H:%M") . "</strong>\n " . count($_plage->_ref_operations) . " " . CAppUI::tr('COperation');
if (count($_plage->_ref_operations) > 1) {
$event->title .= "s";
}
示例13: array
* $Id: plage_selector.php 22873 2014-04-22 07:51:07Z mytto $
*
* @package Mediboard
* @subpackage PlanningOp
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision: 22873 $
*/
CCanDo::checkRead();
$ds = CSQLDataSource::get("std");
$chir = CValue::get("chir", 0);
$date = CValue::getOrSession("date_plagesel", CMbDT::date());
$group_id = CValue::get("group_id", CGroups::loadCurrent()->_id);
$operation_id = CValue::get("operation_id", null);
$curr_op_time = CValue::get("curr_op_time", "25:00");
$resp_bloc = CModule::getInstalled("dPbloc")->canEdit();
// Liste des mois selectionnables
$date = CMbDT::format($date, "%Y-%m-01");
$listMonthes = array();
for ($i = -6; $i <= 12; $i++) {
$curr_key = CMbDT::transform("{$i} month", $date, "%Y-%m-%d");
$curr_month = CMbDT::transform("{$i} month", $date, "%B %Y");
$listMonthes[$i]["date"] = $curr_key;
$listMonthes[$i]["month"] = $curr_month;
}
// Chargement du chirurgien
$mediChir = new CMediusers();
$mediChir->load($chir);
$mediChir->loadBackRefs("secondary_functions");
$secondary_functions = array();
foreach ($mediChir->_back["secondary_functions"] as $curr_sec_func) {
示例14: isInstalled
/**
* @see parent::isInstalled()
*/
function isInstalled()
{
// Prevents zillions of uncachable SQL queries on table existence
return CModule::getInstalled("mediusers");
}
示例15: CDoObjectAddEdit
// Need to change
if ($user->_ref_user->force_change_password) {
CAppUI::redirect("m=admin&tab=chpwd&forceChange=1");
}
if (CMbDT::dateTime("-" . CAppUI::conf("admin CUser password_life_duration")) > $user->_ref_user->user_password_last_change) {
CAppUI::redirect("m=admin&tab=chpwd&forceChange=1&lifeDuration=1");
}
}
}
// Check CSRF protection
CCSRF::checkProtection();
// do some db work if dosql is set
if ($dosql) {
// dP remover super hack
if (!CModule::getInstalled($m)) {
if (!CModule::getInstalled("dP{$m}")) {
CAppUI::redirect("m=system&a=module_missing&mod={$m}");
}
$m = "dP{$m}";
}
// controller in controllers/ directory
if (is_file("./modules/{$m}/controllers/{$dosql}.php")) {
include "./modules/{$m}/controllers/{$dosql}.php";
}
}
// Permissions checked on POST $m, but we redirect to GET $m
if ($post_request && $m_get && $m != $m_get && $m != "dP{$m_get}") {
$m = $m_get;
}
if ($class) {
$do = new CDoObjectAddEdit($class);