Migrate Add Ticket, Recurring Ticket, Project and Vendor to the new ajax-modal
This commit is contained in:
@@ -361,11 +361,11 @@ if (isset($_GET['asset_id'])) {
|
|||||||
<div class="dropdown dropleft mr-2">
|
<div class="dropdown dropleft mr-2">
|
||||||
<button type="button" class="btn btn-primary" data-toggle="dropdown"><i class="fas fa-plus mr-2"></i>New</button>
|
<button type="button" class="btn btn-primary" data-toggle="dropdown"><i class="fas fa-plus mr-2"></i>New</button>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#addTicketModal">
|
<a class="dropdown-item text-dark ajax-modal" href="#" data-modal-url="modals/ticket/ticket_add.php?<?= $client_url ?>&asset_id=<?= $asset_id ?>" data-modal-size="lg">
|
||||||
<i class="fa fa-fw fa-life-ring mr-2"></i>New Ticket
|
<i class="fa fa-fw fa-life-ring mr-2"></i>New Ticket
|
||||||
</a>
|
</a>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#addRecurringTicketModal">
|
<a class="dropdown-item text-dark ajax-modal" href="#" data-modal-url="modals/recurring_ticket/recurring_ticket_add.php?<?= $client_url ?>&asset_id=<?= $asset_id ?>" data-modal-size="lg">
|
||||||
<i class="fa fa-fw fa-recycle mr-2"></i>New Recurring Ticket
|
<i class="fa fa-fw fa-recycle mr-2"></i>New Recurring Ticket
|
||||||
</a>
|
</a>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
@@ -1225,8 +1225,6 @@ if (isset($_GET['asset_id'])) {
|
|||||||
require_once "modals/asset/asset_interface_multiple_add.php";
|
require_once "modals/asset/asset_interface_multiple_add.php";
|
||||||
require_once "modals/asset/asset_interface_import.php";
|
require_once "modals/asset/asset_interface_import.php";
|
||||||
require_once "modals/asset/asset_interface_export.php";
|
require_once "modals/asset/asset_interface_export.php";
|
||||||
require_once "modals/ticket/ticket_add.php";
|
|
||||||
require_once "modals/recurring_ticket/recurring_ticket_add.php";
|
|
||||||
require_once "modals/document/document_add.php";
|
require_once "modals/document/document_add.php";
|
||||||
require_once "modals/file/file_upload.php";
|
require_once "modals/file/file_upload.php";
|
||||||
|
|
||||||
|
|||||||
@@ -262,11 +262,11 @@ if (isset($_GET['contact_id'])) {
|
|||||||
<div class="dropdown dropleft mr-2">
|
<div class="dropdown dropleft mr-2">
|
||||||
<button type="button" class="btn btn-primary" data-toggle="dropdown"><i class="fas fa-plus mr-2"></i>New</button>
|
<button type="button" class="btn btn-primary" data-toggle="dropdown"><i class="fas fa-plus mr-2"></i>New</button>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#addTicketModal">
|
<a class="dropdown-item text-dark ajax-modal" href="#" data-modal-url="modals/ticket/ticket_add.php?<?= $client_url ?>&contact_id=<?= $contact_id ?>" data-modal-size="lg">
|
||||||
<i class="fa fa-fw fa-life-ring mr-2"></i>New Ticket
|
<i class="fa fa-fw fa-life-ring mr-2"></i>New Ticket
|
||||||
</a>
|
</a>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#addRecurringTicketModal">
|
<a class="dropdown-item text-dark ajax-modal" href="#" data-modal-url="modals/recurring_ticket/recurring_ticket_add.php?<?= $client_url ?>&contact_id=<?= $contact_id ?>" data-modal-size="lg">
|
||||||
<i class="fa fa-fw fa-recycle mr-2"></i>New Recurring Ticket
|
<i class="fa fa-fw fa-recycle mr-2"></i>New Recurring Ticket
|
||||||
</a>
|
</a>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
@@ -1180,8 +1180,6 @@ if (isset($_GET['contact_id'])) {
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once "modals/ticket/ticket_add.php";
|
|
||||||
require_once "modals/recurring_ticket/recurring_ticket_add.php";
|
|
||||||
require_once "modals/document/document_add.php";
|
require_once "modals/document/document_add.php";
|
||||||
require_once "modals/file/file_upload.php";
|
require_once "modals/file/file_upload.php";
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,46 @@
|
|||||||
<div class="modal" id="addProjectModal" tabindex="-1">
|
<?php
|
||||||
<div class="modal-dialog">
|
|
||||||
<div class="modal-content">
|
require_once '../../../includes/modal_header.php';
|
||||||
<div class="modal-header bg-dark">
|
|
||||||
|
$client_id = intval($_GET['client_id'] ?? 0);
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
|
||||||
|
?>
|
||||||
|
<div class="modal-header bg-dark">
|
||||||
<h5 class="modal-title"><i class="fas fa-fw fa-project-diagram mr-2"></i>New Project</h5>
|
<h5 class="modal-title"><i class="fas fa-fw fa-project-diagram mr-2"></i>New Project</h5>
|
||||||
<button type="button" class="close text-white" data-dismiss="modal">
|
<button type="button" class="close text-white" data-dismiss="modal">
|
||||||
<span>×</span>
|
<span>×</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<form action="post.php" method="post" autocomplete="off">
|
<form action="post.php" method="post" autocomplete="off">
|
||||||
<input type="hidden" name="client_id" value="<?php if (isset($_GET['client_id'])) { echo $client_id; } else { echo 0; } ?>">
|
|
||||||
|
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
|
||||||
|
<?php if ($client_id) { ?>
|
||||||
|
<input type="hidden" name="client_id" value="<?= $client_id ?>">
|
||||||
|
<?php } else { ?>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Client</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-users"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="client_id">
|
||||||
|
<option value="0">- No Client -</option>
|
||||||
|
<?php
|
||||||
|
$sql = mysqli_query($mysqli, "SELECT * FROM clients WHERE client_archived_at IS NULL $access_permission_query ORDER BY client_name ASC");
|
||||||
|
while ($row = mysqli_fetch_array($sql)) {
|
||||||
|
$client_id_select = intval($row['client_id']);
|
||||||
|
$client_name = nullable_htmlentities($row['client_name']);
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $client_id_select; ?>"><?php echo $client_name; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Project Name <strong class="text-danger">*</strong></label>
|
<label>Project Name <strong class="text-danger">*</strong></label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
@@ -87,34 +116,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if (empty($_GET['client_id'])) { ?>
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Client</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-users"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="client_id">
|
|
||||||
<option value="0">- No Client -</option>
|
|
||||||
<?php
|
|
||||||
$sql = mysqli_query($mysqli, "SELECT * FROM clients WHERE client_archived_at IS NULL $access_permission_query ORDER BY client_name ASC");
|
|
||||||
while ($row = mysqli_fetch_array($sql)) {
|
|
||||||
$client_id = intval($row['client_id']);
|
|
||||||
$client_name = nullable_htmlentities($row['client_name']);
|
|
||||||
?>
|
|
||||||
<option value="<?php echo $client_id; ?>"><?php echo $client_name; ?></option>
|
|
||||||
<?php } ?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="submit" name="add_project" class="btn btn-primary text-bold"><i class="fas fa-check mr-2"></i>Create</button>
|
<button type="submit" name="add_project" class="btn btn-primary text-bold"><i class="fas fa-check mr-2"></i>Create</button>
|
||||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
|
||||||
</div>
|
<?php
|
||||||
</div>
|
require_once '../../../includes/modal_footer.php';
|
||||||
|
|||||||
@@ -1,13 +1,21 @@
|
|||||||
<div class="modal" id="addRecurringTicketModal" tabindex="-1">
|
<?php
|
||||||
<div class="modal-dialog modal-lg">
|
|
||||||
<div class="modal-content">
|
require_once '../../../includes/modal_header.php';
|
||||||
<div class="modal-header bg-dark">
|
|
||||||
|
$client_id = intval($_GET['client_id'] ?? 0);
|
||||||
|
$contact_id = intval($_GET['contact_id'] ?? 0);
|
||||||
|
$asset_id = intval($_GET['asset_id'] ?? 0);
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
|
||||||
|
?>
|
||||||
|
<div class="modal-header bg-dark">
|
||||||
<h5 class="modal-title"><i class="fa fa-fw fa-calendar-check mr-2"></i>New Recurring Ticket</h5>
|
<h5 class="modal-title"><i class="fa fa-fw fa-calendar-check mr-2"></i>New Recurring Ticket</h5>
|
||||||
<button type="button" class="close text-white" data-dismiss="modal">
|
<button type="button" class="close text-white" data-dismiss="modal">
|
||||||
<span>×</span>
|
<span>×</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<form action="post.php" method="post" autocomplete="off">
|
<form action="post.php" method="post" autocomplete="off">
|
||||||
<?php if (isset($client_id)) { ?>
|
<?php if (isset($client_id)) { ?>
|
||||||
<input type="hidden" name="client" value="<?php echo $client_id; ?>>">
|
<input type="hidden" name="client" value="<?php echo $client_id; ?>>">
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
@@ -19,7 +27,7 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link active" data-toggle="pill" href="#pills-add-details"><i class="fa fa-fw fa-life-ring mr-2"></i>Details</a>
|
<a class="nav-link active" data-toggle="pill" href="#pills-add-details"><i class="fa fa-fw fa-life-ring mr-2"></i>Details</a>
|
||||||
</li>
|
</li>
|
||||||
<?php if (!isset($_GET['contact_id'])) { ?>
|
<?php if (!$contact_id) { ?>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" data-toggle="pill" href="#pills-add-contacts"><i class="fa fa-fw fa-users mr-2"></i>Contact</a>
|
<a class="nav-link" data-toggle="pill" href="#pills-add-contacts"><i class="fa fa-fw fa-users mr-2"></i>Contact</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -135,7 +143,10 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if (!isset($_GET['contact_id'])) { ?>
|
<?php if ($contact_id) { ?>
|
||||||
|
<input type="hidden" name="client" value="<?php echo $client_id; ?>">
|
||||||
|
<input type="hidden" name="contact" value="<?php echo $contact_id; ?>">
|
||||||
|
<?php } else { ?>
|
||||||
<div class="tab-pane fade" id="pills-add-contacts">
|
<div class="tab-pane fade" id="pills-add-contacts">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@@ -144,16 +155,16 @@
|
|||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<select class="form-control select2" name="client" id="changeClientSelect" required <?php if (isset($client_id)) { echo "disabled"; } ?>>
|
<select class="form-control select2" name="client" id="changeClientSelect" required <?php if ($client_id) { echo "disabled"; } ?>>
|
||||||
<option value="">- Client -</option>
|
<option value="">- Client -</option>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$sql = mysqli_query($mysqli, "SELECT * FROM clients WHERE client_archived_at IS NULL $access_permission_query ORDER BY client_name ASC");
|
$sql = mysqli_query($mysqli, "SELECT * FROM clients WHERE client_archived_at IS NULL $access_permission_query ORDER BY client_name ASC");
|
||||||
while ($row = mysqli_fetch_array($sql)) {
|
while ($row = mysqli_fetch_array($sql)) {
|
||||||
$selectable_client_id = intval($row['client_id']);
|
$client_id_select = intval($row['client_id']);
|
||||||
$client_name = nullable_htmlentities($row['client_name']); ?>
|
$client_name = nullable_htmlentities($row['client_name']); ?>
|
||||||
|
|
||||||
<option value="<?php echo $selectable_client_id; ?>" <?php if (isset($client_id) && $client_id == $selectable_client_id) {echo "selected"; } ?>><?php echo $client_name; ?></option>
|
<option value="<?php echo $client_id_select; ?>" <?php if ($client_id == $client_id_select) {echo "selected"; } ?>><?php echo $client_name; ?></option>
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</select>
|
</select>
|
||||||
@@ -176,9 +187,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php } else { ?>
|
|
||||||
<input type="hidden" name="client" value="<?php echo $client_id; ?>">
|
|
||||||
<input type="hidden" name="contact" value="<?php echo intval($_GET['contact_id']); ?>">
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<div class="tab-pane fade" id="pills-add-schedule">
|
<div class="tab-pane fade" id="pills-add-schedule">
|
||||||
@@ -219,7 +228,7 @@
|
|||||||
|
|
||||||
<div class="tab-pane fade" id="pills-add-assets">
|
<div class="tab-pane fade" id="pills-add-assets">
|
||||||
|
|
||||||
<?php if (isset($client_id)) { ?>
|
<?php if ($client_id) { ?>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Asset</label>
|
<label>Asset</label>
|
||||||
@@ -263,7 +272,7 @@
|
|||||||
. ($contact_name_select ? " - ($contact_name_select)" : '');
|
. ($contact_name_select ? " - ($contact_name_select)" : '');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<option value="<?= $asset_id_select ?>"><?= $full_name ?></option>
|
<option <?php if ($asset_id == $asset_id_select) { echo "selected"; } ?> value="<?= $asset_id_select ?>"><?= $full_name ?></option>
|
||||||
|
|
||||||
<?php }
|
<?php }
|
||||||
|
|
||||||
@@ -337,12 +346,13 @@
|
|||||||
<button type="submit" name="add_recurring_ticket" class="btn btn-primary text-bold"><i class="fas fa-check mr-2"></i>Create</button>
|
<button type="submit" name="add_recurring_ticket" class="btn btn-primary text-bold"><i class="fas fa-check mr-2"></i>Create</button>
|
||||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fas fa-times mr-2"></i>Cancel</button>
|
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fas fa-times mr-2"></i>Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Recurring Ticket Client/Contact JS -->
|
<!-- Recurring Ticket Client/Contact JS -->
|
||||||
<link rel="stylesheet" href="../plugins/jquery-ui/jquery-ui.min.css">
|
<link rel="stylesheet" href="/plugins/jquery-ui/jquery-ui.min.css">
|
||||||
<script src="../plugins/jquery-ui/jquery-ui.min.js"></script>
|
<script src="/plugins/jquery-ui/jquery-ui.min.js"></script>
|
||||||
<script src="js/tickets_add_modal.js"></script>
|
<script src="/agent/js/tickets_add_modal.js"></script>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
require_once '../../../includes/modal_footer.php';
|
||||||
|
|||||||
@@ -1,13 +1,22 @@
|
|||||||
<div class="modal" id="addTicketModal" tabindex="-1">
|
<?php
|
||||||
<div class="modal-dialog modal-lg">
|
|
||||||
<div class="modal-content">
|
require_once '../../../includes/modal_header.php';
|
||||||
<div class="modal-header bg-dark">
|
|
||||||
|
$client_id = intval($_GET['client_id'] ?? 0);
|
||||||
|
$contact_id = intval($_GET['contact_id'] ?? 0);
|
||||||
|
$asset_id = intval($_GET['asset_id'] ?? 0);
|
||||||
|
$project_id = intval($_GET['project_id'] ?? 0);
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
|
||||||
|
?>
|
||||||
|
<div class="modal-header bg-dark">
|
||||||
<h5 class="modal-title"><i class="fas fa-fw fa-life-ring mr-2"></i>New Ticket (v1)</h5>
|
<h5 class="modal-title"><i class="fas fa-fw fa-life-ring mr-2"></i>New Ticket (v1)</h5>
|
||||||
<button type="button" class="close text-white" data-dismiss="modal">
|
<button type="button" class="close text-white" data-dismiss="modal">
|
||||||
<span>×</span>
|
<span>×</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<form action="post.php" method="post" autocomplete="off">
|
<form action="post.php" method="post" autocomplete="off">
|
||||||
|
|
||||||
<?php if (isset($_GET['project_id'])) { ?>
|
<?php if (isset($_GET['project_id'])) { ?>
|
||||||
<input type="hidden" name="project" value="<?php echo intval($_GET['project_id']); ?>">
|
<input type="hidden" name="project" value="<?php echo intval($_GET['project_id']); ?>">
|
||||||
@@ -36,7 +45,9 @@
|
|||||||
|
|
||||||
<div class="tab-pane fade show active" id="pills-ticket-details">
|
<div class="tab-pane fade show active" id="pills-ticket-details">
|
||||||
|
|
||||||
<?php if (empty($_GET['client_id'])) { ?>
|
<?php if ($client_id) { ?>
|
||||||
|
<input type="hidden" name="client" value="<?= $client_id ?>">
|
||||||
|
<?php } else { ?>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Client <strong class="text-danger">*</strong> / <span class="text-secondary">Use Primary Contact</label>
|
<label>Client <strong class="text-danger">*</strong> / <span class="text-secondary">Use Primary Contact</label>
|
||||||
@@ -50,9 +61,9 @@
|
|||||||
|
|
||||||
$sql = mysqli_query($mysqli, "SELECT client_id, client_name FROM clients WHERE client_archived_at IS NULL $access_permission_query ORDER BY client_name ASC");
|
$sql = mysqli_query($mysqli, "SELECT client_id, client_name FROM clients WHERE client_archived_at IS NULL $access_permission_query ORDER BY client_name ASC");
|
||||||
while ($row = mysqli_fetch_array($sql)) {
|
while ($row = mysqli_fetch_array($sql)) {
|
||||||
$client_id = intval($row['client_id']);
|
$client_id_select = intval($row['client_id']);
|
||||||
$client_name = nullable_htmlentities($row['client_name']); ?>
|
$client_name = nullable_htmlentities($row['client_name']); ?>
|
||||||
<option value="<?php echo $client_id; ?>"><?php echo $client_name; ?></option>
|
<option value="<?php echo $client_id_select; ?>"><?php echo $client_name; ?></option>
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</select>
|
</select>
|
||||||
@@ -223,7 +234,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if (isset($_GET['client_id'])) { ?>
|
<?php if($client_id) { ?>
|
||||||
|
|
||||||
<div class="tab-pane fade" id="pills-ticket-contacts">
|
<div class="tab-pane fade" id="pills-ticket-contacts">
|
||||||
|
|
||||||
@@ -264,9 +275,9 @@
|
|||||||
?>
|
?>
|
||||||
<option value="<?php echo $contact_id_select; ?>"
|
<option value="<?php echo $contact_id_select; ?>"
|
||||||
<?php
|
<?php
|
||||||
if (isset($_GET['contact_id']) && $contact_id_select == intval($_GET['contact_id'])) {
|
if ($contact_id == $contact_id_select) {
|
||||||
echo "selected";
|
echo "selected";
|
||||||
} elseif (empty($_GET['contact_id']) && $contact_primary_select == 1) {
|
} elseif (!$contact_id && $contact_primary_select == 1) {
|
||||||
echo "selected";
|
echo "selected";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -320,8 +331,7 @@
|
|||||||
$asset_contact_name_select = nullable_htmlentities($row['contact_name']);
|
$asset_contact_name_select = nullable_htmlentities($row['contact_name']);
|
||||||
?>
|
?>
|
||||||
<option value="<?php echo $asset_id_select; ?>"
|
<option value="<?php echo $asset_id_select; ?>"
|
||||||
<?php if (isset($_GET['asset_id']) && $asset_id_select == $_GET['asset_id']) { echo "selected"; }
|
<?php if ($asset_id == $asset_id_select) { echo "selected"; }?>
|
||||||
?>
|
|
||||||
><?php echo "$asset_name_select - $asset_contact_name_select"; ?></option>
|
><?php echo "$asset_name_select - $asset_contact_name_select"; ?></option>
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
@@ -433,7 +443,7 @@
|
|||||||
while ($row = mysqli_fetch_array($sql_projects)) {
|
while ($row = mysqli_fetch_array($sql_projects)) {
|
||||||
$project_id_select = intval($row['project_id']);
|
$project_id_select = intval($row['project_id']);
|
||||||
$project_name_select = nullable_htmlentities($row['project_name']); ?>
|
$project_name_select = nullable_htmlentities($row['project_name']); ?>
|
||||||
<option <?php if (isset($_GET['project_id']) && $project_id_select == $_GET['project_id']) { echo "selected"; } ?> value="<?php echo $project_id_select; ?>"><?php echo $project_name_select; ?></option>
|
<option <?php if ($project_id == $project_id_select) { echo "selected"; } ?> value="<?php echo $project_id_select; ?>"><?php echo $project_name_select; ?></option>
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</select>
|
</select>
|
||||||
@@ -451,10 +461,7 @@
|
|||||||
<button type="submit" name="add_ticket" class="btn btn-primary text-bold"><i class="fas fa-check mr-2"></i>Create</button>
|
<button type="submit" name="add_ticket" class="btn btn-primary text-bold"><i class="fas fa-check mr-2"></i>Create</button>
|
||||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fas fa-times mr-2"></i>Cancel</button>
|
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fas fa-times mr-2"></i>Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
@@ -484,3 +491,7 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
require_once '../../../includes/modal_footer.php';
|
||||||
|
|||||||
@@ -1,22 +1,27 @@
|
|||||||
<div class="modal" id="addTicketModalv2" tabindex="-1">
|
<?php
|
||||||
<div class="modal-dialog modal-lg">
|
|
||||||
<div class="modal-content">
|
require_once '../../../includes/modal_header.php';
|
||||||
<div class="modal-header bg-dark">
|
|
||||||
|
$client_id = intval($_GET['client_id'] ?? 0);
|
||||||
|
$contact_id = intval($_GET['contact_id'] ?? 0);
|
||||||
|
$project_id = intval($_GET['project_id'] ?? 0);
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
|
||||||
|
?>
|
||||||
|
<div class="modal-header bg-dark">
|
||||||
<h5 class="modal-title"><i class="fas fa-fw fa-life-ring mr-2"></i>New Ticket (v2)</h5>
|
<h5 class="modal-title"><i class="fas fa-fw fa-life-ring mr-2"></i>New Ticket (v2)</h5>
|
||||||
<button type="button" class="close text-white" data-dismiss="modal">
|
<button type="button" class="close text-white" data-dismiss="modal">
|
||||||
<span>×</span>
|
<span>×</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<form action="post.php" method="post" autocomplete="off">
|
<form action="post.php" method="post" autocomplete="off">
|
||||||
<!-- Hidden/System fields -->
|
<!-- Hidden/System fields -->
|
||||||
<?php if ($client_url && isset($client_id)) { ?>
|
<?php if ($client_id) { ?>
|
||||||
<input type="hidden" name="client" value="<?php echo $client_id; ?>>">
|
<input type="hidden" name="client" value="<?php echo $client_id; ?>>">
|
||||||
<?php }
|
<?php } ?>
|
||||||
if (isset($_GET['contact_id'])) { ?>
|
<?php if ($project_id) { ?>
|
||||||
<input type="hidden" name="contact" value="<?php echo intval($_GET['contact_id']); ?>">
|
<input type="hidden" name="project" value="<?php echo $project_id; ?>">
|
||||||
<?php }
|
|
||||||
if (isset($_GET['project_id'])) { ?>
|
|
||||||
<input type="hidden" name="project" value="<?php echo intval($_GET['project_id']); ?>">
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<input type="hidden" name="billable" value="0">
|
<input type="hidden" name="billable" value="0">
|
||||||
|
|
||||||
@@ -27,8 +32,7 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link active" data-toggle="pill" href="#pills-add-details"><i class="fa fa-fw fa-life-ring mr-2"></i>Details</a>
|
<a class="nav-link active" data-toggle="pill" href="#pills-add-details"><i class="fa fa-fw fa-life-ring mr-2"></i>Details</a>
|
||||||
</li>
|
</li>
|
||||||
<!-- Hide contact if in URL as it means we're creating a ticket from a contact record -->
|
<?php if (!$contact_id) { ?>
|
||||||
<?php if (!isset($_GET['contact_id'])) { ?>
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" data-toggle="pill" href="#pills-add-contacts"><i class="fa fa-fw fa-users mr-2"></i>Contact</a>
|
<a class="nav-link" data-toggle="pill" href="#pills-add-contacts"><i class="fa fa-fw fa-users mr-2"></i>Contact</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -183,7 +187,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Ticket client/contact -->
|
<!-- Ticket client/contact -->
|
||||||
<?php if (!isset($_GET['contact_id'])) { ?>
|
<?php if ($contact_id) { ?>
|
||||||
|
<input type="hidden" name="contact" value="<?php echo $contact_id; ?>">
|
||||||
|
<?php } else { ?>
|
||||||
<div class="tab-pane fade" id="pills-add-contacts">
|
<div class="tab-pane fade" id="pills-add-contacts">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@@ -192,16 +198,16 @@
|
|||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<select class="form-control select2" name="client" id="changeClientSelect" required <?php if ($client_url && isset($client_id)) { echo "disabled"; } ?>>
|
<select class="form-control select2" name="client" id="changeClientSelect" required <?php if ($client_id) { echo "disabled"; } ?>>
|
||||||
<option value="">- Client -</option>
|
<option value="">- Client -</option>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$sql = mysqli_query($mysqli, "SELECT * FROM clients WHERE client_lead = 0 AND client_archived_at IS NULL $access_permission_query ORDER BY client_name ASC");
|
$sql = mysqli_query($mysqli, "SELECT * FROM clients WHERE client_lead = 0 AND client_archived_at IS NULL $access_permission_query ORDER BY client_name ASC");
|
||||||
while ($row = mysqli_fetch_array($sql)) {
|
while ($row = mysqli_fetch_array($sql)) {
|
||||||
$selectable_client_id = intval($row['client_id']);
|
$client_id_select = intval($row['client_id']);
|
||||||
$client_name = nullable_htmlentities($row['client_name']); ?>
|
$client_name = nullable_htmlentities($row['client_name']); ?>
|
||||||
|
|
||||||
<option value="<?php echo $selectable_client_id; ?>" <?php if ($client_url && isset($client_id) && $client_id == $selectable_client_id) {echo "selected"; } ?>><?php echo $client_name; ?></option>
|
<option value="<?php echo $client_id_select; ?>" <?php if ($client_id == $client_id_select) {echo "selected"; } ?>><?php echo $client_name; ?></option>
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</select>
|
</select>
|
||||||
@@ -226,7 +232,7 @@
|
|||||||
To-do: project, etc.
|
To-do: project, etc.
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label> Asset </label>
|
<label>Asset</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-desktop"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-desktop"></i></span>
|
||||||
@@ -237,7 +243,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label> Location </label>
|
<label>Location</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-map-marker-alt"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-map-marker-alt"></i></span>
|
||||||
@@ -251,7 +257,7 @@
|
|||||||
|
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label> Vendor </label>
|
<label>Vendor</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-building"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-building"></i></span>
|
||||||
@@ -287,10 +293,7 @@
|
|||||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fas fa-times mr-2"></i>Cancel</button>
|
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fas fa-times mr-2"></i>Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Ticket Templates -->
|
<!-- Ticket Templates -->
|
||||||
<script>
|
<script>
|
||||||
@@ -323,7 +326,10 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Ticket Client/Contact JS -->
|
<!-- Ticket Client/Contact JS -->
|
||||||
<link rel="stylesheet" href="../plugins/jquery-ui/jquery-ui.min.css">
|
<link rel="stylesheet" href="/plugins/jquery-ui/jquery-ui.min.css">
|
||||||
<script src="../plugins/jquery-ui/jquery-ui.min.js"></script>
|
<script src="/plugins/jquery-ui/jquery-ui.min.js"></script>
|
||||||
<script src="js/tickets_add_modal.js"></script>
|
<script src="/agent/js/tickets_add_modal.js"></script>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
require_once '../../../includes/modal_footer.php';
|
||||||
|
|||||||
29
agent/modals/vendor/vendor_add.php
vendored
29
agent/modals/vendor/vendor_add.php
vendored
@@ -1,14 +1,20 @@
|
|||||||
<div class="modal" id="addVendorModal" tabindex="-1">
|
<?php
|
||||||
<div class="modal-dialog">
|
|
||||||
<div class="modal-content">
|
require_once '../../../includes/modal_header.php';
|
||||||
<div class="modal-header bg-dark">
|
|
||||||
|
$client_id = intval($_GET['client_id'] ?? 0);
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
|
||||||
|
?>
|
||||||
|
<div class="modal-header bg-dark">
|
||||||
<h5 class="modal-title"><i class="fas fa-fw fa-building mr-2"></i>New Vendor</h5>
|
<h5 class="modal-title"><i class="fas fa-fw fa-building mr-2"></i>New Vendor</h5>
|
||||||
<button type="button" class="close text-white" data-dismiss="modal">
|
<button type="button" class="close text-white" data-dismiss="modal">
|
||||||
<span>×</span>
|
<span>×</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<form action="post.php" method="post" autocomplete="off">
|
<form action="post.php" method="post" autocomplete="off">
|
||||||
<input type="hidden" name="client_id" value="<?php if (isset($_GET['client_id'])) { echo $client_id; } else { echo 0; } ?>">
|
<input type="hidden" name="client_id" value="<?= $client_id ?>">
|
||||||
|
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<ul class="nav nav-pills nav-justified mb-3">
|
<ul class="nav nav-pills nav-justified mb-3">
|
||||||
@@ -153,7 +159,8 @@
|
|||||||
<button type="submit" name="add_vendor" class="btn btn-primary text-bold"><i class="fas fa-check mr-2"></i>Create</button>
|
<button type="submit" name="add_vendor" class="btn btn-primary text-bold"><i class="fas fa-check mr-2"></i>Create</button>
|
||||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
|
||||||
</div>
|
<?php
|
||||||
</div>
|
|
||||||
|
require_once '../../../includes/modal_footer.php';
|
||||||
|
|||||||
@@ -184,8 +184,8 @@ if (isset($_GET['project_id'])) {
|
|||||||
<i class="fas fa-fw fa-plus mr-2"></i>New
|
<i class="fas fa-fw fa-plus mr-2"></i>New
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addTicketModal">
|
<a class="dropdown-item text-dark ajax-modal" href="#" data-modal-url="modals/ticket/ticket_add.php?<?= $client_url ?>&project_id=<?= $project_id ?>" data-modal-size="lg">
|
||||||
<i class="fas fa-fw fa-life-ring mr-2"></i>Ticket
|
<i class="fa fa-fw fa-life-ring mr-2"></i>Ticket
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -541,7 +541,6 @@ if (isset($_GET['project_id'])) {
|
|||||||
|
|
||||||
require_once "modals/project/project_link_ticket.php";
|
require_once "modals/project/project_link_ticket.php";
|
||||||
require_once "modals/project/project_link_closed_ticket.php";
|
require_once "modals/project/project_link_closed_ticket.php";
|
||||||
require_once "modals/ticket/ticket_add.php";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ $order = "ASC";
|
|||||||
if (isset($_GET['client_id'])) {
|
if (isset($_GET['client_id'])) {
|
||||||
require_once "includes/inc_all_client.php";
|
require_once "includes/inc_all_client.php";
|
||||||
$client_query = "AND project_client_id = $client_id";
|
$client_query = "AND project_client_id = $client_id";
|
||||||
|
|
||||||
$client_url = "client_id=$client_id&";
|
$client_url = "client_id=$client_id&";
|
||||||
} else {
|
} else {
|
||||||
require_once "includes/inc_all.php";
|
require_once "includes/inc_all.php";
|
||||||
@@ -55,7 +54,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
<h3 class="card-title mt-2"><i class="fas fa-fw fa-project-diagram mr-2"></i>Projects</h3>
|
<h3 class="card-title mt-2"><i class="fas fa-fw fa-project-diagram mr-2"></i>Projects</h3>
|
||||||
<?php if (lookupUserPermission("module_support") >= 2) { ?>
|
<?php if (lookupUserPermission("module_support") >= 2) { ?>
|
||||||
<div class="card-tools">
|
<div class="card-tools">
|
||||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addProjectModal"><i class="fas fa-plus"></i><span class="d-none d-lg-inline ml-2">New Project</span></button>
|
<button type="button" class="btn btn-primary ajax-modal" data-modal-url="modals/project/project_add.php?<?= $client_url ?>"><i class="fas fa-plus"></i><span class="d-none d-lg-inline ml-2">New Project</span></button>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
@@ -316,5 +315,4 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
require_once "modals/project/project_add.php";
|
|
||||||
require_once "../includes/footer.php";
|
require_once "../includes/footer.php";
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
<h3 class="card-title mt-2"><i class="fas fa-fw fa-redo-alt mr-2"></i>Recurring Tickets</h3>
|
<h3 class="card-title mt-2"><i class="fas fa-fw fa-redo-alt mr-2"></i>Recurring Tickets</h3>
|
||||||
<div class='card-tools'>
|
<div class='card-tools'>
|
||||||
<div class="float-left">
|
<div class="float-left">
|
||||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addRecurringTicketModal">
|
<button type="button" class="btn btn-primary ajax-modal" data-modal-url="modals/recurring_ticket/recurring_ticket_add.php?<?= $client_url ?>" data-modal-size="lg">
|
||||||
<i class="fas fa-plus"></i><span class="d-none d-lg-inline ml-2">New Recurring Ticket</span>
|
<i class="fas fa-plus"></i><span class="d-none d-lg-inline ml-2">New Recurring Ticket</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -365,5 +365,4 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
<script src="../js/bulk_actions.js"></script>
|
<script src="../js/bulk_actions.js"></script>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
require_once "modals/recurring_ticket/recurring_ticket_add.php";
|
|
||||||
require_once "../includes/footer.php";
|
require_once "../includes/footer.php";
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ $sql_categories_filter = mysqli_query(
|
|||||||
<?php if (lookupUserPermission("module_support") >= 2) { ?>
|
<?php if (lookupUserPermission("module_support") >= 2) { ?>
|
||||||
<div class="card-tools">
|
<div class="card-tools">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addTicketModalv2">
|
<button type="button" class="btn btn-primary ajax-modal" data-modal-url="modals/ticket/ticket_add_v2.php?<?= $client_url ?>" data-modal-size="lg">
|
||||||
<i class="fas fa-plus"></i><span class="d-none d-lg-inline ml-2">New Ticket</span>
|
<i class="fas fa-plus"></i><span class="d-none d-lg-inline ml-2">New Ticket</span>
|
||||||
</button>
|
</button>
|
||||||
<?php if ($num_rows[0] > 0) { ?>
|
<?php if ($num_rows[0] > 0) { ?>
|
||||||
@@ -391,6 +391,5 @@ if (isset($_GET["view"])) {
|
|||||||
<script src="../js/bulk_actions.js"></script>
|
<script src="../js/bulk_actions.js"></script>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
require_once "modals/ticket/ticket_add_v2.php";
|
|
||||||
require_once "modals/ticket/ticket_export.php";
|
require_once "modals/ticket/ticket_export.php";
|
||||||
require_once "../includes/footer.php";
|
require_once "../includes/footer.php";
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
</h3>
|
</h3>
|
||||||
<div class="card-tools">
|
<div class="card-tools">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addVendorModal">
|
<button type="button" class="btn btn-primary ajax-modal" data-modal-url="modals/vendor/vendor_add.php?<?= $client_url ?>">
|
||||||
<i class="fas fa-plus mr-2"></i>New Vendor
|
<i class="fas fa-plus mr-2"></i>New Vendor
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown"></button>
|
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown"></button>
|
||||||
@@ -283,7 +283,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
<script src="../js/bulk_actions.js"></script>
|
<script src="../js/bulk_actions.js"></script>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
require_once "modals/vendor/vendor_add.php";
|
|
||||||
require_once "modals/vendor/vendor_add_from_template.php";
|
require_once "modals/vendor/vendor_add_from_template.php";
|
||||||
require_once "modals/vendor/vendor_export.php";
|
require_once "modals/vendor/vendor_export.php";
|
||||||
require_once "../includes/footer.php";
|
require_once "../includes/footer.php";
|
||||||
|
|||||||
Reference in New Issue
Block a user