Files
tuend-work 4478491d73 z
2025-11-13 07:41:56 +07:00

1 line
11 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[151],{1825:function(t,e,n){"use strict";n.r(e);var a=n(3933),o=n(2588);for(var i in o)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(i);var r=n(0),s=n(3605),c=n.n(s),l=Object(r.a)(o.default,a.a,a.b,!1,null,null,null);"function"==typeof c.a&&c()(l),e.default=l.exports},2021:function(t,e,n){"use strict";var a=n(1);Object.defineProperty(e,"__esModule",{value:!0}),e.validateVacationAccount=e.getVacation=e.deleteVacations=e.modifyVacation=e.createVacation=e.getVacationDefaults=e.getVacations=void 0;var o=a(n(20));n(17);var i=a(n(78)),r=function(t){return t.mapProps({custom_reply_headers:t.isEqual("1"),reply_content_types:t.toSelect,reply_encodings:t.toSelect,reply_once_select:t.toSelect})},s=i.default.get({id:"VACATIONS",url:"/CMD_EMAIL_VACATION",domain:!0,pagination:!0,after:function(t){return t.flow((function(t){return{rows:t}}),t.processTableInfo("rows"),t.mapProp("rows",t.flow(t.toArray,t.mapArray(t.flow(t.project({user:"user",start:"time.start_timestamp",end:"time.end_timestamp"}),t.mapProps({start:t.convert.toAppDate,end:t.convert.toAppDate}))))))}});e.getVacations=s;var c=i.default.get({id:"VACATION_DEFAULTS",url:"/CMD_EMAIL_VACATION_CREATE",domain:!0,after:function(t){return t.flow(t.mapProps({ENDDAY:t.toSelect,ENDMONTH:t.toSelect,ENDYEAR:t.toSelect,ENDTIME:t.toSelect,STARTDAY:t.toSelect,STARTMONTH:t.toSelect,STARTYEAR:t.toSelect,STARTTIME:t.toSelect,poplist:t.toSelect}),t.moveProp({ENDDAY:"end.day",ENDMONTH:"end.month",ENDYEAR:"end.year",ENDTIME:"end.time",STARTDAY:"start.day",STARTMONTH:"start.month",STARTYEAR:"start.year",STARTTIME:"start.time"}),t.mapProps({end:function(t){return{time:t.time,date:new Date(t.year.value,Number(t.month.value)-1,t.day.value)}},start:function(t){return{time:t.time,date:new Date(t.year.value,Number(t.month.value)-1,t.day.value)}},headers:r(t)}))}});e.getVacationDefaults=c;var l=i.default.post({url:"/CMD_EMAIL_VACATION",params:{action:"create"},domain:!0,schema:{user:i.default.REQUIRED_STRING,starttime:i.default.REQUIRED_STRING,startday:i.default.REQUIRED_STRING,startmonth:i.default.REQUIRED_STRING,startyear:i.default.REQUIRED_STRING,endtime:i.default.REQUIRED_STRING,endday:i.default.REQUIRED_STRING,endmonth:i.default.REQUIRED_STRING,endyear:i.default.REQUIRED_STRING}});e.createVacation=l;var u=l.extend({params:{action:"modify"}});e.modifyVacation=u;var d=i.default.select({url:"/CMD_EMAIL_VACATION",params:{action:"delete",delete:!0},domain:!0});e.deleteVacations=d;var p=i.default.get({id:"VACATION",url:"/CMD_EMAIL_VACATION_MODIFY",domain:!0,schema:{user:i.default.REQUIRED_STRING},after:function(t){return t.flow(t.mapProps({ENDDAY:t.toSelect,ENDMONTH:t.toSelect,ENDYEAR:t.toSelect,ENDTIME:t.toSelect,STARTDAY:t.toSelect,STARTMONTH:t.toSelect,STARTYEAR:t.toSelect,STARTTIME:t.toSelect}),t.moveProp({ENDDAY:"end.day",ENDMONTH:"end.month",ENDYEAR:"end.year",ENDTIME:"end.time",STARTDAY:"start.day",STARTMONTH:"start.month",STARTYEAR:"start.year",STARTTIME:"start.time"}),t.mapProps({end:function(t){return{time:t.time,date:new Date(t.year.value,Number(t.month.value)-1,t.day.value)}},start:function(t){return{time:t.time,date:new Date(t.year.value,Number(t.month.value)-1,t.day.value)}},text:t.convert.toAppText,headers:r(t)}))}});e.getVacation=p;var f=i.default.get({id:"VACATION_VALIDATION",domain:!0,url:"/CMD_EMAIL_VACATION",schema:{user:i.default.REQUIRED_STRING},before:function(t){return{user:null,comparison1:"equals",value1:t.user}},response:!1,mapResponse:function(t){return"object"!==(0,o.default)(t[0])}});e.validateVacationAccount=f},2588:function(t,e,n){"use strict";n.r(e);var a=n(2589),o=n.n(a);for(var i in a)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(i);e.default=o.a},2589:function(t,e,n){"use strict";n(7),n(10),n(5),n(6),n(8),n(11);var a=n(1);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=a(n(36)),i=a(n(37)),r=a(n(2));n(49);var s=n(2021),c=a(n(712)),l=a(n(2585));function u(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function d(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?u(Object(n),!0).forEach((function(e){(0,r.default)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var p,f={preload:s.getVacation,api:[{command:s.getVacation,bind:"vacation"}],components:{"input-date":l.default},props:{user:{type:String,required:!0}},data:function(){return{text:"",start:new Date,starttime:"",end:new Date,endtime:"",subjectPrefix:"",contentType:"",encoding:"",onceSelect:""}},created:function(){var t=this;Object.assign(this.$data,{text:this.$api.vacation.text,start:this.$api.vacation.start.date,end:this.$api.vacation.end.date,starttime:this.$api.vacation.start.time.value,endtime:this.$api.vacation.end.time.value}),this.$api.vacation.headers&&this.$api.vacation.headers.custom_reply_headers&&(this.contentType=this.$api.vacation.headers.reply_content_types.value,this.encoding=this.$api.vacation.headers.reply_encodings.value,this.onceSelect=this.$api.vacation.headers.reply_once_select.value,this.subjectPrefix=this.$api.vacation.headers.subject_prefix),this.$watch("start",(function(e){e>t.end&&(t.end=e)}));var e=function(t,e){var n=function(t){return{morning:1,afternoon:2,evening:3}[t]};return n(t)>n(e)};this.$watch("starttime",(function(n){t.start.getTime()===t.end.getTime()&&e(n,t.endtime)&&(t.endtime=n)})),this.$watch("endtime",(function(n){t.start.getTime()===t.end.getTime()&&e(t.starttime,n)&&(t.starttime=n)}))},methods:{toAPIDate:function(t){var e,n=this[t];return e={},(0,r.default)(e,"".concat(t,"time"),this["".concat(t,"time")]),(0,r.default)(e,"".concat(t,"day"),(0,c.default)(n,"dd",{awareOfUnicodeTokens:!0})),(0,r.default)(e,"".concat(t,"month"),(0,c.default)(n,"MM")),(0,r.default)(e,"".concat(t,"year"),(0,c.default)(n,"yyyy",{awareOfUnicodeTokens:!0})),e},requestData:function(){var t=d(d({user:this.user,text:this.text},this.toAPIDate("start")),this.toAPIDate("end"));return this.$api.vacation.headers&&this.$api.vacation.headers.custom_reply_headers&&(t.subject=this.subjectPrefix,t.reply_encoding=this.encoding,t.reply_content_type=this.contentType,t.reply_once_time=this.onceSelect),t},modifyVacation:(p=(0,i.default)(o.default.mark((function t(){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,s.modifyVacation)(this.requestData());case 2:if(!t.sent){t.next=7;break}return t.next=6,(0,s.getVacations)();case 6:this.$router.push({name:"user/email/vacations"});case 7:case"end":return t.stop()}}),t,this)}))),function(){return p.apply(this,arguments)})}};e.default=f},3605:function(t,e){},3933:function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return o}));var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("app-page",[n("app-page-section",[n("ui-form-element",[n("translate",{attrs:{slot:"title"},slot:"title"},[t._v("\n Vacation Account:\n ")]),t._v(" "),n("input-text",{attrs:{slot:"content",disabled:"",value:t.user+"@"+t.$domainUnicode},slot:"content"})],1),t._v(" "),t.contentType?[n("ui-form-element",[n("translate",{attrs:{slot:"title"},slot:"title"},[t._v("\n Subject Prefix\n ")]),t._v(" "),n("input-text",{attrs:{slot:"content",suffix:t.$gettext(": original subject")},slot:"content",model:{value:t.subjectPrefix,callback:function(e){t.subjectPrefix=e},expression:"subjectPrefix"}})],1),t._v(" "),n("ui-form-element",[n("translate",{attrs:{slot:"title"},slot:"title"},[t._v("\n Reply Encoding\n ")]),t._v(" "),n("input-select",{attrs:{slot:"content",options:t.$api.vacation.headers.reply_encodings.options},slot:"content",model:{value:t.encoding,callback:function(e){t.encoding=e},expression:"encoding"}})],1),t._v(" "),n("ui-form-element",[n("translate",{attrs:{slot:"title"},slot:"title"},[t._v("\n Content-Type\n ")]),t._v(" "),n("input-select",{attrs:{slot:"content",options:t.$api.vacation.headers.reply_content_types.options},slot:"content",model:{value:t.contentType,callback:function(e){t.contentType=e},expression:"contentType"}})],1),t._v(" "),n("ui-form-element",[n("translate",{attrs:{slot:"title"},slot:"title"},[t._v("\n Reply Frequency\n ")]),t._v(" "),n("translate",{attrs:{slot:"tooltip"},slot:"tooltip"},[t._v("\n Minimum time before a repeated reply\n ")]),t._v(" "),n("input-select",{attrs:{slot:"content",options:t.$api.vacation.headers.reply_once_select.options},slot:"content",model:{value:t.onceSelect,callback:function(e){t.onceSelect=e},expression:"onceSelect"}})],1)]:t._e(),t._v(" "),n("ui-form-element",[n("translate",{attrs:{slot:"title"},slot:"title"},[t._v("\n Vacation Start\n ")]),t._v(" "),n("input-date",{attrs:{slot:"content"},slot:"content",model:{value:t.start,callback:function(e){t.start=e},expression:"start"}},[n("input-select",{style:{minWidth:"12rem"},attrs:{slot:"additions:left",options:t.$api.vacation.start.time.options,novalidate:""},nativeOn:{focusin:function(t){t.stopPropagation()}},slot:"additions:left",model:{value:t.starttime,callback:function(e){t.starttime=e},expression:"starttime"}})],1)],1),t._v(" "),n("ui-form-element",{attrs:{group:"vacation"}},[n("translate",{attrs:{slot:"title"},slot:"title"},[t._v("\n Vacation End\n ")]),t._v(" "),n("input-date",{attrs:{slot:"content",min:t.start},slot:"content",model:{value:t.end,callback:function(e){t.end=e},expression:"end"}},[n("input-select",{style:{minWidth:"12rem"},attrs:{slot:"additions:left",options:t.$api.vacation.end.time.options,novalidate:""},nativeOn:{focusin:function(t){t.stopPropagation()}},slot:"additions:left",model:{value:t.endtime,callback:function(e){t.endtime=e},expression:"endtime"}})],1)],1),t._v(" "),n("ui-form-element",{attrs:{group:"vacation",validators:{required:!0}}},[n("translate",{attrs:{slot:"title"},slot:"title"},[t._v("\n Vacation Message:\n ")]),t._v(" "),n("input-textarea",{attrs:{slot:"content"},slot:"content",model:{value:t.text,callback:function(e){t.text=e},expression:"text"}})],1),t._v(" "),n("ui-form-element",[n("translate",{attrs:{slot:"title"},slot:"title"},[t._v("\n Current Server Time:\n ")]),t._v(" "),n("template",{slot:"content"},[t._v("\n "+t._s(t.$api.vacation.servertime)+"\n ")])],2)],2),t._v(" "),n("ui-button",{attrs:{slot:"footer:buttons",theme:"primary",disabled:!t.$valid("vacation")},on:{click:t.modifyVacation},slot:"footer:buttons"},[n("translate",[t._v("Modify")])],1)],1)},o=[]}}]);