mirror of https://github.com/itflow-org/itflow
Merge pull request #1220 from itflow-org/develop
Merge Develop into Master for 25.05 Release
This commit is contained in:
commit
939b07422d
33
CHANGELOG.md
33
CHANGELOG.md
|
|
@ -2,6 +2,39 @@
|
|||
|
||||
This file documents all notable changes made to ITFlow.
|
||||
|
||||
## [25.05]
|
||||
|
||||
### Added / Changed
|
||||
- Expanded file upload allow-list to include .bat and .stk file types.
|
||||
- Added full backup/restore functionality. Backup downloads a zip that includes the SQL dump and uploads folder, setup now has option to restore from zip backup.
|
||||
- Migrated Asset and Contact Links to modals to resolve variable overlap issue.
|
||||
- Added Pagination to Notification Modal.
|
||||
- Removed 500 Records Per Page option.
|
||||
- Removed unused old DB checks in the top nav.
|
||||
- Clients can now use the portal to setup Stripe automatic payments themselves for recurring invoices
|
||||
- Automatic payments are now disabled for all recurring invoices if the saved payment method is removed
|
||||
- Added Card Details and Payment added to Client Stripe.
|
||||
- UI / UX updates to guest pay Make use of cards.
|
||||
- Don't show Checkbox columns when ticket is closed, compact ticket list now matches round pills for status and priority.
|
||||
- Ticket UI/UX update allow the ticket toolbar to be a little more mobile-friendly
|
||||
- UI / UX Updates to Expenses - Combine Category and Description into 1 column.
|
||||
- Country information is now displayed in Invoices, Quotes, Recurring Invoices, Clients, Locations, and the client top header.
|
||||
- Added country-based search filters in Locations and Clients sections.
|
||||
- Changed the settings name from Integrations to Identity Providers to make room for future iDPs (e.g. Google).
|
||||
- Bump FullCalendar from 6.1.15 to 6.1.17.
|
||||
- Bump DataTables from 2.2.2 to 2.3.1.
|
||||
- Bump TCPDF from 6.8.2 to 6.9.4.
|
||||
- Bump tinyMCE from 7.7.1 to 7.9.0.
|
||||
- Bump phpMailer from 6.9.2 to 6.10.0.
|
||||
- Bump stripe-php from 16.4.0 to 17.2.1.
|
||||
|
||||
|
||||
### Fixed
|
||||
- "None" option for SMTP encryption now functions correctly.
|
||||
- Debug table row counts now reflect actual counts instead of relying on SHOW TABLE STATUS.
|
||||
- Archived Categories now display properly.
|
||||
- Stripe saved payment methods are now limited to credit/debit cards only.
|
||||
|
||||
## [25.03.6]
|
||||
|
||||
### Fixed
|
||||
|
|
|
|||
|
|
@ -12,10 +12,8 @@
|
|||
We operate a rolling release model. Any bug fixes will be released into latest version of ITFlow, so you must stay up-to-date.
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| Beta | :x: |
|
||||
| 24.12 | :white_check_mark: |
|
||||
| 25.1 | :white_check_mark: (When released) |
|
||||
|---------| ------------------ |
|
||||
| 25.05 | :white_check_mark: |
|
||||
|
||||
## Reporting a Vulnerability via GitHub Security Advisories
|
||||
|
||||
|
|
|
|||
|
|
@ -48,9 +48,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<h3 class="card-title"><i class="fas fa-fw fa-history mr-2"></i>App Logs</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form class="mb-4" autocomplete="off">
|
||||
<form autocomplete="off">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo stripslashes(nullable_htmlentities($q)); } ?>" placeholder="Search app logs">
|
||||
<div class="input-group-append">
|
||||
|
|
@ -59,6 +60,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2">
|
||||
<div class="form-group">
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<form class="mb-4" autocomplete="off">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo stripslashes(nullable_htmlentities($q)); } ?>" placeholder="Search audit logs">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-secondary" type="button" data-toggle="collapse" data-target="#advancedFilter"><i class="fas fa-filter"></i></button>
|
||||
|
|
@ -85,7 +85,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
|
||||
<div class="col-sm-2">
|
||||
<div class="form-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="client" onchange="this.form.submit()">
|
||||
<option value="">- All Clients -</option>
|
||||
|
||||
|
|
@ -105,7 +105,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
|
||||
<div class="col-sm-2">
|
||||
<div class="form-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="user" onchange="this.form.submit()">
|
||||
<option value="">- All Users -</option>
|
||||
|
||||
|
|
@ -125,7 +125,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
|
||||
<div class="col-sm-2">
|
||||
<div class="form-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="type" onchange="this.form.submit()">
|
||||
<option value="">- All Types -</option>
|
||||
|
||||
|
|
@ -144,7 +144,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
|
||||
<div class="col-sm-2">
|
||||
<div class="form-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="action" onchange="this.form.submit()">
|
||||
<option value="">- All Actions -</option>
|
||||
|
||||
|
|
@ -198,7 +198,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<hr>
|
||||
<div class="table-responsive-sm">
|
||||
<table class="table table-sm table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?> text-nowrap">
|
||||
<tr>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=log_created_at&order=<?php echo $disp; ?>">
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ require_once "includes/inc_all_admin.php";
|
|||
</div>
|
||||
<div class="card-body" style="text-align: center;">
|
||||
<div class="alert alert-secondary">If you are unable to back up the entire VM, you'll need to back up the files & database individually. There is no built-in restore. See the <a href="https://docs.itflow.org/backups" target="_blank">docs here</a>.</div>
|
||||
<a class="btn btn-primary btn-lg p-3" href="post.php?download_database&csrf_token=<?php echo $_SESSION['csrf_token'] ?>"><i class="fas fa-fw fa-4x fa-download"></i><br><br>Download database</a>
|
||||
<a class="btn btn-primary btn-lg p-3" href="post.php?download_backup&csrf_token=<?php echo $_SESSION['csrf_token'] ?>"><i class="fas fa-fw fa-4x fa-download"></i><br><br>Download Backup</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -20,12 +20,12 @@ require_once "includes/inc_all_admin.php";
|
|||
<div class="card-body">
|
||||
<form action="post.php" method="POST">
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token'] ?>">
|
||||
<div class="row d-flex justify-content-center">
|
||||
<div class="input-group col-4">
|
||||
<div class="input-group-prepend">
|
||||
<div class="d-flex justify-content-center">
|
||||
<div class="input-group col-sm-4">
|
||||
<input type="password" class="form-control" placeholder="Enter your account password" name="password" autocomplete="new-password" required>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-primary" type="submit" name="backup_master_key"><i class="fas fa-key"></i></button>
|
||||
</div>
|
||||
<button class="btn btn-primary" type="submit" name="backup_master_key"><i class="fas fa-fw fa-key mr-2"></i>Get Master Key</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -27,10 +27,6 @@ $sql = mysqli_query(
|
|||
);
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
if (isset($_GET['archived'])) {
|
||||
$category = "Archived";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
|
|
@ -98,7 +94,7 @@ if (isset($_GET['archived'])) {
|
|||
} else {
|
||||
echo 'btn-default';
|
||||
} ?>">Ticket</a>
|
||||
<a href="?archived=1"
|
||||
<a href="?<?php echo $url_query_strings_sort ?>&archived=1"
|
||||
class="btn <?php if (isset($_GET['archived'])) {
|
||||
echo 'btn-primary';
|
||||
} else {
|
||||
|
|
@ -150,7 +146,7 @@ if (isset($_GET['archived'])) {
|
|||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<?php
|
||||
if ($category == "Archived") {
|
||||
if ($archived) {
|
||||
?>
|
||||
<a class="dropdown-item text-success confirm-link"
|
||||
href="post.php?unarchive_category=<?php echo $category_id; ?>">
|
||||
|
|
|
|||
|
|
@ -296,7 +296,13 @@ if ($tablesResult) {
|
|||
|
||||
while ($table = $tablesResult->fetch_assoc()) {
|
||||
$tableName = $table['Name'];
|
||||
$tableRows = $table['Rows'];
|
||||
|
||||
// Accurate row count
|
||||
$countResult = $mysqli->query("SELECT COUNT(*) AS cnt FROM `$tableName`");
|
||||
$countRow = $countResult->fetch_assoc();
|
||||
$tableRows = $countRow['cnt'];
|
||||
$countResult->free();
|
||||
|
||||
$dataLength = $table['Data_length'];
|
||||
$indexLength = $table['Index_length'];
|
||||
$tableSize = ($dataLength + $indexLength) / (1024 * 1024); // Size in MB
|
||||
|
|
@ -336,11 +342,6 @@ if ($tablesResult) {
|
|||
'name' => 'Total database size (MB)',
|
||||
'value' => round($totalSize, 2) . ' MB',
|
||||
];
|
||||
} else {
|
||||
$databaseStats[] = [
|
||||
'name' => 'Database connection error',
|
||||
'value' => $mysqli->error,
|
||||
];
|
||||
}
|
||||
|
||||
// Section: Database Structure Comparison
|
||||
|
|
@ -518,6 +519,7 @@ $mysqli->close();
|
|||
</ul>
|
||||
<hr>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered mb-3">
|
||||
<tr>
|
||||
<th>ITFlow release version</th>
|
||||
|
|
@ -536,6 +538,7 @@ $mysqli->close();
|
|||
<td><?php echo $gitBranch; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- System Information Table -->
|
||||
<h3>System Information</h3>
|
||||
|
|
@ -552,6 +555,7 @@ $mysqli->close();
|
|||
|
||||
<!-- PHP Extensions and Configuration Table -->
|
||||
<h3 class="mt-3">PHP Extensions and Configuration</h3>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-sm table-bordered">
|
||||
<!-- PHP Extensions Section -->
|
||||
<thead>
|
||||
|
|
@ -678,11 +682,12 @@ $mysqli->close();
|
|||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Database Structure Comparison Table -->
|
||||
<h3 class="mt-3">Database Structure Comparison</h3>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<?php if (!empty($dbComparison)): ?>
|
||||
|
|
@ -699,9 +704,11 @@ $mysqli->close();
|
|||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- Uploads Directory Stats Table -->
|
||||
<h3 class="mt-3">Uploads Directory Stats</h3>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<?php foreach ($uploadsStats as $stat): ?>
|
||||
|
|
@ -712,9 +719,11 @@ $mysqli->close();
|
|||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- Database Stats Table -->
|
||||
<h3 class="mt-3">Database Stats</h3>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<?php foreach ($databaseStats as $stat): ?>
|
||||
|
|
@ -725,9 +734,11 @@ $mysqli->close();
|
|||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- Table Stats Table -->
|
||||
<h3 class="mt-3">Table Stats</h3>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-sm table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
@ -746,6 +757,7 @@ $mysqli->close();
|
|||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -4,13 +4,29 @@ require_once "includes/inc_all_admin.php";
|
|||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fas fa-fw fa-plug mr-2"></i>Integration Settings</h3>
|
||||
<h3 class="card-title"><i class="fas fa-fw fa-fingerprint mr-2"></i>Identity Providers</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token'] ?>">
|
||||
|
||||
<h4>Client Portal SSO via Microsoft Entra</h4>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Identity Provider <small class='text-secondary'>(Currently only works with Microsft Entra)</small></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>
|
||||
<select class="form-control select2" readonly>
|
||||
<option <?php if (empty($config_azure_client_id)) { echo "selected"; } ?>>Disabled</option>
|
||||
<option <?php if ($config_azure_client_id) { echo "selected"; } ?>>Microsoft Entra</option>
|
||||
<option>Google (WIP)</option>
|
||||
<option>Custom SSO (WIP)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>MS Entra OAuth App (Client) ID</label>
|
||||
<div class="input-group">
|
||||
|
|
@ -33,11 +49,10 @@ require_once "includes/inc_all_admin.php";
|
|||
|
||||
<hr>
|
||||
|
||||
<button type="submit" name="edit_integrations_settings" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Save</button>
|
||||
<button type="submit" name="edit_identity_provider" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Save</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php require_once "includes/footer.php";
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<hr>
|
||||
<div class="table-responsive-sm">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?> text-nowrap">
|
||||
<tr>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=role_name&order=<?php echo $disp; ?>">
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ $company_initials = nullable_htmlentities(initials($company_name));
|
|||
|
||||
<label>Phone</label>
|
||||
<div class="form-row">
|
||||
<div class="col-9">
|
||||
<div class="col-md-9">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@ require_once "includes/inc_all_admin.php";
|
|||
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token'] ?>">
|
||||
|
||||
<div class="input-group-append">
|
||||
<button type="submit" name="test_email_imap" class="btn btn-success"><i class="fas fa-fw fa-inbox mr-2"></i>Test</button>
|
||||
<button type="submit" name="test_email_imap" class="btn btn-success" disabled><i class="fas fa-fw fa-inbox mr-2"></i>Test (WIP)</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ require_once "includes/inc_all_admin.php";
|
|||
<label class="custom-control-label" for="enableCronSwitch">Enable Cron (recommended) <small>(several cron scripts must also be added to cron with correct schedules, <a href="https://docs.itflow.org/cron">docs</a>)</small></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
|
|
@ -170,6 +170,7 @@ require_once "includes/inc_all_admin.php";
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
|
|
|
|||
|
|
@ -11,13 +11,15 @@ $stripe_clients_sql = mysqli_query($mysqli, "SELECT * FROM client_stripe LEFT JO
|
|||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table border border-dark">
|
||||
<thead class="thead-dark">
|
||||
<thead class="thead-dark text-nowrap">
|
||||
<tr>
|
||||
<th>Client</th>
|
||||
<th>Stripe Customer ID</th>
|
||||
<th>Stripe Payment ID</th>
|
||||
<th>Payment Details</th>
|
||||
<th>Created</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -29,13 +31,17 @@ $stripe_clients_sql = mysqli_query($mysqli, "SELECT * FROM client_stripe LEFT JO
|
|||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
$stripe_id = nullable_htmlentities($row['stripe_id']);
|
||||
$stripe_pm = nullable_htmlentities($row['stripe_pm']);
|
||||
$stripe_pm_details = nullable_htmlentities($row['stripe_pm_details']);
|
||||
$stripe_pm_created_at = nullable_htmlentities($row['stripe_pm_created_at']);
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo "$client_name ($client_id)" ?></td>
|
||||
<td><?php echo "$client_name ($client_id)"; ?></td>
|
||||
<td><?php echo $stripe_id; ?></td>
|
||||
<td><?php echo $stripe_pm ?></td>
|
||||
<td><?php echo $stripe_pm; ?></td>
|
||||
<td><?php echo $stripe_pm_details; ?></td>
|
||||
<td><?php echo $stripe_pm_created_at; ?></td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown">
|
||||
|
|
@ -61,6 +67,7 @@ $stripe_clients_sql = mysqli_query($mysqli, "SELECT * FROM client_stripe LEFT JO
|
|||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
// Default Column Sortby Filter
|
||||
$sort = "ticket_status_name";
|
||||
$sort = "ticket_status_order";
|
||||
$order = "ASC";
|
||||
|
||||
require_once "includes/inc_all_admin.php";
|
||||
|
|
@ -79,7 +79,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
if ($ticket_status_active) {
|
||||
$ticket_status_display = "<div class='text-success text-bold'>Active</div>";
|
||||
} else {
|
||||
$ticket_status_display = "<div class='text-secondary'>Disabled</div>";
|
||||
$ticket_status_display = "<div class='text-secondary'>Inactive</div>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -97,7 +97,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<span class='badge badge-pill text-light p-2' style="background-color: <?php echo $ticket_status_color; ?>"><?php echo $ticket_status_name; ?></span>
|
||||
<td><?php echo $ticket_status_display; ?></td>
|
||||
<td>
|
||||
<?php if ( $ticket_status_id > 5 ) { ?>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-ellipsis-h"></i>
|
||||
|
|
@ -106,13 +105,14 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<a class="dropdown-item" href="#" data-toggle="ajax-modal" data-ajax-url="ajax/ajax_custom_ticket_status_edit.php" data-ajax-id="<?php echo $ticket_status_id; ?>">
|
||||
<i class="fas fa-fw fa-edit mr-2"></i>Edit
|
||||
</a>
|
||||
<?php if (!$ticket_status_active) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?delete_ticket_status=<?php echo $ticket_status_id; ?>">
|
||||
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?delete_ticket_status=<?php echo $ticket_status_id; ?>&csrf_token=<?php echo $_SESSION['csrf_token']; ?>">
|
||||
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ $sql_ticket_templates = mysqli_query($mysqli, "SELECT * FROM ticket_templates WH
|
|||
$row = mysqli_fetch_array($sql_ticket_templates);
|
||||
|
||||
$ticket_template_name = nullable_htmlentities($row['ticket_template_name']);
|
||||
$ticket_template_description = nullable_htmlentities($row['ticket_template_description']);
|
||||
//$ticket_template_description = nullable_htmlentities($row['ticket_template_description']);
|
||||
$ticket_template_subject = nullable_htmlentities($row['ticket_template_subject']);
|
||||
$ticket_template_details = $purifier->purify($row['ticket_template_details']);
|
||||
$ticket_template_created_at = nullable_htmlentities($row['ticket_template_created_at']);
|
||||
|
|
@ -45,7 +45,7 @@ $sql_task_templates = mysqli_query($mysqli, "SELECT * FROM task_templates WHERE
|
|||
</ol>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<div class="col-9">
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header">
|
||||
|
|
@ -54,7 +54,7 @@ $sql_task_templates = mysqli_query($mysqli, "SELECT * FROM task_templates WHERE
|
|||
<i class="fa fa-fw fa-2x fa-life-ring mr-3"></i>
|
||||
<div class="media-body">
|
||||
<h3 class="mb-0"><?php echo $ticket_template_name; ?></h3>
|
||||
<div><small class="text-secondary"><?php echo $ticket_template_description; ?></small></div>
|
||||
<div><small class="text-secondary"><?php //echo $ticket_template_description; ?></small></div>
|
||||
</div>
|
||||
</div>
|
||||
</h3>
|
||||
|
|
@ -72,7 +72,7 @@ $sql_task_templates = mysqli_query($mysqli, "SELECT * FROM task_templates WHERE
|
|||
|
||||
</div>
|
||||
|
||||
<div class="col-4">
|
||||
<div class="col-3">
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header">
|
||||
|
|
@ -82,11 +82,8 @@ $sql_task_templates = mysqli_query($mysqli, "SELECT * FROM task_templates WHERE
|
|||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="ticket_template_id" value="<?php echo $ticket_template_id; ?>">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-tasks"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="task_name" placeholder="Create a task" required>
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="text" class="form-control" name="task_name" placeholder="Create a task" required maxlength="200">
|
||||
<div class="input-group-append">
|
||||
<button type="submit" name="add_ticket_template_task" class="btn btn-primary"><i class="fas fa-fw fa-check"></i></button>
|
||||
</div>
|
||||
|
|
@ -99,19 +96,18 @@ $sql_task_templates = mysqli_query($mysqli, "SELECT * FROM task_templates WHERE
|
|||
$task_id = intval($row['task_template_id']);
|
||||
$task_name = nullable_htmlentities($row['task_template_name']);
|
||||
$task_completion_estimate = intval($row['task_template_completion_estimate']);
|
||||
$task_description = nullable_htmlentities($row['task_template_description']);
|
||||
//$task_description = nullable_htmlentities($row['task_template_description']);
|
||||
?>
|
||||
<tr data-task-id="<?php echo $task_id; ?>">
|
||||
<td>
|
||||
<a href="#" class="drag-handle"><i class="fas fa-bars text-muted mr-1"></i></a>
|
||||
<span class="text-secondary"><?php echo $task_completion_estimate; ?>m</span>
|
||||
<span class="text-dark"> - <?php echo $task_name; ?></span>
|
||||
<a href="#" class="drag-handle"><i class="fas fa-bars text-muted mr-2"></i></a>
|
||||
<span class="text-dark"><?php echo $task_name; ?></span>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<div class="float-right">
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-link text-secondary btn-sm" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-fw fa-ellipsis-v"></i>
|
||||
<button class="btn btn-light text-secondary btn-sm" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="#"
|
||||
|
|
|
|||
3
ajax.php
3
ajax.php
|
|
@ -294,6 +294,7 @@ if (isset($_GET['get_active_clients'])) {
|
|||
$mysqli,
|
||||
"SELECT client_id, client_name FROM clients
|
||||
WHERE client_archived_at IS NULL
|
||||
$access_permission_query
|
||||
ORDER BY client_accessed_at DESC"
|
||||
);
|
||||
|
||||
|
|
@ -315,7 +316,9 @@ if (isset($_GET['get_client_contacts'])) {
|
|||
$contact_sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT contact_id, contact_name, contact_primary, contact_important, contact_technical FROM contacts
|
||||
LEFT JOIN clients on contact_client_id = client_id
|
||||
WHERE contacts.contact_archived_at IS NULL AND contact_client_id = $client_id
|
||||
$access_permission_query
|
||||
ORDER BY contact_primary DESC, contact_technical DESC, contact_important DESC, contact_name"
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$asset_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM assets
|
||||
WHERE asset_id = $asset_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$client_id = intval($row['asset_client_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-key mr-2"></i>Link Credential to <strong><?php echo $asset_name; ?></strong></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="asset_id" value="<?php echo $asset_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="credential_id">
|
||||
<option value="">- Select a Credential -</option>
|
||||
<?php
|
||||
$sql_credentials_select = mysqli_query($mysqli, "
|
||||
SELECT credentials.credential_id, credentials.credential_name
|
||||
FROM credentials
|
||||
LEFT JOIN assets ON credentials.credential_asset_id = assets.asset_id
|
||||
AND credentials.credential_asset_id = $asset_id
|
||||
WHERE credentials.credential_client_id = $client_id
|
||||
AND credentials.credential_asset_id = 0
|
||||
AND credentials.credential_archived_at IS NULL
|
||||
ORDER BY credentials.credential_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_credentials_select)) {
|
||||
$credential_id = intval($row['credential_id']);
|
||||
$credential_name = nullable_htmlentities($row['credential_name']);
|
||||
?>
|
||||
<option value="<?php echo $credential_id ?>"><?php echo $credential_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_asset_to_credential" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</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/ajax_footer.php";
|
||||
?>
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$asset_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM assets
|
||||
WHERE asset_id = $asset_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$client_id = intval($row['asset_client_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-folder mr-2"></i>Link Document to <strong><?php echo $asset_name; ?></strong></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="asset_id" value="<?php echo $asset_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-folder"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="document_id">
|
||||
<option value="">- Select a Document -</option>
|
||||
<?php
|
||||
$sql_documents_select = mysqli_query($mysqli, "
|
||||
SELECT documents.document_id, documents.document_name
|
||||
FROM documents
|
||||
LEFT JOIN asset_documents
|
||||
ON documents.document_id = asset_documents.document_id
|
||||
AND asset_documents.asset_id = $asset_id
|
||||
WHERE documents.document_client_id = $client_id
|
||||
AND documents.document_archived_at IS NULL
|
||||
AND asset_documents.asset_id IS NULL
|
||||
ORDER BY documents.document_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_documents_select)) {
|
||||
$document_id = intval($row['document_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
?>
|
||||
<option value="<?php echo $document_id ?>"><?php echo $document_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_asset_to_document" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</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/ajax_footer.php";
|
||||
?>
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$asset_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM assets
|
||||
WHERE asset_id = $asset_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$client_id = intval($row['asset_client_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-paperclip mr-2"></i>Link File to <strong><?php echo $asset_name; ?></strong></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="asset_id" value="<?php echo $asset_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-paperclip"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="file_id">
|
||||
<option value="">- Select a File -</option>
|
||||
<?php
|
||||
$sql_files_select = mysqli_query($mysqli, "
|
||||
SELECT files.file_id, files.file_name, folders.folder_name
|
||||
FROM files
|
||||
LEFT JOIN asset_files
|
||||
ON files.file_id = asset_files.file_id
|
||||
AND asset_files.asset_id = $asset_id
|
||||
LEFT JOIN folders
|
||||
ON folders.folder_id = files.file_folder_id
|
||||
WHERE files.file_client_id = $client_id
|
||||
AND asset_files.asset_id IS NULL
|
||||
ORDER BY folders.folder_name ASC, files.file_name ASC
|
||||
");
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_files_select)) {
|
||||
$file_id = intval($row['file_id']);
|
||||
$file_name = nullable_htmlentities($row['file_name']);
|
||||
$folder_name = nullable_htmlentities($row['folder_name']);
|
||||
?>
|
||||
<option value="<?php echo $file_id ?>"><?php echo "$folder_name/$file_name"; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_asset_to_file" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</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/ajax_footer.php";
|
||||
?>
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$asset_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM assets
|
||||
WHERE asset_id = $asset_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$client_id = intval($row['asset_client_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-stream mr-2"></i>Link Service to <strong><?php echo $asset_name; ?></strong></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="asset_id" value="<?php echo $asset_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-stream"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="service_id">
|
||||
<option value="">- Select a Service -</option>
|
||||
<?php
|
||||
$sql_services_select = mysqli_query($mysqli, "
|
||||
SELECT services.service_id, services.service_name
|
||||
FROM services
|
||||
LEFT JOIN service_assets
|
||||
ON services.service_id = service_assets.service_id
|
||||
AND service_assets.asset_id = $asset_id
|
||||
WHERE services.service_client_id = $client_id
|
||||
AND service_assets.asset_id IS NULL
|
||||
ORDER BY services.service_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_services_select)) {
|
||||
$service_id = intval($row['service_id']);
|
||||
$service_name = nullable_htmlentities($row['service_name']);
|
||||
?>
|
||||
<option value="<?php echo $service_id ?>"><?php echo $service_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_service_to_asset" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</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/ajax_footer.php";
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$asset_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM assets
|
||||
WHERE asset_id = $asset_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$client_id = intval($row['asset_client_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-cube mr-2"></i>License Software to <strong><?php echo $asset_name; ?></strong></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="asset_id" value="<?php echo $asset_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<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="software_id">
|
||||
<option value="">- Select a Device Software License -</option>
|
||||
<?php
|
||||
$sql_software_select = mysqli_query($mysqli, "
|
||||
SELECT software.software_id, software.software_name
|
||||
FROM software
|
||||
LEFT JOIN software_assets
|
||||
ON software.software_id = software_assets.software_id
|
||||
AND software_assets.asset_id = $asset_id
|
||||
WHERE software.software_client_id = $client_id
|
||||
AND software.software_archived_at IS NULL
|
||||
AND software.software_license_type = 'Device'
|
||||
AND software_assets.asset_id IS NULL
|
||||
ORDER BY software.software_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_software_select)) {
|
||||
$software_id = intval($row['software_id']);
|
||||
$software_name = nullable_htmlentities($row['software_name']);
|
||||
|
||||
?>
|
||||
<option value="<?php echo $software_id ?>"><?php echo $software_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_software_to_asset" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</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/ajax_footer.php";
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$contact_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
WHERE contact_id = $contact_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$client_id = intval($row['contact_client_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-desktop mr-2"></i>Link Asset to <strong><?php echo $contact_name; ?></strong></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="contact_id" value="<?php echo $contact_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<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">
|
||||
<option value="">- Select an Asset -</option>
|
||||
<?php
|
||||
$sql_assets_select = mysqli_query($mysqli, "
|
||||
SELECT asset_id, asset_name
|
||||
FROM assets
|
||||
WHERE asset_client_id = $client_id
|
||||
AND asset_contact_id = 0
|
||||
AND asset_archived_at IS NULL
|
||||
ORDER BY asset_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_assets_select)) {
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
?>
|
||||
<option value="<?php echo $asset_id ?>"><?php echo $asset_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_contact_to_asset" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</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/ajax_footer.php";
|
||||
?>
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$contact_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
WHERE contact_id = $contact_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$client_id = intval($row['contact_client_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-key mr-2"></i>Link Credential to <strong><?php echo $contact_name; ?></strong></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="contact_id" value="<?php echo $contact_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="credential_id">
|
||||
<option value="">- Select a Credential -</option>
|
||||
<?php
|
||||
$sql_credentials_select = mysqli_query($mysqli, "
|
||||
SELECT credential_id, credential_name
|
||||
FROM credentials
|
||||
WHERE credential_client_id = $client_id
|
||||
AND credential_contact_id = 0
|
||||
AND credential_archived_at IS NULL
|
||||
ORDER BY credential_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_credentials_select)) {
|
||||
$credential_id = intval($row['credential_id']);
|
||||
$credential_name = nullable_htmlentities($row['credential_name']);
|
||||
?>
|
||||
<option value="<?php echo $credential_id ?>"><?php echo $credential_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_contact_to_credential" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</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/ajax_footer.php";
|
||||
?>
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$contact_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
WHERE contact_id = $contact_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$client_id = intval($row['contact_client_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-folder mr-2"></i>Link Document to <strong><?php echo $contact_name; ?></strong></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="contact_id" value="<?php echo $contact_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-folder"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="document_id">
|
||||
<option value="">- Select a Document -</option>
|
||||
<?php
|
||||
$sql_documents_select = mysqli_query($mysqli, "
|
||||
SELECT documents.document_id, documents.document_name
|
||||
FROM documents
|
||||
LEFT JOIN contact_documents
|
||||
ON documents.document_id = contact_documents.document_id
|
||||
AND contact_documents.contact_id = $contact_id
|
||||
WHERE documents.document_client_id = $client_id
|
||||
AND documents.document_archived_at IS NULL
|
||||
AND contact_documents.contact_id IS NULL
|
||||
ORDER BY documents.document_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_documents_select)) {
|
||||
$document_id = intval($row['document_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
?>
|
||||
<option value="<?php echo $document_id ?>"><?php echo $document_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_contact_to_document" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</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/ajax_footer.php";
|
||||
?>
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$contact_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
WHERE contact_id = $contact_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$client_id = intval($row['contact_client_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-paperclip mr-2"></i>Link File to <strong><?php echo $contact_name; ?></strong></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="contact_id" value="<?php echo $contact_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-paperclip"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="file_id">
|
||||
<option value="">- Select a File -</option>
|
||||
<?php
|
||||
$sql_files_select = mysqli_query($mysqli, "
|
||||
SELECT files.file_id, files.file_name, folders.folder_name
|
||||
FROM files
|
||||
LEFT JOIN contact_files
|
||||
ON files.file_id = contact_files.file_id
|
||||
AND contact_files.contact_id = $contact_id
|
||||
LEFT JOIN folders
|
||||
ON folders.folder_id = files.file_folder_id
|
||||
WHERE files.file_client_id = $client_id
|
||||
AND contact_files.contact_id IS NULL
|
||||
ORDER BY folders.folder_name ASC, files.file_name ASC
|
||||
");
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_files_select)) {
|
||||
$file_id = intval($row['file_id']);
|
||||
$file_name = nullable_htmlentities($row['file_name']);
|
||||
$folder_name = nullable_htmlentities($row['folder_name']);
|
||||
?>
|
||||
<option value="<?php echo $file_id ?>"><?php echo "$folder_name/$file_name"; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_contact_to_file" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</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/ajax_footer.php";
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$contact_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
WHERE contact_id = $contact_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$client_id = intval($row['contact_client_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-stream mr-2"></i>Link Service to <strong><?php echo $contact_name; ?></strong></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="contact_id" value="<?php echo $contact_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-stream"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="service_id">
|
||||
<option value="">- Select a Service -</option>
|
||||
<?php
|
||||
$sql_services_select = mysqli_query($mysqli, "
|
||||
SELECT services.service_id, services.service_name
|
||||
FROM services
|
||||
LEFT JOIN service_contacts
|
||||
ON services.service_id = service_contacts.service_id
|
||||
AND service_contacts.contact_id = $contact_id
|
||||
WHERE services.service_client_id = $client_id
|
||||
AND service_contacts.contact_id IS NULL
|
||||
ORDER BY services.service_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_services_select)) {
|
||||
$service_id = intval($row['service_id']);
|
||||
$service_name = nullable_htmlentities($row['service_name']);
|
||||
?>
|
||||
<option value="<?php echo $service_id ?>"><?php echo $service_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_service_to_contact" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</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/ajax_footer.php";
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$contact_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
WHERE contact_id = $contact_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$client_id = intval($row['contact_client_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-cube mr-2"></i>License Software to <strong><?php echo $contact_name; ?></strong></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="contact_id" value="<?php echo $contact_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<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="software_id">
|
||||
<option value="">- Select a User Software License -</option>
|
||||
<?php
|
||||
$sql_software_select = mysqli_query($mysqli, "
|
||||
SELECT software.software_id, software.software_name
|
||||
FROM software
|
||||
LEFT JOIN software_contacts
|
||||
ON software.software_id = software_contacts.software_id
|
||||
AND software_contacts.contact_id = $contact_id
|
||||
WHERE software.software_client_id = $client_id
|
||||
AND software.software_archived_at IS NULL
|
||||
AND software.software_license_type = 'User'
|
||||
AND software_contacts.contact_id IS NULL
|
||||
ORDER BY software.software_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_software_select)) {
|
||||
$software_id = intval($row['software_id']);
|
||||
$software_name = nullable_htmlentities($row['software_name']);
|
||||
?>
|
||||
<option value="<?php echo $software_id ?>"><?php echo $software_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_software_to_contact" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</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/ajax_footer.php";
|
||||
?>
|
||||
|
|
@ -8,6 +8,7 @@ $sql = mysqli_query($mysqli, "SELECT * FROM ticket_statuses WHERE ticket_status_
|
|||
$row = mysqli_fetch_array($sql);
|
||||
$ticket_status_name = nullable_htmlentities($row['ticket_status_name']);
|
||||
$ticket_status_color = nullable_htmlentities($row['ticket_status_color']);
|
||||
$ticket_status_order = intval($row['ticket_status_order']);
|
||||
$ticket_status_active = intval($row['ticket_status_active']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
|
|
@ -30,7 +31,7 @@ ob_start();
|
|||
<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="name" maxlength="200" value="<?php echo $ticket_status_name; ?>" required>
|
||||
<input type="text" class="form-control" name="name" maxlength="200" value="<?php echo $ticket_status_name; ?>" required <?php if ($ticket_status_id <= 5) { echo "readonly"; } ?>>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -44,6 +45,16 @@ ob_start();
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Order</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-sort-numeric-down"></i></span>
|
||||
</div>
|
||||
<input type="number" class="form-control" name="order" placeholder="Leave blank for no order" value="<?php echo $ticket_status_order; ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Status <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
|
|
@ -52,7 +63,7 @@ ob_start();
|
|||
</div>
|
||||
<select class="form-control select2" name="status" required>
|
||||
<option <?php if ($ticket_status_active == 1) { echo "selected"; } ?> value="1">Active</option>
|
||||
<option <?php if ($ticket_status_active == 0) { echo "selected"; } ?> value="0">Disabled</option>
|
||||
<option <?php if ($ticket_status_active == 0) { echo "selected"; } ?> value="0" <?php if ($ticket_status_id <= 5) { echo "disabled"; } ?>>Inactive</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ ob_start();
|
|||
|
||||
<div class="modal-body bg-white">
|
||||
<?php if ($num_notifications) { ?>
|
||||
<table class="table table-sm table-hover table-borderless">
|
||||
|
||||
|
||||
<?php while ($row = mysqli_fetch_array($sql)) {
|
||||
|
||||
|
|
@ -44,27 +46,35 @@ ob_start();
|
|||
}
|
||||
?>
|
||||
|
||||
<a class="text-dark dropdown-item px-1" href="<?php echo $notification_action; ?>">
|
||||
<div>
|
||||
<span class="text-bold">
|
||||
<tr class="notification-item">
|
||||
<th>
|
||||
<a class="text-dark" href="<?php echo $notification_action; ?>">
|
||||
<i class="fas fa-bullhorn mr-2"></i><?php echo $notification_type; ?>
|
||||
</span>
|
||||
<small class="text-muted float-right">
|
||||
<?php echo $notification_timestamp_formated; ?>
|
||||
</small>
|
||||
</div>
|
||||
<br>
|
||||
<small class="text-secondary text-wrap"><?php echo $notification_details; ?></small>
|
||||
</a>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}} else { ?>
|
||||
<div class="text-center text-secondary py-5">
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<div class="text-center mt-2">
|
||||
<button id="prev-btn" class="btn btn-sm btn-outline-secondary mr-2"><i class="fas fa-caret-left"></i></button>
|
||||
<button id="next-btn" class="btn btn-sm btn-outline-secondary"><i class="fas fa-caret-right"></i></button>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="text-center text-secondary pt-3">
|
||||
<i class='far fa-6x fa-bell-slash'></i>
|
||||
<h3 class="mt-3">No Notifications</h3>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="modal-footer bg-white justify-content-end">
|
||||
<div class="modal-footer bg-white">
|
||||
<?php if ($num_notifications) { ?>
|
||||
|
||||
<a href="post.php?dismiss_all_notifications&csrf_token=<?php echo $_SESSION[
|
||||
|
|
@ -85,4 +95,41 @@ ob_start();
|
|||
</button>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
var perPage = 8;
|
||||
var $items = $(".notification-item");
|
||||
var totalItems = $items.length;
|
||||
var totalPages = Math.ceil(totalItems / perPage);
|
||||
var currentPage = 0;
|
||||
|
||||
function showPage(page) {
|
||||
$items.hide().slice(page * perPage, (page + 1) * perPage).show();
|
||||
$("#prev-btn").prop("disabled", page === 0);
|
||||
$("#next-btn").prop("disabled", page >= totalPages - 1);
|
||||
$("#page-indicator").text(`Page ${page + 1} of ${totalPages} (${totalItems} total)`);
|
||||
}
|
||||
|
||||
$("#prev-btn").on("click", function () {
|
||||
if (currentPage > 0) {
|
||||
currentPage--;
|
||||
showPage(currentPage);
|
||||
}
|
||||
});
|
||||
|
||||
$("#next-btn").on("click", function () {
|
||||
if (currentPage < totalPages - 1) {
|
||||
currentPage++;
|
||||
showPage(currentPage);
|
||||
}
|
||||
});
|
||||
|
||||
if (totalItems <= perPage) {
|
||||
$("#prev-btn, #next-btn, #page-indicator").hide();
|
||||
}
|
||||
|
||||
showPage(currentPage);
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php require_once "../includes/ajax_footer.php";
|
||||
|
|
|
|||
|
|
@ -85,6 +85,25 @@ ob_start();
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<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)) {
|
||||
$select_client_id = intval($row['client_id']);
|
||||
$select_client_name = nullable_htmlentities($row['client_name']);
|
||||
?>
|
||||
<option value="<?php echo $select_client_id; ?>" <?php if ($client_id == $select_client_id) { echo "selected"; } ?>><?php echo $select_client_name; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="edit_project" class="btn btn-primary text-bold">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ $row = mysqli_fetch_array($sql);
|
|||
$task_template_name = nullable_htmlentities($row['task_template_name']);
|
||||
$task_template_order = intval($row['task_template_order']);
|
||||
$task_template_completion_estimate = intval($row['task_template_completion_estimate']);
|
||||
$task_template_description = nullable_htmlentities($row['task_template_description']);
|
||||
//$task_template_description = nullable_htmlentities($row['task_template_description']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ if (!empty($subject)) {
|
|||
|
||||
// Insert ticket
|
||||
$url_key = randomString(156);
|
||||
$insert_sql = mysqli_query($mysqli,"INSERT INTO tickets SET ticket_prefix = '$config_ticket_prefix', ticket_number = $ticket_number, ticket_subject = '$subject', ticket_details = '$details', ticket_priority = '$priority', ticket_status = 1, ticket_billable = $billable, ticket_vendor_ticket_number = '$vendor_ticket_number', ticket_vendor_id = $vendor_id, ticket_created_by = 0, ticket_assigned_to = $assigned_to, ticket_contact_id = $contact, ticket_url_key = '$url_key', ticket_client_id = $client_id");
|
||||
$insert_sql = mysqli_query($mysqli,"INSERT INTO tickets SET ticket_prefix = '$config_ticket_prefix', ticket_number = $ticket_number, ticket_source = 'API', ticket_subject = '$subject', ticket_details = '$details', ticket_priority = '$priority', ticket_status = 1, ticket_billable = $billable, ticket_vendor_ticket_number = '$vendor_ticket_number', ticket_vendor_id = $vendor_id, ticket_created_by = 0, ticket_assigned_to = $assigned_to, ticket_contact_id = $contact, ticket_url_key = '$url_key', ticket_client_id = $client_id");
|
||||
|
||||
// Check insert & get insert ID
|
||||
if ($insert_sql) {
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ if (isset($_GET['asset_id'])) {
|
|||
$ticket_count = mysqli_num_rows($sql_related_tickets);
|
||||
|
||||
// Related Recurring Tickets Query
|
||||
$sql_related_recurring_tickets = mysqli_query($mysqli, "SELECT * FROM recurring_tickets
|
||||
$sql_related_recurring_tickets = mysqli_query($mysqli, "SELECT recurring_tickets.* FROM recurring_tickets
|
||||
LEFT JOIN recurring_ticket_assets ON recurring_tickets.recurring_ticket_id = recurring_ticket_assets.recurring_ticket_id
|
||||
WHERE recurring_ticket_asset_id = $asset_id OR recurring_ticket_assets.asset_id = $asset_id
|
||||
GROUP BY recurring_tickets.recurring_ticket_id
|
||||
|
|
@ -378,27 +378,40 @@ if (isset($_GET['asset_id'])) {
|
|||
<div class="dropdown dropleft">
|
||||
<button type="button" class="btn btn-outline-primary" data-toggle="dropdown"><i class="fas fa-link mr-2"></i>Link</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkSoftwareModal">
|
||||
<a class="dropdown-item text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_asset_link_software.php"
|
||||
data-ajax-id="<?php echo $asset_id; ?>">
|
||||
<i class="fa fa-fw fa-cube mr-2"></i>License
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkCredentialModal">
|
||||
<a class="dropdown-item text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_asset_link_credential.php"
|
||||
data-ajax-id="<?php echo $asset_id; ?>">
|
||||
<i class="fa fa-fw fa-key mr-2"></i>Credential
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkServiceModal">
|
||||
<a class="dropdown-item text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_asset_link_service.php"
|
||||
data-ajax-id="<?php echo $asset_id; ?>">
|
||||
<i class="fa fa-fw fa-stream mr-2"></i>Service
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkDocumentModal">
|
||||
<a class="dropdown-item text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_asset_link_document.php"
|
||||
data-ajax-id="<?php echo $asset_id; ?>">
|
||||
<i class="fa fa-fw fa-folder mr-2"></i>Document
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkFileModal">
|
||||
<a class="dropdown-item text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_asset_link_file.php"
|
||||
data-ajax-id="<?php echo $asset_id; ?>">
|
||||
<i class="fa fa-fw fa-paperclip mr-2"></i>File
|
||||
</a>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1193,10 +1206,4 @@ require_once "modals/credential_add_modal.php";
|
|||
require_once "modals/client_document_add_modal.php";
|
||||
require_once "modals/client_file_upload_modal.php";
|
||||
|
||||
require_once "modals/asset_link_software_modal.php";
|
||||
require_once "modals/asset_link_credential_modal.php";
|
||||
require_once "modals/asset_link_service_modal.php";
|
||||
require_once "modals/asset_link_document_modal.php";
|
||||
require_once "modals/asset_link_file_modal.php";
|
||||
|
||||
require_once "includes/footer.php";
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ if (mysqli_num_rows($os_sql) > 0) {
|
|||
</div>
|
||||
<?php if ($client_url) { ?>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="location" onchange="this.form.submit()">
|
||||
<option value="">- All Locations -</option>
|
||||
|
||||
|
|
@ -233,7 +233,7 @@ if (mysqli_num_rows($os_sql) > 0) {
|
|||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="client" onchange="this.form.submit()">
|
||||
<option value="" <?php if ($client == "") { echo "selected"; } ?>>- All Clients -</option>
|
||||
|
||||
|
|
@ -338,7 +338,7 @@ if (mysqli_num_rows($os_sql) > 0) {
|
|||
|
||||
<div class="table-responsive">
|
||||
<table class="table border table-hover">
|
||||
<thead class="thead-light <?php if (!$num_rows[0]) { echo "d-none"; } ?>">
|
||||
<thead class="thead-light <?php if (!$num_rows[0]) { echo "d-none"; } ?> text-nowrap">
|
||||
<tr>
|
||||
<td class="bg-light pr-0">
|
||||
<div class="form-check">
|
||||
|
|
@ -519,7 +519,7 @@ if (mysqli_num_rows($os_sql) > 0) {
|
|||
if ($contact_name) {
|
||||
$contact_name_display = "<a href='#'
|
||||
data-toggle='ajax-modal'
|
||||
data-modal-size='lg'
|
||||
data-modal-size='xl'
|
||||
data-ajax-url='ajax/ajax_contact_details.php'
|
||||
data-ajax-id='$asset_contact_id'>
|
||||
$contact_name $contact_archive_display
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ header("X-Frame-Options: DENY"); // Legacy
|
|||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="navbarDropdown1">
|
||||
<a class="dropdown-item" href="invoices.php">Invoices</a>
|
||||
<a class="dropdown-item" href="recurring_invoices.php">Recurring Invoices</a>
|
||||
<a class="dropdown-item" href="quotes.php">Quotes</a>
|
||||
<a class="dropdown-item" href="autopay.php">Auto Payment</a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ if (isset($_POST['add_ticket'])) {
|
|||
$new_config_ticket_next_number = $config_ticket_next_number + 1;
|
||||
mysqli_query($mysqli, "UPDATE settings SET config_ticket_next_number = $new_config_ticket_next_number WHERE company_id = 1");
|
||||
|
||||
mysqli_query($mysqli, "INSERT INTO tickets SET ticket_prefix = '$config_ticket_prefix', ticket_number = $ticket_number, ticket_category = $category, ticket_subject = '$subject', ticket_details = '$details', ticket_priority = '$priority', ticket_status = 1, ticket_billable = $config_ticket_default_billable, ticket_created_by = 0, ticket_contact_id = $session_contact_id, ticket_url_key = '$url_key', ticket_client_id = $session_client_id");
|
||||
mysqli_query($mysqli, "INSERT INTO tickets SET ticket_prefix = '$config_ticket_prefix', ticket_number = $ticket_number, ticket_source = 'Portal', ticket_category = $category, ticket_subject = '$subject', ticket_details = '$details', ticket_priority = '$priority', ticket_status = 1, ticket_billable = $config_ticket_default_billable, ticket_created_by = $session_user_id, ticket_contact_id = $session_contact_id, ticket_url_key = '$url_key', ticket_client_id = $session_client_id");
|
||||
$ticket_id = mysqli_insert_id($mysqli);
|
||||
|
||||
// Notify agent DL of the new ticket, if populated with a valid email
|
||||
|
|
@ -597,10 +597,22 @@ if (isset($_GET['stripe_save_card'])) {
|
|||
|
||||
// Get some card/payment method details for the email/logging
|
||||
$payment_method_details = $stripe->paymentMethods->retrieve($payment_method);
|
||||
$card_info = sanitizeInput($payment_method_details->card->display_brand) . " " . sanitizeInput($payment_method_details->card->last4);
|
||||
$card_type = sanitizeInput($payment_method_details->card->brand);
|
||||
$last4 = sanitizeInput($payment_method_details->card->last4);
|
||||
$expiry_month = sanitizeInput($payment_method_details->card->exp_month);
|
||||
$expiry_year = sanitizeInput($payment_method_details->card->exp_year);
|
||||
|
||||
// Format the payment details string (Visa - 4324 | Exp 12/25)
|
||||
$stripe_pm_details = "$card_type - $last4 | Exp $expiry_month/$expiry_year";
|
||||
|
||||
// Save the formatted payment details into stripe_pm_details
|
||||
$update_query = "
|
||||
UPDATE client_stripe
|
||||
SET stripe_pm_details = '$stripe_pm_details'
|
||||
WHERE client_id = $session_client_id LIMIT 1";
|
||||
mysqli_query($mysqli, $update_query);
|
||||
|
||||
// Send email confirmation
|
||||
|
||||
// Company Details & Settings
|
||||
$sql_settings = mysqli_query($mysqli, "SELECT * FROM companies, settings WHERE companies.company_id = settings.company_id AND companies.company_id = 1");
|
||||
$row = mysqli_fetch_array($sql_settings);
|
||||
|
|
@ -617,7 +629,7 @@ if (isset($_GET['stripe_save_card'])) {
|
|||
|
||||
if (!empty($config_smtp_host)) {
|
||||
$subject = "Payment method saved";
|
||||
$body = "Hello $session_contact_name,<br><br>We’re writing to confirm that your payment details have been securely stored with Stripe, our trusted payment processor.<br><br>By agreeing to save your payment information, you have authorized us to automatically bill your card ($card_info) for any future invoices. The payment details you’ve provided are securely stored with Stripe and will be used solely for invoices. We do not have access to your full card details.<br><br>You may update or remove your payment information at any time using the portal.<br><br>Thank you for your business!<br><br>--<br>$company_name - Billing Department<br>$config_invoice_from_email<br>$company_phone";
|
||||
$body = "Hello $session_contact_name,<br><br>We’re writing to confirm that your payment details have been securely stored with Stripe, our trusted payment processor.<br><br>By agreeing to save your payment information, you have authorized us to automatically bill your card ($stripe_pm_details) for any future invoices. The payment details you’ve provided are securely stored with Stripe and will be used solely for invoices. We do not have access to your full card details.<br><br>You may update or remove your payment information at any time using the portal.<br><br>Thank you for your business!<br><br>--<br>$company_name - Billing Department<br>$config_invoice_from_email<br>$company_phone";
|
||||
|
||||
$data = [
|
||||
[
|
||||
|
|
@ -635,12 +647,11 @@ if (isset($_GET['stripe_save_card'])) {
|
|||
}
|
||||
|
||||
// Logging
|
||||
logAction("Stripe", "Update", "$session_contact_name saved payment method ($card_info) for future automatic payments (PM: $payment_method)", $session_client_id, $session_client_id);
|
||||
logAction("Stripe", "Update", "$session_contact_name saved payment method ($stripe_pm_details) for future automatic payments (PM: $payment_method)", $session_client_id, $session_client_id);
|
||||
|
||||
// Redirect
|
||||
$_SESSION['alert_message'] = "Payment method saved - thank you";
|
||||
header('Location: autopay.php');
|
||||
|
||||
}
|
||||
|
||||
if (isset($_GET['stripe_remove_pm'])) {
|
||||
|
|
@ -677,7 +688,15 @@ if (isset($_GET['stripe_remove_pm'])) {
|
|||
}
|
||||
|
||||
// Remove payment method from ITFlow
|
||||
mysqli_query($mysqli, "UPDATE client_stripe SET stripe_pm = NULL WHERE client_id = $session_client_id LIMIT 1");
|
||||
mysqli_query($mysqli, "UPDATE client_stripe SET stripe_pm = NULL, stripe_pm_details = NULL WHERE client_id = $session_client_id LIMIT 1");
|
||||
|
||||
// Remove Auto Pay on recurring invoices that are stripe
|
||||
$sql_recurring_invoices = mysqli_query($mysqli, "SELECT recurring_invoice_id FROM recurring_invoices WHERE recurring_invoice_client_id = $session_client_id");
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_recurring_invoices)) {
|
||||
$recurring_invoice_id = intval($row['recurring_invoice_id']);
|
||||
mysqli_query($mysqli, "DELETE FROM recurring_payments WHERE recurring_payment_method = 'Stripe' AND recurring_payment_recurring_invoice_id = $recurring_invoice_id");
|
||||
}
|
||||
|
||||
// Logging & Redirect
|
||||
logAction("Stripe", "Update", "$session_contact_name deleted saved Stripe payment method (PM: $payment_method)", $session_client_id, $session_client_id);
|
||||
|
|
@ -685,3 +704,49 @@ if (isset($_GET['stripe_remove_pm'])) {
|
|||
$_SESSION['alert_message'] = "Payment method removed";
|
||||
header('Location: autopay.php');
|
||||
}
|
||||
|
||||
if (isset($_POST['add_recurring_payment'])) {
|
||||
|
||||
$recurring_invoice_id = intval($_POST['recurring_invoice_id']);
|
||||
|
||||
// Get Recurring Info for logging and alerting
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM recurring_invoices WHERE recurring_invoice_id = $recurring_invoice_id");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$recurring_invoice_prefix = sanitizeInput($row['recurring_invoice_prefix']);
|
||||
$recurring_invoice_number = intval($row['recurring_invoice_number']);
|
||||
$recurring_invoice_amount = floatval($row['recurring_invoice_amount']);
|
||||
$recurring_invoice_currency_code = sanitizeInput($row['recurring_invoice_currency_code']);
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO recurring_payments SET recurring_payment_currency_code = '$recurring_invoice_currency_code', recurring_payment_account_id = $config_stripe_account, recurring_payment_method = 'Stripe', recurring_payment_recurring_invoice_id = $recurring_invoice_id");
|
||||
|
||||
// Get Payment ID for reference
|
||||
$recurring_payment_id = mysqli_insert_id($mysqli);
|
||||
|
||||
// Logging
|
||||
logAction("Recurring Invoice", "Auto Payment", "$session_name created Auto Pay for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number in the amount of " . numfmt_format_currency($currency_format, $recurring_invoice_amount, $recurring_invoice_currency_code), $session_client_id, $recurring_invoice_id);
|
||||
|
||||
|
||||
$_SESSION['alert_message'] = "Automatic Payment enabled for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
}
|
||||
|
||||
if (isset($_POST['delete_recurring_payment'])) {
|
||||
$recurring_invoice_id = intval($_POST['recurring_invoice_id']);
|
||||
|
||||
// Get the invoice total and details
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM recurring_invoices WHERE recurring_invoice_id = $recurring_invoice_id");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$recurring_invoice_prefix = sanitizeInput($row['recurring_invoice_prefix']);
|
||||
$recurring_invoice_number = intval($row['recurring_invoice_number']);
|
||||
|
||||
mysqli_query($mysqli,"DELETE FROM recurring_payments WHERE recurring_payment_recurring_invoice_id = $recurring_invoice_id");
|
||||
|
||||
// Logging
|
||||
logAction("Recurring Invoice", "Auto Payment", "$session_name removed auto Pay from Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number", $session_client_id, $recurring_invoice_id);
|
||||
|
||||
$_SESSION['alert_message'] = "Automatic Payment disabled for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,120 @@
|
|||
<?php
|
||||
/*
|
||||
* Client Portal
|
||||
* Invoices for PTC
|
||||
*/
|
||||
|
||||
header("Content-Security-Policy: default-src 'self'");
|
||||
|
||||
require_once "includes/inc_all.php";
|
||||
|
||||
|
||||
if ($session_contact_primary == 0 && !$session_contact_is_billing_contact) {
|
||||
header("Location: post.php?logout");
|
||||
exit();
|
||||
}
|
||||
|
||||
// Get client's StripeID from database
|
||||
$stripe_client_details = mysqli_fetch_array(mysqli_query($mysqli, "SELECT * FROM client_stripe WHERE client_id = $session_client_id LIMIT 1"));
|
||||
if ($stripe_client_details) {
|
||||
$stripe_pm = sanitizeInput($stripe_client_details['stripe_pm']);
|
||||
}
|
||||
|
||||
$recurring_invoices_sql = mysqli_query($mysqli, "SELECT * FROM recurring_invoices
|
||||
LEFT JOIN recurring_payments ON recurring_payment_recurring_invoice_id = recurring_invoice_id
|
||||
WHERE recurring_invoice_client_id = $session_client_id
|
||||
AND recurring_invoice_status = 1
|
||||
ORDER BY recurring_invoice_next_date DESC"
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<h3>Recurring Invoices</h3>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-10">
|
||||
|
||||
<table class="table tabled-bordered border border-dark">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Scope</th>
|
||||
<th>Amount</th>
|
||||
<th>Next Bill Date</th>
|
||||
<th>Frequency</th>
|
||||
<?php if ($config_stripe_enable) { ?>
|
||||
<th>Auto Pay</th>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
while ($row = mysqli_fetch_array($recurring_invoices_sql)) {
|
||||
$recurring_invoice_id = intval($row['recurring_invoice_id']);
|
||||
$recurring_invoice_prefix = nullable_htmlentities($row['recurring_invoice_prefix']);
|
||||
$recurring_invoice_number = intval($row['recurring_invoice_number']);
|
||||
$recurring_invoice_scope = nullable_htmlentities($row['recurring_invoice_scope']);
|
||||
$recurring_invoice_status = nullable_htmlentities($row['recurring_invoice_status']);
|
||||
$recurring_invoice_next_date = nullable_htmlentities($row['recurring_invoice_next_date']);
|
||||
$recurring_invoice_frequency = nullable_htmlentities($row['recurring_invoice_frequency']);
|
||||
$recurring_invoice_amount = floatval($row['recurring_invoice_amount']);
|
||||
$recurring_payment_id = intval($row['recurring_payment_id']);
|
||||
$recurring_payment_recurring_invoice_id = intval($row['recurring_payment_recurring_invoice_id']);
|
||||
if ($config_stripe_enable) {
|
||||
if ($recurring_payment_recurring_invoice_id) {
|
||||
$auto_pay_display = "
|
||||
Yes
|
||||
<a href='post.php?delete_recurring_payment=$recurring_payment_id' title='Remove'>
|
||||
<i class='fas fa-fw fa-times-circle'></i>
|
||||
</a>
|
||||
";
|
||||
} else {
|
||||
$auto_pay_display = "
|
||||
<a href='#' data-toggle='modal' data-target='#addRecurringPaymentModal$recurring_invoice_id'>
|
||||
Create
|
||||
</a>
|
||||
";
|
||||
//require "recurring_payment_add_modal.php";
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($recurring_invoice_scope)) {
|
||||
$recurring_invoice_scope_display = "-";
|
||||
} else {
|
||||
$recurring_invoice_scope_display = $recurring_invoice_scope;
|
||||
}
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $recurring_invoice_scope_display; ?></td>
|
||||
<td><?php echo numfmt_format_currency($currency_format, $recurring_invoice_amount, $session_company_currency); ?></td>
|
||||
<td><?php echo $recurring_invoice_next_date; ?></td>
|
||||
<td><?php echo ucwords($recurring_invoice_frequency); ?>ly</td>
|
||||
<?php if ($config_stripe_enable) { ?>
|
||||
<td>
|
||||
<?php if ($stripe_pm) { ?>
|
||||
<form class="form" action="post.php" method="post">
|
||||
<input type="hidden" name="recurring_invoice_id" value="<?php echo $recurring_invoice_id; ?>">
|
||||
<?php if ($recurring_payment_recurring_invoice_id) { ?>
|
||||
<button type="submit" name="delete_recurring_payment" class="btn btn-outline-dark"><i class="fas fa-times mr-2"></i>Disable</button>
|
||||
<?php } else { ?>
|
||||
<button type="submit" name="add_recurring_payment" class="btn btn-primary text-bold"><i class="fas fa-check mr-2"></i>Enable</button>
|
||||
<?php } ?>
|
||||
</form>
|
||||
<?php } else { ?>
|
||||
<a href="autopay.php">Add Card Details First</a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
require_once "includes/footer.php";
|
||||
|
|
@ -9,9 +9,6 @@ require_once "includes/inc_all_client.php";
|
|||
// Perms
|
||||
enforceUserPermission('module_support');
|
||||
|
||||
// Rebuild URL
|
||||
$url_query_strings_sort = http_build_query($get_copy);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM racks
|
||||
|
|
@ -323,7 +320,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
} else {
|
||||
// No device in this row
|
||||
?>
|
||||
<td class="text-center">No device</td>
|
||||
<td class="text-center text-secondary">--</td>
|
||||
<td></td>
|
||||
<?php
|
||||
}
|
||||
|
|
|
|||
10
clients.php
10
clients.php
|
|
@ -62,7 +62,7 @@ $sql = mysqli_query(
|
|||
WHERE (client_name LIKE '%$q%' OR client_abbreviation LIKE '%$q%' OR client_type LIKE '%$q%' OR client_referral LIKE '%$q%'
|
||||
OR contact_email LIKE '%$q%' OR contact_name LIKE '%$q%' OR contact_phone LIKE '%$phone_query%'
|
||||
OR contact_mobile LIKE '%$phone_query%' OR location_address LIKE '%$q%'
|
||||
OR location_city LIKE '%$q%' OR location_state LIKE '%$q%' OR location_zip LIKE '%$q%'
|
||||
OR location_city LIKE '%$q%' OR location_state LIKE '%$q%' OR location_zip LIKE '%$q%' OR location_country LIKE '%$q%'
|
||||
OR tag_name LIKE '%$q%' OR client_tax_id_number LIKE '%$q%')
|
||||
AND client_$archive_query
|
||||
AND DATE(client_created_at) BETWEEN '$dtf' AND '$dtt'
|
||||
|
|
@ -111,7 +111,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<input type="hidden" name="archived" value="<?php echo $archived; ?>">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-sm-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo stripslashes(nullable_htmlentities($q)); } ?>" placeholder="Search <?php if($leads_filter == 0){ echo "clients"; } else { echo "leads"; } ?>" autofocus>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-secondary" type="button" data-toggle="collapse" data-target="#advancedFilter"><i class="fas fa-filter"></i></button>
|
||||
|
|
@ -126,7 +126,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<a href="?leads=1" class="btn btn-<?php if ($leads_filter == 1){ echo "primary"; } else { echo "default"; } ?>"><i class="fa fa-fw fa-bullhorn mr-2"></i>Leads</a>
|
||||
</div>
|
||||
|
||||
<div class="btn-group mr-2">
|
||||
<div class="btn-group">
|
||||
<a href="?<?php echo $url_query_strings_sort ?>&archived=<?php if($archived == 1){ echo 0; } else { echo 1; } ?>"
|
||||
class="btn btn-<?php if ($archived == 1) { echo "primary"; } else { echo "default"; } ?>">
|
||||
<i class="fa fa-fw fa-archive mr-2"></i>Archived
|
||||
|
|
@ -248,7 +248,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<hr>
|
||||
<div class="table-responsive-sm">
|
||||
<table class="table table-striped table-hover table-borderless">
|
||||
<thead class="<?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<thead class="<?php if ($num_rows[0] == 0) { echo "d-none"; } ?> text-nowrap">
|
||||
<tr>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=client_name&order=<?php echo $disp; ?>">
|
||||
|
|
@ -286,7 +286,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
if (empty($location_address) && empty($location_city) && empty($location_state) && empty($location_zip)) {
|
||||
$location_address_display = "-";
|
||||
} else {
|
||||
$location_address_display = "$location_address<br>$location_city $location_state $location_zip";
|
||||
$location_address_display = "<i class='fa fa-fw fa-map-marker-alt text-secondary mr-2'></i>$location_address<br><i class='fa fa-fw mr-2'></i>$location_city $location_state $location_zip<br><i class='fa fa-fw mr-2'></i><small>$location_country</small>";
|
||||
}
|
||||
$contact_id = intval($row['contact_id']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
|
|
|
|||
|
|
@ -294,31 +294,47 @@ if (isset($_GET['contact_id'])) {
|
|||
<div class="dropdown dropleft">
|
||||
<button type="button" class="btn btn-outline-primary" data-toggle="dropdown"><i class="fas fa-link mr-2"></i>Link</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkAssetModal">
|
||||
<a class="dropdown-item text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_contact_link_asset.php"
|
||||
data-ajax-id="<?php echo $contact_id; ?>">
|
||||
<i class="fa fa-fw fa-desktop mr-2"></i>Asset
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkSoftwareModal">
|
||||
<a class="dropdown-item text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_contact_link_software.php"
|
||||
data-ajax-id="<?php echo $contact_id; ?>">
|
||||
<i class="fa fa-fw fa-cube mr-2"></i>License
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkCredentialModal">
|
||||
<a class="dropdown-item text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_contact_link_credential.php"
|
||||
data-ajax-id="<?php echo $contact_id; ?>">
|
||||
<i class="fa fa-fw fa-key mr-2"></i>Credential
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkServiceModal">
|
||||
<a class="dropdown-item text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_contact_link_service.php"
|
||||
data-ajax-id="<?php echo $contact_id; ?>">
|
||||
<i class="fa fa-fw fa-stream mr-2"></i>Service
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkDocumentModal">
|
||||
<a class="dropdown-item text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_contact_link_document.php"
|
||||
data-ajax-id="<?php echo $contact_id; ?>">
|
||||
<i class="fa fa-fw fa-folder mr-2"></i>Document
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkFileModal">
|
||||
<a class="dropdown-item text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_contact_link_file.php"
|
||||
data-ajax-id="<?php echo $contact_id; ?>">
|
||||
<i class="fa fa-fw fa-paperclip mr-2"></i>File
|
||||
</a>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1192,11 +1208,4 @@ require_once "modals/credential_add_modal.php";
|
|||
require_once "modals/client_document_add_modal.php";
|
||||
require_once "modals/client_file_upload_modal.php";
|
||||
|
||||
require_once "modals/contact_link_asset_modal.php";
|
||||
require_once "modals/contact_link_software_modal.php";
|
||||
require_once "modals/contact_link_credential_modal.php";
|
||||
require_once "modals/contact_link_service_modal.php";
|
||||
require_once "modals/contact_link_document_modal.php";
|
||||
require_once "modals/contact_link_file_modal.php";
|
||||
|
||||
require_once "includes/footer.php";
|
||||
|
|
|
|||
16
contacts.php
16
contacts.php
|
|
@ -110,7 +110,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select onchange="this.form.submit()" class="form-control select2" name="tags[]" data-placeholder="- Select Tags -" multiple>
|
||||
|
||||
<?php
|
||||
|
|
@ -137,7 +137,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
<?php if ($client_url) { ?>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="location" onchange="this.form.submit()">
|
||||
<option value="">- All Locations -</option>
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="client" onchange="this.form.submit()">
|
||||
<option value="" <?php if ($client == "") { echo "selected"; } ?>>- All Clients -</option>
|
||||
|
||||
|
|
@ -374,7 +374,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
$sql_related_assets = mysqli_query($mysqli, "SELECT * FROM assets WHERE asset_contact_id = $contact_id ORDER BY asset_id DESC");
|
||||
$asset_count = mysqli_num_rows($sql_related_assets);
|
||||
if ($asset_count) {
|
||||
$asset_count_display = "<span class='mr-2 badge badge-pill badge-dark p-2' title='$asset_count Assets'><i class='fas fa-fw fa-desktop mr-2'></i>$asset_count</span>";
|
||||
$asset_count_display = "<span class='mr-2 mb-1 badge badge-pill badge-dark p-2' title='$asset_count Assets'><i class='fas fa-fw fa-desktop mr-2'></i>$asset_count</span>";
|
||||
} else {
|
||||
$asset_count_display = '';
|
||||
}
|
||||
|
|
@ -383,7 +383,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
$sql_related_credentials = mysqli_query($mysqli, "SELECT * FROM credentials WHERE credential_contact_id = $contact_id ORDER BY credential_id DESC");
|
||||
$credential_count = mysqli_num_rows($sql_related_credentials);
|
||||
if ($credential_count) {
|
||||
$credential_count_display = "<span class='mr-2 badge badge-pill badge-secondary p-2' title='$credential_count Credentials'><i class='fas fa-fw fa-key mr-2'></i>$credential_count</span>";
|
||||
$credential_count_display = "<span class='mr-2 mb-1 badge badge-pill badge-secondary p-2' title='$credential_count Credentials'><i class='fas fa-fw fa-key mr-2'></i>$credential_count</span>";
|
||||
} else {
|
||||
$credential_count_display = '';
|
||||
}
|
||||
|
|
@ -392,7 +392,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
$sql_related_software = mysqli_query($mysqli, "SELECT * FROM software, software_contacts WHERE software.software_id = software_contacts.software_id AND software_contacts.contact_id = $contact_id");
|
||||
$software_count = mysqli_num_rows($sql_related_software);
|
||||
if ($software_count) {
|
||||
$software_count_display = "<span class='mr-2 badge badge-pill badge-secondary p-2' title='$software_count Licenses'><i class='fas fa-fw fa-cube mr-2'></i>$software_count</span>";
|
||||
$software_count_display = "<span class='mr-2 mb-1 badge badge-pill badge-secondary p-2' title='$software_count Licenses'><i class='fas fa-fw fa-cube mr-2'></i>$software_count</span>";
|
||||
} else {
|
||||
$software_count_display = '';
|
||||
}
|
||||
|
|
@ -401,7 +401,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
$sql_related_tickets = mysqli_query($mysqli, "SELECT * FROM tickets WHERE ticket_contact_id = $contact_id");
|
||||
$ticket_count = mysqli_num_rows($sql_related_tickets);
|
||||
if ($ticket_count) {
|
||||
$ticket_count_display = "<span class='mr-2 badge badge-pill badge-secondary p-2' title='$ticket_count Tickets'><i class='fas fa-fw fa-life-ring mr-2'></i>$ticket_count</span>";
|
||||
$ticket_count_display = "<span class='mr-2 mb-1 badge badge-pill badge-secondary p-2' title='$ticket_count Tickets'><i class='fas fa-fw fa-life-ring mr-2'></i>$ticket_count</span>";
|
||||
} else {
|
||||
$ticket_count_display = '';
|
||||
}
|
||||
|
|
@ -410,7 +410,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
$sql_related_documents = mysqli_query($mysqli, "SELECT * FROM documents, contact_documents WHERE documents.document_id = contact_documents.document_id AND contact_documents.contact_id = $contact_id");
|
||||
$document_count = mysqli_num_rows($sql_related_documents);
|
||||
if ($document_count) {
|
||||
$document_count_display = "<span class='mr-2 badge badge-pill badge-secondary p-2' title='$document_count Documents'><i class='fas fa-fw fa-file-alt mr-2'></i>$document_count</span>";
|
||||
$document_count_display = "<span class='mr-2 mb-1 badge badge-pill badge-secondary p-2' title='$document_count Documents'><i class='fas fa-fw fa-file-alt mr-2'></i>$document_count</span>";
|
||||
} else {
|
||||
$document_count_display = '';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select onchange="this.form.submit()" class="form-control select2" name="tags[]" data-placeholder="- Select Tags -" multiple>
|
||||
|
||||
<?php
|
||||
|
|
@ -151,7 +151,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
<?php if ($client_url) { ?>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="location" onchange="this.form.submit()">
|
||||
<option value="">- All Asset Locations -</option>
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="client" onchange="this.form.submit()">
|
||||
<option value="" <?php if ($client == "") { echo "selected"; } ?>>- All Clients -</option>
|
||||
|
||||
|
|
@ -242,7 +242,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
<div class="table-responsive-sm">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?> text-nowrap">
|
||||
<tr>
|
||||
<td class="pr-0">
|
||||
<div class="form-check">
|
||||
|
|
@ -335,7 +335,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
$credential_tags_display = implode('', $credential_tag_name_display_array);
|
||||
|
||||
if ($credential_contact_id) {
|
||||
$credential_contact_display = "<a href='#' class='mr-2 badge badge-pill badge-dark p-2' title='$contact_name'
|
||||
$credential_contact_display = "<a href='#' class='mr-2 mb-1 badge badge-pill badge-dark p-2' title='$contact_name'
|
||||
data-toggle='ajax-modal'
|
||||
data-modal-size='lg'
|
||||
data-ajax-url='ajax/ajax_contact_details.php'
|
||||
|
|
@ -346,7 +346,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
}
|
||||
|
||||
if ($credential_asset_id) {
|
||||
$credential_asset_display = "<a href='#' class='mr-2 badge badge-pill badge-secondary p-2' title='$asset_name' data-toggle='ajax-modal'
|
||||
$credential_asset_display = "<a href='#' class='mr-2 mb-1 badge badge-pill badge-secondary p-2' title='$asset_name' data-toggle='ajax-modal'
|
||||
data-modal-size='lg'
|
||||
data-ajax-url='ajax/ajax_asset_details.php'
|
||||
data-ajax-id='$credential_asset_id'>
|
||||
|
|
@ -412,11 +412,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
</a>
|
||||
</td>
|
||||
<td><?php echo $credential_username_display; ?></td>
|
||||
<td>
|
||||
<td class="text-nowrap"><?php echo $credential_username_display; ?></td>
|
||||
<td class="text-nowrap">
|
||||
<button class="btn p-0" type="button" data-toggle="popover" data-trigger="focus" data-placement="top" data-content="<?php echo $credential_password; ?>"><i class="fas fa-2x fa-ellipsis-h text-secondary"></i><i class="fas fa-2x fa-ellipsis-h text-secondary"></i></button><button class="btn btn-sm clipboardjs" type="button" data-clipboard-text="<?php echo $credential_password; ?>"><i class="far fa-copy text-secondary"></i></button>
|
||||
</td>
|
||||
<td><?php echo $otp_display; ?></td>
|
||||
<td class="text-nowrap"><?php echo $otp_display; ?></td>
|
||||
<td><?php echo $credential_uri_display; ?></td>
|
||||
<td>
|
||||
<?php echo "$credential_contact_display$credential_asset_display"; ?>
|
||||
|
|
|
|||
|
|
@ -21,10 +21,9 @@
|
|||
}
|
||||
|
||||
.drag-handle {
|
||||
cursor: grab;
|
||||
touch-action: none;
|
||||
user-select: none;
|
||||
cursor: grab !important;
|
||||
}
|
||||
|
||||
.drag-handle:active {
|
||||
cursor: grabbing;
|
||||
cursor: grabbing !important;
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
/*!
|
||||
* AdminLTE 3.2.0 Specific Dropdown Fix
|
||||
* Targets .fix-quote-dropdown only
|
||||
* Prevents alignment bugs in split button dropdowns going too far left
|
||||
* (ChatGPT)
|
||||
*/
|
||||
|
||||
.fix-quote-dropdown .dropdown-menu {
|
||||
left: auto !important;
|
||||
right: 0 !important;
|
||||
top: calc(100% + 0.25rem) !important;
|
||||
transform: none !important;
|
||||
min-width: max-content;
|
||||
z-index: 1050;
|
||||
}
|
||||
|
|
@ -41,7 +41,7 @@ $sql_years_select = mysqli_query($mysqli, "
|
|||
<input type="hidden" name="enable_technical" value="0">
|
||||
|
||||
<label for="year" class="mr-sm-2">Select Year:</label>
|
||||
<select id="year" onchange="this.form.submit()" class="form-control mr-sm-3 col-sm-2" name="year">
|
||||
<select id="year" onchange="this.form.submit()" class="form-control mr-sm-3 col-sm-2 mb-3 mb-sm-0" name="year">
|
||||
<?php while ($row = mysqli_fetch_array($sql_years_select)) {
|
||||
$year_select = $row['all_years'];
|
||||
if (empty($year_select)) {
|
||||
|
|
@ -55,7 +55,7 @@ $sql_years_select = mysqli_query($mysqli, "
|
|||
</select>
|
||||
|
||||
<?php if ($session_user_role == 1 || ($session_user_role == 3 && $config_module_enable_accounting == 1)) { ?>
|
||||
<div class="custom-control custom-switch mr-sm-3">
|
||||
<div class="custom-control custom-switch mr-3">
|
||||
<input type="checkbox" onchange="this.form.submit()" class="custom-control-input" id="customSwitch1" name="enable_financial" value="1" <?php if ($user_config_dashboard_financial_enable == 1) { echo "checked"; } ?>>
|
||||
<label class="custom-control-label" for="customSwitch1">Financial</label>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3457,10 +3457,19 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
|
|||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.1.3'");
|
||||
}
|
||||
|
||||
// if (CURRENT_DATABASE_VERSION == '2.1.3') {
|
||||
// // Insert queries here required to update to DB version 2.1.4
|
||||
if (CURRENT_DATABASE_VERSION == '2.1.3') {
|
||||
mysqli_query($mysqli, "ALTER TABLE `client_stripe` ADD `stripe_pm_details` VARCHAR(200) DEFAULT NULL AFTER `stripe_pm`");
|
||||
mysqli_query($mysqli, "ALTER TABLE `client_stripe` ADD `stripe_pm_created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `stripe_pm_details`");
|
||||
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.1.4'");
|
||||
}
|
||||
|
||||
|
||||
|
||||
// if (CURRENT_DATABASE_VERSION == '2.1.4') {
|
||||
// // Insert queries here required to update to DB version 2.1.5
|
||||
// // Then, update the database to the next sequential version
|
||||
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.1.4'");
|
||||
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.1.5'");
|
||||
// }
|
||||
|
||||
} else {
|
||||
|
|
|
|||
4
db.sql
4
db.sql
|
|
@ -482,6 +482,8 @@ CREATE TABLE `client_stripe` (
|
|||
`client_id` int(11) NOT NULL,
|
||||
`stripe_id` varchar(255) NOT NULL,
|
||||
`stripe_pm` varchar(255) DEFAULT NULL,
|
||||
`stripe_pm_details` varchar(200) DEFAULT NULL,
|
||||
`stripe_pm_created_at` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
PRIMARY KEY (`client_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
|
@ -2498,4 +2500,4 @@ CREATE TABLE `vendors` (
|
|||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2025-03-31 12:05:41
|
||||
-- Dump completed on 2025-05-24 13:23:21
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<div class="col-md-2"></div>
|
||||
<?php } else { ?>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="client" onchange="this.form.submit()">
|
||||
<option value="" <?php if ($client == "") { echo "selected"; } ?>>- All Clients -</option>
|
||||
|
||||
|
|
@ -162,7 +162,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<?php } ?>
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?> text-nowrap">
|
||||
<tr>
|
||||
<td class="pr-0">
|
||||
<div class="form-check">
|
||||
|
|
|
|||
19
expenses.php
19
expenses.php
|
|
@ -228,19 +228,18 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
Date <?php if ($sort == 'expense_date') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=vendor_name&order=<?php echo $disp; ?>">
|
||||
Vendor <?php if ($sort == 'vendor_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=category_name&order=<?php echo $disp; ?>">
|
||||
Category <?php if ($sort == 'category_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
/
|
||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=expense_description&order=<?php echo $disp; ?>">
|
||||
Description <?php if ($sort == 'expense_description') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=expense_description&order=<?php echo $disp; ?>">
|
||||
Description <?php if ($sort == 'expense_description') { echo $order_icon; } ?>
|
||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=vendor_name&order=<?php echo $disp; ?>">
|
||||
Vendor <?php if ($sort == 'vendor_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th class="text-right">
|
||||
|
|
@ -313,9 +312,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<?php echo $expense_date; ?>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $category_name; ?>
|
||||
<div class="text-secondary"><small><?php echo truncate($expense_description, 60); ?></small></div>
|
||||
</td>
|
||||
<td><?php echo $vendor_name; ?></td>
|
||||
<td><?php echo $category_name; ?></td>
|
||||
<td><?php echo truncate($expense_description, 50); ?></td>
|
||||
<td class="text-bold text-right"><?php echo numfmt_format_currency($currency_format, $expense_amount, $expense_currency_code); ?></td>
|
||||
<td><?php echo $account_name; ?></td>
|
||||
<td><?php echo $client_name_display; ?></td>
|
||||
|
|
|
|||
|
|
@ -705,7 +705,17 @@ function sendSingleEmail($config_smtp_host, $config_smtp_username, $config_smtp_
|
|||
$mail->SMTPAuth = $smtp_auth; // Enable SMTP authentication
|
||||
$mail->Username = $config_smtp_username; // SMTP username
|
||||
$mail->Password = $config_smtp_password; // SMTP password
|
||||
if ($config_smtp_encryption == 'None') {
|
||||
$mail->SMTPOptions = array(
|
||||
'ssl' => array(
|
||||
'verify_peer' => false,
|
||||
'verify_peer_name' => false,
|
||||
));
|
||||
$mail->SMTPSecure = false;
|
||||
$mail->SMTPAutoTLS = false;
|
||||
} else {
|
||||
$mail->SMTPSecure = $config_smtp_encryption; // Enable TLS encryption, `ssl` also accepted
|
||||
}
|
||||
$mail->Port = $config_smtp_port; // TCP port to connect to
|
||||
|
||||
//Recipients
|
||||
|
|
|
|||
|
|
@ -97,9 +97,7 @@ if (isset($_GET['stripe_create_pi'])) {
|
|||
'itflow_invoice_number' => $invoice_prefix . $invoice_number,
|
||||
'itflow_invoice_id' => $invoice_id,
|
||||
],
|
||||
'automatic_payment_methods' => [
|
||||
'enabled' => true,
|
||||
],
|
||||
'payment_method_types' => ['card'],
|
||||
]);
|
||||
|
||||
$output = [
|
||||
|
|
|
|||
|
|
@ -97,8 +97,11 @@ if (isset($_GET['invoice_id'], $_GET['url_key']) && !isset($_GET['payment_intent
|
|||
|
||||
<!-- Show invoice details -->
|
||||
<div class="col-sm">
|
||||
<h3>Payment for Invoice: <?php echo $invoice_prefix . $invoice_number ?></h3>
|
||||
<br>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Payment for Invoice: <strong><?php echo "$invoice_prefix$invoice_number"; ?></strong></h3>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
|
|
@ -126,32 +129,41 @@ if (isset($_GET['invoice_id'], $_GET['url_key']) && !isset($_GET['payment_intent
|
|||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<?php if ($invoice_discount > 0) { ?>
|
||||
<tr class="text-right">
|
||||
<td colspan="2">Discount</td>
|
||||
<td>
|
||||
<?php echo numfmt_format_currency($currency_format, $invoice_discount, $invoice_currency_code); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if (intval($amount_paid) > 0) { ?>
|
||||
<tr class="text-right">
|
||||
<td colspan="2">Paid</td>
|
||||
<td>
|
||||
<?php echo numfmt_format_currency($currency_format, $amount_paid, $invoice_currency_code); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<br>
|
||||
<i><?php if ($invoice_discount > 0){ echo "Discount: " . numfmt_format_currency($currency_format, $invoice_discount, $invoice_currency_code); } ?>
|
||||
</i>
|
||||
<br>
|
||||
<i><?php if (intval($amount_paid) > 0) { ?> Already paid: <?php echo numfmt_format_currency($currency_format, $amount_paid, $invoice_currency_code); } ?></i>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End invoice details-->
|
||||
|
||||
<!-- Show Stripe payment form -->
|
||||
<div class="col-sm offset-sm-1">
|
||||
<h1>Payment Total:</h1>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Payment Total: <strong><?php echo numfmt_format_currency($currency_format, $balance_to_pay, $invoice_currency_code); ?></strong></h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form id="payment-form">
|
||||
<h1><?php echo numfmt_format_currency($currency_format, $balance_to_pay, $invoice_currency_code); ?></h1>
|
||||
<input type="hidden" id="stripe_publishable_key" value="<?php echo $config_stripe_publishable ?>">
|
||||
<input type="hidden" id="invoice_id" value="<?php echo $invoice_id ?>">
|
||||
<input type="hidden" id="url_key" value="<?php echo $invoice_url_key ?>">
|
||||
<br>
|
||||
<div id="link-authentication-element">
|
||||
<!--Stripe.js injects the Link Authentication Element-->
|
||||
</div>
|
||||
<div id="payment-element">
|
||||
<!--Stripe.js injects the Payment Element-->
|
||||
</div>
|
||||
|
|
@ -163,6 +175,8 @@ if (isset($_GET['invoice_id'], $_GET['url_key']) && !isset($_GET['payment_intent
|
|||
<div id="payment-message" class="hidden"></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Stripe payment form -->
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ $location_address = nullable_htmlentities($row['location_address']);
|
|||
$location_city = nullable_htmlentities($row['location_city']);
|
||||
$location_state = nullable_htmlentities($row['location_state']);
|
||||
$location_zip = nullable_htmlentities($row['location_zip']);
|
||||
$location_country = nullable_htmlentities($row['location_country']);
|
||||
$contact_email = nullable_htmlentities($row['contact_email']);
|
||||
$contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']);
|
||||
$contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code));
|
||||
|
|
@ -71,6 +72,7 @@ $company_address = nullable_htmlentities($row['company_address']);
|
|||
$company_city = nullable_htmlentities($row['company_city']);
|
||||
$company_state = nullable_htmlentities($row['company_state']);
|
||||
$company_zip = nullable_htmlentities($row['company_zip']);
|
||||
$company_country = nullable_htmlentities($row['company_country']);
|
||||
$company_phone_country_code = nullable_htmlentities($row['company_phone_country_code']);
|
||||
$company_phone = nullable_htmlentities(formatPhoneNumber($row['company_phone'], $company_phone_country_code));
|
||||
$company_email = nullable_htmlentities($row['company_email']);
|
||||
|
|
@ -198,6 +200,7 @@ if ($balance > 0) {
|
|||
<li><h4><strong><?php echo $company_name; ?></strong></h4></li>
|
||||
<li><?php echo $company_address; ?></li>
|
||||
<li><?php echo "$company_city $company_state $company_zip"; ?></li>
|
||||
<li><small><?php echo $company_country; ?></small></li>
|
||||
<li><?php echo $company_phone; ?></li>
|
||||
<li><?php echo $company_email; ?></li>
|
||||
</ul>
|
||||
|
|
@ -209,6 +212,7 @@ if ($balance > 0) {
|
|||
<li><h4><strong><?php echo $client_name; ?></strong></h4></li>
|
||||
<li><?php echo $location_address; ?></li>
|
||||
<li><?php echo "$location_city $location_state $location_zip"; ?></li>
|
||||
<li><small><?php echo $location_country; ?></small></li>
|
||||
<li><?php echo "$contact_phone $contact_extension"; ?></li>
|
||||
<li><?php echo $contact_mobile; ?></li>
|
||||
<li><?php echo $contact_email; ?></li>
|
||||
|
|
@ -407,11 +411,11 @@ if ($balance > 0) {
|
|||
{
|
||||
columns: [
|
||||
{
|
||||
text: <?php echo json_encode(html_entity_decode("$company_address \n $company_city $company_state $company_zip \n $company_phone \n $company_website")) ?>,
|
||||
text: <?php echo json_encode(html_entity_decode("$company_address \n $company_city $company_state $company_zip \n $company_country \n $company_phone \n $company_website")) ?>,
|
||||
style: 'invoiceBillingAddress'
|
||||
},
|
||||
{
|
||||
text: <?php echo json_encode(html_entity_decode("$location_address \n $location_city $location_state $location_zip \n $contact_email \n $contact_phone")) ?>,
|
||||
text: <?php echo json_encode(html_entity_decode("$location_address \n $location_city $location_state $location_zip \n $location_country \n $contact_email \n $contact_phone")) ?>,
|
||||
style: 'invoiceBillingAddressClient'
|
||||
},
|
||||
]
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ $location_address = nullable_htmlentities($row['location_address']);
|
|||
$location_city = nullable_htmlentities($row['location_city']);
|
||||
$location_state = nullable_htmlentities($row['location_state']);
|
||||
$location_zip = nullable_htmlentities($row['location_zip']);
|
||||
$location_country = nullable_htmlentities($row['location_country']);
|
||||
$contact_email = nullable_htmlentities($row['contact_email']);
|
||||
$contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']);
|
||||
$contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code));
|
||||
|
|
@ -71,6 +72,7 @@ $company_address = nullable_htmlentities($row['company_address']);
|
|||
$company_city = nullable_htmlentities($row['company_city']);
|
||||
$company_state = nullable_htmlentities($row['company_state']);
|
||||
$company_zip = nullable_htmlentities($row['company_zip']);
|
||||
$company_country = nullable_htmlentities($row['company_country']);
|
||||
$company_phone_country_code = nullable_htmlentities($row['company_phone_country_code']);
|
||||
$company_phone = nullable_htmlentities(formatPhoneNumber($row['company_phone'], $company_phone_country_code));
|
||||
$company_email = nullable_htmlentities($row['company_email']);
|
||||
|
|
@ -136,6 +138,7 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
|
|||
<li><h4><strong><?php echo $company_name; ?></strong></h4></li>
|
||||
<li><?php echo $company_address; ?></li>
|
||||
<li><?php echo "$company_city $company_state $company_zip"; ?></li>
|
||||
<li><small><?php echo $company_country; ?></small></li>
|
||||
<li><?php echo $company_phone; ?></li>
|
||||
<li><?php echo $company_email; ?></li>
|
||||
</ul>
|
||||
|
|
@ -148,6 +151,7 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
|
|||
<li><h4><strong><?php echo $client_name; ?></strong></h4></li>
|
||||
<li><?php echo $location_address; ?></li>
|
||||
<li><?php echo "$location_city $location_state $location_zip"; ?></li>
|
||||
<li><small><?php echo $location_country; ?></small></li>
|
||||
<li><?php echo "$contact_phone $contact_extension"; ?></li>
|
||||
<li><?php echo $contact_mobile; ?></li>
|
||||
<li><?php echo $contact_email; ?></li>
|
||||
|
|
@ -345,11 +349,11 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
|
|||
{
|
||||
columns: [
|
||||
{
|
||||
text: <?php echo json_encode(html_entity_decode("$company_address \n $company_city $company_state $company_zip \n $company_phone \n $company_website")) ?>,
|
||||
text: <?php echo json_encode(html_entity_decode("$company_address \n $company_city $company_state $company_zip \n $company_country \n $company_phone \n $company_website")) ?>,
|
||||
style: 'invoiceBillingAddress'
|
||||
},
|
||||
{
|
||||
text: <?php echo json_encode(html_entity_decode("$location_address \n $location_city $location_state $location_zip \n $contact_email \n $contact_phone")) ?>,
|
||||
text: <?php echo json_encode(html_entity_decode("$location_address \n $location_city $location_state $location_zip \n $location_country \n $contact_email \n $contact_phone")) ?>,
|
||||
style: 'invoiceBillingAddressClient'
|
||||
},
|
||||
]
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@
|
|||
</li>
|
||||
|
||||
<!-- SETTINGS Section -->
|
||||
<li class="nav-item has-treeview mt-2 <?php echo (in_array(basename($_SERVER['PHP_SELF']), ['admin_settings_company.php', 'admin_settings_localization.php', 'admin_settings_theme.php', 'admin_settings_security.php', 'admin_settings_mail.php', 'admin_settings_notification.php', 'admin_settings_default.php', 'admin_settings_invoice.php', 'admin_settings_quote.php', 'admin_settings_online_payment.php', 'admin_settings_online_payment_clients.php', 'admin_settings_project.php', 'admin_settings_ticket.php', 'admin_settings_ai.php', 'admin_settings_integration.php', 'admin_settings_telemetry.php', 'admin_settings_module.php']) ? 'menu-open' : ''); ?>">
|
||||
<li class="nav-item has-treeview mt-2 <?php echo (in_array(basename($_SERVER['PHP_SELF']), ['admin_settings_company.php', 'admin_settings_localization.php', 'admin_settings_theme.php', 'admin_settings_security.php', 'admin_settings_mail.php', 'admin_settings_notification.php', 'admin_settings_default.php', 'admin_settings_invoice.php', 'admin_settings_quote.php', 'admin_settings_online_payment.php', 'admin_settings_online_payment_clients.php', 'admin_settings_project.php', 'admin_settings_ticket.php', 'admin_settings_ai.php', 'admin_identity_provider.php', 'admin_settings_telemetry.php', 'admin_settings_module.php']) ? 'menu-open' : ''); ?>">
|
||||
<a href="#" class="nav-link">
|
||||
<p>
|
||||
SETTINGS
|
||||
|
|
@ -246,9 +246,9 @@
|
|||
<!-- Currently the only integration is the client portal SSO -->
|
||||
<?php if ($config_client_portal_enable) { ?>
|
||||
<li class="nav-item">
|
||||
<a href="admin_settings_integration.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_settings_integration.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-plug"></i>
|
||||
<p>Integrations</p>
|
||||
<a href="admin_identity_provider.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_identity_provider.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-fingerprint"></i>
|
||||
<p>Identity Provider</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
|
|
|||
|
|
@ -5,4 +5,4 @@
|
|||
* Update this file each time we merge develop into master. Format is YY.MM (add a .v if there is more than one release a month.
|
||||
*/
|
||||
|
||||
DEFINE("APP_VERSION", "25.03.6");
|
||||
DEFINE("APP_VERSION", "25.05");
|
||||
|
|
|
|||
|
|
@ -153,6 +153,7 @@
|
|||
</a>
|
||||
</li>
|
||||
|
||||
<?php if (lookupUserPermission("module_credential") >= 1) { ?>
|
||||
<li class="nav-item">
|
||||
<a href="credentials.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "credentials.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-key"></i>
|
||||
|
|
@ -165,6 +166,7 @@
|
|||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="networks.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "networks.php") { echo "active"; } ?>">
|
||||
|
|
|
|||
|
|
@ -5,4 +5,4 @@
|
|||
* It is used in conjunction with database_updates.php
|
||||
*/
|
||||
|
||||
DEFINE("LATEST_DATABASE_VERSION", "2.1.3");
|
||||
DEFINE("LATEST_DATABASE_VERSION", "2.1.4");
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ if ($total_found_rows > 5) {
|
|||
<option <?php if ($user_config_records_per_page == 20) { echo "selected"; } ?> >20</option>
|
||||
<option <?php if ($user_config_records_per_page == 50) { echo "selected"; } ?> >50</option>
|
||||
<option <?php if ($user_config_records_per_page == 100) { echo "selected"; } ?> >100</option>
|
||||
<option <?php if ($user_config_records_per_page == 500) { echo "selected"; } ?> >500</option>
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -121,6 +121,8 @@ $config_log_retention = intval($row['config_log_retention']);
|
|||
// Locale
|
||||
$config_currency_format = "US_en";
|
||||
$config_timezone = $row['config_timezone'];
|
||||
$config_date_format = "Y-m-d";
|
||||
$config_time_format = "H:i";
|
||||
|
||||
// Theme
|
||||
$config_theme = $row['config_theme'];
|
||||
|
|
|
|||
|
|
@ -59,7 +59,12 @@
|
|||
<div>
|
||||
<a href="//maps.<?php echo $session_map_source; ?>.com/?q=<?php echo "$location_address $location_zip"; ?>" target="_blank">
|
||||
<i class="fa fa-fw fa-map-marker-alt text-secondary ml-1 mr-2"></i><?php echo $location_address; ?>
|
||||
<div><i class="fa fa-fw ml-1 mr-2"></i><?php echo "$location_city $location_state $location_zip"; ?></div>
|
||||
<div>
|
||||
<i class="fa fa-fw ml-1 mr-2"></i><?php echo "$location_city $location_state $location_zip"; ?>
|
||||
</div>
|
||||
<div>
|
||||
<i class="fa fa-fw ml-1 mr-2"></i><small><?php echo $location_country; ?></small>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<?php }
|
||||
|
|
|
|||
|
|
@ -28,8 +28,6 @@
|
|||
<!-- Right navbar links -->
|
||||
<ul class="navbar-nav ml-auto">
|
||||
|
||||
<?php if(CURRENT_DATABASE_VERSION > '1.4.5' ) { // Check DB Version REMOVE on Decemeber 1st 2024 -Johnny ?>
|
||||
|
||||
<!--Custom Nav Link -->
|
||||
<?php
|
||||
$sql_custom_links = mysqli_query($mysqli, "SELECT * FROM custom_links WHERE custom_link_location = 2 AND custom_link_archived_at IS NULL
|
||||
|
|
@ -58,8 +56,6 @@
|
|||
<?php } ?>
|
||||
<!-- End Custom Nav Links -->
|
||||
|
||||
<?php } // End DB Check ?>
|
||||
|
||||
<!-- New Notifications Dropdown -->
|
||||
<?php
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('notification_id') AS num FROM notifications WHERE notification_user_id = $session_user_id AND notification_dismissed_at IS NULL"));
|
||||
|
|
|
|||
26
invoice.php
26
invoice.php
|
|
@ -53,6 +53,7 @@ if (isset($_GET['invoice_id'])) {
|
|||
$location_city = nullable_htmlentities($row['location_city']);
|
||||
$location_state = nullable_htmlentities($row['location_state']);
|
||||
$location_zip = nullable_htmlentities($row['location_zip']);
|
||||
$location_country = nullable_htmlentities($row['location_country']);
|
||||
$contact_email = nullable_htmlentities($row['contact_email']);
|
||||
$contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']);
|
||||
$contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code));
|
||||
|
|
@ -192,9 +193,11 @@ if (isset($_GET['invoice_id'])) {
|
|||
|
||||
<div class="card-header d-print-none">
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-8">
|
||||
<?php if (lookupUserPermission("module_sales") >= 2) { ?>
|
||||
<?php if ($invoice_status == 'Draft') { ?>
|
||||
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-fw fa-paper-plane mr-2"></i>Send
|
||||
|
|
@ -210,7 +213,6 @@ if (isset($_GET['invoice_id'])) {
|
|||
<i class="fas fa-fw fa-check mr-2"></i>Mark Sent
|
||||
</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($invoice_status !== 'Paid' && $invoice_status !== 'Cancelled' && $invoice_status !== 'Draft' && $invoice_amount != 0) { ?>
|
||||
<a class="btn btn-success" href="#" data-toggle="modal" data-target="#addPaymentModal">
|
||||
|
|
@ -228,7 +230,7 @@ if (isset($_GET['invoice_id'])) {
|
|||
Mark Non-Billable
|
||||
</a>
|
||||
<?php } ?>
|
||||
|
||||
<?php } // End lookup Perm ?>
|
||||
</div>
|
||||
|
||||
<div class="col-4">
|
||||
|
|
@ -282,6 +284,7 @@ if (isset($_GET['invoice_id'])) {
|
|||
</div>
|
||||
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
@ -307,6 +310,7 @@ if (isset($_GET['invoice_id'])) {
|
|||
<li><h4><strong><?php echo $company_name; ?></strong></h4></li>
|
||||
<li><?php echo $company_address; ?></li>
|
||||
<li><?php echo "$company_city $company_state $company_zip"; ?></li>
|
||||
<li><small><?php echo $company_country; ?></small></li>
|
||||
<li><?php echo $company_phone; ?></li>
|
||||
<li><?php echo $company_email; ?></li>
|
||||
<li><?php echo $company_website; ?></li>
|
||||
|
|
@ -317,6 +321,7 @@ if (isset($_GET['invoice_id'])) {
|
|||
<li><h4><strong><?php echo $client_name; ?></strong></h4></li>
|
||||
<li><?php echo $location_address; ?></li>
|
||||
<li><?php echo "$location_city $location_state $location_zip"; ?></li>
|
||||
<li><small><?php echo $location_country; ?></small></li>
|
||||
<li><?php echo "$contact_phone $contact_extension"; ?></li>
|
||||
<li><?php echo $contact_mobile; ?></li>
|
||||
<li><?php echo $contact_email; ?></li>
|
||||
|
|
@ -380,13 +385,12 @@ if (isset($_GET['invoice_id'])) {
|
|||
<tr data-item-id="<?php echo $item_id; ?>">
|
||||
<td class="d-print-none">
|
||||
<?php if ($invoice_status !== "Paid" && $invoice_status !== "Cancelled") { ?>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<button type="button" class="btn btn-sm btn-light drag-handle">
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-sm btn-link drag-handle">
|
||||
<i class="fas fa-bars text-muted"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col">
|
||||
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-sm btn-light" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
|
|
@ -404,7 +408,7 @@ if (isset($_GET['invoice_id'])) {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td><?php echo $item_name; ?></td>
|
||||
|
|
@ -417,7 +421,7 @@ if (isset($_GET['invoice_id'])) {
|
|||
<?php
|
||||
}
|
||||
?>
|
||||
<tr class="d-print-none" <?php if ($invoice_status == "Paid" || $invoice_status == "Cancelled") { echo "hidden"; } ?>>
|
||||
<tr class="d-print-none" <?php if ($invoice_status == "Paid" || $invoice_status == "Cancelled" || lookupUserPermission("module_sales") <= 1) { echo "hidden"; } ?>>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="invoice_id" value="<?php echo $invoice_id; ?>">
|
||||
<input type="hidden" name="item_order" value="<?php echo mysqli_num_rows($sql_invoice_items) + 1; ?>">
|
||||
|
|
@ -779,11 +783,11 @@ require_once "includes/footer.php";
|
|||
{
|
||||
columns: [
|
||||
{
|
||||
text: <?php echo json_encode(html_entity_decode("$company_address \n $company_city $company_state $company_zip \n $company_phone \n $company_website")) ?>,
|
||||
text: <?php echo json_encode(html_entity_decode("$company_address \n $company_city $company_state $company_zip \n $company_country \n $company_phone \n $company_website")) ?>,
|
||||
style: 'invoiceBillingAddress'
|
||||
},
|
||||
{
|
||||
text: <?php echo json_encode(html_entity_decode("$location_address \n $location_city $location_state $location_zip \n $contact_email \n $contact_phone")) ?>,
|
||||
text: <?php echo json_encode(html_entity_decode("$location_address \n $location_city $location_state $location_zip \n $location_country \n $contact_email \n $contact_phone")) ?>,
|
||||
style: 'invoiceBillingAddressClient'
|
||||
},
|
||||
]
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<?php } ?>
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) {echo stripslashes(nullable_htmlentities($q));} ?>" placeholder="Search Invoices">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-secondary" type="button" data-toggle="collapse" data-target="#advancedFilter"><i class="fas fa-filter"></i></button>
|
||||
|
|
@ -228,7 +228,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<hr>
|
||||
<div class="table-responsive-sm">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?> text-nowrap">
|
||||
<tr>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=invoice_number&order=<?php echo $disp ?>">
|
||||
|
|
|
|||
|
|
@ -23,9 +23,6 @@ async function initialize() {
|
|||
|
||||
elements = stripe.elements({ clientSecret });
|
||||
|
||||
const linkAuthenticationElement = elements.create("linkAuthentication");
|
||||
linkAuthenticationElement.mount("#link-authentication-element");
|
||||
|
||||
const paymentElementOptions = {
|
||||
layout: "tabs",
|
||||
};
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ $sql = mysqli_query(
|
|||
LEFT JOIN tags ON tags.tag_id = location_tags.tag_id
|
||||
WHERE location_$archive_query
|
||||
$tag_query
|
||||
AND (location_name LIKE '%$q%' OR location_description LIKE '%$q%' OR location_address LIKE '%$q%' OR location_phone LIKE '%$phone_query%' OR tag_name LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||
AND (location_name LIKE '%$q%' OR location_description LIKE '%$q%' OR location_address LIKE '%$q%' OR location_city LIKE '%$q%' OR location_state LIKE '%$q%' OR location_zip LIKE '%$q%' OR location_country LIKE '%$q%' OR location_phone LIKE '%$phone_query%' OR tag_name LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||
$access_permission_query
|
||||
$client_query
|
||||
GROUP BY location_id
|
||||
|
|
@ -99,7 +99,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select onchange="this.form.submit()" class="form-control select2" name="tags[]" data-placeholder="- Select Tags -" multiple>
|
||||
<?php
|
||||
$sql_tags_filter = mysqli_query($mysqli, "
|
||||
|
|
@ -126,7 +126,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<div class="col-md-2"></div>
|
||||
<?php } else { ?>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="client" onchange="this.form.submit()">
|
||||
<option value="" <?php if ($client == "") { echo "selected"; } ?>>- All Clients -</option>
|
||||
|
||||
|
|
@ -333,7 +333,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
</a>
|
||||
</td>
|
||||
<td><a href="//maps.<?php echo $session_map_source; ?>.com?q=<?php echo "$location_address $location_zip"; ?>" target="_blank"><?php echo $location_address; ?><br><?php echo "$location_city $location_state $location_zip"; ?></a></td>
|
||||
<td><a href="//maps.<?php echo $session_map_source; ?>.com?q=<?php echo "$location_address $location_zip"; ?>" target="_blank"><?php echo $location_address; ?><br><?php echo "$location_city $location_state $location_zip<br><small>$location_country</small>"; ?></a></td>
|
||||
<td>
|
||||
<?php echo $location_phone_display; ?>
|
||||
<?php echo $location_fax_display; ?>
|
||||
|
|
|
|||
|
|
@ -1,51 +0,0 @@
|
|||
<div class="modal" id="linkCredentialModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-key mr-2"></i>Link Credential to <strong><?php echo $asset_name; ?></strong></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="asset_id" value="<?php echo intval($_GET['asset_id']); ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="credential_id">
|
||||
<option value="">- Select a Credential -</option>
|
||||
<?php
|
||||
|
||||
$sql_credentials_select = mysqli_query($mysqli, "SELECT credential_id, credential_name FROM credentials
|
||||
WHERE credential_client_id = $client_id
|
||||
AND credential_asset_id != $contact_id
|
||||
AND credential_asset_id = 0
|
||||
AND credential_archived_at IS NULL
|
||||
ORDER BY credential_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql_credentials_select)) {
|
||||
$credential_id = intval($row['credential_id']);
|
||||
$credential_name = nullable_htmlentities($row['credential_name']);
|
||||
|
||||
?>
|
||||
<option value="<?php echo $credential_id ?>"><?php echo $credential_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_asset_to_credential" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</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>
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
<div class="modal" id="linkDocumentModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-folder mr-2"></i>Link Document to <strong><?php echo $asset_name; ?></strong></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="asset_id" value="<?php echo intval($_GET['asset_id']); ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-folder"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="document_id">
|
||||
<option value="">- Select a Document -</option>
|
||||
<?php
|
||||
// Check if there are any associated documents
|
||||
if ($linked_documents) {
|
||||
$excluded_document_ids = implode(",", $linked_documents);
|
||||
$exclude_condition = "AND document_id NOT IN ($excluded_document_ids)";
|
||||
} else {
|
||||
$exclude_condition = ""; // No condition if there are no displayed documents
|
||||
}
|
||||
|
||||
$sql_documents_select = mysqli_query($mysqli, "SELECT * FROM documents
|
||||
WHERE document_client_id = $client_id
|
||||
AND document_archived_at IS NULL
|
||||
$exclude_condition
|
||||
ORDER BY document_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql_documents_select)) {
|
||||
$document_id = intval($row['document_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
|
||||
?>
|
||||
<option value="<?php echo $document_id ?>"><?php echo $document_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_asset_to_document" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</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>
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
<div class="modal" id="linkFileModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-paperclip mr-2"></i>Link File to <strong><?php echo $asset_name; ?></strong></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="asset_id" value="<?php echo intval($_GET['asset_id']); ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-paperclip"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="file_id">
|
||||
<option value="">- Select a File -</option>
|
||||
<?php
|
||||
// Check if there are any associated files
|
||||
if (!empty($linked_files)) {
|
||||
$excluded_file_ids = implode(",", $linked_files);
|
||||
$exclude_condition = "AND file_id NOT IN ($excluded_file_ids)";
|
||||
} else {
|
||||
$exclude_condition = ""; // No condition if there are no displayed vendors
|
||||
}
|
||||
|
||||
$sql_files_select = mysqli_query($mysqli, "SELECT * FROM files
|
||||
LEFT JOIN folders ON folder_id = file_folder_id
|
||||
WHERE file_client_id = $client_id
|
||||
$exclude_condition
|
||||
ORDER BY folder_name ASC, file_name ASC"
|
||||
);
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_files_select)) {
|
||||
$file_id = intval($row['file_id']);
|
||||
$file_name = nullable_htmlentities($row['file_name']);
|
||||
$folder_name = nullable_htmlentities($row['folder_name']);
|
||||
|
||||
?>
|
||||
<option value="<?php echo $file_id ?>"><?php echo "$folder_name/$file_name"; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_asset_to_file" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</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>
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
<div class="modal" id="linkServiceModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-stream mr-2"></i>Link Service to <strong><?php echo $asset_name; ?></strong></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="asset_id" value="<?php echo intval($_GET['asset_id']); ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-stream"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="service_id">
|
||||
<option value="">- Select a Service -</option>
|
||||
<?php
|
||||
// Check if there are any associated services
|
||||
if (!empty($linked_services)) {
|
||||
$excluded_service_ids = implode(",", $linked_services);
|
||||
$exclude_condition = "AND service_id NOT IN ($excluded_service_ids)";
|
||||
} else {
|
||||
$exclude_condition = ""; // No condition if there are no displayed services
|
||||
}
|
||||
|
||||
$sql_services_select = mysqli_query($mysqli, "SELECT * FROM services
|
||||
WHERE service_client_id = $client_id
|
||||
$exclude_condition
|
||||
ORDER BY service_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql_services_select)) {
|
||||
$service_id = intval($row['service_id']);
|
||||
$service_name = nullable_htmlentities($row['service_name']);
|
||||
|
||||
?>
|
||||
<option value="<?php echo $service_id ?>"><?php echo $service_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_service_to_asset" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</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>
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
<div class="modal" id="linkSoftwareModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-cube mr-2"></i>License Software to <strong><?php echo $asset_name; ?></strong></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="asset_id" value="<?php echo intval($_GET['asset_id']); ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<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="software_id">
|
||||
<option value="">- Select a Device Software License -</option>
|
||||
<?php
|
||||
// Check if there are any associated sofctware
|
||||
if (!empty($linked_software)) {
|
||||
$excluded_software_ids = implode(",", $linked_software);
|
||||
$exclude_condition = "AND software_id NOT IN ($excluded_software_ids)";
|
||||
} else {
|
||||
$exclude_condition = ""; // No condition if there are no displayed software
|
||||
}
|
||||
|
||||
$sql_software_select = mysqli_query($mysqli, "SELECT * FROM software
|
||||
WHERE software_client_id = $client_id
|
||||
AND software_archived_at IS NULL
|
||||
AND software_license_type = 'Device'
|
||||
$exclude_condition
|
||||
ORDER BY software_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql_software_select)) {
|
||||
$software_id = intval($row['software_id']);
|
||||
$software_name = nullable_htmlentities($row['software_name']);
|
||||
|
||||
?>
|
||||
<option value="<?php echo $software_id ?>"><?php echo $software_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_software_to_asset" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</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>
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<input type="file" class="form-control-file" name="file[]" multiple id="fileInput" accept=".jpg, .jpeg, .gif, .png, .webp, .pdf, .txt, .md, .doc, .docx, .odt, .csv, .xls, .xlsx, .ods, .pptx, .odp, .zip, .tar, .gz, .xml, .msg, .json, .wav, .mp3, .ogg, .mov, .mp4, .av1, .ovpn, .cfg, .ps1, .vsdx, .drawio, .pfx, .unf, .key">
|
||||
<input type="file" class="form-control-file" name="file[]" multiple id="fileInput" accept=".jpg, .jpeg, .gif, .png, .webp, .pdf, .txt, .md, .doc, .docx, .odt, .csv, .xls, .xlsx, .ods, .pptx, .odp, .zip, .tar, .gz, .xml, .msg, .json, .wav, .mp3, .ogg, .mov, .mp4, .av1, .ovpn, .cfg, .ps1, .vsdx, .drawio, .pfx, .unf, .key, .stk, .bat">
|
||||
</div>
|
||||
<small class="text-secondary">Up to 20 files can be uploaded at once by holding down CTRL and selecting files</small>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,51 +0,0 @@
|
|||
<div class="modal" id="linkAssetModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-desktop mr-2"></i>Link Asset to <strong><?php echo $contact_name; ?></strong></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="contact_id" value="<?php echo intval($_GET['contact_id']); ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<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">
|
||||
<option value="">- Select an Asset -</option>
|
||||
<?php
|
||||
|
||||
$sql_assets_select = mysqli_query($mysqli, "SELECT asset_id, asset_name FROM assets
|
||||
WHERE asset_client_id = $client_id
|
||||
AND asset_contact_id != $contact_id
|
||||
AND asset_contact_id = 0
|
||||
AND asset_archived_at IS NULL
|
||||
ORDER BY asset_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql_assets_select)) {
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
|
||||
?>
|
||||
<option value="<?php echo $asset_id ?>"><?php echo $asset_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_contact_to_asset" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</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>
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
<div class="modal" id="linkCredentialModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-key mr-2"></i>Link Credential to <strong><?php echo $contact_name; ?></strong></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="contact_id" value="<?php echo intval($_GET['contact_id']); ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<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="credential_id">
|
||||
<option value="">- Select a Credential -</option>
|
||||
<?php
|
||||
|
||||
$sql_credentials_select = mysqli_query($mysqli, "SELECT credential_id, credential_name FROM credentials
|
||||
WHERE credential_client_id = $client_id
|
||||
AND credential_contact_id != $contact_id
|
||||
AND credential_contact_id = 0
|
||||
AND credential_archived_at IS NULL
|
||||
ORDER BY credential_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql_credentials_select)) {
|
||||
$credential_id = intval($row['credential_id']);
|
||||
$credential_name = nullable_htmlentities($row['credential_name']);
|
||||
|
||||
?>
|
||||
<option value="<?php echo $credential_id ?>"><?php echo $credential_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_contact_to_credential" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</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>
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
<div class="modal" id="linkDocumentModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-folder mr-2"></i>Link Document to <strong><?php echo $contact_name; ?></strong></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="contact_id" value="<?php echo intval($_GET['contact_id']); ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-folder"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="document_id">
|
||||
<option value="">- Select a Document -</option>
|
||||
<?php
|
||||
// Check if there are any associated documents
|
||||
if ($linked_documents) {
|
||||
$excluded_document_ids = implode(",", $linked_documents);
|
||||
$exclude_condition = "AND document_id NOT IN ($excluded_document_ids)";
|
||||
} else {
|
||||
$exclude_condition = ""; // No condition if there are no displayed documents
|
||||
}
|
||||
|
||||
$sql_documents_select = mysqli_query($mysqli, "SELECT * FROM documents
|
||||
WHERE document_client_id = $client_id
|
||||
AND document_archived_at IS NULL
|
||||
$exclude_condition
|
||||
ORDER BY document_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql_documents_select)) {
|
||||
$document_id = intval($row['document_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
|
||||
?>
|
||||
<option value="<?php echo $document_id ?>"><?php echo $document_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_contact_to_document" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</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>
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
<div class="modal" id="linkFileModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-paperclip mr-2"></i>Link File to <strong><?php echo $contact_name; ?></strong></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="contact_id" value="<?php echo intval($_GET['contact_id']); ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-paperclip"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="file_id">
|
||||
<option value="">- Select a File -</option>
|
||||
<?php
|
||||
// Check if there are any associated files
|
||||
if (!empty($linked_files)) {
|
||||
$excluded_file_ids = implode(",", $linked_files);
|
||||
$exclude_condition = "AND file_id NOT IN ($excluded_file_ids)";
|
||||
} else {
|
||||
$exclude_condition = ""; // No condition if there are no displayed vendors
|
||||
}
|
||||
|
||||
$sql_files_select = mysqli_query($mysqli, "SELECT * FROM files
|
||||
LEFT JOIN folders ON folder_id = file_folder_id
|
||||
WHERE file_client_id = $client_id
|
||||
$exclude_condition
|
||||
ORDER BY folder_name ASC, file_name ASC"
|
||||
);
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_files_select)) {
|
||||
$file_id = intval($row['file_id']);
|
||||
$file_name = nullable_htmlentities($row['file_name']);
|
||||
$folder_name = nullable_htmlentities($row['folder_name']);
|
||||
|
||||
?>
|
||||
<option value="<?php echo $file_id ?>"><?php echo "$folder_name/$file_name"; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_contact_to_file" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</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>
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
<div class="modal" id="linkServiceModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-stream mr-2"></i>Link Service to <strong><?php echo $contact_name; ?></strong></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="contact_id" value="<?php echo intval($_GET['contact_id']); ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-stream"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="service_id">
|
||||
<option value="">- Select a Service -</option>
|
||||
<?php
|
||||
// Check if there are any associated services
|
||||
if (!empty($linked_services)) {
|
||||
$excluded_service_ids = implode(",", $linked_services);
|
||||
$exclude_condition = "AND service_id NOT IN ($excluded_service_ids)";
|
||||
} else {
|
||||
$exclude_condition = ""; // No condition if there are no displayed services
|
||||
}
|
||||
|
||||
$sql_services_select = mysqli_query($mysqli, "SELECT * FROM services
|
||||
WHERE service_client_id = $client_id
|
||||
$exclude_condition
|
||||
ORDER BY service_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql_services_select)) {
|
||||
$service_id = intval($row['service_id']);
|
||||
$service_name = nullable_htmlentities($row['service_name']);
|
||||
|
||||
?>
|
||||
<option value="<?php echo $service_id ?>"><?php echo $service_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_service_to_contact" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</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>
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
<div class="modal" id="linkSoftwareModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-cube mr-2"></i>License Software to <strong><?php echo $contact_name; ?></strong></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="contact_id" value="<?php echo intval($_GET['contact_id']); ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<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="software_id">
|
||||
<option value="">- Select a User Software License -</option>
|
||||
<?php
|
||||
// Check if there are any associated sofctware
|
||||
if (!empty($linked_software)) {
|
||||
$excluded_software_ids = implode(",", $linked_software);
|
||||
$exclude_condition = "AND software_id NOT IN ($excluded_software_ids)";
|
||||
} else {
|
||||
$exclude_condition = ""; // No condition if there are no displayed software
|
||||
}
|
||||
|
||||
$sql_software_select = mysqli_query($mysqli, "SELECT * FROM software
|
||||
WHERE software_client_id = $client_id
|
||||
AND software_archived_at IS NULL
|
||||
AND software_license_type = 'User'
|
||||
$exclude_condition
|
||||
ORDER BY software_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql_software_select)) {
|
||||
$software_id = intval($row['software_id']);
|
||||
$software_name = nullable_htmlentities($row['software_name']);
|
||||
|
||||
?>
|
||||
<option value="<?php echo $software_id ?>"><?php echo $software_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_software_to_contact" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</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>
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="add_invoice_recurring" class="btn btn-primary text-bold"><i class="fas fa-check mr-2"></i>Create Invoice</button>
|
||||
<button type="submit" name="add_invoice_recurring" class="btn btn-primary text-bold"><i class="fas fa-check mr-2"></i>Create Recurring Invoice</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fas fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@
|
|||
<span class="input-group-text"><i class="fa fa-fw fa-users"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="client_id">
|
||||
<option vlaue="0">- No Client -</option>
|
||||
<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)) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fas fa-fw fa-life-ring mr-2"></i>Link Ticket to Project: <strong><?php echo $project_name; ?></strong></h5>
|
||||
<h5 class="modal-title"><i class="fas fa-fw fa-life-ring mr-2"></i>Link open ticket to project: <strong><?php echo $project_name; ?></strong></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
|
|
@ -18,17 +18,18 @@
|
|||
<span class="input-group-text"><i class="fa fa-fw fa-life-ring"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" multiple name="tickets[]" required>
|
||||
<option value="">- Select a Tickets -</option>
|
||||
<option value="" disabled>- Select Ticket(s) -</option>
|
||||
<?php
|
||||
|
||||
$sql_tickets_select = mysqli_query($mysqli, "SELECT * FROM tickets WHERE ticket_project_id = 0 AND ticket_closed_at IS NULL $client_ticket_select_query");
|
||||
$sql_tickets_select = mysqli_query($mysqli, "SELECT * FROM tickets LEFT JOIN clients on ticket_client_id = client_id WHERE ticket_project_id = 0 AND ticket_closed_at IS NULL $client_ticket_select_query");
|
||||
while ($row = mysqli_fetch_array($sql_tickets_select)) {
|
||||
$ticket_id_select = intval($row['ticket_id']);
|
||||
$ticket_prefix_select = nullable_htmlentities($row['ticket_prefix']);
|
||||
$ticket_number_select = intval($row['ticket_number']);
|
||||
$ticket_subject_select = nullable_htmlentities($row['ticket_subject']);
|
||||
$ticket_client_abbreviation_select = nullable_htmlentities($row['client_abbreviation'])
|
||||
?>
|
||||
<option value="<?php echo $ticket_id_select; ?>"><?php echo "$ticket_prefix_select $ticket_number_select - $ticket_subject_select"; ?></option>
|
||||
<option value="<?php echo $ticket_id_select; ?>"><?php echo "$ticket_prefix_select$ticket_number_select - $ticket_subject_select ($ticket_client_abbreviation_select)"; ?></option>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-life-desktop mr-2"></i>Editing ticket Asset: <strong><?php echo "$ticket_prefix$ticket_number"; ?></strong> - <?php echo $client_name; ?></h5>
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-desktop mr-2"></i>Editing ticket Asset: <strong><?php echo "$ticket_prefix$ticket_number"; ?></strong> - <?php echo $client_name; ?></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<?php } ?>
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-sm-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) {echo stripslashes(nullable_htmlentities($q));} ?>" placeholder="Search Payments">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-secondary" type="button" data-toggle="collapse" data-target="#advancedFilter"><i class="fas fa-filter"></i></button>
|
||||
|
|
@ -85,7 +85,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<div class="input-group mb-3 mb-sm-0">
|
||||
<select class="form-control select2" name="account" onchange="this.form.submit()">
|
||||
<option value="">- All Accounts -</option>
|
||||
|
||||
|
|
@ -105,7 +105,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
|
||||
<div class="col-sm-2">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<select class="form-control select2" name="method" onchange="this.form.submit()">
|
||||
<option value="">- All Payment Methods -</option>
|
||||
|
||||
|
|
@ -159,7 +159,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<hr>
|
||||
<div class="table-responsive-sm">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?> text-nowrap">
|
||||
<tr>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=payment_date&order=<?php echo $disp; ?>">
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
*
|
||||
* To rebuild or modify this file with the latest versions of the included
|
||||
* software please visit:
|
||||
* https://datatables.net/download/#bs4/dt-2.2.2
|
||||
* https://datatables.net/download/#bs4/dt-2.3.1
|
||||
*
|
||||
* Included libraries:
|
||||
* DataTables 2.2.2
|
||||
* DataTables 2.3.1
|
||||
*/
|
||||
|
||||
:root {
|
||||
|
|
@ -104,24 +104,14 @@ table.dataTable thead > tr > td.dt-ordering-desc span.dt-column-order:after {
|
|||
content: "\25BC";
|
||||
content: "\25BC"/"";
|
||||
}
|
||||
table.dataTable thead > tr > th.dt-orderable-asc, table.dataTable thead > tr > th.dt-orderable-desc, table.dataTable thead > tr > th.dt-ordering-asc, table.dataTable thead > tr > th.dt-ordering-desc,
|
||||
table.dataTable thead > tr > td.dt-orderable-asc,
|
||||
table.dataTable thead > tr > td.dt-orderable-desc,
|
||||
table.dataTable thead > tr > td.dt-ordering-asc,
|
||||
table.dataTable thead > tr > td.dt-ordering-desc {
|
||||
position: relative;
|
||||
padding-right: 30px;
|
||||
}
|
||||
table.dataTable thead > tr > th.dt-orderable-asc span.dt-column-order, table.dataTable thead > tr > th.dt-orderable-desc span.dt-column-order, table.dataTable thead > tr > th.dt-ordering-asc span.dt-column-order, table.dataTable thead > tr > th.dt-ordering-desc span.dt-column-order,
|
||||
table.dataTable thead > tr > td.dt-orderable-asc span.dt-column-order,
|
||||
table.dataTable thead > tr > td.dt-orderable-desc span.dt-column-order,
|
||||
table.dataTable thead > tr > td.dt-ordering-asc span.dt-column-order,
|
||||
table.dataTable thead > tr > td.dt-ordering-desc span.dt-column-order {
|
||||
position: absolute;
|
||||
right: 12px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
position: relative;
|
||||
width: 12px;
|
||||
height: 20px;
|
||||
}
|
||||
table.dataTable thead > tr > th.dt-orderable-asc span.dt-column-order:before, table.dataTable thead > tr > th.dt-orderable-asc span.dt-column-order:after, table.dataTable thead > tr > th.dt-orderable-desc span.dt-column-order:before, table.dataTable thead > tr > th.dt-orderable-desc span.dt-column-order:after, table.dataTable thead > tr > th.dt-ordering-asc span.dt-column-order:before, table.dataTable thead > tr > th.dt-ordering-asc span.dt-column-order:after, table.dataTable thead > tr > th.dt-ordering-desc span.dt-column-order:before, table.dataTable thead > tr > th.dt-ordering-desc span.dt-column-order:after,
|
||||
table.dataTable thead > tr > td.dt-orderable-asc span.dt-column-order:before,
|
||||
|
|
@ -163,6 +153,40 @@ table.dataTable thead > tr > td:active {
|
|||
outline: none;
|
||||
}
|
||||
|
||||
table.dataTable thead > tr > th div.dt-column-header,
|
||||
table.dataTable thead > tr > th div.dt-column-footer,
|
||||
table.dataTable thead > tr > td div.dt-column-header,
|
||||
table.dataTable thead > tr > td div.dt-column-footer,
|
||||
table.dataTable tfoot > tr > th div.dt-column-header,
|
||||
table.dataTable tfoot > tr > th div.dt-column-footer,
|
||||
table.dataTable tfoot > tr > td div.dt-column-header,
|
||||
table.dataTable tfoot > tr > td div.dt-column-footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
table.dataTable thead > tr > th div.dt-column-header span.dt-column-title,
|
||||
table.dataTable thead > tr > th div.dt-column-footer span.dt-column-title,
|
||||
table.dataTable thead > tr > td div.dt-column-header span.dt-column-title,
|
||||
table.dataTable thead > tr > td div.dt-column-footer span.dt-column-title,
|
||||
table.dataTable tfoot > tr > th div.dt-column-header span.dt-column-title,
|
||||
table.dataTable tfoot > tr > th div.dt-column-footer span.dt-column-title,
|
||||
table.dataTable tfoot > tr > td div.dt-column-header span.dt-column-title,
|
||||
table.dataTable tfoot > tr > td div.dt-column-footer span.dt-column-title {
|
||||
flex-grow: 1;
|
||||
}
|
||||
table.dataTable thead > tr > th div.dt-column-header span.dt-column-title:empty,
|
||||
table.dataTable thead > tr > th div.dt-column-footer span.dt-column-title:empty,
|
||||
table.dataTable thead > tr > td div.dt-column-header span.dt-column-title:empty,
|
||||
table.dataTable thead > tr > td div.dt-column-footer span.dt-column-title:empty,
|
||||
table.dataTable tfoot > tr > th div.dt-column-header span.dt-column-title:empty,
|
||||
table.dataTable tfoot > tr > th div.dt-column-footer span.dt-column-title:empty,
|
||||
table.dataTable tfoot > tr > td div.dt-column-header span.dt-column-title:empty,
|
||||
table.dataTable tfoot > tr > td div.dt-column-footer span.dt-column-title:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
div.dt-scroll-body > table.dataTable > thead > tr > th,
|
||||
div.dt-scroll-body > table.dataTable > thead > tr > td {
|
||||
overflow: hidden;
|
||||
|
|
@ -258,10 +282,25 @@ table.dataTable td.dt-type-numeric,
|
|||
table.dataTable td.dt-type-date {
|
||||
text-align: right;
|
||||
}
|
||||
table.dataTable th.dt-type-numeric div.dt-column-header,
|
||||
table.dataTable th.dt-type-numeric div.dt-column-footer, table.dataTable th.dt-type-date div.dt-column-header,
|
||||
table.dataTable th.dt-type-date div.dt-column-footer,
|
||||
table.dataTable td.dt-type-numeric div.dt-column-header,
|
||||
table.dataTable td.dt-type-numeric div.dt-column-footer,
|
||||
table.dataTable td.dt-type-date div.dt-column-header,
|
||||
table.dataTable td.dt-type-date div.dt-column-footer {
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
table.dataTable th.dt-left,
|
||||
table.dataTable td.dt-left {
|
||||
text-align: left;
|
||||
}
|
||||
table.dataTable th.dt-left div.dt-column-header,
|
||||
table.dataTable th.dt-left div.dt-column-footer,
|
||||
table.dataTable td.dt-left div.dt-column-header,
|
||||
table.dataTable td.dt-left div.dt-column-footer {
|
||||
flex-direction: row;
|
||||
}
|
||||
table.dataTable th.dt-center,
|
||||
table.dataTable td.dt-center {
|
||||
text-align: center;
|
||||
|
|
@ -270,10 +309,22 @@ table.dataTable th.dt-right,
|
|||
table.dataTable td.dt-right {
|
||||
text-align: right;
|
||||
}
|
||||
table.dataTable th.dt-right div.dt-column-header,
|
||||
table.dataTable th.dt-right div.dt-column-footer,
|
||||
table.dataTable td.dt-right div.dt-column-header,
|
||||
table.dataTable td.dt-right div.dt-column-footer {
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
table.dataTable th.dt-justify,
|
||||
table.dataTable td.dt-justify {
|
||||
text-align: justify;
|
||||
}
|
||||
table.dataTable th.dt-justify div.dt-column-header,
|
||||
table.dataTable th.dt-justify div.dt-column-footer,
|
||||
table.dataTable td.dt-justify div.dt-column-header,
|
||||
table.dataTable td.dt-justify div.dt-column-footer {
|
||||
flex-direction: row;
|
||||
}
|
||||
table.dataTable th.dt-nowrap,
|
||||
table.dataTable td.dt-nowrap {
|
||||
white-space: nowrap;
|
||||
|
|
@ -295,6 +346,16 @@ table.dataTable tfoot th.dt-head-left,
|
|||
table.dataTable tfoot td.dt-head-left {
|
||||
text-align: left;
|
||||
}
|
||||
table.dataTable thead th.dt-head-left div.dt-column-header,
|
||||
table.dataTable thead th.dt-head-left div.dt-column-footer,
|
||||
table.dataTable thead td.dt-head-left div.dt-column-header,
|
||||
table.dataTable thead td.dt-head-left div.dt-column-footer,
|
||||
table.dataTable tfoot th.dt-head-left div.dt-column-header,
|
||||
table.dataTable tfoot th.dt-head-left div.dt-column-footer,
|
||||
table.dataTable tfoot td.dt-head-left div.dt-column-header,
|
||||
table.dataTable tfoot td.dt-head-left div.dt-column-footer {
|
||||
flex-direction: row;
|
||||
}
|
||||
table.dataTable thead th.dt-head-center,
|
||||
table.dataTable thead td.dt-head-center,
|
||||
table.dataTable tfoot th.dt-head-center,
|
||||
|
|
@ -307,12 +368,32 @@ table.dataTable tfoot th.dt-head-right,
|
|||
table.dataTable tfoot td.dt-head-right {
|
||||
text-align: right;
|
||||
}
|
||||
table.dataTable thead th.dt-head-right div.dt-column-header,
|
||||
table.dataTable thead th.dt-head-right div.dt-column-footer,
|
||||
table.dataTable thead td.dt-head-right div.dt-column-header,
|
||||
table.dataTable thead td.dt-head-right div.dt-column-footer,
|
||||
table.dataTable tfoot th.dt-head-right div.dt-column-header,
|
||||
table.dataTable tfoot th.dt-head-right div.dt-column-footer,
|
||||
table.dataTable tfoot td.dt-head-right div.dt-column-header,
|
||||
table.dataTable tfoot td.dt-head-right div.dt-column-footer {
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
table.dataTable thead th.dt-head-justify,
|
||||
table.dataTable thead td.dt-head-justify,
|
||||
table.dataTable tfoot th.dt-head-justify,
|
||||
table.dataTable tfoot td.dt-head-justify {
|
||||
text-align: justify;
|
||||
}
|
||||
table.dataTable thead th.dt-head-justify div.dt-column-header,
|
||||
table.dataTable thead th.dt-head-justify div.dt-column-footer,
|
||||
table.dataTable thead td.dt-head-justify div.dt-column-header,
|
||||
table.dataTable thead td.dt-head-justify div.dt-column-footer,
|
||||
table.dataTable tfoot th.dt-head-justify div.dt-column-header,
|
||||
table.dataTable tfoot th.dt-head-justify div.dt-column-footer,
|
||||
table.dataTable tfoot td.dt-head-justify div.dt-column-header,
|
||||
table.dataTable tfoot td.dt-head-justify div.dt-column-footer {
|
||||
flex-direction: row;
|
||||
}
|
||||
table.dataTable thead th.dt-head-nowrap,
|
||||
table.dataTable thead td.dt-head-nowrap,
|
||||
table.dataTable tfoot th.dt-head-nowrap,
|
||||
|
|
@ -402,6 +483,9 @@ div.dt-container div.dt-layout-table > div {
|
|||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
div.dt-container {
|
||||
position: relative;
|
||||
}
|
||||
div.dt-container > div.row {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
|
@ -506,14 +590,19 @@ table.dataTable.table-sm > thead > tr td.dt-orderable-asc,
|
|||
table.dataTable.table-sm > thead > tr td.dt-orderable-desc,
|
||||
table.dataTable.table-sm > thead > tr td.dt-ordering-asc,
|
||||
table.dataTable.table-sm > thead > tr td.dt-ordering-desc {
|
||||
padding-right: 20px;
|
||||
padding-right: 4px;
|
||||
}
|
||||
table.dataTable.table-sm > thead > tr th.dt-orderable-asc span.dt-column-order, table.dataTable.table-sm > thead > tr th.dt-orderable-desc span.dt-column-order, table.dataTable.table-sm > thead > tr th.dt-ordering-asc span.dt-column-order, table.dataTable.table-sm > thead > tr th.dt-ordering-desc span.dt-column-order,
|
||||
table.dataTable.table-sm > thead > tr td.dt-orderable-asc span.dt-column-order,
|
||||
table.dataTable.table-sm > thead > tr td.dt-orderable-desc span.dt-column-order,
|
||||
table.dataTable.table-sm > thead > tr td.dt-ordering-asc span.dt-column-order,
|
||||
table.dataTable.table-sm > thead > tr td.dt-ordering-desc span.dt-column-order {
|
||||
right: 5px;
|
||||
right: 4px;
|
||||
}
|
||||
table.dataTable.table-sm > thead > tr th.dt-type-date span.dt-column-order, table.dataTable.table-sm > thead > tr th.dt-type-numeric span.dt-column-order,
|
||||
table.dataTable.table-sm > thead > tr td.dt-type-date span.dt-column-order,
|
||||
table.dataTable.table-sm > thead > tr td.dt-type-numeric span.dt-column-order {
|
||||
left: 4px;
|
||||
}
|
||||
|
||||
div.dt-scroll-head table.table-bordered {
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@
|
|||
*
|
||||
* To rebuild or modify this file with the latest versions of the included
|
||||
* software please visit:
|
||||
* https://datatables.net/download/#bs4/dt-2.2.2
|
||||
* https://datatables.net/download/#bs4/dt-2.3.1
|
||||
*
|
||||
* Included libraries:
|
||||
* DataTables 2.2.2
|
||||
* DataTables 2.3.1
|
||||
*/
|
||||
|
||||
/*! DataTables 2.2.2
|
||||
/*! DataTables 2.3.1
|
||||
* © SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
|
||||
|
|
@ -101,15 +101,19 @@
|
|||
var defaults = DataTable.defaults;
|
||||
var $this = $(this);
|
||||
|
||||
|
||||
/* Sanity check */
|
||||
// Sanity check
|
||||
if ( this.nodeName.toLowerCase() != 'table' )
|
||||
{
|
||||
_fnLog( null, 0, 'Non-table node initialisation ('+this.nodeName+')', 2 );
|
||||
return;
|
||||
}
|
||||
|
||||
$(this).trigger( 'options.dt', oInit );
|
||||
// Special case for options
|
||||
if (oInit.on && oInit.on.options) {
|
||||
_fnListener($this, 'options', oInit.on.options);
|
||||
}
|
||||
|
||||
$this.trigger( 'options.dt', oInit );
|
||||
|
||||
/* Backwards compatibility for the defaults */
|
||||
_fnCompatOpts( defaults );
|
||||
|
|
@ -248,6 +252,9 @@
|
|||
"caption",
|
||||
"layout",
|
||||
"orderDescReverse",
|
||||
"orderIndicators",
|
||||
"orderHandler",
|
||||
"titleRow",
|
||||
"typeDetect",
|
||||
[ "iCookieDuration", "iStateDuration" ], // backwards compat
|
||||
[ "oSearch", "oPreviousSearch" ],
|
||||
|
|
@ -276,6 +283,13 @@
|
|||
|
||||
oSettings.rowIdFn = _fnGetObjectDataFn( oInit.rowId );
|
||||
|
||||
// Add event listeners
|
||||
if (oInit.on) {
|
||||
Object.keys(oInit.on).forEach(function (key) {
|
||||
_fnListener($this, key, oInit.on[key]);
|
||||
});
|
||||
}
|
||||
|
||||
/* Browser support detection */
|
||||
_fnBrowserDetect( oSettings );
|
||||
|
||||
|
|
@ -336,7 +350,7 @@
|
|||
/* HTML5 attribute detection - build an mData object automatically if the
|
||||
* attributes are found
|
||||
*/
|
||||
var rowOne = $this.children('tbody').find('tr').eq(0);
|
||||
var rowOne = $this.children('tbody').find('tr:first-child').eq(0);
|
||||
|
||||
if ( rowOne.length ) {
|
||||
var a = function ( cell, name ) {
|
||||
|
|
@ -494,6 +508,13 @@
|
|||
* @namespace
|
||||
*/
|
||||
DataTable.ext = _ext = {
|
||||
/**
|
||||
* DataTables build type (expanded by the download builder)
|
||||
*
|
||||
* @type string
|
||||
*/
|
||||
builder: "bs4/dt-2.3.1",
|
||||
|
||||
/**
|
||||
* Buttons. For use with the Buttons extension for DataTables. This is
|
||||
* defined here so other extensions can define buttons regardless of load
|
||||
|
|
@ -505,6 +526,14 @@
|
|||
buttons: {},
|
||||
|
||||
|
||||
/**
|
||||
* ColumnControl buttons and content
|
||||
*
|
||||
* @type object
|
||||
*/
|
||||
ccContent: {},
|
||||
|
||||
|
||||
/**
|
||||
* Element class names
|
||||
*
|
||||
|
|
@ -514,14 +543,6 @@
|
|||
classes: {},
|
||||
|
||||
|
||||
/**
|
||||
* DataTables build type (expanded by the download builder)
|
||||
*
|
||||
* @type string
|
||||
*/
|
||||
builder: "bs4/dt-2.2.2",
|
||||
|
||||
|
||||
/**
|
||||
* Error reporting.
|
||||
*
|
||||
|
|
@ -1887,6 +1908,26 @@
|
|||
init.scrollX = init.scrollX ? '100%' : '';
|
||||
}
|
||||
|
||||
// Objects for ordering
|
||||
if ( typeof init.bSort === 'object' ) {
|
||||
init.orderIndicators = init.bSort.indicators !== undefined ? init.bSort.indicators : true;
|
||||
init.orderHandler = init.bSort.handler !== undefined ? init.bSort.handler : true;
|
||||
init.bSort = true;
|
||||
}
|
||||
else if (init.bSort === false) {
|
||||
init.orderIndicators = false;
|
||||
init.orderHandler = false;
|
||||
}
|
||||
else if (init.bSort === true) {
|
||||
init.orderIndicators = true;
|
||||
init.orderHandler = true;
|
||||
}
|
||||
|
||||
// Which cells are the title cells?
|
||||
if (typeof init.bSortCellsTop === 'boolean') {
|
||||
init.titleRow = init.bSortCellsTop;
|
||||
}
|
||||
|
||||
// Column search objects are in an array, so it needs to be converted
|
||||
// element by element
|
||||
var searchCols = init.aoSearchCols;
|
||||
|
|
@ -3264,7 +3305,7 @@
|
|||
* @param {*} settings DataTables settings
|
||||
* @param {*} source Source layout array
|
||||
* @param {*} incColumns What columns should be included
|
||||
* @returns Layout array
|
||||
* @returns Layout array in column index order
|
||||
*/
|
||||
function _fnHeaderLayout( settings, source, incColumns )
|
||||
{
|
||||
|
|
@ -3548,7 +3589,9 @@
|
|||
|
||||
_fnDraw( settings );
|
||||
|
||||
settings.api.one('draw', function () {
|
||||
settings._drawHold = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -3560,10 +3603,9 @@
|
|||
var zero = oLang.sZeroRecords;
|
||||
var dataSrc = _fnDataSource( settings );
|
||||
|
||||
if (
|
||||
(settings.iDraw < 1 && dataSrc === 'ssp') ||
|
||||
(settings.iDraw <= 1 && dataSrc === 'ajax')
|
||||
) {
|
||||
// Make use of the fact that settings.json is only set once the initial data has
|
||||
// been loaded. Show loading when that isn't the case
|
||||
if ((dataSrc === 'ssp' || dataSrc === 'ajax') && ! settings.json) {
|
||||
zero = oLang.sLoadingRecords;
|
||||
}
|
||||
else if ( oLang.sEmptyTable && settings.fnRecordsTotal() === 0 )
|
||||
|
|
@ -3933,6 +3975,7 @@
|
|||
var rows = $(thead).children('tr');
|
||||
var row, cell;
|
||||
var i, k, l, iLen, shifted, column, colspan, rowspan;
|
||||
var titleRow = settings.titleRow;
|
||||
var isHeader = thead && thead.nodeName.toLowerCase() === 'thead';
|
||||
var layout = [];
|
||||
var unique;
|
||||
|
|
@ -3961,6 +4004,7 @@
|
|||
cell.nodeName.toUpperCase() == 'TH'
|
||||
) {
|
||||
var cols = [];
|
||||
var jqCell = $(cell);
|
||||
|
||||
// Get the col and rowspan attributes from the DOM and sanitise them
|
||||
colspan = cell.getAttribute('colspan') * 1;
|
||||
|
|
@ -3981,7 +4025,7 @@
|
|||
if ( write ) {
|
||||
if (unique) {
|
||||
// Allow column options to be set from HTML attributes
|
||||
_fnColumnOptions( settings, shifted, $(cell).data() );
|
||||
_fnColumnOptions( settings, shifted, jqCell.data() );
|
||||
|
||||
// Get the width for the column. This can be defined from the
|
||||
// width attribute, style attribute or `columns.width` option
|
||||
|
|
@ -3998,8 +4042,15 @@
|
|||
// Column title handling - can be user set, or read from the DOM
|
||||
// This happens before the render, so the original is still in place
|
||||
if ( columnDef.sTitle !== null && ! columnDef.autoTitle ) {
|
||||
if (
|
||||
(titleRow === true && i === 0) || // top row
|
||||
(titleRow === false && i === rows.length -1) || // bottom row
|
||||
(titleRow === i) || // specific row
|
||||
(titleRow === null)
|
||||
) {
|
||||
cell.innerHTML = columnDef.sTitle;
|
||||
}
|
||||
}
|
||||
|
||||
if (! columnDef.sTitle && unique) {
|
||||
columnDef.sTitle = _stripHtml(cell.innerHTML);
|
||||
|
|
@ -4016,12 +4067,12 @@
|
|||
// Fall back to the aria-label attribute on the table header if no ariaTitle is
|
||||
// provided.
|
||||
if (! columnDef.ariaTitle) {
|
||||
columnDef.ariaTitle = $(cell).attr("aria-label") || columnDef.sTitle;
|
||||
columnDef.ariaTitle = jqCell.attr("aria-label") || columnDef.sTitle;
|
||||
}
|
||||
|
||||
// Column specific class names
|
||||
if ( columnDef.className ) {
|
||||
$(cell).addClass( columnDef.className );
|
||||
jqCell.addClass( columnDef.className );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4033,11 +4084,28 @@
|
|||
.appendTo(cell);
|
||||
}
|
||||
|
||||
if ( isHeader && $('span.dt-column-order', cell).length === 0) {
|
||||
if (
|
||||
settings.orderIndicators &&
|
||||
isHeader &&
|
||||
jqCell.filter(':not([data-dt-order=disable])').length !== 0 &&
|
||||
jqCell.parent(':not([data-dt-order=disable])').length !== 0 &&
|
||||
$('span.dt-column-order', cell).length === 0
|
||||
) {
|
||||
$('<span>')
|
||||
.addClass('dt-column-order')
|
||||
.appendTo(cell);
|
||||
}
|
||||
|
||||
// We need to wrap the elements in the header in another element to use flexbox
|
||||
// layout for those elements
|
||||
var headerFooter = isHeader ? 'header' : 'footer';
|
||||
|
||||
if ( $('span.dt-column-' + headerFooter, cell).length === 0) {
|
||||
$('<div>')
|
||||
.addClass('dt-column-' + headerFooter)
|
||||
.append(cell.childNodes)
|
||||
.appendTo(cell);
|
||||
}
|
||||
}
|
||||
|
||||
// If there is col / rowspan, copy the information into the layout grid
|
||||
|
|
@ -4188,6 +4256,11 @@
|
|||
// Allow plug-ins and external processes to modify the data
|
||||
_fnCallbackFire( oSettings, null, 'preXhr', [oSettings, data, baseAjax], true );
|
||||
|
||||
// Custom Ajax option to submit the parameters as a JSON string
|
||||
if (baseAjax.submitAs === 'json' && typeof data === 'object') {
|
||||
baseAjax.data = JSON.stringify(data);
|
||||
}
|
||||
|
||||
if ( typeof ajax === 'function' )
|
||||
{
|
||||
// Is a function - let the caller define what needs to be done
|
||||
|
|
@ -5688,17 +5761,22 @@
|
|||
function _fnSortInit( settings ) {
|
||||
var target = settings.nTHead;
|
||||
var headerRows = target.querySelectorAll('tr');
|
||||
var legacyTop = settings.bSortCellsTop;
|
||||
var titleRow = settings.titleRow;
|
||||
var notSelector = ':not([data-dt-order="disable"]):not([data-dt-order="icon-only"])';
|
||||
|
||||
// Legacy support for `orderCellsTop`
|
||||
if (legacyTop === true) {
|
||||
if (titleRow === true) {
|
||||
target = headerRows[0];
|
||||
}
|
||||
else if (legacyTop === false) {
|
||||
else if (titleRow === false) {
|
||||
target = headerRows[ headerRows.length - 1 ];
|
||||
}
|
||||
else if (titleRow !== null) {
|
||||
target = headerRows[titleRow];
|
||||
}
|
||||
// else - all rows
|
||||
|
||||
if (settings.orderHandler) {
|
||||
_fnSortAttachListener(
|
||||
settings,
|
||||
target,
|
||||
|
|
@ -5706,6 +5784,7 @@
|
|||
? 'tr'+notSelector+' th'+notSelector+', tr'+notSelector+' td'+notSelector
|
||||
: 'th'+notSelector+', td'+notSelector
|
||||
);
|
||||
}
|
||||
|
||||
// Need to resolve the user input array into our internal structure
|
||||
var order = [];
|
||||
|
|
@ -5720,6 +5799,8 @@
|
|||
var run = false;
|
||||
var columns = column === undefined
|
||||
? _fnColumnsFromHeader( e.target )
|
||||
: Array.isArray(column)
|
||||
? column
|
||||
: [column];
|
||||
|
||||
if ( columns.length ) {
|
||||
|
|
@ -6343,16 +6424,19 @@
|
|||
|
||||
// A column name was stored and should be used for restore
|
||||
if (typeof col[0] === 'string') {
|
||||
// Find the name from the current list of column names
|
||||
var idx = currentNames.indexOf(col[0]);
|
||||
|
||||
// Find the name from the current list of column names, or fallback to index 0
|
||||
set[0] = idx >= 0
|
||||
? idx
|
||||
: 0;
|
||||
if (idx < 0) {
|
||||
// If the column was not found ignore it and continue
|
||||
return;
|
||||
}
|
||||
|
||||
set[0] = idx;
|
||||
}
|
||||
else if (set[0] >= columns.length) {
|
||||
// If a column name, but it is out of bounds, set to 0
|
||||
set[0] = 0;
|
||||
// If the column index is out of bounds ignore it and continue
|
||||
return;
|
||||
}
|
||||
|
||||
settings.aaSorting.push(set);
|
||||
|
|
@ -6765,6 +6849,23 @@
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add one or more listeners to the table
|
||||
*
|
||||
* @param {*} that JQ for the table
|
||||
* @param {*} name Event name
|
||||
* @param {*} src Listener(s)
|
||||
*/
|
||||
function _fnListener(that, name, src) {
|
||||
if (!Array.isArray(src)) {
|
||||
src = [src];
|
||||
}
|
||||
|
||||
for (i=0 ; i<src.length ; i++) {
|
||||
that.on(name + '.dt', src[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -7421,12 +7522,24 @@
|
|||
['footer', 'aoFooter'],
|
||||
].forEach(function (item) {
|
||||
_api_register( 'table().' + item[0] + '.structure()' , function (selector) {
|
||||
var indexes = this.columns(selector).indexes().flatten();
|
||||
var indexes = this.columns(selector).indexes().flatten().toArray();
|
||||
var ctx = this.context[0];
|
||||
var structure = _fnHeaderLayout(ctx, ctx[item[1]], indexes);
|
||||
|
||||
return _fnHeaderLayout(ctx, ctx[item[1]], indexes);
|
||||
// The structure is in column index order - but from this method we want the return to be
|
||||
// in the columns() selector API order. In order to do that we need to map from one form
|
||||
// to the other
|
||||
var orderedIndexes = indexes.slice().sort(function (a, b) {
|
||||
return a - b;
|
||||
});
|
||||
|
||||
return structure.map(function (row) {
|
||||
return indexes.map(function (colIdx) {
|
||||
return row[orderedIndexes.indexOf(colIdx)];
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
_api_registerPlural( 'tables().containers()', 'table().container()' , function () {
|
||||
|
|
@ -7775,7 +7888,7 @@
|
|||
{
|
||||
var
|
||||
out = [], res,
|
||||
a, i, ien, j, jen,
|
||||
i, ien,
|
||||
selectorType = typeof selector;
|
||||
|
||||
// Can't just check for isArray here, as an API or jQuery instance might be
|
||||
|
|
@ -7785,13 +7898,7 @@
|
|||
}
|
||||
|
||||
for ( i=0, ien=selector.length ; i<ien ; i++ ) {
|
||||
// Only split on simple strings - complex expressions will be jQuery selectors
|
||||
a = selector[i] && selector[i].split && ! selector[i].match(/[[(:]/) ?
|
||||
selector[i].split(',') :
|
||||
[ selector[i] ];
|
||||
|
||||
for ( j=0, jen=a.length ; j<jen ; j++ ) {
|
||||
res = selectFn( typeof a[j] === 'string' ? (a[j]).trim() : a[j] );
|
||||
res = selectFn( typeof selector[i] === 'string' ? selector[i].trim() : selector[i] );
|
||||
|
||||
// Remove empty items
|
||||
res = res.filter( function (item) {
|
||||
|
|
@ -7802,7 +7909,6 @@
|
|||
out = out.concat( res );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// selector extensions
|
||||
var ext = _ext.selector[ type ];
|
||||
|
|
@ -7829,6 +7935,7 @@
|
|||
}
|
||||
|
||||
return $.extend( {
|
||||
columnOrder: 'implied',
|
||||
search: 'none',
|
||||
order: 'current',
|
||||
page: 'all'
|
||||
|
|
@ -8590,23 +8697,60 @@
|
|||
|
||||
var __column_header = function ( settings, column, row ) {
|
||||
var header = settings.aoHeader;
|
||||
var target = row !== undefined
|
||||
? row
|
||||
: settings.bSortCellsTop // legacy support
|
||||
? 0
|
||||
: header.length - 1;
|
||||
var titleRow = settings.titleRow;
|
||||
var target = null;
|
||||
|
||||
if (row !== undefined) {
|
||||
target = row;
|
||||
}
|
||||
else if (titleRow === true) { // legacy orderCellsTop support
|
||||
target = 0;
|
||||
}
|
||||
else if (titleRow === false) {
|
||||
target = header.length - 1;
|
||||
}
|
||||
else if (titleRow !== null) {
|
||||
target = titleRow;
|
||||
}
|
||||
else {
|
||||
// Automatic - find the _last_ unique cell from the top that is not empty (last for
|
||||
// backwards compatibility)
|
||||
for (var i=0 ; i<header.length ; i++) {
|
||||
if (header[i][column].unique && $('span.dt-column-title', header[i][column].cell).text()) {
|
||||
target = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (target === null) {
|
||||
target = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return header[target][column].cell;
|
||||
};
|
||||
|
||||
var __column_header_cells = function (header) {
|
||||
var out = [];
|
||||
|
||||
for (var i=0 ; i<header.length ; i++) {
|
||||
for (var j=0 ; j<header[i].length ; j++) {
|
||||
var cell = header[i][j].cell;
|
||||
|
||||
if (!out.includes(cell)) {
|
||||
out.push(cell);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
var __column_selector = function ( settings, selector, opts )
|
||||
{
|
||||
var
|
||||
columns = settings.aoColumns,
|
||||
names = _pluck( columns, 'sName' ),
|
||||
titles = _pluck( columns, 'sTitle' ),
|
||||
cells = DataTable.util.get('[].[].cell')(settings.aoHeader),
|
||||
nodes = _unique( _flatten([], cells) );
|
||||
names, titles,
|
||||
nodes = __column_header_cells(settings.aoHeader);
|
||||
|
||||
var run = function ( s ) {
|
||||
var selInt = _intVal( s );
|
||||
|
|
@ -8678,12 +8822,21 @@
|
|||
} );
|
||||
|
||||
case 'name':
|
||||
// Don't get names, unless needed, and only get once if it is
|
||||
if (!names) {
|
||||
names = _pluck( columns, 'sName' );
|
||||
}
|
||||
|
||||
// match by name. `names` is column index complete and in order
|
||||
return names.map( function (name, i) {
|
||||
return name === match[1] ? i : null;
|
||||
} );
|
||||
|
||||
case 'title':
|
||||
if (!titles) {
|
||||
titles = _pluck( columns, 'sTitle' );
|
||||
}
|
||||
|
||||
// match by column title
|
||||
return titles.map( function (title, i) {
|
||||
return title === match[1] ? i : null;
|
||||
|
|
@ -8722,7 +8875,11 @@
|
|||
[];
|
||||
};
|
||||
|
||||
return _selector_run( 'column', selector, run, settings, opts );
|
||||
var selected = _selector_run( 'column', selector, run, settings, opts );
|
||||
|
||||
return opts.columnOrder && opts.columnOrder === 'index'
|
||||
? selected.sort(function (a, b) { return a - b; })
|
||||
: selected; // implied
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -8846,6 +9003,12 @@
|
|||
}, 1 );
|
||||
} );
|
||||
|
||||
_api_registerPlural( 'columns().names()', 'column().name()', function () {
|
||||
return this.iterator( 'column', function ( settings, column ) {
|
||||
return settings.aoColumns[column].sName;
|
||||
}, 1 );
|
||||
} );
|
||||
|
||||
_api_registerPlural( 'columns().nodes()', 'column().nodes()', function () {
|
||||
return this.iterator( 'column-rows', function ( settings, column, i, j, rows ) {
|
||||
return _pluck_order( settings.aoData, rows, 'anCells', column ) ;
|
||||
|
|
@ -9272,7 +9435,10 @@
|
|||
// otherwise a 2D array was passed in
|
||||
|
||||
return this.iterator( 'table', function ( settings ) {
|
||||
settings.aaSorting = Array.isArray(order) ? order.slice() : order;
|
||||
var resolved = [];
|
||||
_fnSortResolve(settings, resolved, order);
|
||||
|
||||
settings.aaSorting = resolved;
|
||||
} );
|
||||
} );
|
||||
|
||||
|
|
@ -9398,7 +9564,7 @@
|
|||
var fixed = settings.searchFixed;
|
||||
|
||||
if (! name) {
|
||||
return Object.keys(fixed)
|
||||
return Object.keys(fixed);
|
||||
}
|
||||
else if (search === undefined) {
|
||||
return fixed[name];
|
||||
|
|
@ -9465,10 +9631,10 @@
|
|||
var fixed = settings.aoColumns[colIdx].searchFixed;
|
||||
|
||||
if (! name) {
|
||||
return Object.keys(fixed)
|
||||
return Object.keys(fixed);
|
||||
}
|
||||
else if (search === undefined) {
|
||||
return fixed[name];
|
||||
return fixed[name] || null;
|
||||
}
|
||||
else if (search === null) {
|
||||
delete fixed[name];
|
||||
|
|
@ -9920,14 +10086,9 @@
|
|||
jqTable.append( tfoot );
|
||||
}
|
||||
|
||||
// Clean up the header
|
||||
$(thead).find('span.dt-column-order').remove();
|
||||
$(thead).find('span.dt-column-title').each(function () {
|
||||
var title = $(this).html();
|
||||
$(this).parent().append(title);
|
||||
$(this).remove();
|
||||
});
|
||||
|
||||
// Clean up the header / footer
|
||||
cleanHeader(thead, 'header');
|
||||
cleanHeader(tfoot, 'footer');
|
||||
settings.colgroup.remove();
|
||||
|
||||
settings.aaSorting = [];
|
||||
|
|
@ -9949,7 +10110,6 @@
|
|||
orderClasses.isDesc
|
||||
)
|
||||
.css('width', '')
|
||||
.removeAttr('data-dt-column')
|
||||
.removeAttr('aria-sort');
|
||||
|
||||
// Add the TR elements back into the table in their original order
|
||||
|
|
@ -10030,6 +10190,19 @@
|
|||
: resolved;
|
||||
} );
|
||||
|
||||
// Needed for header and footer, so pulled into its own function
|
||||
function cleanHeader(node, className) {
|
||||
$(node).find('span.dt-column-order').remove();
|
||||
$(node).find('span.dt-column-title').each(function () {
|
||||
var title = $(this).html();
|
||||
$(this).parent().parent().append(title);
|
||||
$(this).remove();
|
||||
});
|
||||
$(node).find('div.dt-column-' + className).remove();
|
||||
|
||||
$('th, td', node).removeAttr('data-dt-column');
|
||||
}
|
||||
|
||||
/**
|
||||
* Version string for plug-ins to check compatibility. Allowed format is
|
||||
* `a.b.c-d` where: a:int, b:int, c:int, d:string(dev|beta|alpha). `d` is used
|
||||
|
|
@ -10038,7 +10211,7 @@
|
|||
* @type string
|
||||
* @default Version number
|
||||
*/
|
||||
DataTable.version = "2.2.2";
|
||||
DataTable.version = "2.3.1";
|
||||
|
||||
/**
|
||||
* Private data store, containing all of the settings objects that are
|
||||
|
|
@ -10645,6 +10818,10 @@
|
|||
"bSortCellsTop": null,
|
||||
|
||||
|
||||
/** Specify which row is the title row in the header. Replacement for bSortCellsTop */
|
||||
titleRow: null,
|
||||
|
||||
|
||||
/**
|
||||
* Enable or disable the addition of the classes `sorting\_1`, `sorting\_2` and
|
||||
* `sorting\_3` to the columns which are currently being sorted on. This is
|
||||
|
|
@ -10922,6 +11099,13 @@
|
|||
1: "entry"
|
||||
},
|
||||
|
||||
/**
|
||||
* Page length options
|
||||
*/
|
||||
lengthLabels: {
|
||||
'-1': 'All'
|
||||
},
|
||||
|
||||
/**
|
||||
* This string is shown in preference to `zeroRecords` when the table is
|
||||
* empty of data (regardless of filtering). Note that this is an optional
|
||||
|
|
@ -11192,7 +11376,10 @@
|
|||
/**
|
||||
* For server-side processing - use the data from the DOM for the first draw
|
||||
*/
|
||||
iDeferLoading: null
|
||||
iDeferLoading: null,
|
||||
|
||||
/** Event listeners */
|
||||
on: null
|
||||
};
|
||||
|
||||
_fnHungarianMap( DataTable.defaults );
|
||||
|
|
@ -12019,10 +12206,7 @@
|
|||
|
||||
/**
|
||||
* Indicate that if multiple rows are in the header and there is more than
|
||||
* one unique cell per column, if the top one (true) or bottom one (false)
|
||||
* should be used for sorting / title by DataTables.
|
||||
* Note that this parameter will be set by the initialisation routine. To
|
||||
* set a default use {@link DataTable.defaults}.
|
||||
* one unique cell per column. Replaced by titleRow
|
||||
*/
|
||||
"bSortCellsTop": null,
|
||||
|
||||
|
|
@ -12147,7 +12331,19 @@
|
|||
resizeObserver: null,
|
||||
|
||||
/** Keep a record of the last size of the container, so we can skip duplicates */
|
||||
containerWidth: -1
|
||||
containerWidth: -1,
|
||||
|
||||
/** Reverse the initial order of the data set on desc ordering */
|
||||
orderDescReverse: null,
|
||||
|
||||
/** Show / hide ordering indicators in headers */
|
||||
orderIndicators: true,
|
||||
|
||||
/** Default ordering listener */
|
||||
orderHandler: true,
|
||||
|
||||
/** Title row indicator */
|
||||
titleRow: null
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -12977,7 +13173,7 @@
|
|||
cell.addClass(classes.order.none);
|
||||
}
|
||||
|
||||
var legacyTop = settings.bSortCellsTop;
|
||||
var titleRow = settings.titleRow;
|
||||
var headerRows = cell.closest('thead').find('tr');
|
||||
var rowIdx = cell.parent().index();
|
||||
|
||||
|
|
@ -12987,11 +13183,10 @@
|
|||
cell.attr('data-dt-order') === 'disable' ||
|
||||
cell.parent().attr('data-dt-order') === 'disable' ||
|
||||
|
||||
// Legacy support for `orderCellsTop`. If it is set, then cells
|
||||
// which are not in the top or bottom row of the header (depending
|
||||
// on the value) do not get the sorting classes applied to them
|
||||
(legacyTop === true && rowIdx !== 0) ||
|
||||
(legacyTop === false && rowIdx !== headerRows.length - 1)
|
||||
// titleRow support, for defining a specific row in the header
|
||||
(titleRow === true && rowIdx !== 0) ||
|
||||
(titleRow === false && rowIdx !== headerRows.length - 1) ||
|
||||
(typeof titleRow === 'number' && rowIdx !== titleRow)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -13001,7 +13196,7 @@
|
|||
// `DT` namespace will allow the event to be removed automatically
|
||||
// on destroy, while the `dt` namespaced event is the one we are
|
||||
// listening for
|
||||
$(settings.nTable).on( 'order.dt.DT column-visibility.dt.DT', function ( e, ctx ) {
|
||||
$(settings.nTable).on( 'order.dt.DT column-visibility.dt.DT', function ( e, ctx, column ) {
|
||||
if ( settings !== ctx ) { // need to check this this is the host
|
||||
return; // table, not a nested one
|
||||
}
|
||||
|
|
@ -13012,6 +13207,16 @@
|
|||
return;
|
||||
}
|
||||
|
||||
var orderedColumns = _pluck(sorting, 'col');
|
||||
|
||||
// This handler is only needed on column visibility if the column is part of the
|
||||
// ordering. If it isn't, then we can bail out to save performance. It could be a
|
||||
// separate event handler, but this is a balance between code reuse / size and performance
|
||||
// console.log(e, e.name, column, orderedColumns, orderedColumns.includes(column))
|
||||
if (e.type === 'column-visibility' && ! orderedColumns.includes(column)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var i;
|
||||
var orderClasses = classes.order;
|
||||
var columns = ctx.api.columns( cell );
|
||||
|
|
@ -13020,8 +13225,8 @@
|
|||
var ariaType = '';
|
||||
var indexes = columns.indexes();
|
||||
var sortDirs = columns.orderable(true).flatten();
|
||||
var orderedColumns = _pluck(sorting, 'col');
|
||||
var tabIndex = settings.iTabIndex;
|
||||
var canOrder = ctx.orderHandler && orderable;
|
||||
|
||||
cell
|
||||
.removeClass(
|
||||
|
|
@ -13029,8 +13234,8 @@
|
|||
orderClasses.isDesc
|
||||
)
|
||||
.toggleClass( orderClasses.none, ! orderable )
|
||||
.toggleClass( orderClasses.canAsc, orderable && sortDirs.includes('asc') )
|
||||
.toggleClass( orderClasses.canDesc, orderable && sortDirs.includes('desc') );
|
||||
.toggleClass( orderClasses.canAsc, canOrder && sortDirs.includes('asc') )
|
||||
.toggleClass( orderClasses.canDesc, canOrder && sortDirs.includes('desc') );
|
||||
|
||||
// Determine if all of the columns that this cell covers are included in the
|
||||
// current ordering
|
||||
|
|
@ -13789,12 +13994,17 @@
|
|||
} );
|
||||
|
||||
for ( i=0 ; i<lengths.length ; i++ ) {
|
||||
select[0][ i ] = new Option(
|
||||
typeof language[i] === 'number' ?
|
||||
// Attempt to look up the length from the i18n options
|
||||
var label = settings.api.i18n('lengthLabels.' + lengths[i], null);
|
||||
|
||||
if (label === null) {
|
||||
// If not present, fallback to old style
|
||||
label = typeof language[i] === 'number' ?
|
||||
settings.fnFormatNumber( language[i] ) :
|
||||
language[i],
|
||||
lengths[i]
|
||||
);
|
||||
language[i];
|
||||
}
|
||||
|
||||
select[0][ i ] = new Option(label, lengths[i]);
|
||||
}
|
||||
|
||||
// add for and id to label and input
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,15 +0,0 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_size = 2
|
||||
|
|
@ -20,25 +20,26 @@
|
|||
- Multipart/alternative emails for mail clients that do not read HTML email
|
||||
- Add attachments, including inline
|
||||
- Support for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings
|
||||
- SMTP authentication with LOGIN, PLAIN, CRAM-MD5, and XOAUTH2 mechanisms over SMTPS and SMTP+STARTTLS transports
|
||||
- Full UTF-8 support when using servers that support `SMTPUTF8`.
|
||||
- Support for iCal events in multiparts and attachments
|
||||
- SMTP authentication with `LOGIN`, `PLAIN`, `CRAM-MD5`, and `XOAUTH2` mechanisms over SMTPS and SMTP+STARTTLS transports
|
||||
- Validates email addresses automatically
|
||||
- Protects against header injection attacks
|
||||
- Error messages in over 50 languages!
|
||||
- DKIM and S/MIME signing support
|
||||
- Compatible with PHP 5.5 and later, including PHP 8.2
|
||||
- Compatible with PHP 5.5 and later, including PHP 8.4
|
||||
- Namespaced to prevent name clashes
|
||||
- Much more!
|
||||
|
||||
## Why you might need it
|
||||
Many PHP developers need to send email from their code. The only PHP function that supports this directly is [`mail()`](https://www.php.net/manual/en/function.mail.php). However, it does not provide any assistance for making use of popular features such as encryption, authentication, HTML messages, and attachments.
|
||||
Many PHP developers need to send email from their code. The only PHP function that supports this directly is [`mail()`](https://www.php.net/manual/en/function.mail.php). However, it does not provide any assistance for making use of popular features such as authentication, HTML messages, and attachments.
|
||||
|
||||
Formatting email correctly is surprisingly difficult. There are myriad overlapping (and conflicting) standards, requiring tight adherence to horribly complicated formatting and encoding rules – the vast majority of code that you'll find online that uses the `mail()` function directly is just plain wrong, if not unsafe!
|
||||
|
||||
The PHP `mail()` function usually sends via a local mail server, typically fronted by a `sendmail` binary on Linux, BSD, and macOS platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP client allows email sending on all platforms without needing a local mail server. Be aware though, that the `mail()` function should be avoided when possible; it's both faster and [safer](https://exploitbox.io/paper/Pwning-PHP-Mail-Function-For-Fun-And-RCE.html) to use SMTP to localhost.
|
||||
|
||||
*Please* don't be tempted to do it yourself – if you don't use PHPMailer, there are many other excellent libraries that
|
||||
you should look at before rolling your own. Try [SwiftMailer](https://swiftmailer.symfony.com/)
|
||||
, [Laminas/Mail](https://docs.laminas.dev/laminas-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail), etc.
|
||||
you should look at before rolling your own. Try [Symfony Mailer](https://symfony.com/doc/current/mailer.html), [Laminas/Mail](https://docs.laminas.dev/laminas-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail), etc.
|
||||
|
||||
## License
|
||||
This software is distributed under the [LGPL 2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html) license, along with the [GPL Cooperation Commitment](https://gplcc.github.io/gplcc/). Please read [LICENSE](https://github.com/PHPMailer/PHPMailer/blob/master/LICENSE) for information on the software availability and distribution.
|
||||
|
|
@ -47,7 +48,7 @@ This software is distributed under the [LGPL 2.1](https://www.gnu.org/licenses/o
|
|||
PHPMailer is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install PHPMailer. Just add this line to your `composer.json` file:
|
||||
|
||||
```json
|
||||
"phpmailer/phpmailer": "^6.9.2"
|
||||
"phpmailer/phpmailer": "^6.10.0"
|
||||
```
|
||||
|
||||
or run
|
||||
|
|
@ -74,7 +75,7 @@ require 'path/to/PHPMailer/src/PHPMailer.php';
|
|||
require 'path/to/PHPMailer/src/SMTP.php';
|
||||
```
|
||||
|
||||
If you're not using the `SMTP` class explicitly (you're probably not), you don't need a `use` line for the SMTP class. Even if you're not using exceptions, you do still need to load the `Exception` class as it is used internally.
|
||||
If you're not using the `SMTP` class explicitly (you're probably not), you don't need a `use` line for it. Even if you're not using exceptions, you do still need to load the `Exception` class as it is used internally.
|
||||
|
||||
## Legacy versions
|
||||
PHPMailer 5.2 (which is compatible with PHP 5.0 — 7.0) is no longer supported, even for security updates. You will find the latest version of 5.2 in the [5.2-stable branch](https://github.com/PHPMailer/PHPMailer/tree/5.2-stable). If you're using PHP 5.5 or later (which you should be), switch to the 6.x releases.
|
||||
|
|
@ -95,7 +96,7 @@ use PHPMailer\PHPMailer\PHPMailer;
|
|||
use PHPMailer\PHPMailer\SMTP;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
|
||||
//Load Composer's autoloader
|
||||
//Load Composer's autoloader (created by composer, not included with PHPMailer)
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
//Create an instance; passing `true` enables exceptions
|
||||
|
|
@ -162,7 +163,7 @@ To reduce PHPMailer's deployed code footprint, examples are not included if you
|
|||
|
||||
Complete generated API documentation is [available online](https://phpmailer.github.io/PHPMailer/).
|
||||
|
||||
You can generate complete API-level documentation by running `phpdoc` in the top-level folder, and documentation will appear in the `docs` folder, though you'll need to have [PHPDocumentor](https://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/blob/master/test/PHPMailerTest.php) a good reference for how to do various operations such as encryption.
|
||||
You can generate complete API-level documentation by running `phpdoc` in the top-level folder, and documentation will appear in the `docs` folder, though you'll need to have [PHPDocumentor](https://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/blob/master/test/PHPMailer/PHPMailerTest.php) a good reference for how to do various operations such as encryption.
|
||||
|
||||
If the documentation doesn't cover what you need, search the [many questions on Stack Overflow](https://stackoverflow.com/questions/tagged/phpmailer), and before you ask a question about "SMTP Error: Could not connect to SMTP host.", [read the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting).
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
# A short history of UTF-8 in email
|
||||
|
||||
## Background
|
||||
|
||||
For most of its existence, SMTP has been a 7-bit channel, only supporting US-ASCII characters. This has been a problem for many languages, especially those that use non-Latin scripts, and has led to the development of various workarounds.
|
||||
|
||||
The first major improvement, introduced in 1994 in [RFC 1652](https://www.rfc-editor.org/rfc/rfc1652) and extended in 2011 in [RFC 6152](https://www.rfc-editor.org/rfc/rfc6152), was the addition of the `8BITMIME` SMTP extension, which allowed raw 8-bit data to be included in message bodies sent over SMTP.
|
||||
This allowed the message *contents* to contain 8-bit data, including things like UTF-8 text, even though the SMTP protocol itself was still firmly 7-bit. This worked by having the server switch to 8-bit after the headers, and then back to 7-bit after the completion of a `DATA` command.
|
||||
|
||||
From 1996, messages could support [RFC 2047 encoding](https://www.rfc-editor.org/rfc/rfc2047), which permitted inserting characters from any character set into header *values* (but not names), but only by encoding them in somewhat unreadable ways to allow them to survive passage through a 7-bit channel. An example with a subject of "Schrödinger's cat" would be:
|
||||
|
||||
```
|
||||
Subject: =?utf-8?Q=Schr=C3=B6dinger=92s_Cat?=
|
||||
```
|
||||
|
||||
Here the accented `ö` is encoded as `=C3=B6`, which is the UTF-8 encoding of the 2-byte character, and the whole thing is wrapped in `=?utf-8?Q?` to indicate that it uses the UTF-8 charset and `quoted-printable` encoding. This is a bit of a hack, and not very human-friendly, but it works.
|
||||
|
||||
Similarly, 8-bit message bodies could be encoded using the same `quoted-printable` and `base64` content transfer encoding (CTE) schemes, which preserved the 8-bit content while encoding it in a format that could survive transmission through a 7-bit channel.
|
||||
|
||||
Domain names were originally also stuck in a 7-bit world, actually even more constrained to only a subset of the US-ASCII character set. But of course, many people want to have domains in their own language/script. Internationalized domain name (IDN) permitted this, using yet another complex encoding scheme called punycode, defined for domain names in 2003 in [RFC 3492](https://www.rfc-editor.org/rfc/rfc3492). This finally allowed the domain part (after the `@`) of email addresses to contain UTF-8, though it was actually an illusion preserved by email client applications. For example, an address of
|
||||
`user@café.example.com` translates to
|
||||
`user@xn--caf-dma.example.com` in punycode, rendering it mostly unreadable, but 7-bit friendly, and remaining compatible with email clients that don't know about IDN.
|
||||
|
||||
The one remaining part of email that could not handle UTF-8 is the local part of email addresses (the part before the `@`).
|
||||
|
||||
I've only mentioned UTF-8 here, but most of these approaches also allowed other character sets that were popular, such as [the ISO-8859 family](https://en.wikipedia.org/wiki/ISO/IEC_8859). However, UTF-8 solves so many problems that these other character sets are gradually falling out of favour, as UTF-8 can support all languages.
|
||||
|
||||
This patchwork of overlapping approaches has served us well, but we have to admit that it's a mess.
|
||||
|
||||
## SMTPUTF8
|
||||
|
||||
`SMTPUTF8` is another SMTP extension, defined in [RFC 6531](https://www.rfc-editor.org/rfc/rfc6531) in 2012. This essentially solves the whole problem, allowing the entire SMTP conversation — commands, headers, and message bodies — to be sent in raw, unencoded UTF-8.
|
||||
|
||||
But there's a problem with this approach: adoption. If you send a UTF-8 message to a recipient whose mail server doesn't support this format, the sender has to somehow downgrade the message to make it survive a transition to 7-bit. This is a hard problem to solve, especially since there is no way to make a 7-bit system support UTF-8 in the local parts of addresses. This downgrade problem is what held up the adoption of `SMTPUTF8` in PHPMailer for many years, but in that time the *de facto* approach has become to simply fail in that situation, and tell the recipient it's time they upgraded their mail server 😅.
|
||||
|
||||
The vast majority of large email providers (gmail, Yahoo, Microsoft, etc), mail servers (postfix, exim, IIS, etc), and mail clients (Apple Mail, Outlook, Thunderbird, etc) now all support SMTPUTF8, so the need for backward compatibility is no longer what it was.
|
||||
|
||||
## SMTPUTF8 in PHPMailer
|
||||
|
||||
Several other PHP email libraries have implemented a halfway solution to `SMTPUTF8`, adding only the ability to support UTF-8 in email addresses, not elsewhere in the protocol. I wanted PHPMailer to do it "the right way", and this has taken much longer. PHPMailer now supports UTF-8 everywhere, and does not need to use transfer or header encodings for UTF-8 text when connecting to an `SMTPUTF8`-capable mail server.
|
||||
|
||||
This support is handled automatically: if you add an email address that requires UTF-8, PHPMailer will use UTF-8 for everything. If not, it will fall back to 7-bit and encode the message as necessary.
|
||||
|
||||
The one place you will need to be careful is in the selection of the address validator. By default, PHPMailer uses PHP's built-in `filter_var` validator, which does not allow UTF-8 email addresses. When PHPMailer spots that you have submitted a UTF-8 address, but have not altered the default validator, it will automatically switch to using a UTF-8-compatible validator. As soon as you do this, any SMTP connection you make will *require* that the server you connect to supports `SMTPUTF8`. You can select this validator explicitly by setting `PHPMailer::$validator = 'eai'` (an acronym for Email Address Internationalization).
|
||||
|
||||
### Postfix gotcha
|
||||
|
||||
Postfix has supported `SMTPUTF8` for a long time, but it has a peculiarity that it does not always advertise that it does so. However, rather surprisingly, if you use UTF-8 in the conversation, it will work anyway.
|
||||
|
|
@ -1 +1 @@
|
|||
6.9.2
|
||||
6.10.0
|
||||
|
|
|
|||
|
|
@ -3,25 +3,32 @@
|
|||
/**
|
||||
* Portuguese (European) PHPMailer language file: refer to English translation for definitive list
|
||||
* @package PHPMailer
|
||||
* @author Jonadabe <jonadabe@hotmail.com>
|
||||
* @author João Vieira <mail@joaovieira.eu>
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'Erro do SMTP: Não foi possível realizar a autenticação.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'Erro do SMTP: Não foi possível realizar ligação com o servidor SMTP.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'Erro do SMTP: Os dados foram rejeitados.';
|
||||
$PHPMAILER_LANG['empty_message'] = 'A mensagem no e-mail está vazia.';
|
||||
$PHPMAILER_LANG['authenticate'] = 'Erro SMTP: Falha na autenticação.';
|
||||
$PHPMAILER_LANG['buggy_php'] = 'A sua versão do PHP tem um bug que pode causar mensagens corrompidas. Para resolver, utilize o envio por SMTP, desative a opção mail.add_x_header no ficheiro php.ini, mude para MacOS ou Linux, ou atualize o PHP para a versão 7.0.17+ ou 7.1.3+.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'Erro SMTP: Não foi possível ligar ao servidor SMTP.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'Erro SMTP: Dados não aceites.';
|
||||
$PHPMAILER_LANG['empty_message'] = 'A mensagem de e-mail está vazia.';
|
||||
$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Não foi possível executar: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Não foi possível aceder o ficheiro: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Abertura do ficheiro: Não foi possível abrir o ficheiro: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'Ocorreram falhas nos endereços dos seguintes remententes: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Não foi possível iniciar uma instância da função mail.';
|
||||
$PHPMAILER_LANG['invalid_address'] = 'Não foi enviado nenhum e-mail para o endereço de e-mail inválido: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Tem de fornecer pelo menos um endereço como destinatário do e-mail.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'Erro do SMTP: O endereço do seguinte destinatário falhou: ';
|
||||
$PHPMAILER_LANG['signing'] = 'Erro ao assinar: ';
|
||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.';
|
||||
$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: ';
|
||||
$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: ';
|
||||
$PHPMAILER_LANG['extension_missing'] = 'Extensão em falta: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Não foi possível aceder ao ficheiro: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Erro ao abrir o ficheiro: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'O envio falhou para o seguinte endereço do remetente: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.';
|
||||
$PHPMAILER_LANG['invalid_address'] = 'Endereço de e-mail inválido: ';
|
||||
$PHPMAILER_LANG['invalid_header'] = 'Nome ou valor do cabeçalho inválido.';
|
||||
$PHPMAILER_LANG['invalid_hostentry'] = 'Entrada de host inválida: ';
|
||||
$PHPMAILER_LANG['invalid_host'] = 'Host inválido: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = 'O cliente de e-mail não é suportado.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Deve fornecer pelo menos um endereço de destinatário.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'Erro SMTP: Falha no envio para os seguintes destinatários: ';
|
||||
$PHPMAILER_LANG['signing'] = 'Erro ao assinar: ';
|
||||
$PHPMAILER_LANG['smtp_code'] = 'Código SMTP: ';
|
||||
$PHPMAILER_LANG['smtp_code_ex'] = 'Informações adicionais SMTP: ';
|
||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'Falha na função SMTP connect().';
|
||||
$PHPMAILER_LANG['smtp_detail'] = 'Detalhes: ';
|
||||
$PHPMAILER_LANG['smtp_error'] = 'Erro do servidor SMTP: ';
|
||||
$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: ';
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ class PHPMailer
|
|||
* You can set your own, but it must be in the format "<id@domain>",
|
||||
* as defined in RFC5322 section 3.6.4 or it will be ignored.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/rfc5322#section-3.6.4
|
||||
* @see https://www.rfc-editor.org/rfc/rfc5322#section-3.6.4
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
|
|
@ -387,7 +387,7 @@ class PHPMailer
|
|||
* 'DELAY' will notify you if there is an unusual delay in delivery, but the actual
|
||||
* delivery's outcome (success or failure) is not yet decided.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/rfc3461 See section 4.1 for more information about NOTIFY
|
||||
* @see https://www.rfc-editor.org/rfc/rfc3461.html#section-4.1 for more information about NOTIFY
|
||||
*/
|
||||
public $dsn = '';
|
||||
|
||||
|
|
@ -580,6 +580,10 @@ class PHPMailer
|
|||
* May be a callable to inject your own validator, but there are several built-in validators.
|
||||
* The default validator uses PHP's FILTER_VALIDATE_EMAIL filter_var option.
|
||||
*
|
||||
* If CharSet is UTF8, the validator is left at the default value,
|
||||
* and you send to addresses that use non-ASCII local parts, then
|
||||
* PHPMailer automatically changes to the 'eai' validator.
|
||||
*
|
||||
* @see PHPMailer::validateAddress()
|
||||
*
|
||||
* @var string|callable
|
||||
|
|
@ -659,6 +663,14 @@ class PHPMailer
|
|||
*/
|
||||
protected $ReplyToQueue = [];
|
||||
|
||||
/**
|
||||
* Whether the need for SMTPUTF8 has been detected. Set by
|
||||
* preSend() if necessary.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $UseSMTPUTF8 = false;
|
||||
|
||||
/**
|
||||
* The array of attachments.
|
||||
*
|
||||
|
|
@ -756,7 +768,7 @@ class PHPMailer
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '6.9.2';
|
||||
const VERSION = '6.10.0';
|
||||
|
||||
/**
|
||||
* Error severity: message only, continue processing.
|
||||
|
|
@ -1110,7 +1122,8 @@ class PHPMailer
|
|||
$params = [$kind, $address, $name];
|
||||
//Enqueue addresses with IDN until we know the PHPMailer::$CharSet.
|
||||
//Domain is assumed to be whatever is after the last @ symbol in the address
|
||||
if (static::idnSupported() && $this->has8bitChars(substr($address, ++$pos))) {
|
||||
if ($this->has8bitChars(substr($address, ++$pos))) {
|
||||
if (static::idnSupported()) {
|
||||
if ('Reply-To' !== $kind) {
|
||||
if (!array_key_exists($address, $this->RecipientsQueue)) {
|
||||
$this->RecipientsQueue[$address] = $params;
|
||||
|
|
@ -1122,7 +1135,9 @@ class PHPMailer
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
//We have an 8-bit domain, but we are missing the necessary extensions to support it
|
||||
//Or we are already sending to this address
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1160,6 +1175,15 @@ class PHPMailer
|
|||
*/
|
||||
protected function addAnAddress($kind, $address, $name = '')
|
||||
{
|
||||
if (
|
||||
self::$validator === 'php' &&
|
||||
((bool) preg_match('/[\x80-\xFF]/', $address))
|
||||
) {
|
||||
//The caller has not altered the validator and is sending to an address
|
||||
//with UTF-8, so assume that they want UTF-8 support instead of failing
|
||||
$this->CharSet = self::CHARSET_UTF8;
|
||||
self::$validator = 'eai';
|
||||
}
|
||||
if (!in_array($kind, ['to', 'cc', 'bcc', 'Reply-To'])) {
|
||||
$error_message = sprintf(
|
||||
'%s: %s',
|
||||
|
|
@ -1362,6 +1386,7 @@ class PHPMailer
|
|||
* * `pcre` Use old PCRE implementation;
|
||||
* * `php` Use PHP built-in FILTER_VALIDATE_EMAIL;
|
||||
* * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements.
|
||||
* * `eai` Use a pattern similar to the HTML5 spec for 'email' and to firefox, extended to support EAI (RFC6530).
|
||||
* * `noregex` Don't use a regex: super fast, really dumb.
|
||||
* Alternatively you may pass in a callable to inject your own validator, for example:
|
||||
*
|
||||
|
|
@ -1432,6 +1457,24 @@ class PHPMailer
|
|||
'[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD',
|
||||
$address
|
||||
);
|
||||
case 'eai':
|
||||
/*
|
||||
* This is the pattern used in the HTML5 spec for validation of 'email' type
|
||||
* form input elements (as above), modified to accept Unicode email addresses.
|
||||
* This is also more lenient than Firefox' html5 spec, in order to make the regex faster.
|
||||
* 'eai' is an acronym for Email Address Internationalization.
|
||||
* This validator is selected automatically if you attempt to use recipient addresses
|
||||
* that contain Unicode characters in the local part.
|
||||
*
|
||||
* @see https://html.spec.whatwg.org/#e-mail-state-(type=email)
|
||||
* @see https://en.wikipedia.org/wiki/International_email
|
||||
*/
|
||||
return (bool) preg_match(
|
||||
'/^[-\p{L}\p{N}\p{M}.!#$%&\'*+\/=?^_`{|}~]+@[\p{L}\p{N}\p{M}](?:[\p{L}\p{N}\p{M}-]{0,61}' .
|
||||
'[\p{L}\p{N}\p{M}])?(?:\.[\p{L}\p{N}\p{M}]' .
|
||||
'(?:[-\p{L}\p{N}\p{M}]{0,61}[\p{L}\p{N}\p{M}])?)*$/usD',
|
||||
$address
|
||||
);
|
||||
case 'php':
|
||||
default:
|
||||
return filter_var($address, FILTER_VALIDATE_EMAIL) !== false;
|
||||
|
|
@ -1565,9 +1608,26 @@ class PHPMailer
|
|||
$this->error_count = 0; //Reset errors
|
||||
$this->mailHeader = '';
|
||||
|
||||
//The code below tries to support full use of Unicode,
|
||||
//while remaining compatible with legacy SMTP servers to
|
||||
//the greatest degree possible: If the message uses
|
||||
//Unicode in the local parts of any addresses, it is sent
|
||||
//using SMTPUTF8. If not, it it sent using
|
||||
//punycode-encoded domains and plain SMTP.
|
||||
if (
|
||||
static::CHARSET_UTF8 === strtolower($this->CharSet) &&
|
||||
($this->anyAddressHasUnicodeLocalPart($this->RecipientsQueue) ||
|
||||
$this->anyAddressHasUnicodeLocalPart(array_keys($this->all_recipients)) ||
|
||||
$this->anyAddressHasUnicodeLocalPart($this->ReplyToQueue) ||
|
||||
$this->addressHasUnicodeLocalPart($this->From))
|
||||
) {
|
||||
$this->UseSMTPUTF8 = true;
|
||||
}
|
||||
//Dequeue recipient and Reply-To addresses with IDN
|
||||
foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) {
|
||||
if (!$this->UseSMTPUTF8) {
|
||||
$params[1] = $this->punyencodeAddress($params[1]);
|
||||
}
|
||||
call_user_func_array([$this, 'addAnAddress'], $params);
|
||||
}
|
||||
if (count($this->to) + count($this->cc) + count($this->bcc) < 1) {
|
||||
|
|
@ -1871,7 +1931,7 @@ class PHPMailer
|
|||
*/
|
||||
protected static function isPermittedPath($path)
|
||||
{
|
||||
//Matches scheme definition from https://tools.ietf.org/html/rfc3986#section-3.1
|
||||
//Matches scheme definition from https://www.rfc-editor.org/rfc/rfc3986#section-3.1
|
||||
return !preg_match('#^[a-z][a-z\d+.-]*://#i', $path);
|
||||
}
|
||||
|
||||
|
|
@ -2058,6 +2118,11 @@ class PHPMailer
|
|||
if (!$this->smtpConnect($this->SMTPOptions)) {
|
||||
throw new Exception($this->lang('smtp_connect_failed'), self::STOP_CRITICAL);
|
||||
}
|
||||
//If we have recipient addresses that need Unicode support,
|
||||
//but the server doesn't support it, stop here
|
||||
if ($this->UseSMTPUTF8 && !$this->smtp->getServerExt('SMTPUTF8')) {
|
||||
throw new Exception($this->lang('no_smtputf8'), self::STOP_CRITICAL);
|
||||
}
|
||||
//Sender already validated in preSend()
|
||||
if ('' === $this->Sender) {
|
||||
$smtp_from = $this->From;
|
||||
|
|
@ -2159,6 +2224,7 @@ class PHPMailer
|
|||
$this->smtp->setDebugLevel($this->SMTPDebug);
|
||||
$this->smtp->setDebugOutput($this->Debugoutput);
|
||||
$this->smtp->setVerp($this->do_verp);
|
||||
$this->smtp->setSMTPUTF8($this->UseSMTPUTF8);
|
||||
if ($this->Host === null) {
|
||||
$this->Host = 'localhost';
|
||||
}
|
||||
|
|
@ -2356,6 +2422,7 @@ class PHPMailer
|
|||
'smtp_detail' => 'Detail: ',
|
||||
'smtp_error' => 'SMTP server error: ',
|
||||
'variable_set' => 'Cannot set or reset variable: ',
|
||||
'no_smtputf8' => 'Server does not support SMTPUTF8 needed to send to Unicode addresses',
|
||||
];
|
||||
if (empty($lang_path)) {
|
||||
//Calculate an absolute path so it can work if CWD is not here
|
||||
|
|
@ -2705,7 +2772,7 @@ class PHPMailer
|
|||
}
|
||||
|
||||
//Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4
|
||||
//https://tools.ietf.org/html/rfc5322#section-3.6.4
|
||||
//https://www.rfc-editor.org/rfc/rfc5322#section-3.6.4
|
||||
if (
|
||||
'' !== $this->MessageID &&
|
||||
preg_match(
|
||||
|
|
@ -2870,7 +2937,9 @@ class PHPMailer
|
|||
$bodyEncoding = $this->Encoding;
|
||||
$bodyCharSet = $this->CharSet;
|
||||
//Can we do a 7-bit downgrade?
|
||||
if (static::ENCODING_8BIT === $bodyEncoding && !$this->has8bitChars($this->Body)) {
|
||||
if ($this->UseSMTPUTF8) {
|
||||
$bodyEncoding = static::ENCODING_8BIT;
|
||||
} elseif (static::ENCODING_8BIT === $bodyEncoding && !$this->has8bitChars($this->Body)) {
|
||||
$bodyEncoding = static::ENCODING_7BIT;
|
||||
//All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit
|
||||
$bodyCharSet = static::CHARSET_ASCII;
|
||||
|
|
@ -3507,7 +3576,8 @@ class PHPMailer
|
|||
/**
|
||||
* Encode a header value (not including its label) optimally.
|
||||
* Picks shortest of Q, B, or none. Result includes folding if needed.
|
||||
* See RFC822 definitions for phrase, comment and text positions.
|
||||
* See RFC822 definitions for phrase, comment and text positions,
|
||||
* and RFC2047 for inline encodings.
|
||||
*
|
||||
* @param string $str The header value to encode
|
||||
* @param string $position What context the string will be used in
|
||||
|
|
@ -3516,6 +3586,11 @@ class PHPMailer
|
|||
*/
|
||||
public function encodeHeader($str, $position = 'text')
|
||||
{
|
||||
$position = strtolower($position);
|
||||
if ($this->UseSMTPUTF8 && !("comment" === $position)) {
|
||||
return trim(static::normalizeBreaks($str));
|
||||
}
|
||||
|
||||
$matchcount = 0;
|
||||
switch (strtolower($position)) {
|
||||
case 'phrase':
|
||||
|
|
@ -4180,7 +4255,7 @@ class PHPMailer
|
|||
if ('smtp' === $this->Mailer && null !== $this->smtp) {
|
||||
$lasterror = $this->smtp->getError();
|
||||
if (!empty($lasterror['error'])) {
|
||||
$msg .= $this->lang('smtp_error') . $lasterror['error'];
|
||||
$msg .= ' ' . $this->lang('smtp_error') . $lasterror['error'];
|
||||
if (!empty($lasterror['detail'])) {
|
||||
$msg .= ' ' . $this->lang('smtp_detail') . $lasterror['detail'];
|
||||
}
|
||||
|
|
@ -4267,6 +4342,45 @@ class PHPMailer
|
|||
return filter_var('https://' . $host, FILTER_VALIDATE_URL) !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the supplied address uses Unicode in the local part.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function addressHasUnicodeLocalPart($address)
|
||||
{
|
||||
return (bool) preg_match('/[\x80-\xFF].*@/', $address);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether any of the supplied addresses use Unicode in the local part.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function anyAddressHasUnicodeLocalPart($addresses)
|
||||
{
|
||||
foreach ($addresses as $address) {
|
||||
if (is_array($address)) {
|
||||
$address = $address[0];
|
||||
}
|
||||
if ($this->addressHasUnicodeLocalPart($address)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the message requires SMTPUTF8 based on what's known so far.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function needsSMTPUTF8()
|
||||
{
|
||||
return $this->UseSMTPUTF8;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get an error message in the current language.
|
||||
*
|
||||
|
|
@ -4910,7 +5024,7 @@ class PHPMailer
|
|||
* Uses the 'relaxed' algorithm from RFC6376 section 3.4.2.
|
||||
* Canonicalized headers should *always* use CRLF, regardless of mailer setting.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/rfc6376#section-3.4.2
|
||||
* @see https://www.rfc-editor.org/rfc/rfc6376#section-3.4.2
|
||||
*
|
||||
* @param string $signHeader Header
|
||||
*
|
||||
|
|
@ -4922,7 +5036,7 @@ class PHPMailer
|
|||
$signHeader = static::normalizeBreaks($signHeader, self::CRLF);
|
||||
//Unfold header lines
|
||||
//Note PCRE \s is too broad a definition of whitespace; RFC5322 defines it as `[ \t]`
|
||||
//@see https://tools.ietf.org/html/rfc5322#section-2.2
|
||||
//@see https://www.rfc-editor.org/rfc/rfc5322#section-2.2
|
||||
//That means this may break if you do something daft like put vertical tabs in your headers.
|
||||
$signHeader = preg_replace('/\r\n[ \t]+/', ' ', $signHeader);
|
||||
//Break headers out into an array
|
||||
|
|
@ -4954,7 +5068,7 @@ class PHPMailer
|
|||
* Uses the 'simple' algorithm from RFC6376 section 3.4.3.
|
||||
* Canonicalized bodies should *always* use CRLF, regardless of mailer setting.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/rfc6376#section-3.4.3
|
||||
* @see https://www.rfc-editor.org/rfc/rfc6376#section-3.4.3
|
||||
*
|
||||
* @param string $body Message Body
|
||||
*
|
||||
|
|
@ -4990,7 +5104,7 @@ class PHPMailer
|
|||
$DKIMquery = 'dns/txt'; //Query method
|
||||
$DKIMtime = time();
|
||||
//Always sign these headers without being asked
|
||||
//Recommended list from https://tools.ietf.org/html/rfc6376#section-5.4.1
|
||||
//Recommended list from https://www.rfc-editor.org/rfc/rfc6376#section-5.4.1
|
||||
$autoSignHeaders = [
|
||||
'from',
|
||||
'to',
|
||||
|
|
@ -5096,7 +5210,7 @@ class PHPMailer
|
|||
}
|
||||
//The DKIM-Signature header is included in the signature *except for* the value of the `b` tag
|
||||
//which is appended after calculating the signature
|
||||
//https://tools.ietf.org/html/rfc6376#section-3.5
|
||||
//https://www.rfc-editor.org/rfc/rfc6376#section-3.5
|
||||
$dkimSignatureHeader = 'DKIM-Signature: v=1;' .
|
||||
' d=' . $this->DKIM_domain . ';' .
|
||||
' s=' . $this->DKIM_selector . ';' . static::$LE .
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class POP3
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '6.9.2';
|
||||
const VERSION = '6.10.0';
|
||||
|
||||
/**
|
||||
* Default POP3 port number.
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class SMTP
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '6.9.2';
|
||||
const VERSION = '6.10.0';
|
||||
|
||||
/**
|
||||
* SMTP line break constant.
|
||||
|
|
@ -62,7 +62,7 @@ class SMTP
|
|||
* The maximum line length allowed by RFC 5321 section 4.5.3.1.6,
|
||||
* *excluding* a trailing CRLF break.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/rfc5321#section-4.5.3.1.6
|
||||
* @see https://www.rfc-editor.org/rfc/rfc5321#section-4.5.3.1.6
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
|
|
@ -72,7 +72,7 @@ class SMTP
|
|||
* The maximum line length allowed for replies in RFC 5321 section 4.5.3.1.5,
|
||||
* *including* a trailing CRLF line break.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/rfc5321#section-4.5.3.1.5
|
||||
* @see https://www.rfc-editor.org/rfc/rfc5321#section-4.5.3.1.5
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
|
|
@ -159,6 +159,15 @@ class SMTP
|
|||
*/
|
||||
public $do_verp = false;
|
||||
|
||||
/**
|
||||
* Whether to use SMTPUTF8.
|
||||
*
|
||||
* @see https://www.rfc-editor.org/rfc/rfc6531
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $do_smtputf8 = false;
|
||||
|
||||
/**
|
||||
* The timeout value for connection, in seconds.
|
||||
* Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2.
|
||||
|
|
@ -373,7 +382,7 @@ class SMTP
|
|||
}
|
||||
//Anything other than a 220 response means something went wrong
|
||||
//RFC 5321 says the server will wait for us to send a QUIT in response to a 554 error
|
||||
//https://tools.ietf.org/html/rfc5321#section-3.1
|
||||
//https://www.rfc-editor.org/rfc/rfc5321#section-3.1
|
||||
if ($responseCode === 554) {
|
||||
$this->quit();
|
||||
}
|
||||
|
|
@ -582,7 +591,7 @@ class SMTP
|
|||
}
|
||||
//Send encoded username and password
|
||||
if (
|
||||
//Format from https://tools.ietf.org/html/rfc4616#section-2
|
||||
//Format from https://www.rfc-editor.org/rfc/rfc4616#section-2
|
||||
//We skip the first field (it's forgery), so the string starts with a null byte
|
||||
!$this->sendCommand(
|
||||
'User & Password',
|
||||
|
|
@ -795,7 +804,7 @@ class SMTP
|
|||
//Send the lines to the server
|
||||
foreach ($lines_out as $line_out) {
|
||||
//Dot-stuffing as per RFC5321 section 4.5.2
|
||||
//https://tools.ietf.org/html/rfc5321#section-4.5.2
|
||||
//https://www.rfc-editor.org/rfc/rfc5321#section-4.5.2
|
||||
if (!empty($line_out) && $line_out[0] === '.') {
|
||||
$line_out = '.' . $line_out;
|
||||
}
|
||||
|
|
@ -913,7 +922,15 @@ class SMTP
|
|||
* $from. Returns true if successful or false otherwise. If True
|
||||
* the mail transaction is started and then one or more recipient
|
||||
* commands may be called followed by a data command.
|
||||
* Implements RFC 821: MAIL <SP> FROM:<reverse-path> <CRLF>.
|
||||
* Implements RFC 821: MAIL <SP> FROM:<reverse-path> <CRLF> and
|
||||
* two extensions, namely XVERP and SMTPUTF8.
|
||||
*
|
||||
* The server's EHLO response is not checked. If use of either
|
||||
* extensions is enabled even though the server does not support
|
||||
* that, mail submission will fail.
|
||||
*
|
||||
* XVERP is documented at https://www.postfix.org/VERP_README.html
|
||||
* and SMTPUTF8 is specified in RFC 6531.
|
||||
*
|
||||
* @param string $from Source address of this message
|
||||
*
|
||||
|
|
@ -922,10 +939,11 @@ class SMTP
|
|||
public function mail($from)
|
||||
{
|
||||
$useVerp = ($this->do_verp ? ' XVERP' : '');
|
||||
$useSmtputf8 = ($this->do_smtputf8 ? ' SMTPUTF8' : '');
|
||||
|
||||
return $this->sendCommand(
|
||||
'MAIL FROM',
|
||||
'MAIL FROM:<' . $from . '>' . $useVerp,
|
||||
'MAIL FROM:<' . $from . '>' . $useSmtputf8 . $useVerp,
|
||||
250
|
||||
);
|
||||
}
|
||||
|
|
@ -1364,6 +1382,26 @@ class SMTP
|
|||
return $this->do_verp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable or disable use of SMTPUTF8.
|
||||
*
|
||||
* @param bool $enabled
|
||||
*/
|
||||
public function setSMTPUTF8($enabled = false)
|
||||
{
|
||||
$this->do_smtputf8 = $enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get SMTPUTF8 use.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getSMTPUTF8()
|
||||
{
|
||||
return $this->do_smtputf8;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set error messages and codes.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,3 +1,22 @@
|
|||
6.9.4 (2025-05-13)
|
||||
- Update donation link.
|
||||
|
||||
6.9.3 (2025-04-20)
|
||||
- New fix for "Deserialization of untrusted data" (check on valid protocols).
|
||||
- Removed global phar configuration.
|
||||
|
||||
6.9.2 (2025-04-18)
|
||||
- Quick fix for "Deserialization of untrusted data" security vulnerability reported by Positive Technologies.
|
||||
- Disable phar protocol globally.
|
||||
|
||||
6.9.1 (2025-04-03)
|
||||
- Fixed "Path Traversal" security vulnerability reported by Positive Technologies.
|
||||
|
||||
6.9.0 (2025-03-30)
|
||||
- Added PHP 8.4 testing.
|
||||
- Removed tcpdf_import.php and tcpdf_parser.php files (for a parser check the tc-lib-pdf-parser project instead).
|
||||
- Fix composer.json.
|
||||
|
||||
6.8.2 (2025-01-26)
|
||||
- Fix some annotation flags values.
|
||||
- Remove examples from packaging.
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
# TCPDF
|
||||
*PHP PDF Library*
|
||||
|
||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_donations¤cy_code=GBP&business=paypal@tecnick.com&item_name=donation%20for%20TCPDF%20project)
|
||||
*Please consider supporting this project by making a donation via [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_donations¤cy_code=GBP&business=paypal@tecnick.com&item_name=donation%20for%20TCPDF%20project)*
|
||||
[](https://www.paypal.com/donate/?hosted_button_id=NZUEC5XS8MFBJ)
|
||||
*Please consider supporting this project by making a donation via [PayPal](https://www.paypal.com/donate/?hosted_button_id=NZUEC5XS8MFBJ)*
|
||||
|
||||
* **category** Library
|
||||
* **author** Nicola Asuni <info@tecnick.com>
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
6.8.2
|
||||
6.9.4
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
"barcodes"
|
||||
],
|
||||
"homepage": "http://www.tcpdf.org/",
|
||||
"version": "6.8.2",
|
||||
"version": "6.9.4",
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"authors": [
|
||||
{
|
||||
|
|
@ -30,8 +30,6 @@
|
|||
"config",
|
||||
"include",
|
||||
"tcpdf.php",
|
||||
"tcpdf_parser.php",
|
||||
"tcpdf_import.php",
|
||||
"tcpdf_barcodes_1d.php",
|
||||
"tcpdf_barcodes_2d.php",
|
||||
"include/tcpdf_colors.php",
|
||||
|
|
@ -44,10 +42,5 @@
|
|||
"include/barcodes/pdf417.php",
|
||||
"include/barcodes/qrcode.php"
|
||||
]
|
||||
},
|
||||
"archive": {
|
||||
"exclude": [
|
||||
"/examples"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class TCPDF_STATIC {
|
|||
* Current TCPDF version.
|
||||
* @private static
|
||||
*/
|
||||
private static $tcpdf_version = '6.8.2';
|
||||
private static $tcpdf_version = '6.9.4';
|
||||
|
||||
/**
|
||||
* String alias for total number of pages.
|
||||
|
|
@ -2652,7 +2652,6 @@ class TCPDF_STATIC {
|
|||
return $page_mode;
|
||||
}
|
||||
|
||||
|
||||
} // END OF TCPDF_STATIC CLASS
|
||||
|
||||
//============================================================+
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue