From 62a990d6cccdcead831d1f6150467b7ee7495192 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Mar 2014 16:02:22 +0100 Subject: [PATCH] Fix: ajax_combobox function must be included before called. New: Feature of module survey are now localized into top menu "Tools". --- htdocs/compta/facture.php | 7 +++--- htdocs/core/class/extrafields.class.php | 2 ++ htdocs/core/class/html.form.class.php | 3 ++- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/modules/modOpenSurvey.class.php | 24 ++++++++++----------- htdocs/opensurvey/card.php | 4 +++- 6 files changed, 24 insertions(+), 18 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 083a2e0518e..a2be9d478f2 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1841,7 +1841,9 @@ if ($action == 'create') } $absolute_discount = $soc->getAvailableDiscounts(); - if (! empty($conf->use_javascript_ajax)) { + if (! empty($conf->use_javascript_ajax)) + { + require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; print ajax_combobox('fac_replacement'); print ajax_combobox('fac_avoir'); } @@ -1849,8 +1851,7 @@ if ($action == 'create') print '
'; print ''; print ''; - if ($soc->id > 0) - print '' . "\n"; + if ($soc->id > 0) print '' . "\n"; print ''; print ''; print ''; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index c35fad153b4..b522e811515 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -674,6 +674,7 @@ class ExtraFields $out = ''; if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && ! $forcecombo) { + include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; $out.= ajax_combobox('options_'.$key.$keyprefix, $event, $conf->global->COMPANY_USE_SEARCH_TO_SELECT); } @@ -693,6 +694,7 @@ class ExtraFields $out = ''; if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && ! $forcecombo) { + include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; $out.= ajax_combobox('options_'.$key.$keyprefix, $event, $conf->global->COMPANY_USE_SEARCH_TO_SELECT); } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3574c841339..9a6e71113de 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -800,7 +800,8 @@ class Form { if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && ! $forcecombo) { - $out.= ajax_combobox($htmlname, $events, $conf->global->COMPANY_USE_SEARCH_TO_SELECT); + include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; + $out.= ajax_combobox($htmlname, $events, $conf->global->COMPANY_USE_SEARCH_TO_SELECT); } // Construct $out and $outarray diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index efcbff69a13..309b7df529c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1151,7 +1151,7 @@ function dol_print_url($url,$target='_blank',$max=32) * @param string $email EMail to show (only email, without 'Name of recipient' before) * @param int $cid Id of contact if known * @param int $socid Id of third party if known - * @param int $addlink 0=no link to create action + * @param int $addlink 0=no link, 1=email has a html email link (+ link to create action if constant AGENDA_ADDACTIONFOREMAIL is on) * @param int $max Max number of characters to show * @param int $showinvalid Show warning if syntax email is wrong * @return string HTML Link diff --git a/htdocs/core/modules/modOpenSurvey.class.php b/htdocs/core/modules/modOpenSurvey.class.php index b8c38d1fb45..e780b235677 100644 --- a/htdocs/core/modules/modOpenSurvey.class.php +++ b/htdocs/core/modules/modOpenSurvey.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2014 Marcos García +/* Copyright (C) 2013-2014 Laurent Destailleur + * Copyright (C) 2014 Marcos García * * 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 @@ -76,7 +76,7 @@ class modOpenSurvey extends DolibarrModules $this->depends = array(); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled $this->phpmin = array(4,1); // Minimum version of PHP required by module - $this->need_dolibarr_version = array(2,4); // Minimum version of Dolibarr required by module + $this->need_dolibarr_version = array(3,4,0); // Minimum version of Dolibarr required by module // Constants $this->const = array(); // List of parameters @@ -121,7 +121,7 @@ class modOpenSurvey extends DolibarrModules // Main menu entries $this->menus = array(); // List of menus to add $r=0; - + /* $this->menu[$r]=array( 'fk_menu'=>0, // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'top', 'titre'=>'Surveys', @@ -133,14 +133,14 @@ class modOpenSurvey extends DolibarrModules 'perms'=>'$user->rights->opensurvey->read', 'target'=>'', 'user'=>0); - $r++; + $r++;*/ - $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=opensurvey', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=tools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', 'titre'=>'Survey', - 'mainmenu'=>'opensurvey', + 'mainmenu'=>'tools', 'leftmenu'=>'opensurvey', - 'url'=>'/opensurvey/index.php?mainmenu=opensurvey&leftmenu=opensurvey', + 'url'=>'/opensurvey/index.php?mainmenu=tools&leftmenu=opensurvey', 'langs'=>'opensurvey', 'position'=>200, 'enabled'=>'$conf->opensurvey->enabled', // Define condition to show or hide menu entry. Use '$conf->NewsSubmitter->enabled' if entry must be visible if module is enabled. @@ -149,10 +149,10 @@ class modOpenSurvey extends DolibarrModules 'user'=>0); $r++; - $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=opensurvey,fk_leftmenu=opensurvey', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=tools,fk_leftmenu=opensurvey', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', 'titre'=>'NewSurvey', - 'mainmenu'=>'opensurvey', + 'mainmenu'=>'tools', 'leftmenu'=>'opensurvey_new', 'url'=>'/opensurvey/wizard/index.php', 'langs'=>'opensurvey', @@ -163,10 +163,10 @@ class modOpenSurvey extends DolibarrModules 'user'=>0); $r++; - $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=opensurvey,fk_leftmenu=opensurvey', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=tools,fk_leftmenu=opensurvey', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', 'titre'=>'List', - 'mainmenu'=>'opensurvey', + 'mainmenu'=>'tools', 'leftmenu'=>'opensurvey_list', 'url'=>'/opensurvey/list.php', 'langs'=>'opensurvey', diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 3bf55fbe847..afbf0c2b92d 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -243,7 +243,7 @@ if (!$object->fk_user_creat) { { print ''; } - else print dol_print_email($object->mail_admin); + else print dol_print_email($object->mail_admin, 0, 0, 1); print ''; } @@ -382,6 +382,8 @@ if ($object->allow_comments) { print ''; +print '
'; + llxFooterSurvey(); $db->close();