UI tweaks

stock_management
João Andrade 4 years ago
parent 8964202a1a
commit 0e2c2c17a2

@ -10,8 +10,6 @@
"itemid": "Item ID", "itemid": "Item ID",
"id": "ID", "id": "ID",
"Edit Item": "Edit Item", "Edit Item": "Edit Item",
"Adding stock": "Adding stock",
"adding stock": "Adding stock for {item}", "adding stock": "Adding stock for {item}",
"Removing stock": "Removing stock",
"removing stock": "Removing stock from {item}" "removing stock": "Removing stock from {item}"
} }

@ -32,25 +32,25 @@ if ($VARS['order'][0]['dir'] == 'asc') {
$sortby = "ASC"; $sortby = "ASC";
} }
switch ($VARS['order'][0]['column']) { switch ($VARS['order'][0]['column']) {
case 2: case 1:
$order = ["name" => $sortby]; $order = ["name" => $sortby];
break; break;
case 3: case 2:
$order = ["catname" => $sortby]; $order = ["catname" => $sortby];
break; break;
case 4: case 3:
$order = ["locname" => $sortby]; $order = ["locname" => $sortby];
break; break;
case 5: case 4:
$order = ["code1" => $sortby]; $order = ["code1" => $sortby];
break; break;
case 6: case 5:
$order = ["code2" => $sortby]; $order = ["code2" => $sortby];
break; break;
case 7: case 6:
$order = ["qty" => $sortby]; $order = ["qty" => $sortby];
break; break;
case 8: case 7:
$order = ["want" => $sortby]; $order = ["want" => $sortby];
break; break;
// Note: We're not going to sort by assigned user. It's too hard. Maybe later. // Note: We're not going to sort by assigned user. It's too hard. Maybe later.

@ -24,19 +24,6 @@ define("PAGES", [
"static/js/items.js" "static/js/items.js"
], ],
], ],
"locations" => [
"title" => "Locations",
"navbar" => true,
"icon" => "fas fa-map-marker",
"styles" => [
"static/css/datatables.min.css",
"static/css/tables.css"
],
"scripts" => [
"static/js/datatables.min.js",
"static/js/locations.js"
],
],
"categories" => [ "categories" => [
"title" => "Categories", "title" => "Categories",
"navbar" => true, "navbar" => true,
@ -50,6 +37,19 @@ define("PAGES", [
"static/js/categories.js" "static/js/categories.js"
], ],
], ],
"locations" => [
"title" => "Locations",
"navbar" => true,
"icon" => "fas fa-map-marker",
"styles" => [
"static/css/datatables.min.css",
"static/css/tables.css"
],
"scripts" => [
"static/js/datatables.min.js",
"static/js/locations.js"
],
],
"item" => [ "item" => [
"title" => "Item", "title" => "Item",
"navbar" => false "navbar" => false

@ -14,9 +14,9 @@ redirectifnotloggedin();
<thead> <thead>
<tr> <tr>
<th data-priority="0"></th> <th data-priority="0"></th>
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
<th data-priority="1"><i class="fas fa-pallet hidden-sm"></i> <?php $Strings->get('category'); ?></th> <th data-priority="1"><i class="fas fa-pallet hidden-sm"></i> <?php $Strings->get('category'); ?></th>
<th data-priority="2"><i class="fas fa-hashtag hidden-sm"></i> <?php $Strings->get('item count'); ?></th> <th data-priority="2"><i class="fas fa-hashtag hidden-sm"></i> <?php $Strings->get('item count'); ?></th>
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -30,11 +30,11 @@ redirectifnotloggedin();
?> ?>
<tr> <tr>
<td></td> <td></td>
<td>
<a class="btn btn-primary btn-sm" href="app.php?page=editcat&id=<?php echo $cat['catid']; ?>"><i class="fas fa-edit"></i> <?php $Strings->get("edit"); ?></a>
</td>
<td><?php echo $cat['catname']; ?></td> <td><?php echo $cat['catname']; ?></td>
<td><?php echo $itemcount; ?></td> <td><?php echo $itemcount; ?></td>
<td>
<a class="btn btn-primary btn-sm" href="app.php?page=editcat&id=<?php echo $cat['catid']; ?>"><i class="fas fa-edit"></i> <?php $Strings->get("edit"); ?></a>
</td>
</tr> </tr>
<?php <?php
} }
@ -43,9 +43,9 @@ redirectifnotloggedin();
<tfoot> <tfoot>
<tr> <tr>
<th data-priority="0"></th> <th data-priority="0"></th>
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
<th data-priority="1"><i class="fas fa-pallet hidden-sm"></i> <?php $Strings->get('category'); ?></th> <th data-priority="1"><i class="fas fa-pallet hidden-sm"></i> <?php $Strings->get('category'); ?></th>
<th data-priority="2"><i class="fas fa-hashtag hidden-sm"></i> <?php $Strings->get('item count'); ?></th> <th data-priority="2"><i class="fas fa-hashtag hidden-sm"></i> <?php $Strings->get('item count'); ?></th>
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>

