Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/contrat/list.php
	htdocs/install/mysql/tables/llx_partnership.key.sql
This commit is contained in:
Laurent Destailleur 2022-03-19 17:34:26 +01:00
commit 8603d493ad
25 changed files with 141 additions and 99 deletions

View File

@ -358,7 +358,7 @@ class Members extends DolibarrApi
if ($member->update(DolibarrApiAccess::$user) >= 0) {
return $this->get($id);
} else {
throw new RestException(500, $member->error);
throw new RestException(500, 'Error when updating member: '.$member->error);
}
}

View File

@ -204,7 +204,7 @@ class MembersTypes extends DolibarrApi
if ($membertype->update(DolibarrApiAccess::$user) >= 0) {
return $this->get($id);
} else {
throw new RestException(500, $membertype->error);
throw new RestException(500, 'Error when updating member type: '.$membertype->error);
}
}

View File

@ -159,7 +159,7 @@ class Subscriptions extends DolibarrApi
$subscription->$field = $value;
}
if ($subscription->create(DolibarrApiAccess::$user) < 0) {
throw new RestException(500, 'Error when creating subscription', array_merge(array($subscription->error), $subscription->errors));
throw new RestException(500, 'Error when creating contribution', array_merge(array($subscription->error), $subscription->errors));
}
return $subscription->id;
}
@ -193,7 +193,7 @@ class Subscriptions extends DolibarrApi
if ($subscription->update(DolibarrApiAccess::$user) > 0) {
return $this->get($id);
} else {
throw new RestException(500, $subscription->error);
throw new RestException(500, 'Error when updating contribution: '.$subscription->error);
}
}

View File

@ -126,7 +126,7 @@ class Documents extends DolibarrApi
* @param string $langcode Language code like 'en_US', 'fr_FR', 'es_ES', ... (If not set, use the default language).
* @return array List of documents
*
* @throws RestException 500
* @throws RestException 500 System error
* @throws RestException 501
* @throws RestException 400
* @throws RestException 401
@ -249,7 +249,7 @@ class Documents extends DolibarrApi
* @throws RestException 400
* @throws RestException 401
* @throws RestException 404
* @throws RestException 500
* @throws RestException 500 System error
*
* @url GET /
*/
@ -546,7 +546,7 @@ class Documents extends DolibarrApi
* @throws RestException 400
* @throws RestException 401
* @throws RestException 404
* @throws RestException 500
* @throws RestException 500 System error
*
* @url POST /upload
*/

View File

