diff --git a/application/views/lehre/lehrauftrag/acceptLehrauftragData.php b/application/views/lehre/lehrauftrag/acceptLehrauftragData.php new file mode 100644 index 000000000..c6bd65198 --- /dev/null +++ b/application/views/lehre/lehrauftrag/acceptLehrauftragData.php @@ -0,0 +1,292 @@ + $query, + 'app' => LehrauftragAkzeptieren::APP, + 'datasetName' => 'lehrauftragAccept', + 'filterKurzbz' => 'LehrauftragAccept', + 'requiredPermissions' => 'lehre', // TODO: change permission + 'datasetRepresentation' => 'tabulator', + 'reloadDataset' => true, // reload query on page refresh + 'customMenu' => false, + 'hideOptions' => true, + 'hideMenu' => true, + 'columnsAliases' => array( // TODO: use phrasen + 'row_index', + 'LE-ID', + 'LV-ID', + 'PA-ID', + 'Studiensemester', + 'Studiengang-KZ', + 'Studiengang', + 'Person-ID', + 'Typ', + 'Auftrag', + 'Organisationseinheit', + 'Gruppe', + 'Stunden', + 'Betrag', + 'Vertrag-ID', + 'UID', + 'Bestellt', + 'Erteilt', + 'Akzeptiert' + ), + 'datasetRepOptions' => '{ + height: 550, + layout: "fitColumns", // fit columns to width of table + responsiveLayout: "hide", // hide columns that dont fit on the table + movableColumns: true, // allows changing column + headerFilterPlaceholder: " ", + index: "row_index", // assign specific column as unique id (important for row indexing) + selectable: true, // allow row selection + selectableRangeMode: "click", // allow range selection using shift end click on end of range + selectablePersistence:false, // deselect previously selected rows when table is filtered, sorted or paginated + selectableCheck: function(row) + { + // only allow to select bestellte Lehraufträge + return row.getData().bestellt != null && row.getData().erteilt != null; + }, + rowUpdated:function(row) + { + // deselect and disable new selection of updated rows (approvement done) + row.deselect(); + row.getElement().off("click"); + }, + rowFormatter:function(row) + { + var data = row.getData(); + + // default (white): rows to be accepted + // green: rows accepted + // grey: all other + if(row.getData().bestellt != null && row.getData().erteilt != null && row.getData().akzeptiert == null) + { + return; + } + else if(row.getData().bestellt != null && row.getData().erteilt != null && row.getData().akzeptiert != null) + { + row.getElement().style["background-color"] = "#d1f1d196"; // green + } + else + { + row.getElement().style["background-color"] = "#f5f5f5"; // grey + } + } + }', // tabulator properties + 'datasetRepFieldsDefs' => '{ + row_index: {visible:false}, // necessary for row indexing + lehreinheit_id: {headerFilter:"input", bottomCalc:"count", bottomCalcFormatter:function(cell){return "Anzahl: " + cell.getValue();}, width: "7%"}, + lehrveranstaltung_id: {headerFilter:"input", width: "5%"}, + projektarbeit_id: {visible: false}, + studiensemester_kurzbz: {visible: false}, + studiengang_kz: {visible: false}, + stg_oe_kurzbz: {headerFilter:"input", width: "5%"}, + person_id: {visible: false}, + typ: {headerFilter:"input", width: "7%"}, + auftrag: {headerFilter:"input", width: "23%"}, + lv_oe_kurzbz: {headerFilter:"input", width: "12%"}, + gruppe: {headerFilter:"input", width: "5%"}, + stunden: {align:"right", headerFilter:"input", bottomCalc:"sum", bottomCalcParams:{precision:1}, width: "5%"}, + betrag: {align:"right", headerFilter:"input", headerFilterPlaceholder:">=", headerFilterFunc: hf_compareWithFloat, + bottomCalc:"sum", bottomCalcParams:{precision:2}, bottomCalcFormatter:"money", bottomCalcFormatterParams:{decimal: ",", thousand: ".", symbol:"€"}, + width: "8%"}, + vertrag_id: {visible: false}, + mitarbeiter_uid: {visible: false}, + bestellt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate}, width: "auto", + erteilt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate}, width: "auto", + akzeptiert: {align:"center", headerFilter:"input", mutator: mut_formatStringDate}, width: "auto" + }', // col properties +); + +echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray); + +?> +