mirror of
https://github.com/itflow-org/itflow
synced 2026-12-01 08:39:01 +00:00
Quick add: the plus beside Contact, Site, Location, Assigned to and Vendor in New Ticket, Edit Ticket and the asset form opens the usual New Contact, New Location or New Vendor window over the form, saved in the background and picked, in place of the pop-up
This commit is contained in:
@@ -946,61 +946,6 @@ if (isset($_GET['client_card'])) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add a contact, location or vendor without leaving the window that needs it (js/quick_add.js -
|
||||
* the + beside those pickers in New Ticket, Edit Ticket and the asset form). Only what the picker
|
||||
* needs: a name, and an email and title, an address, or a phone. Answers {ok, id, label} or {error}.
|
||||
*/
|
||||
if (isset($_POST['quick_add_record'])) {
|
||||
validateCSRFToken();
|
||||
header('Content-Type: application/json');
|
||||
|
||||
$type = (string) $_POST['quick_add_record'];
|
||||
$client_id = intval($_POST['client_id'] ?? 0);
|
||||
$name = mb_substr(trim((string) ($_POST['name'] ?? '')), 0, 200);
|
||||
$fail = function ($error) {
|
||||
echo json_encode(['error' => $error]);
|
||||
exit;
|
||||
};
|
||||
|
||||
if (!in_array($type, ['contact', 'location', 'vendor'], true) || lookupUserPermission('module_client') < 2) {
|
||||
$fail("You can't add those here.");
|
||||
}
|
||||
if (!$client_id || !hasClientAccess($client_id) || !mysqli_num_rows(mysqli_query($mysqli, "SELECT 1 FROM clients WHERE client_id = $client_id"))) {
|
||||
$fail('Pick the client first.');
|
||||
}
|
||||
if ($name === '') {
|
||||
$fail('It needs a name.');
|
||||
}
|
||||
$name_sql = escapeSql($name);
|
||||
|
||||
if ($type === 'contact') {
|
||||
$email = trim((string) ($_POST['email'] ?? ''));
|
||||
if ($email !== '' && !filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||
$fail("That email address doesn't look right.");
|
||||
}
|
||||
mysqli_query($mysqli, "INSERT INTO contacts SET contact_name = '$name_sql', contact_email = '" . escapeSql(mb_substr($email, 0, 200)) . "',
|
||||
contact_title = '" . escapeSql(mb_substr(trim((string) ($_POST['title'] ?? '')), 0, 200)) . "', contact_client_id = $client_id");
|
||||
$id = mysqli_insert_id($mysqli);
|
||||
logAudit("Contact", "Create", "$session_name created contact $name_sql", $client_id, $id);
|
||||
} elseif ($type === 'location') {
|
||||
mysqli_query($mysqli, "INSERT INTO locations SET " . locationFormSet(['name' => $name, 'address' => $_POST['address'] ?? '', 'city' => $_POST['city'] ?? ''], $client_id) . ", location_client_id = $client_id");
|
||||
$id = mysqli_insert_id($mysqli);
|
||||
// The client's first location is its primary one, as from Add Location
|
||||
if (!intval(mysqli_fetch_row(mysqli_query($mysqli, "SELECT COUNT(*) FROM locations WHERE location_client_id = $client_id AND location_primary = 1 AND location_archived_at IS NULL"))[0])) {
|
||||
locationMakePrimary($id, $client_id);
|
||||
}
|
||||
logAudit("Location", "Create", "$session_name created location $name_sql", $client_id, $id);
|
||||
} else {
|
||||
mysqli_query($mysqli, "INSERT INTO vendors SET " . vendorFormSet(['name' => $name, 'phone' => $_POST['phone'] ?? '']) . ", vendor_client_id = $client_id");
|
||||
$id = mysqli_insert_id($mysqli);
|
||||
logAudit("Vendor", "Create", "$session_name created vendor $name_sql", $client_id, $id);
|
||||
}
|
||||
|
||||
echo json_encode(['ok' => true, 'id' => $id, 'label' => $name]);
|
||||
exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Rename a file or a document from its name on the files list (agent/js/files.js) - the name only;
|
||||
* the Rename window still changes the description. Answers {ok, name} or {error}.
|
||||
|
||||
@@ -624,7 +624,7 @@ $search_noun = $type_filter ? $asset_type_tabs[$type_filter]['label'] : 'assets'
|
||||
<?php if ($asset_description) { ?>
|
||||
<div class="small text-body-secondary text-truncate itflow-asset-desc" title="<?= $asset_description ?>"><?= $asset_description ?></div>
|
||||
<?php } ?>
|
||||
<?php if ($asset_tags || lookupUserPermission('module_client') >= 2) { ?>
|
||||
<?php if ($asset_tags) { ?>
|
||||
<div class="mt-1 itflow-above-stretch"><?= tagPills('asset', $asset_id, $asset_tags, "assets.php?$client_url") ?></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
@@ -589,7 +589,7 @@ $total_leads = intval($row['leads']);
|
||||
<?php if ($client_type) { ?>
|
||||
<div class="small text-body-secondary"><?= $client_type ?></div>
|
||||
<?php } ?>
|
||||
<?php if (!empty($client_tags[$client_id]) || $can_edit) { ?>
|
||||
<?php if (!empty($client_tags[$client_id])) { ?>
|
||||
<div class="mt-1"><?= tagPills('client', $client_id, $client_tags[$client_id] ?? [], $leads_filter ? 'clients.php?leads=1&' : 'clients.php?') ?></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
@@ -630,7 +630,7 @@ $search_placeholder = $invites_view ? 'Search invites by email, name or client'
|
||||
<?php if ($contact_role_line) { ?>
|
||||
<div class="small text-body-secondary text-truncate itflow-contact-role"><?= $contact_role_line ?></div>
|
||||
<?php } ?>
|
||||
<?php if ($contact_tags || $can_edit) { ?>
|
||||
<?php if ($contact_tags) { ?>
|
||||
<div class="mt-1 itflow-above-stretch"><?= tagPills('contact', $contact_id, $contact_tags, "contacts.php?$client_url") ?></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
@@ -383,7 +383,7 @@ $filter_url = function ($changes) use ($client_url) {
|
||||
<?php if ($credential_description) { ?>
|
||||
<div class="small text-body-secondary text-truncate itflow-asset-desc" title="<?= $credential_description ?>"><?= $credential_description ?></div>
|
||||
<?php } ?>
|
||||
<?php if ($credential_tags || $can_edit) { ?>
|
||||
<?php if ($credential_tags) { ?>
|
||||
<div class="mt-1"><?= tagPills('credential', $credential_id, $credential_tags, "credentials.php?$client_url") ?></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
@@ -371,7 +371,7 @@ $bulk_vendor_options = $can_edit ? domainVendorChoices($client_url ? $client_id
|
||||
<?php if ($domain_description) { ?>
|
||||
<div class="small text-body-secondary text-truncate itflow-asset-desc" title="<?= $domain_description ?>"><?= $domain_description ?></div>
|
||||
<?php } ?>
|
||||
<?php if ($domain_tags || $can_edit) { ?>
|
||||
<?php if ($domain_tags) { ?>
|
||||
<div class="mt-1"><?= tagPills('domain', $domain_id, $domain_tags, "domains.php?$client_url", $can_edit) ?></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
@@ -729,7 +729,7 @@ $preview = []; // the grid's previewer payload
|
||||
<div class="small text-body-secondary text-truncate itflow-files-desc"><?= escapeHtml($item['description']) ?></div>
|
||||
<?php } ?>
|
||||
<?= filesFolderNote($item) ?>
|
||||
<?php if ($item['kind'] === 'document' && (!empty($documents_tags[$id]) || ($can_edit && !$item['archived']))) { ?>
|
||||
<?php if ($item['kind'] === 'document' && !empty($documents_tags[$id])) { ?>
|
||||
<div class="mt-1 itflow-above-stretch"><?= tagPills('document', $id, $documents_tags[$id] ?? [], "files.php?client_id=$client_id&", $can_edit && !$item['archived']) ?></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
@@ -47,7 +47,8 @@ if (empty($client_top_head_skip)) {
|
||||
<?php if (!empty($config_module_enable_accounting) && ($client_head_tax = taxClient($client_id))['exempt']) { ?>
|
||||
<span class="badge rounded-pill fw-normal <?= $client_head_tax['expired'] ? 'bg-warning-subtle text-warning-emphasis' : 'bg-success-subtle text-success-emphasis' ?>" title="<?= escapeHtml(taxExemptText($client_head_tax)) ?>"><?= $client_head_tax['expired'] ? 'Tax exempt - certificate expired' : 'Tax exempt' ?></span>
|
||||
<?php } ?>
|
||||
<?= tagPills('client', $client_id, $client_tags) ?>
|
||||
<?php // Its tags only - the + to change them is on the client's overview and the clients list ?>
|
||||
<?= tagPills('client', $client_id, $client_tags, '', false) ?>
|
||||
|
||||
<?php /* Open tickets and balance due, always in sight */ ?>
|
||||
<?php if ($client_head_glance_tickets || $client_head_glance_due) { ?>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
$selected_ticket_template_id = intval($selected_ticket_template_id ?? 0);
|
||||
$ticket_template_field = $ticket_template_field ?? 'ticket_template_id';
|
||||
$ticket_template_apply_on_load = !empty($ticket_template_apply_on_load);
|
||||
$ticket_template_hint = $ticket_template_hint ?? 'Picking one fills in the ticket - change anything before it is made. <span class="font-monospace">[Client]</span>, <span class="font-monospace">[Month]</span> and the like are filled in when it is saved.';
|
||||
$ticket_template_hint = $ticket_template_hint ?? '<span class="font-monospace">[Client]</span>, <span class="font-monospace">[Month]</span> and the like in it are filled in when the ticket is saved.';
|
||||
|
||||
$ticket_template_fill_in_values = $ticket_template_fill_in_values ?? [];
|
||||
|
||||
|
||||
@@ -311,7 +311,7 @@ $locations_counts = locationCounts(array_keys($locations));
|
||||
<?php if ($location_description) { ?>
|
||||
<div class="small text-body-secondary text-truncate itflow-asset-desc" title="<?= $location_description ?>"><?= $location_description ?></div>
|
||||
<?php } ?>
|
||||
<?php if ($location_tags || $can_edit) { ?>
|
||||
<?php if ($location_tags) { ?>
|
||||
<div class="mt-1 itflow-above-stretch"><?= tagPills('location', $location_id, $location_tags, "locations.php?$client_url") ?></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
@@ -23,7 +23,7 @@ ob_start();
|
||||
|
||||
<?php
|
||||
$ticket_template_field = 'bulk_ticket_template_id';
|
||||
$ticket_template_hint = "Picking one fills in the tickets - change anything before they are made. <span class=\"font-monospace\">[Asset]</span>, <span class=\"font-monospace\">[Contact]</span> and the like are filled in for each; with <span class=\"font-monospace\">[Asset]</span> in the subject, the asset's name isn't put in front. What the template asks for is answered once, for them all.";
|
||||
$ticket_template_hint = "<span class=\"font-monospace\">[Asset]</span>, <span class=\"font-monospace\">[Contact]</span> and the like in it are filled in for each ticket - with <span class=\"font-monospace\">[Asset]</span> in the subject, the asset's name isn't put in front too.";
|
||||
require_once '../../includes/inc_ticket_template_select.php';
|
||||
?>
|
||||
|
||||
@@ -65,7 +65,7 @@ ob_start();
|
||||
<option value="0">- Not Categorized -</option>
|
||||
<?= categoryOptionsHtml('Ticket') ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('Ticket', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('Ticket') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -28,7 +28,7 @@ ob_start();
|
||||
<option value="">- Select Status -</option>
|
||||
<?= categoryOptionsHtml('asset_status') ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('asset_status', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('asset_status') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ $asset_form_icons = [
|
||||
<option value="">- Status -</option>
|
||||
<?= categoryOptionsHtml('asset_status', html_entity_decode($asset_status)) ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('asset_status', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('asset_status') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
|
||||
@@ -31,7 +31,7 @@ ob_start();
|
||||
<option value="">- No type -</option>
|
||||
<?= categoryOptionsHtml('network_interface') ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('network_interface', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('network_interface') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ $form_type = (string) ($form['interface_type'] ?? '');
|
||||
<option value="">- No type -</option>
|
||||
<?= categoryOptionsHtml('network_interface', $form_type) ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('network_interface', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('network_interface') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
|
||||
@@ -78,7 +78,7 @@ ob_start();
|
||||
<option value="">- No type -</option>
|
||||
<?= categoryOptionsHtml('network_interface', isset($types['Ethernet']) ? 'Ethernet' : null) ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('network_interface', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('network_interface') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
|
||||
@@ -35,7 +35,7 @@ ob_start();
|
||||
<select class="form-select select2" name="type">
|
||||
<?= categoryOptionsHtml('asset_note_type') ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('asset_note_type', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('asset_note_type') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ $form_scope_placeholder = [
|
||||
<option value="">- Category -</option>
|
||||
<?= categoryOptionsHtml('Income', $form_category_id, ['since' => $form_edit ? $form_value('created_at') : null]) ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('Income', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('Income') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ $has_pem = trim(html_entity_decode($certificate_public_key, ENT_QUOTES, 'UTF-8')
|
||||
<div class="tab-pane fade" id="<?= $form_id ?>Details">
|
||||
<label class="form-label">Certificate (PEM)</label>
|
||||
<textarea class="form-control font-monospace small" rows="9" name="public_key" spellcheck="false" placeholder="-----BEGIN CERTIFICATE----- ... -----END CERTIFICATE-----" data-certificate-pem><?= $certificate_public_key ?></textarea>
|
||||
<div class="form-text mb-3">For a host ITFlow can't reach. The issuer, dates, names it covers and fingerprint are read from it - a whole chain is fine, only the first certificate is kept. Never paste the private key.</div>
|
||||
<div class="form-text mb-3">For a host ITFlow can't reach - its details are read from it, and a whole chain is fine. Never paste the private key.</div>
|
||||
|
||||
<fieldset data-certificate-by-hand>
|
||||
<div class="small text-body-secondary fw-semibold text-uppercase mb-2">Nothing to paste? By hand</div>
|
||||
|
||||
@@ -60,7 +60,7 @@ ob_start();
|
||||
<label>Shortened Name</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-id-badge"></i></span>
|
||||
<input type="text" class="form-control" name="abbreviation" placeholder="Shortened name for client - Max chars 6" maxlength="6" oninput="this.value = this.value.toUpperCase()">
|
||||
<input type="text" class="form-control" name="abbreviation" placeholder="Up to 6 characters, such as RDG" maxlength="6" oninput="this.value = this.value.toUpperCase()">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -68,7 +68,7 @@ ob_start();
|
||||
<label>Industry</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-briefcase"></i></span>
|
||||
<input type="text" class="form-control" name="type" placeholder="Company Type" maxlength="200">
|
||||
<input type="text" class="form-control" name="type" placeholder="Healthcare, Legal, Construction" maxlength="200">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -80,7 +80,7 @@ ob_start();
|
||||
<option value="">- Select Referral -</option>
|
||||
<?= categoryOptionsHtml('Referral') ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('Referral', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('Referral') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -297,7 +297,7 @@ ob_start();
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" name="add_client" class="btn btn-primary text-bold" onclick="promptPrimaryContact()"><i class="fa fa-check me-2"></i>Create Client</button>
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal"><i class="fa fa-times me-2"></i>Close</button>
|
||||
<button type="button" class="btn btn-light" data-bs-dismiss="modal"><i class="fa fa-times me-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ ob_start();
|
||||
|
||||
<?php
|
||||
$ticket_template_field = 'bulk_ticket_template_id';
|
||||
$ticket_template_hint = "Picking one fills in the tickets - change anything before they are made. <span class=\"font-monospace\">[Client]</span>, <span class=\"font-monospace\">[Month]</span> and the like are filled in for each. What the template asks for is answered once, for them all.";
|
||||
$ticket_template_hint = "<span class=\"font-monospace\">[Client]</span>, <span class=\"font-monospace\">[Month]</span> and the like in it are filled in for each ticket.";
|
||||
require_once '../../includes/inc_ticket_template_select.php';
|
||||
?>
|
||||
|
||||
@@ -66,7 +66,7 @@ ob_start();
|
||||
<option value="0">- Not Categorized -</option>
|
||||
<?= categoryOptionsHtml('Ticket') ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('Ticket', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('Ticket') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -28,7 +28,7 @@ ob_start();
|
||||
<option value="">- Select a Referral -</option>
|
||||
<?= categoryOptionsHtml('Referral') ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('Referral', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('Referral') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" name="add_credit" class="btn btn-primary text-bold"><i class="fa fa-fw fa-check me-2"></i>Add</button>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><i class="fa fa-times me-2"></i>Cancel</button>
|
||||
<button type="button" class="btn btn-light" data-bs-dismiss="modal"><i class="fa fa-times me-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -91,7 +91,7 @@ ob_start();
|
||||
<label>Shortened Name</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-id-badge"></i></span>
|
||||
<input type="text" class="form-control" name="abbreviation" placeholder="Shortened name for client - Max chars 6" value="<?= $client_abbreviation ?>" maxlength="6" oninput="this.value = this.value.toUpperCase()">
|
||||
<input type="text" class="form-control" name="abbreviation" placeholder="Up to 6 characters, such as RDG" value="<?= $client_abbreviation ?>" maxlength="6" oninput="this.value = this.value.toUpperCase()">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -99,7 +99,7 @@ ob_start();
|
||||
<label>Industry</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-briefcase"></i></span>
|
||||
<input type="text" class="form-control" name="type" placeholder="Industry" maxlength="200"
|
||||
<input type="text" class="form-control" name="type" placeholder="Healthcare, Legal, Construction" maxlength="200"
|
||||
value="<?= $client_type ?>">
|
||||
</div>
|
||||
</div>
|
||||
@@ -112,7 +112,7 @@ ob_start();
|
||||
<option value="">- Select Referral -</option>
|
||||
<?= categoryOptionsHtml('Referral', $row_referral) ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('Referral', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('Referral') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -191,7 +191,7 @@ ob_start();
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" name="edit_client" class="btn btn-primary text-bold"><i class="fa fa-check me-2"></i>Save</button>
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal"><i class="fa fa-times me-2"></i>Cancel</button>
|
||||
<button type="button" class="btn btn-light" data-bs-dismiss="modal"><i class="fa fa-times me-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@@ -35,6 +35,10 @@ $contact_location_id = $client_id ? assetClientOwnedId('location', $_GET['locati
|
||||
$auth_method = '';
|
||||
$contact_tag_id_array = [];
|
||||
|
||||
// Opened by the + beside a contact picker in another window (quickAddButton()) - js/quick_add.js
|
||||
// saves it in the background and picks it there
|
||||
$inline = !empty($_GET['inline']);
|
||||
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
@@ -44,13 +48,15 @@ ob_start();
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<form action="post.php" method="post" enctype="multipart/form-data" autocomplete="off"
|
||||
data-itflow-phone-country="<?= escapeHtml($client_phone_iso2) ?>">
|
||||
data-itflow-phone-country="<?= escapeHtml($client_phone_iso2) ?>"<?= $inline ? ' data-quick-add-inline' : '' ?>>
|
||||
<input type="hidden" name="csrf_token" value="<?= $_SESSION['csrf_token'] ?>">
|
||||
<?php if ($inline) { ?><input type="hidden" name="inline" value="1"><?php } ?>
|
||||
<?php if ($client_id) { ?>
|
||||
<input type="hidden" name="client_id" value="<?= $client_id ?>">
|
||||
<?php } ?>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="alert alert-danger small py-2" role="alert" data-quick-add-error hidden></div>
|
||||
<?php require 'contact_form.php'; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
@@ -35,7 +35,7 @@ ob_start();
|
||||
<select class="form-select select2" name="type">
|
||||
<?= categoryOptionsHtml('contact_note_type') ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('contact_note_type', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('contact_note_type') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -163,7 +163,6 @@ $form_id = 'credentialForm' . ($credential_form_mode === 'edit' ? $credential_id
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-text">The device this login is for - it shows on the asset's Credentials tab.</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label class="form-label">Contact</label>
|
||||
|
||||
@@ -96,7 +96,7 @@ $form_id = 'domainForm' . ($domain_form_mode === 'edit' ? $domain_id : 'New');
|
||||
<div class="col-12 d-none" data-domain-several>
|
||||
<label class="form-label">Domain names <strong class="text-danger">*</strong></label>
|
||||
<textarea class="form-control font-monospace" name="names" rows="8" placeholder="example.com example.net shop.example.org" disabled data-domain-names></textarea>
|
||||
<div class="form-text">One per line - or separated by spaces or commas. Each is looked up as it is added; ones already on the client are skipped. The registrar, hosts, auto-renew and tags you set here go on all of them.</div>
|
||||
<div class="form-text">One per line, or separated by spaces or commas. The registrar, hosts, auto-renew and tags here go on all of them.</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="col-12" data-domain-one>
|
||||
|
||||
@@ -57,7 +57,7 @@ ob_start();
|
||||
<option value="">- Pick a category -</option>
|
||||
<?= categoryOptionsHtml('Expense') ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('Expense', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('Expense') ?>
|
||||
<?php } elseif ($field === 'account') { ?>
|
||||
<select class="form-select select2" name="value" required>
|
||||
<option value="">- Pick an account -</option>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<span class="text-body-secondary small me-auto" id="modalPosition"></span>
|
||||
<button type="button" class="btn btn-outline-light" id="modalDetails"><i class="fas fa-fw fa-info-circle me-2"></i>Details</button>
|
||||
<a class="btn btn-primary" id="modalDownload" href="#"><i class="fas fa-fw fa-download me-2"></i>Download</a>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><i class="fas fa-fw fa-times me-2"></i>Close</button>
|
||||
<button type="button" class="btn btn-light" data-bs-dismiss="modal"><i class="fas fa-fw fa-times me-2"></i>Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -82,7 +82,7 @@ ob_start();
|
||||
<option value="">- Pick a category -</option>
|
||||
<?= categoryOptionsHtml('Income', null, ['exclude' => ['Account Transfer']]) ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('Income', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('Income') ?>
|
||||
<?php } elseif ($field === 'account') { ?>
|
||||
<select class="form-select select2" name="value" required>
|
||||
<option value="">- Pick the account it went into -</option>
|
||||
|
||||
@@ -30,7 +30,7 @@ ob_start();
|
||||
<option value="">- Pick a category -</option>
|
||||
<?= categoryOptionsHtml('Income') ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('Income', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('Income') ?>
|
||||
</div>
|
||||
<div class="form-text">Reports group income by it.</div>
|
||||
</div>
|
||||
|
||||
@@ -37,7 +37,7 @@ ob_start();
|
||||
<?= categoryOptionHtml($category_row) ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('kb', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('kb') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ $kb_form_audience = $kb_form_mode === 'edit' ? kbAudienceFields($kb_form) : ['vi
|
||||
<?= categoryOptionHtml($category_row, intval($category_id) === $kb_form_category) ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('kb', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('kb') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
|
||||
@@ -28,6 +28,10 @@ $location_tag_ids = [];
|
||||
$client_has_location = $client_id ? intval(mysqli_fetch_row(mysqli_query($mysqli, "SELECT COUNT(*) FROM locations WHERE location_client_id = $client_id AND location_archived_at IS NULL"))[0]) : 1;
|
||||
$location_primary = !empty($_GET['primary']) || !$client_has_location ? 1 : 0;
|
||||
|
||||
// Opened by the + beside a location picker in another window (quickAddButton()) - js/quick_add.js
|
||||
// saves it in the background and picks it there
|
||||
$inline = !empty($_GET['inline']);
|
||||
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
@@ -35,13 +39,15 @@ ob_start();
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-map-marker-alt me-2"></i>New Location</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<form action="post.php" method="post" enctype="multipart/form-data" autocomplete="off">
|
||||
<form action="post.php" method="post" enctype="multipart/form-data" autocomplete="off"<?= $inline ? ' data-quick-add-inline' : '' ?>>
|
||||
<input type="hidden" name="csrf_token" value="<?= $_SESSION['csrf_token'] ?>">
|
||||
<?php if ($inline) { ?><input type="hidden" name="inline" value="1"><?php } ?>
|
||||
<?php if ($client_id) { ?>
|
||||
<input type="hidden" name="client_id" value="<?= $client_id ?>">
|
||||
<?php } ?>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="alert alert-danger small py-2" role="alert" data-quick-add-error hidden></div>
|
||||
<?php require 'location_form.php'; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
@@ -111,7 +111,7 @@ $form_id = 'locationForm' . ($location_form_mode === 'edit' ? $location_id : 'Ne
|
||||
<div class="d-flex align-items-center gap-3">
|
||||
<?= pictureField('file', $location_photo ? 'remove_photo' : '', $location_photo ? picturePhoto('../uploads/clients/' . intval($client_id) . '/' . html_entity_decode($location_photo), 'Photo') : picturePhotoEmpty(), picturePhotoEmpty(),
|
||||
['shapes' => 'square,4:3,whole']) ?>
|
||||
<div class="form-text mt-0">The front of the building - so a tech knows it when they pull up. Click it to add a photo or change it.</div>
|
||||
<div class="form-text mt-0">The front of the building, so a tech knows it when they pull up.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -182,7 +182,6 @@ $form_id = 'locationForm' . ($location_form_mode === 'edit' ? $location_id : 'Ne
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-text">Who to ask for when you get there - shown with their number on the location.</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="col-md-8">
|
||||
@@ -222,7 +221,6 @@ $form_id = 'locationForm' . ($location_form_mode === 'edit' ? $location_id : 'Ne
|
||||
<div class="tab-pane fade" id="<?= $form_id ?>Access">
|
||||
<label class="form-label">Access notes</label>
|
||||
<textarea class="form-control" rows="10" name="notes" placeholder="Parking, which door to use, who holds the keys, alarm and door codes, where the comms cupboard is, anything a tech should know before they arrive"><?= $location_notes ?></textarea>
|
||||
<div class="form-text">Shown on the location page, its quick look and on tickets for this location.</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -30,7 +30,7 @@ ob_start();
|
||||
<select class="form-select select2" name="bulk_category_id">
|
||||
<?= categoryOptionsHtml('Income') ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('Income', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('Income') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ if ($form_vendor_id && !isset($form_vendors[$form_vendor_id]) && $form_value('ve
|
||||
<option value="">- Category -</option>
|
||||
<?= categoryOptionsHtml('Income', $form_category_id) ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('Income', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('Income') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
|
||||
@@ -78,7 +78,7 @@ ob_start();
|
||||
<label class="form-label">Description</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text align-items-start pt-2"><i class="fas fa-fw fa-align-left"></i></span>
|
||||
<textarea class="form-control" name="description" rows="2" placeholder="Model, size, colour - goes on the purchase order"><?= escapeHtml((string) ($item['order_item_description'] ?? '')) ?></textarea>
|
||||
<textarea class="form-control" name="description" rows="2" placeholder="Model, size, color - goes on the purchase order"><?= escapeHtml((string) ($item['order_item_description'] ?? '')) ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
|
||||
@@ -41,7 +41,7 @@ isset($mysqli) || die("Direct file access is not allowed");
|
||||
<?php // Rack types from Admin > Categories - one the rack has that is archived or isn't a type any more stays an option, or the required select would change it on every edit ?>
|
||||
<?= categoryOptionsHtml('rack_type', html_entity_decode($rack_type, ENT_QUOTES, 'UTF-8')) ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('rack_type', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('rack_type') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ ob_start();
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
$ticket_template_hint = "Picking one fills in the recurring ticket - change anything before it is saved. <span class=\"font-monospace\">[Client]</span>, <span class=\"font-monospace\">[Month]</span> and the like are filled in each time it raises a ticket, and what the template asks for is answered once here.";
|
||||
$ticket_template_hint = "<span class=\"font-monospace\">[Client]</span>, <span class=\"font-monospace\">[Month]</span> and the like in it are filled in each time it raises a ticket.";
|
||||
require_once '../../includes/inc_ticket_template_select.php';
|
||||
?>
|
||||
|
||||
@@ -135,7 +135,7 @@ ob_start();
|
||||
<option value="0">- Not Categorized -</option>
|
||||
<?= categoryOptionsHtml('Ticket') ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('Ticket', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('Ticket') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -31,7 +31,7 @@ ob_start();
|
||||
<option value="0">- Uncategorized -</option>
|
||||
<?= categoryOptionsHtml('Ticket') ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('Ticket', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('Ticket') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -112,7 +112,7 @@ ob_start();
|
||||
foreach (ticketFillInsStored('recurring_ticket', $recurring['recurring_ticket_id']) as $answer) {
|
||||
$ticket_template_fill_in_values[$answer['name']] = $answer['value'];
|
||||
}
|
||||
$ticket_template_hint = "Picking one fills in the recurring ticket - change anything before it is saved. <span class=\"font-monospace\">[Client]</span>, <span class=\"font-monospace\">[Month]</span> and the like are filled in each time it raises a ticket, and what the template asks for is answered once here.";
|
||||
$ticket_template_hint = "<span class=\"font-monospace\">[Client]</span>, <span class=\"font-monospace\">[Month]</span> and the like in it are filled in each time it raises a ticket.";
|
||||
require_once '../../includes/inc_ticket_template_select.php';
|
||||
?>
|
||||
|
||||
@@ -151,7 +151,7 @@ ob_start();
|
||||
<option value="0">- Not categorized -</option>
|
||||
<?= categoryOptionsHtml('Ticket', $category_id) ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('Ticket', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('Ticket') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -141,7 +141,7 @@ $form_id = 'softwareForm' . ($software_form_mode === 'edit' ? $software_id : 'Ne
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-text">Fills in the name, type, license type, description, seats, vendor, renewal date and notes - change anything after. The license remembers it.</div>
|
||||
<div class="form-text">Fills in the details - change anything after.</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
@@ -172,7 +172,7 @@ $form_id = 'softwareForm' . ($software_form_mode === 'edit' ? $software_id : 'Ne
|
||||
<option value="">- Select Type -</option>
|
||||
<?= categoryOptionsHtml('software_type', $software_type_raw) ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('software_type', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('software_type') ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($client_id) { ?>
|
||||
@@ -268,7 +268,6 @@ $form_id = 'softwareForm' . ($software_form_mode === 'edit' ? $software_id : 'Ne
|
||||
<button type="button" class="btn btn-outline-secondary" data-renew-term="1y" title="A year after it was bought (or today)">1 yr</button>
|
||||
<button type="button" class="btn btn-outline-secondary" data-renew-term="3y" title="Three years after it was bought (or today)">3 yr</button>
|
||||
</div>
|
||||
<div class="form-text">Shows on the client overview's renewals and the dashboard as it gets close.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -182,7 +182,7 @@ ob_start();
|
||||
<select class="form-select select2" name="contact_id" id="contactSelect" data-selected="<?= $contact_id ?>">
|
||||
<option value="0">- No One -</option>
|
||||
</select>
|
||||
<?= quickAddButton('contact', 0, 'btn btn-secondary') ?>
|
||||
<?= quickAddButton('contact', 0) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -231,7 +231,7 @@ ob_start();
|
||||
<option value="0">- Not Categorized -</option>
|
||||
<?= categoryOptionsHtml('Ticket', $prefill_category_id ?: null) ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('Ticket', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('Ticket') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -273,11 +273,11 @@ ob_start();
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Where it starts, and the work booked - as the ticket's own status menu and Schedule window -->
|
||||
<!-- Where it starts - as the ticket's own status menu - and its tags -->
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="mb-3">
|
||||
<label>Status</label>
|
||||
<label class="form-label">Status</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-info-circle"></i></span>
|
||||
<select class="form-select select2" name="status">
|
||||
@@ -291,27 +291,28 @@ ob_start();
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="mb-3">
|
||||
<label>Schedule</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-calendar-day"></i></span>
|
||||
<input type="datetime-local" class="form-control" name="schedule" min="<?= date('Y-m-d\TH:i') ?>" value="<?= escapeHtml($prefill_schedule) ?>" aria-label="Date and time of the work">
|
||||
<select class="form-select flex-grow-0 w-auto" name="schedule_minutes" aria-label="How long">
|
||||
<?php foreach (ticketScheduleLengths($prefill_schedule_minutes) as $minutes => $label) { ?>
|
||||
<option value="<?= intval($minutes) ?>" <?= intval($minutes) === $prefill_schedule_minutes ? 'selected' : '' ?>><?= escapeHtml($label) ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<select class="form-select flex-grow-0 w-auto" name="onsite" aria-label="Visit">
|
||||
<option value="0">Remote</option>
|
||||
<option value="1">Onsite</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-text">When, how long and where. Leave it empty to book the work later.</div>
|
||||
<?= tagFormFieldHtml('ticket', [], 'Onboarding, Hardware, Escalated', 'Tags', 'data-template-field="tags"') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- The work booked, as the ticket's own Schedule window - a row of its own, so the date has room beside how long and where -->
|
||||
<div class="mb-3">
|
||||
<?= tagFormFieldHtml('ticket', [], 'Onboarding, Hardware, Escalated', 'Tags', 'data-template-field="tags"') ?>
|
||||
<label>Schedule</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-calendar-day"></i></span>
|
||||
<input type="datetime-local" class="form-control" name="schedule" min="<?= date('Y-m-d\TH:i') ?>" value="<?= escapeHtml($prefill_schedule) ?>" aria-label="Date and time of the work">
|
||||
<select class="form-select flex-grow-0 w-auto" name="schedule_minutes" aria-label="How long">
|
||||
<?php foreach (ticketScheduleLengths($prefill_schedule_minutes) as $minutes => $label) { ?>
|
||||
<option value="<?= intval($minutes) ?>" <?= intval($minutes) === $prefill_schedule_minutes ? 'selected' : '' ?>><?= escapeHtml($label) ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<select class="form-select flex-grow-0 w-auto" name="onsite" aria-label="Visit">
|
||||
<option value="0">Remote</option>
|
||||
<option value="1">Onsite</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-text">Leave it empty to book the work later.</div>
|
||||
</div>
|
||||
|
||||
<?php if ($config_module_enable_accounting) { ?>
|
||||
@@ -366,7 +367,7 @@ ob_start();
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-map-marker-alt"></i></span>
|
||||
<select class="form-select select2" name="location_id" id="locationSelect" data-selected="<?= $location_id ?>">
|
||||
</select>
|
||||
<?= quickAddButton('location', 0, 'btn btn-secondary') ?>
|
||||
<?= quickAddButton('location', 0) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -379,7 +380,7 @@ ob_start();
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-building"></i></span>
|
||||
<select class="form-select select2" name="vendor_id" id="vendorSelect" data-selected="<?= $vendor_id ?>">
|
||||
</select>
|
||||
<?= quickAddButton('vendor', 0, 'btn btn-secondary') ?>
|
||||
<?= quickAddButton('vendor', 0) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -33,7 +33,7 @@ ob_start();
|
||||
<option value="0">- Uncategorized -</option>
|
||||
<?= categoryOptionsHtml('Ticket') ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('Ticket', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('Ticket') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -135,7 +135,7 @@ ob_start();
|
||||
<option value="0">- Not categorized -</option>
|
||||
<?= categoryOptionsHtml('Ticket', $ticket_category) ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('Ticket', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('Ticket') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -138,7 +138,7 @@ ob_start();
|
||||
<option value="">- Category -</option>
|
||||
<?= categoryOptionsHtml('Income') ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('Income', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('Income') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12" data-ticket-invoice-new>
|
||||
|
||||
@@ -115,7 +115,7 @@ ob_start();
|
||||
<option value="">- Select a Category -</option>
|
||||
<?= categoryOptionsHtml('Income') ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('Income', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('Income') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
8
agent/modals/vendor/vendor_add.php
vendored
8
agent/modals/vendor/vendor_add.php
vendored
@@ -28,6 +28,10 @@ $vendor_template_id = 0;
|
||||
$vendor_tag_ids = [];
|
||||
$vendor_template_focus = !empty($_GET['from_template']);
|
||||
|
||||
// Opened by the + beside a vendor picker in another window (quickAddButton()) - js/quick_add.js
|
||||
// saves it in the background and picks it there
|
||||
$inline = !empty($_GET['inline']);
|
||||
|
||||
// Started from a template - its fields, escaped like the rest
|
||||
$template = vendorTemplateRow($_GET['template_id'] ?? 0);
|
||||
if ($template) {
|
||||
@@ -47,13 +51,15 @@ ob_start();
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-building me-2"></i>New <?= $client_id || $vendor_pick_client ? '' : 'Company ' ?>Vendor</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<form action="post.php" method="post" autocomplete="off"<?= $inline ? ' data-quick-add-inline' : '' ?>>
|
||||
<input type="hidden" name="csrf_token" value="<?= $_SESSION['csrf_token'] ?>">
|
||||
<?php if ($inline) { ?><input type="hidden" name="inline" value="1"><?php } ?>
|
||||
<?php if (!$vendor_pick_client) { ?>
|
||||
<input type="hidden" name="client_id" value="<?= $client_id ?>">
|
||||
<?php } ?>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="alert alert-danger small py-2" role="alert" data-quick-add-error hidden></div>
|
||||
<?php require 'vendor_form.php'; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
9
agent/modals/vendor/vendor_form.php
vendored
9
agent/modals/vendor/vendor_form.php
vendored
@@ -106,7 +106,7 @@ $form_id = 'vendorForm' . ($vendor_form_mode === 'edit' ? $vendor_id : 'New');
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label class="form-label">What they are</label>
|
||||
<label class="form-label">Description</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-align-left"></i></span>
|
||||
<input type="text" class="form-control" name="description" placeholder="Primary internet circuit, practice management software" maxlength="200" value="<?= $vendor_description ?>">
|
||||
@@ -135,7 +135,6 @@ $form_id = 'vendorForm' . ($vendor_form_mode === 'edit' ? $vendor_id : 'New');
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-text">Template changes can be pushed to every vendor based on it, from Admin › Vendor Templates.</div>
|
||||
</div>
|
||||
<?php } elseif ($vendor_form_mode === 'edit') { ?>
|
||||
<input type="hidden" name="vendor_template_id" value="<?= intval($vendor_template_id) ?>">
|
||||
@@ -207,7 +206,7 @@ $form_id = 'vendorForm' . ($vendor_form_mode === 'edit' ? $vendor_id : 'New');
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="form-text mt-0">Where they post outages, and where you sign in to open a case - link the login itself from the vendor's Logins tab.</div>
|
||||
<div class="form-text mt-0">Where they post outages, and where you sign in to open a case.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -230,7 +229,7 @@ $form_id = 'vendorForm' . ($vendor_form_mode === 'edit' ? $vendor_id : 'New');
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="form-text mt-0">What support asks for to check it's you - shown beside the support line, with the PIN hidden until you click it.</div>
|
||||
<div class="form-text mt-0">What support asks for to check it's you.</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label class="form-label">Account manager</label>
|
||||
@@ -260,7 +259,7 @@ $form_id = 'vendorForm' . ($vendor_form_mode === 'edit' ? $vendor_id : 'New');
|
||||
<!-- Everything else -->
|
||||
<div class="tab-pane fade" id="<?= $form_id ?>Notes">
|
||||
<label class="form-label">Notes</label>
|
||||
<textarea class="form-control" rows="10" name="notes" placeholder="Escalation path, who is authorised to call them, circuit IDs, contract renewal, anything the next tech should know before they ring"><?= $vendor_notes ?></textarea>
|
||||
<textarea class="form-control" rows="10" name="notes" placeholder="Escalation path, who is authorized to call them, circuit IDs, contract renewal, anything the next tech should know before they call"><?= $vendor_notes ?></textarea>
|
||||
<div class="form-text">Shown on the vendor's page and its quick look.</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -356,7 +356,7 @@ $csrf = $_SESSION['csrf_token'];
|
||||
</div>
|
||||
<!-- On a phone the other columns are off to the side - the subnet comes along -->
|
||||
<div class="d-md-none small font-monospace mt-1"><?= escapeHtml($row['network']) ?><?= $row['network_gateway'] ? ' · gw ' . escapeHtml($row['network_gateway']) : '' ?></div>
|
||||
<?php if (!empty($networks_tags[$network_id]) || ($can_edit && !$is_archived)) { ?>
|
||||
<?php if (!empty($networks_tags[$network_id])) { ?>
|
||||
<div class="mt-1"><?= tagPills('network', $network_id, $networks_tags[$network_id] ?? [], "networks.php?$client_url", $can_edit && !$is_archived) ?></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
@@ -87,6 +87,10 @@ if (isset($_POST['add_contact'])) {
|
||||
|
||||
triggerCustomAction('contact_create', $contact_id);
|
||||
|
||||
$contact_label = getFieldById('contacts', $contact_id, 'contact_name');
|
||||
inlineSaveAnswer(['ok' => true, 'value' => (string) $contact_id, 'label' => $contact_label,
|
||||
'message' => "Contact $contact_label created" . ($invited === false ? ' - the portal invite was not sent' : ''), 'warning' => $invited === false]);
|
||||
|
||||
flashAlert("Contact <strong>" . stripslashes($name) . "</strong> created" . ($invited ? ' and invited to the client portal' : ($invited === false ? ' - the portal invite was not sent, as ' . (portalMailReady() ? 'their email address is not valid' : 'outgoing mail is not set up') : '')), $invited === false ? 'warning' : 'success');
|
||||
|
||||
redirect();
|
||||
|
||||
@@ -50,6 +50,7 @@ if (isset($_POST['add_location'])) {
|
||||
|
||||
$set = locationFormSet($_POST, $client_id);
|
||||
if ($set === null) {
|
||||
inlineSaveAnswer(['ok' => false, 'error' => 'A location needs a name.']);
|
||||
flashAlert('A location needs a name.', 'error');
|
||||
redirect();
|
||||
}
|
||||
@@ -70,6 +71,8 @@ if (isset($_POST['add_location'])) {
|
||||
$name = trim($_POST['name']);
|
||||
logAudit("Location", "Create", "$session_name created location " . escapeSql($name), $client_id, $location_id);
|
||||
|
||||
inlineSaveAnswer(['ok' => true, 'value' => (string) $location_id, 'label' => $name, 'message' => "Location $name created"]);
|
||||
|
||||
flashAlert("Location <strong>$name</strong> created");
|
||||
|
||||
redirect();
|
||||
|
||||
@@ -51,12 +51,14 @@ if (isset($_POST['add_vendor'])) {
|
||||
$client_id = intval($_POST['client_id'] ?? 0);
|
||||
vendorEnforce($client_id, 2);
|
||||
if ($client_id && !getFieldById('clients', $client_id, 'client_name')) {
|
||||
inlineSaveAnswer(['ok' => false, 'error' => 'That client no longer exists.']);
|
||||
flashAlert('That client no longer exists.', 'error');
|
||||
redirect();
|
||||
}
|
||||
|
||||
$vendor_id = vendorCreate($_POST, $client_id);
|
||||
if (!$vendor_id) {
|
||||
inlineSaveAnswer(['ok' => false, 'error' => 'A vendor needs a name.']);
|
||||
flashAlert('A vendor needs a name.', 'error');
|
||||
redirect();
|
||||
}
|
||||
@@ -67,6 +69,8 @@ if (isset($_POST['add_vendor'])) {
|
||||
$template_note = intval($_POST['vendor_template_id'] ?? 0) ? ' from a template' : '';
|
||||
logAudit("Vendor", "Create", "$session_name created vendor " . escapeSql($name) . $template_note, $client_id, $vendor_id);
|
||||
|
||||
inlineSaveAnswer(['ok' => true, 'value' => (string) $vendor_id, 'label' => $name, 'message' => "Vendor $name created"]);
|
||||
|
||||
flashAlert("Vendor <strong>$name</strong> created");
|
||||
|
||||
redirect();
|
||||
|
||||
@@ -170,7 +170,7 @@ if ($next_label !== '') {
|
||||
'sub' => $next_named ? '<span class="text-body-tertiary">Most:</span> ' . escapeHtml($next_named[0]['name']) . ' <span class="text-body-tertiary">(' . geographyNoun($next_named[0]['clients'], 'client') . ')</span>' : ''];
|
||||
}
|
||||
$stats[] = ['label' => 'Incomplete addresses', 'value' => reportCount($gaps), 'tone' => $gaps ? 'warning' : 'success',
|
||||
'sub' => '<span class="text-body-tertiary">' . ($gaps ? 'No city, or a country or state not recognised' : 'Every location placed') . '</span>'];
|
||||
'sub' => '<span class="text-body-tertiary">' . ($gaps ? 'No city, or a country or state not recognized' : 'Every location placed') . '</span>'];
|
||||
|
||||
// The map: the world by country, or this country's states - shaded by clients or locations
|
||||
$map_name = $level === 0 ? 'world' : (REPORT_GEO_MAPS[$country] ?? '');
|
||||
@@ -241,7 +241,7 @@ $controls .= reportSwitchControl('leads', $leads, 'Include leads');
|
||||
</div>
|
||||
<?php if ($off_map) { ?>
|
||||
<div class="card-footer small text-body-secondary">
|
||||
<?= geographyNoun($off_map, 'location') ?> could not be placed on the map - the <?= $level === 0 ? 'country' : strtolower($term) ?> is not filled in or not recognised. They are in the table below.
|
||||
<?= geographyNoun($off_map, 'location') ?> could not be placed on the map - the <?= $level === 0 ? 'country' : strtolower($term) ?> is not filled in or not recognized. They are in the table below.
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
@@ -331,7 +331,7 @@ $link_icons = ['asset' => ['fa-desktop', 'asset', 'assets'], 'credential' => ['f
|
||||
<?php if ($detail !== '') { ?>
|
||||
<div class="small text-body-secondary text-truncate itflow-service-desc" title="<?= escapeHtml($detail) ?>"><?= escapeHtml($detail) ?></div>
|
||||
<?php } ?>
|
||||
<?php if ($service_tags || ($can_edit && !$is_archived)) { ?>
|
||||
<?php if ($service_tags) { ?>
|
||||
<div class="mt-1"><?= tagPills('service', $service_id, $service_tags, "services.php?$client_url", $can_edit && !$is_archived) ?></div>
|
||||
<?php } ?>
|
||||
<!-- Narrower screens drop the Depends on column - the chips come along -->
|
||||
|
||||
@@ -479,7 +479,7 @@ while ($license_type_row = mysqli_fetch_row($sql_license_types)) {
|
||||
<?php if ($software_favorite) { ?><i class="fas fa-star text-warning ms-1" title="Favorite"></i><?php } ?>
|
||||
<?php if ($software_archived_at) { ?><span class="badge rounded-pill text-bg-secondary fw-normal ms-1">Archived</span><?php } ?>
|
||||
<div class="small text-body-secondary text-truncate itflow-asset-desc" title="<?= $software_description ?: $software_type ?>"><?= $software_description ?: $software_type ?></div>
|
||||
<?php if ($license_tags || ($can_tag && !$software_archived_at)) { ?>
|
||||
<?php if ($license_tags) { ?>
|
||||
<div class="mt-1 itflow-above-stretch"><?= tagPills('license', $software_id, $license_tags, "software.php?$client_url", $can_tag && !$software_archived_at) ?></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
@@ -360,7 +360,6 @@ $hours_text = function ($hours) {
|
||||
<th>Client</th>
|
||||
<?php if ($with_time) { ?>
|
||||
<th class="text-end">Tickets</th>
|
||||
<th class="text-end d-none d-lg-table-cell">Logged</th>
|
||||
<th class="text-end d-none d-sm-table-cell">Bill</th>
|
||||
<th class="text-end d-none d-lg-table-cell">Rate</th>
|
||||
<?php } ?>
|
||||
@@ -444,13 +443,20 @@ $hours_text = function ($hours) {
|
||||
<div class="small text-warning-emphasis text-nowrap" title="No time logged - they go on the invoice with no charge unless you open the client and type the hours"><?= $c['no_time'] ?> with no time</div>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td class="text-end text-nowrap d-none d-lg-table-cell"><?= $c['tickets'] ? billingDuration($c['seconds']) : '<span class="text-body-secondary">-</span>' ?></td>
|
||||
<td class="text-end text-nowrap d-none d-sm-table-cell"><?= $c['tickets'] ? $hours_text($c['hours']) : '<span class="text-body-secondary">-</span>' ?></td>
|
||||
<!-- What it bills, with the time logged under it -->
|
||||
<td class="text-end text-nowrap d-none d-sm-table-cell">
|
||||
<?php if ($c['tickets']) { ?>
|
||||
<?= $hours_text($c['hours']) ?>
|
||||
<div class="small text-body-secondary" title="Time logged"><?= billingDuration($c['seconds']) ?> logged</div>
|
||||
<?php } else { ?>
|
||||
<span class="text-body-secondary">-</span>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td class="text-end text-nowrap d-none d-lg-table-cell">
|
||||
<?php if (!$c['tickets']) { ?>
|
||||
<span class="text-body-secondary">-</span>
|
||||
<?php } elseif (count($c['rates'] ?? []) > 1) { ?>
|
||||
<span class="small" title="An after-hours rate, or a change of contract - each ticket bills at its own">Each its own</span>
|
||||
<span class="small" title="An after-hours rate, or a change of contract - each ticket bills at its own">Varies</span>
|
||||
<?php } elseif ($c['rate'] > 0 || !$c['default_rate']) { ?>
|
||||
<?= $money($c['rate']) ?><?= $c['default_rate'] ? '<div class="small text-body-tertiary" title="No contract in force sets a rate - the default in Admin > Settings > Defaults">default</div>' : (in_array($c['rate_source'] ?? '', ['contract', 'after_hours'], true) ? '<div class="small text-body-tertiary" title="' . escapeHtml(ucfirst($c['rate_note'])) . '">contract</div>' : '') ?>
|
||||
<?php } else { ?>
|
||||
@@ -539,7 +545,7 @@ $hours_text = function ($hours) {
|
||||
<option value="">- Category -</option>
|
||||
<?= categoryOptionsHtml('Income') ?>
|
||||
</select>
|
||||
<?= categoryAddButtonHtml('Income', 'btn btn-secondary') ?>
|
||||
<?= categoryAddButtonHtml('Income') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12" data-unbilled-new>
|
||||
@@ -568,7 +574,7 @@ $hours_text = function ($hours) {
|
||||
<label class="form-label">Rate<?= $one_rate ? ' <strong class="text-danger">*</strong>' : '' ?></label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-dollar-sign"></i></span>
|
||||
<input type="text" class="form-control text-end" name="price" inputmode="decimal" value="<?= $one_rate ? number_format($this_client['rate'], 2, '.', '') : '' ?>" placeholder="Each its own"<?= $one_rate ? ' required' : '' ?> data-unbilled-rate>
|
||||
<input type="text" class="form-control text-end" name="price" inputmode="decimal" value="<?= $one_rate ? number_format($this_client['rate'], 2, '.', '') : '' ?>" placeholder="Each ticket's own"<?= $one_rate ? ' required' : '' ?> data-unbilled-rate>
|
||||
</div>
|
||||
<div class="form-text"><?= !$one_rate ? "Each ticket at its own rate - a contract's sets some. Type one to bill them all at it." : 'An hour - ' . ($this_client['default_rate'] ? 'the default, the client has no rate' : escapeHtml($this_client['rate_note'] ?: "the client's rate")) ?></div>
|
||||
</div>
|
||||
|
||||
@@ -466,7 +466,7 @@ if (!$vendor || (isset($_GET['client_id']) && $vendor_client_id !== intval($clie
|
||||
<div class="card-header">
|
||||
<h3 class="card-title mb-0"><i class="fas fa-fw fa-sticky-note text-secondary me-2"></i>Notes</h3>
|
||||
</div>
|
||||
<textarea class="form-control border-0 rounded-0 rounded-bottom itflow-vendor-notes" rows="7" placeholder="Escalation path, who is authorised to call them, circuit IDs, contract renewal - saves when you click away"
|
||||
<textarea class="form-control border-0 rounded-0 rounded-bottom itflow-vendor-notes" rows="7" placeholder="Escalation path, who is authorized to call them, circuit IDs, contract renewal - saves when you click away"
|
||||
data-vendor-id="<?= $vendor_id ?>" data-csrf="<?= escapeHtml($_SESSION['csrf_token']) ?>" <?= $can_edit ? '' : 'readonly' ?>><?= $vendor_notes ?></textarea>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -362,7 +362,7 @@ $missing_templates = $view === 'client' && !$archived ? vendorTemplatesMissingFo
|
||||
<?php if ($vendor_description) { ?>
|
||||
<div class="small text-body-secondary text-truncate itflow-asset-desc" title="<?= $vendor_description ?>"><?= $vendor_description ?></div>
|
||||
<?php } ?>
|
||||
<?php if ($vendor_tags || $row_can_edit) { ?>
|
||||
<?php if ($vendor_tags) { ?>
|
||||
<div class="mt-1 itflow-above-stretch"><?= tagPills('vendor', $vendor_id, $vendor_tags, $tag_base, $row_can_edit) ?></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user