Browse Source

Merge remote-tracking branch 'upstream/master'

experimental
Paweł Bukowski 2 years ago
parent
commit
41f21e7ab3
100 changed files with 2024 additions and 11463 deletions
  1. +2
    -2
      README.md
  2. +83
    -0
      Vagrantfile
  3. +10
    -4
      composer.json
  4. +1099
    -540
      composer.lock
  5. +3
    -0
      console.php
  6. +3
    -3
      console/Develop/CreateModuleCommand.php
  7. +140
    -0
      console/Develop/CreateTestModuleCommand.php
  8. +33
    -0
      console/RebuildAllCommand.php
  9. +57
    -0
      console/RemoveAllCommand.php
  10. +18
    -0
      docs/CHANGELOG.md
  11. +2
    -2
      include/misc.php
  12. +1
    -1
      include/version.php
  13. +125
    -7
      modules/Applets/Clock/ClockCommon_0.php
  14. +22
    -3
      modules/Applets/Clock/Clock_0.php
  15. +1
    -1
      modules/Base/Dashboard/Dashboard_0.php
  16. +1
    -1
      modules/Base/Notify/NotifyCommon_0.php
  17. +302
    -201
      modules/Base/Notify/js/desktop-notify.js
  18. +27
    -27
      modules/Base/Notify/js/main.js
  19. +3
    -0
      modules/Base/Notify/refresh.php
  20. +6
    -2
      modules/Libs/TCPDF/TCPDFCommon_0.php
  21. +5
    -0
      modules/Libs/TCPDF/composer.json
  22. +81
    -0
      modules/Libs/TCPDF/composer.lock
  23. +0
    -332
      modules/Libs/TCPDF/tcpdf5.9/2dbarcodes.php
  24. +0
    -2405
      modules/Libs/TCPDF/tcpdf5.9/CHANGELOG.TXT
  25. +0
    -858
      modules/Libs/TCPDF/tcpdf5.9/LICENSE.TXT
  26. +0
    -97
      modules/Libs/TCPDF/tcpdf5.9/README.TXT
  27. +0
    -2287
      modules/Libs/TCPDF/tcpdf5.9/barcodes.php
  28. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/afr.php
  29. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/ara.php
  30. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/aze.php
  31. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/bel.php
  32. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/bra.php
  33. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/bul.php
  34. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/cat.php
  35. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/ces.php
  36. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/chi.php
  37. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/cym.php
  38. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/dan.php
  39. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/eng.php
  40. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/est.php
  41. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/eus.php
  42. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/far.php
  43. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/fra.php
  44. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/ger.php
  45. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/gle.php
  46. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/glg.php
  47. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/hat.php
  48. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/heb.php
  49. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/hrv.php
  50. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/hun.php
  51. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/hye.php
  52. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/ind.php
  53. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/ita.php
  54. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/jpn.php
  55. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/kat.php
  56. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/kor.php
  57. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/mkd.php
  58. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/mlt.php
  59. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/msa.php
  60. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/nld.php
  61. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/nob.php
  62. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/pol.php
  63. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/por.php
  64. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/ron.php
  65. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/rus.php
  66. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/slv.php
  67. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/spa.php
  68. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/sqi.php
  69. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/srp.php
  70. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/swa.php
  71. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/swe.php
  72. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/ukr.php
  73. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/urd.php
  74. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/yid.php
  75. +0
    -47
      modules/Libs/TCPDF/tcpdf5.9/config/lang/zho.php
  76. +0
    -250
      modules/Libs/TCPDF/tcpdf5.9/config/tcpdf_config.php
  77. +0
    -1148
      modules/Libs/TCPDF/tcpdf5.9/datamatrix.php
  78. +0
    -846
      modules/Libs/TCPDF/tcpdf5.9/encodings_maps.php
  79. +0
    -15
      modules/Libs/TCPDF/tcpdf5.9/fonts/cid0cs.php
  80. +0
    -15
      modules/Libs/TCPDF/tcpdf5.9/fonts/cid0ct.php
  81. +0
    -15
      modules/Libs/TCPDF/tcpdf5.9/fonts/cid0jp.php
  82. +0
    -15
      modules/Libs/TCPDF/tcpdf5.9/fonts/cid0kr.php
  83. +0
    -5
      modules/Libs/TCPDF/tcpdf5.9/fonts/cid0xx.php
  84. +0
    -12
      modules/Libs/TCPDF/tcpdf5.9/fonts/courier.php
  85. +0
    -12
      modules/Libs/TCPDF/tcpdf5.9/fonts/courierb.php
  86. +0
    -12
      modules/Libs/TCPDF/tcpdf5.9/fonts/courierbi.php
  87. +0
    -12
      modules/Libs/TCPDF/tcpdf5.9/fonts/courieri.php
  88. BIN
      modules/Libs/TCPDF/tcpdf5.9/fonts/dejavusanscondensed.ctg.z
  89. +0
    -16
      modules/Libs/TCPDF/tcpdf5.9/fonts/dejavusanscondensed.php
  90. BIN
      modules/Libs/TCPDF/tcpdf5.9/fonts/dejavusanscondensed.z
  91. BIN
      modules/Libs/TCPDF/tcpdf5.9/fonts/dejavusanscondensedb.ctg.z
  92. +0
    -16
      modules/Libs/TCPDF/tcpdf5.9/fonts/dejavusanscondensedb.php
  93. BIN
      modules/Libs/TCPDF/tcpdf5.9/fonts/dejavusanscondensedb.z
  94. BIN
      modules/Libs/TCPDF/tcpdf5.9/fonts/dejavusanscondensedbi.ctg.z
  95. +0
    -16
      modules/Libs/TCPDF/tcpdf5.9/fonts/dejavusanscondensedbi.php
  96. BIN
      modules/Libs/TCPDF/tcpdf5.9/fonts/dejavusanscondensedbi.z
  97. BIN
      modules/Libs/TCPDF/tcpdf5.9/fonts/dejavusanscondensedi.ctg.z
  98. +0
    -16
      modules/Libs/TCPDF/tcpdf5.9/fonts/dejavusanscondensedi.php
  99. BIN
      modules/Libs/TCPDF/tcpdf5.9/fonts/dejavusanscondensedi.z
  100. +0
    -13
      modules/Libs/TCPDF/tcpdf5.9/fonts/helvetica.php

+ 2
- 2
README.md View File

@@ -48,7 +48,7 @@ It requires properly configured HTTP server with PHP and MySQL or PostgreSQL dat

EPESI is released under the MIT License

Copyright © 2006-2016 Telaxus LLC
Copyright © 2006-2018 Telaxus LLC

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/orsell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@@ -63,7 +63,7 @@ Telaxus LLC http://telaxus.com/
- Telaxus LLC is a technology company specializing in developoment of CRM and ERP solutions for small and medium size businesses utilizing our own platform - EPESI Business Information Manager.


<i>Copyright © 2006-2016 Telaxus LLC</i>
<i>Copyright © 2006-2018 Telaxus LLC</i>

Enjoy,
<b>EPESI Team</b>

+ 83
- 0
Vagrantfile View File

@@ -0,0 +1,83 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.

# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box = "ubuntu/trusty64"

# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# NOTE: This will enable public access to the opened port
# config.vm.network "forwarded_port", guest: 80, host: 8080

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine and only allow access
# via 127.0.0.1 to disable public access
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"

# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", type: "dhcp"

# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"

# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
config.vm.synced_folder ".", "/var/www/epesi", owner: "www-data", group: "www-data"
config.vm.synced_folder ".", "/vagrant"

# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# end
#
# View the documentation for the provider you are using for more
# information on available options.

# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", inline: <<-SHELL
# apt-get update
# apt-get install -y apache2
# SHELL

config.vm.provision "ansible_local" do |ansible|
ansible.playbook = "playbook.yml"
ansible.compatibility_mode = "2.0"
end

config.vm.provision "shell", privileged: false, inline: <<-EOF
echo "Congratulations! Vagrant machine is provisioned!"
echo "Now setup Your Epesi http://$(facter -p ipaddress_eth1)"
echo "Database credentials: admin:$(cat /vagrant/mysqlpassword)"
EOF
end

