Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
edc03a5aeb
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2018 Jean-François FERRY <hello@librethic.io>
|
||||
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.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
|
||||
@ -180,10 +181,10 @@ function showDirectPublicLink($object)
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a random id
|
||||
* Generate a random id
|
||||
*
|
||||
* @param string $car Char to generate key
|
||||
* @return void
|
||||
* @param int $car Length of string to generate key
|
||||
* @return string
|
||||
*/
|
||||
function generate_random_id($car = 16)
|
||||
{
|
||||
|
||||
@ -21,9 +21,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
|
||||
* \file htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php
|
||||
* \ingroup agenda
|
||||
* \brief Trigger file for agenda module
|
||||
* \brief Trigger file for company - contactroles
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';
|
||||
@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';
|
||||
class InterfaceContactRoles extends DolibarrTriggers
|
||||
{
|
||||
public $family = 'agenda';
|
||||
public $description = "Triggers of this module add actions in agenda according to setup made in agenda setup.";
|
||||
public $description = "Triggers of this module auto link contact to company.";
|
||||
|
||||
/**
|
||||
* Version of the trigger
|
||||
@ -73,7 +73,6 @@ class InterfaceContactRoles extends DolibarrTriggers
|
||||
$socid=(property_exists($object, 'socid')?$object->socid:$object->fk_soc);
|
||||
|
||||
if (! empty($socid) && $socid > 0) {
|
||||
global $db, $langs;
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
$contactdefault = new Contact($this->db);
|
||||
$contactdefault->socid=$socid;
|
||||
@ -83,7 +82,7 @@ class InterfaceContactRoles extends DolibarrTriggers
|
||||
if ($object->id > 0)
|
||||
{
|
||||
$class = get_class($object);
|
||||
$cloneFrom = new $class($db);
|
||||
$cloneFrom = new $class($this->db);
|
||||
$r = $cloneFrom->fetch($object->id);
|
||||
|
||||
if (!empty($cloneFrom->id)) $TContactAlreadyLinked = array_merge($cloneFrom->liste_contact(-1, 'external'), $cloneFrom->liste_contact(-1, 'internal'));
|
||||
|
||||
@ -1317,11 +1317,11 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
||||
{
|
||||
$arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF');
|
||||
if (! in_array($cpt->currency, $arrayzerounitcurrency)) {
|
||||
$currencybalance[$cpt->currency]->available=$cpt->amount / 100;
|
||||
$currencybalance[$cpt->currency]['available']=$cpt->amount / 100;
|
||||
} else {
|
||||
$currencybalance[$cpt->currency]->available=$cpt->amount;
|
||||
$currencybalance[$cpt->currency]['available']=$cpt->amount;
|
||||
}
|
||||
$currencybalance[$cpt->currency]->currency=$cpt->currency;
|
||||
$currencybalance[$cpt->currency]['currency']=$cpt->currency;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1331,9 +1331,9 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
||||
{
|
||||
$arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF');
|
||||
if (! in_array($cpt->currency, $arrayzerounitcurrency)) {
|
||||
$currencybalance[$cpt->currency]->pending=$currencybalance[$cpt->currency]->available+$cpt->amount / 100;
|
||||
$currencybalance[$cpt->currency]['pending']=$currencybalance[$cpt->currency]['available']+$cpt->amount / 100;
|
||||
} else {
|
||||
$currencybalance[$cpt->currency]->pending=$currencybalance[$cpt->currency]->available+$cpt->amount;
|
||||
$currencybalance[$cpt->currency]['pending']=$currencybalance[$cpt->currency]['available']+$cpt->amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1342,7 +1342,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
||||
{
|
||||
foreach ($currencybalance as $cpt)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Currency".strtoupper($cpt->currency)).'</td><td>'.price($cpt->available, 0, '', 1, - 1, - 1, strtoupper($cpt->currency)).'</td><td>'.price($cpt->pending, 0, '', 1, - 1, - 1, strtoupper($cpt->currency)).'</td><td>'.price($cpt->available+$cpt->pending, 0, '', 1, - 1, - 1, strtoupper($cpt->currency)).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Currency".strtoupper($cpt['currency'])).'</td><td>'.price($cpt['available'], 0, '', 1, - 1, - 1, strtoupper($cpt['currency'])).'</td><td>'.price($cpt->pending, 0, '', 1, - 1, - 1, strtoupper($cpt['currency'])).'</td><td>'.price($cpt['available']+$cpt->pending, 0, '', 1, - 1, - 1, strtoupper($cpt['currency'])).'</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2018 Jean-François Ferry <hello@librethic.io>
|
||||
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.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
|
||||
@ -120,7 +121,7 @@ class Ticket extends CommonObject
|
||||
public $progress;
|
||||
|
||||
/**
|
||||
* @var int Duration for ticket
|
||||
* @var string Duration for ticket
|
||||
*/
|
||||
public $timing;
|
||||
|
||||
@ -250,11 +251,11 @@ class Ticket extends CommonObject
|
||||
}
|
||||
|
||||
if (isset($this->fk_soc)) {
|
||||
$this->fk_soc = trim($this->fk_soc);
|
||||
$this->fk_soc = (int) $this->fk_soc;
|
||||
}
|
||||
|
||||
if (isset($this->fk_project)) {
|
||||
$this->fk_project = trim($this->fk_project);
|
||||
$this->fk_project = (int) $this->fk_project;
|
||||
}
|
||||
|
||||
if (isset($this->origin_email)) {
|
||||
@ -262,11 +263,11 @@ class Ticket extends CommonObject
|
||||
}
|
||||
|
||||
if (isset($this->fk_user_create)) {
|
||||
$this->fk_user_create = trim($this->fk_user_create);
|
||||
$this->fk_user_create = (int) $this->fk_user_create;
|
||||
}
|
||||
|
||||
if (isset($this->fk_user_assign)) {
|
||||
$this->fk_user_assign = trim($this->fk_user_assign);
|
||||
$this->fk_user_assign = (int) $this->fk_user_assign;
|
||||
}
|
||||
|
||||
if (isset($this->subject)) {
|
||||
@ -278,7 +279,7 @@ class Ticket extends CommonObject
|
||||
}
|
||||
|
||||
if (isset($this->fk_statut)) {
|
||||
$this->fk_statut = trim($this->fk_statut);
|
||||
$this->fk_statut = (int) $this->fk_statut;
|
||||
}
|
||||
|
||||
if (isset($this->resolution)) {
|
||||
@ -746,11 +747,11 @@ class Ticket extends CommonObject
|
||||
}
|
||||
|
||||
if (isset($this->fk_soc)) {
|
||||
$this->fk_soc = trim($this->fk_soc);
|
||||
$this->fk_soc = (int) $this->fk_soc;
|
||||
}
|
||||
|
||||
if (isset($this->fk_project)) {
|
||||
$this->fk_project = trim($this->fk_project);
|
||||
$this->fk_project = (int) $this->fk_project;
|
||||
}
|
||||
|
||||
if (isset($this->origin_email)) {
|
||||
@ -758,11 +759,11 @@ class Ticket extends CommonObject
|
||||
}
|
||||
|
||||
if (isset($this->fk_user_create)) {
|
||||
$this->fk_user_create = trim($this->fk_user_create);
|
||||
$this->fk_user_create = (int) $this->fk_user_create;
|
||||
}
|
||||
|
||||
if (isset($this->fk_user_assign)) {
|
||||
$this->fk_user_assign = trim($this->fk_user_assign);
|
||||
$this->fk_user_assign = (int) $this->fk_user_assign;
|
||||
}
|
||||
|
||||
if (isset($this->subject)) {
|
||||
@ -774,7 +775,7 @@ class Ticket extends CommonObject
|
||||
}
|
||||
|
||||
if (isset($this->fk_statut)) {
|
||||
$this->fk_statut = trim($this->fk_statut);
|
||||
$this->fk_statut = (int) $this->fk_statut;
|
||||
}
|
||||
|
||||
if (isset($this->resolution)) {
|
||||
@ -1002,12 +1003,12 @@ class Ticket extends CommonObject
|
||||
$this->ref = 'TI0501-001';
|
||||
$this->track_id = 'XXXXaaaa';
|
||||
$this->origin_email = 'email@email.com';
|
||||
$this->fk_project = '1';
|
||||
$this->fk_user_create = '1';
|
||||
$this->fk_user_assign = '1';
|
||||
$this->fk_project = 1;
|
||||
$this->fk_user_create = 1;
|
||||
$this->fk_user_assign = 1;
|
||||
$this->subject = 'Subject of ticket';
|
||||
$this->message = 'Message of ticket';
|
||||
$this->fk_statut = '0';
|
||||
$this->fk_statut = 0;
|
||||
$this->resolution = '1';
|
||||
$this->progress = '10';
|
||||
$this->timing = '30';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user