mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-11 03:51:25 +01:00
Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
@@ -674,7 +674,7 @@ if ($id) {
|
|||||||
// Can an entry be erased or disabled ?
|
// Can an entry be erased or disabled ?
|
||||||
$iserasable = 1; $canbedisabled = 1; $canbemodified = 1; // true by default
|
$iserasable = 1; $canbedisabled = 1; $canbemodified = 1; // true by default
|
||||||
|
|
||||||
$url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : '');
|
$url = $_SERVER["PHP_SELF"].'?token='.newToken().($page ? '&page='.$page : '').'&sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : '');
|
||||||
if ($param) {
|
if ($param) {
|
||||||
$url .= '&'.$param;
|
$url .= '&'.$param;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2010-2018 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2018 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.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
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -108,7 +109,7 @@ llxHeader('', $langs->trans("WithdrawalsLines"));
|
|||||||
|
|
||||||
$sql = "SELECT p.rowid, p.ref, p.statut as status, p.datec";
|
$sql = "SELECT p.rowid, p.ref, p.statut as status, p.datec";
|
||||||
$sql .= " , f.rowid as facid, f.ref as invoiceref, f.total_ttc";
|
$sql .= " , f.rowid as facid, f.ref as invoiceref, f.total_ttc";
|
||||||
$sql .= " , s.rowid as socid, s.nom as name, s.code_client, s.email";
|
$sql .= " , s.rowid as socid, s.nom as name, s.code_client, s.code_fournisseur, s.email";
|
||||||
$sql .= " , pl.amount, pl.statut as statut_ligne, pl.rowid as rowid_ligne";
|
$sql .= " , pl.amount, pl.statut as statut_ligne, pl.rowid as rowid_ligne";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
|
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
|
||||||
$sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
|
$sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
|
||||||
@@ -139,7 +140,7 @@ if ($search_bon) {
|
|||||||
}
|
}
|
||||||
if ($type == 'bank-transfer') {
|
if ($type == 'bank-transfer') {
|
||||||
if ($search_code) {
|
if ($search_code) {
|
||||||
$sql .= natural_search("s.code_fourn", $search_code);
|
$sql .= natural_search("s.code_fournisseur", $search_code);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($search_code) {
|
if ($search_code) {
|
||||||
@@ -172,6 +173,9 @@ if ($result) {
|
|||||||
|
|
||||||
$param = "&statut=".urlencode($statut);
|
$param = "&statut=".urlencode($statut);
|
||||||
$param .= "&search_bon=".urlencode($search_bon);
|
$param .= "&search_bon=".urlencode($search_bon);
|
||||||
|
if ($type == 'bank-transfer') {
|
||||||
|
$param .= '&type=bank-transfer';
|
||||||
|
}
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||||
$param .= '&limit='.urlencode($limit);
|
$param .= '&limit='.urlencode($limit);
|
||||||
}
|
}
|
||||||
@@ -204,7 +208,7 @@ if ($result) {
|
|||||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_bon" value="'.dol_escape_htmltag($search_bon).'" size="6"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" name="search_bon" value="'.dol_escape_htmltag($search_bon).'" size="6"></td>';
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_company" value="'.dol_escape_htmltag($search_company).'" size="6"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" name="search_company" value="'.dol_escape_htmltag($search_company).'" size="6"></td>';
|
||||||
print '<td class="liste_titre" align="center"><input type="text" class="flat" name="search_code" value="'.dol_escape_htmltag($search_code).'" size="6"></td>';
|
print '<td class="liste_titre center"><input type="text" class="flat" name="search_code" value="'.dol_escape_htmltag($search_code).'" size="6"></td>';
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
print '<td class="liste_titre maxwidthsearch">';
|
print '<td class="liste_titre maxwidthsearch">';
|
||||||
@@ -214,8 +218,12 @@ if ($result) {
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$columntitle = "WithdrawalsReceipts";
|
$columntitle = "WithdrawalsReceipts";
|
||||||
|
$columntitlethirdparty = "CustomerCode";
|
||||||
|
$columncodethirdparty = "s.code_client";
|
||||||
if ($type == 'bank-transfer') {
|
if ($type == 'bank-transfer') {
|
||||||
$columntitle = "BankTransferReceipts";
|
$columntitle = "BankTransferReceipts";
|
||||||
|
$columntitlethirdparty = "SupplierCode";
|
||||||
|
$columncodethirdparty = "s.code_fournisseur";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@@ -223,7 +231,7 @@ if ($result) {
|
|||||||
print_liste_field_titre("Line", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Line", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Bill", $_SERVER["PHP_SELF"], "f.ref", '', $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Bill", $_SERVER["PHP_SELF"], "f.ref", '', $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("CustomerCode", $_SERVER["PHP_SELF"], "s.code_client", '', $param, '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre($columntitlethirdparty, $_SERVER["PHP_SELF"], $columncodethirdparty, '', $param, '', $sortfield, $sortorder, 'center ');
|
||||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "pl.amount", "", $param, '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "pl.amount", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
print_liste_field_titre('');
|
print_liste_field_titre('');
|
||||||
@@ -256,9 +264,17 @@ if ($result) {
|
|||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->facid.'">';
|
$link_to_bill = '/compta/facture/card.php?facid=';
|
||||||
print img_object($langs->trans("ShowBill"), "bill");
|
$link_title = 'Invoice';
|
||||||
print ' <a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->facid.'">'.$obj->invoiceref."</a></td>\n";
|
$link_picto = 'bill';
|
||||||
|
if ($type == 'bank-transfer') {
|
||||||
|
$link_to_bill = '/fourn/facture/card.php?facid=';
|
||||||
|
$link_title = 'SupplierInvoice';
|
||||||
|
$link_picto = 'supplier_invoice';
|
||||||
|
}
|
||||||
|
print '<a href="'.DOL_URL_ROOT.$link_to_bill.$obj->facid.'">';
|
||||||
|
print img_object($langs->trans($link_title), $link_picto);
|
||||||
|
print ' '.$obj->invoiceref."</td>\n";
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
@@ -266,7 +282,15 @@ if ($result) {
|
|||||||
print $company->getNomUrl(1);
|
print $company->getNomUrl(1);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
print '<td align="center"><a href="card.php?id='.$obj->rowid.'">'.$obj->code_client."</a></td>\n";
|
|
||||||
|
print '<td class="center">';
|
||||||
|
$link_to_tab = '/comm/card.php?socid=';
|
||||||
|
$link_code = $obj->code_client;
|
||||||
|
if ($type == 'bank-transfer') {
|
||||||
|
$link_to_tab = '/fourn/card.php?socid=';
|
||||||
|
$link_code = $obj->code_fournisseur;
|
||||||
|
}
|
||||||
|
print '<a href="'.DOL_URL_ROOT.$link_to_tab.$company->id.'">'.$link_code."</a></td>\n";
|
||||||
|
|
||||||
print '<td class="center">'.dol_print_date($db->jdate($obj->datec), 'day')."</td>\n";
|
print '<td class="center">'.dol_print_date($db->jdate($obj->datec), 'day')."</td>\n";
|
||||||
|
|
||||||
|
|||||||
@@ -132,6 +132,9 @@ if ($result) {
|
|||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||||
$param .= '&contextpage='.urlencode($contextpage);
|
$param .= '&contextpage='.urlencode($contextpage);
|
||||||
}
|
}
|
||||||
|
if ($type == 'bank-transfer') {
|
||||||
|
$param .= '&type=bank-transfer';
|
||||||
|
}
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||||
$param .= '&limit='.urlencode($limit);
|
$param .= '&limit='.urlencode($limit);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,12 @@ class RssParser
|
|||||||
|
|
||||||
private $current_namespace;
|
private $current_namespace;
|
||||||
|
|
||||||
|
private $initem;
|
||||||
|
private $intextinput;
|
||||||
|
private $incontent;
|
||||||
|
private $inimage;
|
||||||
|
private $inchannel;
|
||||||
|
|
||||||
// For parsing with xmlparser
|
// For parsing with xmlparser
|
||||||
public $stack = array(); // parser stack
|
public $stack = array(); // parser stack
|
||||||
private $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'title', 'tagline', 'copyright');
|
private $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'title', 'tagline', 'copyright');
|
||||||
@@ -254,21 +260,26 @@ class RssParser
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$xmlparser = xml_parser_create('');
|
try {
|
||||||
|
$xmlparser = xml_parser_create(null);
|
||||||
|
|
||||||
if (!is_resource($xmlparser) && !is_object($xmlparser)) {
|
if (!is_resource($xmlparser) && !is_object($xmlparser)) {
|
||||||
$this->error = "ErrorFailedToCreateParser";
|
$this->error = "ErrorFailedToCreateParser";
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
xml_set_object($xmlparser, $this);
|
||||||
|
xml_set_element_handler($xmlparser, 'feed_start_element', 'feed_end_element');
|
||||||
|
xml_set_character_data_handler($xmlparser, 'feed_cdata');
|
||||||
|
|
||||||
|
$status = xml_parse($xmlparser, $str, false);
|
||||||
|
|
||||||
|
xml_parser_free($xmlparser);
|
||||||
|
$rss = $this;
|
||||||
|
//var_dump($status.' '.$rss->_format);exit;
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$rss = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
xml_set_object($xmlparser, $this);
|
|
||||||
xml_set_element_handler($xmlparser, 'feed_start_element', 'feed_end_element');
|
|
||||||
xml_set_character_data_handler($xmlparser, 'feed_cdata');
|
|
||||||
|
|
||||||
$status = xml_parse($xmlparser, $str);
|
|
||||||
xml_parser_free($xmlparser);
|
|
||||||
$rss = $this;
|
|
||||||
//var_dump($status.' '.$rss->_format);exit;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -443,7 +454,7 @@ class RssParser
|
|||||||
|
|
||||||
// Loop on each category
|
// Loop on each category
|
||||||
$itemCategory = array();
|
$itemCategory = array();
|
||||||
if (is_array($item->category)) {
|
if (!empty($item->category) && is_array($item->category)) {
|
||||||
foreach ($item->category as $cat) {
|
foreach ($item->category as $cat) {
|
||||||
$itemCategory[] = (string) $cat;
|
$itemCategory[] = (string) $cat;
|
||||||
}
|
}
|
||||||
@@ -514,7 +525,7 @@ class RssParser
|
|||||||
* @param array $attrs Attributes of tags
|
* @param array $attrs Attributes of tags
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function feed_start_element($p, $element, &$attrs)
|
public function feed_start_element($p, $element, $attrs)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$el = $element = strtolower($element);
|
$el = $element = strtolower($element);
|
||||||
@@ -681,9 +692,9 @@ class RssParser
|
|||||||
public function append_content($text)
|
public function append_content($text)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
if ($this->initem) {
|
if (!empty($this->initem)) {
|
||||||
$this->concat($this->current_item[$this->incontent], $text);
|
$this->concat($this->current_item[$this->incontent], $text);
|
||||||
} elseif ($this->inchannel) {
|
} elseif (!empty($this->inchannel)) {
|
||||||
$this->concat($this->channel[$this->incontent], $text);
|
$this->concat($this->channel[$this->incontent], $text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -700,24 +711,24 @@ class RssParser
|
|||||||
if (!$el) {
|
if (!$el) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($this->current_namespace) {
|
if (!empty($this->current_namespace)) {
|
||||||
if ($this->initem) {
|
if (!empty($this->initem)) {
|
||||||
$this->concat($this->current_item[$this->current_namespace][$el], $text);
|
$this->concat($this->current_item[$this->current_namespace][$el], $text);
|
||||||
} elseif ($this->inchannel) {
|
} elseif (!empty($this->inchannel)) {
|
||||||
$this->concat($this->channel[$this->current_namespace][$el], $text);
|
$this->concat($this->channel[$this->current_namespace][$el], $text);
|
||||||
} elseif ($this->intextinput) {
|
} elseif (!empty($this->intextinput)) {
|
||||||
$this->concat($this->textinput[$this->current_namespace][$el], $text);
|
$this->concat($this->textinput[$this->current_namespace][$el], $text);
|
||||||
} elseif ($this->inimage) {
|
} elseif (!empty($this->inimage)) {
|
||||||
$this->concat($this->image[$this->current_namespace][$el], $text);
|
$this->concat($this->image[$this->current_namespace][$el], $text);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($this->initem) {
|
if (!empty($this->initem)) {
|
||||||
$this->concat($this->current_item[$el], $text);
|
$this->concat($this->current_item[$el], $text);
|
||||||
} elseif ($this->intextinput) {
|
} elseif (!empty($this->intextinput)) {
|
||||||
$this->concat($this->textinput[$el], $text);
|
$this->concat($this->textinput[$el], $text);
|
||||||
} elseif ($this->inimage) {
|
} elseif (!empty($this->inimage)) {
|
||||||
$this->concat($this->image[$el], $text);
|
$this->concat($this->image[$el], $text);
|
||||||
} elseif ($this->inchannel) {
|
} elseif (!empty($this->inchannel)) {
|
||||||
$this->concat($this->channel[$el], $text);
|
$this->concat($this->channel[$el], $text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -471,7 +471,7 @@ class DoliDBMysqli extends DoliDB
|
|||||||
*/
|
*/
|
||||||
public function escape($stringtoencode)
|
public function escape($stringtoencode)
|
||||||
{
|
{
|
||||||
return $this->db->real_escape_string($stringtoencode);
|
return $this->db->real_escape_string((string) $stringtoencode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -482,7 +482,7 @@ class DoliDBMysqli extends DoliDB
|
|||||||
*/
|
*/
|
||||||
public function escapeunderscore($stringtoencode)
|
public function escapeunderscore($stringtoencode)
|
||||||
{
|
{
|
||||||
return str_replace('_', '\_', $stringtoencode);
|
return str_replace('_', '\_', (string) $stringtoencode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6583,10 +6583,10 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart = '
|
|||||||
*
|
*
|
||||||
* @param string $dir Directory to create (Separator must be '/'. Example: '/mydir/mysubdir')
|
* @param string $dir Directory to create (Separator must be '/'. Example: '/mydir/mysubdir')
|
||||||
* @param string $dataroot Data root directory (To avoid having the data root in the loop. Using this will also lost the warning on first dir PHP has no permission when open_basedir is used)
|
* @param string $dataroot Data root directory (To avoid having the data root in the loop. Using this will also lost the warning on first dir PHP has no permission when open_basedir is used)
|
||||||
* @param string|null $newmask Mask for new file (Defaults to $conf->global->MAIN_UMASK or 0755 if unavailable). Example: '0444'
|
* @param string $newmask Mask for new file (Defaults to $conf->global->MAIN_UMASK or 0755 if unavailable). Example: '0444'
|
||||||
* @return int < 0 if KO, 0 = already exists, > 0 if OK
|
* @return int < 0 if KO, 0 = already exists, > 0 if OK
|
||||||
*/
|
*/
|
||||||
function dol_mkdir($dir, $dataroot = '', $newmask = null)
|
function dol_mkdir($dir, $dataroot = '', $newmask = '')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -6627,7 +6627,7 @@ function dol_mkdir($dir, $dataroot = '', $newmask = null)
|
|||||||
dol_syslog("functions.lib::dol_mkdir: Directory '".$ccdir."' does not exists or is outside open_basedir PHP setting.", LOG_DEBUG);
|
dol_syslog("functions.lib::dol_mkdir: Directory '".$ccdir."' does not exists or is outside open_basedir PHP setting.", LOG_DEBUG);
|
||||||
|
|
||||||
umask(0);
|
umask(0);
|
||||||
$dirmaskdec = octdec($newmask);
|
$dirmaskdec = octdec((string) $newmask);
|
||||||
if (empty($newmask)) {
|
if (empty($newmask)) {
|
||||||
$dirmaskdec = empty($conf->global->MAIN_UMASK) ? octdec('0755') : octdec($conf->global->MAIN_UMASK);
|
$dirmaskdec = empty($conf->global->MAIN_UMASK) ? octdec('0755') : octdec($conf->global->MAIN_UMASK);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,8 @@ class modIncoterm extends DolibarrModules
|
|||||||
'tabfieldvalue'=>array("code,libelle"), // List of fields (list of fields to edit a record)
|
'tabfieldvalue'=>array("code,libelle"), // List of fields (list of fields to edit a record)
|
||||||
'tabfieldinsert'=>array("code,libelle"), // List of fields (list of fields for insert)
|
'tabfieldinsert'=>array("code,libelle"), // List of fields (list of fields for insert)
|
||||||
'tabrowid'=>array("rowid"), // Name of columns with primary key (try to always name it 'rowid')
|
'tabrowid'=>array("rowid"), // Name of columns with primary key (try to always name it 'rowid')
|
||||||
'tabcond'=>array($conf->incoterm->enabled)
|
'tabcond'=>array($conf->incoterm->enabled),
|
||||||
|
'tabhelp' => array(array())
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->boxes = array(); // List of boxes
|
$this->boxes = array(); // List of boxes
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ if (empty($reshook)) {
|
|||||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->expensereport->creer))
|
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->expensereport->creer))
|
||||||
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->expensereport->creer) && empty($user->rights->expensereport->writeall_advance))) {
|
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->expensereport->creer) && empty($user->rights->expensereport->writeall_advance))) {
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("NotEnoughPermission"), null, 'errors');
|
setEventMessages($langs->trans("NotEnoughPermissions"), null, 'errors');
|
||||||
}
|
}
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->expensereport->writeall_advance)) {
|
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->expensereport->writeall_advance)) {
|
||||||
|
|||||||
@@ -482,7 +482,7 @@ if ($resql) {
|
|||||||
if ($canedit) {
|
if ($canedit) {
|
||||||
print '<a href="'.DOL_URL_ROOT.'/expensereport/card.php?action=create&fk_user_author='.$fuser->id.'" class="butAction">'.$langs->trans("AddTrip").'</a>';
|
print '<a href="'.DOL_URL_ROOT.'/expensereport/card.php?action=create&fk_user_author='.$fuser->id.'" class="butAction">'.$langs->trans("AddTrip").'</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<a href="#" class="butActionRefused" title="'.$langs->trans("NotEnoughPermission").'">'.$langs->trans("AddTrip").'</a>';
|
print '<a href="#" class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("AddTrip").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ insert into llx_c_forme_juridique (fk_pays, code, libelle) values (2, '228', 'VO
|
|||||||
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (2, '229', 'VS0 - Vennootschap met sociaal oogmerk');
|
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (2, '229', 'VS0 - Vennootschap met sociaal oogmerk');
|
||||||
|
|
||||||
|
|
||||||
-- France: Extrait de http://www.insee.fr/fr/nom_def_met/nomenclatures/cj/cjniveau2.htm
|
-- France: Extrait de https://www.insee.fr/fr/information/2028129
|
||||||
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'11','Artisan Commerçant (EI)');
|
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'11','Artisan Commerçant (EI)');
|
||||||
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'12','Commerçant (EI)');
|
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'12','Commerçant (EI)');
|
||||||
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'13','Artisan (EI)');
|
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'13','Artisan (EI)');
|
||||||
|
|||||||
@@ -345,7 +345,7 @@ KiloBytes=Kilobytes
|
|||||||
MegaBytes=Megabytes
|
MegaBytes=Megabytes
|
||||||
GigaBytes=Gigabytes
|
GigaBytes=Gigabytes
|
||||||
TeraBytes=Terabytes
|
TeraBytes=Terabytes
|
||||||
UserAuthor=Ceated by
|
UserAuthor=Created by
|
||||||
UserModif=Updated by
|
UserModif=Updated by
|
||||||
b=b.
|
b=b.
|
||||||
Kb=Kb
|
Kb=Kb
|
||||||
@@ -712,6 +712,7 @@ FeatureDisabled=Feature disabled
|
|||||||
MoveBox=Move widget
|
MoveBox=Move widget
|
||||||
Offered=Offered
|
Offered=Offered
|
||||||
NotEnoughPermissions=You don't have permission for this action
|
NotEnoughPermissions=You don't have permission for this action
|
||||||
|
UserNotInHierachy=This action is reserved to the supervisors of this user
|
||||||
SessionName=Session name
|
SessionName=Session name
|
||||||
Method=Method
|
Method=Method
|
||||||
Receive=Receive
|
Receive=Receive
|
||||||
|
|||||||
@@ -221,9 +221,9 @@ class modMyModule extends DolibarrModules
|
|||||||
// Name of columns with primary key (try to always name it 'rowid')
|
// Name of columns with primary key (try to always name it 'rowid')
|
||||||
'tabrowid'=>array("rowid", "rowid", "rowid"),
|
'tabrowid'=>array("rowid", "rowid", "rowid"),
|
||||||
// Condition to show each dictionary
|
// Condition to show each dictionary
|
||||||
'tabcond'=>array($conf->mymodule->enabled, $conf->mymodule->enabled, $conf->mymodule->enabled)
|
'tabcond'=>array($conf->mymodule->enabled, $conf->mymodule->enabled, $conf->mymodule->enabled),
|
||||||
// Help tooltip for each fields of the dictionary
|
// Tooltip for every fields of dictionaries: DO NOT PUT AN EMPTY ARRAY
|
||||||
'tabhelp'=>array(array('code'=>$langs->trans('CodeTooltipHelp')))
|
'tabhelp'=>array(array('code'=>$langs->trans('CodeTooltipHelp'), 'field2' => 'field2tooltip'), array('code'=>$langs->trans('CodeTooltipHelp'), 'field2' => 'field2tooltip'), ...),
|
||||||
);
|
);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -336,7 +336,7 @@ $sql .= " t.rowid as id, t.ref, t.label, t.planned_workload, t.duration_effectiv
|
|||||||
$sql .= " t.description, t.fk_task_parent";
|
$sql .= " t.description, t.fk_task_parent";
|
||||||
$sql .= " ,t.budget_amount";
|
$sql .= " ,t.budget_amount";
|
||||||
// We'll need these fields in order to filter by categ
|
// We'll need these fields in order to filter by categ
|
||||||
if ($search_categ) {
|
if ($search_categ > 0) {
|
||||||
$sql .= ", cs.fk_categorie, cs.fk_project";
|
$sql .= ", cs.fk_categorie, cs.fk_project";
|
||||||
}
|
}
|
||||||
// Add sum fields
|
// Add sum fields
|
||||||
@@ -356,7 +356,7 @@ $sql .= $hookmanager->resPrint;
|
|||||||
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
|
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
||||||
// We'll need this table joined to the select in order to filter by categ
|
// We'll need this table joined to the select in order to filter by categ
|
||||||
if (!empty($search_categ)) {
|
if ($search_categ > 0) {
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_project as cs ON p.rowid = cs.fk_project"; // We'll need this table joined to the select in order to filter by categ
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_project as cs ON p.rowid = cs.fk_project"; // We'll need this table joined to the select in order to filter by categ
|
||||||
}
|
}
|
||||||
$sql .= ", ".MAIN_DB_PREFIX."projet_task as t";
|
$sql .= ", ".MAIN_DB_PREFIX."projet_task as t";
|
||||||
|
|||||||
@@ -751,7 +751,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
|
|||||||
if ($permissiontoaddbankaccount) {
|
if ($permissiontoaddbankaccount) {
|
||||||
$morehtmlright = dolGetButtonTitle($langs->trans('Add'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=create');
|
$morehtmlright = dolGetButtonTitle($langs->trans('Add'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=create');
|
||||||
} else {
|
} else {
|
||||||
$morehtmlright = dolGetButtonTitle($langs->trans('Add'), 'NotEnoughPermission', 'fa fa-plus-circle', '', '', -2);
|
$morehtmlright = dolGetButtonTitle($langs->trans('Add'), $langs->trans('NotEnoughPermissions'), 'fa fa-plus-circle', '', '', -2);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$morehtmlright = dolGetButtonTitle($langs->trans('Add'), 'AlreadyOneBankAccount', 'fa fa-plus-circle', '', '', -2);
|
$morehtmlright = dolGetButtonTitle($langs->trans('Add'), 'AlreadyOneBankAccount', 'fa fa-plus-circle', '', '', -2);
|
||||||
|
|||||||
@@ -476,7 +476,7 @@ if (empty($reshook)) {
|
|||||||
$object->lang = GETPOST('default_lang', 'aZ09');
|
$object->lang = GETPOST('default_lang', 'aZ09');
|
||||||
|
|
||||||
// Do we update also ->entity ?
|
// Do we update also ->entity ?
|
||||||
if (!empty($conf->multicompany->enabled && $user->entity == 0 && !empty($user->admin))) { // If multicompany is not enabled, we never update the entity of a user.
|
if (!empty($conf->multicompany->enabled) && empty($user->entity) && !empty($user->admin)) { // If multicompany is not enabled, we never update the entity of a user.
|
||||||
if (GETPOST('superadmin', 'int')) {
|
if (GETPOST('superadmin', 'int')) {
|
||||||
$object->entity = 0;
|
$object->entity = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1488,8 +1488,8 @@ class User extends CommonObject
|
|||||||
// Clean parameters
|
// Clean parameters
|
||||||
$this->setUpperOrLowerCase();
|
$this->setUpperOrLowerCase();
|
||||||
|
|
||||||
$this->civility_code = trim($this->civility_code);
|
$this->civility_code = trim((string) $this->civility_code);
|
||||||
$this->login = trim($this->login);
|
$this->login = trim((string) $this->login);
|
||||||
if (!isset($this->entity)) {
|
if (!isset($this->entity)) {
|
||||||
$this->entity = $conf->entity; // If not defined, we use default value
|
$this->entity = $conf->entity; // If not defined, we use default value
|
||||||
}
|
}
|
||||||
@@ -1851,47 +1851,45 @@ class User extends CommonObject
|
|||||||
dol_syslog(get_class($this)."::update notrigger=".$notrigger.", nosyncmember=".$nosyncmember.", nosyncmemberpass=".$nosyncmemberpass);
|
dol_syslog(get_class($this)."::update notrigger=".$notrigger.", nosyncmember=".$nosyncmember.", nosyncmemberpass=".$nosyncmemberpass);
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
$this->civility_code = trim($this->civility_code);
|
$this->civility_code = trim((string) $this->civility_code);
|
||||||
$this->lastname = trim($this->lastname);
|
$this->lastname = trim((string) $this->lastname);
|
||||||
$this->firstname = trim($this->firstname);
|
$this->firstname = trim((string) $this->firstname);
|
||||||
$this->ref_employee = trim($this->ref_employee);
|
$this->ref_employee = trim((string) $this->ref_employee);
|
||||||
$this->national_registration_number = trim($this->national_registration_number);
|
$this->national_registration_number = trim((string) $this->national_registration_number);
|
||||||
$this->employee = $this->employee ? $this->employee : 0;
|
$this->employee = ($this->employee > 0 ? $this->employee : 0);
|
||||||
$this->login = trim($this->login);
|
$this->login = trim((string) $this->login);
|
||||||
$this->gender = trim($this->gender);
|
$this->gender = trim((string) $this->gender);
|
||||||
$this->pass = trim($this->pass);
|
$this->pass = trim((string) $this->pass);
|
||||||
$this->api_key = trim($this->api_key);
|
$this->api_key = trim((string) $this->api_key);
|
||||||
$this->address = $this->address ? trim($this->address) : trim($this->address);
|
$this->address = trim((string) $this->address);
|
||||||
$this->zip = $this->zip ? trim($this->zip) : trim($this->zip);
|
$this->zip = trim((string) $this->zip);
|
||||||
$this->town = $this->town ? trim($this->town) : trim($this->town);
|
$this->town = trim((string) $this->town);
|
||||||
$this->setUpperOrLowerCase();
|
$this->setUpperOrLowerCase();
|
||||||
$this->state_id = trim($this->state_id);
|
|
||||||
$this->country_id = ($this->country_id > 0) ? $this->country_id : 0;
|
|
||||||
$this->office_phone = trim($this->office_phone);
|
|
||||||
$this->office_fax = trim($this->office_fax);
|
|
||||||
$this->user_mobile = trim($this->user_mobile);
|
|
||||||
$this->personal_mobile = trim($this->personal_mobile);
|
|
||||||
$this->email = trim($this->email);
|
|
||||||
$this->personal_email = trim($this->personal_email);
|
|
||||||
|
|
||||||
$this->job = trim($this->job);
|
$this->state_id = ($this->state_id > 0 ? $this->state_id : 0);
|
||||||
$this->signature = trim($this->signature);
|
$this->country_id = ($this->country_id > 0 ? $this->country_id : 0);
|
||||||
$this->note_public = trim($this->note_public);
|
$this->office_phone = trim((string) $this->office_phone);
|
||||||
$this->note_private = trim($this->note_private);
|
$this->office_fax = trim((string) $this->office_fax);
|
||||||
$this->openid = trim(empty($this->openid) ? '' : $this->openid); // Avoid warning
|
$this->user_mobile = trim((string) $this->user_mobile);
|
||||||
$this->admin = $this->admin ? $this->admin : 0;
|
$this->personal_mobile = trim((string) $this->personal_mobile);
|
||||||
$this->address = empty($this->address) ? '' : $this->address;
|
$this->email = trim((string) $this->email);
|
||||||
$this->zip = empty($this->zip) ? '' : $this->zip;
|
$this->personal_email = trim((string) $this->personal_email);
|
||||||
$this->town = empty($this->town) ? '' : $this->town;
|
|
||||||
$this->setUpperOrLowerCase();
|
$this->job = trim((string) $this->job);
|
||||||
$this->accountancy_code = trim($this->accountancy_code);
|
$this->signature = trim((string) $this->signature);
|
||||||
$this->color = empty($this->color) ? '' : $this->color;
|
$this->note_public = trim((string) $this->note_public);
|
||||||
$this->dateemployment = empty($this->dateemployment) ? '' : $this->dateemployment;
|
$this->note_private = trim((string) $this->note_private);
|
||||||
$this->dateemploymentend = empty($this->dateemploymentend) ? '' : $this->dateemploymentend;
|
$this->openid = trim((string) $this->openid);
|
||||||
$this->datestartvalidity = empty($this->datestartvalidity) ? '' : $this->datestartvalidity;
|
$this->admin = ($this->admin > 0 ? $this->admin : 0);
|
||||||
$this->dateendvalidity = empty($this->dateendvalidity) ? '' : $this->dateendvalidity;
|
|
||||||
$this->birth = trim($this->birth);
|
$this->accountancy_code = trim((string) $this->accountancy_code);
|
||||||
$this->fk_warehouse = (int) $this->fk_warehouse;
|
$this->color = trim((string) $this->color);
|
||||||
|
$this->dateemployment = empty($this->dateemployment) ? '' : $this->dateemployment;
|
||||||
|
$this->dateemploymentend = empty($this->dateemploymentend) ? '' : $this->dateemploymentend;
|
||||||
|
$this->datestartvalidity = empty($this->datestartvalidity) ? '' : $this->datestartvalidity;
|
||||||
|
$this->dateendvalidity = empty($this->dateendvalidity) ? '' : $this->dateendvalidity;
|
||||||
|
$this->birth = empty($this->birth) ? '' : $this->birth;
|
||||||
|
$this->fk_warehouse = (int) $this->fk_warehouse;
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
$badCharUnauthorizedIntoLoginName = getDolGlobalString('MAIN_LOGIN_BADCHARUNAUTHORIZED', ',@<>"\'');
|
$badCharUnauthorizedIntoLoginName = getDolGlobalString('MAIN_LOGIN_BADCHARUNAUTHORIZED', ',@<>"\'');
|
||||||
@@ -2061,8 +2059,6 @@ class User extends CommonObject
|
|||||||
|
|
||||||
$adh->pass = $this->pass;
|
$adh->pass = $this->pass;
|
||||||
|
|
||||||
//$adh->societe = (empty($adh->societe) && $this->societe_id ? $this->societe_id : $adh->societe);
|
|
||||||
|
|
||||||
$adh->address = $this->address;
|
$adh->address = $this->address;
|
||||||
$adh->town = $this->town;
|
$adh->town = $this->town;
|
||||||
$adh->zip = $this->zip;
|
$adh->zip = $this->zip;
|
||||||
@@ -2112,8 +2108,6 @@ class User extends CommonObject
|
|||||||
|
|
||||||
//$tmpobj->pass=$this->pass;
|
//$tmpobj->pass=$this->pass;
|
||||||
|
|
||||||
//$tmpobj->societe=(empty($tmpobj->societe) && $this->societe_id ? $this->societe_id : $tmpobj->societe);
|
|
||||||
|
|
||||||
$tmpobj->email = $this->email;
|
$tmpobj->email = $this->email;
|
||||||
|
|
||||||
$tmpobj->socialnetworks = $this->socialnetworks;
|
$tmpobj->socialnetworks = $this->socialnetworks;
|
||||||
|
|||||||
Reference in New Issue
Block a user