本文整理汇总了PHP中G::LoadTranslation方法的典型用法代码示例。如果您正苦于以下问题:PHP G::LoadTranslation方法的具体用法?PHP G::LoadTranslation怎么用?PHP G::LoadTranslation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类G
的用法示例。
在下文中一共展示了G::LoadTranslation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTemporalFields
/**
* this function get the fields that are part of the temporal
* dynaform file.
*
* @name getTemporalFields
* @author gustavo cruz
* @access public
* @param $file - the name of the dynaform file
* @return invalidFields string
*/
function getTemporalFields($file)
{
try {
//$G_PUBLISH->AddContent('pagedtable', 'paged-table', 'dynaforms/fields_List', 'display:none', $Parameters , '', SYS_URI.'dynaforms/dynaforms_PagedTableAjax');
$i = 0;
$aFields = array();
$aFields[] = array('XMLNODE_NAME' => 'char', 'TYPE' => 'char', 'UP' => 'char', 'DOWN' => 'char');
$oSession = new DBSession(new DBConnection(PATH_DYNAFORM . $file . '_tmp0.xml', '', '', '', 'myxml'));
$oDataset = $oSession->Execute('SELECT * FROM dynaForm WHERE NOT( XMLNODE_NAME = "" ) AND TYPE <> "pmconnection"');
$iMaximun = $oDataset->count();
while ($aRow = $oDataset->Read()) {
$aFields[] = array('XMLNODE_NAME' => $aRow['XMLNODE_NAME'], 'TYPE' => $aRow['TYPE'], 'UP' => $i > 0 ? G::LoadTranslation('ID_UP') : '', 'DOWN' => $i < $iMaximun - 1 ? G::LoadTranslation('ID_DOWN') : '', 'row__' => $i + 1);
$i++;
}
// print_r($aFields);
// die;
} catch (Exception $e) {
}
$invalidFields = validateGridConversion($aFields);
if (count($invalidFields) > 0) {
return implode(", ", $invalidFields);
} else {
return "ok";
}
}
示例2: saveInputDoc
public function saveInputDoc($params)
{
require_once 'classes/model/InputDocument.php';
G::LoadClass('processMap');
$aData = array();
$aData['PRO_UID'] = $params->PRO_UID;
$aData['INP_DOC_UID'] = $params->INP_DOC_UID;
$aData['INP_DOC_TITLE'] = $params->INP_DOC_TITLE;
$aData['INP_DOC_FORM_NEEDED'] = $params->INP_DOC_FORM_NEEDED;
if ($aData['INP_DOC_FORM_NEEDED'] != 'VIRTUAL') {
$aData['INP_DOC_ORIGINAL'] = $params->INP_DOC_ORIGINAL;
} else {
$aData['INP_DOC_ORIGINAL'] = 'ORIGINAL';
}
$aData['INP_DOC_VERSIONING'] = $params->INP_DOC_VERSIONING;
$aData['INP_DOC_DESCRIPTION'] = $params->INP_DOC_DESCRIPTION;
$aData['INP_DOC_DESTINATION_PATH'] = $params->INP_DOC_DESTINATION_PATH;
$aData['INP_DOC_TAGS'] = $params->INP_DOC_TAGS;
$oInputDocument = new InputDocument();
if ($aData['INP_DOC_UID'] == '') {
unset($aData['INP_DOC_UID']);
$oInputDocument->create($aData);
$this->msg = G::LoadTranslation('ID_INPUT_DOC_SUCCESS_NEW');
} else {
$oInputDocument->update($aData);
$this->msg = G::LoadTranslation('ID_INPUT_DOC_SUCCESS_UPDATE');
}
//refresh dbarray with the last change in inputDocument
$oMap = new processMap();
$oCriteria = $oMap->getInputDocumentsCriteria($aData['PRO_UID']);
$this->success = true;
}
示例3: AuthenticationBasicHTTP
function AuthenticationBasicHTTP($realm)
{
if (empty($_SERVER['PHP_AUTH_USER']) && empty($_SERVER['REDIRECT_REMOTE_USER'])) {
header('WWW-Authenticate: Basic realm="' . $realm . '"');
header('HTTP/1.0 401 Unauthorized');
die('401 Unauthorized');
}
global $RBAC;
$uid = $RBAC->VerifyLogin($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
if ($uid > 0) {
// Asign the uid of user to userloggedobj
$RBAC->loadUserRolePermission($RBAC->sSystem, $uid);
$res = $RBAC->userCanAccess('PM_WEBDAV');
if ($res != 1) {
if ($res == -2) {
$msg = G::LoadTranslation('ID_USER_HAVENT_RIGHTS_SYSTEM');
} else {
$msg = G::LoadTranslation('ID_USER_HAVENT_RIGHTS_PAGE');
}
header('WWW-Authenticate: Basic realm="' . $realm . '"');
header('HTTP/1.0 401 ' . $msg);
die('401 ' . $msg);
return false;
die;
}
return true;
}
header('WWW-Authenticate: Basic realm="' . $realm . '"');
header('HTTP/1.0 401 Unauthorized');
die('401 Unauthorized');
return false;
}
示例4: create
/**
* Create record
*
* @param string $applicationUid Unique id of Case
* @param int $delIndex Delegation index
* @param array $arrayData Data
*
* return void
*/
public function create($applicationUid, $delIndex, array $arrayData)
{
try {
$cnn = Propel::getConnection(AppAssignSelfServiceValuePeer::DATABASE_NAME);
try {
$appAssignSelfServiceValue = new AppAssignSelfServiceValue();
$appAssignSelfServiceValue->fromArray($arrayData, BasePeer::TYPE_FIELDNAME);
$appAssignSelfServiceValue->setAppUid($applicationUid);
$appAssignSelfServiceValue->setDelIndex($delIndex);
if ($appAssignSelfServiceValue->validate()) {
$cnn->begin();
$result = $appAssignSelfServiceValue->save();
$cnn->commit();
} else {
$msg = "";
foreach ($appAssignSelfServiceValue->getValidationFailures() as $validationFailure) {
$msg .= ($msg != "" ? "\n" : "") . $validationFailure->getMessage();
}
throw new Exception(G::LoadTranslation("ID_RECORD_CANNOT_BE_CREATED") . ($msg != "" ? "\n" . $msg : ""));
}
} catch (Exception $e) {
$cnn->rollback();
throw $e;
}
} catch (Exception $e) {
throw $e;
}
}
示例5: create
public function create(array $arrayData)
{
$cnn = Propel::getConnection(ConfigurationPeer::DATABASE_NAME);
try {
$this->setCfgUid($arrayData["CFG_UID"]);
$this->setObjUid($arrayData["OBJ_UID"]);
$this->setCfgValue(isset($arrayData["CFG_VALUE"]) ? $arrayData["CFG_VALUE"] : "");
$this->setProUid($arrayData["PRO_UID"]);
$this->setUsrUid($arrayData["USR_UID"]);
$this->setAppUid($arrayData["APP_UID"]);
if ($this->validate()) {
$cnn->begin();
$result = $this->save();
$cnn->commit();
//Return
return $result;
} else {
$msg = "";
foreach ($this->getValidationFailures() as $validationFailure) {
$msg = $msg . ($msg != "" ? "\n" : "") . $validationFailure->getMessage();
}
throw new Exception(G::LoadTranslation("ID_RECORD_CANNOT_BE_CREATED") . ($msg != "" ? "\n" . $msg : ""));
}
} catch (Exception $e) {
$cnn->rollback();
throw $e;
}
}
示例6: calendarEdit
/**
* CALENDAR
* getting default list
* @param string $httpData->PRO_UID (opional)
*/
public function calendarEdit($httpData)
{
global $RBAC;
//$RBAC->requirePermissions('PM_SETUP_ADVANCE');
G::LoadClass('configuration');
G::LoadClass('calendar');
$CalendarUid = str_replace('"', '', isset($_GET['id']) ? $_GET['id'] : G::GenerateUniqueID());
$calendarObj = new calendar();
if (isset($_GET['id']) && $_GET['id'] != "") {
$fields = $calendarObj->getCalendarInfoE($CalendarUid);
$fields['OLD_NAME'] = $fields['CALENDAR_NAME'];
}
if (!isset($fields['CALENDAR_UID'])) {
//For a new Calendar
$fields['CALENDAR_UID'] = $CalendarUid;
$fields['OLD_NAME'] = '';
//Default Business Hour
$fields['BUSINESS_DAY'][1]['CALENDAR_BUSINESS_DAY'] = 7;
$fields['BUSINESS_DAY'][1]['CALENDAR_BUSINESS_START'] = "09:00";
$fields['BUSINESS_DAY'][1]['CALENDAR_BUSINESS_END'] = "17:00";
}
if (isset($_GET['cp']) && $_GET['cp'] == 1) {
// Copy Calendar
$fields['CALENDAR_UID'] = G::GenerateUniqueID();
$fields['CALENDAR_NAME'] = G::LoadTranslation("ID_COPY_OF") . " " . $fields['CALENDAR_NAME'];
$fields['OLD_NAME'] = $fields['CALENDAR_NAME'];
}
$c = new Configurations();
$configPage = $c->getConfiguration('additionalTablesList', 'pageSize', '', $_SESSION['USER_LOGGED']);
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
$this->includeExtJS('admin/calendarEdit');
$this->setView('admin/calendarEdit');
$businessDayArray = array();
for ($i = 0; $i < sizeof($fields['BUSINESS_DAY']); $i++) {
$businessDayArray[$i] = $fields['BUSINESS_DAY'][$i + 1];
}
$fields['BUSINESS_DAY'] = $businessDayArray;
//validating if the calendar is new, it means that we don't have the $_GET array
$fields['HOLIDAY'] = isset($_GET['id']) && $_GET['id'] != '' ? $fields['HOLIDAY'] : array();
$holidayArray = array();
for ($i = 0; $i < sizeof($fields['HOLIDAY']); $i++) {
$holidayArray[$i] = $fields['HOLIDAY'][$i + 1];
}
$_GET['id'] = isset($_GET['id']) && $_GET['id'] != '' ? $_GET['id'] : '';
$fields['HOLIDAY'] = $holidayArray;
$fields['NEWCALENDAR'] = 'NO';
if (isset($_GET['id']) && $_GET['id'] == '') {
$fields['CALENDAR_UID'] = G::GenerateUniqueID();
$fields['NEWCALENDAR'] = 'YES';
}
$this->setJSVar('CALENDAR_UID', $fields['CALENDAR_UID']);
$this->setJSVar('fields', $fields);
G::RenderPage('publish', 'extJs');
}
示例7: __construct
/**
* Constructor of the class
*
* return void
*/
public function __construct()
{
try {
$user = new \ProcessMaker\BusinessModel\User();
$usrUid = $this->getUserId();
if (!$user->checkPermission($usrUid, "PM_SETUP")) {
throw new \Exception(\G::LoadTranslation("ID_USER_NOT_HAVE_PERMISSION", array($usrUid)));
}
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
示例8: __construct
/**
* Constructor of the class
*
* return void
*/
public function __construct()
{
try {
$user = new \ProcessMaker\BusinessModel\User();
$usrUid = $this->getUserId();
if (!$user->checkPermission($usrUid, "PM_USERS")) {
throw new \Exception(\G::LoadTranslation("ID_USER_NOT_HAVE_PERMISSION", array($usrUid)));
}
$this->role = new \ProcessMaker\BusinessModel\Role();
$this->role->setFormatFieldNameInUppercase(false);
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
示例9: deleteCase
function deleteCase($params)
{
$ainfoCase = array();
try {
$applicationUID = isset($_POST['APP_UID']) ? $_POST['APP_UID'] : $_SESSION['APPLICATION'];
$app = new Application();
$caseData = $app->load($applicationUID);
$data['APP_NUMBER'] = $caseData['APP_NUMBER'];
$oCase = new Cases();
$oCase->removeCase($applicationUID);
$this->success = true;
$this->msg = G::LoadTranslation('ID_CASE_DELETED_SUCCESSFULLY', SYS_LANG, $data);
} catch (Exception $e) {
$this->success = false;
$this->msg = $e->getMessage();
}
}
示例10: changeSequence
/**
* Change Sequence with native query
*
* @param type $seqName
* @param type $seqValue
* @return type
*
*/
public function changeSequence($seqName, $seqValue)
{
try {
$con = Propel::getConnection('workflow');
if ($this->nameExists($seqName)) {
$sql = "UPDATE SEQUENCES SET SEQ_VALUE = {$seqValue} WHERE SEQ_NAME = '{$seqName}' ";
} else {
$sql = "INSERT INTO SEQUENCES (`SEQ_NAME`,`SEQ_VALUE`) VALUES ('{$seqName}', {$seqValue}) ";
}
$stmt = $con->createStatement();
$rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
return $rs;
} catch (Exception $e) {
// throw ($e);
throw new Exception(G::LoadTranslation('ID_ERROR_CHANGE_SEQUENCE_NUMBER'));
}
}
示例11: saveConfigPmGmail
public function saveConfigPmGmail($httpData)
{
G::LoadClass("pmGoogleApi");
$pmGoogle = new PMGoogleApi();
$result = new StdClass();
$result->success = true;
if (!empty($httpData->status_pmgmail)) {
$httpData->status_pmgmail = $httpData->status_pmgmail == 1 ? true : false;
$pmGoogle->setStatusService($httpData->status_pmgmail);
$message = G::LoadTranslation('ID_ENABLE_PMGMAIL') . ': ' . ($httpData->status_pmgmail ? G::LoadTranslation('ID_ENABLE') : G::LoadTranslation('ID_DISABLE'));
$pmGoogle->setTypeAuthentication($httpData->typeAuth);
if (!empty($httpData->email_service_account)) {
$pmGoogle->setServiceAccountEmail($httpData->email_service_account);
$message .= ', ' . G::LoadTranslation('ID_PMG_EMAIL') . ': ' . $httpData->email_service_account;
}
if (!empty($_FILES)) {
if (!empty($_FILES['file_p12']) && $_FILES['file_p12']['error'] != 1) {
if ($_FILES['file_p12']['tmp_name'] != '') {
G::uploadFile($_FILES['file_p12']['tmp_name'], PATH_DATA_SITE, $_FILES['file_p12']['name']);
$pmGoogle->setServiceAccountP12($_FILES['file_p12']['name']);
$message .= ', ' . G::LoadTranslation('ID_PMG_FILE') . ': ' . $_FILES['file_p12']['name'];
}
} else {
if (!empty($_FILES['file_json']) && $_FILES['file_json']['error'] != 1) {
if ($_FILES['file_json']['tmp_name'] != '') {
G::uploadFile($_FILES['file_json']['tmp_name'], PATH_DATA_SITE, $_FILES['file_json']['name']);
$pmGoogle->setAccountJson($_FILES['file_json']['name']);
$message .= ', ' . G::LoadTranslation('ID_PMG_FILE') . ': ' . $_FILES['file_json']['name'];
}
} else {
$result->success = false;
$result->fileError = true;
print G::json_encode($result);
die;
}
}
}
} else {
$pmGoogle->setStatusService(false);
$message = G::LoadTranslation('ID_ENABLE_PMGMAIL') . ': ' . G::LoadTranslation('ID_DISABLE');
}
G::auditLog("Update Settings Gmail", $message);
print G::json_encode($result);
}
示例12: getProcessArray
function getProcessArray($userUid)
{
global $oAppCache;
require_once "classes/model/AppCacheView.php";
$processes = array();
$processes[] = array('', G::LoadTranslation('ID_ALL_PROCESS'));
$cProcess = new Criteria('workflow');
$cProcess->clearSelectColumns();
$cProcess->addSelectColumn(AppCacheViewPeer::PRO_UID);
$cProcess->addSelectColumn(AppCacheViewPeer::APP_PRO_TITLE);
$cProcess->setDistinct(AppCacheViewPeer::PRO_UID);
$cProcess->addAscendingOrderByColumn(AppCacheViewPeer::APP_PRO_TITLE);
$oDataset = AppCacheViewPeer::doSelectRS($cProcess);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$processes[] = array($aRow['PRO_UID'], $aRow['APP_PRO_TITLE']);
$oDataset->next();
}
return $processes;
}
示例13: getCalendarList
function getCalendarList($onlyActive = false, $arrayMode = false)
{
$Criteria = new Criteria('workflow');
$Criteria->clearSelectColumns();
$Criteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_UID);
$Criteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_NAME);
$Criteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_CREATE_DATE);
$Criteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_UPDATE_DATE);
$Criteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_DESCRIPTION);
$Criteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_STATUS);
// $Criteria->addAsColumn('DELETABLE', "IF (CALENDAR_UID <> '00000000000000000000000000000001', '".G::LoadTranslation('ID_DELETE')."','') ");
$Criteria->addAsColumn('DELETABLE', "CASE WHEN CALENDAR_UID <> '00000000000000000000000000000001' THEN '" . G::LoadTranslation('ID_DELETE') . "' ELSE '' END ");
// Note: This list doesn't show deleted items (STATUS = DELETED)
if ($onlyActive) {
// Show only active. Used on assignment lists
$Criteria->add(calendarDefinitionPeer::CALENDAR_STATUS, "ACTIVE", CRITERIA::EQUAL);
} else {
// Show Active and Inactive calendars. USed in main list
$Criteria->add(calendarDefinitionPeer::CALENDAR_STATUS, array("ACTIVE", "INACTIVE"), CRITERIA::IN);
}
$Criteria->add(calendarDefinitionPeer::CALENDAR_UID, "xx", CRITERIA::NOT_EQUAL);
if (!$arrayMode) {
return $Criteria;
} else {
$oDataset = calendarDefinitionPeer::doSelectRS($Criteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$calendarA = array(0 => 'dummy');
$calendarCount = 0;
while (is_array($aRow = $oDataset->getRow())) {
$calendarCount++;
$calendarA[$calendarCount] = $aRow;
$oDataset->next();
}
$return['criteria'] = $Criteria;
$return['array'] = $calendarA;
return $return;
}
}
示例14: reservedWordsSqlValidate
function reservedWordsSqlValidate($data)
{
$arrayAux = array();
$reservedWordsSql = G::reservedWordsSql();
foreach ($data->reportTables as $rptIndex => $rptValue) {
if (in_array(strtoupper($rptValue["REP_TAB_NAME"]), $reservedWordsSql)) {
$arrayAux[] = $rptValue["REP_TAB_NAME"];
}
}
if (count($arrayAux) > 0) {
throw new Exception(G::LoadTranslation("ID_PMTABLE_INVALID_NAME", array(implode(", ", $arrayAux))));
}
$arrayAux = array();
foreach ($data->reportTablesVars as $rptIndex => $rptValue) {
if (in_array(strtoupper($rptValue["REP_VAR_NAME"]), $reservedWordsSql)) {
$arrayAux[] = $rptValue["REP_VAR_NAME"];
}
}
if (count($arrayAux) > 0) {
throw new Exception(G::LoadTranslation("ID_PMTABLE_INVALID_FIELD_NAME", array(implode(", ", $arrayAux))));
}
}
示例15: updateDevice
/**
* Update register device with userUid
*
* @param array $request_data
* @param string $dev_uid
* @param string $use_uid
* @author Ronald Quenta <ronald.quenta@processmaker.com>
*
*/
public function updateDevice($dev_uid, $use_uid, $request_data)
{
$arrayData = array();
$arrayData['USR_UID'] = $use_uid;
$arrayData['DEV_UID'] = $dev_uid;
if (isset($request_data['deviceIdToken'])) {
$arrayData['DEV_REG_ID'] = $request_data['deviceIdToken'];
}
if (isset($request_data['sysLanguage'])) {
$arrayData['SYS_LANG'] = $request_data['sysLanguage'];
}
if (isset($request_data['deviceType'])) {
$arrayData['DEV_TYPE'] = $request_data['deviceType'];
}
$oNoti = new \NotificationDevice();
$response = array();
if ($oNoti->update($arrayData)) {
$response["message"] = G::LoadTranslation("ID_RECORD_SAVED_SUCCESFULLY");
G::auditLog("Update", "Device Save: Device ID (" . $oNoti->getDevUid() . ") ");
}
return $response;
}