mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-20 18:08:02 +02:00
Use a server call for all actions so whole query works
This commit is contained in:
parent
483069d970
commit
b3886ab828
@ -48,7 +48,6 @@ class resources_ui
|
|||||||
*/
|
*/
|
||||||
function index($content='')
|
function index($content='')
|
||||||
{
|
{
|
||||||
$msg = $content;
|
|
||||||
if (is_array($content))
|
if (is_array($content))
|
||||||
{
|
{
|
||||||
$sessiondata = $content['nm'];
|
$sessiondata = $content['nm'];
|
||||||
@ -110,6 +109,8 @@ class resources_ui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$msg = $content;
|
||||||
}
|
}
|
||||||
$content = array();
|
$content = array();
|
||||||
$content['msg'] = $msg;
|
$content['msg'] = $msg;
|
||||||
@ -227,14 +228,11 @@ class resources_ui
|
|||||||
'popup' => egw_link::get_registry('resources', 'add_popup'),
|
'popup' => egw_link::get_registry('resources', 'add_popup'),
|
||||||
'group' => $group,
|
'group' => $group,
|
||||||
),
|
),
|
||||||
'view_calendar' => array(
|
'view-calendar' => array(
|
||||||
'caption' => 'View calendar',
|
'caption' => 'View calendar',
|
||||||
'icon' => 'calendar/planner',
|
'icon' => 'calendar/planner',
|
||||||
'group' => ++$group,
|
'group' => ++$group,
|
||||||
'allowOnMultiple' => true,
|
'allowOnMultiple' => true,
|
||||||
'onExecute' => 'javaScript:view_calendar',
|
|
||||||
'url' => 'menuaction=calendar.calendar_uiviews.planner&sortby=user&owner=0',
|
|
||||||
'nm_action' => 'location',
|
|
||||||
'disableClass' => 'no_view_calendar',
|
'disableClass' => 'no_view_calendar',
|
||||||
),
|
),
|
||||||
'book' => array(
|
'book' => array(
|
||||||
@ -242,9 +240,6 @@ class resources_ui
|
|||||||
'icon' => 'navbar',
|
'icon' => 'navbar',
|
||||||
'group' => $group,
|
'group' => $group,
|
||||||
'allowOnMultiple' => true,
|
'allowOnMultiple' => true,
|
||||||
'onExecute' => 'javaScript:view_calendar',
|
|
||||||
'url' => 'menuaction=calendar.calendar_uiforms.edit&participants=',
|
|
||||||
'popup' => egw_link::get_registry('calendar', 'add_popup'),
|
|
||||||
'disableClass' => 'no_book',
|
'disableClass' => 'no_book',
|
||||||
),
|
),
|
||||||
'new_accessory' => array(
|
'new_accessory' => array(
|
||||||
@ -296,19 +291,53 @@ class resources_ui
|
|||||||
if ($use_all)
|
if ($use_all)
|
||||||
{
|
{
|
||||||
// get the whole selection
|
// get the whole selection
|
||||||
$query = is_array($session_name) ? $session_name : $GLOBALS['egw']->session->appsession($session_name,'resources');
|
$query = is_array($session_name) ? $session_name : $GLOBALS['egw']->session->appsession('session_data', $session_name);
|
||||||
|
|
||||||
@set_time_limit(0); // switch off the execution time limit, as it's for big selections to small
|
@set_time_limit(0); // switch off the execution time limit, as it's for big selections to small
|
||||||
$query['num_rows'] = -1; // all
|
$query['num_rows'] = -1; // all
|
||||||
$this->bo->get_rows($query,$checked,$readonlys,true); // true = only return the id's
|
$this->bo->get_rows($query,$resources,$readonlys);
|
||||||
|
foreach($resources as $resource)
|
||||||
|
{
|
||||||
|
$checked[] = $resource['res_id'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
echo __METHOD__."('$action', ".array2string($checked).', '.array2string($use_all).",,, '$session_name')";
|
//echo __METHOD__."('$action', ".array2string($checked).', '.array2string($use_all).",,, '$session_name')";
|
||||||
|
|
||||||
// Dialogs to get options
|
// Dialogs to get options
|
||||||
list($action, $settings) = explode('_', $action, 2);
|
list($action, $settings) = explode('_', $action, 2);
|
||||||
|
|
||||||
switch($action)
|
switch($action)
|
||||||
{
|
{
|
||||||
|
case 'view-calendar':
|
||||||
|
echo "window.location = '".egw::link('/index.php',$url_params);
|
||||||
|
$resource_ids = array(0);
|
||||||
|
$url_params = array(
|
||||||
|
'menuaction' => 'calendar.calendar_uiviews.planner',
|
||||||
|
'sortby' => 'user',
|
||||||
|
);
|
||||||
|
foreach($checked as $n => $id)
|
||||||
|
{
|
||||||
|
$resource_ids[] = 'r'.$id;
|
||||||
|
}
|
||||||
|
$url_params['owner'] = implode(',',$resource_ids);
|
||||||
|
$success = count($resource_ids);
|
||||||
|
egw_framework::set_onload("window.location = '".egw::link('/index.php',$url_params).'\';');
|
||||||
|
$action_msg = lang('view calendar');
|
||||||
|
break;
|
||||||
|
case 'book':
|
||||||
|
$resource_ids = array();
|
||||||
|
$url_params = array(
|
||||||
|
'menuaction' => 'calendar.calendar_uiforms.edit'
|
||||||
|
);
|
||||||
|
foreach($checked as $n => $id)
|
||||||
|
{
|
||||||
|
$resource_ids[] = 'r'.$id;
|
||||||
|
}
|
||||||
|
$url_params['participants'] = implode(',',$resource_ids);
|
||||||
|
$success = count($resource_ids);
|
||||||
|
egw_framework::set_onload("egw_openWindowCentered2('".egw::link('/index.php',$url_params) ."','_blank');");
|
||||||
|
$action_msg = lang('booked');
|
||||||
|
break;
|
||||||
case 'delete':
|
case 'delete':
|
||||||
$action_msg = lang('deleted');
|
$action_msg = lang('deleted');
|
||||||
foreach((array)$checked as $n => $id)
|
foreach((array)$checked as $n => $id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user