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
6bf2220a
Commit
6bf2220a
authored
Nov 12, 2013
by
Florian Henry
Browse files
Options
Downloads
Patches
Plain Diff
Add status filter into prospect and customer list
parent
a76d5f8a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/comm/list.php
+20
-4
20 additions, 4 deletions
htdocs/comm/list.php
htdocs/comm/prospect/list.php
+14
-3
14 additions, 3 deletions
htdocs/comm/prospect/list.php
with
34 additions
and
7 deletions
htdocs/comm/list.php
+
20
−
4
View file @
6bf2220a
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
*
*
* This program is free software; you can redistribute it and/or modify
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* it under the terms of the GNU General Public License as published by
...
@@ -52,6 +53,8 @@ $search_zipcode=GETPOST("search_zipcode");
...
@@ -52,6 +53,8 @@ $search_zipcode=GETPOST("search_zipcode");
$search_town
=
GETPOST
(
"search_town"
);
$search_town
=
GETPOST
(
"search_town"
);
$search_code
=
GETPOST
(
"search_code"
);
$search_code
=
GETPOST
(
"search_code"
);
$search_compta
=
GETPOST
(
"search_compta"
);
$search_compta
=
GETPOST
(
"search_compta"
);
$search_status
=
GETPOST
(
"search_status"
,
'int'
);
if
(
$search_status
==
''
)
$search_status
=
1
;
// always display activ customer first
// Load sale and categ filters
// Load sale and categ filters
$search_sale
=
GETPOST
(
"search_sale"
);
$search_sale
=
GETPOST
(
"search_sale"
);
...
@@ -83,6 +86,7 @@ if (GETPOST("button_removefilter_x"))
...
@@ -83,6 +86,7 @@ if (GETPOST("button_removefilter_x"))
$search_idprof2
=
''
;
$search_idprof2
=
''
;
$search_idprof3
=
''
;
$search_idprof3
=
''
;
$search_idprof4
=
''
;
$search_idprof4
=
''
;
$seach_status
=
1
;
}
}
...
@@ -92,6 +96,7 @@ if (GETPOST("button_removefilter_x"))
...
@@ -92,6 +96,7 @@ if (GETPOST("button_removefilter_x"))
*/
*/
$formother
=
new
FormOther
(
$db
);
$formother
=
new
FormOther
(
$db
);
$form
=
new
Form
(
$db
);
$thirdpartystatic
=
new
Societe
(
$db
);
$thirdpartystatic
=
new
Societe
(
$db
);
$help_url
=
'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'
;
$help_url
=
'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'
;
...
@@ -125,6 +130,8 @@ if ($search_town) {
...
@@ -125,6 +130,8 @@ if ($search_town) {
}
}
if
(
$search_code
)
$sql
.
=
" AND s.code_client LIKE '%"
.
$db
->
escape
(
$search_code
)
.
"%'"
;
if
(
$search_code
)
$sql
.
=
" AND s.code_client LIKE '%"
.
$db
->
escape
(
$search_code
)
.
"%'"
;
if
(
$search_compta
)
$sql
.
=
" AND s.code_compta LIKE '%"
.
$db
->
escape
(
$search_compta
)
.
"%'"
;
if
(
$search_compta
)
$sql
.
=
" AND s.code_compta LIKE '%"
.
$db
->
escape
(
$search_compta
)
.
"%'"
;
if
(
$search_status
!=
''
)
$sql
.
=
" AND s.status = "
.
$db
->
escape
(
$search_status
);
// Insert sale filter
// Insert sale filter
if
(
$search_sale
)
if
(
$search_sale
)
{
{
...
@@ -152,6 +159,7 @@ if ($result)
...
@@ -152,6 +159,7 @@ if ($result)
$param
=
"&search_nom="
.
$search_nom
.
"&search_code="
.
$search_code
.
"&search_zipcode="
.
$search_zipcode
.
"&search_town="
.
$search_town
;
$param
=
"&search_nom="
.
$search_nom
.
"&search_code="
.
$search_code
.
"&search_zipcode="
.
$search_zipcode
.
"&search_town="
.
$search_town
;
if
(
$search_categ
!=
''
)
$param
.
=
'&search_categ='
.
$search_categ
;
if
(
$search_categ
!=
''
)
$param
.
=
'&search_categ='
.
$search_categ
;
if
(
$search_sale
!=
''
)
$param
.
=
'&search_sale='
.
$search_sale
;
if
(
$search_sale
!=
''
)
$param
.
=
'&search_sale='
.
$search_sale
;
if
(
$search_status
!=
''
)
$param
.
=
'&search_status='
.
$search_status
;
print_barre_liste
(
$langs
->
trans
(
"ListOfCustomers"
),
$page
,
$_SERVER
[
"PHP_SELF"
],
$param
,
$sortfield
,
$sortorder
,
''
,
$num
,
$nbtotalofrecords
);
print_barre_liste
(
$langs
->
trans
(
"ListOfCustomers"
),
$page
,
$_SERVER
[
"PHP_SELF"
],
$param
,
$sortfield
,
$sortorder
,
''
,
$num
,
$nbtotalofrecords
);
...
@@ -190,7 +198,7 @@ if ($result)
...
@@ -190,7 +198,7 @@ if ($result)
print_liste_field_titre
(
$langs
->
trans
(
"AccountancyCode"
),
$_SERVER
[
"PHP_SELF"
],
"s.code_compta"
,
""
,
$param
,
'align="left"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"AccountancyCode"
),
$_SERVER
[
"PHP_SELF"
],
"s.code_compta"
,
""
,
$param
,
'align="left"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"DateCreation"
),
$_SERVER
[
"PHP_SELF"
],
"datec"
,
""
,
$param
,
'align="right"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"DateCreation"
),
$_SERVER
[
"PHP_SELF"
],
"datec"
,
""
,
$param
,
'align="right"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Status"
),
$_SERVER
[
"PHP_SELF"
],
"s.status"
,
""
,
$param
,
'align="right"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Status"
),
$_SERVER
[
"PHP_SELF"
],
"s.status"
,
""
,
$param
,
'align="right"'
,
$sortfield
,
$sortorder
);
print
'<td class="liste_titre" width="1%"> </td>'
;
$parameters
=
array
();
$parameters
=
array
();
$formconfirm
=
$hookmanager
->
executeHooks
(
'printFieldListTitle'
,
$parameters
);
// Note that $action and $object may have been modified by hook
$formconfirm
=
$hookmanager
->
executeHooks
(
'printFieldListTitle'
,
$parameters
);
// Note that $action and $object may have been modified by hook
...
@@ -218,7 +226,13 @@ if ($result)
...
@@ -218,7 +226,13 @@ if ($result)
print
'<input type="text" class="flat" name="search_compta" value="'
.
$search_compta
.
'" size="10">'
;
print
'<input type="text" class="flat" name="search_compta" value="'
.
$search_compta
.
'" size="10">'
;
print
'</td>'
;
print
'</td>'
;
print
'</td><td> </td>'
;
print
'<td class="liste_titre" align="center">'
;
print
' '
;
print
'</td>'
;
print
'<td class="liste_titre" align="center">'
;
print
$form
->
selectarray
(
'search_status'
,
array
(
'0'
=>
$langs
->
trans
(
'ActivityCeased'
),
'1'
=>
$langs
->
trans
(
'InActivity'
)),
$search_status
);
print
'</td>'
;
print
'<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'
.
DOL_URL_ROOT
.
'/theme/'
.
$conf
->
theme
.
'/img/search.png" value="'
.
dol_escape_htmltag
(
$langs
->
trans
(
"Search"
))
.
'" title="'
.
dol_escape_htmltag
(
$langs
->
trans
(
"Search"
))
.
'">'
;
print
'<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'
.
DOL_URL_ROOT
.
'/theme/'
.
$conf
->
theme
.
'/img/search.png" value="'
.
dol_escape_htmltag
(
$langs
->
trans
(
"Search"
))
.
'" title="'
.
dol_escape_htmltag
(
$langs
->
trans
(
"Search"
))
.
'">'
;
print
' '
;
print
' '
;
...
@@ -243,6 +257,7 @@ if ($result)
...
@@ -243,6 +257,7 @@ if ($result)
$thirdpartystatic
->
id
=
$obj
->
rowid
;
$thirdpartystatic
->
id
=
$obj
->
rowid
;
$thirdpartystatic
->
name
=
$obj
->
name
;
$thirdpartystatic
->
name
=
$obj
->
name
;
$thirdpartystatic
->
client
=
$obj
->
client
;
$thirdpartystatic
->
client
=
$obj
->
client
;
$thirdpartystatic
->
code_client
=
$obj
->
code_client
;
$thirdpartystatic
->
canvas
=
$obj
->
canvas
;
$thirdpartystatic
->
canvas
=
$obj
->
canvas
;
$thirdpartystatic
->
status
=
$obj
->
status
;
$thirdpartystatic
->
status
=
$obj
->
status
;
print
$thirdpartystatic
->
getNomUrl
(
1
);
print
$thirdpartystatic
->
getNomUrl
(
1
);
...
@@ -252,8 +267,9 @@ if ($result)
...
@@ -252,8 +267,9 @@ if ($result)
print
'<td>'
.
$obj
->
code_client
.
'</td>'
;
print
'<td>'
.
$obj
->
code_client
.
'</td>'
;
print
'<td>'
.
$obj
->
code_compta
.
'</td>'
;
print
'<td>'
.
$obj
->
code_compta
.
'</td>'
;
print
'<td align="right">'
.
dol_print_date
(
$db
->
jdate
(
$obj
->
datec
),
'day'
)
.
'</td>'
;
print
'<td align="right">'
.
dol_print_date
(
$db
->
jdate
(
$obj
->
datec
),
'day'
)
.
'</td>'
;
print
'<td align="
right
">'
.
$thirdpartystatic
->
getLibStatut
(
3
);
print
'<td align="
center
">'
.
$thirdpartystatic
->
getLibStatut
(
3
);
print
'</td>'
;
print
'</td>'
;
print
'<td></td>'
;
$parameters
=
array
(
'obj'
=>
$obj
);
$parameters
=
array
(
'obj'
=>
$obj
);
$formconfirm
=
$hookmanager
->
executeHooks
(
'printFieldListValue'
,
$parameters
);
// Note that $action and $object may have been modified by hook
$formconfirm
=
$hookmanager
->
executeHooks
(
'printFieldListValue'
,
$parameters
);
// Note that $action and $object may have been modified by hook
...
...
This diff is collapsed.
Click to expand it.
htdocs/comm/prospect/list.php
+
14
−
3
View file @
6bf2220a
...
@@ -47,6 +47,8 @@ $search_town = GETPOST("search_town");
...
@@ -47,6 +47,8 @@ $search_town = GETPOST("search_town");
$search_state
=
GETPOST
(
"search_state"
);
$search_state
=
GETPOST
(
"search_state"
);
$search_datec
=
GETPOST
(
"search_datec"
);
$search_datec
=
GETPOST
(
"search_datec"
);
$search_categ
=
GETPOST
(
"search_categ"
,
'int'
);
$search_categ
=
GETPOST
(
"search_categ"
,
'int'
);
$search_status
=
GETPOST
(
"search_status"
,
'int'
);
if
(
$search_status
==
''
)
$search_status
=
1
;
// always display activ customer first
$catid
=
GETPOST
(
"catid"
,
'int'
);
$catid
=
GETPOST
(
"catid"
,
'int'
);
$sortfield
=
GETPOST
(
"sortfield"
,
'alpha'
);
$sortfield
=
GETPOST
(
"sortfield"
,
'alpha'
);
...
@@ -173,6 +175,7 @@ if ($action == 'cstc')
...
@@ -173,6 +175,7 @@ if ($action == 'cstc')
*/
*/
$formother
=
new
FormOther
(
$db
);
$formother
=
new
FormOther
(
$db
);
$form
=
new
Form
(
$db
);
$sql
=
"SELECT s.rowid, s.nom, s.zip, s.town, s.datec, s.datea, s.status as status,"
;
$sql
=
"SELECT s.rowid, s.nom, s.zip, s.town, s.datec, s.datea, s.status as status,"
;
$sql
.
=
" st.libelle as stcomm, s.prefix_comm, s.fk_stcomm, s.fk_prospectlevel,"
;
$sql
.
=
" st.libelle as stcomm, s.prefix_comm, s.fk_stcomm, s.fk_prospectlevel,"
;
...
@@ -205,6 +208,7 @@ if ($search_state) {
...
@@ -205,6 +208,7 @@ if ($search_state) {
$sql
.
=
natural_search
(
'd.nom'
,
$search_state
);
$sql
.
=
natural_search
(
'd.nom'
,
$search_state
);
}
}
if
(
$search_datec
)
$sql
.
=
" AND s.datec LIKE '%"
.
$db
->
escape
(
$search_datec
)
.
"%'"
;
if
(
$search_datec
)
$sql
.
=
" AND s.datec LIKE '%"
.
$db
->
escape
(
$search_datec
)
.
"%'"
;
if
(
$search_status
!=
''
)
$sql
.
=
" AND s.status = "
.
$db
->
escape
(
$search_status
);
// Insert levels filters
// Insert levels filters
if
(
$search_levels
)
if
(
$search_levels
)
{
{
...
@@ -231,7 +235,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
...
@@ -231,7 +235,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
$sql
.
=
" ORDER BY
$sortfield
$sortorder
, s.nom ASC"
;
$sql
.
=
" ORDER BY
$sortfield
$sortorder
, s.nom ASC"
;
$sql
.
=
$db
->
plimit
(
$conf
->
liste_limit
+
1
,
$offset
);
$sql
.
=
$db
->
plimit
(
$conf
->
liste_limit
+
1
,
$offset
);
dol_syslog
(
'comm/prospect/list.php sql='
.
$sql
,
LOG_DEBUG
);
$resql
=
$db
->
query
(
$sql
);
$resql
=
$db
->
query
(
$sql
);
if
(
$resql
)
if
(
$resql
)
{
{
...
@@ -265,6 +269,7 @@ if ($resql)
...
@@ -265,6 +269,7 @@ if ($resql)
if
(
$search_level_to
!=
''
)
$param
.
=
'&search_level_to='
.
$search_level_to
;
if
(
$search_level_to
!=
''
)
$param
.
=
'&search_level_to='
.
$search_level_to
;
if
(
$search_categ
!=
''
)
$param
.
=
'&search_categ='
.
$search_categ
;
if
(
$search_categ
!=
''
)
$param
.
=
'&search_categ='
.
$search_categ
;
if
(
$search_sale
!=
''
)
$param
.
=
'&search_sale='
.
$search_sale
;
if
(
$search_sale
!=
''
)
$param
.
=
'&search_sale='
.
$search_sale
;
if
(
$search_status
!=
''
)
$param
.
=
'&search_status='
.
$search_status
;
// $param and $urladd should have the same value
// $param and $urladd should have the same value
$urladd
=
$param
;
$urladd
=
$param
;
...
@@ -306,7 +311,8 @@ if ($resql)
...
@@ -306,7 +311,8 @@ if ($resql)
print_liste_field_titre
(
$langs
->
trans
(
"ProspectLevelShort"
),
$_SERVER
[
"PHP_SELF"
],
"s.fk_prospectlevel"
,
""
,
$param
,
'align="center"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"ProspectLevelShort"
),
$_SERVER
[
"PHP_SELF"
],
"s.fk_prospectlevel"
,
""
,
$param
,
'align="center"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"StatusProsp"
),
$_SERVER
[
"PHP_SELF"
],
"s.fk_stcomm"
,
""
,
$param
,
'align="center"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"StatusProsp"
),
$_SERVER
[
"PHP_SELF"
],
"s.fk_stcomm"
,
""
,
$param
,
'align="center"'
,
$sortfield
,
$sortorder
);
print
'<td class="liste_titre"> </td>'
;
print
'<td class="liste_titre"> </td>'
;
print_liste_field_titre
(
$langs
->
trans
(
"Status"
),
$_SERVER
[
"PHP_SELF"
],
"s.status"
,
""
,
$param
,
'align="right"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Status"
),
$_SERVER
[
"PHP_SELF"
],
"s.status"
,
""
,
$param
,
'align="center"'
,
$sortfield
,
$sortorder
);
print
'<td class="liste_titre"> </td>'
;
$parameters
=
array
();
$parameters
=
array
();
$formconfirm
=
$hookmanager
->
executeHooks
(
'printFieldListTitle'
,
$parameters
);
// Note that $action and $object may have been modified by hook
$formconfirm
=
$hookmanager
->
executeHooks
(
'printFieldListTitle'
,
$parameters
);
// Note that $action and $object may have been modified by hook
...
@@ -368,6 +374,10 @@ if ($resql)
...
@@ -368,6 +374,10 @@ if ($resql)
print
' '
;
print
' '
;
print
'</td>'
;
print
'</td>'
;
print
'<td class="liste_titre" align="center">'
;
print
$form
->
selectarray
(
'search_status'
,
array
(
'0'
=>
$langs
->
trans
(
'ActivityCeased'
),
'1'
=>
$langs
->
trans
(
'InActivity'
)),
$search_status
);
print
'</td>'
;
// Print the search button
// Print the search button
print
'<td class="liste_titre" align="right">'
;
print
'<td class="liste_titre" align="right">'
;
print
'<input class="liste_titre" name="button_search" type="image" src="'
.
DOL_URL_ROOT
.
'/theme/'
.
$conf
->
theme
.
'/img/search.png" value="'
.
dol_escape_htmltag
(
$langs
->
trans
(
"Search"
))
.
'" title="'
.
dol_escape_htmltag
(
$langs
->
trans
(
"Search"
))
.
'">'
;
print
'<input class="liste_titre" name="button_search" type="image" src="'
.
DOL_URL_ROOT
.
'/theme/'
.
$conf
->
theme
.
'/img/search.png" value="'
.
dol_escape_htmltag
(
$langs
->
trans
(
"Search"
))
.
'" title="'
.
dol_escape_htmltag
(
$langs
->
trans
(
"Search"
))
.
'">'
;
...
@@ -425,9 +435,10 @@ if ($resql)
...
@@ -425,9 +435,10 @@ if ($resql)
}
}
print
'</td>'
;
print
'</td>'
;
print
'<td align="
right
">'
;
print
'<td align="
center
">'
;
print
$prospectstatic
->
LibStatut
(
$prospectstatic
->
status
,
3
);
print
$prospectstatic
->
LibStatut
(
$prospectstatic
->
status
,
3
);
print
'</td>'
;
print
'</td>'
;
print
'<td></td>'
;
$parameters
=
array
(
'obj'
=>
$obj
);
$parameters
=
array
(
'obj'
=>
$obj
);
$formconfirm
=
$hookmanager
->
executeHooks
(
'printFieldListValue'
,
$parameters
);
// Note that $action and $object may have been modified by hook
$formconfirm
=
$hookmanager
->
executeHooks
(
'printFieldListValue'
,
$parameters
);
// Note that $action and $object may have been modified by hook
...
...
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