Feature: Ajout onlget note sur fiche utilisateur
This commit is contained in:
parent
9b6bd49d8f
commit
f6d364b415
@ -21,9 +21,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/compta/facture/note.php
|
\file htdocs/adherents/note.php
|
||||||
\ingroup facture
|
\ingroup member
|
||||||
\brief Fiche de notes sur une facture
|
\brief Fiche de notes sur un adherent
|
||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@ -37,30 +37,33 @@ if (!$user->admin)
|
|||||||
|
|
||||||
// Constante et traduction de la description du module
|
// Constante et traduction de la description du module
|
||||||
$modules = array(
|
$modules = array(
|
||||||
'SOCIETE' => 'FCKeditorForCompany',
|
'USER' => 'FCKeditorForUsers',
|
||||||
|
'SOCIETE' => 'FCKeditorForCompany', // TODO Regrouper les 4 parm sur edit notes en 1 seul
|
||||||
'PRODUCTDESC' => 'FCKeditorForProduct',
|
'PRODUCTDESC' => 'FCKeditorForProduct',
|
||||||
'DETAILS' => 'FCKeditorForProductDetails',
|
'MEMBER' => 'FCKeditorForMembers',
|
||||||
'DETAILS_PERSO' => 'FCKeditorForProductDetailsPerso',
|
|
||||||
'MAILING' => 'FCKeditorForMailing',
|
'MAILING' => 'FCKeditorForMailing',
|
||||||
'MEMBER' => 'FCKeditorForMembers'
|
'DETAILS' => 'FCKeditorForProductDetails',
|
||||||
|
'DETAILS_PERSO' => 'FCKeditorForProductDetailsPerso'
|
||||||
);
|
);
|
||||||
// Conditions pour que l'option soit proposée
|
// Conditions pour que l'option soit proposée
|
||||||
$conditions = array(
|
$conditions = array(
|
||||||
|
'USER' => 1,
|
||||||
'SOCIETE' => $conf->societe->enabled,
|
'SOCIETE' => $conf->societe->enabled,
|
||||||
'PRODUCTDESC' => ($conf->produit->enabled||$conf->service->enabled),
|
'PRODUCTDESC' => ($conf->produit->enabled||$conf->service->enabled),
|
||||||
'DETAILS' => ($conf->facture->enabled||$conf->propal->enabled||$conf->commande->enabled),
|
'MEMBER' => $conf->adherent->enabled,
|
||||||
'DETAILS_PERSO' => ($conf->facture->enabled||$conf->propal->enabled||$conf->commande->enabled),
|
|
||||||
'MAILING' => $conf->mailing->enabled,
|
'MAILING' => $conf->mailing->enabled,
|
||||||
'MEMBER' => $conf->adherent->enabled
|
'DETAILS' => ($conf->facture->enabled||$conf->propal->enabled||$conf->commande->enabled),
|
||||||
|
'DETAILS_PERSO' => ($conf->facture->enabled||$conf->propal->enabled||$conf->commande->enabled)
|
||||||
);
|
);
|
||||||
// Picto
|
// Picto
|
||||||
$picto = array(
|
$picto = array(
|
||||||
|
'USER' => 'user',
|
||||||
'SOCIETE' => 'company',
|
'SOCIETE' => 'company',
|
||||||
'PRODUCTDESC' => 'product',
|
'PRODUCTDESC' => 'product',
|
||||||
'DETAILS' => 'generic',
|
'MEMBER' => 'user',
|
||||||
'DETAILS_PERSO' => 'generic',
|
|
||||||
'MAILING' => 'email',
|
'MAILING' => 'email',
|
||||||
'MEMBER' => 'user'
|
'DETAILS' => 'generic',
|
||||||
|
'DETAILS_PERSO' => 'generic'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -70,7 +73,7 @@ foreach($modules as $const => $desc)
|
|||||||
{
|
{
|
||||||
dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1");
|
dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1");
|
||||||
// Si fckeditor est activé dans la description produit/service, on l'active dans les formulaires
|
// Si fckeditor est activé dans la description produit/service, on l'active dans les formulaires
|
||||||
if ($const == 'PRODUCTDESC')
|
if ($const == 'PRODUCTDESC' && $conf->global->PRODUIT_DESC_IN_FORM)
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1");
|
dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -728,11 +728,12 @@ DeliveryOrderModel=Products deliveries receipt model
|
|||||||
DeliveriesOrderAbility=Products deliveries receipt ability
|
DeliveriesOrderAbility=Products deliveries receipt ability
|
||||||
##### FCKeditor #####
|
##### FCKeditor #####
|
||||||
ActivateFCKeditor=Activate FCKeditor for:
|
ActivateFCKeditor=Activate FCKeditor for:
|
||||||
FCKeditorForCompany=WYSIWIG creation/edition of companies description and note
|
FCKeditorForMembers=WYSIWIG creation/edition of users' description and note
|
||||||
FCKeditorForProduct=WYSIWIG creation/edition of products/services description and note
|
FCKeditorForCompany=WYSIWIG creation/edition of companies' description and note
|
||||||
FCKeditorForMembers=WYSIWIG creation/edition of members description and note
|
FCKeditorForProduct=WYSIWIG creation/edition of products/services' description and note
|
||||||
FCKeditorForProductDetails=WYSIWIG creation/edition of details lines for all entities (proposals, orders, invoices, etc...)
|
FCKeditorForMembers=WYSIWIG creation/edition of members' description and note
|
||||||
FCKeditorForProductDetailsPerso=WYSIWIG creation/edition of description for all personalized products (proposals, orders, invoices, etc...)
|
FCKeditorForProductDetails=WYSIWIG creation/edition of products details lines for all entities (proposals, orders, invoices, etc...)
|
||||||
|
FCKeditorForProductDetailsPerso=WYSIWIG creation/edition of products personalized details lines for all entities (proposals, orders, invoices, etc...)
|
||||||
FCKeditorForMailing=WYSIWIG creation/edition of mailings
|
FCKeditorForMailing=WYSIWIG creation/edition of mailings
|
||||||
##### OSCommerce 1 #####
|
##### OSCommerce 1 #####
|
||||||
OSCommerceErrorConnectOkButWrongDatabase=Connection succeeded but database doesn't look to be an OSCommerce database.
|
OSCommerceErrorConnectOkButWrongDatabase=Connection succeeded but database doesn't look to be an OSCommerce database.
|
||||||
|
|||||||
@ -730,11 +730,12 @@ DeliveryOrderModel=Mod
|
|||||||
DeliveriesOrderAbility=Prise en charge des bons de réception client
|
DeliveriesOrderAbility=Prise en charge des bons de réception client
|
||||||
##### FCKeditor #####
|
##### FCKeditor #####
|
||||||
ActivateFCKeditor=Activer FCKeditor pour :
|
ActivateFCKeditor=Activer FCKeditor pour :
|
||||||
FCKeditorForCompany=Création/édition WYSIWIG des descriptions et notes des tiers
|
FCKeditorForUsers=Création/édition WYSIWIG de la description et note des utilisateurs
|
||||||
FCKeditorForProduct=Création/édition WYSIWIG des descriptions et notes des produits/services
|
FCKeditorForCompany=Création/édition WYSIWIG de la description et note des tiers
|
||||||
FCKeditorForMembers=Création/édition WYSIWIG des descriptions et notes des adhérents
|
FCKeditorForProduct=Création/édition WYSIWIG de la description et note des produits/services
|
||||||
FCKeditorForProductDetails=Création/édition WYSIWIG des lignes details des produits (sur commandes, propales, factures, etc...)
|
FCKeditorForMembers=Création/édition WYSIWIG de la description et note des adhérents
|
||||||
FCKeditorForProductDetailsPerso=Création/édition WYSIWIG des descriptions des produits personnalisées (sur commandes, propales, factures, etc...)
|
FCKeditorForProductDetails=Création/édition WYSIWIG des lignes details produits (sur commandes, propales, factures, etc...)
|
||||||
|
FCKeditorForProductDetailsPerso=Création/édition WYSIWIG des lignes details produits personnalisées (sur commandes, propales, factures, etc...)
|
||||||
FCKeditorForMailing=Création/édition WYSIWIG des mailings
|
FCKeditorForMailing=Création/édition WYSIWIG des mailings
|
||||||
##### OSCommerce 1 #####
|
##### OSCommerce 1 #####
|
||||||
OSCommerceErrorConnectOkButWrongDatabase=La connexion a réussie mais la base ne semble pas etre une base OSCommerce.
|
OSCommerceErrorConnectOkButWrongDatabase=La connexion a réussie mais la base ne semble pas etre une base OSCommerce.
|
||||||
|
|||||||
@ -76,6 +76,11 @@ function user_prepare_head($user)
|
|||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/user/note.php?id='.$user->id;
|
||||||
|
$head[$h][1] = $langs->trans("Note");
|
||||||
|
$head[$h][2] = 'note';
|
||||||
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/user/info.php?id='.$user->id;
|
$head[$h][0] = DOL_URL_ROOT.'/user/info.php?id='.$user->id;
|
||||||
$head[$h][1] = $langs->trans("Info");
|
$head[$h][1] = $langs->trans("Info");
|
||||||
$head[$h][2] = 'info';
|
$head[$h][2] = 'info';
|
||||||
|
|||||||
@ -1014,6 +1014,34 @@ class User
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Fonction qui met à jour le commentaire d'un utilisateur
|
||||||
|
\param note Note
|
||||||
|
\param user Utilisateur qui réalise la mise a jour
|
||||||
|
\return int <0 si KO, >0 si OK
|
||||||
|
*/
|
||||||
|
function update_note($note,$user)
|
||||||
|
{
|
||||||
|
$this->db->begin();
|
||||||
|
|
||||||
|
$sql = "UPDATE ".MAIN_DB_PREFIX."user SET";
|
||||||
|
$sql.= " note='".addslashes($note)."'";
|
||||||
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
|
dolibarr_syslog("User::update_note sql=$sql");
|
||||||
|
$result = $this->db->query($sql);
|
||||||
|
if (! $result)
|
||||||
|
{
|
||||||
|
$this->error=$this->db->error();
|
||||||
|
$this->db->rollback();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->note = $note;
|
||||||
|
|
||||||
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Mise à jour en base de la date de deniere connexion d'un utilisateur
|
* \brief Mise à jour en base de la date de deniere connexion d'un utilisateur
|
||||||
|
|||||||
167
htdocs/user/note.php
Normal file
167
htdocs/user/note.php
Normal file
@ -0,0 +1,167 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
* $Source$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\file htdocs/user/note.php
|
||||||
|
\ingroup usergroup
|
||||||
|
\brief Fiche de notes sur un utilisateur Dolibarr
|
||||||
|
\version $Revision$
|
||||||
|
*/
|
||||||
|
|
||||||
|
require("./pre.inc.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT.'/lib/usergroups.lib.php');
|
||||||
|
require_once(DOL_DOCUMENT_ROOT.'/user.class.php');
|
||||||
|
|
||||||
|
$action=isset($_GET["action"])?$_GET["action"]:(isset($_POST["action"])?$_POST["action"]:"");
|
||||||
|
$id=isset($_GET["id"])?$_GET["id"]:(isset($_POST["id"])?$_POST["id"]:"");
|
||||||
|
|
||||||
|
$user->getrights('user');
|
||||||
|
|
||||||
|
$langs->load("companies");
|
||||||
|
$langs->load("members");
|
||||||
|
$langs->load("bills");
|
||||||
|
|
||||||
|
if (!$user->rights->user->user->lire)
|
||||||
|
accessforbidden();
|
||||||
|
|
||||||
|
$fuser = new User($db);
|
||||||
|
$fuser->id = $id;
|
||||||
|
$fuser->fetch();
|
||||||
|
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
/* Actions */
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
if ($_POST["action"] == 'update' && $user->rights->user->user->creer && ! $_POST["cancel"])
|
||||||
|
{
|
||||||
|
$db->begin();
|
||||||
|
|
||||||
|
$res=$fuser->update_note($_POST["note"],$user);
|
||||||
|
if ($res < 0)
|
||||||
|
{
|
||||||
|
$mesg='<div class="error">'.$adh->error.'</div>';
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$db->commit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
/* Affichage fiche */
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
llxHeader();
|
||||||
|
|
||||||
|
$html = new Form($db);
|
||||||
|
|
||||||
|
if ($id)
|
||||||
|
{
|
||||||
|
$head = user_prepare_head($fuser);
|
||||||
|
|
||||||
|
dolibarr_fiche_head($head, 'note', $langs->trans("User"));
|
||||||
|
|
||||||
|
if ($msg) print '<div class="error">'.$msg.'</div>';
|
||||||
|
|
||||||
|
print "<form method=\"post\" action=\"note.php\">";
|
||||||
|
|
||||||
|
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');
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Nom
|
||||||
|
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur" colspan="3">'.$fuser->nom.' </td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Prenom
|
||||||
|
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur" colspan="3">'.$fuser->prenom.' </td></tr>';
|
||||||
|
|
||||||
|
// Login
|
||||||
|
print '<tr><td>'.$langs->trans("Login").'</td><td class="valeur" colspan="3">'.$fuser->login.' </td></tr>';
|
||||||
|
|
||||||
|
// Note
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("Note").'</td>';
|
||||||
|
print '<td valign="top" colspan="3">';
|
||||||
|
if ($action == 'edit' && $user->rights->user->user->creer)
|
||||||
|
{
|
||||||
|
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
||||||
|
print "<input type=\"hidden\" name=\"id\" value=\"".$fuser->id."\">";
|
||||||
|
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_USER)
|
||||||
|
{
|
||||||
|
// Editeur wysiwyg
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||||
|
$doleditor=new DolEditor('note',$fuser->note,280,'dolibarr_notes','In',true);
|
||||||
|
$doleditor->Create();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<textarea name="note" cols="80" rows="10">'.$fuser->note.'</textarea>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print nl2br($fuser->note);
|
||||||
|
}
|
||||||
|
print "</td></tr>";
|
||||||
|
|
||||||
|
if ($action == 'edit')
|
||||||
|
{
|
||||||
|
print '<tr><td colspan="4" align="center">';
|
||||||
|
print '<input type="submit" class="button" name="update" value="'.$langs->trans("Save").'">';
|
||||||
|
print ' ';
|
||||||
|
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</table>";
|
||||||
|
print "</form>\n";
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
print '</div>';
|
||||||
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
|
if ($user->rights->user->user->creer && $action != 'edit')
|
||||||
|
{
|
||||||
|
print "<a class=\"butAction\" href=\"note.php?id=$fuser->id&action=edit\">".$langs->trans('Edit')."</a>";
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</div>";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->close();
|
||||||
|
|
||||||
|
llxFooter('$Date$ - $Revision$');
|
||||||
|
?>
|
||||||
@ -156,6 +156,15 @@ insert into llx_const (name, value, type, note, visible) values ('ADHERENT_CARD_
|
|||||||
insert into llx_const (name, value, type, note, visible) values ('ADHERENT_CARD_FOOTER_TEXT','Association AZERTY','chaine','Texte imprime sur le bas de la carte adherent',0);
|
insert into llx_const (name, value, type, note, visible) values ('ADHERENT_CARD_FOOTER_TEXT','Association AZERTY','chaine','Texte imprime sur le bas de la carte adherent',0);
|
||||||
insert into llx_const (name, value, type, note, visible) values ('ADHERENT_CARD_TEXT','%TYPE% n° %ID%\r\n%PRENOM% %NOM%\r\n<%EMAIL%>\r\n%ADRESSE%\r\n%CP% %VILLE%\r\n%PAYS%','texte','Texte imprime sur la carte adherent',0);
|
insert into llx_const (name, value, type, note, visible) values ('ADHERENT_CARD_TEXT','%TYPE% n° %ID%\r\n%PRENOM% %NOM%\r\n<%EMAIL%>\r\n%ADRESSE%\r\n%CP% %VILLE%\r\n%PAYS%','texte','Texte imprime sur la carte adherent',0);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- FCKEditor
|
||||||
|
--
|
||||||
|
insert into llx_const (name, value, type, note, visible) values ('FCKEDITOR_ENABLE_USER', 1,'yesno','Activation fckeditor sur notes utilisateurs',0);
|
||||||
|
insert into llx_const (name, value, type, note, visible) values ('FCKEDITOR_ENABLE_SOCIETE', 1,'yesno','Activation fckeditor sur notes societe',0);
|
||||||
|
insert into llx_const (name, value, type, note, visible) values ('FCKEDITOR_ENABLE_PRODUCTDESC',1,'yesno','Activation fckeditor sur notes produits',0);
|
||||||
|
insert into llx_const (name, value, type, note, visible) values ('FCKEDITOR_ENABLE_MEMBER', 1,'yesno','Activation fckeditor sur notes adherent',0);
|
||||||
|
insert into llx_const (name, value, type, note, visible) values ('FCKEDITOR_ENABLE_MAILING', 1,'yesno','Activation fckeditor sur emailing',0);
|
||||||
|
|
||||||
--
|
--
|
||||||
-- OsCommerce 1
|
-- OsCommerce 1
|
||||||
--
|
--
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user