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
9792d5a2
Commit
9792d5a2
authored
12 years ago
by
Regis Houssin
Browse files
Options
Downloads
Patches
Plain Diff
Fix: use company name if firstname and lastname not exists
parent
1d344ec8
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
htdocs/adherents/index.php
+12
-4
12 additions, 4 deletions
htdocs/adherents/index.php
htdocs/adherents/liste.php
+16
-11
16 additions, 11 deletions
htdocs/adherents/liste.php
htdocs/core/boxes/box_members.php
+10
-1
10 additions, 1 deletion
htdocs/core/boxes/box_members.php
with
38 additions
and
16 deletions
htdocs/adherents/index.php
+
12
−
4
View file @
9792d5a2
...
...
@@ -203,7 +203,7 @@ $var=true;
*/
$max
=
5
;
$sql
=
"SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname,"
;
$sql
=
"SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname,
a.societe as company, a.fk_soc,
"
;
$sql
.
=
" a.tms as datem, datefin as date_end_subscription,"
;
$sql
.
=
" ta.rowid as typeid, ta.libelle, ta.cotisation"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"adherent as a, "
.
MAIN_DB_PREFIX
.
"adherent_type as ta"
;
...
...
@@ -235,6 +235,7 @@ if ($resql)
if
(
!
empty
(
$obj
->
fk_soc
))
{
$staticmember
->
socid
=
$obj
->
fk_soc
;
$staticmember
->
fetch_thirdparty
();
$staticmember
->
name
=
$staticmember
->
thirdparty
->
name
;
}
else
{
$staticmember
->
name
=
$obj
->
company
;
}
...
...
@@ -262,7 +263,7 @@ else
*/
$max
=
5
;
$sql
=
"SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname,"
;
$sql
=
"SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname,
a.societe as company, a.fk_soc,
"
;
$sql
.
=
" datefin as date_end_subscription,"
;
$sql
.
=
" c.rowid as cid, c.tms as datem, c.datec as datec, c.dateadh as date_start, c.datef as date_end, c.cotisation"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"adherent as a, "
.
MAIN_DB_PREFIX
.
"cotisation as c"
;
...
...
@@ -293,9 +294,16 @@ if ($resql)
$staticmember
->
id
=
$obj
->
rowid
;
$staticmember
->
lastname
=
$obj
->
lastname
;
$staticmember
->
firstname
=
$obj
->
firstname
;
if
(
!
empty
(
$obj
->
fk_soc
))
{
$staticmember
->
socid
=
$obj
->
fk_soc
;
$staticmember
->
fetch_thirdparty
();
$staticmember
->
name
=
$staticmember
->
thirdparty
->
name
;
}
else
{
$staticmember
->
name
=
$obj
->
company
;
}
$staticmember
->
ref
=
$staticmember
->
getFullName
(
$langs
);
print
'<td>'
.
$subscriptionstatic
->
getNomUrl
(
1
)
.
'</td>'
;
print
'<td>'
.
$staticmember
->
getNomUrl
(
1
,
2
4
,
'subscription'
)
.
'</td>'
;
print
'<td>'
.
$staticmember
->
getNomUrl
(
1
,
3
2
,
'subscription'
)
.
'</td>'
;
print
'<td>'
.
get_date_range
(
$db
->
jdate
(
$obj
->
date_start
),
$db
->
jdate
(
$obj
->
date_end
))
.
'</td>'
;
print
'<td align="right">'
.
price
(
$obj
->
cotisation
)
.
'</td>'
;
//print '<td align="right">'.$staticmember->LibStatut($obj->statut,($obj->cotisation=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).'</td>';
...
...
@@ -326,7 +334,7 @@ foreach ($AdherentType as $key => $adhtype)
{
$var
=!
$var
;
print
"<tr
$bc[$var]
>"
;
print
'<td>
<a href="type.php?rowid='
.
$adhtype
->
id
.
'">'
.
img_object
(
$langs
->
trans
(
"ShowType"
),
"group"
)
.
'
'
.
$adhtype
->
getNomUrl
(
0
,
dol_size
(
32
))
.
'</
a></
td>'
;
print
'<td>'
.
$adhtype
->
getNomUrl
(
1
,
dol_size
(
32
))
.
'</td>'
;
print
'<td align="right">'
.
(
isset
(
$MemberToValidate
[
$key
])
&&
$MemberToValidate
[
$key
]
>
0
?
$MemberToValidate
[
$key
]
:
''
)
.
' '
.
$staticmember
->
LibStatut
(
-
1
,
$adhtype
->
cotisation
,
0
,
3
)
.
'</td>'
;
print
'<td align="right">'
.
(
isset
(
$MembersValidated
[
$key
])
&&
(
$MembersValidated
[
$key
]
-
$MemberUpToDate
[
$key
]
>
0
)
?
$MembersValidated
[
$key
]
-
$MemberUpToDate
[
$key
]
:
''
)
.
' '
.
$staticmember
->
LibStatut
(
1
,
$adhtype
->
cotisation
,
0
,
3
)
.
'</td>'
;
print
'<td align="right">'
.
(
isset
(
$MemberUpToDate
[
$key
])
&&
$MemberUpToDate
[
$key
]
>
0
?
$MemberUpToDate
[
$key
]
:
''
)
.
' '
.
$staticmember
->
LibStatut
(
1
,
$adhtype
->
cotisation
,
$now
,
3
)
.
'</td>'
;
...
...
This diff is collapsed.
Click to expand it.
htdocs/adherents/liste.php
+
16
−
11
View file @
9792d5a2
...
...
@@ -84,7 +84,7 @@ llxHeader('',$langs->trans("Member"),'EN:Module_Foundations|FR:Module_Adhé
$now
=
dol_now
();
$sql
=
"SELECT d.rowid, d.login, d.nom as lastname, d.prenom as firstname, d.societe
,
"
;
$sql
=
"SELECT d.rowid, d.login, d.nom as lastname, d.prenom as firstname, d.societe
as company, d.fk_soc,
"
;
$sql
.
=
" d.datefin,"
;
$sql
.
=
" d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,"
;
$sql
.
=
" t.libelle as type, t.cotisation"
;
...
...
@@ -238,7 +238,7 @@ if ($resql)
print
'<td class="liste_titre">'
;
$listetype
=
$membertypestatic
->
liste_array
();
print
$form
->
selectarray
(
"type"
,
$listetype
,
$type
,
1
,
0
,
0
,
''
,
0
,
1
2
);
print
$form
->
selectarray
(
"type"
,
$listetype
,
$type
,
1
,
0
,
0
,
''
,
0
,
3
2
);
print
'</td>'
;
print
'<td class="liste_titre"> </td>'
;
...
...
@@ -268,6 +268,14 @@ if ($resql)
$memberstatic
->
lastname
=
$objp
->
lastname
;
$memberstatic
->
firstname
=
$objp
->
firstname
;
if
(
!
empty
(
$objp
->
fk_soc
))
{
$memberstatic
->
socid
=
$objp
->
fk_soc
;
$memberstatic
->
fetch_thirdparty
();
$companyname
=
$memberstatic
->
thirdparty
->
name
;
}
else
{
$companyname
=
$objp
->
company
;
}
$var
=!
$var
;
print
"<tr "
.
$bc
[
$var
]
.
">"
;
...
...
@@ -277,14 +285,11 @@ if ($resql)
print
"</td>
\n
"
;
// Lastname
if
(
$objp
->
societe
!=
''
)
{
print
"<td><a href=
\"
fiche.php?rowid=
$objp->rowid
\"
>"
.
dol_trunc
(
$memberstatic
->
getFullName
(
$langs
))
.
" / "
.
dol_trunc
(
$objp
->
societe
,
12
)
.
"</a></td>
\n
"
;
}
else
{
print
"<td><a href=
\"
fiche.php?rowid=
$objp->rowid
\"
>"
.
dol_trunc
(
$memberstatic
->
getFullName
(
$langs
))
.
"</a></td>
\n
"
;
}
print
"<td><a href=
\"
fiche.php?rowid=
$objp->rowid
\"
>"
;
print
((
!
empty
(
$objp
->
lastname
)
||
!
empty
(
$objp
->
firstname
))
?
dol_trunc
(
$memberstatic
->
getFullName
(
$langs
))
:
''
);
print
(((
!
empty
(
$objp
->
lastname
)
||
!
empty
(
$objp
->
firstname
))
&&
!
empty
(
$companyname
))
?
' / '
:
''
);
print
(
!
empty
(
$companyname
)
?
dol_trunc
(
$companyname
,
32
)
:
''
);
print
"</a></td>
\n
"
;
// Login
print
"<td>"
.
$objp
->
login
.
"</td>
\n
"
;
...
...
@@ -293,7 +298,7 @@ if ($resql)
$membertypestatic
->
id
=
$objp
->
type_id
;
$membertypestatic
->
libelle
=
$objp
->
type
;
print
'<td nowrap="nowrap">'
;
print
$membertypestatic
->
getNomUrl
(
1
,
1
2
);
print
$membertypestatic
->
getNomUrl
(
1
,
3
2
);
print
'</td>'
;
// Moral/Physique
...
...
This diff is collapsed.
Click to expand it.
htdocs/core/boxes/box_members.php
+
10
−
1
View file @
9792d5a2
...
...
@@ -73,7 +73,8 @@ class box_members extends ModeleBoxes
if
(
$user
->
rights
->
societe
->
lire
)
{
$sql
=
"SELECT a.rowid, a.nom as lastname, a.prenom as firstname, a.datec, a.tms, a.statut as status, a.datefin as date_end_subscription,"
;
$sql
=
"SELECT a.rowid, a.nom as lastname, a.prenom as firstname, a.societe, a.fk_soc,"
;
$sql
.
=
" a.datec, a.tms, a.statut as status, a.datefin as date_end_subscription,"
;
$sql
.
=
" t.cotisation"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"adherent as a, "
.
MAIN_DB_PREFIX
.
"adherent_type as t"
;
$sql
.
=
" WHERE a.entity = "
.
$conf
->
entity
;
...
...
@@ -97,6 +98,14 @@ class box_members extends ModeleBoxes
$memberstatic
->
lastname
=
$objp
->
lastname
;
$memberstatic
->
firstname
=
$objp
->
firstname
;
if
(
!
empty
(
$objp
->
fk_soc
))
{
$memberstatic
->
socid
=
$objp
->
fk_soc
;
$memberstatic
->
fetch_thirdparty
();
$memberstatic
->
name
=
$memberstatic
->
thirdparty
->
name
;
}
else
{
$memberstatic
->
name
=
$objp
->
company
;
}
$this
->
info_box_contents
[
$i
][
0
]
=
array
(
'td'
=>
'align="left" width="16"'
,
'logo'
=>
$this
->
boximg
,
'url'
=>
DOL_URL_ROOT
.
"/adherents/fiche.php?rowid="
.
$objp
->
rowid
);
...
...
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