コード例 #1
0
ファイル: AppNotes.php プロジェクト: emildev35/processmaker
 public function getNotesList($appUid, $usrUid = '', $start = '', $limit = 25, $sort = 'APP_NOTES.NOTE_DATE', $dir = 'DESC', $dateFrom = '', $dateTo = '', $search = '')
 {
     $Criteria = new Criteria('workflow');
     $Criteria->clearSelectColumns();
     $Criteria->addSelectColumn(AppNotesPeer::APP_UID);
     $Criteria->addSelectColumn(AppNotesPeer::USR_UID);
     $Criteria->addSelectColumn(AppNotesPeer::NOTE_DATE);
     $Criteria->addSelectColumn(AppNotesPeer::NOTE_CONTENT);
     $Criteria->addSelectColumn(AppNotesPeer::NOTE_TYPE);
     $Criteria->addSelectColumn(AppNotesPeer::NOTE_AVAILABILITY);
     $Criteria->addSelectColumn(AppNotesPeer::NOTE_ORIGIN_OBJ);
     $Criteria->addSelectColumn(AppNotesPeer::NOTE_AFFECTED_OBJ1);
     $Criteria->addSelectColumn(AppNotesPeer::NOTE_AFFECTED_OBJ2);
     $Criteria->addSelectColumn(AppNotesPeer::NOTE_RECIPIENTS);
     $Criteria->addSelectColumn(UsersPeer::USR_USERNAME);
     $Criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
     $Criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
     $Criteria->addSelectColumn(UsersPeer::USR_EMAIL);
     $Criteria->addJoin(AppNotesPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
     $Criteria->add(AppNotesPeer::APP_UID, $appUid, Criteria::EQUAL);
     if ($usrUid != '') {
         $Criteria->add(AppNotesPeer::USR_UID, $usrUid, Criteria::EQUAL);
     }
     if ($dateFrom != '') {
         $Criteria->add(AppNotesPeer::NOTE_DATE, $dateFrom, Criteria::GREATER_EQUAL);
     }
     if ($dateTo != '') {
         $Criteria->add(AppNotesPeer::NOTE_DATE, $dateTo, Criteria::LESS_EQUAL);
     }
     if ($search != '') {
         $Criteria->add(AppNotesPeer::NOTE_CONTENT, '%' . $search . '%', Criteria::LIKE);
     }
     if ($dir == 'DESC') {
         $Criteria->addDescendingOrderByColumn($sort);
     } else {
         $Criteria->addAscendingOrderByColumn($sort);
     }
     $response = array();
     $totalCount = AppNotesPeer::doCount($Criteria);
     $response['totalCount'] = $totalCount;
     $response['notes'] = array();
     if ($start != '') {
         $Criteria->setLimit($limit);
         $Criteria->setOffset($start);
     }
     $oDataset = appNotesPeer::doSelectRS($Criteria);
     $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $oDataset->next();
     while ($aRow = $oDataset->getRow()) {
         $aRow['NOTE_CONTENT'] = htmlentities(stripslashes($aRow['NOTE_CONTENT']), ENT_QUOTES, 'UTF-8');
         $response['notes'][] = $aRow;
         $oDataset->next();
     }
     $result['criteria'] = $Criteria;
     $result['array'] = $response;
     return $result;
 }
コード例 #2
0
ファイル: AppNotes.php プロジェクト: bqevin/processmaker
 public function getNotesList($appUid, $usrUid = '', $start = '', $limit = '')
 {
     require_once "classes/model/Users.php";
     G::LoadClass('ArrayPeer');
     $Criteria = new Criteria('workflow');
     $Criteria->clearSelectColumns();
     $Criteria->addSelectColumn(AppNotesPeer::APP_UID);
     $Criteria->addSelectColumn(AppNotesPeer::USR_UID);
     $Criteria->addSelectColumn(AppNotesPeer::NOTE_DATE);
     $Criteria->addSelectColumn(AppNotesPeer::NOTE_CONTENT);
     $Criteria->addSelectColumn(AppNotesPeer::NOTE_TYPE);
     $Criteria->addSelectColumn(AppNotesPeer::NOTE_AVAILABILITY);
     $Criteria->addSelectColumn(AppNotesPeer::NOTE_ORIGIN_OBJ);
     $Criteria->addSelectColumn(AppNotesPeer::NOTE_AFFECTED_OBJ1);
     $Criteria->addSelectColumn(AppNotesPeer::NOTE_AFFECTED_OBJ2);
     $Criteria->addSelectColumn(AppNotesPeer::NOTE_RECIPIENTS);
     $Criteria->addSelectColumn(UsersPeer::USR_USERNAME);
     $Criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
     $Criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
     $Criteria->addSelectColumn(UsersPeer::USR_EMAIL);
     $Criteria->addJoin(AppNotesPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
     $Criteria->add(appNotesPeer::APP_UID, $appUid, CRITERIA::EQUAL);
     if ($usrUid != '') {
         $Criteria->add(appNotesPeer::USR_UID, $usrUid, CRITERIA::EQUAL);
     }
     $Criteria->addDescendingOrderByColumn(AppNotesPeer::NOTE_DATE);
     $response = array();
     $totalCount = AppNotesPeer::doCount($Criteria);
     $response['totalCount'] = $totalCount;
     $response['notes'] = array();
     if ($start != '') {
         $Criteria->setLimit($limit);
         $Criteria->setOffset($start);
     }
     $oDataset = appNotesPeer::doSelectRS($Criteria);
     $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $oDataset->next();
     while ($aRow = $oDataset->getRow()) {
         $aRow['NOTE_CONTENT'] = htmlentities(stripslashes($aRow['NOTE_CONTENT']), ENT_QUOTES, 'UTF-8');
         $response['notes'][] = $aRow;
         $oDataset->next();
     }
     $result['criteria'] = $Criteria;
     $result['array'] = $response;
     return $result;
 }