Gitlab CSE Unil

Commit 03eb4896 authored by M. Chardon's avatar M. Chardon
Browse files

maj bug tooltypeid

bug basic tools
parent 5a42f8df
...@@ -54,6 +54,13 @@ function xmldb_assignfeedback_editpdfplus_install() { ...@@ -54,6 +54,13 @@ function xmldb_assignfeedback_editpdfplus_install() {
$tytool1->color = "#FFFF40"; $tytool1->color = "#FFFF40";
$tytool1->contextid = 1; $tytool1->contextid = 1;
$tytool1->label = "highlightplus"; $tytool1->label = "highlightplus";
$tytool1b = new assignfeedback_editpdfplus\bdd\type_tool();
$tytool1b->cartridge_color = null;
$tytool1b->cartridge_x = null;
$tytool1b->cartridge_y = null;
$tytool1b->color = "red";
$tytool1b->contextid = 1;
$tytool1b->label = "lineplus";
$tytool2 = new assignfeedback_editpdfplus\bdd\type_tool(); $tytool2 = new assignfeedback_editpdfplus\bdd\type_tool();
$tytool2->cartridge_color = null; $tytool2->cartridge_color = null;
$tytool2->cartridge_x = null; $tytool2->cartridge_x = null;
...@@ -124,7 +131,7 @@ function xmldb_assignfeedback_editpdfplus_install() { ...@@ -124,7 +131,7 @@ function xmldb_assignfeedback_editpdfplus_install() {
$tytool11->color = null; $tytool11->color = null;
$tytool11->contextid = 1; $tytool11->contextid = 1;
$tytool11->label = "highlight"; $tytool11->label = "highlight";
$tytools = array($tytool1, $tytool2, $tytool3, $tytool4, $tytool5, $tytool6, $tytool7, $tytool8, $tytool9, $tytool10, $tytool11); $tytools = array($tytool1,$tytool1b, $tytool2, $tytool3, $tytool4, $tytool5, $tytool6, $tytool7, $tytool8, $tytool9, $tytool10, $tytool11);
$DB->insert_records('assignfeedback_editpp_typet', $tytools); $DB->insert_records('assignfeedback_editpp_typet', $tytools);
//tools //tools
$tool1 = new assignfeedback_editpdfplus\bdd\tool(); $tool1 = new assignfeedback_editpdfplus\bdd\tool();
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
* The code is based on mod/assign/feedback/editpdf/db/upgrade.php by Jerome Mouneyrac. * The code is based on mod/assign/feedback/editpdf/db/upgrade.php by Jerome Mouneyrac.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
use assignfeedback_editpdfplus\bdd\type_tool; use assignfeedback_editpdfplus\bdd\type_tool;
...@@ -215,5 +214,69 @@ function xmldb_assignfeedback_editpdfplus_upgrade($oldversion) { ...@@ -215,5 +214,69 @@ function xmldb_assignfeedback_editpdfplus_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2017081601, 'assignfeedback', 'editpdfplus'); upgrade_plugin_savepoint(true, 2017081601, 'assignfeedback', 'editpdfplus');
} }
if ($oldversion < 2018091100) {
$sql = "UPDATE {assignfeedback_editpp_typet}
SET id = 12
WHERE id = 11 and label = 'highlight'";
$DB->execute($sql, []);
$sql = "UPDATE {assignfeedback_editpp_typet}
SET id = 11
WHERE id = 10 and label = 'oval'";
$DB->execute($sql, []);
$sql = "UPDATE {assignfeedback_editpp_typet}
SET id = 10
WHERE id = 9 and label = 'rectangle'";
$DB->execute($sql, []);
$sql = "UPDATE {assignfeedback_editpp_typet}
SET id = 9
WHERE id = 8 and label = 'line'";
$DB->execute($sql, []);
$sql = "UPDATE {assignfeedback_editpp_typet}
SET id = 8
WHERE id = 7 and label = 'pen'";
$DB->execute($sql, []);
$sql = "UPDATE {assignfeedback_editpp_typet}
SET id = 7
WHERE id = 6 and label = 'commentplus'";
$DB->execute($sql, []);
$sql = "UPDATE {assignfeedback_editpp_typet}
SET id = 6
WHERE id = 5 and label = 'stampcomment'";
$DB->execute($sql, []);
$sql = "UPDATE {assignfeedback_editpp_typet}
SET id = 5
WHERE id = 4 and label = 'verticalline'";
$DB->execute($sql, []);
$sql = "UPDATE {assignfeedback_editpp_typet}
SET id = 4
WHERE id = 3 and label = 'frame'";
$DB->execute($sql, []);
$sql = "UPDATE {assignfeedback_editpp_typet}
SET id = 3
WHERE id = 2 and label = 'stampplus'";
$DB->execute($sql, []);
$DB->get_manager()->reset_sequence('assignfeedback_editpp_typet');
$sql = "UPDATE {assignfeedback_editpp_tool}
SET type = 6
WHERE id > 13 and type = 5";
$DB->execute($sql, []);
$sql = "UPDATE {assignfeedback_editpp_tool}
SET type = 5
WHERE id > 13 and type = 4";
$DB->execute($sql, []);
$sql = "UPDATE {assignfeedback_editpp_tool}
SET type = 4
WHERE id > 13 and type = 3";
$DB->execute($sql, []);
$sql = "UPDATE {assignfeedback_editpp_tool}
SET type = 3
WHERE id > 14 and type = 2";
$DB->execute($sql, []);
// Editpdfplus savepoint reached.
upgrade_plugin_savepoint(true, 2018091100, 'assignfeedback', 'editpdfplus');
}
return true; return true;
} }
...@@ -25,10 +25,10 @@ ...@@ -25,10 +25,10 @@
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
$plugin->version = 2018072300; $plugin->version = 2018091100;
$plugin->requires = 2018050800; // Requires this Moodle version. $plugin->requires = 2018050800; // Requires this Moodle version.
$plugin->maturity = MATURITY_STABLE; $plugin->maturity = MATURITY_STABLE;
$plugin->release = "2.0 (Build: 2017100400)"; $plugin->release = "2.1 (Build: 2018091100)";
$plugin->dependencies = array( $plugin->dependencies = array(
'assignfeedback_editpdf' => 2018051400 'assignfeedback_editpdf' => 2018051400
); );
......
...@@ -550,7 +550,7 @@ M.assignfeedback_editpdfplus.drawable = DRAWABLE; ...@@ -550,7 +550,7 @@ M.assignfeedback_editpdfplus.drawable = DRAWABLE;
*/ */
/** /**
* Class representing a highlight. * Class representing an annotation.
* *
* @namespace M.assignfeedback_editpdfplus * @namespace M.assignfeedback_editpdfplus
* @class annotation * @class annotation
...@@ -1571,6 +1571,10 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1571,6 +1571,10 @@ Y.extend(ANNOTATION, Y.Base, {
if (this.tooltype.type <= TOOLTYPE.COMMENTPLUS && !this.parent_annot_element) { if (this.tooltype.type <= TOOLTYPE.COMMENTPLUS && !this.parent_annot_element) {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge); var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display"); var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
if (!divdisplay){
//for basic tools (pen, rectangle)
return;
}
var divedit = this.editor.get_dialogue_element('#' + this.divcartridge + "_edit"); var divedit = this.editor.get_dialogue_element('#' + this.divcartridge + "_edit");
var buttonplusr = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit_right"); var buttonplusr = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit_right");
var buttonplusl = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit_left"); var buttonplusl = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit_left");
......
...@@ -550,7 +550,7 @@ M.assignfeedback_editpdfplus.drawable = DRAWABLE; ...@@ -550,7 +550,7 @@ M.assignfeedback_editpdfplus.drawable = DRAWABLE;
*/ */
/** /**
* Class representing a highlight. * Class representing an annotation.
* *
* @namespace M.assignfeedback_editpdfplus * @namespace M.assignfeedback_editpdfplus
* @class annotation * @class annotation
...@@ -1571,6 +1571,10 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1571,6 +1571,10 @@ Y.extend(ANNOTATION, Y.Base, {
if (this.tooltype.type <= TOOLTYPE.COMMENTPLUS && !this.parent_annot_element) { if (this.tooltype.type <= TOOLTYPE.COMMENTPLUS && !this.parent_annot_element) {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge); var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display"); var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
if (!divdisplay){
//for basic tools (pen, rectangle)
return;
}
var divedit = this.editor.get_dialogue_element('#' + this.divcartridge + "_edit"); var divedit = this.editor.get_dialogue_element('#' + this.divcartridge + "_edit");
var buttonplusr = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit_right"); var buttonplusr = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit_right");
var buttonplusl = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit_left"); var buttonplusl = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit_left");
......
...@@ -1042,6 +1042,10 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1042,6 +1042,10 @@ Y.extend(ANNOTATION, Y.Base, {
if (this.tooltype.type <= TOOLTYPE.COMMENTPLUS && !this.parent_annot_element) { if (this.tooltype.type <= TOOLTYPE.COMMENTPLUS && !this.parent_annot_element) {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge); var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display"); var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
if (!divdisplay){
//for basic tools (pen, rectangle,...)
return;
}
var divedit = this.editor.get_dialogue_element('#' + this.divcartridge + "_edit"); var divedit = this.editor.get_dialogue_element('#' + this.divcartridge + "_edit");
var buttonplusr = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit_right"); var buttonplusr = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit_right");
var buttonplusl = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit_left"); var buttonplusl = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit_left");
......
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