diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 85f49aabe8c..59ecd27e2c1 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -21,7 +21,7 @@ * \file htdocs/core/class/html.formmail.class.php * \ingroup core * \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire - * \version $Id$ + * \version $Id: html.formmail.class.php,v 1.26 2011/06/29 10:23:33 eldy Exp $ */ require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); @@ -34,620 +34,630 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); */ class FormMail { - var $db; - - var $withform; + var $db; - var $fromname; - var $frommail; - var $replytoname; - var $replytomail; - var $toname; - var $tomail; + var $withform; - var $withsubstit; // Show substitution array - var $withfrom; - var $withto; - var $withtofree; - var $withtocc; - var $withtopic; - var $withfile; // 0=No attaches files, 1=Show attached files, 2=Can add new attached files - var $withbody; + var $fromname; + var $frommail; + var $replytoname; + var $replytomail; + var $toname; + var $tomail; - var $withfromreadonly; - var $withreplytoreadonly; - var $withtoreadonly; - var $withtoccreadonly; - var $withtopicreadonly; - var $withfilereadonly; - var $withdeliveryreceipt; - var $withcancel; + var $withsubstit; // Show substitution array + var $withfrom; + var $withto; + var $withtofree; + var $withtocc; + var $withtopic; + var $withfile; // 0=No attaches files, 1=Show attached files, 2=Can add new attached files + var $withbody; - var $substit=array(); - var $param=array(); + var $withfromreadonly; + var $withreplytoreadonly; + var $withtoreadonly; + var $withtoccreadonly; + var $withtopicreadonly; + var $withfilereadonly; + var $withdeliveryreceipt; + var $withcancel; - var $error; + var $substit=array(); + var $param=array(); + + var $error; - /** - * \brief Constructeur - * \param DB handler d'acces base de donnee - */ - function FormMail($DB) - { - $this->db = $DB; - - $this->withform=1; + /** + * \brief Constructeur + * \param DB handler d'acces base de donnee + */ + function FormMail($DB) + { + $this->db = $DB; - $this->withfrom=1; - $this->withto=1; - $this->withtofree=1; - $this->withtocc=1; - $this->withtoccc=0; - $this->witherrorsto=0; - $this->withtopic=1; - $this->withfile=0; - $this->withbody=1; + $this->withform=1; - $this->withfromreadonly=1; - $this->withreplytoreadonly=1; - $this->withtoreadonly=0; - $this->withtoccreadonly=0; - $this->witherrorstoreadonly=0; - $this->withtopicreadonly=0; - $this->withfilereadonly=0; - $this->withbodyreadonly=0; - $this->withdeliveryreceiptreadonly=0; + $this->withfrom=1; + $this->withto=1; + $this->withtofree=1; + $this->withtocc=1; + $this->withtoccc=0; + $this->witherrorsto=0; + $this->withtopic=1; + $this->withfile=0; + $this->withbody=1; - return 1; - } + $this->withfromreadonly=1; + $this->withreplytoreadonly=1; + $this->withtoreadonly=0; + $this->withtoccreadonly=0; + $this->witherrorstoreadonly=0; + $this->withtopicreadonly=0; + $this->withfilereadonly=0; + $this->withbodyreadonly=0; + $this->withdeliveryreceiptreadonly=0; - /** - * Clear list of attached files in send mail form (stored in session) - */ - function clear_attached_files() - { - global $conf,$user; + return 1; + } + + /** + * Clear list of attached files in send mail form (stored in session) + */ + function clear_attached_files() + { + global $conf,$user; require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); - // Set tmp user directory - $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir = $vardir.'/temp/'; - if (is_dir($upload_dir)) dol_delete_dir_recursive($upload_dir); + // Set tmp user directory + $vardir=$conf->user->dir_output."/".$user->id; + $upload_dir = $vardir.'/temp/'; + if (is_dir($upload_dir)) dol_delete_dir_recursive($upload_dir); - unset($_SESSION["listofpaths"]); - unset($_SESSION["listofnames"]); - unset($_SESSION["listofmimes"]); - } + unset($_SESSION["listofpaths"]); + unset($_SESSION["listofnames"]); + unset($_SESSION["listofmimes"]); + } - /** - * Add a file into the list of attached files (stored in SECTION array) - * - * @param $path - * @param $file - * @param $type - */ - function add_attached_files($path,$file,$type) - { - $listofpaths=array(); - $listofnames=array(); - $listofmimes=array(); - if (! empty($_SESSION["listofpaths"])) $listofpaths=explode(';',$_SESSION["listofpaths"]); - if (! empty($_SESSION["listofnames"])) $listofnames=explode(';',$_SESSION["listofnames"]); - if (! empty($_SESSION["listofmimes"])) $listofmimes=explode(';',$_SESSION["listofmimes"]); - if (! in_array($file,$listofnames)) - { - $listofpaths[]=$path; - $listofnames[]=$file; - $listofmimes[]=$type; - $_SESSION["listofpaths"]=join(';',$listofpaths); - $_SESSION["listofnames"]=join(';',$listofnames); - $_SESSION["listofmimes"]=join(';',$listofmimes); - } - } + /** + * Add a file into the list of attached files (stored in SECTION array) + * + * @param $path + * @param $file + * @param $type + */ + function add_attached_files($path,$file,$type) + { + $listofpaths=array(); + $listofnames=array(); + $listofmimes=array(); + if (! empty($_SESSION["listofpaths"])) $listofpaths=explode(';',$_SESSION["listofpaths"]); + if (! empty($_SESSION["listofnames"])) $listofnames=explode(';',$_SESSION["listofnames"]); + if (! empty($_SESSION["listofmimes"])) $listofmimes=explode(';',$_SESSION["listofmimes"]); + if (! in_array($file,$listofnames)) + { + $listofpaths[]=$path; + $listofnames[]=$file; + $listofmimes[]=$type; + $_SESSION["listofpaths"]=join(';',$listofpaths); + $_SESSION["listofnames"]=join(';',$listofnames); + $_SESSION["listofmimes"]=join(';',$listofmimes); + } + } - /** - * Remove a file from the list of attached files (stored in SECTION array) - * - * @param $keytodelete Key in file array - */ - function remove_attached_files($keytodelete) - { - $listofpaths=array(); - $listofnames=array(); - $listofmimes=array(); - if (! empty($_SESSION["listofpaths"])) $listofpaths=explode(';',$_SESSION["listofpaths"]); - if (! empty($_SESSION["listofnames"])) $listofnames=explode(';',$_SESSION["listofnames"]); - if (! empty($_SESSION["listofmimes"])) $listofmimes=explode(';',$_SESSION["listofmimes"]); - if ($keytodelete >= 0) - { - unset ($listofpaths[$keytodelete]); - unset ($listofnames[$keytodelete]); - unset ($listofmimes[$keytodelete]); - $_SESSION["listofpaths"]=join(';',$listofpaths); - $_SESSION["listofnames"]=join(';',$listofnames); - $_SESSION["listofmimes"]=join(';',$listofmimes); - //var_dump($_SESSION['listofpaths']); - } - } + /** + * Remove a file from the list of attached files (stored in SECTION array) + * + * @param $keytodelete Key in file array + */ + function remove_attached_files($keytodelete) + { + $listofpaths=array(); + $listofnames=array(); + $listofmimes=array(); + if (! empty($_SESSION["listofpaths"])) $listofpaths=explode(';',$_SESSION["listofpaths"]); + if (! empty($_SESSION["listofnames"])) $listofnames=explode(';',$_SESSION["listofnames"]); + if (! empty($_SESSION["listofmimes"])) $listofmimes=explode(';',$_SESSION["listofmimes"]); + if ($keytodelete >= 0) + { + unset ($listofpaths[$keytodelete]); + unset ($listofnames[$keytodelete]); + unset ($listofmimes[$keytodelete]); + $_SESSION["listofpaths"]=join(';',$listofpaths); + $_SESSION["listofnames"]=join(';',$listofnames); + $_SESSION["listofmimes"]=join(';',$listofmimes); + //var_dump($_SESSION['listofpaths']); + } + } - /** - * Return list of attached files (stored in SECTION array) - * - * @return array array('paths'=> ,'names'=>, 'mimes'=> ) - */ - function get_attached_files() - { - $listofpaths=array(); - $listofnames=array(); - $listofmimes=array(); - if (! empty($_SESSION["listofpaths"])) $listofpaths=explode(';',$_SESSION["listofpaths"]); - if (! empty($_SESSION["listofnames"])) $listofnames=explode(';',$_SESSION["listofnames"]); - if (! empty($_SESSION["listofmimes"])) $listofmimes=explode(';',$_SESSION["listofmimes"]); - return array('paths'=>$listofpaths, 'names'=>$listofnames, 'mimes'=>$listofmimes); - } - - /** - * Show the form to input an email + /** + * Return list of attached files (stored in SECTION array) + * + * @return array array('paths'=> ,'names'=>, 'mimes'=> ) + */ + function get_attached_files() + { + $listofpaths=array(); + $listofnames=array(); + $listofmimes=array(); + if (! empty($_SESSION["listofpaths"])) $listofpaths=explode(';',$_SESSION["listofpaths"]); + if (! empty($_SESSION["listofnames"])) $listofnames=explode(';',$_SESSION["listofnames"]); + if (! empty($_SESSION["listofmimes"])) $listofmimes=explode(';',$_SESSION["listofmimes"]); + return array('paths'=>$listofpaths, 'names'=>$listofnames, 'mimes'=>$listofmimes); + } + + /** + * Show the form to input an email * this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files - * @param addfileaction Name of action when posting file attachments - * @param removefileaction Name of action when removing file attachments - */ - function show_form($addfileaction='addfile',$removefileaction='removefile') - { - print $this->get_form($addfileaction,$removefileaction); - } + * @param addfileaction Name of action when posting file attachments + * @param removefileaction Name of action when removing file attachments + */ + function show_form($addfileaction='addfile',$removefileaction='removefile') + { + print $this->get_form($addfileaction,$removefileaction); + } - /** - * Get the form to input an email + /** + * Get the form to input an email * this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files - * @param addfileaction Name of action when posting file attachments - * @param removefileaction Name of action when removing file attachments - */ - function get_form($addfileaction='addfile',$removefileaction='removefile') - { - global $conf, $langs, $user; + * @param addfileaction Name of action when posting file attachments + * @param removefileaction Name of action when removing file attachments + */ + function get_form($addfileaction='addfile',$removefileaction='removefile') + { + global $conf, $langs, $user; - $langs->load("other"); - $langs->load("mails"); - - $out=''; + $langs->load("other"); + $langs->load("mails"); - // Define list of attached files - $listofpaths=array(); - $listofnames=array(); - $listofmimes=array(); - if (! empty($_SESSION["listofpaths"])) $listofpaths=explode(';',$_SESSION["listofpaths"]); - if (! empty($_SESSION["listofnames"])) $listofnames=explode(';',$_SESSION["listofnames"]); - if (! empty($_SESSION["listofmimes"])) $listofmimes=explode(';',$_SESSION["listofmimes"]); + $out=''; + + // Define list of attached files + $listofpaths=array(); + $listofnames=array(); + $listofmimes=array(); + if (! empty($_SESSION["listofpaths"])) $listofpaths=explode(';',$_SESSION["listofpaths"]); + if (! empty($_SESSION["listofnames"])) $listofnames=explode(';',$_SESSION["listofnames"]); + if (! empty($_SESSION["listofmimes"])) $listofmimes=explode(';',$_SESSION["listofmimes"]); - $form=new Form($DB); + $form=new Form($DB); - $out.= "\n\n"; - if ($this->withform) - { - $out.= '
'."\n"; + $out.= "\n"; + + return $out; + } - /** - * \brief Affiche la partie de formulaire pour saisie d'un mail - * \param withtopic 1 pour proposer a la saisie le sujet - * \param withbody 1 pour proposer a la saisie le corps du message - * \param withfile 1 pour proposer a la saisie l'ajout d'un fichier joint - * \todo Fonction a virer quand fichier /comm/mailing.php vire (= quand ecran dans /comm/mailing prets) - */ - function mail_topicmessagefile($withtopic=1,$withbody=1,$withfile=1,$defaultbody) - { - global $langs; + /** + * \brief Affiche la partie de formulaire pour saisie d'un mail + * \param withtopic 1 pour proposer a la saisie le sujet + * \param withbody 1 pour proposer a la saisie le corps du message + * \param withfile 1 pour proposer a la saisie l'ajout d'un fichier joint + * \todo Fonction a virer quand fichier /comm/mailing.php vire (= quand ecran dans /comm/mailing prets) + */ + function mail_topicmessagefile($withtopic=1,$withbody=1,$withfile=1,$defaultbody) + { + global $langs; - $langs->load("other"); + $langs->load("other"); - print "| ".$langs->trans("MailTopic")." | "; - print ""; - print ""; - print " |
| ".$langs->trans("MailTopic")." | "; + print ""; + print ""; + print " |
| ".$langs->trans("MailText")." | "; - print ""; - print ""; - print " |
| ".$langs->trans("MailText")." | "; + print ""; + print ""; + print " |
| ".$langs->trans("MailFile")." | "; - print ""; - print "trans("Upload")."\"/>"; - print " |
| ".$langs->trans("MailFile")." | "; + print ""; + print "trans("Upload")."\"/>"; + print " |
| '; - print $langs->trans("LDAPUsers"); - print ' | '; - print ''; - print ''; - print $html->selectarray('users', $liste, '', 1); - print ' | '; - print ''; - print ' |
| '; + print $langs->trans("LDAPUsers"); + print ' | '; + print ''; + print ''; + print $html->selectarray('users', $liste, '', 1); + print ' | '; + print ''; + print ' |
| '.$langs->trans("Lastname").' | '; - print ''; - if ($ldap_nom) - { - print ''; - print $ldap_nom; - } - else - { - print ''; - } - print ' | '.$langs->trans("Lastname").' | '; + print ''; + if ($ldap_nom) + { + print ''; + print $ldap_nom; + } + else + { + print ''; + } + print ' | '; - // Prenom - print '
| '.$langs->trans("Firstname").' | '; - print ''; - if ($ldap_prenom) - { - print ''; - print $ldap_prenom; - } - else - { - print ''; - } - print ' |
| '.$langs->trans("Firstname").' | '; + print ''; + if ($ldap_prenom) + { + print ''; + print $ldap_prenom; + } + else + { + print ''; + } + print ' |
| '.$langs->trans("Login").' | '; - print ''; - if ($ldap_login) - { - print ''; - print $ldap_login; - } - elseif ($ldap_loginsmb) - { - print ''; - print $ldap_loginsmb; - } - else - { - print ''; - } - print ' |
| '.$langs->trans("Login").' | '; + print ''; + if ($ldap_login) + { + print ''; + print $ldap_login; + } + elseif ($ldap_loginsmb) + { + print ''; + print $ldap_loginsmb; + } + else + { + print ''; + } + print ' |
| '.$langs->trans("Password").' | '; - print ''; - if ($ldap_sid) - { - print 'Mot de passe du domaine'; - } - else - { - if ($ldap_pass) - { - print ''; - print preg_replace('/./i','*',$ldap_pass); - } - else - { - // We do not use a field password but a field text to show new password to use. - print ''; - } - } - print ' |
| '.$langs->trans("Password").' | '; + print ''; + if ($ldap_sid) + { + print 'Mot de passe du domaine'; + } + else + { + if ($ldap_pass) + { + print ''; + print preg_replace('/./i','*',$ldap_pass); + } + else + { + // We do not use a field password but a field text to show new password to use. + print ''; + } + } + print ' |
| '.$langs->trans("Administrator").' | '; - print ''; - print $form->selectyesno('admin',$_POST["admin"],1); + // Administrateur + if ($user->admin) + { + print ' |
| '.$langs->trans("Administrator").' | '; + print ''; + print $form->selectyesno('admin',$_POST["admin"],1); - if (! empty($conf->multicompany->enabled) && ! $user->entity) - { - if ($conf->use_javascript_ajax) - { - print ''; - } - $checked=($_POST["superadmin"]?' checked':''); - $disabled=($_POST["superadmin"]?'':' disabled'); - print ' '.$langs->trans("SuperAdministrator"); - } - print " |
| '.$langs->trans("Type").' | '; - print ''; - print $html->textwithpicto($langs->trans("Internal"),$langs->trans("InternalExternalDesc")); - print ' |
| '.$langs->trans("Type").' | '; + print ''; + print $html->textwithpicto($langs->trans("Internal"),$langs->trans("InternalExternalDesc")); + print ' |
| '.$langs->trans("PhonePro").' | '; - print ''; - if ($ldap_phone) - { - print ''; - print $ldap_phone; - } - else - { - print ''; - } - print ' |
| '.$langs->trans("PhonePro").' | '; + print ''; + if ($ldap_phone) + { + print ''; + print $ldap_phone; + } + else + { + print ''; + } + print ' |
| '.$langs->trans("PhoneMobile").' | '; - print ''; - if ($ldap_mobile) - { - print ''; - print $ldap_mobile; - } - else - { - print ''; - } - print ' |
| '.$langs->trans("PhoneMobile").' | '; + print ''; + if ($ldap_mobile) + { + print ''; + print $ldap_mobile; + } + else + { + print ''; + } + print ' |
| '.$langs->trans("Fax").' | '; - print ''; - if ($ldap_fax) - { - print ''; - print $ldap_fax; - } - else - { - print ''; - } - print ' |
| '.$langs->trans("Fax").' | '; + print ''; + if ($ldap_fax) + { + print ''; + print $ldap_fax; + } + else + { + print ''; + } + print ' |
| global->USER_MAIL_REQUIRED?' class="fieldrequired"':'').'>'.$langs->trans("EMail").' | '; - print ''; - if ($ldap_mail) - { - print ''; - print $ldap_mail; - } - else - { - print ''; - } - print ' | '; + if ($ldap_mail) + { + print ''; + print $ldap_mail; + } + else + { + print ''; + } + print ' | '; - // Note - print '
| '; - print $langs->trans("Note"); - print ' | '; - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_USER) - { - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('note','','',180,'dolibarr_notes','',false); - $doleditor->Create(); - } - else - { - print ''; - } - print " |
| '.$langs->trans("Signature").' | '; + print ''; + print ''; + print ' |
| '; + print $langs->trans("Note"); + print ' | '; + if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_USER) + { + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('note','','',180,'dolibarr_notes','',false); + $doleditor->Create(); + } + else + { + print ''; + } + print " |
| '.$langs->trans("LoginWebcal").' | '; - print '|
| '.$langs->trans("LoginPenix").' | '; - print '|
| '.$langs->trans("PassPenix").' | '; - print '|
| '.$langs->trans("LoginWebcal").' | '; + print '|
| '.$langs->trans("Ref").' | '; - print ''; - print $html->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin); - print ' | '; - print '||||
| '.$langs->trans("Ref").' | '; + print ''; + print $html->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin); + print ' | '; + print '||||
| '.$langs->trans("Lastname").' | '; - print ''.$fuser->nom.' | '; + // Lastname + print '||||
| '.$langs->trans("Lastname").' | '; + print ''.$fuser->nom.' | '; // Photo print ''; @@ -927,404 +935,409 @@ else print ' | |||
| '.$langs->trans("Firstname").' | '; - print ''.$fuser->prenom.' | '; + // Firstname + print '||||
| '.$langs->trans("Firstname").' | '; + print ''.$fuser->prenom.' | '; print '||||
| '.$langs->trans("Login").' | '; - if ($fuser->ldap_sid && $fuser->statut==0) - { - print ''.$langs->trans("LoginAccountDisableInDolibarr").' | '; - } - else - { - print ''.$fuser->login.' | '; - } - print '|||
| '.$langs->trans("Password").' | '; - if ($fuser->ldap_sid) - { - if ($passDoNotExpire) - { - print ''.$langs->trans("LdapUacf_".$statutUACF).' | '; - } - else if($userChangePassNextLogon) - { - print ''.$langs->trans("UserMustChangePassNextLogon",$ldap->domainFQDN).' | '; - } - else if($userDisabled) - { - print ''.$langs->trans("LdapUacf_".$statutUACF,$ldap->domainFQDN).' | '; - } - else - { - print ''.$langs->trans("DomainPassword").' | '; - } - } - else - { - print ''; - if ($fuser->pass) print preg_replace('/./i','*',$fuser->pass); - else - { - if ($user->admin) print $langs->trans("Crypted").': '.$fuser->pass_indatabase_crypted; - else print $langs->trans("Hidden"); - } - print " | "; - } + // Login + print '
| '.$langs->trans("Login").' | '; + if ($fuser->ldap_sid && $fuser->statut==0) + { + print ''.$langs->trans("LoginAccountDisableInDolibarr").' | '; + } + else + { + print ''.$fuser->login.' | '; + } print '|||
| '.$langs->trans("Administrator").' | '; - if (! empty($conf->multicompany->enabled) && $fuser->admin && ! $fuser->entity) - { - print $html->textwithpicto(yn($fuser->admin),$langs->trans("SuperAdministratorDesc"),1,"superadmin"); - } - else if ($fuser->admin) - { - print $html->textwithpicto(yn($fuser->admin),$langs->trans("AdministratorDesc"),1,"admin"); - } - else - { - print yn($fuser->admin); - } + // Password + print ' | ||||
| '.$langs->trans("Password").' | '; + if ($fuser->ldap_sid) + { + if ($passDoNotExpire) + { + print ''.$langs->trans("LdapUacf_".$statutUACF).' | '; + } + else if($userChangePassNextLogon) + { + print ''.$langs->trans("UserMustChangePassNextLogon",$ldap->domainFQDN).' | '; + } + else if($userDisabled) + { + print ''.$langs->trans("LdapUacf_".$statutUACF,$ldap->domainFQDN).' | '; + } + else + { + print ''.$langs->trans("DomainPassword").' | '; + } + } + else + { + print ''; + if ($fuser->pass) print preg_replace('/./i','*',$fuser->pass); + else + { + if ($user->admin) print $langs->trans("Crypted").': '.$fuser->pass_indatabase_crypted; + else print $langs->trans("Hidden"); + } + print " | "; + } + print '
| '.$langs->trans("Administrator").' | '; + if (! empty($conf->multicompany->enabled) && $fuser->admin && ! $fuser->entity) + { + print $html->textwithpicto(yn($fuser->admin),$langs->trans("SuperAdministratorDesc"),1,"superadmin"); + } + else if ($fuser->admin) + { + print $html->textwithpicto(yn($fuser->admin),$langs->trans("AdministratorDesc"),1,"admin"); + } + else + { + print yn($fuser->admin); + } print ' | ||||
| '.$langs->trans("Type").' | '; - if ($fuser->societe_id) - { - print $html->textwithpicto($langs->trans("External"),$langs->trans("InternalExternalDesc")); - } - else if ($fuser->ldap_sid) - { - print $langs->trans("DomainUser",$ldap->domainFQDN); - } - else - { - print $html->textwithpicto($langs->trans("Internal"),$langs->trans("InternalExternalDesc")); - } + // Type + print ' | ||||
| '.$langs->trans("Type").' | '; + if ($fuser->societe_id) + { + print $html->textwithpicto($langs->trans("External"),$langs->trans("InternalExternalDesc")); + } + else if ($fuser->ldap_sid) + { + print $langs->trans("DomainUser",$ldap->domainFQDN); + } + else + { + print $html->textwithpicto($langs->trans("Internal"),$langs->trans("InternalExternalDesc")); + } print ' | ||||
| '.$langs->trans("PhonePro").' | '; - print ''.dol_print_phone($fuser->office_phone,'',0,0,1).' | '; + // Tel pro + print '||||
| '.$langs->trans("PhonePro").' | '; + print ''.dol_print_phone($fuser->office_phone,'',0,0,1).' | '; print '||||
| '.$langs->trans("PhoneMobile").' | '; - print ''.dol_print_phone($fuser->user_mobile,'',0,0,1).' | '; + // Tel mobile + print '||||
| '.$langs->trans("PhoneMobile").' | '; + print ''.dol_print_phone($fuser->user_mobile,'',0,0,1).' | '; print '||||
| '.$langs->trans("Fax").' | '; - print ''.dol_print_phone($fuser->office_fax,'',0,0,1).' | '; + // Fax + print '||||
| '.$langs->trans("Fax").' | '; + print ''.dol_print_phone($fuser->office_fax,'',0,0,1).' | '; print '||||
| '.$langs->trans("EMail").' | '; - print ''.dol_print_email($fuser->email,0,0,1).' | '; - print "||||
| '.$langs->trans("EMail").' | '; + print ''.dol_print_email($fuser->email,0,0,1).' | '; + print "||||
| '.$langs->trans("Status").' | '; - print ''; - print $fuser->getLibStatut(4); - print ' | '; + // Signature + print '||||
| '.$langs->trans('Signature').' | '; + print ''.$fuser->signature.' | '; + print "||||
| '.$langs->trans("Status").' | '; + print ''; + print $fuser->getLibStatut(4); + print ' | '; print '||||
| '.$langs->trans("LastConnexion").' | '; - print ''.dol_print_date($fuser->datelastlogin,"dayhour").' | '; - print "||||
| '.$langs->trans("LastConnexion").' | '; + print ''.dol_print_date($fuser->datelastlogin,"dayhour").' | '; + print "||||
| '.$langs->trans("PreviousConnexion").' | '; - print ''.dol_print_date($fuser->datepreviouslogin,"dayhour").' | '; - print "||||
| '.$langs->trans("PreviousConnexion").' | '; + print ''.dol_print_date($fuser->datepreviouslogin,"dayhour").' | '; + print "||||
| '.$langs->trans("url_openid").' | '; - print ''.$fuser->openid.' | '; - print "||||
| '.$langs->trans("url_openid").' | '; + print ''.$fuser->openid.' | '; + print "||||
| '.$langs->trans("LoginWebcal").' | '; - print ''.$fuser->webcal_login.' | '; + // Module Webcalendar + if ($conf->webcalendar->enabled) + { + $langs->load("other"); + print '||||
| '.$langs->trans("LoginWebcal").' | '; + print ''.$fuser->webcal_login.' | '; print '||||
| '.$langs->trans("LoginPhenix").' | '; - print ''.$fuser->phenix_login.' | '; - print "||||
| '.$langs->trans("PassPhenix").' | '; - print ''.preg_replace('/./i','*',$fuser->phenix_pass_crypted).' | '; + // Module Phenix + if ($conf->phenix->enabled) + { + $langs->load("other"); + print '||||
| '.$langs->trans("LoginPhenix").' | '; + print ''.$fuser->phenix_login.' | '; + print "||||
| '.$langs->trans("PassPhenix").' | '; + print ''.preg_replace('/./i','*',$fuser->phenix_pass_crypted).' | '; print '||||
| '.$langs->trans("LinkToCompanyContact").' | '; - print '';
- if ($fuser->societe_id > 0)
- {
- $societe = new Societe($db);
- $societe->fetch($fuser->societe_id);
- print $societe->getNomUrl(1,'');
- }
- else
- {
- print $langs->trans("ThisUserIsNot");
- }
- if ($fuser->contact_id)
- {
- $contact = new Contact($db);
- $contact->fetch($fuser->contact_id);
- if ($fuser->societe_id > 0) print ' / ';
- else print ' '; - print ''.img_object($langs->trans("ShowContact"),'contact').' '.dol_trunc($contact->getFullName($langs),32).''; - } - print ' | ';
+ // Company / Contact
+ if ($conf->societe->enabled)
+ {
+ print '||||
| '.$langs->trans("LinkToCompanyContact").' | '; + print '';
+ if ($fuser->societe_id > 0)
+ {
+ $societe = new Societe($db);
+ $societe->fetch($fuser->societe_id);
+ print $societe->getNomUrl(1,'');
+ }
+ else
+ {
+ print $langs->trans("ThisUserIsNot");
+ }
+ if ($fuser->contact_id)
+ {
+ $contact = new Contact($db);
+ $contact->fetch($fuser->contact_id);
+ if ($fuser->societe_id > 0) print ' / ';
+ else print ' '; + print ''.img_object($langs->trans("ShowContact"),'contact').' '.dol_trunc($contact->getFullName($langs),32).''; + } + print ' | ';
print '||||
| '.$langs->trans("LinkedToDolibarrMember").' | '; - print ''; - if ($fuser->fk_member) - { - $adh=new Adherent($db); - $adh->fetch($fuser->fk_member); - $adh->ref=$adh->getFullname($langs); // Force to show login instead of id - print $adh->getNomUrl(1); - } - else - { - print $langs->trans("UserNotLinkedToMember"); - } - print ' | '; + // Module Adherent + if ($conf->adherent->enabled) + { + $langs->load("members"); + print '||||
| '.$langs->trans("LinkedToDolibarrMember").' | '; + print ''; + if ($fuser->fk_member) + { + $adh=new Adherent($db); + $adh->fetch($fuser->fk_member); + $adh->ref=$adh->getFullname($langs); // Force to show login instead of id + print $adh->getNomUrl(1); + } + else + { + print $langs->trans("UserNotLinkedToMember"); + } + print ' | '; print '||||
| '.$langs->trans("GroupsToAdd").' | '."\n"; - print ''; - print $form->select_dolgroups('','group',1,$exclude); - print ' '; - print ''; - print ' |
| '.$langs->trans("GroupsToAdd").' | '."\n"; + print ''; + print $form->select_dolgroups('','group',1,$exclude); + print ' '; + print ''; + print ' |
| '.$langs->trans("Groups").' | '; - print "|
| '.$langs->trans("Groups").' | '; + print "|
| '; - if ($caneditgroup) - { - print ''.img_object($langs->trans("ShowGroup"),"group").' '.$group->nom.''; - } - else - { - print img_object($langs->trans("ShowGroup"),"group").' '.$group->nom; - } - print ' | '; - print ''; + print " |
| '; + if ($caneditgroup) + { + print ''.img_object($langs->trans("ShowGroup"),"group").' '.$group->nom.''; + } + else + { + print img_object($langs->trans("ShowGroup"),"group").' '.$group->nom; + } + print ' | '; + print ''; - if ($caneditgroup) - { - print ''; - print img_delete($langs->trans("RemoveFromGroup")); - } - else - { - print " "; - } - print " |
| '.$langs->trans("None").' | |
| '.$langs->trans("None").' | |
| '.$langs->trans("Ref").' | '; - print ''; - print $fuser->id; - print ' | '; - print '|
| '.$langs->trans("Ref").' | '; + print ''; + print $fuser->id; + print ' | '; + print '|
| '.$langs->trans("Lastname").' | '; - print ''; - if ($caneditfield && !$fuser->ldap_sid) - { - print ''; - } - else - { - print ''; - print $fuser->nom; - } - print ' | '; + // Lastname + print "|
| '.$langs->trans("Lastname").' | '; + print ''; + if ($caneditfield && !$fuser->ldap_sid) + { + print ''; + } + else + { + print ''; + print $fuser->nom; + } + print ' | '; // Photo print ''; print $html->showphoto('userphoto',$fuser); @@ -1338,84 +1351,84 @@ else print ' |