Commit 149c491d authored by Daniel Messer's avatar Daniel Messer

Initial GitLab commit.

parents
# Maniphestopheles 2.0
## Changelog & Journal
*Note: All dates are DD/MM/YYYY in format.*
All notable changes to this project will be documented in this file.
## Journal
#### Journal Entry 20/03/2018
I removed the user account and user tracking features as there was some worry over whether or not this was a security risk. It's not, but it's just as easy to remove the feature as it is to argue over it. After speaking with some other folks, they agreed that the inclusion of a user name wasn't all that important. The database has been updated to reflect this, though I'm holding the user account table for a few days just in case I run into a bug and need the data to track it down. Some files have been moved to the archive for any bug tracking I might need to do. Eventually that stuff will be deleted.
#### Journal Entry 01/02/2018
More code clean up and link fixes. Things route to index.php, the inbound login page, rather than the non-existent index.html. I've also done a little fiddling with hold routing slips both in look and feel and the method used to generate them. They should look a bit closer to the standard hold routing slips Polaris generates. Along with that, they live in their own directory and can be obtained through new links in sidebarnav.html. That way these slips could be printed after, or at some other time during, the inbound processing.
Finally, I've added another link in sidebarnav.html that take a user to the temp directory where they can get the bin processing list. That way, if something goes sideways, they can obtain that list and feed it to Polaris check in via the Staff Client. Or they can use it to verify items in the bin. Either way, it's available to them.
#### Journal Entry 18/01/2018
I did a bit of code clean up here and there before heading out into the field yesterday to run tests on the system. I'm pleased to report that I ran almost 100 items, real-world circulating items, through inbound and it worked perfectly! As I sorted through the items, I saw a need to allow for the printing of hold-routing slips. I wanted that to be an optional feature so it's a button offered on the post-processing inbound screen. The hold-routing slips open in a browser and can be printed to a receipt printer from there.
#### Journal Entry 11/01/2018
There's now a login form for processing inbound items. This not only provides for the transfer of data across forms, but also builds a structure for getting information from the database, using that to assign variables in PHP, which are then passed along to sipcheckin.py for use. In this case, I've update the branches database to include a given SIP port for the branch, which is used when connecting to the SIP server. The port gets called from the database based on what the user selected when they logged in, and that'll inform the SIP server where the items are being checked in, and it can process them accordingly.
There's a new index that's PHP instead of HTML. That's also the inbound login form. I may change that later but, for now, it'll work. I need to do a bunch of link clean up throughout because of this, but I'll hold off until I hammer down on some ideas for site structure.
#### Journal Entry 10/01/2018
After some time spent learning a bit of Python and the SIP2 protocol, I'm happy to announce that Maniphestopheles now processes bins using SIP2! Before, the system generated a list of items that were to be run through the Polaris check in workform in the Staff Client. While that functionality remains in the code, I've commented it out and updated inboundresult.php to use a Python based system for checking in and processing items. Initial testing looks good, but there are some plumbing needs I'll have to attend to in order to make this work well. More to come soon!
#### Journal Entry 19/05/2017
Aside from bug testing, I'm calling it today -- **Maniphestopheles 2.0 is done!**
I've added user and branch functionality along with the ability to manage users and branches within the browser. Along with that, I've cleaned up some of the code and updated the titles on Admin pages so browser tabs are populated with what's going on with the display. The inbound page has a reset button to clear the form after processing. Finally, the system remembers who you are when processing outbound.
#### Journal Entry 18/05/2017
Modifying and removing users is now a thing, along with a central page for administrative tasks. I should finish similar code for modifying and removing branches today or tomorrow.
#### Journal Entry 17/05/2017
Added the functionality for creating a new user. Error handling is in place so that if a user is created with a username in the database, an error page will be thrown. As always, trying to keep errors and successes as friendly and as useful as possible.
**ADDENDUM @ 14:26**
Got a lot done today, more than I figured. I've added forms to create users and branches and I've updated existing proceedures, mostly outbound, to call data from the database. Dropdown lists are now populated from the database. When processing outbound, a user is first asked for their username and branch (from dropdowns). These get stored as $\_SESSION data and are retained until the user closes the browser.
#### Journal Entry 16/05/2017
This is the Changelog and Journal for Maniphestopheles 2.0, forked from the original code today. To keep the new features completely separate from the running code, I wanted to created a new repository. With that, I'll start this changelog and journal anew with the road to 2.0.
Throughout today I created a new database for users and began working on the basic functionality needed to incorporate a user base into the code. Other parts of the database will require modification, but I'll handle that when it's time.
## Changelog
[TO DO]
* Universal login and user tracking **WON'T DO**
* Better and more error handling
* Database handling of the management of holdslips
* Database handling of the management of bin logs
* List the bin number on the post-processing screen **COMPLETE**
* Link cleanup site wide **COMPLETE, I THINK**
[2.1.5] - **Let's dump user accounts.**
**Removed:** User account features
**Modified:** Admin features re: above and also clean up
[2.1.4] - **Let's label things to make them clearer.**
**Added:** Bin number on the post-processing screen
**Modified:** Changed the file name format for hold slips to make it easier to find them by branch abbreviation.
**Modified:** Removed the version 1.x stuff from this CHANGELOG. See the archive folder for older stuff.
[2.1.3] - **Let's clean things up and provide access to things we've done.**
**Fixed:** index.html links corrected to index.php
**Modified:** Site wide link and code cleanup
**Added:** Link to temp directory so users can get recently processed bins.
**Added:** Link to temp/holdslips directory so users can get recently generated hold slips.
[2.1.2] - **Let's offer hold routing slips.**
**Added:** Updated the SIP2 checkin module to track items trapped as hold routes and then offer a way to print hold slips for shipping.
**Fixed:** index.php title is correct.
[2.1.1] - **Let's make a better workflow.**
**Added:** New index, inbound, and inboundresult pages to allow users to select their branches, which is passed on to the SIP2 checkin module.
**Added:** Updated branches database to include port numbers *Note: Will do a database dump soon.*
**Added:** Inbound processing pulls branch code and port information from the database
**Added:** sipcheckin.py gets branch and port info from inboundresult.php
**Modified:** Bunch of code clean up in sipcheckin.py, along with moving things around to make more sense
**Modified:** Updated both sidebarnav.html files to use the new index.php linkage
[2.1.0] - **Let's use SIP2 instead.**
**Added:** A check in module written in Python that leverages SIP2 processing
**Modified:** inboundresult.php to use the SIP2 check in module
[2.0.0] - **Let's make something even better than before.**
**Added:** Reset button to clear inbound form
**Added:** Session data to remember the user and branch while processing outbound
**Added:** Tweak to outbound workflow to make the above feature possible
**Modified:** All admin pages now have meaningful titles
MIT License
Copyright (c) 2017 Daniel Messer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# Maniphestopheles
## An attempt at tote manifesting for Polaris ILS
### About
Maniphesopheles is a simple tote manifesting system for use with [Polaris ILS](https://www.iii.com/products/polaris-ils/), though it could be targeted toward other ILS solutions and products. As an automated materials handling (AMH) solution, it aims to optimize the processing involved with shipping and receiving materials through a library's multi-branch courier system. In short, rather than dealing items on the individual level, Maniphestopheles deals with bins full of items. Its goals:
* Speed up the processing of items shipped through the courier by focusing on the bins, not the items
* Provide a fast way to processing entire bins of library materials by using the manifest to run the contents through Polaris check-in
* Offer a new way to track items in courier, by providing up to date information on the location of an item at the branch, the bin that item is in, and the time that item was processed into that bin
* Offer a new way to historically track and locate items over long periods of time
* Offer a way to ease the task of finding a misplaced or mis-shipped item by tracking where it was last seen
In its initial proof-of-concept stage, Maniphestopheles was written in [AutoHotkey](https://autohotkey.com/) with a file based storage system for retaining data. After verifying the proof-of-concept, I'm rewriting the app in PHP with a MariaDB backend database for data retention, lookup, and statistical use.
Any questions, feel free to contact [Daniel Messer](mailto:cyberpunklibrarian@protonmail.com).
---
### Screenshots
![Inbound Branch Selection](http://cyberpunklibrarian.com/wp-content/uploads/2018/05/manishot01.png)
![Inbound Bin Check In](http://cyberpunklibrarian.com/wp-content/uploads/2018/05/manishot02.png)
![Outbound](http://cyberpunklibrarian.com/wp-content/uploads/2018/05/manishot03.png)
<!DOCTYPE html>
<!-- Special thanks to quackit.com for this HTML template -->
<!-- Sure I can write this myself, but why reinvent the wheel? -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Maniphestopheles - Add Items to Bin</title>
<link rel="stylesheet" type="text/css" href="styles/stylesheet.css">
<script src="http://www.w3schools.com/lib/w3data.js"></script>
</head>
<body>
<header id="header">
<div class="innertube">
<a href="index.php"><img src="images/manny-header.png" style="float:left; padding: 5px 15px 5px 5px;" height="70" border="0"></a>
<h1>Maniphestopheles</h1>
<h3>Simple tote manifesting for Polaris ILS</h3>
</div>
</header>
<div id="wrapper">
<main>
<div id="content">
<div class="innertube">
<h1>Add Items to Bin</h1>
<form action="outboundadd.php" method="post">
<p>
Add items into the bin:<br>
<textarea id="itemlistadd" name="itemlistadd" rows="30" cols="25" autofocus></textarea>
</p>
<p>
<label for="bin">Bin Number:</label>
<input type="text" name="bin" id="bin">
</p>
<input type="submit" value="Submit">
</form>
</div>
</div>
</main>
<nav id="nav">
<div class="innertube">
<div w3-include-html="sidebarnav.html"></div>
<script>
w3IncludeHTML();
</script>
</div>
</nav>
</div>
<footer id="footer">
<div class="innertube">
<p>Maniphestopheles: Manifesting without complications</p>
</div>
</footer>
</body>
</html>
<?php
$password = "library";
?>
<?php
include '../creds.php';
$branchfull = $_POST['branchfull'];
$branchshort = $_POST['branchshort'];
$branchcode = $_POST['branchcode'];
$location = $_POST['location'];
// Check to see if branch exists
$checkbranch = mysqli_query($conn,"SELECT * FROM branches WHERE branchshort = '$branchshort'");
$num_rows = mysqli_num_rows($checkbranch);
if ($num_rows > 0) {
header("Location: error-branchexists.html"); // Branch exists - send to error page
exit;
}
mysqli_query($conn,"INSERT INTO branches (recordID, branchfull, branchshort, branchcode, location) VALUES (NULL,'$branchfull','$branchshort','$branchcode','$location')");
mysqli_close($conn);
header("Location: success-branchadded.html");
?>
<!DOCTYPE html>
<!-- Special thanks to quackit.com for this HTML template -->
<!-- Sure I can write this myself, but why reinvent the wheel? -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Maniphestopheles - Add Branch</title>
<link rel="stylesheet" type="text/css" href="../styles/stylesheet.css">
<script src="http://www.w3schools.com/lib/w3data.js"></script>
</head>
<body>
<?php include 'access.php'; ?>
<header id="header">
<div class="innertube">
<a href="../index.php"><img src="../images/manny-header.png" style="float:left; padding: 5px 15px 5px 5px;" height="70" border="0"></a>
<h1>Maniphestopheles</h1>
<h3>Simple tote manifesting for Polaris ILS</h3>
</div>
</header>
<div id="wrapper">
<main>
<div id="content">
<div class="innertube">
<h1>Admin &ndash; Add Branch</h1>
<hr>
<?php
// Check for password validity
if (isset($_POST["password"]) && ($_POST["password"]=="$password")) {
?>
<!-- BEGIN Password protected HTML -->
<form action="addbranch.php" method="post">
<p>
<label for="branchfull">Full Branch Name:</label>
<input type="text" name="branchfull" id="branchfull"><br><br>
<label for="branchshort">Branch Abbreviation:</label>
<input type="text" name="branchshort" id="branchshort"><br><br>
<label for="branchcode">Polaris Branch Code:</label>
<input type="text" name="branchcode" id="branchcode"><br><br>
<label for="location">Location (Google Maps):</label>
<input type="text" name="location" id="location"><br><br>
</p>
<input type="submit" value="Submit">
</form>
<!-- END Password protected HTML -->
<?php
}
else
{
// Wrong password or no password entered display this message
if (isset($_POST['password']) || $password == "") {
print "<p align=\"center\"><font color=\"red\"><b>Incorrect Password</b><br>Try again.</font></p>";}
print "<form method=\"post\"><p align=\"center\">Administrative password<br>";
print "<input name=\"password\" type=\"password\" size=\"25\" maxlength=\"10\"><input value=\"Login\" type=\"submit\"></p></form>";
}
?>
<BR>
</div>
</div>
</main>
<nav id="nav">
<div class="innertube">
<div w3-include-html="adminnav.html"></div>
<script>
w3IncludeHTML();
</script>
</div>
</nav>
</div>
<footer id="footer">
<div class="innertube">
<p>Maniphestopheles: Manifesting without complications</p>
</div>
</footer>
</body>
</html>
<!DOCTYPE html>
<!-- Special thanks to quackit.com for this HTML template -->
<!-- Sure I can write this myself, but why reinvent the wheel? -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Maniphestopheles - Modify Branch</title>
<link rel="stylesheet" type="text/css" href="../styles/stylesheet.css">
<script src="http://www.w3schools.com/lib/w3data.js"></script>
</head>
<body>
<?php include 'access.php'; ?>
<header id="header">
<div class="innertube">
<a href="../index.php"><img src="../images/manny-header.png" style="float:left; padding: 5px 15px 5px 5px;" height="70" border="0"></a>
<h1>Maniphestopheles</h1>
<h3>Simple tote manifesting for Polaris ILS</h3>
</div>
</header>
<div id="wrapper">
<main>
<div id="content">
<div class="innertube">
<h1>Admin &ndash; Modify Branch</h1>
<hr>
<?php
// Check for password validity
if (isset($_POST["password"]) && ($_POST["password"]=="$password")) {
?>
<!-- BEGIN Password protected HTML -->
<form action="modbranch.php" method="post">
<p>
<label for="branchab">Branch abbreviation:</label>
<input type="text" name="branchab" id="branchab" autofocus><br><br>
</p>
<input type="submit" value="Submit">
</form>
<!-- END Password protected HTML -->
<?php
}
else
{
// Wrong password or no password entered display this message
if (isset($_POST['password']) || $password == "") {
print "<p align=\"center\"><font color=\"red\"><b>Incorrect Password</b><br>Try again.</font></p>";}
print "<form method=\"post\"><p align=\"center\">Administrative password<br>";
print "<input name=\"password\" type=\"password\" size=\"25\" maxlength=\"10\" autofocus><input value=\"Login\" type=\"submit\"></p></form>";
}
?>
<BR>
</div>
</div>
</main>
<nav id="nav">
<div class="innertube">
<div w3-include-html="adminnav.html"></div>
<script>
w3IncludeHTML();
</script>
</div>
</nav>
</div>
<footer id="footer">
<div class="innertube">
<p>Maniphestopheles: Manifesting without complications</p>
</div>
</footer>
</body>
</html>
<!DOCTYPE html>
<!-- Special thanks to quackit.com for this HTML template -->
<!-- Sure I can write this myself, but why reinvent the wheel? -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Maniphestopheles - Remove Branch</title>
<link rel="stylesheet" type="text/css" href="../styles/stylesheet.css">
<script src="http://www.w3schools.com/lib/w3data.js"></script>
</head>
<body>
<?php include 'access.php'; ?>
<header id="header">
<div class="innertube">
<a href="../index.php"><img src="../images/manny-header.png" style="float:left; padding: 5px 15px 5px 5px;" height="70" border="0"></a>
<h1>Maniphestopheles</h1>
<h3>Simple tote manifesting for Polaris ILS</h3>
</div>
</header>
<div id="wrapper">
<main>
<div id="content">
<div class="innertube">
<h1>Admin &ndash; Remove Branch</h1>
<hr>
<?php
// Check for password validity
if (isset($_POST["password"]) && ($_POST["password"]=="$password")) {
?>
<!-- BEGIN Password protected HTML -->
<form action="removebranch.php" method="post">
<p>
<label for="branchab">Branch Abbreviation:</label>
<input type="text" name="branchab" id="branchab" autofocus><br><br>
</p>
<input type="submit" value="Submit">
</form>
<!-- END Password protected HTML -->
<?php
}
else
{
// Wrong password or no password entered display this message
if (isset($_POST['password']) || $password == "") {
print "<p align=\"center\"><font color=\"red\"><b>Incorrect Password</b><br>Try again.</font></p>";}
print "<form method=\"post\"><p align=\"center\">Administrative password<br>";
print "<input name=\"password\" type=\"password\" size=\"25\" maxlength=\"10\" autofocus><input value=\"Login\" type=\"submit\"></p></form>";
}
?>
<BR>
</div>
</div>
</main>
<nav id="nav">
<div class="innertube">
<div w3-include-html="adminnav.html"></div>
<script>
w3IncludeHTML();
</script>
</div>
</nav>
</div>
<footer id="footer">
<div class="innertube">
<p>Maniphestopheles: Manifesting without complications</p>
</div>
</footer>
</body>
</html>
<!DOCTYPE html>
<!-- Special thanks to quackit.com for this HTML template -->
<!-- Sure I can write this myself, but why reinvent the wheel? -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Maniphestopheles - View Branches</title>
<link rel="stylesheet" type="text/css" href="../styles/stylesheet.css">
<script src="http://www.w3schools.com/lib/w3data.js"></script>
</head>
<body>
<header id="header">
<div class="innertube">
<a href="index.php"><img src="../images/manny-header.png" style="float:left; padding: 5px 15px 5px 5px;" height="70" border="0"></a>
<h1>Maniphestopheles</h1>
<h3>Simple tote manifesting for Polaris ILS</h3>
</div>
</header>
<div id="wrapper">
<main>
<div id="content">
<div class="innertube">
<h1>View Branches</h1>
<table class="tg">
<tr>
<th><strong>Branch Full Name</strong></th>
<th><strong>Branch Abbreviation</strong></th>
<th><strong>Branch Code</strong></th>
<th><strong>Location</strong></th>
</tr>
<?php
include '../creds.php';
$result = mysqli_query($conn,"SELECT branchfull, branchshort, branchcode, location FROM branches WHERE branchshort LIKE '$branchab%' ORDER BY branchfull");
while($row = mysqli_fetch_array($result))
{
$row_branchfull = $row['branchfull'];
$row_branchshort = $row['branchshort'];
$row_branchcode = $row['branchcode'];
$row_location = $row['location'];
echo "<tr>";
echo "<td>";
echo $row_branchfull;
echo "</td>";
echo "<td>";
echo $row_branchshort;
echo "</td>";
echo "<td>";
echo $row_branchcode;
echo "</td>";
echo "<td>";
echo $row_location;
echo "</td>";
echo "</tr>";
}
// Close database connection.
mysqli_close($conn);
?>
</table>
</div>
</div>
</main>
<nav id="nav">
<div class="innertube">
<div w3-include-html="adminnav.html"></div>
<script>
w3IncludeHTML();
</script>
</div>
</nav>
</div>
<footer id="footer">
<div class="innertube">
<p>Maniphestopheles: Manifesting without complications</p>
</div>
</footer>
</body>
</html>
<h3>Administration</h3>
<ul>
<strong>Primary Admin</strong><br>
<li><a href="index.php">Main Admin</a></li>
<hr>
<strong>Manage Branches</strong><br>
<li><a href="admin-viewbranches.php">View Branches</a></li>
<li><a href="admin-addbranch.php">Add Branch</a></li>
<li><a href="admin-modbranch.php">Modify Branch</a></li>
<li><a href="admin-removebranch.php">Remove Branch</a></li>
</ul>
<!DOCTYPE html>
<!-- Special thanks to quackit.com for this HTML template -->
<!-- Sure I can write this myself, but why reinvent the wheel? -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Maniphestopheles - Error</title>
<link rel="stylesheet" type="text/css" href="../styles/stylesheet.css">
<script src="http://www.w3schools.com/lib/w3data.js"></script>
</head>
<body>
<header id="header">
<div class="innertube">
<a href="../index.php"><img src="../images/manny-header.png" style="float:left; padding: 5px 15px 5px 5px;" height="70" border="0"></a>
<h1>Maniphestopheles</h1>
<h3>Simple tote manifesting for Polaris ILS</h3>
</div>
</header>
<div id="wrapper">
<main>
<div id="content">
<div class="innertube">
<h1>Error &ndash; Branch Exists</h1>
<p>
<strong>Options:</strong><br>
<a href="admin-managebranches.php">Manage branches</a> | <a href="admin.html">Admin</a></p>
</div>
</div>
</main>
<nav id="nav">
<div class="innertube">
<div w3-include-html="adminnav.html"></div>
<script>
w3IncludeHTML();
</script>
</div>
</nav>
</div>
<footer id="footer">
<div class="innertube">
<p>Maniphestopheles: Manifesting without complications</p>
</div>
</footer>
</body>
</html>