diff --git a/ChangeLog b/ChangeLog index 76709bd8f85..fcf5af4aef6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,28 +27,28 @@ Following changes may create regressions for some external modules, but were nec For users: --------------- -NEW: PHP 8.1 compatibility +NEW: PHP 8.1 compatibility. + Warning: Application works correctly with PHP8 and 8.1 but you may experience a lot of PHP warning into the PHP server log files (depending + on the PHP setup). Removal of all PHP warnings on server side is planned for v17. NEW: Support for recurring purchase invoices. NEW: #20292 Include German public holidays -NEW: Can show ZATCA QRCode on PDFs -NEW: Can show Swiss QR Code on PDFs +NEW: Can show ZATCA QR-Code on PDFs +NEW: Can show Swiss QR-Code on PDFs NEW: #17123 added ExtraFields for Stock Mouvement -NEW: #20609 : new massaction to assign a sale representatives on a selection of thirdparties +NEW: #20609 new massaction to assign a sale representatives on a selection of thirdparties NEW: #20653 edit discount pourcentage for all lines in one shot NEW: Accept 'auto' for ref of object on import of purchase order/proposal NEW: Accountancy - Add more filters and info on page to bind accounting accounts -NEW: Accountancy - Add subledger account when we generate a transaction with a deposit invoice +NEW: Accountancy - Add subledger account when generate a transaction with a deposit invoice NEW: Accountancy - Add a massaction to preselect an account (customer and supplier list) NEW: ACE Editor is restored at same cursor position after a save. NEW: Add "addMoreActionsButtons" hook to subscription form NEW: Add an option in GUI to show a Quick add button into top menu bar -NEW: Module Recruitment - Add a public page with all list of open job positions. -NEW: Module Recruitment - Add a tab with list of application on the jobposition file. NEW: Add a workflow to auto link contract on a ticket NEW: Add column date of Signature on proposal list NEW: Add column template invoice in invoice list NEW: Add column "Total HT" to products array on document creation card -NEW: ADD configuration for text color of button action +NEW: Add configuration for text color of button action NEW: Add constant to hide categories in TakePos NEW: Add constant to show category description in TakePos NEW: Add constant to show only the products in stock in TakePos @@ -56,7 +56,7 @@ NEW: Add entity filter in exports NEW: Show the event block on recurring invoices #20870 NEW: Add filter "opportunity status" on statistics of projects. NEW: Add firstname, lastname and max number of attendees for module "Event Organization" -NEW: add margin info in proposal and order list +NEW: Add margin info in proposal and order list NEW: Add massaction "Edit Extrafield" for Product NEW: Add more fields to detect duplicate during import of thirdparties NEW: Add option to foce delivery on email for purchase order receipt to yes @@ -67,14 +67,12 @@ NEW: Add possibility with constant MAIN_LOGIN_BADCHARUNAUTHORIZED to define bad NEW: Add private and public notes on tax files. NEW: Add status "Obsolete" to KM articles NEW: Add substitutions "user numbers" -NEW: Add the possibility to add sub-BOMs to BOM NEW: allow a ticket to be automatically marked as read when created from backend. NEW: allow cut&paste as real numeric value to excel NEW: A public form to send a message and create a lead is available NEW: automatically set totally received status in reception NEW: Auto set invoice paid when adding credit not and remain to pay is 0 NEW: Availibility dictionnary has a new column unit and number -NEW: barcode rule to insert product in takepos NEW: Can change value of AWP during the inventory NEW: Can enter price with tax for predefined products on purchase objects NEW: Can filter on a thirdparty on product statistics @@ -90,7 +88,7 @@ NEW: create third-party with contact if not found on public ticket NEW: Default value for MAIN_SECURITY_CSRF_WITH_TOKEN is now 2 (GET are also protected agains CSRF attacks) NEW: deposit payment terms: add field into dictionary admin page to define default percentage of deposit. NEW: Dictionaries - add possibility to manage countries in EEC -NEW: display errors in a message box after generating documents +NEW: Display errors in a message box after generating documents NEW: Display physical and virtual stock of the products when creating OF from a BOM NEW: Display product ref in "Object link" product tab for BOM NEW: Enhance the import. Can use 'auto' for the ref (import of orders) @@ -102,10 +100,13 @@ NEW: leave requests: add field into type dictionary to block request if balance NEW: MAIN_MAIL_AUTOCOPY_TO can accept several email and special keys NEW: MAIN_SEARCH_CAT_OR_BY_DEFAULT const for search by category NEW: Mass action "Close shipments" +NEW: Module BOM - Add tabs for nets Bom +NEW: Module BOM - Add the possibility to add sub-BOMs to BOM +NEW: Module Recruitment - Add a public page with all list of open job positions. +NEW: Module Recruitment - Add a tab with list of application on the jobposition file. NEW: Module website now supports the multicompany module NEW: More mode for THEME_TOPMENU_DISABLE_IMAGE (2, 3, ...) NEW: Add option to move checkbox column as first column on Thirdparty list (only few screens) -NEW: Add tabs for nets Bom NEW: on redirect of page in website module, GET parameters are kept. NEW: optional display warning icons on ticket list NEW: option to default check "notify tier at creation" in ticket module @@ -117,15 +118,15 @@ NEW: Send email to the supplier order contact NEW: New permission to report time on timesheet. NEW: SEPA XML - option to place payment Type Info at Credit transfer Transaction level NEW: Show number of votes into the label of tab "Results" of a survey -NEW: Show product reference in Takepos NEW: Some core tables are created only at module activation NEW: split consumption line on MO NEW: stock filter in reassort lists NEW: stock limit in stock export CSV -NEW: Sub-bom are availables NEW: Supplier order - Show ref supplier of reception in linked object block NEW: support user_modif in order -NEW: TakePos - pagination on search results +NEW: TakePOS - barcode rule to insert product in TakePOS +NEW: TakePOS - pagination on search results +NEW: TakePOS - show product reference NEW: The backup tools has an "lowmemory" option for mysqldump on large database NEW: The 'reposition' class works on ajax constantonoff that make redirects NEW: Thirdparty - Add rules "customer accountancy code" is mandatory to validate invoice @@ -140,7 +141,7 @@ NEW: Added MMK currency (Myanmar Kyat) Modules NEW: Module Partnership Management -NEW: Experimental module Event Organization Management +NEW: Experimental Module Event Organization Management For developers or integrators: @@ -155,7 +156,6 @@ NEW: Suggest a way to run upgrade per entities. NEW: Support html content for multiselect component. NEW: ModuleBuilder - Add tabs view in module builder NEW: ModuleBuilder - More feature that can be modifed after module generation -NEW: Hook getNomUrl available everywhere in tooltip of ref links NEW: Identification of tr is possible with by attribute data-id on some pages NEW: Import with select boxes V2 NEW: Can update rank of invoice, proposal and order lines with API update @@ -182,6 +182,9 @@ NEW: Add a protection into PHPunit to avoid to forget a var_dump NEW: Add datem and type parameters to API to create movements NEW: Add hidden option on contract PDF line to hide qty and price NEW: Option MAIL_MASS_ACTION_ADD_LAST_IF_MAIN_DOC_NOT_FOUND to send last document in mass mailing action + +Hooks: +NEW: Hook getNomUrl available everywhere in tooltip of ref links NEW: Add hooks: selectContactListWhere hook, selectThirdpartyListWhere hook NEW: TakePos - add hooks complete product display NEW: TakePos - add hooks for cart display @@ -222,6 +225,81 @@ Following changes may create regressions for some external modules, but were nec * The context hook 'suppliercard' when on the supplier tab of a thirdparty has been renamed into 'thirdpartysupplier' +***** ChangeLog for 15.0.3 compared to 15.0.2 ***** + +FIX: 15.0: modules cannot declare more than 1 cron job using the same method with different parameters +FIX: 15 fix graph ficheinter status +FIX: #18704 +FIX: #20444 +FIX: #20448 missing preg_replace for vat rate when adding a free line +FIX: #20476 migration postgresql 13.0.x to 14.0.x packaging type +FIX: #20487 missing letter D in constant THIRDPARTIES_DISABLE_RELATED_… +FIX: #20487 missing letter D in constant THIRDPARTIES_DISABLE_RELATED_OBJECT_TAB +FIX: #20527 Accountancy - Unbalanced entry proposed when an employee are declared on a social contribution +FIX: #20527 Accountancy Unbalanced entry proposed when an employee are declared on social contribution +FIX: #20621 signature online with proposal with n page. +FIX: #20696 +FIX: #20828 +FIX: #20886 : manage durations in list_print_total.tpl.php +FIX: #20902 +FIX: #21051 +FIX: #21093 +FIX: #21138 +FIX: #21140 +FIX: #21174 +FIX: #21323 +FIX: #21472 On the bank transfer lists, a change of page switches to the lists of the direct debit module +FIX: #21495 +FIX: #21518 +FIX: Accountancy - Label of VAT account is empty +FIX: Accountancy - Model account list - Problem of CSRF +FIX: Accountancy - Partitioning of the entity on an automatic binding +FIX: add missing thead, th and id on table +FIX: backport commit 5b3fcc5e43979b1b0789bf81fb8f1b2b59c93056, chkbxlst cannot be emptied +FIX: Bank account not set when creating invoice from order +FIX: Bank transfer - Link on code supplier invoice was bad +FIX: Can convert a partially closed down payment when close for +FIX: class center linkedObjectblock order date +FIX: count elements in invoice list (Issue #21444) +FIX: Customer price non numeric warning when 0 vat. +FIX: errors in getLinesArray() +FIX: False alert of WAF when there is "set" into some URL action=update. +FIX: Intervention graph by status on ficheinter Index page +FIX: Intervention url link into Commerce index +FIX: Fix get origin from other than supplier proposal when add a new supplier proposal +FIX: Fix show errors in card +FIX: fourn/commande/card.php Added "$object" parameter to $formfile->showdocuments call +FIX: french traductions for payment methods +FIX: hook for dol_format_address +FIX: Index page for "Sales" give wrong URL link to Intervention +FIX: issue Dolibarr#21495 for v15 +FIX: label and get_substitutionarray_each_var_object on ODT generation +FIX: load product stock in inventory lines +FIX: missing morecss for multiselectarray +FIX: missins time spent list menu +FIX: new member subscription: bank account and payment mode might be hidden +FIX: ODT generation of BOM document +FIX: ODT tags for subobjects {object_subobject_yyy} was not working. +FIX: qty received label in Squille PDF model +FIX: rank duplicate on mass action invoice from multiple orders +FIX: regression + add $forceentity parameter +FIX: regression PR #20713 +FIX: security breach if we have same ref number in multiple entities +FIX: selection of type of invoice +FIX: Send remind to pay invoice only on validated invoices +FIX: Show sellist type of extrafield when none category selected +FIX: signature online with proposal with n page. +FIX: sql error when PRODUCT_USE_SUPPLIER_PACKAGING enabled. +FIX: sql order +FIX: trash icon on crontask list to do not work +FIX: v15 linked object block center order date +FIX: Warning on attribut +FIX: We must remove empty values of $features array in fetchByProductCombination2ValuePairs() because some products can use only several attributes in their variations and not necessarily all. In this case, fetch doesn't work without my correction +FIX: with callback function +FIX: xml file for company with special chars in name +FIX: Zatca QR code must use company name/vat + + ***** ChangeLog for 15.0.2 compared to 15.0.1 ***** FIX: #19777 #20281 diff --git a/build/README b/build/README index 626953f9376..19cf4ad1ec2 100644 --- a/build/README +++ b/build/README @@ -13,32 +13,12 @@ It is here only to build Dolibarr packages, and those generated packages will no There are several tools: +-------------------------------------------------------------------------------------------------- - To build full Dolibarr packages, launch the script > Launch command perl makepack-dolibarr.pl --------------------------------------------------------------------------------------------------- - - -Prerequisites to build tgz, debian and rpm packages: -> apt-get install tar dpkg dpatch p7zip-full rpm zip - - --------------------------------------------------------------------------------------------------- - -Prerequisites to build autoexe DoliWamp package: -> apt-get install wine q4wine -> Launch "wine cmd" to check a drive Z: pointing to / exists. -> Install InnoSetup - For example by running isetup-5.5.8.exe (https://www.jrsoftware.org) https://files.jrsoftware.org/is/5/ -> Install WampServer into "C:\wamp64" to have Apache, PHP and MariaDB - For example by running wampserver3.2.0_x64.exe (https://www.wampserver.com). - See file build/exe/doliwamp.iss to know the doliwamp version currently setup. -> Add path to ISCC into PATH windows var: - Launch wine cmd, then regedit and add entry int HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment\PATH -> To build manually the .exe from Windows (running from makepack-dolibarr.pl script is however recommanded), - open file build/exe/doliwamp.iss and click on button "Compile". - The .exe file will be build into directory build. +See makepack-howto.txt for prerequisites. -------------------------------------------------------------------------------------------------- diff --git a/build/exe/doliwamp/.gitignore b/build/exe/doliwamp/.gitignore index ce74d54f78e..f9a2ea83b34 100644 --- a/build/exe/doliwamp/.gitignore +++ b/build/exe/doliwamp/.gitignore @@ -1 +1 @@ -/doliwamp.tmp.iss +/doliwamp.tmp.iss* diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index c316e0f91d6..10cc1561011 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -24,7 +24,6 @@ OutputBaseFilename=__FILENAMEEXEDOLIWAMP__ ;OutputManifestFile=build\doliwampbuild.log ; Define full path from which all relative path are defined ; You must modify this to put here your dolibarr root directory -;SourceDir=Z:\home\ldestailleur\git\dolibarrxxx SourceDir=..\..\.. AppId=doliwamp AppPublisher=DoliCloud @@ -32,7 +31,7 @@ AppPublisherURL=https://www.dolicloud.com AppSupportURL=https://www.dolibarr.org AppUpdatesURL=https://www.dolibarr.org AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql software. -AppCopyright=Copyright (C) 2008-2022 Laurent Destailleur (NLTechno), Fabian Rodriguez (Le Goût du Libre) +AppCopyright=Copyright (C) 2008-2022 Laurent Destailleur (DoliCloud), Fabian Rodriguez (Le Goût du Libre) DefaultDirName=c:\dolibarr DefaultGroupName=Dolibarr ;LicenseFile=COPYING @@ -81,7 +80,7 @@ Name: "desktopicon"; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm: Name: "{app}\logs" Name: "{app}\tmp" Name: "{app}\dolibarr_documents" -Name: "{app}\bin\apache\apache2.4.41\logs" +Name: "{app}\bin\apache\apache2.4.51\logs" [Files] ; Stop/start @@ -101,16 +100,10 @@ Source: "build\exe\doliwamp\UsedPort.exe"; DestDir: "{app}\"; Flags: ignoreversi ; Apache, Php, Mysql ; Put here path of Wampserver applications -; Value OK: apache 2.2.6, php 5.2.5 (5.2.11, 5.3.0 and 5.3.1 fails if php_exif, php_pgsql, php_zip is on), mysql 5.0.45 -; Value OK: apache 2.2.11, php 5.3.0 (if no php_exif, php_pgsql, php_zip), mysql 5.0.45 -; Value OK: apache 2.4.9, php 5.5.12, mysql 5.0.45 instead of 5.6.17 (wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b.exe) -; Value OK: apache 2.4.41, php 7.3.12, mariadb10.4.10 (wampserver3.2.0_x64.exe) -;Source: "C:\Program Files\Wamp\bin\apache\apache2.4.9\*.*"; DestDir: "{app}\bin\apache\apache2.4.9"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,httpd.conf,wampserver.conf,*.log,*_log" -Source: "C:\wamp64\bin\apache\apache2.4.41\*.*"; DestDir: "{app}\bin\apache\apache2.4.41"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,httpd.conf,wampserver.conf,*.log,*_log" -;Source: "C:\Program Files\Wamp\bin\php\php5.5.12\*.*"; DestDir: "{app}\bin\php\php5.5.12"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,phpForApache.ini,wampserver.conf,*.log,*_log" -Source: "C:\wamp64\bin\php\php7.3.12\*.*"; DestDir: "{app}\bin\php\php7.3.12"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,phpForApache.ini,wampserver.conf,*.log,*_log" -;Source: "C:\Program Files\Wamp\bin\mysql\mysql5.0.45\*.*"; DestDir: "{app}\bin\mysql\mysql5.0.45"; Flags: ignoreversion recursesubdirs; Excludes: "my.ini,data\*,wampserver.conf,*.log,*_log,MySQLInstanceConfig.exe" -Source: "C:\wamp64\bin\mariadb\mariadb10.4.10\*.*"; DestDir: "{app}\bin\mariadb\mariadb10.4.10"; Flags: ignoreversion recursesubdirs; Excludes: "my.ini,data\*,wampserver.conf,*.log,*_log,MySQLInstanceConfig.exe" +; Value OK: apache 2.4.51, php 7.3.33, mariadb10.6.5 (wampserver3.2.6_x64.exe) +Source: "C:\wamp64\bin\apache\apache2.4.51\*.*"; DestDir: "{app}\bin\apache\apache2.4.51"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,httpd.conf,wampserver.conf,*.log,*_log" +Source: "C:\wamp64\bin\php\php7.3.33\*.*"; DestDir: "{app}\bin\php\php7.3.33"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,phpForApache.ini,wampserver.conf,*.log,*_log" +Source: "C:\wamp64\bin\mariadb\mariadb10.6.5\*.*"; DestDir: "{app}\bin\mariadb\mariadb10.6.5"; Flags: ignoreversion recursesubdirs; Excludes: "my.ini,data\*,wampserver.conf,*.log,*_log,MySQLInstanceConfig.exe" ; Mysql data files (does not overwrite if exists) ; We must copy them because the tool mysql_install_db.exe to generate them at first install does not return to prompt so make install hang @@ -125,12 +118,10 @@ Source: "*.*"; DestDir: "{app}\www\dolibarr"; Flags: ignoreversion; Excludes: ". ; Config files Source: "build\exe\doliwamp\dolibarr.conf.install"; DestDir: "{app}\alias"; Flags: ignoreversion; -;Source: "build\exe\doliwamp\httpd.conf.install"; DestDir: "{app}\bin\apache\apache2.4.9\conf"; Flags: ignoreversion; -Source: "build\exe\doliwamp\httpd.conf.install"; DestDir: "{app}\bin\apache\apache2.4.41\conf"; Flags: ignoreversion; +Source: "build\exe\doliwamp\httpd.conf.install"; DestDir: "{app}\bin\apache\apache2.4.51\conf"; Flags: ignoreversion; Source: "build\exe\doliwamp\my.ini.install"; DestDir: "{app}\bin\mysql\mysql5.0.45"; Flags: ignoreversion; -Source: "build\exe\doliwamp\my.ini.install"; DestDir: "{app}\bin\mariadb\mariadb10.4.10"; Flags: ignoreversion; -;Source: "build\exe\doliwamp\php.ini.install"; DestDir: "{app}\bin\php\php5.5.12"; Flags: ignoreversion; -Source: "build\exe\doliwamp\php.ini.install"; DestDir: "{app}\bin\php\php7.3.12"; Flags: ignoreversion; +Source: "build\exe\doliwamp\my.ini.install"; DestDir: "{app}\bin\mariadb\mariadb10.6.5"; Flags: ignoreversion; +Source: "build\exe\doliwamp\php.ini.install"; DestDir: "{app}\bin\php\php7.3.33"; Flags: ignoreversion; Source: "build\exe\doliwamp\index.php.install"; DestDir: "{app}\www"; Flags: ignoreversion; Source: "build\exe\doliwamp\install.forced.php.install"; DestDir: "{app}\www\dolibarr\htdocs\install"; Flags: ignoreversion; Source: "build\exe\doliwamp\openssl.conf"; DestDir: "{app}"; Flags: ignoreversion; @@ -236,12 +227,9 @@ procedure InitializeWizard(); begin //version des applis, a modifier pour chaque version de WampServer 2 - //apacheVersion := '2.4.9'; - //phpVersion := '5.5.12' ; - apacheVersion := '2.4.41'; - phpVersion := '7.3.12' ; - //mysqlVersion := '5.0.45'; - mysqlVersion := '10.4.10'; + apacheVersion := '2.4.51'; + phpVersion := '7.3.33' ; + mysqlVersion := '10.6.5'; smtpServer := 'localhost'; apachePort := '80'; @@ -375,9 +363,9 @@ begin // Migration of database -// datadir := pathWithSlashes+'/bin/mariadb/marradb10.4.10/data'; -// exedirold := pathWithSlashes+'/bin/mariadb/marradb10.4.10/'; -// exedirnew := pathWithSlashes+'/bin/mariadb/marradb10.4.10/'; +// datadir := pathWithSlashes+'/bin/mariadb/mariadb10.6.5/data'; +// exedirold := pathWithSlashes+'/bin/mariadb/mariadb10.6.5/'; +// exedirnew := pathWithSlashes+'/bin/mariadb/mariadb10.6.5/'; // If we have a new database version, we should only copy old my.ini file into new directory // and change only all basedir= strings to use new version. Like this, data dir is still correct. @@ -1027,7 +1015,7 @@ Filename: "{app}\rundoliwamp.bat"; Description: {cm:LaunchNow}; Flags: shellexec [UninstallDelete] Type: files; Name: "{app}\*.*" -Type: files; Name: "{app}\bin\mariadb\mariadb10.4.10\*.*" +Type: files; Name: "{app}\bin\mariadb\mariadb10.6.5\*.*" Type: filesandordirs; Name: "{app}\alias" Type: filesandordirs; Name: "{app}\apps" Type: filesandordirs; Name: "{app}\bin\apache" diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 556ce9d0a7e..3024d3b1e61 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -65,7 +65,7 @@ $DIR||='.'; $DIR =~ s/([^\/\\])[\\\/]+$/$1/; $SOURCE="$DIR/.."; $DESTI="$SOURCE/build"; -if ($SOURCE !~ /^\//) +if ($SOURCE !~ /^\// && $SOURCE !~ /^[a-z]:/i) { print "Error: Launch the script $PROG.$Extension with its full path from /.\n"; print "$PROG.$Extension aborted.\n"; @@ -76,15 +76,23 @@ if (! $ENV{"DESTIBETARC"} || ! $ENV{"DESTISTABLE"}) { print "Error: Missing environment variables.\n"; print "You must define the environment variable DESTIBETARC and DESTISTABLE to point to the\ndirectories where you want to save the generated packages.\n"; + print "$PROG.$Extension aborted.\n"; + print "\n"; + print "You can set them with\n"; + print "On Linux:\n"; + print "export DESTIBETARC='/tmp'; export DESTISTABLE='/tmp';\n"; + print "On Windows:\n"; + print "set DESTIBETARC=c:/tmp\n"; + print "set DESTISTABLE=c:/tmp\n"; + print "\n"; print "Example: DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild'\n"; print "Example: DESTISTABLE='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/stable'\n"; - print "$PROG.$Extension aborted.\n"; sleep 2; exit 1; } if (! -d $ENV{"DESTIBETARC"} || ! -d $ENV{"DESTISTABLE"}) { - print "Error: Directory of environment variable DESTIBETARC or DESTISTABLE does not exist.\n"; + print "Error: Directory of environment variable DESTIBETARC ($ENV{'DESTIBETARC'}) or DESTISTABLE ($ENV{'DESTISTABLE'}) does not exist.\n"; print "$PROG.$Extension aborted.\n"; sleep 2; exit 1; @@ -94,7 +102,7 @@ if (! -d $ENV{"DESTIBETARC"} || ! -d $ENV{"DESTISTABLE"}) # -------------- if ("$^O" =~ /linux/i || (-d "/etc" && -d "/var" && "$^O" !~ /cygwin/i)) { $OS='linux'; $CR=''; } elsif (-d "/etc" && -d "/Users") { $OS='macosx'; $CR=''; } -elsif ("$^O" =~ /cygwin/i || "$^O" =~ /win32/i) { $OS='windows'; $CR="\r"; } +elsif ("$^O" =~ /cygwin/i || "$^O" =~ /win32/i || "$^O" =~ /msys/i) { $OS='windows'; $CR="\r"; } if (! $OS) { print "Error: Can't detect your OS.\n"; print "Can't continue.\n"; @@ -390,7 +398,7 @@ if ($nboftargetok) { $olddir=getcwd(); chdir("$SOURCE"); - print "Clean $SOURCE/htdocs\n"; + print "Clean $SOURCE/htdocs/includes/autoload.php\n"; $ret=`rm -f $SOURCE/htdocs/includes/autoload.php`; $ret=`git ls-files . --exclude-standard --others`; @@ -1074,28 +1082,52 @@ if ($nboftargetok) { print "Remove target $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe...\n"; unlink "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"; - print "Check that in your Wine setup, you have created a Z: drive that point to your / directory.\n"; - + if ($OS eq 'windows') { + print "Check that ISCC.exe is in your PATH.\n"; + } else { + print "Check that in your Wine setup, you have created a Z: drive that point to your / directory.\n"; + } + $SOURCEBACK=$SOURCE; $SOURCEBACK =~ s/\//\\/g; - print "Prepare file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss from \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.iss\"\n"; - $ret=`cat "$SOURCE/build/exe/doliwamp/doliwamp.iss" | sed -e 's/__FILENAMEEXEDOLIWAMP__/$FILENAMEEXEDOLIWAMP/g' > "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`; + print "Prepare file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\" from \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.iss\"\n"; + + #$ret=`cat "$SOURCE/build/exe/doliwamp/doliwamp.iss" | sed -e 's/__FILENAMEEXEDOLIWAMP__/$FILENAMEEXEDOLIWAMP/g' > "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`; + open(IN, '<' . $SOURCE."/build/exe/doliwamp/doliwamp.iss") or die $!; + open(OUT, '>' . "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss") or die $!; + while() + { + $_ =~ s/__FILENAMEEXEDOLIWAMP__/$FILENAMEEXEDOLIWAMP/g; + print OUT $_; + } + close(IN); + close(OUT); - print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\"\n"; - $cmd= "wine ISCC.exe \"Z:$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\""; + print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\" on OS $OS\n"; + + if ($OS eq 'windows') { + $cmd= "ISCC.exe \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\""; + } else { + #$cmd= "wine ISCC.exe \"Z:$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\""; + } print "$cmd\n"; $ret= `$cmd`; - #print "$ret\n"; + print "ret=$ret\n"; # Move to final dir print "Move \"$SOURCE\\build\\$FILENAMEEXEDOLIWAMP.exe\" to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n"; rename("$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe","$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"); print "Move $SOURCE/build/$FILENAMEEXEDOLIWAMP.exe to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n"; - $ret=`mv "$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe" "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"`; + + use File::Copy; + + #$ret=`mv "$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe" "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"`; + $ret=move("$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe", "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"); print "Remove tmp file $SOURCE/build/exe/doliwamp/doliwamp.tmp.iss\n"; - $ret=`rm "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`; + #$ret=`rm "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`; + $ret=unlink("$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"); next; } @@ -1242,7 +1274,7 @@ if ($nboftargetok) { print "\n----- Summary -----\n"; foreach my $target (sort keys %CHOOSEDTARGET) { - if ($target eq '-CHKSUM') { print "Checksum was generated"; next; } + if ($target eq '-CHKSUM') { print "Checksum was generated\n"; next; } if ($CHOOSEDTARGET{$target} < 0) { print "Package $target not built (bad requirement).\n"; } else { diff --git a/build/makepack-howto.txt b/build/makepack-howto.txt index d4e37e32629..be88302cd1d 100644 --- a/build/makepack-howto.txt +++ b/build/makepack-howto.txt @@ -1,7 +1,34 @@ ----- Dolibarr Makepack How To ----- This documentation describe steps to build a BETA or RELEASE versions -of Dolibarr. There is a chapter for BETA version and a chapter for -RELEASE version. +of Dolibarr. There is a chapter for BETA version and a chapter for RELEASE version. + + +***** Prerequisites For Linux ***** + +Prerequisites to build tgz, debian and rpm packages: +> apt-get install perl tar dpkg dpatch p7zip-full rpm zip php-cli + +Prerequisites to build autoexe DoliWamp package: +> apt-get install wine q4wine +> Launch "wine cmd" to check a drive Z: pointing to / exists. +> Install InnoSetup + For example by running isetup-5.5.8.exe (https://www.jrsoftware.org) https://files.jrsoftware.org/is/5/ +> Install WampServer into "C:\wamp64" to have Apache, PHP and MariaDB + For example by running wampserver3.2.0_x64.exe (https://www.wampserver.com). + See file build/exe/doliwamp.iss to know the doliwamp version currently setup. +> Add path to ISCC into PATH windows var: + Launch wine cmd, then regedit and add entry int HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment\PATH +> To build manually the .exe from Windows (running from makepack-dolibarr.pl script is however recommanded), + open file build/exe/doliwamp.iss and click on button "Compile". + The .exe file will be build into directory build. + + +***** Prerequisites For Windows ***** + +Install Perl +Install WampServer-3.2.*-64.exe +isetup-5.5.8.exe + ***** Actions to do a BETA ***** This files describe steps made by Dolibarr packaging team to make a diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 27130244d00..1c6716408b7 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -227,6 +227,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/ticket %_datadir/dolibarr/htdocs/user %_datadir/dolibarr/htdocs/variants +%_datadir/dolibarr/htdocs/webhook %_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/workstation diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index aeddd5526f8..f6d81feaea4 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -54,7 +54,7 @@ BuildRequires: desktop-file-utils Group: Applications/Productivity Requires: apache-base, apache-mod_php, php-cgi, php-cli, php-bz2, php-gd, php-ldap, php-imap, php-mysqli, php-openssl, fonts-ttf-dejavu Requires: mysql, mysql-client -%else%_datadir/dolibarr/htdocs/datapolicy +%else %if 0%{?suse_version} # Voir http://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros Group: Productivity/Office/Management @@ -67,7 +67,7 @@ Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mbstring Requires: mysql-server, mysql Requires: php-mysqli >= 4.1.0 %endif -%endif%_datadir/dolibarr/htdocs/eventorganization +%endif %endif @@ -125,7 +125,7 @@ cui hai bisogno ed essere facile da usare. %if 0%{?sles_version} %{__rm} -rf $RPM_BUILD_ROOT -%{__mkdir} $RPM_BUILD_ROOT%_datadir/dolibarr/htdocs/datapolicy +%{__mkdir} $RPM_BUILD_ROOT% %{__mkdir} $RPM_BUILD_ROOT%{_sysconfdir} %{__mkdir} $RPM_BUILD_ROOT%{_sysconfdir}/%{name} %else @@ -308,6 +308,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/ticket %_datadir/dolibarr/htdocs/user %_datadir/dolibarr/htdocs/variants +%_datadir/dolibarr/htdocs/webhook %_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/workstation diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index a1e4dffc781..a371e3ab02f 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -224,6 +224,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/ticket %_datadir/dolibarr/htdocs/user %_datadir/dolibarr/htdocs/variants +%_datadir/dolibarr/htdocs/webhook %_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/workstation diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index aed2d76ed29..bd6834582ac 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -66,7 +66,7 @@ ed essere facile da usare. Programmo web, progettato per poter fornire solo ciò di cui hai bisogno ed essere facile da usare. - +%_datadir/dolibarr/htdocs/webhook #---- prep %prep @@ -235,6 +235,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/ticket %_datadir/dolibarr/htdocs/user %_datadir/dolibarr/htdocs/variants +%_datadir/dolibarr/htdocs/webhook %_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/workstation diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 2e04a29b69f..44a12293e67 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -621,6 +621,11 @@ if (empty($reshook)) { } } $action = ($result < 0 || !$error) ? '' : 'create'; + + if (!$error && $backtopage) { + header("Location: ".$backtopage); + exit; + } } if ($user->rights->adherent->supprimer && $action == 'confirm_delete' && $confirm == 'yes') { diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index c860a19d588..dec7584b68e 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -670,11 +670,10 @@ class Adherent extends CommonObject $this->town = ($this->town ? $this->town : $this->town); $this->country_id = ($this->country_id > 0 ? $this->country_id : $this->country_id); $this->state_id = ($this->state_id > 0 ? $this->state_id : $this->state_id); - $this->setUpperOrLowerCase(); $this->note_public = ($this->note_public ? $this->note_public : $this->note_public); $this->note_private = ($this->note_private ? $this->note_private : $this->note_private); $this->url = $this->url ?clean_url($this->url, 0) : ''; - + $this->setUpperOrLowerCase(); // Check parameters if (!empty($conf->global->ADHERENT_MAIL_REQUIRED) && !isValidEMail($this->email)) { $langs->load("errors"); diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index ddc9a1470c0..f3d5f96a78a 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2013 Florian Henry * Copyright (C) 2015 Alexandre Spangaro - * Copyright (C) 2019 Thibault Foucart + * Copyright (C) 2019-2022 Thibault Foucart * Copyright (C) 2020 Josep Lluís Amador * Copyright (C) 2021 Waël Almoman * @@ -141,6 +141,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); } else { $sql = "SELECT libelle FROM ".MAIN_DB_PREFIX."adherent_type WHERE libelle='".$db->escape($object->label)."'"; + $sql .= " WHERE entity IN (".getEntity('member_type').")"; $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index ce36d97d06a..e3f2c7307f7 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -207,21 +207,11 @@ $message .= $langs->trans("AgendaUrlOptionsIncludeHolidays", '1', '1').'
'; print info_admin($message); -if (!empty($conf->use_javascript_ajax)) { - print "\n".''; -} +$constname = 'MAIN_AGENDA_XCAL_EXPORTKEY'; + +// Add button to autosuggest a key +include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; +print dolJSToSetRandomPassword($constname); // End of page llxFooter(); diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 57c32d79318..1a4f5873e33 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -396,7 +396,7 @@ if ($resql) { } } } else { - print $langs->trans("ChooseABarCode"); + print ''.$langs->trans("ChooseABarCode").''; } print ''; @@ -439,7 +439,7 @@ if (!isset($_SERVER['WINDIR'])) { print ''; print ''.$langs->trans("GenbarcodeLocation").''; print ''; - print ''; + print ''; if (!empty($conf->global->GENBARCODE_LOCATION) && !@file_exists($conf->global->GENBARCODE_LOCATION)) { $langs->load("errors"); print '
'.$langs->trans("ErrorFileNotFound", $conf->global->GENBARCODE_LOCATION).''; diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index a8d33ae5a09..8f98b4d25e9 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -188,22 +188,10 @@ if (!empty($conf->global->CLICKTODIAL_URL)) { } } -if (!empty($conf->use_javascript_ajax)) { - print "\n".''; -} +// Add button to autosuggest a key +include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; +print dolJSToSetRandomPassword('CLICKTODIAL_KEY_FOR_CIDLOOKUP'); + // End of page llxFooter(); diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index fa5d6deae97..dd29ee1cde3 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -622,34 +622,33 @@ $sourceList = array(); if ($id == 11) { $elementList = array( '' => '', - 'societe' => $langs->trans('ThirdParty'), + 'agenda' => img_picto('', 'action', 'class="pictofixedwidth"').$langs->trans('Agenda'), + 'dolresource' => img_picto('', 'resource', 'class="pictofixedwidth"').$langs->trans('Resource'), + 'societe' => img_picto('', 'company', 'class="pictofixedwidth"').$langs->trans('ThirdParty'), // 'proposal' => $langs->trans('Proposal'), // 'order' => $langs->trans('Order'), // 'invoice' => $langs->trans('Bill'), - 'supplier_proposal' => $langs->trans('SupplierProposal'), - 'order_supplier' => $langs->trans('SupplierOrder'), - 'invoice_supplier' => $langs->trans('SupplierBill'), // 'intervention' => $langs->trans('InterventionCard'), // 'contract' => $langs->trans('Contract'), - 'project' => $langs->trans('Project'), - 'project_task' => $langs->trans('Task'), - 'ticket' => $langs->trans('Ticket'), - 'agenda' => $langs->trans('Agenda'), - 'dolresource' => $langs->trans('Resource'), - // old deprecated - 'propal' => $langs->trans('Proposal'), - 'commande' => $langs->trans('Order'), - 'facture' => $langs->trans('Bill'), - 'fichinter' => $langs->trans('InterventionCard'), - 'contrat' => $langs->trans('Contract'), + 'project' => img_picto('', 'project', 'class="pictofixedwidth"').$langs->trans('Project'), + 'project_task' => img_picto('', 'projecttask', 'class="pictofixedwidth"').$langs->trans('Task'), + 'propal' => img_picto('', 'propal', 'class="pictofixedwidth"').$langs->trans('Proposal'), + 'commande' => img_picto('', 'order', 'class="pictofixedwidth"').$langs->trans('Order'), + 'facture' => img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans('Bill'), + 'fichinter' => img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterventionCard'), + 'contrat' => img_picto('', 'contract', 'class="pictofixedwidth"').$langs->trans('Contract'), + 'ticket' => img_picto('', 'ticket', 'class="pictofixedwidth"').$langs->trans('Ticket'), + 'supplier_proposal' => img_picto('', 'supplier_proposal', 'class="pictofixedwidth"').$langs->trans('SupplierProposal'), + 'order_supplier' => img_picto('', 'supplier_order', 'class="pictofixedwidth"').$langs->trans('SupplierOrder'), + 'invoice_supplier' => img_picto('', 'supplier_invoice', 'class="pictofixedwidth"').$langs->trans('SupplierBill'), ); - if (!empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) { - $elementList["societe"] = $langs->trans('ThirdParty'); + if (!empty($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL >= 2) { + $elementList['conferenceorbooth'] = img_picto('', 'eventorganization', 'class="pictofixedwidth"').$langs->trans('ConferenceOrBooth'); } complete_elementList_with_modules($elementList); - asort($elementList); + //asort($elementList); $sourceList = array( 'internal' => $langs->trans('Internal'), 'external' => $langs->trans('External') @@ -1202,7 +1201,6 @@ if (GETPOST('from')) { if ($action == 'delete') { print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'rowid='.urlencode($rowid).'&code='.urlencode($code).$paramwithsearch, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); } -//var_dump($elementList); /* @@ -1960,7 +1958,7 @@ if ($id > 0) { $valuetoshow = price($valuetoshow); } if ($value == 'private') { - $valuetoshow = yn($elementList[$valuetoshow]); + $valuetoshow = yn($valuetoshow); } elseif ($value == 'libelle_facture') { $langs->load("bills"); $key = $langs->trans("PaymentCondition".strtoupper($obj->code)); @@ -2375,9 +2373,15 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print ''; print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'lang'); print ''; - } elseif (in_array($value, array('element', 'source'))) { //Example: the type and source of the element (for contact types) + } elseif (in_array($value, array('element', 'source'))) { // Example: the type and source of the element (for contact types) + $tmparray = array(); + if ($value == 'element') { + $tmparray = $elementList; + } else { + $tmparray = $sourceList; + } print ''; - print $form->selectarray($value, $elementList, (!empty($obj->{$value}) ? $obj->{$value}:'')); + print $form->selectarray($value, $tmparray, (!empty($obj->{$value}) ? $obj->{$value}:''), 0, 0, 0, '', 0, 0, 0, '', 'maxwidth250'); print ''; } elseif (in_array($value, array('public', 'use_default'))) { // Fields 0/1 with a combo select Yes/No diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index ab4f0c7def0..bc8267f9ef9 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -378,33 +378,54 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $connectstringserver = $object->getConnectStringIMAP($usessl); - try { - if ($sourcedir) { - //$connectstringsource = $connectstringserver.imap_utf7_encode($sourcedir); - $connectstringsource = $connectstringserver.$object->getEncodedUtf7($sourcedir); - } - if ($targetdir) { - //$connectstringtarget = $connectstringserver.imap_utf7_encode($targetdir); - $connectstringtarget = $connectstringserver.$object->getEncodedUtf7($targetdir); + if ($action == 'scan') { + try { + if ($sourcedir) { + //$connectstringsource = $connectstringserver.imap_utf7_encode($sourcedir); + $connectstringsource = $connectstringserver.$object->getEncodedUtf7($sourcedir); + } + if ($targetdir) { + //$connectstringtarget = $connectstringserver.imap_utf7_encode($targetdir); + $connectstringtarget = $connectstringserver.$object->getEncodedUtf7($targetdir); + } + + $timeoutconnect = empty($conf->global->MAIN_USE_CONNECT_TIMEOUT) ? 5 : $conf->global->MAIN_USE_CONNECT_TIMEOUT; + $timeoutread = empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT) ? 20 : $conf->global->MAIN_USE_RESPONSE_TIMEOUT; + + dol_syslog("imap_open connectstring=".$connectstringsource." login=".$object->login." password=".$object->password." timeoutconnect=".$timeoutconnect." timeoutread=".$timeoutread); + + $result1 = imap_timeout(IMAP_OPENTIMEOUT, $timeoutconnect); // timeout seems ignored with ssl connect + $result2 = imap_timeout(IMAP_READTIMEOUT, $timeoutread); + $result3 = imap_timeout(IMAP_WRITETIMEOUT, 5); + $result4 = imap_timeout(IMAP_CLOSETIMEOUT, 5); + + dol_syslog("result1=".$result1." result2=".$result2." result3=".$result3." result4=".$result4); + + $connection = imap_open($connectstringsource, $object->login, $object->password); + + //dol_syslog("end imap_open connection=".var_export($connection, true)); + } catch (Exception $e) { + print $e->getMessage(); } - $timeoutconnect = empty($conf->global->MAIN_USE_CONNECT_TIMEOUT) ? 5 : $conf->global->MAIN_USE_CONNECT_TIMEOUT; - $timeoutread = empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT) ? 20 : $conf->global->MAIN_USE_RESPONSE_TIMEOUT; + if (!$connection) { + $morehtml .= 'Failed to open IMAP connection '.$connectstringsource; + if (function_exists('imap_last_error')) { + $morehtml .= '
'.imap_last_error(); + } + dol_syslog("Error ".$morehtml, LOG_WARNING); + //var_dump(imap_errors()) + } else { + dol_syslog("Imap connected. Now we call imap_num_msg()"); + $morehtml .= imap_num_msg($connection); + } - dol_syslog("imap_open connectstring=".$connectstringsource." login=".$object->login." password=".$object->password." timeoutconnect=".$timeoutconnect." timeoutread=".$timeoutread); - - $result1 = imap_timeout(IMAP_OPENTIMEOUT, $timeoutconnect); // timeout seems ignored with ssl connect - $result2 = imap_timeout(IMAP_READTIMEOUT, $timeoutread); - $result3 = imap_timeout(IMAP_WRITETIMEOUT, 5); - $result4 = imap_timeout(IMAP_CLOSETIMEOUT, 5); - - dol_syslog("result1=".$result1." result2=".$result2." result3=".$result3." result4=".$result4); - - $connection = imap_open($connectstringsource, $object->login, $object->password); - - //dol_syslog("end imap_open connection=".var_export($connection, true)); - } catch (Exception $e) { - print $e->getMessage(); + if ($connection) { + dol_syslog("Imap close"); + imap_close($connection); + } + } else { + $morehtml .= ''.img_picto('', 'refresh', 'class="paddingrightonly"').$langs->trans("Refresh").''; } $morehtml .= $form->textwithpicto('', 'connect string '.$connectstringserver); @@ -412,23 +433,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtml .= 'IMAP functions not available on your PHP. '; } - if (!$connection) { - $morehtml .= 'Failed to open IMAP connection '.$connectstringsource; - if (function_exists('imap_last_error')) { - $morehtml .= '
'.imap_last_error(); - } - dol_syslog("Error ".$morehtml, LOG_WARNING); - //var_dump(imap_errors()) - } else { - dol_syslog("Imap connected. Now we call imap_num_msg()"); - $morehtml .= imap_num_msg($connection); - } - - if ($connection) { - dol_syslog("Imap close"); - imap_close($connection); - } - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref.'
'.$morehtml.'
', '', 0, '', '', 0, ''); print '
'; @@ -580,11 +584,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; print $form->selectarray('operationtype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', 'maxwidth300', 1); print ''; - print ''; + //print ''; + $htmltext = $langs->transnoentitiesnoconv("OperationParamDesc"); + print $form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'operationparamtt'); print ''; print ''; - $htmltext = $langs->transnoentitiesnoconv("OperationParamDesc"); - print $form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'operationparamtt'); print ''; print ''; print ''; diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index ee6c2ae6b52..05df4187130 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -273,21 +273,10 @@ if ($action == 'edit') { if (!empty($conf->use_javascript_ajax)) { print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"'); } - if (!empty($conf->use_javascript_ajax)) { - print "\n".''; - } + + // Add button to autosuggest a key + include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; + print dolJSToSetRandomPassword($constname, 'generate_token'.$constname); } elseif ($val['type'] == 'product') { if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { $selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname); diff --git a/htdocs/admin/hrm.php b/htdocs/admin/hrm.php index b1b74189d35..cfe40c006b7 100644 --- a/htdocs/admin/hrm.php +++ b/htdocs/admin/hrm.php @@ -540,21 +540,10 @@ if ($action == 'edit') { if (!empty($conf->use_javascript_ajax)) { print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"'); } - if (!empty($conf->use_javascript_ajax)) { - print "\n".''; - } + + // Add button to autosuggest a key + include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; + print dolJSToSetRandomPassword($constname, 'generate_token'.$constname); } elseif ($val['type'] == 'product') { if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { $selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname); diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 37735a43ed3..da2df89b21a 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -107,21 +107,11 @@ llxHeader('', $langs->trans("MailingSetup")); $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("MailingSetup"), $linkback, 'title_setup'); -if (!empty($conf->use_javascript_ajax)) { - print "\n".''; -} +$constname = 'MAILING_EMAIL_UNSUBSCRIBE_KEY'; + +// Add button to autosuggest a key +include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; +print dolJSToSetRandomPassword($constname); print '
'; print '
'; diff --git a/htdocs/admin/oauth.php b/htdocs/admin/oauth.php index 772055f0809..ade561c4ef1 100644 --- a/htdocs/admin/oauth.php +++ b/htdocs/admin/oauth.php @@ -62,7 +62,7 @@ if ($action == 'add') { // $provider is OAUTH_XXX setEventMessages($langs->trans("AOAuthEntryForThisProviderAndLabelAlreadyHasAKey"), null, 'errors'); $error++; } else { - dolibarr_set_const($db, $constname, 'ToComplete', 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, $constname, $langs->trans('ToComplete'), 'chaine', 0, '', $conf->entity); setEventMessages($langs->trans("OAuthProviderAdded"), null); } } @@ -78,6 +78,16 @@ if ($action == 'update') { if (!dolibarr_set_const($db, $constvalue.'_SECRET', GETPOST($constvalue.'_ID') ? GETPOST($constvalue.'_SECRET') : '', 'chaine', 0, '', $conf->entity)) { $error++; } + if (GETPOSTISSET($constvalue.'_URLAUTHORIZE')) { + if (!dolibarr_set_const($db, $constvalue.'_URLAUTHORIZE', GETPOST($constvalue.'_URLAUTHORIZE'), 'chaine', 0, '', $conf->entity)) { + $error++; + } + } + if (GETPOSTISSET($constvalue.'_SCOPE')) { + if (!dolibarr_set_const($db, $constvalue.'_SCOPE', GETPOST($constvalue.'_SCOPE'), 'chaine', 0, '', $conf->entity)) { + $error++; + } + } } } @@ -147,11 +157,17 @@ print ''; $i = 0; -//var_dump($list); +// Define $listinsetup foreach ($conf->global as $key => $val) { if (!empty($val) && preg_match('/^OAUTH_.*_ID$/', $key)) { $provider = preg_replace('/_ID$/', '', $key); - $listinsetup[] = array($provider.'_NAME', $provider.'_ID', $provider.'_SECRET', 'OAUTH Provider '.str_replace('OAUTH_', '', $provider)); + $listinsetup[] = array( + $provider.'_NAME', + $provider.'_ID', + $provider.'_SECRET', + $provider.'_URLAUTHORIZE', // For custom oauth links + $provider.'_SCOPE' // For custom oauth links + ); } } @@ -178,12 +194,16 @@ foreach ($listinsetup as $key) { $i++; - print ''; // Api Name $label = $langs->trans($keyforsupportedoauth2array); + print ''; print ''; print ''; - print ''; + + if ($keyforsupportedoauth2array == 'OAUTH_OTHER_NAME') { + print ''; + print ''; + print ''; + } } else { print ''; print ''; @@ -213,14 +240,32 @@ foreach ($listinsetup as $key) { // Api Id print ''; print ''; - print ''; // Api Secret print ''; print ''; - print ''; + + // TODO Move this into token generation + if ($supported) { + if ($keyforsupportedoauth2array == 'OAUTH_OTHER_NAME') { + print ''; + print ''; + print ''; + } else { + print ''; + print ''; + print ''; + } + } } print '
'; print img_picto('', $supportedoauth2array[$keyforsupportedoauth2array]['picto'], 'class="pictofixedwidth"'); - print $label; + if ($label == $keyforsupportedoauth2array) { + print $supportedoauth2array[$keyforsupportedoauth2array]['name']; + } else { + print $label; + } if ($keyforprovider) { print ' ('.$keyforprovider.')'; } else { @@ -201,8 +221,15 @@ foreach ($listinsetup as $key) { $redirect_uri = $urlwithroot.'/core/modules/oauth/'.$supportedoauth2array[$keyforsupportedoauth2array]['callbackfile'].'_oauthcallback.php'; print '
'.$langs->trans("UseTheFollowingUrlAsRedirectURI").''; + print ''; print '
'.$langs->trans("URLOfServiceForAuthorization").''; + print '
'.$langs->trans("UseTheFollowingUrlAsRedirectURI").'
'; + print ''; print '
'; + print ''; print '
'.$langs->trans("Scopes").''; + print ''; + print '
'.$langs->trans("Scopes").''; + //print ''; + print $supportedoauth2array[$keyforsupportedoauth2array]['defaultscope']; + print '
'."\n"; diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php index b2830f95743..00daaf01e27 100644 --- a/htdocs/admin/oauthlogintokens.php +++ b/htdocs/admin/oauthlogintokens.php @@ -138,11 +138,17 @@ if (GETPOST('error')) { if ($mode == 'setup' && $user->admin) { print ''.$langs->trans("OAuthSetupForLogin")."

\n"; - //var_dump($list); + // Define $listinsetup foreach ($conf->global as $key => $val) { if (!empty($val) && preg_match('/^OAUTH_.*_ID$/', $key)) { $provider = preg_replace('/_ID$/', '', $key); - $listinsetup[] = array($provider.'_NAME', $provider.'_ID', $provider.'_SECRET', 'OAUTH Provider '.str_replace('OAUTH_', '', $provider)); + $listinsetup[] = array( + $provider.'_NAME', + $provider.'_ID', + $provider.'_SECRET', + $provider.'_URLAUTHORIZE', // For custom oauth links + $provider.'_SCOPE' // For custom oauth links + ); } } @@ -165,46 +171,39 @@ if ($mode == 'setup' && $user->admin) { $OAUTH_SERVICENAME = (empty($supportedoauth2array[$keyforsupportedoauth2array]['name']) ? 'Unknown' : $supportedoauth2array[$keyforsupportedoauth2array]['name'].($keyforprovider ? '-'.$keyforprovider : '')); - // Define $shortscope, $urltorenew, $urltodelete, $urltocheckperms + $shortscope = $supportedoauth2array[$keyforsupportedoauth2array]['defaultscope']; + if (getDolGlobalString($key[4])) { + $shortscope = getDolGlobalString($key[4]); + } + $state = $shortscope; // TODO USe a better state + + // Define $urltorenew, $urltodelete, $urltocheckperms // TODO Use array $supportedoauth2array if ($keyforsupportedoauth2array == 'OAUTH_GITHUB_NAME') { // List of keys that will be converted into scopes (from constants 'SCOPE_state_in_uppercase' in file of service). // We pass this param list in to 'state' because we need it before and after the redirect. - $shortscope = 'user,public_repo'; - // Note: github does not accept csrf key inside the state parameter (only know values) - $urltorenew = $urlwithroot.'/core/modules/oauth/github_oauthcallback.php?shortscope='.$shortscope.'&state='.$shortscope.'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); + // Note: github does not accept csrf key inside the state parameter (only known values) + $urltorenew = $urlwithroot.'/core/modules/oauth/github_oauthcallback.php?shortscope='.urlencode($shortscope).'&state='.$shortscope.'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); $urltodelete = $urlwithroot.'/core/modules/oauth/github_oauthcallback.php?action=delete&token='.newToken().'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); $urltocheckperms = 'https://github.com/settings/applications/'; } elseif ($keyforsupportedoauth2array == 'OAUTH_GOOGLE_NAME') { // List of keys that will be converted into scopes (from constants 'SCOPE_state_in_uppercase' in file of service). // List of scopes for Google are here: https://developers.google.com/identity/protocols/oauth2/scopes // We pass this key list into the param 'state' because we need it before and after the redirect. - $shortscope = 'userinfo_email,userinfo_profile'; - $shortscope .= ',openid,email,profile'; // For openid connect - if (!empty($conf->printing->enabled)) { - $shortscope .= ',cloud_print'; - } - if (!empty($conf->global->OAUTH_GOOGLE_GSUITE)) { - $shortscope .= ',admin_directory_user'; - } - if (!empty($conf->global->OAUTH_GOOGLE_GMAIL)) { - $shortscope.=',gmail_full'; - } - - $urltorenew = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?shortscope='.$shortscope.'&state='.$shortscope.'-'.$oauthstateanticsrf.'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); + $urltorenew = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?shortscope='.urlencode($shortscope).'&state='.urlencode($state).'-'.$oauthstateanticsrf.'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); $urltodelete = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?action=delete&token='.newToken().'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); $urltocheckperms = 'https://security.google.com/settings/security/permissions'; } elseif ($keyforsupportedoauth2array == 'OAUTH_STRIPE_TEST_NAME') { - $shortscope = 'none'; - - $urltorenew = $urlwithroot.'/core/modules/oauth/stripetest_oauthcallback.php?backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); + $urltorenew = $urlwithroot.'/core/modules/oauth/stripetest_oauthcallback.php?shortscope='.urlencode($shortscope).'&state='.urlencode($state).'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); $urltodelete = ''; $urltocheckperms = ''; } elseif ($keyforsupportedoauth2array == 'OAUTH_STRIPE_LIVE_NAME') { - $shortscope = 'none'; - - $urltorenew = $urlwithroot.'/core/modules/oauth/stripelive_oauthcallback.php?backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); + $urltorenew = $urlwithroot.'/core/modules/oauth/stripelive_oauthcallback.php?shortscope='.urlencode($shortscope).'&state='.urlencode($state).'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); + $urltodelete = ''; + $urltocheckperms = ''; + } elseif ($keyforsupportedoauth2array = 'OAUTH_OTHER_NAME') { + $urltorenew = $urlwithroot.'/core/modules/oauth/generic_oauthcallback.php?shortscope='.urlencode($shortscope).'&state='.urlencode($state).'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); $urltodelete = ''; $urltocheckperms = ''; } else { @@ -212,7 +211,8 @@ if ($mode == 'setup' && $user->admin) { $urltodelete = ''; $urltocheckperms = ''; } - $urltorenew .= '&keyforprovider='.$keyforprovider; + + $urltorenew .= '&keyforprovider='.urlencode($keyforprovider); // Show value of token $tokenobj = null; @@ -246,7 +246,7 @@ if ($mode == 'setup' && $user->admin) { } elseif ($endoflife == $tokenobj::EOL_UNKNOWN) { $expiredat = $langs->trans("Unknown"); } else { - $expiredat = dol_print_date($endoflife, "dayhour"); + $expiredat = dol_print_date($endoflife, "dayhour", 'tzuserrel'); } } } @@ -260,10 +260,16 @@ if ($mode == 'setup' && $user->admin) { print '
'; print ''."\n"; + // Api Name + $label = $langs->trans($keyforsupportedoauth2array); print ''; print ''; +print ''; +print ''; +print ''; +print ''; + /* if (empty($conf->global->MAIN_APPLICATION_TITLE)) { $conf->global->MAIN_APPLICATION_TITLE = ""; diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index a23f3127ca8..2b25d7deb5a 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -643,7 +643,7 @@ print ''."\n"; print ''; print ''; print '"; print "\n"; diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index fae91d3ecb4..588cc5ed866 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -168,9 +168,10 @@ print ''; print ''; -print '
'; print img_picto('', $supportedoauth2array[$keyforsupportedoauth2array]['picto'], 'class="pictofixedwidth"'); - print $langs->trans($keyforsupportedoauth2array); + if ($label == $keyforsupportedoauth2array) { + print $supportedoauth2array[$keyforsupportedoauth2array]['name']; + } else { + print $label; + } if ($keyforprovider) { print ' ('.$keyforprovider.')'; } else { @@ -292,7 +298,8 @@ if ($mode == 'setup' && $user->admin) { print ''; print ''; if (is_object($tokenobj)) { - print $langs->trans("HasAccessToken"); + // TODO Read in database to get the date of creation of token + print $form->textwithpicto(yn(1), $langs->trans("HasAccessToken").' : '); } else { print ''.$langs->trans("NoAccessToken").''; } @@ -305,7 +312,9 @@ if ($mode == 'setup' && $user->admin) { } // Request remote token if ($urltorenew) { - print ''.$langs->trans('RequestAccess').'
'; + print ''.$langs->trans('GetAccess').''; + print $form->textwithpicto('', $langs->trans('RequestAccess')); + print '
'; } // Check remote access if ($urltocheckperms) { @@ -378,8 +387,8 @@ if ($mode == 'setup' && $user->admin) { } } - print ''; + print '
'; } } diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 79190725c16..090e2254541 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -61,14 +61,17 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { dol_print_error($db); } } elseif ($action == 'updateform') { - $res1 = 1; $res2 = 1; + $res1 = 1; $res2 = 1; $res3 = 1; if (GETPOSTISSET('MAIN_APPLICATION_TITLE')) { $res1 = dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", GETPOST("MAIN_APPLICATION_TITLE", 'alphanohtml'), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET('MAIN_SESSION_TIMEOUT')) { $res2 = dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", GETPOST("MAIN_SESSION_TIMEOUT", 'alphanohtml'), 'chaine', 0, '', $conf->entity); } - if ($res1 && $res2) { + if (GETPOSTISSET('MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT')) { + $res3 = dolibarr_set_const($db, "MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT", GETPOST("MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT", 'alphanohtml'), 'int', 0, '', $conf->entity); + } + if ($res1 && $res2 && $res3) { setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); } } @@ -174,6 +177,14 @@ print ''; print '
'.$langs->trans("MaxNumberOfImagesInGetPost").''; +print ''; +print ' '.strtolower($langs->trans("Images")); +print '
'.$langs->trans("MainDefaultWarehouse").''; -print $formproduct->selectWarehouses($conf->global->MAIN_DEFAULT_WAREHOUSE, 'default_warehouse', '', 1, 0, 0, '', 0, 0, array(), 'left reposition'); +print $formproduct->selectWarehouses(!empty($conf->global->MAIN_DEFAULT_WAREHOUSE) ? $conf->global->MAIN_DEFAULT_WAREHOUSE : -1, 'default_warehouse', '', 1, 0, 0, '', 0, 0, array(), 'left reposition'); print ''; print "
'; print $langs->trans("DatabaseName").' : '.$dolibarr_main_db_name.'
'; print '
'; +print '
'; print ''; + print ''; print ''; -print ''; -print ''; +print ''; +print '
'; @@ -195,27 +196,31 @@ print ''; print ''; print ''; +print '
'; + +print ''; print ''; print ''; if ($permission) { - print ""; + print "id."'>"; print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft'); print ""; @@ -597,7 +598,8 @@ if ($type == Categorie::TYPE_CUSTOMER) { print ''; print '
'; - $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($socs); $nbtotalofrecords = ''; $newcardbutton = ''; + $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($socs); $nbtotalofrecords = ''; + $newcardbutton = dolGetButtonTitle($langs->trans("AddThirdParty"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/societe/card.php?action=create&client=3&custcats[]='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $user->rights->societe->creer); print_barre_liste($langs->trans("Customers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'companies', 0, $newcardbutton, '', $limit); print ''."\n"; @@ -618,7 +620,7 @@ if ($type == Categorie::TYPE_CUSTOMER) { // Link to delete from category print '
'; if ($permission) { - print ""; + print "id."'>"; print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft'); print ""; @@ -671,7 +673,8 @@ if ($type == Categorie::TYPE_SUPPLIER) { print ''; print '
'; - $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($socs); $nbtotalofrecords = ''; $newcardbutton = ''; + $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($socs); $nbtotalofrecords = ''; + $newcardbutton = dolGetButtonTitle($langs->trans("AddSupplier"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/societe/card.php?action=create&fournisseur=1&suppcats[]='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $user->rights->societe->creer); print_barre_liste($langs->trans("Suppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'companies', 0, $newcardbutton, '', $limit); print ''."\n"; @@ -692,7 +695,7 @@ if ($type == Categorie::TYPE_SUPPLIER) { // Link to delete from category print ''; $texte .= ''; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= '
'; if ($permission) { - print ""; + print "id."'>"; print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft'); print ""; @@ -748,7 +751,8 @@ if ($type == Categorie::TYPE_MEMBER) { print ''; print '
'; - $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($prods); $nbtotalofrecords = ''; $newcardbutton = ''; + $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($prods); $nbtotalofrecords = ''; + $newcardbutton = dolGetButtonTitle($langs->trans("AddMember"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/card.php?action=create&memcats[]='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $user->rights->adherent->creer); print_barre_liste($langs->trans("Member"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit); print "\n"; @@ -772,7 +776,7 @@ if ($type == Categorie::TYPE_MEMBER) { // Link to delete from category print ''; } else { - if ($this->withreadid > 0) { + if (isset($this->withreadid) && $this->withreadid > 0) { $subject = $langs->trans('SubjectAnswerToTicket').' '.$this->withreadid.' : '.$this->topic_title.''; + } else { + $subject = GETPOST('subject', 'alpha'); } - print ''; + print ''; print ''; } } @@ -643,7 +645,7 @@ class FormTicket print '
'; - print $form->buttonsSaveCancel((($this->withreadid > 0) ? "SendResponse" : "CreateTicket"), ($this->withcancel ? "Cancel" : "")); + print $form->buttonsSaveCancel(((isset($this->withreadid) && $this->withreadid > 0) ? "SendResponse" : "CreateTicket"), ($this->withcancel ? "Cancel" : "")); /* print '
'; diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index c11f94fa047..255cdb2fb67 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -637,7 +637,10 @@ class Translate ); if (strpos($key, 'Format') !== 0) { - $str = sprintf($str, $param1, $param2, $param3, $param4); // Replace %s and %d except for FormatXXX strings. + try { + $str = sprintf($str, $param1, $param2, $param3, $param4); // Replace %s and %d except for FormatXXX strings. + } catch (Exception $e) { + } } // Crypt string into HTML diff --git a/htdocs/core/class/vcard.class.php b/htdocs/core/class/vcard.class.php index d513262b871..dbe505a894b 100644 --- a/htdocs/core/class/vcard.class.php +++ b/htdocs/core/class/vcard.class.php @@ -195,14 +195,14 @@ class vCard // $type may be DOM | INTL | POSTAL | PARCEL | HOME | WORK or any combination of these: e.g. "WORK;PARCEL;POSTAL" $key = "ADR"; if ($type != "") { - $key .= ";$type"; + $key .= ";".$type; } $key .= ";CHARSET=".$this->encoding; $this->properties[$key] = ";".encode($extended).";".encode($street).";".encode($city).";".encode($region).";".encode($zip).";".encode($country); - if ($this->properties["LABEL;$type;CHARSET=".$this->encoding] == "") { + //if ($this->properties["LABEL;".$type.";CHARSET=".$this->encoding] == '') { //$this->setLabel($postoffice, $extended, $street, $city, $region, $zip, $country, $type); - } + //} } /** diff --git a/htdocs/core/get_menudiv.php b/htdocs/core/get_menudiv.php index 597031945f1..c4be69675bb 100644 --- a/htdocs/core/get_menudiv.php +++ b/htdocs/core/get_menudiv.php @@ -121,10 +121,19 @@ print ' display: none; } + ul li.lilevel2 { + padding-left: 42px; + } + a.alilevel0, span.spanlilevel0 { background-image: url(\''.DOL_URL_ROOT.'/theme/'.urlencode($conf->theme).'/img/next.png\') !important; - background-repeat: no-repeat !important; - background-position-x: 10px; + background-repeat: no-repeat !important;'; +if ($langs->trans("DIRECTION") == 'rtl') { + print 'background-position: right;'; +} else { + print 'background-position-x: 10px;'; +} + print ' background-position-y: 16px; padding: 1em 15px 1em 40px; display: block; @@ -152,6 +161,18 @@ print ' li.lilevel1 a { padding-bottom: 5px; } + li.lilevel1 > a, li.lilevel1 > i { + /* background-image: url(\''.DOL_URL_ROOT.'/theme/'.urlencode($conf->theme).'/img/puce.png\') !important; */ + background-repeat: no-repeat !important;'; +if ($langs->trans("DIRECTION") == 'rtl') { + print 'background-position: right;'; +} else { + print 'background-position-x: 10px;'; +} + print 'background-position-y: 1px;'; + print 'padding-left: 20px;'; + print ' + } li.lilevel1 a, li.lilevel1 { color: #000; cursor: pointer; diff --git a/htdocs/core/lib/ftp.lib.php b/htdocs/core/lib/ftp.lib.php new file mode 100644 index 00000000000..3d680de08a0 --- /dev/null +++ b/htdocs/core/lib/ftp.lib.php @@ -0,0 +1,278 @@ + + * Copyright (C) 2022 Anthony Berton + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see https://www.gnu.org/ + */ + +/** + * \file htdocs/core/lib/ftp.lib.php + * \brief Set of functions used for FTP + * \ingroup core + */ + + + + +/** + * Connect to FTP server + * + * @param string $ftp_server Server name + * @param string $ftp_port Server port + * @param string $ftp_user FTP user + * @param string $ftp_password FTP password + * @param string $section Directory + * @param integer $ftp_passive Use a passive mode + * @return int <0 if OK, >0 if KO + */ +function dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $section, $ftp_passive = 0) +{ + + global $langs, $conf; + + $ok = 1; + $error = 0; + $connect_id = null; + $newsectioniso = ''; + $mesg=""; + + if (!is_numeric($ftp_port)) { + $mesg = $langs->transnoentitiesnoconv("FailedToConnectToFTPServer", $ftp_server, $ftp_port); + $ok = 0; + } + + if ($ok) { + $connecttimeout = (empty($conf->global->FTP_CONNECT_TIMEOUT) ? 40 : $conf->global->FTP_CONNECT_TIMEOUT); + if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) { + dol_syslog('Try to connect with ssh2_connect'); + $tmp_conn_id = ssh2_connect($ftp_server, $ftp_port); + } elseif (!empty($conf->global->FTP_CONNECT_WITH_SSL)) { + dol_syslog('Try to connect with ftp_ssl_connect'); + $connect_id = ftp_ssl_connect($ftp_server, $ftp_port, $connecttimeout); + } else { + dol_syslog('Try to connect with ftp_connect'); + $connect_id = ftp_connect($ftp_server, $ftp_port, $connecttimeout); + } + if (!empty($connect_id) || !empty($tmp_conn_id)) { + if ($ftp_user) { + if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) { + dol_syslog('Try to authenticate with ssh2_auth_password'); + if (ssh2_auth_password($tmp_conn_id, $ftp_user, $ftp_password)) { + // Turn on passive mode transfers (must be after a successful login + //if ($ftp_passive) ftp_pasv($connect_id, true); + + // Change the dir + $newsectioniso = utf8_decode($section); + //ftp_chdir($connect_id, $newsectioniso); + $connect_id = ssh2_sftp($tmp_conn_id); + if (!$connect_id) { + dol_syslog('Failed to connect to SFTP after sssh authentication', LOG_DEBUG); + $mesg = $langs->transnoentitiesnoconv("FailedToConnectToSFTPAfterSSHAuthentication"); + $ok = 0; + $error++; + } + } else { + dol_syslog('Failed to connect to FTP with login '.$ftp_user, LOG_DEBUG); + $mesg = $langs->transnoentitiesnoconv("FailedToConnectToFTPServerWithCredentials"); + $ok = 0; + $error++; + } + } else { + if (ftp_login($connect_id, $ftp_user, $ftp_password)) { + // Turn on passive mode transfers (must be after a successful login + if ($ftp_passive) { + ftp_pasv($connect_id, true); + } + + // Change the dir + $newsectioniso = utf8_decode($section); + ftp_chdir($connect_id, $newsectioniso); + } else { + $mesg = $langs->transnoentitiesnoconv("FailedToConnectToFTPServerWithCredentials"); + $ok = 0; + $error++; + } + } + } + } else { + dol_syslog('FailedToConnectToFTPServer '.$ftp_server.' '.$ftp_port, LOG_ERR); + $mesg = $langs->transnoentitiesnoconv("FailedToConnectToFTPServer", $ftp_server, $ftp_port); + $ok = 0; + } + } + + $arrayresult = array('conn_id'=>$connect_id, 'ok'=>$ok, 'mesg'=>$mesg, 'curdir'=>$section, 'curdiriso'=>$newsectioniso); + return $arrayresult; +} + + +/** + * Tell if an entry is a FTP directory + * + * @param resource $connect_id Connection handler + * @param string $dir Directory + * @return int 1=directory, 0=not a directory + */ +function ftp_isdir($connect_id, $dir) +{ + + if (@ftp_chdir($connect_id, $dir)) { + ftp_cdup($connect_id); + return 1; + } else { + return 0; + } +} + +/** + * Tell if an entry is a FTP directory + * + * @param resource $connect_id Connection handler + * @return result + */ +function dol_ftp_close($connect_id) +{ + + global $conf; + + // Close FTP connection + if ($connect_id) { + if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) { + } elseif (!empty($conf->global->FTP_CONNECT_WITH_SSL)) { + return ftp_close($connect_id); + } else { + return ftp_close($connect_id); + } + } +} + +/** + * Delete a FTP file + * + * @param resource $connect_id Connection handler + * @param string $file File + * @param string $newsection $newsection + * @return result + */ +function dol_ftp_delete($connect_id, $file, $newsection) +{ + + global $conf; + + if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) { + $newsection = ssh2_sftp_realpath($connect_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169 + } + + // Remote file + $filename = $file; + $remotefile = $newsection.(preg_match('@[\\\/]$@', $newsection) ? '' : '/').$file; + $newremotefileiso = utf8_decode($remotefile); + + //print "x".$newremotefileiso; + dol_syslog("ftp/index.php ftp_delete ".$newremotefileiso); + if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) { + return ssh2_sftp_unlink($connect_id, $newremotefileiso); + } else { + return @ftp_delete($connect_id, $newremotefileiso); + } +} + +/** + * Download a FTP file + * + * @param resource $connect_id Connection handler + * @param string $file File + * @param string $newsection $newsection + * @return result + */ +function dol_ftp_get($connect_id, $file, $newsection) +{ + + global $conf; + + if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) { + $newsection = ssh2_sftp_realpath($connect_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169 + } + + // Remote file + $filename = $file; + $remotefile = $newsection.(preg_match('@[\\\/]$@', $newsection) ? '' : '/').$file; + $newremotefileiso = utf8_decode($remotefile); + + if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) { + return fopen('ssh2.sftp://'.intval($connect_id).$newremotefileiso, 'r'); + } else { + return ftp_get($connect_id, $localfile, $newremotefileiso, FTP_BINARY); + } +} + +/** + * Upload a FTP file + * + * @param resource $connect_id Connection handler + * @param string $file File name + * @param string $localfile The path to the local file + * @param string $newsection $newsection + * @return result + */ +function dol_ftp_put($connect_id, $file, $localfile, $newsection) +{ + + global $conf; + + if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) { + $newsection = ssh2_sftp_realpath($connect_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169 + } + + // Remote file + $filename = $file; + $remotefile = $newsection.(preg_match('@[\\\/]$@', $newsection) ? '' : '/').$file; + $newremotefileiso = utf8_decode($remotefile); + + if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) { + return ssh2_scp_send($connect_id, $localfile, $newremotefileiso, 0644); + } else { + return ftp_put($connect_id, $newremotefileiso, $localfile, FTP_BINARY); + } +} + +/** + * Remove FTP directory + * + * @param resource $connect_id Connection handler + * @param string $file File + * @param string $newsection $newsection + * @return result + */ +function dol_ftp_rmdir($connect_id, $file, $newsection) +{ + + global $conf; + + if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) { + $newsection = ssh2_sftp_realpath($connect_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169 + } + + // Remote file + $filename = $file; + $remotefile = $newsection.(preg_match('@[\\\/]$@', $newsection) ? '' : '/').$file; + $newremotefileiso = utf8_decode($remotefile); + + if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) { + return ssh2_sftp_rmdir($connect_id, $newremotefileiso); + } else { + return @ftp_rmdir($connect_id, $newremotefileiso); + } +} diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8e59e688e2c..90698c95f80 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -14,7 +14,7 @@ * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2018-2022 Frédéric France - * Copyright (C) 2019 Thibault Foucart + * Copyright (C) 2019-2022 Thibault Foucart * Copyright (C) 2020 Open-Dsi * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2022 Anthony Berton @@ -954,6 +954,11 @@ function sanitizeVal($out = '', $check = 'alphanohtml', $filter = null, $options // Restore entity ' into ' (restricthtml is for html content so we can use html entity) $out = preg_replace('/'/i', "'", $out); + + preg_match_all('/( getDolGlobalInt("MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT", 1000)) { + $out = ''; + } } while ($oldstringtoclean != $out); break; case 'custom': @@ -1718,7 +1723,7 @@ function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $di //print ''; $out .= ''."\n"; - $out .= ''.$buttonstring.''; + $out .= ''.$buttonstring.''; $out .= ''; $out .= ''; $out .= ''; @@ -7388,6 +7393,9 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = 'Lowest data for planned expiration of service'; $substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATETIME__'] = 'Lowest date and hour for planned expiration of service'; } + if (!empty($conf->propal->enabled) && (!is_object($object) || $object->element == 'propal')) { + $substitutionarray['__ONLINE_SIGN_URL__'] = 'ToOfferALinkForOnlineSignature'; + } $substitutionarray['__ONLINE_PAYMENT_URL__'] = 'UrlToPayOnlineIfApplicable'; $substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__'] = 'TextAndUrlToPayOnlineIfApplicable'; $substitutionarray['__SECUREKEYPAYMENT__'] = 'Security key (if key is not unique per record)'; @@ -9141,6 +9149,7 @@ function printCommonFooter($zone = 'private') print "\n"; if (!empty($conf->use_javascript_ajax)) { + print "\n\n"; print ''; + } +} diff --git a/htdocs/core/lib/takepos.lib.php b/htdocs/core/lib/takepos.lib.php index d983f0298ce..c2468c98169 100644 --- a/htdocs/core/lib/takepos.lib.php +++ b/htdocs/core/lib/takepos.lib.php @@ -56,7 +56,7 @@ function takepos_admin_prepare_head() $numterminals = max(1, $conf->global->TAKEPOS_NUM_TERMINALS); for ($i = 1; $i <= $numterminals; $i++) { $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/terminal.php?terminal='.$i; - $head[$h][1] = $langs->trans("Terminal")." ".$i; + $head[$h][1] = getDolGlobalString('TAKEPOS_TERMINAL_NAME_'.$i, $langs->trans("TerminalName", $i)); $head[$h][2] = 'terminal'.$i; $h++; } diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index e1544e763df..ef2f6bcf286 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -84,7 +84,7 @@ function ticket_prepare_head($object) $head[$h][2] = 'tabTicket'; $h++; - if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && empty($user->socid) && $conf->societe->enabled) { + if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && empty($user->socid) && isModEnabled("societe")) { $nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external')); $head[$h][0] = DOL_URL_ROOT.'/ticket/contact.php?track_id='.$object->track_id; $head[$h][1] = $langs->trans('ContactsAddresses'); diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index adc4f8d487c..71f399497c7 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010-2022 Laurent Destailleur * Copyright (C) 2010-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -72,6 +72,7 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout $num = count($newTabMenu); for ($i = 0; $i < $num; $i++) { + //var_dump($type_user.' '.$newTabMenu[$i]['url'].' '.$showmode.' '.$newTabMenu[$i]['perms']); $idsel = (empty($newTabMenu[$i]['mainmenu']) ? 'none' : $newTabMenu[$i]['mainmenu']); $shorturl = ''; @@ -80,9 +81,9 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout if ($showmode == 1) { $newTabMenu[$i]['url'] = make_substitutions($newTabMenu[$i]['url'], $substitarray); + // url = url from host, shorturl = relative path into dolibarr sources $url = $shorturl = $newTabMenu[$i]['url']; - - if (!preg_match("/^(http:\/\/|https:\/\/)/i", $newTabMenu[$i]['url'])) { + if (!preg_match("/^(http:\/\/|https:\/\/)/i", $newTabMenu[$i]['url'])) { // Do not change url content for external links $tmp = explode('?', $newTabMenu[$i]['url'], 2); $url = $shorturl = $tmp[0]; $param = (isset($tmp[1]) ? $tmp[1] : ''); @@ -235,11 +236,11 @@ function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $cla $classnametxt = str_replace('class="', 'class="tmenulabel ', $classname); if ($showmode == 1) { - print ''; - print '
'; + print '
'; + print '
'; print '
'; if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) { - print ''; + print ''; print ''; print $text; print ''; @@ -300,11 +301,13 @@ function print_end_menu_array_auguria() * @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x' * @param string $forceleftmenu 'all'=Force leftmenu to '' (= all). If value come being '', we change it to value in session and 'none' if not defined in session. * @param array $moredata An array with more data to output + * @param int $type_user 0=Menu for backoffice, 1=Menu for front office * @return int Nb of menu entries */ -function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$tabMenu, &$menu, $noout = 0, $forcemainmenu = '', $forceleftmenu = '', $moredata = null) +function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$tabMenu, &$menu, $noout = 0, $forcemainmenu = '', $forceleftmenu = '', $moredata = null, $type_user = 0) { - global $user, $conf, $langs, $dolibarr_main_db_name, $mysoc; + global $user, $conf, $langs, $hookmanager; + global $dolibarr_main_db_name, $mysoc; $newmenu = $menu; @@ -472,6 +475,29 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t return 0; } + // Allow the $menu_array of the menu to be manipulated by modules + $parameters = array( + 'mainmenu' => $mainmenu, + ); + $hook_items = $menu_array; + $reshook = $hookmanager->executeHooks('menuLeftMenuItems', $parameters, $hook_items); // Note that $action and $object may have been modified by some hooks + + if (is_numeric($reshook)) { + if ($reshook == 0 && !empty($hookmanager->results)) { + $menu_array[] = $hookmanager->results; // add + } elseif ($reshook == 1) { + $menu_array = $hookmanager->results; // replace + } + + // @todo Sort menu items by 'position' value + // $position = array(); + // foreach ($menu_array as $key => $row) { + // $position[$key] = $row['position']; + // } + // $array1_sort_order = SORT_ASC; + // array_multisort($position, $array1_sort_order, $menu_array); + } + // Show menu $invert = empty($conf->global->MAIN_MENU_INVERT) ? "" : "invert"; if (empty($noout)) { @@ -542,7 +568,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t if ($menu_array[$i]['enabled']) { // Enabled so visible print ''."\n"; $lastlevel0 = 'enabled'; } elseif ($showmenu) { // Not enabled but visible (so greyed) - print ''."\n"; + print ''."\n"; $lastlevel0 = 'greyed'; } else { $lastlevel0 = 'hidden'; @@ -572,10 +602,12 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t $cssmenu = ' menu_contenu'.dol_string_nospecial(preg_replace('/\.php.*$/', '', $menu_array[$i]['url'])); } - if ($menu_array[$i]['enabled'] && $lastlevel0 == 'enabled') { // Enabled so visible, except if parent was not enabled. - print '
'; $texte .= ''; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= '
'; if ($permission) { - print ""; + print "id."'>"; print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft'); print ""; @@ -788,7 +792,7 @@ if ($type == Categorie::TYPE_MEMBER) { } } -// Categorie contact +// List of contacts if ($type == Categorie::TYPE_CONTACT) { $permission = $user->rights->societe->creer; @@ -808,7 +812,7 @@ if ($type == Categorie::TYPE_CONTACT) { print ''; print ''; print ''; print ''; @@ -826,7 +830,7 @@ if ($type == Categorie::TYPE_CONTACT) { $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($contacts); $nbtotalofrecords = ''; - $newcardbutton = ''; + $newcardbutton = dolGetButtonTitle($langs->trans("AddContact"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?action=create&contcats[]='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $user->rights->societe->creer); $objsoc = new Societe($db); print_barre_liste($langs->trans("Contact"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'contact', 0, $newcardbutton, '', $limit); @@ -853,7 +857,7 @@ if ($type == Categorie::TYPE_CONTACT) { // Link to delete from category print ''; } @@ -1545,64 +1721,64 @@ if ($id > 0) { print ''; - } + // // Recurring event + // $userepeatevent = ($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0); + // if ($userepeatevent) { + // // Repeat + // //print ''; + // } print ''; // Date start - end diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 68e358f18eb..9a7114a6113 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1558,13 +1558,13 @@ class ActionComm extends CommonObject } $canread = 0; - if ($user->rights->agenda->myactions->read && $this->authorid == $user->id) { + if (!empty($user->rights->agenda->myactions->read) && $this->authorid == $user->id) { $canread = 1; // Can read my event } - if ($user->rights->agenda->myactions->read && array_key_exists($user->id, $this->userassigned)) { + if (!empty($user->rights->agenda->myactions->read) && array_key_exists($user->id, $this->userassigned)) { $canread = 1; // Can read my event i am assigned } - if ($user->rights->agenda->allactions->read) { + if (!empty($user->rights->agenda->allactions->read)) { $canread = 1; // Can read all event of other } if (!$canread) { diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index d2b089491a7..db62dfe6a9f 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -216,6 +216,9 @@ class CActionComm if ($obj->module == 'shipping' && !empty($conf->expedition->enabled) && !empty($user->rights->expedition->lire)) { $qualified = 1; } + if (preg_split("/@/", $obj->module, -1)[1] == 'eventorganization' && !empty($conf->eventorganization->enabled)) { + $qualified = 1; + } // For the generic case with type = 'module...' and module = 'myobject@mymodule' $regs = array(); if (preg_match('/^module/', $obj->type)) { diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 9fcb8375193..2afad30c454 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -111,7 +111,7 @@ $month = GETPOST("month", "int") ?GETPOST("month", "int") : date("m"); $week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W"); $day = GETPOST("day", "int") ?GETPOST("day", "int") : date("d"); $pid = GETPOST("search_projectid", "int", 3) ? GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3); -$status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo' +$status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo', 'na' or -1 $type = GETPOSTISSET("search_type") ? GETPOST("search_type", 'aZ09') : GETPOST("type", 'aZ09'); $maxprint = GETPOSTISSET("maxprint") ? GETPOST("maxprint", 'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW; $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') @@ -759,12 +759,14 @@ if ($type) { if ($status == '0') { $sql .= " AND a.percent = 0"; } -if ($status == '-1') { +if ($status == '-1' || $status == 'na') { + // Not applicable $sql .= " AND a.percent = -1"; -} // Not applicable +} if ($status == '50') { + // Running already started $sql .= " AND (a.percent > 0 AND a.percent < 100)"; -} // Running already started +} if ($status == 'done' || $status == '100') { $sql .= " AND (a.percent = 100)"; } diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 18f62872630..87def7240f5 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -101,7 +101,7 @@ $month = GETPOST("month", "int") ?GETPOST("month", "int") : date("m"); $week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W"); $day = GETPOST("day", "int") ?GETPOST("day", "int") : date("d"); $pid = GETPOSTISSET("search_projectid") ? GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3); -$status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo' +$status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo', 'na' or -1 $type = GETPOSTISSET("search_type") ? GETPOST("search_type", 'alpha') : GETPOST("type", 'alpha'); $maxprint = ((GETPOST("maxprint", 'int') != '') ?GETPOST("maxprint", 'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') @@ -627,12 +627,14 @@ if ($type) { if ($status == '0') { $sql .= " AND a.percent = 0"; } -if ($status == '-1') { +if ($status == '-1' || $status == 'na') { + // Not applicable $sql .= " AND a.percent = -1"; -} // Not applicable +} if ($status == '50') { + // Running already started $sql .= " AND (a.percent > 0 AND a.percent < 100)"; -} // Running already started +} if ($status == 'done' || $status == '100') { $sql .= " AND (a.percent = 100)"; } diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index ecde836c428..757b6373f3f 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -277,7 +277,7 @@ if ($resql) { print ''; // Title - print ''; + print ''; // Date creation print ''; + print ''; } // Alias if (!empty($arrayfields['s.name_alias']['checked'])) { @@ -2083,7 +2084,7 @@ if ($resql) { // Amount HT if (!empty($arrayfields['f.total_ht']['checked'])) { - print '\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index e7cb0b1d4b5..55ee99f4cb6 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -102,19 +102,24 @@ print load_fiche_titre($langs->trans("AccountancyTreasuryArea"), '', 'bill'); print '
'; -print getNumberInvoicesPieChart('customers'); -print '
'; +if (isModEnabled('facture')) { + print getNumberInvoicesPieChart('customers'); + print '
'; +} -if (!empty($conf->fournisseur->enabled)) { +if (isModEnabled('fournisseur') || isModEnabled('supplier_invoice')) { print getNumberInvoicesPieChart('fourn'); print '
'; } -print getCustomerInvoiceDraftTable($max, $socid); - -if (!empty($conf->fournisseur->enabled)) { +if (isModEnabled('facture')) { + print getCustomerInvoiceDraftTable($max, $socid); print '
'; +} + +if (isModEnabled('fournisseur') || isModEnabled('supplier_invoice')) { print getDraftSupplierTable($max, $socid); + print '
'; } print '
'; @@ -273,7 +278,7 @@ if (isModEnabled('facture') && !empty($user->rights->facture->lire)) { // Last modified supplier invoices -if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) { +if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) { $langs->load("boxes"); $facstatic = new FactureFournisseur($db); @@ -400,7 +405,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU // Latest donations -if (!empty($conf->don->enabled) && !empty($user->rights->don->lire)) { +if (isModEnabled('don') && !empty($user->rights->don->lire)) { include_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; $langs->load("boxes"); @@ -490,7 +495,7 @@ if (!empty($conf->don->enabled) && !empty($user->rights->don->lire)) { /** * Social contributions to pay */ -if (!empty($conf->tax->enabled) && !empty($user->rights->tax->charges->lire)) { +if (isModEnabled('tax') && !empty($user->rights->tax->charges->lire)) { if (!$socid) { $chargestatic = new ChargeSociales($db); @@ -582,7 +587,7 @@ if (!empty($conf->tax->enabled) && !empty($user->rights->tax->charges->lire)) { /* * Customers orders to be billed */ -if (isModEnabled('facture') && !empty($conf->commande->enabled) && $user->rights->commande->lire && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) { +if (isModEnabled('facture') && isModEnabled('commande') && $user->rights->commande->lire && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) { $commandestatic = new Commande($db); $langs->load("orders"); diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 52cde1877b8..0ef31fe36a4 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -567,19 +567,22 @@ $form = new Form($db); $formadmin = new FormAdmin($db); $formcompany = new FormCompany($db); +$objsoc = new Societe($db); +if ($socid > 0) { + $objsoc->fetch($socid); +} + $title = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/contactnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->lastname) { $title = $object->lastname; } $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +$title = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")); + +llxHeader('', $title, $help_url); $countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; -$objsoc = new Societe($db); -if ($socid > 0) { - $objsoc->fetch($socid); -} - if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // ----------------------------------------- // When used with CANVAS @@ -621,8 +624,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Show tabs $head = contact_prepare_head($object); - - llxHeader('', $title, $help_url); } if ($user->rights->societe->contact->creer) { @@ -643,9 +644,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } $linkback = ''; - $title = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")); - - llxHeader('', $title, $help_url); print load_fiche_titre($title, $linkback, 'address'); @@ -1534,7 +1532,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } else { //print ''.$langs->trans("NoDolibarrAccess").''; if (!$object->user_id && $user->rights->user->user->creer) { - print ''.img_picto($langs->trans("CreateDolibarrLogin"), 'add').' '.$langs->trans("CreateDolibarrLogin").''; + print ''.img_picto($langs->trans("CreateDolibarrLogin"), 'add', 'class="pictofixedwidth"').$langs->trans("CreateDolibarrLogin").''; } } print '
'; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 9fa3602ee4b..799b53cdad0 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -571,7 +571,6 @@ class Contact extends CommonObject $this->fax = trim($this->fax); $this->zip = (empty($this->zip) ? '' : trim($this->zip)); $this->town = (empty($this->town) ? '' : trim($this->town)); - $this->setUpperOrLowerCase(); $this->country_id = ($this->country_id > 0 ? $this->country_id : $this->country_id); if (empty($this->statut)) { $this->statut = 0; @@ -579,6 +578,7 @@ class Contact extends CommonObject if (empty($this->civility_code) && !is_numeric($this->civility_id)) { $this->civility_code = $this->civility_id; // For backward compatibility } + $this->setUpperOrLowerCase(); $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET"; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 1e497b0ab2e..a0091061adb 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -207,16 +207,16 @@ foreach ($object->fields as $key => $val) { } // Add none object fields to fields for list -$arrayfields['country.code_iso'] = array('label'=>"Country", 'position'=>22, 'checked'=>0); +$arrayfields['country.code_iso'] = array('label'=>"Country", 'position'=>66, 'checked'=>0); if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { - $arrayfields['s.nom'] = array('label'=>"ThirdParty", 'position'=>25, 'checked'=>1); + $arrayfields['s.nom'] = array('label'=>"ThirdParty", 'position'=>113, 'checked'=> 1); } $arrayfields['unsubscribed'] = array( 'label'=>'No_Email', 'checked'=>0, 'enabled'=>(!empty($conf->mailing->enabled)), - 'position'=>41); + 'position'=>111); if (!empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { @@ -373,6 +373,7 @@ $sql = "SELECT s.rowid as socid, s.nom as name,"; $sql .= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.address, p.zip, p.town, p.poste, p.email,"; $sql .= " p.socialnetworks, p.photo,"; $sql .= " p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.datec as date_creation, p.tms as date_update,"; +$sql .= " p.import_key,"; $sql .= " st.libelle as stcomm, st.picto as stcomm_picto, p.fk_stcommcontact as stcomm_id, p.fk_prospectcontactlevel,"; $sql .= " co.label as country, co.code as country_code"; // Add fields from extrafields @@ -1074,6 +1075,7 @@ while ($i < min($num, $limit)) { $contactstatic->country = $obj->country; $contactstatic->country_code = $obj->country_code; $contactstatic->photo = $obj->photo; + $contactstatic->import_key = $obj->import_key; $contactstatic->fk_prospectlevel = $obj->fk_prospectcontactlevel; @@ -1309,9 +1311,10 @@ while ($i < min($num, $limit)) { $totalarray['nbfield']++; } } + // Import key if (!empty($arrayfields['p.import_key']['checked'])) { print '\n"; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/core/actions_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php index 69d46dae51c..385b36bdbce 100644 --- a/htdocs/core/actions_builddoc.inc.php +++ b/htdocs/core/actions_builddoc.inc.php @@ -34,7 +34,7 @@ if (!empty($permissioncreate) && empty($permissiontoadd)) { } // Build doc -if ($action == 'builddoc' && $permissiontoadd) { +if ($action == 'builddoc' && ($permissiontoadd || !empty($usercangeneretedoc))) { if (is_numeric(GETPOST('model', 'alpha'))) { $error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Model")); } else { diff --git a/htdocs/core/ajax/security.php b/htdocs/core/ajax/security.php index 0056120c6bd..1f2143d4b72 100644 --- a/htdocs/core/ajax/security.php +++ b/htdocs/core/ajax/security.php @@ -42,6 +42,9 @@ if (!defined('NOREQUIRETRAN')) { require '../../main.inc.php'; +$action = GETPOST('action'); + + /* * View */ @@ -52,10 +55,10 @@ top_httphead(); //print ''."\n"; // Registering the location of boxes -if (isset($_GET['action']) && !empty($_GET['action'])) { - if ($_GET['action'] == 'getrandompassword' && ($user->admin || $user->rights->api->apikey->generate)) { +if ($action) { + if ($action == 'getrandompassword' && ($user->admin || $user->rights->api->apikey->generate)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; - $generic = $_GET['generic'] ? true : false; + $generic = GETPOST('generic') ? true : false; echo getRandomPassword($generic); } } diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index c1199477f58..54e3e1e4470 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -64,63 +64,62 @@ $arrayresult = array(); // Define $searchform -if (!empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire) { +if (isModEnabled('adherent') && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->hasRight('adherent', 'lire')) { $arrayresult['searchintomember'] = array('position'=>8, 'shortcut'=>'M', 'img'=>'object_member', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('', 'object_member', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } -if (((!empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire) { +if (((isModEnabled('societe') && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_order') || isModEnabled('supplier_invoice'))) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->hasRight('societe', 'lire')) { $arrayresult['searchintothirdparty'] = array('position'=>10, 'shortcut'=>'T', 'img'=>'object_company', 'label'=>$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'text'=>img_picto('', 'object_company', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } -if (!empty($conf->societe->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTACT_DISABLED) && $user->rights->societe->lire) { +if (isModEnabled('societe') && empty($conf->global->MAIN_SEARCHFORM_CONTACT_DISABLED) && $user->hasRight('societe', 'lire')) { $arrayresult['searchintocontact'] = array('position'=>15, 'shortcut'=>'A', 'img'=>'object_contact', 'label'=>$langs->trans("SearchIntoContacts", $search_boxvalue), 'text'=>img_picto('', 'object_contact', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } -if (((!empty($conf->product->enabled) && $user->rights->produit->lire) || (!empty($conf->service->enabled) && $user->rights->service->lire)) -&& empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED)) { +if (((isModEnabled('product') && $user->hasRight('produit', 'lire')) || (isModEnabled('service') && $user->hasRight('service', 'lire'))) && empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED)) { $arrayresult['searchintoproduct'] = array('position'=>30, 'shortcut'=>'P', 'img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'text'=>img_picto('', 'object_product', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); // search on lot/serial numbers - if ( ! empty($conf->productbatch->enabled) ) { + if (isModEnabled('productbatch')) { $arrayresult['searchintobatch'] = array('position'=>32, 'shortcut'=>'B', 'img'=>'object_lot', 'label'=>$langs->trans("SearchIntoBatch", $search_boxvalue), 'text'=>img_picto('', 'object_lot', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoBatch", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/stock/productlot_list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } } -if (!empty($conf->mrp->enabled) && $user->rights->mrp->read && empty($conf->global->MAIN_SEARCHFORM_MRP_DISABLED)) { +if (isModEnabled('mrp') && $user->hasRight('mrp', 'read') && empty($conf->global->MAIN_SEARCHFORM_MRP_DISABLED)) { $arrayresult['searchintomo'] = array('position'=>35, 'shortcut'=>'', 'img'=>'object_mrp', 'label'=>$langs->trans("SearchIntoMO", $search_boxvalue), 'text'=>img_picto('', 'object_mrp', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMO", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/mrp/mo_list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } -if (!empty($conf->project->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire) { +if (isModEnabled('project') && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->hasRight('projet', 'lire')) { $arrayresult['searchintoprojects'] = array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_project', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('', 'object_project', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } -if (!empty($conf->project->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire) { +if (isModEnabled('project') && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->hasRight('projet', 'lire')) { $arrayresult['searchintotasks'] = array('position'=>45, 'img'=>'object_projecttask', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('', 'object_projecttask', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } -if (!empty($conf->propal->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_PROPAL_DISABLED) && $user->rights->propal->lire) { +if (isModEnabled('propal') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_PROPAL_DISABLED) && $user->hasRight('propal', 'lire')) { $arrayresult['searchintopropal'] = array('position'=>60, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'text'=>img_picto('', 'object_propal', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/comm/propal/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } -if (!empty($conf->commande->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_ORDER_DISABLED) && $user->rights->commande->lire) { +if (isModEnabled('commande') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_ORDER_DISABLED) && $user->hasRight('commande', 'lire')) { $arrayresult['searchintoorder'] = array('position'=>70, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'text'=>img_picto('', 'object_order', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/commande/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } -if (!empty($conf->expedition->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED) && $user->rights->expedition->lire) { +if (isModEnabled('expedition') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED) && $user->hasRight('expedition', 'lire')) { $arrayresult['searchintoshipment'] = array('position'=>80, 'img'=>'object_shipment', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('', 'object_shipment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } -if (isModEnabled('facture') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) { +if (isModEnabled('facture') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->hasRight('facture', 'lire')) { $arrayresult['searchintoinvoice'] = array('position'=>90, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_bill', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } -if (!empty($conf->supplier_proposal->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED) && $user->rights->supplier_proposal->lire) { +if (isModEnabled('supplier_proposal') && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED) && $user->hasRight('supplier_proposal', 'lire')) { $arrayresult['searchintosupplierpropal'] = array('position'=>100, 'img'=>'object_supplier_proposal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_proposal', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } -if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED)) { +if (((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight('fournisseur', 'commande', 'lire')) || (isModEnabled('supplier_order') && $user->hasRight('supplier_order', 'lire'))) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED)) { $arrayresult['searchintosupplierorder'] = array('position'=>110, 'img'=>'object_supplier_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_order', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } -if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED)) { +if (((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight('fournisseur', 'facture', 'lire')) || (isModEnabled('supplier_invoice') && $user->hasRight('supplier_invoice', 'lire'))) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED)) { $arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_supplier_invoice', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_invoice', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } // Customer payments -if (isModEnabled('facture') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) { +if (isModEnabled('facture') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->hasRight('facture', 'lire')) { $arrayresult['searchintocustomerpayments'] = array( 'position'=>170, 'img'=>'object_payment', @@ -130,7 +129,7 @@ if (isModEnabled('facture') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INV } // Vendor payments -if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED)) { +if (((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight('fournisseur', 'facture', 'lire')) || (isModEnabled('supplier_invoice') && $user->hasRight('supplier_invoice', 'lire'))) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED)) { $arrayresult['searchintovendorpayments'] = array( 'position'=>175, 'img'=>'object_payment', @@ -140,7 +139,7 @@ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_S } // Miscellaneous payments -if (!empty($conf->banque->enabled) && empty($conf->global->MAIN_SEARCHFORM_MISC_PAYMENTS_DISABLED) && $user->rights->banque->lire) { +if (isModEnabled('banque') && empty($conf->global->MAIN_SEARCHFORM_MISC_PAYMENTS_DISABLED) && $user->hasRight('banque', 'lire')) { $arrayresult['searchintomiscpayments'] = array( 'position'=>180, 'img'=>'object_payment', @@ -149,24 +148,24 @@ if (!empty($conf->banque->enabled) && empty($conf->global->MAIN_SEARCHFORM_MISC_ 'url'=>DOL_URL_ROOT.'/compta/bank/various_payment/list.php?leftmenu=tax_various'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : '')); } -if (!empty($conf->contrat->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTRACT_DISABLED) && $user->rights->contrat->lire) { +if (isModEnabled('contrat') && empty($conf->global->MAIN_SEARCHFORM_CONTRACT_DISABLED) && $user->hasRight('contrat', 'lire')) { $arrayresult['searchintocontract'] = array('position'=>130, 'img'=>'object_contract', 'label'=>$langs->trans("SearchIntoContracts", $search_boxvalue), 'text'=>img_picto('', 'object_contract', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } -if (!empty($conf->ficheinter->enabled) && empty($conf->global->MAIN_SEARCHFORM_FICHINTER_DISABLED) && $user->rights->ficheinter->lire) { +if (isModEnabled('ficheinter') && empty($conf->global->MAIN_SEARCHFORM_FICHINTER_DISABLED) && $user->hasRight('ficheinter', 'lire')) { $arrayresult['searchintointervention'] = array('position'=>140, 'img'=>'object_intervention', 'label'=>$langs->trans("SearchIntoInterventions", $search_boxvalue), 'text'=>img_picto('', 'object_intervention', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } -if (!empty($conf->ticket->enabled) && empty($conf->global->MAIN_SEARCHFORM_TICKET_DISABLED) && $user->rights->ticket->read) { +if (isModEnabled('ticket') && empty($conf->global->MAIN_SEARCHFORM_TICKET_DISABLED) && $user->hasRight('ticket', 'read')) { $arrayresult['searchintotickets'] = array('position'=>145, 'img'=>'object_ticket', 'label'=>$langs->trans("SearchIntoTickets", $search_boxvalue), 'text'=>img_picto('', 'object_ticket', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoTickets", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/ticket/list.php?mainmenu=ticket'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : '')); } // HR -if (!empty($conf->user->enabled) && empty($conf->global->MAIN_SEARCHFORM_USER_DISABLED) && $user->rights->user->user->lire) { +if (isModEnabled('user') && empty($conf->global->MAIN_SEARCHFORM_USER_DISABLED) && $user->hasRight('user', 'user', 'lire')) { $arrayresult['searchintouser'] = array('position'=>200, 'shortcut'=>'U', 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoUsers", $search_boxvalue), 'text'=>img_picto('', 'object_user', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } -if (!empty($conf->expensereport->enabled) && empty($conf->global->MAIN_SEARCHFORM_EXPENSEREPORT_DISABLED) && $user->rights->expensereport->lire) { +if (isModEnabled('expensereport') && empty($conf->global->MAIN_SEARCHFORM_EXPENSEREPORT_DISABLED) && $user->hasRight('expensereport', 'lire')) { $arrayresult['searchintoexpensereport'] = array('position'=>210, 'img'=>'object_trip', 'label'=>$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'text'=>img_picto('', 'object_trip', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : '')); } -if (!empty($conf->holiday->enabled) && empty($conf->global->MAIN_SEARCHFORM_HOLIDAY_DISABLED) && $user->rights->holiday->read) { +if (isModEnabled('holiday') && empty($conf->global->MAIN_SEARCHFORM_HOLIDAY_DISABLED) && $user->hasRight('holiday', 'read')) { $arrayresult['searchintoleaves'] = array('position'=>220, 'img'=>'object_holiday', 'label'=>$langs->trans("SearchIntoLeaves", $search_boxvalue), 'text'=>img_picto('', 'object_holiday', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : '')); } diff --git a/htdocs/core/boxes/box_accountancy_last_manual_entries.php b/htdocs/core/boxes/box_accountancy_last_manual_entries.php index 96abd8699f3..a15728a04f0 100644 --- a/htdocs/core/boxes/box_accountancy_last_manual_entries.php +++ b/htdocs/core/boxes/box_accountancy_last_manual_entries.php @@ -60,7 +60,7 @@ class box_accountancy_last_manual_entries extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->accounting->mouvements->lire); + $this->hidden = empty($user->rights->accounting->mouvements->lire); } /** diff --git a/htdocs/core/boxes/box_accountancy_suspense_account.php b/htdocs/core/boxes/box_accountancy_suspense_account.php index f40c6e8a41b..3ea5b191799 100644 --- a/htdocs/core/boxes/box_accountancy_suspense_account.php +++ b/htdocs/core/boxes/box_accountancy_suspense_account.php @@ -60,7 +60,7 @@ class box_accountancy_suspense_account extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->accounting->mouvements->lire); + $this->hidden = empty($user->rights->accounting->mouvements->lire); } /** diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 551b892f0f7..fb0f93086d2 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -62,7 +62,7 @@ class box_actions extends ModeleBoxes $this->enabled = $conf->agenda->enabled; - $this->hidden = !($user->rights->agenda->myactions->read); + $this->hidden = !($user->hasRight('agenda', 'myactions', 'read')); } /** diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index ea43eff12fc..49690dc893e 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -63,8 +63,8 @@ class box_activity extends ModeleBoxes $this->enabled = ($conf->global->MAIN_FEATURES_LEVEL); // Not enabled by default due to bugs (see previous comments) $this->hidden = !((isModEnabled('facture') && $user->rights->facture->lire) - || (!empty($conf->commande->enabled) && $user->rights->commande->lire) - || (!empty($conf->propal->enabled) && $user->rights->propale->lire) + || (isModEnabled('commande') && $user->rights->commande->lire) + || (isModEnabled('propal') && $user->rights->propale->lire) ); } diff --git a/htdocs/core/boxes/box_birthdays.php b/htdocs/core/boxes/box_birthdays.php index 9462c810393..6aec6f4064a 100644 --- a/htdocs/core/boxes/box_birthdays.php +++ b/htdocs/core/boxes/box_birthdays.php @@ -85,13 +85,19 @@ class box_birthdays extends ModeleBoxes if ($user->rights->user->user->lire) { $tmparray = dol_getdate(dol_now(), true); - $sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth, u.email, u.statut as status"; + $sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth as datea, 'birth' as typea, u.email, u.statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE u.entity IN (".getEntity('user').")"; $sql .= " AND u.statut = 1"; $sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0); - $sql .= " ORDER BY DAY(u.birth) ASC"; - $sql .= $this->db->plimit($max, 0); + $sql .= ' UNION '; + $sql .= "SELECT u.rowid, u.firstname, u.lastname, u.dateemployment as datea, 'employment' as typea, u.email, u.statut as status"; + $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; + $sql .= " WHERE u.entity IN (".getEntity('user').")"; + $sql .= " AND u.statut = 1"; + $sql .= dolSqlDateFilter('u.dateemployment', 0, $tmparray['mon'], 0); + + $sql .= " ORDER BY DAY(datea) ASC"; dol_syslog(get_class($this)."::loadBox", LOG_DEBUG); $result = $this->db->query($sql); @@ -108,9 +114,13 @@ class box_birthdays extends ModeleBoxes $userstatic->email = $objp->email; $userstatic->statut = $objp->status; - $dateb = $this->db->jdate($objp->birth); + $dateb = $this->db->jdate($objp->datea); $age = date('Y', dol_now()) - date('Y', $dateb); + $picb = ''; + $pice = ''; + $typea = ($objp->typea == 'birth') ? $picb : $pice; + $this->info_box_contents[$line][] = array( 'td' => '', 'text' => $userstatic->getNomUrl(1), @@ -119,7 +129,18 @@ class box_birthdays extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="center nowraponall"', - 'text' => dol_print_date($dateb, "day", 'tzserver').' - '.$age.' '.$langs->trans('DurationYears') + 'text' => dol_print_date($dateb, "day", 'tzserver') + ); + + $this->info_box_contents[$line][] = array( + 'td' => 'class="right nowraponall"', + 'text' => $age.' '.$langs->trans('DurationYears') + ); + + $this->info_box_contents[$line][] = array( + 'td' => 'class="center nowraponall"', + 'text' => $typea, + 'asis' => 1 ); /*$this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_boms.php b/htdocs/core/boxes/box_boms.php index a9a4f8746da..2ace554eb55 100644 --- a/htdocs/core/boxes/box_boms.php +++ b/htdocs/core/boxes/box_boms.php @@ -60,7 +60,7 @@ class box_boms extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->bom->read); + $this->hidden = empty($user->rights->bom->read); } /** diff --git a/htdocs/core/boxes/box_bookmarks.php b/htdocs/core/boxes/box_bookmarks.php index 1a3a1183032..3e8abd587c0 100644 --- a/htdocs/core/boxes/box_bookmarks.php +++ b/htdocs/core/boxes/box_bookmarks.php @@ -56,7 +56,7 @@ class box_bookmarks extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->bookmark->lire); + $this->hidden = empty($user->rights->bookmark->lire); } /** diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index b5656c36292..f4aec2075d7 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -60,7 +60,7 @@ class box_commandes extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->commande->lire); + $this->hidden = empty($user->rights->commande->lire); } /** diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index 5570051a065..606f8409161 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -68,7 +68,7 @@ class box_comptes extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !($user->rights->banque->lire); + $this->hidden = empty($user->rights->banque->lire); } /** diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index ea35a080d0e..f257d7db18d 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -63,7 +63,7 @@ class box_contacts extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->societe->lire && $user->rights->societe->contact->lire); + $this->hidden = !($user->hasRight('societe', 'lire') && $user->hasRight('societe', 'contact', 'lire')); } /** diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index dddafffdc02..99ea5541c98 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -59,7 +59,7 @@ class box_contracts extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->contrat->lire); + $this->hidden = !($user->hasRight('contrat', 'lire')); } /** diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php index 4b85ce9d396..83615c17fd3 100644 --- a/htdocs/core/boxes/box_dolibarr_state_board.php +++ b/htdocs/core/boxes/box_dolibarr_state_board.php @@ -112,32 +112,32 @@ class box_dolibarr_state_board extends ModeleBoxes 'dolresource' ); $conditions = array( - 'users' => $user->rights->user->user->lire, - 'members' => !empty($conf->adherent->enabled) && $user->rights->adherent->lire, - 'customers' => !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS), - 'prospects' => !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS), + 'users' => $user->hasRight('user', 'user', 'lire'), + 'members' => isModEnabled('adherent') && $user->rights->adherent->lire, + 'customers' => isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS), + 'prospects' => isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS), 'suppliers' => ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire) ) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS), - 'contacts' => !empty($conf->societe->enabled) && $user->rights->societe->contact->lire, - 'products' => !empty($conf->product->enabled) && $user->rights->produit->lire, - 'services' => !empty($conf->service->enabled) && $user->rights->service->lire, - 'proposals' => !empty($conf->propal->enabled) && $user->rights->propale->lire, - 'orders' => !empty($conf->commande->enabled) && $user->rights->commande->lire, - 'invoices' => isModEnabled('facture') && $user->rights->facture->lire, - 'donations' => !empty($conf->don->enabled) && $user->rights->don->lire, - 'contracts' => !empty($conf->contrat->enabled) && $user->rights->contrat->lire, - 'interventions' => !empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire, - 'supplier_orders' => !empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS), - 'supplier_invoices' => !empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS), - 'supplier_proposals' => !empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS), - 'projects' => !empty($conf->project->enabled) && $user->rights->projet->lire, - 'expensereports' => !empty($conf->expensereport->enabled) && $user->rights->expensereport->lire, - 'holidays' => !empty($conf->holiday->enabled) && $user->rights->holiday->read, - 'ticket' => !empty($conf->ticket->enabled) && $user->rights->ticket->read, - 'dolresource' => !empty($conf->resource->enabled) && $user->rights->resource->read + 'contacts' => isModEnabled('societe') && $user->hasRight('societe', 'contact', 'lire'), + 'products' => isModEnabled('product') && $user->hasRight('produit', 'lire'), + 'services' => isModEnabled('service') && $user->hasRight('service', 'lire'), + 'proposals' => isModEnabled('propal') && $user->hasRight('propale', 'lire'), + 'orders' => isModEnabled('commande') && $user->hasRight('commande', 'lire'), + 'invoices' => isModEnabled('facture') && $user->hasRight('facture', 'lire'), + 'donations' => isModEnabled('don') && $user->hasRight('don', 'lire'), + 'contracts' => isModEnabled('contrat') && $user->hasRight('contrat', 'lire'), + 'interventions' => isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'lire'), + 'supplier_orders' => isModEnabled('supplier_order') && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS), + 'supplier_invoices' => isModEnabled('supplier_invoice') && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS), + 'supplier_proposals' => isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS), + 'projects' => isModEnabled('project') && $user->hasRight('projet', 'lire'), + 'expensereports' => isModEnabled('expensereport') && $user->hasRight('expensereport', 'lire'), + 'holidays' => isModEnabled('holiday') && $user->hasRight('holiday', 'read'), + 'ticket' => isModEnabled('ticket') && $user->hasRight('ticket', 'read'), + 'dolresource' => isModEnabled('resource') && $user->hasRight('resource', 'read') ); $classes = array( 'users' => 'User', diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index 43087949e47..e34e89c97eb 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -58,7 +58,7 @@ class box_factures extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->facture->lire); + $this->hidden = empty($user->rights->facture->lire); } /** diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index 5fc3bdafa38..06124d4ab35 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -59,7 +59,7 @@ class box_factures_fourn extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->fournisseur->facture->lire); + $this->hidden = !($user->hasRight('fournisseur', 'facture', 'lire')); } /** diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index d8c9321411d..ad6c6c97c27 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -58,7 +58,7 @@ class box_factures_fourn_imp extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->fournisseur->facture->lire); + $this->hidden = !($user->hasRight('fournisseur', 'facture', 'lire')); } /** diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index 6d6893f8ae2..a6103c26257 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -61,7 +61,7 @@ class box_factures_imp extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->facture->lire); + $this->hidden = empty($user->rights->facture->lire); } /** diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index b0f0e691471..f69ccb0ad94 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -59,7 +59,7 @@ class box_ficheinter extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->ficheinter->lire); + $this->hidden = !($user->hasRight('ficheinter', 'lire')); } /** diff --git a/htdocs/core/boxes/box_goodcustomers.php b/htdocs/core/boxes/box_goodcustomers.php index ab425ceac87..3341e08107d 100644 --- a/htdocs/core/boxes/box_goodcustomers.php +++ b/htdocs/core/boxes/box_goodcustomers.php @@ -69,7 +69,7 @@ class box_goodcustomers extends ModeleBoxes $this->enabled = 0; // not enabled by default. Very slow on large database } - $this->hidden = !($user->rights->societe->lire); + $this->hidden = empty($user->rights->societe->lire); } /** diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index 8179e134bcf..03b0e1d087b 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -56,7 +56,7 @@ class box_graph_invoices_permonth extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->facture->lire); + $this->hidden = empty($user->rights->facture->lire); } /** diff --git a/htdocs/core/boxes/box_graph_invoices_peryear.php b/htdocs/core/boxes/box_graph_invoices_peryear.php index 9126cfcfb37..5a9b84829f2 100644 --- a/htdocs/core/boxes/box_graph_invoices_peryear.php +++ b/htdocs/core/boxes/box_graph_invoices_peryear.php @@ -54,7 +54,7 @@ class box_graph_invoices_peryear extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->facture->lire); + $this->hidden = empty($user->rights->facture->lire); } /** diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index fc91cb692c1..75e51e071f8 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -56,7 +56,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->fournisseur->facture->lire); + $this->hidden = empty($user->rights->fournisseur->facture->lire); } /** diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index 885ec469632..c4205901528 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -56,7 +56,7 @@ class box_graph_orders_permonth extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->commande->lire); + $this->hidden = empty($user->rights->commande->lire); } /** diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index db7400c1c5a..433ba660365 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -56,7 +56,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->fournisseur->commande->lire); + $this->hidden = empty($user->rights->fournisseur->commande->lire); } /** diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index afed778912f..44f94fd48d1 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -61,8 +61,8 @@ class box_graph_product_distribution extends ModeleBoxes $this->hidden = !( (isModEnabled('facture') && !empty($user->rights->facture->lire)) - || (!empty($conf->commande->enabled) && !empty($user->rights->commande->lire)) - || (!empty($conf->propal->enabled) && !empty($user->rights->propale->lire)) + || (isModEnabled('commande') && !empty($user->rights->commande->lire)) + || (isModEnabled('propal') && !empty($user->rights->propale->lire)) ); } diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index cb9a543bc19..13f3a29ec16 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -56,7 +56,7 @@ class box_graph_propales_permonth extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->propale->lire); + $this->hidden = empty($user->rights->propale->lire); } /** diff --git a/htdocs/core/boxes/box_mos.php b/htdocs/core/boxes/box_mos.php index cff19388c17..812fcab7b64 100644 --- a/htdocs/core/boxes/box_mos.php +++ b/htdocs/core/boxes/box_mos.php @@ -60,7 +60,7 @@ class box_mos extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->bom->read); + $this->hidden = empty($user->rights->bom->read); } /** diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 909ff32acb9..80d465f0f87 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -62,7 +62,7 @@ class box_project extends ModeleBoxes $this->db = $db; $this->boxlabel = "OpenedProjects"; - $this->hidden = !($user->rights->projet->lire); + $this->hidden = empty($user->rights->projet->lire); } /** diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index cdaf629ae3f..8e8efc8d8f3 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -61,7 +61,7 @@ class box_propales extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->propale->lire); + $this->hidden = !($user->hasRight('propale', 'lire')); } /** diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php index e9cca792de1..25fa5ca2b1f 100644 --- a/htdocs/core/boxes/box_services_expired.php +++ b/htdocs/core/boxes/box_services_expired.php @@ -58,7 +58,7 @@ class box_services_expired extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->contrat->lire); + $this->hidden = !($user->hasRight('contrat', 'lire')); } /** diff --git a/htdocs/core/boxes/box_shipments.php b/htdocs/core/boxes/box_shipments.php index ba95fe14356..4e54f3c5992 100644 --- a/htdocs/core/boxes/box_shipments.php +++ b/htdocs/core/boxes/box_shipments.php @@ -60,7 +60,7 @@ class box_shipments extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->expedition->lire); + $this->hidden = empty($user->rights->expedition->lire); } /** diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php index 6ee0c5ef8a3..f3db3526bb6 100644 --- a/htdocs/core/boxes/box_supplier_orders.php +++ b/htdocs/core/boxes/box_supplier_orders.php @@ -58,7 +58,7 @@ class box_supplier_orders extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->fournisseur->commande->lire); + $this->hidden = !($user->hasRight('fournisseur', 'commande', 'lire')); } /** diff --git a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php index 32151828b83..ce0161582de 100644 --- a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php +++ b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php @@ -58,7 +58,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->fournisseur->commande->lire); + $this->hidden = !($user->hasRight('fournisseur', 'commande', 'lire')); } /** diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index 82e917b102a..3f3c9d83a62 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -64,7 +64,7 @@ class box_task extends ModeleBoxes $this->boxlabel = "Tasks"; $this->db = $db; - $this->hidden = (!empty($conf->global->PROJECT_HIDE_TASKS) || !($user->rights->projet->lire)); + $this->hidden = (!empty($conf->global->PROJECT_HIDE_TASKS) || empty($user->rights->projet->lire)); } /** diff --git a/htdocs/core/boxes/box_validated_projects.php b/htdocs/core/boxes/box_validated_projects.php index e57bb1f14d9..bab64d5a000 100644 --- a/htdocs/core/boxes/box_validated_projects.php +++ b/htdocs/core/boxes/box_validated_projects.php @@ -66,7 +66,7 @@ class box_validated_projects extends ModeleBoxes $this->db = $db; $this->boxlabel = "ProjectTasksWithoutTimeSpent"; - $this->hidden = !($user->rights->projet->lire); + $this->hidden = empty($user->rights->projet->lire); if ($conf->global->MAIN_FEATURES_LEVEL < 2) { $this->enabled = 0; diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 94fb05d5346..7acd7ac3db0 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2019-2020 Frédéric France + * Copyright (C) 2019-2022 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 @@ -547,10 +547,18 @@ class CMailFile } if (!empty($this->addr_cc)) { - $this->message->setCc($this->getArrayAddress($this->addr_cc)); + try { + $this->message->setCc($this->getArrayAddress($this->addr_cc)); + } catch (Exception $e) { + $this->errors[] = $e->getMessage(); + } } if (!empty($this->addr_bcc)) { - $this->message->setBcc($this->getArrayAddress($this->addr_bcc)); + try { + $this->message->setBcc($this->getArrayAddress($this->addr_bcc)); + } catch (Exception $e) { + $this->errors[] = $e->getMessage(); + } } //if (! empty($this->errors_to)) $this->message->setErrorsTo($this->getArrayAddress($this->errors_to)); if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 01665e99ca5..3c24b3c484f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -744,6 +744,7 @@ abstract class CommonObject public function setUpperOrLowerCase() { global $conf; + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) { $this->lastname = dol_ucwords(dol_strtolower($this->lastname)); $this->firstname = dol_ucwords(dol_strtolower($this->firstname)); @@ -759,6 +760,12 @@ abstract class CommonObject $this->address = dol_strtoupper($this->address); $this->town = dol_strtoupper($this->town); } + if (isset($this->email)) { + $this->email = dol_strtolower($this->email); + } + if (isset($this->personal_email)) { + $this->personal_email = dol_strtolower($this->personal_email); + } } /** @@ -5474,7 +5481,7 @@ abstract class CommonObject // We save charset_output to restore it because write_file can change it if needed for // output format that does not support UTF8. - $sav_charset_output = $outputlangs->charset_output; + $sav_charset_output = empty($outputlangs->charset_output) ? '' : $outputlangs->charset_output; if (in_array(get_class($this), array('Adherent'))) { $resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, 'member', 1, 'tmp_cards', $moreparams); @@ -7758,12 +7765,12 @@ abstract class CommonObject } else { $value = ''; } - } elseif (preg_match('/^(text|html)/', $type)) { - $value = dol_htmlentitiesbr($value); } elseif ($type == 'password') { $value = preg_replace('/./i', '*', $value); } elseif ($type == 'array') { $value = implode('
', $value); + } else { // text|html|varchar + $value = dol_htmlentitiesbr($value); } //print $type.'-'.$size.'-'.$value; @@ -8444,8 +8451,8 @@ abstract class CommonObject /** * Get buy price to use for margin calculation. This function is called when buy price is unknown. * Set buy price = sell price if ForceBuyingPriceIfNull configured, - * else if calculation MARGIN_TYPE = 'costprice' and costprice is defined, use costprice as buyprice - * else if calculation MARGIN_TYPE = 'pmp' and pmp is calculated, use pmp as buyprice + * elseif calculation MARGIN_TYPE = 'costprice' and costprice is defined, use costprice as buyprice + * elseif calculation MARGIN_TYPE = 'pmp' and pmp is calculated, use pmp as buyprice * else set min buy price as buy price * * @param float $unitPrice Product unit price @@ -8799,7 +8806,7 @@ abstract class CommonObject public function isInt($info) { if (is_array($info)) { - if (isset($info['type']) && ($info['type'] == 'int' || preg_match('/^integer/i', $info['type']))) { + if (isset($info['type']) && (preg_match('/(^int|int$)/i', $info['type']))) { return true; } else { return false; @@ -9058,6 +9065,8 @@ abstract class CommonObject return 'NULL'; } elseif (preg_match('/^(int|double|real|price)/i', $fieldsentry['type'])) { return price2num("$value"); + } elseif (preg_match('/int$/i', $fieldsentry['type'])) { + return (int) $value; } elseif ($fieldsentry['type'] == 'boolean') { if ($value) { return 'true'; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d31cdda5770..82e73186233 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4914,8 +4914,9 @@ class Form * @param string $question Question * @param string $action Action * @param array|string $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , 'size'=>, 'morecss'=>, 'moreattr'=>'autofocus' or 'style=...')) - * 'type' can be 'hidden', 'text', 'password', 'checkbox', 'radio', 'date', 'select', 'multiselect', 'morecss', 'other' or 'onecolumn'... - * @param string $selectedchoice '' or 'no', or 'yes' or '1' or '0' + * 'type' can be 'text', 'password', 'checkbox', 'radio', 'date', 'select', 'multiselect', 'morecss', + * 'other', 'onecolumn' or 'hidden'... + * @param int|string $selectedchoice '' or 'no', or 'yes' or '1', 1, '0' or 0 * @param int|string $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx * @param int|string $height Force height of box (0 = auto) * @param int $width Force width of box ('999' or '90%'). Ignored and forced to 90% on smartphones. diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 242c1476736..99003f00276 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -327,11 +327,11 @@ class FormActions $cursorevent++; } } else { - print '
'; + print ''; } if ($max && $num > $max) { - print ''; + print ''; } print '
'; - print $langs->trans("AddContactIntoCategory").'  '; + print $langs->trans("AssignCategoryTo").'  '; print $form->selectContacts('', '', 'elemid'); print '
'; if ($permission) { - print ""; + print "id."'>"; print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft'); print ""; @@ -931,7 +935,7 @@ if ($type == Categorie::TYPE_ACCOUNT) { // Link to delete from category print ''; if ($permission) { - print ""; + print "id."'>"; print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft'); print ""; @@ -1009,7 +1013,7 @@ if ($type == Categorie::TYPE_PROJECT) { // Link to delete from category print ''; if ($permission) { - print ""; + print "id."'>"; print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft'); print ""; @@ -1081,7 +1085,7 @@ if ($type == Categorie::TYPE_USER) { // Link to delete from category print ''; if ($user->rights->user->user->creer) { - print ""; + print "id."'>"; print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft'); print ""; @@ -1140,7 +1144,7 @@ if ($type == Categorie::TYPE_WAREHOUSE) { // Link to delete from category print ''; if ($permission) { - print ""; + print "id."'>"; print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft'); print ""; @@ -1156,6 +1160,7 @@ if ($type == Categorie::TYPE_WAREHOUSE) { } } +// List of tickets if ($type == Categorie::TYPE_TICKET) { $permission = ($user->rights->categorie->creer || $user->rights->categorie->creer); @@ -1212,7 +1217,7 @@ if ($type == Categorie::TYPE_TICKET) { // Link to delete from category print ''; if ($permission) { - print ""; + print "id."'>"; print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft'); print ""; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 989c909487b..ed25d89db67 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -409,9 +409,13 @@ if (empty($reshook) && $action == 'add') { $error++; } + + if (!$error) { $db->begin(); + + // Creation of action/event $idaction = $object->create($user); @@ -474,15 +478,15 @@ if (empty($reshook) && $action == 'add') { $db->commit(); } - if (!empty($backtopage)) { - dol_syslog("Back to ".$backtopage.($moreparam ? (preg_match('/\?/', $backtopage) ? '&'.$moreparam : '?'.$moreparam) : '')); - header("Location: ".$backtopage.($moreparam ? (preg_match('/\?/', $backtopage) ? '&'.$moreparam : '?'.$moreparam) : '')); - } elseif ($idaction) { - header("Location: ".DOL_URL_ROOT.'/comm/action/card.php?id='.$idaction.($moreparam ? '&'.$moreparam : '')); - } else { - header("Location: ".DOL_URL_ROOT.'/comm/action/index.php'.($moreparam ? '?'.$moreparam : '')); - } - exit; + // if (!empty($backtopage)) { + // dol_syslog("Back to ".$backtopage.($moreparam ? (preg_match('/\?/', $backtopage) ? '&'.$moreparam : '?'.$moreparam) : '')); + // header("Location: ".$backtopage.($moreparam ? (preg_match('/\?/', $backtopage) ? '&'.$moreparam : '?'.$moreparam) : '')); + // } elseif ($idaction) { + // header("Location: ".DOL_URL_ROOT.'/comm/action/card.php?id='.$idaction.($moreparam ? '&'.$moreparam : '')); + // } else { + // header("Location: ".DOL_URL_ROOT.'/comm/action/index.php'.($moreparam ? '?'.$moreparam : '')); + // } + // exit; } else { // If error $db->rollback(); @@ -496,6 +500,151 @@ if (empty($reshook) && $action == 'add') { setEventMessages($object->error, $object->errors, 'errors'); $action = 'create'; $donotclearsession = 1; } + + $selectedrecurrulefreq = 'no'; + $selectedrecurrulebymonthday = ''; + $selectedrecurrulebyday = ''; + $object->recurrule = GETPOSTISSET('recurrulefreq') ? "FREQ=".GETPOST('recurrulefreq', 'alpha') : ""; + $object->recurrule .= GETPOSTISSET('BYMONTHDAY') ? "_BYMONTHDAY".GETPOST('BYMONTHDAY', 'alpha') : ""; + $object->recurrule .= GETPOSTISSET('BYDAY') ? "_BYDAY".GETPOST('BYDAY', 'alpha') : ""; + + if ($object->recurrule && preg_match('/FREQ=([A-Z]+)/i', $object->recurrule, $reg1)) { + $selectedrecurrulefreq = $reg1[1]; + } + if ($object->recurrule && preg_match('/FREQ=MONTHLY.*BYMONTHDAY(\d+)/i', $object->recurrule, $reg2)) { + $selectedrecurrulebymonthday = $reg2[1]; + } + if ($object->recurrule && preg_match('/FREQ=WEEKLY.*BYDAY(\d+)/i', $object->recurrule, $reg3)) { + $selectedrecurrulebyday = $reg3[1]; + } + + // If event is recurrent + $userepeatevent = ($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0); + if ($userepeatevent && !empty($selectedrecurrulefreq) && $selectedrecurrulefreq != 'no') { + // We set first date of recurrence and offsets + if ($selectedrecurrulefreq == 'WEEKLY' && !empty($selectedrecurrulebyday)) { + $firstdatearray = dol_get_first_day_week(GETPOST("apday", 'int'), GETPOST("apmonth", 'int'), GETPOST("apyear", 'int')); + $datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), $firstdatearray['month'], $firstdatearray['first_day'], $firstdatearray['year'], $tzforfullday ? $tzforfullday : 'tzuser'); + $datep = dol_time_plus_duree($datep, $selectedrecurrulebyday + 6, 'd');//We begin the week after + $dayoffset = 7; + $monthoffset = 0; + } elseif ($selectedrecurrulefreq == 'MONTHLY' && !empty($selectedrecurrulebymonthday)) { + $firstday = $selectedrecurrulebymonthday; + $firstmonth = GETPOST("apday") > $selectedrecurrulebymonthday ? GETPOST("apmonth", 'int') + 1 : GETPOST("apmonth", 'int');//We begin the week after + $datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), $firstmonth, $firstday, GETPOST("apyear", 'int'), $tzforfullday ? $tzforfullday : 'tzuser'); + $dayoffset = 0; + $monthoffset = 1; + } else { + $error++; + } + // End date + $repeateventlimitdate = dol_mktime('23', '59', '59', GETPOSTISSET("limitmonth", 'int') ? GETPOST("limitmonth", 'int') : 01, GETPOSTISSET("limitday", 'int') ? GETPOST("limitday", 'int') : 01, GETPOSTISSET("limityear", 'int') && GETPOST("limityear", 'int') < 2100 ? GETPOST("limityear", 'int') : 2100, $tzforfullday ? $tzforfullday : 'tzuser'); + // Set date of end of event + $deltatime = num_between_day($object->datep, $datep); + $datef = dol_time_plus_duree($datef, $deltatime, 'd'); + + while ($datep <= $repeateventlimitdate && !$error) { + $finalobject = clone $object; + + + $finalobject->datep = $datep; + $finalobject->datef = $datef; + // Creation of action/event + $idaction = $finalobject->create($user); + + if ($idaction > 0) { + if (!$finalobject->error) { + // Category association + $categories = GETPOST('categories', 'array'); + $finalobject->setCategories($categories); + + unset($_SESSION['assignedtouser']); + + $moreparam = ''; + if ($user->id != $finalobject->userownerid) { + $moreparam = "filtert=-1"; // We force to remove filter so created record is visible when going back to per user view. + } + + // Create reminders + if ($addreminder == 'on') { + $actionCommReminder = new ActionCommReminder($db); + + $dateremind = dol_time_plus_duree($datep, -$offsetvalue, $offsetunit); + + $actionCommReminder->dateremind = $dateremind; + $actionCommReminder->typeremind = $remindertype; + $actionCommReminder->offsetunit = $offsetunit; + $actionCommReminder->offsetvalue = $offsetvalue; + $actionCommReminder->status = $actionCommReminder::STATUS_TODO; + $actionCommReminder->fk_actioncomm = $finalobject->id; + if ($remindertype == 'email') { + $actionCommReminder->fk_email_template = $modelmail; + } + + // the notification must be created for every user assigned to the event + foreach ($finalobject->userassigned as $userassigned) { + $actionCommReminder->fk_user = $userassigned['id']; + $res = $actionCommReminder->create($user); + + if ($res <= 0) { + // If error + $db->rollback(); + $langs->load("errors"); + $error = $langs->trans('ErrorReminderActionCommCreation'); + setEventMessages($error, null, 'errors'); + $action = 'create'; $donotclearsession = 1; + break; + } + } + } + + // Modify $moreparam so we are sure to see the event we have just created, whatever are the default value of filter on next page. + /*$moreparam .= ($moreparam ? '&' : '').'search_actioncode=0'; + $moreparam .= ($moreparam ? '&' : '').'search_status=-1'; + $moreparam .= ($moreparam ? '&' : '').'search_filtert='.$object->userownerid; + */ + $moreparam .= ($moreparam ? '&' : '').'disabledefaultvalues=1'; + + if ($error) { + $db->rollback(); + } else { + $db->commit(); + } + } else { + // If error + $db->rollback(); + $langs->load("errors"); + $error = $langs->trans($finalobject->error); + setEventMessages($error, null, 'errors'); + $action = 'create'; $donotclearsession = 1; + } + } else { + $db->rollback(); + setEventMessages($finalobject->error, $finalobject->errors, 'errors'); + $action = 'create'; $donotclearsession = 1; + } + + // If event is not recurrent, we stop here + if (!($userepeatevent && GETPOSTISSET('recurrulefreq') && GETPOST('recurrulefreq') != 'no' && GETPOSTISSET("limityear") && GETPOSTISSET("limitmonth") && GETPOSTISSET("limitday"))) { + break; + } + + // increment date for recurrent events + $datep = dol_time_plus_duree($datep, $dayoffset, 'd'); + $datep = dol_time_plus_duree($datep, $monthoffset, 'm'); + $datef = dol_time_plus_duree($datef, $dayoffset, 'd'); + $datef = dol_time_plus_duree($datef, $monthoffset, 'm'); + } + } + if (!empty($backtopage) && !$error) { + dol_syslog("Back to ".$backtopage.($moreparam ? (preg_match('/\?/', $backtopage) ? '&'.$moreparam : '?'.$moreparam) : '')); + header("Location: ".$backtopage.($moreparam ? (preg_match('/\?/', $backtopage) ? '&'.$moreparam : '?'.$moreparam) : '')); + } elseif ($idaction) { + header("Location: ".DOL_URL_ROOT.'/comm/action/card.php?id='.$idaction.($moreparam ? '&'.$moreparam : '')); + } else { + header("Location: ".DOL_URL_ROOT.'/comm/action/index.php'.($moreparam ? '?'.$moreparam : '')); + } + exit; } } @@ -916,10 +1065,11 @@ $formproject = new FormProjets($db); $arrayrecurrulefreq = array( 'no'=>$langs->trans("OnceOnly"), 'MONTHLY'=>$langs->trans("EveryMonth"), - 'WEEKLY'=>$langs->trans("EveryWeek"), - //'DAYLY'=>$langs->trans("EveryDay") + 'WEEKLY'=>$langs->trans("EveryWeek") + // 'DAILY'=>$langs->trans("EveryDay") ); + $help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda'; llxHeader('', $langs->trans("Agenda"), $help_url); @@ -1037,20 +1187,31 @@ if ($action == 'create') { print '        
'; print img_picto($langs->trans("Recurrence"), 'recurring', 'class="paddingright2"'); print ''; + $selectedrecurrulefreq = 'no'; $selectedrecurrulebymonthday = ''; $selectedrecurrulebyday = ''; + $object->recurrule = GETPOSTISSET('recurrulefreq') ? "FREQ=".GETPOST('recurrulefreq', 'alpha') : ""; + $object->recurrule .= GETPOSTISSET('BYMONTHDAY') ? "_BYMONTHDAY".GETPOST('BYMONTHDAY', 'alpha') : ""; + $object->recurrule .= GETPOSTISSET('BYDAY') ? "_BYDAY".GETPOST('BYDAY', 'alpha') : ""; + + $reg = array(); if ($object->recurrule && preg_match('/FREQ=([A-Z]+)/i', $object->recurrule, $reg)) { $selectedrecurrulefreq = $reg[1]; } - if ($object->recurrule && preg_match('/FREQ=MONTHLY.*BYMONTHDAY=(\d+)/i', $object->recurrule, $reg)) { + if ($object->recurrule && preg_match('/FREQ=MONTHLY.*BYMONTHDAY(\d+)/i', $object->recurrule, $reg)) { $selectedrecurrulebymonthday = $reg[1]; } if ($object->recurrule && preg_match('/FREQ=WEEKLY.*BYDAY(\d+)/i', $object->recurrule, $reg)) { $selectedrecurrulebyday = $reg[1]; } + print $form->selectarray('recurrulefreq', $arrayrecurrulefreq, $selectedrecurrulefreq, 0, 0, 0, '', 0, 0, 0, '', 'marginrightonly'); + // print ''; + // For recursive event + + // If recurrulefreq is MONTHLY print ''; //print '
'.$langs->trans("Date").'fulldayevent ? ' checked' : '').'>'; print ''; - // Recurring event - $userepeatevent = ($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0); - if ($userepeatevent) { - // Repeat - //print '
'; - print '        
'; - print img_picto($langs->trans("Recurrence"), 'recurring', 'class="paddingright2"'); - print ''; - $selectedrecurrulefreq = 'no'; - $selectedrecurrulebymonthday = ''; - $selectedrecurrulebyday = ''; - if ($object->recurrule && preg_match('/FREQ=([A-Z]+)/i', $object->recurrule, $reg)) { - $selectedrecurrulefreq = $reg[1]; - } - if ($object->recurrule && preg_match('/FREQ=MONTHLY.*BYMONTHDAY=(\d+)/i', $object->recurrule, $reg)) { - $selectedrecurrulebymonthday = $reg[1]; - } - if ($object->recurrule && preg_match('/FREQ=WEEKLY.*BYDAY(\d+)/i', $object->recurrule, $reg)) { - $selectedrecurrulebyday = $reg[1]; - } - print $form->selectarray('recurrulefreq', $arrayrecurrulefreq, $selectedrecurrulefreq, 0, 0, 0, '', 0, 0, 0, '', 'marginrightonly'); - // If recurrulefreq is MONTHLY - print ''; - // If recurrulefreq is WEEKLY - print ''; - print ''; - print '
'; - //print '
'; + // print '        
'; + // print img_picto($langs->trans("Recurrence"), 'recurring', 'class="paddingright2"'); + // print ''; + // $selectedrecurrulefreq = 'no'; + // $selectedrecurrulebymonthday = ''; + // $selectedrecurrulebyday = ''; + // if ($object->recurrule && preg_match('/FREQ=([A-Z]+)/i', $object->recurrule, $reg)) { + // $selectedrecurrulefreq = $reg[1]; + // } + // if ($object->recurrule && preg_match('/FREQ=MONTHLY.*BYMONTHDAY=(\d+)/i', $object->recurrule, $reg)) { + // $selectedrecurrulebymonthday = $reg[1]; + // } + // if ($object->recurrule && preg_match('/FREQ=WEEKLY.*BYDAY(\d+)/i', $object->recurrule, $reg)) { + // $selectedrecurrulebyday = $reg[1]; + // } + // print $form->selectarray('recurrulefreq', $arrayrecurrulefreq, $selectedrecurrulefreq, 0, 0, 0, '', 0, 0, 0, '', 'marginrightonly'); + // // If recurrulefreq is MONTHLY + // print ''; + // // If recurrulefreq is WEEKLY + // print ''; + // print ''; + // print '
'; + // //print '
'.$obj->title.''.dol_escape_htmltag($obj->title).''; @@ -286,7 +286,7 @@ if ($resql) { // Nb of email if (!$filteremail) { - print ''; + print ''; $nbemail = $obj->nbemail; /*if ($obj->statut != 3 && !empty($conf->global->MAILING_LIMIT_SENDBYWEB) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail) { diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 06c36ce517c..f1a92d032cf 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -120,9 +120,9 @@ $usercanclose = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreat $usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->propal->propal_advance->validate))); $usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->propal->propal_advance->send))); -$usercancreateorder = $user->rights->commande->creer; -$usercancreateinvoice = $user->rights->facture->creer; -$usercancreatecontract = $user->rights->contrat->creer; +$usercancreateorder = $user->hasRight('commande', 'creer'); +$usercancreateinvoice = $user->hasRight('facture', 'creer'); +$usercancreatecontract = $user->hasRight('contrat', 'creer'); $usercancreateintervention = $user->hasRight('ficheinter', 'creer'); $usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer')); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 668787349be..aa26e7be794 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -108,16 +108,18 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once -$usercanread = $user->rights->commande->lire; -$usercancreate = $user->rights->commande->creer; -$usercandelete = $user->rights->commande->supprimer; +$usercanread = $user->hasRight('commande', 'lire'); +$usercancreate = $user->hasRight('commande', 'creer'); +$usercandelete = $user->hasRight('commande', 'supprimer'); // Advanced permissions -$usercanclose = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->close))); -$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->validate))); -$usercancancel = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->annuler))); -$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send); -$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); +$usercanclose = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->hasRight('commande', 'order_advance', 'close')))); +$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->hasRight('commande', 'order_advance', 'validate')))); +$usercancancel = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->hasRight('commande', 'order_advance', 'annuler')))); +$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->hasRight('commande', 'order_advance', 'send')); +$usercangeneretedoc = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->hasRight('commande', 'order_advance', 'generetedoc')); + +$usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer')); $permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php $permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php @@ -2747,7 +2749,7 @@ if ($action == 'create' && $usercancreate) { $langs->load("interventions"); if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0) { - if ($user->rights->ficheinter->creer) { + if ($user->hasRight('ficheinter', 'creer')) { print dolGetButtonAction('', $langs->trans('AddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, ''); } else { print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('AddIntervention'), 'default', $_SERVER['PHP_SELF']. '#', '', false); @@ -2759,7 +2761,7 @@ if ($action == 'create' && $usercancreate) { if (!empty($conf->contrat->enabled) && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)) { $langs->load("contracts"); - if ($user->rights->contrat->creer) { + if ($user->hasRight('contrat', 'creer')) { print dolGetButtonAction('', $langs->trans('AddContract'), 'default', DOL_URL_ROOT.'/contrat/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, ''); } } @@ -2771,7 +2773,7 @@ if ($action == 'create' && $usercancreate) { if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { if ((isModEnabled('expedition_bon') && $user->rights->expedition->creer) || ($conf->delivery_note->enabled && $user->rights->expedition->delivery->creer)) { - if ($user->rights->expedition->creer) { + if ($user->hasRight('expedition', 'creer')) { print dolGetButtonAction('', $langs->trans('CreateShipment'), 'default', DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id, ''); } else { print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF']. '#', '', false); @@ -2790,7 +2792,7 @@ if ($action == 'create' && $usercancreate) { // Create bill and Classify billed // Note: Even if module invoice is not enabled, we should be able to use button "Classified billed" if ($object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) { - if (isModEnabled('facture') && $user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) { + if (isModEnabled('facture') && $user->hasRight('facture', 'creer') && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) { print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&token='.newToken().'&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, ''); } if ($usercancreate && $object->statut >= Commande::STATUS_VALIDATED && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 2dbaaa07373..c08336841e2 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -387,6 +387,10 @@ if (empty($numref)) { * Show list of record into a bank statement */ + $title = $langs->trans("FinancialAccount").' - '.$langs->trans("AccountStatements"); + $helpurl = ""; + llxHeader('', $title, $helpurl); + // Onglets $head = account_statement_prepare_head($object, $numref); print dol_get_fiche_head($head, 'statement', $langs->trans("AccountStatement"), -1, 'account'); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index bdc6a102147..23f53c3d405 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -363,11 +363,11 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $search_datelimit_start = ''; $search_datelimit_end = ''; $search_fac_rec_source_title = ''; - $option = ''; - $filter = ''; $toselect = array(); $search_array_options = array(); $search_categ_cus = 0; + $option = ''; + $socid = 0; } if (empty($reshook)) { @@ -919,7 +919,7 @@ if ($resql) { llxHeader('', $langs->trans('CustomersInvoices'), 'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes'); - if ($socid) { + if ($socid > 0) { $soc = new Societe($db); $soc->fetch($socid); if (empty($search_company)) { @@ -1151,8 +1151,9 @@ if ($resql) { print ''; print ''; print ''; + print ''; - print_barre_liste($langs->trans('BillsCustomers').' '.($socid ? ' '.$soc->name : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bill', 0, $newcardbutton, '', $limit, 0, 0, 1); + print_barre_liste($langs->trans('BillsCustomers').' '.($socid > 0 ? ' '.$soc->name : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bill', 0, $newcardbutton, '', $limit, 0, 0, 1); $topicmail = "SendBillRef"; $modelmail = "facture_send"; @@ -1329,7 +1330,7 @@ if ($resql) { } // Thirdparty if (!empty($arrayfields['s.nom']['checked'])) { - print ' 0 ? " disabled" : "").'>'.price($obj->total_ht)."'.price($obj->total_ht)."
'; - print $obj->import_key; + print dol_escape_htmltag($obj->import_key); print "
'.$langs->trans("None").'
'.$langs->trans("None").'
'.$langs->trans("More").'...
'.$langs->trans("More").'...
'; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 4c77566eeed..c23545a34c9 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -85,7 +85,7 @@ class FormMail extends Form public $toid; /** - * @var string replyto name + * @var string Reply-to name */ public $replytoname; @@ -95,20 +95,25 @@ class FormMail extends Form public $replytomail; /** - * @var string to name + * @var string To name */ public $toname; /** - * @var string to email + * @var string To email */ public $tomail; /** - * @var string trackid + * @var string Track id */ public $trackid; + /** + * @var string If you know a MSGID of an email and want to send the email in reply to it. Will be added into header as In-Reply-To: <...> + */ + public $inreplyto; + public $withsubstit; // Show substitution array public $withfrom; @@ -449,6 +454,7 @@ class FormMail extends Form $out .= ''; $out .= ''; $out .= ''; + $out .= ''; } if (!empty($this->withfrom)) { if (!empty($this->withfromreadonly)) { @@ -458,7 +464,7 @@ class FormMail extends Form } foreach ($this->param as $key => $value) { if (is_array($value)) { - $out .= "\n"; + $out .= "\n"; } else { $out .= ''."\n"; } diff --git a/htdocs/core/class/html.formsetup.class.php b/htdocs/core/class/html.formsetup.class.php index 1cfddb588fd..3ff36b356da 100644 --- a/htdocs/core/class/html.formsetup.class.php +++ b/htdocs/core/class/html.formsetup.class.php @@ -952,21 +952,11 @@ class FormSetupItem if (!empty($conf->use_javascript_ajax)) { $out.= ' '.img_picto($this->langs->trans('Generate'), 'refresh', 'id="generate_token'.$this->confKey.'" class="linkobject"'); } - if (!empty($conf->use_javascript_ajax)) { - $out .= "\n" . ''; - } + + // Add button to autosuggest a key + include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; + $out .= dolJSToSetRandomPassword($this->confKey, 'generate_token'.$this->confKey); + return $out; } @@ -1103,6 +1093,7 @@ class FormSetupItem $out.= $this->langs->trans("NorProspectNorCustomer"); } } elseif ($this->type == 'product') { + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; $product = new Product($this->db); $resprod = $product->fetch($this->fieldValue); if ($resprod > 0) { diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index e13aaba4685..62965413a5d 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -119,7 +119,7 @@ class FormTicket $this->action = 'add'; - $this->withcompany = $conf->societe->enabled ? 1 : 0; + $this->withcompany = isModEnabled("societe"); $this->withfromsocid = 0; $this->withfromcontactid = 0; //$this->withreadid=0; @@ -169,7 +169,7 @@ class FormTicket print dol_get_fiche_head(null, 'card', '', 0, ''); } - print '
'; + print 'param["returnurl"] : "").'">'; print ''; print ''; foreach ($this->param as $key => $value) { @@ -341,10 +341,12 @@ class FormTicket print $langs->trans('SubjectAnswerToTicket').' '.$this->topic_title; print '
'.$langs->trans("Mask").' ('.$langs->trans("BarCodeModel").'):
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).'   
'; diff --git a/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php b/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php index fd0a87efe5b..e25cd1dd115 100644 --- a/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php @@ -110,7 +110,7 @@ class mod_barcode_thirdparty_standard extends ModeleNumRefBarCode //$texte.= '
'.$langs->trans("Mask").' ('.$langs->trans("BarCodeModel").'):
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).'   
'; diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php index 43bf3ecd2cb..514a6c162fd 100644 --- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php +++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php @@ -274,7 +274,7 @@ class doc_generic_bom_odt extends ModelePDFBom $newfiletmp = preg_replace('/\.od(t|s)/i', '', $newfile); $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); - $newfiletmp = $objectref.'_'.$newfiletmp; + $newfiletmp = $objectref . '_' . $newfiletmp; //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); @@ -283,11 +283,11 @@ class doc_generic_bom_odt extends ModelePDFBom if ($format == '1') { $format = '%Y%m%d%H%M%S'; } - $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; + $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; } else { - $filename = $newfiletmp.'.'.$newfileformat; + $filename = $newfiletmp . '.' . $newfileformat; } - $file = $dir.'/'.$filename; + $file = $dir . '/' . $filename; //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; @@ -295,8 +295,8 @@ class doc_generic_bom_odt extends ModelePDFBom dol_mkdir($conf->bom->dir_temp); if (!is_writable($conf->bom->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->bom->dir_temp; - dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->bom->dir_temp); + dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); return -1; } diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 86e43a9c021..b9ff88c4fe6 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -280,7 +280,7 @@ class doc_generic_order_odt extends ModelePDFCommandes $newfiletmp = preg_replace('/\.od(t|s)/i', '', $newfile); $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); - $newfiletmp = $objectref.'_'.$newfiletmp; + $newfiletmp = $objectref . '_' . $newfiletmp; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); @@ -289,11 +289,11 @@ class doc_generic_order_odt extends ModelePDFCommandes if ($format == '1') { $format = '%Y%m%d%H%M%S'; } - $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; + $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; } else { - $filename = $newfiletmp.'.'.$newfileformat; + $filename = $newfiletmp . '.' . $newfileformat; } - $file = $dir.'/'.$filename; + $file = $dir . '/' . $filename; //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; @@ -301,8 +301,8 @@ class doc_generic_order_odt extends ModelePDFCommandes dol_mkdir($conf->commande->dir_temp); if (!is_writable($conf->commande->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->commande->dir_temp; - dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->commande->dir_temp); + dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); return -1; } diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index 9050e1accf5..df584348e5e 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -266,7 +266,7 @@ class doc_generic_contract_odt extends ModelePDFContract $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); - $newfiletmp = $objectref.'_'.$newfiletmp; + $newfiletmp = $objectref . '_' . $newfiletmp; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); @@ -275,11 +275,11 @@ class doc_generic_contract_odt extends ModelePDFContract if ($format == '1') { $format = '%Y%m%d%H%M%S'; } - $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; + $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; } else { - $filename = $newfiletmp.'.'.$newfileformat; + $filename = $newfiletmp . '.' . $newfileformat; } - $file = $dir.'/'.$filename; + $file = $dir . '/' . $filename; //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; @@ -287,8 +287,8 @@ class doc_generic_contract_odt extends ModelePDFContract dol_mkdir($conf->contrat->dir_temp); if (!is_writable($conf->contrat->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->contrat->dir_temp; - dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->contrat->dir_temp); + dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); return -1; } diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index f2035c89575..8d6e980bdc5 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -278,7 +278,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition $newfiletmp = preg_replace('/\.od(t|s)/i', '', $newfile); $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); - $newfiletmp = $objectref.'_'.$newfiletmp; + $newfiletmp = $objectref . '_' . $newfiletmp; //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); @@ -287,11 +287,11 @@ class doc_generic_shipment_odt extends ModelePdfExpedition if ($format == '1') { $format = '%Y%m%d%H%M%S'; } - $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; + $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; } else { - $filename = $newfiletmp.'.'.$newfileformat; + $filename = $newfiletmp . '.' . $newfileformat; } - $file = $dir.'/'.$filename; + $file = $dir . '/' . $filename; //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; @@ -299,8 +299,8 @@ class doc_generic_shipment_odt extends ModelePdfExpedition dol_mkdir($conf->expedition->dir_temp); if (!is_writable($conf->expedition->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->expedition->dir_temp; - dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->expedition->dir_temp); + dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); return -1; } diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index fc73460bd1b..f255fa52474 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -278,7 +278,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); - $newfiletmp = $objectref.'_'.$newfiletmp; + $newfiletmp = $objectref . '_' . $newfiletmp; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); @@ -287,11 +287,11 @@ class doc_generic_invoice_odt extends ModelePDFFactures if ($format == '1') { $format = '%Y%m%d%H%M%S'; } - $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; + $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; } else { - $filename = $newfiletmp.'.'.$newfileformat; + $filename = $newfiletmp . '.' . $newfileformat; } - $file = $dir.'/'.$filename; + $file = $dir . '/' . $filename; //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; //print "newdir=".$dir; //print "newfile=".$newfile; @@ -300,8 +300,8 @@ class doc_generic_invoice_odt extends ModelePDFFactures dol_mkdir($conf->facture->dir_temp); if (!is_writable($conf->facture->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->facture->dir_temp; - dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->facture->dir_temp); + dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); return -1; } diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 46ac4ffde37..9c79896ee6e 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -115,6 +115,32 @@ class pdf_sponge extends ModelePDFFactures */ public $marge_basse; + + /** + * @var int heightforinfotot + */ + public $heightforinfotot; + + /** + * @var int heightforfreetext + */ + public $heightforfreetext; + + /** + * @var int heightforfooter + */ + public $heightforfooter; + + /** + * @var int tab_top + */ + public $tab_top; + + /** + * @var int tab_top_newpage + */ + public $tab_top_newpage; + /** * Issuer * @var Societe Object that emits @@ -345,9 +371,9 @@ class pdf_sponge extends ModelePDFFactures $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $pdf->SetAutoPageBreak(1, 0); - $heightforinfotot = 50 + (4 * $nbpayments); // Height reserved to output the info and total part and payment part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page - $heightforfooter = $this->marge_basse + (empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 12 : 22); // Height reserved to output the footer (value include bottom margin) + $this->heightforinfotot = 50 + (4 * $nbpayments); // Height reserved to output the info and total part and payment part + $this->heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $this->heightforfooter = $this->marge_basse + (empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 12 : 22); // Height reserved to output the footer (value include bottom margin) if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); @@ -429,9 +455,9 @@ class pdf_sponge extends ModelePDFFactures // $pdf->GetY() here can't be used. It is bottom of the second addresse box but first one may be higher - // $tab_top is y where we must continue content (90 = 42 + 48: 42 is height of logo and ref, 48 is address blocks) - $tab_top = 90 + $top_shift; // top_shift is an addition for linked objects or addons (0 in most cases) - $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift : 10); + // $this->tab_top is y where we must continue content (90 = 42 + 48: 42 is height of logo and ref, 48 is address blocks) + $this->tab_top = 90 + $top_shift; // top_shift is an addition for linked objects or addons (0 in most cases) + $this->tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift : 10); // You can add more thing under header here, if you increase $extra_under_address_shift too. $extra_under_address_shift = 0; @@ -452,7 +478,7 @@ class pdf_sponge extends ModelePDFFactures 'module_width' => 1, // width of a single module in points 'module_height' => 1 // height of a single module in points ); - $pdf->write2DBarcode($qrcodestring, 'QRCODE,M', $this->marge_gauche, $tab_top - 5, 25, 25, $styleQr, 'N'); + $pdf->write2DBarcode($qrcodestring, 'QRCODE,M', $this->marge_gauche, $this->tab_top - 5, 25, 25, $styleQr, 'N'); $extra_under_address_shift += 25; } @@ -469,32 +495,32 @@ class pdf_sponge extends ModelePDFFactures $extra_under_address_shift += $hookmanager->resArray['extra_under_header_shift']; } - $tab_top += $extra_under_address_shift; - $tab_top_newpage += 0; + $this->tab_top += $extra_under_address_shift; + $this->tab_top_newpage += 0; // Define heigth of table for lines (for first page) - $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext; + $tab_height = $this->page_hauteur - $this->tab_top - $this->heightforfooter - $this->heightforfreetext; - $nexY = $tab_top - 1; + $nexY = $this->tab_top - 1; // Incoterm $height_incoterms = 0; if (!empty($conf->incoterm->enabled)) { $desc_incoterms = $object->getIncotermsForPDF(); if ($desc_incoterms) { - $tab_top -= 2; + $this->tab_top -= 2; $pdf->SetFont('', '', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1, dol_htmlentitiesbr($desc_incoterms), 0, 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $this->tab_top - 1, dol_htmlentitiesbr($desc_incoterms), 0, 1); $nexY = max($pdf->GetY(), $nexY); - $height_incoterms = $nexY - $tab_top; + $height_incoterms = $nexY - $this->tab_top; // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1); + $pdf->Rect($this->marge_gauche, $this->tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1); - $tab_top = $nexY + 6; + $this->tab_top = $nexY + 6; $height_incoterms += 4; } } @@ -521,7 +547,7 @@ class pdf_sponge extends ModelePDFFactures $pagenb = $pdf->getPage(); if ($notetoshow) { - $tab_top -= 2; + $this->tab_top -= 2; $tab_width = $this->page_largeur - $this->marge_gauche - $this->marge_droite; $pageposbeforenote = $pagenb; @@ -534,7 +560,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->startTransaction(); $pdf->SetFont('', '', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $this->tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); // Description $pageposafternote = $pdf->getPage(); $posyafter = $pdf->GetY(); @@ -553,29 +579,29 @@ class pdf_sponge extends ModelePDFFactures $this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis); } // $this->_pagefoot($pdf,$object,$outputlangs,1); - $pdf->setTopMargin($tab_top_newpage); + $pdf->setTopMargin($this->tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', 1, $this->heightforfooter + $this->heightforfreetext); } // back to start $pdf->setPage($pageposbeforenote); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', 1, $this->heightforfooter + $this->heightforfreetext); $pdf->SetFont('', '', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $this->tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); $pageposafternote = $pdf->getPage(); $posyafter = $pdf->GetY(); - if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20))) { // There is no space left for total+free text + if ($posyafter > ($this->page_hauteur - ($this->heightforfooter + $this->heightforfreetext + 20))) { // There is no space left for total+free text $pdf->AddPage('', '', true); $pagenb++; $pageposafternote++; $pdf->setPage($pageposafternote); - $pdf->setTopMargin($tab_top_newpage); + $pdf->setTopMargin($this->tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); - //$posyafter = $tab_top_newpage; + $pdf->setPageOrientation('', 1, $this->heightforfooter + $this->heightforfreetext); + //$posyafter = $this->tab_top_newpage; } @@ -588,11 +614,11 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetDrawColor(128, 128, 128); // Draw note frame if ($i > $pageposbeforenote) { - $height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter); - $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); + $height_note = $this->page_hauteur - ($this->tab_top_newpage + $this->heightforfooter); + $pdf->Rect($this->marge_gauche, $this->tab_top_newpage - 1, $tab_width, $height_note + 1); } else { - $height_note = $this->page_hauteur - ($tab_top + $heightforfooter); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1); + $height_note = $this->page_hauteur - ($this->tab_top + $this->heightforfooter); + $pdf->Rect($this->marge_gauche, $this->tab_top - 1, $tab_width, $height_note + 1); } // Add footer @@ -610,17 +636,17 @@ class pdf_sponge extends ModelePDFFactures if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis); } - $height_note = $posyafter - $tab_top_newpage; - $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); + $height_note = $posyafter - $this->tab_top_newpage; + $pdf->Rect($this->marge_gauche, $this->tab_top_newpage - 1, $tab_width, $height_note + 1); } else { // No pagebreak $pdf->commitTransaction(); $posyafter = $pdf->GetY(); - $height_note = $posyafter - $tab_top; - $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1); + $height_note = $posyafter - $this->tab_top; + $pdf->Rect($this->marge_gauche, $this->tab_top - 1, $tab_width, $height_note + 1); - if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20))) { + if ($posyafter > ($this->page_hauteur - ($this->heightforfooter + $this->heightforfreetext + 20))) { // not enough space, need to add page $pdf->AddPage('', '', true); $pagenb++; @@ -633,12 +659,12 @@ class pdf_sponge extends ModelePDFFactures $this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis); } - $posyafter = $tab_top_newpage; + $posyafter = $this->tab_top_newpage; } } $tab_height = $tab_height - $height_note; - $tab_top = $posyafter + 6; + $this->tab_top = $posyafter + 6; } else { $height_note = 0; } @@ -648,10 +674,10 @@ class pdf_sponge extends ModelePDFFactures // Table simulation to know the height of the title line (this set this->tableTitleHeight) $pdf->startTransaction(); - $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop); + $this->pdfTabTitles($pdf, $this->tab_top, $tab_height, $outputlangs, $hidetop); $pdf->rollbackTransaction(true); - $nexY = $tab_top + $this->tabTitleHeight; + $nexY = $this->tab_top + $this->tabTitleHeight; // Loop on each lines $pageposbeforeprintlines = $pdf->getPage(); @@ -667,8 +693,8 @@ class pdf_sponge extends ModelePDFFactures $imglinesize = pdf_getSizeForImage($realpatharray[$i]); } - $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setTopMargin($this->tab_top_newpage); + $pdf->setPageOrientation('', 1, $this->heightforfooter + $this->heightforfreetext + $this->heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); $showpricebeforepagebreak = 1; @@ -677,14 +703,14 @@ class pdf_sponge extends ModelePDFFactures if ($this->getColumnStatus('photo')) { // We start with Photo of product line - if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) { // If photo too high, we moved completely on new page + if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur - ($this->heightforfooter + $this->heightforfreetext + $this->heightforinfotot))) { // If photo too high, we moved completely on new page $pdf->AddPage('', '', true); if (!empty($tplidx)) { $pdf->useTemplate($tplidx); } $pdf->setPage($pageposbefore + 1); - $curY = $tab_top_newpage; + $curY = $this->tab_top_newpage; // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) { @@ -711,14 +737,14 @@ class pdf_sponge extends ModelePDFFactures if ($pageposafter > $pageposbefore) { // There is a pagebreak $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', 1, $this->heightforfooter); // The only function to edit the bottom margin of current page to set it. $this->printColDescContent($pdf, $curY, 'desc', $object, $i, $outputlangs, $hideref, $hidedesc); $pageposafter = $pdf->getPage(); $posyafter = $pdf->GetY(); - //var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit; - if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) { // There is no space left for total+free text + //var_dump($posyafter); var_dump(($this->page_hauteur - ($this->heightforfooter+$this->heightforfreetext+$this->heightforinfotot))); exit; + if ($posyafter > ($this->page_hauteur - ($this->heightforfooter + $this->heightforfreetext + $this->heightforinfotot))) { // There is no space left for total+free text if ($i == ($nblines - 1)) { // No more lines, and no space left to show total, so we create a new page $pdf->AddPage('', '', true); if (!empty($tplidx)) { @@ -752,7 +778,7 @@ class pdf_sponge extends ModelePDFFactures // We suppose that a too long description or photo were moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { $pdf->setPage($pageposafter); - $curY = $tab_top_newpage; + $curY = $this->tab_top_newpage; } $pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font @@ -923,9 +949,9 @@ class pdf_sponge extends ModelePDFFactures while ($pagenb < $pageposafter) { $pdf->setPage($pagenb); if ($pagenb == $pageposbeforeprintlines) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code, $outputlangsbis); + $this->_tableau($pdf, $this->tab_top, $this->page_hauteur - $this->tab_top - $this->heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code, $outputlangsbis); } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code, $outputlangsbis); + $this->_tableau($pdf, $this->tab_top_newpage, $this->page_hauteur - $this->tab_top_newpage - $this->heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code, $outputlangsbis); } $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; @@ -941,9 +967,9 @@ class pdf_sponge extends ModelePDFFactures if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == $pageposafter) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code, $outputlangsbis); + $this->_tableau($pdf, $this->tab_top, $this->page_hauteur - $this->tab_top - $this->heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code, $outputlangsbis); } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code, $outputlangsbis); + $this->_tableau($pdf, $this->tab_top_newpage, $this->page_hauteur - $this->tab_top_newpage - $this->heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code, $outputlangsbis); } $this->_pagefoot($pdf, $object, $outputlangs, 1); // New page @@ -960,11 +986,11 @@ class pdf_sponge extends ModelePDFFactures // Show square if ($pagenb == $pageposbeforeprintlines) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code, $outputlangsbis); - $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; + $this->_tableau($pdf, $this->tab_top, $this->page_hauteur - $this->tab_top - $this->heightforinfotot - $this->heightforfreetext - $this->heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code, $outputlangsbis); + $bottomlasttab = $this->page_hauteur - $this->heightforinfotot - $this->heightforfreetext - $this->heightforfooter + 1; } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code, $outputlangsbis); - $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; + $this->_tableau($pdf, $this->tab_top_newpage, $this->page_hauteur - $this->tab_top_newpage - $this->heightforinfotot - $this->heightforfreetext - $this->heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code, $outputlangsbis); + $bottomlasttab = $this->page_hauteur - $this->heightforinfotot - $this->heightforfreetext - $this->heightforfooter + 1; } // Display infos area @@ -1432,10 +1458,16 @@ class pdf_sponge extends ModelePDFFactures $posy = $pdf->GetY(); foreach ($TPreviousIncoice as &$fac) { - if ($posy > $this->page_hauteur - 4) { + if ($posy > $this->page_hauteur - 4 - $this->heightforfooter) { $this->_pagefoot($pdf, $object, $outputlangs, 1); $pdf->addPage(); - $pdf->setY($this->marge_haute); + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { + $this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis); + $pdf->setY($this->tab_top_newpage); + } + else{ + $pdf->setY($this->marge_haute); + } $posy = $pdf->GetY(); } @@ -1495,9 +1527,16 @@ class pdf_sponge extends ModelePDFFactures $posy += $tab2_hl; - if ($posy > $this->page_hauteur - 4) { + if ($posy > $this->page_hauteur - 4 - $this->heightforfooter) { $pdf->addPage(); - $pdf->setY($this->marge_haute); + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { + $this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis); + $pdf->setY($this->tab_top_newpage); + } + else { + $pdf->setY($this->marge_haute); + } + $posy = $pdf->GetY(); } diff --git a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php index c2ccff58ed7..0a196b49ae3 100644 --- a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php +++ b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php @@ -268,7 +268,7 @@ class doc_generic_member_odt extends ModelePDFMember $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); - $newfiletmp = $objectref.'_'.$newfiletmp; + $newfiletmp = $objectref . '_' . $newfiletmp; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); @@ -277,11 +277,11 @@ class doc_generic_member_odt extends ModelePDFMember if ($format == '1') { $format = '%Y%m%d%H%M%S'; } - $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; + $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; } else { - $filename = $newfiletmp.'.'.$newfileformat; + $filename = $newfiletmp . '.' . $newfileformat; } - $file = $dir.'/'.$filename; + $file = $dir . '/' . $filename; //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; @@ -289,8 +289,8 @@ class doc_generic_member_odt extends ModelePDFMember dol_mkdir($conf->adherent->dir_temp); if (!is_writable($conf->adherent->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->adherent->dir_temp; - dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->adherent->dir_temp); + dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); return -1; } diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index 842495c242d..91206c2dd9f 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -179,8 +179,8 @@ class pdf_standard extends CommonStickerGenerator $widthtouse = $maxwidthtouse; $heighttouse = round($widthtouse / $imgratio); } else { - $heightouse = $maxheighttouse; - $widthtouse = round($heightouse * $imgratio); + $heighttouse = $maxheighttouse; + $widthtouse = round($heighttouse * $imgratio); } } //var_dump($this->_Width.'x'.$this->_Height.' with border and scale '.$imgscale.' => max '.$maxwidthtouse.'x'.$maxheighttouse.' => We use '.$widthtouse.'x'.$heighttouse);exit; diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index 215e7dd3c64..ec0546e9af1 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -250,7 +250,7 @@ class modAdherent extends DolibarrModules $r++; $this->rights[$r][0] = 78; - $this->rights[$r][1] = 'Read subscriptions'; + $this->rights[$r][1] = 'Read membership fees'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'cotisation'; @@ -258,7 +258,7 @@ class modAdherent extends DolibarrModules $r++; $this->rights[$r][0] = 79; - $this->rights[$r][1] = 'Create/modify/remove subscriptions'; + $this->rights[$r][1] = 'Create/modify/remove membership fees'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'cotisation'; diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index e75147ba78a..70f06169394 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -139,9 +139,17 @@ class modCommande extends DolibarrModules $this->rights[$r][4] = 'order_advance'; $this->rights[$r][5] = 'validate'; + $r++; + $this->rights[$r][0] = 85; + $this->rights[$r][1] = 'Generate the documents sales orders'; + $this->rights[$r][2] = 'd'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'order_advance'; + $this->rights[$r][5] = 'generetedoc'; + $r++; $this->rights[$r][0] = 86; - $this->rights[$r][1] = 'Send sale orders by email'; + $this->rights[$r][1] = 'Send sales orders by email'; $this->rights[$r][2] = 'd'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'order_advance'; diff --git a/htdocs/core/modules/modEventOrganization.class.php b/htdocs/core/modules/modEventOrganization.class.php index 93318bb952e..a7a6c048a4d 100644 --- a/htdocs/core/modules/modEventOrganization.class.php +++ b/htdocs/core/modules/modEventOrganization.class.php @@ -24,6 +24,7 @@ * \brief Description and activation file for the EventOrganization */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; /** * Description and activation class for module EventOrganization @@ -257,7 +258,7 @@ class modEventOrganization extends DolibarrModules 'fk_menu'=>'fk_mainmenu=project,fk_leftmenu=eventorganization', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', // This is a Left menu entry 'titre'=>'New', - 'url'=>'/projet/card.php?leftmenu=projects&action=create&usage_organize_event=1', + 'url'=>'/projet/card.php?leftmenu=projects&action=create&usage_organize_event=1&usage_opportunity=0', 'langs'=>'eventorganization@eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position'=>1000+$r, 'enabled'=>'$conf->eventorganization->enabled', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. @@ -367,7 +368,9 @@ class modEventOrganization extends DolibarrModules } } - return $this->_init($sql, $options); + $init = $this->_init($sql, $options); + + return $init; } /** diff --git a/htdocs/core/modules/modFTP.class.php b/htdocs/core/modules/modFTP.class.php index 3e2ccd7d049..7cde492b2c3 100644 --- a/htdocs/core/modules/modFTP.class.php +++ b/htdocs/core/modules/modFTP.class.php @@ -58,7 +58,7 @@ class modFTP extends DolibarrModules // Key used in llx_const table to save module status enabled/disabled (XXX is id value) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Name of png file (without png) used for this module - $this->picto = 'dir'; + $this->picto = 'folder'; // Data directories to create when module is enabled $this->dirs = array("/ftp/temp"); @@ -114,6 +114,7 @@ class modFTP extends DolibarrModules $this->menu[$r] = array('fk_menu'=>0, 'type'=>'top', 'titre'=>'FTP', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em092"'), 'mainmenu'=>'ftp', 'url'=>'/ftp/index.php', 'langs'=>'ftp', diff --git a/htdocs/core/modules/modWebsite.class.php b/htdocs/core/modules/modWebsite.class.php index e27e7a2f6b0..6e0dc80e41c 100644 --- a/htdocs/core/modules/modWebsite.class.php +++ b/htdocs/core/modules/modWebsite.class.php @@ -164,6 +164,8 @@ class modWebsite extends DolibarrModules { global $conf, $langs; + $error = 0; + $result = $this->_load_tables('/install/mysql/', 'website'); if ($result < 0) { return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default') @@ -185,11 +187,16 @@ class modWebsite extends DolibarrModules if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyDir', $src, $dest); - return 0; + $this->errors[] = $langs->trans('ErrorFailToCopyDir', $src, $dest); + $error++; } } } + if ($error) { + return 0; + } + // Website templates $srcroot = DOL_DOCUMENT_ROOT.'/install/doctemplates/websites'; $destroot = DOL_DATA_ROOT.'/doctemplates/websites'; @@ -205,9 +212,15 @@ class modWebsite extends DolibarrModules if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); + $this->errors[] = $langs->trans('ErrorFailToCopyFile', $src, $dest); + $error++; } } + if ($error) { + return 0; + } + $sql = array(); return $this->_init($sql, $options); diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php index 7463ed995d0..1c08dd7228d 100644 --- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php +++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php @@ -267,7 +267,7 @@ class doc_generic_mo_odt extends ModelePDFMo $newfiletmp = preg_replace('/\.od(t|s)/i', '', $newfile); $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); - $newfiletmp = $objectref.'_'.$newfiletmp; + $newfiletmp = $objectref . '_' . $newfiletmp; //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); @@ -276,11 +276,11 @@ class doc_generic_mo_odt extends ModelePDFMo if ($format == '1') { $format = '%Y%m%d%H%M%S'; } - $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; + $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; } else { - $filename = $newfiletmp.'.'.$newfileformat; + $filename = $newfiletmp . '.' . $newfileformat; } - $file = $dir.'/'.$filename; + $file = $dir . '/' . $filename; //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; @@ -288,8 +288,8 @@ class doc_generic_mo_odt extends ModelePDFMo dol_mkdir($conf->mrp->dir_temp); if (!is_writable($conf->mrp->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->mrp->dir_temp; - dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->mrp->dir_temp); + dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); return -1; } diff --git a/htdocs/core/modules/oauth/generic_oauthcallback.php b/htdocs/core/modules/oauth/generic_oauthcallback.php new file mode 100644 index 00000000000..9d66bb07302 --- /dev/null +++ b/htdocs/core/modules/oauth/generic_oauthcallback.php @@ -0,0 +1,193 @@ + + * Copyright (C) 2015 Frederic 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/core/modules/oauth/generic_oauthcallback.php + * \ingroup oauth + * \brief Page to get oauth callback + */ + +require '../../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php'; +use OAuth\Common\Storage\DoliStorage; +use OAuth\Common\Consumer\Credentials; +use OAuth\OAuth2\Service\GitHub; + +// Define $urlwithroot +$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); +$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file +//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + + +$action = GETPOST('action', 'aZ09'); +$backtourl = GETPOST('backtourl', 'alpha'); +$keyforprovider = GETPOST('keyforprovider', 'aZ09'); +if (empty($keyforprovider) && !empty($_SESSION["oauthkeyforproviderbeforeoauthjump"]) && (GETPOST('code') || $action == 'delete')) { + $keyforprovider = $_SESSION["oauthkeyforproviderbeforeoauthjump"]; +} +$genericstring = 'OTHER'; + + +/** + * Create a new instance of the URI class with the current URI, stripping the query string + */ +$uriFactory = new \OAuth\Common\Http\Uri\UriFactory(); +//$currentUri = $uriFactory->createFromSuperGlobalArray($_SERVER); +//$currentUri->setQuery(''); +$currentUri = $uriFactory->createFromAbsolute($urlwithroot.'/core/modules/oauth/generic_oauthcallback.php'); + + +/** + * Load the credential for the service + */ + +/** @var $serviceFactory \OAuth\ServiceFactory An OAuth service factory. */ +$serviceFactory = new \OAuth\ServiceFactory(); +$httpClient = new \OAuth\Common\Http\Client\CurlClient(); +// TODO Set options for proxy and timeout +// $params=array('CURLXXX'=>value, ...) +//$httpClient->setCurlParameters($params); +$serviceFactory->setHttpClient($httpClient); + +// Dolibarr storage +$storage = new DoliStorage($db, $conf); + +// Setup the credentials for the requests +$keyforparamid = 'OAUTH_'.$genericstring.($keyforprovider ? '-'.$keyforprovider : '').'_ID'; +$keyforparamsecret = 'OAUTH_'.$genericstring.($keyforprovider ? '-'.$keyforprovider : '').'_SECRET'; +$credentials = new Credentials( + getDolGlobalString($keyforparamid), + getDolGlobalString($keyforparamsecret), + $currentUri->getAbsoluteUri() +); + +$requestedpermissionsarray = array(); +if (GETPOST('state')) { + $requestedpermissionsarray = explode(',', GETPOST('state')); // Example: 'user'. 'state' parameter is standard to retrieve some parameters back +} +if ($action != 'delete' && empty($requestedpermissionsarray)) { + print 'Error, parameter state is not defined'; + exit; +} +//var_dump($requestedpermissionsarray);exit; + +// Instantiate the Api service using the credentials, http client and storage mechanism for the token +$apiService = $serviceFactory->createService($genericstring, $credentials, $storage, $requestedpermissionsarray); + +/* +var_dump($genericstring.($keyforprovider ? '-'.$keyforprovider : '')); +var_dump($credentials); +var_dump($storage); +var_dump($requestedpermissionsarray); +*/ + +if (empty($apiService)) { + print 'Error, failed to create serviceFactory'; + exit; +} + +// access type needed to have oauth provider refreshing token +//$apiService->setAccessType('offline'); + +$langs->load("oauth"); + +if (!getDolGlobalString($keyforparamid)) { + accessforbidden('Setup of service is not complete. Customer ID is missing'); +} +if (!getDolGlobalString($keyforparamsecret)) { + accessforbidden('Setup of service is not complete. Secret key is missing'); +} + + +/* + * Actions + */ + +if ($action == 'delete') { + $storage->clearToken($genericstring); + + setEventMessages($langs->trans('TokenDeleted'), null, 'mesgs'); + + header('Location: '.$backtourl); + exit(); +} + +if (GETPOST('code')) { // We are coming from oauth provider page + // We should have + //$_GET=array('code' => string 'aaaaaaaaaaaaaa' (length=20), 'state' => string 'user,public_repo' (length=16)) + + dol_syslog("We are coming from the oauth provider page"); + //llxHeader('',$langs->trans("OAuthSetup")); + + //$linkback=''.$langs->trans("BackToModuleList").''; + //print load_fiche_titre($langs->trans("OAuthSetup"),$linkback,'title_setup'); + + //print dol_get_fiche_head(); + // retrieve the CSRF state parameter + $state = GETPOSTISSET('state') ? GETPOST('state') : null; + //print ''; + + // This was a callback request from service, get the token + try { + //var_dump($_GET['code']); + //var_dump($state); + //var_dump($apiService); // OAuth\OAuth2\Service\GitHub + + //$token = $apiService->requestAccessToken(GETPOST('code'), $state); + $token = $apiService->requestAccessToken(GETPOST('code')); + // Github is a service that does not need state to be stored. + // Into constructor of GitHub, the call + // parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri) + // has not the ending parameter to true like the Google class constructor. + + setEventMessages($langs->trans('NewTokenStored'), null, 'mesgs'); // Stored into object managed by class DoliStorage so into table oauth_token + + $backtourl = $_SESSION["backtourlsavedbeforeoauthjump"]; + unset($_SESSION["backtourlsavedbeforeoauthjump"]); + + header('Location: '.$backtourl); + exit(); + } catch (Exception $e) { + print $e->getMessage(); + } +} else { // If entry on page with no parameter, we arrive here + $_SESSION["backtourlsavedbeforeoauthjump"] = $backtourl; + $_SESSION["oauthkeyforproviderbeforeoauthjump"] = $keyforprovider; + $_SESSION['oauthstateanticsrf'] = $state; + + // This may create record into oauth_state before the header redirect. + // Creation of record with state in this tables depend on the Provider used (see its constructor). + if (GETPOST('state')) { + $url = $apiService->getAuthorizationUri(array('state' => GETPOST('state'))); + } else { + $url = $apiService->getAuthorizationUri(); // Parameter state will be randomly generated + } + + // we go on oauth provider authorization page + header('Location: '.$url); + exit(); +} + + +/* + * View + */ + +// No view at all, just actions + +$db->close(); diff --git a/htdocs/core/modules/oauth/github_oauthcallback.php b/htdocs/core/modules/oauth/github_oauthcallback.php index 5c24e23aafa..f496c42d0ac 100644 --- a/htdocs/core/modules/oauth/github_oauthcallback.php +++ b/htdocs/core/modules/oauth/github_oauthcallback.php @@ -1,5 +1,5 @@ * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify @@ -86,7 +86,7 @@ if ($action != 'delete' && empty($requestedpermissionsarray)) { //var_dump($requestedpermissionsarray);exit; // Instantiate the Api service using the credentials, http client and storage mechanism for the token -$apiService = $serviceFactory->createService('GitHub'.($keyforprovider ? '-'.$keyforprovider : ''), $credentials, $storage, $requestedpermissionsarray); +$apiService = $serviceFactory->createService('GitHub', $credentials, $storage, $requestedpermissionsarray); // access type needed to have oauth provider refreshing token //$apiService->setAccessType('offline'); diff --git a/htdocs/core/modules/oauth/google_oauthcallback.php b/htdocs/core/modules/oauth/google_oauthcallback.php index 2812c4f7163..9208a6110a9 100644 --- a/htdocs/core/modules/oauth/google_oauthcallback.php +++ b/htdocs/core/modules/oauth/google_oauthcallback.php @@ -1,5 +1,5 @@ * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/core/modules/oauth/stripelive_oauthcallback.php b/htdocs/core/modules/oauth/stripelive_oauthcallback.php index bf9656df783..f24921faf83 100644 --- a/htdocs/core/modules/oauth/stripelive_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripelive_oauthcallback.php @@ -1,5 +1,5 @@ * Copyright (C) 2019 Thibault FOUCART * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/core/modules/oauth/stripetest_oauthcallback.php b/htdocs/core/modules/oauth/stripetest_oauthcallback.php index 64d55fba760..b41b579857e 100644 --- a/htdocs/core/modules/oauth/stripetest_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripetest_oauthcallback.php @@ -1,5 +1,5 @@ * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index bf1da990923..c1b93be6653 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -141,8 +141,8 @@ class pdf_standardlabel extends CommonStickerGenerator $widthtouse = $maxwidthtouse; $heighttouse = round($widthtouse / $imgratio); } else { - $heightouse = $maxheighttouse; - $widthtouse = round($heightouse * $imgratio); + $heighttouse = $maxheighttouse; + $widthtouse = round($heighttouse * $imgratio); } } //var_dump($this->_Width.'x'.$this->_Height.' with border and scale '.$imgscale.' => max '.$maxwidthtouse.'x'.$maxheighttouse.' => We use '.$widthtouse.'x'.$heighttouse);exit; diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index 5d228da7d8c..c4167847986 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -278,7 +278,7 @@ class doc_generic_product_odt extends ModelePDFProduct $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); - $newfiletmp = $objectref.'_'.$newfiletmp; + $newfiletmp = $objectref . '_' . $newfiletmp; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); @@ -287,11 +287,11 @@ class doc_generic_product_odt extends ModelePDFProduct if ($format == '1') { $format = '%Y%m%d%H%M%S'; } - $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; + $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; } else { - $filename = $newfiletmp.'.'.$newfileformat; + $filename = $newfiletmp . '.' . $newfileformat; } - $file = $dir.'/'.$filename; + $file = $dir . '/' . $filename; //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; @@ -299,8 +299,8 @@ class doc_generic_product_odt extends ModelePDFProduct dol_mkdir($conf->product->dir_temp); if (!is_writable($conf->product->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->product->dir_temp; - dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->product->dir_temp); + dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); return -1; } diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 8bd8d030a37..d00eee45219 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -556,7 +556,7 @@ class doc_generic_project_odt extends ModelePDFProjects $newfiletmp = preg_replace('/\.od(t|s)/i', '', $newfile); $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); - $newfiletmp = $objectref.'_'.$newfiletmp; + $newfiletmp = $objectref . '_' . $newfiletmp; //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); @@ -565,11 +565,11 @@ class doc_generic_project_odt extends ModelePDFProjects if ($format == '1') { $format = '%Y%m%d%H%M%S'; } - $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; + $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; } else { - $filename = $newfiletmp.'.'.$newfileformat; + $filename = $newfiletmp . '.' . $newfileformat; } - $file = $dir.'/'.$filename; + $file = $dir . '/' . $filename; //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; @@ -577,8 +577,8 @@ class doc_generic_project_odt extends ModelePDFProjects dol_mkdir($conf->project->dir_temp); if (!is_writable($conf->project->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->project->dir_temp; - dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->project->dir_temp); + dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); return -1; } diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index e26318b749c..410d3ae5b29 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -517,9 +517,9 @@ class doc_generic_task_odt extends ModelePDFTask $newfiletmp = preg_replace('/\.(ods|odt)/i', '', $newfile); $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); - $newfiletmp = $objectref.'_'.$newfiletmp; + $newfiletmp = $objectref . '_' . $newfiletmp; //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; - $file = $dir.'/'.$newfiletmp.'.odt'; + $file = $dir . '/' . $newfiletmp . '.odt'; //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; @@ -527,8 +527,8 @@ class doc_generic_task_odt extends ModelePDFTask dol_mkdir($conf->project->dir_temp); if (!is_writable($conf->project->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->project->dir_temp; - dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->project->dir_temp); + dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); return -1; } diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 7f2e0733e9d..8314d62dada 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -311,7 +311,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); - $newfiletmp = $objectref.'_'.$newfiletmp; + $newfiletmp = $objectref . '_' . $newfiletmp; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); @@ -320,11 +320,11 @@ class doc_generic_proposal_odt extends ModelePDFPropales if ($format == '1') { $format = '%Y%m%d%H%M%S'; } - $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; + $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; } else { - $filename = $newfiletmp.'.'.$newfileformat; + $filename = $newfiletmp . '.' . $newfileformat; } - $file = $dir.'/'.$filename; + $file = $dir . '/' . $filename; //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; @@ -332,8 +332,8 @@ class doc_generic_proposal_odt extends ModelePDFPropales dol_mkdir($conf->propal->multidir_temp[$object->entity]); if (!is_writable($conf->propal->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->propal->dir_temp; - dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->propal->dir_temp); + dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); return -1; } diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index 1976dea773f..18afd4fd054 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -271,7 +271,7 @@ class doc_generic_reception_odt extends ModelePdfReception $newfiletmp = preg_replace('/\.od(t|s)/i', '', $newfile); $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); - $newfiletmp = $objectref.'_'.$newfiletmp; + $newfiletmp = $objectref . '_' . $newfiletmp; //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); @@ -280,11 +280,11 @@ class doc_generic_reception_odt extends ModelePdfReception if ($format == '1') { $format = '%Y%m%d%H%M%S'; } - $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; + $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; } else { - $filename = $newfiletmp.'.'.$newfileformat; + $filename = $newfiletmp . '.' . $newfileformat; } - $file = $dir.'/'.$filename; + $file = $dir . '/' . $filename; //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; @@ -292,8 +292,8 @@ class doc_generic_reception_odt extends ModelePdfReception dol_mkdir($conf->reception->dir_temp); if (!is_writable($conf->reception->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->reception->dir_temp; - dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->reception->dir_temp); + dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); return -1; } diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index a19c90215b0..4a63e9c91f6 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -256,7 +256,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); if (!empty($conf->global->MAIN_DOC_USE_OBJECT_THIRDPARTY_NAME)) { - $newfiletmp = dol_sanitizeFileName(dol_string_nospecial($object->name)).'-'.$newfiletmp; + $newfiletmp = dol_sanitizeFileName(dol_string_nospecial($object->name)) . '-' . $newfiletmp; $newfiletmp = preg_replace('/__+/', '_', $newfiletmp); // Replace repeated _ into one _ (to avoid string with substitution syntax) } if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { @@ -264,11 +264,11 @@ class doc_generic_odt extends ModeleThirdPartyDoc if ($format == '1') { $format = '%Y%m%d%H%M%S'; } - $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; + $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; } else { - $filename = $newfiletmp.'.'.$newfileformat; + $filename = $newfiletmp . '.' . $newfileformat; } - $file = $dir.'/'.$filename; + $file = $dir . '/' . $filename; $object->builddoc_filename = $filename; // For triggers //print "newfileformat=".$newfileformat; //print "newdir=".$dir; @@ -279,8 +279,8 @@ class doc_generic_odt extends ModeleThirdPartyDoc dol_mkdir($conf->societe->multidir_temp[$object->entity]); if (!is_writable($conf->societe->multidir_temp[$object->entity])) { - $this->error = "Failed to write in temp directory ".$conf->societe->multidir_temp[$object->entity]; - dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->societe->multidir_temp[$object->entity]); + dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); return -1; } diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php index c54e5f4f02a..c5a6ae75389 100644 --- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php +++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php @@ -279,7 +279,7 @@ class doc_generic_stock_odt extends ModelePDFStock $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); - $newfiletmp = $objectref.'_'.$newfiletmp; + $newfiletmp = $objectref . '_' . $newfiletmp; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); @@ -288,11 +288,11 @@ class doc_generic_stock_odt extends ModelePDFStock if ($format == '1') { $format = '%Y%m%d%H%M%S'; } - $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; + $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; } else { - $filename = $newfiletmp.'.'.$newfileformat; + $filename = $newfiletmp . '.' . $newfileformat; } - $file = $dir.'/'.$filename; + $file = $dir . '/' . $filename; //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; @@ -300,8 +300,8 @@ class doc_generic_stock_odt extends ModelePDFStock dol_mkdir($conf->product->dir_temp); if (!is_writable($conf->product->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->product->dir_temp; - dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->product->dir_temp); + dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); return -1; } diff --git a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php index a9a8f612578..4e577795ceb 100644 --- a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php +++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php @@ -262,7 +262,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders $newfiletmp = preg_replace('/\.od(t|s)/i', '', $newfile); $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); - $newfiletmp = $objectref.'_'.$newfiletmp; + $newfiletmp = $objectref . '_' . $newfiletmp; //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); @@ -271,11 +271,11 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders if ($format == '1') { $format = '%Y%m%d%H%M%S'; } - $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; + $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; } else { - $filename = $newfiletmp.'.'.$newfileformat; + $filename = $newfiletmp . '.' . $newfileformat; } - $file = $dir.'/'.$filename; + $file = $dir . '/' . $filename; //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; @@ -283,8 +283,8 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders dol_mkdir($conf->fournisseur->commande->dir_temp); if (!is_writable($conf->fournisseur->commande->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->fournisseur->commande->dir_temp; - dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->fournisseur->commande->dir_temp); + dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); return -1; } diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index 82475f7a016..b8148a35c5d 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -297,7 +297,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); - $newfiletmp = $objectref.'_'.$newfiletmp; + $newfiletmp = $objectref . '_' . $newfiletmp; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); @@ -306,11 +306,11 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal if ($format == '1') { $format = '%Y%m%d%H%M%S'; } - $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; + $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; } else { - $filename = $newfiletmp.'.'.$newfileformat; + $filename = $newfiletmp . '.' . $newfileformat; } - $file = $dir.'/'.$filename; + $file = $dir . '/' . $filename; //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; @@ -318,8 +318,8 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal dol_mkdir($conf->supplier_proposal->dir_temp); if (!is_writable($conf->supplier_proposal->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->supplier_proposal->dir_temp; - dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->supplier_proposal->dir_temp); + dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); return -1; } diff --git a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php index cf358cae606..706977f72e6 100644 --- a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php +++ b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php @@ -266,7 +266,7 @@ class doc_generic_ticket_odt extends ModelePDFTicket $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); - $newfiletmp = $objectref.'_'.$newfiletmp; + $newfiletmp = $objectref . '_' . $newfiletmp; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); @@ -275,11 +275,11 @@ class doc_generic_ticket_odt extends ModelePDFTicket if ($format == '1') { $format = '%Y%m%d%H%M%S'; } - $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; + $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; } else { - $filename = $newfiletmp.'.'.$newfileformat; + $filename = $newfiletmp . '.' . $newfileformat; } - $file = $dir.'/'.$filename; + $file = $dir . '/' . $filename; //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; @@ -287,8 +287,8 @@ class doc_generic_ticket_odt extends ModelePDFTicket dol_mkdir($conf->ticket->dir_temp); if (!is_writable($conf->ticket->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->ticket->dir_temp; - dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->ticket->dir_temp); + dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); return -1; } diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index 0c9f5263e09..505d68f0441 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -297,7 +297,7 @@ class doc_generic_user_odt extends ModelePDFUser $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); - $newfiletmp = $objectref.'_'.$newfiletmp; + $newfiletmp = $objectref . '_' . $newfiletmp; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); @@ -306,11 +306,11 @@ class doc_generic_user_odt extends ModelePDFUser if ($format == '1') { $format = '%Y%m%d%H%M%S'; } - $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; + $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; } else { - $filename = $newfiletmp.'.'.$newfileformat; + $filename = $newfiletmp . '.' . $newfileformat; } - $file = $dir.'/'.$filename; + $file = $dir . '/' . $filename; //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; @@ -318,8 +318,8 @@ class doc_generic_user_odt extends ModelePDFUser dol_mkdir($conf->user->dir_temp); if (!is_writable($conf->user->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->user->dir_temp; - dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->user->dir_temp); + dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); return -1; } diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index 188cff00216..d56d8f8d4d1 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -281,7 +281,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); - $newfiletmp = $objectref.'_'.$newfiletmp; + $newfiletmp = $objectref . '_' . $newfiletmp; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); @@ -290,11 +290,11 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup if ($format == '1') { $format = '%Y%m%d%H%M%S'; } - $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; + $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; } else { - $filename = $newfiletmp.'.'.$newfileformat; + $filename = $newfiletmp . '.' . $newfileformat; } - $file = $dir.'/'.$filename; + $file = $dir . '/' . $filename; //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; @@ -302,8 +302,8 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup dol_mkdir($conf->user->dir_temp); if (!is_writable($conf->user->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->user->dir_temp; - dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->user->dir_temp); + dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); return -1; } diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index 65a3275dab7..6bedf368e97 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -474,6 +474,7 @@ if ($action == 'confirm_crop') { * View */ +$head = ''; $title = $langs->trans("ImageEditor"); $morejs = array('/includes/jquery/plugins/jcrop/js/jquery.Jcrop.min.js', '/core/js/lib_photosresize.js'); $morecss = array('/includes/jquery/plugins/jcrop/css/jquery.Jcrop.css'); @@ -505,8 +506,8 @@ print ''; print '
'; print ''.$langs->trans("Resize").''; print $langs->trans("ResizeDesc").'
'; -print $langs->trans("NewLength").': px   '.$langs->trans("or").'   '; -print $langs->trans("NewHeight").': px  
'; +print $langs->trans("NewLength").': px   '.$langs->trans("or").'   '; +print $langs->trans("NewHeight").': px  
'; print ''; print ''; @@ -564,12 +565,12 @@ if (!empty($conf->use_javascript_ajax)) { print '
'.$langs->trans("NewSizeAfterCropping").': - - - - - - +   +   +   +   +   +  
diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 9e0a38bee39..0376a5e85c9 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -147,7 +147,8 @@ if ($action == 'presend') { $formmail->fromtype = 'special'; } - $formmail->trackid = $trackid; + $formmail->trackid = empty($trackid) ? '' : $trackid; + $formmail->inreplyto = empty($inreplyto) ? '' : $inreplyto; $formmail->withfrom = 1; // Fill list of recipient with email inside <>. diff --git a/htdocs/core/tpl/onlinepaymentlinks.tpl.php b/htdocs/core/tpl/onlinepaymentlinks.tpl.php index e355f9654a3..657d32a0a36 100644 --- a/htdocs/core/tpl/onlinepaymentlinks.tpl.php +++ b/htdocs/core/tpl/onlinepaymentlinks.tpl.php @@ -141,21 +141,11 @@ if (!empty($conf->don->enabled)) { print '
'; } -if (!empty($conf->use_javascript_ajax)) { - print "\n".''; -} +$constname = 'PAYMENT_SECURITY_TOKEN'; + +// Add button to autosuggest a key +include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; +print dolJSToSetRandomPassword($constname); print info_admin($langs->trans("YouCanAddTagOnUrl")); diff --git a/htdocs/cron/admin/cron.php b/htdocs/cron/admin/cron.php index ff413a8a1c2..d214c112aa3 100644 --- a/htdocs/cron/admin/cron.php +++ b/htdocs/cron/admin/cron.php @@ -129,22 +129,11 @@ dol_print_cron_urls(); print '
'; -if (!empty($conf->use_javascript_ajax)) { - print "\n".''; -} +$constname = 'CRON_KEY'; + +// Add button to autosuggest a key +include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; +print dolJSToSetRandomPassword($constname); llxFooter(); $db->close(); diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 9a60624e9d2..4f95a44652e 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -111,12 +111,13 @@ class EmailCollector extends CommonObject public $fields = array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>2, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20), - 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'help'=>'Example: MyCollector1', 'csslist'=>'tdoverflowmax250'), + 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'help'=>'Example: MyCollector1', 'csslist'=>'tdoverflowmax200'), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1, 'help'=>'Example: My Email collector', 'csslist'=>'tdoverflowmax150'), 'description' => array('type'=>'text', 'label'=>'Description', 'visible'=>-1, 'enabled'=>1, 'position'=>60, 'notnull'=>-1, 'csslist'=>'small'), 'host' => array('type'=>'varchar(255)', 'label'=>'EMailHost', 'visible'=>1, 'enabled'=>1, 'position'=>90, 'notnull'=>1, 'searchall'=>1, 'comment'=>"IMAP server", 'help'=>'Example: imap.gmail.com', 'csslist'=>'tdoverflow125'), - 'hostcharset' => array('type'=>'varchar(16)', 'label'=>'HostCharset', 'visible'=>-1, 'enabled'=>1, 'position'=>91, 'notnull'=>0, 'searchall'=>0, 'comment'=>"IMAP server charset", 'help'=>'Example: "UTF-8" (May be "US-ASCII" with some Office365)'), - 'login' => array('type'=>'varchar(128)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'position'=>101, 'notnull'=>-1, 'index'=>1, 'comment'=>"IMAP login", 'help'=>'Example: myaccount@gmail.com'), + 'port' => array('type'=>'varchar(10)', 'label'=>'EMailHostPort', 'visible'=>1, 'enabled'=>1, 'position'=>91, 'notnull'=>1, 'searchall'=>0, 'comment'=>"IMAP server port", 'help'=>'Example: 993', 'csslist'=>'tdoverflow125', 'default'=>'993'), + 'hostcharset' => array('type'=>'varchar(16)', 'label'=>'HostCharset', 'visible'=>-1, 'enabled'=>1, 'position'=>92, 'notnull'=>0, 'searchall'=>0, 'comment'=>"IMAP server charset", 'help'=>'Example: "UTF-8" (May be "US-ASCII" with some Office365)', 'default'=>'UTF-8'), + 'login' => array('type'=>'varchar(128)', 'label'=>'Login', 'visible'=>-1, 'enabled'=>1, 'position'=>101, 'notnull'=>-1, 'index'=>1, 'comment'=>"IMAP login", 'help'=>'Example: myaccount@gmail.com'), 'password' => array('type'=>'password', 'label'=>'Password', 'visible'=>-1, 'enabled'=>1, 'position'=>102, 'notnull'=>-1, 'comment'=>"IMAP password", 'help'=>'WithGMailYouCanCreateADedicatedPassword'), 'source_directory' => array('type'=>'varchar(255)', 'label'=>'MailboxSourceDirectory', 'visible'=>-1, 'enabled'=>1, 'position'=>103, 'notnull'=>1, 'default' => 'Inbox', 'help'=>'Example: INBOX'), //'filter' => array('type'=>'text', 'label'=>'Filter', 'visible'=>1, 'enabled'=>1, 'position'=>105), @@ -193,6 +194,7 @@ class EmailCollector extends CommonObject public $host; + public $port; public $hostcharset; public $login; public $password; @@ -746,7 +748,7 @@ class EmailCollector extends CommonObject $flags .= '/authuser='.$partofauth[0].'/user='.$partofauth[1]; } - $connectstringserver = '{'.$this->host.':993'.$flags.'}'; + $connectstringserver = '{'.$this->host.':'.$this->port.$flags.'}'; return $connectstringserver; } @@ -1854,8 +1856,8 @@ class EmailCollector extends CommonObject $actioncomm->label = $langs->trans("ActionAC_".$actioncode).' - '.$langs->trans("MailFrom").' '.$from; $actioncomm->note_private = $descriptionfull; $actioncomm->fk_project = $projectstatic->id; - $actioncomm->datep = $date; - $actioncomm->datef = $date; + $actioncomm->datep = $date; // date of email + $actioncomm->datef = $date; // date of email $actioncomm->percentage = -1; // Not applicable $actioncomm->socid = $thirdpartystatic->id; $actioncomm->contact_id = $contactstatic->id; @@ -2102,7 +2104,7 @@ class EmailCollector extends CommonObject $percent_opp_status = dol_getIdFromCode($this->db, 'PROSP', 'c_lead_status', 'code', 'percent'); $projecttocreate->title = $subject; - $projecttocreate->date_start = $date; + $projecttocreate->date_start = $date; // date of email $projecttocreate->date_end = ''; $projecttocreate->opp_status = $id_opp_status; $projecttocreate->opp_percent = $percent_opp_status; @@ -2210,12 +2212,13 @@ class EmailCollector extends CommonObject $tickettocreate->severity_code = (!empty($conf->global->MAIN_EMAILCOLLECTOR_TICKET_SEVERITY_CODE) ? $conf->global->MAIN_EMAILCOLLECTOR_TICKET_SEVERITY_CODE : dol_getIdFromCode($this->db, 1, 'c_ticket_severity', 'use_default', 'code', 1)); $tickettocreate->origin_email = $from; $tickettocreate->fk_user_create = $user->id; - $tickettocreate->datec = $date; + $tickettocreate->datec = dol_now(); $tickettocreate->fk_project = $projectstatic->id; $tickettocreate->notify_tiers_at_create = 0; $tickettocreate->note_private = $descriptionfull; $tickettocreate->entity = $conf->entity; $tickettocreate->email_msgid = $msgid; + $tickettocreate->email_date = $date; //$tickettocreate->fk_contact = $contactstatic->id; $savesocid = $tickettocreate->socid; @@ -2310,12 +2313,13 @@ class EmailCollector extends CommonObject $candidaturetocreate->email = $from; //$candidaturetocreate->lastname = $langs->trans("Anonymous").' - '.$from; $candidaturetocreate->fk_user_creat = $user->id; - $candidaturetocreate->date_creation = $date; + $candidaturetocreate->date_creation = dol_now(); $candidaturetocreate->fk_project = $projectstatic->id; $candidaturetocreate->description = $description; $candidaturetocreate->note_private = $descriptionfull; $candidaturetocreate->entity = $conf->entity; $candidaturetocreate->email_msgid = $msgid; + $candidaturetocreate->email_date = $date; // date of email $candidaturetocreate->status = $candidaturetocreate::STATUS_DRAFT; //$candidaturetocreate->fk_contact = $contactstatic->id; diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 3df55ff48f3..a2eb140c789 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -105,8 +105,8 @@ class ConferenceOrBooth extends ActionComm public $fields = array( 'id' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'integer', 'label'=>'Ref', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), - 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'csslist'=>'tdoverflowmax125', 'help'=>"Help text", 'showoncombobox'=>'1',), - 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'), + 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'csslist'=>'tdoverflowmax125', 'help'=>"OrganizationEvenLabelName", 'showoncombobox'=>'1',), + 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"OrganizationEventLinkToThirdParty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'), 'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1), 'fk_action' => array('type'=>'sellist:c_actioncomm:libelle:id::module LIKE (\'%@eventorganization\')', 'label'=>'Format', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>1, 'css'=>'width300'), diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 0d5991bb0ac..ac64a16602f 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -185,7 +185,9 @@ if (!empty($withproject)) { // Tabs for project $tab = 'eventorganisation'; $withProjectUrl = "&withproject=1"; + $head = project_prepare_head($projectstatic); + print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', ''); $param = ($mode == 'mine' ? '&mode=mine' : ''); @@ -468,6 +470,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $res = $object->fetch_optionals(); $head = conferenceorboothPrepareHead($object, $withproject); + print dol_get_fiche_head($head, 'card', $langs->trans("ConferenceOrBooth"), -1, $object->picto); $formconfirm = ''; diff --git a/htdocs/eventorganization/conferenceorbooth_document.php b/htdocs/eventorganization/conferenceorbooth_document.php index 739e6f81036..4a5b368df02 100644 --- a/htdocs/eventorganization/conferenceorbooth_document.php +++ b/htdocs/eventorganization/conferenceorbooth_document.php @@ -58,7 +58,7 @@ $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("pa if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$offset = $liste_limit * $page; +$offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (!$sortorder) { diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 972e546255f..c1626f7bbf3 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -947,7 +947,7 @@ if ($num == 0) { $colspan++; } } - print '
'; + print ''; } diff --git a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php index 6a76a14a38c..8d0f442e900 100644 --- a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php +++ b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php @@ -47,12 +47,12 @@ function conferenceorboothPrepareHead($object, $with_project = 0) $head[$h][2] = 'card'; $h++; - /* - $head[$h][0] = DOL_URL_ROOT.'/eventorganization/conferenceorbooth_contact.php?id='.$object->id.$withProjectUrl; - $head[$h][1] = $langs->trans("ContactsAddresses"); - $head[$h][2] = 'contact'; - $h++; - */ + if (!empty($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL >= 2) { + $head[$h][0] = DOL_URL_ROOT.'/eventorganization/conferenceorbooth_contact.php?id='.$object->id.$withProjectUrl; + $head[$h][1] = $langs->trans("ContactsAddresses"); + $head[$h][2] = 'contact'; + $h++; + } /* $head[$h][0] = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php?conforboothid='.$object->id.$withProjectUrl; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index ef71f01e228..d8bb62f6b5d 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -316,7 +316,7 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; // Add GroupBy from hooks -$parameters = array('all' => $all, 'fieldstosearchall' => $fieldstosearchall); +$parameters = array('search_all' => $sall, 'fieldstosearchall' => $fieldstosearchall); $reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; @@ -692,7 +692,7 @@ while ($i < $imaxinloop) { print '
'.$langs->trans("NoRecordFound").'
'.$langs->trans("NoRecordFound").'
'; // Picto + Ref - print ''; // Warning @@ -726,7 +726,7 @@ while ($i < $imaxinloop) { if (!empty($arrayfields['f.ref_client']['checked'])) { // Customer ref print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 6d026272cc7..8d03dbb387c 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -7,7 +7,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2018-2021 Frédéric France - * Copyright (C) 2018-2020 Charlene Benke + * Copyright (C) 2018-2022 Charlene Benke * Copyright (C) 2019 Nicolas Zabouri * Copyright (C) 2021 Alexandre Spangaro * @@ -1557,6 +1557,7 @@ if ($resql) { $totalarray = array('nbfield' => 0, 'val' => array(), 'pos' => array()); $totalarray['val']['cf.total_ht'] = 0; $totalarray['val']['cf.total_ttc'] = 0; + $totalarray['val']['cf.total_tva'] = 0; $imaxinloop = ($limit ? min($num, $limit) : $num); while ($i < $imaxinloop) { diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 4df04f30f70..0a54792c665 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -635,7 +635,7 @@ if (!$search_all) { $sql .= ' f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc,'; $sql .= " f.note_public, f.note_private,"; $sql .= " f.fk_user_author,"; - $sql .= ' s.rowid, s.nom, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,'; + $sql .= ' s.rowid, s.nom, s.name_alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,'; $sql .= " typent.code,"; $sql .= " state.code_departement, state.nom,"; $sql .= ' country.code,'; @@ -1012,7 +1012,7 @@ if ($resql) { } // Thirpdarty if (!empty($arrayfields['s.nom']['checked'])) { - print ''; + print ''; } // Alias if (!empty($arrayfields['s.name_alias']['checked'])) { diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index 626703d4b68..4df7e1512a6 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -27,6 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/ftp.lib.php'; // Load translation files required by the page $langs->loadLangs(array('companies', 'other')); @@ -130,6 +131,39 @@ if (GETPOST("sendit") && !empty($conf->global->MAIN_UPLOAD_DOC)) { } } +if ($action == 'uploadfile') { + // set up a connection or die + if (!$conn_id) { + $newsectioniso = utf8_decode($section); + $resultarray = dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $newsectioniso, $ftp_passive); + $conn_id = $resultarray['conn_id']; + $ok = $resultarray['ok']; + $mesg = $resultarray['mesg']; + } + if ($conn_id && $ok && !$mesg) { + // var_dump($_FILES['userfile']['name']); + $nbfile = count($_FILES['userfile']['name']); + $i = 0; + for (; $i < $nbfile; $i++) { + var_dump($i); + $newsection = $newsectioniso; + $fileupload = $_FILES['userfile']['name'][$i]; + $fileuploadpath = $_FILES['userfile']['tmp_name'][$i]; + $result = dol_ftp_put($conn_id, $fileupload, $fileuploadpath, $newsection); + + if ($result) { + setEventMessages($langs->trans("FileWasUpload", $fileupload), null, 'mesgs'); + } else { + dol_syslog("ftp/index.php ftp_delete", LOG_ERR); + setEventMessages($langs->trans("FTPFailedToUploadFile", $fileupload), null, 'errors'); + } + } + $action = ''; + } else { + dol_print_error('', $mesg); + } +} + // Action ajout d'un rep if ($action == 'add' && $user->rights->ftp->setup) { $ecmdir->ref = GETPOST("ref"); @@ -159,24 +193,8 @@ if ($action == 'confirm_deletefile' && GETPOST('confirm') == 'yes') { if ($conn_id && $ok && !$mesg) { $newsection = $section; - if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) { - $newsection = ssh2_sftp_realpath($conn_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169 - } + $result = dol_ftp_delete($conn_id, $file, $newsection); - $langs->load("other"); - - // Remote file - $filename = $file; - $remotefile = $newsection.(preg_match('@[\\\/]$@', $newsection) ? '' : '/').$file; - $newremotefileiso = utf8_decode($remotefile); - - //print "x".$newremotefileiso; - dol_syslog("ftp/index.php ftp_delete ".$newremotefileiso); - if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) { - $result = ssh2_sftp_unlink($conn_id, $newremotefileiso); - } else { - $result = @ftp_delete($conn_id, $newremotefileiso); - } if ($result) { setEventMessages($langs->trans("FileWasRemoved", $file), null, 'mesgs'); } else { @@ -184,8 +202,6 @@ if ($action == 'confirm_deletefile' && GETPOST('confirm') == 'yes') { setEventMessages($langs->trans("FTPFailedToRemoveFile", $file), null, 'errors'); } - //ftp_close($conn_id); Close later - $action = ''; } else { dol_print_error('', $mesg); @@ -205,25 +221,15 @@ if (GETPOST("const", 'array') && GETPOST("delete") && GETPOST("delete") == $lang if ($conn_id && $ok && !$mesg) { foreach (GETPOST('const', 'array') as $const) { - if ($const["check"]) { // Is checkbox checked + if (isset($const["check"])) { // Is checkbox checked $langs->load("other"); // Remote file $file = $const["file"]; $newsection = $const["section"]; - if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) { - $newsection = ssh2_sftp_realpath($conn_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169 - } - $remotefile = $newsection.(preg_match('@[\\\/]$@', $newsection) ? '' : '/').$file; - $newremotefileiso = utf8_decode($remotefile); - //print "x".$newremotefileiso; - dol_syslog("ftp/index.php ftp_delete n files for ".$newremotefileiso); - if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) { - $result = ssh2_sftp_unlink($conn_id, $newremotefileiso); - } else { - $result = @ftp_delete($conn_id, $newremotefileiso); - } + $result = dol_ftp_delete($conn_id, $file, $newsection); + if ($result) { setEventMessages($langs->trans("FileWasRemoved", $file), null, 'mesgs'); } else { @@ -254,20 +260,9 @@ if ($action == 'confirm_deletesection' && $confirm == 'yes') { if ($conn_id && $ok && !$mesg) { $newsection = $section; - if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) { - $newsection = ssh2_sftp_realpath($conn_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169 - } - // Remote file - $filename = $file; - $remotefile = $newsection.(preg_match('@[\\\/]$@', $newsection) ? '' : '/').$file; - $newremotefileiso = utf8_decode($remotefile); + $result = dol_ftp_rmdir($conn_id, $file, $newsection); - if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) { - $result = ssh2_sftp_rmdir($conn_id, $newremotefileiso); - } else { - $result = @ftp_rmdir($conn_id, $newremotefileiso); - } if ($result) { setEventMessages($langs->trans("DirWasRemoved", $file), null, 'mesgs'); } else { @@ -298,20 +293,10 @@ if ($action == 'download') { $localfile = tempnam($download_dir, 'dol_'); $newsection = $section; - if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) { - $newsection = ssh2_sftp_realpath($conn_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169 - } - // Remote file - $filename = $file; - $remotefile = $newsection.(preg_match('@[\\\/]$@', $newsection) ? '' : '/').$file; - $newremotefileiso = utf8_decode($remotefile); + $result = dol_ftp_get($connect_id, $file, $newsection); + - if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) { - $result = fopen('ssh2.sftp://'.intval($conn_id).$newremotefileiso, 'r'); - } else { - $result = ftp_get($conn_id, $localfile, $newremotefileiso, FTP_BINARY); - } if ($result) { if (!empty($conf->global->MAIN_UMASK)) { @chmod($localfile, octdec($conf->global->MAIN_UMASK)); @@ -344,8 +329,6 @@ if ($action == 'download') { readfile($localfile); - ftp_close($conn_id); - exit; } else { setEventMessages($langs->transnoentitiesnoconv('FailedToGetFile', $remotefile), null, 'errors'); @@ -409,12 +392,12 @@ if (!function_exists('ftp_connect')) { if (!empty($ftp_server)) { // Confirm remove file if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'§ion='.urlencode(GETPOST('section')).'&file='.urlencode(GETPOST('file')), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', '', 1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'§ion='.urlencode(GETPOST('section')).'&file='.urlencode(GETPOST('file')), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile', GETPOST('file')), 'confirm_deletefile', '', '', 1); } // Confirmation de la suppression d'une ligne categorie if ($action == 'delete_section') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'§ion='.urlencode(GETPOST('section')).'&file='.urlencode(GETPOST('file')), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection', $ecmdir->label), 'confirm_deletesection', '', '', 1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'§ion='.urlencode(GETPOST('section')).'&file='.urlencode(GETPOST('file')), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection', GETPOST('file')), 'confirm_deletesection', '', '', 1); } print $langs->trans("Server").': '.$ftp_server.'
'; @@ -504,8 +487,6 @@ if (!function_exists('ftp_connect')) { } else { $buff = ftp_rawlist($conn_id, $newsectioniso); $contents = ftp_nlist($conn_id, $newsectioniso); // Sometimes rawlist fails but never nlist - //var_dump($contents); - //var_dump($buff); } $nboflines = count($contents); @@ -515,7 +496,6 @@ if (!function_exists('ftp_connect')) { while ($i < $nboflines && $i < 1000) { $vals = preg_split('@ +@', utf8_encode($buff[$i]), 9); //$vals=preg_split('@ +@','drwxr-xr-x 2 root root 4096 Aug 30 2008 backup_apollon1',9); - //var_dump($vals); $file = $vals[8]; if (empty($file)) { $rawlisthasfailed = true; @@ -642,6 +622,18 @@ if (!function_exists('ftp_connect')) { print ''; print ""; + if ($user->hasRight('ftp', 'write')) { + print load_fiche_titre($langs->trans("AttachANewFile"), null, null); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + } } else { $foundsetup = false; $MAXFTP = 20; @@ -665,127 +657,14 @@ if (!function_exists('ftp_connect')) { print '
'; -// Close FTP connection -if ($conn_id) { - if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) { - } elseif (!empty($conf->global->FTP_CONNECT_WITH_SSL)) { - ftp_close($conn_id); - } else { - ftp_close($conn_id); +if (!empty($conn_id)) { + $disconnect = dol_ftp_close($conn_id); + + if ($disconnect == false) { + setEventMessages($langs->trans("ErrorFTPNodisconnect"), null, 'errors'); } } // End of page llxFooter(); $db->close(); - - - -/** - * Connect to FTP server - * - * @param string $ftp_server Server name - * @param string $ftp_port Server port - * @param string $ftp_user FTP user - * @param string $ftp_password FTP password - * @param string $section Directory - * @param integer $ftp_passive Use a passive mode - * @return int <0 if OK, >0 if KO - */ -function dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $section, $ftp_passive = 0) -{ - global $langs, $conf; - - $ok = 1; - $error = 0; - $conn_id = null; - $newsectioniso = ''; - $mesg=""; - - if (!is_numeric($ftp_port)) { - $mesg = $langs->transnoentitiesnoconv("FailedToConnectToFTPServer", $ftp_server, $ftp_port); - $ok = 0; - } - - if ($ok) { - $connecttimeout = (empty($conf->global->FTP_CONNECT_TIMEOUT) ? 40 : $conf->global->FTP_CONNECT_TIMEOUT); - if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) { - dol_syslog('Try to connect with ssh2_connect'); - $tmp_conn_id = ssh2_connect($ftp_server, $ftp_port); - } elseif (!empty($conf->global->FTP_CONNECT_WITH_SSL)) { - dol_syslog('Try to connect with ftp_ssl_connect'); - $conn_id = ftp_ssl_connect($ftp_server, $ftp_port, $connecttimeout); - } else { - dol_syslog('Try to connect with ftp_connect'); - $conn_id = ftp_connect($ftp_server, $ftp_port, $connecttimeout); - } - if (!empty($conn_id) || !empty($tmp_conn_id)) { - if ($ftp_user) { - if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) { - dol_syslog('Try to authenticate with ssh2_auth_password'); - if (ssh2_auth_password($tmp_conn_id, $ftp_user, $ftp_password)) { - // Turn on passive mode transfers (must be after a successful login - //if ($ftp_passive) ftp_pasv($conn_id, true); - - // Change the dir - $newsectioniso = utf8_decode($section); - //ftp_chdir($conn_id, $newsectioniso); - $conn_id = ssh2_sftp($tmp_conn_id); - if (!$conn_id) { - dol_syslog('Failed to connect to SFTP after sssh authentication', LOG_DEBUG); - $mesg = $langs->transnoentitiesnoconv("FailedToConnectToSFTPAfterSSHAuthentication"); - $ok = 0; - $error++; - } - } else { - dol_syslog('Failed to connect to FTP with login '.$ftp_user, LOG_DEBUG); - $mesg = $langs->transnoentitiesnoconv("FailedToConnectToFTPServerWithCredentials"); - $ok = 0; - $error++; - } - } else { - if (ftp_login($conn_id, $ftp_user, $ftp_password)) { - // Turn on passive mode transfers (must be after a successful login - if ($ftp_passive) { - ftp_pasv($conn_id, true); - } - - // Change the dir - $newsectioniso = utf8_decode($section); - ftp_chdir($conn_id, $newsectioniso); - } else { - $mesg = $langs->transnoentitiesnoconv("FailedToConnectToFTPServerWithCredentials"); - $ok = 0; - $error++; - } - } - } - } else { - dol_syslog('FailedToConnectToFTPServer '.$ftp_server.' '.$ftp_port, LOG_ERR); - $mesg = $langs->transnoentitiesnoconv("FailedToConnectToFTPServer", $ftp_server, $ftp_port); - $ok = 0; - } - } - - $arrayresult = array('conn_id'=>$conn_id, 'ok'=>$ok, 'mesg'=>$mesg, 'curdir'=>$section, 'curdiriso'=>$newsectioniso); - return $arrayresult; -} - - -/** - * Tell if an entry is a FTP directory - * - * @param resource $connect_id Connection handler - * @param string $dir Directory - * @return int 1=directory, 0=not a directory - */ -function ftp_isdir($connect_id, $dir) -{ - if (@ftp_chdir($connect_id, $dir)) { - ftp_cdup($connect_id); - return 1; - } else { - return 0; - } -} - diff --git a/htdocs/hrm/evaluation_document.php b/htdocs/hrm/evaluation_document.php index 215756eff8b..cf93c75edbf 100644 --- a/htdocs/hrm/evaluation_document.php +++ b/htdocs/hrm/evaluation_document.php @@ -54,7 +54,7 @@ $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("pa if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$offset = $liste_limit * $page; +$offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (!$sortorder) { diff --git a/htdocs/hrm/job_document.php b/htdocs/hrm/job_document.php index 83745962052..0e4d34e0412 100644 --- a/htdocs/hrm/job_document.php +++ b/htdocs/hrm/job_document.php @@ -52,7 +52,7 @@ $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("pa if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$offset = $liste_limit * $page; +$offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (!$sortorder) { diff --git a/htdocs/hrm/position_document.php b/htdocs/hrm/position_document.php index eb4ac0e68ce..c51f2204441 100644 --- a/htdocs/hrm/position_document.php +++ b/htdocs/hrm/position_document.php @@ -53,7 +53,7 @@ $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("pa if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$offset = $liste_limit * $page; +$offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (!$sortorder) { diff --git a/htdocs/hrm/skill_document.php b/htdocs/hrm/skill_document.php index f305ecd1e2e..c0fe492be06 100644 --- a/htdocs/hrm/skill_document.php +++ b/htdocs/hrm/skill_document.php @@ -53,7 +53,7 @@ $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("pa if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$offset = $liste_limit * $page; +$offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (!$sortorder) { diff --git a/htdocs/hrm/skill_tab.php b/htdocs/hrm/skill_tab.php index b2ac9e6bce1..52c45c72848 100644 --- a/htdocs/hrm/skill_tab.php +++ b/htdocs/hrm/skill_tab.php @@ -152,8 +152,6 @@ if (empty($reshook)) { /* * View - * - * Put here all code to build page */ $form = new Form($db); @@ -216,9 +214,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // ------------------------------------------------------------ $linkback = '' . $langs->trans("BackToList") . ''; - $morehtmlref = '
'; - if (isset($object->label)) $morehtmlref.= $object->label; - $morehtmlref .= '
'; + $morehtmlref = ''; + $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"'); + $morehtmlref .= ''; dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref, '&objecttype='.$objecttype); diff --git a/htdocs/includes/tecnickcom/tcpdf/tcpdf_barcodes_1d.php b/htdocs/includes/tecnickcom/tcpdf/tcpdf_barcodes_1d.php index 78bfc5b5bf4..2fea49ef4ce 100644 --- a/htdocs/includes/tecnickcom/tcpdf/tcpdf_barcodes_1d.php +++ b/htdocs/includes/tecnickcom/tcpdf/tcpdf_barcodes_1d.php @@ -1337,14 +1337,14 @@ class TCPDFBarcode { // calculate check digit $sum_a = 0; for ($i = 1; $i < $data_len; $i+=2) { - $sum_a += $code[$i]; + $sum_a += (int) $code[$i]; } if ($len > 12) { $sum_a *= 3; } $sum_b = 0; for ($i = 0; $i < $data_len; $i+=2) { - $sum_b += ($code[$i]); + $sum_b += (int) ($code[$i]); } if ($len < 13) { $sum_b *= 3; @@ -2171,7 +2171,7 @@ class TCPDFBarcode { /** * IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200 - * + * * @param $code (string) pre-formatted IMB barcode (65 chars "FADT") * @return array barcode representation. * @protected diff --git a/htdocs/index.php b/htdocs/index.php index 6ada359cee6..6715577e615 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -162,21 +162,21 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { } // Number of project opened - if (!empty($conf->project->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && $user->rights->projet->lire) { + if (!empty($conf->project->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && $user->hasRight('projet', 'lire')) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $board = new Project($db); $dashboardlines[$board->element] = $board->load_board($user); } // Number of tasks to do (late) - if (!empty($conf->project->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && empty($conf->global->PROJECT_HIDE_TASKS) && $user->rights->projet->lire) { + if (isModEnabled('project') && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && empty($conf->global->PROJECT_HIDE_TASKS) && $user->hasRight('projet', 'lire')) { include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; $board = new Task($db); $dashboardlines[$board->element] = $board->load_board($user); } // Number of commercial customer proposals open (expired) - if (!empty($conf->propal->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->rights->propale->lire) { + if (isModEnabled('propal') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->hasRight('propale', 'lire')) { include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; $board = new Propal($db); $dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened"); @@ -185,7 +185,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { } // Number of supplier proposals open (expired) - if (!empty($conf->supplier_proposal->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && $user->rights->supplier_proposal->lire) { + if (isModEnabled('supplier_proposal') && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && $user->hasRight('supplier_proposal', 'lire')) { $langs->load("supplier_proposal"); include_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; $board = new SupplierProposal($db); @@ -195,14 +195,14 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { } // Number of customer orders a deal - if (!empty($conf->commande->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->rights->commande->lire) { + if (isModEnabled('commande') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->hasRight('commande', 'lire')) { include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; $board = new Commande($db); $dashboardlines[$board->element] = $board->load_board($user); } // Number of suppliers orders a deal - if (!empty($conf->supplier_order->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && $user->rights->fournisseur->commande->lire) { + if (isModEnabled('supplier_order') && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && $user->rights->fournisseur->commande->lire) { include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; $board = new CommandeFournisseur($db); $dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened"); @@ -210,7 +210,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { } // Number of contract / services enabled (delayed) - if (!empty($conf->contrat->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_CONTRACT) && $user->rights->contrat->lire) { + if (isModEnabled('contrat') && empty($conf->global->MAIN_DISABLE_BLOCK_CONTRACT) && $user->hasRight('contrat', 'lire')) { include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; $board = new Contrat($db); $dashboardlines[$board->element.'_inactive'] = $board->load_board($user, "inactive"); @@ -219,7 +219,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { } // Number of tickets open - if (!empty($conf->ticket->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_TICKET) && $user->rights->ticket->read) { + if (isModEnabled('ticket') && empty($conf->global->MAIN_DISABLE_BLOCK_TICKET) && $user->hasRight('ticket', 'read')) { include_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; $board = new Ticket($db); $dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened"); @@ -228,21 +228,21 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { } // Number of invoices customers (paid) - if (isModEnabled('facture') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->rights->facture->lire) { + if (isModEnabled('facture') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->hasRight('facture', 'lire')) { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $board = new Facture($db); $dashboardlines[$board->element] = $board->load_board($user); } // Number of supplier invoices (paid) - if (!empty($conf->supplier_invoice->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && !empty($user->rights->fournisseur->facture->lire)) { + if (isModEnabled('supplier_invoice') && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && !empty($user->rights->fournisseur->facture->lire)) { include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; $board = new FactureFournisseur($db); $dashboardlines[$board->element] = $board->load_board($user); } // Number of transactions to conciliate - if (!empty($conf->banque->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_BANK) && $user->rights->banque->lire && !$user->socid) { + if (isModEnabled('banque') && empty($conf->global->MAIN_DISABLE_BLOCK_BANK) && $user->hasRight('banque', 'lire') && !$user->socid) { include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $board = new Account($db); $nb = $board->countAccountToReconcile(); // Get nb of account to reconciliate @@ -253,7 +253,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { // Number of cheque to send - if (!empty($conf->banque->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_BANK) && $user->rights->banque->lire && !$user->socid) { + if (isModEnabled('banque') && empty($conf->global->MAIN_DISABLE_BLOCK_BANK) && $user->hasRight('banque', 'lire') && !$user->socid) { if (empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT)) { include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; $board = new RemiseCheque($db); @@ -272,7 +272,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { } // Number of foundation members - if (!empty($conf->adherent->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_ADHERENT) && $user->rights->adherent->lire && !$user->socid) { + if (isModEnabled('adherent') && empty($conf->global->MAIN_DISABLE_BLOCK_ADHERENT) && $user->hasRight('adherent', 'lire') && !$user->socid) { include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; $board = new Adherent($db); $dashboardlines[$board->element.'_shift'] = $board->load_board($user, 'shift'); @@ -280,21 +280,21 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { } // Number of expense reports to approve - if (!empty($conf->expensereport->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_EXPENSEREPORT) && $user->rights->expensereport->approve) { + if (isModEnabled('expensereport') && empty($conf->global->MAIN_DISABLE_BLOCK_EXPENSEREPORT) && $user->hasRight('expensereport', 'approve')) { include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; $board = new ExpenseReport($db); $dashboardlines[$board->element.'_toapprove'] = $board->load_board($user, 'toapprove'); } // Number of expense reports to pay - if (!empty($conf->expensereport->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_EXPENSEREPORT) && $user->rights->expensereport->to_paid) { + if (isModEnabled('expensereport') && empty($conf->global->MAIN_DISABLE_BLOCK_EXPENSEREPORT) && $user->hasRight('expensereport', 'to_paid')) { include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; $board = new ExpenseReport($db); $dashboardlines[$board->element.'_topay'] = $board->load_board($user, 'topay'); } // Number of holidays to approve - if (!empty($conf->holiday->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_HOLIDAY) && $user->rights->holiday->approve) { + if (isModEnabled('holiday') && empty($conf->global->MAIN_DISABLE_BLOCK_HOLIDAY) && $user->hasRight('holiday', 'approve')) { include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; $board = new Holiday($db); $dashboardlines[$board->element] = $board->load_board($user); diff --git a/htdocs/install/doctemplates/websites/website_template-style03.jpg b/htdocs/install/doctemplates/websites/website_template-style03.jpg new file mode 100644 index 00000000000..1479f08b5d9 Binary files /dev/null and b/htdocs/install/doctemplates/websites/website_template-style03.jpg differ diff --git a/htdocs/install/doctemplates/websites/website_template-style03.zip b/htdocs/install/doctemplates/websites/website_template-style03.zip new file mode 100644 index 00000000000..1d6af1e04f4 Binary files /dev/null and b/htdocs/install/doctemplates/websites/website_template-style03.zip differ diff --git a/htdocs/install/mysql/data/llx_10_c_regions.sql b/htdocs/install/mysql/data/llx_10_c_regions.sql index 752bc7de395..ffd02aa9cf9 100644 --- a/htdocs/install/mysql/data/llx_10_c_regions.sql +++ b/htdocs/install/mysql/data/llx_10_c_regions.sql @@ -533,3 +533,5 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 2 INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 232, 23208, '', 0, 'Nor-Oriental'); INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 232, 23209, '', 0, 'Zuliana'); +-- Japan Region (id country=123) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 123, 12301, '', 0,'日本'); diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql index 642bd69960b..04522605d4a 100644 --- a/htdocs/install/mysql/data/llx_20_c_departements.sql +++ b/htdocs/install/mysql/data/llx_20_c_departements.sql @@ -1899,3 +1899,52 @@ INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('AE-5', 22701, '', 0, '', 'Ras al-Khaimah'); INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('AE-6', 22701, '', 0, '', 'Sharjah'); INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('AE-7', 22701, '', 0, '', 'Umm al-Quwain'); + +-- Japan 都道府県 (id country=123) +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '01', '', 0, '北海', '北海道', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '02', '', 0, '青森', '青森県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '03', '', 0, '岩手', '岩手県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '04', '', 0, '宮城', '宮城県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '05', '', 0, '秋田', '秋田県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '06', '', 0, '山形', '山形県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '07', '', 0, '福島', '福島県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '08', '', 0, '茨城', '茨城県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '09', '', 0, '栃木', '栃木県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '10', '', 0, '群馬', '群馬県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '11', '', 0, '埼玉', '埼玉県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '12', '', 0, '千葉', '千葉県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '13', '', 0, '東京', '東京都', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '14', '', 0, '神奈川', '神奈川県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '15', '', 0, '新潟', '新潟県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '16', '', 0, '富山', '富山県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '17', '', 0, '石川', '石川県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '18', '', 0, '福井', '福井県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '19', '', 0, '山梨', '山梨県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '20', '', 0, '長野', '長野県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '21', '', 0, '岐阜', '岐阜県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '22', '', 0, '静岡', '静岡県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '23', '', 0, '愛知', '愛知県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '24', '', 0, '三重', '三重県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '25', '', 0, '滋賀', '滋賀県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '26', '', 0, '京都', '京都府', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '27', '', 0, '大阪', '大阪府', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '28', '', 0, '兵庫', '兵庫県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '29', '', 0, '奈良', '奈良県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '30', '', 0, '和歌山', '和歌山県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '31', '', 0, '鳥取', '鳥取県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '32', '', 0, '島根', '島根県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '33', '', 0, '岡山', '岡山県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '34', '', 0, '広島', '広島県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '35', '', 0, '山口', '山口県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '36', '', 0, '徳島', '徳島県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '37', '', 0, '香川', '香川県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '38', '', 0, '愛媛', '愛媛県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '39', '', 0, '高知', '高知県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '40', '', 0, '福岡', '福岡県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '41', '', 0, '佐賀', '佐賀県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '42', '', 0, '長崎', '長崎県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '43', '', 0, '熊本', '熊本県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '44', '', 0, '大分', '大分県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '45', '', 0, '宮崎', '宮崎県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '46', '', 0, '鹿児島', '鹿児島県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '47', '', 0, '沖縄', '沖縄県', 1); diff --git a/htdocs/install/mysql/data/llx_accounting_abc.sql b/htdocs/install/mysql/data/llx_accounting_abc.sql index 7c8deec073c..8874fad0784 100644 --- a/htdocs/install/mysql/data/llx_accounting_abc.sql +++ b/htdocs/install/mysql/data/llx_accounting_abc.sql @@ -183,3 +183,6 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE -- Description of chart of account Mexico SAT/24-2019 INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 154, 'SAT/24-2019', 'Catalogo y codigo agrupador fiscal del 2019', 1); + +-- Description of chart of account Japan JPN-BASE +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 123, 'JPN-BASE', '日本 勘定科目表 基本版', 1); diff --git a/htdocs/install/mysql/data/llx_accounting_account_jp.sql b/htdocs/install/mysql/data/llx_accounting_account_jp.sql new file mode 100644 index 00000000000..2b852ae273f --- /dev/null +++ b/htdocs/install/mysql/data/llx_accounting_account_jp.sql @@ -0,0 +1,365 @@ +-- Copyright (C) 2001-2004 Rodolphe Quiedeville +-- Copyright (C) 2003 Jean-Louis Bergamo +-- Copyright (C) 2004-2009 Laurent Destailleur +-- Copyright (C) 2004 Benoit Mortier +-- Copyright (C) 2004 Guillaume Delecourt +-- Copyright (C) 2005-2009 Regis Houssin +-- Copyright (C) 2007 Patrick Raguin +-- Copyright (C) 2011-2017 Alexandre Spangaro +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- Note (JPN-BASE): INCOME = REVENUE +-- Note (JPN-BASE): EXPENSE = EXPENSES +-- Note (JPN-BASE): CAPITAL = EQUITY +-- +-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors +-- de l''install et tous les sigles '--' sont supprimés. +-- Note: To replace a string thas is '__, 0' into an increasing number, you can use vi with comment +-- :let @a=1 | %s/__, 0/\='__, '.(@a+setreg('a',@a+1))/g + +-- Descriptif des plans comptables Japan JPN-BASE +-- ID 10000 - 99999 +-- ADD 12300000 to rowid # Do no remove this comment -- + +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10000, 'JPN-BASE', 'ASSETS', '10000000', '0', '資産合計', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11000, 'JPN-BASE', 'ASSETS', '11000000', '10000000', '流動資産', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11100, 'JPN-BASE', 'ASSETS', '11100000', '11000000', '当座資産', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11101, 'JPN-BASE', 'ASSETS', '11110000', '11100000', '現金及び預金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11102, 'JPN-BASE', 'ASSETS', '11111000', '11110000', '現金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11103, 'JPN-BASE', 'ASSETS', '11111100', '11111000', '現金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11104, 'JPN-BASE', 'ASSETS', '11111200', '11111000', '小口現金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11105, 'JPN-BASE', 'ASSETS', '11111300', '11111000', '小切手', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11106, 'JPN-BASE', 'ASSETS', '11111400', '11111000', '転送中現金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11107, 'JPN-BASE', 'ASSETS', '11112000', '11110000', '流動性預金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11108, 'JPN-BASE', 'ASSETS', '11112100', '11112000', '当座預金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11109, 'JPN-BASE', 'ASSETS', '11112200', '11112000', '普通預金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11110, 'JPN-BASE', 'ASSETS', '11112300', '11112000', '通知預金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11111, 'JPN-BASE', 'ASSETS', '11112400', '11112000', 'その他流動性預金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11112, 'JPN-BASE', 'ASSETS', '11112500', '11112000', '銀行通過中預金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11113, 'JPN-BASE', 'ASSETS', '11112600', '11112000', '銀行未確認受領', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11114, 'JPN-BASE', 'ASSETS', '11112700', '11112000', '未配分受取預金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11115, 'JPN-BASE', 'ASSETS', '11113000', '11110000', '固定性預金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11116, 'JPN-BASE', 'ASSETS', '11113100', '11113000', '定期預金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11117, 'JPN-BASE', 'ASSETS', '11113200', '11113000', '定期積金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11118, 'JPN-BASE', 'ASSETS', '11113300', '11113000', 'その他固定性預金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11119, 'JPN-BASE', 'ASSETS', '11120000', '11100000', 'その他当座資産', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11120, 'JPN-BASE', 'ASSETS', '11121000', '11120000', '受取手形', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11121, 'JPN-BASE', 'ASSETS', '11122000', '11120000', '売掛金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11122, 'JPN-BASE', 'ASSETS', '11123000', '11120000', 'サービス売掛金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11123, 'JPN-BASE', 'ASSETS', '11124000', '11120000', '有価証券', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11124, 'JPN-BASE', 'ASSETS', '11125000', '11120000', 'その他当座資産', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11125, 'JPN-BASE', 'ASSETS', '11126000', '11120000', '未請求売掛金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11200, 'JPN-BASE', 'ASSETS', '11200000', '11000000', '棚卸資産', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11201, 'JPN-BASE', 'ASSETS', '11201000', '11200000', '商品', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11202, 'JPN-BASE', 'ASSETS', '11202000', '11200000', '製品', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11203, 'JPN-BASE', 'ASSETS', '11203000', '11200000', '製品資産', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11204, 'JPN-BASE', 'ASSETS', '11204000', '11200000', '倉庫資産', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11205, 'JPN-BASE', 'ASSETS', '11205000', '11200000', '原材料', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11206, 'JPN-BASE', 'ASSETS', '11206000', '11200000', '半製品・仕掛品', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11207, 'JPN-BASE', 'ASSETS', '11207000', '11200000', '貯蔵品', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11208, 'JPN-BASE', 'ASSETS', '11208000', '11200000', '補助材料', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11209, 'JPN-BASE', 'ASSETS', '11209000', '11200000', 'その他棚卸資産', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11210, 'JPN-BASE', 'ASSETS', '11210000', '11200000', '仕掛品在庫', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11211, 'JPN-BASE', 'ASSETS', '11211000', '11200000', '検品中在庫', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11300, 'JPN-BASE', 'ASSETS', '11300000', '11000000', 'その他流動資産', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11301, 'JPN-BASE', 'ASSETS', '11301000', '11300000', '前渡金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11302, 'JPN-BASE', 'ASSETS', '11302000', '11300000', '短期貸付金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11303, 'JPN-BASE', 'ASSETS', '11303000', '11300000', '立替金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11304, 'JPN-BASE', 'ASSETS', '11304000', '11300000', '従業員立替', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11305, 'JPN-BASE', 'ASSETS', '11305000', '11300000', '未収入金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11306, 'JPN-BASE', 'ASSETS', '11306000', '11300000', '仮払金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11307, 'JPN-BASE', 'ASSETS', '11307000', '11300000', '前払金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11308, 'JPN-BASE', 'ASSETS', '11308000', '11300000', '仮払消費税等', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11309, 'JPN-BASE', 'ASSETS', '11309000', '11300000', '未収法人税等', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11310, 'JPN-BASE', 'ASSETS', '11310000', '11300000', '繰延税金資産', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11311, 'JPN-BASE', 'ASSETS', '11311000', '11300000', 'その他流動資産', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11312, 'JPN-BASE', 'ASSETS', '11312000', '11300000', '不渡手形', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11313, 'JPN-BASE', 'ASSETS', '11313000', '11300000', '債権償却特別勘定', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11314, 'JPN-BASE', 'ASSETS', '11314000', '11300000', '貸倒引当金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12000, 'JPN-BASE', 'ASSETS', '12000000', '10000000', '固定資産', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12100, 'JPN-BASE', 'ASSETS', '12100000', '12000000', '有形固定資産', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12101, 'JPN-BASE', 'ASSETS', '12101000', '12100000', '建物', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12102, 'JPN-BASE', 'ASSETS', '12102000', '12100000', '建物付属設備', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12103, 'JPN-BASE', 'ASSETS', '12103000', '12100000', '構築物', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12104, 'JPN-BASE', 'ASSETS', '12104000', '12100000', '機械装置', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12105, 'JPN-BASE', 'ASSETS', '12105000', '12100000', '車両運搬具', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12106, 'JPN-BASE', 'ASSETS', '12106000', '12100000', '工具器具備品', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12107, 'JPN-BASE', 'ASSETS', '12107000', '12100000', '土地', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12108, 'JPN-BASE', 'ASSETS', '12108000', '12100000', '建設仮勘定', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12109, 'JPN-BASE', 'ASSETS', '12109000', '12100000', 'その他有形固定資産', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12110, 'JPN-BASE', 'ASSETS', '12110000', '12100000', '減価償却累計額', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12200, 'JPN-BASE', 'ASSETS', '12200000', '12000000', '無形固定資産', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12201, 'JPN-BASE', 'ASSETS', '12201000', '12200000', '電話加入権', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12202, 'JPN-BASE', 'ASSETS', '12202000', '12200000', 'その他無形固定資産', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12203, 'JPN-BASE', 'ASSETS', '12203000', '12200000', 'ソフトウェア資産', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12300, 'JPN-BASE', 'ASSETS', '12300000', '12000000', '投資その他の資産', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12301, 'JPN-BASE', 'ASSETS', '12301000', '12300000', '投資有価証券', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12302, 'JPN-BASE', 'ASSETS', '12302000', '12300000', '出資金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12303, 'JPN-BASE', 'ASSETS', '12303000', '12300000', '長期貸付金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12304, 'JPN-BASE', 'ASSETS', '12304000', '12300000', '長期前払費用', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12305, 'JPN-BASE', 'ASSETS', '12305000', '12300000', '保証金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12306, 'JPN-BASE', 'ASSETS', '12306000', '12300000', '事業保険積立金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12307, 'JPN-BASE', 'ASSETS', '12307000', '12300000', '長期繰延税金資産', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12308, 'JPN-BASE', 'ASSETS', '12308000', '12300000', 'その他投資', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12309, 'JPN-BASE', 'ASSETS', '12410000', '12000000', 'プロジェクト資産', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12310, 'JPN-BASE', 'ASSETS', '12420000', '12000000', 'プロジェクト仕掛', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 13000, 'JPN-BASE', 'ASSETS', '13000000', '10000000', '繰延資産', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 13001, 'JPN-BASE', 'ASSETS', '13100000', '13000000', '創立費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 13002, 'JPN-BASE', 'ASSETS', '13200000', '13000000', '開発費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 13003, 'JPN-BASE', 'ASSETS', '13300000', '13000000', '試験研究費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 13004, 'JPN-BASE', 'ASSETS', '13400000', '13000000', 'その他繰延資産', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 14000, 'JPN-BASE', 'ASSETS', '14000000', '10000000', '関係会社取引元勘定', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 20000, 'JPN-BASE', 'LIABILITIES_EQUITY', '20000000', '0', '負債・純資産合計', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21000, 'JPN-BASE', 'LIABILITIES', '21000000', '20000000', '負債合計', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21001, 'JPN-BASE', 'LIABILITIES', '21100000', '21000000', '流動負債', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21002, 'JPN-BASE', 'LIABILITIES', '21101000', '21100000', '支払手形', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21003, 'JPN-BASE', 'LIABILITIES', '21102000', '21100000', '買掛金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21004, 'JPN-BASE', 'LIABILITIES', '21103000', '21100000', 'サービス買掛金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21005, 'JPN-BASE', 'LIABILITIES', '21104000', '21100000', '短期借入金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21006, 'JPN-BASE', 'LIABILITIES', '21105000', '21100000', '1年内返済長期借入金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21007, 'JPN-BASE', 'LIABILITIES', '21106000', '21100000', '未払金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21008, 'JPN-BASE', 'LIABILITIES', '21107000', '21100000', '未払費用', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21009, 'JPN-BASE', 'LIABILITIES', '21108000', '21100000', '前受金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21010, 'JPN-BASE', 'LIABILITIES', '21109000', '21100000', '仮受金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21011, 'JPN-BASE', 'LIABILITIES', '21110000', '21100000', '預り金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21012, 'JPN-BASE', 'LIABILITIES', '21111000', '21100000', '従業員預り金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21013, 'JPN-BASE', 'LIABILITIES', '21112000', '21100000', '割引手形', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21014, 'JPN-BASE', 'LIABILITIES', '21113000', '21100000', '裏書手形', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21015, 'JPN-BASE', 'LIABILITIES', '21114000', '21100000', '未払法人税等', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21016, 'JPN-BASE', 'LIABILITIES', '21115000', '21100000', '賞与引当金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21017, 'JPN-BASE', 'LIABILITIES', '21116000', '21100000', '仮受消費税等', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21018, 'JPN-BASE', 'LIABILITIES', '21117000', '21100000', '繰延税金負債', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21019, 'JPN-BASE', 'LIABILITIES', '21118000', '21100000', 'その他流動負債', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21020, 'JPN-BASE', 'LIABILITIES', '21119000', '21100000', '未請求受領書', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21021, 'JPN-BASE', 'LIABILITIES', '21200000', '21000000', '固定負債', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21022, 'JPN-BASE', 'LIABILITIES', '21201000', '21200000', '長期借入金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21023, 'JPN-BASE', 'LIABILITIES', '21202000', '21200000', '預り保証金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21024, 'JPN-BASE', 'LIABILITIES', '21203000', '21200000', '退職給与引当金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21025, 'JPN-BASE', 'LIABILITIES', '21204000', '21200000', '長期繰延税金負債', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21026, 'JPN-BASE', 'LIABILITIES', '21205000', '21200000', 'その他固定負債', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21027, 'JPN-BASE', 'LIABILITIES', '21300000', '21000000', '引当金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21028, 'JPN-BASE', 'LIABILITIES', '21301000', '21300000', '引当金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21029, 'JPN-BASE', 'LIABILITIES', '21410000', '21000000', '関係会社取引先勘定', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21030, 'JPN-BASE', 'LIABILITIES', '21420000', '21000000', '源泉所得税', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21031, 'JPN-BASE', 'LIABILITIES', '21430000', '21000000', '支払中買掛金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22000, 'JPN-BASE', 'EQUITY', '22000000', '20000000', '純資産合計', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22001, 'JPN-BASE', 'EQUITY', '22100000', '22000000', '株主資本', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22002, 'JPN-BASE', 'EQUITY', '22110000', '22100000', '資本金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22003, 'JPN-BASE', 'EQUITY', '22111000', '22110000', '資本金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22004, 'JPN-BASE', 'EQUITY', '22120000', '22100000', '新株式申込証拠金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22005, 'JPN-BASE', 'EQUITY', '22121000', '22120000', '新株式申込証拠金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22006, 'JPN-BASE', 'EQUITY', '22130000', '22100000', '資本剰余金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22007, 'JPN-BASE', 'EQUITY', '22131000', '22130000', '資本準備金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22008, 'JPN-BASE', 'EQUITY', '22131100', '22131000', 'その他資本剰余金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22009, 'JPN-BASE', 'EQUITY', '22131110', '22131100', '資本・資本準備金減少差益', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22010, 'JPN-BASE', 'EQUITY', '22131120', '22131100', '自己株式処分差益', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22011, 'JPN-BASE', 'EQUITY', '22140000', '22100000', '利益剰余金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22012, 'JPN-BASE', 'EQUITY', '22141000', '22140000', '利益準備金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22013, 'JPN-BASE', 'EQUITY', '22142000', '22140000', 'その他利益剰余金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22014, 'JPN-BASE', 'EQUITY', '22142100', '22142000', '退職給与積立金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22015, 'JPN-BASE', 'EQUITY', '22142200', '22142000', '別途積立金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22016, 'JPN-BASE', 'EQUITY', '22142300', '22142000', 'その他任意積立金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22017, 'JPN-BASE', 'EQUITY', '22142400', '22142000', '繰越利益剰余金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22018, 'JPN-BASE', 'EQUITY', '22142410', '22142400', '繰越利益剰余金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22019, 'JPN-BASE', 'EQUITY', '22150000', '22100000', '自己株式', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22020, 'JPN-BASE', 'EQUITY', '22151000', '22150000', '自己株式', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22021, 'JPN-BASE', 'EQUITY', '22160000', '22100000', '自己株式申込証拠金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22022, 'JPN-BASE', 'EQUITY', '22161000', '22160000', '自己株式申込証拠金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22023, 'JPN-BASE', 'EQUITY', '22200000', '22000000', '評価・換算差額等', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22024, 'JPN-BASE', 'EQUITY', '22210000', '22200000', '他有価証券評価差額金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22025, 'JPN-BASE', 'EQUITY', '22211000', '22210000', '他有価証券評価差額金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22026, 'JPN-BASE', 'EQUITY', '22220000', '22200000', '繰越ヘッジ損益', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22027, 'JPN-BASE', 'EQUITY', '22221000', '22220000', '繰越ヘッジ損益', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22028, 'JPN-BASE', 'EQUITY', '22300000', '22000000', '新株予約権', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22029, 'JPN-BASE', 'EQUITY', '22310000', '22300000', '新株予約権', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22030, 'JPN-BASE', 'EQUITY', '22320000', '22300000', '自己新株予約権', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 30000, 'JPN-BASE', 'INCOME', '30000000', '0', '純売上高', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 30001, 'JPN-BASE', 'INCOME', '30001000', '30000000', '商品売上高', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 30002, 'JPN-BASE', 'INCOME', '30002000', '30000000', '製品売上高', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 30003, 'JPN-BASE', 'INCOME', '30003000', '30000000', 'サービス売上高', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 30004, 'JPN-BASE', 'INCOME', '30004000', '30000000', '売上値引高', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 30005, 'JPN-BASE', 'INCOME', '30005000', '30000000', '売上戻り高', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 30006, 'JPN-BASE', 'INCOME', '30006000', '30000000', '売上割戻し高', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 30007, 'JPN-BASE', 'INCOME', '30007000', '30000000', '前受収益', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 30008, 'JPN-BASE', 'INCOME', '30008000', '30000000', '未請求売上', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31000, 'JPN-BASE', 'COGS', '31000000', '0', '売上原価', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31001, 'JPN-BASE', 'COGS', '31100000', '31000000', '商品売上原価', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31002, 'JPN-BASE', 'COGS', '31200000', '31000000', '製品売上原価', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31003, 'JPN-BASE', 'COGS', '31201000', '31000000', '製品経費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31004, 'JPN-BASE', 'COGS', '31202000', '31000000', '製品原価調整', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31005, 'JPN-BASE', 'COGS', '31203000', '31000000', '入庫請求仮勘定', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31006, 'JPN-BASE', 'COGS', '31204000', '31000000', '請求価格差異', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31007, 'JPN-BASE', 'COGS', '31205000', '31000000', '標準価格差異', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31008, 'JPN-BASE', 'COGS', '31206000', '31000000', '平均原価差異', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31009, 'JPN-BASE', 'COGS', '31207000', '31000000', '倉庫差異', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31010, 'JPN-BASE', 'COGS', '31208000', '31000000', '在庫調整', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31011, 'JPN-BASE', 'COGS', '31209000', '31000000', '棚卸再評価', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31012, 'JPN-BASE', 'COGS', '31300000', '31000000', '期首棚卸高', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31400, 'JPN-BASE', 'COGS', '31400000', '31000000', '仕入高', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31401, 'JPN-BASE', 'COGS', '31410000', '31400000', '商品仕入高', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31402, 'JPN-BASE', 'COGS', '31420000', '31400000', 'サービス仕入高', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31403, 'JPN-BASE', 'COGS', '31430000', '31400000', '仕入値引高', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31404, 'JPN-BASE', 'COGS', '31440000', '31400000', '仕入戻り高', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31405, 'JPN-BASE', 'COGS', '31450000', '31400000', '仕入割戻し高', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31406, 'JPN-BASE', 'COGS', '31460000', '31400000', '仕入等配賦額', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31500, 'JPN-BASE', 'COGS', '31500000', '31000000', '当期製品製造原価', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31501, 'JPN-BASE', 'COGS', '31510000', '31500000', '当期総製造費用', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31502, 'JPN-BASE', 'COGS', '31511000', '31510000', '材料費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31503, 'JPN-BASE', 'COGS', '31511100', '31511000', '期首材料棚卸高', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31504, 'JPN-BASE', 'COGS', '31511200', '31511000', '材料仕入高', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31505, 'JPN-BASE', 'COGS', '31511300', '31511000', '期末材料棚卸高', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31506, 'JPN-BASE', 'COGS', '31512000', '31510000', '労務費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31507, 'JPN-BASE', 'COGS', '31512100', '31512000', '賃金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31508, 'JPN-BASE', 'COGS', '31512200', '31512000', '賞与', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31509, 'JPN-BASE', 'COGS', '31512300', '31512000', '退職金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31510, 'JPN-BASE', 'COGS', '31512400', '31512000', '法定福利費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31511, 'JPN-BASE', 'COGS', '31512500', '31512000', '福利厚生費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31512, 'JPN-BASE', 'COGS', '31512600', '31512000', '賞与引当金繰入', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31513, 'JPN-BASE', 'COGS', '31512700', '31512000', '退職給与引当金繰入', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31514, 'JPN-BASE', 'COGS', '31512800', '31512000', 'その他労務費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31515, 'JPN-BASE', 'COGS', '31512900', '31512000', '雑給', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31516, 'JPN-BASE', 'COGS', '31513000', '31510000', '外注加工費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31517, 'JPN-BASE', 'COGS', '31513100', '31513000', '外注加工費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31518, 'JPN-BASE', 'COGS', '31514000', '31510000', '製造経費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31519, 'JPN-BASE', 'COGS', '31514010', '31514000', '電力費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31520, 'JPN-BASE', 'COGS', '31514020', '31514000', '燃料費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31521, 'JPN-BASE', 'COGS', '31514030', '31514000', '水道光熱費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31522, 'JPN-BASE', 'COGS', '31514040', '31514000', '車両関連費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31523, 'JPN-BASE', 'COGS', '31514050', '31514000', '運賃', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31524, 'JPN-BASE', 'COGS', '31514060', '31514000', '工場消耗品費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31525, 'JPN-BASE', 'COGS', '31514070', '31514000', '賃借料', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31526, 'JPN-BASE', 'COGS', '31514080', '31514000', '支払保険料', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31527, 'JPN-BASE', 'COGS', '31514090', '31514000', '修繕費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31528, 'JPN-BASE', 'COGS', '31514100', '31514000', '租税公課', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31529, 'JPN-BASE', 'COGS', '31514110', '31514000', '減価償却費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31530, 'JPN-BASE', 'COGS', '31514120', '31514000', '旅費交通費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31531, 'JPN-BASE', 'COGS', '31514130', '31514000', '通信費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31532, 'JPN-BASE', 'COGS', '31514140', '31514000', '支払手数料', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31533, 'JPN-BASE', 'COGS', '31514150', '31514000', '会議費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31534, 'JPN-BASE', 'COGS', '31514160', '31514000', '諸会費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31535, 'JPN-BASE', 'COGS', '31514170', '31514000', '図書教育費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31536, 'JPN-BASE', 'COGS', '31514180', '31514000', '試験研究費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31537, 'JPN-BASE', 'COGS', '31514190', '31514000', 'その他製造経費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31538, 'JPN-BASE', 'COGS', '31514200', '31514000', '雑費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31539, 'JPN-BASE', 'COGS', '31515010', '31514000', '製造原価', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31540, 'JPN-BASE', 'COGS', '31515020', '31514000', 'スクラップ', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31541, 'JPN-BASE', 'COGS', '31515030', '31514000', '外注加工費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31542, 'JPN-BASE', 'COGS', '31515040', '31514000', '数量差異', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31543, 'JPN-BASE', 'COGS', '31515050', '31514000', '仕様変更差異', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31544, 'JPN-BASE', 'COGS', '31515060', '31514000', '賃率差異', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31545, 'JPN-BASE', 'COGS', '31515070', '31514000', '準変動費差異', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31546, 'JPN-BASE', 'COGS', '31515080', '31514000', '労務費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31547, 'JPN-BASE', 'COGS', '31515090', '31514000', '負担', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31548, 'JPN-BASE', 'COGS', '31515100', '31514000', '間接諸経費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31549, 'JPN-BASE', 'COGS', '31520000', '31500000', '仕掛品棚卸高', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31550, 'JPN-BASE', 'COGS', '31521000', '31520000', '製造原価配賦額', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31551, 'JPN-BASE', 'COGS', '31522000', '31520000', '期首仕掛品棚卸高', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31552, 'JPN-BASE', 'COGS', '31523000', '31520000', '期末仕掛品棚卸高', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31553, 'JPN-BASE', 'COGS', '31524000', '31520000', '他勘定振替高', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31600, 'JPN-BASE', 'COGS', '31600000', '31000000', '期末棚卸高', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41000, 'JPN-BASE', 'EXPENSE', '41000000', '0', '販売費及び一般管理費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41100, 'JPN-BASE', 'EXPENSE', '41100000', '41000000', '人件費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41101, 'JPN-BASE', 'EXPENSE', '41101000', '41100000', '役員報酬', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41102, 'JPN-BASE', 'EXPENSE', '41102000', '41100000', '役員賞与', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41103, 'JPN-BASE', 'EXPENSE', '41103000', '41100000', '給料手当', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41104, 'JPN-BASE', 'EXPENSE', '41104000', '41100000', '賞与', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41105, 'JPN-BASE', 'EXPENSE', '41105000', '41100000', '退職金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41106, 'JPN-BASE', 'EXPENSE', '41106000', '41100000', '法定福利費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41107, 'JPN-BASE', 'EXPENSE', '41107000', '41100000', '福利厚生費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41108, 'JPN-BASE', 'EXPENSE', '41108000', '41100000', '賞与引当金繰入', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41109, 'JPN-BASE', 'EXPENSE', '41109000', '41100000', '退職給与引当金繰入', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41110, 'JPN-BASE', 'EXPENSE', '41110000', '41100000', 'その他人件費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41111, 'JPN-BASE', 'EXPENSE', '41111000', '41100000', '雑給', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41112, 'JPN-BASE', 'EXPENSE', '41112000', '41100000', '従業員経費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41200, 'JPN-BASE', 'EXPENSE', '41200000', '41000000', '販売直接費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41201, 'JPN-BASE', 'EXPENSE', '41201000', '41200000', '広告宣伝費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41202, 'JPN-BASE', 'EXPENSE', '41202000', '41200000', '運賃', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41203, 'JPN-BASE', 'EXPENSE', '41203000', '41200000', '販売手数料', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41204, 'JPN-BASE', 'EXPENSE', '41204000', '41200000', '容器包装費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41205, 'JPN-BASE', 'EXPENSE', '41205000', '41200000', 'その他販売直接費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41300, 'JPN-BASE', 'EXPENSE', '41300000', '41000000', '一般管理費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41301, 'JPN-BASE', 'EXPENSE', '41301000', '41300000', '水道光熱費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41302, 'JPN-BASE', 'EXPENSE', '41302000', '41300000', '車両関連費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41303, 'JPN-BASE', 'EXPENSE', '41303000', '41300000', '事務用消耗品費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41304, 'JPN-BASE', 'EXPENSE', '41304000', '41300000', '消耗品費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41305, 'JPN-BASE', 'EXPENSE', '41305000', '41300000', '賃借料', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41306, 'JPN-BASE', 'EXPENSE', '41306000', '41300000', '支払保険料', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41307, 'JPN-BASE', 'EXPENSE', '41307000', '41300000', '修繕費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41308, 'JPN-BASE', 'EXPENSE', '41308000', '41300000', '租税公課', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41309, 'JPN-BASE', 'EXPENSE', '41309000', '41300000', '減価償却費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41310, 'JPN-BASE', 'EXPENSE', '41310000', '41300000', '接待交際費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41311, 'JPN-BASE', 'EXPENSE', '41311000', '41300000', '旅費交通費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41312, 'JPN-BASE', 'EXPENSE', '41312000', '41300000', '通信費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41313, 'JPN-BASE', 'EXPENSE', '41313000', '41300000', '支払手数料', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41314, 'JPN-BASE', 'EXPENSE', '41314000', '41300000', '会議費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41315, 'JPN-BASE', 'EXPENSE', '41315000', '41300000', '諸会費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41316, 'JPN-BASE', 'EXPENSE', '41316000', '41300000', '寄付金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41317, 'JPN-BASE', 'EXPENSE', '41317000', '41300000', '図書教育費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41318, 'JPN-BASE', 'EXPENSE', '41318000', '41300000', '試験研究費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41319, 'JPN-BASE', 'EXPENSE', '41319000', '41300000', 'その他管理費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41320, 'JPN-BASE', 'EXPENSE', '41320000', '41300000', '貸倒引当金繰入', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41321, 'JPN-BASE', 'EXPENSE', '41321000', '41300000', '銀行手数料', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41322, 'JPN-BASE', 'EXPENSE', '41322000', '41300000', '現金差異', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41323, 'JPN-BASE', 'EXPENSE', '41323000', '41300000', '雑費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41400, 'JPN-BASE', 'EXPENSE', '41400000', '41000000', '販管費配賦額', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 51000, 'JPN-BASE', 'OTHER_REVENUE', '51000000', '0', '営業外収益', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 51001, 'JPN-BASE', 'OTHER_REVENUE', '51010000', '51000000', '受取利息', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 51002, 'JPN-BASE', 'OTHER_REVENUE', '51020000', '51000000', '受取配当金', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 51003, 'JPN-BASE', 'OTHER_REVENUE', '51030000', '51000000', '銀行再評価益', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 51004, 'JPN-BASE', 'OTHER_REVENUE', '51040000', '51000000', '銀行決済利益', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 51005, 'JPN-BASE', 'OTHER_REVENUE', '51050000', '51000000', '手数料収益', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 51006, 'JPN-BASE', 'OTHER_REVENUE', '51060000', '51000000', 'その他営業外収益', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 51007, 'JPN-BASE', 'OTHER_REVENUE', '51070000', '51000000', '支払割引費科目', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 51008, 'JPN-BASE', 'OTHER_REVENUE', '51080000', '51000000', '許可割引料', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 51009, 'JPN-BASE', 'OTHER_REVENUE', '51090000', '51000000', '現金出納帳受取', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 51010, 'JPN-BASE', 'OTHER_REVENUE', '51100000', '51000000', '未実現利益', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 51011, 'JPN-BASE', 'OTHER_REVENUE', '51110000', '51000000', '実現利益', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 51012, 'JPN-BASE', 'OTHER_REVENUE', '51120000', '51000000', '雑収入', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 52000, 'JPN-BASE', 'OTHER_EXPENSES', '52000000', '0', '営業外費用', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 52001, 'JPN-BASE', 'OTHER_EXPENSES', '52010000', '52000000', '支払利息', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 52002, 'JPN-BASE', 'OTHER_EXPENSES', '52020000', '52000000', '銀行再評価損', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 52003, 'JPN-BASE', 'OTHER_EXPENSES', '52030000', '52000000', '銀行決済損失', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 52004, 'JPN-BASE', 'OTHER_EXPENSES', '52040000', '52000000', '手数料経費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 52005, 'JPN-BASE', 'OTHER_EXPENSES', '52050000', '52000000', '手形売却損', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 52006, 'JPN-BASE', 'OTHER_EXPENSES', '52060000', '52000000', 'その他営業外費用', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 52007, 'JPN-BASE', 'OTHER_EXPENSES', '52070000', '52000000', '支払割引売上科目', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 52008, 'JPN-BASE', 'OTHER_EXPENSES', '52080000', '52000000', '受取割引料', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 52009, 'JPN-BASE', 'OTHER_EXPENSES', '52090000', '52000000', '貸倒損失', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 52010, 'JPN-BASE', 'OTHER_EXPENSES', '52100000', '52000000', '現金出納帳経費', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 52011, 'JPN-BASE', 'OTHER_EXPENSES', '52110000', '52000000', '未実現損失', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 52012, 'JPN-BASE', 'OTHER_EXPENSES', '52120000', '52000000', '実現損失', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 52013, 'JPN-BASE', 'OTHER_EXPENSES', '52130000', '52000000', '雑損失', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 52014, 'JPN-BASE', 'OTHER_EXPENSES', '52140000', '52000000', '営業外配賦額', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 61000, 'JPN-BASE', 'EXTRAORDINALY_REVENUE', '61000000', '0', '特別利益', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 61001, 'JPN-BASE', 'EXTRAORDINALY_REVENUE', '61100000', '61000000', '固定資産売却益', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 61002, 'JPN-BASE', 'EXTRAORDINALY_REVENUE', '61200000', '61000000', '貸倒引当金戻入', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 61003, 'JPN-BASE', 'EXTRAORDINALY_REVENUE', '61300000', '61000000', 'その他特別利益', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 61004, 'JPN-BASE', 'EXTRAORDINALY_REVENUE', '61400000', '61000000', '前期損益修正益', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 62000, 'JPN-BASE', 'EXTRAORDINALY_EXPENSES', '62000000', '0', '特別損失', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 62001, 'JPN-BASE', 'EXTRAORDINALY_EXPENSES', '62100000', '62000000', '固定資産売却除却損', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 62002, 'JPN-BASE', 'EXTRAORDINALY_EXPENSES', '62200000', '62000000', 'その他特別損失', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 62003, 'JPN-BASE', 'EXTRAORDINALY_EXPENSES', '62300000', '62000000', '前期損益修正損', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71100, 'JPN-BASE', 'INCOME_TAXES', '71100000', '0', '法人税等', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71101, 'JPN-BASE', 'INCOME_TAXES', '71110000', '71100000', '法人税等', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71102, 'JPN-BASE', 'INCOME_TAXES', '71120000', '71100000', '法人税等調整額', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 81101, 'JPN-BASE', 'OTHER_INCOME_EXPENSES', '81101000', '0', 'デフォルト勘定科目', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 81102, 'JPN-BASE', 'OTHER_INCOME_EXPENSES', '81102000', '0', '貸借不一致仮勘定', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 81103, 'JPN-BASE', 'OTHER_INCOME_EXPENSES', '81103000', '0', 'エラー仮勘定', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 81104, 'JPN-BASE', 'OTHER_INCOME_EXPENSES', '81104000', '0', '通貨貸借不一致仮勘定', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 81105, 'JPN-BASE', 'OTHER_INCOME_EXPENSES', '81105000', '0', '損益勘定', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 81106, 'JPN-BASE', 'OTHER_INCOME_EXPENSES', '81106000', '0', '購入価格差異相殺', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 82101, 'JPN-BASE', 'MEMO', '82100000', '0', 'コミッション相殺', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 82102, 'JPN-BASE', 'MEMO', '82200000', '0', '販売コミッション相殺', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 82103, 'JPN-BASE', 'MEMO', '99999999', '0', '諸口', 1); diff --git a/htdocs/install/mysql/data/llx_c_forme_juridique.sql b/htdocs/install/mysql/data/llx_c_forme_juridique.sql index 7baa5007b3d..c35824fa235 100644 --- a/htdocs/install/mysql/data/llx_c_forme_juridique.sql +++ b/htdocs/install/mysql/data/llx_c_forme_juridique.sql @@ -403,3 +403,36 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (76, '7608', ' INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (76, '7609', 'Državno tijelo'); INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (76, '7610', 'Kućna radinost'); INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (76, '7611', 'Sporedno zanimanje'); + +-- Japan (id country=123) +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12301', '株式会社'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12302', '有限会社'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12303', '合資会社'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12304', '合名会社'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12305', '相互会社'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12306', '医療法人'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12307', '財団法人'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12308', '社団法人'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12309', '社会福祉法人'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12310', '学校法人'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12311', '特定非営利活動法人'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12312', 'NPO法人'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12313', '商工組合'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12314', '林業組合'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12315', '同業組合'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12316', '農業協同組合'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12317', '漁業協同組合'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12318', '農事組合法人'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12319', '生活互助会'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12320', '協業組合'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12321', '協同組合'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12322', '生活協同組合'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12323', '連合会'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12324', '組合連合会'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12325', '協同組合連合会'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12329', '一般社団法人'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12330', '公益社団法人'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12331', '一般財団法人'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12332', '公益財団法人'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12333', '合同会社'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (123, '12399', '個人又はその他の法人'); diff --git a/htdocs/install/mysql/data/llx_c_type_contact.sql b/htdocs/install/mysql/data/llx_c_type_contact.sql index 825e21ddf42..5852e295c6b 100644 --- a/htdocs/install/mysql/data/llx_c_type_contact.sql +++ b/htdocs/install/mysql/data/llx_c_type_contact.sql @@ -32,88 +32,89 @@ -- -- The types of contact of an element --- Les types de contact d'un element +-- +-- The unique key is set on (element, source, code) -- -- Contract / Contrat -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (10, 'contrat', 'internal', 'SALESREPSIGN', 'Commercial signataire du contrat', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (11, 'contrat', 'internal', 'SALESREPFOLL', 'Commercial suivi du contrat', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (20, 'contrat', 'external', 'BILLING', 'Contact client facturation contrat', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (21, 'contrat', 'external', 'CUSTOMER', 'Contact client suivi contrat', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (22, 'contrat', 'external', 'SALESREPSIGN', 'Contact client signataire contrat', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('contrat', 'internal', 'SALESREPSIGN', 'Commercial signataire du contrat', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('contrat', 'internal', 'SALESREPFOLL', 'Commercial suivi du contrat', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('contrat', 'external', 'BILLING', 'Contact client facturation contrat', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('contrat', 'external', 'CUSTOMER', 'Contact client suivi contrat', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('contrat', 'external', 'SALESREPSIGN', 'Contact client signataire contrat', 1); -- Proposal / Propal -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (31, 'propal', 'internal', 'SALESREPFOLL', 'Commercial à l''origine de la propale', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (40, 'propal', 'external', 'BILLING', 'Contact client facturation propale', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (41, 'propal', 'external', 'CUSTOMER', 'Contact client suivi propale', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (42, 'propal', 'external', 'SHIPPING', 'Contact client livraison propale', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('propal', 'internal', 'SALESREPFOLL', 'Commercial à l''origine de la propale', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('propal', 'external', 'BILLING', 'Contact client facturation propale', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('propal', 'external', 'CUSTOMER', 'Contact client suivi propale', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('propal', 'external', 'SHIPPING', 'Contact client livraison propale', 1); -- Customer Invoice / Facture -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (50, 'facture', 'internal', 'SALESREPFOLL', 'Responsable suivi du paiement', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (60, 'facture', 'external', 'BILLING', 'Contact client facturation', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (61, 'facture', 'external', 'SHIPPING', 'Contact client livraison', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (62, 'facture', 'external', 'SERVICE', 'Contact client prestation', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('facture', 'internal', 'SALESREPFOLL', 'Responsable suivi du paiement', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('facture', 'external', 'BILLING', 'Contact client facturation', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('facture', 'external', 'SHIPPING', 'Contact client livraison', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('facture', 'external', 'SERVICE', 'Contact client prestation', 1); -- Supplier Invoice -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (70, 'invoice_supplier', 'internal', 'SALESREPFOLL', 'Responsable suivi du paiement', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (71, 'invoice_supplier', 'external', 'BILLING', 'Contact fournisseur facturation', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (72, 'invoice_supplier', 'external', 'SHIPPING', 'Contact fournisseur livraison', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (73, 'invoice_supplier', 'external', 'SERVICE', 'Contact fournisseur prestation', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('invoice_supplier', 'internal', 'SALESREPFOLL', 'Responsable suivi du paiement', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('invoice_supplier', 'external', 'BILLING', 'Contact fournisseur facturation', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('invoice_supplier', 'external', 'SHIPPING', 'Contact fournisseur livraison', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('invoice_supplier', 'external', 'SERVICE', 'Contact fournisseur prestation', 1); -- Agenda -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (80, 'agenda', 'internal', 'ACTOR', 'Responsable', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (81, 'agenda', 'internal', 'GUEST', 'Guest', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (85, 'agenda', 'external', 'ACTOR', 'Responsable', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (86, 'agenda', 'external', 'GUEST', 'Guest', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('agenda', 'internal', 'ACTOR', 'Responsable', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('agenda', 'internal', 'GUEST', 'Guest', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('agenda', 'external', 'ACTOR', 'Responsable', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('agenda', 'external', 'GUEST', 'Guest', 1); -- Customer Order / Commande -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (91, 'commande', 'internal', 'SALESREPFOLL', 'Responsable suivi de la commande', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (100,'commande', 'external', 'BILLING', 'Contact client facturation commande', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (101,'commande', 'external', 'CUSTOMER', 'Contact client suivi commande', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (102,'commande', 'external', 'SHIPPING', 'Contact client livraison commande', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('commande', 'internal', 'SALESREPFOLL', 'Responsable suivi de la commande', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('commande', 'external', 'BILLING', 'Contact client facturation commande', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('commande', 'external', 'CUSTOMER', 'Contact client suivi commande', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('commande', 'external', 'SHIPPING', 'Contact client livraison commande', 1); -- Intervention / Fichinter -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (120, 'fichinter', 'internal', 'INTERREPFOLL', 'Responsable suivi de l''intervention', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (121, 'fichinter', 'internal', 'INTERVENING', 'Intervenant', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (130, 'fichinter', 'external', 'BILLING', 'Contact client facturation intervention', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (131, 'fichinter', 'external', 'CUSTOMER', 'Contact client suivi de l''intervention', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('fichinter', 'internal', 'INTERREPFOLL', 'Responsable suivi de l''intervention', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('fichinter', 'internal', 'INTERVENING', 'Intervenant', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('fichinter', 'external', 'BILLING', 'Contact client facturation intervention', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('fichinter', 'external', 'CUSTOMER', 'Contact client suivi de l''intervention', 1); -- Supplier Order -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (140, 'order_supplier', 'internal', 'SALESREPFOLL', 'Responsable suivi de la commande', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (141, 'order_supplier', 'internal', 'SHIPPING', 'Responsable réception de la commande', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (142, 'order_supplier', 'external', 'BILLING', 'Contact fournisseur facturation commande', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (143, 'order_supplier', 'external', 'CUSTOMER', 'Contact fournisseur suivi commande', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (145, 'order_supplier', 'external', 'SHIPPING', 'Contact fournisseur livraison commande', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('order_supplier', 'internal', 'SALESREPFOLL', 'Responsable suivi de la commande', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('order_supplier', 'internal', 'SHIPPING', 'Responsable réception de la commande', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('order_supplier', 'external', 'BILLING', 'Contact fournisseur facturation commande', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('order_supplier', 'external', 'CUSTOMER', 'Contact fournisseur suivi commande', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('order_supplier', 'external', 'SHIPPING', 'Contact fournisseur livraison commande', 1); -- Resource -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (150, 'dolresource', 'internal', 'USERINCHARGE', 'In charge of resource', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (151, 'dolresource', 'external', 'THIRDINCHARGE', 'In charge of resource', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('dolresource', 'internal', 'USERINCHARGE', 'In charge of resource', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('dolresource', 'external', 'THIRDINCHARGE', 'In charge of resource', 1); -- Tickets -insert into llx_c_type_contact (rowid, element, source, code, libelle, active, module) values (155, 'ticket', 'internal', 'SUPPORTTEC', 'Utilisateur contact support', 1, NULL); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active, module) values (156, 'ticket', 'internal', 'CONTRIBUTOR', 'Intervenant', 1, NULL); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active, module) values (157, 'ticket', 'external', 'SUPPORTCLI', 'Contact client suivi incident', 1, NULL); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active, module) values (158, 'ticket', 'external', 'CONTRIBUTOR', 'Intervenant', 1, NULL); +insert into llx_c_type_contact (element, source, code, libelle, active, module) values ('ticket', 'internal', 'SUPPORTTEC', 'Utilisateur contact support', 1, NULL); +insert into llx_c_type_contact (element, source, code, libelle, active, module) values ('ticket', 'internal', 'CONTRIBUTOR', 'Intervenant', 1, NULL); +insert into llx_c_type_contact (element, source, code, libelle, active, module) values ('ticket', 'external', 'SUPPORTCLI', 'Contact client suivi incident', 1, NULL); +insert into llx_c_type_contact (element, source, code, libelle, active, module) values ('ticket', 'external', 'CONTRIBUTOR', 'Intervenant', 1, NULL); -- Projects / Projet - All project code can start with 'PROJECT' -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (160, 'project', 'internal', 'PROJECTLEADER', 'Chef de Projet', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (161, 'project', 'internal', 'PROJECTCONTRIBUTOR', 'Intervenant', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (170, 'project', 'external', 'PROJECTLEADER', 'Chef de Projet', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (171, 'project', 'external', 'PROJECTCONTRIBUTOR', 'Intervenant', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('project', 'internal', 'PROJECTLEADER', 'Chef de Projet', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('project', 'internal', 'PROJECTCONTRIBUTOR', 'Intervenant', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('project', 'external', 'PROJECTLEADER', 'Chef de Projet', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('project', 'external', 'PROJECTCONTRIBUTOR', 'Intervenant', 1); -- Project Tasks - All task code can start with 'TASK' -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (180, 'project_task', 'internal', 'TASKEXECUTIVE', 'Responsable', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (181, 'project_task', 'internal', 'TASKCONTRIBUTOR', 'Intervenant', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (190, 'project_task', 'external', 'TASKEXECUTIVE', 'Responsable', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (191, 'project_task', 'external', 'TASKCONTRIBUTOR', 'Intervenant', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('project_task', 'internal', 'TASKEXECUTIVE', 'Responsable', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('project_task', 'internal', 'TASKCONTRIBUTOR', 'Intervenant', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('project_task', 'external', 'TASKEXECUTIVE', 'Responsable', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('project_task', 'external', 'TASKCONTRIBUTOR', 'Intervenant', 1); -- Supplier proposal -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (110, 'supplier_proposal', 'internal', 'SALESREPFOLL', 'Responsable suivi de la demande', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (111, 'supplier_proposal', 'external', 'BILLING', 'Contact fournisseur facturation', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (112, 'supplier_proposal', 'external', 'SHIPPING', 'Contact fournisseur livraison', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (113, 'supplier_proposal', 'external', 'SERVICE', 'Contact fournisseur prestation', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('supplier_proposal', 'internal', 'SALESREPFOLL', 'Responsable suivi de la demande', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('supplier_proposal', 'external', 'BILLING', 'Contact fournisseur facturation', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('supplier_proposal', 'external', 'SHIPPING', 'Contact fournisseur livraison', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('supplier_proposal', 'external', 'SERVICE', 'Contact fournisseur prestation', 1); -- Event Organization -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (210, 'conferenceorbooth', 'internal', 'MANAGER', 'Conference or Booth manager', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (211, 'conferenceorbooth', 'external', 'SPEAKER', 'Conference Speaker', 1); -insert into llx_c_type_contact (rowid, element, source, code, libelle, active ) values (212, 'conferenceorbooth', 'external', 'RESPONSIBLE', 'Booth responsible', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('conferenceorbooth', 'internal', 'MANAGER', 'Conference or Booth manager', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('conferenceorbooth', 'external', 'SPEAKER', 'Conference Speaker', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('conferenceorbooth', 'external', 'RESPONSIBLE', 'Booth responsible', 1); diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index 2131f1a4061..6d9aebf934f 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -135,8 +135,28 @@ ALTER TABLE llx_partnership ADD UNIQUE INDEX uk_fk_type_fk_member (fk_type, fk_m ALTER TABLE llx_bank ADD COLUMN amount_main_currency double(24,8) NULL; + -- v16 +ALTER TABLE llx_element_contact DROP FOREIGN KEY fk_element_contact_fk_c_type_contact; +ALTER TABLE llx_societe_contacts DROP FOREIGN KEY fk_societe_contacts_fk_c_type_contact; + +-- VMYSQL4.3 ALTER TABLE llx_c_type_contact ADD PRIMARY KEY(rowid); +-- VMYSQL4.3 ALTER TABLE llx_c_type_contact CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; + +-- VPGSQL8.2 CREATE SEQUENCE llx_c_type_contact_rowid_seq OWNED BY llx_c_type_contact.rowid; +-- VPGSQL8.2 ALTER TABLE llx_c_type_contact ADD PRIMARY KEY (rowid); +-- VPGSQL8.2 ALTER TABLE llx_c_type_contact ALTER COLUMN rowid SET DEFAULT nextval('llx_c_type_contact_rowid_seq'); +-- VPGSQL8.2 SELECT setval('llx_c_type_contact_rowid_seq', MAX(rowid)) FROM llx_c_type_contact; + +insert into llx_c_type_contact(element, source, code, libelle, active ) values ('conferenceorbooth', 'internal', 'MANAGER', 'Conference or Booth manager', 1); +insert into llx_c_type_contact(element, source, code, libelle, active ) values ('conferenceorbooth', 'external', 'SPEAKER', 'Conference Speaker', 1); +insert into llx_c_type_contact(element, source, code, libelle, active ) values ('conferenceorbooth', 'external', 'RESPONSIBLE', 'Booth responsible', 1); + +ALTER TABLE llx_element_contact ADD CONSTRAINT fk_element_contact_fk_c_type_contact FOREIGN KEY (fk_c_type_contact) REFERENCES llx_c_type_contact(rowid); +ALTER TABLE llx_societe_contacts ADD CONSTRAINT fk_societe_contacts_fk_c_type_contact FOREIGN KEY (fk_c_type_contact) REFERENCES llx_c_type_contact(rowid); + + DROP TABLE llx_payment_salary_extrafields; DROP TABLE llx_asset_model_extrafields; DROP TABLE llx_asset_type_extrafields; diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index 2362036c93a..e72fc1b8dcd 100644 --- a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql +++ b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql @@ -41,11 +41,16 @@ ALTER TABLE llx_c_email_templates ADD COLUMN email_from varchar(255); ALTER TABLE llx_c_email_templates ADD COLUMN email_to varchar(255); ALTER TABLE llx_c_email_templates ADD COLUMN email_tocc varchar(255); ALTER TABLE llx_c_email_templates ADD COLUMN email_tobcc varchar(255); +ALTER TABLE llx_c_email_templates ADD COLUMN content_lines text; ALTER TABLE llx_expedition ADD COLUMN billed smallint DEFAULT 0; ALTER TABLE llx_accounting_system MODIFY COLUMN pcg_version varchar(32) NOT NULL; +ALTER TABLE llx_user DROP COLUMN idpers1; +ALTER TABLE llx_user DROP COLUMN idpers2; +ALTER TABLE llx_user DROP COLUMN idpers3; + -- v17 @@ -60,4 +65,15 @@ ALTER TABLE llx_inventory ADD COLUMN categories_product VARCHAR(255) DEFAULT NUL ALTER TABLE llx_ticket ADD COLUMN ip varchar(250); +ALTER TABLE llx_societe ADD last_main_doc VARCHAR(255) NULL AFTER model_pdf; +ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN port varchar(10) DEFAULT '993'; + +ALTER TABLE llx_bank ADD COLUMN position integer DEFAULT 0; + +ALTER TABLE llx_commande_fournisseur_dispatch ADD INDEX idx_commande_fournisseur_dispatch_fk_product (fk_product); + +ALTER TABLE llx_recruitment_recruitmentcandidature ADD email_date datetime after email_msgid; +ALTER TABLE llx_ticket ADD email_date datetime after email_msgid; + +INSERT INTO llx_const (name, entity, value, type, visible) VALUES ('MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT', 1, 1000, 'int', 0); diff --git a/htdocs/install/mysql/tables/llx_bank.sql b/htdocs/install/mysql/tables/llx_bank.sql index d0a8e34790b..9a1b12d5754 100644 --- a/htdocs/install/mysql/tables/llx_bank.sql +++ b/htdocs/install/mysql/tables/llx_bank.sql @@ -37,6 +37,7 @@ create table llx_bank rappro tinyint default 0, note text, fk_bordereau integer DEFAULT 0, + position integer DEFAULT 0, banque varchar(255), -- banque pour les cheques emetteur varchar(255), -- emetteur du cheque author varchar(40), -- a supprimer apres migration diff --git a/htdocs/install/mysql/tables/llx_c_type_contact.sql b/htdocs/install/mysql/tables/llx_c_type_contact.sql index 4b12661657e..e2275e71e5f 100644 --- a/htdocs/install/mysql/tables/llx_c_type_contact.sql +++ b/htdocs/install/mysql/tables/llx_c_type_contact.sql @@ -29,7 +29,7 @@ create table llx_c_type_contact ( - rowid integer PRIMARY KEY, + rowid integer AUTO_INCREMENT PRIMARY KEY, element varchar(30) NOT NULL, source varchar(8) DEFAULT 'external' NOT NULL, code varchar(32) NOT NULL, diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.key.sql b/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.key.sql index 9049cf57065..62d62a2ec38 100644 --- a/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.key.sql +++ b/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.key.sql @@ -19,3 +19,4 @@ ALTER TABLE llx_commande_fournisseur_dispatch ADD INDEX idx_commande_fournisseur_dispatch_fk_commande (fk_commande); ALTER TABLE llx_commande_fournisseur_dispatch ADD INDEX idx_commande_fournisseur_dispatch_fk_reception (fk_reception); ALTER TABLE llx_commande_fournisseur_dispatch ADD CONSTRAINT fk_commande_fournisseur_dispatch_fk_reception FOREIGN KEY (fk_reception) REFERENCES llx_reception (rowid); +ALTER TABLE llx_commande_fournisseur_dispatch ADD INDEX idx_commande_fournisseur_dispatch_fk_product (fk_product); diff --git a/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql b/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql index b62a9b6ba7f..3580f1659b1 100644 --- a/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql +++ b/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql @@ -22,6 +22,7 @@ CREATE TABLE llx_emailcollector_emailcollector( label varchar(255), description text, host varchar(255), + port varchar(10) DEFAULT '993', hostcharset varchar(16) DEFAULT 'UTF-8', login varchar(128), password varchar(128), diff --git a/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature-recruitment.sql b/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature-recruitment.sql index 5749acd93d8..8d5dd3bd14f 100644 --- a/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature-recruitment.sql +++ b/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature-recruitment.sql @@ -38,6 +38,7 @@ CREATE TABLE llx_recruitment_recruitmentcandidature( remuneration_requested integer, remuneration_proposed integer, email_msgid varchar(175), -- Do not use a too large value, it generates trouble with unique index + email_date datetime, fk_recruitment_origin INTEGER NULL -- END MODULEBUILDER FIELDS ) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_ticket-ticket.sql b/htdocs/install/mysql/tables/llx_ticket-ticket.sql index 1f60cb3e6f8..278d62894bc 100644 --- a/htdocs/install/mysql/tables/llx_ticket-ticket.sql +++ b/htdocs/install/mysql/tables/llx_ticket-ticket.sql @@ -34,12 +34,13 @@ CREATE TABLE llx_ticket type_code varchar(32), category_code varchar(32), severity_code varchar(32), - datec datetime, + datec datetime, -- date of creation of record date_read datetime, date_last_msg_sent datetime, date_close datetime, notify_tiers_at_create tinyint, email_msgid varchar(255), -- if ticket is created by email collector, we store here MSG ID + email_date datetime, -- if ticket is created by email collector, we store here Date of message ip varchar(250), tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, import_key varchar(14) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 30e7b45d198..66200898e95 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4116,6 +4116,7 @@ function migrate_delete_old_files($db, $langs, $conf) '/core/boxes/box_members.php', '/api/class/api_generic.class.php', + '/asterisk/cidlookup.php', '/categories/class/api_category.class.php', '/categories/class/api_deprecated_category.class.php', '/compta/facture/class/api_invoice.class.php', diff --git a/htdocs/knowledgemanagement/knowledgerecord_agenda.php b/htdocs/knowledgemanagement/knowledgerecord_agenda.php index 37c6b9a6e3c..cbf8ccf0895 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_agenda.php +++ b/htdocs/knowledgemanagement/knowledgerecord_agenda.php @@ -41,6 +41,7 @@ $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); +$socid = GETPOST('socid', 'int'); if (GETPOST('actioncode', 'array')) { $actioncode = GETPOST('actioncode', 'array', 3); @@ -80,7 +81,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { - $upload_dir = $conf->knowledgemanagement->multidir_output[$object->entity]."/".$object->id; + $upload_dir = (!empty($conf->knowledgemanagement->multidir_output[$object->entity]) ? $conf->knowledgemanagement->multidir_output[$object->entity] : $conf->knowledgemanagement->dir_output)."/".$object->id; } // Security check - Protection if external user diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index baddd9e29a5..66b7b0ca160 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -44,7 +44,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'knowledgerecordcard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); -//$lineid = GETPOST('lineid', 'int'); +$lineid = GETPOST('lineid', 'int'); // Initialize technical objects $object = new KnowledgeRecord($db); diff --git a/htdocs/knowledgemanagement/knowledgerecord_document.php b/htdocs/knowledgemanagement/knowledgerecord_document.php index ec88c33d882..ce185c9b8cf 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_document.php +++ b/htdocs/knowledgemanagement/knowledgerecord_document.php @@ -49,7 +49,7 @@ $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("pa if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$offset = $liste_limit * $page; +$offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (!$sortorder) { diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index b903ab83acc..3f68c444fd2 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -51,6 +51,7 @@ $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'knowledgerecordlist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +$mode = GETPOST('mode', 'aZ09'); $id = GETPOST('id', 'int'); diff --git a/htdocs/langs/am_ET/errors.lang b/htdocs/langs/am_ET/errors.lang index e05f9dc7a2a..20f5b6f264a 100644 --- a/htdocs/langs/am_ET/errors.lang +++ b/htdocs/langs/am_ET/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/ar_DZ/errors.lang b/htdocs/langs/ar_DZ/errors.lang index e05f9dc7a2a..20f5b6f264a 100644 --- a/htdocs/langs/ar_DZ/errors.lang +++ b/htdocs/langs/ar_DZ/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/ar_JO/errors.lang b/htdocs/langs/ar_JO/errors.lang index e05f9dc7a2a..20f5b6f264a 100644 --- a/htdocs/langs/ar_JO/errors.lang +++ b/htdocs/langs/ar_JO/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/ar_SA/errors.lang b/htdocs/langs/ar_SA/errors.lang index 0b94eabbb83..436921eaaef 100644 --- a/htdocs/langs/ar_SA/errors.lang +++ b/htdocs/langs/ar_SA/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/ar_SY/errors.lang b/htdocs/langs/ar_SY/errors.lang index 0bac7cf07c8..8097d3a5b6f 100644 --- a/htdocs/langs/ar_SY/errors.lang +++ b/htdocs/langs/ar_SY/errors.lang @@ -270,7 +270,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/az_AZ/errors.lang b/htdocs/langs/az_AZ/errors.lang index e05f9dc7a2a..20f5b6f264a 100644 --- a/htdocs/langs/az_AZ/errors.lang +++ b/htdocs/langs/az_AZ/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/bg_BG/errors.lang b/htdocs/langs/bg_BG/errors.lang index ceb6c75ae21..f254274c96d 100644 --- a/htdocs/langs/bg_BG/errors.lang +++ b/htdocs/langs/bg_BG/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/bn_BD/errors.lang b/htdocs/langs/bn_BD/errors.lang index e05f9dc7a2a..20f5b6f264a 100644 --- a/htdocs/langs/bn_BD/errors.lang +++ b/htdocs/langs/bn_BD/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/bn_IN/errors.lang b/htdocs/langs/bn_IN/errors.lang index e05f9dc7a2a..20f5b6f264a 100644 --- a/htdocs/langs/bn_IN/errors.lang +++ b/htdocs/langs/bn_IN/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/bs_BA/errors.lang b/htdocs/langs/bs_BA/errors.lang index 864a09e3e63..25fa336f994 100644 --- a/htdocs/langs/bs_BA/errors.lang +++ b/htdocs/langs/bs_BA/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/ca_ES/errors.lang b/htdocs/langs/ca_ES/errors.lang index 26ec96567de..1cdc1133512 100644 --- a/htdocs/langs/ca_ES/errors.lang +++ b/htdocs/langs/ca_ES/errors.lang @@ -270,7 +270,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=Primer heu de configurar el vostre pla ErrorFailedToFindEmailTemplate=No s'ha pogut trobar la plantilla amb el nom de codi %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Durada no definida al servei. No hi ha manera de calcular el preu per hora. ErrorActionCommPropertyUserowneridNotDefined=El propietari de l'usuari és obligatori -ErrorActionCommBadType=El tipus d'esdeveniment seleccionat (identificador: %n, codi: %s) no existeix al diccionari del tipus d'esdeveniment +ErrorActionCommBadType=El tipus d'esdeveniment seleccionat (identificador: %s, codi: %s) no existeix al diccionari del tipus d'esdeveniment CheckVersionFail=Error de comprovació de versió ErrorWrongFileName=El nom del fitxer no pot contenir __COSA__ ErrorNotInDictionaryPaymentConditions=No es troba al Diccionari de condicions de pagament, modifiqueu-lo. diff --git a/htdocs/langs/cs_CZ/errors.lang b/htdocs/langs/cs_CZ/errors.lang index e530b0dbba3..15fdd697542 100644 --- a/htdocs/langs/cs_CZ/errors.lang +++ b/htdocs/langs/cs_CZ/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/cy_GB/errors.lang b/htdocs/langs/cy_GB/errors.lang index 01244d8d8eb..67831088584 100644 --- a/htdocs/langs/cy_GB/errors.lang +++ b/htdocs/langs/cy_GB/errors.lang @@ -270,7 +270,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=Yn gyntaf rhaid i chi osod eich siart c ErrorFailedToFindEmailTemplate=Wedi methu dod o hyd i dempled gydag enw cod %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Hyd heb ei ddiffinio ar y gwasanaeth. Dim ffordd i gyfrifo'r pris fesul awr. ErrorActionCommPropertyUserowneridNotDefined=Mae angen perchennog y defnyddiwr -ErrorActionCommBadType=Nid yw'r math o ddigwyddiad a ddewiswyd (id: %n, cod: %s) yn bodoli mewn geiriadur Math o Ddigwyddiad +ErrorActionCommBadType=Nid yw'r math o ddigwyddiad a ddewiswyd (id: %s, cod: %s) yn bodoli mewn geiriadur Math o Ddigwyddiad CheckVersionFail=Fersiwn gwirio yn methu ErrorWrongFileName=Ni all enw'r ffeil fod â __SOMETHING__ ynddi ErrorNotInDictionaryPaymentConditions=Ddim yn y Geiriadur Telerau Talu, addaswch. diff --git a/htdocs/langs/da_DK/errors.lang b/htdocs/langs/da_DK/errors.lang index f290ed2774a..76a687af8da 100644 --- a/htdocs/langs/da_DK/errors.lang +++ b/htdocs/langs/da_DK/errors.lang @@ -270,7 +270,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=Du skal først konfigurere din kontopla ErrorFailedToFindEmailTemplate=Kunne ikke finde skabelon med kodenavn %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Varighed er ikke defineret i tjenesten. Ingen måde at beregne timeprisen på. ErrorActionCommPropertyUserowneridNotDefined=Brugerens ejer kræves -ErrorActionCommBadType=Den valgte hændelsestype (id: %n, kode: %s) findes ikke i begivenhedstypeordbogen +ErrorActionCommBadType=Den valgte hændelsestype (id: %s, kode: %s) findes ikke i begivenhedstypeordbogen CheckVersionFail=Versionskontrol mislykkedes ErrorWrongFileName=Filens navn kan ikke indeholde __SOMETHING__ ErrorNotInDictionaryPaymentConditions=Ikke i ordbogen om betalingsbetingelser, bedes du ændre. @@ -322,11 +322,6 @@ WarningAvailableOnlyForHTTPSServers=Kun tilgængelig, hvis du bruger HTTPS-sikre WarningModuleXDisabledSoYouMayMissEventHere=Modul %s er ikke aktiveret. Så du går måske glip af en masse begivenheder her. WarningPaypalPaymentNotCompatibleWithStrict=Værdien 'Strict' gør, at onlinebetalingsfunktionerne ikke fungerer korrekt. Brug 'Lax' i stedet. -<<<<<<< HOVED -======= -<<<<<<< HOVED -<<<<<<< HOVED ->>>>>>> gren '15.0' af git@github.com:Dolibarr/dolibarr.git # Validate RequireValidValue = Værdien er ikke gyldig RequireAtLeastXString = Kræver mindst %s karakter (er) @@ -347,12 +342,3 @@ BadSetupOfField = Fejl ved dårlig opsætning af feltet BadSetupOfFieldClassNotFoundForValidation = Fejl ved dårlig opsætning af feltet: Klassen blev ikke fundet til validering BadSetupOfFieldFileNotFound = Fejl ved dårlig opsætning af feltet: Filen blev ikke fundet til inkludering BadSetupOfFieldFetchNotCallable = Fejl dårlig opsætning af felt: Hentning kan ikke kaldes på klassen -<<<<<<< HOVED -======= -======= -======= ->>>>>>> gren '15.0' af git@github.com:Dolibarr/dolibarr.git ->>>>>>> gren '15.0' af git@github.com:Dolibarr/dolibarr.git -======= ->>>>>>> gren '15.0' af git@github.com:Dolibarr/dolibarr.git ->>>>>>> gren '15.0' af git@github.com:Dolibarr/dolibarr.git diff --git a/htdocs/langs/de_DE/errors.lang b/htdocs/langs/de_DE/errors.lang index f0dcb3381c3..b871ef62d28 100644 --- a/htdocs/langs/de_DE/errors.lang +++ b/htdocs/langs/de_DE/errors.lang @@ -271,7 +271,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=Sie müssen zuerst Ihren Kontenplan ein ErrorFailedToFindEmailTemplate=Vorlage mit Codename %s konnte nicht gefunden werden ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Die Dauer für die Leistung ist nicht definiert. Es besteht keine Möglichkeit, den Stundenpreis zu berechnen. ErrorActionCommPropertyUserowneridNotDefined=Der Besitzer des Benutzers ist erforderlich -ErrorActionCommBadType=Der ausgewählte Ereignistyp (ID: %n, Code: %s) ist im Wörterbuch für den Ereignistyp nicht vorhanden +ErrorActionCommBadType=Der ausgewählte Ereignistyp (ID: %s, Code: %s) ist im Wörterbuch für den Ereignistyp nicht vorhanden CheckVersionFail=Versionsprüfung fehlgeschlagen ErrorWrongFileName=Der Dateiname darf nicht __SOMETHING__ enthalten ErrorNotInDictionaryPaymentConditions=Nicht im Dictionary der Zahlungsbedingungen, bitte ändern. diff --git a/htdocs/langs/el_GR/errors.lang b/htdocs/langs/el_GR/errors.lang index f30e49f7fe7..15d6c44b1c8 100644 --- a/htdocs/langs/el_GR/errors.lang +++ b/htdocs/langs/el_GR/errors.lang @@ -271,7 +271,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=Πρέπει πρώτα να ρυθμί ErrorFailedToFindEmailTemplate=Αδυναμία εύρεσης προτύπου με κωδικό όνομα %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Η διάρκεια δεν έχει οριστεί στην υπηρεσία. Δεν υπάρχει τρόπος υπολογισμού της ωριαίας τιμής. ErrorActionCommPropertyUserowneridNotDefined=Απαιτείται το owner id του χρήστη -ErrorActionCommBadType=Ο επιλεγμένος τύπος συμβάντος (αναγνωριστικό: %n, κωδικός: %s) δεν υπάρχει στο λεξικό Τύπου συμβάντος +ErrorActionCommBadType=Ο επιλεγμένος τύπος συμβάντος (αναγνωριστικό: %s, κωδικός: %s) δεν υπάρχει στο λεξικό Τύπου συμβάντος CheckVersionFail=Αποτυχία ελέγχου έκδοσης ErrorWrongFileName=Το όνομα του αρχείου δεν μπορεί να έχει __ΚΑΤΙ__ σε αυτό ErrorNotInDictionaryPaymentConditions=Δεν υπάρχει στο Λεξικό Όρων Πληρωμής, παρακαλώ τροποποιήστε. diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6067d66f109..16c39d3f3d8 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -477,7 +477,7 @@ InstalledInto=Installed into directory %s BarcodeInitForThirdparties=Mass barcode init for third-parties BarcodeInitForProductsOrServices=Mass barcode init or reset for products or services CurrentlyNWithoutBarCode=Currently, you have %s record on %s %s without barcode defined. -InitEmptyBarCode=Init value for next %s empty records +InitEmptyBarCode=Init value for the %s empty barcodes EraseAllCurrentBarCode=Erase all current barcode values ConfirmEraseAllCurrentBarCode=Are you sure you want to erase all current barcode values? AllBarcodeReset=All barcode values have been removed @@ -739,6 +739,7 @@ Permission79=Create/modify subscriptions Permission81=Read customers orders Permission82=Create/modify customers orders Permission84=Validate customers orders +Permission85=Generate the documents sales orders Permission86=Send customers orders Permission87=Close customers orders Permission88=Cancel customers orders @@ -1129,7 +1130,7 @@ ValueOfConstantKey=Value of a configuration constant ConstantIsOn=Option %s is on NbOfDays=No. of days AtEndOfMonth=At end of month -CurrentNext=Current/Next +CurrentNext=A given day in month Offset=Offset AlwaysActive=Always active Upgrade=Upgrade @@ -2066,6 +2067,7 @@ EmailCollectors=Email collectors EmailCollectorDescription=Add a scheduled job and a setup page to scan regularly email boxes (using IMAP protocol) and record emails received into your application, at the right place and/or create some records automatically (like leads). NewEmailCollector=New Email Collector EMailHost=Host of email IMAP server +EMailHostPort=Port of email IMAP server MailboxSourceDirectory=Mailbox source directory MailboxTargetDirectory=Mailbox target directory EmailcollectorOperations=Operations to do by collector @@ -2109,7 +2111,7 @@ CreateCandidature=Create job application FormatZip=Zip MainMenuCode=Menu entry code (mainmenu) ECMAutoTree=Show automatic ECM tree -OperationParamDesc=Define the rules to use to extract or set values.
Example for operations that need to extract a name from email subject:
name=EXTRACT:SUBJECT:Message from company ([^\n]*)
Example for operations that create objects:
objproperty1=SET:the value to set
objproperty2=SET:a value including value of __objproperty1__
objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
objproperty4=EXTRACT:HEADER:X-Myheaderkey:\s*([^\s]*)
options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
object.objproperty5=EXTRACT:BODY:My company name is\s([^\s]*)

Use a ; char as separator to extract or set several properties. +OperationParamDesc=Define the rules to use to extract some data or set values to use for operation.

Example to extract a company name from email subject into a temporary variable:
tmp_var=EXTRACT:SUBJECT:Message from company ([^\n]*)

Examples to set the properties of an object to create:
objproperty1=SET:a hard coded value
objproperty2=SET:__tmp_var__
objproperty3=SETIFEMPTY:a value (value is set only if property is not already defined)
objproperty4=EXTRACT:HEADER:X-Myheaderkey:\s*([^\s]*)
options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
object.objproperty5=EXTRACT:BODY:My company name is\s([^\s]*)

Use a ; char as separator to extract or set several properties. OpeningHours=Opening hours OpeningHoursDesc=Enter here the regular opening hours of your company. ResourceSetup=Configuration of Resource module @@ -2288,4 +2290,6 @@ DoesNotWorkWithAllThemes=Will not work with all themes NoName=No name ShowAdvancedOptions= Show advanced options HideAdvancedoptions= Hide advanced options +Images=Images +MaxNumberOfImagesInGetPost=Max number of images allowed in GETPOST check CIDLookupURL=The module brings an URL that can be used by an external tool to get the name of a thirdparty or contact from its phone number. URL to use is: diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index b8f9ffa857b..9dffacf774c 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -136,7 +136,7 @@ AgendaUrlOptionsNotAdmin=logina=!%s to restrict output to actions not own AgendaUrlOptions4=logint=%s to restrict output to actions assigned to user %s (owner and others). AgendaUrlOptionsProject=project=__PROJECT_ID__ to restrict output to actions linked to project __PROJECT_ID__. AgendaUrlOptionsNotAutoEvent=notactiontype=systemauto to exclude automatic events. -AgendaUrlOptionsIncludeHolidays=includeholidays=1 to include events of holidays. +AgendaUrlOptionsIncludeHolidays=includeholidays=1 to include events of holidays. AgendaShowBirthdayEvents=Birthdays of contacts AgendaHideBirthdayEvents=Hide birthdays of contacts Busy=Busy @@ -160,6 +160,7 @@ DateActionBegin=Start event date ConfirmCloneEvent=Are you sure you want to clone the event %s? RepeatEvent=Repeat event OnceOnly=Once only +EveryDay=Every day EveryWeek=Every week EveryMonth=Every month DayOfMonth=Day of month @@ -175,3 +176,4 @@ AddReminder=Create an automatic reminder notification for this event ErrorReminderActionCommCreation=Error creating the reminder notification for this event BrowserPush=Browser Popup Notification ActiveByDefault=Enabled by default +Until=until \ No newline at end of file diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index 07b91316771..9cde66460d3 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -59,7 +59,7 @@ BillsCoinsPad=Coins and banknotes Pad DolistorePosCategory=TakePOS modules and other POS solutions for Dolibarr TakeposNeedsCategories=TakePOS needs at least one product categorie to work TakeposNeedsAtLeastOnSubCategoryIntoParentCategory=TakePOS needs at least 1 product category under the category %s to work -OrderNotes=Can add some notes to each ordered items +OrderNotes=Can add some notes to each ordered items CashDeskBankAccountFor=Default account to use for payments in NoPaimementModesDefined=No paiment mode defined in TakePOS configuration TicketVatGrouped=Group VAT by rate in tickets|receipts @@ -118,7 +118,7 @@ ScanToOrder=Scan QR code to order Appearance=Appearance HideCategoryImages=Hide Category Images HideProductImages=Hide Product Images -NumberOfLinesToShow=Number of lines of images to show +NumberOfLinesToShow=Number of lines of images to show DefineTablePlan=Define tables plan GiftReceiptButton=Add a "Gift receipt" button GiftReceipt=Gift receipt @@ -138,8 +138,10 @@ TakeposBarcodeRuleToInsertProduct=Barcode rule to insert product TakeposBarcodeRuleToInsertProductDesc=Rule to extract the product reference + a quantity from a scanned barcode.
If empty (default value), application will use the full barcode scanned to find the product.

If defined, syntax must be:
ref:NB+qu:NB+qd:NB+other:NB
where NB is the number of characters to use to extract data from the scanned barcode with:
  • ref : product reference
  • qu : quantity to set when inserting item (units)
  • qd : quantity to set when inserting item (decimals)
  • other : others characters
AlreadyPrinted=Already printed HideCategories=Hide categories -HideStockOnLine=Hide stock on line -ShowOnlyProductInStock=Show the products in stock +HideStockOnLine=Hide stock on line +ShowOnlyProductInStock=Show the products in stock ShowCategoryDescription=Show category description ShowProductReference=Show reference of products -UsePriceHT=Use price excl. taxes and not price incl. taxes \ No newline at end of file +UsePriceHT=Use price excl. taxes and not price incl. taxes +TerminalName=Terminal %s +TerminalNameDesc=Terminal name diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 71b16f24506..996c98c203a 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -444,7 +444,7 @@ AddAddress=Add address SupplierCategory=Vendor category JuridicalStatus200=Independent DeleteFile=Delete file -ConfirmDeleteFile=Are you sure you want to delete this file? +ConfirmDeleteFile=Are you sure you want to delete this file %s? AllocateCommercial=Assigned to sales representative Organization=Organization FiscalYearInformation=Fiscal Year diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index c50ccc810cf..ebdb359a66e 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -271,7 +271,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. @@ -289,11 +289,13 @@ ErrorInvoiceLoadThirdPartyKey=Third-party key "%s" no set for invoice "%s" ErrorDeleteLineNotAllowedByObjectStatus=Delete line is not allowed by current object status ErrorAjaxRequestFailed=Request failed ErrorThirpdartyOrMemberidIsMandatory=Third party or Member of partnership is mandatory +ErrorFailedToWriteInTempDirectory=Failed to write in temp directory +ErrorQuantityIsLimitedTo=Quantity is limited to %s # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user. -WarningMandatorySetupNotComplete=Click here to setup mandatory parameters +WarningMandatorySetupNotComplete=Click here to setup main parameters WarningEnableYourModulesApplications=Click here to enable your modules and applications WarningSafeModeOnCheckExecDir=Warning, PHP option safe_mode is on so command must be stored inside a directory declared by php parameter safe_mode_exec_dir. WarningBookmarkAlreadyExists=A bookmark with this title or this target (URL) already exists. @@ -324,7 +326,8 @@ WarningAvailableOnlyForHTTPSServers=Available only if using HTTPS secured connec WarningModuleXDisabledSoYouMayMissEventHere=Module %s has not been enabled. So you may miss a lot of event here. WarningPaypalPaymentNotCompatibleWithStrict=The value 'Strict' makes the online payment features not working correctly. Use 'Lax' instead. WarningThemeForcedTo=Warning, theme has been forced to %s by hidden constant MAIN_FORCETHEME - +WarningPagesWillBeDeleted=Warning, this will also delete all existing pages/containers of the website. You should export your website before, so you have a backup to re-import it later. + # Validate RequireValidValue = Value not valid RequireAtLeastXString = Requires at least %s character(s) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 858e0937788..b4179b04be6 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -60,6 +60,8 @@ ConferenceOrBoothTab = Conference Or Booth AmountPaid = Amount paid DateOfRegistration = Date of registration ConferenceOrBoothAttendee = Conference Or Booth Attendee +ApplicantOrVisitor=Applicant or visitor +Speaker=Speaker # # Template Mail @@ -139,6 +141,7 @@ OrganizationEventPaymentOfRegistrationWasReceived=Your payment for your event re OrganizationEventBulkMailToAttendees=This is a remind about your participation in the event as an attendee OrganizationEventBulkMailToSpeakers=This is a reminder on your participation in the event as a speaker OrganizationEventLinkToThirdParty=Link to third party (customer, supplier or partner) +OrganizationEvenLabelName=Public name of the conference or booth NewSuggestionOfBooth=Application for a booth NewSuggestionOfConference=Application for a conference diff --git a/htdocs/langs/en_US/knowledgemanagement.lang b/htdocs/langs/en_US/knowledgemanagement.lang index ee93715a5c0..1746b0671ce 100644 --- a/htdocs/langs/en_US/knowledgemanagement.lang +++ b/htdocs/langs/en_US/knowledgemanagement.lang @@ -46,7 +46,7 @@ KnowledgeRecords = Articles KnowledgeRecord = Article KnowledgeRecordExtraFields = Extrafields for Article GroupOfTicket=Group of tickets -YouCanLinkArticleToATicketCategory=You can link an article to a ticket group (so the article will be suggested during qualification of new tickets) +YouCanLinkArticleToATicketCategory=You can link the article to a ticket group (so the article will be highlighted on any tickets in this group) SuggestedForTicketsInGroup=Suggested for tickets when group is SetObsolete=Set as obsolete diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 4e6e274b25b..2c532f339c3 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1185,4 +1185,6 @@ CommercialAffected=Sales representative affected YourMessage=Your message YourMessageHasBeenReceived=Your message has been received. We will answer or contact you as soon as possible. UrlToCheck=Url to check -Automation=Automation \ No newline at end of file +Automation=Automation +CreatedByEmailCollector=Created by Email collector +CreatedByPublicPortal=Created from Public portal diff --git a/htdocs/langs/en_US/oauth.lang b/htdocs/langs/en_US/oauth.lang index 08f7956f455..b7f7c0c2c1a 100644 --- a/htdocs/langs/en_US/oauth.lang +++ b/htdocs/langs/en_US/oauth.lang @@ -9,8 +9,9 @@ HasAccessToken=A token was generated and saved into local database NewTokenStored=Token received and saved ToCheckDeleteTokenOnProvider=Click here to check/delete authorization saved by %s OAuth provider TokenDeleted=Token deleted +GetAccess=Click here to get a token RequestAccess=Click here to request/renew access and receive a new token -DeleteAccess=Click here to delete token +DeleteAccess=Click here to delete the token UseTheFollowingUrlAsRedirectURI=Use the following URL as the Redirect URI when creating your credentials with your OAuth provider: ListOfSupportedOauthProviders=Add your OAuth2 token providers. Then, go on your OAuth provider admin page to create/get an OAuth ID and Secret and save them here. Once done, switch on the other tab to generate your token. OAuthSetupForLogin=Page to manage (generate/delete) OAuth tokens @@ -33,4 +34,6 @@ OAUTH_STRIPE_LIVE_NAME=OAuth Stripe Live OAUTH_ID=OAuth ID OAUTH_SECRET=OAuth secret OAuthProviderAdded=OAuth provider added -AOAuthEntryForThisProviderAndLabelAlreadyHasAKey=An OAuth entry for this provider and label already exists \ No newline at end of file +AOAuthEntryForThisProviderAndLabelAlreadyHasAKey=An OAuth entry for this provider and label already exists +URLOfServiceForAuthorization=URL provided by OAuth service for authentication +Scopes=Scopes \ No newline at end of file diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index e533dc71fa5..daa52aac9fe 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -311,10 +311,10 @@ ExternalSiteURL=External Site URL of HTML iframe content ExternalSiteModuleNotComplete=Module ExternalSite was not configured properly. ExampleMyMenuEntry=My menu entry -# FTP +# ftp FTPClientSetup=FTP or SFTP Client module setup -NewFTPClient=New FTP/FTPS connection setup -FTPArea=FTP/FTPS Area +NewFTPClient=New FTP/SFTP connection setup +FTPArea=FTP/SFTP Area FTPAreaDesc=This screen shows a view of an FTP et SFTP server. SetupOfFTPClientModuleNotComplete=The setup of the FTP or SFTP client module seems to be incomplete FTPFeatureNotSupportedByYourPHP=Your PHP does not support FTP or SFTP functions @@ -325,3 +325,6 @@ FTPFailedToRemoveDir=Failed to remove directory %s: check permissions and FTPPassiveMode=Passive mode ChooseAFTPEntryIntoMenu=Choose a FTP/SFTP site from the menu... FailedToGetFile=Failed to get files %s +ErrorFTPNodisconnect=Error to disconnect FTP/SFTP server +FileWasUpload=File %s was upload +FTPFailedToUploadFile=Failed to upload file %s. diff --git a/htdocs/langs/en_US/stripe.lang b/htdocs/langs/en_US/stripe.lang index 0a376ca9fb1..3ea0cf2354b 100644 --- a/htdocs/langs/en_US/stripe.lang +++ b/htdocs/langs/en_US/stripe.lang @@ -68,4 +68,5 @@ ToOfferALinkForTestWebhook=Link to setup Stripe WebHook to call the IPN (test mo ToOfferALinkForLiveWebhook=Link to setup Stripe WebHook to call the IPN (live mode) PaymentWillBeRecordedForNextPeriod=Payment will be recorded for the next period. ClickHereToTryAgain=Click here to try again... -CreationOfPaymentModeMustBeDoneFromStripeInterface=Due to Strong Customer Authentication rules, creation of a card must be done from Stripe backoffice. You can click here to switch on Stripe customer record: %s \ No newline at end of file +CreationOfPaymentModeMustBeDoneFromStripeInterface=Due to Strong Customer Authentication rules, creation of a card must be done from Stripe backoffice. You can click here to switch on Stripe customer record: %s +TERMINAL_LOCATION=Location (address) for terminals \ No newline at end of file diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index b5ef14bd118..59a23e65d9b 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -1,5 +1,6 @@ # Dolibarr language file - Source file is en_US - website Shortname=Code +WebsiteName=Name of the website WebsiteSetupDesc=Create here the websites you wish to use. Then go into menu Websites to edit them. DeleteWebsite=Delete website ConfirmDeleteWebsite=Are you sure you want to delete this web site? All its pages and content will also be removed. The files uploaded (like into the medias directory, the ECM module, ...) will remain. @@ -42,6 +43,8 @@ ViewPageInNewTab=View page in new tab SetAsHomePage=Set as Home page RealURL=Real URL ViewWebsiteInProduction=View web site using home URLs +Virtualhost=Virtual host or domain name +VirtualhostDesc=The name of the Virtual host or domain (For example: www.mywebsite.com, mybigcompany.net, ...) SetHereVirtualHost=Use with Apache/NGinx/...
Create on your web server (Apache, Nginx, ...) a dedicated Virtual Host with PHP enabled and a Root directory on
%s ExampleToUseInApacheVirtualHostConfig=Example to use in Apache virtual host setup: YouCanAlsoTestWithPHPS=Use with PHP embedded server
On develop environment, you may prefer to test the site with the PHP embedded web server (PHP 5.5 required) by running
php -S 0.0.0.0:8080 -t %s @@ -145,3 +148,5 @@ ImportFavicon=Favicon ErrorFaviconType=Favicon must be png ErrorFaviconSize=Favicon must be sized 16x16, 32x32 or 64x64 FaviconTooltip=Upload an image which needs to be a png (16x16, 32x32 or 64x64) +NextContainer=Next page/container +PreviousContainer=Previous page/container diff --git a/htdocs/langs/es_ES/errors.lang b/htdocs/langs/es_ES/errors.lang index 1c8597c2b51..6f8a4fa537a 100644 --- a/htdocs/langs/es_ES/errors.lang +++ b/htdocs/langs/es_ES/errors.lang @@ -270,7 +270,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=Primero debe configurar su plan de cuen ErrorFailedToFindEmailTemplate=No se pudo encontrar la plantilla con el nombre de código %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duración no definida en el servicio. No hay forma de calcular el precio por hora. ErrorActionCommPropertyUserowneridNotDefined=Se requiere el propietario del usuario -ErrorActionCommBadType=El tipo de evento seleccionado (id: %n, código: %s) no existe en el diccionario de tipo de evento +ErrorActionCommBadType=El tipo de evento seleccionado (id: %s, código: %s) no existe en el diccionario de tipo de evento CheckVersionFail=Error de verificación de versión ErrorWrongFileName=El nombre del archivo no puede contener __SOMETHING__ ErrorNotInDictionaryPaymentConditions=No está en el Diccionario de términos de pago, modifíquelo. @@ -322,11 +322,6 @@ WarningAvailableOnlyForHTTPSServers=Disponible solo si usa una conexión segura WarningModuleXDisabledSoYouMayMissEventHere=El módulo %s no se ha habilitado. Así que puede perderse muchos eventos aquí. WarningPaypalPaymentNotCompatibleWithStrict=El valor 'Estricto' hace que las funciones de pago en línea no funcionen correctamente. Utilice 'Lax' en su lugar. -<<<<<<< HEAD -======= -<<<<<<< HEAD -<<<<<<< HEAD ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git # Validate RequireValidValue = Valor no válido RequireAtLeastXString = Requiere al menos %s carácter(es) @@ -347,12 +342,3 @@ BadSetupOfField = Error de configuración incorrecta del campo BadSetupOfFieldClassNotFoundForValidation = Error de configuración incorrecta del campo: clase no encontrada para validación BadSetupOfFieldFileNotFound = Error de configuración incorrecta del campo: no se encontró el archivo para su inclusión BadSetupOfFieldFetchNotCallable = Error de configuración incorrecta del campo: la recuperación no se puede llamar en la clase -<<<<<<< HEAD -======= -======= -======= ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git -======= ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git diff --git a/htdocs/langs/et_EE/errors.lang b/htdocs/langs/et_EE/errors.lang index e6cb1458234..3e4e7b3638a 100644 --- a/htdocs/langs/et_EE/errors.lang +++ b/htdocs/langs/et_EE/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/eu_ES/errors.lang b/htdocs/langs/eu_ES/errors.lang index e05f9dc7a2a..20f5b6f264a 100644 --- a/htdocs/langs/eu_ES/errors.lang +++ b/htdocs/langs/eu_ES/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/fa_IR/errors.lang b/htdocs/langs/fa_IR/errors.lang index 1231bb9e621..4cd240fef47 100644 --- a/htdocs/langs/fa_IR/errors.lang +++ b/htdocs/langs/fa_IR/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/fi_FI/errors.lang b/htdocs/langs/fi_FI/errors.lang index bbbace60e76..9a5148d92c3 100644 --- a/htdocs/langs/fi_FI/errors.lang +++ b/htdocs/langs/fi_FI/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/fr_FR/agenda.lang b/htdocs/langs/fr_FR/agenda.lang index 65e06587e88..a589163dfad 100644 --- a/htdocs/langs/fr_FR/agenda.lang +++ b/htdocs/langs/fr_FR/agenda.lang @@ -96,7 +96,7 @@ PRODUCT_MODIFYInDolibarr=Produit %s modifié PRODUCT_DELETEInDolibarr=Produit%ssupprimé HOLIDAY_CREATEInDolibarr=Demande de congé %s créée HOLIDAY_MODIFYInDolibarr=Demande de congé %s modifiée -HOLIDAY_APPROVEInDolibarr=Demande de congé %s approuvée +HOLIDAY_APPROVEInDolibarr=Demande de congé %s approuvée HOLIDAY_VALIDATEInDolibarr=Demande de congé %s validée HOLIDAY_DELETEInDolibarr=Demande de congé %s supprimée EXPENSE_REPORT_CREATEInDolibarr=Note de frais %s créée @@ -157,6 +157,7 @@ DateActionBegin=Date début événément ConfirmCloneEvent=Êtes-vous sûr de vouloir cloner cet événement %s ? RepeatEvent=Evénement répétitif OnceOnly=Une seule fois +EveryDay=Chaque jour EveryWeek=Chaque semaine EveryMonth=Chaque mois DayOfMonth=Jour du mois @@ -172,3 +173,4 @@ AddReminder=Créer une notification de rappel automatique pour cet événement ErrorReminderActionCommCreation=Erreur lors de la création de la notification de rappel pour cet événement BrowserPush=Notification par Popup navigateur ActiveByDefault=Activé par défaut +Until=jusqu'à diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index 889f16b3f75..3359131aa51 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -443,7 +443,7 @@ AddAddress=Créer adresse SupplierCategory=Catégorie du fournisseur JuridicalStatus200=Indépendant DeleteFile=Suppression d'un fichier -ConfirmDeleteFile=Êtes-vous sûr de vouloir supprimer ce fichier ? +ConfirmDeleteFile=Êtes-vous sûr de vouloir supprimer ce fichier %s? AllocateCommercial=Affecter un commercial Organization=Organisme FiscalYearInformation=Exercice fiscal diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index 234dc56941c..fa0112fc021 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -270,7 +270,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=Vous devez d’abord configurer votre p ErrorFailedToFindEmailTemplate=Aucun gabarit trouvé avec le code %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Durée non définie sur le service. Pas moyen de calculer le prix horaire. ErrorActionCommPropertyUserowneridNotDefined=Le propriétaire de l'utilisateur est requis -ErrorActionCommBadType=Le type d'événement sélectionné (id: %n, code: %s) n'existe pas dans le dictionnaire des types d'événement +ErrorActionCommBadType=Le type d'événement sélectionné (id: %s, code: %s) n'existe pas dans le dictionnaire des types d'événement CheckVersionFail=Échec de la vérification de version ErrorWrongFileName=Le nom du fichier ne peut pas contenir __SOMETHING__ ErrorNotInDictionaryPaymentConditions=Pas dans le dictionnaire des conditions de paiement, veuillez modifier. diff --git a/htdocs/langs/gl_ES/errors.lang b/htdocs/langs/gl_ES/errors.lang index eda9523d233..491d37ee6b9 100644 --- a/htdocs/langs/gl_ES/errors.lang +++ b/htdocs/langs/gl_ES/errors.lang @@ -270,7 +270,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=Primeiro debe configurar o seu plan de ErrorFailedToFindEmailTemplate=Fallo ao atopar o modelo co nome de código %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duración non definida no servizo. Non hai forma de calcular o prezo por hora. ErrorActionCommPropertyUserowneridNotDefined=É preciso o supervisor do usuario -ErrorActionCommBadType=O tipo de evento seleccionado (id: %n, código: %s) non existe no diccionario Tipo de Evento +ErrorActionCommBadType=O tipo de evento seleccionado (id: %s, código: %s) non existe no diccionario Tipo de Evento CheckVersionFail=Fallou a comprobación da versión ErrorWrongFileName=O nome do ficheiro non pode conte __SOMETHING__ nel ErrorNotInDictionaryPaymentConditions=Non está no Dicionario de Condicións de Pagamento. Modifíqueo. @@ -322,11 +322,6 @@ WarningAvailableOnlyForHTTPSServers=Dispoñible só se usa conexión segura HTTP WarningModuleXDisabledSoYouMayMissEventHere=Non foi activado o módulo %s . Pode que perda moitos eventos aquí WarningPaypalPaymentNotCompatibleWithStrict=O valor "Estricto" fai que as funcións de pago en liña non funcionen correctamente. Use "Laxo" no seu lugar. -<<<<<<< CABECEIRA -======= -<<<<<<< CABECEIRA -<<<<<<< CABECEIRA ->>>>>>> rama '15.0' de git@github.com:Dolibarr/dolibarr.git # Validate RequireValidValue = Valor non válido RequireAtLeastXString = Require polo menos %s caracter(es) @@ -347,12 +342,3 @@ BadSetupOfField = Erro de configuración do campo BadSetupOfFieldClassNotFoundForValidation = Erro de configuración do campo: Non se atopou a clase para validación BadSetupOfFieldFileNotFound = Erro de configuración do campo: Non se atopou o ficheiro para a súa inclusión  BadSetupOfFieldFetchNotCallable = Erro de configuración do campo: A recuperación non se pode chamar na clase -<<<<<<< CABECEIRA -======= -======= -======= ->>>>>>> rama '15.0' de git@github.com:Dolibarr/dolibarr.git ->>>>>>> rama '15.0' de git@github.com:Dolibarr/dolibarr.git -======= ->>>>>>> rama '15.0' de git@github.com:Dolibarr/dolibarr.git ->>>>>>> rama '15.0' de git@github.com:Dolibarr/dolibarr.git diff --git a/htdocs/langs/he_IL/errors.lang b/htdocs/langs/he_IL/errors.lang index e05f9dc7a2a..20f5b6f264a 100644 --- a/htdocs/langs/he_IL/errors.lang +++ b/htdocs/langs/he_IL/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/hi_IN/errors.lang b/htdocs/langs/hi_IN/errors.lang index e05f9dc7a2a..20f5b6f264a 100644 --- a/htdocs/langs/hi_IN/errors.lang +++ b/htdocs/langs/hi_IN/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/hr_HR/errors.lang b/htdocs/langs/hr_HR/errors.lang index 1d6bf9b2ee0..31f089cdee2 100644 --- a/htdocs/langs/hr_HR/errors.lang +++ b/htdocs/langs/hr_HR/errors.lang @@ -270,7 +270,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Nije uspjelo pronaći predložak s kodnim nazivom %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Trajanje nije definirano na usluzi. Nema načina da se izračuna satnica. ErrorActionCommPropertyUserowneridNotDefined=Potreban je vlasnik korisnika -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Provjera verzije nije uspjela ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/hu_HU/errors.lang b/htdocs/langs/hu_HU/errors.lang index 6e46cdadd26..95b4a560500 100644 --- a/htdocs/langs/hu_HU/errors.lang +++ b/htdocs/langs/hu_HU/errors.lang @@ -270,7 +270,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=Először be kell állítania a számla ErrorFailedToFindEmailTemplate=Nem sikerült megtalálni a %s kódnevű sablont ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=A szolgáltatás időtartama nincs meghatározva. Nincs mód az óraárak kiszámítására. ErrorActionCommPropertyUserowneridNotDefined=A felhasználó tulajdonosa kötelező -ErrorActionCommBadType=A kiválasztott eseménytípus (azonosító: %n, kód: %s) nem létezik az Eseménytípus szótárban +ErrorActionCommBadType=A kiválasztott eseménytípus (azonosító: %s, kód: %s) nem létezik az Eseménytípus szótárban CheckVersionFail=A verzióellenőrzés sikertelen ErrorWrongFileName=A fájl nevében nem lehet __SOMETHING__ ErrorNotInDictionaryPaymentConditions=Nem szerepel a Fizetési feltételek szótárban, kérjük módosítsa. @@ -322,11 +322,6 @@ WarningAvailableOnlyForHTTPSServers=Csak HTTPS biztonságos kapcsolat használat WarningModuleXDisabledSoYouMayMissEventHere=A %s modul nincs engedélyezve. Így sok eseményről lemaradhat itt. WarningPaypalPaymentNotCompatibleWithStrict=A 'Strict' érték miatt az online fizetési funkciók nem működnek megfelelően. Használja helyette a „Lax” szót. -<<<<<<< FEJ -======= -<<<<<<< FEJ -<<<<<<< FEJ ->>>>>>> git@github.com:Dolibarr/dolibarr.git '15.0' ága # Validate RequireValidValue = Az érték nem érvényes RequireAtLeastXString = Legalább %s karakter szükséges @@ -347,12 +342,3 @@ BadSetupOfField = Hiba a mező rossz beállításában BadSetupOfFieldClassNotFoundForValidation = Hiba a mező rossz beállításában: Az osztály nem található az ellenőrzéshez BadSetupOfFieldFileNotFound = Hiba a mező rossz beállításában: A fájl nem található a felvételhez BadSetupOfFieldFetchNotCallable = Hiba a mező rossz beállításában: A lekérés nem hívható az osztályban -<<<<<<< FEJ -======= -======= -======= ->>>>>>> git@github.com:Dolibarr/dolibarr.git '15.0' ága ->>>>>>> git@github.com:Dolibarr/dolibarr.git '15.0' ága -======= ->>>>>>> git@github.com:Dolibarr/dolibarr.git '15.0' ága ->>>>>>> git@github.com:Dolibarr/dolibarr.git '15.0' ága diff --git a/htdocs/langs/id_ID/errors.lang b/htdocs/langs/id_ID/errors.lang index bbe8da704b3..04d81d673ae 100644 --- a/htdocs/langs/id_ID/errors.lang +++ b/htdocs/langs/id_ID/errors.lang @@ -270,7 +270,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=Anda harus terlebih dahulu mengatur bag ErrorFailedToFindEmailTemplate=Gagal menemukan template dengan nama kode %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Durasi tidak ditentukan pada layanan. Tidak ada cara untuk menghitung harga per jam. ErrorActionCommPropertyUserowneridNotDefined=Pemilik pengguna diperlukan -ErrorActionCommBadType=Jenis peristiwa yang dipilih (id: %n, kode: %s) tidak ada di kamus Jenis Peristiwa +ErrorActionCommBadType=Jenis peristiwa yang dipilih (id: %s, kode: %s) tidak ada di kamus Jenis Peristiwa CheckVersionFail=Pemeriksaan versi gagal ErrorWrongFileName=Nama file tidak boleh memiliki __SOMETHING__ di dalamnya ErrorNotInDictionaryPaymentConditions=Tidak ada dalam Kamus Istilah Pembayaran, harap ubah. @@ -322,11 +322,6 @@ WarningAvailableOnlyForHTTPSServers=Hanya tersedia jika menggunakan koneksi aman WarningModuleXDisabledSoYouMayMissEventHere=Modul %s belum diaktifkan. Jadi Anda mungkin melewatkan banyak acara di sini. WarningPaypalPaymentNotCompatibleWithStrict=Nilai 'Strict' membuat fitur pembayaran online tidak berfungsi dengan baik. Gunakan 'Lax' sebagai gantinya. -<<<<<<< KEPALA -======= -<<<<<<< KEPALA -<<<<<<< KEPALA ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git # Validate RequireValidValue = Nilai tidak valid RequireAtLeastXString = Memerlukan setidaknya %s karakter @@ -347,12 +342,3 @@ BadSetupOfField = Salah pengaturan bidang yang buruk BadSetupOfFieldClassNotFoundForValidation = Salah pengaturan bidang yang buruk: Kelas tidak ditemukan untuk validasi BadSetupOfFieldFileNotFound = Salah pengaturan bidang yang buruk: File tidak ditemukan untuk dimasukkan BadSetupOfFieldFetchNotCallable = Salah pengaturan bidang yang buruk: Ambil tidak dapat dipanggil di kelas -<<<<<<< KEPALA -======= -======= -======= ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git -======= ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git diff --git a/htdocs/langs/is_IS/errors.lang b/htdocs/langs/is_IS/errors.lang index a6d3ae56134..d8282e3e62a 100644 --- a/htdocs/langs/is_IS/errors.lang +++ b/htdocs/langs/is_IS/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/it_IT/errors.lang b/htdocs/langs/it_IT/errors.lang index f784773bb16..e7d8359baaf 100644 --- a/htdocs/langs/it_IT/errors.lang +++ b/htdocs/langs/it_IT/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=Devi prima impostare il tuo piano dei c ErrorFailedToFindEmailTemplate=Impossibile trovare il modello con nome in codice %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Durata non definita in servizio. Non c'è modo di calcolare il prezzo orario. ErrorActionCommPropertyUserowneridNotDefined=Il proprietario dell'utente è obbligatorio -ErrorActionCommBadType=Il tipo di evento selezionato (id: %n, codice: %s) non esiste nel dizionario del tipo di evento +ErrorActionCommBadType=Il tipo di evento selezionato (id: %s, codice: %s) non esiste nel dizionario del tipo di evento CheckVersionFail=Controllo della versione fallito ErrorWrongFileName=Il nome del file non può contenere __SOMETHING__ ErrorNotInDictionaryPaymentConditions=Non nel dizionario dei termini di pagamento, modificare. diff --git a/htdocs/langs/ja_JP/errors.lang b/htdocs/langs/ja_JP/errors.lang index d415243148a..4586f206d4a 100644 --- a/htdocs/langs/ja_JP/errors.lang +++ b/htdocs/langs/ja_JP/errors.lang @@ -270,7 +270,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=最初に勘定科目表を設定する ErrorFailedToFindEmailTemplate=コードネーム%sのテンプレートが見つからない ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=サービスで期間が定義されていない。時給計算する方法がない。 ErrorActionCommPropertyUserowneridNotDefined=ユーザの所有者が必要 -ErrorActionCommBadType=選択したイベント種別 (id: %n, code: %s) がイベント種別辞書に存在しない +ErrorActionCommBadType=選択したイベント種別 (id: %s, code: %s) がイベント種別辞書に存在しない CheckVersionFail=バージョンチェックに失敗する ErrorWrongFileName=ファイル名に__SOMETHING__を含めることはできない ErrorNotInDictionaryPaymentConditions=支払条件辞書にないので、変更すること。 @@ -322,11 +322,6 @@ WarningAvailableOnlyForHTTPSServers=HTTPSで保護された接続を使用して WarningModuleXDisabledSoYouMayMissEventHere=モジュール%sが有効になっていない。そのため、ここでは多くのイベントを見逃す可能性がある。 WarningPaypalPaymentNotCompatibleWithStrict=値「Strict」では、現在はオンライン支払機能が正常動作せず。代わりに「Lax」を使用すること。 -<<<<<<< HEAD -======= -<<<<<<< HEAD -<<<<<<< HEAD ->>>>>>> git@github.com:Dolibarr/dolibarr.gitのブランチ「15.0」 # Validate RequireValidValue = 値が無効. RequireAtLeastXString = 少なくとも%s文字(s)が必要 @@ -347,12 +342,3 @@ BadSetupOfField = フィールドの設定エラー BadSetupOfFieldClassNotFoundForValidation = フィールドの設定エラー:検証用のクラスが見つからない BadSetupOfFieldFileNotFound = フィールドの設定が正しくない:含めるファイルが見つからない BadSetupOfFieldFetchNotCallable = フィールドの設定不正エラー:クラスでフェッチを呼び出せない -<<<<<<< HEAD -======= -======= -======= ->>>>>>> git@github.com:Dolibarr/dolibarr.gitのブランチ「15.0」 ->>>>>>> git@github.com:Dolibarr/dolibarr.gitのブランチ「15.0」 -======= ->>>>>>> git@github.com:Dolibarr/dolibarr.gitのブランチ「15.0」 ->>>>>>> git@github.com:Dolibarr/dolibarr.gitのブランチ「15.0」 diff --git a/htdocs/langs/ka_GE/errors.lang b/htdocs/langs/ka_GE/errors.lang index e05f9dc7a2a..20f5b6f264a 100644 --- a/htdocs/langs/ka_GE/errors.lang +++ b/htdocs/langs/ka_GE/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/kk_KZ/errors.lang b/htdocs/langs/kk_KZ/errors.lang index e10bb476fff..6792201a546 100644 --- a/htdocs/langs/kk_KZ/errors.lang +++ b/htdocs/langs/kk_KZ/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=Алдымен сіз өзіңізді ErrorFailedToFindEmailTemplate=%s коды бар үлгі табылмады ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Қызмет көрсету мерзімі анықталмаған. Сағаттық бағаны есептеуге болмайды. ErrorActionCommPropertyUserowneridNotDefined=Пайдаланушының иесі қажет -ErrorActionCommBadType=Таңдалған оқиға түрі (идентификатор: %n, код: %s) оқиға түрі сөздігінде жоқ +ErrorActionCommBadType=Таңдалған оқиға түрі (идентификатор: %s, код: %s) оқиға түрі сөздігінде жоқ CheckVersionFail=Нұсқаны тексеру сәтсіз аяқталды ErrorWrongFileName=Файл атауында __SOMETHING__ болмайды ErrorNotInDictionaryPaymentConditions=Төлем шарттары сөздігінде жоқ, өзгертіңіз. diff --git a/htdocs/langs/km_KH/errors.lang b/htdocs/langs/km_KH/errors.lang index e05f9dc7a2a..20f5b6f264a 100644 --- a/htdocs/langs/km_KH/errors.lang +++ b/htdocs/langs/km_KH/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/kn_IN/errors.lang b/htdocs/langs/kn_IN/errors.lang index e05f9dc7a2a..20f5b6f264a 100644 --- a/htdocs/langs/kn_IN/errors.lang +++ b/htdocs/langs/kn_IN/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/ko_KR/errors.lang b/htdocs/langs/ko_KR/errors.lang index e05f9dc7a2a..20f5b6f264a 100644 --- a/htdocs/langs/ko_KR/errors.lang +++ b/htdocs/langs/ko_KR/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/lo_LA/errors.lang b/htdocs/langs/lo_LA/errors.lang index be5f507a576..8390ff24a66 100644 --- a/htdocs/langs/lo_LA/errors.lang +++ b/htdocs/langs/lo_LA/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=ກ່ອນອື່ນmustົດທ ErrorFailedToFindEmailTemplate=ການຊອກຫາແມ່ແບບທີ່ມີລະຫັດຊື່ %s ລົ້ມເຫລວ ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=ບໍ່ໄດ້ ກຳ ນົດໄລຍະເວລາການບໍລິການ. ບໍ່ມີທາງທີ່ຈະຄິດໄລ່ລາຄາຊົ່ວໂມງ. ErrorActionCommPropertyUserowneridNotDefined=ເຈົ້າຂອງຜູ້ໃຊ້ແມ່ນຕ້ອງການ -ErrorActionCommBadType=ປະເພດເຫດການທີ່ເລືອກ (id: %n, ລະຫັດ: %s) ບໍ່ມີຢູ່ໃນວັດຈະນານຸກົມປະເພດເຫດການ +ErrorActionCommBadType=ປະເພດເຫດການທີ່ເລືອກ (id: %s, ລະຫັດ: %s) ບໍ່ມີຢູ່ໃນວັດຈະນານຸກົມປະເພດເຫດການ CheckVersionFail=ກວດສອບເວີຊັນບໍ່ ສຳ ເລັດ ErrorWrongFileName=ຊື່ຂອງໄຟລ cannot ບໍ່ສາມາດມີ __SOMETHING__ ໃນມັນໄດ້ ErrorNotInDictionaryPaymentConditions=ບໍ່ຢູ່ໃນວັດຈະນານຸກົມເງື່ອນໄຂການຈ່າຍເງິນ, ກະລຸນາແກ້ໄຂ. diff --git a/htdocs/langs/lt_LT/errors.lang b/htdocs/langs/lt_LT/errors.lang index 7155a7694df..cff79292d37 100644 --- a/htdocs/langs/lt_LT/errors.lang +++ b/htdocs/langs/lt_LT/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/lv_LV/errors.lang b/htdocs/langs/lv_LV/errors.lang index e07086a7373..7e63665c0b6 100644 --- a/htdocs/langs/lv_LV/errors.lang +++ b/htdocs/langs/lv_LV/errors.lang @@ -271,7 +271,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=Vispirms jums ir jāiestata konta plān ErrorFailedToFindEmailTemplate=Neizdevās atrast veidni ar koda nosaukumu %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Ilgums pakalpojumā nav noteikts. Nav iespējams aprēķināt stundas cenu. ErrorActionCommPropertyUserowneridNotDefined=Nepieciešams lietotāja īpašnieks -ErrorActionCommBadType=Atlasītais notikuma veids (id: %n, kods: %s) nepastāv notikuma veida vārdnīcā +ErrorActionCommBadType=Atlasītais notikuma veids (id: %s, kods: %s) nepastāv notikuma veida vārdnīcā CheckVersionFail=Versijas pārbaude neizdevās ErrorWrongFileName=Faila nosaukumā nedrīkst būt __SOMETHING__ ErrorNotInDictionaryPaymentConditions=Nav Maksājumu nosacījumu vārdnīcā, lūdzu, modificējiet. diff --git a/htdocs/langs/mk_MK/errors.lang b/htdocs/langs/mk_MK/errors.lang index e05f9dc7a2a..20f5b6f264a 100644 --- a/htdocs/langs/mk_MK/errors.lang +++ b/htdocs/langs/mk_MK/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/mn_MN/errors.lang b/htdocs/langs/mn_MN/errors.lang index e05f9dc7a2a..20f5b6f264a 100644 --- a/htdocs/langs/mn_MN/errors.lang +++ b/htdocs/langs/mn_MN/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/ms_MY/errors.lang b/htdocs/langs/ms_MY/errors.lang index 44ce0211742..ceef384ddb3 100644 --- a/htdocs/langs/ms_MY/errors.lang +++ b/htdocs/langs/ms_MY/errors.lang @@ -271,7 +271,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/my_MM/errors.lang b/htdocs/langs/my_MM/errors.lang index e05f9dc7a2a..20f5b6f264a 100644 --- a/htdocs/langs/my_MM/errors.lang +++ b/htdocs/langs/my_MM/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/nb_NO/errors.lang b/htdocs/langs/nb_NO/errors.lang index e97723984b2..fa0021b4854 100644 --- a/htdocs/langs/nb_NO/errors.lang +++ b/htdocs/langs/nb_NO/errors.lang @@ -270,7 +270,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=Du må først konfigurere kontoplanen d ErrorFailedToFindEmailTemplate=Kunne ikke finne mal med kodenavn %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Varighet ikke definert på tjenesten. Ingen måte å beregne timeprisen. ErrorActionCommPropertyUserowneridNotDefined=Brukerens eier kreves -ErrorActionCommBadType=Valgt hendelsestype (id: %n, kode: %s) finnes ikke i ordboken for hendelsestype +ErrorActionCommBadType=Valgt hendelsestype (id: %s, kode: %s) finnes ikke i ordboken for hendelsestype CheckVersionFail=Versjonskontroll mislyktes ErrorWrongFileName=Navnet på filen kan ikke inneholde __SOMETHING__ ErrorNotInDictionaryPaymentConditions=Ikke i ordboken for betalingsvilkår, vennligst endre. @@ -322,11 +322,6 @@ WarningAvailableOnlyForHTTPSServers=Bare tilgjengelig hvis du bruker HTTPS-sikre WarningModuleXDisabledSoYouMayMissEventHere=Modul %s er ikke aktivert, så du kan gå glipp av mange hendelser her. WarningPaypalPaymentNotCompatibleWithStrict=Verdien 'Strict' gjør at betalingsfunksjonene på nettet ikke fungerer som de skal. Bruk 'Lax' i stedet. -<<<<<<< HEAD -======= -<<<<<<< HEAD -<<<<<<< HEAD ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git # Validate RequireValidValue = Verdien er ikke gyldig RequireAtLeastXString = Krever minst %s tegn @@ -347,12 +342,3 @@ BadSetupOfField = Feil oppsett av felt BadSetupOfFieldClassNotFoundForValidation = Feil oppsett av felt: Klasse ikke funnet for validering BadSetupOfFieldFileNotFound = Feil oppsett av felt: Filen ble ikke funnet for inkludering BadSetupOfFieldFetchNotCallable = Feil oppsett av felt: Henting kan ikke kalles på klasse -<<<<<<< HEAD -======= -======= -======= ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git -======= ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git diff --git a/htdocs/langs/ne_NP/errors.lang b/htdocs/langs/ne_NP/errors.lang index e05f9dc7a2a..20f5b6f264a 100644 --- a/htdocs/langs/ne_NP/errors.lang +++ b/htdocs/langs/ne_NP/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/nl_NL/errors.lang b/htdocs/langs/nl_NL/errors.lang index fe70a2010cb..ed4a55d1aab 100644 --- a/htdocs/langs/nl_NL/errors.lang +++ b/htdocs/langs/nl_NL/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=U moet eerst uw rekeningschema instelle ErrorFailedToFindEmailTemplate=Kan sjabloon met codenaam %s . niet vinden ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=De lengte is niet gedefinieerd in de dienst. We kunnen de uurkosten niet berekenen. ErrorActionCommPropertyUserowneridNotDefined=Eigenaar van gebruiker is vereist -ErrorActionCommBadType=Het geselecteerde gebeurtenistype (id: %n, code: %s) bestaat niet in het woordenboek voor gebeurtenistypes +ErrorActionCommBadType=Het geselecteerde gebeurtenistype (id: %s, code: %s) bestaat niet in het woordenboek voor gebeurtenistypes CheckVersionFail=Versiecontrole mislukt ErrorWrongFileName=De naam van het bestand mag niet __SOMETHING__ bevatten ErrorNotInDictionaryPaymentConditions=Niet bekend in de gedefinieerde betaalregelingen, graag wijzigen diff --git a/htdocs/langs/pl_PL/errors.lang b/htdocs/langs/pl_PL/errors.lang index 2022a84943f..fb75cc0a943 100644 --- a/htdocs/langs/pl_PL/errors.lang +++ b/htdocs/langs/pl_PL/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=Najpierw musisz ustawić swój plan kon ErrorFailedToFindEmailTemplate=Nie udało się znaleźć szablonu o nazwie kodowej %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=Właściciel użytkownika jest wymagany -ErrorActionCommBadType=Wybrany typ zdarzenia (id: %n, kod: %s) nie istnieje w słowniku typów zdarzeń +ErrorActionCommBadType=Wybrany typ zdarzenia (id: %s, kod: %s) nie istnieje w słowniku typów zdarzeń CheckVersionFail=Sprawdzanie wersji nie powiodło się ErrorWrongFileName=Nazwa pliku nie może zawierać __COŚ__ ErrorNotInDictionaryPaymentConditions=Nie w Słowniku terminów płatności, zmień. diff --git a/htdocs/langs/pt_PT/errors.lang b/htdocs/langs/pt_PT/errors.lang index dc0eb4f58d5..2b0dda28541 100644 --- a/htdocs/langs/pt_PT/errors.lang +++ b/htdocs/langs/pt_PT/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/ro_RO/errors.lang b/htdocs/langs/ro_RO/errors.lang index 7b55c5259c6..04e1c37abef 100644 --- a/htdocs/langs/ro_RO/errors.lang +++ b/htdocs/langs/ro_RO/errors.lang @@ -270,7 +270,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=Trebuie să setezi mai întâi planul d ErrorFailedToFindEmailTemplate=Nu s-a găsit șablonul cu numele de cod %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Durata nu este definită pentru serviciu. Nicio modalitate de a calcula prețul pe oră. ErrorActionCommPropertyUserowneridNotDefined=Utilizatorul deţinător este obligatoriu -ErrorActionCommBadType=Tipul evenimentului selectat (id: %n, cod: %s) nu există în dicţionarul Tipuri evenimente +ErrorActionCommBadType=Tipul evenimentului selectat (id: %s, cod: %s) nu există în dicţionarul Tipuri evenimente CheckVersionFail=Verificarea versiunii a eşuat ErrorWrongFileName=Numele fișierului nu poate să conțină _SOMETHING_ în el ErrorNotInDictionaryPaymentConditions=Nu se află în dicționarul Condiții de plată, vă rugăm să modificați. @@ -322,11 +322,6 @@ WarningAvailableOnlyForHTTPSServers=Disponibil numai dacă se utilizează conexi WarningModuleXDisabledSoYouMayMissEventHere=Modulul %s nu a fost activat. Este posibil să pierdeți o mulțime de evenimente aici.  WarningPaypalPaymentNotCompatibleWithStrict=Valoarea 'Strictă' face ca funcțiile de plată online să nu funcționeze corect. Folosiți în schimb 'Lax'. -<<<<<<< HEAD -======= -<<<<<<< HEAD -<<<<<<< HEAD ->>>>>>> ramura '15.0' de la git@github.com:Dolibarr/dolibarr.git # Validate RequireValidValue = Valoare invalidă RequireAtLeastXString = Necesită cel puţin %s caracter(e) @@ -347,12 +342,3 @@ BadSetupOfField = Eroare setare invalidă a câmpului BadSetupOfFieldClassNotFoundForValidation = Eroare setare valoare câmp : Clasa nu a fost găsită pentru validare BadSetupOfFieldFileNotFound = Eroare setare valoare câmp : Fișierul nu a fost găsit pentru includere BadSetupOfFieldFetchNotCallable = Eroare setare valoare câmp : Operaţia fetch nu este apelabilă din clasă -<<<<<<< HEAD -======= -======= -======= ->>>>>>> ramura '15.0' de la git@github.com:Dolibarr/dolibarr.git ->>>>>>> ramura '15.0' de la git@github.com:Dolibarr/dolibarr.git -======= ->>>>>>> ramura '15.0' de la git@github.com:Dolibarr/dolibarr.git ->>>>>>> ramura '15.0' de la git@github.com:Dolibarr/dolibarr.git diff --git a/htdocs/langs/ru_RU/errors.lang b/htdocs/langs/ru_RU/errors.lang index 088cae1a1b0..b03e531455b 100644 --- a/htdocs/langs/ru_RU/errors.lang +++ b/htdocs/langs/ru_RU/errors.lang @@ -270,7 +270,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=Вы должны сначала нас ErrorFailedToFindEmailTemplate=Не удалось найти шаблон с кодовым названием %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Срок службы не определен. Невозможно рассчитать почасовую оплату. ErrorActionCommPropertyUserowneridNotDefined=Требуется владелец пользователя -ErrorActionCommBadType=Выбранный тип события (id: %n, код: %s) не существует в словаре типов событий +ErrorActionCommBadType=Выбранный тип события (id: %s, код: %s) не существует в словаре типов событий CheckVersionFail=Ошибка проверки версии ErrorWrongFileName=Имя файла не может содержать __SOMETHING__ ErrorNotInDictionaryPaymentConditions=Нет в Словаре условий оплаты, пожалуйста, измените. @@ -322,11 +322,6 @@ WarningAvailableOnlyForHTTPSServers=Доступно только при исп WarningModuleXDisabledSoYouMayMissEventHere=Модуль %s не включен. Так что вы можете пропустить здесь много мероприятий. WarningPaypalPaymentNotCompatibleWithStrict=Значение «Строгий» приводит к некорректной работе функций онлайн-платежей. Вместо этого используйте «Лакс». -<<<<<<< ГОЛОВА -======= -<<<<<<< ГОЛОВА -<<<<<<< ГОЛОВА ->>>>>>> ветка '15.0' git@github.com:Dolibarr/dolibarr.git # Validate RequireValidValue = Значение недействительно RequireAtLeastXString = Требуется не менее %s символа(ов) @@ -347,12 +342,3 @@ BadSetupOfField = Ошибка неправильная настройка по BadSetupOfFieldClassNotFoundForValidation = Ошибка неправильной настройки поля: класс не найден для проверки BadSetupOfFieldFileNotFound = Ошибка неправильной настройки поля: файл не найден для включения BadSetupOfFieldFetchNotCallable = Ошибка неправильной настройки поля: Получение не вызывается для класса -<<<<<<< ГОЛОВА -======= -======= -======= ->>>>>>> ветка '15.0' git@github.com:Dolibarr/dolibarr.git ->>>>>>> ветка '15.0' git@github.com:Dolibarr/dolibarr.git -======= ->>>>>>> ветка '15.0' git@github.com:Dolibarr/dolibarr.git ->>>>>>> ветка '15.0' git@github.com:Dolibarr/dolibarr.git diff --git a/htdocs/langs/sk_SK/errors.lang b/htdocs/langs/sk_SK/errors.lang index cbb983f03f0..a3f364bae15 100644 --- a/htdocs/langs/sk_SK/errors.lang +++ b/htdocs/langs/sk_SK/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/sl_SI/errors.lang b/htdocs/langs/sl_SI/errors.lang index a27b6fceea6..7910fee7eaa 100644 --- a/htdocs/langs/sl_SI/errors.lang +++ b/htdocs/langs/sl_SI/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/sq_AL/errors.lang b/htdocs/langs/sq_AL/errors.lang index e05f9dc7a2a..20f5b6f264a 100644 --- a/htdocs/langs/sq_AL/errors.lang +++ b/htdocs/langs/sq_AL/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/sr_RS/errors.lang b/htdocs/langs/sr_RS/errors.lang index ce3cbc6b148..30b2026e6ca 100644 --- a/htdocs/langs/sr_RS/errors.lang +++ b/htdocs/langs/sr_RS/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/sv_SE/errors.lang b/htdocs/langs/sv_SE/errors.lang index 6eac66b349a..e56c87c8212 100644 --- a/htdocs/langs/sv_SE/errors.lang +++ b/htdocs/langs/sv_SE/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=Du måste först ställa in ditt kontop ErrorFailedToFindEmailTemplate=Det gick inte att hitta mall med kodnamn %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Varaktighet definieras inte i tjänsten. Inget sätt att beräkna timpriset. ErrorActionCommPropertyUserowneridNotDefined=Användarens ägare krävs -ErrorActionCommBadType=Vald händelsetyp (id: %n, kod: %s) finns inte i ordlistan för händelsetyp +ErrorActionCommBadType=Vald händelsetyp (id: %s, kod: %s) finns inte i ordlistan för händelsetyp CheckVersionFail=Versionskontroll misslyckades ErrorWrongFileName=Filens namn kan inte innehålla __SOMETHING__ ErrorNotInDictionaryPaymentConditions=Inte i ordningen för betalningsvillkor, ändra. diff --git a/htdocs/langs/sw_SW/errors.lang b/htdocs/langs/sw_SW/errors.lang index e05f9dc7a2a..20f5b6f264a 100644 --- a/htdocs/langs/sw_SW/errors.lang +++ b/htdocs/langs/sw_SW/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/ta_IN/errors.lang b/htdocs/langs/ta_IN/errors.lang index 04fa1d14975..d46aeff4ca1 100644 --- a/htdocs/langs/ta_IN/errors.lang +++ b/htdocs/langs/ta_IN/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=முதலில் உங்கள ErrorFailedToFindEmailTemplate=%s என்ற குறியீட்டுப் பெயருடன் டெம்ப்ளேட்டைக் கண்டறிய முடியவில்லை ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=சேவையில் காலம் வரையறுக்கப்படவில்லை. மணிநேர விலையை கணக்கிட வழி இல்லை. ErrorActionCommPropertyUserowneridNotDefined=பயனரின் உரிமையாளர் தேவை -ErrorActionCommBadType=தேர்ந்தெடுக்கப்பட்ட நிகழ்வு வகை (ஐடி: %n, குறியீடு: %s) நிகழ்வு வகை அகராதியில் இல்லை +ErrorActionCommBadType=தேர்ந்தெடுக்கப்பட்ட நிகழ்வு வகை (ஐடி: %s, குறியீடு: %s) நிகழ்வு வகை அகராதியில் இல்லை CheckVersionFail=பதிப்பு சரிபார்ப்பு தோல்வி ErrorWrongFileName=கோப்பின் பெயரில் __சம்திங்__ இருக்கக்கூடாது ErrorNotInDictionaryPaymentConditions=கட்டண விதிமுறைகள் அகராதியில் இல்லை, தயவுசெய்து மாற்றவும். diff --git a/htdocs/langs/tg_TJ/errors.lang b/htdocs/langs/tg_TJ/errors.lang index b861ec4b276..ec74135edae 100644 --- a/htdocs/langs/tg_TJ/errors.lang +++ b/htdocs/langs/tg_TJ/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=Шумо аввал бояд ҷадва ErrorFailedToFindEmailTemplate=Шаблон бо номи рамзи %s ёфт нашуд ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Давомнокии хидмат муайян карда нашудааст. Ҳеҷ гуна ҳисоб кардани нархи соатбайъ. ErrorActionCommPropertyUserowneridNotDefined=Соҳиби корбар лозим аст -ErrorActionCommBadType=Навъи рӯйдоди интихобшуда (id: %n, рамз: %s) дар луғати навъи чорабиниҳо вуҷуд надорад +ErrorActionCommBadType=Навъи рӯйдоди интихобшуда (id: %s, рамз: %s) дар луғати навъи чорабиниҳо вуҷуд надорад CheckVersionFail=Санҷиши версия ноком шуд ErrorWrongFileName=Номи файл наметавонад дар он __SOMETHING__ дошта бошад ErrorNotInDictionaryPaymentConditions=Дар луғати шартҳои пардохт нест, лутфан тағир диҳед. diff --git a/htdocs/langs/th_TH/errors.lang b/htdocs/langs/th_TH/errors.lang index 43200416193..efeb030607d 100644 --- a/htdocs/langs/th_TH/errors.lang +++ b/htdocs/langs/th_TH/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/tr_TR/errors.lang b/htdocs/langs/tr_TR/errors.lang index 37622276db8..d3cd4ad4a71 100644 --- a/htdocs/langs/tr_TR/errors.lang +++ b/htdocs/langs/tr_TR/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/uk_UA/errors.lang b/htdocs/langs/uk_UA/errors.lang index 1f310d658aa..1fd1e371191 100644 --- a/htdocs/langs/uk_UA/errors.lang +++ b/htdocs/langs/uk_UA/errors.lang @@ -270,7 +270,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=Спочатку потрібно на ErrorFailedToFindEmailTemplate=Не вдалося знайти шаблон із кодовою назвою %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Тривалість обслуговування не визначена. Неможливо розрахувати погодинну ціну. ErrorActionCommPropertyUserowneridNotDefined=Потрібен власник користувача -ErrorActionCommBadType=Вибраний тип події (id: %n, код: %s) не існує в словнику типів події +ErrorActionCommBadType=Вибраний тип події (id: %s, код: %s) не існує в словнику типів події CheckVersionFail=Помилка перевірки версії ErrorWrongFileName=У назві файлу не може бути __SOMETHING__ ErrorNotInDictionaryPaymentConditions=Немає в словнику умов оплати, будь ласка, змініть. diff --git a/htdocs/langs/ur_PK/errors.lang b/htdocs/langs/ur_PK/errors.lang index 905d70ab7fb..b6a2f5c9eb7 100644 --- a/htdocs/langs/ur_PK/errors.lang +++ b/htdocs/langs/ur_PK/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=آپ کو پہلے اپنے اکاؤن ErrorFailedToFindEmailTemplate=کوڈ نام %s کے ساتھ ٹیمپلیٹ تلاش کرنے میں ناکام ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=سروس پر مدت کی وضاحت نہیں کی گئی ہے۔ فی گھنٹہ قیمت کا حساب لگانے کا کوئی طریقہ نہیں ہے۔ ErrorActionCommPropertyUserowneridNotDefined=صارف کا مالک درکار ہے۔ -ErrorActionCommBadType=ایونٹ کی قسم کی منتخب کردہ (id: %n، کوڈ: %s) ایونٹ کی قسم ڈکشنری میں موجود نہیں ہے۔ +ErrorActionCommBadType=ایونٹ کی قسم کی منتخب کردہ (id: %s، کوڈ: %s) ایونٹ کی قسم ڈکشنری میں موجود نہیں ہے۔ CheckVersionFail=ورژن کی جانچ ناکام ErrorWrongFileName=فائل کے نام میں __SOMETHING__ نہیں ہو سکتا ErrorNotInDictionaryPaymentConditions=ادائیگی کی شرائط ڈکشنری میں نہیں ہے، براہ کرم ترمیم کریں۔ diff --git a/htdocs/langs/uz_UZ/errors.lang b/htdocs/langs/uz_UZ/errors.lang index e992dabb6b3..aebf69b33d4 100644 --- a/htdocs/langs/uz_UZ/errors.lang +++ b/htdocs/langs/uz_UZ/errors.lang @@ -270,7 +270,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=Avval hisob qaydnomangizni o'rnatishing ErrorFailedToFindEmailTemplate=%s kodli shablonni topib bo'lmadi ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Xizmat muddati aniqlanmagan. Bir soatlik narxni hisoblashning iloji yo'q. ErrorActionCommPropertyUserowneridNotDefined=Foydalanuvchi egasi talab qilinadi -ErrorActionCommBadType=Tanlangan voqea turi (id: %n, kod: %s) Voqealar turi lug'atida mavjud emas +ErrorActionCommBadType=Tanlangan voqea turi (id: %s, kod: %s) Voqealar turi lug'atida mavjud emas CheckVersionFail=Versiyani tekshirib bo'lmadi ErrorWrongFileName=Fayl nomida __SOMETHING__ bo'lishi mumkin emas ErrorNotInDictionaryPaymentConditions=To'lov shartlari lug'atida yo'q, iltimos o'zgartiring. @@ -322,11 +322,6 @@ WarningAvailableOnlyForHTTPSServers=Faqat HTTPS xavfsiz ulanishidan foydalanish WarningModuleXDisabledSoYouMayMissEventHere=%s moduli yoqilmagan. Shunday qilib, siz bu erda ko'plab tadbirlarni o'tkazib yuborishingiz mumkin. WarningPaypalPaymentNotCompatibleWithStrict="Qat'iy" qiymati onlayn to'lov xususiyatlarining noto'g'ri ishlashiga olib keladi. Buning o'rniga "Lax" dan foydalaning. -<<<<<<< BOSH -======= -<<<<<<< BOSH -<<<<<<< BOSH ->>>>>>> git@github.com ning '15.0' filiali:Dolibarr/dolibarr.git # Validate RequireValidValue = Qiymat yaroqsiz RequireAtLeastXString = Kamida %s belgi kerak @@ -347,12 +342,3 @@ BadSetupOfField = Maydonni noto'g'ri sozlashda xato BadSetupOfFieldClassNotFoundForValidation = Maydonni noto'g'ri o'rnatish xatosi: Tasdiqlash uchun sinf topilmadi BadSetupOfFieldFileNotFound = Maydonni noto'g'ri o'rnatishda xato: Faylni kiritish uchun topilmadi BadSetupOfFieldFetchNotCallable = Maydonni noto'g'ri o'rnatish xatosi: Sinfda qo'ng'iroq qilib bo'lmaydi -<<<<<<< BOSH -======= -======= -======= ->>>>>>> git@github.com ning '15.0' filiali:Dolibarr/dolibarr.git ->>>>>>> git@github.com ning '15.0' filiali:Dolibarr/dolibarr.git -======= ->>>>>>> git@github.com ning '15.0' filiali:Dolibarr/dolibarr.git ->>>>>>> git@github.com ning '15.0' filiali:Dolibarr/dolibarr.git diff --git a/htdocs/langs/vi_VN/errors.lang b/htdocs/langs/vi_VN/errors.lang index 1b8c6ca61b9..8707c21f67a 100644 --- a/htdocs/langs/vi_VN/errors.lang +++ b/htdocs/langs/vi_VN/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/zh_CN/errors.lang b/htdocs/langs/zh_CN/errors.lang index 1783be09f3a..53188bca81d 100644 --- a/htdocs/langs/zh_CN/errors.lang +++ b/htdocs/langs/zh_CN/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/zh_HK/errors.lang b/htdocs/langs/zh_HK/errors.lang index e05f9dc7a2a..20f5b6f264a 100644 --- a/htdocs/langs/zh_HK/errors.lang +++ b/htdocs/langs/zh_HK/errors.lang @@ -269,7 +269,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of acco ErrorFailedToFindEmailTemplate=Failed to find template with code name %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +ErrorActionCommBadType=Selected event type (id: %s, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/zh_TW/errors.lang b/htdocs/langs/zh_TW/errors.lang index 5afdeaa2b52..ec8fbdbf698 100644 --- a/htdocs/langs/zh_TW/errors.lang +++ b/htdocs/langs/zh_TW/errors.lang @@ -270,7 +270,7 @@ ErrorYouMustFirstSetupYourChartOfAccount=您必須先設定會計項目表 ErrorFailedToFindEmailTemplate=無法找到代號為 %s 的模板 ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=未在服務中定義時間範圍.無法計算時薪. ErrorActionCommPropertyUserowneridNotDefined=需要用戶的擁有者 -ErrorActionCommBadType=選擇的事件類型(id:%n,代碼:%s)在事件類型分類中不存在 +ErrorActionCommBadType=選擇的事件類型(id:%s,代碼:%s)在事件類型分類中不存在 CheckVersionFail=版本檢查失敗 ErrorWrongFileName=檔案名稱中不可以有__SOMETHING__ ErrorNotInDictionaryPaymentConditions=不在支付條款類別中,請修改。 @@ -322,11 +322,6 @@ WarningAvailableOnlyForHTTPSServers=僅在使用 HTTPS 安全連線時可用。 WarningModuleXDisabledSoYouMayMissEventHere=模組 %s 尚未啟用。所以你可能會在這裡錯過很多事件。 WarningPaypalPaymentNotCompatibleWithStrict=數值 'Strict' 使得線上支付功能無法正常工作。改用“Lax”。 -<<<<<<< HEAD -======= -<<<<<<< HEAD -<<<<<<< HEAD ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git # Validate RequireValidValue = 數值無效 RequireAtLeastXString = 至少需要%s個字元 @@ -347,12 +342,3 @@ BadSetupOfField = 欄位設定錯誤 BadSetupOfFieldClassNotFoundForValidation = 欄位設定錯誤:沒有發現可驗證的Class BadSetupOfFieldFileNotFound = 欄位設定錯誤:未找到要包含的檔案 BadSetupOfFieldFetchNotCallable = 欄位設定錯誤:無法在Class上調用獲取 -<<<<<<< HEAD -======= -======= -======= ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git -======= ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 2b5485efd2a..782f75b0190 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2413,7 +2413,7 @@ function printDropdownQuickadd() "title" => "MenuNewMember@members", "name" => "Adherent@members", "picto" => "object_member", - "activation" => !empty($conf->adherent->enabled) && $user->rights->adherent->creer, // vs hooking + "activation" => !empty($conf->adherent->enabled) && $user->hasRight("adherent", "write"), // vs hooking "position" => 5, ), array( @@ -2421,7 +2421,7 @@ function printDropdownQuickadd() "title" => "MenuNewThirdParty@companies", "name" => "ThirdParty@companies", "picto" => "object_company", - "activation" => !empty($conf->societe->enabled) && $user->rights->societe->creer, // vs hooking + "activation" => !empty($conf->societe->enabled) && $user->hasRight("societe", "write"), // vs hooking "position" => 10, ), array( @@ -2429,7 +2429,7 @@ function printDropdownQuickadd() "title" => "NewContactAddress@companies", "name" => "Contact@companies", "picto" => "object_contact", - "activation" => !empty($conf->societe->enabled) && $user->rights->societe->contact->creer, // vs hooking + "activation" => !empty($conf->societe->enabled) && $user->hasRight("societe", "contact", "write"), // vs hooking "position" => 20, ), array( @@ -2437,7 +2437,7 @@ function printDropdownQuickadd() "title" => "NewPropal@propal", "name" => "Proposal@propal", "picto" => "object_propal", - "activation" => !empty($conf->propal->enabled) && $user->rights->propale->creer, // vs hooking + "activation" => !empty($conf->propal->enabled) && $user->hasRight("propale", "write"), // vs hooking "position" => 30, ), @@ -2446,7 +2446,7 @@ function printDropdownQuickadd() "title" => "NewOrder@orders", "name" => "Order@orders", "picto" => "object_order", - "activation" => !empty($conf->commande->enabled) && $user->rights->commande->creer, // vs hooking + "activation" => !empty($conf->commande->enabled) && $user->hasRight("commande", "write"), // vs hooking "position" => 40, ), array( @@ -2454,7 +2454,7 @@ function printDropdownQuickadd() "title" => "NewBill@bills", "name" => "Bill@bills", "picto" => "object_bill", - "activation" => isModEnabled('facture') && $user->rights->facture->creer, // vs hooking + "activation" => isModEnabled('facture') && $user->hasRight("facture", "write"), // vs hooking "position" => 50, ), array( @@ -2462,7 +2462,7 @@ function printDropdownQuickadd() "title" => "NewContractSubscription@contracts", "name" => "Contract@contracts", "picto" => "object_contract", - "activation" => !empty($conf->contrat->enabled) && $user->rights->contrat->creer, // vs hooking + "activation" => !empty($conf->contrat->enabled) && $user->hasRight("contrat", "write"), // vs hooking "position" => 60, ), array( @@ -2470,7 +2470,7 @@ function printDropdownQuickadd() "title" => "SupplierProposalNew@supplier_proposal", "name" => "SupplierProposal@supplier_proposal", "picto" => "supplier_proposal", - "activation" => !empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->creer, // vs hooking + "activation" => !empty($conf->supplier_proposal->enabled) && $user->hasRight("supplier_invoice", "write"), // vs hooking "position" => 70, ), array( @@ -2478,7 +2478,7 @@ function printDropdownQuickadd() "title" => "NewSupplierOrderShort@orders", "name" => "SupplierOrder@orders", "picto" => "supplier_order", - "activation" => (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->creer) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->creer), // vs hooking + "activation" => (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "commande", "write")) || (!empty($conf->supplier_order->enabled) && $user->hasRight("supplier_invoice", "write")), // vs hooking "position" => 80, ), array( @@ -2486,7 +2486,7 @@ function printDropdownQuickadd() "title" => "NewBill@bills", "name" => "SupplierBill@bills", "picto" => "supplier_invoice", - "activation" => (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->creer) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->creer), // vs hooking + "activation" => (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "write")) || (!empty($conf->supplier_invoice->enabled) && $user->hasRight("supplier_invoice", "write")), // vs hooking "position" => 90, ), array( @@ -2494,7 +2494,7 @@ function printDropdownQuickadd() "title" => "NewProduct@products", "name" => "Product@products", "picto" => "object_product", - "activation" => !empty($conf->product->enabled) && $user->rights->produit->creer, // vs hooking + "activation" => !empty($conf->product->enabled) && $user->hasRight("produit", "write"), // vs hooking "position" => 100, ), array( @@ -2502,7 +2502,7 @@ function printDropdownQuickadd() "title" => "NewService@products", "name" => "Service@products", "picto" => "object_service", - "activation" => !empty($conf->service->enabled) && $user->rights->service->creer, // vs hooking + "activation" => !empty($conf->service->enabled) && $user->hasRight("service", "write"), // vs hooking "position" => 110, ), array( @@ -2510,7 +2510,7 @@ function printDropdownQuickadd() "title" => "AddUser@users", "name" => "User@users", "picto" => "user", - "activation" => $user->rights->user->user->creer, // vs hooking + "activation" => $user->hasRight("user", "user", "write"), // vs hooking "position" => 500, ), ), @@ -2824,7 +2824,7 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_ } else { if (is_array($arrayresult)) { foreach ($arrayresult as $key => $val) { - $searchform .= printSearchForm($val['url'], $val['url'], $val['label'], 'maxwidth125', 'sall', $val['shortcut'], 'searchleft'.$key, $val['img']); + $searchform .= printSearchForm($val['url'], $val['url'], $val['label'], 'maxwidth125', 'sall', (empty($val['shortcut']) ? '' : $val['shortcut']), 'searchleft'.$key, $val['img']); } } } diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 767cb1105fc..f3538d65cfa 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -118,7 +118,7 @@ class MyObject extends CommonObject 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>'Help text', 'showoncombobox'=>2, 'validate'=>1), 'amount' => array('type'=>'price', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for amount', 'validate'=>1), 'qty' => array('type'=>'real', 'label'=>'Qty', 'enabled'=>1, 'visible'=>1, 'default'=>'0', 'position'=>45, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for quantity', 'css'=>'maxwidth75imp', 'validate'=>1), - 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'picto'=>'company', 'label'=>'ThirdParty', 'visible'=> 1, 'enabled'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'LinkToThirparty', 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx'), + 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'picto'=>'company', 'label'=>'ThirdParty', 'visible'=> 1, 'enabled'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'OrganizationEventLinkToThirdParty', 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx'), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>52, 'notnull'=>-1, 'index'=>1, 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx'), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>3, 'position'=>60, 'validate'=>1), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61, 'validate'=>1, 'cssview'=>'wordbreak'), @@ -524,7 +524,7 @@ class MyObject extends CommonObject * Delete object in database * * @param User $user User that deletes - * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param bool $notrigger false=launch triggers, true=disable triggers * @return int <0 if KO, >0 if OK */ public function delete(User $user, $notrigger = false) diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php index 4338c2b7d6a..3011c932171 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php @@ -282,7 +282,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject $newfiletmp = preg_replace('/\.od(t|s)/i', '', $newfile); $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); - $newfiletmp = $objectref.'_'.$newfiletmp; + $newfiletmp = $objectref . '_' . $newfiletmp; //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); @@ -291,11 +291,11 @@ class doc_generic_myobject_odt extends ModelePDFMyObject if ($format == '1') { $format = '%Y%m%d%H%M%S'; } - $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; + $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; } else { - $filename = $newfiletmp.'.'.$newfileformat; + $filename = $newfiletmp . '.' . $newfileformat; } - $file = $dir.'/'.$filename; + $file = $dir . '/' . $filename; //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; @@ -303,8 +303,8 @@ class doc_generic_myobject_odt extends ModelePDFMyObject dol_mkdir($conf->mymodule->dir_temp); if (!is_writable($conf->mymodule->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->mymodule->dir_temp; - dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->mymodule->dir_temp); + dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); return -1; } diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 32bf5ae3200..380eab1ab6b 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -53,7 +53,8 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { // Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME $tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; + $i--; + $j--; } if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; @@ -88,9 +89,6 @@ require_once __DIR__.'/class/myobject.class.php'; // Load translation files required by the page $langs->loadLangs(array("mymodule@mymodule", "other")); -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); - $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? @@ -102,6 +100,9 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $mode = GETPOST('mode', 'aZ'); +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); + // Load variable for pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); diff --git a/htdocs/partnership/partnership_document.php b/htdocs/partnership/partnership_document.php index 3e7f78e5118..f9ea6559979 100644 --- a/htdocs/partnership/partnership_document.php +++ b/htdocs/partnership/partnership_document.php @@ -49,7 +49,7 @@ $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("pa if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$offset = $liste_limit * $page; +$offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (!$sortorder) { diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index 9aad5f382cc..6efe9f0d9e8 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -141,7 +141,7 @@ print '
'; $max = 10; $sql = "SELECT p.rowid, p.label as produit, p.tobatch, p.tosell, p.tobuy,"; $sql .= " e.ref as warehouse_ref, e.rowid as warehouse_id, e.ref as warehouse_label, e.lieu, e.statut as warehouse_status,"; -$sql .= " m.value as qty, m.datem, m.batch, m.eatby, m.sellby"; +$sql .= " m.rowid as mid, m.value as qty, m.datem, m.batch, m.eatby, m.sellby"; $sql .= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql .= ", ".MAIN_DB_PREFIX."stock_mouvement as m"; $sql .= ", ".MAIN_DB_PREFIX."product as p"; @@ -200,7 +200,7 @@ if ($resql) { $tmplotstatic->eatby = $objp->eatby; print '
'; - print ''; + print ''; print '\n"; diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_document.php b/htdocs/product/stock/stocktransfer/stocktransfer_document.php index e4675378d20..e259cc93365 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_document.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_document.php @@ -60,7 +60,7 @@ $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$offset = $liste_limit * $page; +$offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (!$sortorder) $sortorder = "ASC"; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index c246b73e816..95c3a533d1f 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -564,7 +564,7 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; print ''; } // Type of event -print ''."\n"; -print ''; +print ''."\n"; +print ''; // Label print ''."\n"; print ''."\n"; diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 22589c941d2..05cc8e61a82 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -102,7 +102,7 @@ $extrafields = new ExtraFields($db); $user->loadDefaultValues(); $cactioncomm = new CActionComm($db); -$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, "module='conference@eventorganization'"); +$arrayofconfboothtype = $cactioncomm->liste_array('', 'id', '', 0, "module='conference@eventorganization'"); // Security check if (empty($conf->eventorganization->enabled)) { @@ -463,8 +463,7 @@ print '
'; print '
'; print '
'; - -dol_htmloutput_errors($errmsg); +dol_htmloutput_errors($errmsg, $errors); // Print form print '
'."\n"; @@ -547,8 +546,8 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) { print ''; } // Type of event -print '
'."\n"; -print ''; +print ''."\n"; +print ''; // Label print ''."\n"; print ''."\n"; diff --git a/htdocs/recruitment/admin/public_interface.php b/htdocs/recruitment/admin/public_interface.php index b951f440005..7212a687442 100644 --- a/htdocs/recruitment/admin/public_interface.php +++ b/htdocs/recruitment/admin/public_interface.php @@ -139,12 +139,12 @@ print dol_get_fiche_end(); print ''; -/* + if (!empty($conf->global->RECRUITMENT_ENABLE_PUBLIC_INTERFACE)) { print '
'; //print $langs->trans('FollowingLinksArePublic').'
'; - print img_picto('', 'globe').' '.$langs->trans('BlankSubscriptionForm').':
'; - if ($conf->multicompany->enabled) { + print img_picto('', 'globe').' '.$langs->trans('BlankSubscriptionForm').'
'; + if (!empty($conf->multicompany->enabled)) { $entity_qr = '?entity='.$conf->entity; } else { $entity_qr = ''; @@ -155,9 +155,12 @@ if (!empty($conf->global->RECRUITMENT_ENABLE_PUBLIC_INTERFACE)) { $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current - print ''.$urlwithroot.'/public/members/new.php'.$entity_qr.''; + print ''; + print ajax_autoselect('publicurlmember'); } -*/ // End of page llxFooter(); diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index b0a8e9e52a0..c42d6d10ff1 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -114,20 +114,21 @@ class RecruitmentCandidature extends CommonObject 'fk_recruitmentjobposition' => array('type'=>'integer:RecruitmentJobPosition:recruitment/class/recruitmentjobposition.class.php', 'label'=>'Job', 'enabled'=>'1', 'position'=>15, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'picto'=>'recruitmentjobposition', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'minwidth125 tdoverflowmax200'), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0,), - 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>1,), - 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,), 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',), 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,), - 'lastname' => array('type'=>'varchar(128)', 'label'=>'Lastname', 'enabled'=>'1', 'position'=>20, 'notnull'=>0, 'visible'=>1,), - 'firstname' => array('type'=>'varchar(128)', 'label'=>'Firstname', 'enabled'=>'1', 'position'=>21, 'notnull'=>0, 'visible'=>1,), + 'lastname' => array('type'=>'varchar(128)', 'label'=>'Lastname', 'enabled'=>'1', 'position'=>20, 'notnull'=>0, 'visible'=>1, 'csslist'=>'tdoverflowmax150'), + 'firstname' => array('type'=>'varchar(128)', 'label'=>'Firstname', 'enabled'=>'1', 'position'=>21, 'notnull'=>0, 'visible'=>1, 'csslist'=>'tdoverflowmax150'), 'email' => array('type'=>'email', 'label'=>'EMail', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'picto'=>'email', 'csslist'=>'tdoverflowmax200'), 'phone' => array('type'=>'phone', 'label'=>'Phone', 'enabled'=>'1', 'position'=>31, 'notnull'=>0, 'visible'=>1, 'picto'=>'phone', 'csslist'=>'tdoverflowmax150'), 'date_birth' => array('type'=>'date', 'label'=>'DateOfBirth', 'enabled'=>'1', 'position'=>70, 'visible'=>-1,), 'email_msgid' => array('type'=>'varchar(255)', 'label'=>'EmailMsgID', 'visible'=>-2, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'help'=>'EmailMsgIDDesc'), + 'email_date' => array('type'=>'datetime', 'label'=>'EmailDate', 'visible'=>-2, 'enabled'=>1, 'position'=>541), //'fk_recruitment_origin' => array('type'=>'integer:CRecruitmentOrigin:recruitment/class/crecruitmentorigin.class.php', 'label'=>'Origin', 'enabled'=>'1', 'position'=>45, 'visible'=>1, 'index'=>1), 'remuneration_requested' => array('type'=>'integer', 'label'=>'RequestedRemuneration', 'enabled'=>'1', 'position'=>80, 'notnull'=>0, 'visible'=>-1,), 'remuneration_proposed' => array('type'=>'integer', 'label'=>'ProposedRemuneration', 'enabled'=>'1', 'position'=>81, 'notnull'=>0, 'visible'=>-1,), - 'description' => array('type'=>'html', 'label'=>'Description', 'enabled'=>'1', 'position'=>500, 'notnull'=>0, 'visible'=>3, 'cssview'=>'wordbreak'), + 'description' => array('type'=>'html', 'label'=>'Description', 'enabled'=>'1', 'position'=>300, 'notnull'=>0, 'visible'=>3, 'cssview'=>'wordbreak'), + 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>1, 'csslist'=>'nowraponall'), + 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2, 'csslist'=>'nowraponall'), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,), 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,), 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'default'=>0, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Received', '3'=>'ContractProposed', '5'=>'ContractSigned', '8'=>'Refused', '9'=>'Canceled')), @@ -149,6 +150,7 @@ class RecruitmentCandidature extends CommonObject public $phone; public $date_birth; public $email_msgid; + public $email_date; public $remuneration_requested; public $remuneration_proposed; public $fk_recruitment_origin; diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index c1a4ca94045..721ed4c4a2a 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -477,6 +477,23 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } } }*/ + // Author + if (!empty($object->email_msgid)) { + $morehtmlref .= $langs->trans("CreatedBy").' : '; + + if ($object->fk_user_creat > 0) { + $fuser = new User($db); + $fuser->fetch($object->fk_user_creat); + $morehtmlref .= $fuser->getNomUrl(-1); + } + if (!empty($object->email_msgid)) { + $morehtmlref .= ' ('.$form->textwithpicto($langs->trans("CreatedByEmailCollector"), $langs->trans("EmailMsgID").': '.$object->email_msgid).')'; + } + } /* elseif (!empty($object->origin_email)) { + $morehtmlref .= $langs->trans("CreatedBy").' : '; + $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); + $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$langs->trans("CreatedByPublicPortal").')'; + } */ $morehtmlref .= ''; @@ -652,6 +669,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $defaulttopic = 'InformationMessage'; $diroutput = $conf->recruitment->dir_output; $trackid = 'recruitmentcandidature'.$object->id; + $inreplyto = $object->email_msgid; include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; } diff --git a/htdocs/recruitment/recruitmentcandidature_document.php b/htdocs/recruitment/recruitmentcandidature_document.php index 25cdb80aa3e..cd3da93b9e0 100644 --- a/htdocs/recruitment/recruitmentcandidature_document.php +++ b/htdocs/recruitment/recruitmentcandidature_document.php @@ -48,7 +48,7 @@ $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("pa if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$offset = $liste_limit * $page; +$offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (!$sortorder) { diff --git a/htdocs/recruitment/recruitmentjobposition_document.php b/htdocs/recruitment/recruitmentjobposition_document.php index 3845a53a4e3..49a36a736d1 100644 --- a/htdocs/recruitment/recruitmentjobposition_document.php +++ b/htdocs/recruitment/recruitmentjobposition_document.php @@ -48,7 +48,7 @@ $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("pa if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$offset = $liste_limit * $page; +$offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (!$sortorder) { diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index ef9a882bd8e..54f244efc5b 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -216,7 +216,7 @@ $now = dol_now(); //$help_url="EN:Module_RecruitmentJobPosition|FR:Module_RecruitmentJobPosition_FR|ES:Módulo_RecruitmentJobPosition"; $help_url = ''; -$title = $langs->trans('ListOfPositionsToBeFilled'); +$title = $langs->trans('PositionsToBeFilled'); $morejs = array(); $morecss = array(); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index f43bd79ea42..aeeb59b6d92 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -548,9 +548,8 @@ if (empty($reshook)) { } //var_dump($object->array_languages);exit; - if (GETPOST('deletephoto')) { - $object->logo = ''; - } elseif (!empty($_FILES['photo']['name'])) { + if (!empty($_FILES['photo']['name'])) { + $current_logo = $object->logo; $object->logo = dol_sanitizeFileName($_FILES['photo']['name']); } @@ -801,6 +800,13 @@ if (empty($reshook)) { } if ($file_OK) { if (image_format_supported($_FILES['photo']['name']) > 0) { + if ($current_logo != $object->logo) { + $fileimg = $dir.'/'.$current_logo; + $dirthumbs = $dir.'/thumbs'; + dol_delete_file($fileimg); + dol_delete_dir_recursive($dirthumbs); + } + dol_mkdir($dir); if (@is_dir($dir)) { diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index 717398c92d4..4ddbd1c613f 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -127,7 +127,7 @@ class CompanyBankAccount extends Account // End call triggers if (!$error) { - return 1; + return $this->id; } else { return 0; } @@ -136,7 +136,7 @@ class CompanyBankAccount extends Account } } } else { - print $this->db->error(); + $this->error = $this->db->lasterror(); return 0; } } @@ -150,7 +150,7 @@ class CompanyBankAccount extends Account */ public function update(User $user = null, $notrigger = 0) { - global $conf; + global $conf, $langs; $error = 0; @@ -207,7 +207,11 @@ class CompanyBankAccount extends Account return 1; } } else { - $this->error = $this->db->lasterror(); + if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { + $this->error = $langs->trans('ErrorDuplicateField'); + } else { + $this->error = $this->db->lasterror(); + } return -1; } } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 90766323080..105178e3d65 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -232,6 +232,7 @@ class Societe extends CommonObject 'fk_incoterms' =>array('type'=>'integer', 'label'=>'Fk incoterms', 'enabled'=>1, 'visible'=>-1, 'position'=>425), 'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'Location incoterms', 'enabled'=>1, 'visible'=>-1, 'position'=>430), 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>435), + 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>270), 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>1, 'visible'=>-1, 'position'=>440), 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Multicurrency code', 'enabled'=>1, 'visible'=>-1, 'position'=>445), 'fk_account' =>array('type'=>'integer', 'label'=>'AccountingAccount', 'enabled'=>1, 'visible'=>-1, 'position'=>450), @@ -1270,7 +1271,6 @@ class Societe extends CommonObject $this->address = $this->address ?trim($this->address) : trim($this->address); $this->zip = $this->zip ?trim($this->zip) : trim($this->zip); $this->town = $this->town ?trim($this->town) : trim($this->town); - $this->setUpperOrLowerCase(); $this->state_id = trim($this->state_id); $this->country_id = ($this->country_id > 0) ? $this->country_id : 0; $this->phone = trim($this->phone); @@ -1279,7 +1279,7 @@ class Societe extends CommonObject $this->fax = trim($this->fax); $this->fax = preg_replace("/\s/", "", $this->fax); $this->fax = preg_replace("/\./", "", $this->fax); - $this->email = trim($this->email); + $this->email = trim($this->email); $this->url = $this->url ?clean_url($this->url, 0) : ''; $this->note_private = trim($this->note_private); $this->note_public = trim($this->note_public); @@ -1412,7 +1412,7 @@ class Societe extends CommonObject } } } - + $this->setUpperOrLowerCase(); if ($result >= 0) { dol_syslog(get_class($this)."::update verify ok or not done"); diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index a63b91b024b..9e4c0e91137 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -815,7 +815,8 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print ''; print ''; print ''; - print ''; + print img_picto($langs->trans("CreateCustomerOnStripe"), 'stripe'); + print ''; print ''; } print ''; @@ -1289,6 +1290,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $morehtmlright = dolGetButtonTitle($langs->trans('Add'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"] . '?socid=' . $object->id . '&action=create'); } + print load_fiche_titre($langs->trans("BankAccounts"), $morehtmlright, 'bank'); $rib_list = $object->get_all_rib(); @@ -1454,6 +1456,10 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' // Edit/Delete print '
'; + print ''; print $objectstatic->getNomUrl(1); print ''; - print $obj->ref_client; + print dol_escape_htmltag($obj->ref_client); print ' 0 ? " disabled" : "").'>
'.dol_print_date($db->jdate($objp->datem), 'dayhour').''.img_picto($langs->trans("Ref").' '.$objp->mid, 'movement', 'class="pictofixedwidth"').dol_print_date($db->jdate($objp->datem), 'dayhour').''; print $producttmp->getNomUrl(1); print "'; if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print ' '; + print ' '; $htmltext = $langs->trans("ProjectFollowOpportunity"); print ''; print ''; print '
'; } if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print ' '; + print ' '; $htmltext = $langs->trans("ProjectFollowTasks"); print ''; print '
'; } if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print ' '; + print ' '; $htmltext = $langs->trans("ProjectBillTimeDescription"); print ''; print '
'; } if (!empty($conf->eventorganization->enabled)) { - print ' '; + print ' '; $htmltext = $langs->trans("EventOrganizationDescriptionLong"); print ''; } @@ -735,7 +739,7 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; - // Change probability from status + // Change probability from status or role of project print ''; print '
'; @@ -1331,50 +1338,56 @@ if ($action == 'create' && $user->rights->projet->creer) { } } - // Add button to create objects from project + if (!empty($conf->global->PROJECT_SHOW_CREATE_OBJECT_BUTTON)) { + print'"; } - // Clone if ($user->rights->projet->creer) { if ($userWrite > 0) { diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 8c48b7b1ae6..f395173b327 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1272,7 +1272,7 @@ class Project extends CommonObject } $linkclose = ''; - if (empty($notooltip) && $user->rights->projet->lire) { + if (empty($notooltip) && $user->hasRight('projet', 'lire')) { if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $label = $langs->trans("ShowProject"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index 661ae6accfe..8bb85022b2e 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -60,6 +60,7 @@ global $dolibarr_main_url_root; // Init vars $errmsg = ''; +$errors = array(); $error = 0; $backtopage = GETPOST('backtopage', 'alpha'); $action = GETPOST('action', 'aZ09'); @@ -90,6 +91,7 @@ if ($type == 'conf') { if ($resultproject < 0) { $error++; $errmsg .= $project->error; + $errors = array_merge($errors, $project->errors); } } @@ -99,6 +101,7 @@ if ($type == 'global') { if ($resultproject < 0) { $error++; $errmsg .= $project->error; + $errors = array_merge($errors, $project->errors); } else { $sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."projet"; $sql .= " WHERE ".MAIN_DB_PREFIX."eventorganization_conferenceorboothattendee = ".((int) $project->id); @@ -279,6 +282,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen if ($resultconfattendee < 0) { $error++; $errmsg .= $confattendee->error; + $errors = array_merge($errors, $confattendee->errors); } } @@ -403,6 +407,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen // If an error was found $error++; $errmsg .= $thirdparty->error; + $errors = array_merge($errors, $thirdparty->errors); } elseif ($resultfetchthirdparty == 0) { // No thirdparty found + a payment is expected // Creation of a new thirdparty if (!empty($societe)) { @@ -441,6 +446,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen if ($readythirdparty < 0) { $error++; $errmsg .= $thirdparty->error; + $errors = array_merge($errors, $thirdparty->errors); } else { $thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs); $thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs); @@ -472,6 +478,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen if ($resultprod < 0) { $error++; $errmsg .= $productforinvoicerow->error; + $errors = array_merge($errors, $productforinvoicerow->errors); } else { $facture = new Facture($db); if (empty($confattendee->fk_invoice)) { @@ -668,7 +675,7 @@ if ($maxattendees && $currentnbofattendees >= $maxattendees) { print '
'; -dol_htmloutput_errors($errmsg); +dol_htmloutput_errors($errmsg, $errors); if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS_CONFIRMED) || (!empty($project->id) && $project->status == Project::STATUS_VALIDATED)) { if (empty($maxattendees) || $currentnbofattendees < $maxattendees) { diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 992e7ab403d..bb5097cb11a 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -369,13 +369,14 @@ if ($ispaymentok) { } if (empty($user->rights->facture)) { $user->rights->facture = new stdClass(); + $user->rights->facture->invoice_advance = new stdClass(); } if (empty($user->rights->adherent)) { $user->rights->adherent = new stdClass(); - $user->rights->adherent->cotisation = new stdClass(); } $user->rights->societe->creer = 1; $user->rights->facture->creer = 1; + $user->rights->facture->invoice_advance->validate = 1; $user->rights->adherent->cotisation->creer = 1; if (array_key_exists('MEM', $tmptag) && $tmptag['MEM'] > 0) { diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index cb1b1089b0c..52193e4fcd4 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -101,7 +101,7 @@ $extrafields = new ExtraFields($db); $user->loadDefaultValues(); $cactioncomm = new CActionComm($db); -$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, "module='booth@eventorganization'"); +$arrayofconfboothtype = $cactioncomm->liste_array('', 'id', '', 0, "module='booth@eventorganization'"); // Security check if (empty($conf->eventorganization->enabled)) { @@ -612,8 +612,8 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) { print '
'.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).'
'.$langs->trans("Format").'*'.Form::selectarray('eventtype', $arrayofconfboothtype, $eventtype, 1).'
'.$langs->trans("LabelOfBooth").'*
'.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).'
'.$langs->trans("Format").'*'.Form::selectarray('eventtype', $arrayofconfboothtype, $eventtype, 1).'
'.$langs->trans("LabelOfconference").'*
'; if ($permissiontoaddupdatepaymentinformation) { + print ''; + print img_picto($langs->trans("CreateBAN"), 'stripe'); + print ''; + print ''; print img_picto($langs->trans("Modify"), 'edit'); print ''; @@ -1716,10 +1722,10 @@ if ($socid && $action == 'create' && $permissiontoaddupdatepaymentinformation) { print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; // Show fields of bank account foreach ($companybankaccount->getFieldsToShow(1) as $val) { @@ -1812,7 +1818,7 @@ if ($socid && $action == 'create' && $permissiontoaddupdatepaymentinformation) { print dol_get_fiche_end(); - dol_set_focus('#label'); + dol_set_focus('#bank'); print $form->buttonsSaveCancel("Add"); } diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index d61d03b2be6..67e0c26ce8c 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -227,10 +227,10 @@ if (empty($conf->stripeconnect->enabled)) { print ''; print ''; print '\n"; print ''; print ''; print ''; if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { // What is this for ? print ''; } @@ -386,7 +386,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { // TODO Not used by current code // Locations for Stripe Terminal if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { // TODO Not used by current code print ''; } // Activate Payment Request API if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { // TODO Not used by current code print ''; } @@ -441,7 +447,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { // TODO Not used by current code print ajax_constantonoff('STRIPE_SEPA_DIRECT_DEBIT'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("STRIPE_SEPA_DIRECT_DEBIT", $arrval, $conf->global->STRIPE_SEPA_DIRECT_DEBIT); + print $form->selectarray("STRIPE_SEPA_DIRECT_DEBIT", $arrval, getDolGlobalString('STRIPE_SEPA_DIRECT_DEBIT')); } print ''; } @@ -542,6 +548,7 @@ print ''; print ''; @@ -575,7 +582,7 @@ print ''; print ''; print ''; print "\n"; +print ''; +print ''; + print ''; print ''; + // Origin + /* + if ($object->email_msgid) { + $texttoshow = $langs->trans("CreatedByEmailCollector"); + } elseif ($object->origin_email) { + $texttoshow = $langs->trans("FromPublicEmail"); + } + if ($texttoshow) { + print ''; + print ''; + } + */ + // Read date print ''."\n"; // API key - if (!empty($conf->api->enabled) && ($user->id == $id || $user->admin || $user->rights->api->apikey->generate)) { + if (!empty($conf->api->enabled) && ($user->id == $id || $user->admin || $user->hasRight("api", "apikey", "generate"))) { print ''; print '\n"; // API key - if (!empty($conf->api->enabled) && ($user->id == $id || $user->admin || $user->rights->api->apikey->generate)) { + if (!empty($conf->api->enabled) && ($user->id == $id || $user->admin || $user->hasRight("api", "apikey", "generate"))) { print ''; print ''; // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (!empty($conf->categorie->enabled) && !empty($user->hasRight("categorie", "read"))) { print ''; print '
'.$langs->trans("LabelRIB").'
'.$langs->trans("Bank").'
'; print ''.$langs->trans("STRIPE_TEST_WEBHOOK_KEY").''; if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { - print ''; + print ''; print '
'; } - print ''; + print ''; $out = img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForTestWebhook").' '; $url = dol_buildpath('/public/stripe/ipn.php?test', 3); $out .= ''; @@ -278,21 +278,21 @@ if (empty($conf->stripeconnect->enabled)) { if (empty($conf->stripeconnect->enabled)) { print '
'; print ''.$langs->trans("STRIPE_LIVE_PUBLISHABLE_KEY").''; - print ''; + print ''; print '
'; print ''.$langs->trans("STRIPE_LIVE_SECRET_KEY").''; - print ''; + print ''; print '
'; print ''.$langs->trans("STRIPE_LIVE_WEBHOOK_KEY").''; if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { - print ''; + print ''; print '
'; } - print ''; + print ''; $out = img_picto('', 'globe', 'class="pictofixedwidth"').' '.$langs->trans("ToOfferALinkForLiveWebhook").' '; $url = dol_buildpath('/public/stripe/ipn.php', 3); $out .= ''; @@ -347,26 +347,26 @@ print "
'; print $langs->trans("PublicVendorName").''; -print ''; +print ''; print '   '.$langs->trans("Example").': '.$mysoc->name.''; print '
'; print $langs->trans("StripeUserAccountForActions").''; -print img_picto('', 'user', 'class="pictofixedwidth"').$form->select_dolusers($conf->global->STRIPE_USER_ACCOUNT_FOR_ACTIONS, 'STRIPE_USER_ACCOUNT_FOR_ACTIONS', 0); +print img_picto('', 'user', 'class="pictofixedwidth"').$form->select_dolusers(getDolGlobalString('STRIPE_USER_ACCOUNT_FOR_ACTIONS'), 'STRIPE_USER_ACCOUNT_FOR_ACTIONS', 0); print '
'; print $langs->trans("BankAccount").''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); -$form->select_comptes($conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS, 'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1); +$form->select_comptes(getDolGlobalString('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS'), 'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1); print '
'; print $langs->trans("BankAccountForBankTransfer").''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); - $form->select_comptes($conf->global->STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS, 'STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS', 0, '', 1); + $form->select_comptes(getDolGlobalString('STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS'), 'STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS', 0, '', 1); print '
'; - print $langs->trans("STRIPE_LOCATION").''; + print $langs->trans("TERMINAL_LOCATION").''; $service = 'StripeTest'; $servicestatus = 0; if (!empty($conf->global->STRIPE_LIVE) && !GETPOST('forcesandbox', 'alpha')) { @@ -395,7 +395,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { // TODO Not used by current code } global $stripearrayofkeysbyenv; $site_account = $stripearrayofkeysbyenv[$servicestatus]['secret_key']; - \Stripe\Stripe::setApiKey($site_account); + if (!empty($site_account)) { + \Stripe\Stripe::setApiKey($site_account); + } if (!empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) { $service = 'StripeTest'; $servicestatus = '0'; @@ -405,30 +407,34 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { // TODO Not used by current code $servicestatus = '1'; } $stripe = new Stripe($db); - $stripeacc = $stripe->getStripeAccount($service); - if ($stripeacc) { - $locations = \Stripe\Terminal\Location::all('', array("stripe_account" => $stripeacc)); - } else { - $locations = \Stripe\Terminal\Location::all(); + if (!empty($site_account)) { + // If $site_account not defined, then key not set and no way to call API Location + $stripeacc = $stripe->getStripeAccount($service); + if ($stripeacc) { + $locations = \Stripe\Terminal\Location::all('', array("stripe_account" => $stripeacc)); + } else { + $locations = \Stripe\Terminal\Location::all(); + } } + $location = array(); - $location[""] = $langs->trans("EmptyLocation"); + $location[""] = $langs->trans("NotDefined"); foreach ($locations as $locations) { $location[$locations->id] = $locations->display_name; } - print $form->selectarray("STRIPE_LOCATION", $location, $conf->global->STRIPE_LOCATION); + print $form->selectarray("STRIPE_LOCATION", $location, getDolGlobalString('STRIPE_LOCATION')); print '
'; - print $langs->trans("STRIPE_PAYMENT_REQUEST_API").''; + print $langs->trans("STRIPE_PAYMENT_REQUEST_API").' ?? Not used, what is it for ??'; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STRIPE_PAYMENT_REQUEST_API'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("STRIPE_PAYMENT_REQUEST_API", $arrval, $conf->global->STRIPE_PAYMENT_REQUEST_API); + print $form->selectarray("STRIPE_PAYMENT_REQUEST_API", $arrval, getDolGlobalString('STRIPE_PAYMENT_REQUEST_API')); } print '
'; print $langs->trans("ONLINE_PAYMENT_SENDEMAIL").''; +print img_picto('', 'email', 'class="pictofixedwidth"'); print ''; print '   '.$langs->trans("Example").': myemail@myserver.com, Payment service <myemail2@myserver2.com>'; print '
'; print $langs->trans("SecurityTokenIsUnique").''; if ($conf->use_javascript_ajax) { - print ajax_constantonoff('PAYMENT_SECURITY_TOKEN_UNIQUE'); + print ajax_constantonoff('PAYMENT_SECURITY_TOKEN_UNIQUE', null, null, 0, 0, 1); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); print $form->selectarray("PAYMENT_SECURITY_TOKEN_UNIQUE", $arrval, $conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE); diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 2cd61bfe5d0..7f17d51800d 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018-2022 Thibault FOUCART * Copyright (C) 2019 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -251,16 +251,15 @@ if (!$rowid) { $object = new Commande($db); $object->fetch($charge->metadata->dol_id); if ($object->id > 0) { - print "".img_picto('', 'object_order')." ".$object->ref.""; + print "".img_picto('', 'order')." ".$object->ref.""; } else { print $FULLTAG; } } elseif ($charge->metadata->dol_type == "invoice" || $charge->metadata->dol_type == "facture") { - print $charge->metadata->dol_type.' '.$charge->metadata->dol_id.' - '; $object = new Facture($db); $object->fetch($charge->metadata->dol_id); if ($object->id > 0) { - print "".img_picto('', 'object_invoice')." ".$object->ref.""; + print "".img_picto('', 'bill')." ".$object->ref.""; } else { print $FULLTAG; } diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 00d3c4a0d94..5ec149ba07f 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -643,9 +643,6 @@ class Stripe extends CommonObject if (!empty($conf->global->STRIPE_BANCONTACT)) { $paymentmethodtypes[] = "bancontact"; } - if (!empty($conf->global->STRIPE_KLARNA)) { - $paymentmethodtypes[] = "klarna"; - } if (!empty($conf->global->STRIPE_IDEAL)) { $paymentmethodtypes[] = "ideal"; } diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 64ce74b6022..0bfe4ebd080 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -70,6 +70,8 @@ $terminaltouse = $terminal; if (GETPOST('action', 'alpha') == 'set') { $db->begin(); + $res = dolibarr_set_const($db, "TAKEPOS_TERMINAL_NAME_".$terminaltouse, (!empty(GETPOST('terminalname'.$terminaltouse, 'restricthtml')) ? GETPOST('terminalname'.$terminaltouse, 'restricthtml') : $langs->trans("TerminalName", $terminaltouse)), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "CASHDESK_ID_THIRDPARTY".$terminaltouse, (GETPOST('socid', 'int') > 0 ? GETPOST('socid', 'int') : ''), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CASH".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity); @@ -148,6 +150,11 @@ print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("TerminalNameDesc").''; +print 'trans("TerminalName", $terminal)).'" >'; +print '
'.$langs->trans("CashDeskThirdPartyForSell").''; print $form->select_company($conf->global->{'CASHDESK_ID_THIRDPARTY'.$terminaltouse}, 'socid', '(s.client IN (1, 3) AND s.status = 1)', 1, 0, 0, array(), 0); diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index ee6a6c85d80..e9717e7c992 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -955,14 +955,9 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { - trans("Terminal"); ?> + trans("TerminalName", $_SESSION["takeposterminal"])); ?> - - '.dol_print_date(dol_now(), "day").''; ?> @@ -1019,11 +1014,11 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {

trans("TerminalSelect"); ?>

diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index e3f4a106c67..3657ca7f4b6 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -562,13 +562,20 @@ if (empty($reshook)) { $invoice->fetch_thirdparty(); $array_options = array(); + $line = array('description' => $prod->description, 'price' => $price, 'tva_tx' => $tva_tx, 'locatax1_tx' => $localtax1_tx, 'locatax2_tx' => $localtax2_tx, 'remise_percent' => $customer->remise_percent, 'price_ttc' => $price_ttc, 'array_options' => $array_options); + // complete line by hook - $parameters = array('prod' => $prod); - $reshook=$hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action); + $parameters = array('prod' => $prod, 'line' => $line); + $reshook=$hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action); // Note that $action and $line may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + if (empty($reshook)) { - $idoflineadded = $invoice->addline($prod->description, $price, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idproduct, $customer->remise_percent, '', 0, 0, 0, '', $price_base_type, $price_ttc, $prod->type, -1, 0, '', 0, (!empty($parent_line)) ? $parent_line : '', null, '', '', $array_options, 100, '', null, 0); + if (!empty($hookmanager->resArray)) { + $line = $hookmanager->resArray; + } + + $idoflineadded = $invoice->addline($line['description'], $line['price'], $qty, $line['tva_tx'], $line['localtax1_tx'], $line['localtax2_tx'], $idproduct, $line['remise_percent'], '', 0, 0, 0, '', $price_base_type, $line['price_ttc'], $prod->type, -1, 0, '', 0, (!empty($parent_line)) ? $parent_line : '', null, '', '', $line['array_options'], 100, '', null, 0); } if (!empty($conf->global->TAKEPOS_CUSTOMER_DISPLAY)) { diff --git a/htdocs/takepos/public/menu.php b/htdocs/takepos/public/menu.php index ad4dfd9035e..5d9d318db07 100644 --- a/htdocs/takepos/public/menu.php +++ b/htdocs/takepos/public/menu.php @@ -97,7 +97,7 @@ foreach ($maincategories as $cat) {

'.$pro->label.'

- '.price($pro->price_ttc, 1).' + '.price($pro->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).'
'; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 6a2ce22fa68..078d485a5c9 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -543,6 +543,7 @@ fieldset { border: 1px solid #AAAAAA !important; padding-inline-start: 2em; padding-inline-end: 2em; + min-inline-size: auto; } .legendforfieldsetstep { padding-bottom: 10px; } input#onlinepaymenturl, input#directdownloadlink { @@ -2310,7 +2311,7 @@ span.widthpictotitle.pictotitle { .pictofixedwidth { text-align: ; width: 20px; - padding-right: 0; + /* padding-right: 0; */ } .colorthumb { @@ -5143,6 +5144,7 @@ span[phptag] { } .centpercent.websitebar { width: calc(100% - 10px); + font-size: 0.94em; } .websitebar .buttonDelete, .websitebar .button { text-shadow: none; @@ -7639,6 +7641,10 @@ div.clipboardCPValue.hidewithsize { #dolpaymenttable { padding: 5px; } + + .lilevel1 span.paddingright { + padding-right: 4px; + } } @media only screen and (max-width: 320px) diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 03e9565db21..ca485fb0d5f 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -725,6 +725,7 @@ fieldset { border: 1px solid #AAAAAA !important; padding-inline-start: 2em; padding-inline-end: 2em; + min-inline-size: auto; } .legendforfieldsetstep { padding-bottom: 10px; } input#onlinepaymenturl, input#directdownloadlink { @@ -2339,7 +2340,7 @@ img.hideonsmartphone.pictoactionview { .pictofixedwidth { text-align: ; width: 20px; - padding-right: 0; + /* padding-right: 0; */ } .colorthumb { @@ -4992,6 +4993,7 @@ span[phptag] { } .centpercent.websitebar { width: calc(100% - 10px); + font-size: 0.94em; } .websitebar .buttonDelete, .websitebar .button { text-shadow: none; @@ -7319,6 +7321,10 @@ div.clipboardCPValue.hidewithsize { #dolpaymenttable { padding: 5px; } + + .lilevel1 span.paddingright { + padding-right: 3px; + } } diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index e7fc3abba34..cb7e71f8356 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -56,6 +56,7 @@ $projectid = GETPOST('projectid', 'int'); $cancel = GETPOST('cancel', 'alpha'); $action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('$backtopage', 'alpha'); +$contactid = GETPOST('contactid', 'int'); $notifyTiers = GETPOST("notify_tiers_at_create", 'alpha'); @@ -924,15 +925,17 @@ if ($action == 'create' || $action == 'presend') { if ($object->fk_user_create > 0) { $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; - $langs->load("users"); $fuser = new User($db); $fuser->fetch($object->fk_user_create); $morehtmlref .= $fuser->getNomUrl(-1); - } - if (!empty($object->origin_email)) { + } elseif (!empty($object->email_msgid)) { $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); - $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$langs->trans("TicketEmailOriginIssuer").')'; + $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$form->textwithpicto($langs->trans("CreatedByEmailCollector"), $langs->trans("EmailMsgID").': '.$object->email_msgid).')'; + } elseif (!empty($object->origin_email)) { + $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; + $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); + $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$langs->trans("CreatedByPublicPortal").')'; } // Thirdparty @@ -1018,6 +1021,23 @@ if ($action == 'create' || $action == 'presend') { print ' - '.$langs->trans("TimeElapsedSince").': '.convertSecondToTime(roundUpToNextMultiple($now - $object->datec, 60)).''; print '
'; + print $langs->trans("Origin"); + print ''; + print $texttoshow; + print '
'.$langs->trans("TicketReadOn").''; if (!empty($object->date_read)) { @@ -1038,7 +1058,7 @@ if ($action == 'create' || $action == 'presend') { print '
'; print '
'; print $langs->trans("AssignedTo"); - if ($object->fk_status < $object::STATUS_CLOSED && GETPOST('set', 'alpha') != "assign_ticket" && $user->rights->ticket->manage) { + if (isset($object->fk_status) && $object->fk_status < $object::STATUS_CLOSED && GETPOST('set', 'alpha') != "assign_ticket" && $user->rights->ticket->manage) { print ''.img_edit($langs->trans('Modify'), '').''; } print '
'; @@ -1066,7 +1086,7 @@ if ($action == 'create' || $action == 'presend') { print ''; - if ($action != 'progression' && $object->fk_status < $object::STATUS_CLOSED && !$user->socid) { + if ($action != 'progression' && isset($object->fk_status) && $object->fk_status < $object::STATUS_CLOSED && !$user->socid) { print ''; } print '
'; print $langs->trans('Progression').''; print ''.img_edit($langs->trans('Modify')).'
'; @@ -1117,6 +1137,7 @@ if ($action == 'create' || $action == 'presend') { // Fin colonne gauche et début colonne droite print '
'; + print '
'; print ''; print ''; @@ -1126,13 +1147,10 @@ if ($action == 'create' || $action == 'presend') { // Categories if (isModEnabled('categorie')) { - print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table - - print ''; - + print '
'; print ''; print '"; print ''; @@ -903,7 +907,7 @@ if ($id && ($action == 'edit' || $action == 'create') && $user->rights->user->us print '"; print '
'; - print ''; } elseif ($key == 'fk_user_assign' || $key == 'fk_user_create') { print ''; } elseif ($key == 'fk_statut') { $arrayofstatus = array(); @@ -1005,7 +1005,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { } elseif ($key == 'subject') { $s = $obj->subject; print ''; - print $s; + print dol_escape_htmltag($s); print ''; } elseif ($key == 'type_code') { $s = $langs->getLabelFromKey($db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code); diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index 4b887691f01..df829a010ec 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -157,14 +157,17 @@ $morehtmlref .= $object->subject; if ($object->fk_user_create > 0) { $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; - $langs->load("users"); $fuser = new User($db); $fuser->fetch($object->fk_user_create); $morehtmlref .= $fuser->getNomUrl(-1); -} -if (!empty($object->origin_email)) { +} elseif (!empty($object->email_msgid)) { $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; - $morehtmlref .= $object->origin_email.' ('.$langs->trans("TicketEmailOriginIssuer").')'; + $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); + $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$form->textwithpicto($langs->trans("CreatedByEmailCollector"), $langs->trans("EmailMsgID").': '.$object->email_msgid).')'; +} elseif (!empty($object->origin_email)) { + $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; + $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); + $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$langs->trans("CreatedByPublicPortal").')'; } // Thirdparty diff --git a/htdocs/ticket/stats/index.php b/htdocs/ticket/stats/index.php index 37273ee4d1d..463526ba711 100644 --- a/htdocs/ticket/stats/index.php +++ b/htdocs/ticket/stats/index.php @@ -284,7 +284,7 @@ foreach ($data as $val) { print ''; print ''; print ''; - print ''; + print ''; //print ''; //print ''; //print ''; diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php index f1b908ef5f7..669333e4826 100644 --- a/htdocs/user/agenda_extsites.php +++ b/htdocs/user/agenda_extsites.php @@ -169,7 +169,11 @@ if ($user->rights->user->user->lire || $user->admin) { $linkback = ''.$langs->trans("BackToList").''; } -dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); +$morehtmlref = ''; +$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"'); +$morehtmlref .= ''; + +dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', $morehtmlref); print '
'; diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 4ef87e944df..6be5afb3753 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -310,7 +310,11 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac $linkback = ''.$langs->trans("BackToList").''; } - dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); + $morehtmlref = ''; + $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"'); + $morehtmlref .= ''; + + dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', $morehtmlref); print '
'; @@ -833,7 +837,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac if ($account->id == 0) { $colspan = 6; - print '
'; + print ''; } print '
'; + print ''; @@ -1169,11 +1187,8 @@ if ($action == 'create' || $action == 'presend') { } print '
'; print $langs->trans("Categories"); if ($action != 'categories' && !$user->socid) { print ''.img_edit($langs->trans('Modify')).'
'; - - print ''; } - // View Original message $actionobject->viewTicketOriginalMessage($user, $action, $object); @@ -1189,7 +1204,7 @@ if ($action == 'create' || $action == 'presend') { print ''; } else { // Button to edit Properties - if ($object->fk_status < $object::STATUS_NEED_MORE_INFO && $user->rights->ticket->write) { + if (isset($object->fk_status) && $object->fk_status < $object::STATUS_NEED_MORE_INFO && $user->rights->ticket->write) { print ' '.img_edit($langs->trans('Modify')).''; } } @@ -1248,7 +1263,7 @@ if ($action == 'create' || $action == 'presend') { // Display navbar with links to change ticket status print ''; - if (!$user->socid && $user->rights->ticket->write && $object->fk_status < $object::STATUS_CLOSED && GETPOST('set') !== 'properties') { + if (!$user->socid && $user->rights->ticket->write && isset($object->fk_status) && $object->fk_status < $object::STATUS_CLOSED && GETPOST('set') !== 'properties') { $actionobject->viewStatusActions($object); } @@ -1384,16 +1399,16 @@ if ($action == 'create' || $action == 'presend') { if (empty($reshook)) { // Show link to add a message (if read and not closed) - if ($object->fk_status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage") { + if (isset($object->fk_status) && $object->fk_status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage") { print dolGetButtonAction('', $langs->trans('TicketAddMessage'), 'default', $_SERVER["PHP_SELF"].'?action=presend_addmessage&mode=init&token='.newToken().'&track_id='.$object->track_id, ''); } // Link to create an intervention // socid is needed otherwise fichinter ask it and forgot origin after form submit :\ - if (!$object->fk_soc && $user->rights->ficheinter->creer) { + if (!$object->fk_soc && $user->hasRight("ficheinter", "creer")) { print dolGetButtonAction($langs->trans('UnableToCreateInterIfNoSocid'), $langs->trans('TicketAddIntervention'), 'default', $_SERVER['PHP_SELF']. '#', '', false); } - if ($object->fk_soc > 0 && $object->fk_status < Ticket::STATUS_CLOSED && $user->rights->ficheinter->creer) { + if ($object->fk_soc > 0 && isset($object->fk_status) && $object->fk_status < Ticket::STATUS_CLOSED && $user->rights->ficheinter->creer) { print dolGetButtonAction('', $langs->trans('TicketAddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&token='.newToken().'&socid='. $object->fk_soc.'&origin=ticket_ticket&originid='. $object->id, ''); } @@ -1404,17 +1419,17 @@ if ($action == 'create' || $action == 'presend') { */ // Close ticket if statut is read - if ($object->fk_status > 0 && $object->fk_status < Ticket::STATUS_CLOSED && $user->rights->ticket->write) { + if (isset($object->fk_status) && $object->fk_status > 0 && $object->fk_status < Ticket::STATUS_CLOSED && $user->rights->ticket->write) { print dolGetButtonAction('', $langs->trans('CloseTicket'), 'default', $_SERVER["PHP_SELF"].'?action=close&token='.newToken().'&track_id='.$object->track_id, ''); } // Abadon ticket if statut is read - if ($object->fk_status > 0 && $object->fk_status < Ticket::STATUS_CLOSED && $user->rights->ticket->write) { + if (isset($object->fk_status) && $object->fk_status > 0 && $object->fk_status < Ticket::STATUS_CLOSED && $user->rights->ticket->write) { print dolGetButtonAction('', $langs->trans('AbandonTicket'), 'default', $_SERVER["PHP_SELF"].'?action=abandon&token='.newToken().'&track_id='.$object->track_id, ''); } // Re-open ticket - if (!$user->socid && ($object->fk_status == Ticket::STATUS_CLOSED || $object->fk_status == Ticket::STATUS_CANCELED) && !$user->socid) { + if (!$user->socid && (isset($object->fk_status) && ($object->fk_status == Ticket::STATUS_CLOSED || $object->fk_status == Ticket::STATUS_CANCELED)) && !$user->socid) { print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&track_id='.$object->track_id, ''); } diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 5fae77938e8..82c2142d786 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -203,16 +203,23 @@ class Ticket extends CommonObject public $notify_tiers_at_create; /** - * @var string msgid + * @var string Email MSGID */ public $email_msgid; + /** + * @var string Email Date + */ + public $email_date; + + public $lines; + /** * @var string Regex pour les images */ - public $regeximgext = '\.jpg|\.jpeg|\.bmp|\.gif|\.png|\.tiff'; + public $regeximgext = '\.gif|\.jpg|\.jpeg|\.png|\.bmp|\.webp|\.xpm|\.xbm'; // See also into images.lib.php /** * Status @@ -259,24 +266,25 @@ class Ticket extends CommonObject 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>5, 'notnull'=>1, 'index'=>1), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'css'=>'', 'showoncombobox'=>1), 'track_id' => array('type'=>'varchar(255)', 'label'=>'TicketTrackId', 'visible'=>-2, 'enabled'=>1, 'position'=>11, 'notnull'=>-1, 'searchall'=>1, 'help'=>"Help text"), - 'fk_user_create' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Author', 'visible'=>1, 'enabled'=>1, 'position'=>15, 'notnull'=>1, 'css'=>'tdoverflowmax125 maxwidth150onsmartphone'), - 'origin_email' => array('type'=>'mail', 'label'=>'OriginEmail', 'visible'=>-2, 'enabled'=>1, 'position'=>16, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'css'=>'tdoverflowmax150'), + 'fk_user_create' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Author', 'visible'=>1, 'enabled'=>1, 'position'=>15, 'notnull'=>1, 'csslist'=>'tdoverflowmax100 maxwidth150onsmartphone'), + 'origin_email' => array('type'=>'mail', 'label'=>'OriginEmail', 'visible'=>-2, 'enabled'=>1, 'position'=>16, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'csslist'=>'tdoverflowmax150'), 'subject' => array('type'=>'varchar(255)', 'label'=>'Subject', 'visible'=>1, 'enabled'=>1, 'position'=>18, 'notnull'=>-1, 'searchall'=>1, 'help'=>"", 'css'=>'maxwidth200 tdoverflowmax200', 'autofocusoncreate'=>1), - 'type_code' => array('type'=>'varchar(32)', 'label'=>'Type', 'visible'=>1, 'enabled'=>1, 'position'=>20, 'notnull'=>-1, 'help'=>"", 'css'=>'maxwidth125 tdoverflowmax50'), + 'type_code' => array('type'=>'varchar(32)', 'label'=>'Type', 'visible'=>1, 'enabled'=>1, 'position'=>20, 'notnull'=>-1, 'help'=>"", 'csslist'=>'maxwidth125 tdoverflowmax50'), 'category_code' => array('type'=>'varchar(32)', 'label'=>'TicketCategory', 'visible'=>-1, 'enabled'=>1, 'position'=>21, 'notnull'=>-1, 'help'=>"", 'css'=>'maxwidth100 tdoverflowmax200'), 'severity_code' => array('type'=>'varchar(32)', 'label'=>'Severity', 'visible'=>1, 'enabled'=>1, 'position'=>22, 'notnull'=>-1, 'help'=>"", 'css'=>'maxwidth100'), - 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty", 'css'=>'tdoverflowmax150 maxwidth150onsmartphone'), + 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"OrganizationEventLinkToThirdParty", 'css'=>'tdoverflowmax150 maxwidth150onsmartphone'), 'notify_tiers_at_create' => array('type'=>'integer', 'label'=>'NotifyThirdparty', 'visible'=>-1, 'enabled'=>0, 'position'=>51, 'notnull'=>1, 'index'=>1), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php', 'label'=>'Project', 'visible'=>-1, 'enabled'=>'$conf->project->enabled', 'position'=>52, 'notnull'=>-1, 'index'=>1, 'help'=>"LinkToProject"), //'timing' => array('type'=>'varchar(20)', 'label'=>'Timing', 'visible'=>-1, 'enabled'=>1, 'position'=>42, 'notnull'=>-1, 'help'=>""), // what is this ? - 'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>1, 'enabled'=>1, 'position'=>500, 'notnull'=>1), + 'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>1, 'enabled'=>1, 'position'=>500, 'notnull'=>1, 'csslist'=>'nowraponall'), 'date_read' => array('type'=>'datetime', 'label'=>'TicketReadOn', 'visible'=>-1, 'enabled'=>1, 'position'=>501, 'notnull'=>1), 'date_last_msg_sent' => array('type'=>'datetime', 'label'=>'TicketLastMessageDate', 'visible'=>0, 'enabled'=>1, 'position'=>502, 'notnull'=>-1), - 'fk_user_assign' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'AssignedTo', 'visible'=>1, 'enabled'=>1, 'position'=>505, 'notnull'=>1, 'css'=>'tdoverflowmax125'), + 'fk_user_assign' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'AssignedTo', 'visible'=>1, 'enabled'=>1, 'position'=>505, 'notnull'=>1, 'csslist'=>'tdoverflowmax100 maxwidth150onsmartphone'), 'date_close' => array('type'=>'datetime', 'label'=>'TicketCloseOn', 'visible'=>-1, 'enabled'=>1, 'position'=>510, 'notnull'=>1), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-1, 'enabled'=>1, 'position'=>520, 'notnull'=>1), 'message' => array('type'=>'text', 'label'=>'Message', 'visible'=>-2, 'enabled'=>1, 'position'=>540, 'notnull'=>-1,), 'email_msgid' => array('type'=>'varchar(255)', 'label'=>'EmailMsgID', 'visible'=>-2, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'help'=>'EmailMsgIDDesc'), + 'email_date' => array('type'=>'datetime', 'label'=>'EmailDate', 'visible'=>-2, 'enabled'=>1, 'position'=>541), 'progress' => array('type'=>'integer', 'label'=>'Progression', 'visible'=>-1, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'css'=>'right', 'help'=>"", 'isameasure'=>2, 'csslist'=>'width50'), 'resolution' => array('type'=>'integer', 'label'=>'Resolution', 'visible'=>-1, 'enabled'=>'$conf->global->TICKET_ENABLE_RESOLUTION', 'position'=>550, 'notnull'=>1), 'fk_statut' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>600, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0 => 'Unread', 1 => 'Read', 3 => 'Answered', 4 => 'Assigned', 5 => 'InProgress', 6 => 'Waiting', 8 => 'SolvedClosed', 9 => 'Deleted')), @@ -437,6 +445,7 @@ class Ticket extends CommonObject $sql .= "fk_user_create,"; $sql .= "fk_user_assign,"; $sql .= "email_msgid,"; + $sql .= "email_date,"; $sql .= "subject,"; $sql .= "message,"; $sql .= "fk_statut,"; @@ -460,6 +469,7 @@ class Ticket extends CommonObject $sql .= " ".($this->fk_user_create > 0 ? $this->fk_user_create : ($user->id > 0 ? $user->id : 'NULL')).","; $sql .= " ".($this->fk_user_assign > 0 ? $this->fk_user_assign : 'NULL').","; $sql .= " ".(empty($this->email_msgid) ? 'NULL' : "'".$this->db->escape($this->email_msgid)."'").","; + $sql .= " ".(empty($this->email_date) ? 'NULL' : "'".$this->db->idate($this->email_date)."'").","; $sql .= " ".(!isset($this->subject) ? 'NULL' : "'".$this->db->escape($this->subject)."'").","; $sql .= " ".(!isset($this->message) ? 'NULL' : "'".$this->db->escape($this->message)."'").","; $sql .= " ".(!isset($this->fk_statut) ? '0' : "'".$this->db->escape($this->fk_statut)."'").","; @@ -570,6 +580,7 @@ class Ticket extends CommonObject $sql .= " t.fk_user_create,"; $sql .= " t.fk_user_assign,"; $sql .= " t.email_msgid,"; + $sql .= " t.email_date,"; $sql .= " t.subject,"; $sql .= " t.message,"; $sql .= " t.fk_statut as status,"; @@ -620,6 +631,7 @@ class Ticket extends CommonObject $this->fk_user_create = $obj->fk_user_create; $this->fk_user_assign = $obj->fk_user_assign; $this->email_msgid = $obj->email_msgid; + $this->email_date = $this->db->jdate($obj->email_date); $this->subject = $obj->subject; $this->message = $obj->message; diff --git a/htdocs/ticket/contact.php b/htdocs/ticket/contact.php index 5b1b73799f2..d32ab88eb1c 100644 --- a/htdocs/ticket/contact.php +++ b/htdocs/ticket/contact.php @@ -196,14 +196,17 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) { if ($object->fk_user_create > 0) { $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; - $langs->load("users"); $fuser = new User($db); $fuser->fetch($object->fk_user_create); $morehtmlref .= $fuser->getNomUrl(-1); - } - if (!empty($object->origin_email)) { + } elseif (!empty($object->email_msgid)) { $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; - $morehtmlref .= $object->origin_email.' ('.$langs->trans("TicketEmailOriginIssuer").')'; + $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); + $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$form->textwithpicto($langs->trans("CreatedByEmailCollector"), $langs->trans("EmailMsgID").': '.$object->email_msgid).')'; + } elseif (!empty($object->origin_email)) { + $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; + $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); + $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$langs->trans("CreatedByPublicPortal").')'; } // Thirdparty diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php index bf2b1c51fc4..234c5e92918 100644 --- a/htdocs/ticket/document.php +++ b/htdocs/ticket/document.php @@ -129,16 +129,19 @@ if ($object->id) { $morehtmlref .= $object->subject; // Author if ($object->fk_user_create > 0) { - $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; + $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; - $langs->load("users"); $fuser = new User($db); $fuser->fetch($object->fk_user_create); $morehtmlref .= $fuser->getNomUrl(-1); - } - if (!empty($object->origin_email)) { + } elseif (!empty($object->email_msgid)) { $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; - $morehtmlref .= $object->origin_email.' ('.$langs->trans("TicketEmailOriginIssuer").')'; + $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); + $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$form->textwithpicto($langs->trans("CreatedByEmailCollector"), $langs->trans("EmailMsgID").': '.$object->email_msgid).')'; + } elseif (!empty($object->origin_email)) { + $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; + $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); + $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$langs->trans("CreatedByPublicPortal").')'; } // Thirdparty diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index f09388fa0ac..693a40fbb5f 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -824,7 +824,7 @@ foreach ($object->fields as $key => $val) { print '
'; - print $form->select_dolusers((empty($search[$key]) ? '' : $search[$key]), 'search_'.$key, 1, null, 0, '', '', '0', 0, 0, '', 0, '', ($val['css'] ? $val['css'] : 'maxwidth125')); + print $form->select_dolusers((empty($search[$key]) ? '' : $search[$key]), 'search_'.$key, 1, null, 0, '', '', '0', 0, 0, '', 0, '', ($val['css'] ? $val['css'] : 'maxwidth100')); print '
0 ? '&userid='.$userid : '').'">'.$year.''.$val['nb'].''.round($val['nb_diff']).''.round(isset($val['nb_diff']) ? $val['nb_diff'] : 0).''.price(price2num($val['total'], 'MT'), 1).''.round($val['total_diff']).''.price(price2num($val['avg'], 'MT'), 1).'
'.$langs->trans("NoBANRecord").'
'.$langs->trans("NoBANRecord").'
'; @@ -894,7 +898,7 @@ if ($id && ($action == 'edit' || $action == 'create') && $user->rights->user->us print '
'.$langs->trans("BankAccountDomiciliation").''; print '
'.$langs->trans("BankAccountOwner").'
'.$langs->trans("BankAccountOwnerAddress").''; print '
'; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index c4f1be97eb8..8e375933a91 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -76,15 +76,15 @@ $dateendvalidity = dol_mktime(0, 0, 0, GETPOST('dateendvaliditymonth', 'int'), G $dateofbirth = dol_mktime(0, 0, 0, GETPOST('dateofbirthmonth', 'int'), GETPOST('dateofbirthday', 'int'), GETPOST('dateofbirthyear', 'int')); // Define value to know what current user can do on users -$canadduser = (!empty($user->admin) || $user->rights->user->user->creer); -$canreaduser = (!empty($user->admin) || $user->rights->user->user->lire); -$canedituser = (!empty($user->admin) || $user->rights->user->user->creer); -$candisableuser = (!empty($user->admin) || $user->rights->user->user->supprimer); +$canadduser = (!empty($user->admin) || $user->hasRight("user", "user", "write")); +$canreaduser = (!empty($user->admin) || $user->hasRight("user", "user", "read")); +$canedituser = (!empty($user->admin) || $user->hasRight("user", "user", "write")); +$candisableuser = (!empty($user->admin) || $user->hasRight("user", "user", "delete")); $canreadgroup = $canreaduser; $caneditgroup = $canedituser; if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { - $canreadgroup = (!empty($user->admin) || $user->rights->user->group_advance->read); - $caneditgroup = (!empty($user->admin) || $user->rights->user->group_advance->write); + $canreadgroup = (!empty($user->admin) || $user->hasRight("user", "group_advance", "read")); + $caneditgroup = (!empty($user->admin) || $user->hasRight("user", "group_advance", "write")); } $childids = $user->getAllChildIds(1); // For later, test on salary visibility @@ -92,8 +92,8 @@ $childids = $user->getAllChildIds(1); // For later, test on salary visibility // Define value to know what current user can do on properties of edited user if ($id > 0) { // $user is the current logged user, $id is the user we want to edit - $caneditfield = ((($user->id == $id) && $user->rights->user->self->creer) || (($user->id != $id) && $user->rights->user->user->creer)); - $caneditpassword = ((($user->id == $id) && $user->rights->user->self->password) || (($user->id != $id) && $user->rights->user->user->password)); + $caneditfield = ((($user->id == $id) && $user->hasRight("user", "self", "write")) || (($user->id != $id) && $user->hasRight("user", "user", "write"))); + $caneditpassword = ((($user->id == $id) && $user->hasRight("user", "self", "password")) || (($user->id != $id) && $user->hasRight("user", "user", "password"))); } // Security check @@ -712,7 +712,7 @@ if (empty($reshook)) { // Actions to build doc $upload_dir = $conf->user->dir_output; - $permissiontoadd = $user->rights->user->user->creer; + $permissiontoadd = $user->hasRight("user", "user", "write"); include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; } @@ -833,7 +833,7 @@ if ($action == 'create' || $action == 'adduserldap') { print ''; // Civility - print ''; @@ -1165,7 +1165,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (!empty($conf->categorie->enabled) && !empty($user->hasRight("categorie", "read"))) { print ''; - if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read) && in_array($id, $childids)) - || (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->readall)) - || (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read))) { + if ((!empty($conf->salaries->enabled) && !empty($user->hasRight("salaries", "read")) && in_array($id, $childids)) + || (!empty($conf->salaries->enabled) && !empty($user->hasRight("salaries", "readall"))) + || (!empty($conf->hrm->enabled) && !empty($user->hasRight("hrm", "employee", "read")))) { $langs->load("salaries"); // THM @@ -1365,7 +1365,7 @@ if ($action == 'create' || $action == 'adduserldap') { $title = $langs->trans("User"); $linkback = ''; - if ($user->rights->user->user->lire || $user->admin) { + if ($user->hasRight("user", "user", "read") || $user->admin) { $linkback = ''.$langs->trans("BackToList").''; } } @@ -1413,7 +1413,11 @@ if ($action == 'create' || $action == 'adduserldap') { if ($action != 'edit') { print dol_get_fiche_head($head, 'user', $title, -1, 'user'); - dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); + $morehtmlref = ''; + $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"'); + $morehtmlref .= ''; + + dol_banner_tab($object, 'id', $linkback, $user->hasRight("user", "user", "read") || $user->admin, 'rowid', 'ref', $morehtmlref); print '
'; print '
'; @@ -1537,8 +1541,8 @@ if ($action == 'create' || $action == 'adduserldap') { // Sensitive salary/value information if ((empty($user->socid) && in_array($id, $childids)) // A user can always see salary/value information for its subordinates - || (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->readall)) - || (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read))) { + || (!empty($conf->salaries->enabled) && !empty($user->hasRight("salaries", "readall"))) + || (!empty($conf->hrm->enabled) && !empty($user->hasRight("hrm", "employee", "read")))) { $langs->load("salaries"); // Salary @@ -1621,7 +1625,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (!empty($conf->categorie->enabled) && !empty($user->hasRight("categorie", "read"))) { print '
'; print '\n"; - // VCard - print ''; - print '\n"; - print "
'; + print '
'; print $formcompany->select_civility(GETPOSTISSET("civility_code") ? GETPOST("civility_code", 'aZ09') : $object->civility_code, 'civility_code'); print '
'.$form->editfieldkey('Categories', 'usercats', '', $object, 0).''; $cate_arbo = $form->select_all_categories('user', null, 'parent', null, null, 1); print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('usercats', $cate_arbo, GETPOST('usercats', 'array'), 0, 0, 'maxwdith300 widthcentpercentminusx', 0, '90%'); @@ -1234,9 +1234,9 @@ if ($action == 'create' || $action == 'adduserldap') { print ''; print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_USER, 1); @@ -1721,15 +1725,6 @@ if ($action == 'create' || $action == 'adduserldap') { print dol_htmlentitiesbr($object->signature); print "
'.$langs->trans("VCard").''; - print ''; - print img_picto($langs->trans("Download"), 'vcard.png', 'class="paddingrightonly"'); - print $langs->trans("Download"); - print ''; - print "
\n"; // Credentials @@ -1809,7 +1804,7 @@ if ($action == 'create' || $action == 'adduserldap') { print '
'.$langs->trans("ApiKey").''; if (!empty($object->api_key)) { @@ -2077,7 +2072,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Civility - print '
'; + print '
'; if ($caneditfield && !$object->ldap_sid) { print $formcompany->select_civility(GETPOSTISSET("civility_code") ? GETPOST("civility_code", 'aZ09') : $object->civility_code, 'civility_code'); } elseif ($object->civility_code) { @@ -2374,7 +2369,7 @@ if ($action == 'create' || $action == 'adduserldap') { print "
'.$langs->trans("ApiKey").''; print ''; @@ -2571,7 +2566,7 @@ if ($action == 'create' || $action == 'adduserldap') { print '
'.$form->editfieldkey('Categories', 'usercats', '', $object, 0).''; print img_picto('', 'category', 'class="pictofixedwidth"'); @@ -2716,8 +2711,8 @@ if ($action == 'create' || $action == 'adduserldap') { // Sensitive salary/value information if ((empty($user->socid) && in_array($id, $childids)) // A user can always see salary/value information for its subordinates - || (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->readall)) - || (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read))) { + || (!empty($conf->salaries->enabled) && !empty($user->hasRight("salaries", "readall"))) + || (!empty($conf->hrm->enabled) && !empty($user->hasRight("hrm", "employee", "read")))) { $langs->load("salaries"); // Salary @@ -2808,8 +2803,8 @@ if ($action == 'create' || $action == 'adduserldap') { $filename = dol_sanitizeFileName($object->ref); $filedir = $conf->user->dir_output."/".dol_sanitizeFileName($object->ref); $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; - $genallowed = $user->rights->user->user->lire; - $delallowed = $user->rights->user->user->creer; + $genallowed = $user->hasRight("user", "user", "read"); + $delallowed = $user->hasRight("user", "user", "write"); print $formfile->showdocuments('user', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', 0, '', empty($soc->default_lang) ? '' : $soc->default_lang); $somethingshown = $formfile->numoffiles; @@ -2834,20 +2829,12 @@ if ($action == 'create' || $action == 'adduserldap') { } } -if (!empty($conf->api->enabled) && !empty($conf->use_javascript_ajax)) { - print "\n".''; +if (!empty($conf->api->enabled)) { + $constname = 'api_key'; + + // Add button to autosuggest a key + include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; + print dolJSToSetRandomPassword($constname, 'generate_api_key'); } // End of page diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index fcd1505a402..4c044f329b2 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -775,16 +775,16 @@ class User extends CommonObject // For backward compatibility with old permissions called "lire", "creer", "create", "supprimer" // instead of "read", "write", "delete" if ($permlevel2 == 'read' && !empty($this->rights->$rightsPath->$permlevel1->lire)) { - return $this->rights->$rightsPath->lire; + return $this->rights->$rightsPath->$permlevel1->lire; } if ($permlevel2 == 'write' && !empty($this->rights->$rightsPath->$permlevel1->creer)) { - return $this->rights->$rightsPath->create; + return $this->rights->$rightsPath->$permlevel1->creer; } if ($permlevel2 == 'write' && !empty($this->rights->$rightsPath->$permlevel1->create)) { - return $this->rights->$rightsPath->create; + return $this->rights->$rightsPath->$permlevel1->create; } if ($permlevel2 == 'delete' && !empty($this->rights->$rightsPath->$permlevel1->supprimer)) { - return $this->rights->$rightsPath->supprimer; + return $this->rights->$rightsPath->$permlevel1->supprimer; } } } else { @@ -797,7 +797,7 @@ class User extends CommonObject return $this->rights->$rightsPath->lire; } if ($permlevel1 == 'write' && !empty($this->rights->$rightsPath->creer)) { - return $this->rights->$rightsPath->create; + return $this->rights->$rightsPath->creer; } if ($permlevel1 == 'write' && !empty($this->rights->$rightsPath->create)) { return $this->rights->$rightsPath->create; @@ -1864,7 +1864,6 @@ class User extends CommonObject $this->address = trim((string) $this->address); $this->zip = trim((string) $this->zip); $this->town = trim((string) $this->town); - $this->setUpperOrLowerCase(); $this->state_id = ($this->state_id > 0 ? $this->state_id : 0); $this->country_id = ($this->country_id > 0 ? $this->country_id : 0); @@ -1891,6 +1890,8 @@ class User extends CommonObject $this->birth = empty($this->birth) ? '' : $this->birth; $this->fk_warehouse = (int) $this->fk_warehouse; + $this->setUpperOrLowerCase(); + // Check parameters $badCharUnauthorizedIntoLoginName = getDolGlobalString('MAIN_LOGIN_BADCHARUNAUTHORIZED', ',@<>"\''); diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index ca228f122ec..50d514166ee 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -43,6 +43,7 @@ $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('usercard', 'globalcard')); + /* * Actions */ @@ -104,7 +105,11 @@ if ($id > 0) { $linkback = ''.$langs->trans("BackToList").''; } - dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); + $morehtmlref = ''; + $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"'); + $morehtmlref .= ''; + + dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', $morehtmlref); print '
'; print '
'; diff --git a/htdocs/user/document.php b/htdocs/user/document.php index d33175af8c5..31ec618a795 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -41,23 +41,23 @@ $ref = GETPOST('ref', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'userdoc'; // To manage different context of search // Define value to know what current user can do on users -$canadduser = (!empty($user->admin) || $user->rights->user->user->creer); -$canreaduser = (!empty($user->admin) || $user->rights->user->user->lire); -$canedituser = (!empty($user->admin) || $user->rights->user->user->creer); -$candisableuser = (!empty($user->admin) || $user->rights->user->user->supprimer); +$canadduser = (!empty($user->admin) || $user->hasRight("user", "user", "write")); +$canreaduser = (!empty($user->admin) || $user->hasRight("user", "user", "read")); +$canedituser = (!empty($user->admin) || $user->hasRight("user", "user", "write")); +$candisableuser = (!empty($user->admin) || $user->hasRight("user", "user", "delete")); $canreadgroup = $canreaduser; $caneditgroup = $canedituser; if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { - $canreadgroup = (!empty($user->admin) || $user->rights->user->group_advance->read); - $caneditgroup = (!empty($user->admin) || $user->rights->user->group_advance->write); + $canreadgroup = (!empty($user->admin) || $user->hasRight("user", "group_advance", "read")); + $caneditgroup = (!empty($user->admin) || $user->hasRight("user", "group_advance", "write")); } // Define value to know what current user can do on properties of edited user if ($id) { // $user est le user qui edite, $id est l'id de l'utilisateur edite - $caneditfield = ((($user->id == $id) && $user->rights->user->self->creer) - || (($user->id != $id) && $user->rights->user->user->creer)); - $caneditpassword = ((($user->id == $id) && $user->rights->user->self->password) - || (($user->id != $id) && $user->rights->user->user->password)); + $caneditfield = ((($user->id == $id) && $user->hasRight("user", "self", "write")) + || (($user->id != $id) && $user->hasRight("user", "user", "write"))); + $caneditpassword = ((($user->id == $id) && $user->hasRight("user", "self", "password")) + || (($user->id != $id) && $user->hasRight("user", "user", "passsword"))); } $permissiontoadd = $caneditfield; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles @@ -147,11 +147,15 @@ if ($object->id) { print dol_get_fiche_head($head, 'document', $langs->trans("User"), -1, 'user'); $linkback = ''; - if ($user->rights->user->user->lire || $user->admin) { + if ($user->hasRight("user", "user", "read") || $user->admin) { $linkback = ''.$langs->trans("BackToList").''; } - dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); + $morehtmlref = ''; + $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"'); + $morehtmlref .= ''; + + dol_banner_tab($object, 'id', $linkback, $user->hasRight("user", "user", "read") || $user->admin, 'rowid', 'ref', $morehtmlref); print '
'; print '
'; diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 92d309e554b..9b6e9e1c317 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -32,16 +32,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; // Defini si peux lire/modifier utilisateurs et permisssions -$canreadperms = ($user->admin || $user->rights->user->user->lire); -$caneditperms = ($user->admin || $user->rights->user->user->creer); -$candisableperms = ($user->admin || $user->rights->user->user->supprimer); +$canreadperms = ($user->admin || $user->hasRight("user", "user", "read")); +$caneditperms = ($user->admin || $user->hasRight("user", "user", "write")); +$candisableperms = ($user->admin || $user->hasRight("user", "user", "delete")); $feature2 = 'user'; // Advanced permissions if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { - $canreadperms = ($user->admin || $user->rights->user->group_advance->read); - $caneditperms = ($user->admin || $user->rights->user->group_advance->write); - $candisableperms = ($user->admin || $user->rights->user->group_advance->delete); + $canreadperms = ($user->admin || $user->hasRight("user", "group_advance", "read")); + $caneditperms = ($user->admin || $user->hasRight("user", "group_advance", "write")); + $candisableperms = ($user->admin || $user->hasRight("user", "group_advance", "delete")); $feature2 = 'group_advance'; } @@ -238,7 +238,7 @@ if (empty($reshook)) { // Actions to build doc $upload_dir = $conf->user->dir_output.'/usergroups'; - $permissiontoadd = $user->rights->user->user->creer; + $permissiontoadd = $user->hasRight("user", "user", "write"); include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; } @@ -250,7 +250,7 @@ $title = $object->name.' - '.$langs->trans("Card"); if ($action == 'create') { $title = $langs->trans("NewGroup"); } - +$help_url = ""; llxHeader('', $title, $help_url); @@ -329,7 +329,7 @@ if ($action == 'create') { $linkback = ''.$langs->trans("BackToList").''; - dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); + dol_banner_tab($object, 'id', $linkback, $user->hasRight("user", "user", "read") || $user->admin); print '
'; print '
'; @@ -485,8 +485,8 @@ if ($action == 'create') { $filename = dol_sanitizeFileName($object->ref); $filedir = $conf->user->dir_output."/usergroups/".dol_sanitizeFileName($object->ref); $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; - $genallowed = $user->rights->user->user->creer; - $delallowed = $user->rights->user->user->supprimer; + $genallowed = $user->hasRight("user", "user", "write"); + $delallowed = $user->hasRight("user", "user", "delete"); $somethingshown = $formfile->showdocuments('usergroup', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', 0, '', $mysoc->default_lang); diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index bb130b33e75..8f7f907eb7b 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -38,10 +38,10 @@ $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choi $contextpage = GETPOST('optioncss', 'aZ09'); // Defini si peux lire/modifier utilisateurs et permisssions -$caneditperms = ($user->admin || $user->rights->user->user->creer); +$caneditperms = ($user->admin || $user->hasRight("user", "user", "write")); // Advanced permissions if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { - $caneditperms = ($user->admin || $user->rights->user->group_advance->write); + $caneditperms = ($user->admin || $user->hasRight("user", "group_advance", "write")); } // Load variable for pagination @@ -70,7 +70,7 @@ $fieldstosearchall = array( ); if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { - if (!$user->rights->user->group_advance->read && !$user->admin) { + if (!$user->hasRight("user", "group_advance", "read") && !$user->admin) { accessforbidden(); } } @@ -80,7 +80,7 @@ if (!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global-> accessforbidden(); } -if (!$user->rights->user->user->lire && !$user->admin) { +if (!$user->hasRight("user", "user", "read") && !$user->admin) { accessforbidden(); } @@ -121,6 +121,7 @@ if (empty($reshook)) { * View */ $title = $langs->trans("ListOfGroups"); +$help_url=""; llxHeader('', $title, $help_url); $sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec, g.tms as datem, COUNT(DISTINCT ugu.fk_user) as nb, COUNT(DISTINCT ugr.fk_id) as nbpermissions"; diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index edf20d0884c..15fcc2a319f 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -50,15 +50,15 @@ if (!isset($id) || empty($id)) { } // Define if user can read permissions -$canreadperms = ($user->admin || $user->rights->user->user->lire); +$canreadperms = ($user->admin || $user->hasRight("user", "user", "read")); // Define if user can modify group permissions -$caneditperms = ($user->admin || $user->rights->user->user->creer); +$caneditperms = ($user->admin || $user->hasRight("user", "user", "write")); // Advanced permissions $advancedpermsactive = false; if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { $advancedpermsactive = true; - $canreadperms = ($user->admin || ($user->rights->user->group_advance->read && $user->rights->user->group_advance->readperms)); - $caneditperms = ($user->admin || $user->rights->user->group_advance->write); + $canreadperms = ($user->admin || ($user->hasRight("user", "group_advance", "read") && $user->hasRight("user", "group_advance", "readperms"))); + $caneditperms = ($user->admin || $user->hasRight("user", "group_advance", "write")); } // Security check @@ -206,7 +206,7 @@ if ($object->id > 0) { $linkback = ''.$langs->trans("BackToList").''; - dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); + dol_banner_tab($object, 'id', $linkback, $user->hasRight("user", "user", "read") || $user->admin); print '
'; print '
'; diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php index 92d0490f1c6..3f8326d3b7b 100644 --- a/htdocs/user/hierarchy.php +++ b/htdocs/user/hierarchy.php @@ -60,9 +60,9 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $userstatic = new User($db); // Define value to know what current user can do on users -$canadduser = (!empty($user->admin) || $user->rights->user->user->creer); +$canadduser = (!empty($user->admin) || $user->hasRight("user", "user", "write")); -if (!$user->rights->user->user->lire && !$user->admin) { +if (!$user->hasRight("user", "user", "read") && !$user->admin) { accessforbidden(); } diff --git a/htdocs/user/info.php b/htdocs/user/info.php index 6104df6f996..8c5643c5f42 100644 --- a/htdocs/user/info.php +++ b/htdocs/user/info.php @@ -79,7 +79,11 @@ if ($user->rights->user->user->lire || $user->admin) { $linkback = ''.$langs->trans("BackToList").''; } -dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); +$morehtmlref = ''; +$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"'); +$morehtmlref .= ''; + +dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', $morehtmlref); $object->info($id); // This overwrite ->ref with login instead of id diff --git a/htdocs/user/ldap.php b/htdocs/user/ldap.php index 8a8ca28092e..01be4fdcbae 100644 --- a/htdocs/user/ldap.php +++ b/htdocs/user/ldap.php @@ -97,7 +97,7 @@ llxHeader('', $title, $help_url); $head = user_prepare_head($object); $title = $langs->trans("User"); -print dol_get_fiche_head($head, 'ldap', $title, 0, 'user'); +print dol_get_fiche_head($head, 'ldap', $title, -1, 'user'); $linkback = ''; @@ -110,7 +110,7 @@ dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $use print '
'; print '
'; -print ''; +print '
'; // Login print ''; diff --git a/htdocs/user/list.php b/htdocs/user/list.php index a47fa7a51c2..f0196789e25 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -131,7 +131,7 @@ $arrayfields = array( 'u.email'=>array('label'=>"EMail", 'checked'=>1, 'position'=>35), 'u.api_key'=>array('label'=>"ApiKey", 'checked'=>0, 'position'=>40, "enabled"=>(!empty($conf->api->enabled) && $user->admin)), 'u.fk_soc'=>array('label'=>"Company", 'checked'=>($contextpage == 'employeelist' ? 0 : 1), 'position'=>45), - 'u.salary'=>array('label'=>"Salary", 'checked'=>1, 'position'=>80, 'enabled'=>(!empty($conf->salaries->enabled) && !empty($user->rights->salaries->readall))), + 'u.salary'=>array('label'=>"Salary", 'checked'=>1, 'position'=>80, 'enabled'=>(!empty($conf->salaries->enabled) && !empty($user->hasRight("salaries", "readall")))), 'u.datelastlogin'=>array('label'=>"LastConnexion", 'checked'=>1, 'position'=>100), 'u.datepreviouslogin'=>array('label'=>"PreviousConnexion", 'checked'=>0, 'position'=>110), 'u.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), @@ -174,26 +174,26 @@ if ($mode == 'employee' && !GETPOSTISSET('search_employee')) { } // Define value to know what current user can do on users -$permissiontoadd = (!empty($user->admin) || $user->rights->user->user->creer); -$canreaduser = (!empty($user->admin) || $user->rights->user->user->lire); -$canedituser = (!empty($user->admin) || $user->rights->user->user->creer); -$candisableuser = (!empty($user->admin) || $user->rights->user->user->supprimer); +$permissiontoadd = (!empty($user->admin) || $user->hasRight("user", "user", "write")); +$canreaduser = (!empty($user->admin) || $user->hasRight("user", "user", "read")); +$canedituser = (!empty($user->admin) || $user->hasRight("user", "user", "write")); +$candisableuser = (!empty($user->admin) || $user->hasRight("user", "user", "delete")); $canreadgroup = $canreaduser; $caneditgroup = $canedituser; if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { - $canreadgroup = (!empty($user->admin) || $user->rights->user->group_advance->read); - $caneditgroup = (!empty($user->admin) || $user->rights->user->group_advance->write); + $canreadgroup = (!empty($user->admin) || $user->hasRight("user", "group_advance", "read")); + $caneditgroup = (!empty($user->admin) || $user->hasRight("user", "group_advance", "write")); } $error = 0; // Permission to list if ($mode == 'employee') { - if (empty($user->rights->salaries->read)) { + if (empty($user->hasRight("salaries", "read"))) { accessforbidden(); } } else { - if (empty($user->rights->user->user->lire) && empty($user->admin)) { + if (empty($user->hasRight("user", "user", "read")) && empty($user->admin)) { accessforbidden(); } } @@ -441,7 +441,7 @@ if ($search_categ == -2) { if ($search_warehouse > 0) { $sql .= " AND u.fk_warehouse = ".((int) $search_warehouse); } -if ($mode == 'employee' && empty($user->rights->salaries->readall)) { +if ($mode == 'employee' && empty($user->hasRight("salaries", "readall"))) { $sql .= " AND u.rowid IN (".$db->sanitize(join(',', $childids)).")"; } // Add where from extra fields @@ -658,7 +658,7 @@ $moreforfilter = ''; $moreforfilter.= '';*/ // Filter on categories -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { +if (!empty($conf->categorie->enabled) && $user->hasRight("categorie", "read")) { $moreforfilter .= '
'; $tmptitle = $langs->trans('Category'); $moreforfilter .= img_picto($langs->trans("Category"), 'category', 'class="pictofixedwidth"').$formother->select_categories(Categorie::TYPE_USER, $search_categ, 'search_categ', 1, $tmptitle); @@ -939,9 +939,9 @@ while ($i < $imaxinloop) { $li = $object->getNomUrl(-1, '', 0, 0, 24, 1, 'login', '', 1); $canreadhrmdata = 0; - if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read) && in_array($obj->rowid, $childids)) - || (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->readall)) - || (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read))) { + if ((!empty($conf->salaries->enabled) && !empty($user->hasRight("salaries", "read")) && in_array($obj->rowid, $childids)) + || (!empty($conf->salaries->enabled) && !empty($user->hasRight("salaries", "readall"))) + || (!empty($conf->hrm->enabled) && !empty($user->hasRight("hrm", "employee", "read")))) { $canreadhrmdata = 1; } $canreadsecretapi = 0; diff --git a/htdocs/user/note.php b/htdocs/user/note.php index a52b39aab09..2b1e02b1376 100644 --- a/htdocs/user/note.php +++ b/htdocs/user/note.php @@ -39,7 +39,7 @@ $object->fetch($id, '', '', 1); $object->getrights(); // If user is not user read and no permission to read other users, we stop -if (($object->id != $user->id) && (!$user->rights->user->user->lire)) { +if (($object->id != $user->id) && (!$user->hasRight("user", "user", "read"))) { accessforbidden(); } @@ -48,7 +48,7 @@ $socid = 0; if ($user->socid > 0) { $socid = $user->socid; } -$feature2 = (($socid && $user->rights->user->self->creer) ? '' : 'user'); +$feature2 = (($socid && $user->hasRight("user", "self", "write")) ? '' : 'user'); $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); @@ -67,7 +67,7 @@ if ($reshook < 0) { } if (empty($reshook)) { - if ($action == 'update' && $user->rights->user->user->creer && !GETPOST("cancel")) { + if ($action == 'update' && $user->hasRight("user", "user", "write") && !GETPOST("cancel")) { $db->begin(); $res = $object->update_note(dol_html_entity_decode(GETPOST('note_private', 'restricthtml'), ENT_QUOTES | ENT_HTML5)); @@ -99,11 +99,15 @@ if ($id) { $linkback = ''; - if ($user->rights->user->user->lire || $user->admin) { + if ($user->hasRight("user", "user", "read") || $user->admin) { $linkback = ''.$langs->trans("BackToList").''; } - dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); + $morehtmlref = ''; + $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"'); + $morehtmlref .= ''; + + dol_banner_tab($object, 'id', $linkback, $user->hasRight("user", "user", "read") || $user->admin, 'rowid', 'ref', $morehtmlref); print '
'; @@ -134,7 +138,7 @@ if ($id) { } print '
'; - $editenabled = (($action == 'edit') && !empty($user->rights->user->user->creer)); + $editenabled = (($action == 'edit') && !empty($user->hasRight("user", "user", "write"))); // Note print ''; @@ -167,7 +171,7 @@ if ($id) { print '
'; - if ($user->rights->user->user->creer && $action != 'edit') { + if ($user->hasRight("user", "user", "write") && $action != 'edit') { print ''.$langs->trans('Modify').""; } diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 3337d846f0b..e047ab74d51 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -154,7 +154,11 @@ if ($result > 0) { $linkback = ''.$langs->trans("BackToList").''; - dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', '', '', 0, '', '', 0, ''); + $morehtmlref = ''; + $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"'); + $morehtmlref .= ''; + + dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', $morehtmlref, '', 0, '', '', 0, ''); print '
'; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 2823925fc24..6a5eea96490 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; $langs->loadLangs(array('companies', 'products', 'admin', 'users', 'languages', 'projects', 'members')); // Defini si peux lire/modifier permisssions -$canreaduser = ($user->admin || $user->rights->user->user->lire); +$canreaduser = ($user->admin || $user->hasRight("user", "user", "read")); $id = GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09'); @@ -40,8 +40,8 @@ $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'use if ($id) { // $user est le user qui edite, $id est l'id de l'utilisateur edite - $caneditfield = ((($user->id == $id) && $user->rights->user->self->creer) - || (($user->id != $id) && $user->rights->user->user->creer)); + $caneditfield = ((($user->id == $id) && $user->hasRight("user", "self", "write")) + || (($user->id != $id) && $user->hasRight("user", "user", "write"))); } // Security check @@ -49,7 +49,7 @@ $socid = 0; if ($user->socid > 0) { $socid = $user->socid; } -$feature2 = (($socid && $user->rights->user->self->creer) ? '' : 'user'); +$feature2 = (($socid && $user->hasRight("user", "self", "write")) ? '' : 'user'); $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); if ($user->id <> $id && !$canreaduser) { @@ -231,11 +231,11 @@ if ($action == 'edit') { $linkback = ''; - if ($user->rights->user->user->lire || $user->admin) { + if ($user->hasRight("user", "user", "read") || $user->admin) { $linkback = ''.$langs->trans("BackToList").''; } - dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); + dol_banner_tab($object, 'id', $linkback, $user->hasRight("user", "user", "read") || $user->admin); print '
'; @@ -342,7 +342,11 @@ if ($action == 'edit') { $linkback = ''.$langs->trans("BackToList").''; - dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); + $morehtmlref = ''; + $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"'); + $morehtmlref .= ''; + + dol_banner_tab($object, 'id', $linkback, $user->hasRight("user", "user", "read") || $user->admin, 'rowid', 'ref', $morehtmlref); print '
'; diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index d98b980f8ed..bfc234abce1 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -50,13 +50,13 @@ if (!isset($id) || empty($id)) { } // Define if user can read permissions -$canreaduser = ($user->admin || $user->rights->user->user->lire); +$canreaduser = ($user->admin || $user->hasRight("user", "user", "read")); // Define if user can modify other users and permissions -$caneditperms = ($user->admin || $user->rights->user->user->creer); +$caneditperms = ($user->admin || $user->hasRight("user", "user", "write")); // Advanced permissions if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { - $canreaduser = ($user->admin || ($user->rights->user->user->lire && $user->rights->user->user_advance->readperms)); - $caneditselfperms = ($user->id == $id && $user->rights->user->self_advance->writeperms); + $canreaduser = ($user->admin || ($user->hasRight("user", "user", "read") && $user->hasRight("user", "user_advance", "readperms"))); + $caneditselfperms = ($user->id == $id && $user->hasRight("user", "self_advance", "writeperms")); $caneditperms = (($caneditperms || $caneditselfperms) ? 1 : 0); } @@ -65,9 +65,9 @@ $socid = 0; if (isset($user->socid) && $user->socid > 0) { $socid = $user->socid; } -$feature2 = (($socid && $user->rights->user->self->creer) ? '' : 'user'); +$feature2 = (($socid && $user->hasRight("user", "self", "write")) ? '' : 'user'); // A user can always read its own card if not advanced perms enabled, or if he has advanced perms, except for admin -if ($user->id == $id && (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->user->self_advance->readperms) && empty($user->admin))) { +if ($user->id == $id && (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->hasRight("user", "self_advance", "readperms")) && empty($user->admin))) { accessforbidden(); } @@ -249,11 +249,15 @@ if ($result) { $linkback = ''; -if ($user->rights->user->user->lire || $user->admin) { +if ($user->hasRight("user", "user", "read") || $user->admin) { $linkback = ''.$langs->trans("BackToList").''; } -dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); +$morehtmlref = ''; +$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"'); +$morehtmlref .= ''; + +dol_banner_tab($object, 'id', $linkback, $user->hasRight("user", "user", "read") || $user->admin, 'rowid', 'ref', $morehtmlref); print '
'; diff --git a/htdocs/user/vcard.php b/htdocs/user/vcard.php index 0f9085d0b52..6796d11f7aa 100644 --- a/htdocs/user/vcard.php +++ b/htdocs/user/vcard.php @@ -113,7 +113,7 @@ if ($company->id) { } // Si user lie a un tiers non de type "particulier" - if ($user2->typent_code != 'TE_PRIVATE') { + if ($company->typent_code != 'TE_PRIVATE') { $v->setOrg($company->name); } } diff --git a/htdocs/webservices/admin/index.php b/htdocs/webservices/admin/index.php index 14af2e88b3f..8ae62d1bf3c 100644 --- a/htdocs/webservices/admin/index.php +++ b/htdocs/webservices/admin/index.php @@ -140,21 +140,10 @@ print '
'; print '
'; print $langs->trans("OnlyActiveElementsAreShown", DOL_URL_ROOT.'/admin/modules.php'); -if (!empty($conf->use_javascript_ajax)) { - print "\n".''; -} +$constname = 'WEBSERVICES_KEY'; + +print dolJSToSetRandomPassword($constname); + // End of page llxFooter(); diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 3cb5386e831..aa405861e6a 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -30,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; //require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; + /** * Class Website */ @@ -50,6 +51,10 @@ class Website extends CommonObject */ public $ismultientitymanaged = 1; + + protected $childtablesoncascade = array(); + + /** * @var string String with name of icon for website. Must be the part after the 'object_' into object_myobject.png */ @@ -580,8 +585,8 @@ class Website extends CommonObject /** * Delete object in database * - * @param User $user User that deletes - * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param User $user User that deletes + * @param bool $notrigger false=launch triggers, true=disable triggers * * @return int <0 if KO, >0 if OK */ @@ -596,20 +601,8 @@ class Website extends CommonObject $this->db->begin(); if (!$error) { - if (!$notrigger) { - // Uncomment this and change WEBSITE to your own tag if you - // want this action calls a trigger. - - //// Call triggers - //$result=$this->call_trigger('WEBSITE_DELETE',$user); - //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} - //// End call triggers - } - } - - if (!$error) { - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element; - $sql .= ' WHERE rowid='.((int) $this->id); + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'website_page'; + $sql .= ' WHERE fk_website = '.((int) $this->id); $resql = $this->db->query($sql); if (!$resql) { @@ -619,6 +612,12 @@ class Website extends CommonObject } } + // Delete common code. This include execution of trigger. + $result = $this->deleteCommon($user, $notrigger); + if ($result <= 0) { + $error++; + } + if (!$error && !empty($this->ref)) { $pathofwebsite = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/website/'.$this->ref; @@ -1060,29 +1059,35 @@ class Website extends CommonObject $line .= "'".$this->db->escape($objectpageold->grabbed_from)."', "; $line .= "'".$this->db->escape($objectpageold->type_container)."', "; + // Make substitution with a generic path into htmlheader content $stringtoexport = $objectpageold->htmlheader; $stringtoexport = str_replace(array("\r\n", "\r", "\n"), "__N__", $stringtoexport); $stringtoexport = str_replace('file=image/'.$website->ref.'/', "file=image/__WEBSITE_KEY__/", $stringtoexport); $stringtoexport = str_replace('file=js/'.$website->ref.'/', "file=js/__WEBSITE_KEY__/", $stringtoexport); $stringtoexport = str_replace('medias/image/'.$website->ref.'/', "medias/image/__WEBSITE_KEY__/", $stringtoexport); $stringtoexport = str_replace('medias/js/'.$website->ref.'/', "medias/js/__WEBSITE_KEY__/", $stringtoexport); + $stringtoexport = str_replace('file=logos%2Fthumbs%2F'.$mysoc->logo_small, "file=logos%2Fthumbs%2F__LOGO_SMALL_KEY__", $stringtoexport); $stringtoexport = str_replace('file=logos%2Fthumbs%2F'.$mysoc->logo_mini, "file=logos%2Fthumbs%2F__LOGO_MINI_KEY__", $stringtoexport); $stringtoexport = str_replace('file=logos%2Fthumbs%2F'.$mysoc->logo, "file=logos%2Fthumbs%2F__LOGO_KEY__", $stringtoexport); $line .= "'".$this->db->escape(str_replace(array("\r\n", "\r", "\n"), "__N__", $stringtoexport))."', "; // Replace \r \n to have record on 1 line + // Make substitution with a generic path into page content $stringtoexport = $objectpageold->content; $stringtoexport = str_replace(array("\r\n", "\r", "\n"), "__N__", $stringtoexport); $stringtoexport = str_replace('file=image/'.$website->ref.'/', "file=image/__WEBSITE_KEY__/", $stringtoexport); $stringtoexport = str_replace('file=js/'.$website->ref.'/', "file=js/__WEBSITE_KEY__/", $stringtoexport); $stringtoexport = str_replace('medias/image/'.$website->ref.'/', "medias/image/__WEBSITE_KEY__/", $stringtoexport); $stringtoexport = str_replace('medias/js/'.$website->ref.'/', "medias/js/__WEBSITE_KEY__/", $stringtoexport); + $stringtoexport = str_replace('"image/'.$website->ref.'/', '"image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="image/websiteref/file.png" into html content + $stringtoexport = str_replace('"/image/'.$website->ref.'/', '"/image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="/image/websiteref/file.png" into html content + $stringtoexport = str_replace('"js/'.$website->ref.'/', '"js/__WEBSITE_KEY__/', $stringtoexport); + $stringtoexport = str_replace('"/js/'.$website->ref.'/', '"/js/__WEBSITE_KEY__/', $stringtoexport); + $stringtoexport = str_replace('file=logos%2Fthumbs%2F'.$mysoc->logo_small, "file=logos%2Fthumbs%2F__LOGO_SMALL_KEY__", $stringtoexport); $stringtoexport = str_replace('file=logos%2Fthumbs%2F'.$mysoc->logo_mini, "file=logos%2Fthumbs%2F__LOGO_MINI_KEY__", $stringtoexport); $stringtoexport = str_replace('file=logos%2Fthumbs%2F'.$mysoc->logo, "file=logos%2Fthumbs%2F__LOGO_KEY__", $stringtoexport); - // When we have a link src="image/websiteref/file.png" into html content - $stringtoexport = str_replace('="image/'.$website->ref.'/', '="image/__WEBSITE_KEY__/', $stringtoexport); $line .= "'".$this->db->escape($stringtoexport)."', "; // Replace \r \n to have record on 1 line $line .= "'".$this->db->escape($objectpageold->author_alias)."', "; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 2b3eedf995f..90277e59594 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2016-2022 Laurent Destailleur * Copyright (C) 2020 Nicolas ZABOURI * * This program is free software; you can redistribute it and/or modify @@ -587,7 +587,7 @@ if ($action == 'addsite' && $usercanedit) { if (!$error && !GETPOST('WEBSITE_REF', 'alpha')) { $error++; $langs->load("errors"); - setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors'); + setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("WebsiteName")), null, 'errors'); } if (!$error && !preg_match('/^[a-z0-9_\-\.]+$/i', GETPOST('WEBSITE_REF', 'alpha'))) { $error++; @@ -1230,7 +1230,7 @@ if ($action == 'confirm_deletesite' && $confirm == 'yes' && $permissiontodelete) exit; } else { $db->rollback(); - dol_print_error($db); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -2741,7 +2741,8 @@ if (!GETPOST('hide_websitemenu')) { print ''; - print ''; + //print ''; + print ''; // Regenerate all pages print 'ref).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("RegenerateWebsiteContent")).'">'; @@ -2933,12 +2934,12 @@ if (!GETPOST('hide_websitemenu')) { if ($pagepreviousid) { print ''.img_previous($langs->trans("PreviousContainer")).''; } else { - print ''.img_previous($langs->trans("Previous")).''; + print ''.img_previous($langs->trans("PreviousContainer")).''; } if ($pagenextid) { print ''.img_next($langs->trans("NextContainer")).''; } else { - print ''.img_next($langs->trans("Next")).''; + print ''.img_next($langs->trans("NextContainer")).''; } print ''; @@ -2964,7 +2965,12 @@ if (!GETPOST('hide_websitemenu')) { //array('type' => 'other','name' => 'newwebsite','label' => $langs->trans("WebSite"), 'value' => $formwebsite->selectWebsite($object->id, 'newwebsite', 0)) ); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteWebsite'), '', 'confirm_deletesite', $formquestion, 0, 1, 200); + if ($atleastonepage) { + $langs->load("errors"); + $formquestion[] = array('type' => 'onecolumn', 'value' => '
'.$langs->trans("WarningPagesWillBeDeleted").'
'); + } + + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteWebsite'), '', 'confirm_deletesite', $formquestion, 0, 1, 210 + ($atleastonepage ? 70 : 0), 580); print $formconfirm; } @@ -3379,6 +3385,7 @@ if ($action == 'editcss') { $htmltext = ''; print $form->textwithpicto($langs->trans('MainLanguage'), $htmltext, 1, 'help', '', 0, 2, 'WEBSITE_LANG'); print '
'; print ''; @@ -3388,6 +3395,7 @@ if ($action == 'editcss') { $htmltext = $langs->trans("Example").': fr,de,sv,it,pt'; print $form->textwithpicto($langs->trans('OtherLanguages'), $htmltext, 1, 'help', '', 0, 2); print ''; print ''; @@ -3395,13 +3403,7 @@ if ($action == 'editcss') { // VirtualHost print '
'.$langs->trans("Login").'
'.$langs->trans("Note").''; + print img_picto('', 'language', 'class="picotfixedwidth"'); print $formadmin->select_language((GETPOSTISSET('WEBSITE_LANG') ? GETPOST('WEBSITE_LANG', 'aZ09comma') : ($object->lang ? $object->lang : '0')), 'WEBSITE_LANG', 0, null, 1, 0, 0, 'minwidth300', 2, 0, 0, array(), 1); print '
'; + print img_picto('', 'language', 'class="picotfixedwidth"'); print ''; print '
'; - $htmltext = $langs->trans("SetHereVirtualHost", DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/website/{s1}'.$websitekey.'{s2}'); - $htmltext = str_replace(array('{s1}', '{s2}'), array('', ''), $htmltext); - $htmltext .= '
'; - $htmltext .= '
'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT); - $htmltext .= '
'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), '{s1}'); - $htmltext = str_replace('{s1}', DOL_DATA_ROOT.'/website
'.DOL_DATA_ROOT.'/medias', $htmltext); - + $htmltext = $langs->trans("VirtualhostDesc"); print $form->textwithpicto($langs->trans('Virtualhost'), $htmltext, 1, 'help', '', 0, 2, 'virtualhosttooltip'); print '
'; print ''; @@ -3547,7 +3549,7 @@ if ($action == 'createsite') { } print ''."\n"; - //print '
'; + print '
'; print ''; @@ -3566,7 +3568,7 @@ if ($action == 'createsite') { } print ''; @@ -3575,9 +3577,18 @@ if ($action == 'createsite') { print $langs->trans('MainLanguage'); print ''; + print ''; + print ''; print ''; - print ''; - print '
'; - print $form->textwithpicto($langs->trans('WebSite'), $langs->trans("Example").': www.mywebsite.com, myportal, ...'); + print $form->textwithpicto($langs->trans('WebsiteName'), $langs->trans("Example").': MyPortal, www.mywebsite.com, ...'); print ''; print ''; print '
'; $shortlangcode = preg_replace('/[_-].*$/', '', trim($langs->defaultlang)); + print img_picto('', 'language', 'class="pictofixedwidth"'); print $formadmin->select_language((GETPOSTISSET('WEBSITE_LANG') ? GETPOST('WEBSITE_LANG', 'aZ09comma') : $shortlangcode), 'WEBSITE_LANG', 0, null, 1, 0, 0, 'minwidth300', 2, 0, 0, array(), 1); print '
'; + $htmltext = $langs->trans("Example").': fr,de,sv,it,pt'; + print $form->textwithpicto($langs->trans('OtherLanguages'), $htmltext, 1, 'help', '', 0, 2); + print ''; + print img_picto('', 'language', 'class="pictofixedwidth"'); + print ''; + print '
'; print $langs->trans('Description'); print ''; @@ -3585,28 +3596,22 @@ if ($action == 'createsite') { print '
'; - $htmltext = $langs->trans("Example").': fr,de,sv,it,pt'; - print $form->textwithpicto($langs->trans('OtherLanguages'), $htmltext, 1, 'help', '', 0, 2); - print ''; - print ''; - print '
'; - - $htmltext = $langs->trans("SetHereVirtualHost", '{s1}'); - $htmltext = str_replace('{s1}', DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/website/websiteref', $htmltext); + $htmltext = $langs->trans("VirtualhostDesc"); + /*$htmltext = str_replace('{s1}', DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/website/websiteref', $htmltext); $htmltext .= '
'; $htmltext .= '
'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT); $htmltext .= '
'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), '{s1}'); - $htmltext = str_replace('{s1}', DOL_DATA_ROOT.'/website
'.DOL_DATA_ROOT.'/medias', $htmltext); + $htmltext = str_replace('{s1}', DOL_DATA_ROOT.'/website
'.DOL_DATA_ROOT.'/medias', $htmltext);*/ - print $form->textwithpicto($langs->trans('Virtualhost'), $htmltext, 1, 'help', '', 0, 2, 'virtualhosttooltip'); + + print $form->textwithpicto($langs->trans('Virtualhost'), $htmltext, 1, 'help', '', 0, 2, ''); print '
'; print ''; print '
'; + print '
'; if ($action == 'createsite') { print '
'; diff --git a/htdocs/workstation/workstation_document.php b/htdocs/workstation/workstation_document.php index 50331b4b231..92cf4dfde15 100644 --- a/htdocs/workstation/workstation_document.php +++ b/htdocs/workstation/workstation_document.php @@ -48,7 +48,7 @@ $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("pa if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$offset = $liste_limit * $page; +$offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (!$sortorder) { diff --git a/test/phpunit/LangTest.php b/test/phpunit/LangTest.php index c9c332b311e..e0eaded97de 100644 --- a/test/phpunit/LangTest.php +++ b/test/phpunit/LangTest.php @@ -226,6 +226,14 @@ class LangTest extends PHPUnit\Framework\TestCase $result=strpos($filecontent, '%'); // A special % char we don't want. We want the common one. //print __METHOD__." Result for checking we don't have bad percent char = ".$result."\n"; $this->assertTrue($result === false, 'Found a bad percent char % instead of % into file '.$code.'/'.$file); + + $result=preg_match('/%n/m', $filecontent); // A sequence of char we don't want + //print __METHOD__." Result for checking we don't have bad percent char = ".$result."\n"; + $this->assertTrue($result == 0, 'Found a sequence %n into the translation file '.$code.'/'.$file.'. We probably want %s'); + + $result=preg_match('/<<<<assertTrue($result == 0, 'Found a sequence <<<<< into the translation file '.$code.'/'.$file.'. Probably a bad merge of code were done.'); } }