PM-3895 Notifications to all assignees
modify schema.sql add index notification
This commit is contained in:
@@ -134,6 +134,26 @@ class NotificationDevice extends BaseNotificationDevice {
|
|||||||
return $device;
|
return $device;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function loadUsersArrayId ($arrayUserId)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$criteria = new Criteria();
|
||||||
|
$criteria->clearSelectColumns();
|
||||||
|
$criteria->add(NotificationDevicePeer::USR_UID, $arrayUserId, Criteria::IN);
|
||||||
|
|
||||||
|
$rs = NotificationDevicePeer::doSelectRS($criteria);
|
||||||
|
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
$device = array();
|
||||||
|
while ($rs->next()) {
|
||||||
|
$row = $rs->getRow();
|
||||||
|
$device[] = $row;
|
||||||
|
}
|
||||||
|
} catch (Exception $error) {
|
||||||
|
throw $error;
|
||||||
|
}
|
||||||
|
return $device;
|
||||||
|
}
|
||||||
|
|
||||||
public function getAll ()
|
public function getAll ()
|
||||||
{
|
{
|
||||||
$oCriteria = new Criteria( 'workflow' );
|
$oCriteria = new Criteria( 'workflow' );
|
||||||
|
|||||||
@@ -5190,6 +5190,15 @@
|
|||||||
<column name="DEV_TYPE" type="VARCHAR" size="50" required="true" default=""/>
|
<column name="DEV_TYPE" type="VARCHAR" size="50" required="true" default=""/>
|
||||||
<column name="DEV_CREATE" type="TIMESTAMP" required="true" />
|
<column name="DEV_CREATE" type="TIMESTAMP" required="true" />
|
||||||
<column name="DEV_UPDATE" type="TIMESTAMP" required="true" />
|
<column name="DEV_UPDATE" type="TIMESTAMP" required="true" />
|
||||||
|
<index name="indexUserNotification">
|
||||||
|
<index-column name="USR_UID"/>
|
||||||
|
<vendor type="mysql">
|
||||||
|
<parameter name="Table" value="NOTIFICATION_DEVICE"/>
|
||||||
|
<parameter name="Non_unique" value="1"/>
|
||||||
|
<parameter name="Key_name" value="indexUserNotification"/>
|
||||||
|
<parameter name="Seq_in_index" value="1"/>
|
||||||
|
</vendor>
|
||||||
|
</index>
|
||||||
</table>
|
</table>
|
||||||
</database>
|
</database>
|
||||||
|
|
||||||
|
|||||||
@@ -2913,7 +2913,8 @@ CREATE TABLE `NOTIFICATION_DEVICE`
|
|||||||
`DEV_TYPE` VARCHAR(50) default '',
|
`DEV_TYPE` VARCHAR(50) default '',
|
||||||
`DEV_CREATE` DATETIME NOT NULL,
|
`DEV_CREATE` DATETIME NOT NULL,
|
||||||
`DEV_UPDATE` DATETIME NOT NULL,
|
`DEV_UPDATE` DATETIME NOT NULL,
|
||||||
PRIMARY KEY (`DEV_UID`, `USR_UID`)
|
PRIMARY KEY (`DEV_UID`, `USR_UID`),
|
||||||
|
KEY `indexUserNotification`(`USR_UID`)
|
||||||
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Definitions Notification device.';
|
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Definitions Notification device.';
|
||||||
# This restores the fkey checks, after having unset them earlier
|
# This restores the fkey checks, after having unset them earlier
|
||||||
# SET FOREIGN_KEY_CHECKS = 1;
|
# SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|||||||
@@ -208,10 +208,7 @@ class NotificationDevice
|
|||||||
$oNoti = new \NotificationDevice();
|
$oNoti = new \NotificationDevice();
|
||||||
$devices = array();
|
$devices = array();
|
||||||
if (is_array($userIds)){
|
if (is_array($userIds)){
|
||||||
foreach ($userIds as $id) {
|
$devices = $oNoti->loadUsersArrayId($userIds);
|
||||||
$deviceUser = $oNoti->loadByUsersId($id);
|
|
||||||
$devices = array_merge($devices, $deviceUser);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$devices = $oNoti->loadByUsersId($userIds);
|
$devices = $oNoti->loadByUsersId($userIds);
|
||||||
$lists = new \ProcessMaker\BusinessModel\Lists();
|
$lists = new \ProcessMaker\BusinessModel\Lists();
|
||||||
|
|||||||
Reference in New Issue
Block a user