Work on import module
This commit is contained in:
parent
d9ecd2347a
commit
cf6b052006
@ -121,14 +121,26 @@ else
|
|||||||
print '<tr><td '.$bc[false].' colspan="2">'.$langs->trans("NoExportableData").'</td></tr>';
|
print '<tr><td '.$bc[false].' colspan="2">'.$langs->trans("NoExportableData").'</td></tr>';
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
print '<center>';
|
||||||
if (sizeof($export->array_export_code))
|
if (sizeof($export->array_export_code))
|
||||||
{
|
{
|
||||||
|
if ($user->rights->export->creer)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/exports/export.php?leftmenu=export">'.$langs->trans("NewExport").'</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("NewExport").'</a>';
|
||||||
|
}
|
||||||
|
/*
|
||||||
print '<center><form action="'.DOL_URL_ROOT.'/exports/export.php?leftmenu=export"><input type="submit" class="button" value="'.$langs->trans("NewExport").'"';
|
print '<center><form action="'.DOL_URL_ROOT.'/exports/export.php?leftmenu=export"><input type="submit" class="button" value="'.$langs->trans("NewExport").'"';
|
||||||
print ($user->rights->export->creer?'':' disabled="true"');
|
print ($user->rights->export->creer?'':' disabled="true"');
|
||||||
print '></form></center>';
|
print '></form></center>';
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
print '</center>';
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -857,7 +857,7 @@ if ($step == 4 && $datatoimport)
|
|||||||
{
|
{
|
||||||
//$var=!$var;
|
//$var=!$var;
|
||||||
$nbofnotimportedfields++;
|
$nbofnotimportedfields++;
|
||||||
show_elem($fieldssource,$lefti,$key,'',$var);
|
show_elem($fieldssource,$lefti,$key,'',$var,'nostyle');
|
||||||
//print '> '.$lefti.'-'.$key;
|
//print '> '.$lefti.'-'.$key;
|
||||||
$listofkeys[$key]=1;
|
$listofkeys[$key]=1;
|
||||||
$lefti++;
|
$lefti++;
|
||||||
@ -866,7 +866,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,$lefti,$newkey,'',$var);
|
show_elem($fieldssource,$lefti,$newkey,'',$var,'nostyle');
|
||||||
//print '> '.$lefti.'-'.$newkey;
|
//print '> '.$lefti.'-'.$newkey;
|
||||||
$listofkeys[$newkey]=1;
|
$listofkeys[$newkey]=1;
|
||||||
$nbofnotimportedfields++;
|
$nbofnotimportedfields++;
|
||||||
@ -880,7 +880,7 @@ if ($step == 4 && $datatoimport)
|
|||||||
while ($i < $nbofnotimportedfields)
|
while ($i < $nbofnotimportedfields)
|
||||||
{
|
{
|
||||||
// Print empty cells
|
// Print empty cells
|
||||||
show_elem('','','','none',$var);
|
show_elem('','','','none',$var,'nostyle');
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -1172,15 +1172,24 @@ if ($step == 5 && $datatoimport)
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print $langs->trans("NowClickToTestTheImport",$langs->transnoentitiesnoconv("RunSimulateImportFile")).'<br>';
|
print $langs->trans("NowClickToTestTheImport",$langs->transnoentitiesnoconv("RunSimulateImportFile")).'<br>';
|
||||||
print '<br>';
|
|
||||||
print '<center>';
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'?step=6&'.$param.'">';
|
|
||||||
print '<input class="button" type="submit" value="'.$langs->trans("RunSimulateImportFile").'">';
|
|
||||||
print '</form>';
|
|
||||||
print '</center>';
|
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
// Actions
|
||||||
|
print '<center>';
|
||||||
|
if ($user->rights->import->run)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/imports/import.php?leftmenu=import&step=6&'.$param.'">'.$langs->trans("RunSimulateImportFile").'</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("RunSimulateImportFile").'</a>';
|
||||||
|
}
|
||||||
|
/*print '<form action="'.$_SERVER["PHP_SELF"].'?step=6&'.$param.'">';
|
||||||
|
print '<input class="button" type="submit" value="'.$langs->trans("RunSimulateImportFile").'">';
|
||||||
|
print '</form>';*/
|
||||||
|
print '</center>';
|
||||||
|
|
||||||
if ($mesg) print $mesg;
|
if ($mesg) print $mesg;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1196,7 +1205,7 @@ llxFooter('$Date$ - $Revision$');
|
|||||||
/*
|
/*
|
||||||
* Function to put the movable box of a source field
|
* Function to put the movable box of a source field
|
||||||
*/
|
*/
|
||||||
function show_elem($fieldssource,$i,$pos,$key,$var)
|
function show_elem($fieldssource,$i,$pos,$key,$var,$nostyle='')
|
||||||
{
|
{
|
||||||
global $langs,$bc;
|
global $langs,$bc;
|
||||||
|
|
||||||
@ -1204,27 +1213,31 @@ function show_elem($fieldssource,$i,$pos,$key,$var)
|
|||||||
print '<div style="padding: 0px 0px 0px 0px;" id="boxto_'.$pos.'">'."\n";
|
print '<div style="padding: 0px 0px 0px 0px;" id="boxto_'.$pos.'">'."\n";
|
||||||
|
|
||||||
print '<table summary="boxtable'.$pos.'" width="100%" class="nobordernopadding">'."\n";
|
print '<table summary="boxtable'.$pos.'" width="100%" class="nobordernopadding">'."\n";
|
||||||
print '<tr '.$bc[$var].' height="20">';
|
|
||||||
if ($pos && $pos > sizeof($fieldssource)) // NoFields
|
if ($pos && $pos > sizeof($fieldssource)) // NoFields
|
||||||
{
|
{
|
||||||
|
print '<tr '.($nostyle?'':$bc[$var]).' height="20">';
|
||||||
print '<td class="nocellnopadding" width="16" style="font-weight: normal">';
|
print '<td class="nocellnopadding" width="16" style="font-weight: normal">';
|
||||||
print img_picto(($pos>0?$langs->trans("MoveField",$pos):''),'uparrow','class="boxhandle" style="cursor:move;"');
|
print img_picto(($pos>0?$langs->trans("MoveField",$pos):''),'uparrow','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");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
}
|
}
|
||||||
elseif ($key == 'none')
|
elseif ($key == 'none')
|
||||||
{
|
{
|
||||||
|
print '<tr '.($nostyle?'':$bc[$var]).' height="20">';
|
||||||
print '<td class="nocellnopadding" width="16" style="font-weight: normal">';
|
print '<td class="nocellnopadding" width="16" style="font-weight: normal">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td style="font-weight: normal">';
|
print '<td style="font-weight: normal">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
}
|
}
|
||||||
else // Print field of source file
|
else // Print field of source file
|
||||||
{
|
{
|
||||||
|
print '<tr '.($nostyle?'':$bc[$var]).' height="20">';
|
||||||
//print '<td width="16">'.img_file('','').'</td>';
|
//print '<td width="16">'.img_file('','').'</td>';
|
||||||
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
|
||||||
@ -1234,8 +1247,8 @@ function show_elem($fieldssource,$i,$pos,$key,$var)
|
|||||||
print $langs->trans("Field").' '.$pos;
|
print $langs->trans("Field").' '.$pos;
|
||||||
if (! empty($fieldssource[$pos]['example1'])) print ' (<i>'.$fieldssource[$pos]['example1'].'</i>)';
|
if (! empty($fieldssource[$pos]['example1'])) print ' (<i>'.$fieldssource[$pos]['example1'].'</i>)';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
}
|
}
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
|
|||||||
@ -117,11 +117,21 @@ else
|
|||||||
print '<tr><td '.$bc[false].' colspan="2">'.$langs->trans("NoImportableData").'</td></tr>';
|
print '<tr><td '.$bc[false].' colspan="2">'.$langs->trans("NoImportableData").'</td></tr>';
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
print '<center>';
|
||||||
if (sizeof($import->array_import_code))
|
if (sizeof($import->array_import_code))
|
||||||
{
|
{
|
||||||
print '<center><form action="'.DOL_URL_ROOT.'/imports/import.php?leftmenu=import"><input type="submit" class="button" value="'.$langs->trans("NewImport").'"></form></center>';
|
//if ($user->rights->import->run)
|
||||||
|
//{
|
||||||
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/imports/import.php?leftmenu=import">'.$langs->trans("NewImport").'</a>';
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("NewImport").'</a>';
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
print '</center>';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Affiche les profils d'exports
|
// Affiche les profils d'exports
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user