diff --git a/ChangeLog b/ChangeLog
index 70ae8ff8b5c..06f749cbc34 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -112,6 +112,7 @@ NEW: When you create product or service, sell accountancy account by default is
NEW: Widget birthdays of the month.
NEW: Option in workflow module to set a reception billed on validate supplier bill.
NEW: Autocompletion on lists should be available on mobile applications.
+NEW: Add mass action to close several members.
For Developers:
NEW: Module "DebugBar" is available as a stable module.
@@ -121,7 +122,7 @@ NEW: Add constant XFRAMEOPTIONS_ALLOWALL
NEW: Add function isValidVATID()
NEW: ADD document's product support in APIs
NEW: REST API: get the list of objects in a category.
-NEW: Update Stripe library to 6.34.3
+NEW: Update Stripe library to 6.35
NEW: Upgrade jquery lib to 3.3.1
NEW: Add hook 'addHtmlHeader()'
NEW: Add hook 'createRecurringInvoices()'
@@ -174,6 +175,7 @@ Following changes may create regressions for some external modules, but were nec
* Removed deprecated use of string in dol_print_date(). Only date allowed.
* Deprecated property ->fk_departement is now ->state_id everywhere.
* Removed the method 4 of GETPOST (to get $_COOKIE). It was not used and not recommanded to use in Dolibarr.
+* Column llx_facture.facnumber change to llx_facture.ref
***** ChangeLog for 9.0.3 compared to 9.0.2 *****
diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php
index 9d4f4b68370..f007d4f8299 100644
--- a/htdocs/accountancy/admin/account.php
+++ b/htdocs/accountancy/admin/account.php
@@ -247,11 +247,10 @@ if ($resql)
print ' ';
print ' ';
- $newcardbutton = '' . $langs->trans("Addanaccount").' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($langs->trans("New"), $langs->trans("Addanaccount"), 'fa fa-plus-circle', './card.php?action=create');
- print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit);
+
+ print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit);
// Box to select active chart of account
print $langs->trans("Selectchartofaccounts") . " : ";
diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php
index df2dec9d3b1..725dddf1339 100644
--- a/htdocs/accountancy/admin/fiscalyear.php
+++ b/htdocs/accountancy/admin/fiscalyear.php
@@ -111,14 +111,9 @@ if ($result)
$i = 0;
- if (! empty($user->rights->accounting->fiscalyear))
- {
- $addbutton = '' . $langs->trans("NewFiscalYear") .' ';
- }
- else
- {
- $addbutton = '' . $langs->trans("NewFiscalYear") .' ';
- }
+
+ $addbutton.= dolGetButtonTitle($langs->trans('NewFiscalYear'), '', 'fa fa-plus-circle', 'fiscalyear_card.php?action=create', '', $user->rights->accounting->fiscalyear);
+
$title = $langs->trans('AccountingPeriods');
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $addbutton, '', $limit, 1);
diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php
index 207ea3464d8..073d180cd16 100644
--- a/htdocs/accountancy/bookkeeping/list.php
+++ b/htdocs/accountancy/bookkeeping/list.php
@@ -443,19 +443,18 @@ print ' ';
print ' ';
$listofformat=AccountancyExport::getType();
-$button = '';
-if (count($filter)) $button.= $langs->trans("ExportFilteredList");
-else $button.= $langs->trans("ExportList");
-//$button.=' ('.$listofformat[$conf->global->ACCOUNTING_EXPORT_MODELCSV].')';
-$button.= ' ';
+
+if (count($filter)) $buttonLabel = $langs->trans("ExportFilteredList");
+else $buttonLabel = $langs->trans("ExportList");
+
+$newcardbutton = dolGetButtonTitle($buttonLabel, '', 'fa fa-file-export', $_SERVER["PHP_SELF"].'?action=export_file'.($param?'&'.$param:''));
+
+$newcardbutton.= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-object-group', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param);
+
+$newcardbutton.= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle', './card.php?action=create');
-$groupby = ' ' . $langs->trans("GroupByAccountAccounting") . ' ';
-$newcardbutton = ''.$langs->trans("NewAccountingMvt").' ';
-$newcardbutton.= ' ';
-$newcardbutton.= ' ';
-
-print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, $groupby.$newcardbutton, '', $limit);
+print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit);
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php
index 38dc49c5bf6..a2cf4864df8 100644
--- a/htdocs/accountancy/bookkeeping/listbyaccount.php
+++ b/htdocs/accountancy/bookkeeping/listbyaccount.php
@@ -256,10 +256,8 @@ if ($action == 'delbookkeepingyear') {
print '
';
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 38a38d45b12..d2012870a31 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -1685,7 +1685,7 @@ class Commande extends CommonOrder
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as cr ON c.fk_cond_reglement = cr.rowid';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON c.fk_mode_reglement = p.id';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_availability as ca ON c.fk_availability = ca.rowid';
- $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_input_reason as dr ON c.fk_input_reason = ca.rowid';
+ $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_input_reason as dr ON c.fk_input_reason = dr.rowid';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid';
if ($id) $sql.= " WHERE c.rowid=".$id;
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index ad3fd777a5c..f64aadf0e53 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -443,10 +443,8 @@ if ($resql)
$newcardbutton='';
if ($contextpage == 'orderlist' && $user->rights->commande->creer)
{
- $newcardbutton=''.$langs->trans('NewOrder').' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
- }
+ $newcardbutton.= dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/commande/card.php?action=create');
+ }
// Lines of title fields
print ' ';
diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php
index c8c3576f496..68c0ada46df 100644
--- a/htdocs/compta/bank/bankentries_list.php
+++ b/htdocs/compta/bank/bankentries_list.php
@@ -756,34 +756,16 @@ if ($resql)
{
if (empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) // If direct entries is done using miscellaneous payments
{
- if ($user->rights->banque->modifier) {
- $newcardbutton = ''.$langs->trans("AddBankRecord").' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
- } else {
- $newcardbutton = ''.$langs->trans("AddBankRecord").' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
- }
+ $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&accountid='.$search_account.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.urlencode($search_account)), '', $user->rights->banque->modifier);
}
- else // If direct entries is not done using miscellaneous payments
+ else // If direct entries is not done using miscellaneous payments
{
- if ($user->rights->banque->modifier) {
- $newcardbutton = ''.$langs->trans("AddBankRecord").' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
- } else {
- $newcardbutton = ''.$langs->trans("AddBankRecord").' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
- }
+ $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', $user->rights->banque->modifier);
}
}
else
{
- $newcardbutton = ''.$langs->trans("AddBankRecord").' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', -1);
}
}
diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php
index 080cef69778..aeb593f53b9 100644
--- a/htdocs/compta/bank/list.php
+++ b/htdocs/compta/bank/list.php
@@ -227,9 +227,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
$newcardbutton='';
if ($user->rights->banque->configurer)
{
- $newcardbutton.=''.$langs->trans("NewFinancialAccount").' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($langs->trans('NewFinancialAccount'), '', 'fa fa-plus-circle', 'card.php?action=create');
}
diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php
index 017d4e22569..9036b513961 100644
--- a/htdocs/compta/facture/class/api_invoices.class.php
+++ b/htdocs/compta/facture/class/api_invoices.class.php
@@ -73,10 +73,10 @@ class Invoices extends DolibarrApi
}
// Get payment details
- $this->invoice->totalpaye = $this->invoice->getSommePaiement();
+ $this->invoice->totalpaid = $this->invoice->getSommePaiement();
$this->invoice->totalcreditnotes = $this->invoice->getSumCreditNotesUsed();
$this->invoice->totaldeposits = $this->invoice->getSumDepositsUsed();
- $this->invoice->resteapayer = price2num($this->invoice->total_ttc - $this->invoice->totalpaye - $this->invoice->totalcreditnotes - $this->invoice->totaldeposits, 'MT');
+ $this->invoice->remaintopay = price2num($this->invoice->total_ttc - $this->invoice->totalpaid - $this->invoice->totalcreditnotes - $this->invoice->totaldeposits, 'MT');
if (! DolibarrApi::_checkAccessToResource('facture', $this->invoice->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 05ce6cc3504..d12fc90fd77 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -607,9 +607,7 @@ if ($resql)
$newcardbutton='';
if($user->rights->facture->creer)
{
- $newcardbutton=''.$langs->trans('NewBill').' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/facture/card.php?action=create');
}
$i = 0;
diff --git a/htdocs/compta/localtax/list.php b/htdocs/compta/localtax/list.php
index 184c9600926..b7f9c307f14 100644
--- a/htdocs/compta/localtax/list.php
+++ b/htdocs/compta/localtax/list.php
@@ -45,9 +45,7 @@ $localtax_static = new Localtax($db);
$newcardbutton='';
if ($user->rights->tax->charges->creer)
{
- $newcardbutton=''.$langs->trans('NewLocalTaxPayment', ($ltt+1)).' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($langs->trans('NewLocalTaxPayment', ($ltt+1)), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/localtax/card.php?action=create&localTaxType='.$ltt);
}
print load_fiche_titre($langs->transcountry($ltt==2?"LT2Payments":"LT1Payments", $mysoc->country_code), $newcardbutton);
diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php
index 0107ba60383..401d12aec4b 100644
--- a/htdocs/compta/paiement/cheque/list.php
+++ b/htdocs/compta/paiement/cheque/list.php
@@ -138,9 +138,7 @@ if ($resql)
$newcardbutton='';
if ($user->rights->banque->cheque)
{
- $newcardbutton = ''.$langs->trans('NewCheckDeposit').' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($langs->trans('NewCheckDeposit'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/paiement/cheque/card.php?action=new');
}
print ' ';
diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php
index 49f44af1702..9fcb77d9b42 100644
--- a/htdocs/compta/prelevement/bons.php
+++ b/htdocs/compta/prelevement/bons.php
@@ -108,9 +108,7 @@ if ($result)
$newcardbutton='';
if ($user->rights->prelevement->bons->creer)
{
- $newcardbutton = ''.$langs->trans('NewStandingOrder').' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($langs->trans('NewStandingOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php');
}
// Lines of title fields
diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php
index 061008f42a8..1d6b08735a0 100644
--- a/htdocs/compta/tva/list.php
+++ b/htdocs/compta/tva/list.php
@@ -150,10 +150,8 @@ if ($result)
$newcardbutton='';
if ($user->rights->tax->charges->creer)
{
- $newcardbutton=''.$langs->trans('NewVATPayment').' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
- }
+ $newcardbutton.= dolGetButtonTitle($langs->trans('NewVATPayment', ($ltt+1)), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/tva/card.php?action=create');
+ }
print ' ';
if ($optioncss != '') print ' ';
diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php
index 5b9e84f2d16..6e093a934dd 100644
--- a/htdocs/contact/agenda.php
+++ b/htdocs/contact/agenda.php
@@ -261,9 +261,7 @@ else
{
if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create))
{
- $newcardbutton.=''.$langs->trans("AddAction").' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
}
}
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index d350c8b3ff3..dfefb8060fe 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -698,9 +698,9 @@ class Contact extends CommonObject
$langs->load("dict");
- dol_syslog(get_class($this)."::fetch id=".$id, LOG_DEBUG);
+ dol_syslog(get_class($this) . "::fetch id=" . $id . " ref_ext=" . $ref_ext . " email=" . $email, LOG_DEBUG);
- if (empty($id) && empty($ref_ext))
+ if (empty($id) && empty($ref_ext) && empty($email))
{
$this->error='BadParameter';
return -1;
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index febc613434d..6749ac0a7f5 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -455,9 +455,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
$newcardbutton='';
if ($user->rights->societe->contact->creer)
{
- $newcardbutton=''.$langs->trans('NewContactAddress').' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($langs->trans('NewContactAddress'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?action=create');
}
print ' ';
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index 36c527ef283..28c4702a5c2 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -376,9 +376,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
$newcardbutton='';
if ($user->rights->contrat->creer)
{
- $newcardbutton=''.$langs->trans('NewContractSubscription').' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($langs->trans('NewContractSubscription'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contrat/card.php?action=create');
}
print ' ';
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index c86874cdde9..e7d8742a3f5 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -103,7 +103,7 @@ class Form
* @return string HTML edit field
*/
public function editfieldkey($text, $htmlname, $preselected, $object, $perm, $typeofdata = 'string', $moreparam = '', $fieldrequired = 0, $notabletag = 0, $paramid = 'id')
- {
+ {
global $conf,$langs;
$ret='';
@@ -144,7 +144,7 @@ class Form
}
return $ret;
- }
+ }
/**
* Output value of a field for an editable field
diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php
index c9c1bc3d782..31353ea3d10 100644
--- a/htdocs/core/class/html.formactions.class.php
+++ b/htdocs/core/class/html.formactions.class.php
@@ -205,9 +205,7 @@ class FormActions
$newcardbutton='';
if (! empty($conf->agenda->enabled))
{
- $newcardbutton = ''.$langs->trans("AddEvent").' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(), 'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.($object->socid>0?'&socid='.$object->socid:($socid>0?'&socid='.$socid:'')).($projectid>0?'&projectid='.$projectid:'').'&backtopage='.urlencode($urlbacktopage));
}
print ''."\n";
diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php
index f022d2c3791..f9b0a59280f 100644
--- a/htdocs/core/class/html.formmargin.class.php
+++ b/htdocs/core/class/html.formmargin.class.php
@@ -96,7 +96,7 @@ class FormMargin
$line->pa_ht = $line->subprice * (1 - ($line->remise_percent / 100));
}
- $pv = $line->qty * $line->subprice * (1 - $line->remise_percent / 100);
+ $pv = $line->total_ht;
$pa_ht = ($pv < 0 ? - $line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign
$pa = $line->qty * $pa_ht;
diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php
index 243e943143e..6635220cc23 100644
--- a/htdocs/core/lib/admin.lib.php
+++ b/htdocs/core/lib/admin.lib.php
@@ -1044,9 +1044,9 @@ function unActivateModule($value, $requiredby = 1)
$result=$objMod->remove();
if ($result <= 0) $ret=$objMod->error;
}
- else
+ else // We come here when we try to unactivate a module when module does not exists anymore in sources
{
- //print $dir.$modFile;
+ //print $dir.$modFile;exit;
// TODO Replace this after DolibarrModules is moved as abstract class with a try catch to show module we try to disable has not been found or could not be loaded
include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
$genericMod = new DolibarrModules($db);
@@ -1054,11 +1054,11 @@ function unActivateModule($value, $requiredby = 1)
$genericMod->rights_class=strtolower(preg_replace('/^mod/i', '', $modName));
$genericMod->const_name='MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', $modName));
dol_syslog("modules::unActivateModule Failed to find module file, we use generic function with name " . $modName);
- $genericMod->_remove(array());
+ $genericMod->remove('');
}
- // Desactivation des modules qui dependent de lui
- if (! $ret && $requiredby)
+ // Disable modules that depends on module we disable
+ if (! $ret && $requiredby && is_object($objMod) && is_array($objMod->requiredby))
{
$countrb=count($objMod->requiredby);
for ($i = 0; $i < $countrb; $i++)
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index d6fe993aa2d..e080cc89796 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -730,9 +730,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel
$newcardbutton='';
if (! empty($conf->projet->enabled) && $user->rights->projet->creer && empty($nocreatelink))
{
- $newcardbutton=''.$langs->trans("AddProject").' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage));
}
print "\n";
@@ -934,9 +932,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
if ($user->rights->societe->contact->creer)
{
$addcontact = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
- $newcardbutton=''.$addcontact.' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($addcontact, '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage));
}
print "\n";
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 9b8232bb188..f6e530ba8de 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -8017,6 +8017,8 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
{
global $conf;
+ $return = '';
+
// image's filename are still in French
$statusImg=array(
'status0' => 'statut0'
@@ -8153,3 +8155,117 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
return '<'.$tag.' '.$compiledAttributes.'>'.$html.''.$tag.'>
';
}
+
+
+
+/**
+ * Function dolGetButtonTitle : this kind of buttons are used in title in list
+ *
+ * @param string $label label of button
+ * @param string $helpText optional : content for help tooltip
+ * @param string $iconClass class for icon element
+ * @param string $url the url for link
+ * @param string $id attribute id of button
+ * @param int $status 0 no user rights, 1 active, -1 Feature Disabled, -2 disable Other reason use helpText as tooltip
+ * @param array $params various params for future : recommended rather than adding more function arguments
+ * @return string html button
+ */
+function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $url = '', $id = '', $status = 1, $params = array())
+{
+ global $langs, $conf, $user;
+
+ // Actually this conf is used in css too for external module compatibility and smooth transition to this function
+ if (! empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) && (! $user->admin) && $status <= 0) {
+ return '';
+ }
+
+ $class = 'btnTitle' ;
+
+ // hidden conf keep during button transition TODO: remove this block
+ if(empty($conf->global->MAIN_USE_NEW_TITLE_BUTTON)){
+ $class = 'butActionNew';
+ }
+
+ $attr=array(
+ 'class' => $class
+ ,'href' => empty($url)?'':$url
+ );
+
+ if(!empty($helpText)){
+ $attr['title'] = dol_escape_htmltag($helpText);
+ }
+
+ if($status <= 0){
+ $attr['class'] .= ' refused';
+
+ // hidden conf keep during button transition TODO: remove this block
+ if(empty($conf->global->MAIN_USE_NEW_TITLE_BUTTON)){
+ $attr['class'] = 'butActionNewRefused';
+ }
+
+ $attr['href'] = '';
+
+ if($status == -1){ // Not enough permissions
+ $attr['title'] = dol_escape_htmltag($langs->transnoentitiesnoconv("FeatureDisabled"));
+ }
+ elseif($status == 0){ // disable
+ $attr['title'] = dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions"));
+ }
+ }
+
+ if(!empty($attr['title'])){
+ $attr['class'] .= ' classfortooltip';
+ }
+
+ if(empty($id)){
+ $attr['id'] = $id;
+ }
+
+ // Override attr
+ if(!empty($params['attr']) && is_array($params['attr'])){
+ foreach($params['attr'] as $key => $value){
+ if($key == 'class'){
+ $attr['class'].= ' '.$value;
+ }
+ elseif($key == 'classOverride'){
+ $attr['class'] = $value;
+ }
+ else{
+ $attr[$key] = $value;
+ }
+ }
+ }
+
+ if(isset($attr['href']) && empty($attr['href'])){
+ unset($attr['href']);
+ }
+
+ // TODO : add a hook
+
+ // escape all attribute
+ $attr = array_map('dol_escape_htmltag', $attr);
+
+ $TCompiledAttr = array();
+ foreach($attr as $key => $value){
+ $TCompiledAttr[] = $key.'="'.$value.'"';
+ }
+
+ $compiledAttributes = !empty($TCompiledAttr)?implode(' ', $TCompiledAttr):'';
+
+ $tag = !empty($attr['href'])?'a':'span';
+
+
+ $button ='<'.$tag.' '.$compiledAttributes.' >';
+ $button.= ' ';
+ $button.= ''.$label.' ';
+ $button.= ''.$tag.'>';
+
+ // hidden conf keep during button transition TODO: remove this block
+ if(empty($conf->global->MAIN_USE_NEW_TITLE_BUTTON)){
+ $button='<'.$tag.' '.$compiledAttributes.' >'.$label.' ';
+ $button.= ' ';
+ $button.= ''.$tag.'>';
+ }
+
+ return $button;
+}
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index cc40fcb9272..14c0435b4ad 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -1374,6 +1374,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
if (! empty($object->lines[$i]->date_start) || ! empty($object->lines[$i]->date_end))
{
$format='day';
+ $period = '';
// Show duration if exists
if ($object->lines[$i]->date_start && $object->lines[$i]->date_end)
{
diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php
index 4ce610aaf90..7da112fa255 100644
--- a/htdocs/core/lib/usergroups.lib.php
+++ b/htdocs/core/lib/usergroups.lib.php
@@ -145,8 +145,8 @@ function user_prepare_head($object)
if ((! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
|| (! empty($conf->hrm->enabled) && ! empty($user->rights->hrm->employee->read))
- || (! empty($conf->expensereport->enabled) && ! empty($user->rights->expensereport->lire) && $user->id == $object->id)
- || (! empty($conf->holiday->enabled) && ! empty($user->rights->holiday->read) && $user->id == $object->id )
+ || (! empty($conf->expensereport->enabled) && ! empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall))
+ || (! empty($conf->holiday->enabled) && ! empty($user->rights->holiday->read) && ($user->id == $object->id || $user->rights->holiday->read_all))
)
{
// Bank
diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php
index 1fc25035933..c7158413e24 100644
--- a/htdocs/core/modules/DolibarrModules.class.php
+++ b/htdocs/core/modules/DolibarrModules.class.php
@@ -667,7 +667,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
array(
'doc/' => dol_buildpath(strtolower($this->name).'/doc/', 1),
'img/' => dol_buildpath(strtolower($this->name).'/img/', 1),
- 'images/' => dol_buildpath(strtolower($this->name).'/imgages/', 1),
+ 'images/' => dol_buildpath(strtolower($this->name).'/images/', 1),
)
);
}
@@ -746,7 +746,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
$filefound= false;
// Define path to file README.md.
- // First check README-la_LA.md then README.md
+ // First check ChangeLog-la_LA.md then ChangeLog.md
$pathoffile = dol_buildpath(strtolower($this->name).'/ChangeLog-'.$langs->defaultlang.'.md', 0);
if (dol_is_file($pathoffile)) {
$filefound = true;
diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php
index 10a2ce752d8..dfbe97c3fd5 100644
--- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php
+++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php
@@ -301,7 +301,7 @@ class pdf_beluga extends ModelePDFProjects
'table'=>'commande',
'datefieldname'=>'date_commande',
'test'=>$conf->commande->enabled && $user->rights->commande->lire,
- 'lang'=>'order'),
+ 'lang'=>'orders'),
'invoice'=>array(
'name'=>"CustomersInvoices",
'title'=>"ListInvoicesAssociatedProject",
diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php
index cf71d691715..612595b8c44 100644
--- a/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php
+++ b/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php
@@ -1810,7 +1810,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders
global $hookmanager;
$parameters=array(
- 'object' => $object,
'curY' =>& $curY,
'columnText' => $columnText,
'colKey' => $colKey
diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php
index de321443a6c..6bfa0c025af 100644
--- a/htdocs/cron/list.php
+++ b/htdocs/cron/list.php
@@ -342,18 +342,8 @@ print ' ';
// Line with explanation and button new job
$newcardbutton='';
-if ($user->rights->cron->create)
-{
- $newcardbutton.=''.$langs->trans("CronCreateJob").' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
-}
-else
-{
- $newcardbutton.=''.$langs->trans("CronCreateJob").' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
-}
+$newcardbutton.= dolGetButtonTitle($langs->trans('New'), $langs->trans('CronCreateJob'), 'fa fa-plus-circle', DOL_URL_ROOT.'/societe/card.php?action=create'.$typefilter, '', $user->rights->cron->create);
+
print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_setup', 0, $newcardbutton, '', $limit);
diff --git a/htdocs/debugbar/class/DebugBar.php b/htdocs/debugbar/class/DebugBar.php
index d36583d9852..8882b5f4f1e 100644
--- a/htdocs/debugbar/class/DebugBar.php
+++ b/htdocs/debugbar/class/DebugBar.php
@@ -33,7 +33,7 @@ class DolibarrDebugBar extends DebugBar
//$this->addCollector(new PhpInfoCollector());
//$this->addCollector(new DolMessagesCollector());
$this->addCollector(new DolRequestDataCollector());
- $this->addCollector(new DolConfigCollector());
+ //$this->addCollector(new DolConfigCollector()); // Disabled for security purpose
$this->addCollector(new DolTimeDataCollector());
$this->addCollector(new DolMemoryCollector());
//$this->addCollector(new DolExceptionsCollector());
diff --git a/htdocs/don/list.php b/htdocs/don/list.php
index e68b4e46399..f5cf23bceb7 100644
--- a/htdocs/don/list.php
+++ b/htdocs/don/list.php
@@ -142,9 +142,7 @@ if ($resql)
$newcardbutton='';
if ($user->rights->don->creer)
{
- $newcardbutton=''.$langs->trans('NewDonation').' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($langs->trans('NewDonation'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/don/card.php?action=create');
}
print ' '."\n";
diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php
index e52b1bf156e..f60051df970 100644
--- a/htdocs/emailcollector/class/emailcollector.class.php
+++ b/htdocs/emailcollector/class/emailcollector.class.php
@@ -1287,13 +1287,14 @@ class EmailCollector extends CommonObject
if (empty($contactid)) // Try to find contact using email
{
$result = $contactstatic->fetch(0, null, '', $from);
+
if ($result > 0)
{
$contactid = $contactstatic->id;
$contactfoundby = 'email of contact ('.$from.')';
- if ($contactstatic->fk_soc > 0)
+ if ($contactstatic->socid > 0)
{
- $result = $thirdpartystatic->fetch($contactstatic->fk_soc);
+ $result = $thirdpartystatic->fetch($contactstatic->socid);
if ($result > 0)
{
$thirdpartyid = $thirdpartystatic->id;
@@ -1309,7 +1310,6 @@ class EmailCollector extends CommonObject
if ($result > 0) $thirdpartyfoundby = 'email ('.$from.')';
}
-
// Do operations
foreach($this->actions as $operation)
{
@@ -1492,7 +1492,6 @@ class EmailCollector extends CommonObject
// Insert record of emails sent
$actioncomm = new ActionComm($this->db);
-
$actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
$actioncomm->code = 'AC_'.$actioncode;
$actioncomm->label = $langs->trans("ActionAC_".$actioncode).' - '.$langs->trans("MailFrom").' '.$from;
@@ -1503,6 +1502,7 @@ class EmailCollector extends CommonObject
$actioncomm->percentage = -1; // Not applicable
$actioncomm->socid = $thirdpartystatic->id;
$actioncomm->contactid = $contactstatic->id;
+ $actioncomm->socpeopleassigned = (!empty($contactstatic->id) ? array($contactstatic->id => '') : array());
$actioncomm->authorid = $user->id; // User saving action
$actioncomm->userownerid = $user->id; // Owner of action
// Fields when action is an email (content should be added into note)
diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php
index b60852f205b..f5c111f2268 100644
--- a/htdocs/expedition/list.php
+++ b/htdocs/expedition/list.php
@@ -280,10 +280,8 @@ if ($resql)
$newcardbutton='';
if ($user->rights->expedition->creer)
{
- $newcardbutton=''.$langs->trans('NewSending').' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
- }
+ $newcardbutton.= dolGetButtonTitle($langs->trans('NewSending'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/expedition/card.php?action=create2');
+ }
$i = 0;
print ' '."\n";
diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php
index 520972a23e6..94033912a69 100644
--- a/htdocs/expensereport/list.php
+++ b/htdocs/expensereport/list.php
@@ -456,9 +456,7 @@ if ($resql)
$newcardbutton='';
if ($user->rights->expensereport->creer)
{
- $newcardbutton=''.$langs->trans('NewTrip').' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($langs->trans('NewTrip'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/expensereport/card.php?action=create');
}
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic.png', 0, $newcardbutton, '', $limit);
diff --git a/htdocs/exports/index.php b/htdocs/exports/index.php
index 83208ffa020..755c9bc4773 100644
--- a/htdocs/exports/index.php
+++ b/htdocs/exports/index.php
@@ -50,14 +50,7 @@ print ' ';
print '';
if (count($export->array_export_code))
{
- if ($user->rights->export->creer)
- {
- print '
'.$langs->trans("NewExport").' ';
- }
- else
- {
- print '
'.$langs->trans("NewExport").' ';
- }
+ print dolGetButtonTitle($langs->trans('NewExport'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/exports/export.php?leftmenu=export', '', $user->rights->export->creer);
}
print '
';
print ' ';
diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php
index b893f6e6511..bff598873ce 100644
--- a/htdocs/fichinter/list.php
+++ b/htdocs/fichinter/list.php
@@ -314,12 +314,7 @@ if ($resql)
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
$newcardbutton='';
- if ($user->rights->ficheinter->creer)
- {
- $newcardbutton=''.$langs->trans('NewIntervention').' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
- }
+ $morehtmlcenter.= dolGetButtonTitle($langs->trans('NewIntervention'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/fichinter/card.php?action=create', '', $user->rights->ficheinter->creer);
// Lines of title fields
print ' '."\n";
diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php
index e4b71768456..80645e2a486 100644
--- a/htdocs/fourn/commande/list.php
+++ b/htdocs/fourn/commande/list.php
@@ -632,10 +632,8 @@ if ($resql)
$newcardbutton='';
if($user->rights->fournisseur->commande->creer)
{
- $newcardbutton=''.$langs->trans('NewOrder').' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
- }
+ $newcardbutton.= dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/fourn/commande/card.php?action=create');
+ }
// Lignes des champs de filtre
print ' ';
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index 2415167f8ae..fa13e329b0e 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -466,9 +466,7 @@ if ($resql)
$newcardbutton='';
if ($user->rights->fournisseur->facture->creer)
{
- $newcardbutton=''.$langs->trans('NewBill').' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/fourn/facture/card.php?action=create');
}
$i = 0;
diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php
index 5497d66e698..a93be6e096d 100644
--- a/htdocs/holiday/list.php
+++ b/htdocs/holiday/list.php
@@ -340,10 +340,8 @@ else
$newcardbutton='';
if ($user->rights->holiday->write)
{
- $newcardbutton=''.$langs->trans('MenuAddCP').' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
- }
+ $newcardbutton.= dolGetButtonTitle($langs->trans('MenuAddCP'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/holiday/card.php?action=request');
+ }
print_barre_liste($langs->trans("ListeCP"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_hrm.png', 0, $newcardbutton, '', $limit);
diff --git a/htdocs/imports/index.php b/htdocs/imports/index.php
index 6ccb0adcf44..8175dd1ca83 100644
--- a/htdocs/imports/index.php
+++ b/htdocs/imports/index.php
@@ -92,7 +92,7 @@ if (count($import->array_import_code))
{
//if ($user->rights->import->run)
//{
- print ''.$langs->trans("NewImport").' ';
+ print dolGetButtonTitle($langs->trans('NewImport'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/imports/import.php?leftmenu=import');
//}
//else
//{
diff --git a/htdocs/install/mysql/data/llx_c_type_contact.sql b/htdocs/install/mysql/data/llx_c_type_contact.sql
index 62107525ff9..006a65d2641 100644
--- a/htdocs/install/mysql/data/llx_c_type_contact.sql
+++ b/htdocs/install/mysql/data/llx_c_type_contact.sql
@@ -92,3 +92,10 @@ INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, m
INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(157, 'ticket', 'external', 'SUPPORTCLI', 'Contact client suivi incident', 1, NULL);
INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(158, 'ticket', 'external', 'CONTRIBUTOR', 'Intervenant', 1, NULL);
+-- Supplier proposal
+
+insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110, 'supplier_proposal', 'internal', 'SALESREPFOLL', 'Responsable suivi de la demande', 1);
+insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (111, 'supplier_proposal', 'external', 'BILLING', 'Contact fournisseur facturation', 1);
+insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (112, 'supplier_proposal', 'external', 'SHIPPING', 'Contact fournisseur livraison', 1);
+insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (113, 'supplier_proposal', 'external', 'SERVICE', 'Contact fournisseur prestation', 1);
+
diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql
index c85c1ff9167..27449c9e9e9 100644
--- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql
+++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql
@@ -368,4 +368,10 @@ ALTER TABLE llx_reception_extrafields ADD INDEX idx_reception_extrafields (fk_ob
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN fk_projet integer DEFAULT NULL;
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN fk_reception integer DEFAULT NULL;
+
+
+insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110, 'supplier_proposal', 'internal', 'SALESREPFOLL', 'Responsable suivi de la demande', 1);
+insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (111, 'supplier_proposal', 'external', 'BILLING', 'Contact fournisseur facturation', 1);
+insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (112, 'supplier_proposal', 'external', 'SHIPPING', 'Contact fournisseur livraison', 1);
+insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (113, 'supplier_proposal', 'external', 'SERVICE', 'Contact fournisseur prestation', 1);
\ No newline at end of file
diff --git a/htdocs/install/mysql/tables/llx_asset.sql b/htdocs/install/mysql/tables/llx_asset.sql
index a0891ef4b0e..b6b2de3fcb3 100644
--- a/htdocs/install/mysql/tables/llx_asset.sql
+++ b/htdocs/install/mysql/tables/llx_asset.sql
@@ -26,7 +26,7 @@ CREATE TABLE llx_asset(
note_public text,
note_private text,
date_creation datetime NOT NULL,
- tms timestamp NOT NULL,
+ tms timestamp,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
diff --git a/htdocs/install/mysql/tables/llx_bom_bom.sql b/htdocs/install/mysql/tables/llx_bom_bom.sql
index 89a2f8e8bab..a406229a0e4 100644
--- a/htdocs/install/mysql/tables/llx_bom_bom.sql
+++ b/htdocs/install/mysql/tables/llx_bom_bom.sql
@@ -24,7 +24,7 @@ CREATE TABLE llx_bom_bom(
note_public text,
note_private text,
date_creation datetime NOT NULL,
- tms timestamp NOT NULL,
+ tms timestamp,
date_valid datetime,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
diff --git a/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql b/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql
index 2a7bc6a4693..df4640a14f4 100644
--- a/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql
+++ b/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql
@@ -34,7 +34,7 @@ CREATE TABLE llx_emailcollector_emailcollector(
note_public text,
note_private text,
date_creation datetime NOT NULL,
- tms timestamp NOT NULL,
+ tms timestamp,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
diff --git a/htdocs/install/mysql/tables/llx_emailcollector_emailcollectoraction.sql b/htdocs/install/mysql/tables/llx_emailcollector_emailcollectoraction.sql
index e0239cf98f6..011f2d827ce 100644
--- a/htdocs/install/mysql/tables/llx_emailcollector_emailcollectoraction.sql
+++ b/htdocs/install/mysql/tables/llx_emailcollector_emailcollectoraction.sql
@@ -21,7 +21,7 @@ CREATE TABLE llx_emailcollector_emailcollectoraction(
type varchar(128) NOT NULL,
actionparam varchar(255) NULL,
date_creation datetime NOT NULL,
- tms timestamp NOT NULL,
+ tms timestamp,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
position integer DEFAULT 0,
diff --git a/htdocs/install/mysql/tables/llx_emailcollector_emailcollectorfilter.sql b/htdocs/install/mysql/tables/llx_emailcollector_emailcollectorfilter.sql
index e4071e5500a..8ecccedb6d5 100644
--- a/htdocs/install/mysql/tables/llx_emailcollector_emailcollectorfilter.sql
+++ b/htdocs/install/mysql/tables/llx_emailcollector_emailcollectorfilter.sql
@@ -21,7 +21,7 @@ CREATE TABLE llx_emailcollector_emailcollectorfilter(
type varchar(128) NOT NULL,
rulevalue varchar(128) NULL,
date_creation datetime NOT NULL,
- tms timestamp NOT NULL,
+ tms timestamp,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
diff --git a/htdocs/install/mysql/tables/llx_pos_cash_fence.sql b/htdocs/install/mysql/tables/llx_pos_cash_fence.sql
index 607060adab6..f9967ec968b 100644
--- a/htdocs/install/mysql/tables/llx_pos_cash_fence.sql
+++ b/htdocs/install/mysql/tables/llx_pos_cash_fence.sql
@@ -33,6 +33,6 @@ CREATE TABLE llx_pos_cash_fence(
posnumber VARCHAR(30),
fk_user_creat integer,
fk_user_valid integer,
- tms TIMESTAMP NOT NULL,
+ tms TIMESTAMP,
import_key VARCHAR(14)
) ENGINE=innodb;
\ No newline at end of file
diff --git a/htdocs/install/mysql/tables/llx_societe_account.sql b/htdocs/install/mysql/tables/llx_societe_account.sql
index 4123a3b05e2..b307613ba6e 100644
--- a/htdocs/install/mysql/tables/llx_societe_account.sql
+++ b/htdocs/install/mysql/tables/llx_societe_account.sql
@@ -32,7 +32,7 @@ CREATE TABLE llx_societe_account(
date_last_login datetime,
date_previous_login datetime,
date_creation datetime NOT NULL,
- tms timestamp NOT NULL,
+ tms timestamp,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
diff --git a/htdocs/install/pgsql/functions/functions.sql b/htdocs/install/pgsql/functions/functions.sql
index de6d98edf04..66b1fbaf370 100644
--- a/htdocs/install/pgsql/functions/functions.sql
+++ b/htdocs/install/pgsql/functions/functions.sql
@@ -69,6 +69,12 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_adherent_type_extraf
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bank FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bank_account FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bank_account_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_blockedlog FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_blockedlog_authority FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bom_bom FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bom_bom_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bom_bomline FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bom_bomline_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bordereau_cheque FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_boxes_def FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_c_email_templates FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
@@ -96,6 +102,9 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_deplacement FOR EACH
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_don FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_don_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_element_resources FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_emailcollector_emailcollector FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_emailcollector_emailcollectoraction FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_emailcollector_emailcollectorfilter FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_entrepot FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_events FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_expedition FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang
index 299edcbb714..8b33117cc66 100644
--- a/htdocs/langs/en_US/members.lang
+++ b/htdocs/langs/en_US/members.lang
@@ -196,4 +196,5 @@ EmailSentToMember=Email sent to member at %s
SendReminderForExpiredSubscriptionTitle=Send reminder by email for expired subscription
SendReminderForExpiredSubscription=Send reminder by email to members when subscription is about to expire (parameter is number of days before end of subscription to send the remind. It can be a list of days separated by a semicolon, for example '10;5;0;-5')
MembershipPaid=Membership paid for current period (until %s)
-YouMayFindYourInvoiceInThisEmail=You may find your invoice attached to this email
\ No newline at end of file
+YouMayFindYourInvoiceInThisEmail=You may find your invoice attached to this email
+XMembersClosed=%s member(s) closed
\ No newline at end of file
diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php
index e4b51c2429a..80d8645293b 100644
--- a/htdocs/loan/list.php
+++ b/htdocs/loan/list.php
@@ -116,9 +116,7 @@ if ($resql)
$newcardbutton='';
if ($user->rights->loan->write)
{
- $newcardbutton=''.$langs->trans('NewLoan').' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($langs->trans('NewLoan'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/loan/card.php?action=create');
}
print ' '."\n";
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 4f7776a3150..b0036b01ed4 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1740,8 +1740,8 @@ function top_menu_user(User $user, Translate $langs)
}
else{
$nophoto='/public/theme/common/user_anonymous.png';
- if ($object->gender == 'man') $nophoto='/public/theme/common/user_man.png';
- if ($object->gender == 'woman') $nophoto='/public/theme/common/user_woman.png';
+ if ($user->gender == 'man') $nophoto='/public/theme/common/user_man.png';
+ if ($user->gender == 'woman') $nophoto='/public/theme/common/user_woman.png';
$userImage = ' ';
$userDropDownImage = ' ';
diff --git a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php
index 1718a6a72d5..93f43711a78 100644
--- a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php
+++ b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php
@@ -292,6 +292,9 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers
//case 'TASK_TIMESPENT_CREATE':
//case 'TASK_TIMESPENT_MODIFY':
//case 'TASK_TIMESPENT_DELETE':
+ //case 'PROJECT_ADD_CONTACT':
+ //case 'PROJECT_DELETE_CONTACT':
+ //case 'PROJECT_DELETE_RESOURCE':
// Shipping
//case 'SHIPPING_CREATE':
diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php
index f4f4e8c34e5..212e86ca93c 100644
--- a/htdocs/modulebuilder/template/myobject_card.php
+++ b/htdocs/modulebuilder/template/myobject_card.php
@@ -127,7 +127,7 @@ if (empty($reshook))
$backurlforlist = dol_buildpath('/mymodule/myobject_list.php', 1);
if (empty($backtopage)) {
if (empty($id)) $backtopage = $backurlforlist;
- else $backtopage = dol_buildpath('/mymodule/myobject_card.php', 1).($id > 0 ? $id : '__ID__');
+ else $backtopage = dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
}
$triggermodname = 'MYMODULE_MYOBJECT_MODIFY'; // Name of trigger action code to execute when we modify record
diff --git a/htdocs/modulebuilder/template/sql/llx_mymodule_myobject.sql b/htdocs/modulebuilder/template/sql/llx_mymodule_myobject.sql
index 0470739573a..b380b1280f2 100644
--- a/htdocs/modulebuilder/template/sql/llx_mymodule_myobject.sql
+++ b/htdocs/modulebuilder/template/sql/llx_mymodule_myobject.sql
@@ -22,7 +22,7 @@ CREATE TABLE llx_mymodule_myobject(
qty INTEGER,
status INTEGER,
date_creation DATETIME NOT NULL,
- tms TIMESTAMP NOT NULL,
+ tms TIMESTAMP,
import_key VARCHAR(14)
-- END MODULEBUILDER FIELDS
) ENGINE=innodb;
\ No newline at end of file
diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php
index 92171ba7188..025f7099577 100644
--- a/htdocs/opensurvey/list.php
+++ b/htdocs/opensurvey/list.php
@@ -243,18 +243,7 @@ print ' ';
print ' ';
$newcardbutton='';
-if (! empty($user->rights->opensurvey->write))
-{
- $newcardbutton=''.$langs->trans('NewSurvey').' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
-}
-else
-{
- $newcardbutton=''.$langs->trans('NewSurvey').' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
-}
+$newcardbutton.= dolGetButtonTitle($langs->trans('NewSurvey'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/opensurvey/wizard/index.php', '', $user->rights->opensurvey->write);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic.png', 0, $newcardbutton, '', $limit);
diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php
index 0d6a0f05174..28b3c06ffa1 100644
--- a/htdocs/product/agenda.php
+++ b/htdocs/product/agenda.php
@@ -174,14 +174,8 @@ if ($id > 0 || $ref)
$morehtmlcenter='';
if (! empty($conf->agenda->enabled))
{
- if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create))
- {
- $morehtmlcenter.=''.$langs->trans("AddAction").' ';
- }
- else
- {
- $morehtmlcenter.=''.$langs->trans("AddAction").' ';
- }
+ $linktocreatetimeBtnStatus = ! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create);
+ $morehtmlcenter = dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', $linktocreatetimeBtnStatus);
}
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 3796f5b022e..de0d28cee83 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -4155,6 +4155,8 @@ class Product extends CommonObject
// phpcs:enable
global $conf, $langs;
+ $labelstatut = $labelstatutShort = '';
+
$langs->load('products');
if (! empty($conf->productbatch->enabled)) { $langs->load("productbatch");
}
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index 07827094394..688fef19654 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -452,10 +452,8 @@ if ($resql)
{
$label='NewProduct';
if($type == Product::TYPE_SERVICE) $label='NewService';
- $newcardbutton=''.$langs->trans($label).' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
- }
+ $newcardbutton.= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type='.$type);
+ }
print ' ';
if ($optioncss != '') print ' ';
diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php
index 18bb2931823..a30fce71ef1 100644
--- a/htdocs/projet/ganttview.php
+++ b/htdocs/projet/ganttview.php
@@ -194,23 +194,19 @@ if (($id > 0 && is_numeric($id)) || ! empty($ref))
}
// Link to create task
-if ($user->rights->projet->all->creer || $user->rights->projet->creer)
-{
- if ($object->public || $userWrite > 0)
- {
- $linktocreatetask = ''.$langs->trans('AddTask').' ';
+$linktocreatetaskParam = array();
+$linktocreatetaskUserRight = false;
+if ($user->rights->projet->all->creer || $user->rights->projet->creer) {
+ if ($object->public || $userWrite > 0){
+ $linktocreatetaskUserRight = true;
+ }else{
+ $linktocreatetaskParam['attr']['title'] = $langs->trans("NotOwnerOfProject");
}
- else
- {
- $linktocreatetask = ''.$langs->trans('AddTask').' ';
- }
-}
-else
-{
- $linktocreatetask = ''.$langs->trans('AddTask').' ';
}
-$linktolist=''.$langs->trans("GoToListOfTasks").' ';
+$linktocreatetask = dolGetButtonTitle($langs->trans('AddTask'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id.'&action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id), '', $linktocreatetaskUserRight, $linktocreatetaskParam);
+
+$linktolist = dolGetButtonTitle($langs->trans('GoToListOfTasks'), '', 'fa fa-tasks', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id);
//print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'title_generic.png', 0, '', '', 0, 1);
print load_fiche_titre($title, $linktolist.' '.$linktocreatetask, 'title_generic.png');
diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php
index 0e15403e9cf..fa77cb4b52c 100644
--- a/htdocs/projet/index.php
+++ b/htdocs/projet/index.php
@@ -63,7 +63,6 @@ $projectset = ($mine?$mine:(empty($user->rights->projet->all->lire)?0:2));
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, $projetset, 1);
//var_dump($projectsListId);
-
llxHeader("", $langs->trans("Projects"), "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos");
$title=$langs->trans("ProjectsArea");
diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php
index eb6498a220f..d2b95726aea 100644
--- a/htdocs/projet/info.php
+++ b/htdocs/projet/info.php
@@ -161,16 +161,8 @@ if ($permok)
$morehtmlcenter='';
if (! empty($conf->agenda->enabled))
{
- if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create))
- {
- $morehtmlcenter.='id).'">'.$langs->trans("AddAction").' ';
- $morehtmlcenter.=' ';
- $morehtmlcenter.=' ';
- }
- else
- {
- $morehtmlcenter.=''.$langs->trans("AddAction").' ';
- }
+ $addActionBtnRight = ! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create);
+ $morehtmlcenter.= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $addActionBtnRight);
}
//print '';
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index f270167bce9..1e8efc15581 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -451,9 +451,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
$newcardbutton='';
if ($user->rights->projet->creer)
{
- $newcardbutton = ''.$langs->trans('NewProject').' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($langs->trans('NewProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?action=create');
}
print ' ';
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index 1375a7a4844..c7053bc7079 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -642,23 +642,18 @@ elseif ($id > 0 || ! empty($ref))
print ' ';
- // Link to create task
- if ($user->rights->projet->all->creer || $user->rights->projet->creer)
- {
- if ($object->public || $userWrite > 0)
- {
- $linktocreatetask = ''.$langs->trans('AddTask').' ';
- }
- else
- {
- $linktocreatetask = ''.$langs->trans('AddTask').' ';
- }
- }
- else
- {
- $linktocreatetask = ''.$langs->trans('AddTask').' ';
- }
+// Link to create task
+ $linktocreatetaskParam = array();
+ $linktocreatetaskUserRight = false;
+ if ($user->rights->projet->all->creer || $user->rights->projet->creer) {
+ if ($object->public || $userWrite > 0){
+ $linktocreatetaskUserRight = true;
+ }else{
+ $linktocreatetaskParam['attr']['title'] = $langs->trans("NotOwnerOfProject");
+ }
+ }
+ $linktocreatetask = dolGetButtonTitle($langs->trans('AddTask'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id.'&action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id), '', $linktocreatetaskUserRight, $linktocreatetaskParam);
print ' id.'">';
@@ -672,7 +667,7 @@ elseif ($id > 0 || ! empty($ref))
print ' ';
$title=$langs->trans("ListOfTasks");
- $linktotasks=''.$langs->trans("GoToGanttView").' ';
+ $linktotasks = dolGetButtonTitle($langs->trans('GoToGanttView'), '', 'fa fa-calendar-minus-o', DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id.'&withproject=1');
//print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'title_generic.png', 0, '', '', 0, 1);
print load_fiche_titre($title, $linktotasks.' '.$linktocreatetask, 'title_generic.png');
diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php
index 94ca4d436d5..4a6d2633354 100644
--- a/htdocs/projet/tasks/list.php
+++ b/htdocs/projet/tasks/list.php
@@ -425,9 +425,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
$newcardbutton='';
if ($user->rights->projet->creer)
{
- $newcardbutton = ''.$langs->trans('NewTask').' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($langs->trans('NewTask'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/tasks.php?action=create');
}
print ' ';
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index e8d7506c313..f3da816fabd 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -579,31 +579,35 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
}
// Link to create time
+ $linktocreatetimeBtnStatus = 0;
+ $linktocreatetimeUrl = '';
+ $linktocreatetimeHelpText = '';
if ($user->rights->projet->all->creer || $user->rights->projet->creer)
{
if ($projectstatic->public || $userWrite > 0)
{
+ $linktocreatetimeBtnStatus = 1;
+
if (! empty($projectidforalltimes)) // We are on tab 'Time Spent' of project
{
$backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject?'&withproject=1':'');
- $linktocreatetime = ''.$langs->trans('AddTimeSpent').' ';
+ $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject?'withproject=1':'').'&projectid='.$projectstatic->id.'&action=createtime'.$param.'&backtopage='.urlencode($backtourl);
}
else // We are on tab 'Time Spent' of task
{
$backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject?'&withproject=1':'');
- $linktocreatetime = ''.$langs->trans('AddTimeSpent').' ';
+ $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject?'withproject=1':'').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime'.$param.'&backtopage='.urlencode($backtourl);
}
}
else
{
- $linktocreatetime = ''.$langs->trans('AddTime').' ';
+ $linktocreatetimeBtnStatus = -2;
+ $linktocreatetimeHelpText = $langs->trans("NotOwnerOfProject");
}
}
- else
- {
- $linktocreatetime = ''.$langs->trans('AddTime').' ';
- }
- }
+
+ $linktocreatetime = dolGetButtonTitle($langs->trans('AddTimeSpent'), $linktocreatetimeHelpText, 'fa fa-plus-circle', $linktocreatetimeUrl, '', $linktocreatetimeBtnStatus);
+ }
$massactionbutton = '';
if ($projectstatic->bill_time)
diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php
index 6bdaa92f508..7eea7e45df6 100644
--- a/htdocs/public/payment/newpayment.php
+++ b/htdocs/public/payment/newpayment.php
@@ -1943,241 +1943,249 @@ if (preg_match('/^dopayment/', $action))
print ' '."\n";
- print ''."\n";
-
- // Code to ask the credit card. This use the default "API version". No way to force API version when using JS code.
- print ''."\n";
+
+ // Code to ask the credit card. This use the default "API version". No way to force API version when using JS code.
+ print '';
}
-
- ';
}
}
diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php
index 290d07ab857..7adec8e6009 100644
--- a/htdocs/resource/class/dolresource.class.php
+++ b/htdocs/resource/class/dolresource.class.php
@@ -408,6 +408,7 @@ class Dolresource extends CommonObject
public function delete($rowid, $notrigger = 0)
{
global $user,$langs,$conf;
+ require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$error=0;
@@ -841,6 +842,8 @@ class Dolresource extends CommonObject
*/
public function getElementResources($element, $element_id, $resource_type = '')
{
+ $resources=array();
+
// Links beetween objects are stored in this table
$sql = 'SELECT rowid, resource_id, resource_type, busy, mandatory';
$sql.= ' FROM '.MAIN_DB_PREFIX.'element_resources';
diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php
index 45cf1e9d997..3e613c3d99c 100644
--- a/htdocs/resource/list.php
+++ b/htdocs/resource/list.php
@@ -197,10 +197,8 @@ if($ret == -1) {
$newcardbutton='';
if ($user->rights->resource->write)
{
- $newcardbutton=''.$langs->trans('MenuResourceAdd').' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
- }
+ $newcardbutton.= dolGetButtonTitle($langs->trans('MenuResourceAdd'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/resource/card.php?action=create');
+ }
print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $ret+1, $nbtotalofrecords, 'title_generic.png', 0, $newcardbutton, '', $limit);
}
diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php
index 18e1890c485..2bf407ec88d 100644
--- a/htdocs/societe/agenda.php
+++ b/htdocs/societe/agenda.php
@@ -162,9 +162,7 @@ if ($socid > 0)
{
if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create))
{
- $newcardbutton.=''.$langs->trans("AddAction").' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
}
}
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 292d109fd74..0cf2ae21790 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -1207,7 +1207,7 @@ else
{
// Supplier
print '';
- print ''.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).' ';
+ print ' '.$form->editfieldkey('Vendor', 'fournisseur', '', $object, 0, 'string', '', 1).' ';
$default = -1;
if (! empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)) $default=1;
print $form->selectyesno("fournisseur", (GETPOST('fournisseur', 'int')!=''?GETPOST('fournisseur', 'int'):(GETPOST("type", 'alpha') == '' ? $default : $object->fournisseur)), 1, 0, (GETPOST("type", 'alpha') == '' ? 1 : 0));
@@ -2709,9 +2709,7 @@ else
$MAXEVENT = 10;
- $morehtmlright = '';
- $morehtmlright.= $langs->trans("SeeAll");
- $morehtmlright.= ' ';
+ $morehtmlright.= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt', DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index 42584c5621b..13f179b99cc 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -581,9 +581,7 @@ if ($user->rights->societe->creer && $contextpage != 'poslist')
if($type == 'f') $label='NewSupplier';
}
- $newcardbutton = ''.$langs->trans($label).' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/societe/card.php?action=create'.$typefilter);
}
print '';
diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php
index e2175142dd4..e37d7caf91f 100644
--- a/htdocs/societe/paymentmodes.php
+++ b/htdocs/societe/paymentmodes.php
@@ -800,7 +800,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
$morehtmlright='';
if (! empty($conf->global->STRIPE_ALLOW_LOCAL_CARD))
{
- $morehtmlright='id.'&action=createcard">'.$langs->trans("Add").' ';
+ $morehtmlright.= dolGetButtonTitle($langs->trans('Add'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=createcard');
}
print load_fiche_titre($langs->trans('StripePaymentModes').($stripeacc?' (Stripe connection with StripeConnect account '.$stripeacc.')':' (Stripe connection with keys from Stripe module setup)'), $morehtmlright, '');
@@ -1162,7 +1162,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
// List of bank accounts
print ' ';
- $morehtmlright='id.'&action=create">'.$langs->trans("Add").' ';
+ $morehtmlright= dolGetButtonTitle($langs->trans('Add'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=create');
print load_fiche_titre($langs->trans("BankAccounts"), $morehtmlright, '');
diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php
index 8f7c83dcef5..6b4a85f28c8 100644
--- a/htdocs/societe/website.php
+++ b/htdocs/societe/website.php
@@ -230,13 +230,9 @@ dol_fiche_end();
$newcardbutton = '';
if (! empty($conf->website->enabled)) {
if (! empty($user->rights->societe->lire)) {
- $newcardbutton .= 'id).'">' . $langs->trans("AddWebsiteAccount").' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
- } else {
- $newcardbutton .= ''.$langs->trans("AddAction").' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $morehtmlright.= dolGetButtonTitle($langs->trans("AddWebsiteAccount"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/website/websiteaccount_card.php?action=create&fk_soc='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id));
+ } else {
+ $morehtmlright.= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/website/websiteaccount_card.php?action=create&fk_soc='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', 0);
}
}
diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php
index d8e47dcb040..fe010c95e9c 100644
--- a/htdocs/supplier_proposal/list.php
+++ b/htdocs/supplier_proposal/list.php
@@ -388,10 +388,8 @@ if ($resql)
$newcardbutton='';
if($user->rights->supplier_proposal->creer)
{
- $newcardbutton=''.$langs->trans('NewAskPrice').' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
- }
+ $newcardbutton.= dolGetButtonTitle($langs->trans('NewAskPrice'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/supplier_proposal/card.php?action=create');
+ }
// Lignes des champs de filtre
print ' ';
diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php
index 37676f1b1e1..83f4aefb5f5 100644
--- a/htdocs/takepos/pay.php
+++ b/htdocs/takepos/pay.php
@@ -84,7 +84,7 @@ if ($resql) {
if ($paycode == 'CB') $paycode = 'CB';
if ($paycode == 'CHQ') $paycode = 'CHEQUE';
- $accountname="CASHDESK_ID_BANKACCOUNT_".$paycode;
+ $accountname="CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"];
if (! empty($conf->global->$accountname) && $conf->global->$accountname > 0) array_push($paiements, $obj);
}
}
diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php
index 9601c6d0f36..dd2d6524f46 100644
--- a/htdocs/takepos/takepos.php
+++ b/htdocs/takepos/takepos.php
@@ -624,7 +624,7 @@ if ($resql){
if ($paycode == 'CB') $paycode = 'CARD';
if ($paycode == 'CHQ') $paycode = 'CHEQUE';
- $accountname="CASHDESK_ID_BANKACCOUNT_".$paycode;
+ $accountname="CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"];
if (! empty($conf->global->$accountname) && $conf->global->$accountname > 0) array_push($paiementsModes, $obj);
}
}
diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php
new file mode 100644
index 00000000000..927c92c5f41
--- /dev/null
+++ b/htdocs/theme/eldy/btn.inc.php
@@ -0,0 +1,219 @@
+
+/*