Fix: Avoid conflict with other payment modules functions

New: EMail topics can be forced by external modules
This commit is contained in:
Laurent Destailleur
2011-07-13 16:55:25 +00:00
parent b722bbd6ec
commit 1135923e34
9 changed files with 100 additions and 106 deletions

13
README
View File

@@ -53,20 +53,13 @@ To upgrade Dolibarr from an old version to this one:
- If you came from a beta version or from any version x.y.z to any - If you came from a beta version or from any version x.y.z to any
other where x or y number differs, you must call the Dolibarr "install/" other where x or y number differs, you must call the Dolibarr "install/"
page in your browser. page in your browser (this should be done automatically at first dolibarr
Url might be for example: access).
This URL should looks like:
http://localhost/dolibarr/htdocs/install/ http://localhost/dolibarr/htdocs/install/
or or
http://yourdolibarrhost/install/index.php http://yourdolibarrhost/install/index.php
To know what is exactly correct URL for "install/" page, take URL you use
to go on login page. It it ends with "index.php", remove it. Then add
"install/" at the end.
For example, if your login page is:
http://yourdolibarrhost/something/index.php
Then, your "install/" pages will be
http://yourdolibarrhost/something/install/
Then choose the "update" option according to your case. Then choose the "update" option according to your case.
Note: Migrate process can be ran safely several times. Note: Migrate process can be ran safely several times.

View File

@@ -53,19 +53,13 @@ Pour mettre a jour Dolibarr depuis une vieille version vers celle ci:
il n'y a pas besoin de migration de données. il n'y a pas besoin de migration de données.
- Si vous venez d'une beta ou d'un version x.y.z vers une autre ou les numeros x - Si vous venez d'une beta ou d'un version x.y.z vers une autre ou les numeros x
ou y varient, vous devez appelez la page de migration dans votre navigateur: ou y varient, vous devez appelez la page "install/" de migration dans votre
navigateur (ceci doit se faire automatiquement au premier accès de l'application).
Ce sera une URL du genre:
http://localhost/dolibarr/htdocs/install/index.php http://localhost/dolibarr/htdocs/install/index.php
ou ou
http://yourdolibarrhost/install/index.php http://yourdolibarrhost/install/index.php
Pour savoir quelle est l'URL exactement de la page "install/", prenez l'URL que
vous utilisez pour vous loguer. Si elle se termine par "index.php", enlevez le.
Dans tous les cas, ajouter ensuite "install/" à la fin.
Par exemple, si votre page de connexion est:
http://yourdolibarrhost/something/index.php
Alors la page "install/" sera
http://yourdolibarrhost/something/install/
Ensuite, choisir l'option de "mise a jour" en rapport avec votre cas. Ensuite, choisir l'option de "mise a jour" en rapport avec votre cas.
Note: Le processus de migration peut etre lance plusieurs fois sans risque. Note: Le processus de migration peut etre lance plusieurs fois sans risque.

View File

@@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@@ -23,7 +23,7 @@
* \file htdocs/compta/facture/impayees.php * \file htdocs/compta/facture/impayees.php
* \ingroup facture * \ingroup facture
* \brief Page to list and build liste of unpaid invoices * \brief Page to list and build liste of unpaid invoices
* \version $Revision$ * \version $Revision: 1.83 $
*/ */
require("../../main.inc.php"); require("../../main.inc.php");
@@ -268,7 +268,7 @@ if ($result)
print_fiche_titre($titre,$link); print_fiche_titre($titre,$link);
//print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',0); // We don't want pagination on this page //print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',0); // We don't want pagination on this page
if ($mesg) print $mesg; dol_htmloutput_mesg($mesg);
$i = 0; $i = 0;
print '<table class="liste" width="100%">'; print '<table class="liste" width="100%">';
@@ -351,10 +351,10 @@ if ($result)
// PDF Picto // PDF Picto
print '<td width="16" align="right" class="nobordernopadding">'; print '<td width="16" align="right" class="nobordernopadding">';
$filename=dol_sanitizeFileName($objp->facnumber); $filename=dol_sanitizeFileName($objp->facnumber);
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber);
$foundpdf=$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1,$param); $foundpdf=$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1,$param);
print '</td>'; print '</td>';
print '</tr></table>'; print '</tr></table>';
@@ -425,5 +425,5 @@ if ($result)
$db->close(); $db->close();
llxFooter('$Date$ - $Revision$'); llxFooter('$Date: 2011/07/13 14:41:02 $ - $Revision: 1.83 $');
?> ?>

View File

