Questions and discussion about using ProcessMaker: user interface, running cases & functionality
By mariab
#815198
Hello,
I'm trying to make a task which will be assigned to a group and then every user of that group should claim the task.
I've tried the Self Service Value Based Assignment but in this case only one user claims the task and i've tried parallel tasks (with different users), but it is not convenient as I need many people to do the same task. Also it is not convenient -in my case- for the admin to send 'manually' tasks to users (as it happens when i do a cyclical assignment to a group).
Is there any way to do what Self Service Value Based Assignment does, but every single user could be able to claim the task?

Thank you in advance,
Mariab
User avatar
By amosbatto
#815200
Create a task with a parallel marker. Then, you can assign the task to all the users in an array that is assigned to a case variable.

The drawback is if you need all the users to fill out the same Dynaform, because each user will overwrite the case variables which were set by the previous user. The only solution to this problem is to write the variables to a new row in a grid and then display that grid in a subsequent task.
Here is a code example that you can use:
viewtopic.php?f=41&t=710262&p=789936#p789936
By mariab
#816100
Thank you very much for your reply and your code. I've used it and it works fine for dynaforms without grids. Now i'm trying to give a dynaform to a group of people. This dynaform contains a grid, and this grid contains two dropdown menus and one textbox (variables: g_userPrinter, g_userInk, quantity).
I want to clear the form before a new user gives data, so i've made a trigger to be fired after the dynaform of the parallel task. It seems to work, but even though g_userPrinter anf g_userInk are getting cleared, the quantity keeps the last's users value.
I would appreciate any help
Code: Select all
$tot = count(@@grid);
for ($cnt = 1; $cnt <= $tot; $cnt++) {
    
    @@grid[$cnt]['g_userPrinter'] = null;
    @@grid[$cnt]['g_userInk']        = null;
    @@grid[$cnt]['quantity']          = null;
}
User avatar
By amosbatto
#816112
Double check that the field's ID in the grid is spelled 'quantity'. Is your 'quantity' field a textbox?

It is better to use empty strings, instead of null:
Code: Select all
$tot = count(@@grid);
for ($cnt = 1; $cnt <= $tot; $cnt++) {
    
    @@grid[$cnt]['g_userPrinter'] = '';
    @@grid[$cnt]['g_userInk']        = '';
    @@grid[$cnt]['quantity']          = '';
}
If that doesn't solve it, try also setting the _label for the grid:
Code: Select all
$tot = count(@@grid);
for ($cnt = 1; $cnt <= $tot; $cnt++) {   
    @@grid[$cnt]['g_userPrinter'] = '';
    @@grid[$cnt]['g_userInk']        = '';
    @@grid[$cnt]['quantity']          = '';
    @@grid[$cnt]['quantity_label'] = '';
}
By mariab
#816234
Well i have worked for days on this project and the particular thing is a pain to me. I found smth that seems more correct, i forced the grid to be empty. g_userPrinter and g_userInk are dropdowns linked to my database, and g_quantity is a textbox .
For some reason now the dropdown g_userInk isn't blank and gets values from my database.
I have to point out that in one other grid that i have, that has only textboxs , this works fine.
Code: Select all
@@grid = array(
   '1' => array(  'g_userPrinter' => ' ', 'g_userInk'=> ' ', 'g_quantity' => ' ')
);
I would like also to ask if there is a way for a user to undo a grid row deletion.
User avatar
By amosbatto
#816249
mariab wrote: Sat Sep 22, 2018 2:30 pm I would like also to ask if there is a way for a user to undo a grid row deletion.
Unfortunately, there isn't a way to undo grid row deletion.

You could create an .onRowDelete event handler to save the values in the grid row as a JSON string to a hidden field before deleting the row. Then, you could add an "Undo delete" button to your form, that would restore that row.

Here is the basic idea:
(6.08 KiB) Downloaded 285 times
By mariab
#816310
Hello Amos,
I really appreciate your help, but my project is for my thesis and i need it to be perfect, so i bring this up for once again.
I have a parallel task, with one form, this form has one grid, and this grid has 2 dropdowns and 1 textBox. The dropdowns get instances from the database based on the logged user. So i have
g_userPrinter (dropdown), g_userInk (dropdown) and g_quantity (textbox).
I need every time a form goes to a user, the dropdowns to have blank first row text -with no key value-.
The codes that i have mentioned before, don't work good for the dropdowns.
I'm sorry for the multiple replies but the problem isn't solved even though i've tried every possible workaround that i can think.
By mariab
#816630
[/quote]
Unfortunately, there isn't a way to undo grid row deletion.

You could create an .onRowDelete event handler to save the values in the grid row as a JSON string to a hidden field before deleting the row. Then, you could add an "Undo delete" button to your form, that would restore that row.

Here is the basic idea:
Form with clients grid.json
[/quote]
Wow this is much complicated, before doing this, just to make sure, is there a way to prevent the deletion? i would like to do something like this, but return false doesn't stop deletion.
Code: Select all
$("div.pmdynaform-grid-removerow-responsive").find("button").click(function() {
      if (confirm("Are you sure you want to delete this row?")) {
         return true; //delete row
      } else {
        return false; //prevent deletion
    }
});

A 1xbet clone script is a pre-designed software so[…]

4rabet clone script is enabling entrepreneurs to e[…]

Parimatch clone script is enabling entrepreneurs t[…]

In the world of cryptocurrency, a wallet is an app[…]