Merge branch 'develop' of github.com:Dolibarr/dolibarr into develop_NEW_Service_DefaultWorkstation

This commit is contained in:
atm-lena 2022-07-29 12:06:43 +02:00
commit 462352b957
1025 changed files with 27512 additions and 5299 deletions

125
ChangeLog
View File

@ -4,9 +4,20 @@ English Dolibarr ChangeLog
***** ChangeLog for 17.0.0 compared to 16.0.0 ***** ***** ChangeLog for 17.0.0 compared to 16.0.0 *****
For users:
---------------
...
For developers or integrators: For developers or integrators:
------------------------------ ------------------------------
...
WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* The signature of method getNomUrl() of class ProductFournisseur has been modified to match the signature of method Product * The signature of method getNomUrl() of class ProductFournisseur has been modified to match the signature of method Product
@ -19,25 +30,23 @@ For users:
NEW: PHP 8.1 compatibility NEW: PHP 8.1 compatibility
NEW: Support for recurring purchase invoices. NEW: Support for recurring purchase invoices.
NEW: #20292 Include German public holidays NEW: #20292 Include German public holidays
NEW: Can show ZATCA QRCode on PDFs NEW: Can show ZATCA QR-Code on PDFs
NEW: Can show Swiss QR Code on PDFs NEW: Can show Swiss QR-Code on PDFs
NEW: #17123 added ExtraFields for Stock Mouvement 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: #20653 edit discount pourcentage for all lines in one shot
NEW: Accept 'auto' for ref of object on import of purchase order/proposal 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 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: 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: ACE Editor is restored at same cursor position after a save.
NEW: Add "addMoreActionsButtons" hook to subscription form NEW: Add "addMoreActionsButtons" hook to subscription form
NEW: Add an option in GUI to show a Quick add button into top menu bar 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 a workflow to auto link contract on a ticket
NEW: Add column date of Signature on proposal list NEW: Add column date of Signature on proposal list
NEW: Add column template invoice in invoice list NEW: Add column template invoice in invoice list
NEW: Add column "Total HT" to products array on document creation card 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 hide categories in TakePos
NEW: Add constant to show category description in TakePos NEW: Add constant to show category description in TakePos
NEW: Add constant to show only the products in stock in TakePos NEW: Add constant to show only the products in stock in TakePos
@ -45,7 +54,7 @@ NEW: Add entity filter in exports
NEW: Show the event block on recurring invoices #20870 NEW: Show the event block on recurring invoices #20870
NEW: Add filter "opportunity status" on statistics of projects. NEW: Add filter "opportunity status" on statistics of projects.
NEW: Add firstname, lastname and max number of attendees for module "Event Organization" 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 massaction "Edit Extrafield" for Product
NEW: Add more fields to detect duplicate during import of thirdparties 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 NEW: Add option to foce delivery on email for purchase order receipt to yes
@ -56,14 +65,12 @@ NEW: Add possibility with constant MAIN_LOGIN_BADCHARUNAUTHORIZED to define bad
NEW: Add private and public notes on tax files. NEW: Add private and public notes on tax files.
NEW: Add status "Obsolete" to KM articles NEW: Add status "Obsolete" to KM articles
NEW: Add substitutions "user numbers" 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 a ticket to be automatically marked as read when created from backend.
NEW: allow cut&paste as real numeric value to excel 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: A public form to send a message and create a lead is available
NEW: automatically set totally received status in reception NEW: automatically set totally received status in reception
NEW: Auto set invoice paid when adding credit not and remain to pay is 0 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: 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 change value of AWP during the inventory
NEW: Can enter price with tax for predefined products on purchase objects NEW: Can enter price with tax for predefined products on purchase objects
NEW: Can filter on a thirdparty on product statistics NEW: Can filter on a thirdparty on product statistics
@ -79,7 +86,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: 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: 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: 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 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: Display product ref in "Object link" product tab for BOM
NEW: Enhance the import. Can use 'auto' for the ref (import of orders) NEW: Enhance the import. Can use 'auto' for the ref (import of orders)
@ -91,10 +98,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_MAIL_AUTOCOPY_TO can accept several email and special keys
NEW: MAIN_SEARCH_CAT_OR_BY_DEFAULT const for search by category NEW: MAIN_SEARCH_CAT_OR_BY_DEFAULT const for search by category
NEW: Mass action "Close shipments" 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: Module website now supports the multicompany module
NEW: More mode for THEME_TOPMENU_DISABLE_IMAGE (2, 3, ...) 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 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: on redirect of page in website module, GET parameters are kept.
NEW: optional display warning icons on ticket list NEW: optional display warning icons on ticket list
NEW: option to default check "notify tier at creation" in ticket module NEW: option to default check "notify tier at creation" in ticket module
@ -106,15 +116,15 @@ NEW: Send email to the supplier order contact
NEW: New permission to report time on timesheet. NEW: New permission to report time on timesheet.
NEW: SEPA XML - option to place payment Type Info at Credit transfer Transaction level 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 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: Some core tables are created only at module activation
NEW: split consumption line on MO NEW: split consumption line on MO
NEW: stock filter in reassort lists NEW: stock filter in reassort lists
NEW: stock limit in stock export CSV 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: Supplier order - Show ref supplier of reception in linked object block
NEW: support user_modif in order 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 backup tools has an "lowmemory" option for mysqldump on large database
NEW: The 'reposition' class works on ajax constantonoff that make redirects NEW: The 'reposition' class works on ajax constantonoff that make redirects
NEW: Thirdparty - Add rules "customer accountancy code" is mandatory to validate invoice NEW: Thirdparty - Add rules "customer accountancy code" is mandatory to validate invoice
@ -129,7 +139,7 @@ NEW: Added MMK currency (Myanmar Kyat)
Modules Modules
NEW: Module Partnership Management NEW: Module Partnership Management
NEW: Experimental module Event Organization Management NEW: Experimental Module Event Organization Management
For developers or integrators: For developers or integrators:
@ -144,7 +154,6 @@ NEW: Suggest a way to run upgrade per entities.
NEW: Support html content for multiselect component. NEW: Support html content for multiselect component.
NEW: ModuleBuilder - Add tabs view in module builder NEW: ModuleBuilder - Add tabs view in module builder
NEW: ModuleBuilder - More feature that can be modifed after module generation 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: Identification of tr is possible with by attribute data-id on some pages
NEW: Import with select boxes V2 NEW: Import with select boxes V2
NEW: Can update rank of invoice, proposal and order lines with API update NEW: Can update rank of invoice, proposal and order lines with API update
@ -171,6 +180,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 datem and type parameters to API to create movements
NEW: Add hidden option on contract PDF line to hide qty and price 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 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: Add hooks: selectContactListWhere hook, selectThirdpartyListWhere hook
NEW: TakePos - add hooks complete product display NEW: TakePos - add hooks complete product display
NEW: TakePos - add hooks for cart display NEW: TakePos - add hooks for cart display
@ -192,6 +204,8 @@ NEW: Add hooks select product list and select thirdparty list function
NEW: Add hook to getSellPrice function NEW: Add hook to getSellPrice function
WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* There is a new specific permission to be allowed to enter timesheets. If you use timesheet, don't forget to give the new permission (disable and * There is a new specific permission to be allowed to enter timesheets. If you use timesheet, don't forget to give the new permission (disable and
enable the module project if it is not visible). enable the module project if it is not visible).
@ -209,6 +223,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' * 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 ***** ***** ChangeLog for 15.0.2 compared to 15.0.1 *****
FIX: #19777 #20281 FIX: #19777 #20281
@ -489,6 +578,8 @@ NEW: we need to be able to put more filters on deleteByParentField() function
NEW: make it easier to set the `keyword`, `keywords` and `description` attributes of an ecm file object NEW: make it easier to set the `keyword`, `keywords` and `description` attributes of an ecm file object
NEW: Experimental feature to manage user sessions in database NEW: Experimental feature to manage user sessions in database
WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* ALL EXTERNAL MODULES THAT WERE NOT CORRECTLY DEVELOPPED WILL NOT WORK ON V15 (All modules that forgot to manage the security token field * ALL EXTERNAL MODULES THAT WERE NOT CORRECTLY DEVELOPPED WILL NOT WORK ON V15 (All modules that forgot to manage the security token field

View File

@ -13,32 +13,12 @@ It is here only to build Dolibarr packages, and those generated packages will no
There are several tools: There are several tools:
--------------------------------------------------------------------------------------------------
- To build full Dolibarr packages, launch the script - To build full Dolibarr packages, launch the script
> Launch command perl makepack-dolibarr.pl > Launch command perl makepack-dolibarr.pl
-------------------------------------------------------------------------------------------------- See makepack-howto.txt for prerequisites.
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.
-------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------

View File

@ -1 +1 @@
/doliwamp.tmp.iss /doliwamp.tmp.iss*

View File

@ -24,7 +24,6 @@ OutputBaseFilename=__FILENAMEEXEDOLIWAMP__
;OutputManifestFile=build\doliwampbuild.log ;OutputManifestFile=build\doliwampbuild.log
; Define full path from which all relative path are defined ; Define full path from which all relative path are defined
; You must modify this to put here your dolibarr root directory ; You must modify this to put here your dolibarr root directory
;SourceDir=Z:\home\ldestailleur\git\dolibarrxxx
SourceDir=..\..\.. SourceDir=..\..\..
AppId=doliwamp AppId=doliwamp
AppPublisher=DoliCloud AppPublisher=DoliCloud
@ -32,7 +31,7 @@ AppPublisherURL=https://www.dolicloud.com
AppSupportURL=https://www.dolibarr.org AppSupportURL=https://www.dolibarr.org
AppUpdatesURL=https://www.dolibarr.org AppUpdatesURL=https://www.dolibarr.org
AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql software. 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 DefaultDirName=c:\dolibarr
DefaultGroupName=Dolibarr DefaultGroupName=Dolibarr
;LicenseFile=COPYING ;LicenseFile=COPYING
@ -81,7 +80,7 @@ Name: "desktopicon"; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:
Name: "{app}\logs" Name: "{app}\logs"
Name: "{app}\tmp" Name: "{app}\tmp"
Name: "{app}\dolibarr_documents" Name: "{app}\dolibarr_documents"
Name: "{app}\bin\apache\apache2.4.41\logs" Name: "{app}\bin\apache\apache2.4.51\logs"
[Files] [Files]
; Stop/start ; Stop/start
@ -101,16 +100,10 @@ Source: "build\exe\doliwamp\UsedPort.exe"; DestDir: "{app}\"; Flags: ignoreversi
; Apache, Php, Mysql ; Apache, Php, Mysql
; Put here path of Wampserver applications ; 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.4.51, php 7.3.33, mariadb10.6.5 (wampserver3.2.6_x64.exe)
; Value OK: apache 2.2.11, php 5.3.0 (if no php_exif, php_pgsql, php_zip), mysql 5.0.45 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"
; 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) 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"
; Value OK: apache 2.4.41, php 7.3.12, mariadb10.4.10 (wampserver3.2.0_x64.exe) 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"
;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"
; Mysql data files (does not overwrite if exists) ; 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 ; 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 ; Config files
Source: "build\exe\doliwamp\dolibarr.conf.install"; DestDir: "{app}\alias"; Flags: ignoreversion; 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.51\conf"; Flags: ignoreversion;
Source: "build\exe\doliwamp\httpd.conf.install"; DestDir: "{app}\bin\apache\apache2.4.41\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\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\my.ini.install"; DestDir: "{app}\bin\mariadb\mariadb10.6.5"; 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.33"; Flags: ignoreversion;
Source: "build\exe\doliwamp\php.ini.install"; DestDir: "{app}\bin\php\php7.3.12"; Flags: ignoreversion;
Source: "build\exe\doliwamp\index.php.install"; DestDir: "{app}\www"; 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\install.forced.php.install"; DestDir: "{app}\www\dolibarr\htdocs\install"; Flags: ignoreversion;
Source: "build\exe\doliwamp\openssl.conf"; DestDir: "{app}"; Flags: ignoreversion; Source: "build\exe\doliwamp\openssl.conf"; DestDir: "{app}"; Flags: ignoreversion;
@ -236,12 +227,9 @@ procedure InitializeWizard();
begin begin
//version des applis, a modifier pour chaque version de WampServer 2 //version des applis, a modifier pour chaque version de WampServer 2
//apacheVersion := '2.4.9'; apacheVersion := '2.4.51';
//phpVersion := '5.5.12' ; phpVersion := '7.3.33' ;
apacheVersion := '2.4.41'; mysqlVersion := '10.6.5';
phpVersion := '7.3.12' ;
//mysqlVersion := '5.0.45';
mysqlVersion := '10.4.10';
smtpServer := 'localhost'; smtpServer := 'localhost';
apachePort := '80'; apachePort := '80';
@ -375,9 +363,9 @@ begin
// Migration of database // Migration of database
// datadir := pathWithSlashes+'/bin/mariadb/marradb10.4.10/data'; // datadir := pathWithSlashes+'/bin/mariadb/mariadb10.6.5/data';
// exedirold := pathWithSlashes+'/bin/mariadb/marradb10.4.10/'; // exedirold := pathWithSlashes+'/bin/mariadb/mariadb10.6.5/';
// exedirnew := pathWithSlashes+'/bin/mariadb/marradb10.4.10/'; // 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 // 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. // 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] [UninstallDelete]
Type: files; Name: "{app}\*.*" 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}\alias"
Type: filesandordirs; Name: "{app}\apps" Type: filesandordirs; Name: "{app}\apps"
Type: filesandordirs; Name: "{app}\bin\apache" Type: filesandordirs; Name: "{app}\bin\apache"

View File

@ -65,7 +65,7 @@ $DIR||='.'; $DIR =~ s/([^\/\\])[\\\/]+$/$1/;
$SOURCE="$DIR/.."; $SOURCE="$DIR/..";
$DESTI="$SOURCE/build"; $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 "Error: Launch the script $PROG.$Extension with its full path from /.\n";
print "$PROG.$Extension aborted.\n"; print "$PROG.$Extension aborted.\n";
@ -76,15 +76,23 @@ if (! $ENV{"DESTIBETARC"} || ! $ENV{"DESTISTABLE"})
{ {
print "Error: Missing environment variables.\n"; 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 "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: 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 "Example: DESTISTABLE='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/stable'\n";
print "$PROG.$Extension aborted.\n";
sleep 2; sleep 2;
exit 1; exit 1;
} }
if (! -d $ENV{"DESTIBETARC"} || ! -d $ENV{"DESTISTABLE"}) 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"; print "$PROG.$Extension aborted.\n";
sleep 2; sleep 2;
exit 1; 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=''; } if ("$^O" =~ /linux/i || (-d "/etc" && -d "/var" && "$^O" !~ /cygwin/i)) { $OS='linux'; $CR=''; }
elsif (-d "/etc" && -d "/Users") { $OS='macosx'; $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) { if (! $OS) {
print "Error: Can't detect your OS.\n"; print "Error: Can't detect your OS.\n";
print "Can't continue.\n"; print "Can't continue.\n";
@ -390,7 +398,7 @@ if ($nboftargetok) {
$olddir=getcwd(); $olddir=getcwd();
chdir("$SOURCE"); chdir("$SOURCE");
print "Clean $SOURCE/htdocs\n"; print "Clean $SOURCE/htdocs/includes/autoload.php\n";
$ret=`rm -f $SOURCE/htdocs/includes/autoload.php`; $ret=`rm -f $SOURCE/htdocs/includes/autoload.php`;
$ret=`git ls-files . --exclude-standard --others`; $ret=`git ls-files . --exclude-standard --others`;
@ -1074,28 +1082,52 @@ if ($nboftargetok) {
print "Remove target $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe...\n"; print "Remove target $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe...\n";
unlink "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"; 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=$SOURCE;
$SOURCEBACK =~ s/\//\\/g; $SOURCEBACK =~ s/\//\\/g;
print "Prepare file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss from \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.iss\"\n"; 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"`;
#$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(<IN>)
{
$_ =~ 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"; print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\" on OS $OS\n";
$cmd= "wine ISCC.exe \"Z:$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\"";
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"; print "$cmd\n";
$ret= `$cmd`; $ret= `$cmd`;
#print "$ret\n"; print "ret=$ret\n";
# Move to final dir # Move to final dir
print "Move \"$SOURCE\\build\\$FILENAMEEXEDOLIWAMP.exe\" to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n"; print "Move \"$SOURCE\\build\\$FILENAMEEXEDOLIWAMP.exe\" to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n";
rename("$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe","$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"); rename("$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe","$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe");
print "Move $SOURCE/build/$FILENAMEEXEDOLIWAMP.exe to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n"; 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"; 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; next;
} }
@ -1242,7 +1274,7 @@ if ($nboftargetok) {
print "\n----- Summary -----\n"; print "\n----- Summary -----\n";
foreach my $target (sort keys %CHOOSEDTARGET) { 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) { if ($CHOOSEDTARGET{$target} < 0) {
print "Package $target not built (bad requirement).\n"; print "Package $target not built (bad requirement).\n";
} else { } else {

View File

@ -1,7 +1,34 @@
----- Dolibarr Makepack How To ----- ----- Dolibarr Makepack How To -----
This documentation describe steps to build a BETA or RELEASE versions This documentation describe steps to build a BETA or RELEASE versions
of Dolibarr. There is a chapter for BETA version and a chapter for of Dolibarr. There is a chapter for BETA version and a chapter for RELEASE version.
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 ***** ***** Actions to do a BETA *****
This files describe steps made by Dolibarr packaging team to make a This files describe steps made by Dolibarr packaging team to make a

View File

@ -227,6 +227,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/ticket %_datadir/dolibarr/htdocs/ticket
%_datadir/dolibarr/htdocs/user %_datadir/dolibarr/htdocs/user
%_datadir/dolibarr/htdocs/variants %_datadir/dolibarr/htdocs/variants
%_datadir/dolibarr/htdocs/webhook
%_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/webservices
%_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/website
%_datadir/dolibarr/htdocs/workstation %_datadir/dolibarr/htdocs/workstation

View File

@ -54,7 +54,7 @@ BuildRequires: desktop-file-utils
Group: Applications/Productivity 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: 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 Requires: mysql, mysql-client
%else%_datadir/dolibarr/htdocs/datapolicy %else
%if 0%{?suse_version} %if 0%{?suse_version}
# Voir http://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros # Voir http://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros
Group: Productivity/Office/Management 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: mysql-server, mysql
Requires: php-mysqli >= 4.1.0 Requires: php-mysqli >= 4.1.0
%endif %endif
%endif%_datadir/dolibarr/htdocs/eventorganization %endif
%endif %endif
@ -125,7 +125,7 @@ cui hai bisogno ed essere facile da usare.
%if 0%{?sles_version} %if 0%{?sles_version}
%{__rm} -rf $RPM_BUILD_ROOT %{__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}
%{__mkdir} $RPM_BUILD_ROOT%{_sysconfdir}/%{name} %{__mkdir} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
%else %else
@ -308,6 +308,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/ticket %_datadir/dolibarr/htdocs/ticket
%_datadir/dolibarr/htdocs/user %_datadir/dolibarr/htdocs/user
%_datadir/dolibarr/htdocs/variants %_datadir/dolibarr/htdocs/variants
%_datadir/dolibarr/htdocs/webhook
%_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/webservices
%_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/website
%_datadir/dolibarr/htdocs/workstation %_datadir/dolibarr/htdocs/workstation

View File

@ -224,6 +224,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/ticket %_datadir/dolibarr/htdocs/ticket
%_datadir/dolibarr/htdocs/user %_datadir/dolibarr/htdocs/user
%_datadir/dolibarr/htdocs/variants %_datadir/dolibarr/htdocs/variants
%_datadir/dolibarr/htdocs/webhook
%_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/webservices
%_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/website
%_datadir/dolibarr/htdocs/workstation %_datadir/dolibarr/htdocs/workstation

View File

@ -66,7 +66,7 @@ ed essere facile da usare.
Programmo web, progettato per poter fornire solo ciò di Programmo web, progettato per poter fornire solo ciò di
cui hai bisogno ed essere facile da usare. cui hai bisogno ed essere facile da usare.
%_datadir/dolibarr/htdocs/webhook
#---- prep #---- prep
%prep %prep
@ -235,6 +235,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/ticket %_datadir/dolibarr/htdocs/ticket
%_datadir/dolibarr/htdocs/user %_datadir/dolibarr/htdocs/user
%_datadir/dolibarr/htdocs/variants %_datadir/dolibarr/htdocs/variants
%_datadir/dolibarr/htdocs/webhook
%_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/webservices
%_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/website
%_datadir/dolibarr/htdocs/workstation %_datadir/dolibarr/htdocs/workstation

View File

@ -674,7 +674,7 @@ if ($id) {
// Can an entry be erased or disabled ? // Can an entry be erased or disabled ?
$iserasable = 1; $canbedisabled = 1; $canbemodified = 1; // true by default $iserasable = 1; $canbedisabled = 1; $canbemodified = 1; // true by default
$url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : ''); $url = $_SERVER["PHP_SELF"].'?token='.newToken().($page ? '&page='.$page : '').'&sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : '');
if ($param) { if ($param) {
$url .= '&'.$param; $url .= '&'.$param;
} }

View File

@ -197,7 +197,7 @@ $arrayfields = array(
't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0), 't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0),
't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0), 't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0),
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1), 't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
't.date_validated'=>array('label'=>$langs->trans("DateValidationAndLock"), 'checked'=>1), 't.date_validated'=>array('label'=>$langs->trans("DateValidationAndLock"), 'checked'=>1, 'enabled'=>!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")),
't.import_key'=>array('label'=>$langs->trans("ImportId"), 'checked'=>0, 'position'=>1100), 't.import_key'=>array('label'=>$langs->trans("ImportId"), 'checked'=>0, 'position'=>1100),
); );
@ -769,16 +769,18 @@ if ($action == 'export_file') {
$form_question['separator'] = array('name'=>'separator', 'type'=>'separator'); $form_question['separator'] = array('name'=>'separator', 'type'=>'separator');
// If 0 or not set, we NOT check by default. if (!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")) {
$checked = (isset($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) || !empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE)); // If 0 or not set, we NOT check by default.
$form_question['notifiedvalidationdate'] = array( $checked = (isset($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) || !empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE));
'name' => 'notifiedvalidationdate', $form_question['notifiedvalidationdate'] = array(
'type' => 'checkbox', 'name' => 'notifiedvalidationdate',
'label' => $langs->trans('NotifiedValidationDate', $langs->transnoentitiesnoconv("MenuAccountancyClosure")), 'type' => 'checkbox',
'value' => $checked, 'label' => $langs->trans('NotifiedValidationDate', $langs->transnoentitiesnoconv("MenuAccountancyClosure")),
); 'value' => $checked,
);
$form_question['separator2'] = array('name'=>'separator2', 'type'=>'separator'); $form_question['separator2'] = array('name'=>'separator2', 'type'=>'separator');
}
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300, 600); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300, 600);
} }

