account.global.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php
  2. global $myUser, $myFirm, $conf;
  3. if (!$myUser->connected()) throw new Exception("Vous devez être connecté pour accéder à la page",401);
  4. ?>
  5. <div id="user-form" class="user-form">
  6. <br>
  7. <div onclick="account_save()" class="btn btn-success float-right"><i class="fas fa-check"></i> Enregistrer</div>
  8. <h3><?php echo $myUser->fullName(); ?> <small class="text-muted">(<?php echo $myUser->login; ?>)</small></h3>
  9. <div class="clear"></div>
  10. <hr>
  11. <div class="row">
  12. <div class="col-md-6">
  13. <label for="avatar">Photo :</label><br/>
  14. <input id="avatar" data-type="image" name="avatar" class="form-control-file" value="<?php echo $myUser->getAvatar(); ?>" type="file" data-delete="account_avatar_delete(this)" data-default-src="img/default-avatar.png">
  15. </div>
  16. <div class="col-md-6">
  17. <div class="user-ranks">
  18. <label for="rank">Rangs :</label><br>
  19. <small class="text-muted">
  20. <?php
  21. $ranks = array();
  22. if($myUser->superadmin == 1) {
  23. $ranks = array('Super Admin');
  24. } else {
  25. foreach($myUser->ranks[$myFirm->id] as $rank)
  26. $ranks[] = $rank->label;
  27. }
  28. foreach ($ranks as $i=>$rank): ?>
  29. <span class="badge badge-<?php echo $i%2==0 ? 'dark':'secondary'; ?>"><?php echo $rank; ?></span>
  30. <?php endforeach; ?>
  31. </small>
  32. </div>
  33. </div>
  34. </div><br/>
  35. <div class="row">
  36. <div class="col-md-6">
  37. <label for="login">Identifiant :</label><small class="text-danger"> <?php echo ' (,'.$conf->get('login_forbidden_char').' interdits)'; ?> </small>
  38. <input required id="login" name="login" class="form-control" readonly="readonly" placeholder="Identifiant" value="<?php echo html_decode_utf8($myUser->login); ?>" type="text">
  39. </div>
  40. <div class="col-md-6">
  41. <label for="mail">Mail :</label>
  42. <input required id="mail" name="mail" class="form-control" placeholder="Mail" type="text" value="<?php echo $myUser->mail; ?>">
  43. </div>
  44. </div><br/>
  45. <div class="row">
  46. <div class="col-md-6">
  47. <label for="password">Mot de passe :</label><small class="text-danger"> <?php echo ($conf->get('password_forbidden_char') == '' ? '' : ' ('.$conf->get('password_forbidden_char').' interdits)'); ?> </small>
  48. <input required id="password" data-show-strength data-generator data-type="password" name="password" class="form-control" placeholder="Mot de passe" type="password" autocomplete="new-password">
  49. </div>
  50. <div class="col-md-6">
  51. <label for="password2">Mot de passe (confirmation) :</label><small class="text-danger"> <?php echo ($conf->get('password_forbidden_char') == '' ? '' : ' ('.$conf->get('password_forbidden_char').' interdits)'); ?> </small>
  52. <input required id="password2" data-type="password" name="password2" class="form-control" placeholder="Mot de passe (confirmation)" type="password" autocomplete="new-password">
  53. </div>
  54. </div><br>
  55. <div class="row">
  56. <div class="col-md-3">
  57. <label for="firstname">Prénom :</label>
  58. <input id="firstname" name="firstname" class="form-control" placeholder="Prénom" type="text" value="<?php echo html_decode_utf8($myUser->firstname()); ?>">
  59. </div>
  60. <div class="col-md-3">
  61. <label for="name">Nom :</label>
  62. <input id="name" name="name" class="form-control" placeholder="Nom" type="text" value="<?php echo html_decode_utf8($myUser->lastname()); ?>">
  63. </div>
  64. <div class="col-md-6">
  65. <label for="function">Fonction :</label>
  66. <input id="function" name="function" class="form-control" placeholder="ex: Responsable RH" type="text" value="<?php echo $myUser->function; ?>">
  67. </div>
  68. </div><br>
  69. <div class="row">
  70. <div class="col-md-6">
  71. <label for="phone">Téléphone fixe :</label>
  72. <input id="phone" name="phone" class="form-control" placeholder="N° Téléphone fixe" type="text" value="<?php echo $myUser->phone; ?>">
  73. </div><div class="col-md-6">
  74. <label for="mobile">Téléphone mobile :</label>
  75. <input id="mobile" name="mobile" class="form-control" placeholder="N° Téléphone mobile" type="text" value="<?php echo $myUser->mobile; ?>">
  76. </div>
  77. </div><br>
  78. <div class="row mb-2">
  79. <div class="col-md-6">
  80. <label for="">Compte créé le :</label>
  81. <input class="form-control-plaintext" readonly="readonly" type="text" value="<?php echo empty($myUser->created) ? '-' : date('d/m/Y H:i', $myUser->created); ?>">
  82. </div>
  83. <div class="col-md-6">
  84. <label for="manager">Manager :</label>
  85. <input id="manager" name="manager" readonly="readonly" class="form-control-plaintext" placeholder="Nom de manager" type="text" value="<?php echo is_object($myUser->manager) ? $myUser->manager->fullName():' - '; ?>">
  86. </div>
  87. </div><br>
  88. <?php Plugin::callHook('account_global'); ?>
  89. </div>