mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 10:22:18 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e43887678e | |||
| fbc88bf768 | |||
| 8735242e0f | |||
| 7c397df829 |
@@ -64,7 +64,7 @@ class AuthLib
|
||||
{
|
||||
// - The uid must be NOT an empty string
|
||||
// - The current user should NOT be already logged as the given uid
|
||||
if (!isEmptyString($uid) && $this->getAuthObj()->username != $uid)
|
||||
if (!isEmptyString($uid) && $this->getAuthObj()->{self::AO_USERNAME} != $uid)
|
||||
{
|
||||
$this->_ci->load->library('PermissionLib'); // Loads permissions library
|
||||
|
||||
@@ -75,8 +75,28 @@ class AuthLib
|
||||
$loginAS = $this->_createAuthObjByPerson(array('uid' => $uid));
|
||||
if (isSuccess($loginAS))
|
||||
{
|
||||
$authObj = getData($loginAS); // get the authenticate object
|
||||
|
||||
// Store the new authentication object in authentication session
|
||||
setSessionElement(self::SESSION_NAME, self::SESSION_AUTH_OBJ, getData($loginAS));
|
||||
setSessionElement(self::SESSION_NAME, self::SESSION_AUTH_OBJ, $authObj);
|
||||
|
||||
$authObjOrigin = getSessionElement(self::SESSION_NAME, self::SESSION_AUTH_OBJ_ORIGIN);
|
||||
|
||||
// Load the LogLib
|
||||
$this->_ci->load->library('LogLib');
|
||||
// Setup the LogLib
|
||||
$this->_ci->loglib->setConfigs(
|
||||
array(
|
||||
'dbLogType' => 'API', // required
|
||||
'dbExecuteUser' => $authObjOrigin->{self::AO_USERNAME}, // current logged user
|
||||
'requestId' => 'API'
|
||||
)
|
||||
);
|
||||
// Log into the database
|
||||
$this->_ci->loglib->logInfoDB(
|
||||
'The user "'.$authObjOrigin->{self::AO_USERNAME}.'" has changed identity with the user "'.$authObj->{self::AO_USERNAME}.
|
||||
'" and person id '.$authObj->{self::AO_PERSON_ID}
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -105,7 +125,7 @@ class AuthLib
|
||||
{
|
||||
// - The person id must be a number
|
||||
// - The current user should NOT be already logged as the given person id
|
||||
if (is_numeric($person_id) && $this->getAuthObj()->person_id != $person_id)
|
||||
if (is_numeric($person_id) && $this->getAuthObj()->{self::AO_PERSON_ID} != $person_id)
|
||||
{
|
||||
$this->_ci->load->library('PermissionLib'); // Loads permissions library
|
||||
|
||||
@@ -124,6 +144,24 @@ class AuthLib
|
||||
{
|
||||
// Store the new authentication object in authentication session
|
||||
setSessionElement(self::SESSION_NAME, self::SESSION_AUTH_OBJ, $authObj);
|
||||
|
||||
$authObjOrigin = getSessionElement(self::SESSION_NAME, self::SESSION_AUTH_OBJ_ORIGIN);
|
||||
|
||||
// Load the LogLib
|
||||
$this->_ci->load->library('LogLib');
|
||||
// Setup the LogLib
|
||||
$this->_ci->loglib->setConfigs(
|
||||
array(
|
||||
'dbLogType' => 'API', // required
|
||||
'dbExecuteUser' => $authObjOrigin->{self::AO_USERNAME}, // current logged user
|
||||
'requestId' => 'API'
|
||||
)
|
||||
);
|
||||
// Log into the database
|
||||
$this->_ci->loglib->logInfoDB(
|
||||
'The user "'.$authObjOrigin->{self::AO_USERNAME}.'" has changed identity with the user "'.$authObj->{self::AO_USERNAME}.
|
||||
'" and person id '.$authObj->{self::AO_PERSON_ID}
|
||||
);
|
||||
}
|
||||
else // if does NOT have permissions
|
||||
{
|
||||
@@ -172,6 +210,22 @@ class AuthLib
|
||||
// The LoginAs account is logged out
|
||||
// The user is again connected with its real account
|
||||
setSessionElement(self::SESSION_NAME, self::SESSION_AUTH_OBJ, $authObjOrigin);
|
||||
|
||||
// Load the LogLib
|
||||
$this->_ci->load->library('LogLib');
|
||||
// Setup the LogLib
|
||||
$this->_ci->loglib->setConfigs(
|
||||
array(
|
||||
'dbLogType' => 'API', // required
|
||||
'dbExecuteUser' => $authObjOrigin->{self::AO_USERNAME}, // current logged user
|
||||
'requestId' => 'API'
|
||||
)
|
||||
);
|
||||
// Log into the database
|
||||
$this->_ci->loglib->logInfoDB(
|
||||
'The user "'.$authObjOrigin->{self::AO_USERNAME}.'" has logout from the user "'.$authObj->{self::AO_USERNAME}.
|
||||
'" and person id '.$authObj->{self::AO_PERSON_ID}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -608,3 +662,4 @@ class AuthLib
|
||||
return $finalUserBasicDataByUID;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-98
@@ -17,14 +17,13 @@
|
||||
* Karl Burkhart <karl.burkhart@technikum-wien.at> and
|
||||
* Manfred Kindl <manfred.kindl@technikum-wien.at>.
|
||||
*/
|
||||
require_once('../config/cis.config.inc.php');
|
||||
require_once('../include/functions.inc.php');
|
||||
require_once('../include/dms.class.php');
|
||||
require_once('../include/benutzerberechtigung.class.php');
|
||||
require_once('../include/basis_db.class.php');
|
||||
require_once('../include/datum.class.php');
|
||||
require_once('../include/log.class.php');
|
||||
require_once('../include/organisationseinheit.class.php');
|
||||
require_once ('../config/cis.config.inc.php');
|
||||
require_once ('../include/functions.inc.php');
|
||||
require_once ('../include/dms.class.php');
|
||||
require_once ('../include/benutzerberechtigung.class.php');
|
||||
require_once ('../include/basis_db.class.php');
|
||||
require_once ('../include/datum.class.php');
|
||||
require_once ('../include/log.class.php');
|
||||
|
||||
$db = new basis_db();
|
||||
$user = get_uid();
|
||||
@@ -53,7 +52,6 @@ if (! $rechte->isberechtigt('basis/dms', null, 's', null))
|
||||
<script type="text/javascript" src="../vendor/jquery/sizzle/sizzle.js"></script>
|
||||
<script type="text/javascript" src="../vendor/joeldbirch/superfish/dist/js/superfish.min.js"></script>
|
||||
<script type="text/javascript" src="../include/tiny_mce/tiny_mce_popup.js"></script>
|
||||
<script type="text/javascript" src="../include/js/jquery.ui.datepicker.translation.js"></script>
|
||||
<style type="text/css">
|
||||
.buttondesign
|
||||
{
|
||||
@@ -131,8 +129,6 @@ if (! $rechte->isberechtigt('basis/dms', null, 's', null))
|
||||
{
|
||||
//$('#divupload').hide();
|
||||
jQuery('ul.sf-menu').superfish({speed:'fast', delay:200});
|
||||
|
||||
$(".datepicker_datum").datepicker($.datepicker.regional['de']);
|
||||
});
|
||||
|
||||
function upload(id, name)
|
||||
@@ -269,11 +265,6 @@ $mimetypes = array(
|
||||
'image/png' => 'img_icon.png'
|
||||
);
|
||||
|
||||
// Organsiationseinheit dropdown
|
||||
$organisationseinheiten = new organisationseinheit();
|
||||
$organisationseinheiten->getAll(true, null, 'organisationseinheittyp_kurzbz, bezeichnung');
|
||||
$oe_typ = '';
|
||||
|
||||
// Hole Datei aus Import Verzeichnis
|
||||
if ($importFile != '')
|
||||
{
|
||||
@@ -343,9 +334,6 @@ if (isset($_POST['fileupload']))
|
||||
$schlagworte = $_POST['schlagworte'];
|
||||
$mimetype = isset($_POST['mimetype']) ? $_POST['mimetype'] : '';
|
||||
$cis_suche = isset($_POST['cis_suche']) ? true : false;
|
||||
$gueltig_ab = isset($_POST['gueltig_ab']) ? $_POST['gueltig_ab'] : null;
|
||||
$oe_kurzbz_verantwortlich = isset($_POST['oe_kurzbz_verantwortlich']) ? $_POST['oe_kurzbz_verantwortlich'] : null;
|
||||
$archiviert = isset($_POST['archiviert']) ? true : false;
|
||||
$ext = pathinfo($_FILES['userfile']['name'], PATHINFO_EXTENSION);
|
||||
$filename = uniqid();
|
||||
$filename .= ".".$ext;
|
||||
@@ -389,10 +377,6 @@ if (isset($_POST['fileupload']))
|
||||
$dms->beschreibung = $beschreibung;
|
||||
$dms->schlagworte = $schlagworte;
|
||||
$dms->cis_suche = $cis_suche;
|
||||
$gueltig_ab_date = DateTime::createFromFormat('d.m.Y', $gueltig_ab);
|
||||
$dms->gueltig_ab = $gueltig_ab_date->format('Y-m-d');
|
||||
$dms->oe_kurzbz_verantwortlich = $oe_kurzbz_verantwortlich;
|
||||
$dms->archiviert = $archiviert;
|
||||
|
||||
if ($dms->save(true))
|
||||
{
|
||||
@@ -430,9 +414,6 @@ if (isset($_POST['action']) && $_POST['action'] == 'rename')
|
||||
$schlagworte = $_POST['schlagworte'];
|
||||
$mimetype = isset($_POST['mimetype']) ? $_POST['mimetype'] : '';
|
||||
$cis_suche = isset($_POST['cis_suche']) ? true : false;
|
||||
$gueltig_ab = isset($_POST['gueltig_ab']) ? $_POST['gueltig_ab'] : null;
|
||||
$oe_kurzbz_verantwortlich = isset($_POST['oe_kurzbz_verantwortlich']) ? $_POST['oe_kurzbz_verantwortlich'] : null;
|
||||
$archiviert = isset($_POST['archiviert']) ? true : false;
|
||||
|
||||
$dms = new dms();
|
||||
if ($dms->load($dms_id, $version))
|
||||
@@ -451,10 +432,6 @@ if (isset($_POST['action']) && $_POST['action'] == 'rename')
|
||||
}
|
||||
$dms->updateamum = date('Y-m-d H:i:s');
|
||||
$dms->updatevon = $user;
|
||||
$gueltig_ab_date = DateTime::createFromFormat('d.m.Y', $gueltig_ab);
|
||||
$dms->gueltig_ab = $gueltig_ab_date->format('Y-m-d');
|
||||
$dms->oe_kurzbz_verantwortlich = $oe_kurzbz_verantwortlich;
|
||||
$dms->archiviert = $archiviert;
|
||||
|
||||
if ($dms->save(false))
|
||||
echo '<span class="ok">Dateiname wurde erfolgreich geändert</span>';
|
||||
@@ -1040,8 +1017,6 @@ else
|
||||
{
|
||||
echo '<form action="'.$_SERVER['PHP_SELF'].'?kategorie_kurzbz='.$kategorie_kurzbz.'&page='.$page.'&dpp='.$dpp.'" method="POST" enctype="multipart/form-data">';
|
||||
}
|
||||
$tmp_date = date_create();
|
||||
$gueltig_ab_date = $tmp_date->format('d.m.Y');
|
||||
echo '
|
||||
<input type="hidden" name="kategorie_kurzbz" id="kategorie_kurzbz" value="'.$kategorie_kurzbz.'">
|
||||
<input type="hidden" name="dms_id" id="dms_id" value="">
|
||||
@@ -1062,34 +1037,6 @@ else
|
||||
<td>CIS-Suche</td>
|
||||
<td><input type="checkbox" id="cis_suche_checkbox" name="cis_suche"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gültig ab</td>
|
||||
<td><input id="gueltig_ab" class="datepicker_datum" type="text" name="gueltig_ab" value="'.$gueltig_ab_date.'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Verantwortliche Organisationseinheit</td>
|
||||
<td>
|
||||
<select name="oe_kurzbz_verantwortlich">
|
||||
<option value="">-- Bitte Auswählen --</option>';
|
||||
foreach ($organisationseinheiten->result as $oe)
|
||||
{
|
||||
if ($oe_typ != $oe->organisationseinheittyp_kurzbz || $oe_typ == '')
|
||||
{
|
||||
if ($oe_typ != '') echo '</optgroup>';
|
||||
|
||||
echo '<optgroup label="'.$oe->organisationseinheittyp_kurzbz.'">';
|
||||
}
|
||||
echo '<option value="'.$oe->oe_kurzbz.'">'.$oe->organisationseinheittyp_kurzbz.' '.$oe->bezeichnung.'</option>';
|
||||
$oe_typ = $oe->organisationseinheittyp_kurzbz;
|
||||
}
|
||||
echo '
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Archiviert</td>
|
||||
<td><input type="checkbox" id="archiviert_checkbox" name="archiviert"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="file" name="userfile"></td>
|
||||
@@ -1608,7 +1555,6 @@ function drawFilesList($rows)
|
||||
function drawRenameForm($dms_id, $version, $page = NULL, $dpp = NULL, $searching, $searchstring)
|
||||
{
|
||||
global $kategorie_kurzbz;
|
||||
global $organisationseinheiten, $oe_typ;
|
||||
|
||||
$dms = new dms();
|
||||
if ($dms->load($dms_id, $version))
|
||||
@@ -1631,12 +1577,6 @@ function drawRenameForm($dms_id, $version, $page = NULL, $dpp = NULL, $searching
|
||||
echo '&dpp='.$dpp;
|
||||
echo '" method="POST">';
|
||||
}
|
||||
$gueltig_ab_date = '';
|
||||
if ($dms->gueltig_ab != null || $dms->gueltig_ab != '')
|
||||
{
|
||||
$tmp_date = date_create($dms->gueltig_ab);
|
||||
$gueltig_ab_date = $tmp_date->format('d.m.Y');
|
||||
}
|
||||
echo '
|
||||
<table>
|
||||
<tr>
|
||||
@@ -1659,37 +1599,6 @@ function drawRenameForm($dms_id, $version, $page = NULL, $dpp = NULL, $searching
|
||||
<td>CIS-Suche:</td>
|
||||
<td><input type="checkbox" name="cis_suche" '.($dms->cis_suche == 'true'?'checked="checked"':'').'></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gültig ab</td>
|
||||
<td><input id="gueltig_ab" class="datepicker_datum" type="text" name="gueltig_ab" value="'.$gueltig_ab_date.'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Verantwortliche Organisationseinheit</td>
|
||||
<td>
|
||||
<select name="oe_kurzbz_verantwortlich">
|
||||
<option value="">-- Bitte Auswählen --</option>';
|
||||
foreach ($organisationseinheiten->result as $oe)
|
||||
{
|
||||
if ($oe_typ != $oe->organisationseinheittyp_kurzbz || $oe_typ == '')
|
||||
{
|
||||
if ($oe_typ != '') echo '</optgroup>';
|
||||
|
||||
echo '<optgroup label="'.$oe->organisationseinheittyp_kurzbz.'">';
|
||||
}
|
||||
$selected = '';
|
||||
if ($oe->oe_kurzbz == $dms->oe_kurzbz_verantwortlich)
|
||||
$selected = 'selected';
|
||||
echo '<option '.$selected.' value="'.$oe->oe_kurzbz.'">'.$oe->organisationseinheittyp_kurzbz.' '.$oe->bezeichnung.'</option>';
|
||||
$oe_typ = $oe->organisationseinheittyp_kurzbz;
|
||||
}
|
||||
echo '
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Archiviert</td>
|
||||
<td><input type="checkbox" id="archiviert_checkbox" name="archiviert" '.($dms->archiviert == 'true'?'checked="checked"':'').'></td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="action" value="rename">
|
||||
<input type="hidden" name="dms_id" value="'.$dms_id.'">
|
||||
|
||||
+3
-40
@@ -51,9 +51,6 @@ class dms extends basis_db
|
||||
public $kategorie_oe_kurzbz;
|
||||
public $berechtigung_kurzbz;
|
||||
public $bezeichnung;
|
||||
public $gueltig_ab;
|
||||
public $oe_kurzbz_verantwortlich;
|
||||
public $archiviert;
|
||||
|
||||
/**
|
||||
* Konstruktor
|
||||
@@ -100,9 +97,6 @@ class dms extends basis_db
|
||||
$this->updatevon = $row->updatevon;
|
||||
$this->cis_suche = $this->db_parse_bool($row->cis_suche);
|
||||
$this->schlagworte = $row->schlagworte;
|
||||
$this->gueltig_ab = $row->gueltig_ab;
|
||||
$this->oe_kurzbz_verantwortlich = $row->oe_kurzbz_verantwortlich;
|
||||
$this->archiviert = $this->db_parse_bool($row->archiviert);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -154,7 +148,7 @@ class dms extends basis_db
|
||||
|
||||
$qry.="INSERT INTO campus.tbl_dms_version(dms_id, version,
|
||||
filename, mimetype, name, beschreibung, letzterzugriff, insertamum, insertvon,
|
||||
updateamum, updatevon, cis_suche, schlagworte, oe_kurzbz_verantwortlich, gueltig_ab, archiviert) VALUES(".
|
||||
updateamum, updatevon, cis_suche, schlagworte) VALUES(".
|
||||
$dms_id.','.
|
||||
$this->db_add_param($this->version, FHC_INTEGER).','.
|
||||
$this->db_add_param($this->filename).','.
|
||||
@@ -167,11 +161,7 @@ class dms extends basis_db
|
||||
$this->db_add_param($this->updateamum).','.
|
||||
$this->db_add_param($this->updatevon).','.
|
||||
$this->db_add_param($this->cis_suche, FHC_BOOLEAN).','.
|
||||
$this->db_add_param($this->schlagworte).','.
|
||||
$this->db_add_param($this->oe_kurzbz_verantwortlich).','.
|
||||
$this->db_add_param($this->gueltig_ab).','.
|
||||
$this->db_add_param($this->archiviert, FHC_BOOLEAN).
|
||||
');';
|
||||
$this->db_add_param($this->schlagworte).');';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -189,10 +179,7 @@ class dms extends basis_db
|
||||
" updateamum=".$this->db_add_param($this->updateamum).",".
|
||||
" updatevon=".$this->db_add_param($this->updatevon).",".
|
||||
" cis_suche=".$this->db_add_param($this->cis_suche, FHC_BOOLEAN).",".
|
||||
" schlagworte=".$this->db_add_param($this->schlagworte).",".
|
||||
" archiviert=".$this->db_add_param($this->archiviert, FHC_BOOLEAN).",".
|
||||
" oe_kurzbz_verantwortlich=".$this->db_add_param($this->oe_kurzbz_verantwortlich).",".
|
||||
" gueltig_ab=".$this->db_add_param($this->gueltig_ab).
|
||||
" schlagworte=".$this->db_add_param($this->schlagworte).
|
||||
" WHERE dms_id=".$this->db_add_param($this->dms_id,FHC_INTEGER)." AND version=".$this->db_add_param($this->version, FHC_INTEGER).";";
|
||||
}
|
||||
|
||||
@@ -698,9 +685,6 @@ class dms extends basis_db
|
||||
$obj->updateamum = $row->updateamum;
|
||||
$obj->cis_suche = $this->db_parse_bool($row->cis_suche);
|
||||
$obj->schlagworte = $row->schlagworte;
|
||||
$obj->gueltig_ab = $row->gueltig_ab;
|
||||
$obj->oe_kurzbz_verantwortlich = $row->oe_kurzbz_verantwortlich;
|
||||
$obj->archiviert = $this->db_parse_bool($row->archiviert);
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
@@ -805,9 +789,6 @@ class dms extends basis_db
|
||||
$obj->cis_suche = $this->db_parse_bool($row->cis_suche);
|
||||
$obj->schlagworte = $row->schlagworte;
|
||||
$obj->berechtigung_kurzbz = $row->berechtigung_kurzbz;
|
||||
$obj->gueltig_ab = $row->gueltig_ab;
|
||||
$obj->oe_kurzbz_verantwortlich = $row->oe_kurzbz_verantwortlich;
|
||||
$obj->archiviert = $this->db_parse_bool($row->archiviert);
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
@@ -859,9 +840,6 @@ class dms extends basis_db
|
||||
$obj->updateamum = $row->updateamum;
|
||||
$obj->cis_suche = $this->db_parse_bool($row->cis_suche);
|
||||
$obj->schlagworte = $row->schlagworte;
|
||||
$obj->gueltig_ab = $row->gueltig_ab;
|
||||
$obj->oe_kurzbz_verantwortlich = $row->oe_kurzbz_verantwortlich;
|
||||
$obj->archiviert = $this->db_parse_bool($row->archiviert);
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
@@ -910,9 +888,6 @@ class dms extends basis_db
|
||||
$obj->version = $row->version;
|
||||
$obj->cis_suche = $this->db_parse_bool($row->cis_suche);
|
||||
$obj->schlagworte = $row->schlagworte;
|
||||
$obj->gueltig_ab = $row->gueltig_ab;
|
||||
$obj->oe_kurzbz_verantwortlich = $row->oe_kurzbz_verantwortlich;
|
||||
$obj->archiviert = $this->db_parse_bool($row->archiviert);
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
@@ -991,9 +966,6 @@ class dms extends basis_db
|
||||
$obj->updateamum = $row->updateamum;
|
||||
$obj->cis_suche = $this->db_parse_bool($row->cis_suche);
|
||||
$obj->schlagworte = $row->schlagworte;
|
||||
$obj->gueltig_ab = $row->gueltig_ab;
|
||||
$obj->oe_kurzbz_verantwortlich = $row->oe_kurzbz_verantwortlich;
|
||||
$obj->archiviert = $this->db_parse_bool($row->archiviert);
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
@@ -1045,9 +1017,6 @@ class dms extends basis_db
|
||||
$obj->updateamum = $row->updateamum;
|
||||
$obj->cis_suche = $this->db_parse_bool($row->cis_suche);
|
||||
$obj->schlagworte = $row->schlagworte;
|
||||
$obj->gueltig_ab = $row->gueltig_ab;
|
||||
$obj->oe_kurzbz_verantwortlich = $row->oe_kurzbz_verantwortlich;
|
||||
$obj->archiviert = $this->db_parse_bool($row->archiviert);
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
@@ -1100,9 +1069,6 @@ class dms extends basis_db
|
||||
$obj->updateamum = $row->updateamum;
|
||||
$obj->cis_suche = $this->db_parse_bool($row->cis_suche);
|
||||
$obj->schlagworte = $row->schlagworte;
|
||||
$obj->gueltig_ab = $row->gueltig_ab;
|
||||
$obj->oe_kurzbz_verantwortlich = $row->oe_kurzbz_verantwortlich;
|
||||
$obj->archiviert = $this->db_parse_bool($row->archiviert);
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
@@ -1459,9 +1425,6 @@ class dms extends basis_db
|
||||
$obj->updateamum = $row->updateamum;
|
||||
$obj->cis_suche = $this->db_parse_bool($row->cis_suche);
|
||||
$obj->schlagworte = $row->schlagworte;
|
||||
$obj->gueltig_ab = $row->gueltig_ab;
|
||||
$obj->oe_kurzbz_verantwortlich = $row->oe_kurzbz_verantwortlich;
|
||||
$obj->archiviert = $this->db_parse_bool($row->archiviert);
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,6 @@ require_once('dbupdate_3.4/61164_abgabetool_quality_gates.php');
|
||||
require_once('dbupdate_3.4/69065_Projektarbeiten_Firmen_verwalten.php');
|
||||
require_once('dbupdate_3.4/68744_StV_settings.php');
|
||||
require_once('dbupdate_3.4/62889_reihungstest_ueberwachung_mit_constructor.php');
|
||||
require_once('dbupdate_3.4/70806_DMS_Erweiterung_Metadaten.php');
|
||||
require_once('dbupdate_3.4/71399_dashboard_update_widget_paths.php');
|
||||
require_once('dbupdate_3.4/71645_studvw_messagetab_ladezeit.php');
|
||||
require_once('dbupdate_3.4/71566_studienordnungsdokument_neuer_organisationseinheitstyp_programm.php');
|
||||
@@ -161,7 +160,7 @@ $tabellen=array(
|
||||
"campus.tbl_dms" => array("dms_id","oe_kurzbz","dokument_kurzbz","kategorie_kurzbz"),
|
||||
"campus.tbl_dms_kategorie" => array("kategorie_kurzbz","bezeichnung","beschreibung","parent_kategorie_kurzbz","oe_kurzbz","berechtigung_kurzbz"),
|
||||
"campus.tbl_dms_kategorie_gruppe" => array("kategorie_kurzbz","gruppe_kurzbz","insertamum","insertvon"),
|
||||
"campus.tbl_dms_version" => array("dms_id","version","filename","mimetype","name","beschreibung","letzterzugriff","updateamum","updatevon","insertamum","insertvon","cis_suche","schlagworte", "oe_kurzbz_verantwortlich", "gueltig_ab", "archiviert", "oe_kurzbz_verantwortlich", "archiviert", "gueltig_ab"),
|
||||
"campus.tbl_dms_version" => array("dms_id","version","filename","mimetype","name","beschreibung","letzterzugriff","updateamum","updatevon","insertamum","insertvon","cis_suche","schlagworte"),
|
||||
"campus.tbl_erreichbarkeit" => array("erreichbarkeit_kurzbz","beschreibung","farbe"),
|
||||
"campus.tbl_feedback" => array("feedback_id","betreff","text","datum","uid","lehrveranstaltung_id","updateamum","updatevon","insertamum","insertvon"),
|
||||
"campus.tbl_freebusy" => array("freebusy_id","uid","freebusytyp_kurzbz","url","aktiv","bezeichnung","insertamum","insertvon","updateamum","updatevon"),
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
<?php
|
||||
if (!defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
// Check if the column campus.tbl_dms_version.oe_kurzbz_verantwortlich exists
|
||||
if ($result = @$db->db_query("
|
||||
SELECT 1
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'campus'
|
||||
AND table_name = 'tbl_dms_version'
|
||||
AND column_name = 'oe_kurzbz_verantwortlich';
|
||||
"))
|
||||
{
|
||||
// If the column does not exist
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
// Then try to create it
|
||||
$info_msg = 'Added column campus.tbl_dms_version.oe_kurzbz_verantwortlich<br>';
|
||||
if (!$result = @$db->db_query('ALTER TABLE IF EXISTS "campus"."tbl_dms_version" ADD COLUMN IF NOT EXISTS "oe_kurzbz_verantwortlich" VARCHAR(32) NULL;'))
|
||||
$info_msg = '<strong>campus.tbl_dms_version '.$db->db_last_error().'</strong><br>';
|
||||
echo $info_msg;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the column campus.tbl_dms_version.archiviert exists
|
||||
if ($result = @$db->db_query("
|
||||
SELECT 1
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'campus'
|
||||
AND table_name = 'tbl_dms_version'
|
||||
AND column_name = 'archiviert';
|
||||
"))
|
||||
{
|
||||
// If the column does not exist
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
// Then try to create it
|
||||
$info_msg = 'Added column campus.tbl_dms_version.archiviert<br>';
|
||||
if (!$result = @$db->db_query('ALTER TABLE IF EXISTS "campus"."tbl_dms_version" ADD COLUMN IF NOT EXISTS "archiviert" BOOLEAN NOT NULL DEFAULT FALSE;'))
|
||||
$info_msg = '<strong>campus.tbl_dms_version '.$db->db_last_error().'</strong><br>';
|
||||
echo $info_msg;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the column campus.tbl_dms_version.gueltig_ab exists
|
||||
if ($result = @$db->db_query("
|
||||
SELECT 1
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'campus'
|
||||
AND table_name = 'tbl_dms_version'
|
||||
AND column_name = 'gueltig_ab';
|
||||
"))
|
||||
{
|
||||
// If the column does not exist
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
// Then try to create it
|
||||
$info_msg = 'Added column campus.tbl_dms_version.gueltig_ab<br>';
|
||||
if (!$result = @$db->db_query('ALTER TABLE IF EXISTS "campus"."tbl_dms_version" ADD COLUMN IF NOT EXISTS "gueltig_ab" TIMESTAMP NULL;'))
|
||||
$info_msg = '<strong>campus.tbl_dms_version '.$db->db_last_error().'</strong><br>';
|
||||
echo $info_msg;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the foreign key fk_organisationseinheit_dms_verantwortlich exists
|
||||
if ($result = @$db->db_query("
|
||||
SELECT 1
|
||||
FROM information_schema.constraint_column_usage
|
||||
WHERE constraint_schema = 'campus'
|
||||
AND constraint_name = 'fk_organisationseinheit_dms_verantwortlich';
|
||||
"))
|
||||
{
|
||||
// If the foreign key does not exist
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
// Then try to create it
|
||||
$info_msg = 'Added foreign key fk_organisationseinheit_dms_verantwortlich<br>';
|
||||
if (!$result = @$db->db_query('
|
||||
ALTER TABLE "campus"."tbl_dms_version"
|
||||
ADD CONSTRAINT "fk_organisationseinheit_dms_verantwortlich"
|
||||
FOREIGN KEY ("oe_kurzbz_verantwortlich")
|
||||
REFERENCES "public"."tbl_organisationseinheit" ("oe_kurzbz")
|
||||
ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
'))
|
||||
$info_msg = '<strong>campus.tbl_dms_version '.$db->db_last_error().'</strong><br>';
|
||||
echo $info_msg;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user