View File

@ -166,7 +166,7 @@ $arrayfields = array(
't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1), 't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1),
't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1), 't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1),
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1), 't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1), 't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1, 'enabled'=>!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")),
't.import_key'=>array('label'=>$langs->trans("ImportId"), 'checked'=>0, 'position'=>1100), 't.import_key'=>array('label'=>$langs->trans("ImportId"), 'checked'=>0, 'position'=>1100),
); );

View File

@ -112,6 +112,7 @@ if ($action == 'validate_movements_confirm' && !empty($user->rights->accounting-
} }
} }
/* /*
* View * View
*/ */
@ -178,20 +179,40 @@ for ($i = 1; $i <= 12; $i++) {
} }
print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>'; print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>';
$sql = "SELECT COUNT(b.rowid) as detail,"; if (getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")) {
for ($i = 1; $i <= 12; $i++) { // TODO Analyse is done by finding record not into a closed period
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1; $sql = "SELECT COUNT(b.rowid) as detail,";
if ($j > 12) { for ($i = 1; $i <= 12; $i++) {
$j -= 12; $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
$j -= 12;
}
$sql .= " SUM(".$db->ifsql("MONTH(b.doc_date)=".$j, "1", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).",";
} }
$sql .= " SUM(".$db->ifsql("MONTH(b.doc_date)=".$j, "1", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).","; $sql .= " COUNT(b.rowid) as total";
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b";
$sql .= " WHERE b.doc_date >= '".$db->idate($search_date_start)."'";
$sql .= " AND b.doc_date <= '".$db->idate($search_date_end)."'";
$sql .= " AND b.entity IN (".getEntity('bookkeeping', 0).")"; // We don't share object for accountancy
// Loop on each closed period
$sql .= " AND b.doc_date BETWEEN 0 AND 0";
} else {
// Analyse closed record using the unitary flag/date on each record
$sql = "SELECT COUNT(b.rowid) as detail,";
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
$j -= 12;
}
$sql .= " SUM(".$db->ifsql("MONTH(b.doc_date)=".$j, "1", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).",";
}
$sql .= " COUNT(b.rowid) as total";
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b";
$sql .= " WHERE b.doc_date >= '".$db->idate($search_date_start)."'";
$sql .= " AND b.doc_date <= '".$db->idate($search_date_end)."'";
$sql .= " AND b.entity IN (".getEntity('bookkeeping', 0).")"; // We don't share object for accountancy
$sql .= " AND date_validated IS NULL";
} }
$sql .= " COUNT(b.rowid) as total";
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b";
$sql .= " WHERE b.doc_date >= '".$db->idate($search_date_start)."'";
$sql .= " AND b.doc_date <= '".$db->idate($search_date_end)."'";
$sql .= " AND b.entity IN (".getEntity('bookkeeping', 0).")"; // We don't share object for accountancy
$sql .= " AND date_validated IS NULL";
dol_syslog('htdocs/accountancy/closure/index.php', LOG_DEBUG); dol_syslog('htdocs/accountancy/closure/index.php', LOG_DEBUG);
$resql = $db->query($sql); $resql = $db->query($sql);

View File

