diff --git a/cis/private/tools/projektabgabe.php b/cis/private/tools/projektabgabe.php index 9580fcf38..06ec1e146 100644 --- a/cis/private/tools/projektabgabe.php +++ b/cis/private/tools/projektabgabe.php @@ -1,334 +1,333 @@ - - * Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at > - * Rudolf Hangl < rudolf.hangl@technikum-wien.at > - * Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at > - */ -/******************************************************************************************************* - * projektabgabe - * projektabgabe ermöglicht den Download aller Abgaben eines Stg. - * fuer Diplom- und Bachelorarbeiten - *******************************************************************************************************/ - -require_once('../../../config/cis.config.inc.php'); -require_once('../../../include/functions.inc.php'); -require_once('../../../include/studiengang.class.php'); -require_once('../../../include/datum.class.php'); -require_once('../../../include/benutzerberechtigung.class.php'); -require_once('../../../include/datum.class.php'); -require_once('../../../include/mail.class.php'); -require_once('../../../include/phrasen.class.php'); - -include('../../../include/meta/jquery.php'); -include('../../../include/meta/jquery-tablesorter.php'); - -$sprache = getSprache(); -$p = new phrasen($sprache); - -if (!$db = new basis_db()) - die($p->t('global/fehlerBeimOeffnenDerDatenbankverbindung')); - -$aktion=''; -if(isset($_REQUEST['aktion'])) -{ - $aktion=$_REQUEST['aktion']; -} -$zipfile=''; -$stg_kz=(isset($_REQUEST['stg_kz'])?$_REQUEST['stg_kz']:''); -if(!is_numeric($stg_kz) && $stg_kz!='') - exit(); - -$abgabetyp=(isset($_REQUEST['abgabetyp'])?$_REQUEST['abgabetyp']:''); -$termin=(isset($_REQUEST['termin'])?$_REQUEST['termin']:''); - -$htmlstr=''; -$datum_obj = new datum(); -$user = get_uid(); -$rechte = new benutzerberechtigung(); -$rechte->getBerechtigungen($user); -$berechtigung_kurzbz = 'lehre/abgabetool:download'; - -if(isset($_GET['id']) && isset($_GET['uid'])) -{ - if($rechte->isBerechtigt($berechtigung_kurzbz)) - { - if(!is_numeric($_GET['id']) || $_GET['id']=='') - die($p->t('global/fehlerBeiDerParameteruebergabe')); - - $file = $_GET['id'].'_'.$_GET['uid'].'.pdf'; - $filename = PAABGABE_PATH.$file; - header('Content-Type: application/octet-stream'); - header('Content-disposition: attachment; filename="'.$file.'"'); - readfile($filename); - } - else - { - die($p->t('global/keineBerechtigungFuerDieseSeite')); - } - exit(); -} - - -if($aktion!='zip') -{ - echo ' - - - '.$p->t('abgabetool/projektabgabeUebersicht').' - - - - - - - - - - -

'.$p->t('abgabetool/projektabgabeUebersicht').'

'; - - $s = new studiengang(); - $s->loadArray($rechte->getStgKz($berechtigung_kurzbz),'typ,kurzbz'); - - echo'
'; - - echo $p->t('global/studiengang').": "; - - - echo $p->t('abgabetool/abgabetyp').": "; - - $qry_termin=" SELECT distinct campus.tbl_paabgabe.datum as termin , to_char(campus.tbl_paabgabe.datum, 'DD.MM.YYYY') as termin_anzeige - FROM lehre.tbl_projektarbeit - JOIN campus.tbl_paabgabe USING(projektarbeit_id) - LEFT JOIN public.tbl_benutzer ON(uid=student_uid) - LEFT JOIN public.tbl_person ON(tbl_benutzer.person_id=tbl_person.person_id) - LEFT JOIN lehre.tbl_lehreinheit USING(lehreinheit_id) - LEFT JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id) - LEFT JOIN public.tbl_studiengang USING(studiengang_kz) - WHERE (projekttyp_kurzbz='Bachelor' OR projekttyp_kurzbz='Diplom') - "; - - if ($stg_kz!='') - $qry_termin.=" AND public.tbl_studiengang.studiengang_kz=".$db->db_add_param($stg_kz, FHC_INTEGER); - if ($abgabetyp!='') - $qry_termin.=" AND campus.tbl_paabgabe.paabgabetyp_kurzbz=".$db->db_add_param($abgabetyp); - $qry_termin.=" ORDER BY termin desc"; - - echo ' '.$p->t('abgabetool/termin').' '; - - ?> - -t('global/anzeigen')."' onclick=\"f=document.abgabeFrm;f.aktion.value='';\"> 

"; - } - -if(isset($_REQUEST['ok']) || (isset($_REQUEST['aktion']) && $_REQUEST['aktion']=='zip')) -{ - - $s=new studiengang(); - if($stg_kz!='' && !$s->load($stg_kz)) - { - die($p->t('global/studiengangKonnteNichtGefundenWerden')); - } - - if($rechte->isBerechtigt('admin') || $rechte->isBerechtigt($berechtigung_kurzbz, $s->oe_kurzbz)) - { - $qry=""; - - $qry.=" SELECT public.tbl_studiengang.bezeichnung as stgbez, campus.tbl_paabgabe.datum as termin,* - FROM lehre.tbl_projektarbeit - JOIN campus.tbl_paabgabe USING(projektarbeit_id) - LEFT JOIN public.tbl_benutzer ON(uid=student_uid) - LEFT JOIN public.tbl_person ON(tbl_benutzer.person_id=tbl_person.person_id) - LEFT JOIN lehre.tbl_lehreinheit USING(lehreinheit_id) - LEFT JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id) - LEFT JOIN public.tbl_studiengang USING(studiengang_kz) - WHERE (projekttyp_kurzbz='Bachelor' OR projekttyp_kurzbz='Diplom') - - "; - - if ($stg_kz!='') - $qry.=" AND public.tbl_studiengang.studiengang_kz=".$db->db_add_param($stg_kz); - if ($abgabetyp!='') - $qry.=" AND campus.tbl_paabgabe.paabgabetyp_kurzbz=".$db->db_add_param($abgabetyp); - if ($termin!='') - $qry.=" AND campus.tbl_paabgabe.datum=".$db->db_add_param($termin); - $qry.=" ORDER BY nachname "; - - if($stg_kz=='' && $abgabetyp=='' && $termin=='') - { - $qry.=" limit 100 "; - } - - if(!$erg=$db->db_query($qry)) - { - die('Fehler beim Laden der Betreuungen!'); - } - else - { - $htmlstr .= "\n"; - $htmlstr .= "\n"; - $htmlstr .= " - - - - - "; - $htmlstr .= " - "; - $htmlstr .= "\n"; - $i = 0; - while($row=$db->db_fetch_object($erg)) - { - $htmlstr .= ""; - if(file_exists(PAABGABE_PATH.$row->paabgabe_id.'_'.$row->uid.'.pdf')) - { - $htmlstr .= " "; - } - else - { - $htmlstr .= " "; - } - //$htmlstr .= ""; - $htmlstr .= ""; - $htmlstr .= ""; - $htmlstr .= ""; - $htmlstr .= "\n"; - $htmlstr .= "\n"; - $htmlstr .= "\n"; - $htmlstr .= "\n"; - if($aktion=='zip') - { - if($zipfile=='') - { - $zipfile = $row->paabgabe_id.'_'.$row->uid.'.pdf'; - } - else - { - $zipfile .= " ".$row->paabgabe_id.'_'.$row->uid.'.pdf'; - } - } - } - $htmlstr .= "
".$p->t('global/download')."".$p->t('abgabetool/termin')."".$p->t('abgabetool/abgabetyp')."".$p->t('global/uid')."".$p->t('global/vorname')."".$p->t('global/nachname')."".$p->t('abgabetool/typ')."".$p->t('abgabetool/titel')."
uid' target='_blank'>PDF    link".$datum_obj->formatDatum($row->termin,'d.m.Y')."".$abgabetyp." ".$row->uid." ".$row->vorname." ".$row->nachname." ".$row->projekttyp_kurzbz." ".$row->titel." 
"; - } - } - else - { - die($p->t('global/keineBerechtigungFuerDieseSeite')); - } -} - -if($zipfile=='') -{ - echo $htmlstr; - echo ""; -} -else -{ - if(!$rechte->isBerechtigt($berechtigung_kurzbz)) - { - die($p->t('global/keineBerechtigungFuerDieseSeite')); - } - - //Zip File erstellen - chdir(PAABGABE_PATH); - $zipausgabe=tempnam("/tmp", "PAA").".zip"; - exec("zip ".$zipausgabe." ".$zipfile); - - if(file_exists($zipausgabe)) - { - header('Content-Type: application/octet-stream'); - header('Content-disposition: attachment; filename="Abgabe_'.$s->kuerzel.'.zip"'); - $handle = fopen($zipausgabe, "rb"); - - while (!feof($handle)) - { - echo fread($handle, 1024); - } - - fclose($handle); - - //echo file_get_contents($zipausgabe); - unlink($zipausgabe); - } - else - { - echo $p->t('global/dateiExistiertNicht'); - } -} -?> + + * Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at > + * Rudolf Hangl < rudolf.hangl@technikum-wien.at > + * Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at > + */ +/******************************************************************************************************* + * projektabgabe + * projektabgabe ermöglicht den Download aller Abgaben eines Stg. + * fuer Diplom- und Bachelorarbeiten + *******************************************************************************************************/ + +require_once('../../../config/cis.config.inc.php'); +require_once('../../../include/functions.inc.php'); +require_once('../../../include/studiengang.class.php'); +require_once('../../../include/datum.class.php'); +require_once('../../../include/benutzerberechtigung.class.php'); +require_once('../../../include/datum.class.php'); +require_once('../../../include/mail.class.php'); +require_once('../../../include/phrasen.class.php'); + +$sprache = getSprache(); +$p = new phrasen($sprache); + +if (!$db = new basis_db()) + die($p->t('global/fehlerBeimOeffnenDerDatenbankverbindung')); + +$aktion=''; +if(isset($_REQUEST['aktion'])) +{ + $aktion=$_REQUEST['aktion']; +} +$zipfile=''; +$stg_kz=(isset($_REQUEST['stg_kz'])?$_REQUEST['stg_kz']:''); +if(!is_numeric($stg_kz) && $stg_kz!='') + exit(); + +$abgabetyp=(isset($_REQUEST['abgabetyp'])?$_REQUEST['abgabetyp']:''); +$termin=(isset($_REQUEST['termin'])?$_REQUEST['termin']:''); + +$htmlstr=''; +$datum_obj = new datum(); +$user = get_uid(); +$rechte = new benutzerberechtigung(); +$rechte->getBerechtigungen($user); +$berechtigung_kurzbz = 'lehre/abgabetool:download'; + +if(isset($_GET['id']) && isset($_GET['uid'])) +{ + if($rechte->isBerechtigt($berechtigung_kurzbz)) + { + if(!is_numeric($_GET['id']) || $_GET['id']=='') + die($p->t('global/fehlerBeiDerParameteruebergabe')); + + $file = $_GET['id'].'_'.$_GET['uid'].'.pdf'; + $filename = PAABGABE_PATH.$file; + header('Content-Type: application/octet-stream'); + header('Content-disposition: attachment; filename="'.$file.'"'); + readfile($filename); + } + else + { + die($p->t('global/keineBerechtigungFuerDieseSeite')); + } + exit(); +} + + +if($aktion!='zip') +{ + echo ' + + + '.$p->t('abgabetool/projektabgabeUebersicht').' + + + + + + '; + include('../../../include/meta/jquery.php'); + include('../../../include/meta/jquery-tablesorter.php'); + echo ' + + + +

