diff --git a/gulliver/system/class.bootstrap.php b/gulliver/system/class.bootstrap.php index 58066d358..58dd0fa08 100644 --- a/gulliver/system/class.bootstrap.php +++ b/gulliver/system/class.bootstrap.php @@ -199,7 +199,6 @@ class Bootstrap //self::registerClass("GroupUser", PATH_CLASSES . "class.groupUser.php"); -> this have conflicts with model/GroupUser.php self::registerClass("Groups", PATH_CLASSES . "class.groups.php"); self::registerClass("JavaBridgePM", PATH_CLASSES . "class.javaBridgePM.php"); - self::registerClass("Jrml", PATH_CLASSES . "class.jrml.php"); self::registerClass("PMmemcached", PATH_CLASSES . "class.memcached.php"); self::registerClass("multipleFilesBackup", PATH_CLASSES . "class.multipleFilesBackup.php"); self::registerClass("NET", PATH_CLASSES . "class.net.php"); diff --git a/tests/automated/workflow/engine/classes/classJrmlTest.php b/tests/automated/workflow/engine/classes/classJrmlTest.php deleted file mode 100644 index 8eaae8da7..000000000 --- a/tests/automated/workflow/engine/classes/classJrmlTest.php +++ /dev/null @@ -1,139 +0,0 @@ -'', 'type'=> array()); - $this->object = new Jrml($array); - } - - /** - * Tears down the fixture, for example, closes a network connection. - * This method is called after a test is executed. - */ - protected function tearDown() - { - } - - /** - * This is the default method to test, if the class still having - * the same number of methods. - */ - public function testNumberOfMethodsInThisClass() - { - $methods = get_class_methods('Jrml'); - $this->assertTrue( count($methods) == 7); - } - - /** - * @covers Jrml::__construct - * @todo Implement test__construct(). - */ - public function test__construct() - { - $methods = get_class_methods($this->object); - $this->assertTrue( in_array('__construct', $methods ), 'exists method __construct' ); - $r = new ReflectionMethod('Jrml', '__construct'); - $params = $r->getParameters(); - $this->assertTrue( $params[0]->getName() == 'data'); - $this->assertTrue( $params[0]->isArray() == false); - $this->assertTrue( $params[0]->isOptional () == true); - $this->assertTrue( $params[0]->getDefaultValue() == array()); - } - - /** - * @covers Jrml::get_md - * @todo Implement testget_md(). - */ - public function testget_md() - { - $methods = get_class_methods($this->object); - $this->assertTrue( in_array('get_md', $methods ), 'exists method get_md' ); - $r = new ReflectionMethod('Jrml', 'get_md'); - $params = $r->getParameters(); - } - - /** - * @covers Jrml::get_header - * @todo Implement testget_header(). - */ - public function testget_header() - { - $methods = get_class_methods($this->object); - $this->assertTrue( in_array('get_header', $methods ), 'exists method get_header' ); - $r = new ReflectionMethod('Jrml', 'get_header'); - $params = $r->getParameters(); - } - - /** - * @covers Jrml::get_column_header - * @todo Implement testget_column_header(). - */ - public function testget_column_header() - { - $methods = get_class_methods($this->object); - $this->assertTrue( in_array('get_column_header', $methods ), 'exists method get_column_header' ); - $r = new ReflectionMethod('Jrml', 'get_column_header'); - $params = $r->getParameters(); - } - - /** - * @covers Jrml::get_detail - * @todo Implement testget_detail(). - */ - public function testget_detail() - { - $methods = get_class_methods($this->object); - $this->assertTrue( in_array('get_detail', $methods ), 'exists method get_detail' ); - $r = new ReflectionMethod('Jrml', 'get_detail'); - $params = $r->getParameters(); - } - - /** - * @covers Jrml::get_footer - * @todo Implement testget_footer(). - */ - public function testget_footer() - { - $methods = get_class_methods($this->object); - $this->assertTrue( in_array('get_footer', $methods ), 'exists method get_footer' ); - $r = new ReflectionMethod('Jrml', 'get_footer'); - $params = $r->getParameters(); - } - - /** - * @covers Jrml::export - * @todo Implement testexport(). - */ - public function testexport() - { - $methods = get_class_methods($this->object); - $this->assertTrue( in_array('export', $methods ), 'exists method export' ); - $r = new ReflectionMethod('Jrml', 'export'); - $params = $r->getParameters(); - } -} - diff --git a/workflow/engine/classes/class.jrml.php b/workflow/engine/classes/class.jrml.php deleted file mode 100755 index 813ec7e08..000000000 --- a/workflow/engine/classes/class.jrml.php +++ /dev/null @@ -1,228 +0,0 @@ -. - * - * For more information, contact Colosa Inc, 2566 Le Jeune Rd., - * Coral Gables, FL, 33134, USA, or email info@colosa.com. - * - */ - -/** - * Jrml - Jrml class - * - * @package workflow.engine.ProcessMaker - * @author Maborak - * @copyright 2008 COLOSA - */ - -class Jrml -{ - public $rows; - public $sql; - private $data; - - /** - * This function is the constructor of the class Jrml - * - * @param array $data - * @return void - */ - function __construct ($data = array()) - { - $this->data = $data; - $this->sql = $data['sql']; - $this->rows = $this->get_rows( $data['type'] ); - $this->md = $this->get_md(); - } - - /** - * This function is for get rows - * - * @param array $a - * @return array - */ - private function get_rows ($a) - { - $b = array (); - foreach ($a as $key => $value) { - $b[] = $key; - } - return $b; - } - - public function get_md () - { - } - - /** - * This function is for get the header - * - * @return string - */ - public function get_header () - { - $xml = "sql}]]>"; - foreach ($this->data['type'] as $key => $value) { - $xml .= ""; - } - $xml .= ""; - $xml .= ' - - <band height="58"> - <line> - <reportElement x="0" y="8" width="555" height="1"/> - </line> - <line> - <reportElement positionType="FixRelativeToBottom" x="0" y="51" width="555" height="1"/> - </line> - <staticText> - <reportElement x="65" y="13" width="424" height="35"/> - <textElement textAlignment="Center"> - <font size="26" isBold="true"/> - </textElement> - <text><![CDATA[' . $this->data['title'] . ']]></text> - </staticText> - </band> - - - - '; - return $xml; - } - - /** - * This function is for get a column of the header - * - * @return string - */ - public function get_column_header () - { - $xml = ""; - $w = (int) ($this->data['columnWidth'] / sizeof( $this->rows )); - $i = 0; - foreach ($this->data['type'] as $key => $value) { - $xml .= " - - - - - "; - $i = $i + $w; - } - $xml .= " "; - return $xml; - } - - /** - * This function is for get the detail - * - * @return string - */ - public function get_detail () - { - $xml = ''; - $w = (int) ($this->data['columnWidth'] / sizeof( $this->rows )); - $i = 0; - foreach ($this->data['type'] as $key => $value) { - $xml .= ""; - $i = $i + $w; - } - $xml .= ''; - return $xml; - } - - /** - * This function is for get the footer - * - * @return string - */ - public function get_footer () - { - $xml = ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - '; - return $xml; - } - - /** - * This function is for export - * - * @return string - */ - public function export () - { - $xml = ' - '; - $xml .= $this->get_header(); - $xml .= $this->get_column_header(); - $xml .= $this->get_detail(); - $xml .= $this->get_footer(); - $xml .= ''; - return $xml; - } -} \ No newline at end of file diff --git a/workflow/engine/methods/setup/jasper.php b/workflow/engine/methods/setup/jasper.php deleted file mode 100755 index b4a94cbd0..000000000 --- a/workflow/engine/methods/setup/jasper.php +++ /dev/null @@ -1,136 +0,0 @@ -ws_list( "/" ); - -if (is_object( $response ) && get_class( $response ) == 'SOAP_Fault') { - $errorMessage = $response->getFault()->faultstring; -} else { - $folders = $oJasper->getResourceDescriptors( $response ); -} - -//$result = $oJasper->ws_put(); -krumo( $response ); - -//execute a report - - -$currentUri = "/reports/samples/Employees"; -$result = $oJasper->ws_get( $currentUri ); - -$folders = $oJasper->getResourceDescriptors( $result ); - -if (count( $folders ) != 1 || $folders[0]['type'] != 'reportUnit') { - echo "

Invalid RU ($currentUri)

"; - echo "
$result
"; - exit(); -} - -$reportUnit = $folders[0]; - -// 2. Prepare the parameters array looking in the $_GET for params -// starting with PARAM_ ... -// - - -$report_params = array (); - -$moveToPage = "jasper?uri=$currentUri"; - -foreach (array_keys( $_GET ) as $param_name) { - if (strncmp( "PARAM_", $param_name, 6 ) == 0) { - $report_params[substr( $param_name, 6 )] = $_GET[$param_name]; - } - - // if ($param_name != "page" && $param_name != "uri") { - // $moveToPage .= "&".urlencode($param_name)."=". urlencode($_GET[$param_name]); - // } -} - -$formatReport = RUN_OUTPUT_FORMAT_XML; -$formatReport = RUN_OUTPUT_FORMAT_CSV; -$formatReport = RUN_OUTPUT_FORMAT_RTF; -$formatReport = RUN_OUTPUT_FORMAT_PDF; -$formatReport = RUN_OUTPUT_FORMAT_HTML; -$moveToPage .= "&page="; - -// 3. Execute the report -$output_params = array (); -$output_params[RUN_OUTPUT_FORMAT] = $formatReport; - -if ($formatReport == RUN_OUTPUT_FORMAT_HTML) { - //$pageReport = isset ( $_GET['page'] ) ? $_GET['page'] : 1; - //$output_params[RUN_OUTPUT_PAGE] = $pageReport; - //$output_params[RUN_OUTPUT_IMAGES_URI] = '/sysos/'. SYS_LANG. '/classic'; -} - -$result = $oJasper->ws_runReport( $currentUri, $report_params, $output_params, $attachments ); - -// 4. -if (is_object( $result ) && get_class( $result ) == 'SOAP_Fault') { - $errorMessage = $result->getFault()->faultstring; - - echo $errorMessage; - exit(); -} - -$operationResult = $oJasper->getOperationResult( $result ); - -if ($operationResult['returnCode'] != '0') { - echo "Error executing the report:
" . $operationResult['returnMessage'] . ""; - exit(); -} - -if (is_array( $attachments )) { - //krumo ($attachments); - - - switch ($formatReport) { - case RUN_OUTPUT_FORMAT_PDF: - header( "Content-type: application/pdf" ); - echo ($attachments["cid:report"]); - break; - case RUN_OUTPUT_FORMAT_HTML: - // 1. Save attachments.... - // 2. Print the report.... - header( "Content-type: text/html" ); - foreach (array_keys( $attachments ) as $key) { - if ($key != "cid:report") { - $f = fopen( "images/" . substr( $key, 4 ), "w" ); - fwrite( $f, $attachments[$key] ); - fclose( $f ); - } - } - - echo "
"; - $prevpage = ($pageReport > 0) ? $pageReport - 1 : 0; - $nextpage = $pageReport + 1; - - echo "Prev page | Next page"; - echo "

"; - - echo $attachments["cid:report"]; - //print_r(array_keys($attachments)); - break; - case RUN_OUTPUT_FORMAT_CSV: - case RUN_OUTPUT_FORMAT_XLS: - header( 'Content-type: application/xls' ); - header( 'Content-Disposition: attachment; filename="report.xls"' ); - echo ($attachments["cid:report"]); - break; - case RUN_OUTPUT_FORMAT_RTF: - header( 'Content-type: text/rtf' ); - header( 'Content-Disposition: attachment; filename="report.rtf"' ); - echo ($attachments["cid:report"]); - break; - default: - //header ( 'Content-type: application/xls' ); - //header ( 'Content-Disposition: attachment; filename="report.xls"'); - echo ($attachments["cid:report"]); - break; - } - exit(); -} else - echo "No attachment found!"; - diff --git a/workflow/engine/test/unit/processmaker/classJrmlTest.php b/workflow/engine/test/unit/processmaker/classJrmlTest.php deleted file mode 100755 index 46daa8692..000000000 --- a/workflow/engine/test/unit/processmaker/classJrmlTest.php +++ /dev/null @@ -1,113 +0,0 @@ -getMethods() as $reflectmethod ) { - $params = ''; - foreach ( $reflectmethod->getParameters() as $key => $row ) { - if ( $params != '' ) $params .= ', '; - $params .= '$' . $row->name; - } - - $testItems++; - $methods[ $reflectmethod->getName() ] = $params; - } - - $t->diag('class $className' ); - $t->isa_ok( $obj , 'Jrml', 'class $className created'); - - $t->is( count($methods) , 8, "class $className have " . 8 . ' methods.' ); - - //checking method '__construct' - $t->can_ok( $obj, '__construct', '__construct() is callable' ); - - //$result = $obj->__construct ( $data); - //$t->isa_ok( $result, 'NULL', 'call to method __construct '); - $t->todo( "call to method __construct using $data "); - - - //checking method 'get_rows' - $t->can_ok( $obj, 'get_rows', 'get_rows() is callable' ); - - //$result = $obj->get_rows ( $a); - //$t->isa_ok( $result, 'NULL', 'call to method get_rows '); - $t->todo( "call to method get_rows using $a "); - - - //checking method 'get_md' - $t->can_ok( $obj, 'get_md', 'get_md() is callable' ); - - //$result = $obj->get_md ( ); - //$t->isa_ok( $result, 'NULL', 'call to method get_md '); - $t->todo( "call to method get_md using "); - - - //checking method 'get_header' - $t->can_ok( $obj, 'get_header', 'get_header() is callable' ); - - //$result = $obj->get_header ( ); - //$t->isa_ok( $result, 'NULL', 'call to method get_header '); - $t->todo( "call to method get_header using "); - - - //checking method 'get_column_header' - $t->can_ok( $obj, 'get_column_header', 'get_column_header() is callable' ); - - //$result = $obj->get_column_header ( ); - //$t->isa_ok( $result, 'NULL', 'call to method get_column_header '); - $t->todo( "call to method get_column_header using "); - - - //checking method 'get_detail' - $t->can_ok( $obj, 'get_detail', 'get_detail() is callable' ); - - //$result = $obj->get_detail ( ); - //$t->isa_ok( $result, 'NULL', 'call to method get_detail '); - $t->todo( "call to method get_detail using "); - - - //checking method 'get_footer' - $t->can_ok( $obj, 'get_footer', 'get_footer() is callable' ); - - //$result = $obj->get_footer ( ); - //$t->isa_ok( $result, 'NULL', 'call to method get_footer '); - $t->todo( "call to method get_footer using "); - - - //checking method 'export' - $t->can_ok( $obj, 'export', 'export() is callable' ); - - //$result = $obj->export ( ); - //$t->isa_ok( $result, 'NULL', 'call to method export '); - $t->todo( "call to method export using "); - - - - $t->todo ( 'review all pendings methods in this class');