Update ajax.lib.php
This commit is contained in:
parent
633f01e5a2
commit
f25c4f18e6
@ -468,12 +468,11 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0,
|
||||
* @param int $entity Entity to set
|
||||
* @return void
|
||||
*/
|
||||
function ajax_productonoff($id, $code, $input=array(), $entity=null)
|
||||
function ajax_productonoff($id, $code, $input=array())
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
global $conf, $langs, $db;
|
||||
|
||||
$entity = ((isset($entity) && is_numeric($entity) && $entity >= 0) ? $entity : $conf->entity);
|
||||
$object = new Product($db);
|
||||
$object->fetch($id);
|
||||
|
||||
@ -484,10 +483,9 @@ function ajax_productonoff($id, $code, $input=array(), $entity=null)
|
||||
// Set constant
|
||||
$("#set_'.$code.'").click(function() {
|
||||
$.get( "'.DOL_URL_ROOT.'/core/ajax/productonoff.php", {
|
||||
action: \'set\',
|
||||
name: \''.$code.'\',
|
||||
id: \''.$id.'\',
|
||||
entity: \''.$entity.'\'
|
||||
action: \'set'.$code.'\',
|
||||
value: \'1\',
|
||||
id: \''.$id.'\'
|
||||
},
|
||||
function() {
|
||||
$("#set_'.$code.'").hide();
|
||||
@ -513,10 +511,9 @@ function ajax_productonoff($id, $code, $input=array(), $entity=null)
|
||||
// Del constant
|
||||
$("#del_'.$code.'").click(function() {
|
||||
$.get( "'.DOL_URL_ROOT.'/core/ajax/productonoff.php", {
|
||||
action: \'del\',
|
||||
name: \''.$code.'\',
|
||||
id: \''.$id.'\',
|
||||
entity: \''.$entity.'\'
|
||||
action: \'set'.$code.'\',
|
||||
value: \'0\',
|
||||
id: \''.$id.'\'
|
||||
},
|
||||
function() {
|
||||
$("#del_'.$code.'").hide();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user