Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2012-11-20 12:33:24 +01:00
commit a62583e987
13 changed files with 96 additions and 94 deletions

View File

@ -48,7 +48,8 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
var options = '.json_encode($ajaxoptions).'; var options = '.json_encode($ajaxoptions).';
// Remove product id before select another product // Remove product id before select another product
$("input#search_'.$htmlname.'").change(function() { // use keyup instead change to avoid loosing the product id
$("input#search_'.$htmlname.'").keyup(function() {
$("#'.$htmlname.'").val("").trigger("change"); $("#'.$htmlname.'").val("").trigger("change");
}); });
// Check when keyup // Check when keyup
@ -163,7 +164,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
}).data( "autocomplete" )._renderItem = function( ul, item ) { }).data( "autocomplete" )._renderItem = function( ul, item ) {
return $( "<li></li>" ) return $( "<li></li>" )
.data( "item.autocomplete", item ) .data( "item.autocomplete", item )
.append( \'<a href="#"><span class="tag">\' + item.label + "</span></a>" ) .append( \'<a><span class="tag">\' + item.label + "</span></a>" )
.appendTo(ul); .appendTo(ul);
}; };
});'; });';

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr> /* Copyright (C) 2010-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* *
@ -50,13 +50,10 @@
<td colspan="<?php echo $colspan; ?>">&nbsp;</td> <td colspan="<?php echo $colspan; ?>">&nbsp;</td>
</tr> </tr>
<form name="addproduct" id="addproduct" <form name="addproduct" id="addproduct" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id; ?>#add" method="POST">
action="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id; ?>#add" <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
method="POST"> <input type="hidden" name="action" value="addline" />
<input type="hidden" name="token" <input type="hidden" name="id" value="<?php echo $this->id; ?>" />
value="<?php echo $_SESSION['newtoken']; ?>" /> <input type="hidden"
name="action" value="addline" /> <input type="hidden" name="id"
value="<?php echo $this->id; ?>" />
<tr <?php echo $bcnd[$var]; ?>> <tr <?php echo $bcnd[$var]; ?>>
<td<?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> <td<?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
@ -77,8 +74,9 @@
// Editor wysiwyg // Editor wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$nbrows=ROWS_2; $nbrows=ROWS_2;
$enabled=(! empty($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0);
if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
$doleditor=new DolEditor('dp_desc',$_POST["dp_desc"],'',100,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); $doleditor=new DolEditor('dp_desc',GETPOST('dp_desc'),'',100,'dolibarr_details','',false,true,$enabled,$nbrows,70);
$doleditor->Create(); $doleditor->Create();
?> ?>
</td> </td>

View File

@ -78,7 +78,7 @@ jQuery(document).ready(function() {
if (is_object($hookmanager)) if (is_object($hookmanager))
{ {
$parameters=array('fk_parent_line'=>$_POST["fk_parent_line"]); $parameters=array('fk_parent_line'=>GETPOST('fk_parent_line','int'));
$reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); $reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
} }
@ -87,8 +87,9 @@ jQuery(document).ready(function() {
// Editor wysiwyg // Editor wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$nbrows=ROWS_2; $nbrows=ROWS_2;
$enabled=(! empty($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0);
if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
$doleditor=new DolEditor('np_desc',$_POST["np_desc"],'',100,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); $doleditor=new DolEditor('np_desc',GETPOST('np_desc"'),'',100,'dolibarr_details','',false,true,$enabled,$nbrows,70);
$doleditor->Create(); $doleditor->Create();
?> ?>
</td> </td>
@ -109,7 +110,9 @@ if (! empty($conf->margin->enabled)) {
$colspan++; $colspan++;
} }
?> ?>
<td align="center" valign="middle" colspan="<?php echo $colspan; ?>"><input type="submit" class="button" value="<?php echo $langs->trans("Add"); ?>" name="addline"></td> <td align="center" valign="middle" colspan="<?php echo $colspan; ?>">
<input type="submit" class="button" value="<?php echo $langs->trans("Add"); ?>" name="addline">
</td>
</tr> </tr>
<?php if (! empty($conf->service->enabled) && $dateSelector) { <?php if (! empty($conf->service->enabled) && $dateSelector) {