mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge branch 'develop' of github.com:Dolibarr/dolibarr into fix-shipment-dispatch-serial-warehouses
This commit is contained in:
commit
621e212c73
104
ChangeLog
104
ChangeLog
|
|
@ -18,6 +18,7 @@ WARNING:
|
|||
|
||||
The following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||
* The directory /build has been moved into /dev/build.
|
||||
* The use of GETPOST function is not allowed inside extrafields conditions or any strings that contains dynamic code evaluated with dol_eval()
|
||||
|
||||
|
||||
|
||||
|
|
@ -237,6 +238,109 @@ The following changes may create regressions for some external modules, but were
|
|||
* If you were using the substitution key __MEMBER_CIVILITY__, you must now use __MEMBER_TITLE__
|
||||
|
||||
|
||||
***** ChangeLog for 20.0.4 compared to 20.0.2 *****
|
||||
FIX: $this->origin_object can not be instance of CommandeFournisseur if it is already an instanceof CommonObject
|
||||
FIX: 17.0 API endpoints "PUT": prevent overwriting all extrafields if only some are supplied in the request cf. PR #29237
|
||||
FIX: 17.0 - collisions in cache for dol_getIdFromCode
|
||||
FIX: #18713
|
||||
FIX: 20.0 - PHP8 fatal when creating a reception unless corresponding PDF model is enabled
|
||||
FIX: #21294 Stock import sql query
|
||||
FIX: #26250 fatal error on kit
|
||||
FIX: #28702
|
||||
FIX: #29624 - substitution of __DATE_DELIVERY__
|
||||
FIX: #32113
|
||||
FIX: #32186
|
||||
FIX: #32339 Delete a loan settlement is partial
|
||||
FIX: #32387
|
||||
FIX: #32477 Loan - Insurance amount need decimals
|
||||
FIX: #32611
|
||||
FIX: #32736 + avoid php warning
|
||||
FIX: #32743
|
||||
FIX: #32765 JS Error: Uncaught TypeError
|
||||
FIX: #32801 VAT type is inverted in form VAT selector
|
||||
FIX: #32840
|
||||
FIX: #32843
|
||||
FIX: #32880 - Tags are using a special rendering.
|
||||
FIX: add other fields
|
||||
FIX: autofill price with multicurrency on supplier doc
|
||||
FIX: avoid phan error
|
||||
FIX: avoid php8 warnings
|
||||
FIX: avoid warning with the new Dolistore website
|
||||
FIX: backport from develop to avoid php warning
|
||||
FIX: Bad calculation of the theoretical stock. Did not take into account
|
||||
FIX: bad dispatched quantities for batches on shipment card
|
||||
FIX: Brian is in the kitchen
|
||||
FIX: broken feature, compatibility with "Default search filters"
|
||||
FIX: broken feature with check $pa_ht_isemptystring
|
||||
FIX: Bug on select user on time.php (all project list)
|
||||
FIX: can not delete files in task card
|
||||
FIX: Check "$search_sale" only if it's an internal user
|
||||
FIX: clean unique extrafields when create product combination
|
||||
FIX: code not visible correctly into view of dictionary
|
||||
FIX: compatibility between next_prev_filter and hook return
|
||||
FIX: compatibility with multicompany
|
||||
FIX: Complete path was started in #17243 for pdf_cannelle
|
||||
FIX: Continue for eagle_proforma
|
||||
FIX: country id is not saved when we provide country_code only
|
||||
FIX: #CVE-2024-34051
|
||||
FIX: delete supplier order when at least one line linked to customer order line
|
||||
FIX: display error when loan can't be deleted
|
||||
FIX: display full tree on shipment card when a kit contains a same component in other sub-kit
|
||||
FIX: DROP INDEX IF EXISTS is not possible !
|
||||
FIX: extrafields lost during creation from rec invoice
|
||||
FIX: FEC import
|
||||
FIX: Fiscal year - missing translation on status
|
||||
FIX: Fix return value of hook sendMail when hook return -1 who must be return false in sendfile() function
|
||||
FIX: GETPOST('private_message')
|
||||
FIX: glob is better for search files with wildcard + avoid warning
|
||||
FIX: if $force_entity = 0 ($force_entity != 'default') = false
|
||||
FIX: Loan - Insurance amount need decimals
|
||||
FIX: Many status on invoice linked object block
|
||||
FIX: merge problem
|
||||
FIX: missing company name if dontaion is linked to third party
|
||||
FIX: missing default values if $objsrc or $soc fields are empty
|
||||
FIX: missing edit extrafields inline for member card
|
||||
FIX: missing quick edit for extrafields
|
||||
FIX: more bugs and warnings
|
||||
FIX: Multilangs : PDF lines description
|
||||
FIX: Must not have both thirdparty and member.
|
||||
FIX: ODT substitution when many HTML tags in string
|
||||
FIX: on the road again
|
||||
FIX: pdf_cannelle (supplier_invoice) add background - Complete #17243
|
||||
FIX: Prices didn't update when clone a propale with update prices
|
||||
FIX: product variants copy: also copy multiprice variations
|
||||
FIX: refactorize (maybe broken feature for not received completely)
|
||||
FIX: remove debug trace
|
||||
FIX: remove socid when cloning a project without third parties
|
||||
FIX: removes traces of <<<HEAD conflicts following the postponement of branch 13 modifications (#32014)
|
||||
FIX: remove unused code
|
||||
FIX: same broken feature for propal and invoice
|
||||
FIX: select 2 no record found translate
|
||||
FIX: selectcontact is loading all contacts if socid is empty and MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT is not set
|
||||
FIX: selectcontact is loading all contacts when update event
|
||||
FIX: select group and severity search fields on ticket list
|
||||
FIX: send email to assigned user on ticket create
|
||||
FIX: sql error with the new sql forge filter
|
||||
FIX: sql "order by" is defined twice
|
||||
FIX: status ticket update for new message
|
||||
FIX: swap tests
|
||||
FIX: switch on/off status of a page of the second website.
|
||||
FIX: There were many status indicator in the invoice linked object block (propal card)
|
||||
FIX: uniformize code
|
||||
FIX: units used scale and scale is an integer
|
||||
FIX: wrong alias table
|
||||
FIX: wrong file path + avoid warning
|
||||
FIX: wrong filter format
|
||||
FIX: wrong "fournisseur" var value checking
|
||||
FIX: wrong left margin
|
||||
FIX: wrong message on update shipment
|
||||
FIX: wrong ODT path for multicompany
|
||||
FIX: wrong path for odt models
|
||||
FIX: wrong search filter, empty product unit is "none"
|
||||
FIX: wrong update function parameter
|
||||
FIX: some wrong var type
|
||||
FIX: some wrong var name
|
||||
|
||||
***** ChangeLog for 20.0.3 compared to 20.0.2 *****
|
||||
FIX: 17.0 - missing error handling for FactureRec::fetch in card-rec.php
|
||||
FIX: 17.0 - warnings due to uninitialized variables + delete code that doesn't apply to recurring invoices (AFAIK, there is no recurring credit note feature)
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ $PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/asso.dolibarr.org/
|
|||
"RPM_FEDORA"=>"rpmbuild",
|
||||
"RPM_MANDRIVA"=>"rpmbuild",
|
||||
"RPM_OPENSUSE"=>"rpmbuild",
|
||||
"DEB"=>"dpkg",
|
||||
"DEB"=>"dpkg,po2debconf", # need also debhelper
|
||||
"FLATPACK"=>"flatpack",
|
||||
"EXEDOLIWAMP"=>"ISCC.exe",
|
||||
"SNAPSHOT"=>"tar"
|
||||
|
|
@ -85,8 +85,9 @@ if (! $ENV{"DESTIBETARC"} || ! $ENV{"DESTISTABLE"})
|
|||
print "set DESTIBETARC=c:/tmp\n";
|
||||
print "set DESTISTABLE=c:/tmp\n";
|
||||
print "\n";
|
||||
print "Example: DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild'\n";
|
||||
print "Example: DESTISTABLE='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/stable'\n";
|
||||
print "Example in .bashrc:\n";
|
||||
print "export DESTIBETARC='/mnt/HDDATA1_LD/Mes Archives/Doli/dolibarr/lastbuild'\n";
|
||||
print "export DESTISTABLE='/mnt/HDDATA1_LD/Mes Archives/Doli/dolibarr/stable'\n";
|
||||
sleep 2;
|
||||
exit 1;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -32,15 +32,34 @@ the project: `pre-commit-config.yaml`.
|
|||
|
||||
Then you can install pre-commit tool:\
|
||||
`python3 -m pip install pre-commit`
|
||||
or
|
||||
`python3 -m pip install pre-commit --break-system-packages`
|
||||
|
||||
2. In your local git clone of the project, run `pre-commit install` to add the hooks
|
||||
Then install phpcbf and phpcs:\
|
||||
`sudo apt install php-codesniffer`
|
||||
|
||||
3. In your local git clone of the project, run `pre-commit install` to add the hooks
|
||||
or copy the file *dev/setup/git/hooks/pre-commit* manually into *.git/hooks/pre-commit*
|
||||
(recommended because this file may differ from the file installed with the pre-commit install).
|
||||
The good file redirects output to the error channel so your IDE will be able to catch the error.
|
||||
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
* If you get error "ModuleNotFoundError: No module named 'platformdirs'"
|
||||
|
||||
Install the python package with
|
||||
`pip3 install platformdirs` or `pip3 install platformdirs --break-system-packages`
|
||||
|
||||
* If you get error "ERROR: PHP_CodeSniffer requires the tokenizer, xmlwriter and SimpleXML extensions to be enabled. Please enable xmlwriter and SimpleXML."
|
||||
|
||||
Install the PHP package xml
|
||||
`sudo apt install php-simplexml`
|
||||
|
||||
|
||||
### Tips
|
||||
|
||||
|
||||
After installing `pre-commit` onto your local git clone, pre-commit will run
|
||||
on every commit. The first time, all tools required by pre-commit will be installed
|
||||
into ~/.cache/pre-commit
|
||||
|
|
|
|||
|
|
@ -9,16 +9,15 @@
|
|||
*/
|
||||
return [
|
||||
// # Issue statistics:
|
||||
// PhanTypeMismatchArgument : 1840+ occurrences
|
||||
// PhanUndeclaredProperty : 520+ occurrences
|
||||
// PhanTypeMismatchArgumentNullable : 380+ occurrences
|
||||
// PhanTypeMismatchArgument : 1690+ occurrences
|
||||
// PhanUndeclaredProperty : 500+ occurrences
|
||||
// PhanTypeMismatchArgumentNullable : 350+ occurrences
|
||||
// PhanPluginUnknownArrayMethodReturnType : 170+ occurrences
|
||||
// PhanUndeclaredGlobalVariable : 170+ occurrences
|
||||
// PhanTypeMismatchProperty : 130+ occurrences
|
||||
// PhanUndeclaredGlobalVariable : 160+ occurrences
|
||||
// PhanTypeMismatchProperty : 120+ occurrences
|
||||
// PhanPluginUnknownArrayMethodParamType : 110+ occurrences
|
||||
// PhanPossiblyUndeclaredGlobalVariable : 95+ occurrences
|
||||
// PhanTypeMismatchArgumentProbablyReal : 90+ occurrences
|
||||
// PhanRedefineFunction : 40+ occurrences
|
||||
// PhanTypeMismatchArgumentProbablyReal : 75+ occurrences
|
||||
// PhanPossiblyUndeclaredGlobalVariable : 65+ occurrences
|
||||
// PhanTypeExpectedObjectPropAccess : 40+ occurrences
|
||||
// PhanTypeInvalidDimOffset : 25+ occurrences
|
||||
// PhanTypeMismatchDimFetch : 20+ occurrences
|
||||
|
|
@ -27,19 +26,17 @@ return [
|
|||
// PhanTypeMismatchArgumentNullableInternal : 10+ occurrences
|
||||
// PhanUndeclaredMethod : 10+ occurrences
|
||||
// PhanTypeComparisonFromArray : 8 occurrences
|
||||
// PhanPluginSuspiciousParamPosition : 7 occurrences
|
||||
// PhanPluginDuplicateExpressionBinaryOp : 6 occurrences
|
||||
// PhanPluginUnknownObjectMethodCall : 6 occurrences
|
||||
// PhanTypeArraySuspiciousNull : 6 occurrences
|
||||
// PhanParamTooMany : 5 occurrences
|
||||
// PhanPluginDuplicateArrayKey : 4 occurrences
|
||||
// PhanPluginEmptyStatementIf : 4 occurrences
|
||||
// PhanPluginSuspiciousParamPosition : 4 occurrences
|
||||
// PhanEmptyFQSENInClasslike : 3 occurrences
|
||||
// PhanInvalidFQSENInClasslike : 3 occurrences
|
||||
// PhanPluginBothLiteralsBinaryOp : 3 occurrences
|
||||
// PhanEmptyForeach : 2 occurrences
|
||||
// PhanPluginEmptyStatementIf : 2 occurrences
|
||||
// PhanRedefineFunction : 2 occurrences
|
||||
// PhanTypeMismatchDimAssignment : 2 occurrences
|
||||
// PhanTypeMismatchDimFetchNullable : 2 occurrences
|
||||
// PhanTypeSuspiciousStringExpression : 2 occurrences
|
||||
// PhanAccessMethodProtected : 1 occurrence
|
||||
// PhanPluginDuplicateExpressionAssignmentOperation : 1 occurrence
|
||||
|
|
@ -143,7 +140,6 @@ return [
|
|||
'htdocs/asset/tpl/accountancy_codes_edit.tpl.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/asset/tpl/depreciation_options_edit.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
|
||||
'htdocs/asset/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/asterisk/wrapper.php' => ['PhanRedefineFunction'],
|
||||
'htdocs/barcode/printsheet.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/bom/bom_card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/bom/bom_list.php' => ['PhanTypeMismatchArgument'],
|
||||
|
|
@ -225,10 +221,9 @@ return [
|
|||
'htdocs/compta/bank/releve.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/bank/transfer.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/bank/treso.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/bank/various_payment/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/compta/bank/various_payment/document.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/compta/bank/various_payment/info.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/compta/bank/various_payment/list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/bank/various_payment/card.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/bank/various_payment/document.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/compta/bank/various_payment/info.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/compta/cashcontrol/cashcontrol_card.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
|
||||
'htdocs/compta/cashcontrol/cashcontrol_list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/compta/charges/index.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
|
|
@ -241,7 +236,7 @@ return [
|
|||
'htdocs/compta/facture/agenda.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/facture/card-rec.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/compta/facture/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/compta/facture/class/api_invoices.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/compta/facture/class/api_invoices.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/compta/facture/class/facture-rec.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/compta/facture/class/facture.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/compta/facture/class/factureligne.class.php' => ['PhanTypeMismatchArgument'],
|
||||
|
|
@ -445,7 +440,6 @@ return [
|
|||
'htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/project/doc/pdf_beluga.modules.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/modules/project/doc/pdf_timespent.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/propale/doc/pdf_cyan.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
|
|
@ -615,83 +609,37 @@ return [
|
|||
'htdocs/projet/class/api_tasks.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/projet/tasks/time.php' => ['PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/projet/tasks/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/public/agenda/agendaexport.php' => ['PhanRedefineFunction'],
|
||||
'htdocs/public/bookcal/index.php' => ['PhanRedefineFunction'],
|
||||
'htdocs/public/company/new.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/public/cron/cron_run_jobs_by_url.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/public/demo/index.php' => ['PhanRedefineFunction'],
|
||||
'htdocs/public/donations/donateurs_code.php' => ['PhanRedefineFunction'],
|
||||
'htdocs/public/emailing/mailing-read.php' => ['PhanRedefineFunction'],
|
||||
'htdocs/public/eventorganization/attendee_new.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/public/eventorganization/subscriptionok.php' => ['PhanRedefineFunction', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/members/new.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/members/public_card.php' => ['PhanRedefineFunction'],
|
||||
'htdocs/public/members/public_list.php' => ['PhanRedefineFunction'],
|
||||
'htdocs/public/onlinesign/newonlinesign.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentNullableInternal'],
|
||||
'htdocs/public/opensurvey/studs.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/public/partnership/new.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/public/payment/newpayment.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/public/payment/paymentko.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/public/payment/paymentok.php' => ['PhanPluginSuspiciousParamPosition', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/project/index.php' => ['PhanRedefineFunction', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/project/new.php' => ['PhanRedefineFunction'],
|
||||
'htdocs/public/project/suggestbooth.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/public/project/suggestconference.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/public/project/viewandvote.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/recruitment/view.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/stripe/ipn.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/test/test_arrays.php' => ['PhanPluginUndeclaredVariableIsset'],
|
||||
'htdocs/public/ticket/create_ticket.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchDimFetchNullable', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/public/ticket/list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/public/ticket/view.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/public/company/new.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/public/eventorganization/subscriptionok.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/members/new.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/payment/newpayment.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/public/payment/paymentok.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/project/index.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/project/suggestbooth.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/public/project/suggestconference.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/public/project/viewandvote.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/recruitment/view.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/webportal/tpl/menu.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/public/webportal/webportal.main.inc.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/public/website/index.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/public/website/javascript.js.php' => ['PhanRedefineFunction'],
|
||||
'htdocs/public/website/styles.css.php' => ['PhanRedefineFunction'],
|
||||
'htdocs/reception/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/reception/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/reception/class/api_receptions.class.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/reception/class/reception.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/reception/contact.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/reception/dispatch.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/reception/document.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/reception/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/reception/note.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/reception/stats/index.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/recruitment/admin/setup.php' => ['PhanEmptyForeach'],
|
||||
'htdocs/recruitment/admin/setup_candidatures.php' => ['PhanEmptyForeach'],
|
||||
'htdocs/recruitment/class/api_recruitments.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/reception/list.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/class/recruitmentcandidature.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/class/recruitmentjobposition.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/index.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/recruitment/recruitmentcandidature_card.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/recruitmentcandidature_list.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/recruitmentjobposition_agenda.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/recruitment/recruitmentjobposition_applications.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/recruitmentjobposition_card.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/recruitmentjobposition_document.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/recruitmentjobposition_list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/recruitment/recruitmentjobposition_note.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/resource/card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/recruitmentcandidature_card.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/recruitmentcandidature_list.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/recruitmentjobposition_agenda.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/recruitmentjobposition_applications.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/recruitmentjobposition_card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/recruitmentjobposition_document.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/recruitmentjobposition_note.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/resource/class/dolresource.class.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/resource/class/html.formresource.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/resource/element_resource.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/resource/list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/salaries/admin/salaries.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/salaries/card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/salaries/class/api_salaries.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
|
||||
'htdocs/salaries/class/paymentsalary.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/salaries/class/salariesstats.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/salaries/class/salary.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/salaries/document.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/salaries/info.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/salaries/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/salaries/paiement_salary.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
|
||||
'htdocs/salaries/stats/index.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/salaries/virement_request.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/salaries/paiement_salary.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/salaries/virement_request.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/societe/admin/societe.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'],
|
||||
'htdocs/societe/ajax/company.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
|
||||
'htdocs/societe/canvas/actions_card_common.class.php' => ['PhanTypeMismatchArgument'],
|
||||
|
|
@ -775,7 +723,7 @@ return [
|
|||
'htdocs/variants/list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/variants/tpl/productattributevalueline_edit.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/variants/tpl/productattributevalueline_view.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/viewimage.php' => ['PhanRedefineFunction', 'PhanUndeclaredMethod'],
|
||||
'htdocs/viewimage.php' => ['PhanUndeclaredMethod'],
|
||||
'htdocs/webhook/class/api_webhook.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
|
||||
'htdocs/webhook/class/target.class.php' => ['PhanUndeclaredMethod'],
|
||||
'htdocs/webhook/target_card.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ return [
|
|||
|
||||
// Currently, file_suppressions and directory_suppressions are the only supported suppressions
|
||||
'file_suppressions' => [
|
||||
'htdocs/accountancy/admin/productaccount.php' => ['PhanTypeMismatchArgumentNullableInternal'], // false positive
|
||||
'internal' => ['PhanUndeclaredConstant'],
|
||||
],
|
||||
'directory_suppressions' => [
|
||||
|
|
|
|||
|
|
@ -228,12 +228,17 @@ return [
|
|||
'actioncode' => 'string',
|
||||
'badgeStatus0' => 'string',
|
||||
'badgeStatus1' => 'string',
|
||||
'badgeStatus11' => 'string',
|
||||
'badgeStatus3' => 'string',
|
||||
'badgeStatus4' => 'string',
|
||||
'badgeStatus5' => 'string',
|
||||
'badgeStatus6' => 'string',
|
||||
'badgeStatus7' => 'string',
|
||||
'badgeStatus8' => 'string',
|
||||
'badgeStatus9' => 'string',
|
||||
'badgeStatus10' => 'string',
|
||||
'badgeStatus11' => 'string',
|
||||
'badgeStatus4b' => 'string',
|
||||
'badgeStatus8b' => 'string',
|
||||
'classname' => 'string',
|
||||
'conf' => '\Conf',
|
||||
'conffile' => 'string',
|
||||
|
|
|
|||
|
|
@ -96,13 +96,12 @@ class Adherent extends CommonObject
|
|||
|
||||
/**
|
||||
* @var string
|
||||
* @deprecated Use $civility_code
|
||||
* @see $civility_code
|
||||
* @deprecated Use $civility_code
|
||||
*/
|
||||
public $civility_id;
|
||||
|
||||
/**
|
||||
* @var string The civility code, not an integer (ex: 'MR', 'MME', 'MLE', etc.)
|
||||
* @var string The civility code, not an integer (ex: 'MR', 'MME', 'MLE', 'DR', etc.)
|
||||
*/
|
||||
public $civility_code;
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,78 @@ class AdherentType extends CommonObject
|
|||
*/
|
||||
public $picto = 'members';
|
||||
|
||||
/**
|
||||
* @var int<0,1>|string 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
*/
|
||||
public $ismultientitymanaged = 1;
|
||||
|
||||
/**
|
||||
* @var int<0,1> Does object support extrafields ? 0=No, 1=Yes
|
||||
*/
|
||||
public $isextrafieldmanaged = 1;
|
||||
|
||||
//TODO : rename BDD field libelle into label before being able to use arrayfields.
|
||||
|
||||
/**
|
||||
* 'type' field format:
|
||||
* 'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',
|
||||
* 'select' (list of values are in 'options'),
|
||||
* 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter[:CategoryIdType[:CategoryIdList[:SortField]]]]]]',
|
||||
* 'chkbxlst:...',
|
||||
* 'varchar(x)',
|
||||
* 'text', 'text:none', 'html',
|
||||
* 'double(24,8)', 'real', 'price',
|
||||
* 'date', 'datetime', 'timestamp', 'duration',
|
||||
* 'boolean', 'checkbox', 'radio', 'array',
|
||||
* 'mail', 'phone', 'url', 'password', 'ip'
|
||||
* Note: Filter must be a Dolibarr Universal Filter syntax string. Example: "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.status:!=:0) or (t.nature:is:NULL)"
|
||||
* 'label' the translation key.
|
||||
* 'picto' is code of a picto to show before value in forms
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalInt("MY_SETUP_PARAM")' or 'isModEnabled("multicurrency")' ...)
|
||||
* 'position' is the sort order of field.
|
||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||
* 'noteditable' says if field is not editable (1 or 0)
|
||||
* 'alwayseditable' says if field can be modified also when status is not draft ('1' or '0')
|
||||
* 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
|
||||
* 'index' if we want an index in database.
|
||||
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...).
|
||||
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
|
||||
* 'isameasure' must be set to 1 or 2 if field can be used for measure. Field type must be summable like integer or double(24,8). Use 1 in most cases, or 2 if you don't want to see the column total into list (for example for percentage)
|
||||
* 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200'
|
||||
* 'help' and 'helplist' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click.
|
||||
* 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
|
||||
* 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code.
|
||||
* 'arrayofkeyval' to set a list of values if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel"). Note that type can be 'integer' or 'varchar'
|
||||
* 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1.
|
||||
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
|
||||
* 'validate' is 1 if need to validate with $this->validateField()
|
||||
* 'copytoclipboard' is 1 or 2 to allow to add a picto to copy value into clipboard (1=picto after label, 2=picto after value)
|
||||
*
|
||||
* Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor.
|
||||
*/
|
||||
|
||||
// BEGIN MODULEBUILDER PROPERTIES
|
||||
/**
|
||||
* @inheritdoc
|
||||
* Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields = array(
|
||||
"rowid" => array("type" => "integer", "label" => "TechnicalID", "enabled" => "1", 'position' => 10, 'notnull' => 1, "visible" => "-1",),
|
||||
"tms" => array("type" => "timestamp", "label" => "DateModification", "enabled" => "1", 'position' => 20, 'notnull' => 1, "visible" => "-1",),
|
||||
"statut" => array("type" => "smallint(6)", "label" => "Statut", "enabled" => "1", 'position' => 500, 'notnull' => 1, "visible" => "-1",),
|
||||
"libelle" => array("type" => "varchar(50)", "label" => "Label", "enabled" => "1", 'position' => 30, 'notnull' => 1, "visible" => "-1",),
|
||||
"subscription" => array("type" => "varchar(3)", "label" => "Subscription", "enabled" => "1", 'position' => 35, 'notnull' => 1, "visible" => "-1",),
|
||||
"amount" => array("type" => "double(24,8)", "label" => "Amount", "enabled" => "1", 'position' => 40, 'notnull' => 0, "visible" => "-1",),
|
||||
"caneditamount" => array("type" => "integer", "label" => "Caneditamount", "enabled" => "1", 'position' => 45, 'notnull' => 0, "visible" => "-1",),
|
||||
"vote" => array("type" => "varchar(3)", "label" => "Vote", "enabled" => "1", 'position' => 50, 'notnull' => 1, "visible" => "-1",),
|
||||
"note" => array("type" => "longtext", "label" => "Note", "enabled" => "1", 'position' => 55, 'notnull' => 0, "visible" => "-1",),
|
||||
"mail_valid" => array("type" => "longtext", "label" => "Mailvalid", "enabled" => "1", 'position' => 60, 'notnull' => 0, "visible" => "-1",),
|
||||
"morphy" => array("type" => "varchar(3)", "label" => "Morphy", "enabled" => "1", 'position' => 65, 'notnull' => 0, "visible" => "-1",),
|
||||
"duration" => array("type" => "varchar(6)", "label" => "Duration", "enabled" => "1", 'position' => 70, 'notnull' => 0, "visible" => "-1",),
|
||||
);
|
||||
// END MODULEBUILDER PROPERTIES
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @deprecated Use label
|
||||
|
|
@ -143,39 +215,43 @@ class AdherentType extends CommonObject
|
|||
public $multilangs = array();
|
||||
|
||||
|
||||
// BEGIN MODULEBUILDER PROPERTIES
|
||||
/**
|
||||
* @inheritdoc
|
||||
* Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields = array(
|
||||
"rowid" => array("type" => "integer", "label" => "TechnicalID", "enabled" => "1", 'position' => 10, 'notnull' => 1, "visible" => "-1",),
|
||||
"tms" => array("type" => "timestamp", "label" => "DateModification", "enabled" => "1", 'position' => 20, 'notnull' => 1, "visible" => "-1",),
|
||||
"statut" => array("type" => "smallint(6)", "label" => "Statut", "enabled" => "1", 'position' => 500, 'notnull' => 1, "visible" => "-1",),
|
||||
"libelle" => array("type" => "varchar(50)", "label" => "Label", "enabled" => "1", 'position' => 30, 'notnull' => 1, "visible" => "-1",),
|
||||
"subscription" => array("type" => "varchar(3)", "label" => "Subscription", "enabled" => "1", 'position' => 35, 'notnull' => 1, "visible" => "-1",),
|
||||
"amount" => array("type" => "double(24,8)", "label" => "Amount", "enabled" => "1", 'position' => 40, 'notnull' => 0, "visible" => "-1",),
|
||||
"caneditamount" => array("type" => "integer", "label" => "Caneditamount", "enabled" => "1", 'position' => 45, 'notnull' => 0, "visible" => "-1",),
|
||||
"vote" => array("type" => "varchar(3)", "label" => "Vote", "enabled" => "1", 'position' => 50, 'notnull' => 1, "visible" => "-1",),
|
||||
"note" => array("type" => "longtext", "label" => "Note", "enabled" => "1", 'position' => 55, 'notnull' => 0, "visible" => "-1",),
|
||||
"mail_valid" => array("type" => "longtext", "label" => "Mailvalid", "enabled" => "1", 'position' => 60, 'notnull' => 0, "visible" => "-1",),
|
||||
"morphy" => array("type" => "varchar(3)", "label" => "Morphy", "enabled" => "1", 'position' => 65, 'notnull' => 0, "visible" => "-1",),
|
||||
"duration" => array("type" => "varchar(6)", "label" => "Duration", "enabled" => "1", 'position' => 70, 'notnull' => 0, "visible" => "-1",),
|
||||
);
|
||||
// END MODULEBUILDER PROPERTIES
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db)
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
global $langs;
|
||||
$this->db = $db;
|
||||
|
||||
$this->ismultientitymanaged = 1;
|
||||
$this->status = 1;
|
||||
|
||||
if (!getDolGlobalInt('MAIN_SHOW_TECHNICAL_ID') && isset($this->fields['rowid']) && !empty($this->fields['ref'])) {
|
||||
$this->fields['rowid']['visible'] = 0;
|
||||
}
|
||||
if (!isModEnabled('multicompany') && isset($this->fields['entity'])) {
|
||||
$this->fields['entity']['enabled'] = 0;
|
||||
}
|
||||
|
||||
// Unset fields that are disabled
|
||||
foreach ($this->fields as $key => $val) {
|
||||
if (isset($val['enabled']) && empty($val['enabled'])) {
|
||||
unset($this->fields[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
// Translate some data of arrayofkeyval
|
||||
if (is_object($langs)) {
|
||||
foreach ($this->fields as $key => $val) {
|
||||
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
|
||||
foreach ($val['arrayofkeyval'] as $key2 => $val2) {
|
||||
$this->fields[$key]['arrayofkeyval'][$key2] = $langs->trans($val2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -534,7 +534,7 @@ if ($action == 'create') {
|
|||
print '<table class="border centpercent">';
|
||||
print '<tbody>';
|
||||
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" class="minwidth200" name="label" autofocus="autofocus"></td></tr>';
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" class="minwidth200" name="label" value= "'. $label. '" autofocus="autofocus"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
||||
print $form->selectarray('status', array('0' => $langs->trans('ActivityCeased'), '1' => $langs->trans('InActivity')), 1, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100');
|
||||
|
|
@ -566,7 +566,7 @@ if ($action == 'create') {
|
|||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Duration").'</td><td colspan="3">';
|
||||
print '<input name="duration_value" size="5" value="'.GETPOST('duraction_unit', 'aZ09').'"> ';
|
||||
print '<input name="duration_value" size="5" value="'. $duration_value .'"> ';
|
||||
print $formproduct->selectMeasuringUnits("duration_unit", "time", GETPOSTISSET("duration_unit") ? GETPOST('duration_unit', 'aZ09') : 'y', 0, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
|
|||
|
|
@ -382,6 +382,7 @@ if ($action == 'edit') {
|
|||
clearstatcache();
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td></td></tr>';
|
||||
|
||||
|
|
@ -613,11 +614,11 @@ if ($action == 'edit') {
|
|||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("OtherOptions").'</td><td></td></tr>';
|
||||
|
||||
|
|
@ -664,6 +665,7 @@ if ($action == 'edit') {
|
|||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
|
@ -868,7 +870,7 @@ if ($action == 'edit') {
|
|||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_FORCE_SENDTO").'</td><td>'.getDolGlobalString('MAIN_MAIL_FORCE_SENDTO');
|
||||
if (getDolGlobalString('MAIN_MAIL_FORCE_SENDTO')) {
|
||||
if (!isValidEmail(getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))) {
|
||||
print img_warning($langs->trans("ErrorBadEMail"));
|
||||
print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_FORCE_SENDTO')));
|
||||
} else {
|
||||
print img_warning($langs->trans("RecipientEmailsWillBeReplacedWithThisValue"));
|
||||
}
|
||||
|
|
@ -892,7 +894,7 @@ if ($action == 'edit') {
|
|||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_FORCE_SENDTO").'</td><td>'.getDolGlobalString('MAIN_MAIL_FORCE_SENDTO');
|
||||
if (getDolGlobalString('MAIN_MAIL_FORCE_SENDTO')) {
|
||||
if (!isValidEmail(getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))) {
|
||||
print img_warning($langs->trans("ErrorBadEMail"));
|
||||
print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_FORCE_SENDTO')));
|
||||
} else {
|
||||
print img_warning($langs->trans("RecipientEmailsWillBeReplacedWithThisValue"));
|
||||
}
|
||||
|
|
@ -910,7 +912,7 @@ if ($action == 'edit') {
|
|||
if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM')) {
|
||||
print img_warning($langs->trans("Mandatory"));
|
||||
} elseif (!isValidEmail(getDolGlobalString('MAIN_MAIL_EMAIL_FROM'))) {
|
||||
print img_warning($langs->trans("ErrorBadEMail"));
|
||||
print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_EMAIL_FROM')));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -958,7 +960,7 @@ if ($action == 'edit') {
|
|||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_ERRORS_TO").'</td>';
|
||||
print '<td>'.(getDolGlobalString('MAIN_MAIL_ERRORS_TO'));
|
||||
if (getDolGlobalString('MAIN_MAIL_ERRORS_TO') && !isValidEmail(getDolGlobalString('MAIN_MAIL_ERRORS_TO'))) {
|
||||
print img_warning($langs->trans("ErrorBadEMail"));
|
||||
print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_ERRORS_TO')));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
|
|||
|
|
@ -104,6 +104,10 @@ if ($action == 'update' && !$cancel) {
|
|||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET", GETPOST("MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET", GETPOST("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET"), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (GETPOSTISSET("MAIN_MAIL_EMAIL_FROM_PASSWORDRESET")) {
|
||||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM_PASSWORDRESET", GETPOST("MAIN_MAIL_EMAIL_FROM_PASSWORDRESET", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
|
||||
exit;
|
||||
}
|
||||
|
|
@ -349,6 +353,7 @@ if ($action == 'edit') {
|
|||
|
||||
clearstatcache();
|
||||
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td></td></tr>';
|
||||
|
||||
|
|
@ -553,6 +558,26 @@ if ($action == 'edit') {
|
|||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("OtherOptions").'</td><td></td></tr>';
|
||||
|
||||
// From
|
||||
$help = $form->textwithpicto('', $langs->trans("EMailHelpMsgSPFDKIM"));
|
||||
print '<tr class="oddeven"><td class="">';
|
||||
print $langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ? ini_get('sendmail_from') : $langs->transnoentities("Undefined"));
|
||||
print ' '.$help;
|
||||
print '</td>';
|
||||
print '<td><input class="flat minwidth300" name="MAIN_MAIL_EMAIL_FROM_PASSWORDRESET" value="'.getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET');
|
||||
print '"></td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
|
@ -685,6 +710,36 @@ if ($action == 'edit') {
|
|||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("OtherOptions").'</td><td></td></tr>';
|
||||
|
||||
// From
|
||||
$help = $form->textwithpicto('', $langs->trans("EMailHelpMsgSPFDKIM"));
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ? ini_get('sendmail_from') : $langs->transnoentities("Undefined"));
|
||||
print ' '.$help;
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET')) {
|
||||
print '<span class="opacitymedium">'.getDolGlobalString('MAIN_MAIL_EMAIL_FROM').'</span>';
|
||||
} else {
|
||||
print getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET');
|
||||
}
|
||||
if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM') && !getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET')) {
|
||||
print img_warning($langs->trans("Mandatory"));
|
||||
} elseif (getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET') && !isValidEmail(getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET'))) {
|
||||
print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET')));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
|
|
|
|||
213
htdocs/admin/order_pdf.php
Normal file
213
htdocs/admin/order_pdf.php
Normal file
|
|
@ -0,0 +1,213 @@
|
|||
<?php
|
||||
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/order_pdf.php
|
||||
* \ingroup order
|
||||
* \brief Setup page for order module
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @var Societe $mysoc
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("admin", "other", "errors", "orders"));
|
||||
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$value = GETPOST('value', 'alpha');
|
||||
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||
|
||||
$label = GETPOST('label', 'alpha');
|
||||
$scandir = GETPOST('scan_dir', 'alpha');
|
||||
$type = 'order';
|
||||
$dirforterms = $conf->order->dir_output;
|
||||
if (!empty($conf->order->multidir_output[$conf->entity])) {
|
||||
$dirforterms = $conf->order->multidir_output[$conf->entity].'/';
|
||||
}
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
$error = 0;
|
||||
if ($action == "update") {
|
||||
if (GETPOSTISSET('MAIN_PDF_ADD_TERMSOFSALE_ORDER')) {
|
||||
dolibarr_set_const($db, "MAIN_PDF_ADD_TERMSOFSALE_ORDER", GETPOST("MAIN_PDF_ADD_TERMSOFSALE_ORDER", 'int'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (GETPOSTISSET('SALES_ORDER_SHOW_SHIPPING_ADDRESS')) {
|
||||
dolibarr_set_const($db, "SALES_ORDER_SHOW_SHIPPING_ADDRESS", GETPOSTINT("SALES_ORDER_SHOW_SHIPPING_ADDRESS"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_del_const($db, "SALES_ORDER_SHOW_SHIPPING_ADDRESS", $conf->entity);
|
||||
}
|
||||
|
||||
// Terms of sale
|
||||
if ($_FILES['termsofsale']["name"]) {
|
||||
if (!preg_match('/(\.pdf)$/i', $_FILES['termsofsale']["name"])) { // Document can be used on a lot of different places. Only pdf can be supported.
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorBadFormat"), null, 'errors');
|
||||
} else {
|
||||
$original_file = $_FILES['termsofsale']["name"];
|
||||
$result = dol_move_uploaded_file($_FILES['termsofsale']["tmp_name"], $dirforterms.$original_file, 1, 0, $_FILES['termsofsale']['error']);
|
||||
if ($result) {
|
||||
dolibarr_set_const($db, 'MAIN_INFO_ORDER_TERMSOFSALE', $original_file, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Terms of sale
|
||||
if ($action == 'removetermsofsale') {
|
||||
$filename = getDolGlobalString('MAIN_INFO_ORDER_TERMSOFSALE');
|
||||
$file = $dirforterms.'/'.$filename;
|
||||
|
||||
if ($filename != '') {
|
||||
dol_delete_file($file);
|
||||
}
|
||||
dolibarr_del_const($db, 'MAIN_INFO_ORDER_TERMSOFSALE', $conf->entity);
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$formfile = new FormFile($db);
|
||||
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
|
||||
llxHeader('', $langs->trans("OrdersSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-order');
|
||||
|
||||
//if ($mesg) print $mesg;
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("OrdersSetup"), $linkback, 'title_setup');
|
||||
|
||||
$head = order_admin_prepare_head();
|
||||
|
||||
print dol_get_fiche_head($head, 'pdf', $langs->trans("Orders"), -1, 'order');
|
||||
|
||||
print '<form enctype="multipart/form-data" method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px"></td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_ORDER"), $langs->trans("PdfAddTermOfSaleHelp"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_ORDER');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_ORDER", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_ORDER);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESS"), $langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESSMore"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('SALES_ORDER_SHOW_SHIPPING_ADDRESS');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("SALES_ORDER_SHOW_SHIPPING_ADDRESS", $arrval, $conf->global->SALES_ORDER_SHOW_SHIPPING_ADDRESS);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print load_fiche_titre($langs->trans("Files"), '', 'file');
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px"></td></tr>';
|
||||
|
||||
// Terms of sale
|
||||
$tooltiptermsofsale = $langs->trans('AvailableFormats').' : pdf';
|
||||
$maxfilesizearray = getMaxFileSizeArray();
|
||||
$tooltiptermsofsale .= ($maxfilesizearray['maxmin'] > 0) ? '<br>'.$langs->trans('MaxSize').' : '.$maxfilesizearray['maxmin'].' '.$langs->trans('Kb') : '';
|
||||
$documenturl = DOL_URL_ROOT.'/document.php';
|
||||
if (isset($conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) {
|
||||
$documenturl = $conf->global->DOL_URL_ROOT_DOCUMENT_PHP;
|
||||
}
|
||||
$modulepart = 'order';
|
||||
|
||||
print '<tr class="oddeven"><td><label for="logo">'.$form->textwithpicto($langs->trans("TERMSOFSALE"), $tooltiptermsofsale).'</label></td><td>';
|
||||
print '<div class="centpercent nobordernopadding valignmiddle "><div class="inline-block marginrightonly">';
|
||||
print '<input type="file" class="flat minwidth100 maxwidthinputfileonsmartphone" name="termsofsale" id="termsofsale" accept="application/pdf">';
|
||||
|
||||
if (getDolGlobalString("MAIN_INFO_ORDER_TERMSOFSALE")) {
|
||||
$termofsale = getDolGlobalString("MAIN_INFO_ORDER_TERMSOFSALE");
|
||||
if (file_exists($dirforterms.'/'.$termofsale)) {
|
||||
$file = dol_dir_list($dirforterms, 'files', 0, $termofsale);
|
||||
print '<div class="inline-block valignmiddle marginrightonly"><a href="'.$documenturl.'?modulepart='.$modulepart.'&file='.urlencode($termofsale).'">'.$termofsale.'</a>'.$formfile->showPreview($file[0], $modulepart, $termofsale, 0, '');
|
||||
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removetermsofsale&token='.newToken().'">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
|
||||
}
|
||||
}
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<center><input type="submit" class="button button-edit reposition" value="'.$langs->trans("Modify").'"></center>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
|
@ -224,11 +224,33 @@ if (isModEnabled('propal')) {
|
|||
print ajax_constantonoff('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", $arrval, $conf->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING);
|
||||
print $form->selectarray("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", $arrval, getDolGlobalString('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
*/
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("PDF_XXX_SHOW_PRICE_INCL_TAX"), $langs->trans("AvailableWithSomePDFTemplatesOnly"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('PDF_PROPAL_SHOW_PRICE_INCL_TAX');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("PDF_PROPAL_SHOW_PRICE_INCL_TAX", $arrval, getDolGlobalString('PDF_PROPAL_SHOW_PRICE_INCL_TAX'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, getDolGlobalString('MAIN_GENERATE_PROPOSALS_WITH_PICTURE'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_PROPAL"), $langs->trans("PdfAddTermOfSaleHelp"));
|
||||
print '</td><td>';
|
||||
|
|
@ -236,18 +258,7 @@ if (isModEnabled('propal')) {
|
|||
print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_PROPAL');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_PROPAL", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_PROPAL);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, $conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE);
|
||||
print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_PROPAL", $arrval, getDolGlobalString('MAIN_PDF_ADD_TERMSOFSALE_PROPAL'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -261,7 +272,31 @@ if (isModEnabled('order')) {
|
|||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px"></td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("PDF_XXX_SHOW_PRICE_INCL_TAX"), $langs->trans("AvailableWithSomePDFTemplatesOnly"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('PDF_ORDER_SHOW_PRICE_INCL_TAX');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("PDF_ORDER_SHOW_PRICE_INCL_TAX", $arrval, getDolGlobalString('PDF_ORDER_SHOW_PRICE_INCL_TAX'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_ORDERS_WITH_PICTURE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_ORDERS_WITH_PICTURE", $arrval, getDolGlobalString('MAIN_GENERATE_ORDERS_WITH_PICTURE'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_ORDER"), $langs->trans("PdfAddTermOfSaleHelp"));
|
||||
print '</td><td>';
|
||||
|
|
@ -269,18 +304,18 @@ if (isModEnabled('order')) {
|
|||
print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_ORDER');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_ORDER", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_ORDER);
|
||||
print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_ORDER", $arrval, getDolGlobalString('MAIN_PDF_ADD_TERMSOFSALE_ORDER'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESS"), $langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESSMore"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('SALES_ORDER_SHOW_SHIPPING_ADDRESS');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("SALES_ORDER_SHOW_SHIPPING_ADDRESS", $arrval, $conf->global->SALES_ORDER_SHOW_SHIPPING_ADDRESS);
|
||||
print $form->selectarray("SALES_ORDER_SHOW_SHIPPING_ADDRESS", $arrval, getDolGlobalString('SALES_ORDER_SHOW_SHIPPING_ADDRESS'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -289,74 +324,6 @@ if (isModEnabled('order')) {
|
|||
}
|
||||
|
||||
|
||||
if (isModEnabled('supplier_proposal')) {
|
||||
$langs->load("supplier_proposal");
|
||||
print load_fiche_titre($langs->trans("SupplierProposal"), '', 'supplier_proposal');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px"></td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE"), '');
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN"), '');
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
if (isModEnabled('supplier_order')) {
|
||||
$langs->load("supplier_order");
|
||||
print load_fiche_titre($langs->trans("SupplierOrder"), '', 'supplier_proposal');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px"></td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE"), '');
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN"), '');
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
if (isModEnabled('invoice')) {
|
||||
print load_fiche_titre($langs->trans("Invoices"), '', 'bill');
|
||||
|
|
@ -365,6 +332,28 @@ if (isModEnabled('invoice')) {
|
|||
print '<table summary="more" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px"></td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("PDF_XXX_SHOW_PRICE_INCL_TAX"), $langs->trans("AvailableWithSomePDFTemplatesOnly"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('PDF_INVOICE_SHOW_PRICE_INCL_TAX');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("PDF_INVOICE_SHOW_PRICE_INCL_TAX", $arrval, getDolGlobalString('PDF_INVOICE_SHOW_PRICE_INCL_TAX'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_INVOICES_WITH_PICTURE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_INVOICES_WITH_PICTURE", $arrval, getDolGlobalString('MAIN_GENERATE_INVOICES_WITH_PICTURE'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_INVOICE"), $langs->trans("PdfAddTermOfSaleHelp"));
|
||||
print '</td><td>';
|
||||
|
|
@ -372,9 +361,10 @@ if (isModEnabled('invoice')) {
|
|||
print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_INVOICE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_INVOICE", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_INVOICE);
|
||||
print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_INVOICE", $arrval, getDolGlobalString('MAIN_PDF_ADD_TERMSOFSALE_INVOICE'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("INVOICE_ADD_ZATCA_QR_CODE"), $langs->trans("INVOICE_ADD_ZATCA_QR_CODEMore"));
|
||||
print '</td><td>';
|
||||
|
|
@ -430,7 +420,7 @@ if (isModEnabled('invoice')) {
|
|||
print ajax_constantonoff('INVOICE_SHOW_SHIPPING_ADDRESS');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("INVOICE_SHOW_SHIPPING_ADDRESS", $arrval, $conf->global->INVOICE_SHOW_SHIPPING_ADDRESS);
|
||||
print $form->selectarray("INVOICE_SHOW_SHIPPING_ADDRESS", $arrval, getDolGlobalString('INVOICE_SHOW_SHIPPING_ADDRESS'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -466,7 +456,77 @@ if (isModEnabled('invoice')) {
|
|||
print ajax_constantonoff('INVOICE_HIDE_LINKED_OBJECT');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("INVOICE_HIDE_LINKED_OBJECT", $arrval, $conf->global->INVOICE_HIDE_LINKED_OBJECT);
|
||||
print $form->selectarray("INVOICE_HIDE_LINKED_OBJECT", $arrval, getDolGlobalString('INVOICE_HIDE_LINKED_OBJECT'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
if (isModEnabled('supplier_proposal')) {
|
||||
$langs->load("supplier_proposal");
|
||||
print load_fiche_titre($langs->trans("SupplierProposal"), '', 'supplier_proposal');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px"></td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE"), '');
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN"), '');
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
if (isModEnabled('supplier_order')) {
|
||||
$langs->load("supplier_order");
|
||||
print load_fiche_titre($langs->trans("SupplierOrder"), '', 'supplier_proposal');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px"></td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE"), '');
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN"), '');
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -495,7 +555,6 @@ if (isModEnabled('shipping')) {
|
|||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
if (isModEnabled('reception')) {
|
||||
print load_fiche_titre($langs->trans("Receptions"), '', 'reception');
|
||||
|
||||
|
|
@ -572,7 +631,7 @@ $maxfilesizearray = getMaxFileSizeArray();
|
|||
$tooltiptermsofsale .= ($maxfilesizearray['maxmin'] > 0) ? '<br>'.$langs->trans('MaxSize').' : '.$maxfilesizearray['maxmin'].' '.$langs->trans('Kb') : '';
|
||||
$documenturl = DOL_URL_ROOT.'/document.php';
|
||||
if (isset($conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) {
|
||||
$documenturl = $conf->global->DOL_URL_ROOT_DOCUMENT_PHP;
|
||||
$documenturl = getDolGlobalString('DOL_URL_ROOT_DOCUMENT_PHP');
|
||||
}
|
||||
$modulepart = 'mycompany';
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ print '<tr class="oddeven"><td width="300">'.$langs->trans("Password").'</td><td
|
|||
print '<tr class="oddeven"><td width="300">'.$langs->trans("DBStoringCharset").'</td><td>'.$db->getDefaultCharacterSetDatabase();
|
||||
if ($db->type == 'mysqli') {
|
||||
$tooltipexample = "<br>SHOW VARIABLES LIKE 'character_set_database' (cached)<br>You can avoid cache effect with:<br>SELECT DEFAULT_CHARACTER_SET_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = '".$db->escape($conf->db->name)."'";
|
||||
print ' '.$form->textwithpicto('', $langs->transnoentitiesnoconv("HelpMariaDBToGetValue", $tooltipexample.'<br>'.$langs->transnoentitiesnoconv("HelpMariaDBToGetPossibleValues", "<br>SHOW CHARSET")));
|
||||
print ' '.$form->textwithpicto('', $langs->transnoentitiesnoconv("HelpMariaDBToGetValue", $tooltipexample.'<br>'.$langs->transnoentitiesnoconv("HelpMariaDBToGetPossibleValues", "<br>SHOW CHARSET")."<br><br>Example to change value: ALTER DATABASE ".$conf->db->name." CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"));
|
||||
// We can use $db->getDefaultCharacterSetDatabase(), $db->getListOfCharacterSet(),
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
|
|
@ -107,7 +107,7 @@ if ($db->type == 'mysqli') {
|
|||
print img_warning('The database default value of collation '.$defaultcollation.' differs from conf setup '.$conf->db->dolibarr_main_db_collation);
|
||||
}
|
||||
$tooltipexample = "<br>SHOW VARIABLES LIKE 'collation_database' (cached)<br>You can avoid cache effect with:<br>SELECT DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = '".$db->escape($conf->db->name)."'";
|
||||
print ' '.$form->textwithpicto('', $langs->transnoentitiesnoconv("HelpMariaDBToGetValue", $tooltipexample.'<br>'.$langs->transnoentitiesnoconv("HelpMariaDBToGetPossibleValues", "<br>SHOW COLLATION")));
|
||||
print ' '.$form->textwithpicto('', $langs->transnoentitiesnoconv("HelpMariaDBToGetValue", $tooltipexample.'<br>'.$langs->transnoentitiesnoconv("HelpMariaDBToGetPossibleValues", "<br>SHOW COLLATION")."<br><br>Example to change value: ALTER DATABASE ".$conf->db->name." CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"));
|
||||
// We can use $db->getDefaultCollationDatabase(), $db->getListOfCollation();
|
||||
|
||||
print ' <span class="opacitymedium small">'.$langs->trans("ConvertInto");
|
||||
|
|
|
|||
|
|
@ -155,6 +155,15 @@ class Documentation
|
|||
'DocSetEventMessageContextualVariations' => '#seteventmessagesection-contextvariations',
|
||||
)
|
||||
),
|
||||
'Inputs' => array(
|
||||
'url' => dol_buildpath($baseUrl.'/components/inputs.php', 1),
|
||||
'icon' => 'fas fa-comments pictofixedwidth',
|
||||
'submenu' => array(),
|
||||
'summary' => array(
|
||||
'DocBasicUsage' => '#setinputssection-basicusage',
|
||||
'DocHelperFunctionsInputUsage' => '#setinputssection-helperfunctions',
|
||||
)
|
||||
),
|
||||
),
|
||||
'summary' => array(
|
||||
'keySum' => '#keySum'
|
||||
|
|
|
|||
308
htdocs/admin/tools/ui/components/inputs.php
Normal file
308
htdocs/admin/tools/ui/components/inputs.php
Normal file
|
|
@ -0,0 +1,308 @@
|
|||
<?php
|
||||
/*
|
||||
* Copyright (C) 2024 Anthony Damhet <a.damhet@progiseize.fr>
|
||||
*
|
||||
* This program and files/directory inner it is free software: you can
|
||||
* redistribute it and/or modify it under the terms of the
|
||||
* GNU Affero General Public License (AGPL) as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AGPL for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU AGPL
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/agpl-3.0.html>.
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../../../main.inc.php';
|
||||
|
||||
/**
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
|
||||
// Protection if external user
|
||||
if ($user->socid > 0) : accessforbidden();
|
||||
endif;
|
||||
|
||||
// Includes
|
||||
dol_include_once('admin/tools/ui/class/documentation.class.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
|
||||
// Load documentation translations
|
||||
$langs->load('uxdocumentation');
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
|
||||
//
|
||||
$documentation = new Documentation($db);
|
||||
|
||||
// Output html head + body - Param is Title
|
||||
$documentation->docHeader('Inputs');
|
||||
|
||||
// Set view for menu and breadcrumb
|
||||
// Menu must be set in constructor of documentation class
|
||||
$documentation->view = array('Components','Inputs');
|
||||
|
||||
// Output sidebar
|
||||
$documentation->showSidebar(); ?>
|
||||
|
||||
<div class="doc-wrapper">
|
||||
|
||||
<?php $documentation->showBreadCrumb(); ?>
|
||||
|
||||
<div class="doc-content-wrapper">
|
||||
|
||||
<h1 class="documentation-title"><?php echo $langs->trans('DocInputsTitle'); ?></h1>
|
||||
<p class="documentation-text"><?php echo $langs->trans('DocInputsMainDescription'); ?></p>
|
||||
|
||||
<!-- Summary -->
|
||||
<?php $documentation->showSummary(); ?>
|
||||
|
||||
<!-- Basic usage -->
|
||||
<div class="documentation-section" id="setinputssection-basicusage">
|
||||
<h2 class="documentation-title"><?php echo $langs->trans('DocBasicUsage'); ?></h2>
|
||||
<!-- Classic Input -->
|
||||
<p class="documentation-text"><?php echo $langs->trans('DocClassicInputsDescription'); ?></p>
|
||||
<div class="documentation-example">
|
||||
<td>Available Input</td>
|
||||
<td><input id="label" name="label" class="minwidth200" maxlength="255" value=""></td>
|
||||
<br><br>
|
||||
<td>Disabled Input</td>
|
||||
<td><input id="label" name="label" class="minwidth200" maxlength="255" value="" disabled></td>
|
||||
</div>
|
||||
<?php
|
||||
$lines = array(
|
||||
'<td>Available Input</td>',
|
||||
'<td><input id="label" name="label" class="minwidth200" maxlength="255" value=""></td>',
|
||||
'',
|
||||
'<td>Disabled Input</td>',
|
||||
'<td><input id="label" name="label" class="minwidth200" maxlength="255" value="" disabled></td>',
|
||||
);
|
||||
echo $documentation->showCode($lines); ?>
|
||||
|
||||
<!-- Checkbox input -->
|
||||
<p class="documentation-text"><?php echo $langs->trans('DocCheckboxInputsDescription'); ?></p>
|
||||
<div class="documentation-example">
|
||||
<span class="spannature paddinglarge marginrightonly nonature-back"><label for="prospectinput" class="valignmiddle">Prospect<input id="prospectinput2" class="flat checkforselect marginleftonly valignmiddle" type="checkbox" name="customer" value="1" checked></label></span>
|
||||
<span class="spannature paddinglarge marginrightonly nonature-back"><label for="customerinput" class="valignmiddle">Customer<input id="customerinput2" class="flat checkforselect marginleftonly valignmiddle" type="checkbox" name="customer" value="1" checked></label></span>
|
||||
<span class="spannature paddinglarge marginrightonly nonature-back"><label for="supplierinput" class="valignmiddle">Supplier<input id="supplierinput2" class="flat checkforselect marginleftonly valignmiddle" type="checkbox" name="customer" value="1" checked></label></span>
|
||||
</div>
|
||||
<?php
|
||||
$lines = array(
|
||||
'<span class="spannature paddinglarge marginrightonly nonature-back"><label for="prospectinput" class="valignmiddle">Prospect<input id="prospectinput" class="flat checkforselect marginleftonly valignmiddle" type="checkbox" name="customer" value="1" checked></label></span>',
|
||||
'<span class="spannature paddinglarge marginrightonly nonature-back"><label for="customerinput" class="valignmiddle">Customer<input id="customerinput" class="flat checkforselect marginleftonly valignmiddle" type="checkbox" name="customer" value="1" checked></label></span>',
|
||||
'<span class="spannature paddinglarge marginrightonly nonature-back"><label for="supplierinput" class="valignmiddle">Supplier<input id="supplierinput" class="flat checkforselect marginleftonly valignmiddle" type="checkbox" name="customer" value="1" checked></label></span>',
|
||||
);
|
||||
echo $documentation->showCode($lines); ?>
|
||||
|
||||
<!-- Radio input -->
|
||||
<p class="documentation-text"><?php echo $langs->trans('DocRadioInputsDescription'); ?></p>
|
||||
<div class="documentation-example">
|
||||
<input type="radio" name="radioinput" value="radioinput"> Radio Input
|
||||
</div>
|
||||
<?php
|
||||
$lines = array(
|
||||
'<input type="radio" name="radioinput" value="radioinput"> Radio Input'
|
||||
);
|
||||
echo $documentation->showCode($lines); ?>
|
||||
</div>
|
||||
|
||||
<!-- Helper functions -->
|
||||
<div class="documentation-section" id="setinputssection-helperfunctions">
|
||||
<h2 class="documentation-title"><?php echo $langs->trans('DocHelperFunctionsInputUsage'); ?></h2>
|
||||
<p class="documentation-text"><?php echo $langs->trans('DocSelectInputsDescription'); ?></p>
|
||||
<div class="documentation-example">
|
||||
<td>Select with empty value</td>
|
||||
<?php
|
||||
$values = ['1' => 'value 1', '2' => 'value 2', '3' => 'value 3'];
|
||||
$form = new Form($db);
|
||||
print $form->selectarray('htmlnameselectwithemptyvalue', $values, 'idselectwithemptyvalue', 1, 0, 0, '', 0, 0, 0, '', 'minwidth200');
|
||||
?>
|
||||
<br><br>
|
||||
<td>Select within empty value</td>
|
||||
<?php
|
||||
$values = ['1' => 'value 1', '2' => 'value 2', '3' => 'value 3'];
|
||||
$form = new Form($db);
|
||||
print $form->selectarray('htmlnameselectwithinemptyvalue', $values, 'idnameselectwithinemptyvalue', 0, 0, 0, '', 0, 0, 0, '', 'minwidth200');
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
$lines = array(
|
||||
'<?php',
|
||||
'/**',
|
||||
' * Function selectarray',
|
||||
' *',
|
||||
' * @param string $htmlname Name of html select area. Try to start name with "multi" or "search_multi" if this is a multiselect,',
|
||||
' * @param array $array Array like array(key => value) or array(key=>array(\'label\'=>..., \'data-...\'=>..., \'disabled\'=>..., \'css\'=>...)),',
|
||||
' * @param string|string[]|int $id Preselected key or array of preselected keys for multiselect. Use \'ifone\' to autoselect record if there is only one record.,',
|
||||
' * @param int<0,1>|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (If 1: key is -1 and value is \'\' or " ", If \'Placeholder string\': key is -1 and value is the string), <0 to add an empty value with key that is this value.,',
|
||||
' * @param int<0,1> $key_in_label 1 to show key into label with format "[key] value",',
|
||||
' * @param int<0,1> $value_as_key 1 to use value as key,',
|
||||
' * @param string $moreparam Add more parameters onto the select tag. For example "style=\"width: 95%\"" to avoid select2 component to go over parent container,',
|
||||
' * @param int<0,1> $translate 1=Translate and encode value,',
|
||||
' * @param int $maxlen Length maximum for labels,',
|
||||
' * @param int<0,1> $disabled Html select box is disabled,',
|
||||
' * @param string $sort \'ASC\' or \'DESC\' = Sort on label, \'\' or \'NONE\' or \'POS\' = Do not sort, we keep original order,',
|
||||
' * @param string $morecss Add more class to css styles,',
|
||||
' * @param int $addjscombo Add js combo,',
|
||||
' * @param string $moreparamonempty Add more param on the empty option line. Not used if show_empty not set,',
|
||||
' * @param int $disablebademail 1=Check if a not valid email, 2=Check string \'---\', and if found into value, disable and colorize entry,',
|
||||
' * @param int $nohtmlescape No html escaping (not recommended, use \'data-html\' if you need to use label with HTML content).,',
|
||||
' * @return string HTML select string.,',
|
||||
' */',
|
||||
'',
|
||||
'<td>Select with empty value</td>',
|
||||
'print $form->selectarray(\'htmlnameselectwithemptyvalue\', $values, \'idselectwithemptyvalue\', 1, 0, 0, \'\', 0, 0, 0, \'\', \'minwidth200\');',
|
||||
'',
|
||||
'<td>Select within empty value</td>',
|
||||
'print $form->selectarray(\'htmlnameselectwithinemptyvalue\', $values, \'idnameselectwithinemptyvalue\', 0,0, 0, \'\', 0, 0, 0, \'\', \'minwidth200\');',
|
||||
|
||||
);
|
||||
echo $documentation->showCode($lines); ?>
|
||||
|
||||
<!-- Multiselect input -->
|
||||
<p class="documentation-text"><?php echo $langs->trans('DocMultiSelectInputsDescription'); ?></p>
|
||||
<div class="documentation-example">
|
||||
<td>Multiselect</td>
|
||||
<?php
|
||||
$values = ['1' => 'value 1', '2' => 'value 2', '3' => 'value 3'];
|
||||
$form = new Form($db);
|
||||
print $form->multiselectarray('categories', $values, GETPOST('categories', 'array'), 0, 0, 'minwidth200', 0, 0);
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
$lines = array(
|
||||
'<?php',
|
||||
'/**',
|
||||
' * Show a multiselect form from an array. WARNING: Use this only for short lists.',
|
||||
' *',
|
||||
' * @param string $htmlname Name of select',
|
||||
' * @param array<string,string|array{id:string,label:string,color:string,picto:string,labelhtml:string}> $array Array(key=>value) or Array(key=>array(\'id\'=>key, \'label\'=>value, \'color\'=> , \'picto\'=> , \'labelhtml\'=> ))',
|
||||
' * @param string[] $selected Array of keys preselected',
|
||||
' * @param int<0,1> $key_in_label 1 to show key like in "[key] value"',
|
||||
' * @param int<0,1> $value_as_key 1 to use value as key',
|
||||
' * @param string $morecss Add more css style',
|
||||
' * @param int<0,1> $translate Translate and encode value',
|
||||
' * @param int|string $width Force width of select box. May be used only when using jquery couch. Example: 250, \'95%\'',
|
||||
' * @param string $moreattrib Add more options on select component. Example: \'disabled\'',
|
||||
' * @param string $elemtype Type of element we show (\'category\', ...). Will execute a formatting function on it. To use in readonly mode if js component support HTML formatting.',
|
||||
' * @param string $placeholder String to use as placeholder',
|
||||
' * @param int<-1,1> $addjscombo Add js combo',
|
||||
' * @return string HTML multiselect string',
|
||||
' * @see selectarray(), selectArrayAjax(), selectArrayFilter()',
|
||||
' */',
|
||||
'',
|
||||
'<td>Multiselect</td>',
|
||||
'print $form->multiselectarray(\'categories\', $values, GETPOST(\'categories\', \'array\'), 0, 0, \'minwidth200\', 0, 0);'
|
||||
);
|
||||
echo $documentation->showCode($lines); ?>
|
||||
|
||||
<!-- Date input -->
|
||||
<p class="documentation-text"><?php echo $langs->trans('DocDateSelectInputsDescription'); ?></p>
|
||||
<div class="documentation-example">
|
||||
<td>Date Select</td>
|
||||
<?php
|
||||
$values = ['1' => 'value 1', '2' => 'value 2', '3' => 'value 3'];
|
||||
$form = new Form($db);
|
||||
print $form->selectDate();
|
||||
?>
|
||||
<br><br>
|
||||
<td>Date Select with hours</td>
|
||||
<?php
|
||||
$values = ['1' => 'value 1', '2' => 'value 2', '3' => 'value 3'];
|
||||
$form = new Form($db);
|
||||
print $form->selectDate('', 're2', 1, 1, 1);
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
$lines = array(
|
||||
'/**',
|
||||
' * Show a HTML widget to input a date or combo list for day, month, years and optionally hours and minutes.,',
|
||||
' * Fields are preselected with :,',
|
||||
' * - set_time date (must be a local PHP server timestamp or string date with format \'YYYY-MM-DD\' or \'YYYY-MM-DD HH:MM\'),',
|
||||
' * - local date in user area, if set_time is \'\' (so if set_time is \'\', output may differs when done from two different location),',
|
||||
' * - Empty (fields empty), if set_time is -1 (in this case, parameter empty must also have value 1),',
|
||||
' *',
|
||||
' * @param integer|string $set_time Pre-selected date (must be a local PHP server timestamp), -1 to keep date not preselected, \'\' to use current date with 00:00 hour (Parameter \'empty\' must be 0 or 2).,',
|
||||
' * @param string $prefix Prefix for fields name,',
|
||||
' * @param int $h 1 or 2=Show also hours (2=hours on a new line), -1 has same effect but hour and minutes are prefilled with 23:59 if date is empty, 3 or 4 (4=hours on a new line)=Show hour always empty,',
|
||||
' * @param int $m 1=Show also minutes, -1 has same effect but hour and minutes are prefilled with 23:59 if date is empty, 3 show minutes always empty,',
|
||||
' * @param int $empty 0=Fields required, 1=Empty inputs are allowed, 2=Empty inputs are allowed for hours only,',
|
||||
' * @param string $form_name Not used,',
|
||||
' * @param int<0,1> $d 1=Show days, month, years,',
|
||||
' * @param int<0,2> $addnowlink Add a link "Now", 1 with server time, 2 with local computer time,',
|
||||
' * @param int<0,1> $disabled Disable input fields,',
|
||||
' * @param int|string $fullday When a checkbox with id #fullday is checked, hours are set with 00:00 (if value if \'fulldaystart\') or 23:59 (if value is \'fulldayend\'),',
|
||||
' * @param string $addplusone Add a link "+1 hour". Value must be name of another selectDate field.,',
|
||||
' * @param int|string|array<string,mixed> $adddateof Add a link "Date of ..." using the following date. Must be array(array(\'adddateof\' => ..., \'labeladddateof\' => ...)),',
|
||||
' * @param string $openinghours Specify hour start and hour end for the select ex 8,20,',
|
||||
' * @param int $stepminutes Specify step for minutes between 1 and 30,',
|
||||
' * @param string $labeladddateof Label to use for the $adddateof parameter. Deprecated. Used only when $adddateof is not an array.,',
|
||||
' * @param string $placeholder Placeholder,',
|
||||
' * @param \'auto\'|\'gmt\'|\'tzserver\'|\'tzuserrel\' $gm \'auto\' (for backward compatibility, avoid this), \'gmt\' or \'tzserver\' or \'tzuserrel\',',
|
||||
' * @param string $calendarpicto URL of the icon/image used to display the calendar,',
|
||||
' * @return string Html for selectDate,',
|
||||
' * @see form_date(), select_month(), select_year(), select_dayofweek(),',
|
||||
' */',
|
||||
'',
|
||||
'<td>Date Select</td>',
|
||||
'print $form->selectDate();',
|
||||
'',
|
||||
'<td>Date Select with hours</td>',
|
||||
'print $form->selectDate(\'\', \'re2\', 1, 1, 1);'
|
||||
);
|
||||
echo $documentation->showCode($lines); ?>
|
||||
|
||||
|
||||
<!-- Editor input -->
|
||||
<p class="documentation-text"><?php echo $langs->trans('DocEditorInputsDescription'); ?></p>
|
||||
<div class="documentation-example">
|
||||
<?php
|
||||
$doleditor = new DolEditor('desc', GETPOST('desc', 'restricthtml'), '', 160, 'dolibarr_details', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_DETAILS'), ROWS_4, '90%');
|
||||
$doleditor->Create();
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
$lines = array(
|
||||
'<?php',
|
||||
'/**',
|
||||
' * Create an object to build an HTML area to edit a large string content',
|
||||
' *',
|
||||
' * @param string $htmlname HTML name of WYSIWYG field',
|
||||
' * @param string $content Content of WYSIWYG field',
|
||||
' * @param int|string $width Width in pixel of edit area (auto by default)',
|
||||
' * @param int $height Height in pixel of edit area (200px by default)',
|
||||
' * @param string $toolbarname Name of bar set to use (\'Full\', \'dolibarr_notes[_encoded]\', \'dolibarr_details[_encoded]\'=the less featured, \'dolibarr_mailings[_encoded]\', \'dolibarr_readonly\')',
|
||||
' * @param string $toolbarlocation Deprecated. Not used',
|
||||
' * @param bool $toolbarstartexpanded Bar is visible or not at start',
|
||||
' * @param bool|int $uselocalbrowser Enabled to add links to local object with local browser. If false, only external images can be added in content.',
|
||||
' * @param bool|int|string $okforextendededitor 1 or True=Allow usage of extended editor tool if qualified (like ckeditor). If \'textarea\', force use of simple textarea. If \'ace\', force use of Ace.',
|
||||
' * Warning: If you use \'ace\', don\'t forget to also include ace.js in page header. Also, the button "save" must have class="buttonforacesave"',
|
||||
' * @param int $rows Size of rows for textarea tool',
|
||||
' * @param string $cols Size of cols for textarea tool (textarea number of cols \'70\' or percent \'x%\')',
|
||||
' * @param int<0,1> $readonly 0=Read/Edit, 1=Read only',
|
||||
' * @param array{x?:string,y?:string,find?:string} $poscursor Array for initial cursor position array(\'x\'=>x, \'y\'=>y).',
|
||||
' * array(\'find\'=> \'word\') can be used to go to line were the word has been found',
|
||||
' */',
|
||||
'',
|
||||
'$doleditor = new DolEditor(\'desc\', GETPOST(\'desc\', \'restricthtml\'), \'\', 160, \'dolibarr_details\', \'\', false, true, getDolGlobalString(\'FCKEDITOR_ENABLE_DETAILS\'), ROWS_4, \'90%\');',
|
||||
'print $form->multiselectarray(\'categories\', $values, GETPOST(\'categories\', \'array\'), 0, 0, \'minwidth200\', 0, 0);'
|
||||
);
|
||||
echo $documentation->showCode($lines); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
// Output close body + html
|
||||
$documentation->docFooter();
|
||||
|
||||
?>
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
|
||||
require_once '../lib/ai.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT."/ai/lib/ai.lib.php";
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
|
|
@ -39,6 +39,8 @@ require_once '../lib/ai.lib.php';
|
|||
|
||||
$langs->loadLangs(array("admin", "website", "other"));
|
||||
|
||||
$arrayofaifeatures = getLitOfAIFeatures();
|
||||
|
||||
// Parameters
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
|
|
@ -81,18 +83,6 @@ $setupnotempty += count($formSetup->items);
|
|||
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
|
||||
// List of AI features
|
||||
$arrayofaifeatures = array(
|
||||
'textgenerationemail' => array('label' => $langs->trans('TextGeneration').' ('.$langs->trans("EmailContent").')', 'picto'=>'', 'status'=>'development'),
|
||||
'textgenerationwebpage' => array('label' => $langs->trans('TextGeneration').' ('.$langs->trans("WebsitePage").')', 'picto'=>'', 'status'=>'development'),
|
||||
'textgeneration' => array('label' => $langs->trans('TextGeneration').' ('.$langs->trans("Other").')', 'picto'=>'', 'status'=>'notused'),
|
||||
'imagegeneration' => array('label' => 'ImageGeneration', 'picto'=>'', 'status'=>'notused'),
|
||||
'videogeneration' => array('label' => 'VideoGeneration', 'picto'=>'', 'status'=>'notused'),
|
||||
'audiogeneration' => array('label' => 'AudioGeneration', 'picto'=>'', 'status'=>'notused'),
|
||||
'transcription' => array('label' => 'Transcription', 'picto'=>'', 'status'=>'notused'),
|
||||
'translation' => array('label' => 'Translation', 'picto'=>'', 'status'=>'notused')
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
|
|
@ -213,7 +203,7 @@ print load_fiche_titre($langs->trans($title), $linkback, 'title_setup');
|
|||
|
||||
// Configuration header
|
||||
$head = aiAdminPrepareHead();
|
||||
print dol_get_fiche_head($head, 'custom', $langs->trans($title), -1, "fa-microchip");
|
||||
print dol_get_fiche_head($head, 'custom', $langs->trans($title), -1, "ai");
|
||||
|
||||
//$newbutton = '<a href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("New").'</a>';
|
||||
$newbutton = '';
|
||||
|
|
@ -279,6 +269,7 @@ if ($action == 'edit' || $action == 'deleteproperty') {
|
|||
|
||||
$out .= '</td>';
|
||||
$out .= '</tr>';
|
||||
|
||||
$out .= '<tr class="oddeven">';
|
||||
$out .= '<td class="col-setup-title">';
|
||||
$out .= '<span id="prePrompt" class="spanforparamtooltip">';
|
||||
|
|
@ -314,6 +305,7 @@ if ($action == 'edit' || $action == 'deleteproperty') {
|
|||
|
||||
$out .= $form->buttonsSaveCancel("Add", "");
|
||||
$out .= '</form>';
|
||||
|
||||
$out .= '<br><br><br>';
|
||||
|
||||
print $out;
|
||||
|
|
@ -374,7 +366,7 @@ if ($action == 'edit' || $action == 'create' || $action == 'deleteproperty') {
|
|||
$out .= '<tr>';
|
||||
$out .= '<td></td>';
|
||||
$out .= '<td>';
|
||||
$out .= '<input type="submit" class="button small submitBtn reposition" name="modify" data-index="'.$key.'" value="'.dol_escape_htmltag($langs->trans("Modify")).'"/>';
|
||||
$out .= '<input type="submit" class="button small submitBtn reposition" name="modify" data-index="'.$key.'" value="'.dol_escape_htmltag($langs->trans("Save")).'"/>';
|
||||
$out .= ' ';
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
|
|
@ -383,6 +375,8 @@ if ($action == 'edit' || $action == 'create' || $action == 'deleteproperty') {
|
|||
$formmail = new FormMail($db);
|
||||
$htmlname = $key;
|
||||
|
||||
$out .= '<br><br>';
|
||||
|
||||
// Fill $out
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/formlayoutai.tpl.php';
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@
|
|||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
|
||||
require_once '../lib/ai.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php";
|
||||
require_once DOL_DOCUMENT_ROOT."/ai/lib/ai.lib.php";
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
|
|
@ -38,7 +39,9 @@ require_once '../lib/ai.lib.php';
|
|||
* @var User $user
|
||||
*/
|
||||
|
||||
$langs->loadLangs(array("admin"));
|
||||
$langs->loadLangs(array("admin", "website", "other"));
|
||||
|
||||
$arrayofaifeatures = getLitOfAIFeatures();
|
||||
|
||||
// Parameters
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
|
@ -49,10 +52,7 @@ if (empty($action)) {
|
|||
$action = 'edit';
|
||||
}
|
||||
|
||||
$value = GETPOST('value', 'alpha');
|
||||
$label = GETPOST('label', 'alpha');
|
||||
$scandir = GETPOST('scan_dir', 'alpha');
|
||||
$type = 'myobject';
|
||||
$content = GETPOST('content');
|
||||
|
||||
$error = 0;
|
||||
$setupnotempty = 0;
|
||||
|
|
@ -69,6 +69,7 @@ $formSetup = new FormSetup($db);
|
|||
|
||||
// List all available IA
|
||||
$arrayofia = array(
|
||||
'-1' => $langs->trans('SelectAService'),
|
||||
'chatgpt' => 'ChatGPT',
|
||||
'groq' => 'Groq',
|
||||
'custom' => 'Custom'
|
||||
|
|
@ -89,14 +90,14 @@ foreach ($arrayofia as $ia => $ialabel) {
|
|||
$item->nameText = $langs->trans("AI_API_KEY").' ('.$ialabel.')';
|
||||
$item->defaultFieldValue = '';
|
||||
$item->fieldParams['hideGenerateButton'] = 1;
|
||||
$item->fieldParams['trClass'] = $ia;
|
||||
$item->cssClass = 'minwidth500 text-security';
|
||||
$item->fieldParams['trClass'] = 'iaservice '.$ia;
|
||||
$item->cssClass = 'minwidth500 text-security input'.$ia;
|
||||
|
||||
$item = $formSetup->newItem('AI_API_'.strtoupper($ia).'_URL'); // Name of constant must end with _KEY so it is encrypted when saved into database.
|
||||
$item->nameText = $langs->trans("AI_API_URL").' ('.$ialabel.')';
|
||||
$item->defaultFieldValue = '';
|
||||
$item->fieldParams['trClass'] = $ia;
|
||||
$item->cssClass = 'minwidth500';
|
||||
$item->fieldParams['trClass'] = 'iaservice '.$ia;
|
||||
$item->cssClass = 'minwidth500 input'.$ia;
|
||||
}
|
||||
|
||||
$setupnotempty = + count($formSetup->items);
|
||||
|
|
@ -140,7 +141,7 @@ print load_fiche_titre($langs->trans($title), $linkback, 'title_setup');
|
|||
|
||||
// Configuration header
|
||||
$head = aiAdminPrepareHead();
|
||||
print dol_get_fiche_head($head, 'settings', $langs->trans($title), -1, "fa-microchip");
|
||||
print dol_get_fiche_head($head, 'settings', $langs->trans($title), -1, "ai");
|
||||
|
||||
|
||||
if ($action == 'edit') {
|
||||
|
|
@ -160,8 +161,86 @@ if (empty($setupnotempty)) {
|
|||
print '<br>'.$langs->trans("NothingToSetup");
|
||||
}
|
||||
|
||||
print '<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
function showHideAIService(aiservice) {
|
||||
console.log("We select the AI service "+aiservice);
|
||||
jQuery(".iaservice").hide();
|
||||
|
||||
if (aiservice != "-1") {
|
||||
jQuery(".iaservice."+aiservice).show();
|
||||
}
|
||||
}
|
||||
|
||||
jQuery("#AI_API_SERVICE").change(function() {
|
||||
var aiservice = $(this).val();
|
||||
|
||||
showHideAIService(aiservice);
|
||||
});
|
||||
|
||||
showHideAIService("'.getDolGlobalString("AI_API_SERVICE").'");
|
||||
});
|
||||
</script>';
|
||||
|
||||
// Page end
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
if (getDolGlobalString("AI_API_SERVICE")) {
|
||||
// Section to test
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
|
||||
$functioncode = GETPOST('functioncode');
|
||||
$out = '';
|
||||
|
||||
if ($functioncode) {
|
||||
$labeloffeature = empty($arrayofaifeatures[GETPOST('functioncode')]['label']) ? 'Undefined' : $arrayofaifeatures[GETPOST('functioncode')]['label'];
|
||||
|
||||
//$out .= $langs->trans("Test").' '.$labeloffeature.'...<br><br>';
|
||||
|
||||
if (GETPOST('functioncode') == 'textgenerationemail') {
|
||||
$key = 'textgenerationemail'; // The HTML ID of field to fill
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
$showlinktoai = $key; // 'textgeneration', 'imagegeneration', ...
|
||||
$showlinktoailabel = $langs->trans("Test").' '.$labeloffeature;
|
||||
$showlinktolayout = 0;
|
||||
$formmail = new FormMail($db);
|
||||
$htmlname = $key;
|
||||
|
||||
// Fill $out
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/formlayoutai.tpl.php';
|
||||
|
||||
$out .= '<div id="'.$key.'"></div>';
|
||||
} else {
|
||||
$out .= $langs->trans("FeatureNotYetAvailable").'<br><br>';
|
||||
$functioncode = '';
|
||||
}
|
||||
}
|
||||
|
||||
if (!$functioncode) {
|
||||
// Combo list of AI features
|
||||
$out .= '<select name="functioncode" id="functioncode" class="flat minwidth300" placeholder="Test feature">';
|
||||
$out .= '<option value="-1">'.$langs->trans("SelectFeatureToTest").'</option>';
|
||||
foreach ($arrayofaifeatures as $key => $val) {
|
||||
$labelhtml = $langs->trans($arrayofaifeatures[$key]['label']).($arrayofaifeatures[$key]['status'] == 'notused' ? ' <span class="opacitymedium">('.$langs->trans("NotYetAvailable").')</span>' : "");
|
||||
$labeltext = $langs->trans($arrayofaifeatures[$key]['label']);
|
||||
$out .= '<option value="'.$key.'" data-html="'.dol_escape_htmltag($labelhtml).'"';
|
||||
$out .= (GETPOST('functioncode') == $key ? ' selected="selected"' : '');
|
||||
$out .= '>'.dol_escape_htmltag($labeltext).'</option>';
|
||||
}
|
||||
$out .= '</select>';
|
||||
$out .= ajax_combobox("functioncode");
|
||||
|
||||
$out .= '<input class="button small" type="submit" name="testmode" value="'.$langs->trans("Test").'">';
|
||||
}
|
||||
print $out;
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
|
|
|||
|
|
@ -81,15 +81,17 @@ $format = empty($jsonData['format']) ? '' : $jsonData['format'];
|
|||
|
||||
$generatedContent = $ai->generateContent($instructions, 'auto', $function, $format);
|
||||
|
||||
if (is_array($generatedContent) && $generatedContent['error']) {
|
||||
if (is_null($generatedContent) || (is_array($generatedContent) && $generatedContent['error'])) {
|
||||
// Output error
|
||||
if (!empty($generatedContent['code']) && $generatedContent['code'] == 429) {
|
||||
print "Quota or allowed period exceeded. Retry Later !";
|
||||
} elseif ($generatedContent['code'] >= 400) {
|
||||
} elseif (!empty($generatedContent['code']) && $generatedContent['code'] >= 400) {
|
||||
print "Error : " . $generatedContent['message'];
|
||||
print '<br><a href="'.DOL_MAIN_URL_ROOT.'/ai/admin/setup.php">'.$langs->trans('ErrorGoToModuleSetup').'</a>';
|
||||
} else {
|
||||
} elseif (!empty($generatedContent['message'])) {
|
||||
print "Error returned by API call: " . $generatedContent['message'];
|
||||
} else {
|
||||
print "Error API returned no answer";
|
||||
}
|
||||
} else {
|
||||
if ($function == 'textgenerationemail' || $function == 'textgenerationwebpage') {
|
||||
|
|
|
|||
|
|
@ -80,6 +80,8 @@ class Ai
|
|||
*/
|
||||
public function generateContent($instructions, $model = 'auto', $function = 'textgeneration', $format = '')
|
||||
{
|
||||
global $dolibarr_main_data_root;
|
||||
|
||||
if (empty($this->apiKey)) {
|
||||
return array('error' => true, 'message' => 'API key is not defined for the AI enabled service ('.$this->apiService.')');
|
||||
}
|
||||
|
|
@ -192,14 +194,14 @@ class Ai
|
|||
|
||||
if (isset($configurations[$function])) {
|
||||
if (isset($configurations[$function]['prePrompt'])) {
|
||||
$prePrompt = $configurations[$function]['prePrompt']; // TODO We can send prePrompt into a separated message with role system.
|
||||
$prePrompt = $configurations[$function]['prePrompt'];
|
||||
}
|
||||
|
||||
if (isset($configurations[$function]['postPrompt'])) {
|
||||
$postPrompt = $configurations[$function]['postPrompt'];
|
||||
}
|
||||
}
|
||||
$fullInstructions = ($prePrompt ? $prePrompt.' ' : '').$instructions.($postPrompt ? '. '.$postPrompt : '');
|
||||
$fullInstructions = $instructions.($postPrompt ? (preg_match('/[\.\!\?]$/', $instructions) ? '' : '.').' '.$postPrompt : '');
|
||||
|
||||
// Set payload string
|
||||
/*{
|
||||
|
|
@ -224,18 +226,48 @@ class Ai
|
|||
"temperature": 0.7,
|
||||
"top_p": 0.95
|
||||
}*/
|
||||
$payload = json_encode([
|
||||
'messages' => [
|
||||
['role' => 'user', 'content' => $fullInstructions]
|
||||
],
|
||||
'model' => $model,
|
||||
//'stream' => false
|
||||
]);
|
||||
|
||||
$headers = ([
|
||||
$arrayforpayload = array(
|
||||
'messages' => array(array('role' => 'user', 'content' => $fullInstructions)),
|
||||
'model' => $model,
|
||||
);
|
||||
|
||||
// Add a system message
|
||||
$addDateTimeContext = false;
|
||||
if ($addDateTimeContext) { // @phpstan-ignore-line
|
||||
$prePrompt = ($prePrompt ? $prePrompt.(preg_match('/[\.\!\?]$/', $prePrompt) ? '' : '.').' ' : '').'Today we are '.dol_print_date(dol_now(), 'dayhourtext');
|
||||
}
|
||||
if ($prePrompt) {
|
||||
$arrayforpayload['messages'][] = array('role' => 'system', 'content' => $prePrompt);
|
||||
}
|
||||
|
||||
/*
|
||||
$arrayforpayload['temperature'] = 0.7;
|
||||
$arrayforpayload['max_tokens'] = -1;
|
||||
$arrayforpayload['stream'] = false;
|
||||
*/
|
||||
|
||||
$payload = json_encode($arrayforpayload);
|
||||
|
||||
$headers = array(
|
||||
'Authorization: Bearer ' . $this->apiKey,
|
||||
'Content-Type: application/json'
|
||||
]);
|
||||
);
|
||||
|
||||
if (getDolGlobalString("AI_DEBUG")) {
|
||||
if (@is_writable($dolibarr_main_data_root)) { // Avoid fatal error on fopen with open_basedir
|
||||
$outputfile = $dolibarr_main_data_root."/dolibarr_ai.log";
|
||||
$fp = fopen($outputfile, "w"); // overwrite
|
||||
|
||||
if ($fp) {
|
||||
fwrite($fp, var_export($headers, true)."\n");
|
||||
fwrite($fp, var_export($payload, true)."\n");
|
||||
|
||||
fclose($fp);
|
||||
dolChmod($outputfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$localurl = 2; // Accept both local and external endpoints
|
||||
$response = getURLContent($this->apiEndpoint, 'POST', $payload, 1, $headers, array('http', 'https'), $localurl);
|
||||
|
|
@ -248,7 +280,17 @@ class Ai
|
|||
}
|
||||
|
||||
if (getDolGlobalString("AI_DEBUG")) {
|
||||
dol_syslog("response content = ".var_export($response['content'], true));
|
||||
if (@is_writable($dolibarr_main_data_root)) { // Avoid fatal error on fopen with open_basedir
|
||||
$outputfile = $dolibarr_main_data_root."/dolibarr_ai.log";
|
||||
$fp = fopen($outputfile, "a");
|
||||
|
||||
if ($fp) {
|
||||
fwrite($fp, var_export((empty($response['content']) ? 'No content result' : $response['content']), true)."\n");
|
||||
|
||||
fclose($fp);
|
||||
dolChmod($outputfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Decode JSON response
|
||||
|
|
|
|||
|
|
@ -23,6 +23,30 @@
|
|||
* \brief Library files with common functions for Ai
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Prepare admin pages header
|
||||
*
|
||||
* @return array<string,array<string,string>>
|
||||
*/
|
||||
function getLitOfAIFeatures()
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$arrayofaifeatures = array(
|
||||
'textgenerationemail' => array('label' => $langs->trans('TextGeneration').' ('.$langs->trans("EmailContent").')', 'picto'=>'', 'status'=>'dolibarr'),
|
||||
'textgenerationwebpage' => array('label' => $langs->trans('TextGeneration').' ('.$langs->trans("WebsitePage").')', 'picto'=>'', 'status'=>'dolibarr'),
|
||||
'textgeneration' => array('label' => $langs->trans('TextGeneration').' ('.$langs->trans("Other").')', 'picto'=>'', 'status'=>'notused'),
|
||||
'imagegeneration' => array('label' => 'ImageGeneration', 'picto'=>'', 'status'=>'notused'),
|
||||
'videogeneration' => array('label' => 'VideoGeneration', 'picto'=>'', 'status'=>'notused'),
|
||||
'audiogeneration' => array('label' => 'AudioGeneration', 'picto'=>'', 'status'=>'notused'),
|
||||
'transcription' => array('label' => 'Transcription', 'picto'=>'', 'status'=>'notused'),
|
||||
'translation' => array('label' => 'Translation', 'picto'=>'', 'status'=>'notused')
|
||||
);
|
||||
|
||||
return $arrayofaifeatures;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare admin pages header
|
||||
*
|
||||
|
|
|
|||
|
|
@ -496,7 +496,7 @@ if (!empty($moreforfilter)) {
|
|||
}
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields
|
||||
$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column ? 'left' : ''); // This also change content of $arrayfields
|
||||
$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
|
||||
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2009-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -51,6 +51,8 @@ if (!defined('NOREQUIREAJAX')) {
|
|||
/**
|
||||
* Empty header
|
||||
*
|
||||
* Note: also called by functions.lib:recordNotFound
|
||||
*
|
||||
* @param string $head Optional head lines
|
||||
* @param string $title HTML title
|
||||
* @param string $help_url Url links to help page
|
||||
|
|
@ -68,7 +70,7 @@ if (!defined('NOREQUIREAJAX')) {
|
|||
* @param int $disablenoindex Disable the "noindex" on meta robot header
|
||||
* @return void
|
||||
*/
|
||||
function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0)
|
||||
function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) // @phan-suppress-current-line PhanRedefineFunction
|
||||
{
|
||||
print '<html>'."\n";
|
||||
print '<head>'."\n";
|
||||
|
|
@ -79,12 +81,14 @@ function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disab
|
|||
/**
|
||||
* Empty footer
|
||||
*
|
||||
* Note: also called by functions.lib:recordNotFound
|
||||
*
|
||||
* @param string $comment A text to add as HTML comment into HTML generated page
|
||||
* @param string $zone 'private' (for private pages) or 'public' (for public pages)
|
||||
* @param int $disabledoutputofmessages Clear all messages stored into session without displaying them
|
||||
* @return void
|
||||
*/
|
||||
function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0)
|
||||
function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) // @phan-suppress-current-line PhanRedefineFunction
|
||||
{
|
||||
print "\n".'</html>'."\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1504,7 +1504,7 @@ class Categorie extends CommonObject
|
|||
$forced_color = 'colortoreplace';
|
||||
if ($i == count($way)) { // Last category in hierarchy
|
||||
// Check contrast with background and correct text color
|
||||
$forced_color = 'categtextwhite';
|
||||
$forced_color = 'categtextwhite'; // We want color white because the getNomUrl of a tag is always called inside a dark background like '<span color="bbb"></span>' to show it as a tag. TODO Add this in param to force when called outside of span.
|
||||
if ($cat->color) {
|
||||
if (colorIsLight($cat->color)) {
|
||||
$forced_color = 'categtextblack';
|
||||
|
|
@ -1514,7 +1514,7 @@ class Categorie extends CommonObject
|
|||
}
|
||||
|
||||
if ($url == '') {
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$cat->id.'&type='.$cat->type.'" class="'.$forced_color.'">';
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$cat->id.'&type='.$cat->type.'" class="'.($i < count($way) ? 'small ': '').$forced_color.'">';
|
||||
$linkend = '</a>';
|
||||
$w[] = $link.(($addpicto && $i == 1) ? img_object('', 'category', 'class="paddingright"') : '').$cat->label.$linkend;
|
||||
} elseif ($url == 'none') {
|
||||
|
|
|
|||
|
|
@ -803,7 +803,7 @@ if ($object->fetch($id) >= 0) {
|
|||
}
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup
|
||||
$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column ? 'left' : ''); // This also change content of $arrayfields with user setup
|
||||
$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
|
||||
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||
|
||||
|
|
|
|||
|
|
@ -295,7 +295,7 @@ class PaymentVarious extends CommonObject
|
|||
* Load object in memory from database
|
||||
*
|
||||
* @param int $id id object
|
||||
* @param User $user User that load
|
||||
* @param ?User $user User that load
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function fetch($id, $user = null)
|
||||
|
|
|
|||
|
|
@ -105,8 +105,8 @@ if (empty($reshook)) {
|
|||
header("Location: ".$urltogo);
|
||||
exit;
|
||||
}
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$ret = $object->fetch($id, $ref);
|
||||
if ($id > 0) {
|
||||
$ret = $object->fetch($id);
|
||||
}
|
||||
$action = '';
|
||||
}
|
||||
|
|
@ -221,14 +221,13 @@ if (empty($reshook)) {
|
|||
|
||||
$ret = $object->delete($user);
|
||||
if ($ret > 0) {
|
||||
$accountline = null;
|
||||
if ($object->fk_bank) {
|
||||
$accountline = new AccountLine($db);
|
||||
$result = $accountline->fetch($object->fk_bank);
|
||||
if ($result > 0) {
|
||||
$result = $accountline->delete($user); // $result may be 0 if not found (when bank entry was deleted manually and fk_bank point to nothing)
|
||||
}
|
||||
} else {
|
||||
$account_line = null;
|
||||
}
|
||||
|
||||
if ($result >= 0) {
|
||||
|
|
@ -630,7 +629,7 @@ if ($id) {
|
|||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (property_exists($object, 'socid') ? $object->socid : 0), $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (property_exists($object, 'socid') ? $object->socid : 0), (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
|
||||
}
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
|
|
@ -685,7 +684,7 @@ if ($id) {
|
|||
if (isModEnabled('accounting')) {
|
||||
/** @var FormAccounting $formaccounting */
|
||||
print '<tr><td class="nowrap">';
|
||||
print $form->editfieldkey('AccountAccounting', 'accountancy_code', $object->accountancy_code, $object, (!$alreadyaccounted && $permissiontoadd), 'string', '', 0);
|
||||
print $form->editfieldkey('AccountAccounting', 'accountancy_code', $object->accountancy_code, $object, (int) (!$alreadyaccounted && $permissiontoadd), 'string', '', 0);
|
||||
print '</td><td>';
|
||||
if ($action == 'editaccountancy_code' && (!$alreadyaccounted && $permissiontoadd)) {
|
||||
//print $form->editfieldval('AccountAccounting', 'accountancy_code', $object->accountancy_code, $object, (!$alreadyaccounted && $user->hasRight('banque', 'modifier')), 'string', '', 0);
|
||||
|
|
@ -707,7 +706,7 @@ if ($id) {
|
|||
|
||||
// Subledger account
|
||||
print '<tr><td class="nowrap">';
|
||||
print $form->editfieldkey('SubledgerAccount', 'subledger_account', $object->subledger_account, $object, (!$alreadyaccounted && $permissiontoadd), 'string', '', 0);
|
||||
print $form->editfieldkey('SubledgerAccount', 'subledger_account', $object->subledger_account, $object, (int) (!$alreadyaccounted && $permissiontoadd), 'string', '', 0);
|
||||
print '</td><td>';
|
||||
if ($action == 'editsubledger_account' && (!$alreadyaccounted && $permissiontoadd)) {
|
||||
if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -75,7 +75,7 @@ if (!$sortfield) {
|
|||
|
||||
|
||||
$object = new PaymentVarious($db);
|
||||
$object->fetch($id, $ref);
|
||||
$object->fetch($id);
|
||||
|
||||
$upload_dir = $conf->bank->dir_output.'/'.dol_sanitizeFileName((string) $object->id);
|
||||
$modulepart = 'banque';
|
||||
|
|
@ -109,6 +109,7 @@ if ($object->id) {
|
|||
$morehtmlref = '<div class="refidno">';
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$formproject = new FormProjets($db);
|
||||
$langs->load("projects");
|
||||
if ($user->hasRight('banque', 'modifier') && 0) {
|
||||
if ($action != 'classify') {
|
||||
|
|
@ -119,11 +120,11 @@ if ($object->id) {
|
|||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects(0, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= $formproject->select_projects(0, (string) $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300');
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300');
|
||||
}
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -78,6 +78,7 @@ print dol_get_fiche_head($head, 'info', $langs->trans("VariousPayment"), -1, $ob
|
|||
$morehtmlref = '<div class="refidno">';
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$formproject = new FormProjets($db);
|
||||
$langs->load("projects");
|
||||
if ($user->hasRight('banque', 'modifier') && 0) {
|
||||
if ($action != 'classify') {
|
||||
|
|
@ -88,11 +89,11 @@ if (isModEnabled('project')) {
|
|||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects(0, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= $formproject->select_projects(0, (string) $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300');
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300');
|
||||
}
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -169,22 +169,22 @@ $fieldstosearchall = array(
|
|||
|
||||
// Definition of fields for lists
|
||||
$arrayfields = array(
|
||||
'ref' => array('label' => "Ref", 'checked' => 1, 'position' => 100),
|
||||
'label' => array('label' => "Label", 'checked' => 1, 'position' => 110),
|
||||
'datep' => array('label' => "DatePayment", 'checked' => 1, 'position' => 120),
|
||||
'datev' => array('label' => "DateValue", 'checked' => -1, 'position' => 130),
|
||||
'type' => array('label' => "PaymentMode", 'checked' => 1, 'position' => 140),
|
||||
'project' => array('label' => "Project", 'checked' => -1, 'position' => 200, "enabled" => isModEnabled('project')),
|
||||
'bank' => array('label' => "BankAccount", 'checked' => 1, 'position' => 300, "enabled" => isModEnabled("bank")),
|
||||
'entry' => array('label' => "BankTransactionLine", 'checked' => 1, 'position' => 310, "enabled" => isModEnabled("bank")),
|
||||
'account' => array('label' => "AccountAccountingShort", 'checked' => 1, 'position' => 400, "enabled" => isModEnabled('accounting')),
|
||||
'subledger' => array('label' => "SubledgerAccount", 'checked' => 1, 'position' => 410, "enabled" => isModEnabled('accounting')),
|
||||
'debit' => array('label' => "Debit", 'checked' => 1, 'position' => 500),
|
||||
'credit' => array('label' => "Credit", 'checked' => 1, 'position' => 510),
|
||||
'ref' => array('label' => "Ref", 'checked' => '1', 'position' => 100),
|
||||
'label' => array('label' => "Label", 'checked' => '1', 'position' => 110),
|
||||
'datep' => array('label' => "DatePayment", 'checked' => '1', 'position' => 120),
|
||||
'datev' => array('label' => "DateValue", 'checked' => '-1', 'position' => 130),
|
||||
'type' => array('label' => "PaymentMode", 'checked' => '1', 'position' => 140),
|
||||
'project' => array('label' => "Project", 'checked' => '-1', 'position' => 200, "enabled" => (string) (int) isModEnabled('project')),
|
||||
'bank' => array('label' => "BankAccount", 'checked' => '1', 'position' => 300, "enabled" => (string) (int) isModEnabled("bank")),
|
||||
'entry' => array('label' => "BankTransactionLine", 'checked' => '1', 'position' => 310, "enabled" => (string) (int) isModEnabled("bank")),
|
||||
'account' => array('label' => "AccountAccountingShort", 'checked' => '1', 'position' => 400, "enabled" => (string) (int) isModEnabled('accounting')),
|
||||
'subledger' => array('label' => "SubledgerAccount", 'checked' => '1', 'position' => 410, "enabled" => (string) (int) isModEnabled('accounting')),
|
||||
'debit' => array('label' => "Debit", 'checked' => '1', 'position' => 500),
|
||||
'credit' => array('label' => "Credit", 'checked' => '1', 'position' => 510),
|
||||
);
|
||||
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
|
||||
// '@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
|
||||
|
||||
// Security check
|
||||
$socid = GETPOSTINT("socid");
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class Facture extends CommonInvoice
|
|||
protected $table_ref_field = 'ref';
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
* @var int|null ID
|
||||
* @deprecated Use $user_creation_id
|
||||
*/
|
||||
public $fk_user_author;
|
||||
|
|
@ -2554,12 +2554,12 @@ class Facture extends CommonInvoice
|
|||
if (isset($this->retained_warranty)) {
|
||||
$this->retained_warranty = (float) $this->retained_warranty;
|
||||
}
|
||||
if (!isset($this->fk_user_author) && isset($this->user_author) ) {
|
||||
$this->fk_user_author = $this->user_author;
|
||||
if (!isset($this->user_creation_id) && isset($this->fk_user_author) ) {
|
||||
$this->user_creation_id = $this->fk_user_author;
|
||||
}
|
||||
if (!isset($this->user_validation_id) && isset($this->fk_user_valid) ) {
|
||||
$this->user_validation_id = $this->fk_user_valid;
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
// Put here code to add control on parameters values
|
||||
|
||||
// Update request
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture SET";
|
||||
|
|
@ -2584,8 +2584,8 @@ class Facture extends CommonInvoice
|
|||
$sql .= " total_ttc=".(isset($this->total_ttc) ? (float) $this->total_ttc : "null").",";
|
||||
$sql .= " revenuestamp=".((isset($this->revenuestamp) && $this->revenuestamp != '') ? (float) $this->revenuestamp : "null").",";
|
||||
$sql .= " fk_statut=".(isset($this->status) ? (int) $this->status : "null").",";
|
||||
$sql .= " fk_user_author=".(isset($this->fk_user_author) ? ((int) $this->fk_user_author) : "null").",";
|
||||
$sql .= " fk_user_valid=".(isset($this->fk_user_valid) ? (int) $this->fk_user_valid : "null").",";
|
||||
$sql .= " fk_user_author=".(isset($this->user_creation_id) ? ((int) $this->user_creation_id) : "null").",";
|
||||
$sql .= " fk_user_valid=".(isset($this->user_validation_id) ? (int) $this->user_validation_id : "null").",";
|
||||
$sql .= " fk_facture_source=".(isset($this->fk_facture_source) ? (int) $this->fk_facture_source : "null").",";
|
||||
$sql .= " fk_projet=".(isset($this->fk_project) ? (int) $this->fk_project : "null").",";
|
||||
$sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? (int) $this->cond_reglement_id : "null").",";
|
||||
|
|
@ -5181,11 +5181,12 @@ class Facture extends CommonInvoice
|
|||
//Avoid php warning Warning: mt_rand(): max(0) is smaller than min(1) when no product exists
|
||||
if (empty($num_prods)) {
|
||||
$num_prods = 1;
|
||||
$prodids[$num_prods] = 1;
|
||||
}
|
||||
|
||||
// Initialize parameters
|
||||
$this->id = 0;
|
||||
$this->entity = 1;
|
||||
$this->entity = $conf->entity;
|
||||
$this->ref = 'SPECIMEN';
|
||||
$this->specimen = 1;
|
||||
$this->socid = 1;
|
||||
|
|
|
|||
|
|
@ -414,10 +414,6 @@ $parameters = array();
|
|||
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
//print $sql;
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
|
|
@ -429,7 +425,7 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
|||
}
|
||||
}
|
||||
|
||||
// Complete request and execute it with limit
|
||||
// Complete request and execute it with order and limit
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
if ($limit) {
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
|
|
|
|||
|
|
@ -48,8 +48,11 @@ if (!defined('NOREQUIREAJAX')) {
|
|||
* @var HookManager $hookmanager
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*
|
||||
* @var string $module
|
||||
* @var string $mode
|
||||
*/
|
||||
$module = '';
|
||||
|
||||
if (!isset($mode) || $mode != 'noajax') { // For ajax call
|
||||
require_once '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
|
|
|||
|
|
@ -53,10 +53,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
|
|||
|
||||
$boxid = GETPOSTINT('boxid');
|
||||
$boxorder = GETPOST('boxorder');
|
||||
$zone = GETPOST('zone'); // Can be key for zone
|
||||
if ($zone !== '') {
|
||||
$zone = (int) $zone;
|
||||
}
|
||||
$zone = GETPOST('zone'); // Can be '0' or '1' or 'pagename'...
|
||||
$userid = GETPOSTINT('userid');
|
||||
|
||||
// Security check
|
||||
|
|
@ -91,7 +88,7 @@ if ($boxorder && $zone != '' && $userid > 0) {
|
|||
// boxorder value is the target order: "A:idboxA1,idboxA2,A-B:idboxB1,idboxB2,B"
|
||||
dol_syslog("AjaxBox boxorder=".$boxorder." zone=".$zone." userid=".$userid, LOG_DEBUG);
|
||||
|
||||
$result = InfoBox::saveboxorder($db, (int) $zone, $boxorder, $userid);
|
||||
$result = InfoBox::saveboxorder($db, $zone, $boxorder, $userid);
|
||||
if ($result > 0) {
|
||||
$langs->load("boxes");
|
||||
if (!GETPOST('closing')) {
|
||||
|
|
|
|||
|
|
@ -1483,24 +1483,26 @@ class CMailFile
|
|||
$outputfile = $dolibarr_main_data_root."/dolibarr_mail.log";
|
||||
$fp = fopen($outputfile, "w"); // overwrite
|
||||
|
||||
if ($this->sendmode == 'mail') {
|
||||
fwrite($fp, $this->headers);
|
||||
fwrite($fp, $this->eol); // This eol is added by the mail function, so we add it in log
|
||||
fwrite($fp, $this->message);
|
||||
} elseif ($this->sendmode == 'smtps') {
|
||||
fwrite($fp, $this->smtps->log); // this->smtps->log is filled only if MAIN_MAIL_DEBUG was set to on
|
||||
} elseif ($this->sendmode == 'swiftmailer') {
|
||||
fwrite($fp, "smtpheader=\n".$this->message->getHeaders()->toString()."\n");
|
||||
fwrite($fp, $this->logger->dump()); // this->logger is filled only if MAIN_MAIL_DEBUG was set to on
|
||||
}
|
||||
if ($fp) {
|
||||
if ($this->sendmode == 'mail') {
|
||||
fwrite($fp, $this->headers);
|
||||
fwrite($fp, $this->eol); // This eol is added by the mail function, so we add it in log
|
||||
fwrite($fp, $this->message);
|
||||
} elseif ($this->sendmode == 'smtps') {
|
||||
fwrite($fp, $this->smtps->log); // this->smtps->log is filled only if MAIN_MAIL_DEBUG was set to on
|
||||
} elseif ($this->sendmode == 'swiftmailer') {
|
||||
fwrite($fp, "smtpheader=\n".$this->message->getHeaders()->toString()."\n");
|
||||
fwrite($fp, $this->logger->dump()); // this->logger is filled only if MAIN_MAIL_DEBUG was set to on
|
||||
}
|
||||
|
||||
fclose($fp);
|
||||
dolChmod($outputfile);
|
||||
fclose($fp);
|
||||
dolChmod($outputfile);
|
||||
|
||||
// Move dolibarr_mail.log into a dolibarr_mail.log.v123456789
|
||||
if (getDolGlobalInt('MAIN_MAIL_DEBUG_LOG_WITH_DATE')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
archiveOrBackupFile($outputfile, getDolGlobalInt('MAIN_MAIL_DEBUG_LOG_WITH_DATE'));
|
||||
// Move dolibarr_mail.log into a dolibarr_mail.log.v123456789
|
||||
if (getDolGlobalInt('MAIN_MAIL_DEBUG_LOG_WITH_DATE')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
archiveOrBackupFile($outputfile, getDolGlobalInt('MAIN_MAIL_DEBUG_LOG_WITH_DATE'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -653,9 +653,15 @@ abstract class CommonObject
|
|||
|
||||
/**
|
||||
* @var string The civility code, not an integer
|
||||
* @deprecated Use $civlity_code
|
||||
*/
|
||||
public $civility_id;
|
||||
|
||||
/**
|
||||
* @var string The civility code, not an integer
|
||||
*/
|
||||
public $civility_code;
|
||||
|
||||
// Dates
|
||||
/**
|
||||
* @var integer|''|null Object creation date
|
||||
|
|
@ -704,7 +710,7 @@ abstract class CommonObject
|
|||
public $user_creation;
|
||||
|
||||
/**
|
||||
* @var int User id author/creation
|
||||
* @var int|null User id author/creation
|
||||
*/
|
||||
public $user_creation_id;
|
||||
|
||||
|
|
@ -6987,7 +6993,7 @@ abstract class CommonObject
|
|||
*/
|
||||
public function insertExtraLanguages($trigger = '', $userused = null)
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
global $langs, $user;
|
||||
|
||||
if (empty($userused)) {
|
||||
$userused = $user;
|
||||
|
|
@ -7105,7 +7111,7 @@ abstract class CommonObject
|
|||
*/
|
||||
public function updateExtraField($key, $trigger = null, $userused = null)
|
||||
{
|
||||
global $conf, $langs, $user, $hookmanager;
|
||||
global $langs, $user, $hookmanager;
|
||||
|
||||
if (getDolGlobalString('MAIN_EXTRAFIELDS_DISABLED')) {
|
||||
return 0;
|
||||
|
|
@ -7438,13 +7444,13 @@ abstract class CommonObject
|
|||
*/
|
||||
public function updateExtraLanguages($key, $trigger = null, $userused = null)
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
global $user;
|
||||
|
||||
if (empty($userused)) {
|
||||
$userused = $user;
|
||||
}
|
||||
|
||||
$error = 0;
|
||||
//$error = 0;
|
||||
|
||||
if (getDolGlobalString('MAIN_EXTRALANGUAGES_DISABLED')) {
|
||||
return 0; // For avoid conflicts if trigger used
|
||||
|
|
@ -10354,9 +10360,9 @@ abstract class CommonObject
|
|||
/**
|
||||
* Create object in the database
|
||||
*
|
||||
* @param User $user User that creates
|
||||
* @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int<-1,max> Return integer <0 if KO, Id of created object if OK
|
||||
* @param User $user User that creates
|
||||
* @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int<-1,max> Return integer <0 if KO, Id of created object if OK
|
||||
*/
|
||||
public function createCommon(User $user, $notrigger = 0)
|
||||
{
|
||||
|
|
@ -10376,6 +10382,7 @@ abstract class CommonObject
|
|||
$fieldvalues['date_creation'] = $this->db->idate($now);
|
||||
$this->date_creation = $this->db->idate($now);
|
||||
}
|
||||
// For backward compatibility, if a property ->fk_user_creat exists and not filled.
|
||||
if (array_key_exists('fk_user_creat', $fieldvalues) && !($fieldvalues['fk_user_creat'] > 0)) {
|
||||
$fieldvalues['fk_user_creat'] = $user->id;
|
||||
$this->fk_user_creat = $user->id;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2023-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -99,8 +99,8 @@ trait CommonPeople
|
|||
* Return full name (civility+' '+name+' '+lastname)
|
||||
*
|
||||
* @param Translate $langs Language object for translation of civility (used only if option is 1)
|
||||
* @param int $option 0=No option, 1=Add civility
|
||||
* @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname, 2=Firstname, 3=Firstname if defined else lastname, 4=Lastname, 5=Lastname if defined else firstname
|
||||
* @param int<0,1> $option 0=No option, 1=Add civility
|
||||
* @param int<-1,5> $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname, 2=Firstname, 3=Firstname if defined else lastname, 4=Lastname, 5=Lastname if defined else firstname
|
||||
* @param int $maxlen Maximum length
|
||||
* @return string String with full name
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -10112,11 +10112,11 @@ class Form
|
|||
* Return an html string with a select combo box to choose yes or no
|
||||
*
|
||||
* @param string $htmlname Name of html select field
|
||||
* @param string|int $value Pre-selected value
|
||||
* @param int $option 0 return yes/no, 1 return 1/0
|
||||
* @param bool $disabled true or false
|
||||
* @param int $useempty 1=Add empty line
|
||||
* @param int $addjscombo 1=Add js beautifier on combo box
|
||||
* @param string|int<min,1> $value Pre-selected value
|
||||
* @param int<0,1> $option 0 return yes/no, 1 return 1/0
|
||||
* @param bool|int<0,1> $disabled true or false
|
||||
* @param int<0,1> $useempty 1=Add empty line
|
||||
* @param int<0,1> $addjscombo 1=Add js beautifier on combo box
|
||||
* @param string $morecss More CSS
|
||||
* @param string $labelyes Label for Yes
|
||||
* @param string $labelno Label for No
|
||||
|
|
|
|||
|
|
@ -1493,6 +1493,7 @@ class FormMail extends Form
|
|||
* @param string $format Format for output ('', 'html', ...)
|
||||
* @param string $htmlContent HTML name of WYSIWYG field
|
||||
* @return string HTML code to ask AI instruction and autofill result
|
||||
* TODO Move into a file html.formai.class.php
|
||||
*/
|
||||
public function getSectionForAIPrompt($function = 'textgeneration', $format = '', $htmlContent = 'message')
|
||||
{
|
||||
|
|
@ -1502,7 +1503,7 @@ class FormMail extends Form
|
|||
|
||||
$htmlContent = preg_replace('/[^a-z0-9_]/', '', $htmlContent);
|
||||
|
||||
$out = '<div id="ai_input'.$htmlContent.'" class="hidden paddingtop paddingbottom">';
|
||||
$out = '<div id="ai_input'.$htmlContent.'" class="ai_input'.$htmlContent.' hidden paddingtop paddingbottom">';
|
||||
$out .= '<input type="text" class="quatrevingtpercent" id="ai_instructions'.$htmlContent.'" name="instruction" placeholder="'.$langs->trans("EnterYourAIPromptHere").'..." />';
|
||||
$out .= '<input id="generate_button'.$htmlContent.'" type="button" class="button smallpaddingimp" value="'.$langs->trans('Generate').'"/>';
|
||||
$out .= '<div id="ai_status_message'.$htmlContent.'" class="fieldrequired hideobject marginrightonly margintoponly">';
|
||||
|
|
@ -1526,7 +1527,7 @@ class FormMail extends Form
|
|||
});
|
||||
|
||||
$('#generate_button".$htmlContent."').click(function() {
|
||||
console.log('We click on generate_button".$htmlContent." ai button');
|
||||
console.log('We click on generate_button".$htmlContent." ai button, so we make an ajax on url /ai/ajax/generate_content.php');
|
||||
|
||||
var instructions = $('#ai_instructions".$htmlContent."').val();
|
||||
var timeoutfinished = 0;
|
||||
|
|
@ -1554,6 +1555,16 @@ class FormMail extends Form
|
|||
}),
|
||||
success: function(response) {
|
||||
console.log('Received image URL: '+response);
|
||||
|
||||
// make substitutions
|
||||
let substit = ". json_encode($this->substit).";
|
||||
for (let key in substit) {
|
||||
if (substit.hasOwnProperty(key)) {
|
||||
// Replace the placeholder with its corresponding value
|
||||
response = response.replace(key, substit[key]);
|
||||
}
|
||||
}
|
||||
|
||||
// Assuming response is the URL of the generated image
|
||||
var imageUrl = response;
|
||||
$('#ai_image_result').html('<img src=\"' + imageUrl + '\" alt=\"Generated Image\" />');
|
||||
|
|
@ -1579,49 +1590,50 @@ class FormMail extends Form
|
|||
CKEDITOR.instances.".$htmlContent.".setReadOnly(1);
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: '". DOL_URL_ROOT."/ai/ajax/generate_content.php?token=".currentToken()."',
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
data: JSON.stringify({
|
||||
'format': '".dol_escape_js($format)."', /* the format for output */
|
||||
'function': '".dol_escape_js($function)."', /* the AI feature to call */
|
||||
'instructions': instructions, /* the prompt string */
|
||||
}),
|
||||
success: function(response) {
|
||||
console.log('Add response into field \'#".$htmlContent."\': '+response);
|
||||
$.ajax({
|
||||
url: '". DOL_URL_ROOT."/ai/ajax/generate_content.php?token=".currentToken()."',
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
data: JSON.stringify({
|
||||
'format': '".dol_escape_js($format)."', /* the format for output */
|
||||
'function': '".dol_escape_js($function)."', /* the AI feature to call */
|
||||
'instructions': instructions, /* the prompt string */
|
||||
}),
|
||||
success: function(response) {
|
||||
console.log('Add response into field \'#".$htmlContent."\': '+response);
|
||||
|
||||
jQuery('#".$htmlContent."').val(response); // If #htmlcontent is a input name or textarea
|
||||
jQuery('#".$htmlContent."').html(response); // If #htmlContent is a div
|
||||
//jQuery('#".$htmlContent."preview').val(response);
|
||||
jQuery('#".$htmlContent."').val(response); // If #htmlcontent is a input name or textarea
|
||||
jQuery('#".$htmlContent."').html(response); // If #htmlContent is a div
|
||||
//jQuery('#".$htmlContent."preview').val(response);
|
||||
|
||||
if (CKEDITOR.instances) {
|
||||
var editorInstance = CKEDITOR.instances.".$htmlContent.";
|
||||
if (editorInstance) {
|
||||
editorInstance.setReadOnly(0);
|
||||
editorInstance.setData(response);
|
||||
if (CKEDITOR.instances) {
|
||||
var editorInstance = CKEDITOR.instances.".$htmlContent.";
|
||||
if (editorInstance) {
|
||||
editorInstance.setReadOnly(0);
|
||||
editorInstance.setData(response);
|
||||
}
|
||||
//var editorInstancepreview = CKEDITOR.instances.".$htmlContent."preview;
|
||||
//if (editorInstancepreview) {
|
||||
// editorInstancepreview.setData(response);
|
||||
//}
|
||||
}
|
||||
//var editorInstancepreview = CKEDITOR.instances.".$htmlContent."preview;
|
||||
//if (editorInstancepreview) {
|
||||
// editorInstancepreview.setData(response);
|
||||
//}
|
||||
}
|
||||
|
||||
// remove readonly
|
||||
$('#ai_instructions".$htmlContent."').val('');
|
||||
// remove readonly
|
||||
$('#ai_instructions".$htmlContent."').val('');
|
||||
|
||||
apicallfinished = 1;
|
||||
if (timeoutfinished) {
|
||||
apicallfinished = 1;
|
||||
if (timeoutfinished) {
|
||||
$('#ai_status_message".$htmlContent."').hide();
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
alert(error);
|
||||
console.error('error ajax', status, error);
|
||||
$('#ai_status_message".$htmlContent."').hide();
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
alert(error);
|
||||
console.error('error ajax', status, error);
|
||||
$('#ai_status_message".$htmlContent."').hide();
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1648,7 +1660,7 @@ class FormMail extends Form
|
|||
$websitepage = new WebsitePage($this->db);
|
||||
$arrayofblogs = $websitepage->fetchAll('', 'DESC', 'date_creation', 0, 0, array('type_container' => 'blogpost'));
|
||||
|
||||
$out = '<div id="template-selector" class="email-layout-container hidden" style="display:none;">';
|
||||
$out = '<div id="template-selector" class="template-selector email-layout-container hidden" style="display:none;">';
|
||||
|
||||
// Define list of email layouts to use
|
||||
$layouts = array(
|
||||
|
|
|
|||
|
|
@ -217,11 +217,11 @@ class InfoBox
|
|||
/**
|
||||
* Save order of boxes for area and user
|
||||
*
|
||||
* @param DoliDB $dbs Database handler
|
||||
* @param int $zone Key of area (0 for Homepage, ...)
|
||||
* @param string $boxorder List of boxes with correct order 'A:123,456,...-B:789,321...'
|
||||
* @param int $userid Id of user
|
||||
* @return int Return integer <0 if KO, 0=Nothing done, > 0 if OK
|
||||
* @param DoliDB $dbs Database handler
|
||||
* @param int|string $zone Key of area ('0' for Homepage, '1', 'pagename', ...)
|
||||
* @param string $boxorder List of boxes with correct order 'A:123,456,...-B:789,321...'
|
||||
* @param int $userid Id of user
|
||||
* @return int Return integer <0 if KO, 0=Nothing done, > 0 if OK
|
||||
*/
|
||||
public static function saveboxorder($dbs, $zone, $boxorder, $userid = 0)
|
||||
{
|
||||
|
|
@ -252,6 +252,10 @@ class InfoBox
|
|||
return -3;
|
||||
}
|
||||
|
||||
if (!is_numeric($zone)) {
|
||||
$zone = '0'; // Force $zone to a numeric value string
|
||||
}
|
||||
|
||||
// Delete all lines
|
||||
$sql = "DELETE FROM ".$dbs->prefix()."boxes";
|
||||
$sql .= " WHERE entity = ".$conf->entity;
|
||||
|
|
|
|||
|
|
@ -123,70 +123,87 @@ class TimeSpent extends CommonObject
|
|||
'datec' => array('type' => 'datetime', 'label' => 'datec', 'enabled' => 1, 'position' => 16, 'notnull' => 0, 'visible' => -1,),
|
||||
'note' => array('type' => 'text', 'label' => 'note', 'enabled' => 1, 'position' => 18, 'notnull' => 0, 'visible' => -1,),
|
||||
);
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $rowid;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $import_key;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $fk_element;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $elementtype;
|
||||
|
||||
/**
|
||||
* @var int|string
|
||||
*/
|
||||
public $element_date;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $element_datehour;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $element_date_withhour;
|
||||
|
||||
/**
|
||||
* @var int Note seems to be int (seconds) even if declared as double in DB.
|
||||
*/
|
||||
public $element_duration;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $fk_product;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $fk_user;
|
||||
|
||||
/**
|
||||
* @var float
|
||||
*/
|
||||
public $thm;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $invoice_id;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $invoice_line_id;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $intervention_id;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $intervention_line_id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @var ?int Date creation
|
||||
*/
|
||||
public $datec;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2683,9 +2683,54 @@ function addMailingEventTypeSQL($actioncode, $objcon, $filterobj)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show header of company in HTML public pages
|
||||
*
|
||||
* @param Societe $mysoc Third party
|
||||
* @param Translate $langs Output language
|
||||
* @return void
|
||||
*/
|
||||
function htmlPrintOnlineHeader($mysoc, $langs)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
// Define urllogo
|
||||
$urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png';
|
||||
|
||||
if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) {
|
||||
$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small);
|
||||
} elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
|
||||
$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo);
|
||||
} elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) {
|
||||
$urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg';
|
||||
}
|
||||
|
||||
print '<header class="center">';
|
||||
|
||||
// Output html code for logo
|
||||
if ($urllogo) {
|
||||
print '<div class="backgreypublicpayment">';
|
||||
print '<div class="logopublicpayment">';
|
||||
print '<img id="dolpaymentlogo" src="'.$urllogo.'">';
|
||||
print '</div>';
|
||||
if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) {
|
||||
print '<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans("PoweredBy").'<br><img class="poweredbyimg" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
|
||||
}
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
if (getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION')) {
|
||||
print '<div class="backimagepublicregistration">';
|
||||
print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="' . getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION').'">';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print '</header>';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show footer of company in HTML pages
|
||||
* Show footer of company in HTML public pages
|
||||
*
|
||||
* @param Societe $fromcompany Third party
|
||||
* @param Translate $langs Output language
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ function getServerTimeZoneInt($refgmtdate = 'now')
|
|||
/**
|
||||
* Add a delay to a date
|
||||
*
|
||||
* @param int|string $time Date timestamp (or string with format YYYY-MM-DD)
|
||||
* @param int $time Date timestamp
|
||||
* @param float $duration_value Value of delay to add
|
||||
* @param string $duration_unit Unit of added delay (d, m, y, w, h, i)
|
||||
* @param int<0,1> $ruleforendofmonth Change the behavior of PHP over data-interval, 0 or 1
|
||||
|
|
@ -166,7 +166,7 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforend
|
|||
if (getDolGlobalString('MAIN_DATE_IN_MEMORY_ARE_GMT')) {
|
||||
$date->setTimezone(new DateTimeZone('UTC'));
|
||||
}
|
||||
$date->setTimestamp($time);
|
||||
$date->setTimestamp((int) $time);
|
||||
$interval = new DateInterval($deltastring);
|
||||
|
||||
if ($sub) {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
*/
|
||||
function ecm_prepare_dasboard_head()
|
||||
{
|
||||
global $langs, $conf, $user, $form;
|
||||
global $langs, $conf, $form;
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
|
@ -61,7 +61,7 @@ function ecm_prepare_dasboard_head()
|
|||
$h++;
|
||||
}
|
||||
|
||||
if ($showmediasection && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
|
||||
if ($showmediasection) {
|
||||
$head[$h][0] = DOL_URL_ROOT.'/ecm/index_medias.php?file_manager=1';
|
||||
$head[$h][1] = $langs->trans("ECMSectionsMedias").$form->textwithpicto('', $helptext, 1, 'info', '', 0, 3);
|
||||
$head[$h][2] = 'index_medias';
|
||||
|
|
|
|||
|
|
@ -10781,7 +10781,7 @@ function dol_eval($s, $returnvalue = 1, $hideerrors = 1, $onlysimplestring = '1'
|
|||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("function", "call_user_func", "call_user_func_array"));
|
||||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("require", "include", "require_once", "include_once"));
|
||||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("exec", "passthru", "shell_exec", "system", "proc_open", "popen"));
|
||||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("dol_eval", "executeCLI", "verifCond")); // native dolibarr functions
|
||||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("dol_eval", "executeCLI", "verifCond", "GETPOST")); // native dolibarr functions
|
||||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("eval", "create_function", "assert", "mb_ereg_replace")); // function with eval capabilities
|
||||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("dol_compress_dir", "dol_decode", "dol_delete_file", "dol_delete_dir", "dol_delete_dir_recursive", "dol_copy", "archiveOrBackupFile")); // more dolibarr functions
|
||||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask"));
|
||||
|
|
|
|||
|
|
@ -51,6 +51,10 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation =
|
|||
|
||||
dol_syslog("getURLContent postorget=".$postorget." URL=".$url." param=".$param);
|
||||
|
||||
if (!function_exists('curl_init')) {
|
||||
return array('http_code' => 500, 'content' => '', 'curl_error_no' => 1, 'curl_error_msg' => 'PHP curl library must be installed');
|
||||
}
|
||||
|
||||
//setting the curl parameters.
|
||||
$ch = curl_init();
|
||||
|
||||
|
|
|
|||
|
|
@ -192,6 +192,11 @@ function order_admin_prepare_head()
|
|||
$head[$h][2] = 'general';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/admin/order_pdf.php';
|
||||
$head[$h][1] = $langs->trans("PDF");
|
||||
$head[$h][2] = 'pdf';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'order_admin');
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/admin/order_extrafields.php';
|
||||
|
|
|
|||
|
|
@ -641,10 +641,11 @@ class pdf_einstein extends ModelePDFCommandes
|
|||
}
|
||||
|
||||
// Add terms to sale
|
||||
if (!empty($mysoc->termsofsale) && getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_ORDER')) {
|
||||
$termsofsale = $conf->mycompany->dir_output.'/'.$mysoc->termsofsale;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) {
|
||||
$termsofsale = $conf->mycompany->multidir_output[$object->entity].'/'.$mysoc->termsofsale;
|
||||
if (getDolGlobalString("MAIN_INFO_ORDER_TERMSOFSALE") && getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_ORDER')) {
|
||||
$termsofsalefilename = getDolGlobalString('MAIN_INFO_ORDER_TERMSOFSALE');
|
||||
$termsofsale = $conf->order->dir_output.'/'.$termsofsalefilename;
|
||||
if (!empty($conf->order->multidir_output[$conf->entity])) {
|
||||
$termsofsale = $conf->order->multidir_output[$conf->entity].'/'.$termsofsalefilename;
|
||||
}
|
||||
if (file_exists($termsofsale) && is_readable($termsofsale)) {
|
||||
$pagecount = $pdf->setSourceFile($termsofsale);
|
||||
|
|
|
|||
|
|
@ -864,10 +864,11 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
}
|
||||
|
||||
// Add terms to sale
|
||||
if (!empty($mysoc->termsofsale) && getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_ORDER')) {
|
||||
$termsofsale = $conf->mycompany->dir_output.'/'.$mysoc->termsofsale;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) {
|
||||
$termsofsale = $conf->mycompany->multidir_output[$object->entity].'/'.$mysoc->termsofsale;
|
||||
if (getDolGlobalString("MAIN_INFO_ORDER_TERMSOFSALE") && getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_ORDER')) {
|
||||
$termsofsalefilename = getDolGlobalString('MAIN_INFO_ORDER_TERMSOFSALE');
|
||||
$termsofsale = $conf->order->dir_output.'/'.$termsofsalefilename;
|
||||
if (!empty($conf->order->multidir_output[$conf->entity])) {
|
||||
$termsofsale = $conf->order->multidir_output[$conf->entity].'/'.$termsofsalefilename;
|
||||
}
|
||||
if (file_exists($termsofsale) && is_readable($termsofsale)) {
|
||||
$pagecount = $pdf->setSourceFile($termsofsale);
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class pdf_proforma extends pdf_eratosthene
|
|||
*/
|
||||
public function __construct($db)
|
||||
{
|
||||
global $conf, $langs, $mysoc;
|
||||
global $langs;
|
||||
|
||||
parent::__construct($db);
|
||||
|
||||
|
|
|
|||
|
|
@ -182,13 +182,12 @@ class modAdherent extends DolibarrModules
|
|||
[
|
||||
"MEMBER_ADDON_PDF_ODT_PATH",
|
||||
"chaine",
|
||||
"DOL_DATA_ROOT/doctemplates/members",
|
||||
"DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/members",
|
||||
"",
|
||||
0,
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
// Boxes
|
||||
//-------
|
||||
$this->boxes = array(
|
||||
|
|
@ -439,8 +438,8 @@ class modAdherent extends DolibarrModules
|
|||
|
||||
// ODT template
|
||||
/*
|
||||
$src=DOL_DOCUMENT_ROOT.'/install/doctemplates/orders/template_order.odt';
|
||||
$dirodt=DOL_DATA_ROOT.'/doctemplates/orders';
|
||||
$src=DOL_DOCUMENT_ROOT.'/install/doctemplates/members/template_member.odt';
|
||||
$dirodt=DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/members';
|
||||
$dest=$dirodt.'/template_order.odt';
|
||||
|
||||
if (file_exists($src) && ! file_exists($dest)) {
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ class modBom extends DolibarrModules
|
|||
$this->const = array(
|
||||
1 => array('BOM_ADDON_PDF', 'chaine', 'generic_bom_odt', 'Name of PDF model of BOM', 0),
|
||||
2 => array('BOM_ADDON', 'chaine', 'mod_bom_standard', 'Name of numbering rules of BOM', 0),
|
||||
3 => array('BOM_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT/doctemplates/boms', '', 0)
|
||||
3 => array('BOM_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT'.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/boms', '', 0)
|
||||
);
|
||||
|
||||
// Some keys to add into the overwriting translation tables
|
||||
|
|
@ -480,7 +480,7 @@ class modBom extends DolibarrModules
|
|||
|
||||
// ODT template
|
||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/boms/template_bom.odt';
|
||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/boms';
|
||||
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/boms';
|
||||
$dest = $dirodt.'/template_bom.odt';
|
||||
|
||||
if (file_exists($src) && !file_exists($dest)) {
|
||||
|
|
|
|||
|
|
@ -94,11 +94,12 @@ class modCommande extends DolibarrModules
|
|||
[
|
||||
"COMMANDE_ADDON_PDF_ODT_PATH",
|
||||
"chaine",
|
||||
"DOL_DATA_ROOT/doctemplates/orders",
|
||||
"DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/orders",
|
||||
"",
|
||||
0,
|
||||
],
|
||||
];
|
||||
|
||||
/*$r++;
|
||||
$this->const[$r][0] = "COMMANDE_DRAFT_WATERMARK";
|
||||
$this->const[$r][1] = "chaine";
|
||||
|
|
@ -460,7 +461,7 @@ class modCommande extends DolibarrModules
|
|||
|
||||
//ODT template
|
||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/orders/template_order.odt';
|
||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/orders';
|
||||
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/orders';
|
||||
$dest = $dirodt.'/template_order.odt';
|
||||
|
||||
if (file_exists($src) && !file_exists($dest)) {
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class modContrat extends DolibarrModules
|
|||
[
|
||||
"CONTRACT_ADDON_PDF_ODT_PATH",
|
||||
"chaine",
|
||||
"DOL_DATA_ROOT/doctemplates/contracts",
|
||||
"DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/contracts",
|
||||
"",
|
||||
0,
|
||||
],
|
||||
|
|
@ -231,7 +231,7 @@ class modContrat extends DolibarrModules
|
|||
|
||||
//ODT template
|
||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/contracts/template_contract.odt';
|
||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/contracts';
|
||||
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/contracts';
|
||||
$dest = $dirodt.'/template_contract.odt';
|
||||
|
||||
if (file_exists($src) && !file_exists($dest)) {
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class modExpedition extends DolibarrModules
|
|||
[
|
||||
"EXPEDITION_ADDON_PDF_ODT_PATH",
|
||||
"chaine",
|
||||
"DOL_DATA_ROOT/doctemplates/shipments",
|
||||
"DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/shipments",
|
||||
"",
|
||||
0,
|
||||
],
|
||||
|
|
@ -121,7 +121,7 @@ class modExpedition extends DolibarrModules
|
|||
[
|
||||
"DELIVERY_ADDON_PDF_ODT_PATH",
|
||||
"chaine",
|
||||
"DOL_DATA_ROOT/doctemplates/deliveries",
|
||||
"DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/deliveries",
|
||||
"",
|
||||
0,
|
||||
],
|
||||
|
|
@ -133,6 +133,7 @@ class modExpedition extends DolibarrModules
|
|||
0,
|
||||
],
|
||||
];
|
||||
|
||||
// Boxes
|
||||
$this->boxes = array(
|
||||
0 => array('file'=>'box_shipments.php', 'enabledbydefaulton'=>'Home'),
|
||||
|
|
@ -344,7 +345,7 @@ class modExpedition extends DolibarrModules
|
|||
|
||||
//ODT template
|
||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/shipments/template_shipment.odt';
|
||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/shipments';
|
||||
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/shipments';
|
||||
$dest = $dirodt.'/template_shipment.odt';
|
||||
|
||||
if (file_exists($src) && !file_exists($dest)) {
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class modFacture extends DolibarrModules
|
|||
|
||||
$this->const[$r][0] = "FACTURE_ADDON_PDF_ODT_PATH";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/invoices";
|
||||
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/invoices";
|
||||
$this->const[$r][3] = "";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
|
@ -780,7 +780,7 @@ class modFacture extends DolibarrModules
|
|||
|
||||
//ODT template
|
||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/invoices/template_invoice.odt';
|
||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/invoices';
|
||||
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/invoices';
|
||||
$dest = $dirodt.'/template_invoice.odt';
|
||||
|
||||
if (file_exists($src) && !file_exists($dest)) {
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ class modFournisseur extends DolibarrModules
|
|||
// Add ability ODT for Supplier orders
|
||||
$this->const[$r][0] = "SUPPLIER_ORDER_ADDON_PDF_ODT_PATH";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/supplier_orders";
|
||||
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/supplier_orders";
|
||||
$this->const[$r][3] = '';
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
|
@ -126,7 +126,7 @@ class modFournisseur extends DolibarrModules
|
|||
// Add ability ODT for Supplier Invoices
|
||||
$this->const[$r][0] = "SUPPLIER_INVOICE_ADDON_PDF_ODT_PATH";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "";
|
||||
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/supplier_invoices";
|
||||
$this->const[$r][3] = "";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
|
@ -973,7 +973,7 @@ class modFournisseur extends DolibarrModules
|
|||
|
||||
//ODT template for Supplier Orders
|
||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/supplier_orders/template_supplier_order.odt';
|
||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/supplier_orders';
|
||||
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/supplier_orders';
|
||||
$dest = $dirodt.'/template_supplier_order.odt';
|
||||
|
||||
if (file_exists($src) && !file_exists($dest)) {
|
||||
|
|
@ -994,7 +994,7 @@ class modFournisseur extends DolibarrModules
|
|||
|
||||
//ODT template for Supplier Invoice
|
||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/supplier_invoices/template_supplier_invoices.odt';
|
||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/supplier_invoices';
|
||||
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/supplier_invoices';
|
||||
$dest = $dirodt.'/template_supplier_invoices.odt';
|
||||
|
||||
if (file_exists($src) && !file_exists($dest)) {
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class modHoliday extends DolibarrModules
|
|||
|
||||
$this->const[$r][0] = "HOLIDAY_ADDON_PDF_ODT_PATH";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/holiday";
|
||||
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/holiday";
|
||||
$this->const[$r][3] = "";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
|
@ -308,7 +308,7 @@ class modHoliday extends DolibarrModules
|
|||
|
||||
//ODT template
|
||||
/*$src=DOL_DOCUMENT_ROOT.'/install/doctemplates/holiday/template_holiday.odt';
|
||||
$dirodt=DOL_DATA_ROOT.'/doctemplates/holiday';
|
||||
$dirodt=DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/holiday';
|
||||
$dest=$dirodt.'/template_order.odt';
|
||||
|
||||
if (file_exists($src) && ! file_exists($dest))
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ class modMrp extends DolibarrModules
|
|||
$this->const = array(
|
||||
//1=>array('MRP_MO_ADDON_PDF', 'chaine', 'vinci', 'Name of default PDF model of MO', 0),
|
||||
2=>array('MRP_MO_ADDON', 'chaine', 'mod_mo_standard', 'Name of numbering rules of MO', 0),
|
||||
3=>array('MRP_MO_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT/doctemplates/mrps', '', 0)
|
||||
3=>array('MRP_MO_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT'.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/mrps', '', 0)
|
||||
);
|
||||
|
||||
// Some keys to add into the overwriting translation tables
|
||||
|
|
@ -534,7 +534,7 @@ class modMrp extends DolibarrModules
|
|||
|
||||
// ODT template
|
||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/mrps/template_mo.odt';
|
||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/mrps';
|
||||
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/mrps';
|
||||
$dest = $dirodt.'/template_mo.odt';
|
||||
|
||||
if (file_exists($src) && !file_exists($dest)) {
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class modProjet extends DolibarrModules
|
|||
[
|
||||
"PROJECT_ADDON_PDF_ODT_PATH",
|
||||
"chaine",
|
||||
"DOL_DATA_ROOT/doctemplates/projects",
|
||||
"DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/projects",
|
||||
"",
|
||||
0,
|
||||
],
|
||||
|
|
@ -113,7 +113,7 @@ class modProjet extends DolibarrModules
|
|||
[
|
||||
"PROJECT_TASK_ADDON_PDF_ODT_PATH",
|
||||
"chaine",
|
||||
"DOL_DATA_ROOT/doctemplates/tasks",
|
||||
"DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/tasks",
|
||||
"",
|
||||
0,
|
||||
],
|
||||
|
|
@ -380,7 +380,7 @@ class modProjet extends DolibarrModules
|
|||
|
||||
//ODT template for project
|
||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/projects/template_project.odt';
|
||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/projects';
|
||||
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/projects';
|
||||
$dest = $dirodt.'/template_project.odt';
|
||||
|
||||
if (file_exists($src) && !file_exists($dest)) {
|
||||
|
|
@ -396,7 +396,7 @@ class modProjet extends DolibarrModules
|
|||
|
||||
//ODT template for tasks
|
||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/tasks/template_task_summary.odt';
|
||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/tasks';
|
||||
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/tasks';
|
||||
$dest = $dirodt.'/template_task_summary.odt';
|
||||
|
||||
if (file_exists($src) && !file_exists($dest)) {
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class modPropale extends DolibarrModules
|
|||
|
||||
$this->const[$r][0] = "PROPALE_ADDON_PDF_ODT_PATH";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/proposals";
|
||||
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/proposals";
|
||||
$this->const[$r][3] = "";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
|
@ -490,7 +490,7 @@ class modPropale extends DolibarrModules
|
|||
|
||||
//ODT template
|
||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/proposals/template_proposal.odt';
|
||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/proposals';
|
||||
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/proposals';
|
||||
$dest = $dirodt.'/template_proposal.odt';
|
||||
|
||||
if (file_exists($src) && !file_exists($dest)) {
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class modReception extends DolibarrModules
|
|||
|
||||
$this->const[$r][0] = "RECEPTION_ADDON_PDF_ODT_PATH";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/receptions";
|
||||
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/receptions";
|
||||
$this->const[$r][3] = "";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
|
@ -267,7 +267,7 @@ class modReception extends DolibarrModules
|
|||
|
||||
//ODT template
|
||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/reception/template_reception.odt';
|
||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/reception';
|
||||
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/reception';
|
||||
$dest = $dirodt.'/template_reception.odt';
|
||||
|
||||
if (file_exists($src) && !file_exists($dest)) {
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class modSociete extends DolibarrModules
|
|||
|
||||
$this->const[$r][0] = "COMPANY_ADDON_PDF_ODT_PATH";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/thirdparties";
|
||||
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/thirdparties";
|
||||
$this->const[$r][3] = "";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
|
@ -1034,7 +1034,7 @@ class modSociete extends DolibarrModules
|
|||
|
||||
//ODT template
|
||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/thirdparties/template_thirdparty.odt';
|
||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/thirdparties';
|
||||
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/thirdparties';
|
||||
$dest = $dirodt.'/template_thirdparty.odt';
|
||||
|
||||
if (file_exists($src) && !file_exists($dest)) {
|
||||
|
|
|
|||
|
|
@ -97,14 +97,14 @@ class modStock extends DolibarrModules
|
|||
$r++;
|
||||
$this->const[$r][0] = "STOCK_ADDON_PDF_ODT_PATH";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/stocks";
|
||||
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/stocks";
|
||||
$this->const[$r][3] = "";
|
||||
$this->const[$r][4] = 0;
|
||||
|
||||
$r++;
|
||||
$this->const[$r][0] = "MOUVEMENT_ADDON_PDF_ODT_PATH";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/stocks/movements";
|
||||
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/stocks/movements";
|
||||
$this->const[$r][3] = "";
|
||||
$this->const[$r][4] = 0;
|
||||
|
||||
|
|
@ -554,7 +554,7 @@ class modStock extends DolibarrModules
|
|||
|
||||
//ODT template
|
||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/stocks/template_warehouse.odt';
|
||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/stocks';
|
||||
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/stocks';
|
||||
$dest = $dirodt.'/template_warehouse.odt';
|
||||
|
||||
if (file_exists($src) && !file_exists($dest)) {
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class modSupplierProposal extends DolibarrModules
|
|||
|
||||
$this->const[$r][0] = "SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/supplier_proposals";
|
||||
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/supplier_proposals";
|
||||
$this->const[$r][3] = "";
|
||||
$this->const[$r][4] = 0;
|
||||
|
||||
|
|
@ -164,7 +164,7 @@ class modSupplierProposal extends DolibarrModules
|
|||
|
||||
//ODT template
|
||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/supplier_proposals/template_supplier_proposal.odt';
|
||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/supplier_proposals';
|
||||
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/supplier_proposals';
|
||||
$dest = $dirodt.'/template_supplier_proposal.odt';
|
||||
|
||||
if (file_exists($src) && !file_exists($dest)) {
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class modTicket extends DolibarrModules
|
|||
$this->const = array(
|
||||
1 => array('TICKET_ENABLE_PUBLIC_INTERFACE', 'chaine', '0', 'Enable ticket public interface', 0),
|
||||
2 => array('TICKET_ADDON', 'chaine', 'mod_ticket_simple', 'Ticket ref module', 0),
|
||||
3 => array('TICKET_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT/doctemplates/tickets', 'Ticket templates ODT/ODS directory for templates', 0),
|
||||
3 => array('TICKET_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT'.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/tickets', 'Ticket templates ODT/ODS directory for templates', 0),
|
||||
4 => array('TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND', 'chaine', 0, 'Automatically mark ticket as read when created from backend', 0),
|
||||
5 => array('TICKET_DELAY_BEFORE_FIRST_RESPONSE', 'chaine', '0', 'Maximum wanted elapsed time before a first answer to a ticket (in hours). Display a warning in tickets list if not respected.', 0),
|
||||
6 => array('TICKET_DELAY_SINCE_LAST_RESPONSE', 'chaine', '0', 'Maximum wanted elapsed time between two answers on the same ticket (in hours). Display a warning in tickets list if not respected.', 0),
|
||||
|
|
@ -414,7 +414,7 @@ class modTicket extends DolibarrModules
|
|||
|
||||
//ODT template
|
||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/tickets/template_ticket.odt';
|
||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/tickets';
|
||||
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/tickets';
|
||||
$dest = $dirodt.'/template_ticket.odt';
|
||||
|
||||
if (file_exists($src) && !file_exists($dest)) {
|
||||
|
|
|
|||
|
|
@ -195,8 +195,8 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||
'task_label' => $task->label,
|
||||
'task_description' => $task->description,
|
||||
'task_fk_parent' => $task->fk_task_parent,
|
||||
'task_duration' => $task->duration,
|
||||
'task_duration_hour' => convertSecondToTime($task->duration, 'all'),
|
||||
'task_duration' => $task->duration_effective,
|
||||
'task_duration_hour' => convertSecondToTime($task->duration_effective, 'all'),
|
||||
'task_planned_workload' => $task->planned_workload,
|
||||
'task_planned_workload_hour' => convertSecondToTime($task->planned_workload, 'all'),
|
||||
'task_progress' => $task->progress,
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@ class pdf_timespent extends ModelePDFProjects
|
|||
//$progress=($object->lines[$i]->progress?$object->lines[$i]->progress.'%':'');
|
||||
$datestart = dol_print_date($object->lines[$i]->date_start, 'day');
|
||||
$dateend = dol_print_date($object->lines[$i]->date_end, 'day');
|
||||
$duration = convertSecondToTime((int) $object->lines[$i]->duration, 'allhourmin');
|
||||
$duration = convertSecondToTime((int) $object->lines[$i]->duration_effective, 'allhourmin');
|
||||
|
||||
$showpricebeforepagebreak = 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<?php
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2025 Benjamin Falière <benjamin@faliere.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -69,11 +70,13 @@ foreach ($object->fields as $key => $val) {
|
|||
}
|
||||
print '"';
|
||||
print '>';
|
||||
print '<label for="'.$key.'" class="block">';
|
||||
if (!empty($val['help'])) {
|
||||
print $form->textwithpicto($langs->trans($val['label']), $langs->trans($val['help']));
|
||||
} else {
|
||||
print $langs->trans($val['label']);
|
||||
}
|
||||
print '</label>';
|
||||
print '</td>';
|
||||
print '<td class="valuefieldcreate">';
|
||||
if (!empty($val['picto'])) {
|
||||
|
|
|
|||
|
|
@ -15,26 +15,22 @@
|
|||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Need to have the following variables defined:
|
||||
* $conf
|
||||
* $formmail
|
||||
* $formwebsite (optional)
|
||||
* $showlinktolayout='emailing', 'email', 'websitepage', ...
|
||||
* $showlinktolayoutlabel='...'
|
||||
* $showlinktoai ('' or 'textgeneration', 'textgenerationemail', 'textgenerationwebpage', ...)
|
||||
* $showlinktoailabel='...'
|
||||
* $htmlname
|
||||
*/
|
||||
/**
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var ?FormMail $formmail
|
||||
* @var ?FormWebsite $formwebsite
|
||||
* @var string $htmlname
|
||||
* @var string $showlinktolayout
|
||||
* @var string $showlinktolayoutlabel
|
||||
* @var ?FormMail $formmail
|
||||
* @var ?FormWebsite $formwebsite
|
||||
* @var string $htmlname
|
||||
* @var string $showlinktolayout 'emailing', 'email', 'websitepage', ...
|
||||
* @var string $showlinktolayoutlabel '...'
|
||||
* @var string $showlinktoai '' or 'textgeneration', 'textgenerationemail', 'textgenerationwebpage', ...
|
||||
* @var string $showlinktoailabel '...'
|
||||
* @var string $htmlname
|
||||
* @var ?string $out
|
||||
*/
|
||||
// Protection to avoid direct call of template
|
||||
|
||||
//Protection to avoid direct call of template
|
||||
if (empty($conf) || !is_object($conf)) {
|
||||
print "Error, template page can't be called as URL";
|
||||
exit(1);
|
||||
|
|
@ -59,11 +55,12 @@ if (empty($htmlname)) {
|
|||
@phan-var-force ?string $out
|
||||
';
|
||||
|
||||
if (!isset($out)) {
|
||||
if (!isset($out)) { // Init to empty string if not defined
|
||||
$out = '';
|
||||
}
|
||||
|
||||
// Add link to add layout
|
||||
if ($showlinktolayout) {
|
||||
if ($showlinktolayout) { // May be set only if MAIN_EMAIL_USE_LAYOUT is set
|
||||
$out .= '<a href="#" id="linkforlayouttemplates" class="notasortlink inline-block alink marginrightonly">';
|
||||
$out .= img_picto($showlinktolayoutlabel, 'layout', 'class="paddingrightonly"');
|
||||
$out .= $showlinktolayoutlabel.'...';
|
||||
|
|
@ -72,10 +69,10 @@ if ($showlinktolayout) {
|
|||
$out .= '<script>
|
||||
$(document).ready(function() {
|
||||
$("#linkforlayouttemplates").click(function() {
|
||||
console.log("We click on linkforlayouttemplates");
|
||||
console.log("We click on linkforlayouttemplates, we toggle .template-selector");
|
||||
event.preventDefault();
|
||||
jQuery("#template-selector").toggle();
|
||||
jQuery("#ai_input'.$htmlname.'").hide();
|
||||
jQuery(".template-selector").toggle();
|
||||
jQuery(".ai_input'.$htmlname.'").hide();
|
||||
jQuery("#pageContent").show(); // May exists for website page only
|
||||
});
|
||||
});
|
||||
|
|
@ -92,10 +89,10 @@ if ($showlinktoai) {
|
|||
$out .= '<script>
|
||||
$(document).ready(function() {
|
||||
$("#linkforaiprompt'.$showlinktoai.'").click(function() {
|
||||
console.log("formlayoutai.tpl: We click on linkforaiprompt'.$showlinktoai.', we toggle #ai_input'.$showlinktoai.'");
|
||||
console.log("formlayoutai.tpl: We click on linkforaiprompt'.$showlinktoai.', we toggle .ai_input'.$showlinktoai.'");
|
||||
event.preventDefault();
|
||||
jQuery("#ai_input'.$htmlname.'").toggle();
|
||||
jQuery("#template-selector").hide();
|
||||
jQuery(".ai_input'.$htmlname.'").toggle();
|
||||
jQuery(".template-selector").hide();
|
||||
jQuery(".email-layout-container").hide();
|
||||
if (!jQuery("#ai_input'.$htmlname.'").is(":hidden")) {
|
||||
console.log("Set focus on input field #ai_instructions'.$htmlname.'");
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) {
|
|||
//header("X-XSS-Protection: 1"); // XSS filtering protection of some browsers (note: use of Content-Security-Policy is more efficient). Disabled as deprecated.
|
||||
|
||||
// Content-Security-Policy-Report-Only
|
||||
if (!defined('WEBSITE_MAIN_SECURITY_FORCECSPRO')) {
|
||||
if (!defined('WEBSITE_'.$website->id.'_SECURITY_FORCECSPRO')) {
|
||||
// A default security policy that keep usage of js external component like ckeditor, stripe, google, working
|
||||
// For example: to restrict to only local resources, except for css (cloudflare+google), and js (transifex + google tags) and object/iframe (youtube)
|
||||
// default-src 'self'; style-src: https://cdnjs.cloudflare.com https://fonts.googleapis.com; script-src: https://cdn.transifex.com https://www.googletagmanager.com; object-src https://youtube.com; frame-src https://youtube.com; img-src: *;
|
||||
|
|
@ -145,7 +145,7 @@ if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) {
|
|||
//
|
||||
// $contentsecuritypolicy = "frame-ancestors 'self'; img-src * data:; font-src *; default-src 'self' 'unsafe-inline' 'unsafe-eval' *.paypal.com *.stripe.com *.google.com *.googleapis.com *.google-analytics.com *.googletagmanager.com;";
|
||||
// $contentsecuritypolicy = "frame-ancestors 'self'; img-src * data:; font-src *; default-src *; script-src 'self' 'unsafe-inline' *.paypal.com *.stripe.com *.google.com *.googleapis.com *.google-analytics.com *.googletagmanager.com; style-src 'self' 'unsafe-inline'; connect-src 'self';";
|
||||
$contentsecuritypolicy = getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCECSPRO');
|
||||
$contentsecuritypolicy = getDolGlobalString('WEBSITE_'.$website->id.'_SECURITY_FORCECSPRO');
|
||||
|
||||
if (!is_object($hookmanager)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
|
|
|
|||
|
|
@ -79,6 +79,8 @@ if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias')) {
|
|||
/**
|
||||
* Header empty
|
||||
*
|
||||
* Note: also called by functions.lib:recordNotFound
|
||||
*
|
||||
* @param string $head Optional head lines
|
||||
* @param string $title HTML title
|
||||
* @param string $help_url Url links to help page
|
||||
|
|
@ -103,6 +105,8 @@ function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disab
|
|||
/**
|
||||
* Footer empty
|
||||
*
|
||||
* Note: also called by functions.lib:recordNotFound
|
||||
*
|
||||
* @ignore
|
||||
* @param string $comment A text to add as HTML comment into HTML generated page
|
||||
* @param string $zone 'private' (for private pages) or 'public' (for public pages)
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class DonationStats extends Stats
|
|||
}
|
||||
|
||||
if ($typentid) {
|
||||
$this->join .= " LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = d.fk_soc";
|
||||
$this->join .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = d.fk_soc";
|
||||
$this->where .= " AND s.fk_typent = ".((int) $typentid);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ if ($resql) {
|
|||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th colspan="5">'.$langs->trans("LastModifiedDonations", $max).' ';
|
||||
print '<a href="'.DOL_URL_ROOT.'/don/list.php?sortfield=d.datem&sortorder=DESC">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/don/list.php?sortfield=d.datedon&sortorder=DESC">';
|
||||
print '<span class="badge">...</span>';
|
||||
print '</a>';
|
||||
print '</th></tr>';
|
||||
|
|
|
|||
|
|
@ -48,10 +48,15 @@ $langs->loadLangs(array('companies', 'donations'));
|
|||
// Get parameters
|
||||
$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ...
|
||||
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'donationlist';
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
$mode = GETPOST('mode', 'alpha');
|
||||
$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ?
|
||||
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
|
||||
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
|
||||
$toselect = GETPOST('toselect', 'array:int'); // Array of ids of elements selected into a list
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
$mode = GETPOST('mode', 'aZ'); // The display mode ('list', 'kanban', 'hierarchy', 'calendar', 'gantt', ...)
|
||||
$groupby = GETPOST('groupby', 'aZ09'); // Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut'
|
||||
|
||||
$type = GETPOST('type', 'aZ');
|
||||
|
||||
|
|
@ -145,16 +150,54 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
|
|||
$massaction = '';
|
||||
}
|
||||
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // Both test are required to be compatible with all browsers
|
||||
$search_all = "";
|
||||
$search_ref = "";
|
||||
$search_company = "";
|
||||
$search_thirdparty = "";
|
||||
$search_name = "";
|
||||
$search_amount = "";
|
||||
$search_status = '';
|
||||
$parameters = array('arrayfields' => &$arrayfields);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($reshook)) {
|
||||
// Selection of new fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$search[$key] = '';
|
||||
if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
||||
$search[$key.'_dtstart'] = '';
|
||||
$search[$key.'_dtend'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
$search_all = "";
|
||||
$search_ref = "";
|
||||
$search_company = "";
|
||||
$search_thirdparty = "";
|
||||
$search_name = "";
|
||||
$search_amount = "";
|
||||
$search_status = '';
|
||||
$toselect = array();
|
||||
$search_array_options = array();
|
||||
}
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
|
||||
|| GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
|
||||
$massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
|
||||
}
|
||||
|
||||
// Mass actions
|
||||
$objectclass = 'Don';
|
||||
$objectlabel = 'Don';
|
||||
$uploaddir = $conf->don->dir_output;
|
||||
|
||||
global $error;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
// You can add more action here
|
||||
// if ($action == 'xxx' && $permissiontoxxx) ...
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
|
|
@ -253,7 +296,7 @@ $num = $db->num_rows($resql);
|
|||
if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$id = $obj->rowid;
|
||||
header("Location: ".dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$id);
|
||||
header("Location: ".dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.((int) $id));
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
@ -293,6 +336,9 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
|
|||
if ($optioncss != '') {
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
}
|
||||
if ($groupby != '') {
|
||||
$param .= '&groupby='.urlencode($groupby);
|
||||
}
|
||||
if ($search_status && $search_status != -1) {
|
||||
$param .= '&search_status='.urlencode($search_status);
|
||||
}
|
||||
|
|
@ -308,6 +354,12 @@ if ($search_name) {
|
|||
if ($search_amount) {
|
||||
$param .= '&search_amount='.urlencode($search_amount);
|
||||
}
|
||||
// Add $param from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
// Add $param from hooks
|
||||
$parameters = array('param' => &$param);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$param .= $hookmanager->resPrint;
|
||||
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array(
|
||||
|
|
@ -324,7 +376,6 @@ if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predel
|
|||
}
|
||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
if ($optioncss != '') {
|
||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
|
|
@ -343,13 +394,18 @@ print '<input type="hidden" name="type" value="'.$type.'">';
|
|||
$newcardbutton = '';
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition'));
|
||||
if ($user->hasRight('don', 'creer')) {
|
||||
$newcardbutton .= dolGetButtonTitleSeparator();
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewDonation'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/don/card.php?action=create');
|
||||
}
|
||||
$newcardbutton .= dolGetButtonTitleSeparator();
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewDonation'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/don/card.php?action=create', '', $permissiontoadd);
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
|
||||
print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'object_donation', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_donation', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
// Add code for pre mass action (confirmation or email presend form)
|
||||
$topicmail = "SendDonationRef";
|
||||
$modelmail = "don";
|
||||
$objecttmp = new Don($db);
|
||||
$trackid = 'don'.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||
|
||||
if ($search_all) {
|
||||
$setupstring = '';
|
||||
|
|
@ -361,19 +417,41 @@ if ($search_all) {
|
|||
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'</div>';
|
||||
}
|
||||
|
||||
$moreforfilter = '';
|
||||
/*$moreforfilter.='<div class="divsearchfield">';
|
||||
$moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">';
|
||||
$moreforfilter.= '</div>';*/
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
$moreforfilter .= $hookmanager->resPrint;
|
||||
} else {
|
||||
$moreforfilter = $hookmanager->resPrint;
|
||||
}
|
||||
$parameters = array(
|
||||
'arrayfields' => &$arrayfields,
|
||||
);
|
||||
|
||||
if (!empty($moreforfilter)) {
|
||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||
print $moreforfilter;
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
|
||||
$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column ? 'left' : ''); // This also change content of $arrayfields with user setup
|
||||
$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
|
||||
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable nobottomiftotal liste'.(!empty($moreforfilter) ? " listwithfilterbefore" : "").'">'."\n";
|
||||
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
||||
print '<table class="tagtable nobottomiftotal noborder liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||
|
||||
// Fields title search
|
||||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre_filter">';
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
if ($conf->main_checkbox_left_column) {
|
||||
print '<td class="liste_titre center maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons('left');
|
||||
print $searchpicto;
|
||||
|
|
@ -413,7 +491,8 @@ $liststatus = array(
|
|||
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
|
||||
print $form->selectarray('search_status', $liststatus, $search_status, -4, 0, 0, '', 0, 0, 0, '', 'search_status maxwidth100 onrightofpage');
|
||||
print '</td>';
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
// Action column
|
||||
if (!$conf->main_checkbox_left_column) {
|
||||
print '<td class="liste_titre center maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
|
|
@ -428,8 +507,8 @@ $totalarray['nbfield'] = 0;
|
|||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre">';
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre('');
|
||||
if ($conf->main_checkbox_left_column) {
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "d.rowid", "", $param, "", $sortfield, $sortorder);
|
||||
|
|
@ -454,8 +533,9 @@ print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "d.amount", "", $param,
|
|||
$totalarray['nbfield']++;
|
||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "d.fk_statut", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
$totalarray['nbfield']++;
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre('');
|
||||
// Action column
|
||||
if (!$conf->main_checkbox_left_column) {
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
|
@ -467,16 +547,24 @@ $totalarray['nbfield'] = 0;
|
|||
$imaxinloop = ($limit ? min($num, $limit) : $num);
|
||||
while ($i < $imaxinloop) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if (empty($obj)) {
|
||||
break; // Should not happen
|
||||
}
|
||||
|
||||
$donationstatic->setVarsFromFetchObj($obj);
|
||||
|
||||
$donationstatic->id = $obj->rowid;
|
||||
$donationstatic->ref = $obj->rowid;
|
||||
$donationstatic->date = $db->jdate($obj->datedon);
|
||||
$donationstatic->status = $obj->status;
|
||||
$donationstatic->lastname = $obj->lastname;
|
||||
$donationstatic->firstname = $obj->firstname;
|
||||
$object = $donationstatic;
|
||||
|
||||
$company = new Societe($db);
|
||||
$result = $company->fetch($obj->socid);
|
||||
|
||||
|
||||
if ($mode == 'kanban') {
|
||||
if ($i == 0) {
|
||||
print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
|
||||
|
|
@ -506,13 +594,24 @@ while ($i < $imaxinloop) {
|
|||
print '</td></tr>';
|
||||
}
|
||||
} else {
|
||||
$donationstatic->lastname = $obj->lastname;
|
||||
$donationstatic->firstname = $obj->firstname;
|
||||
// Show line of result
|
||||
$j = 0;
|
||||
print '<tr data-rowid="'.$object->id.'" class="oddeven">';
|
||||
|
||||
// Action
|
||||
print '<tr class="oddeven">';
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td></td>';
|
||||
// Action column
|
||||
if ($conf->main_checkbox_left_column) {
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
$selected = 0;
|
||||
if (in_array($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Ref
|
||||
|
|
@ -554,20 +653,35 @@ while ($i < $imaxinloop) {
|
|||
// Status
|
||||
print '<td class="center">'.$donationstatic->LibStatut($obj->status, 5).'</td>';
|
||||
|
||||
// Action
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td></td>';
|
||||
// Action column
|
||||
if (empty($conf->main_checkbox_left_column)) {
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
$selected = 0;
|
||||
if (in_array($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
print "</tr>";
|
||||
print '</tr>'."\n";
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
print "</form>\n";
|
||||
|
||||
$db->free($resql);
|
||||
|
||||
print '</table>'."\n";
|
||||
print '</div>'."\n";
|
||||
|
||||
print '</form>'."\n";
|
||||
|
||||
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
|
|
|||
|
|
@ -1013,9 +1013,17 @@ class EcmFiles extends CommonObject
|
|||
} elseif ($option == 'commande_fournisseur') {
|
||||
$tmppath = preg_replace('/^fournisseur\/commande\//', '', $this->filepath);
|
||||
} else {
|
||||
$tmppath = preg_replace('/^[^\/]+\//', '', $this->filepath);
|
||||
if ((int) $this->entity > 1) {
|
||||
// Remove the part "entityid/commande/" into "entityid/commande/REFXXX" to get only the ref
|
||||
$tmppath = preg_replace('/^\d+\/[^\/]+\//', '', $this->filepath);
|
||||
} else {
|
||||
// Remove the part "commande/" into "commande/REFXXX" to get only the ref
|
||||
$tmppath = preg_replace('/^[^\/]+\//', '', $this->filepath);
|
||||
}
|
||||
}
|
||||
$url = DOL_URL_ROOT.'/document.php?modulepart='.urlencode($option).'&file='.urlencode($tmppath.'/'.$this->filename).'&entity='.$this->entity;
|
||||
//var_dump($this->filepath);
|
||||
|
||||
$url = DOL_URL_ROOT.'/document.php?modulepart='.urlencode($option).'&file='.urlencode($tmppath.'/'.$this->filename).'&entity='.((int) $this->entity);
|
||||
} else {
|
||||
$url = DOL_URL_ROOT.'/ecm/file_card.php?id='.$this->id;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -345,6 +345,7 @@ $moreheadjs .= '</script>'."\n";
|
|||
llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', 0, 0, $morejs, '', '', 'mod-ecm page-index');
|
||||
|
||||
$head = ecm_prepare_dasboard_head();
|
||||
|
||||
print dol_get_fiche_head($head, 'index', '', -1, '');
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -612,11 +612,11 @@ class Expedition extends CommonObject
|
|||
$tab = $line_ext->detail_batch;
|
||||
// create stockLocation Qty array
|
||||
foreach ($tab as $detbatch) {
|
||||
if (!empty($detbatch->entrepot_id)) {
|
||||
if (empty($stockLocationQty[$detbatch->entrepot_id])) {
|
||||
$stockLocationQty[$detbatch->entrepot_id] = 0;
|
||||
if (!empty($detbatch->fk_warehouse)) {
|
||||
if (empty($stockLocationQty[$detbatch->fk_warehouse])) {
|
||||
$stockLocationQty[$detbatch->fk_warehouse] = 0;
|
||||
}
|
||||
$stockLocationQty[$detbatch->entrepot_id] += $detbatch->qty;
|
||||
$stockLocationQty[$detbatch->fk_warehouse] += $detbatch->qty;
|
||||
}
|
||||
}
|
||||
// create shipment lines
|
||||
|
|
@ -627,7 +627,7 @@ class Expedition extends CommonObject
|
|||
} else {
|
||||
// create shipment batch lines for stockLocation
|
||||
foreach ($tab as $detbatch) {
|
||||
if ($detbatch->entrepot_id == $stockLocation) {
|
||||
if ($detbatch->fk_warehouse == $stockLocation) {
|
||||
if (!($detbatch->create($line_id) > 0)) { // Create an ExpeditionLineBatch
|
||||
$this->errors = $detbatch->errors;
|
||||
$error++;
|
||||
|
|
@ -1110,7 +1110,7 @@ class Expedition extends CommonObject
|
|||
}
|
||||
}
|
||||
if (is_object($linebatch)) {
|
||||
$line->entrepot_id = $linebatch->entrepot_id;
|
||||
$line->entrepot_id = $linebatch->fk_warehouse;
|
||||
}
|
||||
$line->origin_line_id = $dbatch['ix_l']; // deprecated
|
||||
$line->fk_elementdet = $dbatch['ix_l'];
|
||||
|
|
|
|||
|
|
@ -603,7 +603,7 @@ class ExpeditionLigne extends CommonObjectLine
|
|||
$shipmentLot->batch = $lot->batch;
|
||||
$shipmentLot->eatby = $lot->eatby;
|
||||
$shipmentLot->sellby = $lot->sellby;
|
||||
$shipmentLot->entrepot_id = $this->detail_batch->entrepot_id;
|
||||
$shipmentLot->fk_warehouse = $this->detail_batch->entrepot_id;
|
||||
$shipmentLot->qty = $this->detail_batch->qty;
|
||||
$shipmentLot->fk_origin_stock = (int) $batch_id;
|
||||
if ($shipmentLot->create($this->id) < 0) {
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ class ExpeditionLineBatch extends CommonObject
|
|||
public $dluo_qty;
|
||||
/**
|
||||
* @var int
|
||||
* @deprecated, use fk_warehouse
|
||||
*/
|
||||
public $entrepot_id;
|
||||
/**
|
||||
|
|
@ -117,7 +118,8 @@ class ExpeditionLineBatch extends CommonObject
|
|||
$this->sellby = $this->db->jdate($obj->sellby);
|
||||
$this->eatby = $this->db->jdate($obj->eatby);
|
||||
$this->batch = $obj->batch;
|
||||
$this->entrepot_id = $obj->fk_entrepot;
|
||||
$this->entrepot_id = $obj->fk_entrepot; // deprecated use fk_warehouse
|
||||
$this->fk_warehouse = $obj->fk_entrepot;
|
||||
$this->fk_origin_stock = (int) $id_stockdluo;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
|
|
|||
|
|
@ -184,8 +184,8 @@ if ($action == 'updatelines' && $usercancreate) {
|
|||
}
|
||||
if (!$error && $modebatch == "batch") {
|
||||
$sql = "SELECT pb.rowid ";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."product_batch as pb";
|
||||
$sql .= " JOIN ".MAIN_DB_PREFIX."product_stock as ps";
|
||||
$sql .= " FROM ".$db->prefix()."product_batch as pb";
|
||||
$sql .= " JOIN ".$db->prefix()."product_stock as ps";
|
||||
$sql .= " ON ps.rowid = pb.fk_product_stock";
|
||||
$sql .= " WHERE pb.batch = '".$db->escape($lot)."'";
|
||||
$sql .= " AND ps.fk_product = ".((int) $prod_id) ;
|
||||
|
|
@ -241,7 +241,7 @@ if ($action == 'updatelines' && $usercancreate) {
|
|||
$sellby = dol_mktime(0, 0, 0, GETPOSTINT('dlc'.$suffixkeyfordate.'month'), GETPOSTINT('dlc'.$suffixkeyfordate.'day'), GETPOSTINT('dlc'.$suffixkeyfordate.'year'), '');
|
||||
$eatby = dol_mktime(0, 0, 0, GETPOSTINT('dluo'.$suffixkeyfordate.'month'), GETPOSTINT('dluo'.$suffixkeyfordate.'day'), GETPOSTINT('dluo'.$suffixkeyfordate.'year'));
|
||||
|
||||
$sqlsearchdet = "SELECT rowid FROM ".MAIN_DB_PREFIX.$expeditionlinebatch->table_element;
|
||||
$sqlsearchdet = "SELECT rowid FROM ".$db->prefix().$expeditionlinebatch->table_element;
|
||||
$sqlsearchdet .= " WHERE fk_expeditiondet = ".((int) $idline);
|
||||
$sqlsearchdet .= " AND batch = '".$db->escape($lot)."'";
|
||||
$resqlsearchdet = $db->query($sqlsearchdet);
|
||||
|
|
@ -254,20 +254,20 @@ if ($action == 'updatelines' && $usercancreate) {
|
|||
}
|
||||
|
||||
if ($objsearchdet) {
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$expeditionlinebatch->table_element." SET";
|
||||
$sql = "UPDATE ".$db->prefix().$expeditionlinebatch->table_element." SET";
|
||||
$sql .= " eatby = ".($eatby ? "'".$db->idate($eatby)."'" : "null");
|
||||
$sql .= " , sellby = ".($sellby ? "'".$db->idate($sellby)."'" : "null");
|
||||
$sql .= " , qty = ".((float) $newqty);
|
||||
$sql .= " , fk_warehouse = ".((int) $warehouse_id);
|
||||
$sql .= " WHERE rowid = ".((int) $objsearchdet->rowid);
|
||||
} else {
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX.$expeditionlinebatch->table_element." (";
|
||||
$sql = "INSERT INTO ".$db->prefix().$expeditionlinebatch->table_element." (";
|
||||
$sql .= "fk_expeditiondet, eatby, sellby, batch, qty, fk_origin_stock, fk_warehouse)";
|
||||
$sql .= " VALUES (".((int) $idline).", ".($eatby ? "'".$db->idate($eatby)."'" : "null").", ".($sellby ? "'".$db->idate($sellby)."'" : "null").", ";
|
||||
$sql .= " '".$db->escape($lot)."', ".((float) $newqty).", 0, ".((int) $warehouse_id).")";
|
||||
}
|
||||
} else {
|
||||
$sql = " DELETE FROM ".MAIN_DB_PREFIX.$expeditionlinebatch->table_element;
|
||||
$sql = " DELETE FROM ".$db->prefix().$expeditionlinebatch->table_element;
|
||||
$sql .= " WHERE fk_expeditiondet = ".((int) $idline);
|
||||
$sql .= " AND batch = '".$db->escape($lot)."'";
|
||||
}
|
||||
|
|
@ -567,7 +567,7 @@ if ($object->id > 0 || !empty($object->ref)) {
|
|||
// Get list of lines of the shipment $products_dispatched, with qty dispatched for each product id
|
||||
$products_dispatched = array();
|
||||
$sql = "SELECT ed.fk_elementdet as rowid, sum(ed.qty) as qty";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed";
|
||||
$sql .= " FROM ".$db->prefix()."expeditiondet as ed";
|
||||
$sql .= " WHERE ed.fk_expedition = ".((int) $object->id);
|
||||
$sql .= " GROUP BY ed.fk_elementdet";
|
||||
|
||||
|
|
@ -602,8 +602,8 @@ if ($object->id > 0 || !empty($object->ref)) {
|
|||
}
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."commandedet as l";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON l.fk_product=p.rowid";
|
||||
$sql .= " FROM ".$db->prefix()."commandedet as l";
|
||||
$sql .= " LEFT JOIN ".$db->prefix()."product as p ON l.fk_product=p.rowid";
|
||||
$sql .= " WHERE l.fk_commande = ".((int) $objectsrc->id);
|
||||
if (!getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
|
||||
$sql .= " AND l.product_type = 0";
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ $result = restrictedArea($user, 'expedition', 0, ''); // We use 0 for id, becaus
|
|||
|
||||
$permissiontoread = $user->hasRight('expedition', 'lire');
|
||||
$permissiontoadd = $user->hasRight('expedition', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
||||
$permissiontodelete = $user->hasRight('expedition', 'supprimer') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
|
||||
$permissiontodelete = $user->hasRight('expedition', 'supprimer') || ($permissiontoadd && ((int) $object->status == $object::STATUS_DRAFT));
|
||||
$permissionnote = $user->hasRight('expedition', 'creer'); // Used by the include of actions_setnotes.inc.php
|
||||
$permissiondellink = $user->hasRight('expedition', 'creer'); // Used by the include of actions_dellink.inc.php
|
||||
|
||||
|
|
|
|||
|
|
@ -235,14 +235,14 @@ if (isModEnabled("supplier_order")) {
|
|||
|
||||
|
||||
/*
|
||||
* List of users allowed
|
||||
* List of users allowed to approve
|
||||
*/
|
||||
|
||||
$sql = "SELECT";
|
||||
if (isModEnabled('multicompany') && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) {
|
||||
$sql .= " DISTINCT";
|
||||
}
|
||||
$sql .= " u.rowid, u.lastname, u.firstname, u.email, u.statut";
|
||||
$sql .= " u.rowid, u.login, u.lastname, u.firstname, u.email, u.photo, u.statut";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
if (isModEnabled('multicompany') && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) {
|
||||
$sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||
|
|
@ -252,7 +252,7 @@ if (isModEnabled('multicompany') && getDolGlobalString('MULTICOMPANY_TRANSVERSE_
|
|||
} else {
|
||||
$sql .= " WHERE (u.entity IN (".getEntity('user')."))";
|
||||
}
|
||||
$sql .= " AND u.fk_soc IS NULL"; // An external user can not approved
|
||||
$sql .= " AND u.fk_soc IS NULL"; // An external user can not approve
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
|
|
@ -264,6 +264,9 @@ if ($resql) {
|
|||
print '<tr class="liste_titre"><th>'.$langs->trans("UserWithApproveOrderGrant").'</th>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
|
@ -272,19 +275,29 @@ if ($resql) {
|
|||
$userstatic->loadRights('fournisseur');
|
||||
|
||||
if ($userstatic->hasRight('fournisseur', 'commande', 'approuver')) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
if ($i > 0) {
|
||||
print ', ';
|
||||
}
|
||||
|
||||
$userstatic->lastname = $obj->lastname;
|
||||
$userstatic->firstname = $obj->firstname;
|
||||
$userstatic->email = $obj->email;
|
||||
$userstatic->login = $obj->login;
|
||||
$userstatic->photo = $obj->photo;
|
||||
$userstatic->status = $obj->statut;
|
||||
print $userstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print $userstatic->getNomUrl(-1);
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
if ($i == 0) {
|
||||
print '<span class="opacitymedium">'.$langs->trans("Nobody").'</span>';
|
||||
}
|
||||
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print "</table></div><br>";
|
||||
$db->free($resql);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ if (!defined('NOTOKENRENEWAL')) {
|
|||
/**
|
||||
* This file is a wrapper, so empty header
|
||||
*
|
||||
* Note: also called by functions.lib:recordNotFound
|
||||
*
|
||||
* @param string $head Optional head lines
|
||||
* @param string $title HTML title
|
||||
* @param string $help_url Url links to help page
|
||||
|
|
@ -48,7 +50,7 @@ if (!defined('NOTOKENRENEWAL')) {
|
|||
* @param int $disablenoindex Disable the "noindex" on meta robot header
|
||||
* @return void
|
||||
*/
|
||||
function llxHeaderEmptyExample($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0)
|
||||
function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) // @phan-suppress-current-line PhanRedefineFunction
|
||||
{
|
||||
print '<html><title>Build an import example file</title><body>';
|
||||
}
|
||||
|
|
@ -56,12 +58,14 @@ function llxHeaderEmptyExample($head = '', $title = '', $help_url = '', $target
|
|||
/**
|
||||
* This file is a wrapper, so empty footer
|
||||
*
|
||||
* Note: also called by functions.lib:recordNotFound
|
||||
*
|
||||
* @param string $comment A text to add as HTML comment into HTML generated page
|
||||
* @param string $zone 'private' (for private pages) or 'public' (for public pages)
|
||||
* @param int $disabledoutputofmessages Clear all messages stored into session without displaying them
|
||||
* @return void
|
||||
*/
|
||||
function llxFooterEmptyExample($comment = '', $zone = 'private', $disabledoutputofmessages = 0)
|
||||
function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) // @phan-suppress-current-line PhanRedefineFunction
|
||||
{
|
||||
print '</body></html>';
|
||||
}
|
||||
|
|
@ -90,9 +94,9 @@ $langs->load("exports");
|
|||
if (empty($datatoimport)) {
|
||||
$user->loadRights();
|
||||
|
||||
llxHeaderEmptyExample();
|
||||
llxHeader();
|
||||
print '<div class="error">Bad value for datatoimport.</div>';
|
||||
llxFooterEmptyExample();
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,3 +58,76 @@ ALTER TABLE llx_holiday_config ADD UNIQUE INDEX idx_holiday_config (entity, name
|
|||
ALTER TABLE llx_societe_account ADD COLUMN ip varchar(250);
|
||||
|
||||
ALTER TABLE llx_product ADD COLUMN packaging float(24,8) DEFAULT NULL;
|
||||
|
||||
|
||||
ALTER TABLE llx_categorie_member ADD COLUMN import_key varchar(14);
|
||||
ALTER TABLE llx_category_bankline ADD COLUMN import_key varchar(14);
|
||||
|
||||
|
||||
create table llx_categorie_order
|
||||
(
|
||||
fk_categorie integer NOT NULL,
|
||||
fk_order integer NOT NULL,
|
||||
import_key varchar(14)
|
||||
)ENGINE=innodb;
|
||||
|
||||
--noqa:disable=PRS
|
||||
ALTER TABLE llx_categorie_order ADD PRIMARY KEY pk_categorie_order(fk_categorie, fk_order);
|
||||
--noqa:enable=PRS
|
||||
ALTER TABLE llx_categorie_order ADD INDEX idx_categorie_order_fk_categorie (fk_categorie);
|
||||
ALTER TABLE llx_categorie_order ADD INDEX idx_categorie_order_fk_order (fk_order);
|
||||
|
||||
ALTER TABLE llx_categorie_order ADD CONSTRAINT fk_categorie_order_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
|
||||
ALTER TABLE llx_categorie_order ADD CONSTRAINT fk_categorie_order_fk_order_rowid FOREIGN KEY (fk_order) REFERENCES llx_commande (rowid);
|
||||
|
||||
|
||||
create table llx_categorie_invoice
|
||||
(
|
||||
fk_categorie integer NOT NULL,
|
||||
fk_invoice integer NOT NULL,
|
||||
import_key varchar(14)
|
||||
)ENGINE=innodb;
|
||||
|
||||
--noqa:disable=PRS
|
||||
ALTER TABLE llx_categorie_invoice ADD PRIMARY KEY pk_categorie_invoice(fk_categorie, fk_invoice);
|
||||
--noqa:enable=PRS
|
||||
ALTER TABLE llx_categorie_invoice ADD INDEX idx_categorie_invoice_fk_categorie (fk_categorie);
|
||||
ALTER TABLE llx_categorie_invoice ADD INDEX idx_categorie_invoice_fk_invoice (fk_invoice);
|
||||
|
||||
ALTER TABLE llx_categorie_invoice ADD CONSTRAINT fk_categorie_invoice_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
|
||||
ALTER TABLE llx_categorie_invoice ADD CONSTRAINT fk_categorie_invoice_fk_invoice_rowid FOREIGN KEY (fk_invoice) REFERENCES llx_facture (rowid);
|
||||
|
||||
|
||||
create table llx_categorie_supplier_order
|
||||
(
|
||||
fk_categorie integer NOT NULL,
|
||||
fk_supplier_order integer NOT NULL,
|
||||
import_key varchar(14)
|
||||
)ENGINE=innodb;
|
||||
|
||||
--noqa:disable=PRS
|
||||
ALTER TABLE llx_categorie_supplier_order ADD PRIMARY KEY pk_categorie_supplier_order(fk_categorie, fk_supplier_order);
|
||||
--noqa:enable=PRS
|
||||
ALTER TABLE llx_categorie_supplier_order ADD INDEX idx_categorie_supplier_order_fk_categorie (fk_categorie);
|
||||
ALTER TABLE llx_categorie_supplier_order ADD INDEX idx_categorie_supplier_order_fk_supplier_order (fk_supplier_order);
|
||||
|
||||
ALTER TABLE llx_categorie_supplier_order ADD CONSTRAINT fk_categorie_supplier_order_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
|
||||
ALTER TABLE llx_categorie_supplier_order ADD CONSTRAINT fk_categorie_supplier_order_fk_supplier_order_rowid FOREIGN KEY (fk_supplier_order) REFERENCES llx_commande_fournisseur (rowid);
|
||||
|
||||
|
||||
create table llx_categorie_supplier_invoice
|
||||
(
|
||||
fk_categorie integer NOT NULL,
|
||||
fk_supplier_invoice integer NOT NULL,
|
||||
import_key varchar(14)
|
||||
)ENGINE=innodb;
|
||||
|
||||
--noqa:disable=PRS
|
||||
ALTER TABLE llx_categorie_supplier_invoice ADD PRIMARY KEY pk_categorie_supplier_invoice(fk_categorie, fk_supplier_invoice);
|
||||
--noqa:enable=PRS
|
||||
|
||||
ALTER TABLE llx_categorie_supplier_invoice ADD INDEX idx_categorie_supplier_invoice_fk_categorie (fk_categorie);
|
||||
ALTER TABLE llx_categorie_supplier_invoice ADD INDEX idx_categorie_supplier_invoice_fk_supplier_invoice (fk_supplier_invoice);
|
||||
|
||||
ALTER TABLE llx_categorie_supplier_invoice ADD CONSTRAINT fk_categorie_supplier_invoice_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
|
||||
ALTER TABLE llx_categorie_supplier_invoice ADD CONSTRAINT fk_categorie_supplier_invoice_fk_supplier_invoice_rowid FOREIGN KEY (fk_supplier_invoice) REFERENCES llx_facture_fourn (rowid);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
-- ============================================================================
|
||||
-- Copyright (C) 2005 Brice Davoleau <e1davole@iu-vannes.fr>
|
||||
-- Copyright (C) 2005-2010 Matthieu Valleton <mv@seeschloss.org>
|
||||
-- Copyright (C) 2005-2010 Matthieu Valleton <mv@seeschloss.org>
|
||||
--
|
||||
-- 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
|
||||
|
|
@ -20,5 +20,6 @@
|
|||
create table llx_categorie_member
|
||||
(
|
||||
fk_categorie integer NOT NULL,
|
||||
fk_member integer NOT NULL
|
||||
fk_member integer NOT NULL,
|
||||
import_key varchar(14)
|
||||
)ENGINE=innodb;
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
-- ===================================================================
|
||||
-- Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
-- Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ===================================================================
|
||||
|
||||
-- TODO : Remove this file, content of this table has been moved into llx_categories table
|
||||
|
||||
create table llx_category_bank
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
label varchar(255),
|
||||
entity integer DEFAULT 1 NOT NULL -- multi company id
|
||||
)ENGINE=innodb;
|
||||
|
|
@ -20,5 +20,6 @@
|
|||
create table llx_category_bankline
|
||||
(
|
||||
lineid integer NOT NULL,
|
||||
fk_categ integer NOT NULL
|
||||
fk_categ integer NOT NULL,
|
||||
import_key varchar(14)
|
||||
)ENGINE=innodb;
|
||||
|
|
|
|||
|
|
@ -546,7 +546,7 @@ if (!empty($moreforfilter)) {
|
|||
}
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, (string) $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup
|
||||
$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, (string) $conf->main_checkbox_left_column ? 'left' : ''); // This also change content of $arrayfields with user setup
|
||||
$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
|
||||
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||
|
||||
|
|
|
|||
|
|
@ -2137,6 +2137,7 @@ MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF
|
|||
MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF
|
||||
DOC_SHOW_FIRST_SALES_REP=Show first sales representative
|
||||
MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add column for picture on proposal lines
|
||||
MAIN_GENERATE_DOCUMENTS_WITH_PICTURE=Add column for picture on document lines
|
||||
MAIN_DOCUMENTS_WITH_PICTURE_WIDTH=Width of the column if a picture is added on lines
|
||||
MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE=Hide the unit price column on quotation requests
|
||||
MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN=Hide the total price column on quotation requests
|
||||
|
|
@ -2507,7 +2508,7 @@ UrlPublicInterfaceLabelAdmin=Alternative URL for public interface
|
|||
UrlPublicInterfaceHelpAdmin=It is possible to define an alias to the web server and thus make available the public interface with another URL (the virtual host server must act as a proxy on the standard URL)
|
||||
ExportUseForce=Use the parameter -f
|
||||
ExportUseForceHelp=Force to continue the export even when an error is found (Backup may not be reliable)
|
||||
CustomPrompt=Custom prompts
|
||||
CustomPrompt=Custom prompts and models
|
||||
AiDescription=AI (Artificial Intelligence) features
|
||||
AiDescriptionLong=Provides AI (Artificial Intelligence) features in different parts of the application. Need external AI API.
|
||||
AI_API_KEY=Key for AI api
|
||||
|
|
@ -2611,3 +2612,7 @@ UploadExtensionRestriction=List of forbidden file extensions to upload
|
|||
UploadExtensionRestrictionExemple=htm, html, shtml, js, php
|
||||
Privileges=Privileges
|
||||
FieldsLinked=Fields Linked
|
||||
PDF_XXX_SHOW_PRICE_INCL_TAX=Show column Price including tax
|
||||
AvailableWithSomePDFTemplatesOnly=Feature not supported on old PDF templates
|
||||
SelectAService=Select the kind of service to use
|
||||
SelectFeatureToTest=Select the feature to test
|
||||
|
|
|
|||
|
|
@ -1351,3 +1351,4 @@ AllTime=From start
|
|||
Transferred=Transferred
|
||||
Anonymous=Anonymous
|
||||
Automatic=Automatic
|
||||
Nobody=Nobody
|
||||
|
|
|
|||
|
|
@ -85,3 +85,15 @@ DocIconsTitle = Icons used by Dolibarr
|
|||
DocIconsList = List of usable icons with img_picto function
|
||||
DocIconsMainDescription = Dolibarr use a part of fontawesome 5 icons
|
||||
DocIconsFontAwesomeList = List of usable fontawesome icons
|
||||
|
||||
#Input
|
||||
DocClassicInputsDescription = Classic input to enter string values, integer values...
|
||||
DocCheckboxInputsDescription = Checkbox input to enter boolean values
|
||||
DocRadioInputsDescription = Radio input to enter boolean values
|
||||
DocHelperFunctionsInputUsage = Helper functions usage
|
||||
DocSelectInputsDescription = Select input to enter one value
|
||||
DocMultiSelectInputsDescription = Multiselect input to enter several values
|
||||
DocEditorInputsDescription = Editor input to enter text with HTML
|
||||
DocDateSelectInputsDescription = Date input to enter a date with or without hours
|
||||
DocInputsMainDescription = Documentation and exemples for inputs
|
||||
DocInputsTitle = Inputs
|
||||
|
|
|
|||
|
|
@ -372,6 +372,7 @@ ContentSecurityPolicy=Content Security Policy
|
|||
WebsiteSecurityForceRP=Website Security RP
|
||||
WebsiteSecurityForceSTS=Website Security STS
|
||||
WebsiteSecurityForcePP=Website Security PP
|
||||
WebsiteSecurityForceCSPRO=Content Security Policy Report-Only
|
||||
SecurityPolicySucesfullyRemoved=Content Security Policy successfully removed
|
||||
ErrorRemovingSecurityPolicy=An error occurred when trying to remove a Content Security Policy
|
||||
SecurityPolicySucesfullyAdded=Content Security Policy successfully added
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user