From ab59c265d46a2373f6a54abd62924b2ae9b5195c Mon Sep 17 00:00:00 2001 From: Paolo Date: Mon, 4 Oct 2021 14:05:10 +0200 Subject: [PATCH 001/279] First commit --- include/Docsbox.php | 112 ++++++++++++++++++++++++++++++ include/dokument_export.class.php | 71 +++++++++---------- 2 files changed, 148 insertions(+), 35 deletions(-) create mode 100644 include/Docsbox.php diff --git a/include/Docsbox.php b/include/Docsbox.php new file mode 100644 index 000000000..08b04f71b --- /dev/null +++ b/include/Docsbox.php @@ -0,0 +1,112 @@ +attach(array('file' => $inputFileName)) + ->expectsJson() + ->send(); + + var_dump($response);exit; + } + catch(\Httpful\Exception\ConnectionErrorException $cee) + { + // Error + } + catch (Exception $e) + { + // Error + } + + if (is_object($response) && isset($response->id) && isset($response->status)) + { + $status = null; + $result_url = null; + + while ($status == null) + { + try + { + $response = \Httpful\Request::get('http://docconverter.technikum-wien.at/api/v1/'.$response->id) + ->expectsJson() + ->send(); + + var_dump($response); + } + catch(\Httpful\Exception\ConnectionErrorException $cee) + { + // Error + } + catch (Exception $e) + { + // Error + } + + if (is_object($response) && isset($response->id) && isset($response->status)) + { + if ($response->status == 'finished' && isset($response->result_url)) + { + $status = $response->status; + $result_url = $response->result_url; + } + else + { + // Error + } + } + else + { + // Error + } + } + + try + { + $response = \Httpful\Request::get($result_url)->send(); + + var_dump($response); + } + catch(\Httpful\Exception\ConnectionErrorException $cee) + { + // Error + } + catch (Exception $e) + { + // Error + } + + var_dump($response);exit; + } + else + { + // Error + } + } +} + diff --git a/include/dokument_export.class.php b/include/dokument_export.class.php index 4f23a7dcd..30af55ac6 100644 --- a/include/dokument_export.class.php +++ b/include/dokument_export.class.php @@ -37,7 +37,6 @@ class dokument_export private $images=array(); private $sourceDir; public $errormsg; - private $unoconv_version; private $sign; private $sign_user; private $sign_profile; @@ -50,18 +49,6 @@ class dokument_export if(!isset($vorlage)) return; - exec('unoconv --version',$ret_arr); - if(isset($ret_arr[0])) - { - $hlp = explode(' ',$ret_arr[0]); - if(isset($hlp[1])) - $this->unoconv_version = $hlp[1]; - else - die('Could not get Unoconv Version'); - } - else - die('Unoconv not found'); - //Vorlage aus der Datenbank holen $this->vorlage = new vorlage(); if(!$this->vorlage->getAktuelleVorlage($oe_kurzbz, $vorlage, $version)) @@ -281,20 +268,27 @@ class dokument_export // Unoconv Version 0.6 hat eine Bug wodurch die Berechtigungen des PDF/Doc nicht korrekt gesetzt // werden. Deshalb wird dies hier speziell behandelt. // Die 2. Variante hat den Vorteil dass hier eine bessere Fehlerbehandlung moeglich ist - if($this->unoconv_version=='0.6') - $command = 'unoconv -e IsSkipEmptyPages=false -f ' . $this->outputformat . ' %2$s > %1$s'; - else - $command = 'unoconv -e IsSkipEmptyPages=false -f ' . $this->outputformat . ' --output %s %s 2>&1'; + //if($this->unoconv_version=='0.6') + // $command = 'unoconv -e IsSkipEmptyPages=false -f ' . $this->outputformat . ' %2$s > %1$s'; + //else + // $command = 'unoconv -e IsSkipEmptyPages=false -f ' . $this->outputformat . ' --output %s %s 2>&1'; - $command = sprintf($command, $this->temp_filename, $tempname_zip); + //$command = sprintf($command, $this->temp_filename, $tempname_zip); - exec($command, $out, $ret); + //exec($command, $out, $ret); - if($ret!=0) - { - $this->errormsg = 'Dokumentenkonvertierung ist derzeit nicht möglich. Bitte versuchen Sie es in einer Minute erneut oder kontaktieren Sie einen Administrator'; - return false; - } + require_once('Docsbox.php'); + + var_dump($tempname_zip); + var_dump($this->temp_filename); + + Docsbox::convert($tempname_zip, $this->temp_filename); + + //if($ret!=0) + //{ + // $this->errormsg = 'Dokumentenkonvertierung ist derzeit nicht möglich. Bitte versuchen Sie es in einer Minute erneut oder kontaktieren Sie einen Administrator'; + // return false; + //} break; case 'odt': default: @@ -455,19 +449,26 @@ class dokument_export */ public function convert($inFile, $outFile, $format = "pdf") { - if($this->unoconv_version=='0.6') - $command = 'unoconv -f %1$s %3$s > %2$s'; - else - $command = 'unoconv -f %s --output %s %s 2>&1'; - $command = sprintf($command, $format, $outFile, $inFile); + //require_once('Docsbox.php'); - exec($command, $out, $ret); + //var_dump($inFile); + //var_dump($outFile); - if($ret!=0) - { - $this->errormsg = 'Dokumentenkonvertierung ist derzeit nicht möglich. Bitte versuchen Sie es in einer Minute erneut oder kontaktieren Sie einen Administrator'; - return false; - } + //Docsbox::convert(); + + //if($this->unoconv_version=='0.6') + // $command = 'unoconv -f %1$s %3$s > %2$s'; + //else + // $command = 'unoconv -f %s --output %s %s 2>&1'; + //$command = sprintf($command, $format, $outFile, $inFile); + + //exec($command, $out, $ret); + + //if($ret!=0) + //{ + // $this->errormsg = 'Dokumentenkonvertierung ist derzeit nicht möglich. Bitte versuchen Sie es in einer Minute erneut oder kontaktieren Sie einen Administrator'; + // return false; + //} return true; } From 2fb4be0e5548b662085b56a4eedbfc0d5622d153 Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 14 Oct 2021 11:34:27 +0200 Subject: [PATCH 002/279] - Added new config entry DOCSBOX_ENABLED to config/global.config-default.inc.php - Added new library application/libraries/DocsboxLib.php to manage document conversion using docsbox - Added new config file application/config/docsbox.php - Integrated DocsboxLib into include/dokument_export.class.php --- application/config/docsbox.php | 7 + application/libraries/DocsboxLib.php | 297 +++++++++++++++++++++++++++ config/global.config-default.inc.php | 3 + include/Docsbox.php | 112 ---------- include/dokument_export.class.php | 101 +++++---- 5 files changed, 372 insertions(+), 148 deletions(-) create mode 100644 application/config/docsbox.php create mode 100644 application/libraries/DocsboxLib.php delete mode 100644 include/Docsbox.php diff --git a/application/config/docsbox.php b/application/config/docsbox.php new file mode 100644 index 000000000..ca64698f9 --- /dev/null +++ b/application/config/docsbox.php @@ -0,0 +1,7 @@ +attach(array('file' => $inputFileName)) + ->expectsJson() + ->send(); + + // Checks that: + // - the response is not empty + // - the reponse body has the property id + // - the property id is a valid string + // - the reponse body has the property status + // - docsbox queued the conversion of the posted file + if (is_object($postFileResponse) + && isset($postFileResponse->body) + && isset($postFileResponse->body->id) + && $postFileResponse->body->id != '' && $postFileResponse->body->id != null + && isset($postFileResponse->body->status) + && $postFileResponse->body->status == self::STATUS_QUEUED) + { + $queueId = $postFileResponse->body->id; + } + else + { + // If docsbox refused to convert the posted file + if (isset($postFileResponse->body->status) + && $postFileResponse->body->status != self::STATUS_QUEUED) + { + error_log( + 'Docsbox did not queue the posted file. Returned status: '. + $postFileResponse->body->status + ); + } + else // any other generic error + { + error_log( + 'An error occurred while posting to docsbox. Response: '. + print_r($postFileResponse, 1) + ); + } + } + } + catch(\Httpful\Exception\ConnectionErrorException $cee) // Httpful exception + { + error_log($cee->getMessage()); + } + catch (Exception $e) // any other exception + { + error_log($e->getMessage()); + } + + return $queueId; + } + + /** + * Check the status of the file convertion identified by the given queue element id + * A URL is returned with the path where it is possible to download the converted file + * If an error occurred then a null value is returned + */ + private static function _checkConvertion($queueId) + { + $resultUrl = null; + $startConvertionsTime = time(); // time when the file conversion has started + + // Until a timeout has occurred + while (time() - $startConvertionsTime <= DOCSBOX_CONVERSION_TIMEOUT) + { + sleep(DOCSBOX_WAITING_SLEEP_TIME); // takes a nap on every round + + try + { + // Calls the docsbox server to check the status of the + // file conversion using the provided queue id + // it expects a response in JSON format + $getStatusResponse = \Httpful\Request::get(DOCSBOX_SERVER.DOCSBOX_PATH_API.$queueId) + ->expectsJson() + ->send(); + + // Checks that: + // - the response is not empty + // - the reponse body has the property id + // - the property id is a valid string + // - the reponse body has the property status + // - docsbox is working the conversion of the posted file + if (is_object($getStatusResponse) + && isset($getStatusResponse->body->id) + && $getStatusResponse->body->id != '' && $getStatusResponse->body->id != null + && isset($getStatusResponse->body->status)) + { + // Checks that docsbox has finished working on the file conversion + // and that there is a valid resultUrl property + if ($getStatusResponse->body->status == self::STATUS_FINISHED + && isset($getStatusResponse->body->result_url) + && $getStatusResponse->body->result_url != '' + && $getStatusResponse->body->result_url != null) + { + $resultUrl = $getStatusResponse->body->result_url; + break; + } + // Just started or still working on it + elseif ($getStatusResponse->body->status == self::STATUS_WORKING + || $getStatusResponse->body->status == self::STATUS_STARTED) + { + // go on! + } + else // any other status is abnormal + { + error_log( + 'Not valid status for queue element: '.$queueId.'. Response: '. + print_r($getStatusResponse, 1) + ); + break; // interrupt the loop on error + } + } + else // if the response from the docsbox server is not valid + { + error_log( + 'An error occurred while checking the docsbox activity. Response: '. + print_r($getStatusResponse, 1) + ); + break; // interrupt the loop on error + } + } + catch(\Httpful\Exception\ConnectionErrorException $cee) // Httpful exception + { + error_log($cee->getMessage()); + break; // interrupt the loop on error + } + catch (Exception $e) // any other exception + { + error_log($e->getMessage()); + break; // interrupt the loop on error + } + } + + return $resultUrl; + } + + /** + * Download the converted file using the provided URL, unzip it, and renames it into the provided file name + */ + private static function _downloadFile($resultUrl, $outputFileName) + { + $downloaded = false; // pessimistic assumption + + try + { + // Download the file + $getFileResponse = \Httpful\Request::get(DOCSBOX_SERVER.$resultUrl)->send(); + + // If the downloaded file content is valid and not empty + if (isset($getFileResponse->body) + && $getFileResponse->body != null + && $getFileResponse->body != '') + { + // Output directory where to unzip the downloaded zip file + $outputDirectory = dirname($outputFileName); + // The path and name of the downloaded zip file + $temporaryDownloadedZip = sys_get_temp_dir().'/'.basename($resultUrl); + + // Write the file content into a temporary directory and file + if (file_put_contents($temporaryDownloadedZip, $getFileResponse->body) != false) + { + $zipArchive = new ZipArchive; + + // Open and extract the dowloaded zip file into the directory of the output file + if ($zipArchive->open($temporaryDownloadedZip) === true + && $zipArchive->extractTo($outputDirectory) === true + && $zipArchive->close() === true) + { + // Opened, extracted and closed! + + // Rename the extracted file to the given output file name + if (rename($outputDirectory.'/'.self::OUTPUT_FILENAME, $outputFileName)) + { + $downloaded = true; + } + else + { + error_log( + 'An error occurred while renaming the extracted file: '. + $outputDirectory.'/'.self::OUTPUT_FILENAME.' into: '. + $outputFileName + ); + } + } + else + { + error_log( + 'An error occurred while working the dowloaded zip file: '. + $temporaryDownloadedZip + ); + } + } + else // if an error occurred while writing + { + error_log( + 'An error occurred while writing the file content to: '. + $temporaryDownloadedZip + ); + } + } + else // if the downloaded file is not valid + { + error_log( + 'An error occurred while downloading the file from the docsbox server: '. + print_r($getFileResponse, 1) + ); + } + } + catch(\Httpful\Exception\ConnectionErrorException $cee) + { + error_log($cee->getMessage()); + } + catch (Exception $e) + { + error_log($e->getMessage()); + } + + return $downloaded; + } +} + diff --git a/config/global.config-default.inc.php b/config/global.config-default.inc.php index b31447994..f4909ba5c 100644 --- a/config/global.config-default.inc.php +++ b/config/global.config-default.inc.php @@ -310,4 +310,7 @@ define ('ZAHLUNGSBESTAETIGUNG_ANZEIGEN_FUER_LEHRGAENGE', true); // Gibt an, ob im CIS die Zahlungsreferenz angezeigt wird define ('ZAHLUNGSBESTAETIGUNG_ZAHLUNGSREFERENZ_ANZEIGEN', false); + +define('DOCSBOX_ENABLED', false); + ?> diff --git a/include/Docsbox.php b/include/Docsbox.php deleted file mode 100644 index 08b04f71b..000000000 --- a/include/Docsbox.php +++ /dev/null @@ -1,112 +0,0 @@ -attach(array('file' => $inputFileName)) - ->expectsJson() - ->send(); - - var_dump($response);exit; - } - catch(\Httpful\Exception\ConnectionErrorException $cee) - { - // Error - } - catch (Exception $e) - { - // Error - } - - if (is_object($response) && isset($response->id) && isset($response->status)) - { - $status = null; - $result_url = null; - - while ($status == null) - { - try - { - $response = \Httpful\Request::get('http://docconverter.technikum-wien.at/api/v1/'.$response->id) - ->expectsJson() - ->send(); - - var_dump($response); - } - catch(\Httpful\Exception\ConnectionErrorException $cee) - { - // Error - } - catch (Exception $e) - { - // Error - } - - if (is_object($response) && isset($response->id) && isset($response->status)) - { - if ($response->status == 'finished' && isset($response->result_url)) - { - $status = $response->status; - $result_url = $response->result_url; - } - else - { - // Error - } - } - else - { - // Error - } - } - - try - { - $response = \Httpful\Request::get($result_url)->send(); - - var_dump($response); - } - catch(\Httpful\Exception\ConnectionErrorException $cee) - { - // Error - } - catch (Exception $e) - { - // Error - } - - var_dump($response);exit; - } - else - { - // Error - } - } -} - diff --git a/include/dokument_export.class.php b/include/dokument_export.class.php index 30af55ac6..c6c609ce9 100644 --- a/include/dokument_export.class.php +++ b/include/dokument_export.class.php @@ -37,6 +37,7 @@ class dokument_export private $images=array(); private $sourceDir; public $errormsg; + private $unoconv_version; private $sign; private $sign_user; private $sign_profile; @@ -49,6 +50,25 @@ class dokument_export if(!isset($vorlage)) return; + if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true) + { + // Use docsbox!! + } + else + { + exec('unoconv --version',$ret_arr); + if(isset($ret_arr[0])) + { + $hlp = explode(' ',$ret_arr[0]); + if(isset($hlp[1])) + $this->unoconv_version = $hlp[1]; + else + die('Could not get Unoconv Version'); + } + else + die('Unoconv not found'); + } + //Vorlage aus der Datenbank holen $this->vorlage = new vorlage(); if(!$this->vorlage->getAktuelleVorlage($oe_kurzbz, $vorlage, $version)) @@ -263,32 +283,36 @@ class dokument_export { case 'pdf': case 'doc': + $ret = 0; $this->temp_filename = $this->temp_folder . '/out.' . $this->outputformat; - // Unoconv Version 0.6 hat eine Bug wodurch die Berechtigungen des PDF/Doc nicht korrekt gesetzt - // werden. Deshalb wird dies hier speziell behandelt. - // Die 2. Variante hat den Vorteil dass hier eine bessere Fehlerbehandlung moeglich ist - //if($this->unoconv_version=='0.6') - // $command = 'unoconv -e IsSkipEmptyPages=false -f ' . $this->outputformat . ' %2$s > %1$s'; - //else - // $command = 'unoconv -e IsSkipEmptyPages=false -f ' . $this->outputformat . ' --output %s %s 2>&1'; + // If it is set to use docsbox + if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true) + { + require_once(dirname(__FILE__).'/../application/libraries/DocsboxLib.php'); - //$command = sprintf($command, $this->temp_filename, $tempname_zip); + $ret = DocsboxLib::convert($tempname_zip, $this->temp_filename); + } + else // otherwise use unoconv + { + // Unoconv Version 0.6 hat eine Bug wodurch die Berechtigungen des PDF/Doc nicht korrekt gesetzt + // werden. Deshalb wird dies hier speziell behandelt. + // Die 2. Variante hat den Vorteil dass hier eine bessere Fehlerbehandlung moeglich ist + if ($this->unoconv_version == '0.6') + $command = 'unoconv -e IsSkipEmptyPages=false -f ' . $this->outputformat . ' %2$s > %1$s'; + else + $command = 'unoconv -e IsSkipEmptyPages=false -f ' . $this->outputformat . ' --output %s %s 2>&1'; - //exec($command, $out, $ret); + $command = sprintf($command, $this->temp_filename, $tempname_zip); - require_once('Docsbox.php'); + exec($command, $out, $ret); + } - var_dump($tempname_zip); - var_dump($this->temp_filename); - - Docsbox::convert($tempname_zip, $this->temp_filename); - - //if($ret!=0) - //{ - // $this->errormsg = 'Dokumentenkonvertierung ist derzeit nicht möglich. Bitte versuchen Sie es in einer Minute erneut oder kontaktieren Sie einen Administrator'; - // return false; - //} + if ($ret != 0) + { + $this->errormsg = 'Dokumentenkonvertierung ist derzeit nicht möglich. Bitte versuchen Sie es in einer Minute erneut oder kontaktieren Sie einen Administrator'; + return false; + } break; case 'odt': default: @@ -449,26 +473,31 @@ class dokument_export */ public function convert($inFile, $outFile, $format = "pdf") { - //require_once('Docsbox.php'); + $ret = 0; - //var_dump($inFile); - //var_dump($outFile); + // If it is set to use DOCSBOX + if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true) + { + require_once(dirname(__FILE__).'/../application/libraries/DocsboxLib.php'); - //Docsbox::convert(); + $ret = DocsboxLib::convert($inFile, $outFile); + } + else // fallback to unoconv + { + if($this->unoconv_version=='0.6') + $command = 'unoconv -f %1$s %3$s > %2$s'; + else + $command = 'unoconv -f %s --output %s %s 2>&1'; + $command = sprintf($command, $format, $outFile, $inFile); - //if($this->unoconv_version=='0.6') - // $command = 'unoconv -f %1$s %3$s > %2$s'; - //else - // $command = 'unoconv -f %s --output %s %s 2>&1'; - //$command = sprintf($command, $format, $outFile, $inFile); + exec($command, $out, $ret); + } - //exec($command, $out, $ret); - - //if($ret!=0) - //{ - // $this->errormsg = 'Dokumentenkonvertierung ist derzeit nicht möglich. Bitte versuchen Sie es in einer Minute erneut oder kontaktieren Sie einen Administrator'; - // return false; - //} + if ($ret != 0) + { + $this->errormsg = 'Dokumentenkonvertierung ist derzeit nicht möglich. Bitte versuchen Sie es in einer Minute erneut oder kontaktieren Sie einen Administrator'; + return false; + } return true; } From 6f14b5cec599f881a75d35c85ce9c6079c24009d Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 14 Oct 2021 14:25:35 +0200 Subject: [PATCH 003/279] - Changed DocsboxLib->convert, not it accepts a new optional parameter called format - Integrated the DocsboxLib into the application/libraries/DocumentLib.php --- application/libraries/DocsboxLib.php | 3 +- application/libraries/DocumentLib.php | 66 +++++++++++++++++++-------- 2 files changed, 48 insertions(+), 21 deletions(-) diff --git a/application/libraries/DocsboxLib.php b/application/libraries/DocsboxLib.php index 2b0715513..ce43f1bc5 100644 --- a/application/libraries/DocsboxLib.php +++ b/application/libraries/DocsboxLib.php @@ -39,8 +39,9 @@ class DocsboxLib /** * Static method used to convert a document using a Docsbox installation (local/remote) over the network * It return 0 on success and any other integer on error + * NOTE: currently format is not supported */ - public static function convert($inputFileName, $outputFileName) + public static function convert($inputFileName, $outputFileName, $format = 'pdf') { // Posts the file to docsbox $queueId = self::_postFile($inputFileName); diff --git a/application/libraries/DocumentLib.php b/application/libraries/DocumentLib.php index 98e546b4e..d78a9c0df 100644 --- a/application/libraries/DocumentLib.php +++ b/application/libraries/DocumentLib.php @@ -14,20 +14,27 @@ class DocumentLib // Gets CI instance $this->ci =& get_instance(); - exec('unoconv --version', $ret_arr); - - if(isset($ret_arr[0])) + if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true) { - $hlp = explode(' ', $ret_arr[0]); - if(isset($hlp[1])) - { - $this->unoconv_version = $hlp[1]; - } - else - show_error('Could not get Unoconv Version'); + // Use docsbox!! } else - show_error('Unoconv not found - Please install Unoconv'); + { + exec('unoconv --version', $ret_arr); + + if(isset($ret_arr[0])) + { + $hlp = explode(' ', $ret_arr[0]); + if(isset($hlp[1])) + { + $this->unoconv_version = $hlp[1]; + } + else + show_error('Could not get Unoconv Version'); + } + else + show_error('Unoconv not found - Please install Unoconv'); + } } /** @@ -57,9 +64,16 @@ class DocumentLib case 'application/vnd.ms-word': case 'application/vnd.oasis.opendocument.text': case 'text/plain': - // Unoconv Version 0.6 seems to fail on converting TXT Files - if ($this->unoconv_version == '0.6') - return error(); + if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true) + { + // Use docsbox + } + else + { + // Unoconv Version 0.6 seems to fail on converting TXT Files + if ($this->unoconv_version == '0.6') + return error(); + } $ret = $this->convert($filename, $outFile, 'pdf'); if(isSuccess($ret)) @@ -123,13 +137,25 @@ class DocumentLib */ public function convert($inFile, $outFile, $format) { - if ($this->unoconv_version == '0.6') - $command = 'unoconv -f %1$s %3$s > %2$s'; - else - $command = 'unoconv -f %s --output %s %s 2>&1'; - $command = sprintf($command, $format, $outFile, $inFile); + $ret = 0; - exec($command, $out, $ret); + // If it is set to use docsbox + if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true) + { + require_once(dirname(__FILE__).'/../application/libraries/DocsboxLib.php'); + + $ret = DocsboxLib::convert($inFile, $outFile, $format); + } + else // otherwise use unoconv + { + if ($this->unoconv_version == '0.6') + $command = 'unoconv -f %1$s %3$s > %2$s'; + else + $command = 'unoconv -f %s --output %s %s 2>&1'; + $command = sprintf($command, $format, $outFile, $inFile); + + exec($command, $out, $ret); + } if ($ret != 0) { From db49f2b1e77248328388213bea238a0b5956966f Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 4 Mar 2022 19:47:32 +0100 Subject: [PATCH 004/279] - libraries/DocsboxLib: - Added new constant DEFAULT_FORMAT - ERROR and SUCCESS constant values are the same of EXIT_ERROR and EXIT_SUCCESS - public method convert parameter format does not have a default value anymore - Added use import of ZipArchive - libraries/DocumentLib: removed unused variables --- application/libraries/DocsboxLib.php | 23 +++++++++++++++-------- application/libraries/DocumentLib.php | 7 ++++--- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/application/libraries/DocsboxLib.php b/application/libraries/DocsboxLib.php index ce43f1bc5..5ec028a49 100644 --- a/application/libraries/DocsboxLib.php +++ b/application/libraries/DocsboxLib.php @@ -1,11 +1,11 @@ body != '') { // Output directory where to unzip the downloaded zip file - $outputDirectory = dirname($outputFileName); + $outputDirectory = dirname($outputFileName); // The path and name of the downloaded zip file $temporaryDownloadedZip = sys_get_temp_dir().'/'.basename($resultUrl); diff --git a/application/libraries/DocumentLib.php b/application/libraries/DocumentLib.php index d78a9c0df..eec3b6938 100644 --- a/application/libraries/DocumentLib.php +++ b/application/libraries/DocumentLib.php @@ -14,6 +14,7 @@ class DocumentLib // Gets CI instance $this->ci =& get_instance(); + // Which document converter has to be used if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true) { // Use docsbox!! @@ -119,7 +120,7 @@ class DocumentLib finfo_close($finfo); - exec($cmd, $out, $ret); + exec($cmd, null, $ret); if ($ret != 0) { return error('PDF-zusammenfuegung ist derzeit nicht möglich. Bitte informieren Sie den Administrator'); @@ -154,7 +155,7 @@ class DocumentLib $command = 'unoconv -f %s --output %s %s 2>&1'; $command = sprintf($command, $format, $outFile, $inFile); - exec($command, $out, $ret); + exec($command, null, $ret); } if ($ret != 0) @@ -217,7 +218,7 @@ class DocumentLib $cmd .= '/countspaces { [ exch { dup 32 ne { pop } if } forall ] length } bind def >> '; $cmd .= 'setpagedevice viewJPEG"'; - exec($cmd, $out, $ret); + exec($cmd, null, $ret); if ($ret != 0) { $this->errormsg = 'jpegToPdf ist derzeit nicht möglich. Bitte informieren Sie den Administrator'; From e50cc27a89f4bbdfc7d9192f215504d4e50b6068 Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 4 Mar 2022 20:13:03 +0100 Subject: [PATCH 005/279] Fixed exec second parameter value --- application/libraries/DocumentLib.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/application/libraries/DocumentLib.php b/application/libraries/DocumentLib.php index eec3b6938..c1dd21c29 100644 --- a/application/libraries/DocumentLib.php +++ b/application/libraries/DocumentLib.php @@ -120,7 +120,8 @@ class DocumentLib finfo_close($finfo); - exec($cmd, null, $ret); + $out = null; + exec($cmd, $out, $ret); if ($ret != 0) { return error('PDF-zusammenfuegung ist derzeit nicht möglich. Bitte informieren Sie den Administrator'); @@ -155,7 +156,8 @@ class DocumentLib $command = 'unoconv -f %s --output %s %s 2>&1'; $command = sprintf($command, $format, $outFile, $inFile); - exec($command, null, $ret); + $out = null; + exec($command, $out, $ret); } if ($ret != 0) @@ -218,7 +220,8 @@ class DocumentLib $cmd .= '/countspaces { [ exch { dup 32 ne { pop } if } forall ] length } bind def >> '; $cmd .= 'setpagedevice viewJPEG"'; - exec($cmd, null, $ret); + $out = null; + exec($cmd, $out, $ret); if ($ret != 0) { $this->errormsg = 'jpegToPdf ist derzeit nicht möglich. Bitte informieren Sie den Administrator'; From 6d1c926ec0eb22d7cea95e20b508a98d9b8018d8 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Tue, 29 Mar 2022 13:56:00 +0200 Subject: [PATCH 006/279] Anzeige AllinSaldo in Zeitaufzeichnung --- cis/private/tools/zeitaufzeichnung.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cis/private/tools/zeitaufzeichnung.php b/cis/private/tools/zeitaufzeichnung.php index ba57b442f..74c2678bc 100644 --- a/cis/private/tools/zeitaufzeichnung.php +++ b/cis/private/tools/zeitaufzeichnung.php @@ -1379,7 +1379,8 @@ if ($projekt->getProjekteMitarbeiter($user, true)) } } echo ''; - echo '

'; + echo '
'; + echo '

'; if (!$adminView) { From 9bf20dd7a41d4667bb208cfa501bd660e6a0efcb Mon Sep 17 00:00:00 2001 From: ma0068 Date: Thu, 28 Apr 2022 07:54:43 +0200 Subject: [PATCH 007/279] neue Funktion: getLastVerwendungZapflicht --- include/bisverwendung.class.php | 63 +++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/include/bisverwendung.class.php b/include/bisverwendung.class.php index ce6a557b1..afcc271f8 100644 --- a/include/bisverwendung.class.php +++ b/include/bisverwendung.class.php @@ -865,5 +865,68 @@ class bisverwendung extends basis_db return false; } } + + /** + * Lädt die letzte zeitaufzeichnungspflichtige Bisverwendung + * @param $uid UID des Mitarbeiters + * @return true wenn ok, false wenn Fehler + */ + public function getLastBisZAPflicht($uid) + { + $datetime = new DateTime($stichtag); + $stichtag = $datetime->format('Y-m-d'); + $bismeldung_jahr = $datetime->format('Y'); + + $qry = ' + SELECT + * + FROM + bis.tbl_bisverwendung + WHERE + mitarbeiter_uid = '. $this->db_add_param($uid).' + AND + zeitaufzeichnungspflichtig = true + ORDER BY ende DESC NULLS FIRST LIMIT 1 + '; + + if($this->db_query($qry)) + { + while($row = $this->db_fetch_object()) + { + + $obj = new bisverwendung(); + + $obj->bisverwendung_id = $row->bisverwendung_id; + $obj->ba1code = $row->ba1code; + $obj->ba2code = $row->ba2code; + $obj->beschausmasscode = $row->beschausmasscode; + $obj->verwendung_code = $row->verwendung_code; + $obj->hauptberufcode = $row->hauptberufcode; + $obj->hauptberuflich = $row->hauptberuflich; + $obj->habilitation = $row->habilitation; + $obj->beginn = $row->beginn; + $obj->ende = $row->ende; + $obj->updatevon = $row->updatevon; + $obj->updateamum = $row->updateamum; + $obj->insertamum = $row->insertamum; + $obj->insertvon = $row->insertvon; + $obj->vertragsstunden = $row->vertragsstunden; + $obj->dv_art = $row->dv_art; + $obj->inkludierte_lehre = $row->inkludierte_lehre; + $obj->azgrelevant = $row->azgrelevant; + $obj->homeoffice = $row->homeoffice; + + $this->result[] = $obj; + } + return true; + } + else + { + $this->errormsg = 'Fehler bei der Datenbankabfrage'; + return false; + } + } + + } ?> From b6cc084799e0bf6fd2fdcc55019b4963e6683365 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Thu, 28 Apr 2022 11:46:45 +0200 Subject: [PATCH 008/279] Adaptierung Funktion getLastBisZAPflicht() --- include/bisverwendung.class.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/bisverwendung.class.php b/include/bisverwendung.class.php index afcc271f8..e5314963b 100644 --- a/include/bisverwendung.class.php +++ b/include/bisverwendung.class.php @@ -873,10 +873,6 @@ class bisverwendung extends basis_db */ public function getLastBisZAPflicht($uid) { - $datetime = new DateTime($stichtag); - $stichtag = $datetime->format('Y-m-d'); - $bismeldung_jahr = $datetime->format('Y'); - $qry = ' SELECT * From d7e4d7ebde5f0eeedb89ea56183b6ea45ffe093a Mon Sep 17 00:00:00 2001 From: Paolo Date: Tue, 3 May 2022 10:58:46 +0200 Subject: [PATCH 009/279] Moved config entries from application/config/docsbox.php to config/cis.config-default.inc.php and config/vilesci.config-default.inc.php --- application/config/docsbox.php | 7 ------- application/libraries/DocsboxLib.php | 3 +-- config/cis.config-default.inc.php | 8 ++++++++ config/vilesci.config-default.inc.php | 8 ++++++++ 4 files changed, 17 insertions(+), 9 deletions(-) delete mode 100644 application/config/docsbox.php diff --git a/application/config/docsbox.php b/application/config/docsbox.php deleted file mode 100644 index ca64698f9..000000000 --- a/application/config/docsbox.php +++ /dev/null @@ -1,7 +0,0 @@ - + diff --git a/config/vilesci.config-default.inc.php b/config/vilesci.config-default.inc.php index cd45e6979..b1340fbfb 100644 --- a/config/vilesci.config-default.inc.php +++ b/config/vilesci.config-default.inc.php @@ -254,4 +254,12 @@ define('BIS_STANDORTCODE_LEHRGAENGE', '0'); // bPk Abfrage define('BPK_FUER_ALLE_BENUTZER_ABFRAGEN', false); + +// Docsbox configs +define('DOCSBOX_SERVER', 'http://docconverter.technikum-wien.at/'); +define('DOCSBOX_PATH_API', 'api/v1/'); +define('DOCSBOX_CONVERSION_TIMEOUT', 30); // seconds +define('DOCSBOX_WAITING_SLEEP_TIME', 1); + ?> + From 58d252b5b7d2e5a87c4b1db7a6fa8e00c4472eeb Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 6 May 2022 09:57:55 +0200 Subject: [PATCH 010/279] Added 3rd parameter to Docsbox::convert call were missing --- include/dokument_export.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/dokument_export.class.php b/include/dokument_export.class.php index c6c609ce9..0d4f2c660 100644 --- a/include/dokument_export.class.php +++ b/include/dokument_export.class.php @@ -291,7 +291,7 @@ class dokument_export { require_once(dirname(__FILE__).'/../application/libraries/DocsboxLib.php'); - $ret = DocsboxLib::convert($tempname_zip, $this->temp_filename); + $ret = DocsboxLib::convert($tempname_zip, $this->temp_filename, $this->outputformat); } else // otherwise use unoconv { @@ -480,7 +480,7 @@ class dokument_export { require_once(dirname(__FILE__).'/../application/libraries/DocsboxLib.php'); - $ret = DocsboxLib::convert($inFile, $outFile); + $ret = DocsboxLib::convert($inFile, $outFile, $format); } else // fallback to unoconv { From 704b32c76c4aba195389561cb8255c592ba2c1d7 Mon Sep 17 00:00:00 2001 From: Paolo Date: Wed, 11 May 2022 11:06:53 +0200 Subject: [PATCH 011/279] Fixed constant values in application/libraries/DocsboxLib.php --- application/libraries/DocsboxLib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/libraries/DocsboxLib.php b/application/libraries/DocsboxLib.php index 7d5af7106..f9167c379 100644 --- a/application/libraries/DocsboxLib.php +++ b/application/libraries/DocsboxLib.php @@ -26,8 +26,8 @@ use \ZipArchive as ZipArchive; */ class DocsboxLib { - const ERROR = EXIT_ERROR; - const SUCCESS = EXIT_SUCCESS; + const ERROR = 1; + const SUCCESS = 0; const STATUS_FINISHED = 'finished'; // Docsbox status when a document conversion ended const STATUS_QUEUED = 'queued'; // Docsbox status when a file has been queued for the conversion const STATUS_STARTED = 'started'; // Docsbox status when a file has started being worked From c87aee0ddf226a6f91ae842c603eb9e007b0ec22 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Fri, 24 Jun 2022 08:10:51 +0200 Subject: [PATCH 012/279] Zeitsperre Umbau Mail auf Sanchomail, Anzeige Zeitsaldo in Sanchomail, Adpatierungen Urlaub --- cis/private/profile/zeitsperre_resturlaub.php | 210 ++++++++++++++++-- include/zeitsperre.class.php | 49 +++- locale/de-AT/urlaubstool.php | 7 +- locale/en-US/urlaubstool.php | 7 + 4 files changed, 249 insertions(+), 24 deletions(-) diff --git a/cis/private/profile/zeitsperre_resturlaub.php b/cis/private/profile/zeitsperre_resturlaub.php index 8e449b12d..b5118dce4 100644 --- a/cis/private/profile/zeitsperre_resturlaub.php +++ b/cis/private/profile/zeitsperre_resturlaub.php @@ -31,6 +31,7 @@ require_once('../../../include/person.class.php'); require_once('../../../include/benutzer.class.php'); require_once('../../../include/mitarbeiter.class.php'); require_once('../../../include/mail.class.php'); +require_once('../../../include/sancho.inc.php'); require_once('../../../include/benutzerberechtigung.class.php'); require_once('../../../include/phrasen.class.php'); require_once('../../../include/zeitaufzeichnung.class.php'); @@ -65,6 +66,7 @@ if(isset($_GET['uid'])) die($p->t('global/FuerDieseAktionBenoetigenSieAdministrationsrechte')); } } + $datum_obj = new datum(); $ma= new mitarbeiter(); @@ -119,7 +121,8 @@ $( document ).ready(function() { for(i in addon) { - addon[i].init("cis/private/profile/zeitsperre_resturlaub.php", {uid:\''.$uid.'\', holiDays: holiDays}); + + addon[i].init("cis/private/profile/zeitsperre_resturlaub.php", {uid:\''.$uid.'\', holiDays: holiDays}); } } @@ -158,6 +161,63 @@ $( document ).ready(function() } return [true, ""]; } + +function AddonCaseTimeLoadZeitsaldo(uid) +{ + $.ajax({ + type: "GET", + dataType: "json", + url: "'.APP_ROOT.'/addons/casetime/vilesci/zeitsaldo.php?uid="+uid, + success: function (result) + { + if (result===false) + { + $("#zeitsaldo").html("error"); + } + else + { + var DatumAktuell = new Date(); + //var DatumAktuell = new Date(2016,0,11); + var MonatAktuell = DatumAktuell.getMonth()+1; + var MonatLetztes = MonatAktuell - 1; + var JahrAktuell = DatumAktuell.getFullYear(); + var JahrLetztes = DatumAktuell.getFullYear(); + var VorJahr = JahrAktuell -1; + if (MonatLetztes == 0) + { + MonatLetztes = 12; + JahrLetztes = JahrAktuell - 1; + } + var MonatVorLetztes = MonatLetztes -1; + var JahrVorLetztes = JahrLetztes; + if (MonatVorLetztes == 0) + { + MonatVorLetztes = 12; + JahrVorLetztes = JahrLetztes -1; + } + + + var zahl = parseFloat(result); + if (zahl > 0) + var faktor = 1; + else + var faktor = -1; + zahl = zahl * faktor; + var std = Math.floor(zahl); + var min = (zahl-Math.floor(zahl))*60; + min = Math.round(min); + var std_anzeigealt = std+"h:"+min+"m"; + + $(\'input[name="zeitsaldo"]\').val("Aktueller Stundensaldo: "+result +" Stunden ("+std_anzeigealt+")"); + + } + }, + error: function(){ + alert("Error Casetime Load"); + } + }); +} + '; ?> @@ -339,12 +399,16 @@ function showHideStudeDropDown() updateamum = date('Y-m-d H:i:s'); $zeitsperre->updatevon = $uid; + // Zeitsperretyp Beschreibung + $zeitsperre->loadZeitsperretyp($zeitsperre->zeitsperretyp_kurzbz); + $zeitsperre->beschreibung = $zeitsperre->result[0]->beschreibung; + if($zeitsperre->save()) { echo "

".$p->t('global/erfolgreichgespeichert')."

"; if(URLAUB_TOOLS) { - if($zeitsperre->new && $zeitsperre->zeitsperretyp_kurzbz=='Urlaub') + //Beim Anlegen von neuen Urlauben oder neuem Zeitausgleich wird ein Mail an den Vorgesetzten versendet + if($zeitsperre->new && ($zeitsperre->zeitsperretyp_kurzbz=='Urlaub' || $zeitsperre->zeitsperretyp_kurzbz == 'ZA') + || !$zeitsperre->new && $zeitsperre->zeitsperretyp_kurzbz == 'ZA') { //Beim Anlegen von neuen Urlauben wird ein Mail an den Vorgesetzten versendet um diesen Freizugeben $prsn = new person(); - $vorgesetzter = $ma->getVorgesetzte($uid); + $vorgesetzter = $ma->getVorgesetzte($uid); + if($vorgesetzter) { $to=''; @@ -536,16 +607,73 @@ if(isset($_GET['type']) && ($_GET['type']=='edit_sperre' || $_GET['type']=='new_ else $jahr = $datum_obj->formatDatum($zeitsperre->vondatum, 'Y'); - $message = "Dies ist eine automatische Mail! \n". - "$benutzer->nachname $benutzer->vorname hat einen neuen Urlaub eingetragen:\n". - "$zeitsperre->bezeichnung von ".$datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y')." bis ".$datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y')."\n\n". - "Sie können diesen unter folgender Adresse freigeben:\n". - APP_ROOT."cis/private/profile/urlaubsfreigabe.php?uid=$uid&year=".$jahr; - $from='vilesci@'.DOMAIN; - $mail = new mail($to, $from, 'Freigabeansuchen', $message); - if($mail->send()) + // Wenn ein neuer Urlaub eingetragen wurde, Freigabemail-Text + if ($zeitsperre->zeitsperretyp_kurzbz=='Urlaub') { - echo "
".$p->t('urlaubstool/freigabemailWurdeVersandt',array($fullName)).""; + if ($zeitsperre->new) + { + $mailSancho = " $benutzer->nachname $benutzer->vorname hat einen neuen Urlaub eingetragen:
"; + + $mailSancho.= (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung). + " von ".$datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y'). + " bis ".$datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y'). + ".
Sie können diesen unter folgender Adresse freigeben:

". + " Link Urlaubstool "; + + $subject = "Freigabeansuchen"; + + $zeitsaldo = ''; + } + + } + + // Wenn ein Zeitausgleich eingetragen wurde... + if ($zeitsperre->zeitsperretyp_kurzbz == 'ZA') + { + // ...Mail-Text für neuen Zeitausgleich + if ($zeitsperre->new) + { + $mailSancho = " $benutzer->nachname $benutzer->vorname hat einen neuen Zeitausgleich eingetragen:
"; + + $mailSancho.= (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung). + " von ".$datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y'). + " bis ".$datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y'); + + $subject = $p->t('urlaubstool/zeitausgleichNeu'); + } + // ...Mail-Text für geaenderten Zeitausgleich + else + { + $mailSancho = " $benutzer->nachname $benutzer->vorname hat den Zeitausgleich wie folgt geändert:
" ; + + $mailSancho.= (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung). + " von ".$datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y'). + " bis ".$datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y'); + + $subject = $subject = $p->t('urlaubstool/zeitausgleichGeaendert'); + } + } + + $from='vilesci@'.DOMAIN; + + //Sanchomail mit Vorlage Sancho Mail Zeitausgleich + $template_data = array( + 'vorgesetzter' => $fullName, + 'textZeitausgleich' => $mailSancho, + 'Saldo'=> $zeitsaldo + ); + + if (sendSanchoMail('Sancho_Content_Zeitausgleich', $template_data, $to, $subject)) + { + if ($zeitsperre->zeitsperretyp_kurzbz=='Urlaub') + { + echo "
". $p->t('urlaubstool/freigabemailWurdeVersandt', array($fullName)). ""; + } + + if ($zeitsperre->zeitsperretyp_kurzbz == 'ZA') + { + echo "
". $p->t('urlaubstool/VorgesetzteInformiert', array($fullName)). ""; + } } else { @@ -572,9 +700,13 @@ if((isset($_GET['type']) && $_GET['type']=='delete_sperre' && isset($_GET['infor $zeitsperre = new zeitsperre(); $zeitsperre->load($_GET['id']); + $zeitsperre->loadZeitsperretyp($zeitsperre->zeitsperretyp_kurzbz); + $zeitsperre->beschreibung = $zeitsperre->result[0]->beschreibung; + $vondatum = $zeitsperre->getVonDatum(); $bisdatum = $zeitsperre->getBisDatum(); + if(!$zeitsperre->delete($_GET['id'])) echo $zeitsperre->errormsg; @@ -604,16 +736,43 @@ if((isset($_GET['type']) && $_GET['type']=='delete_sperre' && isset($_GET['infor $benutzer = new benutzer(); $benutzer->load($uid); - $message = $p->t('urlaubstool/diesIstEineAutomatischeMail')."\n". - $p->t('urlaubstool/xHatUrlaubGeloescht',array($benutzer->nachname,$benutzer->vorname)).":\n"; + + if ($zeitsperre->zeitsperretyp_kurzbz == 'Urlaub') + { + $mailSancho = $p->t('urlaubstool/xHatUrlaubGeloescht', array($benutzer->nachname, $benutzer->vorname)).":
"; + + $mailSancho.= (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung). + " von ".$datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y'). + " bis ".$datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y'); + + // $subject = $p->t('urlaubstool/freigegebenerUrlaubGeloescht'); + $subject = $p->t('urlaubstool/UrlaubGeloescht'); - $message.= $p->t('urlaubstool/von')." ".date("d.m.Y", strtotime($vondatum))." ".$p->t('urlaubstool/bis')." ".date("d.m.Y", strtotime($bisdatum))."\n"; + } + + if ($zeitsperre->zeitsperretyp_kurzbz == 'ZA') + { + $mailSancho = $p->t('urlaubstool/xHatZeitausgleichGeloescht', array($benutzer->nachname, $benutzer->vorname)) . ":
"; + + $mailSancho.= (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung). + " von ".$datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y'). + " bis ".$datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y'); + + $subject = $p->t('urlaubstool/zeitausgleichGeloescht'); + + } + + $template_data = array( + 'vorgesetzter' => $fullName, + 'textZeitausgleich' => $mailSancho, + 'Saldo' => '' + ); - $mail = new mail($to, 'vilesci@'.DOMAIN,$p->t('urlaubstool/freigegebenerUrlaubGeloescht'), $message); - if($mail->send()) + if (sendSanchoMail('Sancho_Content_Zeitausgleich', $template_data, $to, $subject)) { + echo "" . $p->t('global/erfolgreichgelöscht') . '
'; echo "
".$p->t('urlaubstool/VorgesetzteInformiert',array($fullName)).""; } else @@ -621,6 +780,7 @@ if((isset($_GET['type']) && $_GET['type']=='delete_sperre' && isset($_GET['infor echo "
".$p->t('urlaubstool/fehlerBeimSendenAufgetreten',array($fullName))."!"; } } + else { $vgmail="
".$p->t('urlaubstool/konnteKeinFreigabemailVersendetWerden').""; @@ -632,6 +792,7 @@ if(isset($_GET['type']) && $_GET['type']=='delete_sperre' && !isset($_GET['infor { $zeit = new zeitsperre(); $zeit->load($_GET['id']); + //pruefen ob die person die den datensatz loeschen will auch der //besitzer dieses datensatzes ist if($zeit->mitarbeiter_uid==$uid) @@ -698,7 +859,7 @@ if(count($zeit->result)>0) $content_table.="".$p->t('zeitsperre/edit').""; if ($row->vondatum < $gesperrt_bis AND in_array($row->zeitsperretyp_kurzbz,$typen_arr)) $content_table .= ' '; - else if($row->vondatum>=date("Y-m-d",time()) && $row->zeitsperretyp_kurzbz=='Urlaub') + else if($row->vondatum>=date("Y-m-d",time()) && ($row->zeitsperretyp_kurzbz=='Urlaub' || $row->zeitsperretyp_kurzbz == 'ZA')) { $content_table.="\n".$p->t('zeitsperre/loeschen').""; } @@ -836,6 +997,12 @@ if($result = $db->db_query($qry)) } $content_form.= ''; +//visible field für Zeitsaldo in Mail ZA +$content_form.= ''; + +//$content_form.= ''.$p->t('global/bezeichnung').' +//'; + $content_form.= "".$p->t('urlaubstool/erreichbarkeit')."'; + + $content_form.= ''; + + if(isset($_GET['type']) && $_GET['type']=='edit') $content_form.= ""; @@ -875,6 +1046,7 @@ echo ''; ?> + showHideStudeDropDown();'; ?> diff --git a/include/zeitsperre.class.php b/include/zeitsperre.class.php index 0e737eaf0..efae1c91d 100644 --- a/include/zeitsperre.class.php +++ b/include/zeitsperre.class.php @@ -551,13 +551,13 @@ class zeitsperre extends basis_db public function getVonBis($uid, $von, $bis, $zeitsperretyp_kurzbz = null) { $qry = ' - SELECT + SELECT zeitsperre_id, zeitsperretyp_kurzbz, vondatum, vonstunde, bisdatum, bisstunde - FROM + FROM campus.tbl_zeitsperre LEFT JOIN campus.tbl_zeitsperretyp USING (zeitsperretyp_kurzbz) - WHERE - mitarbeiter_uid = '. $this->db_add_param($uid). ' + WHERE + mitarbeiter_uid = '. $this->db_add_param($uid). ' AND ( (vondatum BETWEEN '.$this->db_add_param($von).' AND '.$this->db_add_param($bis).') OR @@ -592,5 +592,46 @@ class zeitsperre extends basis_db return true; } } + + /** + * Laedt einen Zeitsperretyp. + * + * @param $zeitsperretyp_kurzbz + * @return Gibt Zeitsperretyp als Objekt zurück. True wenn ok, false im Fehlerfall. + */ + public function loadZeitsperretyp($zeitsperretyp_kurzbz) + { + if(!is_string($zeitsperretyp_kurzbz)) + { + $this->errormsg = 'zeitsperretyp muß ein String sein'; + return false; + } + + $qry = "SELECT * FROM campus.tbl_zeitsperretyp WHERE zeitsperretyp_kurzbz = ". $this->db_add_param($zeitsperretyp_kurzbz); + + if(!$this->db_query($qry)) + { + $this->errormsg = 'Fehler beim Laden des Datensatzes'; + return false; + } + + if($row = $this->db_fetch_object()) + { + $obj = new StdClass(); + $obj->zeitsperretyp_kurzbz = $row->zeitsperretyp_kurzbz; + $obj->beschreibung = $row->beschreibung; + $obj->farbe = $row->farbe; + + $this->result[]= $obj; + } + else + { + $this->errormsg = 'Zeitsperretyp konnte nicht geladen werden'; + return false; + } + + return true; + } + } ?> diff --git a/locale/de-AT/urlaubstool.php b/locale/de-AT/urlaubstool.php index 6d6edde09..5001ed725 100644 --- a/locale/de-AT/urlaubstool.php +++ b/locale/de-AT/urlaubstool.php @@ -37,9 +37,14 @@ $this->phrasen['urlaubstool/sieKoennenDiesenUnterFolgenderAdresseFreigeben']='Si $this->phrasen['urlaubstool/freigabeansuchenUrlaub']='Freigabeansuchen Urlaub'; $this->phrasen['urlaubstool/freigabeFehlt']='Urlaub wurde noch nicht freigegeben'; $this->phrasen['urlaubstool/freigegebenerUrlaubGeloescht']='Bereits Freigegebener Urlaub wurde gelöscht'; +$this->phrasen['urlaubstool/UrlaubGeloescht']='Urlaub wurde gelöscht'; +$this->phrasen['urlaubstool/zeitausgleichNeu']='Zeitausgleich wurde neu eingetragen'; +$this->phrasen['urlaubstool/zeitausgleichGeaendert']='Zeitausgleich wurde geändert'; +$this->phrasen['urlaubstool/zeitausgleichGeloescht']='Zeitausgleich wurde gelöscht'; +$this->phrasen['urlaubstool/xHatZeitausgleichGeloescht']='%s %s hat einen eingetragenen Zeitausgleich gelöscht'; $this->phrasen['urlaubstool/VorgesetzteInformiert']='Email wurde an %s versandt'; $this->phrasen['urlaubstool/konnteKeinInformationsemailVersendetWerden']='Es konnte kein Email versendet werden, da kein Vorgesetzter eingetragen ist!'; -$this->phrasen['urlaubstool/xHatUrlaubGeloescht']='%s %s hat bereits freigegebenen Urlaub gelöscht'; +$this->phrasen['urlaubstool/xHatUrlaubGeloescht']='%s %s hat Urlaub gelöscht'; $this->phrasen['urlaubstool/urlaubsfreigabe']='Freigabe Urlaub: '; $this->phrasen['urlaubstool/bestaetigungsmailWurdeVersandt']='Bestätigungsmail an %s versandt'; $this->phrasen['urlaubstool/urlaubVon']='Ihr angefragter Urlaub von'; diff --git a/locale/en-US/urlaubstool.php b/locale/en-US/urlaubstool.php index 697117c34..17a31c986 100644 --- a/locale/en-US/urlaubstool.php +++ b/locale/en-US/urlaubstool.php @@ -36,6 +36,13 @@ $this->phrasen['urlaubstool/meineZeitsperren']='My Planned Absences'; $this->phrasen['urlaubstool/sieKoennenDiesenUnterFolgenderAdresseFreigeben']='Sie können diesen unter folgender Adresse freigeben'; //Nur übersetzen, wenn die eMail in der eingestellten Sprache versandt werden soll $this->phrasen['urlaubstool/freigabeansuchenUrlaub']='Freigabeansuchen Urlaub'; //Nur übersetzen, wenn die eMail in der eingestellten Sprache versandt werden soll $this->phrasen['urlaubstool/freigabeFehlt']='Vacation has not been approved yet'; +$this->phrasen['urlaubstool/zeitausgleichNeu']='Compensatory time was entered'; +$this->phrasen['urlaubstool/zeitausgleichGeaendert']='Compensatory time was changed'; +$this->phrasen['urlaubstool/zeitausgleichGeloescht']='Compensatory time was deleted'; +$this->phrasen['urlaubstool/xHatZeitausgleichGeloescht']='Compensatory time was deleted by %s %s'; +$this->phrasen['urlaubstool/xHatUrlaubGeloescht']='Vacation was deleted by %s %s'; +$this->phrasen['urlaubstool/UrlaubGeloescht']='Urlaub wurde gelöscht'; +$this->phrasen['urlaubstool/freigegebenerUrlaubGeloescht']='Approved Vacation was deleted by %s %s'; $this->phrasen['urlaubstool/urlaubsfreigabe']='Vacation approval: '; $this->phrasen['urlaubstool/bestaetigungsmailWurdeVersandt']='Confirmation mail to %s sent'; $this->phrasen['urlaubstool/urlaubVon']='Ihr angefragter Urlaub von'; //Nur übersetzen, wenn die eMail in der eingestellten Sprache versandt werden soll From 797cabccb969843cc9afcbd998e4923a7ffda37b Mon Sep 17 00:00:00 2001 From: ma0068 Date: Wed, 29 Jun 2022 08:46:01 +0200 Subject: [PATCH 013/279] neue Mailvorlagen Sancho fuer Zeitausgleich und Urlaub --- cis/private/profile/zeitsperre_resturlaub.php | 169 ++++++------------ 1 file changed, 51 insertions(+), 118 deletions(-) diff --git a/cis/private/profile/zeitsperre_resturlaub.php b/cis/private/profile/zeitsperre_resturlaub.php index b5118dce4..12f9dfa97 100644 --- a/cis/private/profile/zeitsperre_resturlaub.php +++ b/cis/private/profile/zeitsperre_resturlaub.php @@ -108,7 +108,12 @@ $addon_obj->loadAddons(); foreach($addon_obj->result as $addon) { if(file_exists('../../../addons/'.$addon->kurzbz.'/cis/init.js.php')) + { echo ''; + $addoncasetime = true; + require_once('../../../addons/casetime/include/functions.inc.php'); + } + } // Wenn Seite fertig geladen ist Addons aufrufen @@ -162,62 +167,6 @@ $( document ).ready(function() return [true, ""]; } -function AddonCaseTimeLoadZeitsaldo(uid) -{ - $.ajax({ - type: "GET", - dataType: "json", - url: "'.APP_ROOT.'/addons/casetime/vilesci/zeitsaldo.php?uid="+uid, - success: function (result) - { - if (result===false) - { - $("#zeitsaldo").html("error"); - } - else - { - var DatumAktuell = new Date(); - //var DatumAktuell = new Date(2016,0,11); - var MonatAktuell = DatumAktuell.getMonth()+1; - var MonatLetztes = MonatAktuell - 1; - var JahrAktuell = DatumAktuell.getFullYear(); - var JahrLetztes = DatumAktuell.getFullYear(); - var VorJahr = JahrAktuell -1; - if (MonatLetztes == 0) - { - MonatLetztes = 12; - JahrLetztes = JahrAktuell - 1; - } - var MonatVorLetztes = MonatLetztes -1; - var JahrVorLetztes = JahrLetztes; - if (MonatVorLetztes == 0) - { - MonatVorLetztes = 12; - JahrVorLetztes = JahrLetztes -1; - } - - - var zahl = parseFloat(result); - if (zahl > 0) - var faktor = 1; - else - var faktor = -1; - zahl = zahl * faktor; - var std = Math.floor(zahl); - var min = (zahl-Math.floor(zahl))*60; - min = Math.round(min); - var std_anzeigealt = std+"h:"+min+"m"; - - $(\'input[name="zeitsaldo"]\').val("Aktueller Stundensaldo: "+result +" Stunden ("+std_anzeigealt+")"); - - } - }, - error: function(){ - alert("Error Casetime Load"); - } - }); -} - '; ?> @@ -399,16 +348,20 @@ function showHideStudeDropDown() load($uid); + $nameMitarbeiter = $benutzer->vorname. " ". $benutzer->nachname; + $beschreibung = (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung); + if($datum_obj->formatDatum($zeitsperre->vondatum, 'm')>=9) $jahr = $datum_obj->formatDatum($zeitsperre->vondatum, 'Y')+1; else $jahr = $datum_obj->formatDatum($zeitsperre->vondatum, 'Y'); + $von = $datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y'); + $bis = $datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y'); + // Wenn ein neuer Urlaub eingetragen wurde, Freigabemail-Text if ($zeitsperre->zeitsperretyp_kurzbz=='Urlaub') { - if ($zeitsperre->new) - { - $mailSancho = " $benutzer->nachname $benutzer->vorname hat einen neuen Urlaub eingetragen:
"; - - $mailSancho.= (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung). - " von ".$datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y'). - " bis ".$datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y'). - ".
Sie können diesen unter folgender Adresse freigeben:

". - " Link Urlaubstool "; + $zeitsaldo = " Link Urlaubstool "; $subject = "Freigabeansuchen"; - - $zeitsaldo = ''; - } - + $mailvorlage = 'Sancho_Mail_Urlaub_Neu'; } // Wenn ein Zeitausgleich eingetragen wurde... + //manu zeitsperre neu if ($zeitsperre->zeitsperretyp_kurzbz == 'ZA') { // ...Mail-Text für neuen Zeitausgleich if ($zeitsperre->new) { - $mailSancho = " $benutzer->nachname $benutzer->vorname hat einen neuen Zeitausgleich eingetragen:
"; - - $mailSancho.= (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung). - " von ".$datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y'). - " bis ".$datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y'); - $subject = $p->t('urlaubstool/zeitausgleichNeu'); + $mailvorlage = 'Sancho_Content_Zeitausgleich'; } // ...Mail-Text für geaenderten Zeitausgleich else { - $mailSancho = " $benutzer->nachname $benutzer->vorname hat den Zeitausgleich wie folgt geändert:
" ; - - $mailSancho.= (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung). - " von ".$datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y'). - " bis ".$datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y'); - $subject = $subject = $p->t('urlaubstool/zeitausgleichGeaendert'); + $mailvorlage = 'Sancho_Content_ZA_Aendern'; } } @@ -659,11 +598,15 @@ if(isset($_GET['type']) && ($_GET['type']=='edit_sperre' || $_GET['type']=='new_ //Sanchomail mit Vorlage Sancho Mail Zeitausgleich $template_data = array( 'vorgesetzter' => $fullName, - 'textZeitausgleich' => $mailSancho, + 'nameMitarbeiter' => $nameMitarbeiter, + 'beschreibung' =>$beschreibung, + 'vonDatum' => $von, + 'bisDatum' => $bis, 'Saldo'=> $zeitsaldo ); - if (sendSanchoMail('Sancho_Content_Zeitausgleich', $template_data, $to, $subject)) + + if (sendSanchoMail($mailvorlage, $template_data, $to, $subject)) { if ($zeitsperre->zeitsperretyp_kurzbz=='Urlaub') { @@ -703,8 +646,11 @@ if((isset($_GET['type']) && $_GET['type']=='delete_sperre' && isset($_GET['infor $zeitsperre->loadZeitsperretyp($zeitsperre->zeitsperretyp_kurzbz); $zeitsperre->beschreibung = $zeitsperre->result[0]->beschreibung; - $vondatum = $zeitsperre->getVonDatum(); - $bisdatum = $zeitsperre->getBisDatum(); + $vonDatum = $zeitsperre->getVonDatum(); + $bisDatum = $zeitsperre->getBisDatum(); + + $vonDatum = $datum_obj->formatDatum($vonDatum ,'d.m.Y'); + $bisDatum = $datum_obj->formatDatum($bisDatum,'d.m.Y'); if(!$zeitsperre->delete($_GET['id'])) @@ -736,41 +682,30 @@ if((isset($_GET['type']) && $_GET['type']=='delete_sperre' && isset($_GET['infor $benutzer = new benutzer(); $benutzer->load($uid); + $nameMitarbeiter = $benutzer->vorname. " ". $benutzer->nachname; + $beschreibung = (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung); - if ($zeitsperre->zeitsperretyp_kurzbz == 'Urlaub') - { - $mailSancho = $p->t('urlaubstool/xHatUrlaubGeloescht', array($benutzer->nachname, $benutzer->vorname)).":
"; - - $mailSancho.= (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung). - " von ".$datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y'). - " bis ".$datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y'); - - // $subject = $p->t('urlaubstool/freigegebenerUrlaubGeloescht'); + if ($zeitsperre->zeitsperretyp_kurzbz == 'Urlaub') + { $subject = $p->t('urlaubstool/UrlaubGeloescht'); - - + $mailvorlage = 'Sancho_Mail_Urlaub_Loeschen'; } - if ($zeitsperre->zeitsperretyp_kurzbz == 'ZA') - { - $mailSancho = $p->t('urlaubstool/xHatZeitausgleichGeloescht', array($benutzer->nachname, $benutzer->vorname)) . ":
"; - - $mailSancho.= (!empty($zeitsperre->bezeichnung) ? $zeitsperre->bezeichnung : $zeitsperre->beschreibung). - " von ".$datum_obj->formatDatum($zeitsperre->vondatum,'d.m.Y'). - " bis ".$datum_obj->formatDatum($zeitsperre->bisdatum,'d.m.Y'); - - $subject = $p->t('urlaubstool/zeitausgleichGeloescht'); - - } + if ($zeitsperre->zeitsperretyp_kurzbz == 'ZA') + { + $subject = $p->t('urlaubstool/zeitausgleichGeloescht'); + $mailvorlage = 'Sancho_Mail_ZA_loeschen'; + } $template_data = array( 'vorgesetzter' => $fullName, - 'textZeitausgleich' => $mailSancho, - 'Saldo' => '' + 'nameMitarbeiter' => $nameMitarbeiter, + 'beschreibung' =>$beschreibung, + 'vonDatum' => $vonDatum, + 'bisDatum' => $bisDatum ); - - if (sendSanchoMail('Sancho_Content_Zeitausgleich', $template_data, $to, $subject)) + if (sendSanchoMail($mailvorlage, $template_data, $to, $subject)) { echo "" . $p->t('global/erfolgreichgelöscht') . '
'; echo "
".$p->t('urlaubstool/VorgesetzteInformiert',array($fullName)).""; @@ -997,12 +932,10 @@ if($result = $db->db_query($qry)) } $content_form.= ''; -//visible field für Zeitsaldo in Mail ZA -$content_form.= ''; - //$content_form.= ''.$p->t('global/bezeichnung').' //'; + $content_form.= "".$p->t('urlaubstool/erreichbarkeit')."'; } else { - echo ''; } } diff --git a/cis/private/profile/zeitsperre_resturlaub.php b/cis/private/profile/zeitsperre_resturlaub.php index 12f9dfa97..f18a4b2cc 100644 --- a/cis/private/profile/zeitsperre_resturlaub.php +++ b/cis/private/profile/zeitsperre_resturlaub.php @@ -102,20 +102,20 @@ $num_rows_stunde=$db->db_num_rows($result_stunde); loadAddons(); foreach($addon_obj->result as $addon) { if(file_exists('../../../addons/'.$addon->kurzbz.'/cis/init.js.php')) - { echo ''; - $addoncasetime = true; - require_once('../../../addons/casetime/include/functions.inc.php'); - } - } +// Überprüfen, ob addon casetime aktiv ist +$addoncasetime = $addon_obj->checkActiveAddon("casetime"); +echo $addon_obj->checkActiveAddon("asterisk"); + // Wenn Seite fertig geladen ist Addons aufrufen echo ' '; - $addoncasetime = true; - require_once('../../addons/casetime/include/functions.inc.php'); - } + require_once('../../addons/casetime/include/functions.inc.php'); } + //Kopfzeile echo ' @@ -96,7 +91,7 @@ echo ' "); +if (!in_array($gebiet_id, $_SESSION['alleGebiete'])) + die($p->t('testtool/dasGebietIstNichtFuerSieBestimmt')); + $gebiet = new gebiet($gebiet_id); if($gebiet->level_start!='') diff --git a/cis/testtool/menu.php b/cis/testtool/menu.php index e4b0a82fe..1e39885d8 100644 --- a/cis/testtool/menu.php +++ b/cis/testtool/menu.php @@ -277,6 +277,7 @@ if (isset($_SESSION['pruefling_id'])) $anzahlGebiete = $db->db_num_rows($result); $lastsemester = ''; $quereinsteiger_stg = ''; + $_SESSION['alleGebiete']= []; while($row = $db->db_fetch_object($result)) { //Jedes Semester in einer eigenen Tabelle anzeigen @@ -385,6 +386,7 @@ if (isset($_SESSION['pruefling_id'])) '; + $_SESSION['alleGebiete'][] = $row->gebiet_id; } else { diff --git a/locale/de-AT/testtool.php b/locale/de-AT/testtool.php index dbafe21e9..81a2ca1ca 100644 --- a/locale/de-AT/testtool.php +++ b/locale/de-AT/testtool.php @@ -45,6 +45,7 @@ $this->phrasen['testtool/beiDiesemGebietMuessenSieJedeFrageBeantworten']='Bei di $this->phrasen['testtool/bearbeitungszeit']='Bearbeitungszeit'; $this->phrasen['testtool/dieZeitIstAbgelaufen']='Die Zeit ist abgelaufen!
Bitte aktivieren Sie Javascript in Ihrem Browser!'; $this->phrasen['testtool/dieseFrageIstNichtFuerSieBestimmt']='Diese Frage ist nicht für Sie bestimmt'; +$this->phrasen['testtool/dasGebietIstNichtFuerSieBestimmt']='Das Gebiet ist nicht für Sie bestimmt'; $this->phrasen['testtool/fehlerBeimSpeichernDerErstansicht']='Fehler beim Speichern der Erstansicht'; $this->phrasen['testtool/startDrueckenUmZuBeginnen']='Um dieses Teilgebiet zu starten, drücken Sie bitte links oben auf Gebiet starten.'; $this->phrasen['testtool/keinPrueflingseintragVorhanden']='Kein Prüflingseintrag vorhanden'; diff --git a/locale/en-US/testtool.php b/locale/en-US/testtool.php index 473ac1e0d..87b818062 100644 --- a/locale/en-US/testtool.php +++ b/locale/en-US/testtool.php @@ -45,6 +45,7 @@ $this->phrasen['testtool/beiDiesemGebietMuessenSieJedeFrageBeantworten']='In thi $this->phrasen['testtool/bearbeitungszeit']='Time'; $this->phrasen['testtool/dieZeitIstAbgelaufen']='The time has run out!
Please enable JavaScript in your browser!'; $this->phrasen['testtool/dieseFrageIstNichtFuerSieBestimmt']='This question is not intended for you'; +$this->phrasen['testtool/dasGebietIstNichtFuerSieBestimmt']='This section is not intended for you'; $this->phrasen['testtool/fehlerBeimSpeichernDerErstansicht']='Error in saving the initial view'; $this->phrasen['testtool/startDrueckenUmZuBeginnen']='To start this section, please click on Start section in the top left corner.'; $this->phrasen['testtool/keinPrueflingseintragVorhanden']='No candidate entry available.'; diff --git a/locale/it-IT/testtool.php b/locale/it-IT/testtool.php index 0f64986a9..9a3553efe 100644 --- a/locale/it-IT/testtool.php +++ b/locale/it-IT/testtool.php @@ -7,6 +7,7 @@ $this->phrasen['testtool/bitteZuerstAnmelden']=''; $this->phrasen['testtool/blaettern']=''; $this->phrasen['testtool/demo']=''; $this->phrasen['testtool/dieseFrageIstNichtFuerSieBestimmt']=''; +$this->phrasen['testtool/dasGebietIstNichtFuerSieBestimmt']=''; $this->phrasen['testtool/dieZeitIstAbgelaufen']=''; $this->phrasen['testtool/einleitung']=''; $this->phrasen['testtool/esWurdeKeineFrageGefunden']=''; From 282b46d54e22a918b87b3779221bd4f989826eb8 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Tue, 23 Aug 2022 15:26:13 +0200 Subject: [PATCH 023/279] =?UTF-8?q?Added=20betreuerart=20Senatsvorsitz=20a?= =?UTF-8?q?nd=20Senatspr=C3=BCfer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system/dbupdate_3.3.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 6824d350f..515a80bf5 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -6273,6 +6273,34 @@ if($result = @$db->db_query("SELECT * FROM information_schema.role_table_grants } } +// lehre.tbl_betreuerart: add type Senatsvorsitz +if($result = $db->db_query("SELECT 1 FROM lehre.tbl_betreuerart WHERE betreuerart_kurzbz='Senatsvorsitz'")) +{ + if($db->db_num_rows($result)==0) + { + $qry = "INSERT INTO lehre.tbl_betreuerart(betreuerart_kurzbz, beschreibung) VALUES('Senatsvorsitz', 'Senatsvorsitz kommissionelle Prüfung');"; + + if(!$db->db_query($qry)) + echo 'Betreuerart: '.$db->db_last_error().'
'; + else + echo '
Neue Betreuerart Senatsvorsitz in lehre.tbl_betreuerart hinzugefügt'; + } +} + +// lehre.tbl_betreuerart: add type Senatsprüfer +if($result = $db->db_query("SELECT 1 FROM lehre.tbl_betreuerart WHERE betreuerart_kurzbz='Senatspruefer'")) +{ + if($db->db_num_rows($result)==0) + { + $qry = "INSERT INTO lehre.tbl_betreuerart(betreuerart_kurzbz, beschreibung) VALUES('Senatspruefer', 'Senatsprüfer kommissionelle Prüfung');"; + + if(!$db->db_query($qry)) + echo 'Betreuerart: '.$db->db_last_error().'
'; + else + echo '
Neue Betreuerart Senatspruefer in lehre.tbl_betreuerart hinzugefügt'; + } +} + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; From 82d7891f3c81d4abdf33c2be5a04de7412b9ed0f Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Tue, 23 Aug 2022 17:45:12 +0200 Subject: [PATCH 024/279] =?UTF-8?q?Projektarbeitsbeurteilung=20possible=20?= =?UTF-8?q?for=20Pr=C3=BCfungssenat.=20Mails=20are=20sent=20to=20Senat=20m?= =?UTF-8?q?embers,=20Senat=20members=20are=20displayed=20with=20correct=20?= =?UTF-8?q?labels,=20external=20Pr=C3=BCfer=20can=20get=20login=20token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../education/Projektbetreuer_model.php | 36 +- cis/private/lehre/abgabe_lektor.php | 3 +- cis/private/lehre/abgabe_lektor_details.php | 336 +++++++----- cis/private/lehre/abgabe_student.php | 518 +++++++++--------- cis/private/lehre/abgabe_student_details.php | 95 ++-- include/projektbetreuer.class.php | 68 ++- locale/de-AT/abgabetool.php | 9 +- locale/en-US/abgabetool.php | 7 +- system/phrasesupdate.php | 20 + vilesci/lehre/abgabe_assistenz.php | 6 +- 10 files changed, 611 insertions(+), 487 deletions(-) diff --git a/application/models/education/Projektbetreuer_model.php b/application/models/education/Projektbetreuer_model.php index 0200f6468..f6205f67f 100644 --- a/application/models/education/Projektbetreuer_model.php +++ b/application/models/education/Projektbetreuer_model.php @@ -54,18 +54,28 @@ class Projektbetreuer_model extends DB_Model $qry = "SELECT DISTINCT ON (pers.person_id) pers.person_id, betreuerart_kurzbz, vorname, nachname, trim(COALESCE(titelpre,'')||' '||COALESCE(vorname,'')||' '||COALESCE(nachname,'')||' '||COALESCE(titelpost,'')) as voller_name, anrede, titelpre, titelpost, gebdatum, geschlecht, pa.projekttyp_kurzbz, - ben.uid, ben.alias, ma.personalnummer, mitarbeiter_uid, student_uid - FROM lehre.tbl_projektarbeit pa - JOIN lehre.tbl_projektbetreuer USING (projektarbeit_id) - JOIN public.tbl_person pers USING (person_id) - LEFT JOIN public.tbl_benutzer ben USING (person_id) - LEFT JOIN public.tbl_mitarbeiter ma ON ben.uid = ma.mitarbeiter_uid - WHERE ben.aktiv - AND projektarbeit_id = ? - AND betreuerart_kurzbz = ? - ORDER BY pers.person_id, CASE WHEN ma.mitarbeiter_uid IS NULL THEN 1 ELSE 0 END, /*Mitarbeiter account first*/ - CASE WHEN ben.uid IS NULL THEN 1 ELSE 0 END, /*user with account first*/ - ben.insertamum"; + ben.uid, ben.alias, ma.personalnummer, mitarbeiter_uid, student_uid, + ( + SELECT kontakt + FROM public.tbl_kontakt + WHERE kontakttyp = 'email' + AND person_id = pers.person_id + ORDER BY + CASE WHEN zustellung THEN 0 ELSE 1 END, + insertamum DESC NULLS LAST + LIMIT 1 + ) AS private_email + FROM lehre.tbl_projektarbeit pa + JOIN lehre.tbl_projektbetreuer USING (projektarbeit_id) + JOIN public.tbl_person pers USING (person_id) + LEFT JOIN public.tbl_benutzer ben USING (person_id) + LEFT JOIN public.tbl_mitarbeiter ma ON ben.uid = ma.mitarbeiter_uid + WHERE (ben.aktiv OR ben.aktiv IS NULL) + AND projektarbeit_id = ? + AND betreuerart_kurzbz = ? + ORDER BY pers.person_id, CASE WHEN ma.mitarbeiter_uid IS NULL THEN 1 ELSE 0 END, /*Mitarbeiter account first*/ + CASE WHEN ben.uid IS NULL THEN 1 ELSE 0 END, /*user with account first*/ + ben.insertamum"; return $this->execQuery($qry, array($projektarbeit_id, $betreuerart_kurzbz)); } @@ -102,7 +112,7 @@ class Projektbetreuer_model extends DB_Model trim(COALESCE(titelpre,'')||' '||COALESCE(vorname,'')||' '||COALESCE(nachname,'')||' '||COALESCE(titelpost,'')) as voller_name, CASE WHEN tbl_benutzer.uid IS NULL THEN kontakt ELSE tbl_benutzer.uid || '@".DOMAIN."' END AS email, abg.abgabedatum FROM lehre.tbl_projektbetreuer betr - JOIN lehre.tbl_projektarbeit parb ON betr.projektarbeit_id = parb.projektarbeit_id + JOIN lehre.tbl_projektarbeit parb ON betr.projektarbeit_id = parb.projektarbeit_id JOIN public.tbl_person pers ON betr.person_id = pers.person_id LEFT JOIN public.tbl_kontakt ON pers.person_id = tbl_kontakt.person_id AND kontakttyp = 'email' AND zustellung = true LEFT JOIN public.tbl_benutzer ON pers.person_id = tbl_benutzer.person_id diff --git a/cis/private/lehre/abgabe_lektor.php b/cis/private/lehre/abgabe_lektor.php index 414c5e423..069f3caf3 100644 --- a/cis/private/lehre/abgabe_lektor.php +++ b/cis/private/lehre/abgabe_lektor.php @@ -75,8 +75,7 @@ $sql_query = "SELECT WHERE public.tbl_benutzer.person_id=lehre.tbl_projektbetreuer.person_id AND public.tbl_benutzer.uid=".$db->db_add_param($getuid).") ".($showall?'':' AND public.tbl_benutzer.aktiv AND lehre.tbl_projektarbeit.note IS NULL ')." - AND (betreuerart_kurzbz='Betreuer' OR betreuerart_kurzbz='Begutachter' OR betreuerart_kurzbz='Erstbegutachter' - OR betreuerart_kurzbz='Zweitbegutachter' OR betreuerart_kurzbz='Erstbetreuer') + AND betreuerart_kurzbz IN ('Betreuer', 'Begutachter', 'Erstbegutachter', 'Zweitbegutachter', 'Erstbetreuer', 'Senatsvorsitz', 'Senatspruefer') ORDER BY tbl_projektarbeit.projektarbeit_id, betreuerart_kurzbz desc) as xy ORDER BY nachname"; diff --git a/cis/private/lehre/abgabe_lektor_details.php b/cis/private/lehre/abgabe_lektor_details.php index a508de098..ed33add27 100644 --- a/cis/private/lehre/abgabe_lektor_details.php +++ b/cis/private/lehre/abgabe_lektor_details.php @@ -121,9 +121,9 @@ $titel = $projektarbeit_obj->titel; $student_uid = $projektarbeit_obj->student_uid; // paarbeit sollte nur ab bestimmten Zeitpunkt online bewertet werden -$num_rows_sem = $projektarbeit_obj->projektarbeitIsCurrent($projektarbeit_id); +$paIsCurrent = $projektarbeit_obj->projektarbeitIsCurrent($projektarbeit_id); -if(!is_numeric($num_rows_sem) || $num_rows_sem < 0) +if(!is_numeric($paIsCurrent) || $paIsCurrent < 0) { echo "".$p->t('abgabetool/fehlerAktualitaetProjektarbeit')."
 "; } @@ -143,27 +143,28 @@ if($num_rows_endupload < 0) } // Zweitbegutachter holen -if($betreuerart=="Erstbegutachter") +if(in_array($betreuerart, array('Erstbegutacher', 'Senatsvorsitz'))) { - $projektbetreuer = new projektbetreuer(); - $alleBegutachter = $projektbetreuer->getProjektbetreuer($projektarbeit_id); + $alleBegutachter = new projektbetreuer(); + $alleBegutachterRes = $alleBegutachter->getProjektbetreuer($projektarbeit_id); - if ($alleBegutachter) + if ($alleBegutachterRes) { - $alleBegutachterResults = $projektbetreuer->result; - - foreach ($alleBegutachterResults as $begutachter) + $zweitbetreuerArr = array(); + foreach ($alleBegutachter->result as $begutachter) { - if ($begutachter->betreuerart_kurzbz == "Erstbegutachter") + if (in_array($begutachter->betreuerart_kurzbz, array('Erstbegutacher', 'Senatsvorsitz'))) { + // dem Erstbetreuer zugewiesene Zweitbetreuer holen $erstbetreuer_id = $begutachter->person_id; - $zweitbegutachter = $projektbetreuer->getZweitbegutachterWithToken($erstbetreuer_id, $projektarbeit_id, $student_uid); - break; + $zweitbegutachter = new projektbetreuer(); + $zweitbegutachterRes = $zweitbegutachter->getZweitbegutachterWithToken($erstbetreuer_id, $projektarbeit_id, $student_uid); + if ($zweitbegutachterRes) $zweitbetreuerArr = array_merge($zweitbetreuerArr, $zweitbegutachter->result); } } // Mail mit Token an Zweitbegutachter senden - if ($zweitbegutachter && $num_rows_sem >= 1 && isset($_GET['zweitbegutachtertoken'])) + if ($zweitbegutachterRes && $paIsCurrent >= 1 && isset($_GET['zweitbegutachtertoken']) && isset($_GET['zweitbetreuer_person_id'])) { $qry_std="SELECT * FROM campus.vw_benutzer where uid=".$db->db_add_param($uid); if(!$result_std=$db->db_query($qry_std)) @@ -173,15 +174,24 @@ if($betreuerart=="Erstbegutachter") else { $row_std=@$db->db_fetch_object($result_std); - $mailres = sendZweitbegutachterMail($zweitbegutachter, $erstbetreuer_id, $row_std); + foreach ($zweitbetreuerArr as $zbg) + { + // if Zweitbetreuer is the one for which token was requested, send mail + if ($zbg->person_id == $_GET['zweitbetreuer_person_id']) + { + $mailres = sendZweitbegutachterMail($zbg, $erstbetreuer_id, $row_std); - if ($mailres) - { - echo "
".$p->t('abgabetool/zweitbegutachterMailGesendet', $zweitbegutachter->email)."
 "; - } - else - { - echo "".$p->t('abgabetool/fehlerMailZweitBegutachter')." Mail: ".$zweitbegutachter->email."
 "; + if ($mailres) + { + echo "
" + .$p->t('abgabetool/zweitbegutachterMailGesendet', array($zbg->voller_name, $zbg->email)) + ."
 "; + } + else + { + echo "".$p->t('abgabetool/fehlerMailZweitBegutachter')." Mail: ".$zbg->email."
 "; + } + } } } } @@ -465,7 +475,7 @@ $htmlstr .= "\n"; $htmlstr .= ""; $htmlstr .= ""; $htmlstr .= "\n"; -if (isset($zweitbegutachter) && $zweitbegutachter) // wenn es Zweitbegutachter gibt + +if (isset($zweitbetreuerArr) && is_array($zweitbetreuerArr)) // wenn es Zweitbetreuer gibt { - // Zweitbegutachter anzeigen + // Zweitbetreuer anzeigen $htmlstr .= "\n"; - $htmlstr .= "\n"; $htmlstr .= "\n"; $htmlstr .= "\n"; @@ -545,122 +571,122 @@ $htmlstr .= "\n"; $result=@$db->db_query($qry); - while ($row=@$db->db_fetch_object($result)) +while ($row=@$db->db_fetch_object($result)) +{ + $htmlstr .= "\n"; + $htmlstr .= "\n"; + $htmlstr .= "\n"; + $htmlstr .= "\n"; + $htmlstr .= "\n"; + $htmlstr .= "\n"; + $htmlstr .= "\n"; + if(!$row->abgabedatum) { - $htmlstr .= "\n"; - $htmlstr .= "\n"; - $htmlstr .= "\n"; - $htmlstr .= "\n"; - $htmlstr .= "\n"; - $htmlstr .= "\n"; - $htmlstr .= "\n"; + if ($row->datumdatum>=date('Y-m-d')) && ($row->datumabgabedatum>$row->datum) + { + //Abgabe nach Termin - weiß auf hellrot + $bgcol='#EA7B7B'; + $fcol='#FFFFFF'; + } + else + { + //Abgabe vor Termin - schwarz auf grün + $bgcol='#00FF00'; + $fcol='#000000'; + } + } + //$htmlstr .= ""; + } + else + { + $htmlstr .= ""; + } + $htmlstr .= " \n"; + $htmlstr .= " \n"; + $htmlstr .= " \n"; + $htmlstr .= " \n"; + $htmlstr .= " \n"; + if($user==$row->insertvon && $betreuerart!="Zweitbegutachter") + { + $htmlstr .= " "; + if(!$row->abgabedatum) { - if ($row->datumdatum>=date('Y-m-d')) && ($row->datumt('global/loeschen')."' onclick='return confdel()' title='".$p->t('abgabetool/terminLoeschen')."'>"; } else { - if($row->abgabedatum>$row->datum) - { - //Abgabe nach Termin - weiß auf hellrot - $bgcol='#EA7B7B'; - $fcol='#FFFFFF'; - } - else - { - //Abgabe vor Termin - schwarz auf grün - $bgcol='#00FF00'; - $fcol='#000000'; - } + $htmlstr .= " "; } - //$htmlstr .= ""; - } - else - { - $htmlstr .= ""; - } - $htmlstr .= " \n"; - $htmlstr .= " \n"; - $htmlstr .= " \n"; - $htmlstr .= " \n"; - $htmlstr .= " \n"; - if($user==$row->insertvon && $betreuerart!="Zweitbegutachter") - { - $htmlstr .= " "; - - if(!$row->abgabedatum) - { - $htmlstr .= " "; - } - else - { - $htmlstr .= " "; - } - } - else - { - $htmlstr .= " "; - } - if(file_exists(PAABGABE_PATH.$row->paabgabe_id.'_'.$uid.'.pdf')) - { - $htmlstr .= " "; - } - else - { - $htmlstr .= " "; - } - if($row->abgabedatum && $row->paabgabetyp_kurzbz=="end") - { - $htmlstr .= " "; - } - else - { - $htmlstr .= " "; - } - $htmlstr .= " \n"; - - - $htmlstr .= "\n"; } + else + { + $htmlstr .= " "; + } + if(file_exists(PAABGABE_PATH.$row->paabgabe_id.'_'.$uid.'.pdf')) + { + $htmlstr .= " "; + } + else + { + $htmlstr .= " "; + } + if($row->abgabedatum && $row->paabgabetyp_kurzbz=="end") + { + $htmlstr .= " "; + } + else + { + $htmlstr .= " "; + } + $htmlstr .= " \n"; + + + $htmlstr .= "\n"; +} //Eingabezeile fuer neuen Termin $htmlstr .= ''."\n"; @@ -721,10 +747,16 @@ function sendZweitbegutachterMail($zweitbegutachter, $erstbegutachter_person_id, if (!$projektbetreuer) return $projektbetreuer; - $zweitbetr = $projektbetreuer->getZweitbegutachterWithToken($erstbegutachter_person_id, $zweitbegutachter->projektarbeit_id, $student->uid); + $zweitbetrRes = $projektbetreuer->getZweitbegutachterWithToken( + $erstbegutachter_person_id, + $zweitbegutachter->projektarbeit_id, + $student->uid, + $zweitbegutachter->person_id + ); - if ($zweitbetr) + if ($zweitbetrRes && isset($projektbetreuer->result[0])) { + $zweitbetr = $projektbetreuer->result[0]; $intern = isset($zweitbetr->uid); $mail_baselink = APP_ROOT."index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/Projektarbeitsbeurteilung"; $mail_fulllink = "$mail_baselink?projektarbeit_id=".$zweitbegutachter->projektarbeit_id."&uid=".$student->uid; diff --git a/cis/private/lehre/abgabe_student.php b/cis/private/lehre/abgabe_student.php index 2a328dd35..8782c84c1 100644 --- a/cis/private/lehre/abgabe_student.php +++ b/cis/private/lehre/abgabe_student.php @@ -1,248 +1,270 @@ - - * Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at > - * Rudolf Hangl < rudolf.hangl@technikum-wien.at > - * Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at > - */ - -require_once('../../../config/cis.config.inc.php'); -require_once('../../../include/functions.inc.php'); -require_once('../../../include/datum.class.php'); -require_once('../../../include/person.class.php'); -require_once('../../../include/benutzer.class.php'); -require_once('../../../include/student.class.php'); -require_once('../../../include/studiengang.class.php'); -require_once('../../../include/benutzerberechtigung.class.php'); -require_once('../../../include/phrasen.class.php'); - -$sprache = getSprache(); -$p = new phrasen($sprache); - -if (!$db = new basis_db()) - die($p->t('global/fehlerBeimOeffnenDerDatenbankverbindung')); - -$getuid=get_uid(); -$uid=$getuid; - -if(isset($_GET['uid'])) -{ - //Studentenansicht - $uid = $_GET['uid']; - //Rechte Pruefen - $allowed=false; - - $student = new student(); - if(!$student->load($uid)) - die($p->t('global/fehlerBeimErmittelnDerUID')); - - $stg_obj = new studiengang(); - if(!$stg_obj->load($student->studiengang_kz)) - die($p->t('global/fehlerBeimLesenAusDatenbank')); - - //Berechtigung ueber das Berechtigungssystem - $rechte = new benutzerberechtigung(); - $rechte->getBerechtigungen($getuid); - if($rechte->isBerechtigt('lehre/abgabetool',$stg_obj->oe_kurzbz,'s')) - $allowed=true; - - //oder Lektor mit Betreuung dieses Studenten - $qry = "SELECT 1 - FROM - lehre.tbl_projektarbeit - JOIN lehre.tbl_projektbetreuer USING(projektarbeit_id) - JOIN campus.vw_benutzer on(vw_benutzer.person_id=tbl_projektbetreuer.person_id) - WHERE - tbl_projektarbeit.student_uid=".$db->db_add_param($uid)." AND - vw_benutzer.uid=".$db->db_add_param($getuid).";"; - - if($result = $db->db_query($qry)) - { - if($db->db_num_rows($result)>0) - { - $allowed=true; - } - } - - if(!$allowed) - { - die($p->t('abgabetool/keineBerechtigungStudentenansicht')); - } -} -$htmlstr = ''; -$htmlstr1 = ''; -$vorname=''; -$nachname=''; -$zweitbetreuer = ''; - -$sql_query = "SELECT (SELECT nachname FROM public.tbl_person WHERE person_id=tbl_projektbetreuer.person_id) AS bnachname, - (SELECT vorname FROM public.tbl_person WHERE person_id=tbl_projektbetreuer.person_id) AS bvorname, - (SELECT titelpre FROM public.tbl_person WHERE person_id=tbl_projektbetreuer.person_id) AS btitelpre, - (SELECT titelpost FROM public.tbl_person WHERE person_id=tbl_projektbetreuer.person_id) AS btitelpost, - (SELECT person_id FROM lehre.tbl_projektbetreuer WHERE projektarbeit_id=tbl_projektarbeit.projektarbeit_id - AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter') LIMIT 1) AS zweitbetreuer_person_id, - (SELECT betreuerart_kurzbz FROM lehre.tbl_projektbetreuer WHERE projektarbeit_id=tbl_projektarbeit.projektarbeit_id - AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter') LIMIT 1) AS zweitbetreuer_betreuerart_kurzbz, - tbl_projektbetreuer.person_id AS betreuer_person_id, - tbl_projekttyp.bezeichnung AS prjbez, *, - lehre.tbl_projektbetreuer.note as note, - public.tbl_benutzer.aktiv as aktiv, - (SELECT abgeschicktvon FROM extension.tbl_projektarbeitsbeurteilung WHERE projektarbeit_id = tbl_projektarbeit.projektarbeit_id AND betreuer_person_id = tbl_projektbetreuer.person_id) AS babgeschickt, - (SELECT abgeschicktvon FROM extension.tbl_projektarbeitsbeurteilung WHERE projektarbeit_id = tbl_projektarbeit.projektarbeit_id AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter') LIMIT 1) AS zweitbetreuer_abgeschickt - FROM lehre.tbl_projektarbeit - LEFT JOIN lehre.tbl_projektbetreuer 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) - LEFT JOIN lehre.tbl_projekttyp USING (projekttyp_kurzbz) - WHERE (projekttyp_kurzbz='Bachelor' OR projekttyp_kurzbz='Diplom') - AND (tbl_projektbetreuer.betreuerart_kurzbz='Betreuer' - OR tbl_projektbetreuer.betreuerart_kurzbz='Begutachter' - OR tbl_projektbetreuer.betreuerart_kurzbz='Erstbetreuer' - OR tbl_projektbetreuer.betreuerart_kurzbz='Erstbegutachter') - AND tbl_projektarbeit.student_uid=".$db->db_add_param($uid)." - ORDER BY studiensemester_kurzbz desc, tbl_lehrveranstaltung.kurzbz"; - -//AND tbl_projektarbeit.student_uid='$getuid' 'ie07m102'; -if(!$erg=$db->db_query($sql_query)) -{ - $errormsg=$p->t('global/fehlerBeimLesenAusDatenbank'); -} -else -{ - $htmlstr .= "
".$p->t('abgabetool/student').": ".$db->convert_html_chars($studentenname).""; -$semester_benotbar = $num_rows_sem >= 1; +$semester_benotbar = $paIsCurrent >= 1; $endupload_vorhanden = $num_rows_endupload >= 1; if ($semester_benotbar && $endupload_vorhanden) @@ -498,30 +508,46 @@ else } $htmlstr .= "
" . $p->t('abgabetool/titel') . ": ".$db->convert_html_chars($titel)."".$p->t('abgabetool/studentenansicht')."
" . $p->t('abgabetool/zweitBegutachter') . ": " . $zweitbegutachter->voller_name . ""; - - // keine Mail -> Fehler anzeigen - if (!isset($zweitbegutachter->email)) - $htmlstr .= "  " . $p->t("; - - // Token senden button wenn Zweitbegutachter extern ist und Projektarbeit nicht für altes Semester ist - if (isset($zweitbegutachter->email) && !isset($zweitbegutachter->uid) && $num_rows_sem >= 1) + $htmlstr .= ""; + $bart = ''; + foreach($zweitbetreuerArr as $zweitbetreuer) { - $htmlstr .= "
\n"; - $htmlstr .= ""; - $htmlstr .= ""; - $htmlstr .= ""; - $htmlstr .= " email) . "' alt='" . $p->t('abgabetool/zweitbetreuerMailSenden', $zweitbegutachter->email) . "'/>\n"; - $htmlstr .= " \n"; - $htmlstr .= "
"; - } + if ($bart !== $zweitbetreuer->betreuerart_kurzbz) + { + $htmlstr .= ($zweitbetreuer->betreuerart_kurzbz == 'Senatspruefer' ? $p->t('abgabetool/senatsPruefer') : $p->t('abgabetool/zweitBegutachter')); + $htmlstr .= ": "; + $bart = $zweitbetreuer->betreuerart_kurzbz; + } + else + $htmlstr .= ", "; + $htmlstr .= "" . $zweitbetreuer->voller_name . ""; + + // keine Mail -> Fehler anzeigen + if (!isset($zweitbetreuer->email)) + $htmlstr .= "  " . $p->t("; + + // Token senden button wenn Zweitbegutachter extern ist und Projektarbeit nicht für altes Semester ist + if (isset($zweitbetreuer->email) && !isset($zweitbetreuer->uid) && $paIsCurrent >= 1) + { + $htmlstr .= "
\n"; + $htmlstr .= ""; + $htmlstr .= ""; + $htmlstr .= ""; + $htmlstr .= ""; + $htmlstr .= " voller_name, $zweitbetreuer->email)) . "' + alt='" . $p->t('abgabetool/zweitbetreuerMailSenden', array($zweitbetreuer->voller_name, $zweitbetreuer->email)) . "'/>\n"; + $htmlstr .= " "; + $htmlstr .= "
"; + } + } $htmlstr .= "
fixtermin=='t'?'checked=\"checked\"':'')." >"; + //$htmlstr .= "fixtermin=='t'?'checked="checked" style="background-color:#FF0000;"':'')." disabled>"; + if($row->fixtermin=='t') + { + $htmlstr .= "JN".($row->abgabedatum==''?' ':$datum_obj->formatDatum($row->abgabedatum,'d.m.Y'))."       fixtermin=='t'?'checked=\"checked\"':'')." >"; - //$htmlstr .= "fixtermin=='t'?'checked="checked" style="background-color:#FF0000;"':'')." disabled>"; - if($row->fixtermin=='t') - { - $htmlstr .= "JN".($row->abgabedatum==''?' ':$datum_obj->formatDatum($row->abgabedatum,'d.m.Y'))."                     PDF    zusätzliche Daten    
              PDF    zusätzliche Daten    
