HOR-3670-HQ
update
This commit is contained in:
@@ -919,7 +919,7 @@ class Bootstrap
|
||||
if (((in_array($browserName, $enabledBrowsers)) || (in_array('ALL', $enabledBrowsers))) && (!(in_array($browserName, $disabledBrowsers)))) {
|
||||
if ($cssFileInfo['__ATTRIBUTES__']['file'] == 'rtl.css') {
|
||||
|
||||
$oServerConf = & serverConf::getSingleton();
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
if (!(defined('SYS_LANG'))) {
|
||||
if (isset($_SERVER['HTTP_REFERER'])) {
|
||||
$syss = explode('://', $_SERVER['HTTP_REFERER']);
|
||||
|
||||
@@ -1011,7 +1011,7 @@ class G
|
||||
|
||||
if (((in_array($browserName, $enabledBrowsers)) || (in_array('ALL', $enabledBrowsers)))&&(!(in_array($browserName, $disabledBrowsers)))) {
|
||||
if ($cssFileInfo['__ATTRIBUTES__']['file'] == 'rtl.css') {
|
||||
$oServerConf =& serverConf::getSingleton();
|
||||
$oServerConf =& ServerConf::getSingleton();
|
||||
if (!(defined('SYS_LANG'))) {
|
||||
if (isset($_SERVER['HTTP_REFERER'])) {
|
||||
$syss = explode('://', $_SERVER['HTTP_REFERER']);
|
||||
|
||||
@@ -360,7 +360,7 @@ class headPublisher
|
||||
//$head .= $this->getExtJsStylesheets();
|
||||
$head .= $this->getExtJsScripts();
|
||||
$head .= $this->getExtJsVariablesScript();
|
||||
$oServerConf = & serverConf::getSingleton();
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
if ($oServerConf->isRtl(SYS_LANG)) {
|
||||
$head = $head . " <script type=\"text/javascript\" src=\"" . G::browserCacheFilesUrl("/js/ext/extjs_rtl.js") . "\"></script>\n";
|
||||
}
|
||||
@@ -751,7 +751,7 @@ class headPublisher
|
||||
$views = array();
|
||||
$keyState = "extJsViewState";
|
||||
$prefixExtJs = "ys-";
|
||||
$oServerConf = &serverConf::getSingleton();
|
||||
$oServerConf = &ServerConf::getSingleton();
|
||||
$deleteCache = true;
|
||||
|
||||
$sjson = $oServerConf->getProperty($keyState);
|
||||
|
||||
@@ -76,7 +76,7 @@ class XmlForm_Field_WYSIWYG_EDITOR extends XmlForm_Field
|
||||
{
|
||||
$editorDefinition = 'tinyMCE.baseURL = "/js/tinymce/jscripts/tiny_mce"; ';
|
||||
$editorDefinition .= 'var domainURL = "/sys'.SYS_SYS.'/'.SYS_LANG.'/'.SYS_SKIN.'/"';
|
||||
$serverConf =& serverConf::getSingleton();
|
||||
$serverConf =& ServerConf::getSingleton();
|
||||
|
||||
switch ($this->editorType){
|
||||
case 'EMAIL_TEMPLATE':
|
||||
|
||||
@@ -97,7 +97,7 @@ class PmBootstrap extends Bootstrap
|
||||
$this->autoloader->registerClass('Xml_Node', PATH_GULLIVER . 'class.xmlDocument');
|
||||
$this->autoloader->registerClass('Xml_document', PATH_GULLIVER . 'class.xmlDocument');
|
||||
$this->autoloader->registerClass('XmlForm_Field_*', PATH_GULLIVER . 'class.xmlform');
|
||||
$this->autoloader->registerClass('serverConf', PATH_CORE . 'classes/class.serverConfiguration');
|
||||
$this->autoloader->registerClass('ServerConf', PATH_CORE . 'classes/class.serverConfiguration');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -333,7 +333,7 @@ function resendEmails()
|
||||
$dateResend = date("Y-m-d H:i:s", $mktDateSystem - (7 * 24 * 60 * 60));
|
||||
}
|
||||
|
||||
$oSpool = new spoolRun();
|
||||
$oSpool = new SpoolRun();
|
||||
$oSpool->resendEmails($dateResend, 1);
|
||||
|
||||
saveLog("resendEmails", "action", "Resending Emails", "c");
|
||||
|
||||
@@ -5503,7 +5503,7 @@ class Cases
|
||||
}
|
||||
|
||||
if ($sTo != null) {
|
||||
$oSpool = new spoolRun();
|
||||
$oSpool = new SpoolRun();
|
||||
|
||||
$oSpool->setConfig($dataLastEmail['configuration']);
|
||||
$oSpool->create(array(
|
||||
|
||||
@@ -99,7 +99,7 @@ class EnterpriseClass extends PMPlugin
|
||||
|
||||
public function enterpriseLimitCreateUser()
|
||||
{
|
||||
$oServerConf = &serverConf::getSingleton();
|
||||
$oServerConf = &ServerConf::getSingleton();
|
||||
$infoLicense =$oServerConf->getProperty('LICENSE_INFO');
|
||||
if (isset($infoLicense[SYS_SYS]['LIMIT_USERS'])) {
|
||||
$criteria = new Criteria('workflow');
|
||||
|
||||
@@ -12,18 +12,13 @@
|
||||
* only if this copyright statement is not removed
|
||||
*--------------------------------------------------*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
|
||||
/**
|
||||
* This class is derived of the class archive, is employed to use archives .
|
||||
* gzip
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*
|
||||
*/class gzip_file extends TarFile
|
||||
*/
|
||||
class GzipFile extends TarFile
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -32,9 +27,9 @@
|
||||
* @param string $name
|
||||
* @return void
|
||||
*/
|
||||
public function gzip_file ($name)
|
||||
public function gzip_file($name)
|
||||
{
|
||||
$this->tar_file( $name );
|
||||
$this->tar_file($name);
|
||||
$this->options['type'] = "gzip";
|
||||
}
|
||||
|
||||
@@ -44,25 +39,25 @@
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function create_gzip ()
|
||||
public function create_gzip()
|
||||
{
|
||||
if ($this->options['inmemory'] == 0) {
|
||||
$pwd = getcwd();
|
||||
chdir( $this->options['basedir'] );
|
||||
if ($fp = gzopen( $this->options['name'], "wb{$this->options['level']}" )) {
|
||||
fseek( $this->archive, 0 );
|
||||
while ($temp = fread( $this->archive, 1048576 )) {
|
||||
gzwrite( $fp, $temp );
|
||||
chdir($this->options['basedir']);
|
||||
if ($fp = gzopen($this->options['name'], "wb{$this->options['level']}")) {
|
||||
fseek($this->archive, 0);
|
||||
while ($temp = fread($this->archive, 1048576)) {
|
||||
gzwrite($fp, $temp);
|
||||
}
|
||||
gzclose( $fp );
|
||||
chdir( $pwd );
|
||||
gzclose($fp);
|
||||
chdir($pwd);
|
||||
} else {
|
||||
$this->error[] = "Could not open {$this->options['name']} for writing.";
|
||||
chdir( $pwd );
|
||||
chdir($pwd);
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
$this->archive = gzencode( $this->archive, $this->options['level'] );
|
||||
$this->archive = gzencode($this->archive, $this->options['level']);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -72,8 +67,8 @@
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function open_archive ()
|
||||
public function open_archive()
|
||||
{
|
||||
return @gzopen( $this->options['name'], "rb" );
|
||||
return @gzopen($this->options['name'], "rb");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1100,7 +1100,7 @@ class PMPluginRegistry
|
||||
{
|
||||
try {
|
||||
$iPlugins = 0;
|
||||
$oServerConf = & serverConf::getSingleton();
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
$oServerConf->addPlugin( SYS_SYS, $this->_aPluginDetails );
|
||||
foreach ($this->_aPluginDetails as $namespace => $detail) {
|
||||
if (isset( $detail->enabled ) && $detail->enabled) {
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
$this->context = \Bootstrap::getDefaultContextLog();
|
||||
$this->dataSources = array("database", "dataVariable");
|
||||
$this->pathRTLCss = '/lib/pmdynaform/build/css/PMDynaform-rtl.css';
|
||||
$this->serverConf = &serverConf::getSingleton();
|
||||
$this->serverConf = &ServerConf::getSingleton();
|
||||
$this->isRTL = ($this->serverConf->isRtl(SYS_LANG)) ? 'true' : 'false';
|
||||
$this->fields = $fields;
|
||||
$this->propertiesToExclude = array('dataVariable');
|
||||
|
||||
@@ -18,7 +18,7 @@ use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
public function __construct($flagActivatePlugins = true)
|
||||
{
|
||||
$oServerConf = &serverConf::getSingleton();
|
||||
$oServerConf = &ServerConf::getSingleton();
|
||||
$oServerConf->setProperty('LOGIN_NO_WS', true);
|
||||
|
||||
//to do: this files probably needs to be in core, since they are GPL2
|
||||
@@ -380,7 +380,7 @@ use ProcessMaker\Plugins\PluginRegistry;
|
||||
return false;
|
||||
} else {
|
||||
|
||||
$oServerConf = & serverConf::getSingleton ();
|
||||
$oServerConf = & ServerConf::getSingleton ();
|
||||
$oServerConf->setProperty ( 'ACTIVE_LICENSE',array(SYS_SYS => $path));
|
||||
$this->saveDataLicense( $results, $path, $redirect );
|
||||
if ($redirect) {
|
||||
|
||||
@@ -292,7 +292,7 @@ class PmSystem
|
||||
*/
|
||||
public function getUpgradedFilesList ()
|
||||
{
|
||||
$this->sFilesList = new gzip_file( $this->sFilename );
|
||||
$this->sFilesList = new GzipFile( $this->sFilename );
|
||||
$this->sFilesList->set_options( array ('basedir' => dirname( $this->sFilename ),'overwrite' => 1
|
||||
) );
|
||||
$this->sFilesList->extract_files();
|
||||
|
||||
@@ -1,40 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.report.php
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2011 Colosa Inc.
|
||||
*
|
||||
* 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
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* 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.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
* Report - Report
|
||||
*/
|
||||
|
||||
/**
|
||||
* Report - Report
|
||||
/**
|
||||
* Report - Report class
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
* @author Everth S. Berrios Morales
|
||||
* @copyright 2008 COLOSA
|
||||
*/class Report
|
||||
class Report
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -46,34 +15,34 @@
|
||||
* param
|
||||
* @return object
|
||||
*/
|
||||
public function generatedReport1 ()
|
||||
public function generatedReport1()
|
||||
{
|
||||
$this->reportsPatch();
|
||||
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
require_once 'classes/model/Application.php';
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( AppDelegationPeer::PRO_UID );
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(AppDelegationPeer::PRO_UID);
|
||||
$oCriteria->addSelectColumn(ProcessPeer::PRO_TITLE);
|
||||
$oCriteria->addAsColumn( "MIN", "MIN(" . AppDelegationPeer::DEL_DURATION . ")" );
|
||||
$oCriteria->addAsColumn( "MAX", "MAX(" . AppDelegationPeer::DEL_DURATION . ")" );
|
||||
$oCriteria->addAsColumn( "TOTALDUR", "SUM(" . AppDelegationPeer::DEL_DURATION . ")" );
|
||||
$oCriteria->addAsColumn( "PROMEDIO", "AVG(" . AppDelegationPeer::DEL_DURATION . ")" );
|
||||
$oCriteria->addAsColumn("MIN", "MIN(" . AppDelegationPeer::DEL_DURATION . ")");
|
||||
$oCriteria->addAsColumn("MAX", "MAX(" . AppDelegationPeer::DEL_DURATION . ")");
|
||||
$oCriteria->addAsColumn("TOTALDUR", "SUM(" . AppDelegationPeer::DEL_DURATION . ")");
|
||||
$oCriteria->addAsColumn("PROMEDIO", "AVG(" . AppDelegationPeer::DEL_DURATION . ")");
|
||||
$oCriteria->addJoin(AppDelegationPeer::PRO_UID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN);
|
||||
$oCriteria->addGroupByColumn( AppDelegationPeer::PRO_UID );
|
||||
$oCriteria->addGroupByColumn(AppDelegationPeer::PRO_UID);
|
||||
$oCriteria->addGroupByColumn(ProcessPeer::PRO_TITLE);
|
||||
|
||||
$oDataset = AppDelegationPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$aProcess[] = array ('PRO_UID' => 'char','PRO_TITLE' => 'char','CANTCASES' => 'integer','MIN' => 'float','MAX' => 'float','TOTALDUR' => 'float','PROMEDIO' => 'float'
|
||||
$aProcess[] = array('PRO_UID' => 'char', 'PRO_TITLE' => 'char', 'CANTCASES' => 'integer', 'MIN' => 'float', 'MAX' => 'float', 'TOTALDUR' => 'float', 'PROMEDIO' => 'float'
|
||||
);
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( ApplicationPeer::PRO_UID );
|
||||
$oCriteria->add( ApplicationPeer::PRO_UID, $aRow['PRO_UID'] );
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(ApplicationPeer::PRO_UID);
|
||||
$oCriteria->add(ApplicationPeer::PRO_UID, $aRow['PRO_UID']);
|
||||
|
||||
$aProcess[] = array ('PRO_UID' => $aRow['PRO_UID'],'PRO_TITLE' => $aRow['PRO_TITLE'],'CANTCASES' => ApplicationPeer::doCount( $oCriteria ),'MIN' => number_format( $aRow['MIN'], 2 ),'MAX' => number_format( $aRow['MAX'], 2 ),'TOTALDUR' => number_format( $aRow['TOTALDUR'], 2 ),'PROMEDIO' => number_format( $aRow['PROMEDIO'], 2 )
|
||||
$aProcess[] = array('PRO_UID' => $aRow['PRO_UID'], 'PRO_TITLE' => $aRow['PRO_TITLE'], 'CANTCASES' => ApplicationPeer::doCount($oCriteria), 'MIN' => number_format($aRow['MIN'], 2), 'MAX' => number_format($aRow['MAX'], 2), 'TOTALDUR' => number_format($aRow['TOTALDUR'], 2), 'PROMEDIO' => number_format($aRow['PROMEDIO'], 2)
|
||||
);
|
||||
$oDataset->next();
|
||||
}
|
||||
@@ -81,8 +50,8 @@
|
||||
global $_DBArray;
|
||||
$_DBArray['reports'] = $aProcess;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
$oCriteria = new Criteria( 'dbarray' );
|
||||
$oCriteria->setDBArrayTable( 'reports' );
|
||||
$oCriteria = new Criteria('dbarray');
|
||||
$oCriteria->setDBArrayTable('reports');
|
||||
|
||||
return $oCriteria;
|
||||
}
|
||||
@@ -98,59 +67,59 @@
|
||||
* @param string $startedby
|
||||
* @return object
|
||||
*/
|
||||
public function generatedReport1_filter ($from, $to, $startedby)
|
||||
public function generatedReport1_filter($from, $to, $startedby)
|
||||
{
|
||||
$this->reportsPatch();
|
||||
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
require_once 'classes/model/Application.php';
|
||||
require_once 'classes/model/Users.php';
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$del = DBAdapter::getStringDelimiter();
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_UID );
|
||||
$oCriteria->addSelectColumn( AppDelegationPeer::PRO_UID );
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
|
||||
$oCriteria->addSelectColumn(AppDelegationPeer::PRO_UID);
|
||||
$oCriteria->addSelectColumn(ProcessPeer::PRO_TITLE);
|
||||
$oCriteria->addAsColumn( "MIN", "MIN(" . AppDelegationPeer::DEL_DURATION . ")" );
|
||||
$oCriteria->addAsColumn( "MAX", "MAX(" . AppDelegationPeer::DEL_DURATION . ")" );
|
||||
$oCriteria->addAsColumn( "TOTALDUR", "SUM(" . AppDelegationPeer::DEL_DURATION . ")" );
|
||||
$oCriteria->addAsColumn( "PROMEDIO", "AVG(" . AppDelegationPeer::DEL_DURATION . ")" );
|
||||
$oCriteria->addJoin (AppDelegationPeer::PRO_UID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN);
|
||||
$oCriteria->addJoin( AppDelegationPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN );
|
||||
$oCriteria->addAsColumn("MIN", "MIN(" . AppDelegationPeer::DEL_DURATION . ")");
|
||||
$oCriteria->addAsColumn("MAX", "MAX(" . AppDelegationPeer::DEL_DURATION . ")");
|
||||
$oCriteria->addAsColumn("TOTALDUR", "SUM(" . AppDelegationPeer::DEL_DURATION . ")");
|
||||
$oCriteria->addAsColumn("PROMEDIO", "AVG(" . AppDelegationPeer::DEL_DURATION . ")");
|
||||
$oCriteria->addJoin(AppDelegationPeer::PRO_UID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN);
|
||||
$oCriteria->addJoin(AppDelegationPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
|
||||
//$oCriteria->add(AppDelegationPeer::DEL_DURATION, $from, Criteria::GREATER_EQUAL);
|
||||
//$oCriteria->add(AppDelegationPeer::DEL_DURATION, $to, Criteria::LESS_EQUAL);
|
||||
//$aAux1 = explode('-', $from); date('Y-m-d H:i:s', mktime(0, 0, 0, $aAux1[1], $aAux1[2], $aAux1[0]))
|
||||
$oCriteria->add( $oCriteria->getNewCriterion( AppDelegationPeer::DEL_INIT_DATE, $from . ' 00:00:00', Criteria::GREATER_EQUAL )->addAnd( $oCriteria->getNewCriterion( AppDelegationPeer::DEL_INIT_DATE, $to . ' 23:59:59', Criteria::LESS_EQUAL ) ) );
|
||||
$oCriteria->add($oCriteria->getNewCriterion(AppDelegationPeer::DEL_INIT_DATE, $from . ' 00:00:00', Criteria::GREATER_EQUAL)->addAnd($oCriteria->getNewCriterion(AppDelegationPeer::DEL_INIT_DATE, $to . ' 23:59:59', Criteria::LESS_EQUAL)));
|
||||
|
||||
if ($startedby != '') {
|
||||
$oCriteria->add( ApplicationPeer::APP_INIT_USER, $startedby );
|
||||
$oCriteria->add(ApplicationPeer::APP_INIT_USER, $startedby);
|
||||
}
|
||||
|
||||
$oCriteria->addGroupByColumn( AppDelegationPeer::PRO_UID );
|
||||
$oCriteria->addGroupByColumn(AppDelegationPeer::PRO_UID);
|
||||
$oCriteria->addGroupByColumn(ProcessPeer::PRO_TITLE);
|
||||
|
||||
$oDataset = AppDelegationPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
|
||||
$aProcess[] = array ('PRO_UID' => 'char','PRO_TITLE' => 'char','CANTCASES' => 'integer','MIN' => 'float','MAX' => 'float','TOTALDUR' => 'float','PROMEDIO' => 'float'
|
||||
$aProcess[] = array('PRO_UID' => 'char', 'PRO_TITLE' => 'char', 'CANTCASES' => 'integer', 'MIN' => 'float', 'MAX' => 'float', 'TOTALDUR' => 'float', 'PROMEDIO' => 'float'
|
||||
);
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( ApplicationPeer::PRO_UID );
|
||||
$oCriteria->add( ApplicationPeer::PRO_UID, $aRow['PRO_UID'] );
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(ApplicationPeer::PRO_UID);
|
||||
$oCriteria->add(ApplicationPeer::PRO_UID, $aRow['PRO_UID']);
|
||||
if ($startedby != '') {
|
||||
$oCriteria->add( ApplicationPeer::APP_INIT_USER, $startedby );
|
||||
$oCriteria->add(ApplicationPeer::APP_INIT_USER, $startedby);
|
||||
}
|
||||
|
||||
$aProcess[] = array ('PRO_UID' => $aRow['PRO_UID'],'PRO_TITLE' => $aRow['PRO_TITLE'],'CANTCASES' => ApplicationPeer::doCount( $oCriteria ),'MIN' => number_format( $aRow['MIN'], 2 ),'MAX' => number_format( $aRow['MAX'], 2 ),'TOTALDUR' => number_format( $aRow['TOTALDUR'], 2 ),'PROMEDIO' => number_format( $aRow['PROMEDIO'], 2 ));
|
||||
$aProcess[] = array('PRO_UID' => $aRow['PRO_UID'], 'PRO_TITLE' => $aRow['PRO_TITLE'], 'CANTCASES' => ApplicationPeer::doCount($oCriteria), 'MIN' => number_format($aRow['MIN'], 2), 'MAX' => number_format($aRow['MAX'], 2), 'TOTALDUR' => number_format($aRow['TOTALDUR'], 2), 'PROMEDIO' => number_format($aRow['PROMEDIO'], 2));
|
||||
$oDataset->next();
|
||||
}
|
||||
|
||||
global $_DBArray;
|
||||
$_DBArray['reports'] = $aProcess;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
$oCriteria = new Criteria( 'dbarray' );
|
||||
$oCriteria->setDBArrayTable( 'reports' );
|
||||
$oCriteria = new Criteria('dbarray');
|
||||
$oCriteria->setDBArrayTable('reports');
|
||||
|
||||
return $oCriteria;
|
||||
}
|
||||
@@ -164,7 +133,7 @@
|
||||
* @param string $PRO_UID
|
||||
* @return object
|
||||
*/
|
||||
public function descriptionReport1 ($PRO_UID)
|
||||
public function descriptionReport1($PRO_UID)
|
||||
{
|
||||
$this->reportsPatch();
|
||||
|
||||
@@ -172,29 +141,29 @@
|
||||
require_once 'classes/model/Task.php';
|
||||
require_once 'classes/model/Content.php';
|
||||
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$del = DBAdapter::getStringDelimiter();
|
||||
$oCriteria->addSelectColumn( AppDelegationPeer::PRO_UID );
|
||||
$oCriteria->addSelectColumn( TaskPeer::TAS_TITLE );
|
||||
$oCriteria->addAsColumn( "MIN", "MIN(" . AppDelegationPeer::DEL_DURATION . ")" );
|
||||
$oCriteria->addAsColumn( "MAX", "MAX(" . AppDelegationPeer::DEL_DURATION . ")" );
|
||||
$oCriteria->addAsColumn( "TOTALDUR", "SUM(" . AppDelegationPeer::DEL_DURATION . ")" );
|
||||
$oCriteria->addAsColumn( "PROMEDIO", "AVG(" . AppDelegationPeer::DEL_DURATION . ")" );
|
||||
$oCriteria->addSelectColumn(AppDelegationPeer::PRO_UID);
|
||||
$oCriteria->addSelectColumn(TaskPeer::TAS_TITLE);
|
||||
$oCriteria->addAsColumn("MIN", "MIN(" . AppDelegationPeer::DEL_DURATION . ")");
|
||||
$oCriteria->addAsColumn("MAX", "MAX(" . AppDelegationPeer::DEL_DURATION . ")");
|
||||
$oCriteria->addAsColumn("TOTALDUR", "SUM(" . AppDelegationPeer::DEL_DURATION . ")");
|
||||
$oCriteria->addAsColumn("PROMEDIO", "AVG(" . AppDelegationPeer::DEL_DURATION . ")");
|
||||
|
||||
$oCriteria->addJoin( AppDelegationPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN );
|
||||
$oCriteria->add( AppDelegationPeer::PRO_UID, $PRO_UID );
|
||||
$oCriteria->addJoin(AppDelegationPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN);
|
||||
$oCriteria->add(AppDelegationPeer::PRO_UID, $PRO_UID);
|
||||
|
||||
$oCriteria->addGroupByColumn( AppDelegationPeer::PRO_UID );
|
||||
$oCriteria->addGroupByColumn( TaskPeer::TAS_TITLE );
|
||||
$oCriteria->addGroupByColumn(AppDelegationPeer::PRO_UID);
|
||||
$oCriteria->addGroupByColumn(TaskPeer::TAS_TITLE);
|
||||
|
||||
$oDataset = AppDelegationPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
|
||||
$aProcess[] = array ('TAS_TITLE' => 'char','MIN' => 'float','MAX' => 'float','TOTALDUR' => 'float','PROMEDIO' => 'float'
|
||||
$aProcess[] = array('TAS_TITLE' => 'char', 'MIN' => 'float', 'MAX' => 'float', 'TOTALDUR' => 'float', 'PROMEDIO' => 'float'
|
||||
);
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aProcess[] = array ('TAS_TITLE' => $aRow['TAS_TITLE'],'MIN' => number_format( $aRow['MIN'], 2 ),'MAX' => number_format( $aRow['MAX'], 2 ),'TOTALDUR' => number_format( $aRow['TOTALDUR'], 2 ),'PROMEDIO' => number_format( $aRow['PROMEDIO'], 2 )
|
||||
$aProcess[] = array('TAS_TITLE' => $aRow['TAS_TITLE'], 'MIN' => number_format($aRow['MIN'], 2), 'MAX' => number_format($aRow['MAX'], 2), 'TOTALDUR' => number_format($aRow['TOTALDUR'], 2), 'PROMEDIO' => number_format($aRow['PROMEDIO'], 2)
|
||||
);
|
||||
$oDataset->next();
|
||||
}
|
||||
@@ -202,8 +171,8 @@
|
||||
global $_DBArray;
|
||||
$_DBArray['reports'] = $aProcess;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
$oCriteria = new Criteria( 'dbarray' );
|
||||
$oCriteria->setDBArrayTable( 'reports' );
|
||||
$oCriteria = new Criteria('dbarray');
|
||||
$oCriteria->setDBArrayTable('reports');
|
||||
|
||||
return $oCriteria;
|
||||
}
|
||||
@@ -217,72 +186,72 @@
|
||||
* param
|
||||
* @return object
|
||||
*/
|
||||
public function generatedReport2 ()
|
||||
public function generatedReport2()
|
||||
{
|
||||
$this->reportsPatch();
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
require_once 'classes/model/Application.php';
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$del = DBAdapter::getStringDelimiter();
|
||||
$oCriteria->addSelectColumn( AppDelegationPeer::PRO_UID );
|
||||
$oCriteria->addSelectColumn(AppDelegationPeer::PRO_UID);
|
||||
$oCriteria->addSelectColumn(ProcessPeer::PRO_TITLE);
|
||||
$oCriteria->addAsColumn( "MIN", "MIN(" . AppDelegationPeer::DEL_DURATION . ")" );
|
||||
$oCriteria->addAsColumn( "MAX", "MAX(" . AppDelegationPeer::DEL_DURATION . ")" );
|
||||
$oCriteria->addJoin (AppDelegationPeer::PRO_UID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN);
|
||||
$oCriteria->addGroupByColumn( AppDelegationPeer::PRO_UID );
|
||||
$oCriteria->addAsColumn("MIN", "MIN(" . AppDelegationPeer::DEL_DURATION . ")");
|
||||
$oCriteria->addAsColumn("MAX", "MAX(" . AppDelegationPeer::DEL_DURATION . ")");
|
||||
$oCriteria->addJoin(AppDelegationPeer::PRO_UID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN);
|
||||
$oCriteria->addGroupByColumn(AppDelegationPeer::PRO_UID);
|
||||
|
||||
$oDataset = AppDelegationPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
|
||||
$month = date( 'Y-m-d', mktime( 0, 0, 0, date( "m" ) - 1, date( "d" ), date( "Y" ) ) );
|
||||
$lastmonth = date( 'Y-m-d', mktime( 0, 0, 0, date( "m" ) - 2, date( "d" ), date( "Y" ) ) );
|
||||
$month = date('Y-m-d', mktime(0, 0, 0, date("m") - 1, date("d"), date("Y")));
|
||||
$lastmonth = date('Y-m-d', mktime(0, 0, 0, date("m") - 2, date("d"), date("Y")));
|
||||
|
||||
$day = mktime( 0, 0, 0, date( "m" ), date( "d" ) - 1, date( "Y" ) );
|
||||
$lastday = mktime( 0, 0, 0, date( "m" ), date( "d" ) - 2, date( "Y" ) );
|
||||
$day = mktime(0, 0, 0, date("m"), date("d") - 1, date("Y"));
|
||||
$lastday = mktime(0, 0, 0, date("m"), date("d") - 2, date("Y"));
|
||||
|
||||
$aProcess[] = array ('PRO_UID' => 'char','PRO_TITLE' => 'char','CANTCASES' => 'integer','MIN' => 'float','MAX' => 'float','CASELASTMONTH' => 'integer','CASELASTDAY' => 'integer'
|
||||
$aProcess[] = array('PRO_UID' => 'char', 'PRO_TITLE' => 'char', 'CANTCASES' => 'integer', 'MIN' => 'float', 'MAX' => 'float', 'CASELASTMONTH' => 'integer', 'CASELASTDAY' => 'integer'
|
||||
);
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$oCriteria2 = new Criteria( 'workflow' );
|
||||
$oCriteria2->addSelectColumn( ApplicationPeer::PRO_UID );
|
||||
$oCriteria2->addAsColumn( "CANTCASES", "COUNT(*)" );
|
||||
$oCriteria2->add( ApplicationPeer::PRO_UID, $aRow['PRO_UID'] );
|
||||
$oCriteria2->addGroupByColumn( ApplicationPeer::PRO_UID );
|
||||
$oDataset2 = AppDelegationPeer::doSelectRS( $oCriteria2 );
|
||||
$oDataset2->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oCriteria2 = new Criteria('workflow');
|
||||
$oCriteria2->addSelectColumn(ApplicationPeer::PRO_UID);
|
||||
$oCriteria2->addAsColumn("CANTCASES", "COUNT(*)");
|
||||
$oCriteria2->add(ApplicationPeer::PRO_UID, $aRow['PRO_UID']);
|
||||
$oCriteria2->addGroupByColumn(ApplicationPeer::PRO_UID);
|
||||
$oDataset2 = AppDelegationPeer::doSelectRS($oCriteria2);
|
||||
$oDataset2->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset2->next();
|
||||
$aRow2 = $oDataset2->getRow();
|
||||
$cant = $aRow2['CANTCASES'];
|
||||
|
||||
$oCriteria2 = new Criteria( 'workflow' );
|
||||
$oCriteria2->addSelectColumn( ApplicationPeer::PRO_UID );
|
||||
$oCriteria2->addAsColumn( "CANTCASES", "COUNT(*)" );
|
||||
$oCriteria2->add( ApplicationPeer::PRO_UID, $aRow['PRO_UID'] );
|
||||
$oCriteria2->add( ApplicationPeer::APP_INIT_DATE, $lastmonth, Criteria::GREATER_EQUAL );
|
||||
$oCriteria2->add( ApplicationPeer::APP_INIT_DATE, $month, Criteria::LESS_EQUAL );
|
||||
$oCriteria2->addGroupByColumn( ApplicationPeer::PRO_UID );
|
||||
$oDataset2 = AppDelegationPeer::doSelectRS( $oCriteria2 );
|
||||
$oDataset2->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oCriteria2 = new Criteria('workflow');
|
||||
$oCriteria2->addSelectColumn(ApplicationPeer::PRO_UID);
|
||||
$oCriteria2->addAsColumn("CANTCASES", "COUNT(*)");
|
||||
$oCriteria2->add(ApplicationPeer::PRO_UID, $aRow['PRO_UID']);
|
||||
$oCriteria2->add(ApplicationPeer::APP_INIT_DATE, $lastmonth, Criteria::GREATER_EQUAL);
|
||||
$oCriteria2->add(ApplicationPeer::APP_INIT_DATE, $month, Criteria::LESS_EQUAL);
|
||||
$oCriteria2->addGroupByColumn(ApplicationPeer::PRO_UID);
|
||||
$oDataset2 = AppDelegationPeer::doSelectRS($oCriteria2);
|
||||
$oDataset2->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset2->next();
|
||||
$aRow2 = $oDataset2->getRow();
|
||||
$cant1 = $aRow2['CANTCASES'];
|
||||
|
||||
$oCriteria2 = new Criteria( 'workflow' );
|
||||
$oCriteria2->addSelectColumn( ApplicationPeer::PRO_UID );
|
||||
$oCriteria2->addAsColumn( "CANTCASES", "COUNT(*)" );
|
||||
$oCriteria2->add( ApplicationPeer::PRO_UID, $aRow['PRO_UID'] );
|
||||
$oCriteria2->add( ApplicationPeer::APP_INIT_DATE, $lastday, Criteria::GREATER_EQUAL );
|
||||
$oCriteria2->add( ApplicationPeer::APP_INIT_DATE, $day, Criteria::LESS_EQUAL );
|
||||
$oCriteria2->addGroupByColumn( ApplicationPeer::PRO_UID );
|
||||
$oDataset2 = AppDelegationPeer::doSelectRS( $oCriteria2 );
|
||||
$oDataset2->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oCriteria2 = new Criteria('workflow');
|
||||
$oCriteria2->addSelectColumn(ApplicationPeer::PRO_UID);
|
||||
$oCriteria2->addAsColumn("CANTCASES", "COUNT(*)");
|
||||
$oCriteria2->add(ApplicationPeer::PRO_UID, $aRow['PRO_UID']);
|
||||
$oCriteria2->add(ApplicationPeer::APP_INIT_DATE, $lastday, Criteria::GREATER_EQUAL);
|
||||
$oCriteria2->add(ApplicationPeer::APP_INIT_DATE, $day, Criteria::LESS_EQUAL);
|
||||
$oCriteria2->addGroupByColumn(ApplicationPeer::PRO_UID);
|
||||
$oDataset2 = AppDelegationPeer::doSelectRS($oCriteria2);
|
||||
$oDataset2->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset2->next();
|
||||
$aRow2 = $oDataset2->getRow();
|
||||
$cant2 = $aRow2['CANTCASES'];
|
||||
|
||||
$aProcess[] = array ('PRO_UID' => $aRow['PRO_UID'],'PRO_TITLE' => $aRow['PRO_TITLE'],'CANTCASES' => $cant,'MIN' => number_format( $aRow['MIN'], 2 ),'MAX' => number_format( $aRow['MAX'], 2 ),'CASELASTMONTH' => number_format( $cant1, 2 ),'CASELASTDAY' => number_format( $cant2, 2 )
|
||||
$aProcess[] = array('PRO_UID' => $aRow['PRO_UID'], 'PRO_TITLE' => $aRow['PRO_TITLE'], 'CANTCASES' => $cant, 'MIN' => number_format($aRow['MIN'], 2), 'MAX' => number_format($aRow['MAX'], 2), 'CASELASTMONTH' => number_format($cant1, 2), 'CASELASTDAY' => number_format($cant2, 2)
|
||||
);
|
||||
$oDataset->next();
|
||||
}
|
||||
@@ -290,8 +259,8 @@
|
||||
global $_DBArray;
|
||||
$_DBArray['reports'] = $aProcess;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
$oCriteria = new Criteria( 'dbarray' );
|
||||
$oCriteria->setDBArrayTable( 'reports' );
|
||||
$oCriteria = new Criteria('dbarray');
|
||||
$oCriteria->setDBArrayTable('reports');
|
||||
return $oCriteria;
|
||||
}
|
||||
|
||||
@@ -307,7 +276,7 @@
|
||||
* @param string $PRO_UID
|
||||
* @return object
|
||||
*/
|
||||
public function reports_Description_filter ($from, $to, $startedby, $PRO_UID)
|
||||
public function reports_Description_filter($from, $to, $startedby, $PRO_UID)
|
||||
{
|
||||
$this->reportsPatch();
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
@@ -315,26 +284,26 @@
|
||||
require_once 'classes/model/Content.php';
|
||||
require_once 'classes/model/Users.php';
|
||||
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$del = DBAdapter::getStringDelimiter();
|
||||
$oCriteria->addSelectColumn( AppDelegationPeer::PRO_UID );
|
||||
$oCriteria->addSelectColumn( TaskPeer::TAS_TITLE );
|
||||
$oCriteria->addAsColumn( "MIN", "MIN(" . AppDelegationPeer::DEL_DURATION . ")" );
|
||||
$oCriteria->addAsColumn( "MAX", "MAX(" . AppDelegationPeer::DEL_DURATION . ")" );
|
||||
$oCriteria->addAsColumn( "TOTALDUR", "SUM(" . AppDelegationPeer::DEL_DURATION . ")" );
|
||||
$oCriteria->addAsColumn( "PROMEDIO", "AVG(" . AppDelegationPeer::DEL_DURATION . ")" );
|
||||
$oCriteria->addSelectColumn(AppDelegationPeer::PRO_UID);
|
||||
$oCriteria->addSelectColumn(TaskPeer::TAS_TITLE);
|
||||
$oCriteria->addAsColumn("MIN", "MIN(" . AppDelegationPeer::DEL_DURATION . ")");
|
||||
$oCriteria->addAsColumn("MAX", "MAX(" . AppDelegationPeer::DEL_DURATION . ")");
|
||||
$oCriteria->addAsColumn("TOTALDUR", "SUM(" . AppDelegationPeer::DEL_DURATION . ")");
|
||||
$oCriteria->addAsColumn("PROMEDIO", "AVG(" . AppDelegationPeer::DEL_DURATION . ")");
|
||||
|
||||
$oCriteria->addJoin( AppDelegationPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN );
|
||||
$oCriteria->add( $oCriteria->getNewCriterion( AppDelegationPeer::DEL_INIT_DATE, $from . ' 00:00:00', Criteria::GREATER_EQUAL )->addAnd( $oCriteria->getNewCriterion( AppDelegationPeer::DEL_INIT_DATE, $to . ' 23:59:59', Criteria::LESS_EQUAL ) ) );
|
||||
$oCriteria->addJoin(AppDelegationPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN);
|
||||
$oCriteria->add($oCriteria->getNewCriterion(AppDelegationPeer::DEL_INIT_DATE, $from . ' 00:00:00', Criteria::GREATER_EQUAL)->addAnd($oCriteria->getNewCriterion(AppDelegationPeer::DEL_INIT_DATE, $to . ' 23:59:59', Criteria::LESS_EQUAL)));
|
||||
|
||||
if ($startedby != '') {
|
||||
$oCriteria->add( AppDelegationPeer::USR_UID, $startedby );
|
||||
$oCriteria->add(AppDelegationPeer::USR_UID, $startedby);
|
||||
}
|
||||
|
||||
$oCriteria->add( AppDelegationPeer::PRO_UID, $PRO_UID );
|
||||
$oCriteria->add(AppDelegationPeer::PRO_UID, $PRO_UID);
|
||||
|
||||
$oCriteria->addGroupByColumn( AppDelegationPeer::PRO_UID );
|
||||
$oCriteria->addGroupByColumn( TaskPeer::TAS_TITLE );
|
||||
$oCriteria->addGroupByColumn(AppDelegationPeer::PRO_UID);
|
||||
$oCriteria->addGroupByColumn(TaskPeer::TAS_TITLE);
|
||||
|
||||
return $oCriteria;
|
||||
}
|
||||
@@ -350,82 +319,82 @@
|
||||
* @param string $startedby
|
||||
* @return object
|
||||
*/
|
||||
public function generatedReport2_filter ($from, $to, $startedby)
|
||||
public function generatedReport2_filter($from, $to, $startedby)
|
||||
{
|
||||
$this->reportsPatch();
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
require_once 'classes/model/Application.php';
|
||||
require_once 'classes/model/Users.php';
|
||||
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$del = DBAdapter::getStringDelimiter();
|
||||
$oCriteria->addSelectColumn( AppDelegationPeer::PRO_UID );
|
||||
$oCriteria->addSelectColumn(AppDelegationPeer::PRO_UID);
|
||||
$oCriteria->addSelectColumn(ProcessPeer::PRO_TITLE);
|
||||
$oCriteria->addAsColumn( "MIN", "MIN(" . AppDelegationPeer::DEL_DURATION . ")" );
|
||||
$oCriteria->addAsColumn( "MAX", "MAX(" . AppDelegationPeer::DEL_DURATION . ")" );
|
||||
$oCriteria->addAsColumn("MIN", "MIN(" . AppDelegationPeer::DEL_DURATION . ")");
|
||||
$oCriteria->addAsColumn("MAX", "MAX(" . AppDelegationPeer::DEL_DURATION . ")");
|
||||
$oCriteria->addJoin(AppDelegationPeer::PRO_UID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN);
|
||||
$oCriteria->addGroupByColumn( AppDelegationPeer::PRO_UID );
|
||||
$oCriteria->addGroupByColumn(AppDelegationPeer::PRO_UID);
|
||||
$oCriteria->addGroupByColumn(ProcessPeer::PRO_TITLE);
|
||||
|
||||
$oCriteria->add( $oCriteria->getNewCriterion( AppDelegationPeer::DEL_INIT_DATE, $from . ' 00:00:00', Criteria::GREATER_EQUAL )->addAnd( $oCriteria->getNewCriterion( AppDelegationPeer::DEL_INIT_DATE, $to . ' 23:59:59', Criteria::LESS_EQUAL ) ) );
|
||||
$oCriteria->add($oCriteria->getNewCriterion(AppDelegationPeer::DEL_INIT_DATE, $from . ' 00:00:00', Criteria::GREATER_EQUAL)->addAnd($oCriteria->getNewCriterion(AppDelegationPeer::DEL_INIT_DATE, $to . ' 23:59:59', Criteria::LESS_EQUAL)));
|
||||
|
||||
if ($startedby != '') {
|
||||
$oCriteria->add( AppDelegationPeer::USR_UID, $startedby );
|
||||
$oCriteria->add(AppDelegationPeer::USR_UID, $startedby);
|
||||
}
|
||||
|
||||
$oDataset = AppDelegationPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
|
||||
$month = date( 'Y-m-d', mktime( 0, 0, 0, date( "m" ) - 1, date( "d" ), date( "Y" ) ) );
|
||||
$lastmonth = date( 'Y-m-d', mktime( 0, 0, 0, date( "m" ) - 2, date( "d" ), date( "Y" ) ) );
|
||||
$day = mktime( 0, 0, 0, date( "m" ), date( "d" ) - 1, date( "Y" ) );
|
||||
$lastday = mktime( 0, 0, 0, date( "m" ), date( "d" ) - 2, date( "Y" ) );
|
||||
$aProcess[] = array ('PRO_UID' => 'char','PRO_TITLE' => 'char','CANTCASES' => 'integer','MIN' => 'float','MAX' => 'float','CASELASTMONTH' => 'integer','CASELASTDAY' => 'integer');
|
||||
$month = date('Y-m-d', mktime(0, 0, 0, date("m") - 1, date("d"), date("Y")));
|
||||
$lastmonth = date('Y-m-d', mktime(0, 0, 0, date("m") - 2, date("d"), date("Y")));
|
||||
$day = mktime(0, 0, 0, date("m"), date("d") - 1, date("Y"));
|
||||
$lastday = mktime(0, 0, 0, date("m"), date("d") - 2, date("Y"));
|
||||
$aProcess[] = array('PRO_UID' => 'char', 'PRO_TITLE' => 'char', 'CANTCASES' => 'integer', 'MIN' => 'float', 'MAX' => 'float', 'CASELASTMONTH' => 'integer', 'CASELASTDAY' => 'integer');
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$oCriteria2 = new Criteria( 'workflow' );
|
||||
$oCriteria2->addSelectColumn( ApplicationPeer::PRO_UID );
|
||||
$oCriteria2->addAsColumn( "CANTCASES", "COUNT(*)" );
|
||||
$oCriteria2->add( ApplicationPeer::PRO_UID, $aRow['PRO_UID'] );
|
||||
$oCriteria2 = new Criteria('workflow');
|
||||
$oCriteria2->addSelectColumn(ApplicationPeer::PRO_UID);
|
||||
$oCriteria2->addAsColumn("CANTCASES", "COUNT(*)");
|
||||
$oCriteria2->add(ApplicationPeer::PRO_UID, $aRow['PRO_UID']);
|
||||
if ($startedby != '') {
|
||||
$oCriteria2->add( ApplicationPeer::APP_INIT_USER, $startedby );
|
||||
$oCriteria2->add(ApplicationPeer::APP_INIT_USER, $startedby);
|
||||
}
|
||||
$oCriteria2->addGroupByColumn( ApplicationPeer::PRO_UID );
|
||||
$oDataset2 = AppDelegationPeer::doSelectRS( $oCriteria2 );
|
||||
$oDataset2->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oCriteria2->addGroupByColumn(ApplicationPeer::PRO_UID);
|
||||
$oDataset2 = AppDelegationPeer::doSelectRS($oCriteria2);
|
||||
$oDataset2->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset2->next();
|
||||
$aRow2 = $oDataset2->getRow();
|
||||
$cant = $aRow2['CANTCASES'];
|
||||
|
||||
$oCriteria2 = new Criteria( 'workflow' );
|
||||
$oCriteria2->addSelectColumn( ApplicationPeer::PRO_UID );
|
||||
$oCriteria2->addAsColumn( "CANTCASES", "COUNT(*)" );
|
||||
$oCriteria2->add( ApplicationPeer::PRO_UID, $aRow['PRO_UID'] );
|
||||
$oCriteria2->add( ApplicationPeer::APP_INIT_DATE, $lastmonth, Criteria::GREATER_EQUAL );
|
||||
$oCriteria2->add( ApplicationPeer::APP_INIT_DATE, $month, Criteria::LESS_EQUAL );
|
||||
$oCriteria2 = new Criteria('workflow');
|
||||
$oCriteria2->addSelectColumn(ApplicationPeer::PRO_UID);
|
||||
$oCriteria2->addAsColumn("CANTCASES", "COUNT(*)");
|
||||
$oCriteria2->add(ApplicationPeer::PRO_UID, $aRow['PRO_UID']);
|
||||
$oCriteria2->add(ApplicationPeer::APP_INIT_DATE, $lastmonth, Criteria::GREATER_EQUAL);
|
||||
$oCriteria2->add(ApplicationPeer::APP_INIT_DATE, $month, Criteria::LESS_EQUAL);
|
||||
if ($startedby != '') {
|
||||
$oCriteria2->add( ApplicationPeer::APP_INIT_USER, $startedby );
|
||||
$oCriteria2->add(ApplicationPeer::APP_INIT_USER, $startedby);
|
||||
}
|
||||
$oCriteria2->addGroupByColumn( ApplicationPeer::PRO_UID );
|
||||
$oDataset2 = AppDelegationPeer::doSelectRS( $oCriteria2 );
|
||||
$oDataset2->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oCriteria2->addGroupByColumn(ApplicationPeer::PRO_UID);
|
||||
$oDataset2 = AppDelegationPeer::doSelectRS($oCriteria2);
|
||||
$oDataset2->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset2->next();
|
||||
$aRow2 = $oDataset2->getRow();
|
||||
$cant1 = $aRow2['CANTCASES'];
|
||||
|
||||
$oCriteria2 = new Criteria( 'workflow' );
|
||||
$oCriteria2->addSelectColumn( ApplicationPeer::PRO_UID );
|
||||
$oCriteria2->addAsColumn( "CANTCASES", "COUNT(*)" );
|
||||
$oCriteria2->add( ApplicationPeer::PRO_UID, $aRow['PRO_UID'] );
|
||||
$oCriteria2->add( ApplicationPeer::APP_INIT_DATE, $lastday, Criteria::GREATER_EQUAL );
|
||||
$oCriteria2->add( ApplicationPeer::APP_INIT_DATE, $day, Criteria::LESS_EQUAL );
|
||||
$oCriteria2 = new Criteria('workflow');
|
||||
$oCriteria2->addSelectColumn(ApplicationPeer::PRO_UID);
|
||||
$oCriteria2->addAsColumn("CANTCASES", "COUNT(*)");
|
||||
$oCriteria2->add(ApplicationPeer::PRO_UID, $aRow['PRO_UID']);
|
||||
$oCriteria2->add(ApplicationPeer::APP_INIT_DATE, $lastday, Criteria::GREATER_EQUAL);
|
||||
$oCriteria2->add(ApplicationPeer::APP_INIT_DATE, $day, Criteria::LESS_EQUAL);
|
||||
if ($startedby != '') {
|
||||
$oCriteria2->add( ApplicationPeer::APP_INIT_USER, $startedby );
|
||||
$oCriteria2->add(ApplicationPeer::APP_INIT_USER, $startedby);
|
||||
}
|
||||
$oCriteria2->addGroupByColumn( ApplicationPeer::PRO_UID );
|
||||
$oDataset2 = AppDelegationPeer::doSelectRS( $oCriteria2 );
|
||||
$oDataset2->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oCriteria2->addGroupByColumn(ApplicationPeer::PRO_UID);
|
||||
$oDataset2 = AppDelegationPeer::doSelectRS($oCriteria2);
|
||||
$oDataset2->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset2->next();
|
||||
$aRow2 = $oDataset2->getRow();
|
||||
$cant2 = $aRow2['CANTCASES'];
|
||||
@@ -436,15 +405,15 @@
|
||||
'CASELASTMONTH' => $cant1,
|
||||
'CASELASTDAY' => $cant2
|
||||
);*/
|
||||
$aProcess[] = array ('PRO_UID' => $aRow['PRO_UID'],'PRO_TITLE' => $aRow['PRO_TITLE'],'CANTCASES' => $cant,'MIN' => number_format( $aRow['MIN'], 2 ),'MAX' => number_format( $aRow['MAX'], 2 ),'CASELASTMONTH' => number_format( $cant1, 2 ),'CASELASTDAY' => number_format( $cant2, 2 ));
|
||||
$aProcess[] = array('PRO_UID' => $aRow['PRO_UID'], 'PRO_TITLE' => $aRow['PRO_TITLE'], 'CANTCASES' => $cant, 'MIN' => number_format($aRow['MIN'], 2), 'MAX' => number_format($aRow['MAX'], 2), 'CASELASTMONTH' => number_format($cant1, 2), 'CASELASTDAY' => number_format($cant2, 2));
|
||||
$oDataset->next();
|
||||
}
|
||||
|
||||
global $_DBArray;
|
||||
$_DBArray['reports'] = $aProcess;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
$oCriteria = new Criteria( 'dbarray' );
|
||||
$oCriteria->setDBArrayTable( 'reports' );
|
||||
$oCriteria = new Criteria('dbarray');
|
||||
$oCriteria->setDBArrayTable('reports');
|
||||
return $oCriteria;
|
||||
}
|
||||
|
||||
@@ -459,12 +428,12 @@
|
||||
* @param string $startedby
|
||||
* @return object
|
||||
*/
|
||||
public function generatedReport3 ()
|
||||
public function generatedReport3()
|
||||
{
|
||||
$this->reportsPatch();
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
require_once 'classes/model/Application.php';
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$del = DBAdapter::getStringDelimiter();
|
||||
$sql = "SELECT CONCAT(SUBSTRING(AD.DEL_INIT_DATE,6,2),'-', SUBSTRING(AD.DEL_INIT_DATE,1,4)) AS FECHA,
|
||||
COUNT(DISTINCT(AD.APP_UID)) AS CANTCASES,
|
||||
@@ -477,21 +446,21 @@
|
||||
WHERE AD.APP_UID<>'' AND P.PRO_STATUS<>'DISABLED'
|
||||
GROUP BY FECHA";
|
||||
|
||||
$con = Propel::getConnection( "workflow" );
|
||||
$stmt = $con->prepareStatement( $sql );
|
||||
$con = Propel::getConnection("workflow");
|
||||
$stmt = $con->prepareStatement($sql);
|
||||
$rs = $stmt->executeQuery();
|
||||
|
||||
$ROW[] = array ('FECHA' => 'char','CANTCASES' => 'integer','MIN' => 'float','MAX' => 'float','TOTALDUR' => 'float','PROMEDIO' => 'float');
|
||||
$ROW[] = array('FECHA' => 'char', 'CANTCASES' => 'integer', 'MIN' => 'float', 'MAX' => 'float', 'TOTALDUR' => 'float', 'PROMEDIO' => 'float');
|
||||
|
||||
while ($rs->next()) {
|
||||
$ROW[] = array ('FECHA' => $rs->getString( 'FECHA' ),'CANTCASES' => $rs->getString( 'CANTCASES' ),'MIN' => number_format( $rs->getString( 'MIN' ), 2 ),'MAX' => number_format( $rs->getString( 'MAX' ), 2 ),'TOTALDUR' => number_format( $rs->getString( 'TOTALDUR' ), 2 ),'PROMEDIO' => number_format( $rs->getString( 'PROMEDIO' ), 2 ));
|
||||
$ROW[] = array('FECHA' => $rs->getString('FECHA'), 'CANTCASES' => $rs->getString('CANTCASES'), 'MIN' => number_format($rs->getString('MIN'), 2), 'MAX' => number_format($rs->getString('MAX'), 2), 'TOTALDUR' => number_format($rs->getString('TOTALDUR'), 2), 'PROMEDIO' => number_format($rs->getString('PROMEDIO'), 2));
|
||||
}
|
||||
|
||||
global $_DBArray;
|
||||
$_DBArray['reports'] = $ROW;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
$oCriteria = new Criteria( 'dbarray' );
|
||||
$oCriteria->setDBArrayTable( 'reports' );
|
||||
$oCriteria = new Criteria('dbarray');
|
||||
$oCriteria->setDBArrayTable('reports');
|
||||
|
||||
return $oCriteria;
|
||||
|
||||
@@ -507,12 +476,12 @@
|
||||
* @param string $task
|
||||
* @return object
|
||||
*/
|
||||
public function generatedReport3_filter ($process, $task)
|
||||
public function generatedReport3_filter($process, $task)
|
||||
{
|
||||
$this->reportsPatch();
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
require_once 'classes/model/Application.php';
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$del = DBAdapter::getStringDelimiter();
|
||||
if ($process == '') {
|
||||
$var = " WHERE P.PRO_STATUS<>'DISABLED'";
|
||||
@@ -536,20 +505,20 @@
|
||||
" . $var . "
|
||||
GROUP BY FECHA";
|
||||
|
||||
$con = Propel::getConnection( "workflow" );
|
||||
$stmt = $con->prepareStatement( $sql );
|
||||
$con = Propel::getConnection("workflow");
|
||||
$stmt = $con->prepareStatement($sql);
|
||||
$rs = $stmt->executeQuery();
|
||||
$ROW[] = array ('FECHA' => 'char','CANTCASES' => 'integer','MIN' => 'float','MAX' => 'float','TOTALDUR' => 'float','PROMEDIO' => 'float');
|
||||
$ROW[] = array('FECHA' => 'char', 'CANTCASES' => 'integer', 'MIN' => 'float', 'MAX' => 'float', 'TOTALDUR' => 'float', 'PROMEDIO' => 'float');
|
||||
|
||||
while ($rs->next()) {
|
||||
$ROW[] = array ('FECHA' => $rs->getString( 'FECHA' ),'CANTCASES' => $rs->getString( 'CANTCASES' ),'MIN' => number_format( $rs->getString( 'MIN' ), 2 ),'MAX' => number_format( $rs->getString( 'MAX' ), 2 ),'TOTALDUR' => number_format( $rs->getString( 'TOTALDUR' ), 2 ),'PROMEDIO' => number_format( $rs->getString( 'PROMEDIO' ), 2 ));
|
||||
$ROW[] = array('FECHA' => $rs->getString('FECHA'), 'CANTCASES' => $rs->getString('CANTCASES'), 'MIN' => number_format($rs->getString('MIN'), 2), 'MAX' => number_format($rs->getString('MAX'), 2), 'TOTALDUR' => number_format($rs->getString('TOTALDUR'), 2), 'PROMEDIO' => number_format($rs->getString('PROMEDIO'), 2));
|
||||
}
|
||||
|
||||
global $_DBArray;
|
||||
$_DBArray['reports'] = $ROW;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
$oCriteria = new Criteria( 'dbarray' );
|
||||
$oCriteria->setDBArrayTable( 'reports' );
|
||||
$oCriteria = new Criteria('dbarray');
|
||||
$oCriteria->setDBArrayTable('reports');
|
||||
|
||||
return $oCriteria;
|
||||
}
|
||||
@@ -563,14 +532,14 @@
|
||||
* param
|
||||
* @return object
|
||||
*/
|
||||
public function generatedReport4 ()
|
||||
public function generatedReport4()
|
||||
{
|
||||
$this->reportsPatch();
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
require_once 'classes/model/Application.php';
|
||||
require_once 'classes/model/Process.php';
|
||||
require_once 'classes/model/Users.php';
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$del = DBAdapter::getStringDelimiter();
|
||||
$sql = "SELECT CONCAT(U.USR_LASTNAME,' ',USR_FIRSTNAME) AS USER,
|
||||
COUNT(*) AS CANTCASES,
|
||||
@@ -584,23 +553,23 @@
|
||||
WHERE A.APP_UID<>''
|
||||
GROUP BY USER";
|
||||
// AND P.PRO_STATUS<>'DISABLED' that hapens when it is created to new version it exists at the moment to import
|
||||
$con = Propel::getConnection( "workflow" );
|
||||
$stmt = $con->prepareStatement( $sql );
|
||||
$con = Propel::getConnection("workflow");
|
||||
$stmt = $con->prepareStatement($sql);
|
||||
$rs = $stmt->executeQuery();
|
||||
|
||||
$ROW[] = array ('USER' => 'char','CANTCASES' => 'integer','MIN' => 'float','MAX' => 'float','TOTALDUR' => 'float','PROMEDIO' => 'float'
|
||||
$ROW[] = array('USER' => 'char', 'CANTCASES' => 'integer', 'MIN' => 'float', 'MAX' => 'float', 'TOTALDUR' => 'float', 'PROMEDIO' => 'float'
|
||||
);
|
||||
|
||||
while ($rs->next()) {
|
||||
$ROW[] = array ('USER' => $rs->getString( 'USER' ),'CANTCASES' => $rs->getString( 'CANTCASES' ),'MIN' => number_format( $rs->getString( 'MIN' ), 2 ),'MAX' => number_format( $rs->getString( 'MAX' ), 2 ),'TOTALDUR' => number_format( $rs->getString( 'TOTALDUR' ), 2 ),'PROMEDIO' => number_format( $rs->getString( 'PROMEDIO' ), 2 )
|
||||
$ROW[] = array('USER' => $rs->getString('USER'), 'CANTCASES' => $rs->getString('CANTCASES'), 'MIN' => number_format($rs->getString('MIN'), 2), 'MAX' => number_format($rs->getString('MAX'), 2), 'TOTALDUR' => number_format($rs->getString('TOTALDUR'), 2), 'PROMEDIO' => number_format($rs->getString('PROMEDIO'), 2)
|
||||
);
|
||||
}
|
||||
|
||||
global $_DBArray;
|
||||
$_DBArray['reports'] = $ROW;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
$oCriteria = new Criteria( 'dbarray' );
|
||||
$oCriteria->setDBArrayTable( 'reports' );
|
||||
$oCriteria = new Criteria('dbarray');
|
||||
$oCriteria->setDBArrayTable('reports');
|
||||
|
||||
return $oCriteria;
|
||||
|
||||
@@ -616,14 +585,14 @@
|
||||
* @param string task
|
||||
* @return object
|
||||
*/
|
||||
public function generatedReport4_filter ($process, $task)
|
||||
public function generatedReport4_filter($process, $task)
|
||||
{
|
||||
$this->reportsPatch();
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
require_once 'classes/model/Application.php';
|
||||
require_once 'classes/model/Process.php';
|
||||
require_once 'classes/model/Users.php';
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$del = DBAdapter::getStringDelimiter();
|
||||
if ($process == '') {
|
||||
$var = " ";
|
||||
@@ -649,23 +618,23 @@
|
||||
" . $var . "
|
||||
GROUP BY USER";
|
||||
|
||||
$con = Propel::getConnection( "workflow" );
|
||||
$stmt = $con->prepareStatement( $sql );
|
||||
$con = Propel::getConnection("workflow");
|
||||
$stmt = $con->prepareStatement($sql);
|
||||
$rs = $stmt->executeQuery();
|
||||
|
||||
$ROW[] = array ('USER' => 'char','CANTCASES' => 'integer','MIN' => 'float','MAX' => 'float','TOTALDUR' => 'float','PROMEDIO' => 'float'
|
||||
$ROW[] = array('USER' => 'char', 'CANTCASES' => 'integer', 'MIN' => 'float', 'MAX' => 'float', 'TOTALDUR' => 'float', 'PROMEDIO' => 'float'
|
||||
);
|
||||
|
||||
while ($rs->next()) {
|
||||
$ROW[] = array ('USER' => $rs->getString( 'USER' ),'CANTCASES' => $rs->getString( 'CANTCASES' ),'MIN' => number_format( $rs->getString( 'MIN' ), 2 ),'MAX' => number_format( $rs->getString( 'MAX' ), 2 ),'TOTALDUR' => number_format( $rs->getString( 'TOTALDUR' ), 2 ),'PROMEDIO' => number_format( $rs->getString( 'PROMEDIO' ), 2 )
|
||||
$ROW[] = array('USER' => $rs->getString('USER'), 'CANTCASES' => $rs->getString('CANTCASES'), 'MIN' => number_format($rs->getString('MIN'), 2), 'MAX' => number_format($rs->getString('MAX'), 2), 'TOTALDUR' => number_format($rs->getString('TOTALDUR'), 2), 'PROMEDIO' => number_format($rs->getString('PROMEDIO'), 2)
|
||||
);
|
||||
}
|
||||
|
||||
global $_DBArray;
|
||||
$_DBArray['reports'] = $ROW;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
$oCriteria = new Criteria( 'dbarray' );
|
||||
$oCriteria->setDBArrayTable( 'reports' );
|
||||
$oCriteria = new Criteria('dbarray');
|
||||
$oCriteria->setDBArrayTable('reports');
|
||||
|
||||
return $oCriteria;
|
||||
}
|
||||
@@ -680,14 +649,14 @@
|
||||
* @param string task
|
||||
* @return object
|
||||
*/
|
||||
public function generatedReport5 ()
|
||||
public function generatedReport5()
|
||||
{
|
||||
$this->reportsPatch();
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
require_once 'classes/model/Application.php';
|
||||
require_once 'classes/model/Process.php';
|
||||
require_once 'classes/model/Users.php';
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$del = DBAdapter::getStringDelimiter();
|
||||
$sql = "SELECT CONCAT(U.USR_LASTNAME,' ',USR_FIRSTNAME) AS USER,
|
||||
COUNT(*) AS CANTCASES,
|
||||
@@ -701,23 +670,23 @@
|
||||
WHERE AD.APP_UID<>'' AND AD.DEL_FINISH_DATE IS NULL
|
||||
GROUP BY USER";
|
||||
|
||||
$con = Propel::getConnection( "workflow" );
|
||||
$stmt = $con->prepareStatement( $sql );
|
||||
$con = Propel::getConnection("workflow");
|
||||
$stmt = $con->prepareStatement($sql);
|
||||
$rs = $stmt->executeQuery();
|
||||
|
||||
$ROW[] = array ('USER' => 'char','CANTCASES' => 'integer','MIN' => 'float','MAX' => 'float','TOTALDUR' => 'float','PROMEDIO' => 'float'
|
||||
$ROW[] = array('USER' => 'char', 'CANTCASES' => 'integer', 'MIN' => 'float', 'MAX' => 'float', 'TOTALDUR' => 'float', 'PROMEDIO' => 'float'
|
||||
);
|
||||
|
||||
while ($rs->next()) {
|
||||
$ROW[] = array ('USER' => $rs->getString( 'USER' ),'CANTCASES' => $rs->getString( 'CANTCASES' ),'MIN' => number_format( $rs->getString( 'MIN' ), 2 ),'MAX' => number_format( $rs->getString( 'MAX' ), 2 ),'TOTALDUR' => number_format( $rs->getString( 'TOTALDUR' ), 2 ),'PROMEDIO' => number_format( $rs->getString( 'PROMEDIO' ), 2 )
|
||||
$ROW[] = array('USER' => $rs->getString('USER'), 'CANTCASES' => $rs->getString('CANTCASES'), 'MIN' => number_format($rs->getString('MIN'), 2), 'MAX' => number_format($rs->getString('MAX'), 2), 'TOTALDUR' => number_format($rs->getString('TOTALDUR'), 2), 'PROMEDIO' => number_format($rs->getString('PROMEDIO'), 2)
|
||||
);
|
||||
}
|
||||
|
||||
global $_DBArray;
|
||||
$_DBArray['reports'] = $ROW;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
$oCriteria = new Criteria( 'dbarray' );
|
||||
$oCriteria->setDBArrayTable( 'reports' );
|
||||
$oCriteria = new Criteria('dbarray');
|
||||
$oCriteria->setDBArrayTable('reports');
|
||||
|
||||
return $oCriteria;
|
||||
|
||||
@@ -733,14 +702,14 @@
|
||||
* @param string task
|
||||
* @return object
|
||||
*/
|
||||
public function generatedReport5_filter ($process, $task)
|
||||
public function generatedReport5_filter($process, $task)
|
||||
{
|
||||
$this->reportsPatch();
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
require_once 'classes/model/Application.php';
|
||||
require_once 'classes/model/Process.php';
|
||||
require_once 'classes/model/Users.php';
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$del = DBAdapter::getStringDelimiter();
|
||||
if ($process == '') {
|
||||
$var = " WHERE AD.DEL_FINISH_DATE IS NULL";
|
||||
@@ -765,23 +734,23 @@
|
||||
" . $var . "
|
||||
GROUP BY USER";
|
||||
|
||||
$con = Propel::getConnection( "workflow" );
|
||||
$stmt = $con->prepareStatement( $sql );
|
||||
$con = Propel::getConnection("workflow");
|
||||
$stmt = $con->prepareStatement($sql);
|
||||
$rs = $stmt->executeQuery();
|
||||
|
||||
$ROW[] = array ('USER' => 'char','CANTCASES' => 'integer','MIN' => 'float','MAX' => 'float','TOTALDUR' => 'float','PROMEDIO' => 'float'
|
||||
$ROW[] = array('USER' => 'char', 'CANTCASES' => 'integer', 'MIN' => 'float', 'MAX' => 'float', 'TOTALDUR' => 'float', 'PROMEDIO' => 'float'
|
||||
);
|
||||
|
||||
while ($rs->next()) {
|
||||
$ROW[] = array ('USER' => $rs->getString( 'USER' ),'CANTCASES' => $rs->getString( 'CANTCASES' ),'MIN' => number_format( $rs->getString( 'MIN' ), 2 ),'MAX' => number_format( $rs->getString( 'MAX' ), 2 ),'TOTALDUR' => number_format( $rs->getString( 'TOTALDUR' ), 2 ),'PROMEDIO' => number_format( $rs->getString( 'PROMEDIO' ), 2 )
|
||||
$ROW[] = array('USER' => $rs->getString('USER'), 'CANTCASES' => $rs->getString('CANTCASES'), 'MIN' => number_format($rs->getString('MIN'), 2), 'MAX' => number_format($rs->getString('MAX'), 2), 'TOTALDUR' => number_format($rs->getString('TOTALDUR'), 2), 'PROMEDIO' => number_format($rs->getString('PROMEDIO'), 2)
|
||||
);
|
||||
}
|
||||
|
||||
global $_DBArray;
|
||||
$_DBArray['reports'] = $ROW;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
$oCriteria = new Criteria( 'dbarray' );
|
||||
$oCriteria->setDBArrayTable( 'reports' );
|
||||
$oCriteria = new Criteria('dbarray');
|
||||
$oCriteria->setDBArrayTable('reports');
|
||||
|
||||
return $oCriteria;
|
||||
}
|
||||
@@ -795,9 +764,9 @@
|
||||
* param
|
||||
* @return array
|
||||
*/
|
||||
public function getAvailableReports ()
|
||||
public function getAvailableReports()
|
||||
{
|
||||
return array ('ID_REPORT1','ID_REPORT2','ID_REPORT3','ID_REPORT4','ID_REPORT5'
|
||||
return array('ID_REPORT1', 'ID_REPORT2', 'ID_REPORT3', 'ID_REPORT4', 'ID_REPORT5'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -811,21 +780,21 @@
|
||||
* @return void
|
||||
*/
|
||||
|
||||
public function reportsPatch ()
|
||||
public function reportsPatch()
|
||||
{
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$del = DBAdapter::getStringDelimiter();
|
||||
$oCriteria->addSelectColumn( AppDelegationPeer::APP_UID );
|
||||
$oCriteria->addSelectColumn( AppDelegationPeer::DEL_INDEX );
|
||||
$oCriteria->addSelectColumn( AppDelegationPeer::TAS_UID );
|
||||
$oCriteria->addSelectColumn( AppDelegationPeer::DEL_DELEGATE_DATE );
|
||||
$oCriteria->addSelectColumn( AppDelegationPeer::DEL_INIT_DATE );
|
||||
$oCriteria->addSelectColumn( AppDelegationPeer::DEL_FINISH_DATE );
|
||||
$oCriteria->addSelectColumn( AppDelegationPeer::DEL_DURATION );
|
||||
$oDataset = AppDelegationPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oCriteria->addSelectColumn(AppDelegationPeer::APP_UID);
|
||||
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
|
||||
$oCriteria->addSelectColumn(AppDelegationPeer::TAS_UID);
|
||||
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
|
||||
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE);
|
||||
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_FINISH_DATE);
|
||||
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_DURATION);
|
||||
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$oAppDelegation = new AppDelegation();
|
||||
@@ -839,13 +808,13 @@
|
||||
} else {
|
||||
$aData['DEL_INIT_DATE'] = $aRow['DEL_INIT_DATE'];
|
||||
}
|
||||
//$aData['DEL_FINISH_DATE']=$aRow['DEL_FINISH_DATE'];
|
||||
//$aData['DEL_FINISH_DATE']=$aRow['DEL_FINISH_DATE'];
|
||||
if ($aRow['DEL_DURATION'] != 0) {
|
||||
$oDates = new dates();
|
||||
$aData['DEL_DURATION'] = $oDates->calculateDuration( $aData['DEL_INIT_DATE'], $aRow['DEL_FINISH_DATE'], null, null, $aRow['TAS_UID'] );
|
||||
$aData['DEL_DURATION'] = $oDates->calculateDuration($aData['DEL_INIT_DATE'], $aRow['DEL_FINISH_DATE'], null, null, $aRow['TAS_UID']);
|
||||
}
|
||||
|
||||
$oAppDelegation->update( $aData );
|
||||
$oAppDelegation->update($aData);
|
||||
|
||||
$oDataset->next();
|
||||
}
|
||||
|
||||
@@ -1,45 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.reportTables.php
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2011 Colosa Inc.
|
||||
*
|
||||
* 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
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* 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.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
* ReportTables - Report tables
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* ReportTables - Report tables
|
||||
/**
|
||||
* ReportTables - Report tables class
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
* @author Julio Cesar Laura Avenda<64>o
|
||||
* @copyright 2007 COLOSA
|
||||
*/class ReportTables
|
||||
class ReportTables
|
||||
{
|
||||
private $aDef = array ('mysql' => array ('number' => 'DOUBLE','char' => 'VARCHAR(255)','text' => 'TEXT','date' => 'DATETIME'
|
||||
),'pgsql' => array ('number' => 'DOUBLE','char' => 'VARCHAR(255)','text' => 'TEXT','date' => 'DATETIME'
|
||||
),'mssql' => array ('number' => 'FLOAT','char' => 'NVARCHAR(255)','text' => 'TEXT','date' => 'CHAR(19)'
|
||||
) /* Changed DATETIME CHAR(19) for compatibility issues. */ );
|
||||
private $aDef = array('mysql' => array('number' => 'DOUBLE', 'char' => 'VARCHAR(255)', 'text' => 'TEXT', 'date' => 'DATETIME'
|
||||
), 'pgsql' => array('number' => 'DOUBLE', 'char' => 'VARCHAR(255)', 'text' => 'TEXT', 'date' => 'DATETIME'
|
||||
), 'mssql' => array('number' => 'FLOAT', 'char' => 'NVARCHAR(255)', 'text' => 'TEXT', 'date' => 'CHAR(19)'
|
||||
) /* Changed DATETIME CHAR(19) for compatibility issues. */);
|
||||
//private $sPrefix = 'REP_';
|
||||
private $sPrefix = '';
|
||||
|
||||
@@ -51,12 +20,12 @@
|
||||
* @param string $$sRepTabUid
|
||||
* @return void
|
||||
*/
|
||||
public function deleteAllReportVars ($sRepTabUid = '')
|
||||
public function deleteAllReportVars($sRepTabUid = '')
|
||||
{
|
||||
try {
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( ReportVarPeer::REP_TAB_UID, $sRepTabUid );
|
||||
ReportVarPeer::doDelete( $oCriteria );
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(ReportVarPeer::REP_TAB_UID, $sRepTabUid);
|
||||
ReportVarPeer::doDelete($oCriteria);
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
@@ -71,21 +40,21 @@
|
||||
* @param string $sConnection Conexion
|
||||
* @return void
|
||||
*/
|
||||
public function dropTable ($sTableName, $sConnection = 'report')
|
||||
public function dropTable($sTableName, $sConnection = 'report')
|
||||
{
|
||||
$sTableName = $this->sPrefix . $sTableName;
|
||||
//we have to do the propel connection
|
||||
$PropelDatabase = $this->chooseDB( $sConnection );
|
||||
$con = Propel::getConnection( $PropelDatabase );
|
||||
$PropelDatabase = $this->chooseDB($sConnection);
|
||||
$con = Propel::getConnection($PropelDatabase);
|
||||
$stmt = $con->createStatement();
|
||||
try {
|
||||
switch (DB_ADAPTER) {
|
||||
case 'mysql':
|
||||
$rs = $stmt->executeQuery( 'DROP TABLE IF EXISTS `' . $sTableName . '`' );
|
||||
$rs = $stmt->executeQuery('DROP TABLE IF EXISTS `' . $sTableName . '`');
|
||||
break;
|
||||
case 'mssql':
|
||||
$rs = $stmt->executeQuery( "IF OBJECT_ID (N'" . $sTableName . "', N'U') IS NOT NULL
|
||||
DROP TABLE [" . $sTableName . "]" );
|
||||
$rs = $stmt->executeQuery("IF OBJECT_ID (N'" . $sTableName . "', N'U') IS NOT NULL
|
||||
DROP TABLE [" . $sTableName . "]");
|
||||
break;
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
@@ -105,12 +74,12 @@
|
||||
* @param string $bDefaultFields
|
||||
* @return void
|
||||
*/
|
||||
public function createTable ($sTableName, $sConnection = 'report', $sType = 'NORMAL', $aFields = array(), $bDefaultFields = true)
|
||||
public function createTable($sTableName, $sConnection = 'report', $sType = 'NORMAL', $aFields = array(), $bDefaultFields = true)
|
||||
{
|
||||
$sTableName = $this->sPrefix . $sTableName;
|
||||
//we have to do the propel connection
|
||||
$PropelDatabase = $this->chooseDB( $sConnection );
|
||||
$con = Propel::getConnection( $PropelDatabase );
|
||||
$PropelDatabase = $this->chooseDB($sConnection);
|
||||
$con = Propel::getConnection($PropelDatabase);
|
||||
$stmt = $con->createStatement();
|
||||
try {
|
||||
switch (DB_ADAPTER) {
|
||||
@@ -142,7 +111,7 @@
|
||||
$sQuery .= 'PRIMARY KEY (APP_UID' . ($sType == 'GRID' ? ',ROW' : '') . ')) ';
|
||||
}
|
||||
$sQuery .= ' DEFAULT CHARSET=utf8;';
|
||||
$rs = $stmt->executeQuery( $sQuery );
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
break;
|
||||
case 'mssql':
|
||||
$sQuery = 'CREATE TABLE [' . $sTableName . '] (';
|
||||
@@ -174,7 +143,7 @@
|
||||
$sQuery .= ' ';
|
||||
}
|
||||
|
||||
$rs = $stmt->executeQuery( $sQuery );
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -196,88 +165,88 @@
|
||||
* @param string $sGrid
|
||||
* @return void
|
||||
*/
|
||||
public function populateTable ($sTableName, $sConnection = 'report', $sType = 'NORMAL', $aFields = array(), $sProcessUid = '', $sGrid = '')
|
||||
public function populateTable($sTableName, $sConnection = 'report', $sType = 'NORMAL', $aFields = array(), $sProcessUid = '', $sGrid = '')
|
||||
{
|
||||
$sTableName = $this->sPrefix . $sTableName;
|
||||
//we have to do the propel connection
|
||||
$PropelDatabase = $this->chooseDB( $sConnection );
|
||||
$con = Propel::getConnection( $PropelDatabase );
|
||||
$PropelDatabase = $this->chooseDB($sConnection);
|
||||
$con = Propel::getConnection($PropelDatabase);
|
||||
$stmt = $con->createStatement();
|
||||
if ($sType == 'GRID') {
|
||||
$aAux = explode( '-', $sGrid );
|
||||
$aAux = explode('-', $sGrid);
|
||||
$sGrid = $aAux[0];
|
||||
}
|
||||
try {
|
||||
switch (DB_ADAPTER) {
|
||||
case 'mysql':
|
||||
//select cases for this Process, ordered by APP_NUMBER
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( ApplicationPeer::PRO_UID, $sProcessUid );
|
||||
$oCriteria->addAscendingOrderByColumn( ApplicationPeer::APP_NUMBER );
|
||||
$oDataset = ApplicationPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(ApplicationPeer::PRO_UID, $sProcessUid);
|
||||
$oCriteria->addAscendingOrderByColumn(ApplicationPeer::APP_NUMBER);
|
||||
$oDataset = ApplicationPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aData = unserialize( $aRow['APP_DATA'] );
|
||||
$aData = unserialize($aRow['APP_DATA']);
|
||||
//delete previous record from this report table ( previous records in case this is a grid )
|
||||
$deleteSql = 'DELETE FROM `' . $sTableName . "` WHERE APP_UID = '" . $aRow['APP_UID'] . "'";
|
||||
$rsDel = $stmt->executeQuery( $deleteSql );
|
||||
$rsDel = $stmt->executeQuery($deleteSql);
|
||||
if ($sType == 'NORMAL') {
|
||||
$sQuery = 'INSERT INTO `' . $sTableName . '` (';
|
||||
$sQuery .= '`APP_UID`,`APP_NUMBER`';
|
||||
foreach ($aFields as $aField) {
|
||||
$sQuery .= ',`' . $aField['sFieldName'] . '`';
|
||||
}
|
||||
$sQuery .= ") VALUES ('" . $aRow['APP_UID'] . "'," . (int) $aRow['APP_NUMBER'];
|
||||
$sQuery .= ") VALUES ('" . $aRow['APP_UID'] . "'," . (int)$aRow['APP_NUMBER'];
|
||||
foreach ($aFields as $aField) {
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= ',' . (isset( $aData[$aField['sFieldName']] ) ? (float) str_replace( ',', '', $aData[$aField['sFieldName']] ) : '0');
|
||||
$sQuery .= ',' . (isset($aData[$aField['sFieldName']]) ? (float)str_replace(',', '', $aData[$aField['sFieldName']]) : '0');
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (! isset( $aData[$aField['sFieldName']] )) {
|
||||
if (!isset($aData[$aField['sFieldName']])) {
|
||||
$aData[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= ",'" . (isset( $aData[$aField['sFieldName']] ) ? @mysql_real_escape_string( $aData[$aField['sFieldName']] ) : '') . "'";
|
||||
$sQuery .= ",'" . (isset($aData[$aField['sFieldName']]) ? @mysql_real_escape_string($aData[$aField['sFieldName']]) : '') . "'";
|
||||
break;
|
||||
case 'date':
|
||||
$value = (isset( $aData[$aField['sFieldName']] ) && trim( $aData[$aField['sFieldName']] )) != '' ? "'" . $aData[$aField['sFieldName']] . "'" : 'NULL';
|
||||
$value = (isset($aData[$aField['sFieldName']]) && trim($aData[$aField['sFieldName']])) != '' ? "'" . $aData[$aField['sFieldName']] . "'" : 'NULL';
|
||||
$sQuery .= "," . $value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$sQuery .= ')';
|
||||
$rs = $stmt->executeQuery( $sQuery );
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
} else {
|
||||
if (isset( $aData[$sGrid] )) {
|
||||
if (isset($aData[$sGrid])) {
|
||||
foreach ($aData[$sGrid] as $iRow => $aGridRow) {
|
||||
$sQuery = 'INSERT INTO `' . $sTableName . '` (';
|
||||
$sQuery .= '`APP_UID`,`APP_NUMBER`,`ROW`';
|
||||
foreach ($aFields as $aField) {
|
||||
$sQuery .= ',`' . $aField['sFieldName'] . '`';
|
||||
}
|
||||
$sQuery .= ") VALUES ('" . $aRow['APP_UID'] . "'," . (int) $aRow['APP_NUMBER'] . ',' . $iRow;
|
||||
$sQuery .= ") VALUES ('" . $aRow['APP_UID'] . "'," . (int)$aRow['APP_NUMBER'] . ',' . $iRow;
|
||||
foreach ($aFields as $aField) {
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= ',' . (isset( $aGridRow[$aField['sFieldName']] ) ? (float) str_replace( ',', '', $aGridRow[$aField['sFieldName']] ) : '0');
|
||||
$sQuery .= ',' . (isset($aGridRow[$aField['sFieldName']]) ? (float)str_replace(',', '', $aGridRow[$aField['sFieldName']]) : '0');
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (! isset( $aGridRow[$aField['sFieldName']] )) {
|
||||
if (!isset($aGridRow[$aField['sFieldName']])) {
|
||||
$aGridRow[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= ",'" . (isset( $aGridRow[$aField['sFieldName']] ) ? mysql_real_escape_string( $aGridRow[$aField['sFieldName']] ) : '') . "'";
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? mysql_real_escape_string($aGridRow[$aField['sFieldName']]) : '') . "'";
|
||||
break;
|
||||
case 'date':
|
||||
$value = (isset( $aGridRow[$aField['sFieldName']] ) && trim( $aGridRow[$aField['sFieldName']] )) != '' ? "'" . $aGridRow[$aField['sFieldName']] . "'" : 'NULL';
|
||||
$value = (isset($aGridRow[$aField['sFieldName']]) && trim($aGridRow[$aField['sFieldName']])) != '' ? "'" . $aGridRow[$aField['sFieldName']] . "'" : 'NULL';
|
||||
$sQuery .= "," . $value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$sQuery .= ')';
|
||||
$rs = $stmt->executeQuery( $sQuery );
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -289,69 +258,69 @@
|
||||
* For SQLServer code
|
||||
*/
|
||||
case 'mssql':
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( ApplicationPeer::PRO_UID, $sProcessUid );
|
||||
$oCriteria->addAscendingOrderByColumn( ApplicationPeer::APP_NUMBER );
|
||||
$oDataset = ApplicationPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(ApplicationPeer::PRO_UID, $sProcessUid);
|
||||
$oCriteria->addAscendingOrderByColumn(ApplicationPeer::APP_NUMBER);
|
||||
$oDataset = ApplicationPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aData = unserialize( $aRow['APP_DATA'] );
|
||||
mysql_query( 'DELETE FROM [' . $sTableName . "] WHERE APP_UID = '" . $aRow['APP_UID'] . "'" );
|
||||
$aData = unserialize($aRow['APP_DATA']);
|
||||
mysql_query('DELETE FROM [' . $sTableName . "] WHERE APP_UID = '" . $aRow['APP_UID'] . "'");
|
||||
if ($sType == 'NORMAL') {
|
||||
$sQuery = 'INSERT INTO [' . $sTableName . '] (';
|
||||
$sQuery .= '[APP_UID],[APP_NUMBER]';
|
||||
foreach ($aFields as $aField) {
|
||||
$sQuery .= ',[' . $aField['sFieldName'] . ']';
|
||||
}
|
||||
$sQuery .= ") VALUES ('" . $aRow['APP_UID'] . "'," . (int) $aRow['APP_NUMBER'];
|
||||
$sQuery .= ") VALUES ('" . $aRow['APP_UID'] . "'," . (int)$aRow['APP_NUMBER'];
|
||||
foreach ($aFields as $aField) {
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= ',' . (isset( $aData[$aField['sFieldName']] ) ? (float) str_replace( ',', '', $aData[$aField['sFieldName']] ) : '0');
|
||||
$sQuery .= ',' . (isset($aData[$aField['sFieldName']]) ? (float)str_replace(',', '', $aData[$aField['sFieldName']]) : '0');
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (! isset( $aData[$aField['sFieldName']] )) {
|
||||
if (!isset($aData[$aField['sFieldName']])) {
|
||||
$aData[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= ",'" . (isset( $aData[$aField['sFieldName']] ) ? mysql_real_escape_string( $aData[$aField['sFieldName']] ) : '') . "'";
|
||||
$sQuery .= ",'" . (isset($aData[$aField['sFieldName']]) ? mysql_real_escape_string($aData[$aField['sFieldName']]) : '') . "'";
|
||||
break;
|
||||
case 'date':
|
||||
$sQuery .= ",'" . (isset( $aData[$aField['sFieldName']] ) ? $aData[$aField['sFieldName']] : '') . "'";
|
||||
$sQuery .= ",'" . (isset($aData[$aField['sFieldName']]) ? $aData[$aField['sFieldName']] : '') . "'";
|
||||
break;
|
||||
}
|
||||
}
|
||||
$sQuery .= ')';
|
||||
$rs = $stmt->executeQuery( $sQuery );
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
} else {
|
||||
if (isset( $aData[$sGrid] )) {
|
||||
if (isset($aData[$sGrid])) {
|
||||
foreach ($aData[$sGrid] as $iRow => $aGridRow) {
|
||||
$sQuery = 'INSERT INTO [' . $sTableName . '] (';
|
||||
$sQuery .= '`APP_UID`,`APP_NUMBER`,`ROW`';
|
||||
foreach ($aFields as $aField) {
|
||||
$sQuery .= ',[' . $aField['sFieldName'] . ']';
|
||||
}
|
||||
$sQuery .= ") VALUES ('" . $aRow['APP_UID'] . "'," . (int) $aRow['APP_NUMBER'] . ',' . $iRow;
|
||||
$sQuery .= ") VALUES ('" . $aRow['APP_UID'] . "'," . (int)$aRow['APP_NUMBER'] . ',' . $iRow;
|
||||
foreach ($aFields as $aField) {
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= ',' . (isset( $aGridRow[$aField['sFieldName']] ) ? (float) str_replace( ',', '', $aGridRow[$aField['sFieldName']] ) : '0');
|
||||
$sQuery .= ',' . (isset($aGridRow[$aField['sFieldName']]) ? (float)str_replace(',', '', $aGridRow[$aField['sFieldName']]) : '0');
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (! isset( $aGridRow[$aField['sFieldName']] )) {
|
||||
if (!isset($aGridRow[$aField['sFieldName']])) {
|
||||
$aGridRow[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= ",'" . (isset( $aGridRow[$aField['sFieldName']] ) ? mysql_real_escape_string( $aGridRow[$aField['sFieldName']] ) : '') . "'";
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? mysql_real_escape_string($aGridRow[$aField['sFieldName']]) : '') . "'";
|
||||
break;
|
||||
case 'date':
|
||||
$sQuery .= ",'" . (isset( $aGridRow[$aField['sFieldName']] ) ? $aGridRow[$aField['sFieldName']] : '') . "'";
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? $aGridRow[$aField['sFieldName']] : '') . "'";
|
||||
break;
|
||||
}
|
||||
}
|
||||
$sQuery .= ')';
|
||||
$rs = $stmt->executeQuery( $sQuery );
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -373,21 +342,21 @@
|
||||
* @param boolean $bWhitType
|
||||
* @return void
|
||||
*/
|
||||
public function getTableVars ($sRepTabUid, $bWhitType = false)
|
||||
public function getTableVars($sRepTabUid, $bWhitType = false)
|
||||
{
|
||||
try {
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( ReportVarPeer::REP_TAB_UID, $sRepTabUid );
|
||||
$oDataset = ReportVarPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(ReportVarPeer::REP_TAB_UID, $sRepTabUid);
|
||||
$oDataset = ReportVarPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$aVars = array ();
|
||||
$aImportedVars = array (); //This array will help to control if the variable already exist
|
||||
$aVars = array();
|
||||
$aImportedVars = array(); //This array will help to control if the variable already exist
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
if ($bWhitType) {
|
||||
if (! in_array( $aRow['REP_VAR_NAME'], $aImportedVars )) {
|
||||
if (!in_array($aRow['REP_VAR_NAME'], $aImportedVars)) {
|
||||
$aImportedVars[] = $aRow['REP_VAR_NAME'];
|
||||
$aVars[] = array ('sFieldName' => $aRow['REP_VAR_NAME'],'sType' => $aRow['REP_VAR_TYPE']
|
||||
$aVars[] = array('sFieldName' => $aRow['REP_VAR_NAME'], 'sType' => $aRow['REP_VAR_TYPE']
|
||||
);
|
||||
}
|
||||
} else {
|
||||
@@ -409,17 +378,17 @@
|
||||
* @param string $sRepTabUid
|
||||
* @return void
|
||||
*/
|
||||
public function deleteReportTable ($sRepTabUid)
|
||||
public function deleteReportTable($sRepTabUid)
|
||||
{
|
||||
try {
|
||||
$oReportTable = new ReportTable();
|
||||
$aFields = $oReportTable->load( $sRepTabUid );
|
||||
if (! (empty( $aFields ))) {
|
||||
$this->dropTable( $aFields['REP_TAB_NAME'], $aFields['REP_TAB_CONNECTION'] );
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( ReportVarPeer::REP_TAB_UID, $sRepTabUid );
|
||||
$oDataset = ReportVarPeer::doDelete( $oCriteria );
|
||||
$oReportTable->remove( $sRepTabUid );
|
||||
$aFields = $oReportTable->load($sRepTabUid);
|
||||
if (!(empty($aFields))) {
|
||||
$this->dropTable($aFields['REP_TAB_NAME'], $aFields['REP_TAB_CONNECTION']);
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(ReportVarPeer::REP_TAB_UID, $sRepTabUid);
|
||||
$oDataset = ReportVarPeer::doDelete($oCriteria);
|
||||
$oReportTable->remove($sRepTabUid);
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
@@ -435,22 +404,22 @@
|
||||
* @param string $mask
|
||||
* @return array
|
||||
*/
|
||||
public function getSplitDate ($date, $mask)
|
||||
public function getSplitDate($date, $mask)
|
||||
{
|
||||
$sw1 = false;
|
||||
for ($i = 0; $i < 3; $i ++) {
|
||||
$item = substr( $mask, $i * 2, 1 );
|
||||
for ($i = 0; $i < 3; $i++) {
|
||||
$item = substr($mask, $i * 2, 1);
|
||||
switch ($item) {
|
||||
case 'Y':
|
||||
switch ($i) {
|
||||
case 0:
|
||||
$d1 = substr( $date, 0, 4 );
|
||||
$d1 = substr($date, 0, 4);
|
||||
break;
|
||||
case 1:
|
||||
$d1 = substr( $date, 3, 4 );
|
||||
$d1 = substr($date, 3, 4);
|
||||
break;
|
||||
case 2:
|
||||
$d1 = substr( $date, 6, 4 );
|
||||
$d1 = substr($date, 6, 4);
|
||||
break;
|
||||
}
|
||||
$sw1 = true;
|
||||
@@ -458,45 +427,45 @@
|
||||
case 'y':
|
||||
switch ($i) {
|
||||
case 0:
|
||||
$d1 = substr( $date, 0, 2 );
|
||||
$d1 = substr($date, 0, 2);
|
||||
break;
|
||||
case 1:
|
||||
$d1 = substr( $date, 3, 2 );
|
||||
$d1 = substr($date, 3, 2);
|
||||
break;
|
||||
case 2:
|
||||
$d1 = substr( $date, 6, 2 );
|
||||
$d1 = substr($date, 6, 2);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'm':
|
||||
switch ($i) {
|
||||
case 0:
|
||||
$d2 = substr( $date, 0, 2 );
|
||||
$d2 = substr($date, 0, 2);
|
||||
break;
|
||||
case 1:
|
||||
$d2 = ($sw1) ? substr( $date, 5, 2 ) : substr( $date, 3, 2 );
|
||||
$d2 = ($sw1) ? substr($date, 5, 2) : substr($date, 3, 2);
|
||||
break;
|
||||
case 2:
|
||||
$d2 = ($sw1) ? substr( $date, 8, 2 ) : substr( $date, 5, 2 );
|
||||
$d2 = ($sw1) ? substr($date, 8, 2) : substr($date, 5, 2);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'd':
|
||||
switch ($i) {
|
||||
case 0:
|
||||
$d3 = substr( $date, 0, 2 );
|
||||
$d3 = substr($date, 0, 2);
|
||||
break;
|
||||
case 1:
|
||||
$d3 = ($sw1) ? substr( $date, 5, 2 ) : substr( $date, 3, 2 );
|
||||
$d3 = ($sw1) ? substr($date, 5, 2) : substr($date, 3, 2);
|
||||
break;
|
||||
case 2:
|
||||
$d3 = ($sw1) ? substr( $date, 8, 2 ) : substr( $date, 5, 2 );
|
||||
$d3 = ($sw1) ? substr($date, 8, 2) : substr($date, 5, 2);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return Array (isset( $d1 ) ? $d1 : '',isset( $d2 ) ? $d2 : '',isset( $d3 ) ? $d3 : ''
|
||||
return Array(isset($d1) ? $d1 : '', isset($d2) ? $d2 : '', isset($d3) ? $d3 : ''
|
||||
);
|
||||
}
|
||||
|
||||
@@ -509,30 +478,30 @@
|
||||
* @param date $sMask
|
||||
* @return date
|
||||
*/
|
||||
public function getFormatDate ($sDate, $sMask)
|
||||
public function getFormatDate($sDate, $sMask)
|
||||
{
|
||||
//print $sDate." *** ". $sMask."<BR>";
|
||||
$dateTime = explode( " ", $sDate ); //To accept the Hour part
|
||||
$aDate = explode( '-', str_replace( "/", "-", $dateTime[0] ) );
|
||||
$dateTime = explode(" ", $sDate); //To accept the Hour part
|
||||
$aDate = explode('-', str_replace("/", "-", $dateTime[0]));
|
||||
$bResult = true;
|
||||
foreach ($aDate as $sDate) {
|
||||
if (! is_numeric( $sDate )) {
|
||||
if (!is_numeric($sDate)) {
|
||||
$bResult = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($sMask != '') {
|
||||
$aDate = $this->getSplitDate( $dateTime[0], $sMask );
|
||||
$aDate[0] = ($aDate[0] == '') ? date( 'Y' ) : $aDate[0];
|
||||
$aDate[1] = ($aDate[1] == '') ? date( 'm' ) : $aDate[1];
|
||||
$aDate[2] = ($aDate[2] == '') ? date( 'd' ) : $aDate[2];
|
||||
if (checkdate( $aDate[1], $aDate[2], $aDate[0] )) {
|
||||
$aDate = $this->getSplitDate($dateTime[0], $sMask);
|
||||
$aDate[0] = ($aDate[0] == '') ? date('Y') : $aDate[0];
|
||||
$aDate[1] = ($aDate[1] == '') ? date('m') : $aDate[1];
|
||||
$aDate[2] = ($aDate[2] == '') ? date('d') : $aDate[2];
|
||||
if (checkdate($aDate[1], $aDate[2], $aDate[0])) {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$sDateC = '';
|
||||
for ($i = 0; $i < count( $aDate ); $i ++) {
|
||||
for ($i = 0; $i < count($aDate); $i++) {
|
||||
$sDateC .= (($i == 0) ? "" : "-") . $aDate[$i];
|
||||
}
|
||||
return ($sDateC);
|
||||
@@ -549,7 +518,7 @@
|
||||
* @param string $aFields
|
||||
* @return void
|
||||
*/
|
||||
public function updateTables ($sProcessUid, $sApplicationUid, $iApplicationNumber, $aFields)
|
||||
public function updateTables($sProcessUid, $sApplicationUid, $iApplicationNumber, $aFields)
|
||||
{
|
||||
try {
|
||||
$c = new Criteria('workflow');
|
||||
@@ -562,73 +531,73 @@
|
||||
$isBpmn = isset($row['PRJ_UID']);
|
||||
|
||||
if (!class_exists('ReportTablePeer')) {
|
||||
require_once 'classes/model/ReportTablePeer.php';
|
||||
}
|
||||
require_once 'classes/model/ReportTablePeer.php';
|
||||
}
|
||||
//get all Active Report Tables
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( ReportTablePeer::PRO_UID, $sProcessUid );
|
||||
$oCriteria->add( ReportTablePeer::REP_TAB_STATUS, 'ACTIVE' );
|
||||
$oDataset = ReportTablePeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(ReportTablePeer::PRO_UID, $sProcessUid);
|
||||
$oCriteria->add(ReportTablePeer::REP_TAB_STATUS, 'ACTIVE');
|
||||
$oDataset = ReportTablePeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$aVars = array ();
|
||||
$aVars = array();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aRow['REP_TAB_NAME'] = $this->sPrefix . $aRow['REP_TAB_NAME'];
|
||||
$PropelDatabase = $this->chooseDB( $aRow['REP_TAB_CONNECTION'] );
|
||||
$con = Propel::getConnection( $PropelDatabase );
|
||||
$PropelDatabase = $this->chooseDB($aRow['REP_TAB_CONNECTION']);
|
||||
$con = Propel::getConnection($PropelDatabase);
|
||||
$stmt = $con->createStatement();
|
||||
switch (DB_ADAPTER) {
|
||||
case 'mysql':
|
||||
$aTableFields = $this->getTableVars( $aRow['REP_TAB_UID'], true );
|
||||
$aTableFields = $this->getTableVars($aRow['REP_TAB_UID'], true);
|
||||
if ($aRow['REP_TAB_TYPE'] == 'NORMAL') {
|
||||
$sqlExists = "SELECT * FROM `" . $aRow['REP_TAB_NAME'] . "` WHERE APP_UID = '" . $sApplicationUid . "'";
|
||||
$rsExists = $stmt->executeQuery( $sqlExists, ResultSet::FETCHMODE_ASSOC );
|
||||
$rsExists = $stmt->executeQuery($sqlExists, ResultSet::FETCHMODE_ASSOC);
|
||||
$rsExists->next();
|
||||
$aRow2 = $rsExists->getRow();
|
||||
|
||||
if (is_array( $aRow2 )) {
|
||||
if (is_array($aRow2)) {
|
||||
$sQuery = 'UPDATE `' . $aRow['REP_TAB_NAME'] . '` SET ';
|
||||
foreach ($aTableFields as $aField) {
|
||||
$sQuery .= '`' . $aField['sFieldName'] . '` = ';
|
||||
|
||||
if(!$isBpmn && !isset($aFields[$aField['sFieldName']])){
|
||||
foreach($aFields as $row){
|
||||
if(is_array($row) && isset($row[count($row)])){
|
||||
$aFields = $row[count($row)];
|
||||
}
|
||||
}
|
||||
if (!$isBpmn && !isset($aFields[$aField['sFieldName']])) {
|
||||
foreach ($aFields as $row) {
|
||||
if (is_array($row) && isset($row[count($row)])) {
|
||||
$aFields = $row[count($row)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= (isset( $aFields[$aField['sFieldName']] ) ? (float) str_replace( ',', '', $aFields[$aField['sFieldName']] ) : '0') . ',';
|
||||
$sQuery .= (isset($aFields[$aField['sFieldName']]) ? (float)str_replace(',', '', $aFields[$aField['sFieldName']]) : '0') . ',';
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (! isset( $aFields[$aField['sFieldName']] )) {
|
||||
if (!isset($aFields[$aField['sFieldName']])) {
|
||||
$aFields[$aField['sFieldName']] = '';
|
||||
}
|
||||
if (! isset( $aFields[$aField['sFieldName'] . '_label'] )) {
|
||||
if (!isset($aFields[$aField['sFieldName'] . '_label'])) {
|
||||
$aFields[$aField['sFieldName'] . '_label'] = '';
|
||||
}
|
||||
if(is_array($aFields[$aField['sFieldName']])){
|
||||
$sQuery .= "'" . (isset( $aFields[$aField['sFieldName']] ) ? $aFields[$aField['sFieldName']][0] : '') . "',";
|
||||
}else{
|
||||
$sQuery .= '\'' . ((isset($aFields[$aField['sFieldName']]))? @mysql_real_escape_string($aFields[$aField['sFieldName']]) : '') . '\',';
|
||||
if (is_array($aFields[$aField['sFieldName']])) {
|
||||
$sQuery .= "'" . (isset($aFields[$aField['sFieldName']]) ? $aFields[$aField['sFieldName']][0] : '') . "',";
|
||||
} else {
|
||||
$sQuery .= '\'' . ((isset($aFields[$aField['sFieldName']])) ? @mysql_real_escape_string($aFields[$aField['sFieldName']]) : '') . '\',';
|
||||
}
|
||||
break;
|
||||
case 'date':
|
||||
$mysqlDate = (isset( $aFields[$aField['sFieldName']] ) ? $aFields[$aField['sFieldName']] : '');
|
||||
$mysqlDate = (isset($aFields[$aField['sFieldName']]) ? $aFields[$aField['sFieldName']] : '');
|
||||
if ($mysqlDate != '') {
|
||||
$mysqlDate = str_replace( '/', '-', $mysqlDate );
|
||||
$mysqlDate = date( 'Y-m-d', strtotime( $mysqlDate ) );
|
||||
$mysqlDate = str_replace('/', '-', $mysqlDate);
|
||||
$mysqlDate = date('Y-m-d', strtotime($mysqlDate));
|
||||
}
|
||||
$value = trim( $mysqlDate ) != '' ? "'" . $mysqlDate . "'" : 'NULL';
|
||||
$value = trim($mysqlDate) != '' ? "'" . $mysqlDate . "'" : 'NULL';
|
||||
$sQuery .= $value . ",";
|
||||
break;
|
||||
}
|
||||
}
|
||||
$sQuery = substr( $sQuery, 0, - 1 );
|
||||
$sQuery = substr($sQuery, 0, -1);
|
||||
$sQuery .= " WHERE APP_UID = '" . $sApplicationUid . "'";
|
||||
} else {
|
||||
$sQuery = 'INSERT INTO `' . $aRow['REP_TAB_NAME'] . '` (';
|
||||
@@ -636,40 +605,40 @@
|
||||
foreach ($aTableFields as $aField) {
|
||||
$sQuery .= ',`' . $aField['sFieldName'] . '`';
|
||||
}
|
||||
$sQuery .= ") VALUES ('" . $sApplicationUid . "'," . (int) $iApplicationNumber;
|
||||
$sQuery .= ") VALUES ('" . $sApplicationUid . "'," . (int)$iApplicationNumber;
|
||||
foreach ($aTableFields as $aField) {
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= ',' . (isset( $aFields[$aField['sFieldName']] ) ? (float) str_replace( ',', '', $aFields[$aField['sFieldName']] ) : '0');
|
||||
$sQuery .= ',' . (isset($aFields[$aField['sFieldName']]) ? (float)str_replace(',', '', $aFields[$aField['sFieldName']]) : '0');
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (! isset( $aFields[$aField['sFieldName']] )) {
|
||||
if (!isset($aFields[$aField['sFieldName']])) {
|
||||
$aFields[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= ",'" . (isset( $aFields[$aField['sFieldName']] ) ? mysql_real_escape_string( $aFields[$aField['sFieldName']] ) : '') . "'";
|
||||
$sQuery .= ",'" . (isset($aFields[$aField['sFieldName']]) ? mysql_real_escape_string($aFields[$aField['sFieldName']]) : '') . "'";
|
||||
break;
|
||||
case 'date':
|
||||
$mysqlDate = (isset( $aFields[$aField['sFieldName']] ) ? $aFields[$aField['sFieldName']] : '');
|
||||
$mysqlDate = (isset($aFields[$aField['sFieldName']]) ? $aFields[$aField['sFieldName']] : '');
|
||||
if ($mysqlDate != '') {
|
||||
$mysqlDate = str_replace( '/', '-', $mysqlDate );
|
||||
$mysqlDate = date( 'Y-m-d', strtotime( $mysqlDate ) );
|
||||
$mysqlDate = str_replace('/', '-', $mysqlDate);
|
||||
$mysqlDate = date('Y-m-d', strtotime($mysqlDate));
|
||||
}
|
||||
$value = trim( $mysqlDate ) != '' ? "'" . $mysqlDate . "'" : 'NULL';
|
||||
$value = trim($mysqlDate) != '' ? "'" . $mysqlDate . "'" : 'NULL';
|
||||
$sQuery .= "," . $value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$sQuery .= ')';
|
||||
}
|
||||
$rs = $stmt->executeQuery( $sQuery );
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
} else {
|
||||
//remove old rows from database
|
||||
$sqlDelete = 'DELETE FROM `' . $aRow['REP_TAB_NAME'] . "` WHERE APP_UID = '" . $sApplicationUid . "'";
|
||||
$rsDelete = $stmt->executeQuery( $sqlDelete );
|
||||
$rsDelete = $stmt->executeQuery($sqlDelete);
|
||||
|
||||
$aAux = explode( '-', $aRow['REP_TAB_GRID'] );
|
||||
if (isset( $aFields[$aAux[0]] )) {
|
||||
$aAux = explode('-', $aRow['REP_TAB_GRID']);
|
||||
if (isset($aFields[$aAux[0]])) {
|
||||
if (is_array($aFields[$aAux[0]])) {
|
||||
foreach ($aFields[$aAux[0]] as $iRow => $aGridRow) {
|
||||
$sQuery = 'INSERT INTO `' . $aRow['REP_TAB_NAME'] . '` (';
|
||||
@@ -677,26 +646,26 @@
|
||||
foreach ($aTableFields as $aField) {
|
||||
$sQuery .= ',`' . $aField['sFieldName'] . '`';
|
||||
}
|
||||
$sQuery .= ") VALUES ('" . $sApplicationUid . "'," . (int) $iApplicationNumber . ',' . $iRow;
|
||||
$sQuery .= ") VALUES ('" . $sApplicationUid . "'," . (int)$iApplicationNumber . ',' . $iRow;
|
||||
foreach ($aTableFields as $aField) {
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= ',' . (isset( $aGridRow[$aField['sFieldName']] ) ? (float) str_replace( ',', '', $aGridRow[$aField['sFieldName']] ) : '0');
|
||||
$sQuery .= ',' . (isset($aGridRow[$aField['sFieldName']]) ? (float)str_replace(',', '', $aGridRow[$aField['sFieldName']]) : '0');
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (! isset( $aGridRow[$aField['sFieldName']] )) {
|
||||
if (!isset($aGridRow[$aField['sFieldName']])) {
|
||||
$aGridRow[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= ",'" . (isset( $aGridRow[$aField['sFieldName']] ) ? mysql_real_escape_string( $aGridRow[$aField['sFieldName']] ) : '') . "'";
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? mysql_real_escape_string($aGridRow[$aField['sFieldName']]) : '') . "'";
|
||||
break;
|
||||
case 'date':
|
||||
$sQuery .= ",'" . (isset( $aGridRow[$aField['sFieldName']] ) ? $aGridRow[$aField['sFieldName']] : '') . "'";
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? $aGridRow[$aField['sFieldName']] : '') . "'";
|
||||
break;
|
||||
}
|
||||
}
|
||||
$sQuery .= ')';
|
||||
$rs = $stmt->executeQuery( $sQuery );
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -707,30 +676,30 @@
|
||||
* For SQLServer code
|
||||
*/
|
||||
case 'mssql':
|
||||
$aTableFields = $this->getTableVars( $aRow['REP_TAB_UID'], true );
|
||||
$aTableFields = $this->getTableVars($aRow['REP_TAB_UID'], true);
|
||||
if ($aRow['REP_TAB_TYPE'] == 'NORMAL') {
|
||||
$oDataset2 = mssql_query( "SELECT * FROM [" . $aRow['REP_TAB_NAME'] . "] WHERE APP_UID = '" . $sApplicationUid . "'" );
|
||||
if ($aRow2 = mssql_fetch_row( $oDataset2 )) {
|
||||
$oDataset2 = mssql_query("SELECT * FROM [" . $aRow['REP_TAB_NAME'] . "] WHERE APP_UID = '" . $sApplicationUid . "'");
|
||||
if ($aRow2 = mssql_fetch_row($oDataset2)) {
|
||||
$sQuery = 'UPDATE [' . $aRow['REP_TAB_NAME'] . '] SET ';
|
||||
foreach ($aTableFields as $aField) {
|
||||
$sQuery .= '[' . $aField['sFieldName'] . '] = ';
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= (isset( $aFields[$aField['sFieldName']] ) ? (float) str_replace( ',', '', $aFields[$aField['sFieldName']] ) : '0') . ',';
|
||||
$sQuery .= (isset($aFields[$aField['sFieldName']]) ? (float)str_replace(',', '', $aFields[$aField['sFieldName']]) : '0') . ',';
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (! isset( $aFields[$aField['sFieldName']] )) {
|
||||
if (!isset($aFields[$aField['sFieldName']])) {
|
||||
$aFields[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= "'" . (isset( $aFields[$aField['sFieldName']] ) ? mysql_real_escape_string( $aFields[$aField['sFieldName']] ) : '') . "',";
|
||||
$sQuery .= "'" . (isset($aFields[$aField['sFieldName']]) ? mysql_real_escape_string($aFields[$aField['sFieldName']]) : '') . "',";
|
||||
break;
|
||||
case 'date':
|
||||
$sQuery .= "'" . (isset( $aFields[$aField['sFieldName']] ) ? $aFields[$aField['sFieldName']] : '') . "',";
|
||||
$sQuery .= "'" . (isset($aFields[$aField['sFieldName']]) ? $aFields[$aField['sFieldName']] : '') . "',";
|
||||
break;
|
||||
}
|
||||
}
|
||||
$sQuery = substr( $sQuery, 0, - 1 );
|
||||
$sQuery = substr($sQuery, 0, -1);
|
||||
$sQuery .= " WHERE APP_UID = '" . $sApplicationUid . "'";
|
||||
} else {
|
||||
$sQuery = 'INSERT INTO [' . $aRow['REP_TAB_NAME'] . '] (';
|
||||
@@ -738,57 +707,57 @@
|
||||
foreach ($aTableFields as $aField) {
|
||||
$sQuery .= ',[' . $aField['sFieldName'] . ']';
|
||||
}
|
||||
$sQuery .= ") VALUES ('" . $sApplicationUid . "'," . (int) $iApplicationNumber;
|
||||
$sQuery .= ") VALUES ('" . $sApplicationUid . "'," . (int)$iApplicationNumber;
|
||||
foreach ($aTableFields as $aField) {
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= ',' . (isset( $aFields[$aField['sFieldName']] ) ? (float) str_replace( ',', '', $aFields[$aField['sFieldName']] ) : '0');
|
||||
$sQuery .= ',' . (isset($aFields[$aField['sFieldName']]) ? (float)str_replace(',', '', $aFields[$aField['sFieldName']]) : '0');
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (! isset( $aFields[$aField['sFieldName']] )) {
|
||||
if (!isset($aFields[$aField['sFieldName']])) {
|
||||
$aFields[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= ",'" . (isset( $aFields[$aField['sFieldName']] ) ? mysql_real_escape_string( $aFields[$aField['sFieldName']] ) : '') . "'";
|
||||
$sQuery .= ",'" . (isset($aFields[$aField['sFieldName']]) ? mysql_real_escape_string($aFields[$aField['sFieldName']]) : '') . "'";
|
||||
break;
|
||||
case 'date':
|
||||
$sQuery .= ",'" . (isset( $aFields[$aField['sFieldName']] ) ? $aFields[$aField['sFieldName']] : '') . "'";
|
||||
$sQuery .= ",'" . (isset($aFields[$aField['sFieldName']]) ? $aFields[$aField['sFieldName']] : '') . "'";
|
||||
break;
|
||||
}
|
||||
}
|
||||
$sQuery .= ')';
|
||||
}
|
||||
$rs = $stmt->executeQuery( $sQuery );
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
} else {
|
||||
mysql_query( 'DELETE FROM [' . $aRow['REP_TAB_NAME'] . "] WHERE APP_UID = '" . $sApplicationUid . "'" );
|
||||
$aAux = explode( '-', $aRow['REP_TAB_GRID'] );
|
||||
if (isset( $aFields[$aAux[0]] )) {
|
||||
mysql_query('DELETE FROM [' . $aRow['REP_TAB_NAME'] . "] WHERE APP_UID = '" . $sApplicationUid . "'");
|
||||
$aAux = explode('-', $aRow['REP_TAB_GRID']);
|
||||
if (isset($aFields[$aAux[0]])) {
|
||||
foreach ($aFields[$aAux[0]] as $iRow => $aGridRow) {
|
||||
$sQuery = 'INSERT INTO [' . $aRow['REP_TAB_NAME'] . '] (';
|
||||
$sQuery .= '[APP_UID],[APP_NUMBER],[ROW]';
|
||||
foreach ($aTableFields as $aField) {
|
||||
$sQuery .= ',[' . $aField['sFieldName'] . ']';
|
||||
}
|
||||
$sQuery .= ") VALUES ('" . $sApplicationUid . "'," . (int) $iApplicationNumber . ',' . $iRow;
|
||||
$sQuery .= ") VALUES ('" . $sApplicationUid . "'," . (int)$iApplicationNumber . ',' . $iRow;
|
||||
foreach ($aTableFields as $aField) {
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= ',' . (isset( $aGridRow[$aField['sFieldName']] ) ? (float) str_replace( ',', '', $aGridRow[$aField['sFieldName']] ) : '0');
|
||||
$sQuery .= ',' . (isset($aGridRow[$aField['sFieldName']]) ? (float)str_replace(',', '', $aGridRow[$aField['sFieldName']]) : '0');
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (! isset( $aGridRow[$aField['sFieldName']] )) {
|
||||
if (!isset($aGridRow[$aField['sFieldName']])) {
|
||||
$aGridRow[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= ",'" . (isset( $aGridRow[$aField['sFieldName']] ) ? mysql_real_escape_string( $aGridRow[$aField['sFieldName']] ) : '') . "'";
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? mysql_real_escape_string($aGridRow[$aField['sFieldName']]) : '') . "'";
|
||||
break;
|
||||
case 'date':
|
||||
$sQuery .= ",'" . (isset( $aGridRow[$aField['sFieldName']] ) ? $aGridRow[$aField['sFieldName']] : '') . "'";
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? $aGridRow[$aField['sFieldName']] : '') . "'";
|
||||
break;
|
||||
}
|
||||
}
|
||||
$sQuery .= ')';
|
||||
$rs = $stmt->executeQuery( $sQuery );
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -809,10 +778,10 @@
|
||||
* @access public
|
||||
* @return boolean
|
||||
*/
|
||||
public function tableExist ()
|
||||
public function tableExist()
|
||||
{
|
||||
$bExists = true;
|
||||
$sDataBase = 'database_' . strtolower( DB_ADAPTER );
|
||||
$sDataBase = 'database_' . strtolower(DB_ADAPTER);
|
||||
|
||||
$oDataBase = new database();
|
||||
$bExists = $oDataBase->reportTableExist();
|
||||
@@ -828,9 +797,9 @@
|
||||
* @param string $TabConnectionk
|
||||
* @return string
|
||||
*/
|
||||
public function chooseDB ($TabConnectionk)
|
||||
public function chooseDB($TabConnectionk)
|
||||
{
|
||||
$repTabConnection = trim( strtoupper( $TabConnectionk ) );
|
||||
$repTabConnection = trim(strtoupper($TabConnectionk));
|
||||
$PropelDatabase = 'rp';
|
||||
if ($repTabConnection == '' || $repTabConnection == 'REPORT') {
|
||||
$PropelDatabase = 'rp';
|
||||
|
||||
@@ -1,40 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.serverConfiguration.php
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.
|
||||
*
|
||||
* 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
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* 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.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
* ServerConfiguration - serverConf
|
||||
*/
|
||||
|
||||
/**
|
||||
* ServerConfiguration - serverConf
|
||||
/**
|
||||
* ServerConfiguration - serverConf class
|
||||
*
|
||||
* @author Hugo Loza
|
||||
* @copyright 2010 COLOSA
|
||||
* @license GNU Affero General Public License
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*/class serverConf
|
||||
class ServerConf
|
||||
{
|
||||
|
||||
private $_aProperties = array();
|
||||
@@ -80,7 +49,7 @@
|
||||
public static function &getSingleton()
|
||||
{
|
||||
if (self::$instance == null) {
|
||||
self::$instance = new serverConf();
|
||||
self::$instance = new ServerConf();
|
||||
if ((file_exists(self::$instance->filePath)) && (filesize(self::$instance->filePath) > 0)) {
|
||||
self::$instance->unSerializeInstance(file_get_contents(self::$instance->filePath));
|
||||
}
|
||||
@@ -108,7 +77,7 @@
|
||||
public function unSerializeInstance($serialized)
|
||||
{
|
||||
if (self::$instance == null) {
|
||||
self::$instance = new serverConf();
|
||||
self::$instance = new ServerConf();
|
||||
}
|
||||
|
||||
if ($instance = unserialize($serialized)) {
|
||||
@@ -272,11 +241,10 @@
|
||||
$wsInfo = $this->aWSinfo[$file];
|
||||
} else {
|
||||
$wsInfo['num_processes'] = "not gathered yet";
|
||||
$wsInfo['num_cases'] = "not gathered yet";
|
||||
;
|
||||
$wsInfo['num_cases'] = "not gathered yet";;
|
||||
$wsInfo['num_users'] = "not gathered yet";
|
||||
}
|
||||
$wsArray[$file] = array ('WSP_ID' => $file,'WSP_NAME' => $file,'WSP_STATUS' => $statusl,'WSP_PROCESS_COUNT' => $wsInfo['num_processes'],'WSP_CASES_COUNT' => $wsInfo['num_cases'],'WSP_USERS_COUNT' => isset( $wsInfo['num_users'] ) ? $wsInfo['num_users'] : "");
|
||||
$wsArray[$file] = array('WSP_ID' => $file, 'WSP_NAME' => $file, 'WSP_STATUS' => $statusl, 'WSP_PROCESS_COUNT' => $wsInfo['num_processes'], 'WSP_CASES_COUNT' => $wsInfo['num_cases'], 'WSP_USERS_COUNT' => isset($wsInfo['num_users']) ? $wsInfo['num_users'] : "");
|
||||
if (isset($this->workspaces[$file]['WSP_LOGINS'])) {
|
||||
$wsArray[$file]['WSP_LOGINS'] = $this->workspaces[$file]['WSP_LOGINS'];
|
||||
}
|
||||
@@ -318,7 +286,7 @@
|
||||
|
||||
$Criteria = new Criteria('workflow');
|
||||
$Criteria->add(UsersPeer::USR_STATUS, array('DELETED', 'DISABLED'
|
||||
), CRITERIA::NOT_IN);
|
||||
), CRITERIA::NOT_IN);
|
||||
$aResult['num_users'] = UsersPeer::doCount($Criteria);
|
||||
return $aResult;
|
||||
}
|
||||
|
||||
@@ -27,14 +27,12 @@
|
||||
require_once 'classes/model/Session.php';
|
||||
|
||||
/**
|
||||
* Sessions - Sessions
|
||||
/**
|
||||
* Sessions - Sessions
|
||||
* /**
|
||||
* Sessions - Sessions class
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
* @author Everth S. Berrios Morales
|
||||
* @copyright 2008 COLOSA
|
||||
*/class Sessions
|
||||
*/
|
||||
class Sessions
|
||||
{
|
||||
|
||||
protected $tmpfile;
|
||||
@@ -47,7 +45,7 @@ require_once 'classes/model/Session.php';
|
||||
* @param string $sSessionId
|
||||
* @return void
|
||||
*/
|
||||
public function __construct ($sSessionId = NULL)
|
||||
public function __construct($sSessionId = NULL)
|
||||
{
|
||||
$this->sessionId = $sSessionId;
|
||||
}
|
||||
@@ -61,27 +59,27 @@ require_once 'classes/model/Session.php';
|
||||
* @param string sSessionId
|
||||
* @return array
|
||||
*/
|
||||
public function getSessionUser ($sSessionId = NULL)
|
||||
public function getSessionUser($sSessionId = NULL)
|
||||
{
|
||||
try {
|
||||
if ($sSessionId != NULL) {
|
||||
$this->sessionId = $sSessionId;
|
||||
} else if ($this->sessionId == NULL) {
|
||||
throw new Exception( 'session id was not set.' );
|
||||
throw new Exception('session id was not set.');
|
||||
}
|
||||
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( SessionPeer::USR_UID );
|
||||
$oCriteria->addSelectColumn( SessionPeer::SES_STATUS );
|
||||
$oCriteria->addSelectColumn( SessionPeer::SES_DUE_DATE );
|
||||
$oCriteria->add( SessionPeer::SES_UID, $this->sessionId );
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(SessionPeer::USR_UID);
|
||||
$oCriteria->addSelectColumn(SessionPeer::SES_STATUS);
|
||||
$oCriteria->addSelectColumn(SessionPeer::SES_DUE_DATE);
|
||||
$oCriteria->add(SessionPeer::SES_UID, $this->sessionId);
|
||||
|
||||
$oDataset = SessionPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset = SessionPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
|
||||
if (! is_array( $aRow )) {
|
||||
if (!is_array($aRow)) {
|
||||
$this->deleteTmpfile();
|
||||
}
|
||||
return $aRow;
|
||||
@@ -99,30 +97,30 @@ require_once 'classes/model/Session.php';
|
||||
* @param string sSessionId
|
||||
* @return array
|
||||
*/
|
||||
public function verifySession ($sSessionId = NULL)
|
||||
public function verifySession($sSessionId = NULL)
|
||||
{
|
||||
try {
|
||||
if ($sSessionId != NULL) {
|
||||
$this->sessionId = $sSessionId;
|
||||
} else if ($this->sessionId == NULL) {
|
||||
throw new Exception( 'session id was not set.' );
|
||||
throw new Exception('session id was not set.');
|
||||
}
|
||||
|
||||
$date = date( 'Y-m-d H:i:s' );
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( SessionPeer::USR_UID );
|
||||
$oCriteria->addSelectColumn( SessionPeer::SES_STATUS );
|
||||
$oCriteria->addSelectColumn( SessionPeer::SES_DUE_DATE );
|
||||
$oCriteria->add( SessionPeer::SES_UID, $this->sessionId );
|
||||
$oCriteria->add( SessionPeer::SES_STATUS, 'ACTIVE' );
|
||||
$oCriteria->add( SessionPeer::SES_DUE_DATE, $date, Criteria::GREATER_EQUAL );
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(SessionPeer::USR_UID);
|
||||
$oCriteria->addSelectColumn(SessionPeer::SES_STATUS);
|
||||
$oCriteria->addSelectColumn(SessionPeer::SES_DUE_DATE);
|
||||
$oCriteria->add(SessionPeer::SES_UID, $this->sessionId);
|
||||
$oCriteria->add(SessionPeer::SES_STATUS, 'ACTIVE');
|
||||
$oCriteria->add(SessionPeer::SES_DUE_DATE, $date, Criteria::GREATER_EQUAL);
|
||||
|
||||
$oDataset = SessionPeer::doSelectRS( $oCriteria, Propel::getDbConnection('workflow_ro') );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset = SessionPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro'));
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
|
||||
if (! is_array( $aRow )) {
|
||||
if (!is_array($aRow)) {
|
||||
$this->deleteTmpfile();
|
||||
}
|
||||
|
||||
@@ -142,32 +140,32 @@ require_once 'classes/model/Session.php';
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function registerGlobal ($name, $value)
|
||||
public function registerGlobal($name, $value)
|
||||
{
|
||||
$this->tmpfile = G::sys_get_temp_dir() . PATH_SEP . "pm-rg-{$this->sessionId}";
|
||||
|
||||
if ($this->sessionId == NULL) {
|
||||
throw new Exception( 'session id was not set.' );
|
||||
throw new Exception('session id was not set.');
|
||||
}
|
||||
|
||||
$tmpfile_content = '';
|
||||
if (is_file( $this->tmpfile ) && trim( file_get_contents( $this->tmpfile ) ) != '') {
|
||||
$tmpfile_content = file_get_contents( $this->tmpfile );
|
||||
if (is_file($this->tmpfile) && trim(file_get_contents($this->tmpfile)) != '') {
|
||||
$tmpfile_content = file_get_contents($this->tmpfile);
|
||||
}
|
||||
|
||||
//getting the global array
|
||||
if ($tmpfile_content != '') {
|
||||
$this->globals = unserialize( $tmpfile_content );
|
||||
$this->globals = unserialize($tmpfile_content);
|
||||
} else {
|
||||
$this->globals = Array ();
|
||||
$this->globals = Array();
|
||||
}
|
||||
|
||||
//registering the new global variable
|
||||
$this->globals[$name] = $value;
|
||||
|
||||
//saving the global array
|
||||
$tmpfile_content = serialize( $this->globals );
|
||||
file_put_contents( $this->tmpfile, $tmpfile_content );
|
||||
$tmpfile_content = serialize($this->globals);
|
||||
file_put_contents($this->tmpfile, $tmpfile_content);
|
||||
|
||||
}
|
||||
|
||||
@@ -180,28 +178,28 @@ require_once 'classes/model/Session.php';
|
||||
* @param string $name
|
||||
* @return string
|
||||
*/
|
||||
public function getGlobal ($name)
|
||||
public function getGlobal($name)
|
||||
{
|
||||
$this->tmpfile = G::sys_get_temp_dir() . PATH_SEP . "pm-rg-{$this->sessionId}";
|
||||
|
||||
if ($this->sessionId == NULL) {
|
||||
throw new Exception( 'session id was not set.' );
|
||||
throw new Exception('session id was not set.');
|
||||
}
|
||||
|
||||
$tmpfile_content = '';
|
||||
if (is_file( $this->tmpfile ) && trim( file_get_contents( $this->tmpfile ) ) != '') {
|
||||
$tmpfile_content = file_get_contents( $this->tmpfile );
|
||||
if (is_file($this->tmpfile) && trim(file_get_contents($this->tmpfile)) != '') {
|
||||
$tmpfile_content = file_get_contents($this->tmpfile);
|
||||
}
|
||||
|
||||
//getting the global array
|
||||
if ($tmpfile_content != '') {
|
||||
$this->globals = unserialize( $tmpfile_content );
|
||||
$this->globals = unserialize($tmpfile_content);
|
||||
} else {
|
||||
$this->globals = Array ();
|
||||
$this->globals = Array();
|
||||
}
|
||||
|
||||
//getting the new global variable
|
||||
if (isset( $this->globals[$name] )) {
|
||||
if (isset($this->globals[$name])) {
|
||||
return $this->globals[$name];
|
||||
} else {
|
||||
return '';
|
||||
@@ -217,24 +215,24 @@ require_once 'classes/model/Session.php';
|
||||
* @param string $name
|
||||
* @return array
|
||||
*/
|
||||
public function getGlobals ()
|
||||
public function getGlobals()
|
||||
{
|
||||
$this->tmpfile = G::sys_get_temp_dir() . PATH_SEP . "pm-rg-{$this->sessionId}";
|
||||
|
||||
if ($this->sessionId == NULL) {
|
||||
throw new Exception( 'session id was not set.' );
|
||||
throw new Exception('session id was not set.');
|
||||
}
|
||||
|
||||
$tmpfile_content = '';
|
||||
if (is_file( $this->tmpfile ) && trim( file_get_contents( $this->tmpfile ) ) != '') {
|
||||
$tmpfile_content = file_get_contents( $this->tmpfile );
|
||||
if (is_file($this->tmpfile) && trim(file_get_contents($this->tmpfile)) != '') {
|
||||
$tmpfile_content = file_get_contents($this->tmpfile);
|
||||
}
|
||||
|
||||
//getting the global array
|
||||
if ($tmpfile_content != '') {
|
||||
$this->globals = unserialize( $tmpfile_content );
|
||||
$this->globals = unserialize($tmpfile_content);
|
||||
} else {
|
||||
$this->globals = Array ();
|
||||
$this->globals = Array();
|
||||
}
|
||||
return $this->globals;
|
||||
}
|
||||
@@ -248,13 +246,13 @@ require_once 'classes/model/Session.php';
|
||||
* param
|
||||
* @return void
|
||||
*/
|
||||
private function deleteTmpfile ()
|
||||
private function deleteTmpfile()
|
||||
{
|
||||
if ($this->sessionId == NULL) {
|
||||
throw new Exception( 'session id was not set.' );
|
||||
throw new Exception('session id was not set.');
|
||||
}
|
||||
$this->tmpfile = G::sys_get_temp_dir() . PATH_SEP . "pm-rg-{$this->sessionId}";
|
||||
@unlink( $this->tmpfile );
|
||||
@unlink($this->tmpfile);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,30 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* class.spool.php
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2011 Colosa Inc.
|
||||
*
|
||||
* 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
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* 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.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* spoolRun - brief send email from the spool database, and see if we have all the addresses we send to.
|
||||
*
|
||||
@@ -35,15 +9,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* LOG FIXES
|
||||
* =========
|
||||
*
|
||||
* 24-03-2010 Erik A.O. <erik@colosa.com>
|
||||
* class: the $ExceptionCode and $aWarnings
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*/class spoolRun
|
||||
*/
|
||||
class SpoolRun
|
||||
{
|
||||
public $config;
|
||||
private $fileData;
|
||||
@@ -51,8 +19,8 @@
|
||||
public $status;
|
||||
public $error;
|
||||
|
||||
private $ExceptionCode = Array (); //Array to define the Expetion codes
|
||||
private $aWarnings = Array (); //Array to store the warning that were throws by the class
|
||||
private $ExceptionCode = Array(); //Array to define the Expetion codes
|
||||
private $aWarnings = Array(); //Array to store the warning that were throws by the class
|
||||
|
||||
|
||||
private $longMailEreg;
|
||||
@@ -64,10 +32,10 @@
|
||||
* @param none
|
||||
* @return none
|
||||
*/
|
||||
public function __construct ()
|
||||
public function __construct()
|
||||
{
|
||||
$this->config = array ();
|
||||
$this->fileData = array ();
|
||||
$this->config = array();
|
||||
$this->fileData = array();
|
||||
$this->spool_id = '';
|
||||
$this->status = 'pending';
|
||||
$this->error = '';
|
||||
@@ -86,35 +54,35 @@
|
||||
* @param none
|
||||
* @return none
|
||||
*/
|
||||
public function getSpoolFilesList ()
|
||||
public function getSpoolFilesList()
|
||||
{
|
||||
$sql = "SELECT * FROM APP_MESSAGE WHERE APP_MSG_STATUS ='pending'";
|
||||
|
||||
$con = Propel::getConnection( "workflow" );
|
||||
$stmt = $con->prepareStatement( $sql );
|
||||
$con = Propel::getConnection("workflow");
|
||||
$stmt = $con->prepareStatement($sql);
|
||||
$rs = $stmt->executeQuery();
|
||||
|
||||
while ($rs->next()) {
|
||||
$this->spool_id = $rs->getString( 'APP_MSG_UID' );
|
||||
$this->fileData['subject'] = $rs->getString( 'APP_MSG_SUBJECT' );
|
||||
$this->fileData['from'] = $rs->getString( 'APP_MSG_FROM' );
|
||||
$this->fileData['to'] = $rs->getString( 'APP_MSG_TO' );
|
||||
$this->fileData['body'] = $rs->getString( 'APP_MSG_BODY' );
|
||||
$this->fileData['date'] = $rs->getString( 'APP_MSG_DATE' );
|
||||
$this->fileData['cc'] = $rs->getString( 'APP_MSG_CC' );
|
||||
$this->fileData['bcc'] = $rs->getString( 'APP_MSG_BCC' );
|
||||
$this->fileData['template'] = $rs->getString( 'APP_MSG_TEMPLATE' );
|
||||
$this->fileData['attachments'] = array (); //$rs->getString('APP_MSG_ATTACH');
|
||||
$this->fileData['error'] = $rs->getString( 'APP_MSG_ERROR' );
|
||||
$this->spool_id = $rs->getString('APP_MSG_UID');
|
||||
$this->fileData['subject'] = $rs->getString('APP_MSG_SUBJECT');
|
||||
$this->fileData['from'] = $rs->getString('APP_MSG_FROM');
|
||||
$this->fileData['to'] = $rs->getString('APP_MSG_TO');
|
||||
$this->fileData['body'] = $rs->getString('APP_MSG_BODY');
|
||||
$this->fileData['date'] = $rs->getString('APP_MSG_DATE');
|
||||
$this->fileData['cc'] = $rs->getString('APP_MSG_CC');
|
||||
$this->fileData['bcc'] = $rs->getString('APP_MSG_BCC');
|
||||
$this->fileData['template'] = $rs->getString('APP_MSG_TEMPLATE');
|
||||
$this->fileData['attachments'] = array(); //$rs->getString('APP_MSG_ATTACH');
|
||||
$this->fileData['error'] = $rs->getString('APP_MSG_ERROR');
|
||||
if ($this->config['MESS_ENGINE'] == 'OPENMAIL') {
|
||||
if ($this->config['MESS_SERVER'] != '') {
|
||||
if (($sAux = @gethostbyaddr( $this->config['MESS_SERVER'] ))) {
|
||||
if (($sAux = @gethostbyaddr($this->config['MESS_SERVER']))) {
|
||||
$this->fileData['domain'] = $sAux;
|
||||
} else {
|
||||
$this->fileData['domain'] = $this->config['MESS_SERVER'];
|
||||
}
|
||||
} else {
|
||||
$this->fileData['domain'] = gethostbyaddr( '127.0.0.1' );
|
||||
$this->fileData['domain'] = gethostbyaddr('127.0.0.1');
|
||||
}
|
||||
}
|
||||
$this->sendMail();
|
||||
@@ -127,7 +95,7 @@
|
||||
* @param array $aData
|
||||
* @return none
|
||||
*/
|
||||
public function create ($aData)
|
||||
public function create($aData)
|
||||
{
|
||||
if (is_array($aData['app_msg_attach'])) {
|
||||
$attachment = $aData['app_msg_attach'];
|
||||
@@ -139,16 +107,16 @@
|
||||
}
|
||||
$aData['app_msg_attach'] = serialize($attachment);
|
||||
$aData['app_msg_show_message'] = (isset($aData['app_msg_show_message'])) ? $aData['app_msg_show_message'] : 1;
|
||||
$aData["app_msg_error"] = (isset($aData["app_msg_error"]))? $aData["app_msg_error"] : '';
|
||||
$sUID = $this->db_insert( $aData );
|
||||
$aData["app_msg_error"] = (isset($aData["app_msg_error"])) ? $aData["app_msg_error"] : '';
|
||||
$sUID = $this->db_insert($aData);
|
||||
|
||||
$aData['app_msg_date'] = isset( $aData['app_msg_date'] ) ? $aData['app_msg_date'] : '';
|
||||
$aData['app_msg_date'] = isset($aData['app_msg_date']) ? $aData['app_msg_date'] : '';
|
||||
|
||||
if (isset( $aData['app_msg_status'] )) {
|
||||
$this->status = strtolower( $aData['app_msg_status'] );
|
||||
if (isset($aData['app_msg_status'])) {
|
||||
$this->status = strtolower($aData['app_msg_status']);
|
||||
}
|
||||
|
||||
$aData["contentTypeIsHtml"] = (isset($aData["contentTypeIsHtml"]))? $aData["contentTypeIsHtml"] : true;
|
||||
$aData["contentTypeIsHtml"] = (isset($aData["contentTypeIsHtml"])) ? $aData["contentTypeIsHtml"] : true;
|
||||
|
||||
$this->setData($sUID, $aData["app_msg_subject"], $aData["app_msg_from"], $aData["app_msg_to"], $aData["app_msg_body"], $aData["app_msg_date"], $aData["app_msg_cc"], $aData["app_msg_bcc"], $aData["app_msg_template"], $aData["app_msg_attach"], $aData["contentTypeIsHtml"], $aData["app_msg_error"]);
|
||||
}
|
||||
@@ -159,7 +127,7 @@
|
||||
* @param array $aConfig
|
||||
* @return none
|
||||
*/
|
||||
public function setConfig ($aConfig)
|
||||
public function setConfig($aConfig)
|
||||
{
|
||||
// Processing password
|
||||
$passwd = isset($aConfig['MESS_PASSWORD']) ? $aConfig['MESS_PASSWORD'] : '';
|
||||
@@ -176,17 +144,17 @@
|
||||
$aConfig['MESS_PASSWORD'] = $passwd;
|
||||
|
||||
// Validating authorization flag
|
||||
if(!isset($aConfig['SMTPAuth'])){
|
||||
if (isset($aConfig['MESS_RAUTH'])) {
|
||||
if ($aConfig['MESS_RAUTH'] == false || (is_string($aConfig['MESS_RAUTH']) && $aConfig['MESS_RAUTH'] == 'false')) {
|
||||
$aConfig['MESS_RAUTH'] = 0;
|
||||
} else {
|
||||
$aConfig['MESS_RAUTH'] = 1;
|
||||
}
|
||||
} else {
|
||||
$aConfig['MESS_RAUTH'] = 0;
|
||||
}
|
||||
$aConfig['SMTPAuth'] = $aConfig['MESS_RAUTH'];
|
||||
if (!isset($aConfig['SMTPAuth'])) {
|
||||
if (isset($aConfig['MESS_RAUTH'])) {
|
||||
if ($aConfig['MESS_RAUTH'] == false || (is_string($aConfig['MESS_RAUTH']) && $aConfig['MESS_RAUTH'] == 'false')) {
|
||||
$aConfig['MESS_RAUTH'] = 0;
|
||||
} else {
|
||||
$aConfig['MESS_RAUTH'] = 1;
|
||||
}
|
||||
} else {
|
||||
$aConfig['MESS_RAUTH'] = 0;
|
||||
}
|
||||
$aConfig['SMTPAuth'] = $aConfig['MESS_RAUTH'];
|
||||
}
|
||||
|
||||
// Validating for old configurations
|
||||
@@ -203,7 +171,7 @@
|
||||
/**
|
||||
* set email parameters
|
||||
*
|
||||
* @param string $sAppMsgUid, $sSubject, $sFrom, $sTo, $sBody, $sDate, $sCC, $sBCC, $sTemplate
|
||||
* @param string $sAppMsgUid , $sSubject, $sFrom, $sTo, $sBody, $sDate, $sCC, $sBCC, $sTemplate
|
||||
* @return none
|
||||
*/
|
||||
public function setData($sAppMsgUid, $sSubject, $sFrom, $sTo, $sBody, $sDate = "", $sCC = "", $sBCC = "", $sTemplate = "", $aAttachment = array(), $bContentTypeIsHtml = true, $sError = "")
|
||||
@@ -213,25 +181,25 @@
|
||||
$this->fileData['from'] = $sFrom;
|
||||
$this->fileData['to'] = $sTo;
|
||||
$this->fileData['body'] = $sBody;
|
||||
$this->fileData['date'] = ($sDate != '' ? $sDate : date( 'Y-m-d H:i:s' ));
|
||||
$this->fileData['date'] = ($sDate != '' ? $sDate : date('Y-m-d H:i:s'));
|
||||
$this->fileData['cc'] = $sCC;
|
||||
$this->fileData['bcc'] = $sBCC;
|
||||
$this->fileData['template'] = $sTemplate;
|
||||
$this->fileData['attachments'] = $aAttachment;
|
||||
$this->fileData['envelope_to'] = array ();
|
||||
$this->fileData['envelope_to'] = array();
|
||||
$this->fileData["contentTypeIsHtml"] = $bContentTypeIsHtml;
|
||||
$this->fileData["error"] = $sError;
|
||||
|
||||
if (array_key_exists('MESS_ENGINE',$this->config)) {
|
||||
if (array_key_exists('MESS_ENGINE', $this->config)) {
|
||||
if ($this->config['MESS_ENGINE'] == 'OPENMAIL') {
|
||||
if ($this->config['MESS_SERVER'] != '') {
|
||||
if (($sAux = @gethostbyaddr( $this->config['MESS_SERVER'] ))) {
|
||||
if (($sAux = @gethostbyaddr($this->config['MESS_SERVER']))) {
|
||||
$this->fileData['domain'] = $sAux;
|
||||
} else {
|
||||
$this->fileData['domain'] = $this->config['MESS_SERVER'];
|
||||
}
|
||||
} else {
|
||||
$this->fileData['domain'] = gethostbyaddr( '127.0.0.1' );
|
||||
$this->fileData['domain'] = gethostbyaddr('127.0.0.1');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -243,7 +211,7 @@
|
||||
* @param none
|
||||
* @return boolean true or exception
|
||||
*/
|
||||
public function sendMail ()
|
||||
public function sendMail()
|
||||
{
|
||||
try {
|
||||
$this->handleFrom();
|
||||
@@ -262,15 +230,15 @@
|
||||
* @param none
|
||||
* @return none
|
||||
*/
|
||||
private function updateSpoolStatus ()
|
||||
private function updateSpoolStatus()
|
||||
{
|
||||
$oAppMessage = AppMessagePeer::retrieveByPK( $this->spool_id );
|
||||
if (is_array( $this->fileData['attachments'] )) {
|
||||
$attachment = implode( ",", $this->fileData['attachments'] );
|
||||
$oAppMessage->setappMsgAttach( $attachment );
|
||||
$oAppMessage = AppMessagePeer::retrieveByPK($this->spool_id);
|
||||
if (is_array($this->fileData['attachments'])) {
|
||||
$attachment = implode(",", $this->fileData['attachments']);
|
||||
$oAppMessage->setappMsgAttach($attachment);
|
||||
}
|
||||
$oAppMessage->setappMsgstatus( $this->status );
|
||||
$oAppMessage->setappMsgsenddate( date( 'Y-m-d H:i:s' ) );
|
||||
$oAppMessage->setappMsgstatus($this->status);
|
||||
$oAppMessage->setappMsgsenddate(date('Y-m-d H:i:s'));
|
||||
$oAppMessage->save();
|
||||
}
|
||||
|
||||
@@ -280,35 +248,35 @@
|
||||
* @param none
|
||||
* @return boolean true or exception
|
||||
*/
|
||||
private function handleFrom ()
|
||||
private function handleFrom()
|
||||
{
|
||||
$eregA = "/^'.*@.*$/";
|
||||
|
||||
if (strpos( $this->fileData['from'], '<' ) !== false) {
|
||||
if (strpos($this->fileData['from'], '<') !== false) {
|
||||
//to validate complex email address i.e. Erik A. O <erik@colosa.com>
|
||||
$ereg = (preg_match($eregA, $this->fileData["from"]))? $this->longMailEreg : "/^(.*)(<(.*)>)$/";
|
||||
$ereg = (preg_match($eregA, $this->fileData["from"])) ? $this->longMailEreg : "/^(.*)(<(.*)>)$/";
|
||||
preg_match($ereg, $this->fileData["from"], $matches);
|
||||
|
||||
if (isset( $matches[1] ) && $matches[1] != '') {
|
||||
if (isset($matches[1]) && $matches[1] != '') {
|
||||
//drop the " characters if they exist
|
||||
$this->fileData['from_name'] = trim( str_replace( '"', '', $matches[1] ) );
|
||||
$this->fileData['from_name'] = trim(str_replace('"', '', $matches[1]));
|
||||
} else {
|
||||
//if the from name was not set
|
||||
$this->fileData['from_name'] = '';
|
||||
}
|
||||
|
||||
if (! isset( $matches[3] )) {
|
||||
throw new Exception( 'Invalid email address in FROM parameter (' . $this->fileData['from'] . ')', $this->ExceptionCode['WARNING'] );
|
||||
if (!isset($matches[3])) {
|
||||
throw new Exception('Invalid email address in FROM parameter (' . $this->fileData['from'] . ')', $this->ExceptionCode['WARNING']);
|
||||
}
|
||||
|
||||
$this->fileData['from_email'] = trim( $matches[3] );
|
||||
$this->fileData['from_email'] = trim($matches[3]);
|
||||
} else {
|
||||
//to validate simple email address i.e. erik@colosa.com
|
||||
$ereg = (preg_match($eregA, $this->fileData["from"]))? $this->mailEreg : "/^(.*)$/";
|
||||
$ereg = (preg_match($eregA, $this->fileData["from"])) ? $this->mailEreg : "/^(.*)$/";
|
||||
preg_match($ereg, $this->fileData["from"], $matches);
|
||||
|
||||
if (! isset( $matches[0] )) {
|
||||
throw new Exception( 'Invalid email address in FROM parameter (' . $this->fileData['from'] . ')', $this->ExceptionCode['WARNING'] );
|
||||
if (!isset($matches[0])) {
|
||||
throw new Exception('Invalid email address in FROM parameter (' . $this->fileData['from'] . ')', $this->ExceptionCode['WARNING']);
|
||||
}
|
||||
|
||||
$this->fileData['from_name'] = '';
|
||||
@@ -316,12 +284,12 @@
|
||||
}
|
||||
|
||||
// Set reply to
|
||||
preg_match( $this->longMailEreg, $this->fileData['from_name'], $matches );
|
||||
preg_match($this->longMailEreg, $this->fileData['from_name'], $matches);
|
||||
if (isset($matches[3])) {
|
||||
$this->fileData['reply_to'] = $matches[3];
|
||||
$this->fileData['reply_to_name'] = isset($matches[1]) ? $matches[1] : $this->fileData['from_name'];
|
||||
} else {
|
||||
preg_match( $this->mailEreg, $this->fileData['from_name'], $matches );
|
||||
preg_match($this->mailEreg, $this->fileData['from_name'], $matches);
|
||||
if (isset($matches[1])) {
|
||||
$this->fileData['reply_to'] = $matches[1];
|
||||
$this->fileData['reply_to_name'] = '';
|
||||
@@ -339,65 +307,65 @@
|
||||
* @param none
|
||||
* @return boolean true or exception
|
||||
*/
|
||||
private function handleEnvelopeTo ()
|
||||
private function handleEnvelopeTo()
|
||||
{
|
||||
$hold = array ();
|
||||
$holdcc = array ();
|
||||
$holdbcc = array ();
|
||||
$text = trim( $this->fileData['to'] );
|
||||
$hold = array();
|
||||
$holdcc = array();
|
||||
$holdbcc = array();
|
||||
$text = trim($this->fileData['to']);
|
||||
|
||||
$textcc = '';
|
||||
$textbcc = '';
|
||||
if (isset( $this->fileData['cc'] ) && trim( $this->fileData['cc'] ) != '') {
|
||||
$textcc = trim( $this->fileData['cc'] );
|
||||
if (isset($this->fileData['cc']) && trim($this->fileData['cc']) != '') {
|
||||
$textcc = trim($this->fileData['cc']);
|
||||
}
|
||||
|
||||
if (isset( $this->fileData['bcc'] ) && trim( $this->fileData['bcc'] ) != '') {
|
||||
$textbcc = trim( $this->fileData['bcc'] );
|
||||
if (isset($this->fileData['bcc']) && trim($this->fileData['bcc']) != '') {
|
||||
$textbcc = trim($this->fileData['bcc']);
|
||||
}
|
||||
|
||||
if (false !== (strpos( $text, ',' ))) {
|
||||
$hold = explode( ',', $text );
|
||||
if (false !== (strpos($text, ','))) {
|
||||
$hold = explode(',', $text);
|
||||
|
||||
foreach ($hold as $val) {
|
||||
if (strlen( $val ) > 0) {
|
||||
if (strlen($val) > 0) {
|
||||
$this->fileData['envelope_to'][] = "$val";
|
||||
}
|
||||
}
|
||||
} elseif ($text != '') {
|
||||
$this->fileData['envelope_to'][] = "$text";
|
||||
} else {
|
||||
$this->fileData['envelope_to'] = Array ();
|
||||
$this->fileData['envelope_to'] = Array();
|
||||
}
|
||||
|
||||
//CC
|
||||
if (false !== (strpos( $textcc, ',' ))) {
|
||||
$holdcc = explode( ',', $textcc );
|
||||
if (false !== (strpos($textcc, ','))) {
|
||||
$holdcc = explode(',', $textcc);
|
||||
|
||||
foreach ($holdcc as $valcc) {
|
||||
if (strlen( $valcc ) > 0) {
|
||||
if (strlen($valcc) > 0) {
|
||||
$this->fileData['envelope_cc'][] = "$valcc";
|
||||
}
|
||||
}
|
||||
} elseif ($textcc != '') {
|
||||
$this->fileData['envelope_cc'][] = "$textcc";
|
||||
} else {
|
||||
$this->fileData['envelope_cc'] = Array ();
|
||||
$this->fileData['envelope_cc'] = Array();
|
||||
}
|
||||
|
||||
//BCC
|
||||
if (false !== (strpos( $textbcc, ',' ))) {
|
||||
$holdbcc = explode( ',', $textbcc );
|
||||
if (false !== (strpos($textbcc, ','))) {
|
||||
$holdbcc = explode(',', $textbcc);
|
||||
|
||||
foreach ($holdbcc as $valbcc) {
|
||||
if (strlen( $valbcc ) > 0) {
|
||||
if (strlen($valbcc) > 0) {
|
||||
$this->fileData['envelope_bcc'][] = "$valbcc";
|
||||
}
|
||||
}
|
||||
} elseif ($textbcc != '') {
|
||||
$this->fileData['envelope_bcc'][] = "$textbcc";
|
||||
} else {
|
||||
$this->fileData['envelope_bcc'] = Array ();
|
||||
$this->fileData['envelope_bcc'] = Array();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -408,121 +376,121 @@
|
||||
* @param none
|
||||
* @return none
|
||||
*/
|
||||
private function handleMail ()
|
||||
private function handleMail()
|
||||
{
|
||||
if (count( $this->fileData['envelope_to'] ) > 0) {
|
||||
if (array_key_exists('MESS_ENGINE',$this->config)) {
|
||||
if (count($this->fileData['envelope_to']) > 0) {
|
||||
if (array_key_exists('MESS_ENGINE', $this->config)) {
|
||||
switch ($this->config['MESS_ENGINE']) {
|
||||
case 'MAIL':
|
||||
case 'PHPMAILER':
|
||||
|
||||
|
||||
|
||||
switch ($this->config['MESS_ENGINE']) {
|
||||
case 'MAIL':
|
||||
$oPHPMailer = new PHPMailer();
|
||||
$oPHPMailer->Mailer = 'mail';
|
||||
break;
|
||||
case 'PHPMAILER':
|
||||
$oPHPMailer = new PHPMailer( true );
|
||||
$oPHPMailer = new PHPMailer(true);
|
||||
$oPHPMailer->Mailer = 'smtp';
|
||||
break;
|
||||
}
|
||||
|
||||
$oPHPMailer->SMTPAuth = (isset( $this->config['SMTPAuth'] ) ? $this->config['SMTPAuth'] : '');
|
||||
|
||||
|
||||
$oPHPMailer->SMTPAuth = (isset($this->config['SMTPAuth']) ? $this->config['SMTPAuth'] : '');
|
||||
|
||||
switch ($this->config['MESS_ENGINE']) {
|
||||
case 'MAIL':
|
||||
break;
|
||||
case 'PHPMAILER':
|
||||
//Posible Options for SMTPSecure are: "", "ssl" or "tls"
|
||||
if (isset( $this->config['SMTPSecure'] ) && preg_match( '/^(ssl|tls)$/', $this->config['SMTPSecure'] )) {
|
||||
if (isset($this->config['SMTPSecure']) && preg_match('/^(ssl|tls)$/', $this->config['SMTPSecure'])) {
|
||||
$oPHPMailer->SMTPSecure = $this->config['SMTPSecure'];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
$oPHPMailer->CharSet = "UTF-8";
|
||||
$oPHPMailer->Encoding = "8bit";
|
||||
$oPHPMailer->Host = $this->config['MESS_SERVER'];
|
||||
$oPHPMailer->Port = $this->config['MESS_PORT'];
|
||||
$oPHPMailer->Username = $this->config['MESS_ACCOUNT'];
|
||||
$oPHPMailer->Password = $this->config['MESS_PASSWORD'];
|
||||
$oPHPMailer->SetFrom($this->fileData['from_email'], utf8_decode($this->fileData['from_name']));
|
||||
|
||||
$oPHPMailer->SetFrom($this->fileData['from_email'], utf8_decode($this->fileData['from_name']));
|
||||
|
||||
if (isset($this->fileData['reply_to'])) {
|
||||
if ($this->fileData['reply_to'] != '') {
|
||||
$oPHPMailer->AddReplyTo($this->fileData['reply_to'], $this->fileData['reply_to_name']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$msSubject = $this->fileData['subject'];
|
||||
|
||||
if (! (mb_detect_encoding( $msSubject, "UTF-8" ) == "UTF-8")) {
|
||||
$msSubject = utf8_encode( $msSubject );
|
||||
|
||||
if (!(mb_detect_encoding($msSubject, "UTF-8") == "UTF-8")) {
|
||||
$msSubject = utf8_encode($msSubject);
|
||||
}
|
||||
|
||||
|
||||
$oPHPMailer->Subject = $msSubject;
|
||||
|
||||
|
||||
$msBody = $this->fileData['body'];
|
||||
|
||||
if (! (mb_detect_encoding( $msBody, "UTF-8" ) == "UTF-8")) {
|
||||
$msBody = utf8_encode( $msBody );
|
||||
|
||||
if (!(mb_detect_encoding($msBody, "UTF-8") == "UTF-8")) {
|
||||
$msBody = utf8_encode($msBody);
|
||||
}
|
||||
|
||||
|
||||
$oPHPMailer->Body = $msBody;
|
||||
|
||||
|
||||
$attachment = @unserialize($this->fileData['attachments']);
|
||||
if ($attachment === false) {
|
||||
$attachment = $this->fileData['attachments'];
|
||||
}
|
||||
if (is_array($attachment)) {
|
||||
foreach ($attachment as $key => $fileAttach) {
|
||||
if (file_exists( $fileAttach )) {
|
||||
$oPHPMailer->AddAttachment( $fileAttach, is_int( $key ) ? '' : $key );
|
||||
if (file_exists($fileAttach)) {
|
||||
$oPHPMailer->AddAttachment($fileAttach, is_int($key) ? '' : $key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach ($this->fileData['envelope_to'] as $sEmail) {
|
||||
if (strpos( $sEmail, '<' ) !== false) {
|
||||
preg_match( $this->longMailEreg, $sEmail, $matches );
|
||||
$sTo = trim( $matches[3] );
|
||||
$sToName = trim( $matches[1] );
|
||||
$oPHPMailer->AddAddress( $sTo, $sToName );
|
||||
if (strpos($sEmail, '<') !== false) {
|
||||
preg_match($this->longMailEreg, $sEmail, $matches);
|
||||
$sTo = trim($matches[3]);
|
||||
$sToName = trim($matches[1]);
|
||||
$oPHPMailer->AddAddress($sTo, $sToName);
|
||||
} else {
|
||||
$oPHPMailer->AddAddress( $sEmail );
|
||||
$oPHPMailer->AddAddress($sEmail);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//CC
|
||||
foreach ($this->fileData['envelope_cc'] as $sEmail) {
|
||||
if (strpos( $sEmail, '<' ) !== false) {
|
||||
preg_match( $this->longMailEreg, $sEmail, $matches );
|
||||
$sTo = trim( $matches[3] );
|
||||
$sToName = trim( $matches[1] );
|
||||
$oPHPMailer->AddCC( $sTo, $sToName );
|
||||
if (strpos($sEmail, '<') !== false) {
|
||||
preg_match($this->longMailEreg, $sEmail, $matches);
|
||||
$sTo = trim($matches[3]);
|
||||
$sToName = trim($matches[1]);
|
||||
$oPHPMailer->AddCC($sTo, $sToName);
|
||||
} else {
|
||||
$oPHPMailer->AddCC( $sEmail );
|
||||
$oPHPMailer->AddCC($sEmail);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//BCC
|
||||
foreach ($this->fileData['envelope_bcc'] as $sEmail) {
|
||||
if (strpos( $sEmail, '<' ) !== false) {
|
||||
preg_match( $this->longMailEreg, $sEmail, $matches );
|
||||
$sTo = trim( $matches[3] );
|
||||
$sToName = trim( $matches[1] );
|
||||
$oPHPMailer->AddBCC( $sTo, $sToName );
|
||||
if (strpos($sEmail, '<') !== false) {
|
||||
preg_match($this->longMailEreg, $sEmail, $matches);
|
||||
$sTo = trim($matches[3]);
|
||||
$sToName = trim($matches[1]);
|
||||
$oPHPMailer->AddBCC($sTo, $sToName);
|
||||
} else {
|
||||
$oPHPMailer->AddBCC( $sEmail );
|
||||
$oPHPMailer->AddBCC($sEmail);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$oPHPMailer->IsHTML($this->fileData["contentTypeIsHtml"]);
|
||||
|
||||
if ( $this->config['MESS_ENGINE'] == 'MAIL') {
|
||||
|
||||
if ($this->config['MESS_ENGINE'] == 'MAIL') {
|
||||
$oPHPMailer->WordWrap = 300;
|
||||
}
|
||||
|
||||
|
||||
if ($oPHPMailer->Send()) {
|
||||
$this->error = '';
|
||||
$this->status = 'sent';
|
||||
@@ -532,38 +500,38 @@
|
||||
}
|
||||
break;
|
||||
case 'OPENMAIL':
|
||||
$pack = new package( $this->fileData );
|
||||
$pack = new package($this->fileData);
|
||||
$header = $pack->returnHeader();
|
||||
$body = $pack->returnBody();
|
||||
$send = new smtp();
|
||||
$send->setServer( $this->config['MESS_SERVER'] );
|
||||
$send->setPort( $this->config['MESS_PORT'] );
|
||||
$send->setUsername( $this->config['MESS_ACCOUNT'] );
|
||||
|
||||
$send->setServer($this->config['MESS_SERVER']);
|
||||
$send->setPort($this->config['MESS_PORT']);
|
||||
$send->setUsername($this->config['MESS_ACCOUNT']);
|
||||
|
||||
$passwd = $this->config['MESS_PASSWORD'];
|
||||
$passwdDec = G::decrypt( $passwd, 'EMAILENCRYPT' );
|
||||
$auxPass = explode( 'hash:', $passwdDec );
|
||||
|
||||
if (count( $auxPass ) > 1) {
|
||||
if (count( $auxPass ) == 2) {
|
||||
$passwdDec = G::decrypt($passwd, 'EMAILENCRYPT');
|
||||
$auxPass = explode('hash:', $passwdDec);
|
||||
|
||||
if (count($auxPass) > 1) {
|
||||
if (count($auxPass) == 2) {
|
||||
$passwd = $auxPass[1];
|
||||
} else {
|
||||
array_shift( $auxPass );
|
||||
$passwd = implode( '', $auxPass );
|
||||
array_shift($auxPass);
|
||||
$passwd = implode('', $auxPass);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->config['MESS_PASSWORD'] = $passwd;
|
||||
$send->setPassword( $this->config['MESS_PASSWORD'] );
|
||||
$send->setReturnPath( $this->fileData['from_email'] );
|
||||
$send->setHeaders( $header );
|
||||
$send->setBody( $body );
|
||||
$send->setEnvelopeTo( $this->fileData['envelope_to'] );
|
||||
$send->setPassword($this->config['MESS_PASSWORD']);
|
||||
$send->setReturnPath($this->fileData['from_email']);
|
||||
$send->setHeaders($header);
|
||||
$send->setBody($body);
|
||||
$send->setEnvelopeTo($this->fileData['envelope_to']);
|
||||
if ($send->sendMessage()) {
|
||||
$this->error = '';
|
||||
$this->status = 'sent';
|
||||
} else {
|
||||
$this->error = implode( ', ', $send->returnErrors() );
|
||||
$this->error = implode(', ', $send->returnErrors());
|
||||
$this->status = 'failed';
|
||||
}
|
||||
break;
|
||||
@@ -578,7 +546,7 @@
|
||||
* @param string $dateResend
|
||||
* @return none or exception
|
||||
*/
|
||||
public function resendEmails ($dateResend = null, $cron = 0)
|
||||
public function resendEmails($dateResend = null, $cron = 0)
|
||||
{
|
||||
$aConfiguration = PmSystem::getEmailConfiguration();
|
||||
|
||||
@@ -587,25 +555,25 @@
|
||||
}
|
||||
|
||||
if ($aConfiguration["MESS_ENABLED"] == "1") {
|
||||
require_once ("classes/model/AppMessage.php");
|
||||
require_once("classes/model/AppMessage.php");
|
||||
|
||||
$this->setConfig($aConfiguration);
|
||||
|
||||
$criteria = new Criteria( "workflow" );
|
||||
$criteria->add( AppMessagePeer::APP_MSG_STATUS, "sent", Criteria::NOT_EQUAL );
|
||||
$criteria = new Criteria("workflow");
|
||||
$criteria->add(AppMessagePeer::APP_MSG_STATUS, "sent", Criteria::NOT_EQUAL);
|
||||
|
||||
if ($dateResend != null) {
|
||||
$criteria->add( AppMessagePeer::APP_MSG_DATE, $dateResend, Criteria::GREATER_EQUAL );
|
||||
$criteria->add(AppMessagePeer::APP_MSG_DATE, $dateResend, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
$rsCriteria = AppMessagePeer::doSelectRS( $criteria );
|
||||
$rsCriteria->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$rsCriteria = AppMessagePeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
if ($cron == 1) {
|
||||
$arrayCron = unserialize( trim( @file_get_contents( PATH_DATA . "cron" ) ) );
|
||||
$arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
@file_put_contents( PATH_DATA . "cron", serialize( $arrayCron ) );
|
||||
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
|
||||
}
|
||||
|
||||
$row = $rsCriteria->getRow();
|
||||
@@ -613,17 +581,17 @@
|
||||
try {
|
||||
$sFrom = G::buildFrom($aConfiguration, $row["APP_MSG_FROM"]);
|
||||
|
||||
$this->setData( $row["APP_MSG_UID"], $row["APP_MSG_SUBJECT"], $sFrom, $row["APP_MSG_TO"], $row["APP_MSG_BODY"], date( "Y-m-d H:i:s" ), $row["APP_MSG_CC"], $row["APP_MSG_BCC"], $row["APP_MSG_TEMPLATE"], $row["APP_MSG_ATTACH"] );
|
||||
$this->setData($row["APP_MSG_UID"], $row["APP_MSG_SUBJECT"], $sFrom, $row["APP_MSG_TO"], $row["APP_MSG_BODY"], date("Y-m-d H:i:s"), $row["APP_MSG_CC"], $row["APP_MSG_BCC"], $row["APP_MSG_TEMPLATE"], $row["APP_MSG_ATTACH"]);
|
||||
|
||||
$this->sendMail();
|
||||
} catch (Exception $e) {
|
||||
$strAux = "Spool::resendEmails(): Using " . $aConfiguration["MESS_ENGINE"] . " for APP_MGS_UID=" . $row["APP_MSG_UID"] . " -> With message: " . $e->getMessage();
|
||||
|
||||
if ($e->getCode() == $this->ExceptionCode["WARNING"]) {
|
||||
array_push( $this->aWarnings, $strAux );
|
||||
array_push($this->aWarnings, $strAux);
|
||||
continue;
|
||||
} else {
|
||||
error_log('<400> '.$strAux);
|
||||
error_log('<400> ' . $strAux);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -637,9 +605,9 @@
|
||||
* @param none
|
||||
* @return string $this->aWarnings
|
||||
*/
|
||||
public function getWarnings ()
|
||||
public function getWarnings()
|
||||
{
|
||||
if (sizeof( $this->aWarnings ) != 0) {
|
||||
if (sizeof($this->aWarnings) != 0) {
|
||||
return $this->aWarnings;
|
||||
}
|
||||
|
||||
@@ -652,36 +620,36 @@
|
||||
* @param array $db_spool
|
||||
* @return string $sUID;
|
||||
*/
|
||||
public function db_insert ($db_spool)
|
||||
public function db_insert($db_spool)
|
||||
{
|
||||
$sUID = G::generateUniqueID();
|
||||
$spool = new AppMessage();
|
||||
$spool->setAppMsgUid( $sUID );
|
||||
$spool->setMsgUid( $db_spool['msg_uid'] );
|
||||
$spool->setAppUid( $db_spool['app_uid'] );
|
||||
$spool->setDelIndex( $db_spool['del_index'] );
|
||||
$spool->setAppMsgType( $db_spool['app_msg_type'] );
|
||||
$spool->setAppMsgSubject( $db_spool['app_msg_subject'] );
|
||||
$spool->setAppMsgFrom( $db_spool['app_msg_from'] );
|
||||
$spool->setAppMsgTo( $db_spool['app_msg_to'] );
|
||||
$spool->setAppMsgBody( $db_spool['app_msg_body'] );
|
||||
$spool->setAppMsgDate( date( 'Y-m-d H:i:s' ) );
|
||||
$spool->setAppMsgCc( $db_spool['app_msg_cc'] );
|
||||
$spool->setAppMsgBcc( $db_spool['app_msg_bcc'] );
|
||||
$spool->setappMsgAttach( $db_spool['app_msg_attach'] );
|
||||
$spool->setAppMsgTemplate( $db_spool['app_msg_template'] );
|
||||
$spool->setAppMsgStatus( $db_spool['app_msg_status'] );
|
||||
$spool->setAppMsgSendDate( date( 'Y-m-d H:i:s' ) ); // Add by Ankit
|
||||
$spool->setAppMsgShowMessage( $db_spool['app_msg_show_message'] ); // Add by Ankit
|
||||
$spool->setAppMsgError( $db_spool['app_msg_error'] );
|
||||
$spool->setAppMsgUid($sUID);
|
||||
$spool->setMsgUid($db_spool['msg_uid']);
|
||||
$spool->setAppUid($db_spool['app_uid']);
|
||||
$spool->setDelIndex($db_spool['del_index']);
|
||||
$spool->setAppMsgType($db_spool['app_msg_type']);
|
||||
$spool->setAppMsgSubject($db_spool['app_msg_subject']);
|
||||
$spool->setAppMsgFrom($db_spool['app_msg_from']);
|
||||
$spool->setAppMsgTo($db_spool['app_msg_to']);
|
||||
$spool->setAppMsgBody($db_spool['app_msg_body']);
|
||||
$spool->setAppMsgDate(date('Y-m-d H:i:s'));
|
||||
$spool->setAppMsgCc($db_spool['app_msg_cc']);
|
||||
$spool->setAppMsgBcc($db_spool['app_msg_bcc']);
|
||||
$spool->setappMsgAttach($db_spool['app_msg_attach']);
|
||||
$spool->setAppMsgTemplate($db_spool['app_msg_template']);
|
||||
$spool->setAppMsgStatus($db_spool['app_msg_status']);
|
||||
$spool->setAppMsgSendDate(date('Y-m-d H:i:s')); // Add by Ankit
|
||||
$spool->setAppMsgShowMessage($db_spool['app_msg_show_message']); // Add by Ankit
|
||||
$spool->setAppMsgError($db_spool['app_msg_error']);
|
||||
|
||||
|
||||
if (! $spool->validate()) {
|
||||
if (!$spool->validate()) {
|
||||
$errors = $spool->getValidationFailures();
|
||||
$this->status = 'error';
|
||||
|
||||
foreach ($errors as $key => $value) {
|
||||
echo "Validation error - " . $value->getMessage( $key ) . "\n";
|
||||
echo "Validation error - " . $value->getMessage($key) . "\n";
|
||||
}
|
||||
} else {
|
||||
//echo "Saving - validation ok\n";
|
||||
|
||||
@@ -3588,7 +3588,7 @@ class WorkspaceTools
|
||||
$conf = new Configurations();
|
||||
if (!$conf->exists('AUDIT_LOG', 'log')) {
|
||||
CLI::logging("> Updating Auditlog Config \n");
|
||||
$oServerConf = &serverConf::getSingleton();
|
||||
$oServerConf = &ServerConf::getSingleton();
|
||||
$sAudit = $oServerConf->getAuditLogProperty('AL_OPTION', $workspace);
|
||||
$conf->aConfig = ($sAudit == 1) ? 'true' : 'false';
|
||||
$conf->saveConfig('AUDIT_LOG', 'log');
|
||||
|
||||
@@ -891,7 +891,7 @@ class WsBase
|
||||
$msgError = "The default configuration wasn't defined";
|
||||
}
|
||||
|
||||
$oSpool = new spoolRun();
|
||||
$oSpool = new SpoolRun();
|
||||
|
||||
$oSpool->setConfig($aSetup);
|
||||
|
||||
|
||||
@@ -181,7 +181,7 @@ class AppNotes extends BaseAppNotes
|
||||
$aUser = $oUser->load( $recipientUid );
|
||||
|
||||
$sTo = ((($aUser['USR_FIRSTNAME'] != '') || ($aUser['USR_LASTNAME'] != '')) ? $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' ' : '') . '<' . $aUser['USR_EMAIL'] . '>';
|
||||
$oSpool = new spoolRun();
|
||||
$oSpool = new SpoolRun();
|
||||
|
||||
$oSpool->setConfig($aConfiguration);
|
||||
$oSpool->create(
|
||||
|
||||
@@ -885,7 +885,7 @@ class OutputDocument extends BaseOutputDocument
|
||||
$pdf->SetRightMargin($margins['right']);
|
||||
$pdf->SetAutoPageBreak(true, $margins['bottom']);
|
||||
|
||||
$oServerConf = &serverConf::getSingleton();
|
||||
$oServerConf = &ServerConf::getSingleton();
|
||||
|
||||
// set some language dependent data:
|
||||
$lg = array();
|
||||
|
||||
@@ -619,7 +619,7 @@ class adminProxy extends HttpProxyController
|
||||
$sBodyPre->assign('msg', $msg);
|
||||
$sBody = $sBodyPre->getOutputContent();
|
||||
|
||||
$oSpool = new spoolRun();
|
||||
$oSpool = new SpoolRun();
|
||||
|
||||
$oSpool->setConfig($aConfiguration);
|
||||
|
||||
@@ -1384,7 +1384,7 @@ class adminProxy extends HttpProxyController
|
||||
require_once (PATH_CONTROLLERS . "installer.php");
|
||||
$params = array ();
|
||||
|
||||
$oServerConf = &serverConf::getSingleton();
|
||||
$oServerConf = &ServerConf::getSingleton();
|
||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||
$licenseManager = &PmLicenseManager::getSingleton();
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ class Home extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
$oServerConf = & serverConf::getSingleton();
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
|
||||
if ($oServerConf->isRtl( SYS_LANG )) {
|
||||
$swRtl = 1;
|
||||
|
||||
@@ -199,7 +199,7 @@ class Main extends Controller
|
||||
|
||||
if (($nextBeatDate = $this->memcache->get( 'nextBeatDate' )) === false) {
|
||||
//get the serverconf singleton, and check if we can send the heartbeat
|
||||
$oServerConf = & serverConf::getSingleton();
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
$sflag = $oServerConf->getHeartbeatProperty( 'HB_OPTION', 'HEART_BEAT_CONF' );
|
||||
$sflag = (trim( $sflag ) != '') ? $sflag : '1';
|
||||
//get date of next beat
|
||||
@@ -305,7 +305,7 @@ class Main extends Controller
|
||||
$aField['LOGIN_VERIFY_MSG'] = G::loadTranslation( 'LOGIN_VERIFY_MSG' );
|
||||
|
||||
//Get Server Configuration
|
||||
$oServerConf = & serverConf::getSingleton();
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
|
||||
$availableLangArray = $this->getLanguagesList();
|
||||
|
||||
@@ -515,7 +515,7 @@ class Main extends Controller
|
||||
|
||||
private function getWorkspacesAvailable ()
|
||||
{
|
||||
$oServerConf = & serverConf::getSingleton();
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
$dir = PATH_DB;
|
||||
$filesArray = array ();
|
||||
if (file_exists( $dir )) {
|
||||
|
||||
@@ -267,7 +267,7 @@ class pmTablesProxy extends HttpProxyController
|
||||
}
|
||||
|
||||
if ($row->type == 'CLASSIC') {
|
||||
$rp = new reportTables();
|
||||
$rp = new ReportTables();
|
||||
$rp->deleteReportTable( $row->id );
|
||||
$count ++;
|
||||
} else {
|
||||
|
||||
@@ -194,7 +194,7 @@ if ($actionAjax == 'sendMailMessage_JXP') {
|
||||
|
||||
$aSetup = PmSystem::getEmailConfiguration();
|
||||
|
||||
$oSpool = new spoolRun();
|
||||
$oSpool = new SpoolRun();
|
||||
|
||||
$oSpool->setConfig($aSetup);
|
||||
$oSpool->create( array ('msg_uid' => $data['MSG_UID'],'app_uid' => $data['APP_UID'],'del_index' => $data['DEL_INDEX'],'app_msg_type' => $data['APP_MSG_TYPE'],'app_msg_subject' => $data['APP_MSG_SUBJECT'],'app_msg_from' => $data['APP_MSG_FROM'],'app_msg_to' => $data['APP_MSG_TO'],'app_msg_body' => $data['APP_MSG_BODY'],'app_msg_cc' => $data['APP_MSG_CC'],'app_msg_bcc' => $data['APP_MSG_BCC'],'app_msg_attach' => $data['APP_MSG_ATTACH'],'app_msg_template' => $data['APP_MSG_TEMPLATE'],'app_msg_status' => 'pending'
|
||||
|
||||
@@ -805,7 +805,7 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
|
||||
$aSetup['MESS_RAUTH'] = 1;
|
||||
}
|
||||
|
||||
$oSpool = new spoolRun();
|
||||
$oSpool = new SpoolRun();
|
||||
$oSpool->setConfig(
|
||||
array (
|
||||
'MESS_ENGINE' => $aSetup['MESS_ENGINE'],
|
||||
|
||||
@@ -122,7 +122,7 @@ if (isset($_SESSION['__OPEN_APPLICATION_UID__'])) {
|
||||
}
|
||||
}
|
||||
|
||||
$oServerConf = & serverConf::getSingleton();
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
if ($oServerConf->isRtl( SYS_LANG )) {
|
||||
$regionTreePanel = 'east';
|
||||
$regionDebug = 'west';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
try {
|
||||
if (isset( $_REQUEST['status'] )) {
|
||||
$oServerConf = & serverConf::getSingleton();
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
/*you can use SYS_TEMP or SYS_SYS ON HEAR_BEAT_CONF to save for each workspace*/
|
||||
if ($_REQUEST['status']) {
|
||||
echo "ACTIVE (Thanks!)";
|
||||
|
||||
@@ -293,7 +293,7 @@ try {
|
||||
unset($_SESSION['FAILED_LOGINS']);
|
||||
|
||||
// increment logins in heartbeat
|
||||
$oServerConf =& serverConf::getSingleton();
|
||||
$oServerConf =& ServerConf::getSingleton();
|
||||
$oServerConf->sucessfulLogin();
|
||||
|
||||
// Assign the uid of user to userloggedobj
|
||||
|
||||
@@ -312,7 +312,7 @@ if ($version >= 3) {
|
||||
}
|
||||
|
||||
//get the serverconf singleton, and check if we can send the heartbeat
|
||||
$oServerConf = & serverConf::getSingleton();
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
$partnerFlag = (defined('PARTNER_FLAG')) ? PARTNER_FLAG : false;
|
||||
if (!$partnerFlag) {
|
||||
$sflag = $oServerConf->getHeartbeatProperty('HB_OPTION', 'HEART_BEAT_CONF');
|
||||
|
||||
@@ -57,7 +57,7 @@ if ($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL'
|
||||
<a href='http://www.processmaker.com' style='color:#c40000;'>www.processmaker.com</a><br /></td>
|
||||
</tr></tbody></table>";
|
||||
|
||||
$oSpool = new spoolRun();
|
||||
$oSpool = new SpoolRun();
|
||||
|
||||
$oSpool->setConfig($aSetup);
|
||||
$oSpool->create(array(
|
||||
|
||||
@@ -86,7 +86,7 @@ function getLangFiles()
|
||||
|
||||
function getWorkspacesAvailable()
|
||||
{
|
||||
$oServerConf = & serverConf::getSingleton ();
|
||||
$oServerConf = & ServerConf::getSingleton ();
|
||||
$dir = PATH_DB;
|
||||
$filesArray = array ();
|
||||
if (file_exists ($dir)) {
|
||||
@@ -156,7 +156,7 @@ $version = isset($version[0]) ? intval($version[0]) : 0;
|
||||
switch (WS_IN_LOGIN) {
|
||||
case 'serverconf':
|
||||
//Get Server Configuration
|
||||
$oServerConf = & serverConf::getSingleton ();
|
||||
$oServerConf = & ServerConf::getSingleton ();
|
||||
if ($oServerConf->getProperty ('LOGIN_NO_WS')) {
|
||||
$fileLogin = $version >= 3 ? 'login/sysLoginNoWSpm3' : 'login/sysLoginNoWS';
|
||||
} else {
|
||||
|
||||
@@ -267,7 +267,7 @@ switch ($action) {
|
||||
case 'delete':
|
||||
|
||||
$rows = G::json_decode( $_REQUEST['rows'] );
|
||||
$rp = new reportTables();
|
||||
$rp = new ReportTables();
|
||||
$at = new AdditionalTables();
|
||||
|
||||
try {
|
||||
|
||||
@@ -4,7 +4,7 @@ global $G_TMP_MENU;
|
||||
switch ($_GET['action']) {
|
||||
case 'saveOption':
|
||||
try {
|
||||
$oServerConf = & serverConf::getSingleton();
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
$response = new $oServerConf;
|
||||
$conf = new Configurations();
|
||||
/*you can use SYS_TEMP or SYS_SYS ON AUDIT_LOG_CONF to save for each workspace*/
|
||||
|
||||
@@ -26,7 +26,7 @@ $G_SUB_MENU = 'setup';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_ID_SUB_MENU_SELECTED = 'MAILSYSTEM';
|
||||
|
||||
$run = new spoolRun();
|
||||
$run = new SpoolRun();
|
||||
unset( $run );
|
||||
|
||||
$Fields['MESSAGE'] = 'Hello world, this is my first email ... ';
|
||||
|
||||
@@ -256,7 +256,7 @@ function sendTestMail ()
|
||||
<a href='http://www.processmaker.com' style='color:#c40000;'>www.processmaker.com</a><br /></td>
|
||||
</tr></tbody></table>";
|
||||
|
||||
$oSpool = new spoolRun();
|
||||
$oSpool = new SpoolRun();
|
||||
|
||||
$passwd = $_POST['MESS_PASSWORD'];
|
||||
$passwdDec = G::decrypt( $passwd, 'EMAILENCRYPT' );
|
||||
|
||||
@@ -27,7 +27,7 @@ $RBAC->requirePermissions( 'PM_SETUP' );
|
||||
$oConf = new Configurations();
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oServerConf = & serverConf::getSingleton();
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
|
||||
$oHeadPublisher->addExtJsScript( 'setup/loginSettings', true ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'setup/loginSettings' ); //adding a html file .html.
|
||||
|
||||
@@ -93,7 +93,7 @@ $oHeadPublisher->assign( "tabActive", $tabActive );
|
||||
$oHeadPublisher->assign( "tabItems", $tabItems );
|
||||
$oHeadPublisher->assign( "_item_selected", (($adminSelected != null) ? $adminSelected : "") );
|
||||
|
||||
$oServerConf = & serverConf::getSingleton();
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
if ($oServerConf->isRtl( SYS_LANG )) {
|
||||
$regionTreePanel = 'east';
|
||||
$regionDebug = 'west';
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
switch ($_GET['action']) {
|
||||
case 'saveOption':
|
||||
try {
|
||||
$oServerConf = & serverConf::getSingleton();
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
$response = new stdclass();
|
||||
/*you can use SYS_TEMP or SYS_SYS ON HEAR_BEAT_CONF to save for each workspace*/
|
||||
$oServerConf->unsetHeartbeatProperty( 'HB_BEAT_TYPE', 'HEART_BEAT_CONF' );
|
||||
|
||||
@@ -25,7 +25,7 @@ global $RBAC;
|
||||
$RBAC->requirePermissions( 'PM_SETUP', 'PM_SETUP_HEART_BEAT');
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oServerConf = & serverConf::getSingleton();
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
|
||||
//you can use SYS_TEMP or SYS_SYS ON HEAR_BEAT_CONF to save for each workspace
|
||||
$sflag = $oServerConf->getHeartbeatProperty( 'HB_OPTION', 'HEART_BEAT_CONF' );
|
||||
|
||||
@@ -6,7 +6,7 @@ if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_SETUP_A
|
||||
die();
|
||||
}
|
||||
try {
|
||||
$oServerConf = & serverConf::getSingleton();
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
/*you can use SYS_TEMP or SYS_SYS ON HEAR_BEAT_CONF to save for each workspace*/
|
||||
$sflag = $_POST['HB_OPTION'];
|
||||
$oServerConf->unsetHeartbeatProperty( 'HB_BEAT_TYPE', 'HEART_BEAT_CONF' );
|
||||
|
||||
@@ -229,7 +229,7 @@ class SkinEngine
|
||||
private function _extjs()
|
||||
{
|
||||
|
||||
$oServerConf =& serverConf::getSingleton();
|
||||
$oServerConf =& ServerConf::getSingleton();
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
|
||||
if( $oHeadPublisher->extJsInit === true){
|
||||
@@ -303,7 +303,7 @@ class SkinEngine
|
||||
}
|
||||
}
|
||||
|
||||
$serverConf = &serverConf::getSingleton();
|
||||
$serverConf = &ServerConf::getSingleton();
|
||||
|
||||
if ($serverConf->isRtl(SYS_LANG)) {
|
||||
$dirBody = "dir=\"RTL\"";
|
||||
@@ -551,7 +551,7 @@ class SkinEngine
|
||||
private function _mvc()
|
||||
{
|
||||
|
||||
$oServerConf =& serverConf::getSingleton();
|
||||
$oServerConf =& ServerConf::getSingleton();
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
|
||||
$smarty = new Smarty();
|
||||
@@ -644,7 +644,7 @@ class SkinEngine
|
||||
|
||||
//To setup en extJS Theme for this Skin
|
||||
|
||||
$oServerConf =& serverConf::getSingleton();
|
||||
$oServerConf =& ServerConf::getSingleton();
|
||||
$extSkin = $oServerConf->getProperty("extSkin");
|
||||
|
||||
if(!$extSkin) {
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
use PmDynaform;
|
||||
use SpoolRun;
|
||||
|
||||
/**
|
||||
* Description of ActionsByEmailService
|
||||
@@ -409,7 +410,7 @@ class ActionsByEmail
|
||||
}
|
||||
$aSetup = (!empty($arrayConfigAux))? $arrayConfigAux : \PmSystem::getEmailConfiguration();
|
||||
|
||||
$spool = new \spoolRun();
|
||||
$spool = new SpoolRun();
|
||||
$spool->setConfig($aSetup);
|
||||
|
||||
$spool->create(array(
|
||||
|
||||
@@ -9,11 +9,8 @@ use ResultSet;
|
||||
use CaseConsolidatedCorePeer;
|
||||
use ContentPeer;
|
||||
use PmDynaform;
|
||||
use ReportTables;
|
||||
|
||||
/**
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
class Consolidated
|
||||
{
|
||||
/**
|
||||
@@ -362,7 +359,7 @@ class Consolidated
|
||||
$filter = new \InputFilter();
|
||||
|
||||
if ($sort != "") {
|
||||
$reportTable = new \ReportTables();
|
||||
$reportTable = new ReportTables();
|
||||
$arrayReportTableVar = $reportTable->getTableVars($tableUid);
|
||||
$tableName = $filter->validateInput($tableName);
|
||||
$sort = $filter->validateInput($sort);
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
use \G;
|
||||
use \Exception;
|
||||
use \Bootstrap;
|
||||
use G;
|
||||
use Exception;
|
||||
use Bootstrap;
|
||||
use SpoolRun;
|
||||
|
||||
class EmailServer
|
||||
{
|
||||
@@ -186,7 +187,7 @@ class EmailServer
|
||||
$sBodyPre->assign("msg", $msg);
|
||||
$sBody = $sBodyPre->getOutputContent();
|
||||
|
||||
$oSpool = new \spoolRun();
|
||||
$oSpool = new SpoolRun();
|
||||
|
||||
$oSpool->setConfig($aConfiguration);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ use \RoutePeer;
|
||||
use ProcessMaker\Util\Common;
|
||||
use ProcessMaker\Exception;
|
||||
use ProcessMaker\Util;
|
||||
|
||||
use ReportTables;
|
||||
/**
|
||||
* Class Workflow
|
||||
*
|
||||
@@ -594,7 +594,7 @@ class Workflow extends Handler
|
||||
$oSwimlaneElement = new \SwimlanesElements();
|
||||
$oConfiguration = new \Configuration();
|
||||
$oDbSource = new \DbSource();
|
||||
$oReportTable = new \ReportTables();
|
||||
$oReportTable = new ReportTables();
|
||||
$oCaseTracker = new \CaseTracker();
|
||||
$oCaseTrackerObject = new \CaseTrackerObject();
|
||||
|
||||
|
||||
@@ -247,7 +247,7 @@ use ProcessMaker\Plugins\PluginRegistry;
|
||||
// defining the serverConf singleton
|
||||
if (defined('PATH_DATA') && file_exists(PATH_DATA)) {
|
||||
//Instance Server Configuration Singleton
|
||||
$oServerConf =& serverConf::getSingleton();
|
||||
$oServerConf =& ServerConf::getSingleton();
|
||||
}
|
||||
|
||||
// Call Gulliver Classes
|
||||
|
||||
@@ -506,7 +506,7 @@ define( 'SYS_URI', '/sys' . SYS_TEMP . '/' . SYS_LANG . '/' . SYS_SKIN . '/' );
|
||||
// defining the serverConf singleton
|
||||
if (defined( 'PATH_DATA' ) && file_exists( PATH_DATA )) {
|
||||
//Instance Server Configuration Singleton
|
||||
$oServerConf = & serverConf::getSingleton();
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user