PMC-783
This commit is contained in:
18
database/factories/AppAssignSelfServiceValueFactory.php
Normal file
18
database/factories/AppAssignSelfServiceValueFactory.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Model factory for a APP_ASSIGN_SELF_SERVICE_VALUE
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\AppAssignSelfServiceValue::class, function(Faker $faker) {
|
||||
return [
|
||||
'ID' => $faker->unique()->numberBetween(1, 2000),
|
||||
'APP_UID' => G::generateUniqueID(),
|
||||
'DEL_INDEX' => 2,
|
||||
'PRO_UID' => G::generateUniqueID(),
|
||||
'TAS_UID' => G::generateUniqueID(),
|
||||
'TAS_ID' => $faker->unique()->numberBetween(1, 2000),
|
||||
'GRP_UID' => G::generateUniqueID(),
|
||||
];
|
||||
});
|
||||
|
||||
15
database/factories/AppAssignSelfServiceValueGroupFactory.php
Normal file
15
database/factories/AppAssignSelfServiceValueGroupFactory.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* Model factory for a APP_ASSIGN_SELF_SERVICE_VALUE_GROUP
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\AppAssignSelfServiceValueGroup::class, function(Faker $faker) {
|
||||
return [
|
||||
'ID' => $faker->unique()->numberBetween(1, 2000),
|
||||
'GRP_UID' => G::generateUniqueID(),
|
||||
'ASSIGNEE_ID' => $faker->unique()->numberBetween(1, 2000),
|
||||
'ASSIGNEE_TYPE' => $faker->unique()->numberBetween(1, 2000),
|
||||
];
|
||||
});
|
||||
|
||||
14
database/factories/GroupUserFactory.php
Normal file
14
database/factories/GroupUserFactory.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* Model factory for a group user relation
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\GroupUser::class, function(Faker $faker) {
|
||||
return [
|
||||
'GRP_UID' => G::generateUniqueID(),
|
||||
'GRP_ID' => $faker->unique()->numberBetween(1, 2000),
|
||||
'USR_UID' => G::generateUniqueID()
|
||||
];
|
||||
});
|
||||
|
||||
17
database/factories/GroupwfFactory.php
Normal file
17
database/factories/GroupwfFactory.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* Model factory for a groups
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\Groupwf::class, function(Faker $faker) {
|
||||
return [
|
||||
'GRP_UID' => G::generateUniqueID(),
|
||||
'GRP_ID' => $faker->unique()->numberBetween(1, 2000),
|
||||
'GRP_TITLE' => $faker->sentence(2),
|
||||
'GRP_STATUS' => 'ACTIVE',
|
||||
'GRP_LDAP_DN' => '',
|
||||
'GRP_UX' => 'NORMAL',
|
||||
];
|
||||
});
|
||||
|
||||
40
database/factories/ListUnassignedFactory.php
Normal file
40
database/factories/ListUnassignedFactory.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Model factory for a list unassigned
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\ListUnassigned::class, function (Faker $faker) {
|
||||
$app = factory(\ProcessMaker\Model\Application::class)->create();
|
||||
$process = \ProcessMaker\Model\Process::where('PRO_UID', $app->PRO_UID)->first();
|
||||
$task = $process->tasks->first();
|
||||
// Grab a user if random
|
||||
$users = \ProcessMaker\Model\User::all();
|
||||
if(!count($users)) {
|
||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
||||
} else{
|
||||
$user = $users->random();
|
||||
}
|
||||
|
||||
return [
|
||||
'APP_UID' => $app->APP_UID,
|
||||
'DEL_INDEX' => 1,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'PRO_UID' => $app->PRO_UID,
|
||||
'APP_NUMBER' => $app->APP_NUMBER,
|
||||
'APP_TITLE' => $app->APP_TITLE,
|
||||
'APP_PRO_TITLE' => $process->PRO_TITLE,
|
||||
'APP_TAS_TITLE' => $task->TAS_TITLE,
|
||||
'DEL_PREVIOUS_USR_USERNAME' => $user->USR_USERNAME,
|
||||
'DEL_PREVIOUS_USR_FIRSTNAME' => $user->USR_FIRSTNAME,
|
||||
'DEL_PREVIOUS_USR_LASTNAME' => $user->USR_LASTNAME,
|
||||
'APP_UPDATE_DATE' => $faker->dateTime(),
|
||||
'DEL_PREVIOUS_USR_UID' => G::generateUniqueID(),
|
||||
'DEL_DELEGATE_DATE' => $faker->dateTime(),
|
||||
'DEL_DUE_DATE' => $faker->dateTime(),
|
||||
'DEL_PRIORITY' => 3,
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
'TAS_ID' => $task->TAS_ID,
|
||||
];
|
||||
});
|
||||
|
||||
@@ -15,6 +15,7 @@ $factory->define(\ProcessMaker\Model\Process::class, function(Faker $faker) {
|
||||
'PRO_CREATE_USER' => '00000000000000000000000000000001',
|
||||
'PRO_DYNAFORMS' => '',
|
||||
'PRO_ITEE' => 1,
|
||||
'PRO_STATUS' => 'ACTIVE'
|
||||
];
|
||||
|
||||
$task1 = factory(\ProcessMaker\Model\Task::class)
|
||||
|
||||
@@ -11,6 +11,7 @@ $factory->define(\ProcessMaker\Model\Task::class, function(Faker $faker) {
|
||||
return $process->PRO_UID;
|
||||
},
|
||||
'TAS_UID' => G::generateUniqueID(),
|
||||
'TAS_ID' => $faker->unique()->numberBetween(1, 2000),
|
||||
'TAS_TITLE' => $faker->sentence(2),
|
||||
'TAS_TYPE' => 'NORMAL',
|
||||
'TAS_TYPE_DAY' => 1,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AppAssignSelfServiceValue extends Model
|
||||
{
|
||||
protected $table = 'APP_ASSIGN_SELF_SERVICE_VALUE';
|
||||
protected $primaryKey = 'ID';
|
||||
// We do not have create/update timestamps for this table
|
||||
public $timestamps = false;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AppAssignSelfServiceValueGroup extends Model
|
||||
{
|
||||
protected $table = 'APP_ASSIGN_SELF_SERVICE_VALUE_GROUP';
|
||||
// We do not have create/update timestamps for this table
|
||||
public $timestamps = false;
|
||||
}
|
||||
|
||||
13
workflow/engine/src/ProcessMaker/Model/GroupUser.php
Normal file
13
workflow/engine/src/ProcessMaker/Model/GroupUser.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class GroupUser extends Model
|
||||
{
|
||||
protected $table = 'GROUP_USER';
|
||||
// We do not have create/update timestamps for this table
|
||||
public $timestamps = false;
|
||||
}
|
||||
|
||||
14
workflow/engine/src/ProcessMaker/Model/Groupwf.php
Normal file
14
workflow/engine/src/ProcessMaker/Model/Groupwf.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Groupwf extends Model
|
||||
{
|
||||
protected $table = 'GROUPWF';
|
||||
protected $primaryKey = 'GRP_ID';
|
||||
// We do not have create/update timestamps for this table
|
||||
public $timestamps = false;
|
||||
}
|
||||
|
||||
70
workflow/engine/src/ProcessMaker/Model/ListUnassigned.php
Normal file
70
workflow/engine/src/ProcessMaker/Model/ListUnassigned.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use ListUnassigned as PropelListUnassigned;
|
||||
|
||||
class ListUnassigned extends Model
|
||||
{
|
||||
protected $table = "LIST_UNASSIGNED";
|
||||
// No timestamps
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* Returns the application this belongs to
|
||||
*/
|
||||
public function application()
|
||||
{
|
||||
return $this->belongsTo(Application::class, 'APP_UID', 'APP_UID');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the process task this belongs to
|
||||
*/
|
||||
public function task()
|
||||
{
|
||||
return $this->belongsTo(Task::class, 'TAS_ID', 'TAS_ID');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the process this belongs to
|
||||
*/
|
||||
public function process()
|
||||
{
|
||||
return $this->belongsTo(Process::class, 'PRO_ID', 'PRO_ID');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get count
|
||||
*
|
||||
* @param string $userUid
|
||||
* @param array $filters
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function doCount($userUid, $filters = [])
|
||||
{
|
||||
$list = new PropelListUnassigned();
|
||||
$result = $list->getCountList($userUid, $filters);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Search data
|
||||
*
|
||||
* @param string $userUid
|
||||
* @param array $filters
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function loadList($userUid, $filters = [])
|
||||
{
|
||||
$list = new PropelListUnassigned();
|
||||
$result = $list->loadList($userUid, $filters);
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Task extends Model
|
||||
{
|
||||
protected $table = 'TASK';
|
||||
protected $primaryKey = 'TAS_ID';
|
||||
// We do not have create/update timestamps for this table
|
||||
public $timestamps = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user