diff --git a/.travis.yml b/.travis.yml index ff8350a6446..8d5a54b0548 100644 --- a/.travis.yml +++ b/.travis.yml @@ -79,7 +79,7 @@ matrix: notifications: email: on_success: never # [always|never|change] default: change - on_failure: change # [always|never|change] default: always + on_failure: never # [always|never|change] default: always irc: channels: - "chat.freenode.net#dolibarr" diff --git a/COPYRIGHT b/COPYRIGHT index 9242cb8b9c4..bd3565c3bd1 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -36,7 +36,7 @@ Stripe 4.7.0 MIT licence Yes JS libraries: jQuery 3.1.1 MIT License Yes JS library jQuery UI 1.12.1 GPL and MIT License Yes JS library plugin UI -jQuery select2 4.0.4 GPL and Apache License Yes JS library plugin for sexier multiselect +jQuery select2 4.0.5 GPL and Apache License Yes JS library plugin for sexier multiselect jQuery blockUI 2.70.0 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups) jQuery Colorpicker 1.1 MIT License Yes JS library for color picker for a defined list of colors jQuery Flot 0.8.3 MIT License Yes JS library to build graph diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 0fefb5baf00..0dc64c5a9fe 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -96,7 +96,8 @@ class BlockedLog /** * try to retrieve logged object link */ - public function getObjectLink() { + public function getObjectLink() + { global $langs; if($this->element === 'facture') { @@ -110,6 +111,17 @@ class BlockedLog $this->error++; } } + if($this->element === 'invoice_supplier') { + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; + + $object = new FactureFournisseur($this->db); + if($object->fetch($this->fk_object)>0) { + return $object->getNomUrl(1); + } + else{ + $this->error++; + } + } else if($this->element === 'payment') { require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; @@ -121,6 +133,17 @@ class BlockedLog $this->error++; } } + else if($this->element === 'payment_supplier') { + require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; + + $object = new PaiementFourn($this->db); + if($object->fetch($this->fk_object)>0) { + return $object->getNomUrl(1); + } + else{ + $this->error++; + } + } return $langs->trans('ImpossibleToReloadObject', $this->element, $this->fk_object); @@ -129,7 +152,8 @@ class BlockedLog /** * try to retrieve user author */ - public function getUser() { + public function getUser() + { global $langs, $cachedUser; if(empty($cachedUser))$cachedUser=array(); @@ -149,14 +173,14 @@ class BlockedLog } /** - * populate log by object + * Populate properties of log from object data * - * @param payment|facture $object object to store + * @param Object $object object to store */ - public function setObjectData(&$object) { - + public function setObjectData(&$object) + { // Set date - if ($object->element=='payment') + if($object->element == 'payment' || $object->element == 'payment_supplier') { $this->date_object = $object->datepaye; } @@ -174,7 +198,7 @@ class BlockedLog $this->object_data=new stdClass(); - if ($this->element === 'facture') + if ($this->element == 'facture') { if(empty($object->thirdparty))$object->fetch_thirdparty(); $this->object_data->thirdparty = new stdClass(); @@ -190,15 +214,31 @@ class BlockedLog $this->object_data->total_localtax2= (double) $object->total_localtax2; $this->object_data->note_public = (double) $object->note_public; } - elseif($this->element === 'payment') + if($this->element == 'invoice_supplier') { + if(empty($object->thirdparty))$object->fetch_thirdparty(); + $this->object_data->thirdparty = new stdClass(); + + foreach($object->thirdparty as $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_tva = (double) $object->total_tva; + $this->object_data->total_ttc = (double) $object->total_ttc; + $this->object_data->total_localtax1= (double) $object->total_localtax1; + $this->object_data->total_localtax2= (double) $object->total_localtax2; + $this->object_data->note_public = (double) $object->note_public; + $this->object_data->note_private= (double) $object->note_private; + + } + elseif ($this->element == 'payment'|| $object->element == 'payment_supplier') { $this->object_data->amounts = $object->amounts; } - elseif($this->element === 'payment_salary') + elseif($this->element == 'payment_salary') { $this->object_data->amounts = array($object->amount); } - } /** @@ -520,6 +560,15 @@ class BlockedLog $this->amounts = (double) $obj->amount; } } + if($this->element === 'payment_supplier') { + $sql="SELECT amount FROM ".MAIN_DB_PREFIX."paiementfourn WHERE rowid=".$this->fk_object; + + $res = $this->db->query($sql); + + if($res && $obj = $this->db->fetch_object($res)) { + $this->amounts = (double) $obj->amount; + } + } elseif($this->element === 'facture') { $sql="SELECT total_ttc FROM ".MAIN_DB_PREFIX."facture WHERE rowid=".$this->fk_object; diff --git a/htdocs/collab/index.php b/htdocs/collab/index.php index 2c995543fdf..c356db8625b 100644 --- a/htdocs/collab/index.php +++ b/htdocs/collab/index.php @@ -155,7 +155,7 @@ $form = new Form($db); $help_url=''; -llxHeader('', $langs->trans("WebsiteSetup"), $help_url, '', 0, '', '', '', '', ''."\n".'