Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/ts.corals.io/frontend/dist/_nuxt/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/ts.corals.io/frontend/dist/_nuxt/0983f39.js
(window.webpackJsonp=window.webpackJsonp||[]).push([[24,3,10],{292:function(t,e,r){"use strict";r.r(e);r(33),r(47),r(44),r(18),r(116);var n={name:"CoralsTextarea",props:{form:{type:Object,required:!0},label:{type:[String,Boolean],default:"",required:!1},field:{type:String,required:!0},required:{type:Boolean,default:!1}},computed:{hasValueAttr:function(){return void 0!==this.$attrs.value},labelValue:function(){if(!1===this.label)return"";if(this.label)return this.label;var label=this.field.replace("_"," ");return label.charAt(0).toUpperCase()+label.slice(1)},idValue:function(){return this.$attrs.id?this.$attrs.id:this.field},fieldDescription:function(){return this.$attrs.description||""}}},o=r(88),component=Object(o.a)(n,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("b-form-group",{attrs:{"invalid-feedback":t.form.error(t.field),label:t.labelValue,"label-for":t.idValue,"label-class":t.required?"required-field":"",description:t.fieldDescription,state:t.form.state(t.field)}},[t.hasValueAttr?r("b-form-textarea",t._b({attrs:{id:t.idValue,state:t.form.state(t.field)},on:{input:function(e){return t.$emit("input",e)}}},"b-form-textarea",t.$attrs,!1)):r("b-form-textarea",t._b({attrs:{id:t.idValue,state:t.form.state(t.field)},on:{input:function(e){return t.$emit("input",e)}},model:{value:t.form[t.field],callback:function(e){t.$set(t.form,t.field,"string"==typeof e?e.trim():e)},expression:"form[field]"}},"b-form-textarea",t.$attrs,!1))],1)}),[],!1,null,"26d350b3",null);e.default=component.exports},295:function(t,e,r){"use strict";r.r(e);var n=r(55),o=(r(33),r(47),r(44),r(18),r(116),{name:"CoralsSelect",props:{form:{type:Object,required:!0},label:{type:[String,Boolean],default:"",required:!1},type:{type:String,default:"text"},field:{type:String,required:!0},options:{required:!0},required:{type:Boolean,default:!1}},computed:{getOptions:function(){var t=[];for(var e in this.options)"object"==Object(n.a)(this.options[e])&&this.options[e].hasOwnProperty("label")||Array.isArray(this.options)?t.push(this.options[e]):t.push({value:e,label:this.options[e]});return t},labelValue:function(){if(!1===this.label)return"";if(this.label)return this.label;var label=this.field.replace("_"," ");return label.charAt(0).toUpperCase()+label.slice(1)},idValue:function(){return this.$attrs.id?this.$attrs.id:this.field},fieldDescription:function(){return this.$attrs.description||""},isMultiple:function(){return!!this.$attrs.multiple}}}),l=(r(729),r(88)),component=Object(l.a)(o,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("b-form-group",{attrs:{"invalid-feedback":t.form.error(t.field),label:t.labelValue,"label-for":t.idValue,"label-class":{"required-field":t.required},description:t.fieldDescription,state:t.form.state(t.field)}},[r("v-select",t._b({attrs:{id:t.idValue,options:t.getOptions,reduce:function(t){return t.value},placeholder:"Select "+t.labelValue,selectable:function(option){return!option.hasOwnProperty("notSelectable")}},on:{input:function(e){return t.$emit("input",e)}},scopedSlots:t._u([{key:"selected-option",fn:function(e){var label=e.label,n=e.group_label;return[r("div",{staticClass:"selected-option"},[r("div",{staticClass:"selected-option-group"},[n?r("span",{staticClass:"selected-group",class:t.isMultiple?"multi":""},[t._v("\n            "+t._s(n)+"\n          ")]):t._e(),t._v(" "),r("span",{class:{"has-group":n}},[t._v("\n            "+t._s(label)+"\n          ")])])])]}},{key:"option",fn:function(e){e.group;var label=e.label,n=e.is_group_empty,o=e.notSelectable,l=e.empty_group_message;return[r("div",{class:{"font-weight-bold text-dark":o}},[t._v("\n        "+t._s(label)+"\n      ")]),t._v(" "),n?r("div",[t._v("\n        "+t._s(l)+"\n      ")]):t._e()]}}]),model:{value:t.form[t.field],callback:function(e){t.$set(t.form,t.field,e)},expression:"form[field]"}},"v-select",t.$attrs,!1))],1)}),[],!1,null,null,null);e.default=component.exports},719:function(t,e,r){"use strict";var n={name:"COverlay",props:{show:{default:!1,type:Boolean}}},o=r(88),component=Object(o.a)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("b-overlay",{attrs:{show:t.show,rounded:"sm","spinner-variant":"primary",variant:"transparent",blur:"1px"}},[t._t("default")],2)}),[],!1,null,"5a577948",null);e.a=component.exports},726:function(t,e,r){"use strict";var n=r(55);r(53);e.a={methods:{yesNoOptions:function(){return[{id:!1,text:"No"},{id:!0,text:"Yes"}]},objectAsQueryString:function(t){var p,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=[];for(p in t)if(t.hasOwnProperty(p)){var o=e?e+"["+p+"]":p,l=t[p];r.push(null!==l&&"object"===Object(n.a)(l)?this.objectAsQueryString(l,o):encodeURIComponent(o)+"="+encodeURIComponent(l))}return r.join("&")}}}},727:function(t,e,r){var content=r(730);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,r(95).default)("1556abca",content,!0,{sourceMap:!1})},729:function(t,e,r){"use strict";r(727)},730:function(t,e,r){var n=r(94)(!1);n.push([t.i,".vs__dropdown-option{padding:3px 2px 3px 10px}.vs__dropdown-option:not(.vs__dropdown-option--disabled){padding-left:20px!important}.vs__search{color:#d3d3d3!important}.selected-group{overflow:hidden;pointer-events:none;text-overflow:ellipsis;white-space:nowrap;font-size:12px!important;position:absolute;top:-9px;left:-5px;color:grey}.selected-group.multi{background-color:var(--vs-selected-bg);font-size:9px!important;top:-7px;left:-5px}.selected-option-group{position:relative}.selected-option .has-group{top:12px}",""]),t.exports=n},733:function(t,e,r){var content=r(739);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,r(95).default)("8a92a63a",content,!0,{sourceMap:!1})},738:function(t,e,r){"use strict";r(733)},739:function(t,e,r){var n=r(94)(!1);n.push([t.i,"[data-v-74f6eee8] .vue__time-picker input.display-time{width:100%;border:1px solid #ced4da;height:calc(1.5em + .75rem + 2px);padding:.375rem .75rem;font-size:1rem;line-height:1.5}",""]),t.exports=n},742:function(t,e,r){"use strict";var n=r(2),o=(r(12),r(14),r(15),r(745)),l=r.n(o),c=(r(746),r(292)),d=r(293),m={name:"EntryFields",components:{CoralsTextarea:c.default,VueTimepicker:l.a},props:{form:{required:!0},fullCrud:{required:!1,default:!0}},mounted:function(){this.originalTags=Object(n.a)({},this.form.project_id,this.form.tags),this.loadProjectRelatedFormData(this.form.project_id),this.loadProjectTags(),this.timePicker={HH:"".concat(Object(d.padStart)(this.form.hours||0,2,0)),mm:"".concat(Object(d.padStart)(this.form.minutes||0,2,0))},(this.form.evaluation_hours||this.form.evaluation_minutes)&&(this.evaluationTimePicker={HH:"".concat(Object(d.padStart)(this.form.evaluation_hours||0,2,0)),mm:"".concat(Object(d.padStart)(this.form.evaluation_minutes||0,2,0))})},data:function(){return{active_options:1,activities:[],users:[],projectTagOptions:[],originalTags:[],timePicker:{},evaluationTimePicker:{},timeValidation:""}},methods:{loadProjectRelatedFormData:function(t){var e=this;if(!t)return this.activities=[],this.users=[],void(this.timePicker={});this.form.isReady=!1;var r="timesheet/entries/get-form-data?project_id=".concat(t);this.$axios.get(r).then((function(t){var r=t.data;e.activities=r.data.activities,e.users=r.data.users})).finally((function(){e.form.isReady=!0}))},getActivitiesOrProjectsOptions:function(t){var e=[],r=[],n=[];return this.active_options?(n=t.filter((function(object){return(1===object.is_active||"active"===object.status)&&!0!==object.group})),r=t.filter((function(t){return!0===t.group&&"active"===t.status}))):(n=t.filter((function(object){return!0!==object.group})),r=t.filter((function(t){return!0===t.group}))),r.forEach((function(t){t.is_group_empty=!0,e.push(t),n.filter((function(r){t.code===r.group&&(t.is_group_empty=!1,e.push(r))}))})),e},loadProjectTags:function(){var t=this;if(this.projectTagOptions=[],this.form.tags=[],!this.form.project_id)return[];var e="timesheet/projects/entries/".concat(this.form.project_id,"/get-project-labels");this.$axios.get(e).then((function(e){var r=e.data;t.originalTags.hasOwnProperty(t.form.project_id)&&(t.form.tags=t.originalTags[t.form.project_id]),t.projectTagOptions=r.data}))},TimeValueInput:function(data){this.form.minutes=data.mm,this.form.hours=data.HH},EvaluationTimeValueInput:function(data){this.form.evaluation_minutes=data.mm,this.form.evaluation_hours=data.HH}},watch:{"form.project_id":function(){this.loadProjectTags()},"form.isReady":function(t){if(t){for(var e="",r=0,n=["hours","minutes","evaluation_hours","evaluation_minutes"];r<n.length;r++){var o=n[r];this.form.errors.has(o)&&(e+=this.form.errors.get(o)+"<br/>")}this.timeValidation=e}else this.timeValidation=""}},computed:{getTimeError:function(){return this.timeValidation},getProjectOptions:function(){return this.getActivitiesOrProjectsOptions(this.form.getFormData("projects"))},getActivitiesOptions:function(){return this.getActivitiesOrProjectsOptions(this.activities)},getUsersOptions:function(){return this.active_options?this.users.filter((function(t){return"active"===t.status})):this.users},evaluationEnabled:function(){return this.$store.getters.settings("evaluation_enabled")},isMultipleEntries:function(){return this.form.multiple_entries&&this.fullCrud}}},f=(r(738),r(88)),component=Object(f.a)(m,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[this.form.id?t._e():r("div",{directives:[{name:"is-admin",rawName:"v-is-admin"}]},[r("div",{staticClass:"custom-control custom-checkbox mb-2"},[r("input",{directives:[{name:"model",rawName:"v-model",value:t.active_options,expression:"active_options"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"active_options"},domProps:{checked:Array.isArray(t.active_options)?t._i(t.active_options,null)>-1:t.active_options},on:{change:function(e){var r=t.active_options,n=e.target,o=!!n.checked;if(Array.isArray(r)){var l=t._i(r,null);n.checked?l<0&&(t.active_options=r.concat([null])):l>-1&&(t.active_options=r.slice(0,l).concat(r.slice(l+1)))}else t.active_options=o}}}),t._v(" "),t._m(0)])]),t._v(" "),r("div",{staticClass:"row"},[r("div",{staticClass:"col-md-6"},[r("corals-select",{attrs:{form:t.form,required:"",label:"Project",field:"project_id",options:t.getProjectOptions},on:{input:function(e){return t.loadProjectRelatedFormData(t.form.project_id)}}})],1),t._v(" "),r("div",{staticClass:"col-md-6"},[r("corals-select",{attrs:{form:t.form,required:"",label:"Activity",field:"activity_id",options:t.getActivitiesOptions}})],1)]),t._v(" "),t.isMultipleEntries?r("div",{staticClass:"row"},[this.form.all_member_users?t._e():r("div",{staticClass:"col-md-6"},[r("corals-select",{attrs:{form:t.form,field:"user_id",label:"Users",multiple:!0,options:t.getUsersOptions,required:""}})],1),t._v(" "),r("div",{staticClass:"col-md-6"},[r("corals-checkbox",{attrs:{field:"all_member_users",label:"All active full time members",form:t.form,"with-space":""}})],1)]):r("div",{staticClass:"row"},[r("div",{staticClass:"col-md-6"},[t.fullCrud?r("corals-select",{attrs:{form:t.form,label:"User",field:"user_id",options:t.getUsersOptions,required:""}}):t._e()],1),t._v(" "),r("div",{staticClass:"col-md-6"},[t.fullCrud?r("corals-datepicker",{attrs:{form:t.form,required:"",field:"spent_at",label:"Spent at"}}):t._e()],1)]),t._v(" "),t.isMultipleEntries?r("div",{staticClass:"row sm-gutters"},[r("div",{staticClass:"col-md-6"},[r("corals-datepicker",{attrs:{form:t.form,max:t.form.spent_to,required:"",field:"spent_from",label:"Spent From"}})],1),t._v(" "),r("div",{staticClass:"col-md-6"},[r("corals-datepicker",{attrs:{form:t.form,min:t.form.spent_from,required:"",field:"spent_to",label:"Spent to"}})],1)]):t._e(),t._v(" "),r("div",{staticClass:"row d-block d-md-none"},[r("div",{staticClass:"col-12"},[r("corals-textarea",{attrs:{field:"description",rows:"2",required:"",form:t.form}}),t._v(" "),r("div",{staticClass:"row sm-gutters"},[r("div",{staticClass:"col-6"},[r("div",{staticClass:"form-group"},[r("vue-timepicker",{staticClass:"d-block",attrs:{"input-class":"form-control","hour-label":"Hours","minute-label":"Minutes",format:"HH:mm","minute-interval":5,"advanced-keyboard":"","manual-input":"","drop-direction":"auto","close-on-complete":"",placeholder:"HH:MM"},on:{input:t.TimeValueInput},model:{value:t.timePicker,callback:function(e){t.timePicker=e},expression:"timePicker"}})],1)]),t._v(" "),t.fullCrud&&t.evaluationEnabled?r("div",{staticClass:"col-6"},[r("div",{staticClass:"form-group"},[r("vue-timepicker",{staticClass:"d-block",attrs:{"input-class":"form-control","hour-label":"Hours","minute-label":"Minutes",format:"HH:mm","minute-interval":5,"advanced-keyboard":"","manual-input":"","drop-direction":"auto","close-on-complete":"",placeholder:"HH:MM"},on:{input:t.EvaluationTimeValueInput},model:{value:t.evaluationTimePicker,callback:function(e){t.evaluationTimePicker=e},expression:"evaluationTimePicker"}}),t._v(" "),r("small",{staticClass:"text-muted"},[t._v("Evaluation Time")])],1)]):t._e()]),t._v(" "),t.getTimeError.length?r("div",{staticClass:"d-block invalid-feedback",domProps:{innerHTML:t._s(t.getTimeError)}}):t._e()],1)]),t._v(" "),r("div",{staticClass:"sm-gutters d-none d-md-flex"},[r("div",{staticClass:"col-9"},[r("corals-textarea",{attrs:{field:"description",rows:"4",required:"",form:t.form}}),t._v(" "),t.getTimeError.length?r("div",{staticClass:"d-block invalid-feedback",domProps:{innerHTML:t._s(t.getTimeError)}}):t._e()],1),t._v(" "),r("div",{staticClass:"col-3"},[r("div",{staticClass:"form-group"},[r("label",{staticClass:"d-block"},[t._v(" ")]),t._v(" "),r("vue-timepicker",{staticClass:"d-block",attrs:{"input-class":"form-control","hour-label":"Hours","minute-label":"Minutes",format:"HH:mm","minute-interval":5,"advanced-keyboard":"","manual-input":"","drop-direction":"auto","close-on-complete":"",placeholder:"HH:MM"},on:{input:t.TimeValueInput},model:{value:t.timePicker,callback:function(e){t.timePicker=e},expression:"timePicker"}})],1),t._v(" "),t.fullCrud&&t.evaluationEnabled?r("div",{staticClass:"form-group"},[r("vue-timepicker",{staticClass:"d-block",attrs:{"input-class":"form-control","hour-label":"Hours","minute-label":"Minutes",format:"HH:mm","minute-interval":5,"advanced-keyboard":"","manual-input":"","drop-direction":"auto","close-on-complete":"",placeholder:"HH:MM"},on:{input:t.EvaluationTimeValueInput},model:{value:t.evaluationTimePicker,callback:function(e){t.evaluationTimePicker=e},expression:"evaluationTimePicker"}}),t._v(" "),r("small",{staticClass:"text-muted"},[t._v("Evaluation Time")])],1):r("div",[r("div",{staticClass:"text-center"},[r("fa",{staticClass:"text-success",attrs:{icon:["far","clock"],size:"3x"}})],1)])])]),t._v(" "),r("transition",{attrs:{name:"fade"}},[Object.keys(t.projectTagOptions).length?r("corals-select",{attrs:{form:t.form,field:"tags",label:"Labels",multiple:!0,options:t.projectTagOptions}}):t._e()],1),t._v(" "),t.fullCrud&&!t.isMultipleEntries&&t.evaluationEnabled?r("div",{staticClass:"row"},[r("div",{staticClass:"col-6"},[r("corals-checkbox",{attrs:{field:"has_reviewed",form:t.form}})],1)]):t._e(),t._v(" "),t.fullCrud&&!t.form.id?r("div",{staticClass:"row"},[r("div",{staticClass:"col-6"},[r("corals-checkbox",{attrs:{field:"multiple_entries",form:t.form}})],1)]):t._e()],1)}),[function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("label",{staticClass:"custom-control-label",attrs:{for:"active_options"}},[r("small",[t._v("Show Active Options")])])}],!1,null,"74f6eee8",null);e.a=component.exports},760:function(t,e,r){var content=r(787);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,r(95).default)("cecf902a",content,!0,{sourceMap:!1})},761:function(t,e,r){var content=r(789);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,r(95).default)("2c0814f5",content,!0,{sourceMap:!1})},762:function(t,e,r){var content=r(791);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,r(95).default)("fc84c202",content,!0,{sourceMap:!1})},763:function(t,e,r){var content=r(793);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,r(95).default)("16cc4678",content,!0,{sourceMap:!1})},783:function(t,e,r){"use strict";var n=r(30),o=r(784).start;n({target:"String",proto:!0,forced:r(785)},{padStart:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},784:function(t,e,r){var n=r(35),o=r(137),l=r(63),c=r(302),d=r(82),m=n(c),f=n("".slice),v=Math.ceil,h=function(t){return function(e,r,n){var c,h,_=l(d(e)),y=o(r),w=_.length,k=void 0===n?" ":l(n);return y<=w||""==k?_:((h=m(k,v((c=y-w)/k.length))).length>c&&(h=f(h,0,c)),t?_+h:h+_)}};t.exports={start:h(!1),end:h(!0)}},785:function(t,e,r){var n=r(117);t.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(n)},786:function(t,e,r){"use strict";r(760)},787:function(t,e,r){var n=r(94)(!1);n.push([t.i,".week-day[data-v-71a0a42b]{width:130px}.clear-item-btn[data-v-71a0a42b]{position:absolute;top:0;left:-15px}@media (max-width:768px){.clear-item-btn[data-v-71a0a42b]{top:-15px;left:5px}}",""]),t.exports=n},788:function(t,e,r){"use strict";r(761)},789:function(t,e,r){var n=r(94)(!1);n.push([t.i,".row-entry .entry-action[data-v-86f60516],.row-entry .entry-description[data-v-86f60516],.row-entry .entry-time[data-v-86f60516]{padding:1em}",""]),t.exports=n},790:function(t,e,r){"use strict";r(762)},791:function(t,e,r){var n=r(94)(!1);n.push([t.i,'.entry-box[data-v-7e1e65cd]{min-height:300px}.calendar-week[data-v-7e1e65cd] .card-header{padding:.5rem 1rem!important}.calendar-week[data-v-7e1e65cd] .card-body{padding:0 1rem!important}.sk-tab[data-v-7e1e65cd]{min-height:44px;min-width:44px}.day-tab-title[data-v-7e1e65cd]{position:relative}.require-review[data-v-7e1e65cd]:before{content:"\\2022";position:absolute;top:0;right:-12px;color:#ffc107;line-height:0;font-size:30px}',""]),t.exports=n},792:function(t,e,r){"use strict";r(763)},793:function(t,e,r){var n=r(94)(!1);n.push([t.i,".calendar-week[data-v-215cd784] .card-header{padding:.5rem 1rem!important}.calendar-week[data-v-215cd784] .card-body{padding:0 1rem!important}.b-skeleton-text[data-v-215cd784]{height:20px}.sk-h2[data-v-215cd784]{height:39px}.sk-h4[data-v-215cd784]{height:29px}.b-form-datepicker[data-v-215cd784] .btn{padding:6px 10px!important}",""]),t.exports=n},795:function(t,e,r){"use strict";r.r(e);var n=r(62),o=(r(136),r(33),r(420),r(14),r(12),r(47),r(15),r(19),r(39),r(303),r(783),r(719)),l=r(726),c=(r(72),r(18),r(116),r(295)),d=r(745),m=r.n(d),f={name:"week",inject:["fetchNewWeek","removeRowWeek","onModalHidden"],components:{COverlay:o.a,CoralsSelect:c.default,VueTimepicker:m.a},props:{showLoader:{required:!0},days:{required:!0},weekDays:{required:!0},showCreateRowModal:{required:!0}},data:function(){return{active_options:1,modalTitle:"Create row",rowModalId:"row-modal",activities:[],users:[],form:this.$form({activity_id:"",project_id:"",user_id:this.$auth.user.id},{fetchFormDataURL:"timesheet/entries/get-form-data",model:"entry"})}},mounted:function(){},methods:{getActivitiesOrProjectsOptions:function(t){var e=[],r=[],n=[];return this.active_options?(n=t.filter((function(object){return(1===object.is_active||"active"===object.status)&&!0!==object.group})),r=t.filter((function(t){return!0===t.group&&"active"===t.status}))):(n=t.filter((function(object){return!0!==object.group})),r=t.filter((function(t){return!0===t.group}))),r.forEach((function(t){t.is_group_empty=!0,e.push(t),n.filter((function(r){t.code===r.group&&(t.is_group_empty=!1,e.push(r))}))})),e},loadProjectRelatedFormData:function(t){var e=this;if(!t)return this.activities=[],void(this.users=[]);this.form.isReady=!1;var r="timesheet/entries/get-form-data?project_id=".concat(t);this.$axios.get(r).then((function(t){var r=t.data;e.activities=r.data.activities,e.users=r.data.users})).finally((function(){e.form.isReady=!0}))},submitRow:function(){for(var t=this,e={},i=0;i<this.days.length;i++){e[this.days[i].date]=[{entryId:"",date:this.days[i].date,time:{HH:"",mm:""},description:""}]}var r=this.form.getFormData("projects").filter((function(e){return e.value===t.form.project_id})),n=this.getActivitiesOptions.filter((function(e){return e.value===t.form.activity_id})),o=this.getUsersOptions.filter((function(e){return e.id===t.form.user_id})),l={activity_id:this.form.activity_id,activity:n[0].label,project_id:this.form.project_id,project:r[0].label,user_id:this.form.user_id,user:o[0].label.split(", ")[0],showDeleteAction:!0,weekRowEntries:e};this.weekDays.push(l),this.$bvModal.hide(this.rowModalId)},removeRow:function(t){var e=[];this.weekDays.forEach((function(r,n){n!=t&&e.push(r)})),this.removeRowWeek(e)},saveWeek:function(){var t=this,e=this.weekDays,r=this.$route.query.date,n=!1;e.forEach((function(t){for(var e in t.weekRowEntries)t.weekRowEntries[e].forEach((function(t){t.description||!t.time.HH&&!t.time.mm||(n=!0)}))})),n?this.$toast.error("Please make sure the entries description set"):this.$axios.post("timesheet/timesheet-calender/save-week",{week:e}).then((function(e){t.fetchNewWeek(r),t.$toast.success(e.data.message)})).catch((function(t){console.error(t)}))},closeDescription:function(){this.$root.$emit("bv::hide::popover")}},watch:{},computed:{getDays:function(){return this.days},getProjectOptions:function(){return this.getActivitiesOrProjectsOptions(this.form.getFormData("projects"))},getActivitiesOptions:function(){var t=this.activities.length?this.activities:this.form.getFormData("activities");return this.getActivitiesOrProjectsOptions(t)},getUsersOptions:function(){var t=this.users.length?this.users:this.form.getFormData("users");return this.active_options?t.filter((function(t){return"active"===t.status})):t}}},v=(r(786),r(88)),component=Object(v.a)(f,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("div",{staticClass:"mb-5"},[r("div",{staticClass:"d-md-block d-none"},[r("c-overlay",{attrs:{show:t.showLoader}},[r("b-card",{staticClass:"card-overflow mb-1",attrs:{"no-body":""}},[r("b-card-header",{attrs:{"header-tag":"header"}},[r("div",{staticClass:"row no-gutters"},[r("div",{staticClass:"col-md-3"}),t._v(" "),r("div",{staticClass:"col-md-9 d-flex"},t._l(t.getDays,(function(e,n){return r("div",{key:"day_"+n,staticClass:"week-day"},[t._v("\n                  "+t._s(e.short_name)+"\n                  "+t._s(e.title.split(", ")[1])+"\n                ")])})),0)])]),t._v(" "),r("b-card-body",[t._l(t.weekDays,(function(e,n){return t.weekDays.length?[r("div",{staticClass:"row no-gutters"},[r("div",{staticClass:"col-md-3"},[e.showDeleteAction?r("a",{staticClass:"text-danger clear-item-btn",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.removeRow(n)}}},[r("fa",{attrs:{icon:"times"}})],1):t._e(),t._v(" "),r("strong",{staticClass:"d-block"},[t._v(t._s(e.client_name)+" - "+t._s(e.project))]),t._v(" "),t.$isAdmin()?r("small",{staticClass:"d-block"},[t._v(t._s(e.user))]):t._e(),t._v(" "),r("small",[t._v(t._s(e.activity))])]),t._v(" "),r("div",{staticClass:"col-md-9 d-flex"},t._l(e.weekRowEntries,(function(e,o){return r("div",{staticClass:"week-day"},t._l(e,(function(e,l){return r("div",{staticClass:"d-flex justify-content-around align-items-center"},[r("vue-timepicker",{staticClass:"d-block p-1",attrs:{"input-class":"form-control","hour-label":"Hours","minute-label":"Minutes",format:"HH:mm","minute-interval":5,"drop-direction":"auto","input-width":"100px","advanced-keyboard":"","manual-input":"","close-on-complete":"",placeholder:"HH:MM"},model:{value:e.time,callback:function(r){t.$set(e,"time",r)},expression:"day_time.time"}}),t._v(" "),r("a",{attrs:{id:"description_"+n+"-"+o+"-"+l}},[e.description?r("fa",{staticClass:"text-success",attrs:{icon:"sticky-note"}}):r("fa",{class:e.time.HH||e.time.mm?"text-danger":"text-success",attrs:{icon:["far","sticky-note"]}})],1),t._v(" "),r("b-popover",{attrs:{target:"description_"+n+"-"+o+"-"+l,placement:"bottomright"}},[r("div",{staticClass:"d-flex"},[r("corals-textarea",{attrs:{form:t.form,field:"",label:"Description",required:""},model:{value:e.description,callback:function(r){t.$set(e,"description",r)},expression:"day_time.description"}}),t._v(" "),r("a",{staticClass:"text-danger ",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.closeDescription.apply(null,arguments)}}},[r("fa",{attrs:{icon:"times"}})],1)],1)])],1)})),0)})),0)]),t._v(" "),r("hr")]:t._e()})),t._v(" "),t.weekDays.length?t._e():[r("div",{staticClass:"p-5"},[r("h4",{staticClass:"text-center"},[t._v("\n                  No Entries yet!\n                ")])])]],2)],1)],1)],1),t._v(" "),r("div",{staticClass:"d-md-none d-block"},[r("hr"),t._v(" "),t._l(t.getDays,(function(e,n){return r("div",[r("div",[r("strong",[t._v(t._s(e.title))]),t._v(" "),r("hr",{staticStyle:{width:"50%","text-align":"left","margin-left":"0"}})]),t._v(" "),t._l(t.weekDays,(function(o,l){return t.weekDays.length?[r("div",{staticClass:"row"},[r("div",{staticClass:"col-7"},[o.showDeleteAction?r("a",{staticClass:"text-danger clear-item-btn",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.removeRow(l)}}},[r("fa",{attrs:{icon:"times"}})],1):t._e(),t._v(" "),r("div",[r("strong",{staticClass:"d-block"},[t._v(t._s(o.client_name)+" - "+t._s(o.project))]),t._v(" "),t.$isAdmin()?r("small",{staticClass:"d-block"},[t._v(t._s(o.user))]):t._e(),t._v(" "),r("small",[t._v(t._s(o.activity))])])]),t._v(" "),r("div",{staticClass:"col-5"},t._l(o.weekRowEntries[e.date],(function(e,o){return r("div",{staticClass:"d-flex justify-content-around align-items-center"},[r("vue-timepicker",{staticClass:"d-block p-1",attrs:{"input-class":"form-control","hour-label":"Hours","minute-label":"Minutes",format:"HH:mm","minute-interval":5,"drop-direction":"auto","input-width":"100px","advanced-keyboard":"","manual-input":"","close-on-complete":"",placeholder:"HH:MM"},model:{value:e.time,callback:function(r){t.$set(e,"time",r)},expression:"day_time.time"}}),t._v(" "),r("a",{attrs:{id:"description_"+n+"-"+l+"-"+e.date+"-"+o}},[e.description?r("fa",{staticClass:"text-success",attrs:{icon:"sticky-note"}}):r("fa",{class:e.time.HH||e.time.mm?"text-danger":"text-success",attrs:{icon:["far","sticky-note"]}})],1),t._v(" "),r("b-popover",{attrs:{target:"description_"+n+"-"+l+"-"+e.date+"-"+o,placement:"bottomleft"}},[r("div",{staticClass:"d-flex"},[r("corals-textarea",{attrs:{form:t.form,field:"",label:"Description",required:""},model:{value:e.description,callback:function(r){t.$set(e,"description",r)},expression:"day_time.description"}}),t._v(" "),r("a",{staticClass:"text-danger ",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.closeDescription.apply(null,arguments)}}},[r("fa",{attrs:{icon:"times"}})],1)],1)])],1)})),0)]),t._v(" "),r("hr")]:t._e()}))],2)}))],2),t._v(" "),r("div",{staticClass:"row mt-3"},[r("div",{staticClass:"col-md-12"},[r("button",{staticClass:"btn btn-success",attrs:{disabled:0===t.weekDays.length},on:{click:function(e){return e.preventDefault(),t.saveWeek.apply(null,arguments)}}},[r("fa",{attrs:{icon:"save"}}),t._v("\n          Save\n        ")],1)])])]),t._v(" "),t.showCreateRowModal?[r("b-modal",{attrs:{"hide-footer":"",visible:"","content-class":"shadow","title-html":t.modalTitle,"no-close-on-backdrop":"",id:t.rowModalId,size:"md"},on:{hidden:t.onModalHidden}},[r("div",{staticClass:"row"},[r("div",{staticClass:"col-md-12"},[r("c-overlay",{attrs:{show:!t.form.isReady}},[r("div",{staticClass:"row"},[r("div",{staticClass:"col-md-10"},[r("corals-select",{attrs:{form:t.form,required:"",label:"Project",field:"project_id",options:t.getProjectOptions},on:{input:function(e){return t.loadProjectRelatedFormData(t.form.project_id)}}}),t._v(" "),r("corals-select",{attrs:{form:t.form,required:"",label:"Activity",field:"activity_id",options:t.getActivitiesOptions}}),t._v(" "),t.$isAdmin()?r("corals-select",{attrs:{form:t.form,label:"User",field:"user_id",options:t.getUsersOptions,required:""}}):t._e()],1)]),t._v(" "),r("div",{staticClass:"text-right"},[r("button",{staticClass:"btn btn-sm btn-primary",attrs:{type:"submit",disabled:!t.form.isReady},on:{click:function(e){return e.preventDefault(),t.submitRow.apply(null,arguments)}}},[t._v("\n                "+t._s(t.modalTitle)+"\n              ")]),t._v(" "),r("button",{staticClass:"btn btn-sm btn-secondary",attrs:{disabled:!t.form.isReady},on:{click:function(e){return e.preventDefault(),t.$bvModal.hide(t.rowModalId)}}},[t._v("Close\n              ")])])])],1)])])]:t._e()],2)}),[],!1,null,"71a0a42b",null),h=component.exports,_=(r(101),{name:"Entry",inject:["updateEntry"],props:{entry:{required:!0},index:{required:!0}},data:function(){return{reviewing:!1}},methods:{editRecord:function(t){this.$emit("edit-record",t)},showDeleteModal:function(t){this.$emit("show-delete-modal",t)},markEntryAsReviewed:function(t,e){var r=this;this.reviewing=!0,this.$axios.post("timesheet/projects/".concat(t.project_id,"/entries/").concat(t.id,"/mark-entry-as-reviewed")).then((function(t){r.updateEntry(t.data.data)})).catch((function(t){var e=t.message;t.response&&t.response.data&&t.response.data.message&&(e=t.response.data.message),r.$toast.error(e)})).finally((function(){r.reviewing=!1}))}},computed:{evaluationEnabled:function(){return this.$store.getters.settings("evaluation_enabled")},canAccess:function(){return!this.$cant("view","invoice")}}}),y=(r(788),{name:"DayEntries",provide:function(){return{updateEntry:this.updateEntry}},components:{DataEntry:Object(v.a)(_,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"row row-entry",style:t.index%2==0?{"background-color":"rgba(0, 0, 0, 0.05)"}:""},[r("div",{staticClass:"col-md-5 col-12 entry-description"},[r("h5",[r("nuxt-link",{attrs:{to:"/clients/"+t.entry.client_id}},[t._v(t._s(t.entry.client_name))]),t._v("\n      -\n      "),r("nuxt-link",{attrs:{to:"/clients/"+t.entry.client_id+"/projects/"+t.entry.project_id}},[t._v("\n        "+t._s(t.entry.project)+"\n      ")])],1),t._v(" "),r("small",{staticClass:"d-block my-1"},[t._v(t._s(t.entry.activity))]),t._v(" "),r("div",{domProps:{innerHTML:t._s(t.$getTextWithLinks(t.entry.description))}}),t._v(" "),r("div",[t._l(t.entry.labels,(function(label){return[r("span",{staticClass:"badge badge-warning mr-1"},[t._v(t._s(label.name))])]}))],2),t._v(" "),t.$isAdmin()?[r("small",[r("nuxt-link",{attrs:{to:"/users/"+t.entry.user_id}},[r("fa",{attrs:{icon:"user"}}),t._v("\n          "+t._s(t.entry.user)+"\n        ")],1)],1)]:t._e()],2),t._v(" "),r("div",{staticClass:"col-md-5 col-8 entry-time text-left"},[r("strong",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"bg-secondary rounded time-label text-center text-light p-1",attrs:{title:"Time"}},[r("fa",{attrs:{icon:"hourglass-start"}}),t._v("\n      "+t._s(t.entry.time)+"\n    ")],1),t._v(" "),t.$isAdmin()?[r("strong",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"bg-danger rounded time-label text-center text-light p-1",attrs:{title:"Cost"}},[r("fa",{attrs:{icon:["far","money-bill-alt"]}}),t._v("\n        "+t._s(t.entry.cost)+"\n      ")],1),t._v(" "),t.evaluationEnabled?r("strong",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"bg-info rounded time-label text-center text-light p-1",attrs:{title:"Evaluation hours"}},[r("fa",{attrs:{icon:"hourglass"}}),t._v("\n        "+t._s(t.entry.evaluation_time)+"\n      ")],1):t._e(),t._v(" "),r("strong",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"bg-success rounded time-label text-center text-light p-1",attrs:{title:"Billable Amount"}},[r("fa",{attrs:{icon:"coins"}}),t._v("\n        "+t._s(t.entry.amount)+"\n      ")],1)]:t._e(),t._v(" "),t.entry.has_reviewed?r("fa",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip",value:"Has Reviewed",expression:"'Has Reviewed'"}],staticClass:"text-success",attrs:{icon:"check-circle"}}):t._e()],2),t._v(" "),r("div",{staticClass:"col-md-2 col-4 entry-action text-md-center d-flex d-md-block justify-content-around"},[t.entry.edit?r("b-link",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],attrs:{title:"Edit"},on:{click:function(e){return e.preventDefault(),t.editRecord(t.entry)}}},[r("fa",{attrs:{icon:"edit"}})],1):t._e(),t._v(" "),t.entry.delete?r("b-link",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"text-danger",attrs:{title:"Delete"},on:{click:function(e){return e.preventDefault(),t.showDeleteModal(t.entry)}}},[r("fa",{attrs:{icon:"trash"}})],1):t._e(),t._v(" "),t.entry.markAsReviewed&&t.evaluationEnabled?r("b-link",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"text-success",attrs:{title:"Mark as Reviewed"},on:{click:function(e){return e.preventDefault(),t.markEntryAsReviewed(t.entry,t.index)}}},[t.reviewing?r("b-spinner",{attrs:{small:""}}):r("fa",{attrs:{icon:"check"}})],1):t._e(),t._v(" "),t.entry.invoice_id&&t.canAccess?r("b-link",{attrs:{to:"/invoices/"+t.entry.invoice_id}},[r("fa",{attrs:{icon:"file-invoice"}})],1):t._e()],1)])}),[],!1,null,"86f60516",null).exports},props:{day:{required:!0},form:{required:!1}},data:function(){return{}},computed:{evaluationEnabled:function(){return this.$store.getters.settings("evaluation_enabled")},getDay:function(){return this.day}},methods:{editRecord:function(t){this.form.replace(t),this.$emit("show-edit-entry-modal",t)},updateEntry:function(t){var e=this,r=!1;this.day.entries.forEach((function(n,o){n.id===t.id?e.$set(e.day.entries,o,t):0===n.has_reviewed&&(r=!0)})),this.$set(this.day,"require_review",r)},showDeleteModal:function(t){var e=this;this.$swal.fire({title:"Are you sure?",text:"You won't be able to revert this!",icon:"warning",showCancelButton:!0,confirmButtonColor:"#d33",cancelButtonColor:"#d7d7d7",confirmButtonText:"Yes, delete it!"}).then((function(r){r.value&&e.$emit("delete-entry",t)}))}}}),w=Object(v.a)(y,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[t.getDay.entries.length?t._l(t.getDay.entries,(function(e,n){return r("div",{key:"day_"+t.getDay.date+"_entry_"+n},[r("data-entry",{attrs:{entry:e,index:n},on:{"edit-record":t.editRecord,"show-delete-modal":t.showDeleteModal}})],1)})):[t._m(0)]],2)}),[function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"p-5"},[r("h4",{staticClass:"text-center"},[t._v("\n        No Entries yet!\n      ")])])}],!1,null,"4bb06916",null).exports,k=r(742),x={name:"AddEntryModal",components:{COverlay:o.a,EntryFields:k.a},props:{modalId:{required:!0,type:String},modalTitle:{required:!1,type:String,default:"Create Entry"},form:{required:!0}}},C=Object(v.a)(x,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("b-modal",{attrs:{"hide-footer":"",visible:"","content-class":"shadow","title-html":t.modalTitle,"no-close-on-backdrop":"",id:t.modalId,size:"lg"},on:{hidden:function(e){return t.$emit("hidden")}}},[r("div",{staticClass:"row"},[r("div",{staticClass:"col-md-12"},[r("c-overlay",{attrs:{show:!t.form.isReady}},[r("form",{on:{submit:function(e){return e.preventDefault(),t.$emit("modal-submitted")}}},[r("entry-fields",{attrs:{form:t.form,"full-crud":t.$isAdmin()}}),t._v(" "),r("div",{staticClass:"text-right"},[r("button",{staticClass:"btn btn-sm btn-primary",attrs:{type:"submit",disabled:!t.form.isReady||!t.form.project_id}},[t._v("\n              "+t._s(t.modalTitle)+"\n            ")]),t._v(" "),r("button",{staticClass:"btn btn-sm btn-secondary",attrs:{disabled:!t.form.isReady},on:{click:function(e){return e.preventDefault(),t.$bvModal.hide(t.modalId)}}},[t._v("Close\n            ")])])],1)])],1)])])}),[],!1,null,"0e2758e4",null).exports,D={name:"day",inject:["showEditEntryModal","onModalHidden","updateCreateEntry","updateSelectedDayIndex","afterFormSubmitted"],components:{COverlay:o.a,DayEntries:w,AddEntryModal:C},props:{showLoader:{required:!0},days:{required:!0},selectedDayIndex:{required:!0,default:null},evaluationEnabled:{required:!0},showBillable:{required:!0},weekTotalBillableTime:{required:!0},weekTotalTime:{required:!0},form:{required:!0},showAddEntryModal:{required:!0},entryModalTitle:{required:!0}},data:function(){return{createEntryModalId:"timesheet-entry-model"}},methods:{deleteEntry:function(t){var e=this;this.$axios.delete("timesheet/projects/".concat(t.project_id,"/entries/").concat(t.id)).then((function(t){e.afterFormSubmitted()})).catch((function(t){var r=t.message;t.response&&t.response.data&&t.response.data.message&&(r=t.response.data.message),e.$toast.error(r)}))},toggleTotalHours:function(){this.$isAdmin()&&(this.showBillable=!this.showBillable)},onTabChange:function(t){this.updateSelectedDayIndex(t)}},computed:{getDays:function(){return this.days},isShowBillable:function(){return this.showBillable}}},E=(r(790),Object(v.a)(D,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[t.days.length?r("c-overlay",{attrs:{show:t.showLoader}},[r("b-card",{staticClass:"calendar-week",attrs:{"no-body":""}},[r("b-tabs",{attrs:{pills:"",card:"",justified:"",filled:""},scopedSlots:t._u([{key:"tabs-end",fn:function(){return[r("b-nav-item",{staticClass:"bg-secondary rounded",attrs:{role:"presentation",href:"#","link-classes":"py-2 px-0"},on:{click:function(t){t.preventDefault()}}},[r("div",{staticClass:"text-center text-light",on:{click:function(e){return e.preventDefault(),t.toggleTotalHours()}}},[r("h6",{staticClass:"d-md-block d-none"},[t._v("Week Total")]),t._v(" "),r("h6",{staticClass:"d-md-none d-block"},[t._v("Total")]),t._v(" "),r("h6",{staticClass:"mb-0"},[t._v(t._s(t.isShowBillable?t.weekTotalBillableTime:t.weekTotalTime)+"\n                "),t.$isAdmin()&&t.evaluationEnabled?[t.isShowBillable?t._e():r("fa",{attrs:{icon:"hourglass-start"}}),t._v(" "),t.isShowBillable&&t.evaluationEnabled?r("fa",{staticClass:"text-warning",attrs:{icon:"hourglass"}}):t._e()]:t._e()],2)])])]},proxy:!0}],null,!1,1610375082)},t._l(t.getDays,(function(e,n){return r("b-tab",{key:"day_"+n,attrs:{active:n===t.selectedDayIndex},on:{click:function(e){return t.onTabChange(n)}},scopedSlots:t._u([{key:"title",fn:function(){return[r("div",{staticClass:"text-center day-tab-title",class:{"require-review":e.require_review&&t.$isAdmin()&&t.evaluationEnabled}},[r("h6",{staticClass:"d-md-block d-none"},[t._v(t._s(e.name))]),t._v(" "),r("h6",{staticClass:"d-md-none d-block"},[t._v(t._s(e.short_name))]),t._v(" "),t.isShowBillable?t._e():r("h6",{staticClass:"mb-0"},[t._v(t._s(e.total_time))]),t._v(" "),t.isShowBillable?r("h6",{staticClass:"mb-0"},[t._v(t._s(e.total_evaluation_time))]):t._e()])]},proxy:!0}],null,!0)},[t._v(" "),r("b-card-text",{staticClass:"entry-box"},[r("day-entries",{attrs:{form:t.form,day:e},on:{"delete-entry":t.deleteEntry,"show-edit-entry-modal":t.showEditEntryModal}})],1)],1)})),1)],1)],1):r("c-overlay",{attrs:{show:!1}},[r("b-card",{staticClass:"calendar-week",attrs:{"no-body":""}},[r("b-tabs",{attrs:{pills:"",card:"",justified:"",filled:""},scopedSlots:t._u([{key:"tabs-end",fn:function(){return[r("b-nav-item",{staticClass:"bg-secondary rounded",attrs:{role:"presentation",href:"#","link-classes":"py-2 px-0"},on:{click:function(t){t.preventDefault()}}},[r("div",{staticClass:"text-center text-light"},[r("h6",{staticClass:"d-md-block d-none"},[t._v("Week Total")]),t._v(" "),r("h6",{staticClass:"d-md-none d-block"},[t._v("Total")]),t._v(" "),r("h6",{staticClass:"mb-0"},[t._v("00:00\n                "),t.$isAdmin()?[t.isShowBillable?t._e():r("fa",{attrs:{icon:"hourglass-start"}})]:t._e()],2)])])]},proxy:!0}])},t._l(7,(function(e){return r("b-tab",{key:"day_"+e,scopedSlots:t._u([{key:"title",fn:function(){return[r("div",{staticClass:"text-center sk-tab"},[r("b-skeleton",{staticClass:"d-block",attrs:{animation:"fade"}}),t._v(" "),r("b-skeleton",{staticClass:"d-block mb-0",attrs:{animation:"fade"}})],1)]},proxy:!0}],null,!0)},[t._v(" "),r("b-card-text",{staticClass:"entry-box"},[r("div",{staticClass:"p-5 loader"},[r("h4",{staticClass:"text-center text-muted"},[t._v("\n                Loading\n                "),r("span",{staticClass:"dot"},[t._v(".")]),t._v(" "),r("span",{staticClass:"dot"},[t._v(".")]),t._v(" "),r("span",{staticClass:"dot"},[t._v(".")])])])])],1)})),1)],1)],1),t._v(" "),t.showAddEntryModal?r("add-entry-modal",{attrs:{"modal-title":t.entryModalTitle,form:t.form,"modal-id":t.createEntryModalId},on:{hidden:t.onModalHidden,"modal-submitted":t.updateCreateEntry}}):t._e()],1)}),[],!1,null,"7e1e65cd",null).exports),j={name:"timesheet-calender",components:{COverlay:o.a,Week:h,Day:E},middleware:"Authorization",mixins:[l.a],provide:function(){return{fetchNewWeek:this.fetchNewWeek,removeRowWeek:this.removeRowWeek,showEditEntryModal:this.showEditEntryModal,onModalHidden:this.onModalHidden,updateCreateEntry:this.updateCreateEntry,updateSelectedDayIndex:this.updateSelectedDayIndex,afterFormSubmitted:this.afterFormSubmitted}},fetch:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.hasFiltersMethod()){e.next=3;break}return e.next=3,t.initFilterForm();case 3:return r=t.todayDate,t.$route.query.date&&null!==t.$route.query.date.match(/^\d{4}-\d{2}-\d{2}$/)&&(r=t.$route.query.date),e.next=7,t.fetchWeekAndSelectDate(r);case 7:case"end":return e.stop()}}),e)})))()},data:function(){return{prev_week:null,next_week:null,start_week:null,end_week:null,dayViewEnabled:!0,specificDate:this.selectedDate,days:[],weekDays:[],weekTotalTime:"00:00",weekTotalBillableTime:"00:00",filtersModalId:"filter-modal",filterForm:{},tempFilterForm:this.$form({user_id:this.$route.query.user_id||"",project_id:this.$route.query.project_id||"",client_id:this.$route.query.client_id||""},{fetchFormDataURL:"timesheet/timesheet-calender/get-filters-form-data"}),showBillable:!1,showAddEntryModal:!1,showCreateRowModal:!1,selectedDayIndex:null,showLoader:!1,selectedEntry:null,form:this.$form({activity_id:"",project_id:"",user_id:"",spent_at:new Date,spent_from:new Date,spent_to:new Date,hours:"",minutes:"",tags:[],evaluation_hours:"",evaluation_minutes:"",description:"",has_reviewed:0,multiple_entries:0,all_member_users:0},{fetchFormDataURL:"timesheet/entries/get-form-data",model:"entry"})}},methods:{showWeekView:function(){this.dayViewEnabled=!1},hideWeekView:function(){this.dayViewEnabled=!0},removeRowWeek:function(t){this.weekDays=t},openFilterModal:function(){this.filterForm.initialized||this.initFilterForm(),this.$bvModal.show(this.filtersModalId)},initFilterForm:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$form({user_id:t.$route.query.user_id||"",project_id:t.$route.query.project_id||"",client_id:t.$route.query.client_id||""},{fetchFormDataURL:"timesheet/timesheet-calender/get-filters-form-data"});case 2:t.filterForm=e.sent;case 3:case"end":return e.stop()}}),e)})))()},resetFilters:function(){this.filterForm.reset(),this.tempFilterForm.reset(),this.filter()},filter:function(){this.filterForm.replace(this.tempFilterForm),this.fetchWeekAndSelectDate(this.selectedDate.date),this.$bvModal.hide(this.filtersModalId)},appendAllFiltersToURLParameters:function(){this.$router.push({query:this.getParametersList()})},getParametersList:function(){var t=this.selectedDate,e={},r=null;return this.filterForm&&(e={user_id:this.filterForm.user_id||"",client_id:this.filterForm.client_id||"",project_id:this.filterForm.project_id||""}),t&&t.date?r=t.date:this.$route.query.date&&null!==this.$route.query.date.match(/^\d{4}-\d{2}-\d{2}$/)&&(r=this.$route.query.date),Object.keys(e).forEach((function(t){return!e[t]&&delete e[t]})),Object.assign(e,{date:r})},clearFilterItem:function(t){this.tempFilterForm[t]="",this.filter()},showEditEntryModal:function(t){this.selectedEntry=t,this.showAddEntryModal=!0},onModalHidden:function(){this.dayViewEnabled?(this.form.replace(this.form.originalData),this.form.errors.purge(),this.selectedEntry=null,this.showAddEntryModal=!1):this.showCreateRowModal=!1},openModal:function(){this.$cant("create","entry")||(this.dayViewEnabled?(this.form.id="",this.form.spent_at=this.selectedDate.date,this.showAddEntryModal=!0):this.showCreateRowModal=!0)},updateCreateEntry:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.selectedEntry?t.updateSelectedEntry():t.createNewEntry();case 1:case"end":return e.stop()}}),e)})))()},updateSelectedEntry:function(){this.$cant("update","entry")||this.form.put("timesheet/projects/".concat(this.selectedEntry.project_id,"/entries/").concat(this.selectedEntry.id)).then(this.afterFormSubmitted)},createNewEntry:function(){var t=this;this.$cant("create","entry")||this.form.project_id&&this.form.post("timesheet/projects/".concat(this.form.project_id,"/entries")).then(function(){var e=Object(n.a)(regeneratorRuntime.mark((function e(r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.afterFormSubmitted();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},afterFormSubmitted:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.selectedEntry=null,t.form.id="",t.form.spent_at=t.selectedDate.date,t.form.setDefaults(),t.showAddEntryModal=!1,e.next=7,t.fetchWeekAndSelectDate(t.selectedDate.date);case 7:case"end":return e.stop()}}),e)})))()},returnToToday:function(){var t=this;this.selectDay(this.todayDate)||this.fetchNewWeek(this.todayDate).then((function(){t.selectDay(t.todayDate)}))},selectDay:function(t){var e=!1;for(var r in this.days)if(this.days[r].date===t){this.selectedDayIndex=Number(r),e=!0;break}return this.appendAllFiltersToURLParameters(t),e},goNext:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.dayViewEnabled){e.next=6;break}return e.next=3,t.fetchNewWeek(t.next_week);case 3:t.selectedDayIndex=0,e.next=13;break;case 6:if(t.days[t.selectedDayIndex+1]){e.next=12;break}return e.next=9,t.fetchNewWeek(t.selectedDate.next_day);case 9:t.selectedDayIndex=0,e.next=13;break;case 12:t.selectedDayIndex++;case 13:case"end":return e.stop()}}),e)})))()},goPrev:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.dayViewEnabled){e.next=6;break}return e.next=3,t.fetchNewWeek(t.prev_week);case 3:t.selectedDayIndex=t.days.length-1,e.next=13;break;case 6:if(t.days[t.selectedDayIndex-1]){e.next=12;break}return e.next=9,t.fetchNewWeek(t.selectedDate.prev_day);case 9:t.selectedDayIndex=t.days.length-1,e.next=13;break;case 12:t.selectedDayIndex--;case 13:case"end":return e.stop()}}),e)})))()},fetchNewWeek:function(t){var e=this;return Object(n.a)(regeneratorRuntime.mark((function r(){var n,o,l;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e.$cant("view","entry")){r.next=2;break}return r.abrupt("return");case 2:return e.showLoader=!0,n="timesheet/timesheet-calender/get-week?start_date=".concat(t),(o=e.objectAsQueryString(e.getParametersList()))&&(n+="&".concat(o)),r.next=7,e.$axios.get(n).then((function(t){return t.data.data})).finally((function(){return e.showLoader=!1}));case 7:l=r.sent,e.days=l.days,e.weekDays=l.weekDays.week,e.prev_week=l.weekDays.prev_week,e.next_week=l.weekDays.next_week,e.start_week=l.weekDays.start_week,e.end_week=l.weekDays.end_week,e.weekTotalTime=l.week_total_time,e.weekTotalBillableTime=l.week_total_evaluation_time;case 16:case"end":return r.stop()}}),r)})))()},getFilterDataAsParameters:function(){this.filterForm.initialized&&this.appendAllFiltersToURLParameters()},fetchWeekAndSelectDate:function(t){var e=this;return Object(n.a)(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e.$cant("view","entry")){r.next=2;break}return r.abrupt("return");case 2:return r.next=4,e.fetchNewWeek(t);case 4:e.selectDay(t);case 5:case"end":return r.stop()}}),r)})))()},hasFiltersMethod:function(){return this.hasFilters},updateSelectedDayIndex:function(t){this.selectedDayIndex=t}},computed:{evaluationEnabled:function(){return this.$store.getters.settings("evaluation_enabled")},membersWithoutEntries:function(){return this.days.length?null==this.selectedDayIndex?[]:this.days[this.selectedDayIndex].members_without_entries||[]:[]},getWeekDays:function(){return this.weekDays},hasFilters:function(){for(var t=0,e=["user_id","project_id","client_id"];t<e.length;t++){var r=e[t];if(this.filterForm[r]||this.$route.query[r])return!0}return!1},isTodayOrWeekSelected:function(){if(!this.days.length)return!0;if(!this.dayViewEnabled)return this.todayDate>this.prev_week&&this.todayDate<this.next_week;for(var t in this.days)if(this.days[t].date===this.todayDate)return this.selectedDayIndex===Number(t);return!1},selectedDate:function(){var t=this.days[this.selectedDayIndex];return t&&(this.specificDate=t.date),t},todayDate:function(){var t=new Date,dd=String(t.getDate()).padStart(2,"0"),e=String(t.getMonth()+1).padStart(2,"0"),r=t.getFullYear();return"".concat(r,"-").concat(e,"-").concat(dd)},entryModalTitle:function(){return(this.selectedEntry?"Update":"Create")+" Entry"},selectedUserFilter:function(){var t=this;return this.filterForm.initialized&&this.filterForm.user_id?this.filterForm.getFormData("users").filter((function(e){return e.value==t.filterForm.user_id})).shift():""},selectedProjectFilter:function(){if(this.filterForm.initialized&&this.filterForm.project_id){var t=this.filterForm.getFormData("projects"),e="";for(var i in t)if(!0!==t[i].group){if(t[i].value==this.filterForm.project_id)return t[i].label+(e?"[".concat(e,"]"):"")}else e=t[i].label;return""}},selectedClientFilter:function(){return this.filterForm.initialized&&this.filterForm.client_id?this.filterForm.getFormData("clients")[this.filterForm.client_id]:""}},watch:{specificDate:function(t){this.selectDay(t)||this.fetchWeekAndSelectDate(t)}},beforeMount:function(){this.$eventBus.$on("fetch-week-and-select-date",this.fetchWeekAndSelectDate)},beforeDestroy:function(){this.$eventBus.$off("fetch-week-and-select-date")}},$=j,F=(r(792),Object(v.a)($,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("div",{staticClass:"row d-none d-md-flex"},[r("div",{staticClass:"col-md-6 offset-md-1"},[r("div",{staticClass:"ml-1 pb-2 d-flex align-items-center"},[r("b-button-group",[r("b-button",{directives:[{name:"can",rawName:"v-can",value:"view entry",expression:"`view entry`"}],attrs:{disabled:!t.days.length,variant:"outline-secondary"},on:{click:t.goPrev}},[r("fa",{attrs:{icon:"chevron-left"}})],1),t._v(" "),r("b-button",{directives:[{name:"can",rawName:"v-can",value:"view entry",expression:"`view entry`"}],attrs:{disabled:!t.days.length,variant:"outline-secondary"},on:{click:t.goNext}},[r("fa",{attrs:{icon:"chevron-right"}})],1)],1),t._v(" "),t.selectedDate&&t.dayViewEnabled?r("h2",{staticClass:"d-inline-block mb-0 mx-3"},[t._v(t._s(t.selectedDate.title))]):t.dayViewEnabled?r("b-skeleton",{staticClass:"d-inline-block mb-0 mx-3 w-25 sk-h2",attrs:{animation:"fade"}}):r("h2",{staticClass:"d-inline-block mb-0 mx-2"},[t._v("\n          "+t._s(this.start_week+" - "+this.end_week))]),t._v(" "),t.isTodayOrWeekSelected?t._e():r("a",{directives:[{name:"can",rawName:"v-can",value:"view entry",expression:"`view entry`"}],attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.returnToToday.apply(null,arguments)}}},[r("small",[t.dayViewEnabled?r("span",[t._v("Return to today")]):r("span",[t._v("Return to current week")])])])],1)]),t._v(" "),r("div",{staticClass:"col-md-5 d-flex align-items-center justify-content-end"},[r("b-button-group",{staticClass:"mr-2 rounded "},[r("b-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"btn-light border-secondary",class:[t.dayViewEnabled?"active":""],attrs:{title:"Day view"},on:{click:function(e){return e.preventDefault(),t.hideWeekView.apply(null,arguments)}}},[r("fa",{staticClass:"text-dark",attrs:{icon:"calendar-week"}}),t._v("\n          Day\n        ")],1),t._v(" "),r("b-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"btn-light border-secondary",class:[t.dayViewEnabled?"":"active"],attrs:{title:"Week view"},on:{click:function(e){return e.preventDefault(),t.showWeekView.apply(null,arguments)}}},[r("fa",{staticClass:"text-dark",attrs:{icon:"calendar-week"}}),t._v("\n          Week\n        ")],1)],1),t._v(" "),t.$isAdmin()?r("b-button",{staticClass:"mr-1",attrs:{variant:"warning",disabled:!t.days.length},on:{click:function(e){return e.preventDefault(),t.openFilterModal.apply(null,arguments)}}},[r("fa",{attrs:{icon:"filter"}})],1):t._e(),t._v(" "),r("b-form-datepicker",{staticClass:"mr-1",attrs:{"button-variant":"info",dropleft:"","button-only":"",disabled:!t.days.length},model:{value:t.specificDate,callback:function(e){t.specificDate=e},expression:"specificDate"}})],1)]),t._v(" "),r("div",{staticClass:"row d-md-none no-gutters"},[r("div",{staticClass:"col-10"},[r("div",{staticClass:"d-flex align-items-center"},[r("b-button-group",{staticClass:"d-inline-block"},[r("b-button",{staticClass:"px-2",attrs:{disabled:!t.days.length,variant:"outline-secondary"},on:{click:t.goPrev}},[r("fa",{attrs:{icon:"chevron-left"}})],1),t._v(" "),r("b-button",{staticClass:"px-2",attrs:{disabled:!t.days.length,variant:"outline-secondary"},on:{click:t.goNext}},[r("fa",{attrs:{icon:"chevron-right"}})],1)],1),t._v(" "),t.selectedDate&&t.dayViewEnabled?r("h4",{staticClass:"d-inline-block mb-0 mx-2 mx-md-3"},[t._v("\n          "+t._s(t.selectedDate.title))]):t.dayViewEnabled?r("b-skeleton",{staticClass:"d-inline-block mb-0 mx-2 mx-md-3 w-50 sk-h4",attrs:{animation:"fade"}}):r("h5",{staticClass:"d-inline-block mb-0 mx-md-3"},[t._v("\n          "+t._s(this.start_week+"-"+this.end_week))])],1),t._v(" "),t.isTodayOrWeekSelected?r("div",{staticClass:"mb-1"},[r("small",[t._v(" ")])]):r("a",{directives:[{name:"can",rawName:"v-can",value:"view entry",expression:"`view entry`"}],staticClass:"d-block text-right mb-1",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.returnToToday.apply(null,arguments)}}},[r("small",[t.dayViewEnabled?r("span",[t._v("Return to today")]):r("span",[t._v("Return to current week")])])])]),t._v(" "),r("div",{staticClass:"col-2 text-right"},[r("b-form-datepicker",{attrs:{dropleft:"","button-variant":"info","button-only":"",disabled:!t.days.length},model:{value:t.specificDate,callback:function(e){t.specificDate=e},expression:"specificDate"}})],1)]),t._v(" "),r("div",{staticClass:"row no-gutters"},[r("div",{staticClass:"col-md-1 text-md-center d-none d-md-block pt-2"},[r("button",{directives:[{name:"can",rawName:"v-can",value:"create entry",expression:"`create entry`"},{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"btn btn-success py-1 px-2",attrs:{title:"New entry",disabled:!t.days.length},on:{click:function(e){return e.preventDefault(),t.openModal.apply(null,arguments)}}},[r("fa",{attrs:{icon:"plus",size:"3x"}})],1),t._v(" "),r("small",{staticClass:"d-block"},[t.dayViewEnabled?r("b",[t._v("New entry")]):r("b",[t._v("New Row")])])]),t._v(" "),r("div",{staticClass:"col-12 d-block d-md-none justify-content-between d-flex",class:t.$isAdmin()?"col-10":"col-12"},[r("b-button",{staticClass:"btn btn-success mb-2",attrs:{disabled:!t.days.length},on:{click:function(e){return e.preventDefault(),t.openModal.apply(null,arguments)}}},[r("fa",{attrs:{icon:"plus"}}),t._v(" "),t.dayViewEnabled?r("span",[t._v("New entry")]):r("span",[t._v("New Row")])],1),t._v(" "),r("b-button-group",{staticClass:"mb-2 rounded"},[r("b-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"btn-light border-secondary",class:[t.dayViewEnabled?"active":""],attrs:{title:"Day view"},on:{click:function(e){return e.preventDefault(),t.hideWeekView.apply(null,arguments)}}},[r("fa",{staticClass:"text-dark",attrs:{icon:"calendar-week"}}),t._v("\n          Day\n        ")],1),t._v(" "),r("b-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"btn-light border-secondary",class:[t.dayViewEnabled?"":"active"],attrs:{title:"Week view"},on:{click:function(e){return e.preventDefault(),t.showWeekView.apply(null,arguments)}}},[r("fa",{staticClass:"text-dark",attrs:{icon:"calendar-week"}}),t._v("\n          Week\n        ")],1)],1),t._v(" "),r("b-button",{directives:[{name:"isAdmin",rawName:"v-isAdmin"}],staticClass:"mb-2",attrs:{disabled:!t.days.length,variant:"warning"},on:{click:function(e){return e.preventDefault(),t.openFilterModal.apply(null,arguments)}}},[r("fa",{attrs:{icon:"filter"}})],1)],1),t._v(" "),r("div",{staticClass:"col-md-11"},[t.filterForm.initialized?r("div",{directives:[{name:"isAdmin",rawName:"v-isAdmin"}],staticClass:"row d-flex"},[r("div",{staticClass:"col-md-12"},[r("ul",{staticClass:"list-inline m-0"},[t.filterForm.user_id?r("li",{staticClass:"list-inline-item"},[r("small",[r("b",[t._v("User:")]),t._v(" "+t._s(t.selectedUserFilter.label))]),t._v(" "),r("sup",{staticClass:"text-danger cursor-pointer"},[r("fa",{attrs:{icon:"times"},on:{click:function(e){return e.preventDefault(),t.clearFilterItem("user_id")}}})],1)]):t._e(),t._v(" "),t.filterForm.client_id?r("li",{staticClass:"list-inline-item"},[r("small",[r("b",[t._v("Client:")]),t._v(" "+t._s(t.selectedClientFilter))]),t._v(" "),r("sup",{staticClass:"text-danger cursor-pointer"},[r("fa",{attrs:{icon:"times"},on:{click:function(e){return e.preventDefault(),t.clearFilterItem("client_id")}}})],1)]):t._e(),t._v(" "),t.filterForm.project_id?r("li",{staticClass:"list-inline-item"},[r("small",[r("b",[t._v("Project:")]),t._v(" "+t._s(t.selectedProjectFilter))]),t._v(" "),r("sup",{staticClass:"text-danger cursor-pointer"},[r("fa",{attrs:{icon:"times"},on:{click:function(e){return e.preventDefault(),t.clearFilterItem("project_id")}}})],1)]):t._e()])])]):t._e(),t._v(" "),t.dayViewEnabled?r("div",[r("Day",{attrs:{showLoader:t.showLoader,days:t.days,selectedDayIndex:t.selectedDayIndex,evaluationEnabled:t.evaluationEnabled,showBillable:t.showBillable,weekTotalBillableTime:t.weekTotalBillableTime,weekTotalTime:t.weekTotalTime,form:t.form,showAddEntryModal:t.showAddEntryModal,entryModalTitle:t.entryModalTitle}})],1):r("div",[r("Week",{attrs:{showLoader:t.showLoader,days:t.days,weekDays:t.getWeekDays,showCreateRowModal:t.showCreateRowModal}})],1)])]),t._v(" "),r("div",{staticClass:"d-flex justify-content-center"},[r("div",{staticClass:"text-sm col-md-8"},[t.membersWithoutEntries.length&&t.$isAdmin()?r("b-alert",{attrs:{variant:"warning",show:"",fade:""}},[r("b",[t._v("\n          Users without entries for "+t._s(t.selectedDate.title)+":\n        ")]),t._v(" "),r("br"),t._v(" "),t._l(t.membersWithoutEntries,(function(e){return r("div",[t._v("- "+t._s(e))])}))],2):t._e()],1)]),t._v(" "),t.$isAdmin()?[r("b-modal",{attrs:{"content-class":"shadow",title:"Filters","no-close-on-backdrop":"",id:t.filtersModalId},scopedSlots:t._u([{key:"modal-footer",fn:function(){return[r("button",{staticClass:"btn btn-primary",on:{click:function(e){return e.preventDefault(),t.filter.apply(null,arguments)}}},[r("fa",{attrs:{icon:"search"}})],1),t._v(" "),r("button",{staticClass:"btn btn-secondary",on:{click:function(e){return e.preventDefault(),t.resetFilters.apply(null,arguments)}}},[r("fa",{attrs:{icon:"eraser"}})],1)]},proxy:!0}],null,!1,866091762)},[r("c-overlay",{attrs:{show:!t.filterForm.initialized}},[r("div",[r("corals-select",{attrs:{form:t.tempFilterForm,label:"User",field:"user_id",options:t.filterForm.initialized?t.filterForm.getFormData("users"):[]}})],1),t._v(" "),r("div",[r("corals-select",{attrs:{form:t.tempFilterForm,label:"Project",field:"project_id",options:t.filterForm.initialized?t.filterForm.getFormData("projects"):[]}})],1),t._v(" "),r("div",[r("corals-select",{attrs:{form:t.tempFilterForm,label:"Client",field:"client_id",options:t.filterForm.initialized?t.filterForm.getFormData("clients"):[]}})],1)])],1)]:t._e()],2)}),[],!1,null,"215cd784",null));e.default=F.exports}}]);

Spamworldpro Mini