phpScheduleIt
May 24, 2013, 10:19:45 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: phpScheduleIt 2.4.2 has been released!
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Schedule layout change  (Read 850 times)
ayid85
Newbie
*

Karma: 0
Posts: 9


« on: March 12, 2012, 09:06:06 AM »

Hi i saw a post about changing the schedule layout to start from available time and end at the available end time but it was more for an earlier version. I noticed that you guys might have change the logic of the program. Is there any way I could tweak the program so That I can only show the timings where slots are available
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #1 on: March 12, 2012, 02:29:39 PM »

Unfortunately there's not a simple way to do this. You can try this (I haven't tested this):

Change lib/Application/Schedule/DailyLayout.php GetLabels() function to:

Code:
public function GetLabels(Date $displayDate)
{
$labels = array();

$periods = $this->_scheduleLayout->GetLayout($displayDate);

if ($periods[0]->BeginsBefore($displayDate))
{
$labels[] = $periods[0]->Label($displayDate->GetDate());
}
else
{
$labels[] = $periods[0]->Label();
}

for ($i = 1; $i < count($periods); $i++)
{
if ($periods[$i]->IsReservable()){
$labels[] = $periods[$i]->Label();
}
}

return $labels;
}

Then lines 53-55 of tpl/schedule.tpl to:

Code:
{function name=displayUnreservable}
    <!--<td colspan="{$Slot->PeriodSpan()}" class="unreservable slot">&nbsp;</td>-->
{/function}
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!