Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions lhc_web/modules/lhabstract/copyautoresponder.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

if (isset($_POST['CopyAction'])) {

$definition = array(
$definition = [
'CopyDepartments' => new ezcInputFormDefinitionElement(
ezcInputFormDefinitionElement::OPTIONAL, 'int', null, FILTER_REQUIRE_ARRAY
)
);
];

$form = new ezcInputForm( INPUT_POST, $definition );
$Errors = array();
$Errors = [];

if ( !$form->hasValidData( 'CopyDepartments' ) || empty($form->CopyDepartments))
{
Expand Down Expand Up @@ -43,5 +43,3 @@

$Result['content'] = $tpl->fetch();
$Result['pagelayout'] = 'popup';

?>
12 changes: 5 additions & 7 deletions lhc_web/modules/lhabstract/delete.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

erLhcoreClassChatEventDispatcher::getInstance()->dispatch('abstract.delete_'.strtolower($Params['user_parameters']['identifier']).'_general', array());
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('abstract.delete_'.strtolower($Params['user_parameters']['identifier']).'_general', []);

if (!$currentUser->validateCSFRToken($Params['user_parameters_unordered']['csfr'])) {
die('Invalid CSFR Token');
Expand Down Expand Up @@ -62,15 +62,15 @@

$ObjectData->removeThis();

erLhcoreClassLog::logObjectChange(array(
erLhcoreClassLog::logObjectChange([
'object' => $ObjectData,
'check_log' => true,
'action' => 'Delete',
'msg' => array(
'msg' => [
'delete' => $ObjectData->getState(),
'user_id' => $currentUser->getUserID()
)
));
]
]);

$cache = CSCacheAPC::getMem();
$cache->increaseCacheVersion('site_attributes_version');
Expand All @@ -82,5 +82,3 @@
erLhcoreClassModule::redirect('abstract/list','/'.$Params['user_parameters']['identifier'] . $extension);
}
exit;

?>
25 changes: 13 additions & 12 deletions lhc_web/modules/lhabstract/edit.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

erLhcoreClassChatEventDispatcher::getInstance()->dispatch('abstract.edit_'.strtolower($Params['user_parameters']['identifier']).'_general', array());
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('abstract.edit_'.strtolower($Params['user_parameters']['identifier']).'_general', []);

$tpl = erLhcoreClassTemplate::getInstance('lhabstract/edit.tpl.php');

Expand Down Expand Up @@ -84,15 +84,15 @@

$currentState = $ObjectData->getState();

erLhcoreClassLog::logObjectChange(array(
erLhcoreClassLog::logObjectChange([
'object' => $ObjectData,
'check_log' => true,
'msg' => array(
'msg' => [
'prev' => $previousState,
'curr' => $currentState,
'user_id' => $currentUser->getUserID()
)
));
]
]);

if (isset($_POST['SaveClient'])){
erLhcoreClassModule::redirect('abstract/list','/'.$Params['user_parameters']['identifier'] . $extension);
Expand Down Expand Up @@ -141,13 +141,14 @@
} else {
$Result['path'] = $object_trans['path'];
}
$Result['path'][] = array('url' => erLhcoreClassDesign::baseurl('abstract/list').'/'.$Params['user_parameters']['identifier'] . $extension, 'title' => $object_trans['name']);
$Result['path'][] = array('title' =>erTranslationClassLhTranslation::getInstance()->getTranslation('system/buttons','Edit'));
$Result['path'][] = ['url' => erLhcoreClassDesign::baseurl('abstract/list') . '/' . $Params['user_parameters']['identifier'] . $extension, 'title' => $object_trans['name']];
$Result['path'][] = ['title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/buttons', 'Edit')];
} else {
$Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('system/configuration'),'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/htmlcode','System configuration')),
array('url' => erLhcoreClassDesign::baseurl('abstract/list').'/'.$Params['user_parameters']['identifier'] . $extension, 'title' => $object_trans['name']),
array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/buttons','Edit'))
);
$Result['path'] = [
['url' => erLhcoreClassDesign::baseurl('system/configuration'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/htmlcode', 'System configuration')],
['url' => erLhcoreClassDesign::baseurl('abstract/list') . '/' . $Params['user_parameters']['identifier'] . $extension, 'title' => $object_trans['name']],
['title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/buttons', 'Edit')]
];
}

erLhcoreClassChatEventDispatcher::getInstance()->dispatch('abstract.edit_'.strtolower($Params['user_parameters']['identifier']).'_path', array('result' => & $Result));
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('abstract.edit_'.strtolower($Params['user_parameters']['identifier']).'_path', ['result' => & $Result]);
20 changes: 10 additions & 10 deletions lhc_web/modules/lhabstract/list.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

erLhcoreClassChatEventDispatcher::getInstance()->dispatch('abstract.list_'.strtolower($Params['user_parameters']['identifier']).'_general', array());
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('abstract.list_'.strtolower($Params['user_parameters']['identifier']).'_general', []);

