• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: assignment submission for a particular User

assignment submission for a particular User 9 years 3 months ago #33609

  • superix
  • superix's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
I wonder how do I assign a submission for a given User .

example : the administrator fills out a form and select the User that will receive this form. But this form has to appear to the User at the " RSForm ! Pro " submissions " like the User who has filled that form.
The administrator has disabled public write access.

assignment submission for a particular User 9 years 3 months ago #33616

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Simple head over to the Manage Submissions area, edit the submission and specify the username / id of the targeted user.

On a different note, given that the form will be submitted by administrators only, you can consider adding a dropdown field that will display all site users (or a particular group). The administrator would then be able to select the target user.

A small script will also be required, within the PHP Scripts > Scripts called after form process area that will automatically assign the submission to the selected user. You will need to alter the following RSForm!Pro database table:

_rsform_submissions (notice the Username, UserId columns)
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

assignment submission for a particular User 9 years 3 months ago #33623

  • superix
  • superix's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
I already managed to do is list with ususarios could help me with the script to send to the selected User ?
The administrator has disabled public write access.

assignment submission for a particular User 9 years 3 months ago #33645

Super fix i also need to create such a functionality. Have you made id it and could you help me?
The administrator has disabled public write access.

assignment submission for a particular User 9 years 3 months ago #33646

Dear alexp will you be able to share with example of this kind of form with the script that allows to administrator to select users?
The administrator has disabled public write access.

assignment submission for a particular User 9 years 3 months ago #33647

i ALSO LOOK FOR THE SAME FUNCTIONALITY, HOW TO DO THIS: "form will be submitted by administrators only, you can consider adding a dropdown field that will display all site users (or a particular group). The administrator would then be able to select the target user.

A small script will also be required, within the PHP Scripts > Scripts called after form process area that will automatically assign the submission to the selected user. You will need to alter the following RSForm!Pro database table:

_rsform_submissions (notice the Username, UserId columns) "
The administrator has disabled public write access.

assignment submission for a particular User 9 years 3 months ago #33666

Like alexp wrote me i ve created drop down field, and paste in this field "items" this code:
//<code>
$db = JFactory::getDBO();
$db->setQuery("SELECT `name`, `email` FROM #__users");
$rez = $db->loadObjectList();
$items = "|Select...\n";
foreach($rez as $r){
	$items .= $r->email."|".$r->name."\n";
}
return trim($items);
//</code>

After that i went to Properties (of this form)->PHP Scripts and paste in "Script called after form has been processed" below code:
<?php
 
$db = JFactory::getDBO();
$db->setQuery("UPDATE #__rsform_submissions SET `UserId` = '".$db->escape($_POST['form name']['dropdown field name'][0])."' WHERE `SubmissionId` = '".$SubmissionId."'");
$db->query();
 
?>

and this stil doesnt work.

USERID of the selected in dropdown menu is not pasted in the Submitter's User ID .

Where is the mistake? Could any from this forum can send me information ?
The administrator has disabled public write access.

assignment submission for a particular User 9 years 3 months ago #33681

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Given that the customer support service helped you with the solution, can you post the solution here as well ?
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

assignment submission for a particular User 9 years 3 months ago #33686

ALEXP. THANK YOU NOW IT WORKS BELOW IS SOLUTION:

Like alexp wrote me i ve created drop down field, and paste in this field "items" this code:
//<code>
$db = JFactory::getDBO();
$db->setQuery("SELECT `id`, `name` FROM #__users");
$rez = $db->loadObjectList();
$items = "|Select...\n";
foreach($rez as $r){
	$items .= $r->id."|".$r->name."\n";
}
return trim($items);
//</code>

After that i went to Properties (of this form)->PHP Scripts and paste in "Script called after form has been processed" below code:
$db = JFactory::getDBO();
$user = JFactory::getUser($_POST['form']['klient'][0]);
$db->setQuery("UPDATE #__rsform_submissions SET `UserId` = '".$db->escape($_POST['form']['klient'][0])."', `Username` = '".$user->username."' WHERE `SubmissionId` = '".$SubmissionId."' LIMIT 1");
$db->query();
 


there is only one more problem. When user is chosen from the dropdown menu, he will not receive email that form is fieled in, and hew was chosen to be able to see it in directory submission. How to fix this ?
Last Edit: 9 years 3 months ago by alexp.
The administrator has disabled public write access.

assignment submission for a particular User 9 years 3 months ago #33688

my second question was also resolved by alexp : "When user is chosen from the dropdown menu, he will not receive email that form is fieled in, and hew was chosen to be able to see it in directory submission. How to fix this ? "

solution is simple :

in form-> properties go to "PHP email scripts". Then in field: "Script called before the User Email is sent" please pasted this script:
$user = JFactory::getUser($_POST['form name']['drop down field with users list'][0]);
$userEmail['to'] = $user->email;
Great support alexp :)
Last Edit: 9 years 3 months ago by p.jaworski.
The administrator has disabled public write access.

assignment submission for a particular User 5 years 6 months ago #39574

I have this all working but cant get the user email element to work.

$user = JFactory::getUser($_POST[0]);
$userEmail = $user->email;

Have chnaged "form name" and "dropfown field with users list" but it just sends a copy of the email to the admin user who is submitting for someone else.

Any ideas where I am going wong?
The administrator has disabled public write access.

assignment submission for a particular User 5 years 1 week ago #40095

  • SNortham
  • SNortham's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
//<code>
$db = JFactory::getDBO();
$db->setQuery("SELECT `id`, `name` FROM #__users");
$rez = $db->loadObjectList();
$items = "|Select...\n";
foreach($rez as $r){
$items .= $r->id."|".$r->name."\n";
}
return trim($items);
//</code>

- How can I put the output from this list in Alphabetical order? :)

Thanks
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!