\n"; - $htmlstr .= "\n"; - $htmlstr .= " - - - - - - - - "; - $htmlstr .= "\n"; - $i = 0; - while($row=$db->db_fetch_object($erg)) - { - $htmlstr1 = ''; - $zweitbetreuer_obj = new person(); - if ($zweitbetreuer_obj->load($row->zweitbetreuer_person_id)) - { - $zweitbetreuer = ', '.$db->convert_html_chars($row->zweitbetreuer_betreuerart_kurzbz).': '.$zweitbetreuer_obj->titelpre.' '.$zweitbetreuer_obj->vorname.' '.$zweitbetreuer_obj->nachname.' '.$zweitbetreuer_obj->titelpost; - } - $htmlstr1 = ''.$db->convert_html_chars($row->betreuerart_kurzbz).': '; - $vorname=$row->vorname; - $nachname=$row->nachname; - $uid=$row->uid; - ($row->btitelpre!=''?$htmlstr1 .= $row->btitelpre.' ':$htmlstr1 .= ''); - $htmlstr1 .= $row->bvorname.' '.$row->bnachname; - ($row->btitelpost!=''?$htmlstr1 .= ' '.$row->btitelpost:$htmlstr1 .= ''); - $htmlstr1 .= $zweitbetreuer; - $htmlstr .= " \n"; //class='liste".($i%2)."' - - if (is_null($row->note) && $row->aktiv === 't') - $htmlstr .= " \n"; - elseif (!is_null($row->babgeschickt) || !is_null($row->zweitbetreuer_abgeschickt)) - { - $htmlstr .= ""; - } else - { - $htmlstr .= ""; - } - - - $htmlstr .= " \n"; - $htmlstr .= " \n"; - $htmlstr .= " "; - $htmlstr .= " \n"; - $htmlstr .= " \n"; - $htmlstr .= " \n"; -// $htmlstr .= " \n"; - $htmlstr .= " \n"; - $i++; - } - $htmlstr .= "
".$p->t('abgabetool/details')."".$p->t('lvplan/sem')."".$p->t('lvplan/stg')."".$p->t('global/mail')."".$p->t('abgabetool/betreuer')."".$p->t('abgabetool/typ')."".$p->t('abgabetool/titel')."
".$p->t('abgabetool/upload').""; - - if (!is_null($row->babgeschickt)) - $htmlstr .= "".$p->t('abgabetool/projektbeurteilungErstDownload').""; - - if (!is_null($row->babgeschickt) && !is_null($row->zweitbetreuer_abgeschickt)) - $htmlstr .= "/"; - - if (!is_null($row->zweitbetreuer_abgeschickt)) - $htmlstr .= "".$p->t('abgabetool/projektbeurteilungZweitDownload').""; - - $htmlstr .= "".$row->studiensemester_kurzbz."".strtoupper($row->typ.$row->kurzbz).""; - - $qry_betr="SELECT mitarbeiter_uid FROM public.tbl_person - JOIN public.tbl_benutzer USING(person_id) - JOIN public.tbl_mitarbeiter ON(uid=mitarbeiter_uid) - WHERE person_id=".$db->db_add_param($row->betreuer_person_id, FHC_INTEGER).";"; - if($result_betr=$db->db_query($qry_betr)) - { - if($row_betr=$db->db_fetch_object($result_betr)) - { - $htmlstr.="email"; - } - else - { - $htmlstr.="UID unknown!"; - } - } - $htmlstr .= " ".$htmlstr1." ".$db->convert_html_chars($row->prjbez)."".$db->convert_html_chars($row->titel)."".$db->convert_html_chars($row->betreuerart_kurzbz)."
\n"; -} -echo ' - - - - Abgabesystem_Studentensicht - - - - - - - - - - - - -'; - - echo '

