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
4a3083a4
Commit
4a3083a4
authored
8 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
FIX Remove PHP Warning: Creating default object from empty value.
parent
ab6fbb1b
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/expensereport/card.php
+11
-34
11 additions, 34 deletions
htdocs/expensereport/card.php
with
11 additions
and
34 deletions
htdocs/expensereport/card.php
+
11
−
34
View file @
4a3083a4
...
...
@@ -333,7 +333,7 @@ if ($action == "confirm_save_from_refuse" && GETPOST("confirm") == "yes" && $id
if
(
$result
>
0
)
{
if
(
!
empty
(
$conf
->
global
->
DEPLACEMENT_TO_CLEAN
))
if
(
!
empty
(
$conf
->
global
->
DEPLACEMENT_TO_CLEAN
))
// TODO Translate this so we can remove condition
{
// Send mail
...
...
@@ -390,6 +390,7 @@ if ($action == "confirm_save_from_refuse" && GETPOST("confirm") == "yes" && $id
else
{
$mesg
=
$mailfile
->
error
;
setEventMessages
(
$mesg
,
null
,
'errors'
);
}
// END - Send mail
}
...
...
@@ -438,7 +439,7 @@ if ($action == "confirm_approve" && GETPOST("confirm") == "yes" && $id > 0 && $u
if
(
$result
>
0
)
{
if
(
!
empty
(
$conf
->
global
->
DEPLACEMENT_TO_CLEAN
))
if
(
!
empty
(
$conf
->
global
->
DEPLACEMENT_TO_CLEAN
))
// TODO Translate this so we can remove condition
{
// Send mail
...
...
@@ -542,7 +543,7 @@ if ($action == "confirm_refuse" && GETPOST('confirm')=="yes" && $id > 0 && $user
if
(
$result
>
0
)
{
if
(
!
empty
(
$conf
->
global
->
DEPLACEMENT_TO_CLEAN
))
if
(
!
empty
(
$conf
->
global
->
DEPLACEMENT_TO_CLEAN
))
// TODO Translate this so we can remove condition
{
// Send mail
...
...
@@ -583,7 +584,6 @@ if ($action == "confirm_refuse" && GETPOST('confirm')=="yes" && $id > 0 && $user
else
{
setEventMessages
(
$langs
->
trans
(
"ErrorFailedToSendMail"
,
$emailFrom
,
$emailTo
),
null
,
'errors'
);
$mesg
=
"Impossible d'envoyer l'email."
;
}
// END - Send mail
}
...
...
@@ -627,7 +627,7 @@ if ($action == "confirm_cancel" && GETPOST('confirm')=="yes" && GETPOST('detail_
if
(
$result
>
0
)
{
if
(
!
empty
(
$conf
->
global
->
DEPLACEMENT_TO_CLEAN
))
if
(
!
empty
(
$conf
->
global
->
DEPLACEMENT_TO_CLEAN
))
// TODO Translate this so we can remove condition
{
// Send mail
...
...
@@ -667,6 +667,7 @@ if ($action == "confirm_cancel" && GETPOST('confirm')=="yes" && GETPOST('detail_
else
{
$mesg
=
"Impossible d'envoyer l'email."
;
setEventMessages
(
$mesg
,
null
,
'errors'
);
}
// END - Send mail
}
...
...
@@ -756,7 +757,7 @@ if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid)
if
(
$result
>
0
)
{
if
(
!
empty
(
$conf
->
global
->
DEPLACEMENT_TO_CLEAN
))
if
(
!
empty
(
$conf
->
global
->
DEPLACEMENT_TO_CLEAN
))
// TODO Translate this so we can remove condition
{
// Send mail
...
...
@@ -806,9 +807,8 @@ if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid)
endif
;
else
:
$mesg
=
"Impossible d'envoyer l'email."
;
$mesg
=
"Impossible d'envoyer l'email."
;
setEventMessages
(
$mesg
,
null
,
'errors'
);
endif
;
// END - Send mail
}
...
...
@@ -921,7 +921,7 @@ if ($action == 'confirm_delete_line' && GETPOST("confirm") == "yes")
$total_ht
=
$object_ligne
->
total_ht
;
$total_tva
=
$object_ligne
->
total_tva
;
$result
=
$object
->
deleteline
(
GETPOST
(
"rowid"
));
$result
=
$object
->
deleteline
(
GETPOST
(
"rowid"
)
,
$user
);
if
(
$result
>=
0
)
{
if
(
$result
>
0
)
...
...
@@ -961,7 +961,6 @@ if ($action == "updateligne" )
$rowid
=
$_POST
[
'rowid'
];
$type_fees_id
=
GETPOST
(
'fk_c_type_fees'
);
$object_ligne
->
vatrate
=
price2num
(
GETPOST
(
'vatrate'
));
$projet_id
=
$fk_projet
;
$comments
=
GETPOST
(
'comments'
);
$qty
=
GETPOST
(
'qty'
);
...
...
@@ -983,6 +982,7 @@ if ($action == "updateligne" )
if
(
!
$error
)
{
// TODO Use update method of ExpenseReportLine
$result
=
$object
->
updateline
(
$rowid
,
$type_fees_id
,
$projet_id
,
$vatrate
,
$comments
,
$qty
,
$value_unit
,
$date
,
$id
);
if
(
$result
>=
0
)
{
...
...
@@ -1078,29 +1078,6 @@ $formfile = new FormFile($db);
$formproject
=
new
FormProjets
(
$db
);
$projecttmp
=
new
Project
(
$db
);
if
(
!
empty
(
$conf
->
global
->
DEPLACEMENT_TO_CLEAN
))
{
if
(
!
empty
(
$_GET
[
'mesg'
]))
{
$text_mesg
=
explode
(
","
,
$_GET
[
'mesg'
]);
foreach
(
$text_mesg
as
$text
)
{
$mesg
.
=
"- "
.
$langs
->
trans
(
$text
)
.
"<br />"
;
}
print
"<div class=
\"
error
\"
style=
\"
font-size:15px;background-color:#FFB3B3;
\"
>"
;
print
$langs
->
trans
(
"LINE_NOT_ADDED"
)
.
"<br />"
;
print
$mesg
;
print
"</div>"
;
}
else
{
if
(
$mesg
)
print
"<div class=
\"
error
\"
style=
\"
font-size:16px;background-color:red;
\"
>"
.
$mesg
.
"</div>"
;
}
}
// Create
if
(
$action
==
'create'
)
{
...
...
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