Calendar Week View fünf statt sieben Tage
Eingetragen von mikolaskova (776)
am 30.04.2010 - 12:26 Uhr in
am 30.04.2010 - 12:26 Uhr in
Hallo,
ich benutze Calendar und Views und würde gern eine fünf-Tage -Wochenansicht realisieren:
gibt es die Möglichkeit, die Wochen-Ansicht so zu verändern, dass nur noch Montag bis Freitag angezeigt werden?
Gruss
- Anmelden oder Registrieren um Kommentare zu schreiben
Hast Du evl. eine Lösung
am 15.02.2011 - 14:52 Uhr
Hast Du evl. eine Lösung gefunden?
...habe in der
am 19.02.2011 - 21:54 Uhr
...habe in der calendar-week-Template gebastelt...
<?php $countingdays=1; ?>
<?php foreach ($columns as $column): ?>
<?php if ($countingdays<6): ?>
<td class="calendar-agenda-items">
<div class="calendar">
<div class="inner">
<?php print isset($time['values'][$column]) ? implode($time['values'][$column]) : ' '; ?>
</div>
</div>
</td>
<?php endif;?>
<?php $countingdays=$countingdays+1; ?>
Vielen Dank für die
am 20.02.2011 - 12:16 Uhr
Vielen Dank für die Unterstützung.
Kannst Du mir evl. auch noch einen Hinweis geben, wo ich das genau platziere bzw. ob ich dafür anderen Code ersetze? Es sieht ja ganz danach aus, nur finde ich keine Übereinstimmungen in Deinem Code und dem bestehenden.
Ich wäre Dir sehr dankbar.
unter
am 20.02.2011 - 13:02 Uhr
unter sites/all/modules/calendar/theme sind die entsprechenden Template Dateien des Calendar Modules! Wenn Du eine davon, wie z.B. die calendar-week.tpl.php abändern willst, dann kopierst Du diese in Dein verwendetes Theme und änderst die Kopie entsprechend ab.
Danach immer Theme Registry aktualisieren und gegebenenfalls Caches leeren. Damit die Änderungen auch greifen.
Die Vorgehensweise ist mir
am 20.02.2011 - 12:56 Uhr
Die Vorgehensweise ist mir hinlänglich bekannt. Ich weiß nur nicht, welche Stellen der ursprünglichen Datei ich bearbeiten/ersetzen muss.
Ich finde keine Übereinstimmungen in der Datei mit dem gezeigten Code, woran ich ausmachen könnte, an welcher Stelle der Code platziert werden muss bzw. welchen Code er ersetzt.
calendar-week.tpl.php zeile
am 20.02.2011 - 15:05 Uhr
calendar-week.tpl.php
zeile 66-74
Herzlichen dank! Allerdings
am 22.02.2011 - 10:48 Uhr
Herzlichen Dank!
Allerdings bekomme ich jetzt eine Fehlermeldung:
Parse error: syntax error, unexpected $end in /home/deelite/www/glueck/sites/all/themes/glueck_tp_01/calendar-week--calendar.tpl.php on line 82
Sind die Doppelpunkte in Zeilen 2 und 3 des Codes eigentlich richtig? Sollten da nicht Semikolons stehen? Ich habe die : mal testweise gegen ; ausgetauscht, da bekomme ich dann diesen Fehler:
Parse error: syntax error, unexpected T_ENDIF in /home/deelite/www/glueck/sites/all/themes/glueck_tp_01/calendar-week--calendar.tpl.php on line 76
Formatiert sieht der betreffende Bereich meiner Datei so aus:
66 <?php $countingdays=1; ?>
67 <?php foreach ($columns as $column): ?>
68 <?php if ($countingdays<6): ?>
69 <td class="calendar-agenda-items">
70 <div class="calendar">
71 <div class="inner">
72 <?php print isset($time['values'][$column]) ? implode($time['values'][$column]) : ' '; ?>
73 </div>
74 </div>
75 </td>
76 <?php endif; ?>
77 <?php $countingdays=$countingdays+1; ?>
78 </tr>
79 <?php endforeach; ?>
80</tbody>
81</table>
82</div></div>
Die Doppelpunkte sind
am 22.02.2011 - 11:16 Uhr
Die Doppelpunkte sind zulässige PHP-Syntax für IF-Abfragen und Schleifen (siehe PHP-Handbuch).
Im Original des Templates calendar-week.tpl.php steht in dem Teil eine geschachtelte foreach Schleife. In dem von Dir gezeigten Code wird aber nur die innere geschlossen. Vermutlich fehlt das Schließen der äußeren und das gibt die Fehlermeldung
Parse error: syntax error, unexpected $end in /home/deelite/www/glueck/sites/all/themes/glueck_tp_01/calendar-week--calendar.tpl.php on line 82
Das solltest Du noch mal überprüfen.
Beste Grüße
Werner
deelite schrieb Parse error:
am 22.02.2011 - 13:44 Uhr
Parse error: syntax error, unexpected $end in /home/deelite/www/glueck/sites/all/themes/glueck_tp_01/calendar-week--calendar.tpl.php on line 82
Sorry mein Fehler, Zeile 66-73. Habs allerdings nicht getestet und der Code betrifft auch nur die ausgabe der einzelnen Tage. Bei den Wochentagsnamen musst du das selbe auch noch machen.
gruß
Independent
Jetzt sieht das Ganze so aus
am 22.02.2011 - 15:17 Uhr
Jetzt sieht das Ganze so aus ;-(
deelite schrieb Jetzt sieht
am 22.02.2011 - 17:17 Uhr
Jetzt sieht das Ganze so aus ;-(
und wie sah es davor aus?
Welche Version benützt du denn? Multiday Module ist ja deaktiviert oder?
Sorry. Multiday war
am 22.02.2011 - 17:35 Uhr
Sorry. Multiday war eingeschaltet. Jetzt werden die Tage ausgeblendet.
Allerdings wird die Zeile oberste Zeile des Kalenders nicht mit ausgeblendet und bleibt auch bei Samstag und Sonntag stehen. Die Zeile müsste für "All day" stehen.
Bekommt man diese Zeile noch weg?
Ich habe die Zeile Mit dem
am 22.02.2011 - 18:22 Uhr
Ich habe die Zeile Mit dem Tagesdatum komplett aus dem Template entfernt. Das Tagesdatum möchte ich an einer anderen Stelle platzieren - das wird dann nochmal ein neues Problemchen.
Jetzt zeigt es nur noch die Tabellenzellen mit den unerwünschten Tagesnamen.
Mein Problem ist also nur noch, diese beiden Zellen wegzubekommen.
einen Teil kannst Du auch mit
am 22.02.2011 - 19:53 Uhr
einen Teil kannst Du auch mit den entsprechenden CSS-Klassen unsichtbar machen (display:none)...
deelite schrieb Sorry.
am 22.02.2011 - 20:01 Uhr
Sorry. Multiday war eingeschaltet.
Multiday verwendet eine andere Template Datei, deshalb die frage. Kannst du ruhig trotzdem verwenden.
Zu den Wochentagsnamen habe ich oben ja schon geschrieben dass du die noch extra ausblenden musst. Aber das kannst du genau so machen wie bei den Tagen.
Ich hab die beiden Tage jetzt
am 23.02.2011 - 10:34 Uhr
Ich hab die beiden Tage jetzt erst mal per CSS ausgeblendet, wobei mir allerdings die "saubere" Variante lieber wäre.
Leider sehe ich keinen Ansatz, den Code der jetzigen Lösung auf die Namen der Wochentage umzusetzen ;-(
Herzlichen Dank für Eure Hilfe!
<?php $countingdays=1;
am 23.02.2011 - 15:08 Uhr
<?php $countingdays=1; ?>
<?php foreach ($day_names as $cell): ?>
<?php if ($countingdays<6): ?>
<th class="<?php print $cell['class']; ?>">
<?php print $cell['data']; ?>
</th>
<?php endif;?>
<?php $countingdays=$countingdays+1; ?>
<?php endforeach; ?>
so in etwa. Aber bitte nicht einfach Copy/paste! denn der Code stammt aus einer anderen tpl Datei.
Perfekt. Tausend Dank! Die
am 23.02.2011 - 15:18 Uhr
Perfekt. Tausend Dank!
Die Datebox für das Tagesdatum musste ich auch gleich noch so behandeln.
Das war dann doch nicht ganz
am 25.02.2011 - 15:56 Uhr
Das war dann doch nicht ganz meine Lösung. Um meine Darstellung wie gewünscht zu erreichen, benötige ich das Modul Calendar Multiday und die dazugehörigen Templates.
In meinem Fall ist das die calendar-week-overlap.tpl.php. Die Wochentagsnamen habe ich schon ausgeblendet bekommen. Nur leider gelingt mir das nicht für die Zeile "all day" und die Tagesspalten.
Hat vielleicht jemand Lust, sich anzusehen, wie ich diese beiden Sachen auch bei dieser Datei ausgeblendet bekomme? Ich stehe ganz schon auf dem Schlauch...
Derzeit sieht die Datei bei mir so aus (anbei noch die Datei):
<?php
// $Id: calendar-week-overlap.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
/**
* @file
* Template to display a view as a calendar week with overlapping items
*
* @see template_preprocess_calendar_week.
*
* $day_names: An array of the day of week names for the table header.
* $rows: The rendered data for this week.
*
* For each day of the week, you have:
* $rows['date'] - the date for this day, formatted as YYYY-MM-DD.
* $rows['datebox'] - the formatted datebox for this day.
* $rows['empty'] - empty text for this day, if no items were found.
* $rows['all_day'] - an array of formatted all day items.
* $rows['items'] - an array of timed items for the day.
* $rows['items'][$time_period]['hour'] - the formatted hour for a time period.
* $rows['items'][$time_period]['ampm'] - the formatted ampm value, if any for a time period.
* $rows['items'][$time_period]['values'] - An array of formatted items for a time period.
*
* $view: The view.
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
*
*/
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
//dsm($rows);
//dsm($items);
?>
<div class="calendar-calendar"><div class="week-view">
<div id="header-container">
<table class="full">
<tbody>
<tr class="holder"><td class="calendar-time-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td></tr>
<tr>
<th class="calendar-agenda-hour"> </th>
<?php $countingdays=1; ?>
<?php foreach ($day_names as $cell): ?>
<?php if ($countingdays<6): ?>
<th class="<?php print $cell['class']; ?>">
<?php print $cell['data']; ?>
</th>
<?php endif;?>
<?php $countingdays=$countingdays+1; ?>
<?php endforeach; ?>
</tr>
</tbody>
</table>
</div>
<div id="multi-day-container">
<table class="full">
<tbody>
<tr class="holder"><td class="calendar-time-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td></tr>
<?php for ($i = 0; $i < $multiday_rows; $i++): ?>
<?php
$colpos = 0;
$rowclass = "all-day";
if( $i == 0) {
$rowclass .= " first";
}
if( $i == $multiday_rows - 1) {
$rowclass .= " last";
}
?>
<tr class="<?php print $rowclass?>">
<?php if($i == 0 && ($by_hour_count > 0 || !empty($start_times))) :?>
<td class="<?php print $agenda_hour_class ?>" rowspan="<?php print $multiday_rows?>">
<span class="calendar-hour"><?php print date_t('All day', 'datetime')?></span>
</td>
<?php endif; ?>
<?php for($j = 0; $j < 6; $j++): ?>
<?php $cell = (empty($all_day[$j][$i])) ? NULL : $all_day[$j][$i]; ?>
<?php if($cell != NULL && $cell['filled'] && $cell['wday'] == $j): ?>
<?php for($k = $colpos; $k < $cell['wday']; $k++) : ?>
<td class="calendar-agenda-items multi-day no-entry"><div class="inner"> </div></td>
<?php endfor;?>
<td colspan="<?php print $cell['colspan']?>" class="calendar-agenda-items multi-day">
<div class="inner">
<?php print $cell['entry']?>
</div>
</td>
<?php $colpos = $cell['wday'] + $cell['colspan']; ?>
<?php endif; ?>
<?php endfor; ?>
<?php for($j = $colpos; $j < 7; $j++) : ?>
<td class="calendar-agenda-items multi-day no-entry"><div class="inner"> </div></td>
<?php endfor;?>
</tr>
<?php endfor; ?>
<?php if ($multiday_rows == 0) :?>
<tr>
<td class="<?php print $agenda_hour_class ?>">
<span class="calendar-hour"><?php print date_t('All day', 'datetime')?></span>
</td>
<?php for($j = 0; $j < 6; $j++): ?>
<td class="calendar-agenda-items multi-day no-entry"><div class="inner"> </div></td>
<?php endfor; ?>
</tr>
<?php endif; ?>
<tr class="expand">
<td class="<?php print $agenda_hour_class ?>">
<span class="calendar-hour"> </span>
</td>
<?php for($j = 0; $j < 6; $j++): ?>
<td class="calendar-agenda-items multi-day no-entry"><div class="inner"> </div></td>
<?php endfor; ?>
</tr>
</thead>
</table>
</div>
<div class="header-body-divider"> </div>
<div id="single-day-container">
<script>
try {
// Hide container while it renders... Degrade w/o javascript support
$('#single-day-container').css('visibility','hidden');
}catch(e){
// swallow
}
</script>
<table class="full">
<tbody>
<tr class="holder"><td class="calendar-time-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td></tr>
<tr>
<?php for ($index = 0; $index < 8; $index++): ?>
<?php if ($index == 0 ): ?>
<td class="first">
<?php elseif ($index == 7 ) : ?>
<td class="last">
<?php else : ?>
<td>
<?php endif; ?>
<?php foreach ($start_times as $time_cnt => $start_time): ?>
<?php
if ($time_cnt == 0) {
$class = 'first ';
}
elseif ($time_cnt == count($start_times) - 1) {
$class = 'last ';
}
else {
$class = '';
} ?>
<?php if( $index == 0 ): ?>
<?php $time = $items[$start_time];?>
<div class="<?php print $class?>calendar-agenda-hour">
<span class="calendar-hour"><?php print $time['hour']; ?></span>
<span class="calendar-ampm"><?php print $time['ampm']; ?></span>
</div>
<?php else: ?>
<div class="<?php print $class?>calendar-agenda-items single-day">
<div class="half-hour"> </div>
<div class="calendar item-wrapper">
<div class="inner">
<?php if(!empty($items[$start_time]['values'][$index - 1])) :?>
<?php foreach($items[$start_time]['values'][$index - 1] as $item) :?>
<?php if (isset($item['is_first']) && $item['is_first']) :?>
<div class="item <?php print $item['class']?> first_item">
<?php else : ?>
<div class="item <?php print $item['class']?>">
<?php endif; ?>
<?php print $item['entry'] ?>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
</div>
<?php endif; ?>
<?php endforeach;?>
</td>
<?php endfor;?>
</tr>
</tbody>
</table>
</div>
<div class="single-day-footer"> </div>
</div></div>
<script>
try {
// Size and position the viewport inline so there are no delays
calendar_resizeViewport();
calendar_scrollToFirst();
// Show it now that it is complete and positioned
$('#single-day-container').css('visibility','visible');
}catch(e){
// swallow
}
</script>
Ich weiß, das Ganze ist etwas
am 07.03.2011 - 10:07 Uhr
Ich weiß, das Ganze ist etwas aufwändig. Aber hat vielleicht doch jemand Muse, sich das mal anzusehen?
Schieb ;-)
am 21.03.2011 - 18:46 Uhr
Schieb ;-)