'.$p->t('abgabetool/ueberschrift'); - if(trim($uid)!='') - echo " ($uid $vorname $nachname)
"; - echo '

'; - echo $htmlstr; - echo ' -'; -?> + + * Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at > + * Rudolf Hangl < rudolf.hangl@technikum-wien.at > + * Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at > + */ + +require_once('../../../config/cis.config.inc.php'); +require_once('../../../include/functions.inc.php'); +require_once('../../../include/datum.class.php'); +require_once('../../../include/person.class.php'); +require_once('../../../include/benutzer.class.php'); +require_once('../../../include/student.class.php'); +require_once('../../../include/studiengang.class.php'); +require_once('../../../include/projektbetreuer.class.php'); +require_once('../../../include/benutzerberechtigung.class.php'); +require_once('../../../include/phrasen.class.php'); + +$sprache = getSprache(); +$p = new phrasen($sprache); + +if (!$db = new basis_db()) + die($p->t('global/fehlerBeimOeffnenDerDatenbankverbindung')); + +$getuid=get_uid(); +$uid=$getuid; + +if(isset($_GET['uid'])) +{ + //Studentenansicht + $uid = $_GET['uid']; + //Rechte Pruefen + $allowed=false; + + $student = new student(); + if(!$student->load($uid)) + die($p->t('global/fehlerBeimErmittelnDerUID')); + + $stg_obj = new studiengang(); + if(!$stg_obj->load($student->studiengang_kz)) + die($p->t('global/fehlerBeimLesenAusDatenbank')); + + //Berechtigung ueber das Berechtigungssystem + $rechte = new benutzerberechtigung(); + $rechte->getBerechtigungen($getuid); + if($rechte->isBerechtigt('lehre/abgabetool',$stg_obj->oe_kurzbz,'s')) + $allowed=true; + + //oder Lektor mit Betreuung dieses Studenten + $qry = "SELECT 1 + FROM + lehre.tbl_projektarbeit + JOIN lehre.tbl_projektbetreuer USING(projektarbeit_id) + JOIN campus.vw_benutzer on(vw_benutzer.person_id=tbl_projektbetreuer.person_id) + WHERE + tbl_projektarbeit.student_uid=".$db->db_add_param($uid)." AND + vw_benutzer.uid=".$db->db_add_param($getuid).";"; + + if($result = $db->db_query($qry)) + { + if($db->db_num_rows($result)>0) + { + $allowed=true; + } + } + + if(!$allowed) + { + die($p->t('abgabetool/keineBerechtigungStudentenansicht')); + } +} +$htmlstr = ''; +$htmlstr1 = ''; +$vorname=''; +$nachname=''; +$zweitbetreuer = ''; +$senatspruefer = ''; + +$sql_query = "SELECT (SELECT nachname FROM public.tbl_person WHERE person_id=tbl_projektbetreuer.person_id) AS bnachname, + (SELECT vorname FROM public.tbl_person WHERE person_id=tbl_projektbetreuer.person_id) AS bvorname, + (SELECT titelpre FROM public.tbl_person WHERE person_id=tbl_projektbetreuer.person_id) AS btitelpre, + (SELECT titelpost FROM public.tbl_person WHERE person_id=tbl_projektbetreuer.person_id) AS btitelpost, + (SELECT person_id FROM lehre.tbl_projektbetreuer WHERE projektarbeit_id=tbl_projektarbeit.projektarbeit_id + AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter') LIMIT 1) AS zweitbetreuer_person_id, + (SELECT betreuerart_kurzbz FROM lehre.tbl_projektbetreuer WHERE projektarbeit_id=tbl_projektarbeit.projektarbeit_id + AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter') LIMIT 1) AS zweitbetreuer_betreuerart_kurzbz, + tbl_projektbetreuer.person_id AS betreuer_person_id, + tbl_projekttyp.bezeichnung AS prjbez, *, + lehre.tbl_projektbetreuer.note as note, + public.tbl_benutzer.aktiv as aktiv, + (SELECT abgeschicktvon FROM extension.tbl_projektarbeitsbeurteilung WHERE projektarbeit_id = tbl_projektarbeit.projektarbeit_id AND betreuer_person_id = tbl_projektbetreuer.person_id) AS babgeschickt, + (SELECT abgeschicktvon FROM extension.tbl_projektarbeitsbeurteilung WHERE projektarbeit_id = tbl_projektarbeit.projektarbeit_id AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter') LIMIT 1) AS zweitbetreuer_abgeschickt + FROM lehre.tbl_projektarbeit + LEFT JOIN lehre.tbl_projektbetreuer 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) + LEFT JOIN lehre.tbl_projekttyp USING (projekttyp_kurzbz) + WHERE (projekttyp_kurzbz='Bachelor' OR projekttyp_kurzbz='Diplom') + AND betreuerart_kurzbz IN ('Betreuer', 'Begutachter', 'Erstbegutachter', 'Senatsvorsitz') + AND tbl_projektarbeit.student_uid=".$db->db_add_param($uid)." + ORDER BY studiensemester_kurzbz desc, tbl_lehrveranstaltung.kurzbz"; + +//AND tbl_projektarbeit.student_uid='$getuid' 'ie07m102'; +if(!$erg=$db->db_query($sql_query)) +{ + $errormsg=$p->t('global/fehlerBeimLesenAusDatenbank'); +} +else +{ + $htmlstr .= "
\n"; + $htmlstr .= "\n"; + $htmlstr .= " + + + + + + + + "; + $htmlstr .= "\n"; + $i = 0; + while($row=$db->db_fetch_object($erg)) + { + // get zweitbetreuer, if any + $htmlstr1 = ''; + $zweitbetreuer_obj = new person(); + if ($zweitbetreuer_obj->load($row->zweitbetreuer_person_id)) + { + $zweitbetreuer = ', '.$db->convert_html_chars($row->zweitbetreuer_betreuerart_kurzbz).': '.$zweitbetreuer_obj->titelpre.' '.$zweitbetreuer_obj->vorname.' '.$zweitbetreuer_obj->nachname.' '.$zweitbetreuer_obj->titelpost; + } + $htmlstr1 = ''.$db->convert_html_chars($row->betreuerart_kurzbz).': '; + + // get senatspruefer, if any + if ($row->betreuerart_kurzbz == 'Senatsvorsitz') + { + $senatspruefer_obj = new projektbetreuer(); + $senatsprueferRes = $senatspruefer_obj->getZweitbegutachterWithToken($row->betreuer_person_id, $row->projektarbeit_id, $row->uid); + if ($senatsprueferRes) + { + $senatspruefer .= ', Senatsprüfer: '; + $first = true; + foreach($senatspruefer_obj->result as $spr) + { + if (!$first) + $senatspruefer .= ', '; + $senatspruefer .= $spr->voller_name; + $first = false; + } + } + } + + $vorname=$row->vorname; + $nachname=$row->nachname; + $uid=$row->uid; + + ($row->btitelpre!=''?$htmlstr1 .= $row->btitelpre.' ':$htmlstr1 .= ''); + $htmlstr1 .= $row->bvorname.' '.$row->bnachname; + ($row->btitelpost!=''?$htmlstr1 .= ' '.$row->btitelpost:$htmlstr1 .= ''); + $htmlstr1 .= $zweitbetreuer; + $htmlstr1 .= $senatspruefer; + $htmlstr .= " \n"; //class='liste".($i%2)."' + + if (is_null($row->note) && $row->aktiv === 't') + $htmlstr .= " \n"; + elseif (!is_null($row->babgeschickt) || !is_null($row->zweitbetreuer_abgeschickt)) + { + $htmlstr .= ""; + } else + { + $htmlstr .= ""; + } + + + $htmlstr .= " \n"; + $htmlstr .= " \n"; + $htmlstr .= " "; + $htmlstr .= " \n"; + $htmlstr .= " \n"; + $htmlstr .= " \n"; +// $htmlstr .= " \n"; + $htmlstr .= " \n"; + $i++; + } + $htmlstr .= "
".$p->t('abgabetool/details')."".$p->t('lvplan/sem')."".$p->t('lvplan/stg')."".$p->t('global/mail')."".$p->t('abgabetool/betreuer')."".$p->t('abgabetool/typ')."".$p->t('abgabetool/titel')."
".$p->t('abgabetool/upload').""; + + if (!is_null($row->babgeschickt)) + $htmlstr .= "".$p->t('abgabetool/projektbeurteilungErstDownload').""; + + if (!is_null($row->babgeschickt) && !is_null($row->zweitbetreuer_abgeschickt)) + $htmlstr .= "/"; + + if (!is_null($row->zweitbetreuer_abgeschickt)) + $htmlstr .= "".$p->t('abgabetool/projektbeurteilungZweitDownload').""; + + $htmlstr .= "".$row->note."".$row->studiensemester_kurzbz."".strtoupper($row->typ.$row->kurzbz).""; + + $qry_betr="SELECT mitarbeiter_uid FROM public.tbl_person + JOIN public.tbl_benutzer USING(person_id) + JOIN public.tbl_mitarbeiter ON(uid=mitarbeiter_uid) + WHERE person_id=".$db->db_add_param($row->betreuer_person_id, FHC_INTEGER).";"; + if($result_betr=$db->db_query($qry_betr)) + { + if($row_betr=$db->db_fetch_object($result_betr)) + { + $htmlstr.="email"; + } + else + { + $htmlstr.="UID unknown!"; + } + } + $htmlstr .= " ".$htmlstr1." ".$db->convert_html_chars($row->prjbez)."".$db->convert_html_chars($row->titel)."".$db->convert_html_chars($row->betreuerart_kurzbz)."
\n"; +} +echo ' + + + + Abgabesystem_Studentensicht + + + + + + + + + + + + +'; + + echo '

