6048 Commits

Author SHA1 Message Date
nicolasconnault
6a581514b4 Fixing $Id: tag 2008-01-24 14:46:01 +00:00
nicolasconnault
51b57ef6a8 MDL-13101
1. Showing full path
2. Showing plugins to be installed
3. Lang strings properly used
4. Table headers
2008-01-24 08:40:36 +00:00
nicolasconnault
1e92bb9112 MDL-13101 New section of the upgrade process: plugins check 2008-01-23 22:48:54 +00:00
skodak
29c660c4be MDL-12144 fixed creation of course category; merged from MOODLE_19_STABLE 2008-01-22 11:59:39 +00:00
skodak
b5d4efc60f MDL-13091 Aggregate including subcategories off by default, adding default values info into grade cat combo setting; merged from MOODLE_19_STABLE 2008-01-22 08:27:30 +00:00
skodak
8a0a6046a3 MDL-13085 delete grades and items when uninstalling module; merged from MOODLE_19_STABLE 2008-01-21 23:36:19 +00:00
skodak
4b86bb0827 MDL-12773, MDL-12144 grade category selection on modedit page; merged from MOODLE_19_STABLE 2008-01-21 18:42:03 +00:00
skodak
fd6fefb790 MDL-13084 SORT_LOCALE_STRING not defined < PHP 4.4.0; merged from MOODLE_19_STABLE 2008-01-21 18:18:07 +00:00
skodak
85a0a69fa4 MDL-13081 add "long grade" formatted string "score / maxscore" into grade_get_grades() and friends; merged from MOODLE_19_STABLE 2008-01-21 07:19:19 +00:00
skodak
6a525ce289 MDL-12983 Installation stops after trying to download Language-Pack - patch by Dan Poltawski; merged from MOODLE_19_STABLE 2008-01-20 17:59:26 +00:00
skodak
ff396fd597 MDL-13063 fixed comments and changeme password reset; merged from MOODLE_19_STABLE 2008-01-19 20:05:21 +00:00
skodak
4559ab345f MDL-11759 group edit cleanup; merged from MOODLE_18_STABLE 2008-01-18 10:08:40 +00:00
moodler
5df984eb0a Merged typo fox for popup windows from 19 2008-01-18 05:18:11 +00:00
skodak
588cd516e1 tweak has_capability() debug mode to add only one query per page for cap name verification; merged from MOODLE_19_STABLE 2008-01-16 17:24:08 +00:00
scyrma
9ea043250b added some documentation 2008-01-16 08:41:30 +00:00
scyrma
aa68a7b0a2 MDL-13020 : deprecates make_table 2008-01-16 08:17:25 +00:00
scyrma
9e73868793 Fix for MDL-9669 : make it possible to specify 0 as cellpadding and cellspacing 2008-01-16 07:39:03 +00:00
moodler
e6d8bc8c4a Merged upgradelib.php fixes from 1.9 MDL-13017 2008-01-16 01:51:18 +00:00
mjollnir_
d46a26c309 Merged from MOODLE_19_STABLE:
MDL-13000 Adding support for developers to add their own capabilities to local/db/access.php
This relies on a local/ language pack as well for the capability names.
Notes on implementation are in lib/locallib.php
2008-01-15 04:20:12 +00:00
mjollnir_
6a91692518 Merged from MOODLE_19_STABLE: MDL-13001 - adding support for language files in local/ directory. 2008-01-15 01:40:02 +00:00
mjollnir_
60581bb517 Merged from MOODLE_19_STABLE:
More on MDL-11561 - fixed up path to local/ settings file to be more consistent,
added documentation in lib/locallib.php on how to create new local admin tree item
2008-01-15 01:10:34 +00:00
mjollnir_
0b5e060578 Merged from MOODLE_19_STABLE: MDL-11561 - added support for local/localsettings.php 2008-01-14 23:32:43 +00:00
skodak
204175c5ce MDL-12912 module idnumber course unique only; merged from MOODLE_19_STABLE 2008-01-14 22:46:03 +00:00
jamiesensei
c56590192a whitespace clean up, removed all indentation with tabs and trailing white space 2008-01-13 08:30:39 +00:00
stronk7
6cf0583501 Function changed to check for register_globals. MDL-12914 ; merged from 19_STABLE 2008-01-12 18:54:30 +00:00
jamiesensei
3269de981e MDL-12906 add an optional parameter $jsconfirmmessage parameter to print_single_button 2008-01-12 08:47:29 +00:00
poltawski
71beacf6d1 MDL-11074 - incorrect test in page_generic_activity, thanks to Gordon Bateson
merged from MOODLE_19_STABLE
2008-01-11 15:44:11 +00:00
urs_hunkler
ba92d2f50c 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.
2008-01-11 09:29:53 +00:00
stronk7
5075a6ca3d Added new library to store all core custom checks to be performed
by environmental stuff. MDL-12914
2008-01-10 23:46:28 +00:00
poltawski
16ca2da3d6 MDL-12915 - fixed require of removed file
merged from MOODLE_19_STABLE
2008-01-10 16:11:10 +00:00
mjollnir_
e3cd54731c 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.
2008-01-09 23:15:44 +00:00
skodak
b9f49659b6 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 2008-01-09 18:19:42 +00:00
urs_hunkler
52ea8aa026 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.
2008-01-09 15:52:08 +00:00
scyrma
6a8fd52898 Small documentation fix. 2008-01-09 04:10:02 +00:00
poltawski
667a2d481e MDL-12882 - we were caching empty records which caused clone warnings
merged from MOODLE_19_STABLE
2008-01-08 20:20:36 +00:00
tjhunt
cc3d5e10ec 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. 2008-01-08 15:04:00 +00:00
martinlanghoff
2e7e89a907 dmllib:rcache_set()/rcache_get() - use clone() function which we can support in PHP4 - MDL-12827 2008-01-08 04:13:32 +00:00
mjollnir_
2f13f94ccc 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.
2008-01-07 01:54:28 +00:00
martinlanghoff
19f2318a44 accesslib: get_users_by_capability() now excludes doanything'ers properly
With some subselect-outer-join poison-pill magic, when the we don't
want doanything users, we remove the roles that would grant such
dubious status.

