# HG changeset patch # User Nathan Phillip Brink # Date 2011-10-18 20:21:56 # Node ID 4b85fc33379ce1007eb5798df3c4aa893241bd14 # Parent 63da13bd33d59e6323abb8abb74c85ba1c1d1efc Fix JavaScript errors on schedule print page and restrict output only to schedule selected for printing. diff --git a/inc/class.schedule.php b/inc/class.schedule.php --- a/inc/class.schedule.php +++ b/inc/class.schedule.php @@ -439,11 +439,11 @@ class Schedule $footcloser = ''; - $headcode = array('jQuery', 'jQueryUI', 'uiTabsKeyboard', 'displayTables', 'outputStyle', 'jQuery.cuteTime'); + $headcode = array('jQuery', 'jQueryUI', 'uiTabsKeyboard', 'displayTables', 'outputStyle', 'jQuery.cuteTime', 'qTip2'); if(!empty($_REQUEST['print'])) array_push($headcode, 'outputPrintStyle'); else - array_push($headcode, 'jAddress', 'qTip2'); + array_push($headcode, 'jAddress'); $outputPage = page::page_create(htmlentities($this->getName()), $headcode, array('school' => $this->school_get(), 'semester' => $this->semester_get())); @@ -453,22 +453,12 @@ class Schedule if(!empty($_REQUEST['print'])) { - echo ''; - - echo '

« Return to normal view

'; - + $script = '' + . 'jQuery(document).ready( function() {' . PHP_EOL + . ' window.print();' . PHP_EOL + . '});'; + echo $outputPage->script_wrap($script); + echo '

« Return to normal view

'; } else { echo '