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

This commit is contained in:
Laurent Destailleur 2021-03-18 23:59:03 +01:00
commit e9f9cf62af
32 changed files with 150 additions and 90 deletions

View File

@ -7,7 +7,7 @@
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2017-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2017-2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Eric Seigne <eric.seigne@cap-rel.fr>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
@ -960,13 +960,18 @@ if (empty($action) || $action == 'view') {
$nom = $langs->trans("FinanceJournal").' | '.$accountingjournalstatic->getNomUrl(0, 1, 1, '', 1);
$builddate = dol_now();
//$description = $langs->trans("DescFinanceJournal") . '<br>';
$description .= $langs->trans("DescJournalOnlyBindedVisible").'<br>';
$description = $langs->trans("DescJournalOnlyBindedVisible").'<br>';
$listofchoices = array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
$listofchoices = array(
'notyet'=>$langs->trans("NotYetInGeneralLedger"),
'already'=>$langs->trans("AlreadyInGeneralLedger")
);
$period = $form->selectDate($date_start ? $date_start : -1, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end ? $date_end : -1, 'date_end', 0, 0, 0, '', 1, 0);
$period .= ' - '.$langs->trans("JournalizationInLedgerStatus").' '.$form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
$varlink = 'id_journal='.$id_journal;
$periodlink = '';
$exportlink = '';
journalHead($nom, '', $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);

View File

@ -8,7 +8,7 @@
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2021 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
@ -663,7 +663,7 @@ if (empty($action) || $action == 'view') {
$periodlink = '';
$exportlink = '';
$builddate = dol_now();
$description .= $langs->trans("DescJournalOnlyBindedVisible").'<br>';
$description = $langs->trans("DescJournalOnlyBindedVisible").'<br>';
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$description .= $langs->trans("DepositsAreNotIncluded");
} else {

View File

@ -8,7 +8,7 @@
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020-2021 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
@ -254,7 +254,8 @@ if ($conf->facture->enabled) {
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
print '<tr class="oddeven"><td>'.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").'</td>';
print '<td>';
$form->select_produits($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', '', 0);
$selected = (empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) ? '' : $conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
$form->select_produits($selected, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', '', 0);
print '</td>';
}
print "</tr>\n";

View File

@ -1691,6 +1691,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
*/
print '<div class="tabsAction">';
$isinspip = 0;
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
if (empty($reshook)) {
@ -1827,7 +1828,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$genallowed = $user->rights->adherent->lire;
$delallowed = $user->rights->adherent->creer;
print $formfile->showdocuments('member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $object->default_lang, '', $object);
print $formfile->showdocuments('member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', (empty($object->default_lang) ? '' : $object->default_lang), '', $object);
$somethingshown = $formfile->numoffiles;
// Show links to link elements

View File

@ -442,7 +442,7 @@ foreach ($configfileparameters as $key => $value) {
print img_warning($langs->trans('SwitchThisForABetterSecurity', 0));
}
} else {
print ${$newkey};
print (empty(${$newkey}) ? '' : ${$newkey});
}
if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) {
print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')';

View File

@ -81,7 +81,7 @@ $langs->loadLangs(array('propal', 'other', 'companies'));
if ($mode == 'customer') {
$picto = 'propal';
$title = $langs->trans("ProposalsStatistics");
$dir = $conf->propale->dir_temp;
$dir = $conf->propal->dir_temp;
$cat_type = Categorie::TYPE_CUSTOMER;
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer"));
}

View File

@ -233,6 +233,7 @@ $account_from = '';
$account_to = '';
$label = '';
$amount = '';
$amountto = '';
if ($error) {
$account_from = GETPOST('account_from', 'int');

View File

@ -1543,6 +1543,13 @@ class Facture extends CommonInvoice
}
}
global $action, $hookmanager;
$hookmanager->initHooks(array('invoicedao'));
$parameters = array('id'=>$this->id, 'getnomurl'=>$result, 'notooltip' => $notooltip, 'addlinktonotes' => $addlinktonotes, 'save_lastsearch_value'=> $save_lastsearch_value, 'target' => $target);
$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook > 0) $result = $hookmanager->resPrint;
else $result .= $hookmanager->resPrint;
return $result;
}

View File

@ -493,6 +493,10 @@ if ($search_user > 0) {
$sql .= ", ".MAIN_DB_PREFIX."element_contact as ec";
$sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc";
}
// Add table from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql .= ' WHERE f.fk_soc = s.rowid';
$sql .= ' AND f.entity IN ('.getEntity('invoice').')';
@ -689,10 +693,19 @@ if (!$sall) {
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key : '');
}
}
// Add GroupBy from hooks
$parameters = array('all' => $all, 'fieldstosearchall' => $fieldstosearchall);
$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
} else {
$sql .= natural_search(array_keys($fieldstosearchall), $sall);
}
// Add HAVING from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql .= !empty($hookmanager->resPrint) ? (' HAVING 1=1 ' . $hookmanager->resPrint) : '';
$sql .= ' ORDER BY ';
$listfield = explode(',', $sortfield);
$listorder = explode(',', $sortorder);
@ -865,6 +878,10 @@ if ($resql) {
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
// Add $param from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
$param .= $hookmanager->resPrint;
$arrayofmassactions = array(
'validate'=>$langs->trans("Validate"),

View File

@ -1510,7 +1510,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Presend form
$modelmail = 'contact';
$defaulttopic = 'Information';
$diroutput = $conf->contact->dir_output;
$diroutput = $conf->societe->dir_output.'/contact/';
$trackid = 'ctc'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2014 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* Copyright (C) 2017 Regis Houssin <regis.houssin@inodbox.com>
/* Copyright (C) 2014 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015-2021 Frederic France <frederic.france@free.fr>
* Copyright (C) 2017 Regis Houssin <regis.houssin@inodbox.com>
*
* 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
@ -107,7 +107,7 @@ if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/contactnameonly/', $c
$title = $object->lastname;
}
$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
llxHeader('', $title, $helpurl);
llxHeader('', $title, $help_url);
if ($object->id) {
$head = contact_prepare_head($object);

View File

@ -9,7 +9,7 @@
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2015-2018 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
@ -2001,7 +2001,8 @@ class Contrat extends CommonObject
$label .= ' '.$this->getLibStatut(5);
}*/
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.($this->ref ? $this->ref : $this->id);
$label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.($this->ref_customer ? $this->ref_customer : $this->ref_client);
$ref_customer = (!empty($this->ref_customer) ? $this->ref_customer : (empty($this->ref_client) ? '' : $this->ref_client));
$label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.$ref_customer;
$label .= '<br><b>'.$langs->trans('RefSupplier').':</b> '.$this->ref_supplier;
if (!empty($this->total_ht)) {
$label .= '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);

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

@ -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

@ -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

@ -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

@ -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

@ -62,7 +62,7 @@ if (!$sortfield) {
if (!$sortorder) {
$sortorder = 'DESC,ASC';
}
$optioncss = GETPOST('optioncss', 'alpha');
$mode = GETPOST('mode', 'aZ09');
//Search criteria
$search_status = (GETPOSTISSET('search_status') ?GETPOST('search_status', 'int') : GETPOST('status', 'int'));
@ -71,7 +71,11 @@ $search_module_name = GETPOST("search_module_name", 'alpha');
$search_lastresult = GETPOST("search_lastresult", "alpha");
$securitykey = GETPOST('securitykey', 'alpha');
$diroutputmassaction = $conf->cronjob->dir_output.'/temp/massgeneration/'.$user->id;
$outputdir = $conf->cron->dir_output;
if (empty($outputdir)) {
$outputdir = $conf->cronjob->dir_output;
}
$diroutputmassaction = $outputdir.'/temp/massgeneration/'.$user->id;
$object = new Cronjob($db);
@ -360,7 +364,7 @@ $arrayofmassactions = array(
'enable'=>$langs->trans("CronStatusActiveBtn"),
'disable'=>$langs->trans("CronStatusInactiveBtn"),
);
if ($user->rights->mymodule->delete) {
if ($user->rights->cron->delete) {
$arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
}
if (in_array($massaction, array('presend', 'predelete'))) {

View File

@ -148,7 +148,10 @@ if (GETPOST('delete', 'alpha')) {
$form = new Form($db);
llxHeader();
$help_url = 'EN:Module_FTP_En|FR:Module_FTP|ES:Módulo_FTP';
llxHeader('', 'FTP', $help_url);
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("FTPClientSetup"), $linkback, 'title_setup');

View File

@ -6,6 +6,7 @@
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2014-2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020-2021 Udo Tamm <dev@dolibit.de>
*
* 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
@ -408,7 +409,7 @@ if (empty($reshook)) {
$verif = $object->validate($user);
// Si pas d'erreur SQL on redirige vers la fiche de la demande
// If no SQL error, we redirect to the request form
if ($verif > 0) {
// To
$destinataire = new User($db);
@ -446,7 +447,7 @@ if (empty($reshook)) {
$nextMonth = dol_time_plus_duree($now, $delayForRequest, 'd');
// Si l'option pour avertir le valideur en cas de délai trop court
// option to warn the validator in case of too short delay
if ($object->getConfCP('AlertValidatorDelay')) {
if ($object->date_debut < $nextMonth) {
$message .= "\n";
@ -454,7 +455,7 @@ if (empty($reshook)) {
}
}
// Si l'option pour avertir le valideur en cas de solde inférieur à la demande
// option to notify the validator if the balance is less than the request
if ($object->getConfCP('AlertValidatorSolde')) {
$nbopenedday = num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday);
if ($nbopenedday > $object->getCPforUser($object->fk_user, $object->fk_type)) {
@ -473,7 +474,7 @@ if (empty($reshook)) {
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 0, '', '', $trackid);
// Envoi du mail
// Sending the email
$result = $mail->sendfile();
if (!$result) {
@ -533,21 +534,21 @@ if (empty($reshook)) {
$error++;
}
// Si pas d'erreur SQL on redirige vers la fiche de la demande
// If no SQL error, we redirect to the request form
if (!$error) {
// Calculcate number of days consummed
$nbopenedday = num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday);
$soldeActuel = $object->getCpforUser($object->fk_user, $object->fk_type);
$newSolde = ($soldeActuel - $nbopenedday);
// On ajoute la modification dans le LOG
// The modification is added to the LOG
$result = $object->addLogCP($user->id, $object->fk_user, $langs->transnoentitiesnoconv("Holidays"), $newSolde, $object->fk_type);
if ($result < 0) {
$error++;
setEventMessages(null, $object->errors, 'errors');
}
//Update balance
// Update balance
$result = $object->updateSoldeCP($object->fk_user, $newSolde, $object->fk_type);
if ($result < 0) {
$error++;
@ -593,7 +594,7 @@ if (empty($reshook)) {
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 0, '', '', $trackid);
// Envoi du mail
// Sending email
$result = $mail->sendfile();
if (!$result) {
@ -619,7 +620,7 @@ if (empty($reshook)) {
if (!empty($_POST['detail_refuse'])) {
$object->fetch($id);
// Si statut en attente de validation et valideur = utilisateur
// If status pending validation and validator = user
if ($object->statut == Holiday::STATUS_VALIDATED && $user->id == $object->fk_validator) {
$object->date_refuse = dol_print_date('dayhour', dol_now());
$object->fk_user_refuse = $user->id;
@ -634,7 +635,7 @@ if (empty($reshook)) {
setEventMessages($object->error, $object->errors, 'errors');
}
// Si pas d'erreur SQL on redirige vers la fiche de la demande
// If no SQL error, we redirect to the request form
if (!$error) {
// To
$destinataire = new User($db);
@ -674,7 +675,7 @@ if (empty($reshook)) {
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 0, '', '', $trackid);
// Envoi du mail
// sending email
$result = $mail->sendfile();
if (!$result) {
@ -703,7 +704,7 @@ if (empty($reshook)) {
}
// Si Validation de la demande
// If the request is validated
if ($action == 'confirm_draft' && GETPOST('confirm') == 'yes') {
$error = 0;
@ -728,13 +729,13 @@ if (empty($reshook)) {
}
}
// Si confirmation of cancellation
// If confirmation of cancellation
if ($action == 'confirm_cancel' && GETPOST('confirm') == 'yes') {
$error = 0;
$object->fetch($id);
// Si statut en attente de validation et valideur = valideur ou utilisateur, ou droits de faire pour les autres
// If status pending validation and validator = validator or user, or rights to do for others
if (($object->statut == Holiday::STATUS_VALIDATED || $object->statut == Holiday::STATUS_APPROVED) && ($user->id == $object->fk_validator || in_array($object->fk_user, $childids)
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->holiday->writeall_advance)))) {
$db->begin();
@ -753,10 +754,10 @@ if (empty($reshook)) {
$soldeActuel = $object->getCpforUser($object->fk_user, $object->fk_type);
$newSolde = ($soldeActuel + $nbopenedday);
// On ajoute la modification dans le LOG
// The modification is added to the LOG
$result1 = $object->addLogCP($user->id, $object->fk_user, $langs->transnoentitiesnoconv("HolidaysCancelation"), $newSolde, $object->fk_type);
// Mise à jour du solde
// Update of the balance
$result2 = $object->updateSoldeCP($object->fk_user, $newSolde, $object->fk_type);
if ($result1 < 0 || $result2 < 0) {
@ -771,7 +772,7 @@ if (empty($reshook)) {
$db->rollback();
}
// Si pas d'erreur SQL on redirige vers la fiche de la demande
// If no SQL error, we redirect to the request form
if (!$error && $result > 0) {
// To
$destinataire = new User($db);
@ -811,7 +812,7 @@ if (empty($reshook)) {
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 0, '', '', $trackid);
// Envoi du mail
// sending email
$result = $mail->sendfile();
if (!$result) {
@ -853,7 +854,9 @@ $object = new Holiday($db);
$listhalfday = array('morning'=>$langs->trans("Morning"), "afternoon"=>$langs->trans("Afternoon"));
llxHeader('', $langs->trans('CPTitreMenu'));
$help_url = 'EN:Module_Holiday';
llxHeader('', $langs->trans('CPTitreMenu'), $help_url);
if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
// If user has no permission to create a leave

View File

@ -30,13 +30,13 @@
-- Do not concatenate the values in a single query, for the same reason.
--
-- Departements/Cantons/Provinces
-- Departements/Cantons/Provinces/States
--
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values ( 0, '0', '0',0,'-','-');
-- Andorra Provinces (rowid country=34)
-- Andorra Parròquies (id country=34)
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-002', 'AD100', NULL, NULL, 'Canillo');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-003', 'AD200', NULL, NULL, 'Encamp');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-004', 'AD400', NULL, NULL, 'La Massana');
@ -45,6 +45,19 @@ INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-007', 'AD500', NULL, NULL, 'Andorra la Vella');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-008', 'AD700', NULL, NULL, 'Escaldes-Engordany');
-- Austria States (Bundesländer) (id country=41)
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'B','BURGENLAND','Burgenland',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'K','KAERNTEN','Kärnten',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'N','NIEDEROESTERREICH','Niederösterreich',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'O','OBEROESTERREICH','Oberösterreich',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'S','SALZBURG','Salzburg',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'ST','STEIERMARK','Steiermark',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'T','TIROL','Tirol',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'V','VORARLBERG','Vorarlberg',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'W','WIEN','Wien',1);
-- Departements France (id country=1)
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values ( 1,'971','97105',3,'GUADELOUPE','Guadeloupe');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values ( 2,'972','97209',3,'MARTINIQUE','Martinique');
@ -149,16 +162,6 @@ insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,no
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (11,'94','94028',2,'VAL-DE-MARNE','Val-de-Marne');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (11,'95','95500',2,'VAL-D OISE','Val-d Oise');
-- Provinces Austria (id country=41)
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'B','BURGENLAND','Burgenland',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'K','KAERNTEN','Kärnten',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'N','NIEDEROESTERREICH','Niederösterreich',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'O','OBEROESTERREICH','Oberösterreich',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'S','SALZBURG','Salzburg',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'ST','STEIERMARK','Steiermark',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'T','TIROL','Tirol',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'V','VORARLBERG','Vorarlberg',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'W','WIEN','Wien',1);
-- Provinces Belgium (id country=2)
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (201,'01','',1,'ANVERS','Anvers');

View File

@ -389,7 +389,7 @@ AmountTotal=Total amount
AmountAverage=Average amount
PriceQtyMinHT=Price quantity min. (excl. tax)
PriceQtyMinHTCurrency=Price quantity min. (excl. tax) (currency)
PercentOfOriginalObject=Percent of original object
PercentOfOriginalObject=Percent of original object
AmountOrPercent=Amount or percent
Percentage=Percentage
Total=Total
@ -1017,6 +1017,7 @@ SearchIntoContacts=Contacts
SearchIntoMembers=Members
SearchIntoUsers=Users
SearchIntoProductsOrServices=Products or services
SearchIntoBatch=Lots / Serials
SearchIntoProjects=Projects
SearchIntoMO=Manufacturing Orders
SearchIntoTasks=Tasks

View File

@ -548,7 +548,7 @@ None=Aucun
NoneF=Aucune
NoneOrSeveral=Aucun ou plusieurs
Late=Retard
LateDesc=Le délai qui définit si un enregistrement est en retard ou non dépend de votre configuration. Demandez à votre administrateur pour changer ce délai depuis Accueil - Configuration - Alertes
LateDesc=Le délai qui définit si un enregistrement est en retard ou non dépend de votre configuration. Demandez à votre administrateur pour changer ce délai depuis Accueil - Configuration - Alertes
NoItemLate=Aucun élément en retard
Photo=Photo
Photos=Photos
@ -1013,6 +1013,7 @@ SearchIntoContacts=Contacts
SearchIntoMembers=Adhérents
SearchIntoUsers=Utilisateurs
SearchIntoProductsOrServices=Produits ou services
SearchIntoBatch=Lots / N° de série
SearchIntoProjects=Projets
SearchIntoMO=Ordres de fabrication
SearchIntoTasks=Tâches

View File

@ -1197,6 +1197,7 @@ if ($resql) {
$i = 0;
$totalarray = array();
$totalarray['nbfield'] = 0;
while ($i < min($num, $limit)) {
$obj = $db->fetch_object($resql);

View File

@ -65,7 +65,7 @@ $includeuserlist = array();
llxHeader('', $langs->trans('Projects'));
$title = $langs->trans("ProjectsStatistics");
$dir = $conf->projet->dir_output.'/temp';
$dir = $conf->project->dir_output.'/temp';
print load_fiche_titre($title, '', 'project');
@ -224,7 +224,8 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
$mesg = $px3->isGraphKo();
if (!$mesg) {
$px3->SetData($data);
$i = $startyear; $legend = array();
$i = $startyear;
$legend = array();
while ($i <= $endyear) {
$legend[] = $i;
$i++;
@ -268,7 +269,7 @@ $head[$h][1] = $langs->trans("ByMonthYear");
$head[$h][2] = 'byyear';
$h++;
complete_head_from_modules($conf, $langs, null, $head, $h, $type);
complete_head_from_modules($conf, $langs, null, $head, $h, 'project_stats');
print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1, '');
@ -337,9 +338,9 @@ foreach ($data_all_year as $val) {
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.($socid > 0 ? '&socid='.$socid : '').($userid > 0 ? '&userid='.$userid : '').'">'.$year.'</a></td>';
print '<td class="right">'.$val['nb'].'</td>';
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
print '<td class="right">'.($val['total'] ?price(price2num($val['total'], 'MT'), 1) : '0').'</td>';
print '<td class="right">'.($val['avg'] ?price(price2num($val['avg'], 'MT'), 1) : '0').'</td>';
print '<td class="right">'.($val['weighted'] ?price(price2num($val['weighted'], 'MT'), 1) : '0').'</td>';
print '<td class="right">'.($val['total'] ? price(price2num($val['total'], 'MT'), 1) : '0').'</td>';
print '<td class="right">'.($val['avg'] ? price(price2num($val['avg'], 'MT'), 1) : '0').'</td>';
print '<td class="right">'.(isset($val['weighted']) ? price(price2num($val['weighted'], 'MT'), 1) : '0').'</td>';
}
print '</tr>';
$oldyear = $year;
@ -350,7 +351,7 @@ print '</div>';
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
$stringtoshow .= '<table class="border centpercent"><tr class="pair nohover"><td class="center">';
$stringtoshow = '<table class="border centpercent"><tr class="pair nohover"><td class="center">';
if ($mesg) {
print $mesg;
} else {

View File

@ -65,7 +65,7 @@ $includeuserlist = array();
llxHeader('', $langs->trans('Tasks'));
$title = $langs->trans("TasksStatistics");
$dir = $conf->projet->dir_output.'/temp';
$dir = $conf->project->dir_output.'/temp';
print load_fiche_titre($title, '', 'projecttask');
@ -134,12 +134,12 @@ if (!count($arrayyears)) {
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/stats/index.php?mode='.$mode;
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/stats/index.php';
$head[$h][1] = $langs->trans("ByMonthYear");
$head[$h][2] = 'byyear';
$h++;
complete_head_from_modules($conf, $langs, null, $head, $h, $type);
complete_head_from_modules($conf, $langs, null, $head, $h, 'project_tasks_stats');
print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1, '');
@ -191,13 +191,13 @@ foreach ($data_all_year as $val) {
$oldyear--;
print '<tr class="oddeven" height="24">';
print '<td><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&amp;mode='.$mode.($socid > 0 ? '&socid='.$socid : '').($userid > 0 ? '&userid='.$userid : '').'">'.$oldyear.'</a></td>';
print '<td><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.($socid > 0 ? '&socid='.$socid : '').($userid > 0 ? '&userid='.$userid : '').'">'.$oldyear.'</a></td>';
print '<td class="right">0</td>';
print '</tr>';
}
print '<tr class="oddeven" height="24">';
print '<td><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&amp;mode='.$mode.($socid > 0 ? '&socid='.$socid : '').($userid > 0 ? '&userid='.$userid : '').'">'.$year.'</a></td>';
print '<td><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.($socid > 0 ? '&socid='.$socid : '').($userid > 0 ? '&userid='.$userid : '').'">'.$year.'</a></td>';
print '<td class="right">'.$val['nb'].'</td>';
print '</tr>';
$oldyear = $year;
@ -208,7 +208,7 @@ print '</div>';
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
$stringtoshow .= '<table class="border centpercent"><tr class="pair nohover"><td class="center">';
$stringtoshow = '<table class="border centpercent"><tr class="pair nohover"><td class="center">';
if ($mesg) {
print $mesg;
} else {

View File

@ -493,6 +493,7 @@ class Dolresource extends CommonObject
$sql .= " t.entity,";
$sql .= " t.ref,";
$sql .= " t.description,";
$sql .= " t.fk_country,";
$sql .= " t.fk_code_type_resource,";
$sql .= " t.tms,";
// Add fields from extrafields