Example #1
0
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * HUBzero is a registered trademark of Purdue University.
 *
 * @package   hubzero-cms
 * @author    Sam Wilson <*****@*****.**>
 * @copyright Copyright 2005-2015 HUBzero Foundation, LLC.
 * @license   http://opensource.org/licenses/MIT MIT
 */
// No direct access
defined('_HZEXEC_') or die;
\Hubzero\Document\Assets::addSystemScript('jquery.fancyselect.min');
\Hubzero\Document\Assets::addSystemStylesheet('jquery.fancyselect.css');
// Get our asset model
$asset = new \Components\Courses\Models\Asset(Request::getInt('asset_id', null));
$asset->set('section_id', $this->course->offering()->section()->get('id'));
// Get the asset groups
$assetgroups = array();
$assets = array();
foreach ($this->course->offering()->units() as $unit) {
    foreach ($unit->assetgroups() as $agt) {
        foreach ($agt->children() as $ag) {
            $assetgroups[] = array('id' => $ag->get('id'), 'title' => $ag->get('title'));
            foreach ($ag->assets() as $a) {
                if ($a->isPublished()) {
                    $a->set('longTitle', $unit->get('title') . ' - ' . $ag->get('title') . ' - ' . $a->get('title'));
                    $assets[] = $a;
Example #2
0
 * @package   hubzero-cms
 * @author    Sam Wilson <*****@*****.**>
 * @copyright Copyright 2005-2015 HUBzero Foundation, LLC.
 * @license   http://opensource.org/licenses/MIT MIT
 */
use Components\Time\Models\Hub;
use Components\Time\Models\Task;
// No direct access.
defined('_HZEXEC_') or die;
$this->css()->css('overview')->css('fullcalendar')->js('overview');
\Hubzero\Document\Assets::addSystemStylesheet('jquery.fancyselect.css');
\Hubzero\Document\Assets::addSystemScript('flot/jquery.flot.min');
\Hubzero\Document\Assets::addSystemScript('flot/jquery.flot.pie.min');
\Hubzero\Document\Assets::addSystemScript('jquery.fancyselect');
\Hubzero\Document\Assets::addSystemScript('moment.min');
\Hubzero\Document\Assets::addSystemScript('jquery.fullcalendar.min');
HTML::behavior('core');
$utc = Date::of('now');
$now = Date::of($utc)->toLocal(Lang::txt('g:00a'));
$then = Date::of(strtotime($now . ' + 1 hour'))->toLocal(Lang::txt('g:00a'));
$start = Date::of($utc)->toLocal(Lang::txt('G'));
$end = Date::of(strtotime($now . ' + 1 hour'))->toLocal(Lang::txt('G'));
?>

<header id="content-header">
	<h2><?php 
echo $this->title;
?>
</h2>
</header>
Example #3
0
 * THE SOFTWARE.
 *
 * HUBzero is a registered trademark of Purdue University.
 *
 * @package   hubzero-cms
 * @author    Sam Wilson <*****@*****.**>
 * @copyright Copyright 2005-2015 HUBzero Foundation, LLC.
 * @license   http://opensource.org/licenses/MIT MIT
 */
use Components\Time\Models\Proxy;
// No direct access
defined('_HZEXEC_') or die;
\Hubzero\Document\Assets::addSystemScript('jquery.flot.min', 'flot');
\Hubzero\Document\Assets::addSystemScript('jquery.flot.time.min', 'flot');
\Hubzero\Document\Assets::addSystemScript('jquery.flot.stack.min', 'flot');
\Hubzero\Document\Assets::addSystemScript('moment.min');
\Hubzero\Document\Assets::addSystemStylesheet('jquery.ui');
$this->css()->js();
HTML::behavior('core');
// Get the day of the week
$today = Date::of(Request::getVar('week', time()));
$dateofToday = $today->format('Y-m-d');
$dayOfWeek = $today->format('N') - 1;
$mon = Date::of(strtotime("{$dateofToday} - {$dayOfWeek}days"))->toLocal('n/j');
$sun = Date::of(strtotime("{$dateofToday} + " . (6 - $dayOfWeek) . 'days'))->toLocal('n/j');
// Build a list of people that should show up on the bar chart
// We do this because the list returned from the records query
// would not otherwise include folks that didn't enter any records
$people = [['name' => User::get('name'), 'user_id' => User::get('id')]];
foreach (Proxy::whereEquals('proxy_id', User::get('id')) as $proxy) {
    $people[] = ['name' => $proxy->user->name, 'user_id' => $proxy->user_id];
Example #4
0
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * HUBzero is a registered trademark of Purdue University.
 *
 * @package   hubzero-cms
 * @copyright Copyright 2005-2015 HUBzero Foundation, LLC.
 * @license   http://opensource.org/licenses/MIT MIT
 */
// No direct access.
defined('_HZEXEC_') or die;
Html::behavior('framework');
\Hubzero\Document\Assets::addSystemScript('jquery.datetimepicker');
\Hubzero\Document\Assets::addSystemStylesheet('jquery.datetimepicker.css');
$text = $this->task == 'edit' ? Lang::txt('JACTION_EDIT') : Lang::txt('JACTION_CREATE');
$mwdb = \Components\Tools\Helpers\Utils::getMWDBO();
$zones = with(new \Components\Tools\Tables\Zones($mwdb))->find('all');
?>

<script>
function submitbutton(pressbutton)
{
	var form = document.adminForm;

	if (pressbutton == 'cancel') {
		submitform(pressbutton);
		return;
	}
Example #5
0
 * THE SOFTWARE.
 *
 * HUBzero is a registered trademark of Purdue University.
 *
 * @package   hubzero-cms
 * @author    Sam Wilson <*****@*****.**>
 * @copyright Copyright 2005-2015 HUBzero Foundation, LLC.
 * @license   http://opensource.org/licenses/MIT MIT
 */
use Components\Time\Models\Hub;
use Components\Time\Models\Task;
// No direct access
defined('_HZEXEC_') or die;
\Hubzero\Document\Assets::addSystemScript('select2');
\Hubzero\Document\Assets::addSystemScript('jquery.flot.min', 'flot');
\Hubzero\Document\Assets::addSystemScript('jquery.flot.time.min', 'flot');
\Hubzero\Document\Assets::addSystemStylesheet('select2');
\Hubzero\Document\Assets::addSystemStylesheet('jquery.ui');
$this->css()->js();
HTML::behavior('core');
$base = 'index.php?option=com_time&controller=reports';
?>

<div class="plg_time_summary">
	<div class="filters">
		<form action="<?php 
echo Route::url($base);
?>
">
			<input type="hidden" name="report_type" value="summary" />
			<div class="grouping">
Example #6
0
 *
 * @package   hubzero-cms
 * @author    Sam Wilson <*****@*****.**>
 * @copyright Copyright 2005-2015 HUBzero Foundation, LLC.
 * @license   http://opensource.org/licenses/MIT MIT
 */
// No direct access.
defined('_HZEXEC_') or die;
// Get and add the js and extra css to the page
\Hubzero\Document\Assets::addComponentStylesheet('com_users', 'login.css');
\Hubzero\Document\Assets::addComponentStylesheet('com_users', 'providers.css');
\Hubzero\Document\Assets::addComponentScript('com_users', 'login');
\Hubzero\Document\Assets::addSystemStylesheet('uniform.css');
\Hubzero\Document\Assets::addSystemScript('jquery.uniform');
\Hubzero\Document\Assets::addSystemScript('jquery.hoverIntent');
\Hubzero\Document\Assets::addSystemScript('placeholder');
$hash = App::hash(App::get('client')->name . ':authenticator');
if (($cookie = \Hubzero\Utility\Cookie::eat('authenticator')) && !Request::getInt('reset', false)) {
    $primary = $cookie->authenticator;
    // Make sure primary is still enabled
    if (array_key_exists($primary, $this->authenticators) || isset($this->local) && $this->local && $primary == 'hubzero') {
        if (isset($cookie->user_id)) {
            $user = User::getInstance($cookie->user_id);
            $user_img = $cookie->user_img;
            Request::setVar('primary', $primary);
        }
    }
}
$usersConfig = Component::params('com_members');
$primary = Request::getWord('primary', false);
// use some reflections to inspect plugins for special behavior (added for shibboleth)
Example #7
0
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * HUBzero is a registered trademark of Purdue University.
 *
 * @package   hubzero-cms
 * @author    Sam Wilson <*****@*****.**>
 * @copyright Copyright 2005-2015 HUBzero Foundation, LLC.
 * @license   http://opensource.org/licenses/MIT MIT
 */
use Components\Time\Models\Hub;
// No direct access
defined('_HZEXEC_') or die;
\Hubzero\Document\Assets::addSystemScript('select2');
\Hubzero\Document\Assets::addSystemStylesheet('select2');
\Hubzero\Document\Assets::addSystemStylesheet('jquery.ui');
$this->css()->js();
$options = array();
$base = 'index.php?option=com_time&controller=reports';
// If no incoming fields vars selected, we'll assume we should show all
$all = true;
foreach (Request::query() as $key => $value) {
    if (strpos($key, 'fields-') !== false) {
        $all = false;
    }
}
?>

<div class="plg_time_csv">
Example #8
0
    /**
     * Return data on a resource view (this will be some form of HTML)
     *
     * @param      object  $resource Current resource
     * @param      string  $option    Name of the component
     * @param      array   $areas     Active area(s)
     * @param      string  $rtrn      Data to be returned
     * @return     array
     */
    public function onResources($model, $option, $areas, $rtrn = 'all')
    {
        $arr = array('area' => $this->_name, 'html' => '', 'metadata' => '');
        // Check if our area is in the array of areas we want to return results for
        if (is_array($areas)) {
            if (!array_intersect($areas, $this->onResourcesAreas($model)) && !array_intersect($areas, array_keys($this->onResourcesAreas($model)))) {
                $rtrn = 'metadata';
            }
        }
        if (!is_null($enabled = $model->type->params->get('plg_classrooms')) && !$enabled) {
            return $arr;
        }
        // Are we returning HTML?
        if ($rtrn == 'all' || $rtrn == 'html') {
            $arr['html'] = array('<div id="no-usage"><p class="warning">' . Lang::txt('PLG_RESOURCES_CLASSROOMS_NO_DATA_FOUND') . '</p></div>');
            if (self::any($model->resource->alias)) {
                \Hubzero\Document\Assets::addPluginStyleSheet($this->_type, $this->_name);
                \Hubzero\Document\Assets::addPluginScript($this->_type, $this->_name);
                \Hubzero\Document\Assets::addSystemScript('d3.v2.js');
                $dbh = App::get('db');
                $tool = $dbh->quote($model->resource->alias);
                $dbh->setQuery('SELECT DISTINCT
					c2.toolname AS tool,
					c2.clustersize AS size,
					YEAR(c2.cluster_start) AS year,
					c2.cluster_start,
					c2.cluster_end,
					c2.first_use,
					SUBSTRING_INDEX(c2.cluster, \'|\', 1) AS semester,
					CONCAT(SUBSTRING_INDEX(c2.cluster, \'|\', 1), \'|\', SUBSTRING_INDEX(c2.cluster, \'|\', -2)) AS cluster,
					SHA1(CONCAT(c2.uidNumber, ' . $dbh->quote(uniqid()) . ')) AS uid
					FROM
					(SELECT DISTINCT cluster FROM #__resource_stats_clusters WHERE toolname = ' . $tool . ') AS ct,
					#__resource_stats_clusters AS c2
					WHERE ct.cluster = c2.cluster');
                $nodes = array();
                foreach ($dbh->loadAssocList() as $row) {
                    if (!isset($nodes[$row['semester']])) {
                        $nodes[$row['semester']] = array();
                    }
                    foreach (array('cluster_start', 'cluster_end', 'first_use') as $dateCol) {
                        $row[$dateCol] = date('r', strtotime($row[$dateCol]));
                    }
                    $nodes[$row['semester']][] = $row;
                }
                $arr['html'][] = '<span id="cluster-data" data-tool="' . str_replace('"', '&quot;', $model->resource->alias) . '" data-seed="' . str_replace('"', '&quot;', json_encode(array_values($nodes))) . '"></span>';
            }
            $arr['html'] = implode("\n", $arr['html']);
        }
        return $arr;
    }