53 Commits

Author SHA1 Message Date
defacer
1fa95628f6 Backup and restore for block instances within activities!
Made using the new goodies from the new pagelib, some really useful advice
from "Backup Man" Eloy and lots of love.
2005-02-28 04:50:36 +00:00
stronk7
50fc80d722 If the user isn't admin and the restored course hasn't teachers, add teacher.
Bug 2381
(http://moodle.org/bugs/bug.php?op=show&bugid=2381)

Merged from MOODLE_14_STABLE
2005-02-17 22:57:53 +00:00
stronk7
6d1e416208 Now MIM is restored completely too!!!
It was more complex than I thought!
2005-02-13 19:09:41 +00:00
stronk7
0183a6c48e One minor problem restoring categories in XHTML solved 2005-02-07 23:45:19 +00:00
stronk7
1bbf415fe8 Now the restore process is XHTMLised 2005-02-07 23:28:52 +00:00
stronk7
cee6968fa1 Now metacourses are working in restore too!
Please test them!!
2005-02-07 17:52:58 +00:00
stronk7
96e76b6291 Two missing parameters added 2005-01-27 19:43:42 +00:00
stronk7
94df8a48c3 Now scheduled backup supports new blocks.
Moved blocks code to library.
Fixed a missing global preventing restore to work.
2005-01-27 19:07:51 +00:00
mjollnir_
873bf8758f Initial checkin for import course content functionality (uses backup/restore). Probably needs wording changes and new icon! Please test me *thoroughly*! 2005-01-27 02:35:10 +00:00
mjollnir_
68ba62d21a Merged from MOODLE_14_STABLE: Adding fix for idnumber duplication problem in restoring from backup discussed at http://moodle.org/mod/forum/discuss.php?d=16297 2004-12-17 03:04:24 +00:00
defacer
9b12850043 Fix for bug 2241:
I hope this time I got everything changed to the new Page interface! I 'm
really sorry for messing up and breaking new installations... :(

Also moved the only two functions of the API outside the page_base class.
2004-11-29 04:19:05 +00:00
defacer
f032aa7a5f MAJOR CHANGES:
--------------

Brand-new pagelib.php at your disposal! It slices, it dices, it makes your coffee.
It still doesn't understand women... Read the comments in pagelib.php for a first
impression. Feedback highly encouraged!

Blocks code has undergone significant changes to work with Pages. Flexibility is its
middle name, since I think (without having tried it) that adding e.g. a third
placeholder for "center" blocks in courses, with full support for moving around etc,
will now take about 15 lines of new or edited code. If you are not impressed yet, I
suggest watching a documentary on solar physics. :P

MINOR CHANGES:
--------------

Added instance_allow_config() in the blocks class hierarchy to supplement per-instance
configuration options. You can override it to return true and thus get configuration
amenities without allowing multiple instances.

Minor polishing to comments and documentation (whatever caught my eye was game).

Tightened up some code here and there by utilizing all the new features.

BUGFIXES:
---------

A bug in restore_execute.html caused hidden blocks to not be restored at all.
2004-11-08 19:36:07 +00:00
moodler
c1177e371f Fixed a comment without // at the start in block restoring 2004-11-04 08:12:33 +00:00
defacer
3ecf46a193 Blocks are now saved to and restored from course backups!
Backward compatibility is maintained, i.e. you can restore ANY version
backups without problems in 1.5. When "adding backup data to an existing
course", no blocks are added. I 'm not sure what the correct behavior
would be in this case.

When restoring a backup from Moodle <= 1.2, the new course SHOULD be given
default blocks when it is restored. I have not actually tested this, my
tests were with version 1.3 and 1.4 backup format.
2004-10-29 17:07:11 +00:00
gustav_delius
7ef0797dea some fixes for XHTML compliance 2004-09-12 01:34:24 +00:00
gustav_delius
6bc502cca7 List of courses is now always ordered according to sortorder, see http://moodle.org/mod/forum/discuss.php?d=7034 2004-05-30 00:33:45 +00:00
stronk7
c9c8984582 Now ORIGINAL_WWWROOT is saved in backup and restored too!! 2004-05-06 23:20:25 +00:00
stronk7
56eea82e08 First version of inter-activities mantained in backup/restore.
All the conversion to some pseudo-codes are done at backup time.
In the restore process, every link is decoded to new ids.
For now, this is supported:
- In backup:
  -all links to forums are encoded.
- In restore:
  - all links to forums are decoded.
      - from forums (post->message).
      - from resources (resource->alltext).
The process requires a backup made with the same version (because it
has to be properly encoded at backup time). Old backups will work
without conversions at all.
Only tested with some little courses.
It would be perfect to have some "big" course to test it.
Please, test and feedback, ciao :-)
2004-04-24 00:40:45 +00:00
stronk7
df9a165ecc Now, after restoring the course, the restore proccess executes
every MODULE_refresh_events() function to recalculate every
activity event automatically.
2004-04-09 23:40:37 +00:00
stronk7
57946b6d47 Take out the "working on it" string when restoring logs 2004-03-10 08:35:48 +00:00
stronk7
cd44fdcb82 Some important changes:
- Now course events are supported in backup & restore.
        - in manual backups
        - in scheduled backups
    - Fixed important bug when restoring groups.
    - Added support to the "user change password" action
      (with some changes done in login/change_password.php)

Please, test it !!!!
2004-02-21 01:30:22 +00:00
stronk7
2ecad74265 First version of restore logs !!
It restores:
    course logs
    user logs
Todo:
    module logs

Coming soon :-)
2004-02-13 23:28:45 +00:00
stronk7
dfa14bc98f Now groups and members are restored and recoded when restoring courses.
Existing courses are searched by name+description to add members to
existing groups (when restoring over another course).
2004-01-25 20:57:58 +00:00
moodler
d497a2a2fb Don't throw an error if users aren't found - just print a notice. 2003-10-07 14:02:32 +00:00
stronk7
0611af101d Now, "needed" users are included in backup/restore when
"course users" are selected.  This uses the xxxx_get_participants()
function in every module.
This solves an issue about info in modules belonging to
unenrolled users (Bug #692 closed).
Mantain compatibility with old backups (1.1 and 1.1.1).
Updated version to "1.2 development".
Included support to "label" module (by Martin)
2003-09-14 21:43:34 +00:00
moodler
830ce8241b Some fixes for robustness (make sure variables exist before using them
because it flags errors when in debug mode).

Also, when specifying array values by name use quotes around the name

 eg  $array['value'] instead of $array[value]

Finally, I changed the way user restoring works (slightly).  Before, if a
restored user was found to be a course creator or an admin, then this
status was restored.  I don't think this is a good idea - it could lead
to security problems when copying a backup from one site to another,
or if that person's status has changed since the backup was made.
I think it's best to only restore what is actually part of the course,
ie teacher or student.

If this broke anything else let me know!
2003-08-25 01:44:01 +00:00
stronk7
300ae26c2d Ooops I commited some debug source code in previous
versions. Going back. Sorry.
2003-08-23 17:40:27 +00:00
stronk7
41923e7511 Solved one problem when copying empty directories. 2003-08-23 17:33:34 +00:00
stronk7
bbc69d99c1 Changed one notify 2003-08-23 17:02:20 +00:00
moodler
ae5f8de620 Added some more error messages when restoring 2003-08-22 13:20:06 +00:00
stronk7
42f1ff47b4 Scales are now supported in backup/restore.
Updated version to 0.8.8 alpha. Please test.
2003-08-18 00:00:22 +00:00
moodler
63bcc9b55b Use isteacheredit instead of isteacher 2003-08-16 06:37:06 +00:00
moodler
6a2d42e6fb Changed function name 2003-08-07 16:04:54 +00:00
stronk7
51de923ed1 Reuse an existing string. 2003-08-03 15:15:23 +00:00
stronk7
be2a6fc6ca Teacher restoring and admin restoring finished.
Allow restore into new course (only admins),
      restore into existing course deleting old and
      restore into existing course adding to old
Teachers are limited to "current course" while admins ca
select any course. :-)
2003-08-03 00:42:41 +00:00
moodler
9c1ae5ae32 Removed $moodle_home and $mods_home references.
Also removed direct references to $backup_version and $backup_release

