- Fix day view user header

- Fix toolbar add button
This commit is contained in:
Nathan Gray 2016-01-06 20:37:29 +00:00
parent ec8c22c93b
commit d1739fd873
5 changed files with 17 additions and 7 deletions

View File

@ -622,14 +622,22 @@ class calendar_ui
$sel_options = array(); $sel_options = array();
// Add external owners that a select account widget will not find // Add external owners that a select account widget will not find
$linked_owners = array();
foreach($owners as $owner) foreach($owners as $owner)
{ {
if(!is_numeric(substr($owner, 0,1))) if(!is_numeric($owner))
{ {
$resource = $this->bo->resources[substr($owner, 0,1)]; $resource = $this->bo->resources[substr($owner, 0,1)];
$sel_options['owner'][] = array('value' => $owner, 'label' => egw_link::title($resource['app'], substr($owner,1))); $label = egw_link::title($resource['app'], substr($owner,1));
$linked_owners[$resource['app']][substr($owner,1)] = $label;
$sel_options['owner'][] = array('value' => $owner, 'label' => $label);
} }
} }
if($linked_owners)
{
// Send them to link registry too
egw_json_response::get()->call('egw.link_title_callback',$linked_owners);
}
$readonlys = array(); $readonlys = array();
$sel_options['status_filter'] = array( $sel_options['status_filter'] = array(

View File

@ -276,7 +276,7 @@ class calendar_uiviews extends calendar_ui
'caption' => 'Add', 'caption' => 'Add',
'icon' => 'add', 'icon' => 'add',
'group' => ++$group, 'group' => ++$group,
'onExecute' => 'javaScript:egw.open(null,"calendar","add");', 'onExecute' => 'javaScript:app.calendar.toolbar_action',
'hint' => 'Add', 'hint' => 'Add',
'toolbarDefault' => true, 'toolbarDefault' => true,
), ),

View File

@ -411,7 +411,6 @@ app.classes.calendar = AppJS.extend(
*/ */
toolbar_action: function toolbar_action(action) toolbar_action: function toolbar_action(action)
{ {
debugger;
// Most can just provide state change data // Most can just provide state change data
if(action.data && action.data.state) if(action.data && action.data.state)
{ {
@ -420,6 +419,8 @@ app.classes.calendar = AppJS.extend(
// Special handling // Special handling
switch(action.id) switch(action.id)
{ {
case 'add':
return egw.open(null,"calendar","add");
case 'weekend': case 'weekend':
this.update_state({weekend: action.checked}); this.update_state({weekend: action.checked});
break; break;

View File

@ -344,6 +344,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM],
set_label: function(label) { set_label: function(label) {
this.options.label = label; this.options.label = label;
this.title.text(label); this.title.text(label);
this.title.toggleClass('et2_clickable et2_link',label === '');
}, },
set_left: function(left) { set_left: function(left) {
// Maybe? // Maybe?

View File

@ -232,16 +232,16 @@ var et2_calendar_view = et2_valueWidget.extend(
break; break;
case 'r': case 'r':
application = 'resources'; application = 'resources';
this.owner.set_value(_owner.substr(1));
break; break;
} }
// This might not have a value right away // This might not have a value right away
user = egw.link_title(application,user.match(/\d+/)[0]); // send an empty function or it won't ask the server
user = egw.link_title(application,user.match(/\d+/)[0], function() {}, this);
} }
else // users else // users
{ {
user = parseInt(user) user = parseInt(user)
var accounts = egw.accounts(); var accounts = egw.accounts('both');
for(var j = 0; j < accounts.length; j++) for(var j = 0; j < accounts.length; j++)
{ {
if(accounts[j].value === user) if(accounts[j].value === user)