From db38a20908f7ff0191f8d030df3aaf9df50ae7ec Mon Sep 17 00:00:00 2001 From: Alexey Koshelev Date: Tue, 24 Mar 2026 12:07:08 +0300 Subject: [PATCH] [PDF Form] Add Send for signing panel --- apps/api/documents/api.js | 3 +- apps/common/Gateway.js | 7 +- apps/common/main/lib/util/utils.js | 3 +- apps/common/main/lib/view/Header.js | 8 +- .../toolbar/1.25x/btn-menu-send-to-sign.png | Bin 0 -> 291 bytes .../resources/img/toolbar/1.25x/btn-user.png | Bin 0 -> 259 bytes .../toolbar/1.5x/btn-menu-send-to-sign.png | Bin 0 -> 314 bytes .../resources/img/toolbar/1.5x/btn-user.png | Bin 0 -> 508 bytes .../toolbar/1.75x/btn-menu-send-to-sign.png | Bin 0 -> 350 bytes .../resources/img/toolbar/1.75x/btn-user.png | Bin 0 -> 519 bytes .../img/toolbar/1x/btn-menu-send-to-sign.png | Bin 0 -> 263 bytes .../resources/img/toolbar/1x/btn-user.png | Bin 0 -> 287 bytes .../toolbar/2.5x/btn-menu-send-to-sign.svg | 4 + .../resources/img/toolbar/2.5x/btn-user.svg | 3 + .../img/toolbar/2x/btn-menu-send-to-sign.png | Bin 0 -> 419 bytes .../resources/img/toolbar/2x/btn-user.png | Bin 0 -> 490 bytes .../v2/1.25x/btn-menu-send-to-sign.png | Bin 0 -> 366 bytes .../img/toolbar/v2/1.25x/btn-user.png | Bin 0 -> 418 bytes .../toolbar/v2/1.5x/btn-menu-send-to-sign.png | Bin 0 -> 395 bytes .../img/toolbar/v2/1.5x/btn-user.png | Bin 0 -> 433 bytes .../v2/1.75x/btn-menu-send-to-sign.png | Bin 0 -> 450 bytes .../img/toolbar/v2/1.75x/btn-user.png | Bin 0 -> 554 bytes .../toolbar/v2/1x/btn-menu-send-to-sign.png | Bin 0 -> 363 bytes .../resources/img/toolbar/v2/1x/btn-user.png | Bin 0 -> 332 bytes .../toolbar/v2/2.5x/btn-menu-send-to-sign.svg | 3 + .../img/toolbar/v2/2.5x/btn-user.svg | 4 + .../toolbar/v2/2x/btn-menu-send-to-sign.png | Bin 0 -> 533 bytes .../resources/img/toolbar/v2/2x/btn-user.png | Bin 0 -> 544 bytes .../main/app/controller/FormsTab.js | 6 + .../main/app/controller/Main.js | 9 +- .../main/app/controller/RightMenu.js | 22 ++ .../template/FillingStatusSettings.template | 48 +++ .../main/app/template/RightMenu.template | 4 + .../template/SendForSigningSettings.template | 22 ++ .../main/app/view/FillingStatusSettings.js | 107 ++++++ .../documenteditor/main/app/view/RightMenu.js | 43 ++- .../main/app/view/SendForSigningSettings.js | 302 ++++++++++++++++ .../main/resources/less/rightmenu.less | 331 ++++++++++++++++++ 38 files changed, 919 insertions(+), 10 deletions(-) create mode 100644 apps/common/main/resources/img/toolbar/1.25x/btn-menu-send-to-sign.png create mode 100644 apps/common/main/resources/img/toolbar/1.25x/btn-user.png create mode 100644 apps/common/main/resources/img/toolbar/1.5x/btn-menu-send-to-sign.png create mode 100644 apps/common/main/resources/img/toolbar/1.5x/btn-user.png create mode 100644 apps/common/main/resources/img/toolbar/1.75x/btn-menu-send-to-sign.png create mode 100644 apps/common/main/resources/img/toolbar/1.75x/btn-user.png create mode 100644 apps/common/main/resources/img/toolbar/1x/btn-menu-send-to-sign.png create mode 100644 apps/common/main/resources/img/toolbar/1x/btn-user.png create mode 100644 apps/common/main/resources/img/toolbar/2.5x/btn-menu-send-to-sign.svg create mode 100644 apps/common/main/resources/img/toolbar/2.5x/btn-user.svg create mode 100644 apps/common/main/resources/img/toolbar/2x/btn-menu-send-to-sign.png create mode 100644 apps/common/main/resources/img/toolbar/2x/btn-user.png create mode 100644 apps/common/main/resources/img/toolbar/v2/1.25x/btn-menu-send-to-sign.png create mode 100644 apps/common/main/resources/img/toolbar/v2/1.25x/btn-user.png create mode 100644 apps/common/main/resources/img/toolbar/v2/1.5x/btn-menu-send-to-sign.png create mode 100644 apps/common/main/resources/img/toolbar/v2/1.5x/btn-user.png create mode 100644 apps/common/main/resources/img/toolbar/v2/1.75x/btn-menu-send-to-sign.png create mode 100644 apps/common/main/resources/img/toolbar/v2/1.75x/btn-user.png create mode 100644 apps/common/main/resources/img/toolbar/v2/1x/btn-menu-send-to-sign.png create mode 100644 apps/common/main/resources/img/toolbar/v2/1x/btn-user.png create mode 100644 apps/common/main/resources/img/toolbar/v2/2.5x/btn-menu-send-to-sign.svg create mode 100644 apps/common/main/resources/img/toolbar/v2/2.5x/btn-user.svg create mode 100644 apps/common/main/resources/img/toolbar/v2/2x/btn-menu-send-to-sign.png create mode 100644 apps/common/main/resources/img/toolbar/v2/2x/btn-user.png create mode 100644 apps/documenteditor/main/app/template/FillingStatusSettings.template create mode 100644 apps/documenteditor/main/app/template/SendForSigningSettings.template create mode 100644 apps/documenteditor/main/app/view/FillingStatusSettings.js create mode 100644 apps/documenteditor/main/app/view/SendForSigningSettings.js diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index bdcc11f603..1958e6f8d4 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -403,7 +403,8 @@ _config.editorConfig.canRequestSelectSpreadsheet = _config.events && !!_config.events.onRequestSelectSpreadsheet; _config.editorConfig.canRequestReferenceSource = _config.events && !!_config.events.onRequestReferenceSource; _config.editorConfig.canSaveDocumentToBinary = _config.events && !!_config.events.onSaveDocument; - _config.editorConfig.canStartFilling = _config.events && !!_config.events.onRequestStartFilling; + _config.editorConfig.canRequestStartFilling = _config.events && !!_config.events.onRequestStartFilling; + _config.editorConfig.canStartFilling = _config.events && !!_config.events.onStartFilling; _config.editorConfig.canRequestRefreshFile = _config.events && !!_config.events.onRequestRefreshFile; _config.editorConfig.canUpdateVersion = _config.events && !!_config.events.onOutdatedVersion; _config.editorConfig.canRequestFillingStatus = _config.events && !!_config.events.onRequestFillingStatus; diff --git a/apps/common/Gateway.js b/apps/common/Gateway.js index 9a39cb5c6a..701e7fb53d 100644 --- a/apps/common/Gateway.js +++ b/apps/common/Gateway.js @@ -413,8 +413,11 @@ if (window.Common === undefined) { _postMessage({event:'onSwitchEditorType', data: {type: value, restart: restart}}); }, - startFilling: function () { - _postMessage({event:'onStartFilling'}); + startFilling: function (roles) { + _postMessage({ + event:'onStartFilling', + data: roles + }); }, requestFillingStatus: function (role) { diff --git a/apps/common/main/lib/util/utils.js b/apps/common/main/lib/util/utils.js index 26f7dd1aff..bdbda1dfda 100644 --- a/apps/common/main/lib/util/utils.js +++ b/apps/common/main/lib/util/utils.js @@ -118,7 +118,8 @@ define([], function () { Pivot: 10, Cell: 11, Slicer: 12, - Form: 13 + Form: 13, + SendForSigning: 15 }, importTextType = { DRM: 0, diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index 56e4499f0e..420d1d289a 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -402,7 +402,11 @@ define([ } me.btnStartFill && me.btnStartFill.on('click', function (e) { - Common.NotificationCenter.trigger('forms:request-fill'); + if(appConfig.canRequestStartFilling) { + Common.NotificationCenter.trigger('forms:request-fill'); + } else { + Common.NotificationCenter.trigger('forms:show-send-for-signing'); + } }); if (me.btnFillStatus) { @@ -1011,7 +1015,7 @@ define([ } else $html.find('#slot-btn-edit-mode').hide(); - if (config.canStartFilling) { + if (config.showStartFillingButton) { me.btnStartFill = new Common.UI.Button({ cls: 'btn-text-default auto yellow', caption: config.customization && config.customization.startFillingForm && config.customization.startFillingForm.text ? config.customization.startFillingForm.text : me.textStartFill, diff --git a/apps/common/main/resources/img/toolbar/1.25x/btn-menu-send-to-sign.png b/apps/common/main/resources/img/toolbar/1.25x/btn-menu-send-to-sign.png new file mode 100644 index 0000000000000000000000000000000000000000..93654cc547a330fba6a8a060103881648c5e4646 GIT binary patch literal 291 zcmeAS@N?(olHy`uVBq!ia0vp^MnEjd!VDxEs}jnAlth3}h%1l=g8%>jLr6H|QRXx^ zpb&dWkY6x^fk8sT1;4bGcj>txFi zrjj$N!3vAE!`-keJM$9~i|*uS2+svyVf>T$u$^(nv9uBY=(Qs8#HCkuQvC^09*D%_$02HxH;BkvYboqNovipuuJ1 kQb&dv!F-IYU%aImdM1c{U0}@i73e$$Pgg&ebxsLQ0Q=2YN&o-= literal 0 HcmV?d00001 diff --git a/apps/common/main/resources/img/toolbar/1.5x/btn-menu-send-to-sign.png b/apps/common/main/resources/img/toolbar/1.5x/btn-menu-send-to-sign.png new file mode 100644 index 0000000000000000000000000000000000000000..7c23da5dc8819aed45c3fb7cd2663155f6298703 GIT binary patch literal 314 zcmeAS@N?(olHy`uVBq!ia0vp^Hb5-L!VDyvwk6a6DTx4|5LX}#1poj4hmdf_qs(b; zKq2;$AirP+1A~NwN8iuH&u;_@o$_>X45_%acakCBVFeyn*;{Jb!p7d~CP=5O58!85 zHD%_~Q(v=r*mhUHV&t^7&H2F)6T?3B>D$OxkFEPsXA0*RM^5|DJU6uBtCYWIqOb|u zHSM-_=4Yx7$F7%XpAJMb_#|fV{oq~}F1z0C{Hl1~)vFVdQ&MBb@05oBNQvd(} literal 0 HcmV?d00001 diff --git a/apps/common/main/resources/img/toolbar/1.5x/btn-user.png b/apps/common/main/resources/img/toolbar/1.5x/btn-user.png new file mode 100644 index 0000000000000000000000000000000000000000..5d5ae5af45422293c9b5d860cd9e10afb1f1ce0f GIT binary patch literal 508 zcmeAS@N?(olHy`uVBq!ia0vp^Hb5-L!3-qb-Fj<*RAzurh%1l=g8%>j)0!-;u`C4I zp;!{+7tA0aprGL3kdRPNP+#BB(BD6Q{(=ST*KgRcfB*UO_wT=dFIKAA%D}*==;`7Z zQgQ3))YFri6$D%vS$%7ceCN^7`19XgE!0ggW7Eu=OU+|!<5n%)?cK7^y5Qi}d7C*@ zml~vSrL_LlQUttFM^8iCBuX3BMa znxOY4z=t6%SKqJw%8hR036jjeBa9ipZ9JHJtJtH}x0>5!Zo@@t|LsIeV!m2moA_&r@9fIs zW`^_ap1k!jKl$YF(%xP3UoP93Wt0DYj>z}E-I8-APdZo_Tt8vMo|JQc9F<(w2;di#PcDa`6zRjGEoH{;Jb#Oz~vl>J}G|D1%#?He~5_&|~9 M>FVdQ&MBb@0BGCcj{pDw literal 0 HcmV?d00001 diff --git a/apps/common/main/resources/img/toolbar/1.75x/btn-menu-send-to-sign.png b/apps/common/main/resources/img/toolbar/1.75x/btn-menu-send-to-sign.png new file mode 100644 index 0000000000000000000000000000000000000000..d3a21de809f4c229817fabdfb8d71fbb6695e204 GIT binary patch literal 350 zcmeAS@N?(olHy`uVBq!ia0vp^Za}Qe!VDyDTPDTL0o3Igrtw=LA3Y|Op>!JVUf4Qm-Z zC!br=`SEM@qJsa=%u*HFYUAgrQu-8K@0!0e?e)6IEyhz;R9H9f6iZm= iI#qS+CcTH>|4-$w+GYMGxsDGM7!01SelF{r5}E*p!Izu> literal 0 HcmV?d00001 diff --git a/apps/common/main/resources/img/toolbar/1.75x/btn-user.png b/apps/common/main/resources/img/toolbar/1.75x/btn-user.png new file mode 100644 index 0000000000000000000000000000000000000000..c6cd7569bb28b50cead0da946531a3d86efb54de GIT binary patch literal 519 zcmeAS@N?(olHy`uVBq!ia0vp^Za}Qe!3-qjPWHqDsmuVM5LX}#1poj4r!`qxV_68a zL$M^tFPK3*f2$)ph5j2&xil=KXtelx0tNk5L00uv*Ps1B`-}l{(gx}T`L_k zd#&rIbN%~HUstkLHe7V)%>$2AQAeK}S*=A!zH8ex&3WbWF1(1za^}IwhuLm~=be1g z(faM`r-Y~RR+l;xu1X%TkkTo8*^z!wh(Cet!2S%DKRKor5nOBASWYjvy2U7h@2VTC z_PN`2nj!C(@4IgrM?L1cM z`KCBdexdNh6?U}~PlyhS;o literal 0 HcmV?d00001 diff --git a/apps/common/main/resources/img/toolbar/1x/btn-menu-send-to-sign.png b/apps/common/main/resources/img/toolbar/1x/btn-menu-send-to-sign.png new file mode 100644 index 0000000000000000000000000000000000000000..fca5e1af7c4d98a7f52a877964c282c56813b1cd GIT binary patch literal 263 zcmeAS@N?(olHy`uVBq!ia0vp^8bB<oWinbX{W zLhL0$e!&c;rqicC`F2k_q6*bA@sm)YM6U{=Lt#nw1mh1Rvqx;KAbq?k<0P6d1}*=G?phO zA3avT!SuOdt@z4_lXm+KOVlq+4*TMAtM3EPV%e8dO1p+)~nw;rnpK0rTRTx978H@B_}M9*s!MhDMO;+`@fkC zqF=N{>X{O6nq|hcap|QetZ3ShW?)d_%qnkWaKbTSzJx@HA&b7D!HeXK`v(tP=sd5a zqJDONZo~1nZ=T=VTOG`hRCovI$a1EL4Qwl>KegzXD$QW>kS*c^N5=<7!P$;3IuRcj uJ036#$~&;wM|_Z#Xo&cKu;CE{8$-wrBc_!W-_HY`#^CAd=d#Wzp$PySfN=W& literal 0 HcmV?d00001 diff --git a/apps/common/main/resources/img/toolbar/2.5x/btn-menu-send-to-sign.svg b/apps/common/main/resources/img/toolbar/2.5x/btn-menu-send-to-sign.svg new file mode 100644 index 0000000000..7e21ef90fc --- /dev/null +++ b/apps/common/main/resources/img/toolbar/2.5x/btn-menu-send-to-sign.svg @@ -0,0 +1,4 @@ + + + + diff --git a/apps/common/main/resources/img/toolbar/2.5x/btn-user.svg b/apps/common/main/resources/img/toolbar/2.5x/btn-user.svg new file mode 100644 index 0000000000..1ffd4c1ca7 --- /dev/null +++ b/apps/common/main/resources/img/toolbar/2.5x/btn-user.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/common/main/resources/img/toolbar/2x/btn-menu-send-to-sign.png b/apps/common/main/resources/img/toolbar/2x/btn-menu-send-to-sign.png new file mode 100644 index 0000000000000000000000000000000000000000..c55f25bd19da03d0cebb0199433ba5dbbb2781a3 GIT binary patch literal 419 zcmeAS@N?(olHy`uVBq!ia0vp^0YI$5!VDy5`z06wDY*cj5LY1m|NnnX5+a!H%JUg0 z$59gG7tElbm{C)I|9)}8@_!5rj5?k!jv*Ddu1@jJI_$vXkh-1SBkbNR9iF|8*Y`TE z7jRNIt>abGm?XPEqU3g&lDBf^7M_-K#|~E7)VdiRu(v#tE_>Gc$>ujg6Z&*J!rAlq zS08!%a0*jgpRPr`aDkB*Bl~KR4dz~q)~iJXdV(A_c(L{dIj&xEYpH3|(&>^OoE?HC z_8VVbx$Iap^~3%b+8-Y%GJf}b@z2KWpA%(T7t%*2_$&z!*cDCvQnu$2Ro-v4TiLH4;_2bq%vlUV%%$eZ$Sz7T3|4Zld`k|)FUac2ixE~mn44$rjF6*2UngHztuDt*N literal 0 HcmV?d00001 diff --git a/apps/common/main/resources/img/toolbar/2x/btn-user.png b/apps/common/main/resources/img/toolbar/2x/btn-user.png new file mode 100644 index 0000000000000000000000000000000000000000..e60aa1511a44b5ee09056dfd17f291dd2c923500 GIT binary patch literal 490 zcmeAS@N?(olHy`uVBq!ia0vp^0YI$5!3-qh_VpSADa!z#5LX}#1poj4M<(H1JPh-t z!8|}cf+azI!3+Wd3Mw`Z>2(bg=FUHJ@BaG>e3i=?7#RIMT^vIyZoQpyyXde2kBcGO znWHgF{{O%6;7aKR-G^tkRC>&=Z4NZ+R+Uw>`_+EQjB$xU+*Qf>f{)keonqr&{pP~z z$#UV9H@|vMShLR1+4pAQ6v1v|rxiPwy|Ik)cpZJ5W!n1BGp=u6)iZCsG~>4Xa9Pvv zKQFhoowu{xUK=1` z?Yq&Zy)XFj3_jWGdD4gfa?HKP*S*NCqw5Aw*^i$I`m5O;>jfVreJyy{RJe41RT9Vj z0*?Jm?N8S}?9;Dp)i=F9<>u_~ZC^JW_@yXz`%-Gok)-PU^6e@UEktcr_?X1JKC)$P z>;_*8Khw#X(b-ztINiA}PLnvs6;i&ZI3h)U-IJp7F!Oo;T_zk+?-15}6g)xorTLtE w&tIO8rX71Zxvj}$N$Ee$wb!NVzO8QtFi1!(Xy}-5|Nevbf8WIa zX9LRJ@^o1s>K5S=z#ar+(YNbzwbOlszrgeyyRVqWTp7Me223)8`3F ze%Upp-=k?mpQ)o2ziH&eYtsxa>{M;~(#rXQTlkVJ+pfbN<}%+yHy7LpKYL`s)x-o9#eV4!W9y=j)=hdNv2St0-Qj^aKrR+{hIbu z`*am4@uF(azNP1GY-0+!`Of#4@s}ghKeAnU&Xwc!_}Dd|FBv>t{an^LB{Ts5+-Rjs literal 0 HcmV?d00001 diff --git a/apps/common/main/resources/img/toolbar/v2/1.25x/btn-user.png b/apps/common/main/resources/img/toolbar/v2/1.25x/btn-user.png new file mode 100644 index 0000000000000000000000000000000000000000..7330200bf58b2840aa3c5496779953c71034aa2e GIT binary patch literal 418 zcmeAS@N?(olHy`uVBq!ia0vp^Hb5-L!3-qb-Fj<*R7ikNh%1nGaB#SL_pXJ7#r^yD zU%h%|Zf^ek`SaJWUz?hm0tJC0FJHa{3Ia(>OG`K#q7u#pDgcTA0Z@y~)4Y|m7NP%Zb zXkzh$ISDr({Qn>9d!Q$3-q(ZGFK3;e_&93W75VrkzHGkda@l{T{kf7Xn;D>NIdkj9 z1yYNq-ZVbAnjy1uuF^g(H|4Iw5of*E$giploa5aZniRZpN9QBa8=AakDa#FRKV7#t zXZM}b3AwMOW?1M1GtaJCEG7El-wL+YW#+4%Z*Yohez$S5|7>&nZPy=Yh)-ZXx2Sie zLe!rNmuf1G?-K}q{I_V${pGjkuD-kJecH4gd*AKm_TN*>%bs_ip~R`9Re?B|(0{3gyrZ=IgpgBeCu{sbOd*`xO(Bm znVz|e_j?%H*x65(ZQ=K{V~KGWW}3wigQHoaw$Wir9< z@xqoX_c%S)b8{|zw)ZpJsW<7*?JhHiaK5!XS;AV|cCE*H=}u4fGn%t+&y85}Sb4q9e02}k8$N&HU literal 0 HcmV?d00001 diff --git a/apps/common/main/resources/img/toolbar/v2/1.5x/btn-user.png b/apps/common/main/resources/img/toolbar/v2/1.5x/btn-user.png new file mode 100644 index 0000000000000000000000000000000000000000..c6865f33f191eec73163f7e773ee71ce4dfcd0a2 GIT binary patch literal 433 zcmeAS@N?(olHy`uVBq!ia0vp^9zd+Z!3-p2S$jf&lv99Dh%1nGaB#SF>z0Lu#nY!x zpFe*NWW0Ly3P`?q@xt8P974W)`4T7y&)>TL{x6gKF;xZzMov!`$B>F!Z$oeMwJPv1iv(OK6#Vx;y#E*j=Z3xW zkL=qpVcEpBb9-uk1RUt~*340Hk2rBNd(vi>R41=<1(O!no=Z4t z@A}`fuF?6}w!>4o9fVJ=cbk>haMd0}=Qmt~A6r;h zn46owc=6)Zt5=qmmM>qv1ag6FAPEFOE|3jWQ*OhT2Gqu1666=mARwTi(9kep!h!|+ z_us#N(|PA21_nlbPZ!6Kid%25-R3)_z{8dxVpe+U;otdTWldto@85gTn?0>n=k)ZF zEhWe16dv1tXm1ej`vbGTNoKQjU(i%t`l};w^|B`?q*fY6ZEDN%DtX%|r5ww?r05Fc z)Wu>eWlSBOu5iq1X4>jF@z$c+t*(uyF7DlwQnFr0aIbi%Q@*Qc;Fq4oFK+4wzTcX` zaQ}+>9(PgRz#EI@swCN#JFkD7QTp<^lkJ)-=f4y$lnZ~wZY5s7PtOQMt~1(Y60(n1 z2}JgOnEh)~wLEWX|Ft`&FQ)xY{9Rmf`tOdvk-w_neR6xd^R)C0)*~JId)3Rn&TKu>Z5||TvqQ+Jj$oU?fx|A@ErnS$`-(`7!uP-XCR^>bP0l+XkKY*5Q; literal 0 HcmV?d00001 diff --git a/apps/common/main/resources/img/toolbar/v2/1.75x/btn-user.png b/apps/common/main/resources/img/toolbar/v2/1.75x/btn-user.png new file mode 100644 index 0000000000000000000000000000000000000000..4b01b687b038a68baf7b0d9d149f5822d4c07269 GIT binary patch literal 554 zcmeAS@N?(olHy`uVBq!ia0vp^AwaCf!3-p&=Jq%NslWiA5LY1W;NWok_U$K6o>*8| zyn6M@+}!;6^XFz}WO)-y8#WAED7=p zW)KiiP%yA{h)+l;C~at%KY#!J^XKp1fB$|tpCBs(17p6Yi(^Q|t+%1K*EK5$h-`^i z&%w3n_kZ~+q3EC>_lkF&pSKuJURXUdGxY9`kKF=`)8nQuJ2Pdn@~x8CG&^Q_j^xgp zZ%Y#7z0OR$sS&uc_2~9u3-f-q1WN`R1h4T}Jim6jm~J*o9BH5)rb1eZdMBeuW=f{+b>y$^0E1 zR+7eC)@Cq~)%tK5m(8(e-pJsSUzTt!do@!$lrwb(_q10XCDA9Z2~E`%&Al~!hVz!p zaI^Z&YtGb(rKYVlS292OUwG*=+l$Goo>i?W+VH+pE_mzpA-^EgAe}{s$W>SMAl6+qO{p*D#w~#Z40v`n6~jZ-pXIFiqU?5+p2Br e^6val{lgewsG_`q!#EfiKMbC(elF{r5}E*?>;8!V literal 0 HcmV?d00001 diff --git a/apps/common/main/resources/img/toolbar/v2/1x/btn-menu-send-to-sign.png b/apps/common/main/resources/img/toolbar/v2/1x/btn-menu-send-to-sign.png new file mode 100644 index 0000000000000000000000000000000000000000..dbafd730a3efbbeab3f3bfc2237be3bb6a79ab60 GIT binary patch literal 363 zcmeAS@N?(olHy`uVBq!ia0vp^20$#q!3-q3mHXZSDfS`=W-ng6FgG`U`SK-D9KryyfefGmAPE!%GIm^l_7-S_a7mC~FoS@A zf`WlTKtMx7fB*dX_wT=d{~_?m5uo%5PZ!6Kid%Ol-xg|C;Bg5S4cX$mkbJm7c*d{TuAtvnY8~^F#RHP+ewQ%Ly1vT)X3&?# zcV?gAo3=NsOJ-iOQunG|>!kIW>%MEg4?1<+lV4R{JvWGP y-O2vjQrsJI|D9F4cvnqy=QsP5o9F5)Chgmjz*UyXbgv%hCk9VfKbLh*2~7aGNu3`6 literal 0 HcmV?d00001 diff --git a/apps/common/main/resources/img/toolbar/v2/1x/btn-user.png b/apps/common/main/resources/img/toolbar/v2/1x/btn-user.png new file mode 100644 index 0000000000000000000000000000000000000000..3feadfdf282fd925f72ac01d4e79fa53583bba03 GIT binary patch literal 332 zcmeAS@N?(olHy`uVBq!ia0vp^20$#q!3-q3mHXZSDfzo)qf*+7!wz#x zU$q@_FY2AxE0UZ1xOJ)E0Z(t~r8=JJT&CUWUt1Ubvp2JO-74&UcS(_=Z1MkV-MJ+) zneUIzI+L*D_w2`Omw#RNP36e3$uBl?dhYmjU~g%(+ztNvGxG8A?71ud70v`Yn!(f6 K&t;ucLK6V1iIxWd literal 0 HcmV?d00001 diff --git a/apps/common/main/resources/img/toolbar/v2/2.5x/btn-menu-send-to-sign.svg b/apps/common/main/resources/img/toolbar/v2/2.5x/btn-menu-send-to-sign.svg new file mode 100644 index 0000000000..33b2898bde --- /dev/null +++ b/apps/common/main/resources/img/toolbar/v2/2.5x/btn-menu-send-to-sign.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/common/main/resources/img/toolbar/v2/2.5x/btn-user.svg b/apps/common/main/resources/img/toolbar/v2/2.5x/btn-user.svg new file mode 100644 index 0000000000..7a30953be7 --- /dev/null +++ b/apps/common/main/resources/img/toolbar/v2/2.5x/btn-user.svg @@ -0,0 +1,4 @@ + + + + diff --git a/apps/common/main/resources/img/toolbar/v2/2x/btn-menu-send-to-sign.png b/apps/common/main/resources/img/toolbar/v2/2x/btn-menu-send-to-sign.png new file mode 100644 index 0000000000000000000000000000000000000000..397fd69d26127ae8881c4af8981f7d814097646f GIT binary patch literal 533 zcmeAS@N?(olHy`uVBq!ia0vp^2|#SX!3-pCp6LGzr0fHHLR^8ggM-8U`}ZF|er#c3 z@#@tpAo=XsvzISlnwy(LxUXNohOmJoP#h=-mzt?PISpupa7mC~FoS@Afui#%N%Ln>~)oqjg2#ek<}^XwAwTTV>pe%ojBss`36%!{d7 zF@u?@^VtO6XO4oX)V%oeh7vA+ z`6?6`_TJ^Qe$d&H(S7~|i-}8g4V#*W;;BdL0KrWCClme1KHZm8Y7@~`@^Y0m;Sz;wYe!&a^0tyNS zHV*0O4Gj|}%%8vi%=P>4-|L;7A84vDZ2UhzrF2@ zil{{~+xXRet7e#=Xi1!2dTd>GM#hhzo?8qvrUw5^+SYOVP{)_J!;E)>e;n>%f7V#C zk8%C6fMZgt6f}6Gtu%MN+t#9`!6kL(qI90a^`FMK7Mq`W6!W~eA^rW%_KnBVJI>!T zZeOIe;n1(B6;+(vdh1(NrX)P_?oY`2!<&E6V&PgYh9}{g3eUpl3s!7*HLJTWo!6on zI#c|-@5(cKD$c1L_RJkhjfsk9Mhx_I(d-L6U&0ptT zuTr^W4RpvGon7^fagrSYy;~ildVu8acHuvJkIa{u_h8whpA7wma&v93ad8Fj*xcdn z-V&j$(b5q3+?LhOdW~YjlS=Ep5M zf4~Wr`9}VHcE`&#Kc~Fd#Kbk}MAWJyDqPc6{ry_8o-6F_y5rV2|Lv8Q+Q(;a{!B@@ U@;>7}VDvC}y85}Sb4q9e05F*SEdT%j literal 0 HcmV?d00001 diff --git a/apps/documenteditor/main/app/controller/FormsTab.js b/apps/documenteditor/main/app/controller/FormsTab.js index 3d127da58b..53da9e9013 100644 --- a/apps/documenteditor/main/app/controller/FormsTab.js +++ b/apps/documenteditor/main/app/controller/FormsTab.js @@ -90,6 +90,7 @@ define([ Common.NotificationCenter.on('forms:close-help', _.bind(this.closeHelpTip, this)); Common.NotificationCenter.on('forms:show-help', _.bind(this.showHelpTip, this)); Common.NotificationCenter.on('forms:request-fill', _.bind(this.requestStartFilling, this)); + Common.NotificationCenter.on('forms:show-send-for-signing', _.bind(this.showSendForSigning, this)); Common.NotificationCenter.on('document:ready', _.bind(this.onDocumentReady, this)); return this; }, @@ -724,6 +725,11 @@ define([ Common.Gateway.requestStartFilling(arr); }, + showSendForSigning: function() { + const rightmenuController = this.getApplication().getController('RightMenu'); + rightmenuController.openSendForSigning(); + }, + onActiveTab: function(tab) { (tab !== 'forms') && this.onTabCollapse(); }, diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 115d9c6e60..a9ddc906a9 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1776,7 +1776,9 @@ define([ this.appOptions.canSwitchMode = this.appOptions.isEdit; this.appOptions.canSubmitForms = this.appOptions.isRestrictedEdit && this.appOptions.canFillForms && this.appOptions.canLicense && !this.appOptions.isOffline && (typeof (this.editorConfig.customization) == 'object') && !!this.editorConfig.customization.submitForm && (typeof this.editorConfig.customization.submitForm !== 'object' || this.editorConfig.customization.submitForm.visible!==false); - this.appOptions.canStartFilling = this.editorConfig.canStartFilling && this.appOptions.isEdit && this.appOptions.isPDFForm; // show Start Filling button in the header + this.appOptions.canStartFilling = this.editorConfig.canStartFilling && this.appOptions.isEdit && this.appOptions.isPDFForm; + this.appOptions.canRequestStartFilling = this.editorConfig.canRequestStartFilling && this.appOptions.isEdit && this.appOptions.isPDFForm; + this.appOptions.showStartFillingButton = this.appOptions.canStartFilling || this.appOptions.canRequestStartFilling; // show Start Filling button in the header this.appOptions.compactHeader = this.appOptions.customization && (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compactHeader; this.appOptions.twoLevelHeader = this.appOptions.isEdit || this.appOptions.isPDFForm && this.appOptions.canFillForms && this.appOptions.isRestrictedEdit; // when compactHeader=true some buttons move to toolbar @@ -1983,8 +1985,9 @@ define([ (!inViewMode || force) && Common.NotificationCenter.trigger('doc:mode-changed', mode); }, - onStartFilling: function(disconnect) { + onStartFilling: function(disconnect, roles) { this._isFillInitiator = true; + this._rolesForFilling = roles; this.api.asc_CompletePreparingOForm(!!disconnect); !disconnect && this.onDisconnectEveryone(); // disable editing only for current user }, @@ -1999,7 +2002,7 @@ define([ }, onCompletePreparingOForm: function() { - Common.Gateway.startFilling(); + Common.Gateway.startFilling(this._rolesForFilling); }, applyModeCommonElements: function() { diff --git a/apps/documenteditor/main/app/controller/RightMenu.js b/apps/documenteditor/main/app/controller/RightMenu.js index 7412a499ab..775f38d641 100644 --- a/apps/documenteditor/main/app/controller/RightMenu.js +++ b/apps/documenteditor/main/app/controller/RightMenu.js @@ -100,6 +100,8 @@ define([ this._settings[Common.Utils.documentSettingsType.MailMerge] = {panelId: "id-mail-merge-settings", panel: rightMenu.mergeSettings, btn: rightMenu.btnMailMerge, hidden: 1, props: {}, locked: false}; this._settings[Common.Utils.documentSettingsType.Signature] = {panelId: "id-signature-settings", panel: rightMenu.signatureSettings, btn: rightMenu.btnSignature, hidden: 1, props: {}, locked: false}; this._settings[Common.Utils.documentSettingsType.Form] = {panelId: "id-form-settings", panel: rightMenu.formSettings, btn: rightMenu.btnForm, hidden: 1, props: {}, locked: false}; + // this._settings[Common.Utils.documentSettingsType.FillingStatus] = {panelId: "id-filling-status-settings", panel: rightMenu.fillingStatusSettings, btn: rightMenu.btnFillingStatus, hidden: 1, props: {}, locked: false}; + this._settings[Common.Utils.documentSettingsType.SendForSigning] = {panelId: "id-send-for-signing-settings", panel: rightMenu.sendForSigningSettings, btn: rightMenu.btnSendForSigning, hidden: 1, props: {}, locked: false}; }, setApi: function(api) { @@ -359,6 +361,8 @@ define([ this._settings[Common.Utils.documentSettingsType.Image].needShow = false; this._settings[Common.Utils.documentSettingsType.Chart].needShow = false; + + this.rightmenu.btnSendForSigning && this.rightmenu.btnSendForSigning.setDisabled(false); }, onCoAuthoringDisconnect: function() { @@ -504,6 +508,8 @@ define([ disabled && this.rightmenu.btnMailMerge.setDisabled(disabled); } this.rightmenu.chartSettings.disableControls(disabled); + this.rightmenu.fillingStatusSettings && this.rightmenu.fillingStatusSettings.disableControls(disabled); + this.rightmenu.sendForSigningSettings && this.rightmenu.sendForSigningSettings.disableControls(disabled); if (this.rightmenu.signatureSettings) { !allowSignature && this.rightmenu.btnSignature.setDisabled(disabled); @@ -519,6 +525,8 @@ define([ this.rightmenu.btnTextArt.setDisabled(disabled); this.rightmenu.btnChart.setDisabled(disabled); this.rightmenu.btnForm && this.rightmenu.btnForm.setDisabled(disabled); + this.rightmenu.btnFillingStatus && this.rightmenu.btnFillingStatus.setDisabled(disabled); + this.rightmenu.btnSendForSigning && this.rightmenu.btnSendForSigning.setDisabled(disabled); this.rightmenu.setDisabledAllMoreMenuItems(disabled); } else { var selectedElements = this.api.getSelectedElements(); @@ -610,6 +618,20 @@ define([ this.rightmenu.fireEvent('editcomplete', this.rightmenu); }, + openSendForSigning: function() { + const btnSendForSigning = this.rightmenu.btnSendForSigning; + if(!btnSendForSigning.isActive()) { + btnSendForSigning.click(); + } + }, + + closeSendForSigning: function() { + const btnSendForSigning = this.rightmenu.btnSendForSigning; + if(btnSendForSigning.isActive()) { + btnSendForSigning.click(); + } + }, + onHidePlugins: function() { Common.NotificationCenter.trigger('layout:changed', 'rightmenu'); }, diff --git a/apps/documenteditor/main/app/template/FillingStatusSettings.template b/apps/documenteditor/main/app/template/FillingStatusSettings.template new file mode 100644 index 0000000000..2f4817af45 --- /dev/null +++ b/apps/documenteditor/main/app/template/FillingStatusSettings.template @@ -0,0 +1,48 @@ + + + + + + + +
+ +
+ <% _.each(items, function(item, index) { %> +
+
+
<%= index + 1 %>
+
+
+
+
+
<%= item.name %>
+ <% if (item.status == 'done') { %> +
+ <% } %> +
+
<%= item.email %>
+ <% if (item.status == 'done') { %> + + <% } %> +
+
+ <% }) %> +
+
+
+
+
+
+
+
+
Complete
+
+
+
+
\ No newline at end of file diff --git a/apps/documenteditor/main/app/template/RightMenu.template b/apps/documenteditor/main/app/template/RightMenu.template index 90cb7c62bb..0f09cade57 100644 --- a/apps/documenteditor/main/app/template/RightMenu.template +++ b/apps/documenteditor/main/app/template/RightMenu.template @@ -10,6 +10,8 @@
+
+
\ No newline at end of file diff --git a/apps/documenteditor/main/app/template/SendForSigningSettings.template b/apps/documenteditor/main/app/template/SendForSigningSettings.template new file mode 100644 index 0000000000..429a71faf1 --- /dev/null +++ b/apps/documenteditor/main/app/template/SendForSigningSettings.template @@ -0,0 +1,22 @@ + + + + +
+
+
+ + +
+
+
+
+
+
+
+ +
+
\ No newline at end of file diff --git a/apps/documenteditor/main/app/view/FillingStatusSettings.js b/apps/documenteditor/main/app/view/FillingStatusSettings.js new file mode 100644 index 0000000000..39712be187 --- /dev/null +++ b/apps/documenteditor/main/app/view/FillingStatusSettings.js @@ -0,0 +1,107 @@ +/* + * (c) Copyright Ascensio System SIA 2010-2024 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish + * street, Riga, Latvia, EU, LV-1050. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * + */ +/** + * FillingStatusSettings.js + * + * Created on 10.03.2026 + * + */ + +define([ + 'text!documenteditor/main/app/template/FillingStatusSettings.template', + 'jquery', + 'underscore', + 'backbone', + 'common/main/lib/component/Button' +], function (menuTemplate, $, _, Backbone) { + 'use strict'; + + DE.Views.FillingStatusSettings = Backbone.View.extend(_.extend({ + el: '#id-filling-status-settings', + + // Compile our stats template + template: _.template(menuTemplate), + + // Delegated events for creating new items, and clearing completed ones. + events: { + }, + + options: { + alias: 'FillingStatusSettings' + }, + + initialize: function () { + this._state = {}; + this._locked = false; + + this.render(); + }, + + render: function () { + const items = [ + { email: 'user333@gmail.com', name: 'Anyone', date: '1/20/2026 9:00 PM', status: 'done' }, + { email: 'test@yandex.ru', name: 'User1', date: null, status: 'done' }, + { email: 'test@yandex.ru', name: 'User2', date: null, status: 'done' } + ]; + const el = this.$el || $(this.el); + el.html(this.template({ + scope: this, + items: items, + isAllDone: items.every(function(item) { return item.status == 'done'}) + })); + }, + + setApi: function(api) { + this.api = api; + return this; + }, + + ChangeSettings: function(props) { + + }, + + setLocked: function (locked) { + this._locked = locked; + }, + + setMode: function(mode) { + this.mode = mode; + }, + + disableControls: function(disable) { + + }, + + txtTitle: 'Filling status', + + }, DE.Views.FillingStatusSettings || {})); +}); \ No newline at end of file diff --git a/apps/documenteditor/main/app/view/RightMenu.js b/apps/documenteditor/main/app/view/RightMenu.js index 182a489d41..538cb81a99 100644 --- a/apps/documenteditor/main/app/view/RightMenu.js +++ b/apps/documenteditor/main/app/view/RightMenu.js @@ -39,6 +39,7 @@ var SCALE_MIN = 40; var MENU_SCALE_PART = 260; var MENU_BASE_WIDTH = 220; +// var MENU_BASE_WIDTH = 360; define([ 'text!documenteditor/main/app/template/RightMenu.template', @@ -59,6 +60,8 @@ define([ 'documenteditor/main/app/view/TextArtSettings', 'documenteditor/main/app/view/SignatureSettings', 'documenteditor/main/app/view/FormSettings', + 'documenteditor/main/app/view/FillingStatusSettings', + 'documenteditor/main/app/view/SendForSigningSettings', 'common/main/lib/component/Scroller', 'common/main/lib/component/ListView', ], function (menuTemplate, $, _, Backbone) { @@ -253,6 +256,39 @@ define([ this.formSettings = new DE.Views.FormSettings(); } + if (false) { + this.btnFillingStatus = new Common.UI.Button({ + hint: this.txtFormSettings, + asctype: Common.Utils.documentSettingsType.FillingStatus, + enableToggle: true, + disabled: true, + iconCls: 'btn-field', + toggleGroup: 'tabpanelbtnsGroup', + allowMouseEventsOnDisabled: true + }); + this._settings[Common.Utils.documentSettingsType.FillingStatus] = {panel: "id-filling-status-settings", btn: this.btnFillingStatus}; + this.btnFillingStatus.setElement($markup.findById('#id-right-menu-filling-status'), false); + this.btnFillingStatus.render().setVisible(true); + this.btnFillingStatus.on('click', this.onBtnMenuClick.bind(this)); + this.fillingStatusSettings = new DE.Views.FillingStatusSettings(); + } + + if (!mode.canRequestStartFilling) { + this.btnSendForSigning = new Common.UI.Button({ + hint: this.txtSendForSigning, + asctype: Common.Utils.documentSettingsType.SendForSigning, + enableToggle: true, + disabled: false, + iconCls: 'btn-field', + toggleGroup: 'tabpanelbtnsGroup', + allowMouseEventsOnDisabled: true + }); + this._settings[Common.Utils.documentSettingsType.SendForSigning] = {panel: "id-send-for-signing-settings", btn: this.btnSendForSigning}; + this.btnSendForSigning.setElement($markup.findById('#id-right-menu-send-for-signing'), false); + this.btnSendForSigning.render().setVisible(true); + this.btnSendForSigning.on('click', this.onBtnMenuClick.bind(this)); + this.sendForSigningSettings = new DE.Views.SendForSigningSettings(); + } if (_.isUndefined(this.scroller)) { this.scroller = new Common.UI.Scroller({ @@ -289,6 +325,8 @@ define([ if (this.mergeSettings) this.mergeSettings.setApi(api).on('editcomplete', _fire_editcomplete); if (this.signatureSettings) this.signatureSettings.setApi(api).on('editcomplete', _fire_editcomplete); if (this.formSettings) this.formSettings.setApi(api).on('editcomplete', _fire_editcomplete).on('updatescroller', _updateScroller); + if (this.fillingStatusSettings) this.fillingStatusSettings.setApi(api).on('editcomplete', _fire_editcomplete).on('updatescroller', _updateScroller); + if (this.sendForSigningSettings) this.sendForSigningSettings.setApi(api).on('editcomplete', _fire_editcomplete).on('updatescroller', _updateScroller); }, setMode: function(mode) { @@ -300,6 +338,8 @@ define([ this.chartSettings && this.chartSettings.setMode(mode); // this.headerSettings && this.headerSettings.setMode(mode); this.signatureSettings && this.signatureSettings.setMode(mode); + this.fillingStatusSettings && this.fillingStatusSettings.setMode(mode); + this.sendForSigningSettings && this.sendForSigningSettings.setMode(mode); }, onBtnMenuClick: function(btn, e) { @@ -402,7 +442,7 @@ define([ setButtons: function () { var allButtons = [this.btnText, this.btnTable, this.btnImage, this.btnShape, this.btnChart, this.btnTextArt, - this.btnMailMerge, this.btnSignature, this.btnForm]; + this.btnMailMerge, this.btnSignature, this.btnForm, this.btnFillingStatus, this.btnSendForSigning]; Common.UI.SideMenu.prototype.setButtons.apply(this, [allButtons]); }, @@ -434,6 +474,7 @@ define([ txtMailMergeSettings: 'Mail Merge Settings', txtSignatureSettings: 'Signature Settings', txtFormSettings: 'Form Settings', + txtSendForSigning: 'Send for signing', ariaRightMenu: 'Right menu' }, DE.Views.RightMenu || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/main/app/view/SendForSigningSettings.js b/apps/documenteditor/main/app/view/SendForSigningSettings.js new file mode 100644 index 0000000000..83509afbfd --- /dev/null +++ b/apps/documenteditor/main/app/view/SendForSigningSettings.js @@ -0,0 +1,302 @@ +/* + * (c) Copyright Ascensio System SIA 2010-2024 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish + * street, Riga, Latvia, EU, LV-1050. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * + */ +/** + * SendForSigningSettings.js + * + * Created on 10.03.2026 + * + */ + +define([ + 'text!documenteditor/main/app/template/SendForSigningSettings.template', + 'jquery', + 'underscore', + 'backbone', + 'common/main/lib/component/Button' +], function (menuTemplate, $, _, Backbone) { + 'use strict'; + + DE.Views.SendForSigningSettings = Backbone.View.extend(_.extend({ + el: '#id-send-for-signing-settings', + + // Compile our stats template + template: _.template(menuTemplate), + + // Delegated events for creating new items, and clearing completed ones. + events: { + }, + + options: { + alias: 'SendForSigningSettings' + }, + + initialize: function (options) { + this._initSettings = true; + this._state = { + isUsersListLoading: false + }; + this._locked = false; + + this.users = []; + this.render(); + + + // TODO: if (config.canRequestUsers)??? + this._state.isUsersListLoading = true; + Common.UI.ExternalUsers.get('filler'); + Common.NotificationCenter.on('mentions:setusers', _.bind(this.onUsersListLoad, this)); + }, + + render: function () { + const el = this.$el || $(this.el); + el.html(this.template({ + scope: this + })); + }, + + createDelayedElements: function() { + this._initSettings = false; + const me = this; + const $markup = this.$el || $(this.el); + + this._updateRolesListHeight(); + this.scrollerOptions = { + el: $markup.find('#id-send-for-signing-settings-roles-list'), + wheelSpeed: 8, + alwaysVisibleY: true + }; + this.scroller = new Common.UI.Scroller(this.scrollerOptions); + + this.sendBtn = new Common.UI.Button({ + el: $markup.find('#id-send-for-signing-settings-send-btn'), + disabled: true + }); + this.sendBtn.on('click', _.bind(this.onSend, this)); + + this.cancelBtn = $markup.find('#id-send-for-signing-settings-cancel-btn'); + this.cancelBtn.on('click', _.bind(this.onCancel, this)); + + const oForm = this.api.asc_GetOForm(); + this.rolesCollection = new Backbone.Collection(); + this.rolesCollection.on('reset', function(newCollection, details) { + me._renderRolesList(); + }, this); + this.setRoles(oForm ? oForm.asc_getAllRoles() : []); + + $(window).on('resize', _.bind(this.onWindowResize, this)); + }, + + setApi: function(api) { + this.api = api; + if (this.api) { + this.api.asc_registerCallback('asc_onUpdateOFormRoles', _.bind(this.onRefreshRolesList, this)); + } + return this; + }, + + ChangeSettings: function(props) { + if (this._initSettings) { + this.createDelayedElements(); + } + }, + + setLocked: function (locked) { + this._locked = locked; + }, + + setMode: function(mode) { + this.mode = mode; + }, + + disableControls: function(disable) { + + }, + + updateDisableSendButton: function() { + const hasEmptyUser = this.rolesCollection.some(function(role) { + return !role.get('user'); + }); + this.sendBtn.setDisabled(hasEmptyUser); + }, + + setRoles: function(roles) { + const oldArray = this.rolesCollection.toJSON(); + const oldMap = {}; + const newArray = (roles).map(function(role) { + role = role.asc_getSettings(); + let color = role.asc_getColor(); + color && (color = Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b())); + return { + name: role.asc_getName(), + color: color, + user: null + } + }); + + oldArray.forEach(function(item) { + oldMap[item.name] = item; + }); + + // Arrays are merged by 'name', only the `user` field is carried over from the old array + const resultArray = newArray.map(function(item) { + if (oldMap.hasOwnProperty(item.name)) { + item.user = oldMap[item.name].user; + } + return item; + }); + + this.rolesCollection.reset(resultArray); + }, + + onUsersListLoad: function(type, users, isPaginated) { + if (this._state.isUsersListLoading && type!=='filler') return; + + this._state.isUsersListLoading = false; + this.users = (users || []).map(function(user) { + return { + id: user.id, + name: user.name, + email: user.email, + image: user.image, + initials: Common.Utils.getUserInitials(user.name) + } + }); + }, + + onSend: function() { + const roles = this.rolesCollection.map(function(role) { + return { + name: role.get('name'), + color: role.get('color'), + user: role.get('user') + } + }); + DE.getController('Main').onStartFilling(true, roles); + }, + + onCancel: function() { + // TODO: Move this out of the component by emitting an event + const rightmenuController = DE.getController('RightMenu'); + rightmenuController.closeSendForSigning(); + }, + + onRefreshRolesList: function(roles) { + if (this._initSettings) return; + this.setRoles(roles); + }, + + onWindowResize: function() { + this._updateRolesListHeight(); + this.scroller.update(this.scrollerOptions); + }, + + _renderRolesList: function() { + const me = this; + const userCmbOptions = this.users.map(function(user) { + return Object.assign({value: user.id, displayValue: user.name || user.email}, user); + }); + + this.$el.find('#id-send-for-signing-settings-roles-list').empty(); + this.rolesCollection.each(function(role, index) { + const $item = $( + '
' + + '
' + + '
' + + (index + 1) + + '
' + + '
' + + '
' + + '
' + + '
' + role.get('name') + '
' + + '
' + + '
' + + '
' + ); + const user = role.get('user'); + const cmb = new Common.UI.ComboBox({ + el: $item.find('.role-item-user-cmb'), + cls: 'input-group-nr', + menuCls: 'role-item-user-cmb-menu', + restoreMenuHeightAndTop: true, + editable: false, + data: userCmbOptions, + placeHolder: me.txtSelectUser, + itemTemplate: _.template( + '
  • ' + + '' + + '<% if(image) { %>' + + '
    ' + + '<% } else { %>' + + '
    ' + + ' ' + + '
    ' + + '<% } %>' + + '
    ' + + '
    <%= name %>
    ' + + '' + + '
    ' + + '
    ' + + '
  • ' + ) + }); + (user && user.id) && cmb.setValue(user.id); + cmb.on('selected', function(combo, record) { + role.set('user', { + id: record.id, + name: record.name, + email: record.email, + image: record.image + }); + me.updateDisableSendButton(); + }); + me.$el.find('#id-send-for-signing-settings-roles-list').append($item); + }); + this.updateDisableSendButton(); + this.scroller.update(this.scrollerOptions); + }, + + _updateRolesListHeight: function() { + const $markup = this.$el || $(this.el); + const $listWrapper = $markup.find('.roles-list-wrapper'); + const height = $listWrapper.height(); + + $markup.find('#id-send-for-signing-settings-roles-list').height(height); + }, + + txtTitle: 'Send for signing', + txtDescription: 'Please check the order of filling before sending.', + txtSelectUser: 'Select user', + txtSend: 'Send', + txtCancel: 'Cancel', + + }, DE.Views.SendForSigningSettings || {})); +}); \ No newline at end of file diff --git a/apps/documenteditor/main/resources/less/rightmenu.less b/apps/documenteditor/main/resources/less/rightmenu.less index 385bbbe0aa..22ec97396f 100644 --- a/apps/documenteditor/main/resources/less/rightmenu.less +++ b/apps/documenteditor/main/resources/less/rightmenu.less @@ -228,6 +228,337 @@ .margin-right-2(); } } + + &#id-filling-status-settings { + .progress-item { + display: flex; + margin-bottom: 4px; + + .progress-item-left { + display: flex; + flex-direction: column; + align-items: center; + .margin-right(12px); + + .progress-item-number { + opacity: 0.4; + min-width: 24px; + min-height: 24px; + margin-bottom: 4px; + display: flex; + align-items: center; + justify-content: center; + border-radius: 100%; + border: @scaled-one-px-value-ie solid @text-normal-ie; + border: @scaled-one-px-value solid @text-normal; + color: @text-normal-ie; + color: @text-normal; + } + + .progress-item-dashes { + opacity: 0.4; + width: @scaled-one-px-value-ie; + width: @scaled-one-px-value; + height: 100%; + background: repeating-linear-gradient( + to bottom, + @text-normal-ie 0px, + @text-normal-ie 3px, + transparent 3px, + transparent 6px + ); + background: repeating-linear-gradient( + to bottom, + @text-normal 0px, + @text-normal 3px, + transparent 3px, + transparent 6px + ); + } + } + + .progress-item-content { + flex: 1; + color: @text-normal-ie; + color: @text-normal; + min-height: 43px; + + .progress-item-header { + display: flex; + align-items: center; + + .progress-item-label { + line-height: 24px; + font-weight: 600; + .margin-right(4px); + } + } + } + + .progress-item-footer { + display: flex; + align-items: center; + justify-content: space-between; + + .progress-item-date { + color: @text-secondary-ie; + color: @text-secondary; + } + } + + .progress-item-check { + display: block; + + position: relative; + width: 24px; + height: 24px; + + &::before, + &::after { + content: ""; + position: absolute; + background: #009900; + // border-radius: 2px; + } + + &::before { + width: 4px; + height: 2px; + left: 7px; + top: 12px; + transform: rotate(45deg); + } + + &::after { + width: 10px; + height: 2px; + left: 9px; + top: 11px; + transform: rotate(-45deg); + } + } + + &.active { + .progress-item-number { + opacity: 1 !important; + border-color: @background-accent-button-ie !important; + border-color: @background-accent-button !important; + } + .progress-item-label { + color: @border-fill-input-focused-ie !important; + color: @border-fill-input-focused !important; + } + } + + &.complete { + &:not(.all-done) { + opacity: 0.4; + } + + .progress-item-number { + opacity: 1 !important; + border-color: #009900 !important; + } + .progress-item-content { + min-height: auto !important; + } + } + } + } + + &#id-send-for-signing-settings { + padding: 0; + &, table { + height: 100%; + } + + .content-padding { + padding: @layout-padding-right-panel-content-ie; + padding: @layout-padding-right-panel-content; + + .rtl & { + padding: @layout-padding-right-panel-content-rtl-ie; + padding: @layout-padding-right-panel-content-rtl; + } + } + + .inner { + height: 100%; + display: flex; + flex-direction: column; + justify-content: space-between; + flex: 1; + + .content { + display: flex; + flex-direction: column; + flex: 1; + } + + .footer { + padding: 12px 0; + display: flex; + justify-content: center; + + #id-send-for-signing-settings-send-btn { + .margin-right(10px); + } + } + + .description { + color: @text-secondary-ie; + color: @text-secondary; + } + + .roles-list-wrapper { + flex: 1; + position: relative; + } + + #id-send-for-signing-settings-roles-list { + width: 100%; + position: absolute; + overflow: hidden; + padding-top: 0; + + .role-item { + display: flex; + margin-bottom: 4px; + + .role-item-left { + display: flex; + flex-direction: column; + align-items: center; + .margin-right(12px); + + .role-item-number { + min-width: 24px; + min-height: 24px; + margin-bottom: 4px; + display: flex; + align-items: center; + justify-content: center; + border-radius: 100%; + border: @scaled-one-px-value-ie solid rgba(0, 0, 0, 0.15); + border: @scaled-one-px-value solid rgba(0, 0, 0, 0.15); + color: #000000CC; + } + + .role-item-dashes { + opacity: 0.4; + width: @scaled-one-px-value-ie; + width: @scaled-one-px-value; + height: 100%; + background: repeating-linear-gradient( + to bottom, + @text-normal-ie 0px, + @text-normal-ie 3px, + transparent 3px, + transparent 6px + ); + background: repeating-linear-gradient( + to bottom, + @text-normal 0px, + @text-normal 3px, + transparent 3px, + transparent 6px + ); + } + } + + .role-item-content { + .role-item-user-cmb { + margin-bottom: 8px; + } + .role-item-user-cmb-menu { + width: 196px; + left: -36px; + .rtl & { + left: unset; + right: -36px; + } + + .item { + a { + display: flex; + padding: 5px 7px; + + .avatar { + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + width: 24px; + height: 24px; + border-radius: 24px; + background-color: @border-divider-ie; + background-color: @border-divider; + // color: @toolbar-header-text-on-background-ie; + // color: @toolbar-header-text-on-background; + vertical-align: middle; + background-size: cover; + background-position: center; + font-size: 10px; + line-height: 24px; + overflow: hidden; + text-align: center; + .margin-right(4px); + + .icon { + display: block; + width: @x-small-btn-icon-size-ie; + width: @x-small-btn-icon-size; + height: @x-small-btn-icon-size-ie; + height: @x-small-btn-icon-size; + } + } + + .content { + min-width: 0; + & > * { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + .email { + color: @text-secondary-ie; + color: @text-secondary; + } + } + } + } + } + } + + &.last { + .role-item-dashes { + display: none; + } + } + + .role-item-content { + flex: 1; + color: @text-normal-ie; + color: @text-normal; + min-width: 0; + + .role-item-label { + line-height: 24px; + font-weight: 600; + + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + .role-item-user-cmb { + height: 24px; + } + } + } + } + } + } } .ie {