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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
fa53147d
Commit
fa53147d
authored
12 years ago
by
Jean-François Ferry
Browse files
Options
Downloads
Patches
Plain Diff
Retrieve extrafields when fetch thirparty
Work on extrafields support in thirpdparty ODT document
parent
91215a07
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/core/class/commondocgenerator.class.php
+12
-1
12 additions, 1 deletion
htdocs/core/class/commondocgenerator.class.php
htdocs/societe/class/societe.class.php
+14
-0
14 additions, 0 deletions
htdocs/societe/class/societe.class.php
with
26 additions
and
1 deletion
htdocs/core/class/commondocgenerator.class.php
+
12
−
1
View file @
fa53147d
...
...
@@ -134,7 +134,7 @@ abstract class CommonDocGenerator
$object
->
state
=
getState
(
$object
->
state_code
,
0
);
}
return
array
(
$array_thirdparty
=
array
(
'company_name'
=>
$object
->
name
,
'company_email'
=>
$object
->
email
,
'company_phone'
=>
$object
->
phone
,
...
...
@@ -163,6 +163,17 @@ abstract class CommonDocGenerator
'company_idprof6'
=>
$object
->
idprof6
,
'company_note'
=>
$object
->
note
);
$extrafields
=
array
();
if
(
is_array
(
$object
->
array_options
)
&&
count
(
$object
->
array_options
))
{
foreach
(
$object
->
array_options
as
$key
=>
$label
)
{
$extrafields
[
'company_options_'
.
$key
]
=
$label
;
}
$array_thirdparty
=
array_merge
(
$array_thirdparty
,
$extrafields
);
}
return
$array_thirdparty
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
htdocs/societe/class/societe.class.php
+
14
−
0
View file @
fa53147d
...
...
@@ -140,6 +140,8 @@ class Societe extends CommonObject
var
$logo_small
;
var
$logo_mini
;
var
$array_options
;
var
$oldcopy
;
/**
...
...
@@ -852,6 +854,18 @@ class Societe extends CommonObject
$this
->
import_key
=
$obj
->
import_key
;
$result
=
1
;
// Retreive all extrafield for thirdparty
// fetch optionals attributes and labels
$extrafields
=
new
ExtraFields
(
$this
->
db
);
$extralabels
=
$extrafields
->
fetch_name_optionals_label
(
'company'
,
true
);
if
(
count
(
$extralabels
)
>
0
)
{
$this
->
array_options
=
array
();
}
foreach
(
$extrafields
->
attribute_label
as
$key
=>
$label
)
{
$this
->
array_options
[
$key
]
=
$label
;
}
}
else
{
...
...
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