@ -328,7 +328,7 @@ if ($action == 'writebookkeeping') {
foreach ($arrayofvat[$key] as $k => $mt) { foreach ($arrayofvat[$key] as $k => $mt) {
if ($mt) { if ($mt) {
$accountingaccount->fetch($k, null, true); // TODO Use a cache for label $accountingaccount->fetch(null, $k, true); // TODO Use a cache for label
$account_label = $accountingaccount->label; $account_label = $accountingaccount->label;
// get compte id and label // get compte id and label

View File

@ -457,7 +457,7 @@ if ($action == 'writebookkeeping') {
foreach ($arrayofvat[$key] as $k => $mt) { foreach ($arrayofvat[$key] as $k => $mt) {
if ($mt) { if ($mt) {
$accountingaccount->fetch($k, null, true); // TODO Use a cache for label $accountingaccount->fetch(null, $k, true); // TODO Use a cache for label
$label_account = $accountingaccount->label; $label_account = $accountingaccount->label;
$bookkeeping = new BookKeeping($db); $bookkeeping = new BookKeeping($db);

View File

@ -479,7 +479,7 @@ if ($action == 'writebookkeeping') {
foreach ($arrayofvat[$key] as $k => $mt) { foreach ($arrayofvat[$key] as $k => $mt) {
if ($mt) { if ($mt) {
$accountingaccount->fetch($k, null, true); // TODO Use a cache for label $accountingaccount->fetch(null, $k, true); // TODO Use a cache for label
$label_account = $accountingaccount->label; $label_account = $accountingaccount->label;
$bookkeeping = new BookKeeping($db); $bookkeeping = new BookKeeping($db);

View File

@ -236,7 +236,7 @@ if ($some_mandatory_steps_of_setup_were_not_done) {
print ' : ' . $langs->trans("AccountancyAreaDescMisc", 4, '<strong>' . $langs->transnoentitiesnoconv("MenuAccountancy") . '-' . $langs->transnoentitiesnoconv("Setup") . "-" . $langs->transnoentitiesnoconv("MenuDefaultAccounts") . '</strong>'); print ' : ' . $langs->trans("AccountancyAreaDescMisc", 4, '<strong>' . $langs->transnoentitiesnoconv("MenuAccountancy") . '-' . $langs->transnoentitiesnoconv("Setup") . "-" . $langs->transnoentitiesnoconv("MenuDefaultAccounts") . '</strong>');
print '</div>'; print '</div>';
} }
print '<div class="tabsAction tabsActionNoBottom">'; print '<div class="tabsAction tabsActionNoBottom centerimp">';
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') { if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') {
print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />'; print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
} }

View File

@ -178,14 +178,14 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>'; print '<td>'.$langs->trans("Parameter").'</td>';
print '<td class="right">'.$langs->trans("Value").'</td>'; print '<td>'.$langs->trans("Value").'</td>';
print "</tr>\n"; print "</tr>\n";
// Force Type // Force Type
$adht = new AdherentType($db); $adht = new AdherentType($db);
print '<tr class="oddeven drag" id="trforcetype"><td>'; print '<tr class="oddeven drag" id="trforcetype"><td>';
print $langs->trans("ForceMemberType"); print $langs->trans("ForceMemberType");
print '</td><td class="right">'; print '</td><td>';
$listofval = array(); $listofval = array();
$listofval += $adht->liste_array(1); $listofval += $adht->liste_array(1);
$forcetype = empty($conf->global->MEMBER_NEWFORM_FORCETYPE) ? -1 : $conf->global->MEMBER_NEWFORM_FORCETYPE; $forcetype = empty($conf->global->MEMBER_NEWFORM_FORCETYPE) ? -1 : $conf->global->MEMBER_NEWFORM_FORCETYPE;
@ -197,7 +197,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
$morphys["mor"] = $langs->trans("Moral"); $morphys["mor"] = $langs->trans("Moral");
print '<tr class="oddeven drag" id="trforcenature"><td>'; print '<tr class="oddeven drag" id="trforcenature"><td>';
print $langs->trans("ForceMemberNature"); print $langs->trans("ForceMemberNature");
print '</td><td class="right">'; print '</td><td>';
$forcenature = empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY) ? 0 : $conf->global->MEMBER_NEWFORM_FORCEMORPHY; $forcenature = empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY) ? 0 : $conf->global->MEMBER_NEWFORM_FORCEMORPHY;
print $form->selectarray("MEMBER_NEWFORM_FORCEMORPHY", $morphys, $forcenature, 1); print $form->selectarray("MEMBER_NEWFORM_FORCEMORPHY", $morphys, $forcenature, 1);
print "</td></tr>\n"; print "</td></tr>\n";
@ -205,21 +205,21 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
// Amount // Amount
print '<tr class="oddeven" id="tramount"><td>'; print '<tr class="oddeven" id="tramount"><td>';
print $langs->trans("DefaultAmount"); print $langs->trans("DefaultAmount");
print '</td><td class="right">'; print '</td><td>';
print '<input type="text" class="right width75" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" value="'.(!empty($conf->global->MEMBER_NEWFORM_AMOUNT) ? $conf->global->MEMBER_NEWFORM_AMOUNT : '').'">'; print '<input type="text" class="right width50" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" value="'.(!empty($conf->global->MEMBER_NEWFORM_AMOUNT) ? $conf->global->MEMBER_NEWFORM_AMOUNT : '').'">';
print "</td></tr>\n"; print "</td></tr>\n";
// Can edit // Can edit
print '<tr class="oddeven" id="tredit"><td>'; print '<tr class="oddeven" id="tredit"><td>';
print $langs->trans("CanEditAmount"); print $langs->trans("CanEditAmount");
print '</td><td class="right">'; print '</td><td>';
print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT", (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT) ? $conf->global->MEMBER_NEWFORM_EDITAMOUNT : 0), 1); print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT", (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT) ? $conf->global->MEMBER_NEWFORM_EDITAMOUNT : 0), 1);
print "</td></tr>\n"; print "</td></tr>\n";
// Jump to an online payment page // Jump to an online payment page
print '<tr class="oddeven" id="trpayment"><td>'; print '<tr class="oddeven" id="trpayment"><td>';
print $langs->trans("MEMBER_NEWFORM_PAYONLINE"); print $langs->trans("MEMBER_NEWFORM_PAYONLINE");
print '</td><td class="right">'; print '</td><td>';
$listofval = array(); $listofval = array();
$listofval['-1'] = $langs->trans('No'); $listofval['-1'] = $langs->trans('No');
$listofval['all'] = $langs->trans('Yes').' ('.$langs->trans("VisitorCanChooseItsPaymentMode").')'; $listofval['all'] = $langs->trans('Yes').' ('.$langs->trans("VisitorCanChooseItsPaymentMode").')';

View File

@ -1227,12 +1227,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
print '<tr><td class="fieldrequired">'.$langs->trans("Password").'</td><td><input type="password" name="pass" class="minwidth300" maxlength="50" value="'.dol_escape_htmltag(GETPOSTISSET("pass") ? GETPOST("pass", 'none', 2) : $object->pass).'"></td></tr>'; print '<tr><td class="fieldrequired">'.$langs->trans("Password").'</td><td><input type="password" name="pass" class="minwidth300" maxlength="50" value="'.dol_escape_htmltag(GETPOSTISSET("pass") ? GETPOST("pass", 'none', 2) : $object->pass).'"></td></tr>';
} }
// Morphy
$morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Moral");
print '<tr><td><span class="fieldrequired">'.$langs->trans("MemberNature").'</span></td><td>';
print $form->selectarray("morphy", $morphys, (GETPOSTISSET("morphy") ? GETPOST("morphy", 'alpha') : $object->morphy), 0, 0, 0, '', 0, 0, 0, '', '', 1);
print "</td></tr>";
// Type // Type
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td>'; print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td>';
@ -1244,6 +1238,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
} }
print "</td></tr>"; print "</td></tr>";
// Morphy
$morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Moral");
print '<tr><td><span class="fieldrequired">'.$langs->trans("MemberNature").'</span></td><td>';
print $form->selectarray("morphy", $morphys, (GETPOSTISSET("morphy") ? GETPOST("morphy", 'alpha') : $object->morphy), 0, 0, 0, '', 0, 0, 0, '', '', 1);
print "</td></tr>";
// Company // Company
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(GETPOSTISSET("societe") ? GETPOST("societe", 'alphanohtml', 2) : $object->company).'"></td></tr>'; print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(GETPOSTISSET("societe") ? GETPOST("societe", 'alphanohtml', 2) : $object->company).'"></td></tr>';
@ -1511,7 +1512,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$outputlangs->loadLangs(array("main", "members", "companies", "install", "other")); $outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
// Get email content from template // Get email content from template
$arraydefaultmessage = null; $arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION; $labeltouse = getDolGlobalString("ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION");
if (!empty($labeltouse)) { if (!empty($labeltouse)) {
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);

View File

@ -670,11 +670,10 @@ class Adherent extends CommonObject
$this->town = ($this->town ? $this->town : $this->town); $this->town = ($this->town ? $this->town : $this->town);
$this->country_id = ($this->country_id > 0 ? $this->country_id : $this->country_id); $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->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_public = ($this->note_public ? $this->note_public : $this->note_public);
$this->note_private = ($this->note_private ? $this->note_private : $this->note_private); $this->note_private = ($this->note_private ? $this->note_private : $this->note_private);
$this->url = $this->url ?clean_url($this->url, 0) : ''; $this->url = $this->url ?clean_url($this->url, 0) : '';
$this->setUpperOrLowerCase();
// Check parameters // Check parameters
if (!empty($conf->global->ADHERENT_MAIL_REQUIRED) && !isValidEMail($this->email)) { if (!empty($conf->global->ADHERENT_MAIL_REQUIRED) && !isValidEMail($this->email)) {
$langs->load("errors"); $langs->load("errors");

View File

@ -63,6 +63,7 @@ $search_email = GETPOST("search_email", 'alpha');
$search_categ = GETPOST("search_categ", 'int'); $search_categ = GETPOST("search_categ", 'int');
$search_filter = GETPOST("search_filter", 'alpha'); $search_filter = GETPOST("search_filter", 'alpha');
$search_status = GETPOST("search_status", 'intcomma'); $search_status = GETPOST("search_status", 'intcomma');
$search_morphy = GETPOST("search_morphy", 'alpha');
$search_import_key = trim(GETPOST("search_import_key", "alpha")); $search_import_key = trim(GETPOST("search_import_key", "alpha"));
$catid = GETPOST("catid", 'int'); $catid = GETPOST("catid", 'int');
$optioncss = GETPOST('optioncss', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha');
@ -382,6 +383,9 @@ if ($search_status != '') {
// Peut valoir un nombre ou liste de nombre separes par virgules // Peut valoir un nombre ou liste de nombre separes par virgules
$sql .= " AND d.statut in (".$db->sanitize($db->escape($search_status)).")"; $sql .= " AND d.statut in (".$db->sanitize($db->escape($search_status)).")";
} }
if ($search_morphy != '') {
$sql .= natural_search("d.morphy", $search_morphy);
}
if ($search_ref) { if ($search_ref) {
$sql .= natural_search("d.ref", $search_ref); $sql .= natural_search("d.ref", $search_ref);
} }
@ -731,6 +735,11 @@ if (!empty($arrayfields['d.login']['checked'])) {
} }
if (!empty($arrayfields['d.morphy']['checked'])) { if (!empty($arrayfields['d.morphy']['checked'])) {
print '<td class="liste_titre left">'; print '<td class="liste_titre left">';
$arraymorphy = array('mor'=>$langs->trans("Moral"), 'phy'=>$langs->trans("Physical"));
print $form->selectarray('search_morphy', $arraymorphy, $search_morphy, 1);
print '</td>';
}
if (!empty($arrayfields['t.libelle']['checked'])) {
print '</td>'; print '</td>';
} }
if (!empty($arrayfields['t.libelle']['checked'])) { if (!empty($arrayfields['t.libelle']['checked'])) {

View File

@ -598,7 +598,11 @@ while ($i < min($num, $limit)) {
if (!$i) { if (!$i) {
$totalarray['pos'][$totalarray['nbfield']] = 'd.amount'; $totalarray['pos'][$totalarray['nbfield']] = 'd.amount';
} }
$totalarray['val']['d.amount'] += $obj->subscription; if (empty($totalarray['val']['d.amount'])) {
$totalarray['val']['d.amount'] = $obj->subscription;
} else {
$totalarray['val']['d.amount'] += $obj->subscription;
}
} }
// Extra fields // Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';

View File

@ -207,21 +207,11 @@ $message .= $langs->trans("AgendaUrlOptionsIncludeHolidays", '1', '1').'<br>';
print info_admin($message); print info_admin($message);
if (!empty($conf->use_javascript_ajax)) { $constname = 'MAIN_AGENDA_XCAL_EXPORTKEY';
print "\n".'<script type="text/javascript">';
print '$(document).ready(function () { // Add button to autosuggest a key
$("#generate_token").click(function() { include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", { print dolJSToSetRandomPassword($constname);
action: \'getrandompassword\',
generic: true
},
function(token) {
$("#MAIN_AGENDA_XCAL_EXPORTKEY").val(token);
});
});
});';
print '</script>';
}
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -396,7 +396,7 @@ if ($resql) {
} }
} }
} else { } else {
print $langs->trans("ChooseABarCode"); print '<span class="opacitymedium">'.$langs->trans("ChooseABarCode").'</span>';
} }
print '</td>'; print '</td>';
@ -439,7 +439,7 @@ if (!isset($_SERVER['WINDIR'])) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("GenbarcodeLocation").'</td>'; print '<td>'.$langs->trans("GenbarcodeLocation").'</td>';
print '<td width="60" class="center">'; print '<td width="60" class="center">';
print '<input type="text" size="40" name="GENBARCODE_LOCATION" value="'.$conf->global->GENBARCODE_LOCATION.'">'; print '<input type="text" size="40" name="GENBARCODE_LOCATION" value="'.getDolGlobalString('GENBARCODE_LOCATION').'">';
if (!empty($conf->global->GENBARCODE_LOCATION) && !@file_exists($conf->global->GENBARCODE_LOCATION)) { if (!empty($conf->global->GENBARCODE_LOCATION) && !@file_exists($conf->global->GENBARCODE_LOCATION)) {
$langs->load("errors"); $langs->load("errors");
print '<br><span class="error">'.$langs->trans("ErrorFileNotFound", $conf->global->GENBARCODE_LOCATION).'</span>'; print '<br><span class="error">'.$langs->trans("ErrorFileNotFound", $conf->global->GENBARCODE_LOCATION).'</span>';

View File

@ -466,13 +466,13 @@ print '</form>';
//Use draft Watermark //Use draft Watermark
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">"; print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print "<input type=\"hidden\" name=\"action\" value=\"set_BOM_DRAFT_WATERMARK\">"; print '<input type="hidden" name="action" value="set_BOM_DRAFT_WATERMARK">';
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("WatermarkOnDraftBOMs"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>'; print $form->textwithpicto($langs->trans("WatermarkOnDraftBOMs"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
print '</td><td>'; print '</td><td>';
print '<input class="flat minwidth200" type="text" name="BOM_DRAFT_WATERMARK" value="'.$conf->global->BOM_DRAFT_WATERMARK.'">'; print '<input class="flat minwidth200" type="text" name="BOM_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('BOM_DRAFT_WATERMARK')).'">';
print '</td><td class="right">'; print '</td><td class="right">';
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n"; print "</td></tr>\n";

View File

@ -64,7 +64,7 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
* View * View
*/ */
$help_url = '';
llxHeader('', $langs->trans("BOMsSetup"), $help_url); llxHeader('', $langs->trans("BOMsSetup"), $help_url);

View File

@ -47,8 +47,9 @@ if (!in_array('clicktodial', $conf->modules)) {
if ($action == 'setvalue' && $user->admin) { if ($action == 'setvalue' && $user->admin) {
$result1 = dolibarr_set_const($db, "CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", GETPOST("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS"), 'chaine', 0, '', $conf->entity); $result1 = dolibarr_set_const($db, "CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", GETPOST("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS"), 'chaine', 0, '', $conf->entity);
$result2 = dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("CLICKTODIAL_URL"), 'chaine', 0, '', $conf->entity); $result2 = dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("CLICKTODIAL_URL"), 'chaine', 0, '', $conf->entity);
$result3 = dolibarr_set_const($db, "CLICKTODIAL_KEY_FOR_CIDLOOKUP", GETPOST("CLICKTODIAL_KEY_FOR_CIDLOOKUP"), 'chaine', 0, '', $conf->entity);
if ($result1 >= 0 && $result2 >= 0) { if ($result1 >= 0 && $result2 >= 0 && $result3 >= 0) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else { } else {
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
@ -80,7 +81,7 @@ print '<input type="hidden" name="action" value="setvalue">';
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>'; print '<td class="minwidth200">'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Value").'</td>'; print '<td>'.$langs->trans("Value").'</td>';
print "</tr>\n"; print "</tr>\n";
@ -89,21 +90,21 @@ print '<tr class="oddeven"><td>';
print $langs->trans("ClickToDialUseTelLink").'</td><td>'; print $langs->trans("ClickToDialUseTelLink").'</td><td>';
print $form->selectyesno("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", $conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS, 1).'<br>'; print $form->selectyesno("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", $conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS, 1).'<br>';
print '<br>'; print '<br>';
print $langs->trans("ClickToDialUseTelLinkDesc"); print '<span class="opacitymedium small">'.$langs->trans("ClickToDialUseTelLinkDesc").'</span>';
print '</td></tr>'; print '</td></tr>';
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans("DefaultLink").'</td><td>'; print $langs->trans("DefaultLink").'</td><td>';
print '<input class="quatrevingtpercent" type="text" id="CLICKTODIAL_URL" name="CLICKTODIAL_URL"'.($conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS ? ' disabled="disabled"' : '').' value="'.$conf->global->CLICKTODIAL_URL.'"><br>'; print '<input class="quatrevingtpercent" type="text" id="CLICKTODIAL_URL" name="CLICKTODIAL_URL"'.(getDolGlobalString('CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS') ? ' disabled="disabled"' : '').' value="'.getDolGlobalString('CLICKTODIAL_URL').'"><br>';
print ajax_autoselect('CLICKTODIAL_URL'); print ajax_autoselect('CLICKTODIAL_URL');
print '<br>'; print '<br>';
print $langs->trans("ClickToDialUrlDesc").'<br>'; print $langs->trans("ClickToDialUrlDesc").'<br>';
print '<br>'; print '<br>';
print '<span class="opacitymedium">'; print '<span class="opacitymedium">';
print $langs->trans("Examples").':<br>'; print $langs->trans("Examples").':<br>';
print 'https://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__<br>'; print '* https://myphoneserver/phoneurl?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__<br>';
print 'sip:__PHONETO__@my.sip.server'; print '* sip:__PHONETO__@my.sip.server';
print '</span>'; print '</span>';
//if (! empty($user->clicktodial_url)) //if (! empty($user->clicktodial_url))
@ -114,6 +115,37 @@ print '</span>';
print '</td></tr>'; print '</td></tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("SecurityKey").'</td>';
print '<td>';
global $dolibarr_main_url_root;
// 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
// Url for CIDLookup
//print '<div class="div-table-responsive-no-min">';
//print $langs->trans("URLToLaunchCronJobs").':<br>';
$url = $urlwithroot.'/public/clicktodial/cidlookup.php?securitykey='.getDolGlobalString('CLICKTODIAL_KEY_FOR_CIDLOOKUP', 'ValueToDefine').'&phone=...';
//print img_picto('', 'globe').' <a href="'.$url.'" target="_blank" rel="noopener noreferrer">'.$url."</a><br>\n";
//print '</div>';
//print '<br>';
print '<span class="opacitymedium">'.$langs->trans("CIDLookupURL").'</span>';
print '<br>'.$url;
print '<br>';
print '<br>';
print '<input type="text" class="flat minwidth300" id="CLICKTODIAL_KEY_FOR_CIDLOOKUP" name="CLICKTODIAL_KEY_FOR_CIDLOOKUP" value="'.(GETPOST('CLICKTODIAL_KEY_FOR_CIDLOOKUP') ? GETPOST('CLICKTODIAL_KEY_FOR_CIDLOOKUP') : (!empty($conf->global->CLICKTODIAL_KEY_FOR_CIDLOOKUP) ? $conf->global->CLICKTODIAL_KEY_FOR_CIDLOOKUP : '')).'">';
if (!empty($conf->use_javascript_ajax)) {
print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
}
print '</td>';
print '</tr>';
print '</table>'; print '</table>';
print '</div>'; print '</div>';
@ -156,6 +188,11 @@ if (!empty($conf->global->CLICKTODIAL_URL)) {
} }
} }
// 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 // End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -625,13 +625,13 @@ print '</form>';
//Use draft Watermark //Use draft Watermark
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">"; print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print "<input type=\"hidden\" name=\"action\" value=\"set_COMMANDE_DRAFT_WATERMARK\">"; print '<input type="hidden" name="action" value="set_COMMANDE_DRAFT_WATERMARK">';
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("WatermarkOnDraftOrders"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>'; print $form->textwithpicto($langs->trans("WatermarkOnDraftOrders"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
print '</td><td>'; print '</td><td>';
print '<input class="flat minwidth200" type="text" name="COMMANDE_DRAFT_WATERMARK" value="'.getDolGlobalString('COMMANDE_DRAFT_WATERMARK').'">'; print '<input class="flat minwidth200" type="text" name="COMMANDE_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('COMMANDE_DRAFT_WATERMARK')).'">';
print '</td><td class="right">'; print '</td><td class="right">';
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n"; print "</td></tr>\n";

View File

@ -220,7 +220,7 @@ if (!empty($conf->multicompany->enabled) && !$user->entity) {
print '<td class="center">'; print '<td class="center">';
print '<input type="hidden" name="entity" value="'.$conf->entity.'">'; print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
} }
print '<input type="submit" class="button button-add" name="add" value="'.$langs->trans("Add").'">'; print '<input type="submit" class="button button-add small" name="add" value="'.$langs->trans("Add").'">';
print "</td>\n"; print "</td>\n";
print '</tr>'; print '</tr>';
@ -273,7 +273,7 @@ if ($result) {
print '</td>'; print '</td>';
// Date last change // Date last change
print '<td class="nowraponall">'; print '<td class="nowraponall center">';
print dol_print_date($db->jdate($obj->tms), 'dayhour'); print dol_print_date($db->jdate($obj->tms), 'dayhour');
print '</td>'; print '</td>';

View File

@ -458,7 +458,7 @@ print '</td></tr>'."\n";
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>'; print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
print '</td><td>'; print '</td><td>';
print '<input class="flat minwidth200" type="text" name="CONTRACT_DRAFT_WATERMARK" value="'.$conf->global->CONTRACT_DRAFT_WATERMARK.'">'; print '<input class="flat minwidth200" type="text" name="CONTRACT_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('CONTRACT_DRAFT_WATERMARK')).'">';
print '</td></tr>'."\n"; print '</td></tr>'."\n";
print '<tr class="oddeven">'; print '<tr class="oddeven">';

View File

@ -2090,6 +2090,8 @@ if ($id > 0) {
$valuetoshow = $langs->trans($obj->{$value}); $valuetoshow = $langs->trans($obj->{$value});
} elseif ($value == 'block_if_negative') { } elseif ($value == 'block_if_negative') {
$valuetoshow = yn($obj->{$value}); $valuetoshow = yn($obj->{$value});
} elseif ($value == 'icon') {
$valuetoshow = $obj->{$value}." ".img_picto("", $obj->{$value});
} elseif ($value == 'type_duration') { } elseif ($value == 'type_duration') {
$TDurationTypes = array('y'=>$langs->trans('Years'), 'm'=>$langs->trans('Month'), 'w'=>$langs->trans('Weeks'), 'd'=>$langs->trans('Days'), 'h'=>$langs->trans('Hours'), 'i'=>$langs->trans('Minutes')); $TDurationTypes = array('y'=>$langs->trans('Years'), 'm'=>$langs->trans('Month'), 'w'=>$langs->trans('Weeks'), 'd'=>$langs->trans('Days'), 'h'=>$langs->trans('Hours'), 'i'=>$langs->trans('Minutes'));
$valuetoshow =$TDurationTypes[$obj->{$value}]; $valuetoshow =$TDurationTypes[$obj->{$value}];

View File

@ -206,7 +206,7 @@ class PrestaShopWebservice
*/ */
public function printDebug($title, $content) public function printDebug($title, $content)
{ {
echo '<div style="display:table;background:#CCC;font-size:8pt;padding:7px"><h6 style="font-size:9pt;margin:0">'.$title.'</h6><pre>'.htmlentities($content).'</pre></div>'; echo '<div style="display:table;background:#CCC;font-size:8pt;padding:7px"><h6 style="font-size:9pt;margin:0">'.dol_escape_htmltag($title).'</h6><pre>'.dol_escape_htmltag($content).'</pre></div>';
} }
/** /**

View File

@ -273,21 +273,10 @@ if ($action == 'edit') {
if (!empty($conf->use_javascript_ajax)) { if (!empty($conf->use_javascript_ajax)) {
print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"'); print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"');
} }
if (!empty($conf->use_javascript_ajax)) {
print "\n".'<script type="text/javascript">'; // Add button to autosuggest a key
print '$(document).ready(function () { include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
$("#generate_token'.$constname.'").click(function() { print dolJSToSetRandomPassword($constname, 'generate_token'.$constname);
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
action: \'getrandompassword\',
generic: true
},
function(token) {
$("#'.$constname.'").val(token);
});
});
});';
print '</script>';
}
} elseif ($val['type'] == 'product') { } elseif ($val['type'] == 'product') {
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname); $selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);

View File

@ -451,7 +451,7 @@ print "</td></tr>\n";
print '<tr><td>'; print '<tr><td>';
print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>'; print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
print '<input class="flat minwidth200" type="text" name="SHIPPING_DRAFT_WATERMARK" value="'.getDolGlobalString('SHIPPING_DRAFT_WATERMARK').'">'; print '<input class="flat minwidth200" type="text" name="SHIPPING_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('SHIPPING_DRAFT_WATERMARK')).'">';
print "</td></tr>\n"; print "</td></tr>\n";
print '</table>'; print '</table>';

View File

@ -468,7 +468,7 @@ print '</td></tr>'."\n";
print '<tr class="oddeven"><td colspan="2">'; print '<tr class="oddeven"><td colspan="2">';
print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>'; print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
print '<input class="flat minwidth200" type="text" name="EXPENSEREPORT_DRAFT_WATERMARK" value="'.$conf->global->EXPENSEREPORT_DRAFT_WATERMARK.'">'; print '<input class="flat minwidth200" type="text" name="EXPENSEREPORT_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('EXPENSEREPORT_DRAFT_WATERMARK')).'">';
print '</td></tr>'."\n"; print '</td></tr>'."\n";
if (!empty($conf->project->enabled)) { if (!empty($conf->project->enabled)) {

View File

@ -761,7 +761,7 @@ print '<input type="hidden" name="action" value="set_FACTURE_DRAFT_WATERMARK" />
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("WatermarkOnDraftBill"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>'; print $form->textwithpicto($langs->trans("WatermarkOnDraftBill"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
print '</td>'; print '</td>';
print '<td><input class="flat minwidth200imp" type="text" name="FACTURE_DRAFT_WATERMARK" value="'.$conf->global->FACTURE_DRAFT_WATERMARK.'" />'; print '<td><input class="flat minwidth200imp" type="text" name="FACTURE_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('FACTURE_DRAFT_WATERMARK')).'">';
print '</td><td class="right">'; print '</td><td class="right">';
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'" />'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'" />';
print "</td></tr>\n"; print "</td></tr>\n";

View File

@ -525,7 +525,7 @@ print "<input type=\"hidden\" name=\"action\" value=\"set_FICHINTER_DRAFT_WATERM
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("WatermarkOnDraftInterventionCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>'; print $form->textwithpicto($langs->trans("WatermarkOnDraftInterventionCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
print '</td><td>'; print '</td><td>';
print '<input class="flat minwidth200" type="text" name="FICHINTER_DRAFT_WATERMARK" value="'.$conf->global->FICHINTER_DRAFT_WATERMARK.'">'; print '<input class="flat minwidth200" type="text" name="FICHINTER_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('FICHINTER_DRAFT_WATERMARK')).'">';
print '</td><td class="right">'; print '</td><td class="right">';
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n"; print "</td></tr>\n";

View File

@ -551,7 +551,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("WatermarkOnDraftHolidayCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>'; print $form->textwithpicto($langs->trans("WatermarkOnDraftHolidayCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
print '</td><td>'; print '</td><td>';
print '<input class="flat minwidth200" type="text" name="HOLIDAY_DRAFT_WATERMARK" value="'.$conf->global->HOLIDAY_DRAFT_WATERMARK.'">'; print '<input class="flat minwidth200" type="text" name="HOLIDAY_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('HOLIDAY_DRAFT_WATERMARK')).'">';
print '</td></tr>'."\n"; print '</td></tr>'."\n";
} }

View File

@ -57,7 +57,7 @@ $type = 'myobject';
$arrayofparameters = array( $arrayofparameters = array(
'HRM_MAXRANK'=>array('type'=>'integer','enabled'=>1), 'HRM_MAXRANK'=>array('type'=>'integer','enabled'=>1),
'HRM_DEFAULT_SKILL_DESCRIPTION'=>array('type'=>'textarea','enabled'=>1), 'HRM_DEFAULT_SKILL_DESCRIPTION'=>array('type'=>'varchar','enabled'=>1),
); );
$error = 0; $error = 0;
@ -540,21 +540,10 @@ if ($action == 'edit') {
if (!empty($conf->use_javascript_ajax)) { if (!empty($conf->use_javascript_ajax)) {
print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"'); print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"');
} }
if (!empty($conf->use_javascript_ajax)) {
print "\n".'<script type="text/javascript">'; // Add button to autosuggest a key
print '$(document).ready(function () { include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
$("#generate_token'.$constname.'").click(function() { print dolJSToSetRandomPassword($constname, 'generate_token'.$constname);
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
action: \'getrandompassword\',
generic: true
},
function(token) {
$("#'.$constname.'").val(token);
});
});
});';
print '</script>';
}
} elseif ($val['type'] == 'product') { } elseif ($val['type'] == 'product') {
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname); $selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);

View File

@ -107,21 +107,11 @@ llxHeader('', $langs->trans("MailingSetup"));
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("MailingSetup"), $linkback, 'title_setup'); print load_fiche_titre($langs->trans("MailingSetup"), $linkback, 'title_setup');
if (!empty($conf->use_javascript_ajax)) { $constname = 'MAILING_EMAIL_UNSUBSCRIBE_KEY';
print "\n".'<script type="text/javascript">';
print '$(document).ready(function () { // Add button to autosuggest a key
$("#generate_token").click(function() { include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", { print dolJSToSetRandomPassword($constname);
action: \'getrandompassword\',
generic: true
},
function(token) {
$("#MAILING_EMAIL_UNSUBSCRIBE_KEY").val(token);
});
});
});';
print '</script>';
}
print '<br>'; print '<br>';
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -870,7 +870,7 @@ if ($action == 'edit') {
if (!empty($dnsinfo) && is_array($dnsinfo)) { if (!empty($dnsinfo) && is_array($dnsinfo)) {
foreach ($dnsinfo as $info) { foreach ($dnsinfo as $info) {
if (strpos($info['txt'], 'v=spf') !== false) { if (strpos($info['txt'], 'v=spf') !== false) {
$text .= ($text ? '<br><br>' : '').$langs->trans("ActualMailSPFRecordFound", $info['txt']); $text .= ($text ? '<br><br>' : '').$langs->trans("ActualMailSPFRecordFound", $companyemail, $info['txt']);
} }
} }
} }

View File

@ -427,11 +427,15 @@ if ($action == 'edit') {
// Method // Method
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td>'; print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td>';
$text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE_EMAILING]; $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING')];
if (empty($text)) { if (empty($text)) {
$text = $langs->trans("Undefined").img_warning(); $text = $langs->trans("Undefined").img_warning();
} }
print $text; if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') == 'default') {
print '<span class="opacitymedium">'.$text.'</span>';
} else {
print $text;
}
print '</td></tr>'; print '</td></tr>';
if (!empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') { if (!empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') {

View File

@ -394,11 +394,15 @@ if ($action == 'edit') {
// Method // Method
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td>'; print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td>';
$text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE_TICKET]; $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET')];
if (empty($text)) { if (empty($text)) {
$text = $langs->trans("Undefined").img_warning(); $text = $langs->trans("Undefined").img_warning();
} }
print $text; if (getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET') == 'default') {
print '<span class="opacitymedium">'.$text.'</span>';
} else {
print $text;
}
print '</td></tr>'; print '</td></tr>';
if (!empty($conf->global->MAIN_MAIL_SENDMODE_TICKET) && $conf->global->MAIN_MAIL_SENDMODE_TICKET != 'default') { if (!empty($conf->global->MAIN_MAIL_SENDMODE_TICKET) && $conf->global->MAIN_MAIL_SENDMODE_TICKET != 'default') {

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2017 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -505,7 +506,7 @@ if ($mode == 'feature') {
$text .= '<br>'; $text .= '<br>';
$text .= '<br><strong>'.$langs->trans("AddHooks").':</strong> '; $text .= '<br><strong>'.$langs->trans("AddHooks").':</strong> ';
if (isset($objMod->module_parts) && is_array($objMod->module_parts['hooks']) && count($objMod->module_parts['hooks'])) { if (isset($objMod->module_parts) && isset($objMod->module_parts['hooks']) && is_array($objMod->module_parts['hooks']) && count($objMod->module_parts['hooks'])) {
$i = 0; $i = 0;
foreach ($objMod->module_parts['hooks'] as $key => $val) { foreach ($objMod->module_parts['hooks'] as $key => $val) {
if ($key === 'entity') { if ($key === 'entity') {

View File

@ -465,7 +465,7 @@ print "<input type=\"hidden\" name=\"action\" value=\"set_MRP_MO_DRAFT_WATERMARK
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("WatermarkOnDraftMOs"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>'; print $form->textwithpicto($langs->trans("WatermarkOnDraftMOs"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
print '</td><td>'; print '</td><td>';
print '<input class="flat minwidth200" type="text" name="MRP_MO_DRAFT_WATERMARK" value="'.$conf->global->MRP_MO_DRAFT_WATERMARK.'">'; print '<input class="flat minwidth200" type="text" name="MRP_MO_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('MRP_MO_DRAFT_WATERMARK')).'">';
print '</td><td class="right">'; print '</td><td class="right">';
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n"; print "</td></tr>\n";

View File

@ -188,6 +188,7 @@ print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setvalue">'; print '<input type="hidden" name="action" value="setvalue">';
print '<div class="div-table-responsive">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>'; print '<td>'.$langs->trans("Parameter").'</td>';
@ -198,7 +199,7 @@ print '<tr class="oddeven"><td>';
print $langs->trans("NotificationEMailFrom").'</td>'; print $langs->trans("NotificationEMailFrom").'</td>';
print '<td>'; print '<td>';
print img_picto('', 'email', 'class="pictofixedwidth"'); print img_picto('', 'email', 'class="pictofixedwidth"');
print '<input class="width300" type="email" name="email_from" value="'.$conf->global->NOTIFICATION_EMAIL_FROM.'">'; print '<input class="width150 quatrevingtpercentminusx" type="email" name="email_from" value="'.getDolGlobalString('NOTIFICATION_EMAIL_FROM').'">';
if (!empty($conf->global->NOTIFICATION_EMAIL_FROM) && !isValidEmail($conf->global->NOTIFICATION_EMAIL_FROM)) { if (!empty($conf->global->NOTIFICATION_EMAIL_FROM) && !isValidEmail($conf->global->NOTIFICATION_EMAIL_FROM)) {
print ' '.img_warning($langs->trans("ErrorBadEMail")); print ' '.img_warning($langs->trans("ErrorBadEMail"));
} }
@ -212,7 +213,7 @@ if ($conf->use_javascript_ajax) {
print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT'); print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT');
} else { } else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT", $arrval, $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT); print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT", $arrval, getDolGlobalString('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT'));
} }
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -224,7 +225,7 @@ if ($conf->use_javascript_ajax) {
print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER'); print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER');
} else { } else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER", $arrval, $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER); print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER", $arrval, getDolGlobalString('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER'));
} }
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -236,11 +237,12 @@ if ($conf->use_javascript_ajax) {
print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX'); print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX');
} else { } else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX", $arrval, $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX); print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX", $arrval, getDolGlobalString('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX'));
} }
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';
print '</div>';
print $form->buttonsSaveCancel("Save", ''); print $form->buttonsSaveCancel("Save", '');
@ -387,6 +389,7 @@ if (!empty($conf->societe->enabled)) {
} }
print '</div>'; print '</div>';
print '<div class="div-table-responsive">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Module").'</td>'; print '<td>'.$langs->trans("Module").'</td>';
@ -449,7 +452,7 @@ foreach ($listofnotifiedevents as $notifiedevent) {
$param = 'NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_'.$reg[1]; $param = 'NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_'.$reg[1];
$value = GETPOST('NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key') ?GETPOST('NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key', 'alpha') : $conf->global->$param; $value = GETPOST('NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key') ?GETPOST('NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key', 'alpha') : $conf->global->$param;
$s = '<input type="text" size="32" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key" value="'.dol_escape_htmltag($value).'">'; // Do not use type="email" here, we must be able to enter a list of email with , separator. $s = '<input type="text" class="minwidth200" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key" value="'.dol_escape_htmltag($value).'">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
$arrayemail = explode(',', $value); $arrayemail = explode(',', $value);
$showwarning = 0; $showwarning = 0;
foreach ($arrayemail as $keydet => $valuedet) { foreach ($arrayemail as $keydet => $valuedet) {
@ -468,7 +471,7 @@ foreach ($listofnotifiedevents as $notifiedevent) {
} }
// New entry input fields // New entry input fields
if (empty($inputfieldalreadyshown) || !$codehasnotrigger) { if (empty($inputfieldalreadyshown) || !$codehasnotrigger) {
$s = '<input type="text" size="32" name="NOTIF_'.$notifiedevent['code'].'_new_key" value="">'; // Do not use type="email" here, we must be able to enter a list of email with , separator. $s = '<input type="text" class="minwidth200" name="NOTIF_'.$notifiedevent['code'].'_new_key" value="">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword"), 1, 'help', '', 0, 2); print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword"), 1, 'help', '', 0, 2);
} }
print '</td>'; print '</td>';
@ -501,6 +504,7 @@ foreach ($listofnotifiedevents as $notifiedevent) {
print '</tr>'; print '</tr>';
} }
print '</table>'; print '</table>';
print '</div>';
print $form->buttonsSaveCancel("Save", ''); print $form->buttonsSaveCancel("Save", '');

View File

@ -693,7 +693,7 @@ print "<input type=\"hidden\" name=\"action\" value=\"set_PROPALE_DRAFT_WATERMAR
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("WatermarkOnDraftProposal"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>'; print $form->textwithpicto($langs->trans("WatermarkOnDraftProposal"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
print '</td><td>'; print '</td><td>';
print '<input class="flat minwidth200" type="text" name="PROPALE_DRAFT_WATERMARK" value="'.$conf->global->PROPALE_DRAFT_WATERMARK.'">'; print '<input class="flat minwidth200" type="text" name="PROPALE_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('PROPALE_DRAFT_WATERMARK')).'">';
print '</td><td class="right">'; print '</td><td class="right">';
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n"; print "</td></tr>\n";

View File

@ -467,7 +467,7 @@ print "</td></tr>\n";
print '<tr><td>'; print '<tr><td>';
print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext).'<br>'; print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext).'<br>';
print '<input class="flat minwidth200" type="text" name="RECEPTION_DRAFT_WATERMARK" value="'.$conf->global->RECEPTION_DRAFT_WATERMARK.'">'; print '<input class="flat minwidth200" type="text" name="RECEPTION_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('RECEPTION_DRAFT_WATERMARK')).'">';
print "</td></tr>\n"; print "</td></tr>\n";
*/ */
print '</table>'; print '</table>';

View File

@ -128,7 +128,7 @@ if (isset($max)) {
} }
print '</td>'; print '</td>';
print '<td class="nowrap">'; print '<td class="nowrap">';
print '<input class="flat" name="MAIN_UPLOAD_DOC" type="text" size="6" value="'.htmlentities($conf->global->MAIN_UPLOAD_DOC).'"> '.$langs->trans("Kb"); print '<input class="flat" name="MAIN_UPLOAD_DOC" type="text" size="6" value="'.dol_escape_htmltag($conf->global->MAIN_UPLOAD_DOC).'"> '.$langs->trans("Kb");
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -138,7 +138,7 @@ print '<td>'.$langs->trans("UMask").'</td><td class="right">';
print $form->textwithpicto('', $langs->trans("UMaskExplanation")); print $form->textwithpicto('', $langs->trans("UMaskExplanation"));
print '</td>'; print '</td>';
print '<td class="nowrap">'; print '<td class="nowrap">';
print '<input class="flat" name="MAIN_UMASK" type="text" size="6" value="'.htmlentities($conf->global->MAIN_UMASK).'">'; print '<input class="flat" name="MAIN_UMASK" type="text" size="6" value="'.dol_escape_htmltag($conf->global->MAIN_UMASK).'">';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -61,8 +61,13 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) {
dol_print_error($db); dol_print_error($db);
} }
} elseif ($action == 'updateform') { } elseif ($action == 'updateform') {
$res1 = dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", GETPOST("MAIN_APPLICATION_TITLE", 'alphanohtml'), 'chaine', 0, '', $conf->entity); $res1 = 1; $res2 = 1;
$res2 = dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", GETPOST("MAIN_SESSION_TIMEOUT", 'alphanohtml'), 'chaine', 0, '', $conf->entity); 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 ($res1 && $res2) {
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
} }
@ -165,11 +170,11 @@ if (ini_get("session.gc_probability") == 0) {
} }
print '</td>'; print '</td>';
print '<td class="nowrap">'; print '<td class="nowrap">';
print '<input class="flat" name="MAIN_SESSION_TIMEOUT" type="text" size="6" value="'.htmlentities($conf->global->MAIN_SESSION_TIMEOUT).'"> '.strtolower($langs->trans("Seconds")); print '<input class="flat right width50" name="MAIN_SESSION_TIMEOUT" type="text" value="'.dol_escape_htmltag($conf->global->MAIN_SESSION_TIMEOUT).'"> '.strtolower($langs->trans("Seconds"));
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
/*
if (empty($conf->global->MAIN_APPLICATION_TITLE)) { if (empty($conf->global->MAIN_APPLICATION_TITLE)) {
$conf->global->MAIN_APPLICATION_TITLE = ""; $conf->global->MAIN_APPLICATION_TITLE = "";
} }
@ -177,9 +182,10 @@ print '<tr class="oddeven">';
print '<td>'.$langs->trans("MAIN_APPLICATION_TITLE").'</td><td class="right">'; print '<td>'.$langs->trans("MAIN_APPLICATION_TITLE").'</td><td class="right">';
print '</td>'; print '</td>';
print '<td class="nowrap">'; print '<td class="nowrap">';
print '<input class="flat" name="MAIN_APPLICATION_TITLE" type="text" size="20" value="'.htmlentities($conf->global->MAIN_APPLICATION_TITLE).'"> '; print '<input class="flat" name="MAIN_APPLICATION_TITLE" type="text" size="20" value="'.dol_escape_htmltag($conf->global->MAIN_APPLICATION_TITLE).'"> ';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
*/
print '</table>'; print '</table>';