+ 10
- 4
composer.json View File

@@ -12,13 +12,19 @@
"psy/psysh": "@stable",
"enyo/dropzone": "@stable",
"ezyang/htmlpurifier": "^4.9",
"moneyphp/money": "^3.0"
"moneyphp/money": "^3.0",
"tecnickcom/tcpdf": "^6.2"
},
"scripts": {
"post-install-cmd": [
"@composer -d=\"modules/CRM/Mail\" install",
"@composer -d=\"modules/Libs/PHPExcel\" install"
]
"@composer -d\"modules/CRM/Mail\" install",
"@composer -d\"modules/Libs/PHPExcel\" install",
"@composer -d\"vendor/tecnickcom/tcpdf\" install",
"@composer -d\"vendor/tecnickcom/tcpdf\" dump-autoload"
],
"post-update-cmd": [
"@composer -d\"vendor/tecnickcom/tcpdf\" dump-autoload"
]
},
"autoload": {
"psr-4": {


+ 1099
- 540
composer.lock
File diff suppressed because it is too large
View File


+ 3
- 0
console.php View File

@@ -41,5 +41,8 @@ $application->add(new \Epesi\Console\Backup\ListBackupsCommand());
$application->add(new \Epesi\Console\Demo\GenerateContactsCommand());
$application->add(new \Epesi\Console\Develop\CreateModuleCommand());
$application->add(new \Epesi\Console\Develop\CreatePatchCommand());
$application->add(new \Epesi\Console\Develop\CreateTestModuleCommand());
$application->add(new \Epesi\Console\ShellCommand());
$application->add(new \Epesi\Console\RebuildAllCommand());
$application->add(new \Epesi\Console\RemoveAllCommand());
$application->run($input);

+ 3
- 3
console/Develop/CreateModuleCommand.php View File

@@ -20,7 +20,7 @@ class CreateModuleCommand extends Command
{
$this
->setName('dev:module:create')
->setDescription('Create EPESI module files')
->setDescription('Create EPESI empty module files')
->addArgument(
'name',
InputArgument::REQUIRED,
@@ -125,10 +125,10 @@ class CreateModuleCommand extends Command
Method::make('requires')
->addArgument(
Argument::make('mixed', 'v'))
->setBody("{$t}{$t}return array(\n$required_modules_str\n{$t}{$t});"))
->setBody("{$t}{$t}return [\n$required_modules_str\n{$t}{$t}];"))
->addMethod(
Method::make('version')
->setBody("{$t}{$t}return array('0.1');"))
->setBody("{$t}{$t}return ['0.1'];"))
);

