Giter Site home page Giter Site logo

moodle-block_course_contacts's Introduction

Course contents block
*********************

The Course Contacts block displays a list of users on your course and various
methods for communicating with them.

The block is highly customisable and allows you to choose specific roles which
you wish to display users from. By default the block will show teachers on the
course but this can be changed however you wish.

You can also configure which communication types you wish to show, the block
can provide quick links to Email, Message or Telephone each user.

The block also shows whether the user has been active in the last five minutes.

Changelog
**********
v3.9 - Remove old/unused references to emails and quickmail. Apply fixes for identified issues and pull requests
	Thanks to mkpelletier, VladimirSavitchi, bel-omahoney, bradnielsen2981 and others
	With apologies for the large gap between reviews and updates!
v3.5.0.1 - Add Privacy API
v3.2 - Add missing capability language strings (thanks SK-Unikent)
       Add profile description as a display option
v3.1 - Option to use Alternate name for display instead of truncated full name (Thanks mkpelletier)
     - Font sizes of role name and text altered for consistency across other blocks
     - Bug fixed to add capability (Thanks savva312)
v3.0 - Minor updates to make the block work on Moodle3: minimal changes not reworked.
     - Code Checker edits
v2.0 - Fixed compatibility with MS-SQL.
     - The current user will no longer be filtered out of contacts list
       although the contact links will not be displayed for them.
     - Improved coding, removed custom DB query and made use of html writer.
     - Added a simple email form allowing users to email others directly
       from Moodle. This can be disabled through site configuration.
     - Added option to sort contact cards by recently active or date enrolled.
     - Added option to display inherited role assignments.
     - Removed dummy pluralisation after role names.
v1.0.1 - cleaned up sql queries, fixed a problem in the stylesheet
v1.0 - first release


Maintainer
**********
The block has been written and is being maintained by Mark Ward for Burton &
South Derbyshire College (UK).
v3.0/3.1 - Contributions from Richard Oelmann


Many thanks to
**************
Matthew Cannings of Sandwell.ac.uk for contributing code, suggestions and testing.
Paul Haddad for suggesting intergrated emailing and contact sorting options.
Aaricia Thorgalson for suggesting that users who are contacts should be visible on list.
Simon Hanmer for identifying problem and solution to issues with MSSQL databases.

Contact
*******
Mark Ward - http://moodle.org/user/profile.php?id=489101
Richard Oelmann - https://moodle.org/user/profile.php?id=480148

License
*******
Released Under the GNU General Public Licence http://www.gnu.org/copyleft/gpl.html

moodle-block_course_contacts's People

Contributors

brum1975 avatar gustavorivas96 avatar mkpelletier avatar roelmann avatar roglos avatar savva312 avatar sk-unikent avatar

Watchers

 avatar  avatar  avatar

moodle-block_course_contacts's Issues

Text content of the block is too large and out of proportion to other blocks

  1. Reduce role header size to h4 from h2 - H1 is used for the page header, H2 for block headers and H3 for topic section headers (in Clean theme). Role title inside block content should be smaller than these
  2. Make font size default for site/blocks, no need for it to be larger than standard - can be adjusted at an individual site level through custom css if required by a particular site

M3.11+ compatibility user_picture::fields

If you pull in Catalyst changes be aware that their line 199 in block_course_contacts.php is using a function user_picture::fields which is deprecated from M3.11

The alternative is:

$userfields = \core_user\fields::for_userpic()
            ->including(...['lastaccess', 'phone1', 'description'])
            ->get_sql('u', false, '', '', false)
            ->selects;

But this is only valid from M3.11

Users with multiple role assignments

Users with multiple role assignments are listed multiple times if more than one of his/her roles are selected in the block configuration. It would be useful to prioritise roles, selecting only those which are higher in the role hierarchy.

text-transform capitalize breaks casing for some names

With last names or compound names that are irregularly cased, the text-transform: capitalize in style.css causes problems. For example, names like van der Merwe are displayed like Van Der Merwe, which is incorrect. Since these are already correctly cased in the user's profile, it is unnecessary to use this styling.

Notice: Undefined property: stdClass::$description

Hello,

Turning the site on debug mode, I saw this on a page with block:

Notice: Undefined property: stdClass::$description in /var/www/html/moodle/blocks/course_contacts/block_course_contacts.php on line 301

Looks harmless, but I thought you might have wanted to know.

Cheers,

Sébastien

Error when restoring a course backup containing block instance on PHP 7.1