View File

@ -492,7 +492,7 @@ print "<input type=\"hidden\" name=\"action\" value=\"set_SUPPLIER_PROPOSAL_DRAF
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("WatermarkOnDraftProposal"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>'; print $form->textwithpicto($langs->trans("WatermarkOnDraftProposal"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
print '</td><td>'; print '</td><td>';
print '<input class="flat minwidth200" type="text" name="SUPPLIER_PROPOSAL_DRAFT_WATERMARK" value="'.$conf->global->SUPPLIER_PROPOSAL_DRAFT_WATERMARK.'">'; print '<input class="flat minwidth200" type="text" name="SUPPLIER_PROPOSAL_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('SUPPLIER_PROPOSAL_DRAFT_WATERMARK')).'">';
print '</td><td class="right">'; print '</td><td class="right">';
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n"; print "</td></tr>\n";

View File

@ -295,7 +295,7 @@ print '</td></tr>';
if (!empty($conf->loghandlers['mod_syslog_file']) && !empty($conf->cron->enabled)) { if (!empty($conf->loghandlers['mod_syslog_file']) && !empty($conf->cron->enabled)) {
print '<tr class="oddeven"><td width="140">'.$langs->trans("SyslogFileNumberOfSaves").'</td>'; print '<tr class="oddeven"><td width="140">'.$langs->trans("SyslogFileNumberOfSaves").'</td>';
print '<td colspan="2"><input type="number" name="file_saves" placeholder="14" min="0" step="1" value="'.$conf->global->SYSLOG_FILE_SAVES.'" />'; print '<td colspan="2"><input type="number" name="file_saves" placeholder="14" min="0" step="1" value="'.getDolGlobalString('SYSLOG_FILE_SAVES').'" />';
print ' (<a href="'.dol_buildpath('/cron/list.php', 1).'?search_label=CompressSyslogs&status=-1">'.$langs->trans('ConfigureCleaningCronjobToSetFrequencyOfSaves').'</a>)</td></tr>'; print ' (<a href="'.dol_buildpath('/cron/list.php', 1).'?search_label=CompressSyslogs&status=-1">'.$langs->trans('ConfigureCleaningCronjobToSetFrequencyOfSaves').'</a>)</td></tr>';
} }

View File

@ -89,6 +89,7 @@ $configfileparameters = array(
'separator', 'separator',
'?dolibarr_mailing_limit_sendbyweb', '?dolibarr_mailing_limit_sendbyweb',
'?dolibarr_mailing_limit_sendbycli', '?dolibarr_mailing_limit_sendbycli',
'?dolibarr_mailing_limit_sendbyday',
'?dolibarr_strict_mode' '?dolibarr_strict_mode'
); );
$configfilelib = array( $configfilelib = array(

View File

@ -106,6 +106,14 @@ if (!$base) {
print '<td class="right">Collation</td>'; print '<td class="right">Collation</td>';
print "</tr>\n"; print "</tr>\n";
$arrayoffilesrich = dol_dir_list(DOL_DOCUMENT_ROOT.'/install/mysql/tables/', 'files', 0, '\.sql$');
$arrayoffiles = array();
foreach ($arrayoffilesrich as $value) {
//print $shortsqlfilename.' ';
$shortsqlfilename = preg_replace('/\-[a-z]+\./', '.', $value['name']);
$arrayoffiles[] = $shortsqlfilename;
}
$sql = "SHOW TABLE STATUS"; $sql = "SHOW TABLE STATUS";
$resql = $db->query($sql); $resql = $db->query($sql);
@ -119,7 +127,8 @@ if (!$base) {
print '<td>'.($i+1).'</td>'; print '<td>'.($i+1).'</td>';
print '<td><a href="dbtable.php?table='.$obj->Name.'">'.$obj->Name.'</a>'; print '<td><a href="dbtable.php?table='.$obj->Name.'">'.$obj->Name.'</a>';
$tablename = preg_replace('/^'.MAIN_DB_PREFIX.'/', 'llx_', $obj->Name); $tablename = preg_replace('/^'.MAIN_DB_PREFIX.'/', 'llx_', $obj->Name);
if (dol_is_file(DOL_DOCUMENT_ROOT.'/install/mysql/tables/'.$tablename.'.sql')) {
if (in_array($tablename.'.sql', $arrayoffiles)) {
$img = "info"; $img = "info";
//print img_picto($langs->trans("ExternalModule"), $img); //print img_picto($langs->trans("ExternalModule"), $img);
} else { } else {

View File

@ -360,6 +360,7 @@ $configfileparameters = array(
'dolibarr_main_restrict_ip' => 'Restrict access to some IPs only', 'dolibarr_main_restrict_ip' => 'Restrict access to some IPs only',
'?dolibarr_mailing_limit_sendbyweb' => 'Limit nb of email sent by page', '?dolibarr_mailing_limit_sendbyweb' => 'Limit nb of email sent by page',
'?dolibarr_mailing_limit_sendbycli' => 'Limit nb of email sent by cli', '?dolibarr_mailing_limit_sendbycli' => 'Limit nb of email sent by cli',
'?dolibarr_mailing_limit_sendbyday' => 'Limit nb of email sent per day',
'?dolibarr_strict_mode' => 'Strict mode is on/off', '?dolibarr_strict_mode' => 'Strict mode is on/off',
'?dolibarr_nocsrfcheck' => 'Disable CSRF security checks' '?dolibarr_nocsrfcheck' => 'Disable CSRF security checks'
); );

View File

@ -183,7 +183,8 @@ if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE') {
} }
// enable captcha by default // enable captcha by default
$res = dolibarr_set_const($db, 'MAIN_SECURITY_ENABLECAPTCHA', 1, 'chaine', 0, '', $conf->entity); // TODO Add a visible option in this setup page for this
$res = dolibarr_set_const($db, 'MAIN_SECURITY_ENABLECAPTCHA_TICKET', 1, 'chaine', 0, '', $conf->entity);
if (!($res > 0)) { if (!($res > 0)) {
$error++; $error++;
$errors[] = $db->lasterror(); $errors[] = $db->lasterror();

View File

@ -58,7 +58,7 @@ if ($action == 'set_default') {
} elseif ($action == 'del_default') { } elseif ($action == 'del_default') {
$ret = delDocumentModel($value, $type); $ret = delDocumentModel($value, $type);
if ($ret > 0) { if ($ret > 0) {
if ($conf->global->USERGROUP_ADDON_PDF_ODT == "$value") { if (getDolGlobalString('USERGROUP_ADDON_PDF_ODT') == "$value") {
dolibarr_del_const($db, 'USERGROUP_ADDON_PDF_ODT', $conf->entity); dolibarr_del_const($db, 'USERGROUP_ADDON_PDF_ODT', $conf->entity);
} }
} }
@ -202,7 +202,7 @@ foreach ($dirmodels as $reldir) {
// Defaut // Defaut
print '<td class="center">'; print '<td class="center">';
if ($conf->global->USERGROUP_ADDON_PDF == $name) { if (getDolGlobalString('USERGROUP_ADDON_PDF') == $name) {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
} else { } else {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scandir='.urlencode($module->scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scandir='.urlencode($module->scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';

View File

@ -338,21 +338,10 @@ if ($action == 'edit') {
if (!empty($conf->use_javascript_ajax)) { if (!empty($conf->use_javascript_ajax)) {
print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"'); print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"');
} }
if (!empty($conf->use_javascript_ajax)) {
print "\n".'<script type="text/javascript">'; // Add button to autosuggest a key
print '$(document).ready(function () { include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
$("#generate_token'.$constname.'").click(function() { print dolJSToSetRandomPassword($constname, 'generate_token'.$constname);
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
action: \'getrandompassword\',
generic: true
},
function(token) {
$("#'.$constname.'").val(token);
});
});
});';
print '</script>';
}
} elseif ($val['type'] == 'product') { } elseif ($val['type'] == 'product') {
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname); $selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);

View File

@ -257,6 +257,8 @@ if (!empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $
continue; continue;
} }
//dol_syslog("We scan to search api file with into ".$dir_part.$file_searched);
$regapi = array(); $regapi = array();
if (is_readable($dir_part.$file_searched) && preg_match("/^api_(.*)\.class\.php$/i", $file_searched, $regapi)) { if (is_readable($dir_part.$file_searched) && preg_match("/^api_(.*)\.class\.php$/i", $file_searched, $regapi)) {
$classname = ucwords($regapi[1]); $classname = ucwords($regapi[1]);

View File

@ -519,21 +519,10 @@ if ($action == 'edit') {
if (!empty($conf->use_javascript_ajax)) { if (!empty($conf->use_javascript_ajax)) {
print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"'); print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"');
} }
if (!empty($conf->use_javascript_ajax)) {
print "\n".'<script type="text/javascript">'; // Add button to autosuggest a key
print '$(document).ready(function () { include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
$("#generate_token'.$constname.'").click(function() { print dolJSToSetRandomPassword($constname, 'generate_token'.$constname);
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
action: \'getrandompassword\',
generic: true
},
function(token) {
$("#'.$constname.'").val(token);
});
});
});';
print '</script>';
}
} elseif ($val['type'] == 'product') { } elseif ($val['type'] == 'product') {
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname); $selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2014-2015 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2014-2022 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -21,6 +21,7 @@
* \ingroup member * \ingroup member
* \brief Page to make mass init of barcode * \brief Page to make mass init of barcode
*/ */
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
@ -322,26 +323,29 @@ if (isModEnabled('societe')) {
dol_print_error($db); dol_print_error($db);
} }
print $langs->trans("CurrentlyNWithoutBarCode", $nbthirdpartyno, $nbthirdpartytotal, $langs->transnoentitiesnoconv("ThirdParties")).'<br>'."\n"; print $langs->trans("CurrentlyNWithoutBarCode", $nbthirdpartyno, $nbthirdpartytotal, $langs->transnoentitiesnoconv("ThirdParties"))."\n";
$disabledthirdparty = $disabledthirdparty1 = 0; $disabledthirdparty = $disabledthirdparty1 = 0;
if (is_object($modBarCodeThirdparty)) { if (is_object($modBarCodeThirdparty)) {
print $langs->trans("BarCodeNumberManager").": "; print '<br>'.$langs->trans("BarCodeNumberManager").": ";
$objthirdparty = new Societe($db); $objthirdparty = new Societe($db);
print '<b>'.(isset($modBarCodeThirdparty->name) ? $modBarCodeThirdparty->name : $modBarCodeThirdparty->nom).'</b> - '.$langs->trans("NextValue").': <b>'.$modBarCodeThirdparty->getNextValue($objthirdparty).'</b><br>'; print '<b>'.(isset($modBarCodeThirdparty->name) ? $modBarCodeThirdparty->name : $modBarCodeThirdparty->nom).'</b> - '.$langs->trans("NextValue").': <b>'.$modBarCodeThirdparty->getNextValue($objthirdparty).'</b><br>';
$disabledthirdparty = 0; $disabledthirdparty = 0;
print '<br>';
} else { } else {
$disabledthirdparty = 1; $disabledthirdparty = 1;
$titleno = $langs->trans("NoBarcodeNumberingTemplateDefined"); $titleno = $langs->trans("NoBarcodeNumberingTemplateDefined");
print '<span class="warning">'.$langs->trans("NoBarcodeNumberingTemplateDefined").'</span> (<a href="'.DOL_URL_ROOT.'/admin/barcode.php">'.$langs->trans("ToGenerateCodeDefineAutomaticRuleFirst").'</a>)<br>'; print '<div class="warning">'.$langs->trans("NoBarcodeNumberingTemplateDefined");
print '<br><a href="'.DOL_URL_ROOT.'/admin/barcode.php">'.$langs->trans("ToGenerateCodeDefineAutomaticRuleFirst").'</a>';
print '</div>';
} }
if (empty($nbthirdpartyno)) { if (empty($nbthirdpartyno)) {
$disabledthirdparty1 = 1; $disabledthirdparty1 = 1;
} }
$moretagsthirdparty1 = (($disabledthirdparty || $disabledthirdparty1) ? ' disabled title="'.dol_escape_htmltag($titleno).'"' : ''); $moretagsthirdparty1 = (($disabledthirdparty || $disabledthirdparty1) ? ' disabled title="'.dol_escape_htmltag($titleno).'"' : '');
print '<br><input class="button button-add" type="submit" id="submitformbarcodethirdpartygen" value="'.$langs->trans("InitEmptyBarCode", $nbno).'"'.$moretagsthirdparty1.'>'; print '<br><input class="button button-add" type="submit" id="submitformbarcodethirdpartygen" value="'.$langs->trans("InitEmptyBarCode", $nbthirdpartyno).'"'.$moretagsthirdparty1.'>';
$moretagsthirdparty2 = (($nbthirdpartyno == $nbthirdpartytotal) ? ' disabled' : ''); $moretagsthirdparty2 = (($nbthirdpartyno == $nbthirdpartytotal) ? ' disabled' : '');
print ' &nbsp; '; print ' &nbsp; ';
print '<input type="submit" class="button butActionDelete" name="eraseallthirdpartybarcode" id="eraseallthirdpartybarcode" value="'.$langs->trans("EraseAllCurrentBarCode").'"'.$moretagsthirdparty2.' onClick="return confirm_erase();">'; print '<input type="submit" class="button butActionDelete" name="eraseallthirdpartybarcode" id="eraseallthirdpartybarcode" value="'.$langs->trans("EraseAllCurrentBarCode").'"'.$moretagsthirdparty2.' onClick="return confirm_erase();">';
@ -391,28 +395,30 @@ if ($conf->product->enabled || $conf->product->service) {
dol_print_error($db); dol_print_error($db);
} }
print $langs->trans("CurrentlyNWithoutBarCode", $nbproductno, $nbproducttotal, $langs->transnoentitiesnoconv("ProductsOrServices")).'<br>'."\n"; print $langs->trans("CurrentlyNWithoutBarCode", $nbproductno, $nbproducttotal, $langs->transnoentitiesnoconv("ProductsOrServices"))."\n";
$disabledproduct = $disabledproduct1 = 0; $disabledproduct = $disabledproduct1 = 0;
if (is_object($modBarCodeProduct)) { if (is_object($modBarCodeProduct)) {
print $langs->trans("BarCodeNumberManager").": "; print '<br>'.$langs->trans("BarCodeNumberManager").": ";
$objproduct = new Product($db); $objproduct = new Product($db);
print '<b>'.(isset($modBarCodeProduct->name) ? $modBarCodeProduct->name : $modBarCodeProduct->nom).'</b> - '.$langs->trans("NextValue").': <b>'.$modBarCodeProduct->getNextValue($objproduct).'</b><br>'; print '<b>'.(isset($modBarCodeProduct->name) ? $modBarCodeProduct->name : $modBarCodeProduct->nom).'</b> - '.$langs->trans("NextValue").': <b>'.$modBarCodeProduct->getNextValue($objproduct).'</b><br>';
$disabledproduct = 0; $disabledproduct = 0;
print '<br>';
} else { } else {
$disabledproduct = 1; $disabledproduct = 1;
$titleno = $langs->trans("NoBarcodeNumberingTemplateDefined"); $titleno = $langs->trans("NoBarcodeNumberingTemplateDefined");
print '<span class="warning">'.$langs->trans("NoBarcodeNumberingTemplateDefined").'</span> (<a href="'.DOL_URL_ROOT.'/admin/barcode.php">'.$langs->trans("ToGenerateCodeDefineAutomaticRuleFirst").'</a>)<br>'; print '<br><div class="warning">'.$langs->trans("NoBarcodeNumberingTemplateDefined");
print '<br><a href="'.DOL_URL_ROOT.'/admin/barcode.php">'.$langs->trans("ToGenerateCodeDefineAutomaticRuleFirst").'</a>';
print '</div>';
} }
if (empty($nbproductno)) { if (empty($nbproductno)) {
$disabledproduct1 = 1; $disabledproduct1 = 1;
} }
print '<br>';
//print '<input type="checkbox" id="erasealreadyset" name="erasealreadyset"> '.$langs->trans("ResetBarcodeForAllRecords").'<br>'; //print '<input type="checkbox" id="erasealreadyset" name="erasealreadyset"> '.$langs->trans("ResetBarcodeForAllRecords").'<br>';
$moretagsproduct1 = (($disabledproduct || $disabledproduct1) ? ' disabled title="'.dol_escape_htmltag($titleno).'"' : ''); $moretagsproduct1 = (($disabledproduct || $disabledproduct1) ? ' disabled title="'.dol_escape_htmltag($titleno).'"' : '');
print '<input type="submit" class="button" name="submitformbarcodeproductgen" id="submitformbarcodeproductgen" value="'.$langs->trans("InitEmptyBarCode", min($maxperinit, $nbno)).'"'.$moretagsproduct1.'>'; print '<input type="submit" class="button" name="submitformbarcodeproductgen" id="submitformbarcodeproductgen" value="'.$langs->trans("InitEmptyBarCode", min($maxperinit, $nbproductno)).'"'.$moretagsproduct1.'>';
$moretagsproduct2 = (($nbproductno == $nbproducttotal) ? ' disabled' : ''); $moretagsproduct2 = (($nbproductno == $nbproducttotal) ? ' disabled' : '');
print ' &nbsp; '; print ' &nbsp; ';
print '<input type="submit" class="button butActionDelete" name="eraseallproductbarcode" id="eraseallproductbarcode" value="'.$langs->trans("EraseAllCurrentBarCode").'"'.$moretagsproduct2.' onClick="return confirm_erase();">'; print '<input type="submit" class="button butActionDelete" name="eraseallproductbarcode" id="eraseallproductbarcode" value="'.$langs->trans("EraseAllCurrentBarCode").'"'.$moretagsproduct2.' onClick="return confirm_erase();">';

