dolibarr/htdocs/compta/deplacement/card.php

583 lines
20 KiB
PHP
Raw Normal View History

<?php
2011-10-23 14:55:37 +02:00
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
2018-10-27 14:43:12 +02:00
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
2012-03-27 09:56:37 +02:00
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
2018-09-09 09:56:33 +02:00
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
2019-12-08 22:45:10 +01:00
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
2012-03-18 19:23:01 +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
* (at your option) any later version.
2012-03-18 19:23:01 +01:00
*
* 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.
2012-03-18 19:23:01 +01:00
*
* 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/>.
*/
2005-04-27 23:53:41 +02:00
/**
2018-09-09 09:56:33 +02:00
* \file htdocs/compta/deplacement/card.php
* \brief Page to show a trip card
2008-11-15 22:18:40 +01:00
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/trip.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (!empty($conf->projet->enabled))
{
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
2003-09-02 19:41:30 +02:00
2018-05-27 09:27:09 +02:00
// Load translation files required by the page
2005-04-27 23:53:41 +02:00
$langs->load("trips");
2008-02-25 17:30:43 +01:00
// Security check
$id = GETPOST('id', 'int');
if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'deplacement', $id, '');
2005-04-27 23:53:41 +02:00
$action = GETPOST('action', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
2003-09-02 19:41:30 +02:00
2011-10-23 14:55:37 +02:00
$object = new Deplacement($db);
2017-06-10 12:56:28 +02:00
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('tripsandexpensescard', 'globalcard'));
$permissionnote = $user->rights->deplacement->creer; // Used by the include of actions_setnotes.inc.php
2005-04-27 23:53:41 +02:00
/*
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
if ($action == 'validate' && $user->rights->deplacement->creer)
{
$object->fetch($id);
2019-12-08 22:45:10 +01:00
if ($object->statut == Deplacement::STATUS_DRAFT)
{
$result = $object->setStatut(1);
if ($result > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
exit;
}
else
{
2015-11-12 11:59:15 +01:00
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
2019-01-27 10:49:34 +01:00
elseif ($action == 'classifyrefunded' && $user->rights->deplacement->creer)
{
$object->fetch($id);
2019-12-08 22:45:10 +01:00
if ($object->statut == Deplacement::STATUS_VALIDATED)
{
2019-12-08 22:45:10 +01:00
$result = $object->setStatut(Deplacement::STATUS_REFUNDED);
if ($result > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
exit;
}
else
{
2015-11-12 11:59:15 +01:00
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
2019-01-27 10:49:34 +01:00
elseif ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->deplacement->supprimer)
2003-09-03 02:26:19 +02:00
{
$result = $object->delete($id);
if ($result >= 0)
{
2012-08-31 05:58:38 +02:00
header("Location: index.php");
exit;
}
else
{
2015-11-12 11:59:15 +01:00
setEventMessages($object->error, $object->errors, 'errors');
}
2003-09-03 02:26:19 +02:00
}
2019-01-27 10:49:34 +01:00
elseif ($action == 'add' && $user->rights->deplacement->creer)
2003-09-02 19:41:30 +02:00
{
if (!GETPOST('cancel', 'alpha'))
{
$error = 0;
2019-12-08 22:45:10 +01:00
$object->date = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
$object->km = price2num(GETPOST('km', 'alpha'), 'MU'); // Not 'int', it may be a formated amount
2019-12-08 22:45:10 +01:00
$object->type = GETPOST('type', 'alpha');
$object->socid = (int) GETPOST('socid', 'int');
$object->fk_user = (int) GETPOST('fk_user', 'int');
$object->note_private = GETPOST('note_private', 'alpha');
$object->note_public = GETPOST('note_public', 'alpha');
2019-12-08 22:45:10 +01:00
$object->statut = Deplacement::STATUS_DRAFT;
2008-11-15 22:18:40 +01:00
if (!$object->date)
{
2015-10-17 16:18:33 +02:00
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
$error++;
}
2015-02-21 15:18:05 +01:00
if ($object->type == '-1')
{
2015-10-17 16:18:33 +02:00
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
$error++;
}
if (!($object->fk_user > 0))
{
2015-10-17 16:18:33 +02:00
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Person")), null, 'errors');
$error++;
}
if (!$error)
{
$id = $object->create($user);
if ($id > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
exit;
}
else
{
2015-11-12 11:59:15 +01:00
setEventMessages($object->error, $object->errors, 'errors');
$action = 'create';
}
}
else
{
$action = 'create';
}
}
else
{
2012-08-31 05:58:38 +02:00
header("Location: index.php");
exit;
}
2003-09-02 19:41:30 +02:00
}
// Update record
2019-01-27 10:49:34 +01:00
elseif ($action == 'update' && $user->rights->deplacement->creer)
2003-09-02 19:41:30 +02:00
{
if (!GETPOST('cancel', 'alpha'))
{
$result = $object->fetch($id);
$object->date = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
$object->km = price2num(GETPOST('km', 'alpha'), 'MU'); // Not 'int', it may be a formated amount
$object->type = GETPOST('type', 'alpha');
2019-12-08 22:45:10 +01:00
$object->socid = (int) GETPOST('socid', 'int');
$object->fk_user = (int) GETPOST('fk_user', 'int');
$object->note_private = GETPOST('note_private', 'alpha');
$object->note_public = GETPOST('note_public', 'alpha');
$result = $object->update($user);
if ($result > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
exit;
}
else
{
2015-11-12 11:59:15 +01:00
setEventMessages($object->error, $object->errors, 'errors');
}
}
else
{
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
exit;
}
2003-09-02 19:41:30 +02:00
}
// Set into a project
2019-01-27 10:49:34 +01:00
elseif ($action == 'classin' && $user->rights->deplacement->creer)
{
$object->fetch($id);
$result = $object->setProject(GETPOST('projectid', 'int'));
if ($result < 0) dol_print_error($db, $object->error);
}
// Set fields
2019-01-27 10:49:34 +01:00
elseif ($action == 'setdated' && $user->rights->deplacement->creer)
{
$dated = dol_mktime(GETPOST('datedhour', 'int'), GETPOST('datedmin', 'int'), GETPOST('datedsec', 'int'), GETPOST('datedmonth', 'int'), GETPOST('datedday', 'int'), GETPOST('datedyear', 'int'));
$object->fetch($id);
$result = $object->setValueFrom('dated', $dated, '', '', 'date', '', $user, 'DEPLACEMENT_MODIFY');
if ($result < 0) dol_print_error($db, $object->error);
}
2019-01-27 10:49:34 +01:00
elseif ($action == 'setkm' && $user->rights->deplacement->creer)
2011-11-05 18:25:04 +01:00
{
$object->fetch($id);
$result = $object->setValueFrom('km', GETPOST('km', 'int'), '', null, 'text', '', $user, 'DEPLACEMENT_MODIFY');
2011-11-05 18:25:04 +01:00
if ($result < 0) dol_print_error($db, $object->error);
}
2003-09-02 19:41:30 +02:00
/*
* View
*/
2005-04-27 23:53:41 +02:00
2003-09-02 19:41:30 +02:00
llxHeader();
2011-10-27 10:15:49 +02:00
$form = new Form($db);
2005-04-27 23:53:41 +02:00
2003-09-02 19:41:30 +02:00
/*
2005-04-27 23:53:41 +02:00
* Action create
*/
2011-10-23 14:55:37 +02:00
if ($action == 'create')
2003-09-02 19:41:30 +02:00
{
2012-07-27 21:27:03 +02:00
//WYSIWYG Editor
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
2012-07-27 21:27:03 +02:00
print load_fiche_titre($langs->trans("NewTrip"));
2006-11-11 02:50:38 +01:00
$datec = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="add">';
2008-11-15 22:18:40 +01:00
2019-11-05 21:24:41 +01:00
print '<table class="border centpercent">';
2008-11-15 22:18:40 +01:00
print "<tr>";
2017-06-07 16:44:04 +02:00
print '<td class="fieldrequired">'.$langs->trans("Type").'</td><td>';
$form->select_type_fees(GETPOST('type', 'int'), 'type', 1);
print '</td></tr>';
2008-11-15 22:18:40 +01:00
print "<tr>";
print '<td class="fieldrequired">'.$langs->trans("Person").'</td><td>';
print $form->select_dolusers(GETPOST('fk_user', 'int'), 'fk_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print '</td></tr>';
2008-11-15 22:18:40 +01:00
print "<tr>";
print '<td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
print $form->selectDate($datec ? $datec : -1, '', '', '', '', 'add', 1, 1);
print '</td></tr>';
2008-11-15 22:18:40 +01:00
// Km
print '<tr><td class="fieldrequired">'.$langs->trans("FeesKilometersOrAmout").'</td><td><input name="km" size="10" value="'.GETPOST("km").'"></td></tr>';
2011-06-29 19:55:32 +02:00
// Company
print "<tr>";
print '<td>'.$langs->trans("CompanyVisited").'</td><td>';
print $form->select_company(GETPOST('socid', 'int'), 'socid', '', 1);
print '</td></tr>';
// Public note
print '<tr>';
2017-05-29 10:58:41 +02:00
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
2017-06-07 16:44:04 +02:00
print '<td>';
2020-03-19 21:13:15 +01:00
$doleditor = new DolEditor('note_public', GETPOST('note_public', 'restricthtml'), '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '90%');
print $doleditor->Create(1);
2012-07-27 21:27:03 +02:00
print '</td></tr>';
// Private note
if (empty($user->socid))
{
print '<tr>';
2017-05-29 10:58:41 +02:00
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
2017-06-07 16:44:04 +02:00
print '<td>';
2020-03-19 21:13:15 +01:00
$doleditor = new DolEditor('note_private', GETPOST('note_private', 'restricthtml'), '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '90%');
print $doleditor->Create(1);
2012-07-27 21:27:03 +02:00
print '</td></tr>';
}
// Other attributes
$parameters = array();
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
2017-06-11 10:37:58 +02:00
print $hookmanager->resPrint;
2011-06-29 19:55:32 +02:00
print '</table>';
2014-11-25 20:13:43 +01:00
print '<br><div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
print '</form>';
2003-09-02 19:41:30 +02:00
}
2019-01-27 10:49:34 +01:00
elseif ($id)
2003-09-02 19:41:30 +02:00
{
$result = $object->fetch($id);
if ($result > 0)
{
$head = trip_prepare_head($object);
dol_fiche_head($head, 'card', $langs->trans("TripCard"), 0, 'trip');
if ($action == 'edit' && $user->rights->deplacement->creer)
{
2012-07-27 21:27:03 +02:00
//WYSIWYG Editor
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
2012-07-27 21:27:03 +02:00
$soc = new Societe($db);
if ($object->socid)
{
$soc->fetch($object->socid);
}
print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="id" value="'.$id.'">';
2019-11-05 21:24:41 +01:00
print '<table class="border centpercent">';
// Ref
print "<tr>";
2017-06-07 16:44:04 +02:00
print '<td class="titlefield">'.$langs->trans("Ref").'</td><td>';
print $object->ref;
print '</td></tr>';
// Type
print "<tr>";
print '<td class="fieldrequired">'.$langs->trans("Type").'</td><td>';
$form->select_type_fees(GETPOST('type', 'int') ?GETPOST('type', 'int') : $object->type, 'type', 0);
print '</td></tr>';
// Who
print "<tr>";
print '<td class="fieldrequired">'.$langs->trans("Person").'</td><td>';
print $form->select_dolusers(GETPOST('fk_user', 'int') ?GETPOST('fk_user', 'int') : $object->fk_user, 'fk_user', 0, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print '</td></tr>';
// Date
print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
2018-09-09 09:56:33 +02:00
print $form->selectDate($object->date, '', 0, 0, 0, 'update', 1, 0);
print '</td></tr>';
// Km
print '<tr><td class="fieldrequired">'.$langs->trans("FeesKilometersOrAmout").'</td><td>';
print '<input name="km" class="flat" size="10" value="'.$object->km.'">';
print '</td></tr>';
// Where
print "<tr>";
print '<td>'.$langs->trans("CompanyVisited").'</td><td>';
print $form->select_company($soc->id, 'socid', '', 1);
print '</td></tr>';
// Public note
2017-01-22 12:13:32 +01:00
print '<tr><td class="tdtop">'.$langs->trans("NotePublic").'</td>';
2017-06-07 16:44:04 +02:00
print '<td>';
2012-07-27 21:27:03 +02:00
2016-11-25 17:47:47 +01:00
$doleditor = new DolEditor('note_public', $object->note_public, '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '90%');
print $doleditor->Create(1);
print "</td></tr>";
// Private note
if (empty($user->socid))
{
2017-01-22 12:13:32 +01:00
print '<tr><td class="tdtop">'.$langs->trans("NotePrivate").'</td>';
2017-06-07 16:44:04 +02:00
print '<td>';
2012-07-27 21:27:03 +02:00
2016-11-25 17:47:47 +01:00
$doleditor = new DolEditor('note_private', $object->note_private, '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '90%');
print $doleditor->Create(1);
2012-07-27 21:27:03 +02:00
print "</td></tr>";
}
// Other attributes
$parameters = array();
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
2017-06-11 10:37:58 +02:00
print $hookmanager->resPrint;
print '</table>';
2014-11-25 20:13:43 +01:00
print '<br><div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
2014-11-25 20:13:43 +01:00
print '</div>';
print '</form>';
print '</div>';
}
else
{
2019-10-26 14:42:25 +02:00
/*
* Confirm delete trip
*/
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("DeleteTrip"), $langs->trans("ConfirmDeleteTrip"), "confirm_delete");
}
$soc = new Societe($db);
if ($object->socid) $soc->fetch($object->socid);
2019-11-05 21:24:41 +01:00
print '<table class="border centpercent">';
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/deplacement/list.php'.(!empty($socid) ? '?socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
2012-07-28 21:22:59 +02:00
// Ref
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>';
print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
print '</td></tr>';
$form->load_cache_types_fees();
// Type
print '<tr><td>';
2020-04-12 18:59:22 +02:00
print $form->editfieldkey("Type", 'type', $langs->trans($object->type), $object, $user->rights->deplacement->creer, 'select:types_fees');
print '</td><td>';
2020-04-12 18:59:22 +02:00
print $form->editfieldval("Type", 'type', $form->cache_types_fees[$object->type], $object, $user->rights->deplacement->creer, 'select:types_fees');
print '</td></tr>';
// Who
print '<tr><td>'.$langs->trans("Person").'</td><td>';
$userfee = new User($db);
$userfee->fetch($object->fk_user);
print $userfee->getNomUrl(1);
print '</td></tr>';
// Date
print '<tr><td>';
2020-04-12 18:59:22 +02:00
print $form->editfieldkey("Date", 'dated', $object->date, $object, $user->rights->deplacement->creer, 'datepicker');
print '</td><td>';
2020-04-12 18:59:22 +02:00
print $form->editfieldval("Date", 'dated', $object->date, $object, $user->rights->deplacement->creer, 'datepicker');
print '</td></tr>';
// Km/Price
2017-01-22 12:13:32 +01:00
print '<tr><td class="tdtop">';
2020-04-12 18:59:22 +02:00
print $form->editfieldkey("FeesKilometersOrAmout", 'km', $object->km, $object, $user->rights->deplacement->creer, 'numeric:6');
print '</td><td>';
2020-04-12 18:59:22 +02:00
print $form->editfieldval("FeesKilometersOrAmout", 'km', $object->km, $object, $user->rights->deplacement->creer, 'numeric:6');
print "</td></tr>";
// Where
print '<tr><td>'.$langs->trans("CompanyVisited").'</td>';
print '<td>';
if ($soc->id) print $soc->getNomUrl(1);
print '</td></tr>';
// Project
if (!empty($conf->projet->enabled))
{
$langs->load('projects');
print '<tr>';
print '<td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Project');
print '</td>';
if ($action != 'classify' && $user->rights->deplacement->creer)
{
2019-02-04 13:51:39 +01:00
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=classify&amp;id='.$object->id.'">';
print img_edit($langs->trans('SetProject'), 1);
print '</a></td>';
}
print '</tr></table>';
print '</td><td colspan="3">';
if ($action == 'classify')
{
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1);
}
else
{
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0);
}
print '</td>';
print '</tr>';
}
// Statut
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
2012-03-18 19:23:01 +01:00
2017-06-07 16:44:04 +02:00
// Other attributes
$parameters = array('socid'=>$object->id);
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
print "</table><br>";
2012-03-18 19:23:01 +01:00
// Notes
2012-07-02 19:30:37 +02:00
$blocname = 'notes';
$title = $langs->trans('Notes');
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
print '</div>';
/*
* Barre d'actions
*/
print '<div class="tabsAction">';
2019-12-08 22:45:10 +01:00
if ($object->statut < Deplacement::STATUS_REFUNDED) // if not refunded
{
if ($user->rights->deplacement->creer)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&id='.$id.'">'.$langs->trans('Modify').'</a>';
}
else
{
2018-11-13 21:40:17 +01:00
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans('Modify').'</a>';
}
}
2019-12-08 22:45:10 +01:00
if ($object->statut == Deplacement::STATUS_DRAFT) // if draft
{
if ($user->rights->deplacement->creer)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=validate&id='.$id.'">'.$langs->trans('Validate').'</a>';
}
else
{
2018-11-13 21:40:17 +01:00
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans('Validate').'</a>';
}
}
2019-12-08 22:45:10 +01:00
if ($object->statut == Deplacement::STATUS_VALIDATED) // if validated
{
if ($user->rights->deplacement->creer)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=classifyrefunded&id='.$id.'">'.$langs->trans('ClassifyRefunded').'</a>';
}
else
{
2018-11-13 21:40:17 +01:00
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans('ClassifyRefunded').'</a>';
}
}
if ($user->rights->deplacement->supprimer)
{
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&id='.$id.'">'.$langs->trans('Delete').'</a>';
}
else
{
2018-11-13 21:40:17 +01:00
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans('Delete').'</a>';
}
print '</div>';
}
}
else
{
dol_print_error($db);
}
2003-09-02 19:41:30 +02:00
}
2003-09-03 02:26:19 +02:00
2018-07-30 17:28:44 +02:00
// End of page
llxFooter();
2013-01-24 12:16:00 +01:00
$db->close();