Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into

develop

Conflicts:
	htdocs/compta/paiement.php
	htdocs/fourn/facture/paiement.php
This commit is contained in:
Laurent Destailleur 2019-02-03 20:38:47 +01:00
commit af9e2d07d2
1542 changed files with 29377 additions and 29426 deletions

View File

@ -8,7 +8,8 @@ charset = utf-8
end_of_line = lf
insert_final_newline = true
[*.php]
indent_style = tab
indent_style = space
trim_trailing_whitespace = true
[*.js]
indent_style = tab
[*.css]

View File

@ -45,8 +45,7 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
$includecustom=0;
$includeconstants=array();
if (empty($argv[1]))
{
if (empty($argv[1])) {
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
exit -1;
@ -54,14 +53,11 @@ if (empty($argv[1]))
parse_str($argv[1]);
$i=0;
while ($i < $argc)
{
while ($i < $argc) {
if (! empty($argv[$i])) parse_str($argv[$i]);
if (preg_match('/includeconstant=/',$argv[$i]))
{
if (preg_match('/includeconstant=/', $argv[$i])) {
$tmp=explode(':', $includeconstant, 3);
if (count($tmp) != 3)
{
if (count($tmp) != 3) {
print "Error: Bad parameter includeconstant ".$includeconstant."\n";
exit -1;
}
@ -70,8 +66,7 @@ while ($i < $argc)
$i++;
}
if (empty($release))
{
if (empty($release)) {
print "Error: Missing release paramater\n";
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
exit -1;
@ -81,39 +76,29 @@ $savrelease = $release;
// If release is auto, we take current version
$tmpver=explode('-', $release, 2);
if ($tmpver[0] == 'auto' || $tmpver[0] == 'autostable')
{
if ($tmpver[0] == 'auto' || $tmpver[0] == 'autostable') {
$release=DOL_VERSION;
if ($tmpver[1] && $tmpver[0] == 'auto') $release.='-'.$tmpver[1];
}
if (empty($includecustom))
{
if (empty($includecustom)) {
$tmpverbis=explode('-', $release, 2);
if (empty($tmpverbis[1]) || $tmpver[0] == 'autostable')
{
if (DOL_VERSION != $tmpverbis[0] && $savrelease != 'auto')
{
if (empty($tmpverbis[1]) || $tmpver[0] == 'autostable') {
if (DOL_VERSION != $tmpverbis[0] && $savrelease != 'auto') {
print 'Error: When parameter "includecustom" is not set and there is no suffix in release parameter, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$tmpverbis[0].')'."\n";
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
exit -1;
}
}
else
{
} else {
$tmpverter=explode('-', DOL_VERSION, 2);
if ($tmpverter[0] != $tmpverbis[0])
{
if ($tmpverter[0] != $tmpverbis[0]) {
print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must have value without prefix ('.$tmpverter[0].') that is exact same value than "release" parameter ('.$tmpverbis[0].')'."\n";
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
exit -1;
}
}
}
else
{
if (! preg_match('/'.preg_quote(DOL_VERSION,'/').'-/',$release))
{
} else {
if (! preg_match('/'.preg_quote(DOL_VERSION, '/').'-/', $release)) {
print 'Error: When parameter "includecustom" is set, version declared into filefunc.inc.php ('.DOL_VERSION.') must be used with a suffix into "release" parameter (ex: '.DOL_VERSION.'-mydistrib).'."\n";
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
exit -1;
@ -123,10 +108,8 @@ else
print "Release : ".$release."\n";
print "Include custom in signature : ".$includecustom."\n";
print "Include constants in signature : ";
foreach ($includeconstants as $countrycode => $tmp)
{
foreach($tmp as $constname => $constvalue)
{
foreach ($includeconstants as $countrycode => $tmp) {
foreach($tmp as $constname => $constvalue) {
print $constname.'='.$constvalue." ";
}
}
@ -144,11 +127,9 @@ $fp = fopen($outputfile,'w');
fputs($fp, '<?xml version="1.0" encoding="UTF-8" ?>'."\n");
fputs($fp, '<checksum_list version="'.$release.'" date="'.dol_print_date(dol_now(), 'dayhourrfc').'" generator="'.$script_file.'">'."\n");
foreach ($includeconstants as $countrycode => $tmp)
{
foreach ($includeconstants as $countrycode => $tmp) {
fputs($fp, '<dolibarr_constants country="'.$countrycode.'">'."\n");
foreach($tmp as $constname => $constvalue)
{
foreach($tmp as $constname => $constvalue) {
$valueforchecksum=(empty($constvalue)?'0':$constvalue);
$checksumconcat[]=$valueforchecksum;
fputs($fp, ' <constant name="'.$constname.'">'.$valueforchecksum.'</constant>'."\n");

View File

@ -112,9 +112,6 @@
<rule ref="Generic.Functions.CallTimePassByReference" />
<rule ref="Generic.Functions.FunctionCallArgumentSpacing" />
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterComma">
<severity>0</severity>
</rule>
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceBeforeEquals">
<severity>0</severity>
</rule>
@ -190,6 +187,9 @@
</rule>
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" />
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen" />
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceBeforeClose" />
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
<properties>
@ -432,5 +432,5 @@
<rule ref="PSR2.Classes.ClassDeclaration" />
<rule ref="PSR2.Methods.FunctionClosingBrace" />
<rule ref="PSR2.Files.EndFileNewline.TooMany" />
<rule ref="PSR2.Files.EndFileNewline.NoneFound" />
</ruleset>

View File

@ -220,11 +220,13 @@ class autoTranslator
}
}
if ($key == 'CHARSET') $val=$this->_outputpagecode;
elseif (preg_match('/^Format/',$key)) $val=$value;
elseif ($value=='-') $val=$value;
else
{
if ($key == 'CHARSET') {
$val=$this->_outputpagecode;
} elseif (preg_match('/^Format/', $key)) {
$val=$value;
} elseif ($value=='-') {
$val=$value;
} else {
// If not translated then translate
if ($this->_outputpagecode == 'UTF-8') $val=$this->translateTexts(array($value), substr($this->_refLang, 0, 2), substr($my_destlang, 0, 2));
else $val=utf8_decode($this->translateTexts(array($value), substr($this->_refLang, 0, 2), substr($my_destlang, 0, 2)));

View File

@ -531,12 +531,15 @@ if ($id)
if ($fieldlist[$field]=='country_id') { $valuetoshow=''; }
if ($fieldlist[$field]=='pcg_version' || $fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); }
if ($valuetoshow != '')
{
if ($valuetoshow != '') {
print '<td align="'.$align.'">';
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
else print $valuetoshow;
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) {
print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
} elseif (! empty($tabhelp[$id][$value])) {
print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
} else {
print $valuetoshow;
}
print '</td>';
}
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1;

View File

@ -627,11 +627,17 @@ if ($id)
// Can an entry be erased or disabled ?
$iserasable=1;$canbedisabled=1;$canbemodified=1; // true by default
if (isset($obj->code) && $id != 10)
{
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $canbedisabled = 0; }
elseif ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; }
elseif ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; }
if (isset($obj->code) && $id != 10) {
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) {
$iserasable = 0;
$canbedisabled = 0;
} elseif ($obj->code == 'RECEP') {
$iserasable = 0;
$canbedisabled = 0;
} elseif ($obj->code == 'EF0') {
$iserasable = 0;
$canbedisabled = 0;
}
}
$canbemodified=$iserasable;

View File

@ -95,15 +95,13 @@ if ($cancel) {
$action='';
if (! empty($backtopage))
{
if (! empty($backtopage)) {
header("Location: ".$backtopage);
exit;
}
}
if ($action == 'add' && $user->rights->adherent->configurer)
{
if ($action == 'add' && $user->rights->adherent->configurer) {
$object->label = trim($label);
$object->statut = (int) $statut;
$object->subscription = (int) $subscription;
@ -266,8 +264,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
$membertype = new AdherentType($db);
while ($i < $num)
{
while ($i < $num) {
$objp = $db->fetch_object($result);
$membertype->id = $objp->rowid;

View File

@ -192,10 +192,8 @@ elseif ($action == 'set_ORDER_FREE_TEXT')
{
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
} elseif ($action=="setshippableiconinlist") {
// Activate Set Shippable Icon In List
elseif ($action=="setshippableiconinlist") {
$setshippableiconinlist = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist, 'yesno', 0, '', $conf->entity);
if (! $res > 0) $error++;

View File

@ -136,9 +136,7 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha'))
else dol_syslog($imgThumbMini);
}
else dol_syslog("ErrorImageFormatNotSupported", LOG_WARNING);
}
elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result))
{
} elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result)) {
$error++;
$langs->load("errors");
$tmparray=explode(':', $result);

View File

@ -1436,8 +1436,7 @@ if ($id)
elseif($valuetoshow == 1) $valuetoshow = $langs->trans('AtEndOfMonth');
elseif($valuetoshow == 2) $valuetoshow = $langs->trans('CurrentNext');
$align="center";
}
elseif ($fieldlist[$field]=='price' || preg_match('/^amount/i',$fieldlist[$field])) {
} elseif ($fieldlist[$field]=='price' || preg_match('/^amount/i', $fieldlist[$field])) {
$valuetoshow=price($valuetoshow);
}
if ($value == 'private')
@ -1558,9 +1557,7 @@ if ($id)
elseif ($fieldlist[$field]=='taux') {
$valuetoshow = price($valuetoshow, 0, $langs, 0, 0);
$align="center";
}
elseif (in_array($fieldlist[$field],array('recuperableonly')))
{
} elseif (in_array($fieldlist[$field], array('recuperableonly'))) {
$align="center";
}
elseif ($fieldlist[$field]=='accountancy_code' || $fieldlist[$field]=='accountancy_code_sell' || $fieldlist[$field]=='accountancy_code_buy') {
@ -1600,7 +1597,10 @@ if ($id)
}
// Can an entry be erased or disabled ?
$iserasable=1;$canbedisabled=1;$canbemodified=1; // true by default
// all true by default
$iserasable=1;
$canbedisabled=1;
$canbemodified=1;
if (isset($obj->code) && $id != 10)
{
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) { $iserasable = 0; $canbedisabled = 0; }

View File

@ -55,10 +55,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
{
dol_print_error($db);
}
}
elseif (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
{
} elseif (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) {
$code=$reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
{

View File

@ -104,9 +104,7 @@ if ($action === 'downloadblockchain') {
echo $bc;
exit;
}
elseif (GETPOST('downloadcsv','alpha'))
{
} elseif (GETPOST('downloadcsv', 'alpha')) {
$error = 0;
$previoushash='';
@ -438,8 +436,7 @@ print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"],'','',$param,'align="cente
print getTitleFieldOfList('<span id="blockchainstatus"></span>', 0, $_SERVER["PHP_SELF"], '', '', $param, 'align="center"', $sortfield, $sortorder, '')."\n";
print '</tr>';
if (! empty($conf->global->BLOCKEDLOG_SCAN_ALL_FOR_LOWERIDINERROR))
{
if (! empty($conf->global->BLOCKEDLOG_SCAN_ALL_FOR_LOWERIDINERROR)) {
// This is version that is faster but require more memory and report errors that are outside the filter range
// TODO Make a full scan of table in reverse order of id of $block, so we can use the parameter $previoushash into checkSignature to save requests

View File

@ -1428,9 +1428,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
elseif ($event->type_code == 'ICALEVENT')
{
$cssclass.= " unmovable";
}
elseif ($event->date_end_in_calendar && date('Ymd',$event->date_start_in_calendar) != date('Ymd',$event->date_end_in_calendar))
{
} elseif ($event->date_end_in_calendar && date('Ymd', $event->date_start_in_calendar) != date('Ymd', $event->date_end_in_calendar)) {
$tmpyearend = date('Y', $event->date_end_in_calendar);
$tmpmonthend = date('m', $event->date_end_in_calendar);
$tmpdayend = date('d', $event->date_end_in_calendar);

View File

@ -527,11 +527,11 @@ if (empty($reshook))
if ($action == 'settitre') $object->titre = trim(GETPOST('titre', 'alpha'));
elseif ($action == 'setemail_from') $object->email_from = trim(GETPOST('email_from', 'alpha'));
elseif ($action == 'setemail_replyto') $object->email_replyto = trim(GETPOST('email_replyto', 'alpha'));
elseif ($action == 'setemail_errorsto') $object->email_errorsto = trim(GETPOST('email_errorsto','alpha'));
elseif ($action == 'settitre' && empty($object->titre)) {
elseif ($action == 'setemail_errorsto') {
$object->email_errorsto = trim(GETPOST('email_errorsto', 'alpha'));
} elseif ($action == 'settitre' && empty($object->titre)) {
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("MailTitle"));
}
elseif ($action == 'setfrom' && empty($object->email_from)) {
} elseif ($action == 'setfrom' && empty($object->email_from)) {
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("MailFrom"));
}

View File

@ -518,8 +518,7 @@ if ($object->fetch($id) >= 0)
print_liste_field_titre("OtherInformations", $_SERVER["PHP_SELF"], "", $param, "", "", $sortfield, $sortorder);
print_liste_field_titre("Source", $_SERVER["PHP_SELF"], "", $param, "", 'align="center"', $sortfield, $sortorder);
// Date sending
if ($object->statut < 2)
{
if ($object->statut < 2) {
print_liste_field_titre('');
}
else

View File

@ -641,8 +641,7 @@ if (empty($reshook))
}
// Close proposal
elseif ($action == 'setstatut' && $usercanclose && ! GETPOST('cancel','alpha'))
{
elseif ($action == 'setstatut' && $usercanclose && ! GETPOST('cancel', 'alpha')) {
if (! (GETPOST('statut', 'int') > 0)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CloseAs")), null, 'errors');
$action = 'statut';
@ -672,8 +671,7 @@ if (empty($reshook))
}
// Reopen proposal
elseif ($action == 'confirm_reopen' && $usercanclose && ! GETPOST('cancel','alpha'))
{
elseif ($action == 'confirm_reopen' && $usercanclose && ! GETPOST('cancel', 'alpha')) {
// prevent browser refresh from reopening proposal several times
if ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED)
{
@ -1318,16 +1316,13 @@ if (empty($reshook))
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
elseif ($action == 'updateline' && $usercancreate && GETPOST('cancel','alpha'))
{
} elseif ($action == 'updateline' && $usercancreate && GETPOST('cancel', 'alpha')) {
header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition
exit();
}
// Set project
elseif ($action == 'classin' && $usercancreate) {
// Set project
$object->setProject(GETPOST('projectid', 'int'));
}

View File

@ -1132,9 +1132,7 @@ if (empty($reshook))
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
elseif ($action == 'updateline' && $user->rights->commande->creer && GETPOST('cancel','alpha') == $langs->trans('Cancel')) {
} elseif ($action == 'updateline' && $user->rights->commande->creer && GETPOST('cancel', 'alpha') == $langs->trans('Cancel')) {
header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition
exit();
}

View File

@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$langs->loadLangs(array('companies', 'bills', 'banks', 'multicurrency'));
$action = GETPOST('action', 'alpha');
$confirm = GETPOST('confirm');
$confirm = GETPOST('confirm', 'alpha');
$facid = GETPOST('facid', 'int');
$accountid = GETPOST('accountid', 'int');

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2016-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
*
* This program is free software; you can redistribute it and/or modify

View File

@ -653,8 +653,7 @@ if (empty($reshook))
}
}
elseif ($action == 'updateline' && $user->rights->contrat->creer && ! GETPOST('cancel','alpha'))
{
elseif ($action == 'updateline' && $user->rights->contrat->creer && ! GETPOST('cancel', 'alpha')) {
$error = 0;
if (!empty($date_start_update) && !empty($date_end_update) && $date_start_update > $date_end_update)

View File

@ -58,7 +58,8 @@ if ($action == 'builddoc' && $permissioncreate)
// Special case to force bank account
//if (property_exists($object, 'fk_bank'))
//{
if (GETPOST('fk_bank','int')) { // this field may come from an external module
if (GETPOST('fk_bank', 'int')) {
// this field may come from an external module
$object->fk_bank = GETPOST('fk_bank', 'int');
} elseif (! empty($object->fk_account)) {
$object->fk_bank = $object->fk_account;

View File

@ -3,6 +3,7 @@
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -902,8 +903,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang=GETPOST('lang_id', 'aZ09');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$objecttmp->thirdparty->default_lang;
if (! empty($newlang))
{
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}

View File

@ -59,10 +59,8 @@ if ($action == 'setnote_public' && ! empty($permissionnote) && ! GETPOST('cancel
if ($result < 0) dol_print_error($db, $result);
}
}
}
} elseif ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('cancel', 'alpha')) {
// Set public note
elseif ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('cancel','alpha'))
{
if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('', 'Include of actions_setnotes.inc.php was done but required variable was not set before');
if (empty($object->id)) $object->fetch($id); // Fetch may not be already done
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private', 'none'), ENT_QUOTES), '_private');

View File

@ -634,8 +634,9 @@ class Menubase
$tab_titre = explode("/", $menu['titre']);
$title = $langs->trans($tab_titre[0])."/".$langs->trans($tab_titre[1]);
}
elseif (preg_match('/\|\|/',$menu['titre'])) // To manage different translation (Title||AltTitle@ConditionForAltTitle)
elseif (preg_match('/\|\|/', $menu['titre']))
{
// To manage different translation (Title||AltTitle@ConditionForAltTitle)
$tab_title = explode("||", $menu['titre']);
$alt_title = explode("@", $tab_title[1]);
$title_enabled = verifCond($alt_title[1]);

View File

@ -4,6 +4,7 @@
* Copyright (C) 2012-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -2654,10 +2655,10 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
if (! empty($conf->productbatch->enabled)) $original_file=$conf->productbatch->multidir_output[$entity].'/'.$original_file;
}
// Wrapping pour les mouvements stocks
// Wrapping for stock movements
elseif ($modulepart == 'movement' || $modulepart == 'mouvement')
{
if (empty($entity) || (empty($conf->stock->multidir_output[$entity]) )) return array('accessallowed'=>0, 'error'=>'Value entity must be provided');
if (empty($entity) || empty($conf->stock->multidir_output[$entity])) return array('accessallowed'=>0, 'error'=>'Value entity must be provided');
if (($fuser->rights->stock->{$lire} || $fuser->rights->stock->movement->{$lire} || $fuser->rights->stock->mouvement->{$lire}) || preg_match('/^specimen/i', $original_file))
{
$accessallowed=1;

View File

@ -3089,7 +3089,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$fa='fa';
if (! empty($conf->global->MAIN_USE_FONT_AWESOME_5)) $fa='fas';
$enabledisablehtml = '<span class="' . $fa . ' ' . $fakey . ' ' . ($marginleftonlyshort ? ($marginleftonlyshort == 1 ? 'marginleftonlyshort' : 'marginleftonly') : '') . ' valignmiddle' . ($morecss ? ' ' . $morecss : '') . '" style="' . ($fasize ? ('font-size: ' . $fasize . ';') : '') . ($facolor ? (' color: ' . $facolor . ';') : '') . ($morestyle ? ' ' . $morestyle : '') . '"' . (($notitle || empty($titlealt)) ? '' : ' title="' . dol_escape_htmltag($titlealt) . '"') . ($moreatt ? ' ' . $moreatt : '') . '>';
$enabledisablehtml = '<span class="' . $fa . ' ' . $fakey . ' ' . ($marginleftonlyshort ? ($marginleftonlyshort == 1 ? 'marginleftonlyshort' : 'marginleftonly') : '');
$enabledisablehtml .= ' valignmiddle' . ($morecss ? ' ' . $morecss : '') . '" style="' . ($fasize ? ('font-size: ' . $fasize . ';') : '') . ($facolor ? (' color: ' . $facolor . ';') : '') . ($morestyle ? ' ' . $morestyle : '') . '"' . (($notitle || empty($titlealt)) ? '' : ' title="' . dol_escape_htmltag($titlealt) . '"') . ($moreatt ? ' ' . $moreatt : '') . '>';
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$enabledisablehtml.= $titlealt;
}

View File

@ -577,8 +577,7 @@ class ImportCsv extends ModeleImports
}
}
// If test is just a static regex
elseif (! preg_match('/'.$objimport->array_import_regex[0][$val].'/i',$newval))
{
elseif (! preg_match('/'.$objimport->array_import_regex[0][$val].'/i', $newval)) {
//if ($key == 19) print "xxx".$newval."zzz".$objimport->array_import_regex[0][$val]."<br>";
$this->errors[$error]['lib']=$langs->transnoentitiesnoconv('ErrorWrongValueForField', $key, $newval, $objimport->array_import_regex[0][$val]);
$this->errors[$error]['type']='REGEX';

View File

@ -602,10 +602,8 @@ class ImportXlsx extends ModeleImports
$errorforthistable++;
$error++;
}
}
} elseif (! preg_match('/'.$objimport->array_import_regex[0][$val].'/i', $newval)) {
// If test is just a static regex
elseif (! preg_match('/'.$objimport->array_import_regex[0][$val].'/i',$newval))
{
//if ($key == 19) print "xxx".$newval."zzz".$objimport->array_import_regex[0][$val]."<br>";
$this->errors[$error]['lib']=$langs->transnoentitiesnoconv('ErrorWrongValueForField', $key, $newval, $objimport->array_import_regex[0][$val]);
$this->errors[$error]['type']='REGEX';

View File

@ -27,8 +27,7 @@
*/
// Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf))
{
if (empty($conf) || ! is_object($conf)) {
print "Error, template page can't be called as URL";
exit;
}

View File

@ -145,7 +145,7 @@ $coldisplay=-1; // We remove first td
}
$coldisplay++;
print '<td align="right"><input type="text" class="flat right" size="5" id="price_ht" name="price_ht" value="' . (isset($line->pu_ht)?price($line->pu_ht,0,'',0):price($line->subprice,0,'',0)) . '"';
print '<td class="right"><input type="text" class="flat right" size="5" id="price_ht" name="price_ht" value="' . (isset($line->pu_ht)?price($line->pu_ht, 0, '', 0):price($line->subprice, 0, '', 0)) . '"';
if ($line->fk_prev_id != null) print ' readonly';
print '></td>';
@ -156,7 +156,7 @@ $coldisplay=-1; // We remove first td
if ($inputalsopricewithtax)
{
$coldisplay++;
print '<td align="right"><input type="text" class="flat right" size="5" id="price_ttc" name="price_ttc" value="'.(isset($line->pu_ttc)?price($line->pu_ttc,0,'',0):'').'"';
print '<td class="right"><input type="text" class="flat right" size="5" id="price_ttc" name="price_ttc" value="'.(isset($line->pu_ttc)?price($line->pu_ttc, 0, '', 0):'').'"';
if ($line->fk_prev_id != null) print ' readonly';
print '></td>';
}

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -28,6 +29,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/cron/class/cronjob.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/cron.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("admin","cron","bills","members"));

View File

@ -117,9 +117,8 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
if ($resupload < 0) // Unknown error
{
setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors');
}
elseif (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
{
} elseif (preg_match('/ErrorFileIsInfectedWithAVirus/', $resupload)) {
// Files infected by a virus
setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors');
}
else // Known error

View File

@ -841,9 +841,7 @@ if (empty($reshook))
header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // To redisplay the form being edited
exit();
}
}
elseif ($action == 'updateline' && $user->rights->expedition->creer && GETPOST('cancel','alpha') == $langs->trans('Cancel')) {
} elseif ($action == 'updateline' && $user->rights->expedition->creer && GETPOST('cancel', 'alpha') == $langs->trans('Cancel')) {
header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // To redisplay the form being edited
exit();
}

View File

@ -594,8 +594,7 @@ if (empty($reshook))
/*
* Mise a jour d'une ligne d'intervention
*/
elseif ($action == 'updateline' && $user->rights->ficheinter->creer && GETPOST('save','alpha') == $langs->trans("Save"))
{
elseif ($action == 'updateline' && $user->rights->ficheinter->creer && GETPOST('save', 'alpha') == $langs->trans("Save")) {
$objectline = new FichinterLigne($db);
if ($objectline->fetch($lineid) <= 0)
{

View File

@ -1239,9 +1239,7 @@ if (empty($reshook))
setEventMessages($langs->trans("ErrorWebServicesFieldsRequired"), null, 'errors');
} elseif (empty($ws_user) || empty($ws_password) || empty($ws_thirdparty)) {
setEventMessages($langs->trans("ErrorFieldsRequired"), null, 'errors');
}
else
{
} else {
//Create SOAP client and connect it to order
$soapclient_order = new nusoap_client($ws_url."/webservices/server_order.php");
$soapclient_order->soap_defencoding='UTF-8';

View File

@ -42,10 +42,10 @@ $langs->loadLangs(array('companies', 'bills', 'banks', 'compta'));
// Security check
$action = GETPOST('action', 'alpha');
$confirm = GETPOST('confirm');
$confirm = GETPOST('confirm', 'alpha');
$facid = GETPOST('facid', 'int');
$socid = GETPOST('socid', 'int');
$accountid = GETPOST('accountid');
$accountid = GETPOST('accountid', 'int');
$day = GETPOST('day', 'int');
$month = GETPOST('month', 'int');
$year = GETPOST('year', 'int');
@ -773,8 +773,7 @@ if (empty($action))
if (!$user->rights->societe->client->voir) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid > 0) $sql .= ' AND f.fk_soc = '.$socid;
// Search criteria
if ($month > 0)
{
if ($month > 0) {
if ($year > 0 && empty($day))
$sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year, $month, false))."' AND '".$db->idate(dol_get_last_day($year, $month, false))."'";
elseif ($year > 0 && ! empty($day))

View File

@ -106,9 +106,8 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
if ($resupload < 0) // Unknown error
{
setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors');
}
elseif (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
{
} elseif (preg_match('/ErrorFileIsInfectedWithAVirus/', $resupload)) {
// Files infected by a virus
setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors');
}
else // Known error

View File

@ -54,3 +54,4 @@ Paymentnumpad=Payment Num Pad
Numberspad=Numbers Pad
BillsCoinsPad=Bills and Coins Pad
DolistorePosCategory=TakePOS modules and other POS solutions for Dolibarr
TakeposNeedsCategories=TakePOS needs product categories to work

View File

@ -133,8 +133,7 @@ unset($conf->db->pass); // This is to avoid password to be shown in memory/sw
/*
* Object $user
*/
if (! defined('NOREQUIREUSER'))
{
if (! defined('NOREQUIREUSER')) {
$user = new User($db);
}

View File

@ -15,6 +15,7 @@
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2016 Meziane Sof <virtualsof@yahoo.fr>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -1176,8 +1177,7 @@ else
// Accountancy_code_sell
print '<tr><td class="titlefieldcreate">'.$langs->trans("ProductAccountancySellCode").'</td>';
print '<td>';
if($type = 0)
{
if($type = 0) {
$accountancy_code_sell = (GETPOST('accountancy_code_sell', 'alpha')?(GETPOST('accountancy_code_sell', 'alpha')):$conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT);
} else {
$accountancy_code_sell = (GETPOST('accountancy_code_sell', 'alpha')?(GETPOST('accountancy_code_sell', 'alpha')):$conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT);
@ -1190,8 +1190,7 @@ else
{
print '<tr><td class="titlefieldcreate">'.$langs->trans("ProductAccountancySellIntraCode").'</td>';
print '<td>';
if($type = 0)
{
if($type = 0) {
$accountancy_code_sell_intra = (GETPOST('accountancy_code_sell_intra', 'alpha')?(GETPOST('accountancy_code_sell_intra', 'alpha')):$conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT);
} else {
$accountancy_code_sell_intra = GETPOST('accountancy_code_sell_intra', 'alpha');
@ -1228,8 +1227,7 @@ else
if ($conf->global->MAIN_FEATURES_LEVEL)
{
// Accountancy_code_sell_intra
if ($mysoc->isInEEC())
{
if ($mysoc->isInEEC()) {
print '<tr><td class="titlefieldcreate">'.$langs->trans("ProductAccountancySellIntraCode").'</td>';
print '<td class="maxwidthonsmartphone"><input class="minwidth100" name="accountancy_code_sell_intra" value="'.$object->accountancy_code_sell_intra.'">';
print '</td></tr>';

View File

@ -722,18 +722,14 @@ class Project extends CommonObject
}
}
if (empty($error))
{
if (empty($error)) {
// We remove directory
$projectref = dol_sanitizeFileName($this->ref);
if ($conf->projet->dir_output)
{
if ($conf->projet->dir_output) {
$dir = $conf->projet->dir_output . "/" . $projectref;
if (file_exists($dir))
{
if (file_exists($dir)) {
$res = @dol_delete_dir_recursive($dir);
if (!$res)
{
if (!$res) {
$this->errors[] = 'ErrorFailToDeleteDir';
$error++;
}
@ -955,48 +951,37 @@ class Project extends CommonObject
// phpcs:enable
global $langs;
if ($mode == 0)
{
if ($mode == 0) {
return $langs->trans($this->statuts_long[$statut]);
}
if ($mode == 1)
{
} elseif ($mode == 1) {
return $langs->trans($this->statuts_short[$statut]);
}
if ($mode == 2)
{
} elseif ($mode == 2) {
if ($statut == 0)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut0') . ' ' . $langs->trans($this->statuts_short[$statut]);
if ($statut == 1)
elseif ($statut == 1)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut4') . ' ' . $langs->trans($this->statuts_short[$statut]);
if ($statut == 2)
elseif ($statut == 2)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut6') . ' ' . $langs->trans($this->statuts_short[$statut]);
}
if ($mode == 3)
{
} elseif ($mode == 3) {
if ($statut == 0)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut0');
if ($statut == 1)
elseif ($statut == 1)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut4');
if ($statut == 2)
elseif ($statut == 2)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut6');
}
if ($mode == 4)
{
} elseif ($mode == 4) {
if ($statut == 0)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut0') . ' ' . $langs->trans($this->statuts_long[$statut]);
if ($statut == 1)
elseif ($statut == 1)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut4') . ' ' . $langs->trans($this->statuts_long[$statut]);
if ($statut == 2)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut6') . ' ' . $langs->trans($this->statuts_long[$statut]);
}
if ($mode == 5)
{
} elseif ($mode == 5) {
if ($statut == 0)
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_long[$statut]), 'statut0');
if ($statut == 1)
elseif ($statut == 1)
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_long[$statut]), 'statut4');
if ($statut == 2)
elseif ($statut == 2)
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_long[$statut]), 'statut6');
}
}

View File

@ -969,9 +969,9 @@ foreach ($listofreferent as $key => $value)
// Third party or user
print '<td class="left">';
if (is_object($element->thirdparty)) print $element->thirdparty->getNomUrl(1,'',48);
elseif ($tablename == 'expensereport_det')
{
if (is_object($element->thirdparty)) {
print $element->thirdparty->getNomUrl(1, '', 48);
} elseif ($tablename == 'expensereport_det') {
$tmpuser=new User($db);
$tmpuser->fetch($expensereport->fk_user_author);
print $tmpuser->getNomUrl(1, '', 48);

View File

@ -687,9 +687,7 @@ if (empty($reshook))
header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition
exit();
}
}
elseif ($action == 'updateline' && $user->rights->reception->creer && GETPOST('cancel','alpha') == $langs->trans('Cancel')) {
} elseif ($action == 'updateline' && $user->rights->reception->creer && GETPOST('cancel', 'alpha') == $langs->trans('Cancel')) {
header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition
exit();
}

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2018-2019 Thibault FOUCART <support@ptibogxiv.net>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -59,8 +60,7 @@ $stripe = new Stripe($db);
llxHeader('', $langs->trans("StripePayoutList"));
if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox','alpha')))
{
if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) {
$service = 'StripeTest';
$servicestatus = '0';
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning');
@ -80,8 +80,9 @@ $stripeacc = $stripe->getStripeAccount($service);
if (! $rowid) {
print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
if ($optioncss != '')
if ($optioncss != '') {
print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
}
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="action" value="list">';
@ -207,16 +208,17 @@ if (! $rowid) {
print "<td align=\"right\">" . price(($payout->fee) / 100, 0, '', 1, - 1, - 1, strtoupper($payout->currency)) . "</td>";
// Status
print "<td align='right'>";
if ($payout->status=='paid')
{print img_picto($langs->trans("".$payout->status.""),'statut4');}
elseif ($payout->status=='pending')
{print img_picto($langs->trans("".$payout->status.""),'statut7');}
elseif ($payout->status=='in_transit')
{print img_picto($langs->trans("".$payout->status.""),'statut7');}
elseif ($payout->status=='failed')
{print img_picto($langs->trans("".$payout->status.""),'statut7');}
elseif ($payout->status=='canceled')
{print img_picto($langs->trans("".$payout->status.""),'statut8');}
if ($payout->status=='paid') {
print img_picto($langs->trans("".$payout->status.""), 'statut4');
} elseif ($payout->status=='pending') {
print img_picto($langs->trans("".$payout->status.""), 'statut7');
} elseif ($payout->status=='in_transit') {
print img_picto($langs->trans("".$payout->status.""), 'statut7');
} elseif ($payout->status=='failed') {
print img_picto($langs->trans("".$payout->status.""), 'statut7');
} elseif ($payout->status=='canceled') {
print img_picto($langs->trans("".$payout->status.""), 'statut8');
}
print '</td>';
print "</tr>\n";
}

View File

@ -1,21 +1,11 @@
html,body {
padding:0;
box-sizing: border-box;
padding:3px;
margin:0;
height:100%;
width:100%;
}
.row {
width:100%;
height:50%;
}
.row div {
width:33%;
height:100%;
float:left;
}
button.calcbutton {
display: inline-block;
position: relative;
@ -69,33 +59,36 @@ button.actionbutton {
vertical-align: middle;
text-align: center;
overflow: visible; /* removes extra width in IE */
width:32%;
height:32%;
width:33%;
height:33%;
}
div.wrapper{
float:left; /* important */
position:relative; /* important(so we can absolutely position the description div */
width:21.5%;
height:23%;
margin:1%;
width:25%;
height:25%;
margin:0;
padding:1px;
border: 0.1em solid;
box-shadow: 3px 3px 2px #888;
text-align: center;
box-sizing: border-box;
background-color:#f0eeee;
}
div.wrapper2{
float:left; /* important */
position:relative; /* important(so we can absolutely position the description div */
width:10.9%;
height:23%;
margin-top:0.5%;
margin-bottom:0.5%;
margin-left:0.5%;
margin-right:0.5%;
width:12.5%;
height:25%;
margin:0;
padding:1px;
border: 0.1em solid;
box-shadow: 3px 3px 2px #888;
box-shadow: 2px 2px 1px #888;
text-align: center;
box-sizing: border-box;
background-color:#f0eeee;
}
button:active{
@ -124,8 +117,8 @@ div.description{
}
.container{
width: 98%;
height: 98%;
width: 100%;
height: 100%;
margin: 0 auto;
overflow: visible;
box-sizing: border-box;
@ -145,10 +138,12 @@ div.description{
.div1{
height:100%;
width: 33%;
width: 34%;
float: left;
text-align: center;
box-sizing: border-box;
overflow: auto;
background-color:white;
}
.div2{
@ -156,7 +151,6 @@ div.description{
width: 33%;
font-size: 0;
float: left;
text-align: center;
padding-left: 10px;
box-sizing: border-box;
}
@ -165,7 +159,6 @@ div.description{
height: 100%;
width: 33%;
float: left;
text-align: center;
box-sizing: border-box;
}
@ -175,6 +168,7 @@ div.description{
float: left;
box-sizing: border-box;
font-size: 6px;
padding:3px;
}
.div5{
@ -183,6 +177,7 @@ div.description{
float: left;
box-sizing: border-box;
font-size: 6px;
padding:10px;
}
p.description_content{

View File

@ -387,12 +387,12 @@ $( document ).ready(function() {
});
</script>
<body style="overflow: hidden; background-color:#E8E8E8;">
<body style="overflow: hidden; background-color:#D1D1D1;">
<div class="container">
<div class="row1">
<div id="poslines" class="div1" style="overflow: auto;">
<div id="poslines" class="div1">
</div>
<div class="div2">
@ -415,6 +415,13 @@ $( document ).ready(function() {
</div>
<?php
// TakePOS setup check
if (empty($conf->global->CASHDESK_ID_THIRDPARTY) or empty($conf->global->CASHDESK_ID_BANKACCOUNT_CASH) or empty($conf->global->CASHDESK_ID_BANKACCOUNT_CB)) {
setEventMessages($langs->trans("ErrorModuleSetupNotComplete"), null, 'errors');
}
if (count($maincategories)==0) {
setEventMessages($langs->trans("TakeposNeedsCategories"), null, 'errors');
}
// User menu and external TakePOS modules
$menus = array();
$r=0;
@ -447,14 +454,15 @@ if($conf->global->TAKEPOS_BAR_RESTAURANT){
}
if ($conf->global->TAKEPOSCONNECTOR){
$menus[$r++]=array('title'=>$langs->trans("DOL_OPEN_DRAWER"),
'action'=>'OpenDrawer();');
$menus[$r++]=array(
'title'=>$langs->trans("DOL_OPEN_DRAWER"),
'action'=>'OpenDrawer();'
);
}
$hookmanager->initHooks(array('takeposfrontend'));
$reshook=$hookmanager->executeHooks('ActionButtons');
if (!empty($reshook))
{
if (!empty($reshook)) {
$menus[$r++]=$reshook;
}

View File

@ -197,7 +197,9 @@ class Users extends DolibarrApi
*
* @param int $id Id of account to update
* @param array $request_data Datas
* @return int
* @return array
*
* @throws RestException
*/
function put($id, $request_data = null)
{

View File

@ -472,15 +472,17 @@ else
print '<tr class="oddeven">';
print '<td>';
print $useringroup->getNomUrl(-1, '', 0, 0, 24, 0, 'login');
if ($useringroup->admin && ! $useringroup->entity) print img_picto($langs->trans("SuperAdministrator"),'redstar');
elseif ($useringroup->admin) print img_picto($langs->trans("Administrator"),'star');
if ($useringroup->admin && ! $useringroup->entity) {
print img_picto($langs->trans("SuperAdministrator"), 'redstar');
} elseif ($useringroup->admin) {
print img_picto($langs->trans("Administrator"), 'star');
}
print '</td>';
print '<td>'.$useringroup->lastname.'</td>';
print '<td>'.$useringroup->firstname.'</td>';
print '<td align="center">'.$useringroup->getLibStatut(3).'</td>';
print '<td align="right">';
if (! empty($user->admin))
{
if (! empty($user->admin)) {
print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=removeuser&amp;user='.$useringroup->id.'">';
print img_picto($langs->trans("RemoveFromGroup"), 'unlink');
print '</a>';