|
@@ -61,8 +61,9 @@ class Route_Notify extends RouteBase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if ('1' == V::get('send', 0, $_POST, 'int')) {
|
|
if ('1' == V::get('send', 0, $_POST, 'int')) {
|
|
|
- $this->send($usrLogin, $notifyTypeList);
|
|
|
|
|
- $this->markAsSent($usrLogin, $notifyTypeList);
|
|
|
|
|
|
|
+ SE_Layout::alert('warning', "TODO: fix send, mark as sent");
|
|
|
|
|
+ //$this->send($usrLogin, $notifyTypeList);
|
|
|
|
|
+ //$this->markAsSent($usrLogin, $notifyTypeList);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$urlParts = array();// index.php?_route=Notify&_task=generateUserReminders&usrLogin=magdalena.cichosz&reminder[]=msgs
|
|
$urlParts = array();// index.php?_route=Notify&_task=generateUserReminders&usrLogin=magdalena.cichosz&reminder[]=msgs
|
|
@@ -247,15 +248,18 @@ function refreshPreview() {
|
|
|
return reset($aliasy);
|
|
return reset($aliasy);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function markAsSent($usrLogin, $notifyTypeList) {
|
|
|
|
|
- $sqlReminderTypes = "'" . implode("','", $notifyTypeList) . "'";
|
|
|
|
|
|
|
+ public function markAsSent($usrLogin, $reminders, $when) {
|
|
|
|
|
+// $sqlReminderTypes = "'" . implode("','", $notifyTypeList) . "'";
|
|
|
|
|
+ $sqlReminderTypes = "'" . implode("','", array_keys($reminders)) . "'";
|
|
|
$sth = DB::getPDO()->prepare("
|
|
$sth = DB::getPDO()->prepare("
|
|
|
update CRM_NOTIFY
|
|
update CRM_NOTIFY
|
|
|
set `last_exec_time` = NOW()
|
|
set `last_exec_time` = NOW()
|
|
|
where `who` = :login
|
|
where `who` = :login
|
|
|
|
|
+ and `when` = :when
|
|
|
and `what` in({$sqlReminderTypes})
|
|
and `what` in({$sqlReminderTypes})
|
|
|
");
|
|
");
|
|
|
$sth->bindValue(':login', $usrLogin, PDO::PARAM_STR);
|
|
$sth->bindValue(':login', $usrLogin, PDO::PARAM_STR);
|
|
|
|
|
+ $sth->bindValue(':when', $when, PDO::PARAM_STR);
|
|
|
$sth->execute();
|
|
$sth->execute();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -860,6 +864,7 @@ function refreshPreview() {
|
|
|
and u.EMPLOYEE_TYPE = 'Pracownik'
|
|
and u.EMPLOYEE_TYPE = 'Pracownik'
|
|
|
and n.`who` is not null
|
|
and n.`who` is not null
|
|
|
group by u.ADM_ACCOUNT
|
|
group by u.ADM_ACCOUNT
|
|
|
|
|
+ order by n.last_exec_time asc
|
|
|
limit :limit
|
|
limit :limit
|
|
|
");
|
|
");
|
|
|
$sth->bindValue(':limit', $limit, PDO::PARAM_INT);
|
|
$sth->bindValue(':limit', $limit, PDO::PARAM_INT);
|
|
@@ -884,6 +889,7 @@ function refreshPreview() {
|
|
|
from CRM_NOTIFY n
|
|
from CRM_NOTIFY n
|
|
|
where n.`who` in({$sqlUsers})
|
|
where n.`who` in({$sqlUsers})
|
|
|
and {$sqlWhenFltr}
|
|
and {$sqlWhenFltr}
|
|
|
|
|
+ order by n.last_exec_time asc
|
|
|
");
|
|
");
|
|
|
$sth->execute();
|
|
$sth->execute();
|
|
|
$rawReminders = $sth->fetchAll();
|
|
$rawReminders = $sth->fetchAll();
|