add list of conversion and notification services

This commit is contained in:
Uwe Steinmann 2023-02-12 14:33:51 +01:00
parent 6c6b754e52
commit d07219a213
3 changed files with 116 additions and 1 deletions

View File

@ -0,0 +1,47 @@
<?php
// MyDMS. Document Management System
// Copyright (C) 2010 Matteo Lucarelli
//
// 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., 675 Mass Ave, Cambridge, MA 02139, USA.
if(!isset($settings))
require_once("../inc/inc.Settings.php");
require_once("inc/inc.Utils.php");
require_once("inc/inc.LogInit.php");
require_once("inc/inc.Language.php");
require_once("inc/inc.Init.php");
require_once("inc/inc.Extension.php");
require_once("inc/inc.DBInit.php");
require_once("inc/inc.ClassUI.php");
require_once("inc/inc.Authentication.php");
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
$accessop = new SeedDMS_AccessOperation($dms, null, $user, $settings);
if (!$settings->_enableDebugMode) {
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
}
if (!$accessop->check_view_access($view, $_GET)) {
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
}
if($view) {
$view->setParam('settings', $settings);
$view->setParam('accessobject', $accessop);
$view->setParam('conversionmgr', $conversionmgr);
$view($_GET);
exit;
}

View File

@ -29,7 +29,7 @@ require_once("inc/inc.Authentication.php");
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
$accessop = new SeedDMS_AccessOperation($dms, null, $user, $settings);
if (!$settings->_enableDebugMode) {
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
}

View File

@ -0,0 +1,68 @@
<?php
/**
* Implementation of Conversion Services view
*
* @category DMS
* @package SeedDMS
* @license GPL 2
* @version @version@
* @author Uwe Steinmann <uwe@steinmann.cx>
* @copyright Copyright (C) 2010-2023 Uwe Steinmann
* @version Release: @package_version@
*/
/**
* Class which outputs the html page for Conversion Services view
*
* @category DMS
* @package SeedDMS
* @author Uwe Steinmann <uwe@steinmann.cx>
* @copyright Copyright (C) 2016 Uwe Steinmann
* @version Release: @package_version@
*/
class SeedDMS_View_ConversionServices extends SeedDMS_Theme_Style {
/**
* List all registered conversion services
*
*/
function list_conversion_services($conversionmgr) { /* {{{ */
if(!$conversionmgr)
return;
$allservices = $conversionmgr->getServices();
echo "<table class=\"table table-condensed table-sm\">\n";
echo "<thead>";
echo "<tr><th>".getMLText('service_list_from')."</th><th>".getMLText('service_list_to')."</th><th>".getMLText('class_name')."</th><th>".getMLText('service_list_info')."</th></tr>\n";
echo "</thead>";
echo "<tbody>";
foreach($allservices as $from=>$tos) {
foreach($tos as $to=>$services) {
foreach($services as $service) {
echo "<tr><td>".$from."</td><td>".$to."</td><td>".get_class($service)."</td><td>".$service->getInfo()."</td></tr>";
}
}
}
echo "</tbody>";
echo "</table>\n";
} /* }}} */
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$conversionmgr = $this->params['conversionmgr'];
$this->htmlStartPage(getMLText("admin_tools"));
$this->globalNavigation();
$this->contentStart();
$this->pageNavigation(getMLText("admin_tools"), "admin_tools");
$this->contentHeading(getMLText("list_conversion_services"));
self::list_conversion_services($conversionmgr);
$this->contentEnd();
$this->htmlEndPage();
} /* }}} */
}