Commit e6260d99 authored by Gerd Schachtschneider's avatar Gerd Schachtschneider
Browse files

initial

parent 4380968a
[__global__]
noLinkFromListView = 1
[tabID]
visibility:list = hidden
Key = PRI
[substanz]
noLinkFromListView = 0
filter = 1
[lgk]
widget:label = "Lagerklasse"
filter = 1
[cmr]
widget:label = "CMR-Stoff"
filter = 1
[cas]
widget:label = "CAS-Nummer"
[gruppe]
Key = PRI
filter = 1
[bfile]
widget:label = "Betriebsanweisung"
[bfile_filename]
widget:label = "Dateiname"
column:legend = "Betriebsanweisung"
[sfile]
widget:label = "Sicherheitsdatenblatt"
[sfile_filename]
widget:label = "Dateiname"
column:legend = "Sicherheitsdatenblatt"
[bearbeiter]
[zeitstempel]
<?php
class tables_view_chemAll {
// check login & editieren nicht erlaubt
function getPermissions($record) {
$auth =& Dataface_AuthenticationTool::getInstance();
$user =& $auth->getLoggedInUser();
if ( !isset($user) ) return Dataface_PermissionsTool::NO_ACCESS();
return Dataface_PermissionsTool::getRolePermissions('READ ONLY');
}
// setze indiv. Farbe in listenansicht fuer tabelle
function css__tableRowClass( &$record ) {
$query = Dataface_Application::getInstance()->getQuery();
$table = $query['-table'].' ';
// return $table.'normal'; //mit color
return $table;
}
// link nach Substanz
function substanz__renderCell( &$record ) {
$subst = $record->strval('substanz');
$tabID = $record->strval('tabID');
$subdb = $record->strval('gruppe').'_chem';
$table = 'mpi_chemstoff';
return '<div style="white-space:nowrap"><a href="/'.$subdb.'/index.php?-table='.$table.'&-action=browse&tabID='.$tabID.'">'.$subst.'</a></div>';
}
/*
// Umbruch in Liste verhindern !!! verhindert leider auch den link in releationships
function substanz__renderCell(&$record) {
return '<div style="white-space:nowrap">'.$record->display('substanz').'</div>';
}
*/
// Umbruch in Liste verhindern
function cas__renderCell(&$record) {
return '<div style="white-space:nowrap">'.$record->display('cas').'</div>';
}
// Umbruch in Liste verhindern !!! verhindert leider auch den link in releationships
function einheit__renderCell(&$record) {
return '<div style="white-space:nowrap">'.$record->display('einheit').'</div>';
}
function cmr__renderCell(&$record) {
if ($record->val('cmr') == '1') return 'ja'; else return 'nein';
}
// Formatiere Zeitstempel auf Deutsch
function zeitstempel__display(&$record) {
if ($record->strval('zeitstempel') == NULL) return;
return date('d.m.Y', strtotime($record->strval('zeitstempel')));
}
}
?>
-- Version mpg
-- entsprechend erweitern/anpassen, wenn mehr chemie-db's existieren
CREATE OR REPLACE VIEW view_chemAll AS
SELECT
mpg.tabID AS tabID,
mpg.substanz AS substanz,
mpg.reinheit AS reinheit,
mpg.lgk AS lgk,
mpg.cmr AS cmr,
mpg.cas AS cas,
mpg.einheit AS einheit,
'mpg' AS gruppe,
mpg.bearbeiter AS bearbeiter,
mpg.zeitstempel AS zeitstempel
FROM mpidb_mpg_chem.mpi_chemstoff AS mpg
;
-- Version mpi-dcts
CREATE OR REPLACE VIEW view_chemAll AS
SELECT
bio.tabID AS tabID,
bio.substanz AS substanz,
bio.reinheit AS reinheit,
bio.lgk AS lgk,
bio.cmr AS cmr,
bio.cas AS cas,
bio.einheit AS einheit,
'bio' AS gruppe,
bio.bearbeiter AS bearbeiter,
bio.zeitstempel AS zeitstempel
FROM mpidb_bio_chem.mpi_chemstoff AS bio
UNION ALL
SELECT
bpe.tabID AS tabID,
bpe.substanz AS substanz,
bpe.reinheit AS reinheit,
bpe.lgk AS lgk,
bpe.cmr AS cmr,
bpe.cas AS cas,
bpe.einheit AS einheit,
'bpe' AS gruppe,
bpe.bearbeiter AS bearbeiter,
bpe.zeitstempel AS zeitstempel
FROM
mpidb_bpe_chem.mpi_chemstoff AS bpe
UNION ALL
SELECT
pcg.tabID AS tabID,
pcg.substanz AS substanz,
pcg.reinheit AS reinheit,
pcg.lgk AS lgk,
pcg.cmr AS cmr,
pcg.cas AS cas,
pcg.einheit AS einheit,
'pcg' AS gruppe,
pcg.bearbeiter AS bearbeiter,
pcg.zeitstempel AS zeitstempel
FROM
mpidb_pcg_chem.mpi_chemstoff AS pcg
UNION ALL
SELECT
pse.tabID AS tabID,
pse.substanz AS substanz,
pse.reinheit AS reinheit,
pse.lgk AS lgk,
pse.cmr AS cmr,
pse.cas AS cas,
pse.einheit AS einheit,
'pse' AS gruppe,
pse.bearbeiter AS bearbeiter,
pse.zeitstempel AS zeitstempel
FROM
mpidb_pse_chem.mpi_chemstoff AS pse
;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment