-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
787 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.DS_Store | ||
._* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
// This file is part of Moodle - https://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Class egregionalmanager. | ||
* | ||
* @package wbreport_egregionalmanager | ||
* @copyright 2024 Wunderbyte GmbH <[email protected]> | ||
* @author Bernhard Fischer-Sengseis | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
namespace wbreport_egregionalmanager; | ||
|
||
use local_wb_reports\plugininfo\wbreport; | ||
use local_wb_reports\plugininfo\wbreport_interface; | ||
|
||
class egregionalmanager extends wbreport implements wbreport_interface { | ||
// The plugin can implement functions defined in the interface here or extend the general plugin type. | ||
} |
103 changes: 103 additions & 0 deletions
103
wbreport/egregionalmanager/classes/local/table/egregionalmanager_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<?php | ||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
namespace wbreport_egregionalmanager\local\table; | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
global $CFG; | ||
require_once($CFG->libdir.'/tablelib.php'); | ||
|
||
use local_wunderbyte_table\wunderbyte_table; | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
/** | ||
* Definitions for transactionstable iteration of wb_table | ||
*/ | ||
class egregionalmanager_table extends wunderbyte_table { | ||
|
||
/** | ||
* This function is called for each data row to allow processing of the | ||
* "timeaccess" (=last access) value. | ||
* | ||
* @param object $values Contains object with all the values of record. | ||
* @return string a string containing the start date | ||
*/ | ||
public function col_timeaccess($values) { | ||
$lastaccess = $values->timeaccess; | ||
if (empty($lastaccess)) { | ||
return ''; | ||
} | ||
switch (current_language()) { | ||
case 'de': | ||
$renderedlastaccess = date('d.m.Y', $lastaccess); | ||
break; | ||
default: | ||
$renderedlastaccess = date('M d, Y', $lastaccess); | ||
break; | ||
} | ||
return $renderedlastaccess; | ||
} | ||
|
||
/** | ||
* This function is called for each data row to allow processing of the | ||
* "complcount" value. | ||
* | ||
* @param object $values Contains object with all the values of record. | ||
* @return string a string showing the completion count | ||
*/ | ||
public function col_complcount($values) { | ||
$complcount = $values->complcount ?? 0; // Number of completed modules. | ||
$modcount = $values->modcount ?? 0; // Number of modules. | ||
if (empty($complcount) && empty($modcount)) { | ||
return ''; | ||
} | ||
if ($this->is_downloading()) { | ||
return "$complcount/$modcount"; | ||
} | ||
$ret = ''; | ||
if (!empty($complcount) && $complcount > 0) { | ||
$ret .= str_repeat('✅ ', $complcount); | ||
$ret .= str_repeat('◯ ', $modcount - $complcount); | ||
} else if (!empty($modcount) && $modcount > 0) { | ||
$ret .= str_repeat('◯ ', $modcount); | ||
} | ||
|
||
return $ret; | ||
} | ||
|
||
/** | ||
* This function is called for each data row to allow processing of the | ||
* "ispartner" value. | ||
* | ||
* @param object $values Contains object with all the values of record. | ||
* @return string a string showing the completion count | ||
*/ | ||
public function col_ispartner($values) { | ||
$ispartner = $values->ispartner; | ||
if ($this->is_downloading()) { | ||
return $ispartner; | ||
} | ||
if ($ispartner == '1') { | ||
$ret = '✅'; | ||
} else { | ||
$ret = '❌'; | ||
} | ||
|
||
return $ret; | ||
} | ||
} |
Oops, something went wrong.