window.alert=function(_1,id){
if(id){
messageBox=new dijit.Dialog({id:id,refocus:false,title:"Message"});
}else{
messageBox=new dijit.Dialog({refocus:false,title:"Message"});
}
dijit.Dialog.prototype.onHide=function(){
dojo.connect(this,"hide",this,"destroy");
};
messageBox.setContent(_1);
messageBox.show();
messageBox.onHide();
};
function Control(){
this.mainManagerNode=this.getPage("mainManager");
this.mainManager=new mainManager();
this.statsNode=this.getPage("stats");
this.stats=new stats();
this.accountNode=this.getPage("account");
this.account=new account();
this.home=new home();
this.loginNode=this.getPage("login");
this.login=new login();
this.lostPasswordNode=this.getPage("lostPassword");
this.lostPassword=new lostPassword();
this.legalsNode=this.getPage("legals");
this.legals=new legals();
this.contactNode=this.getPage("contact");
this.contact=new contact();
this.planningNode=this.getPage("contact");
this.planning=new planning();
this.errorMsg=null;
this.currentUser=null;
};
Control.prototype.amIlogged=function(){
var _3=new Object();
_3.php_class="Control";
_3.php_method="amIlogged";
_3.php_param=null;
var _4="/index_xhr.php";
this.callback=function(_5,_6){
this.scope.checkNotLogged(_5);
return _5;
};
var _7=5000;
this.xGet=xGet;
this.xGet(_3,_4,this,this.callback,_7);
};
Control.prototype.getPage=function(_8){
var _9=new Object();
_9.page=_8;
_9.php_class="Control";
_9.php_method="get_page";
_9.php_param=_8;
var _a="/index_xhr.php";
this.callback=function(_b,_c){
this.scope.checkNotLogged(_b);
this.myEval=_b.content;
eval("this.scope."+_b.name+"Node=this.myEval;");
return _b;
};
var _d=5000;
this.xGet=xGet;
this.xGet(_9,_a,this,this.callback,_d);
};
Control.prototype.requestPage=function(_e){
if(this.currentUser&&this.currentUser.user_logged==true){
this.amIlogged();
}
eval("this."+_e+".currentUser=this.currentUser;");
eval("this."+_e+".ctrl=this;");
switch(_e){
case "mainManager":
this.mainManager.anyRemoteUsers();
break;
case "login":
this.changePage(_e,false);
break;
case "home":
this.changePage(_e,false);
break;
case "planning":
this.changePage(_e,false);
break;
default:
this.changePage(_e,true);
break;
}
};
Control.prototype.changePage=function(_f,_10){
if(this.currentPage){
eval("this."+this.currentPage+".destroy();");
}
if(_10){
eval("node=this."+_f+"Node;");
if(!node){
setTimeout(dojo.hitch(this,"timeOutChangePage",_f),100);
return;
}
dojo.byId("page").innerHTML=node;
}
eval("this."+_f+".init();");
this.currentPage=_f;
};
Control.prototype.timeOutChangePage=function(_11){
eval("node=this."+_11+"Node;");
if(!node){
setTimeout(dojo.hitch(this,"timeOutChangePage",_11),100);
return;
}
dojo.byId("page").innerHTML=node;
eval("this."+_11+".init();");
};
Control.prototype.changeLang=function(){
this.mainManager.doNotSaveUserWeekType=true;
this.changeLangCounter=0;
this.timeOutChangeLang();
};
Control.prototype.timeOutChangeLang=function(){
if(this.changeLangCounter>=0&&this.changeLangCounter<10){
this.changeLangCounter++;
setTimeout(dojo.hitch(this,"timeOutChangeLang"),100);
}
if(this.changeLangCounter==10){
this.changeLangCounter=-1;
if(lang.name=="fr"){
lang=new English();
}else{
lang=new French();
}
if(this.currentPage=="home"){
window.location="/index.php?lang="+lang.name;
return;
}
this.requestPage(this.currentPage);
this.loadIndexMessages();
this.changeServerLang(lang.name);
}
};
Control.prototype.changeServerLang=function(_12){
var _13=new Object();
_13.php_class="User";
_13.me=this.currentUser;
_13.php_method="changeUserLang";
_13.php_param=_12;
var url="/index_xhr.php?lang="+_12;
this.callback=function(_15,_16){
return _15;
};
var _17=5000;
this.xGet=xGet;
this.xGet(_13,url,this,this.callback,_17);
};
Control.prototype.loadIndexMessages=function(){
dojo.query("[msg^=lang]").forEach(function(_18){
code=_18.getAttribute("msg");
msg=eval(code);
if(_18.type=="submit"){
_18.value=msg;
}else{
_18.innerHTML=msg;
}
});
};
Control.prototype.start=function(){
this.loadIndexMessages();
this.defaultPage();
};
Control.prototype.defaultPage=function(){
if(this.gotoPage){
this.requestPage(this.gotoPage);
}else{
this.requestPage("home");
}
if(this.errorMsg){
alert(this.errorMsg);
}
};
Control.prototype.checkNotLogged=function(_19){
if(_19=="notlogged"){
window.location="/index.php?errorMsg=lang.noSession&page=login";
}
return;
};
function English(){
this.name="en";
this.dojoName="en-us";
};
English.prototype.langLink="Français";
English.prototype.forumLink="Forum";
English.prototype.faqLink="FAQ";
English.prototype.helpLink="Help";
English.prototype.mainManagerLink="Planning";
English.prototype.newAccountLink="Account creation";
English.prototype.homeLink="Home";
English.prototype.loginLink="Sign in";
English.prototype.logoutLink="Log out";
English.prototype.errorLogin="Email or password is not correct, please try again.";
English.prototype.errorNotConfirmed="Thank you to confirm your account with the mail we send to you.";
English.prototype.noSession="Your session has expired, please Log in";
English.prototype.statsLink="Statistics";
English.prototype.downloadLink="My local app";
English.prototype.legalsLink="Legals";
English.prototype.contactLink="Contact";
English.prototype.accountLink="My account";
English.prototype.loginEmail="E-mail : ";
English.prototype.loginPassword="Password : ";
English.prototype.lostPasswordLink="Lost password";
English.prototype.loginTitle="Enter your connection parameters";
English.prototype.loginSubmit="Login";
English.prototype.lostPasswordTitle="Enter your email,to receive the new password";
English.prototype.lostPasswordEmail="E-mail : ";
English.prototype.lostPasswordSend="Send";
English.prototype.successFullLostPassword="Congratulations, your password has been renewed. <br/> You will receive an email with new parameters.";
English.prototype.emailNotFound="Sorry This email address is unknown to us, you're probably <br/> registered with another address. <br/> If you are not registered, <br/> visit the home page.";
English.prototype.noRemoteUser="Your account will be available, "+"<br/> once you have installed the program included in the registration email "+"<br/> and a user of your computer will be logged.";
English.prototype.lundi="Monday";
English.prototype.mardi="Tuesday";
English.prototype.mercredi="Wednesday";
English.prototype.jeudi="Thursday";
English.prototype.vendredi="Friday";
English.prototype.samedi="Saturday";
English.prototype.dimanche="Sunday";
English.prototype.selectionInfoMsg1="User ";
English.prototype.selectionInfoMsg2=" has week type : ";
English.prototype.renameMenuItem="Rename";
English.prototype.saveAsMenuItem="Save as";
English.prototype.newMenuItem="New";
English.prototype.deleteMenuItem="Delete";
English.prototype.weekTypeNotEmpty="Week type should be complete";
English.prototype.cancelButtonWeekType="Cancel";
English.prototype.newButtonWeekType="New week type";
English.prototype.userInfo="Manage users";
English.prototype.weekTypeInfo="Manage week types";
English.prototype.comboInfo="Select user's name and assign him a typical week";
English.prototype.comboInfoManage="Select a typical week, and then choose an action from the menu";
English.prototype.cantDeleteDefaultWeekType="You can't delete \"New User\" week type.";
English.prototype.cantRenameDefaultWeekType="You can't rename \"New User\"  week type.";
English.prototype.cantDeleteDefaultWeekType="You can't delete \"Administrator\" week type.";
English.prototype.cantRenameDefaultWeekType="You can't rename \"Administrator\"  week type.";
English.prototype.cantDeleteUsedWeekType="This typical week is at present allocated to a user <br/>and cannot be erased";
English.prototype.nameWeekTypeExists="This name of typical week already exists, please modify it";
English.prototype.maxDaysInfo="You can enter for each day a maximum in \"hour: minute\", which will have priority over slots allowed";
English.prototype.quotaDayPromptMessage="Enter a maximum time in hh: mm <br/> or nothing if you do not want a maximum per day";
English.prototype.quotaDayInvalidMessage="Hour: minute format invalid";
English.prototype.maxWeekInfo="You can enter for this typical week a maximum in hour, which will have priority over slots allowed";
English.prototype.quotaWeekPromptMessage="Enter a number of hours from 1 to 168, <br/> or nothing if you do not want a maximum per week";
English.prototype.bigUserListTitle="This typical week is active for following users :";
English.prototype.bigUserListTitleNoUser="This typical week is not assigned to any user";
English.prototype.adminWeekTypeExplaination="This week type is not editable. <br/> <small> This is the typical week awarded to the administrator. <br/> You can create or modify typical weeks in th section <b> \"Typical weeks management\" </b> and then assign them to users in the category <b> \"User Management\" </b>. </ small>";
English.prototype.ttWeekType="<b>This section allows you to create, edit and delete types weeks. </b> <br/> You can create your list of typical weeks, you can assign them  to users in the \"User Management\" section. <br/>  <b> Warning :</b> a typical week may be assigned to multiple users.";
English.prototype.ttUser="<b> This section allows you to assign typical weeks to users. </b> <br/>The typical week is selected and can be changed at any time. <br/> <b>  Warning :</b> changes are effective immediately.";
English.prototype.ttCumul="If you want to apply the maximum per day and per week to several computers, click on \"Accumulation of time on several computer, choose a user and check the user of the other computer that you'd like to cumulate. <br/> <b> Warning :</b> This button remains inactive until the resident program has not been installed on several computers.";
English.prototype.weekTypeIdError="An error has occurred, this typical week has no valid ID,<br/> please renew the operation.";
English.prototype.emailValid="Email should be a valid email";
English.prototype.subscribeButton="I subscribe";
English.prototype.successFullSubscribe="Congratulations, vYour subscription has been registered. <br/> You will receive a confirmation email to validate your email address.";
English.prototype.emailAlreadyExists="Sorry, This email address is already in our database, <br/> you're probably already registered with that address. <br/><br/> If you have lost your password, <br/> go to lost password section.";
English.prototype.authorizeDay="Allow this day";
English.prototype.forbidDay="Forbid this day";
English.prototype.buttonFusionLabel="Accumulation of time on several computers";
English.prototype.buttonFusionBackLabel="Back";
English.prototype.fusionInfo="Select a user, then check user(s)concerned by the cumulative time";
English.prototype.alreadyMerged="Already concerned by an accumulation of time";
English.prototype.sameComputer="The users of the same computer can not accumulate time";
English.prototype.warningAdminUser="WARNING : The selected user has an administrator profile. <br/> If you change his schedule, you may be disconnected ...";
English.prototype.myEmailValid="Your email must be valid";
English.prototype.friendEmailValid="Your friend's email must be valid";
English.prototype.successFullSendFriend="An information email about the website parentsdanslesparages.com, has been sent to your friend";
English.prototype.unSuccessFullSendFriend="An error occurred while sending email";
English.prototype.sendToFriend="Send to a friend";
English.prototype.yourEmail="Your email :";
English.prototype.yourFriendEmail="Your Friend's email :";
English.prototype.sendFriendEmail="Send";
English.prototype.newsSubscription="Sign up for newsletter";
English.prototype.facebookShare="Share on facebook";
English.prototype.statError="Error reception parameters !";
English.prototype.statNoDays="No days of use of the computer for the period !";
English.prototype.statNoDay="The computer was not used this day";
English.prototype.statInvalidDay="Incompatible dates";
English.prototype.statNoData="No data available";
English.prototype.statComboGraphTitle="Choice of statistical graphic";
English.prototype.statComboRemoteUserTitle="Choice of the user";
English.prototype.startCalendarTitle="Choose a start date";
English.prototype.endCalendarTitle="Choose an end date";
English.prototype.statsTitle="Statistics for computer use";
English.prototype.graphTempsConnexionDName="Connected time per day from ##date1## to ##date2##";
English.prototype.graphRepartitionConnexionDName="Distribution schedule connections from ##date1## to ##date2##";
English.prototype.graphJourConnexionDName="Connections  ##date1##";
English.prototype.legalsTitle="Legal Information";
English.prototype.legalsMessage1="The website www.parentsdanslesparages.com is published by LC productions.";
English.prototype.legalsMessage2="SARL au capital 3000 Euros, SIRET 492 333 372 00018";
English.prototype.legalsMessage3="N° CNIL : 1374975";
English.prototype.legalsMessage4="Copyright (c) 2009 LC productions<br/>"+"Parents dans les parages, est un logiciel gratuit de contrôle et "+"<br/> limitation du temps d'utilisation de l'ordinateur. "+"<br/>Ce logiciel fonctionne en relation avec notre serveur web,  "+"<br/>et transmet des informations de l'ordinateur vers notre serveur, ces informations concernent "+"<br/>le nom des utilisateurs tels qu'ils sont déclarés dans le système windows "+"<br/>et les dates d'utilisation de l'ordinateur."+"<br/><br/>Ce logiciel est la propriété exclusive de la société LC Productions, et ne peut être copié, "+"<br/>modifié ou utilisé en dehors du cadre prévu par LC productions."+"<br/>La société LC Productions décline toute responsabilité sur les dommages "+"<br/>que pourraient causer ce logiciel, sur l'ordinateur de l'utilisateur."+"<br/><br/>L'utilisateur déclare avoir pris connaissance, de ce texte et en accepte les termes.";
English.prototype.contactTitle="Contact us";
English.prototype.contactEmail="Your E-mail";
English.prototype.contactMessage="Your message";
English.prototype.contactButton="Send";
English.prototype.messageValid="Your message execeed authorized size";
English.prototype.successFullSendContactMessage="Your message has been sent";
English.prototype.unsuccessFullSendContactMessage="Due to a technical problem, your message has not been sent";
English.prototype.accountTitle="My account parameters";
English.prototype.accountChangePassword="Change password";
English.prototype.accountPassword1="Enter new password : ";
English.prototype.accountPassword2="Confirm new password : ";
English.prototype.changePasswordButton="Modify password";
English.prototype.noPassword="You should enter your new password";
English.prototype.invalidPassword="Your new password should have between 6 and 16 characters";
English.prototype.differentPassword="You must enter your password twice identically";
English.prototype.successFullChangePassword="Your password has been changed, an email with your new settings has been sent";
English.prototype.accountChangeEmail="Change email";
English.prototype.accountEmail1="Enter new  email : ";
English.prototype.accountEmail2="Confirm new email : ";
English.prototype.changeEmailButton="Modify email";
English.prototype.emailChangeInValid="One email is not valid";
English.prototype.emailChangeDifferent="You must enter your new email twice identically";
English.prototype.successFullChangeEmail="Your email has been changed, an email with your new settings has been sent";
English.prototype.accountPCList="Computer list";
English.prototype.computerNamePCList="Computer name";
English.prototype.versionPdlpPCList="Resident program version";
English.prototype.versionUptoDatePcList="Resident program up to date";
English.prototype.versionUpgradePcList="There is a more recent resident program version";
English.prototype.versionUpgradeLimitPcList="This version of the resident program is outdated, critical update";
English.prototype.lastVersionLink="Download resident program version ";
English.prototype.accountRUList="User list";
English.prototype.accountMiscParameters="Settings";
English.prototype.deconnectionTime="Time to disconnect the user :";
English.prototype.ruNameRuList="User / Computer";
French.prototype.ruNameRuListDomain="User / Domain";
English.prototype.disabledRuList="Deactivate User";
French.prototype.deleteRuList="Delete User";
French.prototype.deletePcList="Delete PC";
English.prototype.sendPlanningRuList="Send planning by email";
English.prototype.ttDisabledRu="If you select this option, the affected user will not appear anymore and you will lose access to its setting. <br/> Permits to prevent an expired or casual user from appearig in the dropdown.";
French.prototype.ttDeleteRu="Erase user for good.<br/>If the User still exist, it will be automatically recreated";
French.prototype.ttDeletePc="Erase PC for good.<br/>If the PC still exist, it will be automatically recreated.";
English.prototype.remoteUserIsAdmin="This user is administrator";
English.prototype.remoteUserActive="This user is active";
English.prototype.remoteUserDisabled="this user is deactivated";
English.prototype.sendPlanningEmail="Send";
English.prototype.sendPlanningToUser="Send planning to user :";
English.prototype.remoteUserEmail="User's email :";
English.prototype.remoteUserEmailValid="User's email should be valid";
English.prototype.successFullSendPlanning="The user's planning has been sent by email";
English.prototype.unSuccessFullSendPlanning="An error occurred in sending the email";
English.prototype.planningTitle="User planning";
English.prototype.planningMessage1="The website www.parentsdanslesparages.com is published  by LC productions.";
English.prototype.planningNoData="No data available to display the planning";
function French(){
this.name="fr";
this.dojoName="fr";
};
French.prototype.langLink="English";
French.prototype.forumLink="Forum";
French.prototype.faqLink="FAQ";
French.prototype.helpLink="Aide";
French.prototype.mainManagerLink="Planning";
French.prototype.newAccountLink="Créer un compte";
French.prototype.homeLink="Accueil";
French.prototype.loginLink="Connexion";
French.prototype.logoutLink="Déconnexion";
French.prototype.errorLogin="Email ou mot de passe erroné, merci de réessayer.";
French.prototype.errorNotConfirmed="Merci de confirmer votre compte, grâce au mail que vous avez reçu.";
French.prototype.noSession="Votre session à expirée, merci de vous reconnecter";
French.prototype.statsLink="Statistiques";
French.prototype.downloadLink="Mon programme résident";
French.prototype.legalsLink="Mentions légales";
French.prototype.contactLink="Contact";
French.prototype.accountLink="Mon compte";
French.prototype.loginEmail="E-mail : ";
French.prototype.loginPassword="Mot de passe : ";
French.prototype.lostPasswordLink="Mot de passe perdu";
French.prototype.loginTitle="Entrez vos paramètres de connexion";
French.prototype.loginSubmit="Connexion";
French.prototype.lostPasswordTitle="Entrez votre email, pour recevoir un nouveau mot de passe";
French.prototype.lostPasswordEmail="E-mail : ";
French.prototype.lostPasswordSend="Envoyer";
French.prototype.successFullLostPassword="Félicitations, votre mot de passe à été renouvelé.<br/> Vous allez recevoir un mail avec de nouveaux paramètres.";
French.prototype.emailNotFound="Désolé cette adresse email nous est inconnue,<br/>vous êtes probablement inscrit avec une autre adresse.<br/><br/>Si vous n'êtes pas inscrit, <br/>rendez-vous sur la page d'accueil.";
French.prototype.noRemoteUser="Votre compte sera disponible, "+"<br/>dés que vous aurez installé le programme fourni dans le mail d'inscription "+"<br/>et qu'un utilisateur de votre ordinateur aura ouvert une session.";
French.prototype.lundi="Lundi";
French.prototype.mardi="Mardi";
French.prototype.mercredi="Mercredi";
French.prototype.jeudi="Jeudi";
French.prototype.vendredi="Vendredi";
French.prototype.samedi="Samedi";
French.prototype.dimanche="Dimanche";
French.prototype.selectionInfoMsg1="L'utilisateur ";
French.prototype.selectionInfoMsg2=" a la semaine type : ";
French.prototype.renameMenuItem="Renommer";
French.prototype.saveAsMenuItem="Enregistrer sous";
French.prototype.newMenuItem="Nouvelle semaine type";
French.prototype.deleteMenuItem="Effacer";
French.prototype.weekTypeNotEmpty="Le nom de la semaine type doit être complété";
French.prototype.cancelButtonWeekType="Annuler";
French.prototype.newButtonWeekType="Nouvelle semaine type";
French.prototype.userInfo="Gestion des utilisateurs";
French.prototype.weekTypeInfo="Gestion des semaines type";
French.prototype.comboInfo="Sélectionnez le nom de l'utilisateur et affectez lui une semaine type";
French.prototype.comboInfoManage="Sélectionnez une semaine type, puis choisissez une action dans le menu";
French.prototype.cantDeleteDefaultWeekType="La semaine type \"Nouvel utilisateur\" ne peut pas être effacée";
French.prototype.cantRenameDefaultWeekType="La semaine type \"Nouvel utilisateur\" ne peut pas être renommée";
French.prototype.cantDeleteAdminWeekType="La semaine type \"Administrateur\" ne peut pas être effacée";
French.prototype.cantRenameAdminWeekType="La semaine type \"Administrateur\" ne peut pas être renommée";
French.prototype.cantDeleteUsedWeekType="Cette semaine type est actuellement affectée à un utilisateur<br/>et ne peut pas être effacée";
French.prototype.nameWeekTypeExists="Ce nom de semaine type existe déjà, merci de le modifier";
French.prototype.maxDaysInfo="Vous pouvez saisir pour chacun des jours un maximum en \"heure:minute\", qui sera prioritaire sur les créneaux autorisés";
French.prototype.quotaDayPromptMessage="Entrez un temps maximun au format hh:mm, <br/> ou rien si vous ne souhaitez pas de maximum par jour";
French.prototype.quotaDayInvalidMessage="Format heures:minutes invalide";
French.prototype.maxWeekInfo="Vous pouvez saisir pour cette semaine type un maximum d'heure, qui sera prioritaire sur les créneaux autorisés";
French.prototype.quotaWeekPromptMessage="Entrez un nombre d'heure de 1 à 168, <br/> ou rien si vous ne souhaitez pas de maximum par semaine";
French.prototype.quotaWeekInvalidMessage="Nombre d'heures invalide";
French.prototype.bigUserListTitle="Cette semaine type est active pour les utilisateurs suivants :";
French.prototype.bigUserListTitleNoUser="Cette semaine type n'est affectée à aucun utilisateur";
French.prototype.adminWeekTypeExplaination="Cette semaine type n'est pas modifiable.<br/><small>Il s'agit de la semaine type attribuée aux administrateurs.<br/><br/>Vous pouvez créer ou modifier des semaines types dans la rubrique <b>\"Gestion des semaines types\"</b>, puis les affecter aux utilisateurs dans la rubrique <b>\"Gestion des utilisateurs\"</b>.</small>";
French.prototype.ttWeekType="<b>Cette rubrique vous permet de créer, modifier et effacer des semaines types.</b> <br/><br/>Vous pouvez ainsi créer votre liste de semaines type, que vous pourrez affecter aux utilisateurs dans la rubrique \"Gestion des utilisateurs\".<br/><br/><b>Attention !</b> une même semaine type peut être affectée à plusieurs utilisateurs.";
French.prototype.ttUser="<b>Cette rubrique vous permet d'affecter des semaines type aux utilisateurs.</b><br/><br/>La semaine type sélectionnée apparaît et peut être modifiée à tout moment.<br/><br/><b>Attention !</b> les modifications sont prises en compte immediatement.";
French.prototype.ttCumul="Si vous souhaitez que les maximums par jour et par semaine s'appliquent sur plusieurs ordinateurs, cliquez sur le bouton \"Cumul du temps sur plusieurs postes\", choisissez un utilisateur et cocher l'utilisateur de l'autre poste avec lequel vous souhaitez effectuer le cumul. <br/><br/><b>Attention !</b> Ce bouton reste inactif tant que le programme résident n'a pas été installé sur plusieurs ordinateurs.";
French.prototype.weekTypeIdError="Une erreur s'est produite, cette semaine type n'a pas d'identifiant valide, <br/>veuillez renouveller l'opération.";
French.prototype.emailValid="L'email doit être valide";
French.prototype.subscribeButton="Je m'inscris";
French.prototype.successFullSubscribe="Félicitations, votre inscription a bien été enregistrée.<br/> Vous allez recevoir un mail de confirmation pour valider votre adresse email.";
French.prototype.emailAlreadyExists="Désolé cette adresse email figure déjà dans notre base,<br/>vous êtes probablement déjà inscrit avec cette adresse.<br/><br/>Si vous avez perdu votre mot de passe, <br/>rendez-vous sur la rubrique mot de passe perdu, dans le menu connexion.";
French.prototype.authorizeDay="Autoriser ce jour";
French.prototype.forbidDay="Interdire ce jour";
French.prototype.buttonFusionLabel="Cumul du temps sur plusieurs postes";
French.prototype.buttonFusionBackLabel="Retour";
French.prototype.fusionInfo="Sélectionnez un utilisateur, puis cochez le(s) utilisateur(s) concerné(s) par le cumul de temps";
French.prototype.alreadyMerged="Déjà concerné par un cumul de temps";
French.prototype.sameComputer="Les utilisateurs d'un même poste ne peuvent pas cumuler leur temps";
French.prototype.warningAdminUser="ATTENTION : L'utilisateur sélectionné à un profil ADMINISTRATEUR. <br/>Si vous modifiez son planning, vous risquez d'être déconnecté ...";
French.prototype.myEmailValid="Votre email doit être valide";
French.prototype.friendEmailValid="L'email de votre ami doit être valide";
French.prototype.successFullSendFriend="Un email d'information sur le site parentsdanslesparages.com, vient d'être envoyé à votre ami";
French.prototype.unSuccessFullSendFriend="Une erreur c'est produite dans l'envoi de l'email";
French.prototype.sendToFriend="Envoyer à un ami";
French.prototype.yourEmail="Votre email :";
French.prototype.yourFriendEmail="Email de votre ami :";
French.prototype.sendFriendEmail="Envoyer";
French.prototype.newsSubscription="S'inscrire à la newsletter";
French.prototype.facebookShare="Partager sur facebook";
French.prototype.statError="Erreur réception paramètres !";
French.prototype.statNoDays="Pas d'utilisation de l'ordinateur dans la période";
French.prototype.statNoDay="L'ordinateur n'a pas été utilisé ce jour";
French.prototype.statInvalidDay="Dates incompatibles";
French.prototype.statNoData="Pas d'utilisation de l'ordinateur dans la période";
French.prototype.statlabelgraph2="Répartition par tranche horaire ";
French.prototype.statComboGraphTitle="Choix du graphique de statistiques";
French.prototype.statComboRemoteUserTitle="Choix de l'utilisateur";
French.prototype.startCalendarTitle="Choisir une date de début";
French.prototype.endCalendarTitle="Choisir une date de fin";
French.prototype.endCalendarTitle2="Choisir une date";
French.prototype.statsTitle="Statistiques d'utilisation de l'ordinateur";
French.prototype.graphTempsConnexionDName="Temps de connexion du ##date1## au ##date2##";
French.prototype.graphRepartitionConnexionDName="Répartition horaire du ##date1## au ##date2##";
French.prototype.graphJourConnexionDName="Connexions du ##date1##";
French.prototype.legalsTitle="Informations legales";
French.prototype.legalsMessage1="Le site www.parentsdanslesparages.com est édité par la société LC productions.";
French.prototype.legalsMessage2="SARL au capital 3000 Euros, SIRET 492 333 372 00018";
French.prototype.legalsMessage3="N° CNIL : 1374975";
French.prototype.legalsMessage4="Copyright (c) 2009 LC productions<br/>"+"Parents dans les parages, est un logiciel gratuit de contrôle et "+"<br/> limitation du temps d'utilisation de l'ordinateur. "+"<br/>Ce logiciel fonctionne en relation avec notre serveur web,  "+"<br/>et transmet des informations de l'ordinateur vers notre serveur, ces informations concernent "+"<br/>le nom des utilisateurs tels qu'ils sont déclarés dans le système windows "+"<br/>et les dates d'utilisation de l'ordinateur."+"<br/><br/>Ce logiciel est la propriété exclusive de la société LC Productions, et ne peut être copié, "+"<br/>modifié ou utilisé en dehors du cadre prévu par LC productions."+"<br/>La société LC Productions décline toute responsabilité sur les dommages "+"<br/>que pourraient causer ce logiciel, sur l'ordinateur de l'utilisateur."+"<br/><br/>L'utilisateur déclare avoir pris connaissance, de ce texte et en accepte les termes.";
French.prototype.contactTitle="Prendre contact";
French.prototype.contactEmail="Votre E-mail";
French.prototype.contactMessage="Votre message";
French.prototype.contactButton="Envoyer";
French.prototype.messageValid="Votre message dépasse la taille autorisée";
French.prototype.successFullSendContactMessage="Votre message a été envoyé";
French.prototype.unsuccessFullSendContactMessage="Suite à un problème technique votre message, n'a pas pu ête envoyé";
French.prototype.accountTitle="Paramètres de mon compte";
French.prototype.accountChangePassword="Changer de mot de passe";
French.prototype.accountPassword1="Saisisez votre nouveau mot de passe : ";
French.prototype.accountPassword2="Confirmer votre nouveau mot de passe : ";
French.prototype.changePasswordButton="Modifier mon mot de passe";
French.prototype.noPassword="Vous devez saisir votre nouveau mot de passe";
French.prototype.invalidPassword="La taille de votre nouveau mot de passe doit être compris entre 6 et 16 caractères";
French.prototype.differentPassword="Vous devez saisir deux fois votre mot de passe de manière identique";
French.prototype.successFullChangePassword="Votre mot de passe a été modifié, un email avec vos nouveaux paramètres vous a été adressé";
French.prototype.accountChangeEmail="Changer d'email";
French.prototype.accountEmail1="Saisisez votre nouvel email : ";
French.prototype.accountEmail2="Confirmer votre nouvel email : ";
French.prototype.changeEmailButton="Modifier mon email";
French.prototype.emailChangeInValid="Un des email saisi n'est pas valide";
French.prototype.emailChangeDifferent="Vous devez saisir deux fois votre nouvel email de manière identique";
French.prototype.successFullChangeEmail="Votre email a été modifié, un email avec vos nouveaux paramètres vous a été adressé";
French.prototype.accountPCList="Liste de vos ordinateurs";
French.prototype.computerNamePCList="Nom de l'ordinateur";
French.prototype.versionPdlpPCList="Version du programme résident";
French.prototype.versionUptoDatePcList="Version du programme résident à jour";
French.prototype.versionUpgradePcList="Il existe une version du programme résident plus récente";
French.prototype.versionUpgradeLimitPcList="Cette version du programme résident est périmée, mise à jour impérative";
French.prototype.lastVersionLink="Télécharger mon programme résident version ";
French.prototype.accountRUList="Liste de vos utilisateurs";
French.prototype.accountMiscParameters="Paramétrage";
French.prototype.deconnectionTime="Temps avant déconnexion de l'utilisateur :";
French.prototype.ruNameRuList="Utilisateur / Ordinateur";
French.prototype.ruNameRuListDomain="Utilisateur / Domaine";
French.prototype.disabledRuList="Désactiver<br/> l'utilisateur";
French.prototype.deleteRuList="Effacer<br/> l'utilisateur";
French.prototype.deletePcList="Effacer le PC";
French.prototype.sendPlanningRuList="Envoyer le planning par email";
French.prototype.ttDisabledRu="Si vous cochez cette option, l'utilisateur concerné n'apparaitra plus et vous n'aurez plus accès à son paramétrage.<br/>Permet de ne pas faire figuré dans les listes déroulantes un utilisateur occasionnel ou périmé.";
French.prototype.ttDeleteRu="Efface définitivement l'utilisateur.<br/>Si l'utilisateur est toujours présent sur votre ordinateur, il sera automatiquement recréé.";
French.prototype.ttDeletePc="Efface définitivement le PC<br/>Si l'utilisateur est toujours présent sur votre ordinateur, il sera automatiquement recréé.";
French.prototype.remoteUserIsAdmin="Cet utilisateur est administrateur";
French.prototype.remoteUserActive="Cet utilisateur est actif";
French.prototype.remoteUserDisabled="Cet utilisateur est désactivé";
French.prototype.sendPlanningEmail="Envoyer";
French.prototype.sendPlanningToUser="Envoyer son planning à l'utilisateur :";
French.prototype.remoteUserEmail="Email de l'utilisateur :";
French.prototype.remoteUserEmailValid="L'email de l'utilisateur doit être valide";
French.prototype.successFullSendPlanning="Le planning de l'utilisateur a été envoyé par email";
French.prototype.unSuccessFullSendPlanning="Une erreur c'est produite dans l'envoi de l'email";
French.prototype.planningTitle="Planning de l'utilisateur";
French.prototype.planningMessage1="Le site www.parentsdanslesparages.com est édité par la société LC productions.";
French.prototype.planningNoData="Aucune données disponible, pour afficher le planning";
function xGet(_1a,url,_1c,_1d,_1e){
obj=new Object();
obj.url=url;
obj.handleAs="json-comment-filtered";
obj.content={param:dojo.toJson(_1a)};
obj.timeout=_1e;
obj.scope=_1c;
obj.load=_1d;
obj.error=function(_1f,_20){
if(console){
console.error("HTTP status code: ",_20.xhr.status);
}
return _1f;
};
dojo.xhrPost(obj);
};
function xPost(_21,url,_23,_24){
obj=new Object();
obj.url=url;
obj.handleAs="json-comment-filtered";
obj.content={param:dojo.toJson(_21)};
obj.timeout=_24;
obj.load=callback;
obj.error=function(_25,_26){
if(console){
console.error("HTTP status code: ",_26.xhr.status);
}
return _25;
};
dojo.xhrPost(obj);
};
function account(){
this.xGet=xGet;
};
account.prototype.init=function(){
this.ctrl.loadIndexMessages();
if(!this.dijitCreated){
this.createDijit();
}
this.setAccountId();
};
account.prototype.createDijit=function(){
this.dijitCreated=true;
this.createTextBoxPassword1();
this.createTextBoxPassword2();
this.createButtonPassword();
this.createTextBoxEmail1();
this.createTextBoxEmail2();
this.createButtonChangeEmail();
this.createComboDeconnectionTime();
this.getPcs();
this.getRemoteUsers();
this.createTooltipSendPlanning();
this.createButtonSendPlanning();
this.createTextBoxRemoteUserEmail();
};
account.prototype.setAccountId=function(){
dojo.byId("accountId").innerHTML=ctrl.currentUser.user_email;
dojo.byId("feedburnerEmail").value=ctrl.currentUser.user_email;
};
account.prototype.createTextBoxEmail1=function(){
this.textBoxEmail1=new dijit.form.TextBox({name:"textBoxEmail1",style:"width:250px;",trim:true,value:""},dojo.byId("textBoxEmail1"));
this.textBoxEmail1.validateContent=function(_27){
reg=new RegExp("^[a-z0-9]+([_|.|-]{1}[a-z0-9]+)*@[a-z0-9]+([_|.|-]{1}[a-z0-9]+)*[.]{1}[a-z]{2,6}$","i");
email1=trim(this.getDisplayedValue());
if(!reg.test(email1)||!reg.test(trim(_27))){
alert(lang.emailChangeInValid);
return false;
}
if(trim(_27)!=email1){
alert(lang.emailChangeDifferent);
return false;
}
return true;
};
};
account.prototype.createTextBoxEmail2=function(){
this.textBoxEmail2=new dijit.form.TextBox({name:"textBoxEmail2",style:"width:250px;",trim:true,value:""},dojo.byId("textBoxEmail2"));
};
account.prototype.createButtonChangeEmail=function(){
this.buttonChangeEmail=new dijit.form.Button({name:"buttonChangeEmail",label:lang.changeEmailButton},dojo.byId("buttonChangeEmail"));
dojo.connect(this.buttonChangeEmail,"onClick",this,function(){
this.changeEmail(this.textBoxEmail2.getDisplayedValue());
});
dojo.connect(this.buttonChangeEmail.domNode,"onmouseenter",this,function(){
this.buttonChangeEmail.authentic=true;
});
};
account.prototype.createTextBoxPassword1=function(){
this.textBoxPassword1=new dijit.form.TextBox({name:"textBoxPassword1",type:"password",style:"width:250px;",trim:true,value:""},dojo.byId("textBoxPassword1"));
this.textBoxPassword1.validateContent=function(pw2){
pwd=trim(this.getDisplayedValue());
if(!pwd){
alert(lang.noPassword);
return false;
}
if(pwd&&(pwd.length<6||pwd.length>16)){
alert(lang.invalidPassword);
return false;
}
if(pwd&&pwd!=trim(pw2)){
alert(lang.differentPassword);
return false;
}
return true;
};
};
account.prototype.createTextBoxPassword2=function(){
this.textBoxPassword2=new dijit.form.TextBox({name:"textBoxPassword2",type:"password",style:"width:250px;",trim:true,value:""},dojo.byId("textBoxPassword2"));
};
account.prototype.createButtonPassword=function(){
this.buttonPassword=new dijit.form.Button({name:"buttonPassword",label:lang.changePasswordButton},dojo.byId("buttonPassword"));
dojo.connect(this.buttonPassword,"onClick",this,function(){
this.changePassword(this.textBoxPassword1.getDisplayedValue());
});
dojo.connect(this.buttonPassword.domNode,"onmouseenter",this,function(){
this.buttonPassword.authentic=true;
});
};
account.prototype.createTooltipSendPlanning=function(){
this.ttSendPlanning=new dijit.TooltipDialog({id:"ttSendPlanning"},dojo.byId("ttSendPlanning"));
this.ttSendPlanning.startup();
};
account.prototype.createComboDeconnectionTime=function(){
this.comboDeconnectionTime=new dijit.form.ComboBox({id:"comboDeconnectionTime",autoComplete:true,name:"comboDeconnectionTime",value:""},dojo.byId("comboDeconnectionTime"));
dojo.style(this.comboDeconnectionTime.domNode,"width","100px");
this.getDeconnectionTime();
dojo.connect(this.comboDeconnectionTime,"onChange",this,function(){
this.setDeconnectionTime(this.comboDeconnectionTime.getValue());
});
this.comboDeconnectionTime.startup();
};
account.prototype.createTtDisabledRu=function(){
this.ttDisabledRu=new dijit.Tooltip({label:lang.ttDisabledRu,connectId:["ttDisabledRu"]});
};
account.prototype.createTtDeleteRu=function(){
this.ttDeleteRu=new dijit.Tooltip({label:lang.ttDeleteRu,connectId:["ttDeleteRu"]});
};
account.prototype.createTtDeletePc=function(){
this.ttDeletePc=new dijit.Tooltip({label:lang.ttDeletePc,connectId:["ttDeletePc"]});
};
account.prototype.createButtonSendPlanning=function(){
this.buttonSendPlanning=new dijit.form.Button({iconClass:"",showLabel:"false",type:"submit",name:"buttonSendPlanning"},dojo.byId("buttonSendPlanning"));
dojo.connect(this.buttonSendPlanning.domNode,"onmouseenter",this,function(){
this.buttonSendPlanning.authentic=true;
});
dojo.connect(this.buttonSendPlanning,"onClick",this,function(){
this.sendPlanning(this.textBoxRemoteUserEmail.getDisplayedValue());
});
};
account.prototype.createTextBoxRemoteUserEmail=function(){
this.textBoxRemoteUserEmail=new dijit.form.TextBox({type:"text",name:"email",required:"true",invalidMessage:"Email invalide"},dojo.byId("textBoxRemoteUserEmail"));
this.textBoxRemoteUserEmail.validateContent=function(){
reg=new RegExp("^[a-z0-9]+([_|.|-]{1}[a-z0-9]+)*@[a-z0-9]+([_|.|-]{1}[a-z0-9]+)*[.]{1}[a-z]{2,6}$","i");
if(!reg.test(this.getDisplayedValue())){
alert(lang.remoteUserEmailValid);
return false;
}else{
return true;
}
};
};
account.prototype.changeEmail=function(_29){
if(!this.textBoxEmail1.validateContent(this.textBoxEmail2.getDisplayedValue())){
return;
}
var _2a=new Object();
_2a.php_class="User";
_2a.php_method="changeEmail";
_2a.php_param={email:ctrl.currentUser.user_email,new_email:_29};
url="/index_xhr.php";
this.callback=function(_2b,_2c){
this.scope.currentUser=_2b;
if(this.scope.currentUser.user_id){
alert(lang.successFullChangeEmail);
}else{
}
newEmail=trim(this.scope.textBoxEmail1.getDisplayedValue());
ctrl.currentUser.user_email=newEmail;
this.scope.setAccountId();
this.scope.textBoxEmail1.setDisplayedValue("");
this.scope.textBoxEmail2.setDisplayedValue("");
return _2b;
};
timeout=7000;
if(this.buttonChangeEmail.authentic){
this.xGet(_2a,url,this,this.callback,timeout);
}
};
account.prototype.changePassword=function(_2d){
if(!this.textBoxPassword1.validateContent(this.textBoxPassword2.getDisplayedValue())){
this.textBoxPassword1.setDisplayedValue("");
return;
}
var _2e=new Object();
_2e.php_class="User";
_2e.php_method="changePassword";
_2e.php_param={email:ctrl.currentUser.user_email,password:_2d};
url="/index_xhr.php";
this.callback=function(_2f,_30){
this.scope.currentUser=_2f;
if(this.scope.currentUser.user_id){
alert(lang.successFullChangePassword);
}else{
}
this.scope.textBoxPassword1.setDisplayedValue("");
this.scope.textBoxPassword2.setDisplayedValue("");
return _2f;
};
timeout=7000;
if(this.buttonPassword.authentic){
this.xGet(_2e,url,this,this.callback,timeout);
}
};
account.prototype.buildPcList=function(pcs){
dojo.byId("pcList").innerHTML="";
if(!this.tabButtonPc){
this.tabButtonPc=new Array();
}else{
for(i=0;i<this.tabButtonPc.length;i++){
this.tabButtonPc[i].butpcdel.destroy();
delete (this.tabButtonPc[i].pc);
}
}
table=document.createElement("table");
tbody=document.createElement("tbody");
table.appendChild(tbody);
dojo.byId("pcList").appendChild(table);
tr=document.createElement("tr");
tbody.appendChild(tr);
th=document.createElement("th");
tr.appendChild(th);
span=document.createElement("span");
span.setAttribute("class","entetePcList");
span.setAttribute("className","entetePcList");
span.innerHTML=lang.computerNamePCList;
th.appendChild(span);
th=document.createElement("th");
tr.appendChild(th);
span=document.createElement("span");
span.setAttribute("class","entetePcList");
span.setAttribute("className","entetePcList");
span.innerHTML=lang.versionPdlpPCList;
th.appendChild(span);
th=document.createElement("th");
tr.appendChild(th);
span=document.createElement("span");
span.setAttribute("class","entetePcList");
span.setAttribute("className","entetePcList");
span.innerHTML=lang.deletePcList;
th.appendChild(span);
div=document.createElement("div");
div.setAttribute("class","toolTip");
div.setAttribute("className","toolTip");
div.setAttribute("id","ttDeletePc");
th.appendChild(div);
for(i=0;i<pcs.length;i++){
tr=document.createElement("tr");
tbody.appendChild(tr);
td=document.createElement("td");
tr.appendChild(td);
span=document.createElement("span");
span.setAttribute("class","labelPcList");
span.setAttribute("className","labelPcList");
span.innerHTML=pcs[i].computer_name;
td.appendChild(span);
td=document.createElement("td");
tr.appendChild(td);
span=document.createElement("span");
cssClassName="versionUptoDatePcList";
versionTitle=lang.versionUptoDatePcList;
if(parseFloat(pcs[i].pdlp_version)<parseFloat(pcs[i].current_version)){
cssClassName="versionUpgradePcList";
versionTitle=lang.versionUpgradePcList;
}
if(parseFloat(pcs[i].pdlp_version)<parseFloat(pcs[i].version_limit)){
cssClassName="versionUpgradeLimitPcList";
versionTitle=lang.versionUpgradeLimitPcList;
}
span.setAttribute("class",cssClassName);
span.setAttribute("title",versionTitle);
span.setAttribute("className",cssClassName);
span.innerHTML=pcs[i].pdlp_version;
td.appendChild(span);
td=document.createElement("td");
tr.appendChild(td);
nodeButPcDel=document.createElement("div");
nodeButPcDel.id="but_pc_del_"+pcs[i].mac+"_"+pcs[i].computer_name;
td.appendChild(nodeButPcDel);
iconClassDeleteButton="dijitDeleteGreyIcon";
if(pcs[i].nb_pc_left>1){
iconClassDeleteButton="dijitDeleteIcon";
}
this.tabButtonPc[i]={butpcdel:new dijit.form.Button({label:"",iconClass:iconClassDeleteButton,showLabel:false},nodeButPcDel.id),pc:pcs[i]};
dojo.connect(dojo.byId(nodeButPcDel.id),"onclick",this,this.clickButtonDelPc);
this.tabButtonPc[i].butpcdel.startup();
currentVersion=pcs[i].current_version;
}
tr=document.createElement("tr");
tbody.appendChild(tr);
td=document.createElement("td");
td.setAttribute("class","emptyCellPcList");
td.setAttribute("colspan","3");
td.setAttribute("className","emptyCellPcList");
td.innerHTML="<a class=\"indexLink lastVersionLink\" onclick=\"window.location=ctrl.urlExe;\">"+lang.lastVersionLink+parseFloat(currentVersion)+"</a>";
tr.appendChild(td);
};
account.prototype.buildRuCheckBoxList=function(_32){
dojo.byId("checkBoxRemoteUserListAccount").innerHTML="";
if(!this.tabCbRemoteUsers){
this.tabCbRemoteUsers=new Array();
}else{
for(i=0;i<this.tabCbRemoteUsers.length;i++){
this.tabCbRemoteUsers[i].cb.destroy();
this.tabCbRemoteUsers[i].dd.destroy();
this.tabCbRemoteUsers[i].butdel.destroy();
delete (this.tabCbRemoteUsers[i].ru);
}
}
table=document.createElement("table");
tbody=document.createElement("tbody");
table.appendChild(tbody);
dojo.byId("checkBoxRemoteUserListAccount").appendChild(table);
tr=document.createElement("tr");
tbody.appendChild(tr);
th=document.createElement("th");
tr.appendChild(th);
span=document.createElement("span");
span.setAttribute("class","enteteRuList");
span.setAttribute("className","enteteRuList");
span.innerHTML=lang.ruNameRuList;
if(ctrl.currentUser.user_has_domain){
span.innerHTML=lang.ruNameRuListDomain;
}
th.appendChild(span);
th=document.createElement("th");
tr.appendChild(th);
span=document.createElement("span");
span.setAttribute("class","enteteRuList");
span.setAttribute("className","enteteRuList");
span.innerHTML=lang.disabledRuList;
th.appendChild(span);
div=document.createElement("div");
div.setAttribute("class","toolTip");
div.setAttribute("className","toolTip");
div.setAttribute("id","ttDisabledRu");
th.appendChild(div);
th=document.createElement("th");
tr.appendChild(th);
span=document.createElement("span");
span.setAttribute("class","enteteRuList");
span.setAttribute("className","enteteRuList");
span.innerHTML=lang.deleteRuList;
th.appendChild(span);
div=document.createElement("div");
div.setAttribute("class","toolTip");
div.setAttribute("className","toolTip");
div.setAttribute("id","ttDeleteRu");
th.appendChild(div);
th=document.createElement("th");
tr.appendChild(th);
span=document.createElement("span");
span.setAttribute("class","enteteRuList");
span.setAttribute("className","enteteRuList");
span.innerHTML=lang.sendPlanningRuList;
th.appendChild(span);
this.tabCbRemoteUsers=new Array();
for(i=0;i<_32.length;i++){
tr=document.createElement("tr");
tbody.appendChild(tr);
td=document.createElement("td");
tr.appendChild(td);
span=document.createElement("span");
span.id="label_ru_"+_32[i].remote_user_id;
span.setAttribute("class","cbLabelRemoteUserListAccount");
span.setAttribute("className","cbLabelRemoteUserListAccount");
span.innerHTML=_32[i].remote_user_name+" / "+_32[i].computer_name;
td.appendChild(span);
td=document.createElement("td");
tr.appendChild(td);
node=document.createElement("div");
node.id="cb_ru_"+_32[i].remote_user_id;
td.appendChild(node);
td=document.createElement("td");
tr.appendChild(td);
nodeButDel=document.createElement("div");
nodeButDel.id="but_ru_del_"+_32[i].remote_user_id;
td.appendChild(nodeButDel);
td=document.createElement("td");
tr.appendChild(td);
nodeDd=document.createElement("div");
nodeDd.id="dd_ru_"+_32[i].remote_user_id;
td.appendChild(nodeDd);
if(_32[i].remote_user_disabled){
isChecked=true;
span.setAttribute("title","");
dojo.style(span,"color","#AAAAAA");
dojo.style(span,"cursor","pointer");
span.setAttribute("title",lang.remoteUserDisabled);
}else{
isChecked=false;
span.setAttribute("title","");
dojo.style(span,"color","#000000");
dojo.style(span,"cursor","pointer");
span.setAttribute("title",lang.remoteUserActive);
}
iconClassDeleteButton="dijitDeleteIcon";
if(_32[i].remote_user_default){
isDisabled=true;
dojo.style(span,"color","red");
dojo.style(span,"cursor","pointer");
span.setAttribute("title",lang.remoteUserIsAdmin);
iconClassDeleteButton="dijitDeleteGreyIcon";
}else{
isDisabled=false;
}
this.tabCbRemoteUsers[i]={cb:new dijit.form.CheckBox({id:node.id,value:node.id,name:node.id,disabled:isDisabled,checked:isChecked},node.id),butdel:new dijit.form.Button({label:"",iconClass:iconClassDeleteButton,showLabel:false},nodeButDel.id),dd:new dijit.form.DropDownButton({label:"",iconClass:"dijitSendToFriendIcon",showLabel:false,dropDown:this.ttSendPlanning},nodeDd.id),ru:_32[i],span:span};
dojo.connect(dojo.byId(node.id),"onclick",this,this.clickCheckBoxRu);
dojo.connect(dojo.byId(nodeButDel.id),"onclick",this,this.clickButtonDelRu);
dojo.connect(dojo.byId(nodeDd.id),"onclick",this,this.clickDropDownRu);
this.tabCbRemoteUsers[i].cb.startup();
this.tabCbRemoteUsers[i].butdel.startup();
this.tabCbRemoteUsers[i].dd.startup();
}
};
account.prototype.clickCheckBoxRu=function(e){
for(i=0;i<this.tabCbRemoteUsers.length;i++){
if(this.tabCbRemoteUsers[i].cb.id==e.currentTarget.id){
index=i;
clickedCbRu=this.tabCbRemoteUsers[i];
if(clickedCbRu.cb.checked){
clickedCbRu.ru.remote_user_disabled=true;
dojo.style(clickedCbRu.span,"color","#AAAAAA");
dojo.style(clickedCbRu.span,"cursor","pointer");
clickedCbRu.span.setAttribute("title",lang.remoteUserDisabled);
}else{
clickedCbRu.ru.remote_user_disabled=false;
dojo.style(clickedCbRu.span,"color","#000000");
dojo.style(clickedCbRu.span,"cursor","pointer");
clickedCbRu.span.setAttribute("title",lang.remoteUserActive);
}
}
}
this.saveDisabledRu();
};
account.prototype.clickDropDownRu=function(e){
for(i=0;i<this.tabCbRemoteUsers.length;i++){
if(this.tabCbRemoteUsers[i].dd.id==e.currentTarget.id){
index=i;
clickedDdRu=this.tabCbRemoteUsers[i];
this.currentRemoteUser=clickedDdRu.ru;
dojo.byId("remoteUserNameTarget").innerHTML=lang.sendPlanningToUser+" "+this.currentRemoteUser.remote_user_name+" / "+this.currentRemoteUser.computer_name;
}
}
};
account.prototype.clickButtonDelRu=function(e){
for(i=0;i<this.tabCbRemoteUsers.length;i++){
if(this.tabCbRemoteUsers[i].butdel.id==e.currentTarget.id){
index=i;
if(!this.tabCbRemoteUsers[i].ru.remote_user_default){
this.deleteRu(this.tabCbRemoteUsers[i].ru);
}
}
}
};
account.prototype.clickButtonDelPc=function(e){
for(i=0;i<this.tabButtonPc.length;i++){
if(this.tabButtonPc[i].butpcdel.id==e.currentTarget.id){
index=i;
if(this.tabButtonPc[i].pc.nb_pc_left>1){
this.deletePc(this.tabButtonPc[i].pc);
}
}
}
};
account.prototype.saveDisabledRu=function(){
param=new Object();
param.php_class="RemoteUser";
param.php_method="saveDisabledRu";
remoteUsers=new Array();
for(i=0;i<this.tabCbRemoteUsers.length;i++){
remoteUsers[i]=this.tabCbRemoteUsers[i].ru;
}
param.php_param=remoteUsers;
url="/index_xhr.php";
this.callback=function(_37,_38){
this.scope.ctrl.checkNotLogged(_37);
if(!_37){
}else{
}
return _37;
};
timeout=7000;
this.xGet(param,url,this,this.callback,timeout);
};
account.prototype.deleteRu=function(ru){
param=new Object();
param.php_class="RemoteUser";
param.php_method="deleteRu";
remoteUsers=new Array();
param.php_param=ru;
url="/index_xhr.php";
this.callback=function(_3a,_3b){
this.scope.ctrl.checkNotLogged(_3a);
if(!_3a){
}else{
this.scope.getRemoteUsers();
}
return _3a;
};
timeout=7000;
this.xGet(param,url,this,this.callback,timeout);
};
account.prototype.deletePc=function(pc){
param=new Object();
param.php_class="Pc";
param.php_method="deletePc";
remoteUsers=new Array();
param.php_param=pc;
url="/index_xhr.php";
this.callback=function(_3d,_3e){
this.scope.ctrl.checkNotLogged(_3d);
if(!_3d){
}else{
this.scope.getPcs();
this.scope.getRemoteUsers();
}
return _3d;
};
timeout=7000;
this.xGet(param,url,this,this.callback,timeout);
};
account.prototype.sendPlanning=function(_3f){
if(!this.textBoxRemoteUserEmail.validateContent()){
this.textBoxRemoteUserEmail.setDisplayedValue("");
return;
}
param=new Object();
param.php_class="RemoteUser";
param.php_method="sendPlanning";
param.me=this.currentRemoteUser;
param.php_param=_3f;
url="/index_xhr.php";
this.callback=function(_40,_41){
this.scope.ctrl.checkNotLogged(_40);
if(_40){
alert(lang.successFullSendPlanning);
}else{
alert(lang.unSuccessFullSendPlanning);
}
return _40;
};
timeout=7000;
this.xGet(param,url,this,this.callback,timeout);
};
account.prototype.getPcs=function(){
param=new Object();
param.php_class="Pc";
param.php_method="getPcs";
param.php_param=ctrl.currentUser.user_id;
url="/index_xhr.php";
this.callback=function(_42,_43){
this.scope.ctrl.checkNotLogged(_42);
if(!_42){
}else{
this.scope.buildPcList(_42);
}
return _42;
};
timeout=7000;
this.xGet(param,url,this,this.callback,timeout);
};
account.prototype.setDeconnectionTime=function(_44){
seconds=180;
_44=trim(_44);
if(_44=="1 min"){
seconds=60;
}
if(_44=="2 min"){
seconds=120;
}
if(_44=="3 min"){
seconds=180;
}
if(_44=="4 min"){
seconds=240;
}
if(_44=="5 min"){
seconds=300;
}
param=new Object();
param.php_class="User";
param.me=this.currentUser;
param.php_method="setDeconnectionTime";
param.php_param=seconds;
url="/index_xhr.php";
this.callback=function(_45,_46){
this.scope.ctrl.checkNotLogged(_45);
if(!_45){
}else{
}
return _45;
};
timeout=7000;
this.xGet(param,url,this,this.callback,timeout);
};
account.prototype.getDeconnectionTime=function(){
param=new Object();
param.php_class="User";
param.me=this.currentUser;
param.php_method="getDeconnectionTime";
param.php_param=null;
url="/index_xhr.php";
this.callback=function(_47,_48){
this.scope.ctrl.checkNotLogged(_47);
if(!_47){
}else{
textTime="2 min";
seconds=_47;
minutes=(seconds/60)-(seconds%60);
if(minutes){
textTime=minutes+" min";
}
this.scope.comboDeconnectionTime.setValue(textTime);
}
return _47;
};
timeout=7000;
this.xGet(param,url,this,this.callback,timeout);
};
account.prototype.getRemoteUsers=function(){
param=new Object();
param.php_class="User";
param.me=this.currentUser;
param.php_method="getRemoteUsersUTF8";
param.php_param=null;
url="/index_xhr.php";
this.callback=function(_49,_4a){
this.scope.ctrl.checkNotLogged(_49);
if(!_49){
}else{
this.scope.buildRuCheckBoxList(_49);
this.scope.createTtDisabledRu(_49);
this.scope.createTtDeleteRu(_49);
this.scope.createTtDeletePc(_49);
}
return _49;
};
timeout=7000;
this.xGet(param,url,this,this.callback,timeout);
};
account.prototype.destroy=function(){
this.textBoxEmail1.destroy();
this.textBoxEmail2.destroy();
this.textBoxPassword1.destroy();
this.textBoxPassword2.destroy();
this.buttonPassword.destroy();
this.buttonChangeEmail.destroy();
this.comboDeconnectionTime.destroy();
this.ttDisabledRu.destroy();
this.ttDeleteRu.destroy();
this.ttDeletePc.destroy();
this.ttSendPlanning.destroy();
this.buttonSendPlanning.destroy();
this.textBoxRemoteUserEmail.destroy();
if(this.tabCbRemoteUsers){
for(i=0;i<this.tabCbRemoteUsers.length;i++){
this.tabCbRemoteUsers[i].cb.destroy();
this.tabCbRemoteUsers[i].dd.destroy();
this.tabCbRemoteUsers[i].butdel.destroy();
delete (this.tabCbRemoteUsers[i].ru);
}
}
this.dijitCreated=false;
};
function contact(){
this.xGet=xGet;
};
contact.prototype.init=function(){
this.ctrl.loadIndexMessages();
if(!this.dijitCreated){
this.createDijit();
}
};
contact.prototype.createDijit=function(){
this.dijitCreated=true;
this.createTextBoxEmail();
this.createTextBoxMessage();
this.createButtonEmail();
};
contact.prototype.createTextBoxEmail=function(){
this.textBoxEmail=new dijit.form.TextBox({name:"textBoxEmail",style:"width:250px;",trim:true,value:""},dojo.byId("textBoxEmail"));
this.textBoxEmail.validateContent=function(){
reg=new RegExp("^[a-z0-9]+([_|.|-]{1}[a-z0-9]+)*@[a-z0-9]+([_|.|-]{1}[a-z0-9]+)*[.]{1}[a-z]{2,6}$","i");
if(!reg.test(this.getDisplayedValue())){
alert(lang.emailValid);
return false;
}else{
return true;
}
};
};
contact.prototype.createTextBoxMessage=function(){
this.textBoxMessage=new dijit.form.SimpleTextarea({name:"textBoxMessage",style:"width:250px;",trim:true,rows:5,cols:50,value:""},dojo.byId("textBoxMessage"));
this.textBoxMessage.validateContent=function(){
this.maxLength=1000;
if(this.getValue().length>this.maxLength){
alert(lang.messageValid);
return false;
}else{
return true;
}
};
};
contact.prototype.createButtonEmail=function(){
this.buttonEmail=new dijit.form.Button({name:"buttonEmail",label:lang.contactButton},dojo.byId("buttonEmail"));
dojo.connect(this.buttonEmail,"onClick",this,function(){
this.sendContactMessage(this.textBoxEmail.getDisplayedValue(),this.textBoxMessage.getValue());
});
dojo.connect(this.buttonEmail.domNode,"onmouseenter",this,function(){
this.buttonEmail.authentic=true;
});
};
contact.prototype.sendContactMessage=function(_4b,_4c){
if(!this.textBoxEmail.validateContent()){
this.textBoxEmail.setDisplayedValue("");
return;
}
if(!this.textBoxMessage.validateContent()){
this.textBoxMessage.setValue(this.textBoxMessage.getValue().substr(0,this.textBoxMessage.maxLength));
return;
}
var _4d=new Object();
_4d.php_class="User";
_4d.php_method="sendContactMessage";
_4d.php_param={email:_4b,message:_4c};
url="/index_xhr.php";
this.callback=function(_4e,_4f){
this.scope.currentUser=_4e;
if(_4e){
alert(lang.successFullSendContactMessage);
this.scope.textBoxEmail.setDisplayedValue("");
this.scope.textBoxMessage.setValue("");
}else{
alert(lang.unsuccessFullSendContactMessage);
}
return _4e;
};
timeout=5000;
if(this.buttonEmail.authentic){
this.xGet(_4d,url,this,this.callback,timeout);
}
};
contact.prototype.destroy=function(){
this.textBoxEmail.destroy();
this.textBoxMessage.destroy();
this.buttonEmail.destroy();
this.dijitCreated=false;
};
function home(){
this.xGet=xGet;
};
home.prototype.init=function(){
if(!this.ctrl){
this.ctrl=ctrl;
}
if(!this.dijitCreated){
this.createDijit();
}
};
home.prototype.createDijit=function(){
this.dijitCreated=true;
this.createTextBoxEmail();
this.createButtonEmail();
this.createTooltipSendToFriend();
this.createDropDownButtonSendToFriend();
this.createButtonSendToFriend();
this.createTextBoxFriendEmail();
this.createTextBoxMyEmail();
};
home.prototype.createTextBoxEmail=function(){
this.textBoxEmail=new dijit.form.TextBox({name:"textBoxEmail",style:"width:250px;",trim:true,value:""},dojo.byId("textBoxEmail"));
this.textBoxEmail.validateContent=function(){
reg=new RegExp("^[a-z0-9]+([_|.|-]{1}[a-z0-9]+)*@[a-z0-9]+([_|.|-]{1}[a-z0-9]+)*[.]{1}[a-z]{2,6}$","i");
if(!reg.test(this.getDisplayedValue())){
alert(lang.emailValid);
return false;
}else{
return true;
}
};
};
home.prototype.createButtonEmail=function(){
this.buttonEmail=new dijit.form.Button({name:"buttonEmail",label:lang.subscribeButton},dojo.byId("buttonEmail"));
dojo.connect(this.buttonEmail,"onClick",this,function(){
this.subscribe(this.textBoxEmail.getDisplayedValue());
});
dojo.connect(this.buttonEmail.domNode,"onmouseenter",this,function(){
this.buttonEmail.authentic=true;
});
};
home.prototype.createTooltipSendToFriend=function(){
this.ttSendToFriend=new dijit.TooltipDialog({id:"ttSendToFriendid"},dojo.byId("ttSendToFriend"));
this.ttSendToFriend.startup();
};
home.prototype.createDropDownButtonSendToFriend=function(){
this.dropDownButtonSendToFriend=new dijit.form.DropDownButton({label:"<span class=sendToFriendText>"+lang.sendToFriend+"</span>",iconClass:"dijitSendToFriendIcon",showLabel:"true",dropDown:this.ttSendToFriend},dojo.byId("dropDownButtonSendToFriend"));
this.dropDownButtonSendToFriend.startup();
};
home.prototype.createButtonSendToFriend=function(){
this.buttonSendToFriend=new dijit.form.Button({iconClass:"",label:lang.sendFriendEmail,id:"buttonSendToFriend",name:"buttonSendToFriend"},dojo.byId("buttonSendToFriend"));
this.buttonSendToFriend.startup();
dojo.connect(this.buttonSendToFriend.domNode,"onmouseenter",this,function(){
this.buttonSendToFriend.authentic=true;
});
dojo.connect(this.buttonSendToFriend,"onClick",this,function(){
this.sendToFriend(this.textBoxFriendEmail.getDisplayedValue(),this.textBoxMyEmail.getDisplayedValue());
});
};
home.prototype.createTextBoxFriendEmail=function(){
this.textBoxFriendEmail=new dijit.form.TextBox({type:"text",name:"email",required:"true",invalidMessage:"Email invalide"},dojo.byId("textBoxFriendEmail"));
this.textBoxFriendEmail.validateContent=function(){
reg=new RegExp("^[a-z0-9]+([_|.|-]{1}[a-z0-9]+)*@[a-z0-9]+([_|.|-]{1}[a-z0-9]+)*[.]{1}[a-z]{2,6}$","i");
if(!reg.test(this.getDisplayedValue())){
alert(lang.friendEmailValid);
return false;
}else{
return true;
}
};
};
home.prototype.createTextBoxMyEmail=function(){
this.textBoxMyEmail=new dijit.form.TextBox({type:"text",name:"textBoxMyEmail",required:"true",invalidMessage:"Email invalide"},dojo.byId("textBoxMyEmail"));
this.textBoxMyEmail.validateContent=function(){
reg=new RegExp("^[a-z0-9]+([_|.|-]{1}[a-z0-9]+)*@[a-z0-9]+([_|.|-]{1}[a-z0-9]+)*[.]{1}[a-z]{2,6}$","i");
if(!reg.test(this.getDisplayedValue())){
alert(lang.myEmailValid);
return false;
}else{
return true;
}
};
};
home.prototype.subscribe=function(_50){
if(!this.textBoxEmail.validateContent()){
this.textBoxEmail.setDisplayedValue("");
return;
}
var _51=new Object();
_51.php_class="User";
_51.php_method="subscribe";
_51.php_param={email:_50,user_lang:lang.name};
url="/index_xhr.php";
this.callback=function(_52,_53){
this.scope.currentUser=_52;
if(this.scope.currentUser.user_id){
alert(lang.successFullSubscribe);
}else{
alert(lang.emailAlreadyExists);
}
this.scope.textBoxEmail.setDisplayedValue("");
return _52;
};
timeout=5000;
if(this.buttonEmail.authentic){
this.xGet(_51,url,this,this.callback,timeout);
}
};
home.prototype.sendToFriend=function(_54,_55){
console.debug("sendToFriend");
if(!this.textBoxMyEmail.validateContent()){
this.textBoxMyEmail.setDisplayedValue("");
return;
}
if(!this.textBoxFriendEmail.validateContent()){
this.textBoxFriendEmail.setDisplayedValue("");
return;
}
var _56=new Object();
_56.php_class="User";
_56.php_method="sendToFriend";
_56.php_param={friendEmail:_54,myEmail:_55,user_lang:lang.name};
url="/index_xhr.php";
this.callback=function(_57,_58){
if(_57){
alert(lang.successFullSendFriend);
}else{
alert(lang.unSuccessFullSendFriend);
}
this.scope.textBoxFriendEmail.setDisplayedValue("");
this.scope.textBoxMyEmail.setDisplayedValue("");
return _57;
};
timeout=5000;
if(this.buttonSendToFriend.authentic){
this.xGet(_56,url,this,this.callback,timeout);
}
};
home.prototype.destroy=function(){
this.textBoxEmail.destroy();
this.buttonEmail.destroy();
this.ttSendToFriend.destroy();
this.dropDownButtonSendToFriend.destroy();
this.buttonSendToFriend.destroy();
this.textBoxFriendEmail.destroy();
this.textBoxMyEmail.destroy();
this.dijitCreated=false;
};
function legals(){
this.xGet=xGet;
};
legals.prototype.init=function(){
this.ctrl.loadIndexMessages();
};
legals.prototype.destroy=function(){
};
function login(){
this.xGet=xGet;
};
login.prototype.init=function(){
if(!this.ctrl){
this.ctrl=ctrl;
}
this.ctrl.loadIndexMessages();
};
login.prototype.destroy=function(){
};
function lostPassword(){
this.xGet=xGet;
};
lostPassword.prototype.init=function(){
this.ctrl.loadIndexMessages();
if(!this.dijitCreated){
this.createDijit();
}
};
lostPassword.prototype.createDijit=function(){
this.dijitCreated=true;
this.createTextBoxEmail();
this.createButtonEmail();
};
lostPassword.prototype.createTextBoxEmail=function(){
this.textBoxEmail=new dijit.form.TextBox({name:"textBoxEmail",style:"width:250px;",trim:true,value:""},dojo.byId("textBoxEmail"));
this.textBoxEmail.validateContent=function(){
reg=new RegExp("^[a-z0-9]+([_|.|-]{1}[a-z0-9]+)*@[a-z0-9]+([_|.|-]{1}[a-z0-9]+)*[.]{1}[a-z]{2,6}$","i");
if(!reg.test(this.getDisplayedValue())){
alert(lang.emailValid);
return false;
}else{
return true;
}
};
};
lostPassword.prototype.createButtonEmail=function(){
this.buttonEmail=new dijit.form.Button({name:"buttonEmail",label:lang.lostPasswordSend},dojo.byId("buttonEmail"));
dojo.connect(this.buttonEmail,"onClick",this,function(){
this.lostPassword(this.textBoxEmail.getDisplayedValue());
});
dojo.connect(this.buttonEmail.domNode,"onmouseenter",this,function(){
this.buttonEmail.authentic=true;
});
};
lostPassword.prototype.lostPassword=function(_59){
if(!this.textBoxEmail.validateContent()){
this.textBoxEmail.setDisplayedValue("");
return;
}
var _5a=new Object();
_5a.php_class="User";
_5a.php_method="lostPassword";
_5a.php_param={email:_59,user_lang:lang.name};
url="/index_xhr.php";
this.callback=function(_5b,_5c){
this.scope.currentUser=_5b;
if(this.scope.currentUser.user_id){
alert(lang.successFullLostPassword);
}else{
alert(lang.emailNotFound);
}
this.scope.textBoxEmail.setDisplayedValue("");
return _5b;
};
timeout=5000;
if(this.buttonEmail.authentic){
this.xGet(_5a,url,this,this.callback,timeout);
}
};
lostPassword.prototype.destroy=function(){
this.textBoxEmail.destroy();
this.buttonEmail.destroy();
this.dijitCreated=false;
};
function mainManager(){
this.xGet=xGet;
this.refTab=new Object();
this.refTab.slots=new Array();
};
mainManager.prototype.init=function(){
this.ctrl.loadIndexMessages();
this.dayWidth=90;
this.dayHeight=1440;
this.timeSlotHeight=30;
this.pixelToMinute=1;
this.roundPixel=30;
this.days=new Array("J1","J2","J3","J4","J5","J6","J7");
this.dayNames=new Array(lang.lundi,lang.mardi,lang.mercredi,lang.jeudi,lang.vendredi,lang.samedi,lang.dimanche);
this.extendColor="green";
this.parentNode=dojo.byId("weekWrapper");
dojo.connect(dojo.byId("J1"),"onclick",this,this.createSlot);
dojo.connect(dojo.byId("J2"),"onclick",this,this.createSlot);
dojo.connect(dojo.byId("J3"),"onclick",this,this.createSlot);
dojo.connect(dojo.byId("J4"),"onclick",this,this.createSlot);
dojo.connect(dojo.byId("J5"),"onclick",this,this.createSlot);
dojo.connect(dojo.byId("J6"),"onclick",this,this.createSlot);
dojo.connect(dojo.byId("J7"),"onclick",this,this.createSlot);
for(var i=0;i<24;i++){
hour=document.createElement("div");
hour.setAttribute("class","hourNameDiv");
hour.setAttribute("className","hourNameDiv");
dojo.byId("hours").appendChild(hour);
hour.innerHTML="<span class='hourName'>"+i+":00</span>";
hour.style.height=(this.pixelToMinute*60)+"px";
}
for(var i=0;i<this.days.length;i++){
dojo.byId(this.days[i]).style.position="absolute";
if(i==0){
dojo.byId(this.days[i]).style.left=0+"px";
}else{
dojo.byId(this.days[i]).style.left=(this.dayWidth*i)+"px";
}
dojo.byId(this.days[i]).style.width=(this.dayWidth)+"px";
dojo.byId(this.days[i]).style.height=(this.dayHeight)+"px";
entete=dojo.byId(this.days[i]+"Entete");
entete.style.width=(this.dayWidth)+"px";
entete.style.height="33px";
entete.innerHTML="<span class='dayName'>"+this.dayNames[i]+"</span><div id='"+this.days[i]+"authorize' class='dayAuthorize' title='"+lang.authorizeDay+"'></div><div id='"+this.days[i]+"forbid' class='dayForbid' title='"+lang.forbidDay+"'></div>";
dojo.connect(dojo.byId(this.days[i]+"authorize"),"onclick",this,this.authorizeDay);
dojo.connect(dojo.byId(this.days[i]+"forbid"),"onclick",this,this.forbidDay);
}
if(!this.dijitCreated){
this.createDijit();
}
this.leavedPlanning=true;
this.enterPlanning=dojo.connect(dojo.byId("weekPlanner"),"onmouseenter",this,function(){
if(this.leavedPlanning){
this.leavedPlanning=false;
dojo.style(dojo.byId("bigUserListId"),"display","block");
setTimeout(dojo.hitch(this,"hideBigUserList"),2000);
}
});
this.outPlanning=dojo.connect(dojo.byId("weekPlanner"),"onmouseleave",this,function(){
this.leavedPlanning=true;
});
this.hideBigUserList=function(){
dojo.style(dojo.byId("bigUserListId"),"display","none");
};
};
dojoc.layout.TimeSlot.prototype.notifyDelete=function(){
this.refTab.slots.splice(this.tabId,1);
for(i=this.tabId;i<this.refTab.slots.length;i++){
this.refTab.slots[i].tabId--;
}
};
dojoc.layout.TimeSlot.prototype.notifyChange=function(){
if(this.manager){
this.manager.saveSlots();
}
};
mainManager.prototype.deleteDaySlots=function(_5e){
for(i=0;i<this.refTab.slots.length;i++){
if(this.refTab.slots[i].day==_5e){
this.refTab.slots[i]._deleteTimeSlot();
this.deleteDaySlots(_5e);
return;
}
}
};
mainManager.prototype.createSlot=function(e){
myDay=e.currentTarget.id;
node=document.createElement("div");
this.parentNode.appendChild(node);
timeSlot=new dojoc.layout.TimeSlot({fromData:false,width:this.dayWidth,minHeight:this.timeSlotHeight,pixelToMinute:this.pixelToMinute,roundPixel:this.roundPixel,extendAnchorHeight:5,mousePos:{x:e.clientX,y:e.clientY},day:myDay,parentNode:this.parentNode,dayHeight:this.dayHeight,extendColor:this.extendColor,manager:this},node);
index=this.refTab.slots.length;
this.refTab.slots[index]=timeSlot;
timeSlot.refTab=new Object();
timeSlot.refTab=this.refTab;
timeSlot.tabId=index;
timeSlot.startup();
};
mainManager.prototype.authorizeDay=function(e){
dayId=e.currentTarget.id.replace("authorize","");
this.deleteDaySlots(dayId);
this.createSlotFromData(dayId,0,1440,false);
};
mainManager.prototype.forbidDay=function(e){
dayId=e.currentTarget.id.replace("forbid","");
this.deleteDaySlots(dayId);
};
mainManager.prototype.createSlotFromData=function(_62,_63,_64,_65){
nodeDay=dojo.query("#"+_62)[0];
x=dojo.coords(nodeDay).x;
y=dojo.coords(this.parentNode).y+_63*this.pixelToMinute;
currentExtendHeight=_64*this.pixelToMinute-this.timeSlotHeight;
node=document.createElement("div");
this.parentNode.appendChild(node);
timeSlot=new dojoc.layout.TimeSlot({fromData:_65,width:this.dayWidth,minHeight:this.timeSlotHeight,pixelToMinute:this.pixelToMinute,roundPixel:this.roundPixel,extendAnchorHeight:5,mousePos:{x:x,y:y},day:_62,parentNode:this.parentNode,dayHeight:this.dayHeight,extendColor:this.extendColor,manager:this,currentExtendHeight:currentExtendHeight},node);
timeSlot._setExtendHeight();
index=this.refTab.slots.length;
this.refTab.slots[index]=timeSlot;
timeSlot.refTab=new Object();
timeSlot.refTab=this.refTab;
timeSlot.tabId=index;
timeSlot.startup();
};
mainManager.prototype.createDijit=function(){
this.dijitCreated=true;
this.createComboRemoteUsers();
this.createComboFusionRemoteUsers();
this.createComboWeekTypes();
this.createComboManageWeekTypes();
this.createTextBoxWeekType();
this.createButtonFusion();
this.createButtonFusionBack();
this.createDropDownButtonWeekType();
this.createButtonWeekType();
this.createCancelButtonWeekType();
this.createNewButtonWeekType();
this.createTextBoxesQuotaHoursDay();
this.createTextBoxQuotaWeek();
this.createTtWeekType();
this.createTtUser();
this.createTtCumul();
};
mainManager.prototype.createComboRemoteUsers=function(){
param=new Object();
param.php_class="User";
param.php_method="getComboRemoteUsers";
param.php_param=null;
param.me=this.currentUser;
url="/index_xhr.php?param="+dojo.toJson(param);
store=new dojo.data.ItemFileReadStore({url:url});
this.comboRemoteUsers=new dijit.form.FilteringSelect({id:"comboRemoteUsers",autoComplete:true,store:store,name:"font",searchAttr:"name",labelAttr:"label",labelType:"html",value:""},dojo.byId("comboRemoteUsers"));
this.comboRemoteUsers.url=url;
store.fetch({onComplete:this.comboRemoteUsers.setStoreFirstValue,scope:this.comboRemoteUsers,start:0,count:1});
dojo.style(this.comboRemoteUsers.domNode,"width","200px");
dojo.connect(this.comboRemoteUsers,"onChange",this,function(){
this.setCurrentRemoteUser(this.comboRemoteUsers.getValue());
});
this.comboRemoteUsers.startup();
};
mainManager.prototype.createButtonFusion=function(){
this.buttonFusion=new dijit.form.Button({id:"buttonFusion",name:"buttonFusion",label:lang.buttonFusionLabel,disabled:true},dojo.byId("buttonFusion"));
this.buttonFusion.startup();
dojo.connect(this.buttonFusion,"onClick",this,function(){
dojo.style(dojo.byId("fusionArea"),"display","block");
});
};
mainManager.prototype.createButtonFusionBack=function(){
this.buttonFusionBack=new dijit.form.Button({id:"buttonFusionBack",name:"buttonFusionBack",label:lang.buttonFusionBackLabel},dojo.byId("buttonFusionBack"));
this.buttonFusionBack.startup();
dojo.connect(this.buttonFusionBack,"onClick",this,function(){
dojo.style(dojo.byId("fusionArea"),"display","none");
});
};
mainManager.prototype.createComboFusionRemoteUsers=function(){
param=new Object();
param.php_class="User";
param.php_method="getComboRemoteUsers";
param.php_param=null;
param.me=this.currentUser;
url="/index_xhr.php?param="+dojo.toJson(param);
store=new dojo.data.ItemFileReadStore({url:url});
this.comboFusionRemoteUsers=new dijit.form.FilteringSelect({id:"comboFusionRemoteUsers",autoComplete:true,store:store,name:"font",searchAttr:"name",labelAttr:"label",labelType:"html",value:""},dojo.byId("comboFusionRemoteUsers"));
this.comboRemoteUsers.url=url;
store.fetch({onComplete:this.comboFusionRemoteUsers.setStoreFirstValue,scope:this.comboFusionRemoteUsers,start:0,count:1});
dojo.style(this.comboFusionRemoteUsers.domNode,"width","400px");
dojo.connect(this.comboFusionRemoteUsers,"onChange",this,function(){
this.getMergeableRemoteUsers(this.comboFusionRemoteUsers.getValue());
});
this.comboFusionRemoteUsers.startup();
};
mainManager.prototype.createComboWeekTypes=function(){
param=new Object();
param.php_class="User";
param.php_method="getComboWeekTypes";
param.php_param=null;
param.me=this.currentUser;
url="/index_xhr.php?param="+dojo.toJson(param);
store=new dojo.data.ItemFileReadStore({url:url});
this.comboWeekTypes=new dijit.form.FilteringSelect({id:"comboWeekTypes",autoComplete:true,store:store,name:"font",searchAttr:"name",labelAttr:"label",labelType:"html",value:""},dojo.byId("comboWeekTypes"));
this.comboWeekTypes.url=url;
this.comboWeekTypes.doNotSaveUserWeekType=true;
store.fetch({onComplete:this.comboWeekTypes.setStoreFirstValue,scope:this.comboWeekTypes,start:0,count:1});
dojo.style(this.comboWeekTypes.domNode,"width","230px");
dojo.connect(this.comboWeekTypes,"onChange",this,function(){
if(!this.comboWeekTypes.doNotSaveUserWeekType){
this.saveUserWeekType(this.comboWeekTypes.getValue(),this.comboRemoteUsers.getValue());
}
this.comboWeekTypes.doNotSaveUserWeekType=false;
this.setBigUserList(this.comboManageWeekTypes.getValue());
});
this.comboWeekTypes.startup();
};
mainManager.prototype.createComboManageWeekTypes=function(){
param=new Object();
param.php_class="User";
param.php_method="getComboWeekTypes";
param.php_param=null;
param.me=this.currentUser;
url="/index_xhr.php?param="+dojo.toJson(param);
store=new dojo.data.ItemFileReadStore({url:url});
this.comboManageWeekTypes=new dijit.form.FilteringSelect({id:"comboManageWeekTypes",autoComplete:true,store:store,name:"font",searchAttr:"name",labelAttr:"label",labelType:"html",value:""},dojo.byId("comboManageWeekTypes"));
this.comboManageWeekTypes.url=url;
store.fetch({onComplete:this.comboManageWeekTypes.setStoreFirstValue,scope:this.comboManageWeekTypes,start:0,count:1});
dojo.style(this.comboManageWeekTypes.domNode,"width","220px");
dojo.connect(this.comboManageWeekTypes,"onChange",this,function(){
if(this.comboManageWeekTypes.getValue()&&this.comboManageWeekTypes.getValue()!=""){
this.setCurrentWeekType(this.comboManageWeekTypes.getValue());
this.textBoxWeekType.setDisplayedValue(this.comboManageWeekTypes.getDisplayedValue());
this.setBigUserList(this.comboManageWeekTypes.getValue());
}
});
this.comboManageWeekTypes.startup();
};
mainManager.prototype.createTextBoxWeekType=function(){
this.textBoxWeekType=new dijit.form.TextBox({name:"textBoxWeekType",style:"width:200px;",value:""},dojo.byId("textBoxWeekType"));
this.textBoxWeekType.validateContent=function(){
if(this.getValue()==""){
alert(lang.weekTypeNotEmpty);
return false;
}else{
return true;
}
};
};
mainManager.prototype.createDropDownButtonWeekType=function(){
this.menuWeekType=new dijit.Menu({});
this.menuWeekType.domNode.style.display="none";
this.menuItem1=new dijit.MenuItem({label:lang.renameMenuItem,iconClass:"dijitEditorIcon dijitEditorIconSave"});
this.menuWeekType.addChild(this.menuItem1);
dojo.connect(this.menuItem1,"onClick",this,function(){
this.textBoxWeekType.focus();
this.buttonWeekType.setLabel(lang.renameMenuItem);
dojo.style(dojo.byId("manageWeekTypesArea"),"display","block");
con=dojo.connect(this.buttonWeekType,"onClick",this,function(){
this.renameWeekType();
dojo.style(dojo.byId("manageWeekTypesArea"),"display","none");
dojo.disconnect(con);
});
});
this.menuItem2=new dijit.MenuItem({label:lang.saveAsMenuItem,iconClass:"dijitEditorIcon dijitEditorIconSave"});
this.menuWeekType.addChild(this.menuItem2);
dojo.connect(this.menuItem2,"onClick",this,function(){
this.textBoxWeekType.focus();
this.buttonWeekType.setLabel(lang.saveAsMenuItem);
dojo.style(dojo.byId("manageWeekTypesArea"),"display","block");
con=dojo.connect(this.buttonWeekType,"onClick",this,function(){
this.saveAsWeekType();
dojo.style(dojo.byId("manageWeekTypesArea"),"display","none");
dojo.disconnect(con);
});
});
this.menuItem4=new dijit.MenuItem({label:lang.deleteMenuItem,iconClass:"dijitEditorIcon dijitEditorIconSave"});
this.menuWeekType.addChild(this.menuItem4);
dojo.connect(this.menuItem4,"onClick",this,function(){
this.deleteWeekType();
});
this.dropDownButtonWeekType=new dijit.form.DropDownButton({label:"",name:"dropDownButtonWeekType",dropDown:this.menuWeekType,id:"dropDownButtonWeekType",iconClass:"dijitEditorIcon dijitEditorIconSave",showLabel:"false"});
dojo.byId("dropDownButtonWeekType").appendChild(this.dropDownButtonWeekType.domNode);
};
mainManager.prototype.createButtonWeekType=function(){
this.buttonWeekType=new dijit.form.Button({id:"buttonWeekType",name:"buttonWeekType",label:""},dojo.byId("buttonWeekType"));
this.buttonWeekType.startup();
};
mainManager.prototype.createCancelButtonWeekType=function(){
this.cancelButtonWeekType=new dijit.form.Button({id:"cancelButtonWeekType",name:"cancelButtonWeekType",label:lang.cancelButtonWeekType},dojo.byId("cancelButtonWeekType"));
this.cancelButtonWeekType.startup();
dojo.connect(this.cancelButtonWeekType,"onClick",this,function(){
dojo.style(dojo.byId("manageWeekTypesArea"),"display","none");
});
};
mainManager.prototype.createNewButtonWeekType=function(){
this.newButtonWeekType=new dijit.form.Button({id:"newButtonWeekType",name:"newButtonWeekType",label:lang.newButtonWeekType},dojo.byId("newButtonWeekType"));
this.newButtonWeekType.startup();
dojo.connect(this.newButtonWeekType,"onClick",this,function(){
this.textBoxWeekType.setDisplayedValue("");
this.textBoxWeekType.focus();
this.buttonWeekType.setLabel(lang.newMenuItem);
dojo.style(dojo.byId("manageWeekTypesArea"),"display","block");
con=dojo.connect(this.buttonWeekType,"onClick",this,function(){
this.newWeekType();
dojo.style(dojo.byId("manageWeekTypesArea"),"display","none");
dojo.disconnect(con);
});
});
};
mainManager.prototype.createTextBoxesQuotaHoursDay=function(){
this.textBoxQuotaDay=new Array();
for(i=1;i<8;i++){
this.textBoxQuotaDay[i]=new dijit.form.ValidationTextBox({name:"textBoxQuotaDay_"+i,style:"width:55px;height:16px;",maxLength:5,value:"",regExp:"^[0-2]?[0-9]?[:h]?[0-9]?[0-9]?$",promptMessage:lang.quotaDayPromptMessage,required:false,invalidMessage:lang.quotaDayInvalidMessage},dojo.byId("textBoxQuotaDay_"+i));
this.textBoxQuotaDay[i].startup();
this.textBoxQuotaDay[i].manager=this;
this.textBoxQuotaDay[i].parseHeureMinute=function(){
heureMinute=this.getDisplayedValue();
heureMinute=heureMinute.replace(":","h");
this.seconds=0;
if(heureMinute.length>2){
tab=heureMinute.split("h");
heures=parseInt(tab[0],10);
if(!isNaN(heures)){
this.seconds=heures*3600;
}else{
this.seconds=0;
}
minutes=parseInt(tab[1],10);
if(!isNaN(minutes)){
this.seconds+=minutes*60;
}
}else{
heures=parseInt(heureMinute,10);
if(!isNaN(heures)){
this.seconds=heures*3600;
}
}
if(this.seconds>3600*24){
this.setSeconds(3600*24);
}
if(!isNaN(this.seconds)){
return true;
}
};
this.textBoxQuotaDay[i].setSeconds=function(_66){
this.seconds=_66;
heures=(this.seconds-(this.seconds%3600))/3600;
minutes=((this.seconds%3600)-(this.seconds%60))/60;
heureMinute="";
if(heures<10){
heureMinute="0"+heures+":";
}else{
heureMinute=heures+":";
}
if(minutes<10){
heureMinute+="0"+minutes;
}else{
heureMinute+=minutes;
}
this.setValue(heureMinute);
};
this.textBoxQuotaDay[i].onChange=function(){
if(this.manager&&this.parseHeureMinute()){
this.manager.saveSlots();
}
};
this.textBoxQuotaDay[i]._onMouse=function(){
if(this.manager&&this.parseHeureMinute()){
this.manager.saveSlots();
}
};
}
};
mainManager.prototype.createTextBoxQuotaWeek=function(){
this.textBoxQuotaWeek=new dijit.form.NumberTextBox({name:"textBoxQuotaWeek",style:"width:82px;",value:"",constraints:{min:1,max:168,places:0},promptMessage:lang.quotaWeekPromptMessage,required:false,invalidMessage:lang.quotaWeekInvalidMessage},dojo.byId("textBoxQuotaWeek"));
this.textBoxQuotaWeek.validateContent=function(){
if(this.getValue()==""){
alert(lang.weekTypeNotEmpty);
return false;
}else{
return true;
}
};
this.textBoxQuotaWeek.startup();
this.textBoxQuotaWeek.manager=this;
this.textBoxQuotaWeek.onChange=function(){
if(this.manager){
this.manager.saveSlots();
}
};
this.textBoxQuotaWeek._onMouse=function(){
if(this.manager){
this.manager.saveSlots();
}
};
};
mainManager.prototype.createTtWeekType=function(){
this.ttWeekType=new dijit.Tooltip({label:lang.ttWeekType,connectId:["ttWeekType"]});
};
mainManager.prototype.createTtUser=function(){
this.ttUser=new dijit.Tooltip({label:lang.ttUser,connectId:["ttUser"]});
};
mainManager.prototype.createTtCumul=function(){
this.ttCumul=new dijit.Tooltip({label:lang.ttCumul,connectId:["ttCumul"]});
};
mainManager.prototype.setCurrentRemoteUser=function(id){
var _68=new Object();
_68.php_class="RemoteUser";
_68.php_method="getRemoteUserById";
_68.php_param=id;
var url="/index_xhr.php";
this.callback=function(_6a,_6b){
this.scope.ctrl.checkNotLogged(_6a);
this.scope.currentRemoteUser=_6a;
if(this.scope.currentRemoteUser.remote_user_default){
alert(lang.warningAdminUser);
}
this.scope.comboWeekTypes.doNotSaveUserWeekType=true;
this.scope.comboWeekTypes.setValue(this.scope.currentRemoteUser.week_type_id);
this.scope.comboWeekTypes.doNotSaveUserWeekType=false;
this.scope.comboManageWeekTypes.setValue(this.scope.currentRemoteUser.week_type_id);
this.scope.setSelectionInfo();
return _6a;
};
var _6c=5000;
this.xGet(_68,url,this,this.callback,_6c);
};
mainManager.prototype.setCurrentWeekType=function(_6d){
var _6e=new Object();
_6e.php_class="WeekType";
_6e.php_method="getWeekTypeById";
_6e.php_param={week_type_id:_6d};
var url="/index_xhr.php";
this.callback=function(_70,_71){
this.scope.ctrl.checkNotLogged(_70);
this.scope.currentWeekType=_70;
adminWeekTypeDiv=dojo.byId("adminWeekTypeId");
if(!this.scope.currentWeekType.week_type_admin){
dojo.style(adminWeekTypeDiv,"display","none");
}else{
dojo.style(adminWeekTypeDiv,"display","block");
adminWeekTypeDiv.innerHTML=lang.adminWeekTypeExplaination;
}
this.scope.showSlots(this.scope.currentWeekType.week_type_slots);
return _70;
};
var _72=5000;
this.xGet(_6e,url,this,this.callback,_72);
};
mainManager.prototype.setBigUserList=function(_73){
if(!_73||_73==""){
return;
}
var _74=new Object();
_74.php_class="RemoteUser";
_74.php_method="getWeekTypeRemoteUsers";
_74.php_param={week_type_id:_73};
var url="/index_xhr.php";
this.callback=function(_76,_77){
this.scope.ctrl.checkNotLogged(_76);
bigUserList=dojo.byId("bigUserListId");
if(bigUserList){
if(_76.length>0){
html=lang.bigUserListTitle+"<br/>";
for(i=0;i<_76.length;i++){
html+=_76[i].remote_user_name+" / "+_76[i].computer_name+"<br/>";
}
}else{
html=lang.bigUserListTitleNoUser;
}
bigUserList.innerHTML=html;
}
return _76;
};
var _78=5000;
this.xGet(_74,url,this,this.callback,_78);
};
mainManager.prototype.saveUserWeekType=function(_79,_7a){
var _7b=new Object();
_7b.php_class="WeekType";
_7b.php_method="saveUserWeekType";
_7b.php_param={week_type_id:_79,remote_user_id:_7a};
var url="/index_xhr.php";
this.callback=function(_7d,_7e){
this.scope.ctrl.checkNotLogged(_7d);
this.scope.setSelectionInfo();
this.scope.textBoxWeekType.setDisplayedValue(this.scope.comboWeekTypes.getDisplayedValue());
this.scope.comboManageWeekTypes.setValue(this.scope.comboWeekTypes.getValue());
return _7d;
};
var _7f=5000;
this.xGet(_7b,url,this,this.callback,_7f);
};
mainManager.prototype.setSelectionInfo=function(){
if(this.currentRemoteUser&&this.comboWeekTypes.getDisplayedValue()){
dojo.byId("currentSelectionInfo").innerHTML=lang.selectionInfoMsg1+"<span class=\"selectionInfoImportant\" >"+this.currentRemoteUser.remote_user_name+"</span>"+lang.selectionInfoMsg2+"<span class=\"selectionInfoImportant\" >"+this.comboWeekTypes.getDisplayedValue()+"</span>";
}
};
dijit.form.FilteringSelect.prototype.setStoreFirstValue=function(_80,_81){
this.doNotSaveUserWeekType=true;
itemsRefs=new Array();
itemsNames=new Array();
i=0;
dojo.forEach(_80,function(_82){
itemsRefs[i]=_81.store.getValue(_82,"ref");
itemsNames[i]=_81.store.getValue(_82,"name");
i++;
});
this.setValue(itemsRefs[0]);
this.doNotSaveUserWeekType=false;
};
mainManager.prototype.renameWeekType=function(){
if(!this.textBoxWeekType.validateContent()){
this.textBoxWeekType.setDisplayedValue(this.currentWeekType.week_type_name);
return;
}
var _83=new Object();
_83.php_class="WeekType";
_83.php_method="renameWeekType";
_83.php_param={week_type_id:this.comboManageWeekTypes.getValue(),week_type_name:this.textBoxWeekType.getDisplayedValue()};
url="/index_xhr.php";
this.callback=function(_84,_85){
this.scope.ctrl.checkNotLogged(_84);
if(!_84.errorMsg){
delete this.scope.comboManageWeekTypes.store;
this.scope.comboManageWeekTypes.store=new dojo.data.ItemFileReadStore({url:this.scope.comboManageWeekTypes.url});
this.scope.comboManageWeekTypes.store.fetch();
this.scope.comboManageWeekTypes.setDisplayedValue(_84.week_type_name);
delete this.scope.comboWeekTypes.store;
this.scope.comboWeekTypes.store=new dojo.data.ItemFileReadStore({url:this.scope.comboWeekTypes.url});
this.scope.comboWeekTypes.store.fetch();
if(this.scope.comboManageWeekTypes.getValue()==this.scope.comboWeekTypes.getValue()){
this.scope.comboWeekTypes.setDisplayedValue(_84.week_type_name);
}
this.scope.textBoxWeekType.setDisplayedValue(_84.week_type_name);
}else{
msg=eval(_84.errorMsg);
alert(msg);
}
return _84;
};
timeout=5000;
this.xGet(_83,url,this,this.callback,timeout);
};
mainManager.prototype.saveAsWeekType=function(){
if(!this.textBoxWeekType.validateContent()){
return;
}
param=new Object();
param.php_class="WeekType";
param.php_method="saveAsWeekType";
param.php_param={week_type_id:this.comboManageWeekTypes.getValue(),week_type_name:this.textBoxWeekType.getDisplayedValue()};
url="/index_xhr.php";
this.callback=function(_86,_87){
this.scope.ctrl.checkNotLogged(_86);
if(!_86.errorMsg){
delete this.scope.comboManageWeekTypes.store;
this.scope.comboManageWeekTypes.store=new dojo.data.ItemFileReadStore({url:this.scope.comboManageWeekTypes.url});
this.scope.comboManageWeekTypes.store.fetch();
delete this.scope.comboWeekTypes.store;
this.scope.comboWeekTypes.store=new dojo.data.ItemFileReadStore({url:this.scope.comboWeekTypes.url});
this.scope.comboWeekTypes.store.fetch();
this.scope.comboManageWeekTypes.setDisplayedValue(_86.week_type_name);
this.scope.textBoxWeekType.setDisplayedValue(_86.week_type_name);
}else{
msg=eval(_86.errorMsg);
alert(msg);
}
return _86;
};
timeout=5000;
this.xGet(param,url,this,this.callback,timeout);
};
mainManager.prototype.newWeekType=function(){
if(!this.textBoxWeekType.validateContent()){
return;
}
var _88=new Object();
_88.php_class="WeekType";
_88.php_method="newWeekType";
_88.php_param={week_type_id:this.currentWeekType.week_type_id,week_type_name:this.textBoxWeekType.getDisplayedValue()};
url="/index_xhr.php";
this.callback=function(_89,_8a){
this.scope.ctrl.checkNotLogged(_89);
if(!_89.errorMsg){
delete this.scope.comboManageWeekTypes.store;
this.scope.comboManageWeekTypes.store=new dojo.data.ItemFileReadStore({url:this.scope.comboManageWeekTypes.url});
this.scope.comboManageWeekTypes.store.fetch();
delete this.scope.comboWeekTypes.store;
this.scope.comboWeekTypes.store=new dojo.data.ItemFileReadStore({url:this.scope.comboWeekTypes.url});
this.scope.comboWeekTypes.store.fetch();
this.scope.comboManageWeekTypes.setDisplayedValue(_89.week_type_name);
this.scope.textBoxWeekType.setDisplayedValue(_89.week_type_name);
}else{
msg=eval(_89.errorMsg);
alert(msg);
}
return _89;
};
timeout=5000;
this.xGet(_88,url,this,this.callback,timeout);
};
mainManager.prototype.deleteWeekType=function(){
param=new Object();
param.php_class="WeekType";
param.php_method="deleteWeekType";
param.php_param={week_type_id:this.comboManageWeekTypes.getValue(),week_type_name:this.textBoxWeekType.getDisplayedValue()};
url="/index_xhr.php";
this.callback=function(_8b,_8c){
this.scope.ctrl.checkNotLogged(_8b);
if(!_8b.errorMsg){
delete this.scope.comboManageWeekTypes.store;
this.scope.comboManageWeekTypes.store=new dojo.data.ItemFileReadStore({url:this.scope.comboManageWeekTypes.url});
this.scope.comboManageWeekTypes.store.fetch();
delete this.scope.comboWeekTypes.store;
this.scope.comboWeekTypes.store=new dojo.data.ItemFileReadStore({url:this.scope.comboWeekTypes.url});
this.scope.comboWeekTypes.store.fetch();
this.scope.comboManageWeekTypes.setDisplayedValue(this.scope.comboWeekTypes.getDisplayedValue());
this.scope.textBoxWeekType.setDisplayedValue(_8b.week_type_name);
}else{
msg=eval(_8b.errorMsg);
alert(msg);
}
return _8b;
};
timeout=5000;
this.xGet(param,url,this,this.callback,timeout);
};
mainManager.prototype.saveSlots=function(){
if(!this.currentWeekType.week_type_admin){
this.saveSlotsCounter=0;
this.timeOutSaveSlots();
}else{
this.initDefaultWeekTypeCounter=0;
this.timeOutInitDefaultWeekType();
}
};
mainManager.prototype.timeOutInitDefaultWeekType=function(){
if(this.initDefaultWeekTypeCounter>=0&&this.initDefaultWeekTypeCounter<10){
this.initDefaultWeekTypeCounter++;
setTimeout(dojo.hitch(this,"timeOutInitDefaultWeekType"),100);
}
if(this.initDefaultWeekTypeCounter==10){
this.initDefaultWeekTypeCounter=-1;
this.showSlots(this.currentWeekType.week_type_slots);
}
};
mainManager.prototype.timeOutSaveSlots=function(){
if(this.saveSlotsCounter>=0&&this.saveSlotsCounter<10){
this.saveSlotsCounter++;
setTimeout(dojo.hitch(this,"timeOutSaveSlots"),100);
}
if(this.saveSlotsCounter==10){
this.saveSlotsCounter=-1;
param=new Object();
param.php_class="WeekType";
param.php_method="saveSlots";
this.currentWeekType.week_type_slots=this.getFormattedSlots();
param.php_param=this.currentWeekType;
url="/index_xhr.php";
this.callback=function(_8d,_8e){
this.scope.ctrl.checkNotLogged(_8d);
return _8d;
};
timeout=5000;
this.xGet(param,url,this,this.callback,timeout);
}
};
mainManager.prototype.anyRemoteUsers=function(){
param=new Object();
param.php_class="RemoteUser";
param.php_method="anyRemoteUsers";
param.php_param=this.currentUser;
url="/index_xhr.php";
this.callback=function(_8f,_90){
if(!_8f){
window.location="/index.php?page=home&errorMsg=lang.noRemoteUser";
}else{
this.scope.ctrl.changePage("mainManager",true);
}
return _8f;
};
timeout=5000;
this.xGet(param,url,this,this.callback,timeout);
};
mainManager.prototype.getMergeableRemoteUsers=function(_91){
param=new Object();
param.php_class="RemoteUser";
param.php_method="getMergeableRemoteUsers";
param.php_param=_91;
url="/index_xhr.php";
this.callback=function(_92,_93){
this.scope.ctrl.checkNotLogged(_92);
if(!_92){
}else{
if(_92.length>1){
this.scope.buttonFusion.setAttribute("disabled",false);
}
this.scope.buildRuCheckBoxList(_92);
}
return _92;
};
timeout=5000;
this.xGet(param,url,this,this.callback,timeout);
};
mainManager.prototype.buildRuCheckBoxList=function(_94){
dojo.byId("checkBoxRemoteUserList").innerHTML="";
if(!this.tabCbRemoteUsers){
this.tabCbRemoteUsers=new Array();
}else{
for(i=0;i<this.tabCbRemoteUsers.length;i++){
this.tabCbRemoteUsers[i].cb.destroy();
delete (this.tabCbRemoteUsers[i].ru);
}
}
for(i=0;i<_94.length;i++){
if(this.comboFusionRemoteUsers.getValue()==_94[i].remote_user_id){
this.selectedRuForMerge=new Object();
this.selectedRuForMerge=_94[i];
this.selectedRuForMerge.index=i;
}
}
_94.splice(this.selectedRuForMerge.index,1);
table=document.createElement("table");
tbody=document.createElement("tbody");
table.appendChild(tbody);
dojo.byId("checkBoxRemoteUserList").appendChild(table);
this.tabCbRemoteUsers=new Array();
for(i=0;i<_94.length;i++){
tr=document.createElement("tr");
tbody.appendChild(tr);
td=document.createElement("td");
tr.appendChild(td);
node=document.createElement("div");
node.id="cb_ru_"+_94[i].remote_user_id;
td.appendChild(node);
td=document.createElement("td");
tr.appendChild(td);
span=document.createElement("span");
span.id="label_ru_"+_94[i].remote_user_id;
span.setAttribute("class","cbLabelRemoteUserList");
span.setAttribute("className","cbLabelRemoteUserList");
span.innerHTML=_94[i].remote_user_name+" / "+_94[i].computer_name;
td.appendChild(span);
if(this.selectedRuForMerge.fusion_id&&this.selectedRuForMerge.fusion_id!=""&&this.selectedRuForMerge.fusion_id==_94[i].fusion_id){
isChecked=true;
isDisabled=false;
span.setAttribute("title","");
dojo.style(span,"cursor","default");
}else{
isChecked=false;
isDisabled=false;
if(_94[i].fusion_id&&_94[i].fusion_id!=""){
isDisabled=true;
dojo.style(span,"color","#AAAAAA");
dojo.style(span,"cursor","pointer");
span.setAttribute("title",lang.alreadyMerged);
}
}
this.tabCbRemoteUsers[i]={cb:new dijit.form.CheckBox({id:node.id,value:node.id,name:node.id,disabled:isDisabled,checked:isChecked},node.id),ru:_94[i],span:span};
dojo.connect(dojo.byId(node.id),"onclick",this,this.clickCheckBoxRu);
this.tabCbRemoteUsers[i].cb.startup();
}
for(z=0;z<this.tabCbRemoteUsers.length;z++){
if(this.tabCbRemoteUsers[z].cb.checked){
this.onClickCheckBoxRu(this.tabCbRemoteUsers[z],z);
}
}
};
mainManager.prototype.clickCheckBoxRu=function(e){
for(i=0;i<this.tabCbRemoteUsers.length;i++){
if(this.tabCbRemoteUsers[i].cb.id==e.currentTarget.id){
index=i;
clickedCbRu=this.tabCbRemoteUsers[i];
}
}
if(clickedCbRu){
this.onClickCheckBoxRu(clickedCbRu,index);
}
this.setFusionId();
this.saveFusionIds();
};
mainManager.prototype.onClickCheckBoxRu=function(_96,_97){
if(!_96.cb.disabled){
for(i=0;i<this.tabCbRemoteUsers.length;i++){
if(this.tabCbRemoteUsers[i].ru.mac==_96.ru.mac&&i!=_97){
if(!this.tabCbRemoteUsers[i].cb.checked){
if(_96.cb.checked){
this.tabCbRemoteUsers[i].cb.setAttribute("disabled",true);
dojo.style(this.tabCbRemoteUsers[i].span,"color","#AAAAAA");
dojo.style(this.tabCbRemoteUsers[i].span,"cursor","pointer");
this.tabCbRemoteUsers[i].span.setAttribute("title",lang.sameComputer);
}else{
this.tabCbRemoteUsers[i].cb.setAttribute("disabled",false);
dojo.style(this.tabCbRemoteUsers[i].span,"color","#000000");
dojo.style(this.tabCbRemoteUsers[i].span,"cursor","default");
span.setAttribute("title","");
}
}
}
}
}
};
mainManager.prototype.setFusionId=function(){
id=Math.uuid(32);
for(i=0;i<this.tabCbRemoteUsers.length;i++){
if(this.tabCbRemoteUsers[i].cb.checked){
this.tabCbRemoteUsers[i].ru.fusion_id=id;
}
if(!this.tabCbRemoteUsers[i].cb.checked&&!this.tabCbRemoteUsers[i].cb.disabled){
this.tabCbRemoteUsers[i].ru.fusion_id="";
}
}
};
mainManager.prototype.saveFusionIds=function(){
param=new Object();
param.php_class="RemoteUser";
param.php_method="saveFusionIds";
remoteUsers=new Array();
fusionId="";
for(i=0;i<this.tabCbRemoteUsers.length;i++){
remoteUsers[i]=this.tabCbRemoteUsers[i].ru;
if(this.tabCbRemoteUsers[i].ru.fusion_id&&this.tabCbRemoteUsers[i].cb.checked){
fusionId=this.tabCbRemoteUsers[i].ru.fusion_id;
}
}
this.selectedRuForMerge.fusion_id=fusionId;
remoteUsers[this.tabCbRemoteUsers.length]=this.selectedRuForMerge;
param.php_param=remoteUsers;
url="/index_xhr.php";
this.callback=function(_98,_99){
this.scope.ctrl.checkNotLogged(_98);
if(!_98){
}else{
}
return _98;
};
timeout=5000;
this.xGet(param,url,this,this.callback,timeout);
};
mainManager.prototype.getFormattedSlots=function(){
var _9a=new Array();
for(i=0;i<this.refTab.slots.length;i++){
time=(this.refTab.slots[i].endDate-this.refTab.slots[i].startDate)/1000;
slot="T"+this.refTab.slots[i].startDate.getHours()+":"+this.refTab.slots[i].startDate.getMinutes();
slot+="/"+time;
day="J"+(this.refTab.slots[i].startDate.getDay()+1);
if(_9a[day]){
_9a[day]+=slot;
}else{
_9a[day]=slot;
}
}
str="0W0";
if(!this.textBoxQuotaWeek.getDisplayedValue()||this.textBoxQuotaWeek.getDisplayedValue()==""){
str+="/0";
}else{
str+="/"+(this.textBoxQuotaWeek.getDisplayedValue()*3600);
}
str+="|";
for(i=1;i<=7;i++){
if(!_9a["J"+i]){
_9a["J"+i]="T0:0/0";
}
str+="J"+i;
if(!this.textBoxQuotaDay[i].getDisplayedValue()||this.textBoxQuotaDay[i].getDisplayedValue()==""){
str+="/0";
}else{
str+="/"+this.textBoxQuotaDay[i].seconds;
}
str+=_9a["J"+i];
str+="|";
}
str=str.slice(0,str.length-1);
return str;
};
mainManager.prototype.extractFormattedSlots=function(_9b){
res=new Object();
pipe=_9b.split("|");
tab=new Array();
week=pipe[0].split("/");
res.quotaWeek=Math.round(parseInt(week[1],10)/3600);
j=0;
for(i=1;i<pipe.length;i++){
if(pipe[i]!=("J"+i+"/0T0:0/0")){
tab[j]=new Object();
T=pipe[i].split("T");
slash=new Array();
for(k=0;k<T.length;k++){
slash[k]=T[k].split("/");
}
tab[j].dayId=slash[0][0];
seconds=parseInt(slash[0][1],10);
tab[j].quotaJourSeconds=seconds;
for(l=1;l<slash.length;l++){
twoPoints=slash[l][0].split(":");
if(l==1){
tab[j].startHour=parseInt(twoPoints[0],10);
tab[j].startMinute=parseInt(twoPoints[1],10);
tab[j].duration=parseInt(slash[l][1],10);
}else{
j++;
tab[j]=new Object();
tab[j].dayId=tab[j-1].dayId;
tab[j].quotaJourSeconds=tab[j-1].quotaJourSeconds;
tab[j].startHour=parseInt(twoPoints[0],10);
tab[j].startMinute=parseInt(twoPoints[1],10);
tab[j].duration=parseInt(slash[l][1],10);
}
}
j++;
}
}
res.slots=tab;
return res;
};
mainManager.prototype.showSlots=function(_9c){
this.deleteAllSlots();
obj=this.extractFormattedSlots(_9c);
if(obj.quotaWeek==0){
this.textBoxQuotaWeek.setDisplayedValue("");
}else{
this.textBoxQuotaWeek.setDisplayedValue(obj.quotaWeek);
}
for(i=0;i<obj.slots.length;i++){
obj.slots[i].minutes=obj.slots[i].startHour*60+obj.slots[i].startMinute;
obj.slots[i].durationMinute=Math.round(obj.slots[i].duration/60);
if(obj.slots[i].quotaJourSeconds==0){
this.textBoxQuotaDay[parseInt(obj.slots[i].dayId.charAt(1),10)].setDisplayedValue("");
}else{
this.textBoxQuotaDay[parseInt(obj.slots[i].dayId.charAt(1),10)].setSeconds(obj.slots[i].quotaJourSeconds);
}
if(obj.slots[i].durationMinute>0){
this.createSlotFromData(obj.slots[i].dayId,obj.slots[i].minutes,obj.slots[i].durationMinute,true);
}
}
};
mainManager.prototype.deleteAllSlots=function(){
for(i=0;i<this.refTab.slots.length;i++){
this.refTab.slots[i].destroy();
}
this.refTab.slots=new Array();
for(i=1;i<8;i++){
this.textBoxQuotaDay[i].setDisplayedValue("");
}
for(i=1;i<8;i++){
this.textBoxQuotaDay[i].setDisplayedValue("");
}
};
mainManager.prototype.destroy=function(){
if(this.dijitCreated){
this.comboRemoteUsers.destroy();
this.comboFusionRemoteUsers.destroy();
this.comboWeekTypes.destroy();
this.comboManageWeekTypes.destroy();
this.textBoxWeekType.destroy();
this.dropDownButtonWeekType.destroy();
this.buttonWeekType.destroy();
this.cancelButtonWeekType.destroy();
this.newButtonWeekType.destroy();
this.buttonFusion.destroy();
this.buttonFusionBack.destroy();
for(i=1;i<8;i++){
this.textBoxQuotaDay[i].destroy();
}
this.textBoxQuotaWeek.destroy();
this.ttWeekType.destroy();
this.ttUser.destroy();
this.ttCumul.destroy();
if(this.tabCbRemoteUsers){
for(i=0;i<this.tabCbRemoteUsers.length;i++){
this.tabCbRemoteUsers[i].cb.destroy();
delete (this.tabCbRemoteUsers[i].ru);
}
}
this.dijitCreated=false;
}
};
function planning(){
this.xGet=xGet;
};
planning.prototype.init=function(){
this.ctrl.loadIndexMessages();
this.buildPlanning();
};
planning.prototype.buildPlanning=function(){
param=new Object();
param.php_class="RemoteUser";
param.php_method="buildPlanning";
param.php_param={graphName:"planning",remote_user_token:this.ctrl.remoteUserToken};
url="/index_xhr.php";
this.callback=function(_9d,_9e){
if(!_9d.errorMsg){
dojo.byId("planningImage").src=_9d.url;
dojo.byId("planningImage").alt=_9d.name;
dojo.style(dojo.byId("planningImage"),"display","block");
dojo.byId("planningTitle").innerHTML=_9d.name;
}else{
dojo.style(dojo.byId("planningImage"),"display","none");
msg=eval(_9d.errorMsg);
dojo.byId("planningTitle").innerHTML=msg;
}
return _9d;
};
timeout=5000;
this.xGet(param,url,this,this.callback,timeout);
};
planning.prototype.destroy=function(){
};
function stats(){
this.xGet=xGet;
};
stats.prototype.init=function(){
this.ctrl.loadIndexMessages();
if(!this.dijitCreated){
this.createDijit();
}
};
stats.prototype.createDijit=function(){
this.dijitCreated=true;
this.is_interval=true;
this.createStartCalendar(this);
this.createEndCalendar(this);
this.createComboGraph();
this.createComboStatsRemoteUsers();
};
stats.prototype.createStartCalendar=function(_9f){
this.startCalendar=new dijit._Calendar({name:"startCalendar",lang:lang.dojoName},dojo.byId("startCalendar"));
today=new Date();
last_week=new Date();
last_week.setTime(today.getTime()-(1000*3600*24*7));
this.startCalendar.setValue(last_week);
this.datedeb=last_week;
this.startCalendar.onChange=function(_a0){
_9f.datedeb=_a0;
if(_9f.datedeb&&_9f.datefin&&_9f.currentRemoteUser){
_9f.buildGraph();
}
};
};
stats.prototype.createEndCalendar=function(_a1){
this.endCalendar=new dijit._Calendar({name:"endCalendar",lang:lang.dojoName},dojo.byId("endCalendar"));
today=new Date();
this.endCalendar.setValue(today);
this.datefin=today;
this.endCalendar.onChange=function(_a2){
_a1.datefin=_a2;
if(_a1.datedeb&&_a1.datefin&&_a1.currentRemoteUser){
_a1.buildGraph();
}
};
};
stats.prototype.createComboGraph=function(){
param=new Object();
param.php_class="Stat";
param.php_method="getComboGraph";
param.php_param={user_lang:lang.name};
url="/index_xhr.php?param="+dojo.toJson(param);
store=new dojo.data.ItemFileReadStore({url:url});
this.comboGraph=new dijit.form.FilteringSelect({id:"comboGraph",autoComplete:true,store:store,name:"comboGraph",searchAttr:"name",labelAttr:"label",labelType:"html",value:""},dojo.byId("comboGraph"));
this.comboGraph.url=url;
store.fetch({onComplete:this.comboGraph.setStoreFirstValue,scope:this.comboGraph,start:0,count:1});
dojo.style(this.comboGraph.domNode,"width","300px");
dojo.connect(this.comboGraph,"onChange",this,function(){
if(this.comboGraph.getValue()=="connexion_jour"){
this.is_interval=false;
dojo.style(this.startCalendar.domNode,"display","none");
dojo.style(dojo.byId("calendarTitleLeft"),"color","#E8EEFA");
dojo.byId("calendarTitleRight").innerHTML=lang.endCalendarTitle2;
}else{
this.is_interval=true;
dojo.style(this.startCalendar.domNode,"display","block");
dojo.style(dojo.byId("calendarTitleLeft"),"color","#47618F");
dojo.byId("calendarTitleRight").innerHTML=lang.endCalendarTitle;
}
if(this.datedeb&&this.datefin&&this.currentRemoteUser){
this.buildGraph();
}
});
this.comboGraph.startup();
};
stats.prototype.createComboStatsRemoteUsers=function(){
param=new Object();
param.php_class="User";
param.php_method="getComboRemoteUsers";
param.php_param=null;
param.me=this.currentUser;
url="/index_xhr.php?param="+dojo.toJson(param);
store=new dojo.data.ItemFileReadStore({url:url});
this.comboStatsRemoteUsers=new dijit.form.FilteringSelect({id:"comboStatsRemoteUsers",autoComplete:true,store:store,name:"comboStatsRemoteUsers",searchAttr:"name",labelAttr:"label",labelType:"html",value:""},dojo.byId("comboStatsRemoteUsers"));
this.comboStatsRemoteUsers.url=url;
store.fetch({onComplete:this.comboStatsRemoteUsers.setStoreFirstValue,scope:this.comboStatsRemoteUsers,start:0,count:1});
dojo.style(this.comboStatsRemoteUsers.domNode,"width","300px");
dojo.connect(this.comboStatsRemoteUsers,"onChange",this,function(){
this.currentRemoteUser=this.comboStatsRemoteUsers.getValue();
if(this.datedeb&&this.datefin&&this.currentRemoteUser){
this.buildGraph();
}
});
this.comboStatsRemoteUsers.startup();
};
stats.prototype.buildGraph=function(){
this.setDynamicGraphTitles();
str_date_deb=this.datedeb.getFullYear()+"/"+(this.datedeb.getMonth()+1)+"/"+this.datedeb.getDate();
str_date_fin=this.datefin.getFullYear()+"/"+(this.datefin.getMonth()+1)+"/"+this.datefin.getDate();
param.php_class="Stat";
param.php_method="buildGraph";
param.php_param={graphName:this.currentGraph,datedeb:str_date_deb,datefin:str_date_fin,is_interval:this.is_interval,title:this.currentGraphTitle,remote_user_id:this.currentRemoteUser};
url="/index_xhr.php";
this.callback=function(_a3,_a4){
this.scope.ctrl.checkNotLogged(_a3);
if(!_a3.errorMsg){
dojo.byId("statImage").src=_a3.url;
dojo.byId("statImage").alt=_a3.name;
dojo.style(dojo.byId("statImage"),"display","block");
dojo.byId("graphTitle").innerHTML=this.scope.currentGraphTitle;
}else{
dojo.style(dojo.byId("statImage"),"display","none");
msg=eval(_a3.errorMsg);
dojo.byId("graphTitle").innerHTML=msg;
}
return _a3;
};
timeout=5000;
this.xGet(param,url,this,this.callback,timeout);
};
stats.prototype.setDynamicGraphTitles=function(){
dynamicGraphTitle=new Array();
dynamicGraphTitle["temps_connexion"]=lang.graphTempsConnexionDName.replace("##date1##",this.datedeb.toLocaleDateString()).replace("##date2##",this.datefin.toLocaleDateString());
dynamicGraphTitle["repartition_connexion"]=lang.graphRepartitionConnexionDName.replace("##date1##",this.datedeb.toLocaleDateString()).replace("##date2##",this.datefin.toLocaleDateString());
dynamicGraphTitle["connexion_jour"]=lang.graphJourConnexionDName.replace("##date1##",this.datefin.toLocaleDateString());
this.currentGraph=this.comboGraph.getValue();
this.currentGraphTitle=dynamicGraphTitle[this.comboGraph.getValue()];
};
stats.prototype.destroy=function(){
this.endCalendar.destroy();
this.startCalendar.destroy();
this.comboGraph.destroy();
this.comboStatsRemoteUsers.destroy();
this.dijitCreated=false;
};
Math.uuid=(function(){
var _a5="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
return function(len,_a7){
var _a8=_a5,_a9=[],rnd=Math.random;
_a7=_a7||_a8.length;
if(len){
for(var i=0;i<len;i++){
_a9[i]=_a8[0|rnd()*_a7];
}
}else{
var r;
_a9[8]=_a9[13]=_a9[18]=_a9[23]="-";
_a9[14]="4";
for(var i=0;i<36;i++){
if(!_a9[i]){
r=0|rnd()*16;
_a9[i]=_a8[(i==19)?(r&3)|8:r&15];
}
}
}
return _a9.join("");
};
})();
var randomUUID=Math.uuid;
function trim(str){
if(str){
return str.replace(/^\s+/g,"").replace(/\s+$/g,"");
}
};


