diff --git a/code/game/magic/archived_book.dm b/code/game/magic/archived_book.dm
index 1aab354815..b042e5eae2 100644
--- a/code/game/magic/archived_book.dm
+++ b/code/game/magic/archived_book.dm
@@ -39,25 +39,46 @@ var/global/datum/book_manager/book_mgr = new()
if(!src.holder)
to_chat(src, "Only administrators may use this command.")
return
+//VOREStation Edit Start
+ var/obj/machinery/librarycomp/our_comp
+ for(var/obj/machinery/librarycomp/l in world)
+ if(istype(l, /obj/machinery/librarycomp))
+ our_comp = l
+ break
- var/isbn = tgui_input_number(usr, "ISBN number?", "Delete Book")
- if(!isbn)
+ if(!our_comp)
+ to_chat(usr, "Unable to locate a library computer to use for book deleting.")
return
- if(BOOKS_USE_SQL && config.sql_enabled)
- var/DBConnection/dbcon = new()
- dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
- if(!dbcon.IsConnected())
- tgui_alert_async(usr, "Connection to Archive has been severed. Aborting.")
- return
+ var/dat = "
Book Inventory Management\n" //
+ dat += "ADMINISTRATIVE MANAGEMENT
"
+ establish_old_db_connection()
+
+ if(!SSdbcore.IsConnected()) //CHOMP Edit
+ dat += "ERROR: Unable to contact External Archive. Please contact your system administrator for assistance."
else
- var/DBQuery/query = dbcon.NewQuery("DELETE FROM library WHERE id=[isbn]")
- if(!query.Execute())
- to_chat(usr,query.ErrorMsg())
- dbcon.Disconnect()
- else
- book_mgr.remove(isbn)
- log_admin("[usr.key] has deleted the book [isbn]")
+ dat += {"(Order book by SS13BN)
+ "
+
+ usr << browse(dat, "window=library")
+ onclose(usr, "library")
+//VOREStation Edit End
// delete a book
/datum/book_manager/proc/remove(var/id)
diff --git a/code/modules/admin/admin_verb_lists_vr.dm b/code/modules/admin/admin_verb_lists_vr.dm
index 4719c289c1..1ce3f3ade0 100644
--- a/code/modules/admin/admin_verb_lists_vr.dm
+++ b/code/modules/admin/admin_verb_lists_vr.dm
@@ -129,7 +129,8 @@ var/list/admin_verbs_admin = list(
/datum/admins/proc/view_feedback,
/client/proc/make_mentor,
/client/proc/unmake_mentor,
- /client/proc/removetickets
+ /client/proc/removetickets,
+ /client/proc/delbook
)
var/list/admin_verbs_ban = list(
diff --git a/code/modules/admin/admin_verbs_vr.dm b/code/modules/admin/admin_verbs_vr.dm
index a96217fb72..cbafb33f89 100644
--- a/code/modules/admin/admin_verbs_vr.dm
+++ b/code/modules/admin/admin_verbs_vr.dm
@@ -73,4 +73,51 @@
log_and_message_admins("removed a security ticket from the global list: \"[input]\"", usr)
else
- tgui_alert_async(usr, "The ticket list is empty.","Empty")
\ No newline at end of file
+ tgui_alert_async(usr, "The ticket list is empty.","Empty")
+
+/client/proc/delbook()
+ set name = "Delete Book"
+ set desc = "Permamently deletes a book from the database."
+ set category = "Admin"
+ if(!src.holder)
+ to_chat(src, "Only administrators may use this command.")
+ return
+
+ var/obj/machinery/librarycomp/our_comp
+ for(var/obj/machinery/librarycomp/l in world)
+ if(istype(l, /obj/machinery/librarycomp))
+ our_comp = l
+ break
+
+ if(!our_comp)
+ to_chat(usr, "Unable to locate a library computer to use for book deleting.")
+ return
+
+ var/dat = "Book Inventory Management\n"
+ dat += "ADMINISTRATIVE MANAGEMENT
"
+ establish_old_db_connection()
+
+ if(!SSdbcore.IsConnected())
+ dat += "ERROR: Unable to contact External Archive. Please contact your system administrator for assistance."
+ else
+ dat += {"(Order book by SS13BN)
+ "
+
+ usr << browse(dat, "window=library")
+ onclose(usr, "library")
diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm
index ad915f7f9d..5e24efbcf2 100644
--- a/code/modules/library/lib_machines.dm
+++ b/code/modules/library/lib_machines.dm
@@ -308,6 +308,43 @@
user << browse(dat, "window=library")
onclose(user, "library")
+//VOREStation Addition Start
+/obj/machinery/librarycomp/attack_ghost(mob/user)
+
+ var/show_admin_options = check_rights(R_ADMIN, show_msg = FALSE)
+ if(!show_admin_options)
+ . = ..()
+
+ else
+ usr.set_machine(src)
+ var/dat = "Book Inventory Management\n" //
+
+ dat += "ADMINISTRATIVE MANAGEMENT
"
+ establish_old_db_connection()
+
+ if(!SSdbcore.IsConnected())
+ dat += "ERROR: Unable to contact External Archive. Please contact your system administrator for assistance."
+ else
+ dat += {"(Order book by SS13BN)
+ "
+ dat += "
(Return to main menu)
"
+
+ user << browse(dat, "window=library")
+ onclose(user, "library")
+//VOREStation Addition End
+
/obj/machinery/librarycomp/emag_act(var/remaining_charges, var/mob/user)
if (src.density && !src.emagged)
src.emagged = 1
@@ -567,4 +604,4 @@
b.icon_state = "book[rand(1,7)]"
qdel(O)
else
- ..()
\ No newline at end of file
+ ..()
diff --git a/maps/groundbase/gb-centcomm.dmm b/maps/groundbase/gb-centcomm.dmm
index 2e9ff9cff0..89864b7f4f 100644
--- a/maps/groundbase/gb-centcomm.dmm
+++ b/maps/groundbase/gb-centcomm.dmm
@@ -13678,6 +13678,7 @@
/area/centcom/terminal)
"SK" = (
/obj/structure/table/reinforced,
+/obj/machinery/librarycomp,
/turf/simulated/floor/tiled,
/area/centcom/control)
"SL" = (
diff --git a/maps/stellar_delight/ship_centcom.dmm b/maps/stellar_delight/ship_centcom.dmm
index 18b7e0ce50..54048e59db 100644
--- a/maps/stellar_delight/ship_centcom.dmm
+++ b/maps/stellar_delight/ship_centcom.dmm
@@ -4501,6 +4501,7 @@
/area/shuttle/ccboat)
"qB" = (
/obj/structure/table/reinforced,
+/obj/machinery/librarycomp,
/turf/simulated/floor/tiled,
/area/centcom/control)
"qE" = (
diff --git a/maps/tether/submaps/tether_centcom.dmm b/maps/tether/submaps/tether_centcom.dmm
index 292c438f30..ef54e274f3 100644
--- a/maps/tether/submaps/tether_centcom.dmm
+++ b/maps/tether/submaps/tether_centcom.dmm
@@ -7043,6 +7043,7 @@
/area/centcom/medical)
"DJ" = (
/obj/structure/table/reinforced,
+/obj/machinery/librarycomp,
/turf/simulated/floor/tiled,
/area/centcom/control)
"DK" = (