Refactor project structure

This commit is contained in:
Thilina Hasantha
2018-04-29 17:46:42 +02:00
parent 889baf124c
commit e3a7e18d9c
5513 changed files with 32 additions and 27 deletions

View File

@@ -0,0 +1,36 @@
<?php
/**
* Created by PhpStorm.
* User: Thilina
* Date: 8/20/17
* Time: 8:04 AM
*/
namespace Travel\Common\Model;
use Model\BaseModel;
class EmployeeImmigration extends BaseModel
{
public $table = 'EmployeeImmigrations';
public function getAdminAccess()
{
return array("get","element","save","delete");
}
public function getManagerAccess()
{
return array("get","element","save","delete");
}
public function getUserAccess()
{
return array("get");
}
public function getUserOnlyMeAccess()
{
return array("element","save","delete");
}
}

View File

@@ -0,0 +1,74 @@
<?php
/**
* Created by PhpStorm.
* User: Thilina
* Date: 8/20/17
* Time: 8:05 AM
*/
namespace Travel\Common\Model;
use Classes\SettingsManager;
use Model\ApproveModel;
class EmployeeTravelRecord extends ApproveModel
{
public $table = 'EmployeeTravelRecords';
public $notificationModuleName = "Travel Management";
public $notificationUnitName = "TravelRequest";
public $notificationUnitPrefix = "A";
public $notificationUnitAdminUrl
= "g=modules&n=travel&m=module_Travel_Management#tabSubordinateEmployeeTravelRecord";
public $preApproveSettingName = "Travel: Pre-Approve Travel Request";
public function isMultiLevelApprovalsEnabled()
{
return (SettingsManager::getInstance()->getSetting('Travel: Enable Multi Level Approvals') == '1');
}
public function getAdminAccess()
{
return array("get", "element", "save", "delete");
}
public function getManagerAccess()
{
return array("get", "element", "save", "delete");
}
public function getUserAccess()
{
return array("get");
}
public function getUserOnlyMeAccess()
{
return array("element", "save", "delete");
}
public function fieldsNeedToBeApproved()
{
return array(
"travel_from",
"travel_to",
"travel_date",
"return_date",
"funding",
"currency"
);
}
public function getType()
{
return 'EmployeeTravelRecord';
}
public function allowIndirectMapping()
{
if (SettingsManager::getInstance()->getSetting('Travel: Allow Indirect Admins to Approve') == '1') {
return true;
}
return false;
}
}

View File

@@ -0,0 +1,26 @@
<?php
/**
* Created by PhpStorm.
* User: Thilina
* Date: 8/20/17
* Time: 8:06 AM
*/
namespace Travel\Common\Model;
class EmployeeTravelRecordApproval extends EmployeeTravelRecord
{
// @codingStandardsIgnoreStart
public function Find($whereOrderBy, $bindarr = false, $pkeysArr = false, $extra = array())
{
// @codingStandardsIgnoreEnd
return $this->findApprovals(
new EmployeeTravelRecord(),
$whereOrderBy,
$bindarr,
$pkeysArr,
$extra
);
}
}

View File

@@ -0,0 +1,36 @@
<?php
/**
* Created by PhpStorm.
* User: Thilina
* Date: 8/20/17
* Time: 8:03 AM
*/
namespace Travel\Common\Model;
use Model\BaseModel;
class ImmigrationDocument extends BaseModel
{
public $table = 'ImmigrationDocuments';
public function getAdminAccess()
{
return array("get","element","save","delete");
}
public function getManagerAccess()
{
return array("get","element","save","delete");
}
public function getUserAccess()
{
return array("get");
}
public function getUserOnlyMeAccess()
{
return array("get","element");
}
}