Qual: Clean code from things that should be inside external module.
This commit is contained in:
parent
792341a4b8
commit
750b30863f
@ -589,8 +589,6 @@ if ($action == 'create')
|
||||
print '<input type="text" name="priority" value="'.(GETPOST('priority')?GETPOST('priority'):($actioncomm->priority?$actioncomm->priority:'')).'" size="5">';
|
||||
print '</td></tr>';
|
||||
|
||||
add_row_for_calendar_link();
|
||||
|
||||
// Description
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
@ -1061,90 +1059,8 @@ if ($id > 0)
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
|
||||
/**
|
||||
* Ajoute une ligne de tableau a 2 colonnes pour avoir l'option synchro calendrier
|
||||
*
|
||||
* @return int Retourne le nombre de lignes ajoutees
|
||||
*/
|
||||
function add_row_for_calendar_link()
|
||||
{
|
||||
global $conf,$langs,$user;
|
||||
$nbtr=0;
|
||||
|
||||
// Lien avec calendrier si module active
|
||||
// TODO external module
|
||||
if (! empty($conf->webcalendar->enabled))
|
||||
{
|
||||
if ($conf->global->PHPWEBCALENDAR_SYNCRO != 'never')
|
||||
{
|
||||
$langs->load("other");
|
||||
|
||||
print '<tr><td width="25%" nowrap>'.$langs->trans("AddCalendarEntry","Webcalendar").'</td>';
|
||||
|
||||
if (! $user->webcal_login)
|
||||
{
|
||||
print '<td><input type="checkbox" disabled name="add_webcal">';
|
||||
print ' '.$langs->transnoentities("ErrorWebcalLoginNotDefined","<a href=\"".DOL_URL_ROOT."/user/fiche.php?id=".$user->id."\">".$user->login."</a>");
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
$nbtr++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($conf->global->PHPWEBCALENDAR_SYNCRO == 'always')
|
||||
{
|
||||
print '<input type="hidden" name="add_webcal" value="on">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td><input type="checkbox" name="add_webcal"'.(($conf->global->PHPWEBCALENDAR_SYNCRO=='always' || $conf->global->PHPWEBCALENDAR_SYNCRO=='yesbydefault')?' checked':'').'></td>';
|
||||
print '</tr>';
|
||||
$nbtr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO external module
|
||||
if (! empty($conf->phenix->enabled))
|
||||
{
|
||||
if ($conf->global->PHPPHENIX_SYNCRO != 'never')
|
||||
{
|
||||
$langs->load("other");
|
||||
|
||||
print '<tr><td width="25%" nowrap>'.$langs->trans("AddCalendarEntry","Phenix").'</td>';
|
||||
|
||||
if (! $user->phenix_login)
|
||||
{
|
||||
print '<td><input type="checkbox" disabled name="add_phenix">';
|
||||
print ' '.$langs->transnoentities("ErrorPhenixLoginNotDefined","<a href=\"".DOL_URL_ROOT."/user/fiche.php?id=".$user->id."\">".$user->login."</a>");
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
$nbtr++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($conf->global->PHPPHENIX_SYNCRO == 'always')
|
||||
{
|
||||
print '<input type="hidden" name="add_phenix" value="on">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td><input type="checkbox" name="add_phenix"'.(($conf->global->PHPPHENIX_SYNCRO=='always' || $conf->global->PHPPHENIX_SYNCRO=='yesbydefault')?' checked':'').'></td>';
|
||||
print '</tr>';
|
||||
$nbtr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $nbtr;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
-- ============================================================================
|
||||
-- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
-- Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
-- Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
-- Copyright (C) 2007-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
@ -47,9 +47,6 @@ create table llx_user
|
||||
email varchar(255),
|
||||
signature text DEFAULT NULL,
|
||||
admin smallint DEFAULT 0,
|
||||
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_pass varchar(128), -- TODO move to an extra table (ex: llx_extra_fields)
|
||||
module_comm smallint DEFAULT 1,
|
||||
module_compta smallint DEFAULT 1,
|
||||
fk_societe integer,
|
||||
@ -64,6 +61,6 @@ create table llx_user
|
||||
openid varchar(255),
|
||||
statut tinyint DEFAULT 1,
|
||||
photo varchar(255), -- filename or url of photo
|
||||
lang varchar(6)
|
||||
|
||||
lang varchar(6),
|
||||
color varchar(6)
|
||||
)ENGINE=innodb;
|
||||
|
||||
@ -76,11 +76,6 @@ class User extends CommonObject
|
||||
var $fk_member;
|
||||
var $fk_user;
|
||||
|
||||
var $webcal_login;
|
||||
var $phenix_login;
|
||||
var $phenix_pass;
|
||||
var $phenix_pass_crypted;
|
||||
|
||||
var $clicktodial_url;
|
||||
var $clicktodial_login;
|
||||
var $clicktodial_password;
|
||||
@ -144,7 +139,7 @@ class User extends CommonObject
|
||||
|
||||
// Get user
|
||||
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.email, u.job, 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.note,";
|
||||
$sql.= " u.pass, u.pass_crypted, u.pass_temp,";
|
||||
$sql.= " u.fk_societe, u.fk_socpeople, u.fk_member, u.fk_user, u.ldap_sid,";
|
||||
$sql.= " u.statut, u.lang, u.entity,";
|
||||
@ -220,9 +215,6 @@ class User extends CommonObject
|
||||
$this->datelastlogin = $this->db->jdate($obj->datel);
|
||||
$this->datepreviouslogin = $this->db->jdate($obj->datep);
|
||||
|
||||
$this->webcal_login = $obj->webcal_login;
|
||||
$this->phenix_login = $obj->phenix_login;
|
||||
$this->phenix_pass_crypted = $obj->phenix_pass;
|
||||
$this->societe_id = $obj->fk_societe;
|
||||
$this->contact_id = $obj->fk_socpeople;
|
||||
$this->fk_member = $obj->fk_member;
|
||||
@ -1111,12 +1103,6 @@ class User extends CommonObject
|
||||
$this->signature = trim($this->signature);
|
||||
$this->note = trim($this->note);
|
||||
$this->openid = trim(empty($this->openid)?'':$this->openid); // Avoid warning
|
||||
$this->webcal_login = trim($this->webcal_login);
|
||||
$this->phenix_login = trim($this->phenix_login);
|
||||
if ($this->phenix_pass != $this->phenix_pass_crypted)
|
||||
{
|
||||
$this->phenix_pass = dol_hash(trim($this->phenix_pass));
|
||||
}
|
||||
$this->admin = $this->admin?$this->admin:0;
|
||||
|
||||
// Check parameters
|
||||
@ -1146,9 +1132,6 @@ class User extends CommonObject
|
||||
$sql.= ", email = '".$this->db->escape($this->email)."'";
|
||||
$sql.= ", job = '".$this->db->escape($this->job)."'";
|
||||
$sql.= ", signature = '".$this->db->escape($this->signature)."'";
|
||||
$sql.= ", webcal_login = '".$this->db->escape($this->webcal_login)."'";
|
||||
$sql.= ", phenix_login = '".$this->db->escape($this->phenix_login)."'";
|
||||
$sql.= ", phenix_pass = '".$this->db->escape($this->phenix_pass)."'";
|
||||
$sql.= ", note = '".$this->db->escape($this->note)."'";
|
||||
$sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null");
|
||||
$sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null");
|
||||
@ -1954,6 +1937,8 @@ class User extends CommonObject
|
||||
{
|
||||
global $user,$langs;
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
// Initialise parametres
|
||||
$this->id=0;
|
||||
$this->ref = 'SPECIMEN';
|
||||
@ -1971,12 +1956,11 @@ class User extends CommonObject
|
||||
$this->pass='dolibspec';
|
||||
//$this->pass_indatabase='dolibspec'; Set after a fetch
|
||||
//$this->pass_indatabase_crypted='e80ca5a88c892b0aaaf7e154853bccab'; Set after a fetch
|
||||
$this->datec=time();
|
||||
$this->datem=time();
|
||||
$this->webcal_login='dolibspec';
|
||||
$this->datec=$now;
|
||||
$this->datem=$now;
|
||||
|
||||
$this->datelastlogin=time();
|
||||
$this->datepreviouslogin=time();
|
||||
$this->datelastlogin=$now;
|
||||
$this->datepreviouslogin=$now;
|
||||
$this->statut=1;
|
||||
|
||||
//$this->societe_id = 1; For external users
|
||||
|
||||
@ -357,10 +357,6 @@ function getUser($authentication,$id,$ref='',$ref_ext='')
|
||||
'fk_thirdparty' => $user->societe_id,
|
||||
'fk_contact' => $user->contact_id,
|
||||
'fk_member' => $user->fk_member,
|
||||
'webcal_login' => $user->webcal_login,
|
||||
'phenix_login' => $user->phenix_login,
|
||||
'phenix_pass' => $user->phenix_pass,
|
||||
'phenix_pass_crypted' => $user->phenix_pass_crypted,
|
||||
'datelastlogin' => dol_print_date($user->datelastlogin,'dayhourrfc'),
|
||||
'datepreviouslogin' => dol_print_date($user->datepreviouslogin,'dayhourrfc'),
|
||||
'statut' => $user->statut,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user