@@ -22,7 +22,7 @@
* \file htdocs/core/class/commonobject.class.php * \file htdocs/core/class/commonobject.class.php
* \ingroup core * \ingroup core
* \brief File of parent class of all other business classes (invoices, contracts, proposals, orders, ...) * \brief File of parent class of all other business classes (invoices, contracts, proposals, orders, ...)
* \version $Id: commonobject.class.php,v 1.145 2011/07/10 16:50:40 eldy Exp $ * \version $Id: commonobject.class.php,v 1.146 2011/07/13 16:55:25 eldy Exp $
*/ */
@@ -365,9 +365,10 @@ class CommonObject
* Return array with list of possible values for type of contacts * Return array with list of possible values for type of contacts
* @param source internal, external or all if not defined * @param source internal, external or all if not defined
* @param order Sort order by : code or rowid * @param order Sort order by : code or rowid
* @return array List of type of contacts * @param option 0=Return array id->label, 1=Return array code->label
* @return array Array list of type of contacts (id->label if option=0, code->label if option=1)
*/ */
function liste_type_contact($source='internal', $order='code') function liste_type_contact($source='internal', $order='code', $option=0)
{ {
global $langs; global $langs;
@@ -390,7 +391,8 @@ class CommonObject
$transkey="TypeContact_".$this->element."_".$source."_".$obj->code; $transkey="TypeContact_".$this->element."_".$source."_".$obj->code;
$libelle_type=($langs->trans($transkey)!=$transkey ? $langs->trans($transkey) : $obj->libelle); $libelle_type=($langs->trans($transkey)!=$transkey ? $langs->trans($transkey) : $obj->libelle);
$tab[$obj->rowid]=$libelle_type; if (empty($option)) $tab[$obj->rowid]=$libelle_type;
else $tab[$obj->code]=$libelle_type;
$i++; $i++;
} }
return $tab; return $tab;

View File

