当前位置: 首页>>代码示例>>PHP>>正文


PHP InputDocument::load方法代码示例

本文整理汇总了PHP中InputDocument::load方法的典型用法代码示例。如果您正苦于以下问题:PHP InputDocument::load方法的具体用法?PHP InputDocument::load怎么用?PHP InputDocument::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在InputDocument的用法示例。


在下文中一共展示了InputDocument::load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: loadTest

 function loadTest($aTestData, $aFields)
 {
     $oInputDocument = new InputDocument();
     try {
         return $oInputDocument->load($aFields['INP_DOC_UID']);
     } catch (Exception $oError) {
         return $oError;
     }
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:9,代码来源:classInputDocumentTest.php

示例2: render

 /**
  * Function render
  *
  * @author David S. Callizaya S. <davidsantos@colosa.com>
  * @access public
  * @param string value
  * @return string
  */
 public function render($value = null, $owner = null, $rowId = null, $row = -1, $therow = -1)
 {
     $permission = false;
     $url = null;
     switch ($owner->type) {
         case "xmlform":
             $pmtype = $this->NSFieldType();
             break;
         case "grid":
             $pmtype = $this->NSGridType();
             break;
     }
     if (isset($_SESSION["APPLICATION"]) && isset($_SESSION["USER_LOGGED"]) && isset($_SESSION["TASK"]) && isset($this->input) && $this->input != null && $this->mode == "view") {
         require_once "classes/model/AppDocument.php";
         G::LoadClass("case");
         $case = new Cases();
         $arrayField = $case->loadCase($_SESSION["APPLICATION"]);
         $arrayPermission = $case->getAllObjects($arrayField["PRO_UID"], $_SESSION["APPLICATION"], $_SESSION["TASK"], $_SESSION["USER_LOGGED"]);
         $criteria = new Criteria();
         $criteria->add(AppDocumentPeer::APP_DOC_UID, $arrayPermission["INPUT_DOCUMENTS"], Criteria::IN);
         switch ($owner->type) {
             case "xmlform":
                 break;
             case "grid":
                 $criteria->add(AppDocumentPeer::APP_DOC_FIELDNAME, $owner->name . "_" . $row . "_" . $this->name);
                 break;
         }
         $criteria->addDescendingOrderByColumn(AppDocumentPeer::APP_DOC_CREATE_DATE);
         $rsCriteria = AppDocumentPeer::doSelectRS($criteria);
         $rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $sw = 0;
         while ($rsCriteria->next() && $sw == 0) {
             $row = $rsCriteria->getRow();
             if ($row["DOC_UID"] == $this->input) {
                 $permission = true;
                 $url = (G::is_https() ? "https://" : "http://") . $_SERVER["HTTP_HOST"] . dirname($_SERVER["REQUEST_URI"]) . "/cases_ShowDocument?a=" . $row["APP_DOC_UID"] . "&v=" . $row["DOC_VERSION"];
                 $sw = 1;
             }
         }
     }
     $html1 = null;
     $html2 = null;
     $mode = $this->mode == "view" ? " disabled=\"disabled\"" : null;
     $styleDisplay = null;
     if ($this->mode == "view") {
         if ($permission) {
             $html1 = "<a href=\"" . $url . "\"" . ($owner->type == "grid" ? " class=\"tableOption\" style=\"color: #006699; text-decoration: none; font-weight: normal;\"" : null) . ">";
             $html2 = "</a>";
         }
         $html1 = $html1 . $value;
         $styleDisplay = "display: none;";
     }
     $html = $html1 . "<input type=\"file\" " . $pmtype . " id=\"form" . $rowId . "[" . $this->name . "]\" name=\"form" . $rowId . "[" . $this->name . "]\" value=\"" . $value . "\" class=\"module_app_input___gray_file\" style=\"" . $styleDisplay . "\"" . $mode . " " . $this->NSRequiredValue() . " />" . $html2;
     if (isset($this->input) && $this->input != null) {
         require_once "classes/model/InputDocument.php";
         try {
             $indoc = new InputDocument();
             $aDoc = $indoc->load($this->input);
             $aDoc["INP_DOC_TITLE"] = isset($aDoc["INP_DOC_TITLE"]) ? $aDoc["INP_DOC_TITLE"] : null;
             $html = $html . "<label><img src=\"/images/inputdocument.gif\" width=\"22px\" width=\"22px\" alt=\"\" /><font size=\"1\">(" . trim($aDoc["INP_DOC_TITLE"]) . ")</font></label>";
         } catch (Exception $e) {
             //Then the input document doesn"t exits, id referencial broken
             $html = $html . "&nbsp;<font color=\"red\"><img src=\"/images/alert_icon.gif\" width=\"16px\" width=\"16px\" alt=\"\" /><font size=\"1\">(" . G::loadTranslation("ID_INPUT_DOC_DOESNT_EXIST") . ")</font></font>";
         }
     }
     $html = $html . $this->renderHint();
     return $html;
 }
开发者ID:norahmollo,项目名称:processmaker,代码行数:76,代码来源:class.xmlform.php

示例3: render

 /**
  * Function render
  * @author David S. Callizaya S. <davidsantos@colosa.com>
  * @access public
  * @param string value
  * @return string
  */
 function render($value = NULL)
 {
     $mode = $this->mode == 'view' ? ' disabled="disabled"' : '';
     if ($this->mode == 'view') {
         $displayStyle = 'display:none;';
         $html = $value . '<input class="module_app_input___gray_file" ' . $mode . 'style=' . $displayStyle . ' id="form[' . $this->name . ']" name="form[' . $this->name . ']" type=\'file\' value=\'' . $value . '\' />';
     } else {
         $html = '<input class="module_app_input___gray_file" ' . $mode . 'id="form[' . $this->name . ']" name="form[' . $this->name . ']" type=\'file\' value=\'' . $value . '\'/>';
     }
     if (isset($this->input) && $this->input != '') {
         require_once 'classes/model/InputDocument.php';
         $oiDoc = new InputDocument();
         try {
             $aDoc = $oiDoc->load($this->input);
             $aDoc['INP_DOC_TITLE'] = isset($aDoc['INP_DOC_TITLE']) ? $aDoc['INP_DOC_TITLE'] : '';
             $html .= '<label><img src="/images/inputdocument.gif" width="22px" width="22px"/><font size="1">(' . trim($aDoc['INP_DOC_TITLE']) . ')</font></label>';
         } catch (Exception $e) {
             // then the input document doesn't exits, id referencial broken
             $html .= '&nbsp;<font color="red"><img src="/images/alert_icon.gif" width="16px" width="16px"/><font size="1">(' . G::loadTranslation('ID_INPUT_DOC_DOESNT_EXIST') . ')</font></font>';
         }
     }
     $html .= $this->renderHint();
     return $html;
 }
开发者ID:nshong,项目名称:processmaker,代码行数:31,代码来源:class.xmlform.php

示例4: getInputDocumentDataFromRecord

 /**
  * Get data of an InputDocument from a record
  *
  * @param array $record Record
  *
  * return array Return an array with data InputDocument
  */
 public function getInputDocumentDataFromRecord($record)
 {
     try {
         if ($record["INP_DOC_TITLE"] . "" == "") {
             //Load InputDocument
             $inputDocument = new \InputDocument();
             $arrayInputDocumentData = $inputDocument->load($record["INP_DOC_UID"]);
             //There is no transaltion for this Document name, try to get/regenerate the label
             $record["INP_DOC_TITLE"] = $arrayInputDocumentData["INP_DOC_TITLE"];
             $record["INP_DOC_DESCRIPTION"] = $arrayInputDocumentData["INP_DOC_DESCRIPTION"];
         }
         return array($this->getFieldNameByFormatFieldName("INP_DOC_UID") => $record["INP_DOC_UID"], $this->getFieldNameByFormatFieldName("INP_DOC_TITLE") => $record["INP_DOC_TITLE"], $this->getFieldNameByFormatFieldName("INP_DOC_DESCRIPTION") => $record["INP_DOC_DESCRIPTION"] . "", $this->getFieldNameByFormatFieldName("INP_DOC_FORM_NEEDED") => $record["INP_DOC_FORM_NEEDED"] . "", $this->getFieldNameByFormatFieldName("INP_DOC_ORIGINAL") => $record["INP_DOC_ORIGINAL"] . "", $this->getFieldNameByFormatFieldName("INP_DOC_PUBLISHED") => $record["INP_DOC_PUBLISHED"] . "", $this->getFieldNameByFormatFieldName("INP_DOC_VERSIONING") => (int) $record["INP_DOC_VERSIONING"], $this->getFieldNameByFormatFieldName("INP_DOC_DESTINATION_PATH") => $record["INP_DOC_DESTINATION_PATH"] . "", $this->getFieldNameByFormatFieldName("INP_DOC_TAGS") => $record["INP_DOC_TAGS"] . "", $this->getFieldNameByFormatFieldName("INP_DOC_TYPE_FILE") => $record["INP_DOC_TYPE_FILE"] . "", $this->getFieldNameByFormatFieldName("INP_DOC_MAX_FILESIZE") => (int) $record["INP_DOC_MAX_FILESIZE"], $this->getFieldNameByFormatFieldName("INP_DOC_MAX_FILESIZE_UNIT") => $record["INP_DOC_MAX_FILESIZE_UNIT"] . "");
     } catch (\Exception $e) {
         throw $e;
     }
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:23,代码来源:InputDocument.php

示例5: Cases

     $oCase = new Cases();
     global $G_PUBLISH;
     $G_PUBLISH = new Publisher();
     $G_PUBLISH->AddContent('propeltable', 'paged-table', 'cases/cases_AllInputdocsList', $oCase->getAllUploadedDocumentsCriteria($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['TASK'], $_SESSION['USER_LOGGED']));
     G::RenderPage('publish', 'raw');
     break;
 case 'showUploadedDocument':
     //require_once 'classes/model/AppDocument.php';
     //require_once 'classes/model/AppDelegation.php';
     //require_once 'classes/model/InputDocument.php';
     //require_once 'classes/model/Users.php';
     $oAppDocument = new AppDocument();
     $oAppDocument->Fields = $oAppDocument->load($_POST['APP_DOC_UID']);
     $oInputDocument = new InputDocument();
     if ($oAppDocument->Fields['DOC_UID'] != -1) {
         $Fields = $oInputDocument->load($oAppDocument->Fields['DOC_UID']);
     } else {
         $Fields = array('INP_DOC_FORM_NEEDED' => '', 'FILENAME' => $oAppDocument->Fields['APP_DOC_FILENAME']);
     }
     $oCriteria = new Criteria('workflow');
     $oCriteria->add(AppDelegationPeer::APP_UID, $oAppDocument->Fields['APP_UID']);
     $oCriteria->add(AppDelegationPeer::DEL_INDEX, $oAppDocument->Fields['DEL_INDEX']);
     $oDataset = AppDelegationPeer::doSelectRS($oCriteria);
     $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $oDataset->next();
     $aRow = $oDataset->getRow();
     $oTask = new Task();
     try {
         $aTask = $oTask->load($aRow['TAS_UID']);
         $Fields['ORIGIN'] = $aTask['TAS_TITLE'];
         $oAppDocument->Fields['VIEW'] = G::LoadTranslation('ID_OPEN');
开发者ID:bqevin,项目名称:processmaker,代码行数:31,代码来源:cases_Ajax.php

示例6: addInputDocument


//.........这里部分代码省略.........

                break;

            case "file":

                $appDocFileName = basename($file);



                if (file_exists($file) && is_file($file)) {

                    $sw = 1;

                }

                break;

        }



        if ($sw == 0) {

            return null;

        }



        //Info

        $inputDocument = new InputDocument();

        $arrayInputDocumentData = $inputDocument->load($inputDocumentUid);



        //--- Validate Filesize of $_FILE

        $inpDocMaxFilesize = $arrayInputDocumentData["INP_DOC_MAX_FILESIZE"];

        $inpDocMaxFilesizeUnit = $arrayInputDocumentData["INP_DOC_MAX_FILESIZE_UNIT"];



        $inpDocMaxFilesize = $inpDocMaxFilesize * (($inpDocMaxFilesizeUnit == "MB")? 1024 *1024 : 1024); //Bytes



        if ($inpDocMaxFilesize > 0 && $fileSize > 0) {

            if ($fileSize > $inpDocMaxFilesize) {

                throw new Exception(G::LoadTranslation("ID_SIZE_VERY_LARGE_PERMITTED"));

            }

        }



        //Get the Custom Folder ID (create if necessary)

        $appFolder = new AppFolder();

        $folderId = $appFolder->createFromPath($arrayInputDocumentData["INP_DOC_DESTINATION_PATH"], $applicationUid);
开发者ID:nhenderson,项目名称:processmaker,代码行数:67,代码来源:class.case.php

示例7: isset

 *
 */
try {
    $docUid = $_POST['form']['DOC_UID'];
    $appDocUid = $_POST['form']['APP_DOC_UID'];
    $docVersion = $_POST['form']['docVersion'];
    $actionType = $_POST['form']['actionType'];
    $appId = $_GET['appId'];
    $docType = isset($_GET['docType']) ? $_GET['docType'] : "";
    //save info
    require_once "classes/model/AppDocument.php";
    require_once 'classes/model/AppFolder.php';
    require_once 'classes/model/InputDocument.php';
    $oInputDocument = new InputDocument();
    if ($_GET['UID'] != -1) {
        $aID = $oInputDocument->load($_GET['UID']);
    } else {
        $oFolder = new AppFolder();
        $folderStructure = $oFolder->getFolderStructure(isset($_GET['folderId']) ? $_GET['folderId'] : "/");
        $aID = array('INP_DOC_DESTINATION_PATH' => $folderStructure['PATH']);
    }
    $oAppDocument = new AppDocument();
    //Get the Custom Folder ID (create if necessary)
    $oFolder = new AppFolder();
    if ($_GET['UID'] != -1) {
        //krumo("jhl");
        $folderId = $oFolder->createFromPath($aID['INP_DOC_DESTINATION_PATH'], $appId);
        //Tags
        $fileTags = $oFolder->parseTags($aID['INP_DOC_TAGS'], $appId);
    } else {
        $folderId = isset($_GET['folderId']) ? $_GET['folderId'] : "/";
开发者ID:nshong,项目名称:processmaker,代码行数:31,代码来源:appFolderSaveDocument.php

示例8: getDynaformHistory

 public function getDynaformHistory($PRO_UID, $TAS_UID, $APP_UID, $DYN_UID = "")
 {
     G::LoadClass('case');
     $oCase = new Cases();
     $oCase->verifyTable();
     $aObjectPermissions = $oCase->getAllObjects($PRO_UID, $APP_UID, $TAS_UID, $_SESSION['USER_LOGGED']);
     if (!is_array($aObjectPermissions)) {
         $aObjectPermissions = array('DYNAFORMS' => array(-1), 'INPUT_DOCUMENTS' => array(-1), 'OUTPUT_DOCUMENTS' => array(-1));
     }
     if (!isset($aObjectPermissions['DYNAFORMS'])) {
         $aObjectPermissions['DYNAFORMS'] = array(-1);
     } else {
         if (!is_array($aObjectPermissions['DYNAFORMS'])) {
             $aObjectPermissions['DYNAFORMS'] = array(-1);
         }
     }
     if (!isset($aObjectPermissions['INPUT_DOCUMENTS'])) {
         $aObjectPermissions['INPUT_DOCUMENTS'] = array(-1);
     } else {
         if (!is_array($aObjectPermissions['INPUT_DOCUMENTS'])) {
             $aObjectPermissions['INPUT_DOCUMENTS'] = array(-1);
         }
     }
     if (!isset($aObjectPermissions['OUTPUT_DOCUMENTS'])) {
         $aObjectPermissions['OUTPUT_DOCUMENTS'] = array(-1);
     } else {
         if (!is_array($aObjectPermissions['OUTPUT_DOCUMENTS'])) {
             $aObjectPermissions['OUTPUT_DOCUMENTS'] = array(-1);
         }
     }
     $appDocument = new AppDocument();
     foreach (array("INPUT_DOCUMENTS", "OUTPUT_DOCUMENTS") as $value) {
         $key = $value;
         if ($aObjectPermissions[$key]) {
             foreach ($aObjectPermissions[$key] as $key2 => $value2) {
                 $appDocumentUid = $value2;
                 try {
                     $arrayAppDocumentData = $appDocument->load($appDocumentUid);
                     $aObjectPermissions[$key][$key2] = $arrayAppDocumentData["DOC_UID"];
                 } catch (Exception $e) {
                 }
             }
         }
     }
     $dynaForm = new Dynaform();
     $inputDocument = new InputDocument();
     $outputDocument = new OutputDocument();
     $c = new Criteria('workflow');
     $c->addSelectColumn(AppHistoryPeer::APP_UID);
     $c->addSelectColumn(AppHistoryPeer::DEL_INDEX);
     $c->addSelectColumn(AppHistoryPeer::PRO_UID);
     $c->addSelectColumn(AppHistoryPeer::TAS_UID);
     $c->addSelectColumn(AppHistoryPeer::DYN_UID);
     $c->addSelectColumn(AppHistoryPeer::OBJ_TYPE);
     $c->addSelectColumn(AppHistoryPeer::USR_UID);
     $c->addSelectColumn(AppHistoryPeer::APP_STATUS);
     $c->addSelectColumn(AppHistoryPeer::HISTORY_DATE);
     $c->addSelectColumn(AppHistoryPeer::HISTORY_DATA);
     $c->addSelectColumn(UsersPeer::USR_FIRSTNAME);
     $c->addSelectColumn(UsersPeer::USR_LASTNAME);
     $c->addAsColumn('USR_NAME', "CONCAT(USR_LASTNAME, ' ', USR_FIRSTNAME)");
     $c->addJoin(AppHistoryPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
     //WHERE
     $c->add($c->getNewCriterion(AppHistoryPeer::DYN_UID, $aObjectPermissions["DYNAFORMS"], Criteria::IN)->addOr($c->getNewCriterion(AppHistoryPeer::DYN_UID, $aObjectPermissions["INPUT_DOCUMENTS"], Criteria::IN))->addOr($c->getNewCriterion(AppHistoryPeer::DYN_UID, $aObjectPermissions["OUTPUT_DOCUMENTS"], Criteria::IN)));
     $c->add(AppHistoryPeer::PRO_UID, $PRO_UID);
     $c->add(AppHistoryPeer::APP_UID, $APP_UID);
     $c->add(AppHistoryPeer::TAS_UID, $TAS_UID);
     if (isset($DYN_UID) && $DYN_UID != "") {
         $c->add(AppHistoryPeer::DYN_UID, $DYN_UID);
     }
     //Execute
     $oDataset = AppHistoryPeer::doSelectRS($c);
     $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $aDynHistory = array();
     $aDynHistory[] = array('DYN_TITLE' => 'char');
     while ($oDataset->next()) {
         $aRow = $oDataset->getRow();
         $title = "";
         switch ($aRow["OBJ_TYPE"]) {
             case "DYNAFORM":
                 $arrayDynaFormData = $dynaForm->Load($aRow["DYN_UID"]);
                 $title = $arrayDynaFormData["DYN_TITLE"] . " (" . G::LoadTranslation("ID_DYNAFORM") . ")";
                 break;
             case "INPUT_DOCUMENT":
                 $arrayInputDocumentData = $inputDocument->load($aRow["DYN_UID"]);
                 $title = $arrayInputDocumentData["INP_DOC_TITLE"] . " (" . G::LoadTranslation("ID_INPUT_DOCUMENT") . ")";
                 break;
             case "OUTPUT_DOCUMENT":
                 $arrayOutputDocumentData = $outputDocument->load($aRow["DYN_UID"]);
                 $title = $arrayOutputDocumentData["OUT_DOC_TITLE"] . " (" . G::LoadTranslation("ID_OUTPUT_DOCUMENT") . ")";
                 break;
             case "ASSIGN_TASK":
                 $title = G::LoadTranslation("ID_ASSIGN_TASK") . " (" . G::LoadTranslation("ID_TRIGGERS") . ")";
                 break;
         }
         $aRow["DYN_TITLE"] = $title;
         $changedValues = unserialize($aRow['HISTORY_DATA']);
         $html = "<table border='0' cellpadding='0' cellspacing='0'>";
         $sw_add = false;
         foreach ($changedValues as $key => $value) {
//.........这里部分代码省略.........
开发者ID:emildev35,项目名称:processmaker,代码行数:101,代码来源:AppHistory.php

示例9: while

 $oDataset = StepPeer::doSelectRS($oCriteria);
 $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
 $oDataset->next();
 $i = 0;
 while ($aRow = $oDataset->getRow()) {
     switch ($aRow['STEP_TYPE_OBJ']) {
         case 'DYNAFORM':
             require_once 'classes/model/Dynaform.php';
             $oObject = new Dynaform();
             $aFields = $oObject->load($aRow['STEP_UID_OBJ']);
             $aRow['STEP_NAME'] = $aFields['DYN_TITLE'];
             break;
         case 'INPUT_DOCUMENT':
             require_once 'classes/model/InputDocument.php';
             $oObject = new InputDocument();
             $aFields = $oObject->load($aRow['STEP_UID_OBJ']);
             $aRow['STEP_NAME'] = $aFields['INP_DOC_TITLE'];
             break;
         case 'OUTPUT_DOCUMENT':
             require_once 'classes/model/OutputDocument.php';
             $oObject = new OutputDocument();
             $aFields = $oObject->load($aRow['STEP_UID_OBJ']);
             $aRow['STEP_NAME'] = $aFields['OUT_DOC_TITLE'];
             break;
         case 'EXTERNAL':
             $aRow['STEP_NAME'] = 'unknown ' . $aRow['STEP_UID'];
             foreach ($externalSteps as $key => $val) {
                 if ($val->sStepId == $aRow['STEP_UID_OBJ']) {
                     $aRow['STEP_NAME'] = $val->sStepTitle;
                 }
             }
开发者ID:nshong,项目名称:processmaker,代码行数:31,代码来源:triggers_Tree.php

示例10: InputDocument

 *
 * The point of this application is upload the file and create the input document record
 *
 * if the post attached file has error code 0 continue in other case nothing to do.
 */
if (isset($_FILES) && $_FILES["ATTACH_FILE"]["error"] == 0) {
    try {
        G::LoadClass("case");
        $folderId = "";
        $fileTags = "";
        if (isset($_POST["DOC_UID"]) && $_POST["DOC_UID"] != -1) {
            //The document is of an Specific Input Document. Get path and Tag information
            require_once "classes/model/AppFolder.php";
            require_once "classes/model/InputDocument.php";
            $oInputDocument = new InputDocument();
            $aID = $oInputDocument->load($_POST["DOC_UID"]);
            //Get the Custom Folder ID (create if necessary)
            $oFolder = new AppFolder();
            $folderId = $oFolder->createFromPath($aID["INP_DOC_DESTINATION_PATH"], $_POST["APPLICATION"]);
            //Tags
            $fileTags = $oFolder->parseTags($aID["INP_DOC_TAGS"], $_POST["APPLICATION"]);
        }
        $oAppDocument = new AppDocument();
        if (isset($_POST["APP_DOC_UID"]) && trim($_POST["APP_DOC_UID"]) != "") {
            //Update
            echo "[update]";
            $aFields["APP_DOC_UID"] = $_POST["APP_DOC_UID"];
            $aFields["DOC_VERSION"] = $_POST["DOC_VERSION"];
            $aFields["APP_DOC_FILENAME"] = $_FILES["ATTACH_FILE"]["name"];
            if (isset($_POST["APPLICATION"])) {
                $aFields["APP_UID"] = $_POST["APPLICATION"];
开发者ID:rodrigoivan,项目名称:processmaker,代码行数:31,代码来源:upload.php

示例11: array

$arrayTrigger = $case->loadTriggers($_SESSION["TASK"], "INPUT_DOCUMENT", $inputDocumentUid, "AFTER");
//Trigger debug routines
//Cleaning debug variables
$_SESSION["TRIGGER_DEBUG"]["ERRORS"] = array();
$_SESSION["TRIGGER_DEBUG"]["DATA"] = array();
$_SESSION["TRIGGER_DEBUG"]["TRIGGERS_NAMES"] = array();
$_SESSION["TRIGGER_DEBUG"]["TRIGGERS_VALUES"] = array();
$_SESSION["TRIGGER_DEBUG"]["NUM_TRIGGERS"] = count($arrayTrigger);
$_SESSION["TRIGGER_DEBUG"]["TIME"] = "AFTER";
if ($_SESSION["TRIGGER_DEBUG"]["NUM_TRIGGERS"] > 0) {
    $_SESSION["TRIGGER_DEBUG"]["TRIGGERS_NAMES"] = $case->getTriggerNames($arrayTrigger);
    $_SESSION["TRIGGER_DEBUG"]["TRIGGERS_VALUES"] = $arrayTrigger;
}
//***Validating the file allowed extensions***
$oInputDocument = new InputDocument();
$InpDocData = $oInputDocument->load($inputDocumentUid);
if (isset($_FILES["form"]["name"]["APP_DOC_FILENAME"]) && isset($_FILES["form"]["tmp_name"]["APP_DOC_FILENAME"])) {
    $res = G::verifyInputDocExtension($InpDocData['INP_DOC_TYPE_FILE'], $_FILES["form"]["name"]["APP_DOC_FILENAME"], $_FILES["form"]["tmp_name"]["APP_DOC_FILENAME"]);
} else {
    $res = new stdclass();
    $res->status = false;
    $res->message = G::LoadTranslation('ID_UPLOAD_ERR_INI_SIZE');
}
if ($res->status == 0) {
    $message = $res->message;
    G::SendMessageText($message, "ERROR");
    $backUrlObj = explode("sys" . SYS_SYS, $_SERVER['HTTP_REFERER']);
    G::header("location: " . "/sys" . SYS_SYS . $backUrlObj[1]);
    die;
}
//Add Input Document
开发者ID:emildev35,项目名称:processmaker,代码行数:31,代码来源:cases_SaveDocument.php

示例12: foreach

 $aData['CURRENT_DYNAFORM'] = $_GET['UID'];
 $aData['USER_UID'] = $_SESSION['USER_LOGGED'];
 $aData['APP_STATUS'] = $Fields['APP_STATUS'];
 $aData['PRO_UID'] = $_SESSION['PROCESS'];
 $oCase->updateCase($_SESSION['APPLICATION'], $aData);
 //save files
 require_once 'classes/model/AppDocument.php';
 if (isset($_FILES['form'])) {
     foreach ($_FILES['form']['name'] as $sFieldName => $vValue) {
         if ($_FILES['form']['error'][$sFieldName] == 0) {
             $oAppDocument = new AppDocument();
             if (isset($_POST['INPUTS'][$sFieldName]) && $_POST['INPUTS'][$sFieldName] != '') {
                 require_once 'classes/model/AppFolder.php';
                 require_once 'classes/model/InputDocument.php';
                 $oInputDocument = new InputDocument();
                 $aID = $oInputDocument->load($_POST['INPUTS'][$sFieldName]);
                 //Get the Custom Folder ID (create if necessary)
                 $oFolder = new AppFolder();
                 $folderId = $oFolder->createFromPath($aID['INP_DOC_DESTINATION_PATH']);
                 //Tags
                 $fileTags = $oFolder->parseTags($aID['INP_DOC_TAGS']);
                 $aFields = array('APP_UID' => $_SESSION['APPLICATION'], 'DEL_INDEX' => $_SESSION['INDEX'], 'USR_UID' => $_SESSION['USER_LOGGED'], 'DOC_UID' => $_POST['INPUTS'][$sFieldName], 'APP_DOC_TYPE' => 'INPUT', 'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'), 'APP_DOC_COMMENT' => '', 'APP_DOC_TITLE' => '', 'APP_DOC_FILENAME' => $_FILES['form']['name'][$sFieldName], 'FOLDER_UID' => $folderId, 'APP_DOC_TAGS' => $fileTags);
             } else {
                 $aFields = array('APP_UID' => $_SESSION['APPLICATION'], 'DEL_INDEX' => $_SESSION['INDEX'], 'USR_UID' => $_SESSION['USER_LOGGED'], 'DOC_UID' => -1, 'APP_DOC_TYPE' => 'ATTACHED', 'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'), 'APP_DOC_COMMENT' => '', 'APP_DOC_TITLE' => '', 'APP_DOC_FILENAME' => $_FILES['form']['name'][$sFieldName]);
             }
             $oAppDocument->create($aFields);
             $iDocVersion = $oAppDocument->getDocVersion();
             $sAppDocUid = $oAppDocument->getAppDocUid();
             $aInfo = pathinfo($oAppDocument->getAppDocFilename());
             $sExtension = isset($aInfo['extension']) ? $aInfo['extension'] : '';
             $sPathName = PATH_DOCUMENT . $_SESSION['APPLICATION'] . PATH_SEP;
开发者ID:nshong,项目名称:processmaker,代码行数:31,代码来源:cases_SaveData.php

示例13: InputDocument

 * @Updated Dec 14, 2009 by Erik <erik@colosa.com>
 * 
 * The point of this application is upload the file and create the input document record
 * 
 * if the post attached file has error code 0 continue in other case nothing to do. */
if (isset($_FILES) && $_FILES['ATTACH_FILE']['error'] == 0) {
    try {
        G::LoadClass('case');
        $folderId = '';
        $fileTags = '';
        if (isset($_POST['DOC_UID']) && $_POST['DOC_UID'] != -1) {
            //The document is of an Specific Input Document. Get path and Tag information
            require_once 'classes/model/AppFolder.php';
            require_once 'classes/model/InputDocument.php';
            $oInputDocument = new InputDocument();
            $aID = $oInputDocument->load($_POST['DOC_UID']);
            //Get the Custom Folder ID (create if necessary)
            $oFolder = new AppFolder();
            $folderId = $oFolder->createFromPath($aID['INP_DOC_DESTINATION_PATH'], $_POST['APPLICATION']);
            //Tags
            $fileTags = $oFolder->parseTags($aID['INP_DOC_TAGS'], $_POST['APPLICATION']);
        }
        $oAppDocument = new AppDocument();
        if (isset($_POST['APP_DOC_UID']) && trim($_POST['APP_DOC_UID']) != '') {
            //Update
            echo '[update]';
            $aFields['APP_DOC_UID'] = $_POST['APP_DOC_UID'];
            $aFields['DOC_VERSION'] = $_POST['DOC_VERSION'];
            $aFields['APP_DOC_FILENAME'] = $_FILES['ATTACH_FILE']['name'];
            if (isset($_POST['APPLICATION'])) {
                $aFields['APP_UID'] = $_POST['APPLICATION'];
开发者ID:nshong,项目名称:processmaker,代码行数:31,代码来源:upload.php

示例14: uploadExternalDocument

function uploadExternalDocument()
{
    $response['action']=$_POST['action']. " - ".$_POST['option'];
    $response['error']="error";
    $response['message']="error";
    $response['success']=false;
    $overwrite = (isset($_REQUEST['overwrite_files'])) ? $_REQUEST['overwrite_files'] : false;
    if (isset($_POST["confirm"]) && $_POST["confirm"] == "true") {
        if (isset($_FILES['uploadedFile'])) {
            $uploadedInstances=count($_FILES['uploadedFile']['name']);
            $sw_error=false;
            $sw_error_exists=isset($_FILES['uploadedFile']['error']);
            $emptyInstances=0;
            $quequeUpload=array();
            //overwrite files
            if ($overwrite) {
                for ($i=0; $i<$uploadedInstances; $i++) {
                    overwriteFile($_REQUEST['dir'], stripslashes($_FILES['uploadedFile']['name'][$i]));
                }
            }
            // upload files & check for errors
            for ($i=0; $i<$uploadedInstances; $i++) {
                $errors[$i] = null;
                $tmp = $_FILES['uploadedFile']['tmp_name'][$i];
                $items[$i] = stripslashes($_FILES['uploadedFile']['name'][$i]);
                if ($sw_error_exists) {
                    $up_err = $_FILES['uploadedFile']['error'][$i];
                } else {
                    $up_err=(file_exists($tmp)?0:4);
                }
                if ($items[$i]=="" || $up_err==4) {
                    $emptyInstances++;
                    continue;
                }
                if ($up_err==1 || $up_err==2) {
                    $errors[$i]='miscfilesize';
                    $sw_error = true;
                    continue;
                }
                if ($up_err==3) {
                    $errors[$i]='miscfilepart';
                    $sw_error=true;
                    continue;
                }
                if (!@is_uploaded_file($tmp)) {
                    $errors[$i]='uploadfile';
                    $sw_error=true;
                    continue;
                }
                //The uplaoded files seems to be correct and ready to be uploaded. Add to the Queque
                $fileInfo=array("tempName"=>$tmp,"fileName"=>$items[$i]);
                $quequeUpload[]=$fileInfo;
            }
        } elseif (isset($_POST['selitems'])) {
            $response="";
            $response['msg']= "correct reload";
            $response['success']=true;
            if (isset($_REQUEST['option']) && isset($_REQUEST['copyMove'])) {
                if ($_REQUEST['option'] == 'directory' && $_REQUEST['copyMove'] == 'all') {
                    $response['action'] = $_POST['action']. " - ".$_POST['option'];
                    $response['error']  = "Complete";
                    $response['message']= str_replace("Execute", "", $_POST['action']). " ". "Complete";
                    $response['success']= 'success';
                    $response['node']   = '';
                    $_POST ['node']     = "";
                    $newFolderUid = checkTree($_REQUEST['dir'], $_REQUEST['new_dir']);
                }
                $_POST['selitems'] = array();
            } else {
                require_once ("classes/model/AppDocument.php");
                $oAppDocument = new AppDocument();
                if (isset($_POST['selitems']) && is_array($_POST['selitems'])) {
                    foreach ($_POST['selitems'] as $docId) {
                        $arrayDocId = explode ('_',$docId);
                        $docInfo=$oAppDocument->load($arrayDocId[0]);
                        $docInfo['FOLDER_UID'] =  $_POST['new_dir'];
                        $docInfo['APP_DOC_CREATE_DATE'] = date('Y-m-d H:i:s');
                        $oAppDocument->update($docInfo);
                    }
                }
            }
        }
        //G::pr($quequeUpload);

        //Read. Instance Document classes
        if (!empty($quequeUpload)) {
            $docUid=$_POST['docUid'];
            $appDocUid=isset($_POST['APP_DOC_UID'])?$_POST['APP_DOC_UID']:"";
            $docVersion=isset($_POST['docVersion'])?$_POST['docVersion']:"";
            $actionType=isset($_POST['actionType'])?$_POST['actionType']:"";
            $folderId=$_POST['dir']==""?"/":$_POST['dir'];
            $appId=$_POST['appId'];
            $docType=isset($_POST['docType'])?$_GET['docType']:"INPUT";
            //save info

            require_once ("classes/model/AppDocument.php");
            require_once ('classes/model/AppFolder.php');
            require_once ('classes/model/InputDocument.php');

            $oInputDocument = new InputDocument();
//.........这里部分代码省略.........
开发者ID:rrsc,项目名称:processmaker,代码行数:101,代码来源:appFolderAjax.php

示例15: count

     $rows = $oProcessMap->getExtAdditionalTablesList();
     $result['totalCount'] = count($rows);
     $result['data'] = $rows;
     print G::json_encode($result);
     break;
 case 'getInputDocumentList':
     $rows = $oProcessMap->getExtInputDocumentsCriteria($start, $limit, $_GET['pid']);
     $result['totalCount'] = $oProcessMap->getAllInputDocumentCount();
     array_shift($rows);
     $result['data'] = $rows;
     print G::json_encode($result);
     break;
 case 'editInputDocument':
     require_once 'classes/model/InputDocument.php';
     $oInputDocument = new InputDocument();
     $rows = $oInputDocument->load($_GET['INP_DOC_UID']);
     $tmpData = G::json_encode($rows);
     $tmpData = str_replace("\\/", "/", '{success:true,data:' . $tmpData . '}');
     // unescape the slashes
     $result = $tmpData;
     echo $result;
     break;
 case 'getOutputDocument':
     $rows = $oProcessMap->getExtOutputDocumentsCriteria($start, $limit, $_GET['pid']);
     $result['totalCount'] = $oProcessMap->getAllOutputDocumentCount();
     array_shift($rows);
     $result['data'] = $rows;
     print G::json_encode($result);
     break;
 case 'editObjectPermission':
     $rows = $oProcessMap->editExtObjectPermission($_GET['pid'], $_GET['op_uid']);
开发者ID:nshong,项目名称:processmaker,代码行数:31,代码来源:proxyExtjs.php


注:本文中的InputDocument::load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。