dolibarr/htdocs/comm/action/info.php

119 lines
5.0 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
2011-08-01 00:21:57 +02:00
* along with this program. If not, see <http://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';
if (! empty($conf->projet->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
2009-02-19 20:06:12 +01:00
if ($user->societe_id > 0)
2006-03-19 00:20:21 +01:00
{
$action = '';
$socid = $user->societe_id;
2006-03-19 00:20:21 +01:00
}
$result = restrictedArea($user, 'agenda', $id, 'actioncomm&societe', 'myactions|allactions', 'fk_soc', 'id');
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
*/
2017-09-30 00:30:58 +02:00
$form=new Form($db);
2010-05-07 21:33:17 +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
2016-09-19 10:43:30 +02:00
$head=actions_prepare_head($object);
2017-03-31 14:21:51 +02:00
dol_fiche_head($head, 'info', $langs->trans("Action"), -1, 'action');
2006-03-19 00:20:21 +01:00
2016-09-19 10:43:30 +02:00
$linkback = img_picto($langs->trans("BackToList"),'object_list','class="hideonsmartphone pictoactionview"');
$linkback.= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php">'.$langs->trans("BackToList").'</a>';
// Link to other agenda views
$out='';
2017-09-30 00:30:58 +02:00
$out.='</li><li class="noborder litext">'.img_picto($langs->trans("ViewPerUser"),'object_calendarperuser','class="hideonsmartphone pictoactionview"');
2016-09-19 10:43:30 +02:00
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=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>';
2017-09-30 00:30:58 +02:00
$out.='</li><li class="noborder litext">'.img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone pictoactionview"');
2016-09-19 10:43:30 +02:00
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=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>';
2017-09-30 00:30:58 +02:00
$out.='</li><li class="noborder litext">'.img_picto($langs->trans("ViewWeek"),'object_calendarweek','class="hideonsmartphone pictoactionview"');
2016-09-19 10:43:30 +02:00
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=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>';
2017-09-30 00:30:58 +02:00
$out.='</li><li class="noborder litext">'.img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone pictoactionview"');
2016-09-19 10:43:30 +02:00
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=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
if (! empty($conf->projet->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);
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
$morehtmlref.=$proj->ref;
$morehtmlref.='</a>';
if ($proj->title) $morehtmlref.=' - '.$proj->title;
} else {
$morehtmlref.='';
}
}
$morehtmlref.='</div>';
dol_banner_tab($object, 'id', $linkback, ($user->societe_id?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>';
2016-09-19 10:43:30 +02:00
dol_fiche_end();
2006-03-19 00:20:21 +01:00
llxFooter();
$db->close();