diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index c14d0c2ef50..77940672d3e 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -1232,13 +1232,11 @@ class Commande extends CommonObject
$sql.= ', cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle, cr.libelle_facture as cond_reglement_libelle_doc';
$sql.= ', ca.code as availability_code';
$sql.= ', dr.code as demand_reason_code';
- $sql.= ', el.fk_source';
$sql.= ' FROM '.MAIN_DB_PREFIX.'commande as c';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as cr ON (c.fk_cond_reglement = cr.rowid)';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON (c.fk_mode_reglement = p.id)';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_availability as ca ON (c.fk_availability = ca.rowid)';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_input_reason as dr ON (c.fk_demand_reason = ca.rowid)';
- $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = c.rowid AND el.targettype = '".$this->element."'";
$sql.= " WHERE c.entity = ".$conf->entity;
if ($id) $sql.= " AND c.rowid=".$id;
if ($ref) $sql.= " AND c.ref='".$this->db->escape($ref)."'";
@@ -1290,7 +1288,6 @@ class Commande extends CommonObject
$this->demand_reason_code = $obj->demand_reason_code;
$this->date_livraison = $this->db->jdate($obj->date_livraison);
$this->fk_delivery_address = $obj->fk_adresse_livraison;
- $this->propale_id = $obj->fk_source;
$this->extraparams = (array) json_decode($obj->extraparams, true);
@@ -1300,22 +1297,6 @@ class Commande extends CommonObject
$this->db->free();
- if ($this->propale_id)
- {
- $sqlp = "SELECT ref";
- $sqlp.= " FROM ".MAIN_DB_PREFIX."propal";
- $sqlp.= " WHERE rowid = ".$this->propale_id;
-
- $resqlprop = $this->db->query($sqlp);
-
- if ($resqlprop)
- {
- $objp = $this->db->fetch_object($resqlprop);
- $this->propale_ref = $objp->ref;
- $this->db->free($resqlprop);
- }
- }
-
/*
* Lines
*/
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index c9892f73f2e..72f3c809d2d 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -2217,8 +2217,6 @@ class Form
$more.=''."\n";
}
- $formconfirm.= "\n\n";
-
if ($useajax && $conf->use_javascript_ajax)
{
$autoOpen=true;
@@ -2244,83 +2242,12 @@ class Form
}
// New code using jQuery only
- $formconfirm.= '
';
- if (! empty($more)) $formconfirm.= '
'.$more.'
';
- $formconfirm.= img_help('','').' '.$question;
- $formconfirm.= '
'."\n";
- $formconfirm.= '';
-
- $formconfirm.= "\n";
+ include(DOL_DOCUMENT_ROOT.'/core/tpl/ajax/formconfirm.tpl.php');
}
else
{
+ $formconfirm.= "\n\n";
+
$formconfirm.= '\n";
$formconfirm.= '
';
+
+ $formconfirm.= "\n";
}
- $formconfirm.= "\n";
return $formconfirm;
}
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 3c56d87984b..d3370982820 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -661,7 +661,7 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$notrigger=0,$objec
//print "x".$file." ".$disableglob;
$ok=true;
$file_osencoded=dol_osencode($file); // New filename encoded in OS filesystem encoding charset
- if (empty($disableglob))
+ if (empty($disableglob) && ! empty($file_osencoded))
{
foreach (glob($file_osencoded) as $filename)
{
diff --git a/htdocs/core/tpl/ajax/fileupload_main.tpl.php b/htdocs/core/tpl/ajax/fileupload_main.tpl.php
index 1c6b988c368..9807dfb293b 100644
--- a/htdocs/core/tpl/ajax/fileupload_main.tpl.php
+++ b/htdocs/core/tpl/ajax/fileupload_main.tpl.php
@@ -44,6 +44,8 @@ $(function () {
// Options
$('#fileupload').fileupload('option', {
+ // Enable iframe cross-domain access via redirect option
+ redirect: window.location.href.replace(/\/[^\/]*$/,'/includes/jquery/plugins/fileupload/cors/result.html?%s'),
maxFileSize: ''
});
diff --git a/htdocs/core/tpl/ajax/formconfirm.tpl.php b/htdocs/core/tpl/ajax/formconfirm.tpl.php
new file mode 100644
index 00000000000..d3367c7a7c1
--- /dev/null
+++ b/htdocs/core/tpl/ajax/formconfirm.tpl.php
@@ -0,0 +1,84 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+?>
+
+
+
+
+
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/fileupload/cors/result.html b/htdocs/includes/jquery/plugins/fileupload/cors/result.html
new file mode 100644
index 00000000000..7c98026846f
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/fileupload/cors/result.html
@@ -0,0 +1,20 @@
+
+
+
+
+
+jQuery Iframe Transport Plugin Redirect Page
+
+
+
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/fileupload/js/jquery.fileupload-ui.js b/htdocs/includes/jquery/plugins/fileupload/js/jquery.fileupload-ui.js
index a7b7d464ca5..e330fe16a36 100644
--- a/htdocs/includes/jquery/plugins/fileupload/js/jquery.fileupload-ui.js
+++ b/htdocs/includes/jquery/plugins/fileupload/js/jquery.fileupload-ui.js
@@ -1,5 +1,5 @@
/*
- * jQuery File Upload User Interface Plugin 6.9
+ * jQuery File Upload User Interface Plugin 6.9.1
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
@@ -530,8 +530,8 @@
},
_forceReflow: function (node) {
- this._reflow = $.support.transition &&
- node.length && node[0].offsetWidth;
+ return $.support.transition && node.length &&
+ node[0].offsetWidth;
},
_transition: function (node) {
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index d144596053e..4076699e201 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -989,11 +989,13 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD))
{
print ''."\n";
- //print ''."\n";
+ print ''."\n";
print ''."\n";
print ''."\n";
print ''."\n";
print ''."\n";
+ print ''."\n";
+ ''."\n";
}
// jQuery DataTables
if (! empty($conf->global->MAIN_USE_JQUERY_DATATABLES))
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 7b53456c21c..bb364435564 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -1092,10 +1092,10 @@ class Product extends CommonObject
$this->db->free($resql);
// multilangs
- if ($conf->global->MAIN_MULTILANGS) $this->getMultiLangs();
+ if (! empty($conf->global->MAIN_MULTILANGS)) $this->getMultiLangs();
// Load multiprices array
- if ($conf->global->PRODUIT_MULTIPRICES)
+ if (! empty($conf->global->PRODUIT_MULTIPRICES))
{
for ($i=1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++)
{