Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-60654

Code Cleanup in calendar/view.php

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4
    • Fix Version/s: 3.4.1
    • Component/s: Calendar
    • Labels:
    • Testing Instructions:
      Hide
      Manual testing
      1. Log in as admin.
      2. On the nav drawer click Calendar.
      3. Make sure it takes you the month view and the page is loaded.
      4. Click on the day number link of a cell that has events (If doesn't, create a event).
      5. Make sure it takes you the day view and the page is loaded.
      6. Go back to Dashboard and add the Upcoming block.
      7. Click Go to calendar... link.
      8. Make sure it takes you the upcoming view and the page is loaded.
      Additional testing

      Make a sanity check.

      Show
      Manual testing Log in as admin. On the nav drawer click Calendar . Make sure it takes you the month view and the page is loaded. Click on the day number link of a cell that has events (If doesn't, create a event). Make sure it takes you the day view and the page is loaded. Go back to Dashboard and add the Upcoming block . Click Go to calendar... link. Make sure it takes you the upcoming view and the page is loaded. Additional testing Make a sanity check.
    • Affected Branches:
      MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      In calendar/view.php, around line 140 there's this piece of code:

      if ($view == 'day' || $view == 'upcoming') {
      switch($view) {
      case 'day':
      list($data, $template) = calendar_get_view($calendar, $view);
      echo $renderer->render_from_template($template, $data);
      break;
      case 'upcoming':
      list($data, $template) = calendar_get_view($calendar, $view);
      echo $renderer->render_from_template($template, $data);
      break;
      }
      } else if ($view == 'month') {
      list($data, $template) = calendar_get_view($calendar, $view);
      echo $renderer->render_from_template($template, $data);
      }

      Everything could be replaced by

      list($data, $template) = calendar_get_view($calendar, $view);
      echo $renderer->render_from_template($template, $data);

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/Jan/18