From: nicolasconnault Date: Fri, 1 Jun 2007 04:46:24 +0000 (+0000) Subject: MDL-9137 Removed hidden field from grade_categories and added deleted field to grade_... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ec4560cc58701de4368669c6e6aaab7d750e5378;p=moodle.git MDL-9137 Removed hidden field from grade_categories and added deleted field to grade_items. Also added 2 images in pix/i --- diff --git a/lib/db/install.xml b/lib/db/install.xml index 8a1fc97f57..34ae950126 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -1256,8 +1256,9 @@ - - + + + @@ -1279,9 +1280,8 @@ - - - + + diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 412e03e064..57c9d10634 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -1302,6 +1302,29 @@ function xmldb_main_upgrade($oldversion=0) { $result = $result && drop_field($table, $field); } + if ($result && $oldversion < 2007052300) { + require_once($CFG->dirroot . '/question/upgrade.php'); + $result = $result && question_remove_rqp_qtype(); + } + + if ($result && $oldversion < 2007060100) { + + /// Define field hidden to be dropped from grade_categories + $table = new XMLDBTable('grade_categories'); + $field = new XMLDBField('hidden'); + + // Launch drop field hidden + $result = $result && drop_field($table, $field); + + // Define field deleted to be added to grade_items + $table = new XMLDBTable('grade_items'); + $field = new XMLDBField('deleted'); + $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'locked'); + + // Launch add field deleted + $result = $result && add_field($table, $field); + } + return $result; } diff --git a/lib/grade/grade_category.php b/lib/grade/grade_category.php index 431767812d..33c1e158a2 100644 --- a/lib/grade/grade_category.php +++ b/lib/grade/grade_category.php @@ -99,12 +99,6 @@ class grade_category extends grade_object { */ var $droplow; - /** - * Date until which to hide this category. If null, 0 or false, category is not hidden. - * @var int $hidden - */ - var $hidden; - /** * Array of grade_items or grade_categories nested exactly 1 level below this category * @var array $children diff --git a/lib/grade/grade_grades_final.php b/lib/grade/grade_grades_final.php index 7547b1c335..be25dc4ece 100644 --- a/lib/grade/grade_grades_final.php +++ b/lib/grade/grade_grades_final.php @@ -63,13 +63,13 @@ class grade_grades_final extends grade_object { var $gradevalue; /** - * Date until which to hide this grade_item. If null, 0 or false, grade_item is not hidden. Hiding prevents viewing. + * Date until which to hide this grade_final. If null, 0 or false, grade_item is not hidden. Hiding prevents viewing. * @var int $hidden */ var $hidden; /** - * Date until which to lock this grade_item. If null, 0 or false, grade_item is not locked. Locking prevents updating. + * Date until which to lock this grade_final. If null, 0 or false, grade_item is not locked. Locking prevents updating. * @var int $locked */ var $locked = false; diff --git a/lib/grade/grade_item.php b/lib/grade/grade_item.php index 8b66d4e2b8..048f191dd9 100644 --- a/lib/grade/grade_item.php +++ b/lib/grade/grade_item.php @@ -186,6 +186,12 @@ class grade_item extends grade_object { */ var $locked = false; + /** + * Whether or not the module instance referred to by this grade_item has been deleted. + * @var int $deleted + */ + var $deleted; + /** * If set, the whole column will be recalculated, then this flag will be switched off. * @var boolean $needsupdate diff --git a/pix/i/lock.gif b/pix/i/lock.gif new file mode 100755 index 0000000000..6ad27be01f Binary files /dev/null and b/pix/i/lock.gif differ diff --git a/pix/i/unlock.gif b/pix/i/unlock.gif new file mode 100755 index 0000000000..16d90a5a64 Binary files /dev/null and b/pix/i/unlock.gif differ diff --git a/version.php b/version.php index 7658f294ef..12d276dd1e 100644 --- a/version.php +++ b/version.php @@ -6,7 +6,7 @@ // This is compared against the values stored in the database to determine // whether upgrades should be performed (see lib/db/*.php) - $version = 2007052800; // YYYYMMDD = date + $version = 2007060100; // YYYYMMDD = date // XY = increments within a single day $release = '1.9 dev'; // Human-friendly version name