if (file_put_contents($file_install, $prettyPrinter->generateCode($myFile)) !== false) {


+ 140
- 0
console/Develop/CreateTestModuleCommand.php View File

@@ -0,0 +1,140 @@
<?php

namespace Epesi\Console\Develop;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

use Memio\Memio\Config\Build;
use Memio\Model\File;
use Memio\Model\Object;
use Memio\Model\Method;
use Memio\Model\Argument;

class CreateTestModuleCommand extends Command
{
protected function configure()
{
$this
->setName('dev:module:test')
->setDescription('Create EPESI Custom Test module files with menu and simple setup')
->addOption(
'require', 'r',
InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
'Define required modules'
);
}

protected function execute(InputInterface $input, OutputInterface $output)
{
$module_name = 'Testing';
$requires = $input->getOption('require');

$module_type = 'Custom_'.$module_name;

//region Add defined("_VALID_ACCESS") to file.twig if not found
$current = file_get_contents(EPESI_LOCAL_DIR . '/vendor/memio/twig-template-engine/templates/file.twig');
if (!preg_match('/defined\(\"\_VALID\_ACCESS\"\)/', $current)) {
file_put_contents(
EPESI_LOCAL_DIR . '/vendor/memio/twig-template-engine/templates/file.twig',
str_replace(
'<?php',
'<?php' . PHP_EOL . 'defined("_VALID_ACCESS") || die(\'Direct access forbidden\');' . PHP_EOL,
$current
)
);
}
//endregion

$prettyPrinter = Build::prettyPrinter();

//region Create module dir
$module_dir = EPESI_LOCAL_DIR . '/modules/Custom/' . $module_name;
if (file_exists($module_dir)) {
$msg = "File or directory: $module_dir already exists";
$output->writeln($msg);
} else {
mkdir($module_dir, 0777, true);
$output->writeln("Created module directory: $module_dir");
}
//endregion

//region Main File
$file_main = $module_dir . '/' . $module_name . '_0.php';
$myFile = File::make($file_main)
->setStructure(
Object::make($module_type)
->extend(
Object::make('Module'))
->addMethod(
Method::make('body')
)
);

if (file_put_contents($file_main, $prettyPrinter->generateCode($myFile)) !== false) {
$output->writeln("Created file: $file_main");
}
//endregion

//region Common File
$t = ' ';
$file_common = $module_dir . '/' . $module_name . 'Common_0.php';
$myFile = File::make($file_common)
->setStructure(
Object::make($module_type . 'Common')
->extend(
Object::make('ModuleCommon')
)
->addMethod(
Method::make('menu')
->setBody("{$t}{$t}return ['_Testing' => []];"))
);

if (file_put_contents($file_common, $prettyPrinter->generateCode($myFile)) !== false) {
$output->writeln("Created file: $file_common");
}
//endregion

//region Install File

$closure = function ($m) use ($t) {
$m = preg_replace('#^modules/#', '', $m);
return "{$t}{$t}{$t}array('name' => '$m', 'version' => 0)";
};
$required_modules_str = implode(",\n", array_map($closure, $requires));
$file_install = $module_dir . '/' . $module_name . 'Install.php';
$myFile = File::make($file_install)
->setStructure(
Object::make($module_type . 'Install')
->extend(
Object::make('ModuleInstall'))
->addMethod(
Method::make('install')
->setBody("{$t}{$t}return true;"))
->addMethod(
Method::make('uninstall')
->setBody("{$t}{$t}return true;"))
->addMethod(
Method::make('requires')
->addArgument(
Argument::make('mixed', 'v'))
->setBody("{$t}{$t}return [\n$required_modules_str\n{$t}{$t}];"))
->addMethod(
Method::make('version')
->setBody("{$t}{$t}return ['0.1'];"))
->addMethod(
Method::make('simple_setup')
->setBody("{$t}{$t}return ['package' => '_Test module'];")
)
);

if (file_put_contents($file_install, $prettyPrinter->generateCode($myFile)) !== false) {
$output->writeln("Created file: $file_install");
}
//endregion

}
}

+ 33
- 0
console/RebuildAllCommand.php View File

@@ -0,0 +1,33 @@
<?php

/**
* Created by PhpStorm.
* User: pjedwabny
* Date: 08.09.15
* Time: 21:10
*/
namespace Epesi\Console;
use Cache;
use ModuleManager;
use Base_ThemeCommon;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class RebuildAllCommand extends Command
{
protected function configure(){
$this
->setName('rebuild:all')
->setDescription('Rebuild EPESI default theme and cache')
;
}
protected function execute(InputInterface $input, OutputInterface $output) {
$output->writeln('Rebuilding themes...');
Base_ThemeCommon::themeup();
$output->writeln('Theme rebuilt! Rebuilding cache...');
Cache::clear();
ModuleManager::create_common_cache();
$output->writeln('Cache rebuilt!');
}
}

+ 57
- 0
console/RemoveAllCommand.php View File

@@ -0,0 +1,57 @@
<?php

namespace Epesi\Console;
use DB;
use Cache;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;


class RemoveAllCommand extends Command
{
protected function configure()
{
$this
->setName('remove:all')
->setDescription('Truncate database and remove all data from EPESI')
;
}

protected function execute(InputInterface $input, OutputInterface $output)
{
$dir = __DIR__ . '/../data/';

if(is_dir($dir)) {
$this->truncateDir($output, $dir);
}
else {
$output->writeln('Data directory doesn\'t exist or you don\'t have required permissions');
}
$this->truncateDb($output);
$output->writeln('EPESI removed. Please install application again');
}

private function truncateDir($output, $dir) {
$files = array_diff(scandir($dir), ['.', '..']);
foreach ($files as $file) {
if(!is_dir("$dir/$file")) unlink("$dir/$file");
else {
$handle = opendir("$dir/$file");
closedir($handle);
exec('rm -rf '."$dir/$file");
}
}
$output->writeln('Data folder cleared!');
}

private function truncateDb ($output) {
Cache::clear();
DB::Execute('SET FOREIGN_KEY_CHECKS=0;');
foreach(DB::MetaTables() as $k => $v) {
DB::DropTable($v);
}
DB::Execute('SET FOREIGN_KEY_CHECKS=1;');
$output->writeln('Database truncated!');
}
}

+ 18
- 0
docs/CHANGELOG.md View File

@@ -3,6 +3,24 @@ EPESI CHANGELOG

(Dev) means that this change is significant only for developers.

RELEASE 1.8.2-20180413
----------------------

### Fixed
- Error: "Undefined index: name" in dashboard
- BBcode display
- watchdog applet caused epesi error

### Feature
- Double clock
- HTML5 Notification
- rebuild:all command
- remove:all command
- create test module command
- possibility to set tooltip for leightbox buttons
- TCPDF from composer (dev)


RELEASE 1.8.2-20171019
----------------------



+ 2
- 2
include/misc.php View File

@@ -316,7 +316,7 @@ function recalculate_time($date,$time) {
function escapeJS($str,$double=true,$single=true) {return Epesi::escapeJS($str,$double,$single);}

function get_epesi_url() {
if(defined('EPESI_URL')) return rtrim(EPESI_URL,'/');
if(defined('EPESI_URL')) return rtrim(EPESI_URL,'/') . '/';
if(php_sapi_name() == 'cli')
return dirname(dirname(__FILE__));
$protocol = (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS'])!== "off") ? 'https://' : 'http://';
@@ -327,7 +327,7 @@ function get_epesi_url() {
$domain_name = $_SERVER['SERVER_NAME'];
}
$url = ($domain_name ? ($protocol . $domain_name) : '') . EPESI_DIR;
return trim($url);
return rtrim(trim($url), '/') . '/';
}

function get_client_ip_address()


+ 1
- 1
include/version.php View File

@@ -1,6 +1,6 @@
<?php
define("EPESI_VERSION", '1.8.2');
define("EPESI_REVISION", 20171019);
define("EPESI_REVISION", 20180413);

function epesi_requires_update()
{


+ 125
- 7
modules/Applets/Clock/ClockCommon_0.php View File

@@ -14,6 +14,42 @@
defined("_VALID_ACCESS") || die('Direct access forbidden');

class Applets_ClockCommon extends ModuleCommon {
public static function get_timezones() {
return array(
'-12.0' => __('(GMT-12:00) Eniwetok, Kwajalein'),
'-11.0' => __('(GMT-11:00) Midway Island, Samoa'),
'-10.0' => __('(GMT-10:00) Hawaii'),
'-9.0' => __('(GMT-9:00) Alaska'),
'-8.0' => __('(GMT-8:00) Pacific Time (US &amp; Canada)'),
'-7.0' => __('(GMT-7:00) Mountain Time (US &amp; Canada)'),
'-6.0' => __('(GMT-6:00) Central Time (US &amp; Canada), Mexico City'),
'-5.0' => __('(GMT-5:00) Eastern Time (US &amp; Canada), Bogota, Lima'),
'-4.0' => __('(GMT-4:00) Atlantic Time (Canada), Caracas, La Paz'),
'-3.5' => __('(GMT-3:30) Newfoundland'),
'-3.0' => __('(GMT-3:00) Brazil, Buenos Aires, Georgetown'),
'-2.0' => __('(GMT-2:00) Mid-Atlantic'),
'-1.0' => __('(GMT-1:00 hour) Azores, Cape Verde Islands'),
'0.0' => __('(GMT) Western Europe Time, London, Lisbon, Casablanca'),
'1.0' => __('(GMT+1:00 hour) Hamburg, Berlin, Brussels, Madrid, Paris'),
'2.0' => __('(GMT+2:00) Kaliningrad, South Africa'),
'3.0' => __('(GMT+3:00) Baghdad, Riyadh, Moscow, St. Petersburg'),
'3.5' => __('(GMT+3:30) Tehran'),
'4.0' => __('(GMT+4:00) Abu Dhabi, Muscat, Baku, Tbilisi'),
'4.5' => __('(GMT+4:30) Kabul'),
'5.0' => __('(GMT+5:00) Ekaterinburg, Islamabad, Karachi, Tashkent'),
'5.5' => __('(GMT+5:30) Bombay, Calcutta, Madras, New Delhi'),
'5.75' => __('(GMT+5:45) Kathmandu'),
'6.0' => __('(GMT+6:00) Almaty, Dhaka, Colombo'),
'7.0' => __('(GMT+7:00) Bangkok, Hanoi, Jakarta'),
'8.0' => __('(GMT+8:00) Beijing, Perth, Singapore, Hong Kong'),
'9.0' => __('(GMT+9:00) Tokyo, Seoul, Osaka, Sapporo, Yakutsk'),
'9.5' => __('(GMT+9:30) Adelaide, Darwin'),
'10.0' => __('(GMT+10:00) Eastern Australia, Guam, Vladivostok'),
'11.0' => __('(GMT+11:00) Magadan, Solomon Islands, New Caledonia'),
'12.0' => __('(GMT+12:00) Auckland, Wellington, Fiji, Kamchatka')
);
}
public static function applet_caption() {
return __('Clock');
}
@@ -23,15 +59,97 @@ class Applets_ClockCommon extends ModuleCommon {
}

public static function applet_settings() {
$browser = stripos($_SERVER['HTTP_USER_AGENT'],'msie');
if($browser!==false)
return array(
array('name'=>'skin','label'=>__('Clock configurable on non-IE browsers only.'),'type'=>'static','values'=>'')
$browser = stripos($_SERVER['HTTP_USER_AGENT'], 'msie');
if ($browser !== false) return array(
array(
'name' => 'skin',
'label' => __('Clock configurable on non-IE browsers only.'),
'type' => 'static',
'values' => ''
)
);
else {
$hide_mapping = array(
array(
'values' => 'single',
'mode' => 'hide',
'fields' => array(
'second_clock_timezone',
'second_clock_label'
)
)
);
else
return array(
array('name'=>'skin','label'=>__('Clock skin'),'type'=>'select','default'=>'swissRail','rule'=>array(array('message'=>__('Field required'), 'type'=>'required')),'values'=>array('swissRail'=>'swissRail','chunkySwiss'=>'chunkySwiss','chunkySwissOnBlack'=>'chunkySwissOnBlack','fancy'=>'fancy','machine'=>'machine','classic'=>'classic','modern'=>'modern','simple'=>'simple','securephp'=>'securephp','Tes2'=>'Tes2','Lev'=>'Lev','Sand'=>'Sand','Sun'=>'Sun','Tor'=>'Tor','Babosa'=>'Babosa','Tumb'=>'Tumb','Stone'=>'Stone','Disc'=>'Disc','flash'=>'flash'))
Libs_QuickFormCommon::autohide_fields('type', $hide_mapping);
return array(
array(
'name' => 'skin',
'label' => __('Clock skin'),
'type' => 'select',
'default' => 'swissRail',
'rule' => array(
array(
'message' => __('Field required'),
'type' => 'required'
)
),
'values' => array(
'swissRail' => 'swissRail',
'chunkySwiss' => 'chunkySwiss',
'chunkySwissOnBlack' => 'chunkySwissOnBlack',
'fancy' => 'fancy',
'machine' => 'machine',
'classic' => 'classic',
'modern' => 'modern',
'simple' => 'simple',
'securephp' => 'securephp',
'Tes2' => 'Tes2',
'Lev' => 'Lev',
'Sand' => 'Sand',
'Sun' => 'Sun',
'Tor' => 'Tor',
'Babosa' => 'Babosa',
'Tumb' => 'Tumb',
'Stone' => 'Stone',
'Disc' => 'Disc',
'flash' => 'flash'
)
),
array(
'name' => 'type',
'label' => __('Type'),
'type' => 'select',
'default' => 'single',
'values' => array(
'single' => __('Single Clock'),
'double' => __('Double Clock')
),
'param' => array(
'id' => 'type'
)
),
array(
'name' => 'second_clock_timezone',
'label' => __('Second clock timezone'),
'type' => 'select',
'default' => '8.0',
'values' => self::get_timezones(),
'param' => array(
'id' => 'second_clock_timezone'
)
),
array(
'name' => 'second_clock_label',
'label' => __('Second clock label'),
'type' => 'text',
'default' => __('Singapore / China'),
'param' => array(
'id' => 'second_clock_label'
)
)
);
}
}
}


+ 22
- 3
modules/Applets/Clock/Clock_0.php View File

@@ -15,7 +15,7 @@ defined("_VALID_ACCESS") || die('Direct access forbidden');

class Applets_Clock extends Module {
public function body($skin, $size=200) {
public function body($skin, $size=200, $conf = []) {
print('<center'.($skin=='chunkySwissOnBlack'?' style="background-color:black; color:white;"':'').'>');
$browser = stripos($_SERVER['HTTP_USER_AGENT'],'msie');
if($browser!==false || $skin=='flash') {
@@ -32,7 +32,23 @@ class Applets_Clock extends Module {
} else {
load_js($this->get_module_dir().'coolclock.js');
eval_js('CoolClock.findAndCreateClocks()');
print('<canvas id="'.$this->get_path().'canvas" class="CoolClock:'.$skin.':'.$size.'"></canvas>');
if ($conf && $conf['type'] == 'double') {
$timezone = $conf['second_clock_timezone'] ?: '0.0';
$label = $conf['second_clock_label'] ?: Applets_ClockCommon::get_timezones()[$timezone];
$offset = $timezone * 60 * 60;
print('<table style="width: 100%"><tr><td style="width: 100px;text-align:center;"><canvas id="' . $this->get_path() . '1_canvas" class="CoolClock:' . $skin . ':' . $size . '"></canvas>');
print('<br>Local Time<br><span class="local_time">' . Base_RegionalSettingsCommon::time2reg(null, false) . '</span></td>');
print('<td style="width: 100px;text-align:center;"><canvas id="' . $this->get_path() . '2_canvas" class="CoolClock:' . $skin . ':' . $size . ':noSeconds:' . $timezone . '"></canvas>');
print('<br>' . $label . '<br>' . gmdate('d F Y', time() + $offset) . '</td></tr></table>');
eval_js('jq(".local_time").html(function() {return jq.datepicker.formatDate("d MM yy", new Date());});');
print('</center>');
return;
}
else
print('<canvas id="' . $this->get_path() . 'canvas" class="CoolClock:' . $skin . ':' . $size . '"></canvas>');
}
print('<BR>'.Base_RegionalSettingsCommon::time2reg(null,false).'</center>');
}
@@ -42,7 +58,10 @@ class Applets_Clock extends Module {
$opts['go'] = true;
$skin = isset($conf['skin'])?$conf['skin']:null;
$opts['go_arguments'] = array($skin);
$this->body($skin,100);
$size = $conf['type'] == 'double'? 60: 100;
$this->body($skin, $size, $conf);
}

}


+ 1
- 1
modules/Base/Dashboard/Dashboard_0.php View File

@@ -474,7 +474,7 @@ class Base_Dashboard extends Module {
if(isset($v['rule']['message']) && isset($v['rule']['type'])) $v['rule'] = array($v['rule']);
}

if (isset($values[$v['name']])) {
if (isset($v['name']) && isset($values[$v['name']])) {
if ($v['type'] == "crits") {
$v['default'] = $values[$v['name']];
} else {


+ 1
- 1
modules/Base/Notify/NotifyCommon_0.php View File

@@ -34,7 +34,7 @@ class Base_NotifyCommon extends ModuleCommon {
load_js('modules/Base/Notify/js/desktop-notify.js');
load_js('modules/Base/Notify/js/main.js');

$disabled_message = __('Notifications disabled or not supported!').'\n'.__('Check your browser settings and allow notifications to use this feature...');
$disabled_message = __('Notifications disabled!')."\n".__('Check your browser settings and allow notifications to use this feature...');
$disabled_message = json_encode($disabled_message);
eval_js_once("Base_Notify.init (".(self::refresh_rate*1000).", $disabled_message);");



+ 302
- 201
modules/Base/Notify/js/desktop-notify.js View File

@@ -1,202 +1,303 @@
/**
* Copyright 2012 Tsvetan Tsvetkov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Author: Tsvetan Tsvetkov (tsekach@gmail.com)
/*! HTML5 Notification - v3.0.0 - 2016-09-19
Copyright 2016 Tsvetan Tsvetkov
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
(function (win) {
/*
Safari native methods required for Notifications do NOT run in strict mode.
*/
//"use strict";
var PERMISSION_DEFAULT = "default",
PERMISSION_GRANTED = "granted",
PERMISSION_DENIED = "denied",
PERMISSION = [PERMISSION_GRANTED, PERMISSION_DEFAULT, PERMISSION_DENIED],
defaultSetting = {
pageVisibility: false,
autoClose: 0
},
empty = {},
emptyString = "",
isSupported = (function () {
var isSupported = false;
/*
* Use try {} catch() {} because the check for IE may throws an exception
* if the code is run on browser that is not Safar/Chrome/IE or
* Firefox with html5notifications plugin.
*
* Also, we canNOT detect if msIsSiteMode method exists, as it is
* a method of host object. In IE check for existing method of host
* object returns undefined. So, we try to run it - if it runs
* successfully - then it is IE9+, if not - an exceptions is thrown.
*/
try {
isSupported = !!(/* Safari, Chrome */win.Notification || /* Chrome & ff-html5notifications plugin */win.webkitNotifications || /* Firefox Mobile */navigator.mozNotification || /* IE9+ */(win.external && win.external.msIsSiteMode() !== undefined));
} catch (e) {}
return isSupported;
}()),
ieVerification = Math.floor((Math.random() * 10) + 1),
isFunction = function (value) { return (value && (value).constructor === Function); },
isString = function (value) {return (value && (value).constructor === String); },
isObject = function (value) {return (value && (value).constructor === Object); },
/**
* Dojo Mixin
*/
mixin = function (target, source) {
var name, s;
for (name in source) {
s = source[name];
if (!(name in target) || (target[name] !== s && (!(name in empty) || empty[name] !== s))) {
target[name] = s;
}
}
return target; // Object
},
noop = function () {},
settings = defaultSetting;
function getNotification(title, options) {
var notification;
if (win.Notification) { /* Safari 6, Chrome (23+) */
notification = new win.Notification(title, {
/* The notification's icon - For Chrome in Windows, Linux & Chrome OS */
icon: isString(options.icon) ? options.icon : options.icon.x32,
/* The notification�s subtitle. */
body: options.body || emptyString,
/*
The notification�s unique identifier.
This prevents duplicate entries from appearing if the user has multiple instances of your website open at once.
*/
tag: options.tag || emptyString
});
} else if (win.webkitNotifications) { /* FF with html5Notifications plugin installed */
notification = win.webkitNotifications.createNotification(options.icon, title, options.body);
notification.show();
} else if (navigator.mozNotification) { /* Firefox Mobile */
notification = navigator.mozNotification.createNotification(title, options.body, options.icon);
notification.show();
} else if (win.external && win.external.msIsSiteMode()) { /* IE9+ */
//Clear any previous notifications
win.external.msSiteModeClearIconOverlay();
win.external.msSiteModeSetIconOverlay((isString(options.icon) ? options.icon : options.icon.x16), title);
win.external.msSiteModeActivate();
notification = {
"ieVerification": ieVerification + 1
};
}
return notification;
}
function getWrapper(notification) {
return {
close: function () {
if (notification) {
if (notification.close) {
//http://code.google.com/p/ff-html5notifications/issues/detail?id=58
notification.close();
}
else if (notification.cancel) {
notification.cancel();
} else if (win.external && win.external.msIsSiteMode()) {
if (notification.ieVerification === ieVerification) {
win.external.msSiteModeClearIconOverlay();
}
}
}
}
};
}
function requestPermission(callback) {
if (!isSupported) { return; }
var callbackFunction = isFunction(callback) ? callback : noop;
if (win.webkitNotifications && win.webkitNotifications.checkPermission) {
/*
* Chrome 23 supports win.Notification.requestPermission, but it
* breaks the browsers, so use the old-webkit-prefixed
* win.webkitNotifications.checkPermission instead.
*
* Firefox with html5notifications plugin supports this method
* for requesting permissions.
*/
win.webkitNotifications.requestPermission(callbackFunction);
} else if (win.Notification && win.Notification.requestPermission) {
win.Notification.requestPermission(callbackFunction);
}
}
function permissionLevel() {
var permission;
if (!isSupported) { return; }
if (win.Notification && win.Notification.permissionLevel) {
//Safari 6
permission = win.Notification.permissionLevel();
} else if (win.webkitNotifications && win.webkitNotifications.checkPermission) {
//Chrome & Firefox with html5-notifications plugin installed
permission = PERMISSION[win.webkitNotifications.checkPermission()];
} else if (win.Notification && win.Notification.permission) {
// Firefox 23+
permission = win.Notification.permission;
} else if (navigator.mozNotification) {
//Firefox Mobile
permission = PERMISSION_GRANTED;
} else if (win.external && (win.external.msIsSiteMode() !== undefined)) { /* keep last */
//IE9+
permission = win.external.msIsSiteMode() ? PERMISSION_GRANTED : PERMISSION_DEFAULT;
}
return permission;
}
/**
*
*/
function config(params) {
if (params && isObject(params)) {
mixin(settings, params);
}
return settings;
}
function createNotification(title, options) {
var notification,
notificationWrapper;
/*
Return undefined if notifications are not supported.
Return undefined if no permissions for displaying notifications.
Title and icons are required. Return undefined if not set.
*/
if (isSupported && isString(title) && (options && (isString(options.icon) || isObject(options.icon))) && (permissionLevel() === PERMISSION_GRANTED)) {
notification = getNotification(title, options);
}
notificationWrapper = getWrapper(notification);
//Auto-close notification
if (settings.autoClose && notification && !notification.ieVerification && notification.addEventListener) {
notification.addEventListener("show", function () {
var notification = notificationWrapper;
win.setTimeout(function () {
notification.close();
}, settings.autoClose);
});
}
return notificationWrapper;
}
win.notify = {
PERMISSION_DEFAULT: PERMISSION_DEFAULT,
PERMISSION_GRANTED: PERMISSION_GRANTED,
PERMISSION_DENIED: PERMISSION_DENIED,
isSupported: isSupported,
config: config,
createNotification: createNotification,
permissionLevel: permissionLevel,
requestPermission: requestPermission
};
if (isFunction(Object.seal)) {
Object.seal(win.notify);
}
}(window));

/** @namespace window */
/** @namespace window.webkitNotifications */
/** @namespace window.external */
(function() {
/*
Safari native methods required for Notifications do NOT run in strict mode.
*/
//'use strict';
// local variables
var PERMISSION_DEFAULT = "default";
// The user decision is unknown; in this case the application will act as if permission was denied.
var PERMISSION_GRANTED = "granted";
// The user has explicitly granted permission for the current origin to display system notifications.
var PERMISSION_DENIED = "denied";
// The user has explicitly denied permission for the current origin to display system notifications.
var PERMISSION_NOTSUPPORTED = "notsupported";
// The Notification API is not supported on current environment
// map for the old permission values
var PERMISSIONS = [ PERMISSION_GRANTED, PERMISSION_DEFAULT, PERMISSION_DENIED, PERMISSION_NOTSUPPORTED ];
var DIRESCTIONS = [ "auto", "ltr", "rtl" ];
/*
IE does not support Notifications in the same meaning as other modern browsers.
On the other side, IE9+(except MS Edge) implement flashing pinned site taskbar buttons.
Each time new IE Notification is create, previous flashing and icon overlay is cleared.
So, we need to keep track of the notification that calls close method.
*/
var IENotificationIndex = -1;
var IECloseNotificationEvents = [ "click", "scroll", "focus" ];
var getIco = function(icon) {
var lastIndex = icon.lastIndexOf(".");
return (lastIndex !== -1 ? icon.substr(0, lastIndex) : icon) + ".ico";
};
/*
* Internal Notificaiton constructor. Keeps the original Notification
* constructor if any or use empty function constructor for browsers
* that do not support Notifications
*/
var _Notification = window.Notification || /* Opera Mobile/Android Browser */
window.webkitNotifications && WebKitNotification || /* IE9+ pinned site */
"external" in window && "msIsSiteMode" in window.external && window.external.msIsSiteMode() !== undefined && IENotification || /* Notifications Not supported. Return dummy constructor */
DummyNotification;
/**
* @constructor DummyNotification
*/
function DummyNotification() {
var dummyElement = document.createElement("div");
this.addEventListener = function(eventName, callback) {
dummyElement.addEventListener(eventName, callback.bind(this));
};
this.removeEventListener = function(eventName, callback) {
dummyElement.removeEventListener(eventName, callback.bind(this));
};
this.dispatchEvent = function(eventName) {
if (typeof eventName !== "string") {
return;
}
try {
dummyElement.dispatchEvent(new Event(eventName));
} catch (e) {
var event = document.createEvent("Event");
event.initEvent(eventName, false, true);
dummyElement.dispatchEvent(event);
}
};
}
Object.defineProperty(DummyNotification, "permission", {
enumerable: true,
get: function() {
return PERMISSION_NOTSUPPORTED;
}
});
Object.defineProperty(DummyNotification, "requestPermission", {
enumerable: true,
writable: true,
value: function(callback) {
callback(this.permission);
}
});
/**
* @constructor IENotification
*/
function IENotification(title, options) {
DummyNotification.call(this);
var notificationIndex = IENotificationIndex;
Object.defineProperties(this, {
close: {
value: function(event) {
if (notificationIndex === IENotificationIndex) {
window.external.msSiteModeClearIconOverlay();
// Remove close events
IECloseNotificationEvents.forEach(function(event) {
window.removeEventListener(event, this.close);
}.bind(this));
this.dispatchEvent("click");
this.dispatchEvent("close");
notificationIndex = null;
}
}.bind(this)
}
});
// Clear any previous icon overlay
this.close();
// Set icon
if (this.icon) {
window.external.msSiteModeSetIconOverlay(getIco(this.icon), this.description || this.title);
}
// Blink icon
window.external.msSiteModeActivate();
// Trigger show event
this.dispatchEvent("show");
// Attach close event to window
IECloseNotificationEvents.forEach(function(event) {
window.addEventListener(event, this.close);
}.bind(this));
// Increment notification index
notificationIndex = ++IENotificationIndex;
}
Object.defineProperty(IENotification, "permission", {
enumerable: true,
get: function() {
var isTabPinned = window.external.msIsSiteMode();
return isTabPinned ? PERMISSION_GRANTED : PERMISSION_DENIED;
}
});
Object.defineProperty(IENotification, "requestPermission", {
enumerable: true,
writable: true,
value: function(callback) {
return new Promise(function(resolve, reject) {
if (this.permission === PERMISSION_DENIED) {
alert(this.PERMISSION_REQUEST_MESSAGE);
}
resolve(this.permission);
}.bind(this));
}
});
Object.defineProperty(IENotification, "PERMISSION_REQUEST_MESSAGE", {
writable: true,
value: "IE supports notifications in pinned mode only. Pin this page on your taskbar to receive notifications."
});
/**
* @constructor WebKitNotification
*/
function WebKitNotification() {}
Object.defineProperty(WebKitNotification, "permission", {
enumerable: true,
get: function() {
return PERMISSIONS[window.webkitNotifications.checkPermission()];
}
});
Object.defineProperty(WebKitNotification, "requestPermission", {
enumerable: true,
writable: true,
value: function(callback) {
return new Promise(function(resolve, reject) {
window.webkitNotifications.requestPermission(function(permission) {
resolve(permission);
});
});
}
});
/*
[Safari] Safari6 do not support Notification.permission.
Instead, it support Notification.permissionLevel()
*/
if (!_Notification.permission) {
Object.defineProperty(_Notification, "permission", {
enumerable: true,
get: function() {
return _Notification.permissionLevel && _Notification.permissionLevel();
}
});
}
/**
* @constructor Notification
*/
function Notification(title, options) {
var dir;
var notification;
if (!arguments.length) {
throw TypeError('Failed to construct "Notification": 1 argument required, but only 0 present.');
}
/*
Chrome display notifications when title is empty screen, but
Safari do NOT.
Set title to non-display characted in order to display notifications
in Safari as well when title is empty.
*/
if (title === "") {
title = "\b";
}
if (arguments.length > 1 && "object" !== typeof options) {
throw TypeError('Failed to construct "Notification": parameter 2 ("options") is not an object.');
}
dir = Object(options).dir;
if (dir !== undefined && DIRESCTIONS.indexOf(dir) === -1) {
throw TypeError('Failed to construct "Notification": The provided value "' + dir + '" is not a valid enum value of type NotificationDirection.');
}
options = Object(options);
notification = new _Notification(title, options);
/* TODO: actions property */
/* TODO: badge property */
if (!notification.body) {
Object.defineProperty(notification, "body", {
value: String(options.body || "")
});
}
if (!notification.data) {
Object.defineProperty(notification, "data", {
value: options.data || null
});
}
if (!notification.dir) {
Object.defineProperty(notification, "dir", {
value: dir || DIRESCTIONS[0]
});
}
if (!notification.icon) {
Object.defineProperty(notification, "icon", {
value: String(options.icon || "")
});
}
if (!notification.lang) {
Object.defineProperty(notification, "lang", {
value: String(options.lang || "")
});
}
/* TODO: noscreen property */
/* TODO: renotify property */
if (!notification.requireInteraction) {
Object.defineProperty(notification, "requireInteraction", {
value: Boolean(options.requireInteraction)
});
}
/* TODO: sound property */
if (!notification.silent) {
Object.defineProperty(notification, "silent", {
value: Boolean(options.silent)
});
}
if (!notification.tag) {
Object.defineProperty(notification, "tag", {
value: String(options.tag || "")
});
}
if (!notification.title) {
Object.defineProperty(notification, "title", {
value: String(title)
});
}
if (!notification.timestamp) {
Object.defineProperty(notification, "timestamp", {
value: new Date().getTime()
});
}
/* TODO: vibrate property */
return notification;
}
Object.defineProperty(Notification, "permission", {
enumerable: true,
get: function() {
return _Notification.permission;
}
});
/*
Notification.requestPermission should return a Promise(by spec).
Keep the original method and replace it with a custom one that
checks if the call of Notification.requestPermission returns a promise
and if not, then return a custom object that simulates the Promise object.
Specification:
Notification.requestPermission().then(callback);
Old Spec:
Notification.requestPermission(callback);
*/
Object.defineProperty(Notification, "requestPermission", {
enumerable: true,
value: function() {
return new Promise(function(resolve, reject) {
var promise = _Notification.requestPermission(function(permission) {
resolve(permission);
});
if (!(promise instanceof Promise)) {
return;
}
resolve(promise);
});
}
});
window.Notification = Notification;
})();

+ 27
- 27
modules/Base/Notify/js/main.js View File

@@ -21,11 +21,11 @@ var Base_Notify = {
refresh: function () {
if (!this.is_active()) return;

if(this.working) return;
this.working = 1;
if(Base_Notify.working) return;
Base_Notify.working = 1;

jq.getJSON('modules/Base/Notify/refresh.php', function(json){
this.working = 0;
Base_Notify.working = 0;

if (typeof json === 'undefined' || jq.isEmptyObject(json)) return;
if (typeof json.disable !== 'undefined') {
@@ -37,47 +37,47 @@ var Base_Notify = {
jq.each(json.messages, function(i, m) {
setTimeout(function(){
if (typeof m.timeout !== 'undefined') notify.config({pageVisibility: false, autoClose: m.timeout});
Base_Notify.notify(m.title, m.opts);
Base_Notify.notify(m.title, m.opts, m.timeout);
}, i*500);
});
});
},
notify: function (title, opts) {
notify: function (title, opts, timeout) {
if (!this.is_active(true)) return;
if (notify.permissionLevel() === notify.PERMISSION_DEFAULT) {
notify.requestPermission(function (permission) {
if (permission === notify.PERMISSION_GRANTED) {
var n = notify.createNotification(title, opts);
}
var n;
if (Notification.permission === 'default') {
Notification.requestPermission().then(function (permission) {
Base_Notify.notify(title, opts, timeout);
});
}
else if (notify.permissionLevel() === notify.PERMISSION_GRANTED) {
var n = notify.createNotification(title, opts);
else if (Notification.permission === 'granted') {
n = new Notification(title, opts);
}

if (n && jq.isNumeric(timeout) && timeout > 5000) {
setInterval(n.close.bind(n), timeout);
}
},
is_active: function (alert) {
is_active: function (show_alert) {
if (this.disabled) return false;

if (Notification.permission === 'granted' || Notification.permission === 'default') return true;
if (!this.is_supported(alert)) {
this.disable();
return false;
if (show_alert) {
var message = this.disabled_message
if (Notification.permission === 'notsupported') {
message = 'Notifications not supported';
}
alert(message);
}
return true;
return false;
},
is_supported: function (alert) {
supported = notify.isSupported && (notify.permissionLevel() !== notify.PERMISSION_DENIED);
if (!supported && alert) alert(this.disabled_message);
return supported;
},

disable: function () {
clearInterval(this.interval);
this.interval = 0;


+ 3
- 0
modules/Base/Notify/refresh.php View File

@@ -14,6 +14,7 @@ define('READ_ONLY_SESSION', true);
require_once('../../../include.php');
ModuleManager::load_modules();

ob_start();
$token = Base_NotifyCommon::get_session_token(); // will check is user logged

if ($token === false) {
@@ -72,6 +73,8 @@ foreach ($notifications as $module => $module_new_notifications) {

Base_NotifyCommon::set_notified_cache($notified_cache, $token, $all_notified ? $refresh_time : Base_NotifyCommon::get_last_refresh($token));

ob_end_clean();

if (count($ret)) {
echo json_encode(array('messages' => $ret));
}


+ 6
- 2
modules/Libs/TCPDF/TCPDFCommon_0.php View File

@@ -16,7 +16,8 @@
*/
defined("_VALID_ACCESS") || die('Direct access forbidden');

define('TCPDF_DIR', 'modules/Libs/TCPDF/tcpdf5.9/');
define('TCPDF_DIR', 'vendor/tecnickcom/tcpdf/');
require_once 'vendor/tecnickcom/tcpdf/vendor/autoload.php';

class Libs_TCPDFCommon extends ModuleCommon {
public static $default_font = 'dejavusanscondensed';//'Helvetica';
@@ -61,7 +62,10 @@ class Libs_TCPDFCommon extends ModuleCommon {

public static function new_pdf($orientation='P',$unit='mm',$format=null) {
ini_set('memory_limit', '512M');
require_once(TCPDF_DIR.'tcpdf.php');

define('K_TCPDF_EXTERNAL_CONFIG', true);
require_once(self::Instance()->get_module_dir() . 'tcpdf_config.php');

self::$default_font = self::get_pdf_font();
if ($format===null) $format = Base_User_SettingsCommon::get(Libs_TCPDF::module_name(),'page_format');


+ 5
- 0
modules/Libs/TCPDF/composer.json View File

@@ -0,0 +1,5 @@
{
"require": {
"tecnickcom/tcpdf": "^6.2"
}
}

+ 81
- 0
modules/Libs/TCPDF/composer.lock View File

@@ -0,0 +1,81 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "a9cb749426bc571c6ce7585ddb2d9eac",
"content-hash": "ff887fa70b38934eeb1c3e344a583056",
"packages": [
{
"name": "tecnickcom/tcpdf",
"version": "6.2.17",
"source": {
"type": "git",
"url": "https://github.com/tecnickcom/TCPDF.git",
"reference": "64fc19439863e1b1314487a72a74d9bfd0b55a53"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/64fc19439863e1b1314487a72a74d9bfd0b55a53",
"reference": "64fc19439863e1b1314487a72a74d9bfd0b55a53",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"autoload": {
"classmap": [
"config",
"include",
"tcpdf.php",
"tcpdf_parser.php",
"tcpdf_import.php",
"tcpdf_barcodes_1d.php",
"tcpdf_barcodes_2d.php",
"include/tcpdf_colors.php",
"include/tcpdf_filters.php",
"include/tcpdf_font_data.php",
"include/tcpdf_fonts.php",
"include/tcpdf_images.php",
"include/tcpdf_static.php",
"include/barcodes/datamatrix.php",
"include/barcodes/pdf417.php",
"include/barcodes/qrcode.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0"
],
"authors": [
{
"name": "Nicola Asuni",
"email": "info@tecnick.com",
"role": "lead"
}
],
"description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
"homepage": "http://www.tcpdf.org/",
"keywords": [
"PDFD32000-2008",
"TCPDF",
"barcodes",
"datamatrix",
"pdf",
"pdf417",
"qrcode"
],
"time": "2018-02-24 11:48:20"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}

+ 0
- 332
modules/Libs/TCPDF/tcpdf5.9/2dbarcodes.php View File

@@ -1,332 +0,0 @@
<?php
//============================================================+
// File name : 2dbarcodes.php
// Version : 1.0.014
// Begin : 2009-04-07
// Last Update : 2012-04-30
// Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - info@tecnick.com
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
// Copyright (C) 2009-2012 Nicola Asuni - Tecnick.com LTD
//
// This file is part of TCPDF software library.
//
// TCPDF is free software: you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// TCPDF 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
//
// See LICENSE.TXT file for more information.
// -------------------------------------------------------------------
//
// Description : PHP class to creates array representations for
// 2D barcodes to be used with TCPDF.
//
//============================================================+

/**
* @file
* PHP class to creates array representations for 2D barcodes to be used with TCPDF.
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.014
*/

/**
* @class TCPDF2DBarcode
* PHP class to creates array representations for 2D barcodes to be used with TCPDF (http://www.tcpdf.org).
* @package com.tecnick.tcpdf
* @version 1.0.014
* @author Nicola Asuni
*/
class TCPDF2DBarcode {

/**
* Array representation of barcode.
* @protected
*/
protected $barcode_array = false;

/**
* This is the class constructor.
* Return an array representations for 2D barcodes:<ul>
* <li>$arrcode['code'] code to be printed on text label</li>
* <li>$arrcode['num_rows'] required number of rows</li>
* <li>$arrcode['num_cols'] required number of columns</li>
* <li>$arrcode['bcode'][$r][$c] value of the cell is $r row and $c column (0 = transparent, 1 = black)</li></ul>
* @param $code (string) code to print
* @param $type (string) type of barcode: <ul><li>DATAMATRIX : Datamatrix (ISO/IEC 16022)</li><li>PDF417 : PDF417 (ISO/IEC 15438:2006)</li><li>PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6 : PDF417 with parameters: a = aspect ratio (width/height); e = error correction level (0-8); t = total number of macro segments; s = macro segment index (0-99998); f = file ID; o0 = File Name (text); o1 = Segment Count (numeric); o2 = Time Stamp (numeric); o3 = Sender (text); o4 = Addressee (text); o5 = File Size (numeric); o6 = Checksum (numeric). NOTES: Parameters t, s and f are required for a Macro Control Block, all other parametrs are optional. To use a comma character ',' on text options, replace it with the character 255: "\xff".</li><li>QRCODE : QRcode Low error correction</li><li>QRCODE,L : QRcode Low error correction</li><li>QRCODE,M : QRcode Medium error correction</li><li>QRCODE,Q : QRcode Better error correction</li><li>QRCODE,H : QR-CODE Best error correction</li><li>RAW: raw mode - comma-separad list of array rows</li><li>RAW2: raw mode - array rows are surrounded by square parenthesis.</li><li>TEST : Test matrix</li></ul>
*/
public function __construct($code, $type) {
$this->setBarcode($code, $type);
}

/**
* Return an array representations of barcode.
* @return array
*/
public function getBarcodeArray() {
return $this->barcode_array;
}

/**
* Send barcode as SVG image object to the standard output.
* @param $w (int) Width of a single rectangle element in user units.
* @param $h (int) Height of a single rectangle element in user units.
* @param $color (string) Foreground color (in SVG format) for bar elements (background is transparent).
* @public
*/
public function getBarcodeSVG($w=3, $h=3, $color='black') {
// send headers
$code = $this->getBarcodeSVGcode($w, $h, $color);
header('Content-Type: application/svg+xml');
header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1
header('Pragma: public');
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Content-Disposition: inline; filename="'.md5($code).'.svg";');
//header('Content-Length: '.strlen($code));
echo $code;
}

/**
* Return a SVG string representation of barcode.
* @param $w (int) Width of a single rectangle element in user units.
* @param $h (int) Height of a single rectangle element in user units.
* @param $color (string) Foreground color (in SVG format) for bar elements (background is transparent).
* @return string SVG code.
* @public
*/
public function getBarcodeSVGcode($w=3, $h=3, $color='black') {
// replace table for special characters
$repstr = array("\0" => '', '&' => '&amp;', '<' => '&lt;', '>' => '&gt;');
$svg = '<'.'?'.'xml version="1.0" standalone="no"'.'?'.'>'."\n";
$svg .= '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">'."\n";
$svg .= '<svg width="'.round(($this->barcode_array['num_cols'] * $w), 3).'" height="'.round(($this->barcode_array['num_rows'] * $h), 3).'" version="1.1" xmlns="http://www.w3.org/2000/svg">'."\n";
$svg .= "\t".'<desc>'.strtr($this->barcode_array['code'], $repstr).'</desc>'."\n";
$svg .= "\t".'<g id="elements" fill="'.$color.'" stroke="none">'."\n";
// print barcode elements
$y = 0;
// for each row
for ($r = 0; $r < $this->barcode_array['num_rows']; ++$r) {
$x = 0;
// for each column
for ($c = 0; $c < $this->barcode_array['num_cols']; ++$c) {
if ($this->barcode_array['bcode'][$r][$c] == 1) {
// draw a single barcode cell
$svg .= "\t\t".'<rect x="'.$x.'" y="'.$y.'" width="'.$w.'" height="'.$h.'" />'."\n";
}
$x += $w;
}
$y += $h;
}
$svg .= "\t".'</g>'."\n";
$svg .= '</svg>'."\n";
return $svg;
}

/**
* Return an HTML representation of barcode.
* @param $w (int) Width of a single rectangle element in pixels.
* @param $h (int) Height of a single rectangle element in pixels.
* @param $color (string) Foreground color for bar elements (background is transparent).
* @return string HTML code.
* @public
*/
public function getBarcodeHTML($w=10, $h=10, $color='black') {
$html = '<div style="font-size:0;position:relative;width:'.($w * $this->barcode_array['num_cols']).'px;height:'.($h * $this->barcode_array['num_rows']).'px;">'."\n";
// print barcode elements
$y = 0;
// for each row
for ($r = 0; $r < $this->barcode_array['num_rows']; ++$r) {
$x = 0;
// for each column
for ($c = 0; $c < $this->barcode_array['num_cols']; ++$c) {
if ($this->barcode_array['bcode'][$r][$c] == 1) {
// draw a single barcode cell
$html .= '<div style="background-color:'.$color.';width:'.$w.'px;height:'.$h.'px;position:absolute;left:'.$x.'px;top:'.$y.'px;">&nbsp;</div>'."\n";
}
$x += $w;
}
$y += $h;
}
$html .= '</div>'."\n";
return $html;
}

/**
* Return a PNG image representation of barcode (requires GD or Imagick library).
* @param $w (int) Width of a single rectangle element in pixels.
* @param $h (int) Height of a single rectangle element in pixels.
* @param $color (array) RGB (0-255) foreground color for bar elements (background is transparent).
* @return image or false in case of error.
* @public
*/
public function getBarcodePNG($w=3, $h=3, $color=array(0,0,0)) {
// calculate image size
$width = ($this->barcode_array['num_cols'] * $w);
$height = ($this->barcode_array['num_rows'] * $h);
if (function_exists('imagecreate')) {
// GD library
$imagick = false;
$png = imagecreate($width, $height);
$bgcol = imagecolorallocate($png, 255, 255, 255);
imagecolortransparent($png, $bgcol);
$fgcol = imagecolorallocate($png, $color[0], $color[1], $color[2]);
} elseif (extension_loaded('imagick')) {
$imagick = true;
$bgcol = new imagickpixel('rgb(255,255,255');
$fgcol = new imagickpixel('rgb('.$color[0].','.$color[1].','.$color[2].')');
$png = new Imagick();
$png->newImage($width, $height, 'none', 'png');
$bar = new imagickdraw();
$bar->setfillcolor($fgcol);
} else {
return false;
}
// print barcode elements
$y = 0;
// for each row
for ($r = 0; $r < $this->barcode_array['num_rows']; ++$r) {
$x = 0;
// for each column
for ($c = 0; $c < $this->barcode_array['num_cols']; ++$c) {
if ($this->barcode_array['bcode'][$r][$c] == 1) {
// draw a single barcode cell
if ($imagick) {
$bar->rectangle($x, $y, ($x + $w - 1), ($y + $h - 1));
} else {
imagefilledrectangle($png, $x, $y, ($x + $w - 1), ($y + $h - 1), $fgcol);
}
}
$x += $w;
}
$y += $h;
}
// send headers
header('Content-Type: image/png');
header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1
header('Pragma: public');
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
if ($imagick) {
$png->drawimage($bar);
echo $png;
} else {
imagepng($png);
imagedestroy($png);
}
}

/**
* Set the barcode.
* @param $code (string) code to print
* @param $type (string) type of barcode: <ul><li>DATAMATRIX : Datamatrix (ISO/IEC 16022)</li><li>PDF417 : PDF417 (ISO/IEC 15438:2006)</li><li>PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6 : PDF417 with parameters: a = aspect ratio (width/height); e = error correction level (0-8); t = total number of macro segments; s = macro segment index (0-99998); f = file ID; o0 = File Name (text); o1 = Segment Count (numeric); o2 = Time Stamp (numeric); o3 = Sender (text); o4 = Addressee (text); o5 = File Size (numeric); o6 = Checksum (numeric). NOTES: Parameters t, s and f are required for a Macro Control Block, all other parametrs are optional. To use a comma character ',' on text options, replace it with the character 255: "\xff".</li><li>QRCODE : QRcode Low error correction</li><li>QRCODE,L : QRcode Low error correction</li><li>QRCODE,M : QRcode Medium error correction</li><li>QRCODE,Q : QRcode Better error correction</li><li>QRCODE,H : QR-CODE Best error correction</li><li>RAW: raw mode - comma-separad list of array rows</li><li>RAW2: raw mode - array rows are surrounded by square parenthesis.</li><li>TEST : Test matrix</li></ul>
* @return array
*/
public function setBarcode($code, $type) {
$mode = explode(',', $type);
$qrtype = strtoupper($mode[0]);
switch ($qrtype) {
case 'DATAMATRIX': { // DATAMATRIX (ISO/IEC 16022)
require_once(dirname(__FILE__).'/datamatrix.php');
$qrcode = new Datamatrix($code);
$this->barcode_array = $qrcode->getBarcodeArray();
$this->barcode_array['code'] = $code;
break;
}
case 'PDF417': { // PDF417 (ISO/IEC 15438:2006)
require_once(dirname(__FILE__).'/pdf417.php');
if (!isset($mode[1]) OR ($mode[1] === '')) {
$aspectratio = 2; // default aspect ratio (width / height)
} else {
$aspectratio = floatval($mode[1]);
}
if (!isset($mode[2]) OR ($mode[2] === '')) {
$ecl = -1; // default error correction level (auto)
} else {
$ecl = intval($mode[2]);
}
// set macro block
$macro = array();
if (isset($mode[3]) AND ($mode[3] !== '') AND isset($mode[4]) AND ($mode[4] !== '') AND isset($mode[5]) AND ($mode[5] !== '')) {
$macro['segment_total'] = intval($mode[3]);
$macro['segment_index'] = intval($mode[4]);
$macro['file_id'] = strtr($mode[5], "\xff", ',');
for ($i = 0; $i < 7; ++$i) {
$o = $i + 6;
if (isset($mode[$o]) AND ($mode[$o] !== '')) {
// add option
$macro['option_'.$i] = strtr($mode[$o], "\xff", ',');
}
}
}
$qrcode = new PDF417($code, $ecl, $aspectratio, $macro);
$this->barcode_array = $qrcode->getBarcodeArray();
$this->barcode_array['code'] = $code;
break;
}
case 'QRCODE': { // QR-CODE
require_once(dirname(__FILE__).'/qrcode.php');
if (!isset($mode[1]) OR (!in_array($mode[1],array('L','M','Q','H')))) {
$mode[1] = 'L'; // Ddefault: Low error correction
}
$qrcode = new QRcode($code, strtoupper($mode[1]));
$this->barcode_array = $qrcode->getBarcodeArray();
$this->barcode_array['code'] = $code;
break;
}
case 'RAW':
case 'RAW2': { // RAW MODE
// remove spaces
$code = preg_replace('/[\s]*/si', '', $code);
if (strlen($code) < 3) {
break;
}
if ($qrtype == 'RAW') {
// comma-separated rows
$rows = explode(',', $code);
} else { // RAW2
// rows enclosed in square parentheses
$code = substr($code, 1, -1);
$rows = explode('][', $code);
}
$this->barcode_array['num_rows'] = count($rows);
$this->barcode_array['num_cols'] = strlen($rows[0]);
$this->barcode_array['bcode'] = array();
foreach ($rows as $r) {
$this->barcode_array['bcode'][] = str_split($r, 1);
}
$this->barcode_array['code'] = $code;
break;
}
case 'TEST': { // TEST MODE
$this->barcode_array['num_rows'] = 5;
$this->barcode_array['num_cols'] = 15;
$this->barcode_array['bcode'] = array(
array(1,1,1,0,1,1,1,0,1,1,1,0,1,1,1),
array(0,1,0,0,1,0,0,0,1,0,0,0,0,1,0),
array(0,1,0,0,1,1,0,0,1,1,1,0,0,1,0),
array(0,1,0,0,1,0,0,0,0,0,1,0,0,1,0),
array(0,1,0,0,1,1,1,0,1,1,1,0,0,1,0));
$this->barcode_array['code'] = $code;
break;
}
default: {
$this->barcode_array = false;
}
}
}
} // end of class

//============================================================+
// END OF FILE
//============================================================+

+ 0
- 2405
modules/Libs/TCPDF/tcpdf5.9/CHANGELOG.TXT
File diff suppressed because it is too large
View File


+ 0
- 858
modules/Libs/TCPDF/tcpdf5.9/LICENSE.TXT View File

@@ -1,858 +0,0 @@
**********************************************************************
* TCPDF LICENSE
**********************************************************************

TCPDF is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

**********************************************************************
**********************************************************************

GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.


This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.

0. Additional Definitions.

As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.

"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.

An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.

A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".

The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.

The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.

1. Exception to Section 3 of the GNU GPL.

You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.

2. Conveying Modified Versions.

If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:

a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or

b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.

3. Object Code Incorporating Material from Library Header Files.

The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:

a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.

b) Accompany the object code with a copy of the GNU GPL and this license
document.

4. Combined Works.

You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:

a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.

b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.

c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.

d) Do one of the following:

0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.

1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.

e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)

5. Combined Libraries.

You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:

a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.

b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.

6. Revised Versions of the GNU Lesser General Public License.

The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.

Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.

If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

**********************************************************************
**********************************************************************

GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Preamble

The GNU General Public License is a free, copyleft license for
software and other kinds of works.

The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.