Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into mko559

This commit is contained in:
Maxime Kohlhaas 2012-10-24 17:18:42 +02:00
commit 21875a5e4a
21 changed files with 472 additions and 321 deletions

View File

@ -12,7 +12,10 @@ a package onto LaunchPad
# To install all packagers tools:
# sudo apt-get install bzr-builder bzr dpatch pbuilder debootstrap devscripts
# Init local working env
#----------------------------------
- Create account on launchpad.org
- Create Project
- Link project to official SCM server
@ -21,32 +24,53 @@ a package onto LaunchPad
- Run from command line:
bzr launchpad-login yourlogin
bzr whoami "Your Name <email@email.com>"
- Create a file /.pbuilderrc with content
bzr whoami
- Create a file ~/.pbuilderrc with content
COMPONENTS="main universe multiverse restricted"
- Create chroot ubuntu env
sudo pbuilder create [--distribution sid|squeeze]
- Edit file ~/.bashrc ti add
- Edit file ~/.bashrc to add
DEBFULLNAME="<Your name>"
DEBEMAIL="<Your email address>"
# Init package tools for launchpad
# Push/declare sources to Launchpad
#----------------------------------
- Create a Bazaar directory
mkdir bzr
- Create debian directory and upload it onto bzr branch ~yourlogin/dolibarr/debian
- Create a series
Call it 'dev' or 'stable'
Add file with *: http://www.dolibarr.org/files/stable/package_debian-ubuntu/dolibarr_3.2.*.tar.gz
??? Configure Series branch - Link to series ???
bzr init
bzr add
bzr commit -m "Init"
bzr push lp:~eldy/dolibarr/stable
# Init package tools for launchpad
#----------------------------------
- Create debian directory and upload it onto bzr branch ~yourlogin/+junk/debian-[dev|stable]
cd bzr
mkdir debian
cd debian
bzr init
cp -pr dolibarr_root/debian bzr/debian
bzr add debian
bzr commit -m "Init"
bzr push lp:~eldy/dolibarr/debian
bzr init
bzr add
bzr commit -m "Init control files"
bzr push lp:~eldy/+junk/debian-[dev|stable] (put here any branch name)
or download it from launchpad bazaar:
cd bzr
bzr branch lp:~eldy/dolibarr/debian
bzr branch lp:~eldy/+junk/debian-[dev|stable]
- To update this debian directory, edit files into the bzr dir and run
bzr status
bzr commit -m "Description of change"
bzr push lp:~eldy/dolibarr/debian
bzr push lp:~eldy/+junk/debian-[dev|stable]
# Define a recipe into launchpad (a rule to build packages into a PPA)
#----------------------------------
- Create a file dolibarr.recipe with content
cd bzr
vi dolibarr.recipe
@ -61,7 +85,9 @@ DEBEMAIL="<Your email address>"
sudo pbuilder build <working-dir>/<project>_<version>.dsc
# To get/download package:
# To get/download package from PPA:
#----------------------------------
Add signing key of the Launchpad repository:
> gpg --keyserver keyserver.ubuntu.com --recv-key A38BF8FD
> sudo apt-key add ~/.gnupg/pubring.gpg

19
build/obs/README Normal file
View File

@ -0,0 +1,19 @@
README (English)
##################################################
OBS Package tools
##################################################
This directory contains files to explain how to publish
a package onto OBS
# Create a project onto OBS
#----------------------------------
https://build.opensuse.org
Add attributes:
OBS:Screenshots URL of screenshot
OBS:QualityCategory Development|Testing|Stable|Private
OBS:Maintained 1

View File

@ -11,7 +11,8 @@ with format RPM (for Redhat, OpenSuse, Mandriva, ...).
# This is standard command to work on RPM packaging:
#
# To install all packagers tools:
# yum -y install rpmlint fedora-packager mock koji hunspell-en hunspell-es hunspell-fr hunspell-it
# Fedora: yum -y install rpmlint fedora-packager mock koji hunspell-en hunspell-es hunspell-fr hunspell-it
# OpenSuse: yast --install update-desktop-files
#
# rpmlint file.rpm Test a package
# mock -r fedora-15-i386 --rebuild ../SRPMS/hello-2.7-1.fc15.src.rpm

View File

