PageRenderTime 24ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/src/2.071.0/themes/default/profil_collab/page_annuaire_nouvelle_fiche.inc.php

https://github.com/yvesb/soothERP
PHP | 269 lines | 244 code | 13 blank | 12 comment | 0 complexity | 33154cc331ef112d2007cc22377269a1 MD5 | raw file
  1. <?php
  2. // *************************************************************************************************************
  3. // CONTROLE DU THEME
  4. // *************************************************************************************************************
  5. // Variables nécessaires à l'affichage
  6. $page_variables = array ("_ALERTES", "ANNUAIRE_CATEGORIES", "DEFAUT_ID_PAYS", "listepays", "civilites");
  7. check_page_variables ($page_variables);
  8. //******************************************************************
  9. // Variables communes d'affichage
  10. //******************************************************************
  11. // *************************************************************************************************************
  12. // AFFICHAGE
  13. // *************************************************************************************************************
  14. ?>
  15. <script type="text/javascript" language="javascript">
  16. id_index_contentcoord=0;
  17. </script>
  18. <div class="emarge">
  19. <div style="display:none">
  20. <?php include $DIR.$_SESSION['theme']->getDir_theme()."page_annuaire_nouvelle_fiche_caiu_vide.inc.php" ?>
  21. </div>
  22. <?php include $DIR.$_SESSION['theme']->getDir_theme()."page_annuaire_recherche_mini.inc.php" ?>
  23. <p class="titre">Cr&eacute;ation d'un nouveau contact </p>
  24. <div class="contactview_corps">
  25. <div id="contact_ajout_content" style="OVERFLOW-Y: auto; OVERFLOW-X: auto; padding:10px ">
  26. <form id="annu_nvlfiche_nouvelle_fiche_form" name="annu_nvlfiche_nouvelle_fiche_form" method="post" action="annuaire_nouvelle_fiche_create.php" target="formFrame">
  27. <table class="max96pc">
  28. <tr>
  29. <td class="ctpc">
  30. <table class="minimizetable">
  31. <tr class="smallheight">
  32. <td><img src="<?php echo $DIR.$_SESSION['theme']->getDir_gtheme()?>images/blank.gif" width="100%" height="1" id="imgsizeform"/></td>
  33. <td><img src="<?php echo $DIR.$_SESSION['theme']->getDir_gtheme()?>images/blank.gif" width="100%" height="1" id="imgsizeform"/></td>
  34. </tr>
  35. <tr>
  36. <td class="size_strict">
  37. <span class="labelled_ralonger">Cat&eacute;gorie:</span>
  38. </td>
  39. <td>
  40. <select id="id_categorie" name="id_categorie" class="classinput_xsize">";
  41. <?php
  42. foreach ($ANNUAIRE_CATEGORIES as $categorie) {
  43. ?>
  44. <option value="<?php echo $categorie->id_categorie?>"><?php echo htmlentities($categorie->lib_categorie, ENT_QUOTES, "UTF-8")?></option>
  45. <?php
  46. }
  47. ?>
  48. </select>
  49. <input name="compte_info" id="compte_info" type="hidden" value="0" />
  50. <input name="create_contact" id="create_contact" type="hidden" value="" />
  51. <input name="return_to_page" id="return_to_page" type="hidden" value="" />
  52. </td>
  53. </tr>
  54. <tr>
  55. <td>
  56. <span class="labelled_ralonger">Civilit&eacute;:</span>
  57. </td>
  58. <td>
  59. <select name="civilite" id="civilite" class="classinput_xsize">
  60. <?php
  61. foreach ($civilites as $civ) {
  62. ?>
  63. <option value="<?php echo $civ->id_civilite ?>"><?php echo htmlentities($civ->lib_civ_court, ENT_QUOTES, "UTF-8")?></option>
  64. <?php
  65. }
  66. ?>
  67. </select>
  68. </td>
  69. </tr>
  70. <tr>
  71. <td>
  72. <span class="labelled_ralonger">Nom:</span>
  73. </td>
  74. <td>
  75. <textarea id="nom" name="nom" rows="2" class="classinput_xsize"></textarea>
  76. </td>
  77. </tr>
  78. <tr id="line_siret" style="display:none">
  79. <td>
  80. <span class="labelled_ralonger" title="Numéro de Siret">Siret:</span>
  81. </td>
  82. <td>
  83. <input type="text" id="siret" name="siret" rows="2" class="classinput_xsize"/>
  84. </td>
  85. </tr>
  86. <tr id="line_tva_intra" style="display:none">
  87. <td>
  88. <span class="labelled_ralonger" title="Numéro de TVA intracommunautaire">TVA intra.:</span>
  89. </td>
  90. <td>
  91. <input type="text" id="tva_intra" name="tva_intra" rows="2" class="classinput_xsize"/>
  92. </td>
  93. </tr>
  94. <tr>
  95. <td>
  96. <span class="labelled_ralonger">Profil de la fiche:</span>
  97. </td>
  98. <td><div id="divprofil">
  99. <table width="100%">
  100. <tr>
  101. <td>
  102. <?php
  103. foreach ($_SESSION['profils'] as $profil) {
  104. if (!$profil->getId_profil()) { continue; }
  105. if ($profil->getActif() != 1) { continue; }
  106. ?>
  107. <span><input onclick="affiche_annu_nvlf_profil('<?php echo $profil->getId_profil();?>');" type=checkbox value="<?php echo $profil->getId_profil();?>" id="profils<?php echo $profil->getId_profil();?>" <?php
  108. //permission (7) Gestion des collaborateurs
  109. if (!$_SESSION['user']->check_permission ("7") && $profil->getId_profil() == $COLLAB_ID_PROFIL) { echo 'disabled="disabled"'; }
  110. //permission (8) Gestion des Administrateurs
  111. if (!$_SESSION['user']->check_permission ("8") && $profil->getId_profil() == $ADMIN_ID_PROFIL) { echo 'disabled="disabled"'; }
  112. ?> name="profils[<?php echo $profil->getId_profil();?>]"><?php echo htmlentities($profil->getLib_profil(), ENT_QUOTES, "UTF-8");?></span><br />
  113. <?php
  114. }
  115. ?>
  116. <div id="divprofil_sec">
  117. <?php
  118. foreach ($_SESSION['profils'] as $profil) {
  119. if (!$profil->getId_profil()) { continue; }
  120. if ($profil->getActif() != 2) { continue; }
  121. ?>
  122. <span><input onclick="affiche_annu_nvlf_profil('<?php echo $profil->getId_profil();?>');" type=checkbox value="<?php echo $profil->getId_profil();?>" id="profils<?php echo $profil->getId_profil();?>"<?php
  123. //permission (7) Gestion des collaborateurs
  124. if (!$_SESSION['user']->check_permission ("7") && $profil->getId_profil() == $COLLAB_ID_PROFIL) { echo 'disabled="disabled"'; }
  125. //permission (8) Gestion des Administrateurs
  126. if (!$_SESSION['user']->check_permission ("8") && $profil->getId_profil() == $ADMIN_ID_PROFIL) { echo 'disabled="disabled"'; }
  127. ?> name="profils[<?php echo $profil->getId_profil();?>]"><?php echo htmlentities($profil->getLib_profil(), ENT_QUOTES, "UTF-8");?></span><br />
  128. <?php
  129. }
  130. ?>
  131. <div id="moins_profil"><a href="#" id="moins_profil_link"><img src="<?php echo $DIR.$_SESSION['theme']->getDir_gtheme()?>images/moins.gif" />Moins de profils</a></div>
  132. </div>
  133. <script type="text/javascript">
  134. Event.observe("moins_profil_link", "click", function(evt){Event.stop(evt); showform ('plus_profil', 'divprofil_sec');}, false);
  135. </script>
  136. <div id="plus_profil"><a href="#" id="plus_profil_link"><img src="<?php echo $DIR.$_SESSION['theme']->getDir_gtheme()?>images/ajouter.gif" />Plus de profils</a></div>
  137. <script type="text/javascript">
  138. Event.observe("plus_profil_link", "click", function(evt){Event.stop(evt); showform ('divprofil_sec', 'plus_profil');}, false);
  139. </script>
  140. </td>
  141. </tr>
  142. </table>
  143. </div>
  144. </td>
  145. </tr>
  146. </table>
  147. <div id="zoneprofils"></div>
  148. <hr class="bleu_liner" />
  149. <table class="minimizetable">
  150. <tr class="smallheight">
  151. <td><img src="<?php echo $DIR.$_SESSION['theme']->getDir_gtheme()?>images/blank.gif" width="100%" height="1" id="imgsizeform"/></td>
  152. <td><img src="<?php echo $DIR.$_SESSION['theme']->getDir_gtheme()?>images/blank.gif" width="100%" height="1" id="imgsizeform"/></td>
  153. </tr>
  154. <tr>
  155. <td class="size_strict">
  156. <span class="labelled_ralonger">Note:</span>
  157. </td>
  158. <td>
  159. <textarea id="note" name="note" rows="4" class="classinput_xsize"></textarea>
  160. </td>
  161. </tr>
  162. </table>
  163. <p style="text-align:right">
  164. <input type="image" name="Submit" src="<?php echo $DIR.$_SESSION['theme']->getDir_gtheme()?>images/bt-ajouter.gif"/>&nbsp;&nbsp;
  165. </p>
  166. </td>
  167. <td style="width:3%">&nbsp;
  168. </td>
  169. <td class="ctpc">
  170. <div id="annu_nvlfiche_ajout_mob" >
  171. <div id="annu_nvlfiche_coord">
  172. <span class="sous_titre1">Coordonn&eacute;es</span>
  173. <ul id="coordlist" style="padding: 2px; margin:0px;">
  174. </ul><br />
  175. <a href="#" class="ajout" id="link_add_new_coord">Ajouter une nouvelle coordonn&eacute;e</a></div>
  176. <br />
  177. <br />
  178. <div id="annu_nvlfiche_adresse">
  179. <span class="sous_titre1">Adresses</span>
  180. <ul id="adresslist" style="padding: 2px; margin:0px;">
  181. </ul><br />
  182. <a href="#" class="ajout" id="link_add_new_adresse">Ajouter une nouvelle adresse</a></div>
  183. <br />
  184. <br />
  185. <div id="annu_nvlfiche_internet">
  186. <span class="sous_titre1">Sites-Web</span>
  187. <ul id="sitelist" style="padding: 2px; margin:0px;">
  188. </ul><br />
  189. <a href="#" class="ajout" id="link_add_new_site">Ajouter un nouveau site</a></div>
  190. </div>
  191. </td>
  192. </tr>
  193. </table>
  194. <p>&nbsp;</p>
  195. <br />
  196. </form>
  197. <br />
  198. </div>
  199. </div>
  200. <script type="text/javascript" language="javascript">
  201. // <![CDATA[
  202. if (return_to_page != "") {
  203. $("return_to_page").value = return_to_page;
  204. }
  205. Event.observe("link_add_new_adresse", "click", function(evt){Event.stop(evt);createnewtagmobil('adresslist','li','adressecontent', 'annu_nvlfiche_ajout_mob');}, false);
  206. Event.observe("link_add_new_coord", "click", function(evt){Event.stop(evt);createnewtagmobil('coordlist','li','coordcontent', 'annu_nvlfiche_ajout_mob');}, false);
  207. Event.observe("link_add_new_site", "click", function(evt){Event.stop(evt); createnewtagmobil('sitelist','li','sitecontent', 'annu_nvlfiche_ajout_mob');}, false);
  208. Position.includeScrollOffsets = true;
  209. createnewtagmobil('adresslist','li','adressecontent', 'annu_nvlfiche_ajout_mob');
  210. createnewtagmobil('coordlist','li','coordcontent', 'annu_nvlfiche_ajout_mob');
  211. createnewtagmobil('sitelist','li','sitecontent', 'annu_nvlfiche_ajout_mob');
  212. start_civilite("id_categorie", "civilite", "civilite.php?cat=");
  213. Event.observe("id_categorie", "change", function(evt){if ($("id_categorie").value != "1") {$("line_siret").show(); $("line_tva_intra").show();} else {$("line_siret").hide(); $("line_tva_intra").hide();}}, false);
  214. new Form.EventObserver('annu_nvlfiche_nouvelle_fiche_form', formChanged);
  215. function setheight_annuaire_add_fiche(){
  216. set_tomax_height("contact_ajout_content" , -52);
  217. }
  218. Event.observe(window, "resize", setheight_annuaire_add_fiche, false);
  219. setheight_annuaire_add_fiche();
  220. //centrage du mini_moteur de recherche d'un contact
  221. centrage_element("pop_up_mini_moteur");
  222. centrage_element("pop_up_mini_moteur_iframe");
  223. Event.observe(window, "resize", function(evt){
  224. centrage_element("pop_up_mini_moteur_iframe");
  225. centrage_element("pop_up_mini_moteur");
  226. });
  227. //on masque le chargement
  228. H_loading();
  229. // ]]>
  230. </script>