mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-10 16:55:00 +00:00
Compare commits
2 Commits
v3.0.0-RC4
...
workflow/i
Author | SHA1 | Date | |
---|---|---|---|
3a98a316fe | |||
829bf01eca |
@@ -271,7 +271,7 @@ class ActivityType
|
|||||||
public function checkSocialActionsVisibility(ExecutionContextInterface $context, $payload)
|
public function checkSocialActionsVisibility(ExecutionContextInterface $context, $payload)
|
||||||
{
|
{
|
||||||
if ($this->socialIssuesVisible !== $this->socialActionsVisible) {
|
if ($this->socialIssuesVisible !== $this->socialActionsVisible) {
|
||||||
if (!($this->socialIssuesVisible === 2 && $this->socialActionsVisible === 1)) {
|
if (!(2 === $this->socialIssuesVisible && 1 === $this->socialActionsVisible)) {
|
||||||
$context
|
$context
|
||||||
->buildViolation('The socialActionsVisible value is not compatible with the socialIssuesVisible value')
|
->buildViolation('The socialActionsVisible value is not compatible with the socialIssuesVisible value')
|
||||||
->atPath('socialActionsVisible')
|
->atPath('socialActionsVisible')
|
||||||
|
@@ -174,6 +174,20 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getCurrentStepChained(): ?EntityWorkflowStep
|
||||||
|
{
|
||||||
|
$steps = $this->getStepsChained();
|
||||||
|
$currentStep = $this->getCurrentStep();
|
||||||
|
|
||||||
|
foreach ($steps as $step) {
|
||||||
|
if ($step === $currentStep) {
|
||||||
|
return $step;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public function getCurrentStepCreatedAt(): ?DateTimeInterface
|
public function getCurrentStepCreatedAt(): ?DateTimeInterface
|
||||||
{
|
{
|
||||||
if (null !== $previous = $this->getPreviousStepIfAny()) {
|
if (null !== $previous = $this->getPreviousStepIfAny()) {
|
||||||
|
@@ -48,6 +48,8 @@ class WorkflowStepType extends AbstractType
|
|||||||
$entityWorkflow = $options['entity_workflow'];
|
$entityWorkflow = $options['entity_workflow'];
|
||||||
$handler = $this->entityWorkflowManager->getHandler($entityWorkflow);
|
$handler = $this->entityWorkflowManager->getHandler($entityWorkflow);
|
||||||
$workflow = $this->registry->get($entityWorkflow, $entityWorkflow->getWorkflowName());
|
$workflow = $this->registry->get($entityWorkflow, $entityWorkflow->getWorkflowName());
|
||||||
|
$place = $workflow->getMarking($entityWorkflow);
|
||||||
|
$placeMetadata = $workflow->getMetadataStore()->getPlaceMetadata(array_keys($place->getPlaces())[0]);
|
||||||
|
|
||||||
if (true === $options['transition']) {
|
if (true === $options['transition']) {
|
||||||
if (null === $options['entity_workflow']) {
|
if (null === $options['entity_workflow']) {
|
||||||
@@ -68,9 +70,34 @@ class WorkflowStepType extends AbstractType
|
|||||||
$transitions
|
$transitions
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (array_key_exists('validationFilterInputLabels', $placeMetadata)) {
|
||||||
|
$inputLabels = $placeMetadata['validationFilterInputLabels'];
|
||||||
|
|
||||||
|
$builder->add('transitionFilter', ChoiceType::class, [
|
||||||
|
'multiple' => false,
|
||||||
|
'label' => 'workflow.My decision',
|
||||||
|
'choices' => [
|
||||||
|
'forward' => 'forward',
|
||||||
|
'backward' => 'backward',
|
||||||
|
'neutral' => 'neutral',
|
||||||
|
],
|
||||||
|
'choice_label' => function (string $key) use ($inputLabels) {
|
||||||
|
return $this->translatableStringHelper->localize($inputLabels[$key]);
|
||||||
|
},
|
||||||
|
'choice_attr' => static function (string $key) {
|
||||||
|
return [
|
||||||
|
$key => $key,
|
||||||
|
];
|
||||||
|
},
|
||||||
|
'mapped' => false,
|
||||||
|
'expanded' => true,
|
||||||
|
'data' => 'forward',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
$builder
|
$builder
|
||||||
->add('transition', ChoiceType::class, [
|
->add('transition', ChoiceType::class, [
|
||||||
'label' => 'workflow.Transition to apply',
|
'label' => 'workflow.Next step',
|
||||||
'mapped' => false,
|
'mapped' => false,
|
||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
@@ -86,6 +113,17 @@ class WorkflowStepType extends AbstractType
|
|||||||
},
|
},
|
||||||
'choice_attr' => static function (Transition $transition) use ($workflow) {
|
'choice_attr' => static function (Transition $transition) use ($workflow) {
|
||||||
$toFinal = true;
|
$toFinal = true;
|
||||||
|
$isForward = 'neutral';
|
||||||
|
|
||||||
|
$metadata = $workflow->getMetadataStore()->getTransitionMetadata($transition);
|
||||||
|
|
||||||
|
if (array_key_exists('isForward', $metadata)) {
|
||||||
|
if ($metadata['isForward']) {
|
||||||
|
$isForward = 'forward';
|
||||||
|
} else {
|
||||||
|
$isForward = 'backward';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($transition->getTos() as $to) {
|
foreach ($transition->getTos() as $to) {
|
||||||
$meta = $workflow->getMetadataStore()->getPlaceMetadata($to);
|
$meta = $workflow->getMetadataStore()->getPlaceMetadata($to);
|
||||||
@@ -100,6 +138,7 @@ class WorkflowStepType extends AbstractType
|
|||||||
return [
|
return [
|
||||||
'data-is-transition' => 'data-is-transition',
|
'data-is-transition' => 'data-is-transition',
|
||||||
'data-to-final' => $toFinal ? '1' : '0',
|
'data-to-final' => $toFinal ? '1' : '0',
|
||||||
|
'data-is-forward' => $isForward,
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
@@ -26,7 +26,9 @@ var ShowHide = function(options) {
|
|||||||
container_content = [],
|
container_content = [],
|
||||||
debug = 'debug' in options ? options.debug : false,
|
debug = 'debug' in options ? options.debug : false,
|
||||||
load_event = 'load_event' in options ? options.load_event : 'load',
|
load_event = 'load_event' in options ? options.load_event : 'load',
|
||||||
id = 'uid' in options ? options.id : Math.random();
|
id = 'uid' in options ? options.id : Math.random(),
|
||||||
|
toggle_callback = 'toggle_callback' in options ? options.toggle_callback : null
|
||||||
|
;
|
||||||
|
|
||||||
var bootstrap = function(event) {
|
var bootstrap = function(event) {
|
||||||
if (debug) {
|
if (debug) {
|
||||||
@@ -39,7 +41,6 @@ var ShowHide = function(options) {
|
|||||||
contents.push(el);
|
contents.push(el);
|
||||||
}
|
}
|
||||||
container_content.push(contents);
|
container_content.push(contents);
|
||||||
// console.log('container content', container_content);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// attach the listener on each input
|
// attach the listener on each input
|
||||||
@@ -96,11 +97,15 @@ var ShowHide = function(options) {
|
|||||||
if (debug) {
|
if (debug) {
|
||||||
console.log('force hide');
|
console.log('force hide');
|
||||||
}
|
}
|
||||||
|
if (toggle_callback !== null) {
|
||||||
|
toggle_callback(container, 'hide');
|
||||||
|
} else {
|
||||||
for (let contents of container_content.values()) {
|
for (let contents of container_content.values()) {
|
||||||
for (let el of contents.values()) {
|
for (let el of contents.values()) {
|
||||||
el.remove();
|
el.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
is_shown = false;
|
is_shown = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -108,12 +113,16 @@ var ShowHide = function(options) {
|
|||||||
if (debug) {
|
if (debug) {
|
||||||
console.log('show');
|
console.log('show');
|
||||||
}
|
}
|
||||||
|
if (toggle_callback !== null) {
|
||||||
|
toggle_callback(container, 'show');
|
||||||
|
} else {
|
||||||
for (let i of container_content.keys()) {
|
for (let i of container_content.keys()) {
|
||||||
var contents = container_content[i];
|
var contents = container_content[i];
|
||||||
for (let el of contents.values()) {
|
for (let el of contents.values()) {
|
||||||
container[i].appendChild(el);
|
container[i].appendChild(el);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
is_shown = true;
|
is_shown = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -2,29 +2,74 @@ import {ShowHide} from 'ChillMainAssets/lib/show_hide/show_hide.js';
|
|||||||
|
|
||||||
window.addEventListener('DOMContentLoaded', function() {
|
window.addEventListener('DOMContentLoaded', function() {
|
||||||
let
|
let
|
||||||
finalizeAfterContainer = document.querySelector('#finalizeAfter'),
|
divTransitions = document.querySelector('#transitions'),
|
||||||
futureDestUsersContainer = document.querySelector('#futureDestUsers')
|
futureDestUsersContainer = document.querySelector('#futureDestUsers')
|
||||||
;
|
;
|
||||||
|
|
||||||
if (null === finalizeAfterContainer) {
|
if (null !== divTransitions) {
|
||||||
return;
|
new ShowHide({
|
||||||
|
load_event: null,
|
||||||
|
froms: [divTransitions],
|
||||||
|
container: [futureDestUsersContainer],
|
||||||
|
test: function(divs, arg2, arg3) {
|
||||||
|
for (let div of divs) {
|
||||||
|
for (let input of div.querySelectorAll('input')) {
|
||||||
|
if (input.checked) {
|
||||||
|
if (input.dataset.toFinal === "1") {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
let
|
||||||
|
transitionFilterContainer = document.querySelector('#transitionFilter'),
|
||||||
|
transitions = document.querySelector('#transitions')
|
||||||
|
;
|
||||||
|
|
||||||
|
if (null !== transitionFilterContainer) {
|
||||||
|
transitions.querySelectorAll('.form-check').forEach(function(row) {
|
||||||
|
|
||||||
|
const isForward = row.querySelector('input').dataset.isForward;
|
||||||
|
console.log(row);
|
||||||
|
console.log(isForward);
|
||||||
|
|
||||||
new ShowHide({
|
new ShowHide({
|
||||||
load_event: null,
|
load_event: null,
|
||||||
froms: [finalizeAfterContainer],
|
froms: [transitionFilterContainer],
|
||||||
container: [futureDestUsersContainer],
|
container: row,
|
||||||
test: function(containers, arg2, arg3) {
|
test: function (containers) {
|
||||||
for (let container of containers) {
|
for (let container of containers) {
|
||||||
for (let input of container.querySelectorAll('input')) {
|
for (let input of container.querySelectorAll('input')) {
|
||||||
if (!input.checked) {
|
if (input.checked) {
|
||||||
return true;
|
return isForward === input.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toggle_callback: function (c, dir) {
|
||||||
|
for (let div of c) {
|
||||||
|
let input = div.querySelector('input');
|
||||||
|
if ('hide' === dir) {
|
||||||
|
input.checked = false;
|
||||||
|
input.disabled = true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
input.disabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@@ -12,6 +12,7 @@
|
|||||||
:relatedEntityClass="this.relatedEntityClass"
|
:relatedEntityClass="this.relatedEntityClass"
|
||||||
:relatedEntityId="this.relatedEntityId"
|
:relatedEntityId="this.relatedEntityId"
|
||||||
:workflowsAvailables="workflowsAvailables"
|
:workflowsAvailables="workflowsAvailables"
|
||||||
|
@go-to-generate-workflow="goToGenerateWorkflow"
|
||||||
></pick-workflow>
|
></pick-workflow>
|
||||||
|
|
||||||
<teleport to="body">
|
<teleport to="body">
|
||||||
@@ -34,6 +35,8 @@
|
|||||||
:relatedEntityClass="this.relatedEntityClass"
|
:relatedEntityClass="this.relatedEntityClass"
|
||||||
:relatedEntityId="this.relatedEntityId"
|
:relatedEntityId="this.relatedEntityId"
|
||||||
:workflowsAvailables="workflowsAvailables"
|
:workflowsAvailables="workflowsAvailables"
|
||||||
|
:preventDefaultMoveToGenerate="this.$props.preventDefaultMoveToGenerate"
|
||||||
|
@go-to-generate-workflow="this.goToGenerateWorkflow"
|
||||||
></pick-workflow>
|
></pick-workflow>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -53,6 +56,7 @@ export default {
|
|||||||
PickWorkflow,
|
PickWorkflow,
|
||||||
ListWorkflowVue
|
ListWorkflowVue
|
||||||
},
|
},
|
||||||
|
emits: ['goToGenerateWorkflow'],
|
||||||
props: {
|
props: {
|
||||||
workflows: {
|
workflows: {
|
||||||
type: Array,
|
type: Array,
|
||||||
@@ -73,7 +77,12 @@ export default {
|
|||||||
workflowsAvailables: {
|
workflowsAvailables: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true,
|
required: true,
|
||||||
}
|
},
|
||||||
|
preventDefaultMoveToGenerate: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -95,6 +104,10 @@ export default {
|
|||||||
openModal() {
|
openModal() {
|
||||||
this.modal.showModal = true;
|
this.modal.showModal = true;
|
||||||
},
|
},
|
||||||
|
goToGenerateWorkflow(data) {
|
||||||
|
console.log('go to generate workflow intercepted');
|
||||||
|
this.$emit('goToGenerateWorkflow', data);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
i18n: {
|
i18n: {
|
||||||
messages: {
|
messages: {
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu" aria-labelledby="createWorkflowButton">
|
<ul class="dropdown-menu" aria-labelledby="createWorkflowButton">
|
||||||
<li v-for="w in workflowsAvailables" :key="w.name">
|
<li v-for="w in workflowsAvailables" :key="w.name">
|
||||||
<a class="dropdown-item" :href="makeLink(w.name)" @click="goToGenerateWorkflow($event, w.name)">{{ w.text }}</a>
|
<a class="dropdown-item" :href="makeLink(w.name)" @click.prevent="goToGenerateWorkflow($event, w.name)">{{ w.text }}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -31,7 +31,12 @@ export default {
|
|||||||
workflowsAvailables: {
|
workflowsAvailables: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true,
|
required: true,
|
||||||
}
|
},
|
||||||
|
preventDefaultMoveToGenerate: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
emits: ['goToGenerateWorkflow'],
|
emits: ['goToGenerateWorkflow'],
|
||||||
methods: {
|
methods: {
|
||||||
@@ -39,6 +44,12 @@ export default {
|
|||||||
return buildLinkCreate(workflowName, this.relatedEntityClass, this.relatedEntityId);
|
return buildLinkCreate(workflowName, this.relatedEntityClass, this.relatedEntityId);
|
||||||
},
|
},
|
||||||
goToGenerateWorkflow(event, workflowName) {
|
goToGenerateWorkflow(event, workflowName) {
|
||||||
|
console.log('goToGenerateWorkflow', event, workflowName);
|
||||||
|
|
||||||
|
if (!this.$props.preventDefaultMoveToGenerate) {
|
||||||
|
event.target.click();
|
||||||
|
}
|
||||||
|
|
||||||
this.$emit('goToGenerateWorkflow', {event, workflowName, link: this.makeLink(workflowName)});
|
this.$emit('goToGenerateWorkflow', {event, workflowName, link: this.makeLink(workflowName)});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,7 +3,60 @@
|
|||||||
{% if transition_form is not null %}
|
{% if transition_form is not null %}
|
||||||
{{ form_start(transition_form) }}
|
{{ form_start(transition_form) }}
|
||||||
|
|
||||||
|
{% set step = entity_workflow.currentStepChained %}
|
||||||
|
{% set labels = workflow_metadata(entity_workflow, 'label', step.currentStep) %}
|
||||||
|
{% set label = labels is null ? step.currentStep : labels|localize_translatable_string %}
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
{{ 'workflow.Current step'|trans }} :
|
||||||
|
<span class="badge bg-primary">{{ label }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if step.previous is not null %}
|
||||||
|
{% if step.previous.comment is not empty %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<blockquote class="chill-user-quote">
|
||||||
|
{{ step.previous.comment|chill_markdown_to_html }}
|
||||||
|
</blockquote>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
{{ 'By'|trans }}
|
||||||
|
{{ step.previous.transitionBy|chill_entity_render_box }},
|
||||||
|
{{ step.previous.transitionAt|format_datetime('short', 'short') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-4">{{ 'workflow.Created by'|trans }}</div>
|
||||||
|
<div class="col-sm-8">{{ step.entityWorkflow.createdBy|chill_entity_render_box }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-4">{{ 'Le'|trans }}</div>
|
||||||
|
<div class="col-sm-8">{{ step.entityWorkflow.createdAt|format_datetime('short', 'short') }}</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div id="transitionFilter">
|
||||||
|
{% if transition_form.transitionFilter is defined %}
|
||||||
|
{{ form_row(transition_form.transitionFilter) }}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="transitions">
|
||||||
{{ form_row(transition_form.transition) }}
|
{{ form_row(transition_form.transition) }}
|
||||||
|
</div>
|
||||||
|
|
||||||
{% if transition_form.freezeAfter is defined %}
|
{% if transition_form.freezeAfter is defined %}
|
||||||
{{ form_row(transition_form.freezeAfter) }}
|
{{ form_row(transition_form.freezeAfter) }}
|
||||||
|
@@ -69,6 +69,18 @@
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if loop.last and step.destUser|length > 0 %}
|
||||||
|
<div class="item-row separator">
|
||||||
|
<div>
|
||||||
|
<p><b>{{ 'workflow.Users allowed to apply transition'|trans }} : </b></p>
|
||||||
|
<ul>
|
||||||
|
{% for u in step.destUser %}
|
||||||
|
<li>{{ u|chill_entity_render_box }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@@ -370,7 +370,8 @@ Workflow history: Historique de la décision
|
|||||||
|
|
||||||
workflow:
|
workflow:
|
||||||
Created by: Créé par
|
Created by: Créé par
|
||||||
Transition to apply: Ma décision
|
My decision: Ma décision
|
||||||
|
Next step: Prochaine étape
|
||||||
dest for next steps: Utilisateurs qui valideront la prochaine étape
|
dest for next steps: Utilisateurs qui valideront la prochaine étape
|
||||||
Freeze: Geler
|
Freeze: Geler
|
||||||
Freezed: Gelé
|
Freezed: Gelé
|
||||||
@@ -392,6 +393,9 @@ workflow:
|
|||||||
dest: Workflows en attente d'action
|
dest: Workflows en attente d'action
|
||||||
you subscribed to all steps: Vous recevrez une notification à chaque étape
|
you subscribed to all steps: Vous recevrez une notification à chaque étape
|
||||||
you subscribed to final step: Vous recevrez une notification à l'étape finale
|
you subscribed to final step: Vous recevrez une notification à l'étape finale
|
||||||
|
Current step: Étape actuelle
|
||||||
|
Comment on last change: Commentaire à la transition précédente
|
||||||
|
Users allowed to apply transition: Utilisateurs pouvant valider cette étape
|
||||||
|
|
||||||
Subscribe final: Recevoir une notification à l'étape finale
|
Subscribe final: Recevoir une notification à l'étape finale
|
||||||
Subscribe all steps: Recevoir une notification à chaque étape
|
Subscribe all steps: Recevoir une notification à chaque étape
|
||||||
|
@@ -28,6 +28,11 @@ final class AccompanyingPeriodRepository implements ObjectRepository
|
|||||||
$this->repository = $entityManager->getRepository(AccompanyingPeriod::class);
|
$this->repository = $entityManager->getRepository(AccompanyingPeriod::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function countBy(array $criteria): int
|
||||||
|
{
|
||||||
|
return $this->repository->count($criteria);
|
||||||
|
}
|
||||||
|
|
||||||
public function countByRecentUserHistory(User $user, DateTimeImmutable $since): int
|
public function countByRecentUserHistory(User $user, DateTimeImmutable $since): int
|
||||||
{
|
{
|
||||||
$qb = $this->buildQueryByRecentUserHistory($user, $since);
|
$qb = $this->buildQueryByRecentUserHistory($user, $since);
|
||||||
@@ -35,11 +40,6 @@ final class AccompanyingPeriodRepository implements ObjectRepository
|
|||||||
return $qb->select('count(a)')->getQuery()->getSingleScalarResult();
|
return $qb->select('count(a)')->getQuery()->getSingleScalarResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function countBy(array $criteria): int
|
|
||||||
{
|
|
||||||
return $this->repository->count($criteria);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder
|
public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder
|
||||||
{
|
{
|
||||||
return $this->repository->createQueryBuilder($alias, $indexBy);
|
return $this->repository->createQueryBuilder($alias, $indexBy);
|
||||||
|
@@ -251,6 +251,7 @@
|
|||||||
relatedEntityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork"
|
relatedEntityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork"
|
||||||
:relatedEntityId="this.work.id"
|
:relatedEntityId="this.work.id"
|
||||||
:workflowsAvailables="this.work.workflows_availables"
|
:workflowsAvailables="this.work.workflows_availables"
|
||||||
|
@go-to-generate-workflow="goToGenerateWorkflow"
|
||||||
></list-workflow-modal>
|
></list-workflow-modal>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@@ -284,6 +285,7 @@ import OnTheFly from 'ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue';
|
|||||||
import ListWorkflowModal from 'ChillMainAssets/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue';
|
import ListWorkflowModal from 'ChillMainAssets/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue';
|
||||||
import PickWorkflow from 'ChillMainAssets/vuejs/_components/EntityWorkflow/PickWorkflow.vue';
|
import PickWorkflow from 'ChillMainAssets/vuejs/_components/EntityWorkflow/PickWorkflow.vue';
|
||||||
import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue';
|
import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue';
|
||||||
|
import {buildLinkCreate} from 'ChillMainAssets/lib/entity-workflow/api.js';
|
||||||
|
|
||||||
const i18n = {
|
const i18n = {
|
||||||
messages: {
|
messages: {
|
||||||
@@ -334,7 +336,6 @@ export default {
|
|||||||
ListWorkflowModal,
|
ListWorkflowModal,
|
||||||
OnTheFly,
|
OnTheFly,
|
||||||
PickWorkflow,
|
PickWorkflow,
|
||||||
OnTheFly,
|
|
||||||
PersonText,
|
PersonText,
|
||||||
},
|
},
|
||||||
i18n,
|
i18n,
|
||||||
@@ -461,6 +462,15 @@ export default {
|
|||||||
removeThirdParty(t) {
|
removeThirdParty(t) {
|
||||||
this.$store.commit('removeThirdParty', t);
|
this.$store.commit('removeThirdParty', t);
|
||||||
},
|
},
|
||||||
|
goToGenerateWorkflow({link}) {
|
||||||
|
console.log('save before leave to generate workflow')
|
||||||
|
const callback = (data) => {
|
||||||
|
window.location.assign(link);
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.$store.dispatch('submit', callback)
|
||||||
|
.catch(e => { console.log(e); throw e; });
|
||||||
|
},
|
||||||
submit() {
|
submit() {
|
||||||
this.$store.dispatch('submit');
|
this.$store.dispatch('submit');
|
||||||
},
|
},
|
||||||
|
@@ -14,10 +14,10 @@
|
|||||||
<list-workflow-modal
|
<list-workflow-modal
|
||||||
:workflows="evaluation.workflows"
|
:workflows="evaluation.workflows"
|
||||||
:allowCreate="true"
|
:allowCreate="true"
|
||||||
relatedEntityClass="faked"
|
relatedEntityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation"
|
||||||
:relatedEntityId="evaluation.id"
|
:relatedEntityId="evaluation.id"
|
||||||
:workflowsAvailables="evaluation.workflows_availables"
|
:workflowsAvailables="evaluation.workflows_availables"
|
||||||
@goToGenerateWorkflow="goToGenerateWorkflow"
|
@go-to-generate-workflow="goToGenerateWorkflow"
|
||||||
></list-workflow-modal>
|
></list-workflow-modal>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
@@ -106,8 +106,7 @@ export default {
|
|||||||
this.toggleEditEvaluation();
|
this.toggleEditEvaluation();
|
||||||
},
|
},
|
||||||
goToGenerateWorkflow({event, link, workflowName}) {
|
goToGenerateWorkflow({event, link, workflowName}) {
|
||||||
event.preventDefault();
|
console.log('goToGenerate in evaluation', event, link, workflowName);
|
||||||
console.log(event, link, workflowName);
|
|
||||||
|
|
||||||
const callback = (data) => {
|
const callback = (data) => {
|
||||||
let evaluationId = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key).id;
|
let evaluationId = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key).id;
|
||||||
|
@@ -210,6 +210,7 @@ const store = createStore({
|
|||||||
editEvaluation: true,
|
editEvaluation: true,
|
||||||
workflows_availables: state.work.workflows_availables_evaluation,
|
workflows_availables: state.work.workflows_availables_evaluation,
|
||||||
documents: [],
|
documents: [],
|
||||||
|
workflows: [],
|
||||||
};
|
};
|
||||||
state.evaluationsPicked.push(e);
|
state.evaluationsPicked.push(e);
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user