fix travis

This commit is contained in:
Alexis Algoud 2017-06-10 10:10:34 +02:00
parent 4fd24f6d8c
commit 3cae54c296
2 changed files with 40 additions and 21 deletions

View File

@ -18,7 +18,8 @@
/** /**
* Class to manage certif authority * Class to manage certif authority
*/ */
class BlockedLogAuthority { class BlockedLogAuthority
{
/** /**
* Id of the log * Id of the log
@ -113,7 +114,8 @@ class BlockedLogAuthority {
/** /**
* Get object from database * Get object from database
* *
* @param int $rowid Id of object to load * @param int $id Id of object to load
* @param string $signature Signature of object to load
* @return int >0 if OK, <0 if KO, 0 if not found * @return int >0 if OK, <0 if KO, 0 if not found
*/ */
public function fetch($id, $signature='') { public function fetch($id, $signature='') {

View File

@ -19,7 +19,8 @@
* Class to manage Blocked Log * Class to manage Blocked Log
*/ */
class BlockedLog { class BlockedLog
{
/** /**
* Id of the log * Id of the log
@ -41,14 +42,34 @@ class BlockedLog {
public $amounts = null; public $amounts = null;
/**
* trigger action
* @var string
*/
public $action = ''; public $action = '';
/**
* Object element
* @var string
*/
public $element = ''; public $element = '';
/**
* Object id
* @var int
*/
public $fk_object = 0; public $fk_object = 0;
/**
* Log certified by remote authority or not
* @var boolean
*/
public $certified = false; public $certified = false;
/**
* Author
* @var int
*/
public $fk_user = 0; public $fk_user = 0;
public $date_object = 0; public $date_object = 0;
@ -71,8 +92,6 @@ class BlockedLog {
/** /**
* try to retrieve logged object * try to retrieve logged object
*
* @param object|string $object object logged
*/ */
public function getObject() { public function getObject() {
global $langs; global $langs;
@ -100,8 +119,6 @@ class BlockedLog {
/** /**
* try to retrieve user author * try to retrieve user author
*
* @param object|string $object object logged
*/ */
public function getUser() { public function getUser() {
global $langs, $cachedUser; global $langs, $cachedUser;
@ -144,19 +161,19 @@ class BlockedLog {
if($this->element === 'facture') { if($this->element === 'facture') {
if(empty($object->thirdparty))$object->fetch_thirdparty(); if(empty($object->thirdparty))$object->fetch_thirdparty();
$this->object_data->thirdparty=new stdClass(); $this->object_data->thirdparty = new stdClass();
foreach($object->thirdparty as $key=>$value) { foreach($object->thirdparty as $key=>$value) {
if(!is_object($value)) $this->object_data->thirdparty->{$key} = $value; if(!is_object($value)) $this->object_data->thirdparty->{$key} = $value;
} }
$this->object_data->total_ht = (double)$object->total_ht; $this->object_data->total_ht = (double) $object->total_ht;
$this->object_data->total_tva = (double)$object->total_tva; $this->object_data->total_tva = (double) $object->total_tva;
$this->object_data->total_ttc = (double)$object->total_ttc; $this->object_data->total_ttc = (double) $object->total_ttc;
$this->object_data->total_localtax1= (double)$object->total_localtax1; $this->object_data->total_localtax1= (double) $object->total_localtax1;
$this->object_data->total_localtax2= (double)$object->total_localtax2; $this->object_data->total_localtax2= (double) $object->total_localtax2;
$this->object_data->note_public = (double)$object->note_public; $this->object_data->note_public = (double) $object->note_public;
$this->object_data->note_private= (double)$object->note_private; $this->object_data->note_private= (double) $object->note_private;
} }
elseif($this->element==='payment'){ elseif($this->element==='payment'){
@ -171,7 +188,7 @@ class BlockedLog {
/** /**
* Get object from database * Get object from database
* *
* @param int $rowid Id of object to load * @param int $id Id of object to load
* @return int >0 if OK, <0 if KO, 0 if not found * @return int >0 if OK, <0 if KO, 0 if not found
*/ */
public function fetch($id) { public function fetch($id) {
@ -203,7 +220,7 @@ class BlockedLog {
$this->ref = $obj->rowid; $this->ref = $obj->rowid;
$this->signature = $obj->signature; $this->signature = $obj->signature;
$this->amounts = (double)$obj->amounts; $this->amounts = (double) $obj->amounts;
$this->action = $obj->action; $this->action = $obj->action;
$this->element = $obj->element; $this->element = $obj->element;
@ -434,7 +451,7 @@ class BlockedLog {
} }
else{ else{
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog
WHERE element='".$element."' AND fk_object=".(int)$fk_object; WHERE element='".$element."' AND fk_object=".(int) $fk_object;
} }
@ -480,7 +497,7 @@ class BlockedLog {
$res = $this->db->query($sql); $res = $this->db->query($sql);
if($res && $obj = $this->db->fetch_object($res)) { if($res && $obj = $this->db->fetch_object($res)) {
$this->amounts = (double)$obj->amount; $this->amounts = (double) $obj->amount;
} }
} }