106 Commits

Author SHA1 Message Date
stronk7
b1a88d0413 Part of Bug 4583. Now backup tables are moodle-style compliant.
Also, the 4th parameter used in insert_record() has been erased
to avoid the bug itself. PortgreSQL upgrade not tested!
(http://moodle.org/bugs/bug.php?op=show&bugid=4583)
2006-01-16 10:23:48 +00:00
mjollnir_
b22008bae0 after discussion with Eloy: Always strip controlchars in xml_tag_safe_content 2006-01-16 09:07:30 +00:00
mjollnir_
a9e1e4c850 Backup xml tags now support attributes and a new function for xml content to be safe utf-8. Eloy can you please review this patch? 2006-01-16 02:37:19 +00:00
mjollnir_
a94baeaf20 Abstracted all the stuff that gets backup prefs from request, and put
it into session. This makes it easier to add a new stages
	and not have to write hidden fields and such like
2006-01-16 00:39:01 +00:00
mjollnir_
1ecea97679 Granular backup & restore:
This patch allows the much requested selection of individual instances of modules within a course to backup and restore.
It needs A LOT of testing and probably some prettyifying too.
2006-01-13 03:45:31 +00:00
skodak
8fd23ca2e2 fixed sql quoting SC#145; merged from MOODLE_15_STABLE 2005-10-29 21:53:33 +00:00
stronk7
f64376bfc8 Strip control chars from being sent to the XML file.
Only tab, newline and return are allowed in XML 1.0.
This feature is controlled by $CFG->backup_strip_controlchars.

Please, test it!

Merged from MOODLE_15_STABLE
2005-09-02 00:03:04 +00:00
mjollnir_
d23d0398fe Merged from MOODLE_15_STABLE: Escape strings for database. SC # 145 2005-08-26 05:29:34 +00:00
moodler
f2e34253c3 Removing and re-adding currency support in courses 2005-07-22 17:19:52 +00:00
moodler
f5e1319ec3 Merged SC139 from stable 2005-07-12 08:00:51 +00:00
gustav_delius
2e1111c5b1 Towards a Moodle 1.5 quiz backup and restore. Not tested yet.
I moved some quiz speicific functions out of backup/backuplib.php into mod/quiz/backuplib.php
2005-05-10 09:37:09 +00:00
moodler
b345a30f35 Added support for trackforums 2005-04-25 18:45:21 +00:00
stronk7
04592aec06 Now event->repeatid is included in backup/restore. Thanks for
your support Jon!
Bump to 1.5 beta
2005-04-22 23:49:48 +00:00
stronk7
12b255b9ed Some table->id fields added to backup of gradebook.
I need them in restore (and I always forget it!)
2005-04-21 16:24:26 +00:00
stronk7
e19d817eb3 Now backup of 1.5 gradebooks is working (restore coming soon). Features are:
- It's automatic. No setting for it. Does it sound ok?
 - Any info related to non-exported modules is skipped.
 - Any info related to non-exported users is skipped.
2005-04-19 23:21:45 +00:00
stronk7
80117b519d Now group images are in backup & restore 2005-03-07 23:40:25 +00:00
moodler
3ac6807ee1 Added backup/restore support for the new fields I added today 2005-03-05 10:31:58 +00:00
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
c98cb6bc57 Now quiz_categories' parent and sortoreder is supported in backup.
A mechanish to detect all the ancestors and to recover orphaned
categories is now running ar backup time to force backups to be consistent.
2005-02-20 17:19:04 +00:00
stronk7
e8cddb8e6c Created the fix_orphaned_questions() function.
Used before execute the backup of a course to enforce integrity.

Perhaps this function should go to central code and be executed
at upgrade time (and be available in health center too!).

See bug 2380
(http://moodle.org/bugs/bug.php?op=show&bugid=2380)
2005-02-15 19:51:01 +00:00
stronk7
2205d909ae Now user->theme, group->theme and course->theme are supported 2005-02-15 18:37:08 +00:00
stronk7
2f77550675 Need IDs to use backup_ids as temporary storage in restore! 2005-02-13 11:44:39 +00:00
stronk7
70641539f3 Now MIM are included in backup (not restore yet). Configurable
for scheduled backups and only done in SITE backups. Structure is:
<MESSAGES>
  <MESSAGE>
    Content of the message with one flag to difference read & unread
  </MESSAGE>
  <CONTACTS>
    <CONTACT>
      Content of the contact
    </CONTACT>
  </CONTACTS>
</MESSAGES>
message_get_participants() should include contact users too!!
2005-02-13 02:59:04 +00:00
stronk7
1d9169d312 Now group members are only included (backup and restore) if
we have selected to have users! Thanks to Etienne! Bug 2486
(http://moodle.org/bugs/bug.php?op=show&bugid=2486)

Merged from MOODLE_14_STABLE
2005-02-04 16:24:12 +00:00
stronk7
572248937e Now metacourse in supported in manual and scheduled backups. It can be configured
in both backups. Please check if the used structure and exported data has sense!
2005-02-04 14:33:51 +00:00
defacer
7542a4e574 Dropping the use of MOODLE_PAGE_COURSE <gasp>!
The new constant is PAGE_COURSE_VIEW, and it's more streamlined with the
new CSS-related ids for 1.5. There are great possibilities for the future
here, so we 're getting ready.

On the other hand, this has to be the ugliest hack I 've ever inflicted
on any program (look at pagelib.php). Thankfully it will only stay for just
a little while.
2005-01-31 02:18:15 +00:00
stronk7
8a792ed10f group->password is now supported 2005-01-30 12:12:06 +00:00
stronk7
57aad2a02a added support for:
- user->policyagreed:
        if the destination server is different, reset it
   - user_students->enrol and user_teachers->enrol
        if not set or the destination server is different, set it to $CFG->enrol
somethings should be modified in the rest of moodle:
    - update all the 'manual' entries to 'internal'
    - modify the enrol_teacher() to use $CFG->enrol by default
    - make every enrol method set this field properly.
    - perhaps, mark metadata users with a new value too.
2005-01-30 11:39:12 +00:00
stronk7
ad4f774cd4 THEME is out of this directory.
I hope to have done it correctly!
2005-01-28 00:01:20 +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
mjollnir_
b565bbdfe2 Merged from MOODLE_14_STABLE: Fixes in datalib and backuplib for postgres invalid sql 2004-11-22 04:24:30 +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
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
stronk7
d752a8691f ZIP_METHOD included in backup for future tests at restore time. 2004-10-16 17:49:14 +00:00
stronk7
05f1bd8bca Not mandatory but I prefer to initialise it.
Merged from MOODLE_14_STABLE
2004-10-16 17:38:12 +00:00
stronk7
17841181b6 Now backup and restore are using central zip & unzip functions.
Merged from MOODLE_14_STABLE
2004-10-16 17:34:56 +00:00
stronk7
26082098d9 Use of cleardoubleslashes() added to the backup and restore functions.
They will be changed to calls to new, central zip and unzip functions.
(coming soon)

Merged from MOODLE_14_STABLE
2004-10-09 23:19:53 +00:00
stronk7
41bac9d0af The get_directory_list() function was being executed with
directories excluded so backup_delete_old_dirs() was no
working fine! This should delete REALLY old dirs in sites
with problems in their scheduled backup.

Merged from MOODLE_14_STABLE
2004-09-24 11:51:12 +00:00
gustav_delius
7ef0797dea some fixes for XHTML compliance 2004-09-12 01:34:24 +00:00
stronk7
6faaf9a6c9 Now user->guid is in backup & restore
Merged some pending changes from STABLE too.
2004-09-05 10:19:03 +00:00
stronk7
0083049b21 Now user->auth is in backup & restore
Bug 1789
(http://moodle.org/bugs/bug.php?op=show&bugid=1789)

Merged from MOODLE_14_STABLE
2004-08-28 10:26:06 +00:00
stronk7
52552be03d Now course->enrolperiod is supported in backup & restore. 2004-07-30 16:55:38 +00:00
stronk7
27757bee57 User->maildigest supported now. 2004-07-23 17:10:55 +00:00
stronk7
baadcd6560 Ooops!! I thought I had sent this to CVS some days ago.
Now both type of links (slasharguments on and off) are
detected in the backup process. And the restore process
take care of the slasharguments seting in destination
and translate all the links to the correct format.
I think it's really a nice addition, ;-)
Ready to 1.3.3 bump!!!
Bug 1634
(http://moodle.org/bugs/bug.php?op=show&bugid=1634)

Merged from MOODLE_13_STABLE
2004-07-15 23:04:22 +00:00
stronk7
d902b189e0 Added course->cost to backup/restore 2004-06-26 12:36:55 +00:00
stronk7
e0f8b50da7 Added support for timestart and timeend (user_teachers table) and
idnumber (course table). :-)
2004-06-24 22:41:00 +00:00
stronk7
fa96ad2f97 New feature implemented allowing none-user course backups.
See bug 1420.
(http://moodle.org/bugs/bug.php?op=show&bugid=1420)
2004-05-20 18:36:59 +00:00
stronk7
35055d3786 Step4 done. :-) 2004-05-16 18:05:02 +00:00
stronk7
646c20b5ff Solved a small bug in scheduled backups when encoding links!!
I've tested it against 10 courses (manual and scheduled) and
everything seems to work fine. In some days I'll test it againt
some BIG course (if moodle.org is updated to this version).
Dump version to 1.3 beta (as I think everything is finished now).

:-)
2004-05-09 23:15:56 +00:00
stronk7
c9c8984582 Now ORIGINAL_WWWROOT is saved in backup and restored too!! 2004-05-06 23:20:25 +00:00