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
3912013a
Commit
3912013a
authored
12 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Plain Diff
Merge pull request #668 from FHenry/develop
Better to use foreach because when add mail in $cible array we can test
parents
4119fde0
3e42f90b
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/core/modules/mailings/modules_mailings.php
+11
-11
11 additions, 11 deletions
htdocs/core/modules/mailings/modules_mailings.php
with
11 additions
and
11 deletions
htdocs/core/modules/mailings/modules_mailings.php
+
11
−
11
View file @
3912013a
...
...
@@ -150,9 +150,9 @@ class MailingTargets // This can't be abstract as it is used for some method
// Insert emailing targest from array into database
$j
=
0
;
$num
=
count
(
$cibles
);
for
(
$i
=
0
;
$i
<
$num
;
$i
++
)
for
each
(
$cibles
as
$targetarray
)
{
if
(
!
empty
(
$
cibles
[
$i
]
[
'email'
]))
// avoid empty email address
if
(
!
empty
(
$
targetarray
[
'email'
]))
// avoid empty email address
{
$sql
=
"INSERT INTO "
.
MAIN_DB_PREFIX
.
"mailing_cibles"
;
$sql
.
=
" (fk_mailing,"
;
...
...
@@ -163,17 +163,17 @@ class MailingTargets // This can't be abstract as it is used for some method
}
$sql
.
=
" source_type)"
;
$sql
.
=
" VALUES ("
.
$mailing_id
.
","
;
$sql
.
=
(
empty
(
$
cibles
[
$i
]
[
'fk_contact'
])
?
'0'
:
"'"
.
$
cibles
[
$i
]
[
'fk_contact'
]
.
"'"
)
.
","
;
$sql
.
=
"'"
.
$this
->
db
->
escape
(
$
cibles
[
$i
]
[
'name'
])
.
"',"
;
$sql
.
=
"'"
.
$this
->
db
->
escape
(
$
cibles
[
$i
]
[
'firstname'
])
.
"',"
;
$sql
.
=
"'"
.
$this
->
db
->
escape
(
$
cibles
[
$i
]
[
'email'
])
.
"',"
;
$sql
.
=
"'"
.
$this
->
db
->
escape
(
$
cibles
[
$i
]
[
'other'
])
.
"',"
;
$sql
.
=
"'"
.
$this
->
db
->
escape
(
$
cibles
[
$i
]
[
'source_url'
])
.
"',"
;
$sql
.
=
"'"
.
$this
->
db
->
escape
(
$
cibles
[
$i
]
[
'source_id'
])
.
"',"
;
$sql
.
=
(
empty
(
$
targetarray
[
'fk_contact'
])
?
'0'
:
"'"
.
$
targetarray
[
'fk_contact'
]
.
"'"
)
.
","
;
$sql
.
=
"'"
.
$this
->
db
->
escape
(
$
targetarray
[
'name'
])
.
"',"
;
$sql
.
=
"'"
.
$this
->
db
->
escape
(
$
targetarray
[
'firstname'
])
.
"',"
;
$sql
.
=
"'"
.
$this
->
db
->
escape
(
$
targetarray
[
'email'
])
.
"',"
;
$sql
.
=
"'"
.
$this
->
db
->
escape
(
$
targetarray
[
'other'
])
.
"',"
;
$sql
.
=
"'"
.
$this
->
db
->
escape
(
$
targetarray
[
'source_url'
])
.
"',"
;
$sql
.
=
"'"
.
$this
->
db
->
escape
(
$
targetarray
[
'source_id'
])
.
"',"
;
if
(
!
empty
(
$conf
->
global
->
MAILING_EMAIL_UNSUBSCRIBE
))
{
$sql
.
=
"'"
.
$this
->
db
->
escape
(
md5
(
$
cibles
[
$i
]
[
'email'
]
.
';'
.
$
cibles
[
$i
]
[
'name'
]
.
';'
.
$mailing_id
.
';'
.
$conf
->
global
->
MAILING_EMAIL_UNSUBSCRIBE_KEY
))
.
"',"
;
$sql
.
=
"'"
.
$this
->
db
->
escape
(
md5
(
$
targetarray
[
'email'
]
.
';'
.
$
targetarray
[
'name'
]
.
';'
.
$mailing_id
.
';'
.
$conf
->
global
->
MAILING_EMAIL_UNSUBSCRIBE_KEY
))
.
"',"
;
}
$sql
.
=
"'"
.
$this
->
db
->
escape
(
$
cibles
[
$i
]
[
'source_type'
])
.
"')"
;
$sql
.
=
"'"
.
$this
->
db
->
escape
(
$
targetarray
[
'source_type'
])
.
"')"
;
$result
=
$this
->
db
->
query
(
$sql
);
if
(
$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