From cb61b09da8de40434d59be88396b5a189499b29e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 31 Jul 2006 22:33:48 +0000 Subject: [PATCH] =?UTF-8?q?Les=20notes=20de=20soci=E9t=E9s=20peuvent=20etr?= =?UTF-8?q?e=20=E9dit=E9es=20avec=20fckeditor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/socnote.php | 91 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 75 insertions(+), 16 deletions(-) diff --git a/htdocs/socnote.php b/htdocs/socnote.php index 5b68bf12f23..5878441e762 100644 --- a/htdocs/socnote.php +++ b/htdocs/socnote.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-2006 Laurent Destailleur * Copyright (C) 2005-2006 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -31,15 +31,14 @@ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); +$action = isset($_GET["action"])?$_GET["action"]:$_POST["action"]; + $langs->load("companies"); $user->getrights('commercial'); // Protection quand utilisateur externe -$socidp = isset($_GET["socid"])?$_GET["socid"]:''; - -//if ($socidp == '') accessforbidden(); //problème après update des notes - +$socidp = isset($_GET["socid"])?$_GET["socid"]:$_POST["socid"]; if ($user->societe_id > 0) { $socidp = $user->societe_id; @@ -59,7 +58,8 @@ if (!$user->rights->commercial->client->voir && $socidp && !$user->societe_id > } -if ($_POST["action"] == 'add') { +if ($_POST["action"] == 'add') +{ $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET note='".addslashes($_POST["note"])."' WHERE idp=".$_POST["socid"]; $result = $db->query($sql); @@ -91,21 +91,80 @@ if ($socidp > 0) print ''; - print ''; - print ''; - print ""; - print ''; + print ''; - print "
'.$langs->trans("Note").''.$langs->trans("CurrentNote").'
'; - print ""; - print "id."\">"; - print '
'; - print '
'.nl2br($societe->note).'
'.$langs->trans('Name').''.$societe->nom.'
"; + print ''.$langs->trans('Prefix').''.$societe->prefix_comm.''; + + if ($societe->client) { + print ''; + print $langs->trans('CustomerCode').''; + print $societe->code_client; + if ($societe->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode"); + print ''; + } + + if ($societe->fournisseur) { + print ''; + print $langs->trans('SupplierCode').''; + print $societe->code_fournisseur; + if ($societe->check_codefournisseur() <> 0) print ' '.$langs->trans("WrongSupplierCode"); + print ''; + } + + print ''.$langs->trans("Note").''; + print ''; + if ($action == 'edit' && $user->rights->societe->creer) + { + print ""; + print "id."\">"; + + // éditeur wysiwyg + if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING) + { + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('note',$societe->note,280,'dolibarr_notes'); + $doleditor->Create(); + } + else + { + print ''; + } + + } + else + { + print nl2br($societe->note); + } + print ""; + + if ($action == 'edit') + { + print ''; + } + print ""; + print ''; } -print '
'; +print ''; + + +/* + * Boutons actions + */ +if ($_GET["action"] == '') +{ + print '
'; + + if ($user->rights->societe->creer) + { + print ''.$langs->trans("Edit").''; + } + + print '
'; +} + $db->close();