forked from Wavyzz/dolibarr
Merge remote-tracking branch 'upstream/develop' into camelCaps
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
@@ -927,6 +927,15 @@ if ($action == 'create')
|
||||
if ($id > 0)
|
||||
{
|
||||
$result1=$object->fetch($id);
|
||||
if ($result1 <= 0)
|
||||
{
|
||||
$langs->load("errors");
|
||||
print $langs->trans("ErrorRecordNotFound");
|
||||
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
$result2=$object->fetch_thirdparty();
|
||||
$result2=$object->fetch_projet();
|
||||
$result3=$object->fetch_contact();
|
||||
@@ -957,7 +966,7 @@ if ($id > 0)
|
||||
$object->note = GETPOST("note",'none');
|
||||
}
|
||||
|
||||
if ($result1 < 0 || $result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0)
|
||||
if ($result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0)
|
||||
{
|
||||
dol_print_error($db,$object->error);
|
||||
exit;
|
||||
|
||||
@@ -621,7 +621,7 @@ class ActionComm extends CommonObject
|
||||
$this->contact->id = $obj->fk_contact; // deprecated
|
||||
|
||||
$this->fk_element = $obj->elementid;
|
||||
$this->elementid = $obj->elementid;
|
||||
$this->elementid = $obj->elementid;
|
||||
$this->elementtype = $obj->elementtype;
|
||||
|
||||
$this->fetchResources();
|
||||
|
||||
@@ -46,8 +46,8 @@ class AgendaEvents extends DolibarrApi
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
global $db, $conf;
|
||||
$this->db = $db;
|
||||
global $db, $conf;
|
||||
$this->db = $db;
|
||||
$this->actioncomm = new ActionComm($this->db);
|
||||
}
|
||||
|
||||
@@ -99,13 +99,14 @@ class AgendaEvents extends DolibarrApi
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.label:like:'%dol%') and (t.datec:<:'20160101')"
|
||||
* @return array Array of Agenda Events objects
|
||||
*/
|
||||
function index($sortfield = "t.id", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $sqlfilters = '') {
|
||||
function index($sortfield = "t.id", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $sqlfilters = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
$obj_ret = array();
|
||||
|
||||
if (! DolibarrApiAccess::$user->rights->agenda->myactions->read) {
|
||||
throw new RestException(401, "Insuffisant rights to read events");
|
||||
throw new RestException(401, "Insuffisant rights to read events");
|
||||
}
|
||||
|
||||
// case of external user
|
||||
@@ -226,7 +227,8 @@ class AgendaEvents extends DolibarrApi
|
||||
* @return int
|
||||
*/
|
||||
/*
|
||||
function put($id, $request_data = null) {
|
||||
function put($id, $request_data = null)
|
||||
{
|
||||
if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) {
|
||||
throw new RestException(401, "Insuffisant rights to create your Agenda Event");
|
||||
}
|
||||
@@ -319,7 +321,8 @@ class AgendaEvents extends DolibarrApi
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
function _cleanObjectDatas($object) {
|
||||
function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
|
||||
@@ -28,7 +28,11 @@
|
||||
*/
|
||||
class CActionComm
|
||||
{
|
||||
var $error;
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
public $error='';
|
||||
|
||||
var $db;
|
||||
|
||||
var $id;
|
||||
|
||||
Reference in New Issue
Block a user