mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Merge remote-tracking branch 'origin/master' into feature-19484/infocenter_reihungstest_freigegeben_liste_zeigt_immer_nur_einen_an
This commit is contained in:
@@ -7,8 +7,8 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
$config['interval_blocking_application'] = 'P1M';
|
||||
|
||||
// Application submission period given by start- and enddate.
|
||||
$config['submit_application_start'] = '01.02.2021';
|
||||
$config['submit_application_end'] = '22.02.2021';
|
||||
$config['submit_application_start'] = '05.09.2022';
|
||||
$config['submit_application_end'] = '22.09.2022';
|
||||
|
||||
// Lehrveranstaltungen with these grades will be blocked for application
|
||||
$config['grades_blocking_application'] = array(
|
||||
|
||||
@@ -6,13 +6,13 @@ class requestAnrechnung extends Auth_Controller
|
||||
{
|
||||
const REQUEST_ANRECHNUNG_URI = '/lehre/anrechnung/RequestAnrechnung';
|
||||
const APPROVE_ANRECHNUNG_URI = '/lehre/anrechnung/ApproveAnrechnungUebersicht';
|
||||
|
||||
|
||||
const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP';
|
||||
const ANRECHNUNGSTATUS_PROGRESSED_BY_KF = 'inProgressKF';
|
||||
const ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR = 'inProgressLektor';
|
||||
const ANRECHNUNGSTATUS_APPROVED = 'approved';
|
||||
const ANRECHNUNGSTATUS_REJECTED = 'rejected';
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
// Set required permissions
|
||||
@@ -23,22 +23,22 @@ class requestAnrechnung extends Auth_Controller
|
||||
'download' => 'student/anrechnung_beantragen:rw',
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
// Load models
|
||||
$this->load->model('education/Anrechnung_model', 'AnrechnungModel');
|
||||
$this->load->model('content/DmsVersion_model', 'DmsVersionModel');
|
||||
|
||||
|
||||
// Load libraries
|
||||
$this->load->library('WidgetLib');
|
||||
$this->load->library('PermissionLib');
|
||||
$this->load->library('AnrechnungLib');
|
||||
$this->load->library('DmsLib');
|
||||
|
||||
|
||||
// Load helpers
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
$this->load->helper('hlp_sancho_helper');
|
||||
|
||||
|
||||
// Load configs
|
||||
$this->load->config('anrechnung');
|
||||
|
||||
@@ -208,11 +208,11 @@ class requestAnrechnung extends Auth_Controller
|
||||
$this->_checkIfEntitledToReadDMSDoc($dms_id);
|
||||
|
||||
// Get file to be downloaded from DMS
|
||||
$download = $this->dmslib->download($dms_id, $filename);
|
||||
if (isError($download)) return $download;
|
||||
$download = $this->dmslib->download($dms_id);
|
||||
if (isError($download)) return $download;
|
||||
|
||||
// Download file
|
||||
$this->outputFile(getData($download));
|
||||
// Download file
|
||||
$this->outputFile(getData($download));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -221,10 +221,10 @@ class requestAnrechnung extends Auth_Controller
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
|
||||
|
||||
if (!$this->_uid) show_error('User authentification failed');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if application deadline is expired.
|
||||
*
|
||||
@@ -237,7 +237,7 @@ class requestAnrechnung extends Auth_Controller
|
||||
private function _isExpired($start, $ende, $studiensemester_kurzbz)
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
|
||||
// If start is not given, set to Semesterstart.
|
||||
if (!isset($start) || isEmptyString($start))
|
||||
{
|
||||
@@ -245,7 +245,7 @@ class requestAnrechnung extends Auth_Controller
|
||||
$result = $this->StudiensemesterModel->load($studiensemester_kurzbz);
|
||||
$start = getData($result)[0]->start;
|
||||
}
|
||||
|
||||
|
||||
// If ende is not given, set to Semesterende.
|
||||
if (!isset($ende) || isEmptyString($ende))
|
||||
{
|
||||
@@ -253,15 +253,15 @@ class requestAnrechnung extends Auth_Controller
|
||||
$result = $this->StudiensemesterModel->load($studiensemester_kurzbz);
|
||||
$ende = getData($result)[0]->ende;
|
||||
}
|
||||
|
||||
|
||||
$today = new DateTime('today midnight');
|
||||
$start = new DateTime($start);
|
||||
$ende = new DateTime($ende);
|
||||
|
||||
|
||||
// True if expired
|
||||
return ($today < $start || $today > $ende);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if user is entitled to read dms doc.
|
||||
*
|
||||
@@ -273,9 +273,9 @@ class requestAnrechnung extends Auth_Controller
|
||||
{
|
||||
show_error('Failed loading Student');
|
||||
}
|
||||
|
||||
|
||||
$result = $this->AnrechnungModel->loadWhere(array('dms_id' => $dms_id));
|
||||
|
||||
|
||||
if($result = getData($result)[0])
|
||||
{
|
||||
if ($result->prestudent_id == $student->prestudent_id)
|
||||
@@ -283,10 +283,10 @@ class requestAnrechnung extends Auth_Controller
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
show_error('You are not entitled to read this document');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if application already exists.
|
||||
*
|
||||
@@ -302,15 +302,15 @@ class requestAnrechnung extends Auth_Controller
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'prestudent_id' => $prestudent_id
|
||||
));
|
||||
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
show_error(getError($result));
|
||||
}
|
||||
|
||||
|
||||
return hasData($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if applications' study semester is actual study semester.
|
||||
*
|
||||
@@ -322,10 +322,10 @@ class requestAnrechnung extends Auth_Controller
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$result = $this->StudiensemesterModel->getNearest();
|
||||
$actual_ss = getData($result)[0]->studiensemester_kurzbz;
|
||||
|
||||
|
||||
return $studiensemester_kurzbz == $actual_ss;
|
||||
}
|
||||
|
||||
|
||||
private function _LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id)
|
||||
{
|
||||
// Get Note of Lehrveranstaltung
|
||||
@@ -336,12 +336,12 @@ class requestAnrechnung extends Auth_Controller
|
||||
'lehrveranstaltung_id' => $lehrveranstaltung_id
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
// If Lehrveranstaltung has Note
|
||||
if (hasData($result))
|
||||
{
|
||||
$note = getData($result)[0]->note;
|
||||
|
||||
|
||||
// Check if Note is a blocking grade
|
||||
if (in_array($note, $this->config->item('grades_blocking_application')))
|
||||
{
|
||||
@@ -350,7 +350,7 @@ class requestAnrechnung extends Auth_Controller
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Upload file via DMS library.
|
||||
*
|
||||
@@ -367,7 +367,7 @@ class requestAnrechnung extends Auth_Controller
|
||||
'insertamum' => (new DateTime())->format('Y-m-d H:i:s'),
|
||||
'insertvon' => $this->_uid
|
||||
);
|
||||
|
||||
|
||||
// Upload document
|
||||
return $this->dmslib->upload($dms, 'uploadfile', array('pdf'));
|
||||
}
|
||||
|
||||
+118
-169
@@ -50,62 +50,57 @@ class DmsLib
|
||||
$kategorie_kurzbz = null, $dokument_kurzbz = null, $beschreibung = null, $cis_suche = false, $schlagworte = null
|
||||
)
|
||||
{
|
||||
// write file with content of fileHandle
|
||||
$writeFileResult = $this->_writeNewFile($name, $fileHandle);
|
||||
// create unique filename, using original document name to detect file extension
|
||||
$filename = $this->_getUniqueFilename($name);
|
||||
|
||||
if (isError($writeFileResult)) return $writeFileResult;
|
||||
// copy file from fileHandle to dms folder
|
||||
$copyFileResult = $this->_copyFile($fileHandle, $filename);
|
||||
|
||||
if (hasData($writeFileResult))
|
||||
if (isError($copyFileResult)) return $copyFileResult;
|
||||
|
||||
// if file written successful, insert dms
|
||||
$dmsResult = $this->_ci->DmsModel->insert(
|
||||
array(
|
||||
'kategorie_kurzbz' => $kategorie_kurzbz,
|
||||
'dokument_kurzbz' => $dokument_kurzbz
|
||||
)
|
||||
);
|
||||
|
||||
if (isError($dmsResult)) return $dmsResult;
|
||||
|
||||
if (hasData($dmsResult))
|
||||
{
|
||||
$writeFileData = getData($writeFileResult);
|
||||
$filename = $writeFileData->filename;
|
||||
$dms_id = getData($dmsResult);
|
||||
$version = 0;
|
||||
|
||||
// if file written successful, insert dms
|
||||
$dmsResult = $this->_ci->DmsModel->insert(
|
||||
array(
|
||||
'kategorie_kurzbz' => $kategorie_kurzbz,
|
||||
'dokument_kurzbz' => $dokument_kurzbz
|
||||
)
|
||||
// insert dms version
|
||||
$dmsVersion = array(
|
||||
'dms_id' => $dms_id,
|
||||
'version' => $version,
|
||||
'filename' => $filename,
|
||||
'mimetype' => $mimetype,
|
||||
'name' => $name,
|
||||
'beschreibung' => $beschreibung,
|
||||
'cis_suche' => $cis_suche,
|
||||
'schlagworte' => $schlagworte,
|
||||
'insertvon' => $this->_who,
|
||||
'insertamum' => date('Y-m-d H:i:s')
|
||||
);
|
||||
|
||||
if (isError($dmsResult)) return $dmsResult;
|
||||
$dmsVersionResult = $this->_ci->DmsVersionModel->insert($dmsVersion);
|
||||
|
||||
if (hasData($dmsResult))
|
||||
{
|
||||
$dms_id = getData($dmsResult);
|
||||
$version = 0;
|
||||
if (isError($dmsVersionResult)) return $dmsVersionResult;
|
||||
|
||||
// insert dms version
|
||||
$dmsVersion = array(
|
||||
'dms_id' => $dms_id,
|
||||
'version' => $version,
|
||||
'filename' => $filename,
|
||||
'mimetype' => $mimetype,
|
||||
'name' => $name,
|
||||
'beschreibung' => $beschreibung,
|
||||
'cis_suche' => $cis_suche,
|
||||
'schlagworte' => $schlagworte,
|
||||
'insertvon' => $this->_who,
|
||||
'insertamum' => date('Y-m-d H:i:s')
|
||||
);
|
||||
// return dms info
|
||||
$resObj = new stdClass();
|
||||
$resObj->dms_id = $dms_id;
|
||||
$resObj->version = $version;
|
||||
$resObj->filename = $filename;
|
||||
|
||||
$dmsVersionResult = $this->_ci->DmsVersionModel->insert($dmsVersion);
|
||||
|
||||
if (isError($dmsVersionResult)) return $dmsVersionResult;
|
||||
|
||||
// return dms info
|
||||
$resObj = new stdClass();
|
||||
$resObj->dms_id = $dms_id;
|
||||
$resObj->version = $version;
|
||||
$resObj->filename = $filename;
|
||||
|
||||
return success($resObj);
|
||||
}
|
||||
else
|
||||
return error("error when inserting DMS");
|
||||
return success($resObj);
|
||||
}
|
||||
else
|
||||
return error("file could not be written");
|
||||
return error("error when inserting DMS");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,46 +120,41 @@ class DmsLib
|
||||
|
||||
$originalName = isset($name) ? $name : $lastVersion->name;
|
||||
|
||||
// write new file with content of fileHandle
|
||||
$writeFileResult = $this->_writeNewFile($originalName, $fileHandle);
|
||||
// create unique filename, using original document name to detect file extension
|
||||
$filename = $this->_getUniqueFilename($originalName);
|
||||
|
||||
if (isError($writeFileResult)) return $writeFileResult;
|
||||
// copy file from fileHandle to dms folder
|
||||
$copyFileResult = $this->_copyFile($fileHandle, $filename);
|
||||
|
||||
if (hasData($writeFileResult))
|
||||
{
|
||||
$writeFileData = getData($writeFileResult);
|
||||
$filename = $writeFileData->filename;
|
||||
if (isError($copyFileResult)) return $copyFileResult;
|
||||
|
||||
// insert new version
|
||||
$newVersionNumber = $lastVersion->version + 1;
|
||||
// insert new version
|
||||
$newVersionNumber = $lastVersion->version + 1;
|
||||
|
||||
// if new parameters given, use them, otherwise use parameters from last version
|
||||
$newVersion = array(
|
||||
'dms_id' => $dms_id,
|
||||
'name' => $originalName,
|
||||
'filename' => $filename,
|
||||
'version' => $newVersionNumber,
|
||||
'mimetype' => isset($mimetype) ? $mimetype : $lastVersion->mimetype,
|
||||
'beschreibung' => isset($beschreibung) ? $beschreibung : $lastVersion->beschreibung,
|
||||
'cis_suche' => isset($cis_suche) ? $cis_suche : $lastVersion->cis_suche,
|
||||
'schlagworte' => isset($schlagworte) ? $schlagworte : $lastVersion->schlagworte,
|
||||
'insertvon' => $this->_who,
|
||||
'insertamum' => date('Y-m-d H:i:s')
|
||||
);
|
||||
// if new parameters given, use them, otherwise use parameters from last version
|
||||
$newVersion = array(
|
||||
'dms_id' => $dms_id,
|
||||
'name' => $originalName,
|
||||
'filename' => $filename,
|
||||
'version' => $newVersionNumber,
|
||||
'mimetype' => isset($mimetype) ? $mimetype : $lastVersion->mimetype,
|
||||
'beschreibung' => isset($beschreibung) ? $beschreibung : $lastVersion->beschreibung,
|
||||
'cis_suche' => isset($cis_suche) ? $cis_suche : $lastVersion->cis_suche,
|
||||
'schlagworte' => isset($schlagworte) ? $schlagworte : $lastVersion->schlagworte,
|
||||
'insertvon' => $this->_who,
|
||||
'insertamum' => date('Y-m-d H:i:s')
|
||||
);
|
||||
|
||||
$addVersionResult = $this->_ci->DmsVersionModel->insert($newVersion);
|
||||
$addVersionResult = $this->_ci->DmsVersionModel->insert($newVersion);
|
||||
|
||||
if (isError($addVersionResult)) return $addVersionResult;
|
||||
if (isError($addVersionResult)) return $addVersionResult;
|
||||
|
||||
// return dms info
|
||||
$resObj = new stdClass();
|
||||
$resObj->version = $newVersionNumber;
|
||||
$resObj->filename = $filename;
|
||||
// return dms info
|
||||
$resObj = new stdClass();
|
||||
$resObj->version = $newVersionNumber;
|
||||
$resObj->filename = $filename;
|
||||
|
||||
return success($resObj);
|
||||
}
|
||||
else
|
||||
return error("file could not be written");
|
||||
return success($resObj);
|
||||
}
|
||||
else
|
||||
return error("last version not found");
|
||||
@@ -185,44 +175,37 @@ class DmsLib
|
||||
if (hasData($lastVersionResult))
|
||||
{
|
||||
$lastVersion = getData($lastVersionResult);
|
||||
$filename = $lastVersion->filename;
|
||||
|
||||
// update file in filesystem
|
||||
$writeFileResult = $this->_writeFile($lastVersion->filename, $fileHandle);
|
||||
$copyFileResult = $this->_copyFile($fileHandle, $filename);
|
||||
|
||||
if (isError($writeFileResult)) return $writeFileResult;
|
||||
if (isError($copyFileResult)) return $copyFileResult;
|
||||
|
||||
if (hasData($writeFileResult))
|
||||
{
|
||||
$writeFileData = getData($writeFileResult);
|
||||
$filename = $writeFileData->filename;
|
||||
// if new parameters given, use them, otherwise use parameters from last version
|
||||
$newVersion = array(
|
||||
'name' => isset($name) ? $name : $lastVersion->name,
|
||||
'filename' => $filename,
|
||||
'mimetype' => isset($mimetype) ? $mimetype : $lastVersion->mimetype,
|
||||
'beschreibung' => isset($beschreibung) ? $beschreibung : $lastVersion->beschreibung,
|
||||
'cis_suche' => isset($cis_suche) ? $cis_suche : $lastVersion->cis_suche,
|
||||
'schlagworte' => isset($schlagworte) ? $schlagworte : $lastVersion->schlagworte,
|
||||
);
|
||||
|
||||
// if new parameters given, use them, otherwise use parameters from last version
|
||||
$newVersion = array(
|
||||
'name' => isset($name) ? $name : $lastVersion->name,
|
||||
'filename' => $filename,
|
||||
'mimetype' => isset($mimetype) ? $mimetype : $lastVersion->mimetype,
|
||||
'beschreibung' => isset($beschreibung) ? $beschreibung : $lastVersion->beschreibung,
|
||||
'cis_suche' => isset($cis_suche) ? $cis_suche : $lastVersion->cis_suche,
|
||||
'schlagworte' => isset($schlagworte) ? $schlagworte : $lastVersion->schlagworte,
|
||||
);
|
||||
// update last dms version
|
||||
$addVersionResult = $this->_ci->DmsVersionModel->update(
|
||||
array($dms_id, $lastVersion->version),
|
||||
$newVersion
|
||||
);
|
||||
|
||||
// update last dms version
|
||||
$addVersionResult = $this->_ci->DmsVersionModel->update(
|
||||
array($dms_id, $lastVersion->version),
|
||||
$newVersion
|
||||
);
|
||||
if (isError($addVersionResult)) return $addVersionResult;
|
||||
|
||||
if (isError($addVersionResult)) return $addVersionResult;
|
||||
// return dms info
|
||||
$resObj = new stdClass();
|
||||
$resObj->version = $lastVersion->version;
|
||||
$resObj->filename = $filename;
|
||||
|
||||
// return dms info
|
||||
$resObj = new stdClass();
|
||||
$resObj->version = $lastVersion->version;
|
||||
$resObj->filename = $filename;
|
||||
|
||||
return success($resObj);
|
||||
}
|
||||
else
|
||||
return error("file could not be written");
|
||||
return success($resObj);
|
||||
}
|
||||
else
|
||||
return error("last version not found");
|
||||
@@ -441,68 +424,35 @@ class DmsLib
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Writes file with content of fileHandle using original document name for file extension
|
||||
* Copies file from sourceFileHandle to destinationFilename in DMS folder
|
||||
* Returns success or error on fail
|
||||
*/
|
||||
private function _writeNewFile($originalName, $fileHandle)
|
||||
private function _copyFile($sourceFileHandle, $destinationFilename)
|
||||
{
|
||||
// create unique filename, using original document name to detect file extension
|
||||
$filename = $this->_getUniqueFilename($originalName);
|
||||
// get file location from file handle
|
||||
$metaData = stream_get_meta_data($sourceFileHandle);
|
||||
|
||||
// write the file
|
||||
return $this->_writeFile($filename, $fileHandle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes file with content of fileHandle
|
||||
* Returns number of bytes written and filename
|
||||
*/
|
||||
private function _writeFile($filename, $fileHandle)
|
||||
{
|
||||
// file content provided by fileHandle
|
||||
$fileContent = '';
|
||||
|
||||
$readBlockResult = success();
|
||||
|
||||
// While the end of the file is not reached and the read does not fail
|
||||
while (!feof($fileHandle) && isSuccess($readBlockResult = $this->_ci->DmsFSModel->readBlock($fileHandle)))
|
||||
if (isset($metaData['uri']) && !isEmptyString($metaData['uri']))
|
||||
{
|
||||
// Concatenate the content of the file
|
||||
$fileContent .= getData($readBlockResult);
|
||||
// if file location determined, copy file
|
||||
$source = $metaData['uri'];
|
||||
|
||||
if (copy($source, DMS_PATH.$destinationFilename))
|
||||
{
|
||||
return success();
|
||||
}
|
||||
else
|
||||
{
|
||||
// error if copy returned false
|
||||
return error('error occured while copying file');
|
||||
}
|
||||
}
|
||||
|
||||
// If an error occurred while reading then return it
|
||||
if (isError($readBlockResult)) return $readBlockResult;
|
||||
|
||||
// open file for writing
|
||||
$openFileResult = $this->_ci->DmsFSModel->openReadWrite($filename);
|
||||
|
||||
if (isError($openFileResult)) return $openFileResult;
|
||||
|
||||
if (!hasData($openFileResult)) return error("File could not be opened");
|
||||
|
||||
$newFileHandle = getData($openFileResult);
|
||||
|
||||
// write file
|
||||
$writeFileResult = $this->_ci->DmsFSModel->write($newFileHandle, $fileContent);
|
||||
|
||||
if (isError($writeFileResult)) return $writeFileResult;
|
||||
|
||||
// return number of bytes written and filename
|
||||
$resObj = new stdClass();
|
||||
$resObj->bytesWritten = 0;
|
||||
$resObj->filename = '';
|
||||
|
||||
if (hasData($writeFileResult))
|
||||
else
|
||||
{
|
||||
$resObj->bytesWritten = getData($writeFileResult);
|
||||
$resObj->filename = $filename;
|
||||
// error when source location could not be determined
|
||||
return error('error occured while getting source file name');
|
||||
}
|
||||
|
||||
// close handle
|
||||
$closeResult = $this->_ci->DmsFSModel->close($newFileHandle, $fileContent);
|
||||
|
||||
if (isError($closeResult)) return $closeResult;
|
||||
|
||||
return success($resObj);
|
||||
}
|
||||
|
||||
@@ -527,7 +477,7 @@ class DmsLib
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
// Deprecated methods, not to be used
|
||||
|
||||
|
||||
/**
|
||||
* Load a DMS Document.
|
||||
* If no version is particularly given, the latest version is loaded.
|
||||
@@ -543,7 +493,7 @@ class DmsLib
|
||||
$this->_ci->DmsModel->addJoin('campus.tbl_dms_version', 'dms_id');
|
||||
$this->_ci->DmsModel->addOrder('version', 'DESC');
|
||||
$this->_ci->DmsModel->addLimit(1);
|
||||
|
||||
|
||||
if (!is_numeric($version))
|
||||
{
|
||||
return $this->_ci->DmsModel->load($dms_id);
|
||||
@@ -620,7 +570,7 @@ class DmsLib
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Uploads a document and saves it to DMS
|
||||
* @param $dms DMS assoc array
|
||||
@@ -659,7 +609,7 @@ class DmsLib
|
||||
// Return result of uploaded data
|
||||
return success($upload_data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Download a document.
|
||||
*
|
||||
@@ -678,7 +628,7 @@ class DmsLib
|
||||
if (hasData($fileInfoResult))
|
||||
{
|
||||
$fileObj = getData($fileInfoResult);
|
||||
|
||||
|
||||
// Change filename, if filename is provided
|
||||
if (!isEmptyString($filename)) $fileObj->name = $filename;
|
||||
|
||||
@@ -694,7 +644,7 @@ class DmsLib
|
||||
// If no data have been found then return an empty success
|
||||
return success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get file information.
|
||||
*
|
||||
@@ -706,7 +656,7 @@ class DmsLib
|
||||
{
|
||||
// Checks the dms_id parameter
|
||||
if (!is_numeric($dms_id)) return error('Wrong parameter');
|
||||
|
||||
|
||||
// Load DMS from database
|
||||
$result = $this->load($dms_id, $version);
|
||||
if (isError($result)) return error(getError($result));
|
||||
@@ -951,4 +901,3 @@ class DmsLib
|
||||
$this->_ci->upload->initialize($config);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ class Dokumentprestudent_model extends DB_Model
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_dokumentprestudent';
|
||||
$this->pk = array('prestudent_id', 'dokument_kurzbz');
|
||||
$this->hasSequence = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,49 +7,6 @@ const COLOR_DANGER = '#f2dede';
|
||||
$(function(){
|
||||
const uploadMaxFilesize = $('#requestAnrechnung-uploadfile').data('maxsize') ; // in byte
|
||||
|
||||
let status_kurzbz = $('#requestAnrechnung-status_kurzbz').data('status_kurzbz');
|
||||
if (status_kurzbz != ' ' && status_kurzbz != ANRECHNUNGSTATUS_APPROVED)
|
||||
{
|
||||
var ectsLv = parseFloat($('#ects').text());
|
||||
var sumEctsSchulisch = parseFloat($('#sumEctsSchulisch').text());
|
||||
var sumEctsBeruflich = parseFloat($('#sumEctsBeruflich').text());
|
||||
var begruendung_id = $('#requestAnrechnung-form :input[name="begruendung"]:checked').val();
|
||||
|
||||
// If Begründung is 'Hochschulzeugnis', return. They are accepted without limit.
|
||||
if (begruendung_id == 5)
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
// If max ECTS is ecceeded
|
||||
if (begruendung_id == 4)
|
||||
{
|
||||
if ((sumEctsSchulisch + sumEctsBeruflich + ectsLv) > 90 ||
|
||||
(sumEctsBeruflich + ectsLv) > 60
|
||||
)
|
||||
{
|
||||
// Get ECTS Überschreitungs-message, depending on schulische or berufliche Qualifikation
|
||||
var msgBeiEctsUeberschreitung = requestAnrechnung.getMsgBeiEctsUeberschreitung(begruendung_id, ectsLv, sumEctsSchulisch, sumEctsBeruflich);
|
||||
|
||||
// Add to Checkbox text
|
||||
$('#requestAnrechnung-form :input[name="begruendung"]:checked').closest('label').append(msgBeiEctsUeberschreitung);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((sumEctsSchulisch + sumEctsBeruflich + ectsLv) > 90 ||
|
||||
(sumEctsSchulisch + ectsLv) > 60
|
||||
)
|
||||
{
|
||||
// Get ECTS Überschreitungs-message, depending on schulische or berufliche Qualifikation
|
||||
var msgBeiEctsUeberschreitung = requestAnrechnung.getMsgBeiEctsUeberschreitung(begruendung_id, ectsLv, sumEctsSchulisch, sumEctsBeruflich);
|
||||
|
||||
// Add to Checkbox text
|
||||
$('#requestAnrechnung-form :input[name="begruendung"]:checked').closest('label').append(msgBeiEctsUeberschreitung);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set status alert color
|
||||
requestAnrechnung.setStatusAlertColor();
|
||||
|
||||
@@ -62,9 +19,12 @@ $(function(){
|
||||
// Init tooltips
|
||||
requestAnrechnung.initTooltips();
|
||||
|
||||
// // Alert message, if maximum ECTS exceeded
|
||||
// Alert message, if maximum ECTS exceeded
|
||||
requestAnrechnung.alertIfMaxEctsExceeded();
|
||||
|
||||
// Alert message inside Begruendungsbox, if maximum ECTS exceeded
|
||||
requestAnrechnung.alertIfMaxEctsExceededInsideBegruendungsbox();
|
||||
|
||||
// Set chars counter for textarea 'Herkunft der Kenntnisse'
|
||||
requestAnrechnung.setCharsCounter();
|
||||
|
||||
@@ -318,6 +278,51 @@ var requestAnrechnung = {
|
||||
});
|
||||
}
|
||||
},
|
||||
alertIfMaxEctsExceededInsideBegruendungsbox: function(){
|
||||
let status_kurzbz = $('#requestAnrechnung-status_kurzbz').data('status_kurzbz');
|
||||
|
||||
if (status_kurzbz != ' ' && status_kurzbz != ANRECHNUNGSTATUS_APPROVED)
|
||||
{
|
||||
var ectsLv = parseFloat($('#ects').text());
|
||||
var sumEctsSchulisch = parseFloat($('#sumEctsSchulisch').text());
|
||||
var sumEctsBeruflich = parseFloat($('#sumEctsBeruflich').text());
|
||||
var begruendung_id = $('#requestAnrechnung-form :input[name="begruendung"]:checked').val();
|
||||
|
||||
// If Begründung is 'Hochschulzeugnis', return. They are accepted without limit.
|
||||
if (begruendung_id == 5)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// If max ECTS is ecceeded
|
||||
if (begruendung_id == 4)
|
||||
{
|
||||
if ((sumEctsSchulisch + sumEctsBeruflich + ectsLv) > 90 ||
|
||||
(sumEctsBeruflich + ectsLv) > 60
|
||||
)
|
||||
{
|
||||
// Get ECTS Überschreitungs-message, depending on schulische or berufliche Qualifikation
|
||||
var msgBeiEctsUeberschreitung = requestAnrechnung.getMsgBeiEctsUeberschreitung(begruendung_id, ectsLv, sumEctsSchulisch, sumEctsBeruflich);
|
||||
|
||||
// Add to Checkbox text
|
||||
$('#requestAnrechnung-form :input[name="begruendung"]:checked').closest('label').append(msgBeiEctsUeberschreitung);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((sumEctsSchulisch + sumEctsBeruflich + ectsLv) > 90 ||
|
||||
(sumEctsSchulisch + ectsLv) > 60
|
||||
)
|
||||
{
|
||||
// Get ECTS Überschreitungs-message, depending on schulische or berufliche Qualifikation
|
||||
var msgBeiEctsUeberschreitung = requestAnrechnung.getMsgBeiEctsUeberschreitung(begruendung_id, ectsLv, sumEctsSchulisch, sumEctsBeruflich);
|
||||
|
||||
// Add to Checkbox text
|
||||
$('#requestAnrechnung-form :input[name="begruendung"]:checked').closest('label').append(msgBeiEctsUeberschreitung);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
getMsgBeiEctsUeberschreitung: function(begruendung_id, ects, sumEctsSchulisch, sumEctsBeruflich){
|
||||
|
||||
return $('<span id="sumEctsMsg"></span>')
|
||||
|
||||
@@ -6495,6 +6495,20 @@ if($result = @$db->db_query("SELECT * FROM information_schema.role_table_grants
|
||||
}
|
||||
}
|
||||
|
||||
// Insert document type Grant Agreement
|
||||
if($result = @$db->db_query("SELECT 1 FROM public.tbl_dokument WHERE dokument_kurzbz = 'GrantAgr';"))
|
||||
{
|
||||
if($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "INSERT INTO public.tbl_dokument(dokument_kurzbz, bezeichnung, bezeichnung_mehrsprachig) VALUES('GrantAgr', 'Grant Agreement', '{\"Grant Agreement\",\"Grant Agreement\"}');";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_dokument '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo 'public.tbl_dokument: Added value \'GrantAgr\'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
|
||||
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user