90 Commits

Author SHA1 Message Date
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
stronk7
4c49c802d0 Some minor changes about the system to encode file.php calls included.
Solve an important issue about scheduled backups not working properly
    when encoding links...
Added support for event->visible in backup & restore.

TODO: Add wwwroot to backup/restore to use it when decoding.
      Change the system to encode forum calls.
2004-05-06 22:17:45 +00:00
stronk7
750024e833 Changed hiddentopics to hiddensections in backup and restore 2004-05-02 22:34:13 +00:00
stronk7
d2b5f1e8bf event->format is now in backup & restore. 2004-04-27 19:51:12 +00:00
stronk7
87808d0a01 Now, in topics format, every course can decide about how to
display hidden topics (collapsed or invisible)
Added support for course->hiddentopics in backup & restore
2004-04-27 16:37:53 +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
229f852a8a Now blockinfo is fully supported in backup & restore. For old backups
(without blockinfo field, default blocks are applied). Every block
visibility is mantained in the process.
Bump versions a bit (2004042100) :-)
2004-04-20 23:28:46 +00:00
moodler
0043ddbb1a decalre $THEME to stop some notices ... 2004-04-17 13:37:54 +00:00
stronk7
01f50e060e First attempt to encode/decode some absolute path parts
in the backup/restore process in order to have every call to file.php
working in destination courses. Specially useful to contents created
with th HTML editor because it uses this type of URLs to images, smiles...

NOTE: This make 1.3 backups not restorable in 1.2 systems !!
2004-04-01 23:31:56 +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
moodler
8199e3f09a New user field called "emailstop" ... to stop emails.
I had to do it ... this is driving me nuts with some people
on moodle.org
2004-02-20 09:02:27 +00:00
moodler
3c0561cfe7 New field in the groups table to "hidepicture" from being displayed
in locations like forums etc.

Backups done too, Eloy.  :-)
2004-02-15 07:29:55 +00:00
stronk7
3a4b33c3b9 Now course->lang is in backup & restore. 2004-02-09 22:24:34 +00:00
stronk7
9055368540 Ooops !! Copy/paste typo. :-) 2004-02-08 19:37:43 +00:00
stronk7
63349eb15c log->cmid is included in backup (not processed in restore yet!!) 2004-02-08 19:36:42 +00:00
stronk7
41fd7fe497 Now user_preferences are fully supported in backup & restore. 2004-02-08 19:27:23 +00:00
stronk7
29856bcba0 Now everything seems to work fine with the new insert_record() function.
Please, test :-)
2004-01-30 19:04:07 +00:00