Exemplo n.º 1
0
    //$oJSON = new Services_JSON();
    
    G::LoadSystem('inputfilter');
    $filter = new InputFilter();
    $_GET = $filter->xssFilterHard($_GET);
    $_POST = $filter->xssFilterHard($_POST);
    $_REQUEST = $filter->xssFilterHard($_REQUEST);
    //$_SESSION = $filter->xssFilterHard($_SESSION); 

    if (isset($_REQUEST['data'])) {
        if($_REQUEST['action']=="addText"||$_REQUEST['action']=="updateText") {
            $oData = Bootstrap::json_decode($_REQUEST['data']);
            $oDataAux = G::json_decode($_REQUEST['data']);
            $oDataAux = (array)$oDataAux;
        } else {
            $oData = Bootstrap::json_decode(stripslashes($_REQUEST['data']));
            $oDataAux = G::json_decode(stripslashes($_REQUEST['data']));
            $oDataAux = (array)$oDataAux;
        }
        //$oData = $oJSON->decode( stripslashes( $_REQUEST['data'] ) );
        $sOutput = '';
        $sTask = '';

        if(array_key_exists('pro_uid', $oDataAux) || array_key_exists('uid', $oDataAux) || array_key_exists('PRO_UID', $oDataAux) || array_key_exists('UID', $oDataAux)) {
            if(array_key_exists('pro_uid', $oDataAux) || array_key_exists('PRO_UID', $oDataAux)) {
                if(array_key_exists('pro_uid', $oDataAux)) {
                    $proUid = $oDataAux['pro_uid'];
                } else {
                    $proUid = $oDataAux['PRO_UID'];
                }
            } else {
Exemplo n.º 2
0
 public function saveOrderDashlet($data)
 {
     $this->setResponseType('json');
     try {
         $orderDashlet[0] = Bootstrap::json_decode($data->positionCol0);
         $orderDashlet[1] = Bootstrap::json_decode($data->positionCol1);
         $orderDashlet[2] = Bootstrap::json_decode($data->positionCol2);
         G::loadClass('configuration');
         $oConfiguration = new Configurations();
         $aConfiguration = $oConfiguration->load('Dashboard', '', '', $_SESSION['USER_LOGGED']);
         $dataDashboard = array();
         if (isset($aConfiguration["CFG_VALUE"])) {
             $dataDashboard = $aConfiguration["CFG_VALUE"];
         }
         $dataNow['ORDER'] = $orderDashlet;
         if (isset($data->columns)) {
             $dataNow['COLUMNS'] = Bootstrap::json_decode($data->columns);
         }
         $dataDashboard = array_merge($dataDashboard, $dataNow);
         $oConfiguration->aConfig = $dataDashboard;
         $oConfiguration->saveConfig('Dashboard', '', '', $_SESSION['USER_LOGGED']);
         $result->success = '1';
         return $result;
     } catch (Exception $error) {
         //ToDo: Display a error message
     }
 }
Exemplo n.º 3
0
         $len = strlen($chain) - 1;
         if ($breakpoint < $len) {
             $chain = substr($chain, 0, $breakpoint) . $pad;
         }
     }
     return $chain;
 }
 function addTitlle($Category, $Id, $Lang)
 {
     require_once 'classes/model/Content.php';
     $content = new Content();
     $value = $content->load($Category, '', $Id, $Lang);
     return $value;
 }
 //$oJSON = new Services_JSON();
 $stdObj = Bootstrap::json_decode($_POST['data']);
 if (isset($stdObj->pro_uid)) {
     $sProUid = $stdObj->pro_uid;
 } else {
     throw new Exception(G::LoadTranslation('ID_PROCESS_UID_NOT_DEFINED'));
 }
 /* Includes */
 G::LoadClass('processes');
 $oProcess = new Processes();
 $proFields = $oProcess->serializeProcess($sProUid);
 $Fields = $oProcess->saveSerializedProcess($proFields);
 $pathLength = strlen(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP);
 $length = strlen($Fields['PRO_TITLE']) + $pathLength;
 foreach ($Fields as $key => $value) {
     if ($key == 'PRO_TITLE') {
         $Fields[$key] = myTruncate($value, 65, ' ', '...');
Exemplo n.º 4
0
    eval($_SESSION['CURRENT_PAGE_INITILIZATION']);
}
//G::LoadSystem('json');
//require_once (PATH_THIRDPARTY . 'pear/json/class.json.php');
//$json = new Services_JSON();
$G_FORM = new form(G::getUIDName(urlDecode($_POST['form'])));
$G_FORM->id = urlDecode($_POST['form']);
$G_FORM->values = $_SESSION[$G_FORM->id];
G::LoadClass('xmlDb');
$file = G::decrypt($G_FORM->values['PME_A'], URL_KEY);
define('DB_XMLDB_HOST', PATH_DYNAFORM . $file . '.xml');
define('DB_XMLDB_USER', '');
define('DB_XMLDB_PASS', '');
define('DB_XMLDB_NAME', '');
define('DB_XMLDB_TYPE', 'myxml');
$newValues = Bootstrap::json_decode(urlDecode(stripslashes($_POST['fields'])));
//Resolve dependencies
//Returns an array ($dependentFields) with the names of the fields
//that depends of fields passed through AJAX ($_GET/$_POST)
$dependentFields = array();
$aux = array();
for ($r = 0; $r < sizeof($newValues); $r++) {
    $newValues[$r] = (array) $newValues[$r];
    $G_FORM->setValues($newValues[$r]);
    //Search dependent fields
    foreach ($newValues[$r] as $k => $v) {
        $myDependentFields = subDependencies($k, $G_FORM, $aux);
        $dependentFields = array_merge($dependentFields, $myDependentFields);
    }
}
$dependentFields = array_unique($dependentFields);
Exemplo n.º 5
0
 }
 $_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
 $_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep['PAGE'];
 $debuggerAvailable = true;
 if (isset($_SESSION['current_ux']) && $_SESSION['current_ux'] == 'SIMPLIFIED') {
     $debuggerAvailable = false;
 }
 if ($trigger_debug_session && $debuggerAvailable) {
     $_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
     $aNextStep['PAGE'] = $aNextStep['PAGE'] . '&breakpoint=triggerdebug';
 }
 $oForm->validatePost();
 //$oJSON = new Services_JSON();
 $_POST['__notValidateThisFields__'] = isset($_POST['__notValidateThisFields__']) && $_POST['__notValidateThisFields__'] != '' ? $_POST['__notValidateThisFields__'] : $_POST['DynaformRequiredFields'];
 if ($missing_req_values = $oForm->validateRequiredFields($_POST['form'], Bootstrap::json_decode(stripslashes($_POST['__notValidateThisFields__'])))) {
     $fieldsRequired = Bootstrap::json_decode(str_replace(array("%27", "%39"), array("\"", "'"), $_POST["DynaformRequiredFields"]));
     foreach ($fieldsRequired as $key1 => $value1) {
         foreach ($missing_req_values as $key2 => $value2) {
             if ($value1->name == $value2) {
                 $missing_req_values[$key2] = $value1->label;
             }
         }
     }
     $_POST['next_step'] = $aNextStep;
     $_POST['previous_step'] = $oCase->getPreviousStep($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION']);
     $_POST['req_val'] = $missing_req_values;
     global $G_PUBLISH;
     $G_PUBLISH = new Publisher();
     $G_PUBLISH->AddContent('view', 'cases/missRequiredFields');
     G::RenderPage('publish', 'blank');
     exit(0);
Exemplo n.º 6
0
        die;
    }
    $_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
    $_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep['PAGE'];
    $debuggerAvailable = true;
    if (isset($_SESSION['current_ux']) && $_SESSION['current_ux'] == 'SIMPLIFIED') {
        $debuggerAvailable = false;
    }
    if ($trigger_debug_session && $debuggerAvailable) {
        $_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
        $aNextStep['PAGE'] = $aNextStep['PAGE'] . '&breakpoint=triggerdebug';
    }
    $oForm->validatePost();
    //$oJSON = new Services_JSON();
    $_POST['__notValidateThisFields__'] = isset($_POST['__notValidateThisFields__']) && $_POST['__notValidateThisFields__'] != '' ? $_POST['__notValidateThisFields__'] : $_POST['DynaformRequiredFields'];
    if ($missing_req_values = $oForm->validateRequiredFields($_POST['form'], Bootstrap::json_decode(stripslashes($_POST['__notValidateThisFields__'])))) {
        $_POST['next_step'] = $aNextStep;
        $_POST['previous_step'] = $oCase->getPreviousStep($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION']);
        $_POST['req_val'] = $missing_req_values;
        $G_PUBLISH = new Publisher();
        $G_PUBLISH->AddContent('view', 'cases/missRequiredFields');
        G::RenderPage('publish', 'blank');
        exit(0);
    }
    G::header('location: ' . $aNextStep['PAGE']);
} catch (Exception $e) {
    $G_PUBLISH = new Publisher();
    $aMessage = array();
    $aMessage['MESSAGE'] = $e->getMessage();
    $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
    G::RenderPage('publish', 'blank');
Exemplo n.º 7
0
                $index = $arrayAux[0];
                unset($arrayAux[0]);
                if (isset($arrayFieldSubDependent[$index])) {
                    $arrayFieldSubDependent[$index] = array_unique(array_merge($arrayFieldSubDependent[$index], $arrayAux));
                } else {
                    $arrayFieldSubDependent[$index] = array_unique($arrayAux);
                }
            }
        }
    }
    $dependentFields = array_unique($arrayDependentField);
}
//Completed all fields of the grid
if (isset($_POST["grid"]) && isset($_POST["gridField"])) {
    //Completed all fields of the grid
    $arrayGridField = (array) Bootstrap::json_decode(urldecode(stripslashes($_POST["gridField"])));
    foreach ($arrayGridField as $index => $value) {
        $G_FORM->values[$_POST["grid"]][$_POST["row"]][$index] = $value;
    }
    //Delete all fields subdependent
    foreach ($arrayFieldSubDependent as $index1 => $value1) {
        $arrayAux = $value1;
        foreach ($arrayAux as $value2) {
            unset($G_FORM->values[$_POST["grid"]][$_POST["row"]][$value2]);
        }
    }
}
//Parse and update the new content
$newContent = $G_FORM->getFields(PATH_CORE . "templates" . PATH_SEP . "xmlform.html", isset($_POST["row"]) ? $_POST["row"] : -1);
//Returns the dependentFields's content
$sendContent = array();
Exemplo n.º 8
0
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
 * Coral Gables, FL, 33134, USA, or email info@colosa.com.
 */