'.$p->t('abgabetool/projektabgabeUebersicht').'

'; + + $s = new studiengang(); + $s->loadArray($rechte->getStgKz($berechtigung_kurzbz),'typ,kurzbz'); + + echo'
'; + + echo $p->t('global/studiengang').": "; + + + echo $p->t('abgabetool/abgabetyp').": "; + + $qry_termin=" SELECT distinct campus.tbl_paabgabe.datum as termin , to_char(campus.tbl_paabgabe.datum, 'DD.MM.YYYY') as termin_anzeige + FROM lehre.tbl_projektarbeit + JOIN campus.tbl_paabgabe USING(projektarbeit_id) + LEFT JOIN public.tbl_benutzer ON(uid=student_uid) + LEFT JOIN public.tbl_person ON(tbl_benutzer.person_id=tbl_person.person_id) + LEFT JOIN lehre.tbl_lehreinheit USING(lehreinheit_id) + LEFT JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id) + LEFT JOIN public.tbl_studiengang USING(studiengang_kz) + WHERE (projekttyp_kurzbz='Bachelor' OR projekttyp_kurzbz='Diplom') + "; + + if ($stg_kz!='') + $qry_termin.=" AND public.tbl_studiengang.studiengang_kz=".$db->db_add_param($stg_kz, FHC_INTEGER); + if ($abgabetyp!='') + $qry_termin.=" AND campus.tbl_paabgabe.paabgabetyp_kurzbz=".$db->db_add_param($abgabetyp); + $qry_termin.=" ORDER BY termin desc"; + + echo ' '.$p->t('abgabetool/termin').' '; + + ?> + +t('global/anzeigen')."' onclick=\"f=document.abgabeFrm;f.aktion.value='';\"> 

