Final changes in the order course feature moving link to the Account buble in userportal

skala
Julio Montoya 14 years ago
parent a8c8297c21
commit 07d3e49779
  1. 17
      main/auth/courses.php
  2. 2
      main/coursecopy/classes/Glossary.class.php
  3. 13
      main/css/base.css
  4. 15
      main/css/base_chamilo.css
  5. 7
      main/inc/lib/display.lib.php
  6. 5
      main/template/default/auth/courses_categories.php
  7. 121
      main/template/default/auth/courses_list.php
  8. 13
      main/webservices/soap_course.php
  9. 14
      user_portal.php

@ -73,23 +73,34 @@ if (isset($_GET['action']) && in_array($_GET['action'],$actions)) {
$action = $_GET['action'];
}
if ($action == 'createcoursecategory') {
if ($action == 'createcoursecategory') {
$nameTools = get_lang('CreateCourseCategory');
}
if ($action == 'subscribe') {
$nameTools = get_lang('SubscribeToCourse');
}
if ($action == 'display_random_courses' || $action == 'display_courses') {
$nameTools = get_lang('CourseManagement');
}
// Breadcrumbs.
$interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'user_portal.php', 'name' => get_lang('MyCourses'));
if (empty($nameTools)) {
$nameTools = get_lang('CourseManagement');
} else {
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'auth/courses.php', 'name' => get_lang('CourseManagement'));
if (!in_array($action, array('sortmycourses', 'createcoursecategory', 'display_random_courses', 'display_courses'))) {
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'auth/courses.php', 'name' => get_lang('CourseManagement'));
}
if ($action == 'createcoursecategory') {
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'auth/courses.php?action=sortmycourses', 'name' => get_lang('SortMyCourses'));
}
$interbreadcrumb[] = array('url' => '#', 'name' => $nameTools);
}
// course description controller object
$courses_controller = new CoursesController();

@ -11,7 +11,7 @@ require_once 'Resource.class.php';
/**
* Add resource glossary
* @author Isaac flores <florespaz@bidsoftperu.com>
* @author Isaac flores
* @package chamilo.backup
*/
class Glossary extends Resource

@ -2494,3 +2494,16 @@ div.admin_section h4 {
width: 560px;
z-index: 0;
}
.userportal-order-courses-link {
background-color: #F9F9F9;
border-radius: 10px 10px 10px 10px;
height: 40px;
margin: 5px;
padding: 15px;
}
.userportal-order-courses-link a {
float:right;
}

