diff -Naur old/calendar.php new/calendar.php --- old/calendar.php 2012-01-30 12:29:41.000000000 +0530 +++ new/calendar.php 2012-04-15 15:06:01.000000000 +0530 @@ -97,6 +97,7 @@ $string['monthnext'] = 'Next month'; $string['monththis'] = 'This month'; $string['newevent'] = 'New event'; +$string['adjustdeadline'] = 'Adjust deadlines'; $string['noupcomingevents'] = 'There are no upcoming events'; $string['oneevent'] = '1 event'; $string['preferences'] = 'Preferences'; diff -Naur old/renderer.php new/renderer.php --- old/renderer.php 2012-02-13 15:34:34.000000000 +0530 +++ new/renderer.php 2012-04-15 15:09:30.169840214 +0530 @@ -208,6 +208,17 @@ return $output; } +protected function adjust_deadline_button($courseid, $day=null, $month=null, $year=null) { + $output = html_writer::start_tag('div', array('class'=>'buttons')); + $output .= html_writer::start_tag('form', array('action'=>CALENDAR_URL.'event1.php', 'method'=>'get')); + $output .= html_writer::start_tag('div'); + $output .= html_writer::empty_tag('input', array('type'=>'submit', 'value'=>get_string('adjustdeadline', 'calendar'))); + $output .= html_writer::end_tag('div'); + $output .= html_writer::end_tag('form'); + $output .= html_writer::end_tag('div'); + return $output; + } + /** * Displays the calendar for a single day * @@ -221,6 +232,7 @@ $output = html_writer::start_tag('div', array('class'=>'header')); if (!isguestuser() && isloggedin() && calendar_user_can_add_event()) { $output .= $this->add_event_button($calendar->courseid, $calendar->day, $calendar->month, $calendar->year); + $output .= $this->adjust_deadline_button($calendar->courseid, $calendar->day, $calendar->month, $calendar->year); } //$output .= html_writer::tag('label', get_string('dayview', 'calendar'), array('for'=>'cal_course_flt_jump')); $output .= $this->course_filter_selector(array('from'=>'day', 'cal_d'=>$calendar->day, 'cal_m'=>$calendar->month, 'cal_y'=>$calendar->year), get_string('dayview', 'calendar')); @@ -396,6 +408,7 @@ $output = html_writer::start_tag('div', array('class'=>'header')); if(!isguestuser() && isloggedin() && calendar_user_can_add_event()) { $output .= $this->add_event_button($calendar->courseid, null, $calendar->month, $calendar->year); + $output .= $this->adjust_deadline_button($calendar->courseid, null, $calendar->month, $calendar->year); } $output .= get_string('detailedmonthview', 'calendar').': '.$this->course_filter_selector(array('from'=>'month', 'cal_d'=>$calendar->day, 'cal_m'=>$calendar->month, 'cal_y'=>$calendar->year)); $output .= html_writer::end_tag('div', array('class'=>'header')); @@ -621,6 +634,7 @@ $output = html_writer::start_tag('div', array('class'=>'header')); if (!isguestuser() && isloggedin() && calendar_user_can_add_event()) { $output .= $this->add_event_button($calendar->courseid); + $output .= $this->adjust_deadline_button($calendar->courseid); } $output .= html_writer::tag('label', get_string('upcomingevents', 'calendar'), array('for'=>'cal_course_flt_jump')); $output .= $this->course_filter_selector(array('from'=>'upcoming')); @@ -683,4 +697,4 @@ } return $this->output->render($select); } -} \ No newline at end of file +}