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,8 +48,9 @@ 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
$("#'.$htmlname.'").val("").trigger("change"); $("input#search_'.$htmlname.'").keyup(function() {
$("#'.$htmlname.'").val("").trigger("change");
}); });
// Check when keyup // Check when keyup
$("input#search_'.$htmlname.'").onDelayedKeyup({ handler: function() { $("input#search_'.$htmlname.'").onDelayedKeyup({ handler: function() {
@ -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,7 +1,7 @@
<?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>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -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>
@ -99,9 +100,9 @@ $colspan = 4;
if (! empty($conf->margin->enabled)) { if (! empty($conf->margin->enabled)) {
?> ?>
<td align="right"> <td align="right">
<select id="fournprice" name="fournprice" style="display: none;"></select> <select id="fournprice" name="fournprice" style="display: none;"></select>
<input type="text" size="5" id="buying_price" name="buying_price" value="<?php echo (isset($_POST["buying_price"])?$_POST["buying_price"]:''); ?>"> <input type="text" size="5" id="buying_price" name="buying_price" value="<?php echo (isset($_POST["buying_price"])?$_POST["buying_price"]:''); ?>">
</td> </td>
<?php <?php
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) if (! empty($conf->global->DISPLAY_MARGIN_RATES))
$colspan++; $colspan++;
@ -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) {