Remove require_once

This commit is contained in:
Paula Quispe
2017-08-04 16:42:40 -04:00
parent eec57be464
commit c4030e08e5
18 changed files with 20 additions and 73 deletions

View File

@@ -79,18 +79,6 @@ class G
//For backward compatibilities //For backward compatibilities
} }
/**
* Include all model files
* @access public
* @param string $strClass
* @return void
* @deprecated 08-04-2017
*/
public static function LoadAllModelClasses($strClass)
{
//For backward compatibilities
}
/** /**
* public function LoadClassRBAC * public function LoadClassRBAC
* @access public * @access public
@@ -128,6 +116,24 @@ class G
//For backward compatibilities //For backward compatibilities
} }
/**
* Include all model files
* @access public
* @param string $strClass
* @return void
*/
public static function LoadAllModelClasses($strClass)
{
$baseDir = PATH_CORE . 'classes' . PATH_SEP . 'model';
if ($handle = opendir( $baseDir )) {
while (false !== ($file = readdir( $handle ))) {
if (strpos( $file, '.php', 1 ) && ! strpos( $file, 'Peer.php', 1 )) {
require_once ($baseDir . PATH_SEP . $file);
}
}
}
}
/** /**
* is_https * is_https
* @return bool * @return bool

View File

@@ -829,7 +829,6 @@ function getPMFolderContent()
$c->setDBArrayTable ('PM_FOLDER_DOC'); $c->setDBArrayTable ('PM_FOLDER_DOC');
$c->addAscendingOrderByColumn ('id'); $c->addAscendingOrderByColumn ('id');
$G_PUBLISH = new Publisher (); $G_PUBLISH = new Publisher ();
require_once ('classes/class.xmlfield_InputPM.php');
$labelFolderAddFile = ""; $labelFolderAddFile = "";
$labelFolderAddFolder = ""; $labelFolderAddFolder = "";
@@ -1157,7 +1156,6 @@ function findChilds($uidFolder, $path, $arrayPath)
} }
function copyMoveAction($type) function copyMoveAction($type)
{ {
require_once ("classes/model/AppFolder.php");
$oPMFolder = new AppFolder (); $oPMFolder = new AppFolder ();
$dir=$_REQUEST['dir']; $dir=$_REQUEST['dir'];
@@ -1327,7 +1325,6 @@ function documentVersionHistory()
$c->setDBArrayTable ('PM_FOLDER_DOC_HISTORY'); $c->setDBArrayTable ('PM_FOLDER_DOC_HISTORY');
$c->addAscendingOrderByColumn ('id'); $c->addAscendingOrderByColumn ('id');
$G_PUBLISH = new Publisher (); $G_PUBLISH = new Publisher ();
require_once ('classes/class.xmlfield_InputPM.php');
$G_PUBLISH->AddContent ('propeltable', 'paged-table', 'appFolder/appFolderDocumentListHistory', $c, $G_PUBLISH->AddContent ('propeltable', 'paged-table', 'appFolder/appFolderDocumentListHistory', $c,
array ('folderID' => $_POST ['folderID'] != '0' ? $_POST ['folderID'] == 'NA' ? array ('folderID' => $_POST ['folderID'] != '0' ? $_POST ['folderID'] == 'NA' ?
@@ -1339,8 +1336,7 @@ function documentVersionHistory()
function overwriteFile($node, $fileName) function overwriteFile($node, $fileName)
{ {
global $RBAC; global $RBAC;
require_once ("classes/model/AppFolder.php");
require_once ("classes/model/AppDocument.php");
$appDocument = new AppDocument(); $appDocument = new AppDocument();
$pMFolder = new AppFolder(); $pMFolder = new AppFolder();
$user = ($RBAC->userCanAccess('PM_ALLCASES') == 1) ? '' : $_SESSION['USER_LOGGED']; $user = ($RBAC->userCanAccess('PM_ALLCASES') == 1) ? '' : $_SESSION['USER_LOGGED'];
@@ -1355,9 +1351,6 @@ function overwriteFile($node, $fileName)
function copyMoveExecuteTree($uidFolder, $newUidFolder) function copyMoveExecuteTree($uidFolder, $newUidFolder)
{ {
require_once ("classes/model/AppDocument.php");
require_once ('classes/model/AppFolder.php');
$appFoder = new AppFolder (); $appFoder = new AppFolder ();
$folderContent = $appFoder->getFolderContent($uidFolder); $folderContent = $appFoder->getFolderContent($uidFolder);
$folderOrigin = $appFoder->getFolderStructure($uidFolder); $folderOrigin = $appFoder->getFolderStructure($uidFolder);
@@ -1412,7 +1405,6 @@ function copyMoveExecuteTree($uidFolder, $newUidFolder)
function checkTree ($uidOriginFolder, $uidNewFolder) function checkTree ($uidOriginFolder, $uidNewFolder)
{ {
require_once ('classes/model/AppFolder.php');
$appFoder = new AppFolder (); $appFoder = new AppFolder ();
$newFoldercontent = copyMoveExecuteTree($uidOriginFolder, $uidNewFolder); $newFoldercontent = copyMoveExecuteTree($uidOriginFolder, $uidNewFolder);
$listfolder = $appFoder->getFolderList($uidOriginFolder); $listfolder = $appFoder->getFolderList($uidOriginFolder);
@@ -1495,7 +1487,6 @@ function uploadExternalDocument()
} }
$_POST['selitems'] = array(); $_POST['selitems'] = array();
} else { } else {
require_once ("classes/model/AppDocument.php");
$oAppDocument = new AppDocument(); $oAppDocument = new AppDocument();
if (isset($_POST['selitems']) && is_array($_POST['selitems'])) { if (isset($_POST['selitems']) && is_array($_POST['selitems'])) {
foreach ($_POST['selitems'] as $docId) { foreach ($_POST['selitems'] as $docId) {
@@ -1533,10 +1524,6 @@ function uploadExternalDocument()
$docType=isset($_POST['docType'])?$_GET['docType']:"INPUT"; $docType=isset($_POST['docType'])?$_GET['docType']:"INPUT";
//save info //save info
require_once ("classes/model/AppDocument.php");
require_once ('classes/model/AppFolder.php');
require_once ('classes/model/InputDocument.php');
$oInputDocument = new InputDocument(); $oInputDocument = new InputDocument();
if ($docUid != -1) { if ($docUid != -1) {
$aID = $oInputDocument->load($docUid); $aID = $oInputDocument->load($docUid);
@@ -1679,7 +1666,6 @@ function uploadExternalDocument()
function newFolder() function newFolder()
{ {
require_once ("classes/model/AppFolder.php");
$oPMFolder = new AppFolder (); $oPMFolder = new AppFolder ();
//G::pr($_POST); //G::pr($_POST);
if ($_POST ['dir']=="") { if ($_POST ['dir']=="") {
@@ -1792,22 +1778,10 @@ function newFolder()
$response=str_replace('"handlerCancel"',$handlerCancel,$response); $response=str_replace('"handlerCancel"',$handlerCancel,$response);
print_r($response); print_r($response);
/*
$oFolder = new AppFolder ();
$folderStructure = $oPMFolder->getFolderStructure ($_POST ['folderID']);
$Fields ['FOLDER_PATH'] = $folderStructure ['PATH'];
$Fields ['FOLDER_PARENT_UID'] = $_POST ['folderID'];
$Fields ['FOLDER_UID'] = G::GenerateUniqueID ();
$G_PUBLISH = new Publisher ();
$G_PUBLISH->AddContent ('xmlform', 'xmlform', 'appFolder/appFolderEdit', '', $Fields, 'appFolderSave');
G::RenderPage ('publish', 'raw');
*/
} }
function appFolderSave() function appFolderSave()
{ {
require_once ("classes/model/AppFolder.php");
$oPMFolder = new AppFolder (); $oPMFolder = new AppFolder ();
$form = $_POST['form']; $form = $_POST['form'];
$FolderUid = $form['FOLDER_UID']; $FolderUid = $form['FOLDER_UID'];

View File

@@ -6,8 +6,6 @@
$index=0; $index=0;
$FolderUid = str_replace ( '"', '', $aux[$index++] ); $FolderUid = str_replace ( '"', '', $aux[$index++] );
require_once ( "classes/model/AppFolder.php" );
//if exists the row in the database propel will update it, otherwise will insert. //if exists the row in the database propel will update it, otherwise will insert.
$tr = AppFolderPeer::retrieveByPK( $FolderUid ); $tr = AppFolderPeer::retrieveByPK( $FolderUid );

View File

@@ -4,9 +4,6 @@
$form = $_POST['form']; $form = $_POST['form'];
$FolderUid = $form['FOLDER_UID']; $FolderUid = $form['FOLDER_UID'];
require_once ( "classes/model/AppFolder.php" );
//if exists the row in the database propel will update it, otherwise will insert. //if exists the row in the database propel will update it, otherwise will insert.
$tr = AppFolderPeer::retrieveByPK( $FolderUid ); $tr = AppFolderPeer::retrieveByPK( $FolderUid );
if ( ( is_object ( $tr ) && get_class ($tr) == 'AppFolder' ) ) { if ( ( is_object ( $tr ) && get_class ($tr) == 'AppFolder' ) ) {

View File

@@ -3,8 +3,6 @@
$aux = explode ( '|', isset($_GET['id']) ? $_GET['id'] : '' ); $aux = explode ( '|', isset($_GET['id']) ? $_GET['id'] : '' );
$FolderUid = str_replace ( '"', '', $aux[0] ); $FolderUid = str_replace ( '"', '', $aux[0] );
require_once ( "classes/model/AppFolder.php" );
//if exists the row in the database propel will update it, otherwise will insert. //if exists the row in the database propel will update it, otherwise will insert.
$tr = AppFolderPeer::retrieveByPK( $FolderUid ); $tr = AppFolderPeer::retrieveByPK( $FolderUid );

View File

@@ -10,7 +10,6 @@ try {
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
if ((isset( $_POST['form']['FOLDER_UID'] )) && (isset( $_POST['form']['MOVE_FOLDER_PATH'] ))) { if ((isset( $_POST['form']['FOLDER_UID'] )) && (isset( $_POST['form']['MOVE_FOLDER_PATH'] ))) {
require_once ("classes/model/AppDocument.php");
$oAppDocument = new AppDocument(); $oAppDocument = new AppDocument();
//Move files to another FOLDER_UID' //Move files to another FOLDER_UID'

View File

@@ -1,9 +1,5 @@
<?php <?php
require_once ( "classes/model/AppFolder.php" );
$fields['FOLDER_UID'] = G::GenerateUniqueID();; $fields['FOLDER_UID'] = G::GenerateUniqueID();;
$fields['FOLDER_PARENT_UID'] = ''; $fields['FOLDER_PARENT_UID'] = '';

View File

@@ -8,9 +8,6 @@ try {
$FolderCreateDate = 'now'; $FolderCreateDate = 'now';
$FolderUpdateDate = 'now'; $FolderUpdateDate = 'now';
require_once ( "classes/model/AppFolder.php" );
//if exists the row in the database propel will update it, otherwise will insert. //if exists the row in the database propel will update it, otherwise will insert.
$tr = AppFolderPeer::retrieveByPK($FolderUid); $tr = AppFolderPeer::retrieveByPK($FolderUid);
if (!( is_object($tr) && get_class($tr) == 'AppFolder' )) { if (!( is_object($tr) && get_class($tr) == 'AppFolder' )) {

View File

@@ -34,10 +34,6 @@ try {
//save info //save info
require_once ("classes/model/AppDocument.php");
require_once ('classes/model/AppFolder.php');
require_once ('classes/model/InputDocument.php');
$oInputDocument = new InputDocument(); $oInputDocument = new InputDocument();
if ($_GET['UID'] != -1) { if ($_GET['UID'] != -1) {
$aID = $oInputDocument->load($_GET['UID']); $aID = $oInputDocument->load($_GET['UID']);

View File

@@ -34,8 +34,6 @@ class treeNode extends stdclass
} }
try { try {
require_once ("classes" . PATH_SEP . "model" . PATH_SEP . "Department.php");
$json = new Services_JSON(); $json = new Services_JSON();
header("Content-Type: application/json;"); header("Content-Type: application/json;");

View File

@@ -31,7 +31,6 @@ try {
switch ($_REQUEST['action']) { switch ($_REQUEST['action']) {
case 'searchUsers': case 'searchUsers':
require_once 'classes/model/Users.php';
$criteria = new Criteria( 'workflow' ); $criteria = new Criteria( 'workflow' );
$criteria->addSelectColumn( UsersPeer::USR_USERNAME ); $criteria->addSelectColumn( UsersPeer::USR_USERNAME );
$criteria->add( UsersPeer::USR_STATUS, array ('CLOSED' $criteria->add( UsersPeer::USR_STATUS, array ('CLOSED'

View File

@@ -98,7 +98,7 @@ foreach ($_POST['aUsers'] as $sUser) {
} }
} }
} }
require_once 'classes/model/Users.php';
$oUser = new Users(); $oUser = new Users();
$oUser->create( $aData ); $oUser->create( $aData );
} }

View File

@@ -312,7 +312,6 @@ switch ($function) {
} }
} }
} }
require_once 'classes/model/Users.php';
$oUser = new Users(); $oUser = new Users();
$oUser->create( $aData ); $oUser->create( $aData );
} }

View File

@@ -42,7 +42,6 @@ function sendJsonResultGeneric ($response, $callback)
function getNotesList () function getNotesList ()
{ {
extract( getExtJSParams() ); extract( getExtJSParams() );
require_once ("classes/model/AppNotes.php");
if ((isset( $_REQUEST['appUid'] )) && (trim( $_REQUEST['appUid'] ) != "")) { if ((isset( $_REQUEST['appUid'] )) && (trim( $_REQUEST['appUid'] ) != "")) {
$appUid = $_REQUEST['appUid']; $appUid = $_REQUEST['appUid'];
} else { } else {
@@ -64,7 +63,6 @@ function postNote ()
$appUid = $_SESSION['APPLICATION']; $appUid = $_SESSION['APPLICATION'];
} }
$usrUid = (isset( $_SESSION['USER_LOGGED'] )) ? $_SESSION['USER_LOGGED'] : ""; $usrUid = (isset( $_SESSION['USER_LOGGED'] )) ? $_SESSION['USER_LOGGED'] : "";
require_once ("classes/model/AppNotes.php");
$noteContent = addslashes( $_POST['noteText'] ); $noteContent = addslashes( $_POST['noteText'] );

View File

@@ -9,9 +9,6 @@ try {
$form = $_POST['form']; $form = $_POST['form'];
$CategoryUid = $form['CATEGORY_UID']; $CategoryUid = $form['CATEGORY_UID'];
require_once ("classes/model/ProcessCategory.php");
require_once 'classes/model/Process.php';
//we'are looking for data into process with this CategoryUid //we'are looking for data into process with this CategoryUid
$oCriteria = new Criteria( 'workflow' ); $oCriteria = new Criteria( 'workflow' );

View File

@@ -9,7 +9,6 @@ if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_SETUP_A
$aux = explode( '|', isset( $_GET['id'] ) ? $_GET['id'] : '' ); $aux = explode( '|', isset( $_GET['id'] ) ? $_GET['id'] : '' );
$CategoryUid = str_replace( '"', '', $aux[0] ); $CategoryUid = str_replace( '"', '', $aux[0] );
require_once ("classes/model/ProcessCategory.php");
//if exists the row in the database propel will update it, otherwise will insert. //if exists the row in the database propel will update it, otherwise will insert.
$tr = ProcessCategoryPeer::retrieveByPK( $CategoryUid ); $tr = ProcessCategoryPeer::retrieveByPK( $CategoryUid );

View File

@@ -6,8 +6,6 @@ if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_SETUP_A
die(); die();
} }
require_once ("classes/model/ProcessCategory.php");
$fields['CATEGORY_UID'] = G::GenerateUniqueID(); $fields['CATEGORY_UID'] = G::GenerateUniqueID();
; ;

View File

@@ -6,8 +6,6 @@ try {
$CategoryName = $form['CATEGORY_NAME']; $CategoryName = $form['CATEGORY_NAME'];
$CategoryIcon = $form['CATEGORY_ICON']; $CategoryIcon = $form['CATEGORY_ICON'];
require_once ("classes/model/ProcessCategory.php");
//if exists the row in the database propel will update it, otherwise will insert. //if exists the row in the database propel will update it, otherwise will insert.
$tr = ProcessCategoryPeer::retrieveByPK( $CategoryUid ); $tr = ProcessCategoryPeer::retrieveByPK( $CategoryUid );
$processCategory = new ProcessCategory(); $processCategory = new ProcessCategory();