transactionLog($controllerAction); $installer->call( $controllerAction ); } else { $_SESSION['phpFileNotFound'] = $_SERVER['REQUEST_URI']; header( "location: /errors/error404.php?url=" . urlencode( $_SERVER['REQUEST_URI'] ) ); } die(); } // Load Language Translation Bootstrap::LoadTranslationObject( defined( 'SYS_LANG' ) ? SYS_LANG : "en" ); // look for a disabled workspace if ($oServerConf->isWSDisabled( SYS_TEMP )) { $aMessage['MESSAGE'] = Bootstrap::LoadTranslation( 'ID_DISB_WORKSPACE' ); $G_PUBLISH = new Publisher(); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage ); Bootstrap::RenderPage( 'publish' ); die(); } // database and workspace definition // if SYS_TEMP exists, the URL has a workspace, now we need to verify if exists their db.php file if (defined( 'SYS_TEMP' ) && SYS_TEMP != '') { //this is the default, the workspace db.php file is in /shared/workflow/sites/SYS_SYS $pathFile = PATH_DB . SYS_TEMP . '/db.php'; $pathFile = $filter->validateInput($pathFile,'path'); if (file_exists( $pathFile )) { require_once ($pathFile); define( 'SYS_SYS', SYS_TEMP );
/** * getformatedDate * * @param date $date * @param string $format default value 'yyyy-mm-dd', * @param string $lang default value '' * * @return string $ret */ public function getformatedDate($date, $format = 'yyyy-mm-dd', $lang = '') { /** * ****************************************************************************************************** * if the year is 2008 and the format is yy then -> 08 * if the year is 2008 and the format is yyyy then -> 2008 * * if the month is 05 and the format is mm then -> 05 * if the month is 05 and the format is m and the month is less than 10 then -> 5 else digit normal * if the month is 05 and the format is MM or M then -> May * * if the day is 5 and the format is dd then -> 05 * if the day is 5 and the format is d and the day is less than 10 then -> 5 else digit normal * if the day is 5 and the format is DD or D then -> five * ******************************************************************************************************* */ //scape the literal switch ($lang) { case 'es': $format = str_replace(' de ', '[of]', $format); break; } //first we must formatted the string $format = str_replace('yyyy', '{YEAR}', $format); $format = str_replace('yy', '{year}', $format); $format = str_replace('mm', '{YONTH}', $format); $format = str_replace('m', '{month}', $format); $format = str_replace('M', '{XONTH}', $format); $format = str_replace('dd', '{DAY}', $format); $format = str_replace('d', '{day}', $format); $format = str_replace('h', '{h}', $format); $format = str_replace('i', '{i}', $format); $format = str_replace('s', '{s}', $format); if ($lang === '') { $lang = defined(SYS_LANG) ? SYS_LANG : 'en'; } $aux = explode(' ', $date); //para dividir la fecha del dia $date = explode('-', isset($aux[0]) ? $aux[0] : '00-00-00'); //para obtener los dias, el mes, y el año. $time = explode(':', isset($aux[1]) ? $aux[1] : '00:00:00'); //para obtener las horas, minutos, segundos. $year = (int) (isset($date[0]) ? $date[0] : '0'); //year $month = (int) (isset($date[1]) ? $date[1] : '0'); //month $day = (int) (isset($date[2]) ? $date[2] : '0'); //day $h = isset($time[0]) ? $time[0] : '00'; //hour $i = isset($time[1]) ? $time[1] : '00'; //minute $s = isset($time[2]) ? $time[2] : '00'; //second $MONTHS = array(); for ($i = 1; $i <= 12; $i++) { $MONTHS[$i] = Bootstrap::LoadTranslation("ID_MONTH_{$i}", $lang); } $d = (int) $day; $dd = Bootstrap::complete_field($day, 2, 1); //missing D $M = $MONTHS[$month]; $m = (int) $month; $mm = Bootstrap::complete_field($month, 2, 1); $yy = substr($year, strlen($year) - 2, 2); $yyyy = $year; $names = array('{day}', '{DAY}', '{month}', '{YONTH}', '{XONTH}', '{year}', '{YEAR}', '{h}', '{i}', '{s}'); $values = array($d, $dd, $m, $mm, $M, $yy, $yyyy, $h, $i, $s); $ret = str_replace($names, $values, $format); //recovering the original literal switch ($lang) { case 'es': $ret = str_replace('[of]', ' de ', $ret); break; } return $ret; }
$_SESSION['__EE_SW_PMLICENSEMANAGER__'] = 1; $_SESSION['phpLastFileFound'] = ''; $_SESSION['USERNAME_PREVIOUS1'] = $decodedResp->user['0']->USR_USERNAME; $_SESSION['USERNAME_PREVIOUS2'] = $decodedResp->user['0']->USR_USERNAME; $_SESSION['WORKSPACE'] = $pmws; $_SESSION['USER_LOGGED'] = $decodedResp->user['0']->USR_UID; $_SESSION['USR_USERNAME'] = $decodedResp->user['0']->USR_USERNAME; $_SESSION['USR_FULLNAME'] = $decodedResp->user['0']->USR_FIRSTNAME . ' ' . $decodedResp->user['0']->USR_LASTNAME; $_SESSION['__sw__'] = 1; //session created } else { echo Bootstrap::LoadTranslation('ID_USER_NOT_ACTIVE'); die; } } else { echo Bootstrap::LoadTranslation('ID_USER_DOES_NOT_CORRESPOND'); die; } } if ($action == "draft") { //sending the email $curlApp = curl_init('https://' . $server . '/api/1.0/' . $pmws . '/gmailIntegration/sendEmail/' . $appUid . '/to/' . $gmail . '/index/' . $delIndex); curl_setopt($curlApp, CURLOPT_HTTPHEADER, array('Authorization: Bearer ' . $pmtoken)); curl_setopt($curlApp, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($curlApp, CURLOPT_RETURNTRANSFER, true); curl_setopt($curlApp, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curlApp, CURLOPT_CONNECTTIMEOUT, 0); $curl_response_app = curl_exec($curlApp); curl_close($curlApp); $mainUrl = '/sys' . $pmws . '/en/' . $enviroment . '/cases/open?APP_UID=' . $appUid . '&DEL_INDEX=' . $delIndex . '&action=' . $action . '&gmail=1'; header('location:' . $mainUrl);