Fix: reorder the lines correctly

This commit is contained in:
Regis Houssin 2011-04-11 09:00:13 +00:00
parent 1216e08521
commit 1c89213caf
6 changed files with 15 additions and 10 deletions

View File

@ -311,6 +311,7 @@ class Propal extends CommonObject
if (empty($qty)) $qty=0;
if (empty($info_bits)) $info_bits=0;
if (empty($rang)) $rang=0;
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);

View File

@ -913,6 +913,7 @@ class Commande extends CommonObject
if (empty($txtva)) $txtva=0;
if (empty($txlocaltax1)) $txlocaltax1=0;
if (empty($txlocaltax2)) $txlocaltax2=0;
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);

View File

@ -1717,6 +1717,7 @@ class Facture extends CommonObject
if (empty($txtva)) $txtva=0;
if (empty($txlocaltax1)) $txlocaltax1=0;
if (empty($txlocaltax2)) $txlocaltax2=0;
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);

View File

@ -47,7 +47,8 @@ top_httphead();
print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\n";
// Registering the location of boxes
if((isset($_GET['roworder']) && !empty($_GET['roworder'])) && (isset($_GET['element']) && !empty($_GET['element'])))
if((isset($_GET['roworder']) && !empty($_GET['roworder'])) && (isset($_GET['table_element_line']) && !empty($_GET['table_element_line']))
&& (isset($_GET['fk_element']) && !empty($_GET['fk_element'])) && (isset($_GET['element_id']) && !empty($_GET['element_id'])) )
{
$roworder = explode(',',$_GET['roworder']);
@ -64,8 +65,11 @@ if((isset($_GET['roworder']) && !empty($_GET['roworder'])) && (isset($_GET['elem
dol_syslog("AjaxRow roworder=".$_GET['roworder']." neworder=".$roworder." element=".$_GET['element'], LOG_DEBUG);
$row=new CommonObject($db);
$row->table_element_line = $_GET['element'];
$row->table_element_line = $_GET['table_element_line'];
$row->fk_element = $_GET['fk_element'];
$row->id = $_GET['element_id'];
$result=$row->line_ajaxorder($roworder);
$result=$row->line_order(true);
}
?>

View File

@ -22,11 +22,7 @@
* \file htdocs/core/class/commonobject.class.php
* \ingroup core
* \brief Fichier de la classe mere des classes metiers (facture, contrat, propal, commande, etc...)
<<<<<<< commonobject.class.php
* \version $Id$
=======
* \version $Id$
>>>>>>> 1.107
*/

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -34,8 +34,10 @@ jQuery(document).ready(function(){
jQuery("#tablelines").tableDnD({
onDrop: function(table, row) {
var roworder = cleanSerialize(jQuery("#tablelines").tableDnDSerialize());
var element = "<?php echo $object->table_element_line; ?>";
jQuery.get("<?php echo DOL_URL_ROOT; ?>/core/ajaxrow.php?roworder="+roworder+"&element="+element);
var table_element_line = "<?php echo $object->table_element_line; ?>";
var fk_element = "<?php echo $object->fk_element; ?>";
var element_id = "<?php echo $object->id; ?>";
jQuery.get("<?php echo DOL_URL_ROOT; ?>/core/ajaxrow.php?roworder="+roworder+"&table_element_line="+table_element_line+"&fk_element="+fk_element+"&element_id="+element_id);
jQuery("#tablelines .drag").each(
function( intIndex ){
jQuery(this).removeClass("pair impair");