diff --git a/dev/tools/codespell/codespell-lines-ignore.txt b/dev/tools/codespell/codespell-lines-ignore.txt index 0d4e979d84a..f6dc9d29159 100644 --- a/dev/tools/codespell/codespell-lines-ignore.txt +++ b/dev/tools/codespell/codespell-lines-ignore.txt @@ -1,55 +1,55 @@ - $objMod->dictionaries = $objMod->{"dictionnaries"}; // For backward compatibility - if (empty($objMod->dictionaries) && !empty($objMod->{"dictionnaries"})) { - print 'id.'">'; - $reponsesadd = str_split($obj->reponses); - $sql .= " SET reponses = '".$db->escape($reponsesadd)."'"; - $sql .= " SET reponses = '0".$db->escape($obj->reponses)."'"; - print ''; - GETPOST("mouvement", 'int'), - jQuery("#mouvement option").removeAttr("selected").change(); - jQuery("#mouvement option[value=0]").attr("selected","selected").trigger("change"); - jQuery("#mouvement option[value=1]").attr("selected","selected").trigger("change"); - jQuery("#mouvement").trigger("change"); - $action = 'transfert'; - $this->category->childs[] = $this->_cleanObjectDatas($cat); - $tmp = array('id_users'=>$obj->id_users, 'nom'=>$obj->name, 'reponses'=>$obj->reponses); - //si les reponses ne concerne pas la colonne effacée, on concatenate - GETPOST("mouvement", "int"), - GETPOST("mouvement", 'alpha'), - GETPOST("mouvement", 'int'), - if (jQuery("#mouvement").val() == \'0\') jQuery("#unitprice").removeAttr("disabled"); - print ''.$langs->trans("TransferStock").''; - $action = 'transfert'; - $ensemblereponses = $obj->reponses; - $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'opensurvey_user_studs (nom, id_sondage, reponses, date_creation)'; - $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'opensurvey_user_studs (nom, id_sondage, reponses, ip, date_creation)'; - $sql = 'SELECT s.reponses'; - $sql2 .= " SET reponses = '".$db->escape($newcar)."'"; - $this->category->childs = array(); - // mise a jour des reponses utilisateurs dans la base - if ($user->hasRight('stock', 'mouvement', 'lire')) { - jQuery("#mouvement").change(function() { - print ''.$langs->trans("TransferStock").''; - $action = 'transfert'; - $ensemblereponses = $obj->reponses; - $sql = "SELECT id_users, nom as name, id_sondage, reponses"; - $sql = "SELECT id_users, nom as name, reponses"; - $test = '/javas:cript/google.com'; - $test=""; // Same - if ($user->hasRight('stock', 'mouvement', 'creer')) { - $ensemblereponses = $obj->reponses; - $opensurveysondage->mail_admin = $_SESSION['adresse']; - $pdf->SetXY($savx, $savy); - $savy = $pdf->getY(); - $somethingshown = $formactions->showactions($object, 'mouvement', 0, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for product - $sql .= " SET reponses = '".$db->escape($nouveauchoix)."'"; - TaskItem(pID, pName, pStart, pEnd, pColor, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend, pCaption, pNotes, pGantt)

