Merge branch 'xmlrechnung'

This commit is contained in:
OpenXE 2025-01-04 13:38:12 +01:00
commit 234eb35c42
9 changed files with 258 additions and 229 deletions

View File

@ -4215,14 +4215,14 @@ url:strUrl, success:function(html){strReturn = html;}, async:false
$sortmodus = $this->TableSearchFilter($name, 1, 'sortmodus', 0,0, 'checkbox'); $sortmodus = $this->TableSearchFilter($name, 1, 'sortmodus', 0,0, 'checkbox');
// headings // headings
$heading = array('','','','Titel', 'Stichwort', 'Version','Größe', 'Ersteller','Version','Datum','Sortierung','Menü'); $heading = array('','','','Titel', 'Stichwort', 'Version','Größe', 'Ersteller','Beschreibung','Datum','Sortierung','Geschützt','Menü');
$width = array('1%','1%','10','40%', '15%', '5%','10%','15%', '10%', '10%','15%', '10%','5%','1%'); $width = array('1%','1%','10','40%', '15%', '5%','10%','15%', '10%', '10%','15%', '10%','5%','1%','1%');
$findcols = array('open','d.id','d.id',"CONCAT(d.titel,' ',v.dateiname)", 's.subjekt', 'v.version',"if(v.size!='',if(v.size > 1024*1024,CONCAT(ROUND(v.size/1024/1024,2),' MB'),CONCAT(ROUND(v.size/1024,2),' KB')),'')", 'v.ersteller','v.bemerkung','v.datum', 's.sort','s.id'); $findcols = array('open','d.id','d.id',"CONCAT(d.titel,' ',v.dateiname)", 's.subjekt', 'v.version',"if(v.size!='',if(v.size > 1024*1024,CONCAT(ROUND(v.size/1024/1024,2),' MB'),CONCAT(ROUND(v.size/1024,2),' KB')),'')", 'v.ersteller','d.beschreibungbemerkung','v.datum', 's.sort','d.geschuetzt','s.id');
$searchsql = array('d.titel', 's.subjekt', 'v.version',"if(v.size!='',if(v.size > 1024*1024,CONCAT(ROUND(v.size/1024/1024,2),' MB'),CONCAT(ROUND(v.size/1024,2),' KB')),'')", 'v.ersteller','v.bemerkung','v.dateiname',"DATE_FORMAT(v.datum, '%d.%m.%Y')"); $searchsql = array('d.titel', 's.subjekt', 'v.version',"if(v.size!='',if(v.size > 1024*1024,CONCAT(ROUND(v.size/1024/1024,2),' MB'),CONCAT(ROUND(v.size/1024,2),' KB')),'')", 'v.ersteller','v.bemerkung','v.dateiname',"DATE_FORMAT(v.datum, '%d.%m.%Y')");
$menu = "<table cellpadding=0 cellspacing=0><tr><td nowrap><a href=\"#\" onclick=editdatei(%value%,\"$cmd\")><img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\"></a>&nbsp;<a href=\"index.php?module=dateien&action=send&id=%value%\"><img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/download.svg\" border=\"0\"></a>&nbsp;<a href=\"#\" onclick=DeleteDialog(\"index.php?module=dateien&action=delete&cmd=".urlencode($objekt)."&id=%value%\")><img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\" ></a></td></tr></table>"; $menu = "<table cellpadding=0 cellspacing=0><tr><td nowrap><a href=\"#\" onclick=editdatei(%value%,\"$cmd\")><img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\"></a>&nbsp;<a href=\"index.php?module=dateien&action=send&id=%value%\"><img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/download.svg\" border=\"0\"></a>&nbsp;<a href=\"#\" onclick=DeleteDialog(\"index.php?module=dateien&action=delete&cmd=".urlencode($objekt)."&id=%value%\")><img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\" ></a></td></tr></table>";
$menucol = 11; $menucol = 12;
$alignright=array(6,7,11); $alignright=array(6,7,11,12);
if(!function_exists('imagejpeg')) if(!function_exists('imagejpeg'))
{ {
@ -4232,10 +4232,21 @@ url:strUrl, success:function(html){strReturn = html;}, async:false
} }
// SQL statement // SQL statement
$sql = "SELECT SQL_CALC_FOUND_ROWS d.id,'<img src=./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/details_open.png class=details>' as open,concat('<input type=\"checkbox\" id=\"auswahl_',d.id,'\" onchange=\"chauswahl();\" value=\"1\" />'), $sql = "SELECT SQL_CALC_FOUND_ROWS
$img, d.id,
'<img src=./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/details_open.png class=details>' as open,
if(d.titel!='',CONCAT(d.titel,'<br><i style=color:#999>',v.dateiname,'</i>'),v.dateiname), s.subjekt, v.version, if(v.size!='',if(v.size > 1024*1024,CONCAT(ROUND(v.size/1024/1024,2),' MB'),CONCAT(ROUND(v.size/1024,2),' KB')),''), v.ersteller, v.bemerkung, DATE_FORMAT(v.datum, '%d.%m.%Y'),s.sort,".($sortmodus?"s.id": "d.id")." CONCAT('<input type=\"checkbox\" id=\"auswahl_',d.id,'\" onchange=\"chauswahl();\" value=\"1\" />'),
$img,
if(d.titel!='',CONCAT(d.titel,'<br><i style=color:#999>',v.dateiname,'</i>'),v.dateiname),
s.subjekt,
v.version,
if(v.size!='',if(v.size > 1024*1024,CONCAT(ROUND(v.size/1024/1024,2),' MB'),CONCAT(ROUND(v.size/1024,2),' KB')),''),
v.ersteller,
d.beschreibung,
".$this->app->erp->FormatDate("v.datum").",
s.sort,
d.geschuetzt,
".($sortmodus?"s.id": "d.id")."
FROM `datei` AS `d` FROM `datei` AS `d`
INNER JOIN `datei_stichwoerter` AS `s` ON d.id=s.datei INNER JOIN `datei_stichwoerter` AS `s` ON d.id=s.datei
LEFT JOIN ( LEFT JOIN (
@ -14156,30 +14167,7 @@ source: "index.php?module=ajax&action=filter&filtername=' . $filter . $extendurl
} }
$werte = $werte . $values[$i + 1]; $werte = $werte . $values[$i + 1];
$this->app->Tpl->Add('CHARTS', "c.add('', '$color', [ $werte]);"); $this->app->Tpl->Add('CHARTS', "c.add('', '$color', [ $werte]);");
} }
function DateiUploadNeuVersion($parsetarget, $datei) {
$speichern = $this->app->Secure->GetPOST("speichern");
$module = $this->app->Secure->GetGET("module");
$action = $this->app->Secure->GetGET("action");
$id = $this->app->Secure->GetGET("id");
if($id)$this->app->Tpl->Set('ID',$id);
// Get files here
if ($speichern != "") {
$retval = $this->FilesFromUploadtoDMS(null, null, $datei);
if ($retval !== true) {
$this->app->Tpl->Set('ERROR', implode(', ',$retval));
$this->app->erp->EnableTab("tabs-2");
} else {
header("Location: index.php?module=$module&action=$action&id=$id");
}
}
$this->app->Tpl->Set('STARTDISABLE', "<!--");
$this->app->Tpl->Set('ENDEDISABLE', "-->");
$this->app->Tpl->Parse($parsetarget, "datei_neudirekt.tpl");
}
function DateiUpload($parsetarget, $objekt, $parameter, $optionen = null) { function DateiUpload($parsetarget, $objekt, $parameter, $optionen = null) {
$speichern = $this->app->Secure->GetPOST("speichern"); $speichern = $this->app->Secure->GetPOST("speichern");

View File

@ -31192,6 +31192,17 @@
"Privileges": "select,insert,update,references", "Privileges": "select,insert,update,references",
"Comment": "" "Comment": ""
}, },
{
"Field": "geschuetzt",
"Type": "int(11)",
"Collation": null,
"Null": "NO",
"Key": "",
"Default": null,
"Extra": "",
"Privileges": "select,insert,update,references",
"Comment": ""
},
{ {
"Field": "logdatei", "Field": "logdatei",
"Type": "timestamp", "Type": "timestamp",

View File

@ -36386,23 +36386,6 @@ function Firmendaten($field,$projekt="")
return $tmpname; return $tmpname;
} }
function CreateDateiOhneInitialeVersion($titel,$beschreibung,$nummer,$ersteller,$without_log=false)
{
if(!$without_log)
{
$this->app->DB->Insert("INSERT INTO datei (id,titel,beschreibung,nummer,firma) VALUES
('','$titel','$beschreibung','$nummer','".$this->app->User->GetFirma()."')");
} else {
$this->app->DB->InsertWithoutLog("INSERT INTO datei (id,titel,beschreibung,nummer,firma) VALUES
('','$titel','$beschreibung','$nummer',1)");
}
$fileid = $this->app->DB->GetInsertID();
//$this->AddDateiVersion($fileid,$ersteller,$name,"Initiale Version",$datei,$without_log);
return $fileid;
}
function GetDMSPath($id, $path = '', $cache = false) function GetDMSPath($id, $path = '', $cache = false)
{ {
$ids = explode('_', $id, 2); $ids = explode('_', $id, 2);
@ -36500,7 +36483,7 @@ function Firmendaten($field,$projekt="")
} }
} }
function CreateDateiWithStichwort($name, $titel,$beschreibung,$nummer,$datei, $ersteller ,$subjekt,$objekt,$parameter, $path = "",$without_log=false) function CreateDateiWithStichwort($name, $titel,$beschreibung,$nummer,$datei, $ersteller ,$subjekt,$objekt,$parameter, $path = "",$without_log=false,$geschuetzt=null)
{ {
$dateien = $this->app->DB->SelectArr("SELECT dv.datei, dv.id FROM datei_stichwoerter ds $dateien = $this->app->DB->SelectArr("SELECT dv.datei, dv.id FROM datei_stichwoerter ds
INNER JOIN datei d ON ds.datei = d.id AND ifnull(d.geloescht,0) = 0 INNER JOIN datei d ON ds.datei = d.id AND ifnull(d.geloescht,0) = 0
@ -36536,12 +36519,12 @@ function Firmendaten($field,$projekt="")
} }
} }
} }
$fileid = $this->CreateDatei($name,$titel,$beschreibung,$nummer,$datei,$ersteller,$without_log,$path); $fileid = $this->CreateDatei($name,$titel,$beschreibung,$nummer,$datei,$ersteller,$without_log,$path,$geschuetzt);
$this->AddDateiStichwort($fileid,$subjekt,$objekt,$parameter,$without_log); $this->AddDateiStichwort($fileid,$subjekt,$objekt,$parameter,$without_log);
return $fileid; return $fileid;
} }
function CreateDatei($name,$titel,$beschreibung,$nummer,$datei,$ersteller,$without_log=false,$path="") function CreateDatei($name,$titel,$beschreibung,$nummer,$datei,$ersteller,$without_log=false,$path="",$geschuetzt=null)
{ {
// Anführungszeichen in Unterstriche wandeln // Anführungszeichen in Unterstriche wandeln
$name = str_replace(['\\\'', '\\"', '\'', '"'], '_', $name); $name = str_replace(['\\\'', '\\"', '\'', '"'], '_', $name);
@ -36553,13 +36536,15 @@ function Firmendaten($field,$projekt="")
titel, titel,
beschreibung, beschreibung,
nummer, nummer,
firma firma,
geschuetzt
) VALUES ( ) VALUES (
'', '',
'".$this->app->DB->real_escape_string($titel)."', '".$this->app->DB->real_escape_string($titel)."',
'".$this->app->DB->real_escape_string($beschreibung)."', '".$this->app->DB->real_escape_string($beschreibung)."',
'".$this->app->DB->real_escape_string($nummer)."', '".$this->app->DB->real_escape_string($nummer)."',
'".$this->app->User->GetFirma()."' '".$this->app->User->GetFirma()."',
'".$geschuetzt."'
)" )"
); );
} else { } else {
@ -36568,13 +36553,15 @@ function Firmendaten($field,$projekt="")
titel, titel,
beschreibung, beschreibung,
nummer, nummer,
firma firma,
geschuetzt
) VALUES ( ) VALUES (
'', '',
'".$this->app->DB->real_escape_string($titel)."', '".$this->app->DB->real_escape_string($titel)."',
'".$this->app->DB->real_escape_string($beschreibung)."', '".$this->app->DB->real_escape_string($beschreibung)."',
'".$this->app->DB->real_escape_string($nummer)."', '".$this->app->DB->real_escape_string($nummer)."',
1 1,
'".$geschuetzt."'
) )
"); ");
} }
@ -36771,6 +36758,12 @@ function Firmendaten($field,$projekt="")
if(!$id){ if(!$id){
return false; return false;
} }
$geschuetzt = $this->app->DB->SelectArr("SELECT geschuetzt FROM datei WHERE datei = '".$id."'");
if ($geschuetzt) {
return false;
}
$error = false; $error = false;
$versionen = $this->app->DB->SelectArr("SELECT * FROM datei_version WHERE datei = '".$id."'"); $versionen = $this->app->DB->SelectArr("SELECT * FROM datei_version WHERE datei = '".$id."'");
if($versionen) if($versionen)