$tpl = erLhcoreClassTemplate::getInstance( 'lhabstract/list.tpl.php');
$tpl->set('extension','');
Expand All @@ -26,15 +26,15 @@
}

$append = '';
$filterParams['filter'] = array();
$filterParams['filter'] = [];

if ( isset($objectData->has_filter) && $objectData->has_filter === true ) {
$filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'abstract', 'module_file' => $objectData->filter_name, 'format_filter' => true, 'use_override' => true, 'uparams' => $Params['user_parameters_unordered']));
$filterParams = erLhcoreClassSearchHandler::getParams(['module' => 'abstract', 'module_file' => $objectData->filter_name, 'format_filter' => true, 'use_override' => true, 'uparams' => $Params['user_parameters_unordered']]);
$append = erLhcoreClassSearchHandler::getURLAppendFromInput($filterParams['input_form']);
$tpl->set('filter', $objectData->filter_name);
}

$filterObject = array();
$filterObject = [];
if ( method_exists($objectData,'getFilter') ) {
$filterObject = $objectData->getFilter($filterParams['input_form']);
}
Expand Down Expand Up @@ -192,13 +192,13 @@
$Result['path'] = $object_trans['path'];
}

$Result['path'][] = array('title' => $object_trans['name']);
$Result['path'][] = ['title' => $object_trans['name']];

} else {
$Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('system/configuration'),'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/htmlcode','System configuration')),
array('title' => $object_trans['name'])
);
$Result['path'] = [
['url' => erLhcoreClassDesign::baseurl('system/configuration'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/htmlcode', 'System configuration')],
['title' => $object_trans['name']]
];
};

erLhcoreClassChatEventDispatcher::getInstance()->dispatch('abstract.list_'.strtolower($Params['user_parameters']['identifier']).'_path', array('result' => & $Result));
?>
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('abstract.list_'.strtolower($Params['user_parameters']['identifier']).'_path', ['result' => & $Result]);
112 changes: 46 additions & 66 deletions lhc_web/modules/lhabstract/module.php
Original file line number Diff line number Diff line change
@@ -1,68 +1,48 @@
<?php

$Module = array( "name" => "Abstract module");

$ViewList = array();

$ViewList['new'] = array(
'functions' => array( 'use' ),
'params' => array('identifier'),
'uparams' => array('extension')
);

$ViewList['list'] = array(
'functions' => array( 'use' ),
'params' => array('identifier'),
'uparams' => array(
'extension',
'name',
'pinned',
'internal',
'object_id',
'user_id',
'category',
'source',
'message',
'timefrom','timefrom_hours','timefrom_seconds','timefrom_minutes',
'timeto', 'timeto_minutes', 'timeto_seconds', 'timeto_hours',
'action','csfr','include_archive','dep_id','object_identifier'
),
'multiple_arguments' => array('dep_id')
);

$ViewList['downloadbinnary'] = array(
'functions' => array( 'use' ),
'params' => array('identifier','object_id')
);

$ViewList['copyautoresponder'] = array(
'functions' => array( 'use' ),
'params' => array('id')
);

$ViewList['edit'] = array(
'functions' => array( 'use' ),
'params' => array('identifier','object_id'),
'uparams' => array('extension','action','csfr')
);

$ViewList['delete'] = array(
'functions' => array( 'use' ),
'params' => array('identifier','object_id'),
'uparams' => array('csfr','extension')
);

$ViewList['index'] = array(
'functions' => array( 'use' ),
'params' => array()
);

$ViewList['testmasking'] = array(
'functions' => array( 'use' ),
'params' => array()
);

$FunctionList = array();
$FunctionList['use'] = array('explain' => 'Allow to use abstract module');

?>
$Module = ['name' => 'Abstract module'];
$default = ['functions' => ['use']];

$ViewList = [
'new' => $default + [
'params' => ['identifier'],
'uparams' => ['extension'],
],
'list' => $default + [
'params' => ['identifier'],
'uparams' => [
'extension', 'name', 'pinned', 'internal',
'object_id', 'user_id', 'category', 'source',
'message', 'timefrom', 'timefrom_hours',
'timefrom_seconds', 'timefrom_minutes',
'timeto', 'timeto_minutes', 'timeto_seconds',
'timeto_hours', 'action', 'csfr', 'include_archive',
'dep_id', 'object_identifier',
],
'multiple_arguments' => ['dep_id'],
],
'downloadbinnary' => $default + [
'params' => ['identifier', 'object_id'],
],
'copyautoresponder' => $default + [
'params' => ['id'],
],
'edit' => $default + [
'params' => ['identifier', 'object_id'],
'uparams' => ['extension', 'action', 'csfr'],
],
'delete' => $default + [
'params' => ['identifier', 'object_id'],
'uparams' => ['csfr', 'extension'],
],
'index' => $default + [
'params' => [],
],
'testmasking' => $default + [
'params' => [],
],
];

$FunctionList = [
'use' => ['explain' => 'Allow to use abstract module'],
];
29 changes: 15 additions & 14 deletions lhc_web/modules/lhabstract/new.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

erLhcoreClassChatEventDispatcher::getInstance()->dispatch('abstract.new_'.strtolower($Params['user_parameters']['identifier']).'_general', array());
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('abstract.new_'.strtolower($Params['user_parameters']['identifier']).'_general', []);

$tpl = erLhcoreClassTemplate::getInstance('lhabstract/new.tpl.php');
$extension = '';
Expand Down Expand Up @@ -42,7 +42,7 @@

$Errors = erLhcoreClassAbstract::validateInput($objectData);

erLhcoreClassChatEventDispatcher::getInstance()->dispatch('abstract.before_created.'.strtolower($objectClass),array('object' => & $objectData, 'errors' => & $Errors));
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('abstract.before_created.'.strtolower($objectClass), ['object' => & $objectData, 'errors' => & $Errors]);

if (count($Errors) == 0)
{
Expand All @@ -57,16 +57,16 @@
erLhcoreClassAbstract::getSession()->update($objectData);
}

erLhcoreClassChatEventDispatcher::getInstance()->dispatch('abstract.created.'.strtolower($objectClass),array('object' => & $objectData));
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('abstract.created.'.strtolower($objectClass), ['object' => & $objectData]);

erLhcoreClassLog::logObjectChange(array(
erLhcoreClassLog::logObjectChange([
'object' => $objectData,
'check_log' => true,
'msg' => array(
'msg' => [
'new' => $objectData->getState(),
'user_id' => $currentUser->getUserID()
)
));
]
]);

if ( isset($_POST['SaveClient']) ) {
erLhcoreClassModule::redirect('abstract/list','/'.$Params['user_parameters']['identifier'] . $extension);
Expand Down Expand Up @@ -116,13 +116,14 @@
} else {
$Result['path'] = $object_trans['path'];
}
$Result['path'][] = array('url' => erLhcoreClassDesign::baseurl('abstract/list').'/'.$Params['user_parameters']['identifier'], 'title' => $object_trans['name']);
$Result['path'][] = array('title' =>erTranslationClassLhTranslation::getInstance()->getTranslation('system/buttons','New'));
$Result['path'][] = ['url' => erLhcoreClassDesign::baseurl('abstract/list') . '/' . $Params['user_parameters']['identifier'], 'title' => $object_trans['name']];
$Result['path'][] = ['title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/buttons', 'New')];
} else {
$Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('system/configuration'),'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/htmlcode','System configuration')),
array('url' => erLhcoreClassDesign::baseurl('abstract/list').'/'.$Params['user_parameters']['identifier'], 'title' => $object_trans['name']),
array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/buttons','New'))
);
$Result['path'] = [
['url' => erLhcoreClassDesign::baseurl('system/configuration'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/htmlcode', 'System configuration')],
['url' => erLhcoreClassDesign::baseurl('abstract/list') . '/' . $Params['user_parameters']['identifier'], 'title' => $object_trans['name']],
['title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/buttons', 'New')]
];
}

erLhcoreClassChatEventDispatcher::getInstance()->dispatch('abstract.new_'.strtolower($Params['user_parameters']['identifier']).'_path', array('result' => & $Result));
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('abstract.new_'.strtolower($Params['user_parameters']['identifier']).'_path', ['result' => & $Result]);
22 changes: 10 additions & 12 deletions lhc_web/modules/lhaudit/configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
$data = (array)$auditOptions->data;

if ( isset($_POST['ReloadOperatorsBackOffice']) ) {
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.reload_backoffice',array());
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.reload_backoffice',[]);
}

if ( isset($_POST['StoreOptions']) ) {
Expand All @@ -28,7 +28,7 @@
exit;
}

$definition = array(
$definition = [
'days_log' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int'),
'log_js' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'boolean'),
'log_user' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'boolean'),
Expand All @@ -37,10 +37,10 @@
'log_routing' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'boolean'),
'log_custom_reply' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'boolean'),
'log_objects' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw',null,FILTER_REQUIRE_ARRAY),
);
];

$form = new ezcInputForm( INPUT_POST, $definition );
$Errors = array();
$Errors = [];

if ( $form->hasValidData( 'days_log' )) {
$data['days_log'] = $form->days_log ;
Expand All @@ -51,7 +51,7 @@
if ( $form->hasValidData( 'log_objects' )) {
$data['log_objects'] = $form->log_objects ;
} else {
$data['log_objects'] = array();
$data['log_objects'] = [];
}

if ( $form->hasValidData( 'log_js' )) {
Expand Down Expand Up @@ -104,11 +104,9 @@

$Result['content'] = $tpl->fetch();

$Result['path'] = array(
array('url' => erLhcoreClassDesign::baseurl('system/configuration'),'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('department/edit','System configuration')),
array(
$Result['path'] = [
['url' => erLhcoreClassDesign::baseurl('system/configuration'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('department/edit', 'System configuration')],
[
'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('audit/options', 'Options')
)
);

?>
]
];
Loading