Skip to content

Commit

Permalink
v1.6.00
Browse files Browse the repository at this point in the history
  • Loading branch information
SKuipers committed Feb 1, 2022
1 parent f6cc526 commit f003a1c
Show file tree
Hide file tree
Showing 24 changed files with 59 additions and 2,228 deletions.
5 changes: 5 additions & 0 deletions Data Admin/CHANGEDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,8 @@
$sql[$count][0]="1.5.01" ;
$sql[$count][1]="";

//v1.6.00
$count++;
$sql[$count][0]="1.6.00" ;
$sql[$count][1]="";

4 changes: 4 additions & 0 deletions Data Admin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
CHANGELOG
=========

## [1.6.00] 2022-02-01
### Fixed
- Fixed deprecated functions for v23 compatibility. Not backwards compatible.

## [1.5.01] 2021-09-30
### Fixed
- Removed PHPExcel class, fixed Combine Similar Fields layout
Expand Down
5 changes: 3 additions & 2 deletions Data Admin/export_run.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

use Gibbon\Data\ImportType;
use Gibbon\Domain\System\SettingGateway;

// Increase max execution time, as this stuff gets big
ini_set('max_execution_time', 7200);
Expand Down Expand Up @@ -45,7 +46,7 @@
$type = (isset($_GET['type']))? $_GET['type'] : '';
$importType = ImportType::loadImportType($type, $pdo);

$checkUserPermissions = getSettingByScope($connection2, 'Data Admin', 'enableUserLevelPermissions');
$checkUserPermissions = $container->get(SettingGateway::class)->getSettingByScope('Data Admin', 'enableUserLevelPermissions');

if ($checkUserPermissions == 'Y' && $importType->isImportAccessible($guid, $connection2) == false) {
echo "<div class='error'>" ;
Expand Down Expand Up @@ -236,7 +237,7 @@

$filename = ($dataExport) ? 'DataExport'.'-'.$type : 'DataStructure'.'-'.$type;

$exportFileType = getSettingByScope($connection2, 'Data Admin', 'exportDefaultFileType');
$exportFileType = $container->get(SettingGateway::class)->getSettingByScope('Data Admin', 'exportDefaultFileType');
if (empty($exportFileType)) {
$exportFileType = 'Excel2007';
}
Expand Down
2 changes: 1 addition & 1 deletion Data Admin/imports/usersBasic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ table:
name: "Username"
desc: "User account name & login"
args: {filter: nospaces, required: true}
password:
passwordStrong:
name: "Password"
desc: "At least one lowercase and one number, from 8 to 20 chars"
args: {filter: nospaces, required: true, custom: true, function: generatePassword}
Expand Down
2 changes: 1 addition & 1 deletion Data Admin/imports/usersFull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ table:
name: "Username"
desc: "User account name & login"
args: {filter: nospaces, required: true}
password:
passwordStrong:
name: "Password"
desc: "At least one lowercase and one number, from 8 to 20 chars"
args: {filter: nospaces, required: true, custom: true, function: generatePassword}
Expand Down
2 changes: 1 addition & 1 deletion Data Admin/imports/usersParents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ table:
name: "Username"
desc: "User account name & login"
args: {filter: nospaces, required: true}
password:
passwordStrong:
name: "Password"
desc: "At least one lowercase and one number, from 8 to 20 chars"
args: {filter: nospaces, required: true, custom: true, function: generatePassword}
Expand Down
2 changes: 1 addition & 1 deletion Data Admin/imports/usersPasswords.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ table:
name: "Username"
desc: "User account name & login"
args: {filter: nospaces, required: true}
password:
passwordStrong:
name: "Password"
desc: "At least one lowercase and one number, from 8 to 20 chars"
args: {filter: nospaces, required: true, custom: true, function: generatePassword}
Expand Down
2 changes: 1 addition & 1 deletion Data Admin/imports/usersStaff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ table:
name: "Username"
desc: "User account name & login"
args: {filter: nospaces, required: true}
password:
passwordStrong:
name: "Password"
desc: "At least one lowercase and one number, from 8 to 20 chars"
args: {filter: nospaces, required: true, custom: true, function: generatePassword}
Expand Down
2 changes: 1 addition & 1 deletion Data Admin/manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
$entryURL="import_manage.php" ; //The landing page for the unit, used in the main menu
$type="Additional" ; //Do not change.
$category="Admin" ; //The main menu area to place the module in
$version="1.5.01" ; //Version number
$version="1.6.00" ; //Version number
$author="Sandra Kuipers" ; //Your name
$url="https://github.com/SKuipers/" ; //Your URL

Expand Down
3 changes: 2 additions & 1 deletion Data Admin/records_duplicates.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

use Gibbon\Data\ImportType;
use Gibbon\Module\DataAdmin\DatabaseTools;
use Gibbon\Domain\System\SettingGateway;

// Module Bootstrap
require __DIR__ . '/module.php';
Expand Down Expand Up @@ -88,7 +89,7 @@
echo "</th>" ;
echo "</tr>" ;

$checkUserPermissions = getSettingByScope($connection2, 'Data Admin', 'enableUserLevelPermissions');
$checkUserPermissions = $container->get(SettingGateway::class)->getSettingByScope('Data Admin', 'enableUserLevelPermissions');
$isImportAccessible = ($checkUserPermissions == 'Y' && $importType->isImportAccessible($guid, $connection2) != false);

foreach ($duplicateRecords as $row) {
Expand Down
8 changes: 5 additions & 3 deletions Data Admin/records_manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

use Gibbon\Data\ImportType;
use Gibbon\Module\DataAdmin\DatabaseTools;
use Gibbon\Domain\System\SettingGateway;

// Module Bootstrap
require __DIR__ . '/module.php';
Expand All @@ -36,10 +37,11 @@
echo __('The following Gibbon tables can be exported to Excel. The full table export is still a beta feature, at this time it should not be relied upon as a backup method. <strong>Note:</strong> This list does not represent the entire Gibbon database, only tables with an existing import/export structure.', 'Data Admin');
echo "</div>" ;

$databaseTools = new DatabaseTools($gibbon->session, $pdo);
$databaseTools = new DatabaseTools($session, $pdo);

// Get a list of available import options
$importTypeList = ImportType::loadImportTypeList($pdo, false);
$settingGateway = $container->get(SettingGateway::class);
$importTypeList = ImportType::loadImportTypeList($settingGateway, $pdo, false);


// Get the unique tables used
Expand All @@ -57,7 +59,7 @@
echo __("There are no records to display.") ;
echo "</div>" ;
} else {
$checkUserPermissions = getSettingByScope($connection2, 'Data Admin', 'enableUserLevelPermissions');
$checkUserPermissions = $settingGateway->getSettingByScope('Data Admin', 'enableUserLevelPermissions');

$grouping = '';
foreach ($importTables as $importType) {
Expand Down
3 changes: 2 additions & 1 deletion Data Admin/records_orphaned.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

use Gibbon\Data\ImportType;
use Gibbon\Module\DataAdmin\DatabaseTools;
use Gibbon\Domain\System\SettingGateway;

// Module Bootstrap
require __DIR__ . '/module.php';
Expand Down Expand Up @@ -84,7 +85,7 @@
echo "</th>" ;
echo "</tr>" ;

$checkUserPermissions = getSettingByScope($connection2, 'Data Admin', 'enableUserLevelPermissions');
$checkUserPermissions = $container->get(SettingGateway::class)->getSettingByScope('Data Admin', 'enableUserLevelPermissions');
$isImportAccessible = ($checkUserPermissions == 'Y' && $importType->isImportAccessible($guid, $connection2) != false);

foreach ($orphanedRecords as $row) {
Expand Down
11 changes: 7 additions & 4 deletions Data Admin/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

use Gibbon\Forms\Form;
use Gibbon\Domain\System\SettingGateway;

// Module Bootstrap
require __DIR__ . '/module.php';
Expand All @@ -37,6 +38,8 @@
$trueIcon = "<img title='" . __('Yes'). "' src='./themes/" . $session->get('gibbonThemeName') . "/img/iconTick.png' width=16 height=16 />";
$falseIcon = "<img title='" . __('No'). "' src='./themes/" . $session->get('gibbonThemeName') . "/img/iconCross.png' width=16 height=16 />";

$settingGateway = $container->get(SettingGateway::class);

// Include the module version info, with required versions
include $session->get('absolutePath').'/modules/'.$session->get('module').'/version.php'; ?>

Expand Down Expand Up @@ -121,7 +124,7 @@
</td>
<td class="right">
<?php
$importsFolder = getSettingByScope($connection2, 'Data Admin', 'importCustomFolderLocation');
$importsFolder = $settingGateway->getSettingByScope('Data Admin', 'importCustomFolderLocation');
$importsFolderPath = $session->get('absolutePath').'/uploads/'.trim($importsFolder, '/ ');

echo (is_writable($importsFolderPath))? $trueIcon : $falseIcon; ?>
Expand All @@ -134,7 +137,7 @@
</td>
<td class="right">
<?php
$snapshotFolder = getSettingByScope($connection2, 'Data Admin', 'exportSnapshotsFolderLocation');
$snapshotFolder = $settingGateway->getSettingByScope('Data Admin', 'exportSnapshotsFolderLocation');
$snapshotFolderPath = $session->get('absolutePath').'/uploads/'.trim($snapshotFolder, '/ ');

echo (is_writable($snapshotFolderPath))? $trueIcon : $falseIcon; ?>
Expand All @@ -154,12 +157,12 @@
'OpenDocument' => __('OpenDocument (.ods)', 'Data Admin'),
'CSV' => __('Comma Separated (.csv)', 'Data Admin'),
);
$setting = getSettingByScope($connection2, 'Data Admin', 'exportDefaultFileType', true);
$setting = $settingGateway->getSettingByScope('Data Admin', 'exportDefaultFileType', true);
$row = $form->addRow();
$row->addLabel($setting['name'], __($setting['nameDisplay']))->description($setting['description']);
$row->addSelect($setting['name'])->fromArray($fileTypes)->selected($setting['value']);

$setting = getSettingByScope($connection2, 'Data Admin', 'exportSnapshotsFolderLocation', true);
$setting = $settingGateway->getSettingByScope('Data Admin', 'exportSnapshotsFolderLocation', true);
$row = $form->addRow();
$row->addLabel($setting['name'], __($setting['nameDisplay']))->description($setting['description']);
$row->addTextField($setting['name'])->required()->setValue($setting['value']);
Expand Down
4 changes: 3 additions & 1 deletion Data Admin/snapshot_manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

use Gibbon\Domain\System\SettingGateway;

// Module Bootstrap
require __DIR__ . '/module.php';

Expand Down Expand Up @@ -47,7 +49,7 @@
}


$snapshotFolder = getSettingByScope($connection2, 'Data Admin', 'exportSnapshotsFolderLocation');
$snapshotFolder = $container->get(SettingGateway::class)->getSettingByScope('Data Admin', 'exportSnapshotsFolderLocation');
$snapshotFolder = '/'.trim($snapshotFolder, '/ ');

$snapshotFolderPath = $session->get('absolutePath').'/uploads'.$snapshotFolder;
Expand Down
4 changes: 3 additions & 1 deletion Data Admin/snapshot_manage_addProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

use Gibbon\Domain\System\SettingGateway;

// Gibbon Bootstrap
include __DIR__ . '/../../gibbon.php';

Expand All @@ -34,7 +36,7 @@
//Proceed!
//Check if file exists

$snapshotFolder = getSettingByScope($connection2, 'Data Admin', 'exportSnapshotsFolderLocation');
$snapshotFolder = $container->get(SettingGateway::class)->getSettingByScope('Data Admin', 'exportSnapshotsFolderLocation');
$snapshotFolder = '/'.trim($snapshotFolder, '/ ');

$snapshotFolderPath = $session->get('absolutePath').'/uploads'.$snapshotFolder;
Expand Down
3 changes: 2 additions & 1 deletion Data Admin/snapshot_manage_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

use Gibbon\Forms\Prefab\DeleteForm;
use Gibbon\Domain\System\SettingGateway;

// Module Bootstrap
require __DIR__ . '/module.php';
Expand All @@ -41,7 +42,7 @@
echo __("You have not specified one or more required parameters.") ;
echo "</div>" ;
} else {
$snapshotFolder = getSettingByScope($connection2, 'Data Admin', 'exportSnapshotsFolderLocation');
$snapshotFolder = $container->get(SettingGateway::class)->getSettingByScope('Data Admin', 'exportSnapshotsFolderLocation');
$snapshotFolder = '/'.trim($snapshotFolder, '/ ');

$snapshotFolderPath = $session->get('absolutePath').'/uploads'.$snapshotFolder;
Expand Down
4 changes: 3 additions & 1 deletion Data Admin/snapshot_manage_deleteProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

use Gibbon\Domain\System\SettingGateway;

// Gibbon Bootstrap
include __DIR__ . '/../../gibbon.php';

Expand All @@ -34,7 +36,7 @@
} else {
//Proceed!
//Check if file exists
$snapshotFolder = getSettingByScope($connection2, 'Data Admin', 'exportSnapshotsFolderLocation');
$snapshotFolder = $container->get(SettingGateway::class)->getSettingByScope('Data Admin', 'exportSnapshotsFolderLocation');
$snapshotFolder = '/'.trim($snapshotFolder, '/ ');

$snapshotFolderPath = $session->get('absolutePath').'/uploads'.$snapshotFolder;
Expand Down
3 changes: 2 additions & 1 deletion Data Admin/snapshot_manage_load.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

use Gibbon\Forms\Form;
use Gibbon\Domain\System\SettingGateway;

// Module Bootstrap
require __DIR__ . '/module.php';
Expand Down Expand Up @@ -51,7 +52,7 @@
echo __("You have not specified one or more required parameters.");
echo "</div>";
} else {
$snapshotFolder = getSettingByScope($connection2, 'Data Admin', 'exportSnapshotsFolderLocation');
$snapshotFolder = $container->get(SettingGateway::class)->getSettingByScope('Data Admin', 'exportSnapshotsFolderLocation');
$snapshotFolder = '/' . trim($snapshotFolder, '/ ');

$snapshotFolderPath = $session->get('absolutePath') . '/uploads' . $snapshotFolder;
Expand Down
4 changes: 3 additions & 1 deletion Data Admin/snapshot_manage_loadProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

use Gibbon\Domain\System\SettingGateway;

// Gibbon Bootstrap
include __DIR__ . '/../../gibbon.php';

Expand All @@ -35,7 +37,7 @@
} else {
//Proceed!
//Check if file exists
$snapshotFolder = getSettingByScope($connection2, 'Data Admin', 'exportSnapshotsFolderLocation');
$snapshotFolder = $container->get(SettingGateway::class)->getSettingByScope('Data Admin', 'exportSnapshotsFolderLocation');
$snapshotFolder = '/'.trim($snapshotFolder, '/ ');

$snapshotFolderPath = $session->get('absolutePath').'/uploads'.$snapshotFolder;
Expand Down
3 changes: 2 additions & 1 deletion Data Admin/src/DatabaseTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

use Gibbon\Contracts\Database\Connection;
use Gibbon\Data\ImportType;
use Gibbon\Contracts\Services\Session;

/**
* Database Tools class
Expand Down Expand Up @@ -50,7 +51,7 @@ class DatabaseTools
* @param Gibbon\session
* @param Gibbon\Contracts\Database\Connection
*/
public function __construct(\Gibbon\Session $session = NULL, Connection $pdo = NULL)
public function __construct(Session $session = NULL, Connection $pdo = NULL)
{
$this->session = $session;
$this->pdo = $pdo;
Expand Down
Loading

0 comments on commit f003a1c

Please sign in to comment.