} else {
     //save the file, if it's not saved
     if ($_FILES['form']['error']['PROCESS_FILENAME'] == 0) {
         $filename = $_FILES['form']['name']['PROCESS_FILENAME'];
         $path = PATH_DOCUMENT . 'input' . PATH_SEP;
         $tempName = $_FILES['form']['tmp_name']['PROCESS_FILENAME'];
         $action = "none";
         G::uploadFile($tempName, $path, $filename);
     }
 }
 $oData = $oProcess->getProcessDataXpdl($path . $filename);
 $Fields['PRO_FILENAME'] = $filename;
 $Fields['IMPORT_OPTION'] = 2;
 $sProUid = $oData->process['PRO_UID'];
 $oData->process['PRO_UID_OLD'] = $sProUid;
 if ($oProcess->processExists($sProUid)) {
     $G_MAIN_MENU = 'processmaker';
     $G_ID_MENU_SELECTED = 'PROCESSES';
     $G_PUBLISH = new Publisher();
     $G_PUBLISH->AddContent('xmlform', 'xmlform', 'processes/processes_ImportExistingXpdl', '', $Fields, 'processes_ImportExistingXpdl');
     G::RenderPage('publish', "blank");
     die;
 }
 // code added by gustavo cruz gustavo-at-colosa-dot-com
 // evaluate actions or import options
 switch ($action) {
     case "none":
         $groupsDuplicated = $oProcess->checkExistingGroups($oData->groupwfs);
         break;
     case "rename":
         $oData->groupwfs = $oProcess->renameExistingGroups($oData->groupwfs);
示例#2
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.
 *
 */
try {
    G::LoadClass('xpdl');
    G::LoadClass('processMap');
    G::LoadClass('tasks');
    $oProcessMap = new processMap(new DBConnection());
    $oProcess = new Xpdl();
    $oTask = new Task();
    if (isset($_POST['PRO_UID'])) {
        $idProcess = $_POST['PRO_UID'];
        if ($oProcess->processExists($idProcess)) {
            $process['ID'] = $idProcess;
        } else {
            $result = array();
            $result['status_code'] = $idProcess;
            $result['message'] = "the process don't exists";
            $result['timestamp'] = date('Y-m-d H:i:s');
            echo G::json_encode($result);
            die;
        }
    } else {
        $result = array();
        $result['status_code'] = 1;
        $result['message'] = "you don't send the process uid";
        $result['timestamp'] = date('Y-m-d H:i:s');
        echo G::json_encode($result);