Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - brg

Pages: 1 [2]
16
How To's / logged_user() return wrong data.
« on: April 29, 2010, 08:00:20 am »
logged_user()  function can return User object (if i am log in) or NULL (if i am not log in) .. ok, but some methods like ProjectTasks::getLateTasksByUser() call logged_user()->getTimezone() without checking what data return logged_user() function.

Second moment .. if i want get in cron job (run from wget without user login) all task ProjectTasks::getProjectTasks() or ProjectTasks::getLateTasksByUser() i get Fatal error because permissions_sql_for_listings() call $user->getId() method .. but $user was "NULL" value if i run cron.php without authorization.

-----------------

Something strange ..
getLateTasksByUser() method was User $user argument, but never use it .. always return late tasks logged user has access to

I am modify:
Code: [Select]
$permissions = ' AND ( ' . permissions_sql_for_listings(ProjectTasks::instance(),ACCESS_LEVEL_READ, logged_user(), 'project_id') .')';
to:
Code: [Select]
$permissions = ' AND ( ' . permissions_sql_for_listings(ProjectTasks::instance(),ACCESS_LEVEL_READ, $user, 'project_id') .')';
And maybe:
Code: [Select]
$to_date = DateTimeValueLib::now()->add('h', logged_user()->getTimezone())->beginningOfDay();
to:
Code: [Select]
$to_date = DateTimeValueLib::now()->add('h', $user->getTimezone())->beginningOfDay();

17
Older versions / [1.7 beta 2] HTML tags in email subjects
« on: April 22, 2010, 07:37:22 am »
In application/models/notifier/Notifier.class.php file in 125 row:
Code: [Select]
"subject" => $subject = lang("$notification notification $type", $name, $uid, $typename, $ws),
but before:
Code: [Select]
$css = get_workspace_css_properties($w->getColor());
$ws .= "<span style=\"$css\">" . $w->getPath() . "</span>";
After this in "$ws" we have html tags, it is ok for "$properties['workspace'] = $ws;", but not for subjects!

Simple solution:
Code: [Select]
"subject" => $subject = lang("$notification notification $type", $name, $uid, $typename, html_to_text($ws)),

18
Installation problems / Re: 1.7 beta 2 upgrade error - resolved
« on: April 22, 2010, 06:49:17 am »
Confirm this.
Today upgrade from 1.6.2 to 1.7 beta and get same error.
Run script from db_migration folder manual too.

19
Pусский / Re: Official translation to Russian
« on: December 21, 2009, 08:39:15 am »
Очепятка в переводе для 1.6
'milestone assigned' => 'Эта "{0}" возложен на Вас',

20
How To's / How to create my custom widgets to dashboard?
« on: December 10, 2009, 04:22:53 am »
I want to write a little plugin which will create additional widget to my dashboard .. but i don`t understand how do this.

I read this - http://wiki.opengoo.org/doku.php/hello_world_application and this http://wiki.opengoo.org/doku.php/hello_world_application

I create my widget, but l am edit OG core files .. DashboardController.class.php and dashboard/index.php .. it is not a solution, because any core update, will create a lot of problems.

OG use hooks and may be I can use some hook to create widget and don`n edit core files?

