[eGroupWare-svn] r55949 - in /trunk: calendar/inc/ calendar/js/ calendar/templates/default/ resources/inc/
[email protected] Fri, 29 Apr 2016 18:01:17 -0000
| Newsgroups | gmane.comp.web.egroupware.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: nathangray
Date: Fri Apr 29 20:01:17 2016
New Revision: 55949
URL: http://svn.stylite.de/viewvc/egroupware?rev=55949&view=rev
Log:
Update for resource selection to re-enable conflict detection
- Remove account & contact options from default resource selection preference
- Edit dialog participant now passes selected start & duration, so conflict detection works again
Modified:
trunk/calendar/inc/class.calendar_hooks.inc.php
trunk/calendar/inc/class.calendar_owner_etemplate_widget.inc.php
trunk/calendar/inc/class.calendar_uiforms.inc.php
trunk/calendar/js/app.js
trunk/calendar/templates/default/edit.xet
trunk/resources/inc/class.resources_bo.inc.php
Modified: trunk/calendar/inc/class.calendar_hooks.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/calendar/inc/class.calendar_hooks.inc.php?rev=55949&r1=55948&r2=55949&view=diff
==============================================================================
--- trunk/calendar/inc/class.calendar_hooks.inc.php (original)
+++ trunk/calendar/inc/class.calendar_hooks.inc.php Fri Apr 29 20:01:17 2016
@@ -192,9 +192,7 @@
$defaultresource_sel = array(
'resources_conflict' => lang('resources with conflict detection'),
'resources_without_conflict' => lang('resources except conflicting ones'),
- 'resources' => lang('resources'),
- 'addressbook' => lang('addressbook'),
- 'home-accounts' => lang('Accounts'),
+ 'resources' => lang('resources')
);
$reset_stati_on_shifts = array(
'no' => lang('Never'),
@@ -418,7 +416,8 @@
'help' => 'Default type of resources application selected in the calendar particpants research form.',
'xmlrpc' => True,
'admin' => False,
- 'forced' => 'addressbook',
+ 'forced' => 'resources',
+ 'default' => 'resources'
),
'default_private' => array(
'type' => 'check',
Modified: trunk/calendar/inc/class.calendar_owner_etemplate_widget.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/calendar/inc/class.calendar_owner_etemplate_widget.inc.php?rev=55949&r1=55948&r2=55949&view=diff
==============================================================================
--- trunk/calendar/inc/class.calendar_owner_etemplate_widget.inc.php (original)
+++ trunk/calendar/inc/class.calendar_owner_etemplate_widget.inc.php Fri Apr 29 20:01:17 2016
@@ -128,7 +128,8 @@
$query = $_REQUEST['query'];
// Arbitrarily limited to 50 / resource
- $options = array('start' => 0, 'num_rows' => 50);
+ $options = array('start' => 0, 'num_rows' => 50) +
+ array_diff_key($_REQUEST, array_flip(array('menuaction','query')));
$results = array();
$resources = array_merge(array('' => $bo->resources['']),$bo->resources);
Modified: trunk/calendar/inc/class.calendar_uiforms.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/calendar/inc/class.calendar_uiforms.inc.php?rev=55949&r1=55948&r2=55949&view=diff
==============================================================================
--- trunk/calendar/inc/class.calendar_uiforms.inc.php (original)
+++ trunk/calendar/inc/class.calendar_uiforms.inc.php Fri Apr 29 20:01:17 2016
@@ -1621,20 +1621,6 @@
if ($data['app'] == 'email') continue; // make no sense, as we cant search for email
$content['participants']['cal_resources'] .= ','.$data['app'];
}
- // adding extra content for the resource link-entry widget to
- // * select resources or addressbook as a default selection on the app selectbox based on prefs
- $content['participants']['resource']['app'] = $this->cal_prefs['defaultresource_sel'];
- // * get informations from the event on the ajax callback
- if (in_array($content['participants']['resource']['app'],array('resources_conflict','resources_without_conflict')))
- {
- // fix real app string
- $content['participants']['resource']['app'] = 'resources';
- }
- // check if current pref. is an allowed application for the user
- if (!isset($GLOBALS['egw_info']['user']['apps'][$content['participants']['resource']['app']]))
- {
- $content['participants']['resource']['app'] = 'home-accounts';
- }
}
$content['participants']['status_date'] = $preserv['actual_date'];
$preserved = array_merge($preserv,$content);
Modified: trunk/calendar/js/app.js
URL: http://svn.stylite.de/viewvc/egroupware/trunk/calendar/js/app.js?rev=55949&r1=55948&r2=55949&view=diff
==============================================================================
--- trunk/calendar/js/app.js (original)
+++ trunk/calendar/js/app.js Fri Apr 29 20:01:17 2016
@@ -1003,6 +1003,30 @@
if (typeof content.duration != 'undefined') end.set_value("+"+content.duration);
}
}
+ this.edit_update_participant(start);
+ },
+
+ /**
+ * Update query parameters for participants
+ *
+ * This allows for resource conflict checking
+ *
+ * @param {DOMNode|et2_widget} input Either the input node, or the widget
+ * @param {et2_widget} [widget] If input is an input node, widget will have
+ * the widget, otherwise it will be undefined.
+ */
+ edit_update_participant: function(input, widget)
+ {
+ if(typeof widget === 'undefined') widget = input;
+ var content = widget.getInstanceManager().getValues(widget.getRoot());
+ var participant = widget.getRoot().getWidgetById('participant');
+
+ participant.set_autocomplete_params({exec:{
+ start: content.start,
+ end: content.end,
+ duration: content.duration,
+ whole_day: content.whole_day
+ }});
},
/**
Modified: trunk/calendar/templates/default/edit.xet
URL: http://svn.stylite.de/viewvc/egroupware/trunk/calendar/templates/default/edit.xet?rev=55949&r1=55948&r2=55949&view=diff
==============================================================================
--- trunk/calendar/templates/default/edit.xet (original)
+++ trunk/calendar/templates/default/edit.xet Fri Apr 29 20:01:17 2016
@@ -205,12 +205,12 @@
</row>
<row class="dialogHeader2" height="28">
<description for="start" value="Start" width="88"/>
- <date-time id="start" needed="1" class="required"/>
+ <date-time id="start" needed="1" class="required" onchange="app.calendar.edit_update_participant"/>
<description for="duration" value="Duration" id="calendar_edit_duration" />
<menulist >
<menupopup statustext="Duration of the meeting" class="et2_fullWidth" id="duration" no_lang="1" onchange="app.calendar.set_enddate_visibility" options="Use end date,,,,,,,false"/>
</menulist>
- <date-time id="end"/>
+ <date-time id="end" onchange="app.calendar.edit_update_participant"/>
</row>
<row class="dialogHeader2" height="28">
<label value="options"/>
Modified: trunk/resources/inc/class.resources_bo.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/resources/inc/class.resources_bo.inc.php?rev=55949&r1=55948&r2=55949&view=diff
==============================================================================
--- trunk/resources/inc/class.resources_bo.inc.php (original)
+++ trunk/resources/inc/class.resources_bo.inc.php Fri Apr 29 20:01:17 2016
@@ -598,7 +598,7 @@
$data = $this->so->search($criteria,$only_keys,$order_by='name',$extra_cols='',$wildcard='%',$empty,$op='OR',$limit,$filter);
// maybe we need to check disponibility of the searched resources in the calendar if $pattern ['exec'] contains some extra args
$show_conflict=False;
- if ($options['exec'])
+ if ($options['exec'] && $GLOBALS['egw_info']['preferences']['calendar']['defaultresource_sel'] !== 'resources')
{
// we'll use a cache for resources info taken from database
static $res_info_cache = array();
@@ -608,12 +608,11 @@
//get a calendar objet for reservations
if ( (!isset($this->bocal)) || !(is_object($this->bocal)))
{
- require_once(EGW_INCLUDE_ROOT.'/calendar/inc/class.calendar_bo.inc.php');
- $this->bocal =& CreateObject('calendar.calendar_bo');
+ $this->bocal = new calendar_bo();
}
$start = new egw_time($cal_info['start']);
$startarr= getdate($start->format('ts'));
- if (isset($cal_info['whole_day'])) {
+ if (isset($cal_info['whole_day']) && $cal_info['whole_day']) {
$startarr['hour'] = $startarr['minute'] = 0;
$start = new egw_time($startarr);
$end = $start->format('ts') + 86399;
@@ -675,7 +674,7 @@
}
}
if (isset($res_info_cache)) {
- $show_conflict= (isset($options['exec']['show_conflict'])&& ($options['exec']['show_conflict']=='0'))? False:True;
+ $show_conflict= $GLOBALS['egw_info']['user']['preferences']['calendar']['defaultresource_sel'] === 'resources_conflict';
// if we have this array indexed on resource id it means non-bookable resource are removed and we are working for calendar
// so we'll loop on this one and not $data
foreach($res_info_cache as $id => $resource) {
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z