Example #1
0
	oEngine.loggedInUserId     = <?php 
echo (int) $loggedInUserId;
?>
;
	oEngine.formattedGroupsNames = {};	// cache of groups names
	oEngine.formattedUserNames = {};	// cache of user names
	oEngine.formattedUserNames['u' + <?php 
echo (int) $loggedInUserId;
?>
] = '<?php 
echo CUtil::JSEscape($loggedInUserFormattedName);
?>
';

	oEngine.manifest = <?php 
echo CUtil::PhpToJsObject(CTaskFilterCtrl::getManifest());
?>
;

	oEngine.objForm = BX.Tasks.lwPopup.registerForm({
		callbacks: {
			onAfterPopupCreated : function(){},
			onBeforePopupShow   : function(){},
			onAfterPopupShow    : function(){},
			onAfterEditorInited : function(){},
			onPopupClose        : (function(objEngine){
				return function(){
					if (objEngine.renderer.bFormShowed)
						objEngine.renderer.bFormShowed = false;
				}
			})(oEngine)
Example #2
0
 public static function MkOperationFilter($key)
 {
     static $arOperationsMap = null;
     // will be loaded on demand
     $key = ltrim($key);
     $firstSymbol = substr($key, 0, 1);
     $twoSymbols = substr($key, 0, 2);
     if ($firstSymbol == "=") {
         $key = substr($key, 1);
         $cOperationType = "I";
     } elseif ($twoSymbols == "!=") {
         $key = substr($key, 2);
         $cOperationType = "NI";
     } elseif ($firstSymbol == "%") {
         $key = substr($key, 1);
         $cOperationType = "S";
     } elseif ($twoSymbols == "!%") {
         $key = substr($key, 2);
         $cOperationType = "NS";
     } elseif ($firstSymbol == "?") {
         $key = substr($key, 1);
         $cOperationType = "?";
     } elseif ($twoSymbols == "><") {
         $key = substr($key, 2);
         $cOperationType = "B";
     } elseif (substr($key, 0, 3) == "!><") {
         $key = substr($key, 3);
         $cOperationType = "NB";
     } elseif ($twoSymbols == ">=") {
         $key = substr($key, 2);
         $cOperationType = "GE";
     } elseif ($firstSymbol == ">") {
         $key = substr($key, 1);
         $cOperationType = "G";
     } elseif ($twoSymbols == "<=") {
         $key = substr($key, 2);
         $cOperationType = "LE";
     } elseif ($firstSymbol == "<") {
         $key = substr($key, 1);
         $cOperationType = "L";
     } elseif ($firstSymbol == "!") {
         $key = substr($key, 1);
         $cOperationType = "N";
     } elseif ($firstSymbol === '#') {
         // Preload and cache in static variable
         if ($arOperationsMap === null) {
             $arManifest = CTaskFilterCtrl::getManifest();
             $arOperationsMap = $arManifest['Operations map'];
         }
         // Resolve operation code and cutoff operation prefix from item name
         $operation = null;
         foreach ($arOperationsMap as $operationCode => $operationPrefix) {
             $pattern = '/^' . preg_quote($operationPrefix) . '[A-Za-z]/';
             if (preg_match($pattern, $key)) {
                 $operation = $operationCode;
                 $key = substr($key, strlen($operationPrefix));
                 break;
             }
         }
         CTaskAssert::assert($operation !== null);
         $cOperationType = "#" . $operation;
     } else {
         $cOperationType = "E";
     }
     // field LIKE val
     return array("FIELD" => $key, "OPERATION" => $cOperationType);
 }