forked from Evarisk/DigiQuali
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Evarisk#1927 [QuestionGroup] add: question group object
- Loading branch information
1 parent
bf5ed14
commit 6160804
Showing
18 changed files
with
2,144 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?php | ||
//Silence is golden |
42 changes: 42 additions & 0 deletions
42
core/modules/digiquali/question_group/mod_question_group_standard.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
/* Copyright (C) 2022 EVARISK <[email protected]> | ||
* | ||
* This program 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. | ||
* | ||
* This program 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 this program. If not, see <https://www.gnu.org/licenses/>. | ||
* or see https://www.gnu.org/ | ||
*/ | ||
|
||
/** | ||
* \file core/modules/digiquali/question/mod_question_standard.php | ||
* \ingroup digiquali | ||
* \brief File of class to manage question numbering rules standard. | ||
*/ | ||
|
||
// Load Saturne libraries. | ||
require_once __DIR__ . '/../../../../../saturne/core/modules/saturne/modules_saturne.php'; | ||
|
||
/** | ||
* Class to manage question numbering rules standard. | ||
*/ | ||
class mod_question_group_standard extends ModeleNumRefSaturne | ||
{ | ||
/** | ||
* @var string Numbering module ref prefix. | ||
*/ | ||
public string $prefix = 'QG'; | ||
|
||
/** | ||
* @var string Name. | ||
*/ | ||
public string $name = 'Kari'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
|
||
/** | ||
* Initialise l'objet "questionGroup" ainsi que la méthode "init" obligatoire pour la bibliothèque EoxiaJS. | ||
* | ||
* @since 1.1.0 | ||
* @version 1.1.0 | ||
*/ | ||
window.digiquali.questionGroup = {}; | ||
|
||
/** | ||
* La méthode appelée automatiquement par la bibliothèque EoxiaJS. | ||
* | ||
* @since 1.1.0 | ||
* @version 1.1.0 | ||
* | ||
* @return {void} | ||
*/ | ||
window.digiquali.questionGroup.init = function() { | ||
window.digiquali.questionGroup.event(); | ||
}; | ||
|
||
/** | ||
* La méthode contenant tous les événements pour le questionGroup. | ||
* | ||
* @since 1.1.0 | ||
* @version 1.1.0 | ||
* | ||
* @return {void} | ||
*/ | ||
window.digiquali.questionGroup.event = function() { | ||
$( document ).on( 'click', '.clicked-photo-preview', window.digiquali.questionGroup.previewPhoto ); | ||
$( document ).on( 'click', '.ui-dialog-titlebar-close', window.digiquali.questionGroup.closePreviewPhoto ); | ||
$( document ).on( 'click', '#show_photo', window.digiquali.questionGroup.showPhoto ); | ||
$( document ).on( 'click', '.answer-picto .item, .wpeo-table .item', window.digiquali.questionGroup.selectAnswerPicto ); | ||
}; | ||
|
||
/** | ||
* Add border on preview photo. | ||
* | ||
* @since 1.1.0 | ||
* @version 1.1.0 | ||
* | ||
* @param {MouseEvent} event Les attributs lors du clic. | ||
* @return {void} | ||
*/ | ||
window.digiquali.questionGroup.previewPhoto = function ( event ) { | ||
if ($(this).hasClass('photo-ok')) { | ||
$("#dialogforpopup").attr('style', 'border: 10px solid #47e58e') | ||
} else if ($(this).hasClass('photo-ko')) { | ||
$("#dialogforpopup").attr('style', 'border: 10px solid #e05353') | ||
} | ||
}; | ||
|
||
/** | ||
* Close preview photo. | ||
* | ||
* @since 1.1.0 | ||
* @version 1.1.0 | ||
* | ||
* @param {MouseEvent} event Les attributs lors du clic. | ||
* @return {void} | ||
*/ | ||
window.digiquali.questionGroup.closePreviewPhoto = function ( event ) { | ||
$("#dialogforpopup").attr('style', 'border:') | ||
}; | ||
|
||
/** | ||
* Show photo for questionGroup. | ||
* | ||
* @since 1.3.0 | ||
* @version 1.3.0 | ||
* | ||
* @return {void} | ||
*/ | ||
window.digiquali.questionGroup.showPhoto = function() { | ||
let photo = $(this).closest('.questionGroup-table').find('.linked-medias') | ||
|
||
if (photo.hasClass('hidden')) { | ||
photo.attr('style', '') | ||
photo.removeClass('hidden') | ||
} else { | ||
photo.attr('style', 'display:none') | ||
photo.addClass('hidden') | ||
} | ||
}; | ||
|
||
/** | ||
* Lors du clic sur un picto de réponse, remplace le contenu du toggle et met l'image du picto sélectionné. | ||
* | ||
* @since 1.0.0 | ||
* @version 1.0.0 | ||
* | ||
* @param {MouseEvent} event [description] | ||
* @return {void} | ||
*/ | ||
window.digiquali.questionGroup.selectAnswerPicto = function( event ) { | ||
var element = $(this).closest('.wpeo-dropdown'); | ||
$(this).closest('.content').removeClass('active'); | ||
element.find('.dropdown-toggle span').hide(); | ||
element.find('.dropdown-toggle.button-picto').html($(this).closest('.wpeo-tooltip-event').html()); | ||
element.find('.input-hidden-picto').val($(this).data('label')); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/* Copyright (C) 2022-2023 EVARISK <[email protected]> | ||
* | ||
* This program 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. | ||
* | ||
* This program 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 this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/** | ||
* \file lib/digiquali_question_group.lib.php | ||
* \ingroup digiquali | ||
* \brief Library files with common functions for Question. | ||
*/ | ||
|
||
// Load Saturne libraries. | ||
require_once __DIR__ . '/../../saturne/lib/object.lib.php'; | ||
|
||
/** | ||
* Prepare array of tabs for question group. | ||
* | ||
* @param QuestionGroup $object QuestionGroup object. | ||
* @return array Array of tabs. | ||
* @throws Exception | ||
*/ | ||
function question_group_prepare_head(QuestionGroup $object): array | ||
{ | ||
return saturne_object_prepare_head($object); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?php | ||
//Silence is golden |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
-- Copyright (C) 2022 EVARISK <[email protected]> | ||
-- | ||
-- This program 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. | ||
-- | ||
-- This program 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 this program. If not, see https://www.gnu.org/licenses/. | ||
|
||
ALTER TABLE llx_categorie_question_group ADD PRIMARY KEY pk_categorie_question (fk_categorie, fk_question); | ||
ALTER TABLE llx_categorie_question_group ADD INDEX idx_categorie_question_fk_categorie (fk_categorie); | ||
ALTER TABLE llx_categorie_question_group ADD INDEX idx_categorie_question_fk_question (fk_question); | ||
ALTER TABLE llx_categorie_question_group ADD CONSTRAINT fk_categorie_question_group_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid); | ||
ALTER TABLE llx_categorie_question_group ADD CONSTRAINT fk_categorie_question_group_digiquali_question_group_rowid FOREIGN KEY (fk_question) REFERENCES llx_digiquali_question_group (rowid); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
-- Copyright (C) 2022 EVARISK <[email protected]> | ||
-- | ||
-- This program 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. | ||
-- | ||
-- This program 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 this program. If not, see https://www.gnu.org/licenses/. | ||
|
||
CREATE TABLE llx_categorie_question_group( | ||
fk_categorie integer NOT NULL, | ||
fk_question_group integer NOT NULL, | ||
import_key varchar(14) | ||
) ENGINE=innodb; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
-- Copyright (C) 2022 EVARISK <[email protected]> | ||
-- | ||
-- This program 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. | ||
-- | ||
-- This program 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 this program. If not, see https://www.gnu.org/licenses/. | ||
|
||
ALTER TABLE llx_digiquali_question_group ADD INDEX idx_digiquali_question_group_rowid (rowid); | ||
ALTER TABLE llx_digiquali_question_group ADD INDEX idx_digiquali_question_group_ref (ref); | ||
ALTER TABLE llx_digiquali_question_group ADD INDEX idx_digiquali_question_group_status (status); | ||
ALTER TABLE llx_digiquali_question_group ADD UNIQUE INDEX uk_digiquali_question_group_ref (ref, entity); | ||
ALTER TABLE llx_digiquali_question_group ADD CONSTRAINT llx_digiquali_question_group_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); |
Oops, something went wrong.