$response = new StdClass();
$outputDir = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP;

try {
	if(empty($_GET)){
		$proUid = Bootstrap::json_decode( $_POST['data']);
		$_GET["pro_uid"] = $proUid->pro_uid;
	}
    if (\BpmnProject::exists($_GET["pro_uid"])) {
        $exporter = new ProcessMaker\Exporter\XmlExporter($_GET["pro_uid"]);
        $getProjectName = $exporter->truncateName($exporter->getProjectName(),false);

        $version = ProcessMaker\Util\Common::getLastVersion($outputDir . $getProjectName . "-*.pmx") + 1;
        $outputFilename = sprintf("%s-%s.%s", str_replace(" ","_",$getProjectName), $version, "pmx");
        $outputFilename = $exporter->saveExport($outputDir.$outputFilename);
    } else {
        $oProcess = new Processes();
        $proFields = $oProcess->serializeProcess($_GET["pro_uid"]);
        $result = $oProcess->saveSerializedProcess($proFields);
        $outputFilename = $result["FILENAME"];
 function doubleStart($oData)
 {
     //$oJSON  = new Services_JSON();
     $sProUid = $oData['PRO_UID'];
     $sTemplate = $oData['PRO_TEMPLATE'];
     $oProcessMap = $oData['PROCESSMAP'];
     $t1 = Bootstrap::json_decode($oProcessMap->addTask($sProUid, 200, 70));
     $t2 = Bootstrap::json_decode($oProcessMap->addTask($sProUid, 400, 70));
     $t3 = Bootstrap::json_decode($oProcessMap->addTask($sProUid, 300, 160));
     $task1 = $t1->uid;
     $task2 = $t2->uid;
     $task3 = $t3->uid;
     $aData = array("TAS_START" => "TRUE", "TAS_UID" => $task1);
     $oTask = new Task();
     $oTask->update($aData);
     $aData = array("TAS_START" => "TRUE", "TAS_UID" => $task2);
     $oTask = new Task();
     $oTask->update($aData);
     $oProcessMap->saveNewPattern($sProUid, $task1, $task3, 'SEQUENTIAL');
     $oProcessMap->saveNewPattern($sProUid, $task2, $task3, 'SEQUENTIAL');
     $oProcessMap->saveNewPattern($sProUid, $task3, -1, 'SEQUENTIAL');
 }
global $RBAC;
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
    G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
    G::header('location: ../login/login');
    die;
}
$aFields = $RBAC->getAuthSource($_POST['form']['AUTH_SOURCE_UID']);
$aAttributes = array();
if (isset($aFields['AUTH_SOURCE_DATA']['AUTH_SOURCE_GRID_ATTRIBUTE'])) {
    $aAttributes = $aFields['AUTH_SOURCE_DATA']['AUTH_SOURCE_GRID_ATTRIBUTE'];
}
//G::LoadThirdParty( 'pear/json', 'class.json' );
//$oJSON = new Services_JSON();
foreach ($_POST['aUsers'] as $sUser) {
    $matches = array();
    $aUser = (array) Bootstrap::json_decode(stripslashes($sUser));
    $aData['USR_USERNAME'] = str_replace("*", "'", $aUser['sUsername']);
    $aData['USR_PASSWORD'] = md5(str_replace("*", "'", $aUser['sUsername']));
    // note added by gustavo gustavo-at-colosa.com
    // asign the FirstName and LastName variables
    // add replace to change D*Souza to D'Souza by krlos
    $aData['USR_FIRSTNAME'] = str_replace("*", "'", $aUser['sFirstname']);
    $aData['USR_LASTNAME'] = str_replace("*", "'", $aUser['sLastname']);
    $aData['USR_EMAIL'] = $aUser['sEmail'];
    $aData['USR_DUE_DATE'] = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 2));
    $aData['USR_CREATE_DATE'] = date('Y-m-d H:i:s');
    $aData['USR_UPDATE_DATE'] = date('Y-m-d H:i:s');
    $aData['USR_BIRTHDAY'] = date('Y-m-d');
    $aData['USR_STATUS'] = 1;
    $aData['USR_AUTH_TYPE'] = strtolower($aFields['AUTH_SOURCE_PROVIDER']);
    $aData['UID_AUTH_SOURCE'] = $aFields['AUTH_SOURCE_UID'];
