From 917423dc0c76e557fac2fcca0c1114ced4cea52b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 26 Nov 2014 14:16:59 +0100 Subject: [PATCH 01/63] add default payment mode select --- htdocs/comm/card.php | 4 ++++ htdocs/fourn/card.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index d0dd842cd7c..7c47c25409d 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -347,6 +347,10 @@ if ($id > 0) print ''; if ($action == 'editmode') { + if (empty($object->mode_reglement_id)) + { + $object->mode_reglement_id=$conf->global->MAIN_PAYMENT_MODE_DEFAULT; + } $form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement_id,'mode_reglement_id'); } else diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 3e234af68cd..30c55c7b130 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -232,6 +232,10 @@ if ($object->fetch($id)) print ''; if ($action == 'editmode') { + if (empty($object->mode_reglement_supplier_id)) + { + $object->mode_reglement_supplier_id=$conf->global->MAIN_PAYMENT_MODE_DEFAULT; + } $form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement_supplier_id,'mode_reglement_supplier_id'); } else From 21f14320cf08f487d8f4b98b83c2e3ad05e2da62 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 27 Nov 2014 05:07:04 +0100 Subject: [PATCH 02/63] Untranslatable token in datepicker --- htdocs/core/datepicker.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/datepicker.php b/htdocs/core/datepicker.php index 7e0333bc5aa..67af3c7e083 100644 --- a/htdocs/core/datepicker.php +++ b/htdocs/core/datepicker.php @@ -39,6 +39,7 @@ require_once '../main.inc.php'; if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang')); // If language was forced on URL by the main.inc.php $langs->load("main"); +$langs->load("agenda"); $right=($langs->trans("DIRECTION")=='rtl'?'left':'right'); $left=($langs->trans("DIRECTION")=='rtl'?'right':'left'); @@ -57,7 +58,7 @@ if (GETPOST('mode') && GETPOST('mode') == 'test') } else { - print 'Calendar'; + print ''.$langs->trans("Calendar").''; } // Define tradMonths javascript array (we define this in datapicker AND in parent page to avoid errors with IE8) From ea70159a7e72cf5057bc5dc95f5ffb50662f6cab Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 27 Nov 2014 05:07:39 +0100 Subject: [PATCH 03/63] Activate the HTML5 Doctype --- htdocs/main.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index c8553f29291..9250384880b 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -959,11 +959,11 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs if (empty($conf->css)) $conf->css = '/theme/eldy/style.css.php'; // If not defined, eldy by default - print ''; + //print ''; //print ''; //print ''; //print ''; - //print ''; + print ''; print "\n"; if (! empty($conf->global->MAIN_USE_CACHE_MANIFEST)) print ''."\n"; else print ''."\n"; From 92c093055ca148d1253ab2f596e00367b915c1b7 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 27 Nov 2014 05:41:57 +0100 Subject: [PATCH 04/63] Add meta balise for viewport & scale --- htdocs/main.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 9250384880b..f9ff80dd366 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -975,6 +975,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs // Displays meta print ''."\n"; // Evite indexation par robots print ''."\n"; + print ''."\n"; // Needed for Responsive Web Design $favicon=dol_buildpath('/theme/'.$conf->theme.'/img/favicon.ico',1); if (! empty($conf->global->MAIN_FAVICON_URL)) $favicon=$conf->global->MAIN_FAVICON_URL; print ''."\n"; From 217cacbc295a16daafb33e48494fa6f1531fac0e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 27 Nov 2014 17:26:06 +0100 Subject: [PATCH 05/63] To avoid over wrighting lines --- htdocs/core/lib/pdf.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 3223412dc5f..bc0a9e71f38 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -897,7 +897,7 @@ function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$w,$h,$al if (! empty($linkedobject["date_title"]) && ! empty($linkedobject["date_value"])) { - $posy+=3; + $posy+=7; $pdf->SetXY($posx,$posy); $pdf->MultiCell($w, $h, $linkedobject["date_title"].' : '.$linkedobject["date_value"], '', $align); } From b98c0a3208098512a0b9645b578c0a83bfaff2ba Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 27 Nov 2014 20:32:29 +0100 Subject: [PATCH 06/63] Login - Better presentation with RWD --- htdocs/core/tpl/login.tpl.php | 9 +++------ htdocs/theme/eldy/style.css.php | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 23d8dd4f326..844f874a711 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -67,6 +67,8 @@ $(document).ready(function () { +
+ @@ -76,7 +78,7 @@ $(document).ready(function () {
-
+
@@ -130,11 +132,6 @@ if (! empty($hookmanager->resArray['options'])) { -
- - - -
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 5ac8a76fb53..08c5fbcf2ff 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -849,7 +849,7 @@ form#login { vertical-align: middle; } .login_table_title { - max-width: 540px; + max-width: 320px; color: #888888; text-shadow: 1px 1px 1px #FFF; } @@ -863,7 +863,7 @@ form#login { padding-right:6px; padding-top:12px; padding-bottom:12px; - max-width: 540px; + max-width: 320px; background-color: #FFFFFF; From a81c4830613a12700d6cb907312fa28068858db4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Nov 2014 02:14:25 +0100 Subject: [PATCH 07/63] Revert "Update objectline_create.tpl.php" This reverts commit fdac53bfca37b034a8decfb4f0e568cbc93a5b27. --- htdocs/core/tpl/objectline_create.tpl.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 6e9b3251fbd..a51a6505416 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -107,9 +107,7 @@ else { print ''; } else {*/ - echo ''; /* if (empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans("Type"); else if (! empty($forceall) || (! empty($conf->product->enabled) && ! empty($conf->service->enabled))) echo $langs->trans("FreeLineOfType"); @@ -125,7 +123,7 @@ else { { echo '
'; echo ' '; - echo ''; echo ' '; $filtertype=''; From c3d66b037dc0cc13e078b7357d1f095413091ff9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 28 Nov 2014 10:35:02 +0100 Subject: [PATCH 08/63] Revert "add default payment mode select" This reverts commit 917423dc0c76e557fac2fcca0c1114ced4cea52b. --- htdocs/comm/card.php | 4 ---- htdocs/fourn/card.php | 4 ---- 2 files changed, 8 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 7c47c25409d..d0dd842cd7c 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -347,10 +347,6 @@ if ($id > 0) print '
'; -print ''; + print "
'; if ($action == 'editmode') { - if (empty($object->mode_reglement_id)) - { - $object->mode_reglement_id=$conf->global->MAIN_PAYMENT_MODE_DEFAULT; - } $form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement_id,'mode_reglement_id'); } else diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 30c55c7b130..3e234af68cd 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -232,10 +232,6 @@ if ($object->fetch($id)) print ''; if ($action == 'editmode') { - if (empty($object->mode_reglement_supplier_id)) - { - $object->mode_reglement_supplier_id=$conf->global->MAIN_PAYMENT_MODE_DEFAULT; - } $form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement_supplier_id,'mode_reglement_supplier_id'); } else From 15311fb643fc0d44524ab420abc5809d56b83eb8 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 28 Nov 2014 12:41:53 +0100 Subject: [PATCH 09/63] form should not be inside table --- htdocs/accountancy/admin/importaccounts.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/admin/importaccounts.php b/htdocs/accountancy/admin/importaccounts.php index 9e5c59f4555..6358bf353f3 100644 --- a/htdocs/accountancy/admin/importaccounts.php +++ b/htdocs/accountancy/admin/importaccounts.php @@ -120,6 +120,9 @@ if ($result) { $i = 0; print_barre_liste($langs->trans("ImportAccount"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines); + print '
' . "\n"; + print ''; + print ''; print ''; print ''; @@ -132,9 +135,6 @@ if ($result) { $form = new Form($db); $htmlacc = new FormVentilation($db); - print '' . "\n"; - print ''; - $var = true; while ( $i < min($num_lines, $limit) ) { $objp = $db->fetch_object($result); From d156e1ba82217abba188ac2b645243a76a804773 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 28 Nov 2014 12:51:08 +0100 Subject: [PATCH 10/63] form should be outside table --- htdocs/accountancy/admin/journaux.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/journaux.php b/htdocs/accountancy/admin/journaux.php index f7507cda234..84c8042027a 100644 --- a/htdocs/accountancy/admin/journaux.php +++ b/htdocs/accountancy/admin/journaux.php @@ -112,8 +112,8 @@ foreach ( $list as $key ) { print ''; } -print ''; print "
' . $langs->trans("accountingaccount") . '' . $langs->trans("label") . '
\n"; +print ''; print '
'; From 64260cde726df9979899922b5c04598d77296beb Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 29 Nov 2014 07:07:27 +0100 Subject: [PATCH 11/63] Add button in admin->GUISetup to activate Html5 --- htdocs/admin/ihm.php | 61 +++++++++++++++++++++++------------ htdocs/langs/en_US/admin.lang | 3 +- htdocs/main.inc.php | 4 +-- 3 files changed, 45 insertions(+), 23 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 23e7cc96363..f2312ee042f 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -53,29 +53,30 @@ $searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name if ($action == 'update') { - dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["main_lang_default"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["main_multilangs"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["main_lang_default"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["main_multilangs"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_ACTIVATE_HTML5", $_POST["MAIN_ACTIVATE_HTML5"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_SEARCHFORM_SOCIETE", $_POST["MAIN_SEARCHFORM_SOCIETE"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE",$_POST["MAIN_SEARCHFORM_PRODUITSERVICE"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_SEARCHFORM_SOCIETE", $_POST["MAIN_SEARCHFORM_SOCIETE"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE", $_POST["MAIN_SEARCHFORM_PRODUITSERVICE"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER",$_POST["MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_SEARCHFORM_ADHERENT",$_POST["MAIN_SEARCHFORM_ADHERENT"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_SEARCHFORM_ADHERENT", $_POST["MAIN_SEARCHFORM_ADHERENT"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities - dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"],'chaine',0,'',0); // Param for all entities + dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities + dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"],'chaine',0,'',0); // Param for all entities // This one is not always defined if (isset($_POST["MAIN_USE_PREVIEW_TABS"])) dolibarr_set_const($db, "MAIN_USE_PREVIEW_TABS", $_POST["MAIN_USE_PREVIEW_TABS"],'chaine',0,'',$conf->entity); @@ -119,7 +120,7 @@ if ($action == 'edit') // Edit print_fiche_titre($langs->trans("Language"),'','').'
'; print ''; - print ''; + print ''; print ''; print ''; @@ -172,6 +173,17 @@ if ($action == 'edit') // Edit print ''; print ''; print ''; + + // Activate Html5 - Developement - Only available on Eldy template + if ($conf->global->MAIN_FEATURES_LEVEL == 2 || ! empty($conf->global->MAIN_ACTIVATE_HTML5)) + { + $var=!$var; + print ''; + print ''; + print ''; + } // Max size of lists $var=!$var; @@ -351,6 +363,15 @@ else // Show print ''; print ''; print ""; + + // Activate Html5 - Developement - Only available on Eldy template + if ($conf->global->MAIN_FEATURES_LEVEL == 2 || ! empty($conf->global->MAIN_ACTIVATE_HTML5)) + { + $var=!$var; + print ''; + print ''; + print ""; + } $var=!$var; print ''; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a524ff8a5fe..4aee36d73ab 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -887,7 +887,8 @@ MessageLogin=Login page message PermanentLeftSearchForm=Permanent search form on left menu DefaultLanguage=Default language to use (language code) EnableMultilangInterface=Enable multilingual interface -EnableShowLogo=Show logo on left menu +EnableShowLogo=Show logo on left menu +EnableHtml5=Enable Html5 (Developement - Only available on Eldy template) SystemSuccessfulyUpdated=Your system has been updated successfully CompanyInfo=Company/foundation information CompanyIds=Company/foundation identities diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 87b69b56443..199436eae65 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -959,11 +959,11 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs if (empty($conf->css)) $conf->css = '/theme/eldy/style.css.php'; // If not defined, eldy by default - //print ''; + if (empty($conf->global->MAIN_ACTIVATE_HTML5)) print ''; //print ''; //print ''; //print ''; - print ''; + if ($conf->global->MAIN_FEATURES_LEVEL == 2 || ! empty($conf->global->MAIN_ACTIVATE_HTML5)) print ''; // Html5 - Developement - Only available on Eldy template print "\n"; if (! empty($conf->global->MAIN_USE_CACHE_MANIFEST)) print ''."\n"; else print ''."\n"; From c27e2676e3b79db13af1b0f411afc6d14f2ad75c Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 29 Nov 2014 07:08:35 +0100 Subject: [PATCH 12/63] Modify presentation of login page --- htdocs/core/tpl/login.tpl.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index c34894e49c3..a12a960aaec 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -67,6 +67,11 @@ $(document).ready(function () { +
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameters").''.$langs->trans("Value").' 
 
'.$langs->trans("EnableHtml5").''; + print $form->selectyesno('MAIN_ACTIVATE_HTML5',$conf->global->MAIN_ACTIVATE_HTML5,1); + print ' 
'.$langs->trans("EnableShowLogo").'' . yn($conf->global->MAIN_SHOW_LOGO) . ' 
'.$langs->trans("EnableHtml5").'' . yn($conf->global->MAIN_ACTIVATE_HTML5) . ' 
'.$langs->trans("DefaultMaxSizeList").'' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '
@@ -74,12 +79,6 @@ $(document).ready(function () {
-
\n"; print '

'; - +print ''; llxFooter(); $db->close(); \ No newline at end of file From b33612d2311ebbc3242a39319188908479096229 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 1 Dec 2014 12:09:05 +0100 Subject: [PATCH 17/63] close form should be outside button --- htdocs/accountancy/admin/journaux.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/journaux.php b/htdocs/accountancy/admin/journaux.php index 84c8042027a..d97af918f90 100644 --- a/htdocs/accountancy/admin/journaux.php +++ b/htdocs/accountancy/admin/journaux.php @@ -113,9 +113,9 @@ foreach ( $list as $key ) { } print "\n"; -print ''; print '
'; +print ''; print '
'; From d7dcd153f0d519a0e0d4c998b7810d2cde785246 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 1 Dec 2014 12:21:54 +0100 Subject: [PATCH 18/63] missing close form --- htdocs/accountancy/bookkeeping/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 608c62cf1d0..a24ed34e052 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -358,7 +358,8 @@ else print ''; print ''; } - print ""; + print ''; + print ''; } } } From e18196eac6052d1f67ffa4c2892f35572988533c Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 1 Dec 2014 16:50:27 +0100 Subject: [PATCH 19/63] to avoid undefined method --- htdocs/accountancy/class/bookkeeping.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 6291790d008..9d0de035223 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -27,7 +27,7 @@ /** * Class to manage accountancy book keeping */ -class BookKeeping +class BookKeeping extends CommonObject { var $db; var $error; From f6ab7ca0c96f69822f10c5173eb71d062294f6bb Mon Sep 17 00:00:00 2001 From: aspangaro Date: Tue, 2 Dec 2014 20:42:47 +0100 Subject: [PATCH 20/63] Typo --- htdocs/admin/ihm.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index fe375d7668c..358bf486607 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -117,7 +117,7 @@ if ($action == 'edit') // Edit print_fiche_titre($langs->trans("Language"),'','').'
'; print ''; - print ''; + print ''; print ''; print ''; @@ -159,7 +159,7 @@ if ($action == 'edit') // Edit // Other print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameters").''.$langs->trans("Value").' 
'; - print ''; + print ''; print ''; print ''; @@ -283,7 +283,7 @@ else // Show // Language print_fiche_titre($langs->trans("Language"),'','').'
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameters").''.$langs->trans("Value").' 
'; - print ''; + print ''; $var=!$var; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'.$langs->trans("Parameters").''.$langs->trans("Value").' 
'.$langs->trans("DefaultLanguage").''; @@ -327,7 +327,7 @@ else // Show // Other $var=true; print ''; - print ''; + print ''; $var=!$var; print ''; From 5a05d4a4b8efa4d546e84970b491267f0649585f Mon Sep 17 00:00:00 2001 From: aspangaro Date: Tue, 2 Dec 2014 20:59:00 +0100 Subject: [PATCH 21/63] Untranslatable token Calendar in datepicker --- htdocs/core/datepicker.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/datepicker.php b/htdocs/core/datepicker.php index 7e0333bc5aa..67af3c7e083 100644 --- a/htdocs/core/datepicker.php +++ b/htdocs/core/datepicker.php @@ -39,6 +39,7 @@ require_once '../main.inc.php'; if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang')); // If language was forced on URL by the main.inc.php $langs->load("main"); +$langs->load("agenda"); $right=($langs->trans("DIRECTION")=='rtl'?'left':'right'); $left=($langs->trans("DIRECTION")=='rtl'?'right':'left'); @@ -57,7 +58,7 @@ if (GETPOST('mode') && GETPOST('mode') == 'test') } else { - print 'Calendar'; + print ''.$langs->trans("Calendar").''; } // Define tradMonths javascript array (we define this in datapicker AND in parent page to avoid errors with IE8) From 9e1b0d1abceeaebd96cfeac2c623dd16cec10eeb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Dec 2014 15:09:47 +0100 Subject: [PATCH 22/63] Prepare 3.5.6 --- ChangeLog | 8 ++++++++ build/debian/changelog | 7 +++++++ build/exe/doliwamp/doliwamp.iss | 4 ++-- build/makepack-howto.txt | 1 - build/rpm/dolibarr_fedora.spec | 3 +++ build/rpm/dolibarr_generic.spec | 3 +++ build/rpm/dolibarr_mandriva.spec | 3 +++ build/rpm/dolibarr_opensuse.spec | 3 +++ htdocs/filefunc.inc.php | 2 +- 9 files changed, 30 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index bab2b804a5c..7a65eef7fc9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,14 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 +Fix: Can't update phone_pro from web service +Fix: Some security holes. +Fix: copy extrafields when creating order from proposal. +Fix: report on action was not filtering by environment. +Fix: Avoid missing class error. +Fix: Add function dolEscapeXML. +Fix: Bad days and month reported by function. +Fix: Bad margin calculation. ***** ChangeLog for 3.5.5 compared to 3.5.4 ***** Fix: Holiday module was broken. Initializaion of amount of holidays failed. diff --git a/build/debian/changelog b/build/debian/changelog index aeba0dfa190..e1f40514d9a 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -1,3 +1,10 @@ +dolibarr (3.5.6-3) unstable; urgency=low + + [ Laurent Destailleur (eldy) ] + * New upstream release. + + -- Laurent Destailleur (eldy) Tue, 2 Dec 2014 12:00:00 +0100 + dolibarr (3.5.5-3) unstable; urgency=low [ Laurent Destailleur (eldy) ] diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 5ff4e7770b0..f06ec591712 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -17,9 +17,9 @@ ; ----- Change this ----- AppName=DoliWamp ; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x -AppVerName=DoliWamp-3.5.5 +AppVerName=DoliWamp-3.5.6 ; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x -OutputBaseFilename=DoliWamp-3.5.5 +OutputBaseFilename=DoliWamp-3.5.6 ; ----- End of change ;OutputManifestFile=build\doliwampbuild.log ; Define full path from which all relative path are defined diff --git a/build/makepack-howto.txt b/build/makepack-howto.txt index 7ab0da72138..24e5f809185 100644 --- a/build/makepack-howto.txt +++ b/build/makepack-howto.txt @@ -13,7 +13,6 @@ beta version of Dolibarr, step by step. - Update version number with x.y.z-w in build/debian/changelog - Update version number with x.y.z-w in build/exe/doliwamp/doliwamp.iss - Update version number with x.y.z-w in build/rpm/*.spec -- Update version number with x.y in build/doxygen/dolibarr-doxygen.doxyfile - Commit all changes. - Add a Tag (x.y.betaz_YYYYMMDD) and push it: git push --tags - Create a branch (x.y). diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 92b097801b4..242d19239a5 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -331,6 +331,9 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Tue Dec 2 2014 Laurent Destailleur 3.5.6-0.3 +- Upstream release + * Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3 - Upstream release diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index b2b7e745b34..d8e8349f9fb 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -567,6 +567,9 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Tue Dec 2 2014 Laurent Destailleur 3.5.6-0.3 +- Upstream release + * Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3 - Upstream release diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index 658601980f7..9238530a308 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -336,6 +336,9 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Tue Dec 2 2014 Laurent Destailleur 3.5.6-0.3 +- Upstream release + * Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3 - Upstream release diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index d11630c3bb9..94ce0e7e549 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -347,6 +347,9 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Tue Dec 2 2014 Laurent Destailleur 3.5.6-0.3 +- Upstream release + * Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3 - Upstream release diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 95916901c6d..9705eee2028 100755 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -29,7 +29,7 @@ * \brief File that include conf.php file and commons lib like functions.lib.php */ -if (! defined('DOL_VERSION')) define('DOL_VERSION','3.5.5'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','3.5.6'); if (! defined('EURO')) define('EURO',chr(128)); // Define syslog constants From bff65fc6b479f744c34af7a3020d50c66ae9a731 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Dec 2014 01:25:18 +0100 Subject: [PATCH 23/63] Fix: starting with var with always same color --- htdocs/comm/card.php | 2 +- htdocs/core/class/html.formfile.class.php | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index d0dd842cd7c..8a4df52748c 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -530,6 +530,7 @@ if ($id > 0) while ($i < $num && $i < $MAXLIST) { $objp = $db->fetch_object($resql); + $var=!$var; print ""; print '\n"; print ''; print ''; - $var=!$var; $i++; } $db->free($resql); diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 824bd4f3ae9..2bcfd36bdde 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -133,9 +133,10 @@ class FormFile if ($perm) { $langs->load('other'); - $out .= ' ('.$langs->trans("MaxSize").': '.$max.' '.$langs->trans("Kb"); - $out .= ' '.info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1); - $out .= ')'; + //$out .= ' ('.$langs->trans("MaxSize").': '.$max.' '.$langs->trans("Kb"); + $out .= ' '; + $out.=info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1); + //$out .= ')'; } } else @@ -778,7 +779,7 @@ class FormFile if ($nboffiles > 0) include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; - $var=false; + $var=true; foreach($filearray as $key => $file) // filearray must be only files here { if ($file['name'] != '.' From ceba894d5748271162e7474b1184a2c6ea8edd97 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Dec 2014 13:26:47 +0100 Subject: [PATCH 24/63] Start to work on new generation combo box. --- htdocs/comm/propal.php | 14 +- htdocs/core/class/conf.class.php | 3 + htdocs/core/class/html.form.class.php | 38 +++- htdocs/core/class/html.formcompany.class.php | 192 ++++++++---------- htdocs/core/lib/ajax.lib.php | 31 +-- htdocs/core/tpl/contacts.tpl.php | 14 +- .../jquery/plugins/select2/select2.js | 4 +- htdocs/langs/en_US/admin.lang | 2 + htdocs/projet/tasks/contact.php | 5 +- htdocs/public/test/test_forms.php | 9 +- htdocs/societe/admin/societe.php | 8 +- 11 files changed, 161 insertions(+), 159 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index aa75945f0ea..5feb7769a43 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1151,6 +1151,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal-> } } + /* * View */ @@ -1236,12 +1237,13 @@ if ($action == 'create') print '
'; print ''; print ''; - if ($origin != 'project' && $originid) { print ''; print ''; } + dol_fiche_head(); + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("EnableShowLogo").'' . yn($conf->global->MAIN_SHOW_LOGO) . '
'.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.''."\n"; if ( ($db->jdate($objp->dp) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 ) @@ -539,7 +540,6 @@ if ($id > 0) print ''.dol_print_date($db->jdate($objp->dp),'day')."'.price($objp->total_ht).''.$propal_static->LibStatut($objp->fk_statut,5).'
'; // Reference @@ -1435,16 +1437,13 @@ if ($action == 'create') print "
\n"; - print '
'; - - /* * Combobox pour la fonction de copie */ if (empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) print ''; - if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE) || ! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print ''; + if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE) || ! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print '
'; if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) { // For backward compatibility @@ -1514,9 +1513,10 @@ if ($action == 'create') } print ''; } - if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE) || ! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print '

'; - + if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE) || ! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print '
'; + dol_fiche_end(); + $langs->load("bills"); print '
'; print ''; diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index e079efb8ecc..ece24bfee34 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -432,6 +432,9 @@ class Conf // Define list of limited modules if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,facture,categorie,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda,adherent'; // '' means 'all'. Note that contact is added here as it should be a module later. + // Enable select2 + if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)) $conf->global->MAIN_USE_JQUERY_MULTISELECT='select2'; + // Timeouts if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) $this->global->MAIN_USE_CONNECT_TIMEOUT=10; if (empty($this->global->MAIN_USE_RESPONSE_TIMEOUT)) $this->global->MAIN_USE_RESPONSE_TIMEOUT=30; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 14b7c78cc7d..08bc3b4c85e 100755 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -825,9 +825,22 @@ class Form } else { + if (! $forcecombo) + { + $out.=' + '; + } + if (count($events)) // Add management of event { - print ''; } else { @@ -4119,10 +4142,11 @@ class Form * @param int $disabled Html select box is disabled * @param int $sort 'ASC' or 'DESC' = Sort on label, '' or 'NONE' = Do not sort * @param string $morecss Add more class to css styles + * @param int $addjscombo Add js combo * @return string HTML select string. * @see multiselectarray */ - static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='') + static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0) { global $conf, $langs; @@ -4131,13 +4155,15 @@ class Form $out=''; // Add code for jquery to use multiselect - if (empty($conf->dol_use_jmobile) && (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))) + if ($addjscombo && empty($conf->dol_use_jmobile) && (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))) { $tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT; - $out=' + $out.=' '; diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index e45fffff759..413dc3d1544 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -520,118 +520,105 @@ class FormCompany * @param string $htmlname Name of HTML form * @param array $limitto Disable answers that are not id in this array list * @param int $forceid This is to force another object id than object->id - * @param array $events More js events option. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @param string $moreparam String with more param to add into url when noajax search is used. * @return int The selected third party ID */ - function selectCompaniesForNewContact($object, $var_id, $selected='', $htmlname='newcompany', $limitto='', $forceid=0, $events=array(), $moreparam='') + function selectCompaniesForNewContact($object, $var_id, $selected='', $htmlname='newcompany', $limitto='', $forceid=0, $moreparam='') { global $conf, $langs; - // On recherche les societes - $sql = "SELECT s.rowid, s.nom as name FROM"; - $sql.= " ".MAIN_DB_PREFIX."societe as s"; - $sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; - if ($selected && $conf->use_javascript_ajax && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) $sql.= " AND s.rowid = ".$selected; + if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) + { + // Use Ajax search + $minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2); + + $socid=0; $name=''; + if ($selected > 0) + { + $tmpthirdparty=new Societe($this->db); + $result = $tmpthirdparty->fetch($selected); + if ($result > 0) + { + $socid = $selected; + $name = $tmpthirdparty->name; + } + } + + // Refresh contacts list on thirdparty list change + $htmloption=''; + + $events=array(); + $events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); + if (count($events)) // If there is some ajax events to run once selection is done, we add code here to run events + { + print ''; + } + + print "\n".''."\n"; + print ''; + print ajax_autocompleter(($socid?$socid:-1),$htmlname,DOL_URL_ROOT.'/societe/ajaxcompanies.php','',$minLength); + return $socid; + } else { + // Search to list thirdparties + $sql = "SELECT s.rowid, s.nom as name FROM"; + $sql.= " ".MAIN_DB_PREFIX."societe as s"; + $sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; // For ajax search we limit here. For combo list, we limit later - if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT - && is_array($limitto) && count($limitto)) + if (is_array($limitto) && count($limitto)) { $sql.= " AND s.rowid IN (".join(',',$limitto).")"; } - } - $sql.= " ORDER BY s.nom ASC"; + $sql.= " ORDER BY s.nom ASC"; - $resql = $this->db->query($sql); - if ($resql) - { - if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) + $resql = $this->db->query($sql); + if ($resql) { - // Use Ajax search - $minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2); - - $socid=0; - if ($selected) - { - $obj = $this->db->fetch_object($resql); - $socid = $obj->rowid?$obj->rowid:''; - } - - // We recall a page after a small delay when a new input has been selected - $htmloption=''; - //$javaScript = "window.location=\'".$_SERVER['PHP_SELF']."?".$var_id."=".($forceid>0?$forceid:$object->id)."&".$htmlname."=\' + document.getElementById(\'".$htmlname."\').value;"; - //$htmloption.= 'onChange="ac_delay(\''.$javaScript.'\',\'500\');"'; // When we select with mouse - //$htmloption.= 'onKeyUp="if (event.keyCode== 13) { ac_delay(\''.$javaScript.'\',\'500\'); }"'; // When we select with keyboard - - if (count($events)) // If there is some ajax events to run once selection is done, we add code here to run events - { - print ''; - } - - print "\n".''."\n"; - //print ''; - //print ''; - //print ''; - //print '
'; - if ($obj->rowid == 0) - { - print ''; - } - else - { - print ''; - } - print ajax_autocompleter(($socid?$socid:-1),$htmlname,DOL_URL_ROOT.'/societe/ajaxcompanies.php','',$minLength); - //print '
'; - //print "\n"; - return $socid; - } - else - { - // No Ajax search print '\n"; return $firstCompany; } - } - else - { - dol_print_error($this->db); + else + { + dol_print_error($this->db); + print 'Error sql'; + } } } diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 3966b29f874..df7c09d9274 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -323,34 +323,23 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0) if (! empty($conf->browser->phone)) return ''; // combobox disabled for smartphones (does not works) if (! empty($conf->global->MAIN_DISABLE_AJAX_COMBOX)) return ''; - /* Some properties for combobox: - minLengthToAutocomplete: 2, - comboboxContainerClass: "comboboxContainer", - comboboxValueContainerClass: "comboboxValueContainer", - comboboxValueContentClass: "comboboxValueContent", - comboboxDropDownClass: "comboboxDropDownContainer", - comboboxDropDownButtonClass: "comboboxDropDownButton", - comboboxDropDownItemClass: "comboboxItem", - comboboxDropDownItemHoverClass: "comboboxItemHover", - comboboxDropDownGroupItemHeaderClass: "comboboxGroupItemHeader", - comboboxDropDownGroupItemContainerClass: "comboboxGroupItemContainer", - animationType: "slide", - width: "500px" */ - $msg = ' -
+