]> git.mjollnir.org Git - moodle.git/commitdiff
Merged from MOODLE_14_STABLE - Ensuring correct sortorder at the beginning of the...
authormartinlanghoff <martinlanghoff>
Tue, 25 Jan 2005 05:03:43 +0000 (05:03 +0000)
committermartinlanghoff <martinlanghoff>
Tue, 25 Jan 2005 05:03:43 +0000 (05:03 +0000)
course/edit.php

index a0070b11f0b9609824083e6d96cdc03347da3b23..cf131f4d302eae5a9698e56a76d362e9eb50341b 100644 (file)
             } else {
                 $form->timecreated = time();
 
+                // place at beginning of category
+                fix_course_sortorder();
+                $form->sortorder = get_field_sql("SELECT min(sortorder)-1 FROM {$CFG->prefix}course WHERE category=$form->category");
+
                 if ($newcourseid = insert_record('course', $form)) {  // Set up new course
                     
                     // Setup the blocks