コード例 #1
0
ファイル: import.php プロジェクト: nrjacker4/crm-php
}
$result = restrictedArea($user, 'import', $origin_id, '');
$entitytoicon = array('invoice' => 'bill', 'invoice_line' => 'bill', 'order' => 'order', 'order_line' => 'order', 'intervention' => 'intervention', 'inter_line' => 'intervention', 'member' => 'user', 'member_type' => 'group', 'subscription' => 'payment', 'tax' => 'generic', 'tax_type' => 'generic', 'account' => 'account', 'payment' => 'payment', 'product' => 'product', 'stock' => 'generic', 'warehouse' => 'stock', 'category' => 'generic', 'other' => 'generic');
$entitytolang = array('user' => 'User', 'company' => 'Company', 'contact' => 'Contact', 'invoice' => 'Bill', 'invoice_line' => 'InvoiceLine', 'order' => 'Order', 'order_line' => 'OrderLine', 'intervention' => 'Intervention', 'inter_line' => 'InterLine', 'member' => 'Member', 'member_type' => 'MemberType', 'subscription' => 'Subscription', 'tax' => 'SocialContribution', 'tax_type' => 'DictionnarySocialContributions', 'account' => 'BankTransactions', 'payment' => 'Payment', 'product' => 'Product', 'stock' => 'Stock', 'warehouse' => 'Warehouse', 'category' => 'Category', 'other' => 'Other');
$datatoimport = GETPOST('datatoimport');
$format = GETPOST('format');
$filetoimport = GETPOST('filetoimport');
$action = GETPOST('action');
$step = GETPOST('step') ? GETPOST('step') : 1;
$import_name = GETPOST('import_name');
$hexa = GETPOST('hexa');
$importmodelid = GETPOST('importmodelid');
$excludefirstline = GETPOST('excludefirstline') ? GETPOST('excludefirstline') : 0;
$objimport = new Import($db);
$objimport->load_arrays($user, $step == 1 ? '' : $datatoimport);
$objmodelimport = new ModeleImports();
$form = new Form($db);
$htmlother = new FormOther($db);
$formfile = new FormFile($db);
// Init $array_match_file_to_database from _SESSION
$serialized_array_match_file_to_database = isset($_SESSION["dol_array_match_file_to_database"]) ? $_SESSION["dol_array_match_file_to_database"] : '';
$array_match_file_to_database = array();
$fieldsarray = explode(',', $serialized_array_match_file_to_database);
foreach ($fieldsarray as $elem) {
    $tabelem = explode('=', $elem, 2);
    $key = $tabelem[0];
    $val = $tabelem[1];
    if ($key && $val) {
        $array_match_file_to_database[$key] = $val;
    }
}
コード例 #2
0
ファイル: index.php プロジェクト: nrjacker4/crm-php
print_fiche_titre($langs->trans("ImportArea"));
print $langs->trans("FormatedImportDesc1") . '<br>';
print $langs->trans("FormatedImportDesc2") . '<br>';
print '<br>';
print '<table class="notopnoleftnoright" width="100%">';
print '<tr><td valign="top" width="40%" class="notopnoleft">';
// Liste des formats d'imports disponibles
$var = true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="2">' . $langs->trans("AvailableFormats") . '</td>';
print '<td>' . $langs->trans("LibraryShort") . '</td>';
print '<td align="right">' . $langs->trans("LibraryVersion") . '</td>';
print '</tr>';
include_once DOL_DOCUMENT_ROOT . '/core/modules/import/modules_import.php';
$model = new ModeleImports();
$liste = $model->liste_modeles($db);
foreach ($liste as $key) {
    $var = !$var;
    print '<tr ' . $bc[$var] . '>';
    print '<td width="16">' . img_picto_common($model->getDriverLabel($key), $model->getPicto($key)) . '</td>';
    $text = $model->getDriverDesc($key);
    print '<td>' . $form->textwithpicto($model->getDriverLabel($key), $text) . '</td>';
    print '<td>' . $model->getLibLabel($key) . '</td>';
    print '<td nowrap="nowrap" align="right">' . $model->getLibVersion($key) . '</td>';
    print '</tr>';
}
print '</table>';
print '</td><td valign="top" width="60%" class="notopnoleftnoright">';
// Affiche les modules d'imports
print '<table class="noborder" width="100%">';