Exemplo n.º 11
0
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
 * Coral Gables, FL, 33134, USA, or email info@colosa.com.
 */
/**
 * ription This is a callback for the View of all groups from a determinated user
 *
 * @author Everth S. Berrios Morales <*****@*****.**>
 * @Date 16/05/2008
 * @LastModification none
 */
//G::LoadThirdParty( 'pear/json', 'class.json' );
try {
    //$oJSON = new Services_JSON();
    $stdObj = Bootstrap::json_decode(stripslashes($_POST['data']));
    if (isset($stdObj->pro_uid)) {
        $sProUid = $stdObj->pro_uid;
    } else {
        throw new Exception('the process uid is not defined!.');
    }
    G::LoadClass('processMap');
    $oProcessMap = new ProcessMap();
    $c = $oProcessMap->listProcessesUser($sProUid);
    $oHeadPublisher =& headPublisher::getSingleton();
    $oHeadPublisher->addScriptFile('/jscore/processmap/core/processUser.js');
    $G_PUBLISH = new Publisher();
    $G_PUBLISH->AddContent('propeltable', 'paged-table', 'processes/processes_User', $c, array('PRO_UID' => $sProUid));
    G::RenderPage('publish', 'raw');
} catch (Exception $e) {
    $G_PUBLISH = new Publisher();
Exemplo n.º 12
0
    /**
     * Load data of the Process
     *
     * @param string $processUid
     *
     * return array  Return data array with data of the Process (attributes of the process, tasks and routes)
     *
     * @access public
     */
    public function loadProcess($processUid)
    {
        $arrayDefineProcessData = array();

        //Process
        $process = new \Process();

        $arrayProcessData = $process->load($processUid);

        $arrayDefineProcessData["process"] = array(
            "PRO_UID"   => $processUid,
            "PRO_TITLE" => $arrayProcessData["PRO_TITLE"],
            "PRO_DESCRIPTION" => $arrayProcessData["PRO_DESCRIPTION"],
            "PRO_CATEGORY"    => $arrayProcessData["PRO_CATEGORY"]
        );

        //Load data
        $processMap = new \processMap();

        $arrayData = (array)(\Bootstrap::json_decode($processMap->load($processUid)));

        //Tasks & Routes
        $arrayDefineProcessData["process"]["tasks"]  = array();
        $arrayDefineProcessData["process"]["routes"] = array();

        if (isset($arrayData["task"]) && count($arrayData["task"]) > 0) {
            foreach ($arrayData["task"] as $indext => $valuet) {
                $t = (array)($valuet);

                $taskUid = $t["uid"];

                //Load task data
                $task = new \Task();

                $arrayTaskData = $task->load($taskUid);

                //Set task
                $arrayDefineProcessData["process"]["tasks"][] = array(
                    "TAS_UID"   => $taskUid,
                    "TAS_TITLE" => $arrayTaskData["TAS_TITLE"],
                    "TAS_DESCRIPTION" => $arrayTaskData["TAS_DESCRIPTION"],
                    "TAS_POSX"  => $arrayTaskData["TAS_POSX"],
                    "TAS_POSY"  => $arrayTaskData["TAS_POSY"],
                    "TAS_START" => $arrayTaskData["TAS_START"]
                );

                //Routes
                if (isset($t["derivation"])) {
                    $t["derivation"] = (array)($t["derivation"]);

                    $type = "";

                    switch ($t["derivation"]["type"]) {
                        case 0:
                            $type = "SEQUENTIAL";
                            break;
                        case 1:
                            $type = "SELECT";
                            break;
                        case 2:
                            $type = "EVALUATE";
                            break;
                        case 3:
                            $type = "PARALLEL";
                            break;
                        case 4:
                            $type = "PARALLEL-BY-EVALUATION";
                            break;
                        case 5:
                            $type = "SEC-JOIN";
                            break;
                        case 8:
                            $type = "DISCRIMINATOR";
                            break;
                    }

                    foreach ($t["derivation"]["to"] as $indexr => $valuer) {
                        $r = (array)($valuer);

                        //Criteria
                        $criteria = new \Criteria("workflow");

                        $criteria->addSelectColumn(\RoutePeer::ROU_UID);
                        $criteria->add(\RoutePeer::PRO_UID, $processUid, \Criteria::EQUAL);
                        $criteria->add(\RoutePeer::TAS_UID, $taskUid, \Criteria::EQUAL);
                        $criteria->add(\RoutePeer::ROU_NEXT_TASK, $r["task"], \Criteria::EQUAL);

                        $rsCriteria = \RoutePeer::doSelectRS($criteria);
                        $rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);

                        $rsCriteria->next();

                        $row = $rsCriteria->getRow();

                        $routeUid = $row["ROU_UID"];

                        //Set route
                        $arrayDefineProcessData["process"]["routes"][] = array(
                            "ROU_UID" => $routeUid,
                            "TAS_UID" => $taskUid,
                            "ROU_NEXT_TASK" => $r["task"],
                            "ROU_TYPE" => $type
                        );
                    }
                }
            }
        }

        return $arrayDefineProcessData;
    }
