Merge branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2012-01-11 22:21:14 +01:00
commit 6c9cbae1f7
3 changed files with 29 additions and 19 deletions

View File

@ -221,7 +221,7 @@ function ajax_combobox($htmlname)
* @param string $code Name of constant * @param string $code Name of constant
* @param array $input Input element * @param array $input Input element
* @param int $entity Entity to set * @param int $entity Entity to set
* TODO add different method for other input (show/hide, disable, ..) * @return void
*/ */
function ajax_constantonoff($code,$input=array(),$entity=false) function ajax_constantonoff($code,$input=array(),$entity=false)
{ {
@ -243,15 +243,20 @@ function ajax_constantonoff($code,$input=array(),$entity=false)
function() { function() {
$("#set_'.$code.'").hide(); $("#set_'.$code.'").hide();
$("#del_'.$code.'").show(); $("#del_'.$code.'").show();
// Enable another object // Enable another element
if (input.length > 0) { if (input.disabled && input.disabled.length > 0) {
$.each(input, function(key,value) { $.each(input.disabled, function(key,value) {
$("#" + value).removeAttr("disabled"); $("#" + value).removeAttr("disabled");
if ($("#" + value).hasClass("butActionRefused") == true) { if ($("#" + value).hasClass("butActionRefused") == true) {
$("#" + value).removeClass("butActionRefused"); $("#" + value).removeClass("butActionRefused");
$("#" + value).addClass("butAction"); $("#" + value).addClass("butAction");
} }
}); });
// Show another element
} else if (input.showhide && input.showhide.length > 0) {
$.each(input.showhide, function(key,value) {
$("#" + value).show();
});
} }
}); });
}); });
@ -266,15 +271,20 @@ function ajax_constantonoff($code,$input=array(),$entity=false)
function() { function() {
$("#del_'.$code.'").hide(); $("#del_'.$code.'").hide();
$("#set_'.$code.'").show(); $("#set_'.$code.'").show();
// Disable another object // Disable another element
if (input.length > 0) { if (input.disabled && input.disabled.length > 0) {
$.each(input, function(key,value) { $.each(input.disabled, function(key,value) {
$("#" + value).attr("disabled", true); $("#" + value).attr("disabled", true);
if ($("#" + value).hasClass("butAction") == true) { if ($("#" + value).hasClass("butAction") == true) {
$("#" + value).removeClass("butAction"); $("#" + value).removeClass("butAction");
$("#" + value).addClass("butActionRefused"); $("#" + value).addClass("butActionRefused");
} }
}); });
// Hide another element
} else if (input.showhide && input.showhide.length > 0) {
$.each(input.showhide, function(key,value) {
$("#" + value).hide();
});
} }
}); });
}); });

View File

@ -269,7 +269,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
if (! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_HIDE_LOGIN_COMBOBOX)) if (! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_HIDE_LOGIN_COMBOBOX))
{ {
$rowspan++; $rowspan++;
$select_entity = $mc->select_entities($lastentity, 'tabindex="3"', 1); $select_entity = $mc->select_entities($lastentity, 'entity', ' tabindex="3"', 1);
} }
// Security graphical code // Security graphical code

View File

@ -228,7 +228,7 @@ if (! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_
} }
} }
$select_entity = $mc->select_entities($lastentity,'tabindex="2"'); $select_entity = $mc->select_entities($lastentity, 'entity', ' tabindex="2"');
} }
// Security graphical code // Security graphical code