@ -108,12 +108,14 @@ cui hai bisogno ed essere facile da usare.
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts
# Lang
echo "%defattr(0644, root, root, 0644)" > %{name}.lang
echo "%defattr(0644, root, root, 0755)" > %{name}.lang
echo "%dir %{_datadir}/%{name}/htdocs/langs" >> %{name}.lang
for i in $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/langs/*_*
do
lang=$(basename $i)
lang1=`expr substr $lang 1 2`;
lang2=`expr substr $lang 4 2 | tr "[:upper:]" "[:lower:]"`;
echo "%dir %{_datadir}/%{name}/htdocs/langs/${lang}" >> %{name}.lang
if [ "$lang1" = "$lang2" ] ; then
echo "%lang(${lang1}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang"
else
@ -132,6 +134,9 @@ done >>%{name}.lang
%files -f %{name}.lang
%defattr(0755, root, root, 0755)
%dir %_datadir/dolibarr
%dir %_datadir/dolibarr/scripts
%_datadir/dolibarr/scripts/*
@ -141,6 +146,8 @@ done >>%{name}.lang
%_datadir/pixmaps/dolibarr.png
%_datadir/applications/dolibarr.desktop
%dir %_datadir/dolibarr/build
%dir %_datadir/dolibarr/build/rpm
%_datadir/dolibarr/build/rpm/*
@ -195,6 +202,8 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/*.php
%_datadir/dolibarr/htdocs/*.txt
%dir %{_sysconfdir}/dolibarr
%defattr(0664, root, apache)
%config(noreplace) %{_sysconfdir}/dolibarr/conf.php
%config(noreplace) %{_sysconfdir}/dolibarr/apache.conf
@ -206,6 +215,8 @@ done >>%{name}.lang
#---- post (after unzip during install)
%post
echo Run post script of packager dolibarr_fedora.spec
# Define vars
export docdir="/var/lib/dolibarr/documents"
export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf"
@ -252,8 +263,13 @@ restorecon -R -v /var/lib/dolibarr
# Create a config link dolibarr.conf
if [ ! -L $apachelink ]; then
echo Create dolibarr web server config link $apachelink
ln -fs %{_sysconfdir}/dolibarr/apache.conf $apachelink
apachelinkdir=`dirname $apachelink`
if [ -d $apachelinkdir ]; then
echo Create dolibarr web server config link from %{_sysconfdir}/dolibarr/apache.conf to $apachelink
ln -fs %{_sysconfdir}/dolibarr/apache.conf $apachelink
else
echo Do not create link $apachelink - web server conf dir $apachelinkdir not found. web server package may not be installed
fi
fi
echo Set permission to $apacheuser:$apachegroup on /var/lib/dolibarr

View File

@ -54,7 +54,7 @@ Requires: mysql, mysql-client
%if 0%{?suse_version}
# Voir http://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros
Group: Productivity/Office/Management
Requires: apache2, apache2-mod_php5, php5 >= 5.3.0, php5-gd, php5-ldap, php5-imap, php5-mysql, php5-openssl, fonts-ttf-dejavu
Requires: apache2, apache2-mod_php5, php5 >= 5.3.0, php5-gd, php5-ldap, php5-imap, php5-mysql, php5-openssl, dejavu
Requires: mysql-community-server, mysql-community-server-client
BuildRequires: update-desktop-files fdupes
%else
@ -85,7 +85,7 @@ de Recursos Empresariales (ERP) y Gestión de la Relación con los
Clientes (CRM) así como para para otras diferentes actividades.
Dolibarr ha sido diseñado para suministrarle solamente las funcionalidades
que necesita y haciendo hincapié en su facilidad de uso.
%description -l fr
Logiciel ERP & CRM de gestion de PME/PMI, autoentrepreneurs,
artisans ou associations. Il permet de gérer vos clients, prospect,
@ -117,7 +117,11 @@ cui hai bisogno ed essere facile da usare.
#---- install
%install
%if 0%{?sles_version}
%else
%{__rm} -rf $RPM_BUILD_ROOT
%endif
%{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
%{__install} -m 644 build/rpm/conf.php $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.php
@ -168,7 +172,7 @@ cui hai bisogno ed essere facile da usare.
%endif
# Lang
echo "%defattr(0644, root, root, 0644)" > %{name}.lang
echo "%defattr(0644, root, root, 0755)" > %{name}.lang
echo "%dir %{_datadir}/%{name}/htdocs/langs" >> %{name}.lang
for i in $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/langs/*_*
do
@ -183,10 +187,9 @@ do
fi
done >>%{name}.lang
%if 0%{?suse_version}
%if 0%{?suse_version} || 0%{?sles_version}
# Enable this command to tag desktop file for suse
%suse_update_desktop_file dolibarr
%suse_update_desktop_file dolibarr Office Finance
# Enable this command to allow suse detection of duplicate files and create hardlinks instead
%fdupes $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs
%endif
@ -291,6 +294,8 @@ done >>%{name}.lang
#---- post (after unzip during install)
%post
echo Run post script of packager dolibarr_generic.spec
# Define vars
export docdir="/var/lib/dolibarr/documents"
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion}

View File

@ -105,12 +105,14 @@ cui hai bisogno ed essere facile da usare.
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts
# Lang
echo "%defattr(0644, root, root, 0644)" > %{name}.lang
echo "%defattr(0644, root, root, 0755)" > %{name}.lang
echo "%dir %{_datadir}/%{name}/htdocs/langs" >> %{name}.lang
for i in $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/langs/*_*
do
lang=$(basename $i)
lang1=`expr substr $lang 1 2`;
lang2=`expr substr $lang 4 2 | tr "[:upper:]" "[:lower:]"`;
echo "%dir %{_datadir}/%{name}/htdocs/langs/${lang}" >> %{name}.lang
if [ "$lang1" = "$lang2" ] ; then
echo "%lang(${lang1}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang"
else
@ -129,6 +131,9 @@ done >>%{name}.lang
%files -f %{name}.lang
%defattr(0755, root, root, 0755)
%dir %_datadir/dolibarr
%dir %_datadir/dolibarr/scripts
%_datadir/dolibarr/scripts/*
@ -138,6 +143,8 @@ done >>%{name}.lang
%_datadir/pixmaps/dolibarr.png
%_datadir/applications/dolibarr.desktop
%dir %_datadir/dolibarr/build
%dir %_datadir/dolibarr/build/rpm
%_datadir/dolibarr/build/rpm/*
@ -192,6 +199,8 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/*.php
%_datadir/dolibarr/htdocs/*.txt
%dir %{_sysconfdir}/dolibarr
%defattr(0664, root, apache)
%config(noreplace) %{_sysconfdir}/dolibarr/conf.php
%config(noreplace) %{_sysconfdir}/dolibarr/apache.conf
@ -203,6 +212,8 @@ done >>%{name}.lang
#---- post (after unzip during install)
%post
echo Run post script of packager dolibarr_mandriva.spec
# Define vars
export docdir="/var/lib/dolibarr/documents"
export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf"
@ -241,8 +252,13 @@ fi
# Create a config link dolibarr.conf
if [ ! -L $apachelink ]; then
echo Create dolibarr web server config link $apachelink
ln -fs %{_sysconfdir}/dolibarr/apache.conf $apachelink
apachelinkdir=`dirname $apachelink`
if [ -d $apachelinkdir ]; then
echo Create dolibarr web server config link from %{_sysconfdir}/dolibarr/apache.conf to $apachelink
ln -fs %{_sysconfdir}/dolibarr/apache.conf $apachelink
else
echo Do not create link $apachelink - web server conf dir $apachelinkdir not found. web server package may not be installed
fi
fi
echo Set permission to $apacheuser:$apachegroup on /var/lib/dolibarr

View File

@ -25,9 +25,9 @@ BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Group: Productivity/Office/Management
Requires: apache2, apache2-mod_php5, php5 >= 5.3.0, php5-gd, php5-ldap, php5-imap, php5-mysql, php5-openssl, fonts-ttf-dejavu
Requires: apache2, apache2-mod_php5, php5 >= 5.3.0, php5-gd, php5-ldap, php5-imap, php5-mysql, php5-openssl, dejavu
Requires: mysql-community-server, mysql-community-server-client
#BuildRequires: update-desktop-files fdupes
BuildRequires: update-desktop-files fdupes
# Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse)
AutoReqProv: no
@ -104,12 +104,14 @@ cui hai bisogno ed essere facile da usare.
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts
# Lang
echo "%defattr(0644, root, root, 0644)" > %{name}.lang
echo "%defattr(0644, root, root, 0755)" > %{name}.lang
echo "%dir %{_datadir}/%{name}/htdocs/langs" >> %{name}.lang
for i in $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/langs/*_*
do
lang=$(basename $i)
lang1=`expr substr $lang 1 2`;
lang2=`expr substr $lang 4 2 | tr "[:upper:]" "[:lower:]"`;
echo "%dir %{_datadir}/%{name}/htdocs/langs/${lang}" >> %{name}.lang
if [ "$lang1" = "$lang2" ] ; then
echo "%lang(${lang1}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang"
else
@ -117,11 +119,12 @@ do
fi
done >>%{name}.lang
# Enable this command to tag desktop file for suse
#%suse_update_desktop_file dolibarr
%suse_update_desktop_file dolibarr
# Enable this command to allow suse detection of duplicate files and create hardlinks instead
#%fdupes $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs
%fdupes $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs
#---- clean
@ -134,6 +137,9 @@ done >>%{name}.lang
%files -f %{name}.lang
%defattr(0755, root, root, 0755)
%dir %_datadir/dolibarr
%dir %_datadir/dolibarr/scripts
%_datadir/dolibarr/scripts/*
@ -143,6 +149,8 @@ done >>%{name}.lang
%_datadir/pixmaps/dolibarr.png
%_datadir/applications/dolibarr.desktop
%dir %_datadir/dolibarr/build
%dir %_datadir/dolibarr/build/rpm
%_datadir/dolibarr/build/rpm/*
@ -197,6 +205,8 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/*.php
%_datadir/dolibarr/htdocs/*.txt
%dir %{_sysconfdir}/dolibarr
%defattr(0664, root, www)
%config(noreplace) %{_sysconfdir}/dolibarr/conf.php
%config(noreplace) %{_sysconfdir}/dolibarr/apache.conf
@ -208,6 +218,8 @@ done >>%{name}.lang
#---- post (after unzip during install)
%post
echo Run post script of packager dolibarr_opensuse.spec
# Define vars
export docdir="/var/lib/dolibarr/documents"
export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf"
@ -246,8 +258,13 @@ fi
# Create a config link dolibarr.conf
if [ ! -L $apachelink ]; then
echo Create dolibarr web server config link $apachelink
ln -fs %{_sysconfdir}/dolibarr/apache.conf $apachelink
apachelinkdir=`dirname $apachelink`
if [ -d $apachelinkdir ]; then
echo Create dolibarr web server config link from %{_sysconfdir}/dolibarr/apache.conf to $apachelink
ln -fs %{_sysconfdir}/dolibarr/apache.conf $apachelink
else
echo Do not create link $apachelink - web server conf dir $apachelinkdir not found. web server package may not be installed
fi
fi
echo Set permission to $apacheuser:$apachegroup on /var/lib/dolibarr

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
*
* 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
@ -51,12 +52,12 @@ if ($actionsave)
if ($i >= 3)
{
$db->commit();
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$db->rollback();
$mesg = "<font class=\"error\">".$langs->trans("SaveFailed")."</font>";
setEventMessage($langs->trans("SaveFailed"), 'errors');
}
}
@ -95,7 +96,10 @@ print "</tr>";
print "<tr class=\"impair\">";
print '<td class="fieldrequired">'.$langs->trans("PasswordTogetVCalExport")."</td>";
print "<td><input required=\"required\" type=\"text\" class=\"flat\" name=\"MAIN_AGENDA_XCAL_EXPORTKEY\" value=\"". (GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY','alpha')?GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY','alpha'):$conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) . "\" size=\"40\"></td>";
print '<td><input required="required" type="text" class="flat" id="MAIN_AGENDA_XCAL_EXPORTKEY" name="MAIN_AGENDA_XCAL_EXPORTKEY" value="' . (GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY','alpha')?GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY','alpha'):$conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) . '" size="40">';
if (! empty($conf->use_javascript_ajax))
print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
print '</td>';
print "<td>&nbsp;</td>";
print "</tr>";
@ -147,9 +151,24 @@ $message.=$langs->trans("AgendaUrlOptions4",$user->login,$user->login).'<br>';
$message.=$langs->trans("AgendaUrlOptions5",$user->login,$user->login);
print info_admin($message);
dol_htmloutput_mesg($mesg);
if (! empty($conf->use_javascript_ajax))
{
print "\n".'<script type="text/javascript">';
print '$(document).ready(function () {
$("#generate_token").click(function() {
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
action: \'getrandompassword\',
generic: true
},
function(token) {
$("#MAIN_AGENDA_XCAL_EXPORTKEY").val(token);
});
});
});';
print '</script>';
}
$db->close();
llxFooter();
$db->close();
?>

View File

@ -118,7 +118,7 @@ if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_nom) $sql.= " AND s.nom LIKE '%".$db->escape($search_nom)."%'";
if ($search_zipcode) $sql.= " AND s.cp LIKE '%".$db->escape($search_zipcode)."%'";
if ($search_zipcode) $sql.= " AND s.cp LIKE '".$db->escape($search_zipcode)."%'";
if ($search_ville) $sql.= " AND s.ville LIKE '%".$db->escape($search_ville)."%'";
if ($search_code) $sql.= " AND s.code_client LIKE '%".$db->escape($search_code)."%'";
if ($search_compta) $sql.= " AND s.code_compta LIKE '%".$db->escape($search_compta)."%'";
@ -144,7 +144,7 @@ if ($result)
{
$num = $db->num_rows($result);
$param = "&amp;search_nom=".$search_nom."&amp;search_code=".$search_code."&amp;search_ville=".$search_ville;
$param = "&amp;search_nom=".$search_nom."&amp;search_code=".$search_code."&amp;search_zipcode=".$search_zipcode."&amp;search_ville=".$search_ville;
if ($search_categ != '') $param.='&amp;search_categ='.$search_categ;
if ($search_sale != '') $param.='&amp;search_sale='.$search_sale;

View File

@ -195,7 +195,7 @@ if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_nom) $sql .= " AND s.nom LIKE '%".$db->escape(strtolower($search_nom))."%'";
if ($search_zipcode) $sql .= " AND s.cp LIKE '%".$db->escape(strtolower($search_zipcode))."%'";
if ($search_zipcode) $sql .= " AND s.cp LIKE '".$db->escape(strtolower($search_zipcode))."%'";
if ($search_ville) $sql .= " AND s.ville LIKE '%".$db->escape(strtolower($search_ville))."%'";
if ($search_departement) $sql .= " AND d.nom LIKE '%".$db->escape(strtolower($search_departement))."%'";
if ($search_datec) $sql .= " AND s.datec LIKE '%".$db->escape($search_datec)."%'";
@ -244,7 +244,7 @@ if ($resql)
llxHeader('',$langs->trans("ThirdParty"),$help_url);
}
$param='&amp;stcomm='.$stcomm.'&amp;search_nom='.urlencode($search_nom).'&amp;search_ville='.urlencode($search_ville);
$param='&amp;stcomm='.$stcomm.'&amp;search_nom='.urlencode($search_nom).'&amp;search_zipcode='.urlencode($search_code).'&amp;search_ville='.urlencode($search_ville);
// Added by Matelli
// Store the status filter in the URL
if (isSet($search_cstc))

View File

@ -292,8 +292,8 @@ class Form
{
$tmp=explode(':',$inputType);
$inputType=$tmp[0];
if (! empty($tmp[1])) $rows=$tmp[1];
if (! empty($tmp[2])) $cols=$tmp[2];
$rows=(empty($tmp[1])?'8':$tmp[1]);
$cols=(empty($tmp[2])?'80':$tmp[2]);
}
else if (preg_match('/^ckeditor/',$inputType))
{
@ -320,6 +320,10 @@ class Form
if (! empty($savemethod)) $out.= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n";
if (! empty($ext_element)) $out.= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n";
if (! empty($success)) $out.= '<input id="success_'.$htmlname.'" value="'.$success.'" type="hidden"/>'."\n";
if ($inputType == 'textarea') {
$out.= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n";
$out.= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n";
}
$out.= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n";
$out.= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(! empty($editvalue) ? $editvalue : $value).'</span>'."\n";
@ -1480,7 +1484,7 @@ class Form
$outval.=$objRef.' ('.$objRefFourn.') - ';
$opt.=dol_trunc($objp->label,18).' - ';
$outval.=dol_trunc($label,18).' - ';
if (! empty($objp->idprodfournprice))
{
$currencytext=$langs->trans("Currency".$conf->currency);
@ -1505,7 +1509,7 @@ class Form
$opt.= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
$outval.=$langs->transnoentities("Units");
}
if ($objp->quantity >= 1)
{
$opt.=" (".price($objp->unitprice).' '.$currencytext."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
@ -1533,8 +1537,8 @@ class Form
$outval.=$langs->transnoentities("NoPriceDefinedForThisSupplier");
}
$opt .= "</option>\n";
// Add new entry
// "key" value of json key array is used by jQuery automatically as selected value
// "label" value of json key array is used by jQuery automatically as text for combo box
@ -1548,7 +1552,7 @@ class Form
//var_dump($outval); var_dump(utf8_check($outval)); var_dump(json_encode($outval));
//$outval=array('label'=>'ppp (<strong>f</strong>ff2) - ppp - 20,00 Euros/ Unité (20,00 Euros/unité)');
//var_dump($outval); var_dump(utf8_check($outval)); var_dump(json_encode($outval));
$i++;
}
$outselect.='</select>';

View File

@ -909,7 +909,9 @@ class Ldap
if (is_array($attributeArray))
{
// Return list with required fields
$attributeArray=array_values($attributeArray); // This is to force to have index reordered from 0 (not make ldap_search fails)
dol_syslog("Ldap::getRecords connection=".$this->connection." userDn=".$userDn." filter=".$filter. " attributeArray=(".join(',',$attributeArray).")");
//var_dump($attributeArray);
$this->result = @ldap_search($this->connection, $userDn, $filter, $attributeArray);
}
else

View File

@ -1020,23 +1020,35 @@ class DoliDBPgsql
*
* @param string $table Name of table
* @return array Tableau des informations des champs de la table
* TODO modify for postgresql
*
*/
function DDLInfoTable($table)
{
/*
$infotables=array();
$sql="SHOW FULL COLUMNS FROM ".$table.";";
$sql="SELECT ";
$sql.=" infcol.column_name as \"Column\",";
$sql.=" CASE WHEN infcol.character_maximum_length IS NOT NULL THEN infcol.udt_name || '('||infcol.character_maximum_length||')'";
$sql.=" ELSE infcol.udt_name";
$sql.=" END as \"Type\",";
$sql.=" infcol.collation_name as \"Collation\",";
$sql.=" infcol.is_nullable as \"Null\",";
$sql.=" '' as \"Key\",";
$sql.=" infcol.column_default as \"Default\",";
$sql.=" '' as \"Extra\",";
$sql.=" '' as \"Privileges\"";
$sql.=" FROM information_schema.columns infcol";
$sql.=" WHERE table_schema='public' ";
$sql.=" AND table_name='".$table."'";
$sql.=" ORDER BY ordinal_position;";
dol_syslog($sql,LOG_DEBUG);
$result = $this->pg_query($this->db,$sql);
$result = $this->query($sql);
while($row = $this->fetch_row($result))
{
$infotables[] = $row;
}
return $infotables;
*/
}
return $infotables;
}

