/** * Create the application document registry * * @param array $aData * @return string * */ public function create($aData) { $oConnection = Propel::getConnection(RoutePeer::DATABASE_NAME); try { $sRouteUID = G::generateUniqueID(); $aData['ROU_UID'] = $sRouteUID; $oRoute = new Route(); // validating default values $aData['ROU_TO_LAST_USER'] = $this->validateValue(isset($aData['ROU_TO_LAST_USER']) ? $aData['ROU_TO_LAST_USER'] : '', array('TRUE', 'FALSE'), 'FALSE'); $aData['ROU_OPTIONAL'] = $this->validateValue(isset($aData['ROU_OPTIONAL']) ? $aData['ROU_OPTIONAL'] : '', array('TRUE', 'FALSE'), 'FALSE'); $aData['ROU_SEND_EMAIL'] = $this->validateValue(isset($aData['ROU_SEND_EMAIL']) ? $aData['ROU_SEND_EMAIL'] : '', array('TRUE', 'FALSE'), 'TRUE'); $oRoute->fromArray($aData, BasePeer::TYPE_FIELDNAME); if ($oRoute->validate()) { $oConnection->begin(); $iResult = $oRoute->save(); $oConnection->commit(); return $sRouteUID; } else { $sMessage = ''; $aValidationFailures = $oRoute->getValidationFailures(); foreach ($aValidationFailures as $oValidationFailure) { $sMessage .= $oValidationFailure->getMessage() . '<br />'; } throw new Exception('The registry cannot be created!<br />' . $sMessage); } } catch (Exception $oError) { $oConnection->rollback(); throw $oError; } }
function iniciarBusqueda($numSeccion, $paramStrBuscar) { require_once 'clases/Global.php'; $global = new G(); $busqueda = new memestimeBusqueda(); echo '<input type="hidden" name="strLoQueBusco" value="' . $paramStrBuscar . '" />'; $cursor = $busqueda->buscar($paramStrBuscar, $numSeccion, $numResultados, $strRespuesta); foreach ($cursor as $elemento) { echo '<div class="col-sm-12 col-md-4 col-lg-4"><div class="thumbnail">'; echo '<img class="img-responsive img-circle" src="http://' . $global->getFtpServer() . '/' . $elemento['url'] . '">'; echo '<div class="caption">'; echo "<h3>" . implode(" ", $elemento['nombreImagen']) . "</h3>"; echo '<p><a href="image.php?image=' . $elemento['_id'] . '" class="btn btn-primary" role="button">Ver</a></p>'; echo '</div></div></div>'; } $numIndices = ceil($numResultados / 3); echo '</div>'; echo '<div class="row"><div class="col-md-12 col-lg-12 col-sm-12">'; echo '<input type="hidden" name="numIndices" value= ' . $numIndices . ' />'; echo '<button class="btn btn-default" type="submit" id="btnIrAPrimero" name = "btnIrAPrimero">First</button>'; for ($i = 1; $i <= $numIndices; $i++) { echo '<button class="btn btn-default" type="submit" id="btnIrA' . $i . '" name = "btnIrA' . $i . '" value = ' . $i . '>' . $i . '</button>'; } echo '<button class="btn btn-default" type="submit" id="btnIrAUltimo" name = "btnIrAUltimo">Last</button>'; echo '</div></div>'; }
/** * Constructs a new Log_firebug object. * * @param string $name Ignored. * @param string $ident The identity string. * @param array $conf The configuration array. * @param int $level Log messages up to and including this level. * @access public */ function Log_firebug($name = '', $ident = 'PHP', $conf = array(), $level = PEAR_LOG_DEBUG) { if (!class_exists('G')) { $realdocuroot = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']); $docuroot = explode('/', $realdocuroot); array_pop($docuroot); $pathhome = implode('/', $docuroot) . '/'; array_pop($docuroot); $pathTrunk = implode('/', $docuroot) . '/'; require_once $pathTrunk . 'gulliver/system/class.g.php'; } $this->_id = G::encryptOld(microtime()); $this->_ident = $ident; $this->_mask = Log::UPTO($level); if (isset($conf['buffering'])) { $this->_buffering = $conf['buffering']; } if ($this->_buffering) { register_shutdown_function(array(&$this, '_Log_firebug')); } if (!empty($conf['lineFormat'])) { $this->_lineFormat = str_replace(array_keys($this->_formatMap), array_values($this->_formatMap), $conf['lineFormat']); } if (!empty($conf['timeFormat'])) { $this->_timeFormat = $conf['timeFormat']; } }
/** * Create the application document registry * @param array $aData * @return string **/ public function create($aData) { $oConnection = Propel::getConnection(SwimlanesElementsPeer::DATABASE_NAME); try { $aData['SWI_UID'] = G::generateUniqueID(); $oSwimlanesElements = new SwimlanesElements(); $oSwimlanesElements->fromArray($aData, BasePeer::TYPE_FIELDNAME); if ($oSwimlanesElements->validate()) { $oConnection->begin(); if (isset($aData['SWI_TEXT'])) { $oSwimlanesElements->setSwiEleText($aData['SWI_TEXT']); } $iResult = $oSwimlanesElements->save(); $oConnection->commit(); return $aData['SWI_UID']; } else { $sMessage = ''; $aValidationFailures = $oSwimlanesElements->getValidationFailures(); foreach ($aValidationFailures as $oValidationFailure) { $sMessage .= $oValidationFailure->getMessage() . '<br />'; } throw new Exception('The registry cannot be created!<br />' . $sMessage); } } catch (Exception $oError) { $oConnection->rollback(); throw $oError; } }
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; } }
/** * __construct * * @return void */ function __construct() { //Initialize the Library and register the Default $this->registerFunctionsFileToLibrary(PATH_CORE . "classes" . PATH_SEP . "class.pmFunctions.php", "ProcessMaker Functions"); //Register all registered PLugin Functions if (class_exists('folderData')) { //$folderData = new folderData($sProUid, $proFields['PRO_TITLE'], $sAppUid, $Fields['APP_TITLE'], $sUsrUid); $oPluginRegistry =& PMPluginRegistry::getSingleton(); $aAvailablePmFunctions = $oPluginRegistry->getPmFunctions(); foreach ($aAvailablePmFunctions as $key => $class) { $filePlugin = PATH_PLUGINS . $class . PATH_SEP . 'classes' . PATH_SEP . 'class.pmFunctions.php'; if (file_exists($filePlugin) && !is_dir($filePlugin)) { $this->registerFunctionsFileToLibrary($filePlugin, "ProcessMaker Functions"); } } } //Add External Triggers $dir = G::ExpandPath("classes") . 'triggers'; $filesArray = array(); if (file_exists($dir)) { if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && !is_dir($dir . PATH_SEP . $file)) { $this->registerFunctionsFileToLibrary($dir . PATH_SEP . $file, "ProcessMaker External Functions"); } } closedir($handle); } } }
public function create($aData) { $oConnection = Propel::getConnection(StagePeer::DATABASE_NAME); try { if (isset($aData['STG_UID']) && $aData['STG_UID'] == '') { unset($aData['STG_UID']); } if (!isset($aData['STG_UID'])) { $aData['STG_UID'] = G::generateUniqueID(); } $oStage = new Stage(); $oStage->fromArray($aData, BasePeer::TYPE_FIELDNAME); $oStage->setStgTitle($aData['STG_TITLE']); if ($oStage->validate()) { $oConnection->begin(); $iResult = $oStage->save(); $oConnection->commit(); return $aData['STG_UID']; } else { $sMessage = ''; $aValidationFailures = $oStage->getValidationFailures(); foreach ($aValidationFailures as $oValidationFailure) { $sMessage .= $oValidationFailure->getMessage() . '<br />'; } throw new Exception('The registry cannot be created!<br />' . $sMessage); } } catch (Exception $oError) { $oConnection->rollback(); throw $oError; } }
/** * 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"; } }
function run_create_translation($args, $opts) { G::LoadSystem('inputfilter'); $filter = new InputFilter(); $opts = $filter->xssFilterHard($opts); $args = $filter->xssFilterHard($args); $rootDir = realpath(__DIR__."/../../../../"); $app = new Maveriks\WebApplication(); $app->setRootDir($rootDir); $loadConstants = false; $workspaces = get_workspaces_from_args($args); $lang = array_key_exists("lang", $opts) ? $opts['lang'] : 'en'; $translation = new Translation(); CLI::logging("Updating labels Mafe ...\n"); foreach ($workspaces as $workspace) { try { echo "Updating labels for workspace " . pakeColor::colorize($workspace->name, "INFO") . "\n"; $translation->generateTransaltionMafe($lang); } catch (Exception $e) { echo "Errors upgrading labels for workspace " . CLI::info($workspace->name) . ": " . CLI::error($e->getMessage()) . "\n"; } } CLI::logging("Create successful\n"); }
function create($aData) { try { $sCode = $aData['PER_CODE']; $oCriteria = new Criteria('rbac'); $oCriteria->add(PermissionsPeer::PER_CODE, $sCode); $oDataset = PermissionsPeer::doSelectRS($oCriteria); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->next(); $aRow = $oDataset->getRow(); if (is_array($aRow)) { return 1; } $aData['PER_UID'] = G::generateUniqueID(); $aData['PER_CODE'] = $aData['PER_CODE']; $aData['PER_CREATE_DATE'] = date('Y-m-d H:i:s'); $aData['PER_UPDATE_DATE'] = $aData['PER_CREATE_DATE']; $aData['PER_STATUS'] = 1; $oPermission = new Permissions(); $oPermission->fromArray($aData, BasePeer::TYPE_FIELDNAME); $iResult = $oPermission->save(); return $aData['PER_UID']; } catch (Exception $oError) { throw $oError; } }
function postNote($httpData) { //extract(getExtJSParams()); $appUid = isset($httpData->appUid) ? $httpData->appUid : ''; $usrUid = isset($httpData->usrUid) ? $httpData->usrUid : ''; require_once "classes/model/AppNotes.php"; $appNotes = new AppNotes(); $noteContent = addslashes($httpData->noteText); $result = $appNotes->postNewNote($appUid, $usrUid, $noteContent, false); //return true; //die(); //send the response to client @ini_set('implicit_flush', 1); ob_start(); //echo G::json_encode($result); @ob_flush(); @flush(); @ob_end_flush(); ob_implicit_flush(1); //return true; //send notification in background $noteRecipientsList = array(); G::LoadClass('case'); $oCase = new Cases(); $p = $oCase->getUsersParticipatedInCase($appUid); foreach ($p['array'] as $key => $userParticipated) { $noteRecipientsList[] = $key; } $noteRecipients = implode(",", $noteRecipientsList); $appNotes->sendNoteNotification($appUid, $usrUid, $noteContent, $noteRecipients); }
public function minify() { if ($this->contentType != 'text/css') { G::LoadThirdParty('jsmin', 'jsmin'); $this->content = JSMin::minify($this->content); } }
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; }
function Presentation(&$base, $what, $typ = 0) { global ${"gorum{$what}template"}, $gorumroll; $this->base =& $base; if ($typ) { $this->typ =& $typ; } else { $this->typ =& $base->getTypeInfo(TRUE); } if (isset($this->typ["{$gorumroll->list}: {$what}Template"])) { $this->template = $this->typ["{$gorumroll->list}: {$what}Template"]; } if (isset($this->typ["{$gorumroll->method}: {$what}Template"])) { $this->template = $this->typ["{$gorumroll->method}: {$what}Template"]; } elseif (isset($this->typ["{$what}Template"])) { $this->template = $this->typ["{$what}Template"]; } else { $this->template = ${"gorum{$what}template"}; } $this->innerBordersOnly = G::getSetting($this->typ, "innerBordersOnly"); if ($this->innerBordersOnly) { // a szelso td-k kulso bordereit toroljuk: JavaScript::addOnload("\n \$('.template > table').find('tbody tr:not(.noapply), tfoot tr').find('td:first, th:first').css('border-left', 'none').end().\n find('td:last, th:last').css('border-right', 'none').end().\n find('td.groupsep_v + td').css('border-left', 'none').end().\n find('td.groupsep_v').prev().css('border-right', 'none').end().end().\n slice(-1).find('td').css('border-bottom', 'none');\n ", "innerBordersOnly"); } }
private function renderImagesList() { G::addToRender("forms/admin_copy_image_form.php", BLOCK_PRE_CONTENT, CODE); G::addToRender("admin/mimages_images_table.php", BLOCK_PRE_CONTENT, CODE); //G::addToRender("forms/admin_product_edit_form.php", BLOCK_CONTENT, CODE); G::addToRender("forms/admin_upload_image_form.php", BLOCK_CONTENT, CODE); }
public function create($arrayData) { $cnn = Propel::getConnection(OauthClientsPeer::DATABASE_NAME); try { $cnn->begin(); $id = G::generateCode(32, "ALPHA"); $secret = G::generateUniqueID(); $this->setClientId($id); $this->setClientSecret($secret); $this->setClientName($arrayData["CLIENT_NAME"]); $this->setClientDescription($arrayData["CLIENT_DESCRIPTION"]); $this->setClientWebsite($arrayData["CLIENT_WEBSITE"]); $this->setRedirectUri($arrayData["REDIRECT_URI"]); $this->setUsrUid($arrayData["USR_UID"]); if ($this->validate()) { $result = $this->save(); $cnn->commit(); return array("CLIENT_ID" => $id, "CLIENT_SECRET" => $secret); } else { $cnn->rollback(); throw new Exception("Failed Validation in class \"" . get_class($this) . "\"."); } } catch (Exception $e) { $cnn->rollback(); throw $e; } }
function saveAuthSources($params) { global $RBAC; if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) { G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::header('location: ../login/login'); die; } $aCommonFields = array('AUTH_SOURCE_UID', 'AUTH_SOURCE_NAME', 'AUTH_SOURCE_PROVIDER', 'AUTH_SOURCE_SERVER_NAME', 'AUTH_SOURCE_PORT', 'AUTH_SOURCE_ENABLED_TLS', 'AUTH_ANONYMOUS', 'AUTH_SOURCE_SEARCH_USER', 'AUTH_SOURCE_PASSWORD', 'AUTH_SOURCE_VERSION', 'AUTH_SOURCE_BASE_DN', 'AUTH_SOURCE_OBJECT_CLASSES', 'AUTH_SOURCE_ATTRIBUTES'); $aFields = $aData = array(); unset($params->PHPSESSID); foreach ($params as $sField => $sValue) { if (in_array($sField, $aCommonFields)) { $aFields[$sField] = $sField == 'AUTH_SOURCE_ENABLED_TLS' || $sField == 'AUTH_ANONYMOUS' ? $sValue == 'yes' ? 1 : 0 : $sValue; } else { $aData[$sField] = $sValue; } } $aFields['AUTH_SOURCE_DATA'] = $aData; if ($aFields['AUTH_SOURCE_UID'] == '') { $RBAC->createAuthSource($aFields); } else { $RBAC->updateAuthSource($aFields); } $data = array(); $data['success'] = true; return $data; }
/** * Handle SQL query * edit this for custom sql handling * @param string $query * @return sql result */ static function __handleQuery($query) { if (defined('SQL_DEBUG')) { G::debug($query); } return mysql_query($query); }
function create($aData) { if (!isset($aData['AUTH_SOURCE_UID'])) { $aData['AUTH_SOURCE_UID'] = G::generateUniqueID(); } else { if ($aData['AUTH_SOURCE_UID'] == '') { $aData['AUTH_SOURCE_UID'] = G::generateUniqueID(); } } $aData['AUTH_SOURCE_DATA'] = is_array($aData['AUTH_SOURCE_DATA']) ? serialize($aData['AUTH_SOURCE_DATA']) : $aData['AUTH_SOURCE_DATA']; $oConnection = Propel::getConnection(AuthenticationSourcePeer::DATABASE_NAME); try { $oAuthenticationSource = new AuthenticationSource(); $oAuthenticationSource->fromArray($aData, BasePeer::TYPE_FIELDNAME); if ($oAuthenticationSource->validate()) { $oConnection->begin(); $iResult = $oAuthenticationSource->save(); $oConnection->commit(); return $aData['AUTH_SOURCE_UID']; } else { $sMessage = ''; $aValidationFailures = $oAuthenticationSource->getValidationFailures(); foreach ($aValidationFailures as $oValidationFailure) { $sMessage .= $oValidationFailure->getMessage() . '<br />'; } throw new Exception('The registry cannot be created!<br />' . $sMessage); } } catch (Exception $oError) { $oConnection->rollback(); throw $oError; } }
public function create($aData) { $oConnection = Propel::getConnection(GatewayPeer::DATABASE_NAME); try { $sGatewayUID = G::generateUniqueID(); $aData['GAT_UID'] = $sGatewayUID; $oGateway = new Gateway(); $oGateway->fromArray($aData, BasePeer::TYPE_FIELDNAME); if ($oGateway->validate()) { $oConnection->begin(); $iResult = $oGateway->save(); $oConnection->commit(); return $sGatewayUID; } else { $sMessage = ''; $aValidationFailures = $oGateway->getValidationFailures(); foreach ($aValidationFailures as $oValidationFailure) { $sMessage .= $oValidationFailure->getMessage() . '<br />'; } throw new Exception('The registry cannot be created!<br />' . $sMessage); } } catch (Exception $oError) { $oConnection->rollback(); throw $oError; } }
function runHotfixInstall($command, $args) { CLI::logging("HOTFIX", PATH_DATA . "log" . PATH_SEP . "upgrades.log"); CLI::logging("Install hotfix to system\n"); $arrayFile = $command; if (count($arrayFile) > 0) { //Install hotfix foreach ($arrayFile as $value) { $f = $value; $result = workspaceTools::hotfixInstall($f); CLI::logging($result["message"] . "\n"); } //Clear server's cache CLI::logging("\nClearing cache...\n"); if (defined("PATH_C")) { G::rm_dir(PATH_C); G::mk_dir(PATH_C, 0777); } //Safe upgrade for JavaScript files CLI::logging("\nSafe upgrade for files cached by the browser\n\n"); G::browserCacheFilesSetUid(); CLI::logging("HOTFIX done\n"); } else { CLI::logging("Please specify the hotfix to install\n"); } }
function run_flush_cache($args, $opts) { $rootDir = realpath(__DIR__."/../../../../"); $app = new Maveriks\WebApplication(); $app->setRootDir($rootDir); $loadConstants = false; $workspaces = get_workspaces_from_args($args); if (! defined("PATH_C")) { die("ERROR: seems processmaker is not properly installed (System constants are missing).".PHP_EOL); } CLI::logging("Flush ".pakeColor::colorize("system", "INFO")." cache ... "); G::rm_dir(PATH_C); G::mk_dir(PATH_C, 0777); echo "DONE" . PHP_EOL; foreach ($workspaces as $workspace) { echo "Flush workspace " . pakeColor::colorize($workspace->name, "INFO") . " cache ... "; G::rm_dir($workspace->path . "/cache"); G::mk_dir($workspace->path . "/cache", 0777); G::rm_dir($workspace->path . "/cachefiles"); G::mk_dir($workspace->path . "/cachefiles", 0777); echo "DONE" . PHP_EOL; } }
function get_session_xmlforms() { $cur = array_keys($_SESSION); $res = ''; $colors = array('white', '#EEFFFF'); $colori = 0; $count = 0; //Get xmlforms in session foreach ($cur as $key) { $res .= '<div style="background-color:' . $colors[$colori] . ';">'; $xml = G::getUIDName($key, ''); if (strpos($xml, '.xml') !== false) { $res .= '<i>FORM:</i> ' . $xml; $colori = $colori ^ 1; $count++; } $res .= '</div>'; } //Get pagedTable in session foreach ($cur as $key) { $res .= '<div style="background-color:' . $colors[$colori] . ';">'; if (substr($key, 0, 11) === "pagedTable[") { $xml = G::getUIDName(substr($key, 11, -1), ''); $res .= '<i>TABLE:</i> ' . $xml; $colori = $colori ^ 1; $count++; } $res .= '</div>'; } return array("count" => $count, "html" => $res); }
function cloneCategory($category, $sortId = 0) { $id = $category->id; unset($category->id); unset($category->creationtime); unset($category->wholeName); unset($category->permaLink); $category->sortId = $sortId; $category->subCatNum = $category->directSubCatNum = $category->itemNum = $category->directItemNum = 0; if (!$this->withPictures) { $category->picture = ""; } $category->create(FALSE, TRUE); // fromClone=TRUE if ($this->withPictures && $category->picture) { copy(CAT_PIC_DIR . "/{$id}.{$category->picture}", CAT_PIC_DIR . "/{$category->id}.{$category->picture}"); } // Cloning the custom fields: G::load($fields, array("SELECT * FROM @customfield WHERE cid=#cid#", $id)); foreach ($fields as $field) { unset($field->id); $field->cid = $category->id; create($field); } if ($this->recursive) { G::load($subCats, array("SELECT * FROM @category WHERE up=#id#", $id)); foreach ($subCats as $sc) { $sc->up = $category->id; $this->cloneCategory($sc, $sc->sortId); } } }
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; }
public function GetOrderData_m_diler($id_order) { $and['o.id_order'] = $id_order; $sql = "SELECT o.id_order, o.note2, o.note, o.target_date\r\n\t\t\tFROM " . _DB_PREFIX_ . "order o\r\n\t\t\t" . $this->db->GetWhere($and) . "\r\n\t\t\tGROUP BY o.id_order"; $arr = $this->db->GetArray($sql) or G::DieLoger("SQL - error: {$sql}"); return $arr; }
/** * @method * * Executes a Talend Web Service.. * * @name executeTalendWebservice * @label Executes a Talend Web Service. * * @param string | $wsdl | Talend Web Service (including ?WSDL) * @param array(array(n1 v1) array(n2 v2) array(nN vN)) | $params | Array of params. Pairs of param Name Value * @param string | $message | Message to be displayed * @return array | $return | Talend Array * */ function executeTalendWebservice($wsdl, $params = array(), $message) { $client = new SoapClient($wsdl, array('trace' => 1)); $params[0] = ""; foreach ($params as $paramO) { $params[] = "--context_param" . $paramO[0] . "=" . $paramO[1]; } $result = $client->__SoapCall('runJob', array($params)); /* $params[1]="--context_param nb_line=".@=Quantity; $result = $client->__SoapCall('runJob', array($params)); foreach ($result->item as $keyItem => $item){ $gridRow=$keyItem+1; @=USERSINFO[$gridRow]['NAME']=$item->item[1]; @=USERSINFO[$gridRow]['LASTNAME']=$item->item[2]; @=USERSINFO[$gridRow]['DATE']=$item->item[0]; @=USERSINFO[$gridRow]['STREET']=$item->item[3]; @=USERSINFO[$gridRow]['CITY']=$item->item[4]; @=USERSINFO[$gridRow]['STATE']=$item->item[5]; @=USERSINFO[$gridRow]['STATEID']=$item->item[6]; } */ G::SendMessageText("<font color='blue'>Information from Talend ETL webservice</font><font color='darkgray'><br>" . $wsdl . "</font>", "INFO"); }
function create() { global $gorumroll; $class = strstr($gorumroll->list, "user") ? "user" : "item"; $this->valid(); if (Roll::isFormInvalid()) { return; } if (!preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$/i', $this->youremail) || !preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$/i', $this->friendsemail)) { return Roll::setFormInvalid("invalidEmail"); } G::load($n, Notification_adToAFriend, "notification"); if ($n->active) { $obj = new $class(); $obj->id = $gorumroll->rollid; $obj->getEmailParams($params); $params["message"] = $this->mess; $params["name"] = $this->yourname; $sp = new SendingParameters(); $sp->to = $this->friendsemail; $sp->from = $this->youremail; $sp->replyTo = $this->youremail; $sp->replyToName = $this->yourname; $n->send($sp, $params); } //TODO: respnum increase Roll::setInfoText("mail_fr_sent_{$class}"); }
/** * Constructs a new Log_display object. * * @param string $name Ignored. * @param string $ident The identity string. * @param array $conf The configuration array. * @param int $level Log messages up to and including this level. * @access public */ function Log_display($name = '', $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { if (!class_exists('G')) { $realdocuroot = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']); $docuroot = explode('/', $realdocuroot); array_pop($docuroot); $pathhome = implode('/', $docuroot) . '/'; array_pop($docuroot); $pathTrunk = implode('/', $docuroot) . '/'; require_once $pathTrunk . 'gulliver/system/class.g.php'; } $this->_id = G::encryptOld(microtime()); $this->_ident = $ident; $this->_mask = Log::UPTO($level); if (isset($conf['error_prepend'])) { $this->_error_prepend = $conf['error_prepend']; } else { $this->_error_prepend = ini_get('error_prepend_string'); } if (isset($conf['error_append'])) { $this->_error_append = $conf['error_append']; } else { $this->_error_append = ini_get('error_append_string'); } if (isset($conf['linebreak'])) { $this->_linebreak = $conf['linebreak']; } }
/** * Constructs a new Log_console object. * * @param string $name Ignored. * @param string $ident The identity string. * @param array $conf The configuration array. * @param int $level Log messages up to and including this level. * @access public */ function Log_console($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { if (!class_exists('G')) { $realdocuroot = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']); $docuroot = explode('/', $realdocuroot); array_pop($docuroot); $pathhome = implode('/', $docuroot) . '/'; array_pop($docuroot); $pathTrunk = implode('/', $docuroot) . '/'; require_once $pathTrunk . 'gulliver/system/class.g.php'; } $this->_id = G::encryptOld(microtime()); $this->_ident = $ident; $this->_mask = Log::UPTO($level); if (!empty($conf['stream'])) { $this->_stream = $conf['stream']; } if (isset($conf['buffering'])) { $this->_buffering = $conf['buffering']; } if (!empty($conf['lineFormat'])) { $this->_lineFormat = str_replace(array_keys($this->_formatMap), array_values($this->_formatMap), $conf['lineFormat']); } if (!empty($conf['timeFormat'])) { $this->_timeFormat = $conf['timeFormat']; } /* * If output buffering has been requested, we need to register a * shutdown function that will dump the buffer upon termination. */ if ($this->_buffering) { register_shutdown_function(array(&$this, '_Log_console')); } }