corrade-http-templates
/instantMessage/instantMessage.html |
@@ -71,6 +71,11 @@ |
// Function to send the message to an agent by passing it back through PHP. |
function sendInstantMessage(e) { |
var index = e.data.index; |
// If the parameters are empty, then do not send anything to the PHP script. |
if($.trim($("#firstname-" + index).val()) == '' || |
$.trim($("#lastname-" + index).val()) == '' || |
$.trim($("#message-" + index).val()) == '') |
return; |
$("#controls-" + index).animate({ |
opacity: 'hide' |
}, 'slow'); |
/instantMessage/sendInstantMessage.php |
@@ -18,11 +18,15 @@ |
## INTERNALS ## |
########################################################################### |
|
# If there is no "message" or "name" POST variable set then bail. |
# Check that we have all the necessary variables. |
if(!isset($_POST['message']) || |
empty($_POST['message']) || |
!isset($_POST['name']) || |
empty($_POST['name']) || |
!isset($_POST['firstname']) || |
!isset($_POST['lastname'])) return; |
empty($_POST['firstname']) || |
!isset($_POST['lastname']) || |
empty($_POST['lastname'])) return; |
|
#### |
# I. Build the POST array to send to Corrade. |
/instantMessage/storeInstantMessages.php |
@@ -23,10 +23,13 @@ |
|
# Check if this is the group chat notification. |
if(!isset($_POST['type']) || $_POST['type'] != "message") return; |
# Bail if "firstname", "lastname" or the "message" variables are blank. |
# Check that we have all the required variables. |
if(!isset($_POST['firstname']) || |
empty($_POST['firstname']) || |
!isset($_POST['lastname']) || |
!isset($_POST['message'])) return; |
empty($_POST['lastname']) || |
!isset($_POST['message']) || |
empty($_POST['message'])) return; |
|
#### |
# I. Get the path to the configured chat directory. |