Code clean up for committed files

This commit is contained in:
abraar
2010-12-24 13:20:15 +00:00
parent 19cb483bf0
commit bd60568f84
7 changed files with 158 additions and 408 deletions

View File

@@ -85,12 +85,9 @@ class dynaFormHandler
*/
function __cloneEmpty()
{
//$cloneObj = clone $this;
//$cloneObj->xmlfile = '__Clone__' . $cloneObj->xmlfile;
$xPath = new DOMXPath($this->dom);
$nodeList = $xPath->query('/dynaForm/*');
foreach ($nodeList as $domElement){
//echo $domElement->nodeName.'<br>';
$elements[] = $domElement->nodeName;
}
$this->remove($elements);
@@ -134,14 +131,6 @@ class dynaFormHandler
return $newnode;
}
/*
$child_childs = Array(
Array(name=>'option', value=>'uno', 'attributes'=>Array('name'=>1)),
Array(name=>'option', value=>'dos', 'attributes'=>Array('name'=>2)),
Array(name=>'option', value=>'tres', 'attributes'=>Array('name'=>3)),
)
*/
/**
* Add Function
* @param string $name
@@ -233,7 +222,6 @@ class dynaFormHandler
$this->xmlfile = $fname;
$this->dom->save($this->xmlfile);
}
//$this->fixXmlFile();
}
/**
@@ -501,14 +489,6 @@ class dynaFormHandler
$xnode = $this->dom->createElement($childNode->nodeName);
$xnode->appendChild($this->dom->createCDATASection($child_text));
/*if( $childNode->hasChildNodes() ) {
foreach ($childNode->childNodes as $domElement){
$domNode = $domElement->cloneNode(true);
if( $domNode->nodeType != 4 ) {
$xnode->appendChild($domNode);
}
}
}*/
$element->replaceChild($xnode, $childNode);
$childNode = $element->getElementsByTagName($child_name)->item(0);
}
@@ -521,7 +501,6 @@ class dynaFormHandler
foreach($cc['attributes'] as $cc_att_name => $cc_att_value) {
$ccnode->setAttribute($cc_att_name, $cc_att_value);
}
//$this->addOrUpdateChild($childNode, $cc['name'], $cc['value'], $cc['attributes']);
}
}
}
@@ -534,9 +513,6 @@ class dynaFormHandler
function addOrUpdateChild($xnode, $childName, $childValue, $childAttributes){
//$element = $this->root->getElementsByTagName($nodeName)->item(0);
//$childNode = $element->getElementsByTagName($childName)->item(0);
$newNode = $this->dom->createElement($childName);
$newNode->appendChild($this->dom->createCDATASection($childValue));
@@ -588,28 +564,3 @@ class dynaFormHandler
return $array;
}
}
//examples...........
//$o = new dynaFormHandler('xxx.xml');
//attributes (String node-name, Array attributes(atribute-name =>attribute-value, ..., ...), Array childs(child-name=>child-content), Array Child-childs())
/*$child_childs = Array(
Array('name'=>'option', 'value'=>'uno2', 'attributes'=>Array('name'=>1112)),
Array('name'=>'option', 'value'=>'dos', 'attributes'=>Array('name'=>222)),
Array('name'=>'option', 'value'=>'tres', 'attributes'=>Array('name'=>333)),
);*/
//$o->add('erik', Array('att1'=>1, 'att2'=>'dos'), Array('en'=>'hello'), $child_childs);
//$o->addChilds('neyek', Array('en'=>'deutch'), $child_childs);
//print_r($o->getFieldNames());
/* for($i=1; $i<=5; $i++){
$o->add('lastnamex'.$i, Array('type'=>'text', 'defaultvalue'=>'Ortiz'), Array('es'=>'Apellido'));
}*/
/*
$child_childs = Array(
Array('name'=>'option', 'value'=>'uno', 'attributes'=>Array('name'=>111)),
Array('name'=>'option', 'value'=>'tres', 'attributes'=>Array('name'=>333)),
);
$o->replace('antiguedad', 'antiguedad_replaced', Array('type'=>'dropdown', 'required'=>'0'), Array('es'=>'Antiguedad !!'), $child_childs);
*/
//$o->remove('usr_email');
//$o->replace('usr_uid', 'usr_uid222', Array('type'=>'text', 'defaultvalue'=>'111'), Array('es'=>'fucking id'));

