Commit ab3ba542 authored by Gerd Schachtschneider's avatar Gerd Schachtschneider

add license.txt

parent 4582d3d6
......@@ -59,3 +59,10 @@ Stelle sicher das die .htaccess vom Webbrowser beachtet wird. Teste z.B. mit Ein
## siehe auch ##
Init-Wiki <https://wiki.init.mpg.de/share/Lizenzverwaltungssoftware/xataface><br>
Xatface <http://www.xataface.com><br>
## Lizenzbedingungen ##
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.<br>
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.<br>
See the GNU General Public License for more details.<br>
See also the file LICENSE.txt here
[userID]
#widget:type = "hidden"
visibility:list = "hidden"
visibility:browse = "hidden"
visibility:find = "hidden"
[username]
widget:type = select
widget:focus = 1
vocabulary = user
#validators:lettersonly = "1"
#validators:lettersonly:message = "Username: Only letter here allowed"
widget:label = "Username"
column:legend = "User [Ext.]"
widget:description = "Daten von User-DB (view_user ggf. anpassen)"
[password]
encryption = "sha1"
widget:description = "Is empty, the last saved password will not be overwritten"
validators:regex = "/^.{8,31}$/"
validators:regex:message = "Password: Must be between 8 and 31 characters long"
[email]
#widget:type = "Static"
widget:description = "Wird automatisch gesetzt, wenn leer"
validators:email = "1"
validators:email:message = "Email: Must contain a valid email address"
validators:minlength = "10"
validators:minlength:message = "Email: Must have minlength of 10 chars"
[role]
#widget:label = "Permissions"
widget:type = "select"
vocabulary = "roles"
widget:label = "Berechtigung"
<table width="90%">
<tr>
<th>&#160;&#160;&#160;&#160;</th>
<td>&#160;&#160;&#160;&#160;</td>
<th>Wartung - Status</th>
<td>{$elements.wartStatus.html}</td>
<th>Intervall</th>
<td>{$elements.wartIntervall.html}</td>
<th>Letzte</th>
<td>{$elements.wartLetzte.html}</td>
<th>Naechste</th>
<td>{$elements.wartNaechste.html}</td>
</tr>
<tr>
<th>&#160;&#160;&#160;&#160;</th>
<td>&#160;&#160;&#160;&#160;</td>
<th> Pr&uuml;fung - Status</th>
<td>{$elements.pruefStatus.html}</td>
<th>Intervall</th>
<td>{$elements.pruefIntervall.html}</td>
<th>Letzte</th>
<td>{$elements.pruefLetzte.html}</td>
<th>Naechste</th>
<td>{$elements.pruefNaechste.html}</td>
</tr>
</table>
tr.lesser td { background-color: #FF8000;}
tr.toless td { background-color: red;}
tr.enough td { background-color: green;}
tr.equal td { background-color: yellow;}
tr.narrow td { background-color: lime;}
tr.lineY td { background-color: yellow !important;}
#left_column { display: none;}
/* .portlet { display: none;} */
/* #dataface-sections-left-column { display: none;} */
[forgot_password]
;; entspricht disabled
;;[manage]
;; entspricht disabled
[my_profile]
;; entspricht disabled
[change_password]
;; entspricht disabled
[rss]
;; entspricht disabled
[record_rss > rss]
;; entspricht disabled
[related_rss]
;; entspricht disabled
[export_xml]
;; entspricht disabled
[view_xml]
;; entspricht disabled
[related_xml > export_xml]
;; entspricht disabled
[xml_list]
;; entspricht disabled
;; Problem: Man kann suchen, ohne das man angemeldet ist, deshalb permission hier explizit setzen
[search_index]
label="This Site"
category=find_actions
condition="isset($this->_conf['_index'])"
permission=find
action=search_index
[printable_report]
icon="{$site_url}/images/printer.png"
category=result_list_actions
description="See this product list in a printable format"
url="{$app->url('-action=printable_report')}"
;; # bestimmte Tabellen nur
;; condition="$query['-table'] == 'mpi_kosten'"
;; # nur admin darf drucken
;; permission=reports
# nur wegen sortierung, statt in index.php
__sql__ = "SELECT lst.*, IF(vReit.reiter IS NULL, 0, 1) AS exist FROM list_reiter AS lst LEFT JOIN view_reiter AS vReit ON lst.reiter = vReit.reiter ORDER BY reiter"
[__global__]
noLinkFromListView = 1
[autoID]
# nur noch fuer alte DB's
noLinkFromListView = 0
widget:label = "TabID"
order = 10
[tabID]
noLinkFromListView = 0
order = 10
[reiter]
widget:type = select
widget:focus = 1
vocabulary = tables
widget:label = "Tabelle"
column:legend = "[Link]"
filter = 1
order = 20
[kategorie]
widget:type = select
vocabulary = kategorie
filter = 1
order = 30
[favorit]
widget:type = checkbox
widget:label = "Favorit"
widget:description = "F&uuml;r den schnelleren Zugriff unter dem Men&uuml;punkt 'Favorit'"
filter = 1
order = 40
[history]
widget:type = checkbox
widget:label = "Historie"
widget:description = "Soll History-Tabelle erhalten bleiben. Per Default werden alle per Cronjob gel&ouml;scht. In Views unbedeutend"
filter = 1
order = 50
[bedeutung]
widget:atts:size = 75
order = 60
[exist]
#transient = 1
visibility:list = hidden
filter = 1
order = 70
-- view auf list_reiter, weil COLLATE nicht erlaubt in xataface
-- !! achtung fuer jeden view einer datenbank eigenes TABLE_SCHAEMA !!
CREATE OR REPLACE VIEW view_reiter AS
SELECT
CONVERT(table_name USING utf8) COLLATE utf8_unicode_ci AS reiter,
table_type
FROM
information_schema.tables
WHERE
-- fuer jede db setzen
table_schema = 'mpidb_xxx' AND
( table_type = 'base table' OR table_type = 'view' )
;
<link rel="stylesheet" type="text/css" href="styles.css"/>
{*-------------------------------------------------------------------------------
* Dataface Web Application Framework
* Copyright (C) 2005-2006 Steve Hannah (shannah@sfu.ca)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*-------------------------------------------------------------------------------
*}
{load_record}
{use_macro file="Dataface_Main_Template.html"}
{fill_slot name="main_section"}
{if $ENV.prefs.show_result_controller}
{block name="before_details_controller"}
<div id="details-controller">{include file="Dataface_Details_Controller.html"}</div>
{block name="after_details_controller"}
{/if}
{block name="before_record_heading"}
{define_slot name="record_heading"}
<h2 class="dataface-record-title">{if $ENV.record}<span class="dataface-current-record-prelabel"><b>{translate id="templates.Dataface_Record.LABEL_CURRENT_RECORD"}Current Record{/translate}:</b> </span>{$ENV.record->getTitle()}{else}No Records Matched your Request{/if}</h2>
{/define_slot}
{block name="after_record_heading"}
{block name="before_record_tabs"}
{if $ENV.prefs.show_record_tabs}{record_tabs mincount=2 id="record_tabs" id_prefix="record-tabs-" class="contentViews" selected_action=$ENV.mode}
{actions var="menus" category="record_actions"}
{if $menus|@count > 0 }
<div id="contentActionsWrapper" class="contentActions">
<ul>
{foreach from=$menus item="menu" key="name"}
<li>
<a href="{$menu.url}"
id="record-actions-menu-{$menu.id}"
onmouseup="if (activeButton != null) resetButton(activeButton);"
title="{$menu.description}">
<img src="{$menu.icon}"
alt="" width="16" height="16" />
{$menu.label}
</a>
</li>
{/foreach}
</ul>
</div>
{/if}
<div class="documentContent" id="region-content" style="border: 1px solid gray">
{/if}
{block name="before_record_content"}
{define_slot name="record_content"}
Record Content goes here ...
{/define_slot}
{block name="after_record_content"}
{if $ENV.prefs.show_record_tabs}
</div>
{/if}
{block name="before_record_footer"}
{define_slot name="record_footer"}{/define_slot}
{block name="after_record_footer"}
{/fill_slot}
{/use_macro}
\ No newline at end of file
<?php
/**
* A delegate class for the entire application to handle custom handling of
* some functions such as permissions and preferences.
*/
class conf_ApplicationDelegate
{
/**
* Returns permissions array. This method is called every time an action is
* performed to make sure that the user has permission to perform the action.
* @param record A Dataface_Record object (may be null) against which we check
* permissions.
* @see Dataface_PermissionsTool
* @see Dataface_AuthenticationTool
*/
function getPermissions(&$record)
{
$auth =& Dataface_AuthenticationTool::getInstance();
$user =& $auth->getLoggedInUser();
// if the user is null then nobody is logged in... no access.
if ( !isset($user) ) return Dataface_PermissionsTool::NO_ACCESS();
// This will force a login prompt.
$role = $user->val('role');
return Dataface_PermissionsTool::getRolePermissions($role);
// Returns all of the permissions for the user's current role.
}
function block__tables_menu_tail()
{
$user = Dataface_AuthenticationTool::getInstance()->getLoggedInUser();
// if the user is null then nobody is logged in... no access.
if ( !isset($user) ) return Dataface_PermissionsTool::NO_ACCESS();
// This will force a login prompt.
$role = $user->val('role'); // get Role from mpi_users
if ( $role == 'MANAGER' or $role == 'ADMIN')
{
$app =& Dataface_Application::getInstance();
$query =& $app->getQuery();
$url = basename(DATAFACE_SITE_URL);
$cnt = count($app->_tables);
if ( count($app->_tables) <= 13 )
// entsprechend dataface/Dataface/Application.php
{
echo ' <li><a href="/'.$url.'/index.php?-table=mpi_users";
accesskey="accesskeys-navigation";
class="table-selection-tab";
title="Users";
id="TableLink_mpi_users">
Benutzer
</a></li>';
} else {
echo ' <div class="portletContent">
<a href="/'.$url.'/index.php?-table=mpi_users"
accesskey="accesskeys-navigation"
class="navItem "
title="Benutzer"
id="TableLink_mpi_users">
<img src="'.DATAFACE_URL.'/images/folder_icon.gif" alt="" class="navIconRoot" title="Benutzer" />
<span class="navItemText"> Benutzer </span>
</a>
</div>';
}
}
}
}
?>
/* global settings */
#left_column { display: none; }
/* body { font-size: 72%; } */
/* #main_table { font-size: 105%; } */
legend { background-color: transparent; }
div.top { background-color: whitesmoke; }
div.documentContent { background-color: #FFFCED; }
table.Dataface_QuickForm-table-wrapper { width: 100%; }
table.xf-grid-table { white-space: nowrap; }
table.xf-grid-table td { vertical-align: top; }
/* .discreet { color: DarkSlateBlue; text-align: left }
.portalMessage { background-color: #FFAAAA; }
.horizontalDivider { display: none; } */
.contentViews li a:hover,
.contentViews .selected a,
.contentActions li,
.contentActions li a,
.contentActions { color: #426071; background-color: #bed0da; border-color: #426071; float: none; }
.contentViews,
.contentViews li,
.contentViews li a { color: #426071; border-color: #426071; }
/* Ueberschriften allg. etwas groesser per Default */
h1 { font-size: 120%; }
h2 { font-size: 115%; }
h3 { font-size: 110%; }
h4 { font-size: 105%; }
/* Text im Modus Ansicht etwas vergroessern */
table.record-view-table td { font-size: 100%; }
table.record-view-table th { font-size: 100%; }
li.Dataface_GlanceList-item { font-size: 110%; }
.date { font-weight: normal; }
/* global table edit background colors */
td.Dataface_QuickForm-label-cell {
width: 17%;
/* color: #00264d; */
text-align: right;
vertical-align: top;
background-color: #aec4d0; }
td.Dataface_QuickForm-widget-cell,
tr.listing.odd td { background-color: #f2f2f2; }
tr.listing.even td { background-color: #fafafa; }
[__global__]
noLinkFromListView = 1
[autoID]
widget:label = "TabID"
[reiter]
key = PRI
widget:label = "Tabelle"
column:legend = "[Link]"
filter = 1
[kategorie]
filter = 1
[favorit]
visibility:list = hidden
[history]
visibility:list = hidden
[bedeutung]
widget:atts:size = 75
<?php
class tables_list_reiter {
/*
// geht leider wegen xataface parser nicht, deshalb per view
function __sql__() {
$app = Dataface_Application::getInstance();
$db = $app->_conf['_database']['name'];
return "SELECT lst.*, IF(shw.reiter IS NULL, 0, 1) AS exist FROM list_reiter AS lst LEFT JOIN ( SELECT CONVERT(table_name USING utf8) COLLATE utf8_unicode_ci AS reiter, table_type FROM information_schema.tables WHERE table_schema = '$db' AND ( table_type = 'base table' OR table_type = 'view' ))AS shw ON lst.reiter = shw.reiter";
}
*/
// loeschen nur fuer admin oder manager erlaubt
function getPermissions($record) {
$auth =& Dataface_AuthenticationTool::getInstance();
$user =& $auth->getLoggedInUser();
if ( !isset($user) ) return Dataface_PermissionsTool::NO_ACCESS();
$role = $user->val('role'); // get Role from mpi_users
if ( $role == 'MANAGER' or $role == 'ADMIN') return;
return Dataface_PermissionsTool::getRolePermissions('EDIT');
}
// zeige alle noch nicht erfassten tabellen als auswahl
function valuelist__tables() {
$app = Dataface_Application::getInstance();
$db = $app->_conf['_database']['name'];
static $user = -1;
if ( !is_array($tables) ) {
$tables = array();
$res = mysql_query("SHOW FULL TABLES FROM $db WHERE NOT EXISTS ( SELECT * FROM list_reiter AS lst WHERE lst.reiter = Tables_in_$db COLLATE utf8_unicode_ci )", df_db());
if ( !$res ) throw new Exception(mysql_error(df_db()));
while ($row = mysql_fetch_row($res)) $tables[$row[0]] = $row[1].' : '.$row[0];
}
return $tables;
}
function reiter__renderCell( &$record ) {
$table = $record->strval('reiter');
if ( $record->strval('exist') == '0' ) return '<font color="red">'.$table.'</font>';
return '<a href="'.DATAFACE_SITE_HREF.'?-table='.$table.'">'.$table.'</a>';
}
function beforeSave(&$record) {
if ($record->strval('bedeutung') == NULL) {
$record->setValue('bedeutung', $record->strval('reiter'));
}
}
}
?>
<table width="80%">
<tr>
<th>&#160;&#160;&#160;&#160;</th>
<td></td>
<th>Plz</th>
<td>{$elements.plz.html}</td>
<th>Ort</th>
<td>{$elements.ort.html}</td>
<th>Strasse</th>
<td>{$elements.strasse.html}</td>
</tr>
<tr>
<th>&#160;&#160;&#160;&#160;</th>
<td></td>
<th>Bundesland</th>
<td>{$elements.stateBundesland.html}</td>
<th>Land</th>
<td>{$elements.land.html}</td>
</tr>
</table>
<?php
class tables_view_favorit {
// 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');
}
// table read only
function getRoles(&$record) {
return 'READ ONLY';
}
function reiter__renderCell( &$record ) {
$table = $record->strval('reiter');
return '<a href="'.DATAFACE_SITE_HREF.'?-table='.$table.'">'.$table.'</a>';
}
function block__after_result_list_content() {
$url = DATAFACE_SITE_HREF."?-table=list_reiter&-action=list";
echo 'Zum hinzuf&uuml;gen setze Checkbox Favorit in der gew&uuml;nschten Tabelle <a href='.$url.'>list_reiter</a>';
}
function autoID__renderCell(&$record) {
$table = 'list_reiter';
$action = 'edit';
$field = 'autoID';
$tabID = $record->val($field);
$name = $tabID;
$url = DATAFACE_SITE_HREF."?-table=${table}&-action=${action}&${field}=${tabID}";
return '<div style="text-align:left;"><a href="'.$url.'">'.$name.'</a></div>';
}
}
?>