und hier meine Lösung
Datei modules/calendar/calendarLib.class.php
ab Zeile 1006 (// parse to template)
Code:
// parse to template
$starttime = date("H:i", $startdate);
$endtime = date("H:i", $enddate);
$eenddate = " - ".date("d.m.Y", $enddate);
$eendtime = "";
if (date("d.m.Y", $startdate) == date("d.m.Y", $enddate)){
$eenddate = "";
}
if ($starttime == "00:00" && $endtime == "23:59"){
$estarttime = "";
$eendtime = "";
}
elseif ($starttime != "00:00" && $endtime == "23:59"){
$estarttime = " um ".$starttime." Uhr";
$eendtime = "";
}
else {
$estarttime = " um ".$starttime." Uhr";
$eendtime = " bis ".$endtime." Uhr";
}
$this->_objTpl->setVariable(array(
'CALENDAR_ID' => $objResultNote->fields['id'],
'CALENDAR_TITLE' => htmlentities($objResultNote->fields['name'], ENT_QUOTES, CONTREXX_CHARSET),
'CALENDAR_START' => date("Y-m-d", $startdate),
'CALENDAR_END' => date("Y-m-d", $enddate),
'CALENDAR_START_SHOW' => date("d.m.Y", $startdate),
'CALENDAR_END_SHOW' => $eenddate,
'CALENDAR_START_TIME' => $estarttime,
'CALENDAR_END_TIME' => $eendtime,
'CALENDAR_LINK' => $objResultNote->fields['link'] != '' ? "<a href='".$objResultNote->fields['link']."' target='_blank' >".$objResultNote->fields['link']."</a>" : "",
'CALENDAR_LINK_SOURCE' => $objResultNote->fields['link'],
dazu die abgespeckte Version (mehr brauch ich nicht) vom "Veranstalltungs-Information"
Code:
<!-- START calendar_show_note.html -->
<div id="calendar">
<div id="calendarNotesList">
<table cellspacing="0" cellpadding="2" width="100%">
<tbody>
<tr class="title">
<td colspan="2"><h2>[[CALENDAR_TITLE]] </h2></td>
</tr>
<tr class="row1">
<td width="25%" align="left" valign="top"><b>Wann:</b></td>
<td width="75%" valign="top">[[CALENDAR_START_SHOW]] [[CALENDAR_START_TIME]][[CALENDAR_END_SHOW]] [[CALENDAR_END_TIME]] </td>
</tr>
</tbody>
</table><br />[[CALENDAR_DESCRIPTION]] <br /><br />
<!-- BEGIN calendarRegistration -->
<div align="right">[[CALENDAR_REGISTRATION_LINK]]<br /><br /></div>
<!-- END calendarRegistration -->
</div>
<div class="calendarNote" style="width: 20px;"><br /></div>
<div class="calendarNote" style="width: 65px;">
<div id="calendarNotesList">
<table cellspacing="0" cellpadding="2" width="100%">
<tbody>
<tr class="title">
<td><b>Export</b></td>
</tr>
<tr class="row1">
<td valign="top">[[CALENDAR_ICAL_EXPORT_IMG]]</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<br />
<div style="text-align: left; width: 100%; float: left;"><a href="javascript:history.back()">[[TXT_CALENDAR_BACK]]</a></div>
<!-- END calendar_show_note.html -->
Das ganze sieht dann aus wie in der Anlage:
Zusatz Infos:
Die Programmierer von Contrexx konnten nicht direkt helfen. Ich habe mich daran gesetzt das jetzt folgendes passiert:
Wenn die Uhrzeit "00:00" bis "23:59" gespeichert ist dann wird keine Uhrzeit ausgegeben.
Wenn die Uhrzeit "08:00" bis "23:59" gespeichert ist wird nur die Startzeit ausgegeben.
Wenn die Uhrzeit "08:00" bis "11:00" gespeichert ist werden Start- und Endzeit ausgegeben.
Die Uhrzeiten außer "00:00" und "23:59" sind nur Beispiele.
Zusätzlich habe ich eingebaut:
Wenn das Start- und das Enddatum gleich sind (wie Beispielsweise beim Karfreitag) wird nur das Startdatum ausgegeben.
Weitere Änderung:
Die Ausgabe des Kalenders habe ich etwas anders gestaltet:
Statt der alten großen Form habe ich sie wesendlich verkleinert und den Bedürfnissen angepasst.
Es wird das Datum und die Uhrzeiten jetzt in einer Zeile dargestellt. Die Formatierung der ersten Zeile (Titel) habe ich mit <h2> (Überschrift 2) deutlicher gemacht. Ansonsten gibt es ein Textfeld, wo weitere Informationen eingegeben werden kann. Dieses Textfeld kann natürlich auch Bilder aufnehmen.
Schön wäre es noch wenn man den deutschen Wochentag ausgegeben werden könnte, aber wie?
Lesezeichen