Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
c6b404ad7f
@ -47,6 +47,12 @@ if (!defined('NOBROWSERNOTIF')) {
|
|||||||
define('NOBROWSERNOTIF', '1');
|
define('NOBROWSERNOTIF', '1');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// For MultiCompany module.
|
||||||
|
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
|
||||||
|
$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
|
||||||
|
if (is_numeric($entity)) {
|
||||||
|
define("DOLENTITY", $entity);
|
||||||
|
}
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/ticket/class/actions_ticket.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/ticket/class/actions_ticket.class.php';
|
||||||
@ -342,7 +348,7 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) {
|
|||||||
$messagetoshow = str_replace(array('{s1}', '{s2}'), array('<strong>'.$object->track_id.'</strong>', '<strong>'.$object->ref.'</strong>'), $messagetoshow);
|
$messagetoshow = str_replace(array('{s1}', '{s2}'), array('<strong>'.$object->track_id.'</strong>', '<strong>'.$object->ref.'</strong>'), $messagetoshow);
|
||||||
setEventMessages($messagetoshow, null, 'warnings');
|
setEventMessages($messagetoshow, null, 'warnings');
|
||||||
setEventMessages($langs->trans('PleaseRememberThisId'), null, 'warnings');
|
setEventMessages($langs->trans('PleaseRememberThisId'), null, 'warnings');
|
||||||
header("Location: index.php");
|
header("Location: index.php".(!empty($entity) && !empty($conf->multicompany->enabled)?'?entity='.$entity:''));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -40,7 +40,6 @@ if (!defined('NOBROWSERNOTIF')) {
|
|||||||
|
|
||||||
// For MultiCompany module.
|
// For MultiCompany module.
|
||||||
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
|
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
|
||||||
// TODO This should be useless. Because entity must be retrieve from object ref and not from url.
|
|
||||||
$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
|
$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
|
||||||
if (is_numeric($entity)) {
|
if (is_numeric($entity)) {
|
||||||
define("DOLENTITY", $entity);
|
define("DOLENTITY", $entity);
|
||||||
@ -77,7 +76,6 @@ if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
|
|||||||
print $langs->trans('TicketPublicInterfaceForbidden');
|
print $langs->trans('TicketPublicInterfaceForbidden');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$arrayofjs = array();
|
$arrayofjs = array();
|
||||||
$arrayofcss = array('/ticket/css/styles.css.php');
|
$arrayofcss = array('/ticket/css/styles.css.php');
|
||||||
|
|
||||||
@ -86,9 +84,9 @@ llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
|
|||||||
print '<div class="ticketpublicarea">';
|
print '<div class="ticketpublicarea">';
|
||||||
print '<p style="text-align: center">'.($conf->global->TICKET_PUBLIC_TEXT_HOME ? $conf->global->TICKET_PUBLIC_TEXT_HOME : $langs->trans("TicketPublicDesc")).'</p>';
|
print '<p style="text-align: center">'.($conf->global->TICKET_PUBLIC_TEXT_HOME ? $conf->global->TICKET_PUBLIC_TEXT_HOME : $langs->trans("TicketPublicDesc")).'</p>';
|
||||||
print '<div class="ticketform">';
|
print '<div class="ticketform">';
|
||||||
print '<a href="create_ticket.php" rel="nofollow noopener" class="butAction marginbottomonly"><div class="index_create bigrounded"><span class="fa fa-15x fa-plus-circle valignmiddle btnTitle-icon"></span><br>'.dol_escape_htmltag($langs->trans("CreateTicket")).'</div></a>';
|
print '<a href="create_ticket.php'.(!empty($entity) && !empty($conf->multicompany->enabled)?'?entity='.$entity:'').'" rel="nofollow noopener" class="butAction marginbottomonly"><div class="index_create bigrounded"><span class="fa fa-15x fa-plus-circle valignmiddle btnTitle-icon"></span><br>'.dol_escape_htmltag($langs->trans("CreateTicket")).'</div></a>';
|
||||||
print '<a href="list.php" rel="nofollow noopener" class="butAction marginbottomonly"><div class="index_display bigrounded"><span class="fa fa-15x fa-list-alt valignmiddle btnTitle-icon"></span><br>'.dol_escape_htmltag($langs->trans("ViewMyTicketList")).'</div></a>';
|
print '<a href="list.php'.(!empty($entity) && !empty($conf->multicompany->enabled)?'?entity='.$entity:'').'" rel="nofollow noopener" class="butAction marginbottomonly"><div class="index_display bigrounded"><span class="fa fa-15x fa-list-alt valignmiddle btnTitle-icon"></span><br>'.dol_escape_htmltag($langs->trans("ViewMyTicketList")).'</div></a>';
|
||||||
print '<a href="view.php" rel="nofollow noopener" class="butAction marginbottomonly"><div class="index_display bigrounded">'.img_picto('', 'ticket', 'class="fa-15x"').'<br>'.dol_escape_htmltag($langs->trans("ShowTicketWithTrackId")).'</div></a>';
|
print '<a href="view.php'.(!empty($entity) && !empty($conf->multicompany->enabled)?'?entity='.$entity:'').'" rel="nofollow noopener" class="butAction marginbottomonly"><div class="index_display bigrounded">'.img_picto('', 'ticket', 'class="fa-15x"').'<br>'.dol_escape_htmltag($langs->trans("ShowTicketWithTrackId")).'</div></a>';
|
||||||
print '<div style="clear:both;"></div>';
|
print '<div style="clear:both;"></div>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -40,6 +40,13 @@ if (!defined('NOBROWSERNOTIF')) {
|
|||||||
}
|
}
|
||||||
// If this page is public (can be called outside logged session)
|
// If this page is public (can be called outside logged session)
|
||||||
|
|
||||||
|
// For MultiCompany module.
|
||||||
|
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
|
||||||
|
$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
|
||||||
|
if (is_numeric($entity)) {
|
||||||
|
define("DOLENTITY", $entity);
|
||||||
|
}
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/ticket/class/actions_ticket.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/ticket/class/actions_ticket.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formticket.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formticket.class.php';
|
||||||
@ -154,10 +161,6 @@ if ($action == "view_ticketlist") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//$object->doActions($action);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -215,6 +218,9 @@ if ($action == "view_ticketlist") {
|
|||||||
|
|
||||||
$filter = array();
|
$filter = array();
|
||||||
$param = 'action=view_ticketlist';
|
$param = 'action=view_ticketlist';
|
||||||
|
if (!empty($entity) && !empty($conf->multicompany->enabled)) {
|
||||||
|
$param .= '&entity='.$entity;
|
||||||
|
}
|
||||||
|
|
||||||
// Definition of fields for list
|
// Definition of fields for list
|
||||||
$arrayfields = array(
|
$arrayfields = array(
|
||||||
@ -392,7 +398,7 @@ if ($action == "view_ticketlist") {
|
|||||||
print_barre_liste($langs->trans('TicketList'), $page, 'public/list.php', $param, $sortfield, $sortorder, '', $num, $num_total, 'ticket');
|
print_barre_liste($langs->trans('TicketList'), $page, 'public/list.php', $param, $sortfield, $sortorder, '', $num, $num_total, 'ticket');
|
||||||
|
|
||||||
// Search bar
|
// Search bar
|
||||||
print '<form method="get" action="'.$url_form.'" id="searchFormList" >'."\n";
|
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].(!empty($entity) && !empty($conf->multicompany->enabled)?'?entity='.$entity:'').'" id="searchFormList" >'."\n";
|
||||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
print '<input type="hidden" name="action" value="view_ticketlist">';
|
print '<input type="hidden" name="action" value="view_ticketlist">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
@ -674,7 +680,7 @@ if ($action == "view_ticketlist") {
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
print '<form method="post" id="form_view_ticket" name="form_view_ticket" enctype="multipart/form-data" action="'.dol_buildpath('/public/ticket/view.php', 1).'" style="display:none;">';
|
print '<form method="post" id="form_view_ticket" name="form_view_ticket" action="'.dol_buildpath('/public/ticket/view.php', 1).(!empty($entity) && !empty($conf->multicompany->enabled)?'?entity='.$entity:'').'" style="display:none;">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="view_ticket">';
|
print '<input type="hidden" name="action" value="view_ticket">';
|
||||||
print '<input type="hidden" name="btn_view_ticket_list" value="1">';
|
print '<input type="hidden" name="btn_view_ticket_list" value="1">';
|
||||||
@ -699,7 +705,7 @@ if ($action == "view_ticketlist") {
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<div id="form_view_ticket">';
|
print '<div id="form_view_ticket">';
|
||||||
print '<form method="post" name="form_view_ticketlist" enctype="multipart/form-data" action="'.$_SERVER['PHP_SELF'].'">';
|
print '<form method="post" name="form_view_ticketlist" action="'.$_SERVER['PHP_SELF'].(!empty($entity) && !empty($conf->multicompany->enabled)?'?entity='.$entity:'').'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="view_ticketlist">';
|
print '<input type="hidden" name="action" value="view_ticketlist">';
|
||||||
//print '<input type="hidden" name="search_fk_status" value="non_closed">';
|
//print '<input type="hidden" name="search_fk_status" value="non_closed">';
|
||||||
|
|||||||
@ -41,6 +41,13 @@ if (!defined('NOBROWSERNOTIF')) {
|
|||||||
}
|
}
|
||||||
// If this page is public (can be called outside logged session)
|
// If this page is public (can be called outside logged session)
|
||||||
|
|
||||||
|
// For MultiCompany module.
|
||||||
|
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
|
||||||
|
$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
|
||||||
|
if (is_numeric($entity)) {
|
||||||
|
define("DOLENTITY", $entity);
|
||||||
|
}
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/ticket/class/actions_ticket.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/ticket/class/actions_ticket.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formticket.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formticket.class.php';
|
||||||
@ -163,7 +170,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
|
|||||||
if ($object->dao->close($user)) {
|
if ($object->dao->close($user)) {
|
||||||
setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs');
|
setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs');
|
||||||
|
|
||||||
$url = 'view.php?action=view_ticket&track_id='.GETPOST('track_id', 'alpha');
|
$url = 'view.php?action=view_ticket&track_id='.GETPOST('track_id', 'alpha').(!empty($entity) && !empty($conf->multicompany->enabled)?'&entity='.$entity:'');
|
||||||
header("Location: ".$url);
|
header("Location: ".$url);
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
@ -177,8 +184,6 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
|
|||||||
$ret = $object->dao->newMessage($user, $action, 0, 1);
|
$ret = $object->dao->newMessage($user, $action, 0, 1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$action = 'view_ticket';
|
$action = 'view_ticket';
|
||||||
}
|
}
|
||||||
@ -229,7 +234,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
|
|||||||
if ($display_ticket) {
|
if ($display_ticket) {
|
||||||
// Confirmation close
|
// Confirmation close
|
||||||
if ($action == 'close') {
|
if ($action == 'close') {
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?track_id=".$track_id, $langs->trans("CloseATicket"), $langs->trans("ConfirmCloseAticket"), "confirm_public_close", '', '', 1);
|
print $form->formconfirm($_SERVER["PHP_SELF"]."?track_id=".$track_id.(!empty($entity) && !empty($conf->multicompany->enabled)?'&entity='.$entity:''), $langs->trans("CloseATicket"), $langs->trans("ConfirmCloseAticket"), "confirm_public_close", '', '', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<div id="form_view_ticket" class="margintoponly">';
|
print '<div id="form_view_ticket" class="margintoponly">';
|
||||||
@ -341,7 +346,8 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
|
|||||||
$formticket->track_id = $object->dao->track_id;
|
$formticket->track_id = $object->dao->track_id;
|
||||||
$formticket->id = $object->dao->id;
|
$formticket->id = $object->dao->id;
|
||||||
|
|
||||||
$formticket->param = array('track_id' => $object->dao->track_id, 'fk_user_create' => '-1', 'returnurl' => DOL_URL_ROOT.'/public/ticket/view.php');
|
$formticket->param = array('track_id' => $object->dao->track_id, 'fk_user_create' => '-1',
|
||||||
|
'returnurl' => DOL_URL_ROOT.'/public/ticket/view.php'.(!empty($entity) && !empty($conf->multicompany->enabled)?'?entity='.$entity:''));
|
||||||
|
|
||||||
$formticket->withfile = 2;
|
$formticket->withfile = 2;
|
||||||
$formticket->withcancel = 1;
|
$formticket->withcancel = 1;
|
||||||
@ -350,7 +356,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($action != 'presend') {
|
if ($action != 'presend') {
|
||||||
print '<form method="post" id="form_view_ticket_list" name="form_view_ticket_list" enctype="multipart/form-data" action="'.DOL_URL_ROOT.'/public/ticket/list.php">';
|
print '<form method="post" id="form_view_ticket_list" name="form_view_ticket_list" action="'.DOL_URL_ROOT.'/public/ticket/list.php'.(!empty($entity) && !empty($conf->multicompany->enabled)?'?entity='.$entity:'').'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="view_ticketlist">';
|
print '<input type="hidden" name="action" value="view_ticketlist">';
|
||||||
print '<input type="hidden" name="track_id" value="'.$object->dao->track_id.'">';
|
print '<input type="hidden" name="track_id" value="'.$object->dao->track_id.'">';
|
||||||
@ -365,11 +371,11 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
|
|||||||
|
|
||||||
if ($object->dao->fk_statut < Ticket::STATUS_CLOSED) {
|
if ($object->dao->fk_statut < Ticket::STATUS_CLOSED) {
|
||||||
// New message
|
// New message
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=presend&mode=init&track_id='.$object->dao->track_id.'">'.$langs->trans('AddMessage').'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=presend&mode=init&track_id='.$object->dao->track_id.(!empty($entity) && !empty($conf->multicompany->enabled)?'&entity='.$entity:'').'">'.$langs->trans('AddMessage').'</a></div>';
|
||||||
|
|
||||||
// Close ticket
|
// Close ticket
|
||||||
if ($object->dao->fk_statut >= Ticket::STATUS_NOT_READ && $object->dao->fk_statut < Ticket::STATUS_CLOSED) {
|
if ($object->dao->fk_statut >= Ticket::STATUS_NOT_READ && $object->dao->fk_statut < Ticket::STATUS_CLOSED) {
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=close&track_id='.$object->dao->track_id.'">'.$langs->trans('CloseTicket').'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=close&track_id='.$object->dao->track_id.(!empty($entity) && !empty($conf->multicompany->enabled)?'&entity='.$entity:'').'">'.$langs->trans('CloseTicket').'</a></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -380,13 +386,13 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
|
|||||||
print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'conversation');
|
print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'conversation');
|
||||||
$object->viewTicketMessages(false, true, $object->dao);
|
$object->viewTicketMessages(false, true, $object->dao);
|
||||||
} else {
|
} else {
|
||||||
print '<div class="error">Not Allowed<br><a href="'.$_SERVER['PHP_SELF'].'?track_id='.$object->dao->track_id.'" rel="nofollow noopener">'.$langs->trans('Back').'</a></div>';
|
print '<div class="error">Not Allowed<br><a href="'.$_SERVER['PHP_SELF'].'?track_id='.$object->dao->track_id.(!empty($entity) && !empty($conf->multicompany->enabled)?'?entity='.$entity:'').'" rel="nofollow noopener">'.$langs->trans('Back').'</a></div>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<div class="center opacitymedium margintoponly marginbottomonly">'.$langs->trans("TicketPublicMsgViewLogIn").'</div>';
|
print '<div class="center opacitymedium margintoponly marginbottomonly">'.$langs->trans("TicketPublicMsgViewLogIn").'</div>';
|
||||||
|
|
||||||
print '<div id="form_view_ticket">';
|
print '<div id="form_view_ticket">';
|
||||||
print '<form method="post" name="form_view_ticket" enctype="multipart/form-data" action="'.$_SERVER['PHP_SELF'].'">';
|
print '<form method="post" name="form_view_ticket" action="'.$_SERVER['PHP_SELF'].(!empty($entity) && !empty($conf->multicompany->enabled)?'?entity='.$entity:'').'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="view_ticket">';
|
print '<input type="hidden" name="action" value="view_ticket">';
|
||||||
|
|
||||||
|
|||||||
@ -40,6 +40,9 @@ class ActionsTicket
|
|||||||
*/
|
*/
|
||||||
public $db;
|
public $db;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Ticket Ticket
|
||||||
|
*/
|
||||||
public $dao;
|
public $dao;
|
||||||
|
|
||||||
public $mesg;
|
public $mesg;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user