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
c24d68a0
Commit
c24d68a0
authored
8 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Picto for expense report
parent
99927043
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
htdocs/core/ajax/selectsearchbox.php
+2
-2
2 additions, 2 deletions
htdocs/core/ajax/selectsearchbox.php
htdocs/expensereport/list.php
+53
-18
53 additions, 18 deletions
htdocs/expensereport/list.php
htdocs/theme/eldy/img/object_trip.png
+0
-0
0 additions, 0 deletions
htdocs/theme/eldy/img/object_trip.png
with
55 additions
and
20 deletions
htdocs/core/ajax/selectsearchbox.php
+
2
−
2
View file @
c24d68a0
...
...
@@ -118,11 +118,11 @@ if (! empty($conf->ficheinter->enabled) && empty($conf->global->MAIN_SEARCHFORM_
// HR
if
(
!
empty
(
$conf
->
expensereport
->
enabled
)
&&
empty
(
$conf
->
global
->
MAIN_SEARCHFORM_EXPENSEREPORT_DISABLED
)
&&
$user
->
rights
->
expensereport
->
lire
)
{
$arrayresult
[
'searchintoexpensereport'
]
=
array
(
'text'
=>
img_picto
(
''
,
'object_trip'
)
.
' '
.
$langs
->
trans
(
"SearchIntoExpenseReports"
,
$search_boxvalue
),
'url'
=>
DOL_URL_ROOT
.
'/expensereport/list.php?sall='
.
urlencode
(
$search_boxvalue
));
$arrayresult
[
'searchintoexpensereport'
]
=
array
(
'text'
=>
img_picto
(
''
,
'object_trip'
)
.
' '
.
$langs
->
trans
(
"SearchIntoExpenseReports"
,
$search_boxvalue
),
'url'
=>
DOL_URL_ROOT
.
'/expensereport/list.php?
mainmenu=hrm&
sall='
.
urlencode
(
$search_boxvalue
));
}
if
(
!
empty
(
$conf
->
holiday
->
enabled
)
&&
empty
(
$conf
->
global
->
MAIN_SEARCHFORM_HOLIDAY_DISABLED
)
&&
$user
->
rights
->
holiday
->
read
)
{
$arrayresult
[
'searchintoleaves'
]
=
array
(
'text'
=>
img_picto
(
''
,
'object_holiday'
)
.
' '
.
$langs
->
trans
(
"SearchIntoLeaves"
,
$search_boxvalue
),
'url'
=>
DOL_URL_ROOT
.
'/holiday/list.php?sall='
.
urlencode
(
$search_boxvalue
));
$arrayresult
[
'searchintoleaves'
]
=
array
(
'text'
=>
img_picto
(
''
,
'object_holiday'
)
.
' '
.
$langs
->
trans
(
"SearchIntoLeaves"
,
$search_boxvalue
),
'url'
=>
DOL_URL_ROOT
.
'/holiday/list.php?
mainmenu=hrm&
sall='
.
urlencode
(
$search_boxvalue
));
}
...
...
This diff is collapsed.
Click to expand it.
htdocs/expensereport/list.php
+
53
−
18
View file @
c24d68a0
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-201
5
Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-201
6
Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
...
...
@@ -51,22 +51,21 @@ $month_end = GETPOST("month_end","int");
$year_end
=
GETPOST
(
"year_end"
,
"int"
);
$optioncss
=
GETPOST
(
'optioncss'
,
'alpha'
);
if
(
GETPOST
(
"button_removefilter_x"
)
||
GETPOST
(
"button_removefilter"
))
// Both test must be present to be compatible with all browsers
{
$search_ref
=
""
;
$search_user
=
""
;
$search_amount_ht
=
""
;
$search_amount_ttc
=
""
;
$search_status
=
""
;
$month_start
=
""
;
$year_start
=
""
;
$month_end
=
""
;
$year_end
=
""
;
}
if
(
$search_status
==
''
)
$search_status
=-
1
;
if
(
$search_user
==
''
)
$search_user
=-
1
;
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$contextpage
=
'expensereportlist'
;
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager
->
initHooks
(
array
(
'expensereportlist'
));
$extrafields
=
new
ExtraFields
(
$db
);
// fetch optionals attributes and labels
$extralabels
=
$extrafields
->
fetch_name_optionals_label
(
'expensereport'
);
$search_array_options
=
$extrafields
->
getOptionalsFromPost
(
$extralabels
,
''
,
'search_'
);
// List of fields to search into when doing a "search in all"
$fieldstosearchall
=
array
(
'd.ref'
=>
'Ref'
,
...
...
@@ -75,6 +74,33 @@ $fieldstosearchall = array(
);
/*
* Actions
*/
$parameters
=
array
(
'socid'
=>
$socid
);
$reshook
=
$hookmanager
->
executeHooks
(
'doActions'
,
$parameters
,
$object
,
$action
);
// Note that $action and $object may have been modified by some hooks
if
(
$reshook
<
0
)
setEventMessages
(
$hookmanager
->
error
,
$hookmanager
->
errors
,
'errors'
);
include
DOL_DOCUMENT_ROOT
.
'/core/actions_changeselectedfields.inc.php'
;
if
(
GETPOST
(
"button_removefilter_x"
)
||
GETPOST
(
"button_removefilter.x"
)
||
GETPOST
(
"button_removefilter"
))
// Both test must be present to be compatible with all browsers
{
$search_ref
=
""
;
$search_user
=
""
;
$search_amount_ht
=
""
;
$search_amount_ttc
=
""
;
$search_status
=
""
;
$month_start
=
""
;
$year_start
=
""
;
$month_end
=
""
;
$year_end
=
""
;
$search_array_options
=
array
();
}
/*
* View
*/
...
...
@@ -108,7 +134,6 @@ $sql.= " u.rowid as id_user, u.firstname, u.lastname";
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"expensereport as d"
;
$sql
.
=
" INNER JOIN "
.
MAIN_DB_PREFIX
.
"user as u ON d.fk_user_author = u.rowid"
;
$sql
.
=
" WHERE d.entity = "
.
$conf
->
entity
;
// Search all
if
(
!
empty
(
$sall
))
{
...
...
@@ -192,13 +217,22 @@ if ($resql)
$i
=
0
;
$param
=
""
;
if
(
!
empty
(
$contextpage
)
&&
$contextpage
!=
$_SERVER
[
"PHP_SELF"
])
$param
.
=
'&contextpage='
.
$contextpage
;
if
(
$limit
>
0
&&
$limit
!=
$conf
->
liste_limit
)
$param
.
=
'&limit='
.
$limit
;
if
(
$search_ref
)
$param
.
=
"&search_ref="
.
$search_ref
;
if
(
$search_user
)
$param
.
=
"&search_user="
.
$search_user
;
if
(
$search_amount_ht
)
$param
.
=
"&search_amount_ht="
.
$search_amount_ht
;
if
(
$search_amount_ttc
)
$param
.
=
"&search_amount_ttc="
.
$search_amount_ttc
;
if
(
$search_status
>=
0
)
$param
.
=
"&search_status="
.
$search_status
;
if
(
$optioncss
!=
''
)
$param
.
=
'&optioncss='
.
$optioncss
;
if
(
$optioncss
!=
''
)
$param
.
=
'&optioncss='
.
$optioncss
;
// Add $param from extra fields
foreach
(
$search_array_options
as
$key
=>
$val
)
{
$crit
=
$val
;
$tmpkey
=
preg_replace
(
'/search_options_/'
,
''
,
$key
);
if
(
$val
!=
''
)
$param
.
=
'&search_options_'
.
$tmpkey
.
'='
.
urlencode
(
$val
);
}
print_barre_liste
(
$langs
->
trans
(
"ListTripsAndExpenses"
),
$page
,
$_SERVER
[
"PHP_SELF"
],
$param
,
$sortfield
,
$sortorder
,
''
,
$num
,
$nbtotalofrecords
);
print
'<form action="'
.
$_SERVER
[
"PHP_SELF"
]
.
'" method="POST">'
.
"
\n
"
;
if
(
$optioncss
!=
''
)
print
'<input type="hidden" name="optioncss" value="'
.
$optioncss
.
'">'
;
...
...
@@ -210,8 +244,9 @@ if ($resql)
if
(
$sall
)
{
foreach
(
$fieldstosearchall
as
$key
=>
$val
)
$fieldstosearchall
[
$key
]
=
$langs
->
trans
(
$val
);
print
$langs
->
trans
(
"FilterOnInto"
,
$sall
)
.
join
(
', '
,
$fieldstosearchall
);
}
print
'<table class="noborder" width="100%">'
;
print
"<tr class=
\"
liste_titre
\"
>"
;
print_liste_field_titre
(
$langs
->
trans
(
"Ref"
),
$_SERVER
[
"PHP_SELF"
],
"d.rowid"
,
""
,
$param
,
''
,
$sortfield
,
$sortorder
);
...
...
This diff is collapsed.
Click to expand it.
htdocs/theme/eldy/img/object_trip.png
+32 B (+9%)
View file @
c24d68a0
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
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