mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-10 03:28:18 +01:00
first commit
This commit is contained in:
@@ -1535,7 +1535,7 @@ class Contact extends CommonObject
|
|||||||
$linkend = '</a>';
|
$linkend = '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$result .= $linkstart;
|
$result .= (($option == 'nolink') ? '' : $linkstart);
|
||||||
if ($withpicto) {
|
if ($withpicto) {
|
||||||
if ($withpicto < 0) {
|
if ($withpicto < 0) {
|
||||||
$result .= '<!-- picto photo user --><span class="nopadding userimg'.($morecss ? ' '.$morecss : '').'">'.Form::showphoto('contact', $this, 0, 0, 0, 'userphoto'.($withpicto == -3 ? 'small' : ''), 'mini', 0, 1).'</span>';
|
$result .= '<!-- picto photo user --><span class="nopadding userimg'.($morecss ? ' '.$morecss : '').'">'.Form::showphoto('contact', $this, 0, 0, 0, 'userphoto'.($withpicto == -3 ? 'small' : ''), 'mini', 0, 1).'</span>';
|
||||||
@@ -1546,7 +1546,7 @@ class Contact extends CommonObject
|
|||||||
if ($withpicto != 2 && $withpicto != -2) {
|
if ($withpicto != 2 && $withpicto != -2) {
|
||||||
$result .= '<span class="valigmiddle">'.($maxlen ? dol_trunc($this->getFullName($langs), $maxlen) : $this->getFullName($langs)).'</span>';
|
$result .= '<span class="valigmiddle">'.($maxlen ? dol_trunc($this->getFullName($langs), $maxlen) : $this->getFullName($langs)).'</span>';
|
||||||
}
|
}
|
||||||
$result .= $linkend;
|
$result .= (($option == 'nolink') ? '' : $linkend);
|
||||||
|
|
||||||
global $action;
|
global $action;
|
||||||
$hookmanager->initHooks(array('contactdao'));
|
$hookmanager->initHooks(array('contactdao'));
|
||||||
|
|||||||
@@ -12077,6 +12077,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n
|
|||||||
$sql .= " a.percent as percent, 'action' as type,";
|
$sql .= " a.percent as percent, 'action' as type,";
|
||||||
$sql .= " a.fk_element, a.elementtype,";
|
$sql .= " a.fk_element, a.elementtype,";
|
||||||
$sql .= " a.fk_contact,";
|
$sql .= " a.fk_contact,";
|
||||||
|
$sql .= " a.email_from as msg_from,";
|
||||||
$sql .= " c.code as acode, c.libelle as alabel, c.picto as apicto,";
|
$sql .= " c.code as acode, c.libelle as alabel, c.picto as apicto,";
|
||||||
$sql .= " u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname";
|
$sql .= " u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname";
|
||||||
if (is_object($filterobj) && get_class($filterobj) == 'Societe') {
|
if (is_object($filterobj) && get_class($filterobj) == 'Societe') {
|
||||||
@@ -12276,6 +12277,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n
|
|||||||
'userfirstname'=>$obj->user_firstname,
|
'userfirstname'=>$obj->user_firstname,
|
||||||
'userlastname'=>$obj->user_lastname,
|
'userlastname'=>$obj->user_lastname,
|
||||||
'userphoto'=>$obj->user_photo,
|
'userphoto'=>$obj->user_photo,
|
||||||
|
'msg_from'=>$obj->msg_from,
|
||||||
|
|
||||||
'contact_id'=>$obj->fk_contact,
|
'contact_id'=>$obj->fk_contact,
|
||||||
'socpeopleassigned' => $contactaction->socpeopleassigned,
|
'socpeopleassigned' => $contactaction->socpeopleassigned,
|
||||||
@@ -12339,6 +12341,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n
|
|||||||
$userstatic = new User($db);
|
$userstatic = new User($db);
|
||||||
$contactstatic = new Contact($db);
|
$contactstatic = new Contact($db);
|
||||||
$userGetNomUrlCache = array();
|
$userGetNomUrlCache = array();
|
||||||
|
$contactGetNomUrlCache = array();
|
||||||
|
|
||||||
$out .= '<div class="filters-container" >';
|
$out .= '<div class="filters-container" >';
|
||||||
$out .= '<form name="listactionsfilter" class="listactionsfilter" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
$out .= '<form name="listactionsfilter" class="listactionsfilter" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
@@ -12501,6 +12504,17 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n
|
|||||||
}
|
}
|
||||||
$out .= $userGetNomUrlCache[$histo[$key]['userid']];
|
$out .= $userGetNomUrlCache[$histo[$key]['userid']];
|
||||||
}
|
}
|
||||||
|
else if (!empty($histo[$key]['msg_from']) && $actionstatic->code == 'TICKET_MSG') {
|
||||||
|
if (!isset($contactGetNomUrlCache[$histo[$key]['msg_from']])) {
|
||||||
|
if ($contactstatic->fetch(0,null,'',$histo[$key]['msg_from']) > 0) {
|
||||||
|
$contactGetNomUrlCache[$histo[$key]['msg_from']] = $contactstatic->getNomUrl(-1, '', 16);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$contactGetNomUrlCache[$histo[$key]['msg_from']] = $histo[$key]['msg_from'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$out .= $contactGetNomUrlCache[$histo[$key]['msg_from']];
|
||||||
|
}
|
||||||
$out .= '</div>';
|
$out .= '</div>';
|
||||||
|
|
||||||
// Title
|
// Title
|
||||||
|
|||||||
@@ -306,6 +306,14 @@ class ActionsTicket
|
|||||||
if ($res) {
|
if ($res) {
|
||||||
print $userstat->getNomUrl(0);
|
print $userstat->getNomUrl(0);
|
||||||
}
|
}
|
||||||
|
} else if (isset($arraymsgs['fk_contact_author'])) {
|
||||||
|
$contactstat = new Contact($this->db);
|
||||||
|
$res = $contactstat->fetch(0, null, '', $arraymsgs['fk_contact_author']);
|
||||||
|
if ($res) {
|
||||||
|
print $contactstat->getNomUrl(0, 'nolink');
|
||||||
|
} else {
|
||||||
|
print $arraymsgs['fk_contact_author'];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans('Customer');
|
print $langs->trans('Customer');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1700,6 +1700,9 @@ class Ticket extends CommonObject
|
|||||||
if ($send_email) {
|
if ($send_email) {
|
||||||
$actioncomm->code .= '_SENTBYMAIL';
|
$actioncomm->code .= '_SENTBYMAIL';
|
||||||
}
|
}
|
||||||
|
if ((empty($user->id) || $user->id == 0) && isset($_SESSION['email_customer'])) {
|
||||||
|
$actioncomm->email_from = $_SESSION['email_customer'];
|
||||||
|
}
|
||||||
$actioncomm->socid = $this->socid;
|
$actioncomm->socid = $this->socid;
|
||||||
$actioncomm->label = $this->subject;
|
$actioncomm->label = $this->subject;
|
||||||
$actioncomm->note_private = $this->message;
|
$actioncomm->note_private = $this->message;
|
||||||
@@ -1753,7 +1756,7 @@ class Ticket extends CommonObject
|
|||||||
|
|
||||||
// Cache already loaded
|
// Cache already loaded
|
||||||
|
|
||||||
$sql = "SELECT id as rowid, fk_user_author, datec, label, note as message, code";
|
$sql = "SELECT id as rowid, fk_user_author, email_from, datec, label, note as message, code";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm";
|
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm";
|
||||||
$sql .= " WHERE fk_element = ".(int) $this->id;
|
$sql .= " WHERE fk_element = ".(int) $this->id;
|
||||||
$sql .= " AND elementtype = 'ticket'";
|
$sql .= " AND elementtype = 'ticket'";
|
||||||
@@ -1768,6 +1771,9 @@ class Ticket extends CommonObject
|
|||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
$this->cache_msgs_ticket[$i]['id'] = $obj->rowid;
|
$this->cache_msgs_ticket[$i]['id'] = $obj->rowid;
|
||||||
$this->cache_msgs_ticket[$i]['fk_user_author'] = $obj->fk_user_author;
|
$this->cache_msgs_ticket[$i]['fk_user_author'] = $obj->fk_user_author;
|
||||||
|
if ($obj->code == 'TICKET_MSG' && empty($obj->fk_user_author)) {
|
||||||
|
$this->cache_msgs_ticket[$i]['fk_contact_author'] = $obj->email_from;
|
||||||
|
}
|
||||||
$this->cache_msgs_ticket[$i]['datec'] = $this->db->jdate($obj->datec);
|
$this->cache_msgs_ticket[$i]['datec'] = $this->db->jdate($obj->datec);
|
||||||
$this->cache_msgs_ticket[$i]['subject'] = $obj->label;
|
$this->cache_msgs_ticket[$i]['subject'] = $obj->label;
|
||||||
$this->cache_msgs_ticket[$i]['message'] = $obj->message;
|
$this->cache_msgs_ticket[$i]['message'] = $obj->message;
|
||||||
|
|||||||
Reference in New Issue
Block a user