2
0
forked from Wavyzz/dolibarr

Merge remote-tracking branch 'upstream/develop' into 14a27

This commit is contained in:
Alexandre SPANGARO
2021-03-20 07:47:54 +01:00
150 changed files with 1082 additions and 693 deletions

View File

@@ -288,6 +288,7 @@ if (empty($conf->use_javascript_ajax) || !empty($conf->global->MAIN_ECM_DISABLE_
print '<td class="center">';
$userstatic->id = $val['fk_user_c'];
$userstatic->lastname = $val['login_c'];
$userstatic->statut = $val['statut_c'];
$htmltooltip = '<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';
$htmltooltip = '<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMSectionManual").'<br>';
$htmltooltip .= '<b>'.$langs->trans("ECMCreationUser").'</b>: '.$userstatic->getNomUrl(1, '', false, 1).'<br>';
@@ -454,6 +455,7 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir,
print '<td class="right" width="18">';
$userstatic->id = isset($val['fk_user_c']) ? $val['fk_user_c'] : 0;
$userstatic->lastname = isset($val['login_c']) ? $val['login_c'] : 0;
$userstatic->statut = isset($val['statut_c']) ? $val['statut_c'] : 0;
$htmltooltip = '<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';
$htmltooltip = '<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMSectionManual").'<br>';
$htmltooltip .= '<b>'.$langs->trans("ECMCreationUser").'</b>: '.$userstatic->getNomUrl(1, '', false, 1).'<br>';

View File

@@ -48,10 +48,6 @@ $action = GETPOST('action', 'aZ09');
* View
*/
// Ajout directives pour resoudre bug IE
//header('Cache-Control: Public, must-revalidate');
//header('Pragma: public');
//top_htmlhead("", "", 1); // Replaced with top_httphead. An ajax page does not need html header.
top_httphead();
@@ -63,7 +59,7 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $
$al->datev_next(GETPOST('rowid', 'int'));
$al->fetch(GETPOST('rowid', 'int'));
print '<span>'.dol_print_date($db->jdate($al->datev), "day").'</span>';
print '<span class="spanforajaxedit" id="datevalue_'.$al->id.'">'.dol_print_date($db->jdate($al->datev), "day").'</span>';
exit;
}
@@ -74,7 +70,7 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $
$al->datev_previous(GETPOST('rowid', 'int'));
$al->fetch(GETPOST('rowid', 'int'));
print '<span>'.dol_print_date($db->jdate($al->datev), "day").'</span>';
print '<span class="spanforajaxedit" id="datevalue_'.$al->id.'">'.dol_print_date($db->jdate($al->datev), "day").'</span>';
exit;
}
@@ -85,7 +81,7 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $
$al->dateo_next(GETPOST('rowid', 'int'));
$al->fetch(GETPOST('rowid', 'int'));
print '<span>'.dol_print_date($db->jdate($al->dateo), "day").'</span>';
print '<span class="spanforajaxedit" id="dateoperation_'.$al->id.'">'.dol_print_date($db->jdate($al->dateo), "day").'</span>';
exit;
}
@@ -96,7 +92,7 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $
$al->dateo_previous(GETPOST('rowid', 'int'));
$al->fetch(GETPOST('rowid', 'int'));
print '<span>'.dol_print_date($db->jdate($al->dateo), "day").'</span>';
print '<span class="spanforajaxedit" id="dateoperation_'.$al->id.'">'.dol_print_date($db->jdate($al->dateo), "day").'</span>';
exit;
}

View File

