Fix: ajax_combobox function must be included before called.

New: Feature of module survey are now localized into top menu "Tools".
This commit is contained in:
Laurent Destailleur 2014-03-26 16:02:22 +01:00
parent c45f509984
commit 62a990d6cc
6 changed files with 24 additions and 18 deletions

View File

@ -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 '<form name="add" action="' . $_SERVER ["PHP_SELF"] . '" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<input type="hidden" name="action" value="add">';
if ($soc->id > 0)
print '<input type="hidden" name="socid" value="' . $soc->id . '">' . "\n";
if ($soc->id > 0) print '<input type="hidden" name="socid" value="' . $soc->id . '">' . "\n";
print '<input name="facnumber" type="hidden" value="provisoire">';
print '<input name="ref_client" type="hidden" value="' . $ref_client . '">';
print '<input name="ref_int" type="hidden" value="' . $ref_int . '">';

View File

@ -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);
}

View File

@ -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

View File

@ -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

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
/* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* 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',

View File

@ -243,7 +243,7 @@ if (!$object->fk_user_creat) {
{
print '<input type="text" name="nouvelleadresse" size="40" value="'.$object->mail_admin.'">';
}
else print dol_print_email($object->mail_admin);
else print dol_print_email($object->mail_admin, 0, 0, 1);
print '</td></tr>';
}
@ -382,6 +382,8 @@ if ($object->allow_comments) {
print '</form>';
print '<br>';
llxFooterSurvey();
$db->close();