From a4112238849037a44213d3e8c605ae381387f257 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 5 Oct 2015 17:17:39 +0300 Subject: [PATCH] Bug fix lp:1502914, Bootstrapified, added Cancel button --- email.php | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/email.php b/email.php index 8bc97ef3..69ce39d2 100644 --- a/email.php +++ b/email.php @@ -72,7 +72,7 @@ $operator_id = get_operator_id(); $msg = ""; -if (isset($_POST['firstname'])) +if (isset($_POST['email']) && ((isset($_POST['firstname']) && !empty($_POST['firstname'])) || (isset($_POST['lastname']) && !empty($_POST['lastname'])))) { //validate email address if (validate_email($_POST['email'])) @@ -278,8 +278,10 @@ if (isset($_POST['firstname'])) } //disable recording $newtext = T_("Start REC"); - $js = "js/window.js"; - if (browser_ie()) $js = "js/window_ie6.js"; + + if (isset($_GET['interface2'])) { if (browser_ie()) $js = "js/window_ie6_interface2.js"; else $js = "js/window_interface2.js";} + else { if (browser_ie()) $js = "js/window_ie6.js"; else $js = "js/window.js"; } + if (isset($_GET['interface2'])) { xhtml_head(T_("Email"),true,array("css/call.css"),array($js),"onload='openParent(\"endcase=endcase\");'"); @@ -310,10 +312,10 @@ if (isset($_POST['firstname'])) $case_id = get_case_id($operator_id); -$js = "js/window.js"; -if (browser_ie()) $js = "js/window_ie6.js"; +if (isset($_GET['interface2'])) { if (browser_ie()) $js = "js/window_ie6_interface2.js"; else $js = "js/window_interface2.js"; } +else { if (browser_ie()) $js = "js/window_ie6.js"; else $js = "js/window.js"; } -xhtml_head(T_("Email"),true,array("css/call.css"),array($js)); +xhtml_head(T_("Email"),true,array("include/bootstrap/css/bootstrap.min.css"),array($js)); $sql = "SELECT q.self_complete FROM questionnaire as q, `case` as c @@ -333,22 +335,30 @@ if ($sc == 1) $rs = $db->GetRow($sql); - print "
" . T_("Email respondent for self completion") . "
"; - if (!empty($msg)) print "

$msg

"; + print "

" . T_("Email respondent for self completion") . "

"; + if (!empty($msg)) print "

$msg

"; print "
"; - print "
"; - print "
"; - print "
"; - if (!isset($_GET['interface2'])) - { - print "
"; + print "' method='post' class='form-horizontal col-md-12'>"; + + print "
+ +
"; + print "
+ +
"; + print "
+ +
"; + if (!isset($_GET['interface2'])) { + print "
"; } - print "
"; + print "
+
+
"; } else {