@ -1491,6 +1491,10 @@ if ($id > 0) {
$("#fullday").change(function() {
setdatefields();
});
$("#actioncode").change(function() {
if ($("#actioncode").val() == \'AC_RDV\') $("#dateend").addClass("fieldrequired");
else $("#dateend").removeClass("fieldrequired");
});
})';
print '</script>'."\n";
}
@ -1535,7 +1539,11 @@ if ($id > 0) {
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3"><input type="checkbox" id="fullday" name="fullday" '.($object->fulldayevent ? ' checked' : '').'></td></tr>';
// Date start - end
print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").' - '.$langs->trans("DateActionEnd").'</span></td><td colspan="3">';
print '<tr><td class="nowrap">';
print '<span class="fieldrequired">'.$langs->trans("DateActionStart").'</span>';
print ' - ';
print '<span id="dateend"'.($object->type_code == 'AC_RDV' ? ' class="fieldrequired"' : '').'>'.$langs->trans("DateActionEnd").'</span>';
print '</td><td td colspan="3">';
$tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
if (GETPOST("afaire") == 1) {
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuser') : 'tzuser');

View File

@ -246,8 +246,11 @@ if (empty($reshook)) {
// Remove line
$result = $object->deleteline($lineid);
// reorder lines
if ($result) {
if ($result > 0) {
$object->line_order(true);
} else {
$langs->load("errors");
setEventMessages($object->error, $object->errors, 'errors');
}
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {

View File

@ -625,7 +625,7 @@ class Proposals extends DolibarrApi
*
* @throws RestException 401
* @throws RestException 404
* @throws RestException 500
* @throws RestException 500 System error
*/
public function deleteContact($id, $contactid, $type)
{
@ -799,7 +799,7 @@ class Proposals extends DolibarrApi
* @throws RestException 304
* @throws RestException 401
* @throws RestException 404
* @throws RestException 500
* @throws RestException 500 System error
*
* @return array
*/

View File

@ -992,6 +992,8 @@ class Propal extends CommonObject
$this->db->commit();
return 1;
} else {
$this->error = $line->error;
$this->errors = $line->errors;
$this->db->rollback();
return -1;
}
@ -4194,36 +4196,40 @@ class PropaleLigne extends CommonObjectLine
$error = 0;
$this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE rowid = ".((int) $this->rowid);
dol_syslog("PropaleLigne::delete", LOG_DEBUG);
if ($this->db->query($sql)) {
// Remove extrafields
if (!$error) {
$this->id = $this->rowid;
$result = $this->deleteExtraFields();
if ($result < 0) {
$error++;
dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR);
}
if (!$notrigger) {
// Call trigger
$result = $this->call_trigger('LINEPROPAL_DELETE', $user);
if ($result < 0) {
$error++;
}
}
// End call triggers
if (!$error && !$notrigger) {
// Call trigger
$result = $this->call_trigger('LINEPROPAL_DELETE', $user);
if ($result < 0) {
$this->db->rollback();
return -1;
if (!$error) {
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "propaldet WHERE rowid = " . ((int) $this->rowid);
dol_syslog("PropaleLigne::delete", LOG_DEBUG);
if ($this->db->query($sql)) {
// Remove extrafields
if (!$error) {
$this->id = $this->rowid;
$result = $this->deleteExtraFields();
if ($result < 0) {
$error++;
dol_syslog(get_class($this) . "::delete error -4 " . $this->error, LOG_ERR);
}
}
} else {
$this->error = $this->db->error() . " sql=" . $sql;
$error++;
}
// End call triggers
}
$this->db->commit();
return 1;
} else {
$this->error = $this->db->error()." sql=".$sql;
if ($error) {
$this->db->rollback();
return -1;
} else {
$this->db->commit();
return 1;
}
}

View File

@ -574,7 +574,7 @@ class Orders extends DolibarrApi
*
* @throws RestException 401
* @throws RestException 404
* @throws RestException 500
* @throws RestException 500 System error
*/
public function deleteContact($id, $contactid, $type)
{
@ -704,7 +704,7 @@ class Orders extends DolibarrApi
* @throws RestException 304
* @throws RestException 401
* @throws RestException 404
* @throws RestException 500
* @throws RestException 500 System error
*
* @return array
*/
@ -974,7 +974,7 @@ class Orders extends DolibarrApi
*
* @throws RestException 401
* @throws RestException 404
* @throws RestException 500
* @throws RestException 500 System error
*/
public function getOrderShipments($id)
{
@ -1030,7 +1030,7 @@ class Orders extends DolibarrApi
*
* @throws RestException 401
* @throws RestException 404
* @throws RestException 500
* @throws RestException 500 System error
*/
public function createOrderShipment($id, $warehouse_id)
{

View File

@ -519,7 +519,7 @@ class Invoices extends DolibarrApi
*
* @throws RestException 401
* @throws RestException 404
* @throws RestException 500
* @throws RestException 500 System error
*/
public function deleteContact($id, $contactid, $type)
{
@ -661,7 +661,7 @@ class Invoices extends DolibarrApi
$result = $this->invoice->delete(DolibarrApiAccess::$user);
if ($result < 0) {
throw new RestException(500);
throw new RestException(500, 'Error when deleting invoice');
}
return array(
@ -780,7 +780,7 @@ class Invoices extends DolibarrApi
* @throws RestException 304
* @throws RestException 401
* @throws RestException 404
* @throws RestException 500
* @throws RestException 500 System error
*
*/
public function addContact($id, $fk_socpeople, $type_contact, $source, $notrigger = 0)
@ -829,7 +829,7 @@ class Invoices extends DolibarrApi
* @throws RestException 304
* @throws RestException 401
* @throws RestException 404
* @throws RestException 500
* @throws RestException 500 System error
*
*/
public function settodraft($id, $idwarehouse = -1)
@ -932,7 +932,7 @@ class Invoices extends DolibarrApi
* @throws RestException 304
* @throws RestException 401
* @throws RestException 404
* @throws RestException 500
* @throws RestException 500 System error
*/
public function settopaid($id, $close_code = '', $close_note = '')
{
@ -982,7 +982,7 @@ class Invoices extends DolibarrApi
* @throws RestException 304
* @throws RestException 401
* @throws RestException 404
* @throws RestException 500
* @throws RestException 500 System error
*/
public function settounpaid($id)
{
@ -1069,7 +1069,7 @@ class Invoices extends DolibarrApi
* @throws RestException 304
* @throws RestException 401
* @throws RestException 404
* @throws RestException 500
* @throws RestException 500 System error
*/
public function markAsCreditAvailable($id)
{

View File

@ -351,7 +351,7 @@ if ($search_dfyear > 0 && $search_op2df) {
}
}
$nbtotalofrecords = 0;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
//$result = $db->query($sql);
//$nbtotalofrecords = $db->num_rows($result);

View File

@ -54,12 +54,21 @@ class DiscountAbsolute
public $fk_soc;
public $discount_type; // 0 => customer discount, 1 => supplier discount
public $amount_ht; //
public $amount_tva; //
public $amount_ttc; //
public $multicurrency_amount_ht;
public $multicurrency_amount_tva;
public $multicurrency_amount_ttc;
public $total_ht;
public $total_tva;
public $total_ttc;
public $amount_ht; // deprecated
public $amount_tva; // deprecated
public $amount_ttc; // deprecated
public $multicurrency_total_ht;
public $multicurrency_total_tva;
public $multicurrency_total_ttc;
public $multicurrency_amount_ht; // deprecated
public $multicurrency_amount_tva; // deprecated
public $multicurrency_amount_ttc; // deprecated
// Vat rate
public $tva_tx;
public $vat_src_code;
@ -163,13 +172,21 @@ class DiscountAbsolute
$this->fk_soc = $obj->fk_soc;
$this->discount_type = $obj->discount_type;
$this->amount_ht = $obj->amount_ht;
$this->amount_tva = $obj->amount_tva;
$this->amount_ttc = $obj->amount_ttc;
$this->total_ht = $obj->amount_ht;
$this->total_tva = $obj->amount_tva;
$this->total_ttc = $obj->amount_ttc;
// For backward compatibility
$this->amount_ht = $this->total_ht;
$this->amount_tva = $this->total_tva;
$this->amount_ttc = $this->total_ttc;
$this->multicurrency_amount_ht = $this->multicurrency_subprice = $obj->multicurrency_amount_ht;
$this->multicurrency_amount_tva = $obj->multicurrency_amount_tva;
$this->multicurrency_amount_ttc = $obj->multicurrency_amount_ttc;
$this->multicurrency_total_ht = $this->multicurrency_subprice = $obj->multicurrency_amount_ht;
$this->multicurrency_total_tva = $obj->multicurrency_amount_tva;
$this->multicurrency_total_ttc = $obj->multicurrency_amount_ttc;
// For backward compatibility
$this->multicurrency_amount_ht = $this->multicurrency_total_ht;
$this->multicurrency_amount_tva = $this->multicurrency_total_tva;
$this->multicurrency_amount_ttc = $this->multicurrency_total_ttc;
$this->tva_tx = $obj->tva_tx;
$this->vat_src_code = $obj->vat_src_code;

View File

@ -897,7 +897,7 @@ class pdf_crabe extends ModelePDFFactures
$tab3_width = 80;
$tab3_height = 4;
if ($this->page_largeur < 210) { // To work with US executive format
$tab3_posx -= 20;
$tab3_posx -= 15;
}
$default_font_size = pdf_getPDFFontSize($outputlangs);
@ -1289,7 +1289,8 @@ class pdf_crabe extends ModelePDFFactures
$col1x = 120;
$col2x = 170;
if ($this->page_largeur < 210) { // To work with US executive format
$col2x -= 20;
$col1x -= 15;
$col2x -= 10;
}
$largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);

View File

@ -540,7 +540,7 @@ class pdf_sponge extends ModelePDFFactures
$pdf->useTemplate($tplidx);
}
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
$this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis);
}
// $this->_pagefoot($pdf,$object,$outputlangs,1);
$pdf->setTopMargin($tab_top_newpage);
@ -598,7 +598,7 @@ class pdf_sponge extends ModelePDFFactures
$pdf->useTemplate($tplidx);
}
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
$this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis);
}
$height_note = $posyafter - $tab_top_newpage;
$pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1);
@ -620,7 +620,7 @@ class pdf_sponge extends ModelePDFFactures
$pdf->useTemplate($tplidx);
}
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
$this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis);
}
$posyafter = $tab_top_newpage;
@ -922,7 +922,7 @@ class pdf_sponge extends ModelePDFFactures
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
$this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis);
}
}
@ -940,7 +940,7 @@ class pdf_sponge extends ModelePDFFactures
}
$pagenb++;
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
$this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis);
}
}
}
@ -1026,7 +1026,7 @@ class pdf_sponge extends ModelePDFFactures
$tab3_width = 80;
$tab3_height = 4;
if ($this->page_largeur < 210) { // To work with US executive format
$tab3_posx -= 20;
$tab3_posx -= 15;
}
$default_font_size = pdf_getPDFFontSize($outputlangs);
@ -1356,7 +1356,8 @@ class pdf_sponge extends ModelePDFFactures
$col1x = 120;
$col2x = 170;
if ($this->page_largeur < 210) { // To work with US executive format
$col2x -= 20;
$col1x -= 15;
$col2x -= 10;
}
$largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);

