mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 12:39:25 +01:00
* Projectmanager: Add calendar integration so projects can be shown as events in calendar
This commit is contained in:
parent
bff73eb0b6
commit
26595b4cba
@ -119,22 +119,22 @@ class Etemplate extends Etemplate\Widget\Template
|
|||||||
{
|
{
|
||||||
if (!empty($extra['data']) && is_array($extra['data']))
|
if (!empty($extra['data']) && is_array($extra['data']))
|
||||||
{
|
{
|
||||||
$content = array_merge($content, $extra['data']);
|
$content = array_merge_recursive($content, $extra['data']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($extra['preserve']) && is_array($extra['preserve']))
|
if (!empty($extra['preserve']) && is_array($extra['preserve']))
|
||||||
{
|
{
|
||||||
$preserv = array_merge($preserv, $extra['preserve']);
|
$preserv = array_merge_recursive($preserv, $extra['preserve']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($extra['readonlys']) && is_array($extra['readonlys']))
|
if (!empty($extra['readonlys']) && is_array($extra['readonlys']))
|
||||||
{
|
{
|
||||||
$readonlys = array_merge($readonlys, $extra['readonlys']);
|
$readonlys = array_merge_recursive($readonlys, $extra['readonlys']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($extra['sel_options']) && is_array($extra['sel_options']))
|
if (!empty($extra['sel_options']) && is_array($extra['sel_options']))
|
||||||
{
|
{
|
||||||
$sel_options = array_merge($sel_options, $extra['sel_options']);
|
$sel_options = array_merge_recursive($sel_options, $extra['sel_options']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -578,9 +578,9 @@ class calendar_ui
|
|||||||
// ignore failed discovery
|
// ignore failed discovery
|
||||||
unset($e);
|
unset($e);
|
||||||
}
|
}
|
||||||
if ($GLOBALS['egw_info']['user']['preferences']['calendar']['document_dir'])
|
if($GLOBALS['egw_info']['user']['preferences']['calendar']['document_dir'])
|
||||||
{
|
{
|
||||||
$sel_options['merge'] = calendar_merge::get_documents($GLOBALS['egw_info']['user']['preferences']['calendar']['document_dir'], '', null,'calendar');
|
$sel_options['merge'] = calendar_merge::get_documents($GLOBALS['egw_info']['user']['preferences']['calendar']['document_dir'], '', null, 'calendar');
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -588,6 +588,22 @@ class calendar_ui
|
|||||||
$readonlys['merge'] = true;
|
$readonlys['merge'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add integration UI into sidemenu
|
||||||
|
$integration_data = Api\Hooks::process(array('location' => 'calendar_search_union'));
|
||||||
|
foreach($integration_data as $app => $app_hooks)
|
||||||
|
{
|
||||||
|
foreach($app_hooks as $data)
|
||||||
|
{
|
||||||
|
// App might have multiple hooks, let it specify something else
|
||||||
|
$app = $data['selects']['app'] ?: $app;
|
||||||
|
|
||||||
|
if(array_key_exists('sidebox_template', $data))
|
||||||
|
{
|
||||||
|
$cont['integration'][] = ['template' => $data['sidebox_template'], 'app' => $app];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Sidebox?
|
// Sidebox?
|
||||||
$sidebox->exec('calendar.calendar_ui.sidebox_etemplate', $cont, $sel_options, $readonlys);
|
$sidebox->exec('calendar.calendar_ui.sidebox_etemplate', $cont, $sel_options, $readonlys);
|
||||||
}
|
}
|
||||||
|
@ -21,20 +21,45 @@ var change = {date: today.toJSON()};
|
|||||||
app.calendar.update_state(change);
|
app.calendar.update_state(change);
|
||||||
widget.getRoot().getWidgetById('date').set_value(today);
|
widget.getRoot().getWidgetById('date').set_value(today);
|
||||||
return false;"/>
|
return false;"/>
|
||||||
<buttononly id="header_go" label="↵" icon="nope" class="ui-corner-all" onclick="var change = {date: widget.btn.attr('data-date')}; if ( app.calendar.state.view == 'listview') {change.filter='month';} else if (app.calendar.state.view == 'planner') {} else {change.view = 'month';}app.calendar.update_state(change);" />
|
<buttononly id="header_go" label="↵" icon="nope" class="ui-corner-all"
|
||||||
|
onclick="var change = {date: widget.btn.attr('data-date')}; if ( app.calendar.state.view == 'listview') {change.filter='month';} else if (app.calendar.state.view == 'planner') {} else {change.view = 'month';}app.calendar.update_state(change);"/>
|
||||||
<date id="date" class="et2_fullWidth" inline="true" onchange="var view_change = app.calendar.sidebox_changes_views.indexOf(app.calendar.state.view);
|
<date id="date" class="et2_fullWidth" inline="true" onchange="var view_change = app.calendar.sidebox_changes_views.indexOf(app.calendar.state.view);
|
||||||
var update = {date:widget.getValue()};
|
var update = {date:widget.getValue()};
|
||||||
if(view_change >= 0) {update.view = app.calendar.sidebox_changes_views[view_change ? view_change - 1 : view_change];} else if (app.calendar.state.view == 'listview') {update.filter = 'after';} else if (app.calendar.state.view =='planner') { update.planner_view = 'day'; } app.calendar.update_state(update);"/>
|
if(view_change >= 0) {update.view = app.calendar.sidebox_changes_views[view_change ? view_change - 1 : view_change];} else if (app.calendar.state.view == 'listview') {update.filter = 'after';} else if (app.calendar.state.view =='planner') { update.planner_view = 'day'; } app.calendar.update_state(update);"/>
|
||||||
<textbox type="hidden" id="first"/>
|
<textbox type="hidden" id="first"/>
|
||||||
<textbox type="hidden" id="last"/>
|
<textbox type="hidden" id="last"/>
|
||||||
<hrule/>
|
<hrule/>
|
||||||
<select-cat id="cat_id" empty_label="All categories" width="86%" onchange="app.calendar.update_state({cat_id: widget.getValue()});" expand_multiple_rows="4"/>
|
<select-cat id="cat_id" empty_label="All categories" width="86%"
|
||||||
<select id="status_filter" no_lang="true" class="et2_fullWidth" onchange="app.calendar.update_state({status_filter: widget.getValue()});"/>
|
onchange="app.calendar.update_state({cat_id: widget.getValue()});" expand_multiple_rows="4"/>
|
||||||
|
<select id="status_filter" no_lang="true" class="et2_fullWidth"
|
||||||
|
onchange="app.calendar.update_state({status_filter: widget.getValue()});"/>
|
||||||
<hrule/>
|
<hrule/>
|
||||||
<calendar-owner id="owner" class="et2_fullWidth" onchange="app.calendar.update_state({owner: widget.getValue()}); return false;" multiple="true" allowFreeEntries="false" autocomplete_params="{"checkgrants": true}"/>
|
<calendar-owner id="owner" class="et2_fullWidth"
|
||||||
|
onchange="app.calendar.update_state({owner: widget.getValue()}); return false;"
|
||||||
|
multiple="true" allowFreeEntries="false"
|
||||||
|
autocomplete_params="{"checkgrants": true}"/>
|
||||||
<hrule/>
|
<hrule/>
|
||||||
<select id="merge" empty_label="Insert in document" onchange="app.calendar.sidebox_merge" class="et2_fullWidth"/>
|
<select id="merge" empty_label="Insert in document" onchange="app.calendar.sidebox_merge"
|
||||||
|
class="et2_fullWidth"/>
|
||||||
|
<box>
|
||||||
|
<grid id="integration" disabled="!@integration" width="100%">
|
||||||
|
<columns>
|
||||||
|
<column/>
|
||||||
|
</columns>
|
||||||
|
<rows>
|
||||||
|
<row>
|
||||||
|
<template id="$row_cont[template]" width="100%" content="$row_cont[app]"/>
|
||||||
|
</row>
|
||||||
|
</rows>
|
||||||
|
</grid>
|
||||||
|
</box>
|
||||||
</vbox>
|
</vbox>
|
||||||
<iframe id="iframe" width="100%" height="100%"/>
|
<iframe id="iframe" width="100%" height="100%"/>
|
||||||
|
<styles>
|
||||||
|
#calendar-sidebox_integration: {
|
||||||
|
display: table;
|
||||||
|
width: 100%
|
||||||
|
}
|
||||||
|
</styles>
|
||||||
</template>
|
</template>
|
||||||
</overlay>
|
</overlay>
|
||||||
|
Loading…
Reference in New Issue
Block a user