Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into mko559
This commit is contained in:
commit
21875a5e4a
@ -12,7 +12,10 @@ a package onto LaunchPad
|
|||||||
# To install all packagers tools:
|
# To install all packagers tools:
|
||||||
# sudo apt-get install bzr-builder bzr dpatch pbuilder debootstrap devscripts
|
# sudo apt-get install bzr-builder bzr dpatch pbuilder debootstrap devscripts
|
||||||
|
|
||||||
|
|
||||||
# Init local working env
|
# Init local working env
|
||||||
|
#----------------------------------
|
||||||
|
|
||||||
- Create account on launchpad.org
|
- Create account on launchpad.org
|
||||||
- Create Project
|
- Create Project
|
||||||
- Link project to official SCM server
|
- Link project to official SCM server
|
||||||
@ -21,32 +24,53 @@ a package onto LaunchPad
|
|||||||
- Run from command line:
|
- Run from command line:
|
||||||
bzr launchpad-login yourlogin
|
bzr launchpad-login yourlogin
|
||||||
bzr whoami "Your Name <email@email.com>"
|
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"
|
COMPONENTS="main universe multiverse restricted"
|
||||||
- Create chroot ubuntu env
|
- Create chroot ubuntu env
|
||||||
sudo pbuilder create [--distribution sid|squeeze]
|
sudo pbuilder create [--distribution sid|squeeze]
|
||||||
- Edit file ~/.bashrc ti add
|
- Edit file ~/.bashrc to add
|
||||||
DEBFULLNAME="<Your name>"
|
DEBFULLNAME="<Your name>"
|
||||||
DEBEMAIL="<Your email address>"
|
DEBEMAIL="<Your email address>"
|
||||||
|
|
||||||
# Init package tools for launchpad
|
|
||||||
|
# Push/declare sources to Launchpad
|
||||||
|
#----------------------------------
|
||||||
|
|
||||||
- Create a Bazaar directory
|
- Create a Bazaar directory
|
||||||
mkdir bzr
|
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
|
cd bzr
|
||||||
mkdir debian
|
mkdir debian
|
||||||
cd debian
|
cd debian
|
||||||
bzr init
|
|
||||||
cp -pr dolibarr_root/debian bzr/debian
|
cp -pr dolibarr_root/debian bzr/debian
|
||||||
bzr add debian
|
bzr init
|
||||||
bzr commit -m "Init"
|
bzr add
|
||||||
bzr push lp:~eldy/dolibarr/debian
|
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:
|
or download it from launchpad bazaar:
|
||||||
cd bzr
|
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
|
- To update this debian directory, edit files into the bzr dir and run
|
||||||
|
bzr status
|
||||||
bzr commit -m "Description of change"
|
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
|
- Create a file dolibarr.recipe with content
|
||||||
cd bzr
|
cd bzr
|
||||||
vi dolibarr.recipe
|
vi dolibarr.recipe
|
||||||
@ -61,7 +85,9 @@ DEBEMAIL="<Your email address>"
|
|||||||
sudo pbuilder build <working-dir>/<project>_<version>.dsc
|
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:
|
Add signing key of the Launchpad repository:
|
||||||
> gpg --keyserver keyserver.ubuntu.com --recv-key A38BF8FD
|
> gpg --keyserver keyserver.ubuntu.com --recv-key A38BF8FD
|
||||||
> sudo apt-key add ~/.gnupg/pubring.gpg
|
> sudo apt-key add ~/.gnupg/pubring.gpg
|
||||||
|
|||||||
19
build/obs/README
Normal file
19
build/obs/README
Normal 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
|
||||||
|
|
||||||
@ -11,7 +11,8 @@ with format RPM (for Redhat, OpenSuse, Mandriva, ...).
|
|||||||
# This is standard command to work on RPM packaging:
|
# This is standard command to work on RPM packaging:
|
||||||
#
|
#
|
||||||
# To install all packagers tools:
|
# 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
|
# rpmlint file.rpm Test a package
|
||||||
# mock -r fedora-15-i386 --rebuild ../SRPMS/hello-2.7-1.fc15.src.rpm
|
# mock -r fedora-15-i386 --rebuild ../SRPMS/hello-2.7-1.fc15.src.rpm
|
||||||
|
|||||||
@ -108,12 +108,14 @@ cui hai bisogno ed essere facile da usare.
|
|||||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts
|
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts
|
||||||
|
|
||||||
# Lang
|
# 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/*_*
|
for i in $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/langs/*_*
|
||||||
do
|
do
|
||||||
lang=$(basename $i)
|
lang=$(basename $i)
|
||||||
lang1=`expr substr $lang 1 2`;
|
lang1=`expr substr $lang 1 2`;
|
||||||
lang2=`expr substr $lang 4 2 | tr "[:upper:]" "[:lower:]"`;
|
lang2=`expr substr $lang 4 2 | tr "[:upper:]" "[:lower:]"`;
|
||||||
|
echo "%dir %{_datadir}/%{name}/htdocs/langs/${lang}" >> %{name}.lang
|
||||||
if [ "$lang1" = "$lang2" ] ; then
|
if [ "$lang1" = "$lang2" ] ; then
|
||||||
echo "%lang(${lang1}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang"
|
echo "%lang(${lang1}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang"
|
||||||
else
|
else
|
||||||
@ -132,6 +134,9 @@ done >>%{name}.lang
|
|||||||
%files -f %{name}.lang
|
%files -f %{name}.lang
|
||||||
|
|
||||||
%defattr(0755, root, root, 0755)
|
%defattr(0755, root, root, 0755)
|
||||||
|
|
||||||
|
%dir %_datadir/dolibarr
|
||||||
|
|
||||||
%dir %_datadir/dolibarr/scripts
|
%dir %_datadir/dolibarr/scripts
|
||||||
%_datadir/dolibarr/scripts/*
|
%_datadir/dolibarr/scripts/*
|
||||||
|
|
||||||
@ -141,6 +146,8 @@ done >>%{name}.lang
|
|||||||
%_datadir/pixmaps/dolibarr.png
|
%_datadir/pixmaps/dolibarr.png
|
||||||
%_datadir/applications/dolibarr.desktop
|
%_datadir/applications/dolibarr.desktop
|
||||||
|
|
||||||
|
%dir %_datadir/dolibarr/build
|
||||||
|
|
||||||
%dir %_datadir/dolibarr/build/rpm
|
%dir %_datadir/dolibarr/build/rpm
|
||||||
%_datadir/dolibarr/build/rpm/*
|
%_datadir/dolibarr/build/rpm/*
|
||||||
|
|
||||||
@ -195,6 +202,8 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/*.php
|
%_datadir/dolibarr/htdocs/*.php
|
||||||
%_datadir/dolibarr/htdocs/*.txt
|
%_datadir/dolibarr/htdocs/*.txt
|
||||||
|
|
||||||
|
%dir %{_sysconfdir}/dolibarr
|
||||||
|
|
||||||
%defattr(0664, root, apache)
|
%defattr(0664, root, apache)
|
||||||
%config(noreplace) %{_sysconfdir}/dolibarr/conf.php
|
%config(noreplace) %{_sysconfdir}/dolibarr/conf.php
|
||||||
%config(noreplace) %{_sysconfdir}/dolibarr/apache.conf
|
%config(noreplace) %{_sysconfdir}/dolibarr/apache.conf
|
||||||
@ -206,6 +215,8 @@ done >>%{name}.lang
|
|||||||
#---- post (after unzip during install)
|
#---- post (after unzip during install)
|
||||||
%post
|
%post
|
||||||
|
|
||||||
|
echo Run post script of packager dolibarr_fedora.spec
|
||||||
|
|
||||||
# Define vars
|
# Define vars
|
||||||
export docdir="/var/lib/dolibarr/documents"
|
export docdir="/var/lib/dolibarr/documents"
|
||||||
export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf"
|
export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf"
|
||||||
@ -252,8 +263,13 @@ restorecon -R -v /var/lib/dolibarr
|
|||||||
|
|
||||||
# Create a config link dolibarr.conf
|
# Create a config link dolibarr.conf
|
||||||
if [ ! -L $apachelink ]; then
|
if [ ! -L $apachelink ]; then
|
||||||
echo Create dolibarr web server config link $apachelink
|
apachelinkdir=`dirname $apachelink`
|
||||||
ln -fs %{_sysconfdir}/dolibarr/apache.conf $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
|
fi
|
||||||
|
|
||||||
echo Set permission to $apacheuser:$apachegroup on /var/lib/dolibarr
|
echo Set permission to $apacheuser:$apachegroup on /var/lib/dolibarr
|
||||||
|
|||||||
@ -54,7 +54,7 @@ Requires: mysql, mysql-client
|
|||||||
%if 0%{?suse_version}
|
%if 0%{?suse_version}
|
||||||
# Voir http://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros
|
# Voir http://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros
|
||||||
Group: Productivity/Office/Management
|
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
|
Requires: mysql-community-server, mysql-community-server-client
|
||||||
BuildRequires: update-desktop-files fdupes
|
BuildRequires: update-desktop-files fdupes
|
||||||
%else
|
%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.
|
Clientes (CRM) así como para para otras diferentes actividades.
|
||||||
Dolibarr ha sido diseñado para suministrarle solamente las funcionalidades
|
Dolibarr ha sido diseñado para suministrarle solamente las funcionalidades
|
||||||
que necesita y haciendo hincapié en su facilidad de uso.
|
que necesita y haciendo hincapié en su facilidad de uso.
|
||||||
|
|
||||||
%description -l fr
|
%description -l fr
|
||||||
Logiciel ERP & CRM de gestion de PME/PMI, autoentrepreneurs,
|
Logiciel ERP & CRM de gestion de PME/PMI, autoentrepreneurs,
|
||||||
artisans ou associations. Il permet de gérer vos clients, prospect,
|
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
|
||||||
%install
|
%install
|
||||||
|
|
||||||
|
%if 0%{?sles_version}
|
||||||
|
%else
|
||||||
%{__rm} -rf $RPM_BUILD_ROOT
|
%{__rm} -rf $RPM_BUILD_ROOT
|
||||||
|
%endif
|
||||||
|
|
||||||
%{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
|
%{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
|
||||||
%{__install} -m 644 build/rpm/conf.php $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.php
|
%{__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
|
%endif
|
||||||
|
|
||||||
# Lang
|
# 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
|
echo "%dir %{_datadir}/%{name}/htdocs/langs" >> %{name}.lang
|
||||||
for i in $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/langs/*_*
|
for i in $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/langs/*_*
|
||||||
do
|
do
|
||||||
@ -183,10 +187,9 @@ do
|
|||||||
fi
|
fi
|
||||||
done >>%{name}.lang
|
done >>%{name}.lang
|
||||||
|
|
||||||
%if 0%{?suse_version}
|
%if 0%{?suse_version} || 0%{?sles_version}
|
||||||
# Enable this command to tag desktop file for suse
|
# 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
|
# 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
|
||||||
%endif
|
%endif
|
||||||
@ -291,6 +294,8 @@ done >>%{name}.lang
|
|||||||
#---- post (after unzip during install)
|
#---- post (after unzip during install)
|
||||||
%post
|
%post
|
||||||
|
|
||||||
|
echo Run post script of packager dolibarr_generic.spec
|
||||||
|
|
||||||
# Define vars
|
# Define vars
|
||||||
export docdir="/var/lib/dolibarr/documents"
|
export docdir="/var/lib/dolibarr/documents"
|
||||||
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion}
|
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion}
|
||||||
|
|||||||
@ -105,12 +105,14 @@ cui hai bisogno ed essere facile da usare.
|
|||||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts
|
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts
|
||||||
|
|
||||||
# Lang
|
# 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/*_*
|
for i in $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/langs/*_*
|
||||||
do
|
do
|
||||||
lang=$(basename $i)
|
lang=$(basename $i)
|
||||||
lang1=`expr substr $lang 1 2`;
|
lang1=`expr substr $lang 1 2`;
|
||||||
lang2=`expr substr $lang 4 2 | tr "[:upper:]" "[:lower:]"`;
|
lang2=`expr substr $lang 4 2 | tr "[:upper:]" "[:lower:]"`;
|
||||||
|
echo "%dir %{_datadir}/%{name}/htdocs/langs/${lang}" >> %{name}.lang
|
||||||
if [ "$lang1" = "$lang2" ] ; then
|
if [ "$lang1" = "$lang2" ] ; then
|
||||||
echo "%lang(${lang1}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang"
|
echo "%lang(${lang1}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang"
|
||||||
else
|
else
|
||||||
@ -129,6 +131,9 @@ done >>%{name}.lang
|
|||||||
%files -f %{name}.lang
|
%files -f %{name}.lang
|
||||||
|
|
||||||
%defattr(0755, root, root, 0755)
|
%defattr(0755, root, root, 0755)
|
||||||
|
|
||||||
|
%dir %_datadir/dolibarr
|
||||||
|
|
||||||
%dir %_datadir/dolibarr/scripts
|
%dir %_datadir/dolibarr/scripts
|
||||||
%_datadir/dolibarr/scripts/*
|
%_datadir/dolibarr/scripts/*
|
||||||
|
|
||||||
@ -138,6 +143,8 @@ done >>%{name}.lang
|
|||||||
%_datadir/pixmaps/dolibarr.png
|
%_datadir/pixmaps/dolibarr.png
|
||||||
%_datadir/applications/dolibarr.desktop
|
%_datadir/applications/dolibarr.desktop
|
||||||
|
|
||||||
|
%dir %_datadir/dolibarr/build
|
||||||
|
|
||||||
%dir %_datadir/dolibarr/build/rpm
|
%dir %_datadir/dolibarr/build/rpm
|
||||||
%_datadir/dolibarr/build/rpm/*
|
%_datadir/dolibarr/build/rpm/*
|
||||||
|
|
||||||
@ -192,6 +199,8 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/*.php
|
%_datadir/dolibarr/htdocs/*.php
|
||||||
%_datadir/dolibarr/htdocs/*.txt
|
%_datadir/dolibarr/htdocs/*.txt
|
||||||
|
|
||||||
|
%dir %{_sysconfdir}/dolibarr
|
||||||
|
|
||||||
%defattr(0664, root, apache)
|
%defattr(0664, root, apache)
|
||||||
%config(noreplace) %{_sysconfdir}/dolibarr/conf.php
|
%config(noreplace) %{_sysconfdir}/dolibarr/conf.php
|
||||||
%config(noreplace) %{_sysconfdir}/dolibarr/apache.conf
|
%config(noreplace) %{_sysconfdir}/dolibarr/apache.conf
|
||||||
@ -203,6 +212,8 @@ done >>%{name}.lang
|
|||||||
#---- post (after unzip during install)
|
#---- post (after unzip during install)
|
||||||
%post
|
%post
|
||||||
|
|
||||||
|
echo Run post script of packager dolibarr_mandriva.spec
|
||||||
|
|
||||||
# Define vars
|
# Define vars
|
||||||
export docdir="/var/lib/dolibarr/documents"
|
export docdir="/var/lib/dolibarr/documents"
|
||||||
export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf"
|
export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf"
|
||||||
@ -241,8 +252,13 @@ fi
|
|||||||
|
|
||||||
# Create a config link dolibarr.conf
|
# Create a config link dolibarr.conf
|
||||||
if [ ! -L $apachelink ]; then
|
if [ ! -L $apachelink ]; then
|
||||||
echo Create dolibarr web server config link $apachelink
|
apachelinkdir=`dirname $apachelink`
|
||||||
ln -fs %{_sysconfdir}/dolibarr/apache.conf $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
|
fi
|
||||||
|
|
||||||
echo Set permission to $apacheuser:$apachegroup on /var/lib/dolibarr
|
echo Set permission to $apacheuser:$apachegroup on /var/lib/dolibarr
|
||||||
|
|||||||
@ -25,9 +25,9 @@ BuildArch: noarch
|
|||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
|
|
||||||
Group: Productivity/Office/Management
|
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
|
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)
|
# Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse)
|
||||||
AutoReqProv: no
|
AutoReqProv: no
|
||||||
@ -104,12 +104,14 @@ cui hai bisogno ed essere facile da usare.
|
|||||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts
|
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts
|
||||||
|
|
||||||
# Lang
|
# 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/*_*
|
for i in $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/langs/*_*
|
||||||
do
|
do
|
||||||
lang=$(basename $i)
|
lang=$(basename $i)
|
||||||
lang1=`expr substr $lang 1 2`;
|
lang1=`expr substr $lang 1 2`;
|
||||||
lang2=`expr substr $lang 4 2 | tr "[:upper:]" "[:lower:]"`;
|
lang2=`expr substr $lang 4 2 | tr "[:upper:]" "[:lower:]"`;
|
||||||
|
echo "%dir %{_datadir}/%{name}/htdocs/langs/${lang}" >> %{name}.lang
|
||||||
if [ "$lang1" = "$lang2" ] ; then
|
if [ "$lang1" = "$lang2" ] ; then
|
||||||
echo "%lang(${lang1}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang"
|
echo "%lang(${lang1}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang"
|
||||||
else
|
else
|
||||||
@ -117,11 +119,12 @@ do
|
|||||||
fi
|
fi
|
||||||
done >>%{name}.lang
|
done >>%{name}.lang
|
||||||
|
|
||||||
|
|
||||||
# Enable this command to tag desktop file for suse
|
# 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
|
# 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
|
#---- clean
|
||||||
@ -134,6 +137,9 @@ done >>%{name}.lang
|
|||||||
%files -f %{name}.lang
|
%files -f %{name}.lang
|
||||||
|
|
||||||
%defattr(0755, root, root, 0755)
|
%defattr(0755, root, root, 0755)
|
||||||
|
|
||||||
|
%dir %_datadir/dolibarr
|
||||||
|
|
||||||
%dir %_datadir/dolibarr/scripts
|
%dir %_datadir/dolibarr/scripts
|
||||||
%_datadir/dolibarr/scripts/*
|
%_datadir/dolibarr/scripts/*
|
||||||
|
|
||||||
@ -143,6 +149,8 @@ done >>%{name}.lang
|
|||||||
%_datadir/pixmaps/dolibarr.png
|
%_datadir/pixmaps/dolibarr.png
|
||||||
%_datadir/applications/dolibarr.desktop
|
%_datadir/applications/dolibarr.desktop
|
||||||
|
|
||||||
|
%dir %_datadir/dolibarr/build
|
||||||
|
|
||||||
%dir %_datadir/dolibarr/build/rpm
|
%dir %_datadir/dolibarr/build/rpm
|
||||||
%_datadir/dolibarr/build/rpm/*
|
%_datadir/dolibarr/build/rpm/*
|
||||||
|
|
||||||
@ -197,6 +205,8 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/*.php
|
%_datadir/dolibarr/htdocs/*.php
|
||||||
%_datadir/dolibarr/htdocs/*.txt
|
%_datadir/dolibarr/htdocs/*.txt
|
||||||
|
|
||||||
|
%dir %{_sysconfdir}/dolibarr
|
||||||
|
|
||||||
%defattr(0664, root, www)
|
%defattr(0664, root, www)
|
||||||
%config(noreplace) %{_sysconfdir}/dolibarr/conf.php
|
%config(noreplace) %{_sysconfdir}/dolibarr/conf.php
|
||||||
%config(noreplace) %{_sysconfdir}/dolibarr/apache.conf
|
%config(noreplace) %{_sysconfdir}/dolibarr/apache.conf
|
||||||
@ -208,6 +218,8 @@ done >>%{name}.lang
|
|||||||
#---- post (after unzip during install)
|
#---- post (after unzip during install)
|
||||||
%post
|
%post
|
||||||
|
|
||||||
|
echo Run post script of packager dolibarr_opensuse.spec
|
||||||
|
|
||||||
# Define vars
|
# Define vars
|
||||||
export docdir="/var/lib/dolibarr/documents"
|
export docdir="/var/lib/dolibarr/documents"
|
||||||
export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf"
|
export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf"
|
||||||
@ -246,8 +258,13 @@ fi
|
|||||||
|
|
||||||
# Create a config link dolibarr.conf
|
# Create a config link dolibarr.conf
|
||||||
if [ ! -L $apachelink ]; then
|
if [ ! -L $apachelink ]; then
|
||||||
echo Create dolibarr web server config link $apachelink
|
apachelinkdir=`dirname $apachelink`
|
||||||
ln -fs %{_sysconfdir}/dolibarr/apache.conf $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
|
fi
|
||||||
|
|
||||||
echo Set permission to $apacheuser:$apachegroup on /var/lib/dolibarr
|
echo Set permission to $apacheuser:$apachegroup on /var/lib/dolibarr
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -51,12 +52,12 @@ if ($actionsave)
|
|||||||
if ($i >= 3)
|
if ($i >= 3)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
setEventMessage($langs->trans("SetupSaved"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->rollback();
|
$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 "<tr class=\"impair\">";
|
||||||
print '<td class="fieldrequired">'.$langs->trans("PasswordTogetVCalExport")."</td>";
|
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 ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
|
||||||
|
print '</td>';
|
||||||
print "<td> </td>";
|
print "<td> </td>";
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
@ -147,9 +151,24 @@ $message.=$langs->trans("AgendaUrlOptions4",$user->login,$user->login).'<br>';
|
|||||||
$message.=$langs->trans("AgendaUrlOptions5",$user->login,$user->login);
|
$message.=$langs->trans("AgendaUrlOptions5",$user->login,$user->login);
|
||||||
print info_admin($message);
|
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();
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -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 > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
|
||||||
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
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_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_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_code) $sql.= " AND s.code_client LIKE '%".$db->escape($search_code)."%'";
|
||||||
if ($search_compta) $sql.= " AND s.code_compta LIKE '%".$db->escape($search_compta)."%'";
|
if ($search_compta) $sql.= " AND s.code_compta LIKE '%".$db->escape($search_compta)."%'";
|
||||||
@ -144,7 +144,7 @@ if ($result)
|
|||||||
{
|
{
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
|
|
||||||
$param = "&search_nom=".$search_nom."&search_code=".$search_code."&search_ville=".$search_ville;
|
$param = "&search_nom=".$search_nom."&search_code=".$search_code."&search_zipcode=".$search_zipcode."&search_ville=".$search_ville;
|
||||||
if ($search_categ != '') $param.='&search_categ='.$search_categ;
|
if ($search_categ != '') $param.='&search_categ='.$search_categ;
|
||||||
if ($search_sale != '') $param.='&search_sale='.$search_sale;
|
if ($search_sale != '') $param.='&search_sale='.$search_sale;
|
||||||
|
|
||||||
|
|||||||
@ -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 > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
|
||||||
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
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_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_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_departement) $sql .= " AND d.nom LIKE '%".$db->escape(strtolower($search_departement))."%'";
|
||||||
if ($search_datec) $sql .= " AND s.datec LIKE '%".$db->escape($search_datec)."%'";
|
if ($search_datec) $sql .= " AND s.datec LIKE '%".$db->escape($search_datec)."%'";
|
||||||
@ -244,7 +244,7 @@ if ($resql)
|
|||||||
llxHeader('',$langs->trans("ThirdParty"),$help_url);
|
llxHeader('',$langs->trans("ThirdParty"),$help_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
$param='&stcomm='.$stcomm.'&search_nom='.urlencode($search_nom).'&search_ville='.urlencode($search_ville);
|
$param='&stcomm='.$stcomm.'&search_nom='.urlencode($search_nom).'&search_zipcode='.urlencode($search_code).'&search_ville='.urlencode($search_ville);
|
||||||
// Added by Matelli
|
// Added by Matelli
|
||||||
// Store the status filter in the URL
|
// Store the status filter in the URL
|
||||||
if (isSet($search_cstc))
|
if (isSet($search_cstc))
|
||||||
|
|||||||
@ -292,8 +292,8 @@ class Form
|
|||||||
{
|
{
|
||||||
$tmp=explode(':',$inputType);
|
$tmp=explode(':',$inputType);
|
||||||
$inputType=$tmp[0];
|
$inputType=$tmp[0];
|
||||||
if (! empty($tmp[1])) $rows=$tmp[1];
|
$rows=(empty($tmp[1])?'8':$tmp[1]);
|
||||||
if (! empty($tmp[2])) $cols=$tmp[2];
|
$cols=(empty($tmp[2])?'80':$tmp[2]);
|
||||||
}
|
}
|
||||||
else if (preg_match('/^ckeditor/',$inputType))
|
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($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($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 (! 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="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";
|
$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.') - ';
|
$outval.=$objRef.' ('.$objRefFourn.') - ';
|
||||||
$opt.=dol_trunc($objp->label,18).' - ';
|
$opt.=dol_trunc($objp->label,18).' - ';
|
||||||
$outval.=dol_trunc($label,18).' - ';
|
$outval.=dol_trunc($label,18).' - ';
|
||||||
|
|
||||||
if (! empty($objp->idprodfournprice))
|
if (! empty($objp->idprodfournprice))
|
||||||
{
|
{
|
||||||
$currencytext=$langs->trans("Currency".$conf->currency);
|
$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
|
$opt.= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
|
||||||
$outval.=$langs->transnoentities("Units");
|
$outval.=$langs->transnoentities("Units");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($objp->quantity >= 1)
|
if ($objp->quantity >= 1)
|
||||||
{
|
{
|
||||||
$opt.=" (".price($objp->unitprice).' '.$currencytext."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
|
$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");
|
$outval.=$langs->transnoentities("NoPriceDefinedForThisSupplier");
|
||||||
}
|
}
|
||||||
$opt .= "</option>\n";
|
$opt .= "</option>\n";
|
||||||
|
|
||||||
|
|
||||||
// Add new entry
|
// Add new entry
|
||||||
// "key" value of json key array is used by jQuery automatically as selected value
|
// "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
|
// "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));
|
//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é)');
|
//$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));
|
//var_dump($outval); var_dump(utf8_check($outval)); var_dump(json_encode($outval));
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$outselect.='</select>';
|
$outselect.='</select>';
|
||||||
|
|||||||
@ -909,7 +909,9 @@ class Ldap
|
|||||||
if (is_array($attributeArray))
|
if (is_array($attributeArray))
|
||||||
{
|
{
|
||||||
// Return list with required fields
|
// 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).")");
|
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);
|
$this->result = @ldap_search($this->connection, $userDn, $filter, $attributeArray);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -1020,23 +1020,35 @@ class DoliDBPgsql
|
|||||||
*
|
*
|
||||||
* @param string $table Name of table
|
* @param string $table Name of table
|
||||||
* @return array Tableau des informations des champs de la table
|
* @return array Tableau des informations des champs de la table
|
||||||
* TODO modify for postgresql
|
*
|
||||||
*/
|
*/
|
||||||
function DDLInfoTable($table)
|
function DDLInfoTable($table)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
$infotables=array();
|
$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);
|
dol_syslog($sql,LOG_DEBUG);
|
||||||
$result = $this->pg_query($this->db,$sql);
|
$result = $this->query($sql);
|
||||||
while($row = $this->fetch_row($result))
|
while($row = $this->fetch_row($result))
|
||||||
{
|
{
|
||||||
$infotables[] = $row;
|
$infotables[] = $row;
|
||||||
}
|
}
|
||||||
return $infotables;
|
return $infotables;
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -26,48 +26,51 @@ $(document).ready(function() {
|
|||||||
var table_element = $('#jeditable_table_element').html();
|
var table_element = $('#jeditable_table_element').html();
|
||||||
var fk_element = $('#jeditable_fk_element').html();
|
var fk_element = $('#jeditable_fk_element').html();
|
||||||
|
|
||||||
$('.editval_textarea').editable(urlSaveInPlace, {
|
if ($('.editval_textarea').length > 0) {
|
||||||
type : 'textarea',
|
$('.editval_textarea').editable(urlSaveInPlace, {
|
||||||
rows : 4,
|
type : 'textarea',
|
||||||
id : 'field',
|
rows : $('#textarea_' + $('.editval_textarea').attr('id').substr(8) + '_rows').val(),
|
||||||
tooltip : tooltipInPlace,
|
cols : $('#textarea_' + $('.editval_textarea').attr('id').substr(8) + '_cols').val(),
|
||||||
placeholder : ' ',
|
id : 'field',
|
||||||
cancel : cancelInPlace,
|
tooltip : tooltipInPlace,
|
||||||
submit : submitInPlace,
|
placeholder : ' ',
|
||||||
indicator : indicatorInPlace,
|
cancel : cancelInPlace,
|
||||||
loadurl : urlLoadInPlace,
|
submit : submitInPlace,
|
||||||
loaddata : function(result, settings) {
|
indicator : indicatorInPlace,
|
||||||
return getParameters(this, 'textarea');
|
loadurl : urlLoadInPlace,
|
||||||
},
|
loaddata : function(result, settings) {
|
||||||
submitdata : function(result, settings) {
|
return getParameters(this, 'textarea');
|
||||||
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");
|
|
||||||
},
|
},
|
||||||
function () {
|
submitdata : function(result, settings) {
|
||||||
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
|
return getParameters(this, 'textarea');
|
||||||
|
},
|
||||||
|
callback : function(result, settings) {
|
||||||
|
getResult(this, result);
|
||||||
|
},
|
||||||
|
onreset : function(result, settings) {
|
||||||
|
getDefault(settings);
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
$('.editkey_textarea').click(function() {
|
$('.editkey_textarea').hover(
|
||||||
$('#viewval_' + $(this).attr('id')).click();
|
function () {
|
||||||
});
|
$('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
|
||||||
$('.viewval_textarea.active').click(function() {
|
},
|
||||||
$('#viewval_' + $(this).attr('id').substr(8)).hide();
|
function () {
|
||||||
$('#editval_' + $(this).attr('id').substr(8)).show().click();
|
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
|
||||||
});
|
}
|
||||||
$('.editkey_textarea').click(function() {
|
);
|
||||||
$('#viewval_' + $(this).attr('id')).hide();
|
$('.editkey_textarea').click(function() {
|
||||||
$('#editval_' + $(this).attr('id')).show().click();
|
$('#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') {
|
if (typeof ckeditorConfig != 'undefined') {
|
||||||
$('.editval_ckeditor').editable(urlSaveInPlace, {
|
$('.editval_ckeditor').editable(urlSaveInPlace, {
|
||||||
@ -120,204 +123,214 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.editval_string').editable(urlSaveInPlace, {
|
if ($('.editval_string').length > 0) {
|
||||||
type : 'text',
|
$('.editval_string').editable(urlSaveInPlace, {
|
||||||
id : 'field',
|
type : 'text',
|
||||||
width : 300,
|
id : 'field',
|
||||||
tooltip : tooltipInPlace,
|
width : 300,
|
||||||
placeholder : placeholderInPlace,
|
tooltip : tooltipInPlace,
|
||||||
cancel : cancelInPlace,
|
placeholder : placeholderInPlace,
|
||||||
submit : submitInPlace,
|
cancel : cancelInPlace,
|
||||||
indicator : indicatorInPlace,
|
submit : submitInPlace,
|
||||||
submitdata : function(result, settings) {
|
indicator : indicatorInPlace,
|
||||||
return getParameters(this, 'string');
|
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");
|
|
||||||
},
|
},
|
||||||
function () {
|
callback : function(result, settings) {
|
||||||
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
|
getResult(this, result);
|
||||||
|
},
|
||||||
|
onreset : function(result, settings) {
|
||||||
|
getDefault(settings);
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
$('.editkey_string').click(function() {
|
$('.editkey_string').hover(
|
||||||
$( '#viewval_' + $(this).attr('id') ).click();
|
function () {
|
||||||
});
|
$('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
|
||||||
$('.viewval_string.active').click(function() {
|
},
|
||||||
$('#viewval_' + $(this).attr('id').substr(8)).hide();
|
function () {
|
||||||
$('#editval_' + $(this).attr('id').substr(8)).show().click();
|
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
|
||||||
});
|
}
|
||||||
$('.editkey_string').click(function() {
|
);
|
||||||
$('#viewval_' + $(this).attr('id')).hide();
|
$('.editkey_string').click(function() {
|
||||||
$('#editval_' + $(this).attr('id')).show().click();
|
$( '#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, {
|
if ($('.editval_numeric').length > 0) {
|
||||||
type : 'text',
|
$('.editval_numeric').editable(urlSaveInPlace, {
|
||||||
id : 'field',
|
type : 'text',
|
||||||
width : 100,
|
id : 'field',
|
||||||
tooltip : tooltipInPlace,
|
width : 100,
|
||||||
placeholder : placeholderInPlace,
|
tooltip : tooltipInPlace,
|
||||||
cancel : cancelInPlace,
|
placeholder : placeholderInPlace,
|
||||||
submit : submitInPlace,
|
cancel : cancelInPlace,
|
||||||
indicator : indicatorInPlace,
|
submit : submitInPlace,
|
||||||
submitdata : function(result, settings) {
|
indicator : indicatorInPlace,
|
||||||
return getParameters(this, 'numeric');
|
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");
|
|
||||||
},
|
},
|
||||||
function () {
|
callback : function(result, settings) {
|
||||||
$( '#viewval_' + $(this).attr('id') ).removeClass("viewval_hover");
|
getResult(this, result);
|
||||||
|
},
|
||||||
|
onreset : function(result, settings) {
|
||||||
|
getDefault(settings);
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
$('.editkey_numeric').click(function() {
|
$('.editkey_numeric').hover(
|
||||||
$( '#viewval_' + $(this).attr('id') ).click();
|
function () {
|
||||||
});
|
$( '#viewval_' + $(this).attr('id') ).addClass("viewval_hover");
|
||||||
$('.viewval_numeric.active').click(function() {
|
},
|
||||||
$('#viewval_' + $(this).attr('id').substr(8)).hide();
|
function () {
|
||||||
$('#editval_' + $(this).attr('id').substr(8)).show().click();
|
$( '#viewval_' + $(this).attr('id') ).removeClass("viewval_hover");
|
||||||
});
|
}
|
||||||
$('.editkey_numeric').click(function() {
|
);
|
||||||
$('#viewval_' + $(this).attr('id')).hide();
|
$('.editkey_numeric').click(function() {
|
||||||
$('#editval_' + $(this).attr('id')).show().click();
|
$( '#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, {
|
if ($('.editval_datepicker').length > 0) {
|
||||||
type : 'datepicker',
|
$('.editval_datepicker').editable(urlSaveInPlace, {
|
||||||
id : 'field',
|
type : 'datepicker',
|
||||||
onblur : 'ignore',
|
id : 'field',
|
||||||
tooltip : tooltipInPlace,
|
onblur : 'ignore',
|
||||||
placeholder : ' ',
|
tooltip : tooltipInPlace,
|
||||||
cancel : cancelInPlace,
|
placeholder : ' ',
|
||||||
submit : submitInPlace,
|
cancel : cancelInPlace,
|
||||||
indicator : indicatorInPlace,
|
submit : submitInPlace,
|
||||||
submitdata : function(result, settings) {
|
indicator : indicatorInPlace,
|
||||||
return getParameters(this, 'datepicker');
|
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");
|
|
||||||
},
|
},
|
||||||
function () {
|
callback : function(result, settings) {
|
||||||
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
|
getResult(this, result);
|
||||||
|
},
|
||||||
|
onreset : function(result, settings) {
|
||||||
|
getDefault(settings);
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
$('.viewval_datepicker.active').click(function() {
|
$('.editkey_datepicker').hover(
|
||||||
$('#viewval_' + $(this).attr('id').substr(8)).hide();
|
function () {
|
||||||
$('#editval_' + $(this).attr('id').substr(8)).show().click();
|
$('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
|
||||||
});
|
},
|
||||||
$('.editkey_datepicker').click(function() {
|
function () {
|
||||||
$('#viewval_' + $(this).attr('id')).hide();
|
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
|
||||||
$('#editval_' + $(this).attr('id')).show().click();
|
}
|
||||||
});
|
);
|
||||||
|
$('.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, {
|
if ($('.editval_select').length > 0) {
|
||||||
type : 'select',
|
$('.editval_select').editable(urlSaveInPlace, {
|
||||||
id : 'field',
|
type : 'select',
|
||||||
onblur : 'ignore',
|
id : 'field',
|
||||||
cssclass : 'flat',
|
onblur : 'ignore',
|
||||||
tooltip : tooltipInPlace,
|
cssclass : 'flat',
|
||||||
placeholder : ' ',
|
tooltip : tooltipInPlace,
|
||||||
cancel : cancelInPlace,
|
placeholder : ' ',
|
||||||
submit : submitInPlace,
|
cancel : cancelInPlace,
|
||||||
indicator : indicatorInPlace,
|
submit : submitInPlace,
|
||||||
loadurl : urlLoadInPlace,
|
indicator : indicatorInPlace,
|
||||||
loaddata : function(result, settings) {
|
loadurl : urlLoadInPlace,
|
||||||
return getParameters(this, 'select');
|
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");
|
|
||||||
},
|
},
|
||||||
function () {
|
submitdata : function(result, settings) {
|
||||||
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
|
return getParameters(this, 'select');
|
||||||
|
},
|
||||||
|
callback : function(result, settings) {
|
||||||
|
getResult(this, result);
|
||||||
|
},
|
||||||
|
onreset : function(result, settings) {
|
||||||
|
getDefault(settings);
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
$('.viewval_select.active').click(function() {
|
$('.editkey_select').hover(
|
||||||
$('#viewval_' + $(this).attr('id').substr(8)).hide();
|
function () {
|
||||||
$('#editval_' + $(this).attr('id').substr(8)).show().click();
|
$('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
|
||||||
});
|
},
|
||||||
$('.editkey_select').click(function() {
|
function () {
|
||||||
$('#viewval_' + $(this).attr('id')).hide();
|
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
|
||||||
$('#editval_' + $(this).attr('id')).show().click();
|
}
|
||||||
});
|
);
|
||||||
|
$('.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)
|
// for test only (not stable)
|
||||||
$('.editval_autocomplete').editable(urlSaveInPlace, {
|
if ($('.editval_autocomplete').length > 0) {
|
||||||
type : 'autocomplete',
|
$('.editval_autocomplete').editable(urlSaveInPlace, {
|
||||||
id : 'field',
|
type : 'autocomplete',
|
||||||
width : 300,
|
id : 'field',
|
||||||
onblur : 'ignore',
|
width : 300,
|
||||||
tooltip : tooltipInPlace,
|
onblur : 'ignore',
|
||||||
placeholder : ' ',
|
tooltip : tooltipInPlace,
|
||||||
cancel : cancelInPlace,
|
placeholder : ' ',
|
||||||
submit : submitInPlace,
|
cancel : cancelInPlace,
|
||||||
indicator : indicatorInPlace,
|
submit : submitInPlace,
|
||||||
autocomplete : {
|
indicator : indicatorInPlace,
|
||||||
source : urlLoadInPlace,
|
autocomplete : {
|
||||||
data : function(result, settings) {
|
source : urlLoadInPlace,
|
||||||
return getParameters(this, 'select');
|
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");
|
|
||||||
},
|
},
|
||||||
function () {
|
submitdata : function(result, settings) {
|
||||||
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
|
return getParameters(this, 'select');
|
||||||
|
},
|
||||||
|
callback : function(result, settings) {
|
||||||
|
getResult(this, result);
|
||||||
|
},
|
||||||
|
onreset : function(result, settings) {
|
||||||
|
getDefault(settings);
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
$('.viewval_autocomplete.active').click(function() {
|
$('.editkey_autocomplete').hover(
|
||||||
$('#viewval_' + $(this).attr('id').substr(8)).hide();
|
function () {
|
||||||
$('#editval_' + $(this).attr('id').substr(8)).show().click();
|
$('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
|
||||||
});
|
},
|
||||||
$('.editkey_autocomplete').click(function() {
|
function () {
|
||||||
$('#viewval_' + $(this).attr('id')).hide();
|
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
|
||||||
$('#editval_' + $(this).attr('id')).show().click();
|
}
|
||||||
});
|
);
|
||||||
|
$('.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) {
|
function getParameters(obj, type) {
|
||||||
var htmlname = $(obj).attr('id').substr(8);
|
var htmlname = $(obj).attr('id').substr(8);
|
||||||
|
|||||||
@ -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.
|
* Convert a string to lower. Never use strtolower because it does not works with UTF8 strings.
|
||||||
*
|
*
|
||||||
* @param string $utf8_string String to encode
|
* @param string $utf8_string String to encode
|
||||||
* @return string String converted
|
* @return string String converted
|
||||||
*/
|
*/
|
||||||
function dol_strtolower($utf8_string)
|
function dol_strtolower($utf8_string)
|
||||||
{
|
{
|
||||||
return mb_strtolower($utf8_string, "UTF-8");
|
return mb_strtolower($utf8_string, "UTF-8");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a string to upper. Never use strtolower because it does not works with UTF8 strings.
|
* Convert a string to upper. Never use strtolower because it does not works with UTF8 strings.
|
||||||
*
|
*
|
||||||
* @param string $utf8_string String to encode
|
* @param string $utf8_string String to encode
|
||||||
* @return string String converted
|
* @return string String converted
|
||||||
*/
|
*/
|
||||||
function dol_strtoupper($utf8_string)
|
function dol_strtoupper($utf8_string)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -51,7 +51,7 @@
|
|||||||
{
|
{
|
||||||
echo $form->select_type_of_lines($line->product_type, 'type', 1, 1);
|
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 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; ?>" />
|
<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);
|
$reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<br>';
|
|
||||||
|
|
||||||
// editeur wysiwyg
|
// editeur wysiwyg
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
$nbrows=ROWS_2;
|
$nbrows=ROWS_2;
|
||||||
|
|||||||
@ -912,7 +912,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
print '<tr><td valign="top">';
|
print '<tr><td valign="top">';
|
||||||
print $form->editfieldkey("Description",'description',$object->description,$object,$user->rights->ficheinter->creer,'textarea');
|
print $form->editfieldkey("Description",'description',$object->description,$object,$user->rights->ficheinter->creer,'textarea');
|
||||||
print '</td><td colspan="3">';
|
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 '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|||||||
@ -189,7 +189,7 @@ class ProductFournisseur extends Product
|
|||||||
$sql.= " tva_tx = ".$tva_tx.",";
|
$sql.= " tva_tx = ".$tva_tx.",";
|
||||||
$sql.= " fk_availability = ".$availability.",";
|
$sql.= " fk_availability = ".$availability.",";
|
||||||
$sql.= " entity = ".$conf->entity.",";
|
$sql.= " entity = ".$conf->entity.",";
|
||||||
$sql.= " charges = ".($charges != ''?price2num($charges):"null");
|
$sql.= " charges = ".$charges;
|
||||||
$sql.= " WHERE rowid = ".$this->product_fourn_price_id;
|
$sql.= " WHERE rowid = ".$this->product_fourn_price_id;
|
||||||
// TODO Add price_base_type and price_ttc
|
// TODO Add price_base_type and price_ttc
|
||||||
|
|
||||||
@ -219,18 +219,20 @@ class ProductFournisseur extends Product
|
|||||||
{
|
{
|
||||||
// Add price for this quantity to supplier
|
// Add price for this quantity to supplier
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_fournisseur_price(";
|
$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.= " values('".$this->db->idate($now)."',";
|
||||||
$sql.= " ".$this->id.",";
|
$sql.= " ".$this->id.",";
|
||||||
$sql.= " ".$fourn->id.",";
|
$sql.= " ".$fourn->id.",";
|
||||||
$sql.= " '".$this->db->escape($ref_fourn)."',";
|
$sql.= " '".$this->db->escape($ref_fourn)."',";
|
||||||
$sql.= " ".$user->id.",";
|
$sql.= " ".$user->id.",";
|
||||||
$sql.= " ".price2num($buyprice).",";
|
$sql.= " ".$buyprice.",";
|
||||||
$sql.= " ".$qty.",";
|
$sql.= " ".$qty.",";
|
||||||
$sql.= " ".$remise_percent.",";
|
$sql.= " ".$remise_percent.",";
|
||||||
$sql.= " ".$remise.",";
|
$sql.= " ".$remise.",";
|
||||||
$sql.= " ".$unitBuyPrice.",";
|
$sql.= " ".$unitBuyPrice.",";
|
||||||
$sql.= " ".$tva_tx.",";
|
$sql.= " ".$tva_tx.",";
|
||||||
|
$sql.= " ".$charges.",";
|
||||||
|
$sql.= " ".$unitCharges.",";
|
||||||
$sql.= " ".$availability.",";
|
$sql.= " ".$availability.",";
|
||||||
$sql.= $conf->entity;
|
$sql.= $conf->entity;
|
||||||
$sql.=")";
|
$sql.=")";
|
||||||
|
|||||||
@ -97,7 +97,7 @@ if ($socname)
|
|||||||
$sortorder = "ASC";
|
$sortorder = "ASC";
|
||||||
}
|
}
|
||||||
if ($search_nom) $sql .= " AND s.nom LIKE '%".$db->escape($search_nom)."%'";
|
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_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_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)."%'";
|
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);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
$param = "&search_nom=".$search_nom."&search_code_fournisseur=".$search_code_fournisseur."&search_ville=".$search_ville;
|
$param = "&search_nom=".$search_nom."&search_code_fournisseur=".$search_code_fournisseur."&search_zipcode=".$search_zipcode."&search_ville=".$search_ville;
|
||||||
if ($search_categ != '') $param.='&search_categ='.$search_categ;
|
if ($search_categ != '') $param.='&search_categ='.$search_categ;
|
||||||
|
|
||||||
print_barre_liste($langs->trans("ListOfSuppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords);
|
print_barre_liste($langs->trans("ListOfSuppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords);
|
||||||
|
|||||||
@ -189,6 +189,7 @@ if (! $error)
|
|||||||
}
|
}
|
||||||
elseif ($db->error && ! (! empty($_POST["db_create_database"]) && $db->connected))
|
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>';
|
print '<div class="error">'.$db->error.'</div>';
|
||||||
if (! $db->connected) print $langs->trans("BecauseConnectionFailedParametersMayBeWrong").'<br><br>';
|
if (! $db->connected) print $langs->trans("BecauseConnectionFailedParametersMayBeWrong").'<br><br>';
|
||||||
//print '<a href="#" onClick="javascript: history.back();">';
|
//print '<a href="#" onClick="javascript: history.back();">';
|
||||||
|
|||||||
@ -71,7 +71,7 @@ if ($action == 'setvalue' && $user->admin)
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
$mesg='<div class="ok">'.$langs->trans("SetupSaved").'</div>';
|
setEventMessage($langs->trans("SetupSaved"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -100,37 +100,13 @@ dol_fiche_head($head, 'paypalaccount', $langs->trans("ModuleSetup"));
|
|||||||
|
|
||||||
print $langs->trans("PaypalDesc")."<br>\n";
|
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
|
// Test if php curl exist
|
||||||
if (! function_exists('curl_version'))
|
if (! function_exists('curl_version'))
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$mesg='<div class="error">'.$langs->trans("ErrorPhpCurlNotInstalled").'</div>';
|
setEventMessage($langs->trans("ErrorPhpCurlNotInstalled"), 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_htmloutput_mesg($mesg);
|
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
@ -235,7 +211,8 @@ $var=!$var;
|
|||||||
print '<tr '.$bc[$var].'><td>';
|
print '<tr '.$bc[$var].'><td>';
|
||||||
print $langs->trans("SecurityToken").'</td><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 '<input size="48" type="text" id="PAYPAL_SECURITY_TOKEN" name="PAYPAL_SECURITY_TOKEN" value="'.$conf->global->PAYPAL_SECURITY_TOKEN.'">';
|
||||||
print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
|
if (! empty($conf->use_javascript_ajax))
|
||||||
|
print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
@ -256,7 +233,8 @@ print '<br><br>';
|
|||||||
|
|
||||||
// Help doc
|
// Help doc
|
||||||
print '<u>'.$langs->trans("InformationToFindParameters","Paypal").'</u>:<br>';
|
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';
|
$realpaypalurl='www.paypal.com';
|
||||||
$sandboxpaypalurl='developer.paypal.com';
|
$sandboxpaypalurl='developer.paypal.com';
|
||||||
@ -374,7 +352,29 @@ if (! empty($conf->adherent->enabled))
|
|||||||
print "<br>";
|
print "<br>";
|
||||||
print info_admin($langs->trans("YouCanAddTagOnUrl"));
|
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();
|
$db->close();
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user