本文整理汇总了PHP中CValue::first方法的典型用法代码示例。如果您正苦于以下问题:PHP CValue::first方法的具体用法?PHP CValue::first怎么用?PHP CValue::first使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CValue
的用法示例。
在下文中一共展示了CValue::first方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getValue
/**
* @see parent::getValue()
*/
function getValue($object, $smarty = null, $params = array())
{
include_once $smarty->_get_plugin_filepath('modifier', 'date_format');
$propValue = $object->{$this->fieldName};
$format = CValue::first(@$params["format"], CAppUI::conf("time"));
return $propValue ? smarty_modifier_date_format($propValue, $format) : "";
}
示例2: getValue
/**
* @see parent::getValue()
*/
function getValue($object, $smarty = null, $params = array())
{
if ($smarty) {
include_once $smarty->_get_plugin_filepath('modifier', 'date_format');
}
$propValue = $object->{$this->fieldName};
$format = CValue::first(@$params["format"], CAppUI::conf("date"));
return $propValue && $propValue != "0000-00-00" ? $this->progressive ? $this->progressiveFormat($propValue) : smarty_modifier_date_format($propValue, $format) : "";
// TODO: test and use strftime($format, strtotime($propValue)) instead of smarty
}
示例3: updateFormFields
/**
* @see parent::updateFormFields()
*/
function updateFormFields()
{
$this->_query_params_get = $get = json_decode($this->query_params_get, true);
$this->_query_params_post = $post = json_decode($this->query_params_post, true);
$this->_session_data = $session = json_decode($this->session_data, true);
$get = is_array($get) ? $get : array();
$post = is_array($post) ? $post : array();
$this->_module = CValue::first(CMbArray::extract($get, "m"), CMbArray::extract($post, "m"));
$this->_action = CValue::first(CMbArray::extract($get, "tab"), CMbArray::extract($get, "a"), CMbArray::extract($post, "dosql"));
}
示例4: syncPatient
function syncPatient($update = true)
{
$medecin_id = $this->consume("medecin_id");
// Gestion des id400
$tag = "medecin-patient";
$idex = new CIdSante400();
$idex->object_class = "CPatient";
$idex->id400 = $medecin_id;
$idex->tag = $tag;
// Identité
$patient = new CPatient();
$patient->nom = $this->consume("nom");
$patient->prenom = CValue::first($this->consume("prenom"), $patient->nom);
// Simulation de l'âge
$year = 1980 - strlen($patient->nom);
$month = '01';
$day = str_pad(strlen($patient->prenom) % 30, 2, '0', STR_PAD_LEFT);
$patient->naissance = "{$year}-{$month}-{$day}";
// Binding
$this->trace($patient->getProperties(true), "Patient à enregistrer");
$idex->bindObject($patient);
$this->markStatus(self::STATUS_PATIENT);
}
示例5: ccmu_cmp
function ccmu_cmp($sejour1, $sejour2)
{
$ccmu1 = CValue::first($sejour1->_ref_rpu->ccmu, "9");
$ccmu2 = CValue::first($sejour2->_ref_rpu->ccmu, "9");
if ($ccmu1 == "P") {
$ccmu1 = "1";
}
if ($ccmu2 == "P") {
$ccmu2 = "1";
}
return $ccmu2 - $ccmu1;
}
示例6: substr
if ($limit_char_search = CAppUI::conf("dPpatients CPatient limit_char_search")) {
$patient_nom_search = substr($patient_nom_search, 0, $limit_char_search);
$patient_prenom_search = substr($patient_prenom_search, 0, $limit_char_search);
}
if ($patient_nom_search) {
$patient_nom_soundex = $soundexObj->build($patient_nom_search);
$where[] = "`nom` LIKE '{$patient_nom_search}%' OR `nom_jeune_fille` LIKE '{$patient_nom_search}%'";
$whereSoundex[] = "`nom_soundex2` LIKE '{$patient_nom_soundex}%' OR `nomjf_soundex2` LIKE '{$patient_nom_soundex}%'";
}
if ($patient_prenom_search) {
$patient_prenom_soundex = $soundexObj->build($patient_prenom_search);
$where["prenom"] = "LIKE '{$patient_prenom_search}%'";
$whereSoundex["prenom_soundex2"] = "LIKE '{$patient_prenom_soundex}%'";
}
if ($patient_year || $patient_month || $patient_day) {
$patient_naissance = CValue::first($patient_year, "%") . "-" . CValue::first($patient_month, "%") . "-" . CValue::first($patient_day, "%");
$where["naissance"] = $whereSoundex["naissance"] = "LIKE '{$patient_naissance}'";
}
if ($patient_sexe) {
$where["sexe"] = $whereSoundex["sexe"] = "= '{$patient_sexe}'";
}
if ($patient_ville) {
$where["ville"] = $whereSoundex["ville"] = "LIKE '{$patient_ville}%'";
}
if ($patient_cp) {
$where["cp"] = $whereSoundex["cp"] = "LIKE '{$patient_cp}%'";
}
if ($prat_id) {
$ljoin["consultation"] = "`consultation`.`patient_id` = `patients`.`patient_id`";
$ljoin["plageconsult"] = "`plageconsult`.`plageconsult_id` = `consultation`.`plageconsult_id`";
$ljoin["sejour"] = "`sejour`.`patient_id` = `patients`.`patient_id`";
示例7: buildStat
/**
* Recursive stat building for given files
*
* @param string $basedir Base directory of the node
* @param string|string[] $file File or file collection of the node
*
* @return array|mixed
*/
function buildStat($basedir, $file)
{
$stat = array();
// Directory case
if (is_array($file)) {
$stats = array();
foreach ($file as $filename => $basename) {
$stats[] = $this->buildStat("{$basedir}/{$filename}", $basename);
}
$stat = call_user_func_array("array_merge_recursive", $stats);
return $this->stats[CValue::first($basedir, "-root-")] = $stat;
}
// File case
$subpath = "{$basedir}";
$report = $this->makeReportPath($subpath, "json");
if (is_file($report)) {
$stat = json_decode(file_get_contents($report), true);
}
if (!is_array($stat)) {
$stat = array();
}
return $this->stats[$subpath] = $stat;
}
示例8: CPatient
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
*/
CCanDo::checkAdmin();
if (!CAppUI::conf("sip export_dest")) {
CAppUI::stepAjax("Aucun destinataire de défini pour l'export.", UI_MSG_ERROR);
}
// Si pas de tag patient
if (!CAppUI::conf("dPpatients CPatient tag_ipp")) {
CAppUI::stepAjax("Aucun tag patient de défini.", UI_MSG_ERROR);
}
// Filtre sur les enregistrements
$patient = new CPatient();
$action = CValue::get("action", "start");
// Tous les départs possibles
$idMins = array("start" => "000000", "continue" => CValue::getOrSession("idContinue"), "retry" => CValue::getOrSession("idRetry"));
$idMin = CValue::first(@$idMins[$action], "000000");
CValue::setSession("idRetry", $idMin);
// Requêtes
$where = array();
$where[$patient->_spec->key] = "> '{$idMin}'";
$sip_config = CAppUI::conf("sip");
// Bornes
if ($export_id_min = $sip_config["export_id_min"]) {
$where[] = $patient->_spec->key . " >= '{$export_id_min}'";
}
if ($export_id_max = $sip_config["export_id_max"]) {
$where[] = $patient->_spec->key . " <= '{$export_id_max}'";
}
// Comptage
$count = $patient->countList($where);
$max = $sip_config["export_segment"];
示例9: CConsultation
if ($this->_update_pause && $this->_pause && $this->_pause_repeat_time) {
$consult = new CConsultation();
$where = array();
$where["plageconsult_id"] = " = '{$this->_id}' ";
$where["patient_id"] = " IS NULL";
$consult->loadObject($where);
$consult->plageconsult_id = $this->_id;
$consult->heure = $this->_pause;
$consult->duree = $this->_pause_repeat_time;
$consult->chrono = 16;
$consult->_hour = null;
$consult->_min = null;
if ($msg = $consult->store()) {
CAppUI::stepAjax($msg, UI_MSG_WARNING);
}
}
return null;
}
}
$pcConfig = CAppUI::conf("dPcabinet CPlageconsult");
CPlageconsult::$hours_start = str_pad($pcConfig["hours_start"], 2, "0", STR_PAD_LEFT);
CPlageconsult::$hours_stop = str_pad($pcConfig["hours_stop"], 2, "0", STR_PAD_LEFT);
CPlageconsult::$minutes_interval = CValue::first($pcConfig["minutes_interval"], "15");
$hours = range($pcConfig["hours_start"], $pcConfig["hours_stop"]);
$mins = range(0, 59, CPlageconsult::$minutes_interval);
foreach ($hours as $key => $hour) {
CPlageconsult::$hours[$hour] = str_pad($hour, 2, "0", STR_PAD_LEFT);
}
foreach ($mins as $key => $min) {
CPlageconsult::$minutes[] = str_pad($min, 2, "0", STR_PAD_LEFT);
}
示例10: CMediusers
$filter->user_id = CValue::get("user_id", CAppUI::$user->_id);
$filter->_id = CValue::get("plage_id", "");
$filter->date_debut = CValue::get("date_debut", "{$year}-01-01");
$filter->date_fin = CValue::get("date_fin", "{$year}-12-31");
// load available users
$mediuser = new CMediusers();
$mediusers = $mediuser->loadListFromType();
// load ref function
foreach ($mediusers as $_medius) {
$_medius->loadRefFunction();
}
// Query
$where = array();
$where["user_id"] = CSQLDataSource::prepareIn(array_keys($mediusers), $filter->user_id);
$debut = CValue::first($filter->date_debut, $filter->date_fin);
$fin = CValue::first($filter->date_fin, $filter->date_debut);
if ($fin || $debut) {
$where["date_debut"] = "<= '{$fin}'";
$where["date_fin"] = ">= '{$debut}'";
}
$plages = $filter->loadList($where);
// Regrouper par utilisateur
$found_users = array();
$plages_per_user = array();
foreach ($plages as $_plage) {
$found_users[$_plage->user_id] = $mediusers[$_plage->user_id];
if (!isset($plages_per_user[$_plage->user_id])) {
$plages_per_user[$_plage->user_id] = 0;
}
$plages_per_user[$_plage->user_id]++;
}
示例11: array
$max = CValue::get("max", CAppUI::conf("sante400 nb_rows"));
// Load mouvements
$class = CValue::get("class");
$type = CValue::getOrSession("type");
$mouvs = array();
$count = 0;
$procs = 0;
if (!in_array($type, $types)) {
$type = null;
}
// Mouvement type (or class) provided
if ($type || $class) {
// Mouvement construction by factory
$mouv = $class ? new $class() : CMouvFactory::create($type);
if (!$mouv) {
CAppUI::stepMessage(UI_MSG_ERROR, "CMouvFactory-error-noclass", CValue::first($type, $class));
return;
}
// Initialisation d'un fichier de verrou
$class = $mouv->class;
$lock = new CMbLock("synchro_sante400/{$class}");
// Mouvements counting
$count = $mouv->count($marked);
// Mouvements loading
/** @var CMouvement400[] $mouvs */
$mouvs = array();
if ($rec = CValue::get("rec")) {
try {
$mouv->load($rec);
$mouvs = array($mouv);
} catch (Exception $e) {
示例12: foreach
$equals &= $list_fields["fields"][$_field];
}
// On complète éventuellement le séjour existant avant de le storer
if ($equals) {
foreach ($list_fields["fields"] as $_field => $_state) {
$sejour_existant->{$_field} = CValue::first($sejour_existant->{$_field}, $sejour->{$_field});
}
if (!($msg_error = $sejour_existant->store())) {
$sejour = $sejour_existant;
$sejour_ok = true;
}
// Sinon on propose à l'utilisateur de régler les problèmes
} else {
$sejour_resultat = clone $sejour;
foreach ($list_fields["fields"] as $_field => $_state) {
$sejour_resultat->{$_field} = CValue::first($sejour->{$_field}, $sejour_existant->{$_field});
}
$list_fields["object"] = $sejour;
$list_fields["object_existant"] = $sejour_existant;
$list_fields["object_resultat"] = $sejour_resultat;
}
}
} else {
$msg_error = "<strong>Impossible de sauvegarder le séjour :</strong> " . $msg_error;
}
}
if ($sejour->libelle && !$sejour_ok) {
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("praticien_id", $praticien_id);
$smarty->assign("list_fields", $list_fields);
示例13: addIntervention
function addIntervention($elParent, COperation $operation, $referent = null, $light = false)
{
$identifiant = $this->addElement($elParent, "identifiant");
$this->addElement($identifiant, "emetteur", $operation->_id);
$last_idex = $operation->_ref_last_id400;
if (isset($last_idex->_id)) {
$this->addElement($identifiant, "recepteur", $last_idex->id400);
}
$sejour = $operation->loadRefSejour();
if (!$operation->plageop_id) {
$operation->completeField("date");
}
// Calcul du début de l'intervention
$mbOpDate = CValue::first($operation->_ref_plageop->date, $operation->date);
$time_operation = $operation->time_operation == "00:00:00" ? null : $operation->time_operation;
$mbOpHeureDebut = CValue::first($operation->debut_op, $operation->entree_salle, $time_operation, $operation->horaire_voulu, $operation->_ref_plageop->debut);
$mbOpDebut = CMbRange::forceInside($sejour->entree, $sejour->sortie, "{$mbOpDate} {$mbOpHeureDebut}");
// Calcul de la fin de l'intervention
$mbOpHeureFin = CValue::first($operation->fin_op, $operation->sortie_salle, CMbDT::addTime($operation->temp_operation, CMbDT::time($mbOpDebut)));
$mbOpFin = CMbRange::forceInside($sejour->entree, $sejour->sortie, "{$mbOpDate} {$mbOpHeureFin}");
$debut = $this->addElement($elParent, "debut");
$this->addElement($debut, "date", CMbDT::date($mbOpDebut));
$this->addElement($debut, "heure", CMbDT::time($mbOpDebut));
$fin = $this->addElement($elParent, "fin");
$this->addElement($fin, "date", CMbDT::date($mbOpFin));
$this->addElement($fin, "heure", CMbDT::time($mbOpFin));
if ($light) {
// Ajout des participants
$mbParticipants = array();
foreach ($operation->_ref_actes_ccam as $acte_ccam) {
$acte_ccam->loadRefExecutant();
$mbParticipant = $acte_ccam->_ref_executant;
$mbParticipants[$mbParticipant->user_id] = $mbParticipant;
}
$participants = $this->addElement($elParent, "participants");
foreach ($mbParticipants as $mbParticipant) {
$participant = $this->addElement($participants, "participant");
$medecin = $this->addElement($participant, "medecin");
$this->addProfessionnelSante($medecin, $mbParticipant);
}
// Libellé de l'opération
$this->addTexte($elParent, "libelle", $operation->libelle, 80);
} else {
$this->addUniteFonctionnelle($elParent, $operation);
// Uniquement le responsable de l’'intervention
$participants = $this->addElement($elParent, "participants");
$participant = $this->addElement($participants, "participant");
$medecin = $this->addElement($participant, "medecin");
$this->addProfessionnelSante($medecin, $operation->loadRefChir());
// Libellé de l'opération
$this->addTexte($elParent, "libelle", $operation->libelle, 4000);
// Remarques sur l'opération
$this->addTexte($elParent, "commentaire", CMbString::convertHTMLToXMLEntities("{$operation->materiel} - {$operation->rques}"), 4000);
// Conventionnée ?
$this->addElement($elParent, "convention", $operation->conventionne ? 1 : 0);
// TypeAnesthésie : nomemclature externe (idex)
if ($operation->type_anesth) {
$tag_hprimxml = $this->_ref_receiver->_tag_hprimxml;
$idexTypeAnesth = CIdSante400::getMatch("CTypeAnesth", $tag_hprimxml, null, $operation->type_anesth);
$this->addElement($elParent, "typeAnesthesie", $idexTypeAnesth->id400);
}
// Indicateurs
$indicateurs = $this->addElement($elParent, "indicateurs");
$dossier_medical = new CDossierMedical();
$dossier_medical->object_class = "CPatient";
$dossier_medical->object_id = $operation->loadRefPatient()->_id;
$dossier_medical->loadMatchingObject();
$antecedents = $dossier_medical->loadRefsAntecedents();
foreach ($antecedents as $_antecedent) {
$rques = CMbString::htmlspecialchars($_antecedent->rques);
$rques = CMbString::convertHTMLToXMLEntities($rques);
$this->addCodeLibelle($indicateurs, "indicateur", $_antecedent->_id, $rques);
}
// Extemporané
if ($operation->exam_extempo) {
$this->addCodeLibelle($indicateurs, "indicateur", "EXT", "Extemporané");
}
// Recours / Durée USCPO
$this->addElement($elParent, "recoursUscpo", $operation->duree_uscpo ? 1 : 0);
$this->addElement($elParent, "dureeUscpo", $operation->duree_uscpo ? $operation->duree_uscpo : null);
// Côté (droit|gauche|bilatéral|total|inconnu)
// D - Droit
// G - Gauche
// B - Bilatéral
// T - Total
// I - Inconnu
$cote = array("droit" => "D", "gauche" => "G", "bilatéral" => "B", "total" => "T", "inconnu" => "I", "haut" => "HT", "bas" => "BS");
$this->addCodeLibelle($elParent, "cote", $cote[$operation->cote], CMbString::capitalize($operation->cote));
}
}
示例14: CPrescriptionLabo
* $Id$
*
* @package Mediboard
* @subpackage Labo
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
*/
CCanDo::checkRead();
// Chargement de la prescription
$prescription = new CPrescriptionLabo();
if ($prescription->load(CValue::getOrSession("prescription_id"))) {
$prescription->loadRefsBack();
$prescription->loadClassification();
}
// Chargement du patient
$patient_id = CValue::first($prescription->patient_id, CValue::getOrSession("patient_id"));
$patient = new CPatient();
$patient->load($patient_id);
$patient->loadRefsPrescriptions(PERM_EDIT);
// Chargement de la première prescription dans le cas ou il n'y en a pas
if (!$prescription->_id && $patient->_id && count($patient->_ref_prescriptions)) {
$prescription->load(reset($patient->_ref_prescriptions)->_id);
$prescription->loadRefsBack();
$prescription->loadClassification();
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("patient", $patient);
$smarty->assign("prescription", $prescription);
$smarty->display("vw_resultats.tpl");
示例15: loadMatchingSejour
/**
* Charge le sejour ayant les traits suivants :
* - Meme patient
* - Meme praticien si praticien connu
* - Date d'entree équivalente
*
* @param bool $strict Le séjour this exclu
* @param bool $notCancel Seulement les non annulés
* @param bool $useSortie Filtrer aussi sur la date de sortie
*
* @return int|void Nombre d'occurences trouvées
*/
function loadMatchingSejour($strict = false, $notCancel = false, $useSortie = true)
{
if ($strict && $this->_id) {
$where["sejour_id"] = " != '{$this->_id}'";
}
$where["patient_id"] = " = '{$this->patient_id}'";
$this->_entree = CValue::first($this->entree_reelle, $this->entree_prevue);
if ($useSortie) {
$this->_sortie = CValue::first($this->sortie_reelle, $this->sortie_prevue);
}
if (!$this->_entree) {
return null;
}
if ($this->_entree) {
$date_entree = CMbDT::date($this->_entree);
$where[] = "DATE(entree_prevue) = '{$date_entree}' OR DATE(entree_reelle) = '{$date_entree}'";
}
if ($useSortie) {
if ($this->_sortie) {
$date_sortie = CMbDT::date($this->_sortie);
$where[] = "DATE(sortie_prevue) = '{$date_sortie}' OR DATE(sortie_reelle) = '{$date_sortie}'";
}
}
if ($notCancel) {
$where["annule"] = " = '0'";
}
if ($this->type) {
$where["type"] = " = '{$this->type}'";
}
$this->loadObject($where);
return $this->countList($where);
}