本文整理汇总了PHP中G::toUpper方法的典型用法代码示例。如果您正苦于以下问题:PHP G::toUpper方法的具体用法?PHP G::toUpper怎么用?PHP G::toUpper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类G
的用法示例。
在下文中一共展示了G::toUpper方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getList
//.........这里部分代码省略.........
$filters["limit"] = (int)$filters["limit"];
$filters["limit"] = abs($filters["limit"]);
if ($filters["limit"] == 0) {
G::LoadClass("configuration");
$conf = new \Configurations();
$generalConfCasesList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');
if (isset($generalConfCasesList['casesListRowNumber'])) {
$filters["limit"] = (int)$generalConfCasesList['casesListRowNumber'];
} else {
$filters["limit"] = 25;
}
} else {
$filters["limit"] = (int)$filters["limit"];
}
$filters["sort"] = G::toUpper($filters["sort"]);
$columnsList = $listpeer::getFieldNames(\BasePeer::TYPE_FIELDNAME);
if (!(in_array($filters["sort"], $columnsList))) {
$filters["sort"] = '';
}
$filters["dir"] = G::toUpper($filters["dir"]);
if (!($filters["dir"] == 'DESC' || $filters["dir"] == 'ASC')) {
$filters["dir"] = 'DESC';
}
if ($filters["process"] != '') {
Validator::proUid($filters["process"], '$pro_uid');
}
if ($filters["category"] != '') {
Validator::catUid($filters["category"], '$cat_uid');
}
if ($filters["dateFrom"] != '') {
示例2: getTriggerWebBotProcess
public function getTriggerWebBotProcess($proUid, $action)
{
require_once "classes/model/Triggers.php";
if (!isset($proUid) && $proUid == '' || !isset($action) && $action == '') {
return false;
}
$action = G::toUpper($action);
$webBotTrigger = '';
switch ($action) {
case 'OPEN':
$var = ProcessPeer::PRO_TRI_OPEN;
break;
case 'DELETED':
$var = ProcessPeer::PRO_TRI_DELETED;
break;
case 'CANCELED':
$var = ProcessPeer::PRO_TRI_CANCELED;
break;
case 'PAUSED':
$var = ProcessPeer::PRO_TRI_PAUSED;
break;
case 'REASSIGNED':
$var = ProcessPeer::PRO_TRI_REASSIGNED;
break;
case "UNPAUSE":
$var = ProcessPeer::PRO_TRI_UNPAUSED;
break;
}
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn($var);
$oCriteria->addSelectColumn(TriggersPeer::TRI_WEBBOT);
$oCriteria->addJoin($var, TriggersPeer::TRI_UID, Criteria::LEFT_JOIN);
$oCriteria->add(ProcessPeer::PRO_UID, $proUid);
$oDataSet = ProcessPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro'));
$oDataSet->setFetchmode(ResultSet::FETCHMODE_ASSOC);
if ($oDataSet->next()) {
$row = $oDataSet->getRow();
$webBotTrigger = $row['TRI_WEBBOT'];
}
return $webBotTrigger;
}
示例3: getListDashboards
/**
* Get list All dashboards
*
* @access public
* @param array $options, Data for list
* @return array
*
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
* @copyright Colosa - Bolivia
*/
public function getListDashboards($options = array())
{
Validator::isArray($options, '$options');
G::LoadClass("dashboards");
$dir = isset( $options["dir"] ) ? $options["dir"] : "DESC";
$sort = isset( $options["sort"] ) ? $options["sort"] : "DASHBOARD.DAS_TITLE";
$start = isset( $options["start"] ) ? $options["start"] : "0";
$limit = isset( $options["limit"] ) ? $options["limit"] : "";
$search = isset( $options["search"] ) ? $options["search"] : "";
$paged = isset( $options["paged"] ) ? $options["paged"] : true;
$type = "extjs";
$start = (int)$start;
$start = abs($start);
if ($start != 0) {
$start--;
}
$limit = (int)$limit;
$limit = abs($limit);
if ($limit == 0) {
G::LoadClass("configuration");
$conf = new \Configurations();
$configList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');
if (isset($configList['casesListRowNumber'])) {
$limit = (int)$configList['casesListRowNumber'];
} else {
$limit = 25;
}
} else {
$limit = (int)$limit;
}
if ($sort != 'DASHBOARD.DAS_TITLE') {
$sort = G::toUpper($sort);
$columnsAppCacheView = DashboardPeer::getFieldNames(\BasePeer::TYPE_FIELDNAME);
if (!(in_array($sort, $columnsAppCacheView))) {
$sort = 'APP_CACHE_VIEW.APP_NUMBER';
}
}
$dir = G::toUpper($dir);
if (!($dir == 'DESC' || $dir == 'ASC')) {
$dir = 'DESC';
}
$dashboards = new \Dashboards();
$result = $dashboards->getListDashboards($start, $limit, $sort, $dir, $search);
if ($paged == false) {
$response = $result['data'];
} else {
$response['total'] = $result['totalCount'];
$response['start'] = $start+1;
$response['limit'] = $limit;
$response['sort'] = G::toLower($sort);
$response['dir'] = G::toLower($dir);
$response['search'] = $search;
$response['data'] = $result['data'];
}
return $response;
}
示例4: unset
$_SESSION['PMDEBUGGER'] = false;
}
//cleaning debug variables
if (!isset($_GET['breakpoint'])) {
if (isset($_SESSION['TRIGGER_DEBUG']['info'])) {
unset($_SESSION['TRIGGER_DEBUG']['info']);
}
if (!isset($_SESSION['_NO_EXECUTE_TRIGGERS_'])) {
$_SESSION['TRIGGER_DEBUG']['ERRORS'] = array();
}
$_SESSION['TRIGGER_DEBUG']['DATA'] = array();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = array();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = array();
$triggers = $oCase->loadTriggers($_SESSION['TASK'], $_GET['TYPE'], $_GET['UID'], 'BEFORE');
$_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] = count($triggers);
$_SESSION['TRIGGER_DEBUG']['TIME'] = G::toUpper(G::loadTranslation('ID_BEFORE'));
if ($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0) {
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = $oCase->getTriggerNames($triggers);
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = $triggers;
}
if (!isset($_SESSION['_NO_EXECUTE_TRIGGERS_'])) {
//Execute before triggers - Start
$Fields['APP_DATA'] = $oCase->ExecuteTriggers($_SESSION['TASK'], $_GET['TYPE'], $_GET['UID'], 'BEFORE', $Fields['APP_DATA']);
$Fields['DEL_INDEX'] = $_SESSION['INDEX'];
$Fields['TAS_UID'] = $_SESSION['TASK'];
//Execute before triggers - End
} else {
unset($_SESSION['_NO_EXECUTE_TRIGGERS_']);
$Fields['DEL_INDEX'] = $_SESSION['INDEX'];
$Fields['TAS_UID'] = $_SESSION['TASK'];
}
示例5: verifyCaseTracker
public function verifyCaseTracker($case, $pin)
{
//CASE INSENSITIVE pin
$pin = G::toUpper($pin);
$pin = G::encryptOld($pin);
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ApplicationPeer::APP_UID);
$oCriteria->addSelectColumn(ApplicationPeer::APP_PIN);
$oCriteria->addSelectColumn(ApplicationPeer::PRO_UID);
$oCriteria->addSelectColumn(ApplicationPeer::APP_NUMBER);
$oCriteria->addSelectColumn(ApplicationPeer::APP_PROC_CODE);
//$oCriteria->add(ApplicationPeer::APP_NUMBER, $case);
$oCriteria->add(ApplicationPeer::APP_PROC_CODE, $case);
$oDataset = DynaformPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
$sw = 0;
if (is_array($aRow)) {
$PRO_UID = $aRow['PRO_UID'];
$APP_UID = $aRow['APP_UID'];
$PIN = $aRow['APP_PIN'];
} else {
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ApplicationPeer::APP_UID);
$oCriteria->addSelectColumn(ApplicationPeer::APP_PIN);
$oCriteria->addSelectColumn(ApplicationPeer::PRO_UID);
$oCriteria->addSelectColumn(ApplicationPeer::APP_NUMBER);
$oCriteria->addSelectColumn(ApplicationPeer::APP_PROC_CODE);
$oCriteria->add(ApplicationPeer::APP_NUMBER, $case);
$oDataseti = DynaformPeer::doSelectRS($oCriteria);
$oDataseti->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataseti->next();
$aRowi = $oDataseti->getRow();
if (is_array($aRowi)) {
$PRO_UID = $aRowi['PRO_UID'];
$APP_UID = $aRowi['APP_UID'];
$PIN = $aRowi['APP_PIN'];
} else {
$sw = 1;
}
}
$s = 0;
if ($sw == 1) {
//.........这里部分代码省略.........
示例6: Configurations
$conf = new Configurations();
$generalConfCasesList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');
if (isset($generalConfCasesList['casesListRowNumber'])) {
$filters['limit'] = (int) $generalConfCasesList['casesListRowNumber'];
} else {
$filters['limit'] = 25;
}
} else {
$filters['limit'] = (int) $filters['limit'];
}
$filters['sort'] = G::toUpper($filters['sort']);
$columnsList = $listpeer::getFieldNames(BasePeer::TYPE_FIELDNAME);
if (!in_array($filters['sort'], $columnsList)) {
$filters['sort'] = '';
}
$filters['dir'] = G::toUpper($filters['dir']);
if (!($filters['dir'] == 'DESC' || $filters['dir'] == 'ASC')) {
$filters['dir'] = 'DESC';
}
$result = $list->loadList($userUid, $filters, function (array $record) {
try {
if (isset($record["DEL_PREVIOUS_USR_UID"])) {
if ($record["DEL_PREVIOUS_USR_UID"] == "") {
$appDelegation = AppDelegationPeer::retrieveByPK($record["APP_UID"], $record["DEL_INDEX"]);
if (!is_null($appDelegation)) {
$appDelegationPrevious = AppDelegationPeer::retrieveByPK($record["APP_UID"], $appDelegation->getDelPrevious());
if (!is_null($appDelegationPrevious)) {
$taskPrevious = TaskPeer::retrieveByPK($appDelegationPrevious->getTasUid());
if (!is_null($taskPrevious)) {
switch ($taskPrevious->getTasType()) {
case "SCRIPT-TASK":
示例7: testToUpper
/**
* @covers G::toUpper
* @todo Implement testToUpper().
*/
public function testToUpper()
{
$name = 'brayan';
$this->assertEquals('BRAYAN', G::toUpper($name));
}
示例8: handleFatalErrors
function handleFatalErrors ($buffer)
{
G::LoadClass( 'case' );
$oCase = new Cases();
if (preg_match( '/(error<\/b>:)(.+)(<br)/', $buffer, $regs )) {
$err = preg_replace( '/<.*?>/', '', $regs[2] );
$aAux = explode( ' in ', $err );
$sCode = isset($_SESSION['_CODE_']) ? $_SESSION['_CODE_'] : null;
unset( $_SESSION['_CODE_'] );
registerError( 2, $aAux[0], 0, $sCode );
if (strpos( $_SERVER['REQUEST_URI'], '/cases/cases_Step' ) !== false) {
if (strpos( $_SERVER['REQUEST_URI'], '&ACTION=GENERATE' ) !== false) {
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
if ($_SESSION['TRIGGER_DEBUG']['ISSET']) {
$_SESSION['TRIGGER_DEBUG']['TIME'] = G::toUpper(G::loadTranslation('ID_AFTER'));
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
$aNextStep['PAGE'] = $aNextStep['PAGE'] . '&breakpoint=triggerdebug';
}
global $oPMScript;
if (isset($oPMScript) && isset($_SESSION['APPLICATION'])) {
$oPMScript->aFields['__ERROR__'] = $aAux[0];
$oCase->updateCase($_SESSION['APPLICATION'], array('APP_DATA' => $oPMScript->aFields));
}
G::header( 'Location: ' . $aNextStep['PAGE'] );
die();
}
$_SESSION['_NO_EXECUTE_TRIGGERS_'] = 1;
global $oPMScript;
if (isset($oPMScript) && isset($_SESSION['APPLICATION'])) {
$oPMScript->aFields['__ERROR__'] = $aAux[0];
$oCase->updateCase($_SESSION['APPLICATION'], array('APP_DATA' => $oPMScript->aFields));
}
G::header( 'Location: ' . $_SERVER['REQUEST_URI'] );
die();
} else {
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
if (isset($_SESSION['TRIGGER_DEBUG']['ISSET']) && $_SESSION['TRIGGER_DEBUG']['ISSET']) {
$_SESSION['TRIGGER_DEBUG']['TIME'] = G::toUpper(G::loadTranslation('ID_AFTER'));
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
$aNextStep['PAGE'] = $aNextStep['PAGE'] . '&breakpoint=triggerdebug';
}
if (strpos( $aNextStep['PAGE'], 'TYPE=ASSIGN_TASK&UID=-1' ) !== false) {
G::SendMessageText( 'Fatal error in trigger', 'error' );
}
global $oPMScript;
if (isset($oPMScript) && isset($_SESSION['APPLICATION'])) {
$oPMScript->aFields['__ERROR__'] = $aAux[0];
$oCase->updateCase($_SESSION['APPLICATION'], array('APP_DATA' => $oPMScript->aFields));
}
G::header( 'Location: ' . $aNextStep['PAGE'] );
die();
}
}
return $buffer;
}
示例9: trim
echo $response;
break;
case 'saveNewGroup':
G::LoadClass('groups');
$newGroup['GRP_UID'] = '';
$newGroup['GRP_STATUS'] = G::toUpper($_POST['status']);
$newGroup['GRP_TITLE'] = trim($_POST['name']);
unset($newGroup['GRP_UID']);
$group = new Groupwf();
$group->create($newGroup);
echo '{success: true}';
break;
case 'saveEditGroup':
G::LoadClass('groups');
$editGroup['GRP_UID'] = $_POST['grp_uid'];
$editGroup['GRP_STATUS'] = G::toUpper($_POST['status']);
$editGroup['GRP_TITLE'] = trim($_POST['name']);
$group = new Groupwf();
$group->update($editGroup);
echo '{success: true}';
break;
case 'deleteGroup':
G::LoadClass('groups');
$group = new Groupwf();
if (!isset($_POST['GRP_UID'])) {
return;
}
$group->remove(urldecode($_POST['GRP_UID']));
require_once 'classes/model/TaskUser.php';
$oProcess = new TaskUser();
$oCriteria = new Criteria('workflow');
示例10: unset
unset($appFields['APP_PIN']);
$oCase->updateCase($_SESSION['APPLICATION'], $appFields);
//Save data
//derivate case
$oDerivation = new Derivation();
$aCurrentDerivation = array('APP_UID' => $_SESSION['APPLICATION'], 'DEL_INDEX' => $_SESSION['INDEX'], 'APP_STATUS' => $sStatus, 'TAS_UID' => $_SESSION['TASK'], 'ROU_TYPE' => $_POST['form']['ROU_TYPE']);
$oDerivation->derivate($aCurrentDerivation, $_POST['form']['TASKS']);
$appFields = $oCase->loadCase($_SESSION['APPLICATION']);
//refresh appFields, because in derivations should change some values
$triggers = $oCase->loadTriggers($_SESSION['TASK'], 'ASSIGN_TASK', -2, 'AFTER');
//load the triggers after derivation
if (sizeof($triggers) > 0) {
$appFields['APP_DATA'] = $oCase->ExecuteTriggers($_SESSION['TASK'], 'ASSIGN_TASK', -2, 'AFTER', $appFields['APP_DATA']);
//Execute triggers after derivation
$_SESSION['TRIGGER_DEBUG']['info'][1]['NUM_TRIGGERS'] = sizeof($triggers);
$_SESSION['TRIGGER_DEBUG']['info'][1]['TIME'] = G::toUpper(G::loadTranslation('ID_AFTER'));
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_NAMES'] = $oCase->getTriggerNames($triggers);
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_VALUES'] = $triggers;
}
unset($appFields['APP_STATUS']);
unset($appFields['APP_PROC_STATUS']);
unset($appFields['APP_PROC_CODE']);
unset($appFields['APP_PIN']);
$oCase->updateCase($_SESSION['APPLICATION'], $appFields);
// Send notifications - Start
$oUser = new Users();
$aUser = $oUser->load($_SESSION['USER_LOGGED']);
if (trim($aUser['USR_EMAIL']) == '') {
$aUser['USR_EMAIL'] = 'info@' . $_SERVER['HTTP_HOST'];
}
$sFromName = '"' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . '" <' . $aUser['USR_EMAIL'] . '>';
示例11: upperCase
/**
*
* @method
*
* Returns a string converted into all UPPERCASE letters.
*
* @name upperCase
* @label Upper Case
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#upperCase.28.29
*
* @param string(32) | $sText | Text To Convert | A string to convert to UPPERCASE letters.
* @return string | $TextC | Text Converted | Returns a string with the text converted into upper case letters.
*
*/
function upperCase($sText)
{
return G::toUpper($sText);
}
示例12: dashCalculateDate
public function dashCalculateDate ($iniDate, $duration, $formatDuration, $calendarData = array())
{
if ( G::toUpper($formatDuration) == 'DAYS' ) {
$duration = $duration*$calendarData['HOURS_FOR_DAY'];
}
if ( G::toUpper($formatDuration) == 'MINUTES' ) {
$duration = $duration/60;
}
$hoursDuration = (float)$duration;
$newDate = $iniDate;
while ($hoursDuration > 0) {
$newDate = $this->dashGetIniDate($newDate, $calendarData);
$rangeWorkHour = $this->dashGetRangeWorkHours($newDate, $calendarData['BUSINESS_DAY']);
$onlyDate = (date('Y-m-d',strtotime($newDate))) . ' ' . $rangeWorkHour['END'];
if ( (((float)$hoursDuration) >= ((float)$rangeWorkHour['TOTAL'])) ||
((strtotime($onlyDate) - strtotime($newDate)) < (((float)$hoursDuration)*3600))
) {
$secondRes = (float)(strtotime($onlyDate) - strtotime($newDate));
$newDate = $onlyDate;
$hoursDuration -= (float)($secondRes/3600);
} else {
$newDate = date('Y-m-d H:i:s', strtotime('+' . (((float)$hoursDuration)*3600) . ' seconds', strtotime($newDate)));
$hoursDuration = 0;
}
}
return $newDate;
}
示例13: md5
}
$aData['USR_AUTH_USER_DN'] = $aUser['sDN'];
$sUserUID = $RBAC->createUser($aData, 'PROCESSMAKER_OPERATOR');
$aData['USR_STATUS'] = 'ACTIVE';
$aData['USR_UID'] = $sUserUID;
$aData['USR_PASSWORD'] = md5($sUserUID);
//fake :p
$aData['USR_ROLE'] = 'PROCESSMAKER_OPERATOR';
if (count($aAttributes)) {
foreach ($aAttributes as $value) {
if (isset($aUser[$value['attributeUser']])) {
$aData[$value['attributeUser']] = str_replace("*", "'", $aUser[$value['attributeUser']]);
if ($value['attributeUser'] == 'USR_STATUS') {
$evalValue = $aData[$value['attributeUser']];
$statusValue = 'INACTIVE';
if (is_string($evalValue) && G::toUpper($evalValue) == 'ACTIVE') {
$statusValue = 'ACTIVE';
}
if (is_bool($evalValue) && $evalValue == true) {
$statusValue = 'ACTIVE';
}
if ((is_float($evalValue) || is_int($evalValue) || is_integer($evalValue) || is_numeric($evalValue)) && (int) $evalValue != 0) {
$statusValue = 'ACTIVE';
}
$aData[$value['attributeUser']] = $statusValue;
}
}
}
}
require_once 'classes/model/Users.php';
$oUser = new Users();
示例14: getCaseNotes
/**
* Get Case Notes
*
* @access public
* @param string $app_uid, Uid for case
* @return array
*
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*/
public function getCaseNotes($app_uid, $usr_uid, $data_get)
{
Validator::isString($app_uid, '$app_uid');
Validator::appUid($app_uid, '$app_uid');
Validator::isString($usr_uid, '$usr_uid');
Validator::usrUid($usr_uid, '$usr_uid');
Validator::isArray($data_get, '$data_get');
Validator::isArray($data_get, '$data_get');
$start = isset( $data_get["start"] ) ? $data_get["start"] : "0";
$limit = isset( $data_get["limit"] ) ? $data_get["limit"] : "";
$sort = isset( $data_get["sort"] ) ? $data_get["sort"] : "APP_NOTES.NOTE_DATE";
$dir = isset( $data_get["dir"] ) ? $data_get["dir"] : "DESC";
$user = isset( $data_get["user"] ) ? $data_get["user"] : "";
$dateFrom = (!empty( $data_get["dateFrom"] )) ? substr( $data_get["dateFrom"], 0, 10 ) : "";
$dateTo = (!empty( $data_get["dateTo"] )) ? substr( $data_get["dateTo"], 0, 10 ) : "";
$search = isset( $data_get["search"] ) ? $data_get["search"] : "";
$paged = isset( $data_get["paged"] ) ? $data_get["paged"] : true;
$case = new \Cases();
$caseLoad = $case->loadCase($app_uid);
$pro_uid = $caseLoad['PRO_UID'];
$tas_uid = \AppDelegation::getCurrentTask($app_uid);
$respView = $case->getAllObjectsFrom( $pro_uid, $app_uid, $tas_uid, $usr_uid, 'VIEW' );
$respBlock = $case->getAllObjectsFrom( $pro_uid, $app_uid, $tas_uid, $usr_uid, 'BLOCK' );
if ($respView['CASES_NOTES'] == 0 && $respBlock['CASES_NOTES'] == 0) {
throw (new \Exception(\G::LoadTranslation("ID_CASES_NOTES_NO_PERMISSIONS")));
}
if ($sort != 'APP_NOTE.NOTE_DATE') {
$sort = G::toUpper($sort);
$columnsAppCacheView = \AppNotesPeer::getFieldNames(\BasePeer::TYPE_FIELDNAME);
if (!(in_array($sort, $columnsAppCacheView))) {
$sort = 'APP_NOTES.NOTE_DATE';
} else {
$sort = 'APP_NOTES.'.$sort;
}
}
if ((int)$start == 1 || (int)$start == 0) {
$start = 0;
}
$dir = G::toUpper($dir);
if (!($dir == 'DESC' || $dir == 'ASC')) {
$dir = 'DESC';
}
if ($user != '') {
Validator::usrUid($user, '$usr_uid');
}
if ($dateFrom != '') {
Validator::isDate($dateFrom, 'Y-m-d', '$date_from');
}
if ($dateTo != '') {
Validator::isDate($dateTo, 'Y-m-d', '$date_to');
}
$appNote = new \AppNotes();
$note_data = $appNote->getNotesList($app_uid, $user, $start, $limit, $sort, $dir, $dateFrom, $dateTo, $search);
$response = array();
if ($paged === true) {
$response['total'] = $note_data['array']['totalCount'];
$response['start'] = $start;
$response['limit'] = $limit;
$response['sort'] = $sort;
$response['dir'] = $dir;
$response['usr_uid'] = $user;
$response['date_to'] = $dateTo;
$response['date_from'] = $dateFrom;
$response['search'] = $search;
$response['data'] = array();
$con = 0;
foreach ($note_data['array']['notes'] as $value) {
$response['data'][$con]['app_uid'] = $value['APP_UID'];
$response['data'][$con]['usr_uid'] = $value['USR_UID'];
$response['data'][$con]['note_date'] = $value['NOTE_DATE'];
$response['data'][$con]['note_content'] = $value['NOTE_CONTENT'];
$con++;
}
} else {
$con = 0;
foreach ($note_data['array']['notes'] as $value) {
$response[$con]['app_uid'] = $value['APP_UID'];
$response[$con]['usr_uid'] = $value['USR_UID'];
$response[$con]['note_date'] = $value['NOTE_DATE'];
$response[$con]['note_content'] = $value['NOTE_CONTENT'];
$con++;
}
}
return $response;
}
示例15: calculateDate
public function calculateDate($iniDate, $duration, $formatDuration, $calendarData = array())
{
$calendarData = count($calendarData) ? $calendarData : $this->pmCalendarData;
$this->pmCalendarData = $calendarData;
if (G::toUpper($formatDuration) == 'DAYS') {
$duration = $duration * $this->pmCalendarData['HOURS_FOR_DAY'];
}
/*
$log = array();
$titles = array();
$titles[] = 'HOURS';
$titles[] = 'DATE';
$titles[] = '**DAY';
$titles[] = '**RANGE';
$titles[] = '**HOURS RANGE';
$titles[] = '**SUM HOURS';
$titles[] = '**NEXT DATE';
$log[] = $titles;
$dataLog = array();
$dataLog[] = $duration;
$dataLog[] = $iniDate;
$dataLog[] = '-----';
$dataLog[] = '-----';
$dataLog[] = '-----';
$dataLog[] = '-----';
$dataLog[] = '-----';
$log[] = $dataLog;
*/
$hoursDuration = (double) $duration;
$newDate = $iniDate;
while ($hoursDuration > 0) {
//$dataLog = array();
$newDate = $this->getIniDate($newDate);
//$dataLog[] = $hoursDuration;
//$dataLog[] = $newDate;
$rangeWorkHour = $this->getRangeWorkHours($newDate, $calendarData['BUSINESS_DAY']);
$onlyDate = date('Y-m-d', strtotime($newDate)) . ' ' . $rangeWorkHour['END'];
//$dataLog[] = date('l',strtotime($newDate));
//$dataLog[] = $rangeWorkHour['START'] . ' / ' . $rangeWorkHour['END'];
//$dataLog[] = $rangeWorkHour['TOTAL'];
if ((double) $hoursDuration >= (double) $rangeWorkHour['TOTAL'] || strtotime($onlyDate) - strtotime($newDate) < (double) $hoursDuration * 3600) {
$secondRes = (double) (strtotime($onlyDate) - strtotime($newDate));
$newDate = $onlyDate;
$hoursDuration -= (double) ($secondRes / 3600);
//$dataLog[] = (float)($secondRes/3600);
} else {
$newDate = date('Y-m-d H:i:s', strtotime('+' . (double) $hoursDuration * 3600 . ' seconds', strtotime($newDate)));
//$dataLog[] = (float)($hoursDuration);
$hoursDuration = 0;
}
//$dataLog[] = $newDate;
//$log[] = $dataLog;
}
//$this->showLog($log);
$result['DUE_DATE'] = $newDate;
$result['DUE_DATE_SECONDS'] = strtotime($newDate);
return $result;
}