My colleague Derek Woolhead updated the code, and I just dumped in on github. (You can thank Anthony Borrow, and the people at the Oklahoma Moodle Moot who asked him about it for making it happen.)
Re: Custom SQL queries report now compatible with Moodle 2.0
Great stuff, I know a lot of Moodle 2.0 early adopters will really appreciate this very useful admin functionality - thanks to everyone who made this happen Stu.
Re: Custom SQL queries report now compatible with Moodle 2.0
I just tried this out and it's really nice Tim.
FYI for anyone:
If you would rather have the weekly reports run on the first day of the week that you have set in your calendar settings (instead of Saturday), change line 26 of locallib.php to:
define('REPORT_CUSTOMSQL_START_OF_WEEK', $CFG->calendar_startwday);
Prefix is not necessary, you can just bracket the table names, e.g.:
FROM {groups_members} gm
Re: Custom SQL queries report now compatible with Moodle 2.0
Oh, of course. {} table names will just work. I had thought we would need to change the code to support them, but I was wrong. Thank you for pointing this out.
I guess we should change the help text to recommend {}, and only leave prefix_ for backwards compatibility.
Re: Custom SQL queries report now compatible with Moodle 2.0
Hello Tim,
Thank you guys for making this available, and for upgrading it for Moodle 2.0. I am attempting to install the block now; however, I am seeing this error:
- line 592 of \lib\upgradelib.php: plugin_defective_exception thrown
- line 267 of \lib\upgradelib.php: call to upgrade_plugins_blocks()
- line 1421 of \lib\upgradelib.php: call to upgrade_plugins()
- line 311 of \admin\index.php: call to upgrade_noncore()
Re: Custom SQL queries report now compatible with Moodle 2.0
Hi Joseph,
I've seen a couple of other problems cause this same error. First, I've seen it when I inadvertently installed a plugin in the wrong place - a block in mods or vice versa.
I've also seen this error when the plugin's author has written the code to expect a different folder name from the one supplied in the download. So assuming you've extracted the zip file in the blocks directory, then I think you simply need to rename the folder from "block_timhunt-moodle..." to "configurable_reports".
Hope that helps,
Dan
Re: Custom SQL queries report now compatible with Moodle 2.0
I guess I should have put some install instructions in the readme.txt.;
This in an admin report. You need to install it into the admin/report folder.
When you unzip it, you need to rename the folder to customsql.
So, the code will end up in the admin/report/customsql folder.
Re: Custom SQL queries report now compatible with Moodle 2.0
Ah yes...customsql...sorry, was thinking about the wrong plugin!
Re: Custom SQL queries report now compatible with Moodle 2.0
Ah, perfect, thank you.
Tim,
firstly thanks for this great module - we find it really useful.
We've installed it in our 2.1 site and it works great, but I'm having an issue around roles for this plugin. We have a number of admin staff that we want to give access to the reports so I created a new role 'reporter' assignable at the system level, and set the capability 'report/customsql:view' to allow (the only capability that's configured) and then assigned the admin users the new role at the system level.
However, when the users login, they don't see the 'Reports > Ad-hoc reports' option appear in the settings menu?
Do I need other capabilities?
We're on 2.1.1 and using the 20110505 version of the plugin.
It really looks to me from the code as if report/customsql:view should be the only capability necessary.
Oh, I see. The customsql report adds itself to the settings menu if the user has 'report/customsql:view', but the place where it gets added (the Reports category) only gets added to the tree if the user has 'moodle/site:viewreports'. That is probalby why the link is not showing up. (By the way, this seems to have been fixed in Moodle 2.2.)
What happens if one of your users tries typing the URL .../admin/report/customsql/index.php into their browser, does that get them in?
Tim, I've added the capabilities
- report/customsql:definequeries
- report/customsql:view
- moodle/site:viewreports
In that case I am baffed. I am sure I could work this out, given time, but I don't have a lot of that at the moment.
The way to debug this is probably to go into .../admin/report/customsql/index.php and start adding debugging statements like
echo "got this far 1";
at various points, to see exactly where it gets to before hitting the permisisons problem.
Also, set Debugging to developer level, that will probably give more information.
Tim,
thanks for having a look anyway - understand you have a lot of calls on your time.
Re: Custom SQL queries report now compatible with Moodle 2.0
Hello!! I just started using Moodle a couple of weeks ago and I think this would be really useful! Is there an article explaining how can I install this block and what do I need to download in order to do it?
Thank you very much!!!!
Re: Custom SQL queries report now compatible with Moodle 2.0
See http://moodle.org/plugins/pluginversion.php?id=443 (or the equivalent for whichever version of Moodle you are using). Install instructions are at the bottom.
Hello,
Would this plugin allow me to get a report from all of my courses, that would tell me what students are enrolled in what group in the course? I need the ability to get a report from my moodle installation that tells me who is in what group in each course at a level without going into each course and then each group to find out.
I am using moodle 2.2
Thanks
Hello
How can i do the report of total time of estudents in the cours? it is possible by un jquery sentence?
Thanks