';
// Modify a validated invoice with no payments
- if ($object->statut == 1 && $action != 'edit' && $object->getSommePaiement() == 0 && $user->rights->fournisseur->facture->creer)
+ if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $action != 'edit' && $object->getSommePaiement() == 0 && $user->rights->fournisseur->facture->creer)
{
print '
'.$langs->trans('Modify').'';
}
@@ -2329,7 +2331,7 @@ else
}
// Send by mail
- if (($object->statut == 1 || $object->statut == 2))
+ if (($object->statut == FactureFournisseur::STATUS_VALIDATED || $object->statut == FactureFournisseur::STATUS_CLOSED))
{
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->fournisseur->supplier_invoice_advance->send)
{
@@ -2340,13 +2342,13 @@ else
// Make payments
- if ($action != 'edit' && $object->statut == 1 && $object->paye == 0 && $user->societe_id == 0)
+ if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0)
{
print '
'.$langs->trans('DoPayment').''; // must use facid because id is for payment id not invoice
}
// Classify paid
- if ($action != 'edit' && $object->statut == 1 && $object->paye == 0 && $user->societe_id == 0)
+ if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0)
{
print '
id.'&action=paid"';
print '>'.$langs->trans('ClassifyPaid').'';
@@ -2355,7 +2357,7 @@ else
}
// Validate
- if ($action != 'edit' && $object->statut == 0)
+ if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_DRAFT)
{
if (count($object->lines))
{
diff --git a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql
index 5f8fed7fd14..85757f85f15 100644
--- a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql
+++ b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql
@@ -513,3 +513,6 @@ create table llx_c_price_global_variable_updater
next_update integer DEFAULT 0,
last_status text DEFAULT NULL
)ENGINE=innodb;
+
+ALTER TABLE llx_adherent CHANGE COLUMN note note_private text DEFAULT NULL;
+
diff --git a/htdocs/install/mysql/tables/llx_adherent.sql b/htdocs/install/mysql/tables/llx_adherent.sql
index e7f9c246834..e6ffee2dc5b 100644
--- a/htdocs/install/mysql/tables/llx_adherent.sql
+++ b/htdocs/install/mysql/tables/llx_adherent.sql
@@ -54,7 +54,7 @@ create table llx_adherent
statut smallint NOT NULL DEFAULT 0,
public smallint NOT NULL DEFAULT 0, -- certain champ de la fiche sont ils public ou pas ?
datefin datetime, -- date de fin de validite de la cotisation
- note text,
+ note_private text DEFAULT NULL,
datevalid datetime, -- date de validation
datec datetime, -- date de creation
tms timestamp, -- date de modification
diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php
index c2c0bba6381..85d0694b725 100644
--- a/htdocs/loan/class/loan.class.php
+++ b/htdocs/loan/class/loan.class.php
@@ -321,7 +321,7 @@ class Loan extends CommonObject
* Return label of loan status (unpaid, paid)
*
* @param int $mode 0=label, 1=short label, 2=Picto + Short label, 3=Picto, 4=Picto + Label
- * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
+ * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
* @return string Label
*/
function getLibStatut($mode=0,$alreadypaid=-1)
@@ -334,7 +334,7 @@ class Loan extends CommonObject
*
* @param int $statut Id statut
* @param int $mode 0=Label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Label, 5=Short label + Picto
- * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
+ * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
* @return string Label
*/
function LibStatut($statut,$mode=0,$alreadypaid=-1)
@@ -447,7 +447,7 @@ class Loan extends CommonObject
* Information on record
*
* @param int $id Id of record
- * @return void
+ * @return integer|null
*/
function info($id)
{
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index e4fe0c06e8e..d0b80db1190 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -111,17 +111,17 @@ function test_sql_and_script_inject($val, $type)
/**
* Security: Return true if OK, false otherwise.
*
- * @param string $var Variable name
- * @param string $type 1=GET, 0=POST, 2=PHP_SELF
- * @return boolean true if there is an injection
+ * @param string $var Variable name
+ * @param string $type 1=GET, 0=POST, 2=PHP_SELF
+ * @return boolean||null true if there is an injection. Stop code if injection found.
*/
-function analyse_sql_and_script(&$var, $type)
+function analyseVarsForSqlAndScriptsInjection(&$var, $type)
{
if (is_array($var))
{
foreach ($var as $key => $value)
{
- if (analyse_sql_and_script($value,$type))
+ if (analyseVarsForSqlAndScriptsInjection($value,$type))
{
$var[$key] = $value;
}
@@ -147,16 +147,16 @@ if ((defined('NOREQUIREDB') || defined('NOREQUIRETRAN')) && ! defined('NOREQUIRE
if (! empty($_SERVER["PHP_SELF"]))
{
$morevaltochecklikepost=array($_SERVER["PHP_SELF"]);
- analyse_sql_and_script($morevaltochecklikepost,2);
+ analyseVarsForSqlAndScriptsInjection($morevaltochecklikepost,2);
}
// Sanity check on GET parameters
if (! empty($_SERVER["QUERY_STRING"]))
{
$morevaltochecklikeget=array($_SERVER["QUERY_STRING"]);
- analyse_sql_and_script($morevaltochecklikeget,1);
+ analyseVarsForSqlAndScriptsInjection($morevaltochecklikeget,1);
}
// Sanity check on POST
-analyse_sql_and_script($_POST,0);
+analyseVarsForSqlAndScriptsInjection($_POST,0);
// This is to make Dolibarr working with Plesk
if (! empty($_SERVER['DOCUMENT_ROOT'])) set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs');
diff --git a/htdocs/printing/index.php b/htdocs/printing/index.php
index e8669f44585..48795fbab4c 100644
--- a/htdocs/printing/index.php
+++ b/htdocs/printing/index.php
@@ -30,8 +30,8 @@ llxHeader("",$langs->trans("Printing"));
print_fiche_titre($langs->trans("Printing"));
// List Jobs from printing modules
-//$printer = new dolPrintIPP($db,$conf->global->PRINTIPP_HOST,$conf->global->PRINTIPP_PORT,$user->login,$conf->global->PRINTIPP_USER,$conf->global->PRINTIPP_PASSWORD);
-//$printer->list_jobs('commande');
+$printer = new dolPrintIPP($db,$conf->global->PRINTIPP_HOST,$conf->global->PRINTIPP_PORT,$user->login,$conf->global->PRINTIPP_USER,$conf->global->PRINTIPP_PASSWORD);
+$printer->list_jobs('commande');
llxFooter();
diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php
index b36e7b317c6..5926beab083 100644
--- a/htdocs/product/canvas/service/actions_card_service.class.php
+++ b/htdocs/product/canvas/service/actions_card_service.class.php
@@ -67,7 +67,7 @@ class ActionsCardService
* Assign custom values for canvas (for example into this->tpl to be used by templates)
*
* @param string $action Type of action
- * @param string $id Id of object
+ * @param integer $id Id of object
* @param string $ref Ref of object
* @return void
*/
diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php
index d6d848b8ef1..ee49302407d 100644
--- a/htdocs/product/class/productbatch.class.php
+++ b/htdocs/product/class/productbatch.class.php
@@ -462,7 +462,7 @@ class Productbatch extends CommonObject
/**
* Return all batch detail records for given product and warehouse
*
- * @param obj $db database object
+ * @param DoliDB $db database object
* @param int $fk_product_stock id product_stock for objet
* @param int $with_qty doesn't return line with 0 quantity
* @return int <0 if KO, >0 if OK
diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php
index a6ac9ee1906..8fb06cd783e 100644
--- a/htdocs/public/members/new.php
+++ b/htdocs/public/members/new.php
@@ -25,9 +25,9 @@
* \brief Example of form to add a new member
*
* Note that you can add following constant to change behaviour of page
- * MEMBER_NEWFORM_AMOUNT Default amount for autosubscribe form
+ * MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form
* MEMBER_NEWFORM_EDITAMOUNT Amount can be edited
- * MEMBER_NEWFORM_PAYONLINE Suggest paypemt with paypal of paybox
+ * MEMBER_NEWFORM_PAYONLINE Suggest payment with paypal of paybox
* MEMBER_NEWFORM_DOLIBARRTURNOVER Show field turnover (specific for dolibarr foundation)
* MEMBER_URL_REDIRECT_SUBSCRIPTION Url to redirect once subscribe submitted
* MEMBER_NEWFORM_FORCETYPE Force type of member
@@ -40,7 +40,7 @@ define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
// For MultiCompany module.
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
-// TODO This should be useless. Because entity must be retreive from object ref and not from url.
+// TODO This should be useless. Because entity must be retrieve from object ref and not from url.
$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
if (is_numeric($entity)) define("DOLENTITY", $entity);
@@ -138,7 +138,7 @@ function llxFooterVierge()
* Actions
*/
-// Action called when page is submited
+// Action called when page is submitted
if ($action == 'add')
{
// test if login already exists
@@ -335,7 +335,7 @@ if ($action == 'add')
}
}
-// Action called after a submited was send and member created succesfully
+// Action called after a submitted was send and member created successfully
// If MEMBER_URL_REDIRECT_SUBSCRIPTION is set to url we never go here because a redirect was done to this url.
// backtopage parameter with an url was set on member submit page, we never go here because a redirect was done to this url.
if ($action == 'added')
diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php
index b94262bbb52..c5389c73452 100644
--- a/htdocs/societe/canvas/actions_card_common.class.php
+++ b/htdocs/societe/canvas/actions_card_common.class.php
@@ -355,7 +355,7 @@ abstract class ActionsCardCommon
* Assign custom values for canvas (for example into this->tpl to be used by templates)
*
* @param string $action Type of action
- * @param string $id Id of object
+ * @param integer $id Id of object
* @param string $ref Ref of object
* @return void
*/
diff --git a/htdocs/societe/canvas/company/actions_card_company.class.php b/htdocs/societe/canvas/company/actions_card_company.class.php
index d54af2b8bba..b2c0f82f1e0 100644
--- a/htdocs/societe/canvas/company/actions_card_company.class.php
+++ b/htdocs/societe/canvas/company/actions_card_company.class.php
@@ -92,7 +92,7 @@ class ActionsCardCompany extends ActionsCardCommon
* Assign custom values for canvas (for example into this->tpl to be used by templates)
*
* @param string $action Type of action
- * @param string $id Id of object
+ * @param integer $id Id of object
* @param string $ref Ref of object
* @return void
*/
diff --git a/htdocs/societe/canvas/individual/actions_card_individual.class.php b/htdocs/societe/canvas/individual/actions_card_individual.class.php
index 2f00cd4bc27..19921b69d81 100644
--- a/htdocs/societe/canvas/individual/actions_card_individual.class.php
+++ b/htdocs/societe/canvas/individual/actions_card_individual.class.php
@@ -92,7 +92,7 @@ class ActionsCardIndividual extends ActionsCardCommon
* Assign custom values for canvas (for example into this->tpl to be used by templates)
*
* @param string $action Type of action
- * @param string $id Id of object
+ * @param integer $id Id of object
* @param string $ref Ref of object
* @return void
*/
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 2df9ba0776f..7e2bdeef3a6 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -1578,7 +1578,7 @@ class Societe extends CommonObject
*
* @param User $user Filtre sur un user auteur des remises
* @param string $filter Filtre autre
- * @param string $maxvalue Filter on max value for discount
+ * @param integer $maxvalue Filter on max value for discount
* @return int <0 if KO, Credit note amount otherwise
*/
function getAvailableDiscounts($user='',$filter='',$maxvalue=0)
@@ -1728,7 +1728,7 @@ class Societe extends CommonObject
* @param int $withpicto Add picto into link (0=No picto, 1=Include picto with link, 2=Picto only)
* @param string $option Target of link ('', 'customer', 'prospect', 'supplier')
* @param int $maxlen Max length of text
- * @param string $notooltip 1=Disable tooltip
+ * @param integer $notooltip 1=Disable tooltip
* @return string String with URL
*/
function getNomUrl($withpicto=0,$option='',$maxlen=0,$notooltip=0)
diff --git a/test/bootstrap.php b/test/bootstrap.php
index 6e80411dca6..27a5be97508 100644
--- a/test/bootstrap.php
+++ b/test/bootstrap.php
@@ -1,3 +1,26 @@
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
.
+ * or see http://www.gnu.org/
+ */
+
+/**
+ * \file test/bootstrap.php
+ * \ingroup test
+ * \brief PHPUnit test
+ * \remarks To make test with phpunit
+ */
+
set_time_limit(0);
-?>