Skip to content
Snippets Groups Projects
Commit bcddfd87 authored by Regis Houssin's avatar Regis Houssin
Browse files

Fix: bad entity with ajax constant on/off

parent 91fae204
Branches
Tags
No related merge requests found
......@@ -47,7 +47,7 @@ print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY
// Registering the location of boxes
if ((isset($_GET['action']) && ! empty($_GET['action'])) && (isset($_GET['name']) && ! empty($_GET['name'])) )
{
$entity = (GETPOST('entity','int') >= 0 ? GETPOST('entity','int') : $conf->entity);
$entity = GETPOST('entity','int');
$action = GETPOST('action', 'alpha');
$name = GETPOST('name', 'alpha');
......
<?php
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2007-2012 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -229,7 +229,7 @@ function ajax_constantonoff($code,$input=array(),$entity=false)
{
global $conf, $langs;
$entity = ((! empty($entity) && is_numeric($entity) && $entity > 0) || $entity == 0 ? $entity : $conf->entity);
$entity = ((isset($entity) && is_numeric($entity) && $entity >= 0) ? $entity : $conf->entity);
$out= '<script type="text/javascript">
$(function() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment