Non-core contributed modules

Allow MRBS block to be view/used in courses

Details

  • Type: Improvement Improvement
  • Status: Reopened Reopened
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.9.3
  • Fix Version/s: None
  • Component/s: Block: Mrbs
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE

Description

We've had a similar request from several people so thought I'd post the diff code for the changes we made to the block. Will achieve the following:

1. Allow the block to be displayed on course pages;

2. Fix the capability checking - it only checks at the site level. By default the teacher can view/read/write the mrbs block. However the teacher role is usually not assigned at the site level, rather at the course level and/or occasionally at the front page level. The changes check against CONTEXT_COURSE rather than CONTEXT_SYSTEM.

I don't use the block so maybe there are reasons this code was never included.

Cheers,
Shane.

  1. block_mrbs.php.diff
    17/Dec/08 9:55 AM
    2 kB
    Shane Elliott
  2. mrbs.diff
    29/Dec/08 3:01 PM
    4 kB
    Anthony Borrow

Activity

Hide
Ralf Krause added a comment -

Hi Anthony,

I think that there would be no problem to do this addition. In my own Moodle I changed only one line to get this working.
Open the file blocks/mrbs/block_mrbs.php and add ", 'course' => true" to the code in line 14

My code looks like this and the block is shown to every user who has gotten one of the three mrbs roles

function applicable_formats() {
return array('site' => true,'my' => true, 'course' => true);
}

It would be nice if you could put this addition into the normal code.

Best regards,
Ralf

Show
Ralf Krause added a comment - Hi Anthony, I think that there would be no problem to do this addition. In my own Moodle I changed only one line to get this working. Open the file blocks/mrbs/block_mrbs.php and add ", 'course' => true" to the code in line 14 My code looks like this and the block is shown to every user who has gotten one of the three mrbs roles function applicable_formats() { return array('site' => true,'my' => true, 'course' => true); } It would be nice if you could put this addition into the normal code. Best regards, Ralf
Hide
Anthony Borrow added a comment -

Ralf - Thanks for testing. Actually I think we can go ahead and just use the default block settings so rather than adding course I have simply commented out the local version of applicable_formats. I've committed this to HEAD and if you could test it then I would be willing to merge it back to 1.9. I'm going to go ahead and resolve this issue; however, feel free to let me know if I need to do something else. Peace - Anthony

Show
Anthony Borrow added a comment - Ralf - Thanks for testing. Actually I think we can go ahead and just use the default block settings so rather than adding course I have simply commented out the local version of applicable_formats. I've committed this to HEAD and if you could test it then I would be willing to merge it back to 1.9. I'm going to go ahead and resolve this issue; however, feel free to let me know if I need to do something else. Peace - Anthony
Hide
Anthony Borrow added a comment -

I commented out applicable_formats and will use defaults for a block that will allow course, site, my, etc.

Show
Anthony Borrow added a comment - I commented out applicable_formats and will use defaults for a block that will allow course, site, my, etc.
Hide
Ralf Krause added a comment -

Yes, it seems to work. It would be fine if this could become the distributed version.

I think it is much better if the Moodle-Admin can decide to place the MRBS on the frontpage or not. The global roles for MRBS make sure that only the right people can look into it or can do the bookings.

Ralf

Show
Ralf Krause added a comment - Yes, it seems to work. It would be fine if this could become the distributed version. I think it is much better if the Moodle-Admin can decide to place the MRBS on the frontpage or not. The global roles for MRBS make sure that only the right people can look into it or can do the bookings. Ralf
Hide
Anthony Borrow added a comment -

Ralf - It would not be too difficult to add this option to the global configuration (to use in courses or not). Then it is just a simple if statement. I'm in meetings most of the weekend but will leave this on my to do list. Peace - Anthony

Show
Anthony Borrow added a comment - Ralf - It would not be too difficult to add this option to the global configuration (to use in courses or not). Then it is just a simple if statement. I'm in meetings most of the weekend but will leave this on my to do list. Peace - Anthony
Hide
Anthony Borrow added a comment -

This is a diff file that implements the ability to change the settings to turn on or off being able to add the mrbs block to a course. This patch also incorporates the changes to the description string that was suggested that we add in another issue. I'm going to re-open this issue until I have a chance to review the proposed changes more thoroughly and test them. Testing using this patch is welcome. Peace - Anthony

Show
Anthony Borrow added a comment - This is a diff file that implements the ability to change the settings to turn on or off being able to add the mrbs block to a course. This patch also incorporates the changes to the description string that was suggested that we add in another issue. I'm going to re-open this issue until I have a chance to review the proposed changes more thoroughly and test them. Testing using this patch is welcome. Peace - Anthony
Hide
Anthony Borrow added a comment -

re-opening to implement enable_courses option in settings.php

Show
Anthony Borrow added a comment - re-opening to implement enable_courses option in settings.php
Hide
Anthony Borrow added a comment -

Here is another one with patches that seems worth considering. Shane is the Moodle Partner here in Perth so it should be a reasonably reliable patch. Again, if you prefer not to be bothered just re-assign the issue to me. Peace - Anthony

Show
Anthony Borrow added a comment - Here is another one with patches that seems worth considering. Shane is the Moodle Partner here in Perth so it should be a reasonably reliable patch. Again, if you prefer not to be bothered just re-assign the issue to me. Peace - Anthony

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: