Merge remote-tracking branch 'upstream/develop' into camelCaps
This commit is contained in:
commit
39462742e2
@ -212,6 +212,7 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/supplier_proposal
|
%_datadir/dolibarr/htdocs/supplier_proposal
|
||||||
%_datadir/dolibarr/htdocs/support
|
%_datadir/dolibarr/htdocs/support
|
||||||
%_datadir/dolibarr/htdocs/theme
|
%_datadir/dolibarr/htdocs/theme
|
||||||
|
%_datadir/dolibarr/htdocs/ticket
|
||||||
%_datadir/dolibarr/htdocs/user
|
%_datadir/dolibarr/htdocs/user
|
||||||
%_datadir/dolibarr/htdocs/variants
|
%_datadir/dolibarr/htdocs/variants
|
||||||
%_datadir/dolibarr/htdocs/webservices
|
%_datadir/dolibarr/htdocs/webservices
|
||||||
|
|||||||
@ -292,6 +292,7 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/supplier_proposal
|
%_datadir/dolibarr/htdocs/supplier_proposal
|
||||||
%_datadir/dolibarr/htdocs/support
|
%_datadir/dolibarr/htdocs/support
|
||||||
%_datadir/dolibarr/htdocs/theme
|
%_datadir/dolibarr/htdocs/theme
|
||||||
|
%_datadir/dolibarr/htdocs/ticket
|
||||||
%_datadir/dolibarr/htdocs/user
|
%_datadir/dolibarr/htdocs/user
|
||||||
%_datadir/dolibarr/htdocs/variants
|
%_datadir/dolibarr/htdocs/variants
|
||||||
%_datadir/dolibarr/htdocs/webservices
|
%_datadir/dolibarr/htdocs/webservices
|
||||||
|
|||||||
@ -209,6 +209,7 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/supplier_proposal
|
%_datadir/dolibarr/htdocs/supplier_proposal
|
||||||
%_datadir/dolibarr/htdocs/support
|
%_datadir/dolibarr/htdocs/support
|
||||||
%_datadir/dolibarr/htdocs/theme
|
%_datadir/dolibarr/htdocs/theme
|
||||||
|
%_datadir/dolibarr/htdocs/ticket
|
||||||
%_datadir/dolibarr/htdocs/user
|
%_datadir/dolibarr/htdocs/user
|
||||||
%_datadir/dolibarr/htdocs/variants
|
%_datadir/dolibarr/htdocs/variants
|
||||||
%_datadir/dolibarr/htdocs/webservices
|
%_datadir/dolibarr/htdocs/webservices
|
||||||
|
|||||||
@ -220,6 +220,7 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/supplier_proposal
|
%_datadir/dolibarr/htdocs/supplier_proposal
|
||||||
%_datadir/dolibarr/htdocs/support
|
%_datadir/dolibarr/htdocs/support
|
||||||
%_datadir/dolibarr/htdocs/theme
|
%_datadir/dolibarr/htdocs/theme
|
||||||
|
%_datadir/dolibarr/htdocs/ticket
|
||||||
%_datadir/dolibarr/htdocs/user
|
%_datadir/dolibarr/htdocs/user
|
||||||
%_datadir/dolibarr/htdocs/variants
|
%_datadir/dolibarr/htdocs/variants
|
||||||
%_datadir/dolibarr/htdocs/webservices
|
%_datadir/dolibarr/htdocs/webservices
|
||||||
|
|||||||
@ -218,9 +218,9 @@
|
|||||||
<severity>5</severity>
|
<severity>5</severity>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
|
<!--<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
|
||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
</rule>
|
</rule>-->
|
||||||
<rule ref="PEAR.Commenting.FunctionComment.Missing">
|
<rule ref="PEAR.Commenting.FunctionComment.Missing">
|
||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
</rule>
|
</rule>
|
||||||
|
|||||||
@ -185,6 +185,7 @@ class AccountancyExport
|
|||||||
* Function who chose which export to use with the default config
|
* Function who chose which export to use with the default config
|
||||||
*
|
*
|
||||||
* @param unknown $TData data
|
* @param unknown $TData data
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function export(&$TData) {
|
public function export(&$TData) {
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
@ -602,6 +603,7 @@ class AccountancyExport
|
|||||||
*
|
*
|
||||||
* @param unknown $str data
|
* @param unknown $str data
|
||||||
* @param integer $size data
|
* @param integer $size data
|
||||||
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function trunc($str, $size) {
|
public static function trunc($str, $size) {
|
||||||
return dol_trunc($str, $size, 'right', 'UTF-8', 1);
|
return dol_trunc($str, $size, 'right', 'UTF-8', 1);
|
||||||
|
|||||||
@ -2466,6 +2466,7 @@ class Adherent extends CommonObject
|
|||||||
* Existing categories are left untouch.
|
* Existing categories are left untouch.
|
||||||
*
|
*
|
||||||
* @param int[]|int $categories Category or categories IDs
|
* @param int[]|int $categories Category or categories IDs
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setCategories($categories)
|
public function setCategories($categories)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -82,6 +82,7 @@ class PrestaShopWebservice
|
|||||||
* Take the status code and throw an exception if the server didn't return 200 or 201 code
|
* Take the status code and throw an exception if the server didn't return 200 or 201 code
|
||||||
*
|
*
|
||||||
* @param int $status_code Status code of an HTTP return
|
* @param int $status_code Status code of an HTTP return
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function checkStatusCode($status_code)
|
protected function checkStatusCode($status_code)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -217,6 +217,7 @@ class DolibarrApi
|
|||||||
* @param string $feature2 Feature to check, second level of permission (optional). Can be or check with 'level1|level2'.
|
* @param string $feature2 Feature to check, second level of permission (optional). Can be or check with 'level1|level2'.
|
||||||
* @param string $dbt_keyfield Field name for socid foreign key if not fk_soc. Not used if objectid is null (optional)
|
* @param string $dbt_keyfield Field name for socid foreign key if not fk_soc. Not used if objectid is null (optional)
|
||||||
* @param string $dbt_select Field name for select if not rowid. Not used if objectid is null (optional)
|
* @param string $dbt_select Field name for select if not rowid. Not used if objectid is null (optional)
|
||||||
|
* @return bool
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
static function _checkAccessToResource($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid') {
|
static function _checkAccessToResource($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid') {
|
||||||
|
|||||||
@ -188,6 +188,7 @@ class Setup extends DolibarrApi
|
|||||||
* @param int $id ID of country
|
* @param int $id ID of country
|
||||||
* @param string $lang Code of the language the name of the
|
* @param string $lang Code of the language the name of the
|
||||||
* country must be translated to
|
* country must be translated to
|
||||||
|
* @return array Array of cleaned object properties
|
||||||
*
|
*
|
||||||
* @url GET dictionary/countries/{id}
|
* @url GET dictionary/countries/{id}
|
||||||
*
|
*
|
||||||
@ -293,6 +294,7 @@ class Setup extends DolibarrApi
|
|||||||
* @param Ccountry $country Country
|
* @param Ccountry $country Country
|
||||||
* @param string $lang Code of the language the name of the
|
* @param string $lang Code of the language the name of the
|
||||||
* country must be translated to
|
* country must be translated to
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function translateLabel($country, $lang)
|
private function translateLabel($country, $lang)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -28,6 +28,7 @@ class Status
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Get status (Dolibarr version)
|
* Get status (Dolibarr version)
|
||||||
|
* @return array
|
||||||
*/
|
*/
|
||||||
function index() {
|
function index() {
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|||||||
@ -105,7 +105,8 @@ class BlockedLogAuthority
|
|||||||
/**
|
/**
|
||||||
* Add a new block to the chain
|
* Add a new block to the chain
|
||||||
*
|
*
|
||||||
* @param string $block new block to chain
|
* @param string $block new block to chain
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function addBlock($block) {
|
public function addBlock($block) {
|
||||||
|
|
||||||
|
|||||||
@ -18,9 +18,6 @@
|
|||||||
* See https://medium.com/@lhartikk/a-blockchain-in-200-lines-of-code-963cc1cc0e54
|
* See https://medium.com/@lhartikk/a-blockchain-in-200-lines-of-code-963cc1cc0e54
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*ini_set('unserialize_callback_func', 'mycallback');
|
/*ini_set('unserialize_callback_func', 'mycallback');
|
||||||
|
|
||||||
function mycallback($classname)
|
function mycallback($classname)
|
||||||
@ -171,6 +168,7 @@ class BlockedLog
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Try to retrieve source object (it it still exists)
|
* Try to retrieve source object (it it still exists)
|
||||||
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getObjectLink()
|
public function getObjectLink()
|
||||||
{
|
{
|
||||||
@ -286,6 +284,7 @@ class BlockedLog
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* try to retrieve user author
|
* try to retrieve user author
|
||||||
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getUser()
|
public function getUser()
|
||||||
{
|
{
|
||||||
@ -1029,6 +1028,7 @@ class BlockedLog
|
|||||||
* Check if module was already used or not for at least one recording.
|
* Check if module was already used or not for at least one recording.
|
||||||
*
|
*
|
||||||
* @param int $ignoresystem Ignore system events for the test
|
* @param int $ignoresystem Ignore system events for the test
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
function alreadyUsed($ignoresystem=0)
|
function alreadyUsed($ignoresystem=0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -946,6 +946,7 @@ class Account extends CommonObject
|
|||||||
* Existing categories are left untouch.
|
* Existing categories are left untouch.
|
||||||
*
|
*
|
||||||
* @param int[]|int $categories Category or categories IDs
|
* @param int[]|int $categories Category or categories IDs
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setCategories($categories) {
|
public function setCategories($categories) {
|
||||||
// Handle single category
|
// Handle single category
|
||||||
|
|||||||
@ -4030,8 +4030,6 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
|
||||||
// List of previous situation invoices
|
|
||||||
|
|
||||||
$sign = 1;
|
$sign = 1;
|
||||||
if ($object->type == Facture::TYPE_CREDIT_NOTE) $sign = - 1;
|
if ($object->type == Facture::TYPE_CREDIT_NOTE) $sign = - 1;
|
||||||
$nbrows = 8;
|
$nbrows = 8;
|
||||||
@ -4372,7 +4370,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
else // Credit note
|
else // Credit note
|
||||||
{
|
{
|
||||||
$cssforamountpaymentcomplete='';
|
$cssforamountpaymentcomplete='amountpaymentneutral';
|
||||||
|
|
||||||
// Total already paid back
|
// Total already paid back
|
||||||
print '<tr><td colspan="' . $nbcols . '" align="right">';
|
print '<tr><td colspan="' . $nbcols . '" align="right">';
|
||||||
@ -4387,7 +4385,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
if ($resteapayeraffiche <= 0)
|
if ($resteapayeraffiche <= 0)
|
||||||
print $langs->trans('RemainderToPayBack');
|
print $langs->trans('RemainderToPayBack');
|
||||||
else
|
else
|
||||||
print $langs->trans('ExcessPaydBack');
|
print $langs->trans('ExcessPaid');
|
||||||
print ' :</td>';
|
print ' :</td>';
|
||||||
print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopayback"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($sign * $resteapayeraffiche) . '</td>';
|
print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopayback"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($sign * $resteapayeraffiche) . '</td>';
|
||||||
print '<td class="nowrap"> </td></tr>';
|
print '<td class="nowrap"> </td></tr>';
|
||||||
|
|||||||
@ -1341,6 +1341,7 @@ class Contact extends CommonObject
|
|||||||
* Existing categories are left untouch.
|
* Existing categories are left untouch.
|
||||||
*
|
*
|
||||||
* @param int[]|int $categories Category or categories IDs
|
* @param int[]|int $categories Category or categories IDs
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setCategories($categories)
|
public function setCategories($categories)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -120,6 +120,7 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town']))
|
|||||||
$row_array['selectcountry_id'] = $row['fk_country'];
|
$row_array['selectcountry_id'] = $row['fk_country'];
|
||||||
$row_array['state_id'] = $row['fk_county'];
|
$row_array['state_id'] = $row['fk_county'];
|
||||||
|
|
||||||
|
// TODO Use a cache here to avoid to make select_state in each pass (this make a SQL and lot of logs)
|
||||||
$row_array['states'] = $formcompany->select_state('',$row['fk_country'],'');
|
$row_array['states'] = $formcompany->select_state('',$row['fk_country'],'');
|
||||||
|
|
||||||
array_push($return_arr,$row_array);
|
array_push($return_arr,$row_array);
|
||||||
|
|||||||
@ -6841,6 +6841,7 @@ abstract class CommonObject
|
|||||||
* Function to load data from a SQL pointer into properties of current object $this
|
* Function to load data from a SQL pointer into properties of current object $this
|
||||||
*
|
*
|
||||||
* @param stdClass $obj Contain data of object from database
|
* @param stdClass $obj Contain data of object from database
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function setVarsFromFetchObj(&$obj)
|
protected function setVarsFromFetchObj(&$obj)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* EXPERIMENTAL
|
/* EXPERIMENTAL
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016 ATM Consulting <support@atm-consulting.fr>
|
* Copyright (C) 2016 ATM Consulting <support@atm-consulting.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -22,7 +22,7 @@
|
|||||||
* \ingroup core
|
* \ingroup core
|
||||||
* \brief File of class to manage all object. Might be replace or merge into commonobject
|
* \brief File of class to manage all object. Might be replace or merge into commonobject
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||||
|
|
||||||
class CoreObject extends CommonObject
|
class CoreObject extends CommonObject
|
||||||
@ -54,7 +54,7 @@ class CoreObject extends CommonObject
|
|||||||
$this->id = 0;
|
$this->id = 0;
|
||||||
$this->datec = 0;
|
$this->datec = 0;
|
||||||
$this->tms = 0;
|
$this->tms = 0;
|
||||||
|
|
||||||
if (!empty($this->fields))
|
if (!empty($this->fields))
|
||||||
{
|
{
|
||||||
foreach ($this->fields as $field=>$info)
|
foreach ($this->fields as $field=>$info)
|
||||||
@ -68,14 +68,14 @@ class CoreObject extends CommonObject
|
|||||||
|
|
||||||
$this->to_delete=false;
|
$this->to_delete=false;
|
||||||
$this->is_clone=false;
|
$this->is_clone=false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -110,7 +110,7 @@ class CoreObject extends CommonObject
|
|||||||
if($res>0) {
|
if($res>0) {
|
||||||
if ($loadChild) $this->fetchChild();
|
if ($loadChild) $this->fetchChild();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,14 +133,14 @@ class CoreObject extends CommonObject
|
|||||||
if($object->{$key} === $id) return $k;
|
if($object->{$key} === $id) return $k;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$k = count($this->{$tabName});
|
$k = count($this->{$tabName});
|
||||||
|
|
||||||
$className = ucfirst($tabName);
|
$className = ucfirst($tabName);
|
||||||
$this->{$tabName}[$k] = new $className($this->db);
|
$this->{$tabName}[$k] = new $className($this->db);
|
||||||
if($id>0 && $key==='id' && $try_to_load)
|
if($id>0 && $key==='id' && $try_to_load)
|
||||||
{
|
{
|
||||||
$this->{$tabName}[$k]->fetch($id);
|
$this->{$tabName}[$k]->fetch($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $k;
|
return $k;
|
||||||
@ -171,6 +171,8 @@ class CoreObject extends CommonObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to fetch children objects
|
* Function to fetch children objects
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function fetchChild()
|
public function fetchChild()
|
||||||
{
|
{
|
||||||
@ -207,6 +209,7 @@ class CoreObject extends CommonObject
|
|||||||
* Function to update children data
|
* Function to update children data
|
||||||
*
|
*
|
||||||
* @param User $user user object
|
* @param User $user user object
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function saveChild(User &$user)
|
public function saveChild(User &$user)
|
||||||
{
|
{
|
||||||
@ -220,7 +223,7 @@ class CoreObject extends CommonObject
|
|||||||
foreach($this->{$className} as $i => &$object)
|
foreach($this->{$className} as $i => &$object)
|
||||||
{
|
{
|
||||||
$object->{$this->fk_element} = $this->id;
|
$object->{$this->fk_element} = $this->id;
|
||||||
|
|
||||||
$object->update($user);
|
$object->update($user);
|
||||||
if($this->unsetChildDeleted && isset($object->to_delete) && $object->to_delete==true) unset($this->{$className}[$i]);
|
if($this->unsetChildDeleted && isset($object->to_delete) && $object->to_delete==true) unset($this->{$className}[$i]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -206,7 +206,7 @@ class FormCompany
|
|||||||
*
|
*
|
||||||
* @param string $selected Code state preselected (mus be state id)
|
* @param string $selected Code state preselected (mus be state id)
|
||||||
* @param integer $country_codeid Country code or id: 0=list for all countries, otherwise country code or country rowid to show
|
* @param integer $country_codeid Country code or id: 0=list for all countries, otherwise country code or country rowid to show
|
||||||
* @param string $htmlname Id of department
|
* @param string $htmlname Id of department. If '', we want only the string with <option>
|
||||||
* @return string String with HTML select
|
* @return string String with HTML select
|
||||||
* @see select_country
|
* @see select_country
|
||||||
*/
|
*/
|
||||||
@ -221,7 +221,7 @@ class FormCompany
|
|||||||
|
|
||||||
$out='';
|
$out='';
|
||||||
|
|
||||||
// On recherche les departements/cantons/province active d'une region et pays actif
|
// Serch departements/cantons/province active d'une region et pays actif
|
||||||
$sql = "SELECT d.rowid, d.code_departement as code, d.nom as name, d.active, c.label as country, c.code as country_code, r.nom as region_name FROM";
|
$sql = "SELECT d.rowid, d.code_departement as code, d.nom as name, d.active, c.label as country, c.code as country_code, r.nom as region_name FROM";
|
||||||
$sql .= " ".MAIN_DB_PREFIX ."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r,".MAIN_DB_PREFIX."c_country as c";
|
$sql .= " ".MAIN_DB_PREFIX ."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r,".MAIN_DB_PREFIX."c_country as c";
|
||||||
$sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid";
|
$sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid";
|
||||||
@ -230,7 +230,6 @@ class FormCompany
|
|||||||
if ($country_codeid && ! is_numeric($country_codeid)) $sql .= " AND c.code = '".$this->db->escape($country_codeid)."'";
|
if ($country_codeid && ! is_numeric($country_codeid)) $sql .= " AND c.code = '".$this->db->escape($country_codeid)."'";
|
||||||
$sql .= " ORDER BY c.code, d.code_departement";
|
$sql .= " ORDER BY c.code, d.code_departement";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::select_departement", LOG_DEBUG);
|
|
||||||
$result=$this->db->query($sql);
|
$result=$this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
@ -302,9 +301,12 @@ class FormCompany
|
|||||||
dol_print_error($this->db);
|
dol_print_error($this->db);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make select dynamic
|
// Make select dynamic
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
if (! empty($htmlname))
|
||||||
$out .= ajax_combobox($htmlname);
|
{
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||||
|
$out .= ajax_combobox($htmlname);
|
||||||
|
}
|
||||||
|
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -89,7 +89,7 @@ function societe_prepare_head(Societe $object)
|
|||||||
$head[$h][0] = DOL_URL_ROOT.'/comm/card.php?socid='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/comm/card.php?socid='.$object->id;
|
||||||
$head[$h][1] = '';
|
$head[$h][1] = '';
|
||||||
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && ($object->client==2 || $object->client==3)) $head[$h][1] .= $langs->trans("Prospect");
|
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && ($object->client==2 || $object->client==3)) $head[$h][1] .= $langs->trans("Prospect");
|
||||||
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && $object->client==3) $head[$h][1] .= '/';
|
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && $object->client==3) $head[$h][1] .= ' | ';
|
||||||
if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && ($object->client==1 || $object->client==3)) $head[$h][1] .= $langs->trans("Customer");
|
if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && ($object->client==1 || $object->client==3)) $head[$h][1] .= $langs->trans("Customer");
|
||||||
$head[$h][2] = 'customer';
|
$head[$h][2] = 'customer';
|
||||||
$h++;
|
$h++;
|
||||||
|
|||||||
@ -1594,6 +1594,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
|
|||||||
* @param string $langkey Translation key
|
* @param string $langkey Translation key
|
||||||
* @param string $fieldkey Key of the html select field the text refers to
|
* @param string $fieldkey Key of the html select field the text refers to
|
||||||
* @param int $fieldrequired 1=Field is mandatory
|
* @param int $fieldrequired 1=Field is mandatory
|
||||||
|
* @return string
|
||||||
* @deprecated Form::editfieldkey
|
* @deprecated Form::editfieldkey
|
||||||
*/
|
*/
|
||||||
function fieldLabel($langkey, $fieldkey, $fieldrequired=0)
|
function fieldLabel($langkey, $fieldkey, $fieldrequired=0)
|
||||||
@ -7431,6 +7432,7 @@ function getAdvancedPreviewUrl($modulepart, $relativepath, $alldata=0, $param=''
|
|||||||
*
|
*
|
||||||
* @param string $htmlname Id of html object
|
* @param string $htmlname Id of html object
|
||||||
* @param string $addlink Add a 'link to' after
|
* @param string $addlink Add a 'link to' after
|
||||||
|
* @return string
|
||||||
*/
|
*/
|
||||||
function ajax_autoselect($htmlname, $addlink='')
|
function ajax_autoselect($htmlname, $addlink='')
|
||||||
{
|
{
|
||||||
@ -7568,6 +7570,7 @@ function dol_mimetype($file, $default='application/octet-stream', $mode=0)
|
|||||||
* @param int $id id of line
|
* @param int $id id of line
|
||||||
* @param bool $checkentity add filter on entity
|
* @param bool $checkentity add filter on entity
|
||||||
* @param string $rowidfield name of the column rowid
|
* @param string $rowidfield name of the column rowid
|
||||||
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getDictvalue($tablename, $field, $id, $checkentity=false, $rowidfield='rowid')
|
function getDictvalue($tablename, $field, $id, $checkentity=false, $rowidfield='rowid')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -21,12 +21,12 @@
|
|||||||
* \brief A set of functions for Dolibarr
|
* \brief A set of functions for Dolibarr
|
||||||
* This file contains all frequently used functions.
|
* This file contains all frequently used functions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to return number in text.
|
* Function to return number in text.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param float $num Number to convert
|
* @param float $num Number to convert
|
||||||
* @param Lang $langs Language
|
* @param Lang $langs Language
|
||||||
* @param boolean $currency 0=number to translate | 1=currency to translate
|
* @param boolean $currency 0=number to translate | 1=currency to translate
|
||||||
@ -36,7 +36,7 @@
|
|||||||
function dol_convertToWord($num, $langs, $currency=false, $centimes=false)
|
function dol_convertToWord($num, $langs, $currency=false, $centimes=false)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$num = str_replace(array(',', ' '), '', trim($num));
|
$num = str_replace(array(',', ' '), '', trim($num));
|
||||||
if(! $num) {
|
if(! $num) {
|
||||||
return false;
|
return false;
|
||||||
@ -48,49 +48,49 @@ function dol_convertToWord($num, $langs, $currency=false, $centimes=false)
|
|||||||
$num = (int) $TNum[0];
|
$num = (int) $TNum[0];
|
||||||
$words = array();
|
$words = array();
|
||||||
$list1 = array(
|
$list1 = array(
|
||||||
'',
|
'',
|
||||||
$langs->transnoentitiesnoconv('one'),
|
$langs->transnoentitiesnoconv('one'),
|
||||||
$langs->transnoentitiesnoconv('two'),
|
$langs->transnoentitiesnoconv('two'),
|
||||||
$langs->transnoentitiesnoconv('three'),
|
$langs->transnoentitiesnoconv('three'),
|
||||||
$langs->transnoentitiesnoconv('four'),
|
$langs->transnoentitiesnoconv('four'),
|
||||||
$langs->transnoentitiesnoconv('five'),
|
$langs->transnoentitiesnoconv('five'),
|
||||||
$langs->transnoentitiesnoconv('six'),
|
$langs->transnoentitiesnoconv('six'),
|
||||||
$langs->transnoentitiesnoconv('seven'),
|
$langs->transnoentitiesnoconv('seven'),
|
||||||
$langs->transnoentitiesnoconv('eight'),
|
$langs->transnoentitiesnoconv('eight'),
|
||||||
$langs->transnoentitiesnoconv('nine'),
|
$langs->transnoentitiesnoconv('nine'),
|
||||||
$langs->transnoentitiesnoconv('ten'),
|
$langs->transnoentitiesnoconv('ten'),
|
||||||
$langs->transnoentitiesnoconv('eleven'),
|
$langs->transnoentitiesnoconv('eleven'),
|
||||||
$langs->transnoentitiesnoconv('twelve'),
|
$langs->transnoentitiesnoconv('twelve'),
|
||||||
$langs->transnoentitiesnoconv('thirteen'),
|
$langs->transnoentitiesnoconv('thirteen'),
|
||||||
$langs->transnoentitiesnoconv('fourteen'),
|
$langs->transnoentitiesnoconv('fourteen'),
|
||||||
$langs->transnoentitiesnoconv('fifteen'),
|
$langs->transnoentitiesnoconv('fifteen'),
|
||||||
$langs->transnoentitiesnoconv('sixteen'),
|
$langs->transnoentitiesnoconv('sixteen'),
|
||||||
$langs->transnoentitiesnoconv('seventeen'),
|
$langs->transnoentitiesnoconv('seventeen'),
|
||||||
$langs->transnoentitiesnoconv('eighteen'),
|
$langs->transnoentitiesnoconv('eighteen'),
|
||||||
$langs->transnoentitiesnoconv('nineteen')
|
$langs->transnoentitiesnoconv('nineteen')
|
||||||
);
|
);
|
||||||
$list2 = array(
|
$list2 = array(
|
||||||
'',
|
'',
|
||||||
$langs->transnoentitiesnoconv('ten'),
|
$langs->transnoentitiesnoconv('ten'),
|
||||||
$langs->transnoentitiesnoconv('twenty'),
|
$langs->transnoentitiesnoconv('twenty'),
|
||||||
$langs->transnoentitiesnoconv('thirty'),
|
$langs->transnoentitiesnoconv('thirty'),
|
||||||
$langs->transnoentitiesnoconv('forty'),
|
$langs->transnoentitiesnoconv('forty'),
|
||||||
$langs->transnoentitiesnoconv('fifty'),
|
$langs->transnoentitiesnoconv('fifty'),
|
||||||
$langs->transnoentitiesnoconv('sixty'),
|
$langs->transnoentitiesnoconv('sixty'),
|
||||||
$langs->transnoentitiesnoconv('seventy'),
|
$langs->transnoentitiesnoconv('seventy'),
|
||||||
$langs->transnoentitiesnoconv('eighty'),
|
$langs->transnoentitiesnoconv('eighty'),
|
||||||
$langs->transnoentitiesnoconv('ninety'),
|
$langs->transnoentitiesnoconv('ninety'),
|
||||||
$langs->transnoentitiesnoconv('hundred')
|
$langs->transnoentitiesnoconv('hundred')
|
||||||
);
|
);
|
||||||
$list3 = array(
|
$list3 = array(
|
||||||
'',
|
'',
|
||||||
$langs->transnoentitiesnoconv('thousand'),
|
$langs->transnoentitiesnoconv('thousand'),
|
||||||
$langs->transnoentitiesnoconv('million'),
|
$langs->transnoentitiesnoconv('million'),
|
||||||
$langs->transnoentitiesnoconv('billion'),
|
$langs->transnoentitiesnoconv('billion'),
|
||||||
$langs->transnoentitiesnoconv('trillion'),
|
$langs->transnoentitiesnoconv('trillion'),
|
||||||
$langs->transnoentitiesnoconv('quadrillion')
|
$langs->transnoentitiesnoconv('quadrillion')
|
||||||
);
|
);
|
||||||
|
|
||||||
$num_length = strlen($num);
|
$num_length = strlen($num);
|
||||||
$levels = (int) (($num_length + 2) / 3);
|
$levels = (int) (($num_length + 2) / 3);
|
||||||
$max_length = $levels * 3;
|
$max_length = $levels * 3;
|
||||||
@ -120,11 +120,11 @@ function dol_convertToWord($num, $langs, $currency=false, $centimes=false)
|
|||||||
$concatWords = implode(' ', $words);
|
$concatWords = implode(' ', $words);
|
||||||
// Delete multi whitespaces
|
// Delete multi whitespaces
|
||||||
$concatWords = trim(preg_replace('/[ ]+/', ' ', $concatWords));
|
$concatWords = trim(preg_replace('/[ ]+/', ' ', $concatWords));
|
||||||
|
|
||||||
if(!empty($currency)) {
|
if(!empty($currency)) {
|
||||||
$concatWords .= ' '.$currency;
|
$concatWords .= ' '.$currency;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we need to write cents call again this function for cents
|
// If we need to write cents call again this function for cents
|
||||||
if(!empty($TNum[1])) {
|
if(!empty($TNum[1])) {
|
||||||
if(!empty($currency)) $concatWords .= ' '.$langs->transnoentities('and');
|
if(!empty($currency)) $concatWords .= ' '.$langs->transnoentities('and');
|
||||||
@ -133,11 +133,11 @@ function dol_convertToWord($num, $langs, $currency=false, $centimes=false)
|
|||||||
}
|
}
|
||||||
return $concatWords;
|
return $concatWords;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to return number or amount in text.
|
* Function to return number or amount in text.
|
||||||
*
|
*
|
||||||
* @deprecated
|
* @deprecated
|
||||||
* @param float $numero Number to convert
|
* @param float $numero Number to convert
|
||||||
* @param Lang $langs Language
|
* @param Lang $langs Language
|
||||||
@ -164,7 +164,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency='number')
|
|||||||
/*In dolibarr 3.6.2 (my current version) doesn't have $langs->default and
|
/*In dolibarr 3.6.2 (my current version) doesn't have $langs->default and
|
||||||
in case exist why ask $lang like a parameter?*/
|
in case exist why ask $lang like a parameter?*/
|
||||||
if (((is_object($langs) && $langs->default == 'es_MX') || (! is_object($langs) && $langs == 'es_MX')) && $numorcurrency == 'currency')
|
if (((is_object($langs) && $langs->default == 'es_MX') || (! is_object($langs) && $langs == 'es_MX')) && $numorcurrency == 'currency')
|
||||||
{
|
{
|
||||||
if ($numero>=1 && $numero<2) {
|
if ($numero>=1 && $numero<2) {
|
||||||
return ("UN PESO ".$parte_decimal." / 100 M.N.");
|
return ("UN PESO ".$parte_decimal." / 100 M.N.");
|
||||||
}
|
}
|
||||||
@ -229,10 +229,11 @@ function dolNumberToWord($numero, $langs, $numorcurrency='number')
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* hundreds2text
|
* hundreds2text
|
||||||
*
|
*
|
||||||
* @param integer $hundreds Hundreds
|
* @param integer $hundreds Hundreds
|
||||||
* @param integer $tens Tens
|
* @param integer $tens Tens
|
||||||
* @param integer $units Units
|
* @param integer $units Units
|
||||||
|
* @return string
|
||||||
*/
|
*/
|
||||||
function hundreds2text($hundreds, $tens, $units)
|
function hundreds2text($hundreds, $tens, $units)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -263,6 +263,7 @@ function pdf_getHeightForLogo($logo, $url = false)
|
|||||||
*
|
*
|
||||||
* @param TCPDF $pdf PDF initialized object
|
* @param TCPDF $pdf PDF initialized object
|
||||||
* @param string $htmlcontent HTML Contect
|
* @param string $htmlcontent HTML Contect
|
||||||
|
* @return number
|
||||||
* @see getStringHeight
|
* @see getStringHeight
|
||||||
*/
|
*/
|
||||||
function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent)
|
function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent)
|
||||||
@ -2120,4 +2121,3 @@ function pdf_getSizeForImage($realpath)
|
|||||||
}
|
}
|
||||||
return array('width'=>$width,'height'=>$height);
|
return array('width'=>$width,'height'=>$height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -150,11 +150,10 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode
|
|||||||
if (! empty($conf->salaries->enabled)) $menuqualified++;
|
if (! empty($conf->salaries->enabled)) $menuqualified++;
|
||||||
if (! empty($conf->supplier_invoice->enabled)) $menuqualified++;
|
if (! empty($conf->supplier_invoice->enabled)) $menuqualified++;
|
||||||
if (! empty($conf->loan->enabled)) $menuqualified++;
|
if (! empty($conf->loan->enabled)) $menuqualified++;
|
||||||
if (! empty($conf->banque->enabled)) $menuqualified++;
|
|
||||||
$tmpentry=array(
|
$tmpentry=array(
|
||||||
'enabled'=>$menuqualified,
|
'enabled'=>$menuqualified,
|
||||||
'perms'=>(! empty($user->rights->facture->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read) || ! empty($user->rights->fournisseur->facture->lire) || ! empty($user->rights->loan->read) || ! empty($user->rights->banque->lire)),
|
'perms'=>(! empty($user->rights->facture->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read) || ! empty($user->rights->fournisseur->facture->lire) || ! empty($user->rights->loan->read)),
|
||||||
'module'=>'facture|supplier_invoice|don|tax|salaries|loan|banque');
|
'module'=>'facture|supplier_invoice|don|tax|salaries|loan');
|
||||||
$showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal);
|
$showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal);
|
||||||
if ($showmode)
|
if ($showmode)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -77,6 +77,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
|
|||||||
* @param int $y y position in user units
|
* @param int $y y position in user units
|
||||||
* @param int $w width in user units
|
* @param int $w width in user units
|
||||||
* @param int $h height in user units
|
* @param int $h height in user units
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function writeBarcode(&$pdf, $code, $encoding, $is2d, $x, $y, $w, $h)
|
private function writeBarcode(&$pdf, $code, $encoding, $is2d, $x, $y, $w, $h)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1302,6 +1302,7 @@ class ExpenseReport extends CommonObject
|
|||||||
* @param User $fuser User
|
* @param User $fuser User
|
||||||
* @param Details $details Details
|
* @param Details $details Details
|
||||||
* @param int $notrigger Disable triggers
|
* @param int $notrigger Disable triggers
|
||||||
|
* @return int
|
||||||
*/
|
*/
|
||||||
function setDeny($fuser,$details,$notrigger=0)
|
function setDeny($fuser,$details,$notrigger=0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2904,7 +2904,7 @@ else
|
|||||||
if ($resteapayeraffiche <= 0)
|
if ($resteapayeraffiche <= 0)
|
||||||
print $langs->trans('RemainderToPayBack');
|
print $langs->trans('RemainderToPayBack');
|
||||||
else
|
else
|
||||||
print $langs->trans('ExcessPaydBack');
|
print $langs->trans('ExcessPaid');
|
||||||
print ' :</td>';
|
print ' :</td>';
|
||||||
print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopay"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($sign * $resteapayeraffiche) . '</td>';
|
print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopay"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($sign * $resteapayeraffiche) . '</td>';
|
||||||
print '<td class="nowrap"> </td></tr>';
|
print '<td class="nowrap"> </td></tr>';
|
||||||
|
|||||||
@ -32,6 +32,10 @@
|
|||||||
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
|
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
|
||||||
|
|
||||||
|
|
||||||
|
-- Forgot in < 4.0
|
||||||
|
|
||||||
|
ALTER TABLE llx_c_ziptown DROP FOREIGN KEY fk_c_ziptown_fk_pays;
|
||||||
|
ALTER TABLE llx_c_ziptown ADD CONSTRAINT fk_c_ziptown_fk_pays FOREIGN KEY (fk_pays) REFERENCES llx_c_country(rowid);
|
||||||
|
|
||||||
-- Forgot in 7.0
|
-- Forgot in 7.0
|
||||||
|
|
||||||
@ -49,6 +53,7 @@ ALTER TABLE llx_ecm_files ADD UNIQUE INDEX uk_ecm_files (filepath, filename, ent
|
|||||||
UPDATE llx_const set name = __ENCRYPT('INVOICE_FREE_TEXT')__ where name = __ENCRYPT('FACTURE_FREE_TEXT')__;
|
UPDATE llx_const set name = __ENCRYPT('INVOICE_FREE_TEXT')__ where name = __ENCRYPT('FACTURE_FREE_TEXT')__;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- drop very old table (bad name)
|
-- drop very old table (bad name)
|
||||||
DROP TABLE llx_c_accountancy_category;
|
DROP TABLE llx_c_accountancy_category;
|
||||||
DROP TABLE llx_c_accountingaccount;
|
DROP TABLE llx_c_accountingaccount;
|
||||||
|
|||||||
@ -35,7 +35,7 @@ AgendaAutoActionDesc= Define here events for which you want Dolibarr to create a
|
|||||||
AgendaSetupOtherDesc= This page provides options to allow export of your Dolibarr events into an external calendar (thunderbird, google calendar, ...)
|
AgendaSetupOtherDesc= This page provides options to allow export of your Dolibarr events into an external calendar (thunderbird, google calendar, ...)
|
||||||
AgendaExtSitesDesc=This page allows to declare external sources of calendars to see their events into Dolibarr agenda.
|
AgendaExtSitesDesc=This page allows to declare external sources of calendars to see their events into Dolibarr agenda.
|
||||||
ActionsEvents=Events for which Dolibarr will create an action in agenda automatically
|
ActionsEvents=Events for which Dolibarr will create an action in agenda automatically
|
||||||
EventRemindersByEmailNotEnabled=Event reminders by email was not enabled into Agenda module setup.
|
EventRemindersByEmailNotEnabled=Event reminders by email was not enabled into %s module setup.
|
||||||
##### Agenda event labels #####
|
##### Agenda event labels #####
|
||||||
NewCompanyToDolibarr=Third party %s created
|
NewCompanyToDolibarr=Third party %s created
|
||||||
ContractValidatedInDolibarr=Contract %s validated
|
ContractValidatedInDolibarr=Contract %s validated
|
||||||
|
|||||||
@ -65,8 +65,9 @@ ErrorNoValueForSelectType=Please fill value for select list
|
|||||||
ErrorNoValueForCheckBoxType=Please fill value for checkbox list
|
ErrorNoValueForCheckBoxType=Please fill value for checkbox list
|
||||||
ErrorNoValueForRadioType=Please fill value for radio list
|
ErrorNoValueForRadioType=Please fill value for radio list
|
||||||
ErrorBadFormatValueList=The list value cannot have more than one comma: <u>%s</u>, but need at least one: key,value
|
ErrorBadFormatValueList=The list value cannot have more than one comma: <u>%s</u>, but need at least one: key,value
|
||||||
ErrorFieldCanNotContainSpecialCharacters=Field <b>%s</b> must not contains special characters.
|
ErrorFieldCanNotContainSpecialCharacters=The field <b>%s</b> must not contains special characters.
|
||||||
ErrorFieldCanNotContainSpecialNorUpperCharacters=Field <b>%s</b> must not contain special characters, nor upper case characters and cannot contain only numbers.
|
ErrorFieldCanNotContainSpecialNorUpperCharacters=The field <b>%s</b> must not contain special characters, nor upper case characters and cannot contain only numbers.
|
||||||
|
ErrorFieldMustHaveXChar=The field <b>%s</b> must have at least %s characters.
|
||||||
ErrorNoAccountancyModuleLoaded=No accountancy module activated
|
ErrorNoAccountancyModuleLoaded=No accountancy module activated
|
||||||
ErrorExportDuplicateProfil=This profile name already exists for this export set.
|
ErrorExportDuplicateProfil=This profile name already exists for this export set.
|
||||||
ErrorLDAPSetupNotComplete=Dolibarr-LDAP matching is not complete.
|
ErrorLDAPSetupNotComplete=Dolibarr-LDAP matching is not complete.
|
||||||
|
|||||||
@ -62,6 +62,7 @@ CreateByFetchingExternalPage=Create page/container by fetching page from externa
|
|||||||
OrEnterPageInfoManually=Or create empty page from scratch...
|
OrEnterPageInfoManually=Or create empty page from scratch...
|
||||||
FetchAndCreate=Fetch and Create
|
FetchAndCreate=Fetch and Create
|
||||||
ExportSite=Export site
|
ExportSite=Export site
|
||||||
|
ImportSite=Import site
|
||||||
IDOfPage=Id of page
|
IDOfPage=Id of page
|
||||||
Banner=Banner
|
Banner=Banner
|
||||||
BlogPost=Blog post
|
BlogPost=Blog post
|
||||||
@ -84,4 +85,5 @@ SubdirOfPage=Sub-directory dedicated to page
|
|||||||
AliasPageAlreadyExists=Alias page <strong>%s</strong> already exists
|
AliasPageAlreadyExists=Alias page <strong>%s</strong> already exists
|
||||||
CorporateHomePage=Corporate Home page
|
CorporateHomePage=Corporate Home page
|
||||||
EmptyPage=Empty page
|
EmptyPage=Empty page
|
||||||
ExternalURLMustStartWithHttp=External URL must start with http:// or https://
|
ExternalURLMustStartWithHttp=External URL must start with http:// or https://
|
||||||
|
ZipOfWebsitePackageToImport=Zip file of website package
|
||||||
@ -155,5 +155,6 @@ if (GETPOST('withtab', 'alpha')) {
|
|||||||
|
|
||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -2487,8 +2487,6 @@ elseif (! empty($module))
|
|||||||
|
|
||||||
dol_fiche_end(); // End modules
|
dol_fiche_end(); // End modules
|
||||||
|
|
||||||
|
// End of page
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -233,6 +233,6 @@ if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read)
|
|||||||
|
|
||||||
print '</div></div></div>';
|
print '</div></div></div>';
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -256,7 +256,6 @@ if ($object->id > 0)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -467,7 +467,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -161,6 +161,6 @@ else
|
|||||||
accessforbidden('',0,0);
|
accessforbidden('',0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -159,6 +159,6 @@ if ($id > 0 || ! empty($ref))
|
|||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -99,6 +99,7 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Global test setup
|
* Global test setup
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass()
|
||||||
{
|
{
|
||||||
@ -106,6 +107,7 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Unit test setup
|
* Unit test setup
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
@ -115,6 +117,7 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Verify pre conditions
|
* Verify pre conditions
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function assertPreConditions()
|
protected function assertPreConditions()
|
||||||
{
|
{
|
||||||
@ -122,6 +125,7 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle Dolibarr authentication
|
* Handle Dolibarr authentication
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function authenticate()
|
private function authenticate()
|
||||||
{
|
{
|
||||||
@ -142,6 +146,7 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Test enabling developer mode
|
* Test enabling developer mode
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function testEnableDeveloperMode()
|
public function testEnableDeveloperMode()
|
||||||
{
|
{
|
||||||
@ -161,6 +166,7 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
|
|||||||
* Test enabling the module
|
* Test enabling the module
|
||||||
*
|
*
|
||||||
* @depends testEnableDeveloperMode
|
* @depends testEnableDeveloperMode
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function testModuleEnabled()
|
public function testModuleEnabled()
|
||||||
{
|
{
|
||||||
@ -186,6 +192,7 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
|
|||||||
* Test access to the configuration page
|
* Test access to the configuration page
|
||||||
*
|
*
|
||||||
* @depends testModuleEnabled
|
* @depends testModuleEnabled
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function testConfigurationPage()
|
public function testConfigurationPage()
|
||||||
{
|
{
|
||||||
@ -198,6 +205,7 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
|
|||||||
* Test access to the about page
|
* Test access to the about page
|
||||||
*
|
*
|
||||||
* @depends testConfigurationPage
|
* @depends testConfigurationPage
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function testAboutPage()
|
public function testAboutPage()
|
||||||
{
|
{
|
||||||
@ -210,6 +218,7 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
|
|||||||
* Test about page is rendering Markdown
|
* Test about page is rendering Markdown
|
||||||
*
|
*
|
||||||
* @depends testAboutPage
|
* @depends testAboutPage
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function testAboutPageRendersMarkdownReadme()
|
public function testAboutPageRendersMarkdownReadme()
|
||||||
{
|
{
|
||||||
@ -226,6 +235,7 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
|
|||||||
* Test box is properly declared
|
* Test box is properly declared
|
||||||
*
|
*
|
||||||
* @depends testModuleEnabled
|
* @depends testModuleEnabled
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function testBoxDeclared()
|
public function testBoxDeclared()
|
||||||
{
|
{
|
||||||
@ -238,6 +248,7 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
|
|||||||
* Test trigger is properly enabled
|
* Test trigger is properly enabled
|
||||||
*
|
*
|
||||||
* @depends testModuleEnabled
|
* @depends testModuleEnabled
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function testTriggerDeclared()
|
public function testTriggerDeclared()
|
||||||
{
|
{
|
||||||
@ -254,6 +265,7 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
|
|||||||
* Test trigger is properly declared
|
* Test trigger is properly declared
|
||||||
*
|
*
|
||||||
* @depends testTriggerDeclared
|
* @depends testTriggerDeclared
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function testTriggerEnabled()
|
public function testTriggerEnabled()
|
||||||
{
|
{
|
||||||
@ -268,6 +280,7 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Verify post conditions
|
* Verify post conditions
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function assertPostConditions()
|
protected function assertPostConditions()
|
||||||
{
|
{
|
||||||
@ -275,6 +288,7 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Unit test teardown
|
* Unit test teardown
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function tearDown()
|
public function tearDown()
|
||||||
{
|
{
|
||||||
@ -282,6 +296,7 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Global test teardown
|
* Global test teardown
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -32,6 +32,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Global test setup
|
* Global test setup
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass()
|
||||||
{
|
{
|
||||||
@ -40,6 +41,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Unit test setup
|
* Unit test setup
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function setUp()
|
protected function setUp()
|
||||||
{
|
{
|
||||||
@ -48,6 +50,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Verify pre conditions
|
* Verify pre conditions
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function assertPreConditions()
|
protected function assertPreConditions()
|
||||||
{
|
{
|
||||||
@ -56,6 +59,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A sample test
|
* A sample test
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function testSomething()
|
public function testSomething()
|
||||||
{
|
{
|
||||||
@ -66,6 +70,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Verify post conditions
|
* Verify post conditions
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function assertPostConditions()
|
protected function assertPostConditions()
|
||||||
{
|
{
|
||||||
@ -74,6 +79,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Unit test teardown
|
* Unit test teardown
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function tearDown()
|
protected function tearDown()
|
||||||
{
|
{
|
||||||
@ -82,6 +88,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Global test teardown
|
* Global test teardown
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass()
|
||||||
{
|
{
|
||||||
@ -92,6 +99,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
|
|||||||
* Unsuccessful test
|
* Unsuccessful test
|
||||||
*
|
*
|
||||||
* @param Exception $e Exception
|
* @param Exception $e Exception
|
||||||
|
* @return void
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
protected function onNotSuccessfulTest(Exception $e)
|
protected function onNotSuccessfulTest(Exception $e)
|
||||||
|
|||||||
@ -93,7 +93,7 @@ class MultiCurrency extends CommonObject
|
|||||||
public function __construct(DoliDB $db)
|
public function __construct(DoliDB $db)
|
||||||
{
|
{
|
||||||
$this->db = &$db;
|
$this->db = &$db;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,21 +108,21 @@ class MultiCurrency extends CommonObject
|
|||||||
public function create(User $user, $trigger = true)
|
public function create(User $user, $trigger = true)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
dol_syslog('Currency::create', LOG_DEBUG);
|
dol_syslog('Currency::create', LOG_DEBUG);
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if (self::checkCodeAlreadyExists($this->code))
|
if (self::checkCodeAlreadyExists($this->code))
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$this->errors[] = $langs->trans('multicurrency_code_already_added');
|
$this->errors[] = $langs->trans('multicurrency_code_already_added');
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->entity) || $this->entity <= 0) $this->entity = $conf->entity;
|
if (empty($this->entity) || $this->entity <= 0) $this->entity = $conf->entity;
|
||||||
$now=date('Y-m-d H:i:s');
|
$now=date('Y-m-d H:i:s');
|
||||||
|
|
||||||
// Insert request
|
// Insert request
|
||||||
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . '(';
|
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . '(';
|
||||||
$sql .= ' code,';
|
$sql .= ' code,';
|
||||||
@ -152,7 +152,7 @@ class MultiCurrency extends CommonObject
|
|||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
|
||||||
$this->date_create = $now;
|
$this->date_create = $now;
|
||||||
$this->fk_user = $user->id;
|
$this->fk_user = $user->id;
|
||||||
|
|
||||||
if ($trigger) {
|
if ($trigger) {
|
||||||
$result=$this->call_trigger('CURRENCY_CREATE', $user);
|
$result=$this->call_trigger('CURRENCY_CREATE', $user);
|
||||||
if ($result < 0) $error++;
|
if ($result < 0) $error++;
|
||||||
@ -181,7 +181,7 @@ class MultiCurrency extends CommonObject
|
|||||||
public function fetch($id, $code = null)
|
public function fetch($id, $code = null)
|
||||||
{
|
{
|
||||||
dol_syslog('Currency::fetch', LOG_DEBUG);
|
dol_syslog('Currency::fetch', LOG_DEBUG);
|
||||||
|
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = 'SELECT';
|
$sql = 'SELECT';
|
||||||
@ -192,7 +192,7 @@ class MultiCurrency extends CommonObject
|
|||||||
|
|
||||||
dol_syslog(__METHOD__,LOG_DEBUG);
|
dol_syslog(__METHOD__,LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$numrows = $this->db->num_rows($resql);
|
$numrows = $this->db->num_rows($resql);
|
||||||
if ($numrows) {
|
if ($numrows) {
|
||||||
@ -204,7 +204,7 @@ class MultiCurrency extends CommonObject
|
|||||||
$this->entity = $obj->entity;
|
$this->entity = $obj->entity;
|
||||||
$this->date_create = $obj->date_create;
|
$this->date_create = $obj->date_create;
|
||||||
$this->fk_user = $obj->fk_user;
|
$this->fk_user = $obj->fk_user;
|
||||||
|
|
||||||
$this->fetchAllCurrencyRate();
|
$this->fetchAllCurrencyRate();
|
||||||
$this->getRate();
|
$this->getRate();
|
||||||
}
|
}
|
||||||
@ -234,7 +234,7 @@ class MultiCurrency extends CommonObject
|
|||||||
$sql.= ' FROM ' . MAIN_DB_PREFIX . $this->table_element_line. ' as cr';
|
$sql.= ' FROM ' . MAIN_DB_PREFIX . $this->table_element_line. ' as cr';
|
||||||
$sql.= ' WHERE cr.fk_multicurrency = '.$this->id;
|
$sql.= ' WHERE cr.fk_multicurrency = '.$this->id;
|
||||||
$sql.= ' ORDER BY cr.date_sync DESC';
|
$sql.= ' ORDER BY cr.date_sync DESC';
|
||||||
|
|
||||||
$this->rates = array();
|
$this->rates = array();
|
||||||
|
|
||||||
dol_syslog(__METHOD__,LOG_DEBUG);
|
dol_syslog(__METHOD__,LOG_DEBUG);
|
||||||
@ -245,7 +245,7 @@ class MultiCurrency extends CommonObject
|
|||||||
while ($obj = $this->db->fetch_object($resql)) {
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
$rate = new CurrencyRate($this->db);
|
$rate = new CurrencyRate($this->db);
|
||||||
$rate->fetch($obj->rowid);
|
$rate->fetch($obj->rowid);
|
||||||
|
|
||||||
$this->rates[] = $rate;
|
$this->rates[] = $rate;
|
||||||
}
|
}
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
@ -272,19 +272,19 @@ class MultiCurrency extends CommonObject
|
|||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
dol_syslog('Currency::update', LOG_DEBUG);
|
dol_syslog('Currency::update', LOG_DEBUG);
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
$this->name = trim($this->name);
|
$this->name = trim($this->name);
|
||||||
$this->code = trim($this->code);
|
$this->code = trim($this->code);
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (empty($this->code)) {
|
if (empty($this->code)) {
|
||||||
$error++;
|
$error++;
|
||||||
dol_syslog('Currency::update $this->code can not be empty', LOG_ERR);
|
dol_syslog('Currency::update $this->code can not be empty', LOG_ERR);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update request
|
// Update request
|
||||||
$sql = 'UPDATE ' . MAIN_DB_PREFIX . $this->table_element . ' SET';
|
$sql = 'UPDATE ' . MAIN_DB_PREFIX . $this->table_element . ' SET';
|
||||||
$sql .= ' name=\''.$this->db->escape($this->name).'\'';
|
$sql .= ' name=\''.$this->db->escape($this->name).'\'';
|
||||||
@ -328,7 +328,7 @@ class MultiCurrency extends CommonObject
|
|||||||
public function delete($trigger = true)
|
public function delete($trigger = true)
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
dol_syslog('Currency::delete', LOG_DEBUG);
|
dol_syslog('Currency::delete', LOG_DEBUG);
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
@ -347,7 +347,7 @@ class MultiCurrency extends CommonObject
|
|||||||
$this->errors[] = 'Error ' . $this->db->lasterror();
|
$this->errors[] = 'Error ' . $this->db->lasterror();
|
||||||
dol_syslog('Currency::delete ' . join(',', $this->errors), LOG_ERR);
|
dol_syslog('Currency::delete ' . join(',', $this->errors), LOG_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element;
|
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element;
|
||||||
$sql .= ' WHERE rowid=' . $this->id;
|
$sql .= ' WHERE rowid=' . $this->id;
|
||||||
|
|
||||||
@ -371,7 +371,7 @@ class MultiCurrency extends CommonObject
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete rates in database
|
* Delete rates in database
|
||||||
*
|
*
|
||||||
@ -386,137 +386,137 @@ class MultiCurrency extends CommonObject
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete rate in database
|
* Delete rate in database
|
||||||
*
|
*
|
||||||
* @param double $rate rate value
|
* @param double $rate rate value
|
||||||
*
|
*
|
||||||
* @return int -1 if KO, 1 if OK
|
* @return int -1 if KO, 1 if OK
|
||||||
*/
|
*/
|
||||||
public function addRate($rate)
|
public function addRate($rate)
|
||||||
{
|
{
|
||||||
$currencyRate = new CurrencyRate($this->db);
|
$currencyRate = new CurrencyRate($this->db);
|
||||||
$currencyRate->rate = $rate;
|
$currencyRate->rate = $rate;
|
||||||
|
|
||||||
if ($currencyRate->create($this->id) > 0)
|
if ($currencyRate->create($this->id) > 0)
|
||||||
{
|
{
|
||||||
$this->rate = $currencyRate;
|
$this->rate = $currencyRate;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->rate = null;
|
$this->rate = null;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Try get label of code in llx_currency then add rate
|
* Try get label of code in llx_currency then add rate
|
||||||
*
|
*
|
||||||
* @param string $code currency code
|
* @param string $code currency code
|
||||||
* @param double $rate new rate
|
* @param double $rate new rate
|
||||||
*
|
*
|
||||||
* @return int -1 if KO, 1 if OK, 2 if label found and OK
|
* @return int -1 if KO, 1 if OK, 2 if label found and OK
|
||||||
*/
|
*/
|
||||||
function addRateFromDolibarr($code, $rate)
|
function addRateFromDolibarr($code, $rate)
|
||||||
{
|
{
|
||||||
global $db, $user;
|
global $db, $user;
|
||||||
|
|
||||||
$currency = new MultiCurrency($db);
|
$currency = new MultiCurrency($db);
|
||||||
$currency->code = $code;
|
$currency->code = $code;
|
||||||
$currency->name = $code;
|
$currency->name = $code;
|
||||||
|
|
||||||
$sql = 'SELECT label FROM '.MAIN_DB_PREFIX.'c_currencies WHERE code_iso = \''.$db->escape($code).'\'';
|
$sql = 'SELECT label FROM '.MAIN_DB_PREFIX.'c_currencies WHERE code_iso = \''.$db->escape($code).'\'';
|
||||||
|
|
||||||
dol_syslog(__METHOD__,LOG_DEBUG);
|
dol_syslog(__METHOD__,LOG_DEBUG);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql && ($line = $db->fetch_object($resql)))
|
if ($resql && ($line = $db->fetch_object($resql)))
|
||||||
{
|
{
|
||||||
$currency->name = $line->label;
|
$currency->name = $line->label;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($currency->create($user) > 0)
|
if ($currency->create($user) > 0)
|
||||||
{
|
{
|
||||||
$currency->addRate($rate);
|
$currency->addRate($rate);
|
||||||
|
|
||||||
if (!empty($line)) return 2;
|
if (!empty($line)) return 2;
|
||||||
else return 1;
|
else return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add new entry into llx_multicurrency_rate to historise
|
* Add new entry into llx_multicurrency_rate to historise
|
||||||
*
|
*
|
||||||
* @param double $rate rate value
|
* @param double $rate rate value
|
||||||
*
|
*
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function updateRate($rate)
|
public function updateRate($rate)
|
||||||
{
|
{
|
||||||
return $this->addRate($rate);
|
return $this->addRate($rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch CurrencyRate object in $this->rate
|
* Fetch CurrencyRate object in $this->rate
|
||||||
*
|
*
|
||||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function getRate()
|
public function getRate()
|
||||||
{
|
{
|
||||||
$sql = 'SELECT cr.rowid';
|
$sql = 'SELECT cr.rowid';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element_line.' as cr';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element_line.' as cr';
|
||||||
$sql.= ' WHERE cr.fk_multicurrency = '.$this->id;
|
$sql.= ' WHERE cr.fk_multicurrency = '.$this->id;
|
||||||
$sql.= ' AND cr.date_sync = (SELECT MAX(cr2.date_sync) FROM '.MAIN_DB_PREFIX.$this->table_element_line.' AS cr2 WHERE cr2.fk_multicurrency = '.$this->id.')';
|
$sql.= ' AND cr.date_sync = (SELECT MAX(cr2.date_sync) FROM '.MAIN_DB_PREFIX.$this->table_element_line.' AS cr2 WHERE cr2.fk_multicurrency = '.$this->id.')';
|
||||||
|
|
||||||
dol_syslog(__METHOD__,LOG_DEBUG);
|
dol_syslog(__METHOD__,LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql && ($obj = $this->db->fetch_object($resql))) {
|
if ($resql && ($obj = $this->db->fetch_object($resql))) {
|
||||||
$this->rate = new CurrencyRate($this->db);
|
$this->rate = new CurrencyRate($this->db);
|
||||||
return $this->rate->fetch($obj->rowid);
|
return $this->rate->fetch($obj->rowid);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get id of currency from code
|
* Get id of currency from code
|
||||||
*
|
*
|
||||||
* @param DoliDB $db object db
|
* @param DoliDB $db object db
|
||||||
* @param string $code code value search
|
* @param string $code code value search
|
||||||
*
|
*
|
||||||
* @return 0 if not found, >0 if OK
|
* @return 0 if not found, >0 if OK
|
||||||
*/
|
*/
|
||||||
public static function getIdFromCode(&$db, $code)
|
public static function getIdFromCode(&$db, $code)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'multicurrency WHERE code = \''.$db->escape($code).'\' AND entity = '.$conf->entity;
|
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'multicurrency WHERE code = \''.$db->escape($code).'\' AND entity = '.$conf->entity;
|
||||||
|
|
||||||
dol_syslog(__METHOD__,LOG_DEBUG);
|
dol_syslog(__METHOD__,LOG_DEBUG);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql && $obj = $db->fetch_object($resql)) return $obj->rowid;
|
if ($resql && $obj = $db->fetch_object($resql)) return $obj->rowid;
|
||||||
else return 0;
|
else return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get id and rate of currency from code
|
* Get id and rate of currency from code
|
||||||
*
|
*
|
||||||
* @param DoliDB $db object db
|
* @param DoliDB $db object db
|
||||||
* @param string $code code value search
|
* @param string $code code value search
|
||||||
* @param date $date_document date from document (propal, order, invoice, ...)
|
* @param date $date_document date from document (propal, order, invoice, ...)
|
||||||
*
|
*
|
||||||
* @return array [0] => id currency
|
* @return array [0] => id currency
|
||||||
* [1] => rate
|
* [1] => rate
|
||||||
*/
|
*/
|
||||||
public static function getIdAndTxFromCode(&$db, $code, $date_document='')
|
public static function getIdAndTxFromCode(&$db, $code, $date_document='')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql1 = 'SELECT m.rowid, mc.rate FROM '.MAIN_DB_PREFIX.'multicurrency m';
|
$sql1 = 'SELECT m.rowid, mc.rate FROM '.MAIN_DB_PREFIX.'multicurrency m';
|
||||||
$sql1.= ' LEFT JOIN '.MAIN_DB_PREFIX.'multicurrency_rate mc ON (m.rowid = mc.fk_multicurrency)';
|
$sql1.= ' LEFT JOIN '.MAIN_DB_PREFIX.'multicurrency_rate mc ON (m.rowid = mc.fk_multicurrency)';
|
||||||
$sql1.= ' WHERE m.code = \''.$db->escape($code).'\'';
|
$sql1.= ' WHERE m.code = \''.$db->escape($code).'\'';
|
||||||
@ -524,10 +524,10 @@ class MultiCurrency extends CommonObject
|
|||||||
$sql2= '';
|
$sql2= '';
|
||||||
if (!empty($conf->global->MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE) && !empty($date_document)) $sql2.= ' AND DATE_FORMAT(mc.date_sync, "%Y-%m-%d") = "'.date('Y-m-d', $date_document).'"';
|
if (!empty($conf->global->MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE) && !empty($date_document)) $sql2.= ' AND DATE_FORMAT(mc.date_sync, "%Y-%m-%d") = "'.date('Y-m-d', $date_document).'"';
|
||||||
$sql3.= ' ORDER BY mc.date_sync DESC LIMIT 1';
|
$sql3.= ' ORDER BY mc.date_sync DESC LIMIT 1';
|
||||||
|
|
||||||
dol_syslog(__METHOD__,LOG_DEBUG);
|
dol_syslog(__METHOD__,LOG_DEBUG);
|
||||||
$resql = $db->query($sql1.$sql2.$sql3);
|
$resql = $db->query($sql1.$sql2.$sql3);
|
||||||
|
|
||||||
if ($resql && $obj = $db->fetch_object($resql)) return array($obj->rowid, $obj->rate);
|
if ($resql && $obj = $db->fetch_object($resql)) return array($obj->rowid, $obj->rate);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -536,67 +536,68 @@ class MultiCurrency extends CommonObject
|
|||||||
$resql = $db->query($sql1.$sql3);
|
$resql = $db->query($sql1.$sql3);
|
||||||
if ($resql && $obj = $db->fetch_object($resql)) return array($obj->rowid, $obj->rate);
|
if ($resql && $obj = $db->fetch_object($resql)) return array($obj->rowid, $obj->rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(0, 1);
|
return array(0, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the conversion of amount with invoice rate
|
* Get the conversion of amount with invoice rate
|
||||||
*
|
*
|
||||||
* @param int $fk_facture id of facture
|
* @param int $fk_facture id of facture
|
||||||
* @param double $amount amount to convert
|
* @param double $amount amount to convert
|
||||||
* @param string $way dolibarr mean the amount is in dolibarr currency
|
* @param string $way dolibarr mean the amount is in dolibarr currency
|
||||||
* @param string $table facture or facture_fourn
|
* @param string $table facture or facture_fourn
|
||||||
*
|
*
|
||||||
* @return double amount converted
|
* @return double amount converted
|
||||||
*/
|
*/
|
||||||
public static function getAmountConversionFromInvoiceRate($fk_facture, $amount, $way='dolibarr', $table='facture')
|
public static function getAmountConversionFromInvoiceRate($fk_facture, $amount, $way='dolibarr', $table='facture')
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$multicurrency_tx = self::getInvoiceRate($fk_facture, $table);
|
$multicurrency_tx = self::getInvoiceRate($fk_facture, $table);
|
||||||
|
|
||||||
if ($multicurrency_tx)
|
if ($multicurrency_tx)
|
||||||
{
|
{
|
||||||
if ($way == 'dolibarr') return $amount * $multicurrency_tx;
|
if ($way == 'dolibarr') return $amount * $multicurrency_tx;
|
||||||
else return $amount / $multicurrency_tx;
|
else return $amount / $multicurrency_tx;
|
||||||
}
|
}
|
||||||
else return $amount;
|
else return $amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get current invoite rate
|
* Get current invoite rate
|
||||||
*
|
*
|
||||||
* @param int $fk_facture id of facture
|
* @param int $fk_facture id of facture
|
||||||
* @param string $table facture or facture_fourn
|
* @param string $table facture or facture_fourn
|
||||||
*/
|
* @return bool
|
||||||
public static function getInvoiceRate($fk_facture, $table='facture')
|
*/
|
||||||
{
|
public static function getInvoiceRate($fk_facture, $table='facture')
|
||||||
global $db;
|
{
|
||||||
|
global $db;
|
||||||
$sql = 'SELECT multicurrency_tx FROM '.MAIN_DB_PREFIX.$table.' WHERE rowid = '.$fk_facture;
|
|
||||||
|
$sql = 'SELECT multicurrency_tx FROM '.MAIN_DB_PREFIX.$table.' WHERE rowid = '.$fk_facture;
|
||||||
dol_syslog(__METHOD__,LOG_DEBUG);
|
|
||||||
$resql = $db->query($sql);
|
dol_syslog(__METHOD__,LOG_DEBUG);
|
||||||
if ($resql && ($line = $db->fetch_object($resql)))
|
$resql = $db->query($sql);
|
||||||
{
|
if ($resql && ($line = $db->fetch_object($resql)))
|
||||||
|
{
|
||||||
return $line->multicurrency_tx;
|
return $line->multicurrency_tx;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* With free account we can't set source then recalcul all rates to force another source
|
* With free account we can't set source then recalcul all rates to force another source
|
||||||
*
|
*
|
||||||
* @param stdClass $TRate Object containing all currencies rates
|
* @param stdClass $TRate Object containing all currencies rates
|
||||||
* @return -1 if KO, 0 if nothing, 1 if OK
|
* @return -1 if KO, 0 if nothing, 1 if OK
|
||||||
*/
|
*/
|
||||||
public static function recalculRates(&$TRate)
|
public static function recalculRates(&$TRate)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
if (!empty($conf->global->MULTICURRENCY_ALTERNATE_SOURCE))
|
if (!empty($conf->global->MULTICURRENCY_ALTERNATE_SOURCE))
|
||||||
{
|
{
|
||||||
$alternate_source = 'USD'.$conf->global->MULTICURRENCY_ALTERNATE_SOURCE;
|
$alternate_source = 'USD'.$conf->global->MULTICURRENCY_ALTERNATE_SOURCE;
|
||||||
@ -607,38 +608,39 @@ class MultiCurrency extends CommonObject
|
|||||||
{
|
{
|
||||||
$rate *= $coef;
|
$rate *= $coef;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1; // Alternate souce not found
|
return -1; // Alternate souce not found
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0; // Nothing to do
|
return 0; // Nothing to do
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sync rates from api
|
* Sync rates from api
|
||||||
*
|
*
|
||||||
* @param array $response array of reponse from api to sync dolibarr rates
|
* @param array $response array of reponse from api to sync dolibarr rates
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function syncRates($response)
|
public static function syncRates($response)
|
||||||
{
|
{
|
||||||
global $db,$conf;
|
global $db,$conf;
|
||||||
|
|
||||||
$ch = curl_init('http://apilayer.net/api/live?access_key='.$key.'');
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
||||||
$response = curl_exec($ch);
|
|
||||||
curl_close($ch);
|
|
||||||
$response = json_decode($response);
|
|
||||||
|
|
||||||
if ($response->success)
|
$ch = curl_init('http://apilayer.net/api/live?access_key='.$key.'');
|
||||||
{
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
$response = curl_exec($ch);
|
||||||
|
curl_close($ch);
|
||||||
|
$response = json_decode($response);
|
||||||
|
|
||||||
|
if ($response->success)
|
||||||
|
{
|
||||||
|
|
||||||
$TRate = $response->quotes;
|
$TRate = $response->quotes;
|
||||||
$timestamp = $response->timestamp;
|
$timestamp = $response->timestamp;
|
||||||
|
|
||||||
if (self::recalculRates($TRate) >= 0)
|
if (self::recalculRates($TRate) >= 0)
|
||||||
{
|
{
|
||||||
foreach ($TRate as $currency_code => $rate)
|
foreach ($TRate as $currency_code => $rate)
|
||||||
{
|
{
|
||||||
@ -648,11 +650,11 @@ class MultiCurrency extends CommonObject
|
|||||||
{
|
{
|
||||||
$obj->updateRate($rate);
|
$obj->updateRate($rate);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
self::addRateFromDolibarr($code, $rate);
|
self::addRateFromDolibarr($code, $rate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -660,21 +662,21 @@ class MultiCurrency extends CommonObject
|
|||||||
setEventMessages($langs->trans('multicurrency_syncronize_error', $response->error->info), null, 'errors');
|
setEventMessages($langs->trans('multicurrency_syncronize_error', $response->error->info), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check in database if the current code already exists
|
* Check in database if the current code already exists
|
||||||
*
|
*
|
||||||
* @param string $code current code to search
|
* @param string $code current code to search
|
||||||
* @return boolean True if exists, false if not exists
|
* @return boolean True if exists, false if not exists
|
||||||
*/
|
*/
|
||||||
public static function checkCodeAlreadyExists($code)
|
public static function checkCodeAlreadyExists($code)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$currency = new MultiCurrency($db);
|
$currency = new MultiCurrency($db);
|
||||||
if ($currency->fetch('', $code) > 0) return true;
|
if ($currency->fetch('', $code) > 0) return true;
|
||||||
else return false;
|
else return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -710,7 +712,7 @@ class CurrencyRate extends CommonObjectLine
|
|||||||
* @var int Id of entity
|
* @var int Id of entity
|
||||||
*/
|
*/
|
||||||
public $entity;
|
public $entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
@ -719,10 +721,10 @@ class CurrencyRate extends CommonObjectLine
|
|||||||
public function __construct(DoliDB $db)
|
public function __construct(DoliDB $db)
|
||||||
{
|
{
|
||||||
$this->db = &$db;
|
$this->db = &$db;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create object into database
|
* Create object into database
|
||||||
*
|
*
|
||||||
@ -734,14 +736,14 @@ class CurrencyRate extends CommonObjectLine
|
|||||||
public function create($fk_multicurrency, $trigger = true)
|
public function create($fk_multicurrency, $trigger = true)
|
||||||
{
|
{
|
||||||
global $conf, $user;
|
global $conf, $user;
|
||||||
|
|
||||||
dol_syslog('CurrencyRate::create', LOG_DEBUG);
|
dol_syslog('CurrencyRate::create', LOG_DEBUG);
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
$this->rate = price2num($this->rate);
|
$this->rate = price2num($this->rate);
|
||||||
if (empty($this->entity) || $this->entity <= 0) $this->entity = $conf->entity;
|
if (empty($this->entity) || $this->entity <= 0) $this->entity = $conf->entity;
|
||||||
$now=date('Y-m-d H:i:s');
|
$now=date('Y-m-d H:i:s');
|
||||||
|
|
||||||
// Insert request
|
// Insert request
|
||||||
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . '(';
|
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . '(';
|
||||||
$sql .= ' rate,';
|
$sql .= ' rate,';
|
||||||
@ -769,7 +771,7 @@ class CurrencyRate extends CommonObjectLine
|
|||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
|
||||||
$this->fk_multicurrency = $fk_multicurrency;
|
$this->fk_multicurrency = $fk_multicurrency;
|
||||||
$this->date_sync = $now;
|
$this->date_sync = $now;
|
||||||
|
|
||||||
if ($trigger) {
|
if ($trigger) {
|
||||||
$result=$this->call_trigger('CURRENCYRATE_CREATE', $user);
|
$result=$this->call_trigger('CURRENCYRATE_CREATE', $user);
|
||||||
if ($result < 0) $error++;
|
if ($result < 0) $error++;
|
||||||
@ -829,7 +831,7 @@ class CurrencyRate extends CommonObjectLine
|
|||||||
return - 1;
|
return - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update object into database
|
* Update object into database
|
||||||
*
|
*
|
||||||
@ -840,13 +842,13 @@ class CurrencyRate extends CommonObjectLine
|
|||||||
public function update($trigger = true)
|
public function update($trigger = true)
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
dol_syslog('CurrencyRate::update', LOG_DEBUG);
|
dol_syslog('CurrencyRate::update', LOG_DEBUG);
|
||||||
|
|
||||||
$this->rate = price2num($this->rate);
|
$this->rate = price2num($this->rate);
|
||||||
|
|
||||||
// Update request
|
// Update request
|
||||||
$sql = 'UPDATE ' . MAIN_DB_PREFIX . $this->table_element . ' SET';
|
$sql = 'UPDATE ' . MAIN_DB_PREFIX . $this->table_element . ' SET';
|
||||||
$sql .= ' rate='.$this->rate;
|
$sql .= ' rate='.$this->rate;
|
||||||
@ -878,7 +880,7 @@ class CurrencyRate extends CommonObjectLine
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete object in database
|
* Delete object in database
|
||||||
*
|
*
|
||||||
@ -889,7 +891,7 @@ class CurrencyRate extends CommonObjectLine
|
|||||||
public function delete($trigger = true)
|
public function delete($trigger = true)
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
dol_syslog('CurrencyRate::delete', LOG_DEBUG);
|
dol_syslog('CurrencyRate::delete', LOG_DEBUG);
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
@ -925,5 +927,5 @@ class CurrencyRate extends CommonObjectLine
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -430,6 +430,6 @@ if ($object->allow_comments) {
|
|||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -78,8 +78,6 @@ print '</table>';
|
|||||||
|
|
||||||
print '</div></div></div>';
|
print '</div></div></div>';
|
||||||
|
|
||||||
|
// End of page
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -296,6 +296,6 @@ print '</table>'."\n";
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -161,6 +161,6 @@ print '<a name=bas></a>'."\n";
|
|||||||
print '<br><br><br>'."\n";
|
print '<br><br><br>'."\n";
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -564,6 +564,6 @@ print '</form>'."\n";
|
|||||||
print '<br><br><br><br>'."\n";
|
print '<br><br><br><br>'."\n";
|
||||||
print '</div></div>'."\n";
|
print '</div></div>'."\n";
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -204,6 +204,6 @@ else
|
|||||||
print '<br><br><br>'."\n";
|
print '<br><br><br>'."\n";
|
||||||
print '</form>'."\n";
|
print '</form>'."\n";
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -57,6 +57,6 @@ print '<div style="clear:both;"></div>';
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
print '</div></form>';
|
print '</div></form>';
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -250,5 +250,6 @@ print '<br><br>';
|
|||||||
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/onlinepaymentlinks.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/onlinepaymentlinks.tpl.php';
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -326,5 +326,6 @@ $token='';
|
|||||||
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/onlinepaymentlinks.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/onlinepaymentlinks.tpl.php';
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -361,6 +361,6 @@ if ($mode == 'userconf' && $user->admin)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -68,6 +68,6 @@ foreach ($result as $driver)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -357,5 +357,6 @@ if ($action == 'create_updater' || $action == 'edit_updater') {
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -200,6 +200,6 @@ print '<div style="text-align: center">
|
|||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -744,7 +744,7 @@ print '</table>';
|
|||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
|
|||||||
@ -126,6 +126,6 @@ if ($action == 'edit' && ! empty($attrname))
|
|||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -116,6 +116,6 @@ if ($action == 'edit' && ! empty($attrname))
|
|||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -342,6 +342,6 @@ else
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -203,7 +203,6 @@ if ($id > 0 || $ref)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -2187,6 +2187,6 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete')
|
|||||||
print '</div></div></div>';
|
print '</div></div></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -4549,6 +4549,7 @@ class Product extends CommonObject
|
|||||||
* Existing categories are left untouch.
|
* Existing categories are left untouch.
|
||||||
*
|
*
|
||||||
* @param int[]|int $categories Category or categories IDs
|
* @param int[]|int $categories Category or categories IDs
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setCategories($categories) {
|
public function setCategories($categories) {
|
||||||
// Handle single category
|
// Handle single category
|
||||||
|
|||||||
@ -657,7 +657,6 @@ if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -345,6 +345,6 @@ else
|
|||||||
print $langs->trans("ErrorUnknown");
|
print $langs->trans("ErrorUnknown");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -244,5 +244,6 @@ print '<script type="text/javascript">
|
|||||||
}
|
}
|
||||||
</script>';
|
</script>';
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -889,7 +889,6 @@ else
|
|||||||
print $langs->trans("ErrorUnknown");
|
print $langs->trans("ErrorUnknown");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -397,8 +397,8 @@ if (! empty($conf->global->MAIN_SHOW_PRODUCT_ACTIVITY_TRIM))
|
|||||||
|
|
||||||
print '</div></div></div>';
|
print '</div></div></div>';
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -409,7 +409,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -960,6 +960,6 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -115,6 +115,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
|
|||||||
@ -207,6 +207,6 @@ print "</table>";
|
|||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -2197,6 +2197,6 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -391,6 +391,6 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -421,6 +421,6 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -433,6 +433,6 @@ if (! $id)
|
|||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -257,5 +257,6 @@ if ($id > 0 || ! empty($ref))
|
|||||||
dol_print_error();
|
dol_print_error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -265,5 +265,6 @@ if ($id > 0 || ! empty($ref)) {
|
|||||||
dol_print_error();
|
dol_print_error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -236,6 +236,6 @@ else
|
|||||||
dol_print_error();
|
dol_print_error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -278,5 +278,6 @@ if ($id > 0 || ! empty($ref))
|
|||||||
dol_print_error();
|
dol_print_error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -263,5 +263,6 @@ if ($id > 0 || ! empty($ref))
|
|||||||
dol_print_error();
|
dol_print_error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -261,5 +261,6 @@ if ($id > 0 || ! empty($ref))
|
|||||||
dol_print_error();
|
dol_print_error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -260,5 +260,6 @@ if ($id > 0 || ! empty($ref))
|
|||||||
dol_print_error();
|
dol_print_error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -707,7 +707,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -140,5 +140,6 @@ if ($_GET["id"])
|
|||||||
print "</div>";
|
print "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -185,6 +185,6 @@ if ($resql)
|
|||||||
//print '</td></tr></table>';
|
//print '</td></tr></table>';
|
||||||
print '</div></div></div>';
|
print '</div></div></div>';
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -73,6 +73,6 @@ dol_print_object_info($object);
|
|||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -271,7 +271,6 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -462,7 +462,6 @@ print '<div class="center"><input class="button" type="submit" name="valid" valu
|
|||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -1173,7 +1173,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete' && $id>0)
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
|
|||||||
@ -994,6 +994,6 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -416,7 +416,6 @@ if (empty($action))
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -551,7 +551,6 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -336,5 +336,6 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -157,7 +157,6 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -354,5 +354,6 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -576,7 +576,6 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_S
|
|||||||
|
|
||||||
print '</div></div></div>';
|
print '</div></div></div>';
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -710,6 +710,6 @@ if ($conf->use_javascript_ajax)
|
|||||||
print '</script>';
|
print '</script>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -749,7 +749,6 @@ if ($conf->use_javascript_ajax)
|
|||||||
print '</script>';
|
print '</script>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -910,5 +910,6 @@ print '</table>';
|
|||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -113,6 +113,6 @@ if ($action == 'edit' && ! empty($attrname))
|
|||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user