MDL-48012 tool_recyclebin: multiple changes before integration
authorMark Nelson <markn@moodle.com>
Wed, 24 Feb 2016 05:59:06 +0000 (13:59 +0800)
committerMark Nelson <markn@moodle.com>
Fri, 18 Mar 2016 06:12:08 +0000 (14:12 +0800)
commit93af6a610e6f139895144f3ccab4dfe9d78a69fc
tree8ed8821aac3bfcbfe7f1d56ce0c6e9cba763d57c
parent1c42ad71352914f05075b968e1c2ef7161749083
MDL-48012 tool_recyclebin: multiple changes before integration

- Added new icon for the recycle bin.
- Fixed issue where the course expiry setting was being used to display
  the expiry messages in the category bin.
- Fixed failing Behat tests.
- Tidied Behat tests.
  - General tidy up.
  - Deleted three Behat feature files.
    - Deleted 'delete_confirmation.feature' as it's testing JS functionality
      that was removed (see comment further down). The 'basic_functionality.feature'
      now tests deleting an activity and a course.
    - Deleted 'description.feature' and added the tested functionality to
      'basic_functionality.feature'.
    - Deleted 'logs_test.feature' and moved testing to PHPUnit tests.
  - Added another scenario for restoring a course.
- Removed protected mod settings - it was discussed that this was not a necessary
  feature. We should not be treating the recycle bin as a backup.
- Renamed events to conform to guidelines.
- Wrote new PHPUnit tests for events.
- Tidied up existing PHPUnit tests and extended them.
- Alphabetised lang file.
- Made changes to strings and string identifiers in the lang file and changed usages in code.
- Changed setting names to better identify their purpose.
- Renamed classes and file names so it's easier to identify their purpose.
- Renamed the 'deleted' column to 'timecreated' for consistency with other
  Moodle tables, and to easily identify what the value represents.
- Changed the columns 'category' and 'course' to 'categoryid' and
  'courseid' respectively.
- Changed the name of the table indexes for consistency with core.
- Removed module.js and any use of it and replaced with Moodle core libraries
  for JS confirmation.
- Removed 'noevent' argument in delete_item().
- Removed unnecessary capabilities - we can use the same capabilties for both
  recycle bins based on the context the capability was given.
- Removed '_' in the capability definitions to keep it consistent with core.
- Set page layout and headings for index.php - varies between the course and
  category recycle bins.
- Deleted styles.css and centred columns using the flexible_table API.
- Fixed IDE and codechecker complaints.
- Made use of the files API, rather than writing directly to
  "$CFG->dataroot . '/recyclebin'".
- Used make_temp_directory rather than expecting it to exist.
- Replaced debugging function calls with calls to the backup API to
  display errors.
- Deleted the temporary backup file after a successful restore, or if it fails.
- If the restore fails for a course, delete the course we created.
- Removed unnecessary '\' characters when not in namespace.
- Used configduration class for expiry times in the settings.
- Cleanup course bin when a course is deleted.
- Cleanup a category bin when a category is deleted.
- Removed unnecessary throw tags.
- Changed default settings.
33 files changed:
admin/tool/recyclebin/classes/base_bin.php [moved from admin/tool/recyclebin/classes/recyclebin.php with 66% similarity]
admin/tool/recyclebin/classes/category_bin.php [moved from admin/tool/recyclebin/classes/category.php with 58% similarity]
admin/tool/recyclebin/classes/course_bin.php [moved from admin/tool/recyclebin/classes/course.php with 57% similarity]
admin/tool/recyclebin/classes/event/category_bin_item_created.php [moved from admin/tool/recyclebin/classes/event/course_stored.php with 88% similarity]
admin/tool/recyclebin/classes/event/category_bin_item_deleted.php [moved from admin/tool/recyclebin/classes/event/course_purged.php with 88% similarity]
admin/tool/recyclebin/classes/event/category_bin_item_restored.php [moved from admin/tool/recyclebin/classes/event/course_restored.php with 88% similarity]
admin/tool/recyclebin/classes/event/course_bin_item_created.php [moved from admin/tool/recyclebin/classes/event/item_stored.php with 88% similarity]
admin/tool/recyclebin/classes/event/course_bin_item_deleted.php [moved from admin/tool/recyclebin/classes/event/item_purged.php with 88% similarity]
admin/tool/recyclebin/classes/event/course_bin_item_restored.php [moved from admin/tool/recyclebin/classes/event/item_restored.php with 88% similarity]
admin/tool/recyclebin/classes/task/cleanup_category_bin.php [moved from admin/tool/recyclebin/classes/task/cleanup_courses.php with 69% similarity]
admin/tool/recyclebin/classes/task/cleanup_course_bin.php [moved from admin/tool/recyclebin/classes/task/cleanup_activities.php with 59% similarity]
admin/tool/recyclebin/db/access.php
admin/tool/recyclebin/db/install.xml
admin/tool/recyclebin/db/tasks.php
admin/tool/recyclebin/index.php
admin/tool/recyclebin/lang/en/tool_recyclebin.php
admin/tool/recyclebin/lib.php
admin/tool/recyclebin/module.js [deleted file]
admin/tool/recyclebin/pix/trash.png [new file with mode: 0644]
admin/tool/recyclebin/pix/trash.svg [new file with mode: 0644]
admin/tool/recyclebin/settings.php
admin/tool/recyclebin/styles.css [deleted file]
admin/tool/recyclebin/tests/behat/backup_user_data.feature
admin/tool/recyclebin/tests/behat/basic_functionality.feature
admin/tool/recyclebin/tests/behat/delete_confirmation.feature [deleted file]
admin/tool/recyclebin/tests/behat/description.feature [deleted file]
admin/tool/recyclebin/tests/behat/logs_test.feature [deleted file]
admin/tool/recyclebin/tests/category_bin_test.php [new file with mode: 0644]
admin/tool/recyclebin/tests/category_test.php [deleted file]
admin/tool/recyclebin/tests/course_bin_test.php [new file with mode: 0644]
admin/tool/recyclebin/tests/course_test.php [deleted file]
admin/tool/recyclebin/tests/events_test.php [new file with mode: 0644]
admin/tool/recyclebin/version.php