diff --git a/htdocs/langs/en_US/paypal.lang b/htdocs/langs/en_US/paypal.lang
index 5adf942e205..51fc27715bb 100644
--- a/htdocs/langs/en_US/paypal.lang
+++ b/htdocs/langs/en_US/paypal.lang
@@ -11,4 +11,22 @@ PAYPAL_API_PASSWORD=API password
PAYPAL_API_SIGNATURE=API signature
PAYPAL_API_INTEGRAL_OR_PAYPALONLY=Offer payment "integral" (Credit card+Paypal) or "Paypal" only
PAYPAL_CSS_URL=Optionnal Url of CSS style sheet on payment page
-ThisIsTransactionId=This is id of transaction: %s
\ No newline at end of file
+ThisIsTransactionId=This is id of transaction: %s
+PaypalTransactionDesc=This options allows you to import Paypal payments in Dolibarr as orders, invoices, etc ...
+PaypalEnableThisTool=Enable this functionnality
+
+# Paypal transaction fields
+PAYERID=
+PAYERSTATUS=
+ADDRESSSTATUS=
+TRANSACTIONID=
+TRANSACTIONTYPE=
+PAYMENTTYPE=
+AMT=
+FEEAMT=
+TAXAMT=
+PAYMENTSTATUS=
+PENDINGREASON=
+REASONCODE=
+SHIPPINGMETHOD=
+PROTECTIONELIGIBILITY=
diff --git a/htdocs/langs/fr_FR/paypal.lang b/htdocs/langs/fr_FR/paypal.lang
index 894deac480f..e73b7090e10 100644
--- a/htdocs/langs/fr_FR/paypal.lang
+++ b/htdocs/langs/fr_FR/paypal.lang
@@ -11,4 +11,22 @@ PAYPAL_API_PASSWORD=Mot de passe utilisateur API
PAYPAL_API_SIGNATURE=Signature API
PAYPAL_API_INTEGRAL_OR_PAYPALONLY=Proposer le paiement intégral (Carte+Paypal) ou Paypal seul
PAYPAL_CSS_URL=Url optionnelle de la feuille de style CSS de la page de paiement
-ThisIsTransactionId=Voici l'identifiant de la transaction: %s
\ No newline at end of file
+ThisIsTransactionId=Voici l'identifiant de la transaction: %s
+PaypalTransactionDesc=Ces options permettent d'importer des paiements Paypal dans Dolibarr en tant que commandes, factures, etc...
+PaypalEnableThisTool=Activer ces fonctionnalités
+
+# Paypal transaction fields
+PAYERID=
+PAYERSTATUS=
+ADDRESSSTATUS=
+TRANSACTIONID=
+TRANSACTIONTYPE=
+PAYMENTTYPE=
+AMT=
+FEEAMT=
+TAXAMT=
+PAYMENTSTATUS=
+PENDINGREASON=
+REASONCODE=
+SHIPPINGMETHOD=
+PROTECTIONELIGIBILITY=
diff --git a/htdocs/lib/ajax.lib.php b/htdocs/lib/ajax.lib.php
index 37b2e0b032d..451427979be 100644
--- a/htdocs/lib/ajax.lib.php
+++ b/htdocs/lib/ajax.lib.php
@@ -246,8 +246,8 @@ function ajax_constantonoff($code)
});
';
- $out.= '
'.img_picto($langs->trans("Disabled"),'off').'
';
- $out.= ''.img_picto($langs->trans("Enabled"),'on').'
';
+ $out.= ''.img_picto($langs->trans("Disabled"),'switch_off').'';
+ $out.= ''.img_picto($langs->trans("Enabled"),'switch_on').'';
return $out;
}
diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php
index ea5708ee719..b6e76c5ee9a 100644
--- a/htdocs/lib/functions.lib.php
+++ b/htdocs/lib/functions.lib.php
@@ -2478,7 +2478,7 @@ function load_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath
$return.= "\n";
$return.= '';
- if (empty($conf->browser->phone) && $picto && $titre) $return.= '| '.img_picto('',$picto, 'id="pictotitle"', $pictoisfullpath).' | ';
+ if (empty($conf->browser->phone) && $picto) $return.= ''.img_picto('',$picto, 'id="pictotitle"', $pictoisfullpath).' | ';
$return.= '';
$return.= ' '.$titre.' ';
$return.= ' | ';
diff --git a/htdocs/paypal/admin/import.php b/htdocs/paypal/admin/import.php
new file mode 100755
index 00000000000..c7edcba320c
--- /dev/null
+++ b/htdocs/paypal/admin/import.php
@@ -0,0 +1,128 @@
+
+ *
+ * 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.
+ */
+
+/**
+ * \file htdocs/paypal/admin/import.php
+ * \ingroup paypal
+ * \brief Setup page for paypal module
+ * \version $Id$
+ */
+
+require("../../main.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypal.lib.php");
+require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
+
+if (!$user->admin)
+ accessforbidden();
+
+$langs->load("paypal");
+$langs->load("admin");
+
+
+/*
+ * Actions
+ */
+if (preg_match('/set_(.*)/',$action,$reg))
+{
+ $code=$reg[1];
+ if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
+ {
+ Header("Location: ".$_SERVER["PHP_SELF"]);
+ exit;
+ }
+ else
+ {
+ dol_print_error($db);
+ }
+}
+
+if (preg_match('/del_(.*)/',$action,$reg))
+{
+ $code=$reg[1];
+ if (dolibarr_del_const($db, $code, $conf->entity) > 0)
+ {
+ Header("Location: ".$_SERVER["PHP_SELF"]);
+ exit;
+ }
+ else
+ {
+ dol_print_error($db);
+ }
+}
+
+
+/*
+ * View
+ */
+
+
+$form=new Form($db);
+
+llxHeader('',$langs->trans("PaypalSetup"));
+
+
+$linkback=''.$langs->trans("BackToModuleList").'';
+print_fiche_titre(' - '.$langs->trans("ModuleSetup"),$linkback,'paypal_logo@paypal');
+print '
';
+
+$head=paypaladmin_prepare_head();
+
+dol_fiche_head($head, 'import', $langs->trans("ModuleSetup"));
+
+
+print '';
+
+print '| '.$langs->trans("PaypalTransactionDesc").' | ';
+
+print ''."\n";
+if ($conf->use_javascript_ajax)
+{
+ print ajax_constantonoff('PAYPAL_ENABLE_TRANSACTION_MANAGEMENT');
+}
+else
+{
+ if($conf->global->PAYPAL_ENABLE_TRANSACTION_MANAGEMENT == 0)
+ {
+ print ''.img_picto($langs->trans("Disabled"),'off').'';
+ }
+ else if($conf->global->PAYPAL_ENABLE_TRANSACTION_MANAGEMENT == 1)
+ {
+ print ''.img_picto($langs->trans("Enabled"),'on').'';
+ }
+}
+print ' |
';
+print '
';
+
+print '
';
+
+print '';
+
+$var=true;
+print '';
+print '';
+print '| '.$langs->trans("Parameters").' | '."\n";
+print ' | ';
+print ''.$langs->trans("Value").' | '."\n";
+print '
';
+
+print '
';
+
+$db->close();
+
+llxFooter('$Date$ - $Revision$');
+?>
diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php
index 796312809cb..333d7f52eb7 100644
--- a/htdocs/paypal/admin/paypal.php
+++ b/htdocs/paypal/admin/paypal.php
@@ -25,6 +25,7 @@
*/
require("../../main.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypal.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/security.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
@@ -71,11 +72,16 @@ if ($_POST["action"] == 'setvalue' && $user->admin)
$form=new Form($db);
-llxHeader();
+llxHeader('',$langs->trans("PaypalSetup"));
$linkback=''.$langs->trans("BackToModuleList").'';
-print_fiche_titre($langs->trans("PaypalSetup"),$linkback,'setup');
+print_fiche_titre(' - '.$langs->trans("ModuleSetup"),$linkback,'paypal_logo@paypal');
+print '
';
+
+$head=paypaladmin_prepare_head();
+
+dol_fiche_head($head, 'paypalaccount', $langs->trans("ModuleSetup"));
print $langs->trans("PaypalDesc")."
\n";
diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php
index 960ae99f329..8a88359fd46 100755
--- a/htdocs/paypal/lib/paypal.lib.php
+++ b/htdocs/paypal/lib/paypal.lib.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2005-2007 Regis Houssin
+ * Copyright (C) 2011 Regis Houssin
*
* 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
@@ -59,8 +59,6 @@ function llxFooterPaypal()
print "