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
9c4d60fd
Commit
9c4d60fd
authored
8 years ago
by
Juanjo Menent
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #5639 from atm-florian/4.0
fix ressource module for PGSQL and coding style
parents
ed25c0fd
848d046b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/resource/class/dolresource.class.php
+10
-21
10 additions, 21 deletions
htdocs/resource/class/dolresource.class.php
with
10 additions
and
21 deletions
htdocs/resource/class/dolresource.class.php
+
10
−
21
View file @
9c4d60fd
...
...
@@ -339,7 +339,7 @@ class Dolresource extends CommonObject
if
(
$this
->
db
->
query
(
$sql
))
{
$sql
=
"DELETE FROM "
.
MAIN_DB_PREFIX
.
"element_resources"
;
$sql
.
=
" WHERE element_type='resource' AND resource_id =
"
.
$this
->
db
->
escape
(
$rowid
);
$sql
.
=
" WHERE element_type='resource' AND resource_id ="
.
$this
->
db
->
escape
(
$rowid
);
dol_syslog
(
get_class
(
$this
)
.
"::delete"
,
LOG_DEBUG
);
if
(
$this
->
db
->
query
(
$sql
))
{
...
...
@@ -393,7 +393,6 @@ class Dolresource extends CommonObject
}
}
}
//$sql.= " GROUP BY t.rowid, t.entity, t.ref, t.description, t.fk_code_type_resource, t.tms, ty.label";
$sql
.
=
$this
->
db
->
order
(
$sortfield
,
$sortorder
);
$this
->
num_all
=
0
;
if
(
empty
(
$conf
->
global
->
MAIN_DISABLE_FULL_SCANLIST
))
...
...
@@ -410,10 +409,9 @@ class Dolresource extends CommonObject
$num
=
$this
->
db
->
num_rows
(
$resql
);
if
(
$num
)
{
$
i
=
0
;
while
(
$
i
<
$num
)
$
this
->
lines
=
array
()
;
while
(
$
obj
=
$this
->
db
->
fetch_object
(
$resql
)
)
{
$obj
=
$this
->
db
->
fetch_object
(
$resql
);
$line
=
new
Dolresource
(
$this
->
db
);
$line
->
id
=
$obj
->
rowid
;
$line
->
ref
=
$obj
->
ref
;
...
...
@@ -421,8 +419,7 @@ class Dolresource extends CommonObject
$line
->
fk_code_type_resource
=
$obj
->
fk_code_type_resource
;
$line
->
type_label
=
$obj
->
type_label
;
$this
->
lines
[
$i
]
=
$line
;
$i
++
;
$this
->
lines
[]
=
$line
;
}
$this
->
db
->
free
(
$resql
);
}
...
...
@@ -473,7 +470,6 @@ class Dolresource extends CommonObject
}
}
}
//$sql.= " GROUP BY t.rowid, ty.label";
$sql
.
=
$this
->
db
->
order
(
$sortfield
,
$sortorder
);
if
(
$limit
)
$sql
.
=
$this
->
db
->
plimit
(
$limit
+
1
,
$offset
);
dol_syslog
(
get_class
(
$this
)
.
"::fetch_all"
,
LOG_DEBUG
);
...
...
@@ -484,10 +480,8 @@ class Dolresource extends CommonObject
$num
=
$this
->
db
->
num_rows
(
$resql
);
if
(
$num
)
{
$i
=
0
;
while
(
$i
<
$num
)
while
(
$obj
=
$this
->
db
->
fetch_object
(
$resql
))
{
$obj
=
$this
->
db
->
fetch_object
(
$resql
);
$line
=
new
Dolresource
(
$this
->
db
);
$line
->
id
=
$obj
->
rowid
;
$line
->
resource_id
=
$obj
->
resource_id
;
...
...
@@ -502,9 +496,8 @@ class Dolresource extends CommonObject
$line
->
objresource
=
fetchObjectByElement
(
$obj
->
resource_id
,
$obj
->
resource_type
);
if
(
$obj
->
element_id
&&
$obj
->
element_type
)
$line
->
objelement
=
fetchObjectByElement
(
$obj
->
element_id
,
$obj
->
element_type
);
$this
->
lines
[
$i
]
=
$line
;
$this
->
lines
[]
=
$line
;
$i
++
;
}
$this
->
db
->
free
(
$resql
);
}
...
...
@@ -559,7 +552,6 @@ class Dolresource extends CommonObject
}
}
}
//$sql.= " GROUP BY t.resource_id";
$sql
.
=
$this
->
db
->
order
(
$sortfield
,
$sortorder
);
if
(
$limit
)
$sql
.
=
$this
->
db
->
plimit
(
$limit
+
1
,
$offset
);
dol_syslog
(
get_class
(
$this
)
.
"::fetch_all"
,
LOG_DEBUG
);
...
...
@@ -570,10 +562,9 @@ class Dolresource extends CommonObject
$num
=
$this
->
db
->
num_rows
(
$resql
);
if
(
$num
)
{
$
i
=
0
;
while
(
$
i
<
$num
)
$
this
->
lines
=
array
()
;
while
(
$
obj
=
$this
->
db
->
fetch_object
(
$resql
)
)
{
$obj
=
$this
->
db
->
fetch_object
(
$resql
);
$line
=
new
Dolresource
(
$this
->
db
);
$line
->
id
=
$obj
->
rowid
;
$line
->
resource_id
=
$obj
->
resource_id
;
...
...
@@ -584,9 +575,7 @@ class Dolresource extends CommonObject
$line
->
mandatory
=
$obj
->
mandatory
;
$line
->
fk_user_create
=
$obj
->
fk_user_create
;
$this
->
lines
[
$i
]
=
fetchObjectByElement
(
$obj
->
resource_id
,
$obj
->
resource_type
);
$i
++
;
$this
->
lines
[]
=
fetchObjectByElement
(
$obj
->
resource_id
,
$obj
->
resource_type
);
}
$this
->
db
->
free
(
$resql
);
}
...
...
@@ -759,7 +748,7 @@ class Dolresource extends CommonObject
/**
* Return an array with resources linked to the element
*
*
* @param string $element Element
* @param int $element_id Id
* @param string $resource_type Type
...
...
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