From 2d0eac55b7533ef87fa606218b42c20d8379a8ca Mon Sep 17 00:00:00 2001
From: Ralf Becker grants: user=$user, grant=$grant grants: user=$user, grant=$grant aclFilter(filter='$filter_was',user='$user') = '$filtermethod', privat_user_list=".print_r($privat_user_list,True).", public_user_list=".print_r($public_user_list,True)."
- * private|own - list only his personal entrys (incl. those he is responsible for !!!), my = entries the user is responsible for
+ * @param string $filter: none|all - list all entrys user have rights to see
+ * private|own - list only his personal entrys (incl. those he is responsible for !!!),
+ * responsible|my = entries the user is responsible for
+ * delegated = entries the user delegated to someone else
* @return string the necesary sql
*/
function aclFilter($filter = False)
{
- preg_match('/(my|own|privat|all|none|user)([0-9]*)/',$filter_was=$filter,$vars);
+ preg_match('/(my|responsible|delegated|own|privat|all|none|user)([0-9]*)/',$filter_was=$filter,$vars);
$filter = $vars[1];
$f_user = intval($vars[2]);
@@ -193,61 +195,67 @@ class soinfolog // DB-Layer
return $this->acl_filter[$filter.$f_user]; // used cached filter if found
}
- if (is_array($this->grants))
- {
- foreach($this->grants as $user => $grant)
- {
- // echo "
- * today startdate < tomorrow
- * overdue enddate < tomorrow
+ * @param string $filter upcoming = startdate is in the future
+ * today: startdate < tomorrow
+ * overdue: enddate < tomorrow
+ * date: today <= startdate && startdate < tomorrow
+ * enddate: today <= enddate && enddate < tomorrow
* limitYYYY/MM/DD not older or open
* @return string the necesary sql
*/
function dateFilter($filter = '')
{
- preg_match('/(upcoming|today|overdue|date)([-\\/.0-9]*)/',$filter,$vars);
+ preg_match('/(upcoming|today|overdue|date|enddate)([-\\/.0-9]*)/',$filter,$vars);
$filter = $vars[1];
if (isset($vars[2]) && !empty($vars[2]) && ($date = split('[-/.]',$vars[2])))
@@ -309,6 +319,12 @@ class soinfolog // DB-Layer
return '';
}
return " AND ($today <= info_startdate AND info_startdate < $tomorrow)";
+ case 'enddate':
+ if (!$today || !$tomorrow)
+ {
+ return '';
+ }
+ return " AND ($today <= info_enddate AND info_enddate < $tomorrow)";
case 'limit':
return " AND (info_modified >= '$today' OR NOT (info_status IN ('done','billed','cancelled')))";
}
@@ -705,4 +721,46 @@ class soinfolog // DB-Layer
}
return $ids;
}
+
+ /**
+ * Query infolog for users with open entries, either own or responsible, with start or end within 4 days
+ *
+ * This functions tries to minimize the users really checked with the complete filters, as creating a
+ * user enviroment and running the specific check costs ...
+ *
+ * @return array with acount_id's groups get resolved to there memebers
+ */
+ function users_with_open_entries()
+ {
+ $users = array();
+
+ $this->db->select($this->info_table,'DISTINCT info_owner',array(
+ str_replace(' AND ','',$this->statusFilter('open')),
+ '(ABS(info_startdate-'.time().')<'.(4*24*60*60).' OR '. // start_day within 4 days
+ 'ABS(info_enddate-'.time().')<'.(4*24*60*60).')', // end_day within 4 days
+ ),__LINE__,__FILE__);
+ while ($this->db->next_record())
+ {
+ $users[] = $this->db->f(0);
+ }
+ $this->db->select($this->info_table,'DISTINCT info_responsible',str_replace(' AND ','',$this->statusFilter('open')),__LINE__,__FILE__);
+ while ($this->db->next_record())
+ {
+ foreach(explode(',',$this->db->f(0)) as $responsible)
+ {
+ if ($GLOBALS['egw']->accounts->get_type($responsible) == 'g')
+ {
+ $responsible = $GLOBALS['egw']->accounts->members($responsible,true);
+ }
+ if ($responsible)
+ {
+ foreach(is_array($responsible) ? $responsible : array($responsible) as $user)
+ {
+ if ($user && !in_array($user,$users)) $users[] = $user;
+ }
+ }
+ }
+ }
+ return $users;
+ }
}
diff --git a/infolog/inc/class.uiinfolog.inc.php b/infolog/inc/class.uiinfolog.inc.php
index 0bf81de6d4..82fa80f359 100644
--- a/infolog/inc/class.uiinfolog.inc.php
+++ b/infolog/inc/class.uiinfolog.inc.php
@@ -90,19 +90,23 @@ class uiinfolog
'offer' => 'offer.gif', 'offer_alt' => 'offer' )
);
var $filters = array(
- 'none' => 'no Filter',
- 'done' => 'done',
- 'my' => 'responsible',
- 'my-open-today' => 'responsible open',
- 'my-open-overdue' => 'responsible overdue',
- 'my-upcoming' => 'responsible upcoming',
- 'own' => 'own',
- 'own-open-today' => 'own open',
- 'own-open-overdue' => 'own overdue',
- 'own-upcoming' => 'own upcoming',
- 'open-today' => 'open',
- 'open-overdue' => 'overdue',
- 'upcoming' => 'upcoming'
+ 'none' => 'no Filter',
+ 'done' => 'done',
+ 'responsible' => 'responsible',
+ 'responsible-open-today' => 'responsible open',
+ 'responsible-open-overdue' => 'responsible overdue',
+ 'responsible-upcoming' => 'responsible upcoming',
+ 'delegated' => 'delegated',
+ 'delegated-open-today' => 'delegated open',
+ 'delegated-open-overdue' => 'delegated overdue',
+ 'delegated-upcoming' => 'delegated upcomming',
+ 'own' => 'own',
+ 'own-open-today' => 'own open',
+ 'own-open-overdue' => 'own overdue',
+ 'own-upcoming' => 'own upcoming',
+ 'open-today' => 'open',
+ 'open-overdue' => 'overdue',
+ 'upcoming' => 'upcoming',
);
var $messages = array(
'edit' => 'InfoLog - Edit',
@@ -138,6 +142,24 @@ class uiinfolog
$this->duration_format = str_replace(',','',$pm_config->config_data['duration_units']).','.$pm_config->config_data['hours_per_workday'];
unset($pm_config);
}
+ /* these are just for testing of the notifications
+ for($i = -1; $i <= 3; ++$i)
+ {
+ $this->filters['delegated-open-enddate'.date('Y-m-d',time()+$i*24*60*60)] = "delegated due in $i day(s)";
+ }
+ for($i = -1; $i <= 3; ++$i)
+ {
+ $this->filters['responsible-open-enddate'.date('Y-m-d',time()+$i*24*60*60)] = "responsible due in $i day(s)";
+ }
+ for($i = -1; $i <= 3; ++$i)
+ {
+ $this->filters['delegated-open-date'.date('Y-m-d',time()+$i*24*60*60)] = "delegated starting in $i day(s)";
+ }
+ for($i = -1; $i <= 3; ++$i)
+ {
+ $this->filters['responsible-open-date'.date('Y-m-d',time()+$i*24*60*60)] = "responsible starting in $i day(s)";
+ }
+ */
$GLOBALS['uiinfolog'] =& $this; // make ourself availible for ExecMethod of get_rows function
}
diff --git a/infolog/inc/hook_settings.inc.php b/infolog/inc/hook_settings.inc.php
index 4313863d29..85a5f6efcf 100644
--- a/infolog/inc/hook_settings.inc.php
+++ b/infolog/inc/hook_settings.inc.php
@@ -21,7 +21,7 @@ $have_custom_fields = count($ui->bo->customfields) > 0;
unset($ui);
// migrage old filter-pref 1,2 to the filter one 'own-open-today'
-if (in_array($GLOBALS['egw']->preferences->{$GLOBALS['type']}['homeShowEvents'],array('1','2')))
+if (isset($GLOBALS['type']) && in_array($GLOBALS['egw']->preferences->{$GLOBALS['type']}['homeShowEvents'],array('1','2')))
{
$GLOBALS['egw']->preferences->add('infolog','homeShowEvents','own-open-today',$GLOBALS['type']);
$GLOBALS['egw']->preferences->save_repository();
@@ -136,7 +136,7 @@ $GLOBALS['settings']['notify_creator'] = array(
'type' => 'check',
'label' => 'Receive notifications about own items',
'name' => 'notify_creator',
- 'help' => 'Do you want a notification mail, if items you created get updated?',
+ 'help' => 'Do you want a notification, if items you created get updated?',
'xmlrpc' => True,
'admin' => False,
);
@@ -144,10 +144,57 @@ $GLOBALS['settings']['notify_assigned'] = array(
'type' => 'check',
'label' => 'Receive notifications about items assigned to you',
'name' => 'notify_assigned',
- 'help' => 'Do you want a notification mails, if items get assigned to you or assigned items get updated?',
+ 'help' => 'Do you want a notification, if items get assigned to you or assigned items get updated?',
'xmlrpc' => True,
'admin' => False,
);
+
+// to add options for more then 3 days back or in advance, you need to update soinfolog::users_with_open_entries()!
+$options = array(
+ '0' => lang('No'),
+ '-1d' => lang('one day after'),
+ '0d' => lang('same day'),
+ '1d' => lang('one day in advance'),
+ '2d' => lang('%1 days in advance',2),
+ '3d' => lang('%1 days in advance',3),
+);
+$GLOBALS['settings']['notify_due_delegated'] = array(
+ 'type' => 'select',
+ 'label' => 'Receive notifications about due entries you delegated',
+ 'name' => 'notify_due_delegated',
+ 'help' => 'Do you want a notification, if items you delegated are due?',
+ 'values' => $options,
+ 'xmlrpc' => True,
+ 'admin' => False,
+);
+$GLOBALS['settings']['notify_due_responsible'] = array(
+ 'type' => 'select',
+ 'label' => 'Receive notifications about due entries you are responsible for',
+ 'name' => 'notify_due_responsible',
+ 'help' => 'Do you want a notification, if items you are responsible for are due?',
+ 'values' => $options,
+ 'xmlrpc' => True,
+ 'admin' => False,
+);
+$GLOBALS['settings']['notify_start_delegated'] = array(
+ 'type' => 'select',
+ 'label' => 'Receive notifications about starting entries you delegated',
+ 'name' => 'notify_start_delegated',
+ 'help' => 'Do you want a notification, if items you delegated are about to start?',
+ 'values' => $options,
+ 'xmlrpc' => True,
+ 'admin' => False,
+);
+$GLOBALS['settings']['notify_start_responsible'] = array(
+ 'type' => 'select',
+ 'label' => 'Receive notifications about starting entries you are responsible for',
+ 'name' => 'notify_start_responsible',
+ 'help' => 'Do you want a notification, if items you are responsible for are about to start?',
+ 'values' => $options,
+ 'xmlrpc' => True,
+ 'admin' => False,
+);
+
$GLOBALS['settings']['notify_html'] = array(
'type' => 'check',
'label' => 'Receive notifications as html-mails',
diff --git a/infolog/setup/phpgw_de.lang b/infolog/setup/phpgw_de.lang
index 5bf7f1128c..b229cbacd8 100644
--- a/infolog/setup/phpgw_de.lang
+++ b/infolog/setup/phpgw_de.lang
@@ -1,5 +1,11 @@
+%1 days in advance infolog de %1 Tage im Vorraus
+%1 modified by %2 at %3 infolog de %1 wurde von %2 am %3 geändert
%1 records imported infolog de %1 Datensätze importiert
%1 records read (not yet imported, you may go %2back%3 and uncheck test import) infolog de %1 Datensätze gelesen (noch nicht importiert, sie können %2zurück%3 gehen und Test Import ausschalten)
+%1 you are responsible for is due at %2 infolog de %1 für die Sie verantwortlich sind ist am %2 fällig
+%1 you are responsible for is starting at %2 infolog de %1 für die Sie verantwortlich sind startet am %2
+%1 you delegated is due at %2 infolog de %1 die Sie delegierten ist am %2 fällig
+%1 you delegated is starting at %2 infolog de %1 die Sie delegierten startet am %2
- subprojects from infolog de - Untereinträge von
0% infolog de 0%
10% infolog de 10%
@@ -36,7 +42,7 @@ apply the changes infolog de
are you shure you want to delete this entry ? infolog de Sind Sie sicher, dass Sie diesen Eintrag löschen wollen?
attach a file infolog de Datei anhängen
attach file infolog de Datei anhängen
-attension: no contact with address %1 found. infolog de Achtung: Kein Kontakt mit der Adresse %1 gefunden!
+attention: no contact with address %1 found. infolog de Achtung: Kein Kontakt mit der Adresse %1 gefunden!
back to main list infolog de Zurück zur Gesamtliste
billed infolog de abgerechnet
both infolog de Annahme+erledigt
@@ -93,7 +99,14 @@ deletes this status infolog de l
description infolog de Beschreibung
determines the order the fields are displayed infolog de legt die Reihenfolge fest in der die Felder angezeigt werden
disables a status without deleting it infolog de deaktiviert einen Status ohne ihn zu löschen
-do you want a confirmation of the responsible on: accepting, finishing the task or both infolog de wollen Sie eine Bestätigung des Verantwortlichen bei: Annahme, Beendigung der Aufgabe oder bei beidem
+do you want a confirmation of the responsible on: accepting, finishing the task or both infolog de Wollen Sie eine Bestätigung des Verantwortlichen bei: Annahme, Beendigung der Aufgabe oder bei beidem
+do you want a notification, if items get assigned to you or assigned items get updated? infolog de Wollen Sie eine Benachrichtigung, wenn Einträge Ihnen zugewiesen werden oder zugewiesene Einträge geändert werden?
+do you want a notification, if items you are responsible for are about to start? infolog de Wollen Sie eine Benachrichtigung, wenn Einträge für die Sie verantwortlich sind beginnen sollen?
+do you want a notification, if items you are responsible for are due? infolog de Wollen Sie eine Benachrichtigung, wenn Einträge für die Sie verantwortlich sind fällig werden?
+do you want a notification, if items you created get updated? infolog de Wollen Sie eine Benachrichtigung, wenn Einträge die Sie angelegt haben aktualisiert werden?
+do you want a notification, if items you delegated are about to start? infolog de Wollen Sie eine Benachrichtigung, wenn Einträge die Sie delegiert haben beginnen sollen?
+do you want a notification, if items you delegated are due? infolog de Wollen Sie eine Benachrichtigung, wenn Einträge die Sie delegiert haben fällig werden?
+do you want to receive notifications as html-mails or plain text? infolog de Wollen Sie die Benachrichtigungen als HTML Mail oder reinen Text empfangen?
do you want to see custom infolog types in the calendar? infolog de Wollen Sie benutzerdefinierte Typen auch im Kalender sehen?
don't show infolog infolog de InfoLog NICHT anzeigen
done infolog de erledigt
@@ -164,6 +177,7 @@ max length of the input [, length of the inputfield (optional)] infolog de max.
name must not be empty !!! infolog de Name darf nicht leer sein !!!
name of new type to create infolog de Name des neu anzulegenden Types
never hide search and filters infolog de Suche und Filter niemals ausblenden
+new %1 created by %2 at %3 infolog de Neue %1 wurde von %2 am %3 angelegt
new name infolog de neuer name
new search infolog de Neue Suche
no - cancel infolog de Nein - Abbruch
@@ -181,6 +195,8 @@ note infolog de Notiz
number of records to read (%1) infolog de Anzahl Datensätze lesen (%1)
number of row for a multiline inputfield or line of a multi-select-box infolog de Anzahl Zeilen für ein mehrzeiliges Eingabefeld oder eines mehrfachen Auswahlfeldes
offer infolog de Angebot
+one day after infolog de am nächsten Tag
+one day in advance infolog de am Vortag
ongoing infolog de in Arbeit
only for details infolog de Nur bei Details
only the attachments infolog de nur die Anhänge
@@ -212,6 +228,13 @@ project settings: price, times infolog de Einstellungen zum Projekt: Preis, Zeit
re: infolog de Re:
read one record by passing its id. infolog de Einen Datensatz spezifiziert durch seine id lesen.
read rights (default) infolog de Leserechte (Vorgabe)
+receive notifications about due entries you are responsible for infolog de Benachrichtigungen über fällige Einträge für die Sie verantwortlich sind
+receive notifications about due entries you delegated infolog de Benachrichtigungen über fällige Einträge die Sie delegiert haben
+receive notifications about items assigned to you infolog de Benachrichtigungen über Einträge für die Sie verantwortlich sind
+receive notifications about own items infolog de Benachrichtigungen über eigene Einträge
+receive notifications about starting entries you are responsible for infolog de Benachrichtigungen über zu startende Einträge für die Sie verantwortlich sind
+receive notifications about starting entries you delegated infolog de Benachrichtigungen über zu startende Einträge die Sie delegiert haben
+receive notifications as html-mails infolog de Benachrichtigungen als HTML Mails
reg. expr. for local ip's
eg. ^192.168.1. infolog de reg. Ausdr. für lokale IP's
^192\.168\.1\.
reg. expr. for local ip's
eg. ^192\.168\.1\. infolog de reg. Ausdr. für lokale IP's
^192\.168\.1\.
remark infolog de Bemerkung
@@ -223,6 +246,7 @@ responsible upcoming infolog de verantwortlich zuk
responsible user, priority infolog de Verantwortlicher, Priorität
returns a list / search for records. infolog de Liefert eine Liste von / sucht nach Datensätzen.
rights for the responsible infolog de Rechte für den Verantwortlichen
+same day infolog de gleichen Tag
save infolog de Speichern
saves the changes made and leaves infolog de speichert die Änderungen und beendet
saves this entry infolog de diesen Eintrag speichern
@@ -294,6 +318,7 @@ urgent infolog de Dringend
used time infolog de benötigte Zeit
valid path on clientside
eg. \\server\share or e:\ infolog de gültiger Pfad clientseitig
zB. \\Server\Share oder e:\
valid path on clientside
eg. \servershare or e: infolog de gültiger Pfad clientseitig
zB. \\Server\Share oder e:\
+valid path on clientside
eg. servershare or e: infolog de gültiger Pfad clientseitig
zB. \\Server\Share oder e:\
values for selectbox infolog de Werte für die Auswahlbox
view all subs of this entry infolog de alle Untereinträge dieses Eintrag anzeigen
view other subs infolog de andere Untereinträge anzeigen
diff --git a/infolog/setup/phpgw_en.lang b/infolog/setup/phpgw_en.lang
index edf355147a..ae59640f84 100644
--- a/infolog/setup/phpgw_en.lang
+++ b/infolog/setup/phpgw_en.lang
@@ -1,5 +1,11 @@
+%1 days in advance infolog en %1 days in advance
+%1 modified by %2 at %3 infolog en %1 modified by %2 at %3
%1 records imported infolog en %1 records imported
%1 records read (not yet imported, you may go %2back%3 and uncheck test import) infolog en %1 records read (not yet imported, you may go %2back%3 and uncheck Test Import)
+%1 you are responsible for is due at %2 infolog en %1 you are responsible for is due at %2
+%1 you are responsible for is starting at %2 infolog en %1 you are responsible for is starting at %2
+%1 you delegated is due at %2 infolog en %1 you delegated is due at %2
+%1 you delegated is starting at %2 infolog en %1 you delegated is starting at %2
- subprojects from infolog en - Subprojects from
0% infolog en 0%
10% infolog en 10%
@@ -36,7 +42,7 @@ apply the changes infolog en Apply the changes
are you shure you want to delete this entry ? infolog en Are you sure you want to delete this entry ?
attach a file infolog en Attach a file
attach file infolog en Attach file
-attension: no contact with address %1 found. infolog en Attension: No Contact with address %1 found.
+attention: no contact with address %1 found. infolog en Attention: No Contact with address %1 found.
back to main list infolog en Back to main list
billed infolog en billed
both infolog en both
@@ -94,6 +100,13 @@ description infolog en Description
determines the order the fields are displayed infolog en determines the order the fields are displayed
disables a status without deleting it infolog en disables a status without deleting it
do you want a confirmation of the responsible on: accepting, finishing the task or both infolog en do you want a confirmation of the responsible on: accepting, finishing the task or both
+do you want a notification, if items get assigned to you or assigned items get updated? infolog en Do you want a notification, if items get assigned to you or assigned items get updated?
+do you want a notification, if items you are responsible for are about to start? infolog en Do you want a notification, if items you are responsible for are about to start?
+do you want a notification, if items you are responsible for are due? infolog en Do you want a notification, if items you are responsible for are due?
+do you want a notification, if items you created get updated? infolog en Do you want a notification, if items you created get updated?
+do you want a notification, if items you delegated are about to start? infolog en Do you want a notification, if items you delegated are about to start?
+do you want a notification, if items you delegated are due? infolog en Do you want a notification, if items you delegated are due?
+do you want to receive notifications as html-mails or plain text? infolog en Do you want to receive notifications as html-mails or plain text?
do you want to see custom infolog types in the calendar? infolog en Do you want to see custom InfoLog types in the calendar?
don't show infolog infolog en DON'T show InfoLog
done infolog en done
@@ -164,6 +177,7 @@ max length of the input [, length of the inputfield (optional)] infolog en max l
name must not be empty !!! infolog en Name must not be empty !!!
name of new type to create infolog en name of new type to create
never hide search and filters infolog en Never hide search and filters
+new %1 created by %2 at %3 infolog en New %1 created by %2 at %3
new name infolog en new name
new search infolog en New search
no - cancel infolog en No - Cancel
@@ -181,6 +195,8 @@ note infolog en Note
number of records to read (%1) infolog en Number of records to read (%1)
number of row for a multiline inputfield or line of a multi-select-box infolog en number of row for a multiline inputfield or line of a multi-select-box
offer infolog en offer
+one day after infolog en one day after
+one day in advance infolog en one day in advance
ongoing infolog en ongoing
only for details infolog en Only for details
only the attachments infolog en only the attachments
@@ -212,6 +228,13 @@ project settings: price, times infolog en Project settings: price, times
re: infolog en Re:
read one record by passing its id. infolog en Read one record by passing its id.
read rights (default) infolog en read rights (default)
+receive notifications about due entries you are responsible for infolog en Receive notifications about due entries you are responsible for
+receive notifications about due entries you delegated infolog en Receive notifications about due entries you delegated
+receive notifications about items assigned to you infolog en Receive notifications about items assigned to you
+receive notifications about own items infolog en Receive notifications about own items
+receive notifications about starting entries you are responsible for infolog en Receive notifications about starting entries you are responsible for
+receive notifications about starting entries you delegated infolog en Receive notifications about starting entries you delegated
+receive notifications as html-mails infolog en Receive notifications as html-mails
reg. expr. for local ip's
eg. ^192\.168\.1\. infolog en reg. expr. for local IP's
eg. ^192\.168\.1\.
remark infolog en Remark
remove this link (not the entry itself) infolog en Remove this link (not the entry itself)
@@ -222,6 +245,7 @@ responsible upcoming infolog en responsible upcoming
responsible user, priority infolog en responsible user, priority
returns a list / search for records. infolog en Returns a list / search for records.
rights for the responsible infolog en Rights for the responsible
+same day infolog en same day
save infolog en Save
saves the changes made and leaves infolog en saves the changes made and leaves
saves this entry infolog en Saves this entry
diff --git a/infolog/setup/setup.inc.php b/infolog/setup/setup.inc.php
index 06e8472fa1..42f0eeb6c4 100755
--- a/infolog/setup/setup.inc.php
+++ b/infolog/setup/setup.inc.php
@@ -44,11 +44,12 @@ $setup_info['infolog']['note'] =
expressions and direct calls to php-functions (e.g. to link the phone calls
(again) to the addressbook entrys).
More information about InfoLog and the current development-status can be found on the - InfoLog page on our Website.
'; + InfoLog page on our Website.'; /* The hooks this app includes, needed for hooks registration */ $setup_info['infolog']['hooks']['preferences'] = 'infolog.admin_prefs_sidebox_hooks.all_hooks'; $setup_info['infolog']['hooks'][] = 'settings'; +$setup_info['infolog']['hooks']['verify_settings'] = 'infolog.admin_prefs_sidebox_hooks.verify_settings'; $setup_info['infolog']['hooks']['admin'] = 'infolog.admin_prefs_sidebox_hooks.all_hooks'; $setup_info['infolog']['hooks'][] = 'deleteaccount'; $setup_info['infolog']['hooks'][] = 'home';