Vérification de la possibilité de supprimer un type de mouvement dans
la config
This commit is contained in:
parent
e2d90b3da5
commit
f47e4b0892
54
config.html
54
config.html
@ -48,20 +48,43 @@
|
||||
</thead>
|
||||
<tbody id="input_body">
|
||||
{{#foreach from=$module.config.inputNature item="input_field"}}
|
||||
|
||||
{{* Vérifier si la suppression de ce type d'entrée est possible *}}
|
||||
{{:assign suppr=true}}
|
||||
{{#load type="movement" where="$$.inputNature = :libelle" :libelle=$input_field.label}}
|
||||
{{:assign suppr=false}}
|
||||
{{/load}}
|
||||
|
||||
<tr>
|
||||
<td>{{:input type="text" name="input_fields[label][]" default=$input_field.label}}</td>
|
||||
<td>{{:input type="select" name="input_fields[type][]" options=$types_entrees default=$input_field.type required=true default_empty="— Choisir un type —"}}</td>
|
||||
<td class="action">
|
||||
{{:button label="Retirer" shape="minus" onclick="this.parentNode.parentNode.remove();"}}
|
||||
{{if $suppr}}
|
||||
{{:button label="Supprimer" shape="minus" onclick="this.parentNode.parentNode.remove();"}}
|
||||
{{else}}
|
||||
{{:button label="Supprimer" shape="minus" disabled=true}}
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
{{else}}
|
||||
{{* pas de config enregistrée : utiliser les valeurs par défaut *}}
|
||||
{{#foreach from=$entrees_defaut key="label" item="value"}}
|
||||
|
||||
{{* Vérifier si la suppression de ce type d'entrée est possible *}}
|
||||
{{:assign suppr=true}}
|
||||
{{#load type="movement" where="$$.inputNature = :libelle" :libelle=$label}}
|
||||
{{:assign suppr=false}}
|
||||
{{/load}}
|
||||
|
||||
<tr>
|
||||
<td>{{:input type="text" name="input_fields[label][]" default=$label}}</td>
|
||||
<td>{{:input type="select" name="input_fields[type][]" options=$types_entrees required=true default=$value default_empty="— Choisir un type —"}}</td>
|
||||
<td class="action">
|
||||
{{:button label="Retirer" shape="minus" onclick="this.parentNode.parentNode.remove();"}}
|
||||
{{if $suppr}}
|
||||
{{:button label="Supprimer" shape="minus" onclick="this.parentNode.parentNode.remove();"}}
|
||||
{{else}}
|
||||
{{:button label="Supprimer" shape="minus" disabled=true}}
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
@ -95,20 +118,43 @@
|
||||
</thead>
|
||||
<tbody id="output_body">
|
||||
{{#foreach from=$module.config.outputNature item="output_field"}}
|
||||
|
||||
{{* Vérifier si la suppression de ce type de sortie est possible *}}
|
||||
{{:assign suppr=true}}
|
||||
{{#load type="movement" where="$$.outputNature = :libelle" :libelle=$output_field.label}}
|
||||
{{:assign suppr=false}}
|
||||
{{/load}}
|
||||
|
||||
<tr>
|
||||
<td>{{:input type="text" name="output_fields[label][]" default=$output_field.label}}</td>
|
||||
<td>{{:input type="select" name="output_fields[type][]" options=$types_sorties default=$output_field.type required=true default_empty="— Choisir un type —"}}</td>
|
||||
<td class="action">
|
||||
{{:button label="Retirer" shape="minus" onclick="this.parentNode.parentNode.remove();"}}
|
||||
{{if $suppr}}
|
||||
{{:button label="Supprimer" shape="minus" onclick="this.parentNode.parentNode.remove();"}}
|
||||
{{else}}
|
||||
{{:button label="Supprimer" shape="minus" disabled=true}}
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
{{else}}
|
||||
{{* pas de config enregistrée : utiliser les valeurs par défaut *}}
|
||||
{{#foreach from=$sorties_defaut key="label" item="value"}}
|
||||
|
||||
{{* Vérifier si la suppression de ce type de sortie est possible *}}
|
||||
{{:assign suppr=true}}
|
||||
{{#load type="movement" where="$$.inputNature = :libelle" :libelle=$label}}
|
||||
{{:assign suppr=false}}
|
||||
{{/load}}
|
||||
|
||||
<tr>
|
||||
<td>{{:input type="text" name="output_fields[label][]" default=$label}}</td>
|
||||
<td>{{:input type="select" name="output_fields[type][]" options=$types_sorties required=true default=$value default_empty="— Choisir un type —"}}</td>
|
||||
<td class="action">
|
||||
{{:button label="Retirer" shape="minus" onclick="this.parentNode.parentNode.remove();"}}
|
||||
{{if $suppr}}
|
||||
{{:button label="Supprimer" shape="minus" onclick="this.parentNode.parentNode.remove();"}}
|
||||
{{else}}
|
||||
{{:button label="Supprimer" shape="minus" disabled=true}}
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
|
Loading…
Reference in New Issue
Block a user