@@ -22,7 +22,7 @@
* \file htdocs/core/class/html.formfile.class.php * \file htdocs/core/class/html.formfile.class.php
* \ingroup core * \ingroup core
* \brief File of class to offer components to list and upload files * \brief File of class to offer components to list and upload files
* \version $Id: html.formfile.class.php,v 1.48 2011/07/13 07:38:11 hregis Exp $ * \version $Id: html.formfile.class.php,v 1.49 2011/07/13 14:41:03 eldy Exp $
*/ */
@@ -152,6 +152,7 @@ class FormFile
*/ */
function show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$hooks='') function show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$hooks='')
{ {
$this->numoffiles=0;
print $this->showdocuments($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed,$modelselected,$allowgenifempty,$forcenomultilang,$iconPDF,$maxfilenamelength,$noform,$param,$title,$buttonlabel,$codelang,$hooks); print $this->showdocuments($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed,$modelselected,$allowgenifempty,$forcenomultilang,$iconPDF,$maxfilenamelength,$noform,$param,$title,$buttonlabel,$codelang,$hooks);
return $this->numoffiles; return $this->numoffiles;
} }
@@ -845,12 +846,12 @@ class FormFile
print '<button type="submit" class="start">'.$langs->trans('StartUpload').'</button>'; print '<button type="submit" class="start">'.$langs->trans('StartUpload').'</button>';
print '<button type="reset" class="cancel">'.$langs->trans('CancelUpload').'</button>'; print '<button type="reset" class="cancel">'.$langs->trans('CancelUpload').'</button>';
print '</div></form>'; print '</div></form>';
print '</div><!-- end div fileupload -->'; print '</div><!-- end div fileupload -->';
print '<div id="fileupload-view">'; print '<div id="fileupload-view">';
print '<div class="fileupload-content">'; print '<div class="fileupload-content">';
print '<table width="100%" class="files">'; print '<table width="100%" class="files">';
/*print '<tr>'; /*print '<tr>';
print '<td>'.$langs->trans("Documents2").'</td>'; print '<td>'.$langs->trans("Documents2").'</td>';

View File

@@ -22,7 +22,7 @@
* \file htdocs/core/class/html.formmail.class.php * \file htdocs/core/class/html.formmail.class.php
* \ingroup core * \ingroup core
* \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire * \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire
* \version $Id: html.formmail.class.php,v 1.31 2011/07/10 20:03:41 eldy Exp $ * \version $Id: html.formmail.class.php,v 1.32 2011/07/13 16:55:25 eldy Exp $
*/ */
require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php");
@@ -519,7 +519,7 @@ class FormMail
foreach($listofpaths as $key => $val) foreach($listofpaths as $key => $val)
{ {
$out.= '<div id="attachfile_'.$key.'">'; $out.= '<div id="attachfile_'.$key.'">';
$out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; $out.= img_mime($listofnames[$key]).' '.$listofnames[$key];
if (! $this->withfilereadonly) if (! $this->withfilereadonly)
{ {
$out.= ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="'.($key+1).'" class="removedfile" id="removedfile_'.$key.'" name="removedfile_'.$key.'" />'; $out.= ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="'.($key+1).'" class="removedfile" id="removedfile_'.$key.'" name="removedfile_'.$key.'" />';
@@ -547,15 +547,15 @@ class FormMail
$defaultmessage=""; $defaultmessage="";
// TODO A partir du type, proposer liste de messages dans table llx_models // TODO A partir du type, proposer liste de messages dans table llx_models
if ($this->param["models"]=='body') { $defaultmessage=$this->withbody; } if ($this->param["models"]=='facture_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendInvoice"); }
if ($this->param["models"]=='facture_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendInvoice"); } elseif ($this->param["models"]=='facture_relance') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendInvoiceReminder"); }
if ($this->param["models"]=='facture_relance') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendInvoiceReminder"); } elseif ($this->param["models"]=='propal_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendProposal"); }
if ($this->param["models"]=='propal_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendProposal"); } elseif ($this->param["models"]=='order_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendOrder"); }
if ($this->param["models"]=='order_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendOrder"); } elseif ($this->param["models"]=='order_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierOrder"); }
if ($this->param["models"]=='order_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierOrder"); } elseif ($this->param["models"]=='invoice_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); }
if ($this->param["models"]=='invoice_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); } elseif ($this->param["models"]=='shipping_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendShipping"); }
if ($this->param["models"]=='shipping_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendShipping"); } elseif ($this->param["models"]=='fichinter_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendFichInter"); }
if ($this->param["models"]=='fichinter_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendFichInter"); } elseif (! is_numeric($this->withbody)) { $defaultmessage=$this->withbody; }
if ($conf->paypal->enabled && $conf->global->PAYPAL_ADD_PAYMENT_URL) if ($conf->paypal->enabled && $conf->global->PAYPAL_ADD_PAYMENT_URL)
{ {
@@ -565,12 +565,12 @@ class FormMail
if ($this->param["models"]=='order_send') if ($this->param["models"]=='order_send')
{ {
$url=getPaymentUrl('order',$this->substit['__ORDERREF__']); $url=getPaypalPaymentUrl('order',$this->substit['__ORDERREF__']);
$defaultmessage=$langs->transnoentities("PredefinedMailContentSendOrderWithPaypalLink",$url); $defaultmessage=$langs->transnoentities("PredefinedMailContentSendOrderWithPaypalLink",$url);
} }
if ($this->param["models"]=='facture_send') if ($this->param["models"]=='facture_send')
{ {
$url=getPaymentUrl('invoice',$this->substit['__FACREF__']); $url=getPaypalPaymentUrl('invoice',$this->substit['__FACREF__']);
$defaultmessage=$langs->transnoentities("PredefinedMailContentSendInvoiceWithPaypalLink",$url); $defaultmessage=$langs->transnoentities("PredefinedMailContentSendInvoiceWithPaypalLink",$url);
} }
} }

View File

@@ -9,8 +9,8 @@
// Reference language: en_US // Reference language: en_US
CHARSET=UTF-8 CHARSET=UTF-8
DIRECTION=ltr DIRECTION=ltr
FONTFORPDF=chinese #FONTFORPDF=chinese
#FONTFORPDF=stsongstdlight FONTFORPDF=stsongstdlight
#FONTSIZEFORPDF=9 #FONTSIZEFORPDF=9
SeparatorDecimal=. SeparatorDecimal=.
SeparatorThousand=None SeparatorThousand=None

View File

@@ -22,7 +22,7 @@
* \file htdocs/paypal/lib/paypal.lib.php * \file htdocs/paypal/lib/paypal.lib.php
* \ingroup paypal * \ingroup paypal
* \brief Library for common paypal functions * \brief Library for common paypal functions
* \version $Id$ * \version $Id: paypal.lib.php,v 1.25 2011/07/13 16:55:34 eldy Exp $
*/ */
function llxHeaderPaypal($title, $head = "") function llxHeaderPaypal($title, $head = "")
{ {
@@ -132,7 +132,7 @@ function html_print_paypal_footer($fromcompany,$langs)
function paypaladmin_prepare_head() function paypaladmin_prepare_head()
{ {
global $langs, $conf; global $langs, $conf;
$h = 0; $h = 0;
$head = array(); $head = array();
@@ -140,7 +140,7 @@ function paypaladmin_prepare_head()
$head[$h][1] = $langs->trans("Account"); $head[$h][1] = $langs->trans("Account");
$head[$h][2] = 'paypalaccount'; $head[$h][2] = 'paypalaccount';
$h++; $h++;
// Show more tabs from modules // Show more tabs from modules
// Entries must be declared in modules descriptor with line // Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
@@ -151,24 +151,24 @@ function paypaladmin_prepare_head()
} }
/** /**
* *
*/ */
function getPaymentUrl($source='',$ref='',$amount=0,$freetag='') function getPaypalPaymentUrl($source='',$ref='',$amount=0,$freetag='')
{ {
global $conf; global $conf;
require_once(DOL_DOCUMENT_ROOT."/lib/security.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/security.lib.php");
if (! empty($source) && ! empty($ref)) if (! empty($source) && ! empty($ref))
{ {
$token=''; $token='';
if (! empty($conf->global->PAYPAL_SECURITY_TOKEN)) $token='&securekey='.dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.$source.$ref, 2); if (! empty($conf->global->PAYPAL_SECURITY_TOKEN)) $token='&securekey='.dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.$source.$ref, 2);
if ($source == 'commande') $source = 'order'; if ($source == 'commande') $source = 'order';
if ($source == 'facture') $source = 'invoice'; if ($source == 'facture') $source = 'invoice';
$url = DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?source='.$source.'&ref='.$ref.$token; $url = DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?source='.$source.'&ref='.$ref.$token;
return $url; return $url;
} }
} }
@@ -482,7 +482,7 @@ function hash_call($methodName,$nvpStr)
global $conf, $langs; global $conf, $langs;
global $API_Endpoint, $API_Url, $API_version, $USE_PROXY, $PROXY_HOST, $PROXY_PORT, $PROXY_USER, $PROXY_PASS; global $API_Endpoint, $API_Url, $API_version, $USE_PROXY, $PROXY_HOST, $PROXY_PORT, $PROXY_USER, $PROXY_PASS;
global $PAYPAL_API_USER, $PAYPAL_API_PASSWORD, $PAYPAL_API_SIGNATURE; global $PAYPAL_API_USER, $PAYPAL_API_PASSWORD, $PAYPAL_API_SIGNATURE;
// TODO problem with triggers // TODO problem with triggers
$API_version="56"; $API_version="56";
if ($conf->global->PAYPAL_API_SANDBOX) if ($conf->global->PAYPAL_API_SANDBOX)
@@ -495,7 +495,7 @@ function hash_call($methodName,$nvpStr)
$API_Endpoint = "https://api-3t.paypal.com/nvp"; $API_Endpoint = "https://api-3t.paypal.com/nvp";
$API_Url = "https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token="; $API_Url = "https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=";
} }
// Clean parameters // Clean parameters
$PAYPAL_API_USER=""; $PAYPAL_API_USER="";
if ($conf->global->PAYPAL_API_USER) $PAYPAL_API_USER=$conf->global->PAYPAL_API_USER; if ($conf->global->PAYPAL_API_USER) $PAYPAL_API_USER=$conf->global->PAYPAL_API_USER;
@@ -506,7 +506,7 @@ function hash_call($methodName,$nvpStr)
$PAYPAL_API_SANDBOX=""; $PAYPAL_API_SANDBOX="";
if ($conf->global->PAYPAL_API_SANDBOX) $PAYPAL_API_SANDBOX=$conf->global->PAYPAL_API_SANDBOX; if ($conf->global->PAYPAL_API_SANDBOX) $PAYPAL_API_SANDBOX=$conf->global->PAYPAL_API_SANDBOX;
// TODO END problem with triggers // TODO END problem with triggers
dol_syslog("Paypal API endpoint ".$API_Endpoint); dol_syslog("Paypal API endpoint ".$API_Endpoint);
//setting the curl parameters. //setting the curl parameters.
@@ -580,19 +580,19 @@ function hash_call($methodName,$nvpStr)
function GetApiError() function GetApiError()
{ {
$errors=array(); $errors=array();
$resArray=$_SESSION['reshash']; $resArray=$_SESSION['reshash'];
if(isset($_SESSION['curl_error_no'])) if(isset($_SESSION['curl_error_no']))
{ {
$errors[] = $_SESSION['curl_error_no'].'-'.$_SESSION['curl_error_msg']; $errors[] = $_SESSION['curl_error_no'].'-'.$_SESSION['curl_error_msg'];
} }
foreach($resArray as $key => $value) foreach($resArray as $key => $value)
{ {
$errors[] = $key.'-'.$value; $errors[] = $key.'-'.$value;
} }
return $errors; return $errors;
} }

View File

@@ -23,7 +23,7 @@
* \file htdocs/societe/socnote.php * \file htdocs/societe/socnote.php
* \brief Tab for notes on third party * \brief Tab for notes on third party
* \ingroup societe * \ingroup societe
* \version $Id$ * \version $Id: socnote.php,v 1.22 2011/07/13 16:24:57 eldy Exp $
*/ */
require("../main.inc.php"); require("../main.inc.php");
@@ -44,13 +44,13 @@ $result = restrictedArea($user, 'societe', $socid);
* Actions * Actions
*/ */
if ($action == 'add') if ($action == 'add' && ! GETPOST('cancel'))
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET note='".$db->escape($_POST["note"])."' WHERE rowid=".$_POST["socid"]; $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET note='".$db->escape($_POST["note"])."' WHERE rowid=".$_POST["socid"];
$result = $db->query($sql); $result = $db->query($sql);
$_GET["socid"]=$_POST["socid"]; // Pour retour sur fiche $_GET["socid"]=$_POST["socid"]; // Pour retour sur fiche
$socid = $_GET["socid"]; $socid = $_GET["socid"];
} }
@@ -70,25 +70,25 @@ if ($socid > 0)
$societe = new Societe($db, $socid); $societe = new Societe($db, $socid);
$societe->fetch($socid); $societe->fetch($socid);
/* /*
* Affichage onglets * Affichage onglets
*/ */
if ($conf->notification->enabled) $langs->load("mails"); if ($conf->notification->enabled) $langs->load("mails");
$head = societe_prepare_head($societe); $head = societe_prepare_head($societe);
dol_fiche_head($head, 'note', $langs->trans("ThirdParty"),0,'company'); dol_fiche_head($head, 'note', $langs->trans("ThirdParty"),0,'company');
print "<form method=\"post\" action=\"".DOL_URL_ROOT."/societe/socnote.php\">"; print "<form method=\"post\" action=\"".DOL_URL_ROOT."/societe/socnote.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td width="20%">'.$langs->trans('ThirdPartyName').'</td>'; print '<tr><td width="20%">'.$langs->trans('ThirdPartyName').'</td>';
print '<td colspan="3">'; print '<td colspan="3">';
print $form->showrefnav($societe,'socid','',($user->societe_id?0:1),'rowid','nom'); print $form->showrefnav($societe,'socid','',($user->societe_id?0:1),'rowid','nom');
print '</td></tr>'; print '</td></tr>';
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{ {
@@ -113,32 +113,36 @@ if ($socid > 0)
print '</td></tr>'; print '</td></tr>';
} }
print '<tr><td valign="top">'.$langs->trans("Note").'</td>'; print '<tr><td valign="top">'.$langs->trans("Note").'</td>';
print '<td valign="top">'; print '<td valign="top">';
if ($action == 'edit' && $user->rights->societe->creer) if ($action == 'edit' && $user->rights->societe->creer)
{ {
print "<input type=\"hidden\" name=\"action\" value=\"add\">"; print "<input type=\"hidden\" name=\"action\" value=\"add\">";
print "<input type=\"hidden\" name=\"socid\" value=\"".$societe->id."\">"; print "<input type=\"hidden\" name=\"socid\" value=\"".$societe->id."\">";
// Editeur wysiwyg // Editeur wysiwyg
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
$doleditor=new DolEditor('note',$societe->note,'',360,'dolibarr_notes','In',true,false,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_SOCIETE,20,70); $doleditor=new DolEditor('note',$societe->note,'',360,'dolibarr_notes','In',true,false,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_SOCIETE,20,70);
$doleditor->Create(); $doleditor->Create();
} }
else else
{ {
print dol_textishtml($societe->note)?$societe->note:dol_nl2br($societe->note,1,true); print dol_textishtml($societe->note)?$societe->note:dol_nl2br($societe->note,1,true);
} }
print "</td></tr>"; print "</td></tr>";
if ($action == 'edit') if ($action == 'edit')
{ {
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>'; print '<tr><td colspan="2" align="center">';
} print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</td></tr>';
}
print "</table>"; print "</table>";
print '</form>'; print '</form>';
} }
print '</div>'; print '</div>';
@@ -163,5 +167,5 @@ if ($action != 'edit')
$db->close(); $db->close();
llxFooter('$Date$ - $Revision$'); llxFooter('$Date: 2011/07/13 16:24:57 $ - $Revision: 1.22 $');
?> ?>