Add patch to add signature on user.
This commit is contained in:
parent
c7475f95a6
commit
484d5ce81a
@ -21,7 +21,7 @@
|
|||||||
* \file htdocs/core/class/html.formmail.class.php
|
* \file htdocs/core/class/html.formmail.class.php
|
||||||
* \ingroup core
|
* \ingroup core
|
||||||
* \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire
|
* \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");
|
require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php");
|
||||||
|
|
||||||
@ -257,7 +257,7 @@ class FormMail
|
|||||||
$out.= '<input type="hidden" id="fromname" name="fromname" value="'.$this->fromname.'" />';
|
$out.= '<input type="hidden" id="fromname" name="fromname" value="'.$this->fromname.'" />';
|
||||||
$out.= '<input type="hidden" id="frommail" name="frommail" value="'.$this->frommail.'" />';
|
$out.= '<input type="hidden" id="frommail" name="frommail" value="'.$this->frommail.'" />';
|
||||||
$out.= '<tr><td width="180">'.$langs->trans("MailFrom").'</td><td>';
|
$out.= '<tr><td width="180">'.$langs->trans("MailFrom").'</td><td>';
|
||||||
if ($this->fromtype == 'user')
|
if ($this->fromtype == 'user' && $this->fromid > 0)
|
||||||
{
|
{
|
||||||
$langs->load("users");
|
$langs->load("users");
|
||||||
$fuser=new User($this->db);
|
$fuser=new User($this->db);
|
||||||
@ -564,7 +564,17 @@ class FormMail
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Editeur wysiwyg
|
if(! empty($conf->global->MAIL_USE_SIGN) && $this->fromid > 0)
|
||||||
|
{
|
||||||
|
$fuser=new User($this->db);
|
||||||
|
$fuser->fetch($this->fromid);
|
||||||
|
|
||||||
|
if(!empty($fuser->signature)) {
|
||||||
|
$defaultmessage.=dol_htmlentitiesbr_decode($fuser->signature);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Editor wysiwyg
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||||
$doleditor=new DolEditor('message',$defaultmessage,'',280,'dolibarr_notes','In',true,false,$this->withfckeditor,8,72);
|
$doleditor=new DolEditor('message',$defaultmessage,'',280,'dolibarr_notes','In',true,false,$this->withfckeditor,8,72);
|
||||||
$out.= $doleditor->Create(1);
|
$out.= $doleditor->Create(1);
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
--
|
--
|
||||||
-- $Id: 3.0.0-3.1.0.sql,v 1.75 2011/06/28 07:47:10 eldy Exp $
|
-- $Id: 3.0.0-3.1.0.sql,v 1.76 2011/06/29 10:23:33 eldy Exp $
|
||||||
--
|
--
|
||||||
-- Be carefull to requests order.
|
-- Be carefull to requests order.
|
||||||
-- This file must be loaded by calling /install/index.php page
|
-- This file must be loaded by calling /install/index.php page
|
||||||
@ -425,3 +425,6 @@ ALTER TABLE llx_c_type_contact ADD COLUMN module varchar(32) NULL;
|
|||||||
ALTER TABLE llx_c_typent ADD COLUMN module varchar(32) NULL;
|
ALTER TABLE llx_c_typent ADD COLUMN module varchar(32) NULL;
|
||||||
ALTER TABLE llx_c_effectif ADD COLUMN module varchar(32) NULL;
|
ALTER TABLE llx_c_effectif ADD COLUMN module varchar(32) NULL;
|
||||||
ALTER TABLE llx_c_forme_juridique ADD COLUMN module varchar(32) NULL;
|
ALTER TABLE llx_c_forme_juridique ADD COLUMN module varchar(32) NULL;
|
||||||
|
|
||||||
|
ALTER TABLE llx_user ADD signature text DEFAULT NULL AFTER email;
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
-- ============================================================================
|
-- ============================================================================
|
||||||
-- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
-- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
-- Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
-- Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
-- Copyright (C) 2007-2009 Regis Houssin <regis@dolibarr.fr>
|
-- Copyright (C) 2007-2009 Regis Houssin <regis@dolibarr.fr>
|
||||||
--
|
--
|
||||||
-- This program is free software; you can redistribute it and/or modify
|
-- This program is free software; you can redistribute it and/or modify
|
||||||
@ -17,7 +17,7 @@
|
|||||||
-- along with this program; if not, write to the Free Software
|
-- along with this program; if not, write to the Free Software
|
||||||
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
--
|
--
|
||||||
-- $Id$
|
-- $Id: llx_user.sql,v 1.8 2011/06/29 10:23:33 eldy Exp $
|
||||||
-- ===========================================================================
|
-- ===========================================================================
|
||||||
|
|
||||||
create table llx_user
|
create table llx_user
|
||||||
@ -39,6 +39,7 @@ create table llx_user
|
|||||||
office_fax varchar(20),
|
office_fax varchar(20),
|
||||||
user_mobile varchar(20),
|
user_mobile varchar(20),
|
||||||
email varchar(255),
|
email varchar(255),
|
||||||
|
signature text DEFAULT NULL,
|
||||||
admin smallint DEFAULT 0,
|
admin smallint DEFAULT 0,
|
||||||
webcal_login varchar(25), -- TODO move to an extra table (ex: llx_extra_fields)
|
webcal_login varchar(25), -- TODO move to an extra table (ex: llx_extra_fields)
|
||||||
phenix_login varchar(25), -- TODO move to an extra table (ex: llx_extra_fields)
|
phenix_login varchar(25), -- TODO move to an extra table (ex: llx_extra_fields)
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/user/class/user.class.php
|
* \file htdocs/user/class/user.class.php
|
||||||
* \brief Fichier de la classe utilisateur
|
* \brief Fichier de la classe utilisateur
|
||||||
* \version $Id$
|
* \version $Id: user.class.php,v 1.43 2011/06/29 10:23:32 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
|
require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
|
||||||
@ -53,6 +53,7 @@ class User extends CommonObject
|
|||||||
var $firstname;
|
var $firstname;
|
||||||
var $note;
|
var $note;
|
||||||
var $email;
|
var $email;
|
||||||
|
var $signature;
|
||||||
var $office_phone;
|
var $office_phone;
|
||||||
var $office_fax;
|
var $office_fax;
|
||||||
var $user_mobile;
|
var $user_mobile;
|
||||||
@ -116,7 +117,7 @@ class User extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Charge un objet user avec toutes ces caracteristiques depuis un id ou login
|
* Load a user from database with its id or ref (login)
|
||||||
* @param id Si defini, id a utiliser pour recherche
|
* @param id Si defini, id a utiliser pour recherche
|
||||||
* @param login Si defini, login a utiliser pour recherche
|
* @param login Si defini, login a utiliser pour recherche
|
||||||
* @param sid Si defini, sid a utiliser pour recherche
|
* @param sid Si defini, sid a utiliser pour recherche
|
||||||
@ -127,11 +128,11 @@ class User extends CommonObject
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
// Nettoyage parametres
|
// Clean parameters
|
||||||
$login=trim($login);
|
$login=trim($login);
|
||||||
|
|
||||||
// Recupere utilisateur
|
// Get user
|
||||||
$sql = "SELECT u.rowid, u.name, u.firstname, u.email, u.office_phone, u.office_fax, u.user_mobile,";
|
$sql = "SELECT u.rowid, u.name, u.firstname, u.email, u.signature, u.office_phone, u.office_fax, u.user_mobile,";
|
||||||
$sql.= " u.admin, u.login, u.webcal_login, u.phenix_login, u.phenix_pass, u.note,";
|
$sql.= " u.admin, u.login, u.webcal_login, u.phenix_login, u.phenix_pass, u.note,";
|
||||||
$sql.= " u.pass, u.pass_crypted, u.pass_temp,";
|
$sql.= " u.pass, u.pass_crypted, u.pass_temp,";
|
||||||
$sql.= " u.fk_societe, u.fk_socpeople, u.fk_member, u.ldap_sid,";
|
$sql.= " u.fk_societe, u.fk_socpeople, u.fk_member, u.ldap_sid,";
|
||||||
@ -184,6 +185,7 @@ class User extends CommonObject
|
|||||||
$this->office_fax = $obj->office_fax;
|
$this->office_fax = $obj->office_fax;
|
||||||
$this->user_mobile = $obj->user_mobile;
|
$this->user_mobile = $obj->user_mobile;
|
||||||
$this->email = $obj->email;
|
$this->email = $obj->email;
|
||||||
|
$this->signature = $obj->signature;
|
||||||
$this->admin = $obj->admin;
|
$this->admin = $obj->admin;
|
||||||
$this->note = $obj->note;
|
$this->note = $obj->note;
|
||||||
$this->statut = $obj->statut;
|
$this->statut = $obj->statut;
|
||||||
@ -1008,6 +1010,7 @@ class User extends CommonObject
|
|||||||
$this->office_fax = trim($this->office_fax);
|
$this->office_fax = trim($this->office_fax);
|
||||||
$this->user_mobile = trim($this->user_mobile);
|
$this->user_mobile = trim($this->user_mobile);
|
||||||
$this->email = trim($this->email);
|
$this->email = trim($this->email);
|
||||||
|
$this->signature = trim($this->signature);
|
||||||
$this->note = trim($this->note);
|
$this->note = trim($this->note);
|
||||||
$this->openid = trim(empty($this->openid)?'':$this->openid); // Avoid warning
|
$this->openid = trim(empty($this->openid)?'':$this->openid); // Avoid warning
|
||||||
$this->webcal_login = trim($this->webcal_login);
|
$this->webcal_login = trim($this->webcal_login);
|
||||||
@ -1038,6 +1041,7 @@ class User extends CommonObject
|
|||||||
$sql.= ", office_fax = '".$this->db->escape($this->office_fax)."'";
|
$sql.= ", office_fax = '".$this->db->escape($this->office_fax)."'";
|
||||||
$sql.= ", user_mobile = '".$this->db->escape($this->user_mobile)."'";
|
$sql.= ", user_mobile = '".$this->db->escape($this->user_mobile)."'";
|
||||||
$sql.= ", email = '".$this->db->escape($this->email)."'";
|
$sql.= ", email = '".$this->db->escape($this->email)."'";
|
||||||
|
$sql.= ", signature = '".addslashes($this->signature)."'";
|
||||||
$sql.= ", webcal_login = '".$this->db->escape($this->webcal_login)."'";
|
$sql.= ", webcal_login = '".$this->db->escape($this->webcal_login)."'";
|
||||||
$sql.= ", phenix_login = '".$this->db->escape($this->phenix_login)."'";
|
$sql.= ", phenix_login = '".$this->db->escape($this->phenix_login)."'";
|
||||||
$sql.= ", phenix_pass = '".$this->db->escape($this->phenix_pass)."'";
|
$sql.= ", phenix_pass = '".$this->db->escape($this->phenix_pass)."'";
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/user/fiche.php
|
* \file htdocs/user/fiche.php
|
||||||
* \brief Tab of user card
|
* \brief Tab of user card
|
||||||
* \version $Id$
|
* \version $Id: fiche.php,v 1.273 2011/06/29 10:23:33 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("../main.inc.php");
|
require("../main.inc.php");
|
||||||
@ -188,6 +188,7 @@ if ($_POST["action"] == 'add' && $canadduser)
|
|||||||
$edituser->user_mobile = $_POST["user_mobile"];
|
$edituser->user_mobile = $_POST["user_mobile"];
|
||||||
$edituser->email = $_POST["email"];
|
$edituser->email = $_POST["email"];
|
||||||
$edituser->webcal_login = $_POST["webcal_login"];
|
$edituser->webcal_login = $_POST["webcal_login"];
|
||||||
|
$edituser->signature = $_POST["signature"];
|
||||||
$edituser->phenix_login = $_POST["phenix_login"];
|
$edituser->phenix_login = $_POST["phenix_login"];
|
||||||
$edituser->phenix_pass = $_POST["phenix_pass"];
|
$edituser->phenix_pass = $_POST["phenix_pass"];
|
||||||
$edituser->note = $_POST["note"];
|
$edituser->note = $_POST["note"];
|
||||||
@ -284,6 +285,7 @@ if ($action == 'update' && ! $_POST["cancel"])
|
|||||||
$edituser->office_fax = $_POST["office_fax"];
|
$edituser->office_fax = $_POST["office_fax"];
|
||||||
$edituser->user_mobile = $_POST["user_mobile"];
|
$edituser->user_mobile = $_POST["user_mobile"];
|
||||||
$edituser->email = $_POST["email"];
|
$edituser->email = $_POST["email"];
|
||||||
|
$edituser->signature = $_POST["signature"];
|
||||||
$edituser->openid = $_POST["openid"];
|
$edituser->openid = $_POST["openid"];
|
||||||
$edituser->webcal_login = $_POST["webcal_login"];
|
$edituser->webcal_login = $_POST["webcal_login"];
|
||||||
$edituser->phenix_login = $_POST["phenix_login"];
|
$edituser->phenix_login = $_POST["phenix_login"];
|
||||||
@ -743,6 +745,12 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Signature
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("Signature").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
print '<textarea rows="'.ROWS_5.'" cols="90" name="signature">'.$_POST["signature"].'</textarea>';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
// Note
|
// Note
|
||||||
print '<tr><td valign="top">';
|
print '<tr><td valign="top">';
|
||||||
print $langs->trans("Note");
|
print $langs->trans("Note");
|
||||||
@ -910,7 +918,7 @@ else
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
$rowspan=13;
|
$rowspan=14;
|
||||||
if ($conf->societe->enabled) $rowspan++;
|
if ($conf->societe->enabled) $rowspan++;
|
||||||
if ($conf->adherent->enabled) $rowspan++;
|
if ($conf->adherent->enabled) $rowspan++;
|
||||||
if ($conf->webcalendar->enabled) $rowspan++;
|
if ($conf->webcalendar->enabled) $rowspan++;
|
||||||
@ -1030,6 +1038,11 @@ else
|
|||||||
print '<td>'.dol_print_email($fuser->email,0,0,1).'</td>';
|
print '<td>'.dol_print_email($fuser->email,0,0,1).'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
// Signature
|
||||||
|
print '<tr><td valign="top">'.$langs->trans('Signature').'</td>';
|
||||||
|
print '<td>'.$fuser->signature.'</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
// Statut
|
// Statut
|
||||||
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -1299,7 +1312,7 @@ else
|
|||||||
print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
|
print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
|
||||||
print '<table width="100%" class="border">';
|
print '<table width="100%" class="border">';
|
||||||
|
|
||||||
$rowspan=11;
|
$rowspan=12;
|
||||||
if ($conf->societe->enabled) $rowspan++;
|
if ($conf->societe->enabled) $rowspan++;
|
||||||
if ($conf->adherent->enabled) $rowspan++;
|
if ($conf->adherent->enabled) $rowspan++;
|
||||||
if ($conf->webcalendar->enabled) $rowspan++;
|
if ($conf->webcalendar->enabled) $rowspan++;
|
||||||
@ -1524,6 +1537,12 @@ else
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Signature
|
||||||
|
print "<tr>".'<td valign="top">'.$langs->trans("Signature").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
print '<textarea name="signature" rows="5" cols="90">'.dol_htmlentitiesbr_decode($fuser->signature).'</textarea>';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
// openid
|
// openid
|
||||||
if (preg_match('/myopenid/',$conf->authmode))
|
if (preg_match('/myopenid/',$conf->authmode))
|
||||||
{
|
{
|
||||||
@ -1645,5 +1664,5 @@ function dolValidElement($element) {
|
|||||||
return (trim($element) != '');
|
return (trim($element) != '');
|
||||||
}
|
}
|
||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
llxFooter('$Date: 2011/06/29 10:23:33 $ - $Revision: 1.273 $');
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user