mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge branch 'develop' into fix_updatelines_propal
This commit is contained in:
commit
8a4ced4419
|
|
@ -228,12 +228,6 @@ parameters:
|
|||
count: 4
|
||||
path: ../../htdocs/accountancy/bookkeeping/export.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always true\.$#'
|
||||
identifier: booleanNot.alwaysTrue
|
||||
count: 1
|
||||
path: ../../htdocs/accountancy/bookkeeping/list.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#'
|
||||
identifier: empty.variable
|
||||
|
|
@ -252,12 +246,6 @@ parameters:
|
|||
count: 3
|
||||
path: ../../htdocs/accountancy/bookkeeping/list.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always true\.$#'
|
||||
identifier: booleanNot.alwaysTrue
|
||||
count: 1
|
||||
path: ../../htdocs/accountancy/bookkeeping/listbyaccount.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#'
|
||||
identifier: empty.variable
|
||||
|
|
@ -312,12 +300,6 @@ parameters:
|
|||
count: 4
|
||||
path: ../../htdocs/accountancy/class/accountancycategory.class.php
|
||||
|
||||
-
|
||||
message: '#^Property AccountancyCategory\:\:\$sdcpermonth type has no value type specified in iterable type array\.$#'
|
||||
identifier: missingType.iterableValue
|
||||
count: 1
|
||||
path: ../../htdocs/accountancy/class/accountancycategory.class.php
|
||||
|
||||
-
|
||||
message: '#^Property AccountancyCategory\:\:\$sens \(int\) in isset\(\) is not nullable\.$#'
|
||||
identifier: isset.property
|
||||
|
|
@ -1488,18 +1470,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../htdocs/admin/mails.php
|
||||
|
||||
-
|
||||
message: '#^Right side of && is always true\.$#'
|
||||
identifier: booleanAnd.rightAlwaysTrue
|
||||
count: 3
|
||||
path: ../../htdocs/admin/mails.php
|
||||
|
||||
-
|
||||
message: '#^Ternary operator condition is always false\.$#'
|
||||
identifier: ternary.alwaysFalse
|
||||
count: 3
|
||||
path: ../../htdocs/admin/mails.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$text in empty\(\) always exists and is not falsy\.$#'
|
||||
identifier: empty.variable
|
||||
|
|
@ -4590,12 +4560,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../htdocs/comm/propal/class/propal.class.php
|
||||
|
||||
-
|
||||
message: '#^Property CommonObject\:\:\$model_pdf \(string\) in isset\(\) is not nullable\.$#'
|
||||
identifier: isset.property
|
||||
count: 2
|
||||
path: ../../htdocs/comm/propal/class/propal.class.php
|
||||
|
||||
-
|
||||
message: '#^Property CommonObject\:\:\$ref \(string\) in isset\(\) is not nullable\.$#'
|
||||
identifier: isset.property
|
||||
|
|
@ -4992,12 +4956,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../htdocs/commande/class/commande.class.php
|
||||
|
||||
-
|
||||
message: '#^Property CommonObject\:\:\$model_pdf \(string\) in isset\(\) is not nullable\.$#'
|
||||
identifier: isset.property
|
||||
count: 2
|
||||
path: ../../htdocs/commande/class/commande.class.php
|
||||
|
||||
-
|
||||
message: '#^Property CommonObject\:\:\$ref \(string\) in isset\(\) is not nullable\.$#'
|
||||
identifier: isset.property
|
||||
|
|
@ -6192,12 +6150,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../htdocs/compta/facture/class/facture.class.php
|
||||
|
||||
-
|
||||
message: '#^Property CommonObject\:\:\$model_pdf \(string\) in isset\(\) is not nullable\.$#'
|
||||
identifier: isset.property
|
||||
count: 3
|
||||
path: ../../htdocs/compta/facture/class/facture.class.php
|
||||
|
||||
-
|
||||
message: '#^Property CommonObject\:\:\$ref \(string\) in isset\(\) is not nullable\.$#'
|
||||
identifier: isset.property
|
||||
|
|
@ -17382,24 +17334,6 @@ parameters:
|
|||
count: 2
|
||||
path: ../../htdocs/core/tpl/list_print_total.tpl.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$action might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 5
|
||||
path: ../../htdocs/core/tpl/object_currency_amount.tpl.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$object might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 3
|
||||
path: ../../htdocs/core/tpl/object_currency_amount.tpl.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$usercancreate might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 4
|
||||
path: ../../htdocs/core/tpl/object_currency_amount.tpl.php
|
||||
|
||||
-
|
||||
message: '#^Left side of && is always true\.$#'
|
||||
identifier: booleanAnd.leftAlwaysTrue
|
||||
|
|
@ -19404,12 +19338,6 @@ parameters:
|
|||
count: 2
|
||||
path: ../../htdocs/expedition/class/expedition.class.php
|
||||
|
||||
-
|
||||
message: '#^Property Expedition\:\:\$model_pdf \(string\) in isset\(\) is not nullable\.$#'
|
||||
identifier: isset.property
|
||||
count: 2
|
||||
path: ../../htdocs/expedition/class/expedition.class.php
|
||||
|
||||
-
|
||||
message: '#^Property Expedition\:\:\$ref_customer \(string\) in isset\(\) is not nullable\.$#'
|
||||
identifier: isset.property
|
||||
|
|
@ -20778,12 +20706,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../htdocs/fourn/class/fournisseur.commande.class.php
|
||||
|
||||
-
|
||||
message: '#^Property CommonObject\:\:\$model_pdf \(string\) in isset\(\) is not nullable\.$#'
|
||||
identifier: isset.property
|
||||
count: 2
|
||||
path: ../../htdocs/fourn/class/fournisseur.commande.class.php
|
||||
|
||||
-
|
||||
message: '#^Property CommonObject\:\:\$ref_ext \(string\) in isset\(\) is not nullable\.$#'
|
||||
identifier: isset.property
|
||||
|
|
@ -21018,12 +20940,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../htdocs/fourn/class/fournisseur.facture.class.php
|
||||
|
||||
-
|
||||
message: '#^Property CommonObject\:\:\$model_pdf \(string\) in isset\(\) is not nullable\.$#'
|
||||
identifier: isset.property
|
||||
count: 2
|
||||
path: ../../htdocs/fourn/class/fournisseur.facture.class.php
|
||||
|
||||
-
|
||||
message: '#^Property CommonObject\:\:\$ref_ext \(string\) in isset\(\) is not nullable\.$#'
|
||||
identifier: isset.property
|
||||
|
|
@ -25026,18 +24942,6 @@ parameters:
|
|||
count: 2
|
||||
path: ../../htdocs/modulebuilder/template/myobject_agenda.php
|
||||
|
||||
-
|
||||
message: '#^If condition is always false\.$#'
|
||||
identifier: if.alwaysFalse
|
||||
count: 1
|
||||
path: ../../htdocs/modulebuilder/template/myobject_agenda.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always false\.$#'
|
||||
identifier: booleanNot.alwaysFalse
|
||||
count: 1
|
||||
path: ../../htdocs/modulebuilder/template/myobject_agenda.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always true\.$#'
|
||||
identifier: booleanNot.alwaysTrue
|
||||
|
|
@ -25059,19 +24963,7 @@ parameters:
|
|||
-
|
||||
message: '#^If condition is always false\.$#'
|
||||
identifier: if.alwaysFalse
|
||||
count: 3
|
||||
path: ../../htdocs/modulebuilder/template/myobject_card.php
|
||||
|
||||
-
|
||||
message: '#^If condition is always true\.$#'
|
||||
identifier: if.alwaysTrue
|
||||
count: 1
|
||||
path: ../../htdocs/modulebuilder/template/myobject_card.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always false\.$#'
|
||||
identifier: booleanNot.alwaysFalse
|
||||
count: 1
|
||||
count: 2
|
||||
path: ../../htdocs/modulebuilder/template/myobject_card.php
|
||||
|
||||
-
|
||||
|
|
@ -25104,30 +24996,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../htdocs/modulebuilder/template/myobject_card.php
|
||||
|
||||
-
|
||||
message: '#^Right side of && is always true\.$#'
|
||||
identifier: booleanAnd.rightAlwaysTrue
|
||||
count: 5
|
||||
path: ../../htdocs/modulebuilder/template/myobject_card.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$permissiontoadd in empty\(\) always exists and is not falsy\.$#'
|
||||
identifier: empty.variable
|
||||
count: 1
|
||||
path: ../../htdocs/modulebuilder/template/myobject_card.php
|
||||
|
||||
-
|
||||
message: '#^If condition is always false\.$#'
|
||||
identifier: if.alwaysFalse
|
||||
count: 1
|
||||
path: ../../htdocs/modulebuilder/template/myobject_contact.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always false\.$#'
|
||||
identifier: booleanNot.alwaysFalse
|
||||
count: 1
|
||||
path: ../../htdocs/modulebuilder/template/myobject_contact.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always true\.$#'
|
||||
identifier: booleanNot.alwaysTrue
|
||||
|
|
@ -25146,24 +25014,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../htdocs/modulebuilder/template/myobject_contact.php
|
||||
|
||||
-
|
||||
message: '#^Right side of && is always true\.$#'
|
||||
identifier: booleanAnd.rightAlwaysTrue
|
||||
count: 2
|
||||
path: ../../htdocs/modulebuilder/template/myobject_contact.php
|
||||
|
||||
-
|
||||
message: '#^If condition is always false\.$#'
|
||||
identifier: if.alwaysFalse
|
||||
count: 1
|
||||
path: ../../htdocs/modulebuilder/template/myobject_document.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always false\.$#'
|
||||
identifier: booleanNot.alwaysFalse
|
||||
count: 1
|
||||
path: ../../htdocs/modulebuilder/template/myobject_document.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always true\.$#'
|
||||
identifier: booleanNot.alwaysTrue
|
||||
|
|
@ -25194,18 +25044,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../htdocs/modulebuilder/template/myobject_list.php
|
||||
|
||||
-
|
||||
message: '#^If condition is always false\.$#'
|
||||
identifier: if.alwaysFalse
|
||||
count: 1
|
||||
path: ../../htdocs/modulebuilder/template/myobject_list.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always false\.$#'
|
||||
identifier: booleanNot.alwaysFalse
|
||||
count: 1
|
||||
path: ../../htdocs/modulebuilder/template/myobject_list.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always true\.$#'
|
||||
identifier: booleanNot.alwaysTrue
|
||||
|
|
@ -25224,24 +25062,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../htdocs/modulebuilder/template/myobject_list.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$permissiontodelete in empty\(\) always exists and is not falsy\.$#'
|
||||
identifier: empty.variable
|
||||
count: 1
|
||||
path: ../../htdocs/modulebuilder/template/myobject_list.php
|
||||
|
||||
-
|
||||
message: '#^If condition is always false\.$#'
|
||||
identifier: if.alwaysFalse
|
||||
count: 1
|
||||
path: ../../htdocs/modulebuilder/template/myobject_note.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always false\.$#'
|
||||
identifier: booleanNot.alwaysFalse
|
||||
count: 1
|
||||
path: ../../htdocs/modulebuilder/template/myobject_note.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always true\.$#'
|
||||
identifier: booleanNot.alwaysTrue
|
||||
|
|
@ -27870,12 +27690,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../htdocs/product/stock/movement_list.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$whClass might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 1
|
||||
path: ../../htdocs/product/stock/movement_list.php
|
||||
|
||||
-
|
||||
message: '#^If condition is always false\.$#'
|
||||
identifier: if.alwaysFalse
|
||||
|
|
@ -28896,12 +28710,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../htdocs/projet/list.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always true\.$#'
|
||||
identifier: booleanNot.alwaysTrue
|
||||
count: 1
|
||||
path: ../../htdocs/projet/list.php
|
||||
|
||||
-
|
||||
message: '#^Ternary operator condition is always false\.$#'
|
||||
identifier: ternary.alwaysFalse
|
||||
|
|
@ -30792,12 +30600,6 @@ parameters:
|
|||
count: 2
|
||||
path: ../../htdocs/reception/class/reception.class.php
|
||||
|
||||
-
|
||||
message: '#^Property Reception\:\:\$model_pdf \(string\) in isset\(\) is not nullable\.$#'
|
||||
identifier: isset.property
|
||||
count: 2
|
||||
path: ../../htdocs/reception/class/reception.class.php
|
||||
|
||||
-
|
||||
message: '#^Property Reception\:\:\$ref_supplier \(string\) in isset\(\) is not nullable\.$#'
|
||||
identifier: isset.property
|
||||
|
|
@ -32052,12 +31854,6 @@ parameters:
|
|||
count: 2
|
||||
path: ../../htdocs/salaries/payments.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always true\.$#'
|
||||
identifier: booleanNot.alwaysTrue
|
||||
count: 1
|
||||
path: ../../htdocs/salaries/payments.php
|
||||
|
||||
-
|
||||
message: '#^Ternary operator condition is always false\.$#'
|
||||
identifier: ternary.alwaysFalse
|
||||
|
|
@ -32472,12 +32268,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../htdocs/societe/class/companybankaccount.class.php
|
||||
|
||||
-
|
||||
message: '#^Property CompanyBankAccount\:\:\$model_pdf \(string\) in isset\(\) is not nullable\.$#'
|
||||
identifier: isset.property
|
||||
count: 2
|
||||
path: ../../htdocs/societe/class/companybankaccount.class.php
|
||||
|
||||
-
|
||||
message: '#^Call to function method_exists\(\) with \$this\(Societe\) and ''getLibStatut'' will always evaluate to true\.$#'
|
||||
identifier: function.alreadyNarrowedType
|
||||
|
|
@ -32694,24 +32484,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../htdocs/societe/paymentmodes.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#4 \$month of function dol_mktime expects int, array\<mixed\>\|string given\.$#'
|
||||
identifier: argument.type
|
||||
count: 3
|
||||
path: ../../htdocs/societe/paymentmodes.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#5 \$day of function dol_mktime expects int, array\<mixed\>\|string given\.$#'
|
||||
identifier: argument.type
|
||||
count: 3
|
||||
path: ../../htdocs/societe/paymentmodes.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#6 \$year of function dol_mktime expects int, array\<mixed\>\|string given\.$#'
|
||||
identifier: argument.type
|
||||
count: 3
|
||||
path: ../../htdocs/societe/paymentmodes.php
|
||||
|
||||
-
|
||||
message: '#^Ternary operator condition is always true\.$#'
|
||||
identifier: ternary.alwaysTrue
|
||||
|
|
@ -32754,12 +32526,6 @@ parameters:
|
|||
count: 2
|
||||
path: ../../htdocs/societe/price.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$extrafields might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 14
|
||||
path: ../../htdocs/societe/price.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$prodcustprice might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
|
|
@ -33900,18 +33666,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../htdocs/ticket/class/ticket.class.php
|
||||
|
||||
-
|
||||
message: '#^Property CommonObject\:\:\$entity \(int\) in isset\(\) is not nullable\.$#'
|
||||
identifier: isset.property
|
||||
count: 1
|
||||
path: ../../htdocs/ticket/class/ticket.class.php
|
||||
|
||||
-
|
||||
message: '#^Property CommonObject\:\:\$model_pdf \(string\) in isset\(\) is not nullable\.$#'
|
||||
identifier: isset.property
|
||||
count: 2
|
||||
path: ../../htdocs/ticket/class/ticket.class.php
|
||||
|
||||
-
|
||||
message: '#^Property CommonObject\:\:\$ref \(string\) in isset\(\) is not nullable\.$#'
|
||||
identifier: isset.property
|
||||
|
|
@ -34122,18 +33876,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../htdocs/ticket/index.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always true\.$#'
|
||||
identifier: booleanNot.alwaysTrue
|
||||
count: 3
|
||||
path: ../../htdocs/ticket/list.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#'
|
||||
identifier: empty.variable
|
||||
count: 1
|
||||
path: ../../htdocs/ticket/list.php
|
||||
|
||||
-
|
||||
message: '#^If condition is always false\.$#'
|
||||
identifier: if.alwaysFalse
|
||||
|
|
@ -34482,12 +34224,6 @@ parameters:
|
|||
count: 2
|
||||
path: ../../htdocs/user/home.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always true\.$#'
|
||||
identifier: booleanNot.alwaysTrue
|
||||
count: 2
|
||||
path: ../../htdocs/user/list.php
|
||||
|
||||
-
|
||||
message: '#^Offset ''u\.salary'' on array\{u\.salary\: \(float\|int\)\} in isset\(\) always exists and is not nullable\.$#'
|
||||
identifier: isset.offset
|
||||
|
|
@ -34692,48 +34428,6 @@ parameters:
|
|||
count: 2
|
||||
path: ../../htdocs/variants/list.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access property \$lines on mixed\.$#'
|
||||
identifier: property.nonObject
|
||||
count: 1
|
||||
path: ../../htdocs/variants/tpl/productattributevalueline_create.tpl.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$action might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 1
|
||||
path: ../../htdocs/variants/tpl/productattributevalueline_create.tpl.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$hookmanager might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 1
|
||||
path: ../../htdocs/variants/tpl/productattributevalueline_create.tpl.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$langs might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 2
|
||||
path: ../../htdocs/variants/tpl/productattributevalueline_create.tpl.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$this might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 1
|
||||
path: ../../htdocs/variants/tpl/productattributevalueline_create.tpl.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$action might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 1
|
||||
path: ../../htdocs/variants/tpl/productattributevalueline_title.tpl.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$langs might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 2
|
||||
path: ../../htdocs/variants/tpl/productattributevalueline_title.tpl.php
|
||||
|
||||
-
|
||||
message: '#^Call to function is_numeric\(\) with int will always evaluate to true\.$#'
|
||||
identifier: function.alreadyNarrowedType
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ Init demo
|
|||
|
||||
The script `initdemo.sh` will erase the current database with data from `dev/initdemo/mysqldump_dolibarr_x.y.z.sql` and copy files from `documents_demo` to the official document directory.
|
||||
|
||||
You many to execute `chmod 700 initdemo.sh`
|
||||
You may need to execute `chmod 700 initdemo.sh`
|
||||
then run `./initdemo.sh` to launch the Graphical User Interface.
|
||||
|
||||
After loading the demo files, the admin login may be one of the following:
|
||||
|
|
|
|||
|
|
@ -51,6 +51,13 @@ then
|
|||
fi
|
||||
|
||||
|
||||
# ----------------------------- check if dialog available
|
||||
command -v dialog >/dev/null 2>&1 || {
|
||||
echo "Error: command dialog not found. On Linux, you can install it with: apt install dialog"
|
||||
exit
|
||||
}
|
||||
|
||||
|
||||
# ----------------------------- if no params on command line
|
||||
if [ "$passwd" = "" ]
|
||||
then
|
||||
|
|
@ -179,17 +186,19 @@ fi
|
|||
if [ "$passwd" != "" ]
|
||||
then
|
||||
export passwd="-p$passwd"
|
||||
export passwdshown="-p*****"
|
||||
fi
|
||||
#echo "mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile"
|
||||
#mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile
|
||||
#echo "drop old table"
|
||||
echo "drop table"
|
||||
echo "drop table if exists llx_accounting_account;" | mysql "-P$port" "-u$admin" "$passwd" "$base"
|
||||
echo "mysql -P$port -u$admin -p***** $base < '$mydir/$dumpfile'"
|
||||
echo "mysql -P$port -u$admin $passwdshown $base < '$mydir/$dumpfile'"
|
||||
mysql "-P$port" "-u$admin" "$passwd" "$base" < "$mydir/$dumpfile"
|
||||
export res=$?
|
||||
|
||||
if [ $res -ne 0 ]; then
|
||||
echo "Error to load database dump with mysql -P$port -u$admin -p***** $base < '$mydir/$dumpfile'"
|
||||
echo "Error to load database dump with: mysql -P$port -u$admin $passwdshown $base < '$mydir/$dumpfile'"
|
||||
exit
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@ the project: `pre-commit-config.yaml`.
|
|||
If you do not have python installed, install [python](https://www.python.org) first.\
|
||||
`sudo apt install python3`
|
||||
|
||||
If you do not have [`pip`](https://pypi.org/project/pip), install that as well.\\
|
||||
`sudo apt install pip`
|
||||
If you do not have [`pip`](https://pypi.org/project/pip), install that as well.\
|
||||
`sudo apt install pip`
|
||||
|
||||
Then you can install pre-commit tool:
|
||||
Then you can install pre-commit tool:\
|
||||
`python3 -m pip install pre-commit`
|
||||
|
||||
2. In your local git clone of the project, run `pre-commit install` to add the hooks
|
||||
|
|
@ -96,4 +96,6 @@ CI also runs pre-commit to help maintain code quality.
|
|||
|
||||
Note:
|
||||
Code for precommits are saved into:
|
||||
.cache/pre-commit/repo*/py_env-python3/lib/python*/site-packages/pre_commit_hooks/no_commit_to_branch.py
|
||||
.cache/pre-commit/repo.../pre_commit_hooks/php-....sh
|
||||
and
|
||||
.cache/pre-commit/repo.../py_env-python3/lib/python.../site-packages/pre_commit_hooks/no_commit_to_branch.py
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ $phpstanversion = $output_arrtd[0];
|
|||
|
||||
$output_arrtd = array();
|
||||
if ($dirphpstan != 'disabled') {
|
||||
$commandcheck = ($dirphpstan ? $dirphpstan.'/' : '').'phpstan --level='.$PHPSTANLEVEL.' -v analyze -a build/phpstan/bootstrap.php --memory-limit 8G --error-format=github -c ~/preview.dolibarr.org/dolibarr/phpstan.v1.neon';
|
||||
$commandcheck = ($dirphpstan ? $dirphpstan.'/' : '').'phpstan --level='.$PHPSTANLEVEL.' -v analyze -a build/phpstan/bootstrap.php --memory-limit 8G --error-format=github -c ~/preview.dolibarr.org/dolibarr/dev/tools/phpstan/phpstan_v1_apstats.neon';
|
||||
print 'Execute PHPStan to get the technical debt: '.$commandcheck."\n";
|
||||
$resexectd = 0;
|
||||
exec($commandcheck, $output_arrtd, $resexectd);
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ parameters:
|
|||
treatPhpDocTypesAsCertain: false
|
||||
ignoreErrors:
|
||||
- '#.*phan-var#'
|
||||
- '#is always#'
|
||||
internalErrorsCountLimit: 50
|
||||
cache:
|
||||
nodesByFileCountMax: 512
|
||||
|
|
@ -580,7 +580,6 @@ NewProperty
|
|||
NoActiveEstablishmentDefined
|
||||
NoAddMember
|
||||
NoAuthorityURLDefined
|
||||
NoBankAccountFound
|
||||
NoCurrencyRateSelected
|
||||
NoEntriesToShow
|
||||
NoEstablishmentFound
|
||||
|
|
|
|||
|
|
@ -495,6 +495,8 @@ if (empty($reshook)) {
|
|||
$permissiontodelete = $user->hasRight('societe', 'supprimer');
|
||||
$permissiontoadd = $user->hasRight('societe', 'creer');
|
||||
$uploaddir = $conf->societe->dir_output;
|
||||
|
||||
global $error;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
if (!$error && $action == 'deletebookkeepingwriting' && $confirm == "yes" && $user->hasRight('accounting', 'mouvements', 'supprimer')) {
|
||||
|
|
|
|||
|
|
@ -459,6 +459,8 @@ if (empty($reshook)) {
|
|||
$permissiontodelete = $user->hasRight('societe', 'supprimer');
|
||||
$permissiontoadd = $user->hasRight('societe', 'creer');
|
||||
$uploaddir = $conf->societe->dir_output;
|
||||
|
||||
global $error;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
if (!$error && $action == 'deletebookkeepingwriting' && $confirm == "yes" && $user->hasRight('accounting', 'mouvements', 'supprimer')) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
|
||||
* Copyright (C) 2016-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 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
|
||||
|
|
@ -129,7 +129,7 @@ class AccountancyCategory // extends CommonObject
|
|||
public $sdc;
|
||||
|
||||
/**
|
||||
* @var array Sum debit credit per month
|
||||
* @var array<string,float> Sum debit credit per month
|
||||
*/
|
||||
public $sdcpermonth;
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonpeople.class.php';
|
|||
|
||||
|
||||
/**
|
||||
* Class to manage members of a foundation
|
||||
* Class to manage members of a foundation.
|
||||
*/
|
||||
class Adherent extends CommonObject
|
||||
{
|
||||
|
|
@ -829,7 +829,8 @@ class Adherent extends CommonObject
|
|||
$sql .= ", fk_user_mod = ".($user->id > 0 ? $user->id : 'null'); // Can be null because member can be create by a guest
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
// If we change the type of membership, we set also label of new type
|
||||
// If we change the type of membership, we set also label of new type..
|
||||
'@phan-var-force Adherent $oldcopy';
|
||||
if (!empty($this->oldcopy) && $this->typeid != $this->oldcopy->typeid) {
|
||||
$sql2 = "SELECT libelle as label";
|
||||
$sql2 .= " FROM ".MAIN_DB_PREFIX."adherent_type";
|
||||
|
|
@ -3104,11 +3105,14 @@ class Adherent extends CommonObject
|
|||
$nbko++;
|
||||
$listofmembersko[$adherent->id] = $adherent->id;
|
||||
} else {
|
||||
$adherent->fetch_thirdparty();
|
||||
|
||||
// Language code to use ($languagecodeformember) is default language of thirdparty, if no thirdparty, the language found from country of member then country of thirdparty, and if still not found we use the language of company.
|
||||
$languagefromcountrycode = getLanguageCodeFromCountryCode($adherent->country_code ? $adherent->country_code : $adherent->thirdparty->country_code);
|
||||
$languagecodeformember = (empty($adherent->thirdparty->default_lang) ? ($languagefromcountrycode ? $languagefromcountrycode : $mysoc->default_lang) : $adherent->thirdparty->default_lang);
|
||||
$thirdpartyres = $adherent->fetch_thirdparty();
|
||||
if ($thirdpartyres === -1 ) {
|
||||
$languagecodeformember = $mysoc->default_lang;
|
||||
} else {
|
||||
// Language code to use ($languagecodeformember) is default language of thirdparty, if no thirdparty, the language found from country of member then country of thirdparty, and if still not found we use the language of company.
|
||||
$languagefromcountrycode = getLanguageCodeFromCountryCode($adherent->country_code ? $adherent->country_code : $adherent->thirdparty->country_code);
|
||||
$languagecodeformember = (empty($adherent->thirdparty->default_lang) ? ($languagefromcountrycode ? $languagefromcountrycode : $mysoc->default_lang) : $adherent->thirdparty->default_lang);
|
||||
}
|
||||
|
||||
// Send reminder email
|
||||
$outputlangs = new Translate('', $conf);
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ if (!$user->admin) {
|
|||
|
||||
$usersignature = $user->signature;
|
||||
// For action = test or send, we ensure that content is not html, even for signature, because for this we want a test with NO html.
|
||||
if ($action == 'test' || ($action == 'send' && $trackid = 'test')) {
|
||||
if ($action == 'test' || ($action == 'send' && $trackid == 'test')) {
|
||||
$usersignature = dol_string_nohtmltag($usersignature, 2);
|
||||
}
|
||||
|
||||
|
|
@ -1003,7 +1003,7 @@ if ($action == 'edit') {
|
|||
|
||||
if (!getDolGlobalString('MAIN_DISABLE_ALL_MAILS')) {
|
||||
if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') != 'mail' || !$linuxlike) {
|
||||
if (function_exists('fsockopen') && $port && $server) {
|
||||
if (function_exists('fsockopen') /* && $port && $server */) { // $port and $server can't be empty
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect&token='.newToken().'&date='.dol_now().'#formmailaftertstconnect">'.$langs->trans("DoTestServerAvailability").'</a>';
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1044,19 +1044,19 @@ if ($action == 'edit') {
|
|||
// mthode php mail
|
||||
if (getDolGlobalString('MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD')) { // Not defined by default. Depend on platform.
|
||||
// List of string to add in SPF if the setup use the mail method. Example 'include:sendgrid.net include:spf.mydomain.com'
|
||||
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMailSPFDMARC");
|
||||
$text .= /* ($text ? '<br><br>' : ''). */$langs->trans("WarningPHPMailSPFDMARC");
|
||||
} else {
|
||||
// MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS is list of IPs where email is sent from. Example: '1.2.3.4, [aaaa:bbbb:cccc:dddd]'.
|
||||
if (getDolGlobalString('MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS')) {
|
||||
// List of IP shown as record to add in SPF if we use the mail method
|
||||
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMailSPFDMARC");
|
||||
$text .= /* ($text ? '<br><br>' : ''). */$langs->trans("WarningPHPMailSPFDMARC");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// method smtps or swiftmail
|
||||
if (getDolGlobalString('MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD')) { // Should be required only if you have preset the Dolibarr to use your own SMTP and you want to warn users to update their domain name to match your SMTP server.
|
||||
// List of string to add in SPF if we use the smtp method. Example 'include:spf.mydomain.com'
|
||||
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMailSPF", getDolGlobalString('MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD'));
|
||||
$text .= /* ($text ? '<br><br>' : ''). */$langs->trans("WarningPHPMailSPF", getDolGlobalString('MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD'));
|
||||
}
|
||||
if (getDolGlobalString('MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS')) { // Not defined by default. Depend on platform.
|
||||
// List of IP shown as record to add as allowed IP if we use the smtp method. Value is '1.2.3.4, [aaaa:bbbb:cccc:dddd]'
|
||||
|
|
|
|||
|
|
@ -231,12 +231,6 @@ class Asset extends CommonObject
|
|||
*/
|
||||
public $status;
|
||||
|
||||
/**
|
||||
* @var static object oldcopy
|
||||
*/
|
||||
public $oldcopy;
|
||||
|
||||
|
||||
/**
|
||||
* @var AssetDepreciationOptions Used for computed fields of depreciation options class.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ $title = $langs->trans("Agenda");
|
|||
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist');
|
||||
|
||||
// Define list of all external calendars
|
||||
$listofextcals = array();
|
||||
// $listofextcals = array(); Not used yet in lists
|
||||
|
||||
$param = '';
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
|
|
@ -494,7 +494,7 @@ if (!empty($actioncode)) {
|
|||
} else {
|
||||
if (is_array($actioncode)) {
|
||||
$sql .= " AND c.code IN (".$db->sanitize("'".implode("','", $actioncode)."'", 1).")";
|
||||
} else {
|
||||
} elseif ($actioncode !== '-1') {
|
||||
$sql .= " AND c.code IN (".$db->sanitize("'".implode("','", explode(',', $actioncode))."'", 1).")";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,11 +122,6 @@ class Propal extends CommonObject
|
|||
*/
|
||||
public $ref_customer;
|
||||
|
||||
/**
|
||||
* @var static oldcopy with propal properties
|
||||
*/
|
||||
public $oldcopy;
|
||||
|
||||
/**
|
||||
* Status of the quote
|
||||
* @var int
|
||||
|
|
|
|||
|
|
@ -947,6 +947,7 @@ class Commande extends CommonOrder
|
|||
$this->fk_multicurrency = 0;
|
||||
$this->multicurrency_tx = 1;
|
||||
}
|
||||
// setEntity will set entity with the right value if empty or change it for the right value if multicompany module is active
|
||||
$this->entity = setEntity($this);
|
||||
|
||||
dol_syslog(get_class($this)."::create user=".$user->id);
|
||||
|
|
|
|||
|
|
@ -4254,15 +4254,6 @@ if ($action == 'create') {
|
|||
* Show object in view mode
|
||||
*/
|
||||
|
||||
$result = $object->fetch($id, $ref);
|
||||
if ($result <= 0) {
|
||||
dol_print_error($db, $object->error, $object->errors);
|
||||
exit();
|
||||
}
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
if ($user->socid > 0 && $user->socid != $object->socid) {
|
||||
accessforbidden('', 0, 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -248,11 +248,6 @@ class Facture extends CommonInvoice
|
|||
*/
|
||||
public $tab_next_situation_invoice = array();
|
||||
|
||||
/**
|
||||
* @var static object oldcopy
|
||||
*/
|
||||
public $oldcopy;
|
||||
|
||||
/**
|
||||
* @var float percentage of retainage
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -786,6 +786,7 @@ if ($object->id > 0) {
|
|||
$title = $langs->trans("NewPaymentByBankTransfer");
|
||||
}
|
||||
|
||||
print '<!-- form to select BAN -->';
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'" />';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'" />';
|
||||
|
|
|
|||
|
|
@ -343,13 +343,6 @@ class Contact extends CommonObject
|
|||
public $ip;
|
||||
// END MODULEBUILDER PROPERTIES
|
||||
|
||||
|
||||
/**
|
||||
* Old copy
|
||||
* @var static
|
||||
*/
|
||||
public $oldcopy; // To contain a clone of this when we need to save old properties of object
|
||||
|
||||
/**
|
||||
* @var array<int,array{id:int,socid:int,element:string,source:string,code:string,label:string}> roles
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ if ($action == 'update' && !GETPOST("cancel") && $user->hasRight('societe', 'con
|
|||
|
||||
$result = $object->update_perso($id, $user);
|
||||
if ($result > 0) {
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppres-current-line PhanTypeMismatchProperty
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
// Logo/Photo save
|
||||
$dir = $conf->societe->dir_output.'/contact/'.get_exdir($object->id, 0, 0, 1, $object, 'contact').'/photos';
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ if ($action == 'addlink' && !empty($permissiondellink) && !$cancellink && $id >
|
|||
foreach ($addlinkids as $addlinkid) {
|
||||
$result = $object->add_object_linked($addlink, $addlinkid);
|
||||
}
|
||||
$object->clearObjectLinkedCache();
|
||||
}
|
||||
|
||||
// Link by reference
|
||||
|
|
@ -69,6 +70,7 @@ if ($action == 'addlinkbyref' && !empty($permissiondellink) && !$cancellink && $
|
|||
if (isset($_POST['reftolinkto'])) {
|
||||
unset($_POST['reftolinkto']);
|
||||
}
|
||||
$object->clearObjectLinkedCache();
|
||||
} elseif ($ret < 0) {
|
||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||
} else {
|
||||
|
|
@ -81,6 +83,7 @@ if ($action == 'addlinkbyref' && !empty($permissiondellink) && !$cancellink && $
|
|||
// Delete link in table llx_element_element
|
||||
if ($action == 'dellink' && !empty($permissiondellink) && !$cancellink && $dellinkid > 0) {
|
||||
$result = $object->deleteObjectLinked(0, '', 0, '', $dellinkid);
|
||||
$object->clearObjectLinkedCache();
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@
|
|||
* @var string $objectclass
|
||||
* @var string $uploaddir
|
||||
* @var string $confirm
|
||||
* @var int $error
|
||||
*/
|
||||
'
|
||||
@phan-var-force ?string $permissiontoread
|
||||
|
|
|
|||
|
|
@ -76,11 +76,6 @@ class Comment extends CommonObject
|
|||
|
||||
public $comments = array();
|
||||
|
||||
/**
|
||||
* @var static Object oldcopy
|
||||
*/
|
||||
public $oldcopy;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
|
|
|||
|
|
@ -546,7 +546,7 @@ abstract class CommonObject
|
|||
public $multicurrency_total_localtax2; // not in database
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @var ?string
|
||||
* @see SetDocModel()
|
||||
*/
|
||||
public $model_pdf;
|
||||
|
|
|
|||
|
|
@ -2630,7 +2630,7 @@ class Form
|
|||
* @param array<string,string|string[]> $ajaxoptions Options for ajax_autocompleter
|
||||
* @param int $socid Thirdparty Id (to get also price dedicated to this customer)
|
||||
* @param string|int<0,1> $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text.
|
||||
* @param int $forcecombo Force to use combo box
|
||||
* @param int $forcecombo Force to use combo box.
|
||||
* @param string $morecss Add more css on select
|
||||
* @param int<0,1> $hidepriceinlabel 1=Hide prices in label
|
||||
* @param string $warehouseStatus Warehouse status filter to count the quantity in stock. Following comma separated filter options can be used
|
||||
|
|
@ -2641,7 +2641,6 @@ class Form
|
|||
* @param int<0,1> $nooutput No print if 1, return the output into a string
|
||||
* @param int<-1,1> $status_purchase Purchase status: -1=No filter on purchase status, 0=Products not on purchase, 1=Products on purchase
|
||||
* @param int $warehouseId Filter by Warehouses Id where there is real stock
|
||||
*
|
||||
* @return void|string
|
||||
*/
|
||||
public function select_produits($selected = 0, $htmlname = 'productid', $filtertype = '', $limit = 0, $price_level = 0, $status = 1, $finished = 2, $selected_input_value = '', $hidelabel = 0, $ajaxoptions = array(), $socid = 0, $showempty = '1', $forcecombo = 0, $morecss = '', $hidepriceinlabel = 0, $warehouseStatus = '', $selected_combinations = null, $nooutput = 0, $status_purchase = -1, $warehouseId = 0)
|
||||
|
|
@ -2666,7 +2665,7 @@ class Form
|
|||
}
|
||||
|
||||
if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) {
|
||||
$placeholder = '';
|
||||
$placeholder = (is_numeric($showempty) ? '' : 'placeholder="'.dolPrintHTML($showempty).'"');
|
||||
|
||||
if ($selected && empty($selected_input_value)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
||||
|
|
@ -2688,6 +2687,7 @@ class Form
|
|||
if ((int) $warehouseId > 0) {
|
||||
$urloption .= '&warehouseid=' . (int) $warehouseId;
|
||||
}
|
||||
|
||||
$out .= ajax_autocompleter((string) $selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), getDolGlobalInt('PRODUCT_SEARCH_AUTO_SELECT_IF_ONLY_ONE', 1), $ajaxoptions);
|
||||
|
||||
if (isModEnabled('variants') && is_array($selected_combinations)) {
|
||||
|
|
@ -2774,6 +2774,7 @@ class Form
|
|||
$out .= img_picto($langs->trans("Search"), 'search');
|
||||
}
|
||||
}
|
||||
|
||||
$out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
|
||||
if ($hidelabel == 3) {
|
||||
$out .= img_picto($langs->trans("Search"), 'search');
|
||||
|
|
@ -2794,16 +2795,16 @@ class Form
|
|||
/**
|
||||
* Return list of BOM for customer in Ajax if Ajax activated or go to select_produits_list
|
||||
*
|
||||
* @param string $selected Preselected BOM id
|
||||
* @param string $htmlname Name of HTML select field (must be unique in page).
|
||||
* @param int $limit Limit on number of returned lines
|
||||
* @param int $status Sell status -1=Return all bom, 0=Draft BOM, 1=Validated BOM
|
||||
* @param int $type type of the BOM (-1=Return all BOM, 0=Return disassemble BOM, 1=Return manufacturing BOM)
|
||||
* @param string|int<0,1> $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text.
|
||||
* @param string $morecss Add more css on select
|
||||
* @param string $nooutput No print, return the output into a string
|
||||
* @param int $forcecombo Force to use combo box
|
||||
* @param string[] $TProducts Add filter on a defined product
|
||||
* @param string $selected Preselected BOM id
|
||||
* @param string $htmlname Name of HTML select field (must be unique in page).
|
||||
* @param int $limit Limit on number of returned lines
|
||||
* @param int $status Sell status -1=Return all bom, 0=Draft BOM, 1=Validated BOM
|
||||
* @param int $type Type of the BOM (-1=Return all BOM, 0=Return disassemble BOM, 1=Return manufacturing BOM)
|
||||
* @param string|int<0,1> $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text.
|
||||
* @param string $morecss Add more css on select
|
||||
* @param string $nooutput No print, return the output into a string
|
||||
* @param int $forcecombo Force to use combo box
|
||||
* @param string[] $TProducts Add filter on a defined product
|
||||
* @return void|string
|
||||
*/
|
||||
public function select_bom($selected = '', $htmlname = 'bom_id', $limit = 0, $status = 1, $type = 0, $showempty = '1', $morecss = '', $nooutput = '', $forcecombo = 0, $TProducts = [])
|
||||
|
|
@ -5138,7 +5139,7 @@ class Form
|
|||
|
||||
$out = '';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->loadLangs(array("admin", "banks"));
|
||||
$num = 0;
|
||||
|
||||
$sql = "SELECT rowid, label, bank, clos as status, currency_code";
|
||||
|
|
@ -5164,7 +5165,7 @@ class Form
|
|||
if ($status == 0) {
|
||||
$out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoActiveBankAccountDefined") . '</span>';
|
||||
} else {
|
||||
$out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoBankAccountFound") . '</span>';
|
||||
$out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoBankAccountDefined") . '</span>';
|
||||
}
|
||||
} else {
|
||||
if (!empty($useempty) && !is_numeric($useempty)) {
|
||||
|
|
@ -5214,7 +5215,7 @@ class Form
|
|||
}
|
||||
|
||||
/**
|
||||
* Return a HTML select list of bank accounts customer
|
||||
* Return a HTML select list of bank accounts customer
|
||||
*
|
||||
* @param int|'' $selected Id account preselected
|
||||
* @param string $htmlname Name of select zone
|
||||
|
|
@ -5233,12 +5234,12 @@ class Form
|
|||
|
||||
$out = '';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->loadLangs(array("admin", "banks"));
|
||||
$num = 0;
|
||||
|
||||
$sql = "SELECT rowid, label, bank, status, iban_prefix, bic";
|
||||
$sql .= " FROM " . $this->db->prefix() . "societe_rib";
|
||||
$sql.= " WHERE 1=1";
|
||||
$sql.= " WHERE type = 'ban'";
|
||||
if ($filtre) { // TODO Support USF
|
||||
$sql .= " AND " . $filtre;
|
||||
}
|
||||
|
|
@ -5252,7 +5253,7 @@ class Form
|
|||
$out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
|
||||
|
||||
if ($num == 0) {
|
||||
$out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoBankAccountFound") . '</span>';
|
||||
$out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoBankAccountDefined") . '</span>';
|
||||
} else {
|
||||
if (!empty($useempty) && !is_numeric($useempty)) {
|
||||
$out .= '<option value="-1">'.$langs->trans($useempty).'</option>';
|
||||
|
|
|
|||
|
|
@ -242,38 +242,34 @@ if ($conf->browser->layout != 'phone') {
|
|||
// Code to manage reposition
|
||||
print "\n/* JS CODE TO ENABLE reposition management (does not work if a redirect is done after action of submission) */\n";
|
||||
print '
|
||||
jQuery(document).ready(function() {
|
||||
/* If page_y set, we set scrollbar with it */
|
||||
page_y=getParameterByName(\'page_y\', 0); /* search in GET parameter */
|
||||
if (page_y == 0) page_y = jQuery("#page_y").text(); /* search in POST parameter that is filed at bottom of page */
|
||||
if (page_y > 0)
|
||||
{
|
||||
console.log("page_y found is "+page_y);
|
||||
$(\'html, body\').scrollTop(page_y);
|
||||
}
|
||||
jQuery(document).ready(function() {
|
||||
/* If page_y set, we set scrollbar with it */
|
||||
page_y = getParameterByName("page_y", 0); /* search in GET parameter */
|
||||
if (page_y == 0) page_y = jQuery("#page_y").text(); /* search in POST parameter that is filed at bottom of page */
|
||||
if (page_y > 0) {
|
||||
console.log("page_y found is "+page_y);
|
||||
jQuery("html, body").scrollTop(page_y);
|
||||
}
|
||||
|
||||
/* Set handler to add page_y param on output (click on href links or submit button) */
|
||||
jQuery(".reposition").click(function() {
|
||||
var page_y = $(document).scrollTop();
|
||||
|
||||
if (page_y > 0)
|
||||
{
|
||||
if (this.href)
|
||||
{
|
||||
console.log("We click on tag with .reposition class. this.ref was "+this.href);
|
||||
var hrefarray = this.href.split("#", 2);
|
||||
hrefarray[0]=hrefarray[0].replace(/&page_y=(\d+)/, \'\'); /* remove page_y param if already present */
|
||||
this.href=hrefarray[0]+\'&page_y=\'+page_y;
|
||||
console.log("We click on tag with .reposition class. this.ref is now "+this.href);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("We click on tag with .reposition class but element is not an <a> html tag, so we try to update input form field with name=page_y with value "+page_y);
|
||||
jQuery("input[type=hidden][name=page_y]").val(page_y);
|
||||
}
|
||||
}
|
||||
});
|
||||
});'."\n";
|
||||
/* Set handler to add page_y param on output (click on href links or submit button) */
|
||||
jQuery(".reposition").click(function(event) {
|
||||
var page_y = jQuery(document).scrollTop();
|
||||
if (page_y > 0) {
|
||||
if (this.href) {
|
||||
console.log("We click on tag with .reposition class. this.ref was "+this.href);
|
||||
var url = new URL(this.href, window.location.origin);
|
||||
url.searchParams.delete("page_y"); /* remove page_y param if already present */
|
||||
url.searchParams.set("page_y", page_y);
|
||||
this.href = url.toString();
|
||||
console.log("We click on tag with .reposition class. this.ref is now "+this.href);
|
||||
} else {
|
||||
console.log("We click on tag with .reposition class but element is not an <a> html tag, so we try to update input form field with name=page_y with value "+page_y);
|
||||
jQuery("input[type=hidden][name=page_y]").val(page_y);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
' . "\n";
|
||||
|
||||
// Code to manage Copy To Clipboard click
|
||||
print "\n/* JS CODE TO ENABLE ClipBoard copy paste */\n";
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2000-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2022 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2024 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 Christophe Combelles <ccomb@free.fr>
|
||||
|
|
@ -122,10 +122,10 @@ if (!function_exists('str_contains')) {
|
|||
|
||||
|
||||
/**
|
||||
* Return the full path of the directory where a module (or an object of a module) stores its files,
|
||||
* Return the full path of the directory where a module (or an object of a module) stores its files.
|
||||
* Path may depends on the entity if a multicompany module is enabled.
|
||||
*
|
||||
* @param CommonObject $object Dolibarr common object
|
||||
* @param CommonObject $object Dolibarr common object.
|
||||
* @param string $module Override object element, for example to use 'mycompany' instead of 'societe'
|
||||
* @param int $forobject Return the more complete path for the given object instead of for the module only.
|
||||
* @param string $mode 'output' (full main dir) or 'outputrel' (relative dir) or 'temp' (for temporary files) or 'version' (dir for archived files)
|
||||
|
|
@ -1145,8 +1145,9 @@ function GETPOSTFLOAT($paramname, $rounding = '')
|
|||
* optionally hour, minute, second) fields to return a timestamp.
|
||||
*
|
||||
* @param string $prefix Prefix used to build the date selector (for instance using Form::selectDate)
|
||||
* @param string $hourTime 'getpost' to include hour, minute, second values from the HTTP request, 'XX:YY:ZZ' to set
|
||||
* hour, minute, second respectively (for instance '23:59:59')
|
||||
* @param string $hourTime 'getpost' to include hour, minute, second values from the HTTP request,
|
||||
* or 'XX:YY:ZZ' to set hour, minute, second respectively (for instance '23:59:59')
|
||||
* or '' means '00:00:00' (default)
|
||||
* @param string $gm Passed to dol_mktime
|
||||
* @return int|string Date as a timestamp, '' or false if error
|
||||
*/
|
||||
|
|
@ -1550,9 +1551,9 @@ function dol_get_object_properties($obj, $properties = [])
|
|||
*
|
||||
* @template T
|
||||
*
|
||||
* @param T $object Object to clone
|
||||
* @param int $native 0=Full isolation method, 1=Native PHP method, 2=Full isolation method keeping only scalar and array properties (recommended)
|
||||
* @return T Clone object
|
||||
* @param T $object Object to clone
|
||||
* @param int $native 0=Full isolation method, 1=Native PHP method, 2=Full isolation method keeping only scalar and array properties (recommended)
|
||||
* @return T Clone object
|
||||
* @see https://php.net/manual/language.oop5.cloning.php
|
||||
* @phan-suppress PhanTypeExpectedObjectPropAccess
|
||||
*/
|
||||
|
|
@ -1591,7 +1592,7 @@ function dol_clone($object, $native = 2)
|
|||
}
|
||||
|
||||
/**
|
||||
* Optimize a size for some browsers (phone, smarphone, ...)
|
||||
* Optimize a size for some browsers (phone, smarphone...)
|
||||
*
|
||||
* @param int $size Size we want
|
||||
* @param string $type Type of optimizing:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
/* Copyright (C) 2024 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2024 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -24,8 +24,13 @@
|
|||
* $langs
|
||||
*/
|
||||
/**
|
||||
* @var CommonObject $object
|
||||
* @var Conf $conf
|
||||
* @var Form $form
|
||||
* @var Translate $langs
|
||||
*
|
||||
* @var string $action
|
||||
* @var int $usercancreate
|
||||
*/
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || !is_object($conf)) {
|
||||
|
|
|
|||
|
|
@ -203,43 +203,48 @@ if ($nolinesbefore) {
|
|||
$forceall = 3;
|
||||
}
|
||||
}
|
||||
|
||||
// Free line
|
||||
echo '<span class="prod_entry_mode_free">';
|
||||
// Show radio free line
|
||||
$labelforempty = 1;
|
||||
print '<span class="prod_entry_mode_free">';
|
||||
// Show radio for the non predefined product
|
||||
if ($forceall >= 0 && (isModEnabled("product") || isModEnabled("service"))) {
|
||||
echo '<label for="prod_entry_mode_free">';
|
||||
echo '<input type="radio" class="prod_entry_mode_free" name="prod_entry_mode" id="prod_entry_mode_free" value="free"';
|
||||
print '<label for="prod_entry_mode_free">';
|
||||
print '<input type="radio" class="prod_entry_mode_free" name="prod_entry_mode" id="prod_entry_mode_free" value="free"';
|
||||
//echo (GETPOST('prod_entry_mode')=='free' ? ' checked' : ((empty($forceall) && (!isModEnabled('product') || !isModEnabled('service')))?' checked':'') );
|
||||
echo((GETPOST('prod_entry_mode', 'alpha') == 'free' || getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT')) ? ' checked' : '');
|
||||
echo '> ';
|
||||
print((GETPOST('prod_entry_mode', 'alpha') == 'free' || getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT')) ? ' checked' : '');
|
||||
print '> ';
|
||||
// Show type selector
|
||||
echo '<span class="textradioforitem">'.$langs->trans("FreeLineOfType").'</span>';
|
||||
echo '</label>';
|
||||
echo ' ';
|
||||
//print '<span class="textradioforitem">'.$langs->trans("FreeLineOfType").'</span>';
|
||||
$labelforempty = $langs->trans("FreeLineOfType");
|
||||
print '</label>';
|
||||
//print ' ';
|
||||
} else {
|
||||
echo '<input type="hidden" id="prod_entry_mode_free" name="prod_entry_mode" value="free">';
|
||||
// Show type selector
|
||||
if ($forceall >= 0) {
|
||||
if (!isModEnabled('product') || !isModEnabled('service')) {
|
||||
echo $langs->trans("Type");
|
||||
$labelforempty = $langs->trans("Type");
|
||||
} else {
|
||||
echo $langs->trans("FreeLineOfType");
|
||||
$labelforempty = $langs->trans("FreeLineOfType");
|
||||
}
|
||||
echo ' ';
|
||||
//print ' ';
|
||||
}
|
||||
}
|
||||
$form->select_type_of_lines(GETPOSTISSET("type") ? GETPOST("type", 'alpha', 2) : -1, 'type', 1, 1, $forceall, '');
|
||||
echo '</span>';
|
||||
|
||||
$form->select_type_of_lines(GETPOSTISSET("type") ? GETPOST("type", 'alpha', 2) : -1, 'type', $labelforempty, 1, $forceall, '');
|
||||
print '</span>';
|
||||
}
|
||||
// Predefined product/service
|
||||
if (isModEnabled("product") || isModEnabled("service")) {
|
||||
print '<span class="nowraponall">';
|
||||
if ($forceall >= 0 && $freelines) {
|
||||
echo '<br><span class="prod_entry_mode_predef paddingtop">';
|
||||
print '<br><span class="prod_entry_mode_predef paddingtop">';
|
||||
} else {
|
||||
echo '<span class="prod_entry_mode_predef">';
|
||||
print '<span class="prod_entry_mode_predef">';
|
||||
}
|
||||
echo '<label for="prod_entry_mode_predef">';
|
||||
echo '<input type="radio" class="prod_entry_mode_predef" name="prod_entry_mode" id="prod_entry_mode_predef" value="predef"'.(GETPOST('prod_entry_mode') == 'predef' ? ' checked' : '').'> ';
|
||||
print '<label for="prod_entry_mode_predef">';
|
||||
print '<input type="radio" class="prod_entry_mode_predef" name="prod_entry_mode" id="prod_entry_mode_predef" value="predef"'.(GETPOST('prod_entry_mode') == 'predef' ? ' checked' : '').'> ';
|
||||
$labelforradio = '';
|
||||
if (empty($conf->dol_optimize_smallscreen)) {
|
||||
if (isModEnabled("product") && !isModEnabled('service')) {
|
||||
|
|
@ -252,9 +257,11 @@ if ($nolinesbefore) {
|
|||
} else {
|
||||
$labelforradio = $langs->trans('PredefinedItem');
|
||||
}
|
||||
print '<span class="textradioforitem">'.$labelforradio.'</span>';
|
||||
echo '</label>';
|
||||
echo ' ';
|
||||
if (empty($senderissupplier)) { // TODO Move this into the placeholder
|
||||
//print '<span class="textradioforitem">'.$labelforradio.'</span>';
|
||||
}
|
||||
print '</label>';
|
||||
//print ' ';
|
||||
$filtertype = '';
|
||||
if (!empty($object->element) && $object->element == 'contrat' && !getDolGlobalString('CONTRACT_SUPPORT_PRODUCTS')) {
|
||||
$filtertype = '1';
|
||||
|
|
@ -267,9 +274,9 @@ if ($nolinesbefore) {
|
|||
}
|
||||
if (getDolGlobalString('ENTREPOT_EXTRA_STATUS')) {
|
||||
// hide products in closed warehouse, but show products for internal transfer
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, getDolGlobalInt('PRODUIT_LIMIT_SIZE'), $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, $statuswarehouse, GETPOST('combinations', 'array'));
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, getDolGlobalInt('PRODUIT_LIMIT_SIZE'), $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, $labelforradio, 0, 'maxwidth500 widthcentpercentminusx', 0, $statuswarehouse, GETPOST('combinations', 'array'));
|
||||
} else {
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, getDolGlobalInt('PRODUIT_LIMIT_SIZE'), $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, '', GETPOST('combinations', 'array'));
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, getDolGlobalInt('PRODUIT_LIMIT_SIZE'), $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, $labelforradio, 0, 'maxwidth500 widthcentpercentminusx', 0, '', GETPOST('combinations', 'array'));
|
||||
}
|
||||
if (getDolGlobalString('MAIN_AUTO_OPEN_SELECT2_ON_FOCUS_FOR_CUSTOMER_PRODUCTS')) {
|
||||
?>
|
||||
|
|
@ -305,7 +312,9 @@ if ($nolinesbefore) {
|
|||
);
|
||||
$alsoproductwithnosupplierprice = 1;
|
||||
}
|
||||
$form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1, $alsoproductwithnosupplierprice, 'minwidth100 maxwidth500 widthcentpercentminusx');
|
||||
|
||||
$form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1, $alsoproductwithnosupplierprice, 'minwidth100 maxwidth500 widthcentpercentminusx', $labelforradio);
|
||||
|
||||
if (getDolGlobalString('MAIN_AUTO_OPEN_SELECT2_ON_FOCUS_FOR_SUPPLIER_PRODUCTS')) {
|
||||
?>
|
||||
<script>
|
||||
|
|
@ -365,7 +374,9 @@ if ($nolinesbefore) {
|
|||
}
|
||||
}
|
||||
}
|
||||
} ?>
|
||||
}
|
||||
print '</span>';
|
||||
?>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#dropdownAddProductAndService .dropdown-toggle").on("click", function(event) {
|
||||
|
|
|
|||
|
|
@ -374,7 +374,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
} else {
|
||||
//shipment line for product with no batch management and no multiple stock location
|
||||
if (GETPOSTINT($qty) > 0) {
|
||||
if (GETPOSTFLOAT($qty) > 0) {
|
||||
$totalqty += price2num(GETPOST($qty, 'alpha'), 'MS');
|
||||
$subtotalqty = price2num(GETPOST($qty, 'alpha'), 'MS');
|
||||
}
|
||||
|
|
@ -418,7 +418,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
if (GETPOSTINT($qty) > 0 || getDolGlobalString('SHIPMENT_GETS_ALL_ORDER_PRODUCTS')) {
|
||||
if (GETPOSTFLOAT($qty) > 0 || getDolGlobalString('SHIPMENT_GETS_ALL_ORDER_PRODUCTS')) {
|
||||
$ent = "entl".$i;
|
||||
$idl = "idl".$i;
|
||||
$entrepot_id = is_numeric(GETPOSTINT($ent)) ? GETPOSTINT($ent) : GETPOSTINT('entrepot_id');
|
||||
|
|
@ -429,7 +429,7 @@ if (empty($reshook)) {
|
|||
$entrepot_id = 0;
|
||||
}
|
||||
|
||||
$ret = $object->addline($entrepot_id, GETPOSTINT($idl), price2num(GETPOSTINT($qty), 'MS'), $array_options[$i]);
|
||||
$ret = $object->addline($entrepot_id, GETPOSTINT($idl), price2num(GETPOSTFLOAT($qty), 'MS'), $array_options[$i]);
|
||||
if ($ret < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
|
|
@ -687,7 +687,7 @@ if (empty($reshook)) {
|
|||
$batch = "batchl".$detail_batch->fk_expeditiondet."_".$detail_batch->fk_origin_stock;
|
||||
$qty = "qtyl".$detail_batch->fk_expeditiondet.'_'.$detail_batch->id;
|
||||
$batch_id = GETPOSTINT($batch);
|
||||
$batch_qty = GETPOSTINT($qty);
|
||||
$batch_qty = GETPOSTFLOAT($qty);
|
||||
if (!empty($batch_id)) {
|
||||
if ($lotStock->fetch($batch_id) > 0 && $line->fetch($detail_batch->fk_expeditiondet) > 0) { // $line is ExpeditionLine
|
||||
if ($lines[$i]->entrepot_id != 0) {
|
||||
|
|
@ -724,7 +724,7 @@ if (empty($reshook)) {
|
|||
$batch = "batchl".$line_id."_0";
|
||||
$qty = "qtyl".$line_id."_0";
|
||||
$batch_id = GETPOSTINT($batch);
|
||||
$batch_qty = GETPOSTINT($qty);
|
||||
$batch_qty = GETPOSTFLOAT($qty);
|
||||
$lineIdToAddLot = 0;
|
||||
if ($batch_qty > 0 && !empty($batch_id)) {
|
||||
if ($lotStock->fetch($batch_id) > 0) {
|
||||
|
|
|
|||
|
|
@ -136,11 +136,6 @@ class Expedition extends CommonObject
|
|||
*/
|
||||
public $billed;
|
||||
|
||||
/**
|
||||
* @var string name of pdf model
|
||||
*/
|
||||
public $model_pdf;
|
||||
|
||||
/**
|
||||
* @var int|string
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -4401,6 +4401,11 @@ function migrate_productlot_path()
|
|||
{
|
||||
global $conf, $db, $langs, $user;
|
||||
|
||||
if (!is_object($user)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||
$user = new User($db); // To avoid error during migration
|
||||
}
|
||||
|
||||
print '<tr><td colspan="4">';
|
||||
|
||||
print '<b>'.$langs->trans('MigrationProductLotPath')."</b><br>\n";
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ BankColorizeMovementDesc=If this function is enable, you can choose specific bac
|
|||
BankColorizeMovementName1=Background color for debit movement
|
||||
BankColorizeMovementName2=Background color for credit movement
|
||||
IfYouDontReconcileDisableProperty=If you don't make the bank reconciliations on some bank accounts, disable the property "%s" on them to remove this warning.
|
||||
NoBankAccountDefined=No bank account defined
|
||||
NoBankAccountDefined=No bank account found
|
||||
NoRecordFoundIBankcAccount=No record found in bank account. Commonly, this occurs when a record has been deleted manually from the list of transaction in the bank account (for example during a reconciliation of the bank account). Another reason is that the payment was recorded when the module "%s" was disabled.
|
||||
AlreadyOneBankAccount=Already one bank account defined
|
||||
SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation=SEPA file variant
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ if (isModEnabled('project')) {
|
|||
*/
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bills", "compta", "loan"));
|
||||
$langs->loadLangs(array("banks", "bills", "compta", "loan"));
|
||||
|
||||
$id = GETPOSTINT('id');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
|
||||
// There is several ways to check permission.
|
||||
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
|
||||
$enablepermissioncheck = 0;
|
||||
$enablepermissioncheck = getDolGlobalInt('MYMODULE_ENABLE_PERMISSION_CHECK');
|
||||
if ($enablepermissioncheck) {
|
||||
$permissiontoread = $user->hasRight('mymodule', 'myobject', 'read');
|
||||
$permissiontoadd = $user->hasRight('mymodule', 'myobject', 'write');
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'inclu
|
|||
|
||||
// There is several ways to check permission.
|
||||
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
|
||||
$enablepermissioncheck = 0;
|
||||
$enablepermissioncheck = getDolGlobalInt('MYMODULE_ENABLE_PERMISSION_CHECK');
|
||||
if ($enablepermissioncheck) {
|
||||
$permissiontoread = $user->hasRight('mymodule', 'myobject', 'read');
|
||||
$permissiontoadd = $user->hasRight('mymodule', 'myobject', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'inclu
|
|||
|
||||
// There is several ways to check permission.
|
||||
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
|
||||
$enablepermissioncheck = 0;
|
||||
$enablepermissioncheck = getDolGlobalInt('MYMODULE_ENABLE_PERMISSION_CHECK');
|
||||
if ($enablepermissioncheck) {
|
||||
$permissiontoread = $user->hasRight('mymodule', 'myobject', 'read');
|
||||
$permissiontoadd = $user->hasRight('mymodule', 'myobject', 'write');
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
// Permissions
|
||||
// (There are several ways to check permission.)
|
||||
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
|
||||
$enablepermissioncheck = 0;
|
||||
$enablepermissioncheck = getDolGlobalInt('MYMODULE_ENABLE_PERMISSION_CHECK');
|
||||
if ($enablepermissioncheck) {
|
||||
$permissiontoread = $user->hasRight('mymodule', 'myobject', 'read');
|
||||
$permissiontoadd = $user->hasRight('mymodule', 'myobject', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
|
|||
|
||||
// There is several ways to check permission.
|
||||
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
|
||||
$enablepermissioncheck = 0;
|
||||
$enablepermissioncheck = getDolGlobalInt('MYMODULE_ENABLE_PERMISSION_CHECK');
|
||||
if ($enablepermissioncheck) {
|
||||
$permissiontoread = $user->hasRight('mymodule', 'myobject', 'read');
|
||||
$permissiontoadd = $user->hasRight('mymodule', 'myobject', 'write');
|
||||
|
|
@ -274,6 +274,8 @@ if (empty($reshook)) {
|
|||
$objectclass = 'MyObject';
|
||||
$objectlabel = 'MyObject';
|
||||
$uploaddir = $conf->mymodule->dir_output;
|
||||
|
||||
global $error;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
// You can add more action here
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
|
||||
// There is several ways to check permission.
|
||||
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
|
||||
$enablepermissioncheck = 0;
|
||||
$enablepermissioncheck = getDolGlobalInt('MYMODULE_ENABLE_PERMISSION_CHECK');
|
||||
if ($enablepermissioncheck) {
|
||||
$permissiontoread = $user->hasRight('mymodule', 'myobject', 'read');
|
||||
$permissiontoadd = $user->hasRight('mymodule', 'myobject', 'write');
|
||||
|
|
|
|||
|
|
@ -71,11 +71,6 @@ class Product extends CommonObject
|
|||
*/
|
||||
public $fk_element = 'fk_product';
|
||||
|
||||
/**
|
||||
* @var static
|
||||
*/
|
||||
public $oldcopy;
|
||||
|
||||
/**
|
||||
* @var array<string, array<string>> List of child tables. To test if we can delete object.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -848,7 +848,6 @@ class Productlot extends CommonObject
|
|||
*/
|
||||
public function loadStatsExpedition($socid = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user, $hookmanager, $action;
|
||||
|
||||
$sql = "SELECT COUNT(DISTINCT exp.fk_soc) as nb_customers, COUNT(DISTINCT exp.rowid) as nb,";
|
||||
|
|
@ -923,7 +922,6 @@ class Productlot extends CommonObject
|
|||
*/
|
||||
public function loadStatsSupplierOrder($socid = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user, $hookmanager, $action;
|
||||
|
||||
$sql = "SELECT COUNT(DISTINCT cf.fk_soc) as nb_customers, COUNT(DISTINCT cf.rowid) as nb,";
|
||||
|
|
@ -998,7 +996,6 @@ class Productlot extends CommonObject
|
|||
*/
|
||||
public function loadStatsReception($socid = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user, $hookmanager, $action;
|
||||
|
||||
$sql = "SELECT COUNT(DISTINCT recep.fk_soc) as nb_customers, COUNT(DISTINCT recep.rowid) as nb,";
|
||||
|
|
@ -1072,7 +1069,6 @@ class Productlot extends CommonObject
|
|||
*/
|
||||
public function loadStatsMo($socid = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user, $hookmanager, $action;
|
||||
|
||||
$error = 0;
|
||||
|
|
|
|||
|
|
@ -333,8 +333,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
if ($action == 'update_extras' && $permissiontoadd) {
|
||||
$whClass = get_class($whClass);
|
||||
$whClass::$oldcopy = dol_clone($tmpwarehouse, 2);
|
||||
$tmpwarehouse->oldcopy = dol_clone($tmpwarehouse, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $tmpwarehouse, GETPOST('attribute', 'restricthtml'));
|
||||
|
|
|
|||
|
|
@ -246,11 +246,6 @@ class Project extends CommonObject
|
|||
*/
|
||||
public $email_msgid;
|
||||
|
||||
/**
|
||||
* @var ?static
|
||||
*/
|
||||
public $oldcopy;
|
||||
|
||||
/**
|
||||
* @var array<int,int> Used to store workload details of a projet (array[day])
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -445,6 +445,8 @@ if (empty($reshook)) {
|
|||
$permissiontodelete = $user->hasRight('projet', 'supprimer');
|
||||
$permissiontoadd = $user->hasRight('projet', 'creer');
|
||||
$uploaddir = $conf->project->dir_output;
|
||||
|
||||
global $error;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
// Close records
|
||||
|
|
|
|||
|
|
@ -1705,11 +1705,11 @@ if ($source == 'member' || $source == 'membersubscription') {
|
|||
if (empty($amount) && getDolGlobalString('MEMBER_NEWFORM_AMOUNT')) {
|
||||
$amount = getDolGlobalString('MEMBER_NEWFORM_AMOUNT');
|
||||
}
|
||||
// - If not set, we accept to have amount defined as parameter (for backward compatibility).
|
||||
//if (empty($amount)) {
|
||||
// $amount = (GETPOST('amount') ? price2num(GETPOST('amount', 'alpha'), 'MT', 2) : '');
|
||||
//}
|
||||
// - If a min is set, we take it into account
|
||||
// - If a new amount was posted from the form
|
||||
if ($caneditamount && GETPOSTISSET('newamount') && GETPOSTFLOAT('newamount', 'MT') > 0) {
|
||||
$amount = GETPOSTFLOAT('newamount', 'MT');
|
||||
}
|
||||
// - If a min is set or an amount from the posted form, we take them into account
|
||||
$amount = max(0, (float) $amount, (float) getDolGlobalInt("MEMBER_MIN_AMOUNT"));
|
||||
|
||||
// Amount
|
||||
|
|
@ -2166,7 +2166,7 @@ if ($action != 'dopayment') {
|
|||
$reshook = $hookmanager->executeHooks('doAddButton', $parameters, $object, $action);
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
} elseif ($reshook > 0) {
|
||||
} elseif ($reshook >= 0) {
|
||||
print $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
|
|
@ -2182,7 +2182,7 @@ if ($action != 'dopayment') {
|
|||
});
|
||||
$("#dopayment_paybox").click(function(e){
|
||||
$("#div_dopayment_paybox").css( \'cursor\', \'wait\' );
|
||||
e.stopPropagation();
|
||||
e.stopPropagation();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
@ -2212,7 +2212,7 @@ if ($action != 'dopayment') {
|
|||
});
|
||||
$("#dopayment_stripe").click(function(e){
|
||||
$("#div_dopayment_stripe").css( \'cursor\', \'wait\' );
|
||||
e.stopPropagation();
|
||||
e.stopPropagation();
|
||||
return true;
|
||||
});
|
||||
});
|
||||
|
|
@ -2254,7 +2254,7 @@ if ($action != 'dopayment') {
|
|||
});
|
||||
$("#dopayment_paypal").click(function(e){
|
||||
$("#div_dopayment_paypal").css( \'cursor\', \'wait\' );
|
||||
e.stopPropagation();
|
||||
e.stopPropagation();
|
||||
return true;
|
||||
});
|
||||
});
|
||||
|
|
@ -2296,32 +2296,32 @@ if (preg_match('/^dopayment/', $action)) { // If we chose/clicked on the payme
|
|||
if (GETPOST('dopayment_stripe', 'alpha')) {
|
||||
// Personalized checkout
|
||||
print '<style>
|
||||
/**
|
||||
* The CSS shown here will not be introduced in the Quickstart guide, but shows
|
||||
* how you can use CSS to style your Element s container.
|
||||
*/
|
||||
.StripeElement {
|
||||
background-color: white;
|
||||
padding: 8px 12px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid transparent;
|
||||
box-shadow: 0 1px 3px 0 #e6ebf1;
|
||||
-webkit-transition: box-shadow 150ms ease;
|
||||
transition: box-shadow 150ms ease;
|
||||
}
|
||||
/**
|
||||
* The CSS shown here will not be introduced in the Quickstart guide, but shows
|
||||
* how you can use CSS to style your Element s container.
|
||||
*/
|
||||
.StripeElement {
|
||||
background-color: white;
|
||||
padding: 8px 12px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid transparent;
|
||||
box-shadow: 0 1px 3px 0 #e6ebf1;
|
||||
-webkit-transition: box-shadow 150ms ease;
|
||||
transition: box-shadow 150ms ease;
|
||||
}
|
||||
|
||||
.StripeElement--focus {
|
||||
box-shadow: 0 1px 3px 0 #cfd7df;
|
||||
}
|
||||
.StripeElement--focus {
|
||||
box-shadow: 0 1px 3px 0 #cfd7df;
|
||||
}
|
||||
|
||||
.StripeElement--invalid {
|
||||
border-color: #fa755a;
|
||||
}
|
||||
.StripeElement--invalid {
|
||||
border-color: #fa755a;
|
||||
}
|
||||
|
||||
.StripeElement--webkit-autofill {
|
||||
background-color: #fefde5 !important;
|
||||
}
|
||||
</style>';
|
||||
.StripeElement--webkit-autofill {
|
||||
background-color: #fefde5 !important;
|
||||
}
|
||||
</style>';
|
||||
|
||||
//print '<br>';
|
||||
|
||||
|
|
@ -2380,8 +2380,8 @@ if (preg_match('/^dopayment/', $action)) { // If we chose/clicked on the payme
|
|||
// $conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 2 = use payment object (suggest both card payment mode but also sepa, ...)
|
||||
|
||||
print '
|
||||
<table id="dolpaymenttable" summary="Payment form" class="center centpercent">
|
||||
<tbody><tr><td class="textpublicpayment">';
|
||||
<table id="dolpaymenttable" summary="Payment form" class="center centpercent">
|
||||
<tbody><tr><td class="textpublicpayment">';
|
||||
|
||||
if (getDolGlobalString('STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION')) {
|
||||
print '<div id="payment-request-button"><!-- A Stripe Element will be inserted here. --></div>';
|
||||
|
|
@ -2395,8 +2395,8 @@ if (preg_match('/^dopayment/', $action)) { // If we chose/clicked on the payme
|
|||
|
||||
if (getDolGlobalInt('STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION') == 1) {
|
||||
print '<div id="card-element">
|
||||
<!-- a Stripe Element will be inserted here. -->
|
||||
</div>';
|
||||
<!-- a Stripe Element will be inserted here. -->
|
||||
</div>';
|
||||
}
|
||||
if (getDolGlobalInt('STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION') == 2) {
|
||||
print '<div id="payment-element">
|
||||
|
|
@ -2405,8 +2405,8 @@ if (preg_match('/^dopayment/', $action)) { // If we chose/clicked on the payme
|
|||
}
|
||||
|
||||
print '<!-- Used to display form errors -->
|
||||
<div id="card-errors" role="alert"></div>
|
||||
</div>';
|
||||
<div id="card-errors" role="alert"></div>
|
||||
</div>';
|
||||
|
||||
print '<br>';
|
||||
print '<button class="button buttonpayment" style="text-align: center; padding-left: 0; padding-right: 0;" id="buttontopay" data-secret="'.(is_object($paymentintent) ? $paymentintent->client_secret : '').'">'.$langs->trans("ValidatePayment").'</button>';
|
||||
|
|
|
|||
|
|
@ -99,10 +99,6 @@ class Reception extends CommonObject
|
|||
* @var int<0,1>
|
||||
*/
|
||||
public $billed;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $model_pdf;
|
||||
|
||||
/**
|
||||
* @var int|float
|
||||
|
|
|
|||
|
|
@ -131,11 +131,6 @@ class Dolresource extends CommonObject
|
|||
*/
|
||||
public $cache_code_type_resource;
|
||||
|
||||
/**
|
||||
* @var static Clone of object before changing it
|
||||
*/
|
||||
public $oldcopy;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
|
|
|||
|
|
@ -214,6 +214,8 @@ if (empty($reshook)) {
|
|||
$objectclass = 'PaymentSalary';
|
||||
$objectlabel = 'SalariesPayments';
|
||||
$uploaddir = $conf->salaries->dir_output;
|
||||
|
||||
global $error;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
// Validate records
|
||||
|
|
|
|||
|
|
@ -329,12 +329,6 @@ class CompanyBankAccount extends Account
|
|||
*/
|
||||
public $datem;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @see SetDocModel()
|
||||
*/
|
||||
public $model_pdf;
|
||||
|
||||
/**
|
||||
* @var string TRIGGER_PREFIX Dolibarr 16.0 and above use the prefix to prevent the creation of inconsistently
|
||||
* named triggers
|
||||
|
|
|
|||
|
|
@ -133,11 +133,6 @@ class Societe extends CommonObject
|
|||
*/
|
||||
public $restrictiononfksoc = 1;
|
||||
|
||||
/**
|
||||
* @var static To store a cloned copy of object before to edit it and keep track of old properties
|
||||
*/
|
||||
public $oldcopy;
|
||||
|
||||
/**
|
||||
* array of supplier categories
|
||||
* @var string[]
|
||||
|
|
|
|||
|
|
@ -480,9 +480,11 @@ if (empty($reshook)) {
|
|||
$permissiontodelete = $user->hasRight('societe', 'supprimer');
|
||||
$permissiontoadd = $user->hasRight("societe", "creer");
|
||||
$uploaddir = $conf->societe->dir_output;
|
||||
|
||||
global $error;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
if ($action == 'setstcomm' && $permissiontoadd) {
|
||||
if (!$error && $action == 'setstcomm' && $permissiontoadd) {
|
||||
$object = new Client($db);
|
||||
$result = $object->fetch(GETPOST('stcommsocid'));
|
||||
$object->stcomm_id = dol_getIdFromCode($db, GETPOST('stcomm', 'alpha'), 'c_stcomm');
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
<?php
|
||||
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2022 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013 Peter Fontaine <contact@peterfontaine.fr>
|
||||
* Copyright (C) 2015-2016 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018-2023 Thibault FOUCART <support@ptibogxiv.net>
|
||||
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2022 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013 Peter Fontaine <contact@peterfontaine.fr>
|
||||
* Copyright (C) 2015-2016 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018-2023 Thibault FOUCART <support@ptibogxiv.net>
|
||||
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2024 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
|
||||
|
|
@ -177,8 +177,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
if (!$error) {
|
||||
$cbClassName = get_class($companybankaccount);
|
||||
$cbClassName::$oldcopy = dol_clone($companybankaccount, 2);
|
||||
$companybankaccount->oldcopy = dol_clone($companybankaccount, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
$companybankaccount->socid = $object->id;
|
||||
|
||||
|
|
@ -200,7 +199,7 @@ if (empty($reshook)) {
|
|||
$companybankaccount->owner_address = GETPOST('owner_address', 'alpha');
|
||||
$companybankaccount->frstrecur = GETPOST('frstrecur', 'alpha');
|
||||
$companybankaccount->rum = GETPOST('rum', 'alpha');
|
||||
$companybankaccount->date_rum = dol_mktime(0, 0, 0, GETPOST('date_rummonth'), GETPOST('date_rumday'), GETPOST('date_rumyear'));
|
||||
$companybankaccount->date_rum = GETPOSTDATE('date_rum', '00:00:00');
|
||||
if (empty($companybankaccount->rum)) {
|
||||
$companybankaccount->rum = $prelevement->buildRumNumber($object->code_client, $companybankaccount->datec, $companybankaccount->id);
|
||||
}
|
||||
|
|
@ -255,8 +254,7 @@ if (empty($reshook)) {
|
|||
|
||||
$companypaymentmode->fetch($id);
|
||||
if (!$error) {
|
||||
$cbClassName = get_class($companybankaccount);
|
||||
$cbClassName::$oldcopy = dol_clone($companybankaccount, 2);
|
||||
$companypaymentmode->oldcopy = dol_clone($companypaymentmode, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
$companypaymentmode->fk_soc = $object->id;
|
||||
|
||||
|
|
@ -313,7 +311,7 @@ if (empty($reshook)) {
|
|||
// Ajout
|
||||
$companybankaccount = new CompanyBankAccount($db);
|
||||
|
||||
$companybankaccount->socid = $object->id;
|
||||
$companybankaccount->socid = $object->id;
|
||||
|
||||
$companybankaccount->fetch_thirdparty();
|
||||
|
||||
|
|
@ -333,7 +331,7 @@ if (empty($reshook)) {
|
|||
$companybankaccount->owner_address = GETPOST('owner_address', 'alpha');
|
||||
$companybankaccount->frstrecur = GETPOST('frstrecur', 'alpha');
|
||||
$companybankaccount->rum = GETPOST('rum', 'alpha');
|
||||
$companybankaccount->date_rum = dol_mktime(0, 0, 0, GETPOSTINT('date_rummonth'), GETPOSTINT('date_rumday'), GETPOSTINT('date_rumyear'));
|
||||
$companybankaccount->date_rum = GETPOSTDATE('date_rum', '00:00:00');
|
||||
$companybankaccount->datec = dol_now();
|
||||
|
||||
//$companybankaccount->clos = GETPOSTINT('clos');
|
||||
|
|
@ -2090,7 +2088,7 @@ if ($socid && $action == 'edit' && $permissiontoaddupdatepaymentinformation) {
|
|||
print '<tr><td class="titlefield">'.$langs->trans("RUM").'</td>';
|
||||
print '<td><input class="minwidth300" type="text" name="rum" value="'.dol_escape_htmltag($companybankaccount->rum).'"></td></tr>';
|
||||
|
||||
$date_rum = dol_mktime(0, 0, 0, GETPOST('date_rummonth'), GETPOST('date_rumday'), GETPOST('date_rumyear'));
|
||||
$date_rum = GETPOSTDATE('date_rum', '00:00:00');
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("DateRUM").'</td>';
|
||||
print '<td>'.$form->selectDate($date_rum ? $date_rum : $companybankaccount->date_rum, 'date_rum', 0, 0, 1, 'date_rum', 1, 1).'</td></tr>';
|
||||
|
|
@ -2259,7 +2257,7 @@ if ($socid && $action == 'create' && $permissiontoaddupdatepaymentinformation) {
|
|||
print '<tr><td class="titlefieldcreate">'.$form->textwithpicto($langs->trans("RUM"), $langs->trans("RUMLong").'<br>'.$langs->trans("RUMWillBeGenerated")).'</td>';
|
||||
print '<td colspan="4"><input type="text" class="minwidth300" name="rum" value="'.GETPOST('rum', 'alpha').'"></td></tr>';
|
||||
|
||||
$date_rum = dol_mktime(0, 0, 0, GETPOST('date_rummonth'), GETPOST('date_rumday'), GETPOST('date_rumyear'));
|
||||
$date_rum = GETPOSTDATE('date_rum', '00:00:00');
|
||||
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("DateRUM").'</td>';
|
||||
print '<td colspan="4">'.$form->selectDate($date_rum, 'date_rum', 0, 0, 1, 'date_rum', 1, 1).'</td></tr>';
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
|||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var ExtraFields $extrafields
|
||||
* @var HookManager $hookmanager
|
||||
* @var Societe $mysoc
|
||||
* @var Translate $langs
|
||||
|
|
|
|||
|
|
@ -246,17 +246,11 @@ class Ticket extends CommonObject
|
|||
*/
|
||||
public $ip;
|
||||
|
||||
/**
|
||||
* @var static Save the ticket before an update operation (for triggers)
|
||||
*/
|
||||
public $oldcopy;
|
||||
|
||||
/**
|
||||
* @var Ticket[] Array of Tickets
|
||||
*/
|
||||
public $lines;
|
||||
|
||||
|
||||
/**
|
||||
* @var string Regex pour les images
|
||||
*/
|
||||
|
|
@ -516,7 +510,8 @@ class Ticket extends CommonObject
|
|||
$result = $this->verify();
|
||||
|
||||
if ($result >= 0) {
|
||||
$this->entity = ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity);
|
||||
// setEntity will set entity with the right value if empty or change it for the right value if multicompany module is active
|
||||
$this->entity = setEntity($this);
|
||||
|
||||
// Insert request
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."ticket(";
|
||||
|
|
|
|||
|
|
@ -404,7 +404,7 @@ if ($user->hasRight('ticket', 'read')) {
|
|||
|
||||
// Creation date
|
||||
print '<td class="center nowraponall">';
|
||||
print dol_print_date($db->jdate($objp->datec), 'dayhour');
|
||||
print dol_print_date($db->jdate($objp->datec), 'dayhourreduceformat');
|
||||
print "</td>";
|
||||
|
||||
// Subject
|
||||
|
|
|
|||
|
|
@ -250,19 +250,54 @@ if (empty($reshook)) {
|
|||
$objectclass = 'Ticket';
|
||||
$objectlabel = 'Ticket';
|
||||
$uploaddir = $conf->ticket->dir_output;
|
||||
|
||||
global $error;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
// Close records
|
||||
if (!$error && $massaction == 'close' && $permissiontoadd) {
|
||||
$objecttmp = new $objectclass($db);
|
||||
if (!$error) {
|
||||
$db->begin();
|
||||
$objecttmp = new Ticket($db);
|
||||
$db->begin();
|
||||
|
||||
$nbok = 0;
|
||||
foreach ($toselect as $toselectid) {
|
||||
$result = $objecttmp->fetch($toselectid);
|
||||
if ($result > 0) {
|
||||
$result = $objecttmp->close($user);
|
||||
$nbok = 0;
|
||||
foreach ($toselect as $toselectid) {
|
||||
$result = $objecttmp->fetch($toselectid);
|
||||
if ($result > 0) {
|
||||
$result = $objecttmp->close($user);
|
||||
if ($result < 0) {
|
||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
} else {
|
||||
$nbok++;
|
||||
}
|
||||
} else {
|
||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
|
||||
$db->commit();
|
||||
} else {
|
||||
$db->rollback();
|
||||
}
|
||||
//var_dump($listofobjectthirdparties);exit;
|
||||
}
|
||||
|
||||
// Reopen records
|
||||
if (!$error && $massaction == 'reopen' && $permissiontoadd) {
|
||||
$objecttmp = new Ticket($db);
|
||||
$db->begin();
|
||||
|
||||
$nbok = 0;
|
||||
foreach ($toselect as $toselectid) {
|
||||
$result = $objecttmp->fetch($toselectid);
|
||||
if ($result > 0) {
|
||||
if ($objecttmp->status == Ticket::STATUS_CLOSED || $objecttmp->status == Ticket::STATUS_CANCELED) {
|
||||
$result = $objecttmp->setStatut(Ticket::STATUS_ASSIGNED);
|
||||
if ($result < 0) {
|
||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||
$error++;
|
||||
|
|
@ -271,62 +306,25 @@ if (empty($reshook)) {
|
|||
$nbok++;
|
||||
}
|
||||
} else {
|
||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorObjectMustHaveStatusClosedToBeReOpened", $objecttmp->ref), null, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
|
||||
$db->commit();
|
||||
} else {
|
||||
$db->rollback();
|
||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
//var_dump($listofobjectthirdparties);exit;
|
||||
}
|
||||
}
|
||||
|
||||
// Reopen records
|
||||
if (!$error && $massaction == 'reopen' && $permissiontoadd) {
|
||||
$objecttmp = new $objectclass($db);
|
||||
if (!$error) {
|
||||
$db->begin();
|
||||
|
||||
$nbok = 0;
|
||||
foreach ($toselect as $toselectid) {
|
||||
$result = $objecttmp->fetch($toselectid);
|
||||
if ($result > 0) {
|
||||
if ($objecttmp->status == Ticket::STATUS_CLOSED || $objecttmp->status == Ticket::STATUS_CANCELED) {
|
||||
$result = $objecttmp->setStatut(Ticket::STATUS_ASSIGNED);
|
||||
if ($result < 0) {
|
||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
} else {
|
||||
$nbok++;
|
||||
}
|
||||
} else {
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorObjectMustHaveStatusClosedToBeReOpened", $objecttmp->ref), null, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
|
||||
$db->commit();
|
||||
} else {
|
||||
$db->rollback();
|
||||
}
|
||||
//var_dump($listofobjectthirdparties);exit;
|
||||
setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
|
||||
$db->commit();
|
||||
} else {
|
||||
$db->rollback();
|
||||
}
|
||||
//var_dump($listofobjectthirdparties);exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -393,6 +391,7 @@ if ($socid > 0) {
|
|||
}
|
||||
|
||||
foreach ($search as $key => $val) {
|
||||
$tmpkey = 't.' . $key;
|
||||
if ($key == 'fk_statut' && !empty($search['fk_statut'])) {
|
||||
$newarrayofstatus = array();
|
||||
foreach ($search['fk_statut'] as $key2 => $val2) {
|
||||
|
|
@ -414,18 +413,18 @@ foreach ($search as $key => $val) {
|
|||
$newarrayofstatus[] = Ticket::STATUS_CANCELED;
|
||||
}
|
||||
if (count($newarrayofstatus)) {
|
||||
$sql .= natural_search($key, implode(',', $newarrayofstatus), 2);
|
||||
$sql .= natural_search($tmpkey, implode(',', $newarrayofstatus), 2);
|
||||
}
|
||||
continue;
|
||||
} elseif ($key == 'fk_user_assign' || $key == 'fk_user_create' || $key == 'fk_project' || $key == 'fk_contract') {
|
||||
if ($search[$key] > 0) {
|
||||
$sql .= natural_search($key, $search[$key], 2);
|
||||
$sql .= natural_search($tmpkey, $search[$key], 2);
|
||||
}
|
||||
continue;
|
||||
} elseif ($key == 'type_code') {
|
||||
$newarrayoftypecodes = is_array($search[$key]) ? $search[$key] : (!empty($search[$key]) ? explode(',', $search[$key]) : array());
|
||||
if (count($newarrayoftypecodes)) {
|
||||
$sql .= natural_search($key, implode(',', $newarrayoftypecodes), 3);
|
||||
$sql .= natural_search($tmpkey, implode(',', $newarrayoftypecodes), 3);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
@ -433,7 +432,7 @@ foreach ($search as $key => $val) {
|
|||
$mode_search = ((!empty($object->fields[$key]) && ($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key]))) ? 1 : 0);
|
||||
// $search[$key] can be an array of values, or a string. We add filter if array not empty or if it is a string.
|
||||
if ((is_array($search[$key]) && !empty($search[$key])) || (!is_array($search[$key]) && $search[$key] != '')) {
|
||||
$sql .= natural_search($key, $search[$key], $mode_search);
|
||||
$sql .= natural_search($tmpkey, $search[$key], $mode_search);
|
||||
}
|
||||
}
|
||||
if ($search_all) {
|
||||
|
|
@ -443,10 +442,10 @@ if ($search_societe) {
|
|||
$sql .= natural_search('s.nom', $search_societe);
|
||||
}
|
||||
if ($search_fk_project > 0) {
|
||||
$sql .= natural_search('fk_project', (string) $search_fk_project, 2);
|
||||
$sql .= natural_search('t.fk_project', (string) $search_fk_project, 2);
|
||||
}
|
||||
if ($search_fk_contract > 0) {
|
||||
$sql .= natural_search('fk_contract', (string) $search_fk_contract, 2);
|
||||
$sql .= natural_search('t.fk_contract', (string) $search_fk_contract, 2);
|
||||
}
|
||||
if ($search_date_start) {
|
||||
$sql .= " AND t.datec >= '".$db->idate($search_date_start)."'";
|
||||
|
|
@ -661,7 +660,7 @@ $param = '';
|
|||
if (!empty($mode)) {
|
||||
$param .= '&mode='.urlencode($mode);
|
||||
}
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
if (/* !empty($contextpage) && */ $contextpage != $_SERVER["PHP_SELF"]) { // $contextpage can't be empty
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
}
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
|
|
|
|||
|
|
@ -75,11 +75,6 @@ class User extends CommonObject
|
|||
*/
|
||||
public $id = 0;
|
||||
|
||||
/**
|
||||
* @var static old copy of User
|
||||
*/
|
||||
public $oldcopy;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
* @deprecated Use $status
|
||||
|
|
|
|||
|
|
@ -125,11 +125,6 @@ class UserGroup extends CommonObject
|
|||
*/
|
||||
public $all_permissions_are_loaded;
|
||||
|
||||
/**
|
||||
* @var static
|
||||
*/
|
||||
public $oldcopy; // To contains a clone of this when we need to save old properties of object
|
||||
|
||||
public $fields = array(
|
||||
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'),
|
||||
'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'default' => '1', 'index' => 1, 'position' => 5),
|
||||
|
|
|
|||
|
|
@ -304,63 +304,63 @@ if (empty($reshook)) {
|
|||
$objectclass = 'User';
|
||||
$objectlabel = 'User';
|
||||
$uploaddir = $conf->user->dir_output;
|
||||
|
||||
global $error;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
// Disable or Enable records
|
||||
if (!$error && ($massaction == 'disable' || $massaction == 'reactivate') && $permissiontoadd) {
|
||||
$objecttmp = new User($db);
|
||||
|
||||
if (!$error) {
|
||||
$db->begin();
|
||||
$db->begin();
|
||||
|
||||
$nbok = 0;
|
||||
foreach ($toselect as $toselectid) {
|
||||
if ($toselectid == $user->id) {
|
||||
setEventMessages($langs->trans($massaction == 0 ? 'CantDisableYourself' : 'CanEnableYourself'), null, 'errors');
|
||||
$nbok = 0;
|
||||
foreach ($toselect as $toselectid) {
|
||||
if ($toselectid == $user->id) {
|
||||
setEventMessages($langs->trans($massaction == 0 ? 'CantDisableYourself' : 'CanEnableYourself'), null, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
|
||||
$result = $objecttmp->fetch($toselectid);
|
||||
if ($result > 0) {
|
||||
if ($objecttmp->admin) {
|
||||
setEventMessages($langs->trans($massaction == 0 ? 'CantDisableAnAdminUserWithMassActions' : 'CantEnableAnAdminUserWithMassActions', $objecttmp->login), null, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
|
||||
$result = $objecttmp->fetch($toselectid);
|
||||
if ($result > 0) {
|
||||
if ($objecttmp->admin) {
|
||||
setEventMessages($langs->trans($massaction == 0 ? 'CantDisableAnAdminUserWithMassActions' : 'CantEnableAnAdminUserWithMassActions', $objecttmp->login), null, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
|
||||
$result = $objecttmp->setstatus($massaction == 'disable' ? 0 : 1);
|
||||
if ($result == 0) {
|
||||
// Nothing is done
|
||||
} elseif ($result < 0) {
|
||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
} else {
|
||||
$nbok++;
|
||||
}
|
||||
} else {
|
||||
$result = $objecttmp->setstatus($massaction == 'disable' ? 0 : 1);
|
||||
if ($result == 0) {
|
||||
// Nothing is done
|
||||
} elseif ($result < 0) {
|
||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
} else {
|
||||
$nbok++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && !empty($conf->file->main_limit_users)) {
|
||||
$nb = $object->getNbOfUsers("active");
|
||||
if ($nb >= $conf->file->main_limit_users) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("YourQuotaOfUsersIsReached"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
|
||||
$db->commit();
|
||||
} else {
|
||||
$db->rollback();
|
||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && !empty($conf->file->main_limit_users)) {
|
||||
$nb = $object->getNbOfUsers("active");
|
||||
if ($nb >= $conf->file->main_limit_users) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("YourQuotaOfUsersIsReached"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
|
||||
$db->commit();
|
||||
} else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2022 Open-Dsi <support@open-dsi.fr>
|
||||
/* Copyright (C) 2022 Open-Dsi <support@open-dsi.fr>
|
||||
* 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
|
||||
|
|
@ -24,13 +25,22 @@
|
|||
* $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
|
||||
*/
|
||||
|
||||
/**
|
||||
* @var CommonObject $this
|
||||
* @var CommonObject $object
|
||||
* @var HookManager $hookmanager
|
||||
* @var Translate $langs
|
||||
*
|
||||
* @var string $action
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($object) || !is_object($object)) {
|
||||
print "Error: this template page cannot be called directly as an URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
'@phan-var-force CommonObject $this
|
||||
'@phan-var-force CommonObject $object
|
||||
@phan-var-force CommonObject $this';
|
||||
|
||||
global $forcetoshowtitlelines;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2022 Open-Dsi <support@open-dsi.fr>
|
||||
/* Copyright (C) 2022 Open-Dsi <support@open-dsi.fr>
|
||||
* 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
|
||||
|
|
@ -31,6 +32,11 @@ if (empty($object) || !is_object($object)) {
|
|||
print "Error, template page can't be called as URL";
|
||||
exit(1);
|
||||
}
|
||||
/**
|
||||
* @var Translate $langs
|
||||
*
|
||||
* @var string $action
|
||||
*/
|
||||
|
||||
print "<!-- BEGIN PHP TEMPLATE productattributevalueline_title.tpl.php -->\n";
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user