Beispiel #1
0
 public function Execute()
 {
     if ($this->isInEventActivityMode) {
         return CBPActivityExecutionStatus::Closed;
     }
     if ($this->TimeoutTime != null) {
         $this->TimeoutTimeCurrent = $this->TimeoutTime;
         if (intval($this->TimeoutTime) . "|" != $this->TimeoutTime . "|") {
             $this->TimeoutTimeCurrent = MakeTimeStamp($this->TimeoutTime);
         }
     }
     $this->Subscribe($this);
     if ($this->TimeoutDuration != null) {
         $timeoutDuration = max($this->CalculateTimeoutDuration(), CBPSchedulerService::getDelayMinLimit());
         $this->WriteToTrackingService(str_replace("#PERIOD#", CBPHelper::FormatTimePeriod($timeoutDuration), GetMessage("BPDA_TRACK")));
     } elseif ($this->TimeoutTime != null) {
         $timestamp = max($this->TimeoutTimeCurrent, time() + CBPSchedulerService::getDelayMinLimit());
         $this->WriteToTrackingService(str_replace("#PERIOD#", ConvertTimeStamp($timestamp, "FULL"), GetMessage("BPDA_TRACK1")));
     } else {
         $this->WriteToTrackingService(GetMessage("BPDA_TRACK2"));
     }
     $this->isInEventActivityMode = false;
     return CBPActivityExecutionStatus::Executing;
 }
Beispiel #2
0
echo $arCurrentValues["timeout_duration_type"] == "h" ? " selected" : "";
?>
><?php 
echo GetMessage("BPAA_PD_TIME_H");
?>
</option>
			<option value="d"<?php 
echo $arCurrentValues["timeout_duration_type"] == "d" ? " selected" : "";
?>
><?php 
echo GetMessage("BPAA_PD_TIME_D");
?>
</option>
		</select>
		<?php 
$delayMinLimit = CBPSchedulerService::getDelayMinLimit();
if ($delayMinLimit) {
    ?>
		<p style="color: red;">* <?php 
    echo GetMessage("BPAA_PD_TIMEOUT_LIMIT");
    ?>
: <?php 
    echo CBPHelper::FormatTimePeriod($delayMinLimit);
    ?>
</p>
		<?php 
}
?>
	</td>
