info.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <?php
  2. /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. */
  18. /**
  19. * \file htdocs/comm/action/info.php
  20. * \ingroup agenda
  21. * \brief Page des informations d'une action
  22. */
  23. require '../../main.inc.php';
  24. require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
  25. require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
  26. require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
  27. require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
  28. require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
  29. if (!empty($conf->project->enabled)) {
  30. require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
  31. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
  32. }
  33. // Load translation files required by the page
  34. $langs->load("commercial");
  35. $id = GETPOST('id', 'int');
  36. // Security check
  37. if ($user->socid > 0) {
  38. $action = '';
  39. $socid = $user->socid;
  40. }
  41. $result = restrictedArea($user, 'agenda', $id, 'actioncomm&societe', 'myactions|allactions', 'fk_soc', 'id');
  42. if ($user->socid && $socid) {
  43. $result = restrictedArea($user, 'societe', $socid);
  44. }
  45. /*
  46. * View
  47. */
  48. $form = new Form($db);
  49. $help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
  50. llxHeader('', $langs->trans("Agenda"), $help_url);
  51. $object = new ActionComm($db);
  52. $object->fetch($id);
  53. $object->info($object->id);
  54. $head = actions_prepare_head($object);
  55. print dol_get_fiche_head($head, 'info', $langs->trans("Action"), -1, 'action');
  56. $linkback = img_picto($langs->trans("BackToList"), 'object_calendarlist', 'class="hideonsmartphone pictoactionview"');
  57. $linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php">'.$langs->trans("BackToList").'</a>';
  58. // Link to other agenda views
  59. $out = '';
  60. $out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="hideonsmartphone pictoactionview"');
  61. $out .= '<a href="'.DOL_URL_ROOT.'/comm/action/peruser.php?mode=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewPerUser").'</a>';
  62. $out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="hideonsmartphone pictoactionview"');
  63. $out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewCal").'</a>';
  64. $out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="hideonsmartphone pictoactionview"');
  65. $out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewWeek").'</a>';
  66. $out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="hideonsmartphone pictoactionview"');
  67. $out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewDay").'</a>';
  68. $linkback .= $out;
  69. $morehtmlref = '<div class="refidno">';
  70. // Thirdparty
  71. //$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
  72. // Project
  73. if (!empty($conf->project->enabled)) {
  74. $langs->load("projects");
  75. //$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
  76. $morehtmlref .= $langs->trans('Project').': ';
  77. if (!empty($object->fk_project)) {
  78. $proj = new Project($db);
  79. $proj->fetch($object->fk_project);
  80. $morehtmlref .= ' : '.$proj->getNomUrl(1);
  81. if ($proj->title) {
  82. $morehtmlref .= ' - '.$proj->title;
  83. }
  84. } else {
  85. $morehtmlref .= '';
  86. }
  87. }
  88. $morehtmlref .= '</div>';
  89. dol_banner_tab($object, 'id', $linkback, ($user->socid ? 0 : 1), 'id', 'ref', $morehtmlref);
  90. print '<div class="underbanner clearboth"></div>';
  91. print '<br>';
  92. print '<table width="100%"><tr><td>';
  93. dol_print_object_info($object);
  94. print '</td></tr></table>';
  95. print dol_get_fiche_end();
  96. // End of page
  97. llxFooter();
  98. $db->close();