View File

@ -98,7 +98,7 @@ class BOM extends CommonObject
public $fields = array( public $fields = array(
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",), 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",),
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>5), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>5),
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1', 'csslist'=>'nowraponall'),
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'2', 'autofocusoncreate'=>1, 'css'=>'minwidth300 maxwidth400', 'csslist'=>'tdoverflowmax200'), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'2', 'autofocusoncreate'=>1, 'css'=>'minwidth300 maxwidth400', 'csslist'=>'tdoverflowmax200'),
'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth175', 'csslist'=>'minwidth175 center'), 'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth175', 'csslist'=>'minwidth175 center'),
//'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>32, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing')), //'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>32, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing')),

View File

@ -827,7 +827,7 @@ class Categorie extends CommonObject
/** /**
* Return list of fetched instance of elements having this category * Return list of fetched instance of elements having this category
* *
* @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member', 'knowledge_management' ...) * @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member', 'knowledge_management', ...)
* @param int $onlyids Return only ids of objects (consume less memory) * @param int $onlyids Return only ids of objects (consume less memory)
* @param int $limit Limit * @param int $limit Limit
* @param int $offset Offset * @param int $offset Offset
@ -1215,9 +1215,10 @@ class Categorie extends CommonObject
while ((empty($protection) || $i < $protection) && !empty($this->motherof[$cursor_categ])) { while ((empty($protection) || $i < $protection) && !empty($this->motherof[$cursor_categ])) {
//print '&nbsp; cursor_categ='.$cursor_categ.' i='.$i.' '.$this->motherof[$cursor_categ].'<br>'."\n"; //print '&nbsp; cursor_categ='.$cursor_categ.' i='.$i.' '.$this->motherof[$cursor_categ].'<br>'."\n";
$this->cats[$id_categ]['fullpath'] = '_'.$this->motherof[$cursor_categ].$this->cats[$id_categ]['fullpath']; $this->cats[$id_categ]['fullpath'] = '_'.$this->motherof[$cursor_categ].$this->cats[$id_categ]['fullpath'];
$this->cats[$id_categ]['fulllabel'] = $this->cats[$this->motherof[$cursor_categ]]['label'].' >> '.$this->cats[$id_categ]['fulllabel']; $this->cats[$id_categ]['fulllabel'] = (empty($this->cats[$this->motherof[$cursor_categ]]) ? 'NotFound' : $this->cats[$this->motherof[$cursor_categ]]['label']).' >> '.$this->cats[$id_categ]['fulllabel'];
//print '&nbsp; Result for id_categ='.$id_categ.' : '.$this->cats[$id_categ]['fullpath'].' '.$this->cats[$id_categ]['fulllabel'].'<br>'."\n"; //print '&nbsp; Result for id_categ='.$id_categ.' : '.$this->cats[$id_categ]['fullpath'].' '.$this->cats[$id_categ]['fulllabel'].'<br>'."\n";
$i++; $cursor_categ = $this->motherof[$cursor_categ]; $i++;
$cursor_categ = $this->motherof[$cursor_categ];
} }
//print 'Result for id_categ='.$id_categ.' : '.$this->cats[$id_categ]['fullpath'].'<br>'."\n"; //print 'Result for id_categ='.$id_categ.' : '.$this->cats[$id_categ]['fullpath'].'<br>'."\n";

View File

@ -381,7 +381,7 @@ if ($cats < 0) {
$fulltree = $categstatic->get_full_arbo($type, $object->id, 1); $fulltree = $categstatic->get_full_arbo($type, $object->id, 1);
// Load possible missing includes // Load possible missing includes
if ($conf->global->CATEGORY_SHOW_COUNTS) { if (getDolGlobalString('CATEGORY_SHOW_COUNTS')) {
if ($type == Categorie::TYPE_MEMBER) { if ($type == Categorie::TYPE_MEMBER) {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
} }
@ -407,11 +407,9 @@ if ($cats < 0) {
$desc = dol_htmlcleanlastbr($val['description']); $desc = dol_htmlcleanlastbr($val['description']);
$counter = ''; $counter = '';
if ($conf->global->CATEGORY_SHOW_COUNTS) { if (getDolGlobalString('CATEGORY_SHOW_COUNTS')) {
// we need only a count of the elements, so it is enough to consume only the id's from the database // we need only a count of the elements, so it is enough to consume only the id's from the database
$elements = $type == Categorie::TYPE_ACCOUNT $elements = $categstatic->getObjectsInCateg($type, 1);
? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account"
: $categstatic->getObjectsInCateg($type, 1);
$counter = "<td class='left' width='40px;'>".(is_array($elements) ? count($elements) : '0')."</td>"; $counter = "<td class='left' width='40px;'>".(is_array($elements) ? count($elements) : '0')."</td>";
} }
@ -1047,7 +1045,7 @@ if ($type == Categorie::TYPE_USER) {
print '<input type="hidden" name="action" value="addintocategory">'; print '<input type="hidden" name="action" value="addintocategory">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>'; print '<tr class="liste_titre"><td>';
print $langs->trans("AddProjectIntoCategory").' &nbsp;'; print $langs->trans("AddObjectIntoCategory").' &nbsp;';
print $form->select_dolusers('', 'elemid'); print $form->select_dolusers('', 'elemid');
print '<input type="submit" class="button buttongen" value="'.$langs->trans("ClassifyInCategory").'"></td>'; print '<input type="submit" class="button buttongen" value="'.$langs->trans("ClassifyInCategory").'"></td>';
print '</tr>'; print '</tr>';

View File

@ -409,9 +409,13 @@ if (empty($reshook) && $action == 'add') {
$error++; $error++;
} }
if (!$error) { if (!$error) {
$db->begin(); $db->begin();
// Creation of action/event // Creation of action/event
$idaction = $object->create($user); $idaction = $object->create($user);
@ -474,15 +478,15 @@ if (empty($reshook) && $action == 'add') {
$db->commit(); $db->commit();
} }
if (!empty($backtopage)) { // if (!empty($backtopage)) {
dol_syslog("Back to ".$backtopage.($moreparam ? (preg_match('/\?/', $backtopage) ? '&'.$moreparam : '?'.$moreparam) : '')); // dol_syslog("Back to ".$backtopage.($moreparam ? (preg_match('/\?/', $backtopage) ? '&'.$moreparam : '?'.$moreparam) : ''));
header("Location: ".$backtopage.($moreparam ? (preg_match('/\?/', $backtopage) ? '&'.$moreparam : '?'.$moreparam) : '')); // header("Location: ".$backtopage.($moreparam ? (preg_match('/\?/', $backtopage) ? '&'.$moreparam : '?'.$moreparam) : ''));
} elseif ($idaction) { // } elseif ($idaction) {
header("Location: ".DOL_URL_ROOT.'/comm/action/card.php?id='.$idaction.($moreparam ? '&'.$moreparam : '')); // header("Location: ".DOL_URL_ROOT.'/comm/action/card.php?id='.$idaction.($moreparam ? '&'.$moreparam : ''));
} else { // } else {
header("Location: ".DOL_URL_ROOT.'/comm/action/index.php'.($moreparam ? '?'.$moreparam : '')); // header("Location: ".DOL_URL_ROOT.'/comm/action/index.php'.($moreparam ? '?'.$moreparam : ''));
} // }
exit; // exit;
} else { } else {
// If error // If error
$db->rollback(); $db->rollback();
@ -496,6 +500,151 @@ if (empty($reshook) && $action == 'add') {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$action = 'create'; $donotclearsession = 1; $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( $arrayrecurrulefreq = array(
'no'=>$langs->trans("OnceOnly"), 'no'=>$langs->trans("OnceOnly"),
'MONTHLY'=>$langs->trans("EveryMonth"), 'MONTHLY'=>$langs->trans("EveryMonth"),
'WEEKLY'=>$langs->trans("EveryWeek"), 'WEEKLY'=>$langs->trans("EveryWeek")
//'DAYLY'=>$langs->trans("EveryDay") // 'DAILY'=>$langs->trans("EveryDay")
); );
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda'; $help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
llxHeader('', $langs->trans("Agenda"), $help_url); llxHeader('', $langs->trans("Agenda"), $help_url);
@ -1037,20 +1187,31 @@ if ($action == 'create') {
print ' &nbsp; &nbsp; &nbsp; &nbsp; <div class="opacitymedium inline-block">'; print ' &nbsp; &nbsp; &nbsp; &nbsp; <div class="opacitymedium inline-block">';
print img_picto($langs->trans("Recurrence"), 'recurring', 'class="paddingright2"'); print img_picto($langs->trans("Recurrence"), 'recurring', 'class="paddingright2"');
print '<input type="hidden" name="recurid" value="'.(empty($object->recurid) ? '' : $object->recurid).'">'; print '<input type="hidden" name="recurid" value="'.(empty($object->recurid) ? '' : $object->recurid).'">';
$selectedrecurrulefreq = 'no'; $selectedrecurrulefreq = 'no';
$selectedrecurrulebymonthday = ''; $selectedrecurrulebymonthday = '';
$selectedrecurrulebyday = ''; $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(); $reg = array();
if ($object->recurrule && preg_match('/FREQ=([A-Z]+)/i', $object->recurrule, $reg)) { if ($object->recurrule && preg_match('/FREQ=([A-Z]+)/i', $object->recurrule, $reg)) {
$selectedrecurrulefreq = $reg[1]; $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]; $selectedrecurrulebymonthday = $reg[1];
} }
if ($object->recurrule && preg_match('/FREQ=WEEKLY.*BYDAY(\d+)/i', $object->recurrule, $reg)) { if ($object->recurrule && preg_match('/FREQ=WEEKLY.*BYDAY(\d+)/i', $object->recurrule, $reg)) {
$selectedrecurrulebyday = $reg[1]; $selectedrecurrulebyday = $reg[1];
} }
print $form->selectarray('recurrulefreq', $arrayrecurrulefreq, $selectedrecurrulefreq, 0, 0, 0, '', 0, 0, 0, '', 'marginrightonly'); print $form->selectarray('recurrulefreq', $arrayrecurrulefreq, $selectedrecurrulefreq, 0, 0, 0, '', 0, 0, 0, '', 'marginrightonly');
// print '<script>console.log("recurrule: " +'.$object->recurrule.')</script>';
// For recursive event
// If recurrulefreq is MONTHLY // If recurrulefreq is MONTHLY
print '<div class="hidden marginrightonly inline-block repeateventBYMONTHDAY">'; print '<div class="hidden marginrightonly inline-block repeateventBYMONTHDAY">';
print $langs->trans("DayOfMonth").': <input type="input" size="2" name="BYMONTHDAY" value="'.$selectedrecurrulebymonthday.'">'; print $langs->trans("DayOfMonth").': <input type="input" size="2" name="BYMONTHDAY" value="'.$selectedrecurrulebymonthday.'">';
@ -1059,32 +1220,47 @@ if ($action == 'create') {
print '<div class="hidden marginrightonly inline-block repeateventBYDAY">'; print '<div class="hidden marginrightonly inline-block repeateventBYDAY">';
print $langs->trans("DayOfWeek").': <input type="input" size="4" name="BYDAY" value="'.$selectedrecurrulebyday.'">'; print $langs->trans("DayOfWeek").': <input type="input" size="4" name="BYDAY" value="'.$selectedrecurrulebyday.'">';
print '</div>'; print '</div>';
// limit date
$repeateventlimitdate = $repeateventlimitdate ? $repeateventlimitdate : '';
print '<div class="hidden marginrightonly inline-block repeateventlimitdate">';
print $langs->trans("Until")." ";
print $form->selectDate($repeateventlimitdate, 'limit', 0, 0, 0, "action", 1, 0, 0, '', '', '', '', 1, '', '', 'tzuserrel');
print '</div>';
print '<script type="text/javascript"> print '<script type="text/javascript">
jQuery(document).ready(function() { jQuery(document).ready(function() {
function init_repeat() function init_repeat()
{
console.log("recurrule: " + "'.$object->recurrule.'");
console.log("reg1: " + "'.$selectedrecurrulefreq.'");
console.log("reg2: " + "'.$selectedrecurrulebymonthday.'");
console.log("reg3: " + "'.$selectedrecurrulebyday.'");
console.log("selectedrulefreq: " + "'.$selectedrecurrulefreq.'");
if (jQuery("#recurrulefreq").val() == \'MONTHLY\')
{ {
if (jQuery("#recurrulefreq").val() == \'MONTHLY\') jQuery(".repeateventBYMONTHDAY").css("display", "inline-block"); /* use this instead of show because we want inline-block and not block */
{ jQuery(".repeateventlimitdate").css("display", "inline-block");
jQuery(".repeateventBYMONTHDAY").css("display", "inline-block"); /* use this instead of show because we want inline-block and not block */ jQuery(".repeateventBYDAY").hide();
jQuery(".repeateventBYDAY").hide();
}
else if (jQuery("#recurrulefreq").val() == \'WEEKLY\')
{
jQuery(".repeateventBYMONTHDAY").hide();
jQuery(".repeateventBYDAY").css("display", "inline-block"); /* use this instead of show because we want inline-block and not block */
}
else
{
jQuery(".repeateventBYMONTHDAY").hide();
jQuery(".repeateventBYDAY").hide();
}
} }
else if (jQuery("#recurrulefreq").val() == \'WEEKLY\')
{
jQuery(".repeateventBYMONTHDAY").hide();
jQuery(".repeateventBYDAY").css("display", "inline-block"); /* use this instead of show because we want inline-block and not block */
jQuery(".repeateventlimitdate").css("display", "inline-block");
}
else
{
jQuery(".repeateventBYMONTHDAY").hide();
jQuery(".repeateventBYDAY").hide();
jQuery(".repeateventlimitdate").hide();
}
}
init_repeat();
jQuery("#recurrulefreq").change(function() {
init_repeat(); init_repeat();
jQuery("#recurrulefreq").change(function() {
init_repeat();
});
}); });
</script>'; });
</script>';
print '</div>'; print '</div>';
//print '</td></tr>'; //print '</td></tr>';
} }
@ -1545,64 +1721,64 @@ if ($id > 0) {
print '<tr><td><span class="fieldrequired">'.$langs->trans("Date").'</span></td><td colspan="3" class="valignmiddle height30 small"><input type="checkbox" id="fullday" name="fullday" '.($object->fulldayevent ? ' checked' : '').'>'; print '<tr><td><span class="fieldrequired">'.$langs->trans("Date").'</span></td><td colspan="3" class="valignmiddle height30 small"><input type="checkbox" id="fullday" name="fullday" '.($object->fulldayevent ? ' checked' : '').'>';
print '<label for="fullday">'.$langs->trans("EventOnFullDay").'</label>'; print '<label for="fullday">'.$langs->trans("EventOnFullDay").'</label>';
// Recurring event // // Recurring event
$userepeatevent = ($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0); // $userepeatevent = ($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0);
if ($userepeatevent) { // if ($userepeatevent) {
// Repeat // // Repeat
//print '<tr><td></td><td colspan="3">'; // //print '<tr><td></td><td colspan="3">';
print ' &nbsp; &nbsp; &nbsp; &nbsp; <div class="opacitymedium inline-block">'; // print ' &nbsp; &nbsp; &nbsp; &nbsp; <div class="opacitymedium inline-block">';
print img_picto($langs->trans("Recurrence"), 'recurring', 'class="paddingright2"'); // print img_picto($langs->trans("Recurrence"), 'recurring', 'class="paddingright2"');
print '<input type="hidden" name="recurid" value="'.$object->recurid.'">'; // print '<input type="hidden" name="recurid" value="'.$object->recurid.'">';
$selectedrecurrulefreq = 'no'; // $selectedrecurrulefreq = 'no';
$selectedrecurrulebymonthday = ''; // $selectedrecurrulebymonthday = '';
$selectedrecurrulebyday = ''; // $selectedrecurrulebyday = '';
if ($object->recurrule && preg_match('/FREQ=([A-Z]+)/i', $object->recurrule, $reg)) { // if ($object->recurrule && preg_match('/FREQ=([A-Z]+)/i', $object->recurrule, $reg)) {
$selectedrecurrulefreq = $reg[1]; // $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]; // $selectedrecurrulebymonthday = $reg[1];
} // }
if ($object->recurrule && preg_match('/FREQ=WEEKLY.*BYDAY(\d+)/i', $object->recurrule, $reg)) { // if ($object->recurrule && preg_match('/FREQ=WEEKLY.*BYDAY(\d+)/i', $object->recurrule, $reg)) {
$selectedrecurrulebyday = $reg[1]; // $selectedrecurrulebyday = $reg[1];
} // }
print $form->selectarray('recurrulefreq', $arrayrecurrulefreq, $selectedrecurrulefreq, 0, 0, 0, '', 0, 0, 0, '', 'marginrightonly'); // print $form->selectarray('recurrulefreq', $arrayrecurrulefreq, $selectedrecurrulefreq, 0, 0, 0, '', 0, 0, 0, '', 'marginrightonly');
// If recurrulefreq is MONTHLY // // If recurrulefreq is MONTHLY
print '<div class="hidden marginrightonly inline-block repeateventBYMONTHDAY">'; // print '<div class="hidden marginrightonly inline-block repeateventBYMONTHDAY">';
print $langs->trans("DayOfMonth").': <input type="input" size="2" name="BYMONTHDAY" value="'.$selectedrecurrulebymonthday.'">'; // print $langs->trans("DayOfMonth").': <input type="input" size="2" name="BYMONTHDAY" value="'.$selectedrecurrulebymonthday.'">';
print '</div>'; // print '</div>';
// If recurrulefreq is WEEKLY // // If recurrulefreq is WEEKLY
print '<div class="hidden marginrightonly inline-block repeateventBYDAY">'; // print '<div class="hidden marginrightonly inline-block repeateventBYDAY">';
print $langs->trans("DayOfWeek").': <input type="input" size="4" name="BYDAY" value="'.$selectedrecurrulebyday.'">'; // print $langs->trans("DayOfWeek").': <input type="input" size="4" name="BYDAY" value="'.$selectedrecurrulebyday.'">';
print '</div>'; // print '</div>';
print '<script type="text/javascript"> // print '<script type="text/javascript">
jQuery(document).ready(function() { // jQuery(document).ready(function() {
function init_repeat() // function init_repeat()
{ // {
if (jQuery("#recurrulefreq").val() == \'MONTHLY\') // if (jQuery("#recurrulefreq").val() == \'MONTHLY\')
{ // {
jQuery(".repeateventBYMONTHDAY").css("display", "inline-block"); /* use this instead of show because we want inline-block and not block */ // jQuery(".repeateventBYMONTHDAY").css("display", "inline-block"); /* use this instead of show because we want inline-block and not block */
jQuery(".repeateventBYDAY").hide(); // jQuery(".repeateventBYDAY").hide();
} // }
else if (jQuery("#recurrulefreq").val() == \'WEEKLY\') // else if (jQuery("#recurrulefreq").val() == \'WEEKLY\')
{ // {
jQuery(".repeateventBYMONTHDAY").hide(); // jQuery(".repeateventBYMONTHDAY").hide();
jQuery(".repeateventBYDAY").css("display", "inline-block"); /* use this instead of show because we want inline-block and not block */ // jQuery(".repeateventBYDAY").css("display", "inline-block"); /* use this instead of show because we want inline-block and not block */
} // }
else // else
{ // {
jQuery(".repeateventBYMONTHDAY").hide(); // jQuery(".repeateventBYMONTHDAY").hide();
jQuery(".repeateventBYDAY").hide(); // jQuery(".repeateventBYDAY").hide();
} // }
} // }
init_repeat(); // init_repeat();
jQuery("#recurrulefreq").change(function() { // jQuery("#recurrulefreq").change(function() {
init_repeat(); // init_repeat();
}); // });
}); // });
</script>'; // </script>';
print '</div>'; // print '</div>';
//print '</td></tr>'; // //print '</td></tr>';
} // }
print '</td></tr>'; print '</td></tr>';
// Date start - end // Date start - end
@ -1903,13 +2079,22 @@ if ($id > 0) {
} else { } else {
print dol_get_fiche_head($head, 'card', $langs->trans("Action"), -1, 'action'); print dol_get_fiche_head($head, 'card', $langs->trans("Action"), -1, 'action');
$formconfirm = '';
// Clone event // Clone event
if ($action == 'clone') { if ($action == 'clone') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.GETPOST('id'), $langs->trans('ToClone'), $langs->trans('ConfirmCloneEvent', $object->label), 'confirm_clone', $formquestion, 'yes', 1); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.GETPOST('id'), $langs->trans('ToClone'), $langs->trans('ConfirmCloneEvent', $object->label), 'confirm_clone', array(), 'yes', 1);
print $formconfirm;
} }
// Call Hook formConfirm
$parameters = array();
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
// Print form confirm
print $formconfirm;
$linkback = ''; $linkback = '';
// Link to other agenda views // Link to other agenda views
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1">'; $linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1">';

View File

@ -285,17 +285,17 @@ class ActionComm extends CommonObject
// Properties for links to other objects // Properties for links to other objects
/** /**
* @var int Id of linked object * @var int Id of linked object
*/ */
public $fk_element; // Id of record public $fk_element; // Id of record
/** /**
* @var int Id of record alternative for API * @var int Id of record alternative for API
*/ */
public $elementid; public $elementid;
/** /**
* @var string Type of record. This if property ->element of object linked to. * @var string Type of record. This if property ->element of object linked to.
*/ */
public $elementtype; public $elementtype;
@ -1558,13 +1558,13 @@ class ActionComm extends CommonObject
} }
$canread = 0; $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 $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 $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 $canread = 1; // Can read all event of other
} }
if (!$canread) { if (!$canread) {
@ -2093,8 +2093,8 @@ class ActionComm extends CommonObject
} }
if (!empty($conf->global->AGENDA_EXPORT_FIX_TZ)) { if (!empty($conf->global->AGENDA_EXPORT_FIX_TZ)) {
$timestampStart = - ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600); $timestampStart = $timestampStart - ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600);
$timestampEnd = - ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600); $timestampEnd = $timestampEnd - ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600);
} }
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));

