mirror of https://github.com/itflow-org/itflow
Migrate Add Ticket, Recurring Ticket, Project and Vendor to the new ajax-modal
This commit is contained in:
parent
a55dabb1cd
commit
c12bfb157e
|
|
@ -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,120 +1,127 @@
|
||||||
<div class="modal" id="addProjectModal" tabindex="-1">
|
<?php
|
||||||
<div class="modal-dialog">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header bg-dark">
|
|
||||||
<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">
|
|
||||||
<span>×</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<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">
|
require_once '../../../includes/modal_header.php';
|
||||||
|
|
||||||
<div class="form-group">
|
$client_id = intval($_GET['client_id'] ?? 0);
|
||||||
<label>Project Name <strong class="text-danger">*</strong></label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-project-diagram"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="name" placeholder="Project Name" maxlength="255" required autofocus>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
ob_start();
|
||||||
<label>Template</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-cube"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="project_template_id">
|
|
||||||
<option value="">- Template -</option>
|
|
||||||
<?php
|
|
||||||
$sql = mysqli_query($mysqli, "SELECT * FROM project_templates WHERE project_template_archived_at IS NULL ORDER BY project_template_name ASC");
|
|
||||||
while ($row = mysqli_fetch_array($sql)) {
|
|
||||||
$project_template_id = intval($row['project_template_id']);
|
|
||||||
$project_template_name = nullable_htmlentities($row['project_template_name']);
|
|
||||||
?>
|
|
||||||
<option value="<?php echo $project_template_id; ?>"><?php echo $project_template_name; ?></option>
|
|
||||||
<?php } ?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
?>
|
||||||
<label>Description</label>
|
<div class="modal-header bg-dark">
|
||||||
<div class="input-group">
|
<h5 class="modal-title"><i class="fas fa-fw fa-project-diagram mr-2"></i>New Project</h5>
|
||||||
<div class="input-group-prepend">
|
<button type="button" class="close text-white" data-dismiss="modal">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-angle-right"></i></span>
|
<span>×</span>
|
||||||
</div>
|
</button>
|
||||||
<input type="text" class="form-control" name="description" placeholder="Description">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Date Due <strong class="text-danger">*</strong></label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="date" class="form-control" name="due_date" required>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Project Manager</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-user-tie"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="project_manager">
|
|
||||||
<option value="0">No Manager</option>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$sql = mysqli_query(
|
|
||||||
$mysqli,
|
|
||||||
"SELECT user_id, user_name FROM users
|
|
||||||
WHERE user_role_id > 1 AND user_status = 1 AND user_archived_at IS NULL ORDER BY user_name ASC"
|
|
||||||
);
|
|
||||||
while ($row = mysqli_fetch_array($sql)) {
|
|
||||||
$user_id = intval($row['user_id']);
|
|
||||||
$user_name = nullable_htmlentities($row['user_name']); ?>
|
|
||||||
<option value="<?php echo $user_id; ?>"><?php echo $user_name; ?></option>
|
|
||||||
<?php } ?>
|
|
||||||
</select>
|
|
||||||
</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 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="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<form action="post.php" method="post" autocomplete="off">
|
||||||
|
|
||||||
|
<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">
|
||||||
|
<label>Project Name <strong class="text-danger">*</strong></label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-project-diagram"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="name" placeholder="Project Name" maxlength="255" required autofocus>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Template</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-cube"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="project_template_id">
|
||||||
|
<option value="">- Template -</option>
|
||||||
|
<?php
|
||||||
|
$sql = mysqli_query($mysqli, "SELECT * FROM project_templates WHERE project_template_archived_at IS NULL ORDER BY project_template_name ASC");
|
||||||
|
while ($row = mysqli_fetch_array($sql)) {
|
||||||
|
$project_template_id = intval($row['project_template_id']);
|
||||||
|
$project_template_name = nullable_htmlentities($row['project_template_name']);
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $project_template_id; ?>"><?php echo $project_template_name; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Description</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-angle-right"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="description" placeholder="Description">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Date Due <strong class="text-danger">*</strong></label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="date" class="form-control" name="due_date" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Project Manager</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-user-tie"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="project_manager">
|
||||||
|
<option value="0">No Manager</option>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT user_id, user_name FROM users
|
||||||
|
WHERE user_role_id > 1 AND user_status = 1 AND user_archived_at IS NULL ORDER BY user_name ASC"
|
||||||
|
);
|
||||||
|
while ($row = mysqli_fetch_array($sql)) {
|
||||||
|
$user_id = intval($row['user_id']);
|
||||||
|
$user_name = nullable_htmlentities($row['user_name']); ?>
|
||||||
|
<option value="<?php echo $user_id; ?>"><?php echo $user_name; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<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="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
require_once '../../../includes/modal_footer.php';
|
||||||
|
|
|
||||||
|
|
@ -1,348 +1,358 @@
|
||||||
<div class="modal" id="addRecurringTicketModal" tabindex="-1">
|
<?php
|
||||||
<div class="modal-dialog modal-lg">
|
|
||||||
<div class="modal-content">
|
|
||||||
<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>
|
|
||||||
<button type="button" class="close text-white" data-dismiss="modal">
|
|
||||||
<span>×</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<form action="post.php" method="post" autocomplete="off">
|
|
||||||
<?php if (isset($client_id)) { ?>
|
|
||||||
<input type="hidden" name="client" value="<?php echo $client_id; ?>>">
|
|
||||||
<?php } ?>
|
|
||||||
<input type="hidden" name="billable" value="0">
|
|
||||||
|
|
||||||
<div class="modal-body">
|
require_once '../../../includes/modal_header.php';
|
||||||
|
|
||||||
<ul class="nav nav-pills nav-justified mb-3">
|
$client_id = intval($_GET['client_id'] ?? 0);
|
||||||
<li class="nav-item">
|
$contact_id = intval($_GET['contact_id'] ?? 0);
|
||||||
<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>
|
$asset_id = intval($_GET['asset_id'] ?? 0);
|
||||||
</li>
|
|
||||||
<?php if (!isset($_GET['contact_id'])) { ?>
|
|
||||||
<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>
|
|
||||||
</li>
|
|
||||||
<?php } ?>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" data-toggle="pill" href="#pills-add-schedule"><i class="fa fa-fw fa-building mr-2"></i>Schedule</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" data-toggle="pill" href="#pills-add-assets"><i class="fa fa-fw fa-desktop mr-2"></i>Assets</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="tab-content">
|
ob_start();
|
||||||
|
|
||||||
<div class="tab-pane fade show active" id="pills-add-details">
|
?>
|
||||||
|
<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>
|
||||||
|
<button type="button" class="close text-white" data-dismiss="modal">
|
||||||
|
<span>×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<form action="post.php" method="post" autocomplete="off">
|
||||||
|
<?php if (isset($client_id)) { ?>
|
||||||
|
<input type="hidden" name="client" value="<?php echo $client_id; ?>>">
|
||||||
|
<?php } ?>
|
||||||
|
<input type="hidden" name="billable" value="0">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="modal-body">
|
||||||
<label>Subject <strong class="text-danger">*</strong></label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="subject" placeholder="Subject" maxlength="500" required>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
<ul class="nav nav-pills nav-justified mb-3">
|
||||||
<textarea class="form-control tinymceTicket" name="details"></textarea>
|
<li class="nav-item">
|
||||||
</div>
|
<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>
|
||||||
|
<?php if (!$contact_id) { ?>
|
||||||
|
<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>
|
||||||
|
</li>
|
||||||
|
<?php } ?>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" data-toggle="pill" href="#pills-add-schedule"><i class="fa fa-fw fa-building mr-2"></i>Schedule</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" data-toggle="pill" href="#pills-add-assets"><i class="fa fa-fw fa-desktop mr-2"></i>Assets</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<div class="row">
|
<div class="tab-content">
|
||||||
|
|
||||||
<div class="col">
|
<div class="tab-pane fade show active" id="pills-add-details">
|
||||||
<div class="form-group">
|
|
||||||
<label>Priority <strong class="text-danger">*</strong></label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-thermometer-half"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="priority" required>
|
|
||||||
<option>Low</option>
|
|
||||||
<option>Medium</option>
|
|
||||||
<option>High</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col">
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Category</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-layer-group"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="category">
|
|
||||||
<option value="0">- Not Categorized -</option>
|
|
||||||
<?php
|
|
||||||
$sql_categories = mysqli_query($mysqli, "SELECT category_id, category_name FROM categories WHERE category_type = 'Ticket' AND category_archived_at IS NULL ORDER BY category_name ASC");
|
|
||||||
while ($row = mysqli_fetch_array($sql_categories)) {
|
|
||||||
$category_id = intval($row['category_id']);
|
|
||||||
$category_name = nullable_htmlentities($row['category_name']);
|
|
||||||
|
|
||||||
?>
|
|
||||||
<option value="<?php echo $category_id; ?>"><?php echo $category_name; ?></option>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
<div class="input-group-append">
|
|
||||||
<button class="btn btn-secondary ajax-modal" type="button"
|
|
||||||
data-modal-url="../admin/modals/category/category_add.php?category=Ticket">
|
|
||||||
<i class="fas fa-fw fa-plus"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Assign to</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-user-check"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="assigned_to">
|
|
||||||
<option value="0">- Not Assigned -</option>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$sql = mysqli_query(
|
|
||||||
$mysqli,
|
|
||||||
"SELECT user_id, user_name FROM users
|
|
||||||
WHERE user_type = 1 AND user_status = 1 AND user_archived_at IS NULL ORDER BY user_name ASC"
|
|
||||||
);
|
|
||||||
while ($row = mysqli_fetch_array($sql)) {
|
|
||||||
$user_id = intval($row['user_id']);
|
|
||||||
$user_name = nullable_htmlentities($row['user_name']); ?>
|
|
||||||
<option value="<?php echo $user_id; ?>"><?php echo $user_name; ?></option>
|
|
||||||
<?php } ?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php if ($config_module_enable_accounting) { ?>
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="custom-control custom-switch">
|
|
||||||
<input type="checkbox" class="custom-control-input" name="billable" <?php if ($config_ticket_default_billable == 1) { echo "checked"; } ?> value="1" id="billable">
|
|
||||||
<label class="custom-control-label" for="billable">Mark Billable</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Subject <strong class="text-danger">*</strong></label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
|
||||||
</div>
|
</div>
|
||||||
|
<input type="text" class="form-control" name="subject" placeholder="Subject" maxlength="500" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<?php if (!isset($_GET['contact_id'])) { ?>
|
<div class="form-group">
|
||||||
<div class="tab-pane fade" id="pills-add-contacts">
|
<textarea class="form-control tinymceTicket" name="details"></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="row">
|
||||||
<label>Client <strong class="text-danger">*</strong></label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="client" id="changeClientSelect" required <?php if (isset($client_id)) { echo "disabled"; } ?>>
|
|
||||||
<option value="">- Client -</option>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$sql = mysqli_query($mysqli, "SELECT * FROM clients WHERE client_archived_at IS NULL $access_permission_query ORDER BY client_name ASC");
|
<div class="col">
|
||||||
while ($row = mysqli_fetch_array($sql)) {
|
<div class="form-group">
|
||||||
$selectable_client_id = intval($row['client_id']);
|
<label>Priority <strong class="text-danger">*</strong></label>
|
||||||
$client_name = nullable_htmlentities($row['client_name']); ?>
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
<option value="<?php echo $selectable_client_id; ?>" <?php if (isset($client_id) && $client_id == $selectable_client_id) {echo "selected"; } ?>><?php echo $client_name; ?></option>
|
<span class="input-group-text"><i class="fa fa-fw fa-thermometer-half"></i></span>
|
||||||
|
|
||||||
<?php } ?>
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<select class="form-control select2" name="priority" required>
|
||||||
|
<option>Low</option>
|
||||||
|
<option>Medium</option>
|
||||||
<div class="form-group">
|
<option>High</option>
|
||||||
<label>Contact </label>
|
</select>
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="contact" id="contactSelect">
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="contacts-section">
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php } else { ?>
|
</div>
|
||||||
<input type="hidden" name="client" value="<?php echo $client_id; ?>">
|
|
||||||
<input type="hidden" name="contact" value="<?php echo intval($_GET['contact_id']); ?>">
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<div class="tab-pane fade" id="pills-add-schedule">
|
<div class="col">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Category</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-layer-group"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="category">
|
||||||
|
<option value="0">- Not Categorized -</option>
|
||||||
|
<?php
|
||||||
|
$sql_categories = mysqli_query($mysqli, "SELECT category_id, category_name FROM categories WHERE category_type = 'Ticket' AND category_archived_at IS NULL ORDER BY category_name ASC");
|
||||||
|
while ($row = mysqli_fetch_array($sql_categories)) {
|
||||||
|
$category_id = intval($row['category_id']);
|
||||||
|
$category_name = nullable_htmlentities($row['category_name']);
|
||||||
|
|
||||||
<div class="form-group">
|
?>
|
||||||
<label>Frequency <strong class="text-danger">*</strong></label>
|
<option value="<?php echo $category_id; ?>"><?php echo $category_name; ?></option>
|
||||||
<div class="input-group">
|
<?php } ?>
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-recycle"></i></span>
|
</select>
|
||||||
</div>
|
<div class="input-group-append">
|
||||||
<select class="form-control select2" name="frequency" required>
|
<button class="btn btn-secondary ajax-modal" type="button"
|
||||||
<optgroup label="Days">
|
data-modal-url="../admin/modals/category/category_add.php?category=Ticket">
|
||||||
<option>Three Days</option>
|
<i class="fas fa-fw fa-plus"></i>
|
||||||
<option>Weekly</option>
|
</button>
|
||||||
<option>Biweekly</option>
|
|
||||||
</optgroup>
|
|
||||||
<optgroup label="Months">
|
|
||||||
<option>Monthly</option>
|
|
||||||
<option>Quarterly</option>
|
|
||||||
<option>Biannually</option>
|
|
||||||
<option>Annually</option>
|
|
||||||
</optgroup>
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Starting date <strong class="text-danger">*</strong></label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-calendar-day"></i></span>
|
|
||||||
</div>
|
|
||||||
<input class="form-control" type="date" name="start_date" min="<?php echo date("Y-m-d"); ?>" max="2999-12-31" required>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tab-pane fade" id="pills-add-assets">
|
|
||||||
|
|
||||||
<?php if (isset($client_id)) { ?>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Asset</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-desktop"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="asset">
|
|
||||||
<option value="0">- None -</option>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
// Query assets ordered by type, then name
|
|
||||||
$sql_assets = mysqli_query($mysqli, "
|
|
||||||
SELECT asset_id, asset_name, asset_type, asset_make, asset_model, contact_name
|
|
||||||
FROM assets
|
|
||||||
LEFT JOIN contacts ON contact_id = asset_contact_id
|
|
||||||
WHERE asset_client_id = $client_id
|
|
||||||
AND asset_archived_at IS NULL
|
|
||||||
ORDER BY asset_type ASC, asset_name ASC
|
|
||||||
");
|
|
||||||
|
|
||||||
$current_type = null; // Track which optgroup we're in
|
|
||||||
|
|
||||||
while ($row = mysqli_fetch_array($sql_assets)) {
|
|
||||||
$asset_id_select = intval($row['asset_id']);
|
|
||||||
$asset_name_select = nullable_htmlentities($row['asset_name']);
|
|
||||||
$asset_type_select = nullable_htmlentities($row['asset_type']);
|
|
||||||
$asset_make_select = nullable_htmlentities($row['asset_make']);
|
|
||||||
$asset_model_select = nullable_htmlentities($row['asset_model']);
|
|
||||||
$contact_name_select = nullable_htmlentities($row['contact_name']);
|
|
||||||
|
|
||||||
// Start new optgroup if type changes
|
|
||||||
if ($asset_type_select !== $current_type) {
|
|
||||||
if ($current_type !== null) echo "</optgroup>";
|
|
||||||
echo "<optgroup label=\"" . ($asset_type_select ?: 'Uncategorized') . "\">";
|
|
||||||
$current_type = $asset_type_select;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build full display
|
|
||||||
$full_name = $asset_name_select . ($asset_make_select ? " - $asset_make_select" . ($asset_model_select ? " $asset_model_select" : '') : '')
|
|
||||||
. ($contact_name_select ? " - ($contact_name_select)" : '');
|
|
||||||
?>
|
|
||||||
|
|
||||||
<option value="<?= $asset_id_select ?>"><?= $full_name ?></option>
|
|
||||||
|
|
||||||
<?php }
|
|
||||||
|
|
||||||
if ($current_type_select !== null) echo "</optgroup>";
|
|
||||||
?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Additional Assets</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-desktop"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="additional_assets[]" data-tags="true" data-placeholder="- Select Additional Assets -" multiple>
|
|
||||||
<option value=""></option>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
// Query assets ordered by type then name
|
|
||||||
$sql_assets = mysqli_query($mysqli, "
|
|
||||||
SELECT asset_id, asset_name, asset_type, asset_make, asset_model, contact_name
|
|
||||||
FROM assets
|
|
||||||
LEFT JOIN contacts ON contact_id = asset_contact_id
|
|
||||||
WHERE asset_client_id = $client_id
|
|
||||||
AND asset_archived_at IS NULL
|
|
||||||
ORDER BY asset_type ASC, asset_name ASC
|
|
||||||
");
|
|
||||||
|
|
||||||
$current_type = null;
|
|
||||||
|
|
||||||
while ($row = mysqli_fetch_array($sql_assets)) {
|
|
||||||
$asset_id_select = intval($row['asset_id']);
|
|
||||||
$asset_name_select = nullable_htmlentities($row['asset_name']);
|
|
||||||
$asset_type_select = nullable_htmlentities($row['asset_type']);
|
|
||||||
$asset_make_select = nullable_htmlentities($row['asset_make']);
|
|
||||||
$asset_model_select = nullable_htmlentities($row['asset_model']);
|
|
||||||
$contact_name_select = nullable_htmlentities($row['contact_name']);
|
|
||||||
|
|
||||||
// Start new optgroup if type changes
|
|
||||||
if ($asset_type_select !== $current_type) {
|
|
||||||
if ($current_type !== null) echo "</optgroup>";
|
|
||||||
echo "<optgroup label=\"" . ($asset_type_select ?: 'Uncategorized') . "\">";
|
|
||||||
$current_type = $asset_type_select;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build full display
|
|
||||||
$full_name = $asset_name_select . ($asset_make_select ? " - $asset_make_select" . ($asset_model_select ? " $asset_model_select" : '') : '')
|
|
||||||
. ($contact_name_select ? " - ($contact_name_select)" : '');
|
|
||||||
?>
|
|
||||||
|
|
||||||
<option value="<?= $asset_id_select ?>"><?= $full_name ?></option>
|
|
||||||
|
|
||||||
<?php }
|
|
||||||
|
|
||||||
if ($current_type !== null) echo "</optgroup>";
|
|
||||||
?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="submit" name="add_recurring_ticket" class="btn btn-primary text-bold"><i class="fas fa-check mr-2"></i>Create</button>
|
<div class="form-group">
|
||||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fas fa-times mr-2"></i>Cancel</button>
|
<label>Assign to</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-user-check"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="assigned_to">
|
||||||
|
<option value="0">- Not Assigned -</option>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT user_id, user_name FROM users
|
||||||
|
WHERE user_type = 1 AND user_status = 1 AND user_archived_at IS NULL ORDER BY user_name ASC"
|
||||||
|
);
|
||||||
|
while ($row = mysqli_fetch_array($sql)) {
|
||||||
|
$user_id = intval($row['user_id']);
|
||||||
|
$user_name = nullable_htmlentities($row['user_name']); ?>
|
||||||
|
<option value="<?php echo $user_id; ?>"><?php echo $user_name; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
|
<?php if ($config_module_enable_accounting) { ?>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="custom-control custom-switch">
|
||||||
|
<input type="checkbox" class="custom-control-input" name="billable" <?php if ($config_ticket_default_billable == 1) { echo "checked"; } ?> value="1" id="billable">
|
||||||
|
<label class="custom-control-label" for="billable">Mark Billable</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?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="form-group">
|
||||||
|
<label>Client <strong class="text-danger">*</strong></label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="client" id="changeClientSelect" required <?php if ($client_id) { echo "disabled"; } ?>>
|
||||||
|
<option value="">- 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 if ($client_id == $client_id_select) {echo "selected"; } ?>><?php echo $client_name; ?></option>
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Contact </label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="contact" id="contactSelect">
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="contacts-section">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
<div class="tab-pane fade" id="pills-add-schedule">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Frequency <strong class="text-danger">*</strong></label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-recycle"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="frequency" required>
|
||||||
|
<optgroup label="Days">
|
||||||
|
<option>Three Days</option>
|
||||||
|
<option>Weekly</option>
|
||||||
|
<option>Biweekly</option>
|
||||||
|
</optgroup>
|
||||||
|
<optgroup label="Months">
|
||||||
|
<option>Monthly</option>
|
||||||
|
<option>Quarterly</option>
|
||||||
|
<option>Biannually</option>
|
||||||
|
<option>Annually</option>
|
||||||
|
</optgroup>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Starting date <strong class="text-danger">*</strong></label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-calendar-day"></i></span>
|
||||||
|
</div>
|
||||||
|
<input class="form-control" type="date" name="start_date" min="<?php echo date("Y-m-d"); ?>" max="2999-12-31" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tab-pane fade" id="pills-add-assets">
|
||||||
|
|
||||||
|
<?php if ($client_id) { ?>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Asset</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-desktop"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="asset">
|
||||||
|
<option value="0">- None -</option>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Query assets ordered by type, then name
|
||||||
|
$sql_assets = mysqli_query($mysqli, "
|
||||||
|
SELECT asset_id, asset_name, asset_type, asset_make, asset_model, contact_name
|
||||||
|
FROM assets
|
||||||
|
LEFT JOIN contacts ON contact_id = asset_contact_id
|
||||||
|
WHERE asset_client_id = $client_id
|
||||||
|
AND asset_archived_at IS NULL
|
||||||
|
ORDER BY asset_type ASC, asset_name ASC
|
||||||
|
");
|
||||||
|
|
||||||
|
$current_type = null; // Track which optgroup we're in
|
||||||
|
|
||||||
|
while ($row = mysqli_fetch_array($sql_assets)) {
|
||||||
|
$asset_id_select = intval($row['asset_id']);
|
||||||
|
$asset_name_select = nullable_htmlentities($row['asset_name']);
|
||||||
|
$asset_type_select = nullable_htmlentities($row['asset_type']);
|
||||||
|
$asset_make_select = nullable_htmlentities($row['asset_make']);
|
||||||
|
$asset_model_select = nullable_htmlentities($row['asset_model']);
|
||||||
|
$contact_name_select = nullable_htmlentities($row['contact_name']);
|
||||||
|
|
||||||
|
// Start new optgroup if type changes
|
||||||
|
if ($asset_type_select !== $current_type) {
|
||||||
|
if ($current_type !== null) echo "</optgroup>";
|
||||||
|
echo "<optgroup label=\"" . ($asset_type_select ?: 'Uncategorized') . "\">";
|
||||||
|
$current_type = $asset_type_select;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build full display
|
||||||
|
$full_name = $asset_name_select . ($asset_make_select ? " - $asset_make_select" . ($asset_model_select ? " $asset_model_select" : '') : '')
|
||||||
|
. ($contact_name_select ? " - ($contact_name_select)" : '');
|
||||||
|
?>
|
||||||
|
|
||||||
|
<option <?php if ($asset_id == $asset_id_select) { echo "selected"; } ?> value="<?= $asset_id_select ?>"><?= $full_name ?></option>
|
||||||
|
|
||||||
|
<?php }
|
||||||
|
|
||||||
|
if ($current_type_select !== null) echo "</optgroup>";
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Additional Assets</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-desktop"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="additional_assets[]" data-tags="true" data-placeholder="- Select Additional Assets -" multiple>
|
||||||
|
<option value=""></option>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Query assets ordered by type then name
|
||||||
|
$sql_assets = mysqli_query($mysqli, "
|
||||||
|
SELECT asset_id, asset_name, asset_type, asset_make, asset_model, contact_name
|
||||||
|
FROM assets
|
||||||
|
LEFT JOIN contacts ON contact_id = asset_contact_id
|
||||||
|
WHERE asset_client_id = $client_id
|
||||||
|
AND asset_archived_at IS NULL
|
||||||
|
ORDER BY asset_type ASC, asset_name ASC
|
||||||
|
");
|
||||||
|
|
||||||
|
$current_type = null;
|
||||||
|
|
||||||
|
while ($row = mysqli_fetch_array($sql_assets)) {
|
||||||
|
$asset_id_select = intval($row['asset_id']);
|
||||||
|
$asset_name_select = nullable_htmlentities($row['asset_name']);
|
||||||
|
$asset_type_select = nullable_htmlentities($row['asset_type']);
|
||||||
|
$asset_make_select = nullable_htmlentities($row['asset_make']);
|
||||||
|
$asset_model_select = nullable_htmlentities($row['asset_model']);
|
||||||
|
$contact_name_select = nullable_htmlentities($row['contact_name']);
|
||||||
|
|
||||||
|
// Start new optgroup if type changes
|
||||||
|
if ($asset_type_select !== $current_type) {
|
||||||
|
if ($current_type !== null) echo "</optgroup>";
|
||||||
|
echo "<optgroup label=\"" . ($asset_type_select ?: 'Uncategorized') . "\">";
|
||||||
|
$current_type = $asset_type_select;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build full display
|
||||||
|
$full_name = $asset_name_select . ($asset_make_select ? " - $asset_make_select" . ($asset_model_select ? " $asset_model_select" : '') : '')
|
||||||
|
. ($contact_name_select ? " - ($contact_name_select)" : '');
|
||||||
|
?>
|
||||||
|
|
||||||
|
<option value="<?= $asset_id_select ?>"><?= $full_name ?></option>
|
||||||
|
|
||||||
|
<?php }
|
||||||
|
|
||||||
|
if ($current_type !== null) echo "</optgroup>";
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="modal-footer">
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
<!-- 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,460 +1,467 @@
|
||||||
<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">
|
|
||||||
<h5 class="modal-title"><i class="fas fa-fw fa-life-ring mr-2"></i>New Ticket (v1)</h5>
|
$client_id = intval($_GET['client_id'] ?? 0);
|
||||||
<button type="button" class="close text-white" data-dismiss="modal">
|
$contact_id = intval($_GET['contact_id'] ?? 0);
|
||||||
<span>×</span>
|
$asset_id = intval($_GET['asset_id'] ?? 0);
|
||||||
</button>
|
$project_id = intval($_GET['project_id'] ?? 0);
|
||||||
</div>
|
|
||||||
<form action="post.php" method="post" autocomplete="off">
|
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>
|
||||||
|
<button type="button" class="close text-white" data-dismiss="modal">
|
||||||
|
<span>×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<form action="post.php" method="post" autocomplete="off">
|
||||||
|
|
||||||
|
<?php if (isset($_GET['project_id'])) { ?>
|
||||||
|
<input type="hidden" name="project" value="<?php echo intval($_GET['project_id']); ?>">
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
<div class="modal-body">
|
||||||
|
|
||||||
|
<?php if (isset($_GET['client_id'])) { ?>
|
||||||
|
<ul class="nav nav-pills nav-justified mb-3">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link active" data-toggle="pill" href="#pills-ticket-details"><i class="fa fa-fw fa-life-ring mr-2"></i>Details</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" data-toggle="pill" href="#pills-ticket-contacts"><i class="fa fa-fw fa-users mr-2"></i>Contact</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" data-toggle="pill" href="#pills-ticket-assignment"><i class="fa fa-fw fa-desktop mr-2"></i>Assignment</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
<div class="tab-content">
|
||||||
|
|
||||||
|
<div class="tab-pane fade show active" id="pills-ticket-details">
|
||||||
|
|
||||||
|
<?php if ($client_id) { ?>
|
||||||
|
<input type="hidden" name="client" value="<?= $client_id ?>">
|
||||||
|
<?php } else { ?>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Client <strong class="text-danger">*</strong> / <span class="text-secondary">Use Primary Contact</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="client" required>
|
||||||
|
<option value="">- Client -</option>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$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)) {
|
||||||
|
$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 class="input-group-append">
|
||||||
|
<div class="input-group-text">
|
||||||
|
<input type="checkbox" name="use_primary_contact" value="1">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<?php if (isset($_GET['project_id'])) { ?>
|
|
||||||
<input type="hidden" name="project" value="<?php echo intval($_GET['project_id']); ?>">
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<div class="modal-body">
|
<div class="form-group">
|
||||||
|
<label>Template</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-cube"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" id="ticket_template_select" name="ticket_template_id" required>
|
||||||
|
<option value="0">- Choose a Template -</option>
|
||||||
|
<?php
|
||||||
|
$sql_ticket_templates = mysqli_query($mysqli, "
|
||||||
|
SELECT tt.ticket_template_id,
|
||||||
|
tt.ticket_template_name,
|
||||||
|
tt.ticket_template_subject,
|
||||||
|
tt.ticket_template_details,
|
||||||
|
COUNT(ttt.task_template_id) as task_count
|
||||||
|
FROM ticket_templates tt
|
||||||
|
LEFT JOIN task_templates ttt
|
||||||
|
ON tt.ticket_template_id = ttt.task_template_ticket_template_id
|
||||||
|
WHERE tt.ticket_template_archived_at IS NULL
|
||||||
|
GROUP BY tt.ticket_template_id
|
||||||
|
ORDER BY tt.ticket_template_name ASC
|
||||||
|
");
|
||||||
|
|
||||||
<?php if (isset($_GET['client_id'])) { ?>
|
while ($row = mysqli_fetch_array($sql_ticket_templates)) {
|
||||||
<ul class="nav nav-pills nav-justified mb-3">
|
$ticket_template_id_select = intval($row['ticket_template_id']);
|
||||||
<li class="nav-item">
|
$ticket_template_name_select = nullable_htmlentities($row['ticket_template_name']);
|
||||||
<a class="nav-link active" data-toggle="pill" href="#pills-ticket-details"><i class="fa fa-fw fa-life-ring mr-2"></i>Details</a>
|
$ticket_template_subject_select = nullable_htmlentities($row['ticket_template_subject']);
|
||||||
</li>
|
$ticket_template_details_select = nullable_htmlentities($row['ticket_template_details']);
|
||||||
<li class="nav-item">
|
$task_count = intval($row['task_count']);
|
||||||
<a class="nav-link" data-toggle="pill" href="#pills-ticket-contacts"><i class="fa fa-fw fa-users mr-2"></i>Contact</a>
|
?>
|
||||||
</li>
|
<option value="<?php echo $ticket_template_id_select; ?>"
|
||||||
<li class="nav-item">
|
data-subject="<?php echo $ticket_template_subject_select; ?>"
|
||||||
<a class="nav-link" data-toggle="pill" href="#pills-ticket-assignment"><i class="fa fa-fw fa-desktop mr-2"></i>Assignment</a>
|
data-details="<?php echo $ticket_template_details_select; ?>">
|
||||||
</li>
|
<?php echo $ticket_template_name_select; ?> (<?php echo $task_count; ?> tasks)
|
||||||
</ul>
|
</option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<hr>
|
<div class="form-group">
|
||||||
|
<label>Subject <strong class="text-danger">*</strong></label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" id="subjectInput" name="subject" placeholder="Subject" maxlength="500" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<?php } ?>
|
<div class="form-group">
|
||||||
|
<textarea class="form-control tinymceTicket" id="detailsInput" name="details"></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="tab-content">
|
<div class="row">
|
||||||
|
|
||||||
<div class="tab-pane fade show active" id="pills-ticket-details">
|
<div class="col">
|
||||||
|
<div class="form-group">
|
||||||
<?php if (empty($_GET['client_id'])) { ?>
|
<label>Priority <strong class="text-danger">*</strong></label>
|
||||||
|
<div class="input-group">
|
||||||
<div class="form-group">
|
<div class="input-group-prepend">
|
||||||
<label>Client <strong class="text-danger">*</strong> / <span class="text-secondary">Use Primary Contact</label>
|
<span class="input-group-text"><i class="fa fa-fw fa-thermometer-half"></i></span>
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="client" required>
|
|
||||||
<option value="">- Client -</option>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$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)) {
|
|
||||||
$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 class="input-group-append">
|
|
||||||
<div class="input-group-text">
|
|
||||||
<input type="checkbox" name="use_primary_contact" value="1">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<select class="form-control select2" name="priority" required>
|
||||||
|
<option>Low</option>
|
||||||
|
<option>Medium</option>
|
||||||
|
<option>High</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<?php } ?>
|
<div class="col">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Category</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-layer-group"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="category">
|
||||||
|
<option value="0">- Not Categorized -</option>
|
||||||
|
<?php
|
||||||
|
$sql_categories = mysqli_query($mysqli, "SELECT category_id, category_name FROM categories WHERE category_type = 'Ticket' AND category_archived_at IS NULL ORDER BY category_name ASC");
|
||||||
|
while ($row = mysqli_fetch_array($sql_categories)) {
|
||||||
|
$category_id = intval($row['category_id']);
|
||||||
|
$category_name = nullable_htmlentities($row['category_name']);
|
||||||
|
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $category_id; ?>"><?php echo $category_name; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
<div class="input-group-append">
|
||||||
|
<button class="btn btn-secondary ajax-modal" type="button"
|
||||||
|
data-modal-url="../admin/modals/category/category_add.php?category=Ticket">
|
||||||
|
<i class="fas fa-fw fa-plus"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Assign to</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-user-check"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="assigned_to">
|
||||||
|
<option value="0">Not Assigned</option>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT user_id, user_name FROM users
|
||||||
|
WHERE user_type = 1
|
||||||
|
AND user_status = 1
|
||||||
|
AND user_archived_at IS NULL
|
||||||
|
ORDER BY user_name ASC"
|
||||||
|
);
|
||||||
|
while ($row = mysqli_fetch_array($sql)) {
|
||||||
|
$user_id = intval($row['user_id']);
|
||||||
|
$user_name = nullable_htmlentities($row['user_name']); ?>
|
||||||
|
<option <?php if ($session_user_id == $user_id) { echo "selected"; } ?> value="<?php echo $user_id; ?>"><?php echo $user_name; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Due</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-calendar-check"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="datetime-local" class="form-control" name="due">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if ($config_module_enable_accounting) { ?>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="custom-control custom-switch">
|
||||||
|
<input type="checkbox" class="custom-control-input" name="billable" <?php if ($config_ticket_default_billable == 1) { echo "checked"; } ?> value="1" id="billableSwitch">
|
||||||
|
<label class="custom-control-label" for="billableSwitch">Mark Billable</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if($client_id) { ?>
|
||||||
|
|
||||||
|
<div class="tab-pane fade" id="pills-ticket-contacts">
|
||||||
|
|
||||||
|
<input type="hidden" name="client" value="<?php echo $client_id; ?>">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Contact</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="contact">
|
||||||
|
<option value="0">- No One -</option>
|
||||||
|
<?php
|
||||||
|
$sql = mysqli_query($mysqli, "SELECT contact_id, contact_name, contact_title, contact_primary, contact_technical FROM contacts WHERE contact_client_id = $client_id AND contact_archived_at IS NULL ORDER BY contact_primary DESC, contact_technical DESC, contact_name ASC");
|
||||||
|
while ($row = mysqli_fetch_array($sql)) {
|
||||||
|
$contact_id_select = intval($row['contact_id']);
|
||||||
|
$contact_name_select = nullable_htmlentities($row['contact_name']);
|
||||||
|
$contact_primary_select = intval($row['contact_primary']);
|
||||||
|
if($contact_primary_select == 1) {
|
||||||
|
$contact_primary_display = " (Primary)";
|
||||||
|
} else {
|
||||||
|
$contact_primary_display = "";
|
||||||
|
}
|
||||||
|
$contact_technical_select = intval($row['contact_technical']);
|
||||||
|
if($contact_technical_select == 1) {
|
||||||
|
$contact_technical_display = " (Technical)";
|
||||||
|
} else {
|
||||||
|
$contact_technical_display = "";
|
||||||
|
}
|
||||||
|
$contact_title_select = nullable_htmlentities($row['contact_title']);
|
||||||
|
if($contact_title_select) {
|
||||||
|
$contact_title_display = " - $contact_title_select";
|
||||||
|
} else {
|
||||||
|
$contact_title_display = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $contact_id_select; ?>"
|
||||||
|
<?php
|
||||||
|
if ($contact_id == $contact_id_select) {
|
||||||
|
echo "selected";
|
||||||
|
} elseif (!$contact_id && $contact_primary_select == 1) {
|
||||||
|
echo "selected";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
>
|
||||||
|
<?php echo "$contact_name_select$contact_title_display$contact_primary_display$contact_technical_display"; ?>
|
||||||
|
</option>
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Watchers</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-envelope"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="watchers[]" data-tags="true" data-placeholder="Enter or select email address" multiple>
|
||||||
|
<option value=""></option>
|
||||||
|
<?php
|
||||||
|
$sql = mysqli_query($mysqli, "SELECT contact_email FROM contacts WHERE contact_client_id = $client_id AND contact_archived_at IS NULL AND contact_email IS NOT NULL ORDER BY contact_email ASC");
|
||||||
|
while ($row = mysqli_fetch_array($sql)) {
|
||||||
|
$contact_email = nullable_htmlentities($row['contact_email']);
|
||||||
|
?>
|
||||||
|
<option><?php echo $contact_email; ?></option>
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tab-pane fade" id="pills-ticket-assignment">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Primary Asset</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-desktop"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="asset">
|
||||||
|
<option value="0">- None -</option>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$sql_assets = mysqli_query($mysqli, "SELECT asset_id, asset_name, contact_name FROM assets LEFT JOIN contacts ON contact_id = asset_contact_id WHERE asset_client_id = $client_id AND asset_archived_at IS NULL ORDER BY asset_name ASC");
|
||||||
|
while ($row = mysqli_fetch_array($sql_assets)) {
|
||||||
|
$asset_id_select = intval($row['asset_id']);
|
||||||
|
$asset_name_select = nullable_htmlentities($row['asset_name']);
|
||||||
|
$asset_contact_name_select = nullable_htmlentities($row['contact_name']);
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $asset_id_select; ?>"
|
||||||
|
<?php if ($asset_id == $asset_id_select) { echo "selected"; }?>
|
||||||
|
><?php echo "$asset_name_select - $asset_contact_name_select"; ?></option>
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Additional Assets</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-desktop"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="additional_assets[]" data-tags="true" data-placeholder="- Select Additional Assets -" multiple>
|
||||||
|
<option value=""></option>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$sql_assets = mysqli_query($mysqli, "SELECT asset_id, asset_name, contact_name FROM assets LEFT JOIN contacts ON contact_id = asset_contact_id WHERE asset_client_id = $client_id AND asset_archived_at IS NULL ORDER BY asset_name ASC");
|
||||||
|
while ($row = mysqli_fetch_array($sql_assets)) {
|
||||||
|
$asset_id_select = intval($row['asset_id']);
|
||||||
|
$asset_name_select = nullable_htmlentities($row['asset_name']);
|
||||||
|
$asset_contact_name_select = nullable_htmlentities($row['contact_name']);
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $asset_id_select; ?>">
|
||||||
|
<?php echo "$asset_name_select - $asset_contact_name_select"; ?>
|
||||||
|
</option>
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Location</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-map-marker-alt"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="location">
|
||||||
|
<option value="0">- None -</option>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$sql_locations = mysqli_query($mysqli, "SELECT location_id, location_name FROM locations WHERE location_client_id = $client_id AND location_archived_at IS NULL ORDER BY location_name ASC");
|
||||||
|
while ($row = mysqli_fetch_array($sql_locations)) {
|
||||||
|
$location_id_select = intval($row['location_id']);
|
||||||
|
$location_name_select = nullable_htmlentities($row['location_name']);
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $location_id_select; ?>"><?php echo $location_name_select; ?></option>
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Template</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-cube"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-building"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<select class="form-control select2" id="ticket_template_select" name="ticket_template_id" required>
|
<select class="form-control select2" name="vendor">
|
||||||
<option value="0">- Choose a Template -</option>
|
<option value="0">- None -</option>
|
||||||
<?php
|
<?php
|
||||||
$sql_ticket_templates = mysqli_query($mysqli, "
|
|
||||||
SELECT tt.ticket_template_id,
|
|
||||||
tt.ticket_template_name,
|
|
||||||
tt.ticket_template_subject,
|
|
||||||
tt.ticket_template_details,
|
|
||||||
COUNT(ttt.task_template_id) as task_count
|
|
||||||
FROM ticket_templates tt
|
|
||||||
LEFT JOIN task_templates ttt
|
|
||||||
ON tt.ticket_template_id = ttt.task_template_ticket_template_id
|
|
||||||
WHERE tt.ticket_template_archived_at IS NULL
|
|
||||||
GROUP BY tt.ticket_template_id
|
|
||||||
ORDER BY tt.ticket_template_name ASC
|
|
||||||
");
|
|
||||||
|
|
||||||
while ($row = mysqli_fetch_array($sql_ticket_templates)) {
|
$sql_vendors = mysqli_query($mysqli, "SELECT vendor_id, vendor_name FROM vendors WHERE vendor_client_id = $client_id AND vendor_archived_at IS NULL ORDER BY vendor_name ASC");
|
||||||
$ticket_template_id_select = intval($row['ticket_template_id']);
|
while ($row = mysqli_fetch_array($sql_vendors)) {
|
||||||
$ticket_template_name_select = nullable_htmlentities($row['ticket_template_name']);
|
$vendor_id_select = intval($row['vendor_id']);
|
||||||
$ticket_template_subject_select = nullable_htmlentities($row['ticket_template_subject']);
|
$vendor_name_select = nullable_htmlentities($row['vendor_name']); ?>
|
||||||
$ticket_template_details_select = nullable_htmlentities($row['ticket_template_details']);
|
<option value="<?php echo $vendor_id_select; ?>"><?php echo $vendor_name_select; ?></option>
|
||||||
$task_count = intval($row['task_count']);
|
|
||||||
?>
|
<?php } ?>
|
||||||
<option value="<?php echo $ticket_template_id_select; ?>"
|
|
||||||
data-subject="<?php echo $ticket_template_subject_select; ?>"
|
|
||||||
data-details="<?php echo $ticket_template_details_select; ?>">
|
|
||||||
<?php echo $ticket_template_name_select; ?> (<?php echo $task_count; ?> tasks)
|
|
||||||
</option>
|
|
||||||
<?php } ?>
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Subject <strong class="text-danger">*</strong></label>
|
<label>Vendor Ticket Number</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-tag"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" id="subjectInput" name="subject" placeholder="Subject" maxlength="500" required>
|
<input type="text" class="form-control" name="vendor_ticket_number" placeholder="Vendor ticket number">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<textarea class="form-control tinymceTicket" id="detailsInput" name="details"></textarea>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
|
|
||||||
<div class="col">
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Priority <strong class="text-danger">*</strong></label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-thermometer-half"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="priority" required>
|
|
||||||
<option>Low</option>
|
|
||||||
<option>Medium</option>
|
|
||||||
<option>High</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col">
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Category</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-layer-group"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="category">
|
|
||||||
<option value="0">- Not Categorized -</option>
|
|
||||||
<?php
|
|
||||||
$sql_categories = mysqli_query($mysqli, "SELECT category_id, category_name FROM categories WHERE category_type = 'Ticket' AND category_archived_at IS NULL ORDER BY category_name ASC");
|
|
||||||
while ($row = mysqli_fetch_array($sql_categories)) {
|
|
||||||
$category_id = intval($row['category_id']);
|
|
||||||
$category_name = nullable_htmlentities($row['category_name']);
|
|
||||||
|
|
||||||
?>
|
|
||||||
<option value="<?php echo $category_id; ?>"><?php echo $category_name; ?></option>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
<div class="input-group-append">
|
|
||||||
<button class="btn btn-secondary ajax-modal" type="button"
|
|
||||||
data-modal-url="../admin/modals/category/category_add.php?category=Ticket">
|
|
||||||
<i class="fas fa-fw fa-plus"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col">
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Assign to</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-user-check"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="assigned_to">
|
|
||||||
<option value="0">Not Assigned</option>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$sql = mysqli_query(
|
|
||||||
$mysqli,
|
|
||||||
"SELECT user_id, user_name FROM users
|
|
||||||
WHERE user_type = 1
|
|
||||||
AND user_status = 1
|
|
||||||
AND user_archived_at IS NULL
|
|
||||||
ORDER BY user_name ASC"
|
|
||||||
);
|
|
||||||
while ($row = mysqli_fetch_array($sql)) {
|
|
||||||
$user_id = intval($row['user_id']);
|
|
||||||
$user_name = nullable_htmlentities($row['user_name']); ?>
|
|
||||||
<option <?php if ($session_user_id == $user_id) { echo "selected"; } ?> value="<?php echo $user_id; ?>"><?php echo $user_name; ?></option>
|
|
||||||
<?php } ?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Due</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-calendar-check"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="datetime-local" class="form-control" name="due">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php if ($config_module_enable_accounting) { ?>
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="custom-control custom-switch">
|
|
||||||
<input type="checkbox" class="custom-control-input" name="billable" <?php if ($config_ticket_default_billable == 1) { echo "checked"; } ?> value="1" id="billableSwitch">
|
|
||||||
<label class="custom-control-label" for="billableSwitch">Mark Billable</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if (isset($_GET['client_id'])) { ?>
|
</div>
|
||||||
|
|
||||||
<div class="tab-pane fade" id="pills-ticket-contacts">
|
|
||||||
|
|
||||||
<input type="hidden" name="client" value="<?php echo $client_id; ?>">
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Contact</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="contact">
|
|
||||||
<option value="0">- No One -</option>
|
|
||||||
<?php
|
|
||||||
$sql = mysqli_query($mysqli, "SELECT contact_id, contact_name, contact_title, contact_primary, contact_technical FROM contacts WHERE contact_client_id = $client_id AND contact_archived_at IS NULL ORDER BY contact_primary DESC, contact_technical DESC, contact_name ASC");
|
|
||||||
while ($row = mysqli_fetch_array($sql)) {
|
|
||||||
$contact_id_select = intval($row['contact_id']);
|
|
||||||
$contact_name_select = nullable_htmlentities($row['contact_name']);
|
|
||||||
$contact_primary_select = intval($row['contact_primary']);
|
|
||||||
if($contact_primary_select == 1) {
|
|
||||||
$contact_primary_display = " (Primary)";
|
|
||||||
} else {
|
|
||||||
$contact_primary_display = "";
|
|
||||||
}
|
|
||||||
$contact_technical_select = intval($row['contact_technical']);
|
|
||||||
if($contact_technical_select == 1) {
|
|
||||||
$contact_technical_display = " (Technical)";
|
|
||||||
} else {
|
|
||||||
$contact_technical_display = "";
|
|
||||||
}
|
|
||||||
$contact_title_select = nullable_htmlentities($row['contact_title']);
|
|
||||||
if($contact_title_select) {
|
|
||||||
$contact_title_display = " - $contact_title_select";
|
|
||||||
} else {
|
|
||||||
$contact_title_display = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
<option value="<?php echo $contact_id_select; ?>"
|
|
||||||
<?php
|
|
||||||
if (isset($_GET['contact_id']) && $contact_id_select == intval($_GET['contact_id'])) {
|
|
||||||
echo "selected";
|
|
||||||
} elseif (empty($_GET['contact_id']) && $contact_primary_select == 1) {
|
|
||||||
echo "selected";
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
>
|
|
||||||
<?php echo "$contact_name_select$contact_title_display$contact_primary_display$contact_technical_display"; ?>
|
|
||||||
</option>
|
|
||||||
|
|
||||||
<?php } ?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Watchers</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-envelope"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="watchers[]" data-tags="true" data-placeholder="Enter or select email address" multiple>
|
|
||||||
<option value=""></option>
|
|
||||||
<?php
|
|
||||||
$sql = mysqli_query($mysqli, "SELECT contact_email FROM contacts WHERE contact_client_id = $client_id AND contact_archived_at IS NULL AND contact_email IS NOT NULL ORDER BY contact_email ASC");
|
|
||||||
while ($row = mysqli_fetch_array($sql)) {
|
|
||||||
$contact_email = nullable_htmlentities($row['contact_email']);
|
|
||||||
?>
|
|
||||||
<option><?php echo $contact_email; ?></option>
|
|
||||||
|
|
||||||
<?php } ?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Project</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-project-diagram"></i></span>
|
||||||
</div>
|
</div>
|
||||||
|
<select class="form-control select2" name="project">
|
||||||
|
<option value="0">- Select Project -</option>
|
||||||
|
<?php
|
||||||
|
|
||||||
<div class="tab-pane fade" id="pills-ticket-assignment">
|
$sql_projects = mysqli_query($mysqli, "SELECT project_id, project_name FROM projects WHERE project_client_id = $client_id AND project_completed_at IS NULL AND project_archived_at IS NULL ORDER BY project_name ASC");
|
||||||
|
while ($row = mysqli_fetch_array($sql_projects)) {
|
||||||
<div class="form-group">
|
$project_id_select = intval($row['project_id']);
|
||||||
<label>Primary Asset</label>
|
$project_name_select = nullable_htmlentities($row['project_name']); ?>
|
||||||
<div class="input-group">
|
<option <?php if ($project_id == $project_id_select) { echo "selected"; } ?> value="<?php echo $project_id_select; ?>"><?php echo $project_name_select; ?></option>
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-desktop"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="asset">
|
|
||||||
<option value="0">- None -</option>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$sql_assets = mysqli_query($mysqli, "SELECT asset_id, asset_name, contact_name FROM assets LEFT JOIN contacts ON contact_id = asset_contact_id WHERE asset_client_id = $client_id AND asset_archived_at IS NULL ORDER BY asset_name ASC");
|
|
||||||
while ($row = mysqli_fetch_array($sql_assets)) {
|
|
||||||
$asset_id_select = intval($row['asset_id']);
|
|
||||||
$asset_name_select = nullable_htmlentities($row['asset_name']);
|
|
||||||
$asset_contact_name_select = nullable_htmlentities($row['contact_name']);
|
|
||||||
?>
|
|
||||||
<option value="<?php echo $asset_id_select; ?>"
|
|
||||||
<?php if (isset($_GET['asset_id']) && $asset_id_select == $_GET['asset_id']) { echo "selected"; }
|
|
||||||
?>
|
|
||||||
><?php echo "$asset_name_select - $asset_contact_name_select"; ?></option>
|
|
||||||
|
|
||||||
<?php } ?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Additional Assets</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-desktop"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="additional_assets[]" data-tags="true" data-placeholder="- Select Additional Assets -" multiple>
|
|
||||||
<option value=""></option>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$sql_assets = mysqli_query($mysqli, "SELECT asset_id, asset_name, contact_name FROM assets LEFT JOIN contacts ON contact_id = asset_contact_id WHERE asset_client_id = $client_id AND asset_archived_at IS NULL ORDER BY asset_name ASC");
|
|
||||||
while ($row = mysqli_fetch_array($sql_assets)) {
|
|
||||||
$asset_id_select = intval($row['asset_id']);
|
|
||||||
$asset_name_select = nullable_htmlentities($row['asset_name']);
|
|
||||||
$asset_contact_name_select = nullable_htmlentities($row['contact_name']);
|
|
||||||
?>
|
|
||||||
<option value="<?php echo $asset_id_select; ?>">
|
|
||||||
<?php echo "$asset_name_select - $asset_contact_name_select"; ?>
|
|
||||||
</option>
|
|
||||||
|
|
||||||
<?php } ?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Location</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-map-marker-alt"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="location">
|
|
||||||
<option value="0">- None -</option>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$sql_locations = mysqli_query($mysqli, "SELECT location_id, location_name FROM locations WHERE location_client_id = $client_id AND location_archived_at IS NULL ORDER BY location_name ASC");
|
|
||||||
while ($row = mysqli_fetch_array($sql_locations)) {
|
|
||||||
$location_id_select = intval($row['location_id']);
|
|
||||||
$location_name_select = nullable_htmlentities($row['location_name']);
|
|
||||||
?>
|
|
||||||
<option value="<?php echo $location_id_select; ?>"><?php echo $location_name_select; ?></option>
|
|
||||||
|
|
||||||
<?php } ?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
|
|
||||||
<div class="col">
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Vendor</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-building"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="vendor">
|
|
||||||
<option value="0">- None -</option>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$sql_vendors = mysqli_query($mysqli, "SELECT vendor_id, vendor_name FROM vendors WHERE vendor_client_id = $client_id AND vendor_archived_at IS NULL ORDER BY vendor_name ASC");
|
|
||||||
while ($row = mysqli_fetch_array($sql_vendors)) {
|
|
||||||
$vendor_id_select = intval($row['vendor_id']);
|
|
||||||
$vendor_name_select = nullable_htmlentities($row['vendor_name']); ?>
|
|
||||||
<option value="<?php echo $vendor_id_select; ?>"><?php echo $vendor_name_select; ?></option>
|
|
||||||
|
|
||||||
<?php } ?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col">
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Vendor Ticket Number</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="vendor_ticket_number" placeholder="Vendor ticket number">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Project</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-project-diagram"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="project">
|
|
||||||
<option value="0">- Select Project -</option>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$sql_projects = mysqli_query($mysqli, "SELECT project_id, project_name FROM projects WHERE project_client_id = $client_id AND project_completed_at IS NULL AND project_archived_at IS NULL ORDER BY project_name ASC");
|
|
||||||
while ($row = mysqli_fetch_array($sql_projects)) {
|
|
||||||
$project_id_select = intval($row['project_id']);
|
|
||||||
$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>
|
|
||||||
|
|
||||||
<?php } ?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="submit" name="add_ticket" class="btn btn-primary text-bold"><i class="fas fa-check mr-2"></i>Create</button>
|
<?php } ?>
|
||||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fas fa-times mr-2"></i>Cancel</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="modal-footer">
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
<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,296 +1,299 @@
|
||||||
<div class="modal" id="addTicketModalv2" tabindex="-1">
|
<?php
|
||||||
<div class="modal-dialog modal-lg">
|
|
||||||
<div class="modal-content">
|
|
||||||
<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>
|
|
||||||
<button type="button" class="close text-white" data-dismiss="modal">
|
|
||||||
<span>×</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<form action="post.php" method="post" autocomplete="off">
|
|
||||||
<!-- Hidden/System fields -->
|
|
||||||
<?php if ($client_url && isset($client_id)) { ?>
|
|
||||||
<input type="hidden" name="client" value="<?php echo $client_id; ?>>">
|
|
||||||
<?php }
|
|
||||||
if (isset($_GET['contact_id'])) { ?>
|
|
||||||
<input type="hidden" name="contact" value="<?php echo intval($_GET['contact_id']); ?>">
|
|
||||||
<?php }
|
|
||||||
if (isset($_GET['project_id'])) { ?>
|
|
||||||
<input type="hidden" name="project" value="<?php echo intval($_GET['project_id']); ?>">
|
|
||||||
<?php } ?>
|
|
||||||
<input type="hidden" name="billable" value="0">
|
|
||||||
|
|
||||||
<div class="modal-body">
|
require_once '../../../includes/modal_header.php';
|
||||||
|
|
||||||
<!-- Nav -->
|
$client_id = intval($_GET['client_id'] ?? 0);
|
||||||
<ul class="nav nav-pills nav-justified mb-3">
|
$contact_id = intval($_GET['contact_id'] ?? 0);
|
||||||
<li class="nav-item">
|
$project_id = intval($_GET['project_id'] ?? 0);
|
||||||
<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>
|
|
||||||
<!-- Hide contact if in URL as it means we're creating a ticket from a contact record -->
|
|
||||||
<?php if (!isset($_GET['contact_id'])) { ?>
|
|
||||||
<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>
|
|
||||||
</li>
|
|
||||||
<?php } ?>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" data-toggle="pill" href="#pills-add-relationships"><i class="fa fa-fw fa-desktop mr-2"></i>Assignment</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<!-- Content -->
|
ob_start();
|
||||||
<div class="tab-content">
|
|
||||||
|
|
||||||
<!-- Ticket details -->
|
?>
|
||||||
<div class="tab-pane fade show active" id="pills-add-details">
|
<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>
|
||||||
|
<button type="button" class="close text-white" data-dismiss="modal">
|
||||||
|
<span>×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<form action="post.php" method="post" autocomplete="off">
|
||||||
|
<!-- Hidden/System fields -->
|
||||||
|
<?php if ($client_id) { ?>
|
||||||
|
<input type="hidden" name="client" value="<?php echo $client_id; ?>>">
|
||||||
|
<?php } ?>
|
||||||
|
<?php if ($project_id) { ?>
|
||||||
|
<input type="hidden" name="project" value="<?php echo $project_id; ?>">
|
||||||
|
<?php } ?>
|
||||||
|
<input type="hidden" name="billable" value="0">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="modal-body">
|
||||||
<label>Template</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-cube"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" id="ticket_template_select" name="ticket_template_id" required>
|
|
||||||
<option value="0">- Choose a Template -</option>
|
|
||||||
<?php
|
|
||||||
$sql_ticket_templates = mysqli_query($mysqli, "
|
|
||||||
SELECT tt.ticket_template_id,
|
|
||||||
tt.ticket_template_name,
|
|
||||||
tt.ticket_template_subject,
|
|
||||||
tt.ticket_template_details,
|
|
||||||
COUNT(ttt.task_template_id) as task_count
|
|
||||||
FROM ticket_templates tt
|
|
||||||
LEFT JOIN task_templates ttt
|
|
||||||
ON tt.ticket_template_id = ttt.task_template_ticket_template_id
|
|
||||||
WHERE tt.ticket_template_archived_at IS NULL
|
|
||||||
GROUP BY tt.ticket_template_id
|
|
||||||
ORDER BY tt.ticket_template_name ASC
|
|
||||||
");
|
|
||||||
|
|
||||||
while ($row = mysqli_fetch_array($sql_ticket_templates)) {
|
<!-- Nav -->
|
||||||
$ticket_template_id_select = intval($row['ticket_template_id']);
|
<ul class="nav nav-pills nav-justified mb-3">
|
||||||
$ticket_template_name_select = nullable_htmlentities($row['ticket_template_name']);
|
<li class="nav-item">
|
||||||
$ticket_template_subject_select = nullable_htmlentities($row['ticket_template_subject']);
|
<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>
|
||||||
$ticket_template_details_select = nullable_htmlentities($row['ticket_template_details']);
|
</li>
|
||||||
$task_count = intval($row['task_count']);
|
<?php if (!$contact_id) { ?>
|
||||||
?>
|
<li class="nav-item">
|
||||||
<option value="<?php echo $ticket_template_id_select; ?>"
|
<a class="nav-link" data-toggle="pill" href="#pills-add-contacts"><i class="fa fa-fw fa-users mr-2"></i>Contact</a>
|
||||||
data-subject="<?php echo $ticket_template_subject_select; ?>"
|
</li>
|
||||||
data-details="<?php echo $ticket_template_details_select; ?>">
|
<?php } ?>
|
||||||
<?php echo $ticket_template_name_select; ?> (<?php echo $task_count; ?> tasks)
|
<li class="nav-item">
|
||||||
</option>
|
<a class="nav-link" data-toggle="pill" href="#pills-add-relationships"><i class="fa fa-fw fa-desktop mr-2"></i>Assignment</a>
|
||||||
<?php } ?>
|
</li>
|
||||||
</select>
|
</ul>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
<!-- Content -->
|
||||||
<label>Subject <strong class="text-danger">*</strong></label>
|
<div class="tab-content">
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" id="subjectInput" name="subject" placeholder="Subject" maxlength="500" required>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
<!-- Ticket details -->
|
||||||
<textarea class="form-control tinymceTicket" id="detailsInput" name="details"></textarea>
|
<div class="tab-pane fade show active" id="pills-add-details">
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
|
|
||||||
<div class="col">
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Priority <strong class="text-danger">*</strong></label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-thermometer-half"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="priority" required>
|
|
||||||
<option>Low</option>
|
|
||||||
<option>Medium</option>
|
|
||||||
<option>High</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col">
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Category</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-layer-group"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="category">
|
|
||||||
<option value="0">- Not Categorized -</option>
|
|
||||||
<?php
|
|
||||||
$sql_categories = mysqli_query($mysqli, "SELECT category_id, category_name FROM categories WHERE category_type = 'Ticket' AND category_archived_at IS NULL ORDER BY category_name ASC");
|
|
||||||
while ($row = mysqli_fetch_array($sql_categories)) {
|
|
||||||
$category_id = intval($row['category_id']);
|
|
||||||
$category_name = nullable_htmlentities($row['category_name']);
|
|
||||||
?>
|
|
||||||
<option value="<?php echo $category_id; ?>"><?php echo $category_name; ?></option>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
<div class="input-group-append">
|
|
||||||
<button class="btn btn-secondary ajax-modal" type="button"
|
|
||||||
data-modal-url="../admin/modals/category/category_add.php?category=Ticket">
|
|
||||||
<i class="fas fa-fw fa-plus"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Assign to</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-user-check"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="assigned_to">
|
|
||||||
<option value="0">- Not Assigned -</option>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$sql = mysqli_query(
|
|
||||||
$mysqli,
|
|
||||||
"SELECT user_id, user_name FROM users
|
|
||||||
WHERE user_type = 1 AND user_status = 1 AND user_archived_at IS NULL ORDER BY user_name ASC"
|
|
||||||
);
|
|
||||||
while ($row = mysqli_fetch_array($sql)) {
|
|
||||||
$user_id = intval($row['user_id']);
|
|
||||||
$user_name = nullable_htmlentities($row['user_name']); ?>
|
|
||||||
<option value="<?php echo $user_id; ?>"><?php echo $user_name; ?></option>
|
|
||||||
<?php } ?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php if ($config_module_enable_accounting) { ?>
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="custom-control custom-switch">
|
|
||||||
<input type="checkbox" class="custom-control-input" name="billable" <?php if ($config_ticket_default_billable == 1) { echo "checked"; } ?> value="1" id="billable">
|
|
||||||
<label class="custom-control-label" for="billable">Mark Billable</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Template</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-cube"></i></span>
|
||||||
</div>
|
</div>
|
||||||
|
<select class="form-control select2" id="ticket_template_select" name="ticket_template_id" required>
|
||||||
|
<option value="0">- Choose a Template -</option>
|
||||||
|
<?php
|
||||||
|
$sql_ticket_templates = mysqli_query($mysqli, "
|
||||||
|
SELECT tt.ticket_template_id,
|
||||||
|
tt.ticket_template_name,
|
||||||
|
tt.ticket_template_subject,
|
||||||
|
tt.ticket_template_details,
|
||||||
|
COUNT(ttt.task_template_id) as task_count
|
||||||
|
FROM ticket_templates tt
|
||||||
|
LEFT JOIN task_templates ttt
|
||||||
|
ON tt.ticket_template_id = ttt.task_template_ticket_template_id
|
||||||
|
WHERE tt.ticket_template_archived_at IS NULL
|
||||||
|
GROUP BY tt.ticket_template_id
|
||||||
|
ORDER BY tt.ticket_template_name ASC
|
||||||
|
");
|
||||||
|
|
||||||
<!-- Ticket client/contact -->
|
while ($row = mysqli_fetch_array($sql_ticket_templates)) {
|
||||||
<?php if (!isset($_GET['contact_id'])) { ?>
|
$ticket_template_id_select = intval($row['ticket_template_id']);
|
||||||
<div class="tab-pane fade" id="pills-add-contacts">
|
$ticket_template_name_select = nullable_htmlentities($row['ticket_template_name']);
|
||||||
|
$ticket_template_subject_select = nullable_htmlentities($row['ticket_template_subject']);
|
||||||
|
$ticket_template_details_select = nullable_htmlentities($row['ticket_template_details']);
|
||||||
|
$task_count = intval($row['task_count']);
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $ticket_template_id_select; ?>"
|
||||||
|
data-subject="<?php echo $ticket_template_subject_select; ?>"
|
||||||
|
data-details="<?php echo $ticket_template_details_select; ?>">
|
||||||
|
<?php echo $ticket_template_name_select; ?> (<?php echo $task_count; ?> tasks)
|
||||||
|
</option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Client <strong class="text-danger">*</strong></label>
|
<label>Subject <strong class="text-danger">*</strong></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-user"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<select class="form-control select2" name="client" id="changeClientSelect" required <?php if ($client_url && isset($client_id)) { echo "disabled"; } ?>>
|
<input type="text" class="form-control" id="subjectInput" name="subject" placeholder="Subject" maxlength="500" required>
|
||||||
<option value="">- Client -</option>
|
</div>
|
||||||
<?php
|
</div>
|
||||||
|
|
||||||
$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");
|
<div class="form-group">
|
||||||
while ($row = mysqli_fetch_array($sql)) {
|
<textarea class="form-control tinymceTicket" id="detailsInput" name="details"></textarea>
|
||||||
$selectable_client_id = intval($row['client_id']);
|
</div>
|
||||||
$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>
|
<div class="row">
|
||||||
|
|
||||||
<?php } ?>
|
<div class="col">
|
||||||
</select>
|
<div class="form-group">
|
||||||
</div>
|
<label>Priority <strong class="text-danger">*</strong></label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-thermometer-half"></i></span>
|
||||||
</div>
|
</div>
|
||||||
|
<select class="form-control select2" name="priority" required>
|
||||||
<div class="form-group">
|
<option>Low</option>
|
||||||
<label>Contact </label>
|
<option>Medium</option>
|
||||||
<div class="input-group">
|
<option>High</option>
|
||||||
<div class="input-group-prepend">
|
</select>
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="contact" id="contactSelect">
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="tab-pane fade" id="pills-add-relationships">
|
<div class="col">
|
||||||
To-do: project, etc.
|
<div class="form-group">
|
||||||
|
<label>Category</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-layer-group"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="category">
|
||||||
|
<option value="0">- Not Categorized -</option>
|
||||||
|
<?php
|
||||||
|
$sql_categories = mysqli_query($mysqli, "SELECT category_id, category_name FROM categories WHERE category_type = 'Ticket' AND category_archived_at IS NULL ORDER BY category_name ASC");
|
||||||
|
while ($row = mysqli_fetch_array($sql_categories)) {
|
||||||
|
$category_id = intval($row['category_id']);
|
||||||
|
$category_name = nullable_htmlentities($row['category_name']);
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $category_id; ?>"><?php echo $category_name; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<div class="form-group">
|
</select>
|
||||||
<label> Asset </label>
|
<div class="input-group-append">
|
||||||
<div class="input-group">
|
<button class="btn btn-secondary ajax-modal" type="button"
|
||||||
<div class="input-group-prepend">
|
data-modal-url="../admin/modals/category/category_add.php?category=Ticket">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-desktop"></i></span>
|
<i class="fas fa-fw fa-plus"></i>
|
||||||
</div>
|
</button>
|
||||||
<select class="form-control select2" name="asset" id="assetSelect">
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
|
||||||
<label> Location </label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-map-marker-alt"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="location" id="locationSelect">
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
|
|
||||||
<div class="col">
|
|
||||||
<div class="form-group">
|
|
||||||
<label> Vendor </label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-building"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="vendor" id="vendorSelect">
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col">
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Vendor Ticket Number</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="vendor_ticket_number" placeholder="Vendor ticket number">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Assign to</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-user-check"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="assigned_to">
|
||||||
|
<option value="0">- Not Assigned -</option>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT user_id, user_name FROM users
|
||||||
|
WHERE user_type = 1 AND user_status = 1 AND user_archived_at IS NULL ORDER BY user_name ASC"
|
||||||
|
);
|
||||||
|
while ($row = mysqli_fetch_array($sql)) {
|
||||||
|
$user_id = intval($row['user_id']);
|
||||||
|
$user_name = nullable_htmlentities($row['user_name']); ?>
|
||||||
|
<option value="<?php echo $user_id; ?>"><?php echo $user_name; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if ($config_module_enable_accounting) { ?>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="custom-control custom-switch">
|
||||||
|
<input type="checkbox" class="custom-control-input" name="billable" <?php if ($config_ticket_default_billable == 1) { echo "checked"; } ?> value="1" id="billable">
|
||||||
|
<label class="custom-control-label" for="billable">Mark Billable</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Ticket client/contact -->
|
||||||
|
<?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="form-group">
|
||||||
|
<label>Client <strong class="text-danger">*</strong></label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="client" id="changeClientSelect" required <?php if ($client_id) { echo "disabled"; } ?>>
|
||||||
|
<option value="">- Client -</option>
|
||||||
|
<?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");
|
||||||
|
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 if ($client_id == $client_id_select) {echo "selected"; } ?>><?php echo $client_name; ?></option>
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Contact </label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="contact" id="contactSelect">
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
<div class="tab-pane fade" id="pills-add-relationships">
|
||||||
|
To-do: project, etc.
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Asset</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-desktop"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="asset" id="assetSelect">
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Location</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-map-marker-alt"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="location" id="locationSelect">
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Vendor</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-building"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="vendor" id="vendorSelect">
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Vendor Ticket Number</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="vendor_ticket_number" placeholder="Vendor ticket number">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal-footer">
|
|
||||||
<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>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
<div class="modal-footer">
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
<!-- 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';
|
||||||
|
|
|
||||||
|
|
@ -1,159 +1,166 @@
|
||||||
<div class="modal" id="addVendorModal" tabindex="-1">
|
<?php
|
||||||
<div class="modal-dialog">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header bg-dark">
|
|
||||||
<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">
|
|
||||||
<span>×</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<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">
|
require_once '../../../includes/modal_header.php';
|
||||||
<ul class="nav nav-pills nav-justified mb-3">
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link active" data-toggle="pill" href="#pills-details">Details</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" data-toggle="pill" href="#pills-support">Support</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" data-toggle="pill" href="#pills-notes">Notes</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<hr>
|
$client_id = intval($_GET['client_id'] ?? 0);
|
||||||
|
|
||||||
<div class="tab-content">
|
ob_start();
|
||||||
<div class="tab-pane fade show active" id="pills-details">
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Vendor Name <strong class="text-danger">*</strong></label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-building"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="name" placeholder="Vendor Name" maxlength="200" required autofocus>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
?>
|
||||||
<label>Description</label>
|
<div class="modal-header bg-dark">
|
||||||
<div class="input-group">
|
<h5 class="modal-title"><i class="fas fa-fw fa-building mr-2"></i>New Vendor</h5>
|
||||||
<div class="input-group-prepend">
|
<button type="button" class="close text-white" data-dismiss="modal">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-angle-right"></i></span>
|
<span>×</span>
|
||||||
</div>
|
</button>
|
||||||
<input type="text" class="form-control" name="description" placeholder="Description" maxlength="200">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Account Number</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-fingerprint"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="account_number" placeholder="Account number" maxlength="200">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Account Manager</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="contact_name" placeholder="Account manager's name" maxlength="200">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="tab-pane fade" id="pills-support">
|
|
||||||
<label>Support Phone / <span class="text-secondary">Extension</span></label>
|
|
||||||
<div class="form-row">
|
|
||||||
<div class="col-9">
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="tel" class="form-control col-2" name="phone_country_code" placeholder="+" maxlength="4">
|
|
||||||
<input type="tel" class="form-control" name="phone" placeholder="Phone Number" maxlength="200">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-3">
|
|
||||||
<div class="form-group">
|
|
||||||
<input type="text" class="form-control" name="extension" placeholder="ext." maxlength="200">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Support Hours</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="hours" placeholder="Support Hours" maxlength="200">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Support Email</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-envelope"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="email" class="form-control" name="email" placeholder="Support Email" maxlength="200">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Support Website URL</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-globe"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="website" placeholder="Do not include http(s)://" maxlength="200">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Pin/Code</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="code" placeholder="Access Code or Pin" maxlength="200">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>SLA</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-handshake"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="sla" placeholder="SLA Response Time" maxlength="200">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="tab-pane fade" id="pills-notes">
|
|
||||||
<div class="form-group">
|
|
||||||
<textarea class="form-control" rows="12" placeholder="Enter some notes" name="notes"></textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<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>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<form action="post.php" method="post" autocomplete="off">
|
||||||
|
<input type="hidden" name="client_id" value="<?= $client_id ?>">
|
||||||
|
|
||||||
|
<div class="modal-body">
|
||||||
|
<ul class="nav nav-pills nav-justified mb-3">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link active" data-toggle="pill" href="#pills-details">Details</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" data-toggle="pill" href="#pills-support">Support</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" data-toggle="pill" href="#pills-notes">Notes</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<div class="tab-content">
|
||||||
|
<div class="tab-pane fade show active" id="pills-details">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Vendor Name <strong class="text-danger">*</strong></label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-building"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="name" placeholder="Vendor Name" maxlength="200" required autofocus>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Description</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-angle-right"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="description" placeholder="Description" maxlength="200">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Account Number</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-fingerprint"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="account_number" placeholder="Account number" maxlength="200">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Account Manager</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="contact_name" placeholder="Account manager's name" maxlength="200">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tab-pane fade" id="pills-support">
|
||||||
|
<label>Support Phone / <span class="text-secondary">Extension</span></label>
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="col-9">
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="tel" class="form-control col-2" name="phone_country_code" placeholder="+" maxlength="4">
|
||||||
|
<input type="tel" class="form-control" name="phone" placeholder="Phone Number" maxlength="200">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<input type="text" class="form-control" name="extension" placeholder="ext." maxlength="200">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Support Hours</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="hours" placeholder="Support Hours" maxlength="200">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Support Email</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-envelope"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="email" class="form-control" name="email" placeholder="Support Email" maxlength="200">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Support Website URL</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-globe"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="website" placeholder="Do not include http(s)://" maxlength="200">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Pin/Code</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="code" placeholder="Access Code or Pin" maxlength="200">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>SLA</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-handshake"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="sla" placeholder="SLA Response Time" maxlength="200">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tab-pane fade" id="pills-notes">
|
||||||
|
<div class="form-group">
|
||||||
|
<textarea class="form-control" rows="12" placeholder="Enter some notes" name="notes"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
require_once '../../../includes/modal_footer.php';
|
||||||
|
|
|
||||||
|
|
@ -184,9 +184,9 @@ 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>
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
|
|
@ -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";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue