2
0
forked from Wavyzz/dolibarr

Fix alignement

This commit is contained in:
Laurent Destailleur
2022-05-16 16:53:19 +02:00
parent 937d0418b4
commit 5d148a8a99

View File

@@ -1079,16 +1079,16 @@ if ($step == 4 && $datatoimport) {
}
}
$height = '24px'; //needs px for css height attribute below
$height = '32px'; //needs px for css height attribute below
$i = 0;
$mandatoryfieldshavesource = true;
print '<table width="100%" class="nobordernopadding">';
print '<table class="nobordernopadding centpercent tableimport">';
foreach ($fieldstarget as $code => $line) {
if ($i == $minpos) {
break;
}
print '<tr class="oddeven" style="height:'.$height.'">';
print '<tr style="height:'.$height.'" class="trimport oddevenimport">';
$entity = (!empty($objimport->array_import_entities[0][$code]) ? $objimport->array_import_entities[0][$code] : $objimport->array_import_icon[0]);
$tablealias = preg_replace('/(\..*)$/i', '', $code);
@@ -1116,6 +1116,7 @@ if ($step == 4 && $datatoimport) {
print '</option>';
print $optionsnotused;
print '</select>';
//print ajax_combobox('selectorderimport_'.($i+1));
print "</td>";
print '<td class="nowraponall" style="font-weight:normal; text-align:right">';
$filecolumn = !empty($array_match_database_to_file[$code])?$array_match_database_to_file[$code]:0;
@@ -1224,7 +1225,7 @@ if ($step == 4 && $datatoimport) {
print '</div>';
if ($conf->use_javascript_ajax) {
if (!empty($conf->use_javascript_ajax)) {
print '<script type="text/javascript">'."\n";
print 'var previousselectedvalueimport = "0";'."\n";
print 'var previousselectedlabelimport = "0";'."\n";
@@ -1232,7 +1233,7 @@ if ($step == 4 && $datatoimport) {
print '$(".targetselectchange").focus(function(){'."\n";
print 'previousselectedvalueimport = $(this).val();'."\n";
print 'previousselectedlabelimport = $(this).children("option:selected").text();'."\n";
print 'console.log(previousselectedvalueimport)'."\n";
print 'console.log("previousselectedvalueimport="+previousselectedvalueimport)'."\n";
print '})'."\n";
print '$(".targetselectchange").change(function(){'."\n";
print 'if(previousselectedlabelimport != "" && previousselectedvalueimport != -1){'."\n";
@@ -1259,15 +1260,17 @@ if ($step == 4 && $datatoimport) {
print 'value = $(this).val()'."\n";
print 'arrayselectedfields.push(value);'."\n";
print '});'."\n";
print '$.ajax({'."\n";
print 'type: "POST",'."\n";
print 'dataType: "json",'."\n";
print 'url: "'.$_SERVER["PHP_SELF"].'?action=saveselectorder",'."\n";
print 'data: "selectorder="+arrayselectedfields.toString(),'."\n";
print 'success: function(){'."\n";
print 'console.log("Select order saved");'."\n";
print '},'."\n";
print "$.ajax({\n";
print " type: 'POST',\n";
print " dataType: 'json',\n";
print " url: '".dol_escape_js($_SERVER["PHP_SELF"])."?action=saveselectorder&token=".newToken()."',\n";
print " data: 'selectorder='+arrayselectedfields.toString(),\n";
print " success: function(){\n";
print " console.log('Select order saved');\n";
print " },\n";
print '});'."\n";
print '});'."\n";
print '})'."\n";
print '</script>'."\n";
@@ -2174,24 +2177,24 @@ $db->close();
*/
function show_elem($fieldssource, $pos, $key, $var, $nostyle = '')
{
global $langs, $bc;
global $langs;
$height = '28px';
$height = '32px';
if ($key == 'none') {
//stop multiple duplicate ids with no number
print "\n\n<!-- Box_no-key start-->\n";
print '<div class="box boximport" style="padding:0;">'."\n";
print '<table summary="boxtable_no-key" width="100%" class="nobordernopadding">'."\n";
print '<table summary="boxtable_no-key" class="centpercent nobordernopadding">'."\n";
} else {
print "\n\n<!-- Box ".$pos." start -->\n";
print '<div class="box boximport" style="padding: 0;" id="boxto_'.$pos.'">'."\n";
print '<table summary="boxtable'.$pos.'" width="100%" class="nobordernopadding">'."\n";
print '<table summary="boxtable'.$pos.'" class="nobordernopadding centpercent tableimport">'."\n";
}
if (($pos && $pos > count($fieldssource)) && (!isset($fieldssource[$pos]["imported"]))) { // No fields
print '<tr'.($nostyle ? '' : ' '.$bc[$var]).' style="height:'.$height.'">';
print '<tr style="height:'.$height.'" class="trimport oddevenimport">';
print '<td class="nocellnopadding" width="16" style="font-weight: normal">';
//print img_picto(($pos > 0 ? $langs->trans("MoveField", $pos) : ''), 'grip_title', 'class="boxhandle" style="cursor:move;"');
print '</td>';
@@ -2200,7 +2203,7 @@ function show_elem($fieldssource, $pos, $key, $var, $nostyle = '')
print '</td>';
print '</tr>';
} elseif ($key == 'none') { // Empty line
print '<tr'.($nostyle ? '' : ' '.$bc[$var]).' style="height:'.$height.'">';
print '<tr style="height:'.$height.'" class="trimport oddevenimport">';
print '<td class="nocellnopadding" width="16" style="font-weight: normal">';
print '&nbsp;';
print '</td>';
@@ -2210,7 +2213,7 @@ function show_elem($fieldssource, $pos, $key, $var, $nostyle = '')
print '</tr>';
} else {
// Print field of source file
print '<tr'.($nostyle ? '' : ' '.$bc[$var]).' style="height:'.$height.'">';
print '<tr style="height:'.$height.'" class="trimport oddevenimport">';
print '<td class="nocellnopadding" width="16" style="font-weight: normal">';
// The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object
//print img_picto($langs->trans("MoveField", $pos), 'grip_title', 'class="boxhandle" style="cursor:move;"');