diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 2aed109ce26..ff69fbc688b 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -719,7 +719,7 @@ if (count($sqlwhere) > 0) { // Export into a file with format defined into setup (FEC, CSV, ...) // Must be after definition of $sql if ($action == 'export_fileconfirm' && $user->hasRight('accounting', 'mouvements', 'export')) { - // TODO Replace the fetchAll to get all ->line followed by call to ->export(). It consumes too much memory on large export. + // TODO Replace the fetchAll to get all ->line followed by call to ->export(). It currently consumes too much memory on large export. // Replace this with the query($sql) and loop on each line to export them. $result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', (empty($conf->global->ACCOUNTING_REEXPORT) ? 0 : 1)); @@ -856,6 +856,15 @@ $formconfirm = ''; if ($action == 'export_file') { $form_question = array(); + $form_question['notexportlettering'] = array( + 'name' => 'notexportlettering', + 'type' => 'other', + 'label' => '', // TODO Use Selectmodelcsv and show a select combo + 'value' => $langs->trans('Modelcsv').' : '.$listofformat[$formatexportset].'' + ); + + $form_question['separator0'] = array('name'=>'separator0', 'type'=>'separator'); + if (getDolGlobalInt("ACCOUNTING_ENABLE_LETTERING")) { // If 1, we check by default. $checked = !empty($conf->global->ACCOUNTING_DEFAULT_NOT_EXPORT_LETTERING) ? 'true' : 'false'; @@ -866,7 +875,7 @@ if ($action == 'export_file') { 'value' => $checked, ); - $form_question['separator'] = array('name'=>'separator', 'type'=>'separator'); + $form_question['separator1'] = array('name'=>'separator1', 'type'=>'separator'); } // If 1 or not set, we check by default. @@ -903,7 +912,7 @@ if ($action == 'export_file') { ); } - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 400, 600); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").'...', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 420, 600); } //if ($action == 'delbookkeepingyear') { @@ -1362,7 +1371,7 @@ while ($i < min($num, $limit)) { $accountingjournal = new AccountingJournal($db); $result = $accountingjournal->fetch('', $line->code_journal); $journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0, '', 0) : $line->code_journal); - print ''.$journaltoshow.''; + print ''.$journaltoshow.''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index ed51a2aea5e..b725cafdacd 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -1177,7 +1177,9 @@ class AccountancyExport print $line->code_journal . $separator; // FEC:JournalLib - print dol_string_unaccent($langs->transnoentities($line->journal_label)) . $separator; + $labeljournal = dol_string_unaccent($langs->transnoentities($line->journal_label)); + $labeljournal = dol_string_nospecial($labeljournal, ' '); + print $labeljournal . $separator; // FEC:EcritureNum print $line->piece_num . $separator; @@ -1308,7 +1310,9 @@ class AccountancyExport print $line->code_journal . $separator; // FEC:JournalLib - print dol_string_unaccent($langs->transnoentities($line->journal_label)) . $separator; + $labeljournal = dol_string_unaccent($langs->transnoentities($line->journal_label)); + $labeljournal = dol_string_nospecial($labeljournal, ' '); + print $labeljournal . $separator; // FEC:EcritureNum print $line->piece_num . $separator; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 8cabb3d3215..3261da47160 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1192,7 +1192,7 @@ if ($action == 'create') { print ''; print ''; if ($backtopage) { - print ''; + print ''; } if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) { print ''; @@ -1722,7 +1722,7 @@ if ($id > 0) { print ''; print ''; if ($backtopage) { - print ''; + print ''; } if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && ! preg_match('/^TICKET_MSG_PRIVATE/', $object->code)) { print ''; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index b300e8cc293..282718b219b 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -548,7 +548,7 @@ if ($object->fetch($id) >= 0) { $massactionbutton = ''; - print_barre_liste($langs->trans("MailSelectedRecipients"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $morehtmlcenter, $num, $nbtotalofrecords, 'generic', 0, '', '', $limit); + print_barre_liste($langs->trans("MailSelectedRecipients"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $morehtmlcenter, $num, $nbtotalofrecords, 'generic', 0, '', '', $limit, 0, 0, 1); print ''; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 4c3728e4a00..9437bbf0a92 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1396,6 +1396,9 @@ if (empty($reshook)) { $date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); $remise_percent = price2num(GETPOST('remise_percent'), '', 2); + if (empty($remise_percent)) { + $remise_percent = 0; + } // Prepare a price equivalent for minimum price check $pu_equivalent = $pu_ht; diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index ab8a30455ff..624fe5766d2 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -190,7 +190,7 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO $tmparray[] = trim(GETPOST('sendto', 'alphawithlgt')); } - if (trim($_POST['tomail'])) { + if (isset($_POST['tomail']) && trim($_POST['tomail'])) { // Recipients are provided into free hidden text field $tmparray[] = trim(GETPOST('tomail', 'alphawithlgt')); } diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php index b3f3504cee8..f400ae6fb3d 100644 --- a/htdocs/core/boxes/box_members_by_type.php +++ b/htdocs/core/boxes/box_members_by_type.php @@ -80,7 +80,7 @@ class box_members_by_type extends ModeleBoxes public function loadBox($max = 5) { global $user, $langs, $conf; - $langs->load("boxes"); + $langs->loadLangs(array("boxes", "members")); $this->max = $max; @@ -284,7 +284,7 @@ class box_members_by_type extends ModeleBoxes if ($num == 0) { $this->info_box_contents[$line][0] = array( - 'td' => 'class="center"', + 'td' => 'colspan="7" class="center"', 'text' => $langs->trans("NoRecordedMembersByType") ); } else { diff --git a/htdocs/core/boxes/box_members_subscriptions_by_year.php b/htdocs/core/boxes/box_members_subscriptions_by_year.php index 228ba016ceb..6c3a8b54f7a 100644 --- a/htdocs/core/boxes/box_members_subscriptions_by_year.php +++ b/htdocs/core/boxes/box_members_subscriptions_by_year.php @@ -79,7 +79,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes public function loadBox($max = 5) { global $user, $langs, $conf; - $langs->load("boxes"); + $langs->loadLangs(array("boxes", "members")); $this->max = $max; @@ -191,7 +191,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes if ($num == 0) { $this->info_box_contents[$line][0] = array( - 'td' => 'class="left" colspan="4"', + 'td' => 'colspan="4"', 'text' => $langs->trans("NoRecordedMembers"), ); } else { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a0c049e363f..74d7e1eaf85 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5168,7 +5168,7 @@ class Form $formquestion[] = array('name'=>$input['name'].'year'); $formquestion[] = array('name'=>$input['name'].'hour'); $formquestion[] = array('name'=>$input['name'].'min'); - } elseif ($input['type'] == 'other') { + } elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not $more .= '
'; if (!empty($input['label'])) { $more .= $input['label'].'
'; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index c29eec57698..95cfcfaf75b 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2590,54 +2590,54 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $original_file = $conf->adherent->dir_output.'/'.$original_file; } elseif ($modulepart == 'apercufacture' && !empty($conf->facture->multidir_output[$entity])) { // Wrapping for invoices (user need permission to read invoices) - if ($fuser->rights->facture->{$lire}) { + if ($fuser->hasRight('facture', $lire)) { $accessallowed = 1; } $original_file = $conf->facture->multidir_output[$entity].'/'.$original_file; } elseif ($modulepart == 'apercupropal' && !empty($conf->propal->multidir_output[$entity])) { // Wrapping pour les apercu propal - if ($fuser->rights->propal->{$lire}) { + if ($fuser->hasRight('propal', $lire)) { $accessallowed = 1; } $original_file = $conf->propal->multidir_output[$entity].'/'.$original_file; } elseif ($modulepart == 'apercucommande' && !empty($conf->commande->multidir_output[$entity])) { // Wrapping pour les apercu commande - if ($fuser->rights->commande->{$lire}) { + if ($fuser->hasRight('commande', $lire)) { $accessallowed = 1; } $original_file = $conf->commande->multidir_output[$entity].'/'.$original_file; } elseif (($modulepart == 'apercufichinter' || $modulepart == 'apercuficheinter') && !empty($conf->ficheinter->dir_output)) { // Wrapping pour les apercu intervention - if ($fuser->rights->ficheinter->{$lire}) { + if ($fuser->hasRight('ficheinter', $lire)) { $accessallowed = 1; } $original_file = $conf->ficheinter->dir_output.'/'.$original_file; } elseif (($modulepart == 'apercucontract') && !empty($conf->contrat->multidir_output[$entity])) { // Wrapping pour les apercu contrat - if ($fuser->rights->contrat->{$lire}) { + if ($fuser->hasRight('contrat', $lire)) { $accessallowed = 1; } $original_file = $conf->contrat->multidir_output[$entity].'/'.$original_file; } elseif (($modulepart == 'apercusupplier_proposal' || $modulepart == 'apercusupplier_proposal') && !empty($conf->supplier_proposal->dir_output)) { // Wrapping pour les apercu supplier proposal - if ($fuser->rights->supplier_proposal->{$lire}) { + if ($fuser->hasRight('supplier_proposal', $lire)) { $accessallowed = 1; } $original_file = $conf->supplier_proposal->dir_output.'/'.$original_file; } elseif (($modulepart == 'apercusupplier_order' || $modulepart == 'apercusupplier_order') && !empty($conf->fournisseur->commande->dir_output)) { // Wrapping pour les apercu supplier order - if ($fuser->rights->fournisseur->commande->{$lire}) { + if ($fuser->hasRight('fournisseur', 'commande', $lire)) { $accessallowed = 1; } $original_file = $conf->fournisseur->commande->dir_output.'/'.$original_file; } elseif (($modulepart == 'apercusupplier_invoice' || $modulepart == 'apercusupplier_invoice') && !empty($conf->fournisseur->facture->dir_output)) { // Wrapping pour les apercu supplier invoice - if ($fuser->rights->fournisseur->facture->{$lire}) { + if ($fuser->hasRight('fournisseur', $lire)) { $accessallowed = 1; } $original_file = $conf->fournisseur->facture->dir_output.'/'.$original_file; } elseif (($modulepart == 'holiday') && !empty($conf->holiday->dir_output)) { - if ($fuser->rights->holiday->{$read} || !empty($fuser->rights->holiday->readall) || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('holiday', $read) || !empty($fuser->rights->holiday->readall) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; // If we known $id of holiday, call checkUserAccessToObject to check permission on properties and hierarchy of leave request if ($refname && empty($fuser->rights->holiday->readall) && !preg_match('/^specimen/i', $original_file)) { @@ -2649,7 +2649,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, } $original_file = $conf->holiday->dir_output.'/'.$original_file; } elseif (($modulepart == 'expensereport') && !empty($conf->expensereport->dir_output)) { - if ($fuser->rights->expensereport->{$lire} || !empty($fuser->rights->expensereport->readall) || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('expensereport', $lire) || !empty($fuser->rights->expensereport->readall) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; // If we known $id of expensereport, call checkUserAccessToObject to check permission on properties and hierarchy of expense report if ($refname && empty($fuser->rights->expensereport->readall) && !preg_match('/^specimen/i', $original_file)) { @@ -2662,72 +2662,72 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $original_file = $conf->expensereport->dir_output.'/'.$original_file; } elseif (($modulepart == 'apercuexpensereport') && !empty($conf->expensereport->dir_output)) { // Wrapping pour les apercu expense report - if ($fuser->rights->expensereport->{$lire}) { + if ($fuser->hasRight('expensereport', $lire)) { $accessallowed = 1; } $original_file = $conf->expensereport->dir_output.'/'.$original_file; } elseif ($modulepart == 'propalstats' && !empty($conf->propal->multidir_temp[$entity])) { // Wrapping pour les images des stats propales - if ($fuser->rights->propal->{$lire}) { + if ($fuser->hasRight('propal', $lire)) { $accessallowed = 1; } $original_file = $conf->propal->multidir_temp[$entity].'/'.$original_file; } elseif ($modulepart == 'orderstats' && !empty($conf->commande->dir_temp)) { // Wrapping pour les images des stats commandes - if ($fuser->rights->commande->{$lire}) { + if ($fuser->hasRight('commande', $lire)) { $accessallowed = 1; } $original_file = $conf->commande->dir_temp.'/'.$original_file; } elseif ($modulepart == 'orderstatssupplier' && !empty($conf->fournisseur->dir_output)) { - if ($fuser->rights->fournisseur->commande->{$lire}) { + if ($fuser->hasRight('fournisseur', 'commande', $lire)) { $accessallowed = 1; } $original_file = $conf->fournisseur->commande->dir_temp.'/'.$original_file; } elseif ($modulepart == 'billstats' && !empty($conf->facture->dir_temp)) { // Wrapping pour les images des stats factures - if ($fuser->rights->facture->{$lire}) { + if ($fuser->hasRight('facture', $lire)) { $accessallowed = 1; } $original_file = $conf->facture->dir_temp.'/'.$original_file; } elseif ($modulepart == 'billstatssupplier' && !empty($conf->fournisseur->dir_output)) { - if ($fuser->rights->fournisseur->facture->{$lire}) { + if ($fuser->hasRight('fournisseur', 'facture', $lire)) { $accessallowed = 1; } $original_file = $conf->fournisseur->facture->dir_temp.'/'.$original_file; } elseif ($modulepart == 'expeditionstats' && !empty($conf->expedition->dir_temp)) { // Wrapping pour les images des stats expeditions - if ($fuser->rights->expedition->{$lire}) { + if ($fuser->hasRight('expedition', $lire)) { $accessallowed = 1; } $original_file = $conf->expedition->dir_temp.'/'.$original_file; } elseif ($modulepart == 'tripsexpensesstats' && !empty($conf->deplacement->dir_temp)) { // Wrapping pour les images des stats expeditions - if ($fuser->rights->deplacement->{$lire}) { + if ($fuser->hasRight('deplacement', $lire)) { $accessallowed = 1; } $original_file = $conf->deplacement->dir_temp.'/'.$original_file; } elseif ($modulepart == 'memberstats' && !empty($conf->adherent->dir_temp)) { // Wrapping pour les images des stats expeditions - if ($fuser->rights->adherent->{$lire}) { + if ($fuser->hasRight('adherent', $lire)) { $accessallowed = 1; } $original_file = $conf->adherent->dir_temp.'/'.$original_file; } elseif (preg_match('/^productstats_/i', $modulepart) && !empty($conf->product->dir_temp)) { // Wrapping pour les images des stats produits - if ($fuser->rights->produit->{$lire} || $fuser->rights->service->{$lire}) { + if ($fuser->hasRight('produit', $lire) || $fuser->hasRight('service', $lire)) { $accessallowed = 1; } $original_file = (!empty($conf->product->multidir_temp[$entity]) ? $conf->product->multidir_temp[$entity] : $conf->service->multidir_temp[$entity]).'/'.$original_file; } elseif (in_array($modulepart, array('tax', 'tax-vat', 'tva')) && !empty($conf->tax->dir_output)) { // Wrapping for taxes - if ($fuser->rights->tax->charges->{$lire}) { + if ($fuser->hasRight('tax', 'charges', $lire)) { $accessallowed = 1; } $modulepartsuffix = str_replace('tax-', '', $modulepart); $original_file = $conf->tax->dir_output.'/'.($modulepartsuffix != 'tax' ? $modulepartsuffix.'/' : '').$original_file; } elseif ($modulepart == 'actions' && !empty($conf->agenda->dir_output)) { // Wrapping for events - if ($fuser->rights->agenda->myactions->{$read}) { + if ($fuser->hasRight('agenda', 'myactions', $read)) { $accessallowed = 1; // If we known $id of project, call checkUserAccessToObject to check permission on the given agenda event on properties and assigned users if ($refname && !preg_match('/^specimen/i', $original_file)) { @@ -2811,85 +2811,85 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if (empty($entity) || empty($conf->societe->multidir_output[$entity])) { return array('accessallowed'=>0, 'error'=>'Value entity must be provided'); } - if ($fuser->rights->societe->{$lire}) { + if ($fuser->hasRight('societe', $lire)) { $accessallowed = 1; } $original_file = $conf->societe->multidir_output[$entity].'/contact/'.$original_file; } elseif (($modulepart == 'facture' || $modulepart == 'invoice') && !empty($conf->facture->multidir_output[$entity])) { // Wrapping for invoices - if ($fuser->rights->facture->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('facture', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->facture->multidir_output[$entity].'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('invoice').")"; } elseif ($modulepart == 'massfilesarea_proposals' && !empty($conf->propal->multidir_output[$entity])) { // Wrapping for mass actions - if ($fuser->rights->propal->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('propal', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->propal->multidir_output[$entity].'/temp/massgeneration/'.$user->id.'/'.$original_file; } elseif ($modulepart == 'massfilesarea_orders') { - if ($fuser->rights->commande->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('commande', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->commande->multidir_output[$entity].'/temp/massgeneration/'.$user->id.'/'.$original_file; } elseif ($modulepart == 'massfilesarea_sendings') { - if ($fuser->rights->expedition->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('expedition', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->expedition->dir_output.'/sending/temp/massgeneration/'.$user->id.'/'.$original_file; } elseif ($modulepart == 'massfilesarea_invoices') { - if ($fuser->rights->facture->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('facture', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->facture->multidir_output[$entity].'/temp/massgeneration/'.$user->id.'/'.$original_file; } elseif ($modulepart == 'massfilesarea_expensereport') { - if ($fuser->rights->facture->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('facture', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->expensereport->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file; } elseif ($modulepart == 'massfilesarea_interventions') { - if ($fuser->rights->ficheinter->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('ficheinter', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->ficheinter->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file; } elseif ($modulepart == 'massfilesarea_supplier_proposal' && !empty($conf->supplier_proposal->dir_output)) { - if ($fuser->rights->supplier_proposal->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('supplier_proposal', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->supplier_proposal->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file; } elseif ($modulepart == 'massfilesarea_supplier_order') { - if ($fuser->rights->fournisseur->commande->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('fournisseur', 'commande', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->fournisseur->commande->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file; } elseif ($modulepart == 'massfilesarea_supplier_invoice') { - if ($fuser->rights->fournisseur->facture->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('fournisseur', 'facture', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->fournisseur->facture->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file; } elseif ($modulepart == 'massfilesarea_contract' && !empty($conf->contrat->dir_output)) { - if ($fuser->rights->contrat->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('contrat', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->contrat->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file; } elseif (($modulepart == 'fichinter' || $modulepart == 'ficheinter') && !empty($conf->ficheinter->dir_output)) { // Wrapping for interventions - if ($fuser->rights->ficheinter->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('ficheinter', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->ficheinter->dir_output.'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; } elseif ($modulepart == 'deplacement' && !empty($conf->deplacement->dir_output)) { // Wrapping pour les deplacements et notes de frais - if ($fuser->rights->deplacement->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('deplacement', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->deplacement->dir_output.'/'.$original_file; //$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; - } elseif (($modulepart == 'propal' || $modulepart == 'propale') && !empty($conf->propal->multidir_output[$entity])) { + } elseif (($modulepart == 'propal' || $modulepart == 'propale') && isset($conf->propal->multidir_output[$entity])) { // Wrapping pour les propales - if ($fuser->rights->propal->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('propal', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->propal->multidir_output[$entity].'/'.$original_file; @@ -2903,7 +2903,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."commande WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('order').")"; } elseif ($modulepart == 'project' && !empty($conf->project->dir_output)) { // Wrapping pour les projets - if ($fuser->rights->projet->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('projet', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; // If we known $id of project, call checkUserAccessToObject to check permission on properties and contact of project if ($refname && !preg_match('/^specimen/i', $original_file)) { @@ -2916,7 +2916,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $original_file = $conf->project->dir_output.'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project').")"; } elseif ($modulepart == 'project_task' && !empty($conf->project->dir_output)) { - if ($fuser->rights->projet->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('projet', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; // If we known $id of project, call checkUserAccessToObject to check permission on properties and contact of project if ($refname && !preg_match('/^specimen/i', $original_file)) { @@ -2951,7 +2951,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."paiementfournisseur WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; } elseif ($modulepart == 'facture_paiement' && !empty($conf->facture->dir_output)) { // Wrapping pour les rapport de paiements - if ($fuser->rights->facture->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('facture', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } if ($fuser->socid > 0) { @@ -2967,26 +2967,26 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $original_file = $conf->accounting->dir_output.'/'.$original_file; } elseif (($modulepart == 'expedition' || $modulepart == 'shipment') && !empty($conf->expedition->dir_output)) { // Wrapping pour les expedition - if ($fuser->rights->expedition->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('expedition', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->expedition->dir_output."/".(strpos('sending/', $original_file) === 0 ? '' : 'sending/').$original_file; //$original_file = $conf->expedition->dir_output."/".$original_file; } elseif (($modulepart == 'livraison' || $modulepart == 'delivery') && !empty($conf->expedition->dir_output)) { // Delivery Note Wrapping - if ($fuser->rights->expedition->delivery->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('expedition', 'delivery', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->expedition->dir_output."/".(strpos('receipt/', $original_file) === 0 ? '' : 'receipt/').$original_file; } elseif ($modulepart == 'actions' && !empty($conf->agenda->dir_output)) { // Wrapping pour les actions - if ($fuser->rights->agenda->myactions->{$read} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('agenda', 'myactions', $read) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->agenda->dir_output.'/'.$original_file; } elseif ($modulepart == 'actionsreport' && !empty($conf->agenda->dir_temp)) { // Wrapping pour les actions - if ($fuser->rights->agenda->allactions->{$read} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('agenda', 'allactions', $read) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->agenda->dir_temp."/".$original_file; @@ -2995,7 +2995,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if (empty($entity) || (empty($conf->product->multidir_output[$entity]) && empty($conf->service->multidir_output[$entity]))) { return array('accessallowed'=>0, 'error'=>'Value entity must be provided'); } - if (($fuser->rights->produit->{$lire} || $fuser->rights->service->{$lire}) || preg_match('/^specimen/i', $original_file)) { + if (($fuser->hasRight('produit', $lire) || $fuser->hasRight('service', $lire)) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } if (isModEnabled("product")) { @@ -3008,7 +3008,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if (empty($entity) || (empty($conf->productbatch->multidir_output[$entity]))) { return array('accessallowed'=>0, 'error'=>'Value entity must be provided'); } - if (($fuser->rights->produit->{$lire} ) || preg_match('/^specimen/i', $original_file)) { + if (($fuser->hasRight('produit', $lire)) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } if (isModEnabled('productbatch')) { @@ -3019,7 +3019,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if (empty($entity) || empty($conf->stock->multidir_output[$entity])) { return array('accessallowed'=>0, 'error'=>'Value entity must be provided'); } - if (($fuser->rights->stock->{$lire} || $fuser->rights->stock->movement->{$lire} || $fuser->rights->stock->mouvement->{$lire}) || preg_match('/^specimen/i', $original_file)) { + if (($fuser->hasRight('stock', $lire) || $fuser->hasRight('stock', 'movement', $lire) || $fuser->hasRight('stock', 'mouvement', $lire)) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } if (isModEnabled('stock')) { @@ -3034,26 +3034,26 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."contrat WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('contract').")"; } elseif ($modulepart == 'donation' && !empty($conf->don->dir_output)) { // Wrapping pour les dons - if ($fuser->rights->don->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('don', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->don->dir_output.'/'.$original_file; } elseif ($modulepart == 'dolresource' && !empty($conf->resource->dir_output)) { // Wrapping pour les dons - if ($fuser->rights->resource->{$read} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('resource', $read) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->resource->dir_output.'/'.$original_file; } elseif (($modulepart == 'remisecheque' || $modulepart == 'chequereceipt') && !empty($conf->bank->dir_output)) { // Wrapping pour les remises de cheques - if ($fuser->rights->banque->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('banque', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->bank->dir_output.'/checkdeposits/'.$original_file; // original_file should contains relative path so include the get_exdir result } elseif (($modulepart == 'banque' || $modulepart == 'bank') && !empty($conf->bank->dir_output)) { // Wrapping for bank - if ($fuser->rights->banque->{$lire}) { + if ($fuser->hasRight('banque', $lire)) { $accessallowed = 1; } $original_file = $conf->bank->dir_output.'/'.$original_file; @@ -3096,7 +3096,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $original_file = $conf->bittorrent->dir_output.'/'.$dir.'/'.$original_file; } elseif ($modulepart == 'member' && !empty($conf->adherent->dir_output)) { // Wrapping pour Foundation module - if ($fuser->rights->adherent->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('adherent', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->adherent->dir_output.'/'.$original_file; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7c02eda4799..4fa2b7a9124 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -11605,7 +11605,7 @@ function forgeSQLFromUniversalSearchCriteria($filter, &$error = '') return '1 = 3'; // Bad syntax of the search string, we force a SQL not found } - return " AND (".preg_replace_callback('/'.$regexstring.'/', 'dolForgeCriteriaCallback', $filter).")"; + return " AND (".preg_replace_callback('/'.$regexstring.'/i', 'dolForgeCriteriaCallback', $filter).")"; } /** diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index e4f6b169e93..e69051ad9e4 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -2510,6 +2510,8 @@ function pdf_getSizeForImage($realpath) $maxheight = (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_HEIGHT) ? 32 : $conf->global->MAIN_DOCUMENTS_WITH_PICTURE_HEIGHT); include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; $tmp = dol_getImageSize($realpath); + $width = 0; + $height = 0; if ($tmp['height']) { $width = (int) round($maxheight * $tmp['width'] / $tmp['height']); // I try to use maxheight if ($width > $maxwidth) { // Pb with maxheight, so i use maxwidth diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 16906c95f86..96fdb779b0b 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -104,7 +104,7 @@ class modProduct extends DolibarrModules // Boxes $this->boxes = array( 0=>array('file'=>'box_produits.php', 'enabledbydefaulton'=>'Home'), - 1=>array('file'=>'box_produits_alerte_stock.php', 'enabledbydefaulton'=>''), + 1=>array('file'=>'box_produits_alerte_stock.php', 'enabledbydefaulton'=>'Home'), 2=>array('file'=>'box_graph_product_distribution.php', 'enabledbydefaulton'=>'Home') ); diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index e1cafba1ff1..bd76ca7bbc3 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -1793,8 +1793,8 @@ class FichinterLigne extends CommonObjectLine $sql = "UPDATE ".MAIN_DB_PREFIX."fichinter"; $sql .= " SET duree = ".((int) $total_duration); - $sql .= " , dateo = ".(!empty($obj->dateo) ? "'".$this->db->idate($obj->dateo)."'" : "null"); - $sql .= " , datee = ".(!empty($obj->datee) ? "'".$this->db->idate($obj->datee)."'" : "null"); + $sql .= " , dateo = ".(!empty($obj->dateo) ? "'".$this->db->escape($obj->dateo)."'" : "null"); + $sql .= " , datee = ".(!empty($obj->datee) ? "'".$this->db->escape($obj->datee)."'" : "null"); $sql .= " WHERE rowid = ".((int) $this->fk_fichinter); dol_syslog("FichinterLigne::update_total", LOG_DEBUG); diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index b87c9fc4955..75ac513a110 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -167,9 +167,9 @@ ACCOUNTANCY_COMBO_FOR_AUX=Enable combo list for subsidiary account (may be slow ACCOUNTING_DATE_START_BINDING=Define a date to start binding & transfer in accountancy. Below this date, the transactions will not be transferred to accounting. ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER=On accountancy transfer, what is the period selected by default -ACCOUNTING_SELL_JOURNAL=Sales journal (sales and returns) -ACCOUNTING_PURCHASE_JOURNAL=Purchase journal (purchase and returns) -ACCOUNTING_BANK_JOURNAL=Cash journal (receipts and disbursements) +ACCOUNTING_SELL_JOURNAL=Sales journal - sales and returns +ACCOUNTING_PURCHASE_JOURNAL=Purchase journal - purchase and returns +ACCOUNTING_BANK_JOURNAL=Cash journal - receipts and disbursements ACCOUNTING_EXPENSEREPORT_JOURNAL=Expense report journal ACCOUNTING_MISCELLANEOUS_JOURNAL=General journal ACCOUNTING_HAS_NEW_JOURNAL=Has new Journal @@ -238,6 +238,7 @@ ConfirmDeleteMvt=This will delete all lines in accountancy for the year/month an ConfirmDeleteMvtPartial=This will delete the transaction from the accounting (all lines related to the same transaction will be deleted) FinanceJournal=Finance journal ExpenseReportsJournal=Expense reports journal +InventoryJournal=Inventory journal DescFinanceJournal=Finance journal including all the types of payments by bank account DescJournalOnlyBindedVisible=This is a view of record that are bound to an accounting account and can be recorded into the Journals and Ledger. VATAccountNotDefined=Account for VAT not defined diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index b0237c5578b..78cc1d43820 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -4,6 +4,8 @@ MemberCard=Member card SubscriptionCard=Subscription card Member=Member Members=Members +NoRecordedMembers=No recorded members +NoRecordedMembersByType=No recorded members ShowMember=Show member card UserNotLinkedToMember=User not linked to a member ThirdpartyNotLinkedToMember=Third party not linked to a member diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 52c4731f6a2..e347f05b6bf 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -422,7 +422,7 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll // Example : Adding jquery code // print '