Skip to content
Code-Schnipsel Gruppen Projekte
Commit d9df05f5 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

Merge branch 'next-3.x' into 'main'

Next 3.x

See merge request !112
Übergeordnete d74ec3e9 b314e1d6
No related branches found
Tags 3.7.2
2 Merge Requests!140Update 'next-4.x' with latest changes from 'main',!112Next 3.x
Pipeline #8752 bestanden mit Phase
in 50 Sekunden
<?php
/**
* This file contains package_quiqqer_erp_ajax_process_getProcess
*/
use QUI\ERP\Process;
use QUI\ERP\Processes;
QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_process_getProcess',
function ($globalProcessId, $hash) {
if (!empty($hash) && empty($globalProcessId)) {
$Entity = (new Processes())->getEntity($hash);
$globalProcessId = $Entity->getGlobalProcessId();
}
$Process = new Process($globalProcessId);
return [
'globalProcessId' => $Process->getUUID(),
'history' => $Process->getCompleteHistory()->toArray()
];
},
['globalProcessId', 'hash'],
['Permission::checkAdminUser']
);
......@@ -5,6 +5,7 @@
clear: both;
display: flex;
flex-direction: row;
flex-wrap: wrap;
float: left;
min-height: 50px;
position: relative;
......@@ -63,26 +64,26 @@
text-align: center;
}
.quiqqer-erp-backend-erpArticleText-buttons {
background: #fff;
bottom: 0;
opacity: 0;
padding: 10px;
position: absolute;
right: 0;
text-align: right;
transition: opacity 0.2s;
width: 75px;
z-index: 10;
background: #DEDEDE;
display: none;
width: 100%;
}
.quiqqer-erp-backend-erpArticleText-buttons button {
padding: 0 5px;
background: transparent;
border: none;
cursor: pointer;
line-height: 20px;
margin-left: 5px;
}
.quiqqer-erp-backend-erpArticleText:hover .quiqqer-erp-backend-erpArticleText-buttons {
opacity: 1;
transition: opacity 0.2s;
.quiqqer-erp-backend-erpArticle-select .quiqqer-erp-backend-erpArticleText-buttons {
display: inline-block;
}
.quiqqer-erp-backend-erpArticleText-buttons button:hover {
background: #eaeaea;
}
<div class="quiqqer-erp-backend-erpArticleText-pos cell"></div>
<div class="quiqqer-erp-backend-erpArticleText-text cell"></div>
<div class="quiqqer-erp-backend-erpArticleText-buttons"></div>
<div class="quiqqer-erp-backend-erpArticleText-buttons">
<button name="replace">
<span class="fa fa-retweet"></span>
<span>{{buttonReplace}}</span>
</button>
<button name="delete">
<span class="fa fa-trash"></span>
<span>{{buttonDelete}}</span>
</button>
</div>
\ No newline at end of file
......@@ -16,22 +16,22 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Text', [
'text!package/quiqqer/erp/bin/backend/controls/articles/Text.html',
'css!package/quiqqer/erp/bin/backend/controls/articles/Text.css'
], function (Article, QUIButton, QUILocale, Mustache, template) {
"use strict";
], function(Article, QUIButton, QUILocale, Mustache, template) {
'use strict';
const lg = 'quiqqer/erp';
return new Class({
Extends: Article,
Type : 'package/quiqqer/erp/bin/backend/controls/articles/Text',
Type: 'package/quiqqer/erp/bin/backend/controls/articles/Text',
Binds: [
'$onEditTitle',
'$onEditDescription'
],
initialize: function (options) {
initialize: function(options) {
this.parent(options);
this.setAttributes({
......@@ -44,13 +44,16 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Text', [
*
* @returns {HTMLDivElement}
*/
create: function () {
create: function() {
this.$Elm = new Element('div');
this.$Elm.addClass('quiqqer-erp-backend-erpArticleText');
this.$Elm.set({
html : Mustache.render(template),
html: Mustache.render(template, {
buttonReplace: QUILocale.get(lg, 'articleList.article.button.replace'),
buttonDelete: QUILocale.get(lg, 'articleList.article.button.delete')
}),
events: {
click: this.select
}
......@@ -61,15 +64,15 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Text', [
this.$Buttons = this.$Elm.getElement('.quiqqer-erp-backend-erpArticleText-buttons');
this.$Loader = new Element('div', {
html : '<span class="fa fa-spinner fa-spin"></span>',
html: '<span class="fa fa-spinner fa-spin"></span>',
styles: {
background: '#fff',
display : 'none',
left : 0,
padding : 10,
position : 'absolute',
top : 0,
width : '100%'
display: 'none',
left: 0,
padding: 10,
position: 'absolute',
top: 0,
width: '100%'
}
}).inject(this.$Position);
......@@ -94,28 +97,8 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Text', [
this.setTitle(this.getAttribute('title'));
this.setDescription(this.getAttribute('description'));
// edit buttons
new QUIButton({
title : QUILocale.get(lg, 'erp.articleList.article.button.replace'),
icon : 'fa fa-retweet',
styles: {
'float': 'none'
},
events: {
onClick: this.$onReplaceClick
}
}).inject(this.$Buttons);
new QUIButton({
title : QUILocale.get(lg, 'erp.articleList.article.button.delete'),
icon : 'fa fa-trash',
styles: {
'float': 'none'
},
events: {
onClick: this.openDeleteDialog
}
}).inject(this.$Buttons);
this.$Buttons.getElement('[name="replace"]').addEvent('click', this.$onReplaceClick);
this.$Buttons.getElement('[name="delete"]').addEvent('click', this.openDeleteDialog);
this.$created = true;
......@@ -128,7 +111,7 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Text', [
*
* @return {Promise}
*/
calc: function () {
calc: function() {
return Promise.resolve();
},
......@@ -137,7 +120,7 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Text', [
*
* @param {String} title
*/
setTitle: function (title) {
setTitle: function(title) {
this.setAttribute('title', title);
this.$Title.set('html', title);
......@@ -151,7 +134,7 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Text', [
*
* @param {String} description
*/
setDescription: function (description) {
setDescription: function(description) {
this.setAttribute('description', description);
this.$Description.set('html', description);
......@@ -165,7 +148,7 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Text', [
*
* @return {Promise}
*/
setQuantity: function () {
setQuantity: function() {
return Promise.resolve();
},
......@@ -173,28 +156,28 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Text', [
* Set the product unit price
*
*/
setUnitPrice: function () {
setUnitPrice: function() {
return Promise.resolve();
},
/**
* Set the product unit price
**/
setVat: function () {
setVat: function() {
return Promise.resolve();
},
/**
* Show the loader
*/
showLoader: function () {
showLoader: function() {
this.$Loader.setStyle('display', null);
},
/**
* Hide the loader
*/
hideLoader: function () {
hideLoader: function() {
this.$Loader.setStyle('display', 'none');
}
});
......
......@@ -28,7 +28,8 @@ define('package/quiqqer/erp/bin/backend/controls/process/ProcessGrid', [
options: {
globalProcessId: false,
entityHash: false
entityHash: false,
hideUuids: []
},
initialize: function(options) {
......@@ -95,9 +96,13 @@ define('package/quiqqer/erp/bin/backend/controls/process/ProcessGrid', [
QUIAjax.get('package_quiqqer_erp_ajax_process_getEntities', (result) => {
const data = [];
console.log(result);
const hideUuids = this.getAttribute('hideUuids') || [];
result.forEach((entry) => {
if (hideUuids.indexOf(entry.uuid) !== -1) {
return;
}
const Type = new QUIButton({
events: {
click: this.$click
......
.quiqqer-erp-process-window-header {
background: #f7f7f7;
display: inline-block;
padding: 20px;
width: 100%;
}
.quiqqer-erp-process-window {
display: flex;
flex-direction: column;
}
.quiqqer-erp-process-window-comments {
overflow: auto;
flex-shrink: 0;
flex-grow: 1;
height: 200px;
}
\ No newline at end of file
/**
* @module package/quiqqer/erp/bin/backend/controls/process/ProcessWindow
* @author www.pcsg.de (Henning Leutz)
*/
define('package/quiqqer/erp/bin/backend/controls/process/ProcessWindow', [
'qui/QUI',
'qui/controls/windows/Popup',
'Locale',
'Ajax',
'css!package/quiqqer/erp/bin/backend/controls/process/ProcessWindow.css'
], function(QUI, QUIPopup, QUILocale, QUIAjax) {
'use strict';
const lg = 'quiqqer/erp';
return new Class({
Extends: QUIPopup,
Type: 'package/quiqqer/erp/bin/backend/controls/process/ProcessWindow',
Binds: [
'$onCreate',
'$onOpen'
],
options: {
globalProcessId: false,
hash: false,
buttons: false
},
initialize: function(options) {
this.setAttributes({
icon: 'fa fa-timeline',
title: '',
maxHeight: 900,
maxWidth: 750,
});
this.parent(options);
this.$Comments = null;
this.addEvents({
onCreate: this.$onCreate,
onOpen: this.$onOpen
});
},
$onCreate: function() {
if (!this.getAttribute('globalProcessId') && !this.getAttribute('hash')) {
this.close();
return;
}
this.Loader.show();
this.refresh();
this.getContent().setStyle('padding', 0);
this.getContent().addClass('quiqqer-erp-process-window');
new Element('div', {
'class': 'quiqqer-erp-process-window-header',
html: '<div class="quiqqer-erp-process-window-header-filter">' +
' <input type="text" name="filter" placeholder="Filter (Nachricht, Type, ID) ...">' +
' </div>'
}).inject(this.getContent());
require(['package/quiqqer/erp/bin/backend/controls/Comments'], (Comments) => {
const CommentContainer = new Element('div', {
'class': 'quiqqer-erp-process-window-comments',
styles: {
padding: 20
}
}).inject(this.getContent());
const Filter = this.getContent().getElement('[name="filter"]');
this.$Comments = new Comments().inject(CommentContainer);
Filter.addEvent('keyup', () => {
this.$Comments.filter(Filter.value);
});
this.$onOpen();
});
},
$onOpen: function() {
if (!this.getAttribute('globalProcessId') && !this.getAttribute('hash')) {
this.close();
return;
}
if (!this.$Comments) {
return;
}
this.Loader.show();
QUIAjax.get('package_quiqqer_erp_ajax_process_getProcess', (result) => {
this.setAttributes({
icon: 'fa fa-timeline',
title: QUILocale.get(lg, 'panel.globalProcess.title', {
globalProcessId: result.globalProcessId
})
});
this.refresh();
this.$Comments.clear();
this.$Comments.unserialize(result.history);
this.Loader.hide();
}, {
'package': 'quiqqer/erp',
globalProcessId: this.getAttribute('globalProcessId'),
hash: this.getAttribute('hash'),
});
}
});
});
/**
* Button which opens the window for the process
*/
define('package/quiqqer/erp/bin/backend/controls/process/ProcessWindowButton', [
'qui/QUI',
'qui/controls/buttons/Button',
'package/quiqqer/erp/bin/backend/controls/process/ProcessWindow',
'Locale'
], function(QUI, QUIButton, ProcessWindow, QUILocale) {
'use strict';
const lg = 'quiqqer/erp';
return new Class({
Extends: QUIButton,
Type: 'package/quiqqer/erp/bin/backend/controls/process/ProcessWindowButton',
options: {
globalProcessId: false,
hash: false
},
initialize: function(options) {
this.setAttributes({
styles: {
'border-left-width': 1,
'border-right-width': 1,
'float': 'right',
width: 40
}
});
this.parent(options);
this.setAttributes({
icon: 'fa fa-timeline',
alt: QUILocale.get(lg, 'process.button.alt'),
title: QUILocale.get(lg, 'process.button.title')
});
this.addEvents({
click: () => {
new ProcessWindow({
globalProcessId: this.getAttribute('globalProcessId'),
hash: this.getAttribute('hash')
}).open();
}
});
}
});
});
......@@ -60,6 +60,11 @@ protected function table(): string
return QUI::getDBTableName('process');
}
public function getUUID(): string
{
return $this->processId;
}
/**
* Return all entities which are connected to this process
*
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren