function show_task_calendar_recursive() { $calendar = new calendar(2, 20); $calendar->set_cal_person($_GET["personID"]); $calendar->set_return_mode("calendar"); $calendar->draw(); }
function show_task_calendar_recursive() { $current_user =& singleton("current_user"); $tasksGraphPlotHomeStart = $current_user->prefs["tasksGraphPlotHomeStart"]; $tasksGraphPlotHome = $current_user->prefs["tasksGraphPlotHome"]; $calendar = new calendar($tasksGraphPlotHomeStart, $tasksGraphPlotHome); $calendar->set_cal_person($current_user->get_id()); $calendar->set_return_mode("home"); $calendar->draw($template); }
/** * CALENDAR * getting default list * * @param string $httpData->PRO_UID (opional) */ public function calendarEdit($httpData) { global $RBAC; //$RBAC->requirePermissions('PM_SETUP_ADVANCE'); G::LoadClass('configuration'); G::LoadClass('calendar'); $CalendarUid = str_replace('"', '', isset($_GET['id']) ? $_GET['id'] : G::GenerateUniqueID()); $calendarObj = new calendar(); if (isset($_GET['id']) && $_GET['id'] != "") { $fields = $calendarObj->getCalendarInfoE($CalendarUid); $fields['OLD_NAME'] = $fields['CALENDAR_NAME']; } // For a new Calendar if (!isset($fields['CALENDAR_UID'])) { $fields['CALENDAR_UID'] = $CalendarUid; $fields['OLD_NAME'] = ''; //Default Business Hour $fields['BUSINESS_DAY'][1]['CALENDAR_BUSINESS_DAY'] = 7; $fields['BUSINESS_DAY'][1]['CALENDAR_BUSINESS_START'] = "09:00"; $fields['BUSINESS_DAY'][1]['CALENDAR_BUSINESS_END'] = "17:00"; } // Copy Calendar if (isset($_GET['cp']) && $_GET['cp'] == 1) { $fields['CALENDAR_UID'] = G::GenerateUniqueID(); $fields['CALENDAR_NAME'] = G::LoadTranslation("ID_COPY_OF") . " " . $fields['CALENDAR_NAME']; $fields['OLD_NAME'] = $fields['CALENDAR_NAME']; } $c = new Configurations(); $configPage = $c->getConfiguration('additionalTablesList', 'pageSize', '', $_SESSION['USER_LOGGED']); $Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20; $this->includeExtJS('admin/calendarEdit'); $this->setView('admin/calendarEdit'); $businessDayArray = array(); for ($i = 0; $i < sizeof($fields['BUSINESS_DAY']); $i++) { $businessDayArray[$i] = $fields['BUSINESS_DAY'][$i + 1]; } $fields['BUSINESS_DAY'] = $businessDayArray; //validating if the calendar is new, it means that we don't have the $_GET array $fields['HOLIDAY'] = isset($_GET['id']) && $_GET['id'] != '' ? $fields['HOLIDAY'] : array(); $holidayArray = array(); for ($i = 0; $i < sizeof($fields['HOLIDAY']); $i++) { $holidayArray[$i] = $fields['HOLIDAY'][$i + 1]; } $_GET['id'] = isset($_GET['id']) && $_GET['id'] != '' ? $_GET['id'] : ''; $fields['HOLIDAY'] = $holidayArray; $fields['NEWCALENDAR'] = 'NO'; if (isset($_GET['id']) && $_GET['id'] == '') { $fields['CALENDAR_UID'] = G::GenerateUniqueID(); $fields['NEWCALENDAR'] = 'YES'; } $this->setJSVar('CALENDAR_UID', $fields['CALENDAR_UID']); $this->setJSVar('fields', $fields); G::RenderPage('publish', 'extJs'); }
function data($msg, $params) { $arg = funcs::utfToAscii($msg->args); if (empty($arg)) { $data = time(); } else { $data = calendar::parse_date($arg); if (!$data) { return new BotMsg('Podana data nie została rozpoznana<br />' . "\n" . '<br />' . "\n" . '<u>Przykłady:</u><br />' . "\n" . 'data<br />' . "\n" . 'data pojutrze<br />' . "\n" . 'data 1.01.2009'); } } if (date('d.m.Y') == date('d.m.Y', $data)) { $txt = 'Dziś jest '; } else { $txt = 'Wybrany dzień to '; } include './data/data/data.php'; $txt .= self::$dni[date('w', $data)] . ', ' . date('j', $data) . ' ' . self::$miesiace[date('n', $data)] . ' ' . date('Y', $data) . ' r., ' . (date('z', $data) + 1) . ' dzień roku.<br />' . "\n" . '<br />' . "\n"; $msg->session->setClass('pogoda'); if (!isset($msg->session->geo)) { $geo = array('lon' => '52.25', 'lat' => '21.0'); } else { $geo = $msg->session->geo; } $txt .= 'Imieniny: ' . $imieniny[date('n', $data)][date('j', $data)] . '<br />' . "\n" . 'Wschód Słońca: ' . date_sunrise($data, SUNFUNCS_RET_STRING, $geo['lat'], $geo['lon'], 90.58, 1 + date('I')) . '<br />' . "\n" . 'Zachód Słońca: ' . date_sunset($data, SUNFUNCS_RET_STRING, $geo['lat'], $geo['lon'], 90.58, 1 + date('I')); return new BotMsg($txt); }
public function launch(Request $request, Response $response) { $response->addVar('NomPeriode', calendar::getPeriodName(time())); $response->addVar('TypeSemaineCourante', calendar::getTypeCurrentWeek()); $response->addVar('SemaineCourante', calendar::getCurrentWeek()); $this->render("./lib/template/indexSuccess.php"); $this->printOut(); }
/** * @Route("/calendar/{year}/{weekNumber}",name="calendar") * */ public function calendarAction($year = null, $month = null) { $c = new calendar(); //utlisisateurs sur le site et le mois $data = array(); //$data['absences'] = array(); $data[] = array('fullName' => 'Math Patrick DOHOU 2', 'bookings' => array(array('dateStart' => '2015-04-01', 'dateEnd' => '2015-04-31', 'startTime' => '06:00', 'endTime' => '22:00', 'commentaire' => 'bbbbbbbbbb'))); $data[] = array('fullName' => 'Jean Patrick DOHOU', 'bookings' => array(array('dateStart' => '2015-04-01', 'dateEnd' => '2015-04-03', 'startTime' => '06:00', 'endTime' => '22:00', 'commentaire' => 'bbbbbbbbbb'), array('dateStart' => '2015-04-05', 'dateEnd' => '2015-04-06', 'startTime' => '15:00', 'endTime' => '22:00', 'commentaire' => 'bbbbbbbbbb'))); $data[] = array('fullName' => 'Ame Patrick DOHOU', 'bookings' => array(array('dateStart' => '2015-04-01', 'dateEnd' => '2015-04-03', 'startTime' => '06:00', 'endTime' => '22:00', 'commentaire' => 'bbbbbbbbbb'), array('dateStart' => '2015-04-05', 'dateEnd' => '2015-04-06', 'startTime' => '15:00', 'endTime' => '22:00', 'commentaire' => 'bbbbbbbbbb'))); $data[] = array('fullName' => 'Hervé Patrick DOHOU', 'bookings' => array(array('dateStart' => '2015-04-01', 'dateEnd' => '2015-04-03', 'startTime' => '06:00', 'endTime' => '22:00', 'commentaire' => 'bbbbbbbbbb'), array('dateStart' => '2015-04-05', 'dateEnd' => '2015-04-06', 'startTime' => '15:00', 'endTime' => '22:00', 'commentaire' => 'bbbbbbbbbb'))); $data[] = array('fullName' => 'Balle Patrick DOHOU', 'bookings' => array(array('dateStart' => '2015-04-01', 'dateEnd' => '2015-04-03', 'startTime' => '06:00', 'endTime' => '22:00', 'commentaire' => 'bbbbbbbbbb'), array('dateStart' => '2015-04-05', 'dateEnd' => '2015-04-06', 'startTime' => '15:00', 'endTime' => '22:00', 'commentaire' => 'bbbbbbbbbb'))); // var_dump($data); $params = array('calendars' => $c->getDaysOfYearAndMonth(2015, 4), 'users' => $data); // hervé à travaillé : date01/04/2015 // var_dump( $c->getDaysOfYearAndMonth()); return $this->render('MyPrivSecuCalendarBundle:Calendar:calendar.html.twig', $params); }
function calender() { $cal = new calendar(); $sx = '<h1>' . msg("calender") . '</h1>'; $sx .= '<table width="100%" class="lt1" border=0>'; $data1 = date("Ym"); if (date("m") == 12) { $data2 = date("Y") + 1 . '01'; } else { $data2 = date("Ym") + 1; } /* Actual Month */ $act1 = $cal->actions($data1); $sx .= '<TR valign="top">'; $sx .= '<TD width="10%">'; $sx .= '<center><font class="lt1"><B>' . msg('month_' . substr($data1, 4, 2)) . '/' . substr($data1, 0, 4) . '</B></font>'; $sx .= $cal->calendar($data1, $act1, '#1C4161'); $sx .= '<TD width="90%">'; $sx .= $cal->actions_list($act1); /* Space */ $sx .= '<TR valign="top">'; $sx .= '<TD width="10%"> '; /* Next Month */ $act2 = $cal->actions($data2); $sx .= '<TR valign="top">'; $sx .= '<TD width="10%">'; $sx .= '<center><font class="lt1"><B>' . msg('month_' . substr($data2, 4, 2)) . '/' . substr($data2, 0, 4) . '</B></font>'; $sx .= $cal->calendar($data2, $act2, '#1C4161'); $sx .= '<TD width="90%">'; $sx .= $cal->actions_list($act2); $sx .= '</table>'; return $sx; }
/** * Initializes day calendar * * @param int $room - id from roomscheduler_rooms table * @param int $start_time - 0 to 23 representing start time of displayed content * @param int $end_time - 0 to 23 representing end time of displayed content * @param int $focus_time - focus time of calendar, defaults to time() */ public function __construct($room, $focus_time = null) { parent::__construct($room, $focus_time); //Set instance of the calendar if ($this->count == null) { $this->count = 0; } else { $this->count++; } $this->instance = 'calendar_day_' . $this->count; }
/** * initialization of some parameters */ public function init($request) { parent::init($request); if ($this->url == '') { $this->url = 'primary'; } if ($this->count == 0) { $this->count = 10; } $this->calendar_ids = explode(',', $this->url); }
/** * Initializes day calendar * * @param int $room - id from roomscheduler_rooms table * @param int $start_time - 0 to 23 representing start time of displayed content * @param int $end_time - 0 to 23 representing end time of displayed content * @param int $focus_time - focus time of calendar, defaults to time() */ public function __construct($room, $course, $start_time = 8, $end_time = 5, $focus_time = null) { parent::__construct($room, $focus_time); $this->course = $course; if ($start_time > $end_time) { $this->start_time = $end_time; $this->end_time = $start_time; } else { $this->start_time = $start_time; $this->end_time = $end_time; } //Set instance of the calendar if ($this->count == null) { $this->count = 0; } else { $this->count++; } $this->instance = 'calendar_day_' . $this->count; }
/** * Initializes day calendar * * @param int $room - id from roomscheduler_rooms table * @param int $day - UNIX time stamp representing the day wanted * @param int $start_time - 0 to 23 representing start time of displayed content * @param int $end_time - 0 to 23 representing end time of displayed content * @param int $focus_time - focus time of calendar, defaults to time() */ public function __construct($room, $day, $course, $start_time = 8, $end_time = 5, $show_toolbar = true, $focus_time = null) { parent::__construct($room, $focus_time); $this->course = $course; $this->day = $day; $this->miniCal = $day; if ($start_time > $end_time) { $this->start_time = $end_time; $this->end_time = $start_time; } else { $this->start_time = $start_time; $this->end_time = $end_time; } $this->show_toolbar = $show_toolbar; //Set instance of the calendar if ($this->count == null) { $this->count = 0; } else { $this->count++; } $this->instance = 'calendar_day_' . $this->count; }
public function validatePassword($sPassword, $sLastUpdate, $iChangePasswordNextTime) { if (!defined('PPP_MINIMUM_LENGTH')) { define('PPP_MINIMUM_LENGTH', 5); } if (!defined('PPP_MAXIMUM_LENGTH')) { define('PPP_MAXIMUM_LENGTH', 20); } if (!defined('PPP_NUMERICAL_CHARACTER_REQUIRED')) { define('PPP_NUMERICAL_CHARACTER_REQUIRED', 0); } if (!defined('PPP_UPPERCASE_CHARACTER_REQUIRED')) { define('PPP_UPPERCASE_CHARACTER_REQUIRED', 0); } if (!defined('PPP_SPECIAL_CHARACTER_REQUIRED')) { define('PPP_SPECIAL_CHARACTER_REQUIRED', 0); } if (!defined('PPP_EXPIRATION_IN')) { define('PPP_EXPIRATION_IN', 0); } if (!defined('PPP_CHANGE_PASSWORD_AFTER_NEXT_LOGIN')) { define('PPP_CHANGE_PASSWORD_AFTER_NEXT_LOGIN', 0); } if (function_exists('mb_strlen')) { $iLength = mb_strlen($sPassword); } else { $iLength = strlen($sPassword); } $aErrors = array(); if ($iLength < PPP_MINIMUM_LENGTH) { $aErrors[] = 'ID_PPP_MINIMUM_LENGTH'; } if ($iLength > PPP_MAXIMUM_LENGTH) { $aErrors[] = 'ID_PPP_MAXIMUM_LENGTH'; } if (PPP_NUMERICAL_CHARACTER_REQUIRED == 1) { if (preg_match_all('/[0-9]/', $sPassword, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE) == 0) { $aErrors[] = 'ID_PPP_NUMERICAL_CHARACTER_REQUIRED'; } } if (PPP_UPPERCASE_CHARACTER_REQUIRED == 1) { if (preg_match_all('/[A-Z]/', $sPassword, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE) == 0) { $aErrors[] = 'ID_PPP_UPPERCASE_CHARACTER_REQUIRED'; } } if (PPP_SPECIAL_CHARACTER_REQUIRED == 1) { if (preg_match_all('/[��\\!|"@�#$~%�&�\\/()=\'?��*+\\-_.:,;]/', $sPassword, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE) == 0) { $aErrors[] = 'ID_PPP_SPECIAL_CHARACTER_REQUIRED'; } } if (PPP_EXPIRATION_IN > 0) { G::LoadClass('calendar'); $oCalendar = new calendar(); if ($oCalendar->pmCalendarUid == '') { $oCalendar->pmCalendarUid = '00000000000000000000000000000001'; $oCalendar->getCalendarData(); } $fDays = $oCalendar->calculateDuration(date('Y-m-d H:i:s'), $sLastUpdate); if ($fDays > PPP_EXPIRATION_IN * 24) { $aErrors[] = 'ID_PPP_EXPIRATION_IN'; } } if (PPP_CHANGE_PASSWORD_AFTER_NEXT_LOGIN == 1) { if ($iChangePasswordNextTime == 1) { $aErrors[] = 'ID_PPP_CHANGE_PASSWORD_AFTER_NEXT_LOGIN'; } } return $aErrors; }
/* Copyright Intermesh 2003 Author: Merijn Schering <*****@*****.**> Version: 1.0 Release date: 08 July 2003 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ //date('Ymd', time()) require "../../Group-Office.php"; if ($calendar_module = $GO_MODULES->get_module('calendar')) { require $calendar_module['path'] . "classes/calendar.class.inc"; } $cal = new calendar(); require $GO_LANGUAGE->get_language_file('calendar'); //echo '1=='.$_REQUEST['event_id']; $getevent = $cal->get_event($_REQUEST['event_id']); //echo '2=='.$getevent['end_time'].'-->'.time(); if ($_SERVER['REQUEST_METHOD'] == "POST") { if (isset($_POST['calendars'])) { $cal->set_event_status($_REQUEST['event_id'], '1', $_POST['email']); while ($calendar_id = array_shift($_POST['calendars'])) { if (!$cal->event_is_subscribed($_POST['event_id'], $calendar_id)) { if ($cal->subscribe_event($_POST['event_id'], $calendar_id)) { if (!$cal->set_event_status($_POST['event_id'], '1', $_POST['email'])) { $error = true; } } else { $error = true;
/** * Delete user * * This function is used to delete a user from the system. * The user cannot be deleted if he is the last system administrator. * <br/>Example: * <code> * $user = EfrontUserFactory :: factory('jdoe'); * $user -> delete(); * </code> * * @return boolean True if the user was deleted successfully * @since 3.5.0 * @access public */ public function delete() { // Added by Masoud Sadjadi on July 6, 2014 to support vLab in eFront $vLab_username = $this->user['login']; $this->logout(); ///MODULES2 - Module user delete events - Before anything else // Get all modules (NOT only the ones that have to do with the user type) $modules = eF_loadAllModules(); // Trigger all necessary events. If the function has not been re-defined in the derived module class, nothing will happen foreach ($modules as $module) { $module->onDeleteUser($this->user['login']); } try { $directory = new EfrontDirectory($this->user['directory']); $directory->delete(); } catch (EfrontFileException $e) { $message = _USERDIRECTORYCOULDNOTBEDELETED . ': ' . $e->getMessage() . ' (' . $e->getCode() . ')'; //This does nothing at the moment } foreach ($this->aspects as $aspect) { $aspect->delete(); } calendar::deleteUserCalendarEvents($this->user['login']); eF_updateTableData("f_forums", array("users_LOGIN" => ''), "users_LOGIN='******'login'] . "'"); eF_updateTableData("f_messages", array("users_LOGIN" => ''), "users_LOGIN='******'login'] . "'"); eF_updateTableData("f_topics", array("users_LOGIN" => ''), "users_LOGIN='******'login'] . "'"); eF_updateTableData("f_poll", array("users_LOGIN" => ''), "users_LOGIN='******'login'] . "'"); eF_updateTableData("news", array("users_LOGIN" => ''), "users_LOGIN='******'login'] . "'"); eF_updateTableData("files", array("users_LOGIN" => ''), "users_LOGIN='******'login'] . "'"); eF_deleteTableData("f_folders", "users_LOGIN='******'login'] . "'"); eF_deleteTableData("f_personal_messages", "users_LOGIN='******'login'] . "'"); eF_deleteTableData("bookmarks", "users_LOGIN='******'login'] . "'"); eF_deleteTableData("comments", "users_LOGIN='******'login'] . "'"); eF_deleteTableData("f_users_to_polls", "users_LOGIN='******'login'] . "'"); eF_deleteTableData("logs", "users_LOGIN='******'login'] . "'"); eF_deleteTableData("rules", "users_LOGIN='******'login'] . "'"); //eF_deleteTableData("users_online", "users_LOGIN='******'login']."'"); eF_deleteTableData("user_times", "users_LOGIN='******'login'] . "'"); eF_deleteTableData("users_to_surveys", "users_LOGIN='******'login'] . "'"); eF_deleteTableData("users_to_done_surveys", "users_LOGIN='******'login'] . "'"); eF_deleteTableData("survey_questions_done", "users_LOGIN='******'login'] . "'"); eF_deleteTableData("lessons_timeline_topics_data", "users_LOGIN='******'login'] . "'"); eF_deleteTableData("events", "users_LOGIN='******'login'] . "'"); eF_deleteTableData("profile_comments", "users_LOGIN='******'login'] . "'"); eF_deleteTableData("users_to_content", "users_LOGIN='******'login'] . "'"); eF_deleteTableData("users_to_lessons", "users_LOGIN='******'login'] . "'"); eF_deleteTableData("users_to_courses", "users_LOGIN='******'login'] . "'"); if (G_VERSIONTYPE != 'community') { #cpp#ifndef COMMUNITY eF_deleteTableData("payments", "users_LOGIN='******'login'] . "'"); eF_deleteTableData("facebook_connect", "users_LOGIN='******'login'] . "'"); eF_deleteTableData("users_to_skillgap_tests", "users_LOGIN='******'login'] . "'"); } #cpp#endif //This line was in EfrontProfessor and EfrontStudent without an obvious reason. Admins may also be members of groups eF_deleteTableData("users_to_groups", "users_LOGIN='******'login'] . "'"); //Changing order of these lines because of #4318, where system removal notification was set (user triggering the event) eF_deleteTableData("notifications", "recipient='" . $this->user['login'] . "'"); EfrontEvent::triggerEvent(array("type" => EfrontEvent::SYSTEM_REMOVAL, "users_LOGIN" => $this->user['login'], "users_name" => $this->user['name'], "users_surname" => $this->user['surname'])); eF_deleteTableData("users", "login='******'login'] . "'"); // Added by Masoud Sadjadi on July 6, 2014 to support vLab in eFront // Beging addition // $vLab_username = $this -> user['login']; $vLab_username_urlEncoded = rawurlencode($vLab_username); $vLab_courseid = 123; // Kaseya 7.0 Fundamentals Workshop $vLab_courseid_urlEncoded = rawurlencode($vLab_courseid); // $vLab_moodleURL = "http://localhost/moodle19"; $vLab_moodleURL = "http://ita-portal.cis.fiu.edu"; // auto delete $str = $vLab_moodleURL . "/mod/deva/embedded/auto-delete.php?username={$vLab_username_urlEncoded}&courseid={$vLab_courseid_urlEncoded}"; // echo $str . '<br>'; $payload = file_get_contents($str); // echo $payload; return true; }
function do_retour($stuff, $confirmed = 1) { global $dbh; global $msg; global $alert_sound_list, $pmb_play_pret_sound; global $pmb_gestion_amende, $pmb_gestion_financiere, $pmb_blocage_retard, $pmb_blocage_max, $pmb_blocage_delai, $pmb_blocage_coef; global $deflt_docs_location; $erreur_affichage = ''; if (!is_object($stuff)) { die("erreur dans le module ./circ/retour.inc [do_retour()]. Contactez l'admin"); } // récupération localisation exemplaire $query = "SELECT t.tdoc_libelle as type_doc"; $query .= ", l.location_libelle as location"; $query .= ", s.section_libelle as section"; $query .= " FROM docs_type t"; $query .= ", docs_location l"; $query .= ", docs_section s"; $query .= " WHERE t.idtyp_doc=" . $stuff->expl_typdoc; $query .= " AND l.idlocation=" . $stuff->expl_location; $query .= " AND s.idsection=" . $stuff->expl_section; $query .= " LIMIT 1"; $result = mysql_query($query, $dbh); $info_doc = mysql_fetch_object($result); print pmb_bidi("<br /><form><div class='row'><div class='left'><strong>" . $stuff->libelle . "</strong></div>"); // flag confirm retour if (!$confirmed and $stuff->pret_idempr) { print "\n\t\t\t<div class='right'>\n\t\t\t<input type='button' class='bouton' \n\t\t\t\t\tname='confirm_ret' value='" . $msg['retour_confirm'] . "'\n\t\t\t\t\tonClick=\"document.location='./circ.php?categ=retour&cb_expl=" . $stuff->expl_cb . "'\">\n\t\t\t</div>"; } elseif ($stuff->pret_idempr) { print "\n\t\t\t\t<div class='right'>\n\t\t\t\t\t<font color='RED'><b>{$msg['retour_ok']}</b></font>\n\t\t\t\t</div>"; } print "</div>"; print pmb_bidi("<br /><b>" . $stuff->expl_cb . "</b> " . $info_doc->type_doc); print pmb_bidi('. ' . $info_doc->location); print pmb_bidi('. ' . $info_doc->section); print pmb_bidi('. ' . $stuff->expl_cote); print " <input class='bouton' type='button' value=\"" . $msg[375] . "\" onClick=\"document.location='circ.php?categ=visu_ex&form_cb_expl=" . $stuff->expl_cb . "';\" />"; print "</form>"; //Champs personalisés $p_perso = new parametres_perso("expl"); $perso_aff = ""; if (!$p_perso->no_special_fields) { $perso_ = $p_perso->show_fields($stuff->expl_id); for ($i = 0; $i < count($perso_["FIELDS"]); $i++) { $p = $perso_["FIELDS"][$i]; if ($p["AFF"]) { $perso_aff .= "<br />" . $p["TITRE"] . " " . $p["AFF"]; } } } if ($perso_aff) { print "<div class='row'>" . $perso_aff . "</div>"; } $script_magnetique = "\n<script language='javascript' type='text/javascript'>\nvar requete = null;\n\nfunction creerRequette(){\n\tif(window.XMLHttpRequest) // Firefox\n\t\trequete = new XMLHttpRequest();\n\telse if(window.ActiveXObject) // Internet Explorer\n \t\trequete = new ActiveXObject('Microsoft.XMLHTTP');\n\telse { // XMLHttpRequest non supporté par le navigateur\n \t\talert('Votre navigateur ne supporte pas les objets XMLHTTPRequest...');\n \treturn;\n\t}\n}\n\nfunction magnetise(commande){\n\tcreerRequette();\n\tif(netscape.security.PrivilegeManager)netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');\t\n\trequete.open('GET', 'http://localhost:30000/?send_value='+commande+'&command=Send', false);\n\trequete.send(null);\n\tif(requete.readyState != 4) alert('Requête antivol non effectuée !');\n}\n\n"; global $pmb_antivol; if ($pmb_antivol > 0) { if ($stuff->type_antivol == 1) { // c'est un support non magnétique (livre, revue...) print "{$script_magnetique}" . "magnetise('RRR');</script>"; } if ($stuff->type_antivol == 2) { //c'est un support magnétique (cassette) print "{$script_magnetique}" . "magnetise('SSS');</script>"; } } //si le retour se passe sur un site différent de ce lui de l'exemplaire global $pmb_transferts_actif; $transfert_mauvais_site = false; if ($stuff->expl_location != $deflt_docs_location) { $alert_sound_list[] = "critique"; $html_erreur_site = "<hr /><div class='erreur'>"; //on agit pour faire l'action par defaut //et que c'est un retour d'emprunt if ($pmb_transferts_actif && $stuff->pret_idempr) { global $transferts_retour_action_defaut; global $transferts_retour_action_autorise_autre; $trans = new transfert(); //pour afficher le site de l'exemplaire $rqtSite = "SELECT location_libelle FROM docs_location WHERE idlocation=" . $stuff->expl_location; $resSite = mysql_result(mysql_query($rqtSite), 0); //si on propose une autre action if ($transferts_retour_action_autorise_autre == "1") { $texte_change_loc = str_replace("!!lbl_site!!", $resSite, $msg["transferts_circ_retour_lbl_change_localisation"]); } $texte_change_loc = str_replace("!!liste_sections!!", "<select onchange='enregLoc(this)'>!!liste!!</select>", $texte_change_loc); //on genere la liste des sections $rqt = "SELECT idsection, section_libelle FROM docs_section ORDER BY section_libelle"; $res_section = mysql_query($rqt); $liste_section = ""; while ($value = mysql_fetch_object($res_section)) { $liste_section .= "<option value='" . $value->idsection . "'"; if ($value->idsection == $stuff->expl_section) { $liste_section .= " selected"; $expl_section_libelle = $value->section_libelle; } $liste_section .= ">" . $value->section_libelle . "</option>"; } $texte_change_loc = addslashes(str_replace("!!liste!!", $liste_section, $texte_change_loc)); $html_erreur_site .= "\n<form name='actionTrans'>\n<input type='hidden' name='typeTrans' value='" . $transferts_retour_action_defaut . "'>\n<input type='hidden' name='explTrans' value='" . $stuff->expl_id . "'>\n<script language='javascript'>\nmsg_inf_loc = '" . $texte_change_loc . "';\nmsg_bt_loc = '" . str_replace("'", "\\'", $msg["transferts_circ_retour_bt_retour_mauvaise_localisation"]) . "';\nmsg_inf_trans = '" . str_replace("'", "\\'", str_replace("!!lbl_site!!", $resSite, $msg["transferts_circ_retour_lbl_transfert"])) . "';\nmsg_bt_trans = '" . str_replace("'", "\\'", $msg["transferts_circ_retour_bt_changement_localisation"]) . "';\n\nfunction changeAction() {\n\n\tvar actionTrans = new http_request();\n\tvar url= './ajax.php?module=circ&categ=transferts&idexpl=' + document.actionTrans.explTrans.value + '&action=';\n\t\t\t\t\n\tswitch (document.actionTrans.typeTrans.value) {\n\t\tcase '0':\n\t\t\t//il y a eu un changement localisation\n\t\t\t//on propose un transfert\n\t\t\tif (confirm('" . addslashes($msg["transferts_circ_retour_confirm_gen_transfert"]) . "')) {\n\n\t\t\t\turl = url + 'gen_transfert¶m=' + document.actionTrans.paramTrans.value ;\n\t\t\t\n\t\t\t\tif (actionTrans.request(url)) {\n\t\t\t\t\t// Il y a une erreur. Afficher le message retourné\n\t\t\t\t\talert ( '" . addslashes($msg["540"]) . " : ' + actionTrans.get_text() );\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t//tout c'est bien passe\n\t\t\t\t\t\n\t\t\t\t\t//on recupere les infos\n\t\t\t\t\tdocument.actionTrans.typeTrans.value = '1';\n\t\t\t\t\tdocument.actionTrans.paramTrans.value = actionTrans.get_text();\n\t\t\t\t\t\n\t\t\t\t\t//on change les textes\n\t\t\t\t\tdocument.actionTrans.btActionTrans.value = msg_bt_trans;\n\t\t\t\t\tdocument.getElementById('libInfoTransfert').innerHTML = msg_inf_trans; \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}//if confirm\n\t\t\t\n\t\t\t\n\t\t\tbreak;\n\t\n\t\tcase '1':\n\t\t\t//il y a eu un transfert\n\t\t\t//on propose un changement de localisation\n\t\t\tif (confirm('" . addslashes($msg["transferts_circ_retour_confirm_change_loc"]) . "')) {\n\n\t\t\t\turl = url + 'change_loc¶m=' + document.actionTrans.paramTrans.value ;\n\t\t\t\n\t\t\t\tif (actionTrans.request(url)) {\n\t\t\t\t\t// Il y a une erreur. Afficher le message retourné\n\t\t\t\t\talert ( '" . addslashes($msg["540"]) . " : ' + actionTrans.get_text() );\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t//tout c'est bien passe\n\t\t\t\t\t\n\t\t\t\t\t//on recupere les infos\n\t\t\t\t\tdocument.actionTrans.typeTrans.value = '0';\n\t\t\t\t\tdocument.actionTrans.paramTrans.value = actionTrans.get_text();\n\t\t\t\t\t\n\t\t\t\t\t//on change les textes\n\t\t\t\t\tdocument.actionTrans.btActionTrans.value = msg_bt_loc;\n\t\t\t\t\tdocument.getElementById('libInfoTransfert').innerHTML = msg_inf_loc; \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t} //if confirm\n\t\t\tbreak;\n\t} //switch\n\t\t\n}\n\nfunction enregLoc(obj) {\n\tval = obj.options[obj.selectedIndex].value;\n\t\n\tvar actionTrans = new http_request();\n\tvar url= './ajax.php?module=circ&categ=transferts&idexpl=' + document.actionTrans.explTrans.value + '&action=change_section¶m='+val;\n\t\n\tif (actionTrans.request(url)) {\n\t\t// Il y a une erreur. Afficher le message retourné\n\t\talert ( '" . addslashes($msg["540"]) . " : ' + actionTrans.get_text() );\t\t\t\n\t}\n}\n</script>"; if ($stuff->resa_idempr) { // le doc en retour peut servir à valider une résa suivante if (!verif_cb_utilise($stuff->expl_cb)) { $affect = affecte_cb($stuff->expl_cb); } } if (!$affect) { switch ($transferts_retour_action_defaut) { case "0": //change la localisation d'origine $param = $trans->retour_exemplaire_change_localisation($stuff->expl_id); //le message a l'ecran $html_erreur_site .= "<div id='libInfoTransfert'>" . str_replace("!!lbl_site!!", $resSite, $msg["transferts_circ_retour_lbl_change_localisation"]) . "</div>"; if ($transferts_retour_action_autorise_autre == "1") { //on propose de générer le transfert $html_erreur_site .= " <input class='bouton' name='btActionTrans' type='button' value=\"" . $msg["transferts_circ_retour_bt_retour_mauvaise_localisation"] . "\" " . " onclick=\"changeAction();\"" . ">"; } break; case "1": //genere le transfert automatique de l'exemplaire $param = $trans->retour_exemplaire_genere_transfert_retour($stuff->expl_id); //le message a l'ecran $html_erreur_site .= "<div id='libInfoTransfert'>" . $msg["transferts_circ_retour_lbl_transfert"] . "</div>"; if ($transferts_retour_action_autorise_autre == "1") { //on propose de changer la localisation $html_erreur_site .= " <input class='bouton' name='btActionTrans' type='button' value=\"" . $msg["transferts_circ_retour_bt_changement_localisation"] . "\" " . " onclick=\"changeAction();\"" . ">"; } break; } //switch } if ($transferts_retour_action_autorise_autre == "1") { $html_erreur_site .= "<input type='hidden' name='paramTrans' value='" . $param . "'></form>"; } $html_erreur_site = str_replace("!!lbl_site!!", $resSite, $html_erreur_site); $html_erreur_site = str_replace("!!liste_sections!!", $expl_section_libelle, $html_erreur_site); $transfert_mauvais_site = true; } else { //if (($pmb_transferts_actif)&&($stuff->pret_idempr)) //le message à l'écran $html_erreur_site .= $msg[expl_retour_bad_location]; } $html_erreur_site .= "</div>"; print pmb_bidi($html_erreur_site); // fin de if ($stuff->expl_location != $deflt_docs_location) } if ($stuff->expl_note) { $alert_sound_list[] = "critique"; print pmb_bidi("<hr /><div class='erreur'>{$msg[377]} :</div><div class='message_important'>" . $stuff->expl_note . "</div>"); } elseif ($pmb_play_pret_sound) { $alert_sound_list[] = "information"; } // zone du dernier emrunteur if ($stuff->expl_lastempr) { $dernier_empr = "<hr /><div class='row'>{$msg['expl_prev_empr']} "; $link = "<a href='./circ.php?categ=pret&form_cb=" . rawurlencode($stuff->lastempr_cb) . "'>"; $dernier_empr .= $link . $stuff->lastempr_prenom . ' ' . $stuff->lastempr_nom . ' (' . $stuff->lastempr_cb . ')</a>'; $dernier_empr .= "</div><hr />"; } if ($stuff->pret_idempr) { // l'exemplaire était effectivement emprunté // calcul du retard éventuel $rqt_date = "select ((TO_DAYS(CURDATE()) - TO_DAYS('{$stuff->pret_retour}'))) as retard "; $resultatdate = mysql_query($rqt_date); $resdate = mysql_fetch_object($resultatdate); $retard = $resdate->retard; if ($retard > 0) { //Calcul du vrai nombre de jours $date_debut = explode("-", $stuff->pret_retour); $ndays = calendar::get_open_days($date_debut[2], $date_debut[1], $date_debut[0], date("d"), date("m"), date("Y")); if ($ndays > 0) { $retard = (int) $ndays; print "<br /><div class='erreur'>" . $msg[369] . " : " . $retard . " " . $msg[370] . "</div>"; $alert_sound_list[] = "critique"; } } //Calcul du blocage if ($pmb_blocage_retard) { $date_debut = explode("-", $stuff->pret_retour); $ndays = calendar::get_open_days($date_debut[2], $date_debut[1], $date_debut[0], date("d"), date("m"), date("Y")); if ($ndays > $pmb_blocage_delai) { $ndays = $ndays * $pmb_blocage_coef; if ($ndays > $pmb_blocage_max && $pmb_blocage_max != 0) { $ndays = $pmb_blocage_max; } } else { $ndays = 0; } if ($ndays > 0) { //Le lecteur est-il déjà bloqué ? $date_fin_blocage_empr = mysql_result(mysql_query("select date_fin_blocage from empr where id_empr='" . $stuff->pret_idempr . "'"), 0, 0); //Calcul de la date de fin $date_fin = calendar::add_days(date("d"), date("m"), date("Y"), $ndays); if ($date_fin > $date_fin_blocage_empr) { //Mise à jour mysql_query("update empr set date_fin_blocage='" . $date_fin . "' where id_empr='" . $stuff->pret_idempr . "'"); print "<br /><div class='erreur'>" . sprintf($msg["blocage_retard_pret"], formatdate($date_fin)) . "</div>"; $alertsound_list[] = "critique"; } else { print "<br /><div class='erreur'>" . sprintf($msg["blocage_already_retard_pret"], formatdate($date_fin_blocage_empr)) . "</div>"; $alertsound_list[] = "critique"; } } } //Vérification des amendes if ($pmb_gestion_financiere && $pmb_gestion_amende) { $amende = new amende($stuff->pret_idempr); $amende_t = $amende->get_amende($stuff->pret_idexpl); //Si il y a une amende, je la débite if ($amende_t["valeur"]) { print pmb_bidi("<br /><div class='erreur'>" . $msg["finance_retour_amende"] . " : " . comptes::format($amende_t["valeur"])); $alert_sound_list[] = "critique"; $compte_id = comptes::get_compte_id_from_empr($stuff->pret_idempr, 2); if ($compte_id) { $cpte = new comptes($compte_id); if ($cpte->id_compte) { $cpte->record_transaction("", $amende_t["valeur"], -1, sprintf($msg["finance_retour_amende_expl"], $stuff->pret_idexpl), 0); print " " . $msg["finance_retour_amende_recorded"]; } } print "</div>"; } } // zone du dernier emrunteur print pmb_bidi($dernier_empr); // code de suppression prêt et la mise en table de stat if ($confirmed) { if (del_pret($stuff)) { if (!maj_stat_pret($stuff)) { // impossible de maj en table stat print "<div class='erreur'>{$msg[371]}</div>"; } } else { // impossible de supprimer en table pret print "<div class='erreur'>{$msg[372]}</div>"; } // traitement de l'éventuelle réservation if ($stuff->resa_idempr) { // le doc en retour peut servir à valider une résa suivante if (!verif_cb_utilise($stuff->expl_cb) || $affect) { if (!$affect) { $affect = affecte_cb($stuff->expl_cb); } // affichage message de réservation if ($affect) { $trans_en_cours = false; $msg_trans = ""; if ($pmb_transferts_actif == "1" && !$transfert_mauvais_site) { //si le transfert est actif et qu'un transfert n'est pas deja fait $res_transfert = resa_transfert($affect, $stuff->expl_cb); if ($res_transfert != 0) { $rqt = "SELECT location_libelle FROM docs_location WHERE idlocation=" . $res_transfert; $lib_loc = mysql_result(mysql_query($rqt), 0); $msg_trans = "<strong>" . str_replace("!!site_dest!!", $lib_loc, $msg["transferts_circ_resa_validation_alerte"]) . "</strong><br />"; $trans_en_cours = true; } } $query = "select distinct "; $query .= "empr_prenom, empr_nom, empr_cb "; $query .= "from (((resa LEFT JOIN notices AS notices_m ON resa_idnotice = notices_m.notice_id ) LEFT JOIN bulletins ON resa_idbulletin = bulletins.bulletin_id) LEFT JOIN notices AS notices_s ON bulletin_notice = notices_s.notice_id), empr "; $query .= "where id_resa in (" . $affect . ") and resa_idempr=id_empr"; $result = mysql_query($query, $dbh); $empr = @mysql_fetch_object($result); print pmb_bidi("<div class='message_important'>{$msg['352']}</div>\n\t\t\t\t\t\t\t<div class='row'>{$msg_trans}\n\t\t\t\t\t\t\t{$msg[373]}\n\t\t\t\t\t\t\t<strong><a href='./circ.php?categ=pret&form_cb=" . rawurlencode($empr->empr_cb) . "'>" . $empr->empr_prenom . " " . $empr->empr_nom . "</a></strong>\n\t\t\t\t\t\t\t ({$empr->empr_cb} )\n\t\t\t\t\t\t\t</div>"); $alert_sound_list[] = "critique"; if (!$trans_en_cours) { alert_empr_resa($affect); } } // fin if affect } // fin if !verif_cb_utilise } // fin if resa } // fin confirmed $empr = new emprunteur($stuff->pret_idempr, $erreur_affichage, FALSE, 2); print pmb_bidi($empr->fiche_affichage); } else { print "<div class='erreur'>{$msg[605]}</div>"; $alert_sound_list[] = "critique"; } // show_report($stuff); // this stands for debugging }
$smarty->assign("T_CALENDAR_OPTIONS", $calendarOptions); $smarty->assign("T_CALENDAR_LINK", basename($_SERVER['PHP_SELF']) . "?ctg=calendar"); isset($_GET['add_another']) ? $smarty->assign('T_ADD_ANOTHER', "1") : null; $events = calendar::getCalendarEventsForUser($currentUser); $events = calendar::getCalendarEventsForUser($currentUser); if ($_SESSION['s_type'] != 'administrator' && $_SESSION['s_current_branch']) { //this applies to branch urls $currentBranch = new EfrontBranch($_SESSION['s_current_branch']); $branchTreeUsers = array_keys($currentBranch->getBranchTreeUsers()); foreach ($events as $key => $value) { if ($value['type'] != 'global' && !in_array($value['users_LOGIN'], $branchTreeUsers)) { unset($events[$key]); } } } $events = calendar::sortCalendarEventsByTimestamp($events); $smarty->assign("T_CALENDAR_EVENTS", $events); //Assign events and specific day timestamp to smarty, to be used from calendar $smarty->assign("T_VIEW_CALENDAR", $view_calendar); } /********** Facebook profile ******/ if ($GLOBALS['configuration']['social_modules_activated'] & FB_FUNC_DATA_ACQUISITION) { if (isset($_SESSION['facebook_user']) && $_SESSION['facebook_user']) { $smarty->assign("T_FB_INFORMATION", $_SESSION['facebook_details']); } else { $smarty->assign("T_PREVIOUSMAINURL", $_SESSION['previousMainUrl']); $smarty->assign("T_OPEN_FACEBOOK_SESSION", 1); $smarty->assign("T_FACEBOOK_API_KEY", $GLOBALS['configuration']['facebook_api_key']); } } //-----------------------------------------
Version: 1.0 Release date: 08 July 2003 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ define('SHOW_ALL', 0); define('SHOW_OWN', 1); define('SHOW_SUB', 2); require "../../Group-Office.php"; $GO_SECURITY->authenticate(); $GO_MODULES->authenticate('calendar'); require $GO_LANGUAGE->get_language_file('calendar'); require $GO_MODULES->path . 'classes/calendar.class.inc'; $cal = new calendar(); $post_action = isset($_REQUEST['post_action']) ? $_REQUEST['post_action'] : ''; $task = isset($_POST['task']) ? $_POST['task'] : ''; $return_to = isset($_REQUEST['return_to']) ? $_REQUEST['return_to'] : $_SERVER['HTTP_REFERER']; $link_back = isset($_REQUEST['link_back']) ? $_REQUEST['link_back'] : $_SERVER['REQUEST_URI']; $view_type = isset($_REQUEST['view_type']) ? $_REQUEST['view_type'] : 0; $calendar_id = isset($_REQUEST['calendar_id']) ? $_REQUEST['calendar_id'] : 0; $db = new db(); switch ($task) { case 'delete_calendar': $calendar = $cal->get_calendar($_POST['delete_calendar_id']); if ($GO_SECURITY->user_id == $calendar['user_id']) { if ($cal->delete_calendar($_POST['delete_calendar_id'])) { $holidays->delete_holidays($GO_SECURITY->user_id, $_POST['delete_calendar_id']); $GO_SECURITY->delete_acl($calendar['acl_write']); $GO_SECURITY->delete_acl($calendar['acl_read']);
private function getRssSource($source, $mode, $lesson) { $feeds = $this->getProvidedFeeds(); foreach ($feeds as $value) { if ($value['active'] && $value['mode'] == 'system') { $systemFeeds[$value['type']] = $value; } else { if ($value['active'] && $value['mode'] == 'lesson') { $lessonFeeds[$value['type']] = $value; } } } if ($mode == 'system' && !in_array($source, array_keys($systemFeeds))) { return array(); } elseif ($mode == 'lesson' && !in_array($source, array_keys($lessonFeeds))) { return array(); } $data = array(); switch ($source) { case 'announcements': if ($mode == 'system') { $news = news::getNews(0, true); } elseif ($mode == 'lesson') { if ($lesson) { $news = news::getNews($lesson, true); } else { $lessons = eF_getTableDataFlat("lessons", "id, name"); $lessonNames = array_combine($lessons['id'], $lessons['name']); $news = news::getNews($lessons['id'], true); } } $count = 1; foreach ($news as $value) { if ($mode == 'lesson' && !$lesson) { $value['title'] = $lessonNames[$value['lessons_ID']] . ': ' . $value['title']; $link = G_SERVERNAME . 'userpage.php?lessons_ID=' . $value['lessons_ID'] . '&ctg=news&view=' . $value['id']; } else { $link = G_SERVERNAME . 'userpage.php?ctg=news&view=' . $value['id']; } $data[] = array('title' => $value['title'], 'link' => $link, 'description' => $value['data']); /* if ($count++ == $this -> feedLimit) { break; } */ } break; case 'catalog': $constraints = array("return_objects" => false, 'archive' => false, 'active' => true); $result = EfrontCourse::getAllCourses($constraints); $directionsTree = new EfrontDirectionsTree(); $directionPaths = $directionsTree->toPathString(); foreach ($result as $value) { $pathString = $directionPaths[$value['directions_ID']] . ' → ' . $value['name']; $data[] = array('title' => $pathString, 'link' => G_SERVERNAME . 'index.php?ctg=lesson_info&courses_ID=' . $value['id'], 'description' => implode("<br>", unserialize($value['info']))); } $result = eF_getTableData("lessons", "id,name,directions_ID, info", "archive=0 and instance_source = 0 and active=1 and course_only=0", "name"); foreach ($result as $value) { $pathString = $directionPaths[$value['directions_ID']] . ' → ' . $value['name']; $data[] = array('title' => $pathString, 'link' => G_SERVERNAME . 'index.php?ctg=lesson_info&lessons_ID=' . $value['id'], 'description' => implode("<br>", unserialize($value['info']))); } $data = array_values(eF_multisort($data, 'title', 'asc')); //Sort results based on path string break; case 'calendar': if ($mode == 'system') { $events = calendar::getGlobalCalendarEvents(); } elseif ($mode == 'lesson') { if ($lesson) { $events = calendar::getLessonCalendarEvents($lesson); } else { $events = calendar::getCalendarEventsForAllLessons(); } } foreach ($events as $value) { $value['name'] ? $title = formatTimestamp($value['timestamp']) . ' (' . $value['name'] . ')' : ($title = formatTimestamp($value['timestamp'])); $data[] = array('title' => $title, 'link' => G_SERVERNAME . 'userpage.php?ctg=calendar&view_calendar=' . $value['timestamp'] . '&type=0', 'description' => $value['data']); } break; /* case 'history': $currentUser = $this -> getCurrentUser(); $eventObjects = array(); $result = eF_getTableData("events", "*", "", "timestamp DESC limit 100"); foreach ($result as $value) { $eventObject = new EfrontEvent($value); $eventObject -> createMessage(); pr($eventObject); } break; */ /* case 'history': $currentUser = $this -> getCurrentUser(); $eventObjects = array(); $result = eF_getTableData("events", "*", "", "timestamp DESC limit 100"); foreach ($result as $value) { $eventObject = new EfrontEvent($value); $eventObject -> createMessage(); pr($eventObject); } break; */ case 'structure': if ($lesson) { $contentTree = new EfrontContentTree($lesson); $contentPath = $contentTree->toPathStrings(); foreach ($contentPath as $key => $value) { $data[] = array('title' => $value, 'link' => G_SERVERNAME . 'userpage.php?lessons_ID=' . $lesson . '&unit=' . $key, 'description' => $value); } } break; case 'forum': if ($mode == 'system') { $result = eF_getTableData("f_messages fm JOIN f_topics ft JOIN f_forums ff LEFT OUTER JOIN lessons l ON ff.lessons_ID = l.id", "ff.title as forum_name, fm.body, fm.title, fm.id, ft.id as topic_id, ft.title as topic_title, fm.users_LOGIN, fm.timestamp, l.name as lessons_name, lessons_id as show_lessons_id", "ft.f_forums_ID=ff.id AND fm.f_topics_ID=ft.id ", "fm.timestamp desc LIMIT 100"); } elseif ($mode == 'lesson') { if ($lesson) { $result = eF_getTableData("f_messages fm JOIN f_topics ft JOIN f_forums ff LEFT OUTER JOIN lessons l ON ff.lessons_ID = l.id", "ff.title as forum_name, fm.body, fm.title, fm.id, ft.id as topic_id, ft.title as topic_title, fm.users_LOGIN, fm.timestamp, l.name as lessons_name, lessons_id as show_lessons_id", "ft.f_forums_ID=ff.id AND fm.f_topics_ID=ft.id AND ff.lessons_ID = '" . $lesson . "'", "fm.timestamp desc LIMIT 100"); } else { $result = eF_getTableData("f_messages fm JOIN f_topics ft JOIN f_forums ff LEFT OUTER JOIN lessons l ON ff.lessons_ID = l.id", "ff.title as forum_name, fm.body, fm.title, fm.id, ft.id as topic_id, ft.title as topic_title, fm.users_LOGIN, fm.timestamp, l.name as lessons_name, lessons_id as show_lessons_id", "ft.f_forums_ID=ff.id AND fm.f_topics_ID=ft.id AND ff.lessons_ID != 0", "fm.timestamp desc LIMIT 100"); } } foreach ($result as $value) { $value['title'] = $value['forum_name'] . ' >> ' . $value['topic_title'] . ' >> ' . $value['title']; if ($mode == 'system' && $value['lessons_name'] || $mode == 'lesson' && !$lesson) { $value['title'] = $value['lessons_name'] . ': ' . $value['title']; } $data[] = array('title' => $value['title'], 'link' => G_SERVERNAME . 'userpage.php?ctg=forum&topic=' . $value['topic_id'], 'description' => $value['body']); } break; default: break; } return $data; }
function do_retour_doc() { global $dbh; global $msg; global $pmb_gestion_amende, $pmb_gestion_financiere, $pmb_blocage_retard, $pmb_blocage_max, $pmb_blocage_delai, $pmb_blocage_coef; // récupération localisation exemplaire $query = "select t.tdoc_libelle as type_doc"; $query .= ", l.location_libelle as location"; $query .= ", s.section_libelle as section"; $query .= " from docs_type t"; $query .= ", docs_location l"; $query .= ", docs_section s"; $query .= " where t.idtyp_doc=" . $this->expl_typdoc; $query .= " and l.idlocation=" . $this->expl_location; $query .= " and s.idsection=" . $this->expl_section; $query .= " limit 1"; $result = pmb_mysql_query($query, $dbh); $info_doc = pmb_mysql_fetch_object($result); $this->type_doc = $info_doc->type_doc; if ($this->nbparts > 1) { $this->type_doc .= " (" . $this->nbparts . ")"; } $this->location = $info_doc->location; $this->section = $info_doc->section; if ($this->expl_note) { $this->error_message = $msg[377]; } if ($this->pret_idempr) { // calcul du retard éventuel $rqt_date = "select ((TO_DAYS(CURDATE()) - TO_DAYS('{$this->pret_retour}'))) as retard "; $resultatdate = pmb_mysql_query($rqt_date); $resdate = pmb_mysql_fetch_object($resultatdate); $retard = $resdate->retard; if ($retard > 0) { //Calcul du vrai nombre de jours $date_debut = explode("-", $this->pret_retour); $ndays = calendar::get_open_days($date_debut[2], $date_debut[1], $date_debut[0], date("d"), date("m"), date("Y")); if ($ndays > 0) { $retard = (int) $ndays; $this->error_message = $msg[369] . " : " . $retard . " " . $msg[370]; } else { $this->error_message = $msg["calendrier_active_aucun_retard"]; } } //Calcul du blocage if ($pmb_blocage_retard) { $date_debut = explode("-", $this->pret_retour); $ndays = calendar::get_open_days($date_debut[2], $date_debut[1], $date_debut[0], date("d"), date("m"), date("Y")); if ($ndays > $pmb_blocage_delai) { $ndays = $ndays * $pmb_blocage_coef; if ($ndays > $pmb_blocage_max && $pmb_blocage_max != 0) { $ndays = $pmb_blocage_max; } } else { $ndays = 0; } if ($ndays > 0) { //Le lecteur est-il déjà bloqué ? $date_fin_blocage_empr = pmb_mysql_result(pmb_mysql_query("select date_fin_blocage from empr where id_empr='" . $this->pret_idempr . "'"), 0, 0); //Calcul de la date de fin $date_fin = calendar::add_days(date("d"), date("m"), date("Y"), $ndays); if ($date_fin > $date_fin_blocage_empr) { //Mise à jour pmb_mysql_query("update empr set date_fin_blocage='" . $date_fin . "' where id_empr='" . $this->pret_idempr . "'"); $this->error_message = sprintf($msg["blocage_retard_pret"], formatdate($date_fin)); } else { $this->error_message = sprintf($msg["blocage_already_retard_pret"], formatdate($date_fin_blocage_empr)); } } } //Vérification des amendes if ($pmb_gestion_financiere && $pmb_gestion_amende) { $amende = new amende($this->pret_idempr); $amende_t = $amende->get_amende($this->pret_idexpl); //Si il y a une amende, je la débite if ($amende_t["valeur"]) { $this->error_message = $msg["finance_retour_amende"] . " : " . comptes::format($amende_t["valeur"]); $compte_id = comptes::get_compte_id_from_empr($this->pret_idempr, 2); if ($compte_id) { $cpte = new comptes($compte_id); if ($cpte->id_compte) { $cpte->record_transaction("", $amende_t["valeur"], -1, sprintf($msg["finance_retour_amende_expl"], $this->pret_idexpl), 0); $this->error_message .= " " . $msg["finance_retour_amende_recorded"]; } } } } // Suppression prêt et la mise en table de stat $query = "delete from pret where pret_idexpl = '" . $this->pret_idexpl . "' "; $result = pmb_mysql_query($query, $dbh); if ($result) { $this->retour_message = $msg["retour_ok"]; if (!$this->maj_stat_pret()) { // impossible de maj en table stat $this->error_message = $msg[371]; } } else { // impossible de supprimer en table pret $this->error_message = $msg[372]; } // traitement de l'éventuelle réservation if ($this->resa_idempr) { // le doc en retour peut servir à valider une résa suivante if (!verif_cb_utilise($this->cb_expl)) { $affect = affecte_cb($this->cb_expl); // affichage message de réservation if ($affect) { $this->error_message = $msg["rfid_retour_document_reserve_message"]; $this->url_reservation = "./circ.php?categ=pret&form_cb=" . rawurlencode($this->cb_reservataire); } // fin if affect } // fin if !verif_cb_utilise } // fin if resa } else { $this->error_message = $msg[605]; } }
under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ require "../../Group-Office.php"; $GO_SECURITY->authenticate(); $GO_MODULES->authenticate('calendar'); require $GO_LANGUAGE->get_language_file('calendar'); $max_columns = 7; $link_back = isset($_REQUEST['link_back']) ? $_REQUEST['link_back'] : $_SERVER['REQUEST_URI']; $merged_view = isset($_REQUEST['merged_view']) ? $_REQUEST['merged_view'] : true; //are we in print view? $print = isset($_REQUEST['print']) ? true : false; require_once $GO_MODULES->class_path . 'calendar.class.inc'; require_once $GO_MODULES->class_path . 'todos.class.inc'; $cal = new calendar(); $cal_settings = $cal->get_settings($GO_SECURITY->user_id); //get the local times $local_time = get_time(); $year = isset($_REQUEST['year']) ? $_REQUEST['year'] : date("Y", $local_time); $month = isset($_REQUEST['month']) ? $_REQUEST['month'] : date("m", $local_time); $day = isset($_REQUEST['day']) ? $_REQUEST['day'] : date("j", $local_time); $hour = isset($_REQUEST['hour']) ? $_REQUEST['hour'] : date("H", $local_time); $min = isset($_REQUEST['min']) ? $_REQUEST['min'] : date("i", $local_time); $local_browse_time = mktime($hour, $min, 0, $month, $day, $year); //recalculate date $year = date("Y", $local_browse_time); $month = date("m", $local_browse_time); $day = date("j", $local_browse_time); $hour = date("H", $local_browse_time); $min = date("i", $local_browse_time);
/** * Export lesson * * This function is used to export the current lesson's data to * a file, which can then be imported to other systems. Apart from * the lesson content, the user may optinally specify additional * information to export, using the $exportEntities array. If * $exportEntities is 'all', everything that can be exported, is * exported * * <br/>Example: * <code> * $exportedFile = $lesson -> export('all'); * </code> * * @param array $exportEntities The additional data to export * @param boolean $rename Whether to rename the exported file with the same name as the lesson * @param boolean $exportFiles Whether to export files as well * @return EfrontFile The object of the exported data file * @since 3.5.0 * @access public */ public function export($exportEntities, $rename = true, $exportFiles = true) { if (!$exportEntities) { $exportEntities = array('export_surveys' => 1, 'export_announcements' => 1, 'export_glossary' => 1, 'export_calendar' => 1, 'export_comments' => 1, 'export_rules' => 1); } $data['lessons'] = $this->lesson; unset($data['lessons']['share_folder']); unset($data['lessons']['instance_source']); unset($data['lessons']['originating_course']); $content = eF_getTableData("content", "*", "lessons_ID=" . $this->lesson['id']); if (sizeof($content) > 0) { $contentIds = array(); for ($i = 0; $i < sizeof($content); $i++) { $content[$i]['data'] = str_replace(G_SERVERNAME, "##SERVERNAME##", $content[$i]['data']); $content[$i]['data'] = str_replace("content/lessons/" . ($this->lesson['share_folder'] ? $this->lesson['share_folder'] : $this->lesson['id']), "##LESSONSLINK##", $content[$i]['data']); $contentIds[] = $content[$i]['id']; } $content_list = implode(",", array_values($contentIds)); $data['content'] = $content; $questions = eF_getTableData("questions", "*", "lessons_ID=" . $this->lesson['id']); if (sizeof($questions) > 0) { for ($i = 0; $i < sizeof($questions); $i++) { $questions[$i]['text'] = str_replace(G_SERVERNAME, "##SERVERNAME##", $questions[$i]['text']); $questions[$i]['text'] = str_replace("content/lessons/" . ($this->lesson['share_folder'] ? $this->lesson['share_folder'] : $this->lesson['id']), "##LESSONSLINK##", $questions[$i]['text']); } $data['questions'] = $questions; } $tests = eF_getTableData("tests", "*", "lessons_ID=" . $this->lesson['id']); if (sizeof($tests)) { $testsIds = array(); foreach ($tests as $key => $value) { $testsIds[] = $value['id']; } $tests_list = implode(",", array_values($testsIds)); $tests_to_questions = eF_getTableData("tests_to_questions", "*", "tests_ID IN ({$tests_list})"); for ($i = 0; $i < sizeof($tests); $i++) { $tests[$i]['description'] = str_replace(G_SERVERNAME, "##SERVERNAME##", $tests[$i]['description']); $tests[$i]['description'] = str_replace("content/lessons/" . ($this->lesson['share_folder'] ? $this->lesson['share_folder'] : $this->lesson['id']), "##LESSONSLINK##", $tests[$i]['description']); } $data['tests'] = $tests; $data['tests_to_questions'] = $tests_to_questions; } if (isset($exportEntities['export_rules'])) { $rules = eF_getTableData("rules", "*", "lessons_ID=" . $this->lesson['id']); if (sizeof($rules) > 0) { $data['rules'] = $rules; } } if (isset($exportEntities['export_comments'])) { $comments = eF_getTableData("comments", "*", "content_ID IN ({$content_list})"); if (sizeof($comments) > 0) { $data['comments'] = $comments; } } } if (isset($exportEntities['export_calendar'])) { $calendar = calendar::getLessonCalendarEvents($this); $calendar = array_values($calendar); if (sizeof($calendar) > 0) { $data['calendar'] = $calendar; } } if (isset($exportEntities['export_glossary'])) { $glossary = eF_getTableData("glossary", "*", "lessons_ID = " . $this->lesson['id']); if (sizeof($glossary) > 0) { $data['glossary'] = $glossary; } } if (isset($exportEntities['export_announcements'])) { $news = eF_getTableData("news", "*", "lessons_ID=" . $this->lesson['id']); if (sizeof($news) > 0) { $data['news'] = $news; } } if (isset($exportEntities['export_surveys'])) { $surveys = eF_getTableData("surveys", "*", "lessons_ID=" . $this->lesson['id']); //prepei na ginei to lesson_ID -> lessons_ID sti basi (ayto isos to parampsoyme eykola) if (sizeof($surveys) > 0) { $data['surveys'] = $surveys; $surveys_ = array(); foreach ($surveys as $key => $value) { $surveys_[$value['id']] = $value; } $surveys_list = implode(",", array_keys($surveys_)); $questions_to_surveys = eF_getTableData("questions_to_surveys", "*", "surveys_ID IN ({$surveys_list})"); // oposipote omos to survey_ID -> surveys_ID sti basi if (sizeof($questions_to_surveys) > 0) { $data['questions_to_surveys'] = $questions_to_surveys; } } } $lesson_conditions = eF_getTableData("lesson_conditions", "*", "lessons_ID=" . $this->lesson['id']); if (sizeof($lesson_conditions) > 0) { $data['lesson_conditions'] = $lesson_conditions; } $projects = eF_getTableData("projects", "*", "lessons_ID=" . $this->lesson['id']); if (sizeof($projects) > 0) { $data['projects'] = $projects; } $lesson_files = eF_getTableData("files", "*", "path like '" . str_replace(G_ROOTPATH, '', EfrontDirectory::normalize($this->getDirectory())) . "%'"); if (sizeof($lesson_files) > 0) { $data['files'] = $lesson_files; } if (G_VERSIONTYPE != 'community') { #cpp#ifndef COMMUNITY if (G_VERSIONTYPE != 'standard') { #cpp#ifndef STANDARD //Export scorm tables from here over $scormLessonTables = array('scorm_sequencing_adlseq_map_info', 'scorm_sequencing_content_to_organization', 'scorm_sequencing_maps_info', 'scorm_sequencing_organizations'); foreach ($scormLessonTables as $table) { $scorm_data = eF_getTableData($table, "*", "lessons_ID=" . $this->lesson['id']); if (sizeof($scorm_data) > 0) { $data[$table] = $scorm_data; } } $scormContentTables = array('scorm_sequencing_completion_threshold', 'scorm_sequencing_constrained_choice', 'scorm_sequencing_control_mode', 'scorm_sequencing_delivery_controls', 'scorm_sequencing_hide_lms_ui', 'scorm_sequencing_limit_conditions', 'scorm_sequencing_maps', 'scorm_sequencing_map_info', 'scorm_sequencing_objectives', 'scorm_sequencing_rollup_considerations', 'scorm_sequencing_rollup_controls', 'scorm_sequencing_rollup_rules', 'scorm_sequencing_rules'); if ($content_list) { foreach ($scormContentTables as $table) { $scorm_data = eF_getTableData($table, "*", "content_ID IN ({$content_list})"); if (sizeof($scorm_data) > 0) { $data[$table] = $scorm_data; } if ($table == 'scorm_sequencing_rollup_rules' && sizeof($scorm_data) > 0) { $ids = array(); foreach ($scorm_data as $value) { $ids[] = $value['id']; } $result = eF_getTableData('scorm_sequencing_rollup_rule', "*", "scorm_sequencing_rollup_rules_ID IN (" . implode(",", $ids) . ")"); $data['scorm_sequencing_rollup_rule'] = $result; } if ($table == 'scorm_sequencing_rules' && sizeof($scorm_data) > 0) { $ids = array(); foreach ($scorm_data as $value) { $ids[] = $value['id']; } $result = eF_getTableData('scorm_sequencing_rule', "*", "scorm_sequencing_rules_ID IN (" . implode(",", $ids) . ")"); $data['scorm_sequencing_rule'] = $result; } } } } #cpp#endif } #cpp#endif //'scorm_sequencing_rollup_rule', 'scorm_sequencing_rule', // MODULES - Export module data // Get all modules (NOT only the ones that have to do with the user type) $modules = eF_loadAllModules(); foreach ($modules as $module) { if ($moduleData = $module->onExportLesson($this->lesson['id'])) { $data[$module->className] = $moduleData; } } file_put_contents($this->directory . '/' . "data.dat", serialize($data)); //Create database dump file if ($exportFiles) { $lessonDirectory = new EfrontDirectory($this->directory); $file = $lessonDirectory->compress($this->lesson['id'] . '_exported.zip', false); //Compress the lesson files } else { $dataFile = new EfrontFile($this->directory . '/' . "data.dat"); $file = $dataFile->compress($this->lesson['id'] . '_exported.zip'); } $newList = FileSystemTree::importFiles($file['path']); //Import the file to the database, so we can download it $file = new EfrontFile(current($newList)); if (empty($GLOBALS['currentUser'])) { if ($_SESSION['s_login']) { $GLOBALS['currentUser'] = EfrontUserFactory::factory($_SESSION['s_login']); $userTempDir = $GLOBALS['currentUser']->user['directory'] . '/temp'; } else { $userTempDir = sys_get_temp_dir(); } } else { $userTempDir = $GLOBALS['currentUser']->user['directory'] . '/temp'; } if (!is_dir($userTempDir)) { //If the user's temp directory does not exist, create it $userTempDir = EfrontDirectory::createDirectory($userTempDir, false); $userTempDir = $userTempDir['path']; } try { $existingFile = new EfrontFile($userTempDir . '/' . EfrontFile::encode($this->lesson['name']) . '.zip'); //Delete any previous exported files $existingFile->delete(); } catch (Exception $e) { } if ($rename) { $newName = str_replace(array('"', '>', '<', '*', '?', ':'), array('"', '>', '<', '*', '?', ':'), $this->lesson['name']); $file->rename($userTempDir . '/' . EfrontFile::encode($newName) . '.zip', true); } unlink($this->directory . '/' . "data.dat"); //Delete database dump file return $file; }
exit('Failed to connect to MySQL: ' . mysqli_connect_error()); } if (strlen($year) <= 0) { $result = mysqli_query($conn, "SELECT MAX(ts) as ts from readings WHERE core_id={$id}"); if (mysql_errno()) { exit('Error: ' . mysqli_error($conn)); } $row = mysqli_fetch_array($result); if (!isset($row['ts'])) { echo "No records found"; } else { $date = Carbon::createFromTimeStamp($row['ts']); $year = $date->format('Y'); } } $calendar = new calendar(); $currentYear = $calendar->year($year); echo "<table border=0 width='100%'>"; echo "<tr><td colspan=5>"; echo "<table border=0>"; echo "<td><h2>{$title_name} Calendar</h2></td>"; echo "<td>"; echo "<span style='padding:4px 10px 4px 10px;font-size:20px;font-weight:bold;color:#CC6666;vertical-align:top;'>{$sensor_name}</span>"; echo "</td>"; echo "<td width=400> </td>"; echo "</table>"; echo "</td><tr>"; echo "<td width='100'></td>"; echo "<td align='right'><input type='button' value='< Previous' style='padding:2px;' onclick='change_year(\"" . $currentYear->prev()->int() . "\")'></td>"; echo "<td width='300' align=center ><b>" . $currentYear->name() . "</b></td>"; echo "<td><input type='button' value='Next >' style='padding:2px;' onclick='change_year(\"" . $currentYear->next()->int() . "\")'></td>";
/** * Delete course * * This function is used to delete the current course. It also * removes the course from the succession information of other * courses * <br/>Example: * <code> * $course -> delete(); * </code> * * @since 3.5.0 * @access public * @todo remove from other courses succession */ public function delete() { $this->removeLessons(array_keys($this->getCourseLessons())); $courseUsers = eF_getTableDataFlat("users_to_courses", "users_LOGIN", "courses_ID=" . $this->course['id']); $this->removeUsers($courseUsers["users_LOGIN"]); $this->deleteCourseInstances(); $this->removeCourseSkills(); $this->deleteUniqueLessons(); calendar::deleteCourseCalendarEvents($this); eF_deleteTableData("courses", "id=" . $this->course['id']); if (G_VERSIONTYPE == 'enterprise') { #cpp#ifdef ENTERPRISE eF_deleteTableData("module_hcd_course_to_job_description", "courses_ID =" . $this->course['id']); eF_deleteTableData("module_hcd_course_to_branch", "courses_ID =" . $this->course['id']); } #cpp#endif eF_updateTableData("courses", array("depends_on" => 0), "depends_on = " . $this->course['id']); $modules = eF_loadAllModules(); foreach ($modules as $module) { $module->onDeleteCourse($this->course['id']); } EfrontSearch::removeText('courses', $this->course['id'], ''); }
* Admin Menu * @author Rene Faustino Gabriel Junior (Analista-Desenvolvedor) * @copyright © Pan American Health Organization, 2013. All rights reserved. * @access public * @version v0.13.46 * @package ProEthos-Admin * @subpackage calender */ require "cab.php"; require "_class/_class_calender.php"; global $acao, $dd, $cp, $tabela; require $include . '_class_form.php'; require $include . 'sisdoc_data.php'; $form = new form(); require "form_css.php"; $cl = new calendar(); $cp = $cl->cp(); $tabela = $cl->tabela; $http_edit = page(); $http_redirect = ''; $label = msg('tit_' . $tabela); /** Edit */ echo '<h2>' . $label . '</h2>'; $tela = $form->editar($cp, $tabela); /** Caso o registro seja validado */ if ($form->saved > 0) { redirecina('admin_calender.php'); } else { echo $tela; } echo $hd->foot();
# # GPL: http://www.gnu.org/licenses/gpl.txt # ################################################## if (!defined("EXPONENT")) { exit(""); } $item = null; $iloc = null; if (isset($_POST['id'])) { $item = $db->selectObject("calendar", "id=" . intval($_POST['id'])); $loc = unserialize($item->location_data); $iloc = exponent_core_makeLocation($loc->mod, $loc->src, $item->id); } if ($item == null && exponent_permissions_check("post", $loc) || $item != null && exponent_permissions_check("edit", $loc) || $iloc != null && exponent_permissions_check("edit", $iloc)) { $item = calendar::update($_POST, $item); $item->location_data = serialize($loc); if (isset($_POST['category'])) { $item->category_id = $_POST['category']; } else { $item->category_id = 0; } //Check to see if the feedback form is enabled and/or being used for this event. if (isset($_POST['feedback_form'])) { $item->feedback_form = $_POST['feedback_form']; $item->feedback_email = $_POST['feedback_email']; } else { $item->feedback_form = ""; $item->feedback_email = ""; } if (!defined("SYS_WORKFLOW")) {
if (!popup.opener) popup.opener = self; popup.focus(); } </script> <title><?php echo $GO_CONFIG->title; ?> </title> <?php echo '<meta http-equiv="refresh" content="' . $GO_CONFIG->refresh_rate . ';url=' . $_SERVER['PHP_SELF'] . '">'; //if user uses the calendar then check for events to remind $calendar_module = $GO_MODULES->get_module('calendar'); if ($calendar_module && ($GO_SECURITY->has_permission($GO_SECURITY->user_id, $calendar_module['acl_read']) || $GO_SECURITY->has_permission($GO_SECURITY->user_id, $calendar_module['acl_write']))) { require_once $calendar_module['class_path'] . 'calendar.class.inc'; require_once $calendar_module['class_path'] . 'todos.class.inc'; $cal = new calendar(); $todos = new todos(); $remind_events = $cal->get_events_to_remind($GO_SECURITY->user_id); $remind_todos = $todos->get_todos_to_remind($GO_SECURITY->user_id); if ($remind_events || $remind_todos) { echo '<script language="javascript" type="text/javascript">popup("' . $calendar_module['url'] . 'reminder.php", "500", "200", "reminder");</script>'; } unset($cal); } $_SESSION['notified_new_mail'] = isset($_SESSION['notified_new_mail']) ? $_SESSION['notified_new_mail'] : 0; $_SESSION['new_mail'] = 0; //check for email $email_module = $GO_MODULES->get_module('email'); if ($email_module && ($GO_SECURITY->has_permission($GO_SECURITY->user_id, $email_module['acl_read']) || $GO_SECURITY->has_permission($GO_SECURITY->user_id, $email_module['acl_write']))) { require_once $email_module['class_path'] . 'email.class.inc'; require_once $GO_CONFIG->class_path . 'imap.class.inc';
:</td> <td> <table border="0"> <tr> <td><h3><?php echo $strName; ?> </td> <td><h3><?php echo $strOwner; ?> </td> </tr> <?php $cal->get_authorised_calendars($GO_SECURITY->user_id); $cal2 = new calendar(); while ($cal->next_record()) { if ($view_id > 0 && $task != 'save') { $check = $cal2->calendar_is_in_view($cal->f('id'), $view_id); } else { $check = isset($_POST['calendars']) ? in_array($cal->f('id'), $_POST['calendars']) : false; } if ($has_write_permission) { echo '<tr><td>'; $checkbox = new checkbox('calendars[]', $cal->f('id'), $cal->f('name'), $check); echo '</td><td>' . show_profile($cal->f('user_id')) . '</td></tr>'; } else { if ($check) { echo '<tr><td>' . htmlspecialchars($cal->f('name')); echo '</td><td>' . show_profile($cal->f('user_id')) . '</td></tr>'; }
<?php try { $CalendarUid = $_GET['id']; G::LoadClass('calendar'); $calendarObj = new calendar(); $calendarObj->deleteCalendar($CalendarUid); G::Header('location: calendarList'); } catch (Exception $e) { $G_PUBLISH = new Publisher(); $aMessage['MESSAGE'] = $e->getMessage(); $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage); G::RenderPage('publish', 'blank'); }
<?php $id = get_request_variable('id', ''); $save = get_request_variable('save', ''); $start_date = get_request_variable('start_date', date('Y-m-d')); $stop_date = get_request_variable('stop_date', date('Y-m-d')); $calendar = new calendar(); $calendar->loadDefault($STORAGE['current_employee']->login); $ids = calendar::getIdsForAuthor($STORAGE['current_employee']->login); $event = new calendar_event(); $event->id_event = $id; if ($id) { if (!$event->Load()) { $event->id_event = 0; } elseif (!in_array($event->calendar_id, $ids)) { $event->init(); } } else { $event->id_event = 0; } if ($save) { if ($event->calendar_id == 0) { $event->calendar_id = $calendar->id_calendar; } $event->what = get_request_variable('what', ''); $event->where = get_request_variable('where', ''); $event->description = get_request_variable('description', ''); $event->completed = get_request_variable('completed', 'no'); $event->notice = get_request_variable('notice', 'no'); $event->mark = get_request_variable('mark', 'no'); $event->start_date = parse_date('{Y}-{m}-{d}', $start_date, false);
public function calculateDueDate($sNextTasParam) { //Get Task properties $task = TaskPeer::retrieveByPK($this->getTasUid()); $aData['TAS_UID'] = $this->getTasUid(); //Added to allow User defined Timing Control at Run time from Derivation screen if (isset($sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY']) && $sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] == 'true') { $aData['TAS_DURATION'] = $sNextTasParam['NEXT_TASK']['TAS_DURATION']; $aData['TAS_TIMEUNIT'] = $sNextTasParam['NEXT_TASK']['TAS_TIMEUNIT']; $aData['TAS_TYPE_DAY'] = $sNextTasParam['NEXT_TASK']['TAS_TYPE_DAY']; if (isset($sNextTasParam['NEXT_TASK']['TAS_CALENDAR']) && $sNextTasParam['NEXT_TASK']['TAS_CALENDAR'] != '') { $aCalendarUID = $sNextTasParam['NEXT_TASK']['TAS_CALENDAR']; } else { $aCalendarUID = ''; } //Updating the task Table , so that user will see updated values in the assign screen in consequent cases $oTask = new Task(); $oTask->update($aData); } else { if (is_null($task)) { return 0; } $aData['TAS_DURATION'] = $task->getTasDuration(); $aData['TAS_TIMEUNIT'] = $task->getTasTimeUnit(); $aData['TAS_TYPE_DAY'] = $task->getTasTypeDay(); $aCalendarUID = ''; } //use the dates class to calculate dates $calendar = new calendar(); if ($calendar->pmCalendarUid == '') { $calendar->getCalendar(null, $task->getProUid(), $aData['TAS_UID']); $calendar->getCalendarData(); } $iDueDate = $calendar->calculateDate($this->getDelDelegateDate(), $aData['TAS_DURATION'], $aData['TAS_TIMEUNIT']); return $iDueDate; }