View File

@@ -372,130 +372,130 @@ class pagedTable
* @parameter string table
* @return string
*/
function setupFromTable($table)
{
// var_dump2($table);
//Config
$this->rowsPerPage=25;
if (isset($_GET['page']))
$this->currentPage = $_GET['page'];
else
$this->currentPage = 1;
if (isset($_GET['order']))
$this->orderBy = urldecode($_GET['order']);
else
$this->orderBy = "";
if (isset($_GET['filter']))
$this->filter = urldecode($_GET['filter']);
else
$this->filter = "";
$xmlPopup='';
$this->xmlFormFile="";
/* if ($table->Action)
$this->ajaxServer=G::encryptLink($table->Action);
else*/
$this->ajaxServer=G::encryptLink('../gulliver/pagedTableAjax');
$this->popupPage = $this->ajaxServer . '?function=printForm&filename=' . urlencode($xmlPopup);
$this->ownerPage=G::encryptLink(SYS_CURRENT_URI);
$this->sqlConnection='';
if (isset($table->_source))
$this->sqlSelect=$table->_source;
if (isset($table->WhereClause)){
if (strpos(strtoupper($table->WhereClause),'GROUP BY')!==FALSE)
preg_match("/(.+)(GROUP BY)(.*)/",$table->WhereClause,$matches);
else{
$matches[1]=$table->WhereClause;$matches[2]='';
}
$this->sqlWhere=$matches[1];
if (strcasecmp($matches[2],'GROUP BY')==0)
$this->sqlGroupBy=' GROUP BY '.$matches[3];
}
if (strpos(strtoupper($this->sqlSelect),'WHERE')!==FALSE){
preg_match("/SELECT(.+)FROM(.+)WHERE(.+)/",$this->sqlSelect,$matches);
$this->sqlSelect='SELECT '.$matches[1].' FROM '.$matches[2];
$this->sqlWhere=$matches[3];
}
// DBConnection
// $this->prepareQuery();
//Prepare the fields
if ($table->show_nummbers=='YES'){
$r=-1;
$this->fields[$r]['Name']='numberlabel';
$this->fields[$r]['Type']='numberlabel';
$this->fields[$r]['Label']='#';
}
foreach ($table->Columns as $r => $value){
$this->fields[$r]['Name']=$value['Name'];
$this->fields[$r]['Type']=$value['Type'];
$this->fields[$r]['Label']=((isset($table->Labels[$r]))?$table->Labels[$r]:'');
//Default values for Label if it was empty
if ($this->fields[$r]['Label']=='')
switch($table->Columns[$r]['Type']){
case 'image':
case 'image-text':
case 'jslink':
//var_dump2($table->Columns[$r]);
$this->fields[$r]['Label']=$value['Name'];
}
//Print the type of the field
//$this->fields[$r]['Label'].='('.$this->fields[$r]['Type'].')';
$r++;
}
//Add a delete column if sqlDelete is established
/* if ($this->sqlDelete!='')
{
$this->fields[$r]['Name']='';
$this->fields[$r]['Type']='linknew';
$this->fields[$r]['Label']=G::LoadXml('labels','ID_DELETE');
}*/
//Set the default settings
$this->defaultStyle();
/* if ($this->sqlDelete!='')
{
$this->style[$r]['href']="#";
$this->style[$r]['onclick']="document.getElementById('pagedTable').outerHTML=ajax_function('{$this->ajaxServer}','delete','".$this->fieldDataList."');";
}*/
//Prepare the columns's properties
if ($table->show_nummbers=='YES'){
$r=-1;
$this->style[$r]['data']='@@_row__';
$this->style[$r]['colWidth']=30;
}
$this->gridWidth='';
$this->gridFields='';
foreach ($table->Columns as $r => $value){
//var_dump($value['Width']);
$this->style[$r]['colWidth']=$value['Width'];
$this->style[$r]['titleAlign']=$value['Align'];
$this->style[$r]['href']=$value['Target'];
// Add the row reference
switch ($this->fields[$r]['Type']){
case 'image-text':
case 'textimage':
case 'image':
case 'link':
//$this->style[$r]['href'].='/@@_row__.html'; // No
if (substr($value['Content'],0,1)=='&')
$this->style[$r]['href'].='/@@_'.substr($value['Content'],1).'.html';
}
// Extra events for each field
$this->style[$r]['event']=$value['Extra'];
if ($this->fields[$r]['Label']==''){
$this->style[$r]['titleVisibility']='0';
$this->fields[$r]['Label']=$this->fields[$r]['Name'];
}
//if ($value['orderByThis']===true) $this->orderBy=$value['Name'];
//Needed for javascript
//only the visible columns's width and name are stored
if ($this->style[$r]['showInTable']!='0'){
$this->gridWidth.=','.$this->style[$r]['colWidth'];
$this->gridFields.=',"form['.$this->fields[$r]['Name'].']"';
}
$r++;
}
echo('<br>');
// var_dump2($this);
}
// function setupFromTable($table)
// {
//// var_dump2($table);
// //Config
// $this->rowsPerPage=25;
// if (isset($_GET['page']))
// $this->currentPage = $_GET['page'];
// else
// $this->currentPage = 1;
// if (isset($_GET['order']))
// $this->orderBy = urldecode($_GET['order']);
// else
// $this->orderBy = "";
// if (isset($_GET['filter']))
// $this->filter = urldecode($_GET['filter']);
// else
// $this->filter = "";
// $xmlPopup='';
// $this->xmlFormFile="";
///* if ($table->Action)
// $this->ajaxServer=G::encryptLink($table->Action);
// else*/
// $this->ajaxServer=G::encryptLink('../gulliver/pagedTableAjax');
// $this->popupPage = $this->ajaxServer . '?function=printForm&filename=' . urlencode($xmlPopup);
// $this->ownerPage=G::encryptLink(SYS_CURRENT_URI);
// $this->sqlConnection='';
// if (isset($table->_source))
// $this->sqlSelect=$table->_source;
// if (isset($table->WhereClause)){
// if (strpos(strtoupper($table->WhereClause),'GROUP BY')!==FALSE)
// preg_match("/(.+)(GROUP BY)(.*)/",$table->WhereClause,$matches);
// else{
// $matches[1]=$table->WhereClause;$matches[2]='';
// }
// $this->sqlWhere=$matches[1];
// if (strcasecmp($matches[2],'GROUP BY')==0)
// $this->sqlGroupBy=' GROUP BY '.$matches[3];
// }
// if (strpos(strtoupper($this->sqlSelect),'WHERE')!==FALSE){
// preg_match("/SELECT(.+)FROM(.+)WHERE(.+)/",$this->sqlSelect,$matches);
// $this->sqlSelect='SELECT '.$matches[1].' FROM '.$matches[2];
// $this->sqlWhere=$matches[3];
// }
// // DBConnection
// // $this->prepareQuery();
// //Prepare the fields
// if ($table->show_nummbers=='YES'){
// $r=-1;
// $this->fields[$r]['Name']='numberlabel';
// $this->fields[$r]['Type']='numberlabel';
// $this->fields[$r]['Label']='#';
// }
// foreach ($table->Columns as $r => $value){
// $this->fields[$r]['Name']=$value['Name'];
// $this->fields[$r]['Type']=$value['Type'];
// $this->fields[$r]['Label']=((isset($table->Labels[$r]))?$table->Labels[$r]:'');
// //Default values for Label if it was empty
// if ($this->fields[$r]['Label']=='')
// switch($table->Columns[$r]['Type']){
// case 'image':
// case 'image-text':
// case 'jslink':
// //var_dump2($table->Columns[$r]);
// $this->fields[$r]['Label']=$value['Name'];
// }
// //Print the type of the field
// //$this->fields[$r]['Label'].='('.$this->fields[$r]['Type'].')';
// $r++;
// }
// //Add a delete column if sqlDelete is established
// /* if ($this->sqlDelete!='')
// {
// $this->fields[$r]['Name']='';
// $this->fields[$r]['Type']='linknew';
// $this->fields[$r]['Label']=G::LoadXml('labels','ID_DELETE');
// }*/
// //Set the default settings
// $this->defaultStyle();
// /* if ($this->sqlDelete!='')
// {
// $this->style[$r]['href']="#";
// $this->style[$r]['onclick']="document.getElementById('pagedTable').outerHTML=ajax_function('{$this->ajaxServer}','delete','".$this->fieldDataList."');";
// }*/
// //Prepare the columns's properties
// if ($table->show_nummbers=='YES'){
// $r=-1;
// $this->style[$r]['data']='@@_row__';
// $this->style[$r]['colWidth']=30;
// }
// $this->gridWidth='';
// $this->gridFields='';
// foreach ($table->Columns as $r => $value){
// //var_dump($value['Width']);
// $this->style[$r]['colWidth']=$value['Width'];
// $this->style[$r]['titleAlign']=$value['Align'];
// $this->style[$r]['href']=$value['Target'];
// // Add the row reference
// switch ($this->fields[$r]['Type']){
// case 'image-text':
// case 'textimage':
// case 'image':
// case 'link':
// //$this->style[$r]['href'].='/@@_row__.html'; // No
// if (substr($value['Content'],0,1)=='&')
// $this->style[$r]['href'].='/@@_'.substr($value['Content'],1).'.html';
// }
// // Extra events for each field
// $this->style[$r]['event']=$value['Extra'];
// if ($this->fields[$r]['Label']==''){
// $this->style[$r]['titleVisibility']='0';
// $this->fields[$r]['Label']=$this->fields[$r]['Name'];
// }
// //if ($value['orderByThis']===true) $this->orderBy=$value['Name'];
// //Needed for javascript
// //only the visible columns's width and name are stored
// if ($this->style[$r]['showInTable']!='0'){
// $this->gridWidth.=','.$this->style[$r]['colWidth'];
// $this->gridFields.=',"form['.$this->fields[$r]['Name'].']"';
// }
// $r++;
// }
// echo('<br>');
//// var_dump2($this);
// }
/**
* Function count

View File

@@ -498,9 +498,9 @@ class RBAC
* @param string $sCode
* @return void
*/
function loadPermissionByCode($sCode) {
return $this->permissionsObj->loadByCode($sCode);
}
// function loadPermissionByCode($sCode) {
// return $this->permissionsObj->loadByCode($sCode);
// }
/**
* create permission
@@ -524,9 +524,9 @@ class RBAC
* @param string $sCode
* @return void
*/
function loadRoleByCode($sCode) {
return $this->rolesObj->loadByCode($sCode);
}
// function loadRoleByCode($sCode) {
// return $this->rolesObj->loadByCode($sCode);
// }
/**
* list all roles

View File

@@ -541,27 +541,13 @@ class Table
$res = "<th class=\"$strClass\" align=\"left\" height=\"25\"";
if ( $col["Width"] > 0) $res .= " width=\"" . $col["Width"] . "\"";
$res .= ">";
/*if($HTTP_SESSION_VARS['OrderBy'] == $this->Columns[$intPos]['Name'] ){
if($HTTP_SESSION_VARS['OrderDir'] == 'DESC')
$res .= "<img src='/images/arrow_order_desc.gif' border=0><br>";
}*/
//$res .= "<a class=\"" . $strClass . "Link\" href=\"";
$res .= "<a class=\"" . $strClass . "\" href=\"";
$res .= (ENABLE_ENCRYPT=='yes'?str_replace(G::encrypt('sys' . SYS_SYS, URL_KEY), SYS_SYS, G::encryptUrl(urldecode(SYS_CURRENT_URI), URL_KEY)):SYS_CURRENT_URI) . "?order=" . $this->Columns[$intPos]['Name']."&page=".$pa."&label=true";
//$res .= $_SERVER['REDIRECT_URL'] . "?order=" . $this->Columns[$intPos]['Name']."&page=".$pa."&label=true";
$res .= "\">" . $this->Labels[$intPos] . "</a>";
/*if($HTTP_SESSION_VARS['OrderBy'] == $this->Columns[$intPos]['Name'] ){
if($HTTP_SESSION_VARS['OrderDir'] == 'ASC')
$res .= "<br><img src='/images/arrow_order_asc.gif' border=0>";
}*/
/*
if($HTTP_SESSION_VARS['OrderBy'] == $this->Columns[$intPos]['Name'] ){
$img_dir = 'asc';
if($HTTP_SESSION_VARS['OrderDir'] == 'DESC')
$img_dir = 'desc';
$res .= "<br><img src='/images/arrow_order_$img_dir.gif' border=0>";
}
*/
$res .= "</th>\n";//echo $res;die;
}
else {
@@ -593,12 +579,7 @@ class Table
$res = "<th class=\"$strClass\" align=\"left\" height=\"25\"";
if ( $col["Width"] > 0) $res .= " width=\"" . $col["Width"] . "\"";
$res .= ">";
/*
if($HTTP_SESSION_VARS['OrderBy'] == $this->Columns[$intPos]['Name'] ){
if($HTTP_SESSION_VARS['OrderDir'] == 'DESC')
$res .= "<img src='/images/arrow_order_desc.gif' border=0><br>";
}
*/
//$res .= "<a class=\"" . $strClass . "Link\" href=\"";
$res .= "<a class=\"" . $strClass . "\" href=\"";
$_temp_var=$this->Columns[$intPos]['Name'];
@@ -611,18 +592,7 @@ class Table
else
$res .= "&nbsp;<img src='/images/arrow_order_asc.gif' border=0>";
}
/*if($HTTP_SESSION_VARS['OrderBy'] == $this->Columns[$intPos]['Name'] ){
if($HTTP_SESSION_VARS['OrderDir'] == 'ASC')
$res .= "<br><img src='/images/arrow_order_asc.gif' border=0>";
}*/
/*
if($HTTP_SESSION_VARS['OrderBy'] == $this->Columns[$intPos]['Name'] ){
$img_dir = 'asc';
if($HTTP_SESSION_VARS['OrderDir'] == 'DESC')
$img_dir = 'desc';
$res .= "<br><img src='/images/arrow_order_$img_dir.gif' border=0>";
}
*/
$res .= "</th>\n";//echo $res;die;
}
else {
@@ -670,28 +640,14 @@ class Table
$res .= "<th class=\"$strClass\" align=\"left\" height=\"25\"";
if ( $col["Width"] > 0) $res .= " width=\"" . $col["Width"] . "\"";
$res .= ">&nbsp;";
/*if($HTTP_SESSION_VARS['OrderBy'] == $this->Columns[$intPos]['Name'] ){
if($HTTP_SESSION_VARS['OrderDir'] == 'DESC')
$res .= "<img src='/images/arrow_order_desc.gif' border=0><br>";
}*/
$res .= "<a class=\"" . $strClass . "\" href=\"";
if ($fil != '') $fil .= '&';
$direccion = $target."?".$fil."order=" . $this->Columns[$intPos]['Name']."&page=".$pa."&label=true";
$res .= "javascript:bsearch('$direccion')";
//$res .= $target . "?".$fil."order=" . $this->Columns[$intPos]['Name']."&page=".$pa."&label=true";
$res .= "\">" . $this->Labels[$intPos] . "</a>";
/*if($HTTP_SESSION_VARS['OrderBy'] == $this->Columns[$intPos]['Name'] ){
if($HTTP_SESSION_VARS['OrderDir'] == 'ASC')
$res .= "<br><img src='/images/arrow_order_asc.gif' border=0>";
}*/
/*
if($HTTP_SESSION_VARS['OrderBy'] == $this->Columns[$intPos]['Name'] ){
$img_dir = 'asc';
if($HTTP_SESSION_VARS['OrderDir'] == 'DESC')
$img_dir = 'desc';
$res .= "<br><img src='/images/arrow_order_$img_dir.gif' border=0>";
}
*/
$res .= "</th>\n";
}
else {
@@ -737,7 +693,6 @@ class Table
break;
default:
$fieldname = $col['Name'];
//$val = utf8_encode($this->_row_values[$fieldname]);
$val = isset ( $this->_row_values[$fieldname] ) ? $this->_row_values[$fieldname] : '' ;
}
@@ -825,27 +780,6 @@ class Table
case 'LITERAL' :$res .= formatDate('$M $d $Y',$val);
break;
}
/*
if ($G_DATE_FORMAT == 'DD/MM/AAAA') {
$dateFormat = $aux[2] . "/" . $aux[1] . "/" . $aux[0];
$res .= htmlentities( $dateFormat ) . ' ' . $part[1] . ($G_DATE_FORMAT == 'MM/DD/AAAA' ? ' ' : '',ENT_QUOTES,'utf-8');
}
if ($G_DATE_FORMAT == 'MM/DD/AAAA') {
$dateFormat = $aux[1] . "-" . $aux[2] . "-" . $aux[0];
$res .= htmlentities( $dateFormat ,ENT_QUOTES,'utf-8') . ' ' . $part[1] . ($G_DATE_FORMAT == 'MM/DD/AAAA' ? ' <small>EST</small>' : '');
}
if ($G_DATE_FORMAT == 'AAAA/MM/DD') {
$dateFormat = $aux[0] . "-" . $aux[1] . "-" . $aux[2];
$res .= htmlentities( $dateFormat ,ENT_QUOTES,'utf-8') . ' ' . $part[1] . ($G_DATE_FORMAT == 'MM/DD/AAAA' ? ' ' : '');
}
if ($G_TABLE_DATE_FORMAT == 'LITERAL') {
// mejorar esto porque solo funciona hasta el 2038
$dateFormat = date ( 'M d, Y', mktime (0,0,0, $aux[1], $aux[2], $aux[0]) );
}
/**/
}
else
@@ -907,7 +841,7 @@ class Table
break;
case "image":
//print_r ($this->_row_values);
if (is_array($col["Condition"])) //By JHL to enable Condition to display a image -- New parameter Condition in Addrawcolumn
{
$field_compare=$col["Condition"]['field'];
@@ -935,7 +869,7 @@ class Table
// Hay mas de un valor para el link
$values = $col['Content'];
$n = count($values);
//$res .= "<a class='$strClassLink' $title href=\"" . $col["Target"] . "/" ;
$res .= "<a class='$txtin3' $title href=\"" . (ENABLE_ENCRYPT=='yes'?G::encryptUrl(urldecode($col["Target"]), URL_KEY):$col["Target"]) . "/" ;
for ($i=0; $i < $n; $i++) {
@@ -968,7 +902,6 @@ class Table
$values = $col['Content'];
$n = count($values);
//$res .= "<a class='$strClassLink' $title href=\"" . $col["Target"] . "/" ;
$res .= "<a class='$strClassLink' $title href=\"" . (ENABLE_ENCRYPT=='yes'?G::encryptUrl(urldecode($col["Target"]), URL_KEY):$col["Target"]) . "/" ;
for ($i=0; $i < $n; $i++) {
@@ -1242,8 +1175,7 @@ class Table
if (is_array($this->contexto)) {
$this->contexto[0][] = $contexto;
$this->contexto[1][] = $nombre;
// array_push($this->contexto[0], $contexto);
// array_push($this->contexto[1], $nombre);
} else {
$this->contexto = array();
$this->contexto[0][] = $contexto;
@@ -1321,7 +1253,6 @@ class Table
While ($i<=$len and $i <= $number){
$car=substr($value,$i,1);
$br = strtoupper(substr($value,$i,4));
//print "<br>".$car." ".$i;
if ($car == '<'){
$Flag = 0;
}

View File

@@ -384,7 +384,6 @@ class TemplatePowerParser
}
}
/**
* class TemplatePower
*
@@ -421,7 +420,6 @@ class TemplatePower extends TemplatePowerParser
* @param string $stpl_file
* @param string $tplvar
* @return void
*
* @access private
*/
function __deSerializeTPL( $stpl_file, $type )
@@ -443,7 +441,6 @@ class TemplatePower extends TemplatePowerParser
* TemplatePower::__makeContentRoot()
*
* @return void
*
* @access private
*/
function __makeContentRoot()
@@ -482,7 +479,6 @@ class TemplatePower extends TemplatePowerParser
* @param string $varname
* @param string $value
* @return void
*
* @access private
*/
function __assignGlobal( $varname, $value )
@@ -496,7 +492,6 @@ class TemplatePower extends TemplatePowerParser
*
* @param string $blockname
* @return void
*
* @access private
*/
function __outputContent( $blockname )
@@ -555,7 +550,6 @@ class TemplatePower extends TemplatePowerParser
* function __printVars
*
* @return void
*
* @access public
*/
function __printVars()
@@ -588,7 +582,6 @@ class TemplatePower extends TemplatePowerParser
*
* @param $state
* @return void
*
* @access public
*/
function showUnAssigned( $state = true )
@@ -600,7 +593,6 @@ class TemplatePower extends TemplatePowerParser
* TemplatePower::prepare()
*
* @return void
*
* @access public
*/
function prepare()
@@ -618,7 +610,6 @@ class TemplatePower extends TemplatePowerParser
*
* @param string $blockname
* @return void
*
* @access public
*/
function newBlock( $blockname )
@@ -666,7 +657,6 @@ class TemplatePower extends TemplatePowerParser
}
}
/**
* TemplatePower::assign()
*
@@ -733,7 +723,6 @@ class TemplatePower extends TemplatePowerParser
* TemplatePower::printToScreen()
*
* @return void
*
* @access public
*/
function printToScreen()
@@ -750,7 +739,6 @@ class TemplatePower extends TemplatePowerParser
* TemplatePower::getOutputContent()
*
* @return void
*
* @access public
*/
function getOutputContent()

View File

@@ -167,13 +167,7 @@ class Installer
if($test['created']===true)
{
$local = Array('localhost','127.0.0.1');
// $this->wf_site_name = $wf = "wf_".$this->options['name'];
$this->wf_site_name = $wf = $this->options['advanced']['ao_db_wf'];
// $this->rbac_site_name = $rb = "rbac_".$this->options['name'];
$this->rbac_site_name = $rb = $this->options['advanced']['ao_db_rb'];
$this->report_site_name = $rp = $this->options['advanced']['ao_db_rp'];
@@ -241,21 +235,6 @@ class Installer
$qwv = $this->query_sql_file(PATH_WORKFLOW_MSSQL_DATA.$values,$this->connection_database);
$this->log($qwv);
/*
// No funciona correctamente en 2000
$bulk_country = "BULK INSERT ISO_COUNTRY FROM '" . PATH_WORKFLOW_MSSQL_DATA . "ISO_COUNTRY.txt' " .
" WITH ( FIELDTERMINATOR ='|', ROWTERMINATOR ='\n' ); ";
$bulk_location = " BULK INSERT ISO_LOCATION FROM '" . PATH_WORKFLOW_MSSQL_DATA . "ISO_LOCATION.txt' " .
" WITH ( FIELDTERMINATOR ='|', ROWTERMINATOR ='\n' ); ";
$bulk_subdivision = " BULK INSERT ISO_SUBDIVISION FROM '" . PATH_WORKFLOW_MSSQL_DATA . "ISO_SUBDIVISION.txt' " .
" WITH ( FIELDTERMINATOR ='|', ROWTERMINATOR ='\n' ); ";
$bulk = @mssql_query($bulk_country, $this->connection_database);
$bulk = @mssql_query($bulk_location, $this->connection_database);
$bulk = @mssql_query($bulk_subdivision, $this->connection_database);
*/
/* Dump schema rbac && data */
$pws = PATH_RBAC_MSSQL_DATA.$schema;
mssql_select_db($rb,$this->connection_database);
@@ -299,11 +278,6 @@ class Installer
fclose( $fp );
// Added reading and writing roles.
///-- $this->setRolesPrivileges($wf, (($this->cc_status==1)?$wf:$this->options['database']['username']), (($this->cc_status==1)?$this->options['password']:$this->options['database']['password']) );
///-- $this->setRolesPrivileges($rb, (($this->cc_status==1)?$rb:$this->options['database']['username']), (($this->cc_status==1)?$this->options['password']:$this->options['database']['password']) );
///-- $this->setRolesPrivileges($rp, (($this->cc_status==1)?$rp:$this->options['database']['username']), (($this->cc_status==1)?$this->options['password']:$this->options['database']['password']) );
$this->set_admin();
}
return $test;
@@ -335,33 +309,6 @@ class Installer
return true;
}
function setRolesPrivileges($psDB, $psUser, $psPassword )
{
mssql_select_db($psDB);
$sAddRoleDataReader = "sp_addrolemember 'db_datareader', '" . $psUser . "';";
$ac = @mssql_query($sAddRoleDataReader , $this->connection_database);
$this->log($sAddRoleDataReader.": => ".((!$ac)? "Failed to set read permissions" :"OK")."\n");
///-- mssql_select_db($psDB);
$sAddRoleDataWriter = "sp_addrolemember 'db_datawriter', '" . $psUser . "';";
$ac = @mssql_query($sAddRoleDataWriter , $this->connection_database);
$this->log($sAddRoleDataWriter .": => ".((!$ac)? "Failed to set write permissions" :"OK")."\n");
///-- mssql_select_db($psDB);
$sAddRoleDDLAdmin = "sp_addrolemember 'db_ddladmin', '" . $psUser . "';";
$ac = @mssql_query($sAddRoleDDLAdmin , $this->connection_database);
$this->log($sAddRoleDDLAdmin .": => ".((!$ac)? "Failed to set DLL permissions" :"OK")."\n");
///-- mssql_select_db($psDB);
$sAddRoleDDLAdmin = "sp_addrolemember 'db_owner', '" . $psUser . "';";
$ac = @mssql_query($sAddRoleDDLAdmin , $this->connection_database);
$this->log($sAddRoleDDLAdmin .": => ".((!$ac)? "Failed to set DLL permissions" :"OK")."\n");
return true;
}
/**
* set_admin
*
@@ -394,32 +341,6 @@ class Installer
'errors' => array(),
'querys' => 0
);
/** Deprecated
* new routines written for this process....
* evaluating its performance..... So, that why this deprecated code was not deleted yet..
* the problem with this code is the \n dependence,.. in insert.sql always not ending with \n
* <erik@colosa.com>
* ...........................................................
$content = @fread(@fopen($file,"rt"),@filesize($file));
if(!$content)
{
$report['errors']="Error reading SQL";
return $report;
}
$ret = array();
for ($i=0 ; $i < strlen($content)-1; $i++)
{
if ( $content[$i] == ";" )
{
if ( $content[$i+1] == "\n" )
{
$ret[] = substr($content, 0, $i);
$content = substr($content, $i + 1);
$i = 0;
}
}
}
*/
#<--
if( !is_file($file) ) {
@@ -442,7 +363,6 @@ class Installer
return $report;
}
/**
* check_path
*
@@ -557,16 +477,6 @@ class Installer
}
else {
/* var_dump($this->options['advanced']['ao_db_drop'],$this->cc_status,$this->check_db_empty($dbName));
if(($this->options['advanced']['ao_db_drop']===false && $this->cc_status!=1 && !$this->check_db_empty($dbName)) )
{
return Array('status'=>false,'message'=>'Database is not empty');
}
else
{
return Array('status'=>true,'message'=>'OK');
}*/
if($this->options['advanced']['ao_db_drop']===true || $this->check_db_empty($dbName)) {
return Array('status' => true, 'message' => 'PASSED');
}

