Add field to store version of encoding of line in blockedlog
This commit is contained in:
parent
39fba83f26
commit
398812afa5
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 ATM Consulting <contact@atm-consulting.fr>
|
||||
* Copyright (C) 2017 Laurent Destailleur <eldy@destailleur.fr>
|
||||
/* Copyright (C) 2017 ATM Consulting <contact@atm-consulting.fr>
|
||||
* Copyright (C) 2017-2020 Laurent Destailleur <eldy@destailleur.fr>
|
||||
*
|
||||
* 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
|
||||
@ -115,6 +115,8 @@ class BlockedLog
|
||||
public $ref_object = '';
|
||||
|
||||
public $object_data = null;
|
||||
public $object_version = '';
|
||||
|
||||
public $user_fullname = '';
|
||||
|
||||
/**
|
||||
@ -674,7 +676,7 @@ class BlockedLog
|
||||
$langs->load("blockedlog");
|
||||
|
||||
$sql = "SELECT b.rowid, b.date_creation, b.signature, b.signature_line, b.amounts, b.action, b.element, b.fk_object, b.entity,";
|
||||
$sql .= " b.certified, b.tms, b.fk_user, b.user_fullname, b.date_object, b.ref_object, b.object_data";
|
||||
$sql .= " b.certified, b.tms, b.fk_user, b.user_fullname, b.date_object, b.ref_object, b.object_data, b.object_version";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."blockedlog as b";
|
||||
if ($id) $sql .= " WHERE b.rowid = ".$id;
|
||||
|
||||
@ -704,6 +706,7 @@ class BlockedLog
|
||||
$this->user_fullname = $obj->user_fullname;
|
||||
|
||||
$this->object_data = $this->dolDecodeBlockedData($obj->object_data);
|
||||
$this->object_version = $obj->object_version;
|
||||
|
||||
$this->signature = $obj->signature;
|
||||
$this->signature_line = $obj->signature_line;
|
||||
@ -826,6 +829,7 @@ class BlockedLog
|
||||
$sql .= " date_object,";
|
||||
$sql .= " ref_object,";
|
||||
$sql .= " object_data,";
|
||||
$sql .= " object_version,";
|
||||
$sql .= " certified,";
|
||||
$sql .= " fk_user,";
|
||||
$sql .= " user_fullname,";
|
||||
@ -841,6 +845,7 @@ class BlockedLog
|
||||
$sql .= "'".$this->db->idate($this->date_object)."',";
|
||||
$sql .= "'".$this->db->escape($this->ref_object)."',";
|
||||
$sql .= "'".$this->db->escape(serialize($this->object_data))."',";
|
||||
$sql .= "'".$this->db->escape($this->object_version)."',";
|
||||
$sql .= "0,";
|
||||
$sql .= $this->fk_user.",";
|
||||
$sql .= "'".$this->db->escape($this->user_fullname)."',";
|
||||
@ -914,7 +919,11 @@ class BlockedLog
|
||||
private function buildKeyForSignature()
|
||||
{
|
||||
//print_r($this->object_data);
|
||||
return $this->date_creation.'|'.$this->action.'|'.$this->amounts.'|'.$this->ref_object.'|'.$this->date_object.'|'.$this->user_fullname.'|'.print_r($this->object_data, true);
|
||||
if (((int) $this->object_version) > 12) {
|
||||
return $this->date_creation.'|'.$this->action.'|'.$this->amounts.'|'.$this->ref_object.'|'.$this->date_object.'|'.$this->user_fullname.'|'.print_r($this->object_data, true);
|
||||
} else {
|
||||
return $this->date_creation.'|'.$this->action.'|'.$this->amounts.'|'.$this->ref_object.'|'.$this->date_object.'|'.$this->user_fullname.'|'.print_r($this->object_data, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -203,3 +203,5 @@ ALTER TABLE llx_categorie MODIFY type integer NOT NULL DEFAULT 1;
|
||||
|
||||
ALTER TABLE llx_societe_remise_except ADD COLUMN vat_src_code varchar(10) DEFAULT '';
|
||||
|
||||
ALTER TABLE llx_blockedlog ADD COLUMN object_version varchar(32) DEFAULT '';
|
||||
|
||||
|
||||
@ -33,6 +33,7 @@ CREATE TABLE llx_blockedlog
|
||||
signature varchar(100) NOT NULL,
|
||||
signature_line varchar(100) NOT NULL,
|
||||
object_data text,
|
||||
object_version varchar(32) DEFAULT '';
|
||||
certified integer
|
||||
) ENGINE=innodb;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user