View File

@ -111,7 +111,7 @@ $month = GETPOST("month", "int") ?GETPOST("month", "int") : date("m");
$week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W"); $week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W");
$day = GETPOST("day", "int") ?GETPOST("day", "int") : date("d"); $day = GETPOST("day", "int") ?GETPOST("day", "int") : date("d");
$pid = GETPOST("search_projectid", "int", 3) ? GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3); $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'); $type = GETPOSTISSET("search_type") ? GETPOST("search_type", 'aZ09') : GETPOST("type", 'aZ09');
$maxprint = GETPOSTISSET("maxprint") ? GETPOST("maxprint", 'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW; $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') $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
@ -759,12 +759,14 @@ if ($type) {
if ($status == '0') { if ($status == '0') {
$sql .= " AND a.percent = 0"; $sql .= " AND a.percent = 0";
} }
if ($status == '-1') { if ($status == '-1' || $status == 'na') {
// Not applicable
$sql .= " AND a.percent = -1"; $sql .= " AND a.percent = -1";
} // Not applicable }
if ($status == '50') { if ($status == '50') {
// Running already started
$sql .= " AND (a.percent > 0 AND a.percent < 100)"; $sql .= " AND (a.percent > 0 AND a.percent < 100)";
} // Running already started }
if ($status == 'done' || $status == '100') { if ($status == 'done' || $status == '100') {
$sql .= " AND (a.percent = 100)"; $sql .= " AND (a.percent = 100)";
} }

View File

@ -101,7 +101,7 @@ $month = GETPOST("month", "int") ?GETPOST("month", "int") : date("m");
$week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W"); $week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W");
$day = GETPOST("day", "int") ?GETPOST("day", "int") : date("d"); $day = GETPOST("day", "int") ?GETPOST("day", "int") : date("d");
$pid = GETPOSTISSET("search_projectid") ? GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3); $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'); $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); $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') $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
@ -627,12 +627,14 @@ if ($type) {
if ($status == '0') { if ($status == '0') {
$sql .= " AND a.percent = 0"; $sql .= " AND a.percent = 0";
} }
if ($status == '-1') { if ($status == '-1' || $status == 'na') {
// Not applicable
$sql .= " AND a.percent = -1"; $sql .= " AND a.percent = -1";
} // Not applicable }
if ($status == '50') { if ($status == '50') {
// Running already started
$sql .= " AND (a.percent > 0 AND a.percent < 100)"; $sql .= " AND (a.percent > 0 AND a.percent < 100)";
} // Running already started }
if ($status == 'done' || $status == '100') { if ($status == 'done' || $status == '100') {
$sql .= " AND (a.percent = 100)"; $sql .= " AND (a.percent = 100)";
} }

View File

@ -914,8 +914,10 @@ if ($object->id > 0) {
* Latest orders * Latest orders
*/ */
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
$param ="";
$sql = "SELECT s.nom, s.rowid"; $sql = "SELECT s.nom, s.rowid";
$sql .= ", c.rowid as cid, c.total_ht"; $sql .= ", c.rowid as cid, c.entity, c.total_ht";
$sql .= ", c.total_tva"; $sql .= ", c.total_tva";
$sql .= ", c.total_ttc"; $sql .= ", c.total_ttc";
$sql .= ", c.ref, c.ref_client, c.fk_statut, c.facture"; $sql .= ", c.ref, c.ref_client, c.fk_statut, c.facture";
@ -1024,7 +1026,7 @@ if ($object->id > 0) {
*/ */
if (!empty($conf->expedition->enabled) && $user->rights->expedition->lire) { if (!empty($conf->expedition->enabled) && $user->rights->expedition->lire) {
$sql = 'SELECT e.rowid as id'; $sql = 'SELECT e.rowid as id';
$sql .= ', e.ref'; $sql .= ', e.ref, e.entity';
$sql .= ', e.date_creation'; $sql .= ', e.date_creation';
$sql .= ', e.fk_statut as statut'; $sql .= ', e.fk_statut as statut';
$sql .= ', s.nom'; $sql .= ', s.nom';
@ -1033,7 +1035,7 @@ if ($object->id > 0) {
$sql .= " WHERE e.fk_soc = s.rowid AND s.rowid = ".((int) $object->id); $sql .= " WHERE e.fk_soc = s.rowid AND s.rowid = ".((int) $object->id);
$sql .= " AND e.entity IN (".getEntity('expedition').")"; $sql .= " AND e.entity IN (".getEntity('expedition').")";
$sql .= ' GROUP BY e.rowid'; $sql .= ' GROUP BY e.rowid';
$sql .= ', e.ref'; $sql .= ', e.ref, e.entity';
$sql .= ', e.date_creation'; $sql .= ', e.date_creation';
$sql .= ', e.fk_statut'; $sql .= ', e.fk_statut';
$sql .= ', s.nom'; $sql .= ', s.nom';

View File

@ -801,13 +801,20 @@ if ($action == 'create') {
// MAILING_NO_USING_PHPMAIL may be defined or not. // MAILING_NO_USING_PHPMAIL may be defined or not.
// MAILING_LIMIT_SENDBYWEB is always defined to something != 0 (-1=forbidden). // MAILING_LIMIT_SENDBYWEB is always defined to something != 0 (-1=forbidden).
// MAILING_LIMIT_SENDBYCLI may be defined ot not (-1=forbidden, 0 or undefined=no limit). // MAILING_LIMIT_SENDBYCLI may be defined ot not (-1=forbidden, 0 or undefined=no limit).
// MAILING_LIMIT_SENDBYDAY may be defined ot not (0 or undefined=no limit).
if (!empty($conf->global->MAILING_NO_USING_PHPMAIL) && $sendingmode == 'mail') { if (!empty($conf->global->MAILING_NO_USING_PHPMAIL) && $sendingmode == 'mail') {
// EMailing feature may be a spam problem, so when you host several users/instance, having this option may force each user to use their own SMTP agent. // EMailing feature may be a spam problem, so when you host several users/instance, having this option may force each user to use their own SMTP agent.
// You ensure that every user is using its own SMTP server when using the mass emailing module. // You ensure that every user is using its own SMTP server when using the mass emailing module.
$linktoadminemailbefore = '<a href="'.DOL_URL_ROOT.'/admin/mails_emailing.php">'; $linktoadminemailbefore = '<a href="'.DOL_URL_ROOT.'/admin/mails_emailing.php">';
$linktoadminemailend = '</a>'; $linktoadminemailend = '</a>';
setEventMessages($langs->trans("MailSendSetupIs", $listofmethods[$sendingmode]), null, 'warnings'); setEventMessages($langs->trans("MailSendSetupIs", $listofmethods[$sendingmode]), null, 'warnings');
setEventMessages($langs->trans("MailSendSetupIs2", $linktoadminemailbefore, $linktoadminemailend, $langs->transnoentitiesnoconv("MAIN_MAIL_SENDMODE"), $listofmethods['smtps']), null, 'warnings'); $messagetoshow = $langs->trans("MailSendSetupIs2", '{s1}', '{s2}', '{s3}', '{s4}');
$messagetoshow = str_replace('{s1}', $linktoadminemailbefore, $messagetoshow);
$messagetoshow = str_replace('{s2}', $linktoadminemailend, $messagetoshow);
$messagetoshow = str_replace('{s3}', $langs->transnoentitiesnoconv("MAIN_MAIL_SENDMODE"), $messagetoshow);
$messagetoshow = str_replace('{s4}', $listofmethods['smtps'], $messagetoshow);
setEventMessages($messagetoshow, null, 'warnings');
if (!empty($conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS)) { if (!empty($conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS)) {
setEventMessages($langs->trans("MailSendSetupIs3", $conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS), null, 'warnings'); setEventMessages($langs->trans("MailSendSetupIs3", $conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS), null, 'warnings');
} }
@ -836,14 +843,21 @@ if ($action == 'create') {
} }
$text = ''; $text = '';
if (!isset($conf->global->MAILING_LIMIT_SENDBYCLI) || $conf->global->MAILING_LIMIT_SENDBYCLI >= 0) {
$text .= $langs->trans("MailingNeedCommand"); if (isset($conf->global->MAILING_LIMIT_SENDBYDAY) && $conf->global->MAILING_LIMIT_SENDBYDAY >= 0) {
$text .= '<br><textarea cols="60" rows="'.ROWS_2.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.' '.$user->login.'</textarea>'; $text .= $langs->trans('WarningLimitSendByDay', $conf->global->MAILING_LIMIT_SENDBYDAY);
$text .= '<br><br>'; $text .= '<br><br>';
} }
$text .= $langs->trans('ConfirmSendingEmailing').'<br>'; $text .= $langs->trans('ConfirmSendingEmailing').'<br>';
$text .= $langs->trans('LimitSendingEmailing', $conf->global->MAILING_LIMIT_SENDBYWEB); $text .= $langs->trans('LimitSendingEmailing', $conf->global->MAILING_LIMIT_SENDBYWEB);
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans('SendMailing'), $text, 'sendallconfirmed', '', '', 1, 330, 600);
if (!isset($conf->global->MAILING_LIMIT_SENDBYCLI) || $conf->global->MAILING_LIMIT_SENDBYCLI >= 0) {
$text .= '<br><br>';
$text .= $langs->trans("MailingNeedCommand");
$text .= '<br><textarea cols="60" rows="'.ROWS_2.'" wrap="soft" disabled>php ./scripts/emailings/mailing-send.php '.$object->id.' '.$user->login.'</textarea>';
}
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans('SendMailing'), $text, 'sendallconfirmed', '', '', 1, 330, 600, 0, $langs->trans("Confirm"), $langs->trans("Cancel"));
} }
} }

View File

@ -41,7 +41,7 @@ class AdvanceTargetingMailing extends CommonObject
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
public $table_element = 'advtargetemailing'; public $table_element = 'mailing_advtarget';
/** /**
* @var int ID * @var int ID
@ -159,7 +159,7 @@ class AdvanceTargetingMailing extends CommonObject
// Put here code to add control on parameters values // Put here code to add control on parameters values
// Insert request // Insert request
$sql = "INSERT INTO ".MAIN_DB_PREFIX."advtargetemailing("; $sql = "INSERT INTO ".MAIN_DB_PREFIX."mailing_advtarget(";
$sql .= "name,"; $sql .= "name,";
$sql .= "entity,"; $sql .= "entity,";
$sql .= "fk_element,"; $sql .= "fk_element,";
@ -188,7 +188,7 @@ class AdvanceTargetingMailing extends CommonObject
} }
if (!$error) { if (!$error) {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."advtargetemailing"); $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."mailing_advtarget");
} }
// Commit or rollback // Commit or rollback
@ -227,7 +227,7 @@ class AdvanceTargetingMailing extends CommonObject
$sql .= " t.fk_user_mod,"; $sql .= " t.fk_user_mod,";
$sql .= " t.tms"; $sql .= " t.tms";
$sql .= " FROM ".MAIN_DB_PREFIX."advtargetemailing as t"; $sql .= " FROM ".MAIN_DB_PREFIX."mailing_advtarget as t";
$sql .= " WHERE t.rowid = ".((int) $id); $sql .= " WHERE t.rowid = ".((int) $id);
dol_syslog(get_class($this)."::fetch", LOG_DEBUG); dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
@ -282,7 +282,7 @@ class AdvanceTargetingMailing extends CommonObject
$sql .= " t.fk_user_mod,"; $sql .= " t.fk_user_mod,";
$sql .= " t.tms"; $sql .= " t.tms";
$sql .= " FROM ".MAIN_DB_PREFIX."advtargetemailing as t"; $sql .= " FROM ".MAIN_DB_PREFIX."mailing_advtarget as t";
if (!empty($id)) { if (!empty($id)) {
$sql .= " WHERE t.fk_element = ".((int) $id)." AND type_element = 'mailing'"; $sql .= " WHERE t.fk_element = ".((int) $id)." AND type_element = 'mailing'";
} else { } else {
@ -345,7 +345,7 @@ class AdvanceTargetingMailing extends CommonObject
$sql .= " t.fk_user_mod,"; $sql .= " t.fk_user_mod,";
$sql .= " t.tms"; $sql .= " t.tms";
$sql .= " FROM ".MAIN_DB_PREFIX."advtargetemailing as t"; $sql .= " FROM ".MAIN_DB_PREFIX."mailing_advtarget as t";
if (!empty($id)) { if (!empty($id)) {
$sql .= " WHERE t.fk_element = ".((int) $id)." AND type_element = '".$this->db->escape($type_element)."'"; $sql .= " WHERE t.fk_element = ".((int) $id)." AND type_element = '".$this->db->escape($type_element)."'";
} else { } else {
@ -410,7 +410,7 @@ class AdvanceTargetingMailing extends CommonObject
// Put here code to add a control on parameters values // Put here code to add a control on parameters values
// Update request // Update request
$sql = "UPDATE ".MAIN_DB_PREFIX."advtargetemailing SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."mailing_advtarget SET";
$sql .= " name=".(isset($this->name) ? "'".$this->db->escape($this->name)."'" : "''").","; $sql .= " name=".(isset($this->name) ? "'".$this->db->escape($this->name)."'" : "''").",";
$sql .= " entity=".$conf->entity.","; $sql .= " entity=".$conf->entity.",";
@ -458,7 +458,7 @@ class AdvanceTargetingMailing extends CommonObject
$this->db->begin(); $this->db->begin();
if (!$error) { if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."advtargetemailing"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing_advtarget";
$sql .= " WHERE rowid=".((int) $this->id); $sql .= " WHERE rowid=".((int) $this->id);
dol_syslog(get_class($this)."::delete sql=".$sql); dol_syslog(get_class($this)."::delete sql=".$sql);

View File

@ -277,7 +277,7 @@ if ($resql) {
print '</td>'; print '</td>';
// Title // Title
print '<td>'.$obj->title.'</td>'; print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->title).'">'.dol_escape_htmltag($obj->title).'</td>';
// Date creation // Date creation
print '<td class="center">'; print '<td class="center">';
@ -286,7 +286,7 @@ if ($resql) {
// Nb of email // Nb of email
if (!$filteremail) { if (!$filteremail) {
print '<td class="center">'; print '<td class="center nowraponall">';
$nbemail = $obj->nbemail; $nbemail = $obj->nbemail;
/*if ($obj->statut != 3 && !empty($conf->global->MAILING_LIMIT_SENDBYWEB) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail) /*if ($obj->statut != 3 && !empty($conf->global->MAILING_LIMIT_SENDBYWEB) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail)
{ {

View File

@ -108,16 +108,18 @@ $extrafields->fetch_name_optionals_label($object->table_element);
// Load object // Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
$usercanread = $user->rights->commande->lire; $usercanread = $user->hasRight('commande', 'lire');
$usercancreate = $user->rights->commande->creer; $usercancreate = $user->hasRight('commande', 'creer');
$usercandelete = $user->rights->commande->supprimer; $usercandelete = $user->hasRight('commande', 'supprimer');
// Advanced permissions // 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 $permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php $permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php
@ -2747,7 +2749,7 @@ if ($action == 'create' && $usercancreate) {
$langs->load("interventions"); $langs->load("interventions");
if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0) { 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&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid, ''); print dolGetButtonAction('', $langs->trans('AddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid, '');
} else { } else {
print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('AddIntervention'), 'default', $_SERVER['PHP_SELF']. '#', '', false); 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)) { if (!empty($conf->contrat->enabled) && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)) {
$langs->load("contracts"); $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&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid, ''); print dolGetButtonAction('', $langs->trans('AddContract'), 'default', DOL_URL_ROOT.'/contrat/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;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 ($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 ((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, ''); print dolGetButtonAction('', $langs->trans('CreateShipment'), 'default', DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id, '');
} else { } else {
print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF']. '#', '', false); 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 // Create bill and Classify billed
// Note: Even if module invoice is not enabled, we should be able to use button "Classified 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 ($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&amp;token='.newToken().'&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid, ''); print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&amp;token='.newToken().'&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;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)) { if ($usercancreate && $object->statut >= Commande::STATUS_VALIDATED && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) {

View File

@ -1217,7 +1217,7 @@ if ($resql) {
if ($permissiontocancel) { if ($permissiontocancel) {
$arrayofmassactions['cancelorders'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Cancel"); $arrayofmassactions['cancelorders'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Cancel");
} }
if ($user->rights->facture->creer) { if (!empty($conf->invoice->enabled) && $user->rights->facture->creer) {
$arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisCustomer"); $arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisCustomer");
} }
if ($permissiontoclose) { if ($permissiontoclose) {

View File

@ -2390,7 +2390,7 @@ class AccountLine extends CommonObject
$result = ''; $result = '';
$label = img_picto('', $this->picto).' <u>'.$langs->trans("Transaction").'</u>:<br>'; $label = img_picto('', $this->picto).' <u>'.$langs->trans("BankTransactionLine").'</u>:<br>';
$label .= '<b>'.$langs->trans("Ref").':</b> '.$this->ref; $label .= '<b>'.$langs->trans("Ref").':</b> '.$this->ref;
$linkstart = '<a href="'.DOL_URL_ROOT.'/compta/bank/line.php?rowid='.((int) $this->id).'&save_lastsearch_values=1" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; $linkstart = '<a href="'.DOL_URL_ROOT.'/compta/bank/line.php?rowid='.((int) $this->id).'&save_lastsearch_values=1" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';

View File

@ -606,45 +606,20 @@ class PaymentVarious extends CommonObject
public function LibStatut($status, $mode = 0) public function LibStatut($status, $mode = 0)
{ {
// phpcs:enable // phpcs:enable
global $langs; if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
global $langs;
if ($mode == 0) { //$langs->load("mymodule@mymodule");
return $langs->trans($this->statuts[$status]); /*$this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft');
} elseif ($mode == 1) { $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled');
return $langs->trans($this->statuts_short[$status]); $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled');
} elseif ($mode == 2) { $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft');
if ($status == 0) { $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled');
return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts_short[$status]); $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled');*/
} elseif ($status == 1) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts_short[$status]);
} elseif ($status == 2) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts_short[$status]);
}
} elseif ($mode == 3) {
if ($status == 0 && !empty($this->statuts_short[$status])) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut0');
} elseif ($status == 1 && !empty($this->statuts_short[$status])) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut4');
} elseif ($status == 2 && !empty($this->statuts_short[$status])) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
}
} elseif ($mode == 4) {
if ($status == 0 && !empty($this->statuts_short[$status])) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts[$status]);
} elseif ($status == 1 && !empty($this->statuts_short[$status])) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts[$status]);
} elseif ($status == 2 && !empty($this->statuts_short[$status])) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]);
}
} elseif ($mode == 5) {
if ($status == 0 && !empty($this->statuts_short[$status])) {
return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut0');
} elseif ($status == 1 && !empty($this->statuts_short[$status])) {
return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut4');
} elseif ($status == 2 && !empty($this->statuts_short[$status])) {
return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
}
} }
$statusType = 'status'.$status;
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
} }

