mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 17:18:13 +01:00
Accountancy code on user object in prevision of the complete accountancy module
This commit is contained in:
@@ -66,4 +66,4 @@ ALTER TABLE llx_propaldet_extrafields ADD INDEX idx_propaldet_extrafields (fk_ob
|
|||||||
DROP table llx_adherent_options;
|
DROP table llx_adherent_options;
|
||||||
DROP table llx_adherent_options_label;
|
DROP table llx_adherent_options_label;
|
||||||
|
|
||||||
|
ALTER TABLE `llx_user` ADD `accountancy_code` VARCHAR( 24 ) NULL;
|
||||||
|
|||||||
@@ -62,5 +62,6 @@ create table llx_user
|
|||||||
statut tinyint DEFAULT 1,
|
statut tinyint DEFAULT 1,
|
||||||
photo varchar(255), -- filename or url of photo
|
photo varchar(255), -- filename or url of photo
|
||||||
lang varchar(6),
|
lang varchar(6),
|
||||||
color varchar(6)
|
color varchar(6),
|
||||||
|
accountancy_code varchar(24) NULL
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|||||||
@@ -97,6 +97,8 @@ class User extends CommonObject
|
|||||||
var $users; // To store all tree of users hierarchy
|
var $users; // To store all tree of users hierarchy
|
||||||
var $parentof; // To store an array of all parents for all ids.
|
var $parentof; // To store an array of all parents for all ids.
|
||||||
|
|
||||||
|
var $accountancy_code; // Accountancy code in prevision of the complete accountancy module
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor de la classe
|
* Constructor de la classe
|
||||||
@@ -149,6 +151,7 @@ class User extends CommonObject
|
|||||||
$sql.= " u.datepreviouslogin as datep,";
|
$sql.= " u.datepreviouslogin as datep,";
|
||||||
$sql.= " u.photo as photo,";
|
$sql.= " u.photo as photo,";
|
||||||
$sql.= " u.openid as openid,";
|
$sql.= " u.openid as openid,";
|
||||||
|
$sql.= " u.accountancy_code,";
|
||||||
$sql.= " u.ref_int, u.ref_ext";
|
$sql.= " u.ref_int, u.ref_ext";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||||
|
|
||||||
@@ -209,6 +212,7 @@ class User extends CommonObject
|
|||||||
$this->openid = $obj->openid;
|
$this->openid = $obj->openid;
|
||||||
$this->lang = $obj->lang;
|
$this->lang = $obj->lang;
|
||||||
$this->entity = $obj->entity;
|
$this->entity = $obj->entity;
|
||||||
|
$this->accountancy_code = $obj->accountancy_code;
|
||||||
|
|
||||||
$this->datec = $this->db->jdate($obj->datec);
|
$this->datec = $this->db->jdate($obj->datec);
|
||||||
$this->datem = $this->db->jdate($obj->datem);
|
$this->datem = $this->db->jdate($obj->datem);
|
||||||
@@ -1114,6 +1118,7 @@ class User extends CommonObject
|
|||||||
$this->address = empty($this->address)?'':$this->address;
|
$this->address = empty($this->address)?'':$this->address;
|
||||||
$this->zip = empty($this->zip)?'':$this->zip;
|
$this->zip = empty($this->zip)?'':$this->zip;
|
||||||
$this->town = empty($this->town)?'':$this->town;
|
$this->town = empty($this->town)?'':$this->town;
|
||||||
|
$this->accountancy_code = trim($this->accountancy_code);
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email))
|
if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email))
|
||||||
@@ -1142,6 +1147,7 @@ class User extends CommonObject
|
|||||||
$sql.= ", email = '".$this->db->escape($this->email)."'";
|
$sql.= ", email = '".$this->db->escape($this->email)."'";
|
||||||
$sql.= ", job = '".$this->db->escape($this->job)."'";
|
$sql.= ", job = '".$this->db->escape($this->job)."'";
|
||||||
$sql.= ", signature = '".$this->db->escape($this->signature)."'";
|
$sql.= ", signature = '".$this->db->escape($this->signature)."'";
|
||||||
|
$sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'";
|
||||||
$sql.= ", note = '".$this->db->escape($this->note)."'";
|
$sql.= ", note = '".$this->db->escape($this->note)."'";
|
||||||
$sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null");
|
$sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null");
|
||||||
$sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null");
|
$sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null");
|
||||||
|
|||||||
@@ -188,6 +188,7 @@ if ($action == 'add' && $canadduser)
|
|||||||
$object->email = GETPOST("email");
|
$object->email = GETPOST("email");
|
||||||
$object->job = GETPOST("job");
|
$object->job = GETPOST("job");
|
||||||
$object->signature = GETPOST("signature");
|
$object->signature = GETPOST("signature");
|
||||||
|
$object->accountancy_code = GETPOST("accountancy_code");
|
||||||
$object->note = GETPOST("note");
|
$object->note = GETPOST("note");
|
||||||
$object->ldap_sid = GETPOST("ldap_sid");
|
$object->ldap_sid = GETPOST("ldap_sid");
|
||||||
|
|
||||||
@@ -324,6 +325,7 @@ if ($action == 'update' && ! $_POST["cancel"])
|
|||||||
$object->email = GETPOST("email");
|
$object->email = GETPOST("email");
|
||||||
$object->job = GETPOST("job");
|
$object->job = GETPOST("job");
|
||||||
$object->signature = GETPOST("signature");
|
$object->signature = GETPOST("signature");
|
||||||
|
$object->accountancy_code = GETPOST("accountancy_code");
|
||||||
$object->openid = GETPOST("openid");
|
$object->openid = GETPOST("openid");
|
||||||
$object->fk_user = GETPOST("fk_user")>0?GETPOST("fk_user"):0;
|
$object->fk_user = GETPOST("fk_user")>0?GETPOST("fk_user"):0;
|
||||||
|
|
||||||
@@ -1193,6 +1195,10 @@ else
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
// Accountancy code
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
|
||||||
|
print '<td>'.$object->accountancy_code.'</td>';
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@@ -1822,6 +1828,21 @@ else
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
// Accountancy code
|
||||||
|
print "<tr>";
|
||||||
|
print '<td valign="top">'.$langs->trans("AccountancyCode").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
if ($caneditfield)
|
||||||
|
{
|
||||||
|
print '<input size="30" type="text" class="flat" name="accountancy_code" value="'.$object->accountancy_code.'">';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<input type="hidden" name="accountancy_code" value="'.$object->accountancy_code.'">';
|
||||||
|
print $object->accountancy_code;
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|||||||
Reference in New Issue
Block a user