Permalink
Browse files

merge

  • Loading branch information...
2 parents d0eab62 + e16e230 commit 87d46d187e34d701d3884aac7445dad555bc9596 @doraemonyoung doraemonyoung committed May 7, 2012
Showing 645 changed files with 23,419 additions and 2,520 deletions.
View
@@ -25,4 +25,4 @@ CVS
/.project
/.buildpath
/.cache
-/phpunit.xml
+phpunit.xml
@@ -577,6 +577,11 @@
</DATABASE>
<PHP version="5.3.2" level="required">
</PHP>
+ <PCREUNICODE level="optional">
+ <FEEDBACK>
+ <ON_CHECK message="pcreunicodewarning" />
+ </FEEDBACK>
+ </PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
@@ -670,5 +675,5 @@
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
- </MOODLE>
+</MOODLE>
</COMPATIBILITY_MATRIX>
View
@@ -34,6 +34,10 @@
// Get the submitted params
$disable = optional_param('disable', 0, PARAM_INT);
$enable = optional_param('enable', 0, PARAM_INT);
+$uninstall = optional_param('uninstall', 0, PARAM_INT);
+$confirm = optional_param('confirm', false, PARAM_BOOL);
+
+$headingtitle = get_string('managemessageoutputs', 'message');
if (!empty($disable) && confirm_sesskey()) {
if (!$processor = $DB->get_record('message_processors', array('id'=>$disable))) {
@@ -42,14 +46,37 @@
$DB->set_field('message_processors', 'enabled', '0', array('id'=>$processor->id)); // Disable output
}
-if (!empty($enable) && confirm_sesskey() ) {
+if (!empty($enable) && confirm_sesskey()) {
if (!$processor = $DB->get_record('message_processors', array('id'=>$enable))) {
print_error('outputdoesnotexist', 'message');
}
$DB->set_field('message_processors', 'enabled', '1', array('id'=>$processor->id)); // Enable output
}
-if ($disable || $enable) {
+if (!empty($uninstall) && confirm_sesskey()) {
+ echo $OUTPUT->header();
+ echo $OUTPUT->heading($headingtitle);
+
+ if (!$processor = $DB->get_record('message_processors', array('id'=>$uninstall))) {
+ print_error('outputdoesnotexist', 'message');
+ }
+
+ $processorname = get_string('pluginname', 'message_'.$processor->name);
+
+ if (!$confirm) {
+ echo $OUTPUT->confirm(get_string('processordeleteconfirm', 'message', $processorname), 'message.php?uninstall='.$processor->id.'&confirm=1', 'message.php');
+ echo $OUTPUT->footer();
+ exit;
+
+ } else {
+ message_processor_uninstall($processor->name);
+ $a->processor = $processorname;
+ $a->directory = $CFG->dirroot.'/message/output/'.$processor->name;
+ notice(get_string('processordeletefiles', 'message', $a), 'message.php');
+ }
+}
+
+if ($disable || $enable || $uninstall) {
$url = new moodle_url('message.php');
redirect($url);
}
@@ -65,6 +92,6 @@
// Display the page
echo $OUTPUT->header();
-echo $OUTPUT->heading(get_string('managemessageoutputs', 'message'));
+echo $OUTPUT->heading($headingtitle);
echo $messageoutputs;
echo $OUTPUT->footer();
@@ -100,7 +100,6 @@
$temp->add(new admin_setting_configcheckbox('navshowmycoursecategories', new lang_string('navshowmycoursecategories', 'admin'), new lang_string('navshowmycoursecategories_help', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('navshowallcourses', new lang_string('navshowallcourses', 'admin'), new lang_string('confignavshowallcourses', 'admin'), 0));
$temp->add(new admin_setting_configtext('navcourselimit',new lang_string('navcourselimit','admin'),new lang_string('confignavcourselimit', 'admin'),20,PARAM_INT));
- $temp->add(new admin_setting_configcheckbox('navlinkcoursesections', new lang_string('navlinkcoursesections', 'admin'), new lang_string('navlinkcoursesections_help', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('usesitenameforsitepages', new lang_string('usesitenameforsitepages', 'admin'), new lang_string('configusesitenameforsitepages', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('linkadmincategories', new lang_string('linkadmincategories', 'admin'), new lang_string('linkadmincategories_help', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('navshowfrontpagemods', new lang_string('navshowfrontpagemods', 'admin'), new lang_string('navshowfrontpagemods_help', 'admin'), 1));
@@ -161,6 +161,7 @@
400 => '400',
500 => '500');
$temp->add(new admin_setting_configselect('backup/backup_auto_keep', new lang_string('keep'), new lang_string('backupkeephelp'), 1, $keepoptoins));
+ $temp->add(new admin_setting_configcheckbox('backup/backup_shortname', new lang_string('backup_shortname', 'admin'), new lang_string('backup_shortnamehelp', 'admin'), 0));
// Automated defaults section.
$temp->add(new admin_setting_heading('automatedsettings', new lang_string('automatedsettings','backup'), ''));
@@ -0,0 +1,45 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Script to show all the assignments that have not been upgraded after the main upgrade.
+ *
+ * @package tool_assignmentupgrade
+ * @copyright 2012 NetSpot
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(dirname(__FILE__) . '/locallib.php');
+require_once(dirname(__FILE__) . '/upgradableassignmentstable.php');
+require_once(dirname(__FILE__) . '/upgradableassignmentsbatchform.php');
+require_once($CFG->libdir . '/adminlib.php');
+
+// admin_externalpage_setup calls require_login and checks moodle/site:config
+admin_externalpage_setup('assignmentupgrade', '', array(), tool_assignmentupgrade_url('batchupgrade'));
+$PAGE->navbar->add(get_string('batchupgrade', 'tool_assignmentupgrade'));
+
+$renderer = $PAGE->get_renderer('tool_assignmentupgrade');
+
+$confirm = required_param('confirm', PARAM_BOOL);
+if (!$confirm) {
+ print_error('invalidrequest');
+ die();
+}
+$result = tool_assignmentupgrade_upgrade_multiple_assignments(optional_param('upgradeall', 0, PARAM_BOOL),
+ explode(',', optional_param('selected', '', PARAM_TEXT)));
+
+echo $renderer->convert_multiple_assignments_result($result);
@@ -0,0 +1,50 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * This tool can upgrade old assignment activities to the new assignment activity type
+ *
+ * The upgrade can be done on any old assignment instance providing it is using one of the core
+ * assignment subtypes (online text, single upload, etc).
+ * The new assignment module was introduced in Moodle 2.3 and although it completely reproduces
+ * the features of the existing assignment type it wasn't designed to replace it entirely as there
+ * are many custom assignment types people use and it wouldn't be practical to try to convert them.
+ * Instead the existing assignment type will be left in core and people will be encouraged to
+ * use the new assignment type.
+ *
+ * This screen is the main entry-point to the plugin, it gives the admin a list
+ * of options available to them.
+ *
+ * @package tool_assignmentupgrade
+ * @copyright 2012 NetSpot
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(dirname(__FILE__) . '/locallib.php');
+require_once($CFG->libdir . '/adminlib.php');
+
+// admin_externalpage_setup calls require_login and checks moodle/site:config
+admin_externalpage_setup('assignmentupgrade');
+
+$renderer = $PAGE->get_renderer('tool_assignmentupgrade');
+
+$actions = array();
+
+$header = get_string('pluginname', 'tool_assignmentupgrade');
+$actions[] = tool_assignmentupgrade_action::make('listnotupgraded');
+
+echo $renderer->index_page($header, $actions);
@@ -0,0 +1,56 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Strings for the assignment upgrade tool
+ *
+ * @package tool_assignmentupgrade
+ * @copyright 2012 NetSpot
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+$string['areyousure'] = 'Are you sure?';
+$string['areyousuremessage'] = 'Are you sure you want to upgrade the assignment "{$a->name}"?';
+$string['assignmentid'] = 'Assignment ID';
+$string['assignmentnotfound'] = 'Assignment could not be found (id={$a})';
+$string['assignmenttype'] = 'Assignment type';
+$string['backtoindex'] = 'Back to index';
+$string['batchoperations'] = 'Batch operations';
+$string['batchupgrade'] = 'Upgrade multiple assignments';
+$string['confirmbatchupgrade'] = 'Confirm batch upgrade assignments';
+$string['conversioncomplete'] = 'Assignment converted';
+$string['conversionfailed'] = 'The assignment conversion was not successful. The log from the upgrade was: <br />{$a}';
+$string['listnotupgraded'] = 'List assignments that have not been upgraded';
+$string['listnotupgraded_desc'] = 'You can upgrade individual assignments from here';
+$string['noassignmentstoupgrade'] = 'There are no assignments that require upgrading';
+$string['notsupported'] = '';
+$string['notupgradedintro'] = 'This page lists the assignments created with an older version of Moodle that have not been upgraded to the new assignment module in Moodle 2.3. Not all assignments can be upgraded - if they were created with a custom assignment subtype, then that subtype will need to be upgraded to the new assignment plugin format in order to complete the upgrade.';
+$string['notupgradedtitle'] = 'Assignments not upgraded';
+$string['pluginname'] = 'Assignment upgrade helper';
+$string['select'] = 'Select';
+$string['submissions'] = 'Submissions';
+$string['supported'] = 'Upgrade';
+$string['unknown'] = 'Unknown';
+$string['upgradeassignmentsummary'] = 'Upgrade assignment: {$a->name} (Course: {$a->shortname})';
+$string['upgradeassignmentsuccess'] = 'Result: Upgrade successful';
+$string['upgradeassignmentfailed'] = 'Result: Upgrade failed. The log from the upgrade was: <br/><div class="tool_assignmentupgrade_upgradelog">{$a->log}</div>';
+$string['upgradable'] = 'Upgradable';
+$string['upgradeselected'] = 'Upgrade selected assignments';
+$string['upgradeselectedcount'] = 'Upgrade {$a} selected assignments?';
+$string['upgradeall'] = 'Upgrade all assignments';
+$string['upgradeallconfirm'] = 'Upgrade all assignments?';
+$string['upgradesingle'] = 'Upgrade single assignment';
+$string['viewcourse'] = 'View the course with the converted assignment';
@@ -0,0 +1,59 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Lib functions (cron) to automatically complete the assignment module upgrade if it was not done all at once during the main upgrade.
+ *
+ * @package tool_assignmentupgrade
+ * @copyright 2012 NetSpot
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die;
+
+/**
+ * Standard cron function
+ */
+function tool_assignmentupgrade_cron() {
+ $settings = get_config('tool_assignmentupgrade');
+ if (empty($settings->cronenabled)) {
+ return;
+ }
+
+ mtrace('assignmentupgrade: tool_assignmentupgrade_cron() started at '. date('H:i:s'));
+ try {
+ tool_assignmentupgrade_process($settings);
+ } catch (Exception $e) {
+ mtrace('assignmentupgrade: tool_assignmentupgrade_cron() failed with an exception:');
+ mtrace($e->getMessage());
+ }
+ mtrace('assignmentupgrade: tool_assignmentupgrade_cron() finished at ' . date('H:i:s'));
+}
+
+/**
+ * This function does the cron process within the time range according to settings.
+ * This is not implemented yet
+ * @param stdClass $settings - not used
+ */
+function tool_assignmentupgrade_process($settings) {
+ global $CFG;
+ require_once(dirname(__FILE__) . '/locallib.php');
+
+ mtrace('assignmentupgrade: processing ...');
+
+ mtrace('assignmentupgrade: Done.');
+ return;
+}
@@ -0,0 +1,48 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Script to show all the assignments that have not been upgraded after the main upgrade.
+ *
+ * @package tool_assignmentupgrade
+ * @copyright 2012 NetSpot
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(dirname(__FILE__) . '/locallib.php');
+require_once(dirname(__FILE__) . '/upgradableassignmentstable.php');
+require_once(dirname(__FILE__) . '/upgradableassignmentsbatchform.php');
+require_once($CFG->libdir . '/adminlib.php');
+
+// admin_externalpage_setup calls require_login and checks moodle/site:config
+admin_externalpage_setup('assignmentupgrade', '', array(), tool_assignmentupgrade_url('listnotupgraded'));
+$PAGE->navbar->add(get_string('listnotupgraded', 'tool_assignmentupgrade'));
+
+$renderer = $PAGE->get_renderer('tool_assignmentupgrade');
+
+$perpage = get_user_preferences('tool_assignmentupgrade_perpage', 5);
+$assignments = new tool_assignmentupgrade_assignments_table($perpage);
+
+$batchform = new tool_assignmentupgrade_batchoperations_form();
+$data = $batchform->get_data();
+if ($data && $data->selectedassignments != '' || $data && isset($data->upgradeall)) {
+ echo $renderer->confirm_batch_operation_page($data);
+} else {
+ echo $renderer->assignment_list_page($assignments, $batchform);
+}
+
+
Oops, something went wrong.

0 comments on commit 87d46d1

Please sign in to comment.