@@ -79,6 +79,10 @@ if (!empty($conf->societe->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONT
if (((!empty($conf->product->enabled) && $user->rights->produit->lire) || (!empty($conf->service->enabled) && $user->rights->service->lire))
&& empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED)) {
$arrayresult['searchintoproduct'] = array('position'=>30, 'shortcut'=>'P', 'img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'text'=>img_picto('', 'object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
// search on lot/serial numbers
if ( ! empty($conf->productbatch->enabled) ) {
$arrayresult['searchintobatch'] = array('position'=>32, 'shortcut'=>'B', 'img'=>'object_plot', 'label'=>$langs->trans("SearchIntoBatch", $search_boxvalue), 'text'=>img_picto('', 'object_lot').' '.$langs->trans("SearchIntoBatch", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/stock/productlot_list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
}
}
if (!empty($conf->mrp->enabled) && $user->rights->mrp->read && empty($conf->global->MAIN_SEARCHFORM_MRP_DISABLED)) {

View File

@@ -34,7 +34,7 @@ class box_members_by_type extends ModeleBoxes
{
public $boxcode = "box_members_by_type";
public $boximg = "object_user";
public $boxlabel = "BoxMembersByType";
public $boxlabel = "BoxTitleMembersByType";
public $depends = array("adherent");
/**

View File

@@ -34,7 +34,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes
{
public $boxcode = "box_members_subscriptions_by_year";
public $boximg = "object_user";
public $boxlabel = "BoxMembersSubscriptionsByYear";
public $boxlabel = "BoxTitleMembersSubscriptionsByYear";
public $depends = array("adherent");
/**
@@ -122,7 +122,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes
$line = 0;
$this->info_box_contents[$line][] = array(
'td' => 'class="liste_titre"',
'td' => 'class=""',
'text' => $langs->trans("Year"),
);
$this->info_box_contents[$line][] = array(

View File

@@ -860,7 +860,7 @@ abstract class CommonObject
if (!empty($conf->socialnetworks->enabled)) {
$outsocialnetwork = '';
if (is_array($this->socialnetworks) && count($this->socialnetworks) > 0) {
if (!empty($this->socialnetworks) && is_countable($this->socialnetworks) && count($this->socialnetworks) > 0) {
$socialnetworksdict = getArrayOfSocialNetworks();
foreach ($this->socialnetworks as $key => $value) {
if ($value) {

View File

@@ -826,23 +826,29 @@ class Conf
unset($this->global->MAIN_NO_CONCAT_DESCRIPTION);
}
// For backward compatibility
// product is new use
if (isset($this->product)) {
// For backward compatibility
$this->produit = $this->product;
}
// invoice is new use, facture is old use still initialised
if (isset($this->facture)) {
$this->invoice = $this->facture;
}
// order is new use, commande is old use still initialised
if (isset($this->commande)) {
$this->order = $this->commande;
}
// contract is new use, contrat is old use still initialised
if (isset($this->contrat)) {
$this->contract = $this->contrat;
}
// category is new use, categorie is old use still initialised
if (isset($this->categorie)) {
$this->category = $this->categorie;
}
if (isset($this->project)) {
// project is new use, projet is old use still initialised
if (isset($this->projet) && !isset($this->project)) {
$this->project = $this->projet;
}

View File

@@ -54,7 +54,7 @@ class EmailSenderProfile extends CommonObject
/**
* @var string String with name of icon for emailsenderprofile
*/
public $picto = 'emailsenderprofile@monmodule';
public $picto = 'emailsenderprofile';
const STATUS_DISABLED = 0;

View File

@@ -362,7 +362,7 @@ class FormOther
if (!is_numeric($showempty)) {
$textforempty = $showempty;
}
$moreforfilter .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.($showempty < 0 ? $showempty : -1).'"'.($selected == $showempty ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
$moreforfilter .= '<option class="optiongrey" value="'.($showempty < 0 ? $showempty : -1).'"'.($selected == $showempty ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
//$moreforfilter .= '<option value="0" '.($moreparamonempty ? $moreparamonempty.' ' : '').' class="optiongrey">'.(is_numeric($showempty) ? '&nbsp;' : $showempty).'</option>'; // Should use -1 to say nothing
}

View File

@@ -1886,7 +1886,8 @@ function email_admin_prepare_head()
}
}
if (!empty($user->admin) && (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu'] != 'email_templates')) {
// admin and non admin can view this menu entry, but it is not shown yet when we on user menu "Email templates"
if (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu'] != 'email_templates') {
$head[$h][0] = DOL_URL_ROOT."/admin/mails_senderprofile_list.php";
$head[$h][1] = $langs->trans("EmailSenderProfiles");
$head[$h][2] = 'senderprofiles';

View File

@@ -1190,7 +1190,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
$obj = $db->fetch_object($result);
$contactstatic->id = $obj->rowid;
$contactstatic->ref = $obj->ref;
$contactstatic->ref = $obj->rowid;
$contactstatic->statut = $obj->statut;
$contactstatic->lastname = $obj->lastname;
$contactstatic->firstname = $obj->firstname;
@@ -1204,7 +1204,6 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
$contactstatic->phone_mobile = $obj->phone_mobile;
$contactstatic->phone_perso = $obj->phone_perso;
$contactstatic->email = $obj->email;
$contactstatic->web = $obj->web;
$contactstatic->socialnetworks = $obj->socialnetworks;
$contactstatic->photo = $obj->photo;

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* Copyright (C) 2015-2021 Frederic France <frederic.france@netlogic.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* This program is free software; you can redistribute it and/or modify
@@ -98,7 +98,7 @@ function contact_prepare_head(Contact $object)
// Agenda / Events
$head[$tab][0] = DOL_URL_ROOT.'/contact/agenda.php?id='.$object->id;
$head[$tab][1] .= $langs->trans("Events");
$head[$tab][1] = $langs->trans("Events");
if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$head[$tab][1] .= '/';
$head[$tab][1] .= $langs->trans("Agenda");

View File

@@ -1876,7 +1876,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
}
}
if (!$phototoshow) { // Show No photo link (picto of object)
if (empty($phototoshow)) { // Show No photo link (picto of object)
$morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">';
if ($object->element == 'action') {
$width = 80;
@@ -2069,33 +2069,33 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs
// See format of addresses on https://en.wikipedia.org/wiki/Address
// Address
if (empty($mode)) {
$ret .= ($extralangcode ? $object->array_languages['address'][$extralangcode] : $object->address);
$ret .= ($extralangcode ? $object->array_languages['address'][$extralangcode] : (empty($object->address) ? '' : $object->address));
}
// Zip/Town/State
if (isset($object->country_code) && in_array($object->country_code, array('AU', 'CA', 'US')) || !empty($conf->global->MAIN_FORCE_STATE_INTO_ADDRESS)) {
// US: title firstname name \n address lines \n town, state, zip \n country
$town = ($extralangcode ? $object->array_languages['town'][$extralangcode] : $object->town);
$town = ($extralangcode ? $object->array_languages['town'][$extralangcode] : (empty($object->town) ? '' : $object->town));
$ret .= ($ret ? $sep : '').$town;
if (!empty($object->state)) {
$ret .= ($ret ? ", " : '').$object->state;
}
if ($object->zip) {
if (!empty($object->zip)) {
$ret .= ($ret ? ", " : '').$object->zip;
}
} elseif (isset($object->country_code) && in_array($object->country_code, array('GB', 'UK'))) {
// UK: title firstname name \n address lines \n town state \n zip \n country
$town = ($extralangcode ? $object->array_languages['town'][$extralangcode] : $object->town);
$town = ($extralangcode ? $object->array_languages['town'][$extralangcode] : (empty($object->town) ? '' : $object->town));
$ret .= ($ret ? $sep : '').$town;
if (!empty($object->state)) {
$ret .= ($ret ? ", " : '').$object->state;
}
if ($object->zip) {
if (!empty($object->zip)) {
$ret .= ($ret ? $sep : '').$object->zip;
}
} elseif (isset($object->country_code) && in_array($object->country_code, array('ES', 'TR'))) {
// ES: title firstname name \n address lines \n zip town \n state \n country
$ret .= ($ret ? $sep : '').$object->zip;
$town = ($extralangcode ? $object->array_languages['town'][$extralangcode] : $object->town);
$town = ($extralangcode ? $object->array_languages['town'][$extralangcode] : (empty($object->town) ? '' : $object->town));
$ret .= ($town ? (($object->zip ? ' ' : '').$town) : '');
if (!empty($object->state)) {
$ret .= "\n".$object->state;
@@ -2103,12 +2103,12 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs
} elseif (isset($object->country_code) && in_array($object->country_code, array('IT'))) {
// IT: tile firstname name\n address lines \n zip (Code Departement) \n country
$ret .= ($ret ? $sep : '').$object->zip;
$town = ($extralangcode ? $object->array_languages['town'][$extralangcode] : $object->town);
$town = ($extralangcode ? $object->array_languages['town'][$extralangcode] : (empty($object->town) ? '' : $object->town));
$ret .= ($town ? (($object->zip ? ' ' : '').$town) : '');
$ret .= (empty($object->state_code) ? '' : (' '.$object->state_code));
} else { // Other: title firstname name \n address lines \n zip town \n country
$town = ($extralangcode ? $object->array_languages['town'][$extralangcode] : $object->town);
$ret .= $object->zip ? (($ret ? $sep : '').$object->zip) : '';
$town = ($extralangcode ? $object->array_languages['town'][$extralangcode] : (empty($object->town) ? '' : $object->town));
$ret .= !empty($object->zip) ? (($ret ? $sep : '').$object->zip) : '';
$ret .= ($town ? (($object->zip ? ' ' : ($ret ? $sep : '')).$town) : '');
if (!empty($object->state) && in_array($object->country_code, $countriesusingstate)) {
$ret .= ($ret ? ", " : '').$object->state;

View File

@@ -621,7 +621,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
}
} elseif (in_array($feature, $checksoc)) { // We check feature = checksoc
// If external user: Check permission for external users
if ($user->socid > 0 && empty($conf->global->MAIN_EXTERNAL_USERS_CAN_SEE_SUBSIDIARY_COMPANIES)) {
if ($user->socid > 0) {
if ($user->socid <> $objectid) {
return false;
}

View File

@@ -79,13 +79,13 @@ class modBarcode extends DolibarrModules
$this->rights = array();
$this->rights_class = 'barcode';
$this->rights[1][0] = 300; // id de la permission
$this->rights[1][0] = 301; // id de la permission
$this->rights[1][1] = 'Read barcodes'; // libelle de la permission
$this->rights[1][2] = 'r'; // type de la permission (deprecie a ce jour)
$this->rights[1][3] = 1; // La permission est-elle une permission par defaut
$this->rights[1][4] = 'lire_advance';
$this->rights[2][0] = 301; // id de la permission
$this->rights[2][0] = 302; // id de la permission
$this->rights[2][1] = 'Create/modify barcodes'; // libelle de la permission
$this->rights[2][2] = 'w'; // type de la permission (deprecie a ce jour)
$this->rights[2][3] = 0; // La permission est-elle une permission par defaut

View File

@@ -92,7 +92,7 @@ class modBlockedLog extends DolibarrModules
$this->always_enabled = (!empty($conf->blockedlog->enabled)
&& !empty($conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY)
&& in_array($mysoc->country_code, explode(',', $conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY))
&& in_array((empty($mysoc->country_code) ? '' : $mysoc->country_code), explode(',', $conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY))
&& $this->alreadyUsed());
// Constants

View File

@@ -204,8 +204,8 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php<br>Contact:con
<!-- Totalizable -->
<tr class="extra_totalizable"><td><?php echo $langs->trans("Totalizable"); ?></td><td class="valeur"><input id="totalizable" type="checkbox" name="totalizable"<?php echo ((GETPOST('totalizable', 'alpha') || GETPOST('button', 'alpha')) ? ' checked' : ''); ?>></td></tr>
<!-- Help tooltip -->
<tr class="help"><td><?php echo $form->textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?></td><td class="valeur"><input id="help" class="quatrevingtpercent" type="text" name="help" value="<?php echo dol_escape_htmltag($help); ?>"></td></tr>
<?php if ($conf->multicompany->enabled) { ?>
<tr class="help"><td><?php echo $form->textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?></td><td class="valeur"><input id="help" class="quatrevingtpercent" type="text" name="help" value="<?php echo dol_escape_htmltag((empty($help) ? '' : $help)); ?>"></td></tr>
<?php if (empty($conf->multicompany->enabled)) { ?>
<!-- Multicompany entity -->
<tr><td><?php echo $langs->trans("AllEntities"); ?></td><td class="valeur"><input id="entitycurrentorall" type="checkbox" name="entitycurrentorall"<?php echo (GETPOST('entitycurrentorall', 'alpha') ? '' : ' checked'); ?>></td></tr>
<?php } ?>

View File

@@ -141,7 +141,7 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php<br>Contact:con
<input type="hidden" name="token" value="<?php echo newToken(); ?>">
<input type="hidden" name="attrname" value="<?php echo $attrname; ?>">
<input type="hidden" name="action" value="update">
<input type="hidden" name="rowid" value="<?php echo $rowid ?>">
<input type="hidden" name="rowid" value="<?php echo (empty($rowid) ? '' : $rowid) ?>">
<input type="hidden" name="enabled" value="<?php echo $extrafields->attributes[$elementtype]['enabled'][$attrname]; ?>">
<?php print dol_get_fiche_head(); ?>
@@ -295,7 +295,7 @@ if (in_array($type, array_keys($typewecanchangeinto))) {
<!-- Help tooltip -->
<tr class="help"><td><?php echo $form->textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?></td><td class="valeur"><input id="help" class="quatrevingtpercent" type="text" name="help" value="<?php echo dol_escape_htmltag($help); ?>"></td></tr>
<?php if ($conf->multicompany->enabled) { ?>
<?php if (empty($conf->multicompany->enabled)) { ?>
<!-- Multicompany entity -->
<tr><td><?php echo $langs->trans("AllEntities"); ?></td><td class="valeur"><input id="entitycurrentorall" type="checkbox" name="entitycurrentorall"<?php echo (empty($entitycurrentorall) ? ' checked' : ''); ?>></td></tr>
<?php } ?>

View File

@@ -65,7 +65,7 @@ print '<td class="center">'.$langs->trans("AlwaysEditable").'</td>';
print '<td class="center">'.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).'</td>';
print '<td class="center">'.$form->textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")).'</td>';
print '<td class="center">'.$form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")).'</td>';
if ($conf->multicompany->enabled) {
if (empty($conf->multicompany->enabled)) {
print '<td class="center">'.$langs->trans("Entities").'</td>';
}
print '<td width="80">&nbsp;</td>';

View File

@@ -159,7 +159,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
$keyforperm = 'ficheinter';
}
if (isset($user->rights->$keyforperm)) {
$permok = $user->rights->$keyforperm->creer || $user->rights->$keyforperm->create || $user->rights->$keyforperm->write;
$permok = !empty($user->rights->$keyforperm->creer) || !empty($user->rights->$keyforperm->create) || !empty($user->rights->$keyforperm->write);
}
if ($object->element == 'order_supplier') {
$permok = $user->rights->fournisseur->commande->creer;