dolibarr/htdocs/resource/class/actions_resource.class.php

87 lines
2.2 KiB
PHP
Raw Normal View History

2014-01-02 07:07:43 +01:00
<?php
/* Copyright (C) 2013 Jean-François FERRY <jfefe@aternatik.fr>
*
* 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.
*
* 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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file resource/class/actions_resource.class.php
* \brief Place module actions
*/
2014-03-15 18:28:38 +01:00
/**
* Actions class file for resources
*
* TODO Remove this class and replace a method into commonobject
2014-03-15 18:28:38 +01:00
*/
2014-01-02 07:07:43 +01:00
class ActionsResource
{
var $db;
var $error;
var $errors=array();
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
function __construct($db)
{
$this->db = $db;
}
2014-03-15 18:28:38 +01:00
/**
2014-03-15 22:31:11 +01:00
* doActions for resource module
*
* @param array $parameters parameters
2014-09-27 16:00:11 +02:00
* @param Object $object object
* @param string $action action
* @return void
2014-03-15 18:28:38 +01:00
*/
/* Why a hook action ? TODO Remove this class and replace a method into commonobject
function doActions($parameters, &$object, &$action)
2014-03-15 22:31:11 +01:00
{
2014-01-02 07:07:43 +01:00
global $langs,$user;
2014-03-15 21:24:37 +01:00
$langs->load('resource');
2014-05-11 12:12:17 +02:00
if (in_array('resource_card',explode(':',$parameters['context'])))
{
if($action == 'confirm_delete_resource' && !GETPOST('cancel'))
{
$res = $object->fetch(GETPOST('id'));
if($res)
{
2014-05-11 12:12:17 +02:00
$result = $object->delete(GETPOST('id'));
2014-05-11 12:12:17 +02:00
if ($result >= 0)
{
setEventMessage($langs->trans('RessourceSuccessfullyDeleted'));
Header("Location: list.php");
2014-05-11 12:12:17 +02:00
exit;
}
else {
setEventMessage($object->error,'errors');
}
}
else
{
setEventMessage($object->error,'errors');
}
}
}
}*/
2014-01-02 07:07:43 +01:00
}