backup.php now accepts teachers of their own course
2003-08-01 14:34:11 +00:00
stronk7
101735cc89 Included fix_category_courses() to
adjust the new category structure
2003-07-31 18:01:45 +00:00
stronk7
2b96840769 Variables passed by reference warning is out !! 2003-07-31 16:44:52 +00:00
stronk7
7d40e78c0d Uncommented clean_temp_data. I forgot it
in lastest tests...
2003-07-30 16:29:53 +00:00
stronk7
67805f89ec Prepared to insert string in langs. Tomorrow. 2003-07-28 19:37:37 +00:00
stronk7
11c1d52551 Added some flush 2003-07-07 18:46:36 +00:00
stronk7
56f56ca0b2 Now categories and questions are recovered completely (STEP1) 2003-06-28 23:18:37 +00:00
stronk7
7c7031dd16 Added some <br>... 2003-06-23 22:49:58 +00:00
stronk7
adc8b0c7fe Changes to users restore and some minor bugs detected
(when no modules were selected to restore)
2003-06-20 19:44:06 +00:00
stronk7
5c191b96ee Clear temp data working now (uncommented) 2003-06-12 17:32:22 +00:00
stronk7
2ffc0358aa Uncommented clean_temp_data. 2003-06-01 19:59:42 +00:00
stronk7
bd19b8fa96 Restoring assignments COMPLETED.
Added clean temp structures
Increased version info
2003-06-01 10:40:11 +00:00
stronk7
5146bf9f54 Now readjusting course_modules instance and course modinfo
os implemented and working
2003-05-31 15:21:39 +00:00
stronk7
e3df3ece17 Begin restoring mods. Now they are readed and saved to db
(backup_ids) in serialized form.
2003-05-30 21:32:04 +00:00
stronk7
64eed73fa2 Changed bahabior when restoring into a existing course
(don't create sections and assign to section 0 if original
section doesn't exist). Everything is saved in backup_ids
to use it when restoring modules.
2003-05-28 23:41:56 +00:00