From ec4560cc58701de4368669c6e6aaab7d750e5378 Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Fri, 1 Jun 2007 04:46:24 +0000 Subject: [PATCH] MDL-9137 Removed hidden field from grade_categories and added deleted field to grade_items. Also added 2 images in pix/i --- lib/db/install.xml | 12 ++++++------ lib/db/upgrade.php | 23 +++++++++++++++++++++++ lib/grade/grade_category.php | 6 ------ lib/grade/grade_grades_final.php | 4 ++-- lib/grade/grade_item.php | 6 ++++++ pix/i/lock.gif | Bin 0 -> 323 bytes pix/i/unlock.gif | Bin 0 -> 301 bytes version.php | 2 +- 8 files changed, 38 insertions(+), 15 deletions(-) create mode 100755 pix/i/lock.gif create mode 100755 pix/i/unlock.gif 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 0000000000000000000000000000000000000000..6ad27be01fe396df5de015f15dd5c1af0ae88d82 GIT binary patch literal 323 zcmZ?wbhEHb6krfwSSru({rmgJH&|v(WPJJj?Bp)S|Np$UZ`*O{7~{4L;cp%=<)re= zovNgzu6_PQ^7U)i%ZkgqJbcfe?%ug2XZ|#SR}amjf(54Zd(N69+}px<`^L&6`-?jo zxML$!?5rIp_V@g!Jy857>RgnXSdyBeP@Y+mp%9Xhs^ISF8^ECWlZBCsL5@L(0SG{z zWngo6=r4E?s3CFW$%hjbTAhB0Uo7X^Ej*EZiOaOA_vYK>4tnhi=Q}toRgnXSdyBeP@Y+mp%9Xhs^ISF8^ECWlZBCsL5@L(g@KWQ zlYy6kfz8mNKVV@3N589^V5W@O^m7?gJeF$Nx32jn#i6mQ@%6(42|YXG+`?-V=84K1 M?C@D{+{9oF0DRE30ssI2 literal 0 HcmV?d00001 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 -- 2.39.5