Skip to content

Commit c31ee82

Browse files
committed
Update For Current EasePHP Framework
1 parent e13b18c commit c31ee82

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+569
-518
lines changed

nbproject/private/private.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ copy.src.on.open=false
55
copy.src.target=/var/www/IcingaEditor
66
index.file=src/index.php
77
run.as=LOCAL
8-
url=http://localhost/VitexSoftware/icinga_configurator/
8+
url=http://localhost/VitexSoftware/IcingaEditor/

nbproject/private/private.xml

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
<file>file:/home/vitex/Projects/VitexSoftware/icinga_configurator/src/host.php</file>
1818
<file>file:/home/vitex/Projects/VitexSoftware/icinga_configurator/src/login.php</file>
1919
</group>
20+
<group name="Group 20171205-02:25:52">
21+
<file>file:/home/vitex/Projects/VitexSoftware/icinga_configurator/src/host.php</file>
22+
</group>
2023
<group>
21-
<file>file:/home/vitex/Projects/VitexSoftware/icinga_configurator/debian/rules</file>
22-
<file>file:/home/vitex/Projects/VitexSoftware/icinga_configurator/Makefile</file>
23-
<file>file:/home/vitex/Projects/VitexSoftware/icinga_configurator/bootstrap.sh</file>
24+
<file>file:/home/vitex/Projects/VitexSoftware/IcingaEditor/src/login.php</file>
2425
</group>
2526
</open-files>
2627
</project-private>

src/apply.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* @package IcingaEditor
99
* @author Vitex <vitex@hippy.cz>
10-
* @copyright 2012-2016 Vitex@hippy.cz (G)
10+
* @copyright 2012-2018 Vitex@hippy.cz (G)
1111
*/
1212
require_once 'includes/IEInit.php';
1313

@@ -117,7 +117,7 @@
117117
if (strstr($line, 'has no services associated with it!')) {
118118
preg_match("/\'(.*)\'/", $line, $keywords);
119119
$host = & $generator->parseClasses['host'];
120-
$host->setmyKeyColumn($host->nameColumn);
120+
$host->setKeyColumn($host->nameColumn);
121121
$host->loadFromSQL($keywords[1]);
122122
$host->resetObjectIdentity();
123123
$line = '<span class="label label-warning">'._('Warning').':</span> Host '.'<a href="host.php?host_id='.$host->getMyKey().'">'.$host->getName().'</a> '._('without any assigned service');

src/cfgconfirm.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* @package IcingaEditor
99
* @author Vitex <vitex@hippy.cz>
10-
* @copyright 2012-2016 Vitex@hippy.cz (G)
10+
* @copyright 2012-2018 Vitex@hippy.cz (G)
1111
*/
1212
require_once 'includes/IEInit.php';
1313

src/changepassword.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* User passwords change
77
*
88
* @author Vítězslav Dvořák <vitex@hippy.cz>
9-
* @copyright Vitex Software © 2011-2016
9+
* @copyright Vitex Software © 2011-2018
1010
*/
1111
require_once 'includes/IEInit.php';
1212

src/classes/DataSource.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public function getListing($queryRaw, $transform = 'html')
196196
{
197197
$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1;
198198
$rp = isset($_REQUEST['rp']) ? $_REQUEST['rp'] : 10;
199-
$sortname = isset($_REQUEST['sortname']) ? $_REQUEST['sortname'] : $this->handledObejct->getmyKeyColumn();
199+
$sortname = isset($_REQUEST['sortname']) ? $_REQUEST['sortname'] : $this->handledObejct->getKeyColumn();
200200
$sortorder = isset($_REQUEST['sortorder']) ? $_REQUEST['sortorder'] : 'desc';
201201
$where = $this->getWhere();
202202
$sort = " ORDER BY $sortname $sortorder";
@@ -251,8 +251,8 @@ public function getJson($queryRaw)
251251
} else {
252252
$order = '';
253253
}
254-
$transactions = $this->handledObejct->dblink->queryToArray($queryRaw.' WHERE `'.$this->handledObejct->myKeyColumn.'` IN('.$rows.')'.$order,
255-
$this->handledObejct->getmyKeyColumn());
254+
$transactions = $this->handledObejct->dblink->queryToArray($queryRaw.' WHERE `'.$this->handledObejct->keyColumn.'` IN('.$rows.')'.$order,
255+
$this->handledObejct->getKeyColumn());
256256
$total = count(explode(',', $rows));
257257
} else {
258258
$total = $this->getTotal($queryRaw.$this->getWhere());

src/classes/DbFixer.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ public function fixHostNameIDs()
9090
$host = new Engine\Host();
9191

9292
$service = new Engine\Service();
93-
$services = $service->getColumnsFromSQL([$service->myKeyColumn, $service->nameColumn,
94-
'host_name'], null, null, $service->myKeyColumn);
93+
$services = $service->getColumnsFromSQL([$service->keyColumn, $service->nameColumn,
94+
'host_name'], null, null, $service->keyColumn);
9595
foreach ($services as $serviceId => $serviceInfo) {
9696
$service->loadFromSQL($serviceId);
9797

@@ -151,9 +151,9 @@ public function fixHostNameIDs()
151151
}
152152
}
153153