Encountering the following error when testing either version 2017070100 or 2017100100 on Moodle 3.0 when attempting to restore a course backup containing an instance of block_course_contacts - UPDATE that I found this only happens when running on PHP 7.1 (i.e. even up to PHP 7.0 this is not a problem and doesn't occur):

Exception - Using $this when not in object context

Debug info:
Error code: generalexceptionmessage
Stack trace:

    line 579 of /lib/pear/HTML/QuickForm.php: Error thrown
    line 545 of /lib/pear/HTML/QuickForm.php: call to HTML_QuickForm::_loadElement()
    line 130 of /lib/form/dateselector.php: call to HTML_QuickForm::createElement()
    line 543 of /lib/pear/HTML/QuickForm/group.php: call to MoodleQuickForm_date_selector->_createElements()
    line 160 of /lib/pear/HTML/QuickForm/group.php: call to HTML_QuickForm_group->_createElementsIfNotExist()
    line 194 of /lib/form/dateselector.php: call to HTML_QuickForm_group->setValue()
    line 372 of /lib/pear/HTML/QuickForm/element.php: call to MoodleQuickForm_date_selector->onQuickFormEvent()
    line 414 of /lib/pear/HTML/QuickForm/group.php: call to HTML_QuickForm_element->onQuickFormEvent()
    line 215 of /lib/form/dateselector.php: call to HTML_QuickForm_group->onQuickFormEvent()
    line 579 of /lib/pear/HTML/QuickForm.php: call to MoodleQuickForm_date_selector->onQuickFormEvent()
    line 609 of /lib/pear/HTML/QuickForm.php: call to HTML_QuickForm->_loadElement()
    line 199 of /backup/util/ui/base_moodleform.class.php: call to HTML_QuickForm->addElement()
    line 818 of /backup/util/ui/restore_ui_stage.class.php: call to base_moodleform->add_settings()
    line 137 of /backup/util/ui/base_ui_stage.class.php: call to restore_ui_stage_schema->initialise_stage_form()
    line 384 of /backup/util/ui/restore_ui.class.php: call to base_ui_stage->display()
    line 129 of /backup/restore.php: call to restore_ui->display()

Result is course restore is incomplete with some course activity modules/other content missing, so this is important that any courses containing the block instance can be safely backed up and restored restored intact

Group Support

I believe group support needs to be added. Otherwise the block does not reflect to the course settings when "Group mode" is set to "Separate groups".

Undefined property: stdClass::$description

When testing this plugin on a Moodle 3.5 upgrade, we are seeing the below error message.

PHP message: PHP Notice: Undefined property: stdClass::$description in /var/www/moodle/blocks/course_contacts/block_course_contacts.php on line 268

This is due to this line, $this->config->description == 1 where the blocks configuration does not have a description property set, most likely from being set in a previous version.

Adding an isset() before checking resolves the issue for us, but you could also use !empty()

if (isset($this->config->description) && $this->config->description == 1 && $contact->description != "") {

The images in the field of the profile user are shown

Preconditions:

It should be at least one user in the course.
The user needs an image in the description field of the profile

Test case:

Go to the course and turn editing on
Add Contact blocks and Configure the block
At Contact methods to show, click Yes for Description, Save changes
Errors are shown at the Stack trace and broken images at Course Contact block

Problem on upgrade

I would like to report a problem.
Today I try upgrade to a new version 2017100100 (Version 3.2).

However, after the upgrade, that occurred without error in the plugin page manager, the virtual rooms with the plugin stopped working, displaying HTTP 500 error.

I downgraded the version to be able to solve the problem.

Description of my system
Course contacts: 3.1 (2017070100)
Moodle 3.2.5 (Build: 20170911)

v3.9.0.1 throws an error on Moodle 3.7.6

The is_guest() call is throwing an error on Moodle 3.7.6. Apparently it can't get a course context so it just throws an error. I had to comment the line out and replace it with $isguest=false; to get past it. Maybe a try/catch block or check the Moodle version before calling it?

User photo removal and Email Text instead of Button

Hello,

Nice plugin, it has helped me alot.

Two questions:

  1. Can custom CSS remove the image so only the teacher name is given?
  2. Can the email button be replaced with text? Our students do not really use email enough to be able to follow a mailto link.
    I have gotten around this by making the staff description equal their email, and then show the description but I will for get this when new staff join.

Many thanks

standard capability block/course_contacts:myaddinstance not defined

I get this warning on Moodle 3.3

he block course_contacts does not define the standard capability block/course_contacts:myaddinstance
line 595 of /blocks/moodleblock.class.php: call to debugging()
line 567 of /blocks/moodleblock.class.php: call to block_base->has_add_block_capability()
line 228 of /lib/blocklib.php: call to block_base->user_can_addto()
line 3806 of /lib/navigationlib.php: call to block_manager->get_addable_blocks()
line 771 of /lib/pagelib.php: call to flat_navigation->initialise()
line 820 of /lib/pagelib.php: call to moodle_page->magic_get_flatnav()
line 47 of /theme/boostunic/layout/columns2.php: call to moodle_page->__get()
line 1162 of /lib/outputrenderers.php: call to include()
line 1092 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
line 164 of /my/index.php: call to core_renderer->header()

Moodle 3.10 Compatibility

I was using this on v 3.8 successfully, but have now upgraded to v3.10. We love this block.

Could it be updated to work in v3.10+

Currently when installed, it no longer shows the 'teacher' roles (we use 4) and likely not others except it does seem to show the Student role but we don't use it for that.

Would be to good to have this working v3.10+ asap

Moodle 4 support

Hi,
Could you please add support for Moodle 4?
Even if the current version of the plugin would work on Moodle 4, an official support would be great.

Thanks even for considering it :-)

No longer showing users enrolled via category enrolments

We currently make use of category enrolments to give Heads of School and Programme Leaders access to each of their courses/modules.
School -> Course ->Academic Year -> Modules

On the previous version when we were running 3.7 we were able to show these HoS / PL roles within the course contacts block but this now no longer appears to be the case.
If we were to to manually assign this role then that user would appear in the block, but this is not possible when that role is already assigned via another enrolment method.

Would it be possible to make it so this also pays attention to other types of enrolment?

lib.php referencing quickmail plugin

Hi, all of the functions in the lib.php file seem to be referencing the quickmail plugin and the quickmail db tables. None of these functions are referenced in the rest of the plugin and quickmail is not listed as a dependency for this plugin. I have installed block_course_contacts without this file and all works as expected. Is quickmail required for this plugin? Is the lib.php file required? Thanks

HR located in wrong place

There's a horizontal rule below the user name which separates it from the icons for contact methods email, messaging etc. This makes it appear that the icons belong to the user BELOW instead of the user above. As a result, users click the wrong icon and in both cases may not realize they are emailing or messaging the wrong teacher.

This hr placement also confuses the location of the role titles as well.

I think standard usage would be to have the hr below the icons thus clearly separating the users and indicating that the icons are directly below the name. This would also fix the issue with the placement of the role names.

Mock up of suggested change:

screenshot_10645

Why does this block mangle people's names?

I've seen #2 - I know there's a workaround for this, although in my opinion, not an ideal one: this is abusing the "alternate name" feature, which is designed to help people with different names in their native tongue to the course language. This workaround suggests creating an alternate name that is identical to the user's fullname

My question is why? Why on earth would you want to mess around with people's names? It seems like you are begging to be kicked by one of the items on this list. Which indeed you are, with our many users with a space in their first or last name!

It just doesn't seem like it could possibly be justified. The user is referred to by their fullname everywhere else in Moodle. If they want to be listed by a different name in Course Contacts, that would be the exception, not the rule - that would be the time to use alternatename.

At the very least, this needs to be a setting, but realistically, it should be removed, and the alternate name setting retained for users who want a different name to be presented.

Roles to show settings not honoured when creating courses from template

We use the Course Contacts blocks as a default block for all of our course pages (it's awesome!)

We always create new courses from a template and last year the settings came through fine on Moodle 3.0.3, block 2016070100.

We have recently upgraded to Moodle 3.2.4, block 2017070100 and none of the courses that were created last week have the correct config data set for the block instance.

We are going to update the database directly to correct this but thought I'd let you know.

Version mismatch - Moodle directory vs github source

Hi,

I've come to realise while doing updates for some plugins, and moving some to git submodules, that the moodle directory version of this plugin is showing a higher version than the github source.

Both the master and STABLE_39 branches are showing a version of 3.9.0.1 (2020050101) but the moodle directory is showing version 3.9.0.2 (2020050102).

Are there commits missing from the github repo? As if changing over to github submodules, the database upgrade page complains about the plugin being downgraded.

Block truncates compound names

With compound surnames, the block seems to truncate the name so only the first part is shown. E.g. if the facilitator name is something like Jacques du Plessis, you only get "Jacques Du" in the contacts block. It would seem that the public function "shorten_name" in block_course_contacts.php has not taken into account that some names should legitimately be left intact.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.