Merge branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
85f31fc0cb
@ -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.= ', 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.= ', ca.code as availability_code';
|
||||||
$sql.= ', dr.code as demand_reason_code';
|
$sql.= ', dr.code as demand_reason_code';
|
||||||
$sql.= ', el.fk_source';
|
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'commande as c';
|
$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_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_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_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.'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;
|
$sql.= " WHERE c.entity = ".$conf->entity;
|
||||||
if ($id) $sql.= " AND c.rowid=".$id;
|
if ($id) $sql.= " AND c.rowid=".$id;
|
||||||
if ($ref) $sql.= " AND c.ref='".$this->db->escape($ref)."'";
|
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->demand_reason_code = $obj->demand_reason_code;
|
||||||
$this->date_livraison = $this->db->jdate($obj->date_livraison);
|
$this->date_livraison = $this->db->jdate($obj->date_livraison);
|
||||||
$this->fk_delivery_address = $obj->fk_adresse_livraison;
|
$this->fk_delivery_address = $obj->fk_adresse_livraison;
|
||||||
$this->propale_id = $obj->fk_source;
|
|
||||||
|
|
||||||
$this->extraparams = (array) json_decode($obj->extraparams, true);
|
$this->extraparams = (array) json_decode($obj->extraparams, true);
|
||||||
|
|
||||||
@ -1300,22 +1297,6 @@ class Commande extends CommonObject
|
|||||||
|
|
||||||
$this->db->free();
|
$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
|
* Lines
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -2217,8 +2217,6 @@ class Form
|
|||||||
$more.='</table>'."\n";
|
$more.='</table>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$formconfirm.= "\n<!-- begin form_confirm page=".$page." -->\n";
|
|
||||||
|
|
||||||
if ($useajax && $conf->use_javascript_ajax)
|
if ($useajax && $conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
$autoOpen=true;
|
$autoOpen=true;
|
||||||
@ -2244,83 +2242,12 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// New code using jQuery only
|
// New code using jQuery only
|
||||||
$formconfirm.= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">';
|
include(DOL_DOCUMENT_ROOT.'/core/tpl/ajax/formconfirm.tpl.php');
|
||||||
if (! empty($more)) $formconfirm.= '<p>'.$more.'</p>';
|
|
||||||
$formconfirm.= img_help('','').' '.$question;
|
|
||||||
$formconfirm.= '</div>'."\n";
|
|
||||||
$formconfirm.= '<script type="text/javascript">
|
|
||||||
var choice=\'ko\';
|
|
||||||
var inputok='.json_encode($inputok).';
|
|
||||||
var inputko='.json_encode($inputko).';
|
|
||||||
var pageyes=\''.dol_escape_js($pageyes?$pageyes:'').'\';
|
|
||||||
var pageno=\''.dol_escape_js($pageno?$pageno:'').'\';
|
|
||||||
|
|
||||||
/* Warning: This function is loaded once and not overwritten if loaded by another ajax page */
|
|
||||||
$(function() {
|
|
||||||
$( "#'.$dialogconfirm.'" ).dialog({
|
|
||||||
autoOpen: '.($autoOpen?'true':'false').',
|
|
||||||
resizable: false,
|
|
||||||
height:'.$height.',
|
|
||||||
width:'.$width.',
|
|
||||||
modal: true,
|
|
||||||
closeOnEscape: false,
|
|
||||||
close: function(event, ui) {
|
|
||||||
if (choice == \'ok\') {
|
|
||||||
var options="";
|
|
||||||
if (inputok.length>0) {
|
|
||||||
$.each(inputok, function() {
|
|
||||||
var inputname = this; var more = \'\';
|
|
||||||
if ($("#" + this).attr("type") == \'checkbox\') { more = \':checked\'; }
|
|
||||||
var inputvalue = $("#" + this + more).val();
|
|
||||||
if (typeof inputvalue == \'undefined\') { inputvalue=\'\'; }
|
|
||||||
options += \'&\' + inputname + \'=\' + inputvalue;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var urljump=pageyes + (pageyes.indexOf(\'?\')<0?\'?\':\'\') + options;
|
|
||||||
//alert(urljump);
|
|
||||||
if (pageyes.length > 0) { location.href=urljump; }
|
|
||||||
}
|
|
||||||
if (choice == \'ko\') {
|
|
||||||
var options="";
|
|
||||||
if (inputko.length>0) {
|
|
||||||
$.each(inputko, function() {
|
|
||||||
var inputname = this; var more = \'\';
|
|
||||||
if ($("#" + this).attr("type") == \'checkbox\') { more = \':checked\'; }
|
|
||||||
var inputvalue = $("#" + this + more).val();
|
|
||||||
if (typeof inputvalue == \'undefined\') { inputvalue=\'\'; }
|
|
||||||
options += \'&\' + inputname + \'=\' + inputvalue;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var urljump=pageno + (pageno.indexOf(\'?\')<0?\'?\':\'\') + options;
|
|
||||||
//alert(urljump);
|
|
||||||
if (pageno.length > 0) { location.href=urljump; }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
buttons: {
|
|
||||||
\''.dol_escape_js($langs->transnoentities("Yes")).'\': function() {
|
|
||||||
choice=\'ok\';
|
|
||||||
$(this).dialog(\'close\');
|
|
||||||
},
|
|
||||||
\''.dol_escape_js($langs->transnoentities("No")).'\': function() {
|
|
||||||
choice=\'ko\';
|
|
||||||
$(this).dialog(\'close\');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var button=\''.$button.'\';
|
|
||||||
if (button.length > 0) {
|
|
||||||
$( "#" + button ).click(function() {
|
|
||||||
$("#'.$dialogconfirm.'").dialog(\'open\');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>';
|
|
||||||
|
|
||||||
$formconfirm.= "\n";
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$formconfirm.= "\n<!-- begin form_confirm page=".$page." -->\n";
|
||||||
|
|
||||||
$formconfirm.= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n";
|
$formconfirm.= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n";
|
||||||
$formconfirm.= '<input type="hidden" name="action" value="'.$action.'">';
|
$formconfirm.= '<input type="hidden" name="action" value="'.$action.'">';
|
||||||
$formconfirm.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'."\n";
|
$formconfirm.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'."\n";
|
||||||
@ -2352,9 +2279,10 @@ class Form
|
|||||||
|
|
||||||
$formconfirm.= "</form>\n";
|
$formconfirm.= "</form>\n";
|
||||||
$formconfirm.= '<br>';
|
$formconfirm.= '<br>';
|
||||||
|
|
||||||
|
$formconfirm.= "<!-- end form_confirm -->\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$formconfirm.= "<!-- end form_confirm -->\n";
|
|
||||||
return $formconfirm;
|
return $formconfirm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -661,7 +661,7 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$notrigger=0,$objec
|
|||||||
//print "x".$file." ".$disableglob;
|
//print "x".$file." ".$disableglob;
|
||||||
$ok=true;
|
$ok=true;
|
||||||
$file_osencoded=dol_osencode($file); // New filename encoded in OS filesystem encoding charset
|
$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)
|
foreach (glob($file_osencoded) as $filename)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -44,6 +44,8 @@ $(function () {
|
|||||||
|
|
||||||
// Options
|
// Options
|
||||||
$('#fileupload').fileupload('option', {
|
$('#fileupload').fileupload('option', {
|
||||||
|
// Enable iframe cross-domain access via redirect option
|
||||||
|
redirect: window.location.href.replace(/\/[^\/]*$/,'<?php echo DOL_URL_ROOT; ?>/includes/jquery/plugins/fileupload/cors/result.html?%s'),
|
||||||
maxFileSize: '<?php echo $max_file_size; ?>'
|
maxFileSize: '<?php echo $max_file_size; ?>'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
84
htdocs/core/tpl/ajax/formconfirm.tpl.php
Normal file
84
htdocs/core/tpl/ajax/formconfirm.tpl.php
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2011-2012 Regis Houssin <regis@dolibarr.fr>
|
||||||
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!-- START TEMPLATE FORMCONFIRM PAGE="<?php echo $page; ?>" -->
|
||||||
|
<div id="<?php echo $dialogconfirm; ?>" title="<?php echo dol_escape_htmltag($title); ?>" style="display: none;">
|
||||||
|
<?php if (! empty($more)) { ?>
|
||||||
|
<p><?php echo $more; ?></p>
|
||||||
|
<?php } ?>
|
||||||
|
<?php echo img_help('','').' '.$question; ?>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function() {
|
||||||
|
$( "#<?php echo $dialogconfirm; ?>" ).dialog({
|
||||||
|
autoOpen: <?php echo ($autoOpen ? 'true' : 'false'); ?>,
|
||||||
|
resizable: false,
|
||||||
|
height: '<?php echo $height; ?>',
|
||||||
|
width: '<?php echo $width; ?>',
|
||||||
|
modal: true,
|
||||||
|
closeOnEscape: false,
|
||||||
|
buttons: {
|
||||||
|
'<?php echo dol_escape_js($langs->transnoentities("Yes")); ?>': function() {
|
||||||
|
var options="";
|
||||||
|
var inputok = <?php echo json_encode($inputok); ?>;
|
||||||
|
var pageyes = '<?php echo dol_escape_js($pageyes?$pageyes:''); ?>';
|
||||||
|
if (inputok.length>0) {
|
||||||
|
$.each(inputok, function(i, inputname) {
|
||||||
|
var more = '';
|
||||||
|
if ($("#" + inputname).attr("type") == 'checkbox') { more = ':checked'; }
|
||||||
|
var inputvalue = $("#" + inputname + more).val();
|
||||||
|
if (typeof inputvalue == 'undefined') { inputvalue=''; }
|
||||||
|
options += '&' + inputname + '=' + inputvalue;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
var urljump = pageyes + (pageyes.indexOf('?') < 0 ? '?' : '') + options;
|
||||||
|
//alert(urljump);
|
||||||
|
if (pageyes.length > 0) { location.href = urljump; }
|
||||||
|
$(this).dialog('close');
|
||||||
|
},
|
||||||
|
'<?php echo dol_escape_js($langs->transnoentities("No")); ?>': function() {
|
||||||
|
var options = '';
|
||||||
|
var inputko = <?php echo json_encode($inputko); ?>;
|
||||||
|
var pageno='<?php echo dol_escape_js($pageno?$pageno:''); ?>';
|
||||||
|
if (inputko.length>0) {
|
||||||
|
$.each(inputko, function(i, inputname) {
|
||||||
|
var more = '';
|
||||||
|
if ($("#" + inputname).attr("type") == 'checkbox') { more = ':checked'; }
|
||||||
|
var inputvalue = $("#" + inputname + more).val();
|
||||||
|
if (typeof inputvalue == 'undefined') { inputvalue=''; }
|
||||||
|
options += '&' + inputname + '=' + inputvalue;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
var urljump=pageno + (pageno.indexOf('?') < 0 ? '?' : '') + options;
|
||||||
|
//alert(urljump);
|
||||||
|
if (pageno.length > 0) { location.href = urljump; }
|
||||||
|
$(this).dialog('close');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var button = '<?php echo $button; ?>';
|
||||||
|
if (button.length > 0) {
|
||||||
|
$( "#" + button ).click(function() {
|
||||||
|
$("#<?php echo $dialogconfirm; ?>").dialog('open');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- END TEMPLATE FORM CONFIRM -->
|
||||||
20
htdocs/includes/jquery/plugins/fileupload/cors/result.html
Normal file
20
htdocs/includes/jquery/plugins/fileupload/cors/result.html
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<!--
|
||||||
|
/*
|
||||||
|
* jQuery Iframe Transport Plugin Redirect Page 2.0
|
||||||
|
* https://github.com/blueimp/jQuery-File-Upload
|
||||||
|
*
|
||||||
|
* Copyright 2010, Sebastian Tschan
|
||||||
|
* https://blueimp.net
|
||||||
|
*
|
||||||
|
* Licensed under the MIT license:
|
||||||
|
* http://www.opensource.org/licenses/MIT
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>jQuery Iframe Transport Plugin Redirect Page</title>
|
||||||
|
</head>
|
||||||
|
<body><script>document.body.innerHTML=decodeURIComponent(window.location.search.slice(1));</script></body>
|
||||||
|
</html>
|
||||||
@ -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
|
* https://github.com/blueimp/jQuery-File-Upload
|
||||||
*
|
*
|
||||||
* Copyright 2010, Sebastian Tschan
|
* Copyright 2010, Sebastian Tschan
|
||||||
@ -530,8 +530,8 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
_forceReflow: function (node) {
|
_forceReflow: function (node) {
|
||||||
this._reflow = $.support.transition &&
|
return $.support.transition && node.length &&
|
||||||
node.length && node[0].offsetWidth;
|
node[0].offsetWidth;
|
||||||
},
|
},
|
||||||
|
|
||||||
_transition: function (node) {
|
_transition: function (node) {
|
||||||
|
|||||||
@ -989,11 +989,13 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||||||
if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD))
|
if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD))
|
||||||
{
|
{
|
||||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/template/tmpl.min.js"></script>'."\n";
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/template/tmpl.min.js"></script>'."\n";
|
||||||
//print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.iframe-transport.js"></script>'."\n";
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.iframe-transport.js"></script>'."\n";
|
||||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.fileupload.js"></script>'."\n";
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.fileupload.js"></script>'."\n";
|
||||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.fileupload-fp.js"></script>'."\n";
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.fileupload-fp.js"></script>'."\n";
|
||||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.fileupload-ui.js"></script>'."\n";
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.fileupload-ui.js"></script>'."\n";
|
||||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.fileupload-jui.js"></script>'."\n";
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.fileupload-jui.js"></script>'."\n";
|
||||||
|
print '<!-- The XDomainRequest Transport is included for cross-domain file deletion for IE8+ -->'."\n";
|
||||||
|
'<!--[if gte IE 8]><script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/cors/jquery.xdr-transport.js"></script><![endif]-->'."\n";
|
||||||
}
|
}
|
||||||
// jQuery DataTables
|
// jQuery DataTables
|
||||||
if (! empty($conf->global->MAIN_USE_JQUERY_DATATABLES))
|
if (! empty($conf->global->MAIN_USE_JQUERY_DATATABLES))
|
||||||
|
|||||||
@ -1092,10 +1092,10 @@ class Product extends CommonObject
|
|||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|
||||||
// multilangs
|
// multilangs
|
||||||
if ($conf->global->MAIN_MULTILANGS) $this->getMultiLangs();
|
if (! empty($conf->global->MAIN_MULTILANGS)) $this->getMultiLangs();
|
||||||
|
|
||||||
// Load multiprices array
|
// Load multiprices array
|
||||||
if ($conf->global->PRODUIT_MULTIPRICES)
|
if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
||||||
{
|
{
|
||||||
for ($i=1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++)
|
for ($i=1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user