PMCORE-514
This commit is contained in:
@@ -9,8 +9,8 @@ $factory->define(\ProcessMaker\Model\AppDelay::class, function (Faker $faker) {
|
|||||||
'PRO_UID' => G::generateUniqueID(),
|
'PRO_UID' => G::generateUniqueID(),
|
||||||
'APP_UID' => G::generateUniqueID(),
|
'APP_UID' => G::generateUniqueID(),
|
||||||
'APP_NUMBER' => $faker->unique()->numberBetween(1000),
|
'APP_NUMBER' => $faker->unique()->numberBetween(1000),
|
||||||
'APP_THREAD_INDEX' => 1,
|
'APP_THREAD_INDEX' => $faker->unique()->numberBetween(100),
|
||||||
'APP_DEL_INDEX' => $faker->unique()->numberBetween(10),
|
'APP_DEL_INDEX' => $faker->unique()->numberBetween(100),
|
||||||
'APP_TYPE' => $faker->randomElement($actions),
|
'APP_TYPE' => $faker->randomElement($actions),
|
||||||
'APP_STATUS' => 'TO_DO',
|
'APP_STATUS' => 'TO_DO',
|
||||||
'APP_NEXT_TASK' => 0,
|
'APP_NEXT_TASK' => 0,
|
||||||
@@ -28,56 +28,33 @@ $factory->define(\ProcessMaker\Model\AppDelay::class, function (Faker $faker) {
|
|||||||
// Create a delegation with the foreign keys
|
// Create a delegation with the foreign keys
|
||||||
$factory->state(\ProcessMaker\Model\AppDelay::class, 'paused_foreign_keys', function (Faker $faker) {
|
$factory->state(\ProcessMaker\Model\AppDelay::class, 'paused_foreign_keys', function (Faker $faker) {
|
||||||
// Create values in the foreign key relations
|
// Create values in the foreign key relations
|
||||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
$delegation1 = factory(\ProcessMaker\Model\Delegation::class)->states('closed')->create();
|
||||||
$process = factory(\ProcessMaker\Model\Process::class)->create();
|
$delegation2 = factory(\ProcessMaker\Model\Delegation::class)->states('foreign_keys')->create([
|
||||||
$task = factory(\ProcessMaker\Model\Task::class)->create([
|
'PRO_UID' => $delegation1->PRO_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_ID' => $delegation1->PRO_ID,
|
||||||
'PRO_ID' => $process->PRO_ID
|
'TAS_UID' => $delegation1->TAS_UID,
|
||||||
]);
|
'TAS_ID' => $delegation1->TAS_ID,
|
||||||
$application = factory(\ProcessMaker\Model\Application::class)->create([
|
'APP_NUMBER' => $delegation1->APP_NUMBER,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'APP_UID' => $delegation1->APP_UID,
|
||||||
'APP_INIT_USER' => $user->USR_UID,
|
|
||||||
'APP_CUR_USER' => $user->USR_UID
|
|
||||||
]);
|
|
||||||
$delegation1 = factory(\ProcessMaker\Model\Delegation::class)->create([
|
|
||||||
'PRO_UID' => $process->PRO_UID,
|
|
||||||
'PRO_ID' => $process->PRO_ID,
|
|
||||||
'TAS_UID' => $task->TAS_UID,
|
|
||||||
'TAS_ID' => $task->TAS_ID,
|
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
|
||||||
'APP_UID' => $application->APP_UID,
|
|
||||||
'DEL_THREAD_STATUS' => 'CLOSED',
|
|
||||||
'USR_UID' => $user->USR_UID,
|
|
||||||
'USR_ID' => $user->USR_ID,
|
|
||||||
'DEL_PREVIOUS' => 0,
|
|
||||||
'DEL_INDEX' => 1
|
|
||||||
]);
|
|
||||||
$delegation = factory(\ProcessMaker\Model\Delegation::class)->create([
|
|
||||||
'PRO_UID' => $process->PRO_UID,
|
|
||||||
'PRO_ID' => $process->PRO_ID,
|
|
||||||
'TAS_UID' => $task->TAS_UID,
|
|
||||||
'TAS_ID' => $task->TAS_ID,
|
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
|
||||||
'APP_UID' => $application->APP_UID,
|
|
||||||
'DEL_THREAD_STATUS' => 'OPEN',
|
'DEL_THREAD_STATUS' => 'OPEN',
|
||||||
'USR_UID' => $user->USR_UID,
|
'USR_UID' => $delegation1->USR_UID,
|
||||||
'USR_ID' => $user->USR_ID,
|
'USR_ID' => $delegation1->USR_ID,
|
||||||
'DEL_PREVIOUS' => $delegation1->DEL_INDEX,
|
'DEL_PREVIOUS' => $delegation1->DEL_INDEX,
|
||||||
'DEL_INDEX' => $delegation1->DEL_INDEX++
|
'DEL_INDEX' => $faker->unique()->numberBetween(2000),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Return with default values
|
// Return with default values
|
||||||
return [
|
return [
|
||||||
'APP_DELAY_UID' => G::generateUniqueID(),
|
'APP_DELAY_UID' => G::generateUniqueID(),
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $delegation2->PRO_UID,
|
||||||
'PRO_ID' => $process->PRO_ID,
|
'PRO_ID' => $delegation2->PRO_ID,
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $delegation2->APP_UID,
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $delegation2->APP_NUMBER,
|
||||||
'APP_DEL_INDEX' => $delegation->DEL_INDEX,
|
'APP_DEL_INDEX' => $delegation2->DEL_INDEX,
|
||||||
'APP_TYPE' => 'PAUSE',
|
'APP_TYPE' => 'PAUSE',
|
||||||
'APP_STATUS' => $application->APP_STATUS,
|
'APP_STATUS' => 'TO_DO',
|
||||||
'APP_DELEGATION_USER' => $user->USR_UID,
|
'APP_DELEGATION_USER' => $delegation2->USR_UID,
|
||||||
'APP_DELEGATION_USER_ID' => $user->USR_ID,
|
'APP_DELEGATION_USER_ID' => $delegation2->USR_ID,
|
||||||
'APP_ENABLE_ACTION_USER' => G::generateUniqueID(),
|
'APP_ENABLE_ACTION_USER' => G::generateUniqueID(),
|
||||||
'APP_ENABLE_ACTION_DATE' => $faker->dateTime(),
|
'APP_ENABLE_ACTION_DATE' => $faker->dateTime(),
|
||||||
'APP_DISABLE_ACTION_USER' => 0,
|
'APP_DISABLE_ACTION_USER' => 0,
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ $factory->state(\ProcessMaker\Model\Delegation::class, 'foreign_keys', function
|
|||||||
return [
|
return [
|
||||||
'DELEGATION_ID' => $faker->unique()->numberBetween(5000),
|
'DELEGATION_ID' => $faker->unique()->numberBetween(5000),
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'DEL_INDEX' => 1,
|
'DEL_INDEX' => $faker->unique()->numberBetween(2000),
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
'DEL_PREVIOUS' => 0,
|
'DEL_PREVIOUS' => 0,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
@@ -176,7 +176,17 @@ $factory->state(\ProcessMaker\Model\Delegation::class, 'closed', function (Faker
|
|||||||
|
|
||||||
// Create a last delegation
|
// Create a last delegation
|
||||||
$factory->state(\ProcessMaker\Model\Delegation::class, 'last_thread', function (Faker $faker) {
|
$factory->state(\ProcessMaker\Model\Delegation::class, 'last_thread', function (Faker $faker) {
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'DEL_LAST_INDEX' => 1,
|
'DEL_LAST_INDEX' => 1,
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Create a first delegation
|
||||||
|
$factory->state(\ProcessMaker\Model\Delegation::class, 'first_thread', function (Faker $faker) {
|
||||||
|
|
||||||
|
return [
|
||||||
|
'DEL_INDEX' => 1,
|
||||||
|
'DEL_PREVIOUS' => 0,
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|||||||
@@ -354,6 +354,7 @@ class DraftTest extends TestCase
|
|||||||
* It tests the getCountersByProcesses() method with the category filter
|
* It tests the getCountersByProcesses() method with the category filter
|
||||||
*
|
*
|
||||||
* @covers \ProcessMaker\BusinessModel\Cases\Draft::getCountersByProcesses()
|
* @covers \ProcessMaker\BusinessModel\Cases\Draft::getCountersByProcesses()
|
||||||
|
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::getCountersByProcesses()
|
||||||
* @test
|
* @test
|
||||||
*/
|
*/
|
||||||
public function it_should_test_get_counters_by_processes_method_category()
|
public function it_should_test_get_counters_by_processes_method_category()
|
||||||
@@ -643,6 +644,7 @@ class DraftTest extends TestCase
|
|||||||
* It tests the getCountersByRange() method
|
* It tests the getCountersByRange() method
|
||||||
*
|
*
|
||||||
* @covers \ProcessMaker\BusinessModel\Cases\Draft::getCountersByRange()
|
* @covers \ProcessMaker\BusinessModel\Cases\Draft::getCountersByRange()
|
||||||
|
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::getCountersByProcesses()
|
||||||
* @test
|
* @test
|
||||||
*/
|
*/
|
||||||
public function it_should_test_get_counters_by_range_method()
|
public function it_should_test_get_counters_by_range_method()
|
||||||
|
|||||||
@@ -199,6 +199,7 @@ class InboxTest extends TestCase
|
|||||||
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::getData()
|
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::getData()
|
||||||
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::getColumnsView()
|
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::getColumnsView()
|
||||||
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::filters()
|
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::filters()
|
||||||
|
* @covers \ProcessMaker\Model\Delegation::scopeTask()
|
||||||
* @test
|
* @test
|
||||||
*/
|
*/
|
||||||
public function it_filter_by_task()
|
public function it_filter_by_task()
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ namespace ProcessMaker\BusinessModel;
|
|||||||
use Exception;
|
use Exception;
|
||||||
use G;
|
use G;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\AppDelay;
|
||||||
use ProcessMaker\Model\Application;
|
use ProcessMaker\Model\Application;
|
||||||
use ProcessMaker\Model\Delegation;
|
use ProcessMaker\Model\Delegation;
|
||||||
use ProcessMaker\Model\Documents;
|
use ProcessMaker\Model\Documents;
|
||||||
@@ -380,4 +381,45 @@ class CasesTest extends TestCase
|
|||||||
// Get DynaForms assigned as steps for the second task when the application status is COMPLETED
|
// Get DynaForms assigned as steps for the second task when the application status is COMPLETED
|
||||||
self::assertCount(1, Cases::dynaFormsByApplication($application->APP_UID, $task2->TAS_UID, '', 'COMPLETED'));
|
self::assertCount(1, Cases::dynaFormsByApplication($application->APP_UID, $task2->TAS_UID, '', 'COMPLETED'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It test the case info used in the PMFCaseLink
|
||||||
|
*
|
||||||
|
* @covers \ProcessMaker\BusinessModel\Cases::getStatusInfo()
|
||||||
|
* @covers \ProcessMaker\Model\AppDelay::getPaused()
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_should_test_case_status_info()
|
||||||
|
{
|
||||||
|
// Get status info when the case is PAUSED
|
||||||
|
$table = factory(AppDelay::class)->states('paused_foreign_keys')->create();
|
||||||
|
$cases = new Cases();
|
||||||
|
$result = $cases->getStatusInfo($table->APP_UID, $table->APP_DEL_INDEX, $table->APP_DELEGATION_USER);
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
$this->assertArrayHasKey('APP_STATUS', $result);
|
||||||
|
$this->assertArrayHasKey('DEL_INDEX', $result);
|
||||||
|
$this->assertArrayHasKey('PRO_UID', $result);
|
||||||
|
// Get status info when the case is UNASSIGNED
|
||||||
|
// Get status info when the case is TO_DO
|
||||||
|
$table = factory(Delegation::class)->states('foreign_keys')->create();
|
||||||
|
$cases = new Cases();
|
||||||
|
$result = $cases->getStatusInfo($table->APP_UID, $table->DEL_INDEX, $table->USR_UID);
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
$this->assertArrayHasKey('APP_STATUS', $result);
|
||||||
|
$this->assertArrayHasKey('DEL_INDEX', $result);
|
||||||
|
$this->assertArrayHasKey('PRO_UID', $result);
|
||||||
|
// Get status info when the case is COMPLETED
|
||||||
|
$table = factory(Application::class)->states('completed')->create();
|
||||||
|
$table = factory(Delegation::class)->states('foreign_keys')->create([
|
||||||
|
'APP_NUMBER' => $table->APP_NUMBER,
|
||||||
|
'APP_UID' => $table->APP_UID,
|
||||||
|
]);
|
||||||
|
$cases = new Cases();
|
||||||
|
$result = $cases->getStatusInfo($table->APP_UID, $table->DEL_INDEX, $table->USR_UID);
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
$this->assertArrayHasKey('APP_STATUS', $result);
|
||||||
|
$this->assertArrayHasKey('DEL_INDEX', $result);
|
||||||
|
$this->assertArrayHasKey('PRO_UID', $result);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,102 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\src\ProcessMaker\Model;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use ProcessMaker\Model\AppDelay;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class AppDelayTest
|
||||||
|
*
|
||||||
|
* @coversDefaultClass \ProcessMaker\Model\AppDelay
|
||||||
|
*/
|
||||||
|
class AppDelayTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set up function.
|
||||||
|
*/
|
||||||
|
public function setUp()
|
||||||
|
{
|
||||||
|
parent::setUp();
|
||||||
|
AppDelay::truncate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test scopeType
|
||||||
|
*
|
||||||
|
* @covers \ProcessMaker\Model\AppDelay::scopeType()
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_scope_type()
|
||||||
|
{
|
||||||
|
$table = factory(AppDelay::class)->states('paused_foreign_keys')->create();
|
||||||
|
$this->assertCount(1, $table->type('PAUSE')->get());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test scopeNotDisabled
|
||||||
|
*
|
||||||
|
* @covers \ProcessMaker\Model\AppDelay::scopeNotDisabled()
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_scope_not_action_disable()
|
||||||
|
{
|
||||||
|
$table = factory(AppDelay::class)->states('paused_foreign_keys')->create();
|
||||||
|
$this->assertCount(1, $table->notDisabled()->get());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test scopeCase
|
||||||
|
*
|
||||||
|
* @covers \ProcessMaker\Model\AppDelay::scopeCase()
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_scope_case()
|
||||||
|
{
|
||||||
|
$table = factory(AppDelay::class)->states('paused_foreign_keys')->create();
|
||||||
|
$this->assertCount(1, $table->case($table->APP_NUMBER)->get());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test scopeIndex
|
||||||
|
*
|
||||||
|
* @covers \ProcessMaker\Model\AppDelay::scopeIndex()
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_scope_index()
|
||||||
|
{
|
||||||
|
$table = factory(AppDelay::class)->states('paused_foreign_keys')->create();
|
||||||
|
$this->assertCount(1, $table->index($table->APP_DEL_INDEX)->get());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test scopeDelegateUser
|
||||||
|
*
|
||||||
|
* @covers \ProcessMaker\Model\AppDelay::scopeDelegateUser()
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_scope_delegate_user()
|
||||||
|
{
|
||||||
|
$table = factory(AppDelay::class)->states('paused_foreign_keys')->create();
|
||||||
|
$this->assertCount(1, $table->delegateUser($table->APP_DELEGATION_USER)->get());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test getPaused
|
||||||
|
*
|
||||||
|
* @covers \ProcessMaker\Model\AppDelay::getPaused()
|
||||||
|
* @covers \ProcessMaker\Model\AppDelay::scopeCase()
|
||||||
|
* @covers \ProcessMaker\Model\AppDelay::scopeIndex()
|
||||||
|
* @covers \ProcessMaker\Model\AppDelay::scopeDelegateUser()
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_paused_threads()
|
||||||
|
{
|
||||||
|
$table = factory(AppDelay::class)->states('paused_foreign_keys')->create();
|
||||||
|
$result = AppDelay::getPaused($table->APP_NUMBER, $table->APP_DEL_INDEX, $table->APP_DELEGATION_USER);
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -170,7 +170,7 @@ class DelegationTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_return_scope_case_started()
|
public function it_return_scope_case_started()
|
||||||
{
|
{
|
||||||
$table = factory(Delegation::class)->states('foreign_keys')->create();
|
$table = factory(Delegation::class)->states('first_thread')->create();
|
||||||
$this->assertCount(1, $table->caseStarted($table->DEL_INDEX)->get());
|
$this->assertCount(1, $table->caseStarted($table->DEL_INDEX)->get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2150,6 +2150,8 @@ class DelegationTest extends TestCase
|
|||||||
//Review the self-service records
|
//Review the self-service records
|
||||||
$result = Delegation::getSelfService($user->USR_UID);
|
$result = Delegation::getSelfService($user->USR_UID);
|
||||||
$this->assertEquals(25, count($result));
|
$this->assertEquals(25, count($result));
|
||||||
|
$result = Delegation::getSelfService($user->USR_UID, ['APP_DELEGATION.APP_NUMBER', 'APP_DELEGATION.DEL_INDEX'], null, null,null, null, null, 0, 15);
|
||||||
|
$this->assertEquals(15, count($result));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -3369,7 +3371,7 @@ class DelegationTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_get_cases_started_by_specific_user()
|
public function it_get_cases_started_by_specific_user()
|
||||||
{
|
{
|
||||||
$delegation = factory(Delegation::class)->states('foreign_keys')->create();
|
$delegation = factory(Delegation::class)->states('first_thread')->create();
|
||||||
$result = Delegation::casesStartedBy($delegation->USR_ID);
|
$result = Delegation::casesStartedBy($delegation->USR_ID);
|
||||||
$this->assertNotEmpty($result);
|
$this->assertNotEmpty($result);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ use ProcessMaker\BusinessModel\User as BmUser;
|
|||||||
use ProcessMaker\Core\System;
|
use ProcessMaker\Core\System;
|
||||||
use ProcessMaker\Exception\UploadException;
|
use ProcessMaker\Exception\UploadException;
|
||||||
use ProcessMaker\Exception\CaseNoteUploadFile;
|
use ProcessMaker\Exception\CaseNoteUploadFile;
|
||||||
|
use ProcessMaker\Model\AppDelay as Delay;
|
||||||
use ProcessMaker\Model\Application as ModelApplication;
|
use ProcessMaker\Model\Application as ModelApplication;
|
||||||
use ProcessMaker\Model\AppNotes as Notes;
|
use ProcessMaker\Model\AppNotes as Notes;
|
||||||
use ProcessMaker\Model\AppTimeoutAction;
|
use ProcessMaker\Model\AppTimeoutAction;
|
||||||
@@ -2456,33 +2457,25 @@ class Cases
|
|||||||
/**
|
/**
|
||||||
* This function get the status information
|
* This function get the status information
|
||||||
*
|
*
|
||||||
* @param object $rsCriteria
|
* @param array $result
|
||||||
|
* @param string $status
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private function getStatusInfoDataByRsCriteria($rsCriteria)
|
private function getStatusInfoFormatted(array $result, string $status = '')
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$arrayData = [];
|
$record = head($result);
|
||||||
|
|
||||||
if ($rsCriteria->next()) {
|
|
||||||
$record = $rsCriteria->getRow();
|
|
||||||
|
|
||||||
$arrayData = [
|
$arrayData = [
|
||||||
'APP_STATUS' => $record['APP_STATUS'],
|
'APP_STATUS' => empty($status) ? $record['APP_STATUS'] : $status,
|
||||||
'DEL_INDEX' => [],
|
'DEL_INDEX' => [],
|
||||||
'PRO_UID' => $record['PRO_UID']
|
'PRO_UID' => $record['PRO_UID']
|
||||||
];
|
];
|
||||||
$arrayData['DEL_INDEX'][] = $record['DEL_INDEX'];
|
$arrayData['DEL_INDEX'][] = $record['DEL_INDEX'];
|
||||||
|
foreach ($result as $record) {
|
||||||
while ($rsCriteria->next()) {
|
|
||||||
$record = $rsCriteria->getRow();
|
|
||||||
|
|
||||||
$arrayData['DEL_INDEX'][] = $record['DEL_INDEX'];
|
$arrayData['DEL_INDEX'][] = $record['DEL_INDEX'];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//Return
|
//Return
|
||||||
return $arrayData;
|
return $arrayData;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
@@ -2493,8 +2486,8 @@ class Cases
|
|||||||
/**
|
/**
|
||||||
* Get status info Case
|
* Get status info Case
|
||||||
*
|
*
|
||||||
* @param string $applicationUid Unique id of Case
|
* @param string $appUid Unique id of Case
|
||||||
* @param int $delIndex Delegation index
|
* @param int $index Delegation index
|
||||||
* @param string $userUid Unique id of User
|
* @param string $userUid Unique id of User
|
||||||
*
|
*
|
||||||
* @return array Return an array with status info Case, array empty otherwise
|
* @return array Return an array with status info Case, array empty otherwise
|
||||||
@@ -2502,179 +2495,120 @@ class Cases
|
|||||||
*
|
*
|
||||||
* @see workflow/engine/methods/cases/main_init.php
|
* @see workflow/engine/methods/cases/main_init.php
|
||||||
* @see workflow/engine/methods/cases/opencase.php
|
* @see workflow/engine/methods/cases/opencase.php
|
||||||
* @see ProcessMaker\BusinessModel\Cases->setCaseVariables()
|
* @see \ProcessMaker\BusinessModel\Cases::setCaseVariables()
|
||||||
* @see ProcessMaker\BusinessModel\Cases\InputDocument->getCasesInputDocuments()
|
* @see \ProcessMaker\BusinessModel\Cases\InputDocument::getCasesInputDocuments()
|
||||||
* @see ProcessMaker\BusinessModel\Cases\InputDocument->throwExceptionIfHaventPermissionToDelete()
|
* @see \ProcessMaker\BusinessModel\Cases\InputDocument::throwExceptionIfHaventPermissionToDelete()
|
||||||
* @see ProcessMaker\BusinessModel\Cases\OutputDocument->throwExceptionIfCaseNotIsInInbox()
|
* @see \ProcessMaker\BusinessModel\Cases\OutputDocument::throwExceptionIfCaseNotIsInInbox()
|
||||||
* @see ProcessMaker\BusinessModel\Cases\OutputDocument->throwExceptionIfHaventPermissionToDelete()
|
* @see \ProcessMaker\BusinessModel\Cases\OutputDocument::throwExceptionIfHaventPermissionToDelete()
|
||||||
*/
|
*/
|
||||||
public function getStatusInfo($applicationUid, $delIndex = 0, $userUid = "")
|
public function getStatusInfo(string $appUid, int $index = 0, string $userUid = "")
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
$arrayData = [];
|
||||||
// Verify data
|
// Verify data
|
||||||
$this->throwExceptionIfNotExistsCase($applicationUid, $delIndex,
|
$this->throwExceptionIfNotExistsCase($appUid, $index, $this->getFieldNameByFormatFieldName("APP_UID"));
|
||||||
$this->getFieldNameByFormatFieldName("APP_UID"));
|
// Get the case number
|
||||||
|
$caseNumber = ModelApplication::getCaseNumber($appUid);
|
||||||
//Get data
|
|
||||||
// Status is PAUSED
|
// Status is PAUSED
|
||||||
$delimiter = DBAdapter::getStringDelimiter();
|
$result = Delay::getPaused($caseNumber, $index, $userUid);
|
||||||
|
if (!empty($result)) {
|
||||||
$criteria = new Criteria("workflow");
|
$arrayData = $this->getStatusInfoFormatted($result, 'PAUSED');
|
||||||
|
|
||||||
$criteria->setDistinct();
|
|
||||||
$criteria->addSelectColumn($delimiter . 'PAUSED' . $delimiter . ' AS APP_STATUS');
|
|
||||||
$criteria->addSelectColumn(AppDelayPeer::APP_DEL_INDEX . " AS DEL_INDEX");
|
|
||||||
$criteria->addSelectColumn(AppDelayPeer::PRO_UID);
|
|
||||||
|
|
||||||
$criteria->add(AppDelayPeer::APP_UID, $applicationUid, Criteria::EQUAL);
|
|
||||||
$criteria->add(AppDelayPeer::APP_TYPE, "PAUSE", Criteria::EQUAL);
|
|
||||||
$criteria->add(
|
|
||||||
$criteria->getNewCriterion(AppDelayPeer::APP_DISABLE_ACTION_USER, null, Criteria::ISNULL)->addOr(
|
|
||||||
$criteria->getNewCriterion(AppDelayPeer::APP_DISABLE_ACTION_USER, 0, Criteria::EQUAL))
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($delIndex != 0) {
|
|
||||||
$criteria->add(AppDelayPeer::APP_DEL_INDEX, $delIndex, Criteria::EQUAL);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($userUid != "") {
|
|
||||||
$criteria->add(AppDelayPeer::APP_DELEGATION_USER, $userUid, Criteria::EQUAL);
|
|
||||||
}
|
|
||||||
|
|
||||||
$rsCriteria = AppDelayPeer::doSelectRS($criteria);
|
|
||||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
|
|
||||||
$arrayData = $this->getStatusInfoDataByRsCriteria($rsCriteria);
|
|
||||||
|
|
||||||
if (!empty($arrayData)) {
|
|
||||||
return $arrayData;
|
return $arrayData;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Status is UNASSIGNED
|
// Status is UNASSIGNED
|
||||||
if ($userUid != '') {
|
$query = Delegation::query()->select([
|
||||||
$appCacheView = new AppCacheView();
|
'APP_DELEGATION.APP_NUMBER',
|
||||||
|
'APP_DELEGATION.DEL_INDEX',
|
||||||
$criteria = $appCacheView->getUnassignedListCriteria($userUid);
|
'APP_DELEGATION.PRO_UID'
|
||||||
} else {
|
]);
|
||||||
$criteria = new Criteria('workflow');
|
$query->taskAssignType('SELF_SERVICE');
|
||||||
|
$query->threadOpen()->withoutUserId();
|
||||||
$criteria->add(AppCacheViewPeer::DEL_FINISH_DATE, null, Criteria::ISNULL);
|
// Filter specific user
|
||||||
$criteria->add(AppCacheViewPeer::USR_UID, '', Criteria::EQUAL);
|
if (!empty($userUid)) {
|
||||||
|
$delegation = new Delegation();
|
||||||
|
$delegation->casesUnassigned($query, $userUid);
|
||||||
}
|
}
|
||||||
|
// Filter specific case
|
||||||
$criteria->setDistinct();
|
$query->case($caseNumber);
|
||||||
$criteria->clearSelectColumns();
|
// Filter specific index
|
||||||
$criteria->addSelectColumn($delimiter . 'UNASSIGNED' . $delimiter . ' AS APP_STATUS');
|
if (is_int($index)) {
|
||||||
$criteria->addSelectColumn(AppCacheViewPeer::DEL_INDEX);
|
$query->index($index);
|
||||||
$criteria->addSelectColumn(AppCacheViewPeer::PRO_UID);
|
|
||||||
|
|
||||||
$criteria->add(AppCacheViewPeer::APP_UID, $applicationUid, Criteria::EQUAL);
|
|
||||||
|
|
||||||
if ($delIndex != 0) {
|
|
||||||
$criteria->add(AppCacheViewPeer::DEL_INDEX, $delIndex, Criteria::EQUAL);
|
|
||||||
}
|
}
|
||||||
|
$results = $query->get();
|
||||||
$rsCriteria = AppCacheViewPeer::doSelectRS($criteria);
|
$arrayData = $results->values()->toArray();
|
||||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
|
|
||||||
$arrayData = $this->getStatusInfoDataByRsCriteria($rsCriteria);
|
|
||||||
|
|
||||||
if (!empty($arrayData)) {
|
if (!empty($arrayData)) {
|
||||||
|
$arrayData = $this->getStatusInfoFormatted($arrayData, 'UNASSIGNED');
|
||||||
return $arrayData;
|
return $arrayData;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Status is TO_DO, DRAFT
|
// Status is TO_DO, DRAFT
|
||||||
$criteria = new Criteria("workflow");
|
$query = Delegation::query()->select([
|
||||||
|
'APPLICATION.APP_STATUS',
|
||||||
$criteria->setDistinct();
|
'APP_DELEGATION.APP_NUMBER',
|
||||||
$criteria->addSelectColumn(ApplicationPeer::APP_STATUS);
|
'APP_DELEGATION.DEL_INDEX',
|
||||||
$criteria->addSelectColumn(ApplicationPeer::PRO_UID);
|
'APP_DELEGATION.PRO_UID'
|
||||||
$criteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
|
]);
|
||||||
|
$query->joinApplication();
|
||||||
$arrayCondition = array();
|
// Filter the status TO_DO and DRAFT
|
||||||
$arrayCondition[] = array(ApplicationPeer::APP_UID, AppDelegationPeer::APP_UID, Criteria::EQUAL);
|
$query->casesInProgress([1, 2]);
|
||||||
$arrayCondition[] = array(
|
// Filter the OPEN thread
|
||||||
ApplicationPeer::APP_UID,
|
$query->threadOpen();
|
||||||
$delimiter . $applicationUid . $delimiter,
|
// Filter specific case
|
||||||
Criteria::EQUAL
|
$query->case($caseNumber);
|
||||||
);
|
// Filter specific index
|
||||||
$criteria->addJoinMC($arrayCondition, Criteria::LEFT_JOIN);
|
if ($index > 0) {
|
||||||
|
$query->index($index);
|
||||||
$criteria->add(
|
|
||||||
$criteria->getNewCriterion(ApplicationPeer::APP_STATUS, "TO_DO", Criteria::EQUAL)->addAnd(
|
|
||||||
$criteria->getNewCriterion(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL))->addAnd(
|
|
||||||
$criteria->getNewCriterion(AppDelegationPeer::DEL_THREAD_STATUS, "OPEN"))
|
|
||||||
)->addOr(
|
|
||||||
$criteria->getNewCriterion(ApplicationPeer::APP_STATUS, "DRAFT", Criteria::EQUAL)->addAnd(
|
|
||||||
$criteria->getNewCriterion(AppDelegationPeer::DEL_THREAD_STATUS, "OPEN"))
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($delIndex != 0) {
|
|
||||||
$criteria->add(AppDelegationPeer::DEL_INDEX, $delIndex, Criteria::EQUAL);
|
|
||||||
}
|
}
|
||||||
|
// Filter specific user
|
||||||
if ($userUid != "") {
|
if (!empty($userUid)) {
|
||||||
$criteria->add(AppDelegationPeer::USR_UID, $userUid, Criteria::EQUAL);
|
$userId = !empty($userUid) ? User::getId($userUid) : 0;
|
||||||
|
$query->userId($userId);
|
||||||
}
|
}
|
||||||
|
$results = $query->get();
|
||||||
$rsCriteria = ApplicationPeer::doSelectRS($criteria);
|
$arrayData = $results->values()->toArray();
|
||||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
|
|
||||||
$arrayData = $this->getStatusInfoDataByRsCriteria($rsCriteria);
|
|
||||||
|
|
||||||
if (!empty($arrayData)) {
|
if (!empty($arrayData)) {
|
||||||
|
$arrayData = $this->getStatusInfoFormatted($arrayData);
|
||||||
return $arrayData;
|
return $arrayData;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Status is CANCELLED, COMPLETED
|
// Status is CANCELLED, COMPLETED
|
||||||
$criteria = new Criteria("workflow");
|
$query = Delegation::query()->select([
|
||||||
|
'APPLICATION.APP_STATUS',
|
||||||
$criteria->addSelectColumn(ApplicationPeer::APP_STATUS);
|
'APP_DELEGATION.APP_NUMBER',
|
||||||
$criteria->addSelectColumn(ApplicationPeer::PRO_UID);
|
'APP_DELEGATION.DEL_INDEX',
|
||||||
$criteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
|
'APP_DELEGATION.PRO_UID'
|
||||||
|
]);
|
||||||
$arrayCondition = array();
|
$query->joinApplication();
|
||||||
$arrayCondition[] = array(ApplicationPeer::APP_UID, AppDelegationPeer::APP_UID, Criteria::EQUAL);
|
// Filter the status COMPLETED and CANCELLED
|
||||||
$arrayCondition[] = array(
|
$query->casesDone([3, 4]);
|
||||||
ApplicationPeer::APP_UID,
|
// Filter specific case
|
||||||
$delimiter . $applicationUid . $delimiter,
|
$query->case($caseNumber);
|
||||||
Criteria::EQUAL
|
// Filter specific index
|
||||||
);
|
if ($index > 0) {
|
||||||
$criteria->addJoinMC($arrayCondition, Criteria::LEFT_JOIN);
|
$query->index($index);
|
||||||
|
|
||||||
if ($delIndex != 0) {
|
|
||||||
$criteria->add(AppDelegationPeer::DEL_INDEX, $delIndex, Criteria::EQUAL);
|
|
||||||
}
|
}
|
||||||
|
// Filter specific user
|
||||||
if ($userUid != "") {
|
if (!empty($userUid)) {
|
||||||
$criteria->add(AppDelegationPeer::USR_UID, $userUid, Criteria::EQUAL);
|
$userId = !empty($userUid) ? User::getId($userUid) : 0;
|
||||||
|
$query->userId($userId);
|
||||||
}
|
}
|
||||||
|
$query->lastThread();
|
||||||
$criteria2 = clone $criteria;
|
$results = $query->get();
|
||||||
|
$arrayData = $results->values()->toArray();
|
||||||
$criteria2->setDistinct();
|
|
||||||
|
|
||||||
$criteria2->add(ApplicationPeer::APP_STATUS, ['CANCELLED', 'COMPLETED'], Criteria::IN);
|
|
||||||
$criteria2->add(AppDelegationPeer::DEL_LAST_INDEX, 1, Criteria::EQUAL);
|
|
||||||
|
|
||||||
$rsCriteria2 = ApplicationPeer::doSelectRS($criteria2);
|
|
||||||
$rsCriteria2->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
|
|
||||||
$arrayData = $this->getStatusInfoDataByRsCriteria($rsCriteria2);
|
|
||||||
|
|
||||||
if (!empty($arrayData)) {
|
if (!empty($arrayData)) {
|
||||||
|
$arrayData = $this->getStatusInfoFormatted($arrayData);
|
||||||
return $arrayData;
|
return $arrayData;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Status is PARTICIPATED
|
// Status is PARTICIPATED
|
||||||
$arrayData = Delegation::getParticipatedInfo($applicationUid);
|
$arrayData = Delegation::getParticipatedInfo($appUid);
|
||||||
|
|
||||||
if (!empty($arrayData)) {
|
if (!empty($arrayData)) {
|
||||||
return $arrayData;
|
return $arrayData;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Return
|
return $arrayData;
|
||||||
return array();
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1493,7 +1493,6 @@ class AbstractCases implements CasesInterface
|
|||||||
/**
|
/**
|
||||||
* Count how many cases has each process
|
* Count how many cases has each process
|
||||||
*
|
*
|
||||||
* @param string $list
|
|
||||||
* @param int $category
|
* @param int $category
|
||||||
* @param bool $topTen
|
* @param bool $topTen
|
||||||
* @param array $processes
|
* @param array $processes
|
||||||
@@ -1528,7 +1527,7 @@ class AbstractCases implements CasesInterface
|
|||||||
$query->topTen('TOTAL', 'DESC');
|
$query->topTen('TOTAL', 'DESC');
|
||||||
}
|
}
|
||||||
if (!empty($processes)) {
|
if (!empty($processes)) {
|
||||||
$query->inProcesses($processes);
|
$query->processInList($processes);
|
||||||
}
|
}
|
||||||
return $query->get()->values()->toArray();
|
return $query->get()->values()->toArray();
|
||||||
}
|
}
|
||||||
@@ -1574,7 +1573,7 @@ class AbstractCases implements CasesInterface
|
|||||||
}
|
}
|
||||||
$query->joinProcess();
|
$query->joinProcess();
|
||||||
if (!is_null($processId)) {
|
if (!is_null($processId)) {
|
||||||
$query->inProcesses([$processId]);
|
$query->processInList([$processId]);
|
||||||
}
|
}
|
||||||
if (!is_null($dateFrom)) {
|
if (!is_null($dateFrom)) {
|
||||||
$query->where('APP_DELEGATION.DEL_DELEGATE_DATE', '>=', $dateFrom);
|
$query->where('APP_DELEGATION.DEL_DELEGATE_DATE', '>=', $dateFrom);
|
||||||
|
|||||||
@@ -30,4 +30,94 @@ class AppDelay extends Model
|
|||||||
'APP_ENABLE_ACTION_DATE',
|
'APP_ENABLE_ACTION_DATE',
|
||||||
'APP_DISABLE_ACTION_DATE',
|
'APP_DISABLE_ACTION_DATE',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scope a query to filter a specific type
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||||
|
* @param string $type
|
||||||
|
* @return \Illuminate\Database\Eloquent\Builder
|
||||||
|
*/
|
||||||
|
public function scopeType($query, string $type = 'PAUSE')
|
||||||
|
{
|
||||||
|
return $query->where('APP_DELAY.APP_TYPE', $type);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Scope a query to filter a specific disable action
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||||
|
* @return \Illuminate\Database\Eloquent\Builder
|
||||||
|
*/
|
||||||
|
public function scopeNotDisabled($query)
|
||||||
|
{
|
||||||
|
return $query->where('APP_DELAY.APP_DISABLE_ACTION_USER', 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scope a query to filter a specific case
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||||
|
* @param int $appNumber
|
||||||
|
* @return \Illuminate\Database\Eloquent\Builder
|
||||||
|
*/
|
||||||
|
public function scopeCase($query, int $appNumber)
|
||||||
|
{
|
||||||
|
return $query->where('APP_DELAY.APP_NUMBER', $appNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scope a query to filter a specific index
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||||
|
* @param int $index
|
||||||
|
* @return \Illuminate\Database\Eloquent\Builder
|
||||||
|
*/
|
||||||
|
public function scopeIndex($query, int $index)
|
||||||
|
{
|
||||||
|
return $query->where('APP_DELAY.APP_DEL_INDEX', $index);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scope a query to filter a specific user
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||||
|
* @param string $user
|
||||||
|
* @return \Illuminate\Database\Eloquent\Builder
|
||||||
|
*/
|
||||||
|
public function scopeDelegateUser($query, string $user)
|
||||||
|
{
|
||||||
|
return $query->where('APP_DELAY.APP_DELEGATION_USER', $user);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the thread paused
|
||||||
|
*
|
||||||
|
* @param int $appNumber
|
||||||
|
* @param int $index
|
||||||
|
* @param string $userUid
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public static function getPaused(int $appNumber, int $index, string $userUid = '')
|
||||||
|
{
|
||||||
|
$query = AppDelay::query()->select([
|
||||||
|
'APP_NUMBER',
|
||||||
|
'APP_DEL_INDEX AS DEL_INDEX',
|
||||||
|
'PRO_UID'
|
||||||
|
]);
|
||||||
|
$query->type('PAUSE')->notDisabled();
|
||||||
|
$query->case($appNumber);
|
||||||
|
// Filter specific index
|
||||||
|
if ($index > 0) {
|
||||||
|
$query->index($index);
|
||||||
|
}
|
||||||
|
// Filter specific delegate user
|
||||||
|
if (!empty($userUid)) {
|
||||||
|
$query->delegateUser($userUid);
|
||||||
|
}
|
||||||
|
// Get the result
|
||||||
|
$results = $query->get();
|
||||||
|
|
||||||
|
return $results->values()->toArray();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -173,18 +173,6 @@ class Delegation extends Model
|
|||||||
return $query->where('DEL_INDEX', '=', 1);
|
return $query->where('DEL_INDEX', '=', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Scope a query to get the in-progress
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
|
||||||
*
|
|
||||||
* @return \Illuminate\Database\Eloquent\Builder
|
|
||||||
*/
|
|
||||||
public function scopeCaseInProgress($query)
|
|
||||||
{
|
|
||||||
return $query->statusIds([Application::STATUS_DRAFT, Application::STATUS_TODO]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scope a query to get the to_do cases
|
* Scope a query to get the to_do cases
|
||||||
*
|
*
|
||||||
@@ -777,19 +765,6 @@ class Delegation extends Model
|
|||||||
return $query->whereIn('APP_DELEGATION.PRO_ID', $processes);
|
return $query->whereIn('APP_DELEGATION.PRO_ID', $processes);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Scope where in processes
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
|
||||||
* @param array $processes
|
|
||||||
*
|
|
||||||
* @return \Illuminate\Database\Eloquent\Builder
|
|
||||||
*/
|
|
||||||
public function scopeInProcesses($query, array $processes)
|
|
||||||
{
|
|
||||||
return $query->whereIn('PROCESS.PRO_ID', $processes);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scope the Inbox cases
|
* Scope the Inbox cases
|
||||||
*
|
*
|
||||||
@@ -812,26 +787,6 @@ class Delegation extends Model
|
|||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Scope the Inbox cases
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
|
||||||
*
|
|
||||||
* @return \Illuminate\Database\Eloquent\Builder
|
|
||||||
*/
|
|
||||||
public function scopeInboxWithoutUser($query)
|
|
||||||
{
|
|
||||||
// This scope is for the join with the APP_DELEGATION table
|
|
||||||
$query->joinApplication();
|
|
||||||
$query->status(Application::STATUS_TODO);
|
|
||||||
// Scope for the restriction of the task that must not be searched for
|
|
||||||
$query->excludeTaskTypes(Task::DUMMY_TASKS);
|
|
||||||
// Scope that establish that the DEL_THREAD_STATUS must be OPEN
|
|
||||||
$query->threadOpen();
|
|
||||||
|
|
||||||
return $query;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scope a self service cases
|
* Scope a self service cases
|
||||||
*
|
*
|
||||||
@@ -1417,7 +1372,7 @@ class Delegation extends Model
|
|||||||
* @param string $appUid
|
* @param string $appUid
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
* @see \ProcessMaker\BusinessModel\Cases:getStatusInfo()
|
* @see \ProcessMaker\BusinessModel\Cases::getStatusInfo()
|
||||||
*/
|
*/
|
||||||
public static function getParticipatedInfo($appUid)
|
public static function getParticipatedInfo($appUid)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user