Update api_boms.class.php

public function update(User $user, $notrigger = false)
This commit is contained in:
Frédéric FRANCE 2020-10-31 09:22:02 +01:00 committed by GitHub
parent f7172a9a3c
commit 9b10de3a8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> /* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2019 Maxime Kohlhaas <maxime@atm-consulting.fr> * Copyright (C) 2019 Maxime Kohlhaas <maxime@atm-consulting.fr>
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -131,8 +132,7 @@ class Boms extends DolibarrApi
} }
if ($sqlfilters) if ($sqlfilters)
{ {
if (!DolibarrApi::_checkFilters($sqlfilters)) if (!DolibarrApi::_checkFilters($sqlfilters)) {
{
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters); throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
} }
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; $regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@ -224,8 +224,7 @@ class Boms extends DolibarrApi
$this->bom->$field = $value; $this->bom->$field = $value;
} }
if ($this->bom->update($id, DolibarrApiAccess::$user) > 0) if ($this->bom->update(DolibarrApiAccess::$user) > 0) {
{
return $this->get($id); return $this->get($id);
} else { } else {
throw new RestException(500, $this->bom->error); throw new RestException(500, $this->bom->error);