21
I can`t get these variables in translation. Changing 2 lines fix this problem:
Code: [Select]
--- application/models/notifier/Notifier.class.php
+++ application/models/notifier/Notifier.class.php
@@ -398,7 +398,7 @@
  return self::queueEmail(
  self::prepareEmailAddress($milestone->getAssignedTo()->getEmail(), $milestone->getAssignedTo()->getDisplayName()),
  self::prepareEmailAddress($milestone->getCreatedBy()->getEmail(), $milestone->getCreatedByDisplayName()),
- lang('milestone assigned to you'),
+ lang('milestone assigned to you', $milestone->getName(), $milestone->getProject()->getName()),
  tpl_fetch(get_template_path('milestone_assigned', 'notifier'))
  ); // send
 
@@ -434,7 +434,7 @@
  self::queueEmail(
  array(self::prepareEmailAddress($task->getAssignedTo()->getEmail(), $task->getAssignedTo()->getDisplayName())),
  self::prepareEmailAddress($task->getUpdatedBy()->getEmail(), $task->getUpdatedByDisplayName()),
- lang('task assigned to you'),
+ lang('task assigned to you', $task->getTitle(), $task->getProject()->getName()),
  tpl_fetch(get_template_path('task_assigned', 'notifier'))
  ); // send
 

I am attach path to 1.6 RC

22
Добавлю свои 5 копеек .. неудобно когда много задач, которые называются одинаково, но привязаны к разным воркспэйсам, потому что приходят идентичные напоминалки, почти как спам =))


1. Как можно безболезненно для обновлений исправлять текущий перевод .. создаем файлик z.php в /language/ru_ru и пишем там что нам нужно, перезаписывая предыдущие переводы.

2. Добавить имя воркспэйса, которое собственно передается в перевод, но почему то не участвует в нем (так же в z.php):
Code: [Select]
$add_workspace = array(
  'modified notification task' => 'Задача \'{0}\' была изменена',
  'modified notification task desc' => 'Задача \'{0}\' была изменена {1}.',
  'modified notification event' => 'Событие \'{0}\' было изменено',
  'modified notification event desc' => 'Событие \'{0}\' было изменено {1}.',
  'modified notification company' => 'Компания \'{0}\' была изменена',
  'modified notification company desc' => 'Компания \'{0}\' была изменена {1}.',
  'modified notification contact' => 'Контакт \'{0}\' был изменен',
  'modified notification contact desc' => 'Контакт \'{0}\' был изменен {1}.',
  'modified notification message' => 'Заметка \'{0}\' была изменена',
  'modified notification message desc' => 'Заметка \'{0}\' была изменена {1}.',
  'modified notification file' => 'Файл \'{0}\' был изменен',
  'modified notification file desc' => 'Файл \'{0}\' был изменен {1}.',
  'modified notification webpage' => 'Веб-ссылка \'{0}\' была изменена',
  'modified notification webpage desc' => 'Веб-ссылка \'{0}\' была изменена {1}.',
  'modified notification milestone' => 'Этап \'{0}\' был изменен',
  'modified notification milestone desc' => 'Этап \'{0}\' был изменен {1}.',
  'modified notification email' => 'Email \'{0}\' был изменен',
  'modified notification email desc' => 'Email \'{0}\' был изменен {1}.',
 
  'new notification task' => 'Новая задача \'{0}\'',
  'new notification task desc' => 'Новая задача \'{0}\' была добавлена {1}.',
  'new notification event' => 'Новое событие \'{0}\'',
  'new notification event desc' => 'Новое событие \'{0}\' было добавлено {1}.',
  'new notification company' => 'Новая компания \'{0}\'',
  'new notification company desc' => 'Новая компания \'{0}\' была добавлена {1}',
  'new notification contact' => 'Новый контакт \'{0}\'',
  'new notification contact desc' => 'Новый контакт \'{0}\' был добавлен {1}',
  'new notification message' => 'Новая заметка \'{0}\'',
  'new notification message desc' => 'Новая заметка \'{0}\' была добавлена {1}',
  'new notification file' => 'Новый файл \'{0}\'',
  'new notification file desc' => 'Новый файл \'{0}\' был добавлен {1}',
  'new notification webpage' => 'Новая веб-ссылка \'{0}\'',
  'new notification webpage desc' => 'Новая веб-ссылка \'{0}\' была добавлена {1}',
  'new notification milestone' => 'Новый этап \'{0}\'',
  'new notification milestone desc' => 'Новый этап \'{0}\' был добавлен {1}',
  'new notification comment' => 'Новый комментарий \'{0}\'',
  'new notification comment desc' => 'Новый комментарий \'{0}\' был добавлен {1}.', 
);
 
 
foreach($add_workspace as $k => $phrase){
  $phrases[$k] = '{3}: ' . $phrase . '';
}

return $phrases;

Pages: 1 [2]