mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-14 08:54:21 +01:00
Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into 19.0
This commit is contained in:
@@ -313,23 +313,23 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
// Label
|
||||
print '<tr><td class="tdtop">';
|
||||
print $form->editfieldkey("Label", 'label', $object->label, $object, 1, 'alpha:32');
|
||||
print $form->editfieldkey("Label", 'label', $object->label, $object, 0, 'alpha:32');
|
||||
print '</td><td colspan="2">';
|
||||
print $form->editfieldval("Label", 'label', $object->label, $object, 1, 'alpha:32');
|
||||
print $form->editfieldval("Label", 'label', $object->label, $object, 0, 'alpha:32');
|
||||
print "</td></tr>";
|
||||
|
||||
// Date start
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey("DateStart", 'date_start', $object->date_start, $object, 1, 'datepicker');
|
||||
print $form->editfieldkey("DateStart", 'date_start', $object->date_start, $object, 0, 'datepicker');
|
||||
print '</td><td colspan="2">';
|
||||
print $form->editfieldval("DateStart", 'date_start', $object->date_start, $object, 1, 'datepicker');
|
||||
print $form->editfieldval("DateStart", 'date_start', $object->date_start, $object, 0, 'datepicker');
|
||||
print '</td></tr>';
|
||||
|
||||
// Date end
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey("DateEnd", 'date_end', $object->date_end, $object, 1, 'datepicker');
|
||||
print $form->editfieldkey("DateEnd", 'date_end', $object->date_end, $object, 0, 'datepicker');
|
||||
print '</td><td colspan="2">';
|
||||
print $form->editfieldval("DateEnd", 'date_end', $object->date_end, $object, 1, 'datepicker');
|
||||
print $form->editfieldval("DateEnd", 'date_end', $object->date_end, $object, 0, 'datepicker');
|
||||
print '</td></tr>';
|
||||
|
||||
// Status
|
||||
|
||||
@@ -204,6 +204,8 @@ if ($action == "confirm_update") {
|
||||
$result = $object->createStd($user, false, $mode);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
|
||||
$action = 'create';
|
||||
} else {
|
||||
if ($mode != '_tmp') {
|
||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||
@@ -404,6 +406,7 @@ if ($action == 'create') {
|
||||
print '</form>';
|
||||
} else {
|
||||
$object = new BookKeeping($db);
|
||||
|
||||
$result = $object->fetchPerMvt($piece_num, $mode);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
|
||||
@@ -758,11 +758,10 @@ class BookKeeping extends CommonObject
|
||||
/**
|
||||
* Load object in memory from the database
|
||||
*
|
||||
* @param int $id Id object
|
||||
* @param string $ref Ref
|
||||
* @param string $mode Mode
|
||||
*
|
||||
* @return int Return integer <0 if KO, 0 if not found, >0 if OK
|
||||
* @param int $id Id object
|
||||
* @param string $ref Ref
|
||||
* @param string $mode Mode ('' or 'tmp_')
|
||||
* @return int Return integer <0 if KO, 0 if not found, >0 if OK
|
||||
*/
|
||||
public function fetch($id, $ref = null, $mode = '')
|
||||
{
|
||||
@@ -1491,17 +1490,18 @@ class BookKeeping extends CommonObject
|
||||
/**
|
||||
* Delete object in database
|
||||
*
|
||||
* @param User $user User that deletes
|
||||
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||
* @param string $mode Mode
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
* @param User $user User that deletes
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @param string $mode Mode ('' or 'tmp_')
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function delete(User $user, $notrigger = false, $mode = '')
|
||||
public function delete(User $user, $notrigger = 0, $mode = '')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
$result = $this->canModifyBookkeeping($this->id);
|
||||
$result = $this->canModifyBookkeeping($this->id, $mode);
|
||||
if ($result < 0) {
|
||||
return -1;
|
||||
} elseif ($result == 0) {
|
||||
@@ -2303,9 +2303,10 @@ class BookKeeping extends CommonObject
|
||||
* Is the bookkeeping can be modified or deleted ?
|
||||
*
|
||||
* @param int $id Bookkeeping ID
|
||||
* @param string $mode Mode ('' or 'tmp_')
|
||||
* @return int Return integer <0 if KO, == 0 if No, == 1 if Yes
|
||||
*/
|
||||
public function canModifyBookkeeping($id)
|
||||
public function canModifyBookkeeping($id, $mode = '')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@@ -2317,7 +2318,7 @@ class BookKeeping extends CommonObject
|
||||
}
|
||||
|
||||
$bookkeeping = new BookKeeping($this->db);
|
||||
$result = $bookkeeping->fetch($id);
|
||||
$result = $bookkeeping->fetch($id, null, $mode);
|
||||
if ($result <= 0) {
|
||||
return $result;
|
||||
}
|
||||
@@ -2338,7 +2339,7 @@ class BookKeeping extends CommonObject
|
||||
}
|
||||
|
||||
$bookkeeping = new BookKeeping($this->db);
|
||||
$result = $bookkeeping->fetch($id);
|
||||
$result = $bookkeeping->fetch($id, null, $mode);
|
||||
if ($result <= 0) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -460,7 +460,7 @@ if ($id > 0 || $ref) {
|
||||
if ($salaryBonPl) {
|
||||
$sql = "SELECT pl.rowid, pl.statut, pl.amount, pl.fk_user,";
|
||||
$sql .= " u.rowid as socid, u.login as name";
|
||||
$sql .=" FROM llx_prelevement_lignes as pl";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."prelevement_bons as pb";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."user as u";
|
||||
$sql .= " WHERE pl.fk_prelevement_bons = ".((int) $id);
|
||||
|
||||
Reference in New Issue
Block a user