diff --git a/amd/build/treestudyplan-components.min.js b/amd/build/treestudyplan-components.min.js index d7f02eb..3c8ea44 100644 --- a/amd/build/treestudyplan-components.min.js +++ b/amd/build/treestudyplan-components.min.js @@ -1,3 +1,3 @@ -define("local_treestudyplan/treestudyplan-components",["exports","./util/string-helper","./util/date-helper","./util/fittext-vue"],(function(_exports,_stringHelper,_dateHelper,_fittextVue){var obj;Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_fittextVue=(obj=_fittextVue)&&obj.__esModule?obj:{default:obj};var _default={install(Vue){Vue.use(_fittextVue.default);let strings=(0,_stringHelper.loadStrings)({studyplancard:{open:"open",noenddate:"noenddate",idnumber:"studyplan_idnumber",description:"studyplan_description",completed:"completed",details:"studyplan_details",suspended:"suspended"},details:{details:"studyplan_details"},extrafields:{show:"show@core"},prevnext:{prev:"prev@core",previous:"previous@core",next:"next@core",select:"selectanoptions@core"}});const ItemEventBus=new Vue;Vue.component("s-studyplan-card",{props:{value:{type:Object},open:{type:Boolean},ignoresuspend:{type:Boolean,default:!1}},data:()=>({text:strings.studyplancard}),computed:{timeless(){const plan=this.value;return!(plan.pages&&0!=plan.pages.length&&!plan.pages[0].timeless)},timing(){return(0,_dateHelper.studyplanTiming)(this.value)},dates(){const dates=(0,_dateHelper.studyplanDates)(this.value);return{start:(0,_dateHelper.formatDate)(dates.start),end:dates.end?(0,_dateHelper.formatDate)(dates.end):this.text.noenddate}},suspended(){return this.value.suspended&&!this.ignoresuspend}},methods:{onOpenClick(e){this.$emit("open",e)}},template:"\n \n \n \n
\n
\n
\n
\n \n {{value.name}}\n \n
{{text.suspended}}
\n
\n
\n
\n
\n {{ text.idnumber }}: {{ value.idnumber }}\n
\n \n
\n \n
\n \n \n \n "}),Vue.component("s-progress-bar",{props:{value:{type:Number},min:{type:Number,default:()=>0},max:{type:Number,default:()=>1}},data:()=>({text:strings.studyplancard}),computed:{width_completed(){if(this.value){return 100*((this.value-this.min)/(this.max-this.min))}return 0},width_incomplete(){if(this.value){return 100*(1-(this.value-this.min)/(this.max-this.min))}return 100},percentage_complete(){if(this.value){const v=(this.value-this.min)/(this.max-this.min);return Math.round(100*v)+"%"}return"0%"}},template:"\n
\n
0\"\n :style=\"{width: width_completed+'%'}\"\n class='s-studyplan-card-progress-segment s-studyplan-card-progress-completed'\n >
\n
\n {{ percentage_complete}} {{ text.completed.toLowerCase() }} \n
\n
\n "}),Vue.component("s-studyline-header-heading",{props:{identifier:{type:Number,default:()=>0}},data:()=>({layerHeights:{}}),created(){ItemEventBus.$on("headerHeightChange",this.onHeaderHeightChange)},computed:{},methods:{onHeaderHeightChange(newheight,identifier){this.identifier==identifier&&this.$refs.main&&(this.$refs.main.style.height=`${newheight}px`)}},template:'\n
\n '}),Vue.component("s-studyline-header-period",{props:{value:{type:Object},identifier:{type:Number,default:()=>0},mode:{type:String,default:"view"}},mounted(){const self=this;1==self.value.period&&(self.resizeListener=new ResizeObserver((()=>{if(self.$refs.main){const size=self.$refs.main.getBoundingClientRect();ItemEventBus.$emit("headerHeightChange",size.height,self.identifier)}})).observe(self.$refs.main))},unmounted(){this.resizeListener&&this.resizeListener.disconnect()},computed:{startdate(){return(0,_dateHelper.formatDate)(this.value.startdate)},enddate(){return(0,_dateHelper.formatDate)(this.value.enddate)},current(){if(this.value&&this.value.startdate&&this.value.enddate){const now=new Date,pstart=new Date(this.value.startdate),pend=new Date(this.value.enddate);return now>=pstart&&now({}),template:'\n

{{ value.shortname }}\n {{ value.fullname }}
\n \n {{ startdate }} - {{ enddate }}\n \n \n

\n {{ startdate }}\n - {{ enddate }}\n

\n
\n
\n '}),Vue.component("s-studyplan-details",{props:{value:{type:Object},variant:{type:String,default:()=>"info"},pill:{type:Boolean,default:()=>!1},size:{type:String,default:()=>""}},data:()=>({text:strings.details}),template:'\n \n \n {{ text.details}}\n \n \n \n \n \n \n \n \n \n \n \n \n '}),Vue.component("s-course-extrafields",{props:{value:{type:Array},variant:{type:String,default:()=>"info"},position:{type:String,default:()=>"below"},size:{type:String,default:()=>""}},data:()=>({text:strings.extrafields}),computed:{fields(){const fields=[];for(const ix in this.value){const field=this.value[ix];field.position==this.position&&field.value&&field.value.length>0&&fields.push(field)}return fields}},methods:{displaydate:field=>(0,_dateHelper.formatDate)(field.value,!1)},template:'\n
\n \n \n \n \n \n
{{ field.title}}\n {{ displaydate(field) }}\n {{ field.value }}\n \n {{text.show}}...\n \n \n \n
\n
\n '}),Vue.component("s-prevnext-selector",{props:{value:{type:Object,default:()=>null},options:{type:Array},grouped:{type:Boolean,default:!1},titlefield:{type:String,default:"title"},labelfield:{type:String,default:"label"},optionsfield:{type:String,default:"options"},defaultselectable:{type:Boolean,default:!1},variant:{type:String,default:""},arrows:{type:Boolean,default:!1}},data:()=>({text:strings.prevnext}),computed:{fields(){const f=[];if(this.defaultselectable&&f.push(null),this.grouped)for(const gix in this.options){const group=this.options[gix];for(const ix in group[this.optionsfield]){const v=group[this.optionsfield][ix];f.push(v)}}else for(const ix in this.options){const v=this.options[ix];f.push(v)}return f},bubblevalue:{get(){return this.value?this.value:null},set(v){this.$emit("input",v||null)}}},methods:{atFirst(){return!(this.fields.length>0)||this.fields[0]==this.value},atLast(){if(this.fields.length>0){const l=this.fields.length-1;return this.fields[l]==this.value}return!0},prev(){if(this.fields.length>0){const index=this.fields.indexOf(this.value);index>0&&(this.$emit("input",this.fields[index-1]),this.$emit("change",this.fields[index-1]))}},next(){if(this.fields.length>0){const index=this.fields.indexOf(this.value),l=this.fields.length-1;index>=0&&index\n \n \n {{text.select}}\n \n \n \n \n \n \n '})}};return _exports.default=_default,_exports.default})); +define("local_treestudyplan/treestudyplan-components",["exports","./util/string-helper","./util/date-helper","./util/fittext-vue","./util/settings"],(function(_exports,_stringHelper,_dateHelper,_fittextVue,_settings){var obj;Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_fittextVue=(obj=_fittextVue)&&obj.__esModule?obj:{default:obj};var _default={install(Vue){Vue.use(_fittextVue.default);let strings=(0,_stringHelper.loadStrings)({studyplancard:{open:"open",noenddate:"noenddate",idnumber:"studyplan_idnumber",description:"studyplan_description",completed:"completed",details:"studyplan_details",suspended:"suspended"},details:{details:"studyplan_details"},extrafields:{show:"show@core"},prevnext:{prev:"prev@core",previous:"previous@core",next:"next@core",select:"selectanoptions@core"}});const ItemEventBus=new Vue;Vue.component("s-studyplan-card",{props:{value:{type:Object},open:{type:Boolean},ignoresuspend:{type:Boolean,default:!1}},data:()=>({text:strings.studyplancard}),computed:{timeless(){const plan=this.value;return!(plan.pages&&0!=plan.pages.length&&!plan.pages[0].timeless)},timing(){return(0,_dateHelper.studyplanTiming)(this.value)},dates(){const dates=(0,_dateHelper.studyplanDates)(this.value);return{start:(0,_dateHelper.formatDate)(dates.start),end:dates.end?(0,_dateHelper.formatDate)(dates.end):this.text.noenddate}},suspended(){return this.value.suspended&&!this.ignoresuspend}},methods:{onOpenClick(e){this.$emit("open",e)}},template:"\n \n \n \n
\n
\n
\n
\n \n {{value.name}}\n \n
{{text.suspended}}
\n
\n
\n
\n
\n {{ text.idnumber }}: {{ value.idnumber }}\n
\n \n
\n \n
\n \n \n \n "}),Vue.component("s-progress-bar",{props:{value:{type:Number},min:{type:Number,default:()=>0},max:{type:Number,default:()=>1}},data:()=>({text:strings.studyplancard}),computed:{width_completed(){if(this.value){return 100*((this.value-this.min)/(this.max-this.min))}return 0},width_incomplete(){if(this.value){return 100*(1-(this.value-this.min)/(this.max-this.min))}return 100},percentage_complete(){if(this.value){const v=(this.value-this.min)/(this.max-this.min);return Math.round(100*v)+"%"}return"0%"}},template:"\n
\n
0\"\n :style=\"{width: width_completed+'%'}\"\n class='s-studyplan-card-progress-segment s-studyplan-card-progress-completed'\n >
\n
\n {{ percentage_complete}} {{ text.completed.toLowerCase() }} \n
\n
\n "}),Vue.component("s-studyline-header-heading",{props:{identifier:{type:Number,default:()=>0}},data:()=>({layerHeights:{}}),created(){ItemEventBus.$on("headerHeightChange",this.onHeaderHeightChange)},computed:{},methods:{onHeaderHeightChange(newheight,identifier){this.identifier==identifier&&this.$refs.main&&(this.$refs.main.style.height=`${newheight}px`)}},template:'\n
\n '}),Vue.component("s-studyline-header-period",{props:{value:{type:Object},identifier:{type:Number,default:()=>0},mode:{type:String,default:"view"}},mounted(){const self=this;1==self.value.period&&(self.resizeListener=new ResizeObserver((()=>{if(self.$refs.main){const size=self.$refs.main.getBoundingClientRect();ItemEventBus.$emit("headerHeightChange",size.height,self.identifier)}})).observe(self.$refs.main))},unmounted(){this.resizeListener&&this.resizeListener.disconnect()},computed:{startdate(){return(0,_dateHelper.formatDate)(this.value.startdate)},enddate(){return(0,_dateHelper.formatDate)(this.value.enddate)},current(){if(this.value&&this.value.startdate&&this.value.enddate){const now=new Date,pstart=new Date(this.value.startdate),pend=new Date(this.value.enddate);return now>=pstart&&now({}),template:'\n

{{ value.shortname }}\n {{ value.fullname }}
\n \n {{ startdate }} - {{ enddate }}\n \n \n

\n {{ startdate }}\n - {{ enddate }}\n

\n
\n
\n '}),Vue.component("s-studyplan-details",{props:{value:{type:Object},variant:{type:String,default:()=>"info"},pill:{type:Boolean,default:()=>!1},size:{type:String,default:()=>""}},data:()=>({text:strings.details}),template:'\n \n \n {{ text.details}}\n \n \n \n \n \n \n \n \n \n \n \n \n '}),Vue.component("s-course-extrafields",{props:{value:{type:Array},variant:{type:String,default:()=>"info"},position:{type:String,default:()=>"below"},size:{type:String,default:()=>""}},data:()=>({text:strings.extrafields}),computed:{fields(){const fields=[];for(const ix in this.value){const field=this.value[ix];field.position==this.position&&field.value&&field.value.length>0&&fields.push(field)}return fields}},methods:{displaydate:field=>(0,_dateHelper.formatDate)(field.value,!1)},template:'\n
\n \n \n \n \n \n
{{ field.title}}\n {{ displaydate(field) }}\n {{ field.value }}\n \n {{text.show}}...\n \n \n \n
\n
\n '}),Vue.component("s-prevnext-selector",{props:{value:{type:Object,default:()=>null},options:{type:Array},grouped:{type:Boolean,default:!1},titlefield:{type:String,default:"title"},labelfield:{type:String,default:"label"},optionsfield:{type:String,default:"options"},defaultselectable:{type:Boolean,default:!1},variant:{type:String,default:""},arrows:{type:Boolean,default:!1}},data:()=>({showarrows:(0,_settings.settings)("showprevnextarrows"),text:strings.prevnext}),computed:{fields(){const f=[];if(this.defaultselectable&&f.push(null),this.grouped)for(const gix in this.options){const group=this.options[gix];for(const ix in group[this.optionsfield]){const v=group[this.optionsfield][ix];f.push(v)}}else for(const ix in this.options){const v=this.options[ix];f.push(v)}return f},bubblevalue:{get(){return this.value?this.value:null},set(v){this.$emit("input",v||null)}}},methods:{atFirst(){return!(this.fields.length>0)||this.fields[0]==this.value},atLast(){if(this.fields.length>0){const l=this.fields.length-1;return this.fields[l]==this.value}return!0},prev(){if(this.fields.length>0){const index=this.fields.indexOf(this.value);index>0&&(this.$emit("input",this.fields[index-1]),this.$emit("change",this.fields[index-1]))}},next(){if(this.fields.length>0){const index=this.fields.indexOf(this.value),l=this.fields.length-1;index>=0&&index\n - - `, }); diff --git a/lang/en/local_treestudyplan.php b/lang/en/local_treestudyplan.php index 459aff5..0c7cb13 100644 --- a/lang/en/local_treestudyplan.php +++ b/lang/en/local_treestudyplan.php @@ -128,12 +128,12 @@ $string["settingdesc_infofields_heading"] = 'Select up to 5 fields or custom fie $string["setting_hivizdropslots"] = 'High visibility drop fields'; $string["settingdesc_hivizdropslots"] = 'Give the drop fields when editing a study plan extra visibility.'; - $string["setting_toolboxleft"] = 'Toolbar left side by default'; $string["settingdesc_toolboxleft"] = 'Show the course and component toolbar on the left by default, instead of the right side of the screen.'; - $string["setting_toolboxcoursesonly"] = 'Show only the courses in the toolbox'; $string["settingdesc_toolboxcoursesonly"] = 'Hide the badges and flow tabs in the toolbox and show only the courses.'; +$string["setting_showprevnextarrows"] = 'Show arrows next to student selector dropdowns'; +$string["settingdesc_showprevnextarrows"] = 'Show arrows for previous and next student in the student selector in coach and view mode.'; $string["drophere"] = "Drop here"; $string["infofield_position_above"] = 'Above course results'; diff --git a/lang/nl/local_treestudyplan.php b/lang/nl/local_treestudyplan.php index d90090f..e2b4454 100644 --- a/lang/nl/local_treestudyplan.php +++ b/lang/nl/local_treestudyplan.php @@ -128,12 +128,12 @@ $string["settingdesc_infofields_heading"] = 'Kies tot 5 extra velden om in het c $string["setting_hivizdropslots"] = 'Extra zichtbare sleepvelden'; $string["settingdesc_hivizdropslots"] = 'Maak de velden waar cursussen heen gesleept kunnen worden extra goed zichtbaar.'; - $string["setting_toolboxleft"] = 'Toolbox standaard links'; $string["settingdesc_toolboxleft"] = 'Toon de toolbox met cursussen en componenten standaard links in plaats van rechts.'; - $string["setting_toolboxcoursesonly"] = 'Toon alleen cursussen in toolbox'; $string["settingdesc_toolboxcoursesonly"] = 'Verberg de tabbladen "flow" en "badges" in de toolbox en toon alleen de cursussen.'; +$string["setting_showprevnextarrows"] = 'Toon pijltjes naast de studentselectie drop-down'; +$string["settingdesc_showprevnextarrows"] = 'Laat pijltjes zien voor de vorige en volgende student naast de drop-down box om een student te selecteren.'; $string["drophere"] = "Sleep hierheen"; $string["infofield_position_above"] = 'Boven cursusresultaten'; diff --git a/settings.php b/settings.php index 86b45fd..8f978f4 100644 --- a/settings.php +++ b/settings.php @@ -150,6 +150,12 @@ if ($hassiteconfig) { false, )); + $page->add(new admin_setting_configcheckbox('local_treestudyplan/showprevnextarrows', + get_string('setting_showprevnextarrows', 'local_treestudyplan'), + get_string('settingdesc_showprevnextarrows', 'local_treestudyplan'), + true, + )); + $page->add(new admin_setting_configcheckbox('local_treestudyplan/copystudylinesnewpage', get_string('setting_copystudylinesnewpage', 'local_treestudyplan'), get_string('settingdesc_copystudylinesnewpage', 'local_treestudyplan'), @@ -234,6 +240,7 @@ if ($hassiteconfig) { get_string('setting_competency_heading', 'local_treestudyplan'), get_string('settingdesc_competency_heading', 'local_treestudyplan') )); + $page->add(new admin_setting_configtext('local_treestudyplan/competency_thresh_completed', get_string('setting_competency_thresh_completed', 'local_treestudyplan'), get_string('settingdesc_competency_thresh_completed', 'local_treestudyplan'),