Warning: The magic method SFML_Singleton::__wakeup() must have public visibility in /home/selectec/public_html/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php on line 72

Warning: Cannot modify header information - headers already sent by (output started at /home/selectec/public_html/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php:72) in /home/selectec/public_html/wp-content/plugins/uncode-privacy/includes/class-uncode-toolkit-privacy-public.php on line 355

Warning: Cannot modify header information - headers already sent by (output started at /home/selectec/public_html/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php:72) in /home/selectec/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/selectec/public_html/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php:72) in /home/selectec/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/selectec/public_html/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php:72) in /home/selectec/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/selectec/public_html/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php:72) in /home/selectec/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/selectec/public_html/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php:72) in /home/selectec/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/selectec/public_html/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php:72) in /home/selectec/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/selectec/public_html/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php:72) in /home/selectec/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/selectec/public_html/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php:72) in /home/selectec/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831
{"id":2387,"date":"2016-05-26T14:22:28","date_gmt":"2016-05-26T14:22:28","guid":{"rendered":"http:\/\/staging.selectec.com\/?p=2387"},"modified":"2018-09-27T11:00:41","modified_gmt":"2018-09-27T11:00:41","slug":"script-month-8-disable-print-archiving","status":"publish","type":"post","link":"https:\/\/selectec.com\/script-month-8-disable-print-archiving\/","title":{"rendered":"PaperCut Print Script of the Month #8 – Disable Print Archiving"},"content":{"rendered":"

PaperCut Print Script of the month<\/h2>\n

 <\/p>\n

This month we’re going to look at how we can use a\u00a0PaperCut Print Script to try and fire Ross again, last time we tried he found out a bit early by looking at the print archives, this time, we have created a script so HR can opt to disable print archiving for jobs that they believe are sensitive. To find out how we did this grab a cup of coffee and continue reading.<\/p>\n

After looking through the Print Script API documentation<\/a>, I noticed a useful\u00a0method: actions.job.disableArchiving()<\/strong>, This will allow us to disable the archiving so that sensitive or confidential documents are not viewable by other users.<\/p>\n

\"archiving_disabled\"<\/p>\n

 <\/p>\n

To start setting this up we are going to create three\u00a0variables one for the group, one for the message to show in a pop-up and the last one will contain the message to show as a job comment.<\/p>\n

var GROUP = \"HR\";\r\nvar MESSAGE = \"Do you want to disable archiving for this job?\";\r\nvar COMMENT = \"This job was considered sensitive and archiving was disabled\";<\/pre>\n

 <\/p>\n

Next\u00a0we need to check if the user is in the group we have set in the variable and display a popup box. There a few different types of popup box we can create which will be covered in future\u00a0articles. For this month we are only interested in a simple Yes or No box. We will also need to use the response from the box in the script so we will need to set it to a variable.<\/p>\n

if (inputs.user.isInGroup(GROUP)) {\r\n    var RESP = actions.client.promptYesNo( MESSAGE );\r\n    \/\/ More code will follow\r\n}<\/pre>\n

 <\/p>\n

After that we now have a window that will pop up when a user in the HR group prints it should look something like this:<\/p>\n

\"sotm_8_pop_up\"<\/p>\n

At the moment it doesn’t matter what option is selected as we are not checking the response, The first one we will want to check is if they click Yes the value that will be returned is YES so it will just be a simple case of checking to see if RESP matches that value. We will also want to add the actions.job.disableArchiving()<\/strong> method and provide a handy comment to go along with the job so we can see why there is no archived copy of the job this is done using actions.job.addComment()<\/strong>.<\/p>\n

if (RESP == \"YES\"){\r\n    actions.job.disableArchiving();\r\n    actions.job.addComment(COMMENT);\r\n    return;\r\n}<\/pre>\n

 <\/p>\n

The only thing left to do now is deal with nothing being pressed this is referred to as TIMEOUT, We are not bothered with what happens when they click No as we just want the job to print out like normal, so we don’t need to set anything for it.<\/p>\n

if (RESP == \"TIMEOUT\") {\r\n    actions.job.cancel();\r\n    return;\r\n}<\/pre>\n

 <\/p>\n

That is it for this month and as always the complete print script is below and don’t worry we didn’t let anyone go in the making of this script.<\/p>\n

 <\/p>\n

If you have your own requirements for a PaperCut Print Script and you don\u2019t have the time or in-house experience to make it you can find out how we can help you by sending an email to our sales team at sales@selectec.com<\/a><\/h3>\n

 <\/p>\n

\/*\r\n* Allow a group of users to disable Archiving\r\n*\r\n* Read more at http:\/\/selectec.com\/script-of-the-month-8-disable-print-archiving\/\r\n*\/\r\nfunction printJobHook( inputs, actions ) {\r\n\r\n    var GROUP = \"HR\";\r\n    var MESSAGE = \"Do you want to disable archiving for this job?\";\r\n    var COMMENT = \"This job was considered sensitive and archiving was disabled\";\r\n\r\n    if (!inputs.job.isAnalysisComplete) {\r\n        return;\r\n    }\r\n\r\n    if (inputs.user.isInGroup(GROUP)) {\r\n        var RESP = actions.client.promptYesNo( MESSAGE );\r\n\r\n        if (RESP == \"TIMEOUT\") {\r\n            actions.job.cancel();\r\n            return;\r\n        }\r\n\r\n        if (RESP == \"YES\"){\r\n            actions.job.disableArchiving();\r\n            actions.job.addComment(COMMENT);\r\n            return;\r\n        }\r\n    }\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"

PaperCut Print Script of the month   This month we’re going to look at how we can use a\u00a0PaperCut Print […]<\/p>\n","protected":false},"author":14,"featured_media":2390,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,27,40],"tags":[],"_links":{"self":[{"href":"https:\/\/selectec.com\/wp-json\/wp\/v2\/posts\/2387"}],"collection":[{"href":"https:\/\/selectec.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/selectec.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/selectec.com\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/selectec.com\/wp-json\/wp\/v2\/comments?post=2387"}],"version-history":[{"count":4,"href":"https:\/\/selectec.com\/wp-json\/wp\/v2\/posts\/2387\/revisions"}],"predecessor-version":[{"id":5645,"href":"https:\/\/selectec.com\/wp-json\/wp\/v2\/posts\/2387\/revisions\/5645"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/selectec.com\/wp-json\/wp\/v2\/media\/2390"}],"wp:attachment":[{"href":"https:\/\/selectec.com\/wp-json\/wp\/v2\/media?parent=2387"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/selectec.com\/wp-json\/wp\/v2\/categories?post=2387"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/selectec.com\/wp-json\/wp\/v2\/tags?post=2387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}