Skip to content

Commit

Permalink
correction affichage apres suppression
Browse files Browse the repository at this point in the history
  • Loading branch information
poleumdev authored Feb 19, 2021
1 parent 81abefd commit 0f03db7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 15 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Attestoodle certificate history #

Attestoodle history management
TODO Describe the plugin shortly here.

See doc : https://grp-attestoodle.github.io/moodle-tool_history_attestoodle/
TODO Provide more detailed description here.

## License ##

2021 Universite du Mans
[email protected]

This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Expand Down
9 changes: 7 additions & 2 deletions lst_certif.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,14 @@
if ($delete != 0 && $delete == $userid) { // Deleted confirmed.
deletecertif($userid, $certifid);
// Test si num page ok.
$req = 'select count(id) from {tool_attestoodle_certif_log} where launchid = ?';
$matchcount = $DB->count_records_sql($req, array($launchid));
if ($matchcount == 0) {
redirect($urlhisto);
die;
}

if ($page > 0) {
$req = 'select count(id) from {tool_attestoodle_certif_log} where launchid = ?';
$matchcount = $DB->count_records_sql($req, array($launchid));
if (($matchcount / $perpage) - 1 <= $page) {
$redirecturl = new moodle_url('/admin/tool/history_attestoodle/lst_certif.php',
array('page' => $page - 1, 'perpage' => $perpage,
Expand Down
22 changes: 13 additions & 9 deletions lst_launch.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@
deleteallcertif($launchid);
// Test if num page ok.
if ($page > 0) {
$req = 'select count(id) from {tool_attestoodle_launch_log}';
$matchcount = $DB->count_records_sql($req);
$matchcount = $DB->count_records('tool_attestoodle_launch_log');
if (($matchcount / $perpage) - 1 <= $page) {
$redirecturl = new moodle_url('/admin/tool/history_attestoodle/lst_launch.php',
array('page' => $page - 1, 'perpage' => $perpage));
Expand Down Expand Up @@ -92,14 +91,15 @@
die;
}

echo $OUTPUT->header();
if ($action == '') {
echo $OUTPUT->header();

$req = 'select count(id) from {tool_attestoodle_launch_log}';
$matchcount = $DB->count_records_sql($req);
$matchcount = $DB->count_records('tool_attestoodle_launch_log');
echo $OUTPUT->heading(get_string('nblaunch', 'tool_history_attestoodle', $matchcount));

echo $OUTPUT->heading(get_string('nblaunch', 'tool_history_attestoodle', $matchcount));
// Per page.
echo choiceperpage($OUTPUT, $perpage);
// Per page.
echo choiceperpage($OUTPUT, $perpage);
}

// Table.
$baseurl = new moodle_url('/admin/tool/history_attestoodle/lst_launch.php', array('page' => $page, 'perpage' => $perpage));
Expand Down Expand Up @@ -138,8 +138,12 @@

if ($action == 'purger') {
if (delete_launch($page, $perpage, $order)) {
$table->currpage = 0;
$page = 0;
}
$redirecturl = new moodle_url('/admin/tool/history_attestoodle/lst_launch.php',
array('page' => $page, 'perpage' => $perpage));
redirect($redirecturl);
die();
}

$req = 'select * from {tool_attestoodle_launch_log} ' . $order;
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

$plugin->component = 'tool_history_attestoodle';
$plugin->release = '0.1.0';
$plugin->version = 2021021803;
$plugin->version = 2021021911;
$plugin->requires = 2017051500;
$plugin->maturity = MATURITY_STABLE;
$plugin->dependencies = [
Expand Down

0 comments on commit 0f03db7

Please sign in to comment.