mirror of
https://github.com/itflow-org/itflow
synced 2026-11-11 07:01:16 +00:00
Vendor templates stage 3: add a status page and support portal to vendors and vendor templates, linked from the vendor page, quick look, vendors list and its tickets and kept in step from the template, keep the account manager line and email on templates for new vendors only, add Export and Import of vendor templates with skip, add or replace for existing names and never account numbers or PINs, refresh the starter vendor templates with support sites, status pages, portals and what support asks for plus an Update for ones added before, carry the status page and portal in license template files, the API and exports, stop making a support site with a non-http scheme a link, and database 3.3.6 adds the new vendor and vendor template columns
This commit is contained in:
2
api/v1/vendors/create.php
vendored
2
api/v1/vendors/create.php
vendored
@@ -13,7 +13,7 @@ $insert_id = false;
|
||||
if (!empty($name)) {
|
||||
|
||||
// Insert vendor
|
||||
$insert_sql = mysqli_query($mysqli, "INSERT INTO vendors SET vendor_name = '$name', vendor_description = '$description', vendor_contact_name = '$contact_name', vendor_contact_phone_country_code = '$contact_phone_country_code', vendor_contact_phone = '$contact_phone', vendor_contact_email = '$contact_email', vendor_phone_country_code = '$phone_country_code', vendor_phone = '$phone', vendor_extension = '$extension', vendor_email = '$email', vendor_website = '$website', vendor_hours = '$hours', vendor_sla = '$sla', vendor_code = '$code', vendor_account_number = '$account_number', vendor_notes = '$notes', vendor_client_id = $client_id");
|
||||
$insert_sql = mysqli_query($mysqli, "INSERT INTO vendors SET vendor_name = '$name', vendor_description = '$description', vendor_contact_name = '$contact_name', vendor_contact_phone_country_code = '$contact_phone_country_code', vendor_contact_phone = '$contact_phone', vendor_contact_email = '$contact_email', vendor_phone_country_code = '$phone_country_code', vendor_phone = '$phone', vendor_extension = '$extension', vendor_email = '$email', vendor_website = '$website', vendor_status_page = '$status_page', vendor_portal = '$portal', vendor_hours = '$hours', vendor_sla = '$sla', vendor_code = '$code', vendor_account_number = '$account_number', vendor_notes = '$notes', vendor_client_id = $client_id");
|
||||
|
||||
// Check insert & get insert ID
|
||||
if ($insert_sql) {
|
||||
|
||||
2
api/v1/vendors/update.php
vendored
2
api/v1/vendors/update.php
vendored
@@ -18,7 +18,7 @@ if (!empty($vendor_id)) {
|
||||
require_once 'vendor_model.php';
|
||||
|
||||
if ($vendor_row) {
|
||||
$update_sql = mysqli_query($mysqli, "UPDATE vendors SET vendor_name = '$name', vendor_description = '$description', vendor_contact_name = '$contact_name', vendor_contact_phone_country_code = '$contact_phone_country_code', vendor_contact_phone = '$contact_phone', vendor_contact_email = '$contact_email', vendor_phone_country_code = '$phone_country_code', vendor_phone = '$phone', vendor_extension = '$extension', vendor_email = '$email', vendor_website = '$website', vendor_hours = '$hours', vendor_sla = '$sla', vendor_code = '$code', vendor_account_number = '$account_number', vendor_notes = '$notes' WHERE vendor_id = $vendor_id AND vendor_client_id = $client_id AND vendor_archived_at IS NULL LIMIT 1");
|
||||
$update_sql = mysqli_query($mysqli, "UPDATE vendors SET vendor_name = '$name', vendor_description = '$description', vendor_contact_name = '$contact_name', vendor_contact_phone_country_code = '$contact_phone_country_code', vendor_contact_phone = '$contact_phone', vendor_contact_email = '$contact_email', vendor_phone_country_code = '$phone_country_code', vendor_phone = '$phone', vendor_extension = '$extension', vendor_email = '$email', vendor_website = '$website', vendor_status_page = '$status_page', vendor_portal = '$portal', vendor_hours = '$hours', vendor_sla = '$sla', vendor_code = '$code', vendor_account_number = '$account_number', vendor_notes = '$notes' WHERE vendor_id = $vendor_id AND vendor_client_id = $client_id AND vendor_archived_at IS NULL LIMIT 1");
|
||||
|
||||
// Check update & get affected rows
|
||||
if ($update_sql) {
|
||||
|
||||
16
api/v1/vendors/vendor_model.php
vendored
16
api/v1/vendors/vendor_model.php
vendored
@@ -98,6 +98,22 @@ if (isset($_POST['vendor_website'])) {
|
||||
$website = '';
|
||||
}
|
||||
|
||||
if (isset($_POST['vendor_status_page'])) {
|
||||
$status_page = preg_replace("(^https?://)", "", escapeSql($_POST['vendor_status_page']));
|
||||
} elseif ($vendor_row) {
|
||||
$status_page = mysqli_real_escape_string($mysqli, (string) $vendor_row['vendor_status_page']);
|
||||
} else {
|
||||
$status_page = '';
|
||||
}
|
||||
|
||||
if (isset($_POST['vendor_portal'])) {
|
||||
$portal = preg_replace("(^https?://)", "", escapeSql($_POST['vendor_portal']));
|
||||
} elseif ($vendor_row) {
|
||||
$portal = mysqli_real_escape_string($mysqli, (string) $vendor_row['vendor_portal']);
|
||||
} else {
|
||||
$portal = '';
|
||||
}
|
||||
|
||||
if (isset($_POST['vendor_hours'])) {
|
||||
$hours = escapeSql($_POST['vendor_hours']);
|
||||
} elseif ($vendor_row) {
|
||||
|
||||
Reference in New Issue
Block a user