Merge branch 'MOODLE_25_STABLE' into install_25_STABLE

This commit is contained in:
AMOS bot
2014-04-23 00:38:14 +00:00
26 changed files with 230 additions and 60 deletions
+2
View File
@@ -4,7 +4,9 @@
require('../../config.php');
$context = context_system::instance();
$PAGE->set_url('/auth/shibboleth/index.php');
$PAGE->set_context($context);
// Support for WAYFless URLs.
$target = optional_param('target', '', PARAM_LOCALURL);
+4 -4
View File
@@ -203,11 +203,11 @@ class core_backup_renderer extends plugin_renderer_base {
*/
public function backup_details_unknown(moodle_url $nextstageurl) {
$html = html_writer::start_tag('div', array('class' => 'unknownformat'));
$html .= $this->output->heading(get_string('errorinvalidformat', 'backup'), 2, 'notifyproblem');
$html .= html_writer::tag('div', get_string('errorinvalidformatinfo', 'backup'), array('class' => 'notifyproblem'));
$html = html_writer::start_div('unknownformat');
$html .= $this->output->heading(get_string('errorinvalidformat', 'backup'), 2);
$html .= $this->output->notification(get_string('errorinvalidformatinfo', 'backup'), 'notifyproblem');
$html .= $this->output->single_button($nextstageurl, get_string('continue'), 'post');
$html .= html_writer::end_tag('div');
$html .= html_writer::end_div();
return $html;
}
+1 -1
View File
@@ -82,7 +82,7 @@ function import_xml_grades($text, $course, &$error) {
$newgrade->importer = $USER->id;
// check grade value exists and is a numeric grade
if (isset($result['#']['score'][0]['#'])) {
if (isset($result['#']['score'][0]['#']) && $result['#']['score'][0]['#'] !== '-') {
if (is_numeric($result['#']['score'][0]['#'])) {
$newgrade->finalgrade = $result['#']['score'][0]['#'];
} else {
+3 -3
View File
@@ -64,15 +64,15 @@ $string['awards'] = 'Recipients';
$string['backpackavailability'] = 'External badge verification';
$string['backpackavailability_help'] = 'For badge recipients to be able to prove they earned their badges from you, an external backpack service should be able to access your site and verify badges issued from it. Your site does not currently appear to be accessible, which means that badges you have already issued or will issue in the future cannot be verified.
##Why am I seeing this message?
**Why am I seeing this message?**
It may be that your firewall prevents access from users outside your network, your site is password protected, or you are running the site on a computer that is not available from the Internet (such as a local development machine).
##Is this a problem?
**Is this a problem?**
You should fix this issue on any production site where you are planning to issue badges, otherwise the recipients will not be able to prove they earned their badges from you. If your site is not yet live you can create and issue test badges, as long as the site is accessible before you go live.
##What if I can\'t make my whole site publicly accessible?
**What if I can\'t make my whole site publicly accessible?**
The only URL required for verification is [your-site-url]/badges/assertion.php so if you are able to modify your firewall to allow external access to that file, badge verification will still work.';
$string['backpackbadges'] = 'You have {$a->totalbadges} badge(s) displayed from {$a->totalcollections} collection(s). <a href="mybackpack.php">Change backpack settings</a>.';
+2
View File
@@ -34,6 +34,8 @@
- AlfrescoWebService::__soapCall() arguments do not match SoapClient::__soapCall()
- AlfrescoWebService::__doRequest() arguments do not match SoapClient::__soapCall()
6. Apply the changes from MDL-41975 in regard with the timestamp
== Alfresco PHP Library ==
Installation and developer documentation for the Alfresco PHP Library can be found on the Alfresco Wiki.
@@ -79,8 +79,8 @@ class AlfrescoWebService extends SoapClient
// Construct Timestamp Header
$timeStamp = $dom->createElementNS($this->wsUtilityNS, "Timestamp");
$createdDate = date("Y-m-d\TH:i:s\Z", mktime(date("H")+24, date("i"), date("s"), date("m"), date("d"), date("Y")));
$expiresDate = date("Y-m-d\TH:i:s\Z", mktime(date("H")+25, date("i"), date("s"), date("m"), date("d"), date("Y")));
$createdDate = gmdate("Y-m-d\TH:i:s\Z", gmmktime(gmdate("H"), gmdate("i"), gmdate("s"), gmdate("m"), gmdate("d"), gmdate("Y")));
$expiresDate = gmdate("Y-m-d\TH:i:s\Z", gmmktime(gmdate("H")+1, gmdate("i"), gmdate("s"), gmdate("m"), gmdate("d"), gmdate("Y")));
$created = new DOMElement("Created", $createdDate, $this->wsUtilityNS);
$expires = new DOMElement("Expires", $expiresDate, $this->wsUtilityNS);
$timeStamp->appendChild($created);
+6 -1
View File
@@ -478,6 +478,7 @@ class block_manager {
throw new coding_exception('block_manager has already prepared the blocks in region ' .
$region . 'for output. It is too late to add a fake block.');
}
$bc->attributes['class'] .= ' block_fake';
$this->extracontent[$region][] = $bc;
}
@@ -515,7 +516,11 @@ class block_manager {
$this->check_is_loaded();
$this->ensure_content_created($region, $output);
foreach($this->visibleblockcontent[$region] as $instance) {
if (!$this->region_has_content($region, $output)) {
// If the region has no content then nothing is docked at all of course.
return false;
}
foreach ($this->visibleblockcontent[$region] as $instance) {
if (!empty($instance->content) && !get_user_preferences('docked_block_instance_'.$instance->blockinstanceid, 0)) {
return false;
}
+1
View File
@@ -1603,6 +1603,7 @@ function &get_mimetypes_array() {
'webm' => array ('type'=>'video/webm', 'icon'=>'video', 'groups'=>array('video'), 'string'=>'video'),
'wmv' => array ('type'=>'video/x-ms-wmv', 'icon'=>'wmv', 'groups'=>array('video'), 'string'=>'video'),
'asf' => array ('type'=>'video/x-ms-asf', 'icon'=>'wmv', 'groups'=>array('video'), 'string'=>'video'),
'wma' => array ('type'=>'audio/x-ms-wma', 'icon'=>'audio', 'groups'=>array('audio'), 'string'=>'audio'),
'xbk' => array ('type'=>'application/x-smarttech-notebook', 'icon'=>'archive'),
'xdp' => array ('type'=>'application/pdf', 'icon'=>'pdf'),
+4 -1
View File
@@ -355,7 +355,10 @@ M.form_dndupload.init = function(Y, options) {
* @return boolean true if event has files
*/
has_files: function(e) {
var types = e._event.dataTransfer.types;
// In some browsers, dataTransfer.types may be null for a
// 'dragover' event, so ensure a valid Array is always
// inspected.
var types = e._event.dataTransfer.types || [];
for (var i=0; i<types.length; i++) {
if (types[i] == 'Files') {
return true;
+2 -2
View File
@@ -2810,7 +2810,7 @@ function debugging($message = '', $level = DEBUG_NORMAL, $backtrace = null) {
if (!$backtrace) {
$backtrace = debug_backtrace();
}
$from = format_backtrace($backtrace, CLI_SCRIPT);
$from = format_backtrace($backtrace, CLI_SCRIPT || NO_DEBUG_DISPLAY);
if (PHPUNIT_TEST) {
if (phpunit_util::debugging_triggered($message, $level, $from)) {
// We are inside test, the debug message was logged.
@@ -2821,7 +2821,7 @@ function debugging($message = '', $level = DEBUG_NORMAL, $backtrace = null) {
if (NO_DEBUG_DISPLAY) {
// script does not want any errors or debugging in output,
// we send the info to error log instead
error_log('Debugging: ' . $message . $from);
error_log('Debugging: ' . $message . ' in '. PHP_EOL . $from);
} else if ($forcedebug or $CFG->debugdisplay) {
if (!defined('DEBUGGING_PRINTED')) {
@@ -359,7 +359,7 @@ M.core.blockdraganddrop.is_using_blocks_render_method = function() {
var goodregions = Y.all('.block-region[data-blockregion]').size();
var allregions = Y.all('.block-region').size();
this._isusingnewblocksmethod = (allregions === goodregions);
if (goodregions > 0 && allregions > 0) {
if (goodregions > 0 && allregions > 0 && goodregions !== allregions) {
Y.log('Both core_renderer::blocks and core_renderer::blocks_for_region have been used.', 'warn', 'moodle-core_blocks');
}
}
@@ -451,7 +451,6 @@ MANAGER.prototype = {
i = 0,
region,
regionname,
droptarget,
dragdelegation;
// Evil required by M.core.dragdrop.
@@ -480,7 +479,7 @@ MANAGER.prototype = {
// Setting blockregion as droptarget (the case when it is empty)
// The region-post (the right one)
// is very narrow, so add extra padding on the left to drop block on it.
droptarget = new Y.DD.Drop({
new Y.DD.Drop({
node: region.get_droptarget(),
groups: this.groups,
padding: '40 240 40 240'
@@ -492,7 +491,7 @@ MANAGER.prototype = {
nodes: '.'+CSS.BLOCK,
target: true,
handles: ['.'+CSS.HEADER],
invalid: '.block-hider-hide, .block-hider-show, .moveto',
invalid: '.block-hider-hide, .block-hider-show, .moveto, .block_fake',
dragConfig: {groups: this.groups}
});
dragdelegation.dd.plug(Y.Plugin.DDProxy, {
@@ -500,9 +499,10 @@ MANAGER.prototype = {
moveOnEnd: false
});
dragdelegation.dd.plug(Y.Plugin.DDWinScroll);
// On the mouse down event we will enable all block regions so that they can be dragged to.
// This is VERY important as without it dnd won't work for empty block regions.
dragdelegation.on('drag:mouseDown', this.enable_all_regions, this);
// On the DD Manager start operation, we enable all block regions so that they can be drop targets. This
// must be done *before* drag:start but after dragging has been initialised.
Y.DD.DDM.on('ddm:start', this.enable_all_regions, this);
region.remove_block_move_icons();
}
@@ -544,12 +544,25 @@ MANAGER.prototype = {
/**
* Enables all fo the regions so that they are all visible while dragging is occuring.
*
* @method enable_all_regions
* @returns {undefined}
*/
enable_all_regions : function() {
var i = 0;
var groups = Y.DD.DDM.activeDrag.get('groups');
// As we're called by Y.DD.DDM, we can't be certain that the call
// relates specifically to a block drag/drop operation. Test
// whether the relevant group applies here.
if (!groups || Y.Array.indexOf(groups, 'block') === -1) {
return;
}
var i;
for (i in this.regionobjects) {
if (!this.regionobjects.hasOwnProperty(i)) {
continue;
}
this.regionobjects[i].enable();
}
},
@@ -783,7 +796,8 @@ Y.extend(MANAGER, M.core.dragdrop, MANAGER.prototype, {
value : []
}
}
});/**
});
/**
* This file contains the Block Region class used by the drag and drop manager.
*
* Provides drag and drop functionality for blocks.
File diff suppressed because one or more lines are too long
+23 -9
View File
@@ -359,7 +359,7 @@ M.core.blockdraganddrop.is_using_blocks_render_method = function() {
var goodregions = Y.all('.block-region[data-blockregion]').size();
var allregions = Y.all('.block-region').size();
this._isusingnewblocksmethod = (allregions === goodregions);
if (goodregions > 0 && allregions > 0) {
if (goodregions > 0 && allregions > 0 && goodregions !== allregions) {
}
}
return this._isusingnewblocksmethod;
@@ -447,7 +447,6 @@ MANAGER.prototype = {
i = 0,
region,
regionname,
droptarget,
dragdelegation;
// Evil required by M.core.dragdrop.
@@ -476,7 +475,7 @@ MANAGER.prototype = {
// Setting blockregion as droptarget (the case when it is empty)
// The region-post (the right one)
// is very narrow, so add extra padding on the left to drop block on it.
droptarget = new Y.DD.Drop({
new Y.DD.Drop({
node: region.get_droptarget(),
groups: this.groups,
padding: '40 240 40 240'
@@ -488,7 +487,7 @@ MANAGER.prototype = {
nodes: '.'+CSS.BLOCK,
target: true,
handles: ['.'+CSS.HEADER],
invalid: '.block-hider-hide, .block-hider-show, .moveto',
invalid: '.block-hider-hide, .block-hider-show, .moveto, .block_fake',
dragConfig: {groups: this.groups}
});
dragdelegation.dd.plug(Y.Plugin.DDProxy, {
@@ -496,9 +495,10 @@ MANAGER.prototype = {
moveOnEnd: false
});
dragdelegation.dd.plug(Y.Plugin.DDWinScroll);
// On the mouse down event we will enable all block regions so that they can be dragged to.
// This is VERY important as without it dnd won't work for empty block regions.
dragdelegation.on('drag:mouseDown', this.enable_all_regions, this);
// On the DD Manager start operation, we enable all block regions so that they can be drop targets. This
// must be done *before* drag:start but after dragging has been initialised.
Y.DD.DDM.on('ddm:start', this.enable_all_regions, this);
region.remove_block_move_icons();
}
@@ -539,12 +539,25 @@ MANAGER.prototype = {
/**
* Enables all fo the regions so that they are all visible while dragging is occuring.
*
* @method enable_all_regions
* @returns {undefined}
*/
enable_all_regions : function() {
var i = 0;
var groups = Y.DD.DDM.activeDrag.get('groups');
// As we're called by Y.DD.DDM, we can't be certain that the call
// relates specifically to a block drag/drop operation. Test
// whether the relevant group applies here.
if (!groups || Y.Array.indexOf(groups, 'block') === -1) {
return;
}
var i;
for (i in this.regionobjects) {
if (!this.regionobjects.hasOwnProperty(i)) {
continue;
}
this.regionobjects[i].enable();
}
},
@@ -778,7 +791,8 @@ Y.extend(MANAGER, M.core.dragdrop, MANAGER.prototype, {
value : []
}
}
});/**
});
/**
* This file contains the Block Region class used by the drag and drop manager.
*
* Provides drag and drop functionality for blocks.
+1 -1
View File
@@ -357,7 +357,7 @@ M.core.blockdraganddrop.is_using_blocks_render_method = function() {
var goodregions = Y.all('.block-region[data-blockregion]').size();
var allregions = Y.all('.block-region').size();
this._isusingnewblocksmethod = (allregions === goodregions);
if (goodregions > 0 && allregions > 0) {
if (goodregions > 0 && allregions > 0 && goodregions !== allregions) {
Y.log('Both core_renderer::blocks and core_renderer::blocks_for_region have been used.', 'warn', 'moodle-core_blocks');
}
}
+21 -8
View File
@@ -58,7 +58,6 @@ MANAGER.prototype = {
i = 0,
region,
regionname,
droptarget,
dragdelegation;
// Evil required by M.core.dragdrop.
@@ -87,7 +86,7 @@ MANAGER.prototype = {
// Setting blockregion as droptarget (the case when it is empty)
// The region-post (the right one)
// is very narrow, so add extra padding on the left to drop block on it.
droptarget = new Y.DD.Drop({
new Y.DD.Drop({
node: region.get_droptarget(),
groups: this.groups,
padding: '40 240 40 240'
@@ -99,7 +98,7 @@ MANAGER.prototype = {
nodes: '.'+CSS.BLOCK,
target: true,
handles: ['.'+CSS.HEADER],
invalid: '.block-hider-hide, .block-hider-show, .moveto',
invalid: '.block-hider-hide, .block-hider-show, .moveto, .block_fake',
dragConfig: {groups: this.groups}
});
dragdelegation.dd.plug(Y.Plugin.DDProxy, {
@@ -107,9 +106,10 @@ MANAGER.prototype = {
moveOnEnd: false
});
dragdelegation.dd.plug(Y.Plugin.DDWinScroll);
// On the mouse down event we will enable all block regions so that they can be dragged to.
// This is VERY important as without it dnd won't work for empty block regions.
dragdelegation.on('drag:mouseDown', this.enable_all_regions, this);
// On the DD Manager start operation, we enable all block regions so that they can be drop targets. This
// must be done *before* drag:start but after dragging has been initialised.
Y.DD.DDM.on('ddm:start', this.enable_all_regions, this);
region.remove_block_move_icons();
}
@@ -151,12 +151,25 @@ MANAGER.prototype = {
/**
* Enables all fo the regions so that they are all visible while dragging is occuring.
*
* @method enable_all_regions
* @returns {undefined}
*/
enable_all_regions : function() {
var i = 0;
var groups = Y.DD.DDM.activeDrag.get('groups');
// As we're called by Y.DD.DDM, we can't be certain that the call
// relates specifically to a block drag/drop operation. Test
// whether the relevant group applies here.
if (!groups || Y.Array.indexOf(groups, 'block') === -1) {
return;
}
var i;
for (i in this.regionobjects) {
if (!this.regionobjects.hasOwnProperty(i)) {
continue;
}
this.regionobjects[i].enable();
}
},
@@ -390,4 +403,4 @@ Y.extend(MANAGER, M.core.dragdrop, MANAGER.prototype, {
value : []
}
}
});
});
+2 -2
View File
@@ -325,7 +325,7 @@ function chat_print_recent_activity($course, $viewfullnames, $timestart) {
$strftimerecent = get_string('strftimerecent');
if ($past) {
echo $OUTPUT->heading(get_string("pastchats", 'chat').':');
echo $OUTPUT->heading(get_string("pastchats", 'chat').':', 3);
foreach ($past as $cm) {
$link = $CFG->wwwroot.'/mod/chat/view.php?id='.$cm->id;
@@ -336,7 +336,7 @@ function chat_print_recent_activity($course, $viewfullnames, $timestart) {
}
if ($current) {
echo $OUTPUT->heading(get_string("currentchats", 'chat').':');
echo $OUTPUT->heading(get_string("currentchats", 'chat').':', 3);
$oldest = floor((time()-$CFG->chat_old_ping)/10)*10; // better db caching
+70
View File
@@ -0,0 +1,70 @@
@mod @mod_wiki
Feature: Edited wiki pages handle tags correctly
In order to get wiki pages properly labelled
As a user
I need to introduce the tags while editing
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
| student1 | Student | 1 | student1@asd.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add a "Wiki" to section "1" and I fill the form with:
| Wiki name | Test wiki name |
| Description | Test wiki description |
| First page name | First page |
| Wiki mode | Collaborative wiki |
And I log out
Scenario: Wiki page edition of custom tags works as expected
Given I log in as "student1"
And I follow "Course 1"
And I follow "Test wiki name"
And I press "Create page"
When I set the following fields to these values:
| HTML format | Student page contents to be tagged |
| Other tags (enter tags separated by commas) | Example, Page, Cool |
And I press "Save"
Then I should see "Example" in the ".wiki-tags" "css_element"
And I should see "Page" in the ".wiki-tags" "css_element"
And I should see "Cool" in the ".wiki-tags" "css_element"
And I follow "Edit"
And the field "Other tags (enter tags separated by commas)" matches value "Example, Page, Cool"
And I press "Cancel"
Scenario: Wiki page edition of official tags works as expected
Given I log in as "admin"
And I expand "Site administration" node
And I expand "Appearance" node
And I follow "Manage tags"
And I set the field "otagsadd" to "OT1, OT2, OT3"
And I press "Add official tags"
And I log out
And I log in as "student1"
And I follow "Course 1"
And I follow "Test wiki name"
And I press "Create page"
And the "tags[officialtags][]" select box should contain "OT1"
And the "tags[officialtags][]" select box should contain "OT2"
And the "tags[officialtags][]" select box should contain "OT3"
When I set the following fields to these values:
| HTML format | Student page contents to be tagged |
| tags[officialtags][] | OT1, OT3 |
And I press "Save"
Then I should see "OT1" in the ".wiki-tags" "css_element"
And I should see "OT3" in the ".wiki-tags" "css_element"
And I should not see "OT2" in the ".wiki-tags" "css_element"
And I follow "Edit"
And the field "tags[officialtags][]" matches value "OT1, OT3"
And the field "tags[officialtags][]" does not match value "OT2"
And I press "Cancel"
@@ -0,0 +1,42 @@
@core @core_my
Feature: Restrict which blocks can be added to My home
In order to restrict which blocks can be added
As a student I need to ensure I can add the blocks
As an admin I need to remove the capability to add a blocks
As a student I need to ensure I can't add the blocks any more
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@asd.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
Scenario: The comments block can be added to My home by default
And I log in as "student1"
And I follow "My home"
And I press "Customise this page"
Then the "Add a block" select box should contain "Comments"
And the "Add a block" select box should contain "Courses"
And the "Add a block" select box should contain "HTML"
And the "Add a block" select box should contain "Tags"
@javascript
Scenario: Remove the ability to add the comments block to My home
When I log in as "admin"
And I set the following system permissions of "Authenticated user" role:
| block/comments:myaddinstance | Prohibit |
| block/course_list:myaddinstance | Prohibit |
| block/html:myaddinstance | Prohibit |
And I log out
And I log in as "student1"
And I follow "My home"
And I press "Customise this page"
Then the "Add a block" select box should not contain "Comments"
And the "Add a block" select box should not contain "Courses"
And the "Add a block" select box should not contain "HTML"
And the "Add a block" select box should contain "Tags"
+3
View File
@@ -6,3 +6,6 @@
#page-report-completion-index .export-actions {
text-align: center;
}
#page-report-completion-index.dir-rtl #completion-progress th svg {
direction: ltr;
}
+1
View File
@@ -5,3 +5,4 @@
#page-report-progress-index .completion_prev {display:inline;margin-right:2em;}
#page-report-progress-index .completion_pagingbar p {display:inline;margin:0;}
#page-report-progress-index .completion_next {display:inline;margin-left:2em;}
#page-report-progress-index.dir-rtl #completion-progress th svg {direction:ltr;}
@@ -24,7 +24,7 @@
*/
$string['alfresco_url'] = 'Alfresco URL';
$string['alfrescourltext'] = 'Afresco API url should be: http://yoursite.com/alfresco/api';
$string['alfrescourltext'] = 'Afresco API URL should be: http://yoursite.com/alfresco/api or http://yoursite.com/alfresco/soapapi for Alfresco 4.2.d or greater.';
$string['alfresco:view'] = 'View alfresco repository';
$string['configplugin'] = 'Alfresco configuration';
$string['notitle'] = 'notitle';
+1 -1
View File
@@ -46,7 +46,7 @@ class user_filter_courserole extends user_filter_type {
$objs[] =& $mform->createElement('select', $this->_name .'_ct', null, $this->get_course_categories());
$objs[] =& $mform->createElement('text', $this->_name, null);
$grp =& $mform->addElement('group', $this->_name.'_grp', $this->_label, $objs, '', false);
$mform->setType($this->_name, PARAM_ALPHANUMEXT);
$mform->setType($this->_name, PARAM_TEXT);
if ($this->_advanced) {
$mform->setAdvanced($this->_name.'_grp');
}
+2 -2
View File
@@ -418,7 +418,7 @@ function profile_list_categories() {
function profile_edit_category($id, $redirect) {
global $CFG, $DB, $OUTPUT;
require_once('index_category_form.php');
require_once($CFG->dirroot.'/user/profile/index_category_form.php');
$categoryform = new category_form();
if ($category = $DB->get_record('user_info_category', array('id'=>$id))) {
@@ -474,7 +474,7 @@ function profile_edit_field($id, $datatype, $redirect) {
$field->description = clean_text($field->description, $field->descriptionformat);
$field->description = array('text'=>$field->description, 'format'=>$field->descriptionformat, 'itemid'=>0);
require_once('index_field_form.php');
require_once($CFG->dirroot.'/user/profile/index_field_form.php');
$fieldform = new field_form(null, $field->datatype);
// Convert the data format for
+7 -7
View File
@@ -87,12 +87,11 @@ switch ($action) {
//normal form
}
/// Print the header
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('profilefields', 'admin'));
// Show all categories.
$categories = $DB->get_records('user_info_category', null, 'sortorder ASC');
/// Check that we have at least one category defined
if ($DB->count_records('user_info_category') == 0) {
// Check that we have at least one category defined.
if (empty($categories)) {
$defaultcategory = new stdClass();
$defaultcategory->name = $strdefaultcategory;
$defaultcategory->sortorder = 1;
@@ -100,8 +99,9 @@ if ($DB->count_records('user_info_category') == 0) {
redirect($redirect);
}
/// Show all categories
$categories = $DB->get_records('user_info_category', null, 'sortorder ASC');
// Print the header.
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('profilefields', 'admin'));
foreach ($categories as $category) {
$table = new html_table();
+2 -2
View File
@@ -37,13 +37,13 @@ class category_form extends moodleform {
$data = (object)$data;
$duplicate = $DB->record_exists('user_info_category', array('name'=>$data->name));
$duplicate = $DB->get_field('user_info_category', 'id', array('name' => $data->name));
/// Check the name is unique
if (!empty($data->id)) { // we are editing an existing record
$olddata = $DB->get_record('user_info_category', array('id'=>$data->id));
// name has changed, new name in use, new name in use by another record
$dupfound = (($olddata->name !== $data->name) && $duplicate && ($data->id != $duplicate->id));
$dupfound = (($olddata->name !== $data->name) && $duplicate && ($data->id != $duplicate));
}
else { // new profile category
$dupfound = $duplicate;
+2 -2
View File
@@ -29,11 +29,11 @@
defined('MOODLE_INTERNAL') || die();
$version = 2013051405.07; // 20130514 = branching date YYYYMMDD - do not modify!
$version = 2013051405.08; // 20130514 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches
// .XX = incremental changes
$release = '2.5.5+ (Build: 20140417)'; // Human-friendly version name
$release = '2.5.5+ (Build: 20140422)'; // Human-friendly version name
$branch = '25'; // this version's branch
$maturity = MATURITY_STABLE; // this version's maturity level