PageRenderTime 41ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/htdocs/core/lib/fourn.lib.php

https://bitbucket.org/speedealing/speedealing
PHP | 150 lines | 78 code | 21 blank | 51 comment | 6 complexity | 9121d1dfc52f1bd6ee928f149ca8386e MD5 | raw file
Possible License(s): LGPL-3.0, LGPL-2.1, GPL-3.0, MIT
  1. <?php
  2. /* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
  3. * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
  4. * Copyright (C) 2006 Marc Barilley <marc@ocebo.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. * or see http://www.gnu.org/
  19. */
  20. /**
  21. * \file htdocs/core/lib/fourn.lib.php
  22. * \brief Functions used by supplier invoice module
  23. * \ingroup supplier
  24. */
  25. /**
  26. * Prepare array with list of tabs
  27. *
  28. * @param Object $object Object related to tabs
  29. * @return array Array of tabs to shoc
  30. */
  31. function facturefourn_prepare_head($object)
  32. {
  33. global $langs, $conf;
  34. $h = 0;
  35. $head = array();
  36. $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$object->id;
  37. $head[$h][1] = $langs->trans('CardBill');
  38. $head[$h][2] = 'card';
  39. $h++;
  40. if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
  41. {
  42. $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/contact.php?facid='.$object->id;
  43. $head[$h][1] = $langs->trans('ContactsAddresses');
  44. $head[$h][2] = 'contact';
  45. $h++;
  46. }
  47. // Show more tabs from modules
  48. // Entries must be declared in modules descriptor with line
  49. // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
  50. // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
  51. complete_head_from_modules($conf,$langs,$object,$head,$h,'supplier_invoice');
  52. if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
  53. {
  54. $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/note.php?facid='.$object->id;
  55. $head[$h][1] = $langs->trans('Notes');
  56. $head[$h][2] = 'note';
  57. $h++;
  58. }
  59. $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/document.php?facid='.$object->id;
  60. /*$filesdir = $conf->fournisseur->dir_output.'/facture/'.get_exdir($fac->id,2).$fac->id;
  61. include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
  62. $listoffiles=dol_dir_list($filesdir,'files',1);
  63. $head[$h][1] = (count($listoffiles)?$langs->trans('DocumentsNb',count($listoffiles)):$langs->trans('Documents'));*/
  64. $head[$h][1] = $langs->trans('Documents');
  65. $head[$h][2] = 'documents';
  66. $h++;
  67. $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/info.php?facid='.$object->id;
  68. $head[$h][1] = $langs->trans('Info');
  69. $head[$h][2] = 'info';
  70. $h++;
  71. return $head;
  72. }
  73. /**
  74. * Prepare array with list of tabs
  75. *
  76. * @param Object $object Object related to tabs
  77. * @return array Array of tabs to shoc
  78. */
  79. function ordersupplier_prepare_head($object)
  80. {
  81. global $langs, $conf;
  82. $h = 0;
  83. $head = array();
  84. $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$object->id;
  85. $head[$h][1] = $langs->trans("OrderCard");
  86. $head[$h][2] = 'card';
  87. $h++;
  88. if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER))
  89. {
  90. $langs->load("stocks");
  91. $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/dispatch.php?id='.$object->id;
  92. $head[$h][1] = $langs->trans("OrderDispatch");
  93. $head[$h][2] = 'dispatch';
  94. $h++;
  95. }
  96. if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
  97. {
  98. $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/contact.php?id='.$object->id;
  99. $head[$h][1] = $langs->trans('ContactsAddresses');
  100. $head[$h][2] = 'contact';
  101. $h++;
  102. }
  103. // Show more tabs from modules
  104. // Entries must be declared in modules descriptor with line
  105. // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
  106. // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
  107. complete_head_from_modules($conf,$langs,$object,$head,$h,'supplier_order');
  108. if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
  109. {
  110. $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/note.php?id='.$object->id;
  111. $head[$h][1] = $langs->trans("Notes");
  112. $head[$h][2] = 'note';
  113. $h++;
  114. }
  115. $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/document.php?id='.$object->id;
  116. /*$filesdir = $conf->fournisseur->dir_output . "/commande/" . dol_sanitizeFileName($commande->ref);
  117. include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
  118. $listoffiles=dol_dir_list($filesdir,'files',1);
  119. $head[$h][1] = (count($listoffiles)?$langs->trans('DocumentsNb',count($listoffiles)):$langs->trans('Documents'));*/
  120. $head[$h][1] = $langs->trans('Documents');
  121. $head[$h][2] = 'documents';
  122. $h++;
  123. $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/history.php?id='.$object->id;
  124. $head[$h][1] = $langs->trans("OrderFollow");
  125. $head[$h][2] = 'info';
  126. $h++;
  127. return $head;
  128. }
  129. ?>