Simple Print View

Justin_WorkmanJustin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭
edited June 2018 in Cireson Uploads

SMP_SimplePrint

This will generate a simple print view of a given work item in the Cireson Portal for Service Manager. It will list all properties that have values in a single grid. It will also show the Action Log, Reviewers(if the Work Item is a Review Activity),and the Work Item History.

https://github.com/justinkwork/SMP_SimplePrint

After the success of my Powershell version of Export to HTML, I decided to give a portal task a try.  Please be aware that I'm no javascript expert and this is very hacked together, but it does seem to work fairly well at least in my lab.  I welcome all feedback, requests, and contributions! ;)

Comments

  • Adam_DzyackyAdam_Dzyacky Customer Contributor Monkey ✭✭✭✭✭
    Awesome work @Justin_Workman !
  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    You are on a roll, @Justin_Workman.  This is another really useful tool!
  • Joe_BurrowsJoe_Burrows Cireson Devops Super IT Monkey ✭✭✭✭✭
    +1  - very nice Justin - use to get asked for better print a lot!
  • Mikkel_MadsenMikkel_Madsen Customer Adept IT Monkey ✭✭
    Great feature  :smile:

    A feature request to this is implementing it for KB articles too :wink: 
  • Steve_WrightSteve_Wright Cireson Support Advanced IT Monkey ✭✭✭
    +1 - Nice work!
  • Jeremy_WhalenJeremy_Whalen Customer IT Monkey ✭
    @Justin_Workman

    I just installed this but am unclear on how exactly to history. Is this modified in the custom.js? 
     
    Per the GitHub page:
    showHistory - Set this to false to disable the History. URL Example:/view/printView?workItemType=Incident&workItemId=IR123&showHistory=false
  • Justin_WorkmanJustin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭
    @Jeremy_Whalen - History should come up by default.  If you want to exclude history, you can change the task registration in custom.js.  So where you have something like:
    app.custom.formTasks.add('Incident', "Simple Print", function (formObj, viewModel) { 
       window.open('/view/printView?workItemType=Incident&workItemId=' + viewModel.Id, '_blank');
    });

    you would change:
    window.open('/view/printView?workItemType=Incident&workItemId=' + viewModel.Id, '_blank');
    to :
     window.open('/view/printView?workItemType=Incident&workItemId=' + viewModel.Id + "&showHistory=false", '_blank');

    Then every incident will open with the history turned off.  I hope this helps!
  • Jeremy_WhalenJeremy_Whalen Customer IT Monkey ✭
    Thanks @Justin_Workman despite my nonsensical question your provided the exact insight I needed!
  • Jeremy_WhalenJeremy_Whalen Customer IT Monkey ✭
    @Justin_Workman and another question. We have five review activities one after another. The first three open in a single tab, one after another, the last two do not open at all. Any ideas on what might cause this?

  • Justin_WorkmanJustin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭
    @Justin_Workman and another question. We have five review activities one after another. The first three open in a single tab, one after another, the last two do not open at all. Any ideas on what might cause this?

    I have seen this too.  I'm not sure of the cause.  I'll have a look and see if I can figure it out.
  • Justin_WorkmanJustin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭
    @Jeremy_Whalen - Do you have your pop up blocker disabled for your portal site?  My popup blocker was catching all but one of my activities.  When I did an explicit rule to allow my portal site, they all came through.
  • Jeremy_WhalenJeremy_Whalen Customer IT Monkey ✭
    edited February 14
    @Justin_Workman Pop up blocker is off. When I run the "Simple Print Activities" task in Chrome or IE I get multiple new tabs created. Review activities open in the same tab (except two that never open), one after another so I have to use the back button to go the prior RA steps for printing. Each MA opens in its own tab.

    In Firefox when pop ups are allowed it will only open one RA but all MA and RB. When popups are blocked it opens only first activity (an MA) and prompts me that 10 more tabs are trying to open. When I allow pop ups ALL of the remaining activities open in their own tabs. It's almost like the pause is somehow important. Any thoughts on why the RA are trying to open in the same tab in IE and Chrome?

    Here are the activity types in order.
    01 MA 
    02 RB 
    03 RA (has loaded sporadically)
    04 RA 
    05 MA 
    06 RA (has never loaded except in FF and then only after allowing all popups)
    07 RA 
    08 MA 
    09 RA 
    10 MA 
    11 RA

    I hope that makes some sort of sense to you. If not we might need to talk so I can explain it better.
  • Craig_SmithCraig_Smith Customer IT Monkey ✭
    This work around seems cobbled together :)
Sign In or Register to comment.