You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

117 lines
3.8 KiB

  1. ::use 'design.mtt'::
  2. <div class="col-md-12">
  3. <div class="article">
  4. <h2>::_("Import")::</h2>
  5. ::if step==1::
  6. <form action="/member/import/" method="POST" enctype="multipart/form-data">
  7. <p>
  8. <input name="file" type="file"/>
  9. </p>
  10. <input type="submit" value="OK" class="btn btn-primary" />
  11. </form>
  12. ::elseif step==2::
  13. <h4>::_("Users to import")::</h4>
  14. <div style="margin-bottom:24px;">
  15. ::if (data!=null && data.length>0) || (data2!=null && data2.length>0)::
  16. <table class="table table-bordered" style="font-size:11px;background-color:#FFF;">
  17. <tr>
  18. <th>::_("First name")::</th>
  19. <th>::_("Last name")::</th>
  20. <th>::_("Email")::</th>
  21. <th>::_("Phone")::</th>
  22. <th>::_("Partner first name")::</th>
  23. <th>::_("Partner last name")::</th>
  24. <th>::_("Partner email")::</th>
  25. <th>::_("phone")::</th>
  26. <th>::_("Address 1")::</th>
  27. <th>::_("Address 2")::</th>
  28. <th>::_("zip code")::</th>
  29. <th>::_("City")::</th>
  30. </tr>
  31. ::foreach d data::
  32. <tr>
  33. ::foreach r d::
  34. <td>
  35. ::if r!=null:: ::r:: ::end::
  36. </td>
  37. ::end::
  38. </tr>
  39. ::end::
  40. </table>
  41. <h4>::_("Existing accounts")::</h4>
  42. <table class="table table-bordered" style="font-size:11px;color:#666666;background-color:#FFF;">
  43. <tr>
  44. <th>::_("First name")::</th>
  45. <th>::_("Last name")::</th>
  46. <th>::_("Email")::</th>
  47. <th>::_("Phone")::</th>
  48. <th>::_("Partner first name")::</th>
  49. <th>::_("Partner last name")::</th>
  50. <th>::_("Partner email")::</th>
  51. <th>::_("phone")::</th>
  52. <th>::_("Address 1")::</th>
  53. <th>::_("Address 2")::</th>
  54. <th>::_("zip code")::</th>
  55. <th>::_("City")::</th>
  56. </tr>
  57. ::foreach d data2::
  58. <tr>
  59. ::foreach r d::
  60. <td>
  61. ::if r!=null:: ::r:: ::end::
  62. </td>
  63. ::end::
  64. </tr>
  65. ::end::
  66. </table>
  67. <div class="alert alert-error">
  68. <b>::_("Warning")::</b>
  69. <p>::_("Before validating this import, please check that this table est correctly filled.<br/>If some datas are shifted or are not linked to the right column, please check your CSV file.")::
  70. </p>
  71. <a href="/member/import">::_("Try again")::</a>
  72. </div>
  73. <a href="/member/import?confirm=1" class="btn btn-danger">::_("Finalize import")::</a>
  74. ::else::
  75. <div class="alert alert-error">
  76. <b>::_("Oups !")::</b>
  77. <p>::_("It looks like there is no data to import. Please check your CSV file or check that the users you want to import are not already registred.")::</p>
  78. <a href="/member/import">::_("Try again")::</a>
  79. </div>
  80. ::end::
  81. </div>
  82. ::elseif step==3::
  83. ::if numImported>0::
  84. <div class="alert alert-success">
  85. <b>::raw __("Congratulations ! You just imported <b>::numImported::</b> users in your group.",{numImported:numImported})::</b>
  86. </div>
  87. <p>
  88. ::raw _("You may now consider <a href='/member/?select=newusers'>inviting them</a> to log into Cagette.net")::
  89. </p>
  90. ::else::
  91. <p>::_("You did'nt import anything in your database because your file was empty, or contained already registred users")::</p>
  92. ::end::
  93. <a href="/member/">::_("Go back to the main page")::</a>
  94. ::end::
  95. </div>
  96. <div class="block">
  97. <h3>::_("Help")::</h3>
  98. ::raw _("Here you can import a large amount of members in your database from a simple Excel or Libre Office file.<br/><ul><li>The first step is to <a href=\"/adherents.xls\">download this demo file.</a></li><li>Fill out the table, of modify your existing file to striclty match the columns order.</li><li>Once your file is completed, click on \"save as\" in your spreadsheet software, and select \"CSV\" format</li><li>Select the following options : separator : <b>coma</b> or <b>dot-coma</b>, encoding : <b>Unicode UTF-8</b></li><li>Save the file</li><li>finally, click on \"select a file\" on this page and upload it.</li></ul>")::
  99. </div>
  100. </div>
  101. ::end::