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

#1775 [PublicAnswer] add: rework IHM #1812

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 14 additions & 10 deletions admin/publicinterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,24 @@
$dolEditor->Create();
print '</td></tr>';

// Use signatory
print '<tr class="oddeven"><td>';
print $langs->transnoentities('AnswerPublicInterfaceUseSignatory');
print '</td><td>';
print $langs->transnoentities('AnswerPublicInterfaceUseSignatoryDescription');
print '</td>';
print '<td class="center">';
print ajax_constantonoff('DIGIQUALI_ANSWER_PUBLIC_INTERFACE_USE_SIGNATORY');
print '</td><td></td></tr>';

print '</table>';
print $form->buttonsSaveCancel('Save', '');
print '</form>';

$constArray['digiquali'] = [
'AnswerPublicInterfaceUseSignatory' => [
'name' => 'AnswerPublicInterfaceUseSignatory',
'description' => 'AnswerPublicInterfaceUseSignatoryDescription',
'code' => 'DIGIQUALI_ANSWER_PUBLIC_INTERFACE_USE_SIGNATORY',
],
'AnswerPublicInterfaceShowTitle' => [
'name' => 'AnswerPublicInterfaceShowTitle',
'description' => 'AnswerPublicInterfaceShowTitleDescription',
'code' => 'DIGIQUALI_ANSWER_PUBLIC_INTERFACE_SHOW_TITLE',
]
];
require __DIR__ . '/../../saturne/core/tpl/admin/object/object_const_view.tpl.php';

// Page end
print dol_get_fiche_end();
llxFooter();
Expand Down
37 changes: 17 additions & 20 deletions core/tpl/digiquali_answers.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,24 @@
<div class="table-row">
<!-- Contenu et commentaire -->
<div class="table-cell table-full">
<div class="label"><strong><?php print $question->getNomUrl(1, isset($publicInterface) ? 'nolink' : '', 1, '', -1, 1); ?></strong></div>
<div class="description"><?php print $question->description; ?></div>
<?php if (!isset($publicInterface)) : ?>
<div class="label"><strong><?php print $question->getNomUrl(1, '', 1, '', -1, 1); ?></strong></div>
<?php else : ?>
<div class="label"><strong><?php print $question->label; ?></strong></div>
<?php endif; ?>
<div class="question-comment-container">
<div class="question-ref">
<?php
if (!empty($objectLine->ref) ) {
print '<span class="question-ref-title">' . $objectLine->ref . '</span> :';
if (!empty($objectLine->ref && !isset($publicInterface)) ) {
print '<span class="question-ref-title">' . $objectLine->ref . '</span> :';
} ?>
</div>
<?php if ($question->type == 'Text') : ?>
<div class="<?php echo ($object->status > 0) ? 'style="pointer-events: none"' : '' ?>">
<?php
print '<span>' . $langs->trans('Answer') . ' : </span>';
$object->status > $object::STATUS_DRAFT ? print $questionAnswer :
print '<input' . ($object->status > $object::STATUS_DRAFT ? ' disabled' : '') . ' name="answer' . $question->id . '" id="answer' . $question->id . '"class="question-textarea input-answer ' . ($object->status > 0 ? 'disable' : '') . '" value="' . $questionAnswer . '">'; ?>
</div>
<div class="question-answer-text">
<?php
$object->status > $object::STATUS_DRAFT ? print $questionAnswer :
print '<textarea' . ($object->status > $object::STATUS_DRAFT ? ' disabled' : '') . ' name="answer' . $question->id . '" id="answer' . $question->id . '"class="question-textarea input-answer ' . ($object->status > 0 ? 'disable' : '') . '" value="' . $questionAnswer . '"></textarea>'; ?>
<?php endif; ?>
<?php if ($question->enter_comment > 0) : ?>
<?php print $langs->trans('Comment') . ' : '; ?>
Expand All @@ -74,14 +76,12 @@
<?php endif; ?>
</div>
</div>
<!-- Photo OK KO -->
<?php if ($question->show_photo > 0) : ?>
<?php if ($question->show_photo > 0 && getDolGlobalInt('DIGIQUALI_' . dol_strtoupper($object->element) . '_DISPLAY_MEDIAS')) : ?>
<!-- Photo OK KO -->
<div class="table-cell table-450 cell-photo-check wpeo-table">
<?php
if (getDolGlobalInt('DIGIQUALI_' . dol_strtoupper($object->element) . '_DISPLAY_MEDIAS')) :
print saturne_show_medias_linked('digiquali', $conf->digiquali->multidir_output[$conf->entity] . '/question/'. $question->ref . '/photo_ok', 'small', '', 0, 0, 0, 200, 200, 0, 0, 0, 'question/' . $question->ref . '/photo_ok', $question, 'photo_ok', 0, 0, 0,1, 'photo-ok', 0);
print saturne_show_medias_linked('digiquali', $conf->digiquali->multidir_output[$conf->entity] . '/question/'. $question->ref . '/photo_ko', 'small', '', 0, 0, 0, 200, 200, 0, 0, 0, 'question/' . $question->ref . '/photo_ko', $question, 'photo_ko', 0, 0, 0,1, 'photo-ko', 0);
endif;
?>
</div>
<?php endif; ?>
Expand Down Expand Up @@ -152,14 +152,11 @@
} ?>
</div>
<?php elseif ($question->type == 'Percentage') : ?>
<div class="table-cell table-end answer-cell table-flex <?php echo ($object->status > 0) ? 'style="pointer-events: none"' : '' ?>" data-questionId="<?php echo $question->id; ?>">
<div class="table-cell answer-cell table-flex table-full percentage-cell <?php echo ($object->status > 0) ? 'style="pointer-events: none"' : '' ?>" data-questionId="<?php echo $question->id; ?>">
<?php
print '<span class="table-cell" value="">';
print $langs->transnoentities('Answer') . ' : ';
print '</span>';
print '<span class="table-cell" value="">';
print '<input' . ($object->status > $object::STATUS_DRAFT ? ' disabled' : '') . ' name="answer' . $question->id . '" id="answer' . $question->id . '" type="number" min="0" max="100" class="input-answer ' . ($object->status > 0 ? 'disable' : '') . ' ' . ($questionAnswer == $answerLinked->position ? 'active' : '') . '" value="' . $questionAnswer . '"> %';
print '</span>';
print img_picto('', 'fontawesome_fa-frown_fas_#D53C3D_3em', 'class="range-image"');
print '<input type="range" class="search_component_input range input-answer ' . ($object->status > 0 ? 'disable' : '') . ' ' . ($questionAnswer == $answerLinked->position ? 'active' : '') . '" name="answer' . $question->id . '" id="answer' . $question->id . '" min="0" max="100" step="25" value="' . $questionAnswer . '"' . ($object->status > $object::STATUS_DRAFT ? ' disabled' : '') . '>';
print img_picto('', 'fontawesome_fa-grin_fas_#57AD39_3em', 'class="range-image"');
?>
</div>
<?php elseif ($question->type == 'Range') : ?>
Expand Down
Loading