// -*- tab-width: 3; indent-tabs-mode: 1; -*-
/*  
 * $Id: showContact.php 372 2005-02-03 15:15:51Z micsik $
 * Created for the StreamOnTheFly project (IST-2001-32226)
 * Authors: András Micsik, Máté Pataki, Tamás Déri 
 *          at MTA SZTAKI DSD, http://dsd.sztaki.hu
 */
require "init.inc.php";
$contactId = sotf_Utils::getParameter('id');
if (strpos($contactId, '@') !== FALSE) {
    // someone tries with e-mail address
    $contact = new sotf_Contact();
    $contact->set('email', $contactId);
    $contact->find();
    if ($contact->exists()) {
        $foundByEmail = 1;
        $contactId = $contact->id;
    }
}
if (!$foundByEmail) {
    $contact =& $repository->getObject($contactId);
}
if (!$contact) {
    raiseError("no_such_object", $contactId);
}
$smarty->assign('PAGETITLE', $contact->get('name'));
$smarty->assign('CONTACT_ID', $contactId);
$smarty->assign('CONTACT_NAME', $contact->get('name'));
$smarty->assign('CONTACT_DATA', $contact->getAllWithIcon());
$numProgs = $contact->countProgrammes();