Skip to content

Commit

Permalink
Bump of new release.
Browse files Browse the repository at this point in the history
  • Loading branch information
kordan committed Oct 24, 2024
2 parents 96968f8 + 87ef663 commit 3319c9e
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:
matrix:
include:
- php: 8.1
moodle-branch: MOODLE_404_STABLE
moodle-branch: MOODLE_405_STABLE
database: mariadb
suite: classic
profile: default
- php: 8.2
moodle-branch: MOODLE_404_STABLE
moodle-branch: MOODLE_405_STABLE
database: pgsql
suite: default
profile: chrome
Expand Down
2 changes: 2 additions & 0 deletions classes/view_responselist.php
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,7 @@ public function show_action_buttons($tifirst, $tilast) {

$candeleteownsubmissions = has_capability('mod/surveypro:deleteownsubmissions', $this->context);
$candeleteotherssubmissions = has_capability('mod/surveypro:deleteotherssubmissions', $this->context);
$canenjoydeleteallsubmissionsbutton = has_capability('mod/surveypro:enjoydeleteallsubmissionsbutton', $this->context);
$canseeotherssubmissions = has_capability('mod/surveypro:seeotherssubmissions', $this->context);

$userid = ($canseeotherssubmissions) ? null : $USER->id;
Expand All @@ -1021,6 +1022,7 @@ public function show_action_buttons($tifirst, $tilast) {
$deleteall = true;
$deleteall = $deleteall && $candeleteownsubmissions;
$deleteall = $deleteall && $candeleteotherssubmissions;
$deleteall = $deleteall && $canenjoydeleteallsubmissionsbutton;
$deleteall = $deleteall && empty($this->searchquery);
$deleteall = $deleteall && empty($tifirst); // Hide the deleteall button if not all the responses are shown.
$deleteall = $deleteall && empty($tilast); // Hide the deleteall button if not all the responses are shown.
Expand Down
40 changes: 26 additions & 14 deletions db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
* File: view.php, $section = 'submissionslist'
*
* mod/surveypro:alwaysseeowner
* mod/surveypro:enjoydeleteallsubmissionsbutton
*
* mod/surveypro:seeownsubmissions <-- It does not actually exist. It is always allowed.
* mod/surveypro:seeotherssubmissions
Expand Down Expand Up @@ -204,6 +205,17 @@
],
],

'mod/surveypro:enjoydeleteallsubmissionsbutton' => [
'riskbitmask' => RISK_DATALOSS,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => [
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW,
],
],

'mod/surveypro:seeotherssubmissions' => [
'riskbitmask' => RISK_PERSONAL,
'captype' => 'write',
Expand All @@ -216,7 +228,7 @@
],

'mod/surveypro:editownsubmissions' => [
'riskbitmask' => RISK_CONFIG | RISK_PERSONAL,
'riskbitmask' => RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => [
Expand All @@ -227,7 +239,7 @@
],

'mod/surveypro:editotherssubmissions' => [
'riskbitmask' => RISK_CONFIG | RISK_PERSONAL,
'riskbitmask' => RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => [
Expand All @@ -238,7 +250,7 @@
],

'mod/surveypro:duplicateownsubmissions' => [
'riskbitmask' => RISK_CONFIG | RISK_PERSONAL,
'riskbitmask' => RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => [
Expand All @@ -249,7 +261,7 @@
],

'mod/surveypro:duplicateotherssubmissions' => [
'riskbitmask' => RISK_CONFIG | RISK_PERSONAL,
'riskbitmask' => RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => [
Expand All @@ -260,7 +272,7 @@
],

'mod/surveypro:deleteownsubmissions' => [
'riskbitmask' => RISK_CONFIG,
'riskbitmask' => RISK_DATALOSS,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => [
Expand All @@ -271,7 +283,7 @@
],

'mod/surveypro:deleteotherssubmissions' => [
'riskbitmask' => RISK_CONFIG,
'riskbitmask' => RISK_DATALOSS,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => [
Expand Down Expand Up @@ -383,7 +395,7 @@
],

'mod/surveypro:importresponses' => [
'riskbitmask' => RISK_CONFIG | RISK_PERSONAL,
'riskbitmask' => RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => [
Expand All @@ -395,7 +407,7 @@
],

'mod/surveypro:exportresponses' => [

'riskbitmask' => RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => [
Expand All @@ -407,7 +419,7 @@
],

'mod/surveypro:manageusertemplates' => [

'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => [
Expand All @@ -417,7 +429,7 @@
],

'mod/surveypro:deleteusertemplates' => [
'riskbitmask' => RISK_CONFIG,
'riskbitmask' => RISK_DATALOSS,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => [
Expand All @@ -437,7 +449,7 @@
],

'mod/surveypro:saveusertemplates' => [
'riskbitmask' => RISK_PERSONAL,

'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => [
Expand All @@ -447,7 +459,7 @@
],

'mod/surveypro:importusertemplates' => [

'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => [
Expand All @@ -457,7 +469,7 @@
],

'mod/surveypro:applyusertemplates' => [
'riskbitmask' => RISK_CONFIG,
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => [
Expand All @@ -477,7 +489,7 @@
],

'mod/surveypro:applymastertemplates' => [
'riskbitmask' => RISK_CONFIG,
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => [
Expand Down
2 changes: 1 addition & 1 deletion field/checkbox/db/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<FIELD NAME="options" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="labelother" TYPE="char" LENGTH="64" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="defaultvalue" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="noanswerdefault" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="2" SEQUENCE="false"/>
<FIELD NAME="noanswerdefault" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="downloadformat" TYPE="int" LENGTH="4" NOTNULL="false" UNSIGNED="true" SEQUENCE="false"/>
<FIELD NAME="minimumrequired" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="maximumrequired" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false"/>
Expand Down
2 changes: 1 addition & 1 deletion field/multiselect/db/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<FIELD NAME="itemid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="options" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="defaultvalue" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="noanswerdefault" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="2" SEQUENCE="false"/>
<FIELD NAME="noanswerdefault" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="downloadformat" TYPE="int" LENGTH="4" NOTNULL="false" UNSIGNED="true" SEQUENCE="false"/>
<FIELD NAME="minimumrequired" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="maximumrequired" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false"/>
Expand Down
1 change: 1 addition & 0 deletions lang/en/surveypro.php
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@
$string['surveypro:duplicateownsubmissions'] = 'Duplicate own responses';
$string['surveypro:editotherssubmissions'] = 'Edit responses from other users';
$string['surveypro:editownsubmissions'] = 'Edit own responses';
$string['surveypro:enjoydeleteallsubmissionsbutton'] = 'Enjoy the "Delete all submissions" button';
$string['surveypro:exportresponses'] = 'Export collected responses';
$string['surveypro:ignoremaxentries'] = 'Submissions are not limited by max entries setting';
$string['surveypro:importresponses'] = 'Import data';
Expand Down
6 changes: 3 additions & 3 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@

$plugin->component = 'mod_surveypro';
$plugin->maturity = MATURITY_BETA;
$plugin->version = 2024062403;
$plugin->release = '4.4';
$plugin->requires = 2024042200;
$plugin->version = 2024100700;
$plugin->release = '4.5';
$plugin->requires = 2024100700;

0 comments on commit 3319c9e

Please sign in to comment.