[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/htdocs/user/ -> addon.php (source)

   1  <?php
   2  /* Copyright (C) 2004      Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   * Copyright (C) 2004-2005 Laurent Destailleur  <eldy@users.sourceforge.net>
   4   *
   5   * This program is free software; you can redistribute it and/or modify
   6   * it under the terms of the GNU General Public License as published by
   7   * the Free Software Foundation; either version 2 of the License, or
   8   * (at your option) any later version.
   9   *
  10   * This program is distributed in the hope that it will be useful,
  11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13   * GNU General Public License for more details.
  14   *
  15   * You should have received a copy of the GNU General Public License
  16   * along with this program; if not, write to the Free Software
  17   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18   *
  19   * $Id: addon.php,v 1.12 2005/08/11 18:48:08 eldy Exp $
  20   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/user/addon.php,v $
  21   */
  22  
  23  /**
  24          \file       htdocs/user/addon.php
  25          \brief      Onglet addon de la fiche utilisateur
  26          \version    $Revision: 1.12 $
  27  */
  28  
  29  require ("./pre.inc.php");
  30  require_once DOL_DOCUMENT_ROOT."/bookmark4u.class.php";
  31  
  32  $langs->load("users");
  33  
  34  $form = new Form($db);
  35  
  36  if ($_GET["action"] == 'create_bk4u_login')
  37  {
  38      $edituser = new User($db, $_GET["id"]);
  39      $edituser->fetch($_GET["id"]);
  40      
  41      $bk4u = new Bookmark4u($db);
  42      $bk4u->get_bk4u_uid($fuser);
  43      $result=$bk4u->create_account_from_user($edituser);
  44      
  45      if ($result > 0)
  46      {
  47          Header("Location: addon.php?id=".$_GET["id"]);
  48      }
  49      else
  50      {
  51          dolibarr_print_error($db,$bk4u->error);
  52          exit;
  53      }
  54  }
  55  
  56  llxHeader("","Addon Utilisateur");
  57  
  58  
  59  /* ************************************************************************** */
  60  /*                                                                            */
  61  /*                                                                            */
  62  /* ************************************************************************** */
  63  
  64  
  65  if ($_GET["id"])
  66  {
  67      $fuser = new User($db, $_GET["id"]);
  68      $fuser->fetch();
  69  
  70      $bk4u = new Bookmark4u($db);
  71      $bk4u->get_bk4u_uid($fuser);
  72  
  73  
  74      /*
  75       * Affichage onglets
  76       */
  77  
  78      $h = 0;
  79  
  80      $head[$h][0] = DOL_URL_ROOT.'/user/fiche.php?id='.$fuser->id;
  81      $head[$h][1] = $langs->trans("UserCard");
  82      $h++;
  83  
  84      $head[$h][0] = DOL_URL_ROOT.'/user/perms.php?id='.$fuser->id;
  85      $head[$h][1] = $langs->trans("UserRights");
  86      $h++;
  87  
  88      $head[$h][0] = DOL_URL_ROOT.'/user/param_ihm.php?id='.$fuser->id;
  89      $head[$h][1] = $langs->trans("UserGUISetup");
  90      $h++;
  91  
  92      if ($conf->bookmark4u->enabled)
  93      {
  94          $head[$h][0] = DOL_URL_ROOT.'/user/addon.php?id='.$fuser->id;
  95          $head[$h][1] = $langs->trans("Bookmark4u");
  96          $hselected=$h;
  97          $h++;
  98      }
  99  
 100      if ($conf->clicktodial->enabled)
 101      {
 102          $head[$h][0] = DOL_URL_ROOT.'/user/clicktodial.php?id='.$fuser->id;
 103          $head[$h][1] = $langs->trans("ClickToDial");
 104          $h++;
 105      }
 106  
 107      dolibarr_fiche_head($head, $hselected, $langs->trans("User").": ".$fuser->fullname);
 108  
 109      /*
 110      * Fiche en mode visu
 111      */
 112  
 113      print '<table class="border" width="100%">';
 114  
 115      print '<tr><td width="25%" valign="top">'.$langs->trans("Lastname").'</td>';
 116      print '<td class="valeur">'.$fuser->nom.'</td></tr>';
 117      print '<tr><td width="25%" valign="top">'.$langs->trans("Firstname").'</td>';
 118      print '<td class="valeur">'.$fuser->prenom.'</td>';
 119      print "</tr>\n";
 120  
 121      print '<tr><td width="25%" valign="top">'.$langs->trans("Login").'</td>';
 122      print '<td class="valeur">'.$fuser->login.'</td></tr>';
 123      print '<tr><td width="25%" valign="top">'.$langs->trans("EMail").'</td>';
 124      print '<td class="valeur"><a href="mailto:'.$fuser->email.'">'.$fuser->email.'</a></td>';
 125      print "</tr>\n";
 126  
 127  
 128      print "<tr>".'<td width="25%" valign="top">'.$langs->trans("Login Boobkmark4u").'</td>';
 129      print '<td class="valeur">';
 130  
 131      if ($bk4u->uid == 0)
 132      {
 133          print $langs->trans("NoLogin");
 134      }
 135      else
 136      {
 137          $bk4u->get_bk4u_login();
 138          print $bk4u->login;
 139      }
 140  
 141      print '</td>';
 142      print "</tr>\n";
 143  
 144  
 145      print "</table>\n";
 146  
 147      print "</div>\n";
 148  
 149  
 150      /*
 151      * Barre d'actions
 152      *
 153      */
 154      print '<div class="tabsAction">';
 155  
 156      if ($user->admin)
 157      {
 158          print '<a class="tabAction" href="addon.php?id='.$fuser->id.'&amp;action=create_bk4u_login">'.$langs->trans("Créer login Bookmark4u").'</a>';
 159      }
 160  
 161      print "</div>\n";
 162      print "<br>\n";
 163  
 164  }
 165  
 166  
 167  
 168  $db->close();
 169  
 170  llxFooter('$Date: 2005/08/11 18:48:08 $ - $Revision: 1.12 $');
 171  ?>


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics