dolibarr/htdocs/comm/action/info.php

121 lines
4.9 KiB
PHP
Raw Normal View History

2006-03-19 00:20:21 +01:00
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
2010-05-07 21:33:17 +02:00
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
2006-03-19 00:20:21 +01:00
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
2006-03-19 00:20:21 +01:00
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2019-09-23 21:55:30 +02:00
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2006-03-19 00:20:21 +01:00
*/
/**
2009-08-05 19:19:55 +02:00
* \file htdocs/comm/action/info.php
* \ingroup agenda
* \brief Page des informations d'une action
*/
2006-03-19 00:20:21 +01:00
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
2022-06-14 17:53:17 +02:00
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
2006-03-19 00:20:21 +01:00
2018-05-26 19:03:41 +02:00
// Load translation files required by the page
2006-03-19 00:20:21 +01:00
$langs->load("commercial");
$id = GETPOST('id', 'int');
2008-12-03 22:17:51 +01:00
// Security check
2021-02-23 18:59:19 +01:00
if ($user->socid > 0) {
$action = '';
$socid = $user->socid;
2006-03-19 00:20:21 +01:00
}
$result = restrictedArea($user, 'agenda', $id, 'actioncomm&societe', 'myactions|allactions', 'fk_soc', 'id');
2021-03-29 22:43:39 +02:00
if ($user->socid && $socid) {
$result = restrictedArea($user, 'societe', $socid);
}
2006-03-19 00:20:21 +01:00
2009-08-05 19:19:55 +02:00
2006-03-19 00:20:21 +01:00
/*
2009-08-05 19:19:55 +02:00
* View
2006-03-19 00:20:21 +01:00
*/
$form = new Form($db);
2017-09-30 00:30:58 +02:00
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
llxHeader('', $langs->trans("Agenda"), $help_url);
2006-03-19 00:20:21 +01:00
2016-09-19 10:43:30 +02:00
$object = new ActionComm($db);
$object->fetch($id);
$object->info($object->id);
2006-03-19 00:20:21 +01:00
$head = actions_prepare_head($object);
2020-10-22 22:50:03 +02:00
print dol_get_fiche_head($head, 'info', $langs->trans("Action"), -1, 'action');
2006-03-19 00:20:21 +01:00
2022-06-07 18:03:58 +02:00
$linkback = img_picto($langs->trans("BackToList"), 'object_calendarlist', 'class="hideonsmartphone pictoactionview"');
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php">'.$langs->trans("BackToList").'</a>';
2016-09-19 10:43:30 +02:00
// Link to other agenda views
$out = '';
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="hideonsmartphone pictoactionview"');
$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>';
2021-05-18 14:00:29 +02:00
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="hideonsmartphone pictoactionview"');
$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>';
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="hideonsmartphone pictoactionview"');
$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>';
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="hideonsmartphone pictoactionview"');
$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>';
$linkback .= $out;
$morehtmlref = '<div class="refidno">';
// Thirdparty
//$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
2022-06-14 17:53:17 +02:00
if (!empty($conf->project->enabled)) {
$langs->load("projects");
//$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
$morehtmlref .= $langs->trans('Project').': ';
if (!empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
2021-10-29 09:40:38 +02:00
$morehtmlref .= ' : '.$proj->getNomUrl(1);
2021-02-23 18:59:19 +01:00
if ($proj->title) {
$morehtmlref .= ' - '.$proj->title;
}
} else {
$morehtmlref .= '';
}
}
$morehtmlref .= '</div>';
dol_banner_tab($object, 'id', $linkback, ($user->socid ? 0 : 1), 'id', 'ref', $morehtmlref);
2016-09-19 10:43:30 +02:00
print '<div class="underbanner clearboth"></div>';
print '<br>';
2006-03-19 00:20:21 +01:00
print '<table width="100%"><tr><td>';
2016-09-19 10:43:30 +02:00
dol_print_object_info($object);
2006-03-19 00:20:21 +01:00
print '</td></tr></table>';
2020-10-27 18:19:31 +01:00
print dol_get_fiche_end();
2006-03-19 00:20:21 +01:00
2018-07-29 13:40:35 +02:00
// End of page
llxFooter();
$db->close();