154-
$childsAssigned = $host->dblink->queryToArray('SELECT '.$host->myKeyColumn.','.$host->nameColumn.' FROM '.$host->myTable.' WHERE '
154+
$childsAssigned = $host->dblink->queryToArray('SELECT '.$host->keyColumn.','.$host->nameColumn.' FROM '.$host->myTable.' WHERE '
155155
.'parents'.' IS NOT NULL && parents !=\'a:0:{}\'',
156-
$host->myKeyColumn);
156+
$host->keyColumn);
157157
foreach ($childsAssigned as $chid_id => $child_info) {
158158
$child = new Engine\Host($chid_id);
159159
$parents = $child->getDataValue('parents');
@@ -189,7 +189,7 @@ function fixContactIDs()
189189

190190
$contact = new Engine\Contact;
191191
$service = new Engine\Service;
192-
$services = $service->getColumnsFromSQL([$service->myKeyColumn]);
192+
$services = $service->getColumnsFromSQL([$service->keyColumn]);
193193
foreach ($services as $serviceId => $serviceInfo) {
194194
$serviceId = intval(current($serviceInfo));
195195
$service->loadFromSQL($serviceId);
@@ -222,7 +222,7 @@ function fixContactIDs()
222222
}
223223

224224
$host = new Engine\Host;
225-
$hosts = $host->getColumnsFromSQL([$host->myKeyColumn]);
225+
$hosts = $host->getColumnsFromSQL([$host->keyColumn]);
226226
foreach ($hosts as $hostInfo) {
227227
$hostId = intval(current($hostInfo));
228228
$host->loadFromSQL($hostId);
@@ -261,7 +261,7 @@ function fixHostHostgroupID()
261261
$hostgroupsErr = [];
262262
$host = new Engine\Host;
263263
$hostgroup = new Engine\Hostgroup;
264-
$hosts = $host->getColumnsFromSQL([$host->myKeyColumn]);
264+
$hosts = $host->getColumnsFromSQL([$host->keyColumn]);
265265
foreach ($hosts as $hostInfo) {
266266
$hostId = intval(current($hostInfo));
267267
$host->loadFromSQL($hostId);

src/classes/NRPEConfigGenerator.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ function cfgServices()
8585
{
8686
$service = new Engine\Service();
8787

88-
$servicesAssigned = $service->dblink->queryToArray('SELECT '.$service->myKeyColumn.','.$service->nameColumn.',`use` FROM '.$service->myTable.' WHERE host_name LIKE \'%"'.$this->host->getName().'"%\'',
89-
$service->myKeyColumn);
88+
$servicesAssigned = $service->dblink->queryToArray('SELECT '.$service->keyColumn.','.$service->nameColumn.',`use` FROM '.$service->myTable.' WHERE host_name LIKE \'%"'.$this->host->getName().'"%\'',
89+
$service->keyColumn);
9090

9191
$allServices = $service->getListing(
9292
null, true,

src/classes/NSCPConfigBatGenerator.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ function cfgServices()
290290
{
291291
$service = new Engine\Service();
292292

293-
$servicesAssigned = $service->dblink->queryToArray('SELECT '.$service->myKeyColumn.','.$service->nameColumn.',`use` FROM '.$service->myTable.' WHERE host_name LIKE \'%"'.$this->host->getName().'"%\'',
294-
$service->myKeyColumn);
293+
$servicesAssigned = $service->dblink->queryToArray('SELECT '.$service->keyColumn.','.$service->nameColumn.',`use` FROM '.$service->myTable.' WHERE host_name LIKE \'%"'.$this->host->getName().'"%\'',
294+
$service->keyColumn);
295295

296296
$allServices = $service->getListing(
297297
null, true,

src/classes/PortScanner.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ public function assignServices()
7474
default :
7575
break;
7676
}
77-
$this->service->setmyKeyColumn('tcp_port');
77+
$this->service->setKeyColumn('tcp_port');
7878
$this->service->loadFromSQL($port);
79-
$this->service->setmyKeyColumn('service_id');
79+
$this->service->setKeyColumn('service_id');
8080
$this->service->addMember('host_name', $this->host->getId(),
8181
$this->host->getName());
8282
if ($this->service->saveToSQL()) {

src/classes/Preferences.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class Preferences extends \Ease\Brick
1111
{
1212
public $myTable = 'preferences';
13-
public $myKeyColumn = 'key';
13+
public $KeyColumn = 'key';
1414

1515
/**
1616
* Preferences array

src/classes/Script.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Konfigurace Scriptů
44
*
55
* @author Vitex <vitex@hippy.cz>
6-
* @copyright 2012-2016 Vitex@hippy.cz (G)
6+
* @copyright 2012-2018 Vitex@hippy.cz (G)
77
*/
88

99
namespace Icinga\Editor;
@@ -14,7 +14,7 @@
1414
class Script extends engine\Configurator
1515
{
1616
public $myTable = 'script';
17-
public $myKeyColumn = 'script_id';
17+
public $KeyColumn = 'script_id';
1818
public $nameColumn = 'filename';
1919
public $keyword = 'script';
2020
public $myCreateColumn = 'DatCreate';

src/classes/Searcher.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Searcher Class
77
*
88
* @author Vitex <vitex@hippy.cz>
9-
* @copyright 2012-2016 Vitex@hippy.cz (G)
9+
* @copyright 2012-2018 Vitex@hippy.cz (G)
1010
*/
1111
class Searcher extends engine\Configurator
1212
{

src/classes/Stemplate.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class Stemplate extends Engine\Configurator
1212
{
1313
public $myTable = 'stemplate';
14-
public $myKeyColumn = 'stemplate_id';
14+
public $KeyColumn = 'stemplate_id';
1515
public $nameColumn = 'stemplate_name';
1616
public $keyword = 'stemplate';
1717

src/classes/UI/CfgEditor.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct($cfgObject, $onlyColumn = null)
4444
}
4545

4646
if ($cfgObject->getId()) {
47-
$this->addItem(new \Ease\Html\InputHiddenTag($cfgObject->getmyKeyColumn(),
47+
$this->addItem(new \Ease\Html\InputHiddenTag($cfgObject->getKeyColumn(),
4848
$cfgObject->getMyKey(), ['class' => 'keyId']));
4949
}
5050

@@ -499,7 +499,7 @@ public function fullEditor()
499499
break;
500500
case 'optional':
501501
if (!isset($optionalTab)) {
502-
$optionalTab = $tabs->addTab(_('Optional'));
502+
$optionalTab = $tabs->addTab(_('Optional'));
503503
}
504504
$mainFieldBlock = $optionalTab->addItem(new \Ease\Html\Div(null,
505505
['class' => 'fieldblock', 'id' => $fieldName.'-block']));

src/classes/UI/ChildrenSelector.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public function __construct($Host)
2929

3030
$Service = new \Icinga\Editor\Engine\Service();
3131

32-
$servicesAssigned = $Service->dblink->queryToArray('SELECT '.$Service->myKeyColumn.','.$Service->nameColumn.' FROM '.$Service->myTable.' WHERE '.$FieldName.' LIKE \'%"'.$Host->getName().'"%\'',
33-
$Service->myKeyColumn);
32+
$servicesAssigned = $Service->dblink->queryToArray('SELECT '.$Service->keyColumn.','.$Service->nameColumn.' FROM '.$Service->myTable.' WHERE '.$FieldName.' LIKE \'%"'.$Host->getName().'"%\'',
33+
$Service->keyColumn);
3434

3535
$allServices = $Service->getListing();
3636
foreach ($allServices as $ServiceID => $serviceInfo) {
@@ -49,7 +49,7 @@ public function __construct($Host)
4949
$Jellybean = new \Ease\Html\Span(
5050
null,
5151
['class' => 'jellybean gray', 'id' => $serviceInfo[$Service->nameColumn]]);
52-
$Jellybean->addItem(new \Ease\Html\ATag('?addservice='.$serviceInfo[$Service->nameColumn].'&amp;service_id='.$ServiceID.'&amp;'.$Host->getmyKeyColumn().'='.$Host->getMyKey().'&amp;'.$Host->nameColumn.'='.$Host->getName(),
52+
$Jellybean->addItem(new \Ease\Html\ATag('?addservice='.$serviceInfo[$Service->nameColumn].'&amp;service_id='.$ServiceID.'&amp;'.$Host->getKeyColumn().'='.$Host->getMyKey().'&amp;'.$Host->nameColumn.'='.$Host->getName(),
5353
$serviceInfo[$Service->nameColumn]));
5454
$InitialContent->addItem($Jellybean);
5555
}
@@ -62,7 +62,7 @@ public function __construct($Host)
6262
null,
6363
['class' => 'jellybean', 'id' => $serviceInfo[$Service->nameColumn]]);
6464
$Jellybean->addItem($serviceInfo[$Service->nameColumn]);
65-
$Jellybean->addItem(new \Ease\Html\ATag('?delservice='.$serviceInfo[$Service->nameColumn].'&amp;service_id='.$ServiceID.'&amp;'.$Host->getmyKeyColumn().'='.$Host->getMyKey().'&amp;'.$Host->nameColumn.'='.$Host->getName(),
65+
$Jellybean->addItem(new \Ease\Html\ATag('?delservice='.$serviceInfo[$Service->nameColumn].'&amp;service_id='.$ServiceID.'&amp;'.$Host->getKeyColumn().'='.$Host->getMyKey().'&amp;'.$Host->nameColumn.'='.$Host->getName(),
6666
\Ease\TWB\Part::GlyphIcon('remove')));
6767
$InitialContent->addItem($Jellybean);
6868
}
@@ -79,8 +79,8 @@ public function __construct($Host)
7979
public static function saveMembers($request)
8080
{
8181
$service = new \Icinga\Editor\Engine\Service();
82-
if (isset($request[$service->myKeyColumn])) {
83-
if ($service->loadFromSQL($request[$service->myKeyColumn])) {
82+
if (isset($request[$service->keyColumn])) {
83+
if ($service->loadFromSQL($request[$service->keyColumn])) {
8484
if (isset($request['addservice']) || isset($request['delservice'])) {
8585
if (isset($request['addservice'])) {
8686
$service->addHostName($request['host_id'],

src/classes/UI/ConfigurationsOverview.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* @package IcingaEditor
99
* @author Vitex <vitex@hippy.cz>
10-
* @copyright 2012-2016 Vitex@hippy.cz (G)
10+
* @copyright 2012-2018 Vitex@hippy.cz (G)
1111
*/
1212
class ConfigurationsOverview extends \Ease\TWB\Panel
1313
{

src/classes/UI/ContactAsignForm.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* @package IcingaEditor
99
* @author Vitex <vitex@hippy.cz>
10-
* @copyright 2015-2016 Vitex@hippy.cz (G)
10+
* @copyright 2015-2018 Vitex@hippy.cz (G)
1111
*/
1212
class ContactAsignForm extends \Ease\TWB\Form
1313
{

src/classes/UI/ContactSelect.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ public function __construct($name, $items = null, $defaultValue = null,
3737
function loadItems()
3838
{
3939
$items = [];
40-
$contacts = $this->contact->getColumnsFromSQL([$this->contact->myKeyColumn,
40+
$contacts = $this->contact->getColumnsFromSQL([$this->contact->keyColumn,
4141
$this->contact->nameColumn], null, $this->contact->nameColumn);
4242
if (count($contacts)) {
4343
foreach ($contacts as $contact) {
44-
$items[$contact[$this->contact->myKeyColumn]] = $contact[$this->contact->nameColumn];
44+
$items[$contact[$this->contact->keyColumn]] = $contact[$this->contact->nameColumn];
4545
}
4646
}
4747
return $items;

src/classes/UI/ContactSelector.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
*
88
* @package IcingaEditor
99
* @author Vitex <vitex@hippy.cz>
10-
* @copyright 2012-2016 Vitex@hippy.cz (G)
10+
* @copyright 2012-2018 Vitex@hippy.cz (G)
1111
*/
1212
class ContactSelector extends \Ease\Container
1313
{
14-
public $myKeyColumn = 'service_name';
14+
public $KeyColumn = 'service_name';
1515

1616
/**
1717
* Editor k přidávání členů skupiny
@@ -22,7 +22,7 @@ public function __construct($holder)
2222
{
2323
$contactsAssigned = [];
2424
parent::__construct();
25-
$fieldName = $holder->getmyKeyColumn();
25+
$fieldName = $holder->getKeyColumn();
2626
$initialContent = new \Ease\TWB\Panel(_('Contacts'));
2727
$initialContent->setTagCss(['width' => '100%']);
2828

@@ -63,7 +63,7 @@ public function __construct($holder)
6363
[
6464
new \Ease\Html\ATag('contacttweak.php?contact_id='.$contactInfo['parent_id'].'&amp;service_id='.$holder->getId(),
6565
\Ease\TWB\Part::GlyphIcon('wrench').' '._('Edit')),
66-
new \Ease\Html\ATag('?addcontact='.$contactInfo[$contact->nameColumn].'&amp;contact_id='.$contactID.'&amp;'.$holder->getmyKeyColumn().'='.$holder->getMyKey().'&amp;'.$holder->nameColumn.'='.$holder->getName(),
66+
new \Ease\Html\ATag('?addcontact='.$contactInfo[$contact->nameColumn].'&amp;contact_id='.$contactID.'&amp;'.$holder->getKeyColumn().'='.$holder->getMyKey().'&amp;'.$holder->nameColumn.'='.$holder->getName(),
6767
\Ease\TWB\Part::GlyphIcon('plus').' '._('Start notifing'))
6868
]));
6969
}
@@ -78,7 +78,7 @@ public function __construct($holder)
7878
$contactInfo[$contact->nameColumn], 'success', 'xs',
7979
[
8080
new \Ease\Html\ATag(
81-
'?delcontact='.$contactInfo[$contact->nameColumn].'&amp;contact_id='.$contactID.'&amp;'.$holder->getmyKeyColumn().'='.$holder->getMyKey().'&amp;'.$holder->nameColumn.'='.$holder->getName(),
81+
'?delcontact='.$contactInfo[$contact->nameColumn].'&amp;contact_id='.$contactID.'&amp;'.$holder->getKeyColumn().'='.$holder->getMyKey().'&amp;'.$holder->nameColumn.'='.$holder->getName(),
8282
\Ease\TWB\Part::GlyphIcon('remove').' '._('Stop notifing'))
8383
, new \Ease\Html\ATag('contacttweak.php?contact_id='.$contactInfo['parent_id'].'&amp;service_id='.$holder->getId(),
8484
\Ease\TWB\Part::GlyphIcon('wrench').' '._('Edit'))

0 commit comments

Comments
 (0)