@ -24,7 +24,6 @@ redirectifnotloggedin();
<thead> <thead>
<tr> <tr>
<th data-priority="0"></th> <th data-priority="0"></th>
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
<th data-priority="1"><i class="fas fa-fw fa-box d-none d-md-inline"></i> <?php $Strings->get('name'); ?></th> <th data-priority="1"><i class="fas fa-fw fa-box d-none d-md-inline"></i> <?php $Strings->get('name'); ?></th>
<th data-priority="7"><i class="fas fa-fw fa-pallet d-none d-md-inline"></i> <?php $Strings->get('category'); ?></th> <th data-priority="7"><i class="fas fa-fw fa-pallet d-none d-md-inline"></i> <?php $Strings->get('category'); ?></th>
<th data-priority="4"><i class="fas fa-fw fa-map-marker d-none d-md-inline"></i> <?php $Strings->get('location'); ?></th> <th data-priority="4"><i class="fas fa-fw fa-map-marker d-none d-md-inline"></i> <?php $Strings->get('location'); ?></th>
@ -33,6 +32,7 @@ redirectifnotloggedin();
<th data-priority="3"><i class="fas fa-fw fa-hashtag d-none d-md-inline"></i> <?php $Strings->get('qty'); ?></th> <th data-priority="3"><i class="fas fa-fw fa-hashtag d-none d-md-inline"></i> <?php $Strings->get('qty'); ?></th>
<th data-priority="6"><i class="fas fa-fw fa-hashtag d-none d-md-inline"></i> <?php $Strings->get('want'); ?></th> <th data-priority="6"><i class="fas fa-fw fa-hashtag d-none d-md-inline"></i> <?php $Strings->get('want'); ?></th>
<th data-priority="8"><i class="fas fa-fw fa-user d-none d-md-inline"></i> <?php $Strings->get('assigned to'); ?></th> <th data-priority="8"><i class="fas fa-fw fa-user d-none d-md-inline"></i> <?php $Strings->get('assigned to'); ?></th>
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -40,7 +40,6 @@ redirectifnotloggedin();
<tfoot> <tfoot>
<tr> <tr>
<th data-priority="0"></th> <th data-priority="0"></th>
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
<th data-priority="1"><i class="fas fa-fw fa-box d-none d-md-inline"></i> <?php $Strings->get('name'); ?></th> <th data-priority="1"><i class="fas fa-fw fa-box d-none d-md-inline"></i> <?php $Strings->get('name'); ?></th>
<th data-priority="7"><i class="fas fa-fw fa-pallet d-none d-md-inline"></i> <?php $Strings->get('category'); ?></th> <th data-priority="7"><i class="fas fa-fw fa-pallet d-none d-md-inline"></i> <?php $Strings->get('category'); ?></th>
<th data-priority="4"><i class="fas fa-fw fa-map-marker d-none d-md-inline"></i> <?php $Strings->get('location'); ?></th> <th data-priority="4"><i class="fas fa-fw fa-map-marker d-none d-md-inline"></i> <?php $Strings->get('location'); ?></th>
@ -49,6 +48,7 @@ redirectifnotloggedin();
<th data-priority="3"><i class="fas fa-fw fa-hashtag d-none d-md-inline"></i> <?php $Strings->get('qty'); ?></th> <th data-priority="3"><i class="fas fa-fw fa-hashtag d-none d-md-inline"></i> <?php $Strings->get('qty'); ?></th>
<th data-priority="6"><i class="fas fa-fw fa-hashtag d-none d-md-inline"></i> <?php $Strings->get('want'); ?></th> <th data-priority="6"><i class="fas fa-fw fa-hashtag d-none d-md-inline"></i> <?php $Strings->get('want'); ?></th>
<th data-priority="8"><i class="fas fa-fw fa-user d-none d-md-inline"></i> <?php $Strings->get('assigned to'); ?></th> <th data-priority="8"><i class="fas fa-fw fa-user d-none d-md-inline"></i> <?php $Strings->get('assigned to'); ?></th>
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>

