123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- <?php
- global $myFirm;
- User::check_access('example','read');
- require_once(__DIR__.SLASH.'Contact.class.php');
- $contact = Contact::provide();
- ?>
- <div class="container-small">
- <br>
- <label for="label">Composant Card</label>
- <small class="text-muted"> (Span data-type="card")</small>
- <h3>Fiche du contact <span data-type="card" data-show-delay="800" data-action="example_contact_card" data-parameters='<?php echo json_encode(array('id'=>$contact->id)); ?>'><?php echo html_decode_utf8($contact->label); ?></span></h3>
- <br>
- <form class="row" method="POST" enctype="multipart/form-data" id="contactForm" data-action="contact_save" data-id="<?php echo $contact->id; ?>">
- <div class="col-xl-12">
- <label for="label">Libellé</label>
- <small class="text-muted"> (Simple input texte)</small>
- <input type="text" value="<?php echo html_decode_utf8($contact->label); ?>" placeholder="Raison sociale ou nom" class="form-control" id="label" name="label"/>
- <br>
- <label for="phone">Téléphone</label>
- <small class="text-muted"> (Simple input texte)</small>
- <input type="text" value="<?php echo $contact->phone; ?>" placeholder="N° Téléphone" class="form-control" id="phone" name="phone"/>
- <br>
- <label for="birth">Date de naissance</label>
- <small class="text-muted"> (Input data-type="date")</small>
- <input type="text" data-type="date" value="<?php echo $contact->birth!=0?date('d/m/Y',$contact->birth):''; ?>" placeholder="La date de naissance" class="form-control" id="birth" name="birth"/>
- <br>
- <label for="hour">Heure de naissance</label>
- <small class="text-muted"> (Input data-type="hour")</small>
- <input type="text" data-type="hour" value="<?php echo $contact->hour!=0?date('H:i',$contact->hour):''; ?>" data-step="20" placeholder="L'heure de naissance" class="form-control" id="hour" name="hour"/>
- <br>
- <label for="author">Auteur</label>
- <small class="text-muted" data-placement="right" data-tooltip="* data-multiple : Autorise l'utilisateur a sélectionner des entité multiples" data-tooltip="* data-types (default: user) : définis les entité sélectionnables (ex: user,rank) "> (Input data-type="user")</small>
- <input type="text" data-type="user" data-multiple data-types="user,rank" value="<?php echo $contact->author; ?>" placeholder="Auteur du contact" class="form-control" id="author" name="author"/>
- <br>
- <label for="picture">Image</label>
- <small class="text-muted"> (Input data-type="image")</small>
- <input type="file" data-type="image" value="<?php echo $contact->picture(); ?>" class="form-control-file" id="picture" name="picture" data-delete="contact_avatar_delete(this)" data-default-src="img/default-avatar.png">
- <br>
- <label for="icon">Icône</label>
- <small class="text-muted"> (Input data-type="icon")</small>
- <span class="icon-chooser contact-icon" id="basic-addon-icon-contact">
- <input id="icon" data-type="icon" name="icon" class="form-control" placeholder="Icône du contact" value="<?php echo !empty($contact->icon) ? $contact->icon : 'fab fa-btc'; ?>" type="text"></span>
- <br>
- <label for="vehicle">Véhicule</label>
- <small class="text-muted" data-placement="right" data-tooltip="* data-depth : nb de profondeur de liste
- * data-slug : le slug de la liste mère à afficher
- * data-value : la valeur de l'entité à récup en base
- * data-disable-label : cache le label de sous-liste si mentionné">(Select data-type="dictionnary")</small>
- <select data-type="dictionnary" data-slug="vehicles" data-depth="3" data-value="<?php echo $contact->vehicle; ?>" class="form-control select-control" name="vehicle" id="vehicle"></select>
- <label for="vehicle2">Véhicule (tags)</label>
- <small class="text-muted" data-placement="right" data-tooltip="* data-multiple : Autorise l'utilisateur a sélectionner des tag multiples
- * data-slug : le slug de la liste mère à afficher">(Select data-type="tag-list")</small>
- <input type="text" data-type="tag-list" data-slug="vehicles" class="form-control" />
- <label for="vehicle2">Catégories</label>
- <small class="text-muted" data-placement="right" data-tooltip="* data-tags (json) :tags disponibles (eg.
- {
- 'bug':{'icon':'fas fa-bug','label':'Bug','color':'#cb2431'},
- 'feature':{'icon':'fas fa-check','label':'Demande','color':'#2cbe4e'}
- }
- )">(Select data-type="tagcloud")</small>
- <input type="text" data-type="tagcloud" data-tags='{"bug":{"icon":"fas fa-bug","label":"Bug","color":"#cb2431"},"feature":{"icon":"fas fa-check","label":"Demande","color":"#2cbe4e"},"question":{"icon":"far fa-question-circle","label":"Question","color":"#00BCD4"}}' class="form-control" value="bug,question"/>
- <label for="country">Pays</label>
- <small class="text-muted">(Select data-type="dictionnary")</small>
- <select data-type="dictionnary" data-slug="countries" data-depth="3" data-id="country" data-value="" class="form-control select-control" name="country" id="country"></select>
- <br>
- <label for="country">Etat</label>
- <small data-tooltip="* data-icon : l'icone affichée près du label (optionnel)" class="text-muted">(Select data-type="dropdown-select")</small><br/>
- <select data-type="dropdown-select" id="state">
- <option selected="selected" value="active" style="background-color:#2cbe4e;color:#ffffff;" data-icon="far fa-check-circle">Actif</option>
- <option value="inactive" style="background-color:#c90000;color:#ffffff;" data-icon="far fa-times-circle">Inactif</option>
- </select><br/>
- <label for="address">Adresse</label>
- <small class="text-muted"> (Input data-type="location")</small>
- <input type="text" data-type="location" data-input-city="#city" data-input-latitude="#latitude" value="<?php echo $contact->address; ?>" class="form-control" id="address" name="address"/>
- Ville : <span id="city">...</span><br>
- Latitude : <span id="latitude">...</span>
- <br><br>
- <label for="document">Documents</label>
- <small class="text-muted" data-placement="right" data-tooltip="* data-label : le label affiché dans la zone
- * data-delete : méthode de suppression de doc de l'entité
- * data-preview : Affiche l'apercu de l'image si possible
- * data-readonly : false/true Active désactive la possibilité d'envoyer du fichier
- * data-allowed : les extensions de fichier acceptées"> (Div data-type="dropzone")</small>
- <div data-type="dropzone" data-label="Faites glisser vos documents ici" data-delete="contact_delete_document" data-save="contact_add_document" data-allowed="docx,pdf,txt,jpg,bmp,gif,xlsx,png,iso" class="form-control" id="document" name="document">
- <?php echo json_encode($contact->documents()); ?>
- <!-- Template action custom pour la dropzone -->
- <div class="btn dropzone-custom-button hidden" onclick="alert('Je suis le fichier '+$(this).prev('a').text()+ '. Je vaux '+Math.floor((Math.random() * 10) + 1)+' bitcoins');" title="Une action custom" id="send-offer-button"><i class="fab fa-bitcoin"></i></div>
- </div>
- <br>
- <label for="story">Histoire</label>
- <small class="text-muted"> (Textarea data-type="wysiwyg")</small>
- <textarea data-type="wysiwyg" class="form-control" id="story" name="story"><?php echo $contact->story; ?></textarea>
- <br>
- <label for="login">Login</label>
- <small class="text-muted"> (Simple input texte)</small>
- <input type="text" value="<?php echo $contact->login; ?>" placeholder="Identifiant" class="form-control" id="login" name="login"/>
- <br>
- <label for="password">Password</label>
- <small class="text-muted"> (Input data-type="password")</small>
- <input type="text" data-type="password" data-toggle-event="hover" value="<?php echo $contact->password; ?>" placeholder="Mot de passe" class="form-control" id="password" name="password"/>
- <br>
- <label for="contact">Nom du tuteur :</label>
- <small class="text-muted"> (Div data-type="quickform")</small>
- <div style="display: inline-block;" class="quickform" data-type="quickform" data-title="Ajout rapide de tuteur :" data-loaded="example_quickform_buttons" data-warning="Ajoutez rapidement un tuteur." data-url="plugin/example/page.quick.example.php"><i class="fas fa-user-plus"></i></div>
- <input type="text" value="" placeholder="Nom du contact" class="form-control" id="contact" name="contact"/>
- <br>
- <label for="label">Donuts</label>
- <small class="text-muted"> (canvas data-type="doughnut")</small>
- <canvas data-type="doughnut" data-values="[1,3,4,7]" data-labels='["fib","on","acci"]' data-colors='["#f39c12","#2980b9","#27ae60"]'></canvas>
- <br>
- <label for="label">Line</label>
- <small class="text-muted"> (canvas data-type="line")</small>
- <canvas data-type="line" data-values="[1,3,4,7]" data-labels='["fib","on","acci"]' data-color='#8e44ad'>Graphique example</canvas>
- <br>
- <label for="label">Bar</label>
- <small class="text-muted"> (canvas data-type="bar")</small>
- <canvas data-type="bar" data-values="[2,3,4,7]" data-labels='["fib","on","acci"]' data-colors='["#f39c12","#2980b9","#27ae60"]'>Graphique example</canvas>
- <br>
- <div id="checkboxes">
- <label>Input checkbox</label>
- <small class="text-muted"> (Input data-type="checkbox")</small><br>
- <input type="checkbox" id="mycheckbox1" name="mycheckbox1" data-class="blink_me" data-type="checkbox"><label for="mycheckbox1">Ma checkbox 1 (avec id, non encapsulée)</label><br>
- <label for="checkbox_2"><input type="checkbox" id="checkbox_2" name="checkbox" data-class="" data-type="checkbox">Ma checkbox 2 (avec id, encapsulée)</label><br>
- <label><input type="checkbox" name="checkbox" data-class="" data-type="checkbox">Ma checkbox 3 (sans id, encapsulée)</label><br>
- <input type="checkbox" name="checkbox" data-class="" data-type="checkbox"><label>Ma checkbox 4 (sans id, non encapsulée)</label><br>
- <input type="checkbox" id="checkbox_5" name="checkbox" data-class="" data-type="checkbox" disabled><label for="checkbox_5">Ma checkbox 5 (avec id, disabled)</label><br>
- <label><input type="checkbox" name="checkbox" data-class="" data-type="checkbox" disabled>Ma checkbox 6 (sans id, disabled)</label><br>
- <input type="checkbox" id="checkbox_7" name="checkbox" data-class="" data-type="checkbox" disabled checked><label for="checkbox_7">Ma checkbox 7 (disabled, checked)</label><br>
- </div>
- <br>
- <div>
- <label>Input radio</label>
- <small class="text-muted"> (Input data-type="radio")</small><br>
- <input type="radio" id="case1" name="my-radio-button" data-type="radio" data-label="Hello"><br>
- <label><input type="radio" id="case2" name="my-radio-button" data-type="radio">Toto</label><br>
- <input type="radio" id="case3" name="my-radio-button" data-type="radio"><label for="case3">Coucou</label><br>
- <input type="radio" id="case4" name="my-radio-button" data-type="radio" disabled><label for="case4">Disabled avec id</label><br>
- <input type="radio" name="my-radio-button" data-type="radio"><label>Sans id</label><br>
- <input type="radio" name="my-radio-button" data-type="radio" disabled><label>Disabled sans id</label>
- </div>
- <br>
- <label for="label">Tableau d'une liste</label>
- <small class="text-muted"> (div data-type="dictionnary-table")</small>
- <div data-type="dictionnary-table" data-dictionnary="vehicles"></div>
- <br><br>
- <?php if($myFirm->has_plugin('fr.idleman.stripe')) : ?>
- <label for="checkbox">Formulaire de paiement en ligne (via API Stripe)</label>
- <small class="text-muted"> (Div data-type="payment")</small><br>
- <small class="text-muted">Il faut configurer les clés API en config avant de pouvoir réaliser un paiement. (Voir <a href="https://stripe.com/docs/testing#cards" target="_blank">cette page</a> pour des cartes bleues de tests)</small>
- <div data-type="payment" data-action="example_stripe_pay"></div>
- <?php endif; ?>
- </div>
- <div class="col-md-12 text-center noLabel">
- <div class="btn btn-success" onclick="contact_save();"><i class="fas fa-check"></i> Enregistrer</div>
- <?php if($myUser->can('export', 'read') && $myFirm->has_plugin('fr.idleman.export')) : ?>
- <div class="d-inline-block" data-type="export-model" data-callback="contact_export_callback" data-parameters='<?php echo stripslashes(json_encode(array("plugin"=>"example","dataset"=>"contact-sheet","id"=>$contact->id,"destination"=>addslashes('contact'.SLASH.'documents'.SLASH.$contact->id.SLASH)))); ?>'>
- <div class="btn btn-primary"><i class="far fa-file"></i> Export modèle</div>
- </div>
- <?php endif; ?>
- <br><br>
- </div>
- </form>
- </div>
|