View File

@ -293,7 +293,7 @@ class Donations extends DolibarrApi
* @throws RestException 304
* @throws RestException 401
* @throws RestException 404
* @throws RestException 500
* @throws RestException 500 System error
*
* @return array
*/

View File

@ -401,7 +401,7 @@ class ExpenseReports extends DolibarrApi
*
* @throws RestException 401 Not allowed
* @throws RestException 404 Expense report not found
* @throws RestException 500
* @throws RestException 500 System error
*/
public function put($id, $request_data = null)
{

View File

@ -211,7 +211,7 @@ class SupplierInvoices extends DolibarrApi
* @return int ID of supplier invoice
*
* @throws RestException 401
* @throws RestException 500
* @throws RestException 500 System error
*/
public function post($request_data = null)
{
@ -283,7 +283,7 @@ class SupplierInvoices extends DolibarrApi
*
* @throws RestException 401
* @throws RestException 404
* @throws RestException 500
* @throws RestException 500 System error
*/
public function delete($id)
{
@ -300,7 +300,7 @@ class SupplierInvoices extends DolibarrApi
}
if ($this->invoice->delete(DolibarrApiAccess::$user) < 0) {
throw new RestException(500);
throw new RestException(500, 'Error when deleting invoice');
}
return array(
@ -326,7 +326,7 @@ class SupplierInvoices extends DolibarrApi
* @throws RestException 401
* @throws RestException 404
* @throws RestException 405
* @throws RestException 500
* @throws RestException 500 System error
*/
public function validate($id, $idwarehouse = 0, $notrigger = 0)
{

View File

@ -309,7 +309,7 @@ class SupplierOrders extends DolibarrApi
}
if ($this->order->delete(DolibarrApiAccess::$user) < 0) {
throw new RestException(500);
throw new RestException(500, 'Error when deleting order');
}
return array(

View File

@ -84,8 +84,8 @@ UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'a
UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'cameleo';
DELETE FROM llx_user_param where param = 'MAIN_THEME' and value in ('auguria', 'amarok', 'cameleo');
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging varchar(64) DEFAULT NULL;
ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN packaging varchar(64) DEFAULT NULL;
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging real DEFAULT NULL;
ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN packaging real DEFAULT NULL;
-- For v14

View File

@ -19,3 +19,6 @@
ALTER TABLE llx_partnership ADD INDEX idx_partnership_entity (entity);
ALTER TABLE llx_partnership ADD UNIQUE INDEX uk_partnership_ref (ref, entity);
ALTER TABLE llx_partnership ADD UNIQUE INDEX uk_fk_type_fk_soc (fk_type, fk_soc, date_partnership_start);
ALTER TABLE llx_partnership ADD UNIQUE INDEX uk_fk_type_fk_member (fk_type, fk_member, date_partnership_start);

View File

@ -742,7 +742,7 @@ class Products extends DolibarrApi
* @param int $fk_barcode_type Barcode type
* @return int
*
* @throws RestException 500
* @throws RestException 500 System error
* @throws RestException 401
*
* @url POST {id}/purchase_prices
@ -1161,7 +1161,7 @@ class Products extends DolibarrApi
* @param string $ref_ext External reference of Attribute
* @return array
*
* @throws RestException 500
* @throws RestException 500 System error
* @throws RestException 401
*
* @url GET attributes/ref_ext/{ref_ext}
@ -1212,7 +1212,7 @@ class Products extends DolibarrApi
* @param string $ref_ext Reference of Attribute
* @return int
*
* @throws RestException 500
* @throws RestException 500 System error
* @throws RestException 401
*
* @url POST attributes
@ -1289,7 +1289,7 @@ class Products extends DolibarrApi
* @param int $id ID of Attribute
* @return int Result of deletion
*
* @throws RestException 500
* @throws RestException 500 System error
* @throws RestException 401
*
* @url DELETE attributes/{id}
@ -1317,7 +1317,7 @@ class Products extends DolibarrApi
* @param int $id ID of Attribute value
* @return array
*
* @throws RestException 500
* @throws RestException 500 System error
* @throws RestException 401
*
* @url GET attributes/values/{id}
@ -1358,7 +1358,7 @@ class Products extends DolibarrApi
* @param string $ref Ref of Attribute value
* @return array
*
* @throws RestException 500
* @throws RestException 500 System error
* @throws RestException 401
*
* @url GET attributes/{id}/values/ref/{ref}
@ -1445,7 +1445,7 @@ class Products extends DolibarrApi
* @return array
*
* @throws RestException 401
* @throws RestException 500
* @throws RestException 500 System error
*
* @url GET attributes/{id}/values
*/
@ -1517,7 +1517,7 @@ class Products extends DolibarrApi
* @param string $value Value of Attribute value
* @return int
*
* @throws RestException 500
* @throws RestException 500 System error
* @throws RestException 401
*
* @url POST attributes/{id}/values
@ -1551,7 +1551,7 @@ class Products extends DolibarrApi
* @return array
*
* @throws RestException 401
* @throws RestException 500
* @throws RestException 500 System error
*
* @url PUT attributes/values/{id}
*/
@ -1596,7 +1596,7 @@ class Products extends DolibarrApi
* @param int $id ID of Attribute value
* @return int
*
* @throws RestException 500
* @throws RestException 500 System error
* @throws RestException 401
*
* @url DELETE attributes/values/{id}
@ -1623,7 +1623,7 @@ class Products extends DolibarrApi
* @param int $includestock Default value 0. If parameter is set to 1 the response will contain stock data of each variant
* @return array
*
* @throws RestException 500
* @throws RestException 500 System error
* @throws RestException 401
*
* @url GET {id}/variants
@ -1659,7 +1659,7 @@ class Products extends DolibarrApi
* @param string $ref Ref of Product
* @return array
*
* @throws RestException 500
* @throws RestException 500 System error
* @throws RestException 401
*
* @url GET ref/{ref}/variants
@ -1701,7 +1701,7 @@ class Products extends DolibarrApi
* @param string $ref_ext External reference of variant
* @return int
*
* @throws RestException 500
* @throws RestException 500 System error
* @throws RestException 401
* @throws RestException 404
*
@ -1758,7 +1758,7 @@ class Products extends DolibarrApi
* @param array $features List of attributes pairs id_attribute->id_value. Example: array(id_color=>id_Blue, id_size=>id_small, id_option=>id_val_a, ...)
* @return int
*
* @throws RestException 500
* @throws RestException 500 System error
* @throws RestException 401
* @throws RestException 404
*
@ -1813,7 +1813,7 @@ class Products extends DolibarrApi
* @param array $request_data Datas
* @return int
*
* @throws RestException 500
* @throws RestException 500 System error
* @throws RestException 401
*
* @url PUT variants/{id}
@ -1847,7 +1847,7 @@ class Products extends DolibarrApi
* @param int $id ID of Variant
* @return int Result of deletion
*
* @throws RestException 500
* @throws RestException 500 System error
* @throws RestException 401
*
* @url DELETE variants/{id}
@ -1875,7 +1875,7 @@ class Products extends DolibarrApi
* @param int $selected_warehouse_id ID of warehouse
* @return int
*
* @throws RestException 500
* @throws RestException 500 System error
* @throws RestException 401
* @throws RestException 404
*

View File

@ -216,7 +216,7 @@ if (empty($reshook)) {
}
}
// Save quantity found during inventory
// Save quantity found during inventory (when we click on Save button on inventory page)
if ($action =='updateinventorylines' && $permissiontoadd) {
$sql = 'SELECT id.rowid, id.datec as date_creation, id.tms as date_modification, id.fk_inventory, id.fk_warehouse,';
$sql .= ' id.fk_product, id.batch, id.qty_stock, id.qty_view, id.qty_regulated';
@ -236,6 +236,9 @@ if (empty($reshook)) {
$line = $db->fetch_object($resql);
$lineid = $line->rowid;
$result = 0;
$resultupdate = 0;
if (GETPOST("id_".$lineid, 'alpha') != '') { // If a value was set ('0' or something else)
$qtytoupdate = price2num(GETPOST("id_".$lineid, 'alpha'), 'MS');
$result = $inventoryline->fetch($lineid);
@ -265,7 +268,7 @@ if (empty($reshook)) {
}
}
// Update line with id of stock movement (and the start quantity if it has changed this last recording)
// Update user that update quantities
if (! $error) {
$sqlupdate = "UPDATE ".MAIN_DB_PREFIX."inventory";
$sqlupdate .= " SET fk_user_modif = ".((int) $user->id);

View File

@ -1409,7 +1409,7 @@ class Thirdparties extends DolibarrApi
if ($result > 0) {
return array("success" => $result);
} else {
throw new RestException(500);
throw new RestException(500, 'Error generating the document '.$this->error);
}
}

View File

@ -377,7 +377,7 @@ class Tickets extends DolibarrApi
}
$this->ticket->message = $ticketMessageText;
if (!$this->ticket->createTicketMessage(DolibarrApiAccess::$user)) {
throw new RestException(500);
throw new RestException(500, 'Error when creating ticket');
}
return $this->ticket->id;
}
@ -438,7 +438,7 @@ class Tickets extends DolibarrApi
}
if (!$this->ticket->delete($id)) {
throw new RestException(500);
throw new RestException(500, 'Error when deleting ticket');
}
return array(

View File

@ -466,7 +466,7 @@ class Users extends DolibarrApi
*
* @throws RestException 401 Not allowed
* @throws RestException 404 User not found
* @throws RestException 500 Error
* @throws RestException 500 System error
*
* @url GET {id}/setGroup/{group}
*/