Exemplo n.º 13
0
 case 'editObjectPermission':
     // we also need the process uid variable for the function.
     $oProcessMap->editObjectPermission($oData->op_uid, $oData->pro_uid);
     break;
 case 'caseTracker':
     $oProcessMap->caseTracker($oData->pro_uid);
     break;
 case 'caseTrackerObjects':
     $oProcessMap->caseTrackerObjects($oData->pro_uid);
     break;
 case 'processFilesManager':
     $_SESSION['PFMDirectory'] = '';
     $oProcessMap->processFilesManager($oData->pro_uid);
     break;
 case 'exploreDirectory':
     $objData = Bootstrap::json_decode($_REQUEST['data']);
     $_SESSION['PFMDirectory'] = $objData->{'main_directory'};
     $oProcessMap->exploreDirectory($oData->pro_uid, $oData->main_directory, $oData->directory);
     break;
 case 'deleteFile':
     $oProcessMap->deleteFile($oData->pro_uid, $oData->main_directory, $oData->directory, $oData->file);
     break;
 case 'deleteDirectory':
     $oProcessMap->deleteDirectory($oData->pro_uid, $oData->main_directory, $oData->directory, $oData->dir_to_delete);
     break;
 case 'downloadFile':
     $oProcessMap->downloadFile($oData->pro_uid, $oData->main_directory, $oData->directory, $oData->file);
     break;
 case 'deleteSubProcess':
     $sOutput = $oProcessMap->deleteSubProcess($oData->pro_uid, $oData->tas_uid);
     break;