';
} else {
print '
'.$langs->trans('TicketPublicInfoCreateTicket').'
';
- $formticket->showForm();
+ $formticket->showForm(0, 'edit', 1);
}
}
diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php
index 945e58630fe..125aa5acd82 100644
--- a/htdocs/public/ticket/list.php
+++ b/htdocs/public/ticket/list.php
@@ -432,7 +432,7 @@ if ($action == "view_ticketlist") {
if (!empty($arrayfields['category.code']['checked'])) {
print '
';
- $formTicket->selectGroupTickets($search_category, 'search_category', '', 2, 1, 1);
+ $formTicket->selectGroupTickets($search_category, 'search_category', 'public=1', 2, 1, 1);
print ' | ';
}
diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php
index da04a37dc93..8741fdc6b66 100644
--- a/htdocs/ticket/card.php
+++ b/htdocs/ticket/card.php
@@ -691,7 +691,7 @@ if ($action == 'create' || $action == 'presend') {
$formticket->withextrafields = 1;
$formticket->param = array('origin' => GETPOST('origin'), 'originid' => GETPOST('originid'));
- $formticket->showForm(1, 'create');
+ $formticket->showForm(1, 'create', 0);
} elseif ($action == 'edit' && $user->rights->ticket->write && $object->fk_statut < Ticket::STATUS_CLOSED) {
$formticket = new FormTicket($db);
diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php
index 0ba818b8e0b..93806bb86aa 100644
--- a/htdocs/ticket/class/ticket.class.php
+++ b/htdocs/ticket/class/ticket.class.php
@@ -1177,7 +1177,7 @@ class Ticket extends CommonObject
}
// Cache deja charge
- $sql = "SELECT rowid, code, label, use_default, pos, description";
+ $sql = "SELECT rowid, code, label, use_default, pos, description, public, active";
$sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_category";
$sql .= " WHERE active > 0";
$sql .= " ORDER BY pos";
@@ -1194,6 +1194,8 @@ class Ticket extends CommonObject
$this->cache_category_tickets[$obj->rowid]['label'] = $label;
$this->cache_category_tickets[$obj->rowid]['use_default'] = $obj->use_default;
$this->cache_category_tickets[$obj->rowid]['pos'] = $obj->pos;
+ $this->cache_category_tickets[$obj->rowid]['public'] = $obj->public;
+ $this->cache_category_tickets[$obj->rowid]['active'] = $obj->active;
$i++;
}
return $num;