Gitlab CSE Unil

Commit ff039f99 authored by M. Chardon's avatar M. Chardon
Browse files

résolution conlfit editpdf/editpdfplus

parent 4c31002f
......@@ -214,7 +214,7 @@ function xmldb_assignfeedback_editpdfplus_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2017081601, 'assignfeedback', 'editpdfplus');
}
if ($oldversion < 2018091100) {
if ($oldversion < 2018091203) {
$sql = "UPDATE {assignfeedback_editpp_typet}
SET id = 12
WHERE id = 11 and label = 'highlight'";
......@@ -275,7 +275,7 @@ function xmldb_assignfeedback_editpdfplus_upgrade($oldversion) {
$DB->execute($sql, []);
// Editpdfplus savepoint reached.
upgrade_plugin_savepoint(true, 2018091100, 'assignfeedback', 'editpdfplus');
upgrade_plugin_savepoint(true, 2018091203, 'assignfeedback', 'editpdfplus');
}
return true;
......
......@@ -413,6 +413,28 @@ class assign_feedback_editpdfplus extends assign_feedback_plugin {
}
public function is_enabled() {
$editpdf = null;
$editpdfenable = false;
$editpdfconfenable = false;
$listPlugins = $this->assignment->get_feedback_plugins();
foreach ($listPlugins as $plug) {
if ($plug->get_name() == get_string('pluginname', 'assignfeedback_editpdf')) {
$editpdf = $plug;
$editpdfenable = $plug->is_enabled();
$tmpconf = $plug->get_config();
if ($tmpconf && isset($tmpconf->enabled)) {
$editpdfconfenable = $plug->get_config()->enabled;
}
break;
}
}
if ($editpdf && $editpdfenable && $editpdfconfenable) {
return false;
}
$editpdfplusconf = $this->get_config();
if ($editpdfplusconf && isset($editpdfplusconf->enabled)) {
return $editpdfplusconf->enabled;
}
return $this->is_available();
}
......@@ -424,12 +446,7 @@ class assign_feedback_editpdfplus extends assign_feedback_plugin {
public function is_available() {
if ($this->enabledcache === null) {
$testpath = assignfeedback_editpdfplus\pdf::test_gs_path(false);
//if ($this->assignment->get_context()) {
// $this->enabledcache = ($testpath->status == assignfeedback_editpdfplus\pdf::GSPATH_OK) && has_capability('assignfeedback/editpdfplus:use', $this->assignment->get_context(), null, false);
//} else {
// $this->enabledcache = false;
//}
$this->enabledcache = $this->assignment->get_context() && ($testpath->status == assignfeedback_editpdfplus\pdf::GSPATH_OK) && has_capability('assignfeedback/editpdfplus:use', $this->assignment->get_context(), null, false);
$this->enabledcache = $testpath->status == assignfeedback_editpdfplus\pdf::GSPATH_OK/* && has_capability('assignfeedback/editpdfplus:use', $this->assignment->get_context(), null, false) */;
}
return $this->enabledcache;
}
......
......@@ -28,7 +28,7 @@ defined('MOODLE_INTERNAL') || die();
// Enabled by default.
$settings->add(new admin_setting_configcheckbox('assignfeedback_editpdfplus/default',
new lang_string('default', 'assignfeedback_editpdfplus'),
new lang_string('default_help', 'assignfeedback_editpdfplus'), 1));
new lang_string('default_help', 'assignfeedback_editpdfplus'), 0));
// Ghostscript setting.
$systempathslink = new moodle_url('/admin/settings.php', array('section' => 'systempaths'));
......
......@@ -25,10 +25,10 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2018091100;
$plugin->version = 2018091203;
$plugin->requires = 2018050800; // Requires this Moodle version.
$plugin->maturity = MATURITY_STABLE;
$plugin->release = "2.1 (Build: 2018091100)";
$plugin->release = "2.1 (Build: 2018091203)";
$plugin->dependencies = array(
'assignfeedback_editpdf' => 2018051400
);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment