Revert the option to avoid to introduce a feature that is duplicate with
already existing view "Events/Agenda". It also keeps a common behaviour between other tools. Maxi debug on messages of tickets
This commit is contained in:
parent
b84e9141a5
commit
206b16410e
@ -405,7 +405,6 @@ class ActionComm extends CommonObject
|
||||
$this->userassigned[$tmpid] = array('id'=>$tmpid, 'transparency'=>$this->transparency);
|
||||
}
|
||||
|
||||
|
||||
$userownerid = $this->userownerid;
|
||||
$userdoneid = $this->userdoneid;
|
||||
|
||||
@ -484,7 +483,7 @@ class ActionComm extends CommonObject
|
||||
$sql .= (strval($this->datef) != '' ? "'".$this->db->idate($this->datef)."'" : "null").", ";
|
||||
$sql .= ((isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '') ? "'".$this->db->escape($this->durationp)."'" : "null").", "; // deprecated
|
||||
$sql .= (isset($this->type_id) ? $this->type_id : "null").",";
|
||||
$sql .= ($code ? ("'".$code."'") : "null").", ";
|
||||
$sql .= ($code ? ("'".$this->db->escape($code)."'") : "null").", ";
|
||||
$sql .= ($this->ref_ext ? ("'".$this->db->idate($this->ref_ext)."'") : "null").", ";
|
||||
$sql .= ((isset($this->socid) && $this->socid > 0) ? $this->socid : "null").", ";
|
||||
$sql .= ((isset($this->fk_project) && $this->fk_project > 0) ? $this->fk_project : "null").", ";
|
||||
|
||||
@ -242,7 +242,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
$sql = "SELECT";
|
||||
if ($usergroup > 0) $sql .= " DISTINCT";
|
||||
$sql .= " s.nom as societe, s.rowid as socid, s.client, s.email as socemail,";
|
||||
$sql .= " a.id, a.label, a.note, a.datep as dp, a.datep2 as dp2, a.fulldayevent, a.location,";
|
||||
$sql .= " a.id, a.code, a.label, a.note, a.datep as dp, a.datep2 as dp2, a.fulldayevent, a.location,";
|
||||
$sql .= ' a.fk_user_author,a.fk_user_action,';
|
||||
$sql .= " a.fk_contact, a.note, a.percent as percent,";
|
||||
$sql .= " a.fk_element, a.elementtype, a.datec, a.tms as datem,";
|
||||
@ -385,14 +385,8 @@ if ($resql)
|
||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||
$nav = '';
|
||||
|
||||
//if ($actioncode) $nav.='<input type="hidden" name="actioncode" value="'.$actioncode.'">';
|
||||
//if ($resourceid) $nav.='<input type="hidden" name="resourceid" value="'.$resourceid.'">';
|
||||
if ($filter) $nav .= '<input type="hidden" name="search_filter" value="'.$filter.'">';
|
||||
//if ($filtert) $nav.='<input type="hidden" name="filtert" value="'.$filtert.'">';
|
||||
//if ($socid) $nav.='<input type="hidden" name="socid" value="'.$socid.'">';
|
||||
if ($showbirthday) $nav .= '<input type="hidden" name="search_showbirthday" value="1">';
|
||||
//if ($pid) $nav.='<input type="hidden" name="projectid" value="'.$pid.'">';
|
||||
//if ($usergroup) $nav.='<input type="hidden" name="usergroup" value="'.$usergroup.'">';
|
||||
print $nav;
|
||||
|
||||
dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action');
|
||||
@ -548,6 +542,7 @@ if ($resql)
|
||||
|
||||
$actionstatic->id = $obj->id;
|
||||
$actionstatic->ref = $obj->id;
|
||||
$actionstatic->code = $obj->code;
|
||||
$actionstatic->type_code = $obj->type_code;
|
||||
$actionstatic->type_label = $obj->type_label;
|
||||
$actionstatic->type_picto = $obj->type_picto;
|
||||
@ -583,21 +578,31 @@ if ($resql)
|
||||
if (!empty($arrayfields['c.libelle']['checked']))
|
||||
{
|
||||
print '<td class="nowraponall">';
|
||||
$actioncomm = $actionstatic;
|
||||
// TODO Code common with code into showactions
|
||||
$imgpicto = '';
|
||||
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
{
|
||||
if ($actionstatic->type_picto) print img_picto('', $actionstatic->type_picto);
|
||||
else {
|
||||
if ($actionstatic->type_code == 'AC_RDV') print img_picto('', 'object_group', '', false, 0, 0, '', '').' ';
|
||||
elseif ($actionstatic->type_code == 'AC_TEL') print img_picto('', 'object_phoning', '', false, 0, 0, '', '').' ';
|
||||
elseif ($actionstatic->type_code == 'AC_FAX') print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', '').' ';
|
||||
elseif ($actionstatic->type_code == 'AC_EMAIL') print img_picto('', 'object_email', '', false, 0, 0, '', '').' ';
|
||||
elseif ($actionstatic->type_code == 'AC_INT') print img_picto('', 'object_intervention', '', false, 0, 0, '', '').' ';
|
||||
elseif (!preg_match('/_AUTO/', $actionstatic->type_code)) print img_picto('', 'object_other', '', false, 0, 0, '', '').' ';
|
||||
}
|
||||
if ($actioncomm->type_picto) {
|
||||
$imgpicto = img_picto('', $actioncomm->type_picto);
|
||||
}
|
||||
else {
|
||||
if ($actioncomm->type_code == 'AC_RDV') $imgpicto = img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright').' ';
|
||||
elseif ($actioncomm->type_code == 'AC_TEL') $imgpicto = img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright').' ';
|
||||
elseif ($actioncomm->type_code == 'AC_FAX') $imgpicto = img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright').' ';
|
||||
elseif ($actioncomm->type_code == 'AC_EMAIL') $imgpicto = img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright').' ';
|
||||
elseif ($actioncomm->type_code == 'AC_INT') $imgpicto = img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright').' ';
|
||||
elseif ($actioncomm->type_code == 'AC_OTH' && $actioncomm->code == 'TICKET_MSG') $imgpicto = img_picto('', 'object_conversation', '', false, 0, 0, '', 'paddingright').' ';
|
||||
elseif (!preg_match('/_AUTO/', $actioncomm->type_code)) $imgpicto = img_picto('', 'object_other', '', false, 0, 0, '', 'paddingright').' ';
|
||||
}
|
||||
}
|
||||
print $imgpicto;
|
||||
|
||||
$labeltype = $obj->type_code;
|
||||
if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($arraylist[$labeltype])) $labeltype = 'AC_OTH';
|
||||
if (!empty($arraylist[$labeltype])) $labeltype = $arraylist[$labeltype];
|
||||
if ($actioncomm->type_code == 'AC_OTH' && $actioncomm->code == 'TICKET_MSG') {
|
||||
$labeltype = $langs->trans("Message");
|
||||
} elseif (!empty($arraylist[$labeltype])) $labeltype = $arraylist[$labeltype];
|
||||
print dol_trunc($labeltype, 28);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -2227,13 +2227,12 @@ else
|
||||
|
||||
$MAXEVENT = 10;
|
||||
|
||||
$morehtmlright = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt', DOL_URL_ROOT.'/contrat/agenda.php?id='.$object->id);
|
||||
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/contrat/agenda.php?id='.$object->id);
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, 'contract', $socid, 1, 'listactions', $MAXEVENT, '', $morehtmlright);
|
||||
|
||||
$somethingshown = $formactions->showactions($object, 'contract', $socid, 1, 'listactions', $MAXEVENT, '', $morehtmlcenter);
|
||||
|
||||
print '</div></div></div>';
|
||||
}
|
||||
|
||||
@ -165,13 +165,12 @@ class FormActions
|
||||
* @param string $morecss More css on table
|
||||
* @param int $max Max number of record
|
||||
* @param string $moreparambacktopage More param for the backtopage
|
||||
* @param string $morehtmlright More html text on right of title line
|
||||
* @param string $morehtmlcenter More html text on center of title line
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
public function showactions($object, $typeelement, $socid = 0, $forceshowtitle = 0, $morecss = 'listactions', $max = 0, $moreparambacktopage = '', $morehtmlright = '')
|
||||
public function showactions($object, $typeelement, $socid = 0, $forceshowtitle = 0, $morecss = 'listactions', $max = 0, $moreparambacktopage = '', $morehtmlcenter = '')
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
global $bc;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
|
||||
@ -208,8 +207,9 @@ class FormActions
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(), 'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.($object->socid > 0 ? '&socid='.$object->socid : ($socid > 0 ? '&socid='.$socid : '')).($projectid > 0 ? '&projectid='.$projectid : '').'&backtopage='.urlencode($urlbacktopage));
|
||||
}
|
||||
|
||||
|
||||
print '<!-- formactions->showactions -->'."\n";
|
||||
print load_fiche_titre($title, $newcardbutton, '', 0, 0, '', $morehtmlright);
|
||||
print load_fiche_titre($title, $newcardbutton, '', 0, 0, '', $morehtmlcenter);
|
||||
|
||||
$page = 0; $param = '';
|
||||
|
||||
@ -230,29 +230,29 @@ class FormActions
|
||||
$cacheusers = array();
|
||||
|
||||
$cursorevent = 0;
|
||||
foreach ($listofactions as $action)
|
||||
foreach ($listofactions as $actioncomm)
|
||||
{
|
||||
if ($max && $cursorevent >= $max) break;
|
||||
|
||||
$ref = $action->getNomUrl(1, -1);
|
||||
$label = $action->getNomUrl(0, 38);
|
||||
$ref = $actioncomm->getNomUrl(1, -1);
|
||||
$label = $actioncomm->getNomUrl(0, 38);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
// Ref
|
||||
print '<td class="nowraponall">'.$ref.'</td>';
|
||||
// Onwer
|
||||
print '<td class="tdoverflowmax150">';
|
||||
if (!empty($action->userownerid))
|
||||
if (!empty($actioncomm->userownerid))
|
||||
{
|
||||
if (is_object($cacheusers[$action->userownerid]))
|
||||
if (is_object($cacheusers[$actioncomm->userownerid]))
|
||||
{
|
||||
$tmpuser = $cacheusers[$action->userownerid];
|
||||
$tmpuser = $cacheusers[$actioncomm->userownerid];
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmpuser = new User($this->db);
|
||||
$tmpuser->fetch($action->userownerid);
|
||||
$cacheusers[$action->userownerid] = $tmpuser;
|
||||
$tmpuser->fetch($actioncomm->userownerid);
|
||||
$cacheusers[$actioncomm->userownerid] = $tmpuser;
|
||||
}
|
||||
if ($tmpuser->id > 0)
|
||||
{
|
||||
@ -260,41 +260,50 @@ class FormActions
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Type
|
||||
print '<td>';
|
||||
// TODO Code common with code into comm/action/list.php
|
||||
$imgpicto = '';
|
||||
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
{
|
||||
if ($action->type_picto) $imgpicto = img_picto('', $action->type_picto);
|
||||
if ($actioncomm->type_picto) {
|
||||
$imgpicto = img_picto('', $actioncomm->type_picto);
|
||||
}
|
||||
else {
|
||||
if ($action->type_code == 'AC_RDV') $imgpicto = img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright').' ';
|
||||
elseif ($action->type_code == 'AC_TEL') $imgpicto = img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright').' ';
|
||||
elseif ($action->type_code == 'AC_FAX') $imgpicto = img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright').' ';
|
||||
elseif ($action->type_code == 'AC_EMAIL') $imgpicto = img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright').' ';
|
||||
elseif ($action->type_code == 'AC_INT') $imgpicto = img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright').' ';
|
||||
elseif (!preg_match('/_AUTO/', $action->type_code)) $imgpicto = img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').' ';
|
||||
if ($actioncomm->type_code == 'AC_RDV') $imgpicto = img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright').' ';
|
||||
elseif ($actioncomm->type_code == 'AC_TEL') $imgpicto = img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright').' ';
|
||||
elseif ($actioncomm->type_code == 'AC_FAX') $imgpicto = img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright').' ';
|
||||
elseif ($actioncomm->type_code == 'AC_EMAIL') $imgpicto = img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright').' ';
|
||||
elseif ($actioncomm->type_code == 'AC_INT') $imgpicto = img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright').' ';
|
||||
elseif ($actioncomm->type_code == 'AC_OTH' && $actioncomm->code == 'TICKET_MSG') $imgpicto = img_picto('', 'object_conversation', '', false, 0, 0, '', 'paddingright').' ';
|
||||
elseif (!preg_match('/_AUTO/', $actioncomm->type_code)) $imgpicto = img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').' ';
|
||||
}
|
||||
}
|
||||
print $imgpicto;
|
||||
print $action->type_short ? $action->type_short : $action->type;
|
||||
if ($actioncomm->type_code == 'AC_OTH' && $actioncomm->code == 'TICKET_MSG') {
|
||||
print $langs->trans("Message");
|
||||
} else {
|
||||
print $actioncomm->type_short ? $actioncomm->type_short : $actioncomm->type;
|
||||
}
|
||||
print '</td>';
|
||||
// Label
|
||||
print '<td>'.$label.'</td>';
|
||||
// Date
|
||||
print '<td class="center">'.dol_print_date($action->datep, 'dayhour', 'tzuserrel');
|
||||
if ($action->datef)
|
||||
print '<td class="center">'.dol_print_date($actioncomm->datep, 'dayhour', 'tzuserrel');
|
||||
if ($actioncomm->datef)
|
||||
{
|
||||
$tmpa = dol_getdate($action->datep);
|
||||
$tmpb = dol_getdate($action->datef);
|
||||
$tmpa = dol_getdate($actioncomm->datep);
|
||||
$tmpb = dol_getdate($actioncomm->datef);
|
||||
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year'])
|
||||
{
|
||||
if ($tmpa['hours'] != $tmpb['hours'] || $tmpa['minutes'] != $tmpb['minutes'] && $tmpa['seconds'] != $tmpb['seconds']) print '-'.dol_print_date($action->datef, 'hour', 'tzuserrel');
|
||||
if ($tmpa['hours'] != $tmpb['hours'] || $tmpa['minutes'] != $tmpb['minutes'] && $tmpa['seconds'] != $tmpb['seconds']) print '-'.dol_print_date($actioncomm->datef, 'hour', 'tzuserrel');
|
||||
}
|
||||
else print '-'.dol_print_date($action->datef, 'dayhour', 'tzuserrel');
|
||||
else print '-'.dol_print_date($actioncomm->datef, 'dayhour', 'tzuserrel');
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="right">';
|
||||
print $action->getLibStatut(3);
|
||||
print $actioncomm->getLibStatut(3);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@ -3155,7 +3155,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'intervention', 'label', 'language', 'list', 'listlight', 'lot',
|
||||
'map-marker-alt', 'money-bill-alt', 'mrp', 'note',
|
||||
'object_accounting', 'object_action', 'object_account', 'object_barcode', 'object_bill', 'object_billa', 'object_billd', 'object_bom',
|
||||
'object_category', 'object_bookmark', 'object_bug', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder',
|
||||
'object_category', 'object_conversation', 'object_bookmark', 'object_bug', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder',
|
||||
'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
|
||||
'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_donation', 'object_dynamicprice',
|
||||
'object_holiday', 'object_hrm', 'object_invoice', 'object_intervention', 'object_label',
|
||||
@ -3190,7 +3190,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
$arrayconvpictotofa = array(
|
||||
'account'=>'university', 'accountancy'=>'money-check-alt', 'action'=>'calendar-alt', 'address'=> 'address-book',
|
||||
'bank_account'=>'university', 'bill'=>'file-invoice-dollar', 'billa'=>'file-excel', 'billd'=>'file-medical', 'bom'=>'cubes',
|
||||
'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'donation'=>'file-alt', 'dynamicprice'=>'hand-holding-usd',
|
||||
'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'conversation'=>'comments', 'donation'=>'file-alt', 'dynamicprice'=>'hand-holding-usd',
|
||||
'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins',
|
||||
'accounting'=>'chart-line', 'category'=>'tag', 'dollyrevert'=>'dolly',
|
||||
'hrm'=>'umbrella-beach', 'margin'=>'calculator', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode',
|
||||
@ -3263,7 +3263,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
$arrayconvpictotomorcess = array(
|
||||
'action'=>'bg-infobox-action', 'account'=>'bg-infobox-bank_account', 'accountancy'=>'bg-infobox-bank_account',
|
||||
'bank_account'=>'bg-infobox-bank_account', 'bill'=>'bg-infobox-commande', 'billa'=>'bg-infobox-commande', 'billd'=>'bg-infobox-commande',
|
||||
'cash-register'=>'bg-infobox-bank_account', 'contract'=>'bg-infobox-contrat', 'check'=>'font-status4',
|
||||
'cash-register'=>'bg-infobox-bank_account', 'contract'=>'bg-infobox-contrat', 'check'=>'font-status4', 'conversation'=>'bg-infobox-contrat',
|
||||
'donation'=>'bg-infobox-commande', 'dollyrevert'=>'flip', 'ecm'=>'bg-infobox-action',
|
||||
'hrm'=>'bg-infobox-adherent', 'group'=>'bg-infobox-adherent', 'intervention'=>'bg-infobox-contrat',
|
||||
'multicurrency'=>'bg-infobox-bank_account',
|
||||
|
||||
@ -709,7 +709,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
|
||||
$out .= $histo[$key]['id'];
|
||||
$out .= '</a> ';
|
||||
} else {
|
||||
$out .= $actionstatic->getNomUrl(1, -1).' ';
|
||||
$out .= $actionstatic->getNomUrl(1, -1, 'valignmiddle').' ';
|
||||
}
|
||||
|
||||
//if ($user->rights->agenda->allactions->read || $actionstatic->authorid == $user->id)
|
||||
|
||||
@ -275,4 +275,4 @@ ALTER TABLE llx_prelevement_facture ADD COLUMN fk_facture_fourn INTEGER NULL;
|
||||
|
||||
ALTER TABLE llx_menu MODIFY COLUMN module varchar(255);
|
||||
|
||||
|
||||
ALTER TABLE llx_actioncomm SET fk_action = 50 where fk_action = 40 AND code = 'TICKET_MSG';
|
||||
|
||||
@ -426,6 +426,7 @@ Modules=Modules/Applications
|
||||
Option=Option
|
||||
List=List
|
||||
FullList=Full list
|
||||
FullConversation=Full conversation
|
||||
Statistics=Statistics
|
||||
OtherStatistics=Other statistics
|
||||
Status=Status
|
||||
|
||||
@ -370,7 +370,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
|
||||
}
|
||||
|
||||
// Message list
|
||||
print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'messages@ticket');
|
||||
print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'object_conversation');
|
||||
$object->viewTicketMessages(false, true, $object->dao);
|
||||
}
|
||||
else
|
||||
|
||||
@ -2826,7 +2826,7 @@ else
|
||||
|
||||
$MAXEVENT = 10;
|
||||
|
||||
$morehtmlright = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt', DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id);
|
||||
$morehtmlright = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id);
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
|
||||
@ -154,7 +154,7 @@ a.timeline-btn:hover
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
left: 18px;
|
||||
top: 0;
|
||||
top: 5px;
|
||||
}
|
||||
.timeline > .time-label > span {
|
||||
font-weight: 600;
|
||||
|
||||
@ -143,6 +143,7 @@ if (empty($reshook)) {
|
||||
$action = 'view';
|
||||
}
|
||||
|
||||
// Action to add an action (not a message)
|
||||
if (GETPOST('add', 'alpha') && $user->rights->ticket->write) {
|
||||
$error = 0;
|
||||
|
||||
@ -381,6 +382,7 @@ if (empty($reshook)) {
|
||||
$action = 'view';
|
||||
}
|
||||
|
||||
// Action to add an action (not a message)
|
||||
if ($action == 'add_message' && GETPOSTISSET('btn_add_message') && $user->rights->ticket->read) {
|
||||
$ret = $object->newMessage($user, $action, (GETPOST('private_message', 'alpha') == "on" ? 1 : 0));
|
||||
|
||||
@ -1218,7 +1220,8 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
|
||||
if (GETPOSTISSET('actionbis') && $action == 'presend') $action = 'presend_addmessage';
|
||||
|
||||
// add a message
|
||||
if ($action == 'presend' || $action == 'presend_addmessage') {
|
||||
if ($action == 'presend' || $action == 'presend_addmessage')
|
||||
{
|
||||
$action = 'add_message'; // action to use to post the message
|
||||
$modelmail = 'ticket_send';
|
||||
|
||||
@ -1293,8 +1296,8 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
// Show messages on card
|
||||
if (empty($conf->global->TICKET_HIDE_MESSAGES_ON_CARD)) {
|
||||
// Show messages on card (Note: this is a duplicate of the view Events/Agenda but on the main tab)
|
||||
if (! empty($conf->global->TICKET_SHOW_MESSAGES_ON_CARD)) {
|
||||
$param = '&id='.$object->id;
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
|
||||
@ -1337,16 +1340,23 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
|
||||
print showDirectPublicLink($object).'<br>';
|
||||
print '</div>';
|
||||
|
||||
if (!empty($conf->global->TICKET_HIDE_MESSAGES_ON_CARD)) {
|
||||
if (empty($conf->global->TICKET_SHOW_MESSAGES_ON_CARD)) {
|
||||
print '<div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
$MAXEVENT = 10;
|
||||
|
||||
$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT.'/ticket/messaging.php?id='.$object->id);
|
||||
$morehtmlcenter .= ' ';
|
||||
$morehtmlcenter .= dolGetButtonTitle($langs->trans('FullList'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/ticket/agenda.php?id='.$object->id);
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, 'ticket', $socid, 1);
|
||||
$somethingshown = $formactions->showactions($object, 'ticket', $socid, 1, 'listactions', $MAXEVENT, '', $morehtmlcenter);
|
||||
|
||||
print '</div></div>';
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -272,6 +272,7 @@ class ActionsTicket
|
||||
print $langs->trans('User');
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
foreach ($this->dao->cache_msgs_ticket as $id => $arraymsgs) {
|
||||
if (!$arraymsgs['private']
|
||||
@ -280,7 +281,7 @@ class ActionsTicket
|
||||
//print '<tr>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td><strong>';
|
||||
print dol_print_date($arraymsgs['datec'], 'dayhour');
|
||||
print img_picto('', 'actioncomm', 'class="paddingright"').dol_print_date($arraymsgs['datec'], 'dayhour');
|
||||
print '<strong></td>';
|
||||
if ($show_user) {
|
||||
print '<td>';
|
||||
|
||||
@ -1559,7 +1559,7 @@ class Ticket extends CommonObject
|
||||
// Insert entry into agenda with code 'TICKET_MSG'
|
||||
include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
$actioncomm = new ActionComm($this->db);
|
||||
$actioncomm->type_code = 'AC_OTH_AUTO';
|
||||
$actioncomm->type_code = 'AC_OTH';
|
||||
$actioncomm->code = 'TICKET_MSG';
|
||||
if ($this->private) {
|
||||
$actioncomm->code = 'TICKET_MSG_PRIVATE';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user