Non-core contributed modules

Message log page

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: None
  • Labels:
    None
  • Environment:
    Developed on MySQL but uses get_records_sql so hopefully will work on other databases
  • Affected Branches:
    MOODLE_19_STABLE

Description

Page to view all messages sent along with who when etc. and options to filter by user and date.

See thread: http://moodle.org/mod/forum/discuss.php?d=27559

Activity

Hide
Anthony Borrow added a comment -

Mike - Thanks for sharing this code. Could you also provide a basic README.txt that includes installation instructions.I agree that at an initial glance it looks like it would be a good admin report; however, I am not sure who would be using this report (admins, teachers, etc.). I did find the following:

Notice: Undefined index: user in /home/arborrow/Moodle/code/19stable/message/messagelog.php on line 64

so I would go through and run it with debugging set to show all reasonable PHP notices and errors. I was able to get around it by adding an isset check but check the logic to make sure it is what it is intended:

if (isset($qual['user']) and ! $qual['user'] ) {

Peace - Anthony

Show
Anthony Borrow added a comment - Mike - Thanks for sharing this code. Could you also provide a basic README.txt that includes installation instructions.I agree that at an initial glance it looks like it would be a good admin report; however, I am not sure who would be using this report (admins, teachers, etc.). I did find the following: Notice: Undefined index: user in /home/arborrow/Moodle/code/19stable/message/messagelog.php on line 64 so I would go through and run it with debugging set to show all reasonable PHP notices and errors. I was able to get around it by adding an isset check but check the logic to make sure it is what it is intended: if (isset($qual['user']) and ! $qual['user'] ) { Peace - Anthony
Hide
Matt Campbell added a comment -

Pulled this into an admin report, would probably be a good idea to also add some default settings the admin can define - currently it will pull all messages held in the database (in our case this is about 4 years worth).

Thanks,
Matt

Show
Matt Campbell added a comment - Pulled this into an admin report, would probably be a good idea to also add some default settings the admin can define - currently it will pull all messages held in the database (in our case this is about 4 years worth). Thanks, Matt
Hide
Anthony Borrow added a comment -

Matt - Thanks for making this an admin report - I think it will work much better there. Looking at the code I am still receiving a PHP notice about $qual['user']:

Notice: Undefined index: user in /home/arborrow/Moodle/code/19stable/admin/report/messagelog/index.php on line 68

I'm not sure what the logic you want. Above, I suggested adding an isset but realized that perhaps you may not want it to be set. So then I thought you may be looking for an or statement such as:

if (!isset($qual['user']) or ! $qual['user'] ) {

In other words if $qual['user'] is not set then populate the other stuff unless $qual['user'] is set and is 0 (i.e. false). Alternatively you may just be wanting to use isset instead of the value; however, doing so when it is not set produced the PHP notice. I'll leave it up to you to fix as you see fit.

Peace - Anthony

Show
Anthony Borrow added a comment - Matt - Thanks for making this an admin report - I think it will work much better there. Looking at the code I am still receiving a PHP notice about $qual['user']: Notice: Undefined index: user in /home/arborrow/Moodle/code/19stable/admin/report/messagelog/index.php on line 68 I'm not sure what the logic you want. Above, I suggested adding an isset but realized that perhaps you may not want it to be set. So then I thought you may be looking for an or statement such as: if (!isset($qual['user']) or ! $qual['user'] ) { In other words if $qual['user'] is not set then populate the other stuff unless $qual['user'] is set and is 0 (i.e. false). Alternatively you may just be wanting to use isset instead of the value; however, doing so when it is not set produced the PHP notice. I'll leave it up to you to fix as you see fit. Peace - Anthony
Hide
Anthony Borrow added a comment -

Matt,

I also think the PAGE code can be removed. I commented out these two lines in index.php

//$PAGE = page_create_object(PAGE_COURSE_VIEW, 1); // Complete hack - no idea how to use this function properly
//$PAGE->print_header('View all messages'); // Should probably be PAGE_ADMIN but I can't get this to work

I noticed that when moving around the various options if I choose oldest, then click on more that oldest is not remembered so we may want to look at how the target URLs are being formed so that we maintain the history. It would also be nice to clarify a bit that the involving, from, and to fields search for a match on the username. I initially thought that involving might search the message text so that I could search for a particular word or phrase. Perhaps some logical operators would be helpful to pick from and/or to. It seems that involving is essentially doing from or to a particular user. In any case, it looks functional enough to add to CVS so I am going to do that now.

Peace - Anthony

Show
Anthony Borrow added a comment - Matt, I also think the PAGE code can be removed. I commented out these two lines in index.php //$PAGE = page_create_object(PAGE_COURSE_VIEW, 1); // Complete hack - no idea how to use this function properly //$PAGE->print_header('View all messages'); // Should probably be PAGE_ADMIN but I can't get this to work I noticed that when moving around the various options if I choose oldest, then click on more that oldest is not remembered so we may want to look at how the target URLs are being formed so that we maintain the history. It would also be nice to clarify a bit that the involving, from, and to fields search for a match on the username. I initially thought that involving might search the message text so that I could search for a particular word or phrase. Perhaps some logical operators would be helpful to pick from and/or to. It seems that involving is essentially doing from or to a particular user. In any case, it looks functional enough to add to CVS so I am going to do that now. Peace - Anthony
Hide
Anthony Borrow added a comment -

Matt - code added to CVS, Admin report: Message log component created in tracker, CVS write privileges granted for contrib/plugins/admin/report/messagelog - resolving as fixed. Let me know if you need anything else. Peace - Anthony

Show
Anthony Borrow added a comment - Matt - code added to CVS, Admin report: Message log component created in tracker, CVS write privileges granted for contrib/plugins/admin/report/messagelog - resolving as fixed. Let me know if you need anything else. Peace - Anthony
Hide
Anthony Borrow added a comment -

moving to new component

Show
Anthony Borrow added a comment - moving to new component
Hide
Anthony Borrow added a comment -

Matt - One last comment, if you get a chance please create a page in Moodle Docs with installation instructions (and/or a README.txt file) and consider adding an entry in the Modules and Plugins database for this new report. If you do create a docs and M&P entry, let me know what they are as I am going to start listing those in the component description to facilitate moving between the tracker and other areas. Peace - Anthony

Show
Anthony Borrow added a comment - Matt - One last comment, if you get a chance please create a page in Moodle Docs with installation instructions (and/or a README.txt file) and consider adding an entry in the Modules and Plugins database for this new report. If you do create a docs and M&P entry, let me know what they are as I am going to start listing those in the component description to facilitate moving between the tracker and other areas. Peace - Anthony
Hide
Matt Campbell added a comment -

Added a readme.txt file to the files in contrib and created a M&P entry - http://moodle.org/mod/data/view.php?d=13&rid=2285. Built a page in Moodle docs and put it in the Contributed Code category.

Show
Matt Campbell added a comment - Added a readme.txt file to the files in contrib and created a M&P entry - http://moodle.org/mod/data/view.php?d=13&rid=2285. Built a page in Moodle docs and put it in the Contributed Code category.
Hide
Anthony Borrow added a comment -

Thanks Matt for adding the readme.txt and creating the M&P entry and documentation page (http://docs.moodle.org/en/Message_Log). Peace - Anthony

Show
Anthony Borrow added a comment - Thanks Matt for adding the readme.txt and creating the M&P entry and documentation page (http://docs.moodle.org/en/Message_Log). Peace - Anthony
Hide
Anthony Borrow added a comment -

Closing all of my resolved issues. Peace - Anthony

Show
Anthony Borrow added a comment - Closing all of my resolved issues. Peace - Anthony

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: