Vendor templates stage 2: keep client vendors in step with the template they were made from - saving a template updates the fields its vendors still shared, the template window gets the vendor window's tabs, a template page shows each client vendor as in step or the fields it differs in with Bring in line, Link and Unlink, lists hand-made vendors that look like it to link, and sets who should have it (no one, every client or clients with chosen tags) with coverage and Add to clients for those missing; the list gains Required and Out of step tabs, a client vendor shows its differences with Update from template, a client's Vendors list and overview show vendors missing, Add to clients no longer skips a client whose vendor from the template was archived, and database 3.3.5 adds vendor_template_required, vendor_template_required_tags and a vendor_template_id key on vendors

This commit is contained in:
johnnyq
2026-10-20 11:20:45 -04:00
parent dfc708145d
commit cd03a7765d
15 changed files with 1242 additions and 101 deletions

View File

@@ -0,0 +1,37 @@
<?php
/*
* ITFlow - Database update to version 3.3.5 (from 3.3.4)
* Included by admin/database_updates.php - do not access directly
*/
defined('FROM_DB_UPDATER') || die("Direct file access is not allowed");
// Who should have a vendor from a vendor template (functions/vendor_template.php).
//
// 1. No one in particular (0), every client (1), or the clients with one of
// its client tags (2). Checked first, so the step can run again.
$itflow_column = mysqli_query($mysqli, "SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'vendor_templates' AND COLUMN_NAME = 'vendor_template_required' LIMIT 1");
if (!$itflow_column || mysqli_num_rows($itflow_column) === 0) {
mysqli_query($mysqli, "ALTER TABLE `vendor_templates` ADD `vendor_template_required` tinyint(1) NOT NULL DEFAULT 0 AFTER `vendor_template_notes`");
}
// 2. ...and those tags.
mysqli_query($mysqli, "CREATE TABLE IF NOT EXISTS `vendor_template_required_tags` (
`vendor_template_id` int(11) NOT NULL,
`tag_id` int(11) NOT NULL,
PRIMARY KEY (`vendor_template_id`, `tag_id`),
KEY `tag_id` (`tag_id`),
CONSTRAINT `vendor_template_required_tags_ibfk_1` FOREIGN KEY (`vendor_template_id`) REFERENCES `vendor_templates` (`vendor_template_id`) ON DELETE CASCADE,
CONSTRAINT `vendor_template_required_tags_ibfk_2` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`tag_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci");
// 3. A client's vendors are looked up by the template they came from.
$itflow_index = mysqli_query($mysqli, "SELECT 1 FROM information_schema.STATISTICS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'vendors' AND INDEX_NAME = 'vendor_template_id' LIMIT 1");
if (!$itflow_index || mysqli_num_rows($itflow_index) === 0) {
mysqli_query($mysqli, "ALTER TABLE `vendors` ADD KEY `vendor_template_id` (`vendor_template_id`, `vendor_client_id`)");
}
unset($itflow_column, $itflow_index);

View File

@@ -6,8 +6,9 @@
* template, or blanks when new), $vt_id (0 when new) and, editing, $vt_vendors
* (how many vendors were made from it). The same tabs as a vendor's own
* window - Details, Support, Account and Notes - as a vendor made from it
* gets every one of them. Editing, the fields can be changed on the vendors
* made from it too. Posts to admin/post.php (admin/post/vendor_template.php).
* gets every one of them. Editing, the vendors made from it follow the
* changes (vendorTemplateFollow()). Posts to admin/post.php
* (admin/post/vendor_template.php).
*/
isset($mysqli) || die("Direct file access is not allowed");
@@ -146,20 +147,13 @@ $phone_value = ($vt['phone'] ?? '') !== '' ? escapeHtml(formatPhoneNumber($vt['p
</div>
<?php if ($vt_id && !empty($vt_vendors)) { ?>
<!-- The vendors made from it, changed too - the fields ticked -->
<div class="border rounded p-3 mt-3 bg-body-tertiary" data-vendor-template-push>
<div class="fw-semibold mb-1"><i class="fas fa-fw fa-sync-alt text-secondary me-1"></i>Change them on the <?= $vt_vendors ?> vendor<?= $vt_vendors === 1 ? '' : 's' ?> made from it too</div>
<div class="small text-body-secondary mb-2">Ticked fields are set to what is here on each one - what a client's vendor says now is replaced.</div>
<div class="row row-cols-2 row-cols-md-3 g-1 small">
<?php foreach (vendorTemplateFieldLabels() as $key => $field) { ?>
<div class="col">
<div class="form-check mb-0">
<input class="form-check-input" type="checkbox" name="push[]" value="<?= $key ?>" id="<?= $form_id ?>Push<?= $key ?>">
<label class="form-check-label" for="<?= $form_id ?>Push<?= $key ?>"><i class="fas fa-fw <?= $field['icon'] ?> text-secondary me-1"></i><?= $field['label'] ?></label>
</div>
</div>
<?php } ?>
<!-- The vendors made from it follow it, where they still say what it did -->
<div class="border rounded p-3 mt-3 bg-body-tertiary" data-vendor-template-follow>
<div class="form-check form-switch mb-1">
<input class="form-check-input" type="checkbox" role="switch" name="follow" value="1" id="<?= $form_id ?>Follow" checked>
<label class="form-check-label fw-semibold" for="<?= $form_id ?>Follow">Change the <?= $vt_vendors ?> vendor<?= $vt_vendors === 1 ? '' : 's' ?> made from it too</label>
</div>
<div class="small text-body-secondary">Each field you change here changes on the vendors that still say what it said - one a client has its own for is left as it is, and shows as out of step on the template's page. Account numbers, PINs and account managers are always each client's own.</div>
</div>
<?php } ?>

View File

@@ -0,0 +1,89 @@
<?php
/*
* Who should have a vendor from a template - no one in particular, every
* client, or the clients with one of the client tags picked. ?id= the
* template. Saved by save_vendor_template_required
* (admin/post/vendor_template.php); the template's page, the clients'
* Vendors and their overviews then show the clients missing one.
*/
require_once '../../includes/modal_header.php';
$template = vendorTemplateInfo($_GET['id'] ?? 0);
ob_start();
if (!$template) { ?>
<div class="modal-header bg-dark">
<h5 class="modal-title"><i class="fa fa-fw fa-clipboard-check me-2"></i>Who should have it</h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body text-center text-secondary py-5">That vendor template no longer exists.</div>
<?php } else {
$vendor_template_id = intval($template['vendor_template_id']);
$required = intval($template['vendor_template_required']);
$tag_ids = array_keys(vendorTemplateRequiredTags([$vendor_template_id])[$vendor_template_id]);
?>
<div class="modal-header bg-dark">
<h5 class="modal-title text-truncate"><i class="fa fa-fw fa-clipboard-check me-2"></i>Who should have it <small class="ms-1 opacity-75"><?= escapeHtml($template['vendor_template_name']) ?></small></h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
</div>
<form action="/admin/post.php" method="post" autocomplete="off" data-vendor-template-required>
<input type="hidden" name="csrf_token" value="<?= $_SESSION['csrf_token'] ?>">
<input type="hidden" name="vendor_template_id" value="<?= $vendor_template_id ?>">
<div class="modal-body">
<div class="mb-3">
<label class="form-label">Every one of these should have it as a vendor</label>
<div class="input-group">
<span class="input-group-text"><i class="fa fa-fw fa-users"></i></span>
<select class="form-select select2" name="required" id="vendorTemplateRequired">
<option value="<?= VENDOR_TEMPLATE_REQUIRED_NONE ?>" <?= $required === VENDOR_TEMPLATE_REQUIRED_NONE ? 'selected' : '' ?>>No one in particular</option>
<option value="<?= VENDOR_TEMPLATE_REQUIRED_EVERY ?>" <?= $required === VENDOR_TEMPLATE_REQUIRED_EVERY ? 'selected' : '' ?>>Every client</option>
<option value="<?= VENDOR_TEMPLATE_REQUIRED_TAGGED ?>" <?= $required === VENDOR_TEMPLATE_REQUIRED_TAGGED ? 'selected' : '' ?>>Clients with a tag</option>
</select>
</div>
<div class="form-text">Leads and archived clients don't count. The template's page, each client's Vendors and their overview show who is missing it.</div>
</div>
<div class="mb-1" id="vendorTemplateRequiredTags" <?= $required === VENDOR_TEMPLATE_REQUIRED_TAGGED ? '' : 'hidden' ?>>
<label class="form-label">Client tags</label>
<div class="input-group">
<span class="input-group-text"><i class="fa fa-fw fa-tags"></i></span>
<select class="form-select select2" name="tags[]" multiple data-placeholder="- Pick client tags -">
<?php foreach (tagOptionsFor('client', $tag_ids) as $tag) { ?>
<?= tagOptionHtml($tag, $tag_ids) ?>
<?php } ?>
</select>
</div>
<div class="form-text">Clients with any of them - VoIP, say, for the phone carrier every client on your hosted phones has.</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" name="save_vendor_template_required" class="btn btn-primary text-bold"><i class="fa fa-check me-2"></i>Save</button>
<button type="button" class="btn btn-light" data-bs-dismiss="modal"><i class="fa fa-times me-2"></i>Cancel</button>
</div>
</form>
<script>
(function () {
// The tags are for "Clients with a tag" only
var required = document.getElementById('vendorTemplateRequired');
var tags = document.getElementById('vendorTemplateRequiredTags');
if (required && tags) {
required.addEventListener('change', function () {
tags.hidden = required.value !== '<?= VENDOR_TEMPLATE_REQUIRED_TAGGED ?>';
});
}
})();
</script>
<?php }
require_once '../../../includes/modal_footer.php';

View File

@@ -1,11 +1,14 @@
<?php
/*
* Vendor templates (Admin > Vendor Templates) - making, changing (and the
* fields ticked on the vendors made from it too), copying, archiving,
* restoring and deleting them. The work is in functions/vendor_template.php;
* a vendor is made from one by add_vendor, add_vendor_from_template and
* add_vendor_template_to_clients (agent/post/vendor.php).
* Vendor templates (Admin > Vendor Templates) - making, changing (the
* vendors made from it that still said what it did changing with it),
* copying, archiving, restoring and deleting them, and saying who should have
* one. The work is in functions/vendor_template.php; a vendor is made from
* one by add_vendor, add_vendor_from_template and
* add_vendor_template_to_clients, and brought in line with one, linked to one
* or unlinked by update_vendors_from_template, link_vendors_to_template and
* unlink_vendor_template (agent/post/vendor.php).
*/
defined('FROM_POST_HANDLER') || die("Direct file access is not allowed");
@@ -41,18 +44,15 @@ if (isset($_POST['add_vendor_template']) || isset($_POST['edit_vendor_template']
$renamed = $before['vendor_template_name'] !== $name ? ' (was ' . $before['vendor_template_name'] . ')' : '';
logAudit("Vendor Template", "Edit", "$session_name edited vendor template " . escapeSql($name . $renamed) . ($changed ? ' - ' . escapeSql(mb_strtolower(implode(', ', $changed))) : ''), 0, $vendor_template_id);
// The fields ticked, on every vendor made from it too
$labels = array_map(function ($field) {
return $field['label'];
}, vendorTemplateFieldLabels());
$push = array_values(array_intersect(array_keys($labels), array_map('strval', array_filter((array) ($_POST['push'] ?? []), 'is_scalar'))));
$pushed = $push ? vendorTemplatePush($vendor_template_id, $push) : [];
$what = mb_strtolower(implode(', ', array_intersect_key($labels, array_flip($push))));
foreach ($pushed as $vendor_id => $vendor) {
logAudit("Vendor", "Edit", "$session_name updated vendor " . escapeSql($vendor['name']) . " from template " . escapeSql($name) . " - " . escapeSql($what), $vendor['client_id'], $vendor_id);
// The vendors made from it that still said what it did follow it (vendorTemplateFollow())
$followed = !empty($_POST['follow']) ? vendorTemplateFollow($vendor_template_id, vendorTemplateRowFields($before), $fields) : [];
foreach ($followed as $vendor_id => $vendor) {
logAudit("Vendor", "Edit", "$session_name updated vendor " . escapeSql($vendor['name']) . " from template " . escapeSql($name) . " - " . escapeSql(mb_strtolower(implode(', ', $vendor['fields']))), $vendor['client_id'], $vendor_id);
}
$out_of_step = $followed || !empty($_POST['follow']) ? (vendorTemplateOutOfStep([$vendor_template_id])[$vendor_template_id] ?? 0) : 0;
flashAlert("Vendor template <strong>" . escapeHtml($name) . "</strong> saved" . ($pushed ? ", and " . escapeHtml($what) . " changed on " . count($pushed) . " vendor" . (count($pushed) === 1 ? '' : 's') . " made from it" : ''));
flashAlert("Vendor template <strong>" . escapeHtml($name) . "</strong> saved" . ($followed ? ", and " . count($followed) . " vendor" . (count($followed) === 1 ? '' : 's') . " made from it changed with it" : '')
. ($out_of_step ? " - $out_of_step out of step" : ''));
redirect();
}
@@ -125,3 +125,30 @@ if (isset($_GET['delete_vendor_template'])) {
redirect(!empty($_GET['from_page']) ? 'vendor_templates.php' : null);
}
if (isset($_POST['save_vendor_template_required'])) {
// Who should have a vendor from it
validateCSRFToken();
$row = vendorTemplateForRequest($_POST['vendor_template_id'] ?? 0);
$vendor_template_id = intval($row['vendor_template_id']);
$required = intval($_POST['required'] ?? 0);
$tag_ids = array_map('intval', array_filter((array) ($_POST['tags'] ?? []), 'is_scalar'));
if ($required === VENDOR_TEMPLATE_REQUIRED_TAGGED && !array_filter($tag_ids)) {
flashAlert('Pick the client tags - or Every client.', 'error');
redirect();
}
vendorTemplateSetRequired($vendor_template_id, $required, $tag_ids);
$saved = vendorTemplateInfo($vendor_template_id);
$scope = vendorTemplateScopeText($saved['vendor_template_required'], vendorTemplateRequiredTags([$vendor_template_id])[$vendor_template_id]);
$said = $scope !== '' ? "required of " . lcfirst($scope) : 'not required of anyone';
logAudit("Vendor Template", "Edit", "$session_name set vendor template " . escapeSql($row['vendor_template_name']) . " " . escapeSql($said), 0, $vendor_template_id);
flashAlert("<strong>" . escapeHtml($row['vendor_template_name']) . "</strong> is " . escapeHtml($said));
redirect();
}

View File

@@ -5,9 +5,12 @@
* what they are, the support line, hours, SLA, support email and site, any
* account number, PIN and account manager every client shares, and its
* notes), who made it and last changed it, and its use: the clients with a
* vendor made from it - each with its own account number and PIN, or not yet
* - and the license templates that take their vendor from it. It can be
* added to clients from here. The work is in functions/vendor_template.php.
* vendor made from it - each with its own account number and PIN, or not yet,
* and in step with it or saying something else (views, and bringing one or
* several in line) - the vendors made by hand that look like it (linking
* them), who should have it with the clients missing it, and the license
* templates that take their vendor from it. It can be added to clients from
* here. The work is in functions/vendor_template.php.
*/
require_once "includes/inc_all_admin.php";
@@ -30,20 +33,59 @@ $csrf = $_SESSION['csrf_token'];
// Its vendors - the current ones for current clients listed, the rest counted
$all_vendors = vendorTemplateVendors($vendor_template_id);
$vendors = array_filter($all_vendors, function ($vendor) {
$current = array_filter($all_vendors, function ($vendor) {
return !$vendor['archived'] && !$vendor['client_archived'];
});
$set_up = count(array_filter($vendors, function ($vendor) {
$set_up = count(array_filter($current, function ($vendor) {
return $vendor['client_id'] && $vendor['account_number'] !== '';
}));
$client_vendors = count(array_filter($vendors, function ($vendor) {
$client_vendors = count(array_filter($current, function ($vendor) {
return $vendor['client_id'] > 0;
}));
$others = count($all_vendors) - count($vendors);
$out_of_step = count(array_filter($current, function ($vendor) {
return (bool) $vendor['differences'];
}));
$others = count($all_vendors) - count($current);
$license_templates = vendorTemplateLicenseTemplates($vendor_template_id);
// ...seen all at once, the ones out of step, or the ones without the client's account number
$views = [
'' => ['label' => 'All', 'icon' => 'fa-list', 'title' => 'Every current vendor made from it', 'test' => function ($vendor) {
return true;
}],
'out' => ['label' => 'Out of step', 'icon' => 'fa-not-equal', 'title' => 'Saying something other than the template does', 'test' => function ($vendor) {
return (bool) $vendor['differences'];
}],
'account' => ['label' => 'No account number', 'icon' => 'fa-fingerprint', 'title' => "Without the client's account number", 'test' => function ($vendor) {
return $vendor['client_id'] && $vendor['account_number'] === '';
}],
];
$view = is_string($_GET['view'] ?? null) && isset($views[$_GET['view']]) ? $_GET['view'] : '';
$view_counts = [];
foreach ($views as $key => $definition) {
$view_counts[$key] = count(array_filter($current, $definition['test']));
}
$vendors = array_filter($current, $views[$view]['test']);
$view_url = function ($key) use ($vendor_template_id) {
return '?' . http_build_query(array_filter(['vendor_template_id' => $vendor_template_id, 'view' => $key])) . '#vendorTemplateVendors';
};
// Vendors made by hand that look like it - not offered while it is archived
$matches = $archived ? [] : vendorTemplateMatches($vendor_template_id);
// Who should have one - not counted while it is archived
$required = intval($template['vendor_template_required']);
$required_tags = vendorTemplateRequiredTags([$vendor_template_id])[$vendor_template_id];
$scope_text = vendorTemplateScopeText($required, $required_tags);
$coverage = $required && !$archived ? vendorTemplateCoverage($vendor_template_id, $required, array_keys($required_tags)) : null;
$list_limit = 8;
$missing_text = $coverage && $coverage['missing'] ? (count($coverage['missing']) === 1 ? 'the client missing it' : 'the ' . count($coverage['missing']) . ' clients missing it') : '';
$edit_url = "modals/vendor_template/vendor_template_edit.php?id=$vendor_template_id";
$clients_url = "/agent/modals/vendor/vendor_template_clients.php?template_id=$vendor_template_id";
$required_url = "modals/vendor_template/vendor_template_required.php?id=$vendor_template_id";
$update_url = "/agent/modals/vendor/vendor_template_update.php";
$in_line_url = "$update_url?template_id=$vendor_template_id";
// What a vendor from it starts with - the ones it has
$t = $template;
@@ -89,12 +131,23 @@ foreach (vendorTemplateFieldLabels() as $field) {
</div>
<div class="d-flex flex-wrap gap-2 d-print-none">
<?php if (!$archived) { ?>
<button type="button" class="btn btn-primary ajax-modal" data-modal-url="<?= $clients_url ?>"><i class="fas fa-fw fa-users me-2"></i>Add to clients</button>
<?php if ($missing_text) { ?>
<div class="btn-group">
<button type="button" class="btn btn-primary ajax-modal" data-modal-url="<?= $clients_url ?>"><i class="fas fa-fw fa-users me-2"></i>Add to clients</button>
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-label="More ways to add it"></button>
<div class="dropdown-menu dropdown-menu-end">
<a class="dropdown-item ajax-modal" href="#" data-modal-url="<?= $clients_url ?>&missing=1"><i class="fas fa-fw fa-clipboard-check me-2"></i>To <?= $missing_text ?></a>
</div>
</div>
<?php } else { ?>
<button type="button" class="btn btn-primary ajax-modal" data-modal-url="<?= $clients_url ?>"><i class="fas fa-fw fa-users me-2"></i>Add to clients</button>
<?php } ?>
<?php } ?>
<button type="button" class="btn btn-outline-secondary ajax-modal" data-modal-size="lg" data-modal-url="<?= $edit_url ?>"><i class="fas fa-fw fa-edit me-2"></i>Edit</button>
<div class="dropdown">
<button class="btn btn-outline-secondary" title="More actions" type="button" data-bs-toggle="dropdown"><i class="fas fa-fw fa-ellipsis-h"></i></button>
<div class="dropdown-menu dropdown-menu-end">
<a class="dropdown-item ajax-modal" href="#" data-modal-url="<?= $required_url ?>"><i class="fas fa-fw fa-clipboard-check me-2"></i>Who should have it</a>
<a class="dropdown-item" href="post.php?copy_vendor_template=<?= $vendor_template_id ?>&csrf_token=<?= $csrf ?>"><i class="fas fa-fw fa-copy me-2"></i>Copy</a>
<?php if ($archived) { ?>
<a class="dropdown-item" href="post.php?restore_vendor_template=<?= $vendor_template_id ?>&csrf_token=<?= $csrf ?>"><i class="fas fa-fw fa-redo me-2"></i>Restore</a>
@@ -144,30 +197,81 @@ foreach (vendorTemplateFieldLabels() as $field) {
<div class="card mb-3" id="vendorTemplateVendors">
<div class="card-header d-flex flex-wrap align-items-center gap-2">
<h3 class="card-title mb-0"><i class="fas fa-fw fa-users me-2"></i>Clients with it</h3>
<?php if (!$archived) { ?>
<button type="button" class="btn btn-sm btn-link ms-auto ajax-modal" data-modal-url="<?= $clients_url ?>"><i class="fas fa-plus me-1"></i>Add to clients</button>
<div class="ms-auto d-flex flex-wrap align-items-center gap-2">
<?php if ($current) { ?>
<div class="dropdown" id="bulkActionButton" hidden>
<button class="btn btn-sm btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown">
<i class="fas fa-fw fa-layer-group me-1"></i>Bulk Action (<span id="selectedCount"></span>)
</button>
<div class="dropdown-menu dropdown-menu-end">
<a class="dropdown-item ajax-modal" href="#" data-modal-size="lg" data-modal-url="<?= $in_line_url ?>" data-bulk="true"><i class="fas fa-fw fa-sync-alt me-2"></i>Bring in line</a>
</div>
</div>
<?php } ?>
<?php if (!$archived) { ?>
<button type="button" class="btn btn-sm btn-link ajax-modal" data-modal-url="<?= $clients_url ?>"><i class="fas fa-plus me-1"></i>Add to clients</button>
<?php } ?>
</div>
</div>
<?php if ($current) { ?>
<div class="card-header py-2">
<nav class="nav nav-pills itflow-asset-tabs flex-nowrap overflow-auto">
<?php foreach ($views as $key => $definition) {
if ($key !== '' && $key !== $view && !$view_counts[$key]) {
continue;
} ?>
<a class="nav-link text-nowrap <?= $key === $view ? 'active' : '' ?>" href="<?= escapeHtml($view_url($key)) ?>" title="<?= escapeHtml($definition['title']) ?>" data-vendor-view="<?= $key ?>">
<i class="fas fa-fw <?= $definition['icon'] ?> me-1"></i><?= escapeHtml($definition['label']) ?>
<span class="badge rounded-pill ms-1 <?= $key === 'out' && $key !== $view ? 'text-bg-warning' : '' ?>"><?= $view_counts[$key] ?></span>
</a>
<?php } ?>
</nav>
</div>
<?php if ($view === 'out' && $vendors) { ?>
<div class="card-header py-2 d-flex flex-wrap align-items-center gap-2 bg-body-tertiary">
<span class="small text-secondary">Saying something other than the template does - it may be the client's own, or the template changed since.</span>
<button type="button" class="btn btn-sm btn-primary ms-auto ajax-modal" data-modal-size="lg" data-view-action
data-modal-url="<?= escapeHtml($in_line_url . '&' . implode('&', array_map(function ($id) {
return 'vendor_ids[]=' . $id;
}, array_keys($vendors)))) ?>"><i class="fas fa-fw fa-sync-alt me-1"></i>Bring these in line</button>
</div>
<?php } ?>
<?php } ?>
<?php if ($vendors) { ?>
<div class="table-responsive">
<table class="table table-hover align-middle mb-0">
<thead class="table-light text-nowrap">
<tr><th class="ps-3">Client</th><th>Their vendor</th><th class="d-none d-sm-table-cell">Account</th><th class="d-none d-md-table-cell">Added</th><th></th></tr>
<tr>
<td class="ps-3 pe-0" style="width: 1rem;"><input class="form-check-input" type="checkbox" id="selectAllCheckbox" aria-label="Tick them all"></td>
<th>Client</th><th class="d-none d-md-table-cell">Their vendor</th><th>In step</th><th class="d-none d-sm-table-cell">Account</th><th class="d-none d-lg-table-cell">Added</th><th></th>
</tr>
</thead>
<tbody>
<?php foreach ($vendors as $vendor_id => $vendor) {
$client_id = $vendor['client_id'];
$vendor_url = '/agent/vendor.php?' . ($client_id ? "client_id=$client_id&amp;" : '') . "vendor_id=$vendor_id";
$differences = $vendor['differences'];
$differs_text = count($differences) > 2 ? count($differences) . ' fields' : ucfirst(vendorTemplateLabelsText($differences));
?>
<tr data-vendor-id="<?= $vendor_id ?>">
<td class="ps-3">
<td class="ps-3 pe-0"><input class="form-check-input bulk-select" type="checkbox" name="vendor_ids[]" value="<?= $vendor_id ?>" aria-label="Tick <?= escapeHtml($client_id ? $vendor['client_name'] : 'ours') ?>"></td>
<td>
<?php if ($client_id) { ?>
<a class="fw-semibold text-body" href="/agent/vendors.php?client_id=<?= $client_id ?>"><?= escapeHtml($vendor['client_name']) ?></a>
<?php } else { ?>
<span class="text-body-secondary"><i class="fas fa-fw fa-briefcase me-1"></i>Ours</span>
<?php } ?>
<?php if ($vendor['vendor_name'] !== $template['vendor_template_name']) { ?><div class="d-md-none small text-secondary"><?= escapeHtml($vendor['vendor_name']) ?></div><?php } ?>
</td>
<td class="d-none d-md-table-cell"><a class="text-reset" href="<?= $vendor_url ?>"><?= escapeHtml($vendor['vendor_name']) ?></a></td>
<td class="small">
<?php if ($differences) { ?>
<a href="#" class="badge rounded-pill bg-warning-subtle text-warning-emphasis border border-warning-subtle fw-normal text-decoration-none ajax-modal" data-modal-size="lg"
data-modal-url="<?= $update_url ?>?vendor_id=<?= $vendor_id ?>" title="Differs in <?= escapeHtml(vendorTemplateLabelsText($differences)) ?> - bring it in line" data-out-of-step="<?= escapeHtml(implode(',', array_keys($differences))) ?>"><i class="fas fa-not-equal me-1"></i><?= escapeHtml($differs_text) ?></a>
<?php } else { ?>
<span class="text-success text-nowrap" data-in-step><i class="fas fa-check me-1"></i>In step</span>
<?php } ?>
</td>
<td><a class="text-reset" href="<?= $vendor_url ?>"><?= escapeHtml($vendor['vendor_name']) ?></a></td>
<td class="d-none d-sm-table-cell small">
<?php if ($vendor['account_number'] !== '') { ?>
<span class="font-monospace"><?= escapeHtml($vendor['account_number']) ?></span>
@@ -178,8 +282,21 @@ foreach (vendorTemplateFieldLabels() as $field) {
<span class="text-body-secondary">-</span>
<?php } ?>
</td>
<td class="d-none d-md-table-cell small text-body-secondary text-nowrap" title="<?= escapeHtml($vendor['created_at']) ?>"><?= date('M j, Y', strtotime($vendor['created_at'])) ?></td>
<td class="text-end pe-3"><a class="btn btn-sm btn-light" href="<?= $vendor_url ?>" title="Open their vendor"><i class="fas fa-fw fa-arrow-right"></i></a></td>
<td class="d-none d-lg-table-cell small text-body-secondary text-nowrap" title="<?= escapeHtml($vendor['created_at']) ?>"><?= date('M j, Y', strtotime($vendor['created_at'])) ?></td>
<td class="text-end pe-3">
<div class="dropdown dropstart">
<button class="btn btn-sm btn-light" title="More actions" type="button" data-bs-toggle="dropdown"><i class="fas fa-fw fa-ellipsis-v"></i></button>
<div class="dropdown-menu">
<a class="dropdown-item" href="<?= $vendor_url ?>"><i class="fas fa-fw fa-building text-secondary me-2"></i>Open their vendor</a>
<?php if ($differences) { ?>
<a class="dropdown-item ajax-modal" href="#" data-modal-size="lg" data-modal-url="<?= $update_url ?>?vendor_id=<?= $vendor_id ?>"><i class="fas fa-fw fa-sync-alt text-secondary me-2"></i>Bring in line</a>
<?php } ?>
<div class="dropdown-divider"></div>
<a class="dropdown-item confirm-link" href="/agent/post.php?unlink_vendor_template=<?= $vendor_id ?>&amp;csrf_token=<?= $csrf ?>"
data-confirm-title="Unlink <?= escapeHtml($client_id ? $vendor['client_name'] . "'s" : 'our') ?> <?= escapeHtml($vendor['vendor_name']) ?>?" data-confirm-text="It stays as it is, and is no longer kept in step with the template." data-confirm-button="Unlink"><i class="fas fa-fw fa-unlink text-secondary me-2"></i>Unlink</a>
</div>
</div>
</td>
</tr>
<?php } ?>
</tbody>
@@ -188,11 +305,59 @@ foreach (vendorTemplateFieldLabels() as $field) {
<?php if ($others) { ?>
<div class="card-footer small text-secondary">And <?= $others ?> archived, or for an archived client.</div>
<?php } ?>
<?php } elseif ($current) { ?>
<div class="card-body small text-secondary">None of them - <a href="<?= escapeHtml($view_url('')) ?>">see them all</a>.</div>
<?php } else { ?>
<div class="card-body small text-secondary">No client has a vendor made from it yet<?= $others ? " - $others archived, or for an archived client" : '' ?>. Agents add one from <strong>New Vendor</strong> on a client's Vendors<?= $archived ? '' : ', or add it to several clients from here' ?>.</div>
<?php } ?>
</div>
<?php if ($matches) { ?>
<!-- Vendors made by hand that look like it -->
<div class="card mb-3" id="vendorTemplateMatches">
<div class="card-header d-flex flex-wrap align-items-center gap-2">
<h3 class="card-title mb-0"><i class="fas fa-fw fa-link me-2"></i>Not linked yet <span class="badge rounded-pill text-bg-light border fw-normal ms-1"><?= count($matches) ?></span></h3>
</div>
<div class="card-body small text-secondary pb-2">Vendors made by hand with its name or support site, at clients without one from it. Linked, they count as made from it and are kept in step with it - nothing on them changes unless you say so.</div>
<div class="list-group list-group-flush">
<?php foreach ($matches as $match_id => $match) {
$match_client = $match['client_id'];
$match_url = '/agent/vendor.php?' . ($match_client ? "client_id=$match_client&amp;" : '') . "vendor_id=$match_id"; ?>
<div class="list-group-item d-flex flex-wrap align-items-center gap-2" data-match-vendor-id="<?= $match_id ?>">
<div class="min-w-0 flex-grow-1">
<span class="fw-semibold"><?= $match_client ? escapeHtml($match['client_name']) : '<i class="fas fa-fw fa-briefcase me-1 text-secondary"></i>Ours' ?></span>
<a class="text-reset ms-1" href="<?= $match_url ?>"><?= escapeHtml($match['vendor_name']) ?></a>
<div class="small text-secondary">
<?= $match['how'] === 'name' ? 'Same name' : 'Same support site' ?>
- <?= $match['differences'] ? 'differs in ' . escapeHtml(vendorTemplateLabelsText($match['differences'])) : 'says what the template says' ?>
</div>
</div>
<form action="/agent/post.php" method="post" class="m-0">
<input type="hidden" name="csrf_token" value="<?= $csrf ?>">
<input type="hidden" name="vendor_template_id" value="<?= $vendor_template_id ?>">
<input type="hidden" name="vendor_ids[]" value="<?= $match_id ?>">
<button type="submit" name="link_vendors_to_template" class="btn btn-sm btn-light"><i class="fas fa-link me-1"></i>Link</button>
</form>
</div>
<?php } ?>
</div>
<?php if (count($matches) > 1 || array_filter(array_column($matches, 'differences'))) { ?>
<form action="/agent/post.php" method="post" class="card-footer d-flex flex-wrap align-items-center gap-3" data-link-all>
<input type="hidden" name="csrf_token" value="<?= $csrf ?>">
<input type="hidden" name="vendor_template_id" value="<?= $vendor_template_id ?>">
<?php foreach (array_keys($matches) as $match_id) { ?>
<input type="hidden" name="vendor_ids[]" value="<?= $match_id ?>">
<?php } ?>
<div class="form-check form-switch mb-0">
<input class="form-check-input" type="checkbox" role="switch" name="bring" value="1" id="vendorTemplateLinkBring">
<label class="form-check-label small" for="vendorTemplateLinkBring">and take the template's support details, notes and name</label>
</div>
<button type="submit" name="link_vendors_to_template" class="btn btn-sm btn-outline-primary ms-auto"><i class="fas fa-link me-1"></i>Link <?= count($matches) === 1 ? 'it' : 'all ' . count($matches) ?></button>
</form>
<?php } ?>
</div>
<?php } ?>
</div>
<div class="col-lg-4 d-print-none">
@@ -206,6 +371,9 @@ foreach (vendorTemplateFieldLabels() as $field) {
<?php if ($usage['ours']) { ?><?= $usage['clients'] ? ', and it is one of ours' : 'It is one of our own vendors' ?><?php } ?>
<span class="small text-secondary">- last added <?= timeAgo($usage['last']) ?></span>
</div>
<?php if ($current) { ?>
<div class="small mb-1 <?= $out_of_step ? 'text-warning-emphasis' : 'text-success' ?>" data-vendor-template-in-step><i class="fas fa-fw <?= $out_of_step ? 'fa-not-equal' : 'fa-check' ?> me-1"></i><?= $out_of_step ? "$out_of_step out of step with it" : (count($current) === 1 ? 'In step with it' : 'Every one in step with it') ?></div>
<?php } ?>
<?php if ($client_vendors) { ?>
<div class="small <?= $set_up < $client_vendors ? 'text-warning-emphasis' : 'text-success' ?>"><i class="fas fa-fw fa-fingerprint me-1"></i><?= $set_up < $client_vendors ? ($client_vendors - $set_up) . ' without the client\'s account number' : 'Every one has the client\'s account number' ?></div>
<?php } ?>
@@ -231,6 +399,50 @@ foreach (vendorTemplateFieldLabels() as $field) {
</div>
<?php } ?>
<div class="card mb-3" id="vendorTemplateCoverage">
<div class="card-header d-flex align-items-center">
<h3 class="card-title mb-0"><i class="fas fa-fw fa-clipboard-check me-2"></i>Who should have it</h3>
<button type="button" class="btn btn-sm btn-link ms-auto ajax-modal" data-modal-url="<?= $required_url ?>"><i class="fas fa-edit me-1"></i>Set up</button>
</div>
<div class="card-body">
<?php if (!$required) { ?>
<div class="small text-secondary">No one in particular. Set it up to see which clients are missing it - every client, or the ones with a tag.</div>
<?php } elseif ($archived) { ?>
<div class="small text-secondary"><?= escapeHtml($scope_text) ?> - not counted while it is archived.</div>
<?php } else {
$percent = $coverage['clients'] ? intval(floor($coverage['covered'] * 100 / $coverage['clients'])) : 100;
?>
<div class="d-flex align-items-baseline gap-2 mb-1">
<span class="fw-semibold min-w-0 text-truncate" title="<?= escapeHtml($scope_text) ?>"><?= escapeHtml($scope_text) ?></span>
<span class="ms-auto small text-nowrap"><strong><?= $coverage['covered'] ?></strong> of <?= $coverage['clients'] ?> have it</span>
</div>
<div class="progress mb-2" role="progressbar" aria-label="Clients with it" aria-valuenow="<?= $percent ?>" aria-valuemin="0" aria-valuemax="100" style="height: 6px;">
<div class="progress-bar <?= $coverage['missing'] ? 'bg-warning' : 'bg-success' ?>" style="width: <?= $percent ?>%"></div>
</div>
<?php if ($coverage['missing']) { ?>
<div class="small text-secondary mb-1">Missing it</div>
<div class="list-group list-group-flush small mb-2">
<?php foreach (array_slice($coverage['missing'], 0, $list_limit, true) as $client_id => $client_name) { ?>
<div class="list-group-item px-0 d-flex align-items-center gap-2" data-missing-client-id="<?= $client_id ?>">
<i class="fas fa-fw fa-user text-secondary"></i>
<a class="min-w-0 flex-grow-1 text-truncate text-reset" href="/agent/vendors.php?client_id=<?= $client_id ?>"><?= escapeHtml($client_name) ?></a>
<button type="button" class="btn btn-sm btn-light py-0 ajax-modal" data-modal-url="<?= $clients_url ?>&client_ids[]=<?= $client_id ?>"><i class="fas fa-plus me-1"></i>Add</button>
</div>
<?php } ?>
</div>
<?php if (count($coverage['missing']) > $list_limit) { ?>
<div class="small text-secondary mb-2">and <?= count($coverage['missing']) - $list_limit ?> more</div>
<?php } ?>
<button type="button" class="btn btn-sm btn-outline-primary ajax-modal" data-modal-url="<?= $clients_url ?>&missing=1"><i class="fas fa-users me-1"></i>Add to <?= $missing_text ?></button>
<?php } elseif ($coverage['clients']) { ?>
<div class="small text-success"><i class="fas fa-fw fa-check me-1"></i>Every one of them has it.</div>
<?php } else { ?>
<div class="small text-secondary"><?= $required === VENDOR_TEMPLATE_REQUIRED_TAGGED ? ($required_tags ? 'No clients have ' . (count($required_tags) === 1 ? 'that tag' : 'those tags') : 'No tags picked, so no clients') : 'No clients yet' ?>.</div>
<?php } ?>
<?php } ?>
</div>
</div>
<div class="card mb-3">
<div class="card-header"><h3 class="card-title mb-0"><i class="fas fa-fw fa-info-circle me-2"></i>Details</h3></div>
<div class="card-body">
@@ -251,5 +463,7 @@ foreach (vendorTemplateFieldLabels() as $field) {
</div>
</div>
<script src="../js/bulk_actions.js"></script>
<?php
require_once "../includes/footer.php";

View File

@@ -5,7 +5,9 @@
* again, set up once: the ISPs, the hardware makers, the distributors, the
* line-of-business software. Each row shows what it is, its support line,
* hours and SLA, how many clients have a vendor made from it, when one was
* last added and when it last changed, and by whom. Each opens its page
* last added and when it last changed, and by whom - with how many of the
* clients it is required of have it, and how many of its vendors are out of
* step with it (the Required and Out of step tabs). Each opens its page
* (vendor_template.php). A template can be added to several clients at once,
* changed, copied as the start of another, archived - not offered for new
* vendors, while the vendors made from it stay - or deleted. The work is in
@@ -19,9 +21,28 @@ $order = "ASC";
require_once "includes/inc_all_admin.php";
// '' current, 'archived'
$show_archived = ($_GET['show'] ?? '') === 'archived' || ($_GET['archived'] ?? '') === '1';
$show_where = $show_archived ? 'vendor_template_archived_at IS NOT NULL' : 'vendor_template_archived_at IS NULL';
// The templates with vendors out of step with them, and how many (vendorTemplateOutOfStep())
$made_from = [];
$sql = mysqli_query($mysqli, "SELECT DISTINCT vendor_template_id FROM vendors WHERE vendor_template_id > 0");
while ($row = mysqli_fetch_row($sql)) {
$made_from[] = intval($row[0]);
}
$out_of_step = vendorTemplateOutOfStep($made_from);
$out_ids = implode(',', array_keys($out_of_step) ?: [0]);
// '' current, 'required' the current ones someone should have, 'out' the current ones with vendors out of step, 'archived'
$show = (string) ($_GET['show'] ?? '');
if (($_GET['archived'] ?? '') === '1') {
$show = 'archived';
}
$show = in_array($show, ['required', 'out', 'archived'], true) ? $show : '';
$show_archived = $show === 'archived';
$show_where = [
'' => 'vendor_template_archived_at IS NULL',
'required' => 'vendor_template_archived_at IS NULL AND vendor_template_required > 0',
'out' => "vendor_template_archived_at IS NULL AND vendor_templates.vendor_template_id IN ($out_ids)",
'archived' => 'vendor_template_archived_at IS NOT NULL',
][$show];
// Tab title - the file is named for the table, the page for what it holds
$page_title = 'Vendor Templates';
@@ -45,7 +66,7 @@ $search = "(vendor_template_name LIKE '%$q%' OR vendor_template_description LIKE
// Its use is the current vendors made from it for current clients - as vendorTemplateUsage() counts them
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS vendor_templates.vendor_template_id, vendor_template_name, vendor_template_description, vendor_template_phone_country_code,
vendor_template_phone, vendor_template_extension, vendor_template_email, vendor_template_website, vendor_template_hours, vendor_template_sla,
vendor_template_created_at, vendor_template_updated_at, vendor_template_archived_at,
vendor_template_created_at, vendor_template_updated_at, vendor_template_archived_at, vendor_template_required,
COALESCE(vendor_template_updated_at, vendor_template_created_at) AS changed_at, COALESCE(updater.user_name, creator.user_name) AS changed_by,
COALESCE(used.used_count, 0) AS used_count, used.last_used
FROM vendor_templates
@@ -68,7 +89,17 @@ while ($row = mysqli_fetch_assoc($sql)) {
}
$usage = vendorTemplateUsage(array_keys($rows));
$counts = mysqli_fetch_row(mysqli_query($mysqli, "SELECT COALESCE(SUM(vendor_template_archived_at IS NULL), 0), COALESCE(SUM(vendor_template_archived_at IS NOT NULL), 0)
// How many of the clients a required one is for have it
$required_tags = vendorTemplateRequiredTags(array_keys($rows));
$coverage = [];
foreach ($rows as $template_id => $row) {
if (intval($row['vendor_template_required']) && !$row['vendor_template_archived_at']) {
$coverage[$template_id] = vendorTemplateCoverage($template_id, $row['vendor_template_required'], array_keys($required_tags[$template_id]));
}
}
$counts = mysqli_fetch_row(mysqli_query($mysqli, "SELECT COALESCE(SUM(vendor_template_archived_at IS NULL), 0), COALESCE(SUM(vendor_template_archived_at IS NOT NULL), 0),
COALESCE(SUM(vendor_template_archived_at IS NULL AND vendor_template_required > 0), 0), COALESCE(SUM(vendor_template_archived_at IS NULL AND vendor_template_id IN ($out_ids)), 0)
FROM vendor_templates WHERE $search"));
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
@@ -106,7 +137,7 @@ $csrf = $_SESSION['csrf_token'];
</div>
<div class="card-header py-3">
<form autocomplete="off">
<?php if ($show_archived) { ?><input type="hidden" name="show" value="archived"><?php } ?>
<?php if ($show !== '') { ?><input type="hidden" name="show" value="<?= $show ?>"><?php } ?>
<div class="row g-2 align-items-center">
<div class="col-lg-5 col-md-6">
<div class="input-group">
@@ -116,8 +147,10 @@ $csrf = $_SESSION['csrf_token'];
</div>
</div>
</form>
<nav class="nav nav-pills itflow-asset-tabs mt-2">
<a class="nav-link <?= !$show_archived ? 'active' : '' ?>" href="<?= escapeHtml($pill_url('')) ?>"><i class="fas fa-fw fa-building me-1"></i>Active <span class="badge rounded-pill ms-1"><?= intval($counts[0]) ?></span></a>
<nav class="nav nav-pills itflow-asset-tabs flex-nowrap overflow-auto mt-2">
<a class="nav-link <?= $show === '' ? 'active' : '' ?>" href="<?= escapeHtml($pill_url('')) ?>"><i class="fas fa-fw fa-building me-1"></i>Active <span class="badge rounded-pill ms-1"><?= intval($counts[0]) ?></span></a>
<a class="nav-link <?= $show === 'required' ? 'active' : '' ?>" href="<?= escapeHtml($pill_url('required')) ?>" title="Every client, or the clients with a tag, should have it"><i class="fas fa-fw fa-clipboard-check me-1"></i>Required <span class="badge rounded-pill ms-1"><?= intval($counts[2]) ?></span></a>
<a class="nav-link <?= $show === 'out' ? 'active' : '' ?>" href="<?= escapeHtml($pill_url('out')) ?>" title="Clients' vendors made from it that say something other than it does"><i class="fas fa-fw fa-not-equal me-1"></i>Out of step <span class="badge rounded-pill ms-1 <?= $show !== 'out' && intval($counts[3]) ? 'text-bg-warning' : '' ?>"><?= intval($counts[3]) ?></span></a>
<a class="nav-link <?= $show_archived ? 'active' : '' ?>" href="<?= escapeHtml($pill_url('archived')) ?>" title="Not offered for new vendors - the vendors made from them stay"><i class="fas fa-fw fa-archive me-1"></i>Archived <span class="badge rounded-pill ms-1"><?= intval($counts[1]) ?></span></a>
</nav>
</div>
@@ -168,6 +201,23 @@ $csrf = $_SESSION['csrf_token'];
<?php if (trim((string) $row['vendor_template_email']) !== '') { ?><span class="text-nowrap"><i class="fas fa-fw fa-envelope me-1"></i><?= escapeHtml($row['vendor_template_email']) ?></span><?php } ?>
</div>
<?php } ?>
<?php if (isset($coverage[$template_id]) || (!$row['vendor_template_archived_at'] && isset($out_of_step[$template_id]))) { ?>
<div class="d-flex flex-wrap gap-1 mt-1">
<?php if (isset($coverage[$template_id])) {
$reach = $coverage[$template_id]; ?>
<a class="badge rounded-pill fw-normal text-decoration-none <?= $reach['missing'] ? 'bg-warning-subtle text-warning-emphasis border border-warning-subtle' : 'bg-success-subtle text-success-emphasis border border-success-subtle' ?>"
href="<?= $page_url ?>#vendorTemplateCoverage" title="<?= escapeHtml(vendorTemplateScopeText($row['vendor_template_required'], $required_tags[$template_id])) ?>" data-template-reach>
<i class="fas fa-clipboard-check me-1"></i><?= $reach['covered'] ?> of <?= $reach['clients'] ?> clients
</a>
<?php } ?>
<?php if (!$row['vendor_template_archived_at'] && isset($out_of_step[$template_id])) { ?>
<a class="badge rounded-pill fw-normal text-decoration-none bg-warning-subtle text-warning-emphasis border border-warning-subtle"
href="<?= $page_url ?>&amp;view=out#vendorTemplateVendors" title="Vendors made from it that say something other than it does" data-template-out-of-step="<?= $out_of_step[$template_id] ?>">
<i class="fas fa-not-equal me-1"></i><?= $out_of_step[$template_id] ?> out of step
</a>
<?php } ?>
</div>
<?php } ?>
<?php if ($row['vendor_template_archived_at']) { ?>
<div class="small text-body-secondary"><i class="fas fa-fw fa-archive me-1"></i>Archived <?= date('M j, Y', strtotime($row['vendor_template_archived_at'])) ?></div>
<?php } ?>
@@ -208,6 +258,9 @@ $csrf = $_SESSION['csrf_token'];
<i class="fas fa-fw fa-users text-secondary me-2"></i>Add to clients
</a>
<?php } ?>
<a class="dropdown-item ajax-modal" href="#" data-modal-url="modals/vendor_template/vendor_template_required.php?id=<?= $template_id ?>">
<i class="fas fa-fw fa-clipboard-check text-secondary me-2"></i>Who should have it
</a>
<a class="dropdown-item" href="post.php?copy_vendor_template=<?= $template_id ?>&csrf_token=<?= $csrf ?>" title="A new template starting from this one">
<i class="fas fa-fw fa-copy text-secondary me-2"></i>Copy
</a>
@@ -240,6 +293,8 @@ $csrf = $_SESSION['csrf_token'];
'filtered' => $q !== '',
'archived' => $show_archived,
'views' => ['show'],
'view' => ['required' => ['title' => 'No required templates', 'text' => 'Set one up from its page - <strong>Who should have it</strong> - to see which clients are missing a vendor from it.'],
'out' => ['title' => 'Every vendor is in step', 'text' => 'Every client\'s vendor made from a template says what the template says.']][$show] ?? null,
'text' => 'A vendor your clients use again and again - an ISP, a hardware maker, the software they run - set up once with its support line, hours and site, ready to add to any client. Agents start one from <strong>New Vendor</strong> on a client\'s Vendors.',
'actions' => [['label' => 'New Vendor Template', 'modal' => $add_url, 'size' => 'lg'], ['label' => 'Starter vendor templates', 'href' => 'starter_content.php', 'icon' => 'fa-seedling']],
];