- Menü unter Einkauf > Lieferantenbestellungen statt eigenes Top-Menü - ADL-Buttons auf Produkt-Lieferantenpreisen per Hook (pricesuppliercard) - Admin-Seite: Großhändler-Schnellübersicht mit Version-Check - Dashboard: Shop-öffnen-Button (LI-Action) - Neue Datei: class/actions_idsconnect.class.php Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
114 lines
3.8 KiB
PHP
Executable file
114 lines
3.8 KiB
PHP
Executable file
<?php
|
|
/* Copyright (C) 2026 Eduard Wisch <data@data-it-solution.de>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*/
|
|
|
|
/**
|
|
* \file idsconnect/supplier_list.php
|
|
* \ingroup idsconnect
|
|
* \brief Liste aller konfigurierten Großhändler
|
|
*/
|
|
|
|
// Dolibarr laden
|
|
$res = 0;
|
|
if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
|
|
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
|
}
|
|
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME'];
|
|
$tmp2 = realpath(__FILE__);
|
|
$i = strlen($tmp) - 1;
|
|
$j = strlen($tmp2) - 1;
|
|
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
|
|
$i--;
|
|
$j--;
|
|
}
|
|
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
|
|
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
|
|
}
|
|
if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
|
|
$res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
|
|
}
|
|
if (!$res && file_exists("../main.inc.php")) {
|
|
$res = @include "../main.inc.php";
|
|
}
|
|
if (!$res && file_exists("../../main.inc.php")) {
|
|
$res = @include "../../main.inc.php";
|
|
}
|
|
if (!$res) {
|
|
die("Include of main fails");
|
|
}
|
|
|
|
dol_include_once('/idsconnect/class/idssupplier.class.php');
|
|
dol_include_once('/idsconnect/lib/idsconnect.lib.php');
|
|
|
|
/**
|
|
* @var DoliDB $db
|
|
* @var Translate $langs
|
|
* @var User $user
|
|
*/
|
|
|
|
$langs->loadLangs(array("idsconnect@idsconnect"));
|
|
|
|
if (!$user->hasRight('idsconnect', 'read')) {
|
|
accessforbidden();
|
|
}
|
|
|
|
|
|
/*
|
|
* View
|
|
*/
|
|
|
|
llxHeader('', $langs->trans("IdsconnectSupplierList"), '', '', 0, 0, '', '', '', 'mod-idsconnect page-supplier_list');
|
|
|
|
print load_fiche_titre($langs->trans("IdsconnectSupplierList"), '', 'fa-plug');
|
|
|
|
idsconnectShowTestModeBanner();
|
|
|
|
$supplierObj = new IdsSupplier($db);
|
|
$suppliers = $supplierObj->fetchAll(0);
|
|
|
|
print '<table class="noborder centpercent">';
|
|
print '<tr class="liste_titre">';
|
|
print '<th>'.$langs->trans("IdsconnectSupplierRef").'</th>';
|
|
print '<th>'.$langs->trans("IdsconnectSupplierLabel").'</th>';
|
|
print '<th>'.$langs->trans("IdsconnectSupplierUrl").'</th>';
|
|
print '<th>'.$langs->trans("IdsconnectSupplierVersion").'</th>';
|
|
print '<th class="center">'.$langs->trans("IdsconnectSupplierTestmode").'</th>';
|
|
print '<th class="center">'.$langs->trans("Status").'</th>';
|
|
print '<th class="right">'.$langs->trans("Action").'</th>';
|
|
print '</tr>';
|
|
|
|
if (is_array($suppliers) && count($suppliers) > 0) {
|
|
foreach ($suppliers as $sup) {
|
|
print '<tr class="oddeven">';
|
|
print '<td><a href="'.DOL_URL_ROOT.'/custom/idsconnect/supplier_card.php?id='.$sup->id.'">'.htmlspecialchars($sup->ref).'</a></td>';
|
|
print '<td>'.htmlspecialchars($sup->label).'</td>';
|
|
print '<td class="small">'.htmlspecialchars($sup->ids_url).'</td>';
|
|
print '<td>'.htmlspecialchars($sup->ids_version).'</td>';
|
|
print '<td class="center">'.yn($sup->testmode).'</td>';
|
|
print '<td class="center">'.yn($sup->active).'</td>';
|
|
print '<td class="right nowrap">';
|
|
if ($sup->active && $user->hasRight('idsconnect', 'use')) {
|
|
print '<a class="butAction butActionSmall" href="'.DOL_URL_ROOT.'/custom/idsconnect/launch.php?supplier_id='.$sup->id.'&ids_action=WKE&token='.newToken().'" target="_blank">'.$langs->trans("IdsconnectOpenShop").'</a>';
|
|
}
|
|
print '</td>';
|
|
print '</tr>';
|
|
}
|
|
} else {
|
|
print '<tr class="oddeven"><td colspan="7" class="opacitymedium">'.$langs->trans("IdsconnectNoSuppliers").'</td></tr>';
|
|
}
|
|
|
|
print '</table>';
|
|
|
|
if ($user->hasRight('idsconnect', 'config')) {
|
|
print '<div class="tabsAction">';
|
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/custom/idsconnect/supplier_card.php?action=create">'.$langs->trans("IdsconnectNewSupplier").'</a>';
|
|
print '</div>';
|
|
}
|
|
|
|
llxFooter();
|
|
$db->close();
|