From 9589b84a1a7cc8fecc015ac07cbce0606258bacb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Oct 2012 19:30:49 +0200 Subject: [PATCH 01/15] Fix: No reason to start content of a cell with br --- htdocs/core/tpl/objectline_edit.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 4629e2dcb22..e2dd75494e9 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -51,7 +51,7 @@ { echo $form->select_type_of_lines($line->product_type, 'type', 1, 1); } - ?> + ?> fk_product) && empty($line->label)) ? ' disabled="disabled"' : ''); ?>> @@ -87,7 +87,7 @@ $reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action); } - echo '
'; + //echo '
'; // Fix: No reason to start a content of the cells with br // editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; From 4f15029b133fd17f67cdaa23366b8437d090333a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Oct 2012 20:34:02 +0200 Subject: [PATCH 02/15] Update spec --- build/rpm/README | 3 ++- build/rpm/dolibarr_fedora.spec | 20 +++++++++++++++++--- build/rpm/dolibarr_generic.spec | 4 ++-- build/rpm/dolibarr_mandriva.spec | 20 +++++++++++++++++--- build/rpm/dolibarr_opensuse.spec | 29 ++++++++++++++++++++++------- 5 files changed, 60 insertions(+), 16 deletions(-) diff --git a/build/rpm/README b/build/rpm/README index e1c73a42356..6f2e6634f4b 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -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 diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 714157d1f86..e1b8c27d0ed 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -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 @@ -252,8 +261,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 diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 2b284b6afb9..5ceb43bc781 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -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 @@ -168,7 +168,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 diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index e98a416b8dc..e52d4724dbb 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -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 @@ -241,8 +250,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 diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index 3d8062ae808..a4c4038e829 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -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 @@ -246,8 +256,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 From a10518a2e3d99edb59dbc22b447b448ee485952b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Oct 2012 21:25:14 +0200 Subject: [PATCH 03/15] Comment --- htdocs/install/etape1.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php index 2803d795fc5..0d7a76067d1 100644 --- a/htdocs/install/etape1.php +++ b/htdocs/install/etape1.php @@ -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 '
'.$db->error.'
'; if (! $db->connected) print $langs->trans("BecauseConnectionFailedParametersMayBeWrong").'

