Skip to content

Commit dc16e26

Browse files
committed
Merge tag 'v22.0.4' into PUSH_v22.0.4_INTO_23.0-release
2 parents b6a5ba2 + 3328023 commit dc16e26

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE participant_accounts DROP COLUMN Email;
2+
DELETE FROM history WHERE tbl='participant_accounts' AND col='Email';

modules/survey_accounts/jsx/surveyAccountsIndex.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@ class SurveyAccountsIndex extends Component {
9292
type: 'select',
9393
options: options.visits,
9494
}},
95-
{label: 'Email', show: true, filter: {
96-
name: 'email',
97-
type: 'text',
98-
}},
9995
{label: 'Instrument', show: true, filter: {
10096
name: 'instrument',
10197
type: 'select',

modules/survey_accounts/php/addsurvey.class.inc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ class AddSurvey extends \NDB_Form
6262
$db = \Database::singleton();
6363

6464
$numCandidates = $db->pselectOne(
65-
"SELECT COUNT(*) FROM candidate
66-
WHERE PSCID=:v_PSCID
65+
"SELECT COUNT(*) FROM candidate
66+
WHERE PSCID=:v_PSCID
6767
AND CandID=:v_CandID AND Active='Y'",
6868
array(
6969
'v_PSCID' => $values['PSCID'],
@@ -78,9 +78,9 @@ class AddSurvey extends \NDB_Form
7878
}
7979

8080
$numSessions = $db->pselectOne(
81-
"SELECT COUNT(*) FROM session
82-
WHERE CandID=:v_CandID
83-
AND UPPER(Visit_label)=UPPER(:v_VL)
81+
"SELECT COUNT(*) FROM session
82+
WHERE CandID=:v_CandID
83+
AND UPPER(Visit_label)=UPPER(:v_VL)
8484
AND Active='Y'",
8585
array(
8686
'v_CandID' => $values['CandID'],
@@ -114,8 +114,8 @@ class AddSurvey extends \NDB_Form
114114
$instrument_list = $db->pselect(
115115
"SELECT f.Test_name FROM flag f
116116
JOIN session s on s.ID = f.SessionID
117-
WHERE s.CandID=:v_CandID
118-
AND UPPER(s.Visit_label)=UPPER(:v_VL)
117+
WHERE s.CandID=:v_CandID
118+
AND UPPER(s.Visit_label)=UPPER(:v_VL)
119119
AND s.Active='Y'",
120120
array(
121121
'v_CandID' => $values['CandID'],
@@ -179,7 +179,9 @@ class AddSurvey extends \NDB_Form
179179
*/
180180
function _process($values)
181181
{
182-
$db = \Database::singleton();
182+
$db = \Database::singleton();
183+
$email = $values['Email'];
184+
unset($values['Email']);
183185
$SessionID = $db->pselectOne(
184186
"SELECT ID FROM session".
185187
" WHERE CandID=:v_CandID AND Visit_label=:v_VL",
@@ -207,11 +209,11 @@ class AddSurvey extends \NDB_Form
207209

208210
$key = $this->_generateSurveyKey();
209211

210-
$email = false;
212+
$sendEmail = false;
211213
if (isset($_REQUEST['send_email'])) {
212-
$email = true;
214+
$sendEmail = true;
213215
}
214-
if ($email) {
216+
if ($sendEmail) {
215217
$status = 'Sent';
216218
} else {
217219
$status = 'Created';
@@ -223,7 +225,6 @@ class AddSurvey extends \NDB_Form
223225
array(
224226
'SessionID' => $SessionID,
225227
'Test_name' => $values['Test_name'],
226-
'Email' => $values['Email'],
227228
'Status' => $status,
228229
'OneTimePassword' => $key,
229230
'CommentID' => $commentID,
@@ -238,14 +239,13 @@ class AddSurvey extends \NDB_Form
238239
if ($email) {
239240
$config = \NDB_Config::singleton();
240241
$baseURL = \NDB_Factory::singleton()->settings()->getBaseURL();
241-
242242
$msg_data = array(
243243
'study' => $config->getSetting("title"),
244244
'url' => $baseURL . '/survey.php?key=' .
245245
urlencode($key),
246246
'EmailForm' => $values['email_dialog'],
247247
);
248-
\Email::send($values['Email'], 'new_survey.tpl', $msg_data);
248+
\Email::send($email, 'new_survey.tpl', $msg_data);
249249
}
250250
}
251251

0 commit comments

Comments
 (0)