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
6d1818c6
Commit
6d1818c6
authored
20 years ago
by
Rodolphe Quiedeville
Browse files
Options
Downloads
Patches
Plain Diff
Ajout lecture des permissions
parent
7ecfcd1e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/societe/lien.php
+103
-99
103 additions, 99 deletions
htdocs/societe/lien.php
with
103 additions
and
99 deletions
htdocs/societe/lien.php
+
103
−
99
View file @
6d1818c6
<?php
/* Copyright (C) 2001-200
4
Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2001-200
5
Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -28,7 +28,8 @@
*/
require
(
"./pre.inc.php"
);
require
(
"../contact.class.php"
);
$user
->
getrights
();
$langs
->
load
(
"companies"
);
$langs
->
load
(
"customers"
);
...
...
@@ -57,7 +58,7 @@ if($_GET["socid"] && $_GET["select"])
}
else
{
Header
(
"Location: lien.php?socid="
.
$
soc
->
id
);
Header
(
"Location: lien.php?socid="
.
$
_GET
[
"socid"
]
);
}
}
...
...
@@ -125,7 +126,7 @@ if($_GET["socid"])
$socm
=
new
Societe
(
$db
);
$socm
->
fetch
(
$soc
->
parent
);
print
'<tr><td>Maison mre</td><td colspan="3">'
.
$socm
->
nom_url
.
'</td></tr>'
;
print
'<tr><td>Maison mre</td><td colspan="3">'
.
$socm
->
nom_url
.
'
('
.
$socm
->
code_client
.
')<br />'
.
$socm
->
ville
.
'
</td></tr>'
;
}
print
'</table>'
;
...
...
@@ -140,112 +141,115 @@ if($_GET["socid"])
}
else
{
$page
=
$_GET
[
"page"
];
if
(
$page
==
-
1
)
{
$page
=
0
;
}
$offset
=
$conf
->
liste_limit
*
$page
;
$pageprev
=
$page
-
1
;
$pagenext
=
$page
+
1
;
/*
* Liste
*
*/
$title
=
$langs
->
trans
(
"CompanyList"
);
$sql
=
"SELECT s.idp, s.nom, s.ville, s.prefix_comm, s.client, s.fournisseur, te.libelle"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"societe as s"
;
$sql
.
=
" , "
.
MAIN_DB_PREFIX
.
"c_typent as te"
;
$sql
.
=
" WHERE s.fk_typent = te.id"
;
if
(
strlen
(
trim
(
$_GET
[
"search_nom"
])))
{
$sql
.
=
" AND s.nom LIKE '%"
.
$_GET
[
"search_nom"
]
.
"%'"
;
}
$sql
.
=
" ORDER BY s.nom ASC "
.
$db
->
plimit
(
$conf
->
liste_limit
+
1
,
$offset
);
$result
=
$db
->
query
(
$sql
);
if
(
$result
)
if
(
$user
->
rights
->
societe
->
creer
)
{
$num
=
$db
->
num_rows
();
$
i
=
0
;
$
page
=
$_GET
[
"page"
]
;
$params
=
"&socid="
.
$_GET
[
"socid"
];
if
(
$page
==
-
1
)
{
$page
=
0
;
}
print_barre_liste
(
$title
,
$page
,
"lien.php"
,
$params
,
$sortfield
,
$sortorder
,
''
,
$num
);
$offset
=
$conf
->
liste_limit
*
$page
;
$pageprev
=
$page
-
1
;
$pagenext
=
$page
+
1
;
// Lignes des titres
print
'<table class="noborder" width="100%">'
;
print
'<tr class="liste_titre">'
;
print
'<td>'
.
$langs
->
trans
(
"Company"
)
.
'</td>'
;
print
'<td>'
.
$langs
->
trans
(
"Town"
)
.
'</td>'
;
print
'<td>Type<td>'
;
print
'<td colspan="2" align="center"> </td>'
;
print
"</tr>
\n
"
;
// Lignes des champs de filtre
print
'<form action="lien.php" method="GET" >'
;
print
'<input type="hidden" name="socid" value="'
.
$_GET
[
"socid"
]
.
'">'
;
print
'<tr class="liste_titre">'
;
print
'<td valign="right">'
;
print
'<input type="text" name="search_nom" value="'
.
stripslashes
(
$search_nom
)
.
'">'
;
print
'</td><td colspan="5" align="center">'
;
print
'<input type="submit" class="button" name="button_search" value="'
.
$langs
->
trans
(
"Search"
)
.
'">'
;
print
'</td>'
;
print
"</tr>
\n
"
;
print
'</form>'
;
/*
* Liste
*
*/
$
var
=
True
;
$
title
=
$langs
->
trans
(
"CompanyList"
)
;
while
(
$i
<
min
(
$num
,
$conf
->
liste_limit
))
$sql
=
"SELECT s.idp, s.nom, s.ville, s.prefix_comm, s.client, s.fournisseur, te.libelle"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"societe as s"
;
$sql
.
=
" , "
.
MAIN_DB_PREFIX
.
"c_typent as te"
;
$sql
.
=
" WHERE s.fk_typent = te.id"
;
if
(
strlen
(
trim
(
$_GET
[
"search_nom"
])))
{
$obj
=
$db
->
fetch_object
();
$var
=!
$var
;
print
"<tr
$bc[$var]
><td>"
;
print
stripslashes
(
$obj
->
nom
)
.
"</td>
\n
"
;
print
"<td>"
.
$obj
->
ville
.
" </td>
\n
"
;
print
"<td>"
.
$obj
->
libelle
.
" </td>
\n
"
;
print
'<td align="center">'
;
if
(
$obj
->
client
==
1
)
{
print
$langs
->
trans
(
"Customer"
)
.
"
\n
"
;
}
elseif
(
$obj
->
client
==
2
)
{
print
$langs
->
trans
(
"Prospect"
)
.
"
\n
"
;
}
else
{
print
" "
;
}
print
"</td><td align=
\"
center
\"
>"
;
if
(
$obj
->
fournisseur
)
{
print
$langs
->
trans
(
"Supplier"
);
}
else
$sql
.
=
" AND s.nom LIKE '%"
.
$_GET
[
"search_nom"
]
.
"%'"
;
}
$sql
.
=
" ORDER BY s.nom ASC "
.
$db
->
plimit
(
$conf
->
liste_limit
+
1
,
$offset
);
$result
=
$db
->
query
(
$sql
);
if
(
$result
)
{
$num
=
$db
->
num_rows
();
$i
=
0
;
$params
=
"&socid="
.
$_GET
[
"socid"
];
print_barre_liste
(
$title
,
$page
,
"lien.php"
,
$params
,
$sortfield
,
$sortorder
,
''
,
$num
);
// Lignes des titres
print
'<table class="noborder" width="100%">'
;
print
'<tr class="liste_titre">'
;
print
'<td>'
.
$langs
->
trans
(
"Company"
)
.
'</td>'
;
print
'<td>'
.
$langs
->
trans
(
"Town"
)
.
'</td>'
;
print
'<td>Type<td>'
;
print
'<td colspan="2" align="center"> </td>'
;
print
"</tr>
\n
"
;
// Lignes des champs de filtre
print
'<form action="lien.php" method="GET" >'
;
print
'<input type="hidden" name="socid" value="'
.
$_GET
[
"socid"
]
.
'">'
;
print
'<tr class="liste_titre">'
;
print
'<td valign="right">'
;
print
'<input type="text" name="search_nom" value="'
.
stripslashes
(
$search_nom
)
.
'">'
;
print
'</td><td colspan="5" align="center">'
;
print
'<input type="submit" class="button" name="button_search" value="'
.
$langs
->
trans
(
"Search"
)
.
'">'
;
print
'</td>'
;
print
"</tr>
\n
"
;
print
'</form>'
;
$var
=
True
;
while
(
$i
<
min
(
$num
,
$conf
->
liste_limit
))
{
print
" "
;
$obj
=
$db
->
fetch_object
();
$var
=!
$var
;
print
"<tr
$bc[$var]
><td>"
;
print
stripslashes
(
$obj
->
nom
)
.
"</td>
\n
"
;
print
"<td>"
.
$obj
->
ville
.
" </td>
\n
"
;
print
"<td>"
.
$obj
->
libelle
.
" </td>
\n
"
;
print
'<td align="center">'
;
if
(
$obj
->
client
==
1
)
{
print
$langs
->
trans
(
"Customer"
)
.
"
\n
"
;
}
elseif
(
$obj
->
client
==
2
)
{
print
$langs
->
trans
(
"Prospect"
)
.
"
\n
"
;
}
else
{
print
" "
;
}
print
"</td><td align=
\"
center
\"
>"
;
if
(
$obj
->
fournisseur
)
{
print
$langs
->
trans
(
"Supplier"
);
}
else
{
print
" "
;
}
print
'</td><td><a href="lien.php?socid='
.
$_GET
[
"socid"
]
.
'&select='
.
$obj
->
idp
.
'">Slectionner</a></td>'
;
print
'</tr>'
.
"
\n
"
;
$i
++
;
}
print
'</td><td><a href="lien.php?socid='
.
$_GET
[
"socid"
]
.
'&select='
.
$obj
->
idp
.
'">Slectionner</a></td>'
;
print
'</tr>'
.
"
\n
"
;
$i
++
;
print
"</table>"
;
$db
->
free
();
}
print
"</table>"
;
$db
->
free
();
}
else
{
dolibarr_print_error
(
$db
);
}
}
else
{
dolibarr_print_error
(
$db
);
}
}
}
}
...
...
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