Fix sort order of import profiles

Fix picto in import profile for accounting
This commit is contained in:
Laurent Destailleur 2019-06-21 14:27:38 +02:00
parent f9095408b6
commit 4499447a89
2 changed files with 7 additions and 8 deletions

View File

@ -240,7 +240,7 @@ class modAccounting extends DolibarrModules
$r++;
$this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='Chartofaccounts';
$this->export_icon[$r]='Accounting';
$this->export_icon[$r]='accounting';
$this->export_permission[$r]=array(array("accounting","chartofaccount"));
$this->export_fields_array[$r]=array('ac.rowid'=>'ChartofaccountsId','ac.pcg_version'=>'Chartofaccounts','aa.rowid'=>'Id','aa.account_number'=>"AccountAccounting",'aa.label'=>"Label",'aa.account_parent'=>"Accountparent",'aa.pcg_type'=>"Pcgtype",'aa.pcg_subtype'=>'Pcgsubtype','aa.active'=>'Status');
$this->export_TypeFields_array[$r]=array('ac.rowid'=>'List:accounting_system:pcg_version','aa.account_number'=>"Text",'aa.label'=>"Text",'aa.account_parent'=>"Text",'aa.pcg_type'=>'Text','aa.pcg_subtype'=>'Text','aa.active'=>'Status');

View File

@ -352,20 +352,19 @@ if ($step == 1 || ! $datatoimport)
print '<td>'.$langs->trans("ImportableDatas").'</td>';
print '<td>&nbsp;</td>';
print '</tr>';
$val=true;
if (count($objimport->array_import_code))
if (count($objimport->array_import_module))
{
foreach ($objimport->array_import_code as $key => $value)
$sortedarrayofmodules = dol_sort_array($objimport->array_import_module, 'module_position', 'asc', 0, 0, 1);
foreach ($sortedarrayofmodules as $key => $value)
{
//var_dump($objimport->array_import_code[$key]);
$val=!$val;
print '<tr '.$bc[$val].'><td>';
print '<tr class="oddeven"><td>';
$titleofmodule=$objimport->array_import_module[$key]->getName();
// Special cas for import common to module/services
if (in_array($objimport->array_import_code[$key], array('produit_supplierprices','produit_multiprice','produit_languages'))) $titleofmodule=$langs->trans("ProductOrService");
print $titleofmodule;
print '</td><td>';
//print $value;
print img_object($objimport->array_import_module[$key]->getName(), $objimport->array_import_icon[$key]).' ';
print $objimport->array_import_label[$key];
print '</td><td style="text-align: right">';
@ -382,7 +381,7 @@ if ($step == 1 || ! $datatoimport)
}
else
{
print '<tr><td '.$bc[false].' colspan="3">'.$langs->trans("NoImportableData").'</td></tr>';
print '<tr><td class="oddeven" colspan="3">'.$langs->trans("NoImportableData").'</td></tr>';
}
print '</table>';
print '</div>';