diff --git a/client_document_tags_modal.php b/client_document_tags_modal.php
deleted file mode 100644
index f985f055..00000000
--- a/client_document_tags_modal.php
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/database_updates.php b/database_updates.php
index 88a4a0d6..d3d2c6dd 100644
--- a/database_updates.php
+++ b/database_updates.php
@@ -165,6 +165,13 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
if(CURRENT_DATABASE_VERSION == '0.0.5'){
// Insert queries here required to update to DB version 0.0.6
+ mysqli_query($mysqli, "DROP TABLE `documents_tagged`;");
+ mysqli_query($mysqli, "DROP TABLE `document_tags`;");
+ }
+
+ if(CURRENT_DATABASE_VERSION == '0.0.6'){
+ // Insert queries here required to update to DB version 0.0.7
+
// ALTER queries.....
// Then, update the database to the next sequential version
diff --git a/database_version.php b/database_version.php
index 48be6668..274a78ae 100644
--- a/database_version.php
+++ b/database_version.php
@@ -5,4 +5,4 @@
* It is used in conjunction with database_updates.php
*/
-DEFINE("LATEST_DATABASE_VERSION", "0.0.5");
\ No newline at end of file
+DEFINE("LATEST_DATABASE_VERSION", "0.0.6");
\ No newline at end of file
diff --git a/post.php b/post.php
index 6842891b..fab2d4c6 100644
--- a/post.php
+++ b/post.php
@@ -6908,7 +6908,6 @@ if(isset($_POST['add_document'])){
$client_id = intval($_POST['client_id']);
$name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])));
- $tags_ids = $_POST['tags_ids'];
$content = trim(mysqli_real_escape_string($mysqli,$purifier->purify(html_entity_decode($_POST['content']))));
$content_raw = trim(mysqli_real_escape_string($mysqli, strip_tags($_POST['name'] . " " . str_replace("<", " <", $_POST['content']))));
// Content Raw is used for FULL INDEX searching. Adding a space before HTML tags to allow spaces between newlines, bulletpoints, etc. for searching.
@@ -6922,14 +6921,6 @@ if(isset($_POST['add_document'])){
// Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Document', log_action = 'Create', log_description = 'Created $name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = '$client_id', company_id = $session_company_id, log_user_id = $session_user_id");
- // Add tags
- foreach($tags_ids as $tag_id) {
- $tag_id = intval($tag_id);
- if ($tag_id > 0) {
- mysqli_query($mysqli, "INSERT INTO documents_tagged SET document_id = '$document_id', tag_id = '$tag_id'");
- }
- }
-
$_SESSION['alert_message'] = "Document added";
header("Location: " . $_SERVER["HTTP_REFERER"]);
@@ -6953,7 +6944,6 @@ if(isset($_POST['edit_document'])){
$document_id = intval($_POST['document_id']);
$name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])));
- $tags_ids = $_POST['tags_ids'];
$content = trim(mysqli_real_escape_string($mysqli,$purifier->purify(html_entity_decode($_POST['content']))));
$content_raw = trim(mysqli_real_escape_string($mysqli, strip_tags($_POST['name'] . " " . str_replace("<", " <", $_POST['content']))));
// Content Raw is used for FULL INDEX searching. Adding a space before HTML tags to allow spaces between newlines, bulletpoints, etc. for searching.
@@ -6966,16 +6956,6 @@ if(isset($_POST['edit_document'])){
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Document', log_action = 'Modify', log_description = '$name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id, company_id = $session_company_id");
- // Remove any old tags
- mysqli_query($mysqli, "DELETE FROM documents_tagged WHERE document_id = $document_id");
-
- // Add tags
- foreach($tags_ids as $tag_id) {
- $tag_id = intval($tag_id);
- if ($tag_id > 0) {
- mysqli_query($mysqli, "INSERT INTO documents_tagged SET document_id = '$document_id', tag_id = '$tag_id'");
- }
- }
$_SESSION['alert_message'] = "Document updated";
@@ -6996,9 +6976,6 @@ if(isset($_GET['delete_document'])){
mysqli_query($mysqli,"DELETE FROM documents WHERE document_id = $document_id AND company_id = $session_company_id");
- // Delete the tag associations to documents
- mysqli_query($mysqli, "DELETE FROM documents_tagged WHERE document_id = '$document_id'");
-
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Document', log_action = 'Delete', log_description = '$document_id', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id, company_id = $session_company_id");
@@ -7087,65 +7064,6 @@ if(isset($_GET['delete_folder'])){
}
-if (isset($_POST['add_document_tag'])) {
-
- if($session_user_role == 1){
- $_SESSION['alert_type'] = "danger";
- $_SESSION['alert_message'] = WORDING_ROLECHECK_FAILED;
- header("Location: " . $_SERVER["HTTP_REFERER"]);
- exit();
- }
-
- $client_id = intval($_POST['client_id']);
- $tag_name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['tag_name'])));
-
- mysqli_query($mysqli,"INSERT INTO document_tags SET client_id = '$client_id', tag_name = '$tag_name'");
-
- $_SESSION['alert_message'] = "Document tag added";
- header("Location: " . $_SERVER["HTTP_REFERER"]);
-}
-
-if (isset($_POST['delete_document_tag'])) {
-
- if($session_user_role != 3){
- $_SESSION['alert_type'] = "danger";
- $_SESSION['alert_message'] = WORDING_ROLECHECK_FAILED;
- header("Location: " . $_SERVER["HTTP_REFERER"]);
- exit();
- }
-
- $tag_id = intval($_POST['tag_id']);
-
- // Delete the tag ID
- mysqli_query($mysqli, "DELETE FROM document_tags WHERE tag_id = '$tag_id'");
-
- // Delete the associations to documents
- mysqli_query($mysqli, "DELETE FROM documents_tagged WHERE tag_id = '$tag_id'");
-
- $_SESSION['alert_message'] = "Document tag deleted";
- header("Location: " . $_SERVER["HTTP_REFERER"]);
-}
-
-if (isset($_POST['rename_document_tag'])) {
-
- if($session_user_role == 1){
- $_SESSION['alert_type'] = "danger";
- $_SESSION['alert_message'] = WORDING_ROLECHECK_FAILED;
- header("Location: " . $_SERVER["HTTP_REFERER"]);
- exit();
- }
-
- $tag_id = intval($_POST['tag_id']);
- $tag_new_name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['tag_new_name'])));
-
- // Rename tag in db
- mysqli_query($mysqli, "UPDATE document_tags SET tag_name = '$tag_new_name' WHERE tag_id = '$tag_id'");
-
- $_SESSION['alert_message'] = "Document tag updated";
- header("Location: " . $_SERVER["HTTP_REFERER"]);
-
-}
-
if(isset($_GET['deactivate_shared_item'])){
if($session_user_role != 3){
$_SESSION['alert_type'] = "danger";