Categories, keeping one the license has that is archived or isn't a type any more $software_type_raw = html_entity_decode($software_type, ENT_QUOTES, 'UTF-8'); $type_options = array_map('strval', array_keys(categoryPicker('software_type', [$software_type_raw]))); // License types - the usual ones, keeping whatever this one already has $license_type_options = array_keys(SOFTWARE_LICENSE_TYPES); $software_license_type_raw = html_entity_decode($software_license_type, ENT_QUOTES, 'UTF-8'); if ($software_license_type_raw !== '' && !in_array($software_license_type_raw, $license_type_options, true)) { $license_type_options[] = $software_license_type_raw; } // The client's own lists - only once the client is known $vendor_options = $asset_options = $contact_options = []; if ($client_id) { $sql = mysqli_query($mysqli, "SELECT vendor_archived_at, vendor_id, vendor_name, vendor_description, vendor_template_id FROM vendors WHERE vendor_client_id = $client_id AND (vendor_archived_at IS NULL OR vendor_id = $software_vendor_id) ORDER BY vendor_favorite DESC, vendor_name ASC"); while ($row = mysqli_fetch_assoc($sql)) { $vendor_options[] = $row; } $sql = mysqli_query($mysqli, "SELECT asset_id, asset_name, asset_type, asset_make, asset_model, contact_name FROM assets LEFT JOIN contacts ON contact_id = asset_contact_id WHERE asset_client_id = $client_id AND asset_archived_at IS NULL ORDER BY asset_name ASC"); while ($row = mysqli_fetch_assoc($sql)) { $asset_options[] = $row; } $sql = mysqli_query($mysqli, "SELECT contact_id, contact_name, contact_title, contact_photo, contact_client_id FROM contacts WHERE contact_client_id = $client_id AND contact_archived_at IS NULL ORDER BY contact_name ASC"); while ($row = mysqli_fetch_assoc($sql)) { $contact_options[] = $row; } } else { $client_options = []; $sql = mysqli_query($mysqli, "SELECT client_id, client_name, client_abbreviation FROM clients WHERE client_archived_at IS NULL " . clientScopeSql('clients.client_id') . " ORDER BY client_name ASC"); while ($row = mysqli_fetch_assoc($sql)) { $client_options[] = $row; } } // Templates (Admin > License Templates) to start a new license from $template_options = []; if ($software_form_mode === 'add') { $sql = mysqli_query($mysqli, "SELECT software_template_id, software_template_name, software_template_version, software_template_description, software_template_type, software_template_license_type, software_template_notes, software_template_seats, software_template_term, vendor_template_id, vendor_template_name FROM software_templates LEFT JOIN vendor_templates ON vendor_template_id = software_template_vendor_template_id AND software_template_vendor_template_id > 0 AND vendor_template_archived_at IS NULL WHERE software_template_archived_at IS NULL ORDER BY software_template_name ASC"); while ($row = mysqli_fetch_assoc($sql)) { $template_options[intval($row['software_template_id'])] = [ 'name' => $row['software_template_name'], 'version' => (string) $row['software_template_version'], 'description' => (string) $row['software_template_description'], 'type' => $row['software_template_type'], 'license_type' => (string) $row['software_template_license_type'], 'notes' => (string) $row['software_template_notes'], 'seats' => $row['software_template_seats'] === null ? '' : (string) intval($row['software_template_seats']), 'term' => (string) $row['software_template_term'], 'vendor_template_id' => intval($row['vendor_template_id']), 'vendor' => (string) $row['vendor_template_name'], ]; } } // Who may have a template's vendor made for the client as the license is saved $vendor_can_make = intval(lookupUserPermission('module_client')) >= 2; $software_type_style = softwareTypeStyle($software_type); $form_id = 'softwareForm' . ($software_form_mode === 'edit' ? $software_id : 'New'); ?>
Pick the vendor and who is on it once it's saved.
Fills in the name, type, license type, description, seats, vendor, renewal date and notes - change anything after. The license remembers it.
>

License ID

Leave blank for a site or unlimited license.
The one key for the whole license, if it has one.
Hand each one to a device or user from the license's Keys tab.
Shows on the client overview's renewals and the dashboard as it gets close.
Each device and user here takes a seat.

Pick the devices and users once it's saved - they come from the client.