@ -1125,7 +1125,6 @@ div.admin_section h4 {
.user_course_category {
background-color: #E5EDF9;
border: 1px solid #666;
font-weight: bold;
color: #666;
list-style-type: none;
@ -2511,9 +2510,12 @@ span.form_required {
.userportal-catalog-item {
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
background-color:#F9F9F9;
padding:5px 10px 10px 6px;
border-radius: 10px;
border: 1px solid #DCE5F3;
/*background-color:#F9F9F9; */
padding:0px 0px 0px 5px;
margin:5px;
/* height:40px; */
}
@ -2524,16 +2526,13 @@ span.form_required {
}
.catalog_box {
border: 1px solid #DCE5F3;
/* font-weight: bold; */
color: #666;
list-style-type: none;
margin:5px 5px 10px 5px;
padding: 5px;
background-color:#FFF;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
}

@ -709,6 +709,13 @@ class Display {
}
return self::tag('input', '',$extra_attributes);
}
public static function button($name, $value, $extra_attributes = array()) {
if (!empty($name)) {
$extra_attributes['name']= $name;
}
return self::tag('button', $value, $extra_attributes);
}
/**
* Displays an HTML select tag

@ -51,6 +51,7 @@ if (intval($_GET['hidden_links']) != 1) { ?>
} else {
echo '<a href="'.api_get_self().'?action=display_random_courses">'.get_lang('RandomPick').'</a>';
}
// level 1
foreach ($browse_course_categories[0] as $category) {
$category_name = $category['name'];
@ -63,10 +64,11 @@ if (intval($_GET['hidden_links']) != 1) { ?>
if (!empty($count_courses_lv1)) {
$category_link = '<a href="'. api_get_self().'?action=display_courses&amp;category_code='.$category_code.'&amp;hidden_links='.$hidden_links.'">'.$category_name.'</a> ('.$count_courses_lv1.')';
} else {
$category_link = '<a href="#">'.$category_name.' ('.$count_courses_lv1.')</a>';
$category_link = ''.$category_name.' ('.$count_courses_lv1.')';
}
}
echo '<div>'.$category_link.'</div>';
// level 2
if (!empty($browse_course_categories[$category_code])) {
foreach ($browse_course_categories[$category_code] as $subcategory1) {
@ -80,6 +82,7 @@ if (intval($_GET['hidden_links']) != 1) { ?>
}
echo '<div style="margin-left:20px;">'.$subcategory1_link.'</div>';
}
// level 3
if (!empty($browse_course_categories[$subcategory1_code])) {
foreach ($browse_course_categories[$subcategory1_code] as $subcategory2) {

@ -34,15 +34,8 @@ $courses_without_category = $courses_in_category[0];
foreach ($courses_without_category as $course) {
echo '<tr>';
if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
$icon_title = get_lang('CourseDetails') . ' - ' . $course['title'];
?>
<td>
<a href="<?php echo api_get_path(WEB_CODE_PATH); ?>inc/ajax/course_home.ajax.php?a=show_course_information&code=<?php echo $course['code'] ?>" title="<?php echo $icon_title ?>" class="thickbox">
<?php echo Display::return_icon('info.png', $icon_title, '','22'); ?>
</a>
</td>
<?php } ?>
<td>
<a name="course<?php echo $course['code']; ?>"></a>
<strong><?php echo $course['title']; ?></strong><br />
@ -71,11 +64,19 @@ $courses_without_category = $courses_in_category[0];
<?php } ?>
</select>
<button class="save" type="submit" name="submit_change_course_category"><?php echo get_lang('Ok') ?></button>
</form>
</form><br />
</div>
<?php } ?>
<div style="float:left;">
<div style="float:left; width:110px">
<?php
if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
$icon_title = get_lang('CourseDetails') . ' - ' . $course['title'];
?>
<a href="<?php echo api_get_path(WEB_CODE_PATH); ?>inc/ajax/course_home.ajax.php?a=show_course_information&code=<?php echo $course['code'] ?>" title="<?php echo $icon_title ?>" class="thickbox">
<?php echo Display::return_icon('info.png', $icon_title, '','22'); ?>
</a>
<?php } ?>
<?php if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) { ?>
<?php echo Display::display_icon('edit_na.png', get_lang('Edit'),'',22); ?>
@ -101,27 +102,31 @@ $courses_without_category = $courses_in_category[0];
<?php } else {
echo Display::display_icon('down_na.png', get_lang('Down'),'',22);
}?>
</div>
</div>
<div style="float:left; margin-right:10px;">
<!-- cancel subscrioption-->
<?php if ($course['status'] != 1) {
if ($course['unsubscr'] == 1) {
?>
<!-- changed link to submit to avoid action by the search tool indexer -->
<div style="float:left; margin-right:10px;">
<form style="width:20px;"action="<?php echo api_get_self(); ?>" method="post" onsubmit="javascript: if (!confirm('<?php echo addslashes(api_htmlentities(get_lang("ConfirmUnsubscribeFromCourse"), ENT_QUOTES, api_get_system_encoding())) ?>')) return false;">
<!-- changed link to submit to avoid action by the search tool indexer -->
<form action="<?php echo api_get_self(); ?>" method="post" onsubmit="javascript: if (!confirm('<?php echo addslashes(api_htmlentities(get_lang("ConfirmUnsubscribeFromCourse"), ENT_QUOTES, api_get_system_encoding())) ?>')) return false;">
<input type="hidden" name="sec_token" value="<?php echo $stok; ?>">
<input type="hidden" name="unsubscribe" value="<?php echo $course['code']; ?>" />
<input type="image" name="unsub" style="border-color:#fff" src="<?php echo api_get_path(WEB_IMG_PATH).'/icons/22/unsubscribe_course.png'; ?>" title="<?php echo get_lang('_unsubscribe') ?>" alt="<?php echo get_lang('_unsubscribe'); ?>" />
<button class="a_button orange small" value="<?php echo get_lang('_unsubscribe'); ?>" name="unsub">
<?php echo get_lang('_unsubscribe'); ?>
</button>
</form>
</div>
<?php } else {
echo get_lang('UnsubscribeNotAllowed');
//echo get_lang('UnsubscribeNotAllowed');
//echo Display::url(get_lang('_unsubscribe'), '#', array('class'=>'a_button white small '));
}
} else {
echo get_lang('CourseAdminUnsubscribeNotAllowed');
//echo get_lang('CourseAdminUnsubscribeNotAllowed');
//echo Display::url(get_lang('_unsubscribe'), '#', array('class'=>'a_button white small '));
}
?>
</td>
</tr>
<?php $key++;
@ -133,8 +138,8 @@ $courses_without_category = $courses_in_category[0];
foreach ($user_course_categories as $row) {
if (isset($_GET['categoryid']) && $_GET['categoryid'] == $row['id']) {
?>
<!-- We display the edit form for the category -->
<tr><td colspan="2" class="user_course_category">
<!-- We display the edit form for the category -->
<tr><td class="user_course_category">
<a name="category<?php echo $row['id']; ?>"></a>
<form name="edit_course_category" method="post" action="courses.php?action=<?php echo $action; ?>">
<input type="hidden" name="edit_course_category" value="<?php echo $row['id']; ?>" />
@ -143,9 +148,8 @@ $courses_without_category = $courses_in_category[0];
<button class="save" type="submit" name="submit_edit_course_category"><?php echo get_lang('Ok'); ?></button>
</form>
<?php } else { ?>
<tr>
<td colspan="2" class="user_course_category">
<td class="user_course_category">
<a name="category<?php echo $row['id']; ?>"></a>
<?php echo $row['title']; ?>
<?php } ?>
@ -154,7 +158,8 @@ $courses_without_category = $courses_in_category[0];
<td class="user_course_category">
<!-- display category icons -->
<?php $max_category_key = count($user_course_categories);
<?php
$max_category_key = count($user_course_categories);
if ($action != 'unsubscribe') { ?>
<a href="courses.php?action=sortmycourses&amp;categoryid=<?php echo $row['id']; ?>&amp;sec_token=<?php echo $stok; ?>#category<?php echo $row['id']; ?>">
@ -162,21 +167,18 @@ $courses_without_category = $courses_in_category[0];
</a>
<?php if ($row['id'] != $user_course_categories[0]['id']) { ?>
<a href="courses.php?action=<?php echo $action ?>&amp;move=up&amp;category=<?php echo $row['id']; ?>&amp;sec_token=<?php echo $stok; ?>">
<?php echo Display::return_icon('up.png', get_lang('Up'),'',22); ?>
</a>
<?php } else { ?>
<?php echo Display::return_icon('up_na.png', get_lang('Up'),'',22); ?>
<?php } ?>
<a href="courses.php?action=<?php echo $action ?>&amp;move=up&amp;category=<?php echo $row['id']; ?>&amp;sec_token=<?php echo $stok; ?>">
<?php echo Display::return_icon('up.png', get_lang('Up'),'',22); ?>
</a>
<?php } else { ?>
<?php echo Display::return_icon('up_na.png', get_lang('Up'),'',22); ?>
<?php } ?>
<?php if ($row['id'] != $user_course_categories[$max_category_key - 1]['id']) { ?>
<a href="courses.php?action=<?php echo $action; ?>&amp;move=down&amp;category=<?php echo $row['id']; ?>&amp;sec_token=<?php echo $stok; ?>">
<?php echo Display::return_icon('down.png', get_lang('Down'),'',22); ?>
</a>
<?php } else { ?>
<?php echo Display::return_icon('down_na.png', get_lang('Down'),'',22); ?>
<?php } ?>
@ -197,15 +199,6 @@ $courses_without_category = $courses_in_category[0];
foreach ($courses_in_category[$row['id']] as $course) {
?>
<tr>
<?php if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
$icon_title = get_lang('CourseDetails') . ' - ' . $course['title'];
?>
<td>
<a href="<?php echo api_get_path(WEB_CODE_PATH); ?>inc/ajax/course_home.ajax.php?a=show_course_information&code=<?php echo $course['code'] ?>" title="<?php echo $icon_title ?>" class="thickbox"><?php echo Display::return_icon('info.png', $icon_title,'','22') ?>
</a>
</td>
<?php } ?>
<td>
<a name="course<?php echo $course['code']; ?>"></a>
<strong><?php echo $course['title']; ?></strong><br />
@ -218,10 +211,7 @@ $courses_without_category = $courses_in_category[0];
<td valign="top">
<!-- edit -->
<!-- edit -->
<?php if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) {
$edit_course = Security::remove_XSS($_GET['edit']); ?>
@ -241,7 +231,13 @@ $courses_without_category = $courses_in_category[0];
<?php } ?>
<div style="float:left;">
<div style="float:left;width:110px;">
<?php if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
$icon_title = get_lang('CourseDetails') . ' - ' . $course['title'];
?>
<a href="<?php echo api_get_path(WEB_CODE_PATH); ?>inc/ajax/course_home.ajax.php?a=show_course_information&code=<?php echo $course['code'] ?>" title="<?php echo $icon_title ?>" class="thickbox"><?php echo Display::return_icon('info.png', $icon_title,'','22') ?>
<?php } ?> </a>
<?php if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) { ?>
<?php echo Display::display_icon('edit_na.png', get_lang('Edit'),'',22); ?>
<?php } else { ?>
@ -267,35 +263,32 @@ $courses_without_category = $courses_in_category[0];
<?php } ?>
</div>
<div style="float:left; margin-right:10px;">
<?php if ($course['status'] != 1) {
if ($course['unsubscr'] == 1) {
?>
<div style="float:left; margin-right:10px;">
<form action="<?php echo api_get_self(); ?>" method="post" onsubmit="javascript: if (!confirm('<?php echo addslashes(api_htmlentities(get_lang("ConfirmUnsubscribeFromCourse"), ENT_QUOTES, api_get_system_encoding()))?>')) return false">
<input type="hidden" name="sec_token" value="<?php echo $stok; ?>">
<input type="hidden" name="unsubscribe" value="<?php echo $course['code']; ?>" />
<input type="image" name="unsub" style="border-color:#fff" src="<?php echo api_get_path(WEB_IMG_PATH); ?>icons/22/unsubscribe_course.png" title="<?php echo get_lang('_unsubscribe') ?>" alt="<?php echo get_lang('_unsubscribe') ?>" />
<input type="hidden" name="unsubscribe" value="<?php echo $course['code']; ?>" />
<button class="a_button orange small" value="<?php echo get_lang('_unsubscribe'); ?>" name="unsub">
<?php echo get_lang('_unsubscribe'); ?>
</button>
</form>
</div>
<?php } else {
echo get_lang('UnsubscribeNotAllowed');
//echo get_lang('UnsubscribeNotAllowed');
//echo Display::url(get_lang('_unsubscribe'), '#', array('class'=>'a_button white small '));
}
} else {
echo get_lang('CourseAdminUnsubscribeNotAllowed');
//echo get_lang('CourseAdminUnsubscribeNotAllowed');
//echo Display::url(get_lang('_unsubscribe'), '#', array('class'=>'a_button white small '));
}
?>
<?php $key++;
}
$key++;
}
echo '</div>';
}
}
}
}
?>
</table>
</table>

@ -4,8 +4,8 @@
* Configures the WSCourse SOAP service
* @package chamilo.webservices
*/
require_once(dirname(__FILE__).'/webservice_course.php');
require_once(dirname(__FILE__).'/soap.php');
require_once dirname(__FILE__).'/webservice_course.php';
require_once dirname(__FILE__).'/soap.php';
/**
* Configures the WSCourse SOAP service
@ -49,7 +49,14 @@ $s->wsdl->addComplexType(
$s->register(
'WSCourse.DeleteCourse',
array('secret_key' => 'xsd:string', 'course_id_field_name' => 'xsd:string', 'course_id_value' => 'xsd:string')
array('secret_key' => 'xsd:string', 'course_id_field_name' => 'xsd:string', 'course_id_value' => 'xsd:string'),
array(),
'urn:WSService', // namespace
'urn:WSService#WSCourse.DeleteCourse', // soapaction
'rpc', // style
'encoded', // use
'Delete a course in chamilo' // documentation
);
$s->register(

@ -260,9 +260,7 @@ if ($maxCourse > 0) {
echo '<div class="maincontent" id="maincontent">'; // Start of content for logged in users.
$url = api_get_path(WEB_CODE_PATH).'auth/courses.php?action=sortmycourses';
echo Display::url(Display::return_icon('course_move.png', get_lang('SortMyCourses'),'','32'), $url);
// Plugins for the my courses main area.
@ -270,11 +268,9 @@ echo '<div id="plugin-mycourses_main">';
api_plugin('mycourses_main');
echo '</div>';
/* System Announcements */
/*
$announcement = isset($_GET['announcement']) ? $_GET['announcement'] : -1;
$visibility = api_is_allowed_to_create_course() ? VISIBLE_TEACHER : VISIBLE_STUDENT;
SystemAnnouncementManager :: display_announcements($visibility, $announcement);*/
/*$url = api_get_path(WEB_CODE_PATH).'auth/courses.php?action=sortmycourses';
echo Display::div(Display::url(Display::return_icon('course_move.png', get_lang('SortMyCourses'),'','32'), $url), array('class'=>'userportal-order-courses-link'));*/
if (!empty ($_GET['include']) && preg_match('/^[a-zA-Z0-9_-]*\.html$/',$_GET['include'])) {
include './home/'.$_GET['include'];
@ -672,6 +668,10 @@ if ($show_menu) {
if ($show_course_link) {
if (!api_is_drh()) {
$my_account_content .= '<li><a href="main/auth/courses.php">'.get_lang('CourseManagement').'</a></li>';
$url = api_get_path(WEB_CODE_PATH).'auth/courses.php?action=sortmycourses';
$my_account_content .= Display::url(get_lang('SortMyCourses'), $url);
if (api_get_setting('use_session_mode') == 'true') {
if (isset($_GET['history']) && intval($_GET['history']) == 1) {
$my_account_content .= '<li><a href="user_portal.php">'.get_lang('DisplayTrainingList').'</a></li>';

Loading…
Cancel
Save