Split clients and projects modules
This commit is contained in:
1 parent
854e1038c6
commit
0f7530024e
8 files changed
+181
-1
No files matched your search
@@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
Copyright (c) 2020 [Glacies UG, Berlin, Germany] (http://glacies.de)
|
||||||
|
Developer: Thilina Hasantha (http://lk.linkedin.com/in/thilinah | https://github.com/thilinah)
|
||||||
|
*/
|
||||||
|
|
||||||
|
$moduleName = 'clients';
|
||||||
|
$moduleGroup = 'admin';
|
||||||
|
define('MODULE_PATH',dirname(__FILE__));
|
||||||
|
include APP_BASE_PATH.'header.php';
|
||||||
|
include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||||
|
?><div class="span9">
|
||||||
|
|
||||||
|
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
|
||||||
|
<li class="active"><a id="tabClient" href="#tabPageClient"><?=t('Clients')?></a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="tab-content">
|
||||||
|
<div class="tab-pane active" id="tabPageClient">
|
||||||
|
<div id="Client" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div id="ClientForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
var modJsList = [];
|
||||||
|
|
||||||
|
modJsList['tabClient'] = new ClientAdapter('Client','Client');
|
||||||
|
|
||||||
|
<?php if(isset($modulePermissions['perm']['Add Clients']) && $modulePermissions['perm']['Add Clients'] == "No"){?>
|
||||||
|
modJsList['tabClient'].setShowAddNew(false);
|
||||||
|
<?php }?>
|
||||||
|
|
||||||
|
<?php if(isset($modulePermissions['perm']['Delete Clients']) && $modulePermissions['perm']['Delete Clients'] == "No"){?>
|
||||||
|
modJsList['tabClient'].setShowDelete(false);
|
||||||
|
<?php }?>
|
||||||
|
|
||||||
|
<?php if(isset($modulePermissions['perm']['Edit Clients']) && $modulePermissions['perm']['Edit Clients'] == "No"){?>
|
||||||
|
modJsList['tabClient'].setShowSave(false);
|
||||||
|
<?php }?>
|
||||||
|
|
||||||
|
|
||||||
|
var modJs = modJsList['tabClient'];
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<?php include APP_BASE_PATH.'footer.php';?>
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"label": "Clients",
|
||||||
|
"menu": "Admin",
|
||||||
|
"order": "52",
|
||||||
|
"icon": "fa-user-circle",
|
||||||
|
"user_levels": [
|
||||||
|
"Admin",
|
||||||
|
"Manager"
|
||||||
|
],
|
||||||
|
"dashboardPosition": 4,
|
||||||
|
"permissions": {
|
||||||
|
"Manager": {
|
||||||
|
"Add Clients": "Yes",
|
||||||
|
"Edit Clients": "Yes",
|
||||||
|
"Delete Clients": "No"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"model_namespace": "\\Clients\\Common\\Model",
|
||||||
|
"manager": "\\Clients\\Admin\\Api\\ClientsAdminManager"
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
namespace Clients\Admin\Api;
|
||||||
|
|
||||||
|
use Classes\AbstractModuleManager;
|
||||||
|
|
||||||
|
class ClientsAdminManager extends AbstractModuleManager
|
||||||
|
{
|
||||||
|
|
||||||
|
public function initializeUserClasses()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function initializeFieldMappings()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function initializeDatabaseErrorMappings()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setupModuleClassDefinitions()
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->addModelClass('Client');
|
||||||
|
}
|
||||||
|
}
|
||||||
+9
-1
@@ -6,8 +6,9 @@
|
|||||||
* Time: 5:53 PM
|
* Time: 5:53 PM
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Projects\Common\Model;
|
namespace Clients\Common\Model;
|
||||||
|
|
||||||
|
use Classes\ModuleAccess;
|
||||||
use Model\BaseModel;
|
use Model\BaseModel;
|
||||||
|
|
||||||
class Client extends BaseModel
|
class Client extends BaseModel
|
||||||
@@ -22,4 +23,11 @@ class Client extends BaseModel
|
|||||||
{
|
{
|
||||||
return array("get","element","save","delete");
|
return array("get","element","save","delete");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getModuleAccess()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
new ModuleAccess('clients', 'admin'),
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -154,6 +154,7 @@ gulp.task('admin-js', (done) => {
|
|||||||
let files = [
|
let files = [
|
||||||
'attendance',
|
'attendance',
|
||||||
'company_structure',
|
'company_structure',
|
||||||
|
'clients',
|
||||||
'dashboard',
|
'dashboard',
|
||||||
'data',
|
'data',
|
||||||
'documents',
|
'documents',
|
||||||
|
|||||||
Vendored
+2
@@ -0,0 +1,2 @@
|
|||||||
|
!function e(t,a,l){function i(o,r){if(!a[o]){if(!t[o]){var s="function"==typeof require&&require;if(!r&&s)return s(o,!0);if(n)return n(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=a[o]={exports:{}};t[o][0].call(u.exports,(function(e){return i(t[o][1][e]||e)}),u,u.exports,e,t,a,l)}return a[o].exports}for(var n="function"==typeof require&&require,o=0;o<l.length;o++)i(l[o]);return i}({1:[function(e,t,a){"use strict";var l=e("./lib");window.ClientAdapter=l.ClientAdapter},{"./lib":2}],2:[function(e,t,a){"use strict";var l;function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var a=0;a<t.length;a++){var l=t[a];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,l=u(e);if(t){var i=u(this).constructor;a=Reflect.construct(l,arguments,i)}else a=l.apply(this,arguments);return c(this,a)}}function c(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}(c,e);var t,a,l,i=s(c);function c(){return n(this,c),i.apply(this,arguments)}return t=c,(a=[{key:"getDataMapping",value:function(){return["id","name","details","address","contact_number"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Name"},{sTitle:"Details"},{sTitle:"Address"},{sTitle:"Contact Number"}]}},{key:"getFormFields",value:function(){return this.showSave?[["id",{label:"ID",type:"hidden"}],["name",{label:"Name",type:"text"}],["details",{label:"Details",type:"textarea",validation:"none"}],["address",{label:"Address",type:"textarea",validation:"none"}],["contact_number",{label:"Contact Number",type:"text",validation:"none"}],["contact_email",{label:"Contact Email",type:"text",validation:"none"}],["company_url",{label:"Company Url",type:"text",validation:"none"}],["status",{label:"Status",type:"select",source:[["Active","Active"],["Inactive","Inactive"]]}],["first_contact_date",{label:"First Contact Date",type:"date",validation:"none"}]]:[["id",{label:"ID",type:"hidden"}],["name",{label:"Name",type:"placeholder"}],["details",{label:"Details",type:"placeholder",validation:"none"}],["address",{label:"Address",type:"placeholder",validation:"none"}],["contact_number",{label:"Contact Number",type:"placeholder",validation:"none"}],["contact_email",{label:"Contact Email",type:"placeholder",validation:"none"}],["company_url",{label:"Company Url",type:"placeholder",validation:"none"}],["status",{label:"Status",type:"placeholder",source:[["Active","Active"],["Inactive","Inactive"]]}],["first_contact_date",{label:"First Contact Date",type:"placeholder",validation:"none"}]]}},{key:"getHelpLink",value:function(){return"http://blog.icehrm.com/docs/projects/"}}])&&o(t.prototype,a),l&&o(t,l),c}(((l=e("../../../api/AdapterBase"))&&l.__esModule?l:{default:l}).default);t.exports={ClientAdapter:d}},{"../../../api/AdapterBase":4}],3:[function(e,t,a){"use strict";function l(e,t){for(var a=0;a<t.length;a++){var l=t[a];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,a,i;return t=e,(a=[{key:"getKey",value:function(e,t){var a="".concat(e,"|");for(var l in t)a+="".concat(l,"=").concat(t[l],"|");return a}},{key:"invalidateTable",value:function(e){for(var t,a=0;a<localStorage.length;a++)(t=localStorage.key(a)).indexOf("t=".concat(e))>0&&localStorage.removeItem(t)}},{key:"getData",value:function(e){var t;if("undefined"==typeof Storage)return null;var a=localStorage.getItem(e);return void 0!==a&&null!=a&&""!==a?void 0===(t=JSON.parse(a))||null==t||void 0!==t.status&&null!=t.status&&"SUCCESS"!==t.status?null:t:null}},{key:"setData",value:functioLine truncated
|
||||||
|
//# sourceMappingURL=clients.js.map
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import {
|
||||||
|
ClientAdapter,
|
||||||
|
} from './lib';
|
||||||
|
|
||||||
|
window.ClientAdapter = ClientAdapter;
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2018 [Glacies UG, Berlin, Germany] (http://glacies.de)
|
||||||
|
Developer: Thilina Hasantha (http://lk.linkedin.com/in/thilinah | https://github.com/thilinah)
|
||||||
|
*/
|
||||||
|
|
||||||
|
import AdapterBase from '../../../api/AdapterBase';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClientAdapter
|
||||||
|
*/
|
||||||
|
|
||||||
|
class ClientAdapter extends AdapterBase {
|
||||||
|
getDataMapping() {
|
||||||
|
return [
|
||||||
|
'id',
|
||||||
|
'name',
|
||||||
|
'details',
|
||||||
|
'address',
|
||||||
|
'contact_number',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
getHeaders() {
|
||||||
|
return [
|
||||||
|
{ sTitle: 'ID', bVisible: false },
|
||||||
|
{ sTitle: 'Name' },
|
||||||
|
{ sTitle: 'Details' },
|
||||||
|
{ sTitle: 'Address' },
|
||||||
|
{ sTitle: 'Contact Number' },
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
getFormFields() {
|
||||||
|
if (this.showSave) {
|
||||||
|
return [
|
||||||
|
['id', { label: 'ID', type: 'hidden' }],
|
||||||
|
['name', { label: 'Name', type: 'text' }],
|
||||||
|
['details', { label: 'Details', type: 'textarea', validation: 'none' }],
|
||||||
|
['address', { label: 'Address', type: 'textarea', validation: 'none' }],
|
||||||
|
['contact_number', { label: 'Contact Number', type: 'text', validation: 'none' }],
|
||||||
|
['contact_email', { label: 'Contact Email', type: 'text', validation: 'none' }],
|
||||||
|
['company_url', { label: 'Company Url', type: 'text', validation: 'none' }],
|
||||||
|
['status', { label: 'Status', type: 'select', source: [['Active', 'Active'], ['Inactive', 'Inactive']] }],
|
||||||
|
['first_contact_date', { label: 'First Contact Date', type: 'date', validation: 'none' }],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
return [
|
||||||
|
['id', { label: 'ID', type: 'hidden' }],
|
||||||
|
['name', { label: 'Name', type: 'placeholder' }],
|
||||||
|
['details', { label: 'Details', type: 'placeholder', validation: 'none' }],
|
||||||
|
['address', { label: 'Address', type: 'placeholder', validation: 'none' }],
|
||||||
|
['contact_number', { label: 'Contact Number', type: 'placeholder', validation: 'none' }],
|
||||||
|
['contact_email', { label: 'Contact Email', type: 'placeholder', validation: 'none' }],
|
||||||
|
['company_url', { label: 'Company Url', type: 'placeholder', validation: 'none' }],
|
||||||
|
['status', { label: 'Status', type: 'placeholder', source: [['Active', 'Active'], ['Inactive', 'Inactive']] }],
|
||||||
|
['first_contact_date', { label: 'First Contact Date', type: 'placeholder', validation: 'none' }],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
getHelpLink() {
|
||||||
|
return 'http://blog.icehrm.com/docs/projects/';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
ClientAdapter,
|
||||||
|
};
|
||||||
Reference in new issue
Block a user