Weekly sync 2022-07-04
This commit is contained in:
parent
eab59a060b
commit
6cbf608b94
|
@ -581,6 +581,9 @@ class baseClass extends dbStoredBase implements \JsonSerializable, jsonImportabl
|
|||
$where = (empty($where)?"":"(".$where.") AND ")."`".static::$deletedFieldName."` = 0";
|
||||
}
|
||||
|
||||
$pageSize=is_numeric($pageSize)?((int)$pageSize):null;
|
||||
$page=is_numeric($page)?((int)$page):null;
|
||||
|
||||
if ($pageSize!==null) {
|
||||
if ($page<1) { $page=1;}
|
||||
$limit = "LIMIT ".($pageSize*($page-1)).", ".$pageSize;
|
||||
|
|
|
@ -25,7 +25,7 @@ class s3client implements objectStorageClient
|
|||
|
||||
protected string $prefix = "";
|
||||
|
||||
protected \Aws\S3\S3Client $s3;
|
||||
protected ?\Aws\S3\S3Client $s3;
|
||||
|
||||
public function __construct($endpoint = null, $accessKey = null, $secretKey = null, $regionId = null, $prefix = null)
|
||||
{
|
||||
|
@ -78,6 +78,7 @@ class s3client implements objectStorageClient
|
|||
"Key" => $key,
|
||||
"Body" => $data
|
||||
]);
|
||||
gc_collect_cycles();
|
||||
}
|
||||
|
||||
public function deleteObject($bucket, $key)
|
||||
|
@ -88,13 +89,34 @@ class s3client implements objectStorageClient
|
|||
]);
|
||||
}
|
||||
|
||||
public function listObjects($bucket)
|
||||
public function listObjects($bucket, $marker=0)
|
||||
{
|
||||
return $this->s3->listObjects([
|
||||
"Bucket" => $this->prefix . $bucket
|
||||
"Bucket" => $this->prefix . $bucket,
|
||||
"Marker"=>$marker
|
||||
])["Contents"];
|
||||
}
|
||||
|
||||
public function listAllObjects($bucket)
|
||||
{
|
||||
$rv=[];
|
||||
$cnt=0;
|
||||
$marker=null;
|
||||
while(true) {
|
||||
$cx=0;
|
||||
$list = $this->listObjects($bucket,$marker);
|
||||
if ($list==null) { break; }
|
||||
foreach ($list as $key=>$obj) {
|
||||
$cnt++;
|
||||
$cx++;
|
||||
$rv[]=$obj;
|
||||
$marker=$obj["Key"];
|
||||
}
|
||||
if ($cx==0) { break; }
|
||||
}
|
||||
return $rv;
|
||||
}
|
||||
|
||||
public function exec($method, $args = [])
|
||||
{
|
||||
return $this->s3->{$method}($args);
|
||||
|
@ -113,6 +135,10 @@ class s3client implements objectStorageClient
|
|||
"Bucket" => $this->prefix . $bucket
|
||||
]);
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
$this->s3=null;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -332,15 +332,7 @@ class user extends baseClass implements externalCallable
|
|||
$request->getRequestBodyItem("page"),
|
||||
$opts
|
||||
);
|
||||
|
||||
if (! $request->user->checkAccess("adminUsers", "core")) {
|
||||
throw new foxException("Forbidden", 403);
|
||||
}
|
||||
$pageSize=common::clearInput($request->requestBody->pageSize,"0-9");
|
||||
if (empty($pageSize)) { $pageSize=$request->user->config["pageSize"];}
|
||||
|
||||
return static::search(common::clearInput($request->requestBody->pattern), $pageSize)->result;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static function APIX_GET_sendEMailConfirmation(request $request) {
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
import * as UI from './ui.js';
|
||||
import { langPack } from './langpack.js';
|
||||
|
||||
export function loadModule(modPath) {
|
||||
import(modPath).then(function(mod) {
|
||||
mod.load();
|
||||
})
|
||||
}
|
||||
|
||||
// errDict
|
||||
export function exec(requestType, method , data, onSuccess,noblank,onError,version)
|
||||
{
|
||||
|
|
|
@ -97,7 +97,21 @@ async function compEdit_Click(el) {
|
|||
|
||||
buttons[langPack.core.iface.dialodCloseButton]=function() { UI.closeDialog('ItemAdd'); }
|
||||
|
||||
UI.createDialog(
|
||||
compAddEditDialog_Create(langPack.core.iface.edit, buttons);
|
||||
|
||||
await API.exec("GET",UI.parceURL().module+"/company/"+id,{}, function onAjaxSuccess(json,_textStatus) {
|
||||
$("#cao_name").val(json.data.name);
|
||||
$("#cao_qName").val(json.data.qName);
|
||||
$("#cao_description").val(json.data.description);
|
||||
$("#cao_type").val(json.data.type);
|
||||
|
||||
});
|
||||
|
||||
UI.openDialog('ItemAdd');
|
||||
}
|
||||
|
||||
function compAddEditDialog_Create(title, buttons) {
|
||||
UI.createDialog(
|
||||
UI.addFieldGroup([
|
||||
UI.addField({title: langPack.core.iface.title, item: "cao_name", type: "input",reqx: true}),
|
||||
UI.addField({title: langPack.core.iface.comps.qName, item: "cao_qName", type: "input",reqx: true}),
|
||||
|
@ -110,22 +124,11 @@ async function compEdit_Click(el) {
|
|||
{val:"parner",title: langPack.core.iface.comps.partner},
|
||||
]}),
|
||||
]),
|
||||
langPack.core.iface.edit,
|
||||
title,
|
||||
buttons,
|
||||
350,1,'ItemAdd'
|
||||
);
|
||||
|
||||
await API.exec("GET",UI.parceURL().module+"/company/"+id,{}, function onAjaxSuccess(json,_textStatus) {
|
||||
$("#cao_name").val(json.data.name);
|
||||
$("#cao_qName").val(json.data.qName);
|
||||
$("#cao_description").val(json.data.description);
|
||||
$("#cao_type").val(json.data.type);
|
||||
|
||||
});
|
||||
|
||||
UI.openDialog('ItemAdd');
|
||||
}
|
||||
|
||||
function btnCmpAdd_Click(ref) {
|
||||
var buttons={};
|
||||
buttons[langPack.core.iface.dialodAddButton]=function() {
|
||||
|
@ -145,23 +148,7 @@ function btnCmpAdd_Click(ref) {
|
|||
|
||||
buttons[langPack.core.iface.dialodCloseButton]=function() { UI.closeDialog('ItemAdd'); }
|
||||
|
||||
UI.createDialog(
|
||||
UI.addFieldGroup([
|
||||
UI.addField({title: langPack.core.iface.title, item: "cao_name", type: "input",reqx: true}),
|
||||
UI.addField({title: langPack.core.iface.comps.qName, item: "cao_qName", type: "input",reqx: true}),
|
||||
UI.addField({title: langPack.core.iface.desc, item: "cao_description", type: "input"}),
|
||||
UI.addField({title: langPack.core.iface.type, item: "cao_type", type: "select", reqx: true, args: [
|
||||
{val:"",title: ""},
|
||||
{val:"company",title: langPack.core.iface.comps.company},
|
||||
{val:"client",title: langPack.core.iface.comps.client},
|
||||
{val:"supplier",title: langPack.core.iface.comps.supplier},
|
||||
{val:"parner",title: langPack.core.iface.comps.partner},
|
||||
]}),
|
||||
]),
|
||||
langPack.core.iface.add,
|
||||
buttons,
|
||||
350,1,'ItemAdd'
|
||||
);
|
||||
compAddEditDialog_Create(langPack.core.iface.add, buttons);
|
||||
|
||||
UI.openDialog('ItemAdd');
|
||||
}
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
import * as API from './api.js';
|
||||
import * as UI from './ui.js';
|
||||
import { langPack } from './langpack.js';
|
||||
|
||||
|
||||
|
||||
export var menuSelector={
|
||||
"groups":"adminGrous",
|
||||
|
@ -15,73 +12,29 @@ export var menuSelector={
|
|||
comps: "adminComps"
|
||||
};
|
||||
|
||||
export var modSelector={
|
||||
"myprofile": "./coreMyProfile.js",
|
||||
"modules": "./coreModules.js",
|
||||
"module": "./coreModView.js",
|
||||
"groups": "./coreGroups.js",
|
||||
"group": "./coreGroup.js",
|
||||
"users": "./coreUsers.js",
|
||||
"userEmailConfirm": "./userMailConfirm.js",
|
||||
"mailAccounts": "./coreMailAccounts.js",
|
||||
"oauth": "./coreOAuthProfiles.js",
|
||||
"comps": "./coreComps.js"
|
||||
}
|
||||
|
||||
export function load() {
|
||||
let ref=UI.parceURL();
|
||||
switch (ref.function) {
|
||||
case undefined:
|
||||
break;
|
||||
|
||||
case "myprofile":
|
||||
import("./coreMyProfile.js").then(function(mod) {
|
||||
mod.load();
|
||||
})
|
||||
break;
|
||||
|
||||
case "modules":
|
||||
import("./coreModules.js").then(function(mod) {
|
||||
mod.load();
|
||||
})
|
||||
break;
|
||||
|
||||
case "module":
|
||||
import("./coreModView.js").then(function(mod) {
|
||||
mod.load();
|
||||
})
|
||||
break;
|
||||
|
||||
case "groups":
|
||||
import("./coreGroups.js").then(function(mod) {
|
||||
mod.load();
|
||||
})
|
||||
break;
|
||||
|
||||
case "group":
|
||||
import("./coreGroup.js").then(function(mod) {
|
||||
mod.load();
|
||||
})
|
||||
break;
|
||||
|
||||
case "users":
|
||||
import("./coreUsers.js").then(function(mod) {
|
||||
mod.load();
|
||||
})
|
||||
break;
|
||||
|
||||
case "userEmailConfirm":
|
||||
import("./userMailConfirm.js").then(function(mod) {
|
||||
mod.load();
|
||||
})
|
||||
break;
|
||||
case "mailAccounts":
|
||||
import("./coreMailAccounts.js").then(function(mod) {
|
||||
mod.load();
|
||||
})
|
||||
break;
|
||||
case "oauth":
|
||||
import("./coreOAuthProfiles.js").then(function(mod) {
|
||||
mod.load();
|
||||
})
|
||||
break;
|
||||
|
||||
case "comps":
|
||||
import("./coreComps.js").then(function(mod) {
|
||||
mod.load();
|
||||
})
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
throw new Error(404);
|
||||
|
||||
if (isset(modSelector[ref.function])) {
|
||||
API.loadModule(modSelector[ref.function]);
|
||||
} else if (!isset(ref.function)) {
|
||||
// TODO: Implement default start page for core module
|
||||
return true;
|
||||
} else {
|
||||
throw new Error(404);
|
||||
}
|
||||
return true;
|
||||
}
|
|
@ -442,7 +442,13 @@ export function addField(ref)//title, item, blockstyle, fieldstyle, type, args,
|
|||
title.append($("<span>",{ class: "dialogFieldTitle_Reqx",text: "*", title: langPack.core.iface.errReqx }));
|
||||
}
|
||||
|
||||
var rv=$("<div>",{
|
||||
let rvv=$("<div>",{
|
||||
class: "crm_entity_field_value",
|
||||
append: item,
|
||||
style: ref.fieldstyle
|
||||
});
|
||||
|
||||
let rv=$("<div>",{
|
||||
class: "crm_entity_field_block",
|
||||
style: ref.blockstyle,
|
||||
append: $("<div>",{
|
||||
|
@ -451,11 +457,7 @@ export function addField(ref)//title, item, blockstyle, fieldstyle, type, args,
|
|||
append: title
|
||||
|
||||
})
|
||||
.add($("<div>",{
|
||||
class: "crm_entity_field_value",
|
||||
append: item,
|
||||
style: ref.fieldstyle
|
||||
}))
|
||||
.add(rvv)
|
||||
});
|
||||
|
||||
if (type=="label") {
|
||||
|
@ -464,9 +466,13 @@ export function addField(ref)//title, item, blockstyle, fieldstyle, type, args,
|
|||
rv.addClass("clickable");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (type=="label" || type=="href") {
|
||||
if (typeof(ref.onContextMenu)=="function") {
|
||||
rv.bind('contextmenu click', ref.onContextMenu);
|
||||
rv.bind('contextmenu', ref.onContextMenu);
|
||||
rv.addClass("withContextMenu");
|
||||
rvv.append($("<i>",{style: "padding: 0 10px 0 10px; float: right;", class: "fas fa-ellipsis-v"}).bind('contextmenu click', ref.onContextMenu))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -214,7 +214,7 @@ div.header_user
|
|||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
z-index: 200;
|
||||
z-index: 2000;
|
||||
top: 0;
|
||||
left: 0;
|
||||
backdrop-filter: blur(1px);
|
||||
|
@ -941,7 +941,8 @@ table.datatable.selm tr.ss.contextMenu,
|
|||
table.datatable.sel tr.contextMenu a,
|
||||
table.datatable.selm tbody.contextMenu a,
|
||||
table.datatable.selm tr.ss.contextMenu a,
|
||||
div.crm_entity_field_block.withContextMenu {
|
||||
div.crm_entity_field_block.withContextMenu,
|
||||
div.crm_entity_field_block.withContextMenu a {
|
||||
cursor: context-menu;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue