Skip to content
Snippets Groups Projects
Commit 2f93945f authored by Tim Clark's avatar Tim Clark
Browse files

Adds auto remove on junk items a week after they are taken, and some minor ui changes

parent ad993cf1
No related branches found
No related tags found
No related merge requests found
......@@ -116,6 +116,9 @@ if ($session->loggedin && $admin && (isset($_REQUEST['update']) || isset($_REQUE
}
}
// Remove old taken junk
$DB->Query("DELETE FROM inventory WHERE (taken_on + interval'7 days') < now()");
if ($mode == 'list'){
// Get junk from database, and give admin the full list
......
......@@ -8,15 +8,15 @@
<ul>
{foreach from=$category item=item}
<li>
{$item.title}: {$item.description}
<strong>{$item.title}:</strong> {$item.description}
{if $item.donated_by != null}
<br /><strong>Donated by:</strong> {$item.donated_by}
{/if}
{if $status == 'requested'}
<br /><small>Requested by {$item.requested_by} on {$item.requested_on|date_format:"%e %b %Y"}</small>
{elseif $status == "taken"}
<br /><small>Taken by {$item.requested_by} on {$item.taken_on|date_format:"%e %b %Y"}</small>
{/if}
{if $item.donated_by != null}
<br /><strong>Donated by:</strong>{$item.donated_by}
{/if}
{if $session->loggedin}
{if $admin || $item.status=='junk'}
<form action="{$url}" method="POST">
......@@ -42,13 +42,13 @@
</form>
{/if}
{/if}
</li>
{if $admin && $item.requested_by==null}
<div class="edit">
<a href="{$componentpath}/Edit/{$item.id}">Edit</a>
<div class="clear"></div>
</div>
{/if}
</li>
{/foreach}
</ul>
{/foreach}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment