page.sheet.{{entity.readable}}.php 2.1 KB

12345678910111213141516171819202122232425262728293031
  1. {"label":"Fiche entité","syntax":"php"}
  2. <?php
  3. User::check_access('{{plugin}}','read');
  4. require_once(__DIR__.SLASH.'{{Entity}}.class.php');
  5. ${{entity}} = {{Entity}}::provide();
  6. ?>
  7. <div class="plugin-{{plugin}}">
  8. <div id="{{entity-readable}}-form" class="row justify-content-md-center {{entity-readable}}-form" data-action="{{plugin_entity_deduplicate}}_save" data-id="<?php echo ${{entity}}->id; ?>">
  9. <div class="col-md-6 shadow-sm bg-white p-3">
  10. <h3>{{EntityLabel}}
  11. <div onclick="{{plugin_entity_deduplicate}}_save();" class="btn btn-small btn-success right"><i class="fas fa-check"></i> Enregistrer</div>
  12. <a href="index.php?module={{plugin}}&page=list.{{entity.readable}}" class="btn btn-small btn-dark right mr-2">Retour</a>{{#history-save}}
  13. <div class="btn btn-small btn-info mb-2 btn-dark mx-2 right" data-scope="{{entity}}" data-uid="<?php echo ${{entity}}->id; ?>" data-show-important="true" data-type="history" data-tooltip title="Ouvrir l'historique"> <i class="far fa-comment-dots"></i></div>
  14. {{/history-save}}</h3>{{#fields}}
  15. {{^isChoice}}{{^isList}}{{^isBoolean}}<label for="{{key}}">{{label}}</label>
  16. {{input}}{{/isBoolean}}{{/isList}}{{/isChoice}}{{#isList}}<label for="{{key}}">{{label}}</label>
  17. <select class="form-control select-control" type="text" id="{{key}}">
  18. <?php foreach({{Entity}}::{{key}}s() as $slug=>$item): ?>
  19. <option <?php echo ${{entity}}->{{key}} == $slug ? 'selected="selected"' : '' ?> value="<?php echo $slug ?>" ><?php echo $item['label']; ?></option>
  20. <?php endforeach; ?>
  21. </select>{{/isList}}{{#isBoolean}}<br/><label for="{{key}}"><input <?php echo ${{entity}}->{{key}} == 1 ? 'checked="checked"' : '' ?> data-type="checkbox" type="checkbox" id="{{key}}"> {{label}}</label>{{/isBoolean}}{{#isChoice}}<label for="{{key}}">{{label}}</label><br/>
  22. <?php foreach({{Entity}}::{{key}}s() as $slug=>$item): ?>
  23. <label><input <?php echo ${{entity}}->{{key}} == $slug ? 'checked="checked"' : '' ?> value="<?php echo $slug ?>" data-type="radio" type="radio" name="{{key}}"> <?php echo $item['label']; ?></label>
  24. <?php endforeach; ?>
  25. {{/isChoice}}{{/fields}}
  26. <br/>
  27. </div>
  28. </div>
  29. </div>