View File

@ -588,6 +588,8 @@ if ($id) {
$morehtmlref .= '</div>'; $morehtmlref .= '</div>';
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/various_payment/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/various_payment/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$morehtmlright = '';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright); dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
print '<div class="fichecenter">'; print '<div class="fichecenter">';
@ -617,7 +619,7 @@ if ($id) {
} }
print '<tr><td>'.$langs->trans("Sens").'</td><td>'.$sens.'</td></tr>'; print '<tr><td>'.$langs->trans("Sens").'</td><td>'.$sens.'</td></tr>';
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>'; print '<tr><td>'.$langs->trans("Amount").'</td><td><span class="amount">'.price($object->amount, 0, $langs, 1, -1, -1, $conf->currency).'</span></td></tr>';
// Accountancy code // Accountancy code
print '<tr><td class="nowrap">'; print '<tr><td class="nowrap">';

View File

@ -537,6 +537,8 @@ if ($resql) {
$totalarray = array(); $totalarray = array();
$totalarray['nbfield'] = 0; $totalarray['nbfield'] = 0;
$totalarray['val']['total_cred'] = 0; $totalarray['val']['total_cred'] = 0;
$totalarray['val']['total_deb'] = 0;
while ($i < min($num, $limit)) { while ($i < min($num, $limit)) {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);

View File

@ -1,6 +1,4 @@
<?php <?php
use Stripe\ApiOperations\Delete;
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2009-2012 Regis Houssin <regis.houssin@inodbox.com>
@ -102,6 +100,8 @@ class Deplacement extends CommonObject
public $statuts = array(); public $statuts = array();
public $statuts_short = array(); public $statuts_short = array();
public $statuts_logo = array();
/** /**
* Draft status * Draft status
@ -129,6 +129,7 @@ class Deplacement extends CommonObject
$this->statuts_short = array(0 => 'Draft', 1 => 'Validated', 2 => 'Refunded'); $this->statuts_short = array(0 => 'Draft', 1 => 'Validated', 2 => 'Refunded');
$this->statuts = array(0 => 'Draft', 1 => 'Validated', 2 => 'Refunded'); $this->statuts = array(0 => 'Draft', 1 => 'Validated', 2 => 'Refunded');
$this->statuts_logo = array(0 => 'status0', 1=>'status4', 2 => 'status1', 4 => 'status6', 5 => 'status4', 6 => 'status6', 99 => 'status5');
} }
/** /**
@ -360,43 +361,12 @@ class Deplacement extends CommonObject
// phpcs:enable // phpcs:enable
global $langs; global $langs;
if ($mode == 0) { $labelStatus = $langs->transnoentitiesnoconv($this->statuts[$status]);
return $langs->trans($this->statuts[$status]); $labelStatusShort = $langs->transnoentitiesnoconv($this->statuts_short[$status]);
} elseif ($mode == 1) {
return $langs->trans($this->statuts_short[$status]); $statusType = $this->statuts_logo[$status];
} elseif ($mode == 2) {
if ($status == 0) { return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode);
return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts_short[$status]);
} elseif ($status == 1) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts_short[$status]);
} elseif ($status == 2) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts_short[$status]);
}
} elseif ($mode == 3) {
if ($status == 0 && !empty($this->statuts_short[$status])) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut0');
} elseif ($status == 1 && !empty($this->statuts_short[$status])) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut4');
} elseif ($status == 2 && !empty($this->statuts_short[$status])) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
}
} elseif ($mode == 4) {
if ($status == 0 && !empty($this->statuts_short[$status])) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts[$status]);
} elseif ($status == 1 && !empty($this->statuts_short[$status])) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts[$status]);
} elseif ($status == 2 && !empty($this->statuts_short[$status])) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]);
}
} elseif ($mode == 5) {
if ($status == 0 && !empty($this->statuts_short[$status])) {
return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut0');
} elseif ($status == 1 && !empty($this->statuts_short[$status])) {
return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut4');
} elseif ($status == 2 && !empty($this->statuts_short[$status])) {
return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
}
}
} }
/** /**

View File

@ -668,6 +668,8 @@ class Invoices extends DolibarrApi
$result = $this->invoice->delete(DolibarrApiAccess::$user); $result = $this->invoice->delete(DolibarrApiAccess::$user);
if ($result < 0) { if ($result < 0) {
throw new RestException(500, 'Error when deleting invoice'); throw new RestException(500, 'Error when deleting invoice');
} elseif ($result == 0) {
throw new RestException(403, 'Invoice not erasable');
} }
return array( return array(

View File

@ -5603,6 +5603,9 @@ class Facture extends CommonInvoice
//$actioncomm->email_subject = $subject; //$actioncomm->email_subject = $subject;
$actioncomm->errors_to = $errors_to; $actioncomm->errors_to = $errors_to;
$actioncomm->elementtype = 'invoice';
$actioncomm->fk_element = $tmpinvoice->id;
//$actioncomm->extraparams = $extraparams; //$actioncomm->extraparams = $extraparams;
$actioncomm->create($user); $actioncomm->create($user);

View File

@ -57,6 +57,7 @@ class Paiement extends CommonObject
public $facid; public $facid;
public $datepaye; public $datepaye;
public $date; // same than $datepaye
/** /**
* @deprecated * @deprecated
@ -153,6 +154,7 @@ class Paiement extends CommonObject
*/ */
public $ref_ext; public $ref_ext;
/** /**
* Constructor * Constructor
* *

View File

@ -1,8 +1,9 @@
<?php <?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010-2018 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2018 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -108,7 +109,7 @@ llxHeader('', $langs->trans("WithdrawalsLines"));
$sql = "SELECT p.rowid, p.ref, p.statut as status, p.datec"; $sql = "SELECT p.rowid, p.ref, p.statut as status, p.datec";
$sql .= " , f.rowid as facid, f.ref as invoiceref, f.total_ttc"; $sql .= " , f.rowid as facid, f.ref as invoiceref, f.total_ttc";
$sql .= " , s.rowid as socid, s.nom as name, s.code_client, s.email"; $sql .= " , s.rowid as socid, s.nom as name, s.code_client, s.code_fournisseur, s.email";
$sql .= " , pl.amount, pl.statut as statut_ligne, pl.rowid as rowid_ligne"; $sql .= " , pl.amount, pl.statut as statut_ligne, pl.rowid as rowid_ligne";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl"; $sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
@ -139,7 +140,7 @@ if ($search_bon) {
} }
if ($type == 'bank-transfer') { if ($type == 'bank-transfer') {
if ($search_code) { if ($search_code) {
$sql .= natural_search("s.code_fourn", $search_code); $sql .= natural_search("s.code_fournisseur", $search_code);
} }
} else { } else {
if ($search_code) { if ($search_code) {
@ -172,6 +173,9 @@ if ($result) {
$param = "&amp;statut=".urlencode($statut); $param = "&amp;statut=".urlencode($statut);
$param .= "&amp;search_bon=".urlencode($search_bon); $param .= "&amp;search_bon=".urlencode($search_bon);
if ($type == 'bank-transfer') {
$param .= '&amp;type=bank-transfer';
}
if ($limit > 0 && $limit != $conf->liste_limit) { if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.urlencode($limit); $param .= '&limit='.urlencode($limit);
} }
@ -204,7 +208,7 @@ if ($result) {
print '<td class="liste_titre"><input type="text" class="flat" name="search_bon" value="'.dol_escape_htmltag($search_bon).'" size="6"></td>'; print '<td class="liste_titre"><input type="text" class="flat" name="search_bon" value="'.dol_escape_htmltag($search_bon).'" size="6"></td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre"><input type="text" class="flat" name="search_company" value="'.dol_escape_htmltag($search_company).'" size="6"></td>'; print '<td class="liste_titre"><input type="text" class="flat" name="search_company" value="'.dol_escape_htmltag($search_company).'" size="6"></td>';
print '<td class="liste_titre" align="center"><input type="text" class="flat" name="search_code" value="'.dol_escape_htmltag($search_code).'" size="6"></td>'; print '<td class="liste_titre center"><input type="text" class="flat" name="search_code" value="'.dol_escape_htmltag($search_code).'" size="6"></td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre maxwidthsearch">'; print '<td class="liste_titre maxwidthsearch">';
@ -214,8 +218,12 @@ if ($result) {
print '</tr>'; print '</tr>';
$columntitle = "WithdrawalsReceipts"; $columntitle = "WithdrawalsReceipts";
$columntitlethirdparty = "CustomerCode";
$columncodethirdparty = "s.code_client";
if ($type == 'bank-transfer') { if ($type == 'bank-transfer') {
$columntitle = "BankTransferReceipts"; $columntitle = "BankTransferReceipts";
$columntitlethirdparty = "SupplierCode";
$columncodethirdparty = "s.code_fournisseur";
} }
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -223,7 +231,7 @@ if ($result) {
print_liste_field_titre("Line", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); print_liste_field_titre("Line", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("Bill", $_SERVER["PHP_SELF"], "f.ref", '', $param, '', $sortfield, $sortorder); print_liste_field_titre("Bill", $_SERVER["PHP_SELF"], "f.ref", '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder); print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("CustomerCode", $_SERVER["PHP_SELF"], "s.code_client", '', $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre($columntitlethirdparty, $_SERVER["PHP_SELF"], $columncodethirdparty, '', $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "pl.amount", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "pl.amount", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre(''); print_liste_field_titre('');
@ -256,9 +264,17 @@ if ($result) {
print '</a></td>'; print '</a></td>';
print '<td>'; print '<td>';
print '<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->facid.'">'; $link_to_bill = '/compta/facture/card.php?facid=';
print img_object($langs->trans("ShowBill"), "bill"); $link_title = 'Invoice';
print '&nbsp;<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->facid.'">'.$obj->invoiceref."</a></td>\n"; $link_picto = 'bill';
if ($type == 'bank-transfer') {
$link_to_bill = '/fourn/facture/card.php?facid=';
$link_title = 'SupplierInvoice';
$link_picto = 'supplier_invoice';
}
print '<a href="'.DOL_URL_ROOT.$link_to_bill.$obj->facid.'">';
print img_object($langs->trans($link_title), $link_picto);
print '&nbsp;'.$obj->invoiceref."</td>\n";
print '</a>'; print '</a>';
print '</td>'; print '</td>';
@ -266,7 +282,15 @@ if ($result) {
print $company->getNomUrl(1); print $company->getNomUrl(1);
print "</td>\n"; print "</td>\n";
print '<td align="center"><a href="card.php?id='.$obj->rowid.'">'.$obj->code_client."</a></td>\n";
print '<td class="center">';
$link_to_tab = '/comm/card.php?socid=';
$link_code = $obj->code_client;
if ($type == 'bank-transfer') {
$link_to_tab = '/fourn/card.php?socid=';
$link_code = $obj->code_fournisseur;
}
print '<a href="'.DOL_URL_ROOT.$link_to_tab.$company->id.'">'.$link_code."</a></td>\n";
print '<td class="center">'.dol_print_date($db->jdate($obj->datec), 'day')."</td>\n"; print '<td class="center">'.dol_print_date($db->jdate($obj->datec), 'day')."</td>\n";

View File

@ -132,6 +132,9 @@ if ($result) {
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage); $param .= '&contextpage='.urlencode($contextpage);
} }
if ($type == 'bank-transfer') {
$param .= '&amp;type=bank-transfer';
}
if ($limit > 0 && $limit != $conf->liste_limit) { if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.urlencode($limit); $param .= '&limit='.urlencode($limit);
} }

View File

@ -567,19 +567,22 @@ $form = new Form($db);
$formadmin = new FormAdmin($db); $formadmin = new FormAdmin($db);
$formcompany = new FormCompany($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")); $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) { if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/contactnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->lastname) {
$title = $object->lastname; $title = $object->lastname;
} }
$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; $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").')'; $countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')';
$objsoc = new Societe($db);
if ($socid > 0) {
$objsoc->fetch($socid);
}
if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// ----------------------------------------- // -----------------------------------------
// When used with CANVAS // When used with CANVAS
@ -621,8 +624,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Show tabs // Show tabs
$head = contact_prepare_head($object); $head = contact_prepare_head($object);
llxHeader('', $title, $help_url);
} }
if ($user->rights->societe->contact->creer) { if ($user->rights->societe->contact->creer) {
@ -643,9 +644,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
} }
$linkback = ''; $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'); print load_fiche_titre($title, $linkback, 'address');
@ -1199,6 +1197,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Categories // Categories
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
$arrayselected = array();
print '<tr><td>'.$form->editfieldkey('Categories', 'contcats', '', $object, 0).'</td>'; print '<tr><td>'.$form->editfieldkey('Categories', 'contcats', '', $object, 0).'</td>';
print '<td colspan="3">'; print '<td colspan="3">';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT, null, null, null, null, 1); $cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT, null, null, null, null, 1);
@ -1301,11 +1300,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$action = 'presend'; $action = 'presend';
} }
// View mode
if (!empty($id) && $action != 'edit' && $action != 'create') { if (!empty($id) && $action != 'edit' && $action != 'create') {
$objsoc = new Societe($db); $objsoc = new Societe($db);
// View mode
// Show errors // Show errors
dol_htmloutput_errors(is_numeric($error) ? '' : $error, $errors); dol_htmloutput_errors(is_numeric($error) ? '' : $error, $errors);
@ -1530,9 +1528,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if ($object->user_id) { if ($object->user_id) {
$dolibarr_user = new User($db); $dolibarr_user = new User($db);
$result = $dolibarr_user->fetch($object->user_id); $result = $dolibarr_user->fetch($object->user_id);
print $dolibarr_user->getLoginUrl(1); print $dolibarr_user->getLoginUrl(-1);
} else { } else {
print $langs->trans("NoDolibarrAccess"); //print '<span class="opacitymedium">'.$langs->trans("NoDolibarrAccess").'</span>';
if (!$object->user_id && $user->rights->user->user->creer) {
print '<a class="aaa" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=create_user&token='.newToken().'">'.img_picto($langs->trans("CreateDolibarrLogin"), 'add', 'class="pictofixedwidth"').$langs->trans("CreateDolibarrLogin").'</a>';
}
} }
print '</td></tr>'; print '</td></tr>';
@ -1565,10 +1566,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit&token='.newToken().'">'.$langs->trans('Modify').'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit&token='.newToken().'">'.$langs->trans('Modify').'</a>';
} }
if (!$object->user_id && $user->rights->user->user->creer) {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=create_user&token='.newToken().'">'.$langs->trans("CreateDolibarrLogin").'</a>';
}
// Activer // Activer
if ($object->statut == 0 && $user->rights->societe->contact->creer) { if ($object->statut == 0 && $user->rights->societe->contact->creer) {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable&token='.newToken().'">'.$langs->trans("Reactivate").'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable&token='.newToken().'">'.$langs->trans("Reactivate").'</a>';

View File

@ -571,7 +571,6 @@ class Contact extends CommonObject
$this->fax = trim($this->fax); $this->fax = trim($this->fax);
$this->zip = (empty($this->zip) ? '' : trim($this->zip)); $this->zip = (empty($this->zip) ? '' : trim($this->zip));
$this->town = (empty($this->town) ? '' : trim($this->town)); $this->town = (empty($this->town) ? '' : trim($this->town));
$this->setUpperOrLowerCase();
$this->country_id = ($this->country_id > 0 ? $this->country_id : $this->country_id); $this->country_id = ($this->country_id > 0 ? $this->country_id : $this->country_id);
if (empty($this->statut)) { if (empty($this->statut)) {
$this->statut = 0; $this->statut = 0;
@ -579,6 +578,7 @@ class Contact extends CommonObject
if (empty($this->civility_code) && !is_numeric($this->civility_id)) { if (empty($this->civility_code) && !is_numeric($this->civility_id)) {
$this->civility_code = $this->civility_id; // For backward compatibility $this->civility_code = $this->civility_id; // For backward compatibility
} }
$this->setUpperOrLowerCase();
$this->db->begin(); $this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET";

View File

@ -167,7 +167,7 @@ if ($object->thirdparty->client) {
} }
} }
if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire) { if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) {
$elementTypeArray['fichinter'] = $langs->transnoentitiesnoconv('Interventions'); $elementTypeArray['fichinter'] = $langs->transnoentitiesnoconv('Interventions');
} }

View File

@ -342,6 +342,9 @@ $formother = new FormOther($db);
$formcompany = new FormCompany($db); $formcompany = new FormCompany($db);
$contactstatic = new Contact($db); $contactstatic = new Contact($db);
$morejs=array();
$morecss = array();
if (!empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)) { if (!empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)) {
$contactstatic->loadCacheOfProspStatus(); $contactstatic->loadCacheOfProspStatus();
} }
@ -370,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.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.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.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 .= " 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"; $sql .= " co.label as country, co.code as country_code";
// Add fields from extrafields // Add fields from extrafields
@ -1071,6 +1075,7 @@ while ($i < min($num, $limit)) {
$contactstatic->country = $obj->country; $contactstatic->country = $obj->country;
$contactstatic->country_code = $obj->country_code; $contactstatic->country_code = $obj->country_code;
$contactstatic->photo = $obj->photo; $contactstatic->photo = $obj->photo;
$contactstatic->import_key = $obj->import_key;
$contactstatic->fk_prospectlevel = $obj->fk_prospectcontactlevel; $contactstatic->fk_prospectlevel = $obj->fk_prospectcontactlevel;
@ -1306,9 +1311,10 @@ while ($i < min($num, $limit)) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Import key
if (!empty($arrayfields['p.import_key']['checked'])) { if (!empty($arrayfields['p.import_key']['checked'])) {
print '<td class="tdoverflowmax100">'; print '<td class="tdoverflowmax100">';
print $obj->import_key; print dol_escape_htmltag($obj->import_key);
print "</td>\n"; print "</td>\n";
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;

View File

@ -1263,9 +1263,9 @@ if ($action == 'create') {
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id, $langs->trans("CloseAContract"), $langs->trans("ConfirmCloseContract"), "confirm_close", '', 0, 1); $formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id, $langs->trans("CloseAContract"), $langs->trans("ConfirmCloseContract"), "confirm_close", '', 0, 1);
} elseif ($action == 'activate') { } elseif ($action == 'activate') {
$formquestion = array( $formquestion = array(
array('type' => 'date', 'name' => 'd_start', 'label' => $langs->trans("DateServiceActivate"), /*'value' => $form->selectDate('', '', $usehm, $usehm, '', "active", 1, 0),*/ /*'socid', '(s.client=1 OR s.client=2 OR s.client=3)'*/), array('type' => 'date', 'name' => 'd_start', 'label' => $langs->trans("DateServiceActivate"), 'value' => dol_now()),
array('type' => 'date', 'name' => 'd_end', 'label' => $langs->trans("DateEndPlanned"), /*'value' => $form->selectDate('', "end", $usehm, $usehm, '', "active", 1, 0),*/ '', ''), array('type' => 'date', 'name' => 'd_end', 'label' => $langs->trans("DateEndPlanned"), /*'value' => $form->selectDate('', "end", $usehm, $usehm, '', "active", 1, 0),*/ '', ''),
array('type' => 'text', 'name' => 'comment', 'label' => $langs->trans("Comment"), 'value' => '', '', '', 'class' => 'minwidth300') array('type' => 'text', 'name' => 'comment', 'label' => $langs->trans("Comment"), 'value' => '', '', '', 'class' => 'minwidth300', 'moreattr'=>'autofocus')
); );
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id, $langs->trans("ActivateAllOnContract"), $langs->trans("ConfirmActivateAllOnContract"), "confirm_activate", $formquestion, 'yes', 1, 280); $formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id, $langs->trans("ActivateAllOnContract"), $langs->trans("ConfirmActivateAllOnContract"), "confirm_activate", $formquestion, 'yes', 1, 280);
} elseif ($action == 'clone') { } elseif ($action == 'clone') {

View File

@ -668,7 +668,7 @@ class Contrat extends CommonObject
if (!$id) { if (!$id) {
$sql .= " WHERE entity IN (".getEntity('contract').")"; $sql .= " WHERE entity IN (".getEntity('contract').")";
} else { } else {
$sql .= " WHERE rowid=".(int) $id; $sql .= " WHERE rowid = ".(int) $id;
} }
if ($ref_customer) { if ($ref_customer) {
$sql .= " AND ref_customer = '".$this->db->escape($ref_customer)."'"; $sql .= " AND ref_customer = '".$this->db->escape($ref_customer)."'";
@ -677,7 +677,7 @@ class Contrat extends CommonObject
$sql .= " AND ref_supplier = '".$this->db->escape($ref_supplier)."'"; $sql .= " AND ref_supplier = '".$this->db->escape($ref_supplier)."'";
} }
if ($ref) { if ($ref) {
$sql .= " AND ref='".$this->db->escape($ref)."'"; $sql .= " AND ref = '".$this->db->escape($ref)."'";
} }
dol_syslog(get_class($this)."::fetch", LOG_DEBUG); dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
@ -724,10 +724,13 @@ class Contrat extends CommonObject
// Retrieve all extrafields // Retrieve all extrafields
// fetch optionals attributes and labels // fetch optionals attributes and labels
$this->fetch_optionals(); $result = $this->fetch_optionals();
// Lines // Lines
$result = $this->fetch_lines(); if ($result >= 0 && !empty($this->table_element_line)) {
$result = $this->fetch_lines();
}
if ($result < 0) { if ($result < 0) {
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
return -3; return -3;

View File

@ -61,7 +61,7 @@ if ($action == 'add' && !empty($permissiontoadd)) {
continue; // The field was not submited to be saved continue; // The field was not submited to be saved
} }
} else { } else {
if (!GETPOSTISSET($key)) { if (!GETPOSTISSET($key) && !preg_match('/^chkbxlst:/', $object->fields[$key]['type'])) {
continue; // The field was not submited to be saved continue; // The field was not submited to be saved
} }
} }
@ -91,6 +91,12 @@ if ($action == 'add' && !empty($permissiontoadd)) {
} elseif ($object->fields[$key]['type'] == 'reference') { } elseif ($object->fields[$key]['type'] == 'reference') {
$tmparraykey = array_keys($object->param_list); $tmparraykey = array_keys($object->param_list);
$value = $tmparraykey[GETPOST($key)].','.GETPOST($key.'2'); $value = $tmparraykey[GETPOST($key)].','.GETPOST($key.'2');
} elseif (preg_match('/^chkbxlst:(.*)/', $object->fields[$key]['type'])) {
$value = '';
$values_arr = GETPOST($key, 'array');
if (!empty($values_arr)) {
$value = implode(',', $values_arr);
}
} else { } else {
if ($key == 'lang') { if ($key == 'lang') {
$value = GETPOST($key, 'aZ09') ?GETPOST($key, 'aZ09') : ""; $value = GETPOST($key, 'aZ09') ?GETPOST($key, 'aZ09') : "";
@ -134,6 +140,8 @@ if ($action == 'add' && !empty($permissiontoadd)) {
} }
if (!$error) { if (!$error) {
$db->begin();
$result = $object->create($user); $result = $object->create($user);
if ($result > 0) { if ($result > 0) {
// Creation OK // Creation OK
@ -141,14 +149,19 @@ if ($action == 'add' && !empty($permissiontoadd)) {
$categories = GETPOST('categories', 'array:int'); $categories = GETPOST('categories', 'array:int');
$object->setCategories($categories); $object->setCategories($categories);
} }
$urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist; $urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist;
$urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation
$db->commit();
if (empty($noback)) { if (empty($noback)) {
header("Location: " . $urltogo); header("Location: " . $urltogo);
exit; exit;
} }
} else { } else {
$db->rollback();
$error++; $error++;
// Creation KO // Creation KO
if (!empty($object->errors)) { if (!empty($object->errors)) {
@ -177,7 +190,7 @@ if ($action == 'update' && !empty($permissiontoadd)) {
continue; continue;
} }
} else { } else {
if (!GETPOSTISSET($key)) { if (!GETPOSTISSET($key) && !preg_match('/^chkbxlst:/', $object->fields[$key]['type'])) {
continue; // The field was not submited to be saved continue; // The field was not submited to be saved
} }
} }
@ -215,6 +228,12 @@ if ($action == 'update' && !empty($permissiontoadd)) {
$value = ((GETPOST($key, 'aZ09') == 'on' || GETPOST($key, 'aZ09') == '1') ? 1 : 0); $value = ((GETPOST($key, 'aZ09') == 'on' || GETPOST($key, 'aZ09') == '1') ? 1 : 0);
} elseif ($object->fields[$key]['type'] == 'reference') { } elseif ($object->fields[$key]['type'] == 'reference') {
$value = array_keys($object->param_list)[GETPOST($key)].','.GETPOST($key.'2'); $value = array_keys($object->param_list)[GETPOST($key)].','.GETPOST($key.'2');
} elseif (preg_match('/^chkbxlst:/', $object->fields[$key]['type'])) {
$value = '';
$values_arr = GETPOST($key, 'array');
if (!empty($values_arr)) {
$value = implode(',', $values_arr);
}
} else { } else {
if ($key == 'lang') { if ($key == 'lang') {
$value = GETPOST($key, 'aZ09'); $value = GETPOST($key, 'aZ09');

View File

@ -34,7 +34,7 @@ if (!empty($permissioncreate) && empty($permissiontoadd)) {
} }
// Build doc // Build doc
if ($action == 'builddoc' && $permissiontoadd) { if ($action == 'builddoc' && ($permissiontoadd || !empty($usercangeneretedoc))) {
if (is_numeric(GETPOST('model', 'alpha'))) { if (is_numeric(GETPOST('model', 'alpha'))) {
$error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Model")); $error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Model"));
} else { } else {

View File

@ -42,6 +42,9 @@ if (!defined('NOREQUIRETRAN')) {
require '../../main.inc.php'; require '../../main.inc.php';
$action = GETPOST('action');
/* /*
* View * View
*/ */
@ -52,10 +55,10 @@ top_httphead();
//print '<!-- Ajax page called with url '.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]).' -->'."\n"; //print '<!-- Ajax page called with url '.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]).' -->'."\n";
// Registering the location of boxes // Registering the location of boxes
if (isset($_GET['action']) && !empty($_GET['action'])) { if ($action) {
if ($_GET['action'] == 'getrandompassword' && ($user->admin || $user->rights->api->apikey->generate)) { if ($action == 'getrandompassword' && ($user->admin || $user->rights->api->apikey->generate)) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
$generic = $_GET['generic'] ? true : false; $generic = GETPOST('generic') ? true : false;
echo getRandomPassword($generic); echo getRandomPassword($generic);
} }
} }

View File

@ -64,7 +64,7 @@ $arrayresult = array();
// Define $searchform // 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->rights->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) : '')); $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) : ''));
} }
@ -72,44 +72,43 @@ if (((!empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_P
$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) : '')); $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) : '')); $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)) if (((!empty($conf->product->enabled) && $user->hasRight('produit', 'lire')) || (!empty($conf->service->enabled) && $user->hasRight('service', 'lire'))) && empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED)) {
&& 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) : '')); $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 // 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) : '')); $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) : '')); $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) : '')); $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) : '')); $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) : '')); $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) : '')); $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) : '')); $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) : '')); $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->rights->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) : '')); $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 (((!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)) {
@ -120,7 +119,7 @@ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_S
} }
// Customer payments // 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( $arrayresult['searchintocustomerpayments'] = array(
'position'=>170, 'position'=>170,
'img'=>'object_payment', 'img'=>'object_payment',
@ -140,7 +139,7 @@ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_S
} }
// Miscellaneous payments // 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->rights->banque->lire) {
$arrayresult['searchintomiscpayments'] = array( $arrayresult['searchintomiscpayments'] = array(
'position'=>180, 'position'=>180,
'img'=>'object_payment', '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) : '')); '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->rights->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) : '')); $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->rights->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) : '')); $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->rights->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) : '')); $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 // 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->rights->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) : '')); $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->rights->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) : '')); $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->rights->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) : '')); $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) : ''));
} }