</tr>
<tr>
Beispiel #3
0
    public static function GetPropertiesDialog($documentType, $activityName, $workflowTemplate, $workflowParameters, $workflowVariables, $currentValues = null, $formName = "")
    {
        $runtime = CBPRuntime::GetRuntime();
        $map = array('AuthUserId', 'SetStatusMessage', 'StatusMessage', 'UseSubscription', 'TimeoutDuration', 'TimeoutDurationType');
        $activityData = self::getRestActivityData();
        $properties = isset($activityData['PROPERTIES']) && is_array($activityData['PROPERTIES']) ? $activityData['PROPERTIES'] : array();
        foreach ($properties as $name => $property) {
            if (!in_array($name, $map)) {
                $map[] = $name;
            }
        }
        if (!is_array($currentValues)) {
            $currentValues = array();
            $currentActivity =& CBPWorkflowTemplateLoader::FindActivityByName($workflowTemplate, $activityName);
            if (is_array($currentActivity['Properties'])) {
                foreach ($map as $k) {
                    if (array_key_exists($k, $currentActivity['Properties'])) {
                        $currentValues[strtolower($k)] = $currentActivity['Properties'][$k];
                    } else {
                        $currentValues[strtolower($k)] = "";
                    }
                }
            } else {
                foreach ($map as $k) {
                    $currentValues[strtolower($k)] = "";
                }
            }
        }
        if (strlen($currentValues['statusmessage']) <= 0) {
            $currentValues['statusmessage'] = Loc::getMessage('BPRA_DEFAULT_STATUS_MESSAGE');
        }
        if (strlen($currentValues["timeoutdurationtype"]) <= 0) {
            $currentValues["timeoutdurationtype"] = "s";
        }
        if (empty($currentValues["authuserid"])) {
            $currentValues["authuserid"] = 'user_' . $activityData['AUTH_USER_ID'];
        }
        $currentValues["authuserid"] = CBPHelper::UsersArrayToString($currentValues["authuserid"], $workflowTemplate, $documentType);
        if (!empty($activityData['USE_SUBSCRIPTION'])) {
            $currentValues['usesubscription'] = $activityData['USE_SUBSCRIPTION'];
        }
        /** @var CBPDocumentService $documentService */
        $documentService = $runtime->GetService("DocumentService");
        $activityDocumentType = is_array($activityData['DOCUMENT_TYPE']) ? $activityData['DOCUMENT_TYPE'] : $documentType;
        foreach ($properties as $name => $property) {
            $required = CBPHelper::getBool($property['REQUIRED']);
            $value = !CBPHelper::isEmptyValue($currentValues[strtolower($name)]) ? $currentValues[strtolower($name)] : $property['DEFAULT'];
            ?>
			<tr>
				<td align="right" width="40%" valign="top">
					<span class="<?php 
            echo $required ? 'adm-required-field' : '';
            ?>
">
						<?php 
            echo htmlspecialcharsbx(RestActivityTable::getLocalization($property['NAME'], LANGUAGE_ID));
            ?>
:
					</span>
					<?php 
            if (isset($property['DESCRIPTION'])) {
                ?>
					<br/><?php 
                echo htmlspecialcharsbx(RestActivityTable::getLocalization($property['DESCRIPTION'], LANGUAGE_ID));
                ?>
					<?php 
            }
            ?>
				</td>
				<td width="60%">
					<?php 
            echo $documentService->getFieldInputControl($activityDocumentType, $property, array('Field' => strtolower($name), 'Form' => $formName), $value, true, false);
            ?>
				</td>
			</tr>

		<?php 
        }
        if (static::checkAdminPermissions()) {
            ?>
			<tr>
				<td align="right" width="40%" valign="top"><span class=""><?php 
            echo Loc::getMessage("BPRA_PD_USER_ID");
            ?>
:</span></td>
				<td width="60%">
					<?php 
            echo CBPDocument::ShowParameterField("user", 'authuserid', $currentValues['authuserid'], array('rows' => '1'));
            ?>
				</td>
			</tr>
		<?php 
        }
        ?>
			<tr>
				<td align="right"><?php 
        echo Loc::getMessage("BPRA_PD_SET_STATUS_MESSAGE");
        ?>
:</td>
				<td>
					<select name="setstatusmessage">
						<option value="Y"<?php 
        echo $currentValues["setstatusmessage"] == "Y" ? " selected" : "";
        ?>
><?php 
        echo Loc::getMessage("BPRA_PD_YES");
        ?>
</option>
						<option value="N"<?php 
        echo $currentValues["setstatusmessage"] == "N" ? " selected" : "";
        ?>
><?php 
        echo Loc::getMessage("BPRA_PD_NO");
        ?>
</option>
					</select>
				</td>
			</tr>
			<tr>
				<td align="right"><?php 
        echo Loc::getMessage("BPRA_PD_STATUS_MESSAGE");
        ?>
:</td>
				<td valign="top"><?php 
        echo CBPDocument::ShowParameterField("string", 'statusmessage', $currentValues['statusmessage'], array('size' => '45'));
        ?>
</td>
			</tr>
			<tr>
				<td align="right"><?php 
        echo Loc::getMessage("BPRA_PD_USE_SUBSCRIPTION");
        ?>
:</td>
				<td>
					<select name="usesubscription" <?php 
        echo !empty($activityData['USE_SUBSCRIPTION']) ? 'disabled' : '';
        ?>
>
						<option value="Y"<?php 
        echo $currentValues["usesubscription"] == 'Y' ? " selected" : "";
        ?>
><?php 
        echo Loc::getMessage("BPRA_PD_YES");
        ?>
</option>
						<option value="N"<?php 
        echo $currentValues["usesubscription"] == 'N' ? " selected" : "";
        ?>
><?php 
        echo Loc::getMessage("BPRA_PD_NO");
        ?>
</option>
					</select>
				</td>
			</tr>
			<?php 
        if ($activityData['USE_SUBSCRIPTION'] != 'N') {
            ?>
			<tr>
				<td align="right"><?php 
            echo Loc::getMessage("BPRA_PD_TIMEOUT_DURATION");
            ?>
:<br/><?php 
            echo Loc::getMessage("BPRA_PD_TIMEOUT_DURATION_HINT");
            ?>
</td>
				<td valign="top">
					<input type="text" name="timeoutduration" id="id_timeoutduration" value="<?php 
            echo htmlspecialcharsbx($currentValues["timeoutduration"]);
            ?>
" size="20" />
					<input type="button" value="..." onclick="BPAShowSelector('id_timeoutduration', 'int');" />
					<select name="timeoutdurationtype">
						<option value="s"<?php 
            echo $currentValues["timeoutdurationtype"] == "s" ? " selected" : "";
            ?>
><?php 
            echo Loc::getMessage("BPRA_PD_TIME_S");
            ?>
</option>
						<option value="m"<?php 
            echo $currentValues["timeoutdurationtype"] == "m" ? " selected" : "";
            ?>
><?php 
            echo Loc::getMessage("BPRA_PD_TIME_M");
            ?>
</option>
						<option value="h"<?php 
            echo $currentValues["timeoutdurationtype"] == "h" ? " selected" : "";
            ?>
><?php 
            echo Loc::getMessage("BPRA_PD_TIME_H");
            ?>
</option>
						<option value="d"<?php 
            echo $currentValues["timeoutdurationtype"] == "d" ? " selected" : "";
            ?>
><?php 
            echo Loc::getMessage("BPRA_PD_TIME_D");
            ?>
</option>
					</select>
					<?php 
            $delayMinLimit = CBPSchedulerService::getDelayMinLimit();
            if ($delayMinLimit) {
                ?>
						<p style="color: red;">* <?php 
                echo Loc::getMessage("BPRA_PD_TIMEOUT_LIMIT");
                ?>
: <?php 
                echo CBPHelper::FormatTimePeriod($delayMinLimit);
                ?>
</p>
						<?php 
            }
            ?>
				</td>
			</tr>
			<?php 
        }
    }
Beispiel #4
0
    $path = \Bitrix\Main\Config\Option::get("bizproc", "locked_wi_path", "/services/bp/instances.php?type=is_locked");
    ?>
				<input type="text" size="40" name="locked_wi_path" value="<?php 
    echo htmlspecialcharsbx($path);
    ?>
">
			</td>
		</tr>
		<tr>
			<td width="50%" valign="top"><?php 
    echo GetMessage("BIZPROC_OPT_TIME_LIMIT");
    ?>
:</td>
			<td width="50%" valign="top">
				<?php 
    list($delayTime, $delayType) = CBPSchedulerService::getDelayMinLimit(true);
    ?>
				<input type="text" name="delay_min_limit" value="<?php 
    echo $delayTime;
    ?>
" size="5" />
				<select name="delay_min_limit_type">
					<option value="s"<?php 
    echo $delayType == "s" ? " selected" : "";
    ?>
><?php 
    echo GetMessage("BIZPROC_OPT_TIME_LIMIT_S");
    ?>
</option>
					<option value="m"<?php 
    echo $delayType == "m" ? " selected" : "";