Changeset 204 for trunk/calendar/inc/class.bocalendar.inc.php
- Timestamp:
- 03/05/08 16:23:24 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/calendar/inc/class.bocalendar.inc.php
r166 r204 138 138 var $num_months; 139 139 var $xmlrpc = False; // not called via xmlrpc 140 var $async = false; 140 141 141 142 function bocalendar($session=0) … … 168 169 print_debug('BO Filter',$this->filter); 169 170 print_debug('Owner',$this->owner); 171 172 if ($GLOBALS['argv']) { 173 $this->async = true; 174 $this->load_lang(); 175 } 170 176 171 177 $this->prefs['calendar'] = $GLOBALS['phpgw_info']['user']['preferences']['calendar']; … … 368 374 } 369 375 376 function load_lang() { 377 if(!$_SESSION['phpgw_info']['calendar']['langAlarm']) 378 { 379 $array_keys = array(); 380 $fn = '../../calendar/setup/phpgw_alarm_'.$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'].'.lang'; 381 echo $fn; 382 if (file_exists($fn)){ 383 $fp = fopen($fn,'r'); 384 while ($data = fgets($fp,16000)) { 385 list($message_id,$app_name,$null,$content) = explode("\t",substr($data,0,-1)); 386 $_SESSION['phpgw_info']['calendar']['langAlarm'][$message_id] = $content; 387 } 388 fclose($fp); 389 } 390 } 391 } 370 392 function list_methods($_type='xmlrpc') 371 393 { … … 2990 3012 if (!$returncode) // not nice, but better than failing silently 2991 3013 { 2992 echo '<p><b>bocalendar::send_update</b>: '.lang("Failed sending message to '%1' #%2 subject='%3', sender='%4' 3014 echo '<p><b>bocalendar::send_update</b>: '.lang("Failed sending message to '%1' #%2 subject='%3', sender='%4'!!!",$to,$userid,htmlspecialchars($subject), $sender)."<br>\n"; 2993 3015 echo '<i>'.$mail->ErrorInfo."</i><br>\n"; 2994 3016 echo lang('This is mostly caused by a not or wrongly configured SMTP server. Notify your administrator.')."</p>\n"; … … 3323 3345 } 3324 3346 3347 function translate($key,$vars=false, $not_found='*' ) 3348 { 3349 if ($this->async) 3350 return $GLOBALS['phpgw']->translation->translate_async($key, $vars); 3351 return lang($key, $vars); 3352 } 3353 3325 3354 /*! 3326 3355 @function event2array … … 3333 3362 function event2array($event) 3334 3363 { 3335 3336 'field' => lang('Title'),3364 $var['title'] = Array( 3365 'field' => $this->translate('Title'), 3337 3366 'data' => $event['title'] 3338 3367 ); … … 3341 3370 // this will be printed even though its not needed. 3342 3371 $var['description'] = Array( 3343 'field' => lang('Description'),3372 'field' => $this->translate('Description'), 3344 3373 'data' => $event['description'] 3345 3374 ); 3346 3375 3347 3376 $var['ex_participants'] = Array( 3348 'field' => lang('External Participants'),3377 'field' => $this->translate('External Participants'), 3349 3378 'data' => $event['ex_participants'] 3350 3379 ); … … 3366 3395 } 3367 3396 $var['category'] = Array( 3368 'field' => lang('Category'),3397 'field' => $this->translate('Category'), 3369 3398 'data' => implode(', ',$cat_string) 3370 3399 ); 3371 3400 3372 3401 $var['location'] = Array( 3373 'field' => lang('Location'),3402 'field' => $this->translate('Location'), 3374 3403 'data' => $event['location'] 3375 3404 ); 3376 3405 3377 3406 $var['startdate'] = Array( 3378 'field' => lang('Start Date/Time'),3407 'field' => $this->translate('Start Date/Time'), 3379 3408 'data' => $GLOBALS['phpgw']->common->show_date($this->maketime($event['start']) - $GLOBALS['phpgw']->datetime->tz_offset), 3380 3409 ); 3381 3410 3382 3411 $var['enddate'] = Array( 3383 'field' => lang('End Date/Time'),3412 'field' => $this->translate('End Date/Time'), 3384 3413 'data' => $GLOBALS['phpgw']->common->show_date($this->maketime($event['end']) - $GLOBALS['phpgw']->datetime->tz_offset) 3385 3414 ); … … 3436 3465 } 3437 3466 $var['participants'] = Array( 3438 'field' => lang('Participants'),3467 'field' => $this->translate('Participants'), 3439 3468 'data' => $participants 3440 3469 ); … … 3535 3564 //$default_prefs = $GLOBALS['phpgw']->preferences->default['calendar']; jakjr 3536 3565 3537 $subject = lang('Calendar Event') . ' - $$action$$: $$startdate$$ $$title$$'."\n";3566 $subject = $this->translate('Calendar Event') . ' - $$action$$: $$startdate$$ $$title$$'."\n"; 3538 3567 $defaults = array( 3539 3568 'defaultcalendar' => 'week', … … 3542 3571 'receive_updates' => 'no', 3543 3572 'update_format' => 'extended', // leave it to extended for now, as iCal kills the message-body 3544 'notifyAdded' => $subject . lang ('You have a meeting scheduled for %1','$$startdate$$'),3545 'notifyCanceled' => $subject . lang ('Your meeting scheduled for %1 has been canceled','$$startdate$$'),3546 'notifyModified' => $subject . lang ('Your meeting that had been scheduled for %1 has been rescheduled to %2','$$olddate$$','$$startdate$$'),3547 'notifyResponse' => $subject . lang ('On %1 %2 %3 your meeting request for %4','$$date$$','$$fullname$$','$$action$$','$$startdate$$'),3548 'notifyAlarm' => lang('Alarm for %1 at %2 in %3','$$title$$','$$startdate$$','$$location$$')."\n".lang('Here is your requested alarm.'),3573 'notifyAdded' => $subject . $this->translate ('You have a meeting scheduled for %1',array('$$startdate$$')), 3574 'notifyCanceled' => $subject . $this->translate ('Your meeting scheduled for %1 has been canceled',array('$$startdate$$')), 3575 'notifyModified' => $subject . $this->translate ('Your meeting that had been scheduled for %1 has been rescheduled to %2',array('$$olddate$$','$$startdate$$')), 3576 'notifyResponse' => $subject . $this->translate ('On %1 %2 %3 your meeting request for %4', array('$$date$$','$$fullname$$','$$action$$','$$startdate$$')), 3577 'notifyAlarm' => $this->translate('Alarm for %1 at %2 in %3',array('$$title$$','$$startdate$$','$$location$$')) . "\n" . $this->translate('Here is your requested alarm.'), 3549 3578 'show_rejected' => '0', 3550 3579 'display_status' => '1',
Note: See TracChangeset
for help on using the changeset viewer.