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
1816b224
Commit
1816b224
authored
7 years ago
by
florian HENRY
Browse files
Options
Downloads
Patches
Plain Diff
fix class error
parent
437b2a72
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/ecm/class/ecmfiles.class.php
+36
-16
36 additions, 16 deletions
htdocs/ecm/class/ecmfiles.class.php
htdocs/modulebuilder/template/class/myobject.class.php
+1
-1
1 addition, 1 deletion
htdocs/modulebuilder/template/class/myobject.class.php
with
37 additions
and
17 deletions
htdocs/ecm/class/ecmfiles.class.php
+
36
−
16
View file @
1816b224
...
...
@@ -65,7 +65,7 @@ class EcmFiles //extends CommonObject
/**
*/
/**
* Constructor
...
...
@@ -88,13 +88,13 @@ class EcmFiles //extends CommonObject
public
function
create
(
User
$user
,
$notrigger
=
false
)
{
global
$conf
;
dol_syslog
(
__METHOD__
,
LOG_DEBUG
);
$error
=
0
;
// Clean parameters
if
(
isset
(
$this
->
label
))
{
$this
->
label
=
trim
(
$this
->
label
);
}
...
...
@@ -135,13 +135,13 @@ class EcmFiles //extends CommonObject
$this
->
acl
=
trim
(
$this
->
acl
);
}
if
(
empty
(
$this
->
date_c
))
$this
->
date_c
=
dol_now
();
$maxposition
=
0
;
if
(
empty
(
$this
->
position
))
// Get max used
{
$sql
=
"SELECT MAX(position) as maxposition FROM "
.
MAIN_DB_PREFIX
.
$this
->
table_element
;
$sql
.
=
" WHERE filepath ='"
.
$this
->
db
->
escape
(
$this
->
filepath
)
.
"'"
;
$resql
=
$this
->
db
->
query
(
$sql
);
if
(
$resql
)
{
...
...
@@ -204,7 +204,7 @@ class EcmFiles //extends CommonObject
if
(
!
$error
)
{
$this
->
id
=
$this
->
db
->
last_insert_id
(
MAIN_DB_PREFIX
.
$this
->
table_element
);
$this
->
position
=
$maxposition
;
if
(
!
$notrigger
)
{
// Uncomment this and change MYOBJECT to your own tag if you
// want this action to call a trigger.
...
...
@@ -299,7 +299,7 @@ class EcmFiles //extends CommonObject
$this
->
fk_user_m
=
$obj
->
fk_user_m
;
$this
->
acl
=
$obj
->
acl
;
}
// Retrieve all extrafields for invoice
// fetch optionals attributes and labels
/*
...
...
@@ -309,7 +309,7 @@ class EcmFiles //extends CommonObject
$this->fetch_optionals($this->id,$extralabels);
*/
// $this->fetch_lines();
$this
->
db
->
free
(
$resql
);
if
(
$numrows
)
{
...
...
@@ -393,7 +393,7 @@ class EcmFiles //extends CommonObject
$line
=
new
EcmfilesLine
();
$line
->
id
=
$obj
->
rowid
;
$line
->
label
=
$obj
->
label
;
$line
->
entity
=
$obj
->
entity
;
$line
->
filename
=
$obj
->
filename
;
...
...
@@ -437,7 +437,7 @@ class EcmFiles //extends CommonObject
dol_syslog
(
__METHOD__
,
LOG_DEBUG
);
// Clean parameters
if
(
isset
(
$this
->
label
))
{
$this
->
label
=
trim
(
$this
->
label
);
}
...
...
@@ -562,7 +562,7 @@ class EcmFiles //extends CommonObject
}
// If you need to delete child tables to, you can insert them here
if
(
!
$error
)
{
$sql
=
'DELETE FROM '
.
MAIN_DB_PREFIX
.
$this
->
table_element
;
$sql
.
=
' WHERE rowid='
.
$this
->
id
;
...
...
@@ -651,7 +651,7 @@ class EcmFiles //extends CommonObject
global
$menumanager
;
if
(
!
empty
(
$conf
->
dol_no_mouse_hover
))
$notooltip
=
1
;
// Force disable tooltips
$result
=
''
;
$companylink
=
''
;
...
...
@@ -660,7 +660,7 @@ class EcmFiles //extends CommonObject
$label
.
=
'<b>'
.
$langs
->
trans
(
'Ref'
)
.
':</b> '
.
$this
->
ref
;
$url
=
DOL_URL_ROOT
.
'/ecm/'
.
$this
->
table_name
.
'_card.php?id='
.
$this
->
id
;
$linkclose
=
''
;
if
(
empty
(
$notooltip
))
{
...
...
@@ -673,7 +673,7 @@ class EcmFiles //extends CommonObject
$linkclose
.
=
' class="classfortooltip'
.
(
$morecss
?
' '
.
$morecss
:
''
)
.
'"'
;
}
else
$linkclose
=
(
$morecss
?
' class="'
.
$morecss
.
'"'
:
''
);
$linkstart
=
'<a href="'
.
$url
.
'"'
;
$linkstart
.
=
$linkclose
.
'>'
;
$linkend
=
'</a>'
;
...
...
@@ -757,9 +757,9 @@ class EcmFiles //extends CommonObject
public
function
initAsSpecimen
()
{
global
$conf
,
$user
;
$this
->
id
=
0
;
$this
->
label
=
'0a1b2c3e4f59999999'
;
$this
->
entity
=
'1'
;
$this
->
filename
=
'myspecimenfilefile.pdf'
;
...
...
@@ -780,3 +780,23 @@ class EcmFiles //extends CommonObject
}
class
EcmfilesLine
{
public
$label
;
public
$entity
;
public
$filename
;
public
$filepath
;
public
$fullpath_orig
;
public
$description
;
public
$keywords
;
public
$cover
;
public
$position
;
public
$gen_or_uploaded
;
// can be 'generated', 'uploaded', 'unknown'
public
$extraparams
;
public
$date_c
=
''
;
public
$date_m
=
''
;
public
$fk_user_c
;
public
$fk_user_m
;
public
$acl
;
}
This diff is collapsed.
Click to expand it.
htdocs/modulebuilder/template/class/myobject.class.php
+
1
−
1
View file @
1816b224
...
...
@@ -433,7 +433,7 @@ class MyObject extends CommonObject
global
$user
;
$error
=
0
;
$object
=
new
MyModuleObject
(
$this
->
db
);
$object
=
new
self
(
$this
->
db
);
$this
->
db
->
begin
();
...
...
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