View File

@ -1,155 +1,155 @@
<?php <?php
/* /*
**** 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 * 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. * 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 * 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. * to obtain the text of the corresponding license version.
* *
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE **** **** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
*/ */
?> ?>
<?php <?php
class ObjGenDatei class ObjGenDatei
{ {
private $id; private $id;
private $titel; private $titel;
private $beschreibung; private $beschreibung;
private $nummer; private $nummer;
private $geloescht; private $geloescht;
private $logdatei; private $logdatei;
private $firma; private $firma;
public $app; //application object public $app; //application object
public function __construct($app) public function __construct($app)
{ {
$this->app = $app; $this->app = $app;
} }
public function Select($id) public function Select($id)
{ {
if(is_numeric($id)) if(is_numeric($id))
$result = $this->app->DB->SelectArr("SELECT * FROM datei WHERE (id = '$id')"); $result = $this->app->DB->SelectArr("SELECT * FROM datei WHERE (id = '$id')");
else else
return -1; return -1;
$result = $result[0]; $result = $result[0];
$this->id=$result[id]; $this->id=$result[id];
$this->titel=$result[titel]; $this->titel=$result[titel];
$this->beschreibung=$result[beschreibung]; $this->beschreibung=$result[beschreibung];
$this->nummer=$result[nummer]; $this->nummer=$result[nummer];
$this->geloescht=$result[geloescht]; $this->geloescht=$result[geloescht];
$this->logdatei=$result[logdatei]; $this->logdatei=$result[logdatei];
$this->firma=$result[firma]; $this->firma=$result[firma];
} }
public function Create() public function Create()
{ {
$sql = "INSERT INTO datei (id,titel,beschreibung,nummer,geloescht,logdatei,firma) $sql = "INSERT INTO datei (id,titel,beschreibung,nummer,geloescht,logdatei,firma)
VALUES('','{$this->titel}','{$this->beschreibung}','{$this->nummer}','{$this->geloescht}','{$this->logdatei}','{$this->firma}')"; VALUES('','{$this->titel}','{$this->beschreibung}','{$this->nummer}','{$this->geloescht}','{$this->logdatei}','{$this->firma}')";
$this->app->DB->Insert($sql); $this->app->DB->Insert($sql);
$this->id = $this->app->DB->GetInsertID(); $this->id = $this->app->DB->GetInsertID();
} }
public function Update() public function Update()
{ {
if(!is_numeric($this->id)) if(!is_numeric($this->id))
return -1; return -1;
$sql = "UPDATE datei SET $sql = "UPDATE datei SET
titel='{$this->titel}', titel='{$this->titel}',
beschreibung='{$this->beschreibung}', beschreibung='{$this->beschreibung}',
nummer='{$this->nummer}', nummer='{$this->nummer}',
geloescht='{$this->geloescht}', geloescht='{$this->geloescht}',
logdatei='{$this->logdatei}', logdatei='{$this->logdatei}',
firma='{$this->firma}' firma='{$this->firma}'
WHERE (id='{$this->id}')"; WHERE (id='{$this->id}')";
$this->app->DB->Update($sql); $this->app->DB->Update($sql);
} }
public function Delete($id="") public function Delete($id="")
{ {
if(is_numeric($id)) if(is_numeric($id))
{ {
$this->id=$id; $this->id=$id;
} }
else else
return -1; return -1;
$sql = "DELETE FROM datei WHERE (id='{$this->id}')"; $sql = "DELETE FROM datei WHERE (id='{$this->id}' AND geloescht <> 1)";
$this->app->DB->Delete($sql); $this->app->DB->Delete($sql);
$this->id=""; $this->id="";
$this->titel=""; $this->titel="";
$this->beschreibung=""; $this->beschreibung="";
$this->nummer=""; $this->nummer="";
$this->geloescht=""; $this->geloescht="";
$this->logdatei=""; $this->logdatei="";
$this->firma=""; $this->firma="";
} }
public function Copy() public function Copy()
{ {
$this->id = ""; $this->id = "";
$this->Create(); $this->Create();
} }
/** /**
Mit dieser Funktion kann man einen Datensatz suchen Mit dieser Funktion kann man einen Datensatz suchen
dafuer muss man die Attribute setzen nach denen gesucht werden soll dafuer muss man die Attribute setzen nach denen gesucht werden soll
dann kriegt man als ergebnis den ersten Datensatz der auf die Suche uebereinstimmt dann kriegt man als ergebnis den ersten Datensatz der auf die Suche uebereinstimmt
zurueck. Mit Next() kann man sich alle weiteren Ergebnisse abholen zurueck. Mit Next() kann man sich alle weiteren Ergebnisse abholen
**/ **/
public function Find() public function Find()
{ {
//TODO Suche mit den werten machen //TODO Suche mit den werten machen
} }
public function FindNext() public function FindNext()
{ {
//TODO Suche mit den alten werten fortsetzen machen //TODO Suche mit den alten werten fortsetzen machen
} }
/** Funktionen um durch die Tabelle iterieren zu koennen */ /** Funktionen um durch die Tabelle iterieren zu koennen */
public function Next() public function Next()
{ {
//TODO: SQL Statement passt nach meiner Meinung nach noch nicht immer //TODO: SQL Statement passt nach meiner Meinung nach noch nicht immer
} }
public function First() public function First()
{ {
//TODO: SQL Statement passt nach meiner Meinung nach noch nicht immer //TODO: SQL Statement passt nach meiner Meinung nach noch nicht immer
} }
/** dank dieser funktionen kann man die tatsaechlichen werte einfach /** dank dieser funktionen kann man die tatsaechlichen werte einfach
ueberladen (in einem Objekt das mit seiner klasse ueber dieser steht)**/ ueberladen (in einem Objekt das mit seiner klasse ueber dieser steht)**/
function SetId($value) { $this->id=$value; } function SetId($value) { $this->id=$value; }
function GetId() { return $this->id; } function GetId() { return $this->id; }
function SetTitel($value) { $this->titel=$value; } function SetTitel($value) { $this->titel=$value; }
function GetTitel() { return $this->titel; } function GetTitel() { return $this->titel; }
function SetBeschreibung($value) { $this->beschreibung=$value; } function SetBeschreibung($value) { $this->beschreibung=$value; }
function GetBeschreibung() { return $this->beschreibung; } function GetBeschreibung() { return $this->beschreibung; }
function SetNummer($value) { $this->nummer=$value; } function SetNummer($value) { $this->nummer=$value; }
function GetNummer() { return $this->nummer; } function GetNummer() { return $this->nummer; }
function SetGeloescht($value) { $this->geloescht=$value; } function SetGeloescht($value) { $this->geloescht=$value; }
function GetGeloescht() { return $this->geloescht; } function GetGeloescht() { return $this->geloescht; }
function SetLogdatei($value) { $this->logdatei=$value; } function SetLogdatei($value) { $this->logdatei=$value; }
function GetLogdatei() { return $this->logdatei; } function GetLogdatei() { return $this->logdatei; }
function SetFirma($value) { $this->firma=$value; } function SetFirma($value) { $this->firma=$value; }
function GetFirma() { return $this->firma; } function GetFirma() { return $this->firma; }
} }
?> ?>

