From 4e51963836135c2faa88757bfb16543f51b354e0 Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Wed, 14 May 2014 17:20:11 +0200 Subject: [PATCH] Add possibility to change package dimension after shipping creation --- htdocs/expedition/fiche.php | 53 ++++++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 6 deletions(-) diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 4fac38b385f..f208c82b5d2 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -313,9 +313,15 @@ else if ($action == 'settrackingnumber' || $action == 'settrackingurl' if ($action == 'settrackingnumber') $object->tracking_number = trim(GETPOST('trackingnumber','alpha')); if ($action == 'settrackingurl') $object->tracking_url = trim(GETPOST('trackingurl','int')); - if ($action == 'settrueWeight') $object->trueWeight = trim(GETPOST('trueWeight','int')); + if ($action == 'settrueWeight') { + $object->trueWeight = trim(GETPOST('trueWeight','int')); + $object->weight_units = GETPOST('weight_units','int'); + } if ($action == 'settrueWidth') $object->trueWidth = trim(GETPOST('trueWidth','int')); - if ($action == 'settrueHeight') $object->trueHeight = trim(GETPOST('trueHeight','int')); + if ($action == 'settrueHeight'){ + $object->trueHeight = trim(GETPOST('trueHeight','int')); + $object->size_units = GETPOST('size_units','int'); + } if ($action == 'settrueDepth') $object->trueDepth = trim(GETPOST('trueDepth','int')); if ($action == 'setshipping_method_id') $object->shipping_method_id = trim(GETPOST('shipping_method_id','int')); @@ -1149,8 +1155,25 @@ else if ($id || $ref) // Weight print ''.$form->editfieldkey("Weight",'trueWeight',$object->trueWeight,$object,$user->rights->expedition->creer).''; - print $form->editfieldval("Weight",'trueWeight',$object->trueWeight,$object,$user->rights->expedition->creer); - print ($object->trueWeight && $object->weight_units!='')?' '.measuring_units_string($object->weight_units,"weight"):''; + + if($action=='edittrueWeight') { + + print '
'; + print ''; + print ''; + print ''; + print ''; + print $formproduct->select_measuring_units("weight_units","weight",$object->weight_units); + print ' '; + print ' '; + print '
'; + + } + else { + print $object->trueWeight; + print ($object->trueWeight && $object->weight_units!='')?' '.measuring_units_string($object->weight_units,"weight"):''; + } + if ($totalWeight > 0) { if (!empty($object->trueWeight)) print ' ('.$langs->trans("SumOfProductWeights").': '; @@ -1167,8 +1190,26 @@ else if ($id || $ref) // Height print ''.$form->editfieldkey("Height",'trueHeight',$object->trueHeight,$object,$user->rights->expedition->creer).''; - print $form->editfieldval("Height",'trueHeight',$object->trueHeight,$object,$user->rights->expedition->creer); - print ($object->trueHeight && $object->height_units!='')?' '.measuring_units_string($object->height_units,"size"):''; + if($action=='edittrueHeight') { + + print '
'; + print ''; + print ''; + print ''; + print ''; + print $formproduct->select_measuring_units("size_units","size",$object->size_units); + print ' '; + print ' '; + print '
'; + + } + else { + print $object->trueHeight; + print ($object->trueHeight && $object->height_units!='')?' '.measuring_units_string($object->height_units,"size"):''; + + } + + print ''; // Depth