mirror of https://github.com/itflow-org/itflow
Tickets api - allow setting the billable status when creating a ticket
This commit is contained in:
parent
421abd4c5b
commit
eadfdc41c4
|
|
@ -39,7 +39,7 @@ if (!empty($subject)) {
|
|||
|
||||
// Insert ticket
|
||||
$url_key = randomString(156);
|
||||
$insert_sql = mysqli_query($mysqli,"INSERT INTO tickets SET ticket_prefix = '$config_ticket_prefix', ticket_number = $ticket_number, ticket_subject = '$subject', ticket_details = '$details', ticket_priority = '$priority', ticket_status = 1, ticket_vendor_ticket_number = '$vendor_ticket_number', ticket_vendor_id = $vendor_id, ticket_created_by = 0, ticket_assigned_to = $assigned_to, ticket_contact_id = $contact, ticket_url_key = '$url_key', ticket_client_id = $client_id");
|
||||
$insert_sql = mysqli_query($mysqli,"INSERT INTO tickets SET ticket_prefix = '$config_ticket_prefix', ticket_number = $ticket_number, ticket_subject = '$subject', ticket_details = '$details', ticket_priority = '$priority', ticket_status = 1, ticket_billable = $billable, ticket_vendor_ticket_number = '$vendor_ticket_number', ticket_vendor_id = $vendor_id, ticket_created_by = 0, ticket_assigned_to = $assigned_to, ticket_contact_id = $contact, ticket_url_key = '$url_key', ticket_client_id = $client_id");
|
||||
|
||||
// Check insert & get insert ID
|
||||
if ($insert_sql) {
|
||||
|
|
|
|||
|
|
@ -59,3 +59,11 @@ if (isset($_POST['ticket_assigned_to'])) {
|
|||
} else {
|
||||
$assigned_to = '0';
|
||||
}
|
||||
|
||||
if (isset($_POST['ticket_billable'])) {
|
||||
$billable = intval($_POST['ticket_billable']);
|
||||
} elseif ($ticket_row) {
|
||||
$billable = $ticket_row['ticket_billable'];
|
||||
} else {
|
||||
$billable = '0';
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue