Merged in bugfix/PMCORE-3674 (pull request #8394)
PMCORE-3674 Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
@@ -10,7 +10,7 @@ $factory->define(\ProcessMaker\Model\Process::class, function (Faker $faker) {
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'PRO_UID' => G::generateUniqueID(),
|
'PRO_UID' => G::generateUniqueID(),
|
||||||
'PRO_ID' => $faker->unique()->numberBetween(1000),
|
'PRO_ID' => $faker->unique()->numberBetween(2000),
|
||||||
'PRO_TITLE' => $faker->sentence(3),
|
'PRO_TITLE' => $faker->sentence(3),
|
||||||
'PRO_DESCRIPTION' => $faker->paragraph(3),
|
'PRO_DESCRIPTION' => $faker->paragraph(3),
|
||||||
'PRO_PARENT' => G::generateUniqueID(),
|
'PRO_PARENT' => G::generateUniqueID(),
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the capitalize() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.1/ProcessMaker_Functions#capitalize.28.29
|
||||||
|
*/
|
||||||
|
class CapitalizeTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* This tests the "capitalize"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_get_lower_case()
|
||||||
|
{
|
||||||
|
$result = capitalize('test');
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the formatDate() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.1/ProcessMaker_Functions#formatDate.28.29
|
||||||
|
*/
|
||||||
|
class FormatDateTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* This tests the "formatDate"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_get_format_date()
|
||||||
|
{
|
||||||
|
$result = formatDate(date('Y-m-d'), 'yyyy-mm-dd');
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests the "formatDate"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_get_exceptions()
|
||||||
|
{
|
||||||
|
$this->expectException(Exception::class);
|
||||||
|
$result = formatDate('');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the generateCode() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.1/ProcessMaker_Functions#generateCode.28.29
|
||||||
|
*/
|
||||||
|
class GenerateCodeTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* This tests the "generateCode"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_get_code()
|
||||||
|
{
|
||||||
|
$result = generateCode();
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the getCurrentDate() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.1/ProcessMaker_Functions#getCurrentDate.28.29
|
||||||
|
*/
|
||||||
|
class GetCurrentDateTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* This tests the "getCurrentDate"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_get_current_date()
|
||||||
|
{
|
||||||
|
$result = getCurrentDate();
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the getCurrentTime() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.1/ProcessMaker_Functions#getCurrentTime.28.29
|
||||||
|
*/
|
||||||
|
class GetCurrentTimeTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* This tests the "getCurrentTime"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_get_current_date()
|
||||||
|
{
|
||||||
|
$result = getCurrentTime();
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the literalDate() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.1/ProcessMaker_Functions#literalDate.28.29
|
||||||
|
*/
|
||||||
|
class LiteralDateTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* This tests the "literalDate"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_get_literal_date()
|
||||||
|
{
|
||||||
|
$result = literalDate(date('Y-m-d'), 'en');
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
$result = literalDate(date('Y-m-d'), 'es');
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests the "literalDate"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_get_exceptions()
|
||||||
|
{
|
||||||
|
$this->expectException(Exception::class);
|
||||||
|
$result = literalDate('');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the lowerCase() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.1/ProcessMaker_Functions#lowerCase.28.29
|
||||||
|
*/
|
||||||
|
class LowerCaseTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* This tests the "lowerCase"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_get_lower_case()
|
||||||
|
{
|
||||||
|
$result = lowerCase('TEST');
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the orderGrid() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.1/ProcessMaker_Functions#generateCode.28.29
|
||||||
|
*/
|
||||||
|
class OrderGridTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* This tests the "orderGrid"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_test_order_grid()
|
||||||
|
{
|
||||||
|
$grid = [];
|
||||||
|
$grid[1]['NAME'] = 'Jhon';
|
||||||
|
$grid[1]['AGE'] = 27;
|
||||||
|
$grid[2]['NAME'] = 'Louis';
|
||||||
|
$grid[2]['AGE'] = 5;
|
||||||
|
$result = orderGrid($grid, 'AGE', 'ASC');
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
$result = orderGrid($result, 'AGE', 'DESC');
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\Delegation;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFAddCaseNote() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.2/ProcessMaker_Functions/Case_Notes_Functions#PMFGetCaseNotes.28.29
|
||||||
|
*/
|
||||||
|
class PMFAddCaseNoteTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests if the "PMFAddCaseNote"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_add_case_notes()
|
||||||
|
{
|
||||||
|
// Create notes
|
||||||
|
$table = factory(Delegation::class)->states('foreign_keys')->create();
|
||||||
|
// Force commit for propel
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFAddCaseNote($table->APP_UID, $table->PRO_UID, $table->TAS_UID, $table->USR_UID, 'note');
|
||||||
|
$this->assertTrue($result >= 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\Groupwf;
|
||||||
|
use ProcessMaker\Model\RbacUsers;
|
||||||
|
use ProcessMaker\Model\User;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFAssignUserToGroup() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.2/ProcessMaker_Functions/Group_Functions#PMFAssignUserToGroup.28.29
|
||||||
|
*/
|
||||||
|
class PMFAssignUserToGroupTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests if the "PMFAssignUserToGroup"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_assign_user_to_group()
|
||||||
|
{
|
||||||
|
// Create user
|
||||||
|
global $RBAC;
|
||||||
|
$user = factory(User::class)->create();
|
||||||
|
factory(RbacUsers::class)->create([
|
||||||
|
'USR_UID' => $user->USR_UID,
|
||||||
|
'USR_USERNAME' => $user->USR_USERNAME,
|
||||||
|
'USR_FIRSTNAME' => $user->USR_FIRSTNAME,
|
||||||
|
'USR_LASTNAME' => $user->USR_LASTNAME
|
||||||
|
]);
|
||||||
|
// Create group
|
||||||
|
$group = factory(Groupwf::class)->create();
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFAssignUserToGroup($user->USR_UID, $group->GRP_UID);
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,7 +6,6 @@ use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use ProcessMaker\Model\Application;
|
use ProcessMaker\Model\Application;
|
||||||
use ProcessMaker\Model\Delegation;
|
use ProcessMaker\Model\Delegation;
|
||||||
use RBAC;
|
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\AppThread;
|
||||||
|
use ProcessMaker\Model\Delegation;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFCaseList() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.7/ProcessMaker_Functions/Case_Functions#PMFCaseList.28.29
|
||||||
|
*/
|
||||||
|
class PMFCaseListTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests if the "PMFCaseList"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_list_of_cases()
|
||||||
|
{
|
||||||
|
// Create delegation
|
||||||
|
$table = factory(Delegation::class)->states('foreign_keys')->create();
|
||||||
|
factory(AppThread::class)->create([
|
||||||
|
'APP_THREAD_STATUS' => 'OPEN',
|
||||||
|
'APP_UID' => $table->APP_UID
|
||||||
|
]);
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFCaseList($table->USR_UID);
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\RbacUsers;
|
||||||
|
use ProcessMaker\Model\User;
|
||||||
|
use RBAC;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFCreateUser() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.7/ProcessMaker_Functions/User_Functions#PMFCreateUser.28.29
|
||||||
|
*/
|
||||||
|
class PMFCreateUserTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests the "PMFCreateUser"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_create_user()
|
||||||
|
{
|
||||||
|
// Create User
|
||||||
|
$user = factory(User::class)->create();
|
||||||
|
factory(RbacUsers::class)->create([
|
||||||
|
'USR_UID' => $user->USR_UID,
|
||||||
|
'USR_USERNAME' => $user->USR_USERNAME,
|
||||||
|
'USR_FIRSTNAME' => $user->USR_FIRSTNAME,
|
||||||
|
'USR_LASTNAME' => $user->USR_LASTNAME
|
||||||
|
]);
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFCreateUser('jsmith', 'PaSsWoRd', 'John', 'Smith', 'jsmith@company.com', 'PROCESSMAKER_OPERATOR');
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\Triggers;
|
||||||
|
use ProcessMaker\Model\Delegation;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFDeleteCase() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.7/ProcessMaker_Functions/Case_Functions#PMFDeleteCase.28.29
|
||||||
|
*/
|
||||||
|
class PMFDeleteCaseTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It tests the PMFDeleteCaseTest() function with the default parameters
|
||||||
|
*
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_should_test_this_pmfunction_default_parameters()
|
||||||
|
{
|
||||||
|
$this->expectException(Exception::class);
|
||||||
|
$table = factory(Delegation::class)->states('foreign_keys')->create();
|
||||||
|
factory(Triggers::class)->create([
|
||||||
|
'PRO_UID' => $table->PRO_UID
|
||||||
|
]);
|
||||||
|
// Force commit for propel
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFDeleteCase($table->APP_UID);
|
||||||
|
$this->assertEquals(0, $result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\AppNotes;
|
||||||
|
use ProcessMaker\Model\User;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFGetCaseNotes() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.2/ProcessMaker_Functions/Case_Notes_Functions#PMFGetCaseNotes.28.29
|
||||||
|
*/
|
||||||
|
class PMFGetCaseNotesTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests if the "PMFGetCaseNotes"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_get_case_notes()
|
||||||
|
{
|
||||||
|
// Create notes
|
||||||
|
$user = factory(User::class)->create();
|
||||||
|
$table = factory(AppNotes::class)->create([
|
||||||
|
'USR_UID' => $user->USR_UID
|
||||||
|
]);
|
||||||
|
// Force commit for propel
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFGetCaseNotes($table->APP_UID, 'array');
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
$result = PMFGetCaseNotes($table->APP_UID, 'object');
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
$result = PMFGetCaseNotes($table->APP_UID, 'string');
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\Groupwf;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFGetGroupName() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.1/ProcessMaker_Functions#PMFGetGroupName.28.29
|
||||||
|
*/
|
||||||
|
class PMFGetGroupNameTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests if the "PMFGetGroupName"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_get_group_name()
|
||||||
|
{
|
||||||
|
// Create group
|
||||||
|
$group = factory(Groupwf::class)->create();
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFGetGroupName($group->GRP_TITLE, 'en');
|
||||||
|
$this->assertFalse($result);
|
||||||
|
// When is empty
|
||||||
|
$result = PMFGetGroupName('');
|
||||||
|
$this->assertFalse($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use ProcessMaker\Model\Groupwf;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFGetGroupUID() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.1/ProcessMaker_Functions#PMFGetGroupUID.28.29
|
||||||
|
*/
|
||||||
|
class PMFGetGroupUIDTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests if the "PMFGetGroupUID"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_group_uid()
|
||||||
|
{
|
||||||
|
// Create group
|
||||||
|
$group = factory(Groupwf::class)->create();
|
||||||
|
$result = PMFGetGroupUID($group->GRP_UID);
|
||||||
|
$this->assertFalse($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\Groupwf;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFGetGroupUsers() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.1/ProcessMaker_Functions#PMFGetGroupUsers.28.29
|
||||||
|
*/
|
||||||
|
class PMFGetGroupUsersTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests if the "PMFGetGroupUsers"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_list_of_groups()
|
||||||
|
{
|
||||||
|
// Create group
|
||||||
|
$group = factory(Groupwf::class)->create();
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFGetGroupUsers($group->GRP_UID);
|
||||||
|
$this->assertEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\Process;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFGetProcessUidByName() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.2/ProcessMaker_Functions/Process_Functions#PMFGetProcessUidByName.28.29
|
||||||
|
*/
|
||||||
|
class PMFGetProcessUidByNameTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests if the "PMFGetProcessUidByName"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_process()
|
||||||
|
{
|
||||||
|
// Create process
|
||||||
|
$table = factory(Process::class)->create();
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFGetProcessUidByName($table->PRO_TITLE);
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
// When a process was defined in the session
|
||||||
|
$result = PMFGetProcessUidByName('');
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
// When does not defined the session
|
||||||
|
$_SESSION['PROCESS'] = '';
|
||||||
|
$result = PMFGetProcessUidByName('');
|
||||||
|
$this->assertEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\Task;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFGetTaskName() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.1/ProcessMaker_Functions#PMFGetTaskName.28.29
|
||||||
|
*/
|
||||||
|
class PMFGetTaskNameTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests if the "PMFGetTaskName"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_task_name()
|
||||||
|
{
|
||||||
|
// Create task
|
||||||
|
$task = factory(Task::class)->create();
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFGetTaskName($task->TAS_UID);
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
// When is empty
|
||||||
|
$result = PMFGetTaskName('');
|
||||||
|
$this->assertFalse($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\Task;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFGetTaskUID() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.1/ProcessMaker_Functions#PMFGetTaskUID.28.29
|
||||||
|
*/
|
||||||
|
class PMFGetTaskUIDTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests if the "PMFGetTaskUID"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_task_uid()
|
||||||
|
{
|
||||||
|
// Create task
|
||||||
|
$table = factory(Task::class)->states('foreign_keys')->create();
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFGetTaskUID($table->TAS_TITLE);
|
||||||
|
$this->assertFalse($result);
|
||||||
|
// When is empty
|
||||||
|
$result = PMFGetTaskUID($table->TAS_TITLE, $table->PRO_UID);
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\User;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFGetUserEmailAddress() function
|
||||||
|
*/
|
||||||
|
class PMFGetUserEmailAddressTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests the "PMFGetUserEmailAddress"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_get_user_mail()
|
||||||
|
{
|
||||||
|
// Create User
|
||||||
|
global $RBAC;
|
||||||
|
$user = factory(User::class)->create();
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFGetUserEmailAddress([$user->USR_UID], null);
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\Groupwf;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFGroupList() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.2/ProcessMaker_Functions/Group_Functions#PMFGroupList.28.29
|
||||||
|
*/
|
||||||
|
class PMFGroupListTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests if the "PMFGroupList"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_list_of_groups()
|
||||||
|
{
|
||||||
|
// Create group
|
||||||
|
factory(Groupwf::class)->create();
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFGroupList();
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\User;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFInformationUser() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.2/ProcessMaker_Functions/User_Functions#PMFInformationUser.28.29
|
||||||
|
*/
|
||||||
|
class PMFInformationUserTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests if the "PMFInformationUser"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_list_of_process()
|
||||||
|
{
|
||||||
|
// Create User
|
||||||
|
global $RBAC;
|
||||||
|
$user = factory(User::class)->create();
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFInformationUser($user->USR_UID);
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\Application;
|
||||||
|
use ProcessMaker\Model\Delegation;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFNewCaseImpersonate() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.1/ProcessMaker_Functions#PMFNewCaseImpersonate.28.29
|
||||||
|
*/
|
||||||
|
class PMFNewCaseImpersonateTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It tests the PMFNewCaseImpersonateTest() function with the default parameters
|
||||||
|
*
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_should_test_this_pmfunction_default_parameters()
|
||||||
|
{
|
||||||
|
$table = factory(Delegation::class)->states('foreign_keys')->create();
|
||||||
|
// Force commit for propel
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFNewCaseImpersonate($table->PRO_UID, $table->USR_UID, [], '');
|
||||||
|
$this->assertEquals(0, $result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\Application;
|
||||||
|
use ProcessMaker\Model\Delegation;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFNewCase() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.1/ProcessMaker_Functions#PMFNewCase.28.29
|
||||||
|
*/
|
||||||
|
class PMFNewCaseTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It tests the PMFNewCaseTest() function with the default parameters
|
||||||
|
*
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_should_test_this_pmfunction_default_parameters()
|
||||||
|
{
|
||||||
|
$table = factory(Delegation::class)->states('foreign_keys')->create();
|
||||||
|
// Force commit for propel
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFNewCase($table->PRO_UID, $table->USR_UID, $table->TAS_UID, [], null);
|
||||||
|
$this->assertEquals(0, $result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
use ProcessMaker\Model\GroupUser;
|
use ProcessMaker\Model\GroupUser;
|
||||||
use ProcessMaker\Model\Groupwf;
|
use ProcessMaker\Model\Groupwf;
|
||||||
use ProcessMaker\Model\RbacUsers;
|
use ProcessMaker\Model\RbacUsers;
|
||||||
@@ -9,6 +11,9 @@ use ProcessMaker\Model\User;
|
|||||||
use RBAC;
|
use RBAC;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFNewUserTest() function
|
||||||
|
*/
|
||||||
class PMFNewUserTest extends TestCase
|
class PMFNewUserTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -53,10 +58,11 @@ class PMFNewUserTest extends TestCase
|
|||||||
|
|
||||||
$group = factory(Groupwf::class)->create();
|
$group = factory(Groupwf::class)->create();
|
||||||
|
|
||||||
|
// Active
|
||||||
$result = PMFNewUser("test", "Test123*", "test", "test", "test@test.com", "PROCESSMAKER_ADMIN", null, null, $group['GRP_UID']);
|
$result = PMFNewUser("test", "Test123*", "test", "test", "test@test.com", "PROCESSMAKER_ADMIN", null, null, $group['GRP_UID']);
|
||||||
|
|
||||||
$query = GroupUser::select();
|
$query = GroupUser::select();
|
||||||
$r = $query->get()->values()->toArray();
|
$r = $query->where('GRP_UID', $group['GRP_UID'])->get()->values()->toArray();
|
||||||
|
|
||||||
$this->assertEquals($r[0]['GRP_UID'], $result['groupUid']);
|
$this->assertEquals($r[0]['GRP_UID'], $result['groupUid']);
|
||||||
$this->assertEquals($r[0]['USR_UID'], $result['userUid']);
|
$this->assertEquals($r[0]['USR_UID'], $result['userUid']);
|
||||||
@@ -67,6 +73,14 @@ class PMFNewUserTest extends TestCase
|
|||||||
$this->assertNotEmpty($r);
|
$this->assertNotEmpty($r);
|
||||||
$this->assertEquals($result['userUid'], $r[0]['USR_UID']);
|
$this->assertEquals($result['userUid'], $r[0]['USR_UID']);
|
||||||
$this->assertEquals($result['username'], $r[0]['USR_USERNAME']);
|
$this->assertEquals($result['username'], $r[0]['USR_USERNAME']);
|
||||||
|
|
||||||
|
// Vacation
|
||||||
|
$result = PMFNewUser("test11", "Test123*", "test", "test", "test@test.com", "PROCESSMAKER_ADMIN", null, 'VACATION', $group['GRP_UID']);
|
||||||
|
$this->assertEquals('VACATION', $result['status']);
|
||||||
|
|
||||||
|
// Inactive
|
||||||
|
$result = PMFNewUser("test22", "Test123*", "test", "test", "test@test.com", "PROCESSMAKER_ADMIN", null, 'INACTIVE', $group['GRP_UID']);
|
||||||
|
$this->assertEquals('INACTIVE', $result['status']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use ProcessMaker\Model\Process;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFProcessList() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.2/ProcessMaker_Functions/Process_Functions#PMFProcessList.28.29
|
||||||
|
*/
|
||||||
|
class PMFProcessListTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests if the "PMFProcessList"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_list_of_process()
|
||||||
|
{
|
||||||
|
// Create delegation
|
||||||
|
factory(Process::class)->create();
|
||||||
|
$result = PMFProcessList();
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFRemoveMask() function
|
||||||
|
*/
|
||||||
|
class PMFRemoveMaskTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* This tests the "PMFRemoveMask"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_get_literal_date()
|
||||||
|
{
|
||||||
|
$result = PMFRemoveMask('35.5');
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\GroupUser;
|
||||||
|
use ProcessMaker\Model\Groupwf;
|
||||||
|
use ProcessMaker\Model\User;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFGetGroupUsers() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.1/ProcessMaker_Functions#PMFGetGroupUsers.28.29
|
||||||
|
*/
|
||||||
|
class PMFRemoveUsersFromGroupTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests if the "PMFRemoveUsersFromGroup"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_remove_user_group()
|
||||||
|
{
|
||||||
|
// Create group
|
||||||
|
$user = factory(User::class)->create();
|
||||||
|
$group = factory(Groupwf::class)->create();
|
||||||
|
$groupUser = factory(GroupUser::class)->create([
|
||||||
|
'GRP_UID' => $group->GRP_UID,
|
||||||
|
'GRP_ID' => $group->GRP_ID,
|
||||||
|
'USR_UID' =>$user->USR_UID
|
||||||
|
]);
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFRemoveUsersFromGroup($groupUser->GRP_UID, [$groupUser->USR_UID]);
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\GroupUser;
|
||||||
|
use ProcessMaker\Model\Groupwf;
|
||||||
|
use ProcessMaker\Model\User;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFGetGroupUsers() function
|
||||||
|
*
|
||||||
|
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFRemoveUsersToGroup.28.29
|
||||||
|
*/
|
||||||
|
class PMFRemoveUsersToGroupTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests if the "PMFRemoveUsersToGroup"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_remove_user_group()
|
||||||
|
{
|
||||||
|
// Create group
|
||||||
|
$user = factory(User::class)->create();
|
||||||
|
$group = factory(Groupwf::class)->create();
|
||||||
|
$groupUser = factory(GroupUser::class)->create([
|
||||||
|
'GRP_UID' => $group->GRP_UID,
|
||||||
|
'GRP_ID' => $group->GRP_ID,
|
||||||
|
'USR_UID' =>$user->USR_UID
|
||||||
|
]);
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFRemoveUsersToGroup($groupUser->GRP_UID, [$groupUser->USR_UID]);
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\RbacRoles;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFRoleList() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.2/ProcessMaker_Functions/Group_Functions#PMFRoleList.28.29
|
||||||
|
*/
|
||||||
|
class PMFRoleListTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests if the "PMFRoleList"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_list_of_roles()
|
||||||
|
{
|
||||||
|
// Create roles
|
||||||
|
global $RBAC;
|
||||||
|
factory(RbacRoles::class)->create();
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFRoleList();
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\Delegation;
|
||||||
|
use ProcessMaker\Model\Task;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFTaskCase() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.3/ProcessMaker_Functions/Case_Functions#PMFTaskCase.28.29
|
||||||
|
*/
|
||||||
|
class PMFTaskCaseTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests if the "PMFTaskCase"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_pending_tasks()
|
||||||
|
{
|
||||||
|
$task = factory(Task::class)->create();
|
||||||
|
$table = factory(Delegation::class)->states('foreign_keys')->create([
|
||||||
|
'TAS_ID' => $task->TAS_ID,
|
||||||
|
'TAS_UID' => $task->TAS_UID
|
||||||
|
]);
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFTaskCase($table->APP_UID);
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\Task;
|
||||||
|
use ProcessMaker\Model\TaskUser;
|
||||||
|
use ProcessMaker\Model\User;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFTaskList() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.2/ProcessMaker_Functions/Task_Functions#PMFTaskList.28.29
|
||||||
|
*/
|
||||||
|
class PMFTaskListTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests if the "PMFTaskList"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_pending_tasks()
|
||||||
|
{
|
||||||
|
// Create task
|
||||||
|
$task = factory(Task::class)->create();
|
||||||
|
// Create user
|
||||||
|
$user = factory(User::class)->create();
|
||||||
|
// Assign a user in the task
|
||||||
|
factory(TaskUser::class)->create([
|
||||||
|
'TAS_UID' => $task->TAS_UID,
|
||||||
|
'USR_UID' => $user->USR_UID,
|
||||||
|
'TU_RELATION' => 1, //Related to the user
|
||||||
|
'TU_TYPE' => 1
|
||||||
|
]);
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFTaskList($user->USR_UID);
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\Task;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFTasksListByProcessId() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.2/ProcessMaker_Functions/Task_Functions#PMFTaskList.28.29
|
||||||
|
*/
|
||||||
|
class PMFTasksListByProcessIdTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests if the "PMFTasksListByProcessId"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_process_tasks()
|
||||||
|
{
|
||||||
|
// Create task
|
||||||
|
$task = factory(Task::class)->create();
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFTasksListByProcessId($task->PRO_UID);
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\Application;
|
||||||
|
use ProcessMaker\Model\Delegation;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFUnpauseCase() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.1/ProcessMaker_Functions#PMFUnpauseCase.28.29
|
||||||
|
*/
|
||||||
|
class PMFUnpauseCaseTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It tests the PMFUnpauseCaseTest() function with the default parameters
|
||||||
|
*
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_should_test_this_pmfunction_default_parameters()
|
||||||
|
{
|
||||||
|
$this->expectException(Exception::class);
|
||||||
|
$table = factory(Delegation::class)->states('foreign_keys')->create();
|
||||||
|
// Force commit for propel
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFUnpauseCase($table->APP_UID, $table->DEL_INDEX, $table->USR_UID);
|
||||||
|
$this->assertEquals(0, $result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\User;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFUpdateUser() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.1/ProcessMaker_Functions#PMFUpdateUser.28.29
|
||||||
|
*/
|
||||||
|
class PMFUpdateUserTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests the "PMFUpdateUser"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_update_user()
|
||||||
|
{
|
||||||
|
// Create User
|
||||||
|
global $RBAC;
|
||||||
|
$user = factory(User::class)->create();
|
||||||
|
DB::commit();
|
||||||
|
$result = PMFUpdateUser($user->USR_UID, $user->USR_USERNAME, 'John A.');
|
||||||
|
$this->assertEquals(0, $result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use ProcessMaker\Model\User;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the PMFUserList() function
|
||||||
|
*
|
||||||
|
* @link https://wiki.processmaker.com/3.2/ProcessMaker_Functions/User_Functions#PMFUserList.28.29
|
||||||
|
*/
|
||||||
|
class PMFUserListTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests if the "PMFUserList"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_list_of_users()
|
||||||
|
{
|
||||||
|
// Create user
|
||||||
|
$user = factory(User::class)->create();
|
||||||
|
$result = PMFUserList();
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the pmSqlEscape() function
|
||||||
|
*/
|
||||||
|
class PmSqlEscapeTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* This tests the "pmSqlEscape"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_get_sql_escape()
|
||||||
|
{
|
||||||
|
$value = 'select uid from user';
|
||||||
|
$result = pmSqlEscape($value);
|
||||||
|
$this->assertEquals($result, $value);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the pmToFloat() function
|
||||||
|
*/
|
||||||
|
class PmToFloatTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* This tests the "pmToFloat"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_get_float()
|
||||||
|
{
|
||||||
|
$value = '1.2';
|
||||||
|
$result = pmToFloat($value);
|
||||||
|
$this->assertEquals($result, 1.2);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the pmToInteger() function
|
||||||
|
*/
|
||||||
|
class PmToIntegerTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* This tests the "pmToInteger"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_get_int()
|
||||||
|
{
|
||||||
|
$value = '1';
|
||||||
|
$result = pmToInteger($value);
|
||||||
|
$this->assertEquals($result, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the pmToString() function
|
||||||
|
*/
|
||||||
|
class PmToStringTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* This tests the "pmToString"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_get_string()
|
||||||
|
{
|
||||||
|
$value = 1;
|
||||||
|
$result = pmToString($value);
|
||||||
|
$this->assertEquals($result, '1');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the pmToUrl() function
|
||||||
|
*/
|
||||||
|
class PmToUrlTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* This tests the "pmToUrl"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_get_url()
|
||||||
|
{
|
||||||
|
$value = 'home';
|
||||||
|
$result = pmToUrl($value);
|
||||||
|
$this->assertEquals($result, $value);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the upperCase() function
|
||||||
|
*/
|
||||||
|
class UpperCaseTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* This tests the "upperCase"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_get_upper_case()
|
||||||
|
{
|
||||||
|
$result = upperCase('test');
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use ProcessMaker\Model\User;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the userInfo() function
|
||||||
|
*/
|
||||||
|
class UserInfoTest extends TestCase
|
||||||
|
{
|
||||||
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This tests the "userInfo"
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_get_user_info()
|
||||||
|
{
|
||||||
|
// Create User
|
||||||
|
global $RBAC;
|
||||||
|
$user = factory(User::class)->create();
|
||||||
|
DB::commit();
|
||||||
|
$result = userInfo($user->USR_UID);
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7079,7 +7079,7 @@ class Cases
|
|||||||
* @return array|stdclass|string
|
* @return array|stdclass|string
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function getCaseNotes($applicationID, $type = 'array', $userUid = '')
|
public static function getCaseNotes($applicationID, $type = 'array', $userUid = '')
|
||||||
{
|
{
|
||||||
require_once("classes/model/AppNotes.php");
|
require_once("classes/model/AppNotes.php");
|
||||||
$appNotes = new AppNotes();
|
$appNotes = new AppNotes();
|
||||||
@@ -7108,6 +7108,7 @@ class Cases
|
|||||||
case 'object':
|
case 'object':
|
||||||
$response = new stdclass();
|
$response = new stdclass();
|
||||||
foreach ($appNotes['array']['notes'] as $key => $value) {
|
foreach ($appNotes['array']['notes'] as $key => $value) {
|
||||||
|
$response->$key = new stdclass();
|
||||||
$response->$key->FULL_NAME = $value['USR_FIRSTNAME'] . " " . $value['USR_LASTNAME'];
|
$response->$key->FULL_NAME = $value['USR_FIRSTNAME'] . " " . $value['USR_LASTNAME'];
|
||||||
foreach ($value as $keys => $value) {
|
foreach ($value as $keys => $value) {
|
||||||
if ($keys != 'USR_FIRSTNAME' && $keys != 'USR_LASTNAME' && $keys != 'USR_EMAIL') {
|
if ($keys != 'USR_FIRSTNAME' && $keys != 'USR_LASTNAME' && $keys != 'USR_EMAIL') {
|
||||||
|
|||||||
@@ -1204,7 +1204,9 @@ class WsBase
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
global $RBAC;
|
global $RBAC;
|
||||||
|
if (is_null($RBAC)) {
|
||||||
|
$RBAC = RBAC::getSingleton();
|
||||||
|
}
|
||||||
$RBAC->initRBAC();
|
$RBAC->initRBAC();
|
||||||
|
|
||||||
if (empty($userName)) {
|
if (empty($userName)) {
|
||||||
@@ -1715,6 +1717,9 @@ class WsBase
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
global $RBAC;
|
global $RBAC;
|
||||||
|
if (is_null($RBAC)) {
|
||||||
|
$RBAC = RBAC::getSingleton();
|
||||||
|
}
|
||||||
$RBAC->initRBAC();
|
$RBAC->initRBAC();
|
||||||
$user = $RBAC->verifyUserId($userId);
|
$user = $RBAC->verifyUserId($userId);
|
||||||
|
|
||||||
|
|||||||
@@ -540,10 +540,12 @@ function WSLogin ($user, $pass, $endpoint = "")
|
|||||||
{
|
{
|
||||||
$client = WSOpen(true);
|
$client = WSOpen(true);
|
||||||
|
|
||||||
$params = array ("userid" => $user,"password" => $pass
|
$params = array(
|
||||||
|
"userid" => $user, "password" => $pass
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = $client->__soapCall( "login", array ($params
|
$result = $client->__soapCall("login", array(
|
||||||
|
$params
|
||||||
));
|
));
|
||||||
|
|
||||||
if ($result->status_code == 0) {
|
if ($result->status_code == 0) {
|
||||||
@@ -638,27 +640,31 @@ function WSTaskCase ($caseId)
|
|||||||
$client = WSOpen();
|
$client = WSOpen();
|
||||||
|
|
||||||
$sessionId = $_SESSION["WS_SESSION_ID"];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
$params = array ("sessionId" => $sessionId,"caseId" => $caseId
|
$params = array(
|
||||||
|
"sessionId" => $sessionId, "caseId" => $caseId
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = $client->__soapCall( "taskCase", array ($params
|
$result = $client->__soapCall("taskCase", array(
|
||||||
|
$params
|
||||||
));
|
));
|
||||||
|
|
||||||
$rows = array ();
|
$rows = [];
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
if (isset($result->taskCases)) {
|
if (isset($result->taskCases)) {
|
||||||
//Processing when it is an array
|
//Processing when it is an array
|
||||||
if (is_array($result->taskCases)) {
|
if (is_array($result->taskCases)) {
|
||||||
foreach ($result->taskCases as $key => $obj) {
|
foreach ($result->taskCases as $key => $obj) {
|
||||||
$rows[$i] = array ("guid" => $obj->guid,"name" => $obj->name
|
$rows[$i] = array(
|
||||||
|
"guid" => $obj->guid, "name" => $obj->name
|
||||||
);
|
);
|
||||||
$i = $i + 1;
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Processing when it is an object //1 row
|
//Processing when it is an object //1 row
|
||||||
if (is_object($result->taskCases)) {
|
if (is_object($result->taskCases)) {
|
||||||
$rows[$i] = array ("guid" => $result->taskCases->guid,"name" => $result->taskCases->name
|
$rows[$i] = array(
|
||||||
|
"guid" => $result->taskCases->guid, "name" => $result->taskCases->name
|
||||||
);
|
);
|
||||||
$i = $i + 1;
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
@@ -687,27 +693,31 @@ function WSTaskList ()
|
|||||||
$client = WSOpen();
|
$client = WSOpen();
|
||||||
|
|
||||||
$sessionId = $_SESSION["WS_SESSION_ID"];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
$params = array ("sessionId" => $sessionId
|
$params = array(
|
||||||
|
"sessionId" => $sessionId
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = $client->__soapCall( "TaskList", array ($params
|
$result = $client->__soapCall("TaskList", array(
|
||||||
|
$params
|
||||||
));
|
));
|
||||||
|
|
||||||
$rows = array ();
|
$rows = [];
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
if (isset($result->tasks)) {
|
if (isset($result->tasks)) {
|
||||||
//Processing when it is an array
|
//Processing when it is an array
|
||||||
if (is_array($result->tasks)) {
|
if (is_array($result->tasks)) {
|
||||||
foreach ($result->tasks as $key => $obj) {
|
foreach ($result->tasks as $key => $obj) {
|
||||||
$rows[$i] = array ("guid" => $obj->guid,"name" => $obj->name
|
$rows[$i] = array(
|
||||||
|
"guid" => $obj->guid, "name" => $obj->name
|
||||||
);
|
);
|
||||||
$i = $i + 1;
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Processing when it is an object //1 row
|
//Processing when it is an object //1 row
|
||||||
if (is_object($result->tasks)) {
|
if (is_object($result->tasks)) {
|
||||||
$rows[$i] = array ("guid" => $result->tasks->guid,"name" => $result->tasks->name
|
$rows[$i] = array(
|
||||||
|
"guid" => $result->tasks->guid, "name" => $result->tasks->name
|
||||||
);
|
);
|
||||||
$i = $i + 1;
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
@@ -735,27 +745,31 @@ function WSUserList ()
|
|||||||
$client = WSOpen();
|
$client = WSOpen();
|
||||||
|
|
||||||
$sessionId = $_SESSION["WS_SESSION_ID"];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
$params = array ("sessionId" => $sessionId
|
$params = array(
|
||||||
|
"sessionId" => $sessionId
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = $client->__soapCall( "UserList", array ($params
|
$result = $client->__soapCall("UserList", array(
|
||||||
|
$params
|
||||||
));
|
));
|
||||||
|
|
||||||
$rows = array ();
|
$rows = [];
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
if (isset($result->users)) {
|
if (isset($result->users)) {
|
||||||
//Processing when it is an array
|
//Processing when it is an array
|
||||||
if (is_array($result->users)) {
|
if (is_array($result->users)) {
|
||||||
foreach ($result->users as $key => $obj) {
|
foreach ($result->users as $key => $obj) {
|
||||||
$rows[$i] = array ("guid" => $obj->guid,"name" => $obj->name
|
$rows[$i] = array(
|
||||||
|
"guid" => $obj->guid, "name" => $obj->name
|
||||||
);
|
);
|
||||||
$i = $i + 1;
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Processing when it is an object //1 row
|
//Processing when it is an object //1 row
|
||||||
if (is_object($result->users)) {
|
if (is_object($result->users)) {
|
||||||
$rows[$i] = array ("guid" => $result->users->guid,"name" => $result->users->name
|
$rows[$i] = array(
|
||||||
|
"guid" => $result->users->guid, "name" => $result->users->name
|
||||||
);
|
);
|
||||||
$i = $i + 1;
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
@@ -783,27 +797,31 @@ function WSGroupList ()
|
|||||||
$client = WSOpen();
|
$client = WSOpen();
|
||||||
|
|
||||||
$sessionId = $_SESSION["WS_SESSION_ID"];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
$params = array ("sessionId" => $sessionId
|
$params = array(
|
||||||
|
"sessionId" => $sessionId
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = $client->__soapCall( "GroupList", array ($params
|
$result = $client->__soapCall("GroupList", array(
|
||||||
|
$params
|
||||||
));
|
));
|
||||||
|
|
||||||
$rows = array ();
|
$rows = [];
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
if (isset($result->groups)) {
|
if (isset($result->groups)) {
|
||||||
//Processing when it is an array
|
//Processing when it is an array
|
||||||
if (is_array($result->groups)) {
|
if (is_array($result->groups)) {
|
||||||
foreach ($result->groups as $key => $obj) {
|
foreach ($result->groups as $key => $obj) {
|
||||||
$rows[$i] = array ("guid" => $obj->guid,"name" => $obj->name
|
$rows[$i] = array(
|
||||||
|
"guid" => $obj->guid, "name" => $obj->name
|
||||||
);
|
);
|
||||||
$i = $i + 1;
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Processing when it is an object //1 row
|
//Processing when it is an object //1 row
|
||||||
if (is_object($result->groups)) {
|
if (is_object($result->groups)) {
|
||||||
$rows[$i] = array ("guid" => $result->groups->guid,"name" => $result->groups->name
|
$rows[$i] = array(
|
||||||
|
"guid" => $result->groups->guid, "name" => $result->groups->name
|
||||||
);
|
);
|
||||||
$i = $i + 1;
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
@@ -831,27 +849,31 @@ function WSRoleList ()
|
|||||||
$client = WSOpen();
|
$client = WSOpen();
|
||||||
|
|
||||||
$sessionId = $_SESSION["WS_SESSION_ID"];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
$params = array ("sessionId" => $sessionId
|
$params = array(
|
||||||
|
"sessionId" => $sessionId
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = $client->__soapCall( "RoleList", array ($params
|
$result = $client->__soapCall("RoleList", array(
|
||||||
|
$params
|
||||||
));
|
));
|
||||||
|
|
||||||
$rows = array ();
|
$rows = [];
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
if (isset($result->roles)) {
|
if (isset($result->roles)) {
|
||||||
//Processing when it is an array
|
//Processing when it is an array
|
||||||
if (is_array($result->roles)) {
|
if (is_array($result->roles)) {
|
||||||
foreach ($result->roles as $key => $obj) {
|
foreach ($result->roles as $key => $obj) {
|
||||||
$rows[$i] = array ("guid" => $obj->guid,"name" => $obj->name
|
$rows[$i] = array(
|
||||||
|
"guid" => $obj->guid, "name" => $obj->name
|
||||||
);
|
);
|
||||||
$i = $i + 1;
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Processing when it is an object //1 row
|
//Processing when it is an object //1 row
|
||||||
if (is_object($result->roles)) {
|
if (is_object($result->roles)) {
|
||||||
$rows[$i] = array ("guid" => $result->roles->guid,"name" => $result->roles->name
|
$rows[$i] = array(
|
||||||
|
"guid" => $result->roles->guid, "name" => $result->roles->name
|
||||||
);
|
);
|
||||||
$i = $i + 1;
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
@@ -880,27 +902,31 @@ function WSCaseList ()
|
|||||||
$client = WSOpen();
|
$client = WSOpen();
|
||||||
|
|
||||||
$sessionId = $_SESSION["WS_SESSION_ID"];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
$params = array ("sessionId" => $sessionId
|
$params = array(
|
||||||
|
"sessionId" => $sessionId
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = $client->__soapCall( "CaseList", array ($params
|
$result = $client->__soapCall("CaseList", array(
|
||||||
|
$params
|
||||||
));
|
));
|
||||||
|
|
||||||
$rows = array ();
|
$rows = [];
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
if (isset($result->cases)) {
|
if (isset($result->cases)) {
|
||||||
//Processing when it is an array
|
//Processing when it is an array
|
||||||
if (is_array($result->cases)) {
|
if (is_array($result->cases)) {
|
||||||
foreach ($result->cases as $key => $obj) {
|
foreach ($result->cases as $key => $obj) {
|
||||||
$rows[$i] = array ("guid" => $obj->guid,"name" => $obj->name
|
$rows[$i] = array(
|
||||||
|
"guid" => $obj->guid, "name" => $obj->name
|
||||||
);
|
);
|
||||||
$i = $i + 1;
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Processing when it is an object //1 row
|
//Processing when it is an object //1 row
|
||||||
if (is_object($result->cases)) {
|
if (is_object($result->cases)) {
|
||||||
$rows[$i] = array ("guid" => $result->cases->guid,"name" => $result->cases->name
|
$rows[$i] = array(
|
||||||
|
"guid" => $result->cases->guid, "name" => $result->cases->name
|
||||||
);
|
);
|
||||||
$i = $i + 1;
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
@@ -928,27 +954,31 @@ function WSProcessList ()
|
|||||||
$client = WSOpen();
|
$client = WSOpen();
|
||||||
|
|
||||||
$sessionId = $_SESSION["WS_SESSION_ID"];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
$params = array ("sessionId" => $sessionId
|
$params = array(
|
||||||
|
"sessionId" => $sessionId
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = $client->__soapCall( "ProcessList", array ($params
|
$result = $client->__soapCall("ProcessList", array(
|
||||||
|
$params
|
||||||
));
|
));
|
||||||
|
|
||||||
$rows = array ();
|
$rows = [];
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
if (isset($result->processes)) {
|
if (isset($result->processes)) {
|
||||||
//Processing when it is an array
|
//Processing when it is an array
|
||||||
if (is_array($result->processes)) {
|
if (is_array($result->processes)) {
|
||||||
foreach ($result->processes as $key => $obj) {
|
foreach ($result->processes as $key => $obj) {
|
||||||
$rows[$i] = array ("guid" => $obj->guid,"name" => $obj->name
|
$rows[$i] = array(
|
||||||
|
"guid" => $obj->guid, "name" => $obj->name
|
||||||
);
|
);
|
||||||
$i = $i + 1;
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Processing when it is an object //1 row
|
//Processing when it is an object //1 row
|
||||||
if (is_object($result->processes)) {
|
if (is_object($result->processes)) {
|
||||||
$rows[$i] = array ("guid" => $result->processes->guid,"name" => $result->processes->name
|
$rows[$i] = array(
|
||||||
|
"guid" => $result->processes->guid, "name" => $result->processes->name
|
||||||
);
|
);
|
||||||
$i = $i + 1;
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
@@ -1093,13 +1123,16 @@ function WSSendVariables ($caseId, $name1, $value1, $name2, $value2)
|
|||||||
$v2->name = $name2;
|
$v2->name = $name2;
|
||||||
$v2->value = $value2;
|
$v2->value = $value2;
|
||||||
|
|
||||||
$variables = array ($v1,$v2
|
$variables = array(
|
||||||
|
$v1, $v2
|
||||||
);
|
);
|
||||||
|
|
||||||
$params = array ("sessionId" => $sessionId,"caseId" => $caseId,"variables" => $variables
|
$params = array(
|
||||||
|
"sessionId" => $sessionId, "caseId" => $caseId, "variables" => $variables
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = $client->__soapCall( "SendVariables", array ($params
|
$result = $client->__soapCall("SendVariables", array(
|
||||||
|
$params
|
||||||
));
|
));
|
||||||
|
|
||||||
$fields["status_code"] = $result->status_code;
|
$fields["status_code"] = $result->status_code;
|
||||||
@@ -1131,10 +1164,12 @@ function WSDerivateCase ($caseId, $delIndex)
|
|||||||
|
|
||||||
$sessionId = $_SESSION["WS_SESSION_ID"];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
|
|
||||||
$params = array ("sessionId" => $sessionId,"caseId" => $caseId,"delIndex" => $delIndex
|
$params = array(
|
||||||
|
"sessionId" => $sessionId, "caseId" => $caseId, "delIndex" => $delIndex
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = $client->__soapCall( "DerivateCase", array ($params
|
$result = $client->__soapCall("DerivateCase", array(
|
||||||
|
$params
|
||||||
));
|
));
|
||||||
|
|
||||||
$fields["status_code"] = $result->status_code;
|
$fields["status_code"] = $result->status_code;
|
||||||
@@ -1232,13 +1267,16 @@ function WSNewCase ($processId, $taskId, $name1, $value1, $name2, $value2)
|
|||||||
$v2->name = $name2;
|
$v2->name = $name2;
|
||||||
$v2->value = $value2;
|
$v2->value = $value2;
|
||||||
|
|
||||||
$variables = array ($v1,$v2
|
$variables = array(
|
||||||
|
$v1, $v2
|
||||||
);
|
);
|
||||||
|
|
||||||
$params = array ("sessionId" => $sessionId,"processId" => $processId,"taskId" => $taskId,"variables" => $variables
|
$params = array(
|
||||||
|
"sessionId" => $sessionId, "processId" => $processId, "taskId" => $taskId, "variables" => $variables
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = $client->__soapCall( "NewCase", array ($params
|
$result = $client->__soapCall("NewCase", array(
|
||||||
|
$params
|
||||||
));
|
));
|
||||||
|
|
||||||
$fields["status_code"] = $result->status_code;
|
$fields["status_code"] = $result->status_code;
|
||||||
@@ -1272,10 +1310,12 @@ function WSAssignUserToGroup ($userId, $groupId)
|
|||||||
|
|
||||||
$sessionId = $_SESSION["WS_SESSION_ID"];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
|
|
||||||
$params = array ("sessionId" => $sessionId,"userId" => $userId,"groupId" => $groupId
|
$params = array(
|
||||||
|
"sessionId" => $sessionId, "userId" => $userId, "groupId" => $groupId
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = $client->__soapCall( "AssignUserToGroup", array ($params
|
$result = $client->__soapCall("AssignUserToGroup", array(
|
||||||
|
$params
|
||||||
));
|
));
|
||||||
|
|
||||||
$fields["status_code"] = $result->status_code;
|
$fields["status_code"] = $result->status_code;
|
||||||
@@ -1312,7 +1352,8 @@ function WSCreateUser ($userId, $password, $firstname, $lastname, $email, $role,
|
|||||||
|
|
||||||
$sessionId = $_SESSION["WS_SESSION_ID"];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
|
|
||||||
$params = array ("sessionId" => $sessionId,"userId" => $userId,"firstname" => $firstname,"lastname" => $lastname,"email" => $email,"role" => $role,"password" => $password,"dueDate" => $dueDate,"status" => $status
|
$params = array(
|
||||||
|
"sessionId" => $sessionId, "userId" => $userId, "firstname" => $firstname, "lastname" => $lastname, "email" => $email, "role" => $role, "password" => $password, "dueDate" => $dueDate, "status" => $status
|
||||||
);
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -1356,10 +1397,12 @@ function WSUpdateUser ($userUid, $userName, $firstName = null, $lastName = null,
|
|||||||
|
|
||||||
$sessionId = $_SESSION["WS_SESSION_ID"];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
|
|
||||||
$params = array ("sessionId" => $sessionId,"userUid" => $userUid,"userName" => $userName,"firstName" => $firstName,"lastName" => $lastName,"email" => $email,"dueDate" => $dueDate,"status" => $status,"role" => $role,"password" => $password
|
$params = array(
|
||||||
|
"sessionId" => $sessionId, "userUid" => $userUid, "userName" => $userName, "firstName" => $firstName, "lastName" => $lastName, "email" => $email, "dueDate" => $dueDate, "status" => $status, "role" => $role, "password" => $password
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = $client->__soapCall( "updateUser", array ($params
|
$result = $client->__soapCall("updateUser", array(
|
||||||
|
$params
|
||||||
));
|
));
|
||||||
|
|
||||||
$fields["status_code"] = $result->status_code;
|
$fields["status_code"] = $result->status_code;
|
||||||
@@ -1396,7 +1439,7 @@ function WSInformationUser($userUid)
|
|||||||
|
|
||||||
$result = $client->__soapCall("informationUser", array($params));
|
$result = $client->__soapCall("informationUser", array($params));
|
||||||
|
|
||||||
$response = array();
|
$response = [];
|
||||||
$response["status_code"] = $result->status_code;
|
$response["status_code"] = $result->status_code;
|
||||||
$response["message"] = $result->message;
|
$response["message"] = $result->message;
|
||||||
$response["time_stamp"] = $result->timestamp;
|
$response["time_stamp"] = $result->timestamp;
|
||||||
@@ -1447,13 +1490,15 @@ function WSDeleteCase ($caseUid)
|
|||||||
|
|
||||||
$sessionId = $_SESSION["WS_SESSION_ID"];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
|
|
||||||
$params = array ("sessionId" => $sessionId,"caseUid" => $caseUid
|
$params = array(
|
||||||
|
"sessionId" => $sessionId, "caseUid" => $caseUid
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = $client->__soapCall( "deleteCase", array ($params
|
$result = $client->__soapCall("deleteCase", array(
|
||||||
|
$params
|
||||||
));
|
));
|
||||||
|
|
||||||
$response = array ();
|
$response = [];
|
||||||
$response["status_code"] = $result->status_code;
|
$response["status_code"] = $result->status_code;
|
||||||
$response["message"] = $result->message;
|
$response["message"] = $result->message;
|
||||||
$response["time_stamp"] = $result->timestamp;
|
$response["time_stamp"] = $result->timestamp;
|
||||||
@@ -1483,13 +1528,15 @@ function WSCancelCase ($caseUid, $delIndex, $userUid)
|
|||||||
|
|
||||||
$sessionId = $_SESSION["WS_SESSION_ID"];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
|
|
||||||
$params = array ("sessionId" => $sessionId,"caseUid" => $caseUid,"delIndex" => $delIndex,"userUid" => $userUid
|
$params = array(
|
||||||
|
"sessionId" => $sessionId, "caseUid" => $caseUid, "delIndex" => $delIndex, "userUid" => $userUid
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = $client->__soapCall( "cancelCase", array ($params
|
$result = $client->__soapCall("cancelCase", array(
|
||||||
|
$params
|
||||||
));
|
));
|
||||||
|
|
||||||
$response = array ();
|
$response = [];
|
||||||
$response["status_code"] = $result->status_code;
|
$response["status_code"] = $result->status_code;
|
||||||
$response["message"] = $result->message;
|
$response["message"] = $result->message;
|
||||||
$response["time_stamp"] = $result->timestamp;
|
$response["time_stamp"] = $result->timestamp;
|
||||||
@@ -1520,13 +1567,15 @@ function WSPauseCase ($caseUid, $delIndex, $userUid, $unpauseDate = null)
|
|||||||
|
|
||||||
$sessionId = $_SESSION["WS_SESSION_ID"];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
|
|
||||||
$params = array ("sessionId" => $sessionId,"caseUid" => $caseUid,"delIndex" => $delIndex,"userUid" => $userUid,"unpauseDate" => $unpauseDate
|
$params = array(
|
||||||
|
"sessionId" => $sessionId, "caseUid" => $caseUid, "delIndex" => $delIndex, "userUid" => $userUid, "unpauseDate" => $unpauseDate
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = $client->__soapCall( "pauseCase", array ($params
|
$result = $client->__soapCall("pauseCase", array(
|
||||||
|
$params
|
||||||
));
|
));
|
||||||
|
|
||||||
$response = array ();
|
$response = [];
|
||||||
$response["status_code"] = $result->status_code;
|
$response["status_code"] = $result->status_code;
|
||||||
$response["message"] = $result->message;
|
$response["message"] = $result->message;
|
||||||
$response["time_stamp"] = $result->timestamp;
|
$response["time_stamp"] = $result->timestamp;
|
||||||
@@ -1556,13 +1605,15 @@ function WSUnpauseCase ($caseUid, $delIndex, $userUid)
|
|||||||
|
|
||||||
$sessionId = $_SESSION["WS_SESSION_ID"];
|
$sessionId = $_SESSION["WS_SESSION_ID"];
|
||||||
|
|
||||||
$params = array ("sessionId" => $sessionId,"caseUid" => $caseUid,"delIndex" => $delIndex,"userUid" => $userUid
|
$params = array(
|
||||||
|
"sessionId" => $sessionId, "caseUid" => $caseUid, "delIndex" => $delIndex, "userUid" => $userUid
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = $client->__soapCall( "unpauseCase", array ($params
|
$result = $client->__soapCall("unpauseCase", array(
|
||||||
|
$params
|
||||||
));
|
));
|
||||||
|
|
||||||
$response = array ();
|
$response = [];
|
||||||
$response["status_code"] = $result->status_code;
|
$response["status_code"] = $result->status_code;
|
||||||
$response["message"] = $result->message;
|
$response["message"] = $result->message;
|
||||||
$response["time_stamp"] = $result->timestamp;
|
$response["time_stamp"] = $result->timestamp;
|
||||||
@@ -1607,7 +1658,7 @@ function WSAddCaseNote($caseUid, $processUid, $taskUid, $userUid, $note, $sendMa
|
|||||||
|
|
||||||
$result = $client->__soapCall("addCaseNote", array($params));
|
$result = $client->__soapCall("addCaseNote", array($params));
|
||||||
|
|
||||||
$response = array();
|
$response = [];
|
||||||
$response["status_code"] = $result->status_code;
|
$response["status_code"] = $result->status_code;
|
||||||
$response["message"] = $result->message;
|
$response["message"] = $result->message;
|
||||||
$response["time_stamp"] = $result->timestamp;
|
$response["time_stamp"] = $result->timestamp;
|
||||||
@@ -1640,7 +1691,7 @@ function PMFTaskCase ($caseId) //its test was successfull
|
|||||||
{
|
{
|
||||||
$ws = new WsBase();
|
$ws = new WsBase();
|
||||||
$result = $ws->taskCase($caseId);
|
$result = $ws->taskCase($caseId);
|
||||||
$rows = Array ();
|
$rows = [];
|
||||||
$i = 1;
|
$i = 1;
|
||||||
if (isset($result)) {
|
if (isset($result)) {
|
||||||
foreach ($result as $item) {
|
foreach ($result as $item) {
|
||||||
@@ -1668,7 +1719,7 @@ function PMFTaskList ($userId) //its test was successfull
|
|||||||
{
|
{
|
||||||
$ws = new WsBase();
|
$ws = new WsBase();
|
||||||
$result = $ws->taskList($userId);
|
$result = $ws->taskList($userId);
|
||||||
$rows = Array ();
|
$rows = [];
|
||||||
$i = 1;
|
$i = 1;
|
||||||
if (isset($result)) {
|
if (isset($result)) {
|
||||||
foreach ($result as $item) {
|
foreach ($result as $item) {
|
||||||
@@ -1695,7 +1746,7 @@ function PMFUserList () //its test was successfull
|
|||||||
{
|
{
|
||||||
$ws = new WsBase();
|
$ws = new WsBase();
|
||||||
$result = $ws->userList();
|
$result = $ws->userList();
|
||||||
$rows = Array ();
|
$rows = [];
|
||||||
$i = 1;
|
$i = 1;
|
||||||
if (isset($result)) {
|
if (isset($result)) {
|
||||||
foreach ($result as $item) {
|
foreach ($result as $item) {
|
||||||
@@ -1855,7 +1906,8 @@ function PMFGenerateOutputDocument ($outputID, $sApplication = null, $index = nu
|
|||||||
//Create new Version of current output
|
//Create new Version of current output
|
||||||
$lastDocVersion++;
|
$lastDocVersion++;
|
||||||
if ($aRow = $oDataset->getRow()) {
|
if ($aRow = $oDataset->getRow()) {
|
||||||
$aFields = array ('APP_DOC_UID' => $aRow['APP_DOC_UID'],'APP_UID' => $sApplication,'DEL_INDEX' => $index,'DOC_UID' => $outputID,'DOC_VERSION' => $lastDocVersion + 1,'USR_UID' => $sUserLogged,'APP_DOC_TYPE' => 'OUTPUT','APP_DOC_CREATE_DATE' => date( 'Y-m-d H:i:s' ),'APP_DOC_FILENAME' => $sFilename,'FOLDER_UID' => $folderId,'APP_DOC_TAGS' => $fileTags
|
$aFields = array(
|
||||||
|
'APP_DOC_UID' => $aRow['APP_DOC_UID'], 'APP_UID' => $sApplication, 'DEL_INDEX' => $index, 'DOC_UID' => $outputID, 'DOC_VERSION' => $lastDocVersion + 1, 'USR_UID' => $sUserLogged, 'APP_DOC_TYPE' => 'OUTPUT', 'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'), 'APP_DOC_FILENAME' => $sFilename, 'FOLDER_UID' => $folderId, 'APP_DOC_TAGS' => $fileTags
|
||||||
);
|
);
|
||||||
$oAppDocument = new AppDocument();
|
$oAppDocument = new AppDocument();
|
||||||
$oAppDocument->create($aFields);
|
$oAppDocument->create($aFields);
|
||||||
@@ -1865,7 +1917,8 @@ function PMFGenerateOutputDocument ($outputID, $sApplication = null, $index = nu
|
|||||||
////No versioning so Update a current Output or Create new if no exist
|
////No versioning so Update a current Output or Create new if no exist
|
||||||
if ($aRow = $oDataset->getRow()) {
|
if ($aRow = $oDataset->getRow()) {
|
||||||
//Update
|
//Update
|
||||||
$aFields = array ('APP_DOC_UID' => $aRow['APP_DOC_UID'],'APP_UID' => $sApplication,'DEL_INDEX' => $index,'DOC_UID' => $outputID,'DOC_VERSION' => $lastDocVersion,'USR_UID' => $sUserLogged,'APP_DOC_TYPE' => 'OUTPUT','APP_DOC_CREATE_DATE' => date( 'Y-m-d H:i:s' ),'APP_DOC_FILENAME' => $sFilename,'FOLDER_UID' => $folderId,'APP_DOC_TAGS' => $fileTags
|
$aFields = array(
|
||||||
|
'APP_DOC_UID' => $aRow['APP_DOC_UID'], 'APP_UID' => $sApplication, 'DEL_INDEX' => $index, 'DOC_UID' => $outputID, 'DOC_VERSION' => $lastDocVersion, 'USR_UID' => $sUserLogged, 'APP_DOC_TYPE' => 'OUTPUT', 'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'), 'APP_DOC_FILENAME' => $sFilename, 'FOLDER_UID' => $folderId, 'APP_DOC_TAGS' => $fileTags
|
||||||
);
|
);
|
||||||
$oAppDocument = new AppDocument();
|
$oAppDocument = new AppDocument();
|
||||||
$oAppDocument->update($aFields);
|
$oAppDocument->update($aFields);
|
||||||
@@ -1876,7 +1929,8 @@ function PMFGenerateOutputDocument ($outputID, $sApplication = null, $index = nu
|
|||||||
if ($lastDocVersion == 0) {
|
if ($lastDocVersion == 0) {
|
||||||
$lastDocVersion++;
|
$lastDocVersion++;
|
||||||
}
|
}
|
||||||
$aFields = array ('APP_UID' => $sApplication,'DEL_INDEX' => $index,'DOC_UID' => $outputID,'DOC_VERSION' => $lastDocVersion,'USR_UID' => $sUserLogged,'APP_DOC_TYPE' => 'OUTPUT','APP_DOC_CREATE_DATE' => date( 'Y-m-d H:i:s' ),'APP_DOC_FILENAME' => $sFilename,'FOLDER_UID' => $folderId,'APP_DOC_TAGS' => $fileTags
|
$aFields = array(
|
||||||
|
'APP_UID' => $sApplication, 'DEL_INDEX' => $index, 'DOC_UID' => $outputID, 'DOC_VERSION' => $lastDocVersion, 'USR_UID' => $sUserLogged, 'APP_DOC_TYPE' => 'OUTPUT', 'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'), 'APP_DOC_FILENAME' => $sFilename, 'FOLDER_UID' => $folderId, 'APP_DOC_TAGS' => $fileTags
|
||||||
);
|
);
|
||||||
$oAppDocument = new AppDocument();
|
$oAppDocument = new AppDocument();
|
||||||
$aFields['APP_DOC_UID'] = $sDocUID = $oAppDocument->create($aFields);
|
$aFields['APP_DOC_UID'] = $sDocUID = $oAppDocument->create($aFields);
|
||||||
@@ -1887,7 +1941,7 @@ function PMFGenerateOutputDocument ($outputID, $sApplication = null, $index = nu
|
|||||||
$pathOutput = PATH_DOCUMENT . G::getPathFromUID($sApplication) . PATH_SEP . 'outdocs' . PATH_SEP; //G::pr($sFilename);die;
|
$pathOutput = PATH_DOCUMENT . G::getPathFromUID($sApplication) . PATH_SEP . 'outdocs' . PATH_SEP; //G::pr($sFilename);die;
|
||||||
G::mk_dir($pathOutput);
|
G::mk_dir($pathOutput);
|
||||||
|
|
||||||
$aProperties = array ();
|
$aProperties = [];
|
||||||
|
|
||||||
if (!isset($aOD['OUT_DOC_MEDIA'])) {
|
if (!isset($aOD['OUT_DOC_MEDIA'])) {
|
||||||
$aOD['OUT_DOC_MEDIA'] = 'Letter';
|
$aOD['OUT_DOC_MEDIA'] = 'Letter';
|
||||||
@@ -1906,7 +1960,8 @@ function PMFGenerateOutputDocument ($outputID, $sApplication = null, $index = nu
|
|||||||
}
|
}
|
||||||
|
|
||||||
$aProperties['media'] = $aOD['OUT_DOC_MEDIA'];
|
$aProperties['media'] = $aOD['OUT_DOC_MEDIA'];
|
||||||
$aProperties['margins'] = array ('left' => $aOD['OUT_DOC_LEFT_MARGIN'],'right' => $aOD['OUT_DOC_RIGHT_MARGIN'],'top' => $aOD['OUT_DOC_TOP_MARGIN'],'bottom' => $aOD['OUT_DOC_BOTTOM_MARGIN']
|
$aProperties['margins'] = array(
|
||||||
|
'left' => $aOD['OUT_DOC_LEFT_MARGIN'], 'right' => $aOD['OUT_DOC_RIGHT_MARGIN'], 'top' => $aOD['OUT_DOC_TOP_MARGIN'], 'bottom' => $aOD['OUT_DOC_BOTTOM_MARGIN']
|
||||||
);
|
);
|
||||||
if ($aOD['OUT_DOC_PDF_SECURITY_ENABLED'] == '1') {
|
if ($aOD['OUT_DOC_PDF_SECURITY_ENABLED'] == '1') {
|
||||||
$aProperties['pdfSecurity'] = array('openPassword' => $aOD['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'], 'ownerPassword' => $aOD['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'], 'permissions' => $aOD['OUT_DOC_PDF_SECURITY_PERMISSIONS']);
|
$aProperties['pdfSecurity'] = array('openPassword' => $aOD['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'], 'ownerPassword' => $aOD['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'], 'permissions' => $aOD['OUT_DOC_PDF_SECURITY_PERMISSIONS']);
|
||||||
@@ -1914,7 +1969,7 @@ function PMFGenerateOutputDocument ($outputID, $sApplication = null, $index = nu
|
|||||||
if (isset($aOD['OUT_DOC_REPORT_GENERATOR'])) {
|
if (isset($aOD['OUT_DOC_REPORT_GENERATOR'])) {
|
||||||
$aProperties['report_generator'] = $aOD['OUT_DOC_REPORT_GENERATOR'];
|
$aProperties['report_generator'] = $aOD['OUT_DOC_REPORT_GENERATOR'];
|
||||||
}
|
}
|
||||||
$oOutputDocument->generate( $outputID, $Fields['APP_DATA'], $pathOutput, $sFilename, $aOD['OUT_DOC_TEMPLATE'], (boolean) $aOD['OUT_DOC_LANDSCAPE'], $aOD['OUT_DOC_GENERATE'], $aProperties );
|
$oOutputDocument->generate($outputID, $Fields['APP_DATA'], $pathOutput, $sFilename, $aOD['OUT_DOC_TEMPLATE'], (bool) $aOD['OUT_DOC_LANDSCAPE'], $aOD['OUT_DOC_GENERATE'], $aProperties);
|
||||||
|
|
||||||
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
|
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
|
||||||
|
|
||||||
@@ -2002,7 +2057,7 @@ function PMFGroupList ($regex = null, $start = null, $limit = null) //its test w
|
|||||||
{
|
{
|
||||||
$ws = new WsBase();
|
$ws = new WsBase();
|
||||||
$result = $ws->groupList($regex, $start, $limit);
|
$result = $ws->groupList($regex, $start, $limit);
|
||||||
$rows = array();
|
$rows = [];
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$rows = array_combine(range(1, count($result)), array_values($result));
|
$rows = array_combine(range(1, count($result)), array_values($result));
|
||||||
}
|
}
|
||||||
@@ -2026,7 +2081,7 @@ function PMFRoleList () //its test was successfull
|
|||||||
{
|
{
|
||||||
$ws = new WsBase();
|
$ws = new WsBase();
|
||||||
$result = $ws->roleList();
|
$result = $ws->roleList();
|
||||||
$rows = Array ();
|
$rows = [];
|
||||||
$i = 1;
|
$i = 1;
|
||||||
if (isset($result)) {
|
if (isset($result)) {
|
||||||
foreach ($result as $item) {
|
foreach ($result as $item) {
|
||||||
@@ -2054,7 +2109,7 @@ function PMFCaseList ($userId) //its test was successfull
|
|||||||
{
|
{
|
||||||
$ws = new WsBase();
|
$ws = new WsBase();
|
||||||
$result = $ws->caseList($userId);
|
$result = $ws->caseList($userId);
|
||||||
$rows = Array ();
|
$rows = [];
|
||||||
$i = 1;
|
$i = 1;
|
||||||
if (isset($result)) {
|
if (isset($result)) {
|
||||||
foreach ($result as $item) {
|
foreach ($result as $item) {
|
||||||
@@ -2081,7 +2136,7 @@ function PMFProcessList () //its test was successfull
|
|||||||
{
|
{
|
||||||
$ws = new WsBase();
|
$ws = new WsBase();
|
||||||
$result = $ws->processList();
|
$result = $ws->processList();
|
||||||
$rows = Array ();
|
$rows = [];
|
||||||
$i = 1;
|
$i = 1;
|
||||||
if (isset($result)) {
|
if (isset($result)) {
|
||||||
foreach ($result as $item) {
|
foreach ($result as $item) {
|
||||||
@@ -2115,8 +2170,11 @@ function PMFSendVariables ($caseId, $variables)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$ws = new WsBase();
|
$ws = new WsBase();
|
||||||
$result = $ws->sendVariables($caseId, $variables,
|
$result = $ws->sendVariables(
|
||||||
$oPMScript->executedOn() === PMScript::AFTER_ROUTING);
|
$caseId,
|
||||||
|
$variables,
|
||||||
|
$oPMScript->executedOn() === PMScript::AFTER_ROUTING
|
||||||
|
);
|
||||||
|
|
||||||
if ($result->status_code == 0) {
|
if ($result->status_code == 0) {
|
||||||
if (isset($_SESSION['APPLICATION'])) {
|
if (isset($_SESSION['APPLICATION'])) {
|
||||||
@@ -2354,7 +2412,7 @@ function PMFInformationUser($userUid)
|
|||||||
$ws = new WsBase();
|
$ws = new WsBase();
|
||||||
$result = $ws->informationUser($userUid);
|
$result = $ws->informationUser($userUid);
|
||||||
|
|
||||||
$info = array();
|
$info = [];
|
||||||
|
|
||||||
if ($result->status_code == 0 && isset($result->info)) {
|
if ($result->status_code == 0 && isset($result->info)) {
|
||||||
$info = $result->info;
|
$info = $result->info;
|
||||||
@@ -2475,7 +2533,7 @@ function jumping ($caseId, $delIndex)
|
|||||||
*/
|
*/
|
||||||
function PMFgetLabelOption($PROCESS, $DYNAFORM_UID, $FIELD_NAME, $FIELD_SELECTED_ID)
|
function PMFgetLabelOption($PROCESS, $DYNAFORM_UID, $FIELD_NAME, $FIELD_SELECTED_ID)
|
||||||
{
|
{
|
||||||
$data = array();
|
$data = [];
|
||||||
$data["CURRENT_DYNAFORM"] = $DYNAFORM_UID;
|
$data["CURRENT_DYNAFORM"] = $DYNAFORM_UID;
|
||||||
$dynaform = new PmDynaform($data);
|
$dynaform = new PmDynaform($data);
|
||||||
if ($dynaform->isResponsive()) {
|
if ($dynaform->isResponsive()) {
|
||||||
@@ -2621,12 +2679,14 @@ function PMFGetNextAssignedUser($application, $task, $delIndex = null, $userUid
|
|||||||
|
|
||||||
if ($typeTask == 'BALANCED' && !is_null($_SESSION['INDEX']) && !is_null($_SESSION['USER_LOGGED'])) {
|
if ($typeTask == 'BALANCED' && !is_null($_SESSION['INDEX']) && !is_null($_SESSION['USER_LOGGED'])) {
|
||||||
$oDerivation = new Derivation();
|
$oDerivation = new Derivation();
|
||||||
$aDeriv = $oDerivation->prepareInformation(array('USER_UID' => $_SESSION['USER_LOGGED'], 'APP_UID' => $application, 'DEL_INDEX' => $_SESSION['INDEX']
|
$aDeriv = $oDerivation->prepareInformation(array(
|
||||||
|
'USER_UID' => $_SESSION['USER_LOGGED'], 'APP_UID' => $application, 'DEL_INDEX' => $_SESSION['INDEX']
|
||||||
));
|
));
|
||||||
|
|
||||||
foreach ($aDeriv as $derivation) {
|
foreach ($aDeriv as $derivation) {
|
||||||
|
|
||||||
$aUser = array('USR_UID' => $derivation['NEXT_TASK']['USER_ASSIGNED']['USR_UID'], 'USR_USERNAME' => $derivation['NEXT_TASK']['USER_ASSIGNED']['USR_USERNAME'], 'USR_FIRSTNAME' => $derivation['NEXT_TASK']['USER_ASSIGNED']['USR_FIRSTNAME'], 'USR_LASTNAME' => $derivation['NEXT_TASK']['USER_ASSIGNED']['USR_LASTNAME'], 'USR_EMAIL' => $derivation['NEXT_TASK']['USER_ASSIGNED']['USR_EMAIL']
|
$aUser = array(
|
||||||
|
'USR_UID' => $derivation['NEXT_TASK']['USER_ASSIGNED']['USR_UID'], 'USR_USERNAME' => $derivation['NEXT_TASK']['USER_ASSIGNED']['USR_USERNAME'], 'USR_FIRSTNAME' => $derivation['NEXT_TASK']['USER_ASSIGNED']['USR_FIRSTNAME'], 'USR_LASTNAME' => $derivation['NEXT_TASK']['USER_ASSIGNED']['USR_LASTNAME'], 'USR_EMAIL' => $derivation['NEXT_TASK']['USER_ASSIGNED']['USR_EMAIL']
|
||||||
);
|
);
|
||||||
$aUsers[] = $aUser;
|
$aUsers[] = $aUser;
|
||||||
}
|
}
|
||||||
@@ -2638,7 +2698,6 @@ function PMFGetNextAssignedUser($application, $task, $delIndex = null, $userUid
|
|||||||
} else {
|
} else {
|
||||||
return $aUsers;
|
return $aUsers;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$g->sessionVarRestore();
|
$g->sessionVarRestore();
|
||||||
return false;
|
return false;
|
||||||
@@ -2662,7 +2721,6 @@ function PMFGetNextAssignedUser($application, $task, $delIndex = null, $userUid
|
|||||||
*/
|
*/
|
||||||
function PMFGetUserEmailAddress($id, $APP_UID = null, $prefix = 'usr')
|
function PMFGetUserEmailAddress($id, $APP_UID = null, $prefix = 'usr')
|
||||||
{
|
{
|
||||||
|
|
||||||
if (is_string($id) && trim($id) == "") {
|
if (is_string($id) && trim($id) == "") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -2671,8 +2729,8 @@ function PMFGetUserEmailAddress ($id, $APP_UID = null, $prefix = 'usr')
|
|||||||
}
|
}
|
||||||
|
|
||||||
//recipient to store the email addresses
|
//recipient to store the email addresses
|
||||||
$aRecipient = Array ();
|
$aRecipient = [];
|
||||||
$aItems = Array ();
|
$aItems = [];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* First at all the $id user input can be by example erik@colosa.com
|
* First at all the $id user input can be by example erik@colosa.com
|
||||||
@@ -2859,13 +2917,11 @@ function PMFCancelCase($caseUid, $delIndex = null, $userUid = null)
|
|||||||
G::header('Location: ../cases/casesListExtJsRedirector');
|
G::header('Location: ../cases/casesListExtJsRedirector');
|
||||||
die;
|
die;
|
||||||
} else {
|
} else {
|
||||||
die(
|
die(G::LoadTranslation(
|
||||||
G::LoadTranslation(
|
|
||||||
'ID_PM_FUNCTION_CHANGE_CASE',
|
'ID_PM_FUNCTION_CHANGE_CASE',
|
||||||
SYS_LANG,
|
SYS_LANG,
|
||||||
['PMFCancelCase', G::LoadTranslation('ID_CANCELLED')]
|
['PMFCancelCase', G::LoadTranslation('ID_CANCELLED')]
|
||||||
)
|
));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3070,8 +3126,11 @@ function PMFSaveCurrentData ()
|
|||||||
|
|
||||||
if (isset($_SESSION['APPLICATION']) && isset($oPMScript->aFields)) {
|
if (isset($_SESSION['APPLICATION']) && isset($oPMScript->aFields)) {
|
||||||
$ws = new WsBase();
|
$ws = new WsBase();
|
||||||
$result = $ws->sendVariables($_SESSION['APPLICATION'], $oPMScript->aFields,
|
$result = $ws->sendVariables(
|
||||||
$oPMScript->executedOn() === PMScript::AFTER_ROUTING);
|
$_SESSION['APPLICATION'],
|
||||||
|
$oPMScript->aFields,
|
||||||
|
$oPMScript->executedOn() === PMScript::AFTER_ROUTING
|
||||||
|
);
|
||||||
$response = $result->status_code == 0 ? 1 : 0;
|
$response = $result->status_code == 0 ? 1 : 0;
|
||||||
}
|
}
|
||||||
return $response;
|
return $response;
|
||||||
@@ -3088,7 +3147,7 @@ function PMFSaveCurrentData ()
|
|||||||
*/
|
*/
|
||||||
function PMFTasksListByProcessId($processId, $lang = 'en')
|
function PMFTasksListByProcessId($processId, $lang = 'en')
|
||||||
{
|
{
|
||||||
$result = array();
|
$result = [];
|
||||||
$criteria = new Criteria("workflow");
|
$criteria = new Criteria("workflow");
|
||||||
$criteria->addSelectColumn(TaskPeer::TAS_UID);
|
$criteria->addSelectColumn(TaskPeer::TAS_UID);
|
||||||
$criteria->addSelectColumn(TaskPeer::TAS_TITLE);
|
$criteria->addSelectColumn(TaskPeer::TAS_TITLE);
|
||||||
@@ -3271,7 +3330,8 @@ function PMFDynaFormFields($dynUid, $appUid = '', $delIndex = 0)
|
|||||||
* of the CONTENT table
|
* of the CONTENT table
|
||||||
* @return string | $text | Translated text | the translated text of a string in Content
|
* @return string | $text | Translated text | the translated text of a string in Content
|
||||||
*/
|
*/
|
||||||
function PMFGetTaskName($taskUid, $lang = SYS_LANG) {
|
function PMFGetTaskName($taskUid, $lang = SYS_LANG)
|
||||||
|
{
|
||||||
if (empty($taskUid)) {
|
if (empty($taskUid)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -3292,7 +3352,8 @@ function PMFGetTaskName($taskUid, $lang = SYS_LANG) {
|
|||||||
* @param string | $lang | Language | Is the language of the text, that must be the same to the column: "CON_LANG" of the CONTENT table
|
* @param string | $lang | Language | Is the language of the text, that must be the same to the column: "CON_LANG" of the CONTENT table
|
||||||
* @return string | $text | Translated text | the translated text of a string in Content
|
* @return string | $text | Translated text | the translated text of a string in Content
|
||||||
*/
|
*/
|
||||||
function PMFGetGroupName($grpUid, $lang = SYS_LANG) {
|
function PMFGetGroupName($grpUid, $lang = SYS_LANG)
|
||||||
|
{
|
||||||
if (empty($grpUid)) {
|
if (empty($grpUid)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -3405,8 +3466,11 @@ function PMFGetTaskUID($taskName, $processUid = null)
|
|||||||
$criteria->addSelectColumn(TaskPeer::TAS_UID);
|
$criteria->addSelectColumn(TaskPeer::TAS_UID);
|
||||||
$criteria->add(TaskPeer::TAS_TITLE, $taskName, Criteria::EQUAL);
|
$criteria->add(TaskPeer::TAS_TITLE, $taskName, Criteria::EQUAL);
|
||||||
|
|
||||||
$criteria->add(TaskPeer::PRO_UID, (!empty($processUid)) ? $processUid : $_SESSION['PROCESS'],
|
$criteria->add(
|
||||||
Criteria::EQUAL);
|
TaskPeer::PRO_UID,
|
||||||
|
(!empty($processUid)) ? $processUid : $_SESSION['PROCESS'],
|
||||||
|
Criteria::EQUAL
|
||||||
|
);
|
||||||
|
|
||||||
$rsCriteria = TaskPeer::doSelectRS($criteria);
|
$rsCriteria = TaskPeer::doSelectRS($criteria);
|
||||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
@@ -3434,7 +3498,6 @@ function PMFGetGroupUsers($GroupUID)
|
|||||||
$groups = new Groups();
|
$groups = new Groups();
|
||||||
$usersGroup = $groups->getUsersOfGroup($GroupUID, 'ALL');
|
$usersGroup = $groups->getUsersOfGroup($GroupUID, 'ALL');
|
||||||
return $usersGroup;
|
return $usersGroup;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -3511,7 +3574,8 @@ function PMFGetNextDerivationInfo($caseUid, $delIndex)
|
|||||||
|
|
||||||
$assignmentType = $arrayInfo['NEXT_TASK']['TAS_ASSIGN_TYPE'];
|
$assignmentType = $arrayInfo['NEXT_TASK']['TAS_ASSIGN_TYPE'];
|
||||||
|
|
||||||
if ($arrayInfo['NEXT_TASK']['TAS_ASSIGN_TYPE'] == 'SELF_SERVICE' &&
|
if (
|
||||||
|
$arrayInfo['NEXT_TASK']['TAS_ASSIGN_TYPE'] == 'SELF_SERVICE' &&
|
||||||
trim($arrayInfo['NEXT_TASK']['TAS_GROUP_VARIABLE']) != ''
|
trim($arrayInfo['NEXT_TASK']['TAS_GROUP_VARIABLE']) != ''
|
||||||
) {
|
) {
|
||||||
$assignmentType = 'SELF_SERVICE_VALUE';
|
$assignmentType = 'SELF_SERVICE_VALUE';
|
||||||
@@ -3872,7 +3936,8 @@ function PMFAddUserGroupToTask($taskUid, $userGroupUid)
|
|||||||
$userType = 'group';
|
$userType = 'group';
|
||||||
} else {
|
} else {
|
||||||
throw new Exception(G::LoadTranslation(
|
throw new Exception(G::LoadTranslation(
|
||||||
'ID_USER_GROUP_NOT_CORRESPOND', [$userGroupUid, G::LoadTranslation('ID_USER') . '/' . G::LoadTranslation('ID_GROUP')]
|
'ID_USER_GROUP_NOT_CORRESPOND',
|
||||||
|
[$userGroupUid, G::LoadTranslation('ID_USER') . '/' . G::LoadTranslation('ID_GROUP')]
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3921,7 +3986,8 @@ function PMFRemoveUserGroupFromTask($taskUid, $userGroupUid)
|
|||||||
$uid = $userGroupUid;
|
$uid = $userGroupUid;
|
||||||
} else {
|
} else {
|
||||||
throw new Exception(G::LoadTranslation(
|
throw new Exception(G::LoadTranslation(
|
||||||
'ID_USER_GROUP_NOT_CORRESPOND', [$userGroupUid, G::LoadTranslation('ID_USER') . '/' . G::LoadTranslation('ID_GROUP')]
|
'ID_USER_GROUP_NOT_CORRESPOND',
|
||||||
|
[$userGroupUid, G::LoadTranslation('ID_USER') . '/' . G::LoadTranslation('ID_GROUP')]
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4009,7 +4075,18 @@ function PMFSendMessageToGroup(
|
|||||||
|
|
||||||
if ($flagNextRecord) {
|
if ($flagNextRecord) {
|
||||||
$result = PMFSendMessage(
|
$result = PMFSendMessage(
|
||||||
$caseId, $from, $to, null, null, $subject, $template, $arrayField, $arrayAttachment, $showMessage, $delIndex, $config
|
$caseId,
|
||||||
|
$from,
|
||||||
|
$to,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
$subject,
|
||||||
|
$template,
|
||||||
|
$arrayField,
|
||||||
|
$arrayAttachment,
|
||||||
|
$showMessage,
|
||||||
|
$delIndex,
|
||||||
|
$config
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($result == 0) {
|
if ($result == 0) {
|
||||||
@@ -4053,8 +4130,8 @@ function PMFNewUser(
|
|||||||
$role,
|
$role,
|
||||||
$dueDate = null,
|
$dueDate = null,
|
||||||
$status = null,
|
$status = null,
|
||||||
$group = null)
|
$group = null
|
||||||
{
|
) {
|
||||||
if (empty($username)) {
|
if (empty($username)) {
|
||||||
throw new Exception(G::LoadTranslation('ID_USERNAME_REQUIRED'));
|
throw new Exception(G::LoadTranslation('ID_USERNAME_REQUIRED'));
|
||||||
}
|
}
|
||||||
@@ -4273,7 +4350,7 @@ function PMFCaseInformation($caseUid, $delIndex = 0, $returnAppData = false)
|
|||||||
/**
|
/**
|
||||||
* Convert to string
|
* Convert to string
|
||||||
*
|
*
|
||||||
* @param variant $vValue
|
* @param string $vValue
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function pmToString($vValue)
|
function pmToString($vValue)
|
||||||
@@ -4284,7 +4361,7 @@ function pmToString($vValue)
|
|||||||
/**
|
/**
|
||||||
* Convert to integer
|
* Convert to integer
|
||||||
*
|
*
|
||||||
* @param variant $vValue
|
* @param string $vValue
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
function pmToInteger($vValue)
|
function pmToInteger($vValue)
|
||||||
@@ -4295,7 +4372,7 @@ function pmToInteger($vValue)
|
|||||||
/**
|
/**
|
||||||
* Convert to float
|
* Convert to float
|
||||||
*
|
*
|
||||||
* @param variant $vValue
|
* @param string $vValue
|
||||||
* @return float
|
* @return float
|
||||||
*/
|
*/
|
||||||
function pmToFloat($vValue)
|
function pmToFloat($vValue)
|
||||||
@@ -4306,7 +4383,7 @@ function pmToFloat($vValue)
|
|||||||
/**
|
/**
|
||||||
* Convert to Url
|
* Convert to Url
|
||||||
*
|
*
|
||||||
* @param variant $vValue
|
* @param string $vValue
|
||||||
* @return url
|
* @return url
|
||||||
*/
|
*/
|
||||||
function pmToUrl($vValue)
|
function pmToUrl($vValue)
|
||||||
@@ -4441,7 +4518,7 @@ function registerError($iType, $sError, $iLine, $sCode)
|
|||||||
/**
|
/**
|
||||||
* Obtain engine Data Base name
|
* Obtain engine Data Base name
|
||||||
*
|
*
|
||||||
* @param type $connection
|
* @param object $connection
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
function getEngineDataBaseName($connection)
|
function getEngineDataBaseName($connection)
|
||||||
@@ -4454,9 +4531,9 @@ function getEngineDataBaseName($connection)
|
|||||||
* Execute Queries for Oracle Database
|
* Execute Queries for Oracle Database
|
||||||
*
|
*
|
||||||
* @param type $sql
|
* @param type $sql
|
||||||
* @param type $connection
|
* @param object $connection
|
||||||
*/
|
*/
|
||||||
function executeQueryOci($sql, $connection, $aParameter = array(), $dbsEncode = "")
|
function executeQueryOci($sql, $connection, $aParameter = [], $dbsEncode = "")
|
||||||
{
|
{
|
||||||
$aDNS = $connection->getDSN();
|
$aDNS = $connection->getDSN();
|
||||||
|
|
||||||
@@ -4496,7 +4573,7 @@ function executeQueryOci($sql, $connection, $aParameter = array(), $dbsEncode =
|
|||||||
}
|
}
|
||||||
oci_execute($stid, OCI_DEFAULT);
|
oci_execute($stid, OCI_DEFAULT);
|
||||||
|
|
||||||
$result = Array();
|
$result = [];
|
||||||
$i = 1;
|
$i = 1;
|
||||||
while ($row = oci_fetch_array($stid, OCI_ASSOC + OCI_RETURN_NULLS)) {
|
while ($row = oci_fetch_array($stid, OCI_ASSOC + OCI_RETURN_NULLS)) {
|
||||||
$result[$i++] = $row;
|
$result[$i++] = $row;
|
||||||
@@ -4532,7 +4609,7 @@ function executeQueryOci($sql, $connection, $aParameter = array(), $dbsEncode =
|
|||||||
default:
|
default:
|
||||||
// Stored procedures
|
// Stored procedures
|
||||||
$stid = oci_parse($conn, $sql);
|
$stid = oci_parse($conn, $sql);
|
||||||
$aParameterRet = array();
|
$aParameterRet = [];
|
||||||
if (count($aParameter) > 0) {
|
if (count($aParameter) > 0) {
|
||||||
foreach ($aParameter as $key => $val) {
|
foreach ($aParameter as $key => $val) {
|
||||||
$aParameterRet[$key] = $val;
|
$aParameterRet[$key] = $val;
|
||||||
|
|||||||
Reference in New Issue
Block a user