Skip to content

Commit 93c7a95

Browse files
authored
Merge pull request #5 from LaswitchTech/dev
v0.0.4
2 parents 5f85998 + 85298c2 commit 93c7a95

File tree

5 files changed

+130
-72
lines changed

5 files changed

+130
-72
lines changed

Endpoint.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ public function fetchAction(): array
7575
]);
7676
}
7777

78+
// Check if the Documents is accessible
79+
if($this->Helper->Core->isInstalled('documents')){
80+
$message['data']['dependencies']['documents'] = $this->Model->Documents->fetchAll([
81+
["key" => "targetTable", "operator" => "=", "value" => $this->basename],
82+
["key" => "targetId", "operator" => "=", "value" => $message['data']['record']['id']],
83+
["key" => "isArchived", "operator" => "<>", "value" => 1],
84+
]);
85+
}
86+
7887
// Check if the Notes is accessible
7988
if($this->Helper->Core->isInstalled('notes')){
8089
$message['data']['dependencies']['notes'] = $this->Model->Notes->fetchAll([
@@ -84,7 +93,7 @@ public function fetchAction(): array
8493
]);
8594
}
8695

87-
// Check if the Services is accessible
96+
// Check if the Inventory is accessible
8897
if($this->Helper->Core->isInstalled('inventory')){
8998
$message['data']['dependencies']['inventory'] = $this->Model->Inventory->fetchAll([
9099
["key" => "targetTable", "operator" => "=", "value" => $this->basename],

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.0.3
1+
v0.0.4

View/details.php

Lines changed: 116 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -129,74 +129,122 @@ class: {
129129
},
130130
function(tabs,card){
131131
card._component.body.removeClass('card-body');
132-
tabs.add(
133-
'notes',
134-
{
135-
icon: "stickies",
136-
label: builder.Locale.get("Notes"),
137-
},
138-
function(tab,nav){
139-
NotesFeed(builder.Storage.get('dependencies:notes') ?? {}, tab, 'users', builder.Storage.get('record:id'));
140-
},
141-
);
142-
tabs.add(
143-
'contacts',
144-
{
145-
icon: "person-vcard",
146-
label: builder.Locale.get("Contacts"),
147-
},
148-
function(tab,nav){
149-
ContactsFeed(builder.Storage.get('dependencies:contacts') ?? {}, tab, {
150-
"address": builder.Storage.get('record:vcard:address'),
151-
"city": builder.Storage.get('record:vcard:city'),
152-
"country": builder.Storage.get('record:vcard:country:name'),
153-
"state": builder.Storage.get('record:vcard:state:name'),
154-
"zipcode": builder.Storage.get('record:vcard:zipcode'),
155-
"locale": builder.Storage.get('record:vcard:locale'),
156-
"phone": builder.Storage.get('record:vcard:phone'),
157-
"targetTable": "users",
158-
"targetId": builder.Storage.get('record:id'),
159-
});
160-
},
161-
);
162-
tabs.add(
163-
'files',
164-
{
165-
icon: "file-earmark",
166-
label: builder.Locale.get("Files"),
167-
},
168-
function(tab,nav){
169-
FilesFeed(builder.Storage.get('dependencies:files') ?? {}, tab, {
170-
targetTable: "users",
171-
targetId: builder.Storage.get('record:id'),
172-
isPublic: 1,
173-
});
174-
},
175-
);
176-
tabs.add(
177-
'activities',
178-
{
179-
icon: "activity",
180-
label: builder.Locale.get("Activity"),
181-
},
182-
function(tab,nav){
183-
tab.addClass('px-4 py-3');
184-
EventFeed(builder.Storage.get('dependencies:event') ?? {}, tab);
185-
},
186-
);
187-
tabs.add(
188-
'related',
189-
{
190-
icon: "diagram-2",
191-
label: builder.Locale.get("Related"),
192-
},
193-
function(tab,nav){
194-
tab.addClass('px-4 py-3');
195-
RelationshipFeed(builder.Storage.getKey(), tab, function(feed){
196-
// card.related.feed = feed;
197-
});
198-
},
199-
);
132+
<?php if($this->Helper->Core->isInstalled('notes')): ?>
133+
tabs.add(
134+
'notes',
135+
{
136+
icon: "stickies",
137+
label: builder.Locale.get("Notes"),
138+
},
139+
function(tab,nav){
140+
NotesFeed(builder.Storage.get('dependencies:notes') ?? {}, tab, 'users', builder.Storage.get('record:id'));
141+
},
142+
);
143+
<?php endif; ?>
144+
<?php if($this->Helper->Core->isInstalled('contacts')): ?>
145+
tabs.add(
146+
'contacts',
147+
{
148+
icon: "person-vcard",
149+
label: builder.Locale.get("Contacts"),
150+
},
151+
function(tab,nav){
152+
ContactsFeed(builder.Storage.get('dependencies:contacts') ?? {}, tab, {
153+
"address": builder.Storage.get('record:vcard:address'),
154+
"city": builder.Storage.get('record:vcard:city'),
155+
"country": builder.Storage.get('record:vcard:country:name'),
156+
"state": builder.Storage.get('record:vcard:state:name'),
157+
"zipcode": builder.Storage.get('record:vcard:zipcode'),
158+
"locale": builder.Storage.get('record:vcard:locale'),
159+
"phone": builder.Storage.get('record:vcard:phone'),
160+
"targetTable": "users",
161+
"targetId": builder.Storage.get('record:id'),
162+
});
163+
},
164+
);
165+
<?php endif; ?>
166+
<?php if($this->Helper->Core->isInstalled('files')): ?>
167+
tabs.add(
168+
'files',
169+
{
170+
icon: "file-earmark",
171+
label: builder.Locale.get("Files"),
172+
},
173+
function(tab,nav){
174+
FilesFeed(builder.Storage.get('dependencies:files') ?? {}, tab, {
175+
targetTable: "users",
176+
targetId: builder.Storage.get('record:id'),
177+
isPublic: 1,
178+
});
179+
},
180+
);
181+
<?php endif; ?>
182+
<?php if($this->Helper->Core->isInstalled('documents')): ?>
183+
tabs.add(
184+
'documents',
185+
{
186+
icon: "file-earmark-richtext",
187+
label: builder.Locale.get("Documents"),
188+
},
189+
function(tab,nav){
190+
card.files = tab;
191+
docvals = {
192+
"locale": builder.Storage.get('record:vcard:locale'),
193+
"name": builder.Storage.get('record:vcard:name'),
194+
"title": builder.Storage.get('record:vcard:title'),
195+
"role": builder.Storage.get('record:vcard:role'),
196+
"address": builder.Storage.get('record:vcard:address'),
197+
"city": builder.Storage.get('record:vcard:city'),
198+
"state": builder.Storage.get('record:vcard:state:name'),
199+
"zipcode": builder.Storage.get('record:vcard:zipcode'),
200+
"country": builder.Storage.get('record:vcard:country:name'),
201+
"phone": builder.Storage.get('record:vcard:phone'),
202+
"mobile": builder.Storage.get('record:vcard:mobile'),
203+
"tollfree": builder.Storage.get('record:vcard:tollfree'),
204+
"fax": builder.Storage.get('record:vcard:fax'),
205+
"website": builder.Storage.get('record:vcard:website'),
206+
};
207+
builder.Helper.urlToBase64("/profile/avatar?username="+builder.Storage.get('record:username')).then(dataURI => {
208+
docvals.avatar = dataURI;
209+
DocumentsFeed(builder.Storage.get('dependencies:documents') ?? [], tab, {
210+
targetTable: "users",
211+
targetId: builder.Storage.get('record:id'),
212+
isPublic: 1,
213+
locale: builder.Storage.get('record:vcard:locale'),
214+
docvals: docvals,
215+
}, builder.Storage.get('record:vcard:locale'));
216+
});
217+
},
218+
);
219+
<?php endif; ?>
220+
<?php if($this->Helper->Core->isInstalled('event')): ?>
221+
tabs.add(
222+
'activities',
223+
{
224+
icon: "activity",
225+
label: builder.Locale.get("Activity"),
226+
},
227+
function(tab,nav){
228+
tab.addClass('px-4 py-3');
229+
EventFeed(builder.Storage.get('dependencies:event') ?? {}, tab);
230+
},
231+
);
232+
<?php endif; ?>
233+
<?php if($this->Helper->Core->isInstalled('relationship')): ?>
234+
tabs.add(
235+
'related',
236+
{
237+
icon: "diagram-2",
238+
label: builder.Locale.get("Related"),
239+
},
240+
function(tab,nav){
241+
tab.addClass('px-4 py-3');
242+
RelationshipFeed(builder.Storage.getKey(), tab, function(feed){
243+
// card.related.feed = feed;
244+
});
245+
},
246+
);
247+
<?php endif; ?>
200248
},
201249
);
202250
},

View/index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ class:{
8989
callback:{
9090
val: function(values){
9191
values.username = values.email;
92+
values.isVerified = 1;
9293
return values;
9394
},
9495
submit: function(form){

info.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"base": "users",
55
"author": "LaswitchTech",
66
"email": "support@laswitchtech.com",
7-
"date": "2025-06-27",
8-
"version": "v0.0.3",
7+
"date": "2025-07-09",
8+
"version": "v0.0.4",
99
"tags": "users, management, authentication, roles, permissions",
1010
"description": "This plugin provides user management capabilities, including authentication, role-based access control, and user profile management. It allows for the creation, modification, and deletion of users, as well as the assignment of roles and permissions to control access to various parts of the system.",
1111
"repository": "https://github.com/LaswitchTech/core-plugin-users",

0 commit comments

Comments
 (0)