First set of modifications
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
class actionsByEmailCoreClass extends PMPlugin
|
||||
{
|
||||
public function __construct()
|
||||
@@ -333,4 +334,3 @@ class actionsByEmailCoreClass extends PMPlugin
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,10 @@
|
||||
/**
|
||||
* Class InputDocumentDrive
|
||||
*/
|
||||
class AppDocumentDrive
|
||||
|
||||
/**
|
||||
* Class InputDocumentDrive
|
||||
*/class AppDocumentDrive
|
||||
{
|
||||
/**
|
||||
* @var PMDrive $drive
|
||||
@@ -44,115 +44,6 @@ require_once "classes/model/AppSolrQueue.php";
|
||||
* @author Herbert Saal Gutierrez
|
||||
*
|
||||
*/
|
||||
class InvalidIndexSearchTextException extends Exception
|
||||
{
|
||||
// Redefine the exception so message isn't optional
|
||||
public function __construct($message, $code = 0)
|
||||
{
|
||||
// some code
|
||||
// make sure everything is assigned properly
|
||||
parent::__construct ($message, $code);
|
||||
}
|
||||
|
||||
// custom string representation of object
|
||||
public function __toString()
|
||||
{
|
||||
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Application without Delegations exception
|
||||
*
|
||||
* @author Herbert Saal Gutierrez
|
||||
*
|
||||
* @category Colosa
|
||||
* @copyright Copyright (c) 2005-2012 Colosa Inc. (http://www.colosa.com)
|
||||
*/
|
||||
class ApplicationWithoutDelegationRecordsException extends Exception
|
||||
{
|
||||
// Redefine the exception so message isn't optional
|
||||
public function __construct($message, $code = 0)
|
||||
{
|
||||
// some code
|
||||
// make sure everything is assigned properly
|
||||
parent::__construct ($message, $code);
|
||||
}
|
||||
|
||||
// custom string representation of object
|
||||
public function __toString()
|
||||
{
|
||||
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Dynaform file corrupt
|
||||
*
|
||||
* @author Herbert Saal Gutierrez
|
||||
*
|
||||
* @category Colosa
|
||||
* @copyright Copyright (c) 2005-2012 Colosa Inc. (http://www.colosa.com)
|
||||
*/
|
||||
class ApplicationWithCorruptDynaformException extends Exception
|
||||
{
|
||||
// Redefine the exception so message isn't optional
|
||||
public function __construct($message, $code = 0)
|
||||
{
|
||||
// some code
|
||||
// make sure everything is assigned properly
|
||||
parent::__construct ($message, $code);
|
||||
}
|
||||
|
||||
// custom string representation of object
|
||||
public function __toString()
|
||||
{
|
||||
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Application APP_DATA could not be unserialized exception
|
||||
*
|
||||
* @author Herbert Saal Gutierrez
|
||||
*
|
||||
* @category Colosa
|
||||
* @copyright Copyright (c) 2005-2012 Colosa Inc. (http://www.colosa.com)
|
||||
*/
|
||||
class ApplicationAPP_DATAUnserializeException extends Exception
|
||||
{
|
||||
// Redefine the exception so message isn't optional
|
||||
public function __construct($message, $code = 0)
|
||||
{
|
||||
// some code
|
||||
// make sure everything is assigned properly
|
||||
parent::__construct ($message, $code);
|
||||
}
|
||||
|
||||
// custom string representation of object
|
||||
public function __toString()
|
||||
{
|
||||
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
|
||||
}
|
||||
}
|
||||
/*
|
||||
class CheckSolrAvailability
|
||||
{
|
||||
private static _classInstance = null;
|
||||
private static _SolrIsAvailable = true;
|
||||
|
||||
private function __construct($SolrEnabled, $SolrHost, $SolrInstance)
|
||||
{
|
||||
// define solr availability
|
||||
$this->_solrIsEnabled = $SolrEnabled;
|
||||
$this->_solrHost = $SolrHost;
|
||||
$this->_solrInstance = $SolrInstance;
|
||||
}
|
||||
|
||||
public function getInstance(){
|
||||
if()
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Implementation to display application data in the PMOS2 grids using Solr
|
||||
@@ -162,8 +53,7 @@ class CheckSolrAvailability
|
||||
* @category Colosa
|
||||
* @copyright Copyright (c) 2005-2011 Colosa Inc. (http://www.colosa.com)
|
||||
*
|
||||
*/
|
||||
class AppSolr
|
||||
*/class AppSolr
|
||||
{
|
||||
private $_solrIsEnabled = false;
|
||||
private $_solrHost = "";
|
||||
@@ -3089,4 +2979,3 @@ class AppSolr
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2012 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* 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, 5304 Ventura Drive,
|
||||
* Delray Beach, FL, 33484, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once "classes/model/Application.php";
|
||||
require_once "classes/model/AppDelegation.php";
|
||||
require_once "classes/model/AppThread.php";
|
||||
require_once "classes/model/Content.php";
|
||||
require_once "classes/model/Users.php";
|
||||
require_once "classes/model/GroupUser.php";
|
||||
require_once "classes/model/Task.php";
|
||||
require_once "classes/model/TaskUser.php";
|
||||
require_once "classes/model/Dynaform.php";
|
||||
require_once "classes/model/ProcessVariables.php";
|
||||
require_once "entities/SolrRequestData.php";
|
||||
require_once "entities/SolrUpdateDocument.php";
|
||||
require_once "entities/AppSolrQueue.php";
|
||||
require_once "classes/model/AppSolrQueue.php";
|
||||
|
||||
|
||||
/**
|
||||
* Invalid search text for Solr exception
|
||||
*
|
||||
* @author Herbert Saal Gutierrez
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Application APP_DATA could not be unserialized exception
|
||||
*
|
||||
* @author Herbert Saal Gutierrez
|
||||
*
|
||||
* @category Colosa
|
||||
* @copyright Copyright (c) 2005-2012 Colosa Inc. (http://www.colosa.com)
|
||||
*/class ApplicationAPP_DATAUnserializeException extends Exception
|
||||
{
|
||||
// Redefine the exception so message isn't optional
|
||||
public function __construct($message, $code = 0)
|
||||
{
|
||||
// some code
|
||||
// make sure everything is assigned properly
|
||||
parent::__construct ($message, $code);
|
||||
}
|
||||
|
||||
// custom string representation of object
|
||||
public function __toString()
|
||||
{
|
||||
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2012 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* 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, 5304 Ventura Drive,
|
||||
* Delray Beach, FL, 33484, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once "classes/model/Application.php";
|
||||
require_once "classes/model/AppDelegation.php";
|
||||
require_once "classes/model/AppThread.php";
|
||||
require_once "classes/model/Content.php";
|
||||
require_once "classes/model/Users.php";
|
||||
require_once "classes/model/GroupUser.php";
|
||||
require_once "classes/model/Task.php";
|
||||
require_once "classes/model/TaskUser.php";
|
||||
require_once "classes/model/Dynaform.php";
|
||||
require_once "classes/model/ProcessVariables.php";
|
||||
require_once "entities/SolrRequestData.php";
|
||||
require_once "entities/SolrUpdateDocument.php";
|
||||
require_once "entities/AppSolrQueue.php";
|
||||
require_once "classes/model/AppSolrQueue.php";
|
||||
|
||||
|
||||
/**
|
||||
* Invalid search text for Solr exception
|
||||
*
|
||||
* @author Herbert Saal Gutierrez
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Dynaform file corrupt
|
||||
*
|
||||
* @author Herbert Saal Gutierrez
|
||||
*
|
||||
* @category Colosa
|
||||
* @copyright Copyright (c) 2005-2012 Colosa Inc. (http://www.colosa.com)
|
||||
*/class ApplicationWithCorruptDynaformException extends Exception
|
||||
{
|
||||
// Redefine the exception so message isn't optional
|
||||
public function __construct($message, $code = 0)
|
||||
{
|
||||
// some code
|
||||
// make sure everything is assigned properly
|
||||
parent::__construct ($message, $code);
|
||||
}
|
||||
|
||||
// custom string representation of object
|
||||
public function __toString()
|
||||
{
|
||||
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2012 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* 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, 5304 Ventura Drive,
|
||||
* Delray Beach, FL, 33484, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once "classes/model/Application.php";
|
||||
require_once "classes/model/AppDelegation.php";
|
||||
require_once "classes/model/AppThread.php";
|
||||
require_once "classes/model/Content.php";
|
||||
require_once "classes/model/Users.php";
|
||||
require_once "classes/model/GroupUser.php";
|
||||
require_once "classes/model/Task.php";
|
||||
require_once "classes/model/TaskUser.php";
|
||||
require_once "classes/model/Dynaform.php";
|
||||
require_once "classes/model/ProcessVariables.php";
|
||||
require_once "entities/SolrRequestData.php";
|
||||
require_once "entities/SolrUpdateDocument.php";
|
||||
require_once "entities/AppSolrQueue.php";
|
||||
require_once "classes/model/AppSolrQueue.php";
|
||||
|
||||
|
||||
/**
|
||||
* Invalid search text for Solr exception
|
||||
*
|
||||
* @author Herbert Saal Gutierrez
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Application without Delegations exception
|
||||
*
|
||||
* @author Herbert Saal Gutierrez
|
||||
*
|
||||
* @category Colosa
|
||||
* @copyright Copyright (c) 2005-2012 Colosa Inc. (http://www.colosa.com)
|
||||
*/class ApplicationWithoutDelegationRecordsException extends Exception
|
||||
{
|
||||
// Redefine the exception so message isn't optional
|
||||
public function __construct($message, $code = 0)
|
||||
{
|
||||
// some code
|
||||
// make sure everything is assigned properly
|
||||
parent::__construct ($message, $code);
|
||||
}
|
||||
|
||||
// custom string representation of object
|
||||
public function __toString()
|
||||
{
|
||||
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
|
||||
class Applications
|
||||
{
|
||||
/**
|
||||
@@ -1213,4 +1214,3 @@ class Applications
|
||||
return $steps;
|
||||
}
|
||||
}
|
||||
|
||||
369
workflow/engine/classes/Archive.php
Normal file
369
workflow/engine/classes/Archive.php
Normal file
@@ -0,0 +1,369 @@
|
||||
<?php
|
||||
/*--------------------------------------------------
|
||||
* TAR/GZIP/BZIP2/ZIP ARCHIVE CLASSES 2.1
|
||||
* By Devin Doucette
|
||||
* Copyright (c) 2005 Devin Doucette
|
||||
* Email: darksnoopy@shaw.ca
|
||||
*--------------------------------------------------
|
||||
* Email bugs/suggestions to darksnoopy@shaw.ca
|
||||
*--------------------------------------------------
|
||||
* This script has been created and released under
|
||||
* the GNU GPL and is free to use and redistribute
|
||||
* only if this copyright statement is not removed
|
||||
*--------------------------------------------------*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/class archive
|
||||
{
|
||||
|
||||
/**
|
||||
* This function is the constructor of the class archive
|
||||
*
|
||||
* @param string $name
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
public function archive ($name)
|
||||
{
|
||||
$this->options = array ('basedir' => ".",'name' => $name,'prepend' => "",'inmemory' => 0,'overwrite' => 0,'recurse' => 1,'storepaths' => 1,'followlinks' => 0,'level' => 3,'method' => 1,'sfx' => "",'type' => "",'comment' => ""
|
||||
);
|
||||
$this->files = array ();
|
||||
$this->exclude = array ();
|
||||
$this->storeonly = array ();
|
||||
$this->error = array ();
|
||||
}
|
||||
|
||||
/**
|
||||
* This function gives options to a archive
|
||||
*
|
||||
* @param array $options
|
||||
* @return void
|
||||
*/
|
||||
public function set_options ($options)
|
||||
{
|
||||
foreach ($options as $key => $value) {
|
||||
$this->options[$key] = $value;
|
||||
}
|
||||
if (! empty( $this->options['basedir'] )) {
|
||||
$this->options['basedir'] = str_replace( "\\", "/", $this->options['basedir'] );
|
||||
$this->options['basedir'] = preg_replace( "/\/+/", "/", $this->options['basedir'] );
|
||||
$this->options['basedir'] = preg_replace( "/\/$/", "", $this->options['basedir'] );
|
||||
}
|
||||
if (! empty( $this->options['name'] )) {
|
||||
$this->options['name'] = str_replace( "\\", "/", $this->options['name'] );
|
||||
$this->options['name'] = preg_replace( "/\/+/", "/", $this->options['name'] );
|
||||
}
|
||||
if (! empty( $this->options['prepend'] )) {
|
||||
$this->options['prepend'] = str_replace( "\\", "/", $this->options['prepend'] );
|
||||
$this->options['prepend'] = preg_replace( "/^(\.*\/+)+/", "", $this->options['prepend'] );
|
||||
$this->options['prepend'] = preg_replace( "/\/+/", "/", $this->options['prepend'] );
|
||||
$this->options['prepend'] = preg_replace( "/\/$/", "", $this->options['prepend'] ) . "/";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used to create a archive.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function create_archive ()
|
||||
{
|
||||
$this->make_list();
|
||||
if ($this->options['inmemory'] == 0) {
|
||||
$pwd = getcwd();
|
||||
chdir( $this->options['basedir'] );
|
||||
if ($this->options['overwrite'] == 0 && file_exists( $this->options['name'] . ($this->options['type'] == "gzip" || $this->options['type'] == "bzip" ? ".tmp" : "") )) {
|
||||
$this->error[] = "File {$this->options['name']} already exist.";
|
||||
chdir( $pwd );
|
||||
return 0;
|
||||
} elseif ($this->archive = @fopen( $this->options['name'] . ($this->options['type'] == "gzip" || $this->options['type'] == "bzip" ? ".tmp" : ""), "wb+" )) {
|
||||
chdir( $pwd );
|
||||
} else {
|
||||
$this->error[] = "Could not open {$this->options['name']} for writing.";
|
||||
chdir( $pwd );
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
$this->archive = "";
|
||||
}
|
||||
switch ($this->options['type']) {
|
||||
case "zip":
|
||||
if (! $this->create_zip()) {
|
||||
$this->error[] = "Could not create zip file.";
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case "bzip":
|
||||
if (! $this->create_tar()) {
|
||||
$this->error[] = "Could not create tar file.";
|
||||
return 0;
|
||||
}
|
||||
if (! $this->create_bzip()) {
|
||||
$this->error[] = "Could not create bzip2 file.";
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case "gzip":
|
||||
if (! $this->create_tar()) {
|
||||
$this->error[] = "Could not create tar file.";
|
||||
return 0;
|
||||
}
|
||||
if (! $this->create_gzip()) {
|
||||
$this->error[] = "Could not create gzip file.";
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case "tar":
|
||||
if (! $this->create_tar()) {
|
||||
$this->error[] = "Could not create tar file.";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if ($this->options['inmemory'] == 0) {
|
||||
fclose( $this->archive );
|
||||
if ($this->options['type'] == "gzip" || $this->options['type'] == "bzip") {
|
||||
unlink( $this->options['basedir'] . "/" . $this->options['name'] . ".tmp" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used for add data to a archive
|
||||
*
|
||||
* @param string $data
|
||||
* @return void
|
||||
*/
|
||||
public function add_data ($data)
|
||||
{
|
||||
if ($this->options['inmemory'] == 0) {
|
||||
fwrite( $this->archive, $data );
|
||||
} else {
|
||||
$this->archive .= $data;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function make a list
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function make_list ()
|
||||
{
|
||||
if (! empty( $this->exclude )) {
|
||||
foreach ($this->files as $key => $value) {
|
||||
foreach ($this->exclude as $current) {
|
||||
if ($value['name'] == $current['name']) {
|
||||
unset( $this->files[$key] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (! empty( $this->storeonly )) {
|
||||
foreach ($this->files as $key => $value) {
|
||||
foreach ($this->storeonly as $current) {
|
||||
if ($value['name'] == $current['name']) {
|
||||
$this->files[$key]['method'] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
unset( $this->exclude, $this->storeonly );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add files a list
|
||||
*
|
||||
* @param array $list
|
||||
* @return void
|
||||
*/
|
||||
public function add_files ($list)
|
||||
{
|
||||
$temp = $this->list_files( $list );
|
||||
foreach ($temp as $current) {
|
||||
$this->files[] = $current;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function exclude files of a list
|
||||
*
|
||||
* @param array $list
|
||||
* @return void
|
||||
*/
|
||||
public function exclude_files ($list)
|
||||
{
|
||||
$temp = $this->list_files( $list );
|
||||
foreach ($temp as $current) {
|
||||
$this->exclude[] = $current;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function store files
|
||||
*
|
||||
* @param array $list
|
||||
*/
|
||||
public function store_files ($list)
|
||||
{
|
||||
$temp = $this->list_files( $list );
|
||||
foreach ($temp as $current) {
|
||||
$this->storeonly[] = $current;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* List files gives a List
|
||||
*
|
||||
* @param array $list
|
||||
* @return array
|
||||
*/
|
||||
public function list_files ($list)
|
||||
{
|
||||
if (! is_array( $list )) {
|
||||
$temp = $list;
|
||||
$list = array ($temp
|
||||
);
|
||||
unset( $temp );
|
||||
}
|
||||
$files = array ();
|
||||
$pwd = getcwd();
|
||||
chdir( $this->options['basedir'] );
|
||||
foreach ($list as $current) {
|
||||
$current = str_replace( "\\", "/", $current );
|
||||
$current = preg_replace( "/\/+/", "/", $current );
|
||||
$current = preg_replace( "/\/$/", "", $current );
|
||||
if (strstr( $current, "*" )) {
|
||||
$regex = preg_replace( "/([\\\^\$\.\[\]\|\(\)\?\+\{\}\/])/", "\\\\\\1", $current );
|
||||
$regex = str_replace( "*", ".*", $regex );
|
||||
$dir = strstr( $current, "/" ) ? substr( $current, 0, strrpos( $current, "/" ) ) : ".";
|
||||
$temp = $this->parse_dir( $dir );
|
||||
foreach ($temp as $current2) {
|
||||
if (preg_match( "/^{$regex}$/i", $current2['name'] )) {
|
||||
$files[] = $current2;
|
||||
}
|
||||
}
|
||||
unset( $regex, $dir, $temp, $current );
|
||||
} elseif (@is_dir( $current )) {
|
||||
$temp = $this->parse_dir( $current );
|
||||
foreach ($temp as $file) {
|
||||
$files[] = $file;
|
||||
}
|
||||
unset( $temp, $file );
|
||||
} elseif (@file_exists( $current )) {
|
||||
$files[] = array ('name' => $current,'name2' => $this->options['prepend'] . preg_replace( "/(\.+\/+)+/", "", ($this->options['storepaths'] == 0 && strstr( $current, "/" )) ? substr( $current, strrpos( $current, "/" ) + 1 ) : $current ),'type' => @is_link( $current ) && $this->options['followlinks'] == 0 ? 2 : 0,'ext' => substr( $current, strrpos( $current, "." ) ),'stat' => stat( $current )
|
||||
);
|
||||
}
|
||||
}
|
||||
chdir( $pwd );
|
||||
unset( $current, $pwd );
|
||||
usort( $files, array ("archive","sort_files"
|
||||
) );
|
||||
return $files;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is for parse a directory name
|
||||
*
|
||||
* @param string $dirname
|
||||
* @return array
|
||||
*/
|
||||
public function parse_dir ($dirname)
|
||||
{
|
||||
if ($this->options['storepaths'] == 1 && ! preg_match( "/^(\.+\/*)+$/", $dirname )) {
|
||||
$files = array (array ('name' => $dirname,'name2' => $this->options['prepend'] . preg_replace( "/(\.+\/+)+/", "", ($this->options['storepaths'] == 0 && strstr( $dirname, "/" )) ? substr( $dirname, strrpos( $dirname, "/" ) + 1 ) : $dirname ),'type' => 5,'stat' => stat( $dirname )
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$files = array ();
|
||||
}
|
||||
$dir = @opendir( $dirname );
|
||||
while ($file = @readdir( $dir )) {
|
||||
$fullname = $dirname . "/" . $file;
|
||||
if ($file == "." || $file == "..") {
|
||||
continue;
|
||||
} elseif (@is_dir( $fullname )) {
|
||||
if (empty( $this->options['recurse'] )) {
|
||||
continue;
|
||||
}
|
||||
$temp = $this->parse_dir( $fullname );
|
||||
foreach ($temp as $file2) {
|
||||
$files[] = $file2;
|
||||
}
|
||||
} elseif (@file_exists( $fullname )) {
|
||||
$files[] = array ('name' => $fullname,'name2' => $this->options['prepend'] . preg_replace( "/(\.+\/+)+/", "", ($this->options['storepaths'] == 0 && strstr( $fullname, "/" )) ? substr( $fullname, strrpos( $fullname, "/" ) + 1 ) : $fullname ),'type' => @is_link( $fullname ) && $this->options['followlinks'] == 0 ? 2 : 0,'ext' => substr( $file, strrpos( $file, "." ) ),'stat' => stat( $fullname )
|
||||
);
|
||||
}
|
||||
}
|
||||
@closedir( $dir );
|
||||
return $files;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function sort two files
|
||||
*
|
||||
* @param array $a
|
||||
* @param array $b
|
||||
* @return boolean
|
||||
*/
|
||||
public function sort_files ($a, $b)
|
||||
{
|
||||
if ($a['type'] != $b['type']) {
|
||||
if ($a['type'] == 5 || $b['type'] == 2) {
|
||||
return - 1;
|
||||
} elseif ($a['type'] == 2 || $b['type'] == 5) {
|
||||
return 1;
|
||||
} elseif ($a['type'] == 5) {
|
||||
return strcmp( strtolower( $a['name'] ), strtolower( $b['name'] ) );
|
||||
} elseif ($a['ext'] != $b['ext']) {
|
||||
return strcmp( $a['ext'], $b['ext'] );
|
||||
} elseif ($a['stat'][7] != $b['stat'][7]) {
|
||||
return $a['stat'][7] > $b['stat'][7] ? - 1 : 1;
|
||||
} else {
|
||||
return strcmp( strtolower( $a['name'] ), strtolower( $b['name'] ) );
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function download a file
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function download_file ()
|
||||
{
|
||||
if ($this->options['inmemory'] == 0) {
|
||||
$this->error[] = "Can only use download_file() if archive is in memory. Redirect to file otherwise, it is faster.";
|
||||
return;
|
||||
}
|
||||
switch ($this->options['type']) {
|
||||
case "zip":
|
||||
header( "Content-Type: application/zip" );
|
||||
break;
|
||||
case "bzip":
|
||||
header( "Content-Type: application/x-bzip2" );
|
||||
break;
|
||||
case "gzip":
|
||||
header( "Content-Type: application/x-gzip" );
|
||||
break;
|
||||
case "tar":
|
||||
header( "Content-Type: application/x-tar" );
|
||||
}
|
||||
$header = "Content-Disposition: attachment; filename=\"";
|
||||
$header .= strstr( $this->options['name'], "/" ) ? substr( $this->options['name'], strrpos( $this->options['name'], "/" ) + 1 ) : $this->options['name'];
|
||||
$header .= "\"";
|
||||
header( $header );
|
||||
header( "Content-Length: " . strlen( $this->archive ) );
|
||||
header( "Content-Transfer-Encoding: binary" );
|
||||
header( "Cache-Control: no-cache, must-revalidate, max-age=60" );
|
||||
header( "Expires: Sat, 01 Jan 2000 12:00:00 GMT" );
|
||||
print ($this->archive) ;
|
||||
}
|
||||
}
|
||||
@@ -26,16 +26,12 @@
|
||||
*/
|
||||
|
||||
require_once 'propel/util/BasePeer.php';
|
||||
// The object class -- needed for instanceof checks in this class.
|
||||
// actual class may be a subclass -- as returned by ApplicationPeer::getOMClass()
|
||||
include_once 'classes/model/Application.php';
|
||||
|
||||
// The object
|
||||
/**
|
||||
* Base static class for performing query and update operations on the 'APPLICATION' table.
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
abstract class ArrayBasePeer
|
||||
*/abstract class ArrayBasePeer
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -858,20 +854,3 @@ abstract class ArrayBasePeer
|
||||
}
|
||||
|
||||
} // BaseApplicationPeer
|
||||
|
||||
|
||||
// static code to register the map builder for this Peer with the main Propel class
|
||||
if (Propel::isInit()) {
|
||||
// the MapBuilder classes register themselves with Propel during initialization
|
||||
// so we need to load them here.
|
||||
try {
|
||||
BaseApplicationPeer::getMapBuilder();
|
||||
} catch (Exception $e) {
|
||||
Propel::log( 'Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR );
|
||||
}
|
||||
} else {
|
||||
// even if Propel is not yet initialized, the map builder class can be registered
|
||||
// now and then it will be loaded when Propel initializes.
|
||||
require_once 'classes/model/map/ApplicationMapBuilder.php';
|
||||
Propel::registerMapBuilder( 'classes.model.map.ApplicationMapBuilder' );
|
||||
}
|
||||
@@ -28,7 +28,12 @@
|
||||
* @author Herbert Saal Gutierrez
|
||||
*
|
||||
*/
|
||||
class BpmnEngine_SearchIndexAccess_Solr
|
||||
|
||||
/**
|
||||
* Interface to the Solr Search server
|
||||
* @author Herbert Saal Gutierrez
|
||||
*
|
||||
*/class BpmnEngine_SearchIndexAccess_Solr
|
||||
{
|
||||
const SOLR_VERSION = '&version=2.2';
|
||||
private $_solrIsEnabled = false;
|
||||
@@ -29,7 +29,13 @@
|
||||
* @author Herbert Saal Gutierrez
|
||||
*
|
||||
*/
|
||||
class BpmnEngine_Services_SearchIndex
|
||||
|
||||
/**
|
||||
* Class used as interface to have access to the search index services
|
||||
*
|
||||
* @author Herbert Saal Gutierrez
|
||||
*
|
||||
*/class BpmnEngine_Services_SearchIndex
|
||||
{
|
||||
private $_solrIsEnabled = false;
|
||||
private $_solrHost = "";
|
||||
80
workflow/engine/classes/Bzip_File.php
Normal file
80
workflow/engine/classes/Bzip_File.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/*--------------------------------------------------
|
||||
* TAR/GZIP/BZIP2/ZIP ARCHIVE CLASSES 2.1
|
||||
* By Devin Doucette
|
||||
* Copyright (c) 2005 Devin Doucette
|
||||
* Email: darksnoopy@shaw.ca
|
||||
*--------------------------------------------------
|
||||
* Email bugs/suggestions to darksnoopy@shaw.ca
|
||||
*--------------------------------------------------
|
||||
* This script has been created and released under
|
||||
* the GNU GPL and is free to use and redistribute
|
||||
* only if this copyright statement is not removed
|
||||
*--------------------------------------------------*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* This class is derived from the class archive, is employed to use files .bzip
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*
|
||||
*/class bzip_file extends tar_file
|
||||
{
|
||||
|
||||
/**
|
||||
* This function is the constructor of the class bzip_file
|
||||
*
|
||||
* @param string $name
|
||||
* @return void
|
||||
*/
|
||||
public function bzip_file ($name)
|
||||
{
|
||||
$this->tar_file( $name );
|
||||
$this->options['type'] = "bzip";
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is employed to create files .
|
||||
* bzip
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function create_bzip ()
|
||||
{
|
||||
if ($this->options['inmemory'] == 0) {
|
||||
$pwd = getcwd();
|
||||
chdir( $this->options['basedir'] );
|
||||
if ($fp = bzopen( $this->options['name'], "wb" )) {
|
||||
fseek( $this->archive, 0 );
|
||||
while ($temp = fread( $this->archive, 1048576 )) {
|
||||
bzwrite( $fp, $temp );
|
||||
}
|
||||
bzclose( $fp );
|
||||
chdir( $pwd );
|
||||
} else {
|
||||
$this->error[] = "Could not open {$this->options['name']} for writing.";
|
||||
chdir( $pwd );
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
$this->archive = bzcompress( $this->archive, $this->options['level'] );
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function open a archive of the class bzip_file
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function open_archive ()
|
||||
{
|
||||
return @bzopen( $this->options['name'], "rb" );
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,11 @@
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
class CLI
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/class CLI
|
||||
{
|
||||
public static $tasks = array ();
|
||||
public static $currentTask = null;
|
||||
@@ -384,4 +388,3 @@ EOT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,12 @@ use ProcessMaker\Plugins\PluginRegistry;
|
||||
* This object is applied to Task
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
class Cases
|
||||
|
||||
/**
|
||||
* A Cases object where you can do start, load, update, refresh about cases
|
||||
* This object is applied to Task
|
||||
* @package workflow.engine.classes
|
||||
*/class Cases
|
||||
{
|
||||
|
||||
private $appSolr = null;
|
||||
@@ -34,13 +34,7 @@
|
||||
|
||||
|
||||
/**
|
||||
* ProcessConfiguration - ProcessConfiguration class
|
||||
*
|
||||
* @author David S. Callizaya S.
|
||||
* @copyright 2007 COLOSA
|
||||
*/
|
||||
require_once 'classes/model/Configuration.php';
|
||||
|
||||
* ProcessConfiguration - ProcessConfiguration
|
||||
/**
|
||||
* Extends Configuration
|
||||
*
|
||||
@@ -48,8 +42,7 @@ require_once 'classes/model/Configuration.php';
|
||||
* @copyright 2007 COLOSA
|
||||
* @version Release: @package_version@
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*/
|
||||
class Configurations // extends Configuration
|
||||
*/class Configurations // extends Configuration
|
||||
{
|
||||
|
||||
public $aConfig = array();
|
||||
@@ -1006,4 +999,3 @@ class Configurations // extends Configuration
|
||||
return $ver;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
|
||||
class ConsolidatedCases
|
||||
{
|
||||
private $existTable;
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
|
||||
class Dashboards
|
||||
{
|
||||
public function getListDashboards ($start=0, $limit=20, $sort='', $dir='DESC', $search='')
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
require_once 'classes/interfaces/dashletInterface.php';
|
||||
require_once 'classes/interfaces/DashletInterface.php';
|
||||
|
||||
|
||||
class dashletOpenVSCompleted implements DashletInterface
|
||||
{
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
require_once 'classes/interfaces/dashletInterface.php';
|
||||
require_once 'classes/interfaces/DashletInterface.php';
|
||||
|
||||
|
||||
class dashletProcessMakerCommunity implements DashletInterface
|
||||
{
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
require_once 'classes/interfaces/dashletInterface.php';
|
||||
require_once 'classes/interfaces/DashletInterface.php';
|
||||
|
||||
|
||||
class dashletProcessMakerEnterprise implements DashletInterface
|
||||
{
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
require_once 'classes/interfaces/dashletInterface.php';
|
||||
require_once 'classes/interfaces/DashletInterface.php';
|
||||
|
||||
|
||||
class dashletRssReader implements DashletInterface
|
||||
{
|
||||
@@ -27,18 +27,11 @@
|
||||
*
|
||||
* /*
|
||||
* Created on 21/01/2008
|
||||
* This class is used for handling dates
|
||||
*
|
||||
* @author David Callizaya <davidsantos@colosa.com>
|
||||
*/
|
||||
require_once ("classes/model/TaskPeer.php");
|
||||
require_once ("classes/model/HolidayPeer.php");
|
||||
|
||||
* This
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
class dates
|
||||
*/class dates
|
||||
{
|
||||
|
||||
private $holidays = array();
|
||||
@@ -529,4 +522,3 @@ class dates
|
||||
return $iDate;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Author: Erik Amaru Ortiz <erik@colosa.com>
|
||||
* Description:This is a class for load all additional connections; if exist in a particular proccess
|
||||
* Date: 15-05-2008
|
||||
*
|
||||
*
|
||||
* class.dbConnections.php
|
||||
*
|
||||
* Email bugs/suggestions to erik@colosa.com
|
||||
*/
|
||||
|
||||
require_once 'model/DbSource.php';
|
||||
require_once 'model/Content.php';
|
||||
|
||||
* Description:This is a
|
||||
/**
|
||||
* dbConnections
|
||||
*
|
||||
@@ -20,8 +9,7 @@ require_once 'model/Content.php';
|
||||
* @copyright 2008 Colosa
|
||||
* @package workflow.engine.classes
|
||||
*
|
||||
*/
|
||||
class DbConnections
|
||||
*/class DbConnections
|
||||
{
|
||||
private $PRO_UID;
|
||||
public $connections;
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* derivation - derivation
|
||||
/**
|
||||
* derivation - derivation class
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*
|
||||
*/
|
||||
|
||||
class Derivation
|
||||
*/class Derivation
|
||||
{
|
||||
var $case;
|
||||
protected $flagControl;
|
||||
@@ -26,12 +26,13 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Dynaform Field - DynaformField
|
||||
/**
|
||||
* Dynaform Field - DynaformField class
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
class DynaFormField extends DBTable
|
||||
*/class DynaFormField extends DBTable
|
||||
{
|
||||
|
||||
private $fileName;
|
||||
317
workflow/engine/classes/DynaformEditor.php
Normal file
317
workflow/engine/classes/DynaformEditor.php
Normal file
@@ -0,0 +1,317 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.dynaformEditor.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.
|
||||
*/
|
||||
/**
|
||||
* Created on 21/12/2007
|
||||
* Dynaform - Dynaform
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/class dynaformEditor extends WebResource
|
||||
{
|
||||
|
||||
private $isOldCopy = false;
|
||||
public $file = '';
|
||||
public $title = 'New Dynaform';
|
||||
public $dyn_uid = '';
|
||||
public $dyn_type = '';
|
||||
public $home = '';
|
||||
|
||||
/**
|
||||
* Other Options for Editor:
|
||||
* left: 'getAbsoluteLeft(document.getElementById("dynaformEditor[0]"))',
|
||||
* top: 'getAbsoluteTop(document.getElementById("dynaformEditor[0]"))',
|
||||
* height: '3/4*(document.body.clientWidth-getAbsoluteLeft(document.getElementById("dynaformEditor[0]"))*2)',
|
||||
* left: 'getAbsoluteLeft(document.getElementById("dynaformEditor[0]"))'
|
||||
* left: 'getAbsoluteLeft(document.getElementById("dynaformEditor[0]"))'
|
||||
*
|
||||
* Other Options for Toolbar:
|
||||
* left: 'getAbsoluteLeft(document.getElementById("dynaformEditor[0]"))',
|
||||
* top: 'getAbsoluteTop(document.getElementById("dynaformEditor[0]"))',
|
||||
*/
|
||||
public $defaultConfig = array('Editor' => array('left' => '0', 'top' => '0', 'width' => 'document.body.clientWidth-4', 'height' => 'document.body.clientHeight-4'),
|
||||
'Toolbar' => array('left' => 'document.body.clientWidth-2-toolbar.clientWidth-24-3+7', 'top' => '52'),
|
||||
'FieldsList' => array('left' => '4+toolbar.clientWidth+24', 'top' => 'getAbsoluteTop(document.getElementById("dynaformEditor[0]"))', 'width' => 244, 'height' => 400)
|
||||
);
|
||||
public $panelConf = array('style' => array('title' => array('textAlign' => 'center')),
|
||||
'width' => 700, 'height' => 600, 'tabWidth' => 120, 'modal' => true, 'drag' => false, 'resize' => false, 'blinkToFront' => false
|
||||
);
|
||||
|
||||
/**
|
||||
* Constructor of the class dynaformEditor
|
||||
*
|
||||
* @param string $get
|
||||
* @return void
|
||||
*/
|
||||
public function dynaformEditor($get)
|
||||
{
|
||||
$this->panelConf = array_merge($this->panelConf, $this->defaultConfig['Editor']);
|
||||
//'title' => G::LoadTranslation('ID_DYNAFORM_EDITOR').' - ['.$this->title.']',
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the xml form default
|
||||
*
|
||||
* @param string $filename
|
||||
* @return void
|
||||
*/
|
||||
public function _createDefaultXmlForm($fileName)
|
||||
{
|
||||
//Create the default Dynaform
|
||||
$sampleForm = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
|
||||
$sampleForm .= '<dynaForm type="' . $this->dyn_type . '" name="" width="500" enabletemplate="0" mode="edit">' . "\n";
|
||||
switch ($this->dyn_type) {
|
||||
case "xmlform":
|
||||
/* $sampleForm.='<title type="title" enablehtml="0">' . "\n" .
|
||||
' <en>Sample form</en>' . "\n" .
|
||||
'</title>'."\n";
|
||||
$sampleForm.='<submit type="submit" enablehtml="0" onclick="">' . "\n" .
|
||||
' <en>Submit</en>' . "\n" .
|
||||
'</submit>'."\n"; */
|
||||
break;
|
||||
case "grid":
|
||||
/* $sampleForm.='<fieldA type="text" >' . "\n" .
|
||||
'<en>A</en>' . "\n" .
|
||||
'</fieldA>'."\n";
|
||||
$sampleForm.='<fieldB type="text" >' . "\n" .
|
||||
'<en>B</en>' . "\n" .
|
||||
'</fieldB>'."\n"; */
|
||||
break;
|
||||
}
|
||||
$sampleForm .= '</dynaForm>';
|
||||
G::verifyPath(dirname($fileName), true);
|
||||
$fp = fopen($fileName, 'w');
|
||||
$sampleForm = str_replace('name=""', 'name="' . $this->_getFilename($this->file) . '"', $sampleForm);
|
||||
fwrite($fp, $sampleForm);
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints the DynaformEditor
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function _render()
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
$script = '';
|
||||
|
||||
/* Start Block: Load (Create if doesn't exist) the xmlform */
|
||||
$Parameters = array('SYS_LANG' => SYS_LANG, 'URL' => G::encrypt($this->file, URL_KEY), 'DYN_UID' => $this->dyn_uid, 'PRO_UID' => $this->pro_uid, 'DYNAFORM_NAME' => $this->dyn_title, 'FILE' => $this->file, 'DYN_EDITOR' => $this->dyn_editor
|
||||
);
|
||||
$_SESSION['Current_Dynafom']['Parameters'] = $Parameters;
|
||||
|
||||
$XmlEditor = array('URL' => G::encrypt($this->file, URL_KEY), 'XML' => '' //$openDoc->getXml()
|
||||
);
|
||||
$JSEditor = array('URL' => G::encrypt($this->file, URL_KEY)
|
||||
);
|
||||
|
||||
$A = G::encrypt($this->file, URL_KEY);
|
||||
|
||||
try {
|
||||
$openDoc = new Xml_Document();
|
||||
$fileName = $this->home . $this->file . '.xml';
|
||||
if (file_exists($fileName)) {
|
||||
$openDoc->parseXmlFile($fileName);
|
||||
} else {
|
||||
$this->_createDefaultXmlForm($fileName);
|
||||
$openDoc->parseXmlFile($fileName);
|
||||
}
|
||||
//$form = new Form( $this->file , $this->home, SYS_LANG, true );
|
||||
$Properties = dynaformEditorAjax::get_properties($A, $this->dyn_uid);
|
||||
/* Start Block: Prepare the XMLDB connection */
|
||||
define('DB_XMLDB_HOST', PATH_DYNAFORM . $this->file . '.xml');
|
||||
define('DB_XMLDB_USER', '');
|
||||
define('DB_XMLDB_PASS', '');
|
||||
define('DB_XMLDB_NAME', '');
|
||||
define('DB_XMLDB_TYPE', 'myxml');
|
||||
/* Start Block: Prepare the dynaformEditor */
|
||||
$G_PUBLISH = new Publisher();
|
||||
$sName = 'dynaformEditor';
|
||||
$G_PUBLISH->publisherId = $sName;
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->setTitle(G::LoadTranslation('ID_DYNAFORM_EDITOR') . ' - ' . $Properties['DYN_TITLE']);
|
||||
$G_PUBLISH->AddContent('blank');
|
||||
$this->panelConf['title'] = '';
|
||||
$G_PUBLISH->AddContent('panel-init', 'mainPanel', $this->panelConf);
|
||||
if ($Properties['DYN_TYPE'] == 'xmlform') {
|
||||
$G_PUBLISH->AddContent('xmlform', 'toolbar', 'dynaforms/fields_Toolbar', 'display:none', $Parameters, '', '');
|
||||
} else {
|
||||
$G_PUBLISH->AddContent('xmlform', 'toolbar', 'dynaforms/fields_ToolbarGrid', 'display:none', $Parameters, '', '');
|
||||
}
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_Editor', 'display:none', $Parameters, '', '');
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_XmlEditor', 'display:none', $XmlEditor, '', '');
|
||||
$G_PUBLISH->AddContent('blank');
|
||||
$i = 0;
|
||||
$aFields = array();
|
||||
$aFields[] = array('XMLNODE_NAME' => 'char', 'TYPE' => 'char', 'UP' => 'char', 'DOWN' => 'char'
|
||||
);
|
||||
$oSession = new DBSession(new DBConnection(PATH_DYNAFORM . $this->file . '.xml', '', '', '', 'myxml'));
|
||||
$oDataset = $oSession->Execute('SELECT * FROM dynaForm WHERE NOT( XMLNODE_NAME = "" ) AND TYPE <> "pmconnection"');
|
||||
$iMaximun = $oDataset->count();
|
||||
while ($aRow = $oDataset->Read()) {
|
||||
$aFields[] = array('XMLNODE_NAME' => $aRow['XMLNODE_NAME'], 'TYPE' => $aRow['TYPE'], 'UP' => ($i > 0 ? G::LoadTranslation('ID_UP') : ''), 'DOWN' => ($i < $iMaximun - 1 ? G::LoadTranslation('ID_DOWN') : ''), 'row__' => ($i + 1)
|
||||
);
|
||||
$i++;
|
||||
break;
|
||||
}
|
||||
global $_DBArray;
|
||||
$_DBArray['fields'] = $aFields;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
$oCriteria = new Criteria('dbarray');
|
||||
$oCriteria->setDBArrayTable('fields');
|
||||
/**
|
||||
* *@Erik-> this is deprecated,.
|
||||
* (unuseful) $G_PUBLISH->AddContent('propeltable', 'paged-table', 'dynaforms/fields_List', $oCriteria, $Parameters, '', SYS_URI.'dynaforms/dynaforms_PagedTableAjax');**
|
||||
*/
|
||||
$G_PUBLISH->AddContent('blank');
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_JSEditor', 'display:none', $JSEditor, '', '');
|
||||
} catch (Exception $e) {
|
||||
|
||||
}
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_Properties', 'display:none', $Properties, '', '');
|
||||
//for showHide tab option @Neyek
|
||||
$G_PUBLISH->AddContent('blank');
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_PREVIEW"), $sName . '[3]', 'dynaformEditor.changeToPreview', 'dynaformEditor.saveCurrentView');
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_XML"), $sName . '[4]', 'dynaformEditor.changeToXmlCode', 'dynaformEditor.saveCurrentView');
|
||||
if ($Properties['DYN_TYPE'] != 'grid') {
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_HTML"), $sName . '[5]', 'dynaformEditor.changeToHtmlCode', 'dynaformEditor.saveCurrentView');
|
||||
}
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_FIELDS_LIST"), $sName . '[6]', 'dynaformEditor.changeToFieldsList', 'dynaformEditor.saveCurrentView');
|
||||
if ($Properties["DYN_TYPE"] != "grid") {
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_JAVASCRIPTS"), $sName . '[7]', 'dynaformEditor.changeToJavascripts', 'dynaformEditor.saveCurrentView');
|
||||
}
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_PROPERTIES"), $sName . '[8]', 'dynaformEditor.changeToProperties', 'dynaformEditor.saveCurrentView');
|
||||
|
||||
//for showHide tab option @Neyek
|
||||
if ($Properties["DYN_TYPE"] != "grid") {
|
||||
$G_PUBLISH->AddContent("panel-tab", G::LoadTranslation("ID_CONDITIONS_EDITOR"), $sName . "[9]", "dynaformEditor.changeToShowHide", "dynaformEditor.saveShowHide");
|
||||
}
|
||||
|
||||
$G_PUBLISH->AddContent('panel-close');
|
||||
$oHeadPublisher->addScriptFile("/js/maborak/core/maborak.loader.js",2);
|
||||
$oHeadPublisher->addScriptFile('/jscore/dynaformEditor/core/dynaformEditor.js');
|
||||
|
||||
$oHeadPublisher->addScriptFile('/js/codemirrorOld/js/codemirror.js',1);
|
||||
|
||||
$oHeadPublisher->addScriptFile('/js/grid/core/grid.js');
|
||||
$oHeadPublisher->addScriptCode('
|
||||
var DYNAFORM_URL="' . $Parameters['URL'] . '";
|
||||
leimnud.event.add(window,"load",function(){ loadEditor(); });
|
||||
');
|
||||
$oHeadPublisher->addScriptCode(' var jsMeta;var __usernameLoggedDE__ = "' . (isset($_SESSION['USR_USERNAME']) ? $_SESSION['USR_USERNAME'] : '') . '";var SYS_LANG = "' . SYS_LANG . '";var __DYN_UID__ = "' . $this->dyn_uid . '";');
|
||||
|
||||
$arrayParameterAux = $Parameters;
|
||||
$arrayParameterAux["DYNAFORM_NAME"] = base64_encode($arrayParameterAux["DYNAFORM_NAME"]);
|
||||
$oHeadPublisher->addScriptCode('var dynaformEditorParams = \'' . serialize($arrayParameterAux) . '\';');
|
||||
|
||||
G::RenderPage("publish", 'blank');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filename
|
||||
*
|
||||
* @param string $file
|
||||
* @return string
|
||||
*/
|
||||
public function _getFilename($file)
|
||||
{
|
||||
return (strcasecmp(substr($file, - 5), '_tmp0') == 0) ? substr($file, 0, strlen($file) - 5) : $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the temporal copy
|
||||
*
|
||||
* @param string $onOff
|
||||
* @return void
|
||||
*/
|
||||
public function _setUseTemporalCopy($onOff)
|
||||
{
|
||||
$file = self::_getFilename($this->file);
|
||||
if ($onOff) {
|
||||
$this->file = $file . '_tmp0';
|
||||
self::_setTmpData(array('useTmpCopy' => true ));
|
||||
if (!file_exists(PATH_DYNAFORM . $file . '.xml')) {
|
||||
$this->_createDefaultXmlForm(PATH_DYNAFORM . $file . '.xml');
|
||||
}
|
||||
//Creates a copy if it doesn't exist, else, use the old copy
|
||||
if (!file_exists(PATH_DYNAFORM . $this->file . '.xml')) {
|
||||
self::_copyFile(PATH_DYNAFORM . $file . '.xml', PATH_DYNAFORM . $this->file . '.xml');
|
||||
}
|
||||
if (!file_exists(PATH_DYNAFORM . $this->file . '.html') && file_exists(PATH_DYNAFORM . $file . '.html')) {
|
||||
self::_copyFile(PATH_DYNAFORM . $file . '.html', PATH_DYNAFORM . $this->file . '.html');
|
||||
}
|
||||
} else {
|
||||
$this->file = $file;
|
||||
self::_setTmpData(array());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set temporal data
|
||||
*
|
||||
* @param $data
|
||||
* @return void
|
||||
*/
|
||||
public function _setTmpData($data)
|
||||
{
|
||||
G::verifyPath(PATH_C . 'dynEditor/', true);
|
||||
$fp = fopen(PATH_C . 'dynEditor/' . session_id() . '.php', 'w');
|
||||
fwrite($fp, '$tmpData=unserialize(\'' . addcslashes(serialize($data), '\\\'') . '\');');
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get temporal data
|
||||
*
|
||||
* @param string $filename
|
||||
* @return array
|
||||
*/
|
||||
public function _getTmpData()
|
||||
{
|
||||
$tmpData = array();
|
||||
$file = PATH_C . 'dynEditor/' . session_id() . '.php';
|
||||
if (file_exists($file)) {
|
||||
eval(implode('', file($file)));
|
||||
}
|
||||
return $tmpData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy files
|
||||
*
|
||||
* @param file $from
|
||||
* @param file $to
|
||||
* @return void
|
||||
*/
|
||||
public function _copyFile($from, $to)
|
||||
{
|
||||
$copy = implode('', file($from));
|
||||
$fcopy = fopen($to, "w");
|
||||
fwrite($fcopy, $copy);
|
||||
fclose($fcopy);
|
||||
}
|
||||
}
|
||||
@@ -26,313 +26,12 @@
|
||||
*/
|
||||
/**
|
||||
* Created on 21/12/2007
|
||||
* Dynaform - Dynaform class
|
||||
*
|
||||
* @copyright 2007 COLOSA
|
||||
* @author David Callizaya <davidsantos@colosa.com>
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
class dynaformEditor extends WebResource
|
||||
{
|
||||
|
||||
private $isOldCopy = false;
|
||||
public $file = '';
|
||||
public $title = 'New Dynaform';
|
||||
public $dyn_uid = '';
|
||||
public $dyn_type = '';
|
||||
public $home = '';
|
||||
|
||||
/**
|
||||
* Other Options for Editor:
|
||||
* left: 'getAbsoluteLeft(document.getElementById("dynaformEditor[0]"))',
|
||||
* top: 'getAbsoluteTop(document.getElementById("dynaformEditor[0]"))',
|
||||
* height: '3/4*(document.body.clientWidth-getAbsoluteLeft(document.getElementById("dynaformEditor[0]"))*2)',
|
||||
* left: 'getAbsoluteLeft(document.getElementById("dynaformEditor[0]"))'
|
||||
* left: 'getAbsoluteLeft(document.getElementById("dynaformEditor[0]"))'
|
||||
*
|
||||
* Other Options for Toolbar:
|
||||
* left: 'getAbsoluteLeft(document.getElementById("dynaformEditor[0]"))',
|
||||
* top: 'getAbsoluteTop(document.getElementById("dynaformEditor[0]"))',
|
||||
*/
|
||||
public $defaultConfig = array('Editor' => array('left' => '0', 'top' => '0', 'width' => 'document.body.clientWidth-4', 'height' => 'document.body.clientHeight-4'),
|
||||
'Toolbar' => array('left' => 'document.body.clientWidth-2-toolbar.clientWidth-24-3+7', 'top' => '52'),
|
||||
'FieldsList' => array('left' => '4+toolbar.clientWidth+24', 'top' => 'getAbsoluteTop(document.getElementById("dynaformEditor[0]"))', 'width' => 244, 'height' => 400)
|
||||
);
|
||||
public $panelConf = array('style' => array('title' => array('textAlign' => 'center')),
|
||||
'width' => 700, 'height' => 600, 'tabWidth' => 120, 'modal' => true, 'drag' => false, 'resize' => false, 'blinkToFront' => false
|
||||
);
|
||||
|
||||
/**
|
||||
* Constructor of the class dynaformEditor
|
||||
*
|
||||
* @param string $get
|
||||
* @return void
|
||||
*/
|
||||
public function dynaformEditor($get)
|
||||
{
|
||||
$this->panelConf = array_merge($this->panelConf, $this->defaultConfig['Editor']);
|
||||
//'title' => G::LoadTranslation('ID_DYNAFORM_EDITOR').' - ['.$this->title.']',
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the xml form default
|
||||
*
|
||||
* @param string $filename
|
||||
* @return void
|
||||
*/
|
||||
public function _createDefaultXmlForm($fileName)
|
||||
{
|
||||
//Create the default Dynaform
|
||||
$sampleForm = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
|
||||
$sampleForm .= '<dynaForm type="' . $this->dyn_type . '" name="" width="500" enabletemplate="0" mode="edit">' . "\n";
|
||||
switch ($this->dyn_type) {
|
||||
case "xmlform":
|
||||
/* $sampleForm.='<title type="title" enablehtml="0">' . "\n" .
|
||||
' <en>Sample form</en>' . "\n" .
|
||||
'</title>'."\n";
|
||||
$sampleForm.='<submit type="submit" enablehtml="0" onclick="">' . "\n" .
|
||||
' <en>Submit</en>' . "\n" .
|
||||
'</submit>'."\n"; */
|
||||
break;
|
||||
case "grid":
|
||||
/* $sampleForm.='<fieldA type="text" >' . "\n" .
|
||||
'<en>A</en>' . "\n" .
|
||||
'</fieldA>'."\n";
|
||||
$sampleForm.='<fieldB type="text" >' . "\n" .
|
||||
'<en>B</en>' . "\n" .
|
||||
'</fieldB>'."\n"; */
|
||||
break;
|
||||
}
|
||||
$sampleForm .= '</dynaForm>';
|
||||
G::verifyPath(dirname($fileName), true);
|
||||
$fp = fopen($fileName, 'w');
|
||||
$sampleForm = str_replace('name=""', 'name="' . $this->_getFilename($this->file) . '"', $sampleForm);
|
||||
fwrite($fp, $sampleForm);
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints the DynaformEditor
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function _render()
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
$script = '';
|
||||
|
||||
/* Start Block: Load (Create if doesn't exist) the xmlform */
|
||||
$Parameters = array('SYS_LANG' => SYS_LANG, 'URL' => G::encrypt($this->file, URL_KEY), 'DYN_UID' => $this->dyn_uid, 'PRO_UID' => $this->pro_uid, 'DYNAFORM_NAME' => $this->dyn_title, 'FILE' => $this->file, 'DYN_EDITOR' => $this->dyn_editor
|
||||
);
|
||||
$_SESSION['Current_Dynafom']['Parameters'] = $Parameters;
|
||||
|
||||
$XmlEditor = array('URL' => G::encrypt($this->file, URL_KEY), 'XML' => '' //$openDoc->getXml()
|
||||
);
|
||||
$JSEditor = array('URL' => G::encrypt($this->file, URL_KEY)
|
||||
);
|
||||
|
||||
$A = G::encrypt($this->file, URL_KEY);
|
||||
|
||||
try {
|
||||
$openDoc = new Xml_Document();
|
||||
$fileName = $this->home . $this->file . '.xml';
|
||||
if (file_exists($fileName)) {
|
||||
$openDoc->parseXmlFile($fileName);
|
||||
} else {
|
||||
$this->_createDefaultXmlForm($fileName);
|
||||
$openDoc->parseXmlFile($fileName);
|
||||
}
|
||||
//$form = new Form( $this->file , $this->home, SYS_LANG, true );
|
||||
$Properties = dynaformEditorAjax::get_properties($A, $this->dyn_uid);
|
||||
/* Start Block: Prepare the XMLDB connection */
|
||||
define('DB_XMLDB_HOST', PATH_DYNAFORM . $this->file . '.xml');
|
||||
define('DB_XMLDB_USER', '');
|
||||
define('DB_XMLDB_PASS', '');
|
||||
define('DB_XMLDB_NAME', '');
|
||||
define('DB_XMLDB_TYPE', 'myxml');
|
||||
/* Start Block: Prepare the dynaformEditor */
|
||||
$G_PUBLISH = new Publisher();
|
||||
$sName = 'dynaformEditor';
|
||||
$G_PUBLISH->publisherId = $sName;
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->setTitle(G::LoadTranslation('ID_DYNAFORM_EDITOR') . ' - ' . $Properties['DYN_TITLE']);
|
||||
$G_PUBLISH->AddContent('blank');
|
||||
$this->panelConf['title'] = '';
|
||||
$G_PUBLISH->AddContent('panel-init', 'mainPanel', $this->panelConf);
|
||||
if ($Properties['DYN_TYPE'] == 'xmlform') {
|
||||
$G_PUBLISH->AddContent('xmlform', 'toolbar', 'dynaforms/fields_Toolbar', 'display:none', $Parameters, '', '');
|
||||
} else {
|
||||
$G_PUBLISH->AddContent('xmlform', 'toolbar', 'dynaforms/fields_ToolbarGrid', 'display:none', $Parameters, '', '');
|
||||
}
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_Editor', 'display:none', $Parameters, '', '');
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_XmlEditor', 'display:none', $XmlEditor, '', '');
|
||||
$G_PUBLISH->AddContent('blank');
|
||||
$i = 0;
|
||||
$aFields = array();
|
||||
$aFields[] = array('XMLNODE_NAME' => 'char', 'TYPE' => 'char', 'UP' => 'char', 'DOWN' => 'char'
|
||||
);
|
||||
$oSession = new DBSession(new DBConnection(PATH_DYNAFORM . $this->file . '.xml', '', '', '', 'myxml'));
|
||||
$oDataset = $oSession->Execute('SELECT * FROM dynaForm WHERE NOT( XMLNODE_NAME = "" ) AND TYPE <> "pmconnection"');
|
||||
$iMaximun = $oDataset->count();
|
||||
while ($aRow = $oDataset->Read()) {
|
||||
$aFields[] = array('XMLNODE_NAME' => $aRow['XMLNODE_NAME'], 'TYPE' => $aRow['TYPE'], 'UP' => ($i > 0 ? G::LoadTranslation('ID_UP') : ''), 'DOWN' => ($i < $iMaximun - 1 ? G::LoadTranslation('ID_DOWN') : ''), 'row__' => ($i + 1)
|
||||
);
|
||||
$i++;
|
||||
break;
|
||||
}
|
||||
global $_DBArray;
|
||||
$_DBArray['fields'] = $aFields;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
$oCriteria = new Criteria('dbarray');
|
||||
$oCriteria->setDBArrayTable('fields');
|
||||
/**
|
||||
* *@Erik-> this is deprecated,.
|
||||
* (unuseful) $G_PUBLISH->AddContent('propeltable', 'paged-table', 'dynaforms/fields_List', $oCriteria, $Parameters, '', SYS_URI.'dynaforms/dynaforms_PagedTableAjax');**
|
||||
*/
|
||||
$G_PUBLISH->AddContent('blank');
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_JSEditor', 'display:none', $JSEditor, '', '');
|
||||
} catch (Exception $e) {
|
||||
|
||||
}
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_Properties', 'display:none', $Properties, '', '');
|
||||
//for showHide tab option @Neyek
|
||||
$G_PUBLISH->AddContent('blank');
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_PREVIEW"), $sName . '[3]', 'dynaformEditor.changeToPreview', 'dynaformEditor.saveCurrentView');
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_XML"), $sName . '[4]', 'dynaformEditor.changeToXmlCode', 'dynaformEditor.saveCurrentView');
|
||||
if ($Properties['DYN_TYPE'] != 'grid') {
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_HTML"), $sName . '[5]', 'dynaformEditor.changeToHtmlCode', 'dynaformEditor.saveCurrentView');
|
||||
}
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_FIELDS_LIST"), $sName . '[6]', 'dynaformEditor.changeToFieldsList', 'dynaformEditor.saveCurrentView');
|
||||
if ($Properties["DYN_TYPE"] != "grid") {
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_JAVASCRIPTS"), $sName . '[7]', 'dynaformEditor.changeToJavascripts', 'dynaformEditor.saveCurrentView');
|
||||
}
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_PROPERTIES"), $sName . '[8]', 'dynaformEditor.changeToProperties', 'dynaformEditor.saveCurrentView');
|
||||
|
||||
//for showHide tab option @Neyek
|
||||
if ($Properties["DYN_TYPE"] != "grid") {
|
||||
$G_PUBLISH->AddContent("panel-tab", G::LoadTranslation("ID_CONDITIONS_EDITOR"), $sName . "[9]", "dynaformEditor.changeToShowHide", "dynaformEditor.saveShowHide");
|
||||
}
|
||||
|
||||
$G_PUBLISH->AddContent('panel-close');
|
||||
$oHeadPublisher->addScriptFile("/js/maborak/core/maborak.loader.js",2);
|
||||
$oHeadPublisher->addScriptFile('/jscore/dynaformEditor/core/dynaformEditor.js');
|
||||
|
||||
$oHeadPublisher->addScriptFile('/js/codemirrorOld/js/codemirror.js',1);
|
||||
|
||||
$oHeadPublisher->addScriptFile('/js/grid/core/grid.js');
|
||||
$oHeadPublisher->addScriptCode('
|
||||
var DYNAFORM_URL="' . $Parameters['URL'] . '";
|
||||
leimnud.event.add(window,"load",function(){ loadEditor(); });
|
||||
');
|
||||
$oHeadPublisher->addScriptCode(' var jsMeta;var __usernameLoggedDE__ = "' . (isset($_SESSION['USR_USERNAME']) ? $_SESSION['USR_USERNAME'] : '') . '";var SYS_LANG = "' . SYS_LANG . '";var __DYN_UID__ = "' . $this->dyn_uid . '";');
|
||||
|
||||
$arrayParameterAux = $Parameters;
|
||||
$arrayParameterAux["DYNAFORM_NAME"] = base64_encode($arrayParameterAux["DYNAFORM_NAME"]);
|
||||
$oHeadPublisher->addScriptCode('var dynaformEditorParams = \'' . serialize($arrayParameterAux) . '\';');
|
||||
|
||||
G::RenderPage("publish", 'blank');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filename
|
||||
*
|
||||
* @param string $file
|
||||
* @return string
|
||||
*/
|
||||
public function _getFilename($file)
|
||||
{
|
||||
return (strcasecmp(substr($file, - 5), '_tmp0') == 0) ? substr($file, 0, strlen($file) - 5) : $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the temporal copy
|
||||
*
|
||||
* @param string $onOff
|
||||
* @return void
|
||||
*/
|
||||
public function _setUseTemporalCopy($onOff)
|
||||
{
|
||||
$file = self::_getFilename($this->file);
|
||||
if ($onOff) {
|
||||
$this->file = $file . '_tmp0';
|
||||
self::_setTmpData(array('useTmpCopy' => true ));
|
||||
if (!file_exists(PATH_DYNAFORM . $file . '.xml')) {
|
||||
$this->_createDefaultXmlForm(PATH_DYNAFORM . $file . '.xml');
|
||||
}
|
||||
//Creates a copy if it doesn't exist, else, use the old copy
|
||||
if (!file_exists(PATH_DYNAFORM . $this->file . '.xml')) {
|
||||
self::_copyFile(PATH_DYNAFORM . $file . '.xml', PATH_DYNAFORM . $this->file . '.xml');
|
||||
}
|
||||
if (!file_exists(PATH_DYNAFORM . $this->file . '.html') && file_exists(PATH_DYNAFORM . $file . '.html')) {
|
||||
self::_copyFile(PATH_DYNAFORM . $file . '.html', PATH_DYNAFORM . $this->file . '.html');
|
||||
}
|
||||
} else {
|
||||
$this->file = $file;
|
||||
self::_setTmpData(array());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set temporal data
|
||||
*
|
||||
* @param $data
|
||||
* @return void
|
||||
*/
|
||||
public function _setTmpData($data)
|
||||
{
|
||||
G::verifyPath(PATH_C . 'dynEditor/', true);
|
||||
$fp = fopen(PATH_C . 'dynEditor/' . session_id() . '.php', 'w');
|
||||
fwrite($fp, '$tmpData=unserialize(\'' . addcslashes(serialize($data), '\\\'') . '\');');
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get temporal data
|
||||
*
|
||||
* @param string $filename
|
||||
* @return array
|
||||
*/
|
||||
public function _getTmpData()
|
||||
{
|
||||
$tmpData = array();
|
||||
$file = PATH_C . 'dynEditor/' . session_id() . '.php';
|
||||
if (file_exists($file)) {
|
||||
eval(implode('', file($file)));
|
||||
}
|
||||
return $tmpData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy files
|
||||
*
|
||||
* @param file $from
|
||||
* @param file $to
|
||||
* @return void
|
||||
*/
|
||||
public function _copyFile($from, $to)
|
||||
{
|
||||
$copy = implode('', file($from));
|
||||
$fcopy = fopen($to, "w");
|
||||
fwrite($fcopy, $copy);
|
||||
fclose($fcopy);
|
||||
}
|
||||
}
|
||||
|
||||
interface iDynaformEditorAjax
|
||||
{
|
||||
//public function render_preview($A);
|
||||
}
|
||||
|
||||
* Dynaform - Dynaform
|
||||
/**
|
||||
* DynaformEditorAjax - DynaformEditorAjax class
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
class dynaformEditorAjax extends dynaformEditor implements iDynaformEditorAjax
|
||||
*/class dynaformEditorAjax extends dynaformEditor implements iDynaformEditorAjax
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
require_once ("classes" . PATH_SEP . "class.enterpriseUtils.php");
|
||||
|
||||
if (!defined("PM_VERSION")) {
|
||||
if (file_exists(PATH_METHODS . "login/version-pmos.php")) {
|
||||
@@ -9,6 +8,7 @@ if (!defined("PM_VERSION")) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class enterpriseClass extends PMPlugin
|
||||
{
|
||||
public function __construct()
|
||||
@@ -156,8 +156,3 @@ class enterpriseClass extends PMPlugin
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists("pmLicenseManager")) {
|
||||
require_once ("classes" . PATH_SEP . "class.pmLicenseManager.php");
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
require_once ("classes/model/Configuration.php");
|
||||
|
||||
|
||||
class EnterpriseUtils
|
||||
{
|
||||
public static function getInternetConnection()
|
||||
@@ -149,4 +150,3 @@ class EnterpriseUtils
|
||||
return $sw;
|
||||
}
|
||||
}
|
||||
|
||||
24
workflow/engine/classes/FeaturesDetail.php
Normal file
24
workflow/engine/classes/FeaturesDetail.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
|
||||
class featuresDetail
|
||||
{
|
||||
public $featureName;
|
||||
public $description = null;
|
||||
public $enabled = false;
|
||||
public $workspaces = null;
|
||||
|
||||
/**
|
||||
* This function is the constructor of the featuresDetail class
|
||||
*
|
||||
* @param string $featureName
|
||||
* @param string $name
|
||||
* @param string $description
|
||||
* @return void
|
||||
*/
|
||||
public function __construct ($featureName, $description = '')
|
||||
{
|
||||
$this->featureName = $featureName;
|
||||
$this->description = $description;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
class FieldValidator
|
||||
{
|
||||
/**
|
||||
@@ -240,4 +241,3 @@ class FieldValidator
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,32 @@
|
||||
*
|
||||
*/
|
||||
|
||||
class FileCache
|
||||
|
||||
/**
|
||||
* class.memcached.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.
|
||||
*
|
||||
*/class FileCache
|
||||
{
|
||||
function __construct ($dir)
|
||||
{
|
||||
@@ -122,4 +147,3 @@ class FileCache
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
class FormBatchRouting extends Form
|
||||
{
|
||||
public function getVars($bWhitSystemVars = true)
|
||||
@@ -18,4 +19,3 @@ class FormBatchRouting extends Form
|
||||
return $aFields;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,13 +29,14 @@ require_once 'classes/model/Groupwf.php';
|
||||
require_once 'classes/model/GroupUser.php';
|
||||
require_once 'classes/model/Users.php';
|
||||
|
||||
/**
|
||||
* Groups - Groups
|
||||
/**
|
||||
* Groups - Groups class
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
* @copyright 2007 COLOSA
|
||||
*/
|
||||
class Groups
|
||||
*/class Groups
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -463,4 +464,3 @@ class Groups
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,18 +26,14 @@
|
||||
*/
|
||||
|
||||
require_once 'propel/util/BasePeer.php';
|
||||
// The object class -- needed for instanceof checks in this class.
|
||||
// actual class may be a subclass -- as returned by ApplicationPeer::getOMClass()
|
||||
include_once 'classes/model/Application.php';
|
||||
|
||||
// The object
|
||||
/**
|
||||
* Base static class for performing query and update operations on the 'APPLICATION' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
abstract class GulliverBasePeer
|
||||
*/abstract class GulliverBasePeer
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -702,20 +698,3 @@ abstract class GulliverBasePeer
|
||||
}
|
||||
|
||||
} // BaseApplicationPeer
|
||||
|
||||
|
||||
// static code to register the map builder for this Peer with the main Propel class
|
||||
if (Propel::isInit()) {
|
||||
// the MapBuilder classes register themselves with Propel during initialization
|
||||
// so we need to load them here.
|
||||
try {
|
||||
BaseApplicationPeer::getMapBuilder();
|
||||
} catch (Exception $e) {
|
||||
Propel::log( 'Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR );
|
||||
}
|
||||
} else {
|
||||
// even if Propel is not yet initialized, the map builder class can be registered
|
||||
// now and then it will be loaded when Propel initializes.
|
||||
require_once 'classes/model/map/ApplicationMapBuilder.php';
|
||||
Propel::registerMapBuilder( 'classes.model.map.ApplicationMapBuilder' );
|
||||
}
|
||||
79
workflow/engine/classes/Gzip_File.php
Normal file
79
workflow/engine/classes/Gzip_File.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
/*--------------------------------------------------
|
||||
* TAR/GZIP/BZIP2/ZIP ARCHIVE CLASSES 2.1
|
||||
* By Devin Doucette
|
||||
* Copyright (c) 2005 Devin Doucette
|
||||
* Email: darksnoopy@shaw.ca
|
||||
*--------------------------------------------------
|
||||
* Email bugs/suggestions to darksnoopy@shaw.ca
|
||||
*--------------------------------------------------
|
||||
* This script has been created and released under
|
||||
* the GNU GPL and is free to use and redistribute
|
||||
* 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 tar_file
|
||||
{
|
||||
|
||||
/**
|
||||
* This function is the constructor of the class gzip_file
|
||||
*
|
||||
* @param string $name
|
||||
* @return void
|
||||
*/
|
||||
public function gzip_file ($name)
|
||||
{
|
||||
$this->tar_file( $name );
|
||||
$this->options['type'] = "gzip";
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is employed to create files .
|
||||
* gzip
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
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 );
|
||||
}
|
||||
gzclose( $fp );
|
||||
chdir( $pwd );
|
||||
} else {
|
||||
$this->error[] = "Could not open {$this->options['name']} for writing.";
|
||||
chdir( $pwd );
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
$this->archive = gzencode( $this->archive, $this->options['level'] );
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function open a archive of the class gzip_file
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function open_archive ()
|
||||
{
|
||||
return @gzopen( $this->options['name'], "rb" );
|
||||
}
|
||||
}
|
||||
6
workflow/engine/classes/IDynaformEditorAjax.php
Normal file
6
workflow/engine/classes/IDynaformEditorAjax.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
interface iDynaformEditorAjax
|
||||
{
|
||||
//public function render_preview($A);
|
||||
}
|
||||
68
workflow/engine/classes/InvalidIndexSearchTextException.php
Normal file
68
workflow/engine/classes/InvalidIndexSearchTextException.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2012 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* 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, 5304 Ventura Drive,
|
||||
* Delray Beach, FL, 33484, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once "classes/model/Application.php";
|
||||
require_once "classes/model/AppDelegation.php";
|
||||
require_once "classes/model/AppThread.php";
|
||||
require_once "classes/model/Content.php";
|
||||
require_once "classes/model/Users.php";
|
||||
require_once "classes/model/GroupUser.php";
|
||||
require_once "classes/model/Task.php";
|
||||
require_once "classes/model/TaskUser.php";
|
||||
require_once "classes/model/Dynaform.php";
|
||||
require_once "classes/model/ProcessVariables.php";
|
||||
require_once "entities/SolrRequestData.php";
|
||||
require_once "entities/SolrUpdateDocument.php";
|
||||
require_once "entities/AppSolrQueue.php";
|
||||
require_once "classes/model/AppSolrQueue.php";
|
||||
|
||||
|
||||
/**
|
||||
* Invalid search text for Solr exception
|
||||
*
|
||||
* @author Herbert Saal Gutierrez
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Invalid search text for Solr exception
|
||||
*
|
||||
* @author Herbert Saal Gutierrez
|
||||
*
|
||||
*/class InvalidIndexSearchTextException extends Exception
|
||||
{
|
||||
// Redefine the exception so message isn't optional
|
||||
public function __construct($message, $code = 0)
|
||||
{
|
||||
// some code
|
||||
// make sure everything is assigned properly
|
||||
parent::__construct ($message, $code);
|
||||
}
|
||||
|
||||
// custom string representation of object
|
||||
public function __toString()
|
||||
{
|
||||
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,11 @@ if (! defined( 'JAVA_BRIDGE_HOST' )) {
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
class JavaBridgePM
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/class JavaBridgePM
|
||||
{
|
||||
public $JavaBridgeDir = JAVA_BRIDGE_PATH;
|
||||
public $JavaBridgePort = JAVA_BRIDGE_PORT;
|
||||
@@ -174,4 +178,3 @@ class JavaBridgePM
|
||||
printf( "saved %s bytes in file %s \n", $iSize, $reportFilename );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
|
||||
class labelsGmail
|
||||
{
|
||||
function listLabels($service)
|
||||
@@ -1,38 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* class.ldapAdvanced.php
|
||||
* LDAP plugin for the RBAC class. This class encapsulates all the methods required in order to bind
|
||||
* ProcessMaker and a Ldap Directory server.
|
||||
*
|
||||
* @author
|
||||
* Fernando Ontiveros
|
||||
* Colosa
|
||||
* @copyright
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.
|
||||
* @package plugins.ldapAdvanced.classes
|
||||
*/
|
||||
|
||||
// evaluating the requiring of some classes
|
||||
if (!class_exists("Department")) {
|
||||
require_once "classes/model/Department.php";
|
||||
}
|
||||
|
||||
if (!class_exists("Groupwf")) {
|
||||
require_once "classes/model/Groupwf.php";
|
||||
}
|
||||
|
||||
if (!class_exists("GroupUser")) {
|
||||
require_once "classes/model/GroupUser.php";
|
||||
}
|
||||
|
||||
if (!class_exists("RbacUsers")) {
|
||||
require_once PATH_RBAC."model/RbacUsers.php";
|
||||
}
|
||||
|
||||
if (!class_exists("RBAC")) {
|
||||
require_once PATH_TRUNK . "gulliver/system/class.rbac.php";
|
||||
}
|
||||
|
||||
* LDAP plugin for the RBAC class. This
|
||||
class ldapAdvanced
|
||||
{
|
||||
/**
|
||||
@@ -25,7 +25,33 @@
|
||||
* @history---------------------------------------------
|
||||
* see CHANGELOG
|
||||
*/
|
||||
class license_application extends padl
|
||||
|
||||
/**
|
||||
* Project: Distrubution License Class
|
||||
* File: class.license.app.php
|
||||
*
|
||||
* Copyright (C) 2005 Oliver Lillie
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation; either version 2 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 General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* @link http://www.buggedcom.co.uk/
|
||||
* @link http://www.phpclasses.org/browse/package/2298.html
|
||||
* @author Oliver Lillie, buggedcom <publicmail at buggedcom dot co dot uk>
|
||||
* @history---------------------------------------------
|
||||
* see CHANGELOG
|
||||
*/class license_application extends padl
|
||||
{
|
||||
/**
|
||||
* The number of allowed differences between the $_SERVER vars and the vars
|
||||
@@ -513,4 +539,3 @@ class license_application extends padl
|
||||
return (empty($data['RESULT'])) ? 'SOCKET_FAILED' : $data['RESULT'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,13 @@
|
||||
*
|
||||
* Exports the database and copies the files to an tar archive o several if the max filesize is reached.
|
||||
*/
|
||||
class multipleFilesBackup
|
||||
|
||||
/**
|
||||
* Class MultipleFilesBackup
|
||||
* create a backup of this workspace
|
||||
*
|
||||
* Exports the database and copies the files to an tar archive o several if the max filesize is reached.
|
||||
*/class multipleFilesBackup
|
||||
{
|
||||
private $dir_to_compress = "";
|
||||
private $filename = "backUpProcessMaker.tar";
|
||||
@@ -228,4 +234,3 @@ class multipleFilesBackup
|
||||
CLI::logging( CLI::info( "Done restoring" ) . "\n" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,11 @@
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
|
||||
class NET
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/class NET
|
||||
{
|
||||
public $hostname;
|
||||
public $ip;
|
||||
@@ -578,17 +582,3 @@ class NET
|
||||
return $this->errstr;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
class Stat
|
||||
{
|
||||
public $stutus;
|
||||
|
||||
public function __construct ()
|
||||
{
|
||||
$this->status = false;
|
||||
}
|
||||
}
|
||||
91
workflow/engine/classes/ObjectCellection.php
Normal file
91
workflow/engine/classes/ObjectCellection.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
/**
|
||||
* class.processes.php
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* ObjectDocument Collection
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*/class ObjectCellection
|
||||
{
|
||||
public $num;
|
||||
public $swapc;
|
||||
public $objects;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->objects = Array();
|
||||
$this->num = 0;
|
||||
$this->swapc = $this->num;
|
||||
array_push($this->objects, 'void');
|
||||
}
|
||||
|
||||
/**
|
||||
* add in the collecetion a new object Document
|
||||
*
|
||||
* @param $name name object document
|
||||
* @param $type type object document
|
||||
* @param $data data object document
|
||||
* @param $origin origin object document
|
||||
* @return void
|
||||
*/
|
||||
public function add($name, $type, $data, $origin)
|
||||
{
|
||||
$o = new ObjectDocument();
|
||||
$o->name = $name;
|
||||
$o->type = $type;
|
||||
$o->data = $data;
|
||||
$o->origin = $origin;
|
||||
|
||||
$this->num++;
|
||||
array_push($this->objects, $o);
|
||||
$this->swapc = $this->num;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the collection of ObjectDocument
|
||||
*
|
||||
* @param $name name object document
|
||||
* @param $type type object document
|
||||
* @param $data data object document
|
||||
* @param $origin origin object document
|
||||
* @return void
|
||||
*/
|
||||
public function get()
|
||||
{
|
||||
if ($this->swapc > 0) {
|
||||
$e = $this->objects[$this->swapc];
|
||||
$this->swapc--;
|
||||
return $e;
|
||||
} else {
|
||||
$this->swapc = $this->num;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
49
workflow/engine/classes/ObjectDocument.php
Normal file
49
workflow/engine/classes/ObjectDocument.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/**
|
||||
* class.processes.php
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Object Document class
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*/class ObjectDocument
|
||||
{
|
||||
public $type;
|
||||
public $name;
|
||||
public $data;
|
||||
public $origin;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->type = '';
|
||||
$this->name = '';
|
||||
$this->data = '';
|
||||
$this->origin = '';
|
||||
}
|
||||
}
|
||||
@@ -6,14 +6,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
abstract class patch
|
||||
{
|
||||
static protected $isPathchable = false;
|
||||
static public $dbAdapter = 'mysql';
|
||||
abstract static public function isApplicable();
|
||||
abstract static public function execute();
|
||||
}
|
||||
|
||||
abstract
|
||||
class p11835 extends patch
|
||||
{
|
||||
/*
|
||||
@@ -116,4 +109,3 @@ class p11835 extends patch
|
||||
echo $count . " records where patched to use SELF_SERVICE feature.\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
require_once 'classes/interfaces/dashletInterface.php';
|
||||
require_once 'classes/interfaces/DashletInterface.php';
|
||||
require_once 'classes/model/Dashlet.php';
|
||||
require_once 'classes/model/DashletInstance.php';
|
||||
|
||||
|
||||
class PMDashlet extends DashletInstance implements DashletInterface
|
||||
{
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.pmDrive.php
|
||||
*
|
||||
* @package workflow.engine.
|
||||
/**
|
||||
* class.pmDrive.php
|
||||
*
|
||||
* @package workflow.engine.class
|
||||
*
|
||||
*/
|
||||
|
||||
class PMDrive extends PMGoogleApi
|
||||
*/class PMDrive extends PMGoogleApi
|
||||
{
|
||||
private $folderIdPMDrive = '';
|
||||
private $folderNamePMDrive;
|
||||
@@ -7,7 +7,11 @@
|
||||
|
||||
require_once PATH_TRUNK . 'vendor' . PATH_SEP . 'google' . PATH_SEP . 'apiclient' . PATH_SEP . 'src' . PATH_SEP . 'Google' . PATH_SEP . 'autoload.php';
|
||||
|
||||
class PMGoogleApi
|
||||
|
||||
/**
|
||||
* class.pmGoogleApi.php
|
||||
*
|
||||
*/class PMGoogleApi
|
||||
{
|
||||
const DRIVE = 'https://www.googleapis.com/auth/drive';
|
||||
const DRIVE_FILE = 'https://www.googleapis.com/auth/drive.file';
|
||||
@@ -1,27 +1,5 @@
|
||||
<?php
|
||||
|
||||
class featuresDetail
|
||||
{
|
||||
public $featureName;
|
||||
public $description = null;
|
||||
public $enabled = false;
|
||||
public $workspaces = null;
|
||||
|
||||
/**
|
||||
* This function is the constructor of the featuresDetail class
|
||||
*
|
||||
* @param string $featureName
|
||||
* @param string $name
|
||||
* @param string $description
|
||||
* @return void
|
||||
*/
|
||||
public function __construct ($featureName, $description = '')
|
||||
{
|
||||
$this->featureName = $featureName;
|
||||
$this->description = $description;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class PMLicensedFeatures
|
||||
{
|
||||
@@ -35,57 +35,11 @@ use ProcessMaker\Plugins\PluginRegistry;
|
||||
require_once 'class.plugin.php';
|
||||
|
||||
|
||||
class pluginDetail
|
||||
{
|
||||
public $sNamespace;
|
||||
public $sClassName;
|
||||
public $sFriendlyName = null;
|
||||
public $sDescription = null;
|
||||
public $sSetupPage = null;
|
||||
public $sFilename;
|
||||
public $sPluginFolder = '';
|
||||
public $sCompanyLogo = '';
|
||||
public $iVersion = 0;
|
||||
public $enabled = false;
|
||||
public $aWorkspaces = null;
|
||||
public $bPrivate = false;
|
||||
|
||||
/**
|
||||
* This function is the constructor of the pluginDetail class
|
||||
*
|
||||
* @param string $sNamespace
|
||||
* @param string $sClassName
|
||||
* @param string $sFilename
|
||||
* @param string $sFriendlyName
|
||||
* @param string $sPluginFolder
|
||||
* @param string $sDescription
|
||||
* @param string $sSetupPage
|
||||
* @param integer $iVersion
|
||||
* @return void
|
||||
*/
|
||||
public function __construct ($sNamespace, $sClassName, $sFilename, $sFriendlyName = '', $sPluginFolder = '', $sDescription = '', $sSetupPage = '', $iVersion = 0)
|
||||
{
|
||||
$this->sNamespace = $sNamespace;
|
||||
$this->sClassName = $sClassName;
|
||||
$this->sFriendlyName = $sFriendlyName;
|
||||
$this->sDescription = $sDescription;
|
||||
$this->sSetupPage = $sSetupPage;
|
||||
$this->iVersion = $iVersion;
|
||||
$this->sFilename = $sFilename;
|
||||
if ($sPluginFolder == '') {
|
||||
$this->sPluginFolder = $sNamespace;
|
||||
} else {
|
||||
$this->sPluginFolder = $sPluginFolder;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
|
||||
class PMPluginRegistry
|
||||
*/class PMPluginRegistry
|
||||
{
|
||||
private $_aPluginDetails = array ();
|
||||
private $_aPlugins = array ();
|
||||
@@ -25,13 +25,13 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* The ProcessMaker memcached
|
||||
/**
|
||||
* The ProcessMaker memcached class
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*/
|
||||
|
||||
class PMmemcached
|
||||
*/class PMmemcached
|
||||
{
|
||||
const ONE_MINUTE = 60;
|
||||
const ONE_HOUR = 3600;
|
||||
@@ -65,7 +65,6 @@ class PMmemcached
|
||||
$this->version = $this->mem->getVersion();
|
||||
}
|
||||
} else {
|
||||
require_once ("classes" . PATH_SEP . "class.fileCache.php");
|
||||
|
||||
//Create cache folder
|
||||
$cacheFolder = PATH_DATA . "sites". PATH_SEP . $workspace . PATH_SEP . "cachefiles" . PATH_SEP;
|
||||
@@ -218,4 +217,3 @@ class PMmemcached
|
||||
echo "</table>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,34 @@
|
||||
* @history---------------------------------------------
|
||||
* see CHANGELOG
|
||||
*/
|
||||
class padl
|
||||
|
||||
/**
|
||||
* Project: Distrubution License Class
|
||||
* File: class.license.lib.php
|
||||
*
|
||||
* Copyright (C) 2005 Oliver Lillie
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation; either version 2 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 General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* @link http://www.buggedcom.co.uk/
|
||||
* @link http://www.phpclasses.org/browse/package/2298.html
|
||||
* @author Oliver Lillie, buggedcom <publicmail at buggedcom dot co dot uk>
|
||||
* @version 0.1
|
||||
* @history---------------------------------------------
|
||||
* see CHANGELOG
|
||||
*/class padl
|
||||
{
|
||||
/**
|
||||
* hash key 1 used to encrypt the generate key data.
|
||||
@@ -673,32 +700,3 @@ class padl
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* custom functions to aid in debugging
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
function trace()
|
||||
{
|
||||
$message = '';
|
||||
for ($i = 0; $i < func_num_args(); $i++) {
|
||||
if (is_array(func_get_arg($i))) {
|
||||
trace_r(func_get_arg($i));
|
||||
} else {
|
||||
$message .= func_get_arg($i);
|
||||
}
|
||||
if ($i <= func_num_args() - 2) {
|
||||
$message.=' : ';
|
||||
}
|
||||
}
|
||||
echo "<br><b>\r\r" . $message . "\r\r</b>";
|
||||
}
|
||||
|
||||
function trace_r($array = "array is empty")
|
||||
{
|
||||
echo "<pre><b>\r\r";
|
||||
print_r($array);
|
||||
echo "\r\r</b></pre>";
|
||||
}
|
||||
|
||||
19
workflow/engine/classes/Patch.php
Normal file
19
workflow/engine/classes/Patch.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class, helping to set some not desirable settings but necesary
|
||||
* @author reav
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* class, helping to set some not desirable settings but necesary
|
||||
* @author reav
|
||||
*
|
||||
*/abstract class patch
|
||||
{
|
||||
static protected $isPathchable = false;
|
||||
static public $dbAdapter = 'mysql';
|
||||
abstract static public function isApplicable();
|
||||
abstract static public function execute();
|
||||
}
|
||||
85
workflow/engine/classes/PluginDetail.php
Normal file
85
workflow/engine/classes/PluginDetail.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.pluginRegistry.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.
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
|
||||
require_once 'class.plugin.php';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/class pluginDetail
|
||||
{
|
||||
public $sNamespace;
|
||||
public $sClassName;
|
||||
public $sFriendlyName = null;
|
||||
public $sDescription = null;
|
||||
public $sSetupPage = null;
|
||||
public $sFilename;
|
||||
public $sPluginFolder = '';
|
||||
public $sCompanyLogo = '';
|
||||
public $iVersion = 0;
|
||||
public $enabled = false;
|
||||
public $aWorkspaces = null;
|
||||
public $bPrivate = false;
|
||||
|
||||
/**
|
||||
* This function is the constructor of the pluginDetail class
|
||||
*
|
||||
* @param string $sNamespace
|
||||
* @param string $sClassName
|
||||
* @param string $sFilename
|
||||
* @param string $sFriendlyName
|
||||
* @param string $sPluginFolder
|
||||
* @param string $sDescription
|
||||
* @param string $sSetupPage
|
||||
* @param integer $iVersion
|
||||
* @return void
|
||||
*/
|
||||
public function __construct ($sNamespace, $sClassName, $sFilename, $sFriendlyName = '', $sPluginFolder = '', $sDescription = '', $sSetupPage = '', $iVersion = 0)
|
||||
{
|
||||
$this->sNamespace = $sNamespace;
|
||||
$this->sClassName = $sClassName;
|
||||
$this->sFriendlyName = $sFriendlyName;
|
||||
$this->sDescription = $sDescription;
|
||||
$this->sSetupPage = $sSetupPage;
|
||||
$this->iVersion = $iVersion;
|
||||
$this->sFilename = $sFilename;
|
||||
if ($sPluginFolder == '') {
|
||||
$this->sPluginFolder = $sNamespace;
|
||||
} else {
|
||||
$this->sPluginFolder = $sPluginFolder;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,14 @@
|
||||
* @author Roly Rudy Gutierrez Pinto
|
||||
* @package engine.classes
|
||||
*/
|
||||
class pmDynaform
|
||||
|
||||
/**
|
||||
* class.pmDynaform.php
|
||||
* Implementing pmDynaform library in the running case.
|
||||
*
|
||||
* @author Roly Rudy Gutierrez Pinto
|
||||
* @package engine.classes
|
||||
*/class pmDynaform
|
||||
{
|
||||
|
||||
public static $instance = null;
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
|
||||
class pmGauge
|
||||
{
|
||||
|
||||
@@ -280,4 +281,3 @@ class pmGauge
|
||||
imagettftext($im, 9, 0, $centerX, $centerY, $black, $fontArial, $textToDisplay);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,13 +2,16 @@
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
require_once PATH_CORE . 'classes' . PATH_SEP . 'class.enterpriseUtils.php';
|
||||
|
||||
/**
|
||||
* class.pmLicenseManager.php
|
||||
*
|
||||
*/
|
||||
class pmLicenseManager
|
||||
|
||||
/**
|
||||
* class.pmLicenseManager.php
|
||||
*
|
||||
*/class pmLicenseManager
|
||||
{
|
||||
|
||||
private static $instance = null;
|
||||
@@ -22,8 +25,6 @@ class pmLicenseManager
|
||||
//include_once (PATH_PLUGINS . 'enterprise' . PATH_SEP . 'classes' . PATH_SEP . 'class.license.lib.php');
|
||||
//include_once (PATH_PLUGINS . 'enterprise' . PATH_SEP . 'classes' . PATH_SEP . 'class.license.app.php');
|
||||
|
||||
require_once PATH_CORE . 'classes' . PATH_SEP . 'class.license.lib.php';
|
||||
require_once PATH_CORE . 'classes' . PATH_SEP . 'class.license.app.php';
|
||||
|
||||
//searching .dat files in workspace folder
|
||||
$server_array = $_SERVER;
|
||||
@@ -510,4 +511,3 @@ class pmLicenseManager
|
||||
return unserialize(G::decrypt($this->serial, file_get_contents(PATH_PLUGINS . 'enterprise/data/default')));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ if (! class_exists( 'Phing' )) {
|
||||
throw new Exception( 'Fatal Error: Phing is not loaded!' );
|
||||
}
|
||||
|
||||
|
||||
class pmPhing extends Phing
|
||||
{
|
||||
|
||||
@@ -46,4 +47,3 @@ class pmPhing extends Phing
|
||||
return 'pmPhing Ver 1.0';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
class pmSsoClass extends PMPlugin {
|
||||
|
||||
/**
|
||||
* class.pmSso.php
|
||||
*
|
||||
*/ class pmSsoClass extends PMPlugin {
|
||||
function __construct() {
|
||||
}
|
||||
|
||||
@@ -63,4 +67,3 @@
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -26,14 +26,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* popupMenu - popupMenu
|
||||
/**
|
||||
* popupMenu - popupMenu class
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
* @copyright COLOSA
|
||||
*/
|
||||
|
||||
class popupMenu extends form
|
||||
*/class popupMenu extends form
|
||||
{
|
||||
var $type = 'popupMenu';
|
||||
var $theme = 'processmaker';
|
||||
@@ -73,27 +73,3 @@ class popupMenu extends form
|
||||
return $sc;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* XmlForm_Field_popupOption - XmlForm_Field_popupOption class
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
* @copyright COLOSA
|
||||
*/
|
||||
|
||||
class XmlForm_Field_popupOption extends XmlForm_Field
|
||||
{
|
||||
var $launch = '';
|
||||
|
||||
/**
|
||||
* Get Events
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getEvents ()
|
||||
{
|
||||
$script = '{name:"' . $this->name . '",text:"' . addcslashes( $this->label, '\\"' ) . '", launch:leimnud.closure({Function:function(target){' . $this->launch . '}, args:target})}';
|
||||
return $script;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,31 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
class Processes
|
||||
|
||||
/**
|
||||
* class.processes.php
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* 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.
|
||||
*/class Processes
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -6183,96 +6207,3 @@ class Processes
|
||||
return $proTitle;
|
||||
}
|
||||
}
|
||||
|
||||
//end class processes
|
||||
|
||||
|
||||
/**
|
||||
* Object Document class
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*/
|
||||
class ObjectDocument
|
||||
{
|
||||
public $type;
|
||||
public $name;
|
||||
public $data;
|
||||
public $origin;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->type = '';
|
||||
$this->name = '';
|
||||
$this->data = '';
|
||||
$this->origin = '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ObjectDocument Collection
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*/
|
||||
class ObjectCellection
|
||||
{
|
||||
public $num;
|
||||
public $swapc;
|
||||
public $objects;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->objects = Array();
|
||||
$this->num = 0;
|
||||
$this->swapc = $this->num;
|
||||
array_push($this->objects, 'void');
|
||||
}
|
||||
|
||||
/**
|
||||
* add in the collecetion a new object Document
|
||||
*
|
||||
* @param $name name object document
|
||||
* @param $type type object document
|
||||
* @param $data data object document
|
||||
* @param $origin origin object document
|
||||
* @return void
|
||||
*/
|
||||
public function add($name, $type, $data, $origin)
|
||||
{
|
||||
$o = new ObjectDocument();
|
||||
$o->name = $name;
|
||||
$o->type = $type;
|
||||
$o->data = $data;
|
||||
$o->origin = $origin;
|
||||
|
||||
$this->num++;
|
||||
array_push($this->objects, $o);
|
||||
$this->swapc = $this->num;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the collection of ObjectDocument
|
||||
*
|
||||
* @param $name name object document
|
||||
* @param $type type object document
|
||||
* @param $data data object document
|
||||
* @param $origin origin object document
|
||||
* @return void
|
||||
*/
|
||||
public function get()
|
||||
{
|
||||
if ($this->swapc > 0) {
|
||||
$e = $this->objects[$this->swapc];
|
||||
$this->swapc--;
|
||||
return $e;
|
||||
} else {
|
||||
$this->swapc = $this->num;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,15 @@ use ProcessMaker\Plugins\PluginRegistry;
|
||||
* dependencies TemplatePower Form XmlForm
|
||||
*/
|
||||
|
||||
class propelTable
|
||||
|
||||
/**
|
||||
* Class pagedTable
|
||||
*
|
||||
* @author David S. Callizaya S. <davidsantos@colosa.com> *
|
||||
* @access public
|
||||
* @package workflow.gulliver.system
|
||||
* dependencies TemplatePower Form XmlForm
|
||||
*/class propelTable
|
||||
{
|
||||
public $xmlFormFile;
|
||||
public $currentPage;
|
||||
@@ -910,4 +918,3 @@ class propelTable
|
||||
G::RenderPage( "publish", "blank" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,11 @@
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
|
||||
class replacementLogo
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/class replacementLogo
|
||||
{
|
||||
|
||||
//var $dir='';
|
||||
@@ -109,4 +113,3 @@ class replacementLogo
|
||||
return ($ainfoLogo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,15 +26,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Report - Report
|
||||
/**
|
||||
* Report - Report class
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
* @author Everth S. Berrios Morales
|
||||
* @copyright 2008 COLOSA
|
||||
*/
|
||||
|
||||
class Report
|
||||
*/class Report
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -852,4 +852,3 @@ class Report
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,15 +26,15 @@
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* ReportTables - Report tables
|
||||
/**
|
||||
* ReportTables - Report tables class
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
* @author Julio Cesar Laura Avenda<EFBFBD>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'
|
||||
@@ -844,4 +844,3 @@ class ReportTables
|
||||
return ($PropelDatabase);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
/**
|
||||
* ServerConfiguration - serverConf
|
||||
/**
|
||||
* ServerConfiguration - serverConf class
|
||||
*
|
||||
@@ -32,8 +34,7 @@
|
||||
* @copyright 2010 COLOSA
|
||||
* @license GNU Affero General Public License
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*/
|
||||
class serverConf
|
||||
*/class serverConf
|
||||
{
|
||||
|
||||
private $_aProperties = array();
|
||||
@@ -110,7 +111,7 @@ class serverConf
|
||||
self::$instance = new serverConf();
|
||||
}
|
||||
|
||||
if ($instance = @unserialize($serialized)) {
|
||||
if ($instance = unserialize($serialized)) {
|
||||
self::$instance = $instance;
|
||||
}
|
||||
}
|
||||
@@ -26,15 +26,15 @@
|
||||
*/
|
||||
require_once 'classes/model/Session.php';
|
||||
|
||||
/**
|
||||
* Sessions - Sessions
|
||||
/**
|
||||
* Sessions - Sessions class
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
* @author Everth S. Berrios Morales
|
||||
* @copyright 2008 COLOSA
|
||||
*/
|
||||
|
||||
class Sessions
|
||||
*/class Sessions
|
||||
{
|
||||
|
||||
protected $tmpfile;
|
||||
@@ -258,21 +258,3 @@ class Sessions
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -39,21 +39,11 @@
|
||||
* =========
|
||||
*
|
||||
* 24-03-2010 Erik A.O. <erik@colosa.com>
|
||||
* class: the $ExceptionCode and $aWarnings class attributes were added
|
||||
* function handleFrom(): Validations for invalid data for {$this->fileData['from_email']} were added
|
||||
* function resendEmails(): handler for warnings was added and fixes
|
||||
* function getWarnings(): added
|
||||
* function sendMail(): now is handling the exception
|
||||
*/
|
||||
|
||||
require_once ('classes/model/AppMessage.php');
|
||||
|
||||
* class: the $ExceptionCode and $aWarnings
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*/
|
||||
|
||||
class spoolRun
|
||||
*/class spoolRun
|
||||
{
|
||||
public $config;
|
||||
private $fileData;
|
||||
@@ -702,4 +692,3 @@ class spoolRun
|
||||
return $sUID;
|
||||
}
|
||||
}
|
||||
|
||||
24
workflow/engine/classes/Stat.php
Normal file
24
workflow/engine/classes/Stat.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* LastModification 30/05/2008
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/class Stat
|
||||
{
|
||||
public $stutus;
|
||||
|
||||
public function __construct ()
|
||||
{
|
||||
$this->status = false;
|
||||
}
|
||||
}
|
||||
175
workflow/engine/classes/Tar_File.php
Normal file
175
workflow/engine/classes/Tar_File.php
Normal file
@@ -0,0 +1,175 @@
|
||||
<?php
|
||||
/*--------------------------------------------------
|
||||
* TAR/GZIP/BZIP2/ZIP ARCHIVE CLASSES 2.1
|
||||
* By Devin Doucette
|
||||
* Copyright (c) 2005 Devin Doucette
|
||||
* Email: darksnoopy@shaw.ca
|
||||
*--------------------------------------------------
|
||||
* Email bugs/suggestions to darksnoopy@shaw.ca
|
||||
*--------------------------------------------------
|
||||
* This script has been created and released under
|
||||
* the GNU GPL and is free to use and redistribute
|
||||
* only if this copyright statement is not removed
|
||||
*--------------------------------------------------*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
|
||||
/**
|
||||
* This class is derived from the class archive, is imployed to use files .
|
||||
* tar
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*
|
||||
*/class tar_file extends archive
|
||||
{
|
||||
|
||||
/**
|
||||
* This function is the constructor of the class tar_file
|
||||
*
|
||||
* @param string $name
|
||||
*/
|
||||
public function tar_file ($name)
|
||||
{
|
||||
$this->archive( $name );
|
||||
$this->options['type'] = "tar";
|
||||
}
|
||||
|
||||
/**
|
||||
* This function create a file .
|
||||
* tar
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function create_tar ()
|
||||
{
|
||||
$pwd = getcwd();
|
||||
chdir( $this->options['basedir'] );
|
||||
foreach ($this->files as $current) {
|
||||
if ($current['name'] == $this->options['name']) {
|
||||
continue;
|
||||
}
|
||||
if (strlen( $current['name2'] ) > 99) {
|
||||
$path = substr( $current['name2'], 0, strpos( $current['name2'], "/", strlen( $current['name2'] ) - 100 ) + 1 );
|
||||
$current['name2'] = substr( $current['name2'], strlen( $path ) );
|
||||
if (strlen( $path ) > 154 || strlen( $current['name2'] ) > 99) {
|
||||
$this->error[] = "Could not add {$path}{$current['name2']} to archive because the filename is too long.";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$block = pack( "a100a8a8a8a12a12a8a1a100a6a2a32a32a8a8a155a12", $current['name2'], sprintf( "%07o", $current['stat'][2] ), sprintf( "%07o", $current['stat'][4] ), sprintf( "%07o", $current['stat'][5] ), sprintf( "%011o", $current['type'] == 2 ? 0 : $current['stat'][7] ), sprintf( "%011o", $current['stat'][9] ), " ", $current['type'], $current['type'] == 2 ? @readlink( $current['name'] ) : "", "ustar ", " ", "Unknown", "Unknown", "", "", ! empty( $path ) ? $path : "", "" );
|
||||
$checksum = 0;
|
||||
for ($i = 0; $i < 512; $i ++) {
|
||||
$checksum += ord( substr( $block, $i, 1 ) );
|
||||
}
|
||||
$checksum = pack( "a8", sprintf( "%07o", $checksum ) );
|
||||
$block = substr_replace( $block, $checksum, 148, 8 );
|
||||
if ($current['type'] == 2 || $current['stat'][7] == 0) {
|
||||
$this->add_data( $block );
|
||||
} elseif ($fp = @fopen( $current['name'], "rb" )) {
|
||||
$this->add_data( $block );
|
||||
while ($temp = fread( $fp, 1048576 )) {
|
||||
$this->add_data( $temp );
|
||||
}
|
||||
if ($current['stat'][7] % 512 > 0) {
|
||||
$temp = "";
|
||||
for ($i = 0; $i < 512 - $current['stat'][7] % 512; $i ++) {
|
||||
$temp .= "\0";
|
||||
}
|
||||
$this->add_data( $temp );
|
||||
}
|
||||
fclose( $fp );
|
||||
} else {
|
||||
$this->error[] = "Could not open file {$current['name']} for reading. It was not added.";
|
||||
}
|
||||
}
|
||||
$this->add_data( pack( "a1024", "" ) );
|
||||
chdir( $pwd );
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used for extract files of the class tar_file
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function extract_files ()
|
||||
{
|
||||
$pwd = getcwd();
|
||||
chdir( $this->options['basedir'] );
|
||||
if ($fp = $this->open_archive()) {
|
||||
if ($this->options['inmemory'] == 1) {
|
||||
$this->files = array ();
|
||||
}
|
||||
while ($block = fread( $fp, 512 )) {
|
||||
$temp = unpack( "a100name/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1type/a100symlink/a6magic/a2temp/a32temp/a32temp/a8temp/a8temp/a155prefix/a12temp", $block );
|
||||
$file = array ('name' => $this->options['basedir'] . '/' . $temp['prefix'] . $temp['name'],'stat' => array (2 => $temp['mode'],4 => octdec( $temp['uid'] ),5 => octdec( $temp['gid'] ),7 => octdec( $temp['size'] ),9 => octdec( $temp['mtime'] )
|
||||
),'checksum' => octdec( $temp['checksum'] ),'type' => $temp['type'],'magic' => $temp['magic']
|
||||
);
|
||||
if ($file['checksum'] == 0x00000000) {
|
||||
break;
|
||||
} elseif (substr( $file['magic'], 0, 5 ) != "ustar") {
|
||||
$this->error[] = "This script does not support extracting this type of tar file.";
|
||||
break;
|
||||
}
|
||||
$block = substr_replace( $block, " ", 148, 8 );
|
||||
$checksum = 0;
|
||||
for ($i = 0; $i < 512; $i ++) {
|
||||
$checksum += ord( substr( $block, $i, 1 ) );
|
||||
}
|
||||
if ($file['checksum'] != $checksum) {
|
||||
$this->error[] = "Could not extract from {$this->options['name']}, it is corrupt.";
|
||||
}
|
||||
if ($this->options['inmemory'] == 1) {
|
||||
$file['data'] = fread( $fp, $file['stat'][7] );
|
||||
fread( $fp, (512 - $file['stat'][7] % 512) == 512 ? 0 : (512 - $file['stat'][7] % 512) );
|
||||
unset( $file['checksum'], $file['magic'] );
|
||||
$this->files[] = $file;
|
||||
} elseif ($file['type'] == 5) {
|
||||
if (! is_dir( $file['name'] )) {
|
||||
//mkdir($file['name'], $file['stat'][2]);
|
||||
mkdir( $file['name'], 0775 );
|
||||
}
|
||||
} elseif ($this->options['overwrite'] == 0 && file_exists( $file['name'] )) {
|
||||
$this->error[] = "{$file['name']} already exist.";
|
||||
continue;
|
||||
} elseif ($file['type'] == 2) {
|
||||
symlink( $temp['symlink'], $file['name'] );
|
||||
//chmod($file['name'], $file['stat'][2]);
|
||||
} elseif ($new = @fopen( $file['name'], "wb" )) {
|
||||
fwrite( $new, fread( $fp, $file['stat'][7] ) );
|
||||
if ((512 - $file['stat'][7] % 512) != 512) {
|
||||
fread( $fp, (512 - $file['stat'][7] % 512) );
|
||||
}
|
||||
//fread($fp, (512 - $file['stat'][7] % 512) == 512 ? 0 : (512 - $file['stat'][7] % 512));
|
||||
fclose( $new );
|
||||
//chmod($file['name'], $file['stat'][2]);
|
||||
chmod( $file['name'], 0777 );
|
||||
$this->files[] = $file['name'];
|
||||
} else {
|
||||
$this->error[] = "Could not open {$file['name']} for writing.";
|
||||
continue;
|
||||
}
|
||||
//chown($file['name'], $file['stat'][4]);
|
||||
//chgrp($file['name'], $file['stat'][5]);
|
||||
@touch( $file['name'], $file['stat'][9] );
|
||||
unset( $file );
|
||||
}
|
||||
} else {
|
||||
$this->error[] = "Could not open file {$this->options['name']}";
|
||||
}
|
||||
chdir( $pwd );
|
||||
}
|
||||
|
||||
/**
|
||||
* This function open a archive of the class tar_file
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function open_archive ()
|
||||
{
|
||||
return @fopen( $this->options['name'], "rb" );
|
||||
}
|
||||
}
|
||||
@@ -37,14 +37,15 @@ require_once 'classes/model/TaskUser.php';
|
||||
require_once 'classes/model/Users.php';
|
||||
require_once 'classes/model/Gateway.php';
|
||||
|
||||
/**
|
||||
* Tasks - Tasks
|
||||
/**
|
||||
* Tasks - Tasks class
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
* @author Julio Cesar Laura Avenda<EFBFBD>o
|
||||
* @copyright 2007 COLOSA
|
||||
*/
|
||||
class Tasks
|
||||
*/class Tasks
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -879,4 +880,3 @@ class Tasks
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
39
workflow/engine/classes/ToolBar.php
Normal file
39
workflow/engine/classes/ToolBar.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.toolBar.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.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* ToolBar - ToolBar
|
||||
/**
|
||||
* ToolBar - ToolBar class
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*/class ToolBar extends form
|
||||
{
|
||||
public $type = 'toolbar';
|
||||
public $align = 'left';
|
||||
}
|
||||
@@ -3,17 +3,11 @@
|
||||
*
|
||||
* @author Hugo Loza <hugo@colosa.com>
|
||||
*
|
||||
* This class Helps registering and implementing Wizard for Triggers
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
* This
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*/
|
||||
|
||||
class triggerLibrary
|
||||
*/class triggerLibrary
|
||||
{
|
||||
|
||||
private $_aTriggerClasses_ = array ();
|
||||
@@ -166,5 +160,3 @@ class triggerLibrary
|
||||
//TODO - Insert your code here
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -19,6 +19,7 @@ function ls_dir($dir, $basename = null)
|
||||
return $files;
|
||||
}
|
||||
|
||||
|
||||
class Upgrade
|
||||
{
|
||||
private $addon = null;
|
||||
@@ -3,14 +3,15 @@
|
||||
use ProcessMaker\Util\FixReferencePath;
|
||||
use ProcessMaker\Plugins\Adapters\PluginAdapter;
|
||||
|
||||
/**
|
||||
*
|
||||
/**
|
||||
* class workspaceTools.
|
||||
*
|
||||
* Utility functions to manage a workspace.
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
class workspaceTools
|
||||
*/class workspaceTools
|
||||
{
|
||||
public $name = null;
|
||||
public $path = null;
|
||||
@@ -27,6 +27,12 @@
|
||||
//It works with the table CONFIGURATION in a WF dataBase
|
||||
|
||||
|
||||
/**
|
||||
* Copyright (C) 2009 COLOSA
|
||||
* License: LGPL, see LICENSE
|
||||
* Last Modify: 26.06.2008 10:05:00
|
||||
* Last modify by: Erik Amaru Ortiz <erik@colosa.com>
|
||||
* Last Modify comment(26.06.2008): the session expired verification was removed from here to soap
|
||||
/**
|
||||
* Copyright (C) 2009 COLOSA
|
||||
* License: LGPL, see LICENSE
|
||||
@@ -35,9 +41,7 @@
|
||||
* Last Modify comment(26.06.2008): the session expired verification was removed from here to soap class
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
|
||||
class wsBase
|
||||
*/class wsBase
|
||||
{
|
||||
public $stored_system_variables; //boolean
|
||||
public $wsSessionId; //web service session id, if the wsbase function is used from a WS request
|
||||
61
workflow/engine/classes/WsCreateDepartmentResponse.php
Normal file
61
workflow/engine/classes/WsCreateDepartmentResponse.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.wsResponse.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.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Class wsCreateDepartmentResponse
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/class wsCreateDepartmentResponse
|
||||
{
|
||||
public $status_code = 0;
|
||||
public $message = '';
|
||||
public $departmentUID = '';
|
||||
public $timestamp = '';
|
||||
|
||||
/**
|
||||
* Function __construct
|
||||
* Constructor of the class
|
||||
*
|
||||
* @param string $status
|
||||
* @param string $message
|
||||
* @param string $departmentUID
|
||||
* @return void
|
||||
*/
|
||||
function __construct ($status, $message, $departmentUID)
|
||||
{
|
||||
$this->status_code = $status;
|
||||
$this->message = $message;
|
||||
$this->departmentUID = $departmentUID;
|
||||
$this->timestamp = date( 'Y-m-d H:i:s' );
|
||||
}
|
||||
}
|
||||
62
workflow/engine/classes/WsCreateGroupResponse.php
Normal file
62
workflow/engine/classes/WsCreateGroupResponse.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.wsResponse.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.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Class wsCreateGroupResponse
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/class wsCreateGroupResponse
|
||||
{
|
||||
public $status_code = 0;
|
||||
public $message = '';
|
||||
public $groupUID = '';
|
||||
public $timestamp = '';
|
||||
|
||||
/**
|
||||
* Function __construct
|
||||
* Constructor of the class
|
||||
*
|
||||
* @param string $status
|
||||
* @param string $message
|
||||
* @param string $groupUID
|
||||
* @return void
|
||||
*/
|
||||
function __construct ($status, $message, $groupUID)
|
||||
{
|
||||
$this->status_code = $status;
|
||||
$this->message = $message;
|
||||
$this->groupUID = $groupUID;
|
||||
$this->timestamp = date( 'Y-m-d H:i:s' );
|
||||
}
|
||||
|
||||
}
|
||||
61
workflow/engine/classes/WsCreateUserResponse.php
Normal file
61
workflow/engine/classes/WsCreateUserResponse.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.wsResponse.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.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Class wsCreateUserResponse
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/class wsCreateUserResponse
|
||||
{
|
||||
public $status_code = 0;
|
||||
public $message = '';
|
||||
public $userUID = '';
|
||||
public $timestamp = '';
|
||||
|
||||
/**
|
||||
* Function __construct
|
||||
* Constructor of the class
|
||||
*
|
||||
* @param string $status
|
||||
* @param string $message
|
||||
* @param string $userUID
|
||||
* @return void
|
||||
*/
|
||||
function __construct ($status, $message, $userUID)
|
||||
{
|
||||
$this->status_code = $status;
|
||||
$this->message = $message;
|
||||
$this->userUID = $userUID;
|
||||
$this->timestamp = date( 'Y-m-d H:i:s' );
|
||||
}
|
||||
}
|
||||
61
workflow/engine/classes/WsGetCaseNotesResponse.php
Normal file
61
workflow/engine/classes/WsGetCaseNotesResponse.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.wsResponse.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.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Class wsGetCaseNotesResponse
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/class wsGetCaseNotesResponse
|
||||
{
|
||||
public $status_code = 0;
|
||||
public $message = '';
|
||||
public $notes = null;
|
||||
public $timestamp = '';
|
||||
|
||||
/**
|
||||
* Function __construct
|
||||
* Constructor of the class
|
||||
*
|
||||
* @param string $status
|
||||
* @param string $message
|
||||
* @param array|object|string $notes
|
||||
* @return void
|
||||
*/
|
||||
function __construct ($status, $message, $notes)
|
||||
{
|
||||
$this->status_code = $status;
|
||||
$this->message = $message;
|
||||
$this->notes = $notes;
|
||||
$this->timestamp = date( 'Y-m-d H:i:s' );
|
||||
}
|
||||
}
|
||||
61
workflow/engine/classes/WsGetVariableResponse.php
Normal file
61
workflow/engine/classes/WsGetVariableResponse.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.wsResponse.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.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Class wsGetVariableResponse
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/class wsGetVariableResponse
|
||||
{
|
||||
public $status_code = 0;
|
||||
public $message = '';
|
||||
public $variables = null;
|
||||
public $timestamp = '';
|
||||
|
||||
/**
|
||||
* Function __construct
|
||||
* Constructor of the class
|
||||
*
|
||||
* @param string $status
|
||||
* @param string $message
|
||||
* @param string $variables
|
||||
* @return void
|
||||
*/
|
||||
function __construct ($status, $message, $variables)
|
||||
{
|
||||
$this->status_code = $status;
|
||||
$this->message = $message;
|
||||
$this->variables = $variables;
|
||||
$this->timestamp = date( 'Y-m-d H:i:s' );
|
||||
}
|
||||
}
|
||||
85
workflow/engine/classes/WsResponse.php
Normal file
85
workflow/engine/classes/WsResponse.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.wsResponse.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.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/class wsResponse
|
||||
{
|
||||
public $status_code = 0;
|
||||
public $message = '';
|
||||
public $timestamp = '';
|
||||
|
||||
/**
|
||||
* Function __construct
|
||||
* Constructor of the class
|
||||
*
|
||||
* @param string $status
|
||||
* @param string $message
|
||||
* @return void
|
||||
*/
|
||||
function __construct ($status, $message)
|
||||
{
|
||||
$this->status_code = $status;
|
||||
$this->message = $message;
|
||||
$this->timestamp = date( 'Y-m-d H:i:s' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Function getPayloadString
|
||||
*
|
||||
* @param string $operation
|
||||
* @return string
|
||||
*/
|
||||
function getPayloadString ($operation)
|
||||
{
|
||||
$res = "<$operation>\n";
|
||||
$res .= "<status_code>" . $this->status_code . "</status_code>";
|
||||
$res .= "<message>" . $this->message . "</message>";
|
||||
$res .= "<timestamp>" . $this->timestamp . "</timestamp>";
|
||||
// $res .= "<array>" . $this->timestamp . "</array>";
|
||||
$res .= "<$operation>";
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function getPayloadArray
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getPayloadArray ()
|
||||
{
|
||||
return array ("status_code" => $this->status_code,'message' => $this->message,'timestamp' => $this->timestamp
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -35,39 +35,6 @@
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*
|
||||
*/
|
||||
class XMLDB
|
||||
{
|
||||
|
||||
/**
|
||||
* &connect
|
||||
*
|
||||
* @param string $dsn
|
||||
* @return array $options
|
||||
*/
|
||||
public function &connect ($dsn, $options = array())
|
||||
{
|
||||
//Needed for $mysql_real_escape_string
|
||||
$mresdbc = new DBConnection();
|
||||
|
||||
if (! file_exists( $dsn )) {
|
||||
$err = new DB_Error( "File $dsn not found." );
|
||||
return $err;
|
||||
}
|
||||
$dbc = new XMLConnection( $dsn );
|
||||
return $dbc;
|
||||
}
|
||||
|
||||
/**
|
||||
* isError
|
||||
*
|
||||
* @param string $result
|
||||
* @return boolean is_a($result, 'DB_Error')
|
||||
*/
|
||||
public function isError ($result)
|
||||
{
|
||||
return is_a( $result, 'DB_Error' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* XMLConnection
|
||||
@@ -77,8 +44,7 @@ class XMLDB
|
||||
* @copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*
|
||||
*/
|
||||
class XMLConnection
|
||||
*/class XMLConnection
|
||||
{
|
||||
var $phptype = 'myxml';
|
||||
var $caseFolding = true;
|
||||
@@ -555,73 +521,3 @@ class XMLConnection
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* XMLResult
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
*
|
||||
* @copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*
|
||||
*/
|
||||
class XMLResult
|
||||
{
|
||||
var $result = array ();
|
||||
var $cursor = 0;
|
||||
|
||||
/**
|
||||
* XMLResult
|
||||
*
|
||||
* @param array $result
|
||||
* @return void
|
||||
*/
|
||||
public function XMLResult ($result = array())
|
||||
{
|
||||
$this->result = $result;
|
||||
$this->cursor = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* numRows
|
||||
*
|
||||
* @return integer sizeof($this->result)
|
||||
*/
|
||||
public function numRows ()
|
||||
{
|
||||
return sizeof( $this->result );
|
||||
}
|
||||
|
||||
/**
|
||||
* fetchRow
|
||||
*
|
||||
* @param string $const
|
||||
* @return integer $this->result[ $this->cursor-1 ];
|
||||
*/
|
||||
public function fetchRow ($const)
|
||||
{
|
||||
if ($this->cursor >= $this->numRows()) {
|
||||
return null;
|
||||
}
|
||||
$this->cursor ++;
|
||||
return $this->result[$this->cursor - 1];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getNames
|
||||
*
|
||||
* @param object $children
|
||||
* @return array $names
|
||||
*/
|
||||
function getNames ($children)
|
||||
{
|
||||
$names = array ();
|
||||
$r = 0;
|
||||
foreach ($children as $child) {
|
||||
$names[$r] = $child->name;
|
||||
$r ++;
|
||||
}
|
||||
return $names;
|
||||
}
|
||||
|
||||
79
workflow/engine/classes/XMLDB.php
Normal file
79
workflow/engine/classes/XMLDB.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.xmlDb.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.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* XMLDB
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
*
|
||||
* @copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* XMLDB
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
*
|
||||
* @copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*
|
||||
*/class XMLDB
|
||||
{
|
||||
|
||||
/**
|
||||
* &connect
|
||||
*
|
||||
* @param string $dsn
|
||||
* @return array $options
|
||||
*/
|
||||
public function &connect ($dsn, $options = array())
|
||||
{
|
||||
//Needed for $mysql_real_escape_string
|
||||
$mresdbc = new DBConnection();
|
||||
|
||||
if (! file_exists( $dsn )) {
|
||||
$err = new DB_Error( "File $dsn not found." );
|
||||
return $err;
|
||||
}
|
||||
$dbc = new XMLConnection( $dsn );
|
||||
return $dbc;
|
||||
}
|
||||
|
||||
/**
|
||||
* isError
|
||||
*
|
||||
* @param string $result
|
||||
* @return boolean is_a($result, 'DB_Error')
|
||||
*/
|
||||
public function isError ($result)
|
||||
{
|
||||
return is_a( $result, 'DB_Error' );
|
||||
}
|
||||
}
|
||||
88
workflow/engine/classes/XMLResult.php
Normal file
88
workflow/engine/classes/XMLResult.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.xmlDb.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.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* XMLDB
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
*
|
||||
* @copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* XMLResult
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
*
|
||||
* @copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*
|
||||
*/class XMLResult
|
||||
{
|
||||
var $result = array ();
|
||||
var $cursor = 0;
|
||||
|
||||
/**
|
||||
* XMLResult
|
||||
*
|
||||
* @param array $result
|
||||
* @return void
|
||||
*/
|
||||
public function XMLResult ($result = array())
|
||||
{
|
||||
$this->result = $result;
|
||||
$this->cursor = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* numRows
|
||||
*
|
||||
* @return integer sizeof($this->result)
|
||||
*/
|
||||
public function numRows ()
|
||||
{
|
||||
return sizeof( $this->result );
|
||||
}
|
||||
|
||||
/**
|
||||
* fetchRow
|
||||
*
|
||||
* @param string $const
|
||||
* @return integer $this->result[ $this->cursor-1 ];
|
||||
*/
|
||||
public function fetchRow ($const)
|
||||
{
|
||||
if ($this->cursor >= $this->numRows()) {
|
||||
return null;
|
||||
}
|
||||
$this->cursor ++;
|
||||
return $this->result[$this->cursor - 1];
|
||||
}
|
||||
}
|
||||
53
workflow/engine/classes/XmlForm_Field_CheckBoxTable.php
Normal file
53
workflow/engine/classes/XmlForm_Field_CheckBoxTable.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.xmlfield_InputPM.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.
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
**/
|
||||
|
||||
|
||||
/**
|
||||
* Class XmlForm_Field_CheckBoxTable
|
||||
*/class XmlForm_Field_CheckBoxTable extends XmlForm_Field_Checkbox
|
||||
{
|
||||
|
||||
/**
|
||||
* Function render
|
||||
*
|
||||
* @author The Answer
|
||||
* @access public
|
||||
* @param eter string value
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
public function render ($value = null, $owner = null)
|
||||
{
|
||||
//$optionName = $owner->values['USR_UID'];
|
||||
$optionName = $value;
|
||||
$onclick = (($this->onclick) ? ' onclick="' . G::replaceDataField( $this->onclick, $owner->values ) . '" ' : '');
|
||||
$html = '<input class="FormCheck" id="form[' . $this->name . '][' . $optionName . ']" name="form[' . $this->name . '][' . $optionName . ']" type=\'checkbox\' value="' . $value . '"' . $onclick . '> <span class="FormCheck"></span></input>';
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
151
workflow/engine/classes/XmlForm_Field_Hours.php
Normal file
151
workflow/engine/classes/XmlForm_Field_Hours.php
Normal file
@@ -0,0 +1,151 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.xmlfield_InputPM.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.
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
**/
|
||||
|
||||
|
||||
/**
|
||||
* Class XmlForm_Field_hours
|
||||
*/class XmlForm_Field_hours extends XmlForm_Field_SimpleText
|
||||
{
|
||||
public $size = 15;
|
||||
public $maxLength = 64;
|
||||
public $validate = 'Any';
|
||||
public $mask = '';
|
||||
public $defaultValue = '';
|
||||
public $required = false;
|
||||
public $dependentFields = '';
|
||||
public $linkField = '';
|
||||
//Possible values:(-|UPPER|LOWER|CAPITALIZE)
|
||||
public $strTo = '';
|
||||
public $readOnly = false;
|
||||
public $sqlConnection = 0;
|
||||
public $sql = '';
|
||||
public $sqlOption = array ();
|
||||
//Atributes only for grids
|
||||
public $formula = '';
|
||||
public $function = '';
|
||||
public $replaceTags = 0;
|
||||
public $showVars = 0;
|
||||
public $process = '';
|
||||
public $symbol = '@@';
|
||||
|
||||
/**
|
||||
* Function render
|
||||
*
|
||||
* @author Julio Cesar Laura Avendano <juliocesar@colosa.com>
|
||||
* @access public
|
||||
* @param eter string value
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
public function render ($value = null, $owner = null)
|
||||
{
|
||||
if ($this->strTo === 'UPPER') {
|
||||
$value = strtoupper( $value );
|
||||
}
|
||||
if ($this->strTo === 'LOWER') {
|
||||
$value = strtolower( $value );
|
||||
}
|
||||
//if ($this->strTo==='CAPITALIZE') $value = strtocapitalize($value);
|
||||
$onkeypress = G::replaceDataField( $this->onkeypress, $owner->values );
|
||||
if ($this->replaceTags == 1) {
|
||||
$value = G::replaceDataField( $value, $owner->values );
|
||||
}
|
||||
if ($this->showVars == 1) {
|
||||
$this->process = G::replaceDataField( $this->process, $owner->values );
|
||||
//$sShowVars = ' <a href="#" onclick="showDynaformsFormVars(\'form['.$this->name.']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;">' . $this->symbol . '</a>';
|
||||
$sShowVars = ' <input type="button" value="' . $this->symbol . '" onclick="showDynaformsFormVars(\'form[' . $this->name . ']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;"/>';
|
||||
} else {
|
||||
$sShowVars = '';
|
||||
}
|
||||
if ($this->mode === 'edit') {
|
||||
if ($this->readOnly) {
|
||||
return '<input class="module_app_input___gray" id="form[' . $this->name . ']" name="form[' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' readOnly="readOnly" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
} else {
|
||||
return '<input class="module_app_input___gray" id="form[' . $this->name . ']" name="form[' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
}
|
||||
} elseif ($this->mode === 'view') {
|
||||
return '<input class="module_app_input___gray" id="form[' . $this->name . ']" name="form[' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' style="display:none;' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' );
|
||||
} else {
|
||||
return $this->htmlentities( $value, ENT_COMPAT, 'utf-8' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function renderGrid
|
||||
*
|
||||
* @author Julio Cesar Laura Avendano <juliocesar@colosa.com>
|
||||
* @access public
|
||||
* @param eter array values
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
public function renderGrid ($values = array(),$owner)
|
||||
{
|
||||
$result = array ();
|
||||
$r = 1;
|
||||
foreach ($values as $v) {
|
||||
if ($this->replaceTags == 1) {
|
||||
$v = G::replaceDataField( $v, $owner->values );
|
||||
}
|
||||
if ($this->showVars == 1) {
|
||||
$this->process = G::replaceDataField( $this->process, $owner->values );
|
||||
//$sShowVars = ' <a href="#" onclick="showDynaformsFormVars(\'form['.$owner->name .']['.$r.']['.$this->name.']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;">' . $this->symbol . '</a>';
|
||||
$sShowVars = ' <input type="button" value="' . $this->symbol . '" onclick="showDynaformsFormVars(\'form[' . $owner->name . '][' . $r . '][' . $this->name . ']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;"/>';
|
||||
} else {
|
||||
$sShowVars = '';
|
||||
}
|
||||
if ($this->mode === 'edit') {
|
||||
if ($this->readOnly) {
|
||||
$result[] = '<input class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value="' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '" readOnly="readOnly" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
} else {
|
||||
$result[] = '<input class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value="' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
}
|
||||
} elseif ($this->mode === 'view') {
|
||||
$result[] = '<p align="' . $this->align . '">' . $this->htmlentities( number_format( $v, 2 ), ENT_COMPAT, 'utf-8' ) . '</p>';
|
||||
} else {
|
||||
$result[] = '<p align="' . $this->align . '">' . $this->htmlentities( number_format( $v, 2 ), ENT_COMPAT, 'utf-8' ) . '</p>';
|
||||
}
|
||||
$r ++;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function attachEvents
|
||||
*
|
||||
* @access public
|
||||
* @param eter string $element
|
||||
* @return string
|
||||
*/
|
||||
public function attachEvents ($element)
|
||||
{
|
||||
return "myForm.aElements[i] = new G_Text(myForm, $element,'{$this->name}');
|
||||
myForm.aElements[i].setAttributes(" . $this->getAttributes() . ");";
|
||||
}
|
||||
}
|
||||
50
workflow/engine/classes/XmlForm_Field_PopupOption.php
Normal file
50
workflow/engine/classes/XmlForm_Field_PopupOption.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.popupMenu.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.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* popupMenu - popupMenu
|
||||
/**
|
||||
* XmlForm_Field_popupOption - XmlForm_Field_popupOption class
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
* @copyright COLOSA
|
||||
*/class XmlForm_Field_popupOption extends XmlForm_Field
|
||||
{
|
||||
var $launch = '';
|
||||
|
||||
/**
|
||||
* Get Events
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getEvents ()
|
||||
{
|
||||
$script = '{name:"' . $this->name . '",text:"' . addcslashes( $this->label, '\\"' ) . '", launch:leimnud.closure({Function:function(target){' . $this->launch . '}, args:target})}';
|
||||
return $script;
|
||||
}
|
||||
}
|
||||
181
workflow/engine/classes/XmlForm_Field_TextPM.php
Normal file
181
workflow/engine/classes/XmlForm_Field_TextPM.php
Normal file
@@ -0,0 +1,181 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.xmlfield_InputPM.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.
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
**/
|
||||
|
||||
|
||||
/**
|
||||
* class.xmlfield_InputPM.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.
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
**/class XmlForm_Field_TextPM extends XmlForm_Field_SimpleText
|
||||
{
|
||||
public $size = 15;
|
||||
public $maxLength = 64;
|
||||
public $validate = 'Any';
|
||||
public $mask = '';
|
||||
public $defaultValue = '';
|
||||
public $required = false;
|
||||
public $dependentFields = '';
|
||||
public $linkField = '';
|
||||
//Possible values:(-|UPPER|LOWER|CAPITALIZE)
|
||||
public $strTo = '';
|
||||
public $readOnly = false;
|
||||
public $sqlConnection = 0;
|
||||
public $sql = '';
|
||||
public $sqlOption = array ();
|
||||
//Atributes only for grids
|
||||
public $formula = '';
|
||||
public $function = '';
|
||||
public $replaceTags = 0;
|
||||
public $showVars = 0;
|
||||
public $process = '';
|
||||
public $symbol = '@@';
|
||||
|
||||
/**
|
||||
* Function render
|
||||
*
|
||||
* @author Julio Cesar Laura Avendano <juliocesar@colosa.com>
|
||||
* @access public
|
||||
* @param eter string value
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
public function render ($value = null, $owner = null)
|
||||
{
|
||||
//$this->executeSQL();
|
||||
//if (isset($this->sqlOption)) {
|
||||
// reset($this->sqlOption);
|
||||
// $firstElement=key($this->sqlOption);
|
||||
// if (isset($firstElement)) $value = $firstElement;
|
||||
//}
|
||||
//NOTE: string functions must be in G class
|
||||
if ($this->strTo === 'UPPER') {
|
||||
$value = strtoupper( $value );
|
||||
}
|
||||
if ($this->strTo === 'LOWER') {
|
||||
$value = strtolower( $value );
|
||||
}
|
||||
//if ($this->strTo==='CAPITALIZE') $value = strtocapitalize($value);
|
||||
$onkeypress = G::replaceDataField( $this->onkeypress, $owner->values );
|
||||
if ($this->replaceTags == 1) {
|
||||
$value = G::replaceDataField( $value, $owner->values );
|
||||
}
|
||||
if ($this->showVars == 1) {
|
||||
$this->process = G::replaceDataField( $this->process, $owner->values );
|
||||
//$sShowVars = ' <a href="#" onclick="showDynaformsFormVars(\'form['.$this->name.']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;">' . $this->symbol . '</a>';
|
||||
$sShowVars = ' <input type="button" value="' . $this->symbol . '" onclick="showDynaformsFormVars(\'form[' . $this->name . ']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;"/>';
|
||||
} else {
|
||||
$sShowVars = '';
|
||||
}
|
||||
if ($this->mode === 'edit') {
|
||||
if ($this->readOnly) {
|
||||
return '<input class="module_app_input___gray" id="form[' . $this->name . ']" name="form[' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' readOnly="readOnly" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
} else {
|
||||
return '<input class="module_app_input___gray" id="form[' . $this->name . ']" name="form[' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
}
|
||||
} elseif ($this->mode === 'view') {
|
||||
return '<input class="module_app_input___gray" id="form[' . $this->name . ']" name="form[' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' style="display:none;' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' );
|
||||
} else {
|
||||
return $this->htmlentities( $value, ENT_COMPAT, 'utf-8' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function renderGrid
|
||||
*
|
||||
* @author Julio Cesar Laura Avendano <juliocesar@colosa.com>
|
||||
* @access public
|
||||
* @param eter array values
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
public function renderGrid ($values = array(), $owner)
|
||||
{
|
||||
$result = array ();
|
||||
$r = 1;
|
||||
foreach ($values as $v) {
|
||||
if ($this->replaceTags == 1) {
|
||||
$v = G::replaceDataField( $v, $owner->values );
|
||||
}
|
||||
if ($this->showVars == 1) {
|
||||
$this->process = G::replaceDataField( $this->process, $owner->values );
|
||||
//$sShowVars = ' <a href="#" onclick="showDynaformsFormVars(\'form['.$owner->name .']['.$r.']['.$this->name.']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;">' . $this->symbol . '</a>';
|
||||
$sShowVars = ' <input type="button" value="' . $this->symbol . '" onclick="showDynaformsFormVars(\'form[' . $owner->name . '][' . $r . '][' . $this->name . ']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;"/>';
|
||||
} else {
|
||||
$sShowVars = '';
|
||||
}
|
||||
if ($this->mode === 'edit') {
|
||||
if ($this->readOnly) {
|
||||
$result[] = '<input class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value="' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '" readOnly="readOnly" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
} else {
|
||||
$result[] = '<input class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value="' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
}
|
||||
} elseif ($this->mode === 'view') {
|
||||
$result[] = $this->htmlentities( $v, ENT_COMPAT, 'utf-8' );
|
||||
} else {
|
||||
$result[] = $this->htmlentities( $v, ENT_COMPAT, 'utf-8' );
|
||||
}
|
||||
$r ++;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function attachEvents
|
||||
*
|
||||
* @access public
|
||||
* @param eter string $element
|
||||
* @return string
|
||||
*/
|
||||
public function attachEvents ($element)
|
||||
{
|
||||
return "myForm.aElements[i] = new G_Text(myForm, $element,'{$this->name}');
|
||||
myForm.aElements[i].setAttributes(" . $this->getAttributes() . ");";
|
||||
}
|
||||
}
|
||||
116
workflow/engine/classes/XmlForm_Field_TextareaPM.php
Normal file
116
workflow/engine/classes/XmlForm_Field_TextareaPM.php
Normal file
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.xmlfield_InputPM.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.
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
**/
|
||||
|
||||
|
||||
/**
|
||||
* Class XmlForm_Field_TextareaPM
|
||||
*/class XmlForm_Field_TextareaPM extends XmlForm_Field
|
||||
{
|
||||
public $rows = 12;
|
||||
public $cols = 40;
|
||||
public $required = false;
|
||||
public $readOnly = false;
|
||||
public $wrap = 'OFF';
|
||||
public $showVars = 0;
|
||||
public $process = '';
|
||||
public $symbol = '@@';
|
||||
|
||||
/**
|
||||
* Function render
|
||||
*
|
||||
* @author Julio Cesar Laura Avendao <juliocesar@colosa.com>
|
||||
* @access public
|
||||
* @param eter string value
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
public function render ($value = null, $owner)
|
||||
{
|
||||
if ($this->showVars == 1) {
|
||||
$this->process = G::replaceDataField( $this->process, $owner->values );
|
||||
$sShowVars = ' <input type="button" value="' . $this->symbol . '" onclick="showDynaformsFormVars(\'form[' . $this->name . ']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;"/>';
|
||||
} else {
|
||||
$sShowVars = '';
|
||||
}
|
||||
if ($this->mode === 'edit') {
|
||||
if ($this->readOnly) {
|
||||
return '<textarea id="form[' . $this->name . ']" name="form[' . $this->name . ']" cols="' . $this->cols . '" rows="' . $this->rows . '" style="' . $this->style . '" wrap="' . htmlentities( $this->wrap, ENT_QUOTES, 'UTF-8' ) . '" class="FormTextPM" readOnly>' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '</textarea>' . $sShowVars;
|
||||
} else {
|
||||
return '<textarea id="form[' . $this->name . ']" name="form[' . $this->name . ']" cols="' . $this->cols . '" rows="' . $this->rows . '" style="' . $this->style . '" wrap="' . htmlentities( $this->wrap, ENT_QUOTES, 'UTF-8' ) . '" class="FormTextPM" >' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '</textarea>' . $sShowVars;
|
||||
}
|
||||
} elseif ($this->mode === 'view') {
|
||||
return '<textarea id="form[' . $this->name . ']" name="form[' . $this->name . ']" cols="' . $this->cols . '" rows="' . $this->rows . '" readOnly style="border:0px;backgroud-color:inherit;' . $this->style . '" wrap="' . htmlentities( $this->wrap, ENT_QUOTES, 'UTF-8' ) . '" class="FormTextPM" >' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '</textarea>';
|
||||
} else {
|
||||
return '<textarea id="form[' . $this->name . ']" name="form[' . $this->name . ']" cols="' . $this->cols . '" rows="' . $this->rows . '" style="' . $this->style . '" wrap="' . htmlentities( $this->wrap, ENT_QUOTES, 'UTF-8' ) . '" class="FormTextArea" >' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '</textarea>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function renderGrid
|
||||
*
|
||||
* @author Julio Cesar Laura Avendano <juliocesar@colosa.com>
|
||||
* @access public
|
||||
* @param eter string values
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
public function renderGrid ($owner, $values = null)
|
||||
{
|
||||
$result = array ();
|
||||
$r = 1;
|
||||
foreach ($values as $v) {
|
||||
if ($this->showVars == 1) {
|
||||
$this->process = G::replaceDataField( $this->process, $owner->values );
|
||||
//$sShowVars = ' <a href="#" onclick="showDynaformsFormVars(\'form['.$owner->name .']['.$r.']['.$this->name.']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;">' . $this->symbol . '</a>';
|
||||
$sShowVars = ' <input type="button" value="' . $this->symbol . '" onclick="showDynaformsFormVars(\'form[' . $owner->name . '][' . $r . '][' . $this->name . ']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;"/>';
|
||||
} else {
|
||||
$sShowVars = '';
|
||||
}
|
||||
if ($this->mode === 'edit') {
|
||||
if ($this->readOnly) {
|
||||
$result[] = '<input class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '\' readOnly="readOnly"/>' . $sShowVars;
|
||||
} else {
|
||||
$result[] = '<input class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '\' />' . $sShowVars;
|
||||
}
|
||||
} elseif ($this->mode === 'view') {
|
||||
if (stristr( $_SERVER['HTTP_USER_AGENT'], 'iPhone' )) {
|
||||
//$result[] = '<div style="overflow:hidden;height:25px;padding:0px;margin:0px;">'.$this->htmlentities( $v , ENT_COMPAT, 'utf-8').'</div>';
|
||||
$result[] = $this->htmlentities( $v, ENT_COMPAT, 'utf-8' );
|
||||
} else {
|
||||
//$result[] = '<div style="overflow:hidden;width:inherit;height:2em;padding:0px;margin:0px;">'.$this->htmlentities( $v , ENT_COMPAT, 'utf-8').'</div>';
|
||||
$result[] = $this->htmlentities( $v, ENT_COMPAT, 'utf-8' );
|
||||
}
|
||||
} else {
|
||||
$result[] = $this->htmlentities( $v, ENT_COMPAT, 'utf-8' );
|
||||
}
|
||||
$r ++;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
75
workflow/engine/classes/XmlForm_Field_ToolBar.php
Normal file
75
workflow/engine/classes/XmlForm_Field_ToolBar.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.toolBar.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.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* ToolBar - ToolBar
|
||||
/**
|
||||
* XmlForm_Field_ToolBar - XmlForm_Field_ToolBar class
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*/class XmlForm_Field_ToolBar extends XmlForm_Field
|
||||
{
|
||||
|
||||
public $xmlfile = '';
|
||||
public $type = 'toolbar';
|
||||
public $toolBar;
|
||||
public $home = '';
|
||||
public $withoutLabel = true;
|
||||
|
||||
/**
|
||||
* Constructor of the class XmlForm_Field_ToolBar
|
||||
*
|
||||
* @param string $xmlNode
|
||||
* @param string $lang
|
||||
* @param string $home
|
||||
* @param string $owner
|
||||
* @return void
|
||||
*/
|
||||
public function XmlForm_Field_ToolBar($xmlNode, $lang = 'en', $home = '', $owner = ' ')
|
||||
{
|
||||
parent::XmlForm_Field($xmlNode, $lang, $home, $owner);
|
||||
$this->home = $home;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints the ToolBar
|
||||
*
|
||||
* @param string $value
|
||||
* @return string
|
||||
*/
|
||||
public function render($value)
|
||||
{
|
||||
$this->toolBar = new toolBar($this->xmlfile, $this->home);
|
||||
$template = PATH_CORE . 'templates/' . $this->type . '.html';
|
||||
$out = $this->toolBar->render($template, $scriptCode);
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptFile($this->toolBar->scriptURL);
|
||||
$oHeadPublisher->addScriptCode($scriptCode);
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
@@ -27,69 +27,12 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* ToolBar - ToolBar class
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*/
|
||||
class ToolBar extends form
|
||||
{
|
||||
public $type = 'toolbar';
|
||||
public $align = 'left';
|
||||
}
|
||||
|
||||
/**
|
||||
* XmlForm_Field_ToolBar - XmlForm_Field_ToolBar class
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*/
|
||||
class XmlForm_Field_ToolBar extends XmlForm_Field
|
||||
{
|
||||
|
||||
public $xmlfile = '';
|
||||
public $type = 'toolbar';
|
||||
public $toolBar;
|
||||
public $home = '';
|
||||
public $withoutLabel = true;
|
||||
|
||||
/**
|
||||
* Constructor of the class XmlForm_Field_ToolBar
|
||||
*
|
||||
* @param string $xmlNode
|
||||
* @param string $lang
|
||||
* @param string $home
|
||||
* @param string $owner
|
||||
* @return void
|
||||
*/
|
||||
public function XmlForm_Field_ToolBar($xmlNode, $lang = 'en', $home = '', $owner = ' ')
|
||||
{
|
||||
parent::XmlForm_Field($xmlNode, $lang, $home, $owner);
|
||||
$this->home = $home;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints the ToolBar
|
||||
*
|
||||
* @param string $value
|
||||
* @return string
|
||||
*/
|
||||
public function render($value)
|
||||
{
|
||||
$this->toolBar = new toolBar($this->xmlfile, $this->home);
|
||||
$template = PATH_CORE . 'templates/' . $this->type . '.html';
|
||||
$out = $this->toolBar->render($template, $scriptCode);
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptFile($this->toolBar->scriptURL);
|
||||
$oHeadPublisher->addScriptCode($scriptCode);
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
|
||||
* ToolBar - ToolBar
|
||||
/**
|
||||
* XmlForm_Field_toolButton - XmlForm_Field_toolButton class
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*/
|
||||
class XmlForm_Field_toolButton extends XmlForm_Field
|
||||
*/class XmlForm_Field_toolButton extends XmlForm_Field
|
||||
{
|
||||
|
||||
public $file = '';
|
||||
113
workflow/engine/classes/Zip_File.php
Normal file
113
workflow/engine/classes/Zip_File.php
Normal file
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
/*--------------------------------------------------
|
||||
* TAR/GZIP/BZIP2/ZIP ARCHIVE CLASSES 2.1
|
||||
* By Devin Doucette
|
||||
* Copyright (c) 2005 Devin Doucette
|
||||
* Email: darksnoopy@shaw.ca
|
||||
*--------------------------------------------------
|
||||
* Email bugs/suggestions to darksnoopy@shaw.ca
|
||||
*--------------------------------------------------
|
||||
* This script has been created and released under
|
||||
* the GNU GPL and is free to use and redistribute
|
||||
* only if this copyright statement is not removed
|
||||
*--------------------------------------------------*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
|
||||
/**
|
||||
* This class is derived from the class archive, is imployed to use files .
|
||||
* zip
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/class zip_file extends archive
|
||||
{
|
||||
|
||||
public function zip_file ($name)
|
||||
{
|
||||
$this->archive( $name );
|
||||
$this->options['type'] = "zip";
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used to create archives .
|
||||
* zip
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function create_zip ()
|
||||
{
|
||||
$files = 0;
|
||||
$offset = 0;
|
||||
$central = "";
|
||||
if (! empty( $this->options['sfx'] )) {
|
||||
if ($fp = @fopen( $this->options['sfx'], "rb" )) {
|
||||
$temp = fread( $fp, filesize( $this->options['sfx'] ) );
|
||||
fclose( $fp );
|
||||
$this->add_data( $temp );
|
||||
$offset += strlen( $temp );
|
||||
unset( $temp );
|
||||
} else {
|
||||
$this->error[] = "Could not open sfx module from {$this->options['sfx']}.";
|
||||
}
|
||||
}
|
||||
$pwd = getcwd();
|
||||
chdir( $this->options['basedir'] );
|
||||
foreach ($this->files as $current) {
|
||||
if ($current['name'] == $this->options['name']) {
|
||||
continue;
|
||||
}
|
||||
$timedate = explode( " ", date( "Y n j G i s", $current['stat'][9] ) );
|
||||
$timedate = ($timedate[0] - 1980 << 25) | ($timedate[1] << 21) | ($timedate[2] << 16) | ($timedate[3] << 11) | ($timedate[4] << 5) | ($timedate[5]);
|
||||
$block = pack( "VvvvV", 0x04034b50, 0x000A, 0x0000, (isset( $current['method'] ) || $this->options['method'] == 0) ? 0x0000 : 0x0008, $timedate );
|
||||
if ($current['stat'][7] == 0 && $current['type'] == 5) {
|
||||
$block .= pack( "VVVvv", 0x00000000, 0x00000000, 0x00000000, strlen( $current['name2'] ) + 1, 0x0000 );
|
||||
$block .= $current['name2'] . "/";
|
||||
$this->add_data( $block );
|
||||
$central .= pack( "VvvvvVVVVvvvvvVV", 0x02014b50, 0x0014, $this->options['method'] == 0 ? 0x0000 : 0x000A, 0x0000, (isset( $current['method'] ) || $this->options['method'] == 0) ? 0x0000 : 0x0008, $timedate, 0x00000000, 0x00000000, 0x00000000, strlen( $current['name2'] ) + 1, 0x0000, 0x0000, 0x0000, 0x0000, $current['type'] == 5 ? 0x00000010 : 0x00000000, $offset );
|
||||
$central .= $current['name2'] . "/";
|
||||
$files ++;
|
||||
$offset += (31 + strlen( $current['name2'] ));
|
||||
} elseif ($current['stat'][7] == 0) {
|
||||
$block .= pack( "VVVvv", 0x00000000, 0x00000000, 0x00000000, strlen( $current['name2'] ), 0x0000 );
|
||||
$block .= $current['name2'];
|
||||
$this->add_data( $block );
|
||||
$central .= pack( "VvvvvVVVVvvvvvVV", 0x02014b50, 0x0014, $this->options['method'] == 0 ? 0x0000 : 0x000A, 0x0000, (isset( $current['method'] ) || $this->options['method'] == 0) ? 0x0000 : 0x0008, $timedate, 0x00000000, 0x00000000, 0x00000000, strlen( $current['name2'] ), 0x0000, 0x0000, 0x0000, 0x0000, $current['type'] == 5 ? 0x00000010 : 0x00000000, $offset );
|
||||
$central .= $current['name2'];
|
||||
$files ++;
|
||||
$offset += (30 + strlen( $current['name2'] ));
|
||||
} elseif ($fp = @fopen( $current['name'], "rb" )) {
|
||||
$temp = fread( $fp, $current['stat'][7] );
|
||||
fclose( $fp );
|
||||
$crc32 = G::encryptCrc32( $temp );
|
||||
if (! isset( $current['method'] ) && $this->options['method'] == 1) {
|
||||
$temp = gzcompress( $temp, $this->options['level'] );
|
||||
$size = strlen( $temp ) - 6;
|
||||
$temp = substr( $temp, 2, $size );
|
||||
} else {
|
||||
$size = strlen( $temp );
|
||||
}
|
||||
$block .= pack( "VVVvv", $crc32, $size, $current['stat'][7], strlen( $current['name2'] ), 0x0000 );
|
||||
$block .= $current['name2'];
|
||||
$this->add_data( $block );
|
||||
$this->add_data( $temp );
|
||||
unset( $temp );
|
||||
$central .= pack( "VvvvvVVVVvvvvvVV", 0x02014b50, 0x0014, $this->options['method'] == 0 ? 0x0000 : 0x000A, 0x0000, (isset( $current['method'] ) || $this->options['method'] == 0) ? 0x0000 : 0x0008, $timedate, $crc32, $size, $current['stat'][7], strlen( $current['name2'] ), 0x0000, 0x0000, 0x0000, 0x0000, 0x00000000, $offset );
|
||||
$central .= $current['name2'];
|
||||
$files ++;
|
||||
$offset += (30 + strlen( $current['name2'] ) + $size);
|
||||
} else {
|
||||
$this->error[] = "Could not open file {$current['name']} for reading. It was not added.";
|
||||
}
|
||||
}
|
||||
$this->add_data( $central );
|
||||
$this->add_data( pack( "VvvvvVVv", 0x06054b50, 0x0000, 0x0000, $files, $files, strlen( $central ), $offset, ! empty( $this->options['comment'] ) ? strlen( $this->options['comment'] ) : 0x0000 ) );
|
||||
if (! empty( $this->options['comment'] )) {
|
||||
$this->add_data( $this->options['comment'] );
|
||||
}
|
||||
chdir( $pwd );
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -1,746 +0,0 @@
|
||||
<?php
|
||||
/*--------------------------------------------------
|
||||
* TAR/GZIP/BZIP2/ZIP ARCHIVE CLASSES 2.1
|
||||
* By Devin Doucette
|
||||
* Copyright (c) 2005 Devin Doucette
|
||||
* Email: darksnoopy@shaw.ca
|
||||
*--------------------------------------------------
|
||||
* Email bugs/suggestions to darksnoopy@shaw.ca
|
||||
*--------------------------------------------------
|
||||
* This script has been created and released under
|
||||
* the GNU GPL and is free to use and redistribute
|
||||
* only if this copyright statement is not removed
|
||||
*--------------------------------------------------*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
class archive
|
||||
{
|
||||
|
||||
/**
|
||||
* This function is the constructor of the class archive
|
||||
*
|
||||
* @param string $name
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
public function archive ($name)
|
||||
{
|
||||
$this->options = array ('basedir' => ".",'name' => $name,'prepend' => "",'inmemory' => 0,'overwrite' => 0,'recurse' => 1,'storepaths' => 1,'followlinks' => 0,'level' => 3,'method' => 1,'sfx' => "",'type' => "",'comment' => ""
|
||||
);
|
||||
$this->files = array ();
|
||||
$this->exclude = array ();
|
||||
$this->storeonly = array ();
|
||||
$this->error = array ();
|
||||
}
|
||||
|
||||
/**
|
||||
* This function gives options to a archive
|
||||
*
|
||||
* @param array $options
|
||||
* @return void
|
||||
*/
|
||||
public function set_options ($options)
|
||||
{
|
||||
foreach ($options as $key => $value) {
|
||||
$this->options[$key] = $value;
|
||||
}
|
||||
if (! empty( $this->options['basedir'] )) {
|
||||
$this->options['basedir'] = str_replace( "\\", "/", $this->options['basedir'] );
|
||||
$this->options['basedir'] = preg_replace( "/\/+/", "/", $this->options['basedir'] );
|
||||
$this->options['basedir'] = preg_replace( "/\/$/", "", $this->options['basedir'] );
|
||||
}
|
||||
if (! empty( $this->options['name'] )) {
|
||||
$this->options['name'] = str_replace( "\\", "/", $this->options['name'] );
|
||||
$this->options['name'] = preg_replace( "/\/+/", "/", $this->options['name'] );
|
||||
}
|
||||
if (! empty( $this->options['prepend'] )) {
|
||||
$this->options['prepend'] = str_replace( "\\", "/", $this->options['prepend'] );
|
||||
$this->options['prepend'] = preg_replace( "/^(\.*\/+)+/", "", $this->options['prepend'] );
|
||||
$this->options['prepend'] = preg_replace( "/\/+/", "/", $this->options['prepend'] );
|
||||
$this->options['prepend'] = preg_replace( "/\/$/", "", $this->options['prepend'] ) . "/";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used to create a archive.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function create_archive ()
|
||||
{
|
||||
$this->make_list();
|
||||
if ($this->options['inmemory'] == 0) {
|
||||
$pwd = getcwd();
|
||||
chdir( $this->options['basedir'] );
|
||||
if ($this->options['overwrite'] == 0 && file_exists( $this->options['name'] . ($this->options['type'] == "gzip" || $this->options['type'] == "bzip" ? ".tmp" : "") )) {
|
||||
$this->error[] = "File {$this->options['name']} already exist.";
|
||||
chdir( $pwd );
|
||||
return 0;
|
||||
} elseif ($this->archive = @fopen( $this->options['name'] . ($this->options['type'] == "gzip" || $this->options['type'] == "bzip" ? ".tmp" : ""), "wb+" )) {
|
||||
chdir( $pwd );
|
||||
} else {
|
||||
$this->error[] = "Could not open {$this->options['name']} for writing.";
|
||||
chdir( $pwd );
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
$this->archive = "";
|
||||
}
|
||||
switch ($this->options['type']) {
|
||||
case "zip":
|
||||
if (! $this->create_zip()) {
|
||||
$this->error[] = "Could not create zip file.";
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case "bzip":
|
||||
if (! $this->create_tar()) {
|
||||
$this->error[] = "Could not create tar file.";
|
||||
return 0;
|
||||
}
|
||||
if (! $this->create_bzip()) {
|
||||
$this->error[] = "Could not create bzip2 file.";
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case "gzip":
|
||||
if (! $this->create_tar()) {
|
||||
$this->error[] = "Could not create tar file.";
|
||||
return 0;
|
||||
}
|
||||
if (! $this->create_gzip()) {
|
||||
$this->error[] = "Could not create gzip file.";
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case "tar":
|
||||
if (! $this->create_tar()) {
|
||||
$this->error[] = "Could not create tar file.";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if ($this->options['inmemory'] == 0) {
|
||||
fclose( $this->archive );
|
||||
if ($this->options['type'] == "gzip" || $this->options['type'] == "bzip") {
|
||||
unlink( $this->options['basedir'] . "/" . $this->options['name'] . ".tmp" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used for add data to a archive
|
||||
*
|
||||
* @param string $data
|
||||
* @return void
|
||||
*/
|
||||
public function add_data ($data)
|
||||
{
|
||||
if ($this->options['inmemory'] == 0) {
|
||||
fwrite( $this->archive, $data );
|
||||
} else {
|
||||
$this->archive .= $data;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function make a list
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function make_list ()
|
||||
{
|
||||
if (! empty( $this->exclude )) {
|
||||
foreach ($this->files as $key => $value) {
|
||||
foreach ($this->exclude as $current) {
|
||||
if ($value['name'] == $current['name']) {
|
||||
unset( $this->files[$key] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (! empty( $this->storeonly )) {
|
||||
foreach ($this->files as $key => $value) {
|
||||
foreach ($this->storeonly as $current) {
|
||||
if ($value['name'] == $current['name']) {
|
||||
$this->files[$key]['method'] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
unset( $this->exclude, $this->storeonly );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add files a list
|
||||
*
|
||||
* @param array $list
|
||||
* @return void
|
||||
*/
|
||||
public function add_files ($list)
|
||||
{
|
||||
$temp = $this->list_files( $list );
|
||||
foreach ($temp as $current) {
|
||||
$this->files[] = $current;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function exclude files of a list
|
||||
*
|
||||
* @param array $list
|
||||
* @return void
|
||||
*/
|
||||
public function exclude_files ($list)
|
||||
{
|
||||
$temp = $this->list_files( $list );
|
||||
foreach ($temp as $current) {
|
||||
$this->exclude[] = $current;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function store files
|
||||
*
|
||||
* @param array $list
|
||||
*/
|
||||
public function store_files ($list)
|
||||
{
|
||||
$temp = $this->list_files( $list );
|
||||
foreach ($temp as $current) {
|
||||
$this->storeonly[] = $current;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* List files gives a List
|
||||
*
|
||||
* @param array $list
|
||||
* @return array
|
||||
*/
|
||||
public function list_files ($list)
|
||||
{
|
||||
if (! is_array( $list )) {
|
||||
$temp = $list;
|
||||
$list = array ($temp
|
||||
);
|
||||
unset( $temp );
|
||||
}
|
||||
$files = array ();
|
||||
$pwd = getcwd();
|
||||
chdir( $this->options['basedir'] );
|
||||
foreach ($list as $current) {
|
||||
$current = str_replace( "\\", "/", $current );
|
||||
$current = preg_replace( "/\/+/", "/", $current );
|
||||
$current = preg_replace( "/\/$/", "", $current );
|
||||
if (strstr( $current, "*" )) {
|
||||
$regex = preg_replace( "/([\\\^\$\.\[\]\|\(\)\?\+\{\}\/])/", "\\\\\\1", $current );
|
||||
$regex = str_replace( "*", ".*", $regex );
|
||||
$dir = strstr( $current, "/" ) ? substr( $current, 0, strrpos( $current, "/" ) ) : ".";
|
||||
$temp = $this->parse_dir( $dir );
|
||||
foreach ($temp as $current2) {
|
||||
if (preg_match( "/^{$regex}$/i", $current2['name'] )) {
|
||||
$files[] = $current2;
|
||||
}
|
||||
}
|
||||
unset( $regex, $dir, $temp, $current );
|
||||
} elseif (@is_dir( $current )) {
|
||||
$temp = $this->parse_dir( $current );
|
||||
foreach ($temp as $file) {
|
||||
$files[] = $file;
|
||||
}
|
||||
unset( $temp, $file );
|
||||
} elseif (@file_exists( $current )) {
|
||||
$files[] = array ('name' => $current,'name2' => $this->options['prepend'] . preg_replace( "/(\.+\/+)+/", "", ($this->options['storepaths'] == 0 && strstr( $current, "/" )) ? substr( $current, strrpos( $current, "/" ) + 1 ) : $current ),'type' => @is_link( $current ) && $this->options['followlinks'] == 0 ? 2 : 0,'ext' => substr( $current, strrpos( $current, "." ) ),'stat' => stat( $current )
|
||||
);
|
||||
}
|
||||
}
|
||||
chdir( $pwd );
|
||||
unset( $current, $pwd );
|
||||
usort( $files, array ("archive","sort_files"
|
||||
) );
|
||||
return $files;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is for parse a directory name
|
||||
*
|
||||
* @param string $dirname
|
||||
* @return array
|
||||
*/
|
||||
public function parse_dir ($dirname)
|
||||
{
|
||||
if ($this->options['storepaths'] == 1 && ! preg_match( "/^(\.+\/*)+$/", $dirname )) {
|
||||
$files = array (array ('name' => $dirname,'name2' => $this->options['prepend'] . preg_replace( "/(\.+\/+)+/", "", ($this->options['storepaths'] == 0 && strstr( $dirname, "/" )) ? substr( $dirname, strrpos( $dirname, "/" ) + 1 ) : $dirname ),'type' => 5,'stat' => stat( $dirname )
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$files = array ();
|
||||
}
|
||||
$dir = @opendir( $dirname );
|
||||
while ($file = @readdir( $dir )) {
|
||||
$fullname = $dirname . "/" . $file;
|
||||
if ($file == "." || $file == "..") {
|
||||
continue;
|
||||
} elseif (@is_dir( $fullname )) {
|
||||
if (empty( $this->options['recurse'] )) {
|
||||
continue;
|
||||
}
|
||||
$temp = $this->parse_dir( $fullname );
|
||||
foreach ($temp as $file2) {
|
||||
$files[] = $file2;
|
||||
}
|
||||
} elseif (@file_exists( $fullname )) {
|
||||
$files[] = array ('name' => $fullname,'name2' => $this->options['prepend'] . preg_replace( "/(\.+\/+)+/", "", ($this->options['storepaths'] == 0 && strstr( $fullname, "/" )) ? substr( $fullname, strrpos( $fullname, "/" ) + 1 ) : $fullname ),'type' => @is_link( $fullname ) && $this->options['followlinks'] == 0 ? 2 : 0,'ext' => substr( $file, strrpos( $file, "." ) ),'stat' => stat( $fullname )
|
||||
);
|
||||
}
|
||||
}
|
||||
@closedir( $dir );
|
||||
return $files;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function sort two files
|
||||
*
|
||||
* @param array $a
|
||||
* @param array $b
|
||||
* @return boolean
|
||||
*/
|
||||
public function sort_files ($a, $b)
|
||||
{
|
||||
if ($a['type'] != $b['type']) {
|
||||
if ($a['type'] == 5 || $b['type'] == 2) {
|
||||
return - 1;
|
||||
} elseif ($a['type'] == 2 || $b['type'] == 5) {
|
||||
return 1;
|
||||
} elseif ($a['type'] == 5) {
|
||||
return strcmp( strtolower( $a['name'] ), strtolower( $b['name'] ) );
|
||||
} elseif ($a['ext'] != $b['ext']) {
|
||||
return strcmp( $a['ext'], $b['ext'] );
|
||||
} elseif ($a['stat'][7] != $b['stat'][7]) {
|
||||
return $a['stat'][7] > $b['stat'][7] ? - 1 : 1;
|
||||
} else {
|
||||
return strcmp( strtolower( $a['name'] ), strtolower( $b['name'] ) );
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function download a file
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function download_file ()
|
||||
{
|
||||
if ($this->options['inmemory'] == 0) {
|
||||
$this->error[] = "Can only use download_file() if archive is in memory. Redirect to file otherwise, it is faster.";
|
||||
return;
|
||||
}
|
||||
switch ($this->options['type']) {
|
||||
case "zip":
|
||||
header( "Content-Type: application/zip" );
|
||||
break;
|
||||
case "bzip":
|
||||
header( "Content-Type: application/x-bzip2" );
|
||||
break;
|
||||
case "gzip":
|
||||
header( "Content-Type: application/x-gzip" );
|
||||
break;
|
||||
case "tar":
|
||||
header( "Content-Type: application/x-tar" );
|
||||
}
|
||||
$header = "Content-Disposition: attachment; filename=\"";
|
||||
$header .= strstr( $this->options['name'], "/" ) ? substr( $this->options['name'], strrpos( $this->options['name'], "/" ) + 1 ) : $this->options['name'];
|
||||
$header .= "\"";
|
||||
header( $header );
|
||||
header( "Content-Length: " . strlen( $this->archive ) );
|
||||
header( "Content-Transfer-Encoding: binary" );
|
||||
header( "Cache-Control: no-cache, must-revalidate, max-age=60" );
|
||||
header( "Expires: Sat, 01 Jan 2000 12:00:00 GMT" );
|
||||
print ($this->archive) ;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This class is derived from the class archive, is imployed to use files .
|
||||
* tar
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*
|
||||
*/
|
||||
class tar_file extends archive
|
||||
{
|
||||
|
||||
/**
|
||||
* This function is the constructor of the class tar_file
|
||||
*
|
||||
* @param string $name
|
||||
*/
|
||||
public function tar_file ($name)
|
||||
{
|
||||
$this->archive( $name );
|
||||
$this->options['type'] = "tar";
|
||||
}
|
||||
|
||||
/**
|
||||
* This function create a file .
|
||||
* tar
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function create_tar ()
|
||||
{
|
||||
$pwd = getcwd();
|
||||
chdir( $this->options['basedir'] );
|
||||
foreach ($this->files as $current) {
|
||||
if ($current['name'] == $this->options['name']) {
|
||||
continue;
|
||||
}
|
||||
if (strlen( $current['name2'] ) > 99) {
|
||||
$path = substr( $current['name2'], 0, strpos( $current['name2'], "/", strlen( $current['name2'] ) - 100 ) + 1 );
|
||||
$current['name2'] = substr( $current['name2'], strlen( $path ) );
|
||||
if (strlen( $path ) > 154 || strlen( $current['name2'] ) > 99) {
|
||||
$this->error[] = "Could not add {$path}{$current['name2']} to archive because the filename is too long.";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$block = pack( "a100a8a8a8a12a12a8a1a100a6a2a32a32a8a8a155a12", $current['name2'], sprintf( "%07o", $current['stat'][2] ), sprintf( "%07o", $current['stat'][4] ), sprintf( "%07o", $current['stat'][5] ), sprintf( "%011o", $current['type'] == 2 ? 0 : $current['stat'][7] ), sprintf( "%011o", $current['stat'][9] ), " ", $current['type'], $current['type'] == 2 ? @readlink( $current['name'] ) : "", "ustar ", " ", "Unknown", "Unknown", "", "", ! empty( $path ) ? $path : "", "" );
|
||||
$checksum = 0;
|
||||
for ($i = 0; $i < 512; $i ++) {
|
||||
$checksum += ord( substr( $block, $i, 1 ) );
|
||||
}
|
||||
$checksum = pack( "a8", sprintf( "%07o", $checksum ) );
|
||||
$block = substr_replace( $block, $checksum, 148, 8 );
|
||||
if ($current['type'] == 2 || $current['stat'][7] == 0) {
|
||||
$this->add_data( $block );
|
||||
} elseif ($fp = @fopen( $current['name'], "rb" )) {
|
||||
$this->add_data( $block );
|
||||
while ($temp = fread( $fp, 1048576 )) {
|
||||
$this->add_data( $temp );
|
||||
}
|
||||
if ($current['stat'][7] % 512 > 0) {
|
||||
$temp = "";
|
||||
for ($i = 0; $i < 512 - $current['stat'][7] % 512; $i ++) {
|
||||
$temp .= "\0";
|
||||
}
|
||||
$this->add_data( $temp );
|
||||
}
|
||||
fclose( $fp );
|
||||
} else {
|
||||
$this->error[] = "Could not open file {$current['name']} for reading. It was not added.";
|
||||
}
|
||||
}
|
||||
$this->add_data( pack( "a1024", "" ) );
|
||||
chdir( $pwd );
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used for extract files of the class tar_file
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function extract_files ()
|
||||
{
|
||||
$pwd = getcwd();
|
||||
chdir( $this->options['basedir'] );
|
||||
if ($fp = $this->open_archive()) {
|
||||
if ($this->options['inmemory'] == 1) {
|
||||
$this->files = array ();
|
||||
}
|
||||
while ($block = fread( $fp, 512 )) {
|
||||
$temp = unpack( "a100name/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1type/a100symlink/a6magic/a2temp/a32temp/a32temp/a8temp/a8temp/a155prefix/a12temp", $block );
|
||||
$file = array ('name' => $this->options['basedir'] . '/' . $temp['prefix'] . $temp['name'],'stat' => array (2 => $temp['mode'],4 => octdec( $temp['uid'] ),5 => octdec( $temp['gid'] ),7 => octdec( $temp['size'] ),9 => octdec( $temp['mtime'] )
|
||||
),'checksum' => octdec( $temp['checksum'] ),'type' => $temp['type'],'magic' => $temp['magic']
|
||||
);
|
||||
if ($file['checksum'] == 0x00000000) {
|
||||
break;
|
||||
} elseif (substr( $file['magic'], 0, 5 ) != "ustar") {
|
||||
$this->error[] = "This script does not support extracting this type of tar file.";
|
||||
break;
|
||||
}
|
||||
$block = substr_replace( $block, " ", 148, 8 );
|
||||
$checksum = 0;
|
||||
for ($i = 0; $i < 512; $i ++) {
|
||||
$checksum += ord( substr( $block, $i, 1 ) );
|
||||
}
|
||||
if ($file['checksum'] != $checksum) {
|
||||
$this->error[] = "Could not extract from {$this->options['name']}, it is corrupt.";
|
||||
}
|
||||
if ($this->options['inmemory'] == 1) {
|
||||
$file['data'] = fread( $fp, $file['stat'][7] );
|
||||
fread( $fp, (512 - $file['stat'][7] % 512) == 512 ? 0 : (512 - $file['stat'][7] % 512) );
|
||||
unset( $file['checksum'], $file['magic'] );
|
||||
$this->files[] = $file;
|
||||
} elseif ($file['type'] == 5) {
|
||||
if (! is_dir( $file['name'] )) {
|
||||
//mkdir($file['name'], $file['stat'][2]);
|
||||
mkdir( $file['name'], 0775 );
|
||||
}
|
||||
} elseif ($this->options['overwrite'] == 0 && file_exists( $file['name'] )) {
|
||||
$this->error[] = "{$file['name']} already exist.";
|
||||
continue;
|
||||
} elseif ($file['type'] == 2) {
|
||||
symlink( $temp['symlink'], $file['name'] );
|
||||
//chmod($file['name'], $file['stat'][2]);
|
||||
} elseif ($new = @fopen( $file['name'], "wb" )) {
|
||||
fwrite( $new, fread( $fp, $file['stat'][7] ) );
|
||||
if ((512 - $file['stat'][7] % 512) != 512) {
|
||||
fread( $fp, (512 - $file['stat'][7] % 512) );
|
||||
}
|
||||
//fread($fp, (512 - $file['stat'][7] % 512) == 512 ? 0 : (512 - $file['stat'][7] % 512));
|
||||
fclose( $new );
|
||||
//chmod($file['name'], $file['stat'][2]);
|
||||
chmod( $file['name'], 0777 );
|
||||
$this->files[] = $file['name'];
|
||||
} else {
|
||||
$this->error[] = "Could not open {$file['name']} for writing.";
|
||||
continue;
|
||||
}
|
||||
//chown($file['name'], $file['stat'][4]);
|
||||
//chgrp($file['name'], $file['stat'][5]);
|
||||
@touch( $file['name'], $file['stat'][9] );
|
||||
unset( $file );
|
||||
}
|
||||
} else {
|
||||
$this->error[] = "Could not open file {$this->options['name']}";
|
||||
}
|
||||
chdir( $pwd );
|
||||
}
|
||||
|
||||
/**
|
||||
* This function open a archive of the class tar_file
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function open_archive ()
|
||||
{
|
||||
return @fopen( $this->options['name'], "rb" );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This class is derived of the class archive, is employed to use archives .
|
||||
* gzip
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*
|
||||
*/
|
||||
class gzip_file extends tar_file
|
||||
{
|
||||
|
||||
/**
|
||||
* This function is the constructor of the class gzip_file
|
||||
*
|
||||
* @param string $name
|
||||
* @return void
|
||||
*/
|
||||
public function gzip_file ($name)
|
||||
{
|
||||
$this->tar_file( $name );
|
||||
$this->options['type'] = "gzip";
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is employed to create files .
|
||||
* gzip
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
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 );
|
||||
}
|
||||
gzclose( $fp );
|
||||
chdir( $pwd );
|
||||
} else {
|
||||
$this->error[] = "Could not open {$this->options['name']} for writing.";
|
||||
chdir( $pwd );
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
$this->archive = gzencode( $this->archive, $this->options['level'] );
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function open a archive of the class gzip_file
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function open_archive ()
|
||||
{
|
||||
return @gzopen( $this->options['name'], "rb" );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* This class is derived from the class archive, is employed to use files .bzip
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*
|
||||
*/
|
||||
class bzip_file extends tar_file
|
||||
{
|
||||
|
||||
/**
|
||||
* This function is the constructor of the class bzip_file
|
||||
*
|
||||
* @param string $name
|
||||
* @return void
|
||||
*/
|
||||
public function bzip_file ($name)
|
||||
{
|
||||
$this->tar_file( $name );
|
||||
$this->options['type'] = "bzip";
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is employed to create files .
|
||||
* bzip
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function create_bzip ()
|
||||
{
|
||||
if ($this->options['inmemory'] == 0) {
|
||||
$pwd = getcwd();
|
||||
chdir( $this->options['basedir'] );
|
||||
if ($fp = bzopen( $this->options['name'], "wb" )) {
|
||||
fseek( $this->archive, 0 );
|
||||
while ($temp = fread( $this->archive, 1048576 )) {
|
||||
bzwrite( $fp, $temp );
|
||||
}
|
||||
bzclose( $fp );
|
||||
chdir( $pwd );
|
||||
} else {
|
||||
$this->error[] = "Could not open {$this->options['name']} for writing.";
|
||||
chdir( $pwd );
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
$this->archive = bzcompress( $this->archive, $this->options['level'] );
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function open a archive of the class bzip_file
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function open_archive ()
|
||||
{
|
||||
return @bzopen( $this->options['name'], "rb" );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This class is derived from the class archive, is imployed to use files .
|
||||
* zip
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
|
||||
class zip_file extends archive
|
||||
{
|
||||
|
||||
public function zip_file ($name)
|
||||
{
|
||||
$this->archive( $name );
|
||||
$this->options['type'] = "zip";
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used to create archives .
|
||||
* zip
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function create_zip ()
|
||||
{
|
||||
$files = 0;
|
||||
$offset = 0;
|
||||
$central = "";
|
||||
if (! empty( $this->options['sfx'] )) {
|
||||
if ($fp = @fopen( $this->options['sfx'], "rb" )) {
|
||||
$temp = fread( $fp, filesize( $this->options['sfx'] ) );
|
||||
fclose( $fp );
|
||||
$this->add_data( $temp );
|
||||
$offset += strlen( $temp );
|
||||
unset( $temp );
|
||||
} else {
|
||||
$this->error[] = "Could not open sfx module from {$this->options['sfx']}.";
|
||||
}
|
||||
}
|
||||
$pwd = getcwd();
|
||||
chdir( $this->options['basedir'] );
|
||||
foreach ($this->files as $current) {
|
||||
if ($current['name'] == $this->options['name']) {
|
||||
continue;
|
||||
}
|
||||
$timedate = explode( " ", date( "Y n j G i s", $current['stat'][9] ) );
|
||||
$timedate = ($timedate[0] - 1980 << 25) | ($timedate[1] << 21) | ($timedate[2] << 16) | ($timedate[3] << 11) | ($timedate[4] << 5) | ($timedate[5]);
|
||||
$block = pack( "VvvvV", 0x04034b50, 0x000A, 0x0000, (isset( $current['method'] ) || $this->options['method'] == 0) ? 0x0000 : 0x0008, $timedate );
|
||||
if ($current['stat'][7] == 0 && $current['type'] == 5) {
|
||||
$block .= pack( "VVVvv", 0x00000000, 0x00000000, 0x00000000, strlen( $current['name2'] ) + 1, 0x0000 );
|
||||
$block .= $current['name2'] . "/";
|
||||
$this->add_data( $block );
|
||||
$central .= pack( "VvvvvVVVVvvvvvVV", 0x02014b50, 0x0014, $this->options['method'] == 0 ? 0x0000 : 0x000A, 0x0000, (isset( $current['method'] ) || $this->options['method'] == 0) ? 0x0000 : 0x0008, $timedate, 0x00000000, 0x00000000, 0x00000000, strlen( $current['name2'] ) + 1, 0x0000, 0x0000, 0x0000, 0x0000, $current['type'] == 5 ? 0x00000010 : 0x00000000, $offset );
|
||||
$central .= $current['name2'] . "/";
|
||||
$files ++;
|
||||
$offset += (31 + strlen( $current['name2'] ));
|
||||
} elseif ($current['stat'][7] == 0) {
|
||||
$block .= pack( "VVVvv", 0x00000000, 0x00000000, 0x00000000, strlen( $current['name2'] ), 0x0000 );
|
||||
$block .= $current['name2'];
|
||||
$this->add_data( $block );
|
||||
$central .= pack( "VvvvvVVVVvvvvvVV", 0x02014b50, 0x0014, $this->options['method'] == 0 ? 0x0000 : 0x000A, 0x0000, (isset( $current['method'] ) || $this->options['method'] == 0) ? 0x0000 : 0x0008, $timedate, 0x00000000, 0x00000000, 0x00000000, strlen( $current['name2'] ), 0x0000, 0x0000, 0x0000, 0x0000, $current['type'] == 5 ? 0x00000010 : 0x00000000, $offset );
|
||||
$central .= $current['name2'];
|
||||
$files ++;
|
||||
$offset += (30 + strlen( $current['name2'] ));
|
||||
} elseif ($fp = @fopen( $current['name'], "rb" )) {
|
||||
$temp = fread( $fp, $current['stat'][7] );
|
||||
fclose( $fp );
|
||||
$crc32 = G::encryptCrc32( $temp );
|
||||
if (! isset( $current['method'] ) && $this->options['method'] == 1) {
|
||||
$temp = gzcompress( $temp, $this->options['level'] );
|
||||
$size = strlen( $temp ) - 6;
|
||||
$temp = substr( $temp, 2, $size );
|
||||
} else {
|
||||
$size = strlen( $temp );
|
||||
}
|
||||
$block .= pack( "VVVvv", $crc32, $size, $current['stat'][7], strlen( $current['name2'] ), 0x0000 );
|
||||
$block .= $current['name2'];
|
||||
$this->add_data( $block );
|
||||
$this->add_data( $temp );
|
||||
unset( $temp );
|
||||
$central .= pack( "VvvvvVVVVvvvvvVV", 0x02014b50, 0x0014, $this->options['method'] == 0 ? 0x0000 : 0x000A, 0x0000, (isset( $current['method'] ) || $this->options['method'] == 0) ? 0x0000 : 0x0008, $timedate, $crc32, $size, $current['stat'][7], strlen( $current['name2'] ), 0x0000, 0x0000, 0x0000, 0x0000, 0x00000000, $offset );
|
||||
$central .= $current['name2'];
|
||||
$files ++;
|
||||
$offset += (30 + strlen( $current['name2'] ) + $size);
|
||||
} else {
|
||||
$this->error[] = "Could not open file {$current['name']} for reading. It was not added.";
|
||||
}
|
||||
}
|
||||
$this->add_data( $central );
|
||||
$this->add_data( pack( "VvvvvVVv", 0x06054b50, 0x0000, 0x0000, $files, $files, strlen( $central ), $offset, ! empty( $this->options['comment'] ) ? strlen( $this->options['comment'] ) : 0x0000 ) );
|
||||
if (! empty( $this->options['comment'] )) {
|
||||
$this->add_data( $this->options['comment'] );
|
||||
}
|
||||
chdir( $pwd );
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
require_once 'class.pluginRegistry.php';
|
||||
|
||||
define('G_PLUGIN_CLASS', 1);
|
||||
define('PM_CREATE_CASE', 1001);
|
||||
|
||||
@@ -1,233 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.wsResponse.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.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
|
||||
class wsResponse
|
||||
{
|
||||
public $status_code = 0;
|
||||
public $message = '';
|
||||
public $timestamp = '';
|
||||
|
||||
/**
|
||||
* Function __construct
|
||||
* Constructor of the class
|
||||
*
|
||||
* @param string $status
|
||||
* @param string $message
|
||||
* @return void
|
||||
*/
|
||||
function __construct ($status, $message)
|
||||
{
|
||||
$this->status_code = $status;
|
||||
$this->message = $message;
|
||||
$this->timestamp = date( 'Y-m-d H:i:s' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Function getPayloadString
|
||||
*
|
||||
* @param string $operation
|
||||
* @return string
|
||||
*/
|
||||
function getPayloadString ($operation)
|
||||
{
|
||||
$res = "<$operation>\n";
|
||||
$res .= "<status_code>" . $this->status_code . "</status_code>";
|
||||
$res .= "<message>" . $this->message . "</message>";
|
||||
$res .= "<timestamp>" . $this->timestamp . "</timestamp>";
|
||||
// $res .= "<array>" . $this->timestamp . "</array>";
|
||||
$res .= "<$operation>";
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function getPayloadArray
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getPayloadArray ()
|
||||
{
|
||||
return array ("status_code" => $this->status_code,'message' => $this->message,'timestamp' => $this->timestamp
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class wsCreateUserResponse
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
class wsCreateUserResponse
|
||||
{
|
||||
public $status_code = 0;
|
||||
public $message = '';
|
||||
public $userUID = '';
|
||||
public $timestamp = '';
|
||||
|
||||
/**
|
||||
* Function __construct
|
||||
* Constructor of the class
|
||||
*
|
||||
* @param string $status
|
||||
* @param string $message
|
||||
* @param string $userUID
|
||||
* @return void
|
||||
*/
|
||||
function __construct ($status, $message, $userUID)
|
||||
{
|
||||
$this->status_code = $status;
|
||||
$this->message = $message;
|
||||
$this->userUID = $userUID;
|
||||
$this->timestamp = date( 'Y-m-d H:i:s' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class wsCreateGroupResponse
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
class wsCreateGroupResponse
|
||||
{
|
||||
public $status_code = 0;
|
||||
public $message = '';
|
||||
public $groupUID = '';
|
||||
public $timestamp = '';
|
||||
|
||||
/**
|
||||
* Function __construct
|
||||
* Constructor of the class
|
||||
*
|
||||
* @param string $status
|
||||
* @param string $message
|
||||
* @param string $groupUID
|
||||
* @return void
|
||||
*/
|
||||
function __construct ($status, $message, $groupUID)
|
||||
{
|
||||
$this->status_code = $status;
|
||||
$this->message = $message;
|
||||
$this->groupUID = $groupUID;
|
||||
$this->timestamp = date( 'Y-m-d H:i:s' );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Class wsCreateDepartmentResponse
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
class wsCreateDepartmentResponse
|
||||
{
|
||||
public $status_code = 0;
|
||||
public $message = '';
|
||||
public $departmentUID = '';
|
||||
public $timestamp = '';
|
||||
|
||||
/**
|
||||
* Function __construct
|
||||
* Constructor of the class
|
||||
*
|
||||
* @param string $status
|
||||
* @param string $message
|
||||
* @param string $departmentUID
|
||||
* @return void
|
||||
*/
|
||||
function __construct ($status, $message, $departmentUID)
|
||||
{
|
||||
$this->status_code = $status;
|
||||
$this->message = $message;
|
||||
$this->departmentUID = $departmentUID;
|
||||
$this->timestamp = date( 'Y-m-d H:i:s' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class wsGetVariableResponse
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
class wsGetVariableResponse
|
||||
{
|
||||
public $status_code = 0;
|
||||
public $message = '';
|
||||
public $variables = null;
|
||||
public $timestamp = '';
|
||||
|
||||
/**
|
||||
* Function __construct
|
||||
* Constructor of the class
|
||||
*
|
||||
* @param string $status
|
||||
* @param string $message
|
||||
* @param string $variables
|
||||
* @return void
|
||||
*/
|
||||
function __construct ($status, $message, $variables)
|
||||
{
|
||||
$this->status_code = $status;
|
||||
$this->message = $message;
|
||||
$this->variables = $variables;
|
||||
$this->timestamp = date( 'Y-m-d H:i:s' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class wsGetCaseNotesResponse
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
class wsGetCaseNotesResponse
|
||||
{
|
||||
public $status_code = 0;
|
||||
public $message = '';
|
||||
public $notes = null;
|
||||
public $timestamp = '';
|
||||
|
||||
/**
|
||||
* Function __construct
|
||||
* Constructor of the class
|
||||
*
|
||||
* @param string $status
|
||||
* @param string $message
|
||||
* @param array|object|string $notes
|
||||
* @return void
|
||||
*/
|
||||
function __construct ($status, $message, $notes)
|
||||
{
|
||||
$this->status_code = $status;
|
||||
$this->message = $message;
|
||||
$this->notes = $notes;
|
||||
$this->timestamp = date( 'Y-m-d H:i:s' );
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,580 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class.xmlfield_InputPM.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.
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
**/
|
||||
|
||||
class XmlForm_Field_TextPM extends XmlForm_Field_SimpleText
|
||||
{
|
||||
public $size = 15;
|
||||
public $maxLength = 64;
|
||||
public $validate = 'Any';
|
||||
public $mask = '';
|
||||
public $defaultValue = '';
|
||||
public $required = false;
|
||||
public $dependentFields = '';
|
||||
public $linkField = '';
|
||||
//Possible values:(-|UPPER|LOWER|CAPITALIZE)
|
||||
public $strTo = '';
|
||||
public $readOnly = false;
|
||||
public $sqlConnection = 0;
|
||||
public $sql = '';
|
||||
public $sqlOption = array ();
|
||||
//Atributes only for grids
|
||||
public $formula = '';
|
||||
public $function = '';
|
||||
public $replaceTags = 0;
|
||||
public $showVars = 0;
|
||||
public $process = '';
|
||||
public $symbol = '@@';
|
||||
|
||||
/**
|
||||
* Function render
|
||||
*
|
||||
* @author Julio Cesar Laura Avendano <juliocesar@colosa.com>
|
||||
* @access public
|
||||
* @param eter string value
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
public function render ($value = null, $owner = null)
|
||||
{
|
||||
//$this->executeSQL();
|
||||
//if (isset($this->sqlOption)) {
|
||||
// reset($this->sqlOption);
|
||||
// $firstElement=key($this->sqlOption);
|
||||
// if (isset($firstElement)) $value = $firstElement;
|
||||
//}
|
||||
//NOTE: string functions must be in G class
|
||||
if ($this->strTo === 'UPPER') {
|
||||
$value = strtoupper( $value );
|
||||
}
|
||||
if ($this->strTo === 'LOWER') {
|
||||
$value = strtolower( $value );
|
||||
}
|
||||
//if ($this->strTo==='CAPITALIZE') $value = strtocapitalize($value);
|
||||
$onkeypress = G::replaceDataField( $this->onkeypress, $owner->values );
|
||||
if ($this->replaceTags == 1) {
|
||||
$value = G::replaceDataField( $value, $owner->values );
|
||||
}
|
||||
if ($this->showVars == 1) {
|
||||
$this->process = G::replaceDataField( $this->process, $owner->values );
|
||||
//$sShowVars = ' <a href="#" onclick="showDynaformsFormVars(\'form['.$this->name.']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;">' . $this->symbol . '</a>';
|
||||
$sShowVars = ' <input type="button" value="' . $this->symbol . '" onclick="showDynaformsFormVars(\'form[' . $this->name . ']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;"/>';
|
||||
} else {
|
||||
$sShowVars = '';
|
||||
}
|
||||
if ($this->mode === 'edit') {
|
||||
if ($this->readOnly) {
|
||||
return '<input class="module_app_input___gray" id="form[' . $this->name . ']" name="form[' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' readOnly="readOnly" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
} else {
|
||||
return '<input class="module_app_input___gray" id="form[' . $this->name . ']" name="form[' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
}
|
||||
} elseif ($this->mode === 'view') {
|
||||
return '<input class="module_app_input___gray" id="form[' . $this->name . ']" name="form[' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' style="display:none;' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' );
|
||||
} else {
|
||||
return $this->htmlentities( $value, ENT_COMPAT, 'utf-8' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function renderGrid
|
||||
*
|
||||
* @author Julio Cesar Laura Avendano <juliocesar@colosa.com>
|
||||
* @access public
|
||||
* @param eter array values
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
public function renderGrid ($values = array(), $owner)
|
||||
{
|
||||
$result = array ();
|
||||
$r = 1;
|
||||
foreach ($values as $v) {
|
||||
if ($this->replaceTags == 1) {
|
||||
$v = G::replaceDataField( $v, $owner->values );
|
||||
}
|
||||
if ($this->showVars == 1) {
|
||||
$this->process = G::replaceDataField( $this->process, $owner->values );
|
||||
//$sShowVars = ' <a href="#" onclick="showDynaformsFormVars(\'form['.$owner->name .']['.$r.']['.$this->name.']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;">' . $this->symbol . '</a>';
|
||||
$sShowVars = ' <input type="button" value="' . $this->symbol . '" onclick="showDynaformsFormVars(\'form[' . $owner->name . '][' . $r . '][' . $this->name . ']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;"/>';
|
||||
} else {
|
||||
$sShowVars = '';
|
||||
}
|
||||
if ($this->mode === 'edit') {
|
||||
if ($this->readOnly) {
|
||||
$result[] = '<input class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value="' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '" readOnly="readOnly" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
} else {
|
||||
$result[] = '<input class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value="' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
}
|
||||
} elseif ($this->mode === 'view') {
|
||||
$result[] = $this->htmlentities( $v, ENT_COMPAT, 'utf-8' );
|
||||
} else {
|
||||
$result[] = $this->htmlentities( $v, ENT_COMPAT, 'utf-8' );
|
||||
}
|
||||
$r ++;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function attachEvents
|
||||
*
|
||||
* @access public
|
||||
* @param eter string $element
|
||||
* @return string
|
||||
*/
|
||||
public function attachEvents ($element)
|
||||
{
|
||||
return "myForm.aElements[i] = new G_Text(myForm, $element,'{$this->name}');
|
||||
myForm.aElements[i].setAttributes(" . $this->getAttributes() . ");";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class XmlForm_Field_TextareaPM
|
||||
*/
|
||||
class XmlForm_Field_TextareaPM extends XmlForm_Field
|
||||
{
|
||||
public $rows = 12;
|
||||
public $cols = 40;
|
||||
public $required = false;
|
||||
public $readOnly = false;
|
||||
public $wrap = 'OFF';
|
||||
public $showVars = 0;
|
||||
public $process = '';
|
||||
public $symbol = '@@';
|
||||
|
||||
/**
|
||||
* Function render
|
||||
*
|
||||
* @author Julio Cesar Laura Avendao <juliocesar@colosa.com>
|
||||
* @access public
|
||||
* @param eter string value
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
public function render ($value = null, $owner)
|
||||
{
|
||||
if ($this->showVars == 1) {
|
||||
$this->process = G::replaceDataField( $this->process, $owner->values );
|
||||
$sShowVars = ' <input type="button" value="' . $this->symbol . '" onclick="showDynaformsFormVars(\'form[' . $this->name . ']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;"/>';
|
||||
} else {
|
||||
$sShowVars = '';
|
||||
}
|
||||
if ($this->mode === 'edit') {
|
||||
if ($this->readOnly) {
|
||||
return '<textarea id="form[' . $this->name . ']" name="form[' . $this->name . ']" cols="' . $this->cols . '" rows="' . $this->rows . '" style="' . $this->style . '" wrap="' . htmlentities( $this->wrap, ENT_QUOTES, 'UTF-8' ) . '" class="FormTextPM" readOnly>' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '</textarea>' . $sShowVars;
|
||||
} else {
|
||||
return '<textarea id="form[' . $this->name . ']" name="form[' . $this->name . ']" cols="' . $this->cols . '" rows="' . $this->rows . '" style="' . $this->style . '" wrap="' . htmlentities( $this->wrap, ENT_QUOTES, 'UTF-8' ) . '" class="FormTextPM" >' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '</textarea>' . $sShowVars;
|
||||
}
|
||||
} elseif ($this->mode === 'view') {
|
||||
return '<textarea id="form[' . $this->name . ']" name="form[' . $this->name . ']" cols="' . $this->cols . '" rows="' . $this->rows . '" readOnly style="border:0px;backgroud-color:inherit;' . $this->style . '" wrap="' . htmlentities( $this->wrap, ENT_QUOTES, 'UTF-8' ) . '" class="FormTextPM" >' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '</textarea>';
|
||||
} else {
|
||||
return '<textarea id="form[' . $this->name . ']" name="form[' . $this->name . ']" cols="' . $this->cols . '" rows="' . $this->rows . '" style="' . $this->style . '" wrap="' . htmlentities( $this->wrap, ENT_QUOTES, 'UTF-8' ) . '" class="FormTextArea" >' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '</textarea>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function renderGrid
|
||||
*
|
||||
* @author Julio Cesar Laura Avendano <juliocesar@colosa.com>
|
||||
* @access public
|
||||
* @param eter string values
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
public function renderGrid ($owner, $values = null)
|
||||
{
|
||||
$result = array ();
|
||||
$r = 1;
|
||||
foreach ($values as $v) {
|
||||
if ($this->showVars == 1) {
|
||||
$this->process = G::replaceDataField( $this->process, $owner->values );
|
||||
//$sShowVars = ' <a href="#" onclick="showDynaformsFormVars(\'form['.$owner->name .']['.$r.']['.$this->name.']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;">' . $this->symbol . '</a>';
|
||||
$sShowVars = ' <input type="button" value="' . $this->symbol . '" onclick="showDynaformsFormVars(\'form[' . $owner->name . '][' . $r . '][' . $this->name . ']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;"/>';
|
||||
} else {
|
||||
$sShowVars = '';
|
||||
}
|
||||
if ($this->mode === 'edit') {
|
||||
if ($this->readOnly) {
|
||||
$result[] = '<input class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '\' readOnly="readOnly"/>' . $sShowVars;
|
||||
} else {
|
||||
$result[] = '<input class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '\' />' . $sShowVars;
|
||||
}
|
||||
} elseif ($this->mode === 'view') {
|
||||
if (stristr( $_SERVER['HTTP_USER_AGENT'], 'iPhone' )) {
|
||||
//$result[] = '<div style="overflow:hidden;height:25px;padding:0px;margin:0px;">'.$this->htmlentities( $v , ENT_COMPAT, 'utf-8').'</div>';
|
||||
$result[] = $this->htmlentities( $v, ENT_COMPAT, 'utf-8' );
|
||||
} else {
|
||||
//$result[] = '<div style="overflow:hidden;width:inherit;height:2em;padding:0px;margin:0px;">'.$this->htmlentities( $v , ENT_COMPAT, 'utf-8').'</div>';
|
||||
$result[] = $this->htmlentities( $v, ENT_COMPAT, 'utf-8' );
|
||||
}
|
||||
} else {
|
||||
$result[] = $this->htmlentities( $v, ENT_COMPAT, 'utf-8' );
|
||||
}
|
||||
$r ++;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class XmlForm_Field_hours
|
||||
*/
|
||||
class XmlForm_Field_hours extends XmlForm_Field_SimpleText
|
||||
{
|
||||
public $size = 15;
|
||||
public $maxLength = 64;
|
||||
public $validate = 'Any';
|
||||
public $mask = '';
|
||||
public $defaultValue = '';
|
||||
public $required = false;
|
||||
public $dependentFields = '';
|
||||
public $linkField = '';
|
||||
//Possible values:(-|UPPER|LOWER|CAPITALIZE)
|
||||
public $strTo = '';
|
||||
public $readOnly = false;
|
||||
public $sqlConnection = 0;
|
||||
public $sql = '';
|
||||
public $sqlOption = array ();
|
||||
//Atributes only for grids
|
||||
public $formula = '';
|
||||
public $function = '';
|
||||
public $replaceTags = 0;
|
||||
public $showVars = 0;
|
||||
public $process = '';
|
||||
public $symbol = '@@';
|
||||
|
||||
/**
|
||||
* Function render
|
||||
*
|
||||
* @author Julio Cesar Laura Avendano <juliocesar@colosa.com>
|
||||
* @access public
|
||||
* @param eter string value
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
public function render ($value = null, $owner = null)
|
||||
{
|
||||
if ($this->strTo === 'UPPER') {
|
||||
$value = strtoupper( $value );
|
||||
}
|
||||
if ($this->strTo === 'LOWER') {
|
||||
$value = strtolower( $value );
|
||||
}
|
||||
//if ($this->strTo==='CAPITALIZE') $value = strtocapitalize($value);
|
||||
$onkeypress = G::replaceDataField( $this->onkeypress, $owner->values );
|
||||
if ($this->replaceTags == 1) {
|
||||
$value = G::replaceDataField( $value, $owner->values );
|
||||
}
|
||||
if ($this->showVars == 1) {
|
||||
$this->process = G::replaceDataField( $this->process, $owner->values );
|
||||
//$sShowVars = ' <a href="#" onclick="showDynaformsFormVars(\'form['.$this->name.']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;">' . $this->symbol . '</a>';
|
||||
$sShowVars = ' <input type="button" value="' . $this->symbol . '" onclick="showDynaformsFormVars(\'form[' . $this->name . ']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;"/>';
|
||||
} else {
|
||||
$sShowVars = '';
|
||||
}
|
||||
if ($this->mode === 'edit') {
|
||||
if ($this->readOnly) {
|
||||
return '<input class="module_app_input___gray" id="form[' . $this->name . ']" name="form[' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' readOnly="readOnly" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
} else {
|
||||
return '<input class="module_app_input___gray" id="form[' . $this->name . ']" name="form[' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
}
|
||||
} elseif ($this->mode === 'view') {
|
||||
return '<input class="module_app_input___gray" id="form[' . $this->name . ']" name="form[' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' style="display:none;' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' );
|
||||
} else {
|
||||
return $this->htmlentities( $value, ENT_COMPAT, 'utf-8' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function renderGrid
|
||||
*
|
||||
* @author Julio Cesar Laura Avendano <juliocesar@colosa.com>
|
||||
* @access public
|
||||
* @param eter array values
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
public function renderGrid ($values = array(),$owner)
|
||||
{
|
||||
$result = array ();
|
||||
$r = 1;
|
||||
foreach ($values as $v) {
|
||||
if ($this->replaceTags == 1) {
|
||||
$v = G::replaceDataField( $v, $owner->values );
|
||||
}
|
||||
if ($this->showVars == 1) {
|
||||
$this->process = G::replaceDataField( $this->process, $owner->values );
|
||||
//$sShowVars = ' <a href="#" onclick="showDynaformsFormVars(\'form['.$owner->name .']['.$r.']['.$this->name.']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;">' . $this->symbol . '</a>';
|
||||
$sShowVars = ' <input type="button" value="' . $this->symbol . '" onclick="showDynaformsFormVars(\'form[' . $owner->name . '][' . $r . '][' . $this->name . ']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;"/>';
|
||||
} else {
|
||||
$sShowVars = '';
|
||||
}
|
||||
if ($this->mode === 'edit') {
|
||||
if ($this->readOnly) {
|
||||
$result[] = '<input class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value="' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '" readOnly="readOnly" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
} else {
|
||||
$result[] = '<input class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value="' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '"/>' . $sShowVars;
|
||||
}
|
||||
} elseif ($this->mode === 'view') {
|
||||
$result[] = '<p align="' . $this->align . '">' . $this->htmlentities( number_format( $v, 2 ), ENT_COMPAT, 'utf-8' ) . '</p>';
|
||||
} else {
|
||||
$result[] = '<p align="' . $this->align . '">' . $this->htmlentities( number_format( $v, 2 ), ENT_COMPAT, 'utf-8' ) . '</p>';
|
||||
}
|
||||
$r ++;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function attachEvents
|
||||
*
|
||||
* @access public
|
||||
* @param eter string $element
|
||||
* @return string
|
||||
*/
|
||||
public function attachEvents ($element)
|
||||
{
|
||||
return "myForm.aElements[i] = new G_Text(myForm, $element,'{$this->name}');
|
||||
myForm.aElements[i].setAttributes(" . $this->getAttributes() . ");";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function getDynaformsVars
|
||||
*
|
||||
* @access public
|
||||
* @param eter string $sProcessUID
|
||||
* @param eter boolean $bSystemVars
|
||||
* @return array
|
||||
*/
|
||||
function getDynaformsVars ($sProcessUID, $typeVars = 'all', $bIncMulSelFields = 0)
|
||||
{
|
||||
$aFields = array ();
|
||||
$aFieldsNames = array ();
|
||||
if ($typeVars == 'system' || $typeVars == 'all') {
|
||||
$aAux = G::getSystemConstants();
|
||||
foreach ($aAux as $sName => $sValue) {
|
||||
$aFields[] = array ('sName' => $sName,'sType' => 'system','sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLES'));
|
||||
}
|
||||
//we're adding the pin variable to the system list
|
||||
$aFields[] = array ('sName' => 'PIN','sType' => 'system','sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLES'));
|
||||
|
||||
//we're adding the app_number variable to the system list
|
||||
$aFields[] = array('sName' => 'APP_NUMBER', 'sType' => 'system', 'sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLE'), 'sUid' => '');
|
||||
}
|
||||
|
||||
$aInvalidTypes = array("title", "subtitle", "file", "button", "reset", "submit", "javascript", "pmconnection");
|
||||
$aMultipleSelectionFields = array("listbox", "checkgroup");
|
||||
|
||||
if ($bIncMulSelFields != 0) {
|
||||
$aInvalidTypes = array_merge( $aInvalidTypes, $aMultipleSelectionFields );
|
||||
}
|
||||
// getting bpmn projects
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(BpmnProjectPeer::PRJ_UID);
|
||||
$oCriteria->add(BpmnProjectPeer::PRJ_UID, $sProcessUID);
|
||||
$oDataset = ProcessPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro'));
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$row = $oDataset->getRow();
|
||||
if (isset($row["PRJ_UID"])) {
|
||||
if($typeVars == 'process' || $typeVars == 'all') {
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_UID);
|
||||
$oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_NAME);
|
||||
$oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_FIELD_TYPE);
|
||||
$oCriteria->add(ProcessVariablesPeer::PRJ_UID, $sProcessUID);
|
||||
$oDataset = ProcessVariablesPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
while ($oDataset->next()) {
|
||||
$row = $oDataset->getRow();
|
||||
array_push($aFields, array(
|
||||
"sName" => $row["VAR_NAME"],
|
||||
"sType" => $row["VAR_FIELD_TYPE"],
|
||||
"sLabel" => $row["VAR_FIELD_TYPE"]
|
||||
));
|
||||
}
|
||||
}
|
||||
if($typeVars == 'grid' || $typeVars == 'all') {
|
||||
$oC = new Criteria( 'workflow' );
|
||||
$oC->addSelectColumn( DynaformPeer::DYN_CONTENT );
|
||||
$oC->add( DynaformPeer::PRO_UID, $sProcessUID );
|
||||
$oC->add( DynaformPeer::DYN_TYPE, 'xmlform' );
|
||||
$oData = DynaformPeer::doSelectRS( $oC );
|
||||
$oData->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oData->next();
|
||||
while ($aRowd = $oData->getRow()) {
|
||||
$dynaform = G::json_decode($aRowd['DYN_CONTENT'],true);
|
||||
if(is_array($dynaform) && sizeof($dynaform)) {
|
||||
$items = $dynaform['items'][0]['items'];
|
||||
foreach($items as $key => $val){
|
||||
if(isset($val[0]['type']) && $val[0]['type'] == 'grid'){
|
||||
if(sizeof($val[0]['columns'])) {
|
||||
$columns = $val[0]['columns'];
|
||||
foreach($columns as $column) {
|
||||
array_push($aFields, array(
|
||||
"sName" => $column['name'],
|
||||
"sType" => $column['type'],
|
||||
"sLabel" => $column['type']
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$oData->next();
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
require_once 'classes/model/Dynaform.php';
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( DynaformPeer::DYN_FILENAME );
|
||||
$oCriteria->add( DynaformPeer::PRO_UID, $sProcessUID );
|
||||
$oCriteria->add( DynaformPeer::DYN_TYPE, 'xmlform' );
|
||||
$oDataset = DynaformPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
if (file_exists( PATH_DYNAFORM . PATH_SEP . $aRow['DYN_FILENAME'] . '.xml' )) {
|
||||
$G_FORM = new Form( $aRow['DYN_FILENAME'], PATH_DYNAFORM, SYS_LANG );
|
||||
if (($G_FORM->type == 'xmlform') || ($G_FORM->type == '')) {
|
||||
foreach ($G_FORM->fields as $k => $v) {
|
||||
if (! in_array( $v->type, $aInvalidTypes )) {
|
||||
if (! in_array( $k, $aFieldsNames )) {
|
||||
$aFields[] = array ('sName' => $k,'sType' => $v->type,'sLabel' => ($v->type != 'grid' ? $v->label : '[ ' . G::LoadTranslation( 'ID_GRID' ) . ' ]')
|
||||
);
|
||||
$aFieldsNames[] = $k;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$oDataset->next();
|
||||
}
|
||||
}
|
||||
return $aFields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function getGridsVars
|
||||
*
|
||||
* @access public
|
||||
* @param eter string $sProcessUID
|
||||
* @return array
|
||||
*/
|
||||
function getGridsVars ($sProcessUID)
|
||||
{
|
||||
$aFields = array ();
|
||||
$aFieldsNames = array ();
|
||||
|
||||
require_once 'classes/model/Dynaform.php';
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( DynaformPeer::DYN_FILENAME );
|
||||
$oCriteria->add( DynaformPeer::PRO_UID, $sProcessUID );
|
||||
$oDataset = DynaformPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$G_FORM = new Form( $aRow['DYN_FILENAME'], PATH_DYNAFORM, SYS_LANG );
|
||||
if ($G_FORM->type == 'xmlform') {
|
||||
foreach ($G_FORM->fields as $k => $v) {
|
||||
if ($v->type == 'grid') {
|
||||
if (! in_array( $k, $aFieldsNames )) {
|
||||
$aFields[] = array ('sName' => $k,'sXmlForm' => str_replace( $sProcessUID . '/', '', $v->xmlGrid ));
|
||||
$aFieldsNames[] = $k;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$oDataset->next();
|
||||
}
|
||||
return $aFields;
|
||||
}
|
||||
/**
|
||||
* Function getVarsGrid returns all variables of Grid
|
||||
*
|
||||
* @access public
|
||||
* @param string proUid process ID
|
||||
* @param string dynUid dynaform ID
|
||||
* @return array
|
||||
*/
|
||||
|
||||
function getVarsGrid ($proUid, $dynUid)
|
||||
{
|
||||
$dynaformFields = array ();
|
||||
|
||||
if (is_file( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/'. $proUid .'/'.$dynUid. '.xml' ) && filesize( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/'. $proUid .'/'. $dynUid .'.xml' ) > 0) {
|
||||
$dyn = new DynaformHandler( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/' .$proUid. '/' . $dynUid .'.xml' );
|
||||
$dynaformFields[] = $dyn->getFields();
|
||||
}
|
||||
|
||||
$dynaformFieldTypes = array ();
|
||||
|
||||
foreach ($dynaformFields as $aDynFormFields) {
|
||||
foreach ($aDynFormFields as $field) {
|
||||
|
||||
if ($field->getAttribute( 'validate' ) == 'Int') {
|
||||
$dynaformFieldTypes[$field->nodeName] = 'Int';
|
||||
} elseif ($field->getAttribute( 'validate' ) == 'Real') {
|
||||
$dynaformFieldTypes[$field->nodeName] = 'Real';
|
||||
} else {
|
||||
$dynaformFieldTypes[$field->nodeName] = $field->getAttribute( 'type' );
|
||||
}
|
||||
}
|
||||
}
|
||||
return $dynaformFieldTypes;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Class XmlForm_Field_CheckBoxTable
|
||||
*/
|
||||
class XmlForm_Field_CheckBoxTable extends XmlForm_Field_Checkbox
|
||||
{
|
||||
|
||||
/**
|
||||
* Function render
|
||||
*
|
||||
* @author The Answer
|
||||
* @access public
|
||||
* @param eter string value
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
public function render ($value = null, $owner = null)
|
||||
{
|
||||
//$optionName = $owner->values['USR_UID'];
|
||||
$optionName = $value;
|
||||
$onclick = (($this->onclick) ? ' onclick="' . G::replaceDataField( $this->onclick, $owner->values ) . '" ' : '');
|
||||
$html = '<input class="FormCheck" id="form[' . $this->name . '][' . $optionName . ']" name="form[' . $this->name . '][' . $optionName . ']" type=\'checkbox\' value="' . $value . '"' . $onclick . '> <span class="FormCheck"></span></input>';
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,10 @@ require_once ('Base.php');
|
||||
/**
|
||||
* Application Solr Queue
|
||||
*/
|
||||
class Entity_AppSolrQueue extends Entity_Base
|
||||
|
||||
/**
|
||||
* Application Solr Queue
|
||||
*/class Entity_AppSolrQueue extends Entity_Base
|
||||
{
|
||||
public $appUid = '';
|
||||
public $appChangeDate = '';
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user