コード例 #1
0
ファイル: ProyectoPedido.php プロジェクト: minpppst/rsc
 /**
  * Notificacion
  */
 public function notificacion($evento)
 {
     //Ids de los usuarios con el rol "proyecto_pedido"
     $usuarios = \Yii::$app->authManager->getUserIdsByRole('proyecto_pedido');
     foreach ($usuarios as $key => $usuario) {
         Notification::notify(Notification::KEY_NUEVO_PEDIDO, $usuario, $this->id);
     }
 }
コード例 #2
0
ファイル: Auth4Model.php プロジェクト: adem-team/advanced
 public function auth4_saved()
 {
     if ($this->validate()) {
         $roHeader = Purchaseorder::find()->where(['KD_PO' => $this->kdpo])->one();
         $poSignStt = Statuspo::find()->where(['KD_PO' => $this->kdpo, 'ID_USER' => $this->getProfile()->EMP_ID])->one();
         $profile = Yii::$app->getUserOpt->Profile_user();
         $roHeader->STATUS = $this->status;
         $roHeader->SIG4_SVGBASE64 = $profile->emp->SIGSVGBASE64;
         $roHeader->SIG4_SVGBASE30 = $profile->emp->SIGSVGBASE30;
         $roHeader->SIG4_NM = $profile->emp->EMP_NM . ' ' . $profile->emp->EMP_NM_BLK;
         $roHeader->SIG4_TGL = date('Y-m-d');
         if ($roHeader->save()) {
             if (!$poSignStt) {
                 $poHeaderStt = new Statuspo();
                 $poHeaderStt->KD_PO = $this->kdpo;
                 $poHeaderStt->ID_USER = $this->getProfile()->EMP_ID;
                 //$poHeaderStt->TYPE
                 $poHeaderStt->STATUS = 101;
                 $poHeaderStt->UPDATE_AT = date('Y-m-d H:m:s');
                 if ($poHeaderStt->save()) {
                     Notification::notify(Notification::KEY_NEW_MESSAGE, 23, Yii::$app->user->identity->id, $this->kdpo);
                     $msgNotify = new MessageNotify();
                     $msgNotify->USER_CREATE = Yii::$app->user->identity->id;
                     //integer
                     $msgNotify->USER_FROM_ID = $this->getProfile()->EMP_ID;
                     $msgNotify->USER_FROM = $this->getProfile()->EMP_NM;
                     //varchar 50
                     $msgNotify->USER_TO = 'Stephen';
                     //varchar 50 -> catatan multi name user permission purchasing sign3 harus di revisi
                     $msgNotify->USER_TO_ID = 'LG.2016.000001';
                     //catatan multi name EMP_ID permission purchasing sign3 harus di revisi
                     $msgNotify->SUBJECT = 'PO';
                     //varchar 10
                     $msgNotify->CREATE_AT = date('Y-m-d H:m:s');
                     //varchar 10
                     $msgNotify->IMG = '';
                     //TEXT
                     $msgNotify->REF = $this->kdpo;
                     //TEXT
                     $msgNotify->save();
                 }
             }
             return $roHeader;
         }
         return $roHeader;
     }
     return null;
 }
コード例 #3
0
ファイル: Feedback.php プロジェクト: minpppst/rsc
 /**
  * Notificacion
  */
 public function notificacion_cargar($evento)
 {
     Notification::warning(Notification::KEY_FEEDBACK, $this->id_usuario_destino, $this->id);
 }
コード例 #4
0
 public function notificacion_cargar($evento)
 {
     //Ids de los usuarios con el rol "proyecto_pedido"
     $usuarios = \Yii::$app->authManager->getUserIdsByRole('accion_centralizada_requerimiento');
     foreach ($usuarios as $key => $usuario) {
         Notification::notify(Notification::KEY_NUEVO_PEDIDO_ACC, $usuario, $this->id);
     }
 }
コード例 #5
0
ファイル: AcEspUej.php プロジェクト: minpppst/rsc
 public function notificacion_cargar($evento)
 {
     if ($evento->name == 'pedido_aprobado') {
         //buscando los usuarios que tenga asignado esa unidad ejecutora y accion_especifica
         $usuarios = AcEspUej::find()->select(["accion_centralizada_asignar.usuario"])->innerjoin('accion_centralizada_asignar', 'accion_centralizada_ac_especifica_uej.id=accion_centralizada_asignar.accion_especifica_ue')->where(['accion_centralizada_asignar.accion_especifica_ue' => $this->id])->andWhere(['accion_centralizada_ac_especifica_uej.estatus' => 1])->asArray()->all();
         foreach ($usuarios as $key => $usuario) {
             Notification::notify(Notification::KEY_PEDIDO_ACC_APROBADO, $usuario['usuario'], $this->id);
         }
     }
 }
コード例 #6
0
ファイル: Auth1Model.php プロジェクト: adem-team/advanced
 public function auth1_saved()
 {
     if ($this->validate()) {
         $poHeader = Purchaseorder::find()->where(['KD_PO' => $this->kdpo])->one();
         $poSignStt = Statuspo::find()->where(['KD_PO' => $this->kdpo, 'ID_USER' => $this->getProfile()->EMP_ID])->one();
         $poHeader->STATUS = $this->status;
         $poHeader->SIG1_SVGBASE64 = $this->getProfile()->SIGSVGBASE64;
         $poHeader->SIG1_SVGBASE30 = $this->getProfile()->SIGSVGBASE30;
         $poHeader->SIG1_NM = $this->getProfile()->EMP_NM . ' ' . $this->getProfile()->EMP_NM_BLK;
         $poHeader->SIG1_TGL = date('Y-m-d');
         if ($poHeader->save()) {
             if (!$poSignStt) {
                 $poHeaderStt = new Statuspo();
                 $poHeaderStt->KD_PO = $this->kdpo;
                 $poHeaderStt->ID_USER = $this->getProfile()->EMP_ID;
                 //$poHeaderStt->TYPE
                 $poHeaderStt->STATUS = 100;
                 $poHeaderStt->UPDATE_AT = date('Y-m-d H:m:s');
                 if ($poHeaderStt->save()) {
                     //Notification::notify(Notification::KEY_NEW_MESSAGE, $id_Pengirim, $id_penerima(user_login),$ref_kode);
                     Notification::notify(Notification::KEY_NEW_MESSAGE, 25, Yii::$app->user->identity->id, $this->kdpo);
                     $msgNotify = new MessageNotify();
                     $msgNotify->USER_CREATE = Yii::$app->user->identity->id;
                     //integer
                     $msgNotify->USER_FROM_ID = $this->getProfile()->EMP_ID;
                     $msgNotify->USER_FROM = $this->getProfile()->EMP_NM;
                     //varchar 50
                     $msgNotify->USER_TO = 'Melissa';
                     //varchar 50 catatan multi name user permission purchasing sign3 harus di revisi
                     $msgNotify->USER_TO_ID = 'LG.2016.000010';
                     // catatan multi name EMP_ID permission purchasing sign3 harus di revisi
                     $msgNotify->SUBJECT = 'PO';
                     //varchar 10
                     $msgNotify->CREATE_AT = date('Y-m-d H:m:s');
                     //varchar 10
                     $msgNotify->IMG = '';
                     //TEXT
                     $msgNotify->REF = $this->kdpo;
                     //TEXT
                     $msgNotify->save();
                 }
             }
             return $poHeader;
         }
         return $poHeader;
     }
     return null;
 }