'; //print ''; From 92656e2b4f2a68e914f988e8aee6c40b5dc46f41 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Oct 2012 21:37:18 +0200 Subject: [PATCH 04/15] New: Add more info --- build/rpm/dolibarr_fedora.spec | 2 ++ build/rpm/dolibarr_generic.spec | 2 ++ build/rpm/dolibarr_mandriva.spec | 2 ++ build/rpm/dolibarr_opensuse.spec | 2 ++ 4 files changed, 8 insertions(+) diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index e1b8c27d0ed..ce5ae52aad3 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -215,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" diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 5ceb43bc781..01940a7fcf0 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -291,6 +291,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} diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index e52d4724dbb..340fc51a0f0 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -212,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" diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index a4c4038e829..97815a347e1 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -218,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" From 30430953dea56b8a24c82af9de3cec73c47204e6 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 23 Oct 2012 09:30:48 +0200 Subject: [PATCH 05/15] Fix: missing row and col parameters --- htdocs/core/class/html.form.class.php | 18 +- htdocs/core/js/editinplace.js | 459 +++++++++++++------------- htdocs/core/lib/functions.lib.php | 12 +- htdocs/fichinter/fiche.php | 2 +- 4 files changed, 254 insertions(+), 237 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8e03d9b32d8..471948cbd59 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -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=($tmp[1]?$tmp[1]:'8'); + $cols=($tmp[2]?$tmp[2]:'80'); } else if (preg_match('/^ckeditor/',$inputType)) { @@ -320,6 +320,10 @@ class Form if (! empty($savemethod)) $out.= ''."\n"; if (! empty($ext_element)) $out.= ''."\n"; if (! empty($success)) $out.= ''."\n"; + if ($inputType == 'textarea') { + $out.= ''."\n"; + $out.= ''."\n"; + } $out.= ''.$value.''."\n"; $out.= ''.(! empty($editvalue) ? $editvalue : $value).''."\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 .= "\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 (fff2) - ppp - 20,00 Euros/ Unité (20,00 Euros/unité)'); //var_dump($outval); var_dump(utf8_check($outval)); var_dump(json_encode($outval)); - + $i++; } $outselect.=''; diff --git a/htdocs/core/js/editinplace.js b/htdocs/core/js/editinplace.js index c4ea20f0e43..4ccbbd87681 100644 --- a/htdocs/core/js/editinplace.js +++ b/htdocs/core/js/editinplace.js @@ -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 : ' ', - 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 : ' ', + 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 : ' ', - 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 : ' ', + 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 : ' ', - 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 : ' ', + 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 : ' ', - 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 : ' ', + 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); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a576079919e..6416cac14ef 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -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) { diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 7914a475f96..d0b09b22279 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -912,7 +912,7 @@ else if ($id > 0 || ! empty($ref)) print ''; print $form->editfieldkey("Description",'description',$object->description,$object,$user->rights->ficheinter->creer,'textarea'); print ''; - 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 ''; print ''; From 41541e4bc26d0880030b0702737a9c3f96e7053e Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Tue, 23 Oct 2012 10:54:35 +0200 Subject: [PATCH 06/15] add charges and unitcharges in update statement --- htdocs/fourn/class/fournisseur.product.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 5b12f4956d2..3c238369924 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -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.=")"; From 485fab74784afe421d976ddd1c0dae3f5726584a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Oct 2012 23:45:32 +0200 Subject: [PATCH 07/15] Try to fix warning of warning of buildroot and desktop into packaging --- build/launchpad/README | 48 +++++++++++++++++++++++++-------- build/rpm/dolibarr_generic.spec | 11 +++++--- 2 files changed, 44 insertions(+), 15 deletions(-) diff --git a/build/launchpad/README b/build/launchpad/README index cac4aa625b3..e49e1d213b9 100644 --- a/build/launchpad/README +++ b/build/launchpad/README @@ -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 " -- 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="" DEBEMAIL="" -# 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="" sudo pbuilder build /_.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 diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 01940a7fcf0..ffd1e8c5ab5 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -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 @@ -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 From 1999452701c4819a5a34ab77f6f62c6678b9a9c8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Oct 2012 23:49:16 +0200 Subject: [PATCH 08/15] Fix: Avoid warnings --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 471948cbd59..32f76d60eeb 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -292,8 +292,8 @@ class Form { $tmp=explode(':',$inputType); $inputType=$tmp[0]; - $rows=($tmp[1]?$tmp[1]:'8'); - $cols=($tmp[2]?$tmp[2]:'80'); + $rows=(empty($tmp[1])?'8':$tmp[1]); + $cols=(empty($tmp[2])?'80':$tmp[2]); } else if (preg_match('/^ckeditor/',$inputType)) { From aefbebe833d44a9e4e7f4f812b857d40ce04f2f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Oct 2012 02:15:47 +0200 Subject: [PATCH 09/15] Start README to describe usage of OBS packaging platform --- build/obs/README | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 build/obs/README diff --git a/build/obs/README b/build/obs/README new file mode 100644 index 00000000000..0d0e99ffb51 --- /dev/null +++ b/build/obs/README @@ -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 + From 4f45ba8ff68a912e7b318b46612d4a2c33683f1f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 24 Oct 2012 09:56:31 +0200 Subject: [PATCH 10/15] Fix: remove br --- htdocs/core/tpl/objectline_edit.tpl.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index e2dd75494e9..30354476f56 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -87,8 +87,6 @@ $reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action); } - //echo '
'; // Fix: No reason to start a content of the cells with br - // editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $nbrows=ROWS_2; From 87d44c845df555dfcbe36ba3d72d9dd681e702db Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 24 Oct 2012 11:18:15 +0200 Subject: [PATCH 11/15] Fix: restrict the search in the beginning --- htdocs/comm/list.php | 2 +- htdocs/comm/prospect/list.php | 2 +- htdocs/fourn/liste.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/list.php b/htdocs/comm/list.php index 2572c6391ab..346e7a26b66 100755 --- a/htdocs/comm/list.php +++ b/htdocs/comm/list.php @@ -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)."%'"; diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index 45efe02addd..845d43657a6 100755 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -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)."%'"; diff --git a/htdocs/fourn/liste.php b/htdocs/fourn/liste.php index 6ed18f2392c..2812bba9c7e 100644 --- a/htdocs/fourn/liste.php +++ b/htdocs/fourn/liste.php @@ -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)."%'"; From 597ba3e6fce173694e4ba0b10bc4d48e3b026850 Mon Sep 17 00:00:00 2001 From: fhenry Date: Wed, 24 Oct 2012 11:37:00 +0200 Subject: [PATCH 12/15] [ task #581 ] Implement function DDLInfoTable for PostgreSQL db class --- htdocs/core/db/pgsql.class.php | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 7ed1533ee60..16f02559e28 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -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; } From 382f1a54c3b689b04fb9b7691a1e176e551acfe8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 24 Oct 2012 12:18:40 +0200 Subject: [PATCH 13/15] Fix: add key generator in agenda xcal admin page --- htdocs/admin/agenda_xcal.php | 29 ++++++++++++++--- htdocs/paypal/admin/paypal.php | 58 +++++++++++++++++----------------- 2 files changed, 53 insertions(+), 34 deletions(-) diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index 14b21de4fc4..151e116f03a 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -1,6 +1,7 @@ * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -51,12 +52,12 @@ if ($actionsave) if ($i >= 3) { $db->commit(); - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { $db->rollback(); - $mesg = "".$langs->trans("SaveFailed").""; + setEventMessage($langs->trans("SaveFailed"), 'errors'); } } @@ -95,7 +96,10 @@ print ""; print ""; print ''.$langs->trans("PasswordTogetVCalExport").""; -print "global->MAIN_AGENDA_XCAL_EXPORTKEY) . "\" size=\"40\">"; +print ''; +if (! empty($conf->use_javascript_ajax)) + print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"'); +print ''; print " "; print ""; @@ -147,9 +151,24 @@ $message.=$langs->trans("AgendaUrlOptions4",$user->login,$user->login).'
'; $message.=$langs->trans("AgendaUrlOptions5",$user->login,$user->login); print info_admin($message); -dol_htmloutput_mesg($mesg); +if (! empty($conf->use_javascript_ajax)) +{ + print "\n".''; +} -$db->close(); llxFooter(); +$db->close(); ?> diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index c94d49d4da0..a2911a5b3ef 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -71,7 +71,7 @@ if ($action == 'setvalue' && $user->admin) if (! $error) { $db->commit(); - $mesg='
'.$langs->trans("SetupSaved").'
'; + setEventMessage($langs->trans("SetupSaved")); } else { @@ -100,37 +100,13 @@ dol_fiche_head($head, 'paypalaccount', $langs->trans("ModuleSetup")); print $langs->trans("PaypalDesc")."
\n"; -if ($conf->use_javascript_ajax) -{ - print "\n".''; -} - // Test if php curl exist if (! function_exists('curl_version')) { $langs->load("errors"); - $mesg='
'.$langs->trans("ErrorPhpCurlNotInstalled").'
'; + setEventMessage($langs->trans("ErrorPhpCurlNotInstalled"), 'errors'); } -dol_htmloutput_mesg($mesg); print '
'; print '
'; @@ -235,7 +211,8 @@ $var=!$var; print ''; print $langs->trans("SecurityToken").''; print ''; -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 ''; $var=!$var; @@ -256,7 +233,8 @@ print '

