SugarCRM: How to filter query in subpanel Select popup that is specific for one module only - sugarcrm

I am using SugarCRM 6.5. I have a Users subpanel from my custom module. When I click Select, I need to filter the list of users. The challenge is it will only filter when triggered from the custom module and should not from other module using the User popup.
Tried this solution How I can customize query in view.popup in SugarCRM but it doesn't work on my end.
I manage to filter from User.php, adding the query filter in create_new_list_query, however it affects other module (it filters when it should not). I cannot figure out how to add condition for the custom module specific. It seems like it does not know what module that triggers the User popup.
Any possible solutions?
Your answers will be highly appreciated. Thank you!

Related

CRM365 On Prem - Document Templates: how to hook the select event in the form menu

The CRM365 Form displays a convenient document template dropdown button where a number of actions could be initiated. Additionally, it displays the list of already existing document templates. The user can select one template in the list and it is downloaded locally by your browser. So far all good.
Our goal is actually to select the template, retrieve it, and create it in a Document Management repository. We have a working solution for this but it involves too many pieces and steps so we are looking for some better ideas.
Ideally we are looking for a solution where we can:
"intercept" the click on the template item and run a JavaScript function
If we find a solution to this, the rest would be just calling our custom workflow to do the rest of the job.
So, is there any way to hook that "select/click" event from the form menu?
Thank you very much for your help and advice.

Prefilled notes of Class attributes in Enterprise architect

is there a way to have prefilled attributes notes in enterprise architect?
It should be something like this scenario:
1) I create new attribute
2) Enterprise architect prefill note of attribute with predefined text
Something like template for attributes.
Thank you for any advice
I know this won't help directly this question.
Anyways you can achieve it through an external addin.
All you need to do is handle the EA_OnPreNewAttribute and EA_OnPostNewAttribute broadcast events .
This isn't quite what you're after but it is possible to create an Attribute stereotype in a Profile and add to this a Tag with an initial value set to what ever you want. When you create an attribute with this stereotype, this means your predefined text would appear in a tag-value for the attribute rather than the note. Not ideal, but might work for you.
You could also have a go at writing some JavaScript to do this as well (under Scripting in EA). You'd have to use the JS to navigate the repository structure, find the attributes in question, and update their note. I don't believe you can attach a script to a UI event, so I think you'd be stuck running this post-hoc rather than having the note auto-populate on attribute creation.

laravel backpack - crud select change filter

I am using backpack CRUD in laravel 5.3
I have 3 models: product, country and region. And I am looking way to similar function as jquery onchange ajax call.
Product crud has select for county and region. If I selected country, region select should filtered by selected country.
I don't know find crud function for this or way to insert js to edit view for one controller.
I'm afraid there's no pre-built field that will help you. Possible solutions:
create a custom field type for this purpose, starting from select2 or select2_from_ajax, that watches the change event on the first field and filters the second;
include the same javascript in your public\vendor\backpack\crud\js\form.js;
I would recommend option (1), seems cleaner to me.
Hope it helps, cheers!

How to create a list of users on in Alfresco Activiti?

so I have this simple question that I would love to get anwserd.
I am new to BPM an Alfresco Activiti and I am workng on with the trial version of Alfresco Activiti to create a sample project for our company.
I decided to work with the Step editor to se what it can do and if it's as powerfull as a normal BPMN 2.0 editor.
Now I am working on a form where one user would need to select the user for the next task. I was wondering if it's possible to use the single select component to display all the users on the server from which the asignee for the next task could be selected. How can this be done?
I know it is not the bes pracitce to show all the users on the server but this is a test project and your help would be really appreciated.
If any more info is required I will gladly edit the post.
Thnak you.
There is a user picker form control in there, that allows searching the whole system. See the third entry:
you can create a dropdown whose options are populated from a rest call which is provided below.
GET api/enterprise/admin/users
This will return list of all users available in JSON format.
Hope it helped.

twitter bootstrap autocomplete dropdown / combobox with Knockoutjs

I have a requirement where I HAVE TO use bootstrap autocomplete dropdown, BUT user can have free form text in that dropdown if they wish. Before you think about TypeAhead, I could use Bootstrap TypeAhead textbox, but I need to have the dropdown becasue we want to give some default values as headstart options in case users dont know what to search for.
I am using this with MVC DropDownListFor as that creates a select control for us.
I found this article which does that for me.
https://github.com/danielfarrell/bootstrap-combobox/pull/20
All I had to do was take off the name from the select control and the control was letting me enter free form text. All good so far.
Now, I am using this in conjunction with Knockoutjs. I bind my options and selected value to the select control and then on row rendered of my template, I called (selector).combobox() which makes the select control a bootstrap comobobox and adds an input control and hides the select control in the scenes behind.
The problem now is when I try to get he values to post to server, since the value I put in input box is not a valid options from the options I gave to select control, it is always setting it to the first option by default. This is becasue, I set the binding of the selected value on select control and not on the input box which was created by bootstrap-combobox.js.
My question is how do I get the input box to data-bind to the same porperty as the the select control was bound to.
Any other options??
Let me know if you need more clarification or have questions.
Please suggest.
Thanks.
Have a look at Select2 for Bootstrap. It should be able to do everything you need.
Another good option is Selectize.js. It feels a bit more native to Bootstrap.
Does the basic HTML5 datalist work? It's clean and you don't have to play around with the messy third party code. W3SCHOOL tutorial
The MDN Documentation is very eloquent and features examples.
Select2 for Bootstrap 3 native plugin
https://fk.github.io/select2-bootstrap-css/index.html
this plugin uses select2 jquery plugin
nuget
PM> Install-Package Select2-Bootstrap
Fuel UX combobox has all the features you would expect.
Can i suggest http://www.jqueryscript.net/form/Twitter-Like-Mentions-Auto-Suggesting-Plugin-with-jQuery-Bootstrap-Suggest.html, works more like the twitter post suggestion where it gives you a list of users or topics based on # or # tags,
view demo here: http://www.jqueryscript.net/demo/Twitter-Like-Mentions-Auto-Suggesting-Plugin-with-jQuery-Bootstrap-Suggest/
in this one you can easily change the # and # to anything you want
Bootstrap Tokenfield seems good too: http://sliptree.github.io/bootstrap-tokenfield/