mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-24 14:11:29 +01:00
start work on calendar sidebox hook
This commit is contained in:
parent
ba79aa917f
commit
7bba0e916d
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
$this->so =& CreateObject('resources.so_acl');
|
$this->so =& CreateObject('resources.so_acl');
|
||||||
$this->permissions = $this->so->get_permissions($GLOBALS['egw_info']['user']['account_id'],true);
|
$this->permissions = $this->so->get_permissions($GLOBALS['egw_info']['user']['account_id'],true);
|
||||||
$this->egw_cats =& createobject('phpgwapi.categories');
|
$this->egw_cats = createobject('phpgwapi.categories','','resources');
|
||||||
$this->accounts = $GLOBALS['egw']->accounts->get_list();
|
$this->accounts = $GLOBALS['egw']->accounts->get_list();
|
||||||
$this->debug = False;
|
$this->debug = False;
|
||||||
|
|
||||||
|
@ -114,6 +114,10 @@ class resources_hooks
|
|||||||
'type' => 'r',// one char type-identifiy for this resources
|
'type' => 'r',// one char type-identifiy for this resources
|
||||||
'icon' => 'calicon',//icon
|
'icon' => 'calicon',//icon
|
||||||
'participants_header' => lang('resources'), // header of participants from this type
|
'participants_header' => lang('resources'), // header of participants from this type
|
||||||
|
'cal_sidebox' => array(
|
||||||
|
'menu_title' => lang('Select resources'),
|
||||||
|
'file' => 'resources.ui_resources.get_calendar_sidebox'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ class ui_resources
|
|||||||
// print_r($GLOBALS['egw_info']); die();
|
// print_r($GLOBALS['egw_info']); die();
|
||||||
$this->tmpl =& CreateObject('etemplate.etemplate','resources.show');
|
$this->tmpl =& CreateObject('etemplate.etemplate','resources.show');
|
||||||
$this->bo =& CreateObject('resources.bo_resources');
|
$this->bo =& CreateObject('resources.bo_resources');
|
||||||
|
$this->html =& $GLOBALS['egw']->html;
|
||||||
// $this->calui = CreateObject('resources.ui_calviews');
|
// $this->calui = CreateObject('resources.ui_calviews');
|
||||||
|
|
||||||
if(!@is_object($GLOBALS['egw']->js))
|
if(!@is_object($GLOBALS['egw']->js))
|
||||||
@ -459,5 +460,47 @@ class ui_resources
|
|||||||
$this->tmpl->read('resources.resource_select');
|
$this->tmpl->read('resources.resource_select');
|
||||||
$this->tmpl->exec('resources.ui_resources.select',$content,$sel_options,$no_button,$preserv,2);
|
$this->tmpl->exec('resources.ui_resources.select',$content,$sel_options,$no_button,$preserv,2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get_calendar_sidebox
|
||||||
|
* get data für calendar sidebox
|
||||||
|
*
|
||||||
|
* @author Lukas Weiss <wnz_gh05t@users.sourceforge.net>
|
||||||
|
* @return array with: label=>link or array with text
|
||||||
|
*/
|
||||||
|
function get_calendar_sidebox($view_menuaction, $date='')
|
||||||
|
{
|
||||||
|
$selectbox_content = array(lang('Select resources'));
|
||||||
|
$selectbox_content[0] = lang('Select resources');
|
||||||
|
$cats = $this->bo->acl->get_cats(EGW_ACL_READ);
|
||||||
|
|
||||||
|
// this gets the resource-ids of the cats and implodes them to the array-key of the selectbox,
|
||||||
|
// so it is possible to select all resources of a category
|
||||||
|
foreach($cats as $cat_id => $cat_name)
|
||||||
|
{
|
||||||
|
$resources = $this->bo->so->search(array('cat_id' => $cat_id),'res_id');
|
||||||
|
foreach($resources as $res) $key .= ($key == "")?'r'.$res['res_id']:',r'.$res['res_id'];
|
||||||
|
$selectbox_content[$key] = $cat_name;
|
||||||
|
}
|
||||||
|
$selectbox = $this->html->select(
|
||||||
|
'owner',
|
||||||
|
'uical_select_resource',
|
||||||
|
$selectbox_content,
|
||||||
|
$no_lang=true,
|
||||||
|
$options='style="width: 165px;" name="res_id" onchange="load_cal(\''.
|
||||||
|
$GLOBALS['egw']->link('/index.php',array(
|
||||||
|
'menuaction' => $view_menuaction,
|
||||||
|
'date' => $date,
|
||||||
|
)).'\',\'uical_select_resource\');" id="uical_select_resource"',
|
||||||
|
$multiple=0
|
||||||
|
);
|
||||||
|
return array(
|
||||||
|
array(
|
||||||
|
'text' => $selectbox,
|
||||||
|
'no_lang' => True,
|
||||||
|
'link' => False
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user