'.$p->t('abgabetool/ueberschrift'); + if(trim($uid)!='') + echo " ($uid $vorname $nachname)
"; + echo '

'; + echo $htmlstr; + echo ' +'; +?> diff --git a/cis/private/lehre/abgabe_student_details.php b/cis/private/lehre/abgabe_student_details.php index 29d74ab66..bead1a1e9 100644 --- a/cis/private/lehre/abgabe_student_details.php +++ b/cis/private/lehre/abgabe_student_details.php @@ -435,6 +435,8 @@ if($command=="update" && $error!=true) // 1. Begutachter mail ohne Token $mail_baselink = APP_ROOT."index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/Projektarbeitsbeurteilung"; $mail_fulllink = "$mail_baselink?projektarbeit_id=".$projektarbeit_id."&uid=".$row_std->uid; + $projekttyp_kurzbz = $projektarbeit_obj->projekttyp_kurzbz; + $subject = $projektarbeit_obj->projekttyp_kurzbz == 'Diplom' ? 'Masterarbeitsbetreuung' : 'Bachelorarbeitsbetreuung'; $abgabetyp = $paabgabetyp_kurzbz == 'end' ? 'Endabgabe' : 'Zwischenabgabe'; $maildata = array(); @@ -452,7 +454,7 @@ if($command=="update" && $error!=true) 'ParbeitsbeurteilungEndupload', $maildata, $row_betr->mitarbeiter_uid."@".DOMAIN, - "Bachelor-/Masterarbeitsbetreuung", + $subject, 'sancho_header_min_bw.jpg', 'sancho_footer_min_bw.jpg', $user."@".DOMAIN); @@ -465,48 +467,63 @@ if($command=="update" && $error!=true) // 2. Begutachter mail, wenn Endabgabe, mit Token wenn extern if ($paabgabetyp_kurzbz == 'end') { - $projektbetreuer = new projektbetreuer(); - $zweitbetr = $projektbetreuer->getZweitbegutachterWithToken($bid, $projektarbeit_id, $row_std->uid); + // Zweitbegutachter holen + $zweitbegutachter = new projektbetreuer(); + $zweitbegutachterRes = $zweitbegutachter->getZweitbegutachterWithToken($bid, $projektarbeit_id, $row_std->uid); - if ($zweitbetr) + if ($zweitbegutachterRes) { - $tokenGenRes = $projektbetreuer->generateZweitbegutachterToken($zweitbetr->person_id, $projektarbeit_id); + $zweitbegutachterResults = $zweitbegutachter->result; - if (!$tokenGenRes) - echo "" . $p->t('abgabetool/fehlerMailZweitBegutachter') . "
 "; - - $zweitbetr = $projektbetreuer->getZweitbegutachterWithToken($bid, $projektarbeit_id, $row_std->uid); - - if (!$zweitbetr) - echo "" . $p->t('abgabetool/fehlerMailZweitBegutachter') . "
 "; - - $intern = isset($zweitbetr->uid); - $mail_link = $intern ? $mail_fulllink : $mail_baselink; - - $zweitbetmaildata = array(); - $zweitbetmaildata['geehrt'] = "geehrte" . ($zweitbetr->anrede == "Herr" ? "r" : ""); - $zweitbetmaildata['anrede'] = $zweitbetr->anrede; - $zweitbetmaildata['betreuer_voller_name'] = $zweitbetr->voller_name; - $zweitbetmaildata['student_anrede'] = $maildata['student_anrede']; - $zweitbetmaildata['student_voller_name'] = $maildata['student_voller_name']; - $zweitbetmaildata['abgabetyp'] = $abgabetyp; - $zweitbetmaildata['parbeituebersichtlink'] = $intern ? $maildata['parbeituebersichtlink'] : ""; - $zweitbetmaildata['bewertunglink'] = $num_rows_sem >= 1 ? "

Zur Beurteilung der Arbeit

" : ""; - $zweitbetmaildata['token'] = $num_rows_sem >= 1 && isset($zweitbetr->zugangstoken) && !$intern ? "

Zugangstoken: " . $zweitbetr->zugangstoken . "

" : ""; - - $mailres = sendSanchoMail( - 'ParbeitsbeurteilungEndupload', - $zweitbetmaildata, - $zweitbetr->email, - "Masterarbeitsbetreuung", - 'sancho_header_min_bw.jpg', - 'sancho_footer_min_bw.jpg', - $user . "@" . DOMAIN - ); - - if (!$mailres) + foreach ($zweitbegutachterResults as $begutachter) { - echo "" . $p->t('abgabetool/fehlerMailZweitBegutachter') . "
 "; + // token generieren, wenn noch nicht vorhanden und notwendig (wird in methode überprüft) + $tokenGenRes = $zweitbegutachter->generateZweitbegutachterToken($begutachter->person_id, $projektarbeit_id); + + if (!$tokenGenRes) + echo "" . $p->t('abgabetool/fehlerMailZweitBegutachter') . "
 "; + + // Zweitbegutachter (evtl. mit Token) holen + $zweitbegutachterMitToken = new projektbetreuer(); + $begutachterMitTokenRes = $zweitbegutachterMitToken->getZweitbegutachterWithToken($bid, $projektarbeit_id, $row_std->uid, $begutachter->person_id); + + if (!$begutachterMitTokenRes) + echo "" . $p->t('abgabetool/fehlerMailZweitBegutachter') . "
 "; + + // Email an Zweitbegutachter senden + if (isset($zweitbegutachterMitToken->result[0])) + { + $begutachterMitToken = $zweitbegutachterMitToken->result[0]; + + $intern = isset($begutachterMitToken->uid); + $mail_link = $intern ? $mail_fulllink : $mail_baselink; + + $zweitbetmaildata = array(); + $zweitbetmaildata['geehrt'] = "geehrte" . ($begutachterMitToken->anrede == "Herr" ? "r" : ""); + $zweitbetmaildata['anrede'] = $begutachterMitToken->anrede; + $zweitbetmaildata['betreuer_voller_name'] = $begutachterMitToken->voller_name; + $zweitbetmaildata['student_anrede'] = $maildata['student_anrede']; + $zweitbetmaildata['student_voller_name'] = $maildata['student_voller_name']; + $zweitbetmaildata['abgabetyp'] = $abgabetyp; + $zweitbetmaildata['parbeituebersichtlink'] = $intern ? $maildata['parbeituebersichtlink'] : ""; + $zweitbetmaildata['bewertunglink'] = $num_rows_sem >= 1 ? "

Zur Beurteilung der Arbeit

" : ""; + $zweitbetmaildata['token'] = $num_rows_sem >= 1 && isset($begutachterMitToken->zugangstoken) && !$intern ? "

Zugangstoken: " . $begutachterMitToken->zugangstoken . "

" : ""; + + $mailres = sendSanchoMail( + 'ParbeitsbeurteilungEndupload', + $zweitbetmaildata, + $begutachterMitToken->email, + $subject, + 'sancho_header_min_bw.jpg', + 'sancho_footer_min_bw.jpg', + $user . "@" . DOMAIN + ); + + if (!$mailres) + { + echo "" . $p->t('abgabetool/fehlerMailZweitBegutachter') . "
 "; + } + } } } } diff --git a/include/projektbetreuer.class.php b/include/projektbetreuer.class.php index 04ba36b26..e55ad08d1 100644 --- a/include/projektbetreuer.class.php +++ b/include/projektbetreuer.class.php @@ -395,40 +395,66 @@ class projektbetreuer extends basis_db * @param $erstbegutachter_person_id int person_id des Erstbegutachters * @param $projektarbeit_id int * @param $student_uid string uid des Studenten der Arbeit abgibt + * @param $zweitbegutachter_person_id int person_id des Zweitbegutachters (wenn mehrere Zweitbetreuer zu einem Erstbegutachter erwartet werden) * @return object | bool */ - public function getZweitbegutachterWithToken($erstbegutachter_person_id, $projektarbeit_id, $student_uid) + public function getZweitbegutachterWithToken($erstbegutachter_person_id, $projektarbeit_id, $student_uid, $zweitbegutachter_person_id = null) { - $qry_betr="SELECT betr.person_id, betr.projektarbeit_id, pers.anrede, betr.zugangstoken, betr.zugangstoken_gueltigbis, tbl_benutzer.uid, kontakt, + $qry_betr="SELECT DISTINCT ON (betr.person_id) betr.person_id, betr.projektarbeit_id, pers.anrede, betr.zugangstoken, betr.zugangstoken_gueltigbis, + tbl_benutzer.uid, kontakt, betr.betreuerart_kurzbz, trim(COALESCE(titelpre,'')||' '||COALESCE(vorname,'')||' '||COALESCE(nachname,'')||' '||COALESCE(titelpost,'')) as voller_name, CASE WHEN tbl_benutzer.uid IS NULL THEN kontakt ELSE tbl_benutzer.uid || '@".DOMAIN."' END AS email, abg.abgabedatum FROM lehre.tbl_projektbetreuer betr - JOIN lehre.tbl_projektarbeit parb ON betr.projektarbeit_id = parb.projektarbeit_id + JOIN lehre.tbl_projektarbeit parb ON betr.projektarbeit_id = parb.projektarbeit_id JOIN public.tbl_person pers ON betr.person_id = pers.person_id LEFT JOIN public.tbl_kontakt ON pers.person_id = tbl_kontakt.person_id AND kontakttyp = 'email' AND zustellung = true LEFT JOIN public.tbl_benutzer ON pers.person_id = tbl_benutzer.person_id LEFT JOIN campus.tbl_paabgabe abg ON betr.projektarbeit_id = abg.projektarbeit_id AND abg.paabgabetyp_kurzbz = 'end' - WHERE betr.betreuerart_kurzbz = 'Zweitbegutachter' + WHERE + ( + ( + betr.betreuerart_kurzbz = 'Zweitbegutachter' + AND EXISTS ( + SELECT 1 FROM lehre.tbl_projektbetreuer + WHERE person_id = ".$this->db_add_param($erstbegutachter_person_id, FHC_INTEGER)." + AND betreuerart_kurzbz = 'Erstbegutachter' + AND projektarbeit_id = betr.projektarbeit_id + ) + ) + OR + ( + betr.betreuerart_kurzbz = 'Senatspruefer' + AND EXISTS ( + SELECT 1 FROM lehre.tbl_projektbetreuer + WHERE person_id = ".$this->db_add_param($erstbegutachter_person_id, FHC_INTEGER)." + AND betreuerart_kurzbz = 'Senatsvorsitz' + AND projektarbeit_id = betr.projektarbeit_id + ) + ) + ) AND betr.projektarbeit_id = ".$this->db_add_param($projektarbeit_id, FHC_INTEGER)." AND parb.student_uid = ".$this->db_add_param($student_uid)." - AND EXISTS ( - SELECT 1 FROM lehre.tbl_projektbetreuer - WHERE person_id = ".$this->db_add_param($erstbegutachter_person_id, FHC_INTEGER)." - AND betreuerart_kurzbz = 'Erstbegutachter' - AND projektarbeit_id = betr.projektarbeit_id - ) - AND (tbl_benutzer.aktiv OR tbl_benutzer.aktiv IS NULL) - ORDER BY betr.insertamum DESC - LIMIT 1"; + AND (tbl_benutzer.aktiv OR tbl_benutzer.aktiv IS NULL)"; + + if (isset($zweitbegutachter_person_id)) + { + $qry_betr .= " AND betr.person_id = ".$this->db_add_param($zweitbegutachter_person_id, FHC_INTEGER); + } + + $qry_betr .= " ORDER BY betr.person_id DESC, + (CASE WHEN EXISTS ( /* if multiple accounts, prioritize mitarbeiter */ + SELECT 1 FROM public.tbl_mitarbeiter ma + WHERE ma.mitarbeiter_uid = tbl_benutzer.uid + ) THEN 0 ELSE 1 END), betr.insertamum DESC"; if ($betr=$this->db_query($qry_betr)) { - $row_betr = $this->db_fetch_object($betr); - - if ($row_betr) - return $row_betr; - else - return false; + $result = array(); + while ($row_betr = $this->db_fetch_object()) + { + $this->result[] = $row_betr; + } + return true; } else { @@ -451,7 +477,7 @@ class projektbetreuer extends basis_db LEFT JOIN public.tbl_benutzer USING(person_id) WHERE projektarbeit_id = ".$this->db_add_param($projektarbeit_id, FHC_INTEGER)." AND tbl_projektbetreuer.person_id = ".$this->db_add_param($zweitbegutachter_person_id, FHC_INTEGER)." - AND betreuerart_kurzbz = 'Zweitbegutachter' + AND betreuerart_kurzbz IN ('Zweitbegutachter', 'Senatspruefer') LIMIT 1"; if ($betreueruidres = $this->db_query($betreuerUidQry)) @@ -494,7 +520,7 @@ class projektbetreuer extends basis_db zugangstoken_gueltigbis = CURRENT_DATE + interval '1 year' WHERE projektarbeit_id = " . $this->db_add_param($projektarbeit_id, FHC_INTEGER) . " AND person_id = " . $this->db_add_param($row_betr->person_id, FHC_INTEGER) . " - AND betreuerart_kurzbz = 'Zweitbegutachter'"; + AND betreuerart_kurzbz IN ('Zweitbegutachter', 'Senatspruefer')"; if ($this->db_query($qry_upd)) { diff --git a/locale/de-AT/abgabetool.php b/locale/de-AT/abgabetool.php index c4b17318b..e52b91c9a 100644 --- a/locale/de-AT/abgabetool.php +++ b/locale/de-AT/abgabetool.php @@ -83,12 +83,13 @@ $this->phrasen['abgabetool/gelesenUndAkzeptiert']='Gelesen und akzeptiert'; $this->phrasen['abgabetool/erklaerungNichtAkzeptiert']='Erklärung nicht akzeptiert'; $this->phrasen['abgabetool/downloadProjektarbeit']='Dokument herunterladen'; $this->phrasen['abgabetool/zweitBegutachter']='ZweitbegutachterIn'; -$this->phrasen['abgabetool/zweitbetreuerTokenMailSenden']='Zugangstoken an ZweitbegutachterIn noch einmal senden'; -$this->phrasen['abgabetool/zweitbegutachterMailGesendet']='Mail an ZweitbegutachterIn (%s) gesendet'; -$this->phrasen['abgabetool/zweitbetreuerMailSenden']='Mail an ZweitbegutachterIn (%s) senden'; -$this->phrasen['abgabetool/zweitBegutachterEmailFehlt']='keine Zustellmail für Zweitbegutachter vorhanden!'; +$this->phrasen['abgabetool/zweitbetreuerTokenMailSenden']='Zugangstoken noch einmal senden'; +$this->phrasen['abgabetool/zweitbegutachterMailGesendet']='Mail an %s (%s) gesendet'; +$this->phrasen['abgabetool/zweitbetreuerMailSenden']='Mail an %s (%s) senden'; +$this->phrasen['abgabetool/zweitBegutachterEmailFehlt']='keine Zustellmail vorhanden!'; $this->phrasen['abgabetool/projektbeurteilungDownload']='Projektbeurteilung herunterladen'; $this->phrasen['abgabetool/projektbeurteilungErstDownload']='Erst-/Begutachter'; $this->phrasen['abgabetool/projektbeurteilungZweitDownload']='Zweitbegutachter'; $this->phrasen['abgabetool/fehlerErmittelnEndabgabeProjektarbeit']='Fehler beim Ermitteln des Enduplaods der Projektarbeit'; +$this->phrasen['abgabetool/senatsPruefer']='Prüfer'; ?> diff --git a/locale/en-US/abgabetool.php b/locale/en-US/abgabetool.php index b05456faa..27a885a11 100644 --- a/locale/en-US/abgabetool.php +++ b/locale/en-US/abgabetool.php @@ -84,11 +84,12 @@ $this->phrasen['abgabetool/erklaerungNichtAkzeptiert']='Declaration not accepted $this->phrasen['abgabetool/downloadProjektarbeit']='Download File'; $this->phrasen['abgabetool/zweitBegutachter']='Second assessor'; $this->phrasen['abgabetool/zweitbetreuerTokenMailSenden']='Resend access token to second assessor'; -$this->phrasen['abgabetool/zweitbetreuerMailSenden']='Send mail to second assessor (%s)'; -$this->phrasen['abgabetool/zweitbegutachterMailGesendet']='Mail sent to second assessor (%s)'; -$this->phrasen['abgabetool/zweitBegutachterEmailFehlt']='Second assessor has no delivery mail adress!'; +$this->phrasen['abgabetool/zweitbetreuerMailSenden']='Send mail to assessor %s (%s)'; +$this->phrasen['abgabetool/zweitbegutachterMailGesendet']='Mail sent to assessor %s (%s)'; +$this->phrasen['abgabetool/zweitBegutachterEmailFehlt']='Assessor has no delivery mail adress!'; $this->phrasen['abgabetool/projektbeurteilungDownload']='Thesis-Assessment download'; $this->phrasen['abgabetool/projektbeurteilungErstDownload']='First-/Assessor'; $this->phrasen['abgabetool/projektbeurteilungZweitDownload']='Second Assessor'; $this->phrasen['abgabetool/fehlerErmittelnEndabgabeProjektarbeit']='Error when getting endupload of project work'; +$this->phrasen['abgabetool/senatsPruefer']='Examiner'; ?> diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index ca59997fa..7f051459d 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -10389,6 +10389,26 @@ Any unusual occurrences ) ) ), + array( + 'app' => 'projektarbeitsbeurteilung', + 'category' => 'projektarbeitsbeurteilung', + 'phrase' => 'senatsvorsitz', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Senatsvorsitz', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Assessor', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'anrechnung', diff --git a/vilesci/lehre/abgabe_assistenz.php b/vilesci/lehre/abgabe_assistenz.php index 3c939a330..4de70fd31 100644 --- a/vilesci/lehre/abgabe_assistenz.php +++ b/vilesci/lehre/abgabe_assistenz.php @@ -149,11 +149,7 @@ else LEFT JOIN PUBLIC.tbl_benutzer ON (PUBLIC.tbl_benutzer.person_id = PUBLIC.tbl_person.person_id) LEFT JOIN PUBLIC.tbl_mitarbeiter ON (PUBLIC.tbl_benutzer.uid = PUBLIC.tbl_mitarbeiter.mitarbeiter_uid) WHERE projektarbeit_id = ".$db->db_add_param($row->projektarbeit_id, FHC_INTEGER)." - AND ( - tbl_projektbetreuer.betreuerart_kurzbz = 'Erstbegutachter' - OR tbl_projektbetreuer.betreuerart_kurzbz = 'Betreuer' - OR tbl_projektbetreuer.betreuerart_kurzbz = 'Begutachter' - ) + AND tbl_projektbetreuer.betreuerart_kurzbz IN ('Erstbegutachter', 'Betreuer', 'Begutachter', 'Senatsvorsitz') UNION From a1622d8b7473a1ab0f00b3ea5156405b0a9d142c Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Wed, 24 Aug 2022 17:05:30 +0200 Subject: [PATCH 025/279] made betreuert SenatsprueferIn gender neutral --- system/dbupdate_3.3.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 515a80bf5..e362bedba 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -6292,7 +6292,7 @@ if($result = $db->db_query("SELECT 1 FROM lehre.tbl_betreuerart WHERE betreuerar { if($db->db_num_rows($result)==0) { - $qry = "INSERT INTO lehre.tbl_betreuerart(betreuerart_kurzbz, beschreibung) VALUES('Senatspruefer', 'Senatsprüfer kommissionelle Prüfung');"; + $qry = "INSERT INTO lehre.tbl_betreuerart(betreuerart_kurzbz, beschreibung) VALUES('Senatspruefer', 'SenatsprüferIn kommissionelle Prüfung');"; if(!$db->db_query($qry)) echo 'Betreuerart: '.$db->db_last_error().'
'; From 1d5d5e4a84b575af9a98ae7f694cdc95d80972f8 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Wed, 24 Aug 2022 18:07:34 +0200 Subject: [PATCH 026/279] added getEndabgabe method to Paabgabe model --- .../models/education/Paabgabe_model.php | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/application/models/education/Paabgabe_model.php b/application/models/education/Paabgabe_model.php index 087c27663..b876030a6 100644 --- a/application/models/education/Paabgabe_model.php +++ b/application/models/education/Paabgabe_model.php @@ -1,7 +1,6 @@ dbTable = 'campus.tbl_paabgabe'; $this->pk = 'paabgabe_id'; } + + /** + * Gets last Endabgabe of a Projektarbeit, including filename. + * @param int $projektarbeit_id + * @return object + */ + public function getEndabgabe($projektarbeit_id) + { + $qry = "SELECT paabgabe_id, student_uid, paabg.datum, paabg.abgabedatum, projekttyp_kurzbz, titel, titel_english, + paabgabe_id || '_' || student_uid || '.pdf' AS filename + FROM campus.tbl_paabgabe paabg + JOIN lehre.tbl_projektarbeit USING (projektarbeit_id) + WHERE projektarbeit_id = ? + AND paabgabetyp_kurzbz = 'end' + AND paabg.abgabedatum IS NOT NULL + ORDER BY paabg.abgabedatum, paabg.datum DESC + LIMIT 1"; + + return $this->execQuery($qry, array($projektarbeit_id)); + } } From 2125fdc21913ab563a3b3b4c444b65059b40c449 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Wed, 24 Aug 2022 18:09:30 +0200 Subject: [PATCH 027/279] sending of zweitbetreuer mail with token: correct subject depending on projekttyp --- cis/private/lehre/abgabe_lektor_details.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cis/private/lehre/abgabe_lektor_details.php b/cis/private/lehre/abgabe_lektor_details.php index ed33add27..852529d53 100644 --- a/cis/private/lehre/abgabe_lektor_details.php +++ b/cis/private/lehre/abgabe_lektor_details.php @@ -119,6 +119,7 @@ if(!$projektarbeit_obj->load($projektarbeit_id)) die('Fehler beim Laden der Projektarbeit'); $titel = $projektarbeit_obj->titel; $student_uid = $projektarbeit_obj->student_uid; +$projekttyp_kurzbz = $projektarbeit_obj->projekttyp_kurzbz; // paarbeit sollte nur ab bestimmten Zeitpunkt online bewertet werden $paIsCurrent = $projektarbeit_obj->projektarbeitIsCurrent($projektarbeit_id); @@ -179,7 +180,7 @@ if(in_array($betreuerart, array('Erstbegutacher', 'Senatsvorsitz'))) // if Zweitbetreuer is the one for which token was requested, send mail if ($zbg->person_id == $_GET['zweitbetreuer_person_id']) { - $mailres = sendZweitbegutachterMail($zbg, $erstbetreuer_id, $row_std); + $mailres = sendZweitbegutachterMail($zbg, $erstbetreuer_id, $row_std, $projekttyp_kurzbz); if ($mailres) { @@ -734,7 +735,7 @@ echo $htmlstr; * @param object $student * @return bool|projektbetreuer|void|null */ -function sendZweitbegutachterMail($zweitbegutachter, $erstbegutachter_person_id, $student) +function sendZweitbegutachterMail($zweitbegutachter, $erstbegutachter_person_id, $student, $projekttyp_kurzbz) { if (!isset($zweitbegutachter->email) || $zweitbegutachter->email == '') return false; @@ -758,6 +759,7 @@ function sendZweitbegutachterMail($zweitbegutachter, $erstbegutachter_person_id, { $zweitbetr = $projektbetreuer->result[0]; $intern = isset($zweitbetr->uid); + $mail_subject = $projekttyp_kurzbz == 'Diplom' ? "Masterarbeitsbetreuung" : "Bachelorarbeitsbetreuung"; $mail_baselink = APP_ROOT."index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/Projektarbeitsbeurteilung"; $mail_fulllink = "$mail_baselink?projektarbeit_id=".$zweitbegutachter->projektarbeit_id."&uid=".$student->uid; $mail_link = $intern ? $mail_fulllink : $mail_baselink; @@ -777,7 +779,7 @@ function sendZweitbegutachterMail($zweitbegutachter, $erstbegutachter_person_id, 'ParbeitsbeurteilungEndupload', $maildata, $zweitbetr->email, - "Masterarbeitsbetreuung", + $mail_subject, 'sancho_header_min_bw.jpg', 'sancho_footer_min_bw.jpg' ); From 60d675f22b1a316d8bcb321dd08f5545c056d8d3 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Wed, 24 Aug 2022 18:09:53 +0200 Subject: [PATCH 028/279] added parbeitDownload phrases for Projektarbeitsbeurteilung --- system/phrasesupdate.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 7f051459d..db9a33812 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -10409,6 +10409,26 @@ Any unusual occurrences ) ) ), + array( + 'app' => 'projektarbeitsbeurteilung', + 'category' => 'projektarbeitsbeurteilung', + 'phrase' => 'parbeitDownload', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Download Projektarbeit', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Download thesis', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'anrechnung', From 1d408b9d65e475c2e3eeda9a79c48f0325b66474 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Wed, 24 Aug 2022 19:39:31 +0200 Subject: [PATCH 029/279] added comment to getZweitbegutachterWithToken method in projektbetreuer class --- include/projektbetreuer.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/projektbetreuer.class.php b/include/projektbetreuer.class.php index e55ad08d1..1fe2a5e1a 100644 --- a/include/projektbetreuer.class.php +++ b/include/projektbetreuer.class.php @@ -421,7 +421,7 @@ class projektbetreuer extends basis_db AND projektarbeit_id = betr.projektarbeit_id ) ) - OR + OR /* either Zweitbegutachter of masterarbeit, or Kommissionsprüfer if Kommission */ ( betr.betreuerart_kurzbz = 'Senatspruefer' AND EXISTS ( From 2ff067193d868ca43b6919e14d17748f4d661e23 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Wed, 24 Aug 2022 19:39:59 +0200 Subject: [PATCH 030/279] added Senatsvorsitz to betreuerart kurzbz in pdfExport --- cis/private/pdfExport.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cis/private/pdfExport.php b/cis/private/pdfExport.php index 99b5c94f0..2743205d1 100644 --- a/cis/private/pdfExport.php +++ b/cis/private/pdfExport.php @@ -150,14 +150,14 @@ if (isset($_GET['betreuerart_kurzbz'])) if (isset($_GET['xsl']) && $_GET['xsl'] == 'Zahlung') { $requestdata = $_SERVER['QUERY_STRING']; - + $log = new Webservicelog(); $log->webservicetyp_kurzbz = 'content'; $log->request_id = isset($_GET['buchungsnummern']) && !empty($_GET['buchungsnummern']) ? $_GET['buchungsnummern'] : NULL; $log->beschreibung = 'Zahlungsbestaetigungsdownload'; $log->request_data = $requestdata; $log->execute_user = get_uid(); - + $log->save(true); } @@ -207,6 +207,7 @@ if (isset($_GET['xsl']) && ($_GET['xsl'] === 'Projektbeurteilung')) switch ($_GET['betreuerart_kurzbz']) { case 'Begutachter' : + case 'Senatsvorsitz' : $xsl = 'ProjektBeurteilungBA'; break; case 'Erstbegutachter' : From 92762c5dc2ace2b6cf61c641f880c97719b64996 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Sat, 27 Aug 2022 01:34:03 +0200 Subject: [PATCH 031/279] Projektarbeitsbeurteilung: - getZweitbegutachterWithToken: returns Zweitbegutachter (Senatspruefer) from Senatspruefungen as well - added phrase --- .../education/Projektbetreuer_model.php | 66 +++++++++++++------ system/phrasesupdate.php | 20 ++++++ 2 files changed, 67 insertions(+), 19 deletions(-) diff --git a/application/models/education/Projektbetreuer_model.php b/application/models/education/Projektbetreuer_model.php index f6205f67f..d23342c85 100644 --- a/application/models/education/Projektbetreuer_model.php +++ b/application/models/education/Projektbetreuer_model.php @@ -106,8 +106,10 @@ class Projektbetreuer_model extends DB_Model * @param $student_uid string uid des Studenten der Arbeit abgibt * @return object | bool */ - public function getZweitbegutachterWithToken($erstbegutachter_person_id, $projektarbeit_id, $student_uid) + public function getZweitbegutachterWithToken($erstbegutachter_person_id, $projektarbeit_id, $student_uid, $zweitbegutachter_person_id = null) { + $params = array($erstbegutachter_person_id, $erstbegutachter_person_id, $projektarbeit_id, $student_uid); + $qry_betr = "SELECT betr.person_id, betr.projektarbeit_id, pers.anrede, betr.zugangstoken, betr.zugangstoken_gueltigbis, tbl_benutzer.uid, kontakt, trim(COALESCE(titelpre,'')||' '||COALESCE(vorname,'')||' '||COALESCE(nachname,'')||' '||COALESCE(titelpost,'')) as voller_name, CASE WHEN tbl_benutzer.uid IS NULL THEN kontakt ELSE tbl_benutzer.uid || '@".DOMAIN."' END AS email, abg.abgabedatum @@ -117,20 +119,46 @@ class Projektbetreuer_model extends DB_Model LEFT JOIN public.tbl_kontakt ON pers.person_id = tbl_kontakt.person_id AND kontakttyp = 'email' AND zustellung = true LEFT JOIN public.tbl_benutzer ON pers.person_id = tbl_benutzer.person_id LEFT JOIN campus.tbl_paabgabe abg ON betr.projektarbeit_id = abg.projektarbeit_id AND abg.paabgabetyp_kurzbz = 'end' - WHERE betr.betreuerart_kurzbz = 'Zweitbegutachter' + WHERE + ( + ( + betr.betreuerart_kurzbz = 'Zweitbegutachter' + AND EXISTS ( + SELECT 1 FROM lehre.tbl_projektbetreuer + WHERE person_id = ? + AND betreuerart_kurzbz = 'Erstbegutachter' + AND projektarbeit_id = betr.projektarbeit_id + ) + ) + OR /* either Zweitbegutachter of masterarbeit, or Kommissionsprüfer if Kommission */ + ( + betr.betreuerart_kurzbz = 'Senatspruefer' + AND EXISTS ( + SELECT 1 FROM lehre.tbl_projektbetreuer + WHERE person_id = ? + AND betreuerart_kurzbz = 'Senatsvorsitz' + AND projektarbeit_id = betr.projektarbeit_id + ) + ) + ) AND betr.projektarbeit_id = ? AND parb.student_uid = ? - AND EXISTS ( - SELECT 1 FROM lehre.tbl_projektbetreuer - WHERE person_id = ? - AND betreuerart_kurzbz = 'Erstbegutachter' - AND projektarbeit_id = betr.projektarbeit_id - ) - AND (tbl_benutzer.aktiv OR tbl_benutzer.aktiv IS NULL) - ORDER BY betr.insertamum DESC + AND (tbl_benutzer.aktiv OR tbl_benutzer.aktiv IS NULL)"; + + if (isset($zweitbegutachter_person_id)) + { + $qry_betr .= " AND betr.person_id = ?"; + $params[] = $zweitbegutachter_person_id; + } + + $qry_betr .= " ORDER BY betr.person_id DESC, + (CASE WHEN EXISTS ( /* if multiple accounts, prioritize mitarbeiter */ + SELECT 1 FROM public.tbl_mitarbeiter ma + WHERE ma.mitarbeiter_uid = tbl_benutzer.uid + ) THEN 0 ELSE 1 END), betr.insertamum DESC LIMIT 1"; - return $this->execQuery($qry_betr, array($projektarbeit_id, $student_uid, $erstbegutachter_person_id)); + return $this->execQuery($qry_betr, $params); } /** @@ -141,23 +169,23 @@ class Projektbetreuer_model extends DB_Model */ public function generateZweitbegutachterToken($zweitbegutachter_person_id, $projektarbeit_id) { - $betreuerUidQry = "SELECT uid, zugangstoken, zugangstoken_gueltigbis, tbl_projektbetreuer.person_id + $betreuerUidQry = "SELECT uid, zugangstoken, zugangstoken_gueltigbis, tbl_projektbetreuer.person_id, betreuerart_kurzbz FROM lehre.tbl_projektbetreuer JOIN public.tbl_person USING(person_id) LEFT JOIN public.tbl_benutzer USING(person_id) WHERE projektarbeit_id = ? AND tbl_projektbetreuer.person_id = ? - AND betreuerart_kurzbz = 'Zweitbegutachter' + AND betreuerart_kurzbz IN ('Zweitbegutachter', 'Senatspruefer') LIMIT 1"; - $betreueruidres = $this->execQuery($betreuerUidQry, array($projektarbeit_id, $zweitbegutachter_person_id)); + $betreueruidRes = $this->execQuery($betreuerUidQry, array($projektarbeit_id, $zweitbegutachter_person_id)); - if (!hasData($betreueruidres)) + if (!hasData($betreueruidRes)) return error('Zweitbegutachter nicht gefunden'); - $row_betr = getData($betreueruidres)[0]; + $zweitbetreuer = getData($betreueruidRes)[0]; - if (!isset($row_betr->uid)) + if (!isset($zweitbetreuer->uid)) { do { $token = generateToken(16); @@ -166,8 +194,8 @@ class Projektbetreuer_model extends DB_Model $result = $this->update( array('projektarbeit_id' => $projektarbeit_id, - 'person_id' => $row_betr->person_id, - 'betreuerart_kurzbz' => 'Zweitbegutachter'), + 'person_id' => $zweitbetreuer->person_id, + 'betreuerart_kurzbz' => $zweitbetreuer->betreuerart_kurzbz), array('zugangstoken' => $token, 'zugangstoken_gueltigbis' => date('Y-m-d', strtotime('+1 year'))) ); diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index db9a33812..0c2bb0edf 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -10429,6 +10429,26 @@ Any unusual occurrences ) ) ), + array( + 'app' => 'projektarbeitsbeurteilung', + 'category' => 'projektarbeitsbeurteilung', + 'phrase' => 'betreuerart', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Betreuerart', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Assessor type', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'anrechnung', From 824a148b92cb67ae84c1ba3bf5c088f8cb0861a5 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Wed, 31 Aug 2022 13:38:38 +0200 Subject: [PATCH 032/279] adapted core to Projektarbeitsbeurteilung Zweitbegutachter/Erstbegutacher Controller split --- .../education/Projektbetreuer_model.php | 82 +++++++++---------- cis/private/lehre/abgabe_lektor_details.php | 13 +-- cis/private/lehre/abgabe_student_details.php | 5 +- 3 files changed, 52 insertions(+), 48 deletions(-) diff --git a/application/models/education/Projektbetreuer_model.php b/application/models/education/Projektbetreuer_model.php index d23342c85..8a333d47c 100644 --- a/application/models/education/Projektbetreuer_model.php +++ b/application/models/education/Projektbetreuer_model.php @@ -111,52 +111,52 @@ class Projektbetreuer_model extends DB_Model $params = array($erstbegutachter_person_id, $erstbegutachter_person_id, $projektarbeit_id, $student_uid); $qry_betr = "SELECT betr.person_id, betr.projektarbeit_id, pers.anrede, betr.zugangstoken, betr.zugangstoken_gueltigbis, tbl_benutzer.uid, kontakt, - trim(COALESCE(titelpre,'')||' '||COALESCE(vorname,'')||' '||COALESCE(nachname,'')||' '||COALESCE(titelpost,'')) as voller_name, - CASE WHEN tbl_benutzer.uid IS NULL THEN kontakt ELSE tbl_benutzer.uid || '@".DOMAIN."' END AS email, abg.abgabedatum - FROM lehre.tbl_projektbetreuer betr - JOIN lehre.tbl_projektarbeit parb ON betr.projektarbeit_id = parb.projektarbeit_id - JOIN public.tbl_person pers ON betr.person_id = pers.person_id - LEFT JOIN public.tbl_kontakt ON pers.person_id = tbl_kontakt.person_id AND kontakttyp = 'email' AND zustellung = true - LEFT JOIN public.tbl_benutzer ON pers.person_id = tbl_benutzer.person_id - LEFT JOIN campus.tbl_paabgabe abg ON betr.projektarbeit_id = abg.projektarbeit_id AND abg.paabgabetyp_kurzbz = 'end' - WHERE - ( + trim(COALESCE(titelpre,'')||' '||COALESCE(vorname,'')||' '||COALESCE(nachname,'')||' '||COALESCE(titelpost,'')) as voller_name, + CASE WHEN tbl_benutzer.uid IS NULL THEN kontakt ELSE tbl_benutzer.uid || '@".DOMAIN."' END AS email, abg.abgabedatum + FROM lehre.tbl_projektbetreuer betr + JOIN lehre.tbl_projektarbeit parb ON betr.projektarbeit_id = parb.projektarbeit_id + JOIN public.tbl_person pers ON betr.person_id = pers.person_id + LEFT JOIN public.tbl_kontakt ON pers.person_id = tbl_kontakt.person_id AND kontakttyp = 'email' AND zustellung = true + LEFT JOIN public.tbl_benutzer ON pers.person_id = tbl_benutzer.person_id + LEFT JOIN campus.tbl_paabgabe abg ON betr.projektarbeit_id = abg.projektarbeit_id AND abg.paabgabetyp_kurzbz = 'end' + WHERE ( - betr.betreuerart_kurzbz = 'Zweitbegutachter' - AND EXISTS ( - SELECT 1 FROM lehre.tbl_projektbetreuer - WHERE person_id = ? - AND betreuerart_kurzbz = 'Erstbegutachter' - AND projektarbeit_id = betr.projektarbeit_id + ( + betr.betreuerart_kurzbz = 'Zweitbegutachter' + AND EXISTS ( + SELECT 1 FROM lehre.tbl_projektbetreuer + WHERE person_id = ? + AND betreuerart_kurzbz = 'Erstbegutachter' + AND projektarbeit_id = betr.projektarbeit_id + ) + ) + OR /* either Zweitbegutachter of masterarbeit, or Kommissionsprüfer if Kommission */ + ( + betr.betreuerart_kurzbz = 'Senatspruefer' + AND EXISTS ( + SELECT 1 FROM lehre.tbl_projektbetreuer + WHERE person_id = ? + AND betreuerart_kurzbz = 'Senatsvorsitz' + AND projektarbeit_id = betr.projektarbeit_id + ) ) ) - OR /* either Zweitbegutachter of masterarbeit, or Kommissionsprüfer if Kommission */ - ( - betr.betreuerart_kurzbz = 'Senatspruefer' - AND EXISTS ( - SELECT 1 FROM lehre.tbl_projektbetreuer - WHERE person_id = ? - AND betreuerart_kurzbz = 'Senatsvorsitz' - AND projektarbeit_id = betr.projektarbeit_id - ) - ) - ) - AND betr.projektarbeit_id = ? - AND parb.student_uid = ? - AND (tbl_benutzer.aktiv OR tbl_benutzer.aktiv IS NULL)"; + AND betr.projektarbeit_id = ? + AND parb.student_uid = ? + AND (tbl_benutzer.aktiv OR tbl_benutzer.aktiv IS NULL)"; - if (isset($zweitbegutachter_person_id)) - { - $qry_betr .= " AND betr.person_id = ?"; - $params[] = $zweitbegutachter_person_id; - } + if (isset($zweitbegutachter_person_id)) + { + $qry_betr .= " AND betr.person_id = ?"; + $params[] = $zweitbegutachter_person_id; + } - $qry_betr .= " ORDER BY betr.person_id DESC, - (CASE WHEN EXISTS ( /* if multiple accounts, prioritize mitarbeiter */ - SELECT 1 FROM public.tbl_mitarbeiter ma - WHERE ma.mitarbeiter_uid = tbl_benutzer.uid - ) THEN 0 ELSE 1 END), betr.insertamum DESC - LIMIT 1"; + $qry_betr .= " ORDER BY betr.person_id DESC, + (CASE WHEN EXISTS ( /* if multiple accounts, prioritize mitarbeiter */ + SELECT 1 FROM public.tbl_mitarbeiter ma + WHERE ma.mitarbeiter_uid = tbl_benutzer.uid + ) THEN 0 ELSE 1 END), betr.insertamum DESC + LIMIT 1"; return $this->execQuery($qry_betr, $params); } diff --git a/cis/private/lehre/abgabe_lektor_details.php b/cis/private/lehre/abgabe_lektor_details.php index 852529d53..eb41620ce 100644 --- a/cis/private/lehre/abgabe_lektor_details.php +++ b/cis/private/lehre/abgabe_lektor_details.php @@ -144,7 +144,7 @@ if($num_rows_endupload < 0) } // Zweitbegutachter holen -if(in_array($betreuerart, array('Erstbegutacher', 'Senatsvorsitz'))) +if(in_array($betreuerart, array('Erstbegutachter', 'Senatsvorsitz'))) { $alleBegutachter = new projektbetreuer(); $alleBegutachterRes = $alleBegutachter->getProjektbetreuer($projektarbeit_id); @@ -154,7 +154,7 @@ if(in_array($betreuerart, array('Erstbegutacher', 'Senatsvorsitz'))) $zweitbetreuerArr = array(); foreach ($alleBegutachter->result as $begutachter) { - if (in_array($begutachter->betreuerart_kurzbz, array('Erstbegutacher', 'Senatsvorsitz'))) + if (in_array($begutachter->betreuerart_kurzbz, array('Erstbegutachter', 'Senatsvorsitz'))) { // dem Erstbetreuer zugewiesene Zweitbetreuer holen $erstbetreuer_id = $begutachter->person_id; @@ -165,7 +165,7 @@ if(in_array($betreuerart, array('Erstbegutacher', 'Senatsvorsitz'))) } // Mail mit Token an Zweitbegutachter senden - if ($zweitbegutachterRes && $paIsCurrent >= 1 && isset($_GET['zweitbegutachtertoken']) && isset($_GET['zweitbetreuer_person_id'])) + if (count($zweitbetreuerArr) > 0 && $paIsCurrent >= 1 && isset($_GET['zweitbegutachtertoken']) && isset($_GET['zweitbetreuer_person_id'])) { $qry_std="SELECT * FROM campus.vw_benutzer where uid=".$db->db_add_param($uid); if(!$result_std=$db->db_query($qry_std)) @@ -481,7 +481,8 @@ $endupload_vorhanden = $num_rows_endupload >= 1; if ($semester_benotbar && $endupload_vorhanden) { - $htmlstr .= "
"; + $beurtPfad = $betreuerart == 'Zweitbegutachter' ? 'ProjektarbeitsbeurteilungZweitbegutachter' : 'ProjektarbeitsbeurteilungErstbegutachter'; + $htmlstr .= ""; $htmlstr .= "\n"; $htmlstr .= "\n"; $htmlstr .= "
"; @@ -759,8 +760,8 @@ function sendZweitbegutachterMail($zweitbegutachter, $erstbegutachter_person_id, { $zweitbetr = $projektbetreuer->result[0]; $intern = isset($zweitbetr->uid); - $mail_subject = $projekttyp_kurzbz == 'Diplom' ? "Masterarbeitsbetreuung" : "Bachelorarbeitsbetreuung"; - $mail_baselink = APP_ROOT."index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/Projektarbeitsbeurteilung"; + $mail_subject = $projekttyp_kurzbz == 'Diplom' ? 'Masterarbeitsbetreuung' : 'Bachelorarbeitsbetreuung'; + $mail_baselink = APP_ROOT."index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/ProjektarbeitsbeurteilungZweitbegutachter"; $mail_fulllink = "$mail_baselink?projektarbeit_id=".$zweitbegutachter->projektarbeit_id."&uid=".$student->uid; $mail_link = $intern ? $mail_fulllink : $mail_baselink; diff --git a/cis/private/lehre/abgabe_student_details.php b/cis/private/lehre/abgabe_student_details.php index bead1a1e9..522e89dd3 100644 --- a/cis/private/lehre/abgabe_student_details.php +++ b/cis/private/lehre/abgabe_student_details.php @@ -433,7 +433,7 @@ if($command=="update" && $error!=true) $row_std=$db->db_fetch_object($result_std); // 1. Begutachter mail ohne Token - $mail_baselink = APP_ROOT."index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/Projektarbeitsbeurteilung"; + $mail_baselink = APP_ROOT."index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/ProjektarbeitsbeurteilungErstbegutachter"; $mail_fulllink = "$mail_baselink?projektarbeit_id=".$projektarbeit_id."&uid=".$row_std->uid; $projekttyp_kurzbz = $projektarbeit_obj->projekttyp_kurzbz; $subject = $projektarbeit_obj->projekttyp_kurzbz == 'Diplom' ? 'Masterarbeitsbetreuung' : 'Bachelorarbeitsbetreuung'; @@ -495,6 +495,9 @@ if($command=="update" && $error!=true) { $begutachterMitToken = $zweitbegutachterMitToken->result[0]; + $path = $begutachterMitToken->betreuerart_kurzbz == 'Zweitbegutachter' ? 'ProjektarbeitsbeurteilungZweitbegutachter' : 'ProjektarbeitsbeurteilungErstbegutachter'; + $mail_baselink = APP_ROOT."index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/$path"; + $mail_fulllink = "$mail_baselink?projektarbeit_id=".$projektarbeit_id."&uid=".$row_std->uid; $intern = isset($begutachterMitToken->uid); $mail_link = $intern ? $mail_fulllink : $mail_baselink; From cc33502ab3ad6ce31fd1819d62b8f768a80a19f9 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Thu, 1 Sep 2022 02:23:32 +0200 Subject: [PATCH 033/279] adapted "resend token for Begutachter" mail to Projektarbeitsbeurteilung controller split --- application/models/education/Projektbetreuer_model.php | 5 +++-- cis/private/lehre/abgabe_lektor_details.php | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/application/models/education/Projektbetreuer_model.php b/application/models/education/Projektbetreuer_model.php index 8a333d47c..db9310eed 100644 --- a/application/models/education/Projektbetreuer_model.php +++ b/application/models/education/Projektbetreuer_model.php @@ -110,9 +110,10 @@ class Projektbetreuer_model extends DB_Model { $params = array($erstbegutachter_person_id, $erstbegutachter_person_id, $projektarbeit_id, $student_uid); - $qry_betr = "SELECT betr.person_id, betr.projektarbeit_id, pers.anrede, betr.zugangstoken, betr.zugangstoken_gueltigbis, tbl_benutzer.uid, kontakt, + $qry_betr = "SELECT betr.person_id, betr.projektarbeit_id, pers.anrede, betr.zugangstoken, betr.zugangstoken_gueltigbis, tbl_benutzer.uid, trim(COALESCE(titelpre,'')||' '||COALESCE(vorname,'')||' '||COALESCE(nachname,'')||' '||COALESCE(titelpost,'')) as voller_name, - CASE WHEN tbl_benutzer.uid IS NULL THEN kontakt ELSE tbl_benutzer.uid || '@".DOMAIN."' END AS email, abg.abgabedatum + CASE WHEN tbl_benutzer.uid IS NULL THEN kontakt ELSE tbl_benutzer.uid || '@".DOMAIN."' END AS email, kontakt, + abg.abgabedatum, betr.betreuerart_kurzbz FROM lehre.tbl_projektbetreuer betr JOIN lehre.tbl_projektarbeit parb ON betr.projektarbeit_id = parb.projektarbeit_id JOIN public.tbl_person pers ON betr.person_id = pers.person_id diff --git a/cis/private/lehre/abgabe_lektor_details.php b/cis/private/lehre/abgabe_lektor_details.php index eb41620ce..2bda94848 100644 --- a/cis/private/lehre/abgabe_lektor_details.php +++ b/cis/private/lehre/abgabe_lektor_details.php @@ -760,8 +760,9 @@ function sendZweitbegutachterMail($zweitbegutachter, $erstbegutachter_person_id, { $zweitbetr = $projektbetreuer->result[0]; $intern = isset($zweitbetr->uid); + $mail_link_path = $zweitbetr->betreuerart_kurzbz == 'Zweitbegutachter' ? 'ProjektarbeitsbeurteilungZweitbegutachter' : 'ProjektarbeitsbeurteilungErstbegutachter'; $mail_subject = $projekttyp_kurzbz == 'Diplom' ? 'Masterarbeitsbetreuung' : 'Bachelorarbeitsbetreuung'; - $mail_baselink = APP_ROOT."index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/ProjektarbeitsbeurteilungZweitbegutachter"; + $mail_baselink = APP_ROOT."index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/$mail_link_path"; $mail_fulllink = "$mail_baselink?projektarbeit_id=".$zweitbegutachter->projektarbeit_id."&uid=".$student->uid; $mail_link = $intern ? $mail_fulllink : $mail_baselink; From 8670ab18f80586454dc1eff6748500f8cfce5904 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Mon, 5 Sep 2022 11:27:33 +0200 Subject: [PATCH 034/279] =?UTF-8?q?Zeitaufzeichnung:=20Ber=C3=BCcksichtigu?= =?UTF-8?q?ng=20von=20Attribut=20Zeitaufzeichnung=20bei=20Projekt=20und=20?= =?UTF-8?q?Projektphase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cis/private/tools/zeitaufzeichnung.php | 29 ++++++++++++++-- .../tools/zeitaufzeichnung_projektphasen.php | 1 + include/projektphase.class.php | 34 +++++++++++++++++++ 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/cis/private/tools/zeitaufzeichnung.php b/cis/private/tools/zeitaufzeichnung.php index ba57b442f..003eea434 100644 --- a/cis/private/tools/zeitaufzeichnung.php +++ b/cis/private/tools/zeitaufzeichnung.php @@ -605,9 +605,14 @@ echo ' { projphasenhtml += "'; + echo ''; } echo ''; } diff --git a/cis/private/tools/zeitaufzeichnung_projektphasen.php b/cis/private/tools/zeitaufzeichnung_projektphasen.php index 053f38b91..05df74443 100644 --- a/cis/private/tools/zeitaufzeichnung_projektphasen.php +++ b/cis/private/tools/zeitaufzeichnung_projektphasen.php @@ -86,6 +86,7 @@ if (isset($_GET['projekt_kurzbz'])) $item['bezeichnung'] = $row->bezeichnung; $item['start'] = $datum_obj->formatDatum($row->start, 'd.m.Y'); $item['ende'] = $datum_obj->formatDatum($row->ende, 'd.m.Y'); + $item['zeitaufzeichnung_erlaubt'] = $row->zeitaufzeichnung; $result_obj[] = $item; } } diff --git a/include/projektphase.class.php b/include/projektphase.class.php index 19bd85d6d..4e3c38b7c 100644 --- a/include/projektphase.class.php +++ b/include/projektphase.class.php @@ -829,5 +829,39 @@ class projektphase extends basis_db return false; } } + + /** + * Gibt zurück, ob für eine Projektphase Zeitaufzeichnungsbuchung erlaubt ist + * @param $projektphase_id die zu überprüfende Projektphase + * @return boolean true, wenn Buchung erlaubt + */ + public function getPhasenZA($projektphase_id) + { + $qry = " + SELECT + fue.tbl_projektphase.zeitaufzeichnung + FROM + fue.tbl_projektphase + WHERE + tbl_projektphase.projektphase_id = ".$this->db_add_param($projektphase_id); + + if ($this->db_query($qry)) + { + if ($row = $this->db_fetch_object()) + { + return $row->zeitaufzeichnung; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } } ?> From 625b3c74c42a6a2299156abeae0a13f52e4d3265 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Wed, 7 Sep 2022 09:22:06 +0200 Subject: [PATCH 035/279] =?UTF-8?q?Bewerbungstool:=20keine=20ZGV=20bei=20A?= =?UTF-8?q?bbrechern,=20Ber=C3=BCcksichtigung=20studentstatus=20f=C3=BCr?= =?UTF-8?q?=20Dokumenthandling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/prestudent.class.php | 63 +++++++++++++++++++++++++++++++++--- 1 file changed, 59 insertions(+), 4 deletions(-) diff --git a/include/prestudent.class.php b/include/prestudent.class.php index a958120cb..f5d59fd73 100644 --- a/include/prestudent.class.php +++ b/include/prestudent.class.php @@ -588,7 +588,7 @@ class prestudent extends person AND status_kurzbz = 'Interessent' - AND + AND NOT EXISTS ( SELECT 1 FROM public.tbl_prestudentstatus WHERE prestudent_id=tbl_prestudent.prestudent_id AND status_kurzbz='Abgewiesener' )"; @@ -2335,15 +2335,18 @@ class prestudent extends person return false; } - - $qry = "SELECT count(*) as anzahl FROM public.tbl_prestudent + $qry = "SELECT count(*) as anzahl + FROM public.tbl_prestudent pt JOIN public.tbl_prestudentstatus USING (prestudent_id) JOIN public.tbl_studiengang USING (studiengang_kz) WHERE person_id = ".$this->db_add_param($person_id, FHC_INTEGER)." + AND NOT EXISTS + (SELECT * FROM public.tbl_prestudentstatus ps + WHERE ps.prestudent_id = pt.prestudent_id + AND status_kurzbz not in ('Abbrecher')) AND status_kurzbz in ('Absolvent','Diplomand','Unterbrecher','Student') AND typ in ('b','m','d')"; - if ($this->db_query($qry)) { if ($row = $this->db_fetch_object()) @@ -2372,6 +2375,58 @@ class prestudent extends person } } + /** + * Prueft, ob eine Person bereits einmal auf der FHTW Studierend war + * @param int $person_id ID der zu überprüfenden Person. + * @return true wenn vorhanden + * false wenn nicht vorhanden + * false und errormsg wenn Fehler aufgetreten ist + */ +public function isPastStudent($person_id) +{ + if (!is_numeric($person_id)) + { + $this->errormsg = 'Person_id muss eine gueltige Zahl sein'; + return false; + } + + $qry = "SELECT count(*) as anzahl + FROM public.tbl_prestudent pt + JOIN public.tbl_prestudentstatus USING (prestudent_id) + JOIN public.tbl_studiengang USING (studiengang_kz) + WHERE person_id = ".$this->db_add_param($person_id, FHC_INTEGER)." + AND status_kurzbz in ('Student') + AND typ in ('b','m','d') + "; + + if ($this->db_query($qry)) + { + if ($row = $this->db_fetch_object()) + { + if ($row->anzahl > 0) + { + $this->errormsg = ''; + return true; + } + else + { + $this->errormsg = ''; + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } +} + /** * Befüllt MasterZGV-Felder: Nation mit Österreich und MasterZGV-code mit FH-Bachelor(I) * @param int $person_id Personenkennzeichen. From 604592cdd1d485498e6a0601b9cb2c1535dbf462 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Wed, 7 Sep 2022 15:27:47 +0200 Subject: [PATCH 036/279] Bewerbungstool: neue Funktion isPastAbbrecher() --- include/prestudent.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/prestudent.class.php b/include/prestudent.class.php index f5d59fd73..cc48cd17d 100644 --- a/include/prestudent.class.php +++ b/include/prestudent.class.php @@ -2376,13 +2376,13 @@ class prestudent extends person } /** - * Prueft, ob eine Person bereits einmal auf der FHTW Studierend war + * Prueft, ob eine Person Abbrecher war * @param int $person_id ID der zu überprüfenden Person. * @return true wenn vorhanden * false wenn nicht vorhanden * false und errormsg wenn Fehler aufgetreten ist */ -public function isPastStudent($person_id) +public function isPastAbbrecher($person_id) { if (!is_numeric($person_id)) { @@ -2395,7 +2395,7 @@ public function isPastStudent($person_id) JOIN public.tbl_prestudentstatus USING (prestudent_id) JOIN public.tbl_studiengang USING (studiengang_kz) WHERE person_id = ".$this->db_add_param($person_id, FHC_INTEGER)." - AND status_kurzbz in ('Student') + AND status_kurzbz in ('Abbrecher') AND typ in ('b','m','d') "; From 7252bc1e6f07e053bae5a4afc860cd757985e75a Mon Sep 17 00:00:00 2001 From: ma0068 Date: Fri, 9 Sep 2022 13:20:50 +0200 Subject: [PATCH 037/279] add config.file --- cis/private/profile/zeitsperre_resturlaub.php | 1 + 1 file changed, 1 insertion(+) diff --git a/cis/private/profile/zeitsperre_resturlaub.php b/cis/private/profile/zeitsperre_resturlaub.php index 04615ab66..351ebc29d 100644 --- a/cis/private/profile/zeitsperre_resturlaub.php +++ b/cis/private/profile/zeitsperre_resturlaub.php @@ -350,6 +350,7 @@ function showHideStudeDropDown() $zeitsaldo = ""; if($addoncasetime) { + require_once('../../../addons/casetime/config.inc.php'); require_once('../../../addons/casetime/include/functions.inc.php'); $zeitsaldo = getCaseTimeZeitsaldo($uid); $zeitsaldo = "Aktueller Zeitsaldo: ". $zeitsaldo . " (".formatZeitsaldo($zeitsaldo).")"; From 0d03689f570604b995ce0e147c2101141f6796da Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Wed, 14 Sep 2022 02:48:43 +0200 Subject: [PATCH 038/279] added IIssueExistsChecker and Issueload->model('system/Issue_model', 'IssueModel'); + + $this->load->library('IssuesLib'); + } + + /** + * Initializes issue resolution. + */ + public function run() + { + $this->logInfo("Issue producer job started"); + + foreach ($this->_codeLibMappings as $fehlercode => $library) + { + // add person id and oe kurzbz automatically as params, merge it with additional params + // decode bewerbung_parameter into assoc array + $params = array_merge( + array('issue_id' => $issue->issue_id, 'issue_person_id' => $issue->person_id, 'issue_oe_kurzbz' => $issue->oe_kurzbz), + isset($issue->behebung_parameter) ? json_decode($issue->behebung_parameter, true) : array() + ); + + // if called from extension (extension name set), path includes extension names, otherwise it is the core library folder + $libRootPath = isset($this->_extensionName) ? 'extensions/' . $this->_extensionName . '/' : ''; + $issuesLibPath = $libRootPath . self::ISSUES_FOLDER . '/'; + $issuesLibFilePath = DOC_ROOT . 'application/' . $libRootPath . 'libraries/' . self::ISSUES_FOLDER . '/' . $libName . '.php'; + + // check if library file exists + if (!file_exists($issuesLibFilePath)) + { + // log error and continue with next issue if not + $this->logError("Issue library file " . $issuesLibFilePath . " does not exist"); + continue; + } + + // load library connected to fehlercode + $this->load->library( + $issuesLibPath . $libName + ); + + $lowercaseLibName = mb_strtolower($libName); + + // check if method is defined in libary class + if (!is_callable(array($this->{$lowercaseLibName}, self::CHECK_ISSUE_EXISTS_METHOD_NAME))) + { + // log error and continue with next issue if not + $this->logError("Method " . self::CHECK_ISSUE_EXISTS_METHOD_NAME . " is not defined in library $lowercaseLibName"); + continue; + } + + // call the function for checking for issue resolution + $issueResolvedRes = $this->{$lowercaseLibName}->{self::CHECK_ISSUE_EXISTS_METHOD_NAME}($params); + + if (isError($issueResolvedRes)) + { + $this->logError(getError($issueResolvedRes)); + } + else + { + $issueResolvedData = getData($issueResolvedRes); + + if ($issueResolvedData === true) + { + // set issue to resolved if needed + $behobenRes = $this->issueslib->setBehoben($issue->issue_id, null); + + if (isError($behobenRes)) + $this->logError(getError($behobenRes)); + else + $this->logInfo("Issue " . $issue->issue_id . " successfully resolved"); + } + } + } + + $this->logInfo("Issue resolve job ended"); + } +} From 450b0b64339db9316e196676c474eccf981a1ea8 Mon Sep 17 00:00:00 2001 From: Manfred Date: Wed, 14 Sep 2022 15:55:07 +0200 Subject: [PATCH 039/279] Initial commit --- include/berechtigung.class.php | 37 + .../benutzerberechtigung_autocomplete.php | 116 ++ .../benutzerberechtigung_details.php | 1149 +++++++++++------ 3 files changed, 914 insertions(+), 388 deletions(-) create mode 100644 vilesci/stammdaten/benutzerberechtigung_autocomplete.php diff --git a/include/berechtigung.class.php b/include/berechtigung.class.php index 684ad4e81..ab224be4d 100644 --- a/include/berechtigung.class.php +++ b/include/berechtigung.class.php @@ -312,5 +312,42 @@ class berechtigung extends basis_db return false; } } + + /** + * Sucht nach Berechtigungen + * @param string $searchItem Suchbegriff + * @return boolean + */ + public function searchBerechtigungen($searchItem) + { + $this->result=array(); + $qry = 'SELECT * FROM system.tbl_berechtigung WHERE + ( + LOWER(berechtigung_kurzbz) LIKE LOWER(\'%'.$this->db_escape(($searchItem)).'%\') + OR + LOWER(beschreibung) LIKE LOWER(\'%'.$this->db_escape(($searchItem)).'%\') + )'; + + $qry .= ' ORDER BY berechtigung_kurzbz'; + + if($this->db_query($qry)) + { + while($row = $this->db_fetch_object()) + { + $obj = new berechtigung(); + + $obj->berechtigung_kurzbz = $row->berechtigung_kurzbz; + $obj->beschreibung = $row->beschreibung; + + $this->result[] = $obj; + } + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Berechtigungen'; + return false; + } + } } ?> \ No newline at end of file diff --git a/vilesci/stammdaten/benutzerberechtigung_autocomplete.php b/vilesci/stammdaten/benutzerberechtigung_autocomplete.php new file mode 100644 index 000000000..07e57809e --- /dev/null +++ b/vilesci/stammdaten/benutzerberechtigung_autocomplete.php @@ -0,0 +1,116 @@ + + */ +require_once ('../../config/vilesci.config.inc.php'); +require_once ('../../include/functions.inc.php'); +require_once ('../../include/basis_db.class.php'); +require_once ('../../include/ort.class.php'); +require_once ('../../include/benutzer.class.php'); +require_once ('../../include/studiengang.class.php'); +require_once ('../../include/berechtigung.class.php'); +require_once ('../../include/organisationseinheit.class.php'); +require_once ('../../include/sprache.class.php'); + +if (! $db = new basis_db()) + die('Es konnte keine Verbindung zum Server aufgebaut werden.'); + +$uid = get_uid(); +$sprache = getSprache(); + +if (isset($_REQUEST['autocomplete']) && $_REQUEST['autocomplete'] == 'benutzer') +{ + $search = trim((isset($_REQUEST['term']) ? $_REQUEST['term'] : '')); + if (is_null($search) || $search == '') + exit(); + + $benutzer = new benutzer(); + + if ($benutzer->search(array( + $search + ))) + { + $result_obj = array(); + foreach ($benutzer->result as $row) + { + $item['vorname'] = html_entity_decode($row->vorname); + $item['nachname'] = html_entity_decode($row->nachname); + $item['uid'] = html_entity_decode($row->uid); + $result_obj[] = $item; + } + echo json_encode($result_obj); + } + exit(); +} + +if (isset($_REQUEST['autocomplete']) && $_REQUEST['autocomplete'] == 'berechtigung') +{ + $search = trim((isset($_REQUEST['term']) ? $_REQUEST['term'] : '')); + if (is_null($search) || $search == '') + exit(); + + $berechtigung = new berechtigung(); + + if ($berechtigung->searchBerechtigungen($search)) + { + $result_obj = array(); + foreach ($berechtigung->result as $row) + { + $item['berechtigung_kurzbz'] = html_entity_decode($row->berechtigung_kurzbz); + $item['beschreibung'] = html_entity_decode($row->beschreibung); + $result_obj[] = $item; + } + echo json_encode($result_obj); + } + exit(); +} + +if (isset($_REQUEST['autocomplete']) && $_REQUEST['autocomplete'] == 'oe_kurzbz') +{ + $search = trim((isset($_REQUEST['term']) ? $_REQUEST['term'] : '')); + if (is_null($search) || $search == '') + exit(); + + $search = array($search); + $oe = new organisationseinheit(); + $oe->search($search); + + $stg = new studiengang(); + $stg->search($search); + foreach($stg->result as $row) + { + if($row->aktiv===true) + $oe->result[] = new organisationseinheit($row->oe_kurzbz); + } + + if(is_array($oe->result) && count($oe->result) > 0) + { + $result_obj = array(); + foreach($oe->result as $row) + { + if($row->aktiv==true) + { + $item['oe_kurzbz'] = html_entity_decode($row->oe_kurzbz); + $item['organisationseinheittyp_kurzbz'] = html_entity_decode($row->organisationseinheittyp_kurzbz); + $item['bezeichnung'] = html_entity_decode($row->bezeichnung); + $result_obj[] = $item; + } + } + echo json_encode($result_obj); + } + exit(); +} + +?> diff --git a/vilesci/stammdaten/benutzerberechtigung_details.php b/vilesci/stammdaten/benutzerberechtigung_details.php index 83a9c34bb..03e7b15b9 100644 --- a/vilesci/stammdaten/benutzerberechtigung_details.php +++ b/vilesci/stammdaten/benutzerberechtigung_details.php @@ -37,7 +37,28 @@ require_once('../../include/person.class.php'); require_once('../../include/benutzer.class.php'); require_once('../../include/funktion.class.php'); require_once('../../include/wawi_kostenstelle.class.php'); +require_once('../../include/log.class.php'); +/* + * TODOs + * + +Checkbox-Range +Mehrfach-Löschen + + +Wawi und kostenstelle ausblenden +Checkbox markieren bei (doppel)klick auf Zeile + +---------------------- + +Nach übertragen gleich zu Person springen +Bug in Kopieren - Verdoppelt alle Einträge +Sortierreihenfolge. OE wird anscheinend nicht sortiert +ART prüfen auf schreibweise +BEschreibungstexte bestehender Rechte + + */ $user = get_uid(); $rechte = new benutzerberechtigung(); @@ -51,7 +72,8 @@ if(!$rechte->isBerechtigt('basis/berechtigung')) //$reloadstr = ''; // neuladen der liste im oberen frame $htmlstr = ''; -$errorstr = ''; //fehler beim insert +$errorstr = ''; +$successstr = ''; $sel = ''; $chk = ''; $oe_arr = array(); @@ -73,64 +95,161 @@ $neu = false; $negativ = false; $filter=(isset($_GET['filter'])?$_GET['filter']:'alle'); -if(isset($_POST['del'])) +if(isset($_POST['delete']) && $_POST['delete'] != '') { if(!$rechte->isBerechtigt('basis/berechtigung', null, 'suid')) - die('Sie haben keine Berechtigung fuer diese Aktion'); + die($rechte->errormsg); - $benutzerberechtigung_id = $_POST['benutzerberechtigung_id']; + $benutzerberechtigung_id = $_POST['delete']; $ber = new benutzerberechtigung(); if(!$ber->delete($benutzerberechtigung_id)) $errorstr .= 'Datensatz konnte nicht gelöscht werden!'; - //$reloadstr .= "\n"; + //$reloadstr .= ""; } -if(isset($_POST['kopieren'])) +if(isset($_POST['delete_multi']) && $_POST['delete_multi'] != '') { + if(!$rechte->isBerechtigt('basis/berechtigung', null, 'suid')) + die($rechte->errormsg); + + if (isset($_POST['dataset'])) + { + $i = 0; + foreach ($_POST['dataset'] AS $benutzerberechtigung_id => $value) + { + // Nur markierte Rechte kopieren + if (!isset($value['check'])) + { + continue; + } + + $ber = new benutzerberechtigung(); + if(!$ber->delete($benutzerberechtigung_id)) + { + $errorstr .= 'Datensatz konnte nicht gelöscht werden!'; + } + else + { + $i ++; + //Log schreiben + $log = new log(); + + $logdata = var_export((array) $ber, true); + $log->new = true; + $log->sql = $logdata; + $log->sqlundo = 'Kein Undo vorhanden'; + $log->executetime = date('Y-m-d H:i:s'); + $log->mitarbeiter_uid = $user; + $log->beschreibung = 'Berechtigung gelöscht'; + + if(!$log->save()) + { + $errorstr .= "Fehler beim schreiben des Log-Eintrags
"; + } + } + } + if ($errorstr == '') + { + $successstr .= "".$i." Rechte erfolgreich gelöscht
"; + } + } + + + + //$reloadstr .= ""; + +} + +if(isset($_POST['uebertragen']) && $_POST['uebertragen_nach'] != '') +{ + //echo '
', var_dump($_POST), '
';exit(); if($rechte->isBerechtigt('basis/berechtigung', null, 'suid')) { - $uid = $_POST['uid']; - $uid_von = $_POST['uid_von']; + $uidVon = $_POST['uid']; + $copyTo = $_POST['uebertragen_nach']; - $rechtevon = new benutzerberechtigung(); - if(!$rechtevon->loadBenutzerRollen($uid_von)) - die('Fehler beim Laden der Berechtigung von '.$uid_von); - - foreach($rechtevon->berechtigungen AS $row) + if (isset($_POST['dataset'])) { - //Nur aktive Berechtigungen kopieren - if(($row->start=='' || $row->start<=date('Y-m-d')) && ($row->ende=='' || $row->ende>=date('Y-m-d'))) + $i = 0; + foreach ($_POST['dataset'] AS $key => $value) { + // Nur markierte Rechte kopieren + if (!isset($value['check'])) + { + continue; + } + + $rolle_kurzbz = (isset($value['rolle_kurzbz']) ? $value['rolle_kurzbz'] : ''); + $berechtigung_kurzbz = (isset($value['berechtigung_kurzbz']) ? $value['berechtigung_kurzbz'] : ''); + $art = (isset($value['art']) ? $value['art'] : ''); + $oe_kurzbz = (isset($value['oe_kurzbz']) ? $value['oe_kurzbz'] : ''); + $kostenstelle_id = (isset($value['kostenstelle_id']) ? $value['kostenstelle_id'] : ''); + $start = (isset($value['start']) ? $value['start'] : ''); + $ende = (isset($value['ende']) ? $value['ende'] : ''); + $anmerkung = (isset($value['anmerkung']) ? $value['anmerkung'] : ''); + + $funktion_kurzbz = (isset($value['funktion_kurzbz']) ? $value['funktion_kurzbz'] : ''); + $studiensemester_kurzbz = null; + $ber = new benutzerberechtigung(); - $ber->new = true; - //$ber->benutzerberechtigung_id = $benutzerberechtigung_id; - $ber->art = $row->art; - $ber->oe_kurzbz = $row->oe_kurzbz; - $ber->berechtigung_kurzbz = $row->berechtigung_kurzbz; - $ber->rolle_kurzbz = $row->rolle_kurzbz; - $ber->uid = $uid; - $ber->funktion_kurzbz = $row->funktion_kurzbz; - $ber->studiensemester_kurzbz = $row->studiensemester_kurzbz; - $ber->start = $row->start; - $ber->ende = $row->ende; - $ber->negativ = $row->negativ; - $ber->insertamum=date('Y-m-d H:i:s'); + $ber->insertamum = date('Y-m-d H:i:s'); $ber->insertvon = $user; + $ber->new = true; + + if (isset($value['negativ'])) + $ber->negativ = true; + else + $ber->negativ = false; + + $ber->art = $art; + $ber->oe_kurzbz = $oe_kurzbz; + $ber->berechtigung_kurzbz = $berechtigung_kurzbz; + $ber->rolle_kurzbz = $rolle_kurzbz; + $ber->uid = $copyTo; + $ber->funktion_kurzbz = $funktion_kurzbz; + $ber->studiensemester_kurzbz = $studiensemester_kurzbz; + $ber->start = $start; + $ber->ende = $ende; $ber->updateamum = date('Y-m-d H:i:s'); $ber->updatevon = $user; - $ber->kostenstelle_id = $row->kostenstelle_id; - $ber->anmerkung = 'Kopiert von UID '.$uid_von.($row->anmerkung!=''?'. Anmerkung von UID '.$uid_von.': '.$row->anmerkung:''); + $ber->kostenstelle_id = $kostenstelle_id; + $ber->anmerkung = 'Kopiert von UID '.$uidVon.($anmerkung!=''?'. Anmerkung von UID '.$uidVon.': '.$anmerkung:''); if(!$ber->save()) { - if (!$ber->new) - $errorstr .= "Datensatz konnte nicht gespeichert werden!".$ber->errormsg; + $errorstr .= "Datensatz konnte nicht gespeichert werden!".$ber->errormsg; } + else + { + $i ++; + //Log schreiben + $log = new log(); + + $logdata = var_export((array) $ber, true); + $log->new = true; + $log->sql = $logdata; + $log->sqlundo = 'Kein Undo vorhanden'; + $log->executetime = date('Y-m-d H:i:s'); + $log->mitarbeiter_uid = $user; + $log->beschreibung = 'Berechtigung übertragen von '.$uidVon.' nach '.$copyTo; + + if(!$log->save()) + { + $errorstr .= "Fehler beim schreiben des Log-Eintrags
"; + } + } + } + if ($errorstr == '') + { + $successstr .= "".$i." Rechte erfolgreich kopiert
"; + echo ""; } } } @@ -140,71 +259,137 @@ if(isset($_POST['kopieren'])) } } -if(isset($_POST['schick']) || isset($_POST['copy'])) +if(isset($_POST['schick'])) { if($rechte->isBerechtigt('basis/berechtigung', null, 'suid')) { - $benutzerberechtigung_id = $_POST['benutzerberechtigung_id']; - $art = $_POST['art']; - $oe_kurzbz = (isset($_POST['oe_kurzbz'])?$_POST['oe_kurzbz']:''); - $berechtigung_kurzbz = (isset($_POST['berechtigung_kurzbz'])?$_POST['berechtigung_kurzbz']:''); - $rolle_kurzbz = (isset($_POST['rolle_kurzbz'])?$_POST['rolle_kurzbz']:''); - $uid = $_POST['uid']; - $funktion_kurzbz = $_POST['funktion_kurzbz']; - $studiensemester_kurzbz = null;//$_POST['studiensemester_kurzbz']; - $start = $_POST['start']; - $ende = $_POST['ende']; - $kostenstelle_id = (isset($_POST['kostenstelle_id'])?$_POST['kostenstelle_id']:''); - $anmerkung = (isset($_POST['anmerkung'])?$_POST['anmerkung']:''); + if (isset($_POST['dataset'])) + { + foreach ($_POST['dataset'] AS $benutzerberechtigung_id => $value) + { + $rolle_kurzbz = (isset($value['rolle_kurzbz']) ? $value['rolle_kurzbz'] : ''); + $berechtigung_kurzbz = (isset($value['berechtigung_kurzbz']) ? $value['berechtigung_kurzbz'] : ''); + $art = (isset($value['art']) ? $value['art'] : ''); + $oe_kurzbz = (isset($value['oe_kurzbz']) ? $value['oe_kurzbz'] : ''); + $kostenstelle_id = (isset($value['kostenstelle_id']) ? $value['kostenstelle_id'] : ''); + $start = (isset($value['start']) ? $value['start'] : ''); + $ende = (isset($value['ende']) ? $value['ende'] : ''); + $uid = $_POST['uid']; + $anmerkung = (isset($value['anmerkung']) ? $value['anmerkung'] : ''); + $funktion_kurzbz = (isset($_POST['funktion_kurzbz']) ? $_POST['funktion_kurzbz'] : ''); + $studiensemester_kurzbz = null; + + $ber = new benutzerberechtigung(); + if (isset($_POST['neu'])) + { + $ber->insertamum = date('Y-m-d H:i:s'); + $ber->insertvon = $user; + $ber->new = true; + } + else + { + if(!$ber->load($benutzerberechtigung_id)) + die('Fehler beim Laden der Berechtigung'); + } + if (isset($value['negativ'])) + $ber->negativ = true; + else + $ber->negativ = false; + + $ber->benutzerberechtigung_id = $benutzerberechtigung_id; + $ber->art = $art; + $ber->oe_kurzbz = $oe_kurzbz; + $ber->berechtigung_kurzbz = $berechtigung_kurzbz; + $ber->rolle_kurzbz = $rolle_kurzbz; + $ber->uid = $uid; + $ber->funktion_kurzbz = $funktion_kurzbz; + $ber->studiensemester_kurzbz = $studiensemester_kurzbz; + $ber->start = $start; + $ber->ende = $ende; + $ber->updateamum = date('Y-m-d H:i:s'); + $ber->updatevon = $user; + $ber->kostenstelle_id = $kostenstelle_id; + $ber->anmerkung = $anmerkung; + + if(!$ber->save()) + { + if (!$ber->new) + $errorstr .= "Datensatz konnte nicht upgedatet werden!".$ber->errormsg; + else + $errorstr .= "Datensatz konnte nicht gespeichert werden!".$ber->errormsg; + } + else + { + //Log schreiben + $log = new log(); + + $logdata = var_export((array) $ber, true); + $log->new = true; + $log->sql = $logdata; + $log->sqlundo = 'Kein Undo vorhanden'; + $log->executetime = date('Y-m-d H:i:s'); + $log->mitarbeiter_uid = $user; + if (isset($_POST['neu'])) + $log->beschreibung = 'Neue Berechtigung für '.$uid.' angelegt'; + else + $log->beschreibung = 'Berechtigung für '.$uid.' aktualisiert'; + + if(!$log->save()) + { + $errorstr .= "Fehler beim schreiben des Log-Eintrags
"; + } + } + } + } + } + else + { + $errorstr.='Fehler beim Speichern: '.$rechte->errormsg; + } +} + +if(isset($_POST['copy']) && $_POST['copy'] != '') +{ + if($rechte->isBerechtigt('basis/berechtigung', null, 'suid')) + { $ber = new benutzerberechtigung(); - if (isset($_POST['neu']) || isset($_POST['copy'])) - { - $ber->insertamum=date('Y-m-d H:i:s'); - $ber->insertvon = $user; - $ber->new = true; - } - else - { - if(!$ber->load($benutzerberechtigung_id)) - die('Fehler beim Laden der Berechtigung'); - } - if (isset($_POST['negativ'])) - $ber->negativ = true; - else - $ber->negativ = false; + if(!$ber->load($_POST['copy'])) + die('Fehler beim Laden der Berechtigung'); - $ber->benutzerberechtigung_id = $benutzerberechtigung_id; - $ber->art = $art; - $ber->oe_kurzbz = $oe_kurzbz; - $ber->berechtigung_kurzbz = $berechtigung_kurzbz; - $ber->rolle_kurzbz = $rolle_kurzbz; - $ber->uid = $uid; - $ber->funktion_kurzbz = $funktion_kurzbz; - $ber->studiensemester_kurzbz = $studiensemester_kurzbz; - $ber->start = $start; - $ber->ende = $ende; - $ber->updateamum = date('Y-m-d H:i:s'); - $ber->updatevon = $user; - $ber->kostenstelle_id = $kostenstelle_id; - $ber->anmerkung = $anmerkung; + $ber->new = true; + $ber->insertamum = date('Y-m-d H:i:s'); + $ber->insertvon = $user; - if(!$ber->save()){ + if(!$ber->save()) + { if (!$ber->new) $errorstr .= "Datensatz konnte nicht upgedatet werden!".$ber->errormsg; else $errorstr .= "Datensatz konnte nicht gespeichert werden!".$ber->errormsg; } - /*if ($ber->new) + else { - $reloadstr .= "\n"; - }*/ + //Log schreiben + $log = new log(); + + $logdata = var_export((array) $ber, true); + $log->new = true; + $log->sql = $logdata; + $log->sqlundo = 'Kein Undo vorhanden'; + $log->executetime = date('Y-m-d H:i:s'); + $log->mitarbeiter_uid = $user; + $log->beschreibung = 'Berechtigung für '.$uid.' kopiert'; + + if(!$log->save()) + { + $errorstr .= "Fehler beim schreiben des Log-Eintrags
"; + } + } } else { - $errorstr.='Fehler beim Speichern: Sie haben keine Berechtigung zum Speichern'; + $errorstr.='Fehler beim Speichern: '.$rechte->errormsg; } } @@ -220,10 +405,10 @@ sort($rolle_arr); $b->getBerechtigungen(); foreach($b->result as $berechtigung) { - $berechtigung_arr[] = $berechtigung->berechtigung_kurzbz; + $berechtigung_arr[$berechtigung->berechtigung_kurzbz] = $berechtigung->beschreibung; $berechtigung_beschreibung_arr[] = $berechtigung->beschreibung; } -//var_dump($berechtigung_arr); + $st = new studiensemester(); $st->getAll(); foreach($st->studiensemester as $studiensemester) @@ -233,6 +418,10 @@ foreach($st->studiensemester as $studiensemester) $oe = new organisationseinheit(); $oe->getAll(); +foreach ($oe->result AS $row) +{ + $oe_arr[$row->oe_kurzbz] = $row->organisationseinheittyp_kurzbz.' '.$row->bezeichnung; +} $kostenstelle = new wawi_kostenstelle(); $kostenstelle->getAll(); @@ -259,13 +448,16 @@ if (isset($_REQUEST['uid']) || isset($_REQUEST['funktion_kurzbz'])) $rights->loadBenutzerRollen($uid); $name = new benutzer(); $name->load($uid); - $htmlstr .= "Berechtigungen von ".$name->nachname." ".$name->vorname." (".$uid.")\n"; + + $htmlstr .= "Berechtigungen von ".$name->nachname." ".$name->vorname." (".$uid.")"; + $htmlstr .= "

".$errorstr."

".$successstr."

"; + //Formular zum Kopieren von Berechtigungen - $htmlstr .= "
\n"; - $htmlstr .= "Berechtigungen (aktive) kopieren von UID \n"; - $htmlstr .= "\n"; - $htmlstr .= "\n"; - $htmlstr .= "
\n"; + //$htmlstr .= "
"; + //$htmlstr .= "Berechtigungen (aktive) kopieren von UID "; + //$htmlstr .= ""; + //$htmlstr .= ""; + //$htmlstr .= "
"; $i = 0; // Zusätzlich jede Funktion mit einer gültigen Berechtigung anzeigen @@ -291,11 +483,13 @@ if (isset($_REQUEST['uid']) || isset($_REQUEST['funktion_kurzbz'])) $i++; if ($i==1) { - $htmlstr .= "Geerbte Berechtigungen aus Funktion\n"; + $htmlstr .= "

Geerbte Berechtigungen aus Funktion(en) "; } - $htmlstr .= ($i>1?", ":"").$funktion_bezeichnung->beschreibung.""; + $htmlstr .= ($i > 1 ? ", " : "").$funktion_bezeichnung->beschreibung; } } + if(!empty($funktionsrecht)) + $htmlstr .= '

'; } } elseif(isset($_REQUEST['funktion_kurzbz']) && $_REQUEST['funktion_kurzbz']!='') @@ -307,10 +501,10 @@ if (isset($_REQUEST['uid']) || isset($_REQUEST['funktion_kurzbz'])) die('Funktion existiert nicht'); $rights->loadBenutzerRollen(null, $funktion_kurzbz); - $htmlstr .= "Berechtigungen der Funktion ".$funktion->beschreibung."\n"; + $htmlstr .= "Berechtigungen der Funktion ".$funktion->beschreibung.""; } - //$htmlstr .= "Berechtigungen von ".$name->nachname." ".$name->vorname." (".$uid.")".$funktion_kurzbz."\n"; + //$htmlstr .= "Berechtigungen von ".$name->nachname." ".$name->vorname." (".$uid.")".$funktion_kurzbz.""; /*$htmlstr .= '      Filter: Alle | nur WaWi @@ -318,16 +512,19 @@ if (isset($_REQUEST['uid']) || isset($_REQUEST['funktion_kurzbz'])) ';*/ - $htmlstr .= "\n"; //Alternatives styling fuer Tablesorter um Platz zu sparen. - $htmlstr .= "\n"; + //////////////// + // Neue Berechtigung einfügen + //////////////// + + $htmlstr .= "
"; + $htmlstr .= ""; $htmlstr .= " - - - + + @@ -335,63 +532,52 @@ if (isset($_REQUEST['uid']) || isset($_REQUEST['funktion_kurzbz'])) - - \n"; + "; - $htmlstr .= "\n"; - $htmlstr .= "\n"; - $htmlstr .= "\n"; - $htmlstr .= "\n"; - $htmlstr .= "\n"; - $htmlstr .= "\n"; + $htmlstr .= ""; + $htmlstr .= ""; + $htmlstr .= ""; + $htmlstr .= ""; + $htmlstr .= ""; + $htmlstr .= ""; - //Status - $htmlstr .= " \n"; + $htmlstr .= ""; //Rolle - $htmlstr .= " \n"; + $htmlstr .= " "; //Berechtigung_kurzbz - $htmlstr .= " \n"; + $htmlstr .= " "; //Art - $htmlstr .= " \n"; + $htmlstr .= " "; //Organisationseinheit - if($funktion_kurzbz!='') - $htmlstr .= " \n"; + if($funktion_kurzbz != '') + { + $htmlstr .= " "; + } else { - $htmlstr .= " \n"; + $htmlstr .= " "; } //Kostenstelle - $htmlstr .= " \n"; + $htmlstr .= " "; - $htmlstr .= " \n"; - $htmlstr .= " \n"; - $htmlstr .= " \n"; + //Negativ + $htmlstr .= " "; + + //Start + $htmlstr .= " "; + + //Ende + $htmlstr .= " "; //Anmerkung - $htmlstr .= " \n"; + $htmlstr .= " "; - $htmlstr .= " "; - $htmlstr .= "\n"; - $htmlstr .= " \n"; + $htmlstr .= " "; + $htmlstr .= ""; + $htmlstr .= "
Rolle Berechtigung ArtOrganisationseinheitKostenstelleOrganisationseinheitKostenstelle Neg Gültig ab Gültig bisInfo
 Neu: "; + $htmlstr .= " "; + $htmlstr .= " "; + $htmlstr .= " "; + $htmlstr .= " OE aus MA-FunktionOE aus MA-Funktion"; + $htmlstr .= " "; + $htmlstr .= " "; + $htmlstr .= "
"; + + $htmlstr .= "
"; + + //////////////// + // Tabelle für bestehende Berechtigungen + //////////////// + + $htmlstr .= "
"; + + $htmlstr .= ""; + $htmlstr .= ""; + $htmlstr .= " + + + +
+ + +
+ "; + $htmlstr .= ""; + $htmlstr .= ""; + $htmlstr .= " + + + + + + + + + + + + + + + "; foreach($rights->berechtigungen as $b) { @@ -430,199 +659,139 @@ if (isset($_REQUEST['uid']) || isset($_REQUEST['funktion_kurzbz'])) break; default: break; } - if(isset($_POST['edit']) && $_POST['benutzerberechtigung_id']==$b->benutzerberechtigung_id) + + $htmlstr .= " "; + $heute = strtotime(date('Y-m-d')); + if ($b->ende!='' && strtotime($b->ende) < $heute) { - $htmlstr .= " \n"; - $htmlstr .= "\n"; - $htmlstr .= "\n"; - $htmlstr .= "\n"; - $htmlstr .= "\n"; - - $heute = strtotime(date('Y-m-d')); - if ($b->ende!='' && strtotime($b->ende)<$heute) - { - $status="ampel_rot.png"; - $titel="ccc"; - } - elseif ($b->start!='' && strtotime($b->start)>$heute) - { - $status="ampel_gelb.png"; - $titel="bbb"; - } - else - { - $status="ampel_gruen.png"; - $titel="aaa"; - } - //Status - $htmlstr .= " \n"; - //Rolle - $htmlstr .= " \n"; - - //Berechtigung - $htmlstr .= " \n"; - - //Art - $htmlstr .= " \n"; - - //Organisationseinheit - if($funktion_kurzbz!='') - $htmlstr .= " \n"; - else - { - $htmlstr .= " \n"; - } - - //Kostenstelle - $htmlstr .= " \n"; - - $htmlstr .= " \n"; - $htmlstr .= " \n"; - $htmlstr .= " \n"; - $htmlstr .= " \n"; - $htmlstr .= " \n"; - - $htmlstr .= " "; - $htmlstr .= " "; - $htmlstr .= "\n"; - $htmlstr .= " \n"; + $titel="ccc"; + $style = 'style="border-left: 10px solid tomato; border-right: 10px solid transparent; text-align: center; vertical-align: middle"'; + } + elseif ($b->start!='' && strtotime($b->start) > $heute) + { + $titel="bbb"; + $style = 'style="border-left: 10px solid gold; border-right: 10px solid transparent; text-align: center; vertical-align: middle"'; } else { - $htmlstr .= " \n"; - $htmlstr .= "\n"; - $htmlstr .= "\n"; - $htmlstr .= "\n"; - $htmlstr .= "\n"; + $titel="aaa"; + $style = 'style="border-left: 10px solid LightGreen; border-right: 10px solid transparent; text-align: center; vertical-align: middle"'; + } + // Auswahlcheckbox + $htmlstr .= " "; - $heute = strtotime(date('Y-m-d')); - if ($b->ende!='' && strtotime($b->ende)<$heute) + //Rolle + $htmlstr .= " \n"; - //Rolle - $htmlstr .= " \n"; + $sel = ""; + $htmlstr .= ""; + } + $htmlstr .= " "; + $htmlstr.=""; - //Berechtigung - $htmlstr .= " \n"; + //Berechtigung + $htmlstr .= " "; - //Art - $htmlstr .= " \n"; + //Art + $htmlstr .= " "; - //Organisationseinheit - $oekey = $oe->result; - $org = new organisationseinheit(); - $org->load($b->oe_kurzbz); - $htmlstr .= " \n"; - - //Kostenstelle - $kst = new wawi_kostenstelle(); - $kst->load($b->kostenstelle_id); - if(!$kst->aktiv) - $style='style="text-decoration:line-through;"'; - else - $style=''; - $htmlstr .= " \n"; - - - $htmlstr .= " \n"; - $htmlstr .= " \n"; - $htmlstr .= " \n"; - $htmlstr .= " \n"; - $htmlstr .= " \n"; - - $htmlstr .= " "; - $htmlstr .= " "; - $htmlstr .= "\n"; - $htmlstr .= " \n"; + //Organisationseinheit + if($funktion_kurzbz != '') + { + $htmlstr .= " "; + } + else + { + $htmlstr .= " "; } + //Kostenstelle + $htmlstr .= " "; + + //Negativ-Checkbox + $htmlstr .= " "; + + //Gültig ab + $htmlstr .= " "; + + // Gültig bis + $htmlstr .= " "; + + //Anmerkung + $htmlstr .= " "; + + //Info + $htmlstr .= " "; + + $htmlstr .= " "; + $htmlstr .= " "; } - - $htmlstr .= "
RolleBerechtigungArtOrganisationseinheitKostenstelleNegGültig abGültig bisAnmerkungInfo
aktiv"; - - // Wenn editiert wird, zu der Zeile Springen - $htmlstr.=" - - "; - $htmlstr.="OE aus MA-Funktionnegativ?'checked="checked"':'')." onchange='markier(\"td_".$b->benutzerberechtigung_id."\")'>anmerkung))."' size='30' maxlength='256' markier(\"td_".$b->benutzerberechtigung_id."\")'>information  
"; + $htmlstr .= " ".$titel.""; + $htmlstr .= " "; + $htmlstr .= " "; + $htmlstr .= " aktiv$b->rolle_kurzbz$b->berechtigung_kurzbz"; + $htmlstr .= " ".$b->berechtigung_kurzbz.""; + $htmlstr .= " berechtigung_kurzbz] : '')."'>"; + $htmlstr .= " ".$b->art.""; + $htmlstr .= " ".$b->art.""; + $htmlstr .= " "; + $htmlstr .= " ".$org->organisationseinheittyp_kurzbz." ".$org->bezeichnung."$kst->bezeichnungnegativ?'checked="checked"':'')." onchange='markier(\"td_".$b->benutzerberechtigung_id."\")' disabled>".$b->start."".$b->ende."".$b->anmerkung."information
OE aus MA-Funktion"; + $htmlstr .= " ".($b->oe_kurzbz != '' ? $oe_arr[$b->oe_kurzbz] : '').""; + $htmlstr .= " "; + $htmlstr .= " oe_kurzbz] : '')."'>"; + $htmlstr .= " "; + $htmlstr .= " "; + $htmlstr .= " negativ?'checked="checked"':'').">"; + $htmlstr .= " "; + $htmlstr .= " ".$b->start.""; + $htmlstr .= " "; + $htmlstr .= " "; + $htmlstr .= " ".$b->ende.""; + $htmlstr .= " "; + $htmlstr .= " "; + $htmlstr .= " anmerkung))."' size='30' maxlength='256'>"; + $htmlstr .= " information"; + $htmlstr .= " "; + $htmlstr .= " "; + $htmlstr .= "
\n"; + $htmlstr .= ""; + $htmlstr .= '
+
'; + $htmlstr .= ''; + $htmlstr .= ' + +
'; + $htmlstr .= ""; } -$htmlstr .= "
".$errorstr."
\n"; + ?> @@ -635,58 +804,19 @@ $htmlstr .= "
".$errorstr."
\n"; - - - + + + + + + '; + ?> - + + -

Berechtigung - Rolle - Übersicht

+

Berechtigung - Rolle -

deleteRolleBerechtigung($rolle_kurzbz, $berechtigung_kurzbz)): ?> Fehler beim Löschen: errormsg ?> - Berechtigung gelöscht! + Berechtigung gelöscht! -
- Zurück + Zurück zur Rollenübersicht -

RolleBerechtigung "":

- +

getBerechtigungen(); ?>
+ - - - + + + +
@@ -154,6 +216,8 @@ $delete = filter_input(INPUT_GET, 'delete', FILTER_VALIDATE_BOOLEAN); getRolleBerechtigung($rolle_kurzbz); foreach($berechtigungen->result as $rolle): ?> @@ -161,7 +225,7 @@ $delete = filter_input(INPUT_GET, 'delete', FILTER_VALIDATE_BOOLEAN); From 572e53f554f2d290d8f3d2241dbbfb134634c7b8 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 25 Oct 2022 07:02:13 +0200 Subject: [PATCH 095/279] - addon angepassst fuer die stammdaten --- application/views/system/infocenter/stammdaten.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/views/system/infocenter/stammdaten.php b/application/views/system/infocenter/stammdaten.php index 6dba795d9..ac8f6347c 100644 --- a/application/views/system/infocenter/stammdaten.php +++ b/application/views/system/infocenter/stammdaten.php @@ -111,13 +111,13 @@ - @@ -100,7 +93,6 @@
art ?> beschreibung ?> - + entfernen kontakttyp) ?> - kontakttyp.'">';?> + kontakttyp.'" data-value="'. $kontakt->kontakt .'">';?> kontakttyp === 'email'): ?> kontakt; endif; if (($kontakt->kontakttyp === 'telefon' || $kontakt->kontakttyp === 'mobil')) - echo ''; + echo ''; else echo $kontakt->kontakt; if ($kontakt->kontakttyp === 'email'): From 9192befce1cf461f9474865b1f7bddf7dd685346 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 25 Oct 2022 07:08:29 +0200 Subject: [PATCH 096/279] - stammdaten include --- application/views/system/infocenter/infocenterZgvDetails.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/views/system/infocenter/infocenterZgvDetails.php b/application/views/system/infocenter/infocenterZgvDetails.php index 62fefbec8..5bfb6c603 100644 --- a/application/views/system/infocenter/infocenterZgvDetails.php +++ b/application/views/system/infocenter/infocenterZgvDetails.php @@ -26,7 +26,8 @@ 'public/js/tablesort/tablesort.js', 'public/js/infocenter/messageList.js', 'public/js/infocenter/infocenterDetails.js', - 'public/js/infocenter/zgvUeberpruefung.js' + 'public/js/infocenter/zgvUeberpruefung.js', + 'public/js/infocenter/stammdaten.js', ), 'phrases' => array( 'infocenter' => array( From 4518eab1a81a94697c8ee6b4293ba7a8a5dd8e2f Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 25 Oct 2022 07:14:47 +0200 Subject: [PATCH 097/279] - stammdaten include --- application/views/system/infocenter/infocenterDetails.php | 3 ++- application/views/system/infocenter/infocenterZgvDetails.php | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index 76a371c11..c8b16a1c3 100644 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -27,7 +27,8 @@ 'public/js/infocenter/messageList.js', 'public/js/infocenter/infocenterDetails.js', 'public/js/infocenter/zgvUeberpruefung.js', - 'public/js/infocenter/docUeberpruefung.js' + 'public/js/infocenter/docUeberpruefung.js', + 'public/js/infocenter/stammdaten.js' ), 'phrases' => array( 'infocenter' => array( diff --git a/application/views/system/infocenter/infocenterZgvDetails.php b/application/views/system/infocenter/infocenterZgvDetails.php index 5bfb6c603..62fefbec8 100644 --- a/application/views/system/infocenter/infocenterZgvDetails.php +++ b/application/views/system/infocenter/infocenterZgvDetails.php @@ -26,8 +26,7 @@ 'public/js/tablesort/tablesort.js', 'public/js/infocenter/messageList.js', 'public/js/infocenter/infocenterDetails.js', - 'public/js/infocenter/zgvUeberpruefung.js', - 'public/js/infocenter/stammdaten.js', + 'public/js/infocenter/zgvUeberpruefung.js' ), 'phrases' => array( 'infocenter' => array( From f7bd49b408cea514c491695ed9404080f1fd66fb Mon Sep 17 00:00:00 2001 From: ma0048 Date: Fri, 28 Oct 2022 10:56:02 +0200 Subject: [PATCH 098/279] - master messages an studiengang, wenn bereits bestaetigt - lehrgang messages direkt an lehrgang --- application/models/CL/Messages_model.php | 4 ++-- application/models/crm/Prestudent_model.php | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/application/models/CL/Messages_model.php b/application/models/CL/Messages_model.php index b987102dd..04192a7b4 100644 --- a/application/models/CL/Messages_model.php +++ b/application/models/CL/Messages_model.php @@ -128,8 +128,8 @@ class Messages_model extends CI_Model { $ouOptions .= sprintf( "\n".'', - is_numeric($ou->prestudent_id) ? $ou->oe_kurzbz : self::ALT_OE, - $ou->bezeichnung . (is_numeric($ou->prestudent_id) ? '' : ' *') + ($ou->typ === 'l' ? $ou->oe_kurzbz : (is_numeric($ou->prestudent_id) ? $ou->oe_kurzbz : self::ALT_OE)), + $ou->bezeichnung . ((is_numeric($ou->prestudent_id) || $ou->typ === 'l' ) ? '' : ' *') ); } } diff --git a/application/models/crm/Prestudent_model.php b/application/models/crm/Prestudent_model.php index f37b715f4..9addfcc95 100644 --- a/application/models/crm/Prestudent_model.php +++ b/application/models/crm/Prestudent_model.php @@ -560,9 +560,10 @@ class Prestudent_model extends DB_Model o.bezeichnung, (CASE WHEN sg.typ = \'b\' THEN ps.prestudent_id - WHEN sg.typ = \'m\' THEN ps.prestudent_id + WHEN sg.typ = \'m\' THEN mps.prestudent_id ELSE NULL - END) AS prestudent_id + END) AS prestudent_id, + sg.typ FROM public.tbl_prestudent p JOIN public.tbl_studiengang sg USING(studiengang_kz) JOIN public.tbl_organisationseinheit o USING(oe_kurzbz) @@ -571,11 +572,17 @@ class Prestudent_model extends DB_Model FROM public.tbl_prestudentstatus WHERE status_kurzbz = \'Bewerber\' ) ps USING(prestudent_id) + LEFT JOIN ( + SELECT prestudent_id + FROM public.tbl_prestudentstatus + WHERE status_kurzbz = \'Interessent\' AND bestaetigtam IS NOT NULL + ) mps ON p.prestudent_id = mps.prestudent_id WHERE p.person_id = ? GROUP BY o.oe_kurzbz, o.bezeichnung, sg.typ, ps.prestudent_id, + mps.prestudent_id, p.prestudent_id ORDER BY o.bezeichnung'; From f0fd071e312d0010431a3caca56afcb070cb6461 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Mon, 31 Oct 2022 13:44:17 +0100 Subject: [PATCH 099/279] - notizen ausblenden --- content/lvplanung/lehrveranstaltungoverlay.js.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/content/lvplanung/lehrveranstaltungoverlay.js.php b/content/lvplanung/lehrveranstaltungoverlay.js.php index 436c48eb8..ac2c94948 100644 --- a/content/lvplanung/lehrveranstaltungoverlay.js.php +++ b/content/lvplanung/lehrveranstaltungoverlay.js.php @@ -820,7 +820,12 @@ function LeAuswahl() LehrveranstaltungNotenLoad(lehrveranstaltung_id); //Notizen Tab ausblenden - //document.getElementById('lehrveranstaltung-tab-notizen').collapsed=true; + document.getElementById('lehrveranstaltung-tab-notizen').collapsed=true; + + if(document.getElementById('lehrveranstaltung-tabs').selectedItem === document.getElementById('lehrveranstaltung-tab-notizen')) + { + document.getElementById('lehrveranstaltung-tabs').selectedItem = document.getElementById('lehrveranstaltung-tab-detail'); + } //LV-Angebot Tab einblenden und Gruppen laden document.getElementById('lehrveranstaltung-tab-lvangebot').collapsed=false; @@ -853,7 +858,7 @@ function LeAuswahl() //document.getElementById('lehrveranstaltung-tab-noten').collapsed=true; //Notizen Tab einblenden - //document.getElementById('lehrveranstaltung-tab-notizen').collapsed=false; + document.getElementById('lehrveranstaltung-tab-notizen').collapsed=false; //LV-Angebot Tab ausblenden document.getElementById('lehrveranstaltung-tab-lvangebot').collapsed=true; From 651a4a97e7f22138ce7ac683445a08fcedd2a8f6 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 2 Nov 2022 16:50:53 +0100 Subject: [PATCH 100/279] - stammdaten editierbar --- .../system/infocenter/InfoCenter.php | 44 +++++- .../views/system/infocenter/stammdaten.php | 76 ++++++++--- public/js/infocenter/stammdaten.js | 128 +++++++++++++++++- 3 files changed, 225 insertions(+), 23 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index deaee0e10..187a006bd 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -175,6 +175,7 @@ class InfoCenter extends Auth_Controller $this->load->model('codex/Nation_model', 'NationModel'); $this->load->model('person/Kontakt_model', 'KontaktModel'); $this->load->model('person/Geschlecht_model', 'GeschlechtModel'); + $this->load->model('person/adresse_model', 'AdresseModel'); // Loads libraries $this->load->library('PersonLogLib'); @@ -1367,7 +1368,7 @@ class InfoCenter extends Auth_Controller $this->terminateWithJsonError($this->p->t('ui', 'fehlerBeimSpeichern')); $kontakte = $this->input->post('kontakt'); - foreach($kontakte as $kontakt) + foreach ($kontakte as $kontakt) { $kontaktExists = $this->KontaktModel->loadWhere(array( 'kontakt_id' => $kontakt['id'], @@ -1398,6 +1399,47 @@ class InfoCenter extends Auth_Controller $this->terminateWithJsonError($this->p->t('ui', 'fehlerBeimSpeichern')); } } + + $adressen = $this->input->post('adresse'); + + foreach ($adressen as $adresse) + { + $adresseExists = $this->AdresseModel->loadWhere(array( + 'adresse_id' => $adresse['id'], + 'person_id' => $person_id, + )); + + if (hasData($adresseExists)) + { + $adresse = $adresse['value']; + $adresseExists = getData($adresseExists)[0]; + if ($adresseExists->strasse !== $adresse['strasse'] || + $adresseExists->plz !== $adresse['plz'] || + $adresseExists->ort !== $adresse['ort'] || + $adresseExists->nation !== $adresse['nation']) + { + $update = $this->AdresseModel->update( + array + ( + 'adresse_id' => $adresseExists->adresse_id + ), + array + ( + 'strasse' => isEmptyString($adresse['strasse']) ? null : $adresse['strasse'], + 'plz' => isEmptyString($adresse['plz']) ? null : $adresse['plz'], + 'ort' => isEmptyString($adresse['ort']) ? null : $adresse['ort'], + 'nation' => isEmptyString($adresse['nation']) ? null : $adresse['nation'], + 'updateamum' => date('Y-m-d H:i:s'), + 'updatevon' => $this->_uid + ) + ); + + if (isError($update)) + $this->terminateWithJsonError($this->p->t('ui', 'fehlerBeimSpeichern')); + } + + } + } $this->outputJsonSuccess('Success'); } diff --git a/application/views/system/infocenter/stammdaten.php b/application/views/system/infocenter/stammdaten.php index ac8f6347c..47cf7b253 100644 --- a/application/views/system/infocenter/stammdaten.php +++ b/application/views/system/infocenter/stammdaten.php @@ -3,36 +3,52 @@ - + + - + +
nachname ?>
+ + - + +
gebdatum), 'd.m.Y') ?>
+ + +
svnr ?>
+ + - +
p->t('person','titelpre')) ?> +
titelpre ?>
+
p->t('person','vorname')) ?> +
vorname ?>
+ + +
p->t('person','nachname')) ?> -
p->t('person','titelpost')) ?> +
titelpost ?>
+ +
p->t('person','geburtsdatum')) ?> -
p->t('person','svnr')) ?> -
p->t('person','staatsbuergerschaft')) ?> - - p->t('person','geburtsnation')) ?> -
p->t('person','geburtsort')) ?> +
gebort ?>
+ +
@@ -111,14 +130,14 @@
kontakttyp) ?> - kontakttyp.'" data-value="'. $kontakt->kontakt .'">';?> + kontakttyp.'" data-id="'. $kontakt->kontakt_id .'" data-value="' . $kontakt->kontakt .'">';?> kontakttyp === 'email'): ?> kontakt; endif; - if (($kontakt->kontakttyp === 'telefon' || $kontakt->kontakttyp === 'mobil')) - echo ''; - else + /*if (($kontakt->kontakttyp === 'telefon' || $kontakt->kontakttyp === 'mobil')) + echo ''; + else*/ echo $kontakt->kontakt; if ($kontakt->kontakttyp === 'email'): ?> @@ -135,8 +154,33 @@ p->t('person','adresse')) ?> - strasse.', '.$adresse->plz.' '.$adresse->ort : '' ?> - nationkurztext) ? '
'.$adresse->nationkurztext : '' ?> + +
+
strasse ?>
+ + +
plz ?>
+ + +
ort ?>
+ + + nationkurztext)): ?> + +
+
+ +
heimatadresse === true ? 'Heimatadresse' : ''). diff --git a/public/js/infocenter/stammdaten.js b/public/js/infocenter/stammdaten.js index d63df7b2f..a8a15b23b 100644 --- a/public/js/infocenter/stammdaten.js +++ b/public/js/infocenter/stammdaten.js @@ -15,13 +15,27 @@ $(document).ready(function () $('.saveStammdaten').click(function() { var kontakt = []; - $('.kontakt_nummer').each(function(){ + $('.kontakt_input').each(function(){ kontakt.push({ - id: $(this).data('value'), + id: $(this).data('id'), value: $(this).val() }); }); + var adresse = []; + $('.adresse').each(function(){ + var id = $(this).data('value'); + adresse.push({ + id: id, + value: { + 'strasse': $('#input_strasse_' + id).val(), + 'plz': $('#input_plz_' + id).val(), + 'ort': $('#input_ort_' + id).val(), + 'nation': $('#nation_' + id).val(), + } + }); + }); + var data = { "personid" : personid, "titelpre" : $('#titelpre').val(), @@ -34,8 +48,8 @@ $(document).ready(function () "geschlecht" : $('#geschlecht').val(), "gebnation" : $('#gebnation').val(), "gebort" : $('#gebort').val(), - "kontakt" : kontakt - + "kontakt" : kontakt, + "adresse" : adresse, }; Stammdaten.update(personid, data); }); @@ -52,6 +66,8 @@ var Stammdaten = { if (FHC_AjaxClient.isSuccess(data)) { FHC_DialogLib.alertSuccess("Done!"); + Stammdaten._showKontakt(); + Stammdaten._showAdresse(); Stammdaten._hide(); } else @@ -66,9 +82,62 @@ var Stammdaten = { ); }, + _showKontakt: function() + { + $('.kontakt_input').each(function() { + var span = $(this).parent('td').children('span'); + var value = $(this).val(); + + var oldSpanValue = span.data('value'); + span.data('value', value); + var newhtml = span.html().replace(oldSpanValue, value); + span.html(newhtml); + if (span.hasClass('email')) + span.find('a').attr('href', 'mailto:' + value); + + span.show(); + $(this).remove(); + }); + }, + + _showAdresse: function() + { + $('.adresse').each(function() { + var adressenID = $(this).data('value'); + $(this).children('input').each(function() { + $(this).attr('id'); + var div = $(this).attr('id').replace('input_', ''); + $('#' + div).html($(this).val()) + $('#' + div).show(); + $(this).remove(); + }); + }); + + }, + _hide: function() { - $('.stammdaten_form').find('input, select').attr('readonly', true); + var stammdatenform = $('.stammdaten_form'); + stammdatenform.find('select').attr('disabled', true); + + $('.stammdaten').each(function(){ + var id = $(this).attr('id'); + var div = $('
'); + div.attr('id', id); + div.addClass('stammdaten'); + div.html($(this).val()); + $(this).parent('td').html(div); + }); + + $('.kontakt_input').each(function(){ + $(this).parent('td').children('span').show(); + $(this).remove(); + }); + + $('.adresse_input').each(function(){ + $(this).parent('div').children('div').show(); + $(this).remove(); + }); $('.editActionStammdaten').hide(); $('.editStammdaten').show(); @@ -76,9 +145,56 @@ var Stammdaten = { _show: function() { - $('.stammdaten_form').find('input, select').attr('readonly', false); + $('.stammdaten').each(function() { + var id = $(this).attr('id'); + var input = $(''); + input.attr('id', id); + input.addClass('form-control stammdaten'); + input.val($(this).html()); + $(this).parent('td').html(input); + }); + $('.kontakt').each(function() { + var id = $(this).data('id'); + var value = $(this).data('value'); + + $(this).hide(); + + var input = $(''); + input.attr('data-id', id); + input.attr('value', value); + input.addClass('form-control kontakt_input'); + input.val(value); + $(this).parent('td').append(input); + }); + + $('.adresse').each(function() { + var adressenID = $(this).data('value'); + $($(this).children('div').get().reverse()).each(function() { + $(this).hide(); + var id = $(this).attr('id'); + + var input = $(''); + var value = $(this).html(); + + input.attr('id', 'input_' + Stammdaten._getPlaceholder(id) + "_" + adressenID); + input.attr('value', value); + input.attr('placeholder', Stammdaten._getPlaceholder(id).toUpperCase()); + input.addClass('form-control adresse_input'); + input.val(value); + $(this).parent().prepend(input); + }); + }); + + var stammdatenform = $('.stammdaten_form'); + + stammdatenform.find('select').attr('disabled', false); $('.editActionStammdaten').show(); $('.editStammdaten').hide(); + }, + + _getPlaceholder(elementid) + { + return elementid.substr(0, elementid.indexOf("_")); } } \ No newline at end of file From ffec6a5422230a7fc8dde995f45e37dec19db966 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 3 Nov 2022 09:55:38 +0100 Subject: [PATCH 101/279] - stammdaten editierbar --- .../views/system/infocenter/stammdaten.php | 26 +--- public/js/infocenter/stammdaten.js | 139 +++++++++--------- 2 files changed, 73 insertions(+), 92 deletions(-) diff --git a/application/views/system/infocenter/stammdaten.php b/application/views/system/infocenter/stammdaten.php index 47cf7b253..f143c9c03 100644 --- a/application/views/system/infocenter/stammdaten.php +++ b/application/views/system/infocenter/stammdaten.php @@ -6,43 +6,36 @@
titelpre ?>
p->t('person','vorname')) ?>
vorname ?>
- -
p->t('person','nachname')) ?>
nachname ?>
-
p->t('person','titelpost')) ?>
titelpost ?>
-
p->t('person','geburtsdatum')) ?>
gebdatum), 'd.m.Y') ?>
-
p->t('person','svnr')) ?>
svnr ?>
-
p->t('person','geburtsort')) ?>
gebort ?>
-
@@ -135,10 +127,7 @@ kontakt; endif; - /*if (($kontakt->kontakttyp === 'telefon' || $kontakt->kontakttyp === 'mobil')) - echo ''; - else*/ - echo $kontakt->kontakt; + echo $kontakt->kontakt; if ($kontakt->kontakttyp === 'email'): ?> @@ -155,16 +144,13 @@ -
-
strasse ?>
- +
+
strasse ?>
-
plz ?>
- +
plz ?>
-
ort ?>
- - +
ort ?>
+ nationkurztext)): ?> '); - input.attr('id', id); - input.addClass('form-control stammdaten'); + input.attr('id', id + '_input'); + input.addClass('form-control stammdaten_input'); input.val($(this).html()); - $(this).parent('td').html(input); + $(this).hide(); + $(this).parent('td').append(input); }); $('.kontakt').each(function() { @@ -169,17 +125,17 @@ var Stammdaten = { }); $('.adresse').each(function() { - var adressenID = $(this).data('value'); + var adressenID = $(this).data('id'); $($(this).children('div').get().reverse()).each(function() { $(this).hide(); - var id = $(this).attr('id'); - + var type = $(this).data('type'); + var value = $(this).data('value'); var input = $(''); - var value = $(this).html(); - input.attr('id', 'input_' + Stammdaten._getPlaceholder(id) + "_" + adressenID); + input.attr('data-type', type); + input.attr('id', type + '_' + adressenID); input.attr('value', value); - input.attr('placeholder', Stammdaten._getPlaceholder(id).toUpperCase()); + input.attr('placeholder', type.toUpperCase()); input.addClass('form-control adresse_input'); input.val(value); $(this).parent().prepend(input); @@ -193,8 +149,47 @@ var Stammdaten = { $('.editStammdaten').hide(); }, - _getPlaceholder(elementid) + _updated: function() { - return elementid.substr(0, elementid.indexOf("_")); - } + $('.kontakt_input').each(function() { + var span = $(this).parent('td').children('span'); + var value = $(this).val(); + + var oldSpanValue = span.data('value'); + span.data('value', value); + var newhtml = span.html().replace(oldSpanValue, value); + span.html(newhtml); + if (span.hasClass('email')) + span.find('a').attr('href', 'mailto:' + value); + + span.show(); + $(this).remove(); + }); + + $('.adresse').each(function() { + $(this).children('input').each(function() { + var value = $(this).val(); + var type = $(this).data('type'); + var div = $('div[data-type="' + type + '"]'); + div.data('value', value); + div.html(value); + div.show(); + $(this).remove(); + }); + }); + + $('.stammdaten_input').each(function() { + var div = $(this).parent('td').children('div'); + var value = $(this).val(); + div.html(value); + div.show(); + $(this).remove(); + }); + + var stammdatenform = $('.stammdaten_form'); + stammdatenform.find('select').attr('disabled', true); + + $('.editActionStammdaten').hide(); + $('.editStammdaten').show(); + }, } \ No newline at end of file From 71c953bac77b809cc651cd4380c4d7f17a0b953a Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Thu, 3 Nov 2022 12:04:46 +0100 Subject: [PATCH 102/279] studentenmeldung: standort_code is retrieved and set in xml correctly (first prestudent, then studiengang) --- vilesci/bis/studentenmeldung.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/vilesci/bis/studentenmeldung.php b/vilesci/bis/studentenmeldung.php index 140108a12..01d2dc766 100644 --- a/vilesci/bis/studentenmeldung.php +++ b/vilesci/bis/studentenmeldung.php @@ -271,7 +271,8 @@ if (CAMPUS_NAME == 'FH Technikum Wien' && $stg_kz==10006) DISTINCT ON(student_uid, nachname, vorname) *, public.tbl_person.person_id AS pers_id, to_char(gebdatum, 'ddmmyy') AS vdat, public.tbl_prestudent.foerderrelevant as pre_foerderrelevant, - public.tbl_studiengang.foerderrelevant as stg_foerderrelevant + public.tbl_studiengang.foerderrelevant as stg_foerderrelevant, + COALESCE(tbl_prestudent.standort_code, tbl_studiengang.standort_code) AS bis_standort_code FROM public.tbl_student JOIN public.tbl_benutzer ON(student_uid=uid) @@ -295,7 +296,8 @@ elseif ($stg_kz == 'alleBaMa') DISTINCT ON(tbl_student.studiengang_kz, matrikelnr, nachname, vorname) *, public.tbl_person.person_id AS pers_id, to_char(gebdatum, 'ddmmyy') AS vdat, public.tbl_prestudent.foerderrelevant as pre_foerderrelevant, - public.tbl_studiengang.foerderrelevant as stg_foerderrelevant + public.tbl_studiengang.foerderrelevant as stg_foerderrelevant, + COALESCE(tbl_prestudent.standort_code, tbl_studiengang.standort_code) AS bis_standort_code FROM public.tbl_student JOIN public.tbl_benutzer ON(student_uid=uid) @@ -327,7 +329,8 @@ else DISTINCT ON(student_uid, nachname, vorname) *, public.tbl_person.person_id AS pers_id, to_char(gebdatum, 'ddmmyy') AS vdat, public.tbl_prestudent.foerderrelevant as pre_foerderrelevant, - public.tbl_studiengang.foerderrelevant as stg_foerderrelevant + public.tbl_studiengang.foerderrelevant as stg_foerderrelevant, + COALESCE(tbl_prestudent.standort_code, tbl_studiengang.standort_code) AS bis_standort_code FROM public.tbl_student JOIN public.tbl_benutzer ON(student_uid=uid) @@ -1615,7 +1618,7 @@ function GenerateXMLStudentBlock($row) if(!$ausserordentlich) { $datei.=" - ".$row->standort_code.""; + ".$row->bis_standort_code.""; } /* * BMWFFoerderrung derzeit fuer alle Studierende auf Ja gesetzt From 4dd983c105d4c1985dbafdba96b5341d0d44f53e Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Thu, 3 Nov 2022 12:52:31 +0100 Subject: [PATCH 103/279] Phrases --- system/phrasesupdate.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 8ac09cee0..1cbab4108 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -15708,6 +15708,46 @@ array( ) ) ), + array( + 'app' => 'core', + 'category' => 'kvp', + 'phrase' => 'new.error.nostandardcourse.title', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Fehler", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Error", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'kvp', + 'phrase' => 'new.error.nostandardcourse.msg', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Dieser Moodle Kurs ist keinem standardisierten Quellkurs zugeordnet", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "This Moodle Course is not derived from a standardized Source Course", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'kvp', From ebb3a6de1fd9e5949233319b5ab07cba18e4c965 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Thu, 3 Nov 2022 15:33:05 +0100 Subject: [PATCH 104/279] plausichecks view: adapted to vue update - set correct cs and css includes, removed body --- application/views/system/issues/plausichecks.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/application/views/system/issues/plausichecks.php b/application/views/system/issues/plausichecks.php index 99d426199..4016e64cd 100644 --- a/application/views/system/issues/plausichecks.php +++ b/application/views/system/issues/plausichecks.php @@ -3,12 +3,12 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => 'Plausichecks', - 'jquery' => true, - 'jqueryui' => true, + 'jquery3' => true, + 'jqueryui1' => true, 'jquerycheckboxes' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, 'ajaxlib' => true, 'navigationwidget' => true, 'dialoglib' => true, @@ -18,7 +18,6 @@ $this->load->view( ); ?> -
widgetlib->widget('NavigationWidget'); ?> @@ -98,6 +97,5 @@ $this->load->view(
- load->view('templates/FHC-Footer'); ?> From a9d065044dfc075033e2dba8a53e6e2038f54d87 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Mon, 7 Nov 2022 12:17:09 +0100 Subject: [PATCH 105/279] - Inaktive LektorInnen im Lehrauftrags-Dropdown kennzeichnen --- .../lehrveranstaltungdetailoverlay.xul.php | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/content/lvplanung/lehrveranstaltungdetailoverlay.xul.php b/content/lvplanung/lehrveranstaltungdetailoverlay.xul.php index e18407e72..0d238d179 100644 --- a/content/lvplanung/lehrveranstaltungdetailoverlay.xul.php +++ b/content/lvplanung/lehrveranstaltungdetailoverlay.xul.php @@ -469,12 +469,24 @@ $p = new phrasen($sprache);