diff --git a/dev/build/generate_filelist_xml.php b/dev/build/generate_filelist_xml.php index 13c07c7da19..547304bb96c 100755 --- a/dev/build/generate_filelist_xml.php +++ b/dev/build/generate_filelist_xml.php @@ -37,7 +37,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') { exit(1); } -require_once $path."../htdocs/master.inc.php"; +require_once $path."../../htdocs/master.inc.php"; require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"; diff --git a/dev/build/makepack-dolibarr.pl b/dev/build/makepack-dolibarr.pl index 7afc0e4e81f..b0275739aa3 100755 --- a/dev/build/makepack-dolibarr.pl +++ b/dev/build/makepack-dolibarr.pl @@ -377,6 +377,7 @@ if ($nboftargetok) { $TMPBUILDTOCHECKCHANGELOG=$BUILD; $TMPBUILDTOCHECKCHANGELOG =~ s/\-rc\d*//; $TMPBUILDTOCHECKCHANGELOG =~ s/\-beta\d*//; + $TMPBUILDTOCHECKCHANGELOG =~ s/\-alpha\d*//; print "\nCheck if ChangeLog is ok for version $MAJOR.$MINOR\.$TMPBUILDTOCHECKCHANGELOG\n"; $ret=`grep "ChangeLog for $MAJOR.$MINOR\.$TMPBUILDTOCHECKCHANGELOG" "$SOURCE/ChangeLog" 2>&1`; if (! $ret) @@ -387,14 +388,16 @@ if ($nboftargetok) { { print "ChangeLog for $MAJOR.$MINOR\.$BUILD was found into '$SOURCE/ChangeLog'. But you can regenerate it with command:\n"; } - if (! $BUILD || $BUILD eq '0-rc') # For a major version + if (! $BUILD || $BUILD eq '0-alpha' || $BUILD eq '0-beta' || $BUILD eq '0-rc') # For a major or future version { - print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log `git rev-list --boundary '.$MAJOR.'.'.$MINOR.'..origin/develop | grep ^- | cut -c2- | head -n 1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\|PERF\|SEC\|QUAL\|CLOSE\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/CLOSE/NEW/g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa'; + print "Building changeLog file for a major version:\n"; + print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log `git rev-list --boundary '.$MAJOR.'.'.$MINOR.'..origin/develop | grep ^- | cut -c2- | head -n 1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\|PERF\|SEC\|QUAL\|CLOSE\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/CLOSE/NEW/g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' | sed \'s/^* //g\' > /tmp/aaa'; } else # For a maintenance release { + print "Building changeLog file for a maintenance version:\n"; #print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\|PERF\|SEC\|QUAL\|CLOSE\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/CLOSE/NEW/g\'| sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa'; - print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. | grep -v "Merge branch" | grep -v "Merge pull" | grep "^ " | sed -e "s/^[0-9a-z]* *//" | grep -e \'^FIX\|NEW\|PERF\|SEC\|QUAL\|CLOSE\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/CLOSE/NEW/g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa'; + print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. | grep -v "Merge branch" | grep -v "Merge pull" | grep "^ " | sed -e "s/^[0-9a-z]* *//" | grep -e \'^FIX\|NEW\|PERF\|SEC\|QUAL\|CLOSE\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/CLOSE/NEW/g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' | sed \'s/^* //g\' > /tmp/aaa'; } print "\n"; if (! $ret) diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index 8b1d5a1852d..34d7221c578 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -180,12 +180,6 @@ parameters: count: 1 path: ../../../htdocs/accountancy/bookkeeping/export.php - - - message: '#^Variable \$filter might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../../htdocs/accountancy/bookkeeping/export.php - - message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -198,12 +192,6 @@ parameters: count: 1 path: ../../../htdocs/accountancy/bookkeeping/list.php - - - message: '#^Variable \$filter might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../../htdocs/accountancy/bookkeeping/list.php - - message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -1452,12 +1440,6 @@ parameters: count: 2 path: ../../../htdocs/admin/menus/edit.php - - - message: '#^Property Menubase\:\:\$target \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 2 - path: ../../../htdocs/admin/menus/edit.php - - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue @@ -4656,12 +4638,6 @@ parameters: count: 1 path: ../../../htdocs/compta/facture/card-rec.php - - - message: '#^Variable \$newlang in empty\(\) always exists and is always falsy\.$#' - identifier: empty.variable - count: 2 - path: ../../../htdocs/compta/facture/card-rec.php - - message: '#^Comparison operation "\<" between '''' and 0 is always true\.$#' identifier: smaller.alwaysTrue @@ -10164,12 +10140,6 @@ parameters: count: 4 path: ../../../htdocs/core/lib/pdf.lib.php - - - message: '#^Ternary operator condition is always true\.$#' - identifier: ternary.alwaysTrue - count: 12 - path: ../../../htdocs/core/lib/pdf.lib.php - - message: '#^Variable \$refListsTxt in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -10224,12 +10194,6 @@ parameters: count: 6 path: ../../../htdocs/core/lib/tax.lib.php - - - message: '#^Ternary operator condition is always true\.$#' - identifier: ternary.alwaysTrue - count: 1 - path: ../../../htdocs/core/lib/ticket.lib.php - - message: '#^Variable \$butactionbg in empty\(\) always exists and is always falsy\.$#' identifier: empty.variable @@ -10386,12 +10350,6 @@ parameters: count: 1 path: ../../../htdocs/core/menus/standard/auguria.lib.php - - - message: '#^Parameter \#8 \$menuval of function print_text_menu_entry_auguria expects array\{\}\|array\{rowid\: string, fk_menu\: string, langs\: string, enabled\: int\<0, 2\>, type\: string, fk_mainmenu\: string, fk_leftmenu\: string, url\: string, \.\.\.\}, array\{url\: string, titre\: string, enabled\: int\<0, 2\>, target\: string, mainmenu\: string, leftmenu\: string, position\: int, level\?\: int, \.\.\.\} given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/menus/standard/auguria.lib.php - - message: '#^Right side of && is always true\.$#' identifier: booleanAnd.rightAlwaysTrue @@ -10422,12 +10380,6 @@ parameters: count: 4 path: ../../../htdocs/core/menus/standard/eldy.lib.php - - - message: '#^Parameter \#8 \$menuval of function print_text_menu_entry expects array\{\}\|array\{rowid\: string, fk_menu\: string, langs\: string, enabled\: int\<0, 2\>, type\: string, fk_mainmenu\: string, fk_leftmenu\: string, url\: string, \.\.\.\}, array\{url\: string, titre\: string, enabled\: int\<0, 2\>, target\: string, mainmenu\: string, leftmenu\: string, position\: int, level\?\: int, \.\.\.\} given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/menus/standard/eldy.lib.php - - message: '#^Right side of && is always true\.$#' identifier: booleanAnd.rightAlwaysTrue @@ -15066,24 +15018,12 @@ parameters: count: 1 path: ../../../htdocs/fourn/facture/agenda.php - - - message: '#^Variable \$label might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/fourn/facture/card-rec.php - - message: '#^Variable \$maxlength might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../../htdocs/fourn/facture/card-rec.php - - - message: '#^Variable \$newlang in empty\(\) always exists and is always falsy\.$#' - identifier: empty.variable - count: 2 - path: ../../../htdocs/fourn/facture/card-rec.php - - message: '#^Comparison operation "\>" between 0 and 0 is always false\.$#' identifier: greater.alwaysFalse @@ -20580,12 +20520,6 @@ parameters: count: 11 path: ../../../htdocs/public/bookcal/bookcalAjax.php - - - message: '#^Ternary operator condition is always true\.$#' - identifier: ternary.alwaysTrue - count: 1 - path: ../../../htdocs/public/bookcal/index.php - - message: '#^Variable \$user might not be defined\.$#' identifier: variable.undefined @@ -20748,12 +20682,6 @@ parameters: count: 1 path: ../../../htdocs/public/members/new.php - - - message: '#^If condition is always true\.$#' - identifier: if.alwaysTrue - count: 1 - path: ../../../htdocs/public/members/new.php - - message: '#^Variable \$php_self might not be defined\.$#' identifier: variable.undefined @@ -20826,12 +20754,6 @@ parameters: count: 1 path: ../../../htdocs/public/partnership/new.php - - - message: '#^If condition is always true\.$#' - identifier: if.alwaysTrue - count: 1 - path: ../../../htdocs/public/partnership/new.php - - message: '#^Variable \$user might not be defined\.$#' identifier: variable.undefined @@ -20988,12 +20910,6 @@ parameters: count: 1 path: ../../../htdocs/public/project/new.php - - - message: '#^If condition is always true\.$#' - identifier: if.alwaysTrue - count: 1 - path: ../../../htdocs/public/project/new.php - - message: '#^Variable \$user might not be defined\.$#' identifier: variable.undefined diff --git a/dev/setup/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf b/dev/setup/fail2ban/filter.d/web-dolibarr-bruteforce.conf similarity index 100% rename from dev/setup/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf rename to dev/setup/fail2ban/filter.d/web-dolibarr-bruteforce.conf diff --git a/dev/setup/fail2ban/filter.d/web-dolibarr-hackattempt.conf b/dev/setup/fail2ban/filter.d/web-dolibarr-hackattempt.conf new file mode 100644 index 00000000000..5c580f77929 --- /dev/null +++ b/dev/setup/fail2ban/filter.d/web-dolibarr-hackattempt.conf @@ -0,0 +1,18 @@ +# Fail2Ban configuration file +# +# Regexp to detect try to check a couple login/password so we can add mitigation +# on IP making too much tries. + +[Definition] + +# To test, you can inject this example into log +# echo `date +'%Y-%m-%d %H:%M:%S'`" INFO 1.2.3.4 Hack attempt detected - xxx" >> /mypath/documents/dolibarr.log +# +# then +# fail2ban-client status web-dolibarr-hackattempt +# +# To test rule file on a existing log file +# fail2ban-regex /mypath/documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-hackattempt.conf --print-all-matched + +failregex = ^ [A-Z\s]+ \s+Hack attempt detected +ignoreregex = diff --git a/dev/setup/fail2ban/filter.d/web-dolibarr-passf.conf b/dev/setup/fail2ban/filter.d/web-dolibarr-passf.conf index 4111bcb8566..944922ba8c1 100644 --- a/dev/setup/fail2ban/filter.d/web-dolibarr-passf.conf +++ b/dev/setup/fail2ban/filter.d/web-dolibarr-passf.conf @@ -9,7 +9,7 @@ # echo `date +'%Y-%m-%d %H:%M:%S'`" INFO 1.2.3.4 --- Access to GET /passwordforgotten.php - action=buildnewpassword, massaction=" >> /mypath/documents/dolibarr.log # # then -# fail2ban-client status web-dolibarr-rulespassforgotten +# fail2ban-client status web-dolibarr-passf # # To test rule file on a existing log file # fail2ban-regex /mypath/documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-passf.conf --print-all-matched diff --git a/dev/setup/fail2ban/jail.d/web-dolibarr-rulesbruteforce.conf b/dev/setup/fail2ban/jail.d/web-dolibarr-bruteforce.conf similarity index 83% rename from dev/setup/fail2ban/jail.d/web-dolibarr-rulesbruteforce.conf rename to dev/setup/fail2ban/jail.d/web-dolibarr-bruteforce.conf index 94fe3cfe2df..468da0f5b08 100644 --- a/dev/setup/fail2ban/jail.d/web-dolibarr-rulesbruteforce.conf +++ b/dev/setup/fail2ban/jail.d/web-dolibarr-bruteforce.conf @@ -8,4 +8,4 @@ logpath = /mypath/documents/documents/dolibarr.log action = %(action_mw)s bantime = 86400 ; 1 day findtime = 3600 ; 1 hour -maxretry = 20 ; 10 login error in 1 hour, we ban +maxretry = 20 ; 20 login error in 1 hour, we ban diff --git a/dev/setup/fail2ban/jail.d/web-dolibarr-hackattempt.conf b/dev/setup/fail2ban/jail.d/web-dolibarr-hackattempt.conf new file mode 100644 index 00000000000..f16bb9899b2 --- /dev/null +++ b/dev/setup/fail2ban/jail.d/web-dolibarr-hackattempt.conf @@ -0,0 +1,11 @@ +[web-dolibarr-hackattempt] + +; rule against bruteforce hacking (login + api) +enabled = true +port = http,https +filter = web-dolibarr-hackattempt +logpath = /mypath/documents/documents/dolibarr.log +action = %(action_mw)s +bantime = 86400 ; 1 day +findtime = 3600 ; 1 hour +maxretry = 3 ; 5 hack attempts in 1 hour, we ban diff --git a/dev/tools/apstats.php b/dev/tools/apstats.php index cbed08474f1..d866513a0ca 100755 --- a/dev/tools/apstats.php +++ b/dev/tools/apstats.php @@ -270,7 +270,7 @@ foreach ($output_arrglpu as $val) { // Parse the line to split interesting data $tmpval = cleanVal2($val); - if (preg_match('/(#yogosha|CVE|Sec:|Sec\s)/i', $tmpval['title'])) { + if (preg_match('/(#yogosha|CVE|Sec:|Sec\s|Sec$)/i', $tmpval['title'])) { // Recommended git comment: "Sec: Fix #..." $alreadyfound = ''; $alreadyfoundcommitid = ''; foreach ($arrayofalerts as $val) { diff --git a/dev/tools/codespell/codespell-ignore.txt b/dev/tools/codespell/codespell-ignore.txt index 9c957630967..1ba3d105f4f 100644 --- a/dev/tools/codespell/codespell-ignore.txt +++ b/dev/tools/codespell/codespell-ignore.txt @@ -33,6 +33,7 @@ doubleclick errorstring exten falsy +focusin master medias projet diff --git a/dev/tools/codespell/codespell-lines-ignore.txt b/dev/tools/codespell/codespell-lines-ignore.txt index 9eee54b90d6..aa12c3633dd 100644 --- a/dev/tools/codespell/codespell-lines-ignore.txt +++ b/dev/tools/codespell/codespell-lines-ignore.txt @@ -87,8 +87,7 @@ $datepaye = dol_mktime(GETPOSTINT("rehour"), GETPOSTINT("remin"), GETPOSTINT("resec"), GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"), 'tzuserrel'); $ensemblereponses = $obj->reponses; $head[$h][1] = $langs->trans('Referers'); - $inj += preg_match('/on(dblclick|drop|durationchange|emptied|end|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)[a-z]*\s*=/i', $tmpval); - $inj += preg_match('/on(dblclick|drop|durationchange|emptied|end|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)[a-z]*\s*=/i', $val); + $inj += preg_match('/on(dblclick|drag|drop|durationchange|emptied|end|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)[a-z]*\s*=/i', $val); $opensurveysondage->mail_admin = $_SESSION['adresse']; $pdf->SetXY($savx, $savy); $savy = $pdf->getY(); diff --git a/dev/translation/ignore_translation_keys.lst b/dev/translation/ignore_translation_keys.lst index 77aa88d0e65..d85ac6636da 100644 --- a/dev/translation/ignore_translation_keys.lst +++ b/dev/translation/ignore_translation_keys.lst @@ -1000,16 +1000,12 @@ INVOICE_USE_SITUATION INVOICE_USE_SITUATION_CREDIT_NOTE ImpossibleToContactAuthority InterDate -Inventory Code -InvoiceReplace ItemID JobApplications JobPosition Journal -Label Movement Labels Last -LedgerAccount LocalTax1IsNotUsedExample LocalTax1IsUsedExample LocalTax2IsNotUsedExample diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 12be0a3ca14..3772d0ffe06 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -294,7 +294,7 @@ if (empty($reshook)) { $object->journal_label = $journal_label; $object->fk_doc = 0; $object->fk_docdet = 0; - $object->ref = $numRefModel === 'mod_bookkeeping_neon' ? GETPOST('ref', 'alpha') : $object->getNextNumRef(); + $object->ref = (GETPOST('ref', 'alpha') ? GETPOST('ref', 'alpha') : $object->getNextNumRef()); $object->montant = 0; // deprecated $object->amount = 0; @@ -490,13 +490,8 @@ if ($action == 'create') { print ''; - /*print ''; - print ''; - print ''; - print '';*/ - print ''; - print ''; + print ''; print ''; @@ -508,16 +503,21 @@ if ($action == 'create') { print ''; print ''; - print ''; + print ''; print ''; print ''; + // Piece number + print ''; + print ''; + print ''; - print ''; - print ''; - print ''; + print ''; + } else { + print ''.$langs->trans("Automatic").''; } + print ''; + print ''; /* print ''; @@ -560,7 +560,12 @@ if ($action == 'create') { print dol_get_fiche_head($head, 'transaction', '', -1); - $object->label = $object->doc_ref; + //$object->label = $object->doc_ref; + if ($mode == '_tmp') { + $object->context['mode'] = $mode; + $object->next_prev_filter = '1=0'; // Add a test always false to disable navigation into the dol_banner_tab. In tmp mode, we just want to create/edit lines of bank transaction. + } + $object->label = $object->ref; $morehtmlref = '
'; $morehtmlref .= '
'; @@ -577,13 +582,15 @@ if ($action == 'create') { print '
' . $langs->trans("NumPiece") . '' . $next_num_mvt . '
'.$langs->trans("Docdate").''.$langs->trans("Docdate").''; print $form->selectDate('', 'doc_date', 0, 0, 0, "create_mvt", 1, 1); print '
'.$langs->trans("Piece").''.$form->textwithpicto($langs->trans("Piece"), $langs->trans("PieceDesc")).'
'.$form->textwithpicto($langs->trans("Ref"), $langs->trans("BankTransactionRef")).''; if ($numRefModel === 'mod_bookkeeping_neon') { - print '
'.$langs->trans("Ref").'
'; // Account movement + /* print ''; - print ''; + print ''; print ''; print ''; + */ // Account movement ref. Edit allowed only for free ref num model. - print '
'.$langs->trans("NumMvts").''.$langs->trans("NumMvts").''.($mode == '_tmp' ? ''.$langs->trans("Draft").'' : $object->piece_num).'
'; + print '
'; print ''; @@ -607,7 +614,7 @@ if ($action == 'create') { print ''; print ''; print ''; - print ''; + print ''; print ''; } else { print $object->ref; @@ -618,7 +625,7 @@ if ($action == 'create') { // Ref document print ''; + print ''; // Module - print ''; + print ''; // Handler if ($menu->menu_handler == 'all') { @@ -454,7 +455,8 @@ if ($action == 'create') { } else { $handler = $menu->menu_handler; } - print ''; + print ''; + print ''; // User print ''; - print ''; + print ''; // Mainmenu code if ($menu->type == 'top') { print ''; - /*if ($parent_rowid) - { - print ''; - } - else - {*/ print ''; - //} print ''; } // MenuId Parent - print ''; $valtouse = $menu->fk_menu; if ($menu->fk_mainmenu) { @@ -512,18 +511,8 @@ if ($action == 'create') { print ''; print ''; - // URL - print ''; - print ''; - - // Show URL into a frame - if (getDolGlobalString("MAIN_SHOW_TOP_MENU_URL_IN_FRAME")) { - print ''; - print ''; - } - // Picto - print ''; + print ''; print ''; + // URL + print ''; + print ''; + + // Target + print ''; + + // Show URL into a frame + if (getDolGlobalString("MAIN_FEATURE_TO_SHOW_TOP_MENU_URL_IN_FRAME") && $menu->type == 'top') { + print ''; + print ''; + } + // Position print ''; - print ''; + print ''; // Enabled print ''; @@ -551,15 +559,6 @@ if ($action == 'create') { } print ''; - // Target - print ''; - print '
'; print $langs->trans('Ref'); print '
'; print ''; if ($action != 'editdocref') { print ''; + $cursormonth = $j; + if ($cursormonth > 12) { + $cursormonth -= 12; + } + $cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y; + $tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt'); + + print ''; } print ''; diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 15adadbc470..cf979b7991e 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -540,7 +540,7 @@ if (!getDolGlobalInt('SOCIETE_DISABLE_BANKACCOUNT')) { print ''; print ''; print ''; } diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index a74c23ee267..639448bb882 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -98,6 +98,14 @@ $modules = array( array( 'code' => 'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY', 'img' => 'bill' + ), + array( + 'code' => 'MAIN_DELAY_SUPPLIER_PROPALS_TO_CLOSE', + 'img' => 'propal' + ), + array( + 'code' => 'MAIN_DELAY_SUPPLIER_PROPALS_TO_BILL', + 'img' => 'propal' ) ), 'service' => array( diff --git a/htdocs/admin/invoice.php b/htdocs/admin/invoice.php index 0de34fac5df..9056073c371 100644 --- a/htdocs/admin/invoice.php +++ b/htdocs/admin/invoice.php @@ -8,7 +8,7 @@ * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> * Copyright (C) 2022 Anthony Berton * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -126,6 +126,7 @@ if ($action == 'updateMask') { require_once $file; $module = new $classname($db); + /** @var ModelePDFFactures $module */ '@phan-var-force ModelePDFFactures $module'; if ($module->write_file($facture, $langs) > 0) { @@ -344,6 +345,7 @@ foreach ($dirmodels as $reldir) { require_once $dir.$filebis; $module = new $classname($db); + /** @var ModeleNumRefFactures $module */ '@phan-var-force ModeleNumRefFactures $module'; $arrayofmodules[] = $module; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index c05f514f6c6..a2b1eea1e4b 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -640,9 +640,16 @@ if ($action == 'edit') { print '">'; // Default from type - $liste = array(); - $liste['user'] = $langs->trans('UserEmail'); - $liste['company'] = $langs->trans('CompanyEmail').' ('.(!getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') ? $langs->trans("NotDefined") : getDolGlobalString('MAIN_INFO_SOCIETE_MAIL')).')'; + $liste = array( + 'user' => array( + 'label' => $langs->trans('UserEmail'), + 'data-html' => $langs->trans('UserEmail') + ), + 'company' => array( + 'label' => $langs->trans('CompanyEmail').' ('.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL', $langs->trans("NotDefined")).')', + 'data-html' => $langs->trans('CompanyEmail').' ('.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL', $langs->trans("NotDefined")).')' + ) + ); print ''; + print ''; print ''; - print ''; + print ''; // User - print ''; - print ''; + print ''; - print ''; + print ''; // Type print ''; print ''; - // URL - print ''; - print ''; - - // Show URL into a frame - if (getDolGlobalString("MAIN_SHOW_TOP_MENU_URL_IN_FRAME")) { - print ''; - print ''; - } - // Picto print ''; print ''; + // URL + print ''; + print ''; + + // Target + print ''; + + // Show URL into a frame + if (getDolGlobalString("MAIN_FEATURE_TO_SHOW_TOP_MENU_URL_IN_FRAME")) { + print ''; + print ''; + } + // Position print ''; - print ''; + print ''; // Enabled print ''; @@ -407,14 +417,6 @@ if ($action == 'create') { print ''; print ''; - // Target - print ''; - print '
'; - print $langs->trans('Piece'); + print $form->textwithpicto($langs->trans('Piece'), $langs->trans('PieceDesc')); print ''; @@ -640,7 +647,7 @@ if ($action == 'create') { print ''; print ''; print ''; - print ''; + print ''; print ''; } else { print $object->doc_ref; @@ -1037,11 +1044,11 @@ if ($action == 'create') { print '
'; print '
'; if (empty($total_debit) && empty($total_credit)) { - print ''; + print ''.dol_escape_htmltag($langs->trans("ValidTransaction")).''; } elseif ($total_debit == $total_credit) { print ''.$langs->trans("ValidTransaction").''; } else { - print ''; + print ''.dol_escape_htmltag($langs->trans("ValidTransaction")).''; } print '   '; diff --git a/htdocs/accountancy/bookkeeping/export.php b/htdocs/accountancy/bookkeeping/export.php index 366ef96857b..9ae36868f99 100644 --- a/htdocs/accountancy/bookkeeping/export.php +++ b/htdocs/accountancy/bookkeeping/export.php @@ -4,7 +4,7 @@ * Copyright (C) 2013-2025 Alexandre Spangaro * Copyright (C) 2022 Lionel Vessiller * Copyright (C) 2016-2017 Laurent Destailleur - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2022 Progiseize * Copyright (C) 2024-2025 MDW * @@ -250,6 +250,7 @@ if (!$user->hasRight('accounting', 'mouvements', 'lire')) { */ $param = ''; +$filter = array(); if (GETPOST('cancel', 'alpha')) { $action = 'list'; @@ -332,7 +333,6 @@ if (empty($reshook)) { } // Must be after the remove filter action, before the export. - $filter = array(); if (!empty($search_date_start)) { $filter['t.doc_date>='] = $search_date_start; $tmp = dol_getdate($search_date_start); @@ -548,10 +548,6 @@ if (count($filter) > 0) { $sqlwhere[] = "t.doc_date >= '".$db->idate($value)."'"; } elseif ($key == 't.doc_date<=') { $sqlwhere[] = "t.doc_date <= '".$db->idate($value)."'"; - } elseif ($key == 't.doc_date>') { - $sqlwhere[] = "t.doc_date > '".$db->idate($value)."'"; - } elseif ($key == 't.doc_date<') { - $sqlwhere[] = "t.doc_date < '".$db->idate($value)."'"; } elseif ($key == 't.numero_compte>=') { $sqlwhere[] = "t.numero_compte >= '".$db->escape($value)."'"; } elseif ($key == 't.numero_compte<=') { @@ -560,12 +556,12 @@ if (count($filter) > 0) { $sqlwhere[] = "t.subledger_account >= '".$db->escape($value)."'"; } elseif ($key == 't.subledger_account<=') { $sqlwhere[] = "t.subledger_account <= '".$db->escape($value)."'"; - } elseif ($key == 't.fk_doc' || $key == 't.fk_docdet' || $key == 't.piece_num') { - $sqlwhere[] = $db->sanitize($key).'='.((int) $value); + // } elseif ($key == 't.fk_doc' || $key == 't.fk_docdet' || $key == 't.piece_num') { // these fields doesn't exists + // $sqlwhere[] = $db->sanitize($key).'='.((int) $value); } elseif ($key == 't.subledger_account' || $key == 't.numero_compte') { $sqlwhere[] = $db->sanitize($key)." LIKE '".$db->escape($db->escapeforlike($value))."%'"; - } elseif ($key == 't.subledger_account') { - $sqlwhere[] = natural_search($key, $value, 0, 1); + // } elseif ($key == 't.subledger_account') { // this code is unreachable, test is always false + // $sqlwhere[] = natural_search($key, $value, 0, 1); } elseif ($key == 't.tms>=') { $sqlwhere[] = "t.tms >= '".$db->idate($value)."'"; } elseif ($key == 't.tms<=') { diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 4fed43d5c75..9d099ed6805 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -232,6 +232,7 @@ $permissiontoadd = $user->hasRight('accounting', 'mouvements', 'creer'); */ $param = ''; +$filter = array(); if (GETPOST('cancel', 'alpha')) { $action = 'list'; @@ -300,7 +301,6 @@ if (empty($reshook)) { } // Must be after the remove filter action, before the export. - $filter = array(); if (!empty($search_date_start)) { $filter['t.doc_date>='] = $search_date_start; $tmp = dol_getdate($search_date_start); @@ -635,10 +635,6 @@ if (count($filter) > 0) { $sqlwhere[] = "t.doc_date >= '".$db->idate($value)."'"; } elseif ($key == 't.doc_date<=') { $sqlwhere[] = "t.doc_date <= '".$db->idate($value)."'"; - } elseif ($key == 't.doc_date>') { - $sqlwhere[] = "t.doc_date > '".$db->idate($value)."'"; - } elseif ($key == 't.doc_date<') { - $sqlwhere[] = "t.doc_date < '".$db->idate($value)."'"; } elseif ($key == 't.numero_compte>=') { $sqlwhere[] = "t.numero_compte >= '".$db->escape($value)."'"; } elseif ($key == 't.numero_compte<=') { @@ -647,12 +643,12 @@ if (count($filter) > 0) { $sqlwhere[] = "t.subledger_account >= '".$db->escape($value)."'"; } elseif ($key == 't.subledger_account<=') { $sqlwhere[] = "t.subledger_account <= '".$db->escape($value)."'"; - } elseif ($key == 't.fk_doc' || $key == 't.fk_docdet' || $key == 't.piece_num') { - $sqlwhere[] = $db->sanitize($key).' = '.((int) $value); + /* } elseif ($key == 't.fk_doc' || $key == 't.fk_docdet' || $key == 't.piece_num') { // these fields doesn't exists + $sqlwhere[] = $db->sanitize($key).' = '.((int) $value); */ } elseif ($key == 't.subledger_account' || $key == 't.numero_compte') { $sqlwhere[] = $db->sanitize($key)." LIKE '".$db->escape($db->escapeforlike($value))."%'"; - } elseif ($key == 't.subledger_account') { - $sqlwhere[] = natural_search($key, $value, 0, 1); + /* } elseif ($key == 't.subledger_account') { // test is always false + $sqlwhere[] = natural_search($key, $value, 0, 1); */ } elseif ($key == 't.tms>=') { $sqlwhere[] = "t.tms >= '".$db->idate($value)."'"; } elseif ($key == 't.tms<=') { diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index d503ca0c993..52f40c64e44 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -791,7 +791,7 @@ class BookKeeping extends CommonObject $sql .= ' '.(empty($this->code_journal) ? 'NULL' : "'".$this->db->escape($this->code_journal)."'").','; $sql .= ' '.(empty($this->journal_label) ? 'NULL' : "'".$this->db->escape($this->journal_label)."'").','; $sql .= ' '.(empty($this->piece_num) ? 'NULL' : $this->db->escape((string) $this->piece_num)).','; - $sql .= ' '.(empty($this->ref) ? '' : "'".$this->db->escape($this->ref)."'").','; + $sql .= ' '.(empty($this->ref) ? "''" : "'".$this->db->escape($this->ref)."'").','; $sql .= ' '.(!isset($this->entity) ? $conf->entity : $this->entity); $sql .= ')'; diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index 37f426f841f..838cb5f3d37 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -347,7 +347,24 @@ for ($i = 1; $i <= 12; $i++) { if ($j > 12) { $j -= 12; } - print '
'.$langs->trans('MonthShort'.str_pad((string) $j, 2, '0', STR_PAD_LEFT)).''; + if (!empty($tmp['mday'])) { + $param = 'search_date_startday=1&search_date_startmonth='.$cursormonth.'&search_date_startyear='.$cursoryear; + $param .= '&search_date_endday='.$tmp['mday'].'&search_date_endmonth='.$tmp['mon'].'&search_date_endyear='.$tmp['year']; + print ''; + } + print $langs->trans('MonthShort'.str_pad((string) $j, 2, '0', STR_PAD_LEFT)); + if (!empty($tmp['mday'])) { + print ''; + } + print ''.$langs->trans("Total").'
'.$form->textwithpicto($langs->trans("AllowOnLineSign"), $langs->trans("AllowOnLineSignDesc")).''; - print ajax_constantonoff('SOCIETE_RIB_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1, '', '', 'inline-block', 0, $langs->transnoentitiesnoconv("WarningOnlineSignature")); + print ajax_constantonoff('SOCIETE_RIB_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1, '', '', 'inline-block', 0, $langs->transnoentitiesnoconv("WarningOnlineSignature", "https://www.dolistore.com")); print '
'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').''; print $form->selectarray('MAIN_MAIL_DEFAULT_FROMTYPE', $liste, getDolGlobalString('MAIN_MAIL_DEFAULT_FROMTYPE'), 0); @@ -1026,6 +1033,10 @@ if ($action == 'edit') { print ''; + + print '
'; + + if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail' && !getDolGlobalString('MAIN_FIX_FOR_BUGGED_MTA')) { /* // Warning 1 diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index 4efa423f089..57f50d5c7c1 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -59,7 +59,8 @@ foreach ($dirmenus as $dirmenu) { $action = GETPOST('action', 'aZ09'); -$menu = null; +$menu = new Menubase($db); + $menu_handler_top = getDolGlobalString('MAIN_MENU_STANDARD'); $menu_handler_smartphone = getDolGlobalString('MAIN_MENU_SMARTPHONE'); $menu_handler_top = preg_replace('/_backoffice.php/i', '', $menu_handler_top); @@ -137,7 +138,6 @@ if ($action == 'add') { } if (!$error) { - $menu = new Menubase($db); $menu->menu_handler = preg_replace('/_menu$/', '', GETPOST('menu_handler', 'aZ09')); $menu->type = (string) GETPOST('type', 'alphanohtml'); $menu->title = (string) GETPOST('titre', 'alphanohtml'); @@ -148,6 +148,7 @@ if ($action == 'add') { $menu->enabled = (string) GETPOST('enabled', 'alphanohtml'); $menu->perms = (string) GETPOST('perms', 'alphanohtml'); $menu->target = (string) GETPOST('target', 'alphanohtml'); + $menu->showtopmenuinframe = GETPOSTINT('showtopmenuinframe'); $menu->user = GETPOSTINT('user'); $menu->mainmenu = (string) GETPOST('propertymainmenu', 'alphanohtml'); if (is_numeric(GETPOST('menuIdParent', 'alphanohtml'))) { @@ -197,7 +198,6 @@ if ($action == 'update') { } if (!$error) { - $menu = new Menubase($db); $result = $menu->fetch(GETPOSTINT('menuId')); if ($result > 0) { $menu->title = (string) GETPOST('titre', 'alphanohtml'); @@ -211,6 +211,8 @@ if ($action == 'update') { $menu->target = (string) GETPOST('target', 'alphanohtml'); $menu->user = GETPOSTINT('user'); $menu->mainmenu = (string) GETPOST('propertymainmenu', 'alphanohtml'); + $menu->showtopmenuinframe = GETPOSTINT('showtopmenuinframe'); + if (is_numeric(GETPOST('menuIdParent', 'alphanohtml'))) { $menu->fk_menu = (int) GETPOST('menuIdParent', 'alphanohtml'); } else { @@ -318,22 +320,22 @@ if ($action == 'create') { } // Handler - print '
'.$langs->trans('MenuHandler').'
'.$form->textwithpicto($langs->trans('MenuHandler'), $langs->trans('DetailMenuHandler')).''; $formadmin->select_menu_families($menu_handler.(preg_match('/_menu/', $menu_handler) ? '' : '_menu'), 'menu_handler', array_merge($dirstandard, $dirsmartphone)); print ''.$langs->trans('DetailMenuHandler').'
'.$langs->trans('MenuForUsers').'
'.$form->textwithpicto($langs->trans('MenuForUsers'), $langs->trans('DetailUser')).''; print ajax_combobox('menuuser'); print ''.$langs->trans('DetailUser').'
'.$langs->trans('Position').''; @@ -341,7 +343,7 @@ if ($action == 'create') { print $langs->trans('Left'); print ''; } else { - print ''; print ''; print ''; print ''; @@ -376,16 +378,6 @@ if ($action == 'create') { print '
'.$langs->trans('LangFile').''.$langs->trans('DetailLangs').'
'.$langs->trans('URL').''.$langs->trans('DetailUrl').'
'.$langs->trans('ShowTopMenuURLIntoAFrame').'
'.$langs->trans('Image').''.$langs->trans('Example').': fa-globe-americas'; @@ -395,9 +387,27 @@ if ($action == 'create') { print ''; print '
'.$langs->trans('URL').''.$langs->trans('DetailUrl').'
'.$langs->trans('OpenLinkInto').''; + print ajax_combobox("target"); + print '
'.$langs->trans('ShowTopMenuURLIntoAFrame').'
'.$langs->trans('Position').''.$langs->trans('DetailPosition').'
'.$langs->trans('DetailPosition').'
'.$langs->trans('Enabled').'
'.$langs->trans('Rights').''.$langs->trans('DetailRight').'
'.$langs->trans('Target').''; - print ajax_combobox("target"); - print ''.$langs->trans('DetailTarget').'
'; print ''; @@ -425,7 +427,6 @@ if ($action == 'create') { print ''; } elseif ($action == 'edit') { print load_fiche_titre($langs->trans("ModifMenu"), '', 'title_setup'); - print '
'; print '
'; print ''; @@ -443,10 +444,10 @@ if ($action == 'create') { //var_dump($menu); // Id - print '
'.$langs->trans('Id').''.$menu->id.''.$langs->trans('DetailId').'
'.$form->textwithpicto($langs->trans('MenuID'), $langs->trans('DetailId')).''.$menu->id.'
'.$langs->trans('MenuModule').''.(empty($menu->module) ? 'Core' : $menu->module).''.$langs->trans('DetailMenuModule').'
'.$form->textwithpicto($langs->trans('MenuModule'), $langs->trans('DetailMenuModule')).''.(empty($menu->module) ? 'Core' : $menu->module).'
'.$langs->trans('MenuHandler').''.$handler.''.$langs->trans('DetailMenuHandler').'
'.$form->textwithpicto($langs->trans('MenuHandler'), $langs->transnoentitiesnoconv("DetailMenuHandler")).''.$handler.'
'.$langs->trans('MenuForUsers').''; @@ -468,26 +470,23 @@ if ($action == 'create') { // Type print '
'.$langs->trans('Position').''.$langs->trans(ucfirst($menu->type)).''.$langs->trans('DetailType').'
'.$langs->trans(ucfirst($menu->type)); + print ''; + print ''; + print $langs->transnoentitiesnoconv("DetailType"); + print '
'.$langs->trans('MainMenuCode').''.$parent_rowid.'mainmenu).'">'; print $langs->trans("Example").': mytopmenukey'; print '
'.$langs->trans('MenuIdParent'); + print '
'.$langs->trans('MenuIdParent'); print '
'.$langs->trans('LangFile').''.$langs->trans('DetailLangs').'
'.$langs->trans('URL').''.$langs->trans('DetailUrl').'
'.$langs->trans('ShowTopMenuURLIntoAFrame').'
'.$langs->trans('Image').'
'.$langs->trans('Image').''.$langs->trans('Example').': fa-globe-americas'; print ''; print '     '; @@ -531,9 +520,28 @@ if ($action == 'create') { print ''; print '
'.$langs->trans('URL').''.$langs->trans('DetailUrl').'
'.$langs->trans('OpenLinkInto').''; + print ''; + print ajax_combobox("target"); + print '
'.$langs->trans('ShowTopMenuURLIntoAFrame').'showtopmenuinframe ? ' checked="checked"' : '').'">
'.$langs->trans('Position').''.$langs->trans('DetailPosition').'
'.$langs->trans('DetailPosition').'
'.$langs->trans('Enabled').'
'.$langs->trans('Target').''; - print ''; - print ajax_combobox("target"); - print ''.$langs->trans('DetailTarget').'
'; print ''; diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index cb63f3ef55e..5869ec45e20 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -2,7 +2,7 @@ /* Copyright (C) 2015 Juanjo Menent * Copyright (C) 2020 Maxime DEMAREST * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * * 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 @@ -170,6 +170,7 @@ foreach ($dirmodels as $reldir) { require_once $dir.$filebis; $module = new $classname($db); + /** @var ModeleNumRefPayments $module */ '@phan-var-force ModeleNumRefPayments $module'; $arrayofmodules[] = $module; diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index 8de0ccb9bc8..41c160581f9 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -115,7 +115,9 @@ if ($action == "set") { if (!($res > 0)) { $error++; } - } elseif (!$error) { + } + + if (!$error) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index d23e5e3007c..41eb449be75 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -289,7 +289,7 @@ foreach ($workflowcodes as $key => $params) { if ($params['family'] == 'separator') { if ($atleastoneline) { print '
'; - print '
'; + print '
'."\n"; $oldfamily = ''; $atleastoneline = 0; @@ -301,8 +301,10 @@ foreach ($workflowcodes as $key => $params) { if ($oldfamily != $params['family']) { // New group if ($params['family'] == 'create') { + $headerfamily = $langs->trans("AutomaticCreation"); $header = $langs->trans("AutomaticCreation"); } elseif (preg_match('/classify_(.*)/', $params['family'], $reg)) { + $headerfamily = $langs->trans("AutomaticClassification"); $header = $langs->trans("AutomaticClassification"); if ($reg[1] == 'proposal') { $header .= ' - '.$langs->trans('Proposal'); @@ -323,20 +325,31 @@ foreach ($workflowcodes as $key => $params) { $header .= ' - '.$langs->trans('Shipment'); } } elseif (preg_match('/link_(.*)/', $params['family'], $reg)) { + $headerfamily = $langs->trans("AutomaticLinking"); $header = $langs->trans("AutomaticLinking"); if ($reg[1] == 'ticket') { $header .= ' - '.$langs->trans('Ticket'); } } else { + $headerfamily = $langs->trans("Other"); $header = $langs->trans("Description"); } + if ($tableopen) { + print '
'."\n"; + } + + if ($oldfamily == '') { + print load_fiche_titre($headerfamily); + } + + print "\n"; print ''; $tableopen = 1; print ''; print ''; - print ''; + print ''; print ''; $oldfamily = $params['family']; diff --git a/htdocs/ai/admin/custom_prompt.php b/htdocs/ai/admin/custom_prompt.php index 6efe6229d78..f6ccf965f57 100644 --- a/htdocs/ai/admin/custom_prompt.php +++ b/htdocs/ai/admin/custom_prompt.php @@ -81,8 +81,16 @@ $aiservice = getDolGlobalString('AI_API_SERVICE', 'chatgpt'); // Setup conf for AI model $formSetup->formHiddenInputs['action'] = "updatefeaturemodel"; foreach ($arrayofaifeatures as $key => $val) { + $newkey = $key; + if (preg_match('/^text/', $key)) { + $newkey = 'textgeneration'; + } $item = $formSetup->newItem('AI_API_'.strtoupper($aiservice).'_MODEL_'.$val["function"]); // Name of constant must end with _KEY so it is encrypted when saved into database. - $item->nameText = $langs->trans("AI_API_MODEL_".$val["function"]); + if ($arrayofai[$aiservice][$newkey] != 'na') { + $item->nameText = $langs->trans("AI_API_MODEL_".$val["function"]).' ('.$langs->trans("Default").' = '.$arrayofai[$aiservice][$newkey].')'; + } else { + $item->nameText = $langs->trans("AI_API_MODEL_".$val["function"]).' ('.$langs->trans("None").')'; + } $item->cssClass = 'minwidth500 input'; } @@ -218,10 +226,15 @@ print load_fiche_titre($langs->trans($title), $linkback, 'title_setup'); $head = aiAdminPrepareHead(); print dol_get_fiche_head($head, 'custom', $langs->trans($title), -1, "ai"); -//$newbutton = ''.$langs->trans("New").''; -$newbutton = ''; +$newcardbutton = dolGetButtonTitle($langs->trans('NewCustomPrompt'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=create', '', 1); +/* +$newbutton = ''; +$newbutton .= img_picto('', 'add'); +$newbutton .= ''; +*/ + +print load_fiche_titre($langs->trans("AIPromptForFeatures", $arrayofai[$aiservice]['label']), $newcardbutton, ''); -print load_fiche_titre($langs->trans("AIPromptForFeatures"), $newbutton, ''); if ($action == 'deleteproperty') { $formconfirm = $form->formconfirm( @@ -236,8 +249,12 @@ if ($action == 'deleteproperty') { print $formconfirm; } -if ($action == 'edit' || $action == 'deleteproperty') { - $out = ''; +print '
'; + +if ($action == 'create') { + $out = '
'; + + $out .= ''; $out .= ''; $out .= ''; @@ -245,7 +262,7 @@ if ($action == 'edit' || $action == 'deleteproperty') { $out .= '
'.$header.''.$langs->trans("Status").'
'; $out .= ''; $out .= ''; - $out .= ''; + $out .= ''; $out .= ''; $out .= ''; $out .= ''; @@ -310,7 +327,7 @@ if ($action == 'edit' || $action == 'deleteproperty') { $out .= ''; $out .= ''; $out .= ''; $out .= ''; $out .= ''; @@ -320,6 +337,7 @@ if ($action == 'edit' || $action == 'deleteproperty') { $out .= ''; $out .= '


'; + $out .= ''; print $out; } @@ -370,25 +388,24 @@ if ($action == 'edit' || $action == 'create' || $action == 'deleteproperty') { $out .= ''; $out .= ''; - $out .= ''; + $out .= ''; $out .= ''; $out .= ''; $out .= ''; - $out .= ''; + $out .= ''; $out .= ''; $out .= '
'.$langs->trans('Add').''.$langs->trans('NewCustomPrompt').'
'; - $out .= ''; + $out .= ''; $out .= '
'.$langs->trans("BlackListWords").''.$form->textwithpicto($langs->trans("BlackListWords"), $langs->trans("BlackListWordsHelp")).''; - $out .= ''; + $out .= ''; $out .= '
'.$langs->trans("Test").''; - $out .= ''; - $out .= '   '; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $showlinktoai = $key; // 'textgeneration', 'imagegeneration', ... - $showlinktoailabel = $langs->trans("ToTest"); $formmail = new FormMail($db); - $htmlname = $key; + $formmail->withaiprompt = 'html'; // set format - $out .= '

'; + $showlinktoai = $key; // 'textgenerationemail', 'textgenerationwebpage', 'imagegeneration', ... + $showlinktoailabel = $langs->trans("ToTest"); + $htmlname = $key; + $onlyenhancements = $key; // Fill $out include DOL_DOCUMENT_ROOT.'/core/tpl/formlayoutai.tpl.php'; @@ -401,7 +418,11 @@ if ($action == 'edit' || $action == 'create' || $action == 'deleteproperty') { $out .= '
'; + $out .= '
'; + $out .= ''; + + $out .= '

'; } } @@ -412,7 +433,7 @@ if ($action == 'edit' || $action == 'create' || $action == 'deleteproperty') { if ($action == 'edit' || $action == 'create' || $action == 'deleteproperty') { - print load_fiche_titre($langs->trans("AIModelForFeature", $arrayofai[$aiservice]), $newbutton, ''); + print load_fiche_titre($langs->trans("AIModelForFeature", $arrayofai[$aiservice]['label']), '', ''); print $formSetup->generateOutput(true); } diff --git a/htdocs/ai/admin/setup.php b/htdocs/ai/admin/setup.php index 62924e5127a..890b929dd00 100644 --- a/htdocs/ai/admin/setup.php +++ b/htdocs/ai/admin/setup.php @@ -76,7 +76,8 @@ $item = $formSetup->newItem('AI_API_SERVICE'); // Name of constant must end with $item->setAsSelect($arrayofai); $item->cssClass = 'minwidth150'; -foreach ($arrayofai as $ia => $ialabel) { +foreach ($arrayofai as $ia => $iarecord) { + $ialabel = $iarecord['label']; // Setup conf AI_PUBLIC_INTERFACE_TOPIC /*$item = $formSetup->newItem('AI_API_'.strtoupper($ia).'_ENDPOINT'); // Name of constant must end with _KEY so it is encrypted when saved into database. $item->defaultFieldValue = ''; @@ -92,7 +93,7 @@ foreach ($arrayofai as $ia => $ialabel) { $item = $formSetup->newItem('AI_API_'.strtoupper($ia).'_URL'); // Name of constant must end with _KEY so it is encrypted when saved into database. $item->nameText = $langs->trans("AI_API_URL").' ('.$ialabel.')'; $item->defaultFieldValue = ''; - $item->fieldParams['trClass'] = 'iaservice '.$ia; + $item->fieldParams['trClass'] = 'iaservice iaurl '.$ia; $item->cssClass = 'minwidth500 input'.$ia; } @@ -123,8 +124,6 @@ $action = 'edit'; * View */ -$form = new Form($db); - $help_url = ''; $title = "AiSetup"; @@ -160,11 +159,29 @@ if (empty($setupnotempty)) { print ' '; } + if ($showlinktolayout) { if (!empty($formwebsite) && is_object($formwebsite)) { $out .= $formwebsite->getContentPageTemplate($htmlname); @@ -126,13 +128,18 @@ if ($showlinktolayout) { } else { $out .= ''; } + if ($showlinktoai) { if (empty($formai) || $formai instanceof FormAI) { include_once DOL_DOCUMENT_ROOT.'/core/class/html.formai.class.php'; $formai = new FormAI($db); } $out .= $formai->getAjaxAICallFunction(); - $out .= $formai->getSectionForAIEnhancement($showlinktoai, $formmail->withaiprompt, $htmlname); + + if (empty($onlyenhancements)) { + $onlyenhancements = ''; + } + $out .= $formai->getSectionForAIEnhancement($showlinktoai, $formmail->withaiprompt, $htmlname, $onlyenhancements); } else { $out .= ''; } diff --git a/htdocs/emailcollector/class/emailcollectoraction.class.php b/htdocs/emailcollector/class/emailcollectoraction.class.php index eea46233dad..342599b1b8b 100644 --- a/htdocs/emailcollector/class/emailcollectoraction.class.php +++ b/htdocs/emailcollector/class/emailcollectoraction.class.php @@ -78,8 +78,8 @@ class EmailCollectorAction extends CommonObject 'actionparam' => array('type' => 'text', 'label' => 'ParamForAction', 'enabled' => 1, 'visible' => 1, 'position' => 40, 'notnull' => -1), 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'position' => 500, 'notnull' => 1,), 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -2, 'position' => 501, 'notnull' => 1,), - 'fk_user_creat' => array('type' => 'integer', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -2, 'position' => 510, 'notnull' => 1, 'foreignkey' => 'llx_user.rowid',), - 'fk_user_modif' => array('type' => 'integer', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'position' => 511, 'notnull' => -1,), + 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -2, 'position' => 510, 'notnull' => 1, 'foreignkey' => 'llx_user.rowid',), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'position' => 511, 'notnull' => -1,), 'position' => array('type' => 'integer', 'label' => 'Position', 'enabled' => 1, 'visible' => 1, 'position' => 600, 'default' => '0',), 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 1000, 'notnull' => -1,), 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'position' => 1000, 'notnull' => 1, 'default' => '1', 'arrayofkeyval' => array(0 => 'Disabled', 1 => 'Enabled')), diff --git a/htdocs/emailcollector/class/emailcollectorfilter.class.php b/htdocs/emailcollector/class/emailcollectorfilter.class.php index 3611bdfdbbc..1333cd9c202 100644 --- a/htdocs/emailcollector/class/emailcollectorfilter.class.php +++ b/htdocs/emailcollector/class/emailcollectorfilter.class.php @@ -80,8 +80,8 @@ class EmailCollectorFilter extends CommonObject 'rulevalue' => array('type' => 'varchar(255)', 'label' => 'ValueOfRule', 'enabled' => 1, 'visible' => 1, 'position' => 30, 'notnull' => -1, 'help' => "Value of Rule",), 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'position' => 500, 'notnull' => 1,), 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -2, 'position' => 501, 'notnull' => 1,), - 'fk_user_creat' => array('type' => 'integer', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -2, 'position' => 510, 'notnull' => 1, 'foreignkey' => 'llx_user.rowid',), - 'fk_user_modif' => array('type' => 'integer', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'position' => 511, 'notnull' => -1,), + 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -2, 'position' => 510, 'notnull' => 1, 'foreignkey' => 'llx_user.rowid',), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'position' => 511, 'notnull' => -1,), 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 1000, 'notnull' => -1,), 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'position' => 1000, 'notnull' => 1, 'default' => '1', 'arrayofkeyval' => array(0 => 'Disabled', 1 => 'Enabled')), ); diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index e4b74798e77..f52a41fe28a 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -308,13 +308,13 @@ class ExpenseReport extends CommonObject 'date_approve' => array('type' => 'datetime', 'label' => 'Date approve', 'enabled' => 1, 'visible' => -1, 'position' => 80), 'date_refuse' => array('type' => 'datetime', 'label' => 'Date refuse', 'enabled' => 1, 'visible' => -1, 'position' => 85), 'date_cancel' => array('type' => 'datetime', 'label' => 'Date cancel', 'enabled' => 1, 'visible' => -1, 'position' => 90), - 'fk_user_author' => array('type' => 'integer', 'label' => 'Fk user author', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 100), - 'fk_user_modif' => array('type' => 'integer', 'label' => 'Fk user modif', 'enabled' => 1, 'visible' => -1, 'position' => 105), - 'fk_user_valid' => array('type' => 'integer', 'label' => 'Fk user valid', 'enabled' => 1, 'visible' => -1, 'position' => 110), - 'fk_user_validator' => array('type' => 'integer', 'label' => 'Fk user validator', 'enabled' => 1, 'visible' => -1, 'position' => 115), - 'fk_user_approve' => array('type' => 'integer', 'label' => 'Fk user approve', 'enabled' => 1, 'visible' => -1, 'position' => 120), - 'fk_user_refuse' => array('type' => 'integer', 'label' => 'Fk user refuse', 'enabled' => 1, 'visible' => -1, 'position' => 125), - 'fk_user_cancel' => array('type' => 'integer', 'label' => 'Fk user cancel', 'enabled' => 1, 'visible' => -1, 'position' => 130), + 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user author', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 100), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user modif', 'enabled' => 1, 'visible' => -1, 'position' => 105), + 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user valid', 'enabled' => 1, 'visible' => -1, 'position' => 110), + 'fk_user_validator' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user validator', 'enabled' => 1, 'visible' => -1, 'position' => 115), + 'fk_user_approve' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user approve', 'enabled' => 1, 'visible' => -1, 'position' => 120), + 'fk_user_refuse' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user refuse', 'enabled' => 1, 'visible' => -1, 'position' => 125), + 'fk_user_cancel' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user cancel', 'enabled' => 1, 'visible' => -1, 'position' => 130), 'fk_c_paiement' => array('type' => 'integer', 'label' => 'Fk c paiement', 'enabled' => 1, 'visible' => -1, 'position' => 140), 'paid' => array('type' => 'integer', 'label' => 'Paid', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 145), 'note_public' => array('type' => 'html', 'label' => 'Note public', 'enabled' => 1, 'visible' => 0, 'position' => 150), diff --git a/htdocs/expensereport/class/expensereport_rule.class.php b/htdocs/expensereport/class/expensereport_rule.class.php index 6995ed3d609..61d087300ec 100644 --- a/htdocs/expensereport/class/expensereport_rule.class.php +++ b/htdocs/expensereport/class/expensereport_rule.class.php @@ -118,7 +118,7 @@ class ExpenseReportRule extends CommonObject 'datee' => array('type' => 'date', 'label' => 'Datee', 'enabled' => 1, 'visible' => -1, 'position' => 30), 'amount' => array('type' => 'double', 'label' => 'Amount', 'enabled' => 1, 'visible' => -1, 'position' => 40), 'restrictive' => array('type' => 'integer', 'label' => 'Restrictive', 'enabled' => 1, 'visible' => -1, 'position' => 50), - 'fk_user' => array('type' => 'integer', 'label' => 'User', 'enabled' => 1, 'visible' => -1, 'position' => 60), + 'fk_user' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'User', 'enabled' => 1, 'visible' => -1, 'position' => 60), 'fk_usergroup' => array('type' => 'integer', 'label' => 'Usergroup', 'enabled' => 1, 'visible' => -1, 'position' => 70), 'fk_c_type_fees' => array('type' => 'integer', 'label' => 'Type fees', 'enabled' => 1, 'visible' => -1, 'position' => 80), 'code_expense_rules_type' => array('type' => 'string', 'label' => 'Expense rule code', 'enabled' => 1, 'visible' => -1, 'position' => 90), diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 52446b3b9f7..c91b8d8dd57 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -46,7 +46,7 @@ class Fichinter extends CommonObject 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 'isModEnabled("societe")', 'visible' => -1, 'notnull' => 1, 'position' => 15), 'fk_projet' => array('type' => 'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label' => 'Fk projet', 'enabled' => 'isModEnabled("project")', 'visible' => -1, 'position' => 20), - 'fk_contrat' => array('type' => 'integer', 'label' => 'Fk contrat', 'enabled' => '$conf->contrat->enabled', 'visible' => -1, 'position' => 25), + 'fk_contrat' => array('type' => 'integer:Contrat:contrat/class/contrat.class.php', 'label' => 'Fk contrat', 'enabled' => '$conf->contrat->enabled', 'visible' => -1, 'position' => 25), 'ref' => array('type' => 'varchar(30)', 'label' => 'Ref', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'showoncombobox' => 1, 'position' => 30), 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'RefExt', 'enabled' => 1, 'visible' => 0, 'position' => 35), 'ref_client' => array('type' => 'varchar(255)', 'label' => 'RefCustomer', 'enabled' => 1, 'visible' => -1, 'position' => 36), diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index dc94226663c..e501c9d0f21 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3465,6 +3465,7 @@ class CommandeFournisseur extends CommonOrder $response->label = $langs->trans("SuppliersOrdersAwaitingReception"); $response->labelShort = $langs->trans("AwaitingReception"); $response->url = DOL_URL_ROOT.'/fourn/commande/list.php?search_status=3,4&mainmenu=commercial&leftmenu=orders_suppliers'; + $response->url_late = DOL_URL_ROOT.'/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&search_option=recv_late'; } while ($obj = $this->db->fetch_object($resql)) { diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index 5f84d1dfd1d..b333db53cb2 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -75,18 +75,17 @@ class FactureFournisseurRec extends CommonInvoice protected $table_ref_field = 'titre'; /** - * @var string The label of recurring invoice + * @var string The ref of the recurring invoice * @deprecated Use $title */ public $titre; /** - * @var string The label of recurring invoice + * @var string The ref of the recurring invoice */ public $title; /** * @var string - * @deprecated */ public $ref_supplier; /** @@ -351,7 +350,9 @@ class FactureFournisseurRec extends CommonInvoice $this->title = empty($this->title) ? '' : $this->title; $keyforref = $this->table_ref_field; $this->ref = $this->$keyforref; + $this->ref_supplier = empty($this->ref_supplier) ? '' : $this->ref_supplier; + $this->usenewprice = empty($this->usenewprice) ? 0 : $this->usenewprice; $this->suspended = empty($this->suspended) ? 0 : $this->suspended; // No frequency defined then no next date to execution diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index b2b320653f6..c9f9ab00829 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -12,7 +12,7 @@ * Copyright (C) 2015-2022 Ferran Marcet * Copyright (C) 2016-2023 Alexandre Spangaro * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2022 Gauthier VERDOL * Copyright (C) 2023 Nick Fragoulis * Copyright (C) 2024-2025 MDW @@ -2103,7 +2103,7 @@ class FactureFournisseur extends CommonInvoice * @param array $array_options extrafields array * @param int|null $fk_unit Code of the unit to use. Null to use the default one * @param int $origin_id id origin document - * @param float $pu_devise Amount in currency + * @param float $pu_devise Amount in currency * @param string $ref_supplier Supplier ref * @param int $special_code Special code * @param int $fk_parent_line Parent line id @@ -2812,7 +2812,7 @@ class FactureFournisseur extends CommonInvoice $datas['picto'] = img_picto('', $picto).' '.$langs->trans("SupplierInvoice").''; if ($this->type == self::TYPE_REPLACEMENT) { - $datas['picto'] .= ''.$langs->transnoentitiesnoconv("InvoiceReplace").''; + $datas['picto'] .= ''.$langs->transnoentitiesnoconv("InvoiceReplacement").''; } elseif ($this->type == self::TYPE_CREDIT_NOTE) { $datas['picto'] .= ''.$langs->transnoentitiesnoconv("CreditNote").''; } elseif ($this->type == self::TYPE_DEPOSIT) { diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index ec011d8d991..71723935bc5 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -149,6 +149,9 @@ $search_option = GETPOST('search_option', 'alpha'); if ($search_option == 'late') { $search_status = '1,2'; } +if ($search_option == 'recv_late') { + $search_status = '3,4'; +} $diroutputmassaction = $conf->fournisseur->commande->dir_output.'/temp/massgeneration/'.$user->id; @@ -1358,7 +1361,7 @@ if ($resql) { } // alert on late date $moreforfilter .= '
'; - $moreforfilter .= $langs->trans('Alert').' '; + $moreforfilter .= $langs->trans('Alert').' '; $moreforfilter .= '
'; $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index 61f87d1a5bb..f72c9c54e13 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -71,9 +71,9 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $ $id = (GETPOSTINT('facid') ? GETPOSTINT('facid') : GETPOSTINT('id')); $lineid = GETPOSTINT('lineid'); -$title = GETPOST('title', 'alpha'); -$libelle = GETPOST('libelle', 'alpha'); -$ref_supplier = GETPOST('ref_supplier', 'alpha'); +$ref = GETPOST('title', 'alphanohtml') ? GETPOST('title', 'alphanohtml') : GETPOST('ref', 'alphanohtml'); +$label = GETPOST('label', 'alphanohtml'); +$ref_supplier = GETPOST('ref_supplier', 'alphanohtml'); $projectid = GETPOSTINT('projectid'); $year_date_when = GETPOST('year_date_when'); $month_date_when = GETPOST('month_date_when'); @@ -105,8 +105,8 @@ $pageprev = $page - 1; $pagenext = $page + 1; $object = new FactureFournisseurRec($db); -if (($id > 0 || $title) && $action != 'create' && $action != 'add') { - $ret = $object->fetch($id, $title); +if (($id > 0 || $ref) && $action != 'create' && $action != 'add') { + $ret = $object->fetch($id, $ref); if (! $ret) { setEventMessages($langs->trans("ErrorRecordNotFound"), null, 'errors'); } @@ -218,8 +218,8 @@ if (empty($reshook)) { if (! $error) { $object->subtype = GETPOSTINT('subtype'); $object->title = GETPOST('title', 'alphanohtml'); - $object->libelle = GETPOST('libelle', 'alpha'); // deprecated - $object->label = GETPOST('libelle', 'alpha'); + $object->ref = GETPOST('title', 'alphanohtml'); + $object->label = GETPOST('label', 'alpha'); $object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml'); $object->note_private = GETPOST('note_private', 'restricthtml'); @@ -280,7 +280,6 @@ if (empty($reshook)) { } // Delete - //TODO : Droits if ($action == 'confirm_deleteinvoice' && $confirm == 'yes' && $permissiontodelete) { $object->delete($user); @@ -311,17 +310,16 @@ if (empty($reshook)) { } } } elseif ($action == 'settitle' && $permissiontoadd) { - $result = $object->setValueFrom('titre', $title, '', null, 'text', '', $user); + $result = $object->setValueFrom('titre', $ref, '', null, 'text', '', $user); if ($result > 0) { - $object->titre = $title; // deprecated - $object->title = $title; - $object->ref = $object->title; + $object->title = $ref; + $object->ref = $ref; } else { $error++; if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); - setEventMessages($langs->trans('ErrorTitreAlreadyExists', $title), null, 'errors'); + setEventMessages($langs->trans('ErrorTitreAlreadyExists', $ref), null, 'errors'); } else { setEventMessages($object->error, $object->errors, 'errors'); } @@ -392,16 +390,9 @@ if (empty($reshook)) { } elseif ($action == 'setmulticurrencyrate' && $permissiontoadd) { // Multicurrency rate $result = $object->setMulticurrencyRate((float) price2num(GETPOST('multicurrency_tx')), GETPOSTINT('calculation_mode')); - } elseif ($action == 'setlibelle' && $permissiontoadd) { - // Set label - $object->fetch($id); - $object->label = GETPOST('libelle'); - $object->libelle = $object->label; - $result = $object->update($user); - - if ($result < 0) { - dol_print_error($db); - } + } elseif ($action == 'setlabel' && $permissiontoadd) { + // Set bank account + $result = $object->setValueFrom('libelle', $label, '', null, 'text', '', $user); } // Delete line @@ -685,7 +676,7 @@ if (empty($reshook)) { $date_end_fill = GETPOSTINT('date_end_fill'); // Margin - $fournprice = price2num(GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : ''); + $fournprice = (int) (GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only $buyingprice = price2num(GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''); // If buying_price is '0', we must keep this value // Local Taxes @@ -998,7 +989,7 @@ if ($action == 'create') { // Label print '' . $langs->trans("Label") . ''; - print ''; + print ''; print ''; // Author @@ -1256,8 +1247,8 @@ if ($action == 'create') { // Label print ''; - print '' . $form->editfieldkey("Label", 'libelle', $object->libelle, $object, (int) $usercancreate) . ''; - print '' . $form->editfieldval("Label", 'libelle', $object->libelle, $object, $usercancreate) . ''; + print '' . $form->editfieldkey("Label", 'label', $object->label, $object, (int) $usercancreate) . ''; + print '' . $form->editfieldval("Label", 'label', $object->label, $object, $usercancreate) . ''; print ''; // Payment term diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index 15bc4d690ad..bc0efc6f16d 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -711,8 +711,6 @@ while ($i < $imaxinloop) { print $object->getLibStatut(5); } elseif ($key == 'rowid') { print $object->showOutputField($val, $key, (string) $object->id, ''); - } elseif ($key == 'label') { - print $object->showOutputField($val, $key, $object->label, ''); } else { print $object->showOutputField($val, $key, $object->$key, ''); } diff --git a/htdocs/install/mysql/tables/llx_societe_perentity-multicompany.sql b/htdocs/install/mysql/tables/llx_societe_perentity-multicompany.sql index a8d28fb6b22..64308faacac 100644 --- a/htdocs/install/mysql/tables/llx_societe_perentity-multicompany.sql +++ b/htdocs/install/mysql/tables/llx_societe_perentity-multicompany.sql @@ -28,5 +28,5 @@ create table llx_societe_perentity accountancy_code_supplier varchar(32), -- supplier accountancy auxiliary account accountancy_code_sell varchar(32), -- Selling accountancy code accountancy_code_buy varchar(32), -- Buying accountancy code - vat_reverse_charge tinyint DEFAULT 0 -- VAT reverse charge + vat_reverse_charge tinyint DEFAULT 0 )ENGINE=innodb; diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index efced43e276..adb54eb4edd 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -5227,6 +5227,7 @@ function migrate_accountingbookkeeping(int $entity) $error = 0; $resultstring = ''; + $bookKeepingAddon = ''; // For the moment we set the numbering rule to neon (the rule argon has a lot of critical bugs to fix first). if (getDolGlobalString('BOOKKEEPING_ADDON') == '') { @@ -5241,7 +5242,7 @@ function migrate_accountingbookkeeping(int $entity) if ($bookKeepingAddon === 'mod_bookkeeping_argon') { $db->begin(); - $sql = "SELECT DISTINCT YEAR(doc_date) as doc_year, MONTH(doc_date) as doc_month, code_journal, piece_num FROM {$db->prefix()}accounting_bookkeeping"; + $sql = "SELECT DISTINCT YEAR(doc_date) as doc_year, MONTH(doc_date) as doc_month, code_journal, piece_num FROM ".$db->prefix()."accounting_bookkeeping"; $sql .= " WHERE ref IS NULL AND entity = ".((int) $entity); $sql .= " ORDER BY doc_year, doc_month, code_journal, piece_num"; diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 5a698c6e186..24e06f1ef55 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -100,6 +100,7 @@ AccountAccounting=Accounting account AccountAccountingShort=Account SubledgerAccount=Subledger account SubledgerAccountLabel=Subledger account label +LedgerAccount=Ledger account ShowAccountingAccount=Show accounting account ShowAccountingJournal=Show accounting journal ShowAccountingAccountInLedger=Show accounting account in ledger @@ -512,3 +513,5 @@ ClickToShowAlreadyExportedLines=Click to show already exported lines NAccounts=%s accounts ACCOUNTING_USE_TREASURY_Desc=This is the mode for treasury accountancy. We are using the payments only and their date for doing the accountancy. ACCOUNTING_USE_NON_TREASURY_Desc=This is the mode for real accountancy. We are using both the invoices and payments for doing the accountancy. +PieceDesc=The reference of the source document that generates this bank transaction (Invoice Ref, Expense report ref, ...) +BankTransactionRef=A reference for the bank transaction (Optional, an automatic ID is already generated) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 98051d3cad5..4b3a068a637 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -28,6 +28,7 @@ FileCheckDolibarr=Check integrity of application files AvailableOnlyOnPackagedVersions=The local file for integrity checking is only available when the application is installed from an official package XmlNotFound=Xml Integrity File of application not found SessionId=Session ID +MenuID=Menu ID SessionSaveHandler=Handler to save sessions SessionSavePath=Session save location PurgeSessions=Purge of sessions @@ -1281,6 +1282,8 @@ Delays_MAIN_DELAY_CHEQUES_TO_DEPOSIT=Check deposit not done Delays_MAIN_DELAY_EXPENSEREPORTS=Expense report to approve Delays_MAIN_DELAY_HOLIDAYS=Leave requests to approve Delays_MAIN_DELAY_MRP=Manufacturing order in progress +Delays_MAIN_DELAY_SUPPLIER_PROPALS_TO_CLOSE=Supplier proposal not closed +Delays_MAIN_DELAY_SUPPLIER_PROPALS_TO_BILL=Supplier proposal not billed SetupDescription1=Before starting to use Dolibarr some initial parameters must be defined and modules enabled/configured. SetupDescription2=The following two sections are mandatory (the two first entries in the Setup menu): SetupDescription3=%s -> %s

Basic parameters used to customize the default behavior of your application (e.g for country-related features). @@ -1864,6 +1867,7 @@ DetailLangs=Lang file name for label code translation DetailUser=Intern / Extern / All Target=Target Targets=Targets +OpenLinkInto=Open link into DetailTarget=Target for links (_blank top opens a new window) DetailLevel=Level (-1:top menu, 0:header menu, >0 menu and sub menu) ModifMenu=Menu change @@ -2546,7 +2550,9 @@ TextTranslation=Text translation ImageGeneration=Image generation VideoGeneration=Video generation AudioGeneration=Audio generation -AIPromptForFeatures=AI custom prompts or models for features +AIPromptForFeatures=AI custom prompts for features (AI service %s) +AIModelForFeature=AI model for features (AI service %s) +NewCustomPrompt=New custom prompt AudioTranscription=Audio transcription AudioTranslation=Audio translation EnterAnIP=Enter an IP address @@ -2591,7 +2597,7 @@ MainAuthenticationOidcLogoutRedirectUrlDesc=Dolibarr logout URL to authorize on MainAuthenticationOidcLoginClaimName=Login claim MainAuthenticationOidcLoginClaimDesc=OpenID Connect claim matching the Dolibarr user login. If not set or empty, defaults to email BlackListWords=Black list of words -BlackListWordsHelp=Words must be separated by a coma (",") +BlackListWordsHelp=List of words that will be completely removed from any answer. Words must be separated by a coma (",") BlackListWordsAIHelp=This is a list of words that will be completely removed from the result of any AI requests Pre-PromptHelp=This text will always be added before the text you enter to make an AI request Post-PromptHelp=This text will always be added after the text you enter to make an AI request @@ -2634,7 +2640,7 @@ FilesIntegrityDesc=If you want to check the integrity of files instead of databa AttributeCodeHelp=A code of your choice (without special chars and spaces) to identify the property.
Note that if an object B is created from an existing object A that has a different type (for example creation of an invoice from an order), the value of the complementary attributes of A are also copied into the complementary attributes of B when the code of the attribute is the same. ThereIsMoreThanXAnswers=There is more than %s answers with your filter. Please add more filters... PdfAddTermOfSaleHelp=You can upload the file at the bottom of this setup page -WarningOnlineSignature=Please note that this function allows a person (customer, supplier...) to insert, online, the image of his signature in the PDF document. As for a handwritten signature, such a signature can be made by anyone and might not have the same legal value as a legal electronic signature system going through an authorized trusted third party. If you need this level of security, you can contact an integrator for more information or check for addons on www.dolistore.org. +WarningOnlineSignature=Please note that this function allows a person (customer, supplier...) to insert, online, the image of his signature in the PDF document. As for a handwritten signature, such a signature can be made by anyone and might not have the same legal value as a legal electronic signature system going through an authorized trusted third party. If you need this level of security, you can contact an integrator for more information or check for addons on %s. UploadExtensionRestriction=List of forbidden file extensions to upload UploadExtensionRestrictionExemple=htm, html, shtml, js, php Privileges=Privileges @@ -2643,7 +2649,6 @@ PDF_XXX_SHOW_PRICE_INCL_TAX=Show column Price including tax AvailableWithSomePDFTemplatesOnly=Feature not supported on old PDF templates SelectAService=Select the kind of service to use SelectFeatureToTest=Select the feature to test -AIModelForFeature=AI model for features (AI service %s) communityRepo=Community repository online=Online NotConnected=Not connected @@ -2662,4 +2667,6 @@ MULTICURRENCY_APP_ENDPOINT=API endpoint URL to get live multicurrencies from a s NoWebsite=No website UploadName=Upload MAIN_SECURITY_MAXFILESIZE_DOWNLOADED=Max size of downloaded files -ShowTopMenuURLIntoAFrame=Show the top menu URL into a frame +ShowTopMenuURLIntoAFrame=Show the content into a frame +SameWindow=Same window +NewWindow=New window / New tab diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index 2a5f7247934..3da93f477e7 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -209,3 +209,4 @@ ReadMore = Read more ReadLess = Read less RecurringEvent=Recurring event EventPartOfARecurringSerie=Event is part of a recurring serie with ID %s +BookCalSystem=Online booking diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index d437ca16b6c..b89ae8375e7 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -31,6 +31,7 @@ Reconciliation=Reconciliation RIB=Bank Account Number IBAN=IBAN number BIC=BIC/SWIFT code +CCI=Interbank code SwiftValid=BIC/SWIFT valid SwiftNotValid=BIC/SWIFT not valid IbanValid=BAN valid diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index eca1297a949..328a1dbb79d 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -465,4 +465,4 @@ ThirdPartyMustBeACustomerToCreateBANOnStripe=The third-party must be a customer NewSocNameForClone=New company name ConfirmCloneThirdparties=Are you sure that you want to clone %s company ? SocialNetworksBusiness=Social networks for company -ErrorCommercialNotAllowedForThirdparty=The sales representative is not allowed on this company. +ErrorCommercialNotAllowedForThirdparty=The user %s has not the permission to see all thirdparties and is not an allowed sale representative of the company. diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 29f1413e10d..fbb3dab2265 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -369,4 +369,8 @@ SummarizeTwentyFivePercent=25%% SummarizeFiftyPercent=50%% SummarizeSeventyFivePercent=75%% TextSummarize=Text summarize +RephraserByAI=Rephrase message in +RephraseStyleProfessional=Professional style +RephraseStyleHumouristic=Humouristic style +TextRephraser=Text style rephraser AIEnhancements=AI Enhancements diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 40bbae6106a..62fecfd6151 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -160,6 +160,7 @@ MovementLabel=Label of movement TypeMovement=Direction of movement DateMovement=Date of movement InventoryCode=Movement or inventory code +LabelMovement=Label movement IsInPackage=Contained into package WarehouseAllowNegativeTransfer=Stock can be negative qtyToTranferIsNotEnough=You don't have enough stock from your source warehouse and your setup does not allow negative stocks. diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index b5c2f4365d7..dceeb40b079 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1280,7 +1280,7 @@ if (empty($conf->browser->firefox)) { define('ROWS_9', 8); } -$heightforframes = 50; +$heightforframes = 52; // Used by frames.php page // Init menu manager if (!defined('NOREQUIREMENU')) { @@ -3158,7 +3158,7 @@ function top_menu_search() * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage * For other external page: http://server/url * @param string $notused Deprecated. Used in past to add content into left menu. Hooks can be used now. - * @param array,type:string,fk_mainmenu:string,fk_leftmenu:string,url:string,titre:string,perms:string,target:string,mainmenu:string,leftmenu:string,position:int,level?:int,prefix:string}> $menu_array_after Table of menu entries to show after entries of menu handler + * @param array,type:string,fk_mainmenu:string,fk_leftmenu:string,url:string,titre:string,perms:string,target:string,mainmenu:string,leftmenu:string,position:int,showtopmenuinframe:int,level?:int,prefix:string}> $menu_array_after Table of menu entries to show after entries of menu handler * @param int $leftmenuwithoutmainarea Must be set to 1. 0 by default for backward compatibility with old modules. * @param string $title Title of web page * @param int<0,1> $acceptdelayedhtml 1 if caller request to have html delayed content not returned but saved into global $delayedhtmlcontent (so caller can show it at end of page to avoid flash FOUC effect) diff --git a/htdocs/mrp/class/moline.class.php b/htdocs/mrp/class/moline.class.php index a7758c292cd..e9b07ebb1d0 100644 --- a/htdocs/mrp/class/moline.class.php +++ b/htdocs/mrp/class/moline.class.php @@ -109,8 +109,8 @@ class MoLine extends CommonObjectLine 'fk_stock_movement' => array('type' => 'integer', 'label' => 'StockMovement', 'enabled' => 1, 'visible' => -1, 'position' => 155), 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 160), 'tms' => array('type' => 'timestamp', 'label' => 'Tms', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 165), - 'fk_user_creat' => array('type' => 'integer', 'label' => 'UserCreation', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 170), - 'fk_user_modif' => array('type' => 'integer', 'label' => 'UserModification', 'enabled' => 1, 'visible' => -1, 'position' => 175), + 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserCreation', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 170), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModification', 'enabled' => 1, 'visible' => -1, 'position' => 175), 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -1, 'position' => 180), 'fk_default_workstation' => array('type' => 'integer', 'label' => 'DefaultWorkstation', 'enabled' => 1, 'visible' => 1, 'notnull' => 0, 'position' => 185), 'fk_unit' => array('type' => 'int', 'label' => 'Unit', 'enabled' => 1, 'visible' => 1, 'notnull' => 0, 'position' => 186) diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index ca28657af40..7b3c98b22c8 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -126,7 +126,7 @@ class Opensurveysondage extends CommonObject 'allow_comments' => array('type' => 'integer', 'label' => 'Allowcomments', 'enabled' => '1', 'position' => 70, 'notnull' => 1, 'visible' => -1,), 'allow_spy' => array('type' => 'integer', 'label' => 'Allowspy', 'enabled' => '1', 'position' => 75, 'notnull' => 1, 'visible' => -1,), 'sujet' => array('type' => 'mediumtext', 'label' => 'Sujet', 'enabled' => '1', 'position' => 80, 'notnull' => 0, 'visible' => -1,), - 'id_sondage_admin' => array('type' => 'char(24)', 'label' => 'Idsondageadmin', 'enabled' => '1', 'position' => 85, 'notnull' => 0, 'visible' => -1,), + //'id_sondage_admin' => array('type' => 'char(24)', 'label' => 'Idsondageadmin', 'enabled' => '1', 'position' => 85, 'notnull' => 0, 'visible' => -1,), ); /** @@ -155,6 +155,12 @@ class Opensurveysondage extends CommonObject */ public $fk_user_creat; + /** + * @var string title of survey + * @deprecated Rename the field titre into title into the table to allow to change this in fields and remove this declaration. + */ + public $titre; + /** * @var string title of survey */ diff --git a/htdocs/opensurvey/lib/opensurvey.lib.php b/htdocs/opensurvey/lib/opensurvey.lib.php index ef82c0e0970..ef3d867ddca 100644 --- a/htdocs/opensurvey/lib/opensurvey.lib.php +++ b/htdocs/opensurvey/lib/opensurvey.lib.php @@ -77,8 +77,7 @@ function opensurvey_prepare_head(Opensurveysondage $object) */ function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = [], $numsondage = '') { - global $conf, $langs, $mysoc; - global $dolibarr_main_url_root; + global $langs, $mysoc; // $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; @@ -86,48 +85,17 @@ function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $ print ''; + include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + htmlPrintOnlineHeader($mysoc, $langs, 'OPENSURVEY_IMAGE_PUBLIC_INTERFACE'); + print ''."\n"; print '
'."\n"; + print '
'."\n"; print ''; print ''."\n"; print "\n"; - // Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) - // Define logo and logosmall - $logosmall = $mysoc->logo_small; - $logo = $mysoc->logo; - // print ''."\n"; - // Define urllogo - $urllogo = ''; - $urllogofull = ''; - if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); - $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); - } elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); - $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); - } - - // Output html code for logo - if ($urllogo) { - print '
'; - print '
'; - print ''; - print '
'; - if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { - print ''; - } - print '
'; - } - - if (getDolGlobalString('OPENSURVEY_IMAGE_PUBLIC_INTERFACE')) { - print '
'; - print ''; - print '
'; - } - print '


'; } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 19b3a2681c7..60591dbe04b 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -870,8 +870,8 @@ class Product extends CommonObject 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 500), 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 501), //'date_valid' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502), - 'fk_user_author' => array('type' => 'integer', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 510, 'foreignkey' => 'llx_user.rowid'), - 'fk_user_modif' => array('type' => 'integer', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 511), + 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 510, 'foreignkey' => 'llx_user.rowid'), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 511), //'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512), 'localtax1_tx' => array('type' => 'double(6,3)', 'label' => 'Localtax1tx', 'enabled' => 1, 'position' => 150, 'notnull' => 0, 'visible' => -1,), 'localtax1_type' => array('type' => 'varchar(10)', 'label' => 'Localtax1type', 'enabled' => 1, 'position' => 155, 'notnull' => 1, 'visible' => -1,), diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index d00b85f8be8..9cc5c3841a8 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -183,6 +183,8 @@ if (empty($reshook)) { $search[$key.'_dtend'] = ''; } } + $search['status'] = ''; // To remove when statut and status are merged + $search_status = ''; // To remove when statut and status are merged $toselect = array(); $search_array_options = array(); $search_category_list = array(); @@ -256,17 +258,17 @@ if ($separatedPMP) { } $sql .= " WHERE t.entity IN (".getEntity('stock').")"; foreach ($search as $key => $val) { - if (array_key_exists($key, $object->fields) || $key == 'status') { - $class_key = $key; - if ($class_key == 'status') { - $class_key = 'statut'; // remove this after refactoring entrepot.class property statut to status - } + $class_key = $key; + if ($class_key == 'status') { + $class_key = 'statut'; // remove this after refactoring entrepot.class property statut to status + } + if (array_key_exists($class_key, $object->fields)) { if (($key == 'status' && $search[$key] == -1) || $key == 'entity') { continue; } - $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); - if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { - if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) { + $mode_search = (($object->isInt($object->fields[$class_key]) || $object->isFloat($object->fields[$class_key])) ? 1 : 0); + if ((strpos($object->fields[$class_key]['type'], 'integer:') === 0) || (strpos($object->fields[$class_key]['type'], 'sellist:') === 0) || !empty($object->fields[$class_key]['arrayofkeyval'])) { + if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$class_key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$class_key]['arrayofkeyval'])))) { $search[$key] = ''; } $mode_search = 2; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 747621c1156..555c1aec89b 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -7,6 +7,7 @@ * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * Copyright (C) 2024 Alexandre Spangaro + * Copyright (C) 2025 Benjamin Falière * * 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 @@ -1724,9 +1725,9 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { 10 => array('lang' => 'propal', 'enabled' => isModEnabled("propal"), 'perm' => $user->hasRight('propal', 'creer') ? true : false, 'label' => 'AddProp', 'url' => '/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), 20 => array('lang' => 'orders', 'enabled' => isModEnabled("order"), 'perm' => $user->hasRight('commande', 'creer') ? true : false, 'label' => 'CreateOrder', 'url' => '/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), 30 => array('lang' => 'bills', 'enabled' => isModEnabled("invoice"), 'perm' => $user->hasRight('facture', 'creer') ? true : false, 'label' => 'CreateBill', 'url' => '/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - 40 => array('lang' => 'supplier_proposal', 'enabled' => isModEnabled("supplier_proposal"), 'perm' => $user->hasRight('supplier_proposal', 'creer') ? true : false, 'label' => 'AddSupplierProposal', 'url' => '/supplier_proposal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - 50 => array('lang' => 'suppliers', 'enabled' => isModEnabled("supplier_order"), 'perm' => $user->hasRight('fournisseur', 'commande', 'creer') ? true : false, 'label' => 'AddSupplierOrder', 'url' => '/fourn/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - 60 => array('lang' => 'suppliers', 'enabled' => isModEnabled("supplier_invoice"), 'perm' => $user->hasRight('fournisseur', 'facture', 'creer') ? true : false, 'label' => 'AddSupplierInvoice', 'url' => '/fourn/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + 40 => array('lang' => 'supplier_proposal', 'enabled' => isModEnabled("supplier_proposal"), 'perm' => $user->hasRight('supplier_proposal', 'creer') ? true : false, 'label' => 'AddSupplierProposal', 'url' => '/supplier_proposal/card.php?action=create&projectid='.$object->id), + 50 => array('lang' => 'suppliers', 'enabled' => isModEnabled("supplier_order"), 'perm' => $user->hasRight('fournisseur', 'commande', 'creer') ? true : false, 'label' => 'AddSupplierOrder', 'url' => '/fourn/commande/card.php?action=create&projectid='.$object->id), + 60 => array('lang' => 'suppliers', 'enabled' => isModEnabled("supplier_invoice"), 'perm' => $user->hasRight('fournisseur', 'facture', 'creer') ? true : false, 'label' => 'AddSupplierInvoice', 'url' => '/fourn/facture/card.php?action=create&projectid='.$object->id), 70 => array('lang' => 'interventions', 'enabled' => isModEnabled("intervention"), 'perm' => $user->hasRight('fichinter', 'creer') ? true : false, 'label' => 'AddIntervention', 'url' => '/fichinter/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), 80 => array('lang' => 'contracts', 'enabled' => isModEnabled("contract"), 'perm' => $user->hasRight('contrat', 'creer') ? true : false, 'label' => 'AddContract', 'url' => '/contrat/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), 90 => array('lang' => 'trips', 'enabled' => isModEnabled("expensereport"), 'perm' => $user->hasRight('expensereport', 'creer') ? true : false, 'label' => 'AddTrip', 'url' => '/expensereport/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 3e3e42bffb1..a6cf2487e11 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -347,7 +347,7 @@ class Project extends CommonObject 'ref' => array('type' => 'varchar(50)', 'label' => 'Ref', 'enabled' => 1, 'visible' => 1, 'showoncombobox' => 1, 'position' => 15, 'searchall' => 1), 'title' => array('type' => 'varchar(255)', 'label' => 'ProjectLabel', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 17, 'showoncombobox' => 2, 'searchall' => 1), 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => 3, 'notnull' => 1, 'position' => 19), - 'fk_soc' => array('type' => 'integer', 'label' => 'ThirdParty', 'enabled' => 1, 'visible' => 0, 'position' => 20), + 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 1, 'visible' => 0, 'position' => 20), 'dateo' => array('type' => 'date', 'label' => 'DateStart', 'enabled' => 1, 'visible' => -1, 'position' => 30), 'datee' => array('type' => 'date', 'label' => 'DateEnd', 'enabled' => 1, 'visible' => 1, 'position' => 35), 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'visible' => 3, 'position' => 55, 'searchall' => 1), @@ -358,7 +358,7 @@ class Project extends CommonObject 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 90, 'searchall' => 1), 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'ModelPdf', 'enabled' => 1, 'visible' => 0, 'position' => 95), 'date_close' => array('type' => 'datetime', 'label' => 'DateClosing', 'enabled' => 1, 'visible' => 0, 'position' => 105), - 'fk_user_close' => array('type' => 'integer', 'label' => 'UserClosing', 'enabled' => 1, 'visible' => 0, 'position' => 110), + 'fk_user_close' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserClosing', 'enabled' => 1, 'visible' => 0, 'position' => 110), 'opp_amount' => array('type' => 'double(24,8)', 'label' => 'OpportunityAmountShort', 'enabled' => 1, 'visible' => 'getDolGlobalString("PROJECT_USE_OPPORTUNITIES")', 'position' => 115), 'budget_amount' => array('type' => 'double(24,8)', 'label' => 'Budget', 'enabled' => 1, 'visible' => -1, 'position' => 119), 'usage_opportunity' => array('type' => 'integer', 'label' => 'UsageOpportunity', 'enabled' => 1, 'visible' => -1, 'position' => 130), @@ -377,8 +377,8 @@ class Project extends CommonObject // Generic 'datec' => array('type' => 'datetime', 'label' => 'DateCreationShort', 'enabled' => 1, 'visible' => -2, 'position' => 400), 'tms' => array('type' => 'timestamp', 'label' => 'DateModificationShort', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 405), - 'fk_user_creat' => array('type' => 'integer', 'label' => 'UserCreation', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 410), - 'fk_user_modif' => array('type' => 'integer', 'label' => 'UserModification', 'enabled' => 1, 'visible' => 0, 'position' => 415), + 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserCreation', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 410), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModification', 'enabled' => 1, 'visible' => 0, 'position' => 415), 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -1, 'position' => 420), 'email_msgid' => array('type' => 'varchar(255)', 'label' => 'EmailMsgID', 'enabled' => 1, 'visible' => -1, 'position' => 450, 'help' => 'EmailMsgIDWhenSourceisEmail', 'csslist' => 'tdoverflowmax125'), 'fk_statut' => array('type' => 'smallint(6)', 'label' => 'Status', 'alias' => 'status', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 500, 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Validated', 2 => 'Closed')), diff --git a/htdocs/public/bookcal/index.php b/htdocs/public/bookcal/index.php index a32ebb84521..b5b32eba91a 100644 --- a/htdocs/public/bookcal/index.php +++ b/htdocs/public/bookcal/index.php @@ -147,46 +147,8 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ print ''; - $urllogo = ''; - - // Define urllogo - if (getDolGlobalInt('BOOKCAL_SHOW_COMPANY_LOGO') || getDolGlobalString('BOOPKCAL_PUBLIC_INTERFACE_TOPIC')) { - // Print logo - if (getDolGlobalInt('BOOKCAL_SHOW_COMPANY_LOGO')) { - $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; - - if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); - } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$mysoc->logo); - } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { - $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; - } - } - } - - print '
'; - // Output html code for logo - print '
'; - print '
'; - if ($urllogo) { - print ''; - print ''; - print ''; - } - if (getDolGlobalString('BOOKCAL_PUBLIC_INTERFACE_TOPIC')) { - print '
'.(getDolGlobalString('BOOKCAL_PUBLIC_INTERFACE_TOPIC') ? getDolGlobalString('BOOKCAL_PUBLIC_INTERFACE_TOPIC') : $langs->trans("BookCalSystem")).''; - } - if (empty($urllogo) && ! getDolGlobalString('BOOKCAL_PUBLIC_INTERFACE_TOPIC')) { - print $mysoc->name; - } - print '
'; - if (!getDolGlobalInt('MAIN_HIDE_POWERED_BY')) { - print ''; - } - print '
'; - - print '
'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + htmlPrintOnlineHeader($mysoc, $langs, 1, getDolGlobalString('BOOKCAL_PUBLIC_INTERFACE_TOPIC', $langs->trans("BookCalSystem")), 'BOOKCAL_PUBLIC_INTERFACE_IMAGE'); print '
'; } diff --git a/htdocs/public/company/new.php b/htdocs/public/company/new.php index 282f79b52c0..0fea42142e9 100644 --- a/htdocs/public/company/new.php +++ b/htdocs/public/company/new.php @@ -87,7 +87,7 @@ if (!isModEnabled('societe')) { } if (!getDolGlobalString('SOCIETE_ENABLE_PUBLIC')) { - httponly_accessforbidden("Online form for contact for public visitors has not been enabled"); + httponly_accessforbidden("Online form for contact for public visitors has not been enabled (option SOCIETE_ENABLE_PUBLIC)"); } @@ -127,38 +127,8 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ print ''; - // Define urllogo - $urllogo = DOL_URL_ROOT . '/theme/common/login_logo.png'; - - if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output . '/logos/thumbs/' . $mysoc->logo_small)) { - $urllogo = DOL_URL_ROOT . '/viewimage.php?cache=1&modulepart=mycompany&file=' . urlencode('logos/thumbs/' . $mysoc->logo_small); - } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output . '/logos/' . $mysoc->logo)) { - $urllogo = DOL_URL_ROOT . '/viewimage.php?cache=1&modulepart=mycompany&file=' . urlencode('logos/' . $mysoc->logo); - } elseif (is_readable(DOL_DOCUMENT_ROOT . '/theme/dolibarr_logo.svg')) { - $urllogo = DOL_URL_ROOT . '/theme/dolibarr_logo.svg'; - } - - print '
'; - - // Output html code for logo - // if ($urllogo) { // test always true - print '
'; - print '
'; - print ''; - print '
'; - if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { - print ''; - } - print '
'; - // } - - if (getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION')) { - print '
'; - print ''; - print '
'; - } - - print '
'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + htmlPrintOnlineHeader($mysoc, $langs, 1, getDolGlobalString('THIRDPARTY_PUBLIC_INTERFACE_TOPIC'), 'THIRDPARTY_PUBLIC_INTERFACE_IMAGE'); print '
'; } diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 96b2f9eced8..649c34bac72 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -131,38 +131,8 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ print ''; - // Define urllogo - $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; - - if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); - } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); - } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { - $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; - } - - print '
'; - - // Output html code for logo - if ($urllogo) { - print '
'; - print '
'; - print ''; - print '
'; - if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { - print ''; - } - print '
'; - } - - if (getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION')) { - print '
'; - print ''; - print '
'; - } - - print '
'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + htmlPrintOnlineHeader($mysoc, $langs, 1, getDolGlobalString('MEMBER_PUBLIC_INTERFACE'), 'MEMBER_IMAGE_PUBLIC_REGISTRATION'); print '
'; } diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 2a7c46dee7e..fb78d229e3a 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -249,7 +249,7 @@ $title = $langs->trans("OnlineSignature"); $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; llxHeader($head, $title, '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1); -htmlPrintOnlineHeader($mysoc, $langs); +htmlPrintOnlineHeader($mysoc, $langs, 1, '', 'ONLINE_SIGN_IMAGE_PUBLIC_INTERFACE', 'ONLINE_SIGN_LOGO_'.$suffix, 'ONLINE_SIGN_LOGO'); if ($action == 'refusepropal') { print $form->formconfirm($_SERVER["PHP_SELF"].'?ref='.urlencode($ref).'&securekey='.urlencode($SECUREKEY).(isModEnabled('multicompany') ? '&entity='.$entity : ''), $langs->trans('RefusePropal'), $langs->trans('ConfirmRefusePropal', $object->ref), 'confirm_refusepropal', '', '', 1); @@ -280,47 +280,14 @@ print ''; print "\n"; print ''."\n"; -print ''."\n"; - -// Show logo (search order: logo defined by ONLINE_SIGN_LOGO_suffix, then ONLINE_SIGN_LOGO_, then small company logo, large company logo, theme logo, common logo) -// Define logo and logosmall -$logosmall = $mysoc->logo_small; -$logo = $mysoc->logo; -$paramlogo = 'ONLINE_SIGN_LOGO_'.$suffix; -if (getDolGlobalString($paramlogo)) { - $logosmall = getDolGlobalString($paramlogo); -} elseif (getDolGlobalString('ONLINE_SIGN_LOGO')) { - $logosmall = getDolGlobalString('ONLINE_SIGN_LOGO'); -} -//print ''."\n"; -// Define urllogo -$urllogo = ''; -$urllogofull = ''; -if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); - $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); -} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); - $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); -} -// Output html code for logo -if ($urllogo) { - print '
'; - print '
'; - print ''; - print '
'; - if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { - print ''; - } - print '
'; -} if ($source == 'proposal' && getDolGlobalString('PROPOSAL_IMAGE_PUBLIC_SIGN')) { print '
'; print ''; print '
'; } +print '
'."\n"; + // Output introduction text $text = ''; if (getDolGlobalString('ONLINE_SIGN_NEWFORM_TEXT')) { diff --git a/htdocs/public/opensurvey/index.php b/htdocs/public/opensurvey/index.php index 58df00bdfec..ec1ee30db9d 100644 --- a/htdocs/public/opensurvey/index.php +++ b/htdocs/public/opensurvey/index.php @@ -113,6 +113,8 @@ if (getDolGlobalString('MAIN_OPENSURVEY_CSS_URL')) { $conf->dol_hide_topmenu = 1; $conf->dol_hide_leftmenu = 1; +$conf->global->OPENSURVEY_ENABLE_PUBLIC_INTERFACE = 1; + if (!getDolGlobalString('OPENSURVEY_ENABLE_PUBLIC_INTERFACE')) { $langs->load("errors"); print '
'.$langs->trans('ErrorPublicInterfaceNotEnabled').'
'; @@ -127,6 +129,10 @@ $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; llxHeader($head, $langs->trans("Surveys"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1, 1); +include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +htmlPrintOnlineHeader($mysoc, $langs, 1, getDolGlobalString('OPENSURVEY_PUBLIC_INTERFACE_TOPIC'), 'OPENSURVEY_IMAGE_PUBLIC_INTERFACE', 'ONLINE_OPENSURVEY_LOGO_'.$suffix, 'ONLINE_OPENSURVEY_LOGO'); + + print ''."\n"; print '
'."\n"; print ''."\n"; @@ -137,47 +143,7 @@ print ''."\n"; print ''; print "\n"; -print ''."\n"; - -// Show logo (search order: logo defined by ONLINE_SIGN_LOGO_suffix, then ONLINE_SIGN_LOGO_, then small company logo, large company logo, theme logo, common logo) -// Define logo and logosmall -$logosmall = $mysoc->logo_small; -$logo = $mysoc->logo; -$paramlogo = 'ONLINE_OPENSURVEY_LOGO_'.$suffix; -if (getDolGlobalString($paramlogo)) { - $logosmall = getDolGlobalString($paramlogo); -} elseif (getDolGlobalString('ONLINE_OPENSURVEY_LOGO')) { - $logosmall = getDolGlobalString('ONLINE_OPENSURVEY_LOGO_'); -} -//print ''."\n"; -// Define urllogo -$urllogo = ''; -$urllogofull = ''; -if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); - $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); -} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); - $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); -} -// Output html code for logo -if ($urllogo) { - print '
'; - print '
'; - print ''; - print '
'; - if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { - print ''; - } - print '
'; -} - -if (getDolGlobalString('OPENSURVEY_IMAGE_PUBLIC_INTERFACE')) { - print '
'; - print ''; - print '
'; -} - +print ''."\n"; $results = $object->fetchAll($sortorder, $sortfield, 0, 0, '(status:=:1)'); $now = dol_now(); @@ -207,7 +173,7 @@ if (is_array($results)) { // Label print $langs->trans("Label").' : '; - print ''.dol_escape_htmltag($object->title).'
'; + print ''.dol_escape_htmltag(empty($object->titre) ? $object->title : $object->titre).'
'; // Date print $langs->trans("DateExpected").' : '; diff --git a/htdocs/public/partnership/new.php b/htdocs/public/partnership/new.php index 65dfd5a8c07..2dc3c80a62f 100644 --- a/htdocs/public/partnership/new.php +++ b/htdocs/public/partnership/new.php @@ -118,38 +118,8 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ print ''; - // Define urllogo - $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; - - if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); - } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); - } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { - $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; - } - - print '
'; - - // Output html code for logo - if ($urllogo) { - print '
'; - print '
'; - print ''; - print '
'; - if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { - print ''; - } - print '
'; - } - - if (getDolGlobalString('PARTNERSHIP_IMAGE_PUBLIC_REGISTRATION')) { - print '
'; - print ''; - print '
'; - } - - print '
'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + htmlPrintOnlineHeader($mysoc, $langs, 1, getDolGlobalString('PARTNERSHIP_PUBLIC_INTERFACE_TOPIC'), 'PARTNERSHIP_IMAGE_PUBLIC_REGISTRATION'); print '
'; } diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 306e7b5bf72..a0d2fe0b05e 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1010,6 +1010,7 @@ if (isModEnabled('paybox')) { } if (isModEnabled('stripe')) { print ''."\n"; + print ''."\n"; } print ''."\n"; print ''."\n"; @@ -2368,7 +2369,7 @@ if (preg_match('/^dopayment/', $action)) { // If we chose/clicked on the payme print ''."\n"; print ''."\n"; print ''."\n"; - print ''; + print ''."\n"; print ''."\n"; print ''."\n"; print ''; @@ -2376,7 +2377,28 @@ if (preg_match('/^dopayment/', $action)) { // If we chose/clicked on the payme print ''; print ''; - if (getDolGlobalString('STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION') || getDolGlobalString('STRIPE_USE_NEW_CHECKOUT')) { // Use a SCA ready method + // Make some check on amount: We accept an amount that is different to allow to pay an existing invoice partially or + // to allow to pay a membership with open amount, but for a payment of an order, we have no reason to accept partial payment. + $checkamount = 1; + $tmptag = dolExplodeIntoArray($fulltag, '.', '='); + if (array_key_exists('ORD', $tmptag) && (int) $tmptag['ORD'] > 0) { + include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; + $object = new Commande($db); + $result = $object->fetch((int) $tmptag['ORD']); + if ($result > 0) { + if ($object->total_ttc != $amount) { + $checkamount = 0; + } + } else { + $checkamount = 0; + } + } + if (!$checkamount) { + dol_syslog("Hack attempt detected", LOG_WARNING); + setEventMessages('Bad value for amount. Reported as a hack attempt.', null, 'errors'); + } + + if ($checkamount && (getDolGlobalString('STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION') || getDolGlobalString('STRIPE_USE_NEW_CHECKOUT'))) { // Use a SCA ready method require_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php'; $service = 'StripeLive'; @@ -2449,7 +2471,7 @@ if (preg_match('/^dopayment/', $action)) { // If we chose/clicked on the payme if (getDolGlobalString('STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION')) { if (empty($paymentintent)) { - print '
'.$langs->trans("Error").'
'; + print '
'.$langs->trans("Error").' - Failed to get PaymentIntent
'; } else { print ''; //$_SESSION["paymentintent_id"] = $paymentintent->id; diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index 146ec30845b..2eb515e1c80 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -58,7 +58,7 @@ if (is_numeric($entity)) { require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; - +require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; if (isModEnabled('paypal')) { require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypalfunctions.lib.php'; @@ -353,15 +353,18 @@ $db->close(); // If option to do a redirect somewhere else is defined. if (!empty($doactionsthenredirect)) { + $randomseckey = getRandomPassword(true, null, 20); + $_SESSION['paymentsessionkey'] = $randomseckey; + // Redirect to an error page // Paymentko page must be created for the specific website if (!defined('USEDOLIBARRSERVER') && !empty($ws_virtuelhost)) { - $ext_urlko = $ws_virtuelhost . '/paymentko.php?fulltag='.$FULLTAG; + $ext_urlko = $ws_virtuelhost . '/paymentko.php?paymentsessionkey='.urlencode($randomseckey).'&fulltag='.$FULLTAG; } else { - $ext_urlko = DOL_URL_ROOT.'/public/website/index.php?website='.urlencode($ws).'&pageref=paymentko&fulltag='.$FULLTAG; + $ext_urlko = DOL_URL_ROOT.'/public/website/index.php?paymentsessionkey='.urlencode($randomseckey).'&website='.urlencode($ws).'&pageref=paymentko&fulltag='.$FULLTAG; } - if (getDolGlobalInt('MARKETPLACE_PAYMENT_IN_FRAME') == 1) { // TODO Use a property in website module + if (getDolGlobalInt('MARKETPLACE_PAYMENT_IN_FRAME') == 1) { // TODO Remove this to make only a http redirect, if the website need a js redirect to parent frame, he must do it itself. dol_syslog("Now do a redirect in iframe mode in js to ".$ext_urlko, LOG_DEBUG, 0, '_payment'); // Redirect in js is not reliable diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 9564ced0a2b..1b7266c9797 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -60,10 +60,12 @@ if (is_numeric($entity)) { require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; if (isModEnabled('paypal')) { require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypalfunctions.lib.php'; } + /** * @var Conf $conf * @var DoliDB $db @@ -93,14 +95,6 @@ if (isModEnabled('paypal')) { $PAYPAL_API_PASSWORD = getDolGlobalString('PAYPAL_API_PASSWORD'); $PAYPAL_API_SIGNATURE = getDolGlobalString('PAYPAL_API_SIGNATURE'); $PAYPAL_API_SANDBOX = getDolGlobalString('PAYPAL_API_SANDBOX'); - /*$PAYPAL_API_OK = ""; - if ($urlok) { - $PAYPAL_API_OK = $urlok; - } - $PAYPAL_API_KO = ""; - if ($urlko) { - $PAYPAL_API_KO = $urlko; - }*/ $PAYPALTOKEN = GETPOST('TOKEN'); if (empty($PAYPALTOKEN)) { @@ -285,7 +279,10 @@ if (empty($doactionsthenredirect)) { } -// Another step to validate the payment (for payment modes like Paypal that need another step after the callback return for this). +// Add steps to validate payment is complete when we enter this page + + +// For Paypal: validate the payment (Paypal need another step after the callback return to validate the payment). if (isModEnabled('paypal') && $paymentmethod === 'paypal') { // We call this page only if payment is ok on payment system if (!empty($PAYPALTOKEN)) { // Get on url call @@ -293,11 +290,10 @@ if (isModEnabled('paypal') && $paymentmethod === 'paypal') { // We call this pag $fulltag = $FULLTAG; $payerID = !empty($PAYPALPAYERID) ? $PAYPALPAYERID : ''; // Set by newpayment.php + $ipaddress = $_SESSION['ipaddress']; $currencyCodeType = $_SESSION['currencyCodeType']; $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; $paymentType = $_SESSION['PaymentType']; // Value can be 'Mark', 'Sole', 'Sale' for example - // From env - $ipaddress = $_SESSION['ipaddress']; dol_syslog("Call paymentok with token=".$onlinetoken." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag, LOG_DEBUG, 0, '_payment'); @@ -364,6 +360,7 @@ if (isModEnabled('paypal') && $paymentmethod === 'paypal') { // We call this pag } } +// For Paybox if (isModEnabled('paybox')) { if ($paymentmethod === 'paybox') { // TODO Add a check to validate that payment is ok. @@ -371,6 +368,7 @@ if (isModEnabled('paybox')) { } } +// For Stripe if (isModEnabled('stripe')) { if ($paymentmethod === 'stripe') { // TODO Add a check to validate that payment is ok. We can request Stripe with payment_intent and payment_intent_client_secret @@ -378,42 +376,44 @@ if (isModEnabled('stripe')) { } } -// Check status of the object to verify if it is paid by external payment modules -$action = ''; -$parameters = [ - 'paymentmethod' => $paymentmethod, -]; -$reshook = $hookmanager->executeHooks('isPaymentOK', $parameters, $object, $action); -if ($reshook >= 0) { - if (isset($hookmanager->resArray['ispaymentok'])) { - dol_syslog('ispaymentok overwrite by hook return with value='.$hookmanager->resArray['ispaymentok'], LOG_DEBUG, 0, '_payment'); - $ispaymentok = $hookmanager->resArray['ispaymentok']; +// For other payment modules +if (!in_array($paymentmethod, array('paypal', 'paybox', 'stripe'))) { + // Check status of the object to verify if it is paid by external payment modules + $action = ''; + $parameters = [ + 'paymentmethod' => $paymentmethod, + ]; + $reshook = $hookmanager->executeHooks('isPaymentOK', $parameters, $object, $action); + if ($reshook >= 0) { + if (isset($hookmanager->resArray['ispaymentok'])) { + dol_syslog('ispaymentok overwrite by hook return with value='.$hookmanager->resArray['ispaymentok'], LOG_DEBUG, 0, '_payment'); + $ispaymentok = $hookmanager->resArray['ispaymentok']; + } } } - -// If data not provided into callback url, search them into the session env +// Get variable into the session env if (empty($ipaddress)) { $ipaddress = $_SESSION['ipaddress']; } -if (empty($TRANSACTIONID)) { - $TRANSACTIONID = empty($_SESSION['TRANSACTIONID']) ? '' : $_SESSION['TRANSACTIONID']; // pi_... or ch_... - if (empty($TRANSACTIONID) && GETPOST('payment_intent', 'alphanohtml')) { - // For the case we use STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 2 - $TRANSACTIONID = GETPOST('payment_intent', 'alphanohtml'); - } -} if (empty($FinalPaymentAmt)) { $FinalPaymentAmt = empty($_SESSION["FinalPaymentAmt"]) ? '' : $_SESSION["FinalPaymentAmt"]; } if (empty($currencyCodeType)) { $currencyCodeType = empty($_SESSION['currencyCodeType']) ? '' : $_SESSION['currencyCodeType']; } -// Seems used only by Paypal -if (empty($paymentType)) { +if (empty($paymentType)) { // Seems used only by Paypal $paymentType = empty($_SESSION["paymentType"]) ? '' : $_SESSION["paymentType"]; } +if (empty($TRANSACTIONID)) { + $TRANSACTIONID = empty($_SESSION['TRANSACTIONID']) ? '' : $_SESSION['TRANSACTIONID']; // pi_... or ch_... + if (empty($TRANSACTIONID) && GETPOST('payment_intent', 'alphanohtml')) { + // For the case we use STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 2 + $TRANSACTIONID = GETPOST('payment_intent', 'alphanohtml'); + } +} + $fulltag = $FULLTAG; $tmptag = dolExplodeIntoArray($fulltag, '.', '='); @@ -1072,9 +1072,19 @@ if ($ispaymentok) { $invoice = new Facture($db); $result = $invoice->createFromOrder($object, $user); if ($result > 0) { - $object->classifyBilled($user); - $invoice->validate($user); - // Creation of payment line + if ($FinalPaymentAmt != $object->total_ttc) { + // The amount paid can be lower than the order only if the user tried to modified the amount from the payment page. A payment has been received but it is a hack attempt + // We can add a line to reduce the amount of the invoice but with which vat ? + // TODO Test if vat on line is the same everywhere, if yes we can add + // $invoice->addline('Fix amount of invoice', $FinalPaymentAmt - $object->total_ttc, 1, $txtva); + // TODO Send a warning email. + } + + $object->classifyBilled($user); // The invoice has been create from the order so total is the same, so we can classify order to billed (even if payment may be partial). + + $invoice->validate($user); // This may re-classify all linked orders to billed (done previously) if amount of invoice is ok by triggers, depending on the workflow module setup. + + // Creation of payment line (warning: if amount has been modified on page, the payment may be partial) include_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; $paiement = new Paiement($db); $paiement->datepaye = $now; @@ -2149,16 +2159,19 @@ $db->close(); // If option to do a redirect somewhere else. if (!empty($doactionsthenredirect)) { + $randomseckey = getRandomPassword(true, null, 20); + $_SESSION['paymentsessionkey'] = $randomseckey; + if ($ispaymentok) { // Redirect to a success page // Paymentok page must be created for the specific website if (!defined('USEDOLIBARRSERVER') && !empty($ws_virtuelhost)) { - $ext_urlok = $ws_virtuelhost . '/paymentok.php?fulltag='.$FULLTAG; + $ext_urlok = $ws_virtuelhost . '/paymentok.php?paymentsessionkey='.urlencode($randomseckey).'&fulltag='.$FULLTAG; } else { - $ext_urlok = DOL_URL_ROOT.'/public/website/index.php?website='.urlencode($ws).'&pageref=paymentok&fulltag='.$FULLTAG; + $ext_urlok = DOL_URL_ROOT.'/public/website/index.php?paymentsessionkey='.urlencode($randomseckey).'&website='.urlencode($ws).'&pageref=paymentok&fulltag='.$FULLTAG; } - if (getDolGlobalInt('MARKETPLACE_PAYMENT_IN_FRAME') == 1) { // TODO Use a property in website module + if (getDolGlobalInt('MARKETPLACE_PAYMENT_IN_FRAME') == 1) { // TODO Remove this to make only a http redirect, if the website need a js redirect to parent frame, he must do it itself. dol_syslog("Now do a redirect in iframe mode in js to ".$ext_urlok, LOG_DEBUG, 0, '_payment'); // Redirect in js is not reliable @@ -2173,12 +2186,12 @@ if (!empty($doactionsthenredirect)) { // Redirect to an error page // Paymentko page must be created for the specific website if (!defined('USEDOLIBARRSERVER') && !empty($ws_virtuelhost)) { - $ext_urlko = $ws_virtuelhost . '/paymentko.php?fulltag='.$FULLTAG; + $ext_urlko = $ws_virtuelhost . '/paymentko.php?paymentsessionkey='.urlencode($randomseckey).'&fulltag='.$FULLTAG; } else { - $ext_urlko = DOL_URL_ROOT.'/public/website/index.php?website='.urlencode($ws).'&pageref=paymentko&fulltag='.$FULLTAG; + $ext_urlko = DOL_URL_ROOT.'/public/website/index.php?paymentsessionkey='.urlencode($randomseckey).'&website='.urlencode($ws).'&pageref=paymentko&fulltag='.$FULLTAG; } - if (getDolGlobalInt('MARKETPLACE_PAYMENT_IN_FRAME') == 1) { // TODO Use a property in website module + if (getDolGlobalInt('MARKETPLACE_PAYMENT_IN_FRAME') == 1) { // TODO Remove this to make only a http redirect, if the website need a js redirect to parent frame, he must do it itself. dol_syslog("Now do a redirect in iframe mode in js to ".$ext_urlko, LOG_DEBUG, 0, '_payment'); // Redirect in js is not reliable diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php index 35dece5c502..dff11fef317 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -116,39 +116,8 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ print ''; - // Define urllogo - $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; - - if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); - } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); - } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { - $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; - } - - print '
'; - - // Output html code for logo - if ($urllogo) { - print '
'; - print '
'; - print ''; - print '
'; - if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { - print ''; - } - print '
'; - } - - if (getDolGlobalString('PROJECT_IMAGE_PUBLIC_NEWLEAD')) { - print '
'; - print ''; - print '
'; - } - - print '
'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + htmlPrintOnlineHeader($mysoc, $langs, 1, getDolGlobalString('PROJECT_PUBLIC_INTERFACE_TOPIC'), 'PROJECT_IMAGE_PUBLIC_NEWLEAD'); print '
'; } @@ -470,6 +439,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // fetch optio llxHeaderVierge($langs->trans("NewContact")); +print '
'; print load_fiche_titre($langs->trans("NewContact"), '', '', 0, '', 'center'); diff --git a/htdocs/public/users/view.php b/htdocs/public/users/view.php index c8a79649e0a..20fee171c2f 100644 --- a/htdocs/public/users/view.php +++ b/htdocs/public/users/view.php @@ -274,6 +274,7 @@ print ''."\n"; print ''; print "\n"; + // Output html code for logo print '
'; print '
'; @@ -292,15 +293,9 @@ if (!getDolUserInt('USER_PUBLIC_HIDE_COMPANY', 0, $object)) { print '
'; } - - print '
'; -/*if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { - print ''; -}*/ print '
'; - if (getDolGlobalString('USER_IMAGE_PUBLIC_INTERFACE')) { print '
'; print ''; diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 7c0960fd68e..04f42adee4c 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -872,16 +872,16 @@ class Reception extends CommonObject * If STOCK_WAREHOUSE_NOT_REQUIRED_FOR_RECEPTIONS is set, you can add a reception line, with no stock source defined * If STOCK_MUST_BE_ENOUGH_FOR_RECEPTION is not set, you can add a reception line, even if not enough into stock * - * @param int $entrepot_id Id of warehouse - * @param int $id Id of source line (supplier order line) - * @param float $qty Quantity + * @param int $entrepot_id Id of warehouse + * @param int $id Id of source line (supplier order line) + * @param float $qty Quantity * @param array $array_options extrafields array - * @param string $comment Comment for stock movement - * @param int $eatby eat-by date - * @param int $sellby sell-by date - * @param string $batch Lot number - * @param float $cost_price Line cost - * @return int Return integer <0 if KO, index of line if OK + * @param string $comment Comment for stock movement + * @param int $eatby eat-by date + * @param int $sellby sell-by date + * @param string $batch Lot number + * @param float|string $cost_price Line cost (Can be '' to keep AWP unchanged or a float value) + * @return int Return integer <0 if KO, index of line if OK */ public function addline($entrepot_id, $id, $qty, $array_options = [], $comment = '', $eatby = null, $sellby = null, $batch = '', $cost_price = 0) { diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index 69701cab92c..c65dbb7db85 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -76,7 +76,7 @@ class CompanyPaymentMode extends CommonObject */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'Rowid', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 10), - 'fk_soc' => array('type' => 'integer', 'label' => 'Fk soc', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15), + 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'Fk soc', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15), 'label' => array('type' => 'varchar(30)', 'label' => 'Label', 'enabled' => 1, 'visible' => -2, 'position' => 30), 'bank' => array('type' => 'varchar(255)', 'label' => 'Bank', 'enabled' => 1, 'visible' => -2, 'position' => 35), 'code_banque' => array('type' => 'varchar(128)', 'label' => 'Code banque', 'enabled' => 1, 'visible' => -2, 'position' => 40), diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index c28581683b7..5e45efeb4d5 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -116,8 +116,8 @@ class SocieteAccount extends CommonObject 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'visible' => -1, 'enabled' => 1, 'position' => 46, 'notnull' => -1,), 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'visible' => -2, 'enabled' => 1, 'position' => 500, 'notnull' => 1,), 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'visible' => -2, 'enabled' => 1, 'position' => 500, 'notnull' => 1,), - 'fk_user_creat' => array('type' => 'integer', 'label' => 'UserAuthor', 'visible' => -2, 'enabled' => 1, 'position' => 500, 'notnull' => 1,), - 'fk_user_modif' => array('type' => 'integer', 'label' => 'UserModif', 'visible' => -2, 'enabled' => 1, 'position' => 500, 'notnull' => -1,), + 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'visible' => -2, 'enabled' => 1, 'position' => 500, 'notnull' => 1,), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'visible' => -2, 'enabled' => 1, 'position' => 500, 'notnull' => -1,), 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'visible' => -2, 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'index' => 1,), 'status' => array('type' => 'integer', 'label' => 'Status', 'visible' => 1, 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'index' => 1, 'default' => '1', 'arrayofkeyval' => array(1 => 'Active', 0 => 'Disabled')), ); diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index dd935b533bf..59fe7245a93 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -799,7 +799,7 @@ if (empty($reshook)) { min($rank, count($object->lines) + 1), 0, GETPOSTINT('fk_parent_line'), - $fournprice, + (int) $fournprice, $buyingprice, $label, $array_options, @@ -878,7 +878,7 @@ if (empty($reshook)) { -1, // rang 0, // special_code GETPOSTINT('fk_parent_line'), - $fournprice, + (int) $fournprice, $buyingprice, $label, $array_options, @@ -1004,8 +1004,8 @@ if (empty($reshook)) { $pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), 'CU', 2); // Add buying price - $fournprice = (GETPOST('fournprice') ? GETPOSTINT('fournprice') : ''); // foreigh key - $buyingprice = (GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we must keep this value + $fournprice = (int) (GETPOST('fournprice') ? GETPOSTINT('fournprice') : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only + $buyingprice = price2num((GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''), '', 2); // If buying_price is '0', we must keep this value // Extrafields Lines $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line); @@ -1076,7 +1076,7 @@ if (empty($reshook)) { GETPOSTINT('fk_parent_line'), 0, (int) $fournprice, - (float) $buyingprice, + $buyingprice, $label, $type, $array_options, diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 5aa88886622..feadcecac41 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -431,8 +431,8 @@ class SupplierProposal extends CommonObject * @param int $rang Position of line * @param int $special_code Special code (also used by externals modules!) * @param int $fk_parent_line Id of parent line - * @param int $fk_fournprice Id supplier price. If 0, we will take best price. If -1 we keep it empty. - * @param int $pa_ht Buying price without tax + * @param int|string $fk_fournprice Id supplier price or string. If 0, we will take best price. If -1 we keep it empty. + * @param float|string $pa_ht Buying price without tax (Can be '' to keep AWP unchanged or a float value) * @param string $label ??? * @param array $array_options extrafields array * @param string $ref_supplier Supplier price reference @@ -717,7 +717,7 @@ class SupplierProposal extends CommonObject * @param int $fk_parent_line Id of parent line (0 in most cases, used by modules adding sublevels into lines). * @param int $skip_update_total Keep fields total_xxx to 0 (used for special lines by some modules) * @param int $fk_fournprice Id of origin supplier price - * @param float $pa_ht Price (without tax) of product when it was bought + * @param float|string $pa_ht Price (without tax) of product when it was bought (Can be '' to keep AWP unchanged or a float value) * @param string $label ??? * @param int<0,1> $type 0/1=Product/service * @param array $array_options extrafields array diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 25706ebbb6e..e67ee97f16f 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -479,7 +479,8 @@ function MoreProducts(moreorless) { if (maxproduct >= 1) { limit = maxproduct-1; } - var offset = * pageproducts; + var nb_cat_shown = $('.div5 div.wrapper2[data-iscat=1]').length; + var offset = * pageproducts - nb_cat_shown; // Only show products for sale (tosell=1) $.getJSON('/takepos/ajax/ajax.php?action=getProducts&token=&category='+currentcat+'&tosell=1&limit='+limit+'&offset='+offset, function(data) { console.log("Call ajax.php (in MoreProducts) to get Products of category "+currentcat); @@ -1072,6 +1073,7 @@ $( document ).ready(function() { $sql .= " entity = ".((int) $conf->entity)." AND "; $sql .= " posnumber = ".((int) $_SESSION["takeposterminal"])." AND "; $sql .= " date_creation > '".$db->idate(dol_get_first_hour(dol_now()))."'"; + $sql .= " AND status = 0 "; $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); @@ -1452,6 +1454,7 @@ $sql = "SELECT rowid, status, entity FROM ".MAIN_DB_PREFIX."pos_cash_fence WHERE $sql .= " entity = ".((int) $conf->entity)." AND "; $sql .= " posnumber = ".((int) empty($_SESSION["takeposterminal"]) ? 0 : $_SESSION["takeposterminal"])." AND "; $sql .= " date_creation > '".$db->idate(dol_get_first_hour(dol_now()))."'"; +$sql .= " AND status = 0"; $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/theme/eldy/dropdown.inc.php b/htdocs/theme/eldy/dropdown.inc.php index 8923a988e20..51ddbac31ae 100644 --- a/htdocs/theme/eldy/dropdown.inc.php +++ b/htdocs/theme/eldy/dropdown.inc.php @@ -527,7 +527,7 @@ div.quickaddblock:focus { .dropdown-content { display: none; position: absolute; - z-index: 1; + z-index: 2; width: 300px; right:0; /* will be set with js */ bottom: 0; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index ab9c9545026..ee4928c4a8a 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1205,7 +1205,7 @@ td.wordbreak img, td.wordbreakimp img { cursor: move; } .cursornotallowed { - cursor: not-allowed; + cursor: not-allowed !important; } .cursorwait { cursor: wait; @@ -3423,7 +3423,7 @@ if (getDolGlobalString('MAIN_LOGIN_BACKGROUND')) { } .login_table #tdpasswordlogin #togglepassword { position: absolute; - top: 1em; + top: 0.7em; right: 5px; background: none; border: none; @@ -8646,14 +8646,14 @@ table.jPicker { padding: 12px; left: inherit !important; top: inherit !important; - border-radius: 5px !important; + border-radius: px !important; } .ai_feature { background-color: var(--colorbackgrey); padding: 10px; padding-bottom: 6px; padding-top: 6px; - border-radius: 5px; + border-radius: px; } diff --git a/htdocs/theme/md/dropdown.inc.php b/htdocs/theme/md/dropdown.inc.php index 9ec751626c8..ad7b88b63de 100644 --- a/htdocs/theme/md/dropdown.inc.php +++ b/htdocs/theme/md/dropdown.inc.php @@ -585,7 +585,7 @@ div.quickaddblock:focus { .dropdown-content { display: none; position: absolute; - z-index: 1; + z-index: 2; width: 300px; right:0; bottom: 0; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 56d4fc83513..aec153b2dcf 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1371,7 +1371,7 @@ td.wordbreak img, td.wordbreakimp img { cursor: move; } .cursornotallowed { - cursor: not-allowed; + cursor: not-allowed !important; } .cursorwait { cursor: wait; @@ -3489,7 +3489,7 @@ form#login { } .login_table #tdpasswordlogin #togglepassword { position: absolute; - top: 1em; + top: 0.7em; right: 5px; background: none; border: none; @@ -8483,14 +8483,14 @@ table.jPicker { padding: 12px; left: inherit !important; top: inherit !important; - border-radius: 5px !important; + border-radius: px !important; } .ai_feature { background-color: var(--colorbackgrey); padding: 10px; padding-bottom: 6px; padding-top: 6px; - border-radius: 5px; + border-radius: px; } diff --git a/htdocs/waf.inc.php b/htdocs/waf.inc.php index 1af4e6ebd29..591534f16c6 100644 --- a/htdocs/waf.inc.php +++ b/htdocs/waf.inc.php @@ -190,12 +190,12 @@ function testSqlAndScriptInject($val, $type) $inj += preg_match('/=data:/si', $val); // List of dom events is on https://www.w3schools.com/jsref/dom_obj_event.asp and https://developer.mozilla.org/en-US/docs/Web/Events - $inj += preg_match('/on(mouse|drag|key|load|touch|pointer|select|transition)[a-z]*\s*=/i', $val); // onmousexxx can be set on img or any html tag like - $inj += preg_match('/on(abort|after|animation|auxclick|before|blur|bounce|cancel|canplay|canplaythrough|change|click|close|contextmenu|cuechange|copy|cut)[a-z]*\s*=/i', $val); - $inj += preg_match('/on(dblclick|drop|durationchange|emptied|end|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)[a-z]*\s*=/i', $val); - $inj += preg_match('/on(lostpointercapture|offline|online|pagehide|pageshow)[a-z]*\s*=/i', $val); - $inj += preg_match('/on(paste|pause|play|playing|progress|ratechange|reset|resize|scroll|search|seeked|seeking|show|stalled|start|submit|suspend)[a-z]*\s*=/i', $val); - $inj += preg_match('/on(timeupdate|toggle|unload|volumechange|waiting|wheel)[a-z]*\s*=/i', $val); + $inj += preg_match('/on(abort|after|animation|auxclick|before|blur|bounce|cancel|canplay|canplaythrough|change|click|close|content|contextmenu|cuechange|copy|cut)[a-z]*\s*=/i', $val); + $inj += preg_match('/on(dblclick|drag|drop|durationchange|emptied|end|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)[a-z]*\s*=/i', $val); + $inj += preg_match('/on(key|load|lostpointercapture|mouse)[a-z]*\s*=/i', $val); // onmousexxx can be set on img or any html tag like + $inj += preg_match('/on(offline|online|pagehide|pageshow|pointer)[a-z]*\s*=/i', $val); + $inj += preg_match('/on(paste|pause|play|playing|progress|ratechange|reset|resize|scroll|select|search|seeked|seeking|show|stalled|start|submit|suspend)[a-z]*\s*=/i', $val); + $inj += preg_match('/on(timeupdate|touch|transition|toggle|unload|volumechange|waiting|wheel)[a-z]*\s*=/i', $val); // More not into the previous list $inj += preg_match('/on(repeat|begin|finish)[a-z]*\s*=/i', $val); @@ -235,7 +235,7 @@ function testSqlAndScriptInject($val, $type) * Return true if security check on parameters are OK, false otherwise. * * @param string|array $var Variable name - * @param int<0,2> $type 1=GET, 0=POST, 2=PHP_SELF + * @param int<0,3> $type 0=POST, 1=GET, 2=PHP_SELF, 3=GET without sql reserved keywords (the less tolerant test) * @param int<0,1> $stopcode 0=No stop code, 1=Stop code (default) if injection found * @return boolean True if there is no injection. */ @@ -248,8 +248,8 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type, $stopcode = 1) continue; } - // Test on both the key (we force type to the less tolerant = 3) and the value - if (analyseVarsForSqlAndScriptsInjection($key, 3, $stopcode) && analyseVarsForSqlAndScriptsInjection($value, $type, $stopcode)) { + // Test on both the key (we force type to 1 for test on key, we must accept key like "delete=1" blocked with type 3) and the value + if (analyseVarsForSqlAndScriptsInjection($key, 1, $stopcode) && analyseVarsForSqlAndScriptsInjection($value, $type, $stopcode)) { //$var[$key] = $value; // This is useless } else { http_response_code(403); diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 6f0b1c81fd3..b79161b889f 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -225,9 +225,9 @@ class WebsitePage extends CommonObject 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 500), 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 501), //'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>502), - 'fk_user_creat' => array('type' => 'integer', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 510), + 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 510), 'author_alias' => array('type' => 'varchar(64)', 'label' => 'AuthorAlias', 'enabled' => 1, 'visible' => -1, 'index' => 0, 'position' => 511, 'comment' => 'Author alias'), - 'fk_user_modif' => array('type' => 'integer', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -1, 'position' => 512), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -1, 'position' => 512), //'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512), 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -1, 'index' => 1, 'position' => 1000, 'notnull' => -1), 'object_type' => array('type' => 'varchar(255)', 'label' => 'ObjectType', 'enabled' => 1, 'visible' => 0, 'position' => 46, 'searchall' => 0, 'help' => ''), diff --git a/htdocs/website/index.php b/htdocs/website/index.php index f38498d8331..db6eb464bd3 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -331,12 +331,12 @@ $manifestjsoncontentdefault .= '{ $listofpages = array(); $algo = ''; +if (GETPOST('optiopagecontent')) { + $algo .= 'content'; +} if (GETPOST('optionmeta')) { $algo .= 'meta'; } -if (GETPOST('optioncontent')) { - $algo .= 'content'; -} if (GETPOST('optionsitefiles')) { $algo .= 'sitefiles'; } @@ -631,7 +631,7 @@ if ($massaction == 'replace' && GETPOST('confirmmassaction', 'alpha') && $userca if ($objectpage->pageurl) { dol_syslog("Replace string into page ".$objectpage->pageurl); - if (GETPOST('optioncontent', 'aZ09')) { + if (GETPOST('optiopagecontent', 'aZ09')) { $objectpage->content = str_replace($searchkey, $replacestring, $objectpage->content); } if (GETPOST('optionmeta', 'aZ09')) { @@ -5425,7 +5425,7 @@ if ($mode == 'replacesite' || $massaction == 'replace') { print $langs->trans("SearchReplaceInto"); print '
'; print '
'; - print '
'; + print '
'; print '
'; print '
'; print '
'; @@ -5545,8 +5545,8 @@ if ($mode == 'replacesite' || $massaction == 'replace') { $param = 'mode=replacesite&website='.urlencode($website->ref); $param .= '&searchstring='.urlencode($searchkey); - if (GETPOST('optioncontent')) { - $param .= '&optioncontent=content'; + if (GETPOST('optiopagecontent')) { + $param .= '&optiopagecontent=content'; } if (GETPOST('optionmeta')) { $param .= '&optionmeta=meta'; @@ -5595,7 +5595,7 @@ if ($mode == 'replacesite' || $massaction == 'replace') { if (is_object($answerrecord) && get_class($answerrecord) == 'WebsitePage') { $param = '?mode=replacesite'; $param .= '&websiteid='.$website->id; - $param .= '&optioncontent='.GETPOST('optioncontent', 'aZ09'); + $param .= '&optiopagecontent='.GETPOST('optiopagecontent', 'aZ09'); $param .= '&optionmeta='.GETPOST('optionmeta', 'aZ09'); $param .= '&optionsitefiles='.GETPOST('optionsitefiles', 'aZ09'); $param .= '&optioncontainertype='.GETPOST('optioncontainertype', 'aZ09'); @@ -5740,7 +5740,7 @@ if ($mode == 'replacesite' || $massaction == 'replace') { '@phan-var-force array{type:string} $answerrecord'; $param = '?mode=replacesite'; $param .= '&websiteid='.$website->id; - $param .= '&optioncontent='.GETPOST('optioncontent', 'aZ09'); + $param .= '&optiopagecontent='.GETPOST('optiopagecontent', 'aZ09'); $param .= '&optionmeta='.GETPOST('optionmeta', 'aZ09'); $param .= '&optionsitefiles='.GETPOST('optionsitefiles', 'aZ09'); $param .= '&optioncontainertype='.GETPOST('optioncontainertype', 'aZ09');