'; // Help doc print ''.$langs->trans("InformationToFindParameters","Paypal").':
'; -if ($conf->use_javascript_ajax) print '
'.$langs->trans("ClickHere").'...'; +if (! empty($conf->use_javascript_ajax)) + print ''.$langs->trans("ClickHere").'...'; $realpaypalurl='www.paypal.com'; $sandboxpaypalurl='developer.paypal.com'; @@ -374,7 +352,29 @@ if (! empty($conf->adherent->enabled)) print "
"; print info_admin($langs->trans("YouCanAddTagOnUrl")); -llxFooter(); +if (! empty($conf->use_javascript_ajax)) +{ + print "\n".''; +} + +llxFooter(); $db->close(); ?> From 1c84dbaeec2569d2621a955ea204f27c46e7afca Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 24 Oct 2012 12:27:43 +0200 Subject: [PATCH 14/15] Fix: missing zipcode in url --- htdocs/comm/list.php | 2 +- htdocs/comm/prospect/list.php | 2 +- htdocs/fourn/liste.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/list.php b/htdocs/comm/list.php index 346e7a26b66..2f9008cd0ea 100755 --- a/htdocs/comm/list.php +++ b/htdocs/comm/list.php @@ -144,7 +144,7 @@ if ($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_sale != '') $param.='&search_sale='.$search_sale; diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index 845d43657a6..1d06d28db0f 100755 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -244,7 +244,7 @@ if ($resql) 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 // Store the status filter in the URL if (isSet($search_cstc)) diff --git a/htdocs/fourn/liste.php b/htdocs/fourn/liste.php index 2812bba9c7e..968df23af27 100644 --- a/htdocs/fourn/liste.php +++ b/htdocs/fourn/liste.php @@ -122,7 +122,7 @@ if ($resql) $num = $db->num_rows($resql); $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; print_barre_liste($langs->trans("ListOfSuppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords); From 2f4f427d9eb7788ae2589f5629a28e75e3a7bf55 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Oct 2012 16:25:09 +0200 Subject: [PATCH 15/15] Fix: ldap errors --- htdocs/core/class/ldap.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 9e06d62ff74..568b2a335f3 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -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