Home Cireson Uploads
image


IT Monkey will place code here as examples of what Cireson's consulting team has to offer as well as examples for public consumption to benefit the Microsoft System Center community as a whole.

DISCLAIMER

All files and projects located here come as is and without any warranty or support. We will attempt to improve the projects as time goes on based on customer and community demand. Comments and improvements are welcome as well as customization requests. Your use of these Cireson Uploads is subject to our Terms of Use.


Cireson's support team has no information on these projects outside of what you have available and will not provide support for these enhancements, extensions, and scripts.

Dont forget to checkout solutions uploaded by our customers, partners and community members here.

Portal Asset Search

13»

Comments

  • Marek_LefekMarek_Lefek Customer Advanced IT Monkey ✭✭✭

    Hi Joivan,

    I've used @Stefan_Henseler customization from github, but it is not the solution.

    Is there a possibility to display the Software/Hardware/User option on list only for specific users or groups?

  • Marek_LefekMarek_Lefek Customer Advanced IT Monkey ✭✭✭

    Is there a possibility, that in search top menu, normal users could have only standard options (WorkItems, KnowledgeBase and ServiceCatalog). Search for Hardware Items, Software Item and Users menu will be avaible ony for Analitycs or Asset Managers? 

      

  • joivan_hedrickjoivan_hedrick Cireson Consultant Advanced IT Monkey ✭✭✭
    @Marek_Lefek Indeed, both options are very possible.
    For any user, you can check to see if they are an administrator by using "session.user.IsAdmin" . Similarly, you can check for analysts and asset managers with "session.user.Analyst" and "session.user.AssetManager". See attached ss_01 for screenshot. 

    With a little bit of additional scripting and the GetUsersGroups API call, you can check the current user's AD group membership as well. And if they are a member of certain AD groups, then either show or hide the categories. This API call is done in the attached js file. 
  • German_MinicucciGerman_Minicucci Customer IT Monkey ✭
    I'm not an expert... but I'm trying to use this code to have the 3 additional options on the main search box but instead of displaying results, redirect the search to a custom page.
    Basically, you'd select "User", enter something "Smith" and either if you click on the magnifying glass or hit enter capture that and redirect to another URL.
    Any advice from the gurus?
  • Conner_WoodConner_Wood Customer Ninja IT Monkey ✭✭✭✭
    Does this work in latest portal release?
  • joivan_hedrickjoivan_hedrick Cireson Consultant Advanced IT Monkey ✭✭✭
    Affirmative, it works with the current version of 8.1.0.2016. 
  • Silas_SulserSilas_Sulser Customer Advanced IT Monkey ✭✭✭

    Many thanks for sharing that solution! We totally love it.

    Is there any possibility (code) to set "Work items" as default search category?

    After adding this Asset Search App the search category is automatically being set to "Hardware Asset" which is not very convenient for us, because we more use the workitem search.

    On the "custom_InitSearch.js"-file I've seen the line:

    customSearchHardwareAsset.initSearch(searchInput);      
     // set Hardware Asset search as default if user is hardware asset manager

    Can we change it by editing this line?

    Thanks and best regards

    Silas


  • seth_coussensseth_coussens Member Ninja IT Monkey ✭✭✭✭
    @joivan_hedrick
    see above
  • damon_mulligandamon_mulligan Cireson Consultant Advanced IT Monkey ✭✭✭
    edited February 2018
    @Silas_Sulser

    Comment out this section to remove default to Asset Search in the initSearch.js file.:
    Or you can delete.

    function init (searchInput) {
    if (session.user.AssetManager === 1) {
    customSearchHardwareAsset.initSearch(searchInput);

    /* Comment Out Starts Here
    // set Hardware Asset search as default if user is hardware asset manager
    var currentURL = window.location.href;
    var searchParam = $("input[name=search_param]"); //the hidden field which holds the search type id
    var searchConcept = $("span[id=search_concept]"); //the span field which displays the search type value      
    searchParam.val("HardwareAsset");
    searchConcept.html('Hardware Asset');    
    Comment Out Ends Here*/
    }
    };
  • Mark_GearyMark_Geary Customer IT Monkey ✭
    HI this has stopped working in the new version of the portal any ideas on how we can fix this? 
  • Michael_McAllisterMichael_McAllister Customer IT Monkey ✭
    edited November 2018
    HI this has stopped working in the new version of the portal any ideas on how we can fix this? 
    This has stopped working for us as well on 8.9.5. As far as I can tell, the javascript and SQL are both working correctly as the search shows up, it just doesn't return any results. Ran the query manually against the database and it returns just fine. Only thing I can think of is that it's related to the API being changed?

    I'll report back if we find out anything else new.
  • joivan_hedrickjoivan_hedrick Cireson Consultant Advanced IT Monkey ✭✭✭
    We're looking into this one, but we do have an interim workaround. In the SQL query that is defined in the datasource, If you replace the parameter name with all upper case characters, this should allow the API call to return results as expected. e.g. change:
    WHERE HWA.DisplayName like '{{assetSearchTerm}}'
    to
    WHERE HWA.DisplayName like '{{ASSETSEARCHTERM}}'


  • Alex_MarshAlex_Marsh Premier Partner Advanced IT Monkey ✭✭✭
    Tried the fix as mentioned for the user search however it's just returning undefined for all of the results. I can only assume there's been an API change of some description which isn't presenting the results correctly
  • Roland_KindRoland_Kind Partner Advanced IT Monkey ✭✭✭

    maybe the following will help:

    returned field names are all in uppercase: https://support.cireson.com/Problem/Edit/PR79162/


  • Alex_MarshAlex_Marsh Premier Partner Advanced IT Monkey ✭✭✭
    That'll be it then! I'll have to amend the returned field names to capitals until it's resolved
  • Creighton_BarnesCreighton_Barnes Customer IT Monkey ✭
    Glad I found this thread. Is there any thoughts on Cireson just adding a search to the product by default? Seems like a no brainer feature I didn't know wasn't there till I was neck deep in configuring CAM.
  • Justin_WorkmanJustin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭

    Anybody still using this vs Global Search? I've successfully converted this to an odata search and just looking to see if anyone is interested.

  • Ian_GlennIan_Glenn Customer Adept IT Monkey ✭✭

    Hi Justin, we are still using this and would be interested in an odata version.

  • Robert_OsterbergRobert_Osterberg Customer Adept IT Monkey ✭✭

    Hi Justin

    Yes we also still use mostly because that you don`t have to input an exact search string searching for an Hardware it only requires a part of it.

    example ABCDE1234 you can find the hardware by just searching for 1234 and it is very fast

Sign In or Register to comment.