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

#3950 [Risk] add: move medias inside medias bloc #3957

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
89 changes: 45 additions & 44 deletions core/tpl/riskanalysis/risk/digiriskdolibarr_risklist_view.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -863,19 +863,51 @@ class="risk-evaluation-cotation cotation"><?php echo $shownCotation; ?></div>
print "</div><hr>";
} ?>
<div class="risk-evaluation-container standard">
<span class="section-title"><?php echo ' ' . $langs->trans('RiskAssessment'); ?></span>
<div class="risk-evaluation-header">
<?php if ($conf->global->DIGIRISKDOLIBARR_ADVANCED_RISKASSESSMENT_METHOD) : ?>
<div class="wpeo-button evaluation-standard select-evaluation-method selected button-blue">
<span><?php echo $langs->trans('SimpleEvaluation') ?></span>
</div>
<div class="wpeo-button evaluation-advanced select-evaluation-method button-grey">
<span><?php echo $langs->trans('AdvancedEvaluation') ?></span>
</div>
<?php endif; ?>
<input class="risk-evaluation-method" type="hidden" value="standard">
<input class="risk-evaluation-multiple-method" type="hidden" value="1">
</div>
<div class="risk-evaluation-media-wrapper">
<div class="risk-evaluation-header">
<span class="section-title"><?php echo ' ' . $langs->trans('RiskAssessment'); ?></span>
<?php if ($conf->global->DIGIRISKDOLIBARR_ADVANCED_RISKASSESSMENT_METHOD) : ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quitte à modifier un peu le code, pense à remplacer le $conf->global->DIGIRISKDOLIBARR_ADVANCED_RISKASSESSMENT_METHOD
Par getDolGlobalInt('DIGIRISKDOLIBARR_ADVANCED_RISKASSESSMENT_METHOD') > 0

<div class="wpeo-button evaluation-standard select-evaluation-method selected button-blue">
<span><?php echo $langs->trans('SimpleEvaluation') ?></span>
</div>
<div class="wpeo-button evaluation-advanced select-evaluation-method button-grey">
<span><?php echo $langs->trans('AdvancedEvaluation') ?></span>
</div>
<?php endif; ?>
<input class="risk-evaluation-method" type="hidden" value="standard">
<input class="risk-evaluation-multiple-method" type="hidden" value="1">
</div>
<div class="riskassessment-medias linked-medias photo">
<div class="element-linked-medias element-linked-medias-0 risk-new">
<div class="medias section-title"><i class="fas fa-picture-o"></i><?php echo $langs->trans('Medias'); ?></div>
<table class="add-medias">
<tr>
<td>
<input hidden multiple class="fast-upload" id="fast-upload-photo-default" type="file" name="userfile[]" capture="environment" accept="image/*">
<label for="fast-upload-photo-default">
<div class="wpeo-button <?php echo ($onPhone ? 'button-square-40' : 'button-square-50'); ?>">
<i class="fas fa-camera"></i><i class="fas fa-plus-circle button-add"></i>
</div>
</label>
<input type="hidden" class="favorite-photo" id="photo" name="photo" value="<?php echo $object->photo ?>"/>
</td>
<td>
<div class="wpeo-button <?php echo ($onPhone ? 'button-square-40' : 'button-square-50'); ?> 'open-media-gallery add-media modal-open" value="0">
<input type="hidden" class="modal-options" data-modal-to-open="media_gallery" data-from-id="0" data-from-type="riskassessment" data-from-subtype="photo" data-from-subdir=""/>
<i class="fas fa-folder-open"></i><i class="fas fa-plus-circle button-add"></i>
</div>
</td>
<td>
<?php
$relativepath = 'digiriskdolibarr/medias/thumbs';
print saturne_show_medias_linked('digiriskdolibarr', $conf->digiriskdolibarr->multidir_output[$conf->entity] . '/riskassessment/tmp/RA0', 'small', 0, 0, 0, 0, $onPhone ? 40 : 50, $onPhone ? 40 : 50, 1, 0, 0, '/riskassessment/tmp/RA0');
?>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="risk-evaluation-content-wrapper">
<div class="risk-evaluation-content">
<div class="cotation-container">
Expand Down Expand Up @@ -957,37 +989,6 @@ class="risk-evaluation-cotation cotation"><?php echo $shownCotation; ?></div>
</div>
<?php endif; ?>
<hr>
<div class="riskassessment-medias linked-medias photo">
<div class="element-linked-medias element-linked-medias-0 risk-new">
<div class="medias section-title"><i class="fas fa-picture-o"></i><?php echo $langs->trans('Medias'); ?></div>
<table class="add-medias">
<tr>
<td>
<input hidden multiple class="fast-upload" id="fast-upload-photo-default" type="file" name="userfile[]" capture="environment" accept="image/*">
<label for="fast-upload-photo-default">
<div class="wpeo-button <?php echo ($onPhone ? 'button-square-40' : 'button-square-50'); ?>">
<i class="fas fa-camera"></i><i class="fas fa-plus-circle button-add"></i>
</div>
</label>
<input type="hidden" class="favorite-photo" id="photo" name="photo" value="<?php echo $object->photo ?>"/>
</td>
<td>

<div class="wpeo-button <?php echo ($onPhone ? 'button-square-40' : 'button-square-50'); ?> 'open-media-gallery add-media modal-open" value="0">
<input type="hidden" class="modal-options" data-modal-to-open="media_gallery" data-from-id="0" data-from-type="riskassessment" data-from-subtype="photo" data-from-subdir=""/>
<i class="fas fa-folder-open"></i><i class="fas fa-plus-circle button-add"></i>
</div>
</td>
<td>
<?php
$relativepath = 'digiriskdolibarr/medias/thumbs';
print saturne_show_medias_linked('digiriskdolibarr', $conf->digiriskdolibarr->multidir_output[$conf->entity] . '/riskassessment/tmp/RA0', 'small', 0, 0, 0, 0, $onPhone ? 40 : 50, $onPhone ? 40 : 50, 1, 0, 0, '/riskassessment/tmp/RA0');
?>
</td>
</tr>
</table>
</div>
</div>
</div>
<?php if ($conf->global->DIGIRISKDOLIBARR_TASK_MANAGEMENT) : ?>
<div class="riskassessment-task">
Expand Down
2 changes: 1 addition & 1 deletion css/digiriskdolibarr.min.css

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion css/scss/modal/_risk.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,14 @@
margin-bottom: 1em;
border-bottom: 1px solid rgba(0, 0, 0, 0.2);

.risk-evaluation-header {
.risk-evaluation-media-wrapper {
display: flex;
justify-content: space-between;
margin-bottom: 1em;

.risk-evaluation-header {
margin-bottom: 1em;
}
}
.risk-evaluation-content-wrapper {
display: flex;
Expand Down