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
4d4feab0
Commit
4d4feab0
authored
18 years ago
by
Yannick Warnier
Browse files
Options
Downloads
Patches
Plain Diff
Evite le double-enregistrement d'alertes sur anniversaire
parent
bb609f3f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/contact.class.php
+23
-8
23 additions, 8 deletions
htdocs/contact.class.php
with
23 additions
and
8 deletions
htdocs/contact.class.php
+
23
−
8
View file @
4d4feab0
...
...
@@ -321,20 +321,35 @@ class Contact
// Mis a jour alerte birthday
if
(
$this
->
birthday_alert
)
{
$sql
=
"INSERT into "
.
MAIN_DB_PREFIX
.
"user_alert(type,fk_contact,fk_user) "
;
$sql
.
=
"values (1,"
.
$id
.
","
.
$user
->
id
.
")"
;
//check existing
$sql_check
=
"SELECT * FROM "
.
MAIN_DB_PREFIX
.
"user_alert WHERE type=1 AND fk_contact=
$id
AND fk_user="
.
$user
->
id
;
$result_check
=
$this
->
db
->
query
(
$sql_check
);
if
(
!
$result_check
or
(
$this
->
db
->
num_rows
(
$result_check
)
<
1
))
{
//insert
$sql
=
"INSERT into "
.
MAIN_DB_PREFIX
.
"user_alert(type,fk_contact,fk_user) "
;
$sql
.
=
"values (1,"
.
$id
.
","
.
$user
->
id
.
")"
;
$result
=
$this
->
db
->
query
(
$sql
);
if
(
!
$result
)
{
$this
->
error
=
'Echec sql='
.
$sql
;
}
}
else
{
$result
=
true
;
}
}
else
{
$sql
=
"DELETE from "
.
MAIN_DB_PREFIX
.
"user_alert "
;
$sql
.
=
"where type=1 AND fk_contact="
.
$id
.
" AND fk_user="
.
$user
->
id
;
$result
=
$this
->
db
->
query
(
$sql
);
if
(
!
$result
)
{
$this
->
error
=
'Echec sql='
.
$sql
;
}
}
$result
=
$this
->
db
->
query
(
$sql
);
if
(
!
$result
)
{
$this
->
error
=
'Echec sql='
.
$sql
;
}
return
$result
;
}
...
...
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