mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-20 09:58:04 +02:00
Get resources available in sitemgr planner module
This commit is contained in:
parent
b28792ffaf
commit
c49dc59ab3
@ -166,15 +166,20 @@ class module_calendar_planner extends Module
|
|||||||
}
|
}
|
||||||
|
|
||||||
$calendar_bo = new calendar_bo();
|
$calendar_bo = new calendar_bo();
|
||||||
foreach ($calendar_bo->resources as $resource)
|
$query = '';
|
||||||
|
$options = array('start' => 0, 'num_rows' => 50);
|
||||||
|
foreach ($calendar_bo->resources as $type => $data)
|
||||||
{
|
{
|
||||||
if(!is_array($resource['cal_sidebox'])) continue;
|
if ($type != '' && $data['app'] && egw_link::get_registry($data['app'], 'query'))
|
||||||
$this->arguments['resources']['options'] = array_merge($this->arguments['resources']['options'],
|
{
|
||||||
ExecMethod($resource['cal_sidebox']['file'],array(
|
$_results = egw_link::query($data['app'], $query,$options);
|
||||||
'menuaction' => $_GET['menuaction'],
|
}
|
||||||
'block_id' => $_GET['block_id'],
|
if(!$_results) continue;
|
||||||
'return_array' => true,
|
$_results = array_unique($_results);
|
||||||
)));
|
foreach ($_results as $key => $value)
|
||||||
|
{
|
||||||
|
$this->arguments['resources']['options'][$type.$key] = $value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$this->arguments['resources']['multiple'] = count($this->arguments['resources']['options']) ? 4 : 0;
|
$this->arguments['resources']['multiple'] = count($this->arguments['resources']['options']) ? 4 : 0;
|
||||||
|
|
||||||
@ -245,7 +250,7 @@ class module_calendar_planner extends Module
|
|||||||
$ui = new calendar_uiviews();
|
$ui = new calendar_uiviews();
|
||||||
$ui->sortby = $arguments['sortby'];
|
$ui->sortby = $arguments['sortby'];
|
||||||
$ui->owner = $params['owner'];
|
$ui->owner = $params['owner'];
|
||||||
|
|
||||||
if (!$ui->planner_view || $ui->planner_view == 'month') // planner monthview
|
if (!$ui->planner_view || $ui->planner_view == 'month') // planner monthview
|
||||||
{
|
{
|
||||||
if ($ui->day < 15) // show one complete month
|
if ($ui->day < 15) // show one complete month
|
||||||
@ -292,13 +297,13 @@ class module_calendar_planner extends Module
|
|||||||
|
|
||||||
$tmpl->setElementAttribute('planner','start_date', egw_time::to($ui->first, egw_time::ET2));
|
$tmpl->setElementAttribute('planner','start_date', egw_time::to($ui->first, egw_time::ET2));
|
||||||
$tmpl->setElementAttribute('planner','end_date', egw_time::to($ui->last, egw_time::ET2));
|
$tmpl->setElementAttribute('planner','end_date', egw_time::to($ui->last, egw_time::ET2));
|
||||||
$tmpl->setElementAttribute('planner','owner', $search_params['users']);
|
$tmpl->setElementAttribute('planner','owner', $search_params['owner']);
|
||||||
$tmpl->setElementAttribute('planner','group_by', $ui->sortby);
|
$tmpl->setElementAttribute('planner','group_by', $ui->sortby);
|
||||||
$tmpl->exec(__METHOD__, $content,array(), array('__ALL__' => true),array(),2);
|
$tmpl->exec(__METHOD__, $content,array(), array('__ALL__' => true),array(),2);
|
||||||
$html .= ob_get_contents();
|
$html .= ob_get_contents();
|
||||||
$html .= '<script>'
|
$html .= '<script>'
|
||||||
. '$j(function() {app.calendar.set_state(' . json_encode(array(
|
. '$j(function() {app.calendar.set_state(' . json_encode(array(
|
||||||
'owner' => $search_params['users'],
|
'owner' => $search_params['owner'],
|
||||||
'sortby' => $ui->sortby,
|
'sortby' => $ui->sortby,
|
||||||
'filter' => $arguments['filter']
|
'filter' => $arguments['filter']
|
||||||
)).');'
|
)).');'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user