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
c902acf9
Commit
c902acf9
authored
15 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix: A lot of duplicate lines.
parent
817a09c7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/expedition/liste.php
+61
-93
61 additions, 93 deletions
htdocs/expedition/liste.php
with
61 additions
and
93 deletions
htdocs/expedition/liste.php
+
61
−
93
View file @
c902acf9
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
/**
/**
* \file htdocs/expedition/liste.php
* \file htdocs/expedition/liste.php
* \ingroup expedition
* \ingroup expedition
* \brief Page
de la liste des expeditions/livraison
s
* \brief Page
to list all shipment
s
* \version $Id$
* \version $Id$
*/
*/
...
@@ -39,7 +39,7 @@ $result = restrictedArea($user, 'expedition',$expeditionid,'');
...
@@ -39,7 +39,7 @@ $result = restrictedArea($user, 'expedition',$expeditionid,'');
$sortfield
=
isset
(
$_GET
[
"sortfield"
])
?
$_GET
[
"sortfield"
]
:
""
;
$sortfield
=
isset
(
$_GET
[
"sortfield"
])
?
$_GET
[
"sortfield"
]
:
""
;
$sortorder
=
isset
(
$_GET
[
"sortorder"
])
?
$_GET
[
"sortorder"
]
:
""
;
$sortorder
=
isset
(
$_GET
[
"sortorder"
])
?
$_GET
[
"sortorder"
]
:
""
;
if
(
!
$sortfield
)
$sortfield
=
"e.r
owid
"
;
if
(
!
$sortfield
)
$sortfield
=
"e.r
ef
"
;
if
(
!
$sortorder
)
$sortorder
=
"DESC"
;
if
(
!
$sortorder
)
$sortorder
=
"DESC"
;
$limit
=
$conf
->
liste_limit
;
$limit
=
$conf
->
liste_limit
;
...
@@ -50,28 +50,19 @@ $offset = $limit * $_GET["page"] ;
...
@@ -50,28 +50,19 @@ $offset = $limit * $_GET["page"] ;
* View
* View
*/
*/
$companystatic
=
new
Societe
(
$db
);
$helpurl
=
'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones'
;
$helpurl
=
'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones'
;
llxHeader
(
''
,
$langs
->
trans
(
'ListOfSendings'
),
$helpurl
);
llxHeader
(
''
,
$langs
->
trans
(
'ListOfSendings'
),
$helpurl
);
$sql
=
"SELECT e.rowid, e.ref, e.date_expedition, e.fk_statut"
;
$sql
=
"SELECT e.rowid, e.ref, e.date_expedition, e.fk_statut"
;
$sql
.
=
", s.nom as socname, s.rowid as socid"
;
$sql
.
=
", s.nom as socname, s.rowid as socid"
;
$sql
.
=
", ori.ref as origin_ref, ori.rowid as origin_id"
;
$sql
.
=
" FROM ("
.
MAIN_DB_PREFIX
.
"expedition as e"
;
$sql
.
=
" FROM ("
.
MAIN_DB_PREFIX
.
"expedition as e"
;
if
(
!
$user
->
rights
->
societe
->
client
->
voir
&&
!
$socid
)
// Internal user with no permission to see all
if
(
!
$user
->
rights
->
societe
->
client
->
voir
&&
!
$socid
)
// Internal user with no permission to see all
{
{
$sql
.
=
", "
.
MAIN_DB_PREFIX
.
"societe_commerciaux as sc"
;
$sql
.
=
", "
.
MAIN_DB_PREFIX
.
"societe_commerciaux as sc"
;
}
}
$sql
.
=
") LEFT JOIN "
.
MAIN_DB_PREFIX
.
"element_element as el ON e.rowid = el.fk_target"
;
$sql
.
=
")"
;
if
(
$conf
->
commande
->
enabled
)
{
$sql
.
=
" LEFT JOIN "
.
MAIN_DB_PREFIX
.
"commande as ori ON el.fk_source = ori.rowid"
;
$sql
.
=
" AND el.sourcetype = 'commande'"
;
}
else
{
$sql
.
=
" LEFT JOIN "
.
MAIN_DB_PREFIX
.
"propal as ori ON el.fk_source = ori.rowid"
;
$sql
.
=
" AND el.sourcetype = 'propal'"
;
}
$sql
.
=
" LEFT JOIN "
.
MAIN_DB_PREFIX
.
"societe as s ON s.rowid = e.fk_soc"
;
$sql
.
=
" LEFT JOIN "
.
MAIN_DB_PREFIX
.
"societe as s ON s.rowid = e.fk_soc"
;
$sql
.
=
" WHERE e.entity = "
.
$conf
->
entity
;
$sql
.
=
" WHERE e.entity = "
.
$conf
->
entity
;
if
(
!
$user
->
rights
->
societe
->
client
->
voir
&&
!
$socid
)
// Internal user with no permission to see all
if
(
!
$user
->
rights
->
societe
->
client
->
voir
&&
!
$socid
)
// Internal user with no permission to see all
...
@@ -88,7 +79,7 @@ if ($_POST["sf_ref"])
...
@@ -88,7 +79,7 @@ if ($_POST["sf_ref"])
$sql
.
=
" AND e.ref like '%"
.
addslashes
(
$_POST
[
"sf_ref"
])
.
"%'"
;
$sql
.
=
" AND e.ref like '%"
.
addslashes
(
$_POST
[
"sf_ref"
])
.
"%'"
;
}
}
$sql
.
=
" ORDER BY
$sortfield
$sortorder
"
;
$sql
.
=
$db
->
order
(
$sortfield
,
$sortorder
)
;
$sql
.
=
$db
->
plimit
(
$limit
+
1
,
$offset
);
$sql
.
=
$db
->
plimit
(
$limit
+
1
,
$offset
);
$resql
=
$db
->
query
(
$sql
);
$resql
=
$db
->
query
(
$sql
);
...
@@ -98,24 +89,19 @@ if ($resql)
...
@@ -98,24 +89,19 @@ if ($resql)
$expedition
=
new
Expedition
(
$db
);
$expedition
=
new
Expedition
(
$db
);
print_barre_liste
(
$langs
->
trans
(
'ListOfSendings'
),
$_GET
[
"page"
],
"liste.php"
,
"&socid=
$socid
"
,
$sortfield
,
$sortorder
,
''
,
$num
);
$param
=
"&socid=
$socid
"
;
print_barre_liste
(
$langs
->
trans
(
'ListOfSendings'
),
$_GET
[
"page"
],
"liste.php"
,
$param
,
$sortfield
,
$sortorder
,
''
,
$num
);
$i
=
0
;
$i
=
0
;
print
'<table class="noborder" width="100%">'
;
print
'<table class="noborder" width="100%">'
;
print
'<tr class="liste_titre">'
;
print
'<tr class="liste_titre">'
;
print_liste_field_titre
(
$langs
->
trans
(
"Ref"
),
"liste.php"
,
"e.ref"
,
""
,
"&socid=
$socid
"
,
'width="15%"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Ref"
),
"liste.php"
,
"e.ref"
,
""
,
$param
,
'width="15%"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Company"
),
"liste.php"
,
"s.nom"
,
""
,
"&socid=
$socid
"
,
'width="25%" align="left"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Company"
),
"liste.php"
,
"s.nom"
,
""
,
$param
,
'width="25%" align="left"'
,
$sortfield
,
$sortorder
);
if
(
$conf
->
commande
->
enabled
)
print_liste_field_titre
(
$langs
->
trans
(
"Date"
),
"liste.php"
,
"e.date_expedition"
,
""
,
$param
,
'width="25%" align="center"'
,
$sortfield
,
$sortorder
);
{
print_liste_field_titre
(
$langs
->
trans
(
"Status"
),
"liste.php"
,
"e.fk_statut"
,
""
,
$param
,
'width="10%" align="right"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Order"
),
"liste.php"
,
"ori.ref"
,
""
,
"&socid=
$socid
"
,
'width="25%" align="left"'
,
$sortfield
,
$sortorder
);
}
else
{
print_liste_field_titre
(
$langs
->
trans
(
"Proposal"
),
"liste.php"
,
"ori.ref"
,
""
,
"&socid=
$socid
"
,
'width="25%" align="left"'
,
$sortfield
,
$sortorder
);
}
print_liste_field_titre
(
$langs
->
trans
(
"Date"
),
"liste.php"
,
"e.date_expedition"
,
""
,
"&socid=
$socid
"
,
'width="25%" align="right" colspan="2"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Status"
),
"liste.php"
,
"e.fk_statut"
,
""
,
"&socid=
$socid
"
,
'width="10%" align="right"'
,
$sortfield
,
$sortorder
);
print
"</tr>
\n
"
;
print
"</tr>
\n
"
;
$var
=
True
;
$var
=
True
;
...
@@ -127,38 +113,21 @@ if ($resql)
...
@@ -127,38 +113,21 @@ if ($resql)
print
"<tr
$bc[$var]
>"
;
print
"<tr
$bc[$var]
>"
;
print
"<td><a href=
\"
fiche.php?id="
.
$objp
->
rowid
.
"
\"
>"
.
img_object
(
$langs
->
trans
(
"ShowSending"
),
"sending"
)
.
'</a> '
;
print
"<td><a href=
\"
fiche.php?id="
.
$objp
->
rowid
.
"
\"
>"
.
img_object
(
$langs
->
trans
(
"ShowSending"
),
"sending"
)
.
'</a> '
;
print
"<a href=
\"
fiche.php?id="
.
$objp
->
rowid
.
"
\"
>"
.
$objp
->
ref
.
"</a></td>
\n
"
;
print
"<a href=
\"
fiche.php?id="
.
$objp
->
rowid
.
"
\"
>"
.
$objp
->
ref
.
"</a></td>
\n
"
;
print
'<td><a href="'
.
DOL_URL_ROOT
.
'/comm/fiche.php?socid='
.
$objp
->
socid
.
'">'
.
$objp
->
socname
.
'</a></td>'
;
// Third party
if
(
$conf
->
commande
->
enabled
)
print
'<td>'
;
$companystatic
->
id
=
$objp
->
id
;
$companystatic
->
ref
=
$objp
->
id
;
$companystatic
->
nom
=
$objp
->
socname
;
print
$companystatic
->
getNomUrl
(
1
);
print
'</td>'
;
// Date
print
"<td align=
\"
center
\"
>"
;
print
dol_print_date
(
$db
->
jdate
(
$objp
->
date_expedition
),
"day"
);
/*$now = time();
if ( ($now - $db->jdate($objp->date_expedition)) > $conf->warnings->lim && $objp->statutid == 1 )
{
{
print
'<td><a href="'
.
DOL_URL_ROOT
.
'/expedition/commande.php?id='
.
$objp
->
origin_id
.
'">'
.
$objp
->
origin_ref
.
'</a></td>'
;
}*/
}
print
"</td>
\n
"
;
else
{
print
'<td><a href="'
.
DOL_URL_ROOT
.
'/expedition/propal.php?propalid='
.
$objp
->
origin_id
.
'">'
.
$objp
->
origin_ref
.
'</a></td>'
;
}
$now
=
time
();
$lim
=
3600
*
24
*
15
;
if
(
(
$now
-
$db
->
jdate
(
$objp
->
date_expedition
))
>
$lim
&&
$objp
->
statutid
==
1
)
{
print
"<td><b> > 15 jours</b></td>"
;
}
else
{
print
"<td> </td>"
;
}
print
"<td align=
\"
right
\"
>"
;
$y
=
dol_print_date
(
$db
->
jdate
(
$objp
->
date_expedition
),
"%Y"
);
$m
=
dol_print_date
(
$db
->
jdate
(
$objp
->
date_expedition
),
"%m"
);
$mt
=
dol_print_date
(
$db
->
jdate
(
$objp
->
date_expedition
),
"%b"
);
$d
=
dol_print_date
(
$db
->
jdate
(
$objp
->
date_expedition
),
"%d"
);
print
$d
.
"
\n
"
;
print
" <a href=
\"
propal.php?year=
$y
&month=
$m
\"
>"
;
print
$b
.
"</a>
\n
"
;
print
" <a href=
\"
propal.php?year=
$y
\"
>"
;
print
$y
.
"</a></TD>
\n
"
;
print
'<td align="right">'
.
$expedition
->
LibStatut
(
$objp
->
fk_statut
,
5
)
.
'</td>'
;
print
'<td align="right">'
.
$expedition
->
LibStatut
(
$objp
->
fk_statut
,
5
)
.
'</td>'
;
print
"</tr>
\n
"
;
print
"</tr>
\n
"
;
...
@@ -177,5 +146,4 @@ else
...
@@ -177,5 +146,4 @@ else
$db
->
close
();
$db
->
close
();
llxFooter
(
'$Date$ - $Revision$'
);
llxFooter
(
'$Date$ - $Revision$'
);
?>
?>
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