diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 32d5a34aa52..a888cf5566e 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -96,7 +96,7 @@ $hookmanager->initHooks(array('actioncard','globalcard')); /* * Actions */ - +$listUserAssignedUpdated = false; // Remove user to assigned list if (GETPOST('removedassigned') || GETPOST('removedassigned') == '0') { @@ -114,6 +114,8 @@ if (GETPOST('removedassigned') || GETPOST('removedassigned') == '0') $donotclearsession=1; if ($action == 'add') $action = 'create'; if ($action == 'update') $action = 'edit'; + + $listUserAssignedUpdated = true; } // Add user to assigned list @@ -133,6 +135,8 @@ if (GETPOST('addassignedtouser') || GETPOST('updateassignedtouser')) $donotclearsession=1; if ($action == 'add') $action = 'create'; if ($action == 'update') $action = 'edit'; + + $listUserAssignedUpdated = true; } // Action clone object @@ -838,6 +842,28 @@ if ($id > 0) $result4=$object->fetch_userassigned(); $result5=$object->fetch_optionals($id,$extralabels); + if($listUserAssignedUpdated || $donotclearsession) { + + $datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]); + $datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]); + + $object->fk_action = dol_getIdFromCode($db, GETPOST("actioncode"), 'c_actioncomm'); + $object->label = GETPOST("label"); + $object->datep = $datep; + $object->datef = $datef; + $object->percentage = $percentage; + $object->priority = GETPOST("priority"); + $object->fulldayevent= GETPOST("fullday")?1:0; + $object->location = GETPOST('location'); + $object->socid = GETPOST("socid"); + $object->contactid = GETPOST("contactid",'int'); + //$object->societe->id = $_POST["socid"]; // deprecated + //$object->contact->id = $_POST["contactid"]; // deprecated + $object->fk_project = GETPOST("projectid",'int'); + + $object->note = GETPOST("note"); + } + if ($result1 < 0 || $result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0) { dol_print_error($db,$object->error); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index cb0e5ccf55e..6b499f98da6 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -453,7 +453,7 @@ class Commande extends CommonOrder { $mouvP = new MouvementStock($this->db); // We increment stock of product (and sub-products) - $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderBackToDraftInDolibarr",$this->ref)); + $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("OrderBackToDraftInDolibarr",$this->ref)); if ($result < 0) { $error++; } } } @@ -637,7 +637,7 @@ class Commande extends CommonOrder { $mouvP = new MouvementStock($this->db); // We increment stock of product (and sub-products) - $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderCanceledInDolibarr",$this->ref)); + $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("OrderCanceledInDolibarr",$this->ref)); // price is 0, we don't want WAP to be changed if ($result < 0) { $error++; @@ -984,6 +984,7 @@ class Commande extends CommonOrder // Clear fields $this->user_author_id = $user->id; $this->user_valid = ''; + $this->date = dol_now(); $this->date_creation = ''; $this->date_validation = ''; $this->ref_client = ''; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index cfbb0491be2..6a807ffca75 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1890,7 +1890,7 @@ class Facture extends CommonInvoice $mouvP = new MouvementStock($this->db); $mouvP->origin = &$this; // We decrease stock for product - if ($this->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num)); + if ($this->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("InvoiceValidatedInDolibarr",$num)); else $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num)); if ($result < 0) { $error++; diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index b779dae443b..962ecd8acaa 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -508,7 +508,7 @@ jQuery(document).ready(function() { ?> /* Code for margin */ - $("#fournprice_predef options").remove(); + $("#fournprice_predef").find("option").remove(); $("#fournprice_predef").hide(); $("#buying_price").val("").show(); /* Call post to load content of combo list fournprice_predef */ diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 6c2214c7e82..2693847ee40 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1069,7 +1069,7 @@ class Expedition extends CommonObject // no lot/serial // We increment stock of product (and sub-products) // We use warehouse selected for each line - $result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, $obj->subprice, $langs->trans("ShipmentDeletedInDolibarr", $this->ref)); + $result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, 0, $langs->trans("ShipmentDeletedInDolibarr", $this->ref)); // Price is set to 0, because we don't want to see WAP changed if ($result < 0) { $error++;$this->errors=$this->errors + $mouvS->errors; @@ -1082,7 +1082,7 @@ class Expedition extends CommonObject // We use warehouse selected for each line foreach($lotArray as $lot) { - $result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $lot->dluo_qty, $obj->subprice, $langs->trans("ShipmentDeletedInDolibarr", $this->ref), $lot->eatby, $lot->sellby, $lot->batch); + $result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $lot->dluo_qty, 0, $langs->trans("ShipmentDeletedInDolibarr", $this->ref), $lot->eatby, $lot->sellby, $lot->batch); // Price is set to 0, because we don't want to see WAP changed if ($result < 0) { $error++;$this->errors=$this->errors + $mouvS->errors; diff --git a/htdocs/includes/jquery/plugins/jcrop/js/jquery.Jcrop.js b/htdocs/includes/jquery/plugins/jcrop/js/jquery.Jcrop.js index ad261f97aec..a31a0a10592 100755 --- a/htdocs/includes/jquery/plugins/jcrop/js/jquery.Jcrop.js +++ b/htdocs/includes/jquery/plugins/jcrop/js/jquery.Jcrop.js @@ -43,13 +43,11 @@ $.Jcrop = function(obj,opt) // Some on-the-fly fixes for MSIE...sigh if (!('trackDocument' in opt)) { - opt.trackDocument = $.browser.msie ? false : true; - if ($.browser.msie && $.browser.version.split('.')[0] == '8') - opt.trackDocument = true; + opt.trackDocument = true; } if (!('keySupport' in opt)) - opt.keySupport = $.browser.msie ? false : true; + opt.keySupport = true; // }}} // Extend the default options {{{ @@ -416,7 +414,7 @@ $.Jcrop = function(obj,opt) if (options.drawBorders) { borders = { top: insertBorder('hline') - .css('top',$.browser.msie?px(-1):px(0)), + .css('top',px(0)), bottom: insertBorder('hline'), left: insertBorder('vline'), right: insertBorder('vline') @@ -965,7 +963,6 @@ $.Jcrop = function(obj,opt) function newTracker() { var trk = $('
').addClass(cssClass('tracker')); - $.browser.msie && trk.css({ opacity: 0, backgroundColor: 'white' }); return trk; }; diff --git a/htdocs/includes/jquery/plugins/jcrop/js/jquery.Jcrop.min.js b/htdocs/includes/jquery/plugins/jcrop/js/jquery.Jcrop.min.js index 9002b9787f2..c3c932b8349 100755 --- a/htdocs/includes/jquery/plugins/jcrop/js/jquery.Jcrop.min.js +++ b/htdocs/includes/jquery/plugins/jcrop/js/jquery.Jcrop.min.js @@ -8,10 +8,9 @@ (function($){$.Jcrop=function(obj,opt) {var obj=obj,opt=opt;if(typeof(obj)!=='object')obj=$(obj)[0];if(typeof(opt)!=='object')opt={};if(!('trackDocument'in opt)) -{opt.trackDocument=$.browser.msie?false:true;if($.browser.msie&&$.browser.version.split('.')[0]=='8') -opt.trackDocument=true;} +{opt.trackDocument=true;} if(!('keySupport'in opt)) -opt.keySupport=$.browser.msie?false:true;var defaults={trackDocument:false,baseClass:'jcrop',addClass:null,bgColor:'black',bgOpacity:.6,borderOpacity:.4,handleOpacity:.5,handlePad:5,handleSize:9,handleOffset:5,edgeMargin:14,aspectRatio:0,keySupport:true,cornerHandles:true,sideHandles:true,drawBorders:true,dragEdges:true,boxWidth:0,boxHeight:0,boundary:8,animationDelay:20,swingSpeed:3,allowSelect:true,allowMove:true,allowResize:true,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){}};var options=defaults;setOptions(opt);var $origimg=$(obj);var $img=$origimg.clone().removeAttr('id').css({position:'absolute'});$img.width($origimg.width());$img.height($origimg.height());$origimg.after($img).hide();presize($img,options.boxWidth,options.boxHeight);var boundx=$img.width(),boundy=$img.height(),$div=$('').width(boundx).height(boundy).addClass(cssClass('holder')).css({position:'relative',backgroundColor:options.bgColor}).insertAfter($origimg).append($img);;if(options.addClass)$div.addClass(options.addClass);var $img2=$('