diff --git a/plugin/buycourses/resources/css/style.css b/plugin/buycourses/resources/css/style.css index e3e4a80f79..259e242034 100644 --- a/plugin/buycourses/resources/css/style.css +++ b/plugin/buycourses/resources/css/style.css @@ -30,7 +30,42 @@ font-size: 18px; line-height: 1.42857; } - +/* PROCESS BUY */ +.buy-info .price{ + font-size: 24px; + line-height: 32px; + font-weight: bold; + padding-bottom: 10px; + padding-top: 10px; + letter-spacing: -0.020em; +} +.buy-info .buy-item .title{ + margin-top: 5px; + font-weight: bold; + line-height: 24px; + font-size: 18px; +} +.buy-info .buy-item .description, .buy-info .buy-item .coaches{ + margin-bottom: 20px; + color: #666666; +} +.buy-info .buy-item .date{ + margin-bottom: 10px; + color: #666666; +} +.buy-summary{ + margin-top: 10px; + border-top: 1px solid #CCCCCC; +} +.panel-box-buy{ + box-shadow: 0 15px 30px rgba(0,0,0,.1); + padding: 20px; +} +.buy-summary .alert-info { + color: #31708f; + background-color: #e8f2f8; + border-color: #bce8f1; +} @-moz-keyframes wobblebar-loader { 0% { left: 4px; @@ -271,6 +306,18 @@ left: 204px; } } +/* Landscape phones and down */ +@media (max-width: 480px) { + .panel-box-buy{ + padding: 0; + } + .buy-summary .pull-right{ + float: left !important; + } + .buy-summary .btn-success{ + width: 100%; + } +} /* :not(:required) hides this rule from IE9 and below */ .wobblebar-loader:not(:required) { background: #2E6DA4; @@ -300,3 +347,4 @@ width: 21.33333px; height: 14.22222px; } + diff --git a/plugin/buycourses/src/buy_course_plugin.class.php b/plugin/buycourses/src/buy_course_plugin.class.php index eef4cee5d8..a4dd782aa0 100644 --- a/plugin/buycourses/src/buy_course_plugin.class.php +++ b/plugin/buycourses/src/buy_course_plugin.class.php @@ -580,10 +580,21 @@ class BuyCoursesPlugin extends Plugin return []; } + $courseDescription = $entityManager->getRepository('ChamiloCourseBundle:CCourseDescription') + ->findOneBy( + [ + 'cId' => $course->getId(), + 'sessionId' => 0, + ], + [ + 'descriptionType' => 'ASC', + ] + ); + $courseInfo = [ 'id' => $course->getId(), 'title' => $course->getTitle(), - 'description' => $course->getDescription(), + 'description' => $courseDescription->getContent(), 'code' => $course->getCode(), 'visual_code' => $course->getVisualCode(), 'teachers' => [], @@ -594,8 +605,11 @@ class BuyCoursesPlugin extends Plugin $courseTeachers = $course->getTeachers(); - foreach ($courseTeachers as $teacher) { - $courseInfo['teachers'][] = $teacher->getUser()->getCompleteName(); + foreach ($courseTeachers as $teachers) { + $user = $teachers->getUser(); + $teacher['id'] = $user->getId(); + $teacher['name'] = $user->getCompleteName(); + $courseInfo['teachers'][] = $teacher; } $possiblePath = api_get_path(SYS_COURSE_PATH); @@ -646,11 +660,14 @@ class BuyCoursesPlugin extends Plugin $sessionInfo = [ 'id' => $session->getId(), 'name' => $session->getName(), + 'description' => $session->getDescription(), 'dates' => $sessionDates, 'courses' => [], 'price' => $item['price'], 'currency' => $item['iso_code'], 'image' => null, + 'nbrCourses' => $session->getNbrCourses(), + 'nbrUsers' => $session->getNbrUsers() ]; $fieldValue = new ExtraFieldValue('session'); @@ -680,7 +697,9 @@ class BuyCoursesPlugin extends Plugin foreach ($userCourseSubscriptions as $userCourseSubscription) { $user = $userCourseSubscription->getUser(); - $sessionCourseData['coaches'][] = $user->getCompleteName(); + $coaches['id'] = $user->getUserId(); + $coaches['name'] = $user->getCompleteName(); + $sessionCourseData['coaches'][] = $coaches; } $sessionInfo['courses'][] = $sessionCourseData; diff --git a/plugin/buycourses/src/process.php b/plugin/buycourses/src/process.php index 2d33b89e13..1d5ca864e0 100644 --- a/plugin/buycourses/src/process.php +++ b/plugin/buycourses/src/process.php @@ -11,13 +11,12 @@ use ChamiloSession as Session; require_once '../config.php'; $currentUserId = api_get_user_id(); - if (empty($currentUserId)) { Session::write('buy_course_redirect', Security::remove_XSS($_SERVER['REQUEST_URI'])); header('Location: '.api_get_path(WEB_CODE_PATH).'auth/inscription.php'); exit; } - +$htmlHeadXtra[] = ''; $plugin = BuyCoursesPlugin::create(); $includeSession = $plugin->get('include_sessions') === 'true'; $paypalEnabled = $plugin->get('paypal_enable') === 'true'; @@ -109,7 +108,7 @@ if ($count === 0) { $form->addHidden('t', intval($_GET['t'])); $form->addHidden('i', intval($_GET['i'])); -$form->addButton('submit', $plugin->get_lang('ConfirmOrder'), 'check', 'success'); +$form->addButton('submit', $plugin->get_lang('ConfirmOrder'), 'check', 'success', 'btn-lg pull-right'); // View $templateName = $plugin->get_lang('PaymentMethods'); diff --git a/plugin/buycourses/view/process.tpl b/plugin/buycourses/view/process.tpl index f1e577aa18..20af4f40fa 100644 --- a/plugin/buycourses/view/process.tpl +++ b/plugin/buycourses/view/process.tpl @@ -1,58 +1,117 @@ - +
+ + {{ + +
+
-
-
- {% if buying_course %} - - {{ course.title }} - -
-

- {{ course.title }} -

-
    - {% for teacher in course.teachers %} -
  • {{ teacher }}
  • - {% endfor %} -
-

- {{ course.currency == 'BRL' ? 'R$' : course.currency }} {{ course.price }} -

-

-
- {% elseif buying_session %} - {{ session.name }} -
-

{{ session.name }}

-
    -
  • - {{ session.dates.display }} -
  • -
-
    - {% for course in session.courses %} -
  • - - {{ course.title }} - {% if course.coaches|length %} -
      - {% for coach in course.coaches %} -
    • {{ coach }}
    • +
      +
      +
      +
      + {% if buying_course %} +
      +
      + + {{ course.title }} + +
      + {{ 'Total'|get_plugin_lang('BuyCoursesPlugin')}} : + {{ course.currency == 'BRL' ? 'R$' : course.currency }} {{ course.price }} +
      +
      +
      +
      +

      + + {{ course.title }} + +

      + {% if course.description %} +
      + {{ course.description }} +
      + {% endif %} +
      +

      + {{ 'Teachers'|get_plugin_lang('BuyCoursesPlugin')}} : + {% for teacher in course.teachers %} + + {{ teacher.name }}, {% endfor %} -

    +

    +
+
+
+
+ {% elseif buying_session %} +
+
+ {{ session.name }} +
+ {{ 'Total'|get_plugin_lang('BuyCoursesPlugin')}} : + {{ session.currency == 'BRL' ? 'R$' : session.currency }} {{ session.price }} +
+
+
+
+

{{ session.name }}

+ {% if session.description %} +
+ {{ session.description }} +
{% endif %} - - {% endfor %} - -

- {{ session.currency == 'BRL' ? 'R$' : session.currency }} {{ session.price }} -

-

+
+ {{ session.dates.display }} +
+
+ {% for course in session.courses %} +

{{ course.title }}

+

+ {{ 'Teachers'|get_plugin_lang('BuyCoursesPlugin')}} : + {% if course.coaches|length %} + {% for coach in course.coaches %} + + {{ coach.name }}, + {% endfor %} + {% endif %} +

+ {% endfor %} +
+
+
+
+ {% elseif buying_service %} + + {% endif %} + + +
+

{{ 'PaymentMethods'|get_plugin_lang('BuyCoursesPlugin') }}

+ {{ form }}
+ + + + +
+
+ +
+ + {% if buying_course %} + + + {% elseif buying_session %} + + {% elseif buying_service %} {{ service.name }}
-
-
-
-

{{ 'PaymentMethods'|get_plugin_lang('BuyCoursesPlugin') }}

-
-
- {{ form }} -
-
-
+