Merge pull request #1403 from hector-cortez/BUG-0000
BUG 0000 Adjustment for the standardization of code. CODE_STYLE
This commit is contained in:
@@ -24,12 +24,15 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
if (! defined( 'JAVA_BRIDGE_PATH' ))
|
||||
if (! defined( 'JAVA_BRIDGE_PATH' )) {
|
||||
define( 'JAVA_BRIDGE_PATH', 'JavaBridgePM' );
|
||||
if (! defined( 'JAVA_BRIDGE_PORT' ))
|
||||
}
|
||||
if (! defined( 'JAVA_BRIDGE_PORT' )) {
|
||||
define( 'JAVA_BRIDGE_PORT', '8080' );
|
||||
if (! defined( 'JAVA_BRIDGE_HOST' ))
|
||||
}
|
||||
if (! defined( 'JAVA_BRIDGE_HOST' )) {
|
||||
define( 'JAVA_BRIDGE_HOST', '127.0.0.1' );
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -37,9 +40,9 @@ if (! defined( 'JAVA_BRIDGE_HOST' ))
|
||||
*/
|
||||
class JavaBridgePM
|
||||
{
|
||||
var $JavaBridgeDir = JAVA_BRIDGE_PATH;
|
||||
var $JavaBridgePort = JAVA_BRIDGE_PORT;
|
||||
var $JavaBridgeHost = JAVA_BRIDGE_HOST;
|
||||
public $JavaBridgeDir = JAVA_BRIDGE_PATH;
|
||||
public $JavaBridgePort = JAVA_BRIDGE_PORT;
|
||||
public $JavaBridgeHost = JAVA_BRIDGE_HOST;
|
||||
|
||||
/**
|
||||
* checkJavaExtension
|
||||
@@ -48,7 +51,7 @@ class JavaBridgePM
|
||||
*
|
||||
* @return true or false
|
||||
*/
|
||||
function checkJavaExtension ()
|
||||
public function checkJavaExtension ()
|
||||
{
|
||||
try {
|
||||
if (! extension_loaded( 'java' )) {
|
||||
@@ -58,8 +61,9 @@ class JavaBridgePM
|
||||
$includedFiles = get_included_files();
|
||||
$found = false;
|
||||
foreach ($includedFiles as $filename) {
|
||||
if ($urlJavaInc == $filename)
|
||||
if ($urlJavaInc == $filename) {
|
||||
$found = true;
|
||||
}
|
||||
}
|
||||
if (! $found) {
|
||||
throw new Exception( 'The PHP/Java Bridge is not defined' );
|
||||
@@ -86,7 +90,7 @@ class JavaBridgePM
|
||||
* @param string $className
|
||||
* @return s boolean success
|
||||
*/
|
||||
function convertValue ($value, $className)
|
||||
public function convertValue ($value, $className)
|
||||
{
|
||||
// if we are a string, just use the normal conversion
|
||||
// methods from the java extension...
|
||||
@@ -94,10 +98,10 @@ class JavaBridgePM
|
||||
if ($className == 'java.lang.String') {
|
||||
$temp = new Java( 'java.lang.String', $value );
|
||||
return $temp;
|
||||
} else if ($className == 'java.lang.Boolean' || $className == 'java.lang.Integer' || $className == 'java.lang.Long' || $className == 'java.lang.Short' || $className == 'java.lang.Double' || $className == 'java.math.BigDecimal') {
|
||||
} elseif ($className == 'java.lang.Boolean' || $className == 'java.lang.Integer' || $className == 'java.lang.Long' || $className == 'java.lang.Short' || $className == 'java.lang.Double' || $className == 'java.math.BigDecimal') {
|
||||
$temp = new Java( $className, $value );
|
||||
return $temp;
|
||||
} else if ($className == 'java.sql.Timestamp' || $className == 'java.sql.Time') {
|
||||
} elseif ($className == 'java.sql.Timestamp' || $className == 'java.sql.Time') {
|
||||
$temp = new Java( $className );
|
||||
$javaObject = $temp->valueOf( $value );
|
||||
return $javaObject;
|
||||
@@ -119,7 +123,7 @@ class JavaBridgePM
|
||||
* @param object $template
|
||||
* @return void
|
||||
*/
|
||||
function generateJrxmlFromDynaform ($outDocUid, $dynaformUid, $template)
|
||||
public function generateJrxmlFromDynaform ($outDocUid, $dynaformUid, $template)
|
||||
{
|
||||
require_once 'classes/model/Dynaform.php';
|
||||
$dyn = new Dynaform();
|
||||
@@ -129,8 +133,9 @@ class JavaBridgePM
|
||||
$reportTpl = PATH_TPL . 'javaBridgePM/classic.xml';
|
||||
$reportFilename = PATH_DYNAFORM . $aFields['PRO_UID'] . PATH_SEP . $outDocUid . '.jrxml';
|
||||
foreach ($xmlFields as $key => $val) {
|
||||
if ($val->type == 'submit' || $val->type == 'button' || $val->type == 'title' || $val->type == 'subtitle')
|
||||
if ($val->type == 'submit' || $val->type == 'button' || $val->type == 'title' || $val->type == 'subtitle') {
|
||||
unset( $xmlFields[$key] );
|
||||
}
|
||||
}
|
||||
|
||||
//$sqlSentence = 'SELECT * from ' . $tableName;
|
||||
@@ -168,6 +173,5 @@ class JavaBridgePM
|
||||
$iSize = file_put_contents( $reportFilename, $content );
|
||||
printf( "saved %s bytes in file %s \n", $iSize, $reportFilename );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* clases_Test.php
|
||||
*
|
||||
@@ -22,142 +23,137 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
G::LoadClass("derivation");
|
||||
|
||||
G::LoadClass( "derivation" );
|
||||
|
||||
$dbc = new DBConnection;
|
||||
$obj = new Derivation;
|
||||
$dbc = new DBConnection;
|
||||
$obj = new Derivation;
|
||||
|
||||
/* derivando el primer caso */
|
||||
|
||||
$frm['APP_UID'] ='44706CAEA62AE0';
|
||||
$frm['DEL_INDEX'] ='1';
|
||||
$obj->executeDerivation($frm);
|
||||
die;
|
||||
$frm['APP_UID'] = '44706CAEA62AE0';
|
||||
$frm['DEL_INDEX'] = '1';
|
||||
$obj->executeDerivation($frm);
|
||||
die;
|
||||
|
||||
/* derivando el primer caso */
|
||||
|
||||
/* CREANDO UN NUEVO CASO */
|
||||
/*
|
||||
$frm['TAS_UID'] ='246F2CD0D4C79E';
|
||||
$frm['USER_UID'] ='00000000000000000000000000000001';
|
||||
$obj->startCase($frm);
|
||||
die;
|
||||
$frm['TAS_UID'] ='246F2CD0D4C79E';
|
||||
$frm['USER_UID'] ='00000000000000000000000000000001';
|
||||
$obj->startCase($frm);
|
||||
die;
|
||||
|
||||
*/
|
||||
*/
|
||||
/* CREANDO UN NUEVO CASO END */
|
||||
/** Application */
|
||||
|
||||
//$frm['PRO_UID'] ='ssddsfse32dd23s';
|
||||
/* $frm['APP_PARENT'] ='135165FDS54654FD';
|
||||
$frm['PRO_UID'] ='SSDDSFSE32DD23S';
|
||||
$frm['APP_STATUS'] ='DRAFT';
|
||||
$frm['APP_PROC_STATUS']='TEST';
|
||||
$frm['APP_PARALLEL']='NO';
|
||||
$frm['APP_TITLE']='MAUI';
|
||||
*/
|
||||
/** Application */
|
||||
//$frm['PRO_UID'] ='ssddsfse32dd23s';
|
||||
/* $frm['APP_PARENT'] ='135165FDS54654FD';
|
||||
$frm['PRO_UID'] ='SSDDSFSE32DD23S';
|
||||
$frm['APP_STATUS'] ='DRAFT';
|
||||
$frm['APP_PROC_STATUS']='TEST';
|
||||
$frm['APP_PARALLEL']='NO';
|
||||
$frm['APP_TITLE']='MAUI';
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/* $translation2 = $obj->generateFileTranslation();
|
||||
print_r($translation2);*/
|
||||
/* $translation2 = $obj->generateFileTranslation();
|
||||
print_r($translation2); */
|
||||
|
||||
|
||||
|
||||
/*step */
|
||||
/*$frm['TAS_UID'] ='sss';
|
||||
$frm['STEP_NAME_OBJ'] ='DYNA';
|
||||
*/
|
||||
/*ReqDynaform */
|
||||
/* $frm['REQ_DYN_TITLE'] ='sss';
|
||||
$frm['REQ_DYN_DESCRIPTION'] ='eee';
|
||||
$frm['REQ_DYN_FILENAME'] ='33';
|
||||
$frm['REQ_DYN_UID']='346BB3D981FD9E';*/
|
||||
/* step */
|
||||
/* $frm['TAS_UID'] ='sss';
|
||||
$frm['STEP_NAME_OBJ'] ='DYNA';
|
||||
*/
|
||||
/* ReqDynaform */
|
||||
/* $frm['REQ_DYN_TITLE'] ='sss';
|
||||
$frm['REQ_DYN_DESCRIPTION'] ='eee';
|
||||
$frm['REQ_DYN_FILENAME'] ='33';
|
||||
$frm['REQ_DYN_UID']='346BB3D981FD9E'; */
|
||||
|
||||
|
||||
|
||||
/*ReqDocument */
|
||||
/* $frm['REQ_DOC_TITLE'] ='titulosssss';
|
||||
$frm['REQ_DOC_DESCRIPTION'] ='descripcions';
|
||||
//$frm['REQ_DOC_ORIGINAL'] ='1';
|
||||
$frm['REQ_DOC_UID']='646BB2F6BB2037';
|
||||
*/
|
||||
/*Task*/
|
||||
/*$frm['TAS_UID']='846BB16A0D9C7A';
|
||||
$frm['PRO_UID']='746B67A9CC9A0E';
|
||||
//$frm['TAS_TYPE'] ='332';
|
||||
$frm['TAS_TITLE'] ='titulito MAUI13ss';
|
||||
$frm['TAS_DESCRIPTION'] ='Descripci<63>n MAUI13';
|
||||
$frm['TAS_DEF_TITLE'] = "13";
|
||||
$frm['TAS_DEF_DESCRIPTION'] = "23";
|
||||
$frm['TAS_DEF_PROC_CODE'] = "33";
|
||||
$frm['TAS_DEF_MESSAGE'] = "43";*/
|
||||
/* ReqDocument */
|
||||
/* $frm['REQ_DOC_TITLE'] ='titulosssss';
|
||||
$frm['REQ_DOC_DESCRIPTION'] ='descripcions';
|
||||
//$frm['REQ_DOC_ORIGINAL'] ='1';
|
||||
$frm['REQ_DOC_UID']='646BB2F6BB2037';
|
||||
*/
|
||||
/* Task */
|
||||
/* $frm['TAS_UID']='846BB16A0D9C7A';
|
||||
$frm['PRO_UID']='746B67A9CC9A0E';
|
||||
//$frm['TAS_TYPE'] ='332';
|
||||
$frm['TAS_TITLE'] ='titulito MAUI13ss';
|
||||
$frm['TAS_DESCRIPTION'] ='Descripci<63>n MAUI13';
|
||||
$frm['TAS_DEF_TITLE'] = "13";
|
||||
$frm['TAS_DEF_DESCRIPTION'] = "23";
|
||||
$frm['TAS_DEF_PROC_CODE'] = "33";
|
||||
$frm['TAS_DEF_MESSAGE'] = "43"; */
|
||||
|
||||
/** SwimlanesElements*/
|
||||
/** SwimlanesElements */
|
||||
/*
|
||||
$frm['PRO_UID'] ='ssddsfse32dd23s';
|
||||
$frm['SWI_TEXT'] ='maui';
|
||||
$frm['SWI_TYPE'] ='TEXT';
|
||||
$frm['SWI_X'] ='2';
|
||||
$frm['SWI_UID']='746BB217D7805E';
|
||||
$frm['PRO_UID'] ='ssddsfse32dd23s';
|
||||
$frm['SWI_TEXT'] ='maui';
|
||||
$frm['SWI_TYPE'] ='TEXT';
|
||||
$frm['SWI_X'] ='2';
|
||||
$frm['SWI_UID']='746BB217D7805E';
|
||||
|
||||
*/
|
||||
/** Route */
|
||||
*/
|
||||
/** Route */
|
||||
/*
|
||||
$frm['PRO_UID'] ='ssddsfse32dd23s';
|
||||
$frm['TAS_UID'] ='cooo';
|
||||
$frm['ROU_NEXT_TASK'] ='654FD65S4F65SD';
|
||||
$frm['ROU_SOURCEANCHOR'] ='2';
|
||||
$frm['ROU_UID']='746BB8411A9C14';
|
||||
*/
|
||||
$frm['PRO_UID'] ='ssddsfse32dd23s';
|
||||
$frm['TAS_UID'] ='cooo';
|
||||
$frm['ROU_NEXT_TASK'] ='654FD65S4F65SD';
|
||||
$frm['ROU_SOURCEANCHOR'] ='2';
|
||||
$frm['ROU_UID']='746BB8411A9C14';
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*PROCESS*/
|
||||
/*$frm['PRO_UID'] = '446BB1B36E17FE';
|
||||
$frm['PRO_TITLE'] = 'PERDERD';
|
||||
$frm['PRO_PARENT']='746B67A9CC9ADDDDDDDD0E';*/
|
||||
/* PROCESS */
|
||||
/* $frm['PRO_UID'] = '446BB1B36E17FE';
|
||||
$frm['PRO_TITLE'] = 'PERDERD';
|
||||
$frm['PRO_PARENT']='746B67A9CC9ADDDDDDDD0E'; */
|
||||
|
||||
/** END PROCESS*/
|
||||
|
||||
/*MESSAGE*/
|
||||
/** END PROCESS */
|
||||
/* MESSAGE */
|
||||
/*
|
||||
$frm['PRO_UID'] = '446BB1B36E17FE';
|
||||
$frm['MESS_UID'] = '146CDAC097D35A';
|
||||
$frm['MESS_TYPE'] = 'HTMLS';
|
||||
$frm['MESS_TITLE'] = 't<>tulo del mensaje';
|
||||
$frm['MESS_DESCRIPTION'] = 'estimado SrS.';
|
||||
$frm['PRO_UID'] = '446BB1B36E17FE';
|
||||
$frm['MESS_UID'] = '146CDAC097D35A';
|
||||
$frm['MESS_TYPE'] = 'HTMLS';
|
||||
$frm['MESS_TITLE'] = 't<>tulo del mensaje';
|
||||
$frm['MESS_DESCRIPTION'] = 'estimado SrS.';
|
||||
|
||||
/** END MESSAGE*/
|
||||
/*STEP*/
|
||||
/** END MESSAGE */
|
||||
/* STEP */
|
||||
/*
|
||||
$frm['PRO_UID'] = '446BB1B36E17FE';
|
||||
$frm['TAS_UID'] = '146CDAC097D35A';
|
||||
$frm['STEP_NAME_OBJ'] = 'HTM';
|
||||
$frm['STEP_TYPE_OBJ'] = 'OUTPUT_DOCUMENT';
|
||||
$frm['STEP_UID_OBJ'] = 'estimado SrS.';
|
||||
*/
|
||||
/** END MESSAGE*/
|
||||
|
||||
/** Delegation */
|
||||
|
||||
//$frm['PRO_UID'] ='ssddsfse32dd23s';
|
||||
/*$frm['APP_UID'] ='135165FDS54654FD';
|
||||
$frm['APP_PARENT'] ='135165FDS54654FD';
|
||||
$frm['PRO_UID'] ='SSDDSFSE32DD23S';
|
||||
$frm['APP_STATUS'] ='DRAFT';
|
||||
$frm['APP_PROC_STATUS']='TEST';
|
||||
$frm['APP_PARALLEL']='NO';
|
||||
$frm['APP_TITLE']='MAUI';
|
||||
$frm['PRO_UID'] = '446BB1B36E17FE';
|
||||
$frm['TAS_UID'] = '146CDAC097D35A';
|
||||
$frm['STEP_NAME_OBJ'] = 'HTM';
|
||||
$frm['STEP_TYPE_OBJ'] = 'OUTPUT_DOCUMENT';
|
||||
$frm['STEP_UID_OBJ'] = 'estimado SrS.';
|
||||
*/
|
||||
/** END MESSAGE */
|
||||
/** Delegation */
|
||||
//$frm['PRO_UID'] ='ssddsfse32dd23s';
|
||||
/* $frm['APP_UID'] ='135165FDS54654FD';
|
||||
$frm['APP_PARENT'] ='135165FDS54654FD';
|
||||
$frm['PRO_UID'] ='SSDDSFSE32DD23S';
|
||||
$frm['APP_STATUS'] ='DRAFT';
|
||||
$frm['APP_PROC_STATUS']='TEST';
|
||||
$frm['APP_PARALLEL']='NO';
|
||||
$frm['APP_TITLE']='MAUI';
|
||||
|
||||
|
||||
|
||||
$prouid = $obj->Save ($frm);
|
||||
//$obj->load('746E99F0D23189'); print_r($obj->Fields);
|
||||
$obj->delete('046E99A56954AE');
|
||||
$prouid = $obj->Save ($frm);
|
||||
//$obj->load('746E99F0D23189'); print_r($obj->Fields);
|
||||
$obj->delete('046E99A56954AE');
|
||||
|
||||
|
||||
die("eliminado YA - ".$prouid);
|
||||
*/
|
||||
?>
|
||||
die("eliminado YA - ".$prouid);
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* methodsPermissions.php
|
||||
*
|
||||
@@ -21,9 +22,8 @@
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'tools/methodsPermissions' );
|
||||
$G_PUBLISH->AddContent('view', 'tools/methodsPermissions');
|
||||
|
||||
G::RenderPage( 'publish' );
|
||||
G::RenderPage('publish');
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* methodsPermissions.php
|
||||
*
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
@@ -14,131 +14,127 @@
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*
|
||||
*/
|
||||
G::LoadClass('tree');
|
||||
/*
|
||||
* Esto no deberias borrarlo
|
||||
*/
|
||||
$tree = new Tree();
|
||||
G::LoadClass('tree');
|
||||
/*
|
||||
* Esto no deberias borrarlo
|
||||
*/
|
||||
$tree = new Tree();
|
||||
|
||||
reView(PATH_TRUNK,$tree);
|
||||
print( $tree->render() );
|
||||
reView(PATH_TRUNK, $tree);
|
||||
print( $tree->render());
|
||||
|
||||
function reView($path,&$tree)
|
||||
{
|
||||
$tree->name = $path;
|
||||
$tree->value = $path . ' '.
|
||||
setHeader('Set Header','setDirHeader("'.$path.'",this);').
|
||||
selectPermissions('Set Permission','setDirPermission("'.$path.'",this);').
|
||||
selectPermissions('Remove Permission','removeDirPermission("'.$path.'",this);');
|
||||
function reView($path, &$tree)
|
||||
{
|
||||
$tree->name = $path;
|
||||
$tree->value = $path . ' ' .
|
||||
setHeader('Set Header', 'setDirHeader("' . $path . '",this);') .
|
||||
selectPermissions('Set Permission', 'setDirPermission("' . $path . '",this);') .
|
||||
selectPermissions('Remove Permission', 'removeDirPermission("' . $path . '",this);');
|
||||
$tree->contracted = true;
|
||||
foreach(glob($path.'*',GLOB_MARK) as $file)
|
||||
{
|
||||
if (is_dir($file))
|
||||
{
|
||||
reView($file,$tree->addChild($file, $file ));
|
||||
}
|
||||
elseif (substr($file,-4,4)==='.php')
|
||||
{
|
||||
$nodeFile=&$tree->addChild
|
||||
(
|
||||
$file, $file . ' '.
|
||||
selectPermissions('Set Permission','setPermission("'.$file.'",this);').
|
||||
selectPermissions('Remove Permission','removePermission("'.$file.'",this);')
|
||||
);
|
||||
$nodeFile->addChild("View Permissions",'<div style="cursor:hand;" onclick="loadFile("'.htmlentities($file,ENT_QUOTES,'UTF-8').'",this.nextSibling);">View Permissions</div><div id="divPerms['.htmlentities($file,ENT_QUOTES,'UTF-8').']"></div>');
|
||||
$nodeFile->addChild("Add Line",'<a href="#" onclick="addPermission("'.htmlentities($file,ENT_QUOTES,'UTF-8').'",this.nextSibling.nextSibling);return false;">Add Permission</a><br/><input style="width:100%;"/>');
|
||||
$nodeFile->contracted = true;
|
||||
}
|
||||
foreach (glob($path . '*', GLOB_MARK) as $file) {
|
||||
if (is_dir($file)) {
|
||||
reView($file, $tree->addChild($file, $file));
|
||||
} elseif (substr($file, -4, 4) === '.php') {
|
||||
$nodeFile = &$tree->addChild($file, $file . ' ' .
|
||||
selectPermissions('Set Permission', 'setPermission("' . $file . '",this);') .
|
||||
selectPermissions('Remove Permission', 'removePermission("' . $file . '",this);')
|
||||
);
|
||||
$nodeFile->addChild("View Permissions", '<div style="cursor:hand;" onclick="loadFile("' . htmlentities($file, ENT_QUOTES, 'UTF-8') . '",this.nextSibling);">View Permissions</div><div id="divPerms[' . htmlentities($file, ENT_QUOTES, 'UTF-8') . ']"></div>');
|
||||
$nodeFile->addChild("Add Line", '<a href="#" onclick="addPermission("' . htmlentities($file, ENT_QUOTES, 'UTF-8') . '",this.nextSibling.nextSibling);return false;">Add Permission</a><br/><input style="width:100%;"/>');
|
||||
$nodeFile->contracted = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
function selectPermissions($label,$onchange)
|
||||
{
|
||||
return '<select onchange="'.htmlentities($onchange,ENT_QUOTES,'UTF-8').'">'.
|
||||
'<option>'.$label.'</option>'.
|
||||
'<option value="PM_LOGIN">PM_LOGIN</option>'.
|
||||
'<option value="PM_USERS">PM_USERS</option>'.
|
||||
'<option value="PM_CASES">PM_CASES</option>'.
|
||||
'<option value="PM_FACTORY">PM_FACTORY</option>'.
|
||||
'<option value="PM_SETUP">PM_SETUP</option>'.
|
||||
'</select>';
|
||||
}
|
||||
function setHeader($label,$onchange)
|
||||
{
|
||||
return '<input type="button" onclick="'.htmlentities($onchange,ENT_QUOTES,'UTF-8').'" value="set header"/>';
|
||||
}
|
||||
}
|
||||
|
||||
function selectPermissions($label, $onchange)
|
||||
{
|
||||
return '<select onchange="' . htmlentities($onchange, ENT_QUOTES, 'UTF-8') . '">' .
|
||||
'<option>' . $label . '</option>' .
|
||||
'<option value="PM_LOGIN">PM_LOGIN</option>' .
|
||||
'<option value="PM_USERS">PM_USERS</option>' .
|
||||
'<option value="PM_CASES">PM_CASES</option>' .
|
||||
'<option value="PM_FACTORY">PM_FACTORY</option>' .
|
||||
'<option value="PM_SETUP">PM_SETUP</option>' .
|
||||
'</select>';
|
||||
}
|
||||
|
||||
function setHeader($label, $onchange)
|
||||
{
|
||||
return '<input type="button" onclick="' . htmlentities($onchange, ENT_QUOTES, 'UTF-8') . '" value="set header"/>';
|
||||
}
|
||||
?>
|
||||
<textarea id="headerText" cols="80" rows="25"></textarea>
|
||||
<script>
|
||||
var headerText=document.getElementById("headerText");
|
||||
var phpFile = WebResource('methodsPermissions_Ajax');
|
||||
function loadFile(file,div)
|
||||
{
|
||||
div.innerHTML=phpFile.get_permissions(file);
|
||||
}
|
||||
function switchViewEdit(txt,inp)
|
||||
{
|
||||
showHideElement(txt);
|
||||
showHideElement(inp);
|
||||
inp.focus();
|
||||
var file=inp.name.split('?')[0];
|
||||
var row=parseInt(inp.name.split('?')[1]);
|
||||
//phpFile.modify_line(file,row,inp.value);
|
||||
}
|
||||
function switchEditView(txt,inp)
|
||||
{
|
||||
showHideElement(txt);
|
||||
showHideElement(inp);
|
||||
var file=inp.name.split('?')[0];
|
||||
var row=parseInt(inp.name.split('?')[1]);
|
||||
var res=phpFile.modify_line(file,row,inp.value);
|
||||
txt.innerHTML=res[0];
|
||||
inp.value=res[1];
|
||||
}
|
||||
function addPermission(file,inp)
|
||||
{
|
||||
var res=phpFile.add_permission(file,inp.value);
|
||||
document.getElementById('divPerms['+file+']').innerHTML=res;
|
||||
}
|
||||
function removeLine(btn)
|
||||
{
|
||||
var file=btn.name.split('?')[0];
|
||||
var row=parseInt(btn.name.split('?')[1]);
|
||||
var res=phpFile.remove_line(file,row);
|
||||
document.getElementById('divPerms['+file+']').innerHTML=res;
|
||||
}
|
||||
function setDirPermission(file,inp)
|
||||
{
|
||||
var res=phpFile.set_path_permission(file,inp.value);
|
||||
inp.selectedIndex=0;
|
||||
}
|
||||
function setDirHeader(file,inp)
|
||||
{
|
||||
var res=phpFile.set_path_header(file,headerText.value);
|
||||
inp.selectedIndex=0;
|
||||
}
|
||||
function removeDirPermission(file,inp)
|
||||
{
|
||||
var res=phpFile.remove_path_permission(file,headerText.value);
|
||||
inp.selectedIndex=0;
|
||||
}
|
||||
function setPermission(file,inp)
|
||||
{
|
||||
var res=phpFile.set_permission(file,inp.value);
|
||||
document.getElementById('divPerms['+file+']').innerHTML=res;
|
||||
inp.selectedIndex=0;
|
||||
}
|
||||
function removePermission(file,inp)
|
||||
{
|
||||
var res=phpFile.remove_permission(file,inp.value);
|
||||
document.getElementById('divPerms['+file+']').innerHTML=res;
|
||||
inp.selectedIndex=0;
|
||||
}
|
||||
</script>
|
||||
var headerText = document.getElementById("headerText");
|
||||
var phpFile = WebResource('methodsPermissions_Ajax');
|
||||
function loadFile(file, div)
|
||||
{
|
||||
div.innerHTML = phpFile.get_permissions(file);
|
||||
}
|
||||
function switchViewEdit(txt, inp)
|
||||
{
|
||||
showHideElement(txt);
|
||||
showHideElement(inp);
|
||||
inp.focus();
|
||||
var file = inp.name.split('?')[0];
|
||||
var row = parseInt(inp.name.split('?')[1]);
|
||||
//phpFile.modify_line(file,row,inp.value);
|
||||
}
|
||||
function switchEditView(txt, inp)
|
||||
{
|
||||
showHideElement(txt);
|
||||
showHideElement(inp);
|
||||
var file = inp.name.split('?')[0];
|
||||
var row = parseInt(inp.name.split('?')[1]);
|
||||
var res = phpFile.modify_line(file, row, inp.value);
|
||||
txt.innerHTML = res[0];
|
||||
inp.value = res[1];
|
||||
}
|
||||
function addPermission(file, inp)
|
||||
{
|
||||
var res = phpFile.add_permission(file, inp.value);
|
||||
document.getElementById('divPerms[' + file + ']').innerHTML = res;
|
||||
}
|
||||
function removeLine(btn)
|
||||
{
|
||||
var file = btn.name.split('?')[0];
|
||||
var row = parseInt(btn.name.split('?')[1]);
|
||||
var res = phpFile.remove_line(file, row);
|
||||
document.getElementById('divPerms[' + file + ']').innerHTML = res;
|
||||
}
|
||||
function setDirPermission(file, inp)
|
||||
{
|
||||
var res = phpFile.set_path_permission(file, inp.value);
|
||||
inp.selectedIndex = 0;
|
||||
}
|
||||
function setDirHeader(file, inp)
|
||||
{
|
||||
var res = phpFile.set_path_header(file, headerText.value);
|
||||
inp.selectedIndex = 0;
|
||||
}
|
||||
function removeDirPermission(file, inp)
|
||||
{
|
||||
var res = phpFile.remove_path_permission(file, headerText.value);
|
||||
inp.selectedIndex = 0;
|
||||
}
|
||||
function setPermission(file, inp)
|
||||
{
|
||||
var res = phpFile.set_permission(file, inp.value);
|
||||
document.getElementById('divPerms[' + file + ']').innerHTML = res;
|
||||
inp.selectedIndex = 0;
|
||||
}
|
||||
function removePermission(file, inp)
|
||||
{
|
||||
var res = phpFile.remove_permission(file, inp.value);
|
||||
document.getElementById('divPerms[' + file + ']').innerHTML = res;
|
||||
inp.selectedIndex = 0;
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user