Just a flick of the SQL muscle, actually.
2008-01-06 23:26:19 +00:00
martinlanghoff
92c879cef1 accesslib: get_users_by_capability() fix subselect with ra.hidden
MDL-12452
2008-01-06 23:26:08 +00:00
martinlanghoff
b1469317a1 lib/deprecatedlib: use sort_by_roleassignment_authority() to sort RAs
After calling get_users_by_capability(), use
sort_by_roleassignment_authority() to mimic what older versions of
Moodle did.

Affects: get_teacher(), get_course_teachers()

    MDL-12452
2008-01-06 23:25:51 +00:00
martinlanghoff
635bfbad21 accesslib: Introducing sort_by_roleassignment_authority()
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 .

MDL-12452
2008-01-06 23:25:37 +00:00
martinlanghoff
1113f8002a 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.

MDL-12452
2008-01-06 23:25:26 +00:00
martinlanghoff
f17a660a05 accesslib: get_user_by_capability() - Fix pagination
Ooops! Off-by-one error

MDL-12452
2008-01-06 23:25:03 +00:00
martinlanghoff
c26ecb1a29 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().

MDL-12452
2008-01-06 23:24:50 +00:00
martinlanghoff
c92bce4614 accesslib: get_user_by_capability() - Fix last_access handling
We were missing $courseid, which is actually $context->instanceid.

MDL-12452
2008-01-06 23:24:37 +00:00
martinlanghoff
6c9d86b7a6 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().

MDL-12452
2008-01-06 23:24:25 +00:00
martinlanghoff
d2c5b7a9fa 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.

MDL-12452
2008-01-06 23:24:14 +00:00
martinlanghoff
a4436c6db8 accesslib: get_user_by_capability() - Handle the complex case
With this commit, we can handle the complex cases with

 - correct pagination, but not very efficient over large datasets

 - mostly-correct application of the override rules

The structure of the code is fairly complex in that we want to do
it without holding all the recs in memory, so we use a small state
machine. We have to handle the complex override rules over 1 or 2
permissions (when $doanything is set) so it all ends up quite complex.

There is one known issue with this code, in cases where the default
role ends up as the decider between 2 conflicting RAs, we fail to
apply it. This will need a bit of reorg of how the loop works.

MDL-12452
2008-01-06 23:23:58 +00:00
martinlanghoff
2d1669b0d5 accesslib: get_user_by_capability() - Simple cases now handle multiple RAs
The "simple" case SQL did not handle multiple enrolments for the same
user correctly -- it would generate multiple rows for those users,
incorrectly.

With this patch we move the join to RA to a subselect where DISTINCT
takes care of things.

MDL-12452
2008-01-06 23:23:46 +00:00