View File

@ -438,8 +438,11 @@ class Ajax {
$objekt = $this->app->YUI->dateien_module_objekt_map($module); $objekt = $this->app->YUI->dateien_module_objekt_map($module);
$ersteller = $this->app->DB->real_escape_string($this->app->User->GetName()); $ersteller = $this->app->DB->real_escape_string($this->app->User->GetName());
$geschuetzt = $this->app->DB->Select("SELECT geschuetzt FROM datei WHERE id = '".$id."'");
$datei = $this->app->DB->SelectArr("SELECT d.id, s.id as sid FROM datei d LEFT JOIN datei_stichwoerter s ON d.id=s.datei LEFT JOIN datei_version v ON v.datei=d.id WHERE s.objekt LIKE '$objekt' AND s.parameter='$parameter' AND d.geloescht=0 AND d.id = '$id' LIMIT 1"); $datei = $this->app->DB->SelectArr("SELECT d.id, s.id as sid FROM datei d LEFT JOIN datei_stichwoerter s ON d.id=s.datei LEFT JOIN datei_version v ON v.datei=d.id WHERE s.objekt LIKE '$objekt' AND s.parameter='$parameter' AND d.geloescht=0 AND d.id = '$id' LIMIT 1");
if($datei) if($datei && !$geschuetzt)
{ {
$sid = $datei[0]['sid']; $sid = $datei[0]['sid'];
if($subjekt && $sid) if($subjekt && $sid)

View File

@ -20,7 +20,7 @@
<table border="0" width="100%"> <table border="0" width="100%">
<tr> <tr>
<td width="" valign="" height="" bgcolor="" align="right" bordercolor="" classname="orange2" class="orange2"> <td width="" valign="" height="" bgcolor="" align="right" bordercolor="" classname="orange2" class="orange2">
<input type="submit" name="speichern" value="Speichern" /> <input type="submit" name="titel_beschreibung_speichern" value="Speichern" />
</td> </td>
</tr> </tr>
<tr> <tr>

View File

@ -145,8 +145,7 @@ class Dateien {
$this->app->ActionHandler("zahlung","DateienZahlung"); $this->app->ActionHandler("zahlung","DateienZahlung");
$this->app->ActionHandler("protokoll","DateienProtokoll"); $this->app->ActionHandler("protokoll","DateienProtokoll");
$this->app->ActionHandler("abschicken","DateienAbschicken"); $this->app->ActionHandler("abschicken","DateienAbschicken");
$this->app->ActionHandler("freigabe","DateienFreigabe"); $this->app->ActionHandler("freigabe","DateienFreigabe");
$this->app->ActionHandler("delete","DateienDelete");
$this->app->ActionHandler("listfreigegebene","DateienListFreigegebene"); $this->app->ActionHandler("listfreigegebene","DateienListFreigegebene");
$this->app->ActionHandler("kundeuebernehmen","DateienKundeuebernehmen"); $this->app->ActionHandler("kundeuebernehmen","DateienKundeuebernehmen");
$this->app->ActionHandler("versand","DateienVersand"); $this->app->ActionHandler("versand","DateienVersand");
@ -185,10 +184,18 @@ class Dateien {
function DateienMinidetail() function DateienMinidetail()
{ {
$id = (int)$this->app->Secure->GetGET('id'); $id = (int)$this->app->Secure->GetGET('id');
echo "<h2>Beschreibung:</h2>"; $table = new EasyTable($this->app);
echo nl2br($this->app->DB->Select("SELECT beschreibung FROM datei WHERE id = '$id' LIMIT 1")); $table->Query("SELECT version,dateiname,datum,ersteller,bemerkung,id FROM datei_version WHERE datei='$id'",0,"");
$this->app->ExitXentral(); $table->DisplayNew('VERSIONEN',"
<a href=\"index.php?module=dateien&action=send&fid=%value%&id=$id\"><img src=\"./themes/new/images/download.svg\" border=\"0\"></a>
");
$table = new EasyTable($this->app);
$table->Query("SELECT subjekt,objekt,parameter FROM datei_stichwoerter WHERE datei='$id'",0,"");
$table->DisplayNew('STICHWOERTER',"Parameter","noAction");
$this->app->Tpl->Output('datei_minidetail.tpl');
$this->app->ExitXentral();
} }
function DateienHauptMenu() function DateienHauptMenu()
@ -307,16 +314,21 @@ class Dateien {
$id = $this->app->Secure->GetGET("id"); $id = $this->app->Secure->GetGET("id");
$this->DateienHauptMenu(); $this->DateienHauptMenu();
$this->app->YUI->DateiUploadNeuVersion('NEUEVERSION',$id);
$speichern = $this->app->Secure->GetPOST("speichern"); $geschuetzt = $this->app->DB->Select("SELECT geschuetzt FROM datei WHERE id = '".$id."' LIMIT 1");
if($speichern !="") if (!$geschuetzt) {
{ $this->DateiUploadNeuVersion('NEUEVERSION',$id);
$titel= $this->app->Secure->GetPOST("titel"); $speichern = $this->app->Secure->GetPOST("titel_beschreibung_speichern");
$beschreibung= $this->app->Secure->GetPOST("beschreibung"); if($titel_beschreibung_speichern !="")
{
$this->app->DB->Update("UPDATE datei SET titel='$titel', beschreibung='$beschreibung' WHERE id='$id' LIMIT 1"); $titel= $this->app->Secure->GetPOST("titel");
$beschreibung= $this->app->Secure->GetPOST("beschreibung");
$this->app->DB->Update("UPDATE datei SET titel='$titel', beschreibung='$beschreibung' WHERE id='$id' LIMIT 1");
}
} }
$this->app->Tpl->Set('STARTDISABLE', "<!--");
$this->app->Tpl->Set('ENDEDISABLE', "-->");
$this->app->Tpl->Parse('NEUEVERSION', "datei_neudirekt.tpl");
$titel = $this->app->DB->Select("SELECT titel FROM datei WHERE id='$id' LIMIT 1"); $titel = $this->app->DB->Select("SELECT titel FROM datei WHERE id='$id' LIMIT 1");
$beschreibung = $this->app->DB->Select("SELECT beschreibung FROM datei WHERE id='$id' LIMIT 1"); $beschreibung = $this->app->DB->Select("SELECT beschreibung FROM datei WHERE id='$id' LIMIT 1");
@ -369,7 +381,7 @@ class Dateien {
// Deletion of files removed, they only get marketd // Deletion of files removed, they only get marketd
$this->app->DB->Update("UPDATE datei SET geloescht=1 WHERE id='$id'"); $this->app->DB->Update("UPDATE datei SET geloescht=1 WHERE id='$id' AND NOT geschuetzt");
$refer = $_SERVER['HTTP_REFERER']; $refer = $_SERVER['HTTP_REFERER'];
$this->app->Location->execute($refer); $this->app->Location->execute($refer);
} }
@ -382,5 +394,24 @@ class Dateien {
$this->app->Tpl->Set('HEADING',"Dateien (Protokoll)"); $this->app->Tpl->Set('HEADING',"Dateien (Protokoll)");
$this->app->Tpl->Parse('PAGE',"dateien_protokoll.tpl"); $this->app->Tpl->Parse('PAGE',"dateien_protokoll.tpl");
} }
function DateiUploadNeuVersion($parsetarget, $datei) {
$speichern = $this->app->Secure->GetPOST("speichern");
$module = $this->app->Secure->GetGET("module");
$action = $this->app->Secure->GetGET("action");
$id = $this->app->Secure->GetGET("id");
if($id)$this->app->Tpl->Set('ID',$id);
// Get files here
if ($speichern != "") {
$retval = $this->app->YUI->FilesFromUploadtoDMS(null, null, $datei);
if ($retval !== true) {
$this->app->Tpl->Set('ERROR', implode(', ',$retval));
$this->app->erp->EnableTab("tabs-2");
} else {
// header("Location: index.php?module=$module&action=$action&id=$id");
}
}
}
} }

View File

@ -240,7 +240,8 @@ class Rechnung extends GenRechnung
ersteller: $this->app->User->GetName(), ersteller: $this->app->User->GetName(),
subjekt: 'rechnung', subjekt: 'rechnung',
objekt: 'rechnung', objekt: 'rechnung',
parameter: $id parameter: $id,
geschuetzt: true
); );
} }
} else { } else {

View File

@ -2274,6 +2274,9 @@ class Shopimporter_Shopware extends ShopimporterBase
return $anzahl; return $anzahl;
} }
/*
Dysfunctional code: column `datei` does not exist in table `datei`
public function ImportDeleteFile() public function ImportDeleteFile()
{ {
$tmp = $this->CatchRemoteCommand('data'); $tmp = $this->CatchRemoteCommand('data');
@ -2303,7 +2306,7 @@ class Shopimporter_Shopware extends ShopimporterBase
} }
return 'ok'; return 'ok';
} }
*/
public function ImportAddFileSubjekt() public function ImportAddFileSubjekt()
{ {
@ -2320,7 +2323,6 @@ class Shopimporter_Shopware extends ShopimporterBase
return 'ok'; return 'ok';
} }
// delete an article // delete an article
public function ImportDeleteArticle() public function ImportDeleteArticle()
{ {