{"id":26768,"date":"2021-03-01T08:11:17","date_gmt":"2021-03-01T07:11:17","guid":{"rendered":"https:\/\/help.qualiware.it\/qw-help\/?p=26768"},"modified":"2022-04-13T10:31:57","modified_gmt":"2022-04-13T08:31:57","slug":"invio-di-un-messaggio-ai-redattori-e-agli-utenti-coinvolti-in-altre-fasi-bpm","status":"publish","type":"post","link":"https:\/\/help.qualiware.it\/qw-help\/invio-di-un-messaggio-ai-redattori-e-agli-utenti-coinvolti-in-altre-fasi-bpm\/","title":{"rendered":"Invio di un messaggio ai redattori e agli utenti coinvolti in altre fasi (BPM)"},"content":{"rendered":"<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"visualbasic\">' Questo script invia mail di notifica ai redattori del documento (fase R), o agli utenti coinvolti in altre fasi.\r\n' NB Tali fasi devono essere iniziate o concluse, non da cominciare\r\n\r\ndim tipo, tipo_cont, numero as string\r\ndim ind_rev as integer\r\n\r\nUnpackcode(\"DW\",CODDOC,tipo,tipo_cont,numero,ind_rev)\r\n\r\nDim par1 As AssocArray = New AssocArray\r\ndim q1 as qwtable\r\nDim msg1,sql1 as String\r\ndim QWSess As QWSession = DB.QWSession\r\ndim dest as new dbarray()\r\ndim URL AS string\r\nurl = QWSess.DESCRITT.Rowset.Fields(\"QWS_URL\").value+\"\/redirect.aspx?DOC=DW|\"+CODDOC\r\n\r\n' Va a cercare i redattori : si pu\u00f2 inviare agli utenti di altra fase sostituendo il suo codice nel parametro CODFASE\r\npar1(\"T\")=tipo\r\npar1(\"TC\")=tipo_cont\r\npar1(\"N\")=numero\r\npar1(\"IR\")=ind_rev\r\npar1(\"CODFASE\")=\"R\"\r\nsql1=\"select p.mail from doc_reve dr join person p on dr.nome=p.codice where tipo=:T and tipo_cont=:TC and numero=:N and ind_rev=:IR and tipo_p=:CODFASE and p.mail is not null\"\r\n\r\n\u2018Per aggiungere un'altra fase alla notifica, commentare la riga precedente (sql1=\u2026) e abilitare le due successive\r\n'par1(\"CODFASE2\")=\"V\"\r\n'sql1=\"select p.mail from doc_reve dr join person p on dr.nome=p.codice where tipo=:T and tipo_cont=:TC and numero=:N and ind_rev=:IR and (tipo_p=:CODFASE or tipo_p=:CODFASE2) and p.mail is not null\"\r\n\r\n\u2018Per aggiungere due altre fasi alla notifica, commentare la riga precedente (sql1=\u2026) e abilitare le tre successive\r\n'par1(\"CODFASE2\")=\"V\"\r\n'par1(\"CODFASE3\")=\"X\"\r\n'sql1=\"select p.mail from doc_reve dr join person p on dr.nome=p.codice where tipo=:T and tipo_cont=:TC and numero=:N and ind_rev=:IR and (tipo_p=:CODFASE or tipo_p=:CODFASE2 or tipo_p=:CODFASE3) and p.mail is not null\"\r\n\r\nq1=OpenTable(DB,sql1,par1,false,false,msg1)\r\n\r\nif empty(msg1) and q1.rowset.first()\r\n                do while not q1.rowset.endofset()\r\n                               dest.add(q1.rowset.fields(1).value)\r\n                               q1.rowset.next()\r\n                loop       \r\n\r\n\u2018 Nel quanto argomento si pu\u00f2 indicare l\u2019oggetto della mail inviata; nel quinto il testo; possono contenere due variabili con codice univoco del documento (CODDOC) e il link ad esso (url)\r\n   BPMSendMail(DB,CODDOC,dest,\"OGGETTO MAIL \"+CODDOC,\"Testo mail &lt;a href='\"+url+\"'&gt;link&lt;\/a&gt;\",false)\r\nend if\r\nCloseTable(q1)\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&#8216; Questo script invia mail di notifica ai redattori del documento (fase R), o agli utenti coinvolti in altre fasi. &#8216; NB Tali fasi devono essere iniziate o concluse, non da cominciare dim tipo, tipo_cont, numero as string dim ind_rev as integer Unpackcode(&#8220;DW&#8221;,CODDOC,tipo,tipo_cont,numero,ind_rev) Dim par1 As AssocArray = New AssocArray dim q1 as qwtable Dim&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"ngg_post_thumbnail":0,"footnotes":""},"categories":[65],"tags":[69,70],"acf":[],"_links":{"self":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts\/26768"}],"collection":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/comments?post=26768"}],"version-history":[{"count":0,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts\/26768\/revisions"}],"wp:attachment":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/media?parent=26768"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/categories?post=26768"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/tags?post=26768"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}