Merge onlineshops development into onlineshops

This commit is contained in:
OpenXE 2024-08-31 13:17:22 +02:00
commit 6afedcd423
17 changed files with 2874 additions and 2889 deletions

View File

@ -10,6 +10,15 @@ use Xentral\Components\Logger\Handler\LogHandlerInterface;
final class Logger extends AbstractLogger
{
const EMERGENCY = 'emergency';
const ALERT = 'alert';
const CRITICAL = 'critical';
const ERROR = 'error';
const WARNING = 'warning';
const NOTICE = 'notice';
const INFO = 'info';
const DEBUG = 'debug';
/** @var LogHandlerInterface[] $levelHandlers */
private $logHandlers;

View File

@ -1,198 +1,270 @@
<?php
/*
include(dirname(__FILE__)."/../conf/main.conf.php");
include(dirname(__FILE__)."/../phpwf/plugins/class.mysql.php");
include(dirname(__FILE__)."/../www/lib/imap.inc.php");
include(dirname(__FILE__)."/../www/lib/class.erpapi.php");
include(dirname(__FILE__)."/../www/lib/class.erpapi_custom.php");
include(dirname(__FILE__)."/../www/lib/class.remote.php");
include(dirname(__FILE__)."/../www/lib/class.httpclient.php");
include(dirname(__FILE__)."/../www/lib/class.aes.php");
use Xentral\Components\Logger\Logger;
/** @var Logger $logger */
$logger = $app->Container->get('Logger');
class app_t {
var $DB;
var $erp;
var $user;
var $remote;
if (file_exists(dirname(__DIR__) . '/www/lib/class.erpapi_custom.php') && !class_exists('erpAPICustom')) {
include_once dirname(__DIR__) . '/www/lib/class.erpapi_custom.php';
}
*/
//ENDE
if(file_exists(dirname(__DIR__).'/www/lib/class.erpapi_custom.php') && !class_exists('erpAPICustom')){
include_once dirname(__DIR__) . '/www/lib/class.erpapi_custom.php';
if (empty($app->Conf)) {
$conf = new Config();
$app->Conf = $conf;
}
if(empty($app->Conf)) {
$conf = new Config();
$app->Conf = $conf;
if (empty($app->DB) || empty($app->DB->connection)) {
$app->DB = new DB($app->Conf->WFdbhost, $app->Conf->WFdbname, $app->Conf->WFdbuser, $app->Conf->WFdbpass, null, $app->Conf->WFdbport);
}
if(empty($app->DB) || empty($app->DB->connection)) {
$app->DB = new DB($app->Conf->WFdbhost, $app->Conf->WFdbname, $app->Conf->WFdbuser, $app->Conf->WFdbpass, null, $app->Conf->WFdbport);
}
if(!isset($app->erp) || !$app->erp) {
if (class_exists('erpAPICustom')) {
$erp = new erpAPICustom($app);
} else {
$erp = new erpAPI($app);
}
//$remote = new Remote($app);
$app->erp = $erp;
//$app->remote= $remote;
}
if(empty($app->remote)) {
if(is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')) {
if(!class_exists('RemoteCustom')){
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
if (!isset($app->erp) || !$app->erp) {
if (class_exists('erpAPICustom')) {
$erp = new erpAPICustom($app);
} else {
$erp = new erpAPI($app);
}
$app->erp = $erp;
}
if (empty($app->remote)) {
if (is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')) {
if (!class_exists('RemoteCustom')) {
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
}
$app->remote = new RemoteCustom($app);
} else {
$app->remote = new Remote($app);
}
$app->remote = new RemoteCustom($app);
}
else {
$app->remote = new Remote($app);
}
}
$app->erp->LogFile('Cronjob Artikeluebertragung Start');
$logger->debug(
'Start'
);
$app->DB->Update(
"UPDATE `prozessstarter`
"UPDATE `prozessstarter`
SET `mutexcounter` = `mutexcounter` + 1
WHERE `mutex` = 1 AND (`parameter` = 'artikeluebertragen') AND `aktiv` = 1"
);
if($app->DB->Select("SELECT `mutex` FROM `prozessstarter` WHERE (`parameter` = 'artikeluebertragen') LIMIT 1") == 1){
return;
if ($app->DB->Select("SELECT `mutex` FROM `prozessstarter` WHERE (`parameter` = 'artikeluebertragen') LIMIT 1") == 1) {
$logger->debug(
'Läuft bereits'
);
return;
}
$articles = $app->DB->SelectArr(
'SELECT `id`,`shop`,`artikel` FROM `shopexport_artikeluebertragen_check` ORDER BY `id` LIMIT 10'
'SELECT `id`,`shop`,`artikel` FROM `shopexport_artikeluebertragen_check` ORDER BY `id`'
);
if(!empty($articles)) {
/** @var Shopexport $objShopexport */
$objShopexport = $app->loadModule('shopexport');
if($objShopexport !== null && method_exists($objShopexport, 'addChangedArticles')) {
$objShopexport->addChangedArticles();
}
if (!empty($articles)) {
/** @var Shopexport $objShopexport */
$objShopexport = $app->loadModule('shopexport');
if ($objShopexport !== null && method_exists($objShopexport, 'addChangedArticles')) {
$objShopexport->addChangedArticles();
}
}
$logger->debug(
'Prepare',
[
'articles' => $articles
]
);
$anzChecked = [];
$anzChanged = [];
$lastids = [];
while(!empty($articles)) {
foreach($articles as $article) {
if(empty($anzChanged[$article['shop']])) {
$anzChanged[$article['shop']] = 0;
while (!empty($articles)) {
foreach ($articles as $article) {
if (empty($anzChanged[$article['shop']])) {
$anzChanged[$article['shop']] = 0;
}
if (empty($anzChecked[$article['shop']])) {
$anzChecked[$article['shop']] = 0;
}
if (!isset($lastids[$article['shop']])) {
$lastids[$article['shop']] = (int) $app->erp->GetKonfiguration(
'shopexport_artikeluebertragen_check_lastid_' . $article['shop']
);
}
$changed = $objShopexport->hasArticleHashChanged($article['artikel'], $article['shop']);
if ($changed['changed']) {
$app->DB->Insert(
sprintf(
'INSERT INTO `shopexport_artikeluebertragen` (`artikel`, `shop`, `check_nr`) VALUES (%d, %d, %d)',
$article['artikel'], $article['shop'], $lastids[$article['shop']]
)
);
$anzChanged[$article['shop']]++;
}
$anzChecked[$article['shop']]++;
$app->DB->Delete(
sprintf(
'DELETE FROM `shopexport_artikeluebertragen_check` WHERE `id` = %d',
$article['id']
)
);
$app->DB->Update(
sprintf(
"UPDATE `shopexport` SET `autosendarticle_last` = NOW() WHERE `id` = %d",
$article['shop']
)
);
}
if(empty($anzChecked[$article['shop']])) {
$anzChecked[$article['shop']] = 0;
$app->erp->SetKonfigurationValue(
'shopexport_artikeluebertragen_check_changed_' . $article['shop'],
$anzChanged[$article['shop']]
);
$app->erp->SetKonfigurationValue(
'shopexport_artikeluebertragen_check_checked_' . $article['shop'],
$anzChecked[$article['shop']]
);
if (method_exists($app->erp, 'canRunCronjob') && !$app->erp->canRunCronjob(['artikeluebertragen'])) {
$logger->debug(
'!canRunCronjob'
);
return;
}
if(!isset($lastids[$article['shop']])) {
$lastids[$article['shop']] = (int)$app->erp->GetKonfiguration(
'shopexport_artikeluebertragen_check_lastid_' . $article['shop']
);
}
$changed = $objShopexport->hasArticleHashChanged($article['artikel'], $article['shop']);
if($changed['changed']) {
$app->DB->Insert(
sprintf(
'INSERT INTO `shopexport_artikeluebertragen` (`artikel`, `shop`, `check_nr`) VALUES (%d, %d, %d)',
$article['artikel'], $article['shop'], $lastids[$article['shop']]
)
);
$anzChanged[$article['shop']]++;
}
$anzChecked[$article['shop']]++;
$app->DB->Delete(
sprintf(
'DELETE FROM `shopexport_artikeluebertragen_check` WHERE `id` = %d',
$article['id']
)
$articles = $app->DB->SelectArr(
'SELECT `id`,`shop`,`artikel` FROM `shopexport_artikeluebertragen_check` ORDER BY `id` LIMIT 10'
);
$app->DB->Update(
sprintf(
"UPDATE `shopexport` SET `autosendarticle_last` = NOW() WHERE `id` = %d",
$article['shop']
)
);
}
$app->erp->SetKonfigurationValue(
'shopexport_artikeluebertragen_check_changed_'.$article['shop'],
$anzChanged[$article['shop']]
);
$app->erp->SetKonfigurationValue(
'shopexport_artikeluebertragen_check_checked_'.$article['shop'],
$anzChecked[$article['shop']]
);
if(method_exists($app->erp, 'canRunCronjob') && !$app->erp->canRunCronjob(['artikeluebertragen'])) {
return;
}
$articles = $app->DB->SelectArr(
'SELECT `id`,`shop`,`artikel` FROM `shopexport_artikeluebertragen_check` ORDER BY `id` LIMIT 10'
);
$app->DB->Update(
"UPDATE `prozessstarter`
"UPDATE `prozessstarter`
SET `letzteausfuerhung`=NOW(), `mutex` = 1,`mutexcounter`=0
WHERE `parameter` = 'artikeluebertragen'"
);
);
}
$check = $app->DB->Select('SELECT COUNT(`id`) FROM `shopexport_artikeluebertragen`');
$app->DB->Update(
"UPDATE `prozessstarter`
"UPDATE `prozessstarter`
SET `letzteausfuerhung`=NOW(), `mutex` = 1,`mutexcounter`=0
WHERE `parameter` = 'artikeluebertragen'"
);
while($check > 0) {
$shopartikel = $app->DB->Query(
"SELECT `id`,`shop`,`artikel`,`check_nr` FROM `shopexport_artikeluebertragen` ORDER BY `id` LIMIT 10"
);
if(!empty($shopartikel)) {
$anz = 0;
while ($row = $app->DB->Fetch_Assoc($shopartikel)) {
if(!isset($lastids[$row['shop']])) {
$lastids[$row['shop']] = (int)$app->erp->GetKonfiguration('shopexport_artikeluebertragen_check_lastid_' . $row['shop']);
}
$anz++;
try {
$app->remote->RemoteSendArticleList($row['shop'], array($row['artikel']));
$app->erp->LagerSync($row['artikel'], true);
}
catch (Execption $exception) {
$app->erp->LogFile($app->DB->real_escape_string($exception->getMessage()));
}
$app->DB->Delete(
sprintf(
'DELETE FROM `shopexport_artikeluebertragen` WHERE `id`= %d LIMIT 1',
$row['id']
)
);
/*
while ($check > 0) {
$shopartikel = $app->DB->Query(
"SELECT `id`,`shop`,`artikel`,`check_nr` FROM `shopexport_artikeluebertragen` ORDER BY `id` LIMIT 10"
);
if (!empty($shopartikel)) {
$anz = 0;
while ($row = $app->DB->Fetch_Assoc($shopartikel)) {
if (!isset($lastids[$row['shop']])) {
$lastids[$row['shop']] = (int) $app->erp->GetKonfiguration('shopexport_artikeluebertragen_check_lastid_' . $row['shop']);
}
if(!empty($row['check_nr']) && $row['check_nr'] == $lastids[$row['shop']]) {
$transfered = 1+(int)$app->erp->GetKonfiguration('shopexport_artikeluebertragen_check_transfered_'.$row['shop']);
$app->erp->SetKonfigurationValue('shopexport_artikeluebertragen_check_transfered_'.$row['shop'], $transfered);
}
$anz++;
try {
$app->remote->RemoteSendArticleList($row['shop'], array($row['artikel']));
$app->erp->LagerSync($row['artikel'], true);
} catch (Execption $exception) {
$app->erp->LogFile($app->DB->real_escape_string($exception->getMessage()));
}
$app->DB->Delete(
sprintf(
'DELETE FROM `shopexport_artikeluebertragen` WHERE `id`= %d LIMIT 1',
$row['id']
)
);
$app->DB->Update(
"UPDATE `prozessstarter`
if (!empty($row['check_nr']) && $row['check_nr'] == $lastids[$row['shop']]) {
$transfered = 1 + (int) $app->erp->GetKonfiguration('shopexport_artikeluebertragen_check_transfered_' . $row['shop']);
$app->erp->SetKonfigurationValue('shopexport_artikeluebertragen_check_transfered_' . $row['shop'], $transfered);
}
$app->DB->Update(
"UPDATE `prozessstarter`
SET `letzteausfuerhung`=NOW(), `mutex` = 1,`mutexcounter`=0
WHERE `parameter` = 'artikeluebertragen'"
);
);
}
$app->DB->free($shopartikel);
}
$app->DB->free($shopartikel);
}
if (method_exists($app->erp, 'canRunCronjob') && !$app->erp->canRunCronjob(['artikeluebertragen'])) {
return;
}
if(method_exists($app->erp, 'canRunCronjob') && !$app->erp->canRunCronjob(['artikeluebertragen'])) {
return;
}
$check = $app->DB->Select('SELECT COUNT(`id`) FROM `shopexport_artikeluebertragen`');
}*/
//sleep(20); // das performance nicht total spinnt
$check = $app->DB->Select('SELECT COUNT(`id`) FROM `shopexport_artikeluebertragen`');
$sql = "SELECT DISTINCT `shop`, shopexport.`bezeichnung` FROM `shopexport_artikeluebertragen` INNER JOIN shopexport ON shopexport.id = `shop`";
$shops_to_transmit = $app->DB->SelectArr($sql);
//$app->erp->LogFile('Cronjob artikeluebertragen '.(!empty($shops_to_transmit)?count($shops_to_transmit):0)." shops", print_r($shops_to_transmit, true));
$logger->debug(
'{count} Shops',
[
'count' => (!empty($shops_to_transmit)?count($shops_to_transmit):0),
'shops_to_transmit' => $shops_to_transmit
]
);
foreach ($shops_to_transmit as $shop_to_transmit) {
$sql = "SELECT `artikel` FROM `shopexport_artikeluebertragen` WHERE `shop` = '".$shop_to_transmit['shop']."'";
$articles_to_transmit = $app->DB->SelectArr($sql);
$logger->debug(
'{bezeichnung} (Shop {shop_to_transmit}) {count} Artikel',
[
'shop_to_transmit' => $shop_to_transmit['shop'],
'bezeichnung' => $shop_to_transmit['bezeichnung'],
'count' => (!empty($articles_to_transmit)?count($articles_to_transmit):0),
'articles_to_transmit' => $articles_to_transmit
]
);
if (!empty($articles_to_transmit)) {
$article_ids_to_transmit = array_column($articles_to_transmit, 'artikel');
try {
$result = $app->remote->RemoteSendArticleList($shop_to_transmit['shop'], $article_ids_to_transmit); // Expected result is array $articles_to_transmit, field status contains transmission status
} catch (Execption $exception) {
$logger->error(
'Fehler {bezeichnung} (Shop {shop_to_transmit}) {count} Artikel',
[
'shop_to_transmit' => $shop_to_transmit['shop'],
'bezeichnung' => $shop_to_transmit['bezeichnung'],
'count' => (!empty($articles_to_transmit)?count($articles_to_transmit):0),
'exception' => $exception
]
);
}
$logger->debug(
'Ende {bezeichnung} (Shop {shop_to_transmit}) {count} Artikel',
[
'shop_to_transmit' => $shop_to_transmit['shop'],
'bezeichnung' => $shop_to_transmit['bezeichnung'],
'count' => (!empty($articles_to_transmit)?count($articles_to_transmit):0),
'result' => $result
]
);
// See description of return format in function class.remote.php -> RemoteSendArticleList()
foreach ($result['articlelist'] as $article) {
$app->DB->Delete(
sprintf(
'DELETE FROM `shopexport_artikeluebertragen` WHERE `artikel`= %d AND `shop` = %d',
$article['artikel'],
$shop_to_transmit['shop']
)
);
$app->erp->LagerSync($article['artikel'], true);
}
} else {
}
}
$logger->debug(
'Ende'
);
$app->DB->Update(
"UPDATE `prozessstarter`
"UPDATE `prozessstarter`
SET `letzteausfuerhung`= NOW(), `mutex` = 0,`mutexcounter`=0
WHERE `parameter` = 'artikeluebertragen'"
);

View File

@ -1,38 +1,37 @@
<?php
if(file_exists(dirname(__DIR__).'/www/lib/class.erpapi_custom.php') && !class_exists('erpAPICustom')) {
include_once dirname(__DIR__) . '/www/lib/class.erpapi_custom.php';
if (file_exists(dirname(__DIR__) . '/www/lib/class.erpapi_custom.php') && !class_exists('erpAPICustom')) {
include_once dirname(__DIR__) . '/www/lib/class.erpapi_custom.php';
}
if(empty($app) || !class_exists('ApplicationCore') || !($app instanceof ApplicationCore)) {
$app = new app_t();
if (empty($app) || !class_exists('ApplicationCore') || !($app instanceof ApplicationCore)) {
$app = new app_t();
}
if(empty($app->Conf)) {
$conf = new Config();
$app->Conf = $conf;
if (empty($app->Conf)) {
$conf = new Config();
$app->Conf = $conf;
}
if(empty($app->DB)) {
$app->DB = new DB($app->Conf->WFdbhost,$app->Conf->WFdbname,$app->Conf->WFdbuser,$app->Conf->WFdbpass,null,$app->Conf->WFdbport);
if (empty($app->DB)) {
$app->DB = new DB($app->Conf->WFdbhost, $app->Conf->WFdbname, $app->Conf->WFdbuser, $app->Conf->WFdbpass, null, $app->Conf->WFdbport);
}
if(empty($app->erp)) {
if(class_exists('erpAPICustom')) {
$erp = new erpAPICustom($app);
}
else {
$erp = new erpAPI($app);
}
$app->erp = $erp;
}
if(empty($app->remote)) {
if(is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')){
if(!class_exists('RemoteCustom')) {
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
if (empty($app->erp)) {
if (class_exists('erpAPICustom')) {
$erp = new erpAPICustom($app);
} else {
$erp = new erpAPI($app);
}
$app->erp = $erp;
}
if (empty($app->remote)) {
if (is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')) {
if (!class_exists('RemoteCustom')) {
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
}
$app->remote = new RemoteCustom($app);
} else {
$app->remote = new Remote($app);
}
$app->remote = new RemoteCustom($app);
}
else {
$app->remote = new Remote($app);
}
}
$app->erp->LogFile("Lagerzahlen-Synchronisation Start");
@ -40,34 +39,33 @@ $app->erp->LogFile("Lagerzahlen-Synchronisation Start");
$firmendatenid = $app->DB->Select("SELECT MAX(id) FROM firmendaten LIMIT 1");
$app->DB->Update(
$app->DB->Update(
"UPDATE `prozessstarter`
SET `mutexcounter` = `mutexcounter` + 1
WHERE `mutex` = 1 AND `parameter` = 'lagerzahlen' AND `aktiv` = 1"
);
if(!$app->DB->Select(
);
if (!$app->DB->Select(
"SELECT `id` FROM `prozessstarter` WHERE `mutex` = 0 AND `parameter` = 'lagerzahlen' AND `aktiv` = 1"
)) {
)) {
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende: Prozessstarter-Mutex nicht bereit");
return;
}
$shops = $app->DB->SelectArr('SELECT * FROM `shopexport` WHERE `aktiv` = 1');
if(empty($shops)) {
}
$shops = $app->DB->SelectArr('SELECT * FROM `shopexport` WHERE `aktiv` = 1');
if (empty($shops)) {
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende: Keine aktiven Shops");
return;
}
$shopByIds = [];
foreach($shops as $shop) {
}
$shopByIds = [];
foreach ($shops as $shop) {
$shopByIds[$shop['id']] = $shop;
}
$shopIds = array_keys($shopByIds);
$shopIdsStr = implode(',', $shopIds);
$hours = 12;
$hoursShop = 48;
$lagerartikel = $app->DB->SelectFirstCols(
"SELECT a.id
}
$shopIds = array_keys($shopByIds);
$shopIdsStr = implode(',', $shopIds);
$hours = 12;
$hoursShop = 48;
$lagerartikel = $app->DB->SelectFirstCols(
"SELECT a.id
FROM `artikel` AS `a`
LEFT JOIN (
SELECT ao2.artikel, 1 AS `autolagerlampe`,
@ -97,91 +95,86 @@ $firmendatenid = $app->DB->Select("SELECT MAX(id) FROM firmendaten LIMIT 1");
ORDER BY a.cache_lagerplatzinhaltmenge = -999 DESC,
ao.cache_reseted DESC,
a.laststorage_sync"
);
if(empty($lagerartikel)) {
);
if (empty($lagerartikel)) {
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende: Keine fälligen Artikel");
return;
}
}
try {
try {
$r = new ReflectionMethod($app->erp, 'LagerSync');
$params = $r->getParameters();
$anzargs = count($params);
}
catch(Exception $e) {
} catch (Exception $e) {
$anzargs = 2;
}
}
$clagerartikel = $lagerartikel?count($lagerartikel):0;
$app->erp->LogFile('Lagerzahlen-Synchronisation, Artikel gesamt: '.$clagerartikel);
foreach($lagerartikel as $ij => $articleId) {
$clagerartikel = $lagerartikel ? count($lagerartikel) : 0;
$app->erp->LogFile('Lagerzahlen-Synchronisation, Artikel gesamt: ' . $clagerartikel);
foreach ($lagerartikel as $articleCounter => $articleId) {
$app->DB->Update(
"UPDATE `prozessstarter`
"UPDATE `prozessstarter`
SET `mutex` = 1 , `mutexcounter` = 0, `letzteausfuerhung` = NOW()
WHERE `parameter` = 'lagerzahlen' AND `aktiv` = 1"
);
try {
if($anzargs > 2){
$message .= $app->erp->LagerSync($articleId, false, $shopByIds); // 2nd parameter is print_echo -> prints via echo to logfile (big print_r)
}else{
$message .= $app->erp->LagerSync($articleId, false);
}
if ($anzargs > 2) {
$message .= $app->erp->LagerSync($articleId, false, $shopByIds); // 2nd parameter is print_echo -> prints via echo to logfile (big print_r)
} else {
$message .= $app->erp->LagerSync($articleId, false);
}
} catch (Exception $exception) {
$message .= '<br>' . $exception->getMessage();
}
catch (Exception $exception) {
$message .= '<br>' . $exception->getMessage();
if ($message != '') {
$message .= '<br>';
}
if($message!='') {
$message .='<br>';
if ($articleCounter % 10 === 0 && method_exists($app->erp, 'canRunCronjob') && !$app->erp->canRunCronjob(['lagerzahlen'])) {
$app->DB->Update(
"UPDATE `prozessstarter`
SET `mutex` = 0 , `mutexcounter` = 0, `letzteausfuerhung` = NOW()
WHERE `parameter` = 'lagerzahlen' AND `aktiv` = 1"
);
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende: lagerzahlen-Job kann nicht geladen werden");
return;
}
if($ij % 10 === 0 && method_exists($app->erp, 'canRunCronjob')
&& !$app->erp->canRunCronjob(['lagerzahlen'])) {
$app->DB->Update(
"UPDATE `prozessstarter`
SET `mutex` = 0 , `mutexcounter` = 0, `letzteausfuerhung` = NOW()
WHERE `parameter` = 'lagerzahlen' AND `aktiv` = 1"
);
return;
}
usleep(10000);
}
$app->DB->Update(
// $app->erp->LogFile("Lagerzahlen-Synchronisation: Warte 10 Sekunden");
// usleep(10000);
}
$app->DB->Update(
"UPDATE `prozessstarter`
SET `mutex` = 0 , `mutexcounter` = 0, `letzteausfuerhung` = NOW()
WHERE `parameter` = 'lagerzahlen' AND `aktiv` = 1"
);
if($message !='' && $erp->Firmendaten('systemmailsabschalten') == 0 && $erp->GetFirmaMail()!='') {
);
if ($message != '' && $erp->Firmendaten('systemmailsabschalten') == 0 && $erp->GetFirmaMail() != '') {
try {
if($erp->Firmendaten('systemmailsempfaenger') != ''){
$erp->MailSend(
$erp->GetFirmaMail(),
$erp->GetFirmaName(),
$erp->Firmendaten('systemmailsempfaenger'),
'Lagerverwaltung',
'Systemmeldung: Auto Update Lagerlampen',
$message
);
}else{
if($erp->GetFirmaBCC1() != ''){
$erp->MailSend(
$erp->GetFirmaMail(),
$erp->GetFirmaName(),
$erp->GetFirmaBCC1(),
'Lagerverwaltung',
'Systemmeldung: Auto Update Lagerlampen',
$message
);
if ($erp->Firmendaten('systemmailsempfaenger') != '') {
$erp->MailSend(
$erp->GetFirmaMail(),
$erp->GetFirmaName(),
$erp->Firmendaten('systemmailsempfaenger'),
'Lagerverwaltung',
'Systemmeldung: Auto Update Lagerlampen',
$message
);
} else {
if ($erp->GetFirmaBCC1() != '') {
$erp->MailSend(
$erp->GetFirmaMail(),
$erp->GetFirmaName(),
$erp->GetFirmaBCC1(),
'Lagerverwaltung',
'Systemmeldung: Auto Update Lagerlampen',
$message
);
}
}
}
} catch (Exception $exception) {
$app->erp->LogFile("Lagerzahlen-Synchronisation Exception:" . $app->DB->real_escape_string($exception->getMessage()));
}
catch (Exception $exception) {
$app->erp->LogFile("Lagerzahlen-Synchronisation Exception:".$app->DB->real_escape_string($exception->getMessage()));
}
}
}
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende");
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende");

View File

@ -1,392 +1,388 @@
<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
if(!class_exists('ApplicationCore') && is_file(dirname(__DIR__).'/xentral_autoloader.php')) {
include_once dirname(__DIR__).'/xentral_autoloader.php';
if (!class_exists('ApplicationCore') && is_file(dirname(__DIR__) . '/xentral_autoloader.php')) {
include_once dirname(__DIR__) . '/xentral_autoloader.php';
}
include_once dirname(__DIR__).'/conf/main.conf.php';
include_once dirname(__DIR__).'/phpwf/plugins/class.mysql.php';
include_once dirname(__DIR__).'/phpwf/plugins/class.secure.php';
include_once dirname(__DIR__).'/phpwf/plugins/class.user.php';
if(file_exists(dirname(__DIR__).'/conf/user_defined.php')) {
include_once dirname(__DIR__).'/conf/user_defined.php';
}
if(!class_exists('FPDFWAWISION')){
if(file_exists(dirname(__DIR__).'/conf/user_defined.php')){
include_once dirname(__DIR__) . '/conf/main.conf.php';
include_once dirname(__DIR__) . '/phpwf/plugins/class.mysql.php';
include_once dirname(__DIR__) . '/phpwf/plugins/class.secure.php';
include_once dirname(__DIR__) . '/phpwf/plugins/class.user.php';
if (file_exists(dirname(__DIR__) . '/conf/user_defined.php')) {
include_once dirname(__DIR__) . '/conf/user_defined.php';
}
if(defined('USEFPDF3') && USEFPDF3 && file_exists(dirname(__DIR__) . '/www/lib/pdf/fpdf_3.php')){
require_once dirname(__DIR__) . '/www/lib/pdf/fpdf_3.php';
}else if(defined('USEFPDF2') && USEFPDF2 && file_exists(dirname(__DIR__) . '/www/lib/pdf/fpdf_2.php')){
require_once dirname(__DIR__) . '/www/lib/pdf/fpdf_2.php';
}else{
require_once dirname(__DIR__) . '/www/lib/pdf/fpdf.php';
}
}
include_once dirname(__DIR__).'/www/lib/pdf/fpdf_final.php';
include_once dirname(__DIR__).'/www/lib/imap.inc.php';
include_once dirname(__DIR__).'/www/lib/class.erpapi.php';
include_once dirname(__DIR__).'/www/lib/class.remote.php';
include_once dirname(__DIR__).'/www/lib/class.httpclient.php';
if (!class_exists('FPDFWAWISION')) {
if (file_exists(dirname(__DIR__) . '/conf/user_defined.php')) {
include_once dirname(__DIR__) . '/conf/user_defined.php';
}
if (defined('USEFPDF3') && USEFPDF3 && file_exists(dirname(__DIR__) . '/www/lib/pdf/fpdf_3.php')) {
require_once dirname(__DIR__) . '/www/lib/pdf/fpdf_3.php';
} else if (defined('USEFPDF2') && USEFPDF2 && file_exists(dirname(__DIR__) . '/www/lib/pdf/fpdf_2.php')) {
require_once dirname(__DIR__) . '/www/lib/pdf/fpdf_2.php';
} else {
require_once dirname(__DIR__) . '/www/lib/pdf/fpdf.php';
}
}
include_once dirname(__DIR__) . '/www/lib/pdf/fpdf_final.php';
include_once dirname(__DIR__) . '/www/lib/imap.inc.php';
include_once dirname(__DIR__) . '/www/lib/class.erpapi.php';
include_once dirname(__DIR__) . '/www/lib/class.remote.php';
include_once dirname(__DIR__) . '/www/lib/class.httpclient.php';
$aes = '';
$phpversion = (String)phpversion();
if($phpversion[0] == '7' && (int)$phpversion[2] > 0) {
$aes = '2';
$phpversion = (String) phpversion();
if ($phpversion[0] == '7' && (int) $phpversion[2] > 0) {
$aes = '2';
}
if($aes == 2 && is_file(dirname(__DIR__).'/www/lib/class.aes2.php')) {
include_once dirname(__DIR__).'/www/lib/class.aes2.php';
}
else{
include_once dirname(__DIR__) . '/www/lib/class.aes.php';
if ($aes == 2 && is_file(dirname(__DIR__) . '/www/lib/class.aes2.php')) {
include_once dirname(__DIR__) . '/www/lib/class.aes2.php';
} else {
include_once dirname(__DIR__) . '/www/lib/class.aes.php';
}
$classes = array('briefpapier','lieferschein','auftrag','anfrage','gutschrift','bestellung','rechnung','mahnwesen');
foreach($classes as $class)
{
if(file_exists(dirname(__DIR__).'/www/lib/dokumente/class.'.$class.'_custom.php'))
{
include_once dirname(__DIR__).'/www/lib/dokumente/class.'.$class.'_custom.php';
}
elseif(file_exists(dirname(__DIR__).'/www/lib/dokumente/class.'.$class.'.php')) {
include_once dirname(__DIR__).'/www/lib/dokumente/class.'.$class.'.php';
}
$classes = array('briefpapier', 'lieferschein', 'auftrag', 'anfrage', 'gutschrift', 'bestellung', 'rechnung', 'mahnwesen');
foreach ($classes as $class) {
if (file_exists(dirname(__DIR__) . '/www/lib/dokumente/class.' . $class . '_custom.php')) {
include_once dirname(__DIR__) . '/www/lib/dokumente/class.' . $class . '_custom.php';
} elseif (file_exists(dirname(__DIR__) . '/www/lib/dokumente/class.' . $class . '.php')) {
include_once dirname(__DIR__) . '/www/lib/dokumente/class.' . $class . '.php';
}
}
/*
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.briefpapier.php");
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.lieferschein.php");
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.auftrag.php");
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.angebot.php");
if(file_exists(dirname(__FILE__)."/../www/lib/dokumente/class.anfrage.php"))include_once(dirname(__FILE__)."/../www/lib/dokumente/class.anfrage.php");
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.gutschrift.php");
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.bestellung.php");
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.rechnung.php");
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.mahnwesen.php");*/
include_once dirname(__DIR__).'/phpwf/plugins/class.string.php';
if(!class_exists('app_t2'))
{
class app_t2 extends ApplicationCore {
var $DB;
var $erp;
var $User;
var $mail;
var $remote;
var $Secure;
function GetLandLang($isocode)
{
$flipped = array_flip($this->GetLaender());
if(isset($flipped[$isocode]))
$land = $flipped[$isocode];
else {
$land = 'unkown';
}
return $land;
}
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.briefpapier.php");
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.lieferschein.php");
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.auftrag.php");
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.angebot.php");
if(file_exists(dirname(__FILE__)."/../www/lib/dokumente/class.anfrage.php"))include_once(dirname(__FILE__)."/../www/lib/dokumente/class.anfrage.php");
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.gutschrift.php");
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.bestellung.php");
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.rechnung.php");
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.mahnwesen.php"); */
include_once dirname(__DIR__) . '/phpwf/plugins/class.string.php';
if (!class_exists('app_t2')) {
class app_t2 extends ApplicationCore {
var $DB;
var $erp;
var $User;
var $mail;
var $remote;
var $Secure;
function GetLandLang($isocode) {
$flipped = array_flip($this->GetLaender());
if (isset($flipped[$isocode]))
$land = $flipped[$isocode];
else {
$land = 'unkown';
}
return $land;
}
function GetLaender() {
$laender = array(
'Afghanistan' => 'AF',
'&Auml;gypten' => 'EG',
'Albanien' => 'AL',
'Algerien' => 'DZ',
'Andorra' => 'AD',
'Angola' => 'AO',
'Anguilla' => 'AI',
'Antarktis' => 'AQ',
'Antigua und Barbuda' => 'AG',
'&Auml;quatorial Guinea' => 'GQ',
'Argentinien' => 'AR',
'Armenien' => 'AM',
'Aruba' => 'AW',
'Aserbaidschan' => 'AZ',
'&Auml;thiopien' => 'ET',
'Australien' => 'AU',
'Bahamas' => 'BS',
'Bahrain' => 'BH',
'Bangladesh' => 'BD',
'Barbados' => 'BB',
'Belgien' => 'BE',
'Belize' => 'BZ',
'Benin' => 'BJ',
'Bermudas' => 'BM',
'Bhutan' => 'BT',
'Birma' => 'MM',
'Bolivien' => 'BO',
'Bosnien-Herzegowina' => 'BA',
'Botswana' => 'BW',
'Bouvet Inseln' => 'BV',
'Brasilien' => 'BR',
'Britisch-Indischer Ozean' => 'IO',
'Brunei' => 'BN',
'Bulgarien' => 'BG',
'Burkina Faso' => 'BF',
'Burundi' => 'BI',
'Chile' => 'CL',
'China' => 'CN',
'Christmas Island' => 'CX',
'Cook Inseln' => 'CK',
'Costa Rica' => 'CR',
'D&auml;nemark' => 'DK',
'Deutschland' => 'DE',
'Djibuti' => 'DJ',
'Dominika' => 'DM',
'Dominikanische Republik' => 'DO',
'Ecuador' => 'EC',
'El Salvador' => 'SV',
'Elfenbeink&uuml;ste' => 'CI',
'Eritrea' => 'ER',
'Estland' => 'EE',
'Falkland Inseln' => 'FK',
'F&auml;r&ouml;er Inseln' => 'FO',
'Fidschi' => 'FJ',
'Finnland' => 'FI',
'Frankreich' => 'FR',
'Franz&ouml;sisch Guyana' => 'GF',
'Franz&ouml;sisch Polynesien' => 'PF',
'Franz&ouml;sisches S&uuml;d-Territorium' => 'TF',
'Gabun' => 'GA',
'Gambia' => 'GM',
'Georgien' => 'GE',
'Ghana' => 'GH',
'Gibraltar' => 'GI',
'Grenada' => 'GD',
'Griechenland' => 'GR',
'Gr&ouml;nland' => 'GL',
'Großbritannien' => 'UK',
'Großbritannien (UK)' => 'GB',
'Guadeloupe' => 'GP',
'Guam' => 'GU',
'Guatemala' => 'GT',
'Guinea' => 'GN',
'Guinea Bissau' => 'GW',
'Guyana' => 'GY',
'Haiti' => 'HT',
'Heard und McDonald Islands' => 'HM',
'Honduras' => 'HN',
'Hong Kong' => 'HK',
'Indien' => 'IN',
'Indonesien' => 'ID',
'Irak' => 'IQ',
'Iran' => 'IR',
'Irland' => 'IE',
'Island' => 'IS',
'Israel' => 'IL',
'Italien' => 'IT',
'Jamaika' => 'JM',
'Japan' => 'JP',
'Jemen' => 'YE',
'Jordanien' => 'JO',
'Jugoslawien' => 'YU',
'Kaiman Inseln' => 'KY',
'Kambodscha' => 'KH',
'Kamerun' => 'CM',
'Kanada' => 'CA',
'Kap Verde' => 'CV',
'Kasachstan' => 'KZ',
'Kenia' => 'KE',
'Kirgisistan' => 'KG',
'Kiribati' => 'KI',
'Kokosinseln' => 'CC',
'Kolumbien' => 'CO',
'Komoren' => 'KM',
'Kongo' => 'CG',
'Kongo, Demokratische Republik' => 'CD',
'Kosovo' => 'KO',
'Kroatien' => 'HR',
'Kuba' => 'CU',
'Kuwait' => 'KW',
'Laos' => 'LA',
'Lesotho' => 'LS',
'Lettland' => 'LV',
'Libanon' => 'LB',
'Liberia' => 'LR',
'Libyen' => 'LY',
'Liechtenstein' => 'LI',
'Litauen' => 'LT',
'Luxemburg' => 'LU',
'Macao' => 'MO',
'Madagaskar' => 'MG',
'Malawi' => 'MW',
'Malaysia' => 'MY',
'Malediven' => 'MV',
'Mali' => 'ML',
'Malta' => 'MT',
'Marianen' => 'MP',
'Marokko' => 'MA',
'Marshall Inseln' => 'MH',
'Martinique' => 'MQ',
'Mauretanien' => 'MR',
'Mauritius' => 'MU',
'Mayotte' => 'YT',
'Mazedonien' => 'MK',
'Mexiko' => 'MX',
'Mikronesien' => 'FM',
'Mocambique' => 'MZ',
'Moldavien' => 'MD',
'Monaco' => 'MC',
'Mongolei' => 'MN',
'Montenegro' => 'ME',
'Montserrat' => 'MS',
'Namibia' => 'NA',
'Nauru' => 'NR',
'Nepal' => 'NP',
'Neukaledonien' => 'NC',
'Neuseeland' => 'NZ',
'Nicaragua' => 'NI',
'Niederlande' => 'NL',
'Niederl&auml;ndische Antillen' => 'AN',
'Niger' => 'NE',
'Nigeria' => 'NG',
'Niue' => 'NU',
'Nord Korea' => 'KP',
'Norfolk Inseln' => 'NF',
'Norwegen' => 'NO',
'Oman' => 'OM',
'&Ouml;sterreich' => 'AT',
'Pakistan' => 'PK',
'Pal&auml;stina' => 'PS',
'Palau' => 'PW',
'Panama' => 'PA',
'Papua Neuguinea' => 'PG',
'Paraguay' => 'PY',
'Peru' => 'PE',
'Philippinen' => 'PH',
'Pitcairn' => 'PN',
'Polen' => 'PL',
'Portugal' => 'PT',
'Puerto Rico' => 'PR',
'Qatar' => 'QA',
'Reunion' => 'RE',
'Ruanda' => 'RW',
'Rum&auml;nien' => 'RO',
'Ru&szlig;land' => 'RU',
'Saint Lucia' => 'LC',
'Sambia' => 'ZM',
'Samoa' => 'AS',
'Samoa' => 'WS',
'San Marino' => 'SM',
'Sao Tome' => 'ST',
'Saudi Arabien' => 'SA',
'Schweden' => 'SE',
'Schweiz' => 'CH',
'Senegal' => 'SN',
'Serbien' => 'RS',
'Seychellen' => 'SC',
'Sierra Leone' => 'SL',
'Singapur' => 'SG',
'Slowakei -slowakische Republik-' => 'SK',
'Slowenien' => 'SI',
'Solomon Inseln' => 'SB',
'Somalia' => 'SO',
'South Georgia, South Sandwich Isl.' => 'GS',
'Spanien' => 'ES',
'Sri Lanka' => 'LK',
'St. Helena' => 'SH',
'St. Kitts Nevis Anguilla' => 'KN',
'St. Pierre und Miquelon' => 'PM',
'St. Vincent' => 'VC',
'S&uuml;d Korea' => 'KR',
'S&uuml;dafrika' => 'ZA',
'Sudan' => 'SD',
'Surinam' => 'SR',
'Svalbard und Jan Mayen Islands' => 'SJ',
'Swasiland' => 'SZ',
'Syrien' => 'SY',
'Tadschikistan' => 'TJ',
'Taiwan' => 'TW',
'Tansania' => 'TZ',
'Thailand' => 'TH',
'Timor' => 'TP',
'Togo' => 'TG',
'Tokelau' => 'TK',
'Tonga' => 'TO',
'Trinidad Tobago' => 'TT',
'Tschad' => 'TD',
'Tschechische Republik' => 'CZ',
'Tunesien' => 'TN',
'T&uuml;rkei' => 'TR',
'Turkmenistan' => 'TM',
'Turks und Kaikos Inseln' => 'TC',
'Tuvalu' => 'TV',
'Uganda' => 'UG',
'Ukraine' => 'UA',
'Ungarn' => 'HU',
'Uruguay' => 'UY',
'Usbekistan' => 'UZ',
'Vanuatu' => 'VU',
'Vatikan' => 'VA',
'Venezuela' => 'VE',
'Vereinigte Arabische Emirate' => 'AE',
'Vereinigte Staaten von Amerika' => 'US',
'Vietnam' => 'VN',
'Virgin Island (Brit.)' => 'VG',
'Virgin Island (USA)' => 'VI',
'Wallis et Futuna' => 'WF',
'Wei&szlig;ru&szlig;land' => 'BY',
'Westsahara' => 'EH',
'Zentralafrikanische Republik' => 'CF',
'Zimbabwe' => 'ZW',
'Zypern' => 'CY'
);
return $laender;
}
}
function GetLaender()
{
$laender = array(
'Afghanistan' => 'AF',
'&Auml;gypten' => 'EG',
'Albanien' => 'AL',
'Algerien' => 'DZ',
'Andorra' => 'AD',
'Angola' => 'AO',
'Anguilla' => 'AI',
'Antarktis' => 'AQ',
'Antigua und Barbuda' => 'AG',
'&Auml;quatorial Guinea' => 'GQ',
'Argentinien' => 'AR',
'Armenien' => 'AM',
'Aruba' => 'AW',
'Aserbaidschan' => 'AZ',
'&Auml;thiopien' => 'ET',
'Australien' => 'AU',
'Bahamas' => 'BS',
'Bahrain' => 'BH',
'Bangladesh' => 'BD',
'Barbados' => 'BB',
'Belgien' => 'BE',
'Belize' => 'BZ',
'Benin' => 'BJ',
'Bermudas' => 'BM',
'Bhutan' => 'BT',
'Birma' => 'MM',
'Bolivien' => 'BO',
'Bosnien-Herzegowina' => 'BA',
'Botswana' => 'BW',
'Bouvet Inseln' => 'BV',
'Brasilien' => 'BR',
'Britisch-Indischer Ozean' => 'IO',
'Brunei' => 'BN',
'Bulgarien' => 'BG',
'Burkina Faso' => 'BF',
'Burundi' => 'BI',
'Chile' => 'CL',
'China' => 'CN',
'Christmas Island' => 'CX',
'Cook Inseln' => 'CK',
'Costa Rica' => 'CR',
'D&auml;nemark' => 'DK',
'Deutschland' => 'DE',
'Djibuti' => 'DJ',
'Dominika' => 'DM',
'Dominikanische Republik' => 'DO',
'Ecuador' => 'EC',
'El Salvador' => 'SV',
'Elfenbeink&uuml;ste' => 'CI',
'Eritrea' => 'ER',
'Estland' => 'EE',
'Falkland Inseln' => 'FK',
'F&auml;r&ouml;er Inseln' => 'FO',
'Fidschi' => 'FJ',
'Finnland' => 'FI',
'Frankreich' => 'FR',
'Franz&ouml;sisch Guyana' => 'GF',
'Franz&ouml;sisch Polynesien' => 'PF',
'Franz&ouml;sisches S&uuml;d-Territorium' => 'TF',
'Gabun' => 'GA',
'Gambia' => 'GM',
'Georgien' => 'GE',
'Ghana' => 'GH',
'Gibraltar' => 'GI',
'Grenada' => 'GD',
'Griechenland' => 'GR',
'Gr&ouml;nland' => 'GL',
'Großbritannien' => 'UK',
'Großbritannien (UK)' => 'GB',
'Guadeloupe' => 'GP',
'Guam' => 'GU',
'Guatemala' => 'GT',
'Guinea' => 'GN',
'Guinea Bissau' => 'GW',
'Guyana' => 'GY',
'Haiti' => 'HT',
'Heard und McDonald Islands' => 'HM',
'Honduras' => 'HN',
'Hong Kong' => 'HK',
'Indien' => 'IN',
'Indonesien' => 'ID',
'Irak' => 'IQ',
'Iran' => 'IR',
'Irland' => 'IE',
'Island' => 'IS',
'Israel' => 'IL',
'Italien' => 'IT',
'Jamaika' => 'JM',
'Japan' => 'JP',
'Jemen' => 'YE',
'Jordanien' => 'JO',
'Jugoslawien' => 'YU',
'Kaiman Inseln' => 'KY',
'Kambodscha' => 'KH',
'Kamerun' => 'CM',
'Kanada' => 'CA',
'Kap Verde' => 'CV',
'Kasachstan' => 'KZ',
'Kenia' => 'KE',
'Kirgisistan' => 'KG',
'Kiribati' => 'KI',
'Kokosinseln' => 'CC',
'Kolumbien' => 'CO',
'Komoren' => 'KM',
'Kongo' => 'CG',
'Kongo, Demokratische Republik' => 'CD',
'Kosovo' => 'KO',
'Kroatien' => 'HR',
'Kuba' => 'CU',
'Kuwait' => 'KW',
'Laos' => 'LA',
'Lesotho' => 'LS',
'Lettland' => 'LV',
'Libanon' => 'LB',
'Liberia' => 'LR',
'Libyen' => 'LY',
'Liechtenstein' => 'LI',
'Litauen' => 'LT',
'Luxemburg' => 'LU',
'Macao' => 'MO',
'Madagaskar' => 'MG',
'Malawi' => 'MW',
'Malaysia' => 'MY',
'Malediven' => 'MV',
'Mali' => 'ML',
'Malta' => 'MT',
'Marianen' => 'MP',
'Marokko' => 'MA',
'Marshall Inseln' => 'MH',
'Martinique' => 'MQ',
'Mauretanien' => 'MR',
'Mauritius' => 'MU',
'Mayotte' => 'YT',
'Mazedonien' => 'MK',
'Mexiko' => 'MX',
'Mikronesien' => 'FM',
'Mocambique' => 'MZ',
'Moldavien' => 'MD',
'Monaco' => 'MC',
'Mongolei' => 'MN',
'Montenegro' => 'ME',
'Montserrat' => 'MS',
'Namibia' => 'NA',
'Nauru' => 'NR',
'Nepal' => 'NP',
'Neukaledonien' => 'NC',
'Neuseeland' => 'NZ',
'Nicaragua' => 'NI',
'Niederlande' => 'NL',
'Niederl&auml;ndische Antillen' => 'AN',
'Niger' => 'NE',
'Nigeria' => 'NG',
'Niue' => 'NU',
'Nord Korea' => 'KP',
'Norfolk Inseln' => 'NF',
'Norwegen' => 'NO',
'Oman' => 'OM',
'&Ouml;sterreich' => 'AT',
'Pakistan' => 'PK',
'Pal&auml;stina' => 'PS',
'Palau' => 'PW',
'Panama' => 'PA',
'Papua Neuguinea' => 'PG',
'Paraguay' => 'PY',
'Peru' => 'PE',
'Philippinen' => 'PH',
'Pitcairn' => 'PN',
'Polen' => 'PL',
'Portugal' => 'PT',
'Puerto Rico' => 'PR',
'Qatar' => 'QA',
'Reunion' => 'RE',
'Ruanda' => 'RW',
'Rum&auml;nien' => 'RO',
'Ru&szlig;land' => 'RU',
'Saint Lucia' => 'LC',
'Sambia' => 'ZM',
'Samoa' => 'AS',
'Samoa' => 'WS',
'San Marino' => 'SM',
'Sao Tome' => 'ST',
'Saudi Arabien' => 'SA',
'Schweden' => 'SE',
'Schweiz' => 'CH',
'Senegal' => 'SN',
'Serbien' => 'RS',
'Seychellen' => 'SC',
'Sierra Leone' => 'SL',
'Singapur' => 'SG',
'Slowakei -slowakische Republik-' => 'SK',
'Slowenien' => 'SI',
'Solomon Inseln' => 'SB',
'Somalia' => 'SO',
'South Georgia, South Sandwich Isl.' => 'GS',
'Spanien' => 'ES',
'Sri Lanka' => 'LK',
'St. Helena' => 'SH',
'St. Kitts Nevis Anguilla' => 'KN',
'St. Pierre und Miquelon' => 'PM',
'St. Vincent' => 'VC',
'S&uuml;d Korea' => 'KR',
'S&uuml;dafrika' => 'ZA',
'Sudan' => 'SD',
'Surinam' => 'SR',
'Svalbard und Jan Mayen Islands' => 'SJ',
'Swasiland' => 'SZ',
'Syrien' => 'SY',
'Tadschikistan' => 'TJ',
'Taiwan' => 'TW',
'Tansania' => 'TZ',
'Thailand' => 'TH',
'Timor' => 'TP',
'Togo' => 'TG',
'Tokelau' => 'TK',
'Tonga' => 'TO',
'Trinidad Tobago' => 'TT',
'Tschad' => 'TD',
'Tschechische Republik' => 'CZ',
'Tunesien' => 'TN',
'T&uuml;rkei' => 'TR',
'Turkmenistan' => 'TM',
'Turks und Kaikos Inseln' => 'TC',
'Tuvalu' => 'TV',
'Uganda' => 'UG',
'Ukraine' => 'UA',
'Ungarn' => 'HU',
'Uruguay' => 'UY',
'Usbekistan' => 'UZ',
'Vanuatu' => 'VU',
'Vatikan' => 'VA',
'Venezuela' => 'VE',
'Vereinigte Arabische Emirate' => 'AE',
'Vereinigte Staaten von Amerika' => 'US',
'Vietnam' => 'VN',
'Virgin Island (Brit.)' => 'VG',
'Virgin Island (USA)' => 'VI',
'Wallis et Futuna' => 'WF',
'Wei&szlig;ru&szlig;land' => 'BY',
'Westsahara' => 'EH',
'Zentralafrikanische Republik' => 'CF',
'Zimbabwe' => 'ZW',
'Zypern' => 'CY'
);
return $laender;
}
}
}
//ENDE
if(empty($app) || !class_exists('ApplicationCore') || !($app instanceof ApplicationCore)) {
if (empty($app) || !class_exists('ApplicationCore') || !($app instanceof ApplicationCore)) {
$app = new app_t2();
}
if(empty($app->Conf)){
}
if (empty($app->Conf)) {
$conf = new Config();
$app->Conf = $conf;
}
if(empty($app->DB)){
}
if (empty($app->DB)) {
$app->DB = new DB($app->Conf->WFdbhost, $app->Conf->WFdbname, $app->Conf->WFdbuser, $app->Conf->WFdbpass, null, $app->Conf->WFdbport);
}
if(empty($app->erp)){
}
if (empty($app->erp)) {
$erp = new erpAPI($app);
$app->erp = $erp;
}
$app->String = new WawiString();
if(empty($app->remote)){
if(is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')){
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
$app->remote = new RemoteCustom($app);
}
$app->String = new WawiString();
if (empty($app->remote)) {
if (is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')) {
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
$app->remote = new RemoteCustom($app);
} else {
$app->remote = new Remote($app);
}
else{
$app->remote = new Remote($app);
}
}
//$app->remote = new Remote($app);
$app->Secure = new Secure($app);
$app->User = new User($app);
if(!defined('FPDF_FONTPATH')) {
define('FPDF_FONTPATH',dirname(__DIR__).'/www/lib/pdf/font/');
}
}
//$app->remote = new Remote($app);
$app->Secure = new Secure($app);
$app->User = new User($app);
if (!defined('FPDF_FONTPATH')) {
define('FPDF_FONTPATH', dirname(__DIR__) . '/www/lib/pdf/font/');
}
//ENDE
const MAXIMUM_NUMBER_OF_TRIES = 10;
const MAXIMUM_NUMBER_OF_TRIES = 10;
$shops = $app->DB->SelectFirstCols(
'SELECT id FROM shopexport WHERE auftragabgleich = 1 AND aktiv = 1 AND demomodus <> 1 AND sendonlywithtracking = 0'
);
if(empty($shops)) {
$shops = $app->DB->SelectFirstCols(
'SELECT id FROM shopexport WHERE auftragabgleich = 1 AND aktiv = 1 AND demomodus <> 1 AND sendonlywithtracking = 0'
);
if (empty($shops)) {
return;
}
$app->DB->Update("UPDATE prozessstarter SET mutexcounter = mutexcounter + 1 WHERE mutex = 1 AND (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
if(!$app->DB->Select("SELECT id FROM prozessstarter WHERE mutex = 0 AND (parameter = 'shop_rueckmeldungen') AND aktiv = 1")) {
}
$app->DB->Update("UPDATE prozessstarter SET mutexcounter = mutexcounter + 1 WHERE mutex = 1 AND (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
if (!$app->DB->Select("SELECT id FROM prozessstarter WHERE mutex = 0 AND (parameter = 'shop_rueckmeldungen') AND aktiv = 1")) {
return;
}
$app->DB->Update("UPDATE prozessstarter SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now() WHERE (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
}
$app->DB->Update("UPDATE prozessstarter SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now() WHERE (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
$subwhere = sprintf(' a.shop IN (%s) ', implode(',', $shops));
$join = '';
$where = '';
$app->erp->RunHook('shop_rueckmeldung', 2, $join, $where);
$subwhere = sprintf(' a.shop IN (%s) ', implode(',', $shops));
$join = '';
$where = '';
$app->erp->RunHook('shop_rueckmeldung', 2, $join, $where);
$sql = "SELECT DISTINCT a.id, a.shop
FROM auftrag a
LEFT JOIN lieferschein l on l.auftragid = a.id
@ -404,7 +400,7 @@ function GetLaender()
((pr.kommissionierverfahren = 'lieferschein' OR pr.kommissionierverfahren = 'rechnungsmail') AND isnull(v.id))
)
AND (ISNULL(a.shop_status_update_last_attempt_at) OR a.shop_status_update_last_attempt_at < DATE_SUB(NOW(), INTERVAL 4 HOUR))
AND a.shop_status_update_attempt <= ".MAXIMUM_NUMBER_OF_TRIES."
AND a.shop_status_update_attempt <= " . MAXIMUM_NUMBER_OF_TRIES . "
$where
ORDER BY a.id, l.id DESC, v.id DESC
";
@ -412,33 +408,33 @@ function GetLaender()
$auftraege = $app->DB->SelectArr($sql);
if(!empty($auftraege)) {
$app->DB->Update(
"UPDATE prozessstarter
"UPDATE prozessstarter
SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now()
WHERE (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1"
);
$auftragid = null;
$countRequests = 0;
foreach($auftraege as $auftrag) {
if($auftrag['id'] != $auftragid) {
$countRequests++;
$auftragid = $auftrag['id'];
$app->remote->RemoteUpdateAuftrag($auftrag['shop'], $auftrag['id']);
if($countRequests % 10 === 0) {
$app->DB->Update(
"UPDATE prozessstarter
foreach ($auftraege as $auftrag) {
if ($auftrag['id'] != $auftragid) {
$countRequests++;
$auftragid = $auftrag['id'];
$app->remote->RemoteUpdateAuftrag($auftrag['shop'], $auftrag['id']);
if ($countRequests % 10 === 0) {
$app->DB->Update(
"UPDATE prozessstarter
SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now()
WHERE parameter = 'shop_rueckmeldungen' AND aktiv = 1"
);
);
}
}
}
}
unset($auftraege);
}
$app->DB->Update("UPDATE prozessstarter SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now() WHERE (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
}
$app->DB->Update("UPDATE prozessstarter SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now() WHERE (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
//Zahlungsstatus
$query = $app->DB->Query(
"SELECT a.id
//Zahlungsstatus
$query = $app->DB->Query(
"SELECT a.id
FROM `auftrag` AS `a`
LEFT JOIN `rechnung` AS `r1` ON r1.id = a.rechnungid
LEFT JOIN `rechnung` AS `r2` ON r2.auftragid = a.id
@ -449,21 +445,22 @@ function GetLaender()
AND (r1.zahlungsstatus = 'bezahlt' OR r2.zahlungsstatus = 'bezahlt') AND DATEDIFF(NOW(), a.datum) <= 28
GROUP BY a.id
LIMIT 1000"
);
if($query) {
);
if ($query) {
$countRequests = 0;
while($row = $app->DB->Fetch_Assoc($query)) {
$app->erp->ImportUpdateZahlungsstatus($row['id']);
$countRequests++;
if($countRequests % 10 === 0) {
$app->DB->Update(
"UPDATE prozessstarter
while ($row = $app->DB->Fetch_Assoc($query)) {
$app->erp->ImportUpdateZahlungsstatus($row['id']);
$countRequests++;
if ($countRequests % 10 === 0) {
$app->DB->Update(
"UPDATE prozessstarter
SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now()
WHERE parameter = 'shop_rueckmeldungen' AND aktiv = 1"
);
}
);
}
}
$app->DB->free($query);
}
}
$app->DB->Update("UPDATE prozessstarter SET mutex = 0, mutexcounter = 0, letzteausfuerhung = now() WHERE (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
$app->DB->Update("UPDATE prozessstarter SET mutex = 0, mutexcounter = 0, letzteausfuerhung = now() WHERE (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");

View File

@ -18692,6 +18692,14 @@
"id"
],
"Non_unique": ""
},
{
"Key_name": "eigenschaft_unique",
"Index_type": "BTREE",
"columns": [
"name"
],
"Non_unique": "UNIQUE"
}
]
},
@ -18802,6 +18810,15 @@
"artikel"
],
"Non_unique": ""
},
{
"Key_name": "eigenschaft_artikel_unique",
"Index_type": "BTREE",
"columns": [
"artikel",
"artikeleigenschaften"
],
"Non_unique": "UNIQUE"
}
]
},

View File

@ -1329,6 +1329,46 @@ Class ShopimporterBase{
'metabeschreibung' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'metakeywords' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'freifelder' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
],
'shopimporter_mirakl' => [
'auftrag' => ['createarticle' => self::UNDEFINED, 'updatearticle' => self::UNDEFINED, 'importarticle' => self::UNDEFINED, 'importorder' => self::UNDEFINED],
'artikelname' => ['createarticle' => self::MUST, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CAN],
'artikelnummer' => ['createarticle' => self::MUST, 'updatearticle' => self::MUST, 'importarticle' => self::CANNOT, 'importorder' => self::CAN],
'aktiv' => ['createarticle' => self::MUST, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'restmenge' => ['createarticle' => self::CANNOT, 'updatearticle' => self::CANNOT, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'beschreibung' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CAN],
'ean' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'hersteller' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'herstellerlink' => ['createarticle' => self::CANNOT, 'updatearticle' => self::CANNOT, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'herstellernummer' => ['createarticle' => self::CANNOT, 'updatearticle' => self::CANNOT, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'zolltarifnummer' => ['createarticle' => self::CANNOT, 'updatearticle' => self::CANNOT, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'gewicht' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'einheit' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'laenge' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'hoehe' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'breite' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'verkaufspreis' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CAN],
'pseudopreis' => ['createarticle' => self::CANNOT, 'updatearticle' => self::CANNOT, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'lagerzahlen' => ['createarticle' => self::MUST, 'updatearticle' => self::MUST, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'pseudolager' => ['createarticle' => self::MUST, 'updatearticle' => self::MUST, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'staffelpreise' => ['createarticle' => self::MUST, 'updatearticle' => self::MUST, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'gruppenpreise' => ['createarticle' => self::CANNOT, 'updatearticle' => self::CANNOT, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'fremdsprachen' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'kategorie' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'kategoriebaum' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'bilder' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'varianten' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'matrixeigenschaften' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'über 5000 Varianten' => ['createarticle' => self::CANNOT, 'updatearticle' => self::CANNOT, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'eigenschaften' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'crossselling' => ['createarticle' => self::CANNOT, 'updatearticle' => self::CANNOT, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'kurztext' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'herkunftsland' => ['createarticle' => self::CANNOT, 'updatearticle' => self::CANNOT, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'umsatzsteuer' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'metatitel' => ['createarticle' => self::CANNOT, 'updatearticle' => self::CANNOT, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'metabeschreibung' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'metakeywords' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
'freifelder' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
],
'shopimporter_modified' => [
'auftrag' => ['createarticle' => self::UNDEFINED, 'updatearticle' => self::UNDEFINED, 'importarticle' => self::UNDEFINED, 'importorder' => self::UNDEFINED],

View File

@ -17199,7 +17199,7 @@ function CheckShopTabelle($artikel)
return $taxrates;
}
function ImportAuftrag($adresse,$warenkorb,$projekt,$shop="",$auftrag=0)
function ImportAuftrag($adresse,$warenkorb,$projekt,$shop="",$auftrag=0) : array
{
$this->RunHook('ImportAuftragBefore',4, $adresse,$warenkorb,$projekt,$shop);
if(!empty($this->app->stringcleaner)){
@ -17711,6 +17711,9 @@ function CheckShopTabelle($artikel)
if($doctype === 'angebot'){
$this->app->DB->Update("UPDATE angebot SET anfrage = '".$this->app->DB->real_escape_string($warenkorb['onlinebestellnummer'])."' WHERE id = '$auftrag' LIMIT 1");
}
if($doctype === 'auftrag'){
$this->app->DB->Update("UPDATE auftrag SET ihrebestellnummer = '".$this->app->DB->real_escape_string($warenkorb['ihrebestellnummer'])."' WHERE id = '$auftrag' LIMIT 1");
}
$this->app->DB->Update("UPDATE $doctype SET
belegnr='$belegnr',
@ -18674,16 +18677,24 @@ function CheckShopTabelle($artikel)
$artikelporto = $artikelportoermaessigt;
}
if(empty($artikelporto) && $this->app->DB->Select("SELECT portoartikelanlegen FROM shopexport WHERE id = '$shop' LIMIT 1"))
{
if($warenkorb['versandkostennetto'] != 0 || $warenkorb['versandkostenbrutto'] != 0 || $portocheck == 1){
$portoartikelarr = array('projekt'=>$projekt,'porto'=>1, 'lagerartikel'=>0,'name_de'=>'Porto','umsatzsteuer'=>'normal');
$artikelporto = $this->app->erp->InsertUpdateArtikel($portoartikelarr);
if($artikelporto){
$this->app->DB->Update("UPDATE shopexport SET artikelporto = '$artikelporto' WHERE id = '$shop' AND artikelporto = 0 LIMIT 1");
}
if(empty($artikelporto)) {
if ($this->app->DB->Select("SELECT portoartikelanlegen FROM shopexport WHERE id = '$shop' LIMIT 1"))
{
if($warenkorb['versandkostennetto'] != 0 || $warenkorb['versandkostenbrutto'] != 0 || $portocheck == 1)
{
$portoartikelarr = array('projekt'=>$projekt,'porto'=>1, 'lagerartikel'=>0,'name_de'=>'Porto','umsatzsteuer'=>'normal');
$artikelporto = $this->app->erp->InsertUpdateArtikel($portoartikelarr);
if($artikelporto)
{
$this->app->DB->Update("UPDATE shopexport SET artikelporto = '$artikelporto' WHERE id = '$shop' AND artikelporto = 0 LIMIT 1");
}
}
} else {
$error_msg = 'Importauftrag Shop '.$shop.' Fehler: Kein Portoartikel vorhanden';
$this->LogFile($error_msg,['Onlinebestellnummer' => $warenkorb['onlinebestellnummer']]);
return(array("status" => false, "message" => $error_msg, "onlinebestellnummer" => $warenkorb['onlinebestellnummer']));
}
}
}
$umsatzsteuer_porto = $this->app->DB->Select("SELECT umsatzsteuer FROM artikel WHERE id='$artikelporto' LIMIT 1");
$versandname = '';
@ -19029,7 +19040,7 @@ function CheckShopTabelle($artikel)
}
}
return $auftrag;
return array("status" => true, "$auftragid" => $auftrag);
}
@ -21022,7 +21033,7 @@ function ChargenMHDAuslagern($artikel, $menge, $lagerplatztyp, $lpid,$typ,$wert,
$anzges = 0;
$anzfehler = 0;
$result = null; // 1 on success
$result = null; // $result['status'] == 1 on success
if(!empty($extnummer) && is_array($extnummer)) {
foreach($extnummer as $nummer) {
@ -21053,9 +21064,9 @@ function ChargenMHDAuslagern($artikel, $menge, $lagerplatztyp, $lpid,$typ,$wert,
}
$this->LogFile('*** UPDATE '.$lagerartikel[$ij]['nummer'].' '.$lagerartikel[$ij]['name_de'].' Shop: '.$shop.' Lagernd: '.$verkaufbare_menge.' Korrektur: '.round((float) ($verkaufbare_menge_korrektur - $verkaufbare_menge),7).' Pseudolager: '.round((float) $pseudolager,8).' Result: '.gettype($result).' '.$result);
$this->LogFile('*** UPDATE '.$lagerartikel[$ij]['nummer'].' '.$lagerartikel[$ij]['name_de'].' Shop: '.$shop.' Lagernd: '.$verkaufbare_menge.' Korrektur: '.round((float) ($verkaufbare_menge_korrektur - $verkaufbare_menge),7).' Pseudolager: '.round((float) $pseudolager,8).' Result: '.(is_array($result)?$result['status']:$result), $result);
if ($result == 1) {
if ((is_array($result)?$result['status'] == 1:false) || $status === 1) {
$cacheQuantity = (int) $verkaufbare_menge_korrektur + (int) $pseudolager;
$this->app->DB->Update(
"UPDATE `artikel` SET `cache_lagerplatzinhaltmenge` = '{$cacheQuantity}'

View File

@ -2628,6 +2628,10 @@ class Appstore {
'Link'=>'index.php?module=onlineshops&action=create&cmd=shopimporter_presta',
'Icon'=>'Icons_dunkel_1.gif',
'Versionen'=>'ALL','install'=>true, 'beta' => false,'kategorie'=>'{|Shop Schnittstelle|}')
,'shopimporter_mirakl'=>array('Bezeichnung'=>'Mirakl',
'Link'=>'index.php?module=onlineshops&action=create&cmd=shopimporter_mirakl',
'Icon'=>'Icons_dunkel_1.gif',
'Versionen'=>'ALL','install'=>true, 'beta' => false,'kategorie'=>'{|Shop Schnittstelle|}')
,'shopimporter_shopify'=>array(
'Bezeichnung'=>'Shopify API Advanced',
'Link'=>'index.php?module=onlineshops&action=create&cmd=shopimporter_shopify',
@ -3967,7 +3971,6 @@ class Appstore {
}
}
if(isset($module['installiert'])) {
foreach($module['installiert'] as $k => $v) {
$moduleInstallKey = $module['installiert'][$k]['key'];

View File

@ -2841,100 +2841,82 @@ class Artikel extends GenArtikel {
return ['status'=>$isOk, 'info'=>$info, 'msg_encoded' => $msg, 'error' => $error];
}
public function ArtikelShopexport()
{
$id = $this->app->Secure->GetGET('id');
$shop = $this->app->Secure->GetGET('shop');
$artikel = array($id);
$artikelshopid = (int)$this->app->Secure->GetGET('artikelshopid');
if($artikelshopid > 0)
{
$shop = $this->app->DB->Select("SELECT shop FROM artikel_onlineshops WHERE id = '$artikelshopid' AND artikel = '$id' AND aktiv = 1 LIMIT 1");
$this->app->User->SetParameter('artikel_shopexport_shop', '');
}else{
if($shop=='1'){
$shop = $this->app->DB->Select("SELECT shop FROM artikel WHERE id='$id' LIMIT 1");
}
elseif($shop=='2'){
$shop = $this->app->DB->Select("SELECT shop2 FROM artikel WHERE id='$id' LIMIT 1");
}
elseif($shop=='3'){
$shop = $this->app->DB->Select("SELECT shop3 FROM artikel WHERE id='$id' LIMIT 1");
}
}
$artikelexport = $this->app->DB->Select("SELECT artikelexport FROM shopexport WHERE id='$shop' LIMIT 1");
$lagerexport = $this->app->DB->Select("SELECT lagerexport FROM shopexport WHERE id='$shop' LIMIT 1");
public function ArtikelShopexport() {
$id = $this->app->Secure->GetGET('id');
$shop = $this->app->Secure->GetGET('shop');
$artikel = array($id);
$artikelshopid = (int) $this->app->Secure->GetGET('artikelshopid');
$externenummer = $this->app->DB->Select("SELECT nummer FROM artikelnummer_fremdnummern WHERE artikel = '$id' AND aktiv = 1 AND shopid = '$shop' AND nummer <> '' ORDER BY bezeichnung = 'SHOPID' DESC LIMIT 1");
if($externenummer)
{
$extartikelnummer = array($externenummer);
}else{
$extartikelnummer = '';
}
$pageContents = $this->app->remote->RemoteSendArticleList($shop,$artikel,$extartikelnummer);
$check = strpos($pageContents ,'error:');
$msg = '';
if(!empty($pageContents) && is_array($pageContents)) {
if(!empty($pageContents['status']) && !empty($pageContents['message'])) {
$msg = $this->app->erp->base64_url_encode('<div class="info">'.$pageContents['message'].'</div>');
}
elseif(isset($pageContents['status']) && !empty($pageContents['message'])) {
$msg = $this->app->erp->base64_url_encode('<div class="error">'.$pageContents['message'].'</div>');
}
}
elseif($pageContents=='1') {
$pageContents='success';
}
if(empty($msg) && $pageContents!='') {
$pageContents = " ($pageContents)";
}
$this->app->erp->LogFile($this->app->DB->real_escape_string('manueller Shopexport Artikel: '.$this->app->DB->Select("SELECT nummer FROM artikel WHERE id = '$id' LIMIT 1").' Shop: '.$shop.' Status: '.$pageContents));
// keine fehlermeldung vom shop
if(empty($msg)) {
$linkToImporterSettings = '';
if($this->app->erp->RechteVorhanden('onlineshops', 'edit')){
$url = 'index.php?module=onlineshops&action=edit&id='.$shop;
$linkToImporterSettings = "<a href='$url' class='button button-primary'>Zu den Shopeinstellungen</a>";
}
if($check === 0){
$msg = $this->app->erp->base64_url_encode("<div class=\"error\">Es gab einen Fehler beim Aktualisieren des Artikels im Shop!$pageContents</div>");
}
else if($pageContents == ''){
if($artikelexport != 1 && $lagerexport != 1){
$msg = $this->app->erp->base64_url_encode("<div class=\"error\">Der Artikel konnte nicht zum Shop &uuml;bertragen werden! In den Shopeinstellungen ist festgelegt, dass die Artikelinformation- und Lagerbestands&uuml;bertragung nicht erlaubt ist!$pageContents $linkToImporterSettings</div>");
if ($artikelshopid > 0) {
$shop = $this->app->DB->Select("SELECT shop FROM artikel_onlineshops WHERE id = '$artikelshopid' AND artikel = '$id' AND aktiv = 1 LIMIT 1");
$this->app->User->SetParameter('artikel_shopexport_shop', '');
} else {
if ($shop == '1') {
$shop = $this->app->DB->Select("SELECT shop FROM artikel WHERE id='$id' LIMIT 1");
} elseif ($shop == '2') {
$shop = $this->app->DB->Select("SELECT shop2 FROM artikel WHERE id='$id' LIMIT 1");
} elseif ($shop == '3') {
$shop = $this->app->DB->Select("SELECT shop3 FROM artikel WHERE id='$id' LIMIT 1");
}
}
else{
if($pageContents === '0' || $pageContents === 0){
$msg = $this->app->erp->base64_url_encode("<div class=\"error\">Es gab einen Fehler beim Aktualisieren des Artikels im Shop! Stellen Sie sicher, dass die Zugangsdaten und URL's korrekt sind! M&ouml;glicherweise kein Artikelpreis hinterlegt</div>");
}else{
$msg = $this->app->erp->base64_url_encode("<div class=\"error\">Es gab einen Fehler beim Aktualisieren des Artikels im Shop! Stellen Sie sicher, dass die Zugangsdaten und URL's korrekt sind!$pageContents $linkToImporterSettings</div>");
}
}
}
else{
if($artikelexport != 1 && $lagerexport == 1){
$msg = $this->app->erp->base64_url_encode("<div class=info>Es wurde nur der Lagerbestand (nicht die Artikelinfos entsprechend der Einstellungen) im Shop aktualisiert!$pageContents $linkToImporterSettings</div>");
}
else if($lagerexport != 1 && $artikelexport == 1){
$msg = $this->app->erp->base64_url_encode("<div class=info>Es wurde nur der Artikel (nicht der Lagerbestand entsprechend der Einstellungen) im Shop aktualisiert!$pageContents $linkToImporterSettings</div>");
}
else{
$msg = $this->app->erp->base64_url_encode("<div class=info>Der Artikel wurde im Shop aktualisiert!$pageContents</div>");
}
}
}
$this->app->erp->LagerSync($artikel);
$this->app->Location->execute("index.php?module=artikel&action=edit&id=$id&msg=$msg#tabs-4");
}
$artikelexport = $this->app->DB->Select("SELECT artikelexport FROM shopexport WHERE id='$shop' LIMIT 1");
$lagerexport = $this->app->DB->Select("SELECT lagerexport FROM shopexport WHERE id='$shop' LIMIT 1");
$externenummer = $this->app->DB->Select("SELECT nummer FROM artikelnummer_fremdnummern WHERE artikel = '$id' AND aktiv = 1 AND shopid = '$shop' AND nummer <> '' ORDER BY bezeichnung = 'SHOPID' DESC LIMIT 1");
if ($externenummer) {
$extartikelnummer = array($externenummer);
} else {
$extartikelnummer = '';
}
$remote_result = $this->app->remote->RemoteSendArticleList($shop, $artikel, $extartikelnummer);
if (is_array($remote_result)) {
$remote_status = $remote_result['status'];
$remote_message = $remote_result['message'];
} else if (is_numeric($remote_result)) {
if ($remote_result == 1) {
$remote_status = true;
} else {
$remote_status = false;
$remote_message = "Der Artikel konnte nicht zum Shop &uuml;bertragen werden!";
}
} else if ($remote_result === null) {
$remote_status = false;
$remote_message = "Keine Aktion durchgef&uuml;hrt";
} else {
$remote_message = $remote_result;
if (strpos((string) $remote_result, 'error:') === 0) {
$remote_status = false;
} else {
$remote_status = true;
}
}
if ($remote_status) {
$msg = $this->app->erp->base64_url_encode('<div class="info">' . $remote_message . '</div>');
} else {
$msg = $this->app->erp->base64_url_encode('<div class="error">' . $remote_message . '</div>');
}
$this->app->erp->LogFile($this->app->DB->real_escape_string('manueller Shopexport Artikel: '.$this->app->DB->Select("SELECT nummer FROM artikel WHERE id = '$id' LIMIT 1").' Shop: '.$shop.' Status: '.((int) $remote_status)), $remote_message);
// keine fehlermeldung vom shop
if ($remote_status) {
$linkToImporterSettings = '';
if ($this->app->erp->RechteVorhanden('onlineshops', 'edit')) {
$url = 'index.php?module=onlineshops&action=edit&id=' . $shop;
$linkToImporterSettings = "<a href='$url' class='button button-primary'>Zu den Shopeinstellungen</a>";
}
}
$this->app->erp->LagerSync($artikel);
$this->app->Location->execute("index.php?module=artikel&action=edit&id=$id&msg=$msg#tabs-4");
}
public function ArtikelShopexportFiles()
{

View File

@ -22,6 +22,7 @@
<legend>{|Land|}</legend>
<table width="100%" border="0" class="mkTableFormular">
<tr><td>Zweistelliger ISO Code:</td><td><input type="text" name="iso" value="[ISO]" size="40"></td></tr>
<tr><td>Dreistelliger ISO Code:</td><td><input type="text" name="iso3" value="[ISO3]" size="40"></td></tr>
<tr><td>Bezeichnung Deutsch:</td><td><input type="text" name="bezeichnung_de" value="[BEZEICHNUNG_DE]" size="40"></td></tr>
<tr><td>Bezeichnung Englisch:</td><td><input type="text" name="bezeichnung_en" value="[BEZEICHNUNG_EN]" size="40"></td></tr>
<tr><td>EU:</td><td><input type="checkbox" name="eu" value="1" [EU]></td></tr>

View File

@ -4067,6 +4067,25 @@ class Importvorlage extends GenImportvorlage {
}
} // Sprachen
// Artikeleigenschaften
// leer = löschen
$artikeleigenschaften = array();
foreach ($tmp as $feldname => $feldwerte) {
if (strpos($feldname,'eigenschaftname') !== false) {
$eigenschaftspaltennummer = substr($feldname,strlen('eigenschaftname'));
$artikeleigenschaften[$feldwerte[$i]] = $tmp['eigenschaftwert'.$eigenschaftspaltennummer][$i];
}
}
foreach ($artikeleigenschaften as $key => $value) {
$sql = "INSERT INTO artikeleigenschaften (name) VALUES ('".$key."') ON DUPLICATE KEY UPDATE name = '".$key."'";
$this->app->DB->Update($sql);
$sql = "INSERT INTO artikeleigenschaftenwerte (artikel, artikeleigenschaften, wert) VALUES ('".$artikelid."' ,(SELECT id FROM artikeleigenschaften WHERE name = '".$key."'), '".$value."') ON DUPLICATE KEY UPDATE wert = '".$value."'";
$this->app->DB->Update($sql);
}
$sql = "DELETE FROM artikeleigenschaftenwerte WHERE wert = ''";
$this->app->DB->Delete($sql);
//freifelduebersetzungen
foreach ($tmp as $feldname => $feldwerte) {
if(strpos($feldname,'freifeld') !== false && strpos($feldname,'_')>0){

View File

@ -1,215 +1,219 @@
<?php
/*
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
*
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
*
* This file is licensed under the Embedded Projects General Public License *Version 3.1.
*
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
* to obtain the text of the corresponding license version.
*
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
/*
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
*
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
*
* This file is licensed under the Embedded Projects General Public License *Version 3.1.
*
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
* to obtain the text of the corresponding license version.
*
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
*/
?>
<?php
class Laender {
var $app;
static function TableSearch(&$app, $name, $erlaubtevars)
{
// in dieses switch alle lokalen Tabellen (diese Live Tabellen mit Suche etc.) für dieses Modul
switch($name)
{
case "laender_list":
$allowed['laender'] = array('list');
$heading = array('ISO', 'Bezeichnung DE', 'Bezeichnung EN','EU', 'Men&uuml;');
$width = array('9%', '40%', '40%','10%','1%');
$findcols = array('l.iso', 'l.bezeichnung_de', 'l.bezeichnung_en', "if(l.eu,'EU','')", 'l.id');
$searchsql = array('l.iso', 'l.bezeichnung_de', 'l.bezeichnung_en');
$defaultorder = 1;
$defaultorderdesc = 0;
$menu = "<a href=\"index.php?module=laender&action=edit&id=%value%\"><img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\"></a>&nbsp;<a href=\"#\" onclick=DeleteDialog(\"index.php?module=laender&action=delete&id=%value%\")><img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\"></a>";
$where = " l.id > 0 ";
$sql = "SELECT SQL_CALC_FOUND_ROWS l.id, l.iso, l.bezeichnung_de, l.bezeichnung_en, if(l.eu,'EU',''), l.id FROM laender l";
$count = "SELECT count(l.id) FROM laender l WHERE $where";
break;
}
$erg = false;
foreach($erlaubtevars as $k => $v)
{
if(isset($$v))$erg[$v] = $$v;
}
return $erg;
}
function __construct($app, $intern = false) {
$this->app=$app;
if($intern)return;
$this->app->ActionHandlerInit($this);
// ab hier alle Action Handler definieren die das Modul hat
$this->app->ActionHandler("list", "LaenderList");
$this->app->ActionHandler("create", "LaenderCreate");
$this->app->ActionHandler("edit", "LaenderEdit");
$this->app->ActionHandler("delete", "LaenderDelete");
$this->app->ActionHandler('test', 'LaenderTest');
$this->app->ActionHandlerListen($app);
}
function LaenderTest(){
$countryModule = $this->app->Container->get('CountryMigrationService');
if($countryModule->needsMigration()){
$countryModule->doMigration();
}
}
function LaenderMenu()
{
$this->app->erp->MenuEintrag("index.php?module=laender&action=list","Zur&uuml;ck zur &Uuml;bersicht");
}
function LaenderList()
{
$this->app->erp->MenuEintrag("index.php?module=laender&action=create","Neues Land");
$this->app->erp->MenuEintrag("index.php?module=laender&action=list","&Uuml;bersicht");
$this->app->YUI->TableSearch('TAB1','laender_list', "show","","",basename(__FILE__), __CLASS__);
$this->app->Tpl->Parse("PAGE","laender_list.tpl");
}
function LaenderEdit()
{
$id = (int)$this->app->Secure->GetGET('id');
$submit = $this->app->Secure->GetPOST('submitland');
$this->app->Tpl->Add('KURZUEBERSCHRIFT2',$bezeichnung_de);
$input = array();
$this->app->erp->MenuEintrag("index.php?module=laender&action=edit&id=$id","Details");
$this->app->erp->MenuEintrag("index.php?module=laender&action=list","Zur&uuml;ck zur &Uuml;bersicht");
$input = $this->GetInput();
if(is_numeric($id) && $submit!=''){
$error = '';
if($input['iso']=='' || strlen(trim($input['iso'])) > 2) $error .= 'Geben Sie bitte einen zweistelligen ISO-Code ein.<br>';
if($input['bezeichnung_de'] == '') $error .= 'Geben Sie bitte eine deutsche L&auml;nderbezeichnung ein.<br>';
if($input['bezeichnung_en'] =='') $error .= 'Geben Sie bitte eine englische L&auml;nderbezeichnung ein.<br>';
if($error!=''){
$this->app->Tpl->Set('MESSAGE', "<div class=\"error\">$error</div>");
}else{
if($error == ""){
$this->app->DB->Update("UPDATE laender SET iso='{$input['iso']}', bezeichnung_de='{$input['bezeichnung_de']}', bezeichnung_en='{$input['bezeichnung_en']}', eu='{$input['eu']}' WHERE id = '$id' LIMIT 1");
if($input['eu']==1){
$this->app->Tpl->Set('EU', "checked");
}
$this->app->Tpl->Set('MESSAGE', "<div class=\"success\">Die Einstellungen wurden erfolgreich &uuml;bernommen.</div>");
}
}
}
$iso = $this->app->DB->Select("SELECT iso FROM laender WHERE id = '$id'");
$bezeichnung_de = $this->app->DB->Select("SELECT bezeichnung_de FROM laender WHERE id = '$id'");
$bezeichnung_en = $this->app->DB->Select("SELECT bezeichnung_en FROM laender WHERE id = '$id'");
$eu = $this->app->DB->Select("SELECT eu FROM laender WHERE id = '$id'");
$this->app->Tpl->Set('ISO', $iso);
$this->app->Tpl->Set('BEZEICHNUNG_DE', $bezeichnung_de);
$this->app->Tpl->Set('BEZEICHNUNG_EN', $bezeichnung_en);
if($eu == 1){
$this->app->Tpl->Set('EU', "checked");
}
//$this->SetInput($input);
$this->app->Tpl->Parse('PAGE', "laender_edit.tpl");
}
function LaenderDelete()
{
$ref = $_SERVER['HTTP_REFERER'];
$id = $this->app->Secure->GetGET("id");
$this->app->DB->DELETE("DELETE FROM laender WHERE id = '$id' LIMIT 1");
//$this->VorlageList();
header("Location: $ref");
exit;
}
function LaenderCreate(){
// $this->app->Tpl->Add(KURZUEBERSCHRIFT,"Benutzer");
$this->app->erp->MenuEintrag("index.php?module=laender&action=list","Zur&uuml;ck zur &Uuml;bersicht");
$input = $this->GetInput();
$submit = $this->app->Secure->GetPOST('submitland');
if($submit!='') {
$error = '';
if($input['iso']=='' || strlen(trim($input['iso'])) > 2) $error .= 'Geben Sie bitte einen zweistelligen ISO-Code ein.<br>';
if($input['bezeichnung_de']=='') $error .= 'Geben Sie bitte eine deutsche L&auml;nderbezeichnung ein.<br>';
if($input['bezeichnung_en']=='') $error .= 'Geben Sie bitte eine englische L&auml;nderbezeichnung ein.<br>';
if($this->app->DB->Select("SELECT '1' FROM laender WHERE iso='{$input['iso']}' LIMIT 1")=='1')
$error .= "Es existiert bereits ein ISO-Code mit diesem Namen.<br />";
if($error!=''){
$this->app->Tpl->Set('MESSAGE', "<div class=\"error\">$error</div>");
}else {
$this->app->DB->Insert("INSERT INTO laender (iso, bezeichnung_de, bezeichnung_en, eu) VALUES ('{$input['iso']}', '{$input['bezeichnung_de']}', '{$input['bezeichnung_en']}', '{$input['eu']}')");
$newid = $this->app->DB->GetInsertID();
$msg = $this->app->erp->base64_url_encode("<div class=\"success\">Der L&auml;ndereintrag wurde erfolgreich angelegt.</div>");
header("Location: index.php?module=laender&action=edit&id=$newid&msg=$msg");
exit;
}
}
$this->SetInput($input);
$this->app->Tpl->Parse('PAGE', "laender_edit.tpl");
}
function GetInput(){
$input = array();
$input['iso'] = $this->app->Secure->GetPOST('iso');
$input['bezeichnung_de'] = $this->app->Secure->GetPOST('bezeichnung_de');
$input['bezeichnung_en'] = $this->app->Secure->GetPOST('bezeichnung_en');
$input['eu'] = (int)$this->app->Secure->GetPOST('eu');
return $input;
}
function SetInput($input){
$this->app->Tpl->Set('ISO', $input['iso']);
$this->app->Tpl->Set('BEZEICHNUNG_DE', $input['bezeichnung_de']);
$this->app->Tpl->Set('BEZEICHNUNG_EN', $input['bezeichnung_en']);
if($input['eu']==1){
$this->app->Tpl->Set('EU', "checked");
}
}
}
<?php
class Laender {
var $app;
static function TableSearch(&$app, $name, $erlaubtevars)
{
// in dieses switch alle lokalen Tabellen (diese Live Tabellen mit Suche etc.) für dieses Modul
switch($name)
{
case "laender_list":
$allowed['laender'] = array('list');
$heading = array('ISO', 'ISO3','Bezeichnung DE', 'Bezeichnung EN','EU', 'Men&uuml;');
$width = array('9%', '9%','40%', '40%','10%','1%');
$findcols = array('l.iso', 'l.iso3', 'l.bezeichnung_de', 'l.bezeichnung_en', "if(l.eu,'EU','')", 'l.id');
$searchsql = array('l.iso','l.iso3', 'l.bezeichnung_de', 'l.bezeichnung_en');
$defaultorder = 1;
$defaultorderdesc = 0;
$menu = "<a href=\"index.php?module=laender&action=edit&id=%value%\"><img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\"></a>&nbsp;<a href=\"#\" onclick=DeleteDialog(\"index.php?module=laender&action=delete&id=%value%\")><img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\"></a>";
$where = " l.id > 0 ";
$sql = "SELECT SQL_CALC_FOUND_ROWS l.id, l.iso, l.iso3, l.bezeichnung_de, l.bezeichnung_en, if(l.eu,'EU',''), l.id FROM laender l";
$count = "SELECT count(l.id) FROM laender l WHERE $where";
break;
}
$erg = false;
foreach($erlaubtevars as $k => $v)
{
if(isset($$v))$erg[$v] = $$v;
}
return $erg;
}
function __construct($app, $intern = false) {
$this->app=$app;
if($intern)return;
$this->app->ActionHandlerInit($this);
// ab hier alle Action Handler definieren die das Modul hat
$this->app->ActionHandler("list", "LaenderList");
$this->app->ActionHandler("create", "LaenderCreate");
$this->app->ActionHandler("edit", "LaenderEdit");
$this->app->ActionHandler("delete", "LaenderDelete");
$this->app->ActionHandler('test', 'LaenderTest');
$this->app->ActionHandlerListen($app);
}
function LaenderTest(){
$countryModule = $this->app->Container->get('CountryMigrationService');
if($countryModule->needsMigration()){
$countryModule->doMigration();
}
}
function LaenderMenu()
{
$this->app->erp->MenuEintrag("index.php?module=laender&action=list","Zur&uuml;ck zur &Uuml;bersicht");
}
function LaenderList()
{
$this->app->erp->MenuEintrag("index.php?module=laender&action=create","Neues Land");
$this->app->erp->MenuEintrag("index.php?module=laender&action=list","&Uuml;bersicht");
$this->app->YUI->TableSearch('TAB1','laender_list', "show","","",basename(__FILE__), __CLASS__);
$this->app->Tpl->Parse("PAGE","laender_list.tpl");
}
function LaenderEdit()
{
$id = (int)$this->app->Secure->GetGET('id');
$submit = $this->app->Secure->GetPOST('submitland');
$this->app->Tpl->Add('KURZUEBERSCHRIFT2',$bezeichnung_de);
$input = array();
$this->app->erp->MenuEintrag("index.php?module=laender&action=edit&id=$id","Details");
$this->app->erp->MenuEintrag("index.php?module=laender&action=list","Zur&uuml;ck zur &Uuml;bersicht");
$input = $this->GetInput();
if(is_numeric($id) && $submit!=''){
$error = '';
if($input['iso']=='' || strlen(trim($input['iso'])) > 2) $error .= 'Geben Sie bitte einen zweistelligen ISO-Code ein.<br>';
if($input['bezeichnung_de'] == '') $error .= 'Geben Sie bitte eine deutsche L&auml;nderbezeichnung ein.<br>';
if($input['bezeichnung_en'] =='') $error .= 'Geben Sie bitte eine englische L&auml;nderbezeichnung ein.<br>';
if($error!=''){
$this->app->Tpl->Set('MESSAGE', "<div class=\"error\">$error</div>");
}else{
if($error == ""){
$this->app->DB->Update("UPDATE laender SET iso='{$input['iso']}', iso3='{$input['iso3']}', bezeichnung_de='{$input['bezeichnung_de']}', bezeichnung_en='{$input['bezeichnung_en']}', eu='{$input['eu']}' WHERE id = '$id' LIMIT 1");
if($input['eu']==1){
$this->app->Tpl->Set('EU', "checked");
}
$this->app->Tpl->Set('MESSAGE', "<div class=\"success\">Die Einstellungen wurden erfolgreich &uuml;bernommen.</div>");
}
}
}
$iso = $this->app->DB->Select("SELECT iso FROM laender WHERE id = '$id'");
$iso3 = $this->app->DB->Select("SELECT iso3 FROM laender WHERE id = '$id'");
$bezeichnung_de = $this->app->DB->Select("SELECT bezeichnung_de FROM laender WHERE id = '$id'");
$bezeichnung_en = $this->app->DB->Select("SELECT bezeichnung_en FROM laender WHERE id = '$id'");
$eu = $this->app->DB->Select("SELECT eu FROM laender WHERE id = '$id'");
$this->app->Tpl->Set('ISO', $iso);
$this->app->Tpl->Set('ISO3', $iso3);
$this->app->Tpl->Set('BEZEICHNUNG_DE', $bezeichnung_de);
$this->app->Tpl->Set('BEZEICHNUNG_EN', $bezeichnung_en);
if($eu == 1){
$this->app->Tpl->Set('EU', "checked");
}
//$this->SetInput($input);
$this->app->Tpl->Parse('PAGE', "laender_edit.tpl");
}
function LaenderDelete()
{
$ref = $_SERVER['HTTP_REFERER'];
$id = $this->app->Secure->GetGET("id");
$this->app->DB->DELETE("DELETE FROM laender WHERE id = '$id' LIMIT 1");
//$this->VorlageList();
header("Location: $ref");
exit;
}
function LaenderCreate(){
// $this->app->Tpl->Add(KURZUEBERSCHRIFT,"Benutzer");
$this->app->erp->MenuEintrag("index.php?module=laender&action=list","Zur&uuml;ck zur &Uuml;bersicht");
$input = $this->GetInput();
$submit = $this->app->Secure->GetPOST('submitland');
if($submit!='') {
$error = '';
if($input['iso']=='' || strlen(trim($input['iso'])) > 2) $error .= 'Geben Sie bitte einen zweistelligen ISO-Code ein.<br>';
if($input['bezeichnung_de']=='') $error .= 'Geben Sie bitte eine deutsche L&auml;nderbezeichnung ein.<br>';
if($input['bezeichnung_en']=='') $error .= 'Geben Sie bitte eine englische L&auml;nderbezeichnung ein.<br>';
if($this->app->DB->Select("SELECT '1' FROM laender WHERE iso='{$input['iso']}' LIMIT 1")=='1')
$error .= "Es existiert bereits ein ISO-Code mit diesem Namen.<br />";
if($error!=''){
$this->app->Tpl->Set('MESSAGE', "<div class=\"error\">$error</div>");
}else {
$this->app->DB->Insert("INSERT INTO laender (iso, iso3, bezeichnung_de, bezeichnung_en, eu) VALUES ('{$input['iso']}', '{$input['iso3']}', '{$input['bezeichnung_de']}', '{$input['bezeichnung_en']}', '{$input['eu']}')");
$newid = $this->app->DB->GetInsertID();
$msg = $this->app->erp->base64_url_encode("<div class=\"success\">Der L&auml;ndereintrag wurde erfolgreich angelegt.</div>");
header("Location: index.php?module=laender&action=edit&id=$newid&msg=$msg");
exit;
}
}
$this->SetInput($input);
$this->app->Tpl->Parse('PAGE', "laender_edit.tpl");
}
function GetInput(){
$input = array();
$input['iso'] = $this->app->Secure->GetPOST('iso');
$input['iso3'] = $this->app->Secure->GetPOST('iso3');
$input['bezeichnung_de'] = $this->app->Secure->GetPOST('bezeichnung_de');
$input['bezeichnung_en'] = $this->app->Secure->GetPOST('bezeichnung_en');
$input['eu'] = (int)$this->app->Secure->GetPOST('eu');
return $input;
}
function SetInput($input){
$this->app->Tpl->Set('ISO', $input['iso']);
$this->app->Tpl->Set('ISO3', $input['iso3']);
$this->app->Tpl->Set('BEZEICHNUNG_DE', $input['bezeichnung_de']);
$this->app->Tpl->Set('BEZEICHNUNG_EN', $input['bezeichnung_en']);
if($input['eu']==1){
$this->app->Tpl->Set('EU', "checked");
}
}
}

View File

@ -3339,7 +3339,7 @@ INNER JOIN shopexport s ON
}
if($this->app->Secure->GetPOST('pruefen')) {
$className = 'Remote';
$methodName = 'RemoteConnection';
$r = new ReflectionMethod($className, $methodName);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="5.56mm" height="5.56mm" fill-rule="evenodd" stroke-linejoin="round" stroke-width="28.222" preserveAspectRatio="xMidYMid" version="1.2" viewBox="0 0 556 556" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<defs class="ClipPathGroup"><clipPath id="presentation_clip_path">
<rect width="556" height="556"/>
</clipPath></defs>
<g class="Master_Slide">
</g>
<g class="SlideGroup">
<g class="Slide" clip-path="url(#presentation_clip_path)">
<g class="Page">
<g class="com.sun.star.drawing.ClosedBezierShape">
<rect class="BoundingBox" x="175" y="80" width="302" height="302" fill="none"/>
<path d="m421 286c10-17 15-36 15-56 0-19-5-38-15-55s-23-30-40-40-36-15-56-15c-19 0-38 5-55 15s-30 23-40 40-15 36-15 56c0 19 5 38 15 55s23 30 40 40 36 15 56 15c19 0 38-5 55-15s30-23 40-40zm35 20c-13 23-32 42-55 55s-49 20-75 20c-27 0-53-7-76-20s-42-32-55-55-20-49-20-75c0-27 7-53 20-76s32-42 55-55 49-20 75-20c27 0 53 7 76 20s42 32 55 55 20 49 20 75c0 27-7 53-20 76z" fill="#929292"/>
<rect class="BoundingBox" x="78" y="286" width="190" height="191" fill="none"/>
<path d="m195 306c13 23 32 42 55 55 6 3 11 6 17 8l-102 102c-2 3-5 4-8 4h-67c-6 0-11-5-11-11v-67c0-3 1-6 4-8l103-103c2 7 6 14 9 20z" fill="#929292"/>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -53,20 +53,36 @@
<tr>
<td style="min-width:130px;"><label for="bezeichnung">{|Bezeichnung|}:</label></td>
<td>[BEZEICHNUNG][MSGBEZEICHNUNG]</td>
<td><label for="modus">{|Import-Modus|}:</label></td><td>[SELMODUS]</td>
</tr>
<tr>
<td><label for="aktiv">{|Aktiv|}:</label></td>
<td>[AKTIV][MSGAKTIV]</td>
<td><label for="einzelsync">{|Nur 1 Auftrag pro Anfrage|}:</label></td>
<td class="einzelsyncclass">[EINZELSYNC][MSGEINZELSYNC]</td>
</tr>
<tr>
<td><label for="projekt">{|Projekt|}:</label></td>
<td>[PROJEKT][MSGPROJEKT]</td>
<td><label for="warteschlange">{|Aufträge in Zwischentabelle|}:</label></td><td>[WARTESCHLANGE] <i>{|Freigabe erfolgt manuell|}</i>
</td></tr>
<tr><td><label for="abholmodus">{|Abholmodus|}:</label></td><td>[SELABHOLMODUS]</td><td class="manuellebegrenzung">{|Anzahl abholen begrenzen|}:</td><td class="manuellebegrenzung">[MAXMANUELL][MSGMAXMANUELL]&nbsp;<i>{|0 bedeutet Begrenzung auf 100|}</i></td></tr>
</tr>
<tr>
<td><label for="abholmodus">{|Abholmodus|}:</label></td><td>[SELABHOLMODUS]</td>
</tr>
<tr>
<td class="manuellebegrenzung">{|Anzahl abholen begrenzen|}:</td>
<td class="manuellebegrenzung">[MAXMANUELL][MSGMAXMANUELL]</td>
<td><i>{|0 bedeutet Begrenzung auf 100|}</i></td>
</tr>
<tr>
<td><label for="modus">{|Import-Modus|}:</label></td><td>[SELMODUS]</td>
</tr>
<tr>
<td><label for="einzelsync">{|Nur 1 Auftrag pro Anfrage|}:</label></td>
<td class="einzelsyncclass">[EINZELSYNC][MSGEINZELSYNC]</td>
</tr>
<tr>
</tr>
<td><label for="warteschlange">{|Aufträge in Zwischentabelle|}:</label></td><td>[WARTESCHLANGE]</td>
<td><i>{|Freigabe erfolgt manuell|}</i></td>
<tr>
</tr>
<tr class="ab_nummerzeitraum zeitraum">
<td><label for="vondatum">{|Datum von|}:</label></td>
<td nowrap>
@ -98,8 +114,8 @@
<div class="inside inside-full-height">
<fieldset><legend>{|Aktion|}</legend>
<table width="100%">
<tr><td><input type="button" onclick="verpruefen();" value="{|Verbindung pr&uuml;fen|}" class="aktionbutton" ></td></tr>
<tr><td width="50%"><input type="button" onclick="Holeauftrag();" value="{|Auftr&auml;ge abholen|}" class="aktionbutton" ></td></tr>
<tr><td><input type="submit" form="frmpruefen" value="{|Verbindung pr&uuml;fen|}" class="aktionbutton" ></td></tr>
<tr><td width="50%"><input type="submit" form="frmabholen" value="{|Auftr&auml;ge abholen|}" class="aktionbutton" ></td></tr>
[AKTIONBUTTONS]
</table>
</fieldset>

View File

@ -861,7 +861,7 @@ class WidgetShopexport extends WidgetGenShopexport
switch($typ)
{
case 'textarea':
$aktcol .= '<textarea name="'.$name.'" id="'.$name.'">'.(!isset($json['felder'][$name])?'':htmlspecialchars($json['felder'][$name])).'</textarea>';
$aktcol .= '<textarea name="'.$name.'" id="'.$name.'" placeholder = "'.$val['placeholder'].'" cols="'.$val['cols'].'" rows="'.$val['rows'].'">'.(!isset($json['felder'][$name])?'':htmlspecialchars($json['felder'][$name])).'</textarea>';
break;
case 'checkbox':
$aktcol .= '<input type="checkbox" name="'.$name.'" id="'.$name.'" value="1" '.((isset($json['felder'][$name]) && $json['felder'][$name])?' checked="checked" ':'').' />';
@ -894,6 +894,9 @@ class WidgetShopexport extends WidgetGenShopexport
}
}
break;
case 'info':
$aktcol .= $val['text'];
break;
default:
switch($typ) {
case 'datum':
@ -912,7 +915,7 @@ class WidgetShopexport extends WidgetGenShopexport
$aktcol .= '&nbsp;<input type="button" value="'.($val['vorschlag_label']!=''?$val['vorschlag_label']:$val['vorschlag']).'" onclick="$(\'#'.$name.'\').val(\''.$val['vorschlag'].'\');" '.(isset($val['minvorschlagsize']) && $val['minvorschlagsize']?' style="min-width:'.$val['minvorschlagsize'].'px;" ':'').' />';
}
if(isset($val['info']) && $val['info']){
$aktcol .= ' <i>'.$val['info'].'</i>';
$aktcol .= '<td> <i>'.$val['info'].'</i></td>';
}
if(isset($val['col']) && $val['col'] == 2)
{