"; + } + +if(isset($_REQUEST['ok']) || (isset($_REQUEST['aktion']) && $_REQUEST['aktion']=='zip')) +{ + + $s=new studiengang(); + if($stg_kz!='' && !$s->load($stg_kz)) + { + die($p->t('global/studiengangKonnteNichtGefundenWerden')); + } + + if($rechte->isBerechtigt('admin') || $rechte->isBerechtigt($berechtigung_kurzbz, $s->oe_kurzbz)) + { + $qry=""; + + $qry.=" SELECT public.tbl_studiengang.bezeichnung as stgbez, campus.tbl_paabgabe.datum as termin,* + FROM lehre.tbl_projektarbeit + JOIN campus.tbl_paabgabe USING(projektarbeit_id) + LEFT JOIN public.tbl_benutzer ON(uid=student_uid) + LEFT JOIN public.tbl_person ON(tbl_benutzer.person_id=tbl_person.person_id) + LEFT JOIN lehre.tbl_lehreinheit USING(lehreinheit_id) + LEFT JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id) + LEFT JOIN public.tbl_studiengang USING(studiengang_kz) + WHERE (projekttyp_kurzbz='Bachelor' OR projekttyp_kurzbz='Diplom') + + "; + + if ($stg_kz!='') + $qry.=" AND public.tbl_studiengang.studiengang_kz=".$db->db_add_param($stg_kz); + if ($abgabetyp!='') + $qry.=" AND campus.tbl_paabgabe.paabgabetyp_kurzbz=".$db->db_add_param($abgabetyp); + if ($termin!='') + $qry.=" AND campus.tbl_paabgabe.datum=".$db->db_add_param($termin); + $qry.=" ORDER BY nachname "; + + if($stg_kz=='' && $abgabetyp=='' && $termin=='') + { + $qry.=" limit 100 "; + } + + if(!$erg=$db->db_query($qry)) + { + die('Fehler beim Laden der Betreuungen!'); + } + else + { + $htmlstr .= "\n"; + $htmlstr .= "\n"; + $htmlstr .= " + + + + + "; + $htmlstr .= " + "; + $htmlstr .= "\n"; + $i = 0; + while($row=$db->db_fetch_object($erg)) + { + $htmlstr .= ""; + if(file_exists(PAABGABE_PATH.$row->paabgabe_id.'_'.$row->uid.'.pdf')) + { + $htmlstr .= " "; + } + else + { + $htmlstr .= " "; + } + //$htmlstr .= ""; + $htmlstr .= ""; + $htmlstr .= ""; + $htmlstr .= ""; + $htmlstr .= "\n"; + $htmlstr .= "\n"; + $htmlstr .= "\n"; + $htmlstr .= "\n"; + if($aktion=='zip') + { + if($zipfile=='') + { + $zipfile = $row->paabgabe_id.'_'.$row->uid.'.pdf'; + } + else + { + $zipfile .= " ".$row->paabgabe_id.'_'.$row->uid.'.pdf'; + } + } + } + $htmlstr .= "
".$p->t('global/download')."".$p->t('abgabetool/termin')."".$p->t('abgabetool/abgabetyp')."".$p->t('global/uid')."".$p->t('global/vorname')."".$p->t('global/nachname')."".$p->t('abgabetool/typ')."".$p->t('abgabetool/titel')."
uid' target='_blank'>PDF    link".$datum_obj->formatDatum($row->termin,'d.m.Y')."".$abgabetyp." ".$row->uid." ".$row->vorname." ".$row->nachname." ".$row->projekttyp_kurzbz." ".$row->titel." 
"; + } + } + else + { + die($p->t('global/keineBerechtigungFuerDieseSeite')); + } +} + +if($zipfile=='') +{ + echo $htmlstr; + echo ""; +} +else +{ + if(!$rechte->isBerechtigt($berechtigung_kurzbz)) + { + die($p->t('global/keineBerechtigungFuerDieseSeite')); + } + + //Zip File erstellen + chdir(PAABGABE_PATH); + $zipausgabe=tempnam("/tmp", "PAA").".zip"; + exec("zip ".$zipausgabe." ".$zipfile); + + if(file_exists($zipausgabe)) + { + header('Content-Type: application/octet-stream'); + header('Content-disposition: attachment; filename="Abgabe_'.$s->kuerzel.'.zip"'); + $handle = fopen($zipausgabe, "rb"); + + while (!feof($handle)) + { + echo fread($handle, 1024); + } + + fclose($handle); + + //echo file_get_contents($zipausgabe); + unlink($zipausgabe); + } + else + { + echo $p->t('global/dateiExistiertNicht'); + } +} +?> diff --git a/content/lvplanung/lehrveranstaltungdetailoverlay.xul.php b/content/lvplanung/lehrveranstaltungdetailoverlay.xul.php index 0efbfae2c..e18407e72 100644 --- a/content/lvplanung/lehrveranstaltungdetailoverlay.xul.php +++ b/content/lvplanung/lehrveranstaltungdetailoverlay.xul.php @@ -481,9 +481,9 @@ $p = new phrasen($sprache); - diff --git a/content/lvplanung/lehrveranstaltungoverlay.xul.php b/content/lvplanung/lehrveranstaltungoverlay.xul.php index a43b5ca33..cbe9b89ec 100644 --- a/content/lvplanung/lehrveranstaltungoverlay.xul.php +++ b/content/lvplanung/lehrveranstaltungoverlay.xul.php @@ -59,7 +59,7 @@ echo ' - +