Exemplo n.º 1
0
 /**
  * Function returns all the related modules for workflows create entity task
  * @return <JSON>
  */
 public function vtJsonDependentModules()
 {
     vimport('~~/modules/com_vtiger_workflow/WorkflowComponents.php');
     $db = PearDatabase::getInstance();
     $param = array('modulename' => $this->getName());
     return vtJsonDependentModules($db, $param);
 }
Exemplo n.º 2
0
    $wfrs = $adb->pquery('select workflow_id,executionorder from com_vtiger_workflowtasks where task_id=?', array($task_id));
    $wfid = $adb->query_result($wfrs, 0, 'workflow_id');
    $order = $adb->query_result($wfrs, 0, 'executionorder');
    $chgtsk = 'update com_vtiger_workflowtasks set executionorder=? where executionorder=? and workflow_id=?';
    $movtsk = 'update com_vtiger_workflowtasks set executionorder=? where task_id=?';
    if ($direction == 'UP') {
        $chgtskparams = array($order, $order - 1, $wfid);
        $adb->pquery($chgtsk, $chgtskparams);
        $adb->pquery($movtsk, array($order - 1, $task_id));
    } else {
        $chgtskparams = array($order, $order + 1, $wfid);
        $adb->pquery($chgtsk, $chgtskparams);
        $adb->pquery($movtsk, array($order + 1, $task_id));
    }
    echo 'ok';
}
global $adb;
$mode = vtlib_purify($_REQUEST['mode']);
if ($mode == 'getfieldsjson') {
    vtJsonFields($adb, $_REQUEST);
} elseif ($mode == 'getfunctionsjson') {
    vtJsonFunctions($adb);
} elseif ($mode == 'getdependentfields') {
    vtJsonDependentModules($adb, $_REQUEST);
} elseif ($mode == 'getrelatedmodules') {
    vtJsonRelatedModules($adb, $_REQUEST);
} elseif ($mode == 'moveWorkflowTaskUpDown') {
    moveWorkflowTaskUpDown($adb, $_REQUEST);
} elseif ($mode == 'getownerslist') {
    vtJsonOwnersList($adb);
}