From e86480a18e4d8a1ea0084432bfef55ee6b91d952 Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 6 Mar 2020 12:11:29 -0700 Subject: [PATCH] Call Recordings: Remove deprecated Edit script. --- app/call_recordings/call_recording_edit.php | 274 -------------------- 1 file changed, 274 deletions(-) delete mode 100644 app/call_recordings/call_recording_edit.php diff --git a/app/call_recordings/call_recording_edit.php b/app/call_recordings/call_recording_edit.php deleted file mode 100644 index 1771243c97..0000000000 --- a/app/call_recordings/call_recording_edit.php +++ /dev/null @@ -1,274 +0,0 @@ - - Portions created by the Initial Developer are Copyright (C) 2018 - the Initial Developer. All Rights Reserved. - - Contributor(s): - Mark J Crane -*/ - -//includes - require_once "root.php"; - require_once "resources/require.php"; - -//check permissions - require_once "resources/check_auth.php"; - if (permission_exists('call_recording_add') || permission_exists('call_recording_edit')) { - //access granted - } - else { - echo "access denied"; - exit; - } - -//add multi-lingual support - $language = new text; - $text = $language->get(); - -//action add or update - if (is_uuid($_REQUEST["id"])) { - $action = "update"; - $call_recording_uuid = $_REQUEST["id"]; - } - else { - $action = "add"; - } - -//get http post variables and set them to php variables - if (is_array($_POST)) { - $call_recording_name = $_POST["call_recording_name"]; - $call_recording_path = $_POST["call_recording_path"]; - $call_recording_length = $_POST["call_recording_length"]; - $call_recording_date = $_POST["call_recording_date"]; - $call_direction = $_POST["call_direction"]; - $call_recording_description = $_POST["call_recording_description"]; - $call_recording_base64 = $_POST["call_recording_base64"]; - } - -//process the user data and save it to the database - if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { - - //get the uuid from the POST - if ($action == "update") { - $call_recording_uuid = $_POST["call_recording_uuid"]; - } - - //validate the token - $token = new token; - if (!$token->validate($_SERVER['PHP_SELF'])) { - message::add($text['message-invalid_token'],'negative'); - header('Location: call_recordings.php'); - exit; - } - - //check for all required data - $msg = ''; - if (strlen($call_recording_name) == 0) { $msg .= $text['message-required']." ".$text['label-call_recording_name']."
\n"; } - //if (strlen($call_recording_path) == 0) { $msg .= $text['message-required']." ".$text['label-call_recording_path']."
\n"; } - if (strlen($call_recording_length) == 0) { $msg .= $text['message-required']." ".$text['label-call_recording_length']."
\n"; } - if (strlen($call_recording_date) == 0) { $msg .= $text['message-required']." ".$text['label-call_recording_date']."
\n"; } - if (strlen($call_direction) == 0) { $msg .= $text['message-required']." ".$text['label-call_direction']."
\n"; } - //if (strlen($call_recording_description) == 0) { $msg .= $text['message-required']." ".$text['label-call_recording_description']."
\n"; } - //if (strlen($call_recording_base64) == 0) { $msg .= $text['message-required']." ".$text['label-call_recording_base64']."
\n"; } - if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { - require_once "resources/header.php"; - require_once "resources/persist_form_var.php"; - echo "
\n"; - echo "
\n"; - echo $msg."
"; - echo "
\n"; - persistformvar($_POST); - echo "
\n"; - require_once "resources/footer.php"; - return; - } - - //set the domain_uuid - $_POST["domain_uuid"] = $_SESSION["domain_uuid"]; - - //add the call_recording_uuid - if (!is_uuid($_POST["call_recording_uuid"])) { - $call_recording_uuid = uuid(); - } - - //build array - $array['call_recordings'][0]['domain_uuid'] = $domain_uuid; - $array['call_recordings'][0]['call_recording_name'] = $call_recording_uuid; - $array['call_recordings'][0]['call_recording_name'] = $call_recording_name; - $array['call_recordings'][0]['call_recording_path'] = $call_recording_path; - $array['call_recordings'][0]['call_recording_length'] = $call_recording_length; - $array['call_recordings'][0]['call_recording_date'] = $call_recording_date; - $array['call_recordings'][0]['call_direction'] = $call_direction; - $array['call_recordings'][0]['call_recording_description'] = $call_recording_description; - $array['call_recordings'][0]['call_recording_base64'] = $call_recording_base64; - - //save to the data - $database = new database; - $database->app_name = 'call_recordings'; - $database->app_uuid = null; - if (strlen($call_recording_uuid) > 0) { - $database->uuid($call_recording_uuid); - } - $database->save($array); - $message = $database->message; - - //debug info - //echo "
";
-			//print_r($message);
-			//echo "
"; - //exit; - - //redirect the user - if (isset($action)) { - if ($action == "add") { - $_SESSION["message"] = $text['message-add']; - } - if ($action == "update") { - $_SESSION["message"] = $text['message-update']; - } - header('Location: call_recording_edit.php?id='.$call_recording_uuid); - return; - } - } //(is_array($_POST) && strlen($_POST["persistformvar"]) == 0) - -//pre-populate the form - if (is_array($_GET) && $_POST["persistformvar"] != "true" && is_uuid($_GET["id"])) { - $call_recording_uuid = $_GET["id"]; - $sql = "select * from v_call_recordings "; - $sql .= "where call_recording_uuid = :call_recording_uuid "; - //$sql .= "and domain_uuid = :domain_uuid "; - $parameters['call_recording_uuid'] = $call_recording_uuid; - //$parameters['domain_uuid'] = $_SESSION['domain_uuid']; - $database = new database; - $row = $database->select($sql, $parameters, 'row'); - if (is_array($row) && sizeof($row) != 0) { - $call_recording_name = $row["call_recording_name"]; - $call_recording_path = $row["call_recording_path"]; - $call_recording_length = $row["call_recording_length"]; - $call_recording_date = $row["call_recording_date"]; - $call_direction = $row["call_direction"]; - $call_recording_description = $row["call_recording_description"]; - $call_recording_base64 = $row["call_recording_base64"]; - } - unset($sql, $parameters, $row); - } - -//create token - $object = new token; - $token = $object->create($_SERVER['PHP_SELF']); - -//show the header - require_once "resources/header.php"; - -//show the content - echo "
\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo " \n"; - echo " \n"; - echo " "; - echo "
".$text['title-call_recording']."

\n"; - echo " "; - echo " "; - echo "
\n"; - echo " ".$text['label-call_recording_name']."\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo $text['description-call_recording_name']."\n"; - echo "
\n"; - echo " ".$text['label-call_recording_path']."\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo $text['description-call_recording_path']."\n"; - echo "
\n"; - echo " ".$text['label-call_recording_length']."\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo $text['description-call_recording_length']."\n"; - echo "
\n"; - echo " ".$text['label-call_recording_date']."\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo $text['description-call_recording_date']."\n"; - echo "
\n"; - echo " ".$text['label-call_direction']."\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo $text['description-call_direction']."\n"; - echo "
\n"; - echo " ".$text['label-call_recording_description']."\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo $text['description-call_recording_description']."\n"; - echo "
\n"; - if ($action == "update") { - echo " \n"; - } - echo " \n"; - echo " \n"; - echo "
"; - echo "
"; - echo "

"; - -//include the footer - require_once "resources/footer.php"; - -?>