diff --git a/system/abgabe2opus.php b/system/abgabe2opus.php index a551725e7..c231916f6 100644 --- a/system/abgabe2opus.php +++ b/system/abgabe2opus.php @@ -38,12 +38,22 @@ require_once('../include/mail.class.php'); die('Es konnte keine Verbindung zum Server aufgebaut werden.'); // zugriff auf mssql-datenbank - if (!$conn_ext=mysql_connect (OPUS_SERVER, OPUS_USER, OPUS_PASSWD)) + if (!$conn_ext=mysql_pconnect (OPUS_SERVER, OPUS_USER, OPUS_PASSWD)) die('Fehler beim Verbindungsaufbau!'); mysql_select_db(OPUS_DB, $conn_ext); - +/* + $sock = $opus->connect(); + if ($sock < 0 || $opus->select_db() < 0) + { + print (""); + echo ("Error: $ERRMSG\n"); + print (" \n"); + } +*/ $datum_obj = new datum(); +//$jahr=''; +//$source_opus=''; $fehler=''; $error=false; $begutachter1=''; @@ -56,8 +66,1116 @@ $typ=''; $bereich=1; $stg=''; $row_opus=0; -$opus_url=OPUS_PATH_PAA; //http://cis.technikum-wien.at/opus/htdocs/volltexte/ 2008/10/ -$url_paa='http://dav.technikum-wien.at/ruhan/PaUpload/'; +$opus_url=OPUS_PATH_PAA; +$url_paa=PAABGABE_PATH; +function formatDatum($datum, $format='Y-m-d H:i:s') +{ + if(trim($datum)=='') + return ''; + + $ts=''; + $error=false; + + //2008-12-31 + if(ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})",$datum, $regs)) + $ts = mktime(0,0,0,$regs[2],$regs[3],$regs[1]); + + //2008-12-31 12:30 + if(ereg("([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2})",$datum, $regs)) + $ts = mktime($regs[4],$regs[5],0,$regs[2],$regs[3],$regs[1]); + + //2008-12-31 12:30:15 + if(ereg("([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})",$datum, $regs)) + $ts = mktime($regs[4],$regs[5],$regs[6],$regs[2],$regs[3],$regs[1]); + + //1.12.2008 + if(ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})",$datum, $regs)) + $ts = mktime(0,0,0,$regs[2],$regs[1],$regs[3]); + + //1.12.2008 12:30 + if(ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4}) ([0-9]{2}):([0-9]{2})",$datum, $regs)) + $ts = mktime($regs[4],$regs[5],0,$regs[2],$regs[1],$regs[3]); + + //1.12.2008 12:30:15 + if(ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4}) ([0-9]{2}):([0-9]{2}):([0-9]{2})",$datum, $regs)) + $ts = mktime($regs[4],$regs[5],$regs[6],$regs[2],$regs[1],$regs[3]); + + if($ts=='') + { + $ts = strtotime($datum); + if(!$ts || $ts==-1) + { + //wenn strtotime fehlschlaegt liefert diese -1 zurueck, ab php5.1.0 jedoch false + $error = true; + } + } + + if($ts!='' && !$error) + return date($format, $ts); + + return false; +} +function indexdatei($source_opus, $fd) +{ + require '../opus/lib/opus.class.php'; + $opus = new OPUS('../opus/lib/opus.conf'); + $php = $opus->value("php"); + $db = $opus->value("db"); + $opustable = $opus->value("opus_table"); + $url = $opus->value("url"); + $mod_checksum = $opus->value("mod_checksum"); + $projekt = $opus->value("projekt"); + $url_anzeigen = $opus->value("url_anzeigen"); + $urn_anzeigen = $opus->value("urn_anzeigen"); + $lic_active = $opus->value("license_active"); + $doku_pfad = $opus->value("doku_pfad"); + $statistik = $opus->value("statistik"); + $awstats_url = $opus->value("awstats_url"); + $awstats_config = $opus->value("awstats_config"); + $empfehlen = $opus->value("empfehlen"); + $mehrsprachig = $opus->value("mehrsprachig"); + $google_scholar = $opus->value("google_scholar"); + $url_google_scholar = $opus->value("url_google_scholar"); + # BD, 16.9.05: steht nun in frontdoor.conf + # $titel = $opus->value("titel_frontdoor"); + # $ueberschrift = $opus->value("ueberschrift_frontdoor"); + // Anfang Collections + $coll_anzeigen = $opus->value("coll_anzeigen"); + // Ende Collections + $opustable_autor = $opustable . "_autor"; + $opustable_inst = $opustable . "_inst"; + $opustable_diss = $opustable . "_diss"; + $opustable_subject_type = $opustable . "_subject_type"; + $opustable_sr = $opustable . "_schriftenreihe"; + // Anfang Collections + $opustable_coll = $opustable . "_coll"; + // Ende Collections + // Social-Bookmarking-Schnittstellen + $connotea_export = $opus->value("connotea_export"); + $delicious_export = $opus->value("delicious_export"); + $social_bookmarking = 0; + if ($connotea_export == 1 || $delicious_export == 1) + { + $social_bookmarking = 1; + } + /*if ($_REQUEST["show_connotea"]) + { + $_SESSION["show_connotea"] = true; + }*/ + // Ende Social-Bookmarking-Schnittstellen + include ("../opus/lib/stringValidation.php"); + //$source_opus = $_REQUEST['source_opus']; + if (!_is_valid($source_opus, 1, 10, "[0-9]+")) + { + die("Fehler in Parameter source_opus"); + } + # A.Maile 10.2.05: Sprache einlesen aus opus.conf, falls nicht gesetzt + if (!$la) + { + $la = $opus->value("la"); + } + # O. Marahrens: Automatisch alle Texte aus der Textdatei holen + $texte = new OPUS("../opus/texte/$la/frontdoor.conf"); + foreach($texte->getValues() as $k => $v) { + $$k = $v; + } + + $res = $opus->query("SELECT * FROM $opustable WHERE source_opus = $source_opus "); + $num_res = $opus->num_rows($res); + if ($num_res > 0) + { + $mrow = $opus->fetch_row($res); + $title_orig = $mrow[0]; + $title = htmlspecialchars($mrow[0]); + $creator_corporate = $mrow[1]; + $subject_swd = htmlspecialchars($mrow[2]); + $description = $mrow[3]; + # Abstract fuer die Metadaten html-codieren + $description_meta = htmlspecialchars($mrow[3]); + $publisher_university = $mrow[4]; + $contributors_name = $mrow[5]; + $contributors_corporate = $mrow[6]; + $date_year = $mrow[7]; + $date_creation = $mrow[8]; + $date_modified_old = $mrow[9]; + $type = $mrow[10]; + $source_opus = $mrow[11]; + $source_title = htmlspecialchars($mrow[12]); + $source_swb = $mrow[13]; + $language = $mrow[14]; + $verification = $mrow[15]; + $subject_uncontrolled_german = htmlspecialchars($mrow[16]); + $subject_uncontrolled_english = htmlspecialchars($mrow[17]); + $title_en = $mrow[18]; + $description2 = $mrow[19]; + # Abstract fuer die Metadaten html-codieren + $description2_meta = htmlspecialchars($mrow[19]); + $subject_type = $mrow[20]; + $date_valid = $mrow[21]; + $description_lang = $mrow[22]; + $description2_lang = $mrow[23]; + $sachgruppe_ddc = $mrow[24]; + $urn = $mrow[25]; + $bereich_id = $mrow[26]; + if ($lic_active >= 2) + { + $lic = $mrow[27]; + } + $isbn = $mrow[28]; + $bem_extern = $mrow[30]; + //******************************************************************************************************************************** + //Änderung TW + $issn = $mrow[32]; + $ac_nr = $mrow[33]; + $studiengang = $mrow[34]; + $seitenanzahl = $mrow[35]; + $datum = $mrow[36]; + $gutachter1 = $mrow[37]; + $gutachter2 = $mrow[38]; + //******************************************************************************************************************************** + $opus->free_result($res); + /***** Schriftenreihe Start *****/ + $sr_id = ""; + $sr_band = ""; + $res = $opus->query("SELECT * FROM $opustable_sr WHERE source_opus = $source_opus "); + $num_res = $opus->num_rows($res); + if ($num_res > 0) + { + $mrow = $opus->fetch_row($res); + $sr_id = $mrow[1]; + $sr_band = $mrow[2]; + $res = $opus->query("select name from schriftenreihen where sr_id = '$sr_id' "); + $mrow = $opus->fetch_row($res); + $sr_name = $mrow[0]; + $opus->free_result($res); + } + /***** Schriftenreihe Stop *****/ + /* Bei Dissertation (type 8) und Habilitation (type 24) zusaetzlich */ + /* Tag der muendlichen Pruefung (bzw. des Kollquiums) und Hauptberichter anzeigen */ + if ($type == "8" || $type == "24") + { + $res = $opus->query("SELECT date_accepted, advisor, publisher_faculty, title_de FROM $opustable_diss WHERE source_opus = $source_opus"); + $anz = $opus->num_rows($res); + if ($anz > 0) + { + $mrow = $opus->fetch_row($res); + $date_accepted = $mrow[0]; + $advisor = htmlspecialchars($mrow[1]); + $faculty_nr = $mrow[2]; + $title_de = $mrow[3]; + } + $opus->free_result($res); + $res = $opus->query("SELECT fakultaet from faculty_$la where nr = '$faculty_nr'"); + $mrow = $opus->fetch_row($res); + $publisher_faculty = $mrow[0]; + $opus->free_result($res); + } + $jahr = date("Y", $date_creation); + $res = $opus->query("SELECT name FROM institute_$la i, $opustable_inst oi WHERE i.nr=oi.inst_nr and oi.source_opus = '$source_opus'"); + $instnum = $opus->num_rows($res); + $i = 0; + while ($i < $instnum) + { + $i++; + $mrow = $opus->fetch_row($res); + $inst[$i] = $mrow[0]; + } + $opus->free_result($res); + // Anfang Collections + if ($coll_anzeigen == "true") + { + $res = $opus->query("SELECT c.coll_id FROM collections as c, $opustable_coll as oc WHERE c.coll_id = oc.coll_id and oc.source_opus = '$source_opus'"); + $collnum = $opus->num_rows($res); + $i = 0; + while ($i < $collnum) + { + $i++; + $mrow = $opus->fetch_row($res); + $coll[$i] = $mrow[0]; + } + $opus->free_result($res); + } + // Ende Collections + $res = $opus->query("SELECT sprache FROM language_$la WHERE code='$language'"); + $mrow = $opus->fetch_row($res); + $sprache = ucfirst($mrow[0]); + $opus->free_result($res); + $res = $opus->query("SELECT sprache FROM language_$la WHERE code='$description_lang'"); + $mrow = $opus->fetch_row($res); + $sprache_description = ucfirst($mrow[0]); + $opus->free_result($res); + if ($description2_lang != "") + { + $res = $opus->query("SELECT sprache FROM language_$la WHERE code='$description2_lang'"); + $mrow = $opus->fetch_row($res); + $sprache_description2 = ucfirst($mrow[0]); + $opus->free_result($res); + } + $res = $opus->query("SELECT dokumentart FROM resource_type_$la WHERE typeid='$type'"); + $mrow = $opus->fetch_row($res); + $dokumentart = $mrow[0]; + $opus->free_result($res); + # Start Lizenzvertrag + # Link auf Lizenz ausgeben, falls Lizenz-Modul aktiv und Feld lic belegt. + # Falls Lizenz-Modul aktiv, aber Feld lic nicht belegt (alte OPUS-Bestaende) + # dann Link auf urheberrecht.php ausgeben. + if ($lic_active >= 2) + { + $res = $opus->query("SELECT longname, link, logo, desc_text, desc_html FROM license_$la WHERE shortname='$lic'"); + $licnum = $opus->num_rows($res); + if ($licnum == 1) + { + $mrow = $opus->fetch_row($res); + $licname = $mrow[0]; + $liclink = $mrow[1]; + $liclogo = $mrow[2]; + $licdesc = $mrow[3]; + $licdesc_html = $mrow[4]; + $liclink_head = "$lizenz
"; + } + else + { + $liclink_head = "$text1"; + } + $opus->free_result($res); + } + else + { + $liclink_head = "$text1"; + } + # Ende Lizenzvertrag + # Zugriff auf Volltexte weltweit/campusweit/weitere Bereiche + # Falls in Altbestaenden (< Opus 3.0) kein Bereich angegeben ist, + # wird bereich_id auf 1 gesetzt = freier Zugriff auf die Dokumente, + # sonst kommt eine Fehlermeldung der Datenbank + if ($bereich_id == "" || $bereich_id == 0) + { + $bereich_id = 1; + } + $res = $opus->query("SELECT bereich, volltext_pfad, volltext_url FROM bereich_$la WHERE bereich_id = $bereich_id"); + $num = $opus->num_rows($res); + if ($num > 0) + { + $mrow = $opus->fetch_row($res); + $bereich = $mrow[0]; + $volltext_pfad = $mrow[1]; + $volltext_url = $mrow[2]; + $opus->free_result($res); + } + # Ende Zugriff auf Volltexte weltweit/campusweit/weitere Bereiche + $autor = $opus->query("SELECT creator_name, reihenfolge FROM $opustable_autor WHERE source_opus = $source_opus order by reihenfolge"); + $anzahl_creator_name = $opus->num_rows($autor); + $i = 0; + while ($i < $anzahl_creator_name) + { + $mrow = $opus->fetch_row($autor); + $creator_name = $mrow[0]; + $creator_name = htmlspecialchars($creator_name); + $search_creator.= " ; " . $creator_name; + $i++; + } + $search_creator = substr($search_creator, 3); + # Titel und Autoren des Dokuments sollen in$liclink_head \n");
+ # fwrite($fd,"Bitte beziehen Sie sich beim Zitieren dieses Dokumentes immer auf folgende
\n");
+ # fwrite($fd,"$dokumentart zugaenglich unter:");
+ fwrite($fd,"$dokumentart $t_dokumentart_2
\n");
+ # Wenn Urn vorhanden und urn_anzeigen auf 1 gesetzt ist, wird die Urn angezeigt.
+ # Wenn keine Urn vorhanden ist und url_anzeigen auf 2 gesetzt ist, dann Url anzeigen.
+ # Wenn url_anzeigen auf 1 gesetzt ist, dann immer Url anzeigen.
+ if ($urn && $urn_anzeigen)
+ {
+ fwrite($fd,"URN: $urn
\n");
+ }
+ else
+ {
+ if ($url_anzeigen == 2)
+ {
+ if (file_exists("$volltext_pfad/$jahr/$source_opus") == 1)
+ {
+ fwrite($fd,"URL: $volltext_url/$jahr/$source_opus/
\n");
+ }
+ }
+ }
+ if ($url_anzeigen == 1)
+ {
+ if (file_exists("$volltext_pfad/$jahr/$source_opus") == 1)
+ {
+ fwrite($fd,"URL: $volltext_url/$jahr/$source_opus/
\n");
+ }
+ }
+ fwrite($fd,"
\n"); + fwrite($fd,"$t_titel1: $title\n"); + if ($title_en != "") + { + fwrite($fd,"
$t_titel2: $title_en\n"); + } + /*if ($title_de != "") + { + fwrite($fd,"
$title_de\n"); + }*/ + fwrite($fd,"
\n"); + include ("../opus/lib/font.html"); + $link = "$url/ergebnis.$php?suchart=teil&Lines_Displayed=10&sort=o.date_year+DESC%2C+o.title&suchfeld1=freitext&suchwert1=&opt1=AND&opt2=AND&suchfeld3=date_year&suchwert3=&startindex=0&page=0&dir=2&suche=&suchfeld2=oa.person&suchwert2="; + #$res = $opus->query("SELECT creator_name, reihenfolge from opus_autor where source_opus = $source_opus order by reihenfolge "); + if ($anzahl_creator_name > 0) + { + $opus->data_seek($autor, 0); + $mrow = $opus->fetch_row($autor); + $creator_name = $mrow[0]; + # A. Maile, 6.8.2007: Ersten Autor speichern für Google Scholar + $first_creator = $creator_name; + $person = htmlspecialchars(rawurlencode($creator_name)); + fwrite($fd,"Autor(in): $creator_name"); + $pod_creator_names = $person; + if ($anzahl_creator_name > 1) + { + $i = 1; + while ($i < $anzahl_creator_name) + { + $i++; + $mrow = $opus->fetch_row($autor); + $creator_name = $mrow[0]; + $person = htmlspecialchars(rawurlencode($creator_name)); + fwrite($fd," ; \nAutor(in): $creator_name"); + $pod_creator_names.= " ; " . $person; + } + } + } + $opus->free_result($autor); + fwrite($fd,"
");
+ if ($contributors_name != "")
+ {
+ # fwrite($fd," \n");
+ fwrite($fd," \n");
+ }
+ } else {
+ print ($opus_url."/pdf/ nicht vorhanden.
Weitere Beteiligte (Hrsg. etc.): $contributors_name \n");
+ fwrite($fd,"$t_weitere_beteiligte $contributors_name
\n");
+ }
+ if ($creator_corporate != "")
+ {
+ fwrite($fd,"$creator_corporate
\n");
+ }
+ fwrite($fd," \n");
+ fwrite($fd," \n");
+ if ($source_title != "")
+ {
+ fwrite($fd,"
");
+ fwrite($fd," \n \n");
+ }
+ /* Es werden die Formate, die in der Tabelle Format im Feld extension stehen */
+ /* in der Frontdoor angezeigt. Es wird geschaut, ob das jeweilige Directory */
+ /* exisitiert und die darin enthaltenen Dateien in einer Tabelle ausgegeben */
+ $format = $opus->query("select extension from format where name <> 'Originalformat' ");
+ $num_format = $opus->num_rows($format);
+ $f = 0;
+ while ($f < $num_format)
+ {
+ $f++;
+ $mrow = $opus->fetch_row($format);
+ $ext = $mrow[0];
+ if (file_exists("$volltext_pfad/$jahr/$source_opus/$ext") == 1)
+ {
+ /* Falls Startfile .*.anzeigen vorhanden, dann nur dieses anzeigen */
+ /* hauptsaechlich bei html */
+ $handle = opendir("$volltext_pfad/$jahr/$source_opus/$ext");
+ while ($file = readdir($handle))
+ {
+ if (preg_match("/\.anzeigen/", $file))
+ {
+ $startfile = $file;
+ }
+ }
+ closedir($handle);
+ if ($startfile != "")
+ {
+ /* fuehrenden Punkt und .anzeigen entfernen = Startfile des html-Dokuments */
+ $startfile = str_replace(".anzeigen", "", $startfile);
+ $startfile = substr($startfile, 1);
+ fwrite($fd,"");
+ fwrite($fd,"$t_quelle \n");
+ fwrite($fd,"");
+ fwrite($fd,"($date_year) $source_title \n");
+ fwrite($fd,"\n \n");
+ }
+ else
+ {
+ $i = 1;
+ $j = 1;
+ /* Verzeichnis in Array einlesen und sortieren */
+ $handle = opendir("$volltext_pfad/$jahr/$source_opus/$ext");
+ while ($file = readdir($handle))
+ {
+ if ($file != "." && $file != "..")
+ {
+ /* Dateien, die mit .bem_ beginnen sind Bemerkungen zu den Dateien, */
+ /* daher werden nur Dateien, die nicht mit .bem_ anfangen in der */
+ /* Frontdoor aufgelistet. Gepackte Dateien werden separat aufgelistet */
+ if (!preg_match("/^\.bem_/", $file) && !preg_match("/\.zip/i", $file) && !preg_match("/\.gz/i", $file)) {
+ $dir_array[count($dir_array) ] = $file;
+ }
+ }
+ }
+ closedir($handle);
+ $num = count($dir_array);
+ if ($num > 0)
+ {
+ sort($dir_array);
+ fwrite($fd,"");
+ fwrite($fd,"$ext-$t_format: \n \n");
+ fwrite($fd,"\n\n
\n");
+ fwrite($fd,"\n");
+ fwrite($fd," \n");
+ fwrite($fd,"Dokument1.$ext \n \n");
+ fwrite($fd,"\n\n \n");
+ }
+ }
+ /* gezipptes File mit Endung zip bzw. gz einlesen */
+ $g = 0;
+ while ($g < 2)
+ {
+ $g++;
+ if ($g == 1)
+ {
+ $z = "zip";
+ }
+ if ($g == 2)
+ {
+ $z = "gz";
+ }
+ $handle = opendir("$volltext_pfad/$jahr/$source_opus/$ext");
+ while ($file = readdir($handle))
+ {
+ if (preg_match("/\.$z/i", $file))
+ {
+ if (!preg_match("/^\.bem_/", $file))
+ {
+ $line = "$volltext_pfad/$jahr/$source_opus/$ext/$file";
+ $size = stat($line);
+ $filesize = $size[7];
+ $filesize = $filesize/1024;
+ if ($filesize < 1)
+ {
+ $filesize = number_format($filesize, 1);;
+ }
+ else
+ {
+ $filesize = number_format($filesize);
+ }
+ $bem_file = "";
+ if (file_exists("$volltext_pfad/$jahr/$source_opus/$ext/.bem_$file"))
+ {
+ $fd = fopen("$volltext_pfad/$jahr/$source_opus/$ext/.bem_$file", "r");
+ $bem_file = fread($fd, filesize("$volltext_pfad/$jahr/$source_opus/$ext/.bem_$file"));
+ fclose($fd);
+ }
+ fwrite($fd,"");
+ fwrite($fd,"$ext-$t_format: \n \n");
+ fwrite($fd,"\n\n
\n");
+ fwrite($fd,"\n");
+ $k = 0;
+ while ($k < $num)
+ {
+ $filename = array_shift($dir_array);
+ $bem_file = "";
+ if (file_exists("$volltext_pfad/$jahr/$source_opus/$ext/.bem_$filename"))
+ {
+ $fd = fopen("$volltext_pfad/$jahr/$source_opus/$ext/.bem_$filename", "r");
+ $bem_file = fread($fd, filesize("$volltext_pfad/$jahr/$source_opus/$ext/.bem_$filename"));
+ fclose($fd);
+ }
+ $file = "$volltext_pfad/$jahr/$source_opus/$ext/$filename";
+ $array = explode(".", $filename);
+ $last = count($array) -1;
+ $ext2 = strtolower($array[$last]);
+ $size = stat($file);
+ $filesize = $size[7];
+ $filesize = $filesize/1024;
+ if ($filesize < 1)
+ {
+ $filesize = number_format($filesize, 1, ",", ".");
+ }
+ else
+ {
+ $filesize = number_format($filesize, 0, ",", ".");
+ }
+ $format2 = $opus->query("select extension from format where extension like '$ext2%' ");
+ $num_format2 = $opus->num_rows($format2);
+ if ($num_format2 > 0)
+ {
+ if ($i > 3)
+ {
+ fwrite($fd,"\n \n\n");
+ $i = 1;
+ }
+ fwrite($fd," \n");
+ fwrite($fd,"Dokument $j.$ext2 ($filesize KB) ");
+ if ($bem_file != "")
+ {
+ fwrite($fd,"($bem_file)");
+ }
+ fwrite($fd,"\n \n");
+ $i++;
+ $j++;
+ }
+ $k++;
+ }
+ fwrite($fd,"\n\n \n");
+ }
+ }
+ }
+ closedir($handle);
+ }
+ }
+ }
+ $opus->free_result($format);
+ fwrite($fd,"");
+ fwrite($fd,"$ext gepackt: \n \n");
+ fwrite($fd,"\n\n
\n");
+ fwrite($fd,"\n");
+ fwrite($fd," \n");
+ fwrite($fd,"Dokument1.$z ($filesize KB) ");
+ if ($bem_file != "")
+ {
+ fwrite($fd,"($bem_file)");
+ }
+ fwrite($fd,"\n \n");
+ fwrite($fd,"\n
\n");
+
+ # Checksummen-Ueberpruefung
+ if ($mod_gpg == 1 || $mod_checksum == 1)
+ {
+ fwrite($fd,"![]()
\n");
+ }
+
+ # A. Maile 11.10.05: Link zur Dokumentempfehlung
+ if ($empfehlen == 1)
+ {
+ fwrite($fd,"![]()
\n");
+ }
+
+ # A. Maile 11.10.05: Link zur Statistik-Anzeige
+ if ($statistik == 1)
+ {
+ fwrite($fd,"![]()
\n");
+ # Fuer Statistik mit awstats folgende Zeile auskommentieren.
+ #fwrite($fd,"![]()
$t_statistik \n");
+ }
+
+ # O.Marahrens 30.03.07: Social-Bookmarking-Dienste
+ if ($social_bookmarking == 1)
+ {
+ # O.Marahrens 02.02.07: Link zum Connotea-Bookmark
+ if ($connotea_export == 1)
+ {
+ fwrite($fd,"![]()
\n");
+ }
+ # U.Herb: del.icio.us-Bookmarking
+ if ($delicious_export == 1)
+ {
+ fwrite($fd,"![]()
\n");
+ }
+ }
+ # A. Maile 6.8.2007: Link auf Google Scholar mit Suche nach exaktem Titel und Autor
+ if ($google_scholar == 1)
+ {
+ fwrite($fd,"![]()
\n");
+ }
+
+ fwrite($fd,"
" .
+ "
\n" .
+ "
" .
+ "" .
+ "
\n");
+
+ fwrite($fd,"
\n");
+ fwrite($fd,"");
+
+ if ($lic_active >= 1)
+ {
+ $pod_active = $opus->value("pod_active");
+ if ($pod_active > 0 && $bereich_id == 1) { // check, ob lic pod erlaubt und Volltext frei zugaenglich
+ $res = $opus->query("SELECT pod_allowed FROM license_$la WHERE shortname='$lic'");
+ $podnum = $opus->num_rows($res);
+ if ($podnum == 1)
+ {
+ $mrow = $opus->fetch_row($res);
+ if ($mrow[0] == 1)
+ {
+ fwrite($fd,"
\n");
+ }
+ else
+ {
+ #fwrite($fd,"IDN $source_opus nicht vorhanden.");
+ fwrite($fd,"$text7 $source_opus $text8 ");
+ }
+ //$opus->close($sock);
+}
+
//****************************************************************************************************
//Einlesen Projektarbeiten
@@ -74,6 +1192,9 @@ if($erg=pg_query($conn, $qry))
{
while($row=pg_fetch_object($erg))
{
+ $opus_url=OPUS_PATH_PAA;
+ $url_paa=PAABGABE_PATH;
+ $row->sprache=strtolower(substr($row->sprache,0,3));
//echo "--->".$row->projektarbeit_id.", ".$row->projekttyp_kurzbz.", ".$row->student_uid;
//****************************************************************************************************
//weitere benötigte Daten
@@ -303,7 +1424,7 @@ if($erg=pg_query($conn, $qry))
$qry_cre="INSERT INTO opus_autor (source_opus, creator_name, reihenfolge) VALUES ('".$row_opus."', '".$verfasser."', '1')";
$qry_inst="INSERT INTO opus_inst (source_opus, inst_nr) VALUES ('".$row_opus."', '".$institut."')";
- $opus_url.=$datum_obj->formatDatum($row->abgabedatum,'Y')."/".$row_opus."/pdf/";
+
$qry="START TRANSACTION";
@@ -344,9 +1465,23 @@ if($erg=pg_query($conn, $qry))
{
if($row_file=pg_fetch_object($result_file))
{
- copy($url_paa.$row_file->paabgabe_id.'_'.$row->student_uid.'.pdf',$opus_url."".$row_file->paabgabe_id.'_'.$row->student_uid.'.pdf');
+ if(!is_dir($opus_url.$datum_obj->formatDatum($row->abgabedatum,'Y')))
+ {
+ mkdir($opus_url.$datum_obj->formatDatum($row->abgabedatum,'Y'), 0775);
+ }
+ if(!is_dir($opus_url.$datum_obj->formatDatum($row->abgabedatum,'Y')."/".$row_opus))
+ {
+ mkdir($opus_url.$datum_obj->formatDatum($row->abgabedatum,'Y')."/".$row_opus, 0775);
+ }
+ $opus_url=$opus_url.$datum_obj->formatDatum($row->abgabedatum,'Y')."/".$row_opus;
+ if(!is_dir($opus_url."/pdf/"))
+ {
+ mkdir($opus_url."/pdf/", 0775);
+ }
+ //echo " \n \n");
+ }
+ }
+ $opus->free_result($res);
+ }
+ }
+
+ # Zugriff auf Volltexte weltweit/campusweit/weitere Bereiche
+ # Wenn Zugriffsbeschraenkung besteht ($bereich_id > 1)
+ # dann diese anzeigen.
+ if ($bereich_id > 1)
+ {
+ fwrite($fd,"");
+ fwrite($fd,"$pod_linkname_1 \n");
+ fwrite($fd,"\n \n");
+ fwrite($fd,"
\n \n\n");
+ $pod_info = $opus->value("pod_info");
+ $tmp_url = "$volltext_url/$jahr/$source_opus/";
+ $podlink = $pod_info . "?urn=" . urlencode($urn) . "&docurl=" . urlencode($tmp_url) . "&lic=" . $lic . "&aut=" . $pod_creator_names . "&tit=" . htmlspecialchars(rawurlencode($title)) . "&bereich_id=" . $bereich_id . "&la=" . $la;
+ $pod_uselogos = $opus->value("pod_uselogos");
+ $pod_partner_logo = $opus->value("pod_partner_logo");
+ if (($pod_uselogos) AND (strlen($pod_partner_logo) > 0))
+ {
+ $podlogo_width = $opus->value("pod_logo_width");
+ $podlogo_height = $opus->value("pod_logo_height");
+ $podlogo_wh = "";
+ if ($podlogo_width)
+ {
+ $podlogo_wh.= " width=\"" . $podlogo_width . "\"";
+ }
+ if ($podlogo_height)
+ {
+ $podlogo_wh.= " height=\"" . $podlogo_height . "\"";
+ }
+ fwrite($fd,"\n");
+ fwrite($fd," \n");
+ fwrite($fd," \n");
+ }
+ fwrite($fd,"");
+ fwrite($fd,"$pod_linkname_2 \n
\n \n");
+ }
+ # Ende Zugriff auf Volltexte weltweit/campusweit/weitere Bereiche
+ if ($subject_swd != "")
+ {
+ fwrite($fd,"");
+ # fwrite($fd,"Zugriffsbeschränkung: \n");
+ fwrite($fd,"$text3: \n");
+ fwrite($fd,"");
+ fwrite($fd,"$bereich \n");
+ fwrite($fd," \n \n");
+ }
+ if ($subject_uncontrolled_german != "")
+ {
+ fwrite($fd,"");
+ fwrite($fd,"$schlagwoerter_swd \n");
+ fwrite($fd,"");
+ fwrite($fd,"$subject_swd \n");
+ fwrite($fd,"\n \n");
+ }
+ if ($subject_uncontrolled_english != "")
+ {
+ fwrite($fd,"");
+ fwrite($fd,"$schlagwoerter_frei \n");
+ fwrite($fd,"");
+ fwrite($fd,"$subject_uncontrolled_german \n");
+ fwrite($fd," \n \n");
+ }
+ if ($subject_type != "")
+ {
+ $opustable_subject_type = $opustable . "_" . $subject_type;
+ $res = $opus->query("SELECT class from $opustable_subject_type where source_opus = $source_opus");
+ $num = $opus->num_rows($res);
+ if ($num > 0)
+ {
+ $mrow = $opus->fetch_row($res);
+ $class = $mrow[0];
+ $i = 1;
+ while ($i < $num)
+ {
+ $i++;
+ $mrow = $opus->fetch_row($res);
+ $class = "$class , $mrow[0]";
+ }
+ $opus->free_result($res);
+ $res = $opus->query("SELECT name from klassifikation_$la where table_name = '$subject_type' ");
+ $mrow = $opus->fetch_row($res);
+ $class_name = $mrow[0];
+ $opus->free_result($res);
+ fwrite($fd,"");
+ fwrite($fd,"$schlagwoerter_engl \n");
+ fwrite($fd,"");
+ fwrite($fd,"$subject_uncontrolled_english \n");
+ fwrite($fd," \n \n");
+ }
+ }
+ //Anfang Collections
+ if ($coll_anzeigen == "true")
+ {
+ $i = 0;
+ while ($i < $collnum)
+ {
+ $i++;
+ // Wir finden den coll_name der Collection heraus
+ $res_coll = $opus->query("SELECT coll_name FROM collections WHERE coll_id = $coll[$i];");
+ $mrow_coll = $opus->fetch_row($res_coll);
+ $coll_name = $mrow_coll[0];
+ // Wir finden den Namen und die ganze Hierarchie nach oben heraus
+ $query_eltern = "SELECT a.coll_name, (a.rgt - a.lft ) AS height
+ FROM collections AS a, collections AS b
+ WHERE b.lft BETWEEN a.lft AND a.rgt
+ AND b.coll_id = '$coll[$i]'
+ ORDER BY height DESC;";
+ $res_eltern = $opus->query($query_eltern);
+ $num_eltern = $opus->num_rows($res_eltern);
+ fwrite($fd,"");
+ fwrite($fd,"$class_name: \n");
+ fwrite($fd,"");
+ fwrite($fd,"$class \n");
+ fwrite($fd," \n \n");
+ }
+ }
+ // Ende Collections
+ $i = 0;
+ while ($i < $instnum)
+ {
+ $i++;
+ fwrite($fd,"");
+ if ($collnum > 1)
+ {
+ fwrite($fd,"$t_collection $i: \n");
+ }
+ else
+ {
+ fwrite($fd,"$t_collection:\n");
+ }
+ fwrite($fd,"");
+ fwrite($fd,"");
+ $m = 0;
+ while ($m < $num_eltern)
+ {
+ $mrow_eltern = $opus->fetch_row($res_eltern);
+ $coll_name_eltern = $mrow_eltern[0];
+ if ($coll_name_eltern != $coll_name)
+ {
+ fwrite($fd,"$coll_name_eltern / ");
+ }
+ else
+ {
+ fwrite($fd,"$coll_name_eltern");
+ }
+ $m++;
+ }
+ fwrite($fd," \n");
+ fwrite($fd," \n \n");
+ }
+ if ($publisher_faculty != "")
+ {
+ fwrite($fd,"");
+ if ($instnum > 1)
+ {
+ fwrite($fd,"$t_institut $i: \n");
+ }
+ else
+ {
+ fwrite($fd,"$t_institut: \n");
+ }
+ fwrite($fd,"");
+ fwrite($fd,"$inst[$i] \n");
+ fwrite($fd," \n \n");
+ }
+ //***************************************************************************************************************************************
+ //Änderung TW
+ //Studiengang, Seitenanzahl, Datum, AC-Nummer und Begutachter eingefügt
+ if ($studiengang != "" && $studiengang>0)
+ {
+ fwrite($fd,"");
+ fwrite($fd,"$t_fakultaet \n");
+ fwrite($fd,"");
+ fwrite($fd,"$publisher_faculty \n");
+ fwrite($fd," \n \n");
+ }
+ if ($ac_nr != "")
+ {
+ fwrite($fd,"");
+ $res = $opus->query("SELECT * FROM studiengang WHERE stg_nr ='$studiengang'");
+ $rrr = 'name_'.$la;
+ $mrow = $opus->fetch_object($res);
+ $name = $mrow->$rrr;
+ $typ = $mrow->typ;
+ fwrite($fd,"$t_studiengang \n");
+ fwrite($fd,"");
+ fwrite($fd,"$studiengang, $typ $name \n");
+ fwrite($fd," \n \n");
+ }
+ if ($seitenanzahl != "")
+ {
+ fwrite($fd,"");
+ fwrite($fd,"$t_acnr \n");
+ fwrite($fd,"");
+ fwrite($fd,"$ac_nr \n");
+ fwrite($fd," \n \n");
+ }
+ if ($datum != "" && $datum!=NULL)
+ {
+ fwrite($fd,"");
+ fwrite($fd,"$t_sanz \n");
+ fwrite($fd,"");
+ fwrite($fd,"$seitenanzahl \n");
+ fwrite($fd," \n \n");
+ }
+ if ($gutachter1 != "")
+ {
+ fwrite($fd,"");
+ fwrite($fd,"$t_datum \n");
+ fwrite($fd,"");
+ $datum=formatDatum($datum, 'd.m.Y');
+ fwrite($fd,$datum." \n");
+ fwrite($fd," \n \n");
+ }
+ if ($gutachter2 != "")
+ {
+ fwrite($fd,"");
+ fwrite($fd,"$t_gutachter1 \n");
+ fwrite($fd,"");
+ fwrite($fd,"$gutachter1 \n");
+ fwrite($fd," \n \n");
+ }
+ if ($studiensemester != 0 && $studiensemester != '')
+ {
+ fwrite($fd,"");
+ fwrite($fd,"$t_gutachter2 \n");
+ fwrite($fd,"");
+ fwrite($fd,"$gutachter2 \n");
+ fwrite($fd," \n \n");
+ }
+ //****************************************************************************************************************************************
+ if ($sachgruppe_ddc != "" && $sachgruppe_ddc != "no")
+ {
+ $res = $opus->query("SELECT sachgruppe FROM sachgruppe_ddc_$la where nr = '$sachgruppe_ddc'");
+ $num = $opus->num_rows($res);
+ if ($num > 0)
+ {
+ $mrow = $opus->fetch_row($res);
+ $sachgruppe_ddc = $mrow[0];
+ }
+ $opus->free_result($res);
+ fwrite($fd,"");
+ fwrite($fd,"$t_studiensemester \n");
+ fwrite($fd,"");
+ fwrite($fd,"$studiensemester \n");
+ fwrite($fd," \n \n");
+ }
+ if ($contributors_corporate != "")
+ {
+ fwrite($fd,"");
+ fwrite($fd,"$ddc_sachgruppe \n");
+ fwrite($fd,"");
+ fwrite($fd,"$sachgruppe_ddc \n");
+ fwrite($fd," \n \n");
+ }
+
+ fwrite($fd,"");
+ fwrite($fd,"$sonstige_institution \n");
+ fwrite($fd,"");
+ fwrite($fd,"$contributors_corporate \n");
+ fwrite($fd," \n \n");
+ /***** Schriftenreihe Start *****/
+ if ($sr_id != "" && $sr_band != "")
+ {
+ fwrite($fd,"");
+ fwrite($fd,"$t_dokumentart \n");
+ fwrite($fd,"");
+ fwrite($fd,"$dokumentart \n");
+ fwrite($fd," \n \n");
+ fwrite($fd,"");
+ fwrite($fd,"$t_schriftenreihe \n");
+ fwrite($fd,"");
+ fwrite($fd,"$sr_name \n");
+ fwrite($fd," \n \n");
+ }
+ /***** Schriftenreihe Stop *****/
+ if ($advisor != "")
+ {
+ fwrite($fd,"");
+ fwrite($fd,"$t_bandnr \n");
+ fwrite($fd,"");
+ fwrite($fd,"$sr_band \n");
+ fwrite($fd," \n \n");
+ }
+ if ($isbn != "")
+ {
+ fwrite($fd,"");
+ fwrite($fd,"$t_hauptberichter \n");
+ fwrite($fd,"");
+ fwrite($fd,"$advisor \n");
+ fwrite($fd," \n \n");
+ }
+ if ($issn != "")
+ {
+ fwrite($fd,"");
+ fwrite($fd,"$t_isbn \n");
+ fwrite($fd,"");
+ fwrite($fd,"$isbn \n");
+ fwrite($fd," \n \n");
+ }
+ fwrite($fd,"");
+ fwrite($fd,"$t_issn \n");
+ fwrite($fd,"");
+ fwrite($fd,"$issn \n");
+ fwrite($fd," \n \n");
+ if ($date_accepted != "")
+ {
+ fwrite($fd,"");
+ fwrite($fd,"$t_sprache \n");
+ fwrite($fd,"");
+ fwrite($fd,"$sprache \n");
+ fwrite($fd," \n \n");
+ }
+ fwrite($fd,"");
+ fwrite($fd,"$t_pruefung_muendlich \n");
+ fwrite($fd,"");
+ $date_accepted_format = strftime("%d.%m.%Y", $date_accepted);
+ fwrite($fd,"$date_accepted_format \n");
+ fwrite($fd," \n \n");
+ fwrite($fd,"");
+ fwrite($fd,"$t_erstellungsjahr \n");
+ fwrite($fd,"");
+ fwrite($fd,"$date_year \n");
+ fwrite($fd," \n \n");
+ if ($date_valid != 0)
+ {
+ fwrite($fd,"");
+ fwrite($fd,"$t_publikationsdatum \n");
+ fwrite($fd,"");
+ $date_creation_format = strftime("%d.%m.%Y", $date_creation);
+ fwrite($fd,"$date_creation_format \n");
+ fwrite($fd," \n \n");
+ }
+ if ($bem_extern != "")
+ {
+ fwrite($fd,"");
+ #fwrite($fd,"Gültig bis: \n");
+ fwrite($fd,"$text6 \n");
+ fwrite($fd,"");
+ $date_valid_format = strftime("%d.%m.%Y", $date_valid);
+ fwrite($fd,"$date_valid_format \n");
+ fwrite($fd," \n \n");
+ }
+ fwrite($fd,"");
+ fwrite($fd,"$t_bemerkung \n");
+ fwrite($fd,"");
+ fwrite($fd,"$bem_extern \n");
+ fwrite($fd," \n \n");
+ if ($description2 != "")
+ {
+ fwrite($fd,"");
+ fwrite($fd,"$text4 $sprache_description: \n");
+ fwrite($fd,"");
+ fwrite($fd,nl2br($description));
+ fwrite($fd," \n");
+ fwrite($fd," \n \n");
+ }
+ # Start Lizenzvertrag
+ if ($lic_active >= 2)
+ {
+ if ($licname != "")
+ {
+ fwrite($fd,"");
+ fwrite($fd,"$text4 $sprache_description2: \n");
+ fwrite($fd,"");
+ fwrite($fd,nl2br($description2));
+ fwrite($fd," \n");
+ fwrite($fd," \n \n");
+ }
+ }
+ fwrite($fd,"");
+ fwrite($fd,"$lizenz: \n");
+ fwrite($fd,"\n ");
+ if (strlen(trim($licdesc_html)) > 0)
+ {
+ fwrite($fd,"\n" . $licdesc_html . "\n");
+ }
+ $lic_uselogos = $opus->value("license_uselogos");
+ if (($lic_uselogos) AND (strlen($liclogo) > 0))
+ {
+ $liclogo_width = $opus->value("license_logo_width");
+ $liclogo_height = $opus->value("license_logo_height");
+ $liclogo_wh = "";
+ if ($liclogo_width)
+ {
+ $liclogo_wh.= " width=\"" . $liclogo_width . "\"";
+ }
+ if ($liclogo_height)
+ {
+ $liclogo_wh.= " height=\"" . $liclogo_height . "\"";
+ }
+ fwrite($fd,"\n");
+ fwrite($fd," \n");
+ fwrite($fd,"");
+ fwrite($fd," \n");
+ }
+ fwrite($fd,"\n");
+ fwrite($fd,"$licname \n
Quelle: ".$url_paa.$row_file->paabgabe_id.'_'.$row->student_uid.'.pdf'." -> ".$opus_url."".$row_file->paabgabe_id.'_'.$row->student_uid.'.pdf';
+ copy($url_paa.$row_file->paabgabe_id.'_'.$row->student_uid.'.pdf',$opus_url."/pdf/".$row_file->paabgabe_id.'_'.$row->student_uid.'.pdf');
//Überprüfen, ob Datei wirklich kopiert wurde
- if(is_file($opus_url.$row_file->paabgabe_id.'_'.$row->student_uid.'.pdf'))
+ if(is_file($opus_url."/pdf/".$row_file->paabgabe_id.'_'.$row->student_uid.'.pdf'))
{
//COMMIT durchführen
if(!$result=mysql_query('COMMIT',$conn_ext))
@@ -354,6 +1489,26 @@ if($erg=pg_query($conn, $qry))
mysql_query('ROLLBACK',$conn_ext);
echo "Commit nicht ausgef&um;hrt!
".$row_opus."/".$verfasser."
".mysql_errno($conn_ext) . ": " . mysql_error($conn_ext);
}
+ else
+ {
+ if (file_exists("$opus_url"))
+ {
+ $fd = fopen($opus_url."/index.html", 'w');
+ if ($fd == 0)
+ {
+ echo ("Error: $ERRMSG
\n");
+ exit;
+ }
+ else
+ {
+ indexdatei($row_opus, $fd);
+ fclose($fd);
+ #print ("Indexdatei zu Dokument $source_opus wurde in die Datei index.html geschrieben.
\n");
+ }
+ }
}
else
{