expedition.lib.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?php
  2. /* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
  3. * Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  4. * Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
  5. * Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
  6. * Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. * or see https://www.gnu.org/
  21. */
  22. /**
  23. * \file htdocs/core/lib/expedition.lib.php
  24. * \brief Function for expedition module
  25. * \ingroup expedition
  26. */
  27. /**
  28. * Prepare array with list of tabs
  29. *
  30. * @param Expedition $object Object related to tabs
  31. * @return array Array of tabs to show
  32. */
  33. function expedition_prepare_head(Expedition $object)
  34. {
  35. global $langs, $conf, $user;
  36. if (!empty($conf->expedition->enabled)) $langs->load("sendings");
  37. $langs->load("orders");
  38. $h = 0;
  39. $head = array();
  40. $h = 0;
  41. $head[$h][0] = DOL_URL_ROOT."/admin/confexped.php";
  42. $head[$h][1] = $langs->trans("Setup");
  43. $h++;
  44. $head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
  45. $head[$h][1] = $langs->trans("Shipment");
  46. $hselected = $h;
  47. $h++;
  48. if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY))
  49. {
  50. $head[$h][0] = DOL_URL_ROOT."/admin/delivery.php";
  51. $head[$h][1] = $langs->trans("Receivings");
  52. $h++;
  53. }
  54. complete_head_from_modules($conf, $langs, $object, $head, $h, 'order');
  55. complete_head_from_modules($conf, $langs, $object, $head, $h, 'order', 'remove');
  56. return $head;
  57. }
  58. /**
  59. * Return array head with list of tabs to view object informations.
  60. *
  61. * @return array head array with tabs
  62. */
  63. function expedition_admin_prepare_head()
  64. {
  65. global $langs, $conf, $user;
  66. $langs->load("sendings");
  67. $h = 0;
  68. $head = array();
  69. $head[$h][0] = DOL_URL_ROOT."/admin/confexped.php";
  70. $head[$h][1] = $langs->trans("Setup");
  71. $head[$h][2] = 'general';
  72. $h++;
  73. if (!empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
  74. {
  75. $head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
  76. $head[$h][1] = $langs->trans("Shipment");
  77. $head[$h][2] = 'shipment';
  78. $h++;
  79. }
  80. if (!empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
  81. {
  82. $head[$h][0] = DOL_URL_ROOT.'/admin/expedition_extrafields.php';
  83. $head[$h][1] = $langs->trans("ExtraFields");
  84. $head[$h][2] = 'attributes_shipment';
  85. $h++;
  86. }
  87. if (!empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
  88. {
  89. $head[$h][0] = DOL_URL_ROOT.'/admin/expeditiondet_extrafields.php';
  90. $head[$h][1] = $langs->trans("ExtraFieldsLines");
  91. $head[$h][2] = 'attributeslines_shipment';
  92. $h++;
  93. }
  94. if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY))
  95. {
  96. $head[$h][0] = DOL_URL_ROOT."/admin/delivery.php";
  97. $head[$h][1] = $langs->trans("Receivings");
  98. $head[$h][2] = 'receivings';
  99. $h++;
  100. }
  101. if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY))
  102. {
  103. $head[$h][0] = DOL_URL_ROOT.'/admin/delivery_extrafields.php';
  104. $head[$h][1] = $langs->trans("ExtraFields");
  105. $head[$h][2] = 'attributes_receivings';
  106. $h++;
  107. }
  108. if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY))
  109. {
  110. $head[$h][0] = DOL_URL_ROOT.'/admin/deliverydet_extrafields.php';
  111. $head[$h][1] = $langs->trans("ExtraFieldsLines");
  112. $head[$h][2] = 'attributeslines_receivings';
  113. $h++;
  114. }
  115. complete_head_from_modules($conf, $langs, null, $head, $h, 'expedition_admin');
  116. complete_head_from_modules($conf, $langs, null, $head, $h, 'expedition_admin', 'remove');
  117. return $head;
  118. }