@ -15,10 +15,10 @@ redirectifnotloggedin();
<thead> <thead>
<tr> <tr>
<th data-priority="0"></th> <th data-priority="0"></th>
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
<th data-priority="1"><i class="fas fa-map-marker"></i> <?php $Strings->get('location'); ?></th> <th data-priority="1"><i class="fas fa-map-marker"></i> <?php $Strings->get('location'); ?></th>
<th data-priority="2"><i class="fas fa-barcode"></i> <?php $Strings->get('code'); ?></th> <th data-priority="2"><i class="fas fa-barcode"></i> <?php $Strings->get('code'); ?></th>
<th data-priority="3"><i class="fas fa-hashtag"></i> <?php $Strings->get('item count'); ?></th> <th data-priority="3"><i class="fas fa-hashtag"></i> <?php $Strings->get('item count'); ?></th>
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -33,12 +33,12 @@ redirectifnotloggedin();
?> ?>
<tr> <tr>
<td></td> <td></td>
<td>
<a class="btn btn-primary btn-sm" href="app.php?page=editloc&id=<?php echo $loc['locid']; ?>"><i class="fas fa-edit"></i> <?php $Strings->get("edit"); ?></a>
</td>
<td><?php echo $loc['locname']; ?></td> <td><?php echo $loc['locname']; ?></td>
<td><?php echo $loc['loccode']; ?></td> <td><?php echo $loc['loccode']; ?></td>
<td><?php echo $itemcount; ?></td> <td><?php echo $itemcount; ?></td>
<td>
<a class="btn btn-primary btn-sm" href="app.php?page=editloc&id=<?php echo $loc['locid']; ?>"><i class="fas fa-edit"></i> <?php $Strings->get("edit"); ?></a>
</td>
</tr> </tr>
<?php <?php
} }
@ -47,10 +47,10 @@ redirectifnotloggedin();
<tfoot> <tfoot>
<tr> <tr>
<th data-priority="0"></th> <th data-priority="0"></th>
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
<th data-priority="1"><i class="fas fa-map-marker"></i> <?php $Strings->get('location'); ?></th> <th data-priority="1"><i class="fas fa-map-marker"></i> <?php $Strings->get('location'); ?></th>
<th data-priority="2"><i class="fas fa-barcode"></i> <?php $Strings->get('code'); ?></th> <th data-priority="2"><i class="fas fa-barcode"></i> <?php $Strings->get('code'); ?></th>
<th data-priority="3"><i class="fas fa-hashtag"></i> <?php $Strings->get('item count'); ?></th> <th data-priority="3"><i class="fas fa-hashtag"></i> <?php $Strings->get('item count'); ?></th>
<th data-priority="1"><?php $Strings->get('actions'); ?></th>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>

@ -24,11 +24,11 @@ $('#cattable').DataTable({
orderable: false orderable: false
}, },
{ {
targets: 1, targets: 3,
orderable: false orderable: false
} }
], ],
order: [ order: [
[2, 'asc'] [1, 'asc']
] ]
}); });

@ -24,16 +24,16 @@ var itemtable = $('#itemtable').DataTable({
orderable: false orderable: false
}, },
{ {
targets: 1, targets: 8,
orderable: false orderable: false
}, },
{ {
targets: 8, targets: 9,
orderable: false orderable: false
} }
], ],
order: [ order: [
[2, 'asc'] [1, 'asc']
], ],
serverSide: true, serverSide: true,
ajax: { ajax: {
@ -49,7 +49,6 @@ var itemtable = $('#itemtable').DataTable({
json.items.forEach(function (row) { json.items.forEach(function (row) {
json.data.push([ json.data.push([
"", "",
"<span class='btn-group btn-group-sm'>" + row.viewbtn + " " + row.editbtn + " " + row.addstockbtn + " " + row.removestockbtn + "</span>"
row.name, row.name,
row.catname, row.catname,
row.locname + " (" + row.loccode + ")", row.locname + " (" + row.loccode + ")",
@ -57,7 +56,8 @@ var itemtable = $('#itemtable').DataTable({
row.code2, row.code2,
row.qty, row.qty,
row.want, row.want,
row.username row.username,
"<span class='btn-group btn-group-sm'>" + row.viewbtn + " " + row.editbtn + " " + row.addstockbtn + " " + row.removestockbtn + "</span>"
]); ]);
}); });
return JSON.stringify(json); return JSON.stringify(json);

@ -24,11 +24,11 @@ $('#loctable').DataTable({
orderable: false orderable: false
}, },
{ {
targets: 1, targets: 4,
orderable: false orderable: false
} }
], ],
order: [ order: [
[2, 'asc'] [1, 'asc']
] ]
}); });

Loading…
Cancel
Save