info.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <?php
  2. /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
  5. * Copyright (C) 2017 Ferran Marcet <fmarcet@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 <https://www.gnu.org/licenses/>.
  19. */
  20. /**
  21. * \file htdocs/supplier_proposal/info.php
  22. * \ingroup propal
  23. * \brief Page d'affichage des infos d'une proposition commerciale
  24. */
  25. // Load Dolibarr environment
  26. require '../main.inc.php';
  27. require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
  28. require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
  29. require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php';
  30. if (isModEnabled('project')) {
  31. require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
  32. }
  33. // Load translation files required by the page
  34. $langs->loadLangs(array('supplier_proposal', 'compta'));
  35. $id = GETPOST('id', 'int');
  36. $socid = GETPOST('socid', 'int');
  37. // Security check
  38. if (!empty($user->socid)) {
  39. $socid = $user->socid;
  40. }
  41. $result = restrictedArea($user, 'supplier_proposal', $id);
  42. /*
  43. * View
  44. */
  45. $form = new Form($db);
  46. $object = new SupplierProposal($db);
  47. $object->fetch($id);
  48. $object->fetch_thirdparty();
  49. $object->info($object->id);
  50. $title = $object->ref." - ".$langs->trans('Info');
  51. $help_url = 'EN:Ask_Price_Supplier|FR:Demande_de_prix_fournisseur';
  52. llxHeader('', $title, $help_url);
  53. $head = supplier_proposal_prepare_head($object);
  54. print dol_get_fiche_head($head, 'info', $langs->trans('CommRequest'), -1, 'supplier_proposal');
  55. // Supplier proposal card
  56. $linkback = '<a href="'.DOL_URL_ROOT.'/supplier_proposal/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
  57. $morehtmlref = '<div class="refidno">';
  58. // Ref supplier
  59. //$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1);
  60. //$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1);
  61. // Thirdparty
  62. $morehtmlref .= $object->thirdparty->getNomUrl(1);
  63. // Project
  64. if (isModEnabled('project')) {
  65. $langs->load("projects");
  66. $morehtmlref .= '<br>';
  67. if (0) {
  68. $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
  69. if ($action != 'classify') {
  70. $morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
  71. }
  72. $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
  73. } else {
  74. if (!empty($object->fk_project)) {
  75. $proj = new Project($db);
  76. $proj->fetch($object->fk_project);
  77. $morehtmlref .= $proj->getNomUrl(1);
  78. if ($proj->title) {
  79. $morehtmlref .= ' - '.$proj->title;
  80. }
  81. } else {
  82. $morehtmlref .= '';
  83. }
  84. }
  85. }
  86. $morehtmlref .= '</div>';
  87. dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
  88. print '<div class="fichecenter">';
  89. print '<div class="underbanner clearboth"></div>';
  90. print '<br>';
  91. print '<table width="100%"><tr><td>';
  92. dol_print_object_info($object);
  93. print '</td></tr></table>';
  94. print '</div>';
  95. print dol_get_fiche_end();
  96. // End of page
  97. llxFooter();
  98. $db->close();