Browse Source

Debug bad params

Laurent Destailleur 2 years ago
parent
commit
6df4795ded

+ 1 - 1
htdocs/adherents/card.php

@@ -1046,7 +1046,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
 
 
 		// Website
 		// Website
 		print '<tr><td>'.$form->editfieldkey('Web', 'member_url', GETPOST('member_url', 'alpha'), $object, 0).'</td>';
 		print '<tr><td>'.$form->editfieldkey('Web', 'member_url', GETPOST('member_url', 'alpha'), $object, 0).'</td>';
-		print '<td>'.img_picto('', 'globe').' <input type="text" class="maxwidth500 widthcentpercentminusx" name="member_url" id="member_url" value="'.(GETPOSTISSET('member_url', 'alpha') ? GETPOST('member_url', 'alpha') : $object->url).'"></td></tr>';
+		print '<td>'.img_picto('', 'globe').' <input type="text" class="maxwidth500 widthcentpercentminusx" name="member_url" id="member_url" value="'.(GETPOSTISSET('member_url') ? GETPOST('member_url', 'alpha') : $object->url).'"></td></tr>';
 
 
 		// Address
 		// Address
 		print '<tr><td class="tdtop">'.$langs->trans("Address").'</td><td>';
 		print '<tr><td class="tdtop">'.$langs->trans("Address").'</td><td>';

+ 1 - 1
htdocs/admin/modules.php

@@ -1075,7 +1075,7 @@ if ($mode == 'marketplace') {
 			<div id="listing-content">
 			<div id="listing-content">
 				<table summary="list_of_modules" id="list_of_modules" class="productlist centpercent">
 				<table summary="list_of_modules" id="list_of_modules" class="productlist centpercent">
 					<tbody id="listOfModules">
 					<tbody id="listOfModules">
-						<?php echo $dolistore->get_products(!empty($categorie) ? $categorie: ''); ?>
+						<?php echo $dolistore->get_products(); ?>
 					</tbody>
 					</tbody>
 				</table>
 				</table>
 			</div>
 			</div>

+ 1 - 1
htdocs/contact/card.php

@@ -362,7 +362,7 @@ if (empty($reshook)) {
 		if (!$error) {
 		if (!$error) {
 			$contactid = GETPOST("contactid", 'int');
 			$contactid = GETPOST("contactid", 'int');
 			$object->fetch($contactid);
 			$object->fetch($contactid);
-			$object->fetchRoles($contactid);
+			$object->fetchRoles();
 
 
 			// Photo save
 			// Photo save
 			$dir = $conf->societe->multidir_output[$object->entity]."/contact/".$object->id."/photos";
 			$dir = $conf->societe->multidir_output[$object->entity]."/contact/".$object->id."/photos";

+ 1 - 1
htdocs/core/class/discount.class.php

@@ -419,7 +419,7 @@ class DiscountAbsolute
 	 *	When discount is from a credit note used to reduce payment of an invoice, we link using rowidinvoice
 	 *	When discount is from a credit note used to reduce payment of an invoice, we link using rowidinvoice
 	 *
 	 *
 	 *	@param		int		$rowidline		Invoice line id (To use discount into invoice lines)
 	 *	@param		int		$rowidline		Invoice line id (To use discount into invoice lines)
-	 *	@param		int		$rowidinvoice	Invoice id (To use discount as a credit note to reduc payment of invoice)
+	 *	@param		int		$rowidinvoice	Invoice id (To use discount as a credit note to reduce payment of invoice)
 	 *	@return		int						<0 if KO, >0 if OK
 	 *	@return		int						<0 if KO, >0 if OK
 	 */
 	 */
 	public function link_to_invoice($rowidline, $rowidinvoice)
 	public function link_to_invoice($rowidline, $rowidinvoice)

+ 2 - 2
htdocs/core/class/dolgeoip.class.php

@@ -45,7 +45,7 @@ class DolGeoIP
 	{
 	{
 		global $conf;
 		global $conf;
 
 
-		$geoipversion = '2'; // 'php', or '2'
+		$geoipversion = '2'; // 'php', or geoip version '2'
 		if (!empty($conf->global->GEOIP_VERSION)) {
 		if (!empty($conf->global->GEOIP_VERSION)) {
 			$geoipversion = $conf->global->GEOIP_VERSION;
 			$geoipversion = $conf->global->GEOIP_VERSION;
 		}
 		}
@@ -181,7 +181,7 @@ class DolGeoIP
 				return '';
 				return '';
 			}
 			}
 		} else {
 		} else {
-			return geoip_country_code_by_name($this->gi, $name);
+			return strtolower(geoip_country_code_by_name($name));
 		}
 		}
 	}
 	}
 
 

