Skip to content
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

#1680 [Control] add: mass control #1864

Open
wants to merge 25 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
72dbe90
add multi object control
theodaviddd Aug 7, 2024
b1c76bd
#1680 [Control] add: multi control data model
theodaviddd Aug 13, 2024
610c325
#1680 [Control] add: multi control list template
theodaviddd Aug 13, 2024
0980076
#1680 [Control] add: mass control management
theodaviddd Aug 13, 2024
24b3947
#1680 [Control] add: control answers & lock
theodaviddd Aug 13, 2024
5d3133f
#1680 [Control] add: controlled object on mass control list
theodaviddd Aug 13, 2024
4159a25
add: save answers button in modal
evarisk-theo Aug 20, 2024
df7cb27
add multi sheets on control form
evarisk-theo Aug 20, 2024
449d88a
add: add controls to control
evarisk-theo Aug 20, 2024
c0b799b
fix: mass signature
theodaviddd Aug 20, 2024
5123119
fix: action clone
theodaviddd Aug 20, 2024
dde45a6
fix: lock button & js
theodaviddd Aug 16, 2024
da0ed00
fix: workflow
theodaviddd Aug 16, 2024
26b1fde
add: document on list
theodaviddd Aug 16, 2024
4f5ad2a
fix: prevent user from clicking if control is locked
theodaviddd Aug 16, 2024
805b7ec
fix: questions answering
theodaviddd Aug 27, 2024
d624f86
fix: avoid sub controls edition if main control is validated
theodaviddd Aug 27, 2024
26fe14b
fix: show parent control
theodaviddd Aug 27, 2024
2521f83
add: document management
lmag Aug 15, 2024
6d41b05
fix: prevent saving sub control from disabling main control validate …
theodaviddd Sep 3, 2024
6691f09
#1680 [Control] fix: loader on selected answer only
theodaviddd Sep 3, 2024
5bdd7f6
#1680 [Control] fix: change variables from masscontrol to maincontro…
theodaviddd Sep 3, 2024
1b62bc3
#1680 [Control] fix: verdict update if null
theodaviddd Sep 3, 2024
53cb95e
Auto stash before rebase of "add_multi_objects_controls"
theodaviddd Sep 3, 2024
64d3b3b
#1680 [Control] fix: minor typo & syntax changes
theodaviddd Sep 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: questions answering
theodaviddd committed Sep 3, 2024
commit 805b7ec10e0124abc275b604de5f78b4a9f0003c
2 changes: 2 additions & 0 deletions core/tpl/digiquali_answers.tpl.php
Original file line number Diff line number Diff line change
@@ -29,8 +29,10 @@
* Variable : $publicInterface
*/


