1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?php
- global $myFirm;
- User::check_access('example','read');
- require_once(__DIR__.SLASH.'Contact.class.php');
- $defaultFilters = filters_default(array(
- "jean",
- array(
- 'birth' => "17/09/1998",
- 'join' => 'or'
- ),
- array(
- 'phone:like' => "9754"
- )
- ));
- ?>
- <div class="row">
- <div class="col-md-8">
- <!--
- voir filter.component.js pour la documentation
- -->
- <select id="filters" data-type="filter" data-slug="contact-search" data-default='<?php echo json_encode($defaultFilters); ?>' data-label="Trouver un contact" data-function="contact_search">
- <!-- pour une recherche simple, ne pas spécifier d'options dans cette liste -->
- <option value="birth" data-filter-type="date">Date de naissance</option>
- <option value="label" data-filter-type="text">Libellé</option>
- <option value="author" data-filter-type="user">Auteur</option>
- <option value="phone" data-filter-type="text">Téléphone</option>
- <option value="vehicle" data-filter-type="dictionnary" data-slug="vehicles" data-depth="3" data-disable-label>Véhicule</option>
- <option value="login" data-filter-type="dictionnary" data-filter-source='<?php echo json_encode(array('nigol'=>'Nigol','pouet'=>'Pouet')); ?>'>Ma liste custom</option>
- <option value="myNumber" data-filter-type="number">Un nombre</option>
- <option value="mycheckbox1" data-filter-type="boolean">Ma checkbox 1</option>
- </select>
- </div>
- <div class="col-md-4">
- <?php if($myUser->can('example', 'edit')) : ?>
- <a href="index.php?module=example&page=sheet" class="btn btn-success right"><i class="fas fa-plus"></i> Ajouter un contact</a>
- <?php endif; ?>
-
- <?php if($myUser->can('export', 'read') && $myFirm->has_plugin('fr.sys1.export')) : ?>
- <div class="right mr-2 d-inline-block" data-type="export-model" data-default="xlsx2" data-pre-callback="contact_export_pre_callback" data-post-callback="contact_export_post_callback" data-parameters='<?php echo stripslashes(json_encode(array("plugin"=>"example","dataset"=>"contact-list"))); ?>'>
- <div class="btn btn-primary"><i class="far fa-file"></i> Export modèle</div>
- </div>
- <?php endif; ?>
- </div>
- </div>
- <h4 class="results-count"><span></span> Résultat(s) <div class="btn btn-dark btn-small" onclick="contact_search(null,true)"><i class="far fa-file-excel"></i> Exporter</div></h4>
- <div class="row">
- <div class="col-xl-12">
- <!-- Résultats -->
- <table id="contacts" class="table table-striped">
- <thead>
- <tr>
- <th>#</th>
- <th></th>
- <th data-sortable="label">Libellé</th>
- <th data-sortable="phone">Téléphone</th>
- <th>Date de naissance</th>
- <th>Auteur</th>
- <th>Horodatage</th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <tr data-id="{{id}}" class="hidden">
- <td>{{id}}</td>
- <td><img data-src="{{picture}}" class="avatar-mini avatar-rounded"></td>
- <td><a href="index.php?module=example&page=sheet&id={{id}}">{{label}}</a></td>
- <td>{{phone}}</td>
- <td>{{birth}}</td>
- <td>{{author}}</td>
- <td><small class="text-muted">Créé le {{created}} par {{creator}} <br/> Modifié le {{updated}} par {{updater}}</small></td>
- <td class="text-right">
- <div class="btn-group btn-group-sm" role="group">
- <a class="btn btn-info" href="index.php?module=example&page=sheet&id={{id}}"><i class="fas fa-pencil-alt"></i></a>
- <div class="btn btn-danger" onclick="contact_delete(this);"><i class="far fa-trash-alt"></i></div>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
-
- <!-- Pagination (data-range définit le nombre de pages max affichées avant et après la page courante) -->
- <ul class="pagination justify-content-center" data-range="3">
- <li class="page-item hidden" data-value="{{value}}" title="Voir la page {{label}}" onclick="$(this).parent().find('li').removeClass('active');$(this).addClass('active');contact_search()">
- <span class="page-link">{{label}}</span>
- </li>
- </ul>
- </div>
- </div>
|