Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
4818b1ba
Commit
4818b1ba
authored
7 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Load default values into $user->default_values
parent
e6e9b655
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/admin/defaultvalues.php
+0
-1
0 additions, 1 deletion
htdocs/admin/defaultvalues.php
htdocs/user/class/user.class.php
+27
-8
27 additions, 8 deletions
htdocs/user/class/user.class.php
with
27 additions
and
9 deletions
htdocs/admin/defaultvalues.php
+
0
−
1
View file @
4818b1ba
...
...
@@ -259,7 +259,6 @@ if ($result)
{
$num
=
$db
->
num_rows
(
$result
);
$i
=
0
;
$var
=
false
;
while
(
$i
<
$num
)
{
...
...
This diff is collapsed.
Click to expand it.
htdocs/user/class/user.class.php
+
27
−
8
View file @
4818b1ba
...
...
@@ -104,16 +104,17 @@ class User extends CommonObject
public
$lang
;
public
$rights
;
// Array of permissions user->rights->permx
public
$all_permissions_are_loaded
;
/**< \private a
ll
_
permission
s_
are
_
loaded
*/
p
rivate
$_tab_loaded
=
array
();
// Array of cache of already loaded permissions
p
ublic
$nb_rights
;
// Number of rights granted to the user
public
$all_permissions_are_loaded
;
// A
ll
permission
are
loaded
p
ublic
$nb_rights
;
// Number of rights granted to the user
p
rivate
$_tab_loaded
=
array
();
// Cache array of already loaded permissions
public
$conf
;
// To store personal config
var
$oldcopy
;
// To
contains a clone of this when we need to save old properties of object
public
$default_values
;
// To
store default values for user
public
$users
;
// To store all tree of users hierarchy
public
$parentof
;
// To store an array of all parents for all ids.
private
$cache_childids
;
public
$accountancy_code
;
// Accountancy code in prevision of the complete accountancy module
public
$thm
;
// Average cost of employee - Used for valuation of time spent
...
...
@@ -127,7 +128,6 @@ class User extends CommonObject
public
$dateemployment
;
// Define date of employment by company
private
$cache_childids
;
/**
...
...
@@ -339,6 +339,7 @@ class User extends CommonObject
// To get back the global configuration unique to the user
if
(
$loadpersonalconf
)
{
// Load user->conf for user
$sql
=
"SELECT param, value FROM "
.
MAIN_DB_PREFIX
.
"user_param"
;
$sql
.
=
" WHERE fk_user = "
.
$this
->
id
;
$sql
.
=
" AND entity = "
.
$conf
->
entity
;
...
...
@@ -362,6 +363,24 @@ class User extends CommonObject
$this
->
error
=
$this
->
db
->
error
();
return
-
2
;
}
// Load user->default_values for user. TODO Save this in memcached ?
$sql
=
"SELECT rowid, entity, type, page, param, value"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"default_values"
;
$sql
.
=
" WHERE entity IN ("
.
$this
->
entity
.
","
.
$conf
->
entity
.
")"
;
$sql
.
=
" AND user_id IN (0, "
.
$this
->
id
.
")"
;
$resql
=
$this
->
db
->
query
(
$sql
);
if
(
$resql
)
{
while
(
$obj
=
$this
->
db
->
fetch_object
(
$resql
))
{
if
(
!
empty
(
$obj
->
page
)
&&
!
empty
(
$obj
->
type
)
&&
!
empty
(
$obj
->
param
))
{
$user
->
default_values
[
$obj
->
page
][
$obj
->
type
][
$obj
->
param
]
=
$obj
->
value
;
}
}
$this
->
db
->
free
(
$resql
);
}
}
return
1
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment