page.sheet.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <?php
  2. global $myFirm;
  3. if(!$myUser->can('example','read')) throw new Exception("Vous n'avez pas la permission pour executer cette fonctionnalité",403);
  4. require_once('Contact.class.php');
  5. $contact = Contact::provide();
  6. ?>
  7. <div class="container-small">
  8. <br>
  9. <label for="label">Composant Card</label>
  10. <small class="text-muted"> (Span data-type="card")</small>
  11. <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>
  12. <br>
  13. <form class="row" method="POST" enctype="multipart/form-data" id="contactForm" data-action="contact_save" data-id="<?php echo $contact->id; ?>">
  14. <div class="col-xl-12">
  15. <label for="label">Libellé</label>
  16. <small class="text-muted"> (Simple input texte)</small>
  17. <input type="text" value="<?php echo html_decode_utf8($contact->label); ?>" placeholder="Raison sociale ou nom" class="form-control" id="label" name="label"/>
  18. <br>
  19. <label for="phone">Téléphone</label>
  20. <small class="text-muted"> (Simple input texte)</small>
  21. <input type="text" value="<?php echo $contact->phone; ?>" placeholder="N° Téléphone" class="form-control" id="phone" name="phone"/>
  22. <br>
  23. <label for="birth">Date de naissance</label>
  24. <small class="text-muted"> (Input data-type="date")</small>
  25. <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"/>
  26. <br>
  27. <label for="hour">Heure de naissance</label>
  28. <small class="text-muted"> (Input data-type="hour")</small>
  29. <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"/>
  30. <br>
  31. <label for="author">Auteur</label>
  32. <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>
  33. <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"/>
  34. <br>
  35. <label for="picture">Image</label>
  36. <small class="text-muted"> (Input data-type="image")</small>
  37. <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">
  38. <br>
  39. <label for="icon">Icône</label>
  40. <small class="text-muted"> (Input data-type="icon")</small>
  41. <span class="icon-chooser contact-icon" id="basic-addon-icon-contact">
  42. <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>
  43. <br>
  44. <label for="vehicle">Véhicule</label>
  45. <small class="text-muted" data-placement="right" data-tooltip="* data-depth : nb de profondeur de liste
  46. * data-slug : le slug de la liste mère à afficher
  47. * data-value : la valeur de l'entité à récup en base
  48. * data-disable-label : cache le label de sous-liste si mentionné">(Select data-type="dictionnary")</small>
  49. <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>
  50. <label for="vehicle2">Véhicule (tags)</label>
  51. <small class="text-muted" data-placement="right" data-tooltip="* data-multiple : Autorise l'utilisateur a sélectionner des tag multiples
  52. * data-slug : le slug de la liste mère à afficher">(Select data-type="dictionnary")</small>
  53. <input type="text" data-type="tag-list" data-slug="vehicles" class="form-control" />
  54. <label for="country">Pays</label>
  55. <small class="text-muted">(Select data-type="dictionnary")</small>
  56. <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>
  57. <br>
  58. <label for="address">Adresse</label>
  59. <small class="text-muted"> (Input data-type="location")</small>
  60. <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"/>
  61. Ville : <span id="city">...</span><br>
  62. Latitude : <span id="latitude">...</span>
  63. <br><br>
  64. <label for="document">Documents</label>
  65. <small class="text-muted" data-placement="right" data-tooltip="* data-label : le label affiché dans la zone
  66. * data-delete : méthode de suppression de doc de l'entité
  67. * data-preview : Affiche l'apercu de l'image si possible
  68. * data-readonly : false/true Active désactive la possibilité d'envoyer du fichier
  69. * data-allowed : les extensions de fichier acceptées"> (Div data-type="dropzone")</small>
  70. <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">
  71. <?php echo json_encode($contact->documents()); ?>
  72. <!-- Template action custom pour la dropzone -->
  73. <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>
  74. </div>
  75. <br>
  76. <label for="story">Histoire</label>
  77. <small class="text-muted"> (Textarea data-type="wysiwyg")</small>
  78. <textarea data-type="wysiwyg" class="form-control" id="story" name="story"><?php echo $contact->story; ?></textarea>
  79. <br>
  80. <label for="login">Login</label>
  81. <small class="text-muted"> (Simple input texte)</small>
  82. <input type="text" value="<?php echo $contact->login; ?>" placeholder="Identifiant" class="form-control" id="login" name="login"/>
  83. <br>
  84. <label for="password">Password</label>
  85. <small class="text-muted"> (Input data-type="password")</small>
  86. <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"/>
  87. <br>
  88. <label for="contact">Nom du tuteur :</label>
  89. <small class="text-muted"> (Div data-type="quickform")</small>
  90. <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>
  91. <input type="text" value="" placeholder="Nom du contact" class="form-control" id="contact" name="contact"/>
  92. <br>
  93. <label for="label">Donuts</label>
  94. <small class="text-muted"> (canvas data-type="doughnut")</small>
  95. <canvas data-type="doughnut" data-values="[1,3,4,7]" data-labels='["fib","on","acci"]' data-colors='["#f39c12","#2980b9","#27ae60"]'></canvas>
  96. <br>
  97. <label for="label">Line</label>
  98. <small class="text-muted"> (canvas data-type="line")</small>
  99. <canvas data-type="line" data-values="[1,3,4,7]" data-labels='["fib","on","acci"]' data-color='#8e44ad'>Graphique example</canvas>
  100. <br>
  101. <label for="label">Bar</label>
  102. <small class="text-muted"> (canvas data-type="bar")</small>
  103. <canvas data-type="bar" data-values="[2,3,4,7]" data-labels='["fib","on","acci"]' data-colors='["#f39c12","#2980b9","#27ae60"]'>Graphique example</canvas>
  104. <br>
  105. <div>
  106. <label>Input checkbox</label>
  107. <small class="text-muted"> (Input data-type="checkbox")</small><br>
  108. <input type="checkbox" id="checkbox" name="checkbox" data-class="blink_me" data-type="checkbox">
  109. <label for="checkbox">Ma checkbox 1</label>
  110. </div>
  111. <br>
  112. <div>
  113. <label>Input radio</label>
  114. <small class="text-muted"> (Input data-type="radio")</small><br>
  115. <input type="radio" id="case1" name="my-radio-button" data-type="radio" data-label="Hello"><br>
  116. <label><input type="radio" id="case2" name="my-radio-button" data-type="radio">Toto</label><br>
  117. <input type="radio" id="case3" name="my-radio-button" data-type="radio"><label for="case3">Coucou</label><br>
  118. <input type="radio" name="my-radio-button" data-type="radio"><label>Sans id</label>
  119. </div>
  120. <br>
  121. <label for="label">Tableau d'une liste</label>
  122. <small class="text-muted"> (div data-type="dictionnary-table")</small>
  123. <div data-type="dictionnary-table" data-dictionnary="vehicles"></div>
  124. <br><br>
  125. <?php if($myFirm->has_plugin('fr.idleman.stripe')) : ?>
  126. <label for="checkbox">Formulaire de paiement en ligne (via API Stripe)</label>
  127. <small class="text-muted"> (Div data-type="payment")</small><br>
  128. <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>
  129. <div data-type="payment" data-action="example_stripe_pay"></div>
  130. <?php endif; ?>
  131. </div>
  132. <div class="col-md-12 text-center noLabel">
  133. <div class="btn btn-success" onclick="contact_save();"><i class="fas fa-check"></i> Enregistrer</div>
  134. <?php if($myUser->can('export', 'read') && $myFirm->has_plugin('fr.idleman.export')) : ?>
  135. <div style="display: inline-block;" class="offer-btn-export" 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)))); ?>'>
  136. <div class="btn btn-primary"><i class="far fa-file"></i> Export modèle</div>
  137. </div>
  138. <?php endif; ?>
  139. <br><br>
  140. </div>
  141. </form>
  142. </div>