if (is_array($sheet->linkedObjects['digiquali_question']) && !empty($sheet->linkedObjects['digiquali_question'])) {
foreach ($sheet->linkedObjects['digiquali_question'] as $question) {

$questionAnswer = '';
$comment = '';
$result = $objectLine->fetchFromParentWithQuestion($object->id, $question->id);
21 changes: 14 additions & 7 deletions core/tpl/digiquali_mass_control_list.tpl.php
Original file line number Diff line number Diff line change
@@ -40,10 +40,16 @@
print '</div>';

$mainControlId = $object->id;
$sheet = new Sheet($db);

// Check if there are any mass controls and print them
if (is_array($massControlList) && !empty($massControlList)) {
foreach ($massControlList as $massControl) {
$object = $massControl;
$sheet->fetch($massControl->fk_sheet);
$sheet->fetch_optionals();

$sheet->fetchObjectLinked($object->fk_sheet, 'digiquali_' . $sheet->element);
$massControl->fetch_optionals();
$massControl->fetchLines();
$massControl->fetchObjectLinked('', '', $massControl->id, 'digiquali_control', 'OR', 1, 'sourcetype', 0);
@@ -96,8 +102,8 @@

print '<div class="table-cell center">';
$questionCounter = 0;
if (!empty($questionIds)) {
$questionCounter = count($questionIds);
if (!empty($sheet->linkedObjects['digiquali_question'])) {
$questionCounter = count($sheet->linkedObjects['digiquali_question']);
}

$answerCounter = 0;
@@ -110,22 +116,23 @@
}
//affiche le nombre de questions répondues
print '<span class="answerCounter">' . $answerCounter . '/' . $questionCounter . '</span>';
print '<button class="'. ($massControl->status == $massControl::STATUS_LOCKED ? "butActionRefused" : "butAction modal-open") .' answerSubControl" data-control-id="'. $massControl->id .'">';
print '<button type="button" class="'. ($massControl->status == $massControl::STATUS_LOCKED ? "butActionRefused" : "butAction modal-open") .' answerSubControl" data-control-id="'. $massControl->id .'">';
print $langs->trans('Answers');
print '<input type="hidden" class="modal-options" data-modal-to-open="modalSubControl'. $massControl->id .'">';
print '</button>';
print '</div>';
$documenturl = DOL_URL_ROOT . '/document.php';
//retrieve last document of the control
print '<div class="table-cell center">';
$documentList = dol_dir_list($conf->digiquali->multidir_output[$massControl->entity ?: 1] . '/controldocument/' . $massControl->ref . '/');
if (!empty($documentList)) {
$lastDocument = $documentList[count($documentList) - 1];
$lastDocumentPath = $lastDocument['relativename'];
print '<a class="documentdownload paddingright" href="' . $documenturl . '?modulepart=digiquali&file=controldocument/' . urlencode($massControl->ref . '/' . $lastDocumentPath) . '">';
print '<button type="button" class="wpeo-button button-square-40 button-blue wpeo-tooltip-event" aria-label="' . $langs->trans('ShowDocument') . '"><i class="fas fa-eye button-icon"></i></button>';
print '</a>';
}
print '<div class="table-cell center">';
print '<a class="documentdownload paddingright" href="' . $documenturl . '?modulepart=digiquali&file=controldocument/' . urlencode($massControl->ref . '/' . $lastDocumentPath) . '">';
print '<button type="button" class="wpeo-button button-square-40 button-blue wpeo-tooltip-event" aria-label="' . $langs->trans('ShowDocument') . '"><i class="fas fa-eye button-icon"></i></button>';
print '</a>';

print '</div>';
print '<div class="table-cell center">';
if ($massControl->status != $massControl::STATUS_LOCKED) {
2 changes: 1 addition & 1 deletion view/control/control_card.php
Original file line number Diff line number Diff line change
@@ -442,7 +442,7 @@
print '</td></tr>';

//FK SHEET
print '<tr style="display:none" class="sub-controls-model"><td class="fieldrequired">' . ($source != 'pwa' ? $langs->trans('SubControlSheet') : img_picto('', $sheet->picto . '_2em', 'class="pictofixedwidth"')) . '</td><td>';
print '<tr style="'. (GETPOST('mass_control') ? : 'display:none') .'" class="sub-controls-model"><td class="fieldrequired">' . ($source != 'pwa' ? $langs->trans('SubControlSheet') : img_picto('', $sheet->picto . '_2em', 'class="pictofixedwidth"')) . '</td><td>';
print ($source != 'pwa' ? img_picto('', $sheet->picto, 'class="pictofixedwidth"') : '') . $sheet->selectSheetList(GETPOST('fk_sub_controls_sheet'), 'fk_sub_controls_sheet', 's.type = ' . '"' . $object->element . '" AND s.status = ' . Sheet::STATUS_LOCKED);
if ($source != 'pwa') {
print '<a class="butActionNew" href="' . DOL_URL_ROOT . '/custom/digiquali/view/sheet/sheet_card.php?action=create" target="_blank"><span class="fa fa-plus-circle valignmiddle paddingleft" title="' . $langs->trans('AddSheet') . '"></span></a>';