示例#1
0
文件: message.php 项目: rhertzog/lcs
function http_afficher_rendez_vous($date_heure, $date_fin)
{
  global $spip_lang_rtl;

	$dirpuce = _DIR_RACINE . 'dist';
	if (jour($date_heure) == jour($date_fin) AND mois($date_heure) == mois($date_fin) AND annee($date_heure) == annee($date_fin)) {		
	  echo "<p class='verdana2' style='text-align: center'>"._T('titre_rendez_vous')." ".majuscules(nom_jour($date_heure))." <b>".majuscules(affdate($date_heure))."</b><br />\n<b>".heures($date_heure)." "._T('date_mot_heures')." ".minutes($date_heure)."</b>";
	  echo " &nbsp; <img src='$dirpuce/puce$spip_lang_rtl.gif' alt=' ' style='border: 0px;' /> &nbsp;  ".heures($date_fin)." "._T('date_mot_heures')." ".minutes($date_fin)."</p>";
	} else {
	  echo "<p class='verdana2' style='text-align: center'>"._T('titre_rendez_vous')."<br />\n".majuscules(nom_jour($date_heure))." <b>".majuscules(affdate($date_heure))."</b>, <b>".heures($date_heure)." "._T('date_mot_heures')." ".minutes($date_heure)."</b>";
	  echo "<br />\n<img src='$dirpuce/puce$spip_lang_rtl.gif' alt=' ' style='border: 0px;' /> ".majuscules(nom_jour($date_fin))." ".majuscules(affdate($date_fin)).", <b>".heures($date_fin)." "._T('date_mot_heures')." ".minutes($date_fin)."</b></p>";
	}
}
function BOUCLE_art_agendahtml_78503d8cb0bd66f2d97f4b9c0f7d329a(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'articles';
        $command['id'] = '_art_agenda';
        $command['from'] = array('articles' => 'spip_articles', 'L1' => 'spip_mots_liens', 'L2' => 'spip_mots');
        $command['type'] = array();
        $command['groupby'] = array("articles.id_article");
        $command['select'] = array("articles.date_redac", "articles.id_article", "articles.texte", "articles.descriptif", "articles.chapo", "articles.titre", "articles.lang");
        $command['orderby'] = array('articles.date_redac');
        $command['join'] = array('L1' => array('articles', 'id_objet', 'id_article', 'L1.objet=' . sql_quote('article')), 'L2' => array('L1', 'id_mot'));
        $command['limit'] = '0,5';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('articles.statut', 'publie,prop,prepa/auteur', 'publie', ''), array('=', 'L2.titre', "'Agenda'"), array('<', 'TIMESTAMPDIFF(HOUR,articles.date_redac,NOW())/24', "1"), array('=', 'articles.lang', sql_quote($GLOBALS['spip_lang'], '', 'varchar(10) NOT NULL DEFAULT \'\'')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-menu-agenda.html', 'html_78503d8cb0bd66f2d97f4b9c0f7d329a', '_art_agenda', 4, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        lang_select($GLOBALS['spip_lang']);
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']);
            $t0 .= '
				<li>' . (($t1 = strval(affdate(normaliser_date($Pile[$SP]['date_redac'])))) !== '' ? '<span>' . $t1 . (' ' . (($t2 = strval(heures(normaliser_date($Pile[$SP]['date_redac'])) != '0' ? (($t3 = strval(heures(normaliser_date($Pile[$SP]['date_redac'])))) !== '' ? $t3 . ':' : '') . minutes(normaliser_date($Pile[$SP]['date_redac'])) : '')) !== '' ? '- ' . $t2 : '') . '</span>') : '') . '
					<a class="lien' . interdire_scripts(@$Pile[0]['exposer']) . ' article" href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '" ' . (($t1 = strval(interdire_scripts(entites_html(textebrut(filtre_introduction_dist($Pile[$SP]['descriptif'], strlen($Pile[$SP]['descriptif']) ? '' : $Pile[$SP]['chapo'] . "\n\n" . $Pile[$SP]['texte'], 500, $connect, null)))))) !== '' ? 'title="' . $t1 . '"' : '') . '>' . interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '</a>

				</li>
		';
            lang_select();
        }
        lang_select();
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_art_agenda @ squelettes/inc/inc-menu-agenda.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
示例#3
0
function heures_minutes($numdate)
{
    return _T('date_fmt_heures_minutes', array('h' => heures($numdate), 'm' => minutes($numdate)));
}
示例#4
0
function change_date_message($id_message, $heures,$minutes,$mois, $jour, $annee, $heures_fin,$minutes_fin,$mois_fin, $jour_fin, $annee_fin)
{
	$date = date("Y-m-d H:i:s", mktime($heures,$minutes,0,$mois, $jour, $annee));
	
	$jour = journum($date);
	$mois = mois($date);
	$annee = annee($date);
	$heures = heures($date);
	$minutes = minutes($date);
	
	// Verifier que la date de fin est bien posterieure au debut
	$unix_debut = date("U", mktime($heures,$minutes,0,$mois, $jour, $annee));
	$unix_fin = date("U", mktime($heures_fin,$minutes_fin,0,$mois_fin, $jour_fin, $annee_fin));
	if ($unix_fin <= $unix_debut) {
		$jour_fin = $jour;
		$mois_fin = $mois;
		$annee_fin = $annee;
		$heures_fin = $heures + 1;
		$minutes_fin = $minutes;
	}		

	$date_fin = date("Y-m-d H:i:s", mktime($heures_fin,$minutes_fin,0,$mois_fin, $jour_fin, $annee_fin));
	
	$jour_fin = journum($date_fin);
	$mois_fin = mois($date_fin);
	$annee_fin = annee($date_fin);
	$heures_fin = heures($date_fin);
	$minutes_fin = minutes($date_fin);

	sql_updateq('spip_messages', array('date_heure'=>"$annee-$mois-$jour $heures:$minutes:00",  'date_fin'=>"$annee_fin-$mois_fin-$jour_fin $heures_fin:$minutes_fin:00"), "id_message=$id_message");
}
示例#5
0
文件: agenda.php 项目: rhertzog/lcs
function http_calendrier_rv($messages, $type) {

	$total = $date_rv = '';
	if (!$messages) return $total;
	$connect_quand = $GLOBALS['visiteur_session']['quand'];

	foreach ($messages as $row) {
		$rv = ($row['location'] == 'oui');
		$date = $row['dtstart'];
		$date_fin = $row['dtend'];
		if ($row['category']=="pb") $bouton = "pense-bete";
		else if ($row['category']=="affich") $bouton = "annonce";
		else $bouton = "message";

		if ($rv) {
			$date_jour = affdate_jourcourt($date);
			$total .= "<tr><td colspan='2'>" .
				(($date_jour == $date_rv) ? '' :
				"\n<div  class='calendrier-arial11'><b>$date_jour</b></div>") .
				"</td></tr>";
			$date_rv = $date_jour;
			$rv =
		((affdate($date) == affdate($date_fin)) ?
		 ("\n<div class='calendrier-arial9 fond-agenda'>"
		  . heures($date).":".minutes($date)."<br />"
		  . heures($date_fin).":".minutes($date_fin)."</div>") :
		( "\n<div class='calendrier-arial9 fond-agenda' style='text-align: center;'>"
		  . heures($date).":".minutes($date)."<br />...</div>" ));
		}

		$c = (strtotime($date) <= $connect_quand) ? '' : " color: red;";
		$total .= "<tr><td style='width: 24px' valign='middle'>" .
		  http_href($row['url'],
				     ($rv ?
				      http_img_pack("rv.gif", 'rv',
						    http_style_background($bouton . '.gif', "no-repeat;")) : 
				      http_img_pack($bouton.".gif", $bouton, ""))) .
		"</td>\n" .
		"<td valign='middle'><div style='font-weight: bold;$c'>" .
		$rv .
		http_href($row['url'], typo($row['summary']), '', '', 'calendrier-verdana') .
		"</div></td></tr>";
	}

	if ($type == 'annonces') {
		$titre = _T('info_annonces_generales');
	}
	else if ($type == 'pb') {
		$titre = _T('infos_vos_pense_bete');
	}
	else if ($type == 'rv') {
		$titre = _T('info_vos_rendez_vous');
	}

	return
	  debut_cadre_enfonce("", true, "", $titre) .
	  "\n<table>" .
	  $total .
	  "</table>" .
	  fin_cadre_enfonce(true);
}
示例#6
0
function cs_date_long($numdate) {
	$date_array = recup_date($numdate);
	if (!$date_array) return '?';
	list($annee, $mois, $jour, $heures, $minutes, $sec) = $date_array;
	if(!defined('_SPIP19300')) list($heures, $minutes) =array(heures($numdate), minutes($numdate));
	return _T('couteau:stats_date', array('jour'=>$jour, 'mois'=>$mois, 'annee'=>substr($annee,2), 'h'=>$heures, 'm'=>$minutes, 's'=>$sec));
}
示例#7
0
function liste_rv($query, $type)
{
    global $spip_lang_rtl, $spip_lang_left, $spip_lang_right;
    if ($type == annonces) {
        $titre = _T('info_annonces_generales');
        $couleur_titre = "ccaa00";
        $couleur_texte = "black";
        $couleur_fond = "#ffffee";
    } else {
        if ($type == pb) {
            $titre = _T('infos_vos_pense_bete');
            $couleur_titre = "#3874B0";
            $couleur_fond = "#EDF3FE";
            $couleur_texte = "white";
        } else {
            if ($type == rv) {
                $titre = _T('info_vos_rendez_vous');
                $couleur_titre = "#666666";
                $couleur_fond = "#eeeeee";
                $couleur_texte = "white";
            }
        }
    }
    $result = spip_query($query);
    if (spip_num_rows($result) > 0) {
        debut_cadre_enfonce("", false, "", $titre);
        echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>";
        while ($row = spip_fetch_array($result)) {
            if (preg_match("/^=([^[:space:]]+)\$/", $row['texte'], $match)) {
                $url = $match[1];
            } else {
                $url = "message.php3?id_message=" . $row['id_message'];
            }
            $type = $row['type'];
            $rv = $row['rv'];
            $date = $row['date_heure'];
            $date_fin = $row['date_fin'];
            if ($type == "normal") {
                $bouton = "message";
            } elseif ($type == "pb") {
                $bouton = "pense-bete";
            } elseif ($type == "affich") {
                $bouton = "annonce";
            } else {
                $bouton = "message";
            }
            $titre = typo($row['titre']);
            if ($rv == "oui") {
                echo "<tr><td colspan='2'>";
                $date_jour = affdate_jourcourt($date);
                if ($date_jour != $date_rv) {
                    echo "<div class='arial11'><b>{$date_jour}</b></div>";
                }
                echo "</td></tr>";
            }
            echo "<tr>";
            echo "<td width='24' valign='middle'>";
            echo "<a href='{$url}'>";
            if ($rv == "oui") {
                echo "<img src='img_pack/rv.gif' style='background: url(img_pack/{$bouton}.gif) no-repeat;' border='0'>";
            } else {
                echo "<img src='img_pack/{$bouton}.gif' border='0'>";
            }
            echo "</a>";
            echo "</td>";
            echo "<td valign='middle'>";
            if ($rv == "oui") {
                if (affdate($date) == affdate($date_fin)) {
                    echo "<div class='arial0' style='float: {$spip_lang_left}; line-height: 12px; color: #666666; margin-{$spip_lang_right}: 3px; padding-{$spip_lang_right}: 4px; background: url(img_pack/fond-agenda.gif) {$spip_lang_right} center no-repeat;'>" . heures($date) . ":" . minutes($date) . "<br />" . heures($date_fin) . ":" . minutes($date_fin) . "</div>";
                } else {
                    echo "<div class='arial0' style='float: {$spip_lang_left}; line-height: 12px; color: #666666; margin-{$spip_lang_right}: 3px; padding-{$spip_lang_right}: 4px; background: url(img_pack/fond-agenda.gif) {$spip_lang_right} center no-repeat; text-align: center;'>" . heures($date) . ":" . minutes($date) . "<br />...</div>";
                }
            }
            echo "<div><b><a href='{$url}' class='arial1' style='color: #333333;'>{$titre}</a></b></div>";
            echo "</td>";
            echo "</tr>\n";
            $date_rv = $date_jour;
        }
        echo "</table>";
        fin_cadre_enfonce();
    }
}
示例#8
0
function afficher_si_rdv($date_heure, $date_fin, $choix)
{
	$heures_debut = heures($date_heure);
	$minutes_debut = minutes($date_heure);
	$heures_fin = heures($date_fin);
	$minutes_fin = minutes($date_fin);
  
	if ($date_fin == "0000-00-00 00:00:00") {
		$date_fin = $date_heure;
		$heures_fin = $heures_debut + 1;
	}
  
	if ($heures_fin >=24){
		$heures_fin = 23;
		$minutes_fin = 59;
	}
			
	$lib = _T('item_non_afficher_calendrier');
	if (!$choix)  $lib = "<b>$lib</b>";

	$res = "\n<div><input type='radio' name='rv' value='non' id='rv_off'" .
		(!$choix ? " checked='checked' " : '')
		. "\nonclick=\"changeVisible(this.checked, 'heure-rv', 'none', 'block');\"/>"
		. "<label for='rv_off'>"
		. $lib
		. "</label>"
		. "</div>";

	$lib = _T('item_afficher_calendrier');
	if ($choix)  $lib = "<b>$lib</b>";

	$res .= "\n<div><input type='radio' name='rv' value='oui' id='rv_on' " .
		($choix ? " checked='checked' " : '') .
		"\nonclick=\"changeVisible(this.checked, 'heure-rv', 'block', 'none');\"/>" . 
		"<label for='rv_on'>"
		. $lib
		. "</label>"
	  . '</div>';
	
	$display = ($choix ? "block" : "none");
	
	return $res .
	 "\n<div id='heure-rv' style='display: $display; padding-top: 4px; padding-left: 24px;'>" .
	  afficher_jour_mois_annee_h_m($date_heure, $heures_debut, $minutes_debut) .
	  "<br />".
	  afficher_jour_mois_annee_h_m($date_fin, $heures_fin, $minutes_fin, '_fin') .
	  "</div>";
}
示例#9
0
function date_ical($date_heure, $minutes = 0)
{
    return date("Ymd\\THis", mktime(heures($date_heure), minutes($date_heure) + $minutes, 0, mois($date_heure), jour($date_heure), annee($date_heure)));
}
function BOUCLE_article_languehtml_76ddbc2b5f1671bea60186a8fa5bb500(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    $doublons_index = array();
    $command['pagination'] = array(isset($Pile[0]['debut_article_langue']) ? $Pile[0]['debut_article_langue'] : null, 10);
    // Initialise le(s) critère(s) doublons
    if (!isset($doublons[$d = 'articles' . 'archives'])) {
        $doublons[$d] = '';
    }
    if (!isset($command['table'])) {
        $command['table'] = 'articles';
        $command['id'] = '_article_langue';
        $command['from'] = array('articles' => 'spip_articles');
        $command['type'] = array();
        $command['groupby'] = array();
        $command['select'] = array("articles.id_article", "articles.date_redac", "articles.surtitre", "articles.titre", "articles.soustitre", "articles.descriptif", "articles.chapo", "articles.texte", "articles.lang");
        $command['orderby'] = array('articles.date_redac');
        $command['join'] = array();
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('articles.statut', 'publie,prop,prepa/auteur', 'publie', ''), array('=', 'articles.lang', sql_quote($GLOBALS['spip_lang'], '', 'varchar(10) NOT NULL DEFAULT \'\'')), array('<', 'TIMESTAMPDIFF(HOUR,articles.date_redac,NOW())/24', "1"), array(sql_in('articles.id_article', $doublons[$doublons_index[] = 'articles' . 'archives'], 'NOT')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/agenda.html', 'html_76ddbc2b5f1671bea60186a8fa5bb500', '_article_langue', 41, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        // COMPTEUR
        $Numrows['_article_langue']['compteur_boucle'] = 0;
        $Numrows['_article_langue']['total'] = @intval($iter->count());
        $debut_boucle = isset($Pile[0]['debut_article_langue']) ? $Pile[0]['debut_article_langue'] : _request('debut_article_langue');
        if (substr($debut_boucle, 0, 1) == '@') {
            $debut_boucle = $Pile[0]['debut_article_langue'] = quete_debut_pagination('id_article', $Pile[0]['@id_article'] = substr($debut_boucle, 1), 10, $iter);
            $iter->seek(0);
        }
        $debut_boucle = intval($debut_boucle);
        $debut_boucle = ($tout = $debut_boucle == -1) ? 0 : $debut_boucle;
        $debut_boucle = max(0, min($debut_boucle, floor(($Numrows['_article_langue']['total'] - 1) / 10) * 10));
        $debut_boucle = intval($debut_boucle);
        $fin_boucle = min($tout ? $Numrows['_article_langue']['total'] : $debut_boucle + 9, $Numrows['_article_langue']['total'] - 1);
        $Numrows['_article_langue']['grand_total'] = $Numrows['_article_langue']['total'];
        $Numrows['_article_langue']["total"] = max(0, $fin_boucle - $debut_boucle + 1);
        if ($debut_boucle > 0 and $debut_boucle < $Numrows['_article_langue']['grand_total'] and $iter->seek($debut_boucle, 'continue')) {
            $Numrows['_article_langue']['compteur_boucle'] = $debut_boucle;
        }
        lang_select($GLOBALS['spip_lang']);
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            $Numrows['_article_langue']['compteur_boucle']++;
            if ($Numrows['_article_langue']['compteur_boucle'] <= $debut_boucle) {
                continue;
            }
            if ($Numrows['_article_langue']['compteur_boucle'] - 1 > $fin_boucle) {
                break;
            }
            foreach ($doublons_index as $k) {
                $doublons[$k] .= "," . $Pile[$SP]['id_article'];
            }
            // doublons
            lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']);
            $t0 .= '
    <hr />
        <h4>' . nom_jour(normaliser_date($Pile[$SP]['date_redac'])) . ' ' . affdate(normaliser_date($Pile[$SP]['date_redac'])) . (($t1 = strval(heures(normaliser_date($Pile[$SP]['date_redac'])) != '0' ? (($t2 = strval(heures(normaliser_date($Pile[$SP]['date_redac'])))) !== '' ? $t2 . ':' : '') . (($t2 = strval(minutes(normaliser_date($Pile[$SP]['date_redac'])))) !== '' ? $t2 . (' ' . _T('public|spip|ecrire:heures')) : '') : '')) !== '' ? ' — ' . $t1 : '') . '</h4>
    <hr />
      ' . (($t1 = strval(filtrer('image_graver', filtrer('image_reduire', !is_array($l = quete_logo('id_article', 'ON', $Pile[$SP]['id_article'], '', 0)) ? '' : "<img class=\"spip_logo spip_logos\" alt=\"\" src=\"{$l['0']}\"" . $l[2] . ($l[1] ? " onmouseover=\"this.src='{$l['1']}'\" onmouseout=\"this.src='{$l['0']}'\"" : "") . ' />', '150', '0')))) !== '' ? '<span style="float:right;">' . $t1 . '</span>' : '') . '
			' . (($t1 = strval(interdire_scripts(typo($Pile[$SP]['surtitre'], "TYPO", $connect, $Pile[0])))) !== '' ? '<div class="surtitre">' . $t1 . '</div>' : '') . '
      <h3><a href="' . spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')) . '/' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '">' . interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '</a></h3>
      ' . (($t1 = strval(interdire_scripts(typo($Pile[$SP]['soustitre'], "TYPO", $connect, $Pile[0])))) !== '' ? '<div class="sous-titre">' . $t1 . '</div>' : '') . '
      <div class="detail">
      </div><!-- detail -->
      ' . (($t1 = strval(interdire_scripts(propre($Pile[$SP]['descriptif'], $connect, $Pile[0]) ? (($t2 = strval(interdire_scripts(propre($Pile[$SP]['descriptif'], $connect, $Pile[0])))) !== '' ? '<div class="">' . $t2 . ('</div>
		<div class="suite"><a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '" title="...' . _T('public|spip|ecrire:suite') . ' : ' . interdire_scripts(attribut_html(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])))) . '" >' . _T('public|spip|ecrire:suite') . '</a></div>') : '') . '
		' : interdire_scripts(propre($Pile[$SP]['chapo'], $connect, $Pile[0]) ? (($t3 = strval(interdire_scripts(propre($Pile[$SP]['chapo'], $connect, $Pile[0])))) !== '' ? '<div class="">' . $t3 . ('</div>
      	<div class="suite"><a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '" title="...' . _T('public|spip|ecrire:suite') . ' : ' . interdire_scripts(attribut_html(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])))) . '" >' . _T('public|spip|ecrire:suite') . '</a></div>') : '') . '
      		' : (($t3 = strval(interdire_scripts(couper(propre($Pile[$SP]['texte'], $connect, $Pile[0]), '300')))) !== '' ? '<div class="">' . $t3 . ('</div>
      	<div class="suite"><a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '" title="...' . _T('public|spip|ecrire:suite') . ' : ' . interdire_scripts(attribut_html(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])))) . '" >' . _T('public|spip|ecrire:suite') . '</a></div>') : '') . '
		') . '
	'))) !== '' ? '<div class="texte">
	<div class="extrait">' . $t1 . '</div><!-- fin extrait -->
      </div>' : '') . '
      <br />
    ';
            lang_select();
        }
        lang_select();
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_article_langue @ squelettes/agenda.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
示例#11
0
function presenter_message_boucles($row, $afficher_auteurs)
{
	global $connect_id_auteur, $spip_lang_left, $spip_lang_rtl;

	$vals = array();

	$id_message = $row['id_message'];
	$date = $row["date_heure"];
	$date_fin = $row["date_fin"];
	$titre = sinon($row['titre'], _T('ecrire:info_sans_titre'));
	$type = $row["type"];
	$rv = $row["rv"];

			//
			// Titre
			//

	$s = "<a href='" . generer_url_ecrire("message","id_message=$id_message") . "' style='display: block;'>";

	switch ($type) {
	case 'pb' :
				$puce = "m_envoi_bleu$spip_lang_rtl.gif";
				break;
	case 'memo' :
				$puce = "m_envoi_jaune$spip_lang_rtl.gif";
				break;
	case 'affich' :
				$puce = "m_envoi_jaune$spip_lang_rtl.gif";
				break;
	case 'normal':
	default:
				$puce = "m_envoi$spip_lang_rtl.gif";
				break;
	}
				
	$s .= http_img_pack("$puce", "", "width='14' height='7'");
	$s .= "&nbsp;&nbsp;".typo($titre)."</a>";
	$vals[] = $s;

			//
			// Auteurs

	if ($afficher_auteurs) {
		$result_auteurs = sql_select("auteurs.id_auteur, auteurs.nom", "spip_auteurs AS auteurs, spip_auteurs_messages AS lien", "lien.id_message=$id_message AND lien.id_auteur!=$connect_id_auteur AND lien.id_auteur=auteurs.id_auteur");

		$auteurs = '';
		while ($row_auteurs = sql_fetch($result_auteurs)) {
			$id_auteur = $row_auteurs['id_auteur'];
			$auteurs[] = "<a href='" . generer_url_ecrire("auteur_infos","id_auteur=$id_auteur") . "'>".typo($row_auteurs['nom'])."</a>";
		}

		if ($auteurs AND $type == 'normal') {
			$s = "<span class='arial1 spip_x-small'>" . join(', ', $auteurs) . "</span>";
		} else $s = "&nbsp;";
		$vals[] = $s;
	}
			
			//
			// Messages de forums
			
	$total_forum = sql_countsel('spip_forum', "id_message=$id_message");
			
	if ($total_forum > 0) $vals[] = "($total_forum)";
	else $vals[] = "";
			
			//
			// Date
			//
			
	$s = affdate($date);
	if ($rv == 'oui') {
		$jour=journum($date);
		$mois=mois($date);
		$annee=annee($date);
				
		$heure = heures($date).":".minutes($date);
		if (affdate($date) == affdate($date_fin))
			$heure_fin = heures($date_fin).":".minutes($date_fin);
		else 
			$heure_fin = "...";

		$s = "<div " . 
			http_style_background('rv-12.gif', "$spip_lang_left center no-repeat; padding-$spip_lang_left: 15px") .
			"><a href='" . generer_url_ecrire("calendrier","type=jour&jour=$jour&mois=$mois&annee=$annee") . "'><b style='color: black;'>$s</b><br />$heure-$heure_fin</a></div>";
	} else {
		$s = "<span style='color: #999999'>$s</span>";
	}
			
	$vals[] = $s;

	return $vals;
}
示例#12
0
function lcm_page_start($title = "", $css_files = "", $meta = '', $help_code = '')
{
    global $connect_id_auteur;
    global $connect_status;
    global $auth_can_disconnect, $connect_login;
    global $options;
    global $lcm_lang, $lcm_lang_rtl, $lcm_lang_left, $lcm_lang_right;
    global $clean_link;
    global $prefs;
    // Clean the global link (i.e. remove actions passed in the URL)
    $clean_link->delVar('var_lang');
    $clean_link->delVar('set_options');
    $clean_link->delVar('set_couleur');
    $clean_link->delVar('set_disp');
    $clean_link->delVar('set_ecran');
    lcm_html_start($title, $css_files, $meta);
    //
    // Title (mandatory) and description (may be empty) of the site
    //
    $site_name = _T(read_meta('site_name'));
    if (!$site_name) {
        $site_name = _T('title_software');
    }
    $site_desc = _T(read_meta('site_description'));
    //
    // Most of the header/navigation html
    //
    echo '<div id="header">
		<a href="summary.php" class="balance_link">&nbsp;</a>
		<h1 class="lcm_main_head"><a href="summary.php" class="head_ttl_link">' . $site_name . '</a></h1>
		<div class="lcm_slogan"><a href="summary.php" class="head_subttl_link">' . $site_desc . "</a></div>\n\t\t<br />\n\t</div>\n";
    echo "<div id='wrapper_" . $prefs['screen'] . "'>\n\t\t<div id=\"container_" . $prefs['screen'] . "\">\n\t\t\t<div id=\"content_" . $prefs['screen'] . "\">\n\t\t\t<!-- This is the navigation column, usually used for menus and brief information -->\n\t\t\t\t<div id=\"navigation_menu_column\">\n\t\t\t\t<!-- Start of navigation_menu_column content -->\n\t\t\t\t\t<div class=\"nav_menu_box\">\n\t\t\t\t\t\t<div class=\"nav_column_menu_head\"><div class=\"mm_main_menu\">" . _T('menu_main') . "</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<ul class=\"nav_menu_list\">";
    echo show_navmenu_item("listcases.php", 'main_cases');
    // Require to be explicitly off in order to hide the menu item (avoid config errors)
    if (read_meta('client_hide_all') != 'yes') {
        echo show_navmenu_item("listclients.php", 'main_clients');
    }
    if (read_meta('org_hide_all') != 'yes') {
        echo show_navmenu_item("listorgs.php", 'main_orgs');
    }
    if (read_meta('expenses_hide_all') != 'yes') {
        echo show_navmenu_item("listexps.php", "main_expenses");
    }
    echo show_navmenu_item("listauthors.php", 'main_authors');
    echo "</ul>\n";
    echo "</div>\n";
    if ($connect_status == 'admin') {
        echo "<div class=\"nav_menu_box\">\n";
        echo "<div class=\"nav_column_menu_head\"><div class=\"mm_admin\">" . _T('menu_admin') . "</div></div>\n";
        echo "<ul class=\"nav_menu_list\">";
        show_navmenu_item("config_site.php", "admin_siteconf");
        show_navmenu_item("archive.php", "admin_archives");
        show_navmenu_item("listreps.php", "admin_reports");
        show_navmenu_item("keywords.php", "admin_keywords");
        echo "</ul>\n";
        echo "</div>\n";
    }
    // Show today's date
    if ($title != _T('title_upgrade_database')) {
        echo "<div class=\"nav_menu_box\">\n";
        echo "<div class=\"nav_column_menu_head\">\n";
        echo "<div class=\"mm_calendar\">" . _T('menu_calendar') . "</div>\n";
        echo "</div>\n";
        // Show calendar
        include_lcm('inc_calendar');
        $now = date('Y-m-d');
        echo "<table border='0' align='center'><tr><td>\n";
        // Temporary? [ML]
        echo http_calendrier_agenda(mois($now), annee($now), jour($now), mois($now), annee($now), false, 'calendar.php');
        echo "</td></tr></table>\n";
        echo "</div>\n";
        // Start agenda box
        echo '<div class="nav_menu_box">' . "\n";
        echo '<div class="nav_column_menu_head">';
        echo '<div class="mm_agenda">' . _T('menu_agenda') . "</div>\n";
        echo "</div>\n";
        $events = false;
        // Show appointments for today
        $q = "SELECT app.id_app, start_time, type, title\n\t\t\tFROM lcm_app as app, lcm_author_app as aut\n\t\t\tWHERE aut.id_author=" . $GLOBALS['author_session']['id_author'] . "\n\t\t\tAND app.id_app = aut.id_app\n\t\t\tAND " . lcm_query_trunc_field('app.start_time', 'day') . "\n\t\t\t= " . lcm_query_trunc_field('NOW()', 'day') . "\n\t\t\tORDER BY app.reminder ASC";
        $result = lcm_query($q);
        if (lcm_num_rows($result) > 0) {
            $events = true;
            $today = getdate(time());
            echo "<p class=\"nav_column_text\">\n" . '<strong><a class="content_link" href="calendar.php?type=jour' . "&amp;jour=" . $today['mday'] . "&amp;mois=" . $today['mon'] . "&amp;annee=" . $today['year'] . '">' . _Th('calendar_button_now') . "</a></strong><br />\n";
            echo "</p>\n";
            echo "<ul class=\"small_agenda\">\n";
            while ($row = lcm_fetch_array($result)) {
                echo "<li><a href=\"app_det.php?app=" . $row['id_app'] . "\">" . heures($row['start_time']) . ':' . minutes($row['start_time']) . " - " . $row['title'] . "</a></li>\n";
            }
            echo "</ul>\n";
            echo "<hr class=\"hair_line\" />\n";
        }
        // Show next appointments
        $q = "SELECT a.id_app, a.start_time, a.type, a.title\n\t\t\tFROM lcm_app as a, lcm_author_app as aa\n\t\t\tWHERE (aa.id_author = " . $GLOBALS['author_session']['id_author'] . "\n\t\t\t\t\tAND a.id_app = aa.id_app\n\t\t\t\t\tAND a.start_time >= '" . date('Y-m-d H:i:s', (int) ceil(time() / 86400) * 86400) . "')\n\t\t\tORDER BY a.reminder ASC\n\t\t\tLIMIT 5";
        $result = lcm_query($q);
        if (lcm_num_rows($result) > 0) {
            $events = true;
            echo "<p class=\"nav_column_text\">\n";
            echo "<strong>" . _T('calendar_button_nextapps') . "</strong><br />\n";
            echo "</p>\n";
            echo "<ul class=\"small_agenda\">\n";
            while ($row = lcm_fetch_array($result)) {
                echo "<li><a href=\"app_det.php?app=" . $row['id_app'] . "\">" . format_date($row['start_time'], 'short') . " - " . $row['title'] . "</a></li>\n";
            }
            echo "</ul>\n";
        }
        if (!$events) {
            echo '<p class="nav_column_text">' . _T('calendar_info_noacts') . "</p>\n";
        }
        // my appointments
        echo '&nbsp;<a href="author_det.php?tab=appointments&amp;author=' . $GLOBALS['author_session']['id_author'] . '" title="' . _T('title_agenda_list') . '">' . '<img src="images/jimmac/stock_show-form-dialog.png" border="0" width="16" height="16" alt="" /></a>';
        // new appointment
        echo '&nbsp;<a href="edit_app.php?app=0" title="' . _T('app_button_new') . '">' . '<img src="images/jimmac/stock_new-16.png" border="0" width="16" height="16" alt="" /></a>';
        // End of nav_menu_box for Agenda
        echo "</div>\n";
    }
    // End of "navigation_menu_column" content
    echo "</div>\n\n\t\t\t\t<!-- The main content will be here - all the data, html forms, search results etc. -->\n\t\t\t\t<div id=\"main_column\">\n\t\t\t\t\n\t\t\t\t\t<!-- Start of 'main_column' content -->\n\t\t\t\t\t<h3 class=\"content_head\">";
    if ($help_code) {
        echo '<span class="help_icon">' . lcm_help($help_code) . "</span> ";
    }
    echo $title;
    echo "</h3>\n\t\t\t\t\t<!-- [KM] Just a small experiment how the future breadcrumb will look like -->\n\t\t\t\t\t<!-- div id=\"breadcrumb\"><a href=\"#\" title=\"Test link\">Home</a> &gt; <a href=\"#\" title=\"Test link\">Page1</a> &gt; <a href=\"#\" title=\"Test link\">Subpage1</a> &gt; Subsubpage1</div -->\n\t";
}
示例#13
0
function http_calendrier_rv($messages, $type)
{
    global $lcm_lang_rtl;
    $total = '';
    if (!$messages) {
        return $total;
    }
    foreach ($messages as $row) {
        if (preg_match("/^=([^[:space:]]+)\$/", $row['texte'], $match)) {
            $url = $match[1];
        } else {
            $url = "message.php3?id_message=" . $row['id_message'];
        }
        $rv = $row['rv'] == 'oui';
        $date = $row['date_heure'];
        $date_fin = $row['date_fin'];
        if ($row['type'] == "pb") {
            $bouton = "pense-bete";
        } else {
            if ($row['type'] == "annonces") {
                $bouton = "annonce";
            } else {
                $bouton = "message";
            }
        }
        if ($rv) {
            $date_jour = affdate_jourcourt($date);
            $total .= "<tr><td colspan='2'>" . ($date_jour == $date_rv ? '' : "<div><b>{$date_jour}</b></div>") . "</td></tr>";
        }
        $total .= "<tr><td width='24' valign='middle'>" . http_href($url, $rv ? http_img_pack("rv.gif", '', http_style_background($bouton . '.gif', "no-repeat;' border='0'")) : http_img_pack("{$bouton}.gif", '', "border='0'"), '', '') . "</td>" . "<td valign='middle'>" . (!$rv ? '' : (affdate($date) == affdate($date_fin) ? "<div style='font-size: 9px;'" . http_style_background('fond-agenda.gif', "right center no-repeat; float: left; line-height: 12px; color: #666666; margin-right: 3px; padding-right: 4px;") . heures($date) . ":" . minutes($date) . "<br />" . heures($date_fin) . ":" . minutes($date_fin) . "</div>" : "<div style='font-size: 9px;'" . http_style_background('fond-agenda.gif', "right center no-repeat; float: left; line-height: 12px; color: #666666; margin-right: 3px; padding-right: 4px; text-align: center;") . heures($date) . ":" . minutes($date) . "<br />...</div>")) . "<div><b>" . http_href($url, typo($row['titre']), '', 'font-size: 10px;') . "</b></div>" . "</td>" . "</tr>\n";
        $date_rv = $date_jour;
    }
    if ($type == 'annonces') {
        $titre = _T('info_annonces_generales');
        $couleur_titre = "ccaa00";
        $couleur_texte = "black";
        $couleur_fond = "#ffffee";
    } else {
        if ($type == 'pb') {
            $titre = _T('infos_vos_pense_bete');
            $couleur_titre = "#3874B0";
            $couleur_fond = "#EDF3FE";
            $couleur_texte = "white";
        } else {
            if ($type == 'rv') {
                $titre = _T('info_vos_rendez_vous');
                $couleur_titre = "#666666";
                $couleur_fond = "#eeeeee";
                $couleur_texte = "white";
            }
        }
    }
    return debut_cadre_enfonce("", true, "", $titre) . "<table width='98%' border='0' cellpadding='0' cellspacing='2'>" . $total . "</table>" . fin_cadre_enfonce(true);
}