2009-09-08 05:29:38 +00:00
|
|
|
var menulist = new Array();
|
|
|
|
|
|
|
|
var menu_opened = "";
|
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
function help(hid) {
|
|
|
|
var top=100; /* (10-screen.height); */
|
|
|
|
var left=100; /*(10-screen.width); */
|
2013-10-17 14:28:23 +00:00
|
|
|
var largeur=800;
|
|
|
|
var hauteur=700;
|
2009-09-08 05:29:38 +00:00
|
|
|
window.open('./aide/help.php?hid='+hid,'help','top='+top+',left='+left+',width='+largeur+',height='+hauteur+',scrollbars=yes');
|
2006-04-26 12:28:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function CheckAll() {
|
2010-06-23 21:58:44 +00:00
|
|
|
chk=document.getElementById('checkall').checked;
|
|
|
|
for (var i = 0; i < document.main.elements.length; i++) {
|
|
|
|
if(document.main.elements[i].type == 'checkbox'){
|
|
|
|
document.main.elements[i].checked = chk;
|
2006-04-26 12:28:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-04-12 14:06:47 +00:00
|
|
|
/*
|
|
|
|
* Function :is_valid_mail
|
|
|
|
* @param : interger arg, an RFC 2822 mail adress
|
|
|
|
* @return : true if arg really is formed like described in RFC 2822, else false
|
2012-08-23 18:46:47 +00:00
|
|
|
* FIXME: does this function is used anywhere ? if yes, remove it, see http://www.bortzmeyer.org/arreter-d-interdire-des-adresses-legales.html
|
2012-04-12 14:06:47 +00:00
|
|
|
*/
|
|
|
|
function is_valid_mail(arg) {
|
|
|
|
//FIXME mail documentation doesn't expect a maximum length of the mail address : http://tools.ietf.org/html/rfc2822#section-3.4.1
|
|
|
|
var rgxp = /^[a-z0-9\!\#\$\%\&\'\*+/=?^_`{|}~-]{1,}((\.[a-z0-9\!\#\$\%\&\'\*+/=?^_`{|}~-]{1,13})?)+@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9\-]*[a-z0-9])?$/
|
2012-04-06 10:10:36 +00:00
|
|
|
if(rgxp.test(arg) == false) {
|
|
|
|
return false;
|
|
|
|
} else {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function menu_toggle(id) {
|
2013-02-04 10:36:47 +00:00
|
|
|
$("#"+id).toggle(200, function() {
|
2013-02-14 15:38:11 +00:00
|
|
|
var tmpi = {};
|
2013-02-04 10:36:47 +00:00
|
|
|
// Animation complete.
|
2013-02-14 15:38:11 +00:00
|
|
|
if ($("#"+id).is(":hidden")) {
|
|
|
|
$("#"+id+"-img").attr("src","images/menu_plus.png");
|
|
|
|
tmpi[''+id] = 'hidden';
|
|
|
|
} else {
|
|
|
|
$("#"+id+"-img").attr("src","images/menu_moins.png");
|
|
|
|
tmpi[''+id] = 'visible';
|
|
|
|
}
|
|
|
|
$.post('tempovars.php', { 'key' : 'menu_toggle', 'val' : tmpi })
|
2013-02-04 10:36:47 +00:00
|
|
|
});
|
2013-01-30 19:56:41 +00:00
|
|
|
|
2012-04-06 10:10:36 +00:00
|
|
|
}
|
|
|
|
|
2012-10-26 13:56:14 +00:00
|
|
|
function false_if_empty(id,err_msg) {
|
|
|
|
if ( $("#"+id).val() == '' ) {
|
|
|
|
alert(err_msg);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-11-08 13:27:46 +00:00
|
|
|
|
|
|
|
function generate_password(len){
|
|
|
|
len = parseInt(len);
|
|
|
|
if(!len)
|
|
|
|
len = 8;
|
|
|
|
var password = "";
|
|
|
|
var chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
|
|
var charsN = chars.length;
|
|
|
|
var nextChar;
|
|
|
|
|
|
|
|
for(i=0; i<len; i++){
|
|
|
|
nextChar = chars.charAt(Math.floor(Math.random()*charsN));
|
|
|
|
password += nextChar;
|
|
|
|
}
|
|
|
|
return password;
|
|
|
|
}
|
|
|
|
|
2013-01-23 13:34:01 +00:00
|
|
|
function generate_password_html(id, size, field1, field2) {
|
2013-04-23 22:04:11 +00:00
|
|
|
$("#z"+id).html("<input id='inp"+id+"' type='textbox' size=8 readonly='readonly' value='"+generate_password(size)+"' /> <a href='javascript:generate_password_html("+id+","+size+",\""+field1+"\",\""+field2+"\");'><img src='/images/refresh.png' alt='Refresh' title='Refresh'/></a>");
|
2012-11-08 13:51:51 +00:00
|
|
|
$("#inp"+id).focus();
|
|
|
|
$("#inp"+id).select();
|
2013-04-23 22:04:11 +00:00
|
|
|
if (field1 != "") { $(field1).val( $("#inp"+id).val() ); }
|
|
|
|
if (field2 != "") { $(field2).val( $("#inp"+id).val() ); }
|
2012-11-08 13:27:46 +00:00
|
|
|
}
|
|
|
|
|