View File

@ -60,7 +60,7 @@ class box_accountancy_last_manual_entries extends ModeleBoxes
$this->db = $db; $this->db = $db;
$this->hidden = !($user->rights->accounting->mouvements->lire); $this->hidden = empty($user->rights->accounting->mouvements->lire);
} }
/** /**

View File

@ -60,7 +60,7 @@ class box_accountancy_suspense_account extends ModeleBoxes
$this->db = $db; $this->db = $db;
$this->hidden = !($user->rights->accounting->mouvements->lire); $this->hidden = empty($user->rights->accounting->mouvements->lire);
} }
/** /**

View File

@ -62,7 +62,7 @@ class box_actions extends ModeleBoxes
$this->enabled = $conf->agenda->enabled; $this->enabled = $conf->agenda->enabled;
$this->hidden = !($user->rights->agenda->myactions->read); $this->hidden = !($user->hasRight('agenda', 'myactions', 'read'));
} }
/** /**

View File

@ -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->enabled = ($conf->global->MAIN_FEATURES_LEVEL); // Not enabled by default due to bugs (see previous comments)
$this->hidden = !((isModEnabled('facture') && $user->rights->facture->lire) $this->hidden = !((isModEnabled('facture') && $user->rights->facture->lire)
|| (!empty($conf->commande->enabled) && $user->rights->commande->lire) || (isModEnabled('commande') && $user->rights->commande->lire)
|| (!empty($conf->propal->enabled) && $user->rights->propale->lire) || (isModEnabled('propal') && $user->rights->propale->lire)
); );
} }

View File

@ -60,7 +60,7 @@ class box_boms extends ModeleBoxes
$this->db = $db; $this->db = $db;
$this->hidden = !($user->rights->bom->read); $this->hidden = empty($user->rights->bom->read);
} }
/** /**

Some files were not shown because too many files have changed in this diff Show More