View File

@@ -121,16 +121,16 @@ class Xpdl extends processes
* @param array $fields
* @return boolean
*/
function updateDynaformsPmxml($uid,$fields)
{
$oData->dynaforms = $this->getDynaformRows ( $uid);
$count = sizeof($oData->dynaforms);
foreach ($fields as $val => $id){
$oData->dynaforms[$count]= $id;
$count = $count + 1 ;
}
$this->createDynaformRows ($oData->dynaforms );
}
// function updateDynaformsPmxml($uid,$fields)
// {
// $oData->dynaforms = $this->getDynaformRows ( $uid);
// $count = sizeof($oData->dynaforms);
// foreach ($fields as $val => $id){
// $oData->dynaforms[$count]= $id;
// $count = $count + 1 ;
// }
// $this->createDynaformRows ($oData->dynaforms );
// }
/**
* This function create the subProcess from data
@@ -781,36 +781,6 @@ class Xpdl extends processes
$idTasks['PORT'] = $port;
$arrayTasks[] = $idTasks;
}
/* $dataTasks .='
<Activity Id="'.$idEvent.'" Name="'.$description.'">
<Description>'.$description.'</Description>
<Event>
<IntermediateEvent Trigger="Message" Implementation="Other">
<TriggerResultMessage CatchThrow="THROW">
<Message Id="'.$idEvent.'" From="jeaqueline@colosa.com" To="'.$to.'" Name="'.$description.'">
</Message>
</TriggerResultMessage>
</IntermediateEvent>
</Event>
<Documentation>'.$description.'</Documentation>
<ExtendedAttributes />
<NodeGraphicsInfos>
<NodeGraphicsInfo ToolId="BizAgi_Process_Modeler" Height="30" Width="30" BorderColor="-6909623" FillColor="-66833">
<Coordinates XCoordinate="'.$coordinateX.'" YCoordinate="'.$coordinateY.'" />
</NodeGraphicsInfo>
</NodeGraphicsInfos>
<IsForCompensationSpecified>false</IsForCompensationSpecified>
</Activity>';
$transitions.='
<Transition Id="t'.$idEvent.'" From="'.$idTask.'" To="'.$idEvent.'" Name="">
<Condition />
<Description />
<ExtendedAttributes />
<ConnectorGraphicsInfos>
<ConnectorGraphicsInfo ToolId="Processmaker" BorderColor="0" FromPort="4" ToPort="3">
</ConnectorGraphicsInfo>
</ConnectorGraphicsInfos>
</Transition>';*/
}
}
$idTasks = array();