Skip to content

Commit

Permalink
Merge branch 'develop' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy authored Mar 7, 2024
2 parents eac3522 + a72e1f0 commit a6881e2
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 18 deletions.
13 changes: 7 additions & 6 deletions dev/setup/pre-commit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ the project: `pre-commit-config.yaml`.

### Installation in your git project

1. Install `pre-commit` tool.\
1. Install pre-commit tool.\
If you do not have python installed, install [python](https://www.python.org) first.\
If you do not have [`pip`](https://pypi.org/project/pip), install that as well.\\

Then you can install pre-commit tool: `python -m pip install pre-commit`.
Then you can install pre-commit tool:
`python3 -m pip install pre-commit`

2. In your local git clone of the project, run `pre-commit install` to add the hooks.\
or copy the file git/hooks/pre-commit manually. (recommended because this file differs
from the file installed with pre-commit install as it redirects output to the error
channel so your IDE will be able to catch the error.
2. In your local git clone of the project, run `pre-commit install` to add the hooks
or copy the file *dev/setup/git/hooks/pre-commit* manually into *.git/hooks/pre-commit*
(recommended because this file may differ from the file installed with the pre-commit install).
The good file redirects output to the error channel so your IDE will be able to catch the error.


### Tips
Expand Down
9 changes: 5 additions & 4 deletions htdocs/eventorganization/class/conferenceorbooth.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,13 +359,14 @@ public function update(User $user, $notrigger = 0)
/**
* Delete object in database
*
* @param int $notrigger false=launch triggers after, true=disable triggers
* @return int Return integer <0 if KO, >0 if OK
* @param User $user User making the delete
* @param int $notrigger false=launch triggers after, true=disable triggers
* @return int Return integer <0 if KO, >0 if OK
*/
public function delete($notrigger = 0)
public function delete($user, $notrigger = 0)
{
//TODO delete attendees and subscription
return parent::delete($notrigger);
return parent::delete($user, $notrigger);
}

/**
Expand Down
13 changes: 8 additions & 5 deletions htdocs/fourn/class/fournisseur.commande.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2316,6 +2316,8 @@ public function dispatchProduct($user, $product, $qty, $entrepot, $price = 0, $c
*/
public function deleteLine($idline, $notrigger = 0)
{
global $user;

if ($this->statut == 0) {
$line = new CommandeFournisseurLigne($this->db);

Expand All @@ -2333,12 +2335,11 @@ public function deleteLine($idline, $notrigger = 0)
}
}

if ($line->delete($notrigger) > 0) {
if ($line->delete($user, $notrigger) > 0) {
$this->update_price(1);
return 1;
} else {
$this->error = $line->error;
$this->errors = $line->errors;
$this->setErrorsFromObject($line);
return -1;
}
} else {
Expand Down Expand Up @@ -4162,9 +4163,11 @@ public function update($notrigger = 0)
* @param int $notrigger 1=Disable call to triggers
* @return int Return integer <0 if KO, >0 if OK
*/
public function delete($notrigger = 0)
public function delete($user, $notrigger = 0)
{
global $user;
if (empty($user)) {
global $user;
}

$error = 0;

Expand Down
1 change: 0 additions & 1 deletion htdocs/hrm/class/establishment.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ public function fetch($id)
* Delete record
*
* @param User $user User making the change
* @param int $id Id of record to delete
* @return int Return integer <0 if KO, >0 if OK
*/
public function delete($user)
Expand Down
2 changes: 1 addition & 1 deletion htdocs/langs/en_US/admin.lang
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ Module2200Desc=Use maths expressions for auto-generation of prices
Module2300Name=Scheduled jobs
Module2300Desc=Scheduled jobs management (alias cron or chrono table)
Module2400Name=Events/Agenda
Module2400Desc=Track events. Log automatic events for tracking purposes or record manual events or meetings. This is the principal module for good Customer or Vendor Relationship Management.
Module2400Desc=Manage manual and automatic events. Provide a calendar to record events manually. Log also events automatically for tracking purposes or record manual events or meetings. This is the principal module for good Customer or Vendor Relationship Management.
Module2430Name=Online appointment scheduling
Module2430Desc=Provides an online appointment booking system. This allow anyone to book rendez-vous, according to predefined ranges or availabilities.
Module2500Name=DMS / ECM
Expand Down
3 changes: 2 additions & 1 deletion htdocs/ticket/class/api_tickets.class.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2016 Jean-François Ferry <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
*
* 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
Expand Down Expand Up @@ -410,7 +411,7 @@ public function delete($id)
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}

if (!$this->ticket->delete($user)) {
if (!$this->ticket->delete(DolibarrApiAccess::$user)) {
throw new RestException(500, 'Error when deleting ticket');
}

Expand Down

0 comments on commit a6881e2

Please sign in to comment.