示例#1
0
文件: Comments.php 项目: valizr/MMA
 public function save(Default_Model_Comments $value)
 {
     $auth = Zend_Auth::getInstance();
     $authAccount = $auth->getStorage()->read();
     if (null != $authAccount) {
         if (null != $authAccount->getId()) {
             $user = new Default_Model_Users();
             $user->find($authAccount->getId());
             $data = array('id' => $value->getId(), 'idProject' => $value->getIdProject(), 'idParent' => $value->getIdParent(), 'idShop' => '3', 'idUserFrom' => $user->id, 'idUserTo' => $value->getIdUserTo(), 'description' => $value->getDescription(), 'deleted' => '0');
             $action_done = '';
             if (null === ($id = $value->getId())) {
                 $data['created'] = new Zend_Db_Expr('NOW()');
                 $id = $this->getDbTable()->insert($data);
                 //logs	action done
                 $user_name = $user->name . ' ' . $user->surname;
                 $project_name = $value->getProjectName()->getName();
                 $action_done = ' ' . $user_name . ' a adaugat un comentariu la proiectul ' . $project_name . ' ';
                 //end logs action done
             }
             Needs_Logs::DbLogTracking($user->id, $value->getIdProject(), 'comments', 'adaugare', $action_done);
             return $id;
         }
     }
 }
示例#2
0
 public function delete(Default_Model_ProductGroups $value)
 {
     $id = $value->getId();
     $data = array('deleted' => '1');
     $this->getDbTable()->update($data, array('id = ?' => $id));
     //logs	action done
     //$user_name = $value->getUserName()->getName().' '.$value->getUserName()->getSurname();
     $product_name = $value->getName();
     $action_done = 'User deleted the group ' . $product_name . ' ';
     Needs_Logs::DbLogTracking(0, $id, 'expenses', 'stergere', $action_done);
     //end logs action done
     return $id;
 }
示例#3
0
文件: Users.php 项目: valizr/MMA
 public function delete(Default_Model_Users $value)
 {
     $auth = Zend_Auth::getInstance();
     $authAccount = $auth->getStorage()->read();
     if (null != $authAccount) {
         if (null != $authAccount->getId()) {
             $user = new Default_Model_Users();
             $user->find($authAccount->getId());
             $id = $value->getId();
             $data = array('deleted' => '1');
             $this->getDbTable()->update($data, array('id = ?' => $id));
             //logs	action done
             $user_name = $user->name;
             $action_done = ' ' . $user_name . ' a sters membrul  ' . $value->getName() . ' ';
             Needs_Logs::DbLogTracking($user->id, $id, 'users', 'stergere', $action_done);
             //end logs action done
             return $id;
         }
     }
 }