~dangarner/xibo/server-120-rc1

« back to all changes in this revision

Viewing changes to server/lib/pages/schedule.class.php

  • Committer: Dan Garner
  • Date: 2010-06-13 20:27:11 UTC
  • Revision ID: dan@xibo.org.uk-20100613202711-pti4fe2kbp882rx7
[server] Use the number of weeks in a month to calculated the position and height of each week row on the schedule.

Show diffs side-by-side

added added

removed removed

Lines of Context:
217
217
            // Load this months events into an array
218
218
            $monthEvents        = $this->GetEventsForMonth($month, $year, $displayGroupIDs);
219
219
 
 
220
            Debug::LogEntry($db, 'audit', 'Number of weeks to render: ' . count($weeks), '', 'GenerateMonth');
 
221
 
 
222
            // Use the number of weeks in this month to work out how much space each week should get, and where to position it
 
223
            $monthHeightOffsetPerWeek = 100 / count($weeks);
 
224
 
 
225
            // Render a week at a time
220
226
            foreach($weeks AS $week)
221
227
            {
222
228
                // Count of the available days in this week.
231
237
                $this->lastEventID[0] = 0;
232
238
                $this->lastEventID[1] = 0;
233
239
                $this->lastEventID[2] = 0;
234
 
                $monthTop       = $weekNo * 20;
 
240
                $monthTop       = $weekNo * $monthHeightOffsetPerWeek;
235
241
 
236
242
                foreach($week as $d)
237
243
                {
248
254
                        $events3  .= '<td class="nonmonthdays" colspan="1"></td>';
249
255
                        $events4  .= '<td class="nonmonthdays" colspan="1"></td>';
250
256
                    }
251
 
 
252
 
                    if(($i >= $offset_count) && ($i < ($num_weeks * 7) - $outset))
 
257
                    else if(($i >= $offset_count) && ($i < ($num_weeks * 7) - $outset))
253
258
                    {
254
259
                        // Link for Heading and Cell
255
260
                        $linkClass      = 'days';
279
284
                            $events4    .= '<td colspan="1"></td>';
280
285
                        }
281
286
                    }
282
 
                    elseif($outset > 0)
 
287
                    else if($outset > 0)
283
288
                    {
 
289
                        Debug::LogEntry($db, 'audit', 'Outset is ' . $outset . ' and i is ' . $i, '', 'GenerateMonth');
 
290
 
284
291
                        // Days that do not belond in this month
285
292
                        if(($i >= ($num_weeks * 7) - $outset))
286
293
                        {
301
308
 
302
309
                $weekNo++;
303
310
 
304
 
                $calendar .= '   <div class="MonthRow" style="top:' . $monthTop . '%; height:20%">';
 
311
                $calendar .= '   <div class="MonthRow" style="top:' . $monthTop . '%; height:' . $monthHeightOffsetPerWeek . '%">';
305
312
                $calendar .= '    <table class="WeekRow" cellspacing="0" cellpadding="0">';
306
313
                $calendar .= '     <tr>';
307
314
                $calendar .= $weekGrid;