View File

@ -26,48 +26,51 @@ $(document).ready(function() {
var table_element = $('#jeditable_table_element').html();
var fk_element = $('#jeditable_fk_element').html();
$('.editval_textarea').editable(urlSaveInPlace, {
type : 'textarea',
rows : 4,
id : 'field',
tooltip : tooltipInPlace,
placeholder : '&nbsp;',
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
loadurl : urlLoadInPlace,
loaddata : function(result, settings) {
return getParameters(this, 'textarea');
},
submitdata : function(result, settings) {
return getParameters(this, 'textarea');
},
callback : function(result, settings) {
getResult(this, result);
},
onreset : function(result, settings) {
getDefault(settings);
}
});
$('.editkey_textarea').hover(
function () {
$('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
if ($('.editval_textarea').length > 0) {
$('.editval_textarea').editable(urlSaveInPlace, {
type : 'textarea',
rows : $('#textarea_' + $('.editval_textarea').attr('id').substr(8) + '_rows').val(),
cols : $('#textarea_' + $('.editval_textarea').attr('id').substr(8) + '_cols').val(),
id : 'field',
tooltip : tooltipInPlace,
placeholder : '&nbsp;',
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
loadurl : urlLoadInPlace,
loaddata : function(result, settings) {
return getParameters(this, 'textarea');
},
function () {
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
submitdata : function(result, settings) {
return getParameters(this, 'textarea');
},
callback : function(result, settings) {
getResult(this, result);
},
onreset : function(result, settings) {
getDefault(settings);
}
);
$('.editkey_textarea').click(function() {
$('#viewval_' + $(this).attr('id')).click();
});
$('.viewval_textarea.active').click(function() {
$('#viewval_' + $(this).attr('id').substr(8)).hide();
$('#editval_' + $(this).attr('id').substr(8)).show().click();
});
$('.editkey_textarea').click(function() {
$('#viewval_' + $(this).attr('id')).hide();
$('#editval_' + $(this).attr('id')).show().click();
});
});
$('.editkey_textarea').hover(
function () {
$('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
},
function () {
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
}
);
$('.editkey_textarea').click(function() {
$('#viewval_' + $(this).attr('id')).click();
});
$('.viewval_textarea.active').click(function() {
$('#viewval_' + $(this).attr('id').substr(8)).hide();
$('#editval_' + $(this).attr('id').substr(8)).show().click();
});
$('.editkey_textarea').click(function() {
$('#viewval_' + $(this).attr('id')).hide();
$('#editval_' + $(this).attr('id')).show().click();
});
}
if (typeof ckeditorConfig != 'undefined') {
$('.editval_ckeditor').editable(urlSaveInPlace, {
@ -120,204 +123,214 @@ $(document).ready(function() {
});
}
$('.editval_string').editable(urlSaveInPlace, {
type : 'text',
id : 'field',
width : 300,
tooltip : tooltipInPlace,
placeholder : placeholderInPlace,
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
submitdata : function(result, settings) {
return getParameters(this, 'string');
},
callback : function(result, settings) {
getResult(this, result);
},
onreset : function(result, settings) {
getDefault(settings);
}
});
$('.editkey_string').hover(
function () {
$('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
if ($('.editval_string').length > 0) {
$('.editval_string').editable(urlSaveInPlace, {
type : 'text',
id : 'field',
width : 300,
tooltip : tooltipInPlace,
placeholder : placeholderInPlace,
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
submitdata : function(result, settings) {
return getParameters(this, 'string');
},
function () {
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
callback : function(result, settings) {
getResult(this, result);
},
onreset : function(result, settings) {
getDefault(settings);
}
);
$('.editkey_string').click(function() {
$( '#viewval_' + $(this).attr('id') ).click();
});
$('.viewval_string.active').click(function() {
$('#viewval_' + $(this).attr('id').substr(8)).hide();
$('#editval_' + $(this).attr('id').substr(8)).show().click();
});
$('.editkey_string').click(function() {
$('#viewval_' + $(this).attr('id')).hide();
$('#editval_' + $(this).attr('id')).show().click();
});
});
$('.editkey_string').hover(
function () {
$('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
},
function () {
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
}
);
$('.editkey_string').click(function() {
$( '#viewval_' + $(this).attr('id') ).click();
});
$('.viewval_string.active').click(function() {
$('#viewval_' + $(this).attr('id').substr(8)).hide();
$('#editval_' + $(this).attr('id').substr(8)).show().click();
});
$('.editkey_string').click(function() {
$('#viewval_' + $(this).attr('id')).hide();
$('#editval_' + $(this).attr('id')).show().click();
});
}
$('.editval_numeric').editable(urlSaveInPlace, {
type : 'text',
id : 'field',
width : 100,
tooltip : tooltipInPlace,
placeholder : placeholderInPlace,
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
submitdata : function(result, settings) {
return getParameters(this, 'numeric');
},
callback : function(result, settings) {
getResult(this, result);
},
onreset : function(result, settings) {
getDefault(settings);
}
});
$('.editkey_numeric').hover(
function () {
$( '#viewval_' + $(this).attr('id') ).addClass("viewval_hover");
if ($('.editval_numeric').length > 0) {
$('.editval_numeric').editable(urlSaveInPlace, {
type : 'text',
id : 'field',
width : 100,
tooltip : tooltipInPlace,
placeholder : placeholderInPlace,
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
submitdata : function(result, settings) {
return getParameters(this, 'numeric');
},
function () {
$( '#viewval_' + $(this).attr('id') ).removeClass("viewval_hover");
callback : function(result, settings) {
getResult(this, result);
},
onreset : function(result, settings) {
getDefault(settings);
}
);
$('.editkey_numeric').click(function() {
$( '#viewval_' + $(this).attr('id') ).click();
});
$('.viewval_numeric.active').click(function() {
$('#viewval_' + $(this).attr('id').substr(8)).hide();
$('#editval_' + $(this).attr('id').substr(8)).show().click();
});
$('.editkey_numeric').click(function() {
$('#viewval_' + $(this).attr('id')).hide();
$('#editval_' + $(this).attr('id')).show().click();
});
});
$('.editkey_numeric').hover(
function () {
$( '#viewval_' + $(this).attr('id') ).addClass("viewval_hover");
},
function () {
$( '#viewval_' + $(this).attr('id') ).removeClass("viewval_hover");
}
);
$('.editkey_numeric').click(function() {
$( '#viewval_' + $(this).attr('id') ).click();
});
$('.viewval_numeric.active').click(function() {
$('#viewval_' + $(this).attr('id').substr(8)).hide();
$('#editval_' + $(this).attr('id').substr(8)).show().click();
});
$('.editkey_numeric').click(function() {
$('#viewval_' + $(this).attr('id')).hide();
$('#editval_' + $(this).attr('id')).show().click();
});
}
$('.editval_datepicker').editable(urlSaveInPlace, {
type : 'datepicker',
id : 'field',
onblur : 'ignore',
tooltip : tooltipInPlace,
placeholder : '&nbsp;',
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
submitdata : function(result, settings) {
return getParameters(this, 'datepicker');
},
callback : function(result, settings) {
getResult(this, result);
},
onreset : function(result, settings) {
getDefault(settings);
}
});
$('.editkey_datepicker').hover(
function () {
$('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
if ($('.editval_datepicker').length > 0) {
$('.editval_datepicker').editable(urlSaveInPlace, {
type : 'datepicker',
id : 'field',
onblur : 'ignore',
tooltip : tooltipInPlace,
placeholder : '&nbsp;',
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
submitdata : function(result, settings) {
return getParameters(this, 'datepicker');
},
function () {
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
callback : function(result, settings) {
getResult(this, result);
},
onreset : function(result, settings) {
getDefault(settings);
}
);
$('.viewval_datepicker.active').click(function() {
$('#viewval_' + $(this).attr('id').substr(8)).hide();
$('#editval_' + $(this).attr('id').substr(8)).show().click();
});
$('.editkey_datepicker').click(function() {
$('#viewval_' + $(this).attr('id')).hide();
$('#editval_' + $(this).attr('id')).show().click();
});
});
$('.editkey_datepicker').hover(
function () {
$('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
},
function () {
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
}
);
$('.viewval_datepicker.active').click(function() {
$('#viewval_' + $(this).attr('id').substr(8)).hide();
$('#editval_' + $(this).attr('id').substr(8)).show().click();
});
$('.editkey_datepicker').click(function() {
$('#viewval_' + $(this).attr('id')).hide();
$('#editval_' + $(this).attr('id')).show().click();
});
}
$('.editval_select').editable(urlSaveInPlace, {
type : 'select',
id : 'field',
onblur : 'ignore',
cssclass : 'flat',
tooltip : tooltipInPlace,
placeholder : '&nbsp;',
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
loadurl : urlLoadInPlace,
loaddata : function(result, settings) {
return getParameters(this, 'select');
},
submitdata : function(result, settings) {
return getParameters(this, 'select');
},
callback : function(result, settings) {
getResult(this, result);
},
onreset : function(result, settings) {
getDefault(settings);
}
});
$('.editkey_select').hover(
function () {
$('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
if ($('.editval_select').length > 0) {
$('.editval_select').editable(urlSaveInPlace, {
type : 'select',
id : 'field',
onblur : 'ignore',
cssclass : 'flat',
tooltip : tooltipInPlace,
placeholder : '&nbsp;',
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
loadurl : urlLoadInPlace,
loaddata : function(result, settings) {
return getParameters(this, 'select');
},
function () {
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
submitdata : function(result, settings) {
return getParameters(this, 'select');
},
callback : function(result, settings) {
getResult(this, result);
},
onreset : function(result, settings) {
getDefault(settings);
}
);
$('.viewval_select.active').click(function() {
$('#viewval_' + $(this).attr('id').substr(8)).hide();
$('#editval_' + $(this).attr('id').substr(8)).show().click();
});
$('.editkey_select').click(function() {
$('#viewval_' + $(this).attr('id')).hide();
$('#editval_' + $(this).attr('id')).show().click();
});
});
$('.editkey_select').hover(
function () {
$('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
},
function () {
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
}
);
$('.viewval_select.active').click(function() {
$('#viewval_' + $(this).attr('id').substr(8)).hide();
$('#editval_' + $(this).attr('id').substr(8)).show().click();
});
$('.editkey_select').click(function() {
$('#viewval_' + $(this).attr('id')).hide();
$('#editval_' + $(this).attr('id')).show().click();
});
}
// for test only (not stable)
$('.editval_autocomplete').editable(urlSaveInPlace, {
type : 'autocomplete',
id : 'field',
width : 300,
onblur : 'ignore',
tooltip : tooltipInPlace,
placeholder : '&nbsp;',
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
autocomplete : {
source : urlLoadInPlace,
data : function(result, settings) {
return getParameters(this, 'select');
}
},
submitdata : function(result, settings) {
return getParameters(this, 'select');
},
callback : function(result, settings) {
getResult(this, result);
},
onreset : function(result, settings) {
getDefault(settings);
}
});
$('.editkey_autocomplete').hover(
function () {
$('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
if ($('.editval_autocomplete').length > 0) {
$('.editval_autocomplete').editable(urlSaveInPlace, {
type : 'autocomplete',
id : 'field',
width : 300,
onblur : 'ignore',
tooltip : tooltipInPlace,
placeholder : '&nbsp;',
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
autocomplete : {
source : urlLoadInPlace,
data : function(result, settings) {
return getParameters(this, 'select');
}
},
function () {
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
submitdata : function(result, settings) {
return getParameters(this, 'select');
},
callback : function(result, settings) {
getResult(this, result);
},
onreset : function(result, settings) {
getDefault(settings);
}
);
$('.viewval_autocomplete.active').click(function() {
$('#viewval_' + $(this).attr('id').substr(8)).hide();
$('#editval_' + $(this).attr('id').substr(8)).show().click();
});
$('.editkey_autocomplete').click(function() {
$('#viewval_' + $(this).attr('id')).hide();
$('#editval_' + $(this).attr('id')).show().click();
});
});
$('.editkey_autocomplete').hover(
function () {
$('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
},
function () {
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
}
);
$('.viewval_autocomplete.active').click(function() {
$('#viewval_' + $(this).attr('id').substr(8)).hide();
$('#editval_' + $(this).attr('id').substr(8)).show().click();
});
$('.editkey_autocomplete').click(function() {
$('#viewval_' + $(this).attr('id')).hide();
$('#editval_' + $(this).attr('id')).show().click();
});
}
function getParameters(obj, type) {
var htmlname = $(obj).attr('id').substr(8);

View File

@ -447,22 +447,22 @@ function dol_escape_htmltag($stringtoescape,$keepb=0)
}
/**
/**
* Convert a string to lower. Never use strtolower because it does not works with UTF8 strings.
*
*
* @param string $utf8_string String to encode
* @return string String converted
* @return string String converted
*/
function dol_strtolower($utf8_string)
{
return mb_strtolower($utf8_string, "UTF-8");
}
/**
/**
* Convert a string to upper. Never use strtolower because it does not works with UTF8 strings.
*
*
* @param string $utf8_string String to encode
* @return string String converted
* @return string String converted
*/
function dol_strtoupper($utf8_string)
{

View File

@ -51,7 +51,7 @@
{
echo $form->select_type_of_lines($line->product_type, 'type', 1, 1);
}
?>
?>
<input id="product_label" name="product_label" size="40" value="<?php echo $label; ?>"<?php echo $placeholder . ((! empty($line->fk_product) && empty($line->label)) ? ' disabled="disabled"' : ''); ?>>
<input type="hidden" id="origin_label_cache" name="origin_label_cache" value="<?php echo $line->product_label; ?>" />
@ -87,8 +87,6 @@
$reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action);
}
echo '<br>';
// editeur wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$nbrows=ROWS_2;

View File

@ -912,7 +912,7 @@ else if ($id > 0 || ! empty($ref))
print '<tr><td valign="top">';
print $form->editfieldkey("Description",'description',$object->description,$object,$user->rights->ficheinter->creer,'textarea');
print '</td><td colspan="3">';
print $form->editfieldval("Description",'description',$object->description,$object,$user->rights->ficheinter->creer,'textarea');
print $form->editfieldval("Description",'description',$object->description,$object,$user->rights->ficheinter->creer,'textarea:8:80');
print '</td>';
print '</tr>';

View File

@ -189,7 +189,7 @@ class ProductFournisseur extends Product
$sql.= " tva_tx = ".$tva_tx.",";
$sql.= " fk_availability = ".$availability.",";
$sql.= " entity = ".$conf->entity.",";
$sql.= " charges = ".($charges != ''?price2num($charges):"null");
$sql.= " charges = ".$charges;
$sql.= " WHERE rowid = ".$this->product_fourn_price_id;
// TODO Add price_base_type and price_ttc
@ -219,18 +219,20 @@ class ProductFournisseur extends Product
{
// Add price for this quantity to supplier
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_fournisseur_price(";
$sql.= "datec, fk_product, fk_soc, ref_fourn, fk_user, price, quantity, remise_percent, remise, unitprice, tva_tx, fk_availability, entity)";
$sql.= "datec, fk_product, fk_soc, ref_fourn, fk_user, price, quantity, remise_percent, remise, unitprice, tva_tx, charges, unitcharges, fk_availability, entity)";
$sql.= " values('".$this->db->idate($now)."',";
$sql.= " ".$this->id.",";
$sql.= " ".$fourn->id.",";
$sql.= " '".$this->db->escape($ref_fourn)."',";
$sql.= " ".$user->id.",";
$sql.= " ".price2num($buyprice).",";
$sql.= " ".$buyprice.",";
$sql.= " ".$qty.",";
$sql.= " ".$remise_percent.",";
$sql.= " ".$remise.",";
$sql.= " ".$unitBuyPrice.",";
$sql.= " ".$tva_tx.",";
$sql.= " ".$charges.",";
$sql.= " ".$unitCharges.",";
$sql.= " ".$availability.",";
$sql.= $conf->entity;
$sql.=")";

View File

@ -97,7 +97,7 @@ if ($socname)
$sortorder = "ASC";
}
if ($search_nom) $sql .= " AND s.nom LIKE '%".$db->escape($search_nom)."%'";
if ($search_zipcode) $sql .= " AND s.cp LIKE '%".$db->escape($search_zipcode)."%'";
if ($search_zipcode) $sql .= " AND s.cp LIKE '".$db->escape($search_zipcode)."%'";
if ($search_ville) $sql .= " AND s.ville LIKE '%".$db->escape($search_ville)."%'";
if ($search_code_fournisseur) $sql .= " AND s.code_fournisseur LIKE '%".$db->escape($search_code_fournisseur)."%'";
if ($search_compta_fournisseur) $sql .= " AND s.code_compta_fournisseur LIKE '%".$db->escape($search_compta_fournisseur)."%'";
@ -122,7 +122,7 @@ if ($resql)
$num = $db->num_rows($resql);
$i = 0;
$param = "&amp;search_nom=".$search_nom."&amp;search_code_fournisseur=".$search_code_fournisseur."&amp;search_ville=".$search_ville;
$param = "&amp;search_nom=".$search_nom."&amp;search_code_fournisseur=".$search_code_fournisseur."&amp;search_zipcode=".$search_zipcode."&amp;search_ville=".$search_ville;
if ($search_categ != '') $param.='&amp;search_categ='.$search_categ;
print_barre_liste($langs->trans("ListOfSuppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords);

View File

@ -189,6 +189,7 @@ if (! $error)
}
elseif ($db->error && ! (! empty($_POST["db_create_database"]) && $db->connected))
{
// Note: you may experience error here with message "No such file or directory" when mysql was installed for the first time but not yet launched.
print '<div class="error">'.$db->error.'</div>';
if (! $db->connected) print $langs->trans("BecauseConnectionFailedParametersMayBeWrong").'<br><br>';
//print '<a href="#" onClick="javascript: history.back();">';

View File

@ -71,7 +71,7 @@ if ($action == 'setvalue' && $user->admin)
if (! $error)
{
$db->commit();
$mesg='<div class="ok">'.$langs->trans("SetupSaved").'</div>';
setEventMessage($langs->trans("SetupSaved"));
}
else
{
@ -100,37 +100,13 @@ dol_fiche_head($head, 'paypalaccount', $langs->trans("ModuleSetup"));
print $langs->trans("PaypalDesc")."<br>\n";
if ($conf->use_javascript_ajax)
{
print "\n".'<script type="text/javascript" language="javascript">';
print '$(document).ready(function () {
$("#apidoc").hide();
$("#apidoca").click(function() {
$("#apidoca").hide();
$("#apidoc").show();
});
$("#generate_token").click(function() {
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
action: \'getrandompassword\',
generic: true
},
function(token) {
$("#PAYPAL_SECURITY_TOKEN").val(token);
});
});
});';
print '</script>';
}
// Test if php curl exist
if (! function_exists('curl_version'))
{
$langs->load("errors");
$mesg='<div class="error">'.$langs->trans("ErrorPhpCurlNotInstalled").'</div>';
setEventMessage($langs->trans("ErrorPhpCurlNotInstalled"), 'errors');
}
dol_htmloutput_mesg($mesg);
print '<br>';
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
@ -235,7 +211,8 @@ $var=!$var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("SecurityToken").'</td><td>';
print '<input size="48" type="text" id="PAYPAL_SECURITY_TOKEN" name="PAYPAL_SECURITY_TOKEN" value="'.$conf->global->PAYPAL_SECURITY_TOKEN.'">';
print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
if (! empty($conf->use_javascript_ajax))
print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
print '</td></tr>';
$var=!$var;
@ -256,7 +233,8 @@ print '<br><br>';
// Help doc
print '<u>'.$langs->trans("InformationToFindParameters","Paypal").'</u>:<br>';
if ($conf->use_javascript_ajax) print '<a href="#" id="apidoca">'.$langs->trans("ClickHere").'...</a>';
if (! empty($conf->use_javascript_ajax))
print '<a href="#" id="apidoca">'.$langs->trans("ClickHere").'...</a>';
$realpaypalurl='www.paypal.com';
$sandboxpaypalurl='developer.paypal.com';
@ -374,7 +352,29 @@ if (! empty($conf->adherent->enabled))
print "<br>";
print info_admin($langs->trans("YouCanAddTagOnUrl"));
llxFooter();
if (! empty($conf->use_javascript_ajax))
{
print "\n".'<script type="text/javascript">';
print '$(document).ready(function () {
$("#apidoc").hide();
$("#apidoca").click(function() {
$("#apidoca").hide();
$("#apidoc").show();
});
$("#generate_token").click(function() {
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
action: \'getrandompassword\',
generic: true
},
function(token) {
$("#PAYPAL_SECURITY_TOKEN").val(token);
});
});
});';
print '</script>';
}
llxFooter();
$db->close();
?>