![]() 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/ |
(window.webpackJsonp=window.webpackJsonp||[]).push([[19,10],{292:function(e,t,r){"use strict";r.r(t);r(33),r(47),r(44),r(18),r(116);var o={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||""}}},n=r(88),component=Object(n.a)(o,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("b-form-group",{attrs:{"invalid-feedback":e.form.error(e.field),label:e.labelValue,"label-for":e.idValue,"label-class":e.required?"required-field":"",description:e.fieldDescription,state:e.form.state(e.field)}},[e.hasValueAttr?r("b-form-textarea",e._b({attrs:{id:e.idValue,state:e.form.state(e.field)},on:{input:function(t){return e.$emit("input",t)}}},"b-form-textarea",e.$attrs,!1)):r("b-form-textarea",e._b({attrs:{id:e.idValue,state:e.form.state(e.field)},on:{input:function(t){return e.$emit("input",t)}},model:{value:e.form[e.field],callback:function(t){e.$set(e.form,e.field,"string"==typeof t?t.trim():t)},expression:"form[field]"}},"b-form-textarea",e.$attrs,!1))],1)}),[],!1,null,"26d350b3",null);t.default=component.exports},719:function(e,t,r){"use strict";var o={name:"COverlay",props:{show:{default:!1,type:Boolean}}},n=r(88),component=Object(n.a)(o,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("b-overlay",{attrs:{show:e.show,rounded:"sm","spinner-variant":"primary",variant:"transparent",blur:"1px"}},[e._t("default")],2)}),[],!1,null,"5a577948",null);t.a=component.exports},720:function(e,t,r){var content=r(725);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[e.i,content,""]]),content.locals&&(e.exports=content.locals);(0,r(95).default)("7c8b2224",content,!0,{sourceMap:!1})},722:function(e,t,r){"use strict";r(33),r(47),r(41),r(19),r(18),r(14),r(12),r(20),r(15),r(21);var o=r(2);r(39);function n(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(object);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,r)}return t}function l(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?n(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):n(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var c={data:function(){var e=this;return{formModalId:"",deleteRecordId:null,editRecordId:null,cloneRecordId:null,showRecordId:null,listFilters:null,filterBy:[],defaultOptions:{hideCreate:!1,headings:{},columnsDropdown:!1,initialPage:1,perPageValues:[],perPage:25,debounce:1e3,filterByColumn:!0,responseAdapter:function(e){var data=e.data;return{data:data.data,count:data.meta.pagination.total}},requestAdapter:function(data){return e.$router.replace({query:l(l({},e.$route.query),{},{page:data.page})}).catch((function(){})),data.query=Object.assign(data.query,e.filterBy),data},sortIcon:{base:"ts-ico",up:"ts-up",down:"ts-down",is:"ts-sort"},sortable:[],filterable:[],customColumns:[],requestKeys:{query:"query",limit:"limit",orderBy:"orderBy",ascending:"ascending",page:"page",byColumn:"byColumn"},initFilters:{},templates:{},listColumns:{}},listTableRefs:"listTable"}},beforeMount:function(){var e=this.$route.query;this.defaultOptions.initialPage=e.page?parseInt(e.page):1},mounted:function(){this.formModalId="".concat(this.resourceURL,"Table")},computed:{deleteURL:function(){return this.deleteHref||this.resourceURL},editURL:function(){return this.editHref||this.resourceURL},cloneURL:function(){return this.cloneHref||this.resourceURL}},methods:{onSubmit:function(){var e=this;this.editRecordId?this.form.put("".concat(this.editURL,"/").concat(this.editRecordId)).then((function(t){e.handleFormHidden(),e.$emit("formUpdated",t.data)})):this.form.post("".concat(this.resourceURL)).then((function(t){e.handleFormHidden(),e.$emit("formStored",t.data)}))},tableOptions:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.defaultOptions;return Object.assign(t,e)},showDeleteModal:function(e,t){var r=this;this.deleteRecordId=e,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(e){e.value&&r.doDeleteRecord()}))},doDeleteRecord:function(){var e=this;this.$axios.delete("".concat(this.deleteURL,"/").concat(this.deleteRecordId)).then((function(t){e.refresh(),t.data.message&&e.$toast.success(t.data.message)})).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)}))},refresh:function(){this.$refs[this.listTableRefs].refresh()},showFormModal:function(){this.$bvModal.show(this.formModalId)},handleFormHidden:function(){this.editRecordId=null,this.$bvModal.hide(this.formModalId),this.refresh()},handleShowHidden:function(){this.showRecordId=null},cloneRecord:function(e,t){var r=this;this.$axios.get("".concat(this.cloneURL,"/").concat(e,"?edit=1")).then((function(o){var n=o.data;r.cloneRecordId=e,r.form.cloneReplace(n.data,t),r.showFormModal()})).catch((function(e){r.$toast.error(e.message)}))},editRecord:function(e){var t=this;this.$axios.get("".concat(this.editURL,"/").concat(e,"?edit=1")).then((function(r){var o=r.data;t.editRecordId=e,t.form.replace(o.data),t.showFormModal()})).catch((function(e){t.$toast.error(e.message)}))},replace:function(data,object){for(var e in data)object[e]=data[e];return object},showRecord:function(e){this.showRecordId=e}}},d=c,f=r(723),m=r(719),h=r(293),v=r.n(h),_={mixins:[d],components:{COverlay:m.a,PageSection:f.a},inject:{handleBulkAction:{default:[]}},props:{columns:{required:!0},bulkActionOptions:{required:!1,default:function(){return[]}},resourceURL:{required:!0},deleteHref:{required:!1},editHref:{required:!1},cloneHref:{required:!1},cloneAttr:{required:!1},options:{required:!0},form:{required:!1},formSize:{required:!1,default:""},labels:{required:!0},rowColumns:{required:!1,default:"col-md-12"},nameClickable:{required:!1},compact:{required:!1},onDataLoaded:{required:!1,default:function(){return function(){}}}},name:"CrudIndex",data:function(){return{selectedIds:[]}},beforeMount:function(){this.$eventBus.$on("setSelectedIds",this.setSelectedIds)},methods:{setSelectedIds:function(e){this.selectedIds=e},onModalShow:function(){this.editRecordId||this.cloneRecordId||(this.form.replace(this.form.originalData),this.editRecordId=null,this.cloneRecordId=null,this.form.errors.purge())},onModalHidden:function(){this.form.replace(this.form.originalData),this.editRecordId=null,this.cloneRecordId=null,this.form.errors.purge(),this.$emit("edit-form-closed")},getTableData:function(){var table=this.$refs[this.listTableRefs];return v.a.get(table,"data")},selectAll:function(e){var data=this.getTableData();this.selectedIds=e?data.map((function(e){return e.id})):[],this.$refs.checkbox_header__table.checked=e}},computed:{modalTitle:function(){return(this.editRecordId?"Update ":this.cloneRecordId?"Clone ":"Create ")+this.labels.singularTitle}},watch:{selectedIds:function(e){this.$refs.checkbox_header__table.checked=this.getTableData().length===v.a.uniq(e).length}},beforeDestroy:function(){}},y=(r(724),r(88)),component=Object(y.a)(_,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"crud-index"},[r("div",{staticClass:"row"},[r("div",{staticClass:"col-md-4"},[r("PageSection",{attrs:{title:e.labels.title}})],1),e._v(" "),r("div",{staticClass:"col-md-8 text-right"},[e.bulkActionOptions.length?r("b-dropdown",{staticClass:"m-2",attrs:{id:"dropdown-left",text:"Actions",variant:"primary",size:"sm"}},[e._l(e.bulkActionOptions,(function(t){return[r("b-dropdown-item",{staticStyle:{"text-transform":"capitalize"},attrs:{href:"#"},on:{click:function(r){return r.preventDefault(),e.handleBulkAction(t,e.selectedIds)}}},[e._v("\n "+e._s(t)+"\n ")])]}))],2):e._e(),e._v(" "),e._t("extraButtons"),e._v(" "),e.options.hideCreate?e._e():r("b-button",{attrs:{variant:"primary",size:"sm",type:"button"},on:{click:function(t){return t.preventDefault(),e.showFormModal.apply(null,arguments)}}},[r("fa",{attrs:{icon:"plus"}}),e._v("\n Create\n ")],1),e._v(" "),r("b-button",{attrs:{variant:"warning",size:"sm",type:"button"},on:{click:function(t){return t.preventDefault(),e.refresh.apply(null,arguments)}}},[r("fa",{attrs:{icon:"redo"}})],1)],2)]),e._v(" "),r("div",{staticClass:"row mt-3"},[r("div",{class:e.rowColumns},[r("v-server-table",{ref:"listTable",attrs:{columns:e.columns,url:e.resourceURL,options:e.tableOptions(e.options)},on:{loaded:e.onDataLoaded},scopedSlots:e._u([{key:"checkbox",fn:function(t){return e.$isAdmin()&&e.bulkActionOptions.length?r("div",{staticClass:"text-center"},[r("b-form-checkbox",{key:t.row.id+"__checkbox_record",attrs:{value:t.row.id},model:{value:e.selectedIds,callback:function(t){e.selectedIds=t},expression:"selectedIds"}})],1):e._e()}},e._l(e.options.customColumns,(function(t){return{key:t,fn:function(r){return[e._t(t,null,{object:r})]}}})),{key:"actions",fn:function(t){return r("div",{},[t.row.edit&&Object.keys(t.row.edit).length?r("b-link",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],attrs:{title:"Edit"},on:{click:function(r){return r.preventDefault(),e.editRecord(t.row.id)}}},[r("fa",{attrs:{icon:"edit"}})],1):e._e(),e._v(" "),t.row.delete&&Object.keys(t.row.delete).length?r("b-link",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"text-danger",attrs:{title:"Delete"},on:{click:function(r){return r.preventDefault(),e.showDeleteModal(t.row.id,t.index)}}},[r("fa",{attrs:{icon:"trash"}})],1):e._e(),e._v(" "),t.row.clone&&Object.keys(t.row.clone).length?r("b-link",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"text-warning",attrs:{title:"Clone"},on:{click:function(r){return r.preventDefault(),e.cloneRecord(t.row.id,e.cloneAttr)}}},[r("fa",{attrs:{icon:"clone"}})],1):e._e(),e._v(" "),e._t("extra-actions",null,{object:t.row})],2)}}],null,!0)},[r("div",{staticClass:"text-center",attrs:{slot:"h__checkbox"},slot:"h__checkbox"},[e.$isAdmin()&&e.bulkActionOptions.length?r("div",{staticClass:"custom-control custom-checkbox"},[r("input",{key:"checkbox_header__table",ref:"checkbox_header__table",staticClass:"custom-control-input",attrs:{type:"checkbox","true-value":1,"false-value":0,id:"checkbox_header__table"},on:{change:function(t){return e.selectAll(t.target.checked)}}}),e._v(" "),r("label",{staticClass:"custom-control-label",attrs:{for:"checkbox_header__table"}})]):e._e()])])],1)]),e._v(" "),r("b-modal",{attrs:{"hide-footer":"",size:e.formSize,"content-class":"shadow",title:e.modalTitle,"no-close-on-backdrop":"",id:e.formModalId},on:{hidden:e.onModalHidden,show:e.onModalShow}},[e.form?r("div",{staticClass:"row"},[r("div",{staticClass:"col-md-12"},[r("c-overlay",{attrs:{show:!e.form.isReady}},[r("form",{on:{submit:function(t){return t.preventDefault(),e.onSubmit()}}},[e._t("default",null,{form:e.form}),e._v(" "),r("div",{staticClass:"text-right"},[r("button",{staticClass:"btn btn-sm btn-primary",attrs:{type:"submit",disabled:!e.form.isReady}},[e._v("\n "+e._s(e.modalTitle)+"\n ")]),e._v(" "),r("button",{staticClass:"btn btn-sm btn-secondary",attrs:{disabled:!e.form.isReady},on:{click:function(t){return t.preventDefault(),e.$bvModal.hide(e.formModalId)}}},[e._v("Close\n ")])])],2)])],1)]):e._e()])],1)}),[],!1,null,null,null);t.a=component.exports},723:function(e,t,r){"use strict";var o={name:"PageSection",props:{title:{required:!0}}},n=r(88),component=Object(n.a)(o,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"row"},[r("div",{staticClass:"col-md-12"},[r("div",{staticClass:"border-bottom mb-3"},[r("h4",[e._v(e._s(e.title))]),e._v(" "),e._t("default")],2)])])}),[],!1,null,"019ca8fe",null);t.a=component.exports},724:function(e,t,r){"use strict";r(720)},725:function(e,t,r){var o=r(94)(!1);o.push([e.i,".form-modal-header{padding:0!important}",""]),e.exports=o},815:function(e,t,r){"use strict";r.r(t);r(41),r(33),r(72);var o=r(722),n={name:"index",components:{CoralsTextarea:r(292).default,CRUDIndex:o.a},data:function(){var e=this;return{resourceUrl:"timesheet/clients",labels:{title:"Clients",singularTitle:"Client"},options:{listColumns:{user_id:[],status:[]},initFilters:{status:"active"},hideCreate:this.$cant("create","client"),sortable:["name"],filterable:["name","user_id","status"],customColumns:["name","number_of_projects","status"],headings:{user_id:"User",number_of_projects:"# Of Projects"}},form:this.$form({name:"",bill_cycle:"",bill_cycle_starts_at:"",user_id:"",status:"active",properties:{billing_address:""}},{fetchFormDataURL:"timesheet/clients/get-form-data",model:"client",loadFormDataCallBack:function(){e.options.listColumns.user_id=e.getOptions(e.form.formData.users),e.options.listColumns.status=e.getOptions(e.form.formData.status_options)}}),billCycleOptions:{daily:"Daily",weekly:"Weekly",biweekly:"Biweekly",monthly:"Monthly"},weekDaysOptions:{0:"Sunday",1:"Monday",2:"Tuesday",3:"Wednesday",4:"Thursday",5:"Friday",6:"Saturday"}}},methods:{getOptions:function(e){var t=[];return t.push({id:"",text:"All"}),e.map((function(e){var r,label=e.label.split(",");t.push({id:null!==(r=e.id)&&void 0!==r?r:e.value,text:label[0]})})),t}},computed:{columns:function(){var e=["name","user_id","number_of_projects","bill_cycle","bill_cycle_starts_at","status","actions"];return this.$notAdmin()&&e.pop(),e}}},l=r(88),component=Object(l.a)(n,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("CRUDIndex",{ref:"clientsTable",attrs:{columns:e.columns,resourceURL:e.resourceUrl,options:e.options,form:e.form,labels:e.labels},scopedSlots:e._u([{key:"name",fn:function(t){var object=t.object;return[r("nuxt-link",{attrs:{to:"/clients/"+object.row.id}},[e._v(e._s(object.row.name))])]}},{key:"number_of_projects",fn:function(t){var object=t.object;return[r("nuxt-link",{attrs:{to:"/clients/"+object.row.id+"?tab=projects"}},[e._v(e._s(object.row.number_of_projects))])]}},{key:"status",fn:function(t){var object=t.object;return[r("span",{domProps:{innerHTML:e._s(object.row.status_as_labels)}})]}},{key:"extra-actions",fn:function(t){var object=t.object;return[object.clientHasInvoicesToBeGenerated?r("nuxt-link",{staticClass:"text-warning",attrs:{to:"/clients/"+object.id+"?tab=billable-entries"}},[r("fa",{attrs:{icon:"file-invoice"}})],1):e._e()]}},{key:"default",fn:function(t){var form=t.form;return[r("corals-input",{attrs:{form:form,field:"name",required:""}}),e._v(" "),r("corals-select",{attrs:{form:form,field:"user_id",label:"User",options:form.getFormData("users")}}),e._v(" "),r("corals-textarea",{attrs:{form:form,label:"Billing Address",field:"properties.billing_address"},model:{value:form.properties.billing_address,callback:function(t){e.$set(form.properties,"billing_address",t)},expression:"form.properties['billing_address']"}}),e._v(" "),r("div",{staticClass:"row"},[r("div",{staticClass:"col-md-6"},[r("corals-select",{attrs:{form:form,field:"bill_cycle",options:e.billCycleOptions}})],1),e._v(" "),r("div",{staticClass:"col-md-6"},["monthly"===form.bill_cycle||"biweekly"===form.bill_cycle?r("corals-input",{attrs:{type:"number",form:form,label:"Start of Cycle",description:"Day of month",field:"bill_cycle_starts_at",min:"1"}}):form.bill_cycle&&"weekly"===form.bill_cycle?r("corals-select",{attrs:{form:form,field:"bill_cycle_starts_at",label:"Start of Cycle",options:e.weekDaysOptions}}):e._e()],1)]),e._v(" "),r("div",{staticClass:"row"},[r("div",{staticClass:"col-md-6"},[r("corals-radio",{attrs:{form:form,field:"status",label:"Status",list:form.getFormData("status_options"),required:""}})],1)])]}}])})],1)}),[],!1,null,"33b4f1ae",null);t.default=component.exports}}]);