Author: nathangray
New Revision: 55981
URL: http://svn.stylite.de/viewvc/egroupware?rev=55981&view=rev
Log:
Planner sitemgr module
- Check ACL and only offer users or resources anonymous user has access (read or free/busy) to
- Stop some errors from missing framework breaking the timegrid
- Fallback to be able to get resource labels in all cases
Modified:
trunk/calendar/inc/class.calendar_bo.inc.php
trunk/calendar/inc/class.calendar_owner_etemplate_widget.inc.php
trunk/calendar/js/app.js
trunk/calendar/js/et2_widget_planner.js
trunk/calendar/js/et2_widget_view.js
trunk/calendar/sitemgr/class.module_calendar_month.inc.php
trunk/calendar/sitemgr/class.module_calendar_planner.inc.php
— trunk/calendar/inc/class.calendar_bo.inc.php (original)
+++ trunk/calendar/inc/class.calendar_bo.inc.php Mon May 2 21:22:52 2016
@@ -262,7 +262,7 @@
);
Api\Cache::setSession(‘calendar’, ‘resources’, $this->resources);
}
— trunk/calendar/inc/class.calendar_owner_etemplate_widget.inc.php (original)
+++ trunk/calendar/inc/class.calendar_owner_etemplate_widget.inc.php Mon May 2 21:22:52 2016
@@ -77,16 +77,13 @@
// Add external owners that a select account widget will not find
foreach($value as &$owner)
{
-
$label = Link::title($resource['app'], substr($owner,1));
}
else if (!in_array($owner, array_keys($accounts)))
{
-
$label = Link::title('api-accounts',$owner);
$resource = array('app'=> 'api-accounts');
}
else
@@ -126,9 +123,15 @@
*
* @return Array List of matching results
*/
- public static function ajax_owner()
- {
-
$bo = new calendar_bo();
- public static function ajax_owner($id = null)
- {
-
// Handle a request for a single ID
-
if($id)
-
{
-
$label = self::get_owner_label($id);
-
Api\Json\Response::get()->data($label);
-
return $label;
-
}
$query = $_REQUEST['query'];
// Arbitrarily limited to 50 / resource
@@ -190,4 +193,33 @@
echo json_encode($results);
exit();
}
+
- /**
-
- Get just the label for a single owner
-
- */
- protected static function get_owner_label($id)
- {
-
static $bo;
-
if(!$bo) $bo = new calendar_bo();
-
-
$id = ''.$id;
-
if(!is_numeric($id))
-
{
-
$resource = $bo->resources[substr($id, 0,1)];
-
$label = Link::title($resource['app'], substr($id,1));
-
-
// Could not get via link, try via resources info
-
if($label === false)
-
{
-
$info = ExecMethod($resource['info'], substr($id,1));
-
$label = $info[0]['name'];
-
}
-
}
-
else
-
{
-
$label = Link::title('api-accounts',$id);
-
}
-
return $label;
- }
}
— trunk/calendar/js/app.js (original)
+++ trunk/calendar/js/app.js Mon May 2 21:22:52 2016
@@ -96,7 +96,7 @@
// Show loading div
egw.loading_prompt(
this.appname,true,egw.lang(‘please wait…’),
@@ -2833,7 +2833,7 @@
}
// Hide AJAX loader
— trunk/calendar/js/et2_widget_planner.js (original)
+++ trunk/calendar/js/et2_widget_planner.js Mon May 2 21:22:52 2016
@@ -349,9 +349,9 @@
}
else // users
{
-
var label = this._get_owner_name(user)||'';
labels.push({id: user, label: label, data: {participants:user,owner:''}});
already_added.push(''+user);
}
@@ -1278,6 +1278,9 @@
* @param {type} actionLinks
*/
_init_links_dnd: function(mgr,actionLinks) {
+
— trunk/calendar/js/et2_widget_view.js (original)
+++ trunk/calendar/js/et2_widget_view.js Mon May 2 21:22:52 2016
@@ -335,6 +335,12 @@
user = app.calendar.sidebox_et2.getWidgetById(‘owner’).options.select_options.find(function(element) {return element.id == user;}) || {};
label = user.label;
}
-
else
-
{
-
// No sidebox? Must be in home or sitemgr (no caching) - ask directly
-
label = '?';
-
egw.json('calendar_owner_etemplate_widget::ajax_owner',user,function(data) {label = data;}, this).sendRequest();
-
}
}
return label;
},
— trunk/calendar/sitemgr/class.module_calendar_month.inc.php (original)
+++ trunk/calendar/sitemgr/class.module_calendar_month.inc.php Mon May 2 21:22:52 2016
@@ -306,7 +306,6 @@
{
$GLOBALS[‘egw’]->template = new Framework\Template;
}
-
$html .= $this->ui->timeGridWidget($this->ui->tagWholeDayOnTop($week),$weeks == 2 ? 30 : 60,200,'',$title,0,$week_start+WEEK_s >= $last);
}
// Initialize Tooltips
$html .= '<script language="JavaScript" type="text/javascript" src="'.$GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/js/wz_tooltip/wz_tooltip.js"></script>'."\n";
— trunk/calendar/sitemgr/class.module_calendar_planner.inc.php (original)
+++ trunk/calendar/sitemgr/class.module_calendar_planner.inc.php Mon May 2 21:22:52 2016
@@ -113,6 +113,7 @@
‘app’ => ‘calendar’,
);
$accounts = $this->accounts->search($search_params);
@@ -127,7 +128,7 @@
// get the rights for each account to check whether the anon user has read permissions.
$rights = $acl->get_rights($anon_user,‘calendar’);
// also add the anon user if it’s his own calendar.
-
if ($calendar_bo->check_perms(Acl::READ|calendar_bo::ACL_READ_FOR_PARTICIPANTS|calendar_bo::ACL_FREEBUSY,0,$entry['account_id'],'ts',null,$anon_user) || ($entry['account_id'] == $anon_user))
{
$has_read_permissions = true;
}
@@ -171,12 +172,17 @@
$this->arguments[‘owner’][‘multiple’] = true;
}
-
// Check anon user's permissions - must have at least run for the hook to be available
-
if($acl->check('run',EGW_ACL_READ, $data['app']) &&
-
$type != '' && $data['app'] && Link::get_registry($data['app'], 'query')
-
)
{
$_results = Link::query($data['app'], $query,$options);
}
@@ -184,11 +190,15 @@
$_results = array_unique($_results);
foreach ($_results as $key => $value)
{
-
if($calendar_bo->check_perms(Acl::READ,0,$type.$key,'ts',null,$anon_user))
-
{
-
$this->arguments['resources']['options'][$type.$key] = $value;
-
}
}
}
$this->arguments['resources']['options'] = array_unique($this->arguments['resources']['options']);
$this->arguments['resources']['multiple'] = count($this->arguments['resources']['options']) ? 4 : 0;
-
return parent::get_user_interface();
}
@@ -309,12 +319,13 @@
$tmpl->exec(METHOD, $content,array(), array(‘ALL’ => true),array(),2);
$html .= ob_get_contents();
$html .= ‘’
-
. ' window.egw_LAB.wait(function() {$j(function() {'
-
. 'app.calendar.set_state(' . json_encode(array(
'owner' => $search_params['owner'],
'sortby' => $ui->sortby,
'filter' => $arguments['filter']
)).');'
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
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs