jamiesensei [Sat, 12 Jan 2008 08:50:32 +0000 (08:50 +0000)]
MDL-12695 Symantec Norton internet security pop up blocker seems to be stopping user starting a quiz attempt - fixed this by using print_single_button which uses an onclick event to trigger a confirm dialogue, should work better even with popup blockers.
skodak [Fri, 11 Jan 2008 13:09:51 +0000 (13:09 +0000)]
MDL-12926 Discussion list shows all discussion in separate mode if user not member of any group and does not have accessallgroups; merged from MOODLE_19_STABLE
urs_hunkler [Fri, 11 Jan 2008 09:29:53 +0000 (09:29 +0000)]
merged from 1.9 :: MDL-12221 :: removed the "nocoursepage" hack, which was an attempt to find out if a page has a layout-table. I developed this hack because Martin said, that he does not see any chance to implement a layout-table check. This hack followed several exception hacks because Moodel pages are inconsistently created. All those exceptions I could delete too.
Now I added a JavaScript layout-table check which works great.
skodak [Thu, 10 Jan 2008 23:13:30 +0000 (23:13 +0000)]
MDL-12921 Using visible groups in Q&A Forums student can't reply to discussions for All participants (including groups code cleanup); merged from MOODLE_19_STABLE
tjhunt [Thu, 10 Jan 2008 10:58:16 +0000 (10:58 +0000)]
MDL-12373 - More instances of links to the participants list being shown in the navigation bar to people without the necessary capability.
I have not copied and pasted the same code into lots of different places. That sucks. We really need to refactor this into a function that builds the navigation up to, and including the user's name. However, I don't have time now. A list of the places touched by this bug (MDL-12373) will at least give a complete list of places that such a refactoring would have to touch.
jmg324 [Thu, 10 Jan 2008 09:47:29 +0000 (09:47 +0000)]
altered require statement for config.
Not sure why, but the referential file path was causing cron to fail because config couldn't be found when running from scheduled cron (running in browser was fine!
It looks tidier anyway to have both require's done the same way, so now both user $dirroot to locate files required and this works with scheduled cron.
mjollnir_ [Wed, 9 Jan 2008 23:15:44 +0000 (23:15 +0000)]
MDL-12894 Fixing language string mess (language packs containing \n) & moved them to the controllers,
also fixed a few typos and a || instead of && bug. This all relates to the CLI installer.
skodak [Wed, 9 Jan 2008 18:19:42 +0000 (18:19 +0000)]
MDL-12822 removing some unused grade functions (obsoleted by format grade function), renaming PUBLIC API to activity communication API and adding new querylib.php with useful functions (requested by other devs); merged from MOODLE_19_STABLE
tjhunt [Wed, 9 Jan 2008 17:23:47 +0000 (17:23 +0000)]
MDL-12373 - If you can see your user profile, but don't have moodle/course:viewparticipants, you get a link in the nav bar that takes you to an error message - and there were also instances in blog.
tjhunt [Wed, 9 Jan 2008 16:46:21 +0000 (16:46 +0000)]
MDL-12373 - If you can see your user profile, but don't have moodle/course:viewparticipants, you get a link in the nav bar that takes you to an error message - this was repeated in other parts of the user profile that I had not noticed when I fixed this before.
urs_hunkler [Wed, 9 Jan 2008 15:52:08 +0000 (15:52 +0000)]
Merged from 1.9 and checked :: MDL-12221 :: I added changes to weblib and the forum and glossary view pages, the custom_corners and standard theme to get those pages working.
In the view pages I changed the container function call to a simple "echo 'div ...'" to avoid the custom_corners container overhead and page oddity.
In weblib I added "clearfix" handling to the function "print_box_start($classes ...". "clearfix" is handed over to the containing divs. This is a hack, but I didn't know how to handle it without rewriting too much areas.
poltawski [Wed, 9 Jan 2008 10:49:59 +0000 (10:49 +0000)]
MDL-10886 - Category edit: use 'save changes', enable cancel button to allow us
to get back from where we came from & refine where we are returned to when cancelled.
merged from MOODLE_19_STABLE
mjollnir_ [Tue, 8 Jan 2008 23:27:45 +0000 (23:27 +0000)]
Merged from MOODLE_19_STABLE: MDL-12884 web installer should set the depth of the miscellaneous course category to 1 too (discussion in moodle hq skype chat with Petr)
tjhunt [Tue, 8 Jan 2008 18:29:20 +0000 (18:29 +0000)]
MDL-12785 - Partially correct tick icon not displayed for MULTICHOICE, single answer questions. Fix thanks to Joseph Rézeau. Merged from MOODLE_18_STABLE.
tjhunt [Tue, 8 Jan 2008 15:04:00 +0000 (15:04 +0000)]
Put back DEBUG_DEVELOPER sanity check in has_capability, that makes sure the capabiltiy you are asking about actually exists. I know it takes an extra DB query, but it is DEBUG_DEVELOPER only, and it is worth its weight in gold, because otherwise you get really subtle bugs that take forever to diagnose. I know, I have just been banging my head against the wall for an hour.
poltawski [Tue, 8 Jan 2008 12:51:07 +0000 (12:51 +0000)]
MDL-10813 - Course requests not respecting course request category.
Also made the course request category more robust, as breakage would
incur if $CFG->defaultrequestcategory didn't exist as a category.
merged from MOODLE_19_STABLE
iarenaza [Tue, 8 Jan 2008 00:13:49 +0000 (00:13 +0000)]
MDL-12858 fix print_error() usage.
print_error()'s third parameter is the URL we jump to (defaults to
$CFG->wwwroot if not set) when we click the 'Continue' button, not the message
string parameter object.
tjhunt [Mon, 7 Jan 2008 16:46:35 +0000 (16:46 +0000)]
Use the locale to sort the list of activites everywhere. This matches a change a made in one place before christmas. If you don't do this, the PHP sorts by ASCII order, so mixed case names, or special characters, get sorted wrongly. Merged from MOODLE_19_STABLE.
mjollnir_ [Mon, 7 Jan 2008 01:54:28 +0000 (01:54 +0000)]
New feature: Command line installer. Credit: Dilan Anurudda.
This was a Google Summer of Code 2007 Project.
This introduces two new files, admin/cliupgrader.php and lib/installlib.php.
It also introduces a new PEAR library, Console_GetOpt. I have recieved permission from the upstream author to include this in GPL Moodle (essentially dual license it) - notes in lib/pear.
Most stuff that outputs html during install gets suppressed by the use of a constant.
Run the script like php admin/cliupgrade.php --help for info.
Note that this all uses strings from install/ rather than lang, so I have updated stringnames.txt accordingly and they'll all be broken until the cronjob that generates them runs.
This will help us bridge the gap from olden-style order-by
user_teachers.id. From the phpdoc...
Will re-sort a $users results array (from get_users_by_capability(), usually)
based on a sorting policy. This is to support the odd practice of
sorting teachers by 'authority', where authority was "lowest id of the role
assignment".
Will execute 1 database query. Only suitable for small numbers of users, as it
uses an u.id IN() clause.
Notes about the sorting criteria.
As a default, we cannot rely on role.sortorder because then
admins/coursecreators will always win. That is why the sane
rule "is locality matters most", with sortorder as 2nd
consideration.
If you want role.sortorder, use the 'sortorder' policy, and
name explicitly what roles you want to cover. It's probably
a good idea to see what roles have the capabilities you want
(array_diff() them against roiles that have 'can-do-anything'
to weed out admin-ish roles. Or fetch a list of roles from
variables like $CFG->coursemanagers .
martinlanghoff [Sun, 6 Jan 2008 23:25:26 +0000 (23:25 +0000)]
lib/deprecatedlib: enrol/manual: Fix calls to get_users_by_capability() to avoid ra
get_users_by_capability() can no longer refer to properties of role
assignments or roles, as the capability aggregate is indirect.
Fixes:
get_teacher() - though the results will be poor, as we cannot provide
role.sortorder reliably
(used mainly by mod/workshop)
get_course_teachers() - which seems broken for a lot of situations as
its default parameters still refer to old tables.
martinlanghoff [Sun, 6 Jan 2008 23:24:50 +0000 (23:24 +0000)]
datalib: get_admins() - Rewrite to avoid get_users_by_capability()
get_admins() and get_admin() were counting on
get_users_by_capability() returning a role-assignment id to pick the
"primary" admin account. With the get_users_by_capability() rewrite,
we no longer have an RA id to clearly blame for the capability.
So, rewrite get_admins() based on the known-good SQL used in
is_siteadmin().
martinlanghoff [Sun, 6 Jan 2008 23:24:25 +0000 (23:24 +0000)]
accesslib: get_user_by_capability() - Move capcheck to has_capability_from_rarc()
This fixes the handling of default roles as "tie breakers" for lower
RAs in conflict, and simplifies the code a lot.
The main loop in get_user_by_capability() runs a simpler state machine
that just collects role assignments (roleid and depth), and handles
pagination.
The complex part of the state machine has moved to
has_capability_from_rarc() which will walk the data structures
collected by get_user_by_capability() for each user.
Having all the complex state handling of $hascap there makes things a
lot easier for pagination and general sanity of
get_user_by_capability().
martinlanghoff [Sun, 6 Jan 2008 23:24:14 +0000 (23:24 +0000)]
accesslib: get_user_by_capability() - Move hidden RA checks to subselect
we don't deal with RAs in the main SELECT -- we deal with _capabilities_
which is an entirely different matter ;-) -- so push the ra.hidden check
into the subselect.
Also, remove ra.hidden from the default list of fields. Hopefully no
callers are using ra.hidden -- if they are, they should be calling
something else, as this function deals with capabilities. So we might
need an audit of callers, to check that noone is expecting ra.hidden
to be there.