import with select boxes
This commit is contained in:
parent
733e411a67
commit
8e11b1c996
@ -142,7 +142,6 @@ $updatekeys = (GETPOST('updatekeys', 'array') ? GETPOST('updatekeys', 'array')
|
|||||||
$separator = (GETPOST('separator', 'nohtml') ? GETPOST('separator', 'nohtml') : (!empty($conf->global->IMPORT_CSV_SEPARATOR_TO_USE) ? $conf->global->IMPORT_CSV_SEPARATOR_TO_USE : ','));
|
$separator = (GETPOST('separator', 'nohtml') ? GETPOST('separator', 'nohtml') : (!empty($conf->global->IMPORT_CSV_SEPARATOR_TO_USE) ? $conf->global->IMPORT_CSV_SEPARATOR_TO_USE : ','));
|
||||||
$enclosure = (GETPOST('enclosure', 'nohtml') ? GETPOST('enclosure', 'nohtml') : '"');
|
$enclosure = (GETPOST('enclosure', 'nohtml') ? GETPOST('enclosure', 'nohtml') : '"');
|
||||||
|
|
||||||
$import_wip = 0;
|
|
||||||
|
|
||||||
$objimport = new Import($db);
|
$objimport = new Import($db);
|
||||||
$objimport->load_arrays($user, ($step == 1 ? '' : $datatoimport));
|
$objimport->load_arrays($user, ($step == 1 ? '' : $datatoimport));
|
||||||
@ -161,7 +160,7 @@ foreach ($fieldsarray as $elem) {
|
|||||||
$tabelem = explode('=', $elem, 2);
|
$tabelem = explode('=', $elem, 2);
|
||||||
$key = $tabelem[0];
|
$key = $tabelem[0];
|
||||||
$val = (isset($tabelem[1]) ? $tabelem[1] : '');
|
$val = (isset($tabelem[1]) ? $tabelem[1] : '');
|
||||||
if ($key && $val) {
|
if ($key && $val && ($key > 0 && $step != 4)) {
|
||||||
$array_match_file_to_database[$key] = $val;
|
$array_match_file_to_database[$key] = $val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -323,31 +322,19 @@ if ($action == 'saveorder') {
|
|||||||
$serialized_array_match_file_to_database = '';
|
$serialized_array_match_file_to_database = '';
|
||||||
$array_match_file_to_database = array();
|
$array_match_file_to_database = array();
|
||||||
$fieldsarray = explode(',', $list);
|
$fieldsarray = explode(',', $list);
|
||||||
if (empty($import_wip)) {
|
$pos = 0;
|
||||||
$pos = 0;
|
|
||||||
}
|
|
||||||
foreach ($fieldsarray as $fieldnb) { // For each elem in list. fieldnb start from 1 to ...
|
foreach ($fieldsarray as $fieldnb) { // For each elem in list. fieldnb start from 1 to ...
|
||||||
// Get name of database fields at position $pos and put it into $namefield
|
// Get name of database fields at position $pos and put it into $namefield
|
||||||
if (empty($import_wip)) {
|
$posbis = 0;
|
||||||
$posbis = 0;
|
|
||||||
} else {
|
|
||||||
$pos = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
$namefield = '';
|
$namefield = '';
|
||||||
foreach ($fieldstarget as $key => $val) { // key: val:
|
foreach ($fieldstarget as $key => $val) { // key: val:
|
||||||
//dol_syslog('AjaxImport key='.$key.' val='.$val);
|
//dol_syslog('AjaxImport key='.$key.' val='.$val);
|
||||||
if (empty($import_wip)) {
|
if ($posbis < $pos) {
|
||||||
if ($posbis < $pos) {
|
$posbis++;
|
||||||
$posbis++;
|
continue;
|
||||||
continue;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ($pos < $fieldnb) {
|
|
||||||
$pos++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// We found the key of targets that is at position pos
|
// We found the key of targets that is at position pos
|
||||||
$namefield = $key;
|
$namefield = $key;
|
||||||
//dol_syslog('AjaxImport Field name found for file field nb '.$fieldnb.'='.$namefield);
|
//dol_syslog('AjaxImport Field name found for file field nb '.$fieldnb.'='.$namefield);
|
||||||
@ -1018,9 +1005,9 @@ if ($step == 4 && $datatoimport) {
|
|||||||
// List of source fields
|
// List of source fields
|
||||||
$var = true;
|
$var = true;
|
||||||
$lefti = 1;
|
$lefti = 1;
|
||||||
foreach ($import_wip?$fieldssource:$array_match_file_to_database as $key => $val) {
|
foreach ($array_match_file_to_database as $key => $val) {
|
||||||
$var = !$var;
|
$var = !$var;
|
||||||
show_elem($fieldssource, $key, $val, $var, '', $import_wip); // key is field number in source file
|
show_elem($fieldssource, $key, $val, $var, 1, '', $listofkeys); // key is field number in source file
|
||||||
//print '> '.$lefti.'-'.$key.'-'.$val;
|
//print '> '.$lefti.'-'.$key.'-'.$val;
|
||||||
$listofkeys[$key] = 1;
|
$listofkeys[$key] = 1;
|
||||||
$fieldsplaced[$key] = 1;
|
$fieldsplaced[$key] = 1;
|
||||||
@ -1039,7 +1026,7 @@ if ($step == 4 && $datatoimport) {
|
|||||||
while ($lefti <= $num) {
|
while ($lefti <= $num) {
|
||||||
$var = !$var;
|
$var = !$var;
|
||||||
$newkey = getnewkey($fieldssource, $listofkeys);
|
$newkey = getnewkey($fieldssource, $listofkeys);
|
||||||
show_elem($fieldssource, $newkey, '', $var, '', $import_wip); // key start after field number in source file
|
show_elem($fieldssource, $newkey, '', $var, 1, '', $listofkeys); // key start after field number in source file
|
||||||
//print '> '.$lefti.'-'.$newkey;
|
//print '> '.$lefti.'-'.$newkey;
|
||||||
$listofkeys[$key] = 1;
|
$listofkeys[$key] = 1;
|
||||||
$lefti++;
|
$lefti++;
|
||||||
@ -1053,20 +1040,14 @@ if ($step == 4 && $datatoimport) {
|
|||||||
print '</td><td width="50%">';
|
print '</td><td width="50%">';
|
||||||
|
|
||||||
// List of target fields
|
// List of target fields
|
||||||
if (empty($import_wip)) {
|
// $height = '24px'; //needs px for css height attribute below
|
||||||
$height = '24px'; //needs px for css height attribute below
|
$height = '30px';
|
||||||
} else {
|
|
||||||
$height = '29px';
|
|
||||||
}
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$mandatoryfieldshavesource = true;
|
$mandatoryfieldshavesource = true;
|
||||||
if (!empty($import_wip)) {
|
$fieldselect = 1;
|
||||||
$fieldselect = 1;
|
|
||||||
}
|
|
||||||
print '<table width="100%" class="nobordernopadding">';
|
print '<table width="100%" class="nobordernopadding">';
|
||||||
if (!empty($import_wip)) {
|
$pos = 1;
|
||||||
$pos = 1;
|
|
||||||
}
|
|
||||||
foreach ($fieldstarget as $code => $label) {
|
foreach ($fieldstarget as $code => $label) {
|
||||||
print '<tr class="oddeven" style="height:'.$height.'">';
|
print '<tr class="oddeven" style="height:'.$height.'">';
|
||||||
|
|
||||||
@ -1081,49 +1062,22 @@ if ($step == 4 && $datatoimport) {
|
|||||||
|
|
||||||
print '<td class="nowraponall" style="font-weight: normal">=>'.img_object('', $entityicon).' '.$langs->trans($entitylang).'</td>';
|
print '<td class="nowraponall" style="font-weight: normal">=>'.img_object('', $entityicon).' '.$langs->trans($entitylang).'</td>';
|
||||||
print '<td class="nowraponall" style="font-weight: normal">';
|
print '<td class="nowraponall" style="font-weight: normal">';
|
||||||
if (empty($import_wip)) {
|
$newlabel = preg_replace('/\*$/', '', $label);
|
||||||
$newlabel = preg_replace('/\*$/', '', $label);
|
$text = $langs->trans($newlabel);
|
||||||
$text = $langs->trans($newlabel);
|
$more = '';
|
||||||
$more = '';
|
if (preg_match('/\*$/', $label)) {
|
||||||
if (preg_match('/\*$/', $label)) {
|
$text = '<span class="fieldrequired">'.$text.'</span>';
|
||||||
$text = '<span class="fieldrequired">'.$text.'</span>';
|
$more = ((!empty($valforsourcefieldnb[$i]) && $valforsourcefieldnb[$i] <= count($fieldssource)) ? '' : img_warning($langs->trans("FieldNeedSource")));
|
||||||
$more = ((!empty($valforsourcefieldnb[$i]) && $valforsourcefieldnb[$i] <= count($fieldssource)) ? '' : img_warning($langs->trans("FieldNeedSource")));
|
if ($mandatoryfieldshavesource) {
|
||||||
if ($mandatoryfieldshavesource) {
|
$mandatoryfieldshavesource = (!empty($valforsourcefieldnb[$i]) && ($valforsourcefieldnb[$i] <= count($fieldssource)));
|
||||||
$mandatoryfieldshavesource = (!empty($valforsourcefieldnb[$i]) && ($valforsourcefieldnb[$i] <= count($fieldssource)));
|
|
||||||
}
|
|
||||||
//print 'xx'.($i).'-'.$valforsourcefieldnb[$i].'-'.$mandatoryfieldshavesource;
|
|
||||||
}
|
}
|
||||||
print $text;
|
//print 'xx'.($i).'-'.$valforsourcefieldnb[$i].'-'.$mandatoryfieldshavesource;
|
||||||
} else {
|
|
||||||
print '<select class="flat minwidth200" autocomplete="off" name="selectfield_'.$fieldselect.'">';
|
|
||||||
print '<option value="-1"> </option>';
|
|
||||||
$pos2=1;
|
|
||||||
foreach ($array_match_file_to_database as $idselect => $codeselect) {
|
|
||||||
$labelselect = $fieldstarget[$codeselect];
|
|
||||||
$newlabel = preg_replace('/\*$/', '', $labelselect);
|
|
||||||
$text = $langs->trans($newlabel);
|
|
||||||
if (preg_match('/\*$/', $label)) {
|
|
||||||
$text = '<span class="fieldrequired">'.$text.'</span>';
|
|
||||||
$more = ((!empty($valforsourcefieldnb[$i]) && $valforsourcefieldnb[$i] <= count($fieldssource)) ? '' : img_warning($langs->trans("FieldNeedSource")));
|
|
||||||
if ($mandatoryfieldshavesource) {
|
|
||||||
$mandatoryfieldshavesource = (!empty($valforsourcefieldnb[$i]) && ($valforsourcefieldnb[$i] <= count($fieldssource)));
|
|
||||||
}
|
|
||||||
//print 'xx'.($i).'-'.$valforsourcefieldnb[$i].'-'.$mandatoryfieldshavesource;
|
|
||||||
}
|
|
||||||
print '<option value="'.$codeselect.'" ';
|
|
||||||
if ($pos == $pos2) {
|
|
||||||
print 'selected';
|
|
||||||
}
|
|
||||||
print '>'.$text.'</option>';
|
|
||||||
$pos2++;
|
|
||||||
}
|
|
||||||
$pos++;
|
|
||||||
print '</select>';
|
|
||||||
}
|
}
|
||||||
|
print $text;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Info field
|
// Info field
|
||||||
print '<td class="nowraponall" style="font-weight:normal; text-align:right">';
|
print '<td class="nowraponall" style="font-weight:normal; text-align:right">';
|
||||||
$filecolumn = $array_match_database_to_file[$code];
|
$filecolumn = !empty($array_match_database_to_file[$code])?$array_match_database_to_file[$code]:0;
|
||||||
// Source field info
|
// Source field info
|
||||||
$htmltext = '<b><u>'.$langs->trans("FieldSource").'</u></b><br>';
|
$htmltext = '<b><u>'.$langs->trans("FieldSource").'</u></b><br>';
|
||||||
if ($filecolumn > count($fieldssource)) {
|
if ($filecolumn > count($fieldssource)) {
|
||||||
@ -1181,9 +1135,7 @@ if ($step == 4 && $datatoimport) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
if (!empty($import_wip)) {
|
$fieldselect++;
|
||||||
$fieldselect++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
@ -1202,7 +1154,7 @@ if ($step == 4 && $datatoimport) {
|
|||||||
if (empty($fieldsplaced[$key])) {
|
if (empty($fieldsplaced[$key])) {
|
||||||
//
|
//
|
||||||
$nbofnotimportedfields++;
|
$nbofnotimportedfields++;
|
||||||
show_elem($fieldssource, $key, '', $var, 'nostyle', $import_wip);
|
show_elem($fieldssource, $key, '', $var, 0, 'nostyle', $listofkeys);
|
||||||
//print '> '.$lefti.'-'.$key;
|
//print '> '.$lefti.'-'.$key;
|
||||||
$listofkeys[$key] = 1;
|
$listofkeys[$key] = 1;
|
||||||
$lefti++;
|
$lefti++;
|
||||||
@ -1211,7 +1163,7 @@ if ($step == 4 && $datatoimport) {
|
|||||||
|
|
||||||
// Print one more empty field
|
// Print one more empty field
|
||||||
$newkey = getnewkey($fieldssource, $listofkeys);
|
$newkey = getnewkey($fieldssource, $listofkeys);
|
||||||
show_elem($fieldssource, $newkey, '', $var, 'nostyle', $import_wip);
|
show_elem($fieldssource, $newkey, '', $var, 1, 'nostyle', $listofkeys);
|
||||||
//print '> '.$lefti.'-'.$newkey;
|
//print '> '.$lefti.'-'.$newkey;
|
||||||
$listofkeys[$newkey] = 1;
|
$listofkeys[$newkey] = 1;
|
||||||
$nbofnotimportedfields++;
|
$nbofnotimportedfields++;
|
||||||
@ -1224,7 +1176,7 @@ if ($step == 4 && $datatoimport) {
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $nbofnotimportedfields) {
|
while ($i < $nbofnotimportedfields) {
|
||||||
// Print empty cells
|
// Print empty cells
|
||||||
show_elem('', '', 'none', $var, 'nostyle', $import_wip);
|
show_elem('', '', 'none', $var, 0, 'nostyle', $listofkeys);
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -1235,35 +1187,51 @@ if ($step == 4 && $datatoimport) {
|
|||||||
|
|
||||||
if ($conf->use_javascript_ajax) {
|
if ($conf->use_javascript_ajax) {
|
||||||
print '<script type="text/javascript">';
|
print '<script type="text/javascript">';
|
||||||
print 'jQuery(function() {
|
|
||||||
jQuery("#left, #right").sortable({
|
// print 'jQuery(function() {
|
||||||
/* placeholder: \'ui-state-highlight\', */
|
// jQuery("#left, #right").sortable({
|
||||||
handle: \'.boxhandle\',
|
// /* placeholder: \'ui-state-highlight\', */
|
||||||
revert: \'invalid\',
|
// handle: \'.boxhandle\',
|
||||||
items: \'.box\',
|
// revert: \'invalid\',
|
||||||
containment: \'.fiche\',
|
// items: \'.box\',
|
||||||
connectWith: \'.connectedSortable\',
|
// containment: \'.fiche\',
|
||||||
stop: function(event, ui) {
|
// connectWith: \'.connectedSortable\',
|
||||||
updateOrder();
|
// stop: function(event, ui) {
|
||||||
}
|
// updateOrder();
|
||||||
});
|
// }
|
||||||
});
|
// });
|
||||||
';
|
// });
|
||||||
|
// ';
|
||||||
|
|
||||||
|
print '$(".import_select").on("change",function(){
|
||||||
|
updateOrder2();
|
||||||
|
})';
|
||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
print 'function updateOrder(){'."\n";
|
// print 'function updateOrder(){'."\n";
|
||||||
print 'var left_list = cleanSerialize(jQuery("#left").sortable("serialize" ));'."\n";
|
// print 'var left_list = cleanSerialize(jQuery("#left").sortable("serialize" ));'."\n";
|
||||||
//print 'var right_list = cleanSerialize(jQuery("#right").sortable("serialize" ));'."\n";
|
// //print 'var right_list = cleanSerialize(jQuery("#right").sortable("serialize" ));'."\n";
|
||||||
print 'var boxorder = \'A:\' + left_list;'."\n";
|
// print 'var boxorder = \'A:\' + left_list;'."\n";
|
||||||
//print 'var boxorder = \'A:\' + left_list + \'-B:\' + right_list;'."\n";
|
// //print 'var boxorder = \'A:\' + left_list + \'-B:\' + right_list;'."\n";
|
||||||
//print 'alert(\'boxorder=\' + boxorder);';
|
// //print 'alert(\'boxorder=\' + boxorder);';
|
||||||
//print 'var userid = \''.$user->id.'\';'."\n";
|
// //print 'var userid = \''.$user->id.'\';'."\n";
|
||||||
//print 'var datatoimport = "'.$datatoimport.'";'."\n";
|
// //print 'var datatoimport = "'.$datatoimport.'";'."\n";
|
||||||
// print 'jQuery.ajax({ url: "ajaximport.php?step=4&boxorder=" + boxorder + "&userid=" + userid + "&datatoimport=" + datatoimport,
|
// // print 'jQuery.ajax({ url: "ajaximport.php?step=4&boxorder=" + boxorder + "&userid=" + userid + "&datatoimport=" + datatoimport,
|
||||||
// async: false
|
// // async: false
|
||||||
// });'."\n";
|
// // });'."\n";
|
||||||
// Now reload page
|
// // Now reload page
|
||||||
|
// print 'var newlocation= \''.$_SERVER["PHP_SELF"].'?step=4'.$param.'&action=saveorder&token='.newToken().'&boxorder=\' + boxorder;'."\n";
|
||||||
|
// //print 'alert(newlocation);';
|
||||||
|
// print 'window.location.href=newlocation;'."\n";
|
||||||
|
// print '}'."\n";
|
||||||
|
|
||||||
|
print 'function updateOrder2(){'."\n";
|
||||||
|
print 'var tmpboxorder = \'A:\''."\n";
|
||||||
|
print '$(".import_select").each(function(){'."\n";
|
||||||
|
print 'tmpboxorder = tmpboxorder + $(this).val() + \',\'';
|
||||||
|
print '});'."\n";
|
||||||
|
print 'boxorder = tmpboxorder.slice(0,-1)'."\n";
|
||||||
print 'var newlocation= \''.$_SERVER["PHP_SELF"].'?step=4'.$param.'&action=saveorder&token='.newToken().'&boxorder=\' + boxorder;'."\n";
|
print 'var newlocation= \''.$_SERVER["PHP_SELF"].'?step=4'.$param.'&action=saveorder&token='.newToken().'&boxorder=\' + boxorder;'."\n";
|
||||||
//print 'alert(newlocation);';
|
|
||||||
print 'window.location.href=newlocation;'."\n";
|
print 'window.location.href=newlocation;'."\n";
|
||||||
print '}'."\n";
|
print '}'."\n";
|
||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
@ -2162,23 +2130,21 @@ $db->close();
|
|||||||
/**
|
/**
|
||||||
* Function to put the movable box of a source field
|
* Function to put the movable box of a source field
|
||||||
*
|
*
|
||||||
* @param array $fieldssource List of source fields
|
* @param array $fieldssource List of source fields
|
||||||
* @param int $pos Pos
|
* @param int $pos Pos
|
||||||
* @param string $key Key
|
* @param string $key Key
|
||||||
* @param boolean $var Line style (odd or not)
|
* @param boolean $var Line style (odd or not)
|
||||||
* @param int $nostyle Hide style
|
* @param boolean $isimportedfield Verify if it's an imported field
|
||||||
* @param int $import_wip WIP
|
* @param int $nostyle Hide style
|
||||||
|
* @param array $listofkeys List of keys for select boxes
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function show_elem($fieldssource, $pos, $key, $var, $nostyle = '', $import_wip = 1)
|
function show_elem($fieldssource, $pos, $key, $var, $isimportedfield, $nostyle = '', &$listofkeys = array())
|
||||||
{
|
{
|
||||||
global $langs, $bc;
|
global $langs, $bc;
|
||||||
|
|
||||||
if (empty($import_wip)) {
|
// $height = '24px';
|
||||||
$height = '24px';
|
$height = '30px';
|
||||||
} else {
|
|
||||||
$height = '29px';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($key == 'none') {
|
if ($key == 'none') {
|
||||||
//stop multiple duplicate ids with no number
|
//stop multiple duplicate ids with no number
|
||||||
@ -2195,9 +2161,7 @@ function show_elem($fieldssource, $pos, $key, $var, $nostyle = '', $import_wip =
|
|||||||
if ($pos && $pos > count($fieldssource)) { // No fields
|
if ($pos && $pos > count($fieldssource)) { // No fields
|
||||||
print '<tr'.($nostyle ? '' : ' '.$bc[$var]).' style="height:'.$height.'">';
|
print '<tr'.($nostyle ? '' : ' '.$bc[$var]).' style="height:'.$height.'">';
|
||||||
print '<td class="nocellnopadding" width="16" style="font-weight: normal">';
|
print '<td class="nocellnopadding" width="16" style="font-weight: normal">';
|
||||||
if (empty($import_wip)) {
|
//print img_picto(($pos > 0 ? $langs->trans("MoveField", $pos) : ''), 'grip_title', 'class="boxhandle" style="cursor:move;"');
|
||||||
print img_picto(($pos > 0 ? $langs->trans("MoveField", $pos) : ''), 'grip_title', 'class="boxhandle" style="cursor:move;"');
|
|
||||||
}
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td style="font-weight: normal">';
|
print '<td style="font-weight: normal">';
|
||||||
print $langs->trans("NoFields");
|
print $langs->trans("NoFields");
|
||||||
@ -2212,24 +2176,65 @@ function show_elem($fieldssource, $pos, $key, $var, $nostyle = '', $import_wip =
|
|||||||
print ' ';
|
print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
} elseif (empty($isimportedfield)) {
|
||||||
|
$example = !empty($fieldssource[$pos]['example1'])?$fieldssource[$pos]['example1']:"";
|
||||||
|
if ($example) {
|
||||||
|
if (!utf8_check($example)) {
|
||||||
|
$example = utf8_encode($example);
|
||||||
|
}
|
||||||
|
print '<tr'.($nostyle ? '' : ' '.$bc[$var]).' style="height:'.$height.'">';
|
||||||
|
print '<td class="nocellnopadding" width="16" style="font-weight: normal">';
|
||||||
|
print ' ';
|
||||||
|
print '</td>';
|
||||||
|
print '<td style="font-weight: normal">';
|
||||||
|
print $langs->trans("EmptyField").': ';
|
||||||
|
print ' (<i>'.$example.'</i>)';
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Print field of source file
|
// Print field of source file
|
||||||
print '<tr'.($nostyle ? '' : ' '.$bc[$var]).' style="height:'.$height.'">';
|
print '<tr'.($nostyle ? '' : ' '.$bc[$var]).' style="height:'.$height.'">';
|
||||||
print '<td class="nocellnopadding" width="16" style="font-weight: normal">';
|
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
|
// 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
|
||||||
if (empty($import_wip)) {
|
//print img_picto($langs->trans("MoveField", $pos), 'grip_title', 'class="boxhandle" style="cursor:move;"');
|
||||||
print img_picto($langs->trans("MoveField", $pos), 'grip_title', 'class="boxhandle" style="cursor:move;"');
|
|
||||||
}
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="nowraponall" style="font-weight: normal">';
|
print '<td class="nowraponall" width="100" style="font-weight: normal">';
|
||||||
print $langs->trans("Field").' '.$pos;
|
$example = !empty($fieldssource[$pos]['example1'])?$fieldssource[$pos]['example1']:"";
|
||||||
$example = $fieldssource[$pos]['example1'];
|
if ($example != "") {
|
||||||
|
print $langs->trans("Field").' '.$pos.': ';
|
||||||
|
} else {
|
||||||
|
print $langs->trans("EmptyField").': ';
|
||||||
|
}
|
||||||
if ($example) {
|
if ($example) {
|
||||||
if (!utf8_check($example)) {
|
if (!utf8_check($example)) {
|
||||||
$example = utf8_encode($example);
|
$example = utf8_encode($example);
|
||||||
}
|
}
|
||||||
print ' (<i>'.$example.'</i>)';
|
|
||||||
}
|
}
|
||||||
|
$nameselect = ($pos > 0) ? $pos : (-$pos);
|
||||||
|
print '<td class="nowraponall" style="font-weight: normal">';
|
||||||
|
print '<select class="import_select flat" style="width:100%;" autocomplete="off" name="selectfield_'.$nameselect.'">';
|
||||||
|
$valueemptyoption = ($pos < 0) ? $pos : (-$pos);
|
||||||
|
print '<option value="'.$valueemptyoption.'"> </option>';
|
||||||
|
if ($example != "") {
|
||||||
|
print '<option selected value="'.$pos.'">';
|
||||||
|
print ' (<i>'.$example.'</i>)';
|
||||||
|
print '</option>';
|
||||||
|
}
|
||||||
|
foreach ($fieldssource as $newkey => $val) {
|
||||||
|
if (empty($listofkeys[$newkey])) {
|
||||||
|
$example = $fieldssource[$newkey]['example1'];
|
||||||
|
if ($example) {
|
||||||
|
if (!utf8_check($example)) {
|
||||||
|
$example = utf8_encode($example);
|
||||||
|
}
|
||||||
|
print '<option value="'.$newkey.'">';
|
||||||
|
print ' (<i>'.$example.'</i>)';
|
||||||
|
print '</option>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,7 @@ ImportableDatas=Importable dataset
|
|||||||
SelectExportDataSet=Choose dataset you want to export...
|
SelectExportDataSet=Choose dataset you want to export...
|
||||||
SelectImportDataSet=Choose dataset you want to import...
|
SelectImportDataSet=Choose dataset you want to import...
|
||||||
SelectExportFields=Choose the fields you want to export, or select a predefined export profile
|
SelectExportFields=Choose the fields you want to export, or select a predefined export profile
|
||||||
SelectImportFields=Choose the source file fields you want to import and their target field in database by moving them up and down with anchor %s, or select a predefined import profile:
|
SelectImportFields=Choose the source file fields you want to import and their target field in database by choosing the fields with the select box, or select a predefined import profile:
|
||||||
NotImportedFields=Fields of source file not imported
|
NotImportedFields=Fields of source file not imported
|
||||||
SaveExportModel=Save your selections as an export profile/template (for reuse).
|
SaveExportModel=Save your selections as an export profile/template (for reuse).
|
||||||
SaveImportModel=Save this import profile (for reuse) ...
|
SaveImportModel=Save this import profile (for reuse) ...
|
||||||
@ -136,3 +136,4 @@ NbUpdate=Number of updated lines: %s
|
|||||||
MultipleRecordFoundWithTheseFilters=Multiple records have been found with these filters: %s
|
MultipleRecordFoundWithTheseFilters=Multiple records have been found with these filters: %s
|
||||||
StocksWithBatch=Stocks and location (warehouse) of products with batch/serial number
|
StocksWithBatch=Stocks and location (warehouse) of products with batch/serial number
|
||||||
WarningFirstImportedLine=The first line(s) will not be imported with the current selection
|
WarningFirstImportedLine=The first line(s) will not be imported with the current selection
|
||||||
|
EmptyField=Empty field
|
||||||
@ -8,7 +8,7 @@ ImportableDatas=Lot de données importables
|
|||||||
SelectExportDataSet=Choisissez un lot prédéfini de données que vous désirez exporter…
|
SelectExportDataSet=Choisissez un lot prédéfini de données que vous désirez exporter…
|
||||||
SelectImportDataSet=Choisissez un lot prédéfini de données que vous désirez importer…
|
SelectImportDataSet=Choisissez un lot prédéfini de données que vous désirez importer…
|
||||||
SelectExportFields=Choisissez les champs à exporter, ou choisissez un profil d'export prédéfini
|
SelectExportFields=Choisissez les champs à exporter, ou choisissez un profil d'export prédéfini
|
||||||
SelectImportFields=Choisissez les champs du fichier source à importer et leur destination dans la base en les déplaçant vers le haut ou vers le bas via l'ancre %s, ou choisissez un profil d'import prédéfini:
|
SelectImportFields=Choisissez les champs du fichier source à importer et leur destination dans la base en utilisant les boîtes de sélection, ou choisissez un profil d'import prédéfini:
|
||||||
NotImportedFields=Champs du fichier source non importés
|
NotImportedFields=Champs du fichier source non importés
|
||||||
SaveExportModel=Enregistrer ce profil d'export (si vous désirez le réutiliser ultérieurement) …
|
SaveExportModel=Enregistrer ce profil d'export (si vous désirez le réutiliser ultérieurement) …
|
||||||
SaveImportModel=Enregistrer ce profil d'import (si vous désirez le réutiliser ultérieurement) …
|
SaveImportModel=Enregistrer ce profil d'import (si vous désirez le réutiliser ultérieurement) …
|
||||||
@ -136,3 +136,4 @@ NbUpdate=Nombre de lignes mises à jour: %s
|
|||||||
MultipleRecordFoundWithTheseFilters=Plusieurs enregistrements ont été trouvés avec ces filtres: %s
|
MultipleRecordFoundWithTheseFilters=Plusieurs enregistrements ont été trouvés avec ces filtres: %s
|
||||||
StocksWithBatch=Stocks et entrepôts des produits avec numéro de lot/série
|
StocksWithBatch=Stocks et entrepôts des produits avec numéro de lot/série
|
||||||
WarningFirstImportedLine=Les première(s) ligne(s) ne seront pas importée(s) avec cette selection
|
WarningFirstImportedLine=Les première(s) ligne(s) ne seront pas importée(s) avec cette selection
|
||||||
|
EmptyField=Champ vide
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user