Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tmuras/moosh#490] correct a having for postgres #491

Merged
merged 2 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Moosh/Command/Moodle39/Course/CourseEnrolChangeStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public function __construct()
{
parent::__construct('enrol-change-status', 'course');

$this->addOption('i|instanceid:', 'enrolment instance id', 0);
$this->addOption('s|status', 'status to be applied 0 for disable, 1 for enable',0);
$this->addOption('i|instanceid:', 'enrolment instance id, if 0 or not entered you\'ll pass in interactive mode' , 0);
$this->addOption('s|status:', 'status to be applied 1 for disable, 0 for enable, default value to 0',0);
$this->addArgument('courseid');
$this->maxArguments = 255;
}
Expand Down
4 changes: 2 additions & 2 deletions Moosh/Command/Moodle39/Course/CourseList.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ public function execute() {
$sql .= " AND ($customwhere)";
}
if ($options['empty'] == 'yes') {
$sql .= " GROUP BY c.id HAVING modules < 2";
$sql .= " GROUP BY c.id HAVING COUNT(c.id) < 2";
}
if ($options['empty'] == 'no') {
$sql .= " GROUP BY c.id HAVING modules > 1";
$sql .= " GROUP BY c.id HAVING COUNT(c.id) > 1";
}

if($this->verbose) {
Expand Down
6 changes: 3 additions & 3 deletions www/commands/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -874,16 +874,16 @@ course-enrol-change-status
Requires course id

Options :
* --instanceid=?, --i=? : enrolment instance id, if not command enter in interactive mode and show all available enrolment instance for the given course, you'll have to choose status from prompt
* --status=0 or 1, --s=0 or 1 : status of enrolment instance 0 (default value) -> enabled, 1 -> disabled
* --instanceid=?, -i ? : enrolment instance id, if not command enter in interactive mode and show all available enrolment instance for the given course, you'll have to choose status from prompt
* --status=0 or 1, -s 0 or 1 : status of enrolment instance 0 (default value) -> enabled, 1 -> disabled

Example1 : change course enrolment instance status in interactive mode

moosh course-enrol-change-status 2

Example1 : change course enrolment instance status to disable for instance 42

moosh course-enrol-change-status --i=42 --s=1 2
moosh course-enrol-change-status -i=42 -s=1 2

course-enableselfenrol
----------------------
Expand Down
Loading