+ 3 - 2
htdocs/core/class/fileupload.class.php

@@ -180,6 +180,8 @@ class FileUpload
 				)
 				)
 		);
 		);
 
 
+		global $action;
+
 		$hookmanager->executeHooks(
 		$hookmanager->executeHooks(
 			'overrideUploadOptions',
 			'overrideUploadOptions',
 			array(
 			array(
@@ -187,8 +189,7 @@ class FileUpload
 				'element' => $element
 				'element' => $element
 			),
 			),
 			$object,
 			$object,
-			$action,
-			$hookmanager
+			$action
 		);
 		);
 
 
 		if ($options) {
 		if ($options) {

+ 1 - 1
htdocs/core/menus/standard/eldy.lib.php

@@ -2061,7 +2061,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme
 			if (isModEnabled('supplier_order')) {
 			if (isModEnabled('supplier_order')) {
 				$newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->hasRight('stock', 'mouvement', 'creer') && $user->hasRight('fournisseur',  'lire'));
 				$newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->hasRight('stock', 'mouvement', 'creer') && $user->hasRight('fournisseur',  'lire'));
 			}
 			}
-			$newmenu->add("/product/stock/stockatdate.php", $langs->trans("StockAtDate"), 1, $user->hasRight('product', 'read', '', 1) && $user->hasRight('stock', 'lire'));
+			$newmenu->add("/product/stock/stockatdate.php", $langs->trans("StockAtDate"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire'));
 
 
 			// Categories for warehouses
 			// Categories for warehouses
 			if (isModEnabled('categorie')) {
 			if (isModEnabled('categorie')) {

+ 1 - 1
htdocs/core/modules/oauth/google_oauthcallback.php

@@ -42,7 +42,7 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai
 $action = GETPOST('action', 'aZ09');
 $action = GETPOST('action', 'aZ09');
 $backtourl = GETPOST('backtourl', 'alpha');
 $backtourl = GETPOST('backtourl', 'alpha');
 $keyforprovider = GETPOST('keyforprovider', 'aZ09');
 $keyforprovider = GETPOST('keyforprovider', 'aZ09');
-if (!GETPOSTISSET('keyforprovider', 'aZ09') && !empty($_SESSION["oauthkeyforproviderbeforeoauthjump"]) && (GETPOST('code') || $action == 'delete')) {
+if (!GETPOSTISSET('keyforprovider') && !empty($_SESSION["oauthkeyforproviderbeforeoauthjump"]) && (GETPOST('code') || $action == 'delete')) {
 	// If we are coming from the Oauth page
 	// If we are coming from the Oauth page
 	$keyforprovider = $_SESSION["oauthkeyforproviderbeforeoauthjump"];
 	$keyforprovider = $_SESSION["oauthkeyforproviderbeforeoauthjump"];
 }
 }

+ 1 - 1
htdocs/core/tpl/advtarget.tpl.php

@@ -198,7 +198,7 @@ if (!empty($array_query['cust_prospect_status'])) {
 	print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
 	print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
 }
 }
 print '</td><td>';
 print '</td><td>';
-print $formadvtargetemaling->multiselectProspectionStatus($array_query['cust_prospect_status'], 'cust_prospect_status', 1);
+print $formadvtargetemaling->multiselectProspectionStatus($array_query['cust_prospect_status'], 'cust_prospect_status');
 print '</td><td>'."\n";
 print '</td><td>'."\n";
 print '</td></tr>'."\n";
 print '</td></tr>'."\n";
 
 

+ 1 - 1
htdocs/don/payment/card.php

@@ -181,7 +181,7 @@ if ($resql) {
 			// Expected to pay
 			// Expected to pay
 			print '<td class="right">'.price($objp->d_amount).'</td>';
 			print '<td class="right">'.price($objp->d_amount).'</td>';
 			// Status
 			// Status
-			print '<td class="center">'.$don->getLibStatut(4, $objp->amount).'</td>';
+			print '<td class="center">'.$don->getLibStatut(4).'</td>';
 			// Amount paid
 			// Amount paid
 			print '<td class="right">'.price($objp->amount).'</td>';
 			print '<td class="right">'.price($objp->amount).'</td>';
 			print "</tr>\n";
 			print "</tr>\n";

+ 1 - 1
htdocs/ecm/search.php

@@ -175,7 +175,7 @@ print load_fiche_titre($langs->trans("ECMArea").' - '.$langs->trans("Search"));
 print $langs->trans("FeatureNotYetAvailable").'.<br><br>';
 print $langs->trans("FeatureNotYetAvailable").'.<br><br>';
 
 
 // Tool bar
 // Tool bar
-$head = ecm_prepare_head_fm($ecmdir, $module, $section);
+$head = ecm_prepare_head_fm($ecmdir);
 //print dol_get_fiche_head($head, 'search_form', '', 1);
 //print dol_get_fiche_head($head, 'search_form', '', 1);
 
 
 
 

+ 1 - 1
htdocs/expensereport/card.php

@@ -295,7 +295,7 @@ if (empty($reshook)) {
 		}
 		}
 
 
 		if (!$error && empty($conf->global->EXPENSEREPORT_ALLOW_OVERLAPPING_PERIODS)) {
 		if (!$error && empty($conf->global->EXPENSEREPORT_ALLOW_OVERLAPPING_PERIODS)) {
-			$overlappingExpenseReportID = $object->periode_existe($fuser, $object->date_debut, $object->date_fin, true);
+			$overlappingExpenseReportID = $object->periode_existe($fuser, $object->date_debut, $object->date_fin);
 
 
 			if ($overlappingExpenseReportID > 0) {
 			if ($overlappingExpenseReportID > 0) {
 				$error++;
 				$error++;

+ 1 - 1
htdocs/expensereport/payment/card.php

@@ -209,7 +209,7 @@ if ($resql) {
 			print '<td class="right">'.price($objp->total_ttc - $objp->amount).'</td>';
 			print '<td class="right">'.price($objp->total_ttc - $objp->amount).'</td>';
 
 
 			// Status
 			// Status
-			print '<td class="center">'.$expensereport->getLibStatut(4, $objp->amount).'</td>';
+			print '<td class="center">'.$expensereport->getLibStatut(4).'</td>';
 
 
 			print "</tr>\n";
 			print "</tr>\n";
 
 

+ 1 - 1
htdocs/fichinter/class/fichinterrec.class.php

@@ -150,7 +150,7 @@ class FichinterRec extends Fichinter
 		$fichintsrc = new Fichinter($this->db);
 		$fichintsrc = new Fichinter($this->db);
 
 
 		$result = $fichintsrc->fetch($this->id_origin);
 		$result = $fichintsrc->fetch($this->id_origin);
-		$result = $fichintsrc->fetch_lines(1); // to get all lines
+		$result = $fichintsrc->fetch_lines(); // to get all lines
 
 
 
 
 		if ($result > 0) {
 		if ($result > 0) {

+ 1 - 1
htdocs/fourn/ajax/getSupplierPrices.php

@@ -88,7 +88,7 @@ if ($idprod > 0) {
 				$label .= ' ('.$productSupplier->fourn_ref.')';
 				$label .= ' ('.$productSupplier->fourn_ref.')';
 			}
 			}
 
 
-			$prices[] = array("id" => $productSupplier->product_fourn_price_id, "price" => price2num($price, 0, '', 0), "label" => $label, "title" => $title); // For price field, we must use price2num(), for label or title, price()
+			$prices[] = array("id" => $productSupplier->product_fourn_price_id, "price" => price2num($price, '', 0), "label" => $label, "title" => $title); // For price field, we must use price2num(), for label or title, price()
 		}
 		}
 	}
 	}
 
 

+ 1 - 1
htdocs/fourn/class/fournisseur.facture.class.php

@@ -1383,7 +1383,7 @@ class FactureFournisseur extends CommonInvoice
 				$result = $this->update_price(1);
 				$result = $this->update_price(1);
 				if ($result > 0) {
 				if ($result > 0) {
 					// Create link between discount and invoice line
 					// Create link between discount and invoice line
-					$result = $remise->link_to_invoice($lineid, 0, 'supplier');
+					$result = $remise->link_to_invoice($lineid, 0);
 					if ($result < 0) {
 					if ($result < 0) {
 						$this->error = $remise->error;
 						$this->error = $remise->error;
 						$this->db->rollback();
 						$this->db->rollback();

+ 22 - 1
htdocs/fourn/facture/card.php

@@ -1172,7 +1172,28 @@ if (empty($reshook)) {
 							if (!empty($conf->global->MAIN_DEPOSIT_MULTI_TVA) && $diff != 0) {
 							if (!empty($conf->global->MAIN_DEPOSIT_MULTI_TVA) && $diff != 0) {
 								$object->fetch_lines();
 								$object->fetch_lines();
 								$subprice_diff = $object->lines[0]->subprice - $diff / (1 + $object->lines[0]->tva_tx / 100);
 								$subprice_diff = $object->lines[0]->subprice - $diff / (1 + $object->lines[0]->tva_tx / 100);
-								$object->updateline($object->lines[0]->id, $object->lines[0]->desc, $subprice_diff, $object->lines[0]->qty, $object->lines[0]->remise_percent, $object->lines[0]->date_start, $object->lines[0]->date_end, $object->lines[0]->tva_tx, 0, 0, 'HT', $object->lines[0]->info_bits, $object->lines[0]->product_type, 0, 0, 0, $object->lines[0]->pa_ht, $object->lines[0]->label, 0, array(), 100);
+								$object->updateline(
+									$object->lines[0]->id,
+									$object->lines[0]->desc,
+									$subprice_diff,
+									$object->lines[0]->tva_tx,
+									$object->lines[0]->localtax1_tx,
+									$object->lines[0]->localtax2_tx,
+									$object->lines[0]->qty,
+									$object->lines[0]->fk_product,
+									'HT',
+									$object->lines[0]->info_bits,
+									$object->lines[0]->product_type,
+									$object->lines[0]->remise_percent,
+									0,
+									$object->lines[0]->date_start,
+									$object->lines[0]->date_end,
+									0,
+									0,
+									0,
+									'',
+									100
+								);
 							}
 							}
 						} elseif ($result > 0) {
 						} elseif ($result > 0) {
 							$lines = $srcobject->lines;
 							$lines = $srcobject->lines;

+ 2 - 1
htdocs/margin/agentMargins.php

@@ -109,7 +109,8 @@ $text = $langs->trans("Margins");
 //print load_fiche_titre($text);
 //print load_fiche_titre($text);
 
 
 // Show tabs
 // Show tabs
-$head = marges_prepare_head($user);
+$head = marges_prepare_head();
+
 $titre = $langs->trans("Margins");
 $titre = $langs->trans("Margins");
 $picto = 'margin';
 $picto = 'margin';
 
 

+ 2 - 1
htdocs/margin/checkMargins.php

@@ -176,7 +176,8 @@ if ($optioncss != '') {
 }
 }
 
 
 // Show tabs
 // Show tabs
-$head = marges_prepare_head($user);
+$head = marges_prepare_head();
+
 $picto = 'margin';
 $picto = 'margin';
 
 
 print '<form method="post" name="sel" action="'.$_SERVER['PHP_SELF'].'">';
 print '<form method="post" name="sel" action="'.$_SERVER['PHP_SELF'].'">';

+ 2 - 1
htdocs/margin/customerMargins.php

@@ -89,7 +89,8 @@ $text = $langs->trans("Margins");
 //print load_fiche_titre($text);
 //print load_fiche_titre($text);
 
 
 // Show tabs
 // Show tabs
-$head = marges_prepare_head($user);
+$head = marges_prepare_head();
+
 $titre = $langs->trans("Margins");
 $titre = $langs->trans("Margins");
 $picto = 'margin';
 $picto = 'margin';
 
 

+ 2 - 1
htdocs/margin/productMargins.php

@@ -102,7 +102,8 @@ $text = $langs->trans("Margins");
 //print load_fiche_titre($text);
 //print load_fiche_titre($text);
 
 
 // Show tabs
 // Show tabs
-$head = marges_prepare_head($user);
+$head = marges_prepare_head();
+
 $titre = $langs->trans("Margins");
 $titre = $langs->trans("Margins");
 $picto = 'margin';
 $picto = 'margin';
 
 

+ 1 - 1
htdocs/theme/eldy/style.css.php

@@ -91,7 +91,7 @@ if (GETPOST('theme', 'aZ09')) {
 if (GETPOST('lang', 'aZ09')) {
 if (GETPOST('lang', 'aZ09')) {
 	$langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL
 	$langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL
 }
 }
-if (GETPOSTISSET('THEME_DARKMODEENABLED', 'int')) {
+if (GETPOSTISSET('THEME_DARKMODEENABLED')) {
 	$conf->global->THEME_DARKMODEENABLED = GETPOST('THEME_DARKMODEENABLED', 'int'); // If darkmode was forced on URL
 	$conf->global->THEME_DARKMODEENABLED = GETPOST('THEME_DARKMODEENABLED', 'int'); // If darkmode was forced on URL
 }
 }
 
 

+ 2 - 1
qodana.yaml

@@ -79,4 +79,5 @@ exclude:
   - name: PhpArrayIndexImmediatelyRewrittenInspection
   - name: PhpArrayIndexImmediatelyRewrittenInspection
   - name: PhpParameterNameChangedDuringInheritanceInspection
   - name: PhpParameterNameChangedDuringInheritanceInspection
   - name: PhpDuplicateSwitchCaseBodyInspection
   - name: PhpDuplicateSwitchCaseBodyInspection
-  
+  - name: PhpNestedDirNameCallsCanBeReplacedWithLevelParameterInspection
+