mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
This commit is contained in:
parent
695078c77e
commit
f7a41f1848
|
|
@ -116,7 +116,7 @@ $search_date_startyear = GETPOST('search_date_startyear', 'int');
|
|||
$search_date_endday = GETPOST('search_date_endday', 'int');
|
||||
$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
|
||||
$search_date_endyear = GETPOST('search_date_endyear', 'int');
|
||||
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
|
||||
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
|
||||
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
|
||||
$search_date_valid_startday = GETPOST('search_date_valid_startday', 'int');
|
||||
$search_date_valid_startmonth = GETPOST('search_date_valid_startmonth', 'int');
|
||||
|
|
@ -124,7 +124,7 @@ $search_date_valid_startyear = GETPOST('search_date_valid_startyear', 'int');
|
|||
$search_date_valid_endday = GETPOST('search_date_valid_endday', 'int');
|
||||
$search_date_valid_endmonth = GETPOST('search_date_valid_endmonth', 'int');
|
||||
$search_date_valid_endyear = GETPOST('search_date_valid_endyear', 'int');
|
||||
$search_date_valid_start = dol_mktime(0, 0, 0, $search_date_valid_startmonth, $search_date_valid_startday, $search_date_valid_startyear); // Use tzserver
|
||||
$search_date_valid_start = dol_mktime(0, 0, 0, $search_date_valid_startmonth, $search_date_valid_startday, $search_date_valid_startyear); // Use tzserver
|
||||
$search_date_valid_end = dol_mktime(23, 59, 59, $search_date_valid_endmonth, $search_date_valid_endday, $search_date_valid_endyear);
|
||||
$search_datelimit_startday = GETPOST('search_datelimit_startday', 'int');
|
||||
$search_datelimit_startmonth = GETPOST('search_datelimit_startmonth', 'int');
|
||||
|
|
@ -380,11 +380,11 @@ if ($action == 'makepayment_confirm' && $user->rights->facture->paiement) {
|
|||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||
if (!empty($arrayofselected)) {
|
||||
$bankid=GETPOST('bankid', 'int');
|
||||
$paiementid=GETPOST('paiementid', 'int');
|
||||
$paiementdate=dol_mktime(12, 0, 0, GETPOST('datepaimentmonth', 'int'), GETPOST('datepaimentday', 'int'), GETPOST('datepaimentyear', 'year'));
|
||||
$bankid = GETPOST('bankid', 'int');
|
||||
$paiementid = GETPOST('paiementid', 'int');
|
||||
$paiementdate = dol_mktime(12, 0, 0, GETPOST('datepaimentmonth', 'int'), GETPOST('datepaimentday', 'int'), GETPOST('datepaimentyear', 'year'));
|
||||
foreach ($arrayofselected as $toselectid) {
|
||||
$errorpayment=0;
|
||||
$errorpayment = 0;
|
||||
$facture = new Facture($db);
|
||||
$result = $facture->fetch($toselectid);
|
||||
if ($result < 0) {
|
||||
|
|
@ -397,7 +397,7 @@ if ($action == 'makepayment_confirm' && $user->rights->facture->paiement) {
|
|||
$totaldeposits = $facture->getSumDepositsUsed();
|
||||
$totalpay = $paiementAmount + $totalcreditnotes + $totaldeposits;
|
||||
$remaintopay = price2num($facture->total_ttc - $totalpay);
|
||||
if ($remaintopay!=0) {
|
||||
if ($remaintopay != 0) {
|
||||
$resultBank = $facture->setBankAccount($bankid);
|
||||
if ($resultBank < 0) {
|
||||
setEventMessage($facture->error, 'errors');
|
||||
|
|
@ -410,12 +410,12 @@ if ($action == 'makepayment_confirm' && $user->rights->facture->paiement) {
|
|||
$paiement->paiementid = $paiementid;
|
||||
$paiement_id = $paiement->create($user, 1, $facture->thirdparty);
|
||||
if ($paiement_id < 0) {
|
||||
setEventMessage($facture->ref . ' ' . $paiement->error, 'errors');
|
||||
setEventMessage($facture->ref.' '.$paiement->error, 'errors');
|
||||
$errorpayment++;
|
||||
} else {
|
||||
$result = $paiement->addPaymentToBank($user, 'payment', '', $bankid, '', '');
|
||||
if ($result < 0) {
|
||||
setEventMessages($facture->ref . ' ' . $paiement->error, $paiement->errors, 'errors');
|
||||
setEventMessages($facture->ref.' '.$paiement->error, $paiement->errors, 'errors');
|
||||
$errorpayment++;
|
||||
}
|
||||
}
|
||||
|
|
@ -555,7 +555,7 @@ $sql .= ' u.login, u.lastname, u.firstname, u.email as user_email, u.statut as u
|
|||
if (!$sall) {
|
||||
$sql .= ', SUM(pf.amount) as dynamount_payed, SUM(pf.multicurrency_amount) as multicurrency_dynamount_payed';
|
||||
}
|
||||
if ($search_categ_cus && $search_categ_cus!=-1) {
|
||||
if ($search_categ_cus && $search_categ_cus != -1) {
|
||||
$sql .= ", cc.fk_categorie, cc.fk_soc";
|
||||
}
|
||||
// Add fields from extrafields
|
||||
|
|
@ -801,7 +801,7 @@ if (!$sall) {
|
|||
$sql .= ' country.code,';
|
||||
$sql .= " p.rowid, p.ref, p.title,";
|
||||
$sql .= " u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender";
|
||||
if ($search_categ_cus && $search_categ_cus!=-1) {
|
||||
if ($search_categ_cus && $search_categ_cus != -1) {
|
||||
$sql .= ", cc.fk_categorie, cc.fk_soc";
|
||||
}
|
||||
// Add fields from extrafields
|
||||
|
|
@ -821,7 +821,7 @@ if (!$sall) {
|
|||
// Add HAVING from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$sql .= !empty($hookmanager->resPrint) ? (" HAVING 1=1 " . $hookmanager->resPrint) : "";
|
||||
$sql .= !empty($hookmanager->resPrint) ? (" HAVING 1=1 ".$hookmanager->resPrint) : "";
|
||||
|
||||
$sql .= ' ORDER BY ';
|
||||
$listfield = explode(',', $sortfield);
|
||||
|
|
@ -914,7 +914,7 @@ if ($resql) {
|
|||
if ($search_date_valid_endyear) {
|
||||
$param .= '&search_date_valid_endyear='.urlencode($search_date_valid_endyear);
|
||||
}
|
||||
if ($search_datelimit_startday) {
|
||||
if ($search_datelimit_startday) {
|
||||
$param .= '&search_datelimit_startday='.urlencode($search_datelimit_startday);
|
||||
}
|
||||
if ($search_datelimit_startmonth) {
|
||||
|
|
@ -1059,7 +1059,7 @@ if ($resql) {
|
|||
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||
}
|
||||
}
|
||||
if (in_array($massaction, array('presend', 'predelete' ,'makepayment'))) {
|
||||
if (in_array($massaction, array('presend', 'predelete', 'makepayment'))) {
|
||||
$arrayofmassactions = array();
|
||||
}
|
||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||
|
|
@ -1097,7 +1097,7 @@ if ($resql) {
|
|||
$trackid = 'inv'.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||
|
||||
if ($massaction=='makepayment') {
|
||||
if ($massaction == 'makepayment') {
|
||||
$formconfirm = '';
|
||||
$formquestion = array(
|
||||
// 'text' => $langs->trans("ConfirmClone"),
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ if ($action == 'add' && !empty($permissiontoadd)) {
|
|||
if (in_array($object->fields[$key]['type'], array('text', 'html'))) {
|
||||
$value = GETPOST($key, 'restricthtml');
|
||||
} elseif ($object->fields[$key]['type'] == 'date') {
|
||||
$value = dol_mktime(12, 0, 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); // for date without hour, we use gmt
|
||||
$value = dol_mktime(12, 0, 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); // for date without hour, we use gmt
|
||||
} elseif ($object->fields[$key]['type'] == 'datetime') {
|
||||
$value = dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), GETPOST($key.'sec', 'int'), GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int'), 'tzuserrel');
|
||||
} elseif ($object->fields[$key]['type'] == 'duration') {
|
||||
|
|
@ -87,7 +87,7 @@ if ($action == 'add' && !empty($permissiontoadd)) {
|
|||
$value = $tmparraykey[GETPOST($key)].','.GETPOST($key.'2');
|
||||
} else {
|
||||
if ($key == 'lang') {
|
||||
$value = GETPOST($key, 'aZ09')?GETPOST($key, 'aZ09'):"";
|
||||
$value = GETPOST($key, 'aZ09') ?GETPOST($key, 'aZ09') : "";
|
||||
} else {
|
||||
$value = GETPOST($key, 'alphanohtml');
|
||||
}
|
||||
|
|
@ -190,7 +190,7 @@ if ($action == 'update' && !empty($permissiontoadd)) {
|
|||
$value = GETPOST($key, 'restricthtml');
|
||||
}
|
||||
} elseif ($object->fields[$key]['type'] == 'date') {
|
||||
$value = dol_mktime(12, 0, 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); // for date without hour, we use gmt
|
||||
$value = dol_mktime(12, 0, 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); // for date without hour, we use gmt
|
||||
} elseif ($object->fields[$key]['type'] == 'datetime') {
|
||||
$value = dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), GETPOST($key.'sec', 'int'), GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int'), 'tzuserrel');
|
||||
} elseif ($object->fields[$key]['type'] == 'duration') {
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ class modMultiCurrency extends DolibarrModules
|
|||
|
||||
$multicurrency = new MultiCurrency($this->db);
|
||||
|
||||
if (! $multicurrency->checkCodeAlreadyExists($conf->currency)) {
|
||||
if (!$multicurrency->checkCodeAlreadyExists($conf->currency)) {
|
||||
$langs->loadCacheCurrencies('');
|
||||
|
||||
$multicurrency->code = $conf->currency;
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class ConferenceOrBoothAttendee extends CommonObject
|
|||
/**
|
||||
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields=array(
|
||||
public $fields = array(
|
||||
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
|
||||
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"),
|
||||
'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'),
|
||||
|
|
@ -119,7 +119,7 @@ class ConferenceOrBoothAttendee extends CommonObject
|
|||
'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>'1', 'position'=>600, 'notnull'=>0, 'visible'=>0,),
|
||||
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,),
|
||||
'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,),
|
||||
'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'default'=>0,'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '9'=>'Canceled'),),
|
||||
'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'default'=>0, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '9'=>'Canceled'),),
|
||||
);
|
||||
public $rowid;
|
||||
public $ref;
|
||||
|
|
@ -787,7 +787,7 @@ class ConferenceOrBoothAttendee extends CommonObject
|
|||
}
|
||||
|
||||
if ($option == 'conforboothidproject') {
|
||||
$url .= '&conforboothid='.((int) $this->fk_actioncomm).'&withproject=1' ;
|
||||
$url .= '&conforboothid='.((int) $this->fk_actioncomm).'&withproject=1';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ $title = $langs->trans("ConferenceOrBoothAttendee");
|
|||
$help_url = '';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
$result = $projectstatic->fetch(empty($confOrBooth->fk_project)?$fk_project:$confOrBooth->fk_project);
|
||||
$result = $projectstatic->fetch(empty($confOrBooth->fk_project) ? $fk_project : $confOrBooth->fk_project);
|
||||
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
|
||||
$projectstatic->fetchComments();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ function realCharForNumericEntities($matches)
|
|||
return chr((int) $newstringnumentity);
|
||||
}
|
||||
|
||||
return '&#'.$matches[1]; // Value will be unchanged because regex was /&#( )/
|
||||
return '&#'.$matches[1]; // Value will be unchanged because regex was /&#( )/
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -94,7 +94,7 @@ function testSqlAndScriptInject($val, $type)
|
|||
do {
|
||||
$oldval = $val;
|
||||
$val = html_entity_decode($val, ENT_QUOTES | ENT_HTML5);
|
||||
$val = preg_replace_callback('/&#(x?[0-9][0-9a-f]+)/i', 'realCharForNumericEntities', $val); // Sometimes we have entities without the ; at end so html_entity_decode does not work but entities is still interpreted by browser.
|
||||
$val = preg_replace_callback('/&#(x?[0-9][0-9a-f]+)/i', 'realCharForNumericEntities', $val); // Sometimes we have entities without the ; at end so html_entity_decode does not work but entities is still interpreted by browser.
|
||||
} while ($oldval != $val);
|
||||
//print "after decoding $val\n";
|
||||
|
||||
|
|
@ -454,7 +454,7 @@ if (!defined('NOTOKENRENEWAL') && !defined('NOSESSION')) {
|
|||
// Save in $_SESSION['newtoken'] what will be next token. Into forms, we will add param token = $_SESSION['newtoken']
|
||||
$token = dol_hash(uniqid(mt_rand(), false), 'md5'); // Generates a hash of a random number. We don't need a secured hash, just a changing random value.
|
||||
$_SESSION['newtoken'] = $token;
|
||||
dol_syslog("NEW TOKEN generated by : " . $_SERVER['PHP_SELF'], LOG_DEBUG);
|
||||
dol_syslog("NEW TOKEN generated by : ".$_SERVER['PHP_SELF'], LOG_DEBUG);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -494,20 +494,20 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt(
|
|||
// If token is not provided or empty, error (we are in case it is mandatory)
|
||||
if (!GETPOST('token', 'alpha') || GETPOST('token', 'alpha') == 'notrequired') {
|
||||
if (GETPOST('uploadform', 'int')) {
|
||||
dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"])?'':$_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused. File size too large.");
|
||||
dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused. File size too large.");
|
||||
$langs->loadLangs(array("errors", "install"));
|
||||
print $langs->trans("ErrorFileSizeTooLarge").' ';
|
||||
print $langs->trans("ErrorGoBackAndCorrectParameters");
|
||||
die;
|
||||
} else {
|
||||
if (defined('CSRFCHECK_WITH_TOKEN')) {
|
||||
dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"])?'':$_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused by CSRF protection (CSRFCHECK_WITH_TOKEN protection) in main.inc.php. Token not provided.", LOG_WARNING);
|
||||
dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused by CSRF protection (CSRFCHECK_WITH_TOKEN protection) in main.inc.php. Token not provided.", LOG_WARNING);
|
||||
print "Access to a page that needs a token (constant CSRFCHECK_WITH_TOKEN is defined) is refused by CSRF protection in main.inc.php. Token not provided.\n";
|
||||
} else {
|
||||
dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"])?'':$_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused by CSRF protection (POST method or GET with a sensible value for 'action' parameter) in main.inc.php. Token not provided.", LOG_WARNING);
|
||||
dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused by CSRF protection (POST method or GET with a sensible value for 'action' parameter) in main.inc.php. Token not provided.", LOG_WARNING);
|
||||
print "Access to this page this way (POST method or GET with a sensible value for 'action' parameter) is refused by CSRF protection in main.inc.php. Token not provided.\n";
|
||||
print "If you access your server behind a proxy using url rewriting and the parameter is provided by caller, you might check that all HTTP header are propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file or MAIN_SECURITY_CSRF_WITH_TOKEN to 0";
|
||||
if (! empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) {
|
||||
if (!empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) {
|
||||
print " instead of ".$conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN;
|
||||
}
|
||||
print " into setup).\n";
|
||||
|
|
@ -520,7 +520,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt(
|
|||
$sessiontokenforthisurl = (empty($_SESSION['token']) ? '' : $_SESSION['token']);
|
||||
// TODO Get the sessiontokenforthisurl into the array of session token
|
||||
if (GETPOSTISSET('token') && GETPOST('token') != 'notrequired' && GETPOST('token', 'alpha') != $sessiontokenforthisurl) {
|
||||
dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"])?'':$_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused by CSRF protection (invalid token), so we disable POST and some GET parameters - referer=".$_SERVER['HTTP_REFERER'].", action=".GETPOST('action', 'aZ09').", _GET|POST['token']=".GETPOST('token', 'alpha').", _SESSION['token']=".$_SESSION['token'], LOG_WARNING);
|
||||
dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused by CSRF protection (invalid token), so we disable POST and some GET parameters - referer=".$_SERVER['HTTP_REFERER'].", action=".GETPOST('action', 'aZ09').", _GET|POST['token']=".GETPOST('token', 'alpha').", _SESSION['token']=".$_SESSION['token'], LOG_WARNING);
|
||||
//print 'Unset POST by CSRF protection in main.inc.php.'; // Do not output anything because this create problems when using the BACK button on browsers.
|
||||
setEventMessages('SecurityTokenHasExpiredSoActionHasBeenCanceledPleaseRetry', null, 'warnings');
|
||||
//if ($conf->global->MAIN_FEATURES_LEVEL >= 1) setEventMessages('Unset POST and GET params by CSRF protection in main.inc.php (Token provided was not generated by the previous page).'."<br>\n".'$_SERVER[REQUEST_URI] = '.$_SERVER['REQUEST_URI'].' $_SERVER[REQUEST_METHOD] = '.$_SERVER['REQUEST_METHOD'].' GETPOST(token) = '.GETPOST('token', 'alpha').' $_SESSION[token] = '.$_SESSION['token'], null, 'warnings');
|
||||
|
|
@ -785,7 +785,7 @@ if (!defined('NOLOGIN')) {
|
|||
// End test login / passwords
|
||||
if (!$login || (in_array('ldap', $authmode) && empty($passwordtotest))) { // With LDAP we refused empty password because some LDAP are "opened" for anonymous access so connexion is a success.
|
||||
// No data to test login, so we show the login page.
|
||||
dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"])?'':$_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." - action=".GETPOST('action', 'aZ09')." - actionlogin=".GETPOST('actionlogin', 'aZ09')." - showing the login form and exit", LOG_INFO);
|
||||
dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." - action=".GETPOST('action', 'aZ09')." - actionlogin=".GETPOST('actionlogin', 'aZ09')." - showing the login form and exit", LOG_INFO);
|
||||
if (defined('NOREDIRECTBYMAINTOLOGIN')) {
|
||||
return 'ERROR_NOT_LOGGED';
|
||||
} else {
|
||||
|
|
@ -1176,7 +1176,7 @@ if (!defined('NOLOGIN')) {
|
|||
$user->getrights();
|
||||
}
|
||||
|
||||
dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"])?'':$_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"].' - action='.GETPOST('action', 'aZ09').', massaction='.GETPOST('massaction', 'aZ09').(defined('NOTOKENRENEWAL') ? ' NOTOKENRENEWAL='.constant('NOTOKENRENEWAL') : ''), LOG_NOTICE);
|
||||
dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"].' - action='.GETPOST('action', 'aZ09').', massaction='.GETPOST('massaction', 'aZ09').(defined('NOTOKENRENEWAL') ? ' NOTOKENRENEWAL='.constant('NOTOKENRENEWAL') : ''), LOG_NOTICE);
|
||||
//Another call for easy debugg
|
||||
//dol_syslog("Access to ".$_SERVER["PHP_SELF"].' '.$_SERVER["HTTP_REFERER"].' GET='.join(',',array_keys($_GET)).'->'.join(',',$_GET).' POST:'.join(',',array_keys($_POST)).'->'.join(',',$_POST));
|
||||
|
||||
|
|
@ -2281,7 +2281,7 @@ function top_menu_quickadd()
|
|||
<!-- Thirdparty link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/societe/card.php?action=create" title="'.$langs->trans("MenuNewThirdParty").'">
|
||||
'. img_picto('', 'object_company') .'<br>'. $langs->trans("ThirdParty") .'</a>
|
||||
'. img_picto('', 'object_company').'<br>'.$langs->trans("ThirdParty").'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
|
@ -2292,7 +2292,7 @@ function top_menu_quickadd()
|
|||
<!-- Contact link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/contact/card.php?action=create" title="'.$langs->trans("NewContactAddress").'">
|
||||
'. img_picto('', 'object_contact') .'<br>'. $langs->trans("Contact") .'</a>
|
||||
'. img_picto('', 'object_contact').'<br>'.$langs->trans("Contact").'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
|
@ -2303,7 +2303,7 @@ function top_menu_quickadd()
|
|||
<!-- Propal link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/comm/propal/card.php?action=create" title="'.$langs->trans("NewPropal").'">
|
||||
'. img_picto('', 'object_propal') .'<br>'. $langs->trans("Proposal") .'</a>
|
||||
'. img_picto('', 'object_propal').'<br>'.$langs->trans("Proposal").'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
|
@ -2314,7 +2314,7 @@ function top_menu_quickadd()
|
|||
<!-- Order link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/commande/card.php?action=create" title="'.$langs->trans("NewOrder").'">
|
||||
'. img_picto('', 'object_order') .'<br>'. $langs->trans("Order") .'</a>
|
||||
'. img_picto('', 'object_order').'<br>'.$langs->trans("Order").'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
|
@ -2325,7 +2325,7 @@ function top_menu_quickadd()
|
|||
<!-- Invoice link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create" title="'.$langs->trans("NewBill").'">
|
||||
'. img_picto('', 'object_bill') .'<br>'. $langs->trans("Bill") .'</a>
|
||||
'. img_picto('', 'object_bill').'<br>'.$langs->trans("Bill").'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
|
@ -2336,7 +2336,7 @@ function top_menu_quickadd()
|
|||
<!-- Contract link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create" title="'.$langs->trans("NewContractSubscription").'">
|
||||
'. img_picto('', 'object_contract') .'<br>'. $langs->trans("Contract") .'</a>
|
||||
'. img_picto('', 'object_contract').'<br>'.$langs->trans("Contract").'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
|
@ -2347,7 +2347,7 @@ function top_menu_quickadd()
|
|||
<!-- Supplier proposal link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/supplier_proposal/card.php?action=create" title="'.$langs->trans("NewAskPrice").'">
|
||||
'. img_picto('', 'object_propal') .'<br>'. $langs->trans("AskPrice") .'</a>
|
||||
'. img_picto('', 'object_propal').'<br>'.$langs->trans("AskPrice").'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
|
@ -2358,7 +2358,7 @@ function top_menu_quickadd()
|
|||
<!-- Supplier order link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create" title="'.$langs->trans("NewSupplierOrderShort").'">
|
||||
'. img_picto('', 'object_order') .'<br>'. $langs->trans("SupplierOrder") .'</a>
|
||||
'. img_picto('', 'object_order').'<br>'.$langs->trans("SupplierOrder").'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
|
@ -2369,7 +2369,7 @@ function top_menu_quickadd()
|
|||
<!-- Supplier invoice link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create" title="'.$langs->trans("NewBill").'">
|
||||
'. img_picto('', 'object_bill') .'<br>'. $langs->trans("SupplierBill") .'</a>
|
||||
'. img_picto('', 'object_bill').'<br>'.$langs->trans("SupplierBill").'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
|
@ -2380,7 +2380,7 @@ function top_menu_quickadd()
|
|||
<!-- Product link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/product/card.php?action=create&type=0" title="'.$langs->trans("NewProduct").'">
|
||||
'. img_picto('', 'object_product') .'<br>'. $langs->trans("Product") .'</a>
|
||||
'. img_picto('', 'object_product').'<br>'.$langs->trans("Product").'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
|
@ -2391,7 +2391,7 @@ function top_menu_quickadd()
|
|||
<!-- Service link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/product/card.php?action=create&type=1" title="'.$langs->trans("NewService").'">
|
||||
'. img_picto('', 'object_service') .'<br>'. $langs->trans("Service") .'</a>
|
||||
'. img_picto('', 'object_service').'<br>'.$langs->trans("Service").'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
|
@ -2402,7 +2402,7 @@ function top_menu_quickadd()
|
|||
<!-- Expense report link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/expensereport/card.php?action=create&fk_user_author='.$user->id.'" title="'.$langs->trans("AddTrip").'">
|
||||
'. img_picto('', 'object_trip') .'<br>'. $langs->trans("ExpenseReport") .'</a>
|
||||
'. img_picto('', 'object_trip').'<br>'.$langs->trans("ExpenseReport").'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
|
@ -2413,7 +2413,7 @@ function top_menu_quickadd()
|
|||
<!-- Holiday link -->
|
||||
<div class="quickaddblock center">
|
||||
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/holiday/card.php?action=create&fuserid='.$user->id.'" title="'.$langs->trans("AddCP").'">
|
||||
'. img_picto('', 'object_holiday') .'<br>'. $langs->trans("Holidays") .'</a>
|
||||
'. img_picto('', 'object_holiday').'<br>'.$langs->trans("Holidays").'</a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
|
@ -2858,12 +2858,12 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_
|
|||
$bugbaseurl .= urlencode("[*Short description*]\n");
|
||||
$bugbaseurl .= urlencode("\n");
|
||||
$bugbaseurl .= urlencode("## Environment\n");
|
||||
$bugbaseurl .= urlencode("- **Version**: " . DOL_VERSION . "\n");
|
||||
$bugbaseurl .= urlencode("- **OS**: " . php_uname('s') . "\n");
|
||||
$bugbaseurl .= urlencode("- **Web server**: " . $_SERVER["SERVER_SOFTWARE"] . "\n");
|
||||
$bugbaseurl .= urlencode("- **PHP**: " . php_sapi_name() . ' ' . phpversion() . "\n");
|
||||
$bugbaseurl .= urlencode("- **Database**: " . $db::LABEL . ' ' . $db->getVersion() . "\n");
|
||||
$bugbaseurl .= urlencode("- **URL(s)**: " . $_SERVER["REQUEST_URI"] . "\n");
|
||||
$bugbaseurl .= urlencode("- **Version**: ".DOL_VERSION."\n");
|
||||
$bugbaseurl .= urlencode("- **OS**: ".php_uname('s')."\n");
|
||||
$bugbaseurl .= urlencode("- **Web server**: ".$_SERVER["SERVER_SOFTWARE"]."\n");
|
||||
$bugbaseurl .= urlencode("- **PHP**: ".php_sapi_name().' '.phpversion()."\n");
|
||||
$bugbaseurl .= urlencode("- **Database**: ".$db::LABEL.' '.$db->getVersion()."\n");
|
||||
$bugbaseurl .= urlencode("- **URL(s)**: ".$_SERVER["REQUEST_URI"]."\n");
|
||||
$bugbaseurl .= urlencode("\n");
|
||||
$bugbaseurl .= urlencode("## Expected and actual behavior\n");
|
||||
$bugbaseurl .= urlencode("[*Verbose description*]\n");
|
||||
|
|
|
|||
|
|
@ -3592,7 +3592,7 @@ if ($module == 'initmodule') {
|
|||
print '</tr>';
|
||||
}
|
||||
} else {
|
||||
print '<tr><td><span class="fa fa-file-o"></span> '.$langs->trans("CLIFile").' : <span class="opacitymedium">'.$langs->trans("FileNotYetGenerated");'</span>';
|
||||
print '<tr><td><span class="fa fa-file-o"></span> '.$langs->trans("CLIFile").' : <span class="opacitymedium">'.$langs->trans("FileNotYetGenerated"); '</span>';
|
||||
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=initcli&token='.newToken().'&format=php">'.img_picto('Generate', 'generate', 'class="paddingleft"').'</a>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ $arrayfields = array(
|
|||
's.import_key'=>array('label'=>"ImportId", 'checked'=>0, 'position'=>1100),
|
||||
);
|
||||
if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
|
||||
$arrayfields['s.price_level'] =array('label'=>"PriceLevel", 'position'=>30, 'checked'=>0);
|
||||
$arrayfields['s.price_level'] = array('label'=>"PriceLevel", 'position'=>30, 'checked'=>0);
|
||||
}
|
||||
|
||||
// Extra fields
|
||||
|
|
@ -467,10 +467,10 @@ if ($search_sale && $search_sale != '-1') {
|
|||
$sql .= ", sc.fk_soc, sc.fk_user";
|
||||
}
|
||||
// We'll need these fields in order to filter by categ
|
||||
if ($search_categ_cus && $search_categ_cus!=-1) {
|
||||
if ($search_categ_cus && $search_categ_cus != -1) {
|
||||
$sql .= ", cc.fk_categorie, cc.fk_soc";
|
||||
}
|
||||
if ($search_categ_sup && $search_categ_sup!=-1) {
|
||||
if ($search_categ_sup && $search_categ_sup != -1) {
|
||||
$sql .= ", cs.fk_categorie, cs.fk_soc";
|
||||
}
|
||||
// Add fields from extrafields
|
||||
|
|
@ -573,7 +573,7 @@ if ($search_account_supplier_code) {
|
|||
$sql .= natural_search("s.code_compta_fournisseur", $search_account_supplier_code);
|
||||
}
|
||||
if ($search_address) {
|
||||
$sql.= natural_search('s.address', $search_address);
|
||||
$sql .= natural_search('s.address', $search_address);
|
||||
}
|
||||
if ($search_town) {
|
||||
$sql .= natural_search("s.town", $search_town);
|
||||
|
|
@ -751,7 +751,7 @@ if ($search_alias != '') {
|
|||
$param .= "&search_alias=".urlencode($search_alias);
|
||||
}
|
||||
if ($search_address != '') {
|
||||
$param .= '&search_address=' . urlencode($search_address);
|
||||
$param .= '&search_address='.urlencode($search_address);
|
||||
}
|
||||
if ($search_town != '') {
|
||||
$param .= "&search_town=".urlencode($search_town);
|
||||
|
|
|
|||
|
|
@ -336,7 +336,7 @@ print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad
|
|||
}
|
||||
}
|
||||
|
||||
print '<button type="button" class="calcbutton2" onclick="Validate(\''.dol_escape_js($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.' iconwithlabel"></span><span class="hideonsmartphone"><br>'. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code)).'</span></button>';
|
||||
print '<button type="button" class="calcbutton2" onclick="Validate(\''.dol_escape_js($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.' iconwithlabel"></span><span class="hideonsmartphone"><br>'.$langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code)).'</span></button>';
|
||||
} else {
|
||||
print '<button type="button" class="calcbutton2">'.$langs->trans("NoPaimementModesDefined").'</button>';
|
||||
}
|
||||
|
|
@ -362,7 +362,7 @@ print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad
|
|||
}
|
||||
}
|
||||
|
||||
print '<button type="button" class="calcbutton2" onclick="Validate(\''.dol_escape_js($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.' iconwithlabel"></span><br> '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code)).'</button>';
|
||||
print '<button type="button" class="calcbutton2" onclick="Validate(\''.dol_escape_js($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.' iconwithlabel"></span><br> '.$langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code)).'</button>';
|
||||
} else {
|
||||
$button = array_pop($action_buttons);
|
||||
print '<button type="button" class="calcbutton2" onclick="'.$button["function"].'"><span '.$button["span"].'>'.$button["text"].'</span></button>';
|
||||
|
|
@ -389,7 +389,7 @@ print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad
|
|||
}
|
||||
}
|
||||
|
||||
print '<button type="button" class="calcbutton2" onclick="Validate(\''.dol_escape_js($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.' iconwithlabel"></span><br>'. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code)).'</button>';
|
||||
print '<button type="button" class="calcbutton2" onclick="Validate(\''.dol_escape_js($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.' iconwithlabel"></span><br>'.$langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code)).'</button>';
|
||||
} else {
|
||||
$button = array_pop($action_buttons);
|
||||
print '<button type="button" class="calcbutton2" onclick="'.$button["function"].'"><span '.$button["span"].'>'.$button["text"].'</span></button>';
|
||||
|
|
@ -417,7 +417,7 @@ while ($i < count($arrayOfValidPaymentModes)) {
|
|||
}
|
||||
}
|
||||
|
||||
print '<button type="button" class="calcbutton2" onclick="Validate(\''.dol_escape_js($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.' iconwithlabel"></span><br>'. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[$i]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[$i]->code)).'</button>';
|
||||
print '<button type="button" class="calcbutton2" onclick="Validate(\''.dol_escape_js($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.' iconwithlabel"></span><br>'.$langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[$i]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[$i]->code)).'</button>';
|
||||
$i = $i + 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user