import.lib.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
  3. * Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  4. * Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
  5. * Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. * or see http://www.gnu.org/
  20. */
  21. /**
  22. * \file htdocs/core/lib/order.lib.php
  23. * \brief Ensemble de fonctions de base pour le module commande
  24. * \ingroup commande
  25. */
  26. /**
  27. * Function to return list of tabs for import pages
  28. *
  29. * @param string $param Params to add on url links
  30. * @param int $maxstep Limit steps to maxstep or no limit if 0
  31. * @return array Array of tabs
  32. */
  33. function import_prepare_head($param, $maxstep=0)
  34. {
  35. global $langs;
  36. if (empty($maxstep)) $maxstep=6;
  37. $h=0;
  38. $head = array();
  39. $i=1;
  40. while($i <= $maxstep)
  41. {
  42. $head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step='.$i.$param;
  43. $head[$h][1] = $langs->trans("Step")." ".$i;
  44. $head[$h][2] = 'step'.$i;
  45. $h++;
  46. $i++;
  47. }
  48. return $head;
  49. }