Debug v14 with nojs
This commit is contained in:
parent
2091120d77
commit
e7b3280c17
@ -99,6 +99,7 @@ print "<br>\n";
|
|||||||
/**
|
/**
|
||||||
* Edit parameters
|
* Edit parameters
|
||||||
*/
|
*/
|
||||||
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
print "\n".'<script type="text/javascript" language="javascript">';
|
print "\n".'<script type="text/javascript" language="javascript">';
|
||||||
print '$(document).ready(function () {
|
print '$(document).ready(function () {
|
||||||
$("#selectcountry_id").change(function() {
|
$("#selectcountry_id").change(function() {
|
||||||
@ -107,6 +108,7 @@ print '$(document).ready(function () {
|
|||||||
});
|
});
|
||||||
});';
|
});';
|
||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
|
}
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'" name="form_index">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'" name="form_index">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
|||||||
@ -384,6 +384,7 @@ print "<br>\n";
|
|||||||
/**
|
/**
|
||||||
* Edit parameters
|
* Edit parameters
|
||||||
*/
|
*/
|
||||||
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
print "\n".'<script type="text/javascript" language="javascript">';
|
print "\n".'<script type="text/javascript" language="javascript">';
|
||||||
print '$(document).ready(function () {
|
print '$(document).ready(function () {
|
||||||
$("#selectcountry_id").change(function() {
|
$("#selectcountry_id").change(function() {
|
||||||
@ -392,6 +393,7 @@ print '$(document).ready(function () {
|
|||||||
});
|
});
|
||||||
});';
|
});';
|
||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
|
}
|
||||||
|
|
||||||
print '<form enctype="multipart/form-data" method="POST" action="'.$_SERVER["PHP_SELF"].'" name="form_index">';
|
print '<form enctype="multipart/form-data" method="POST" action="'.$_SERVER["PHP_SELF"].'" name="form_index">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
|||||||
@ -2006,6 +2006,7 @@ class ExtraFields
|
|||||||
$collapse_display = ((isset($_COOKIE['DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key]) || GETPOST('ignorecollapsesetup', 'int')) ? ($_COOKIE['DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key] ? true : false) : ($extrafield_collapse_display_value == 2 ? false : true));
|
$collapse_display = ((isset($_COOKIE['DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key]) || GETPOST('ignorecollapsesetup', 'int')) ? ($_COOKIE['DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key] ? true : false) : ($extrafield_collapse_display_value == 2 ? false : true));
|
||||||
$extrafields_collapse_num = $this->attributes[$object->table_element]['pos'][$key].(!empty($object->id)?'_'.$object->id:'');
|
$extrafields_collapse_num = $this->attributes[$object->table_element]['pos'][$key].(!empty($object->id)?'_'.$object->id:'');
|
||||||
|
|
||||||
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
$out .= '<!-- Add js script to manage the collapse/uncollapse of extrafields separators '.$key.' -->'."\n";
|
$out .= '<!-- Add js script to manage the collapse/uncollapse of extrafields separators '.$key.' -->'."\n";
|
||||||
$out .= '<script type="text/javascript">'."\n";
|
$out .= '<script type="text/javascript">'."\n";
|
||||||
$out .= 'jQuery(document).ready(function(){'."\n";
|
$out .= 'jQuery(document).ready(function(){'."\n";
|
||||||
@ -2033,6 +2034,7 @@ class ExtraFields
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7067,7 +7067,7 @@ class Form
|
|||||||
public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0)
|
public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
global $delayedhtmlcontent;
|
global $delayedhtmlcontent; // Will be used later outside of this function
|
||||||
|
|
||||||
// TODO Use an internal dolibarr component instead of select2
|
// TODO Use an internal dolibarr component instead of select2
|
||||||
if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && !defined('REQUIRE_JQUERY_MULTISELECT')) {
|
if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && !defined('REQUIRE_JQUERY_MULTISELECT')) {
|
||||||
@ -7076,6 +7076,8 @@ class Form
|
|||||||
|
|
||||||
$out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>';
|
$out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>';
|
||||||
|
|
||||||
|
$outdelayed = '';
|
||||||
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
$tmpplugin = 'select2';
|
$tmpplugin = 'select2';
|
||||||
$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
|
$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
|
||||||
<script>
|
<script>
|
||||||
@ -7138,6 +7140,7 @@ class Form
|
|||||||
|
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
|
}
|
||||||
|
|
||||||
if ($acceptdelayedhtml) {
|
if ($acceptdelayedhtml) {
|
||||||
$delayedhtmlcontent .= $outdelayed;
|
$delayedhtmlcontent .= $outdelayed;
|
||||||
@ -7168,7 +7171,7 @@ class Form
|
|||||||
public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0)
|
public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
global $delayedhtmlcontent;
|
global $delayedhtmlcontent; // Will be used later outside of this function
|
||||||
|
|
||||||
// TODO Use an internal dolibarr component instead of select2
|
// TODO Use an internal dolibarr component instead of select2
|
||||||
if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && !defined('REQUIRE_JQUERY_MULTISELECT')) {
|
if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && !defined('REQUIRE_JQUERY_MULTISELECT')) {
|
||||||
@ -7187,6 +7190,8 @@ class Form
|
|||||||
$formattedarrayresult[] = $o;
|
$formattedarrayresult[] = $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$outdelayed = '';
|
||||||
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
$tmpplugin = 'select2';
|
$tmpplugin = 'select2';
|
||||||
$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
|
$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
|
||||||
<script>
|
<script>
|
||||||
@ -7255,6 +7260,7 @@ class Form
|
|||||||
|
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
|
}
|
||||||
|
|
||||||
if ($acceptdelayedhtml) {
|
if ($acceptdelayedhtml) {
|
||||||
$delayedhtmlcontent .= $outdelayed;
|
$delayedhtmlcontent .= $outdelayed;
|
||||||
@ -7297,7 +7303,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add code for jquery to use multiselect
|
// Add code for jquery to use multiselect
|
||||||
if (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) {
|
if (!empty($conf->use_javascript_ajax) && !empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) {
|
||||||
$out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->';
|
$out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->';
|
||||||
$out .= "\n".'<script>'."\n";
|
$out .= "\n".'<script>'."\n";
|
||||||
if ($addjscombo == 1) {
|
if ($addjscombo == 1) {
|
||||||
|
|||||||
@ -258,7 +258,6 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Add code to manage list depending on others
|
// Add code to manage list depending on others
|
||||||
// TODO Test/enhance this with a more generic solution
|
// TODO Test/enhance this with a more generic solution
|
||||||
if (!empty($conf->use_javascript_ajax)) {
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
|
|||||||
@ -1016,6 +1016,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
//WYSIWYG Editor
|
//WYSIWYG Editor
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
|
|
||||||
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
print '<script type="text/javascript">';
|
print '<script type="text/javascript">';
|
||||||
print '$(document).ready(function () {
|
print '$(document).ready(function () {
|
||||||
$("#selectcountry_id").change(function() {
|
$("#selectcountry_id").change(function() {
|
||||||
@ -1024,6 +1025,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
});
|
});
|
||||||
});';
|
});';
|
||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
|
}
|
||||||
|
|
||||||
// Load object modCodeProduct
|
// Load object modCodeProduct
|
||||||
$module = (!empty($conf->global->PRODUCT_CODEPRODUCT_ADDON) ? $conf->global->PRODUCT_CODEPRODUCT_ADDON : 'mod_codeproduct_leopard');
|
$module = (!empty($conf->global->PRODUCT_CODEPRODUCT_ADDON) ? $conf->global->PRODUCT_CODEPRODUCT_ADDON : 'mod_codeproduct_leopard');
|
||||||
@ -1551,6 +1553,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
//WYSIWYG Editor
|
//WYSIWYG Editor
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
|
|
||||||
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
print '<script type="text/javascript">';
|
print '<script type="text/javascript">';
|
||||||
print '$(document).ready(function () {
|
print '$(document).ready(function () {
|
||||||
$("#selectcountry_id").change(function () {
|
$("#selectcountry_id").change(function () {
|
||||||
@ -1559,6 +1562,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
});
|
});
|
||||||
});';
|
});';
|
||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
|
}
|
||||||
|
|
||||||
// We set country_id, country_code and country for the selected country
|
// We set country_id, country_code and country for the selected country
|
||||||
$object->country_id = GETPOST('country_id') ? GETPOST('country_id') : $object->country_id;
|
$object->country_id = GETPOST('country_id') ? GETPOST('country_id') : $object->country_id;
|
||||||
@ -1646,7 +1650,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
$inherited_mask_sn = getDolGlobalString('SN_ADVANCED_MASK');
|
$inherited_mask_sn = getDolGlobalString('SN_ADVANCED_MASK');
|
||||||
print '<td id="field_mask">';
|
print '<td id="field_mask">';
|
||||||
print $form->textwithpicto('<input type="text" class="flat minwidth175" name="batch_mask" id="batch_mask_input" value="'.$mask.'">', $tooltip, 1, 1);
|
print $form->textwithpicto('<input type="text" class="flat minwidth175" name="batch_mask" id="batch_mask_input" value="'.$mask.'">', $tooltip, 1, 1);
|
||||||
|
// Add javascript to sho/hide field for custom mask
|
||||||
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
print '<script type="text/javascript">
|
print '<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$("#field_mask").parent().addClass("hideobject");
|
$("#field_mask").parent().addClass("hideobject");
|
||||||
@ -1686,6 +1691,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
</script>';
|
</script>';
|
||||||
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1859,7 +1859,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
$sub2 = 1;
|
$sub2 = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->use_javascript_ajax) {
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
print "\n".'<script type="text/javascript">';
|
print "\n".'<script type="text/javascript">';
|
||||||
print '$(document).ready(function () {
|
print '$(document).ready(function () {
|
||||||
var val='.$sub.';
|
var val='.$sub.';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user