Skip to content

Commit

Permalink
Code precheck cleanup and two new links to index.php.
Browse files Browse the repository at this point in the history
  • Loading branch information
drachels committed Aug 28, 2020
1 parent 93dd976 commit 5e90fbe
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 228 deletions.
70 changes: 0 additions & 70 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,76 +25,6 @@ cache:

matrix:
include:
- php: 5.6
env:
DB=pgsql
MOODLE_BRANCH=MOODLE_26_STABLE
MOODLE_CI_VERSION=1
- php: 5.6
env:
DB=mysqli
MOODLE_BRANCH=MOODLE_26_STABLE
MOODLE_CI_VERSION=1
- php: 5.6
env:
DB=pgsql
MOODLE_BRANCH=MOODLE_27_STABLE
MOODLE_CI_VERSION=1
- php: 5.6
env:
DB=mysqli
MOODLE_BRANCH=MOODLE_27_STABLE
MOODLE_CI_VERSION=1
- php: 5.6
env:
DB=pgsql
MOODLE_BRANCH=MOODLE_28_STABLE
MOODLE_CI_VERSION=1
- php: 5.6
env:
DB=mysqli
MOODLE_BRANCH=MOODLE_28_STABLE
MOODLE_CI_VERSION=1
- php: 5.6
env:
DB=pgsql
MOODLE_BRANCH=MOODLE_29_STABLE
MOODLE_CI_VERSION=1
- php: 5.6
env:
DB=mysqli
MOODLE_BRANCH=MOODLE_29_STABLE
MOODLE_CI_VERSION=1
- php: 5.6
env:
DB=pgsql
MOODLE_BRANCH=MOODLE_30_STABLE
MOODLE_CI_VERSION=1
- php: 5.6
env:
DB=mysqli
MOODLE_BRANCH=MOODLE_30_STABLE
MOODLE_CI_VERSION=1
- php: 5.6
env:
DB=pgsql
MOODLE_BRANCH=MOODLE_31_STABLE
MOODLE_CI_VERSION=1
- php: 5.6
env:
DB=mysqli
MOODLE_BRANCH=MOODLE_31_STABLE
MOODLE_CI_VERSION=1
- php: 7.1
env:
DB=pgsql
MOODLE_BRANCH=MOODLE_32_STABLE
MOODLE_CI_VERSION=2
- php: 7.1
env:
DB=mysqli
MOODLE_BRANCH=MOODLE_32_STABLE
MOODLE_CI_VERSION=2
- php: 7.1
env:
DB=pgsql
Expand Down
9 changes: 4 additions & 5 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@

$id = required_param('id', PARAM_INT); // Course.

if (! $course = $DB->get_record("course", array("id" => $id))) {
if (! $course = $DB->get_record('course', array('id' => $id))) {
print_error("Course ID is incorrect");
}

require_course_login($course);


// Header.
$strdiarys = get_string("modulenameplural", "diary");
$strdiarys = get_string('modulenameplural', 'diary');
$PAGE->set_pagelayout('incourse');
$PAGE->set_url('/mod/diary/index.php', array('id' => $id));
$PAGE->navbar->add($strdiarys);
Expand All @@ -46,8 +45,8 @@
echo $OUTPUT->header();
echo $OUTPUT->heading($strdiarys);

if (! $diarys = get_all_instances_in_course("diary", $course)) {
notice(get_string('thereareno', 'moodle', get_string("modulenameplural", "diary")), "../../course/view.php?id=$course->id");
if (! $diarys = get_all_instances_in_course('diary', $course)) {
notice(get_string('thereareno', 'moodle', get_string('modulenameplural', 'diary')), '../../course/view.php?id=$course->id');
die;
}

Expand Down
1 change: 1 addition & 0 deletions lang/en/diary.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,6 @@
$string['timemodified'] = 'Time modified';
$string['userid'] = 'User id';
$string['usertoolbar'] = 'User toolbar:';
$string['viewalldiaries'] = 'View all course diaries';
$string['viewallentries'] = 'View {$a} diary entries';
$string['viewentries'] = 'View entries';
150 changes: 0 additions & 150 deletions notes.txt

This file was deleted.

3 changes: 3 additions & 0 deletions report.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string($stringlable, "diary"));

// 20200827 Added link to index.php page.
echo '<div class="reportlink"><a href="index.php?id='.$course->id.'">'.get_string('viewalldiaries', 'diary').'</a></div>';

// Get a list of groups for this course.
$currentgroup = groups_get_activity_group($cm, true);
if ($currentgroup) {
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2020082402; // The current module version (Date: YYYYMMDDXX).
$plugin->version = 2020082800; // The current module version (Date: YYYYMMDDXX).
$plugin->requires = 2015111600; // Requires Moodle 3.0 version.
$plugin->cron = 60; // Period for cron to check this module (secs).
$plugin->component = 'mod_diary';
$plugin->maturity = MATURITY_STABLE;
$plugin->release = '1.0.2 (Build: 2020082402)'; // User-friendly version number.
$plugin->release = '1.1.0 (Build: 2020082800)'; // User-friendly version number.

3 changes: 2 additions & 1 deletion view.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,9 @@

$entrycount = diary_count_entries($diary, $currentgroup);

// 20200827 Add link to index.php page.
echo '<div class="reportlink"><a href="report.php?id='.$cm->id.'&action=currententry">'.
get_string('viewallentries', 'diary', $entrycount).'</a></div>';
get_string('viewallentries', 'diary', $entrycount).'</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="index.php?id='.$course->id.'">'.get_string('viewalldiaries', 'diary').'</a></div>';
}

echo $output->introduction($diary, $cm); // Ouput introduction in renderer.php.
Expand Down

0 comments on commit 5e90fbe

Please sign in to comment.