diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 5e99f3fc4a6..2f0cf264529 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -38,7 +38,6 @@ class AccountancyCategory // extends CommonObject /** * @var string Error string - * @see $errors */ public $error; diff --git a/htdocs/core/class/openid.class.php b/htdocs/core/class/openid.class.php index e4fe7843d1d..7fcb2a9cdb4 100644 --- a/htdocs/core/class/openid.class.php +++ b/htdocs/core/class/openid.class.php @@ -158,7 +158,7 @@ class SimpleOpenID }else{ $identity = $u['scheme'] . '://' . $u['host'] . $u['path']; } - //*/ + */ $this->openid_url_identity = $a; } diff --git a/htdocs/core/modules/export/export_excel2007new.modules.php b/htdocs/core/modules/export/export_excel2007new.modules.php index 09a93f3d60f..3d27f78b39d 100644 --- a/htdocs/core/modules/export/export_excel2007new.modules.php +++ b/htdocs/core/modules/export/export_excel2007new.modules.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/core/modules/export/export_excelnew.modules.php + * \file htdocs/core/modules/export/export_excel2007new.modules.php * \ingroup export * \brief File of class to generate export file with Excel format */ diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index 558744d87e8..9ccf3757b80 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -10,8 +10,8 @@ */ /** - * \file advtargetingemaling/modules/mailings/advthirdparties.modules.php - * \ingroup advtargetingemaling + * \file htdocs/core/modules/mailings/advthirdparties.modules.php + * \ingroup mailing * \brief Example file to provide a list of recipients for mailing module */ diff --git a/htdocs/core/modules/modBom.class.php b/htdocs/core/modules/modBom.class.php index 98b1e7659ec..5de876f2fb1 100644 --- a/htdocs/core/modules/modBom.class.php +++ b/htdocs/core/modules/modBom.class.php @@ -21,7 +21,7 @@ * \defgroup bom Module Bom * \brief Bom module descriptor. * - * \file htdocs/bom/core/modules/modBom.class.php + * \file htdocs/core/modules/modBom.class.php * \ingroup bom * \brief Description and activation file for module Bom */ diff --git a/htdocs/core/modules/modDataPolicy.class.php b/htdocs/core/modules/modDataPolicy.class.php index c5169c7f6d1..58ce388e78e 100644 --- a/htdocs/core/modules/modDataPolicy.class.php +++ b/htdocs/core/modules/modDataPolicy.class.php @@ -21,7 +21,7 @@ * \defgroup datapolicy Module datapolicy * \brief datapolicy module descriptor. * - * \file htdocs/datapolicy/core/modules/modDataPolicy.class.php + * \file htdocs/core/modules/modDataPolicy.class.php * \ingroup datapolicy * \brief Description and activation file for module DATAPOLICY */ diff --git a/htdocs/core/modules/modEmailCollector.class.php b/htdocs/core/modules/modEmailCollector.class.php index 0b02576f5d4..6e34440a4cd 100644 --- a/htdocs/core/modules/modEmailCollector.class.php +++ b/htdocs/core/modules/modEmailCollector.class.php @@ -19,7 +19,7 @@ * \defgroup emailcollector Module emailcollector * \brief emailcollector module descriptor. * - * \file htdocs/emailcollector/core/modules/modEmailCollector.class.php + * \file htdocs/core/modules/modEmailCollector.class.php * \ingroup emailcollector * \brief Description and activation file for module emailcollector */ diff --git a/htdocs/core/modules/modIncoterm.class.php b/htdocs/core/modules/modIncoterm.class.php index f27db640a3a..2d3c79281b7 100644 --- a/htdocs/core/modules/modIncoterm.class.php +++ b/htdocs/core/modules/modIncoterm.class.php @@ -18,11 +18,10 @@ */ /** - * \defgroup mymodule Module MyModule - * \brief Example of a module descriptor. - * Such a file must be copied into htdocs/mymodule/core/modules directory. - * \file htdocs/mymodule/core/modules/modMyModule.class.php - * \ingroup mymodule + * \defgroup incoterm Module MyModule + * + * \file htdocs/core/modules/modIncoterm.class.php + * \ingroup incoterm * \brief Description and activation file for module MyModule */ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modMrp.class.php b/htdocs/core/modules/modMrp.class.php index e66814d5fc1..d4d9d9c5140 100644 --- a/htdocs/core/modules/modMrp.class.php +++ b/htdocs/core/modules/modMrp.class.php @@ -19,10 +19,10 @@ */ /** - * \defgroup mrp Module Mrp + * \defgroup mrp Module Mrp * \brief Mrp module descriptor. * - * \file htdocs/mrp/core/modules/modMrp.class.php + * \file htdocs/core/modules/modMrp.class.php * \ingroup mrp * \brief Description and activation file for module Mrp */ diff --git a/htdocs/core/modules/modTakePos.class.php b/htdocs/core/modules/modTakePos.class.php index 7024a151bb9..b5f79f79d8d 100644 --- a/htdocs/core/modules/modTakePos.class.php +++ b/htdocs/core/modules/modTakePos.class.php @@ -20,7 +20,7 @@ * \defgroup takepos Module TakePos * \brief TakePos module descriptor. * - * \file htdocs/takepos/core/modules/modTakePos.class.php + * \file htdocs/core/modules/modTakePos.class.php * \ingroup takepos * \brief Description and activation file for module TakePos */ diff --git a/htdocs/core/modules/printing/modules_printing.php b/htdocs/core/modules/printing/modules_printing.php index ab3a50e0989..99a24bfa6b5 100644 --- a/htdocs/core/modules/printing/modules_printing.php +++ b/htdocs/core/modules/printing/modules_printing.php @@ -18,7 +18,7 @@ */ /** - * \file htdocs/core/modules/mailings/modules_printing.php + * \file htdocs/core/modules/printing/modules_printing.php * \ingroup printing * \brief File with parent class of printing modules */ diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index f9b0d1b106c..e8b97224aad 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/core/modules/supplier_invoice/doc/pdf_standard.modules.php + * \file htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php * \ingroup fournisseur * \brief Class file to generate the supplier invoice payment file with the standard model */ diff --git a/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php b/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php index 561af243386..1bc34d41bce 100644 --- a/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php +++ b/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/core/modules/payment/mod_payment_bronan.php + * \file htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php * \ingroup supplier_payment * \brief File containing class for numbering module Bronan */ diff --git a/htdocs/don/payment/payment.php b/htdocs/don/payment/payment.php index 3fed9dd165f..3bbbf9b35ca 100644 --- a/htdocs/don/payment/payment.php +++ b/htdocs/don/payment/payment.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/don/payment.php + * \file htdocs/don/payment/payment.php * \ingroup donations * \brief Page to add payment of a donation */ diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index a88ecd57d7c..01f6228ad83 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Francis Appels - * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2019 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ */ /** - * \file ecm/ecmfiles.class.php + * \file htdocs/ecm/class/ecmfiles.class.php * \ingroup ecm * \brief Class to manage ECM Files (Create/Read/Update/Delete) */ diff --git a/htdocs/expedition/class/api_shipments.class.php b/htdocs/expedition/class/api_shipments.class.php index d1cb1484688..5aca14fb28d 100644 --- a/htdocs/expedition/class/api_shipments.class.php +++ b/htdocs/expedition/class/api_shipments.class.php @@ -208,15 +208,15 @@ class Shipments extends DolibarrApi return $this->shipment->id; } - /** - * Get lines of an shipment - * - * @param int $id Id of shipment - * - * @url GET {id}/lines - * - * @return int - */ + // /** + // * Get lines of an shipment + // * + // * @param int $id Id of shipment + // * + // * @url GET {id}/lines + // * + // * @return int + // */ /* public function getLines($id) { @@ -241,16 +241,16 @@ class Shipments extends DolibarrApi } */ - /** - * Add a line to given shipment - * - * @param int $id Id of shipment to update - * @param array $request_data ShipmentLine data - * - * @url POST {id}/lines - * - * @return int - */ + // /** + // * Add a line to given shipment + // * + // * @param int $id Id of shipment to update + // * @param array $request_data ShipmentLine data + // * + // * @url POST {id}/lines + // * + // * @return int + // */ /* public function postLine($id, $request_data = null) { @@ -303,17 +303,17 @@ class Shipments extends DolibarrApi return false; }*/ - /** - * Update a line to given shipment - * - * @param int $id Id of shipment to update - * @param int $lineid Id of line to update - * @param array $request_data ShipmentLine data - * - * @url PUT {id}/lines/{lineid} - * - * @return object - */ + // /** + // * Update a line to given shipment + // * + // * @param int $id Id of shipment to update + // * @param int $lineid Id of line to update + // * @param array $request_data ShipmentLine data + // * + // * @url PUT {id}/lines/{lineid} + // * + // * @return object + // */ /* public function putLine($id, $lineid, $request_data = null) { @@ -486,7 +486,7 @@ class Shipments extends DolibarrApi * @url POST {id}/validate * * @return array - * FIXME An error 403 is returned if the request has an empty body. + * \todo An error 403 is returned if the request has an empty body. * Error message: "Forbidden: Content type `text/plain` is not supported." * Workaround: send this in the body * { @@ -528,20 +528,20 @@ class Shipments extends DolibarrApi } - /** - * Classify the shipment as invoiced - * - * @param int $id Id of the shipment - * - * @url POST {id}/setinvoiced - * - * @return int - * - * @throws 400 - * @throws 401 - * @throws 404 - * @throws 405 - */ + // /** + // * Classify the shipment as invoiced + // * + // * @param int $id Id of the shipment + // * + // * @url POST {id}/setinvoiced + // * + // * @return int + // * + // * @throws 400 + // * @throws 401 + // * @throws 404 + // * @throws 405 + // */ /* public function setinvoiced($id) { @@ -566,19 +566,19 @@ class Shipments extends DolibarrApi */ - /** - * Create a shipment using an existing order. - * - * @param int $orderid Id of the order - * - * @url POST /createfromorder/{orderid} - * - * @return int - * @throws 400 - * @throws 401 - * @throws 404 - * @throws 405 - */ + // /** + // * Create a shipment using an existing order. + // * + // * @param int $orderid Id of the order + // * + // * @url POST /createfromorder/{orderid} + // * + // * @return int + // * @throws 400 + // * @throws 401 + // * @throws 404 + // * @throws 405 + // */ /* public function createShipmentFromOrder($orderid) { diff --git a/htdocs/product/stock/class/productstockentrepot.class.php b/htdocs/product/stock/class/productstockentrepot.class.php index a53b669c183..7937bc560bb 100644 --- a/htdocs/product/stock/class/productstockentrepot.class.php +++ b/htdocs/product/stock/class/productstockentrepot.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2014-2016 Juanjo Menent * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2019 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ */ /** - * \file ProductEntrepot/ProductStockEntrepot.class.php + * \file htdocs/product/stock/class/productstockentrepot.class.php * \ingroup ProductEntrepot * \brief This file is an example for a CRUD class file (Create/Read/Update/Delete) * Put some comments here diff --git a/htdocs/projet/class/api_tasks.class.php b/htdocs/projet/class/api_tasks.class.php index 7dc9e5ccd52..d7448931086 100644 --- a/htdocs/projet/class/api_tasks.class.php +++ b/htdocs/projet/class/api_tasks.class.php @@ -163,6 +163,7 @@ class Tasks extends DolibarrApi { $num = $db->num_rows($result); $min = min($num, ($limit <= 0 ? $num : $limit)); + $i = 0; while ($i < $min) { $obj = $db->fetch_object($result); @@ -213,14 +214,14 @@ class Tasks extends DolibarrApi return $this->task->id; } - /** - * Get time spent of a task - * - * @param int $id Id of task - * @return int - * - * @url GET {id}/tasks - */ + // /** + // * Get time spent of a task + // * + // * @param int $id Id of task + // * @return int + // * + // * @url GET {id}/tasks + // */ /* public function getLines($id, $includetimespent=0) { @@ -297,16 +298,16 @@ class Tasks extends DolibarrApi } - /** - * Add a task to given project - * - * @param int $id Id of project to update - * @param array $request_data Projectline data - * - * @url POST {id}/tasks - * - * @return int - */ + // /** + // * Add a task to given project + // * + // * @param int $id Id of project to update + // * @param array $request_data Projectline data + // * + // * @url POST {id}/tasks + // * + // * @return int + // */ /* public function postLine($id, $request_data = null) { @@ -359,17 +360,17 @@ class Tasks extends DolibarrApi } */ - /** - * Update a task to given project - * - * @param int $id Id of project to update - * @param int $taskid Id of task to update - * @param array $request_data Projectline data - * - * @url PUT {id}/tasks/{taskid} - * - * @return object - */ + // /** + // * Update a task to given project + // * + // * @param int $id Id of project to update + // * @param int $taskid Id of task to update + // * @param array $request_data Projectline data + // * + // * @url PUT {id}/tasks/{taskid} + // * + // * @return object + // */ /* public function putLine($id, $lineid, $request_data = null) { @@ -616,6 +617,6 @@ class Tasks extends DolibarrApi } - // TODO + // \todo // getSummaryOfTimeSpent } diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 7ffc0908c4e..21bc9e3c3c3 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -21,7 +21,7 @@ */ /** - * \file htdocs/public/onlinesign/newsign.php + * \file htdocs/public/onlinesign/newonlinesign.php * \ingroup core * \brief File to offer a way to make an online signature for a particular Dolibarr entity */ diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index d0f85eb9fe2..db7ae3c30ff 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -1,7 +1,7 @@ - * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018 Frédéric France +/* Copyright (C) 2013-2014 Jean-François Ferry + * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2018-2019 Frédéric France * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ */ /** - * \file resource/index.php + * \file htdocs/resource/list.php * \ingroup resource * \brief Page to manage resource objects */ diff --git a/htdocs/salaries/admin/salaries.php b/htdocs/salaries/admin/salaries.php index db97de6a21a..ebb301f00e1 100644 --- a/htdocs/salaries/admin/salaries.php +++ b/htdocs/salaries/admin/salaries.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/admin/salaries.php + * \file htdocs/salaries/admin/salaries.php * \ingroup Salaries * \brief Setup page to configure salaries module */ diff --git a/htdocs/salaries/admin/salaries_extrafields.php b/htdocs/salaries/admin/salaries_extrafields.php index f04937b59f4..2ea9ba62919 100644 --- a/htdocs/salaries/admin/salaries_extrafields.php +++ b/htdocs/salaries/admin/salaries_extrafields.php @@ -18,7 +18,7 @@ */ /** - * \file htdocs/admin/salaries_extrafields.php + * \file htdocs/salaries/admin/salaries_extrafields.php * \ingroup member * \brief Page to setup extra fields of salaries */ diff --git a/htdocs/variants/class/ProductAttribute.class.php b/htdocs/variants/class/ProductAttribute.class.php index 3ccdb6dbf03..80923a70f4b 100644 --- a/htdocs/variants/class/ProductAttribute.class.php +++ b/htdocs/variants/class/ProductAttribute.class.php @@ -36,7 +36,7 @@ class ProductAttribute /** * Ref of the product attribute - * @var + * @var string */ public $ref; diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 5c2bf40aa03..2f78e66c22d 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -20,7 +20,7 @@ */ /** - * \file website/website.class.php + * \file htdocs/website/class/website.class.php * \ingroup website * \brief File for the CRUD class of website (Create/Read/Update/Delete) */ diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index abdb8d323eb..1661044401a 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -19,7 +19,7 @@ */ /** - * \file website/websitepage.class.php + * \file htdocs/website/class/websitepage.class.php * \ingroup website * \brief File for the CRUD class of websitepage (Create/Read/Update/Delete) */ diff --git a/htdocs/zapier/class/api_zapier.class.php b/htdocs/zapier/class/api_zapier.class.php index 638b02c0c58..49674758e1b 100644 --- a/htdocs/zapier/class/api_zapier.class.php +++ b/htdocs/zapier/class/api_zapier.class.php @@ -23,7 +23,7 @@ dol_include_once('/zapier/class/hook.class.php'); /** - * \file htdocs/modulebuilder/template/class/api_zapier.class.php + * \file htdocs/zapier/class/api_zapier.class.php * \ingroup zapier * \brief File for API management of hook. */ diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php index fdc7aba2bc9..31dd57a11a2 100644 --- a/htdocs/zapier/class/hook.class.php +++ b/htdocs/zapier/class/hook.class.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/modulebuilder/template/class/hook.class.php + * \file htdocs/zapier/class/hook.class.php * \ingroup zapier * \brief This file is a CRUD class file for Hook (Create/Read/Update/Delete) */ diff --git a/htdocs/zapier/hook_agenda.php b/htdocs/zapier/hook_agenda.php index 3d5c789c2b1..d445bc15638 100644 --- a/htdocs/zapier/hook_agenda.php +++ b/htdocs/zapier/hook_agenda.php @@ -17,26 +17,13 @@ */ /** - * \file htdocs/modulebuilder/template/myobject_agenda.php + * \file htdocs/zapier/hook_agenda.php * \ingroup mymodule * \brief Page of MyObject events */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; } -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) $res = @include "../main.inc.php"; -if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php"; -if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php"; -if (!$res) die("Include of main fails"); - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; diff --git a/htdocs/zapier/hook_card.php b/htdocs/zapier/hook_card.php index a2d82904f58..94296627aca 100644 --- a/htdocs/zapier/hook_card.php +++ b/htdocs/zapier/hook_card.php @@ -17,46 +17,13 @@ */ /** - * \file htdocs/modulebuilder/template/myobject_card.php + * \file htdocs/zapier/myobject_card.php * \ingroup mymodule * \brief Page to create/edit/view myobject */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK','1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT','auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE','aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN',1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP','none'); // Disable all Content Security Policies - - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; } -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) $res = @include "../main.inc.php"; -if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php"; -if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php"; -if (!$res) die("Include of main fails"); - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; dol_include_once('/mymodule/class/myobject.class.php'); diff --git a/htdocs/zapier/hook_document.php b/htdocs/zapier/hook_document.php index 966a2b138cf..bedb4eb3590 100644 --- a/htdocs/zapier/hook_document.php +++ b/htdocs/zapier/hook_document.php @@ -17,26 +17,13 @@ */ /** - * \file htdocs/modulebuilder/template/myobject_document.php + * \file htdocs/zapier/myobject_document.php * \ingroup mymodule * \brief Tab for documents linked to MyObject */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; } -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) $res = @include "../main.inc.php"; -if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php"; -if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php"; -if (!$res) die("Include of main fails"); - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; diff --git a/htdocs/zapier/hook_list.php b/htdocs/zapier/hook_list.php index a49c0655b80..25864a7e35a 100644 --- a/htdocs/zapier/hook_list.php +++ b/htdocs/zapier/hook_list.php @@ -1,6 +1,6 @@ - * Copyright (C) ---Put here your own copyright and developer email--- +/* Copyright (C) 2007-2017 Laurent Destailleur + * Copyright (C) 2019 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,45 +17,14 @@ */ /** - * \file htdocs/modulebuilder/template/hook_list.php - * \ingroup mymodule + * \file htdocs/zapier/hook_list.php + * \ingroup zapier * \brief List page for hook */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data -//if (! defined('NOIPCHECK')) define('NOIPCHECK','1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT','auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE','aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN',1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("XFRAMEOPTIONS_ALLOWALL")) define('XFRAMEOPTIONS_ALLOWALL',1); // Do not add the HTTP header 'X-Frame-Options: SAMEORIGIN' but 'X-Frame-Options: ALLOWALL' // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; } -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) $res = @include "../main.inc.php"; -if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php"; -if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php"; -if (!$res) die("Include of main fails"); - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; diff --git a/htdocs/zapier/hook_note.php b/htdocs/zapier/hook_note.php index abb66fd6f38..11ad5efa9f2 100644 --- a/htdocs/zapier/hook_note.php +++ b/htdocs/zapier/hook_note.php @@ -23,20 +23,7 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; } -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) $res = @include "../main.inc.php"; -if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php"; -if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php"; -if (!$res) die("Include of main fails"); - +require '../main.inc.php'; dol_include_once('/mymodule/class/myobject.class.php'); dol_include_once('/mymodule/lib/mymodule_myobject.lib.php'); diff --git a/htdocs/zapier/zapierindex.php b/htdocs/zapier/zapierindex.php index f9931a29d41..77a9d5b4112 100644 --- a/htdocs/zapier/zapierindex.php +++ b/htdocs/zapier/zapierindex.php @@ -19,36 +19,23 @@ */ /** - * \file htdocs/zapierfordolibarr/template/zapierfordolibarrindex.php - * \ingroup zapierfordolibarr - * \brief Home page of zapierfordolibarr top menu + * \file htdocs/zapier/zapierindex.php + * \ingroup zapier + * \brief Home page of zapier top menu */ // Load Dolibarr environment -$res=0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; -while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } -if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php"; -if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php"; -// Try main.inc.php using relative path -if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php"; -if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php"; -if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php"; -if (! $res) die("Include of main fails"); - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; // Load translation files required by the page -$langs->loadLangs(array("zapierfordolibarr@zapierfordolibarr")); +$langs->loadLangs(array("zapier@zapier")); $action=GETPOST('action', 'alpha'); // Securite acces client -if (! $user->rights->zapierfordolibarr->read) accessforbidden(); +if (! $user->rights->zapier->read) accessforbidden(); $socid=GETPOST('socid', 'int'); if (isset($user->socid) && $user->socid > 0) { @@ -76,14 +63,14 @@ $formfile = new FormFile($db); llxHeader("", $langs->trans("ZapierForDolibarrArea")); -print load_fiche_titre($langs->trans("ZapierForDolibarrArea"), '', 'zapierfordolibarr.png@zapierfordolibarr'); +print load_fiche_titre($langs->trans("ZapierForDolibarrArea"), '', 'zapier.png@zapier'); print '
'; /* BEGIN MODULEBUILDER DRAFT MYOBJECT // Draft MyObject -if (! empty($conf->zapierfordolibarr->enabled) && $user->rights->zapierfordolibarr->read) +if (! empty($conf->zapier->enabled) && $user->rights->zapier->read) { $langs->load("orders"); @@ -169,7 +156,7 @@ $max=3; /* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT // Last modified myobject -if (! empty($conf->zapierfordolibarr->enabled) && $user->rights->zapierfordolibarr->read) +if (! empty($conf->zapier->enabled) && $user->rights->zapier->read) { $sql = "SELECT s.rowid, s.nom as name, s.client, s.datec, s.tms, s.canvas"; $sql.= ", s.code_client"; diff --git a/scripts/accountancy/export-thirdpartyaccount.php b/scripts/accountancy/export-thirdpartyaccount.php index b03f397fd7e..9399066078f 100755 --- a/scripts/accountancy/export-thirdpartyaccount.php +++ b/scripts/accountancy/export-thirdpartyaccount.php @@ -20,7 +20,7 @@ */ /** - * \file htdocs/accountancy/admin/export-thirdpartyaccount.php + * \file scripts/accountancy/export-thirdpartyaccount.php * \ingroup Accounting Expert * \brief Page to detect empty accounting account */ diff --git a/scripts/members/sync_members_types_dolibarr2ldap.php b/scripts/members/sync_members_types_dolibarr2ldap.php index a1a41398841..2665a0c828b 100755 --- a/scripts/members/sync_members_types_dolibarr2ldap.php +++ b/scripts/members/sync_members_types_dolibarr2ldap.php @@ -20,7 +20,7 @@ */ /** - * \file scripts/user/sync_members_types_dolibarr2ldap.php + * \file scripts/members/sync_members_types_dolibarr2ldap.php * \ingroup ldap core * \brief Script de mise a jour des types de membres dans LDAP depuis base Dolibarr */ diff --git a/scripts/members/sync_members_types_ldap2dolibarr.php b/scripts/members/sync_members_types_ldap2dolibarr.php index 598b9e5502c..06e96aa44ae 100755 --- a/scripts/members/sync_members_types_ldap2dolibarr.php +++ b/scripts/members/sync_members_types_ldap2dolibarr.php @@ -21,7 +21,7 @@ */ /** - * \file scripts/user/sync_members_types_ldap2dolibarr.php + * \file scripts/members/sync_members_types_ldap2dolibarr.php * \ingroup ldap member * \brief Script to update members types into Dolibarr from LDAP */