Make event types configurable (JSON file) with categories, some other half-finished features
parent
342d2669bd
commit
286d6a2917
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
{
|
||||
"Started": "Started",
|
||||
"Deadline": "Deadline",
|
||||
"Finished": "Finished",
|
||||
"Add Job": "Add Job",
|
||||
"Jobs": "Jobs",
|
||||
"Job Title": "Job Title"
|
||||
}
|
@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2020 Netsyms Technologies.
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
class Container {
|
||||
|
||||
public $containerid = "";
|
||||
public $barcode = "";
|
||||
public $exists = false;
|
||||
private $machines = [];
|
||||
private $components = [];
|
||||
private $others = [];
|
||||
|
||||
public function __construct($containerid) {
|
||||
global $database;
|
||||
|
||||
if ($database->has("containers", ["containerid" => $containerid])) {
|
||||
$this->exists = true;
|
||||
$info = $database->get("containers", ["barcode"], ["containerid" => $containerid]);
|
||||
$this->barcode = $info["barcode"];
|
||||
} else {
|
||||
$this->exists = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function save() {
|
||||
global $database;
|
||||
|
||||
if ($database->has("containers", ["containerid" => $this->containerid])) {
|
||||
$database->update("containers", [
|
||||
"barcode" => $this->barcode
|
||||
], ["containerid" => $this->containerid]);
|
||||
} else {
|
||||
$database->insert("containers", ["barcode" => $this->barcode]);
|
||||
$this->containerid = $database->id();
|
||||
$this->exists = true;
|
||||
}
|
||||
|
||||
$database->action(function ($database) {
|
||||
$database->delete("container_contents", ["containerid" => $this->containerid]);
|
||||
|
||||
foreach ($this->machines as $id) {
|
||||
$database->insert("container_contents", [
|
||||
"machineid" => $id,
|
||||
"containerid" => $this->containerid
|
||||
]);
|
||||
}
|
||||
|
||||
foreach ($this->components as $id) {
|
||||
$database->insert("container_contents", [
|
||||
"componentid" => $id,
|
||||
"containerid" => $this->containerid
|
||||
]);
|
||||
}
|
||||
|
||||
foreach ($this->others as $id) {
|
||||
$database->insert("container_contents", [
|
||||
"otherid" => $id,
|
||||
"containerid" => $this->containerid
|
||||
]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function getMachineIDs(): array {
|
||||
return $this->machines;
|
||||
}
|
||||
|
||||
public function getComponentIDs(): array {
|
||||
return $this->components;
|
||||
}
|
||||
|
||||
public function getOtherIDs(): array {
|
||||
return $this->others;
|
||||
}
|
||||
|
||||
public function addMachine($machineid) {
|
||||
global $database;
|
||||
if ($database->has("machines", ["machineid" => $machineid])) {
|
||||
$this->machines[] = $machineid;
|
||||
} else {
|
||||
throw new Exception("No machine with ID $machineid exists.");
|
||||
}
|
||||
}
|
||||
|
||||
public function addComponent($componentid) {
|
||||
global $database;
|
||||
if ($database->has("components", ["compid" => $componentid])) {
|
||||
$this->components[] = $componentid;
|
||||
} else {
|
||||
throw new Exception("No component with ID $componentid exists.");
|
||||
}
|
||||
}
|
||||
|
||||
public function addOtherID($id) {
|
||||
$this->others[] = $id;
|
||||
}
|
||||
|
||||
public function rmMachine($machineid) {
|
||||
foreach (array_keys($this->machines, $machineid) as $id) {
|
||||
unset($this->machines[$id]);
|
||||
}
|
||||
}
|
||||
|
||||
public function rmComponent($componentid) {
|
||||
foreach (array_keys($this->components, $componentid) as $id) {
|
||||
unset($this->components[$id]);
|
||||
}
|
||||
}
|
||||
|
||||
public function rmOtherID($oid) {
|
||||
foreach (array_keys($this->others, $oid) as $id) {
|
||||
unset($this->others[$id]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,193 @@
|
||||
<?php
|
||||
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
class Job implements JsonSerializable {
|
||||
|
||||
private $jobid = -1;
|
||||
private $exists = false;
|
||||
private $machineid = "";
|
||||
private $jobname = "";
|
||||
private $clientid = "";
|
||||
private $startdate = 0;
|
||||
private $deadline = 0;
|
||||
private $finishdate = 0;
|
||||
private $info = "";
|
||||
private $notes = "";
|
||||
|
||||
public function __construct($jobid = false) {
|
||||
global $database;
|
||||
if ($jobid !== false) {
|
||||
$this->jobid = $jobid;
|
||||
if (Job::exists($jobid)) {
|
||||
$this->exists = true;
|
||||
$info = $database->get("jobs", ["[>]machines" => ["machineid"]], ["jobid", "jobs.machineid", "jobname", "clientid", "startdate", "deadline", "finishdate", "jobinfo", "jobnotes"], ["jobid" => $jobid]);
|
||||
$this->machineid = $info["machineid"];
|
||||
$this->jobname = $info["jobname"];
|
||||
$this->clientid = $info["clientid"];
|
||||
$this->startdate = strtotime($info["startdate"]);
|
||||
$this->deadline = strtotime($info["deadline"]);
|
||||
$this->finishdate = strtotime($info["finishdate"]);
|
||||
$this->info = $info["jobinfo"];
|
||||
$this->notes = $info["jobnotes"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function create(): Job {
|
||||
return new Job();
|
||||
}
|
||||
|
||||
public static function exists($id): bool {
|
||||
global $database;
|
||||
return $database->has('jobs', ['jobid' => $id]);
|
||||
}
|
||||
|
||||
public function toArray() {
|
||||
global $Strings;
|
||||
if ($this->exists) {
|
||||
return [
|
||||
"info" => [
|
||||
"jobid" => $this->getID(),
|
||||
"jobname" => $this->getName(),
|
||||
"machineid" => $this->getMachineID(),
|
||||
"startdate" => $this->getStartDate(),
|
||||
"deadline" => $this->getDeadline(),
|
||||
"finishdate" => $this->getFinishDate(),
|
||||
"jobinfo" => $this->getInfo(),
|
||||
"jobnotes" => $this->getNotes()
|
||||
],
|
||||
"formdata" => [
|
||||
"inputtypes" => [
|
||||
"jobname" => "text",
|
||||
"machineid" => "text",
|
||||
"startdate" => "datetime",
|
||||
"deadline" => "datetime",
|
||||
"finishdate" => "datetime",
|
||||
"jobinfo" => "textarea",
|
||||
"jobnotes" => "textarea"
|
||||
],
|
||||
"labels" => [
|
||||
"machineid" => $Strings->get("Machine ID", false),
|
||||
"jobname" => $Strings->get("Job Title", false),
|
||||
"startdate" => $Strings->get("Started", false),
|
||||
"deadline" => $Strings->get("Deadline", false),
|
||||
"finishdate" => $Strings->get("Finished", false),
|
||||
"jobinfo" => $Strings->get("Info", false),
|
||||
"jobnotes" => $Strings->get("Notes", false)
|
||||
],
|
||||
"icons" => []
|
||||
]
|
||||
];
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
public function jsonSerialize() {
|
||||
return $this->toArray();
|
||||
}
|
||||
|
||||
public function save() {
|
||||
global $database;
|
||||
$data = [
|
||||
"machineid" => $this->getMachineID(),
|
||||
"jobname" => $this->getName(),
|
||||
"startdate" => date("Y-m-d H:i:s", $this->getStartDate()),
|
||||
"deadline" => date("Y-m-d H:i:s", $this->getDeadline()),
|
||||
"finishdate" => date("Y-m-d H:i:s", $this->getFinishDate()),
|
||||
"jobinfo" => $this->getInfo(),
|
||||
"jobnotes" => $this->getNotes()
|
||||
];
|
||||
if ($this->exists) {
|
||||
$database->update("jobs", $data, ["jobid" => $this->jobid]);
|
||||
} else {
|
||||
$database->insert("jobs", $data);
|
||||
$this->jobid = $database->id();
|
||||
$this->exists = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function getID(): int {
|
||||
return $this->jobid;
|
||||
}
|
||||
|
||||
public function getMachineID(): string {
|
||||
if (!empty($this->machineid)) {
|
||||
return $this->machineid;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public function getName(): string {
|
||||
if (!empty($this->jobname)) {
|
||||
return $this->jobname;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public function getStartDate(): int {
|
||||
if (!empty($this->startdate)) {
|
||||
return $this->startdate;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function getDeadline(): int {
|
||||
if (!empty($this->deadline)) {
|
||||
return $this->deadline;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function getFinishDate(): int {
|
||||
if (!empty($this->finishdate)) {
|
||||
return $this->finishdate;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function getInfo(): string {
|
||||
if (!empty($this->info)) {
|
||||
return $this->info;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public function getNotes(): string {
|
||||
if (!empty($this->notes)) {
|
||||
return $this->notes;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public function setMachineID($id) {
|
||||
$this->machineid = $id;
|
||||
}
|
||||
|
||||
public function setName(string $name) {
|
||||
$this->jobname = $name;
|
||||
}
|
||||
|
||||
public function setStartDate($date) {
|
||||
$this->startdate = strtotime($date);
|
||||
}
|
||||
|
||||
public function setDeadline($date) {
|
||||
$this->deadline = strtotime($date);
|
||||
}
|
||||
|
||||
public function setFinishDate($date) {
|
||||
$this->finishdate = strtotime($date);
|
||||
}
|
||||
|
||||
public function setInfo(string $info) {
|
||||
$this->info = $info;
|
||||
}
|
||||
|
||||
public function setNotes(string $notes) {
|
||||
$this->notes = $notes;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2020 Netsyms Technologies.
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
class TrackingCode {
|
||||
|
||||
public $code = "";
|
||||
public $type = "";
|
||||
public $containerid = "";
|
||||
public $trackingurl = "";
|
||||
public $exists = false;
|
||||
|
||||
public function __construct($code) {
|
||||
global $database;
|
||||
|
||||
if ($database->has("trackingcodes", ["code" => $code])) {
|
||||
$this->exists = true;
|
||||
$info = $database->get("trackingcodes", ["containerid", "code", "codetype"], ["code" => $code]);
|
||||
$this->code = $info["code"];
|
||||
$this->containerid = $info["containerid"];
|
||||
$this->type = $info["codetype"];
|
||||
} else {
|
||||
$this->exists = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getCarrier(): string {
|
||||
return TrackingCode::typeToCarrier($this->type);
|
||||
}
|
||||
|
||||
public function save() {
|
||||
global $database;
|
||||
|
||||
if (!$database->has("containers", ["containerid" => $this->containerid])) {
|
||||
throw new Exception("No container with ID $this->containerid exists.");
|
||||
return false;
|
||||
}
|
||||
if ($database->has("trackingcodes", ["code" => $code])) {
|
||||
$database->update("trackingcodes", [
|
||||
"codetype" => $this->type,
|
||||
"containerid" => $this->containerid
|
||||
], ["code" => $this->code]);
|
||||
} else {
|
||||
$database->insert("trackingcodes", [
|
||||
"code" => $this->code,
|
||||
"containerid" => $this->containerid,
|
||||
"codetype" => $this->type
|
||||
]);
|
||||
$this->exists = true;
|
||||
}
|
||||
}
|
||||
|
||||
public static function typeToCarrier($type) {
|
||||
switch (strtolower($type)) {
|
||||
case "usps":
|
||||
return "USPS";
|
||||
case "ups":
|
||||
return "UPS";
|
||||
case "fedex":
|
||||
return "FedEx";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
{
|
||||
"Technical []": [
|
||||
"Diagnosed",
|
||||
"OS Installed",
|
||||
"Repaired",
|
||||
"Tested",
|
||||
"Upgraded",
|
||||
"Wiped"
|
||||
],
|
||||
"Delivered": [
|
||||
"Met Customer",
|
||||
"Left with Customer",
|
||||
"Installed",
|
||||
"Front Door/Porch",
|
||||
"Back/Side Door/Porch",
|
||||
"In Garage",
|
||||
"Left with Neighbor",
|
||||
"Left with Person at Address",
|
||||
"Secure Location",
|
||||
""
|
||||
],
|
||||
"Attempted": [
|
||||
"No answer at door",
|
||||
"Could not find destination",
|
||||
"Hazardous conditions",
|
||||
"Bad weather",
|
||||
"Unacceptable risk of loss",
|
||||
""
|
||||
],
|
||||
"Logistics []": [
|
||||
"Recieved from Customer",
|
||||
"Picked up",
|
||||
"In Transit",
|
||||
"Delayed",
|
||||
"Delivery Scheduled",
|
||||
"Received from shipping partner",
|
||||
"Transferred to shipping partner for delivery",
|
||||
"Accepted"
|
||||
],
|
||||
"Money []": [
|
||||
"Sold",
|
||||
"Refund Issued"
|
||||
],
|
||||
"Other []": [
|
||||
"Other",
|
||||
"Note",
|
||||
"Device ID Generated"
|
||||
]
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2019 Netsyms Technologies.
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
redirectIfNotLoggedIn();
|
||||
$user = new User($_SESSION['uid']);
|
||||
if (!$user->hasPermission("MACHINEMANAGER_VIEW")) {
|
||||
header("Location: ./app.php?msg=no_permission");
|
||||
die();
|
||||
}
|
||||
|
||||
$writeaccess = $user->hasPermission("MACHINEMANAGER_EDIT");
|
||||
|
||||
$containers = $database->select("containers", ["containerid", "barcode"]);
|
||||
|
||||
$addto = false;
|
||||
if (!empty($VARS["addto"]) && Machine::exists($VARS["addto"])) {
|
||||
$addto = $VARS["addto"];
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ($addto != false) { ?>
|
||||
<div class="alert alert-info" role="alert">
|
||||
Select a container to place machine #<?php echo htmlspecialchars($VARS["addto"]); ?> into.
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="btn-group">
|
||||
<?php if ($writeaccess) { ?>
|
||||
<a href="app.php?page=addcontainer" class="btn btn-success"><i class="fas fa-plus"></i> <?php $Strings->get("Add Container"); ?></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<table id="containertable" class="table table-bordered table-hover table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-priority="0"></th>
|
||||
<th data-priority="1"><?php $Strings->get('Actions'); ?></th>
|
||||
<th data-priority="2"><i class="fas fa-barcode hidden-sm"></i> <?php $Strings->get('Barcode'); ?></th>
|
||||
<th data-priority="3"><i class="fas fa-desktop hidden-sm"></i> <?php $Strings->get('Machines'); ?></th>
|
||||
<th data-priority="1"><i class="fas fa-memory hidden-sm"></i> <?php $Strings->get('Components'); ?></th>
|
||||
<th data-priority="2"><i class="fas fa-cubes hidden-sm"></i> <?php $Strings->get('Others'); ?></th>
|
||||
<th data-priority="2"><i class="fas fa-hashtag hidden-sm"></i> <?php $Strings->get('Total'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($containers as $c) {
|
||||
?>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<?php
|
||||
if ($addto != false) {
|
||||
?>
|
||||
<a class="btn btn-success btn-sm" href="app.php?page=editcomponent&id=<?php echo $c['compid']; ?>&machine=<?php echo $attachto; ?>"><i class="fas fa-plus"></i> <?php $Strings->get("Attach"); ?></a>
|
||||
<?php
|
||||
} else if ($writeaccess) {
|
||||
?>
|
||||
<a class="btn btn-primary btn-sm" href="app.php?page=editcomponent&id=<?php echo $c['compid']; ?>"><i class="fas fa-edit"></i> <?php $Strings->get("Edit"); ?></a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td><?php echo $c['compid']; ?></td>
|
||||
<td><?php
|
||||
if (!empty($c['machineid'])) {
|
||||
?>
|
||||
<a href="./app.php?page=viewmachine&id=<?php echo $c['machineid']; ?>"><?php echo $c['machineid']; ?></a>
|
||||
<?php
|
||||
}
|
||||
?></td>
|
||||
<td><?php echo $c['model'] ?? ""; ?></td>
|
||||
<td><?php echo $c['serial'] ?? ""; ?></td>
|
||||
<td><?php echo $c['capacity'] ?? ""; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th data-priority="0"></th>
|
||||
<th data-priority="1"><?php $Strings->get('Actions'); ?></th>
|
||||
<th data-priority="2"><i class="fas fa-barcode hidden-sm"></i> <?php $Strings->get('Barcode'); ?></th>
|
||||
<th data-priority="3"><i class="fas fa-desktop hidden-sm"></i> <?php $Strings->get('Machines'); ?></th>
|
||||
<th data-priority="1"><i class="fas fa-memory hidden-sm"></i> <?php $Strings->get('Components'); ?></th>
|
||||
<th data-priority="2"><i class="fas fa-cubes hidden-sm"></i> <?php $Strings->get('Others'); ?></th>
|
||||
<th data-priority="2"><i class="fas fa-hashtag hidden-sm"></i> <?php $Strings->get('Total'); ?></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
redirectIfNotLoggedIn();
|
||||
$user = new User($_SESSION['uid']);
|
||||
if (!$user->hasPermission("MACHINEMANAGER_EDIT")) {
|
||||
header("Location: ./app.php?msg=no_permission");
|
||||
die();
|
||||
}
|
||||
|
||||
$editing = false;
|
||||
|
||||
if (!empty($_GET['arg']) && Job::exists($_GET['arg'])) {
|
||||
$editing = true;
|
||||
$job = new Job($_GET['arg']);
|
||||
} else {
|
||||
$job = Job::create();
|
||||
}
|
||||
|
||||
if ($editing) {
|
||||
$form = new FormBuilder("Edit Job " . $job->getName(), "fas fa-tasks", "action.php", "POST");
|
||||
} else {
|
||||
$form = new FormBuilder("Add Job", "fas fa-tasks", "action.php", "POST");
|
||||
}
|
||||
|
||||
$form->setID("editjob");
|
||||
|
||||
$form->addHiddenInput("action", "editjob");
|
||||
$form->addHiddenInput("source", "viewjob");
|
||||
|
||||
if ($editing) {
|
||||
$form->addHiddenInput("jobid", $job->getID());
|
||||
}
|
||||
|
||||
$form->addInput("jobname", $job->getName(), "text", true, null, null, "Job Title", "fas fa-tasks", 8, 0, 200);
|
||||
$form->addInput("machineid", $job->getMachineID(), "text", false, null, null, "Machine ID", "fas fa-desktop", 4, 0, 200);
|
||||
$form->addInput("jobinfo", $job->getInfo(), "textarea", false, "jobinfo", null, "Info", "fas fa-comment-dots", 6, 0, 10000);
|
||||
$form->addInput("jobnotes", $job->getNotes(), "textarea", false, "jobnotes", null, "Notes", "far fa-comment-dots", 6, 0, 10000);
|
||||
|
||||
$form->addButton("Save", "fas fa-save", null, "submit", "savebtn");
|
||||
|
||||
$form->generate();
|
@ -0,0 +1,90 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2019 Netsyms Technologies.
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
redirectIfNotLoggedIn();
|
||||
$user = new User($_SESSION['uid']);
|
||||
if (!$user->hasPermission("MACHINEMANAGER_VIEW")) {
|
||||
header("Location: ./app.php?msg=no_permission");
|
||||
die();
|
||||
}
|
||||
|
||||
$writeaccess = $user->hasPermission("MACHINEMANAGER_EDIT");
|
||||
|
||||
$jobs = $database->select("jobs", ["[>]machines" => ["machineid"]], ["jobid", "jobs.machineid", "jobname", "clientid", "startdate", "deadline", "finishdate"]);
|
||||
|
||||
$clients = Clients::getAll();
|
||||
?>
|
||||
|
||||
<div class="btn-group">
|
||||
<?php if ($writeaccess) { ?>
|
||||
<a href="app.php?page=editjob" class="btn btn-success"><i class="fas fa-plus"></i> <?php $Strings->get("Add Job"); ?></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<table id="jobstable" class="table table-bordered table-hover table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-priority="0"></th>
|
||||
<th data-priority="1"><?php $Strings->get('Actions'); ?></th>
|
||||
<th data-priority="3"><i class="fas fa-tasks hidden-sm"></i> <?php $Strings->get('Job Title'); ?></th>
|
||||
<th data-priority="3"><i class="fas fa-desktop hidden-sm"></i> <?php $Strings->get('Machine'); ?></th>
|
||||
<th data-priority="2"><i class="fas fa-user hidden-sm"></i> <?php $Strings->get('Client'); ?></th>
|
||||
<th data-priority="4"><i class="fas fa-calendar-plus hidden-sm"></i> <?php $Strings->get('Started'); ?></th>
|
||||
<th data-priority="2"><i class="fas fa-calendar hidden-sm"></i> <?php $Strings->get('Deadline'); ?></th>
|
||||
<th data-priority="1"><i class="fas fa-calendar-check hidden-sm"></i> <?php $Strings->get('Finished'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($jobs as $j) {
|
||||
?>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<?php
|
||||
if ($writeaccess) {
|
||||
?>
|
||||
<a class="btn btn-primary btn-sm" href="app.php?page=editjob&arg=<?php echo $j['jobid']; ?>"><i class="fas fa-edit"></i> <?php $Strings->get("Edit"); ?></a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td><a href="./app.php?page=viewjob&id=<?php echo $j['jobid']; ?>"><?php echo htmlspecialchars($j['jobname']); ?></a></td>
|
||||
<td>
|
||||
<?php if (!empty($j["machineid"])) { ?>
|
||||
<a href="./app.php?page=viewmachine&id=<?php echo $j['machineid']; ?>"><?php echo htmlspecialchars($j['machineid']); ?></a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td><?php
|
||||
foreach ($clients as $c) {
|
||||
if ($c->getID() == $j['clientid']) {
|
||||
echo $c->getName();
|
||||
break;
|
||||
}
|
||||
}
|
||||
?></td>
|
||||
<td><?php echo $j['startdate'] ?? date($SETTINGS["datetime_format"], strtotime($j['startdate'])); ?></td>
|
||||
<td><?php echo $j['deadline'] ?? date($SETTINGS["datetime_format"], strtotime($j['deadline'])); ?></td>
|
||||
<td><?php echo $j['finishdate'] ?? date($SETTINGS["datetime_format"], strtotime($j['finishdate'])); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th data-priority="0"></th>
|
||||
<th data-priority="1"><?php $Strings->get('Actions'); ?></th>
|
||||
<th data-priority="3"><i class="fas fa-tasks hidden-sm"></i> <?php $Strings->get('Job Title'); ?></th>
|
||||
<th data-priority="3"><i class="fas fa-desktop hidden-sm"></i> <?php $Strings->get('Machine'); ?></th>
|
||||
<th data-priority="2"><i class="fas fa-user hidden-sm"></i> <?php $Strings->get('Client'); ?></th>
|
||||
<th data-priority="4"><i class="fas fa-calendar-plus hidden-sm"></i> <?php $Strings->get('Started'); ?></th>
|
||||
<th data-priority="2"><i class="fas fa-calendar hidden-sm"></i> <?php $Strings->get('Deadline'); ?></th>
|
||||
<th data-priority="1"><i class="fas fa-calendar-check hidden-sm"></i> <?php $Strings->get('Finished'); ?></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright 2020 Netsyms Technologies.
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
|
||||
var easyMDEinfo = new EasyMDE({
|
||||
element: document.getElementById("jobinfo"),
|
||||
forceSync: true
|
||||
});
|
||||
|
||||
var easyMDEnotes = new EasyMDE({
|
||||
element: document.getElementById("jobnotes"),
|
||||
forceSync: true
|
||||
});
|
@ -0,0 +1,30 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
$('#jobstable').DataTable({
|
||||
responsive: {
|
||||
details: {
|
||||
display: $.fn.dataTable.Responsive.display.modal({
|
||||
header: function (row) {
|
||||
var data = row.data();
|
||||
return "<i class=\"fas fa-tasks fa-fw\"></i> " + data[2];
|
||||
}
|
||||
}),
|
||||
renderer: $.fn.dataTable.Responsive.renderer.tableAll({
|
||||
tableClass: 'table'
|
||||
}),
|
||||
type: "column"
|
||||
}
|
||||
},
|
||||
columnDefs: [
|
||||
{
|
||||
targets: 0,
|
||||
className: 'control',
|
||||
orderable: false
|
||||
}
|
||||
],
|
||||
order: [
|
||||
[6, 'desc']
|
||||
]
|
||||
});
|
Loading…
Reference in New Issue