// not allowed $user = login; } } else { if (!$is_admin && $user != $login && !$is_assistant && !access_is_enabled()) { $user = $login; } } } // If not, user current user's login if ($user == '') { $user = $login; } $charset = empty($LANGUAGE) ? 'iso-8859-1' : translate('charset'); // This should work ok with RSS, may need to hardcode fallback value. $lang = languageToAbbrev($LANGUAGE == 'Browser-defined' || $LANGUAGE == 'none' ? $lang : $LANGUAGE); if ($lang == 'en') { $lang = 'en-us'; } //the RSS 2.0 default. user_load_variables($user, 'temp_'); $appStr = generate_application_name(); $descr = $appStr . ' - ' . translate('Unapproved Entries') . ' - ' . $temp_fullname; // header ( 'Content-type: application/rss+xml'); header('Content-type: text/xml'); echo '<?xml version="1.0" encoding="' . $charset . '"?> <rss version="2.0" xml:lang="' . $lang . '"> <channel> <title><![CDATA[' . $appStr . ']]></title> <link>' . $SERVER_URL . '</link> <description><![CDATA[' . $descr . ']]></description>
/** * Prints the HTML header and opening HTML body tag. * * @param array $includes Array of additional files to include referenced * from the includes directory * @param string $HeadX Data to be printed inside the head tag (meta, * script, etc) * @param string $BodyX Data to be printed inside the Body tag (onload * for example) * @param bool $disbleCustom Do not include custom header? (useful for small * popup windows, such as color selection) * @param bool $disableStyle Do not include the standard css? */ function print_header($includes = '', $HeadX = '', $BodyX = '', $disableCustom = false, $disableStyle = false) { global $application_name; global $FONTS, $WEEKENDBG, $THFG, $THBG, $PHP_SELF; global $TABLECELLFG, $TODAYCELLBG, $TEXTCOLOR; global $POPUP_FG, $BGCOLOR; global $LANGUAGE; global $CUSTOM_HEADER, $CUSTOM_SCRIPT; global $friendly; global $bodyid, $self; $lang = ''; if (!empty($LANGUAGE)) { $lang = languageToAbbrev($LANGUAGE); } if (empty($lang)) { $lang = 'en'; } // Start the header & specify the charset // The charset is defined in the translation file // TODO: set language properly if (!empty($LANGUAGE)) { $charset = translate("charset"); if ($charset != "charset") { echo "<?xml version=\"1.0\" encoding=\"{$charset}\"?>\n" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" " . "\"DTD/xhtml1-transitional.dtd\">\n" . "<html xmlns=\"http://www.w3.org/1999/xhtml\" " . "xml:lang=\"{$lang}\" lang=\"{$lang}\">\n" . "<head>\n" . "<meta http-equiv=\"Content-Type\" content=\"text/html; " . "charset={$charset}\" />\n"; echo "<title>" . translate($application_name) . "</title>\n"; } else { echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" " . "\"DTD/xhtml1-transitional.dtd\">\n" . "<html xmlns=\"http://www.w3.org/1999/xhtml\" " . "xml:lang=\"en\" lang=\"en\">\n" . "<head>\n" . "<title>" . translate($application_name) . "</title>\n"; } } // Any other includes? if (is_array($includes)) { foreach ($includes as $inc) { include_once 'includes/' . $inc; } } // Do we need anything else inside the header tag? if ($HeadX) { echo $HeadX . "\n"; } // Include the styles if (!$disableStyle) { include_once 'includes/styles.php'; } // Add custom script/stylesheet if enabled if ($CUSTOM_SCRIPT == 'Y' && !$disableCustom) { $res = dbi_query("SELECT cal_template_text FROM webcal_report_template " . "WHERE cal_template_type = 'S' and cal_report_id = 0"); if ($res) { if ($row = dbi_fetch_row($res)) { echo $row[0]; } dbi_free_result($res); } } // Include includes/print_styles.css as a media="print" stylesheet. When the // user clicks on the "Printer Friendly" link, $friendly will be non-empty, // including this as a normal stylesheet so they can see how it will look // when printed. This maintains backwards-compatibility for browsers that // don't support media="print" stylesheets echo "<link rel=\"stylesheet\" type=\"text/css\"" . (empty($friendly) ? " media=\"print\"" : "") . " href=\"includes/print_styles.css\" />\n"; // Link to favicon echo "<link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\" />\n"; // Finish the header echo "</head>\n<body"; // Find the filename of this page and give the <body> tag the corresponding id $thisPage = substr($self, strrpos($self, '/') + 1); if (isset($bodyid[$thisPage])) { echo " id=\"" . $bodyid[$thisPage] . "\""; } // Add any extra parts to the <body> tag if (!empty($BodyX)) { echo " {$BodyX}"; } echo ">\n"; // Add custom header if enabled if ($CUSTOM_HEADER == 'Y' && !$disableCustom) { $res = dbi_query("SELECT cal_template_text FROM webcal_report_template " . "WHERE cal_template_type = 'H' and cal_report_id = 0"); if ($res) { if ($row = dbi_fetch_row($res)) { echo $row[0]; } dbi_free_result($res); } } }
$last_login = $login = $webcalendar_login; } load_user_preferences(); // include "includes/translate.php"; DEJA inclu dans init.php $return_path = clean_whitespace($return_path); // see if a return path was set if (!empty($return_path)) { $url = $return_path; } else { //$url=empty ( $STARTVIEW ) ? "month.php" : "$STARTVIEW.php"; $url = "month.php"; // $url = "index.php"; } $lang = ''; if (!empty($LANGUAGE)) { $lang = languageToAbbrev($LANGUAGE); } if (empty($lang)) { $lang = 'fr'; } $login = getPostValue('login'); $password = getPostValue('password'); // calculate path for cookie if (empty($PHP_SELF)) { $PHP_SELF = $_SERVER["PHP_SELF"]; } $cookie_path = str_replace("login.php", "", $PHP_SELF); //echo "Cookie path: $cookie_path\n"; if ($single_user == "Y") { // No login for single-user mode do_redirect("index.php");
function send_doctype($doc_title = '') { global $charset, $lang, $LANGUAGE; $lang = empty($LANGUAGE) ? '' : languageToAbbrev($LANGUAGE); if (empty($lang)) { $lang = 'en'; } $charset = empty($LANGUAGE) ? 'iso-8859-1' : translate('charset'); return '<?xml version="1.0" encoding="' . $charset . '"?' . '> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . $lang . '" lang="' . $lang . '"> <head> <meta http-equiv="Content-Type" content="text/html; charset=' . $charset . '" />' . (empty($doc_title) ? '' : ' <title>' . $doc_title . '</title>'); }
$numDays = $x; } // Don't let a malicious user specify more than 365 days if ($numDays > 365) { $numDays = 365; } $endTime = mktime(3, 0, 0, $thismonth, $thisday + $numDays, $thisyear); $endDate = date("Ymd", $endTime); /* Pre-Load the repeated events for quckier access */ $repeated_events = read_repeated_events($username, $cat_id, $date); /* Pre-load the non-repeating events for quicker access */ $events = read_events($username, $date, $endDate, $cat_id); // Print header without custom header and no style sheet if (!empty($LANGUAGE)) { $charset = translate("charset"); $lang = languageToAbbrev($LANGUAGE == "Browser-defined" || $LANGUAGE == "none" ? $lang : $LANGUAGE); if ($charset != "charset") { echo "<?xml version=\"1.0\" encoding=\"{$charset}\"?>\n" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" " . "\"DTD/xhtml1-transitional.dtd\">\n" . "<html xmlns=\"http://www.w3.org/1999/xhtml\" " . "xml:lang=\"{$lang}\" lang=\"{$lang}\">\n" . "<head>\n" . "<meta http-equiv=\"Content-Type\" content=\"text/html; " . "charset={$charset}\" />\n"; } else { echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" " . "\"DTD/xhtml1-transitional.dtd\">\n" . "<html xmlns=\"http://www.w3.org/1999/xhtml\" " . "xml:lang=\"en\" lang=\"en\">\n" . "<head>\n"; } } else { echo "<html>\n"; $charset = "iso-8859-1"; } echo "<title>" . translate($application_name) . "</title>\n"; ?> </head> <body> <?php if (!empty($error)) {
$last_login = $login = $webcalendar_login; } include "includes/translate.php"; // see if a return path was set if (!empty($return_path)) { $return_path = clean_whitespace($return_path); $url = $return_path; } else { $url = "index.php"; } $lang = ''; if (!empty($LANGUAGE) && $LANGUAGE != "Browser-defined" && $LANGUAGE != "none") { $lang = languageToAbbrev($LANGUAGE); } else { $lang_long = get_browser_language(); $lang = languageToAbbrev($lang_long); } if (empty($lang)) { $lang = 'en'; } $login = getPostValue('login'); $password = getPostValue('password'); if (!empty($settings['session']) && ($settings['session'] = 'php')) { session_start(); } // calculate path for cookie if (empty($PHP_SELF)) { $PHP_SELF = $_SERVER["PHP_SELF"]; } $cookie_path = str_replace("login.php", "", $PHP_SELF); //echo "Cookie path: $cookie_path\n$cookie_path1";
function print_header($includes = '', $HeadX = '', $BodyX = '', $disableCustom = false, $disableStyle = false) { global $application_name; global $FONTS, $WEEKENDBG, $THFG, $THBG; global $TABLECELLFG, $TODAYCELLBG, $TEXTCOLOR; global $POPUP_FG, $BGCOLOR; global $LANGUAGE; global $CUSTOM_HEADER, $CUSTOM_SCRIPT; global $friendly; global $bodyid, $self, $popup; global $CUSTOM_TRAILER, $c, $STARTVIEW; global $login, $user, $cat_id, $categories_enabled, $thisyear, $thismonth, $thisday, $DATE_FORMAT_MY, $WEEK_START, $DATE_FORMAT_MD, $readonly, $is_admin, $public_access, $public_access_can_add, $single_user, $use_http_auth, $login_return_path, $require_approvals, $is_nonuser_admin, $public_access_others, $allow_view_other, $views, $reports_enabled, $LAYER_STATUS, $nonuser_enabled, $groups_enabled, $fullname, $has_boss; $lang = ''; if (!empty($LANGUAGE)) { $lang = languageToAbbrev($LANGUAGE); } if (empty($lang)) { $lang = 'en'; } // Start the header & specify the charset // The charset is defined in the translation file if (!empty($LANGUAGE)) { $charset = translate("charset"); if ($charset != "charset") { echo "<?xml version=\"1.0\" encoding=\"{$charset}\"?>\r\n<!DOCTYPE html\r\n PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\r\n \"DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"{$lang}\" lang=\"{$lang}\">\r\n<head>\r\n <title>" . translate($application_name) . "</title>\n"; } else { echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\r\n<!DOCTYPE html\r\n PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\r\n \"DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\r\n<head>\r\n <title>" . translate($application_name) . "</title>\n"; } } // Any other includes? if (is_array($includes)) { foreach ($includes as $inc) { include_once 'includes/' . $inc; } } // Do we need anything else inside the header tag? if ($HeadX) { echo $HeadX . "\n"; } // Include the styles if (!$disableStyle) { echo '<link rel="stylesheet" type="text/css" href="includes/styles.php">'; } // Add custom script/stylesheet if enabled if ($CUSTOM_SCRIPT == 'Y' && !$disableCustom) { $res = dbi_query("SELECT cal_template_text FROM webcal_report_template " . "WHERE cal_template_type = 'S' and cal_report_id = 0"); if ($res) { if ($row = dbi_fetch_row($res)) { echo $row[0]; } dbi_free_result($res); } } // Include includes/print_styles.css as a media="print" stylesheet. When the // user clicks on the "Printer Friendly" link, $friendly will be non-empty, // including this as a normal stylesheet so they can see how it will look // when printed. This maintains backwards-compatibility for browsers that // don't support media="print" stylesheets echo "<link rel=\"stylesheet\" type=\"text/css\"" . (empty($friendly) ? " media=\"print\"" : "") . " href=\"includes/print_styles.css\" />\n"; // Link to favicon echo "<link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\" />\n"; // encodage echo '<meta http-equiv="Content-Type" Content="text/html; charset=ISO-8859-1">' . "\n"; // fonctions vincent include_once 'includes/fonctions_vincent.php'; JSpopup(); // Finish the header echo "</head>\n<body"; // Find the filename of this page and give the <body> tag the corresponding id $thisPage = substr($self, strrpos($self, '/') + 1); if (isset($bodyid[$thisPage])) { echo " id=\"" . $bodyid[$thisPage] . "\""; } // Add any extra parts to the <body> tag if (!empty($BodyX)) { echo " {$BodyX}"; } // ajout du bandeau haras nationnaux if ($popup == true) { echo ">\n"; } else { echo " style=\"background-image:url(images_haras/fond_bandeau.jpg);background-repeat:no-repeat;\">\n"; } // Add custom header if enabled if ($CUSTOM_HEADER == 'Y' && !$disableCustom) { $res = dbi_query("SELECT cal_template_text FROM webcal_report_template " . "WHERE cal_template_type = 'H' and cal_report_id = 0"); if ($res) { if ($row = dbi_fetch_row($res)) { echo $row[0]; } dbi_free_result($res); } } // bandeau haras nationnaux if ($popup != true) { ?> <!-- <a href="http://xinf-prodlinux/hn2g/"><div style="position:fixed;top:30px;width:300px;height:70px;"></div></a> --> <script> function modPform(type) { //alert (type); if (type=='annuHN') { window.document.searchformentry.target='_new'; window.document.searchformentry.action='http://xinf-prodlinux/intra_drh/html/list_pers.php?lc_prmev[ro]=C&lc_prmev[typers]=I&lc_prmev[aff_pop]=Y&tf_PER_LLNOMPERS=INPLIKE&cfrf=true&tf_DRH_LLACTIVITE=LDMEG&sp_DRH_LLACTIVITE=ACTN:CPA:MTT:CMAT:CMATNR'; } else { window.document.searchformentry.target='_self'; window.document.searchformentry.action='search_handler.php'; } } </script> <div class="bandeauharas"> <form action="search_handler.php" name="searchformentry" method="POST" style="margin:0px;"> recherche <input class="gris11px" onfocus="modPform('intsearch')" type="text" style="width:100px" name="keywords" size="20"><img title="rechercher avec le moteur de recherche" src="images_haras/puce_rechercher.gif" alt="lancer la recherche" height="19" width="21" align="absmiddle" border="0" onclick="modPform('intsearch'); document.searchformentry.submit();"><img src="images_haras/separation_haut.gif" alt="" height="19" width="13" align="absmiddle" border="0"> annuaire HN <input class="gris11px" onfocus="modPform('annuHN')" type="text" style="width:100px" name="rq_PER_LLNOMPERS" size="20"><img title="rechercher dans l'annuaire des HN" src="images_haras/puce_rechercher.gif" alt="" height="19" width="21" align="absmiddle" border="0" onclick="modPform('annuHN'); window.document.searchformentry.submit()"><a href="http://xinf-prodlinux/intra_drh/html/req_rech_pers.php?prech=CI&lc_prmev[aff_pop]=Y" target=_"blank"> <img title="recherche avancée dans l'annuaire des HN" src="images_haras/puce_avance.gif" alt="" name="puce_avancee2" height="19" width="62" align="absmiddle" border="0"></a> <?php // les vues echo '<img src="images_haras/separation_haut.gif" alt="" height="19" width="13" align="absmiddle" border="0">'; if ($login != "__public__" && ($allow_view_other != "N" || $is_admin)) { ?> <select name="Vues" size="0" onchange="if(this.value) { location.href = this.value; }"> <option disabled selected>Vos vues</option> <option value="views.php">Gérer vos vues</option> <option disabled value="">----------</option> <?php for ($i = 0; $i < count($views); $i++) { echo '<option value="'; if ($views[$i]['cal_view_type'] == 'W') { echo "view_w.php?"; } elseif ($views[$i]['cal_view_type'] == 'D') { echo "view_d.php?"; } elseif ($views[$i]['cal_view_type'] == 'V') { echo "view_v.php?"; } elseif ($views[$i]['cal_view_type'] == 'T') { echo "view_t.php?timeb=0&"; } elseif ($views[$i]['cal_view_type'] == 'M') { echo "view_m.php?"; } elseif ($views[$i]['cal_view_type'] == 'L') { echo "view_l.php?"; } elseif ($views[$i]['cal_view_type'] == 'S') { echo "view_t.php?timeb=1&"; } else { echo "view_m.php?"; } echo "id=" . $views[$i]['cal_view_id']; if (!empty($thisdate)) { echo "&date={$thisdate}"; } echo '">' . $views[$i]['cal_name'] . '</option>'; } echo '</select>'; } else { echo '<select disabled="disabled"><option>Vos vues</option></select>'; } if ($login != '__public__') { echo '<img src="images_haras/separation_haut.gif" alt="" height="19" width="13" align="absmiddle" border="0"><a class="grisorange" href="import.php" title="Importez et exporter votre calendrier">Import / Export</a>'; } else { echo '<img src="images_haras/separation_haut.gif" alt="" height="19" width="13" align="absmiddle" border="0">Import / Export'; } ?> <img src="images_haras/separation_haut.gif" alt="" height="19" width="13" align="absmiddle" border="0"><a class="grisorange" href="#" onclick="window.open ( 'help_index.php', 'cal_help', 'dependent,menubar,scrollbars,height=400,width=400,innerHeight=420,outerWidth=420' );" onmouseover="window.status='Aide'" title="Obtenir de l'aide">Aide</a> <? if ( $is_admin ) { echo '<img src="images_haras/separation_haut.gif" alt="" height="19" width="13" align="absmiddle" border="0"><a class="grisorange" href="adminhome.php" title="Accéder À l\'espace d\'administration">Admin</a>'; } else { echo '<img src="images_haras/separation_haut.gif" alt="" height="19" width="13" align="absmiddle" border="0">Admin'; } ?> </span> </form> </div> <div style="top:45px;left:400px;position:absolute;font-size:12px;"> <div id="menu"> <?php $can_add = $readonly == "N" || $is_admin == "Y"; if ($public_access == "Y" && $public_access_can_add != "Y" && $login == "__public__") { $can_add = false; } if (!empty($GLOBALS['STARTVIEW'])) { $mycal = $GLOBALS['STARTVIEW'] . ".php"; } else { $mycal = "index.php"; } if ($single_user != "Y") { if (!empty($user) && $user != $login) { echo "<a title=\"Retour à mon agenda\" style=\"font-weight:bold;\" href=\"{$mycal}\">" . translate("Back to My Calendar") . "</a>"; } else { echo "<a title=\"" . translate("My Calendar") . "\" style=\"font-weight:bold;\" href=\"{$mycal}\">" . translate("My Calendar") . "</a>\n"; } if (!empty($user) && $user != $login) { $todayURL .= '?user='******'list_unapproved.php'; if ($is_nonuser_admin) { $url .= "?user={$user}"; } echo " | <a title=\"Permet de valider les évènement en attente d'approbation\" style=\"font-weight:bold;\" href=\"{$url}\">" . translate("Unapproved Events") . "</a>\n"; } if ($login == "__public__" && $public_access_others != "Y") { // don't allow them to see other people's calendar } else { if ($allow_view_other == "Y" || $is_admin) { //echo " | <a title=\"" . translate("Another User's Calendar") . "\" href=\"select_user.php\">" . translate("Another User's Calendar") . "</a>\n"; } } } else { echo "<a title=\"" . translate("My Calendar") . "\" style=\"font-weight:bold;\" href=\"{$mycal}\">" . translate("My Calendar") . "</a>\n"; echo " | <a title=\"" . translate("Today") . "\" style=\"font-weight:bold;\" href=\"{$todayURL}\">" . translate("Today") . "</a>\n"; } // only display some links if we're viewing our own calendar. if (empty($user) || $user == $login) { if ($can_add) { echo " | <a title=\"Ajouter un évènement\" style=\"font-weight:bold;\" href=\"edit_entry.php"; if (!empty($thisyear)) { print "?year={$thisyear}"; if (!empty($thismonth)) { print "&month={$thismonth}"; } if (!empty($thisday)) { print "&day={$thisday}"; } } echo "\">" . translate("Add New Entry") . "</a>\n"; } } if (empty($user) || $user == $login) { if ($login != '__public__') { echo " | <a title=\"Déconnexion\" style=\"font-weight:bold;\" href=\"login.php\">Déconnexion</a>\n"; } else { echo " | <a title=\"Déconnexion\" style=\"font-weight:bold;\" href=\"login.php\">Connexion</a>\n"; } } ?> </div> </div> <div style="padding-top:100px;"> <?php } }