-
Notifications
You must be signed in to change notification settings - Fork 22
Add question group #2059
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Add question group #2059
Conversation
2c95944
to
dc57672
Compare
cdba5c9
to
34cf1bd
Compare
97eebdf
to
beecfd9
Compare
class/control.class.php
Outdated
$questionOrGroup->fk_question_group = 0; | ||
$questions[] = $questionOrGroup; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mettre ça dans une fonction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class/sheet.class.php
Outdated
|
||
|
||
$res = $this->db->query($sql); | ||
$questionAndGroupIds = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$questionAndGroups
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- fetch_object_linked et concaténer les tableaux digiquali_question et digiquali_questiongroup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
en fait je crois que je peux pas utiliser les fonctions natives parce que je veux absolument que ce soit trié par position et y a pas moyen de le faire via fetchObjectLinked vu que c'est deux types d'objets différents il peut pas envoyer une seule liste ordonnée par position
|
||
/** | ||
* \file class/question_group.class.php | ||
* \ingroup digiquali |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vérifier les noms de classe partout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class/questiongroup.class.php
Outdated
* Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor | ||
*/ | ||
|
||
//CREATE TABLE llx_digiquali_question_group( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class/questiongroup.class.php
Outdated
'ref' => ['type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'visible' => 4, 'noteditable' => 1, 'default' => '(PROV)', 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'validate' => 1, 'comment' => 'Reference of object'], | ||
'ref_ext' => ['type' => 'varchar(128)', 'label' => 'RefExt', 'enabled' => 1, 'position' => 20, 'notnull' => 0, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'comment' => 'External reference of object'], | ||
'entity' => ['type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'default' => 1, 'index' => 1, 'comment' => 'Entity'], | ||
'date_creation' => ['type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 40, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'default' => '@NOW@', 'index' => 1, 'comment' => 'Creation date'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@now@ ?
enlever les comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class/questiongroup.class.php
Outdated
* | ||
* @return int <=0 if no, >0 if yes | ||
*/ | ||
public function isErasable() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_erasable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class/questiongroup.class.php
Outdated
global $langs; | ||
|
||
$ret = parent::getTriggerDescription($object); | ||
$ret .= (dol_strlen($object->photo_ok) > 0 ? $langs->transnoentities('PhotoOK') . ' : ' . $object->photo_ok . '</br>' : ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enlever photo ko et ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class/survey.class.php
Outdated
|
||
$surveyLine->create($user); | ||
$test = $surveyLine->create($user); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*/ | ||
|
||
/** | ||
* \file core/modules/digiquali/question/mod_question_standard.php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vérifier nom
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ou est passé le sql de question group
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!empty($sheet->linkedObjects['digiquali_question'])) { | ||
foreach ($sheet->linkedObjects['digiquali_question'] as $question) { | ||
$questionAndGroups = $sheet->fetchQuestionsAndGroups(); | ||
$object->fetchLinesCommon(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pas sûr que ce soit utile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
if (dol_strlen($comment) > 0) { | ||
$line->comment = $comment; | ||
} | ||
|
||
$line->fk_question_group = $question->fk_question_group; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pas sûr d'avoir besoin de ça
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!empty($object->lines)) { | ||
foreach ($object->lines as $line) { | ||
if ($line->fk_question === $question->id) { | ||
if ($line->fk_question === $question->id && $line->fk_question_group === $question->fk_question_group) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update toutes les lines pour mettre le fk_question_group à 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good
js/modules/sheet.js
Outdated
} else { | ||
addGroupRow.classList.remove("hidden"); | ||
addQuestionRow.classList.add("hidden"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jquery
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
js/modules/sheet.js
Outdated
}); | ||
} | ||
|
||
window.digiquali.sheet.closeAllGroups = function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jquery
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
js/modules/sheet.js
Outdated
); | ||
} | ||
|
||
window.digiquali.sheet.showQuestionCard = function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a voir si ça existe encore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
js/modules/sheet.js
Outdated
lineOrder.push($(this).attr('id')); | ||
}); | ||
|
||
const token = $('.fiche').find('input[name="token"]').val(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saturne gettoken
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
js/modules/sheet.js
Outdated
if (document.URL.match(/action=/)) { | ||
document.URL = document.URL.split(/\?/)[0]; | ||
separator = '?'; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get query separator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Define confirmation messages | ||
$formquestion_groupclone = [ | ||
['type' => 'text', 'name' => 'clone_label', 'label' => $langs->trans('NewLabelForClone', $langs->transnoentities('The' . ucfirst($object->element))), 'value' => $langs->trans('CopyOf') . ' ' . $object->ref, 'size' => 24], | ||
['type' => 'checkbox', 'name' => 'clone_photos', 'label' => $langs->trans('ClonePhotos'), 'value' => 1], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enlever
print '<span class="butActionRefused classfortooltip" title="' . dol_escape_htmltag($langs->trans('ObjectMustBeDraft', ucfirst($langs->transnoentities('The' . ucfirst($object->element))))) . '"><i class="fas fa-edit"></i> ' . $langs->trans('Modify') . '</span>'; | ||
} | ||
|
||
// Lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pas d'object type là
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print '</div>'; | ||
} | ||
|
||
// ANSWERS LINES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mauvais commentaire
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* \file view/question_group/question_group_list.php | ||
* \ingroup digiquali | ||
* \brief List page for question_group | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rework la liste avec les nouveaux tpl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$error = 0; | ||
|
||
// Action to set status STATUS_LOCKED | ||
if (!$error && ($massaction == 'lock' || ($action == 'lock' && $confirm == 'yes')) && $permissiontoadd) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pas de object type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!empty($toselect)) { | ||
foreach ($toselect as $toselectedid) { | ||
$object->fetch($toselectedid); | ||
if ($object->type == 'UniqueChoice' || $object->type == 'MultipleChoices') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enlever les massa actions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
view/sheet/sheet_card.php
Outdated
print '</td>'; | ||
// QUESTIONS LINES | ||
print '<div class="div-table-responsive-no-min">'; | ||
print load_fiche_titre($langs->trans("LinkedQuestionsList"), '', '', 0, 'questionList'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remettre le question counter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
view/sheet/sheet_card.php
Outdated
print '<td class="center">' . $langs->trans('Action') . '</td>'; | ||
print '<td class="center"></td>'; | ||
print '</tr></thead>'; | ||
print '<tbody>'; // Ajouter ici le conteneur partagé pour tous les éléments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commentaire
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -53,6 +54,7 @@ | |||
// Initialize technical objects | |||
$object = new Sheet($db); | |||
$question = new Question($db); | |||
$questionGroup = new QuestionGroup($db); | |||
$answer = new Answer($db); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vérifier que l'export marche bien
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -513,14 +529,14 @@ | |||
|
|||
$averagePercentageQuestions = 0; | |||
$percentQuestionCounter = 0; | |||
foreach ($sheet->linkedObjects['digiquali_question'] as $questionLinked) { | |||
foreach ($questionIds as $questionId) { | |||
if ($questionLinked->type !== 'Percentage') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
corriger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.