4 +-----------------------------------------------------------------------+
5 | program/steps/addressbook/show.inc |
7 | This file is part of the RoundCube Webmail client |
8 | Copyright (C) 2005, RoundCube Dev. - Switzerland |
9 | Licensed under the GNU GPL |
12 | Show contact details |
14 +-----------------------------------------------------------------------+
15 | Author: Thomas Bruederli <roundcube@gmail.com> |
16 +-----------------------------------------------------------------------+
18 $Id: show.inc 88 2005-12-03 16:54:12Z roundcube $
23 if ($_GET['_cid'] || $_POST['_cid'])
25 $cid = $_POST['_cid'] ? $_POST['_cid'] : $_GET['_cid'];
26 $DB->query("SELECT * FROM ".get_table_name('contacts')."
31 $_SESSION['user_id']);
33 $CONTACT_RECORD = $DB->fetch_assoc();
35 if (is_array($CONTACT_RECORD))
36 $OUTPUT->add_script(sprintf("%s.set_env('cid', '%s');", $JS_OBJECT_NAME, $CONTACT_RECORD['contact_id']));
41 function rcmail_contact_details($attrib)
43 global $CONTACT_RECORD, $JS_OBJECT_NAME;
46 return show_message('contactnotfound');
48 // a specific part is requested
50 return rep_specialchars_output($CONTACT_RECORD[$attrib['part']]);
53 // return the complete address record as table
56 $a_show_cols = array('name', 'firstname', 'surname', 'email');
57 foreach ($a_show_cols as $col)
59 if ($col=='email' && $CONTACT_RECORD[$col])
60 $value = sprintf('<a href="#compose" onclick="%s.command(\'compose\', %d)" title="%s">%s</a>',
62 $CONTACT_RECORD['contact_id'],
63 rcube_label('composeto'),
64 $CONTACT_RECORD[$col]);
66 $value = rep_specialchars_output($CONTACT_RECORD[$col]);
68 $title = rcube_label($col);
69 $out .= sprintf("<tr><td class=\"title\">%s</td><td>%s</td></tr>\n", $title, $value);
79 parse_template('showcontact');