From bfb3730b6f77d6923c1cfdbf7e0b9619e6ca6990 Mon Sep 17 00:00:00 2001 From: aragonc Date: Tue, 22 Sep 2015 14:26:34 -0500 Subject: [PATCH] fix course copy session CT#7539 --- main/coursecopy/copy_course_session.php | 86 ++++++++++++------------- 1 file changed, 42 insertions(+), 44 deletions(-) diff --git a/main/coursecopy/copy_course_session.php b/main/coursecopy/copy_course_session.php index bf6ccbda75..04bb2d1658 100755 --- a/main/coursecopy/copy_course_session.php +++ b/main/coursecopy/copy_course_session.php @@ -55,14 +55,14 @@ function make_select_session_list($name, $sessions, $attr = array()) $attributes .= ' '.$key.'="'.$value.'"'; } } - $output = ''; if (count($sessions) == 0) { $output .= ''; } else { $output .= ''; } - + if (is_array($sessions)) { foreach ($sessions as $session) { $categoryName = ''; @@ -86,50 +86,56 @@ function display_form() $sessions = SessionManager::get_sessions_list(array(), array('name', 'ASC')); // Actions - $html .= '
'; + // Link back to the documents overview - $html .= ''. + $actionsLeft = ''. Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'), '', ICON_SIZE_MEDIUM). ''; - $html .= '
'; + + + $html .= Display::toolbarAction('toolbar-copysession', array(0 => $actionsLeft)); - $html .= Display::return_message(get_lang('CopyCourseFromSessionToSessionExplanation')); + $html .= Display::return_message(get_lang('CopyCourseFromSessionToSessionExplanation'), 'warning'); - $html .= '
'; - $html .= ''; + $html .= ''; + $html .= '
'; // origin - $html .= '
'; - $html .= ''; - $html .= ''; + $html .= ''; + $html .= '
'.make_select_session_list('sessions_list_origin', $sessions, array('onchange' => 'javascript: xajax_search_courses(this.value,\'origin\');')).'
'; + $html .= '
'; + $html .= ''; + $html .= '
'; //destination - $html .= ''; - $html .= ''; - - $html .= ''; - $html .= '
'.get_lang('OriginCoursesFromSession').':'.make_select_session_list('sessions_list_origin', $sessions, array('onchange' => 'javascript: xajax_search_courses(this.value,\'origin\');')).'
'; - $html .= '
'.get_lang('DestinationCoursesFromSession').':
'; - $html .= '
'; - $html .= '
'; - $html .= '
'; - - $html .= '

'.get_lang('TypeOfCopy').'

'; - $html .= '
'; - $html .= '
'; - - $html .= '

'; - + $html .= '
'; + $html .= ''; + $html .= '
'; + $html .= '
'; + + $html .= '
'; + $html .= ''; + $html .= '
'; + + $options = '
'; + $options .= '
'; + + $options .= '
'; + + $html .= Display::panel($options, get_lang('TypeOfCopy')); + + $html .= '
'; $html .= ''; // Add Security token $html .= ''; + $html .= '
'; $html .= '
'; - + echo $html; } @@ -145,7 +151,7 @@ function search_courses($id_session, $type) if ($type == 'origin') { $course_list = SessionManager::get_course_list_by_session_id($id_session); $temp_course_list = array(); - $return .= ''; foreach ($course_list as $course) { $temp_course_list[] = "'{$course['code']}'"; @@ -161,7 +167,7 @@ function search_courses($id_session, $type) $sessions = SessionManager::get_sessions_list(array(), array('name', 'ASC')); - $select_destination .= ''; $select_destination .= ''; foreach ($sessions as $session) { if ($id_session == $session['id']) { @@ -175,14 +181,14 @@ function search_courses($id_session, $type) $select_destination .= ''; $xajax_response -> addAssign('ajax_sessions_list_destination', 'innerHTML', api_utf8_encode($select_destination)); } else { - $select_destination .= ''; $select_destination .= ''; $select_destination .= ''; $xajax_response -> addAssign('ajax_sessions_list_destination', 'innerHTML', api_utf8_encode($select_destination)); } // Select multiple destination empty - $select_multiple_empty = ''; + $select_multiple_empty = ''; // Send response by ajax $xajax_response -> addAssign('ajax_list_courses_origin', 'innerHTML', api_utf8_encode($return)); @@ -201,7 +207,7 @@ function search_courses($id_session, $type) $rs = Database::query($sql); $course_list_destination = array(); - $return .= ''; while ($course = Database :: fetch_array($rs)) { $course_list_destination[] = $course['code']; $return .= ''; @@ -250,14 +256,6 @@ function checkSelected(id_select,id_radio,id_title,id_destination) { } } } - - if (num == 1) { - document.getElementById(id_radio).disabled = false; - document.getElementById(id_title).style.color = \'#000\'; - } else { - document.getElementById(id_radio).disabled = true; - document.getElementById(id_title).style.color = \'#aaa\'; - } } ';