Example #1
0
	}
}



/******************************************************************************/
/* Affichage fiche                                                            */
/******************************************************************************/

llxHeader();

$html = new Form($db);

if ($id)
{
	$head = user_prepare_head($fuser);

	$title = $langs->trans("User");
	dol_fiche_head($head, 'note', $title, 0, 'user');

	if ($msg) print '<div class="error">'.$msg.'</div>';

	print "<form method=\"post\" action=\"note.php\">";
	print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';

    print '<table class="border" width="100%">';

    // Reference
	print '<tr><td width="20%">'.$langs->trans('Ref').'</td>';
	print '<td colspan="3">';
	print $html->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin);
Example #2
0
        $res = $object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
        if ($res < 0) {
            $mesg = '<div class="error">' . $adh->error . '</div>';
            $db->rollback();
        } else {
            $db->commit();
        }
    }
}
/******************************************************************************/
/* Affichage fiche                                                            */
/******************************************************************************/
llxHeader();
$form = new Form($db);
if ($id) {
    $head = user_prepare_head($object);
    $title = $langs->trans("User");
    dol_fiche_head($head, 'note', $title, 0, 'user');
    $linkback = '<a href="' . DOL_URL_ROOT . '/user/index.php">' . $langs->trans("BackToList") . '</a>';
    dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin);
    print '<div class="underbanner clearboth"></div>';
    print "<form method=\"post\" action=\"" . $_SERVER['PHP_SELF'] . "\">";
    print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
    print '<table class="border" width="100%">';
    // Login
    print '<tr><td class="titlefield">' . $langs->trans("Login") . '</td><td class="valeur">' . $object->login . '&nbsp;</td></tr>';
    // Note
    print '<tr><td class="tdtop">' . $langs->trans("Note") . '</td>';
    print '<td>';
    if ($action == 'edit' && $user->rights->user->user->creer) {
        print "<input type=\"hidden\" name=\"action\" value=\"update\">";
 static function getHeadForObject($tab_object, $fk_object)
 {
     global $db, $conf, $langs, $user;
     $head = array();
     if (empty($tab_object)) {
         return $head;
     }
     if ($tab_object === 'product') {
         dol_include_once('/product/class/product.class.php');
         dol_include_once('/core/lib/product.lib.php');
         $object = new Product($db);
         $object->fetch($fk_object);
         $head = product_prepare_head($object);
     } else {
         if ($tab_object === 'thirdparty') {
             dol_include_once('/societe/class/societe.class.php');
             dol_include_once('/core/lib/company.lib.php');
             $object = new Societe($db);
             $object->fetch($fk_object);
             $head = societe_prepare_head($object);
         } else {
             if ($tab_object === 'contact') {
                 dol_include_once('/contact/class/contact.class.php');
                 dol_include_once('/core/lib/contact.lib.php');
                 $object = new Contact($db);
                 $object->fetch($fk_object);
                 $head = contact_prepare_head($object);
             } else {
                 if ($tab_object === 'user') {
                     dol_include_once('/user/class/user.class.php');
                     dol_include_once('/core/lib/usergroups.lib.php');
                     $object = new User($db);
                     $object->fetch($fk_object);
                     $head = user_prepare_head($object);
                 } else {
                     if ($tab_object === 'group') {
                         dol_include_once('/user/class/usergroup.class.php');
                         dol_include_once('/lib/usergroups.lib.php');
                         $object = new UserGroup($db);
                         $object->fetch($fk_object);
                         $head = group_prepare_head($object);
                     } else {
                         if ($tab_object === 'project') {
                             dol_include_once('/projet/class/project.class.php');
                             dol_include_once('/core/lib/project.lib.php');
                             $object = new Project($db);
                             $object->fetch($fk_object);
                             $head = project_prepare_head($object);
                         }
                     }
                 }
             }
         }
     }
     return $head;
 }
<?php

require 'config.php';
dol_include_once('/dolidacticiel/class/dolidacticiel.class.php');
dol_include_once('/core/lib/usergroups.lib.php');
$id = GETPOST('id');
$u = new User($db);
$u->fetch($id);
$u->getrights();
if ($u->id <= 0) {
    exit('ErrorUser');
}
llxHeader();
$head = user_prepare_head($u);
$title = $langs->trans("Achievements");
dol_fiche_head($head, 'achievements', $title);
$PDOdb = new TPDOdb();
$Tab = TDolidacticiel::getAll($PDOdb, $u, $conf);
print '<table class="border" width="100%">';
foreach ($Tab as &$d) {
    print '<tr><td width="50%"><strong>' . $d->title . '</strong><br />' . $d->description . '</td><td>' . ($d->currentUserAchievement ? img_picto('Ok', 'star') : '') . '</td></tr>';
}
print '</table>';
dol_fiche_end();
llxFooter();