forked from Wavyzz/dolibarr
add new rule
This commit is contained in:
@@ -112,15 +112,13 @@ function ticket_prepare_head($object)
|
||||
$ticketViewType = "messaging";
|
||||
if (empty($_SESSION['ticket-view-type'])) {
|
||||
$_SESSION['ticket-view-type'] = $ticketViewType;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$ticketViewType = $_SESSION['ticket-view-type'];
|
||||
}
|
||||
|
||||
if ($ticketViewType == "messaging") {
|
||||
$head[$h][0] = DOL_URL_ROOT.'/ticket/messaging.php?track_id='.$object->track_id;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// $ticketViewType == "list"
|
||||
$head[$h][0] = DOL_URL_ROOT.'/ticket/agenda.php?track_id='.$object->track_id;
|
||||
}
|
||||
@@ -162,15 +160,13 @@ function showDirectPublicLink($object)
|
||||
if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
||||
{
|
||||
$out .= '<span class="opacitymedium">'.$langs->trans("PublicInterfaceNotEnabled").'</span>';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$out .= img_picto('', 'object_globe.png').' '.$langs->trans("TicketPublicAccess").':<br>';
|
||||
if ($url)
|
||||
{
|
||||
$out .= '<input type="text" id="directpubliclink" class="quatrevingtpercent" value="'.$url.'">';
|
||||
$out .= ajax_autoselect("directpubliclink", 0);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$out .= '<span class="opacitymedium">'.$langs->trans("TicketNotCreatedFromPublicInterface").'</span>';
|
||||
}
|
||||
}
|
||||
@@ -312,8 +308,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
|
||||
// Recherche histo sur actioncomm
|
||||
if (is_object($objcon) && $objcon->id > 0) {
|
||||
$sql = "SELECT DISTINCT a.id, a.label as label,";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$sql = "SELECT a.id, a.label as label,";
|
||||
}
|
||||
$sql .= " a.datep as dp,";
|
||||
@@ -348,8 +343,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
|
||||
$sql .= " ON er.resource_type = 'dolresource'";
|
||||
$sql .= " AND er.element_id = a.id";
|
||||
$sql .= " AND er.resource_id = ".$filterobj->id;
|
||||
}
|
||||
elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql .= ", ".MAIN_DB_PREFIX."adherent as m";
|
||||
} elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql .= ", ".MAIN_DB_PREFIX."adherent as m";
|
||||
elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as o";
|
||||
elseif (is_object($filterobj) && get_class($filterobj) == 'Product') $sql .= ", ".MAIN_DB_PREFIX."product as o";
|
||||
elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql .= ", ".MAIN_DB_PREFIX."ticket as o";
|
||||
@@ -364,28 +358,23 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
|
||||
{
|
||||
$sql .= " AND a.fk_element = m.rowid AND a.elementtype = 'member'";
|
||||
if ($filterobj->id) $sql .= " AND a.fk_element = ".$filterobj->id;
|
||||
}
|
||||
elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur')
|
||||
} elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur')
|
||||
{
|
||||
$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'";
|
||||
if ($filterobj->id) $sql .= " AND a.fk_element = ".$filterobj->id;
|
||||
}
|
||||
elseif (is_object($filterobj) && get_class($filterobj) == 'Product')
|
||||
} elseif (is_object($filterobj) && get_class($filterobj) == 'Product')
|
||||
{
|
||||
$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'product'";
|
||||
if ($filterobj->id) $sql .= " AND a.fk_element = ".$filterobj->id;
|
||||
}
|
||||
elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket')
|
||||
} elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket')
|
||||
{
|
||||
$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'ticket'";
|
||||
if ($filterobj->id) $sql .= " AND a.fk_element = ".$filterobj->id;
|
||||
}
|
||||
elseif (is_object($filterobj) && get_class($filterobj) == 'BOM')
|
||||
} elseif (is_object($filterobj) && get_class($filterobj) == 'BOM')
|
||||
{
|
||||
$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'bom'";
|
||||
if ($filterobj->id) $sql .= " AND a.fk_element = ".$filterobj->id;
|
||||
}
|
||||
elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat')
|
||||
} elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat')
|
||||
{
|
||||
$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'contract'";
|
||||
if ($filterobj->id) $sql .= " AND a.fk_element = ".$filterobj->id;
|
||||
@@ -403,8 +392,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
|
||||
if ($actioncode == 'AC_OTH') $sql .= " AND c.type != 'systemauto'";
|
||||
elseif ($actioncode == 'AC_OTH_AUTO') $sql .= " AND c.type = 'systemauto'";
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if ($actioncode == 'AC_NON_AUTO') $sql .= " AND c.type != 'systemauto'";
|
||||
elseif ($actioncode == 'AC_ALL_AUTO') $sql .= " AND c.type = 'systemauto'";
|
||||
else $sql .= " AND c.code = '".$db->escape($actioncode)."'";
|
||||
@@ -521,8 +509,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
|
||||
$numaction++;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
@@ -548,8 +535,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
|
||||
(is_null($filterobj) || get_class($filterobj) == 'Societe'))
|
||||
{
|
||||
$out .= '<input type="hidden" name="id" value="'.$objcon->id.'" />';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$out .= '<input type="hidden" name="id" value="'.$filterobj->id.'" />';
|
||||
}
|
||||
if ($filterobj && get_class($filterobj) == 'Societe') $out .= '<input type="hidden" name="socid" value="'.$filterobj->id.'" />';
|
||||
@@ -648,16 +634,13 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
|
||||
if ($histo[$key]['percent'] == -1) {
|
||||
$colorClass = 'timeline-icon-not-applicble';
|
||||
$pictoTitle = $langs->trans('StatusNotApplicable');
|
||||
}
|
||||
elseif ($histo[$key]['percent'] == 0) {
|
||||
} elseif ($histo[$key]['percent'] == 0) {
|
||||
$colorClass = 'timeline-icon-todo';
|
||||
$pictoTitle = $langs->trans('StatusActionToDo').' (0%)';
|
||||
}
|
||||
elseif ($histo[$key]['percent'] > 0 && $histo[$key]['percent'] < 100) {
|
||||
} elseif ($histo[$key]['percent'] > 0 && $histo[$key]['percent'] < 100) {
|
||||
$colorClass = 'timeline-icon-in-progress';
|
||||
$pictoTitle = $langs->trans('StatusActionInProcess').' ('.$histo[$key]['percent'].'%)';
|
||||
}
|
||||
elseif ($histo[$key]['percent'] >= 100) {
|
||||
} elseif ($histo[$key]['percent'] >= 100) {
|
||||
$colorClass = 'timeline-icon-done';
|
||||
$pictoTitle = $langs->trans('StatusActionDone').' (100%)';
|
||||
}
|
||||
@@ -665,17 +648,13 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
|
||||
|
||||
if ($actionstatic->code == 'AC_TICKET_CREATE') {
|
||||
$iconClass = 'fa fa-ticket';
|
||||
}
|
||||
elseif ($actionstatic->code == 'AC_TICKET_MODIFY') {
|
||||
} elseif ($actionstatic->code == 'AC_TICKET_MODIFY') {
|
||||
$iconClass = 'fa fa-pencil';
|
||||
}
|
||||
elseif ($actionstatic->code == 'TICKET_MSG') {
|
||||
} elseif ($actionstatic->code == 'TICKET_MSG') {
|
||||
$iconClass = 'fa fa-comments';
|
||||
}
|
||||
elseif ($actionstatic->code == 'TICKET_MSG_PRIVATE') {
|
||||
} elseif ($actionstatic->code == 'TICKET_MSG_PRIVATE') {
|
||||
$iconClass = 'fa fa-mask';
|
||||
}
|
||||
elseif (!empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
} elseif (!empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
{
|
||||
if ($actionstatic->type_picto) $img_picto = img_picto('', $actionstatic->type_picto);
|
||||
else {
|
||||
@@ -757,8 +736,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
|
||||
|
||||
if ($actionstatic->code == 'TICKET_MSG') {
|
||||
$out .= $langs->trans('TicketNewMessage');
|
||||
}
|
||||
elseif ($actionstatic->code == 'TICKET_MSG_PRIVATE') {
|
||||
} elseif ($actionstatic->code == 'TICKET_MSG_PRIVATE') {
|
||||
$out .= $langs->trans('TicketNewMessage').' <em>('.$langs->trans('Private').')</em>';
|
||||
} else {
|
||||
if (isset($histo[$key]['type']) && $histo[$key]['type'] == 'action') {
|
||||
@@ -816,8 +794,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
|
||||
}
|
||||
|
||||
$footer .= $langs->trans('ActionOnContact').' : '.$contactList;
|
||||
}
|
||||
elseif (empty($objcon->id) && isset($histo[$key]['contact_id']) && $histo[$key]['contact_id'] > 0)
|
||||
} elseif (empty($objcon->id) && isset($histo[$key]['contact_id']) && $histo[$key]['contact_id'] > 0)
|
||||
{
|
||||
$contact = new Contact($db);
|
||||
$result = $contact->fetch($histo[$key]['contact_id']);
|
||||
|
||||
Reference in New Issue
Block a user