diff --git a/attachments/trunk/frame_list_attachments.php b/attachments/trunk/frame_list_attachments.php index e17119163644c6d4a9ee6eb0c1a5676fad9ec521..e1c97fbe8d2233051e4c6ef6d3c4d49b80a58afc 100644 --- a/attachments/trunk/frame_list_attachments.php +++ b/attachments/trunk/frame_list_attachments.php @@ -90,7 +90,7 @@ $select['res_view_attachments'] = array(); // Important de laisser cet ordre : 'res_id', 'res_id_version', 'relation', 'status' array_push( - $select['res_view_attachments'], 'res_id', 'res_id_version', 'relation', 'status', 'identifier', 'attachment_type', 'title', 'dest_contact_id', 'creation_date', 'typist', 'doc_date', 'updated_by', 'validation_date', 'format'); + $select['res_view_attachments'], 'res_id', 'res_id_version', 'relation', 'status', 'identifier', 'attachment_type', 'title', 'dest_user', 'dest_contact_id', 'creation_date', 'typist', 'doc_date', 'updated_by', 'validation_date', 'format'); $where = " (res_id_master = ? and coll_id = ? and status <> 'DEL' and status <> 'OBS' and (status <> 'TMP' or (typist = ? and status = 'TMP')))"; $arrayPDO = array($resId, $_SESSION['collection_id_choice'], $_SESSION['user']['UserId']); @@ -214,6 +214,20 @@ if (isset($_REQUEST['load'])) { $attachArr[$i][$j]['valign'] = 'bottom'; $attachArr[$i][$j]['show'] = true; } + if (isset($attachArr[$i][$j][$value]) && $attachArr[$i][$j][$value] == 'dest_user') { + if ($attachArr[$i][$j]['value'] != '') { + $stmt = $db->query("SELECT firstname, lastname FROM users WHERE user_id = ? ", [$attachArr[$i][$j]['value']]); + $res = $stmt->fetchObject(); + $attachArr[$i][$j]['value'] = functions::protect_string_db($res->firstname) .' '. functions::protect_string_db($res->lastname); + } + $attachArr[$i][$j]['dest_user'] = $attachArr[$i][$j]['value']; + $attachArr[$i][$j]['label'] = _DEST; + $attachArr[$i][$j]['size'] = '30'; + $attachArr[$i][$j]['label_align'] = 'left'; + $attachArr[$i][$j]['align'] = 'left'; + $attachArr[$i][$j]['valign'] = 'bottom'; + $attachArr[$i][$j]['show'] = true; + } if (isset($attachArr[$i][$j][$value]) && $attachArr[$i][$j][$value] == 'updated_by') { $stmt = $db->query("SELECT lastname FROM users WHERE user_id = ?",array($attachArr[$i][$j]['value'])); $res = $stmt->fetchObject();