diff --git a/admin/tool/lp/classes/competency_framework.php b/admin/tool/lp/classes/competency_framework.php index 6f75504156f..11fbd1f2bf5 100644 --- a/admin/tool/lp/classes/competency_framework.php +++ b/admin/tool/lp/classes/competency_framework.php @@ -46,9 +46,6 @@ class competency_framework extends persistent { /** @var int $descriptionformat Format for the description */ private $descriptionformat = 0; - /** @var int $sortorder A number used to influence sorting */ - private $sortorder = 0; - /** @var bool $visible Used to show/hide this framework */ private $visible = true; @@ -141,24 +138,6 @@ class competency_framework extends persistent { $this->description = $description; } - /** - * Get the sort order index. - * - * @return string The sort order index - */ - public function get_sortorder() { - return $this->sortorder; - } - - /** - * Set the sort order index. - * - * @param string $sortorder The sort order index - */ - public function set_sortorder($sortorder) { - $this->sortorder = $sortorder; - } - /** * Get the visible flag. * @@ -253,9 +232,6 @@ class competency_framework extends persistent { if (isset($record->descriptionformat)) { $this->set_descriptionformat($record->descriptionformat); } - if (isset($record->sortorder)) { - $this->set_sortorder($record->sortorder); - } if (isset($record->scaleid)) { $this->set_scaleid($record->scaleid); } @@ -293,7 +269,6 @@ class competency_framework extends persistent { $record->description = $this->get_description(); $record->descriptionformat = $this->get_descriptionformat(); $record->descriptionformatted = format_text($this->get_description(), $this->get_descriptionformat()); - $record->sortorder = $this->get_sortorder(); $record->scaleid = $this->get_scaleid(); $record->scaleconfiguration = $this->get_scaleconfiguration(); $record->visible = $this->get_visible(); @@ -305,14 +280,4 @@ class competency_framework extends persistent { return $record; } - /** - * Add a default for the sortorder field to the default create logic. - * - * @return persistent - */ - public function create() { - $this->sortorder = $this->count_records(); - return parent::create(); - } - } diff --git a/admin/tool/lp/classes/external.php b/admin/tool/lp/classes/external.php index 49d5cc42082..5afc2708fcc 100644 --- a/admin/tool/lp/classes/external.php +++ b/admin/tool/lp/classes/external.php @@ -173,10 +173,6 @@ class external extends external_api { PARAM_BOOL, 'Is this framework visible?' ); - $sortorder = new external_value( - PARAM_INT, - 'Relative sort order of this framework' - ); $timecreated = new external_value( PARAM_INT, 'Timestamp this record was created' @@ -198,7 +194,6 @@ class external extends external_api { 'descriptionformat' => $descriptionformat, 'descriptionformatted' => $descriptionformatted, 'visible' => $visible, - 'sortorder' => $sortorder, 'timecreated' => $timecreated, 'timemodified' => $timemodified, 'usermodified' => $usermodified, diff --git a/admin/tool/lp/db/upgrade.php b/admin/tool/lp/db/upgrade.php index 86ba0cea8d9..414103bc223 100644 --- a/admin/tool/lp/db/upgrade.php +++ b/admin/tool/lp/db/upgrade.php @@ -81,5 +81,21 @@ function xmldb_tool_lp_upgrade($oldversion) { upgrade_plugin_savepoint(true, 2015052405, 'tool', 'lp'); } + if ($oldversion < 2015052406) { + + // Define field sortorder to be dropped from tool_lp_competency_framework. + $table = new xmldb_table('tool_lp_competency_framework'); + $field = new xmldb_field('sortorder'); + + // Conditionally launch drop field sortorder. + if ($dbman->field_exists($table, $field)) { + $dbman->drop_field($table, $field); + } + + // Lp savepoint reached. + upgrade_plugin_savepoint(true, 2015052406, 'tool', 'lp'); + } + + return true; } diff --git a/admin/tool/lp/templates/manage_competency_frameworks_page.mustache b/admin/tool/lp/templates/manage_competency_frameworks_page.mustache index 8000d92701b..9241343f3fc 100644 --- a/admin/tool/lp/templates/manage_competency_frameworks_page.mustache +++ b/admin/tool/lp/templates/manage_competency_frameworks_page.mustache @@ -29,7 +29,7 @@ * data-action = deletecompetencyframework Context variables required for this template: - * competencyframeworks - array of objects containing id, shortname, idnumber, sortorder, visible + * competencyframeworks - array of objects containing id, shortname, idnumber, visible * canmanage - true if this user has permission to manage the frameworks * navigation - array of strings containing buttons for navigation }} diff --git a/admin/tool/lp/version.php b/admin/tool/lp/version.php index 58fcccc070f..f2f85150a98 100644 --- a/admin/tool/lp/version.php +++ b/admin/tool/lp/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2015052405; // The current plugin version (Date: YYYYMMDDXX). +$plugin->version = 2015052406; // The current plugin version (Date: YYYYMMDDXX). $plugin->requires = 2014110400; // Requires this Moodle version. $plugin->component = 'tool_lp'; // Full name of the plugin (used for diagnostics).