Lowercase NULL, TRUE, FALSE according to PSR2
This commit is contained in:
parent
c702c88fde
commit
0d0da234b1
@ -118,9 +118,9 @@ class PrestaShopWebservice
|
||||
public function executeRequest($url, $curl_params = array())
|
||||
{
|
||||
$defaultParams = array(
|
||||
CURLOPT_HEADER => TRUE,
|
||||
CURLOPT_RETURNTRANSFER => TRUE,
|
||||
CURLINFO_HEADER_OUT => TRUE,
|
||||
CURLOPT_HEADER => true,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLINFO_HEADER_OUT => true,
|
||||
CURLOPT_HTTPAUTH => CURLAUTH_BASIC,
|
||||
CURLOPT_USERPWD => $this->key.':',
|
||||
CURLOPT_HTTPHEADER => array( 'Expect:' )
|
||||
|
||||
@ -280,7 +280,7 @@ function backup_tables($outputfile, $tables='*')
|
||||
|
||||
//cycle through
|
||||
$handle = fopen($outputfile, 'w+');
|
||||
if (fwrite($handle, '') === FALSE)
|
||||
if (fwrite($handle, '') === false)
|
||||
{
|
||||
$langs->load("errors");
|
||||
dol_syslog("Failed to open file ".$outputfile,LOG_ERR);
|
||||
|
||||
@ -170,7 +170,7 @@ class Setup extends DolibarrApi
|
||||
// and then apply the filter if there is one.
|
||||
$this->translateLabel($country, $lang);
|
||||
|
||||
if (empty($filter) || stripos($country->label, $filter) !== FALSE) {
|
||||
if (empty($filter) || stripos($country->label, $filter) !== false) {
|
||||
$list[] = $this->_cleanObjectDatas($country);
|
||||
}
|
||||
}
|
||||
|
||||
@ -292,7 +292,7 @@ class Facturation
|
||||
else if ( $aId == 'RESET' )
|
||||
{
|
||||
|
||||
$this->id = NULL;
|
||||
$this->id = null;
|
||||
|
||||
}
|
||||
else
|
||||
@ -318,7 +318,7 @@ class Facturation
|
||||
}
|
||||
else if ( $aRef == 'RESET' )
|
||||
{
|
||||
$this->ref = NULL;
|
||||
$this->ref = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -342,7 +342,7 @@ class Facturation
|
||||
else if ( $aQte == 'RESET' )
|
||||
{
|
||||
|
||||
$this->qte = NULL;
|
||||
$this->qte = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -366,7 +366,7 @@ class Facturation
|
||||
}
|
||||
else if ( $aStock == 'RESET' )
|
||||
{
|
||||
$this->stock = NULL;
|
||||
$this->stock = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -390,7 +390,7 @@ class Facturation
|
||||
}
|
||||
else if ($aRemisePercent == 'RESET')
|
||||
{
|
||||
$this->remise_percent = NULL;
|
||||
$this->remise_percent = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -414,7 +414,7 @@ class Facturation
|
||||
|
||||
} else if ( $aMontantRemise == 'RESET' ) {
|
||||
|
||||
$this->montant_remise = NULL;
|
||||
$this->montant_remise = null;
|
||||
|
||||
} else {
|
||||
|
||||
@ -439,7 +439,7 @@ class Facturation
|
||||
|
||||
} else if ( $aPrix == 'RESET' ) {
|
||||
|
||||
$this->prix = NULL;
|
||||
$this->prix = null;
|
||||
|
||||
} else {
|
||||
|
||||
@ -463,7 +463,7 @@ class Facturation
|
||||
|
||||
} else if ( $aTva == 'RESET' ) {
|
||||
|
||||
$this->tva = NULL;
|
||||
$this->tva = null;
|
||||
|
||||
} else {
|
||||
|
||||
@ -487,7 +487,7 @@ class Facturation
|
||||
|
||||
} else if ( $aNumFacture == 'RESET' ) {
|
||||
|
||||
$this->num_facture = NULL;
|
||||
$this->num_facture = null;
|
||||
|
||||
} else {
|
||||
|
||||
@ -511,7 +511,7 @@ class Facturation
|
||||
|
||||
} else if ( $aModeReglement == 'RESET' ) {
|
||||
|
||||
$this->mode_reglement = NULL;
|
||||
$this->mode_reglement = null;
|
||||
|
||||
} else {
|
||||
|
||||
@ -536,7 +536,7 @@ class Facturation
|
||||
|
||||
} else if ( $aMontantEncaisse == 'RESET' ) {
|
||||
|
||||
$this->montant_encaisse = NULL;
|
||||
$this->montant_encaisse = null;
|
||||
|
||||
} else {
|
||||
|
||||
@ -560,7 +560,7 @@ class Facturation
|
||||
return $this->montant_rendu;
|
||||
} else if ( $aMontantRendu == 'RESET' ) {
|
||||
|
||||
$this->montant_rendu = NULL;
|
||||
$this->montant_rendu = null;
|
||||
|
||||
} else {
|
||||
|
||||
@ -584,7 +584,7 @@ class Facturation
|
||||
|
||||
} else if ( $aPaiementLe == 'RESET' ) {
|
||||
|
||||
$this->paiement_le = NULL;
|
||||
$this->paiement_le = null;
|
||||
|
||||
} else {
|
||||
|
||||
@ -607,7 +607,7 @@ class Facturation
|
||||
|
||||
} else if ( $aTotalHt == 'RESET' ) {
|
||||
|
||||
$this->prix_total_ht = NULL;
|
||||
$this->prix_total_ht = null;
|
||||
|
||||
} else {
|
||||
|
||||
@ -630,7 +630,7 @@ class Facturation
|
||||
|
||||
} else if ( $aMontantTva == 'RESET' ) {
|
||||
|
||||
$this->montant_tva = NULL;
|
||||
$this->montant_tva = null;
|
||||
|
||||
} else {
|
||||
|
||||
@ -654,7 +654,7 @@ class Facturation
|
||||
}
|
||||
else if ( $aTotalTtc == 'RESET' )
|
||||
{
|
||||
$this->prix_total_ttc = NULL;
|
||||
$this->prix_total_ttc = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -172,7 +172,7 @@ class Categories extends DolibarrApi
|
||||
* @param array $request_data Request data
|
||||
* @return int ID of category
|
||||
*/
|
||||
function post($request_data = NULL)
|
||||
function post($request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->categorie->creer) {
|
||||
throw new RestException(401);
|
||||
@ -197,7 +197,7 @@ class Categories extends DolibarrApi
|
||||
* @param array $request_data Datas
|
||||
* @return int
|
||||
*/
|
||||
function put($id, $request_data = NULL)
|
||||
function put($id, $request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->categorie->creer) {
|
||||
throw new RestException(401);
|
||||
|
||||
@ -187,7 +187,7 @@ class AgendaEvents extends DolibarrApi
|
||||
* @param array $request_data Request data
|
||||
* @return int ID of Agenda Event
|
||||
*/
|
||||
function post($request_data = NULL)
|
||||
function post($request_data = null)
|
||||
{
|
||||
if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) {
|
||||
throw new RestException(401, "Insuffisant rights to create your Agenda Event");
|
||||
@ -226,7 +226,7 @@ class AgendaEvents extends DolibarrApi
|
||||
* @return int
|
||||
*/
|
||||
/*
|
||||
function put($id, $request_data = NULL) {
|
||||
function put($id, $request_data = null) {
|
||||
if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) {
|
||||
throw new RestException(401, "Insuffisant rights to create your Agenda Event");
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ class Proposals extends DolibarrApi
|
||||
* @param array $request_data Request data
|
||||
* @return int ID of proposal
|
||||
*/
|
||||
function post($request_data = NULL)
|
||||
function post($request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
||||
throw new RestException(401, "Insuffisant rights");
|
||||
@ -241,7 +241,7 @@ class Proposals extends DolibarrApi
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function postLine($id, $request_data = NULL)
|
||||
function postLine($id, $request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
||||
throw new RestException(401);
|
||||
@ -307,7 +307,7 @@ class Proposals extends DolibarrApi
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
function putLine($id, $lineid, $request_data = NULL)
|
||||
function putLine($id, $lineid, $request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
||||
throw new RestException(401);
|
||||
@ -410,7 +410,7 @@ class Proposals extends DolibarrApi
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function put($id, $request_data = NULL) {
|
||||
function put($id, $request_data = null) {
|
||||
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
@ -179,7 +179,7 @@ class Orders extends DolibarrApi
|
||||
* @param array $request_data Request data
|
||||
* @return int ID of order
|
||||
*/
|
||||
function post($request_data = NULL)
|
||||
function post($request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->commande->creer) {
|
||||
throw new RestException(401, "Insuffisant rights");
|
||||
@ -245,7 +245,7 @@ class Orders extends DolibarrApi
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function postLine($id, $request_data = NULL) {
|
||||
function postLine($id, $request_data = null) {
|
||||
if(! DolibarrApiAccess::$user->rights->commande->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
@ -308,7 +308,7 @@ class Orders extends DolibarrApi
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
function putLine($id, $lineid, $request_data = NULL) {
|
||||
function putLine($id, $lineid, $request_data = null) {
|
||||
if(! DolibarrApiAccess::$user->rights->commande->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
@ -402,7 +402,7 @@ class Orders extends DolibarrApi
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function put($id, $request_data = NULL) {
|
||||
function put($id, $request_data = null) {
|
||||
if (! DolibarrApiAccess::$user->rights->commande->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
@ -823,7 +823,7 @@ class Commande extends CommonOrder
|
||||
$line = $this->lines[$i];
|
||||
|
||||
// Test and convert into object this->lines[$i]. When coming from REST API, we may still have an array
|
||||
//if (! is_object($line)) $line=json_decode(json_encode($line), FALSE); // convert recursively array into object.
|
||||
//if (! is_object($line)) $line=json_decode(json_encode($line), false); // convert recursively array into object.
|
||||
if (! is_object($line)) $line = (object) $line;
|
||||
|
||||
// Reset fk_parent_line for no child products and special product
|
||||
|
||||
@ -196,7 +196,7 @@ class Invoices extends DolibarrApi
|
||||
* @param array $request_data Request datas
|
||||
* @return int ID of invoice
|
||||
*/
|
||||
function post($request_data = NULL)
|
||||
function post($request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
||||
throw new RestException(401, "Insuffisant rights");
|
||||
@ -313,7 +313,7 @@ class Invoices extends DolibarrApi
|
||||
* @throws 401
|
||||
* @throws 404
|
||||
*/
|
||||
function putLine($id, $lineid, $request_data = NULL) {
|
||||
function putLine($id, $lineid, $request_data = null) {
|
||||
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
@ -414,7 +414,7 @@ class Invoices extends DolibarrApi
|
||||
* @param array $request_data Datas
|
||||
* @return int
|
||||
*/
|
||||
function put($id, $request_data = NULL)
|
||||
function put($id, $request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
||||
throw new RestException(401);
|
||||
@ -499,7 +499,7 @@ class Invoices extends DolibarrApi
|
||||
* @throws 404
|
||||
* @throws 400
|
||||
*/
|
||||
function postLine($id, $request_data = NULL) {
|
||||
function postLine($id, $request_data = null) {
|
||||
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
@ -613,7 +613,7 @@ class Facture extends CommonInvoice
|
||||
$line = $this->lines[$i];
|
||||
|
||||
// Test and convert into object this->lines[$i]. When coming from REST API, we may still have an array
|
||||
//if (! is_object($line)) $line=json_decode(json_encode($line), FALSE); // convert recursively array into object.
|
||||
//if (! is_object($line)) $line=json_decode(json_encode($line), false); // convert recursively array into object.
|
||||
if (! is_object($line)) $line = (object) $line;
|
||||
|
||||
if ($result >= 0)
|
||||
|
||||
@ -182,7 +182,7 @@ class Contracts extends DolibarrApi
|
||||
* @param array $request_data Request data
|
||||
* @return int ID of contrat
|
||||
*/
|
||||
function post($request_data = NULL)
|
||||
function post($request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
||||
throw new RestException(401, "Insuffisant rights");
|
||||
@ -247,7 +247,7 @@ class Contracts extends DolibarrApi
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function postLine($id, $request_data = NULL) {
|
||||
function postLine($id, $request_data = null) {
|
||||
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
@ -300,7 +300,7 @@ class Contracts extends DolibarrApi
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
function putLine($id, $lineid, $request_data = NULL) {
|
||||
function putLine($id, $lineid, $request_data = null) {
|
||||
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
@ -359,7 +359,7 @@ class Contracts extends DolibarrApi
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
function activateLine($id, $lineid, $datestart, $dateend = NULL, $comment = NULL) {
|
||||
function activateLine($id, $lineid, $datestart, $dateend = null, $comment = null) {
|
||||
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
@ -396,7 +396,7 @@ class Contracts extends DolibarrApi
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
function unactivateLine($id, $lineid, $datestart, $comment = NULL) {
|
||||
function unactivateLine($id, $lineid, $datestart, $comment = null) {
|
||||
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
@ -470,7 +470,7 @@ class Contracts extends DolibarrApi
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function put($id, $request_data = NULL) {
|
||||
function put($id, $request_data = null) {
|
||||
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
@ -347,9 +347,9 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
if (!$folder) $folder = "Sent"; // Default Sent folder
|
||||
|
||||
$mailboxconfig->mbox = imap_open($mailboxconfig->get_connector_url().$folder, $mailboxconfig->mailbox_imap_login, $mailboxconfig->mailbox_imap_password);
|
||||
if (FALSE === $mailboxconfig->mbox)
|
||||
if (false === $mailboxconfig->mbox)
|
||||
{
|
||||
$info = FALSE;
|
||||
$info = false;
|
||||
$err = $langs->trans('Error3_Imap_Connection_Error');
|
||||
setEventMessages($err,$mailboxconfig->element, null, 'errors');
|
||||
}
|
||||
|
||||
@ -6644,7 +6644,7 @@ abstract class CommonObject
|
||||
{
|
||||
$this->{$field} = @unserialize($obj->{$field});
|
||||
// Hack for data not in UTF8
|
||||
if($this->{$field } === FALSE) @unserialize(utf8_decode($obj->{$field}));
|
||||
if($this->{$field } === false) @unserialize(utf8_decode($obj->{$field}));
|
||||
}
|
||||
elseif($this->isInt($info))
|
||||
{
|
||||
|
||||
@ -50,7 +50,7 @@ class DolCookie
|
||||
*/
|
||||
function __construct($key = '')
|
||||
{
|
||||
$this->_myKey = hash('sha256', $key, TRUE);
|
||||
$this->_myKey = hash('sha256', $key, true);
|
||||
$this->_iv = md5(md5($this->_myKey));
|
||||
$this->cookie = "";
|
||||
$this->myCookie = "";
|
||||
|
||||
@ -674,7 +674,7 @@ class DolGraph
|
||||
$group->setPadding($paddleft, $paddright); // Width on left and right for Y axis values
|
||||
$group->legend->setSpace(0);
|
||||
$group->legend->setPadding(2,2,2,2);
|
||||
$group->legend->setPosition(NULL,0.1);
|
||||
$group->legend->setPosition(null, 0.1);
|
||||
$group->legend->setBackgroundColor($colorsemitrans);
|
||||
|
||||
if (is_array($this->bgcolorgrid)) $group->grid->setBackgroundColor($bgcolorgrid);
|
||||
@ -734,7 +734,7 @@ class DolGraph
|
||||
$plot->barShadow->setSize($this->SetShading);
|
||||
$plot->barShadow->setPosition(SHADOW_RIGHT_TOP);
|
||||
$plot->barShadow->setColor(new Color(160, 160, 160, 50));
|
||||
$plot->barShadow->smooth(TRUE);
|
||||
$plot->barShadow->smooth(true);
|
||||
//$plot->setSize(1, 0.96);
|
||||
//$plot->setCenter(0.5, 0.52);
|
||||
|
||||
|
||||
@ -225,7 +225,7 @@ class FileUpload
|
||||
* getFileObject
|
||||
*
|
||||
* @param string $file_name Filename
|
||||
* @return stdClass|NULL
|
||||
* @return stdClass|null
|
||||
*/
|
||||
protected function getFileObject($file_name)
|
||||
{
|
||||
|
||||
@ -502,7 +502,7 @@ class Ldap
|
||||
* @param string $newrdn New RDN entry key (uid=qqq)
|
||||
* @param string $newparent New parent (ou=xxx,dc=aaa,dc=bbb)
|
||||
* @param User $user Objet user that modify
|
||||
* @param bool $deleteoldrdn If TRUE the old RDN value(s) is removed, else the old RDN value(s) is retained as non-distinguished values of the entry.
|
||||
* @param bool $deleteoldrdn If true the old RDN value(s) is removed, else the old RDN value(s) is retained as non-distinguished values of the entry.
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function rename($dn, $newrdn, $newparent, $user, $deleteoldrdn = true)
|
||||
|
||||
@ -753,7 +753,7 @@ function xml2php($xml)
|
||||
{
|
||||
//If this element is already in the array we will create an indexed array
|
||||
$tmp = $array[$key];
|
||||
$array[$key] = NULL;
|
||||
$array[$key] = null;
|
||||
$array[$key][] = $tmp;
|
||||
$array[$key][] = $child;
|
||||
$tab = true;
|
||||
|
||||
@ -647,7 +647,7 @@ class SMTPs
|
||||
{
|
||||
/**
|
||||
* Returns constructed SELECT Object string or boolean upon failure
|
||||
* Default value is set at TRUE
|
||||
* Default value is set at true
|
||||
*/
|
||||
$_retVal = true;
|
||||
|
||||
@ -655,7 +655,7 @@ class SMTPs
|
||||
if ( ! empty ($_strConfigPath) )
|
||||
{
|
||||
// If the path is not valid, this will NOT generate an error,
|
||||
// it will simply return FALSE.
|
||||
// it will simply return false.
|
||||
if ( ! @include ( $_strConfigPath ) )
|
||||
{
|
||||
$this->_setErr(110, '"' . $_strConfigPath . '" is not a valid path.');
|
||||
@ -1756,7 +1756,7 @@ class SMTPs
|
||||
{
|
||||
/**
|
||||
* Returns constructed SELECT Object string or boolean upon failure
|
||||
* Default value is set at TRUE
|
||||
* Default value is set at true
|
||||
*/
|
||||
$_retVal = true;
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
|
||||
/**
|
||||
* GetFolders
|
||||
*
|
||||
*
|
||||
* @param string $resourceType Resource type
|
||||
* @param string $currentFolder Current folder
|
||||
* @return void
|
||||
@ -145,7 +145,7 @@ function CreateFolder( $resourceType, $currentFolder )
|
||||
$sNewFolderName = $_GET['NewFolderName'] ;
|
||||
$sNewFolderName = SanitizeFolderName($sNewFolderName);
|
||||
|
||||
if (strpos($sNewFolderName, '..') !== FALSE)
|
||||
if (strpos($sNewFolderName, '..') !== false)
|
||||
$sErrorNumber = '102' ; // Invalid folder name.
|
||||
else
|
||||
{
|
||||
@ -187,7 +187,7 @@ function CreateFolder( $resourceType, $currentFolder )
|
||||
//function FileUpload( $resourceType, $currentFolder, $sCommand )
|
||||
/**
|
||||
* FileUpload
|
||||
*
|
||||
*
|
||||
* @param string $resourceType Resource type
|
||||
* @param string $currentFolder Current folder
|
||||
* @param string $sCommand Command
|
||||
|
||||
@ -32,7 +32,7 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
|
||||
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
|
||||
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
||||
|
||||
session_cache_limiter(FALSE);
|
||||
session_cache_limiter(false);
|
||||
|
||||
require_once '../../main.inc.php';
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
|
||||
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
|
||||
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
||||
|
||||
session_cache_limiter(FALSE);
|
||||
session_cache_limiter(false);
|
||||
|
||||
require_once '../../main.inc.php';
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
|
||||
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
|
||||
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
||||
|
||||
session_cache_limiter(FALSE);
|
||||
session_cache_limiter(false);
|
||||
|
||||
require_once '../../main.inc.php';
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*
|
||||
* Library javascript to enable Browser notifications
|
||||
*/
|
||||
|
||||
@ -34,17 +34,17 @@ if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['H
|
||||
global $langs, $conf;
|
||||
|
||||
top_httphead('text/javascript; charset=UTF-8');
|
||||
|
||||
|
||||
$nowtime = time();
|
||||
//$nowtimeprevious = floor($nowtime / 60) * 60; // auto_check_events_not_before is rounded to previous minute
|
||||
|
||||
// TODO Try to make a solution with only a javascript timer that is easier. Difficulty is to avoid notification twice when.
|
||||
/* session already started into main
|
||||
session_cache_limiter(FALSE);
|
||||
session_cache_limiter(false);
|
||||
header('Cache-Control: no-cache');
|
||||
session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie
|
||||
session_start();*/
|
||||
if (! isset($_SESSION['auto_check_events_not_before']))
|
||||
if (! isset($_SESSION['auto_check_events_not_before']))
|
||||
{
|
||||
print 'console.log("_SESSION[auto_check_events_not_before] is not set");'."\n";
|
||||
// Round to eliminate the seconds
|
||||
@ -65,9 +65,9 @@ if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['H
|
||||
/* Launch timer */
|
||||
// We set a delay before launching first test so next check will arrive after the time_auto_update compared to previous one.
|
||||
var time_first_execution = (time_auto_update - (nowtime - time_js_next_test)) * 1000; //need milliseconds
|
||||
if (login != '') {
|
||||
if (login != '') {
|
||||
console.log("Launch browser notif check: setTimeout is set to launch 'first_execution' function after a wait of time_first_execution="+time_first_execution+". nowtime (time php page generation) = "+nowtime+" auto_check_events_not_before (val in session)= "+auto_check_events_not_before+" time_js_next_test (max now,auto_check_events_not_before) = "+time_js_next_test+" time_auto_update="+time_auto_update);
|
||||
setTimeout(first_execution, time_first_execution);
|
||||
setTimeout(first_execution, time_first_execution);
|
||||
} //first run auto check
|
||||
|
||||
|
||||
@ -88,13 +88,13 @@ if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['H
|
||||
success: function (result) {
|
||||
var arr = JSON.parse(result);
|
||||
if (arr.length > 0) {
|
||||
var audio = null;
|
||||
var audio = null;
|
||||
<?php
|
||||
if (! empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) {
|
||||
print 'audio = new Audio(\''.DOL_URL_ROOT.'/theme/common/sound/notification_agenda.wav'.'\');';
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
$.each(arr, function (index, value) {
|
||||
var url="notdefined";
|
||||
var title="Not defined";
|
||||
@ -102,7 +102,7 @@ if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['H
|
||||
if (value['type'] == 'agenda' && value['location'] != null && value['location'] != '') {
|
||||
body += '\n' + value['location'];
|
||||
}
|
||||
|
||||
|
||||
if (value['type'] == 'agenda')
|
||||
{
|
||||
url = '<?php echo DOL_URL_ROOT.'/comm/action/card.php?id='; ?>' + value['id'];
|
||||
@ -113,10 +113,10 @@ if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['H
|
||||
body: body,
|
||||
tag: value['id']
|
||||
};
|
||||
|
||||
|
||||
// We release the notify
|
||||
var noti = new Notification(title, extra);
|
||||
if (index==0 && audio)
|
||||
if (index==0 && audio)
|
||||
{
|
||||
audio.play();
|
||||
}
|
||||
@ -140,5 +140,5 @@ if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['H
|
||||
time_js_next_test += time_auto_update;
|
||||
console.log('Updated time_js_next_test. New value is '+time_js_next_test);
|
||||
}
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
|
||||
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
|
||||
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
||||
|
||||
session_cache_limiter(FALSE);
|
||||
session_cache_limiter(false);
|
||||
|
||||
require_once '../../main.inc.php';
|
||||
|
||||
|
||||
@ -1949,7 +1949,7 @@ function dol_uncompress($inputfile,$outputdir)
|
||||
dol_syslog("Class ZipArchive is set so we unzip using ZipArchive to unzip into ".$outputdir);
|
||||
$zip = new ZipArchive;
|
||||
$res = $zip->open($inputfile);
|
||||
if ($res === TRUE)
|
||||
if ($res === true)
|
||||
{
|
||||
$zip->extractTo($outputdir.'/');
|
||||
$zip->close();
|
||||
|
||||
@ -272,7 +272,7 @@ function GETPOSTISSET($paramname)
|
||||
* @param string $noreplace Force disable of replacement of __xxx__ strings.
|
||||
* @return string|string[] Value found (string or array), or '' if check fails
|
||||
*/
|
||||
function GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
|
||||
function GETPOST($paramname, $check='none', $method=0, $filter=null, $options=null, $noreplace=0)
|
||||
{
|
||||
global $mysoc,$user,$conf;
|
||||
|
||||
@ -6519,7 +6519,7 @@ function dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensiti
|
||||
else
|
||||
{
|
||||
($case_sensitive) ? natsort($temp) : natcasesort($temp);
|
||||
if($order!='asc') $temp=array_reverse($temp,TRUE);
|
||||
if($order!='asc') $temp=array_reverse($temp, true);
|
||||
}
|
||||
|
||||
$sorted = array();
|
||||
|
||||
@ -65,8 +65,8 @@ function getURLContent($url,$postorget='GET',$param='',$followlocation=1,$addhea
|
||||
//curl_setopt($ch, CURLOPT_SSLVERSION, 6); for tls 1.2
|
||||
|
||||
//turning off the server and peer verification(TrustManager Concept).
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
||||
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, empty($conf->global->MAIN_USE_CONNECT_TIMEOUT)?5:$conf->global->MAIN_USE_CONNECT_TIMEOUT);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT)?30:$conf->global->MAIN_USE_RESPONSE_TIMEOUT);
|
||||
|
||||
@ -244,7 +244,7 @@ class CdavLib
|
||||
*
|
||||
* @param int $calendarId Calendar id
|
||||
* @param int $bCalendarData Add calendar data
|
||||
* @return array|string[][]|unknown[][]|NULL[][]
|
||||
* @return array|string[][]
|
||||
*/
|
||||
public function getFullCalendarObjects($calendarId, $bCalendarData)
|
||||
{
|
||||
|
||||
@ -181,7 +181,7 @@ class Shipments extends DolibarrApi
|
||||
* @param array $request_data Request data
|
||||
* @return int ID of shipment
|
||||
*/
|
||||
function post($request_data = NULL)
|
||||
function post($request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->expedition->creer) {
|
||||
throw new RestException(401, "Insuffisant rights");
|
||||
@ -250,7 +250,7 @@ class Shipments extends DolibarrApi
|
||||
* @return int
|
||||
*/
|
||||
/*
|
||||
function postLine($id, $request_data = NULL) {
|
||||
function postLine($id, $request_data = null) {
|
||||
if(! DolibarrApiAccess::$user->rights->expedition->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
@ -312,7 +312,7 @@ class Shipments extends DolibarrApi
|
||||
* @return object
|
||||
*/
|
||||
/*
|
||||
function putLine($id, $lineid, $request_data = NULL) {
|
||||
function putLine($id, $lineid, $request_data = null) {
|
||||
if(! DolibarrApiAccess::$user->rights->expedition->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
@ -407,7 +407,7 @@ class Shipments extends DolibarrApi
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function put($id, $request_data = NULL) {
|
||||
function put($id, $request_data = null) {
|
||||
if (! DolibarrApiAccess::$user->rights->expedition->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
@ -160,7 +160,7 @@ class ExpenseReports extends DolibarrApi
|
||||
* @param array $request_data Request data
|
||||
* @return int ID of Expense Report
|
||||
*/
|
||||
function post($request_data = NULL)
|
||||
function post($request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
|
||||
throw new RestException(401, "Insuffisant rights");
|
||||
@ -228,7 +228,7 @@ class ExpenseReports extends DolibarrApi
|
||||
* @return int
|
||||
*/
|
||||
/*
|
||||
function postLine($id, $request_data = NULL) {
|
||||
function postLine($id, $request_data = null) {
|
||||
if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
@ -290,7 +290,7 @@ class ExpenseReports extends DolibarrApi
|
||||
* @return object
|
||||
*/
|
||||
/*
|
||||
function putLine($id, $lineid, $request_data = NULL) {
|
||||
function putLine($id, $lineid, $request_data = null) {
|
||||
if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
@ -380,7 +380,7 @@ class ExpenseReports extends DolibarrApi
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function put($id, $request_data = NULL) {
|
||||
function put($id, $request_data = null) {
|
||||
if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
@ -188,7 +188,7 @@ class Interventions extends DolibarrApi
|
||||
* @param array $request_data Request data
|
||||
* @return int ID of intervention
|
||||
*/
|
||||
function post($request_data = NULL)
|
||||
function post($request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->ficheinter->creer) {
|
||||
throw new RestException(401, "Insuffisant rights");
|
||||
@ -249,7 +249,7 @@ class Interventions extends DolibarrApi
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function postLine($id, $request_data = NULL)
|
||||
function postLine($id, $request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->ficheinter->creer) {
|
||||
throw new RestException(401, "Insuffisant rights");
|
||||
|
||||
@ -182,7 +182,7 @@ class SupplierInvoices extends DolibarrApi
|
||||
* @param array $request_data Request datas
|
||||
* @return int ID of supplier invoice
|
||||
*/
|
||||
function post($request_data = NULL)
|
||||
function post($request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->fournisseur->facture->creer) {
|
||||
throw new RestException(401, "Insuffisant rights");
|
||||
@ -218,7 +218,7 @@ class SupplierInvoices extends DolibarrApi
|
||||
* @param array $request_data Datas
|
||||
* @return int
|
||||
*/
|
||||
function put($id, $request_data = NULL)
|
||||
function put($id, $request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->fournisseur->facture->creer) {
|
||||
throw new RestException(401);
|
||||
|
||||
@ -186,7 +186,7 @@ class SupplierOrders extends DolibarrApi
|
||||
* @param array $request_data Request datas
|
||||
* @return int ID of supplier order
|
||||
*/
|
||||
function post($request_data = NULL)
|
||||
function post($request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->fournisseur->commande->creer) {
|
||||
throw new RestException(401, "Insuffisant rights");
|
||||
@ -222,7 +222,7 @@ class SupplierOrders extends DolibarrApi
|
||||
* @param array $request_data Datas
|
||||
* @return int
|
||||
*/
|
||||
function put($id, $request_data = NULL)
|
||||
function put($id, $request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->fournisseur->commande->creer) {
|
||||
throw new RestException(401);
|
||||
|
||||
@ -404,7 +404,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
$line = $this->lines[$i];
|
||||
|
||||
// Test and convert into object this->lines[$i]. When coming from REST API, we may still have an array
|
||||
//if (! is_object($line)) $line=json_decode(json_encode($line), FALSE); // convert recursively array into object.
|
||||
//if (! is_object($line)) $line=json_decode(json_encode($line), false); // convert recursively array into object.
|
||||
if (! is_object($line)) $line = (object) $line;
|
||||
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn)';
|
||||
|
||||
@ -878,7 +878,7 @@ function write_conf_file($conffile)
|
||||
|
||||
$error=0;
|
||||
|
||||
$key = md5(uniqid(mt_rand(),TRUE)); // Generate random hash
|
||||
$key = md5(uniqid(mt_rand(), true)); // Generate random hash
|
||||
|
||||
$fp = fopen("$conffile", "w");
|
||||
if($fp)
|
||||
|
||||
@ -28,7 +28,7 @@ $default_sale_price = "150000";
|
||||
$default_annual_interest_percent = 7.0;
|
||||
$default_year_term = 30;
|
||||
$default_down_percent = 10;
|
||||
$default_show_progress = TRUE;
|
||||
$default_show_progress = true;
|
||||
|
||||
/* --------------------------------------------------- *
|
||||
* Initialize Variables
|
||||
@ -241,7 +241,7 @@ if ($form_complete && $monthly_payment)
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
*/
|
||||
|
||||
|
||||
print '<tr valign="top" bgcolor="#9999FF">';
|
||||
print '<td align="right">TOTAL Monthly Payment:</td>';
|
||||
print '<td><b>' . number_format(($monthly_payment + $pmi_per_month + $residential_monthly_tax), "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . '</b><br><font>';
|
||||
@ -352,7 +352,7 @@ if ($form_complete && $show_progress) {
|
||||
print '<td align="right">' . number_format($remaining_balance, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
($current_month % 12) ? $show_legend = FALSE : $show_legend = TRUE;
|
||||
($current_month % 12) ? ($show_legend = false) : ($show_legend = true);
|
||||
|
||||
if ($show_legend) {
|
||||
print '<tr>';
|
||||
|
||||
@ -350,7 +350,7 @@ if (! defined('NOTOKENRENEWAL'))
|
||||
if (isset($_SESSION['newtoken'])) $_SESSION['token'] = $_SESSION['newtoken'];
|
||||
|
||||
// Save in $_SESSION['newtoken'] what will be next token. Into forms, we will add param token = $_SESSION['newtoken']
|
||||
$token = dol_hash(uniqid(mt_rand(),TRUE)); // Generates a hash of a random number
|
||||
$token = dol_hash(uniqid(mt_rand(), true)); // Generates a hash of a random number
|
||||
$_SESSION['newtoken'] = $token;
|
||||
}
|
||||
if ((! defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && ! empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN))
|
||||
@ -468,7 +468,7 @@ if (! defined('NOLOGIN'))
|
||||
if (GETPOST("username","alpha",2) && ! empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA))
|
||||
{
|
||||
$sessionkey = 'dol_antispam_value';
|
||||
$ok=(array_key_exists($sessionkey, $_SESSION) === TRUE && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code'])));
|
||||
$ok=(array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code'])));
|
||||
|
||||
// Check code
|
||||
if (! $ok)
|
||||
@ -1502,7 +1502,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
||||
{
|
||||
$toprightmenu.=$result; // For backward compatibility
|
||||
}
|
||||
|
||||
|
||||
// Link to module builder
|
||||
if (! empty($conf->modulebuilder->enabled))
|
||||
{
|
||||
|
||||
@ -192,7 +192,7 @@ class MyModuleApi extends DolibarrApi
|
||||
*
|
||||
* @url POST myobjects/
|
||||
*/
|
||||
function post($request_data = NULL)
|
||||
function post($request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->myobject->create) {
|
||||
throw new RestException(401);
|
||||
@ -218,7 +218,7 @@ class MyModuleApi extends DolibarrApi
|
||||
*
|
||||
* @url PUT myobjects/{id}
|
||||
*/
|
||||
function put($id, $request_data = NULL)
|
||||
function put($id, $request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->myobject->create) {
|
||||
throw new RestException(401);
|
||||
|
||||
@ -48,7 +48,7 @@ if (! $res) die("Include of main fails");
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
session_cache_limiter(FALSE);
|
||||
session_cache_limiter(false);
|
||||
|
||||
// Load user to have $user->conf loaded (not done by default here because of NOLOGIN constant defined) and load permission if we need to use them in CSS
|
||||
/*if (empty($user->id) && ! empty($_SESSION['dol_login']))
|
||||
|
||||
@ -630,8 +630,8 @@ function hash_call($methodName,$nvpStr)
|
||||
curl_setopt($ch, CURLOPT_SSLVERSION, (empty($conf->global->PAYPAL_SSLVERSION)?1:$conf->global->PAYPAL_SSLVERSION));
|
||||
|
||||
//turning off the server and peer verification(TrustManager Concept).
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
||||
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, empty($conf->global->MAIN_USE_CONNECT_TIMEOUT)?5:$conf->global->MAIN_USE_CONNECT_TIMEOUT);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT)?30:$conf->global->MAIN_USE_RESPONSE_TIMEOUT);
|
||||
@ -639,7 +639,7 @@ function hash_call($methodName,$nvpStr)
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
|
||||
//if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled.
|
||||
//if USE_PROXY constant set to true in Constants.php, then only proxy will be enabled.
|
||||
if ($USE_PROXY)
|
||||
{
|
||||
dol_syslog("Paypal API hash_call set proxy to ".$PROXY_HOST. ":" . $PROXY_PORT." - ".$PROXY_USER. ":" . $PROXY_PASS);
|
||||
|
||||
@ -178,7 +178,7 @@ class Products extends DolibarrApi
|
||||
* @param array $request_data Request data
|
||||
* @return int ID of product
|
||||
*/
|
||||
function post($request_data = NULL)
|
||||
function post($request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->produit->creer) {
|
||||
throw new RestException(401);
|
||||
@ -208,7 +208,7 @@ class Products extends DolibarrApi
|
||||
* @throws 401
|
||||
* @throws 404
|
||||
*/
|
||||
function put($id, $request_data = NULL)
|
||||
function put($id, $request_data = null)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
||||
@ -173,7 +173,7 @@ class StockMovements extends DolibarrApi
|
||||
* @return int ID of stock movement
|
||||
*/
|
||||
//function post($product_id, $warehouse_id, $qty, $lot='', $movementcode='', $movementlabel='', $price=0)
|
||||
function post($request_data = NULL)
|
||||
function post($request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->stock->creer) {
|
||||
throw new RestException(401);
|
||||
@ -212,7 +212,7 @@ class StockMovements extends DolibarrApi
|
||||
* @return int
|
||||
*/
|
||||
/*
|
||||
function put($id, $request_data = NULL)
|
||||
function put($id, $request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->stock->creer) {
|
||||
throw new RestException(401);
|
||||
|
||||
@ -158,7 +158,7 @@ class Warehouses extends DolibarrApi
|
||||
* @param array $request_data Request data
|
||||
* @return int ID of warehouse
|
||||
*/
|
||||
function post($request_data = NULL)
|
||||
function post($request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->stock->creer) {
|
||||
throw new RestException(401);
|
||||
@ -183,7 +183,7 @@ class Warehouses extends DolibarrApi
|
||||
* @param array $request_data Datas
|
||||
* @return int
|
||||
*/
|
||||
function put($id, $request_data = NULL)
|
||||
function put($id, $request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->stock->creer) {
|
||||
throw new RestException(401);
|
||||
|
||||
@ -179,7 +179,7 @@ class Projects extends DolibarrApi
|
||||
* @param array $request_data Request data
|
||||
* @return int ID of project
|
||||
*/
|
||||
function post($request_data = NULL)
|
||||
function post($request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||
throw new RestException(401, "Insuffisant rights");
|
||||
@ -300,7 +300,7 @@ class Projects extends DolibarrApi
|
||||
* @return int
|
||||
*/
|
||||
/*
|
||||
function postLine($id, $request_data = NULL) {
|
||||
function postLine($id, $request_data = null) {
|
||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
@ -362,7 +362,7 @@ class Projects extends DolibarrApi
|
||||
* @return object
|
||||
*/
|
||||
/*
|
||||
function putLine($id, $lineid, $request_data = NULL) {
|
||||
function putLine($id, $lineid, $request_data = null) {
|
||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
@ -418,7 +418,7 @@ class Projects extends DolibarrApi
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function put($id, $request_data = NULL) {
|
||||
function put($id, $request_data = null) {
|
||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
@ -187,7 +187,7 @@ class Tasks extends DolibarrApi
|
||||
* @param array $request_data Request data
|
||||
* @return int ID of project
|
||||
*/
|
||||
function post($request_data = NULL)
|
||||
function post($request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||
throw new RestException(401, "Insuffisant rights");
|
||||
@ -305,7 +305,7 @@ class Tasks extends DolibarrApi
|
||||
* @return int
|
||||
*/
|
||||
/*
|
||||
function postLine($id, $request_data = NULL) {
|
||||
function postLine($id, $request_data = null) {
|
||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
@ -367,7 +367,7 @@ class Tasks extends DolibarrApi
|
||||
* @return object
|
||||
*/
|
||||
/*
|
||||
function putLine($id, $lineid, $request_data = NULL) {
|
||||
function putLine($id, $lineid, $request_data = null) {
|
||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
@ -422,7 +422,7 @@ class Tasks extends DolibarrApi
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function put($id, $request_data = NULL) {
|
||||
function put($id, $request_data = null) {
|
||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@ class Contacts extends DolibarrApi
|
||||
* @param array $request_data Request datas
|
||||
* @return int ID of contact
|
||||
*/
|
||||
function post($request_data = NULL) {
|
||||
function post($request_data = null) {
|
||||
if (!DolibarrApiAccess::$user->rights->societe->contact->creer)
|
||||
{
|
||||
throw new RestException(401, 'No permission to create/update contacts');
|
||||
@ -219,7 +219,7 @@ class Contacts extends DolibarrApi
|
||||
* @param array $request_data Datas
|
||||
* @return int
|
||||
*/
|
||||
function put($id, $request_data = NULL) {
|
||||
function put($id, $request_data = null) {
|
||||
if (!DolibarrApiAccess::$user->rights->societe->contact->creer)
|
||||
{
|
||||
throw new RestException(401, 'No permission to create/update contacts');
|
||||
@ -282,7 +282,7 @@ class Contacts extends DolibarrApi
|
||||
*
|
||||
* @url POST {id}/createUser
|
||||
*/
|
||||
function createUser($id, $request_data = NULL) {
|
||||
function createUser($id, $request_data = null) {
|
||||
//if (!DolibarrApiAccess::$user->rights->user->user->creer) {
|
||||
//throw new RestException(401);
|
||||
//}
|
||||
|
||||
@ -199,7 +199,7 @@ class Thirdparties extends DolibarrApi
|
||||
* @param array $request_data Request datas
|
||||
* @return int ID of thirdparty
|
||||
*/
|
||||
function post($request_data = NULL)
|
||||
function post($request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->societe->creer) {
|
||||
throw new RestException(401);
|
||||
@ -223,7 +223,7 @@ class Thirdparties extends DolibarrApi
|
||||
* @param array $request_data Datas
|
||||
* @return int
|
||||
*/
|
||||
function put($id, $request_data = NULL)
|
||||
function put($id, $request_data = null)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->societe->creer) {
|
||||
throw new RestException(401);
|
||||
|
||||
@ -334,10 +334,10 @@ class Stripe extends CommonObject
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$key = $obj->fk_soc;
|
||||
} else {
|
||||
$key = NULL;
|
||||
$key = null;
|
||||
}
|
||||
} else {
|
||||
$key = NULL;
|
||||
$key = null;
|
||||
}
|
||||
|
||||
$arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF');
|
||||
|
||||
@ -418,7 +418,7 @@ else {
|
||||
}
|
||||
|
||||
if (GETPOST('error')){
|
||||
setEventMessages(GETPOST('error'), NULL, 'errors');
|
||||
setEventMessages(GETPOST('error'), null, 'errors');
|
||||
}
|
||||
|
||||
if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paiement')
|
||||
|
||||
@ -58,7 +58,7 @@ $fontsizesmaller='0.75em';
|
||||
|
||||
if (defined('THEME_ONLY_CONSTANT')) return;
|
||||
|
||||
session_cache_limiter(FALSE);
|
||||
session_cache_limiter(false);
|
||||
|
||||
require_once '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
@ -59,7 +59,7 @@ $fontsizesmaller='11';
|
||||
|
||||
if (defined('THEME_ONLY_CONSTANT')) return;
|
||||
|
||||
session_cache_limiter(FALSE);
|
||||
session_cache_limiter(false);
|
||||
|
||||
require_once '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
@ -31,7 +31,7 @@ if (! defined('NOLOGIN')) define('NOLOGIN',1); // File must be
|
||||
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
|
||||
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
||||
|
||||
session_cache_limiter(FALSE);
|
||||
session_cache_limiter(false);
|
||||
|
||||
require_once '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
@ -162,7 +162,7 @@ class Users extends DolibarrApi
|
||||
* @param array $request_data New user data
|
||||
* @return int
|
||||
*/
|
||||
function post($request_data = NULL) {
|
||||
function post($request_data = null) {
|
||||
// check user authorization
|
||||
//if(! DolibarrApiAccess::$user->rights->user->creer) {
|
||||
// throw new RestException(401, "User creation not allowed");
|
||||
@ -194,7 +194,7 @@ class Users extends DolibarrApi
|
||||
* @param array $request_data Datas
|
||||
* @return int
|
||||
*/
|
||||
function put($id, $request_data = NULL) {
|
||||
function put($id, $request_data = null) {
|
||||
//if (!DolibarrApiAccess::$user->rights->user->user->creer) {
|
||||
//throw new RestException(401);
|
||||
//}
|
||||
|
||||
@ -96,7 +96,7 @@ if ($action == 'validatenewpassword' && $username && $passwordhash)
|
||||
if ($action == 'buildnewpassword' && $username)
|
||||
{
|
||||
$sessionkey = 'dol_antispam_value';
|
||||
$ok=(array_key_exists($sessionkey, $_SESSION) === TRUE && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code'])));
|
||||
$ok=(array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code'])));
|
||||
|
||||
// Verify code
|
||||
if (! $ok)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user