Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cc.tadpole.petitionemail
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
extensions
cc.tadpole.petitionemail
Commits
0b9bd690
Commit
0b9bd690
authored
Dec 16, 2013
by
Joseph Lacey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code clean up to petitionemail.php
parent
7949c54c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
23 deletions
+11
-23
petitionemail.php
petitionemail.php
+11
-23
No files found.
petitionemail.php
View file @
0b9bd690
...
...
@@ -322,8 +322,8 @@ function petitionemail_civicrm_postProcess( $formName, &$form ) {
FROM civicrm_petition_email
WHERE petition_id = %1"
;
$checkexisting_params
=
array
(
1
=>
array
(
$survey_id
,
'Integer'
)
);
$checkexisting
=
CRM_Core_DAO
::
singleValueQuery
(
$checkexisting_sql
,
$checkexisting_params
);
if
(
$checkexisting
==
0
)
{
$petitionemail_data_sql
=
"INSERT INTO civicrm_petition_email (
petition_id,
...
...
@@ -340,14 +340,6 @@ function petitionemail_civicrm_postProcess( $formName, &$form ) {
%5,
%6
)"
;
$petitionemail_data_params
=
array
(
1
=>
array
(
$survey_id
,
'Integer'
),
2
=>
array
(
$recipient
,
'String'
),
3
=>
array
(
$recipient_name
,
'String'
),
4
=>
array
(
$default_message
,
'String'
),
5
=>
array
(
$user_message
,
'String'
),
6
=>
array
(
$subjectline
,
'String'
),
);
}
else
{
$petitionemail_data_sql
=
"UPDATE civicrm_petition_email
SET recipient_email = %2,
...
...
@@ -356,6 +348,7 @@ function petitionemail_civicrm_postProcess( $formName, &$form ) {
message_field = %5,
subject = %6
WHERE petition_id = %1"
;
}
$petitionemail_data_params
=
array
(
1
=>
array
(
$survey_id
,
'Integer'
),
2
=>
array
(
$recipient
,
'String'
),
...
...
@@ -364,13 +357,8 @@ function petitionemail_civicrm_postProcess( $formName, &$form ) {
5
=>
array
(
$user_message
,
'String'
),
6
=>
array
(
$subjectline
,
'String'
),
);
}
$petitionemail
=
CRM_Core_DAO
::
executeQuery
(
$petitionemail_data_sql
,
$petitionemail_data_params
);
//FIXME Add failed database write check
//if (!$insert) {
// CRM_Core_Session::setStatus( ts('Could not save petition delivery information.') );
//}
$petitionemail
=
CRM_Core_DAO
::
executeQuery
(
$petitionemail_data_sql
,
$petitionemail_data_params
);
}
}
...
...
@@ -394,7 +382,6 @@ function petitionemail_civicrm_post( $op, $objectName, $objectId, &$objectRef )
if
(
$objectRef
->
activity_type_id
==
$petitiontype
)
{
$survey_id
=
$objectRef
->
source_record_id
;
$activity_id
=
$objectRef
->
id
;
global
$language
;
$petitionemail_get_sql
=
"SELECT petition_id,
recipient_email,
recipient_name,
...
...
@@ -430,6 +417,7 @@ function petitionemail_civicrm_post( $op, $objectName, $objectId, &$objectRef )
}
}
}
// No user supplied message, use the default
if
(
is_null
(
$petition_message
))
{
$petition_message
=
$petitionemail_get
->
default_message
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment