Skip to content

Commit 9c3fb52

Browse files
committed
first commit
0 parents  commit 9c3fb52

10 files changed

+843
-0
lines changed

classes/AssignedStateExecutor.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
/**
3+
* @author Vladimir Kunin <[email protected]>
4+
*/
5+
6+
namespace Knowitop\iTop\MonitoringAPI;
7+
8+
class AssignedStateExecutor extends ExistsStateExecutor
9+
{
10+
public function Resolve(array $aFields, bool $bDoNotWrite = false): bool
11+
{
12+
$this->Update($aFields, true); // update ticket fields inside the context
13+
$oTicket = $this->GetContext()->GetTicket();
14+
$oTicket->ApplyStimulus('ev_resolve', $bDoNotWrite);
15+
$this->GetContext()->SetTicket($oTicket);
16+
17+
return true;
18+
}
19+
}

classes/ExistsStateExecutor.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
/**
3+
* @author Vladimir Kunin <[email protected]>
4+
*/
5+
6+
namespace Knowitop\iTop\MonitoringAPI;
7+
8+
use RestUtils;
9+
use Ticket;
10+
11+
class ExistsStateExecutor extends TicketStateExecutor
12+
{
13+
public function Create(array $aFields, bool $bDoNotWrite = false): bool
14+
{
15+
return false;
16+
}
17+
18+
public function Update(array $aFields, bool $bDoNotWrite = false): bool
19+
{
20+
$oContext = $this->GetContext();
21+
/** @var Ticket $oTicket */
22+
$oTicket = RestUtils::UpdateObjectFromFields($oContext->GetTicket(), $oContext->PrepareFields($aFields));
23+
if (!$bDoNotWrite)
24+
{
25+
$oTicket->DBUpdate();
26+
}
27+
$oContext->SetTicket($oTicket);
28+
29+
return true;
30+
}
31+
32+
public function Assign(array $aFields, bool $bDoNotWrite = false): bool
33+
{
34+
return false;
35+
}
36+
37+
public function Resolve(array $aFields, bool $bDoNotWrite = false): bool
38+
{
39+
return false;
40+
}
41+
42+
public function Reopen(array $aFields, bool $bDoNotWrite = false): bool
43+
{
44+
return false;
45+
}
46+
}

0 commit comments

Comments
 (0)