- if ($action == "transfert") { - print ''; - print ''; + print ajax_combobox("mouvement"); + public $childs = array(); + unset($_SESSION["adresse"]); $permissiontoadd = $user->rights->stock->mouvement->creer; $permissiontodelete = $user->rights->stock->mouvement->creer; // There is no deletion permission for stock movement as we should never delete $permissiontoread = $user->rights->stock->mouvement->lire; diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 99acd49f0ba..d3ccd2bcdcb 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -916,7 +916,7 @@ class BookKeeping extends CommonObject } elseif ($key == 't.fk_doc' || $key == 't.fk_docdet' || $key == 't.piece_num') { $sqlwhere[] = $key.'='.$value; } elseif ($key == 't.subledger_account' || $key == 't.numero_compte') { - $sqlwhere[] = $key.' LIKE \''.$this->db->escapeforlike($this->db->escape($value)).'%\''; + $sqlwhere[] = $key.' LIKE \''.$this->db->escape($this->db->escapeforlike($value)).'%\''; } elseif ($key == 't.date_creation>=' || $key == 't.date_creation<=') { $sqlwhere[] = $key.'\''.$this->db->idate($value).'\''; } elseif ($key == 't.date_export>=' || $key == 't.date_export<=') { diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 953c0b7b528..515d54ef238 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2217,7 +2217,7 @@ class Adherent extends CommonObject */ public function getTooltipContentArray($params) { - global $conf, $langs; + global $langs; $langs->loadLangs(['members', 'companies']); $nofetch = !empty($params['nofetch']); diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index 1305f812c76..2c7f58be336 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -392,11 +392,11 @@ if ($mode == 'config' && $user->admin) { print img_picto($langs->trans("Delete"), 'delete', 'class="paddingright"'); print ''; // test icon - print ''; + print ''; print img_picto($langs->trans("TestPrinterDesc"), 'printer', 'class="paddingright paddingleft"').'TXT'; print ''; // test icon - print ''; + print ''; print img_picto($langs->trans("TestPrinterDesc2"), 'printer', 'class="paddingright paddingleft"').'IMG'; print ''; print ''; diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index b62e8591244..48781cd43e2 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -279,6 +279,12 @@ if (in_array($type, array('mysql', 'mysqli'))) { print ''; print '
'; + print ''; + print ''; + print '
'; + $execmethod = 0; if (getDolGlobalString('MAIN_EXEC_USE_POPEN')) { $execmethod = getDolGlobalString('MAIN_EXEC_USE_POPEN'); diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index dc098d4f3ce..a27f7bfef20 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -149,7 +149,7 @@ if ($object->id > 0) { print dol_get_fiche_head($head, 'documents', $langs->trans("Action"), -1, 'action'); // Link to other agenda views - $linkback .= ''; + $linkback = ''; $linkback .= img_picto($langs->trans("BackToList"), 'object_calendarlist', 'class="pictoactionview pictofixedwidth"'); $linkback .= ''.$langs->trans("BackToList").''; $linkback .= ''; diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index 3af992cec85..591fb5082d3 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -73,7 +73,7 @@ $head = actions_prepare_head($object); print dol_get_fiche_head($head, 'info', $langs->trans("Action"), -1, 'action'); // Link to other agenda views -$linkback .= ''; +$linkback = ''; $linkback .= img_picto($langs->trans("BackToList"), 'object_calendarlist', 'class="pictoactionview pictofixedwidth"'); $linkback .= ''.$langs->trans("BackToList").''; $linkback .= ''; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 1e480c79a14..94fb5f6c971 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -923,6 +923,12 @@ while ($currentdaytoshow < $lastdaytoshow) { } } $sql .= " AND u.statut = 1"; + if ($filtert > 0) { + $sql .= " AND u.rowid = ".((int) $filtert); + } + if ($usergroup > 0) { + $sql .= " AND ug.fk_usergroup = ".((int) $usergroup); + } if ($user->socid > 0) { // External users should see only contacts of their company $sql .= " AND u.fk_soc = ".((int) $user->socid); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index ded202f899f..ac3c2b57bbb 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -845,7 +845,7 @@ if ($object->id > 0) { print ''; print ''; - print '
'; + print ''; print ''; @@ -859,7 +859,8 @@ if ($object->id > 0) { print '\n"; - print ''; + print ''; print ''; $i++; } @@ -956,7 +957,7 @@ if ($object->id > 0) { print '
'.$langs->trans("LastPropals", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllPropals").''.$num.''; print ''; print '
'.$langs->trans("LastPropals", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllPropals").''.$num.''.img_picto($langs->trans("Statistics"), 'stats').'
'; $propal_static->id = $objp->propalid; $propal_static->ref = $objp->ref; - $propal_static->ref_client = $objp->ref_client; + $propal_static->ref_client = $objp->ref_client; // deprecated + $propal_static->ref_customer = $objp->ref_client; $propal_static->total_ht = $objp->total_ht; $propal_static->total_tva = $objp->total_tva; $propal_static->total_ttc = $objp->total_ttc; @@ -898,7 +899,7 @@ if ($object->id > 0) { print " ".img_warning(); } print ''.dol_print_date($db->jdate($objp->dp), 'day')."'.price($objp->total_ht).''.price($objp->total_ht).''.$propal_static->LibStatut($objp->fk_statut, 5).'
'; print ''; - print '
'; + print ''; print ''; @@ -1009,7 +1010,7 @@ if ($object->id > 0) { print ''; print '\n"; - print ''; + print ''; print ''; $i++; } @@ -1055,7 +1056,7 @@ if ($object->id > 0) { print '
'.$langs->trans("LastCustomerOrders", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllOrders").''.$num.''; print ''; print '
'.$langs->trans("LastCustomerOrders", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllOrders").''.$num.''.img_picto($langs->trans("Statistics"), 'stats').'
'.dol_print_date($db->jdate($objp->dc), 'day')."'.price($objp->total_ht).''.price($objp->total_ht).''.$commande_static->LibStatut($objp->fk_statut, $objp->facture, 5).'
'; print ''; - print '
'; + print ''; print ''; @@ -1107,7 +1108,7 @@ if ($object->id > 0) { print ''; } - print ''; + print ''; print "\n"; $i++; } @@ -1251,7 +1252,7 @@ if ($object->id > 0) { print '
'.$langs->trans("LastSendings", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllSendings").''.$num.''; print ''; print '
'.$langs->trans("LastSendings", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllSendings").''.$num.''.img_picto($langs->trans("Statistics"), 'stats').'
!!!'.$sendingstatic->LibStatut($objp->statut, 5).''.$sendingstatic->LibStatut($objp->statut, 5).'
'; print ''; - print '
'; + print ''; print ''; @@ -1347,10 +1348,16 @@ if ($object->id > 0) { if ($num > 0) { print '
'; print '
'.$langs->trans("LastInterventions", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllInterventions").''.$num.''; print ''; print '
'.$langs->trans("LastInterventions", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllInterventions").''.$num.''.img_picto($langs->trans("Statistics"), 'stats').'
'; - print ''; - print ''; + $colspan = 4; + if (getDolGlobalString('MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES')) { + $colspan++; + } + print ''; print ''; } @@ -1383,12 +1390,12 @@ if ($object->id > 0) { print ''; } } - print ''; if (getDolGlobalString('MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES')) { - print ''; } @@ -1440,11 +1447,16 @@ if ($object->id > 0) { if ($num > 0) { print '
'; print '
'; - print '
'.$langs->trans("LatestCustomerTemplateInvoices", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllCustomerTemplateInvoices").''.$num.'
'; + print ''; + print ''; + print '
'.$langs->trans("LatestCustomerTemplateInvoices", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllCustomerTemplateInvoices").''.$num.'
'; + print '
!!!'; + print ''; print price($objp->total_ht); print ''; + print ''; print price($objp->total_ttc); print '
'; - print ''; - print ''; print ''; } @@ -1462,6 +1474,7 @@ if ($object->id > 0) { $facturestatic->status = $objp->status; $facturestatic->paye = $objp->paye; $facturestatic->alreadypaid = $objp->am; + $facturestatic->totalpaid = $objp->am; $facturestatic->date = $db->jdate($objp->df); $facturestatic->date_lim_reglement = $db->jdate($objp->dl); @@ -1508,12 +1521,12 @@ if ($object->id > 0) { } else { print ''; } - print ''; if (getDolGlobalString('MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES')) { - print ''; } diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 3595296fec3..e4d199d5ff6 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -96,7 +96,6 @@ if (empty($action) && empty($object->id)) { $upload_dir = $conf->mailing->dir_output."/".get_exdir($object->id, 2, 0, 1, $object, 'mailing'); - /* * Actions */ @@ -998,9 +997,9 @@ if ($action == 'create') { $nbemail = ($object->nbemail ? $object->nbemail : 0); if (is_numeric($nbemail)) { $text = ''; - if ((getDolGlobalString('MAILING_LIMIT_SENDBYWEB') && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail) && ($object->statut == 1 || ($object->statut == 2 && $nbtry < $nbemail))) { + if ((getDolGlobalString('MAILING_LIMIT_SENDBYWEB') && getDolGlobalInt('MAILING_LIMIT_SENDBYWEB') < $nbemail) && ($object->statut == 1 || ($object->statut == 2 && $nbtry < $nbemail))) { if (getDolGlobalInt('MAILING_LIMIT_SENDBYWEB') > 0) { - $text .= $langs->trans('LimitSendingEmailing', getDolGlobalString('MAILING_LIMIT_SENDBYWEB')); + $text .= $langs->trans('LimitSendingEmailing', getDolGlobalInt('MAILING_LIMIT_SENDBYWEB')); } else { $text .= $langs->trans('SendingFromWebInterfaceIsNotAllowed'); } @@ -1029,7 +1028,9 @@ if ($action == 'create') { print $text; if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'default') { if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'mail') { - print ' ('.getDolGlobalString('MAIN_MAIL_SMTP_SERVER_EMAILING').')'; + print ' ('; + print getDolGlobalString('MAIN_MAIL_SMTP_SERVER_EMAILING', getDolGlobalString('MAIN_MAIL_SMTP_SERVER')); + print ')'; } } elseif (getDolGlobalString('MAIN_MAIL_SENDMODE') != 'mail' && getDolGlobalString('MAIN_MAIL_SMTP_SERVER')) { print ' ('.getDolGlobalString('MAIN_MAIL_SMTP_SERVER').')'; diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index 1f28a16a9d3..7aabd8dc2e3 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -58,28 +58,31 @@ print load_fiche_titre($title); //print '
'; + $colspan = 5; + if (getDolGlobalString('MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES')) { + $colspan++; + } + print ''; + print '
'.$langs->trans("LastCustomersBills", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllBills").''.$num.''; + print ''; print ''; - print '
'.$langs->trans("LastCustomersBills", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllBills").''.$num.''.img_picto($langs->trans("Statistics"), 'stats').'
'; + print '
!!!'; + print ''; print price($objp->total_ht); print ''; + print ''; print price($objp->total_ttc); print '
'; print '
'; +$titlesearch = $langs->trans("SearchAMailing"); +if (getDolGlobalInt('EMAILINGS_SUPPORT_ALSO_SMS')) { + $titlesearch .= ' | '.$langs->trans("smsing"); +} + +// Search into emailings +print '
'; +print ''; +print '
'; +print ''; +print ''; +print ''; +print ''; +print ''; + +print "
'.$titlesearch.'
'; +print $langs->trans("Ref").':
'; +print $langs->trans("Other").':

\n"; -//if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo -//{ - // Search into emailings - print '
'; - print ''; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print "
'.$langs->trans("SearchAMailing").'
'; - print $langs->trans("Ref").':
'; - print $langs->trans("Other").':

\n"; -//} // Affiche stats de tous les modules de destinataires mailings print ''; -print ''; +print ''; $dir = DOL_DOCUMENT_ROOT."/core/modules/mailings"; $handle = opendir($dir); @@ -101,14 +104,14 @@ if (is_resource($handle)) { $qualified = 1; foreach ($mailmodule->require_module as $key) { - if (empty($conf->$key->enabled) || (!$user->admin && $mailmodule->require_admin)) { + if (!isModEnabled($key) || (!$user->admin && !empty($mailmodule->require_admin))) { $qualified = 0; - //print "Les pr�requis d'activation du module mailing ne sont pas respect�s. Il ne sera pas actif"; + //print "Prerequisites are not not, selector won't be active"; break; } } - // Si le module mailing est qualifi� + // If emailing is qualified for statistic section if ($qualified) { foreach ($mailmodule->getSqlArrayForStats() as $sql) { print ''; @@ -118,10 +121,10 @@ if (is_resource($handle)) { $num = $db->num_rows($result); $i = 0; - while ($i < $num) { $obj = $db->fetch_object($result); - print ''; + print ''; $i++; } @@ -149,7 +152,7 @@ print '
'; * List of last emailings */ $limit = 10; -$sql = "SELECT m.rowid, m.titre, m.nbemail, m.statut, m.date_creat"; +$sql = "SELECT m.rowid, m.titre as title, m.nbemail, m.statut as status, m.date_creat"; $sql .= " FROM ".MAIN_DB_PREFIX."mailing as m"; $sql .= " WHERE m.entity = ".$conf->entity; $sql .= " ORDER BY m.date_creat DESC"; @@ -179,7 +182,7 @@ if ($result) { print '
'; print ''; print ''; - print ''; + print ''; print ''; $i++; } diff --git a/htdocs/comm/mailing/note.php b/htdocs/comm/mailing/note.php index 49cf4b026df..19e623d519b 100644 --- a/htdocs/comm/mailing/note.php +++ b/htdocs/comm/mailing/note.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/mailing/class/mailing.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/emailing.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("mailing", "companies")); +$langs->loadLangs(array("mails", "mailing", "companies")); // Get parameters $id = GETPOST('id', 'int'); diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 6bd2223a627..e7679dcec72 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -4,7 +4,7 @@ * Copyright (C) 2017 Pierre-Henry Favre * Copyright (C) 2020 Maxime DEMAREST * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2022 Alexandre Spangaro + * Copyright (C) 2022-2024 Alexandre Spangaro * * 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 @@ -734,18 +734,18 @@ if (!empty($date_start) && !empty($date_stop)) { print_liste_field_titre($arrayfields['date']['label'], $_SERVER["PHP_SELF"], "date", "", $param, '', $sortfield, $sortorder, 'center nowrap '); print_liste_field_titre($arrayfields['date_due']['label'], $_SERVER["PHP_SELF"], "date_due", "", $param, '', $sortfield, $sortorder, 'center nowrap '); print_liste_field_titre($arrayfields['ref']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'nowraponall '); - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; if (isModEnabled('multicurrency')) { - print ''; + print ''; } print ''; @@ -862,9 +862,9 @@ if (!empty($date_start) && !empty($date_stop)) { print ''; // Total WOT - print '\n"; + print '\n"; // Total INCT - print '\n"; // Total VAT - print '\n"; + print '\n"; print '\n"; @@ -909,9 +909,9 @@ if (!empty($date_start) && !empty($date_stop)) { // Total credits print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; if (isModEnabled('multicurrency')) { print ''; @@ -920,9 +920,9 @@ if (!empty($date_start) && !empty($date_stop)) { // Total debits print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; if (isModEnabled('multicurrency')) { print ''; @@ -931,9 +931,9 @@ if (!empty($date_start) && !empty($date_stop)) { // Balance print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; if (isModEnabled('multicurrency')) { print ''; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 4af755a19e1..32e569368e9 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2343,8 +2343,6 @@ class Facture extends CommonInvoice $line->fk_product = $objp->fk_product; $line->date_start = $this->db->jdate($objp->date_start); $line->date_end = $this->db->jdate($objp->date_end); - $line->date_start = $this->db->jdate($objp->date_start); - $line->date_end = $this->db->jdate($objp->date_end); $line->info_bits = $objp->info_bits; $line->total_ht = $objp->total_ht; $line->total_tva = $objp->total_tva; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index cc7df9fc883..e10e81bbbb0 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -59,8 +59,8 @@ $action = (GETPOST('action', 'alpha') ? GETPOST('action', 'alpha') : 'view'); $confirm = GETPOST('confirm', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); -$id = GETPOST('id', 'int'); -$socid = GETPOST('socid', 'int'); +$id = GETPOSTINT('id'); +$socid = GETPOSTINT('socid'); // Initialize technical object $object = new Contact($db); @@ -102,7 +102,7 @@ $permissiontoadd = $user->hasRight('societe', 'contact', 'creer'); if ($user->socid) { $socid = $user->socid; } -if ($object->priv && $object->user_creation->id != $user->id) { +if ($object->priv && $object->user_creation_id != $user->id) { accessforbidden(); } $result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', 0); // If we create a contact with no company (shared contacts), no check on write permission @@ -206,7 +206,7 @@ if (empty($reshook)) { } $object->entity = (GETPOSTISSET('entity') ? GETPOST('entity', 'int') : $conf->entity); - $object->socid = GETPOSTINT("socid"); + $object->socid = $socid; $object->lastname = (string) GETPOST("lastname", 'alpha'); $object->firstname = (string) GETPOST("firstname", 'alpha'); $object->civility_code = (string) GETPOST("civility_code", 'alpha'); @@ -404,7 +404,7 @@ if (empty($reshook)) { $object->oldcopy = clone $object; - $object->socid = GETPOST("socid", 'int'); + $object->socid = $socid; $object->lastname = (string) GETPOST("lastname", 'alpha'); $object->firstname = (string) GETPOST("firstname", 'alpha'); $object->civility_code = (string) GETPOST("civility_code", 'alpha'); diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 88240d0efc3..e0d246ae25a 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -6,7 +6,7 @@ * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2018 Frédéric France * Copyright (C) 2019 Juanjo Menent - * Copyright (C) 2023 William Mead + * Copyright (C) 2023-2024 William Mead * * 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 @@ -62,7 +62,6 @@ if (!$sortorder) { $sortorder = "ASC"; } -$filter = GETPOST("filter", 'alpha'); $search_name = GETPOST("search_name", 'alpha'); $search_subprice = GETPOST("search_subprice", 'alpha'); $search_qty = GETPOST("search_qty", 'alpha'); @@ -114,20 +113,6 @@ if (!empty($user->socid)) { } $result = restrictedArea($user, 'contrat', $contratid); -if ($search_status != '') { - $tmp = explode('&', $search_status); - if (!empty($tmp[1])) { - if ($tmp[1] == 'filter=notexpired') { - $search_status = $tmp[0]; - $filter = 'notexpired'; - } - if ($tmp[1] == 'filter=expired') { - $search_status = $tmp[0]; - $filter = 'expired'; - } - } -} - $staticcontrat = new Contrat($db); $staticcontratligne = new ContratLigne($db); $companystatic = new Societe($db); @@ -194,7 +179,7 @@ if (empty($reshook)) { $search_total_ttc = ""; $search_contract = ""; $search_service = ""; - $search_status = -1; + $search_status = ""; $opouvertureprevuemonth = ""; $opouvertureprevueday = ""; $opouvertureprevueyear = ""; @@ -211,7 +196,6 @@ if (empty($reshook)) { $opclotureday = ""; $opclotureyear = ""; $filter_opcloture = ""; - $filter = ''; $toselect = array(); $search_array_options = array(); } @@ -299,15 +283,15 @@ if ($search_status == "0") { if ($search_status == "4") { $sql .= " AND cd.statut = 4"; } +if ($search_status == "4&filter=expired") { + $sql .= " AND cd.statut = 4 AND cd.date_fin_validite < '".$db->idate($now)."'"; +} +if ($search_status == "4&filter=notexpired") { + $sql .= " AND cd.statut = 4 AND cd.date_fin_validite >= '".$db->idate($now)."'"; +} if ($search_status == "5") { $sql .= " AND cd.statut = 5"; } -if ($filter == "expired") { - $sql .= " AND cd.date_fin_validite < '".$db->idate($now)."'"; -} -if ($filter == "notexpired") { - $sql .= " AND cd.date_fin_validite >= '".$db->idate($now)."'"; -} if ($search_subprice) { $sql .= natural_search("cd.subprice", $search_subprice, 1); } @@ -478,9 +462,6 @@ if ($search_service) { if ($search_status) { $param .= '&search_status='.urlencode($search_status); } -if ($filter) { - $param .= '&filter='.urlencode($filter); -} if (!empty($filter_opouvertureprevue) && $filter_opouvertureprevue != -1) { $param .= '&filter_opouvertureprevue='.urlencode($filter_opouvertureprevue); } @@ -594,7 +575,6 @@ if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { } if (!empty($arrayfields['c.ref']['checked'])) { print ''; diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 159ab973372..f77c48c45a0 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -882,8 +882,9 @@ class CMailFile if ($res) { $additionnalparam = ''; // By default if (getDolGlobalString('MAIN_MAIL_ALLOW_SENDMAIL_F')) { - // le "Return-Path" (retour des messages bounced) dans les header ne fonctionne pas avec tous les MTA - // Le forcage de la valeur grace à l'option -f de sendmail est donc possible si la constante MAIN_MAIL_ALLOW_SENDMAIL_F est definie. + // When using the phpmail function, the mail command may force the from to the user of the login, for example: linuxuser@myserver.mydomain.com + // You can try to set this option to have the command use the From. if it does not work, you can also try the MAIN_MAIL_SENDMAIL_FORCE_BA. + // So forcing using the option -f of sendmail is possible if constant MAIN_MAIL_ALLOW_SENDMAIL_F is defined. // Having this variable defined may create problems with some sendmail (option -f refused) // Having this variable not defined may create problems with some other sendmail (option -f required) $additionnalparam .= ($additionnalparam ? ' ' : '').(getDolGlobalString('MAIN_MAIL_ERRORS_TO') ? '-f'.$this->getValidAddress($conf->global->MAIN_MAIL_ERRORS_TO, 2) : ($this->addr_from != '' ? '-f'.$this->getValidAddress($this->addr_from, 2) : '')); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c8e8c7176ec..8691ee198c2 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5610,6 +5610,7 @@ abstract class CommonObject // If selected model is a filename template (then $modele="modelname" or "modelname:filename") $tmp = explode(':', $modele, 2); + $saved_model = $modele; if (!empty($tmp[1])) { $modele = $tmp[0]; $srctemplatepath = $tmp[1]; @@ -5717,7 +5718,7 @@ abstract class CommonObject $sav_charset_output = empty($outputlangs->charset_output) ? '' : $outputlangs->charset_output; // update model_pdf in object - $this->model_pdf = $modele; + $this->model_pdf = $saved_model; if (in_array(get_class($this), array('Adherent'))) { $resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, 'member', 1, 'tmp_cards', $moreparams); @@ -9526,7 +9527,7 @@ abstract class CommonObject $this->$field = (float) $obj->$field; } } else { - if (isset($obj->$field) && !is_null($obj->$field) || (isset($info['notnull']) && $info['notnull'] == 1)) { + if (isset($obj->$field) && (!is_null($obj->$field) || (isset($info['notnull']) && $info['notnull'] == 1))) { $this->$field = (int) $obj->$field; } else { $this->$field = null; @@ -9541,7 +9542,7 @@ abstract class CommonObject $this->$field = (float) $obj->$field; } } else { - if (isset($obj->$field) && !is_null($obj->$field) || (isset($info['notnull']) && $info['notnull'] == 1)) { + if (isset($obj->$field) && (!is_null($obj->$field) || (isset($info['notnull']) && $info['notnull'] == 1))) { $this->$field = (float) $obj->$field; } else { $this->$field = null; diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index e8dd4158b60..9e21b147d25 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -732,7 +732,7 @@ class Conf extends stdClass } if (!isset($this->global->MAIN_ENABLE_AJAX_TOOLTIP)) { - $this->global->MAIN_ENABLE_AJAX_TOOLTIP = 1; + $this->global->MAIN_ENABLE_AJAX_TOOLTIP = 0; // Not enabled by default (still trouble of persistent tooltip) } // By default, suppliers objects can be linked to all projects diff --git a/htdocs/core/class/cunits.class.php b/htdocs/core/class/cunits.class.php index 4a5326d719e..26b816c273b 100644 --- a/htdocs/core/class/cunits.class.php +++ b/htdocs/core/class/cunits.class.php @@ -103,14 +103,14 @@ class CUnits extends CommonDict $sql .= "code,"; $sql .= "label,"; $sql .= "short_label,"; - $sql .= "unit_type"; + $sql .= "unit_type,"; $sql .= "scale"; $sql .= ") VALUES ("; $sql .= " ".(!isset($this->id) ? 'NULL' : "'".$this->db->escape($this->id)."'").","; $sql .= " ".(!isset($this->code) ? 'NULL' : "'".$this->db->escape($this->code)."'").","; $sql .= " ".(!isset($this->label) ? 'NULL' : "'".$this->db->escape($this->label)."'").","; $sql .= " ".(!isset($this->short_label) ? 'NULL' : "'".$this->db->escape($this->short_label)."'").","; - $sql .= " ".(!isset($this->unit_type) ? 'NULL' : "'".$this->db->escape($this->unit_type)."'"); + $sql .= " ".(!isset($this->unit_type) ? 'NULL' : "'".$this->db->escape($this->unit_type)."'").","; $sql .= " ".(!isset($this->scale) ? 'NULL' : "'".$this->db->escape($this->scale)."'"); $sql .= ")"; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index dec6c86d54d..7f5f6c923f6 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1120,11 +1120,12 @@ class ExtraFields } else { $checked = ' value="1" '; } - $out = ''; // A hidden field ending with "_boolean" that is always set to 1. - $out .= ''; + + $out = ''; } else { $out = $form->selectyesno($keyprefix.$key.$keysuffix, $value, 1, false, 1); } + $out .= ''; // A hidden field ending with "_boolean" that is always set to 1. } elseif ($type == 'price') { if (!empty($value)) { // $value in memory is a php numeric, we format it into user number format. $value = price($value); diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 546b020a2f2..6775e61280f 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1862,6 +1862,9 @@ class FormMail extends Form $tmparray['__OTHER3__'] = 'Other3'; $tmparray['__OTHER4__'] = 'Other4'; $tmparray['__OTHER5__'] = 'Other5'; + $tmparray['__CHECK_READ__'] = $langs->trans('TagCheckMail'); + $tmparray['__UNSUBSCRIBE__'] = $langs->trans('TagUnsubscribe'); + $tmparray['__UNSUBSCRIBE_URL__'] = $langs->trans('TagUnsubscribe').' (URL)'; $onlinepaymentenabled = 0; if (isModEnabled('paypal')) { @@ -1919,7 +1922,7 @@ class FormMail extends Form */ } if (getDolGlobalString('MEMBER_ENABLE_PUBLIC')) { - $substitutionarray['__PUBLICLINK_NEWMEMBERFORM__'] = 'BlankSubscriptionForm'; + $tmparray['__PUBLICLINK_NEWMEMBERFORM__'] = 'BlankSubscriptionForm'; } } diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 42880621de5..6dabcb006b6 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -338,6 +338,9 @@ class Utils if (GETPOST("use_mysql_quick_param", "alpha")) { $param .= " --quick"; } + if (GETPOST("use_force", "alpha")) { + $param .= " -f"; + } if (GETPOST("sql_structure", "alpha") || $usedefault) { if (GETPOST("drop", "alpha") || $usedefault) { $param .= " --add-drop-table=TRUE"; diff --git a/htdocs/core/db/Database.interface.php b/htdocs/core/db/Database.interface.php index e1bc75888e6..72a5114558a 100644 --- a/htdocs/core/db/Database.interface.php +++ b/htdocs/core/db/Database.interface.php @@ -191,7 +191,7 @@ interface Database /** * Escape a string to insert data into a like. - * Can be used this way: LIKE '%".dbhandler->escapeforlike(dbhandler->escape(...))."%' + * Can be used this way: LIKE '%".dbhandler->escape(dbhandler->escapeforlike(...))."%' * * @param string $stringtoencode String to escape * @return string String escaped diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 382576c36d3..9f6e5b9b271 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8718,7 +8718,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $daytext = $outputlangs->trans('Day'.$tmp['wday']); $substitutionarray = array_merge($substitutionarray, array( - '__NOW_TMS__' => (int) $now, + '__NOW_TMS__' => (string) $now, // Must be the string that represent the int '__NOW_TMS_YMD__' => dol_print_date($now, 'day', 'auto', $outputlangs), '__DAY__' => (string) $tmp['mday'], '__DAY_TEXT__' => $daytext, // Monday @@ -12658,7 +12658,7 @@ function dolForgeCriteriaCallback($matches) if (preg_match('/^\'(.*)\'$/', $tmpescaped, $regbis)) { $tmpescaped = $regbis[1]; } - //$tmpescaped = "'".$db->escapeforlike($db->escape($regbis[1]))."'"; + //$tmpescaped = "'".$db->escape($db->escapeforlike($regbis[1]))."'"; $tmpescaped = "'".$db->escape($tmpescaped)."'"; // We do not escape the _ and % so the like will works } elseif (preg_match('/^\'(.*)\'$/', $tmpescaped, $regbis)) { $tmpescaped = "'".$db->escape($regbis[1])."'"; diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index e2554e88ba0..08e6d567ff2 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -192,7 +192,7 @@ function dol_print_object_info($object, $usetable = 0) } else { print ': '; } - if (is_object($object->user_creation)) { + if (! empty($object->user_creation) && is_object($object->user_creation)) { // deprecated mode if ($object->user_creation->id) { print $object->user_creation->getNomUrl(-1, '', 0, 0, 0); } else { diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index e2ec740ac66..2fec5697275 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -201,6 +201,7 @@ foreach (array('internal', 'external') as $source) { $entry->type = $contact['libelle']; $entry->nature = ""; $entry->nature_html = ""; + $entry->thirdparty_id = 0; $entry->thirdparty_html = ""; $entry->thirdparty_name = ""; $entry->contact_html = ""; diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index c129095017f..d614097cdc5 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -137,7 +137,7 @@ class InterfaceActionsAuto extends DolibarrTriggers // For merge event, we add a mention if (!empty($object->context['mergefromname'])) { - $object->actionmsg = dol_concatdesc($object->actionmsg, $langs->trans("DataFromWasMerged", $object->context['mergefromname'])); + $object->actionmsg = dol_concatdesc($object->actionmsg, $langs->trans("DataFromWasMerged", $object->context['mergefromname'].' (id='.$object->context['mergefromname'].')')); } $object->sendtoid = 0; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 14bd62e50f6..de2ebd90a55 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2144,7 +2144,7 @@ class CommandeFournisseur extends CommonOrder $this->line->total_localtax2 = $total_localtax2; $this->line->total_ttc = $total_ttc; $this->line->product_type = $type; - $this->line->special_code = (!empty($this->special_code) ? $this->special_code : 0); + $this->line->special_code = (!empty($special_code) ? $special_code : 0); $this->line->origin = $origin; $this->line->origin_id = $origin_id; $this->line->fk_unit = $fk_unit; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 1a8c9492605..8358056ddd8 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2439,3 +2439,5 @@ RecommendedForProduction=Recommended for Production RecommendedForDebug=Recommended for Debug UrlPublicInterfaceLabelAdmin=Alternative URL for public interface UrlPublicInterfaceHelpAdmin=It is possible to define an alias to the web server and thus make available the public interface with another URL (the virtual host server must act as a proxy on the standard URL) +ExportUseForce=Use the parameter -f +ExportUseForceHelp=Force to continue the export even when an error is found (Backup may not be reliable) diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index aaddd278084..38901ccf3a3 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -2,6 +2,7 @@ Mailing=EMailing EMailing=EMailing EMailings=EMailings +SMSings=SMSings AllEMailings=All eMailings MailCard=EMailing card MailRecipients=Recipients @@ -24,6 +25,7 @@ BodyNotIn=Not in Body ShowEMailing=Show emailing ListOfEMailings=List of emailings NewMailing=New emailing +NewSMSing=New smsing EditMailing=Edit emailing ResetMailing=Resend emailing DeleteMailing=Delete emailing diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 099db8e418c..89b7a974854 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -510,7 +510,7 @@ class Loan extends CommonObject $this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted"); } $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('Unpaid'); - $this->labelStatusShort[self::STATUS_PAID] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatusShort[self::STATUS_PAID] = $langs->transnoentitiesnoconv('Paid'); $this->labelStatusShort[self::STATUS_STARTED] = $langs->transnoentitiesnoconv("BillStatusStarted"); if ($status == 0 && $alreadypaid > 0) { $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted"); diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index a319904e63d..f907e1e5843 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -502,7 +502,7 @@ class MyObject extends CommonObject if (strpos($value, '%') === false) { $sqlwhere[] = $key . " = '" . $this->db->sanitize($this->db->escape($value)) . "'"; } else { - $sqlwhere[] = $key . " LIKE '%" . $this->db->escapeforlike($this->db->escape($value)) . "%'"; + $sqlwhere[] = $key . " LIKE '%" . $this->db->escape($this->db->escapeforlike($value)) . "%'"; } } } @@ -617,8 +617,8 @@ class MyObject extends CommonObject return 0; } - /* if (! ((!getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('mymodule','write')) - || (getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->myobject->myobject_advance->validate)))) + /* if (! ((!getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('mymodule', 'myobject', 'write')) + || (getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('mymodule', 'myobject_advance', 'validate'))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 17c832df13b..889804e87db 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -177,8 +177,8 @@ class modMyModule extends DolibarrModules // Array to add new pages in new tabs $this->tabs = array(); // Example: - // $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1 - // $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key. + // $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@mymodule:$user->hasRight('mymodule', 'read'):/mymodule/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1 + // $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->hasRight('othermodule', 'read'):/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key. // $this->tabs[] = array('data'=>'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname // // Where objecttype can be @@ -290,7 +290,7 @@ class modMyModule extends DolibarrModules $this->rights[$r][0] = $this->numero . sprintf("%02d", ($o * 10) + 3); // Permission id (must not be already used) $this->rights[$r][1] = 'Delete objects of MyModule'; // Permission label $this->rights[$r][4] = 'myobject'; - $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->mymodule->myobject->delete) + $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->hasRight('mymodule', 'myobject', 'delete')) $r++; */ /* END MODULEBUILDER PERMISSIONS */ diff --git a/htdocs/modulebuilder/template/mymoduleindex.php b/htdocs/modulebuilder/template/mymoduleindex.php index 59dbe92439d..f11670f0906 100644 --- a/htdocs/modulebuilder/template/mymoduleindex.php +++ b/htdocs/modulebuilder/template/mymoduleindex.php @@ -111,19 +111,16 @@ print '
'; /* BEGIN MODULEBUILDER DRAFT MYOBJECT // Draft MyObject -if (isModEnabled('mymodule') && $user->rights->mymodule->read) -{ +if (isModEnabled('mymodule') && $user->hasRight('mymodule', 'read')) { $langs->load("orders"); $sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas"; $sql.= ", s.code_client"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; - if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.fk_soc = s.rowid"; $sql.= " AND c.fk_statut = 0"; $sql.= " AND c.entity IN (".getEntity('commande').")"; - if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); if ($socid) $sql.= " AND c.fk_soc = ".((int) $socid); $resql = $db->query($sql); @@ -192,13 +189,10 @@ $max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT'); /* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT // Last modified myobject -if (isModEnabled('mymodule') && $user->rights->mymodule->read) -{ +if (isModEnabled('mymodule') && $user->hasRight('mymodule', 'read')) { $sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms"; $sql.= " FROM ".MAIN_DB_PREFIX."mymodule_myobject as s"; - //if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.entity IN (".getEntity($myobjectstatic->element).")"; - //if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); //if ($socid) $sql.= " AND s.rowid = $socid"; $sql .= " ORDER BY s.tms DESC"; $sql .= $db->plimit($max, 0); diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index 646a8406d06..074fc8cb44b 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -136,8 +136,8 @@ if ($id > 0 || !empty($ref)) { // Set $enablepermissioncheck to 1 to enable a minimum low level of checks $enablepermissioncheck = 0; if ($enablepermissioncheck) { - $permissiontoread = $user->rights->mymodule->myobject->read; - $permissiontoadd = $user->rights->mymodule->myobject->write; + $permissiontoread = $user->hasRight('mymodule', 'myobject', 'read'); + $permissiontoadd = $user->hasRight('mymodule', 'myobject', 'write'); } else { $permissiontoread = 1; $permissiontoadd = 1; diff --git a/htdocs/modulebuilder/template/myobject_contact.php b/htdocs/modulebuilder/template/myobject_contact.php index 93bd0cee267..f7669ae118d 100644 --- a/htdocs/modulebuilder/template/myobject_contact.php +++ b/htdocs/modulebuilder/template/myobject_contact.php @@ -83,8 +83,8 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ // Set $enablepermissioncheck to 1 to enable a minimum low level of checks $enablepermissioncheck = 0; if ($enablepermissioncheck) { - $permissiontoread = $user->rights->mymodule->myobject->read; - $permissiontoadd = $user->rights->mymodule->myobject->write; + $permissiontoread = $user->hasRight('mymodule', 'myobject', 'read'); + $permissiontoadd = $user->hasRight('mymodule', 'myobject', 'write'); } else { $permissiontoread = 1; $permissiontoadd = 1; diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index 19b1a7ceed3..5c36a559723 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -130,8 +130,8 @@ if ($id > 0 || !empty($ref)) { // Set $enablepermissioncheck to 1 to enable a minimum low level of checks $enablepermissioncheck = 0; if ($enablepermissioncheck) { - $permissiontoread = $user->rights->mymodule->myobject->read; - $permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php + $permissiontoread = $user->hasRight('mymodule', 'myobject', 'read'); + $permissiontoadd = $user->hasRight('mymodule', 'myobject', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php } else { $permissiontoread = 1; $permissiontoadd = 1; @@ -251,12 +251,7 @@ print '
'; print dol_get_fiche_end(); $modulepart = 'mymodule'; -//$permissiontoadd = $user->rights->mymodule->myobject->write; -$permissiontoadd = 1; -//$permtoedit = $user->rights->mymodule->myobject->write; -$permtoedit = 1; $param = '&id='.$object->id; - //$relativepathwithnofile='myobject/' . dol_sanitizeFileName($object->id).'/'; $relativepathwithnofile = 'myobject/'.dol_sanitizeFileName($object->ref).'/'; diff --git a/htdocs/modulebuilder/template/myobject_note.php b/htdocs/modulebuilder/template/myobject_note.php index ef4bde7ecf9..c0edbbeffae 100644 --- a/htdocs/modulebuilder/template/myobject_note.php +++ b/htdocs/modulebuilder/template/myobject_note.php @@ -108,9 +108,9 @@ if ($id > 0 || !empty($ref)) { // Set $enablepermissioncheck to 1 to enable a minimum low level of checks $enablepermissioncheck = 0; if ($enablepermissioncheck) { - $permissiontoread = $user->rights->mymodule->myobject->read; - $permissiontoadd = $user->rights->mymodule->myobject->write; - $permissionnote = $user->rights->mymodule->myobject->write; // Used by the include of actions_setnotes.inc.php + $permissiontoread = $user->hasRight('mymodule', 'myobject', 'read'); + $permissiontoadd = $user->hasRight('mymodule', 'myobject', 'write'); + $permissionnote = $user->hasRight('mymodule', 'myobject', 'write'); // Used by the include of actions_setnotes.inc.php } else { $permissiontoread = 1; $permissiontoadd = 1; diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index b0f66bf3e59..26d7986bdc6 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -432,9 +432,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_CANCELED) { if ($permissiontoadd) { if (getDolGlobalInt('INVENTORY_INCLUDE_SUB_WAREHOUSE') && !empty($object->fk_warehouse)) { - print ''.$langs->trans("Validate").' ('.$langs->trans("Start").')'; + print ''.$langs->trans("Validate").' ('.$langs->trans("ToStart").')'; } else { - print ''.$langs->trans("Validate").' ('.$langs->trans("Start").')'; + print ''.$langs->trans("Validate").' ('.$langs->trans("ToStart").')'; } } } diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index d568d1e18fd..7c3694669ef 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -334,7 +334,7 @@ if (!$ret) { print dol_get_fiche_head($head, 'resources', $langs->trans("Action"), -1, 'action'); - $linkback .= ''; + $linkback = ''; $linkback .= img_picto($langs->trans("BackToList"), 'object_calendarlist', 'class="pictoactionview pictofixedwidth"'); $linkback .= ''.$langs->trans("BackToList").''; $linkback .= ''; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index cfe55c80e12..e45ea6690c1 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -5080,10 +5080,11 @@ class Societe extends CommonObject } /** - * llx_societe_extrafields table must not be here because we don't care about the old thirdparty data - * Do not include llx_societe because it will be replaced later + * llx_societe_extrafields table must not be here because we don't care about the old thirdparty extrafields that are managed directly into mergeCompany. + * Do not include llx_societe because it will be replaced later. */ $tables = array( + 'societe_account', 'societe_commerciaux', 'societe_prices', 'societe_remise', @@ -5299,6 +5300,8 @@ class Societe extends CommonObject $error = 0; $soc_origin = new Societe($this->db); // The thirdparty that we will delete + dol_syslog("mergeCompany merge thirdparty id=".$soc_origin_id." (will be deleted) into the thirdparty id=".$this->id); + if (!$error && $soc_origin->fetch($soc_origin_id) < 1) { $this->error = $langs->trans('ErrorRecordNotFound'); $error++; diff --git a/htdocs/takepos/admin/appearance.php b/htdocs/takepos/admin/appearance.php index 3f58d23146b..2871f0ecf1e 100644 --- a/htdocs/takepos/admin/appearance.php +++ b/htdocs/takepos/admin/appearance.php @@ -63,8 +63,6 @@ if (GETPOST('action', 'alpha') == 'set') { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } -} elseif (GETPOST('action', 'alpha') == 'setmethod') { - dolibarr_set_const($db, "TAKEPOS_PRINT_METHOD", GETPOST('value', 'alpha'), 'chaine', 0, '', $conf->entity); } diff --git a/htdocs/takepos/admin/bar.php b/htdocs/takepos/admin/bar.php index 0c8f41fb237..4c822640e6a 100644 --- a/htdocs/takepos/admin/bar.php +++ b/htdocs/takepos/admin/bar.php @@ -126,13 +126,11 @@ if (getDolGlobalInt('TAKEPOS_BAR_RESTAURANT')) { print '
'; print "\n"; - //if (getDolGlobalString('TAKEPOS_PRINT_METHOD') != "browser") { // Why this ? print ''; print ''; if (getDolGlobalString('TAKEPOS_ORDER_PRINTERS')) { @@ -141,7 +139,6 @@ if (getDolGlobalInt('TAKEPOS_BAR_RESTAURANT')) { print ''; print ''; } /*else { diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index e049a2e7b60..453d0115797 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -281,7 +281,7 @@ if (isModEnabled("service")) { print '\n"; @@ -361,7 +361,7 @@ if (is_array($formmail->lines_model)) { } //var_dump($arraydefaultmessage); //var_dump($arrayofmessagename); -print $form->selectarray('TAKEPOS_EMAIL_TEMPLATE_INVOICE', $arrayofmessagename, $conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE, 'None', 1, 0, '', 0, 0, 0, '', '', 1); +print $form->selectarray('TAKEPOS_EMAIL_TEMPLATE_INVOICE', $arrayofmessagename, getDolGlobalString('TAKEPOS_EMAIL_TEMPLATE_INVOICE'), 'None', 1, 0, '', 0, 0, 0, '', 'maxwidth500 widthcentpercentminusx', 1); print "\n"; // Control cash box at opening pos diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 59a667f5e90..1caaa2d6630 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -96,6 +96,8 @@ if ($conf->browser->layout == 'phone') { $MAXCATEG = (!getDolGlobalString('TAKEPOS_NB_MAXCATEG') ? $maxcategbydefaultforthisdevice : $conf->global->TAKEPOS_NB_MAXCATEG); $MAXPRODUCT = (!getDolGlobalString('TAKEPOS_NB_MAXPRODUCT') ? $maxproductbydefaultforthisdevice : $conf->global->TAKEPOS_NB_MAXPRODUCT); +$term = empty($_SESSION['takeposterminal']) ? 1: $_SESSION['takeposterminal']; + /* $constforcompanyid = 'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]; $soc = new Societe($db); @@ -1340,7 +1342,7 @@ if (getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) { } else { $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'TakeposPrinting(placeid);'); } - } elseif (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { + } elseif ((isModEnabled('receiptprinter') && getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0) || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'DolibarrTakeposPrinting(placeid);'); } else { $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'Print(placeid);'); @@ -1357,7 +1359,7 @@ if (getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) { if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { $menus[$r++] = array('title'=>'
'.$langs->trans("DOL_OPEN_DRAWER").'
', 'action'=>'OpenDrawer();'); } -if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { +if (getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0 || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { $menus[$r++] = array( 'title' => '
'.$langs->trans("DOL_OPEN_DRAWER").'
', 'action' => 'DolibarrOpenDrawer();', diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 35f8737168a..7394a021106 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -157,6 +157,8 @@ if (isModEnabled('multicurrency') && !empty($_SESSION["takeposcustomercurrency"] } } +$term = empty($_SESSION["takeposterminal"]) ? 1 : $_SESSION["takeposterminal"]; + /* * Actions @@ -293,7 +295,7 @@ if (empty($reshook)) { if ($pay != "delayed") { $payment->create($user); - $payment->addPaymentToBank($user, 'payment', '(CustomerInvoicePayment)', $bankaccount, '', ''); + $res = $payment->addPaymentToBank($user, 'payment', '(CustomerInvoicePayment)', $bankaccount, '', ''); if ($res < 0) { $error++; dol_htmloutput_errors($langs->trans('ErrorNoPaymentDefined'), $payment->errors, 1); @@ -926,7 +928,7 @@ if (empty($reshook)) { if ($action == "order" && $placeid != 0 && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; - if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter" || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { + if ((isModEnabled('receiptprinter') && getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0) || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter" || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php'; $printer = new dolReceiptPrinter($db); } @@ -971,7 +973,7 @@ if (empty($reshook)) { $order_receipt_printer1 .= ''; } } - if ((getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter" || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") && $linestoprint > 0) { + if (((isModEnabled('receiptprinter') && getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0) || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter" || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") && $linestoprint > 0) { $invoice->fetch($placeid); //Reload object before send to printer $printer->orderprinter = 1; echo "
'.$langs->trans("TargetsStatistics").'
'.$langs->trans("TargetsStatistics").'
'.img_object('', $mailmodule->picto).' '.$obj->label.''.$obj->nb.''; + print ''.img_object('', $mailmodule->picto).' '.dol_escape_htmltag($obj->label).''.$obj->nb.''.(!empty($obj->title) ? dol_trunc($obj->title, 38) : '').''.dol_print_date($db->jdate($obj->date_creat), 'day').''.($obj->nbemail ? $obj->nbemail : "0").''.$mailstatic->LibStatut($obj->statut, 5).''.$mailstatic->LibStatut($obj->status, 5).'
'.$langs->trans("Document").''.$langs->trans("Paid").''.$langs->trans("TotalHT").(isModEnabled('multicurrency') ? ' ('.$langs->getCurrencySymbol($conf->currency).')' : '').''.$langs->trans("TotalTTC").(isModEnabled('multicurrency') ? ' ('.$langs->getCurrencySymbol($conf->currency).')' : '').''.$langs->trans("TotalVAT").(isModEnabled('multicurrency') ? ' ('.$langs->getCurrencySymbol($conf->currency).')' : '').''.$langs->trans("Document").''.$langs->trans("Paid").''.$langs->trans("TotalHT").(isModEnabled('multicurrency') ? ' ('.$langs->getCurrencySymbol($conf->currency).')' : '').''.$langs->trans("TotalTTC").(isModEnabled('multicurrency') ? ' ('.$langs->getCurrencySymbol($conf->currency).')' : '').''.$langs->trans("TotalVAT").(isModEnabled('multicurrency') ? ' ('.$langs->getCurrencySymbol($conf->currency).')' : '').''.$langs->trans("ThirdParty").''.$langs->trans("Code").''.$langs->trans("Country").''.$langs->trans("VATIntra").''.$langs->trans("ThirdParty").''.$langs->trans("Code").''.$langs->trans("Country").''.$langs->trans("VATIntra").''.$langs->trans("Currency").''.$langs->trans("Currency").'
'.($data['paid'] ? yn($data['paid']) : '').''.price(price2num($data['sens'] ? $data['amount_ht'] : -$data['amount_ht'], 'MT'))."'.price(price2num($data['sens'] ? $data['amount_ht'] : -$data['amount_ht'], 'MT'))."'; + print ''; $tooltip = $langs->trans("TotalVAT").' : '.price(price2num($data['sens'] ? $data['amount_vat'] : -$data['amount_vat'], 'MT')); if (!empty($data['amount_localtax1'])) { $tooltip .= '
'.$langs->transcountrynoentities("TotalLT1", $mysoc->country_code).' : '.price(price2num($data['sens'] ? $data['amount_localtax1'] : -$data['amount_localtax1'], 'MT')); @@ -878,7 +878,7 @@ if (!empty($date_start) && !empty($date_stop)) { print ''.price(price2num($data['sens'] ? $data['amount_ttc'] : -$data['amount_ttc'], 'MT')).''; print "
'.price(price2num($data['sens'] ? $data['amount_vat'] : -$data['amount_vat'], 'MT'))."'.price(price2num($data['sens'] ? $data['amount_vat'] : -$data['amount_vat'], 'MT'))."'.dol_escape_htmltag($data['thirdparty_name'])."
'.$langs->trans('Total').' '.$langs->trans('Income').''.price(price2num($totalET_credit, 'MT')).''.price(price2num($totalIT_credit, 'MT')).''.price(price2num($totalVAT_credit, 'MT')).''.price(price2num($totalET_credit, 'MT')).''.price(price2num($totalIT_credit, 'MT')).''.price(price2num($totalVAT_credit, 'MT')).'
'.$langs->trans('Total').' '.$langs->trans('Outcome').''.price(price2num($totalET_debit, 'MT')).''.price(price2num($totalIT_debit, 'MT')).''.price(price2num($totalVAT_debit, 'MT')).''.price(price2num($totalET_debit, 'MT')).''.price(price2num($totalIT_debit, 'MT')).''.price(price2num($totalVAT_debit, 'MT')).'
'.$langs->trans('Total').''.price(price2num($totalET_credit + $totalET_debit, 'MT')).''.price(price2num($totalIT_credit + $totalIT_debit, 'MT')).''.price(price2num($totalVAT_credit + $totalVAT_debit, 'MT')).''.price(price2num($totalET_credit + $totalET_debit, 'MT')).''.price(price2num($totalIT_credit + $totalIT_debit, 'MT')).''.price(price2num($totalVAT_credit + $totalVAT_debit, 'MT')).''; - print ''; print ''; print ''; print ''.$langs->trans("Parameters").''.$langs->trans("Value").'
'; print $langs->trans("OrderPrinters").' ('.$langs->trans("Setup").')'; print ''; print ajax_constantonoff("TAKEPOS_ORDER_PRINTERS", array(), $conf->entity, 0, 0, 1, 0); - //print $form->selectyesno("TAKEPOS_ORDER_PRINTERS", $conf->global->TAKEPOS_ORDER_PRINTERS, 1); print '
'; print ajax_constantonoff("TAKEPOS_ORDER_NOTES", array(), $conf->entity, 0, 0, 1, 0); - //print $form->selectyesno("TAKEPOS_ORDER_NOTES", $conf->global->TAKEPOS_ORDER_NOTES, 1); print '
'; print $form->textwithpicto($langs->trans("RootCategoryForProductsToSell"), $langs->trans("RootCategoryForProductsToSellDesc")); print ''; -print img_object('', 'category', 'class="paddingright"').$form->select_all_categories(Categorie::TYPE_PRODUCT, getDolGlobalInt('TAKEPOS_ROOT_CATEGORY_ID'), 'TAKEPOS_ROOT_CATEGORY_ID', 64, 0, 0, 0, 'widthcentpercentminusx'); +print img_object('', 'category', 'class="paddingright"').$form->select_all_categories(Categorie::TYPE_PRODUCT, getDolGlobalInt('TAKEPOS_ROOT_CATEGORY_ID'), 'TAKEPOS_ROOT_CATEGORY_ID', 64, 0, 0, 0, 'maxwidth500 widthcentpercentminusx'); print ajax_combobox('TAKEPOS_ROOT_CATEGORY_ID'); print "