HOR-3670-RG-5 Files review:
workflow/engine/classes/XmlForm_Field_TextareaPM.php workflow/engine/classes/XmlForm_Field_ToolBar.php workflow/engine/classes/XmlForm_Field_ToolButton.php workflow/engine/classes/Zip_File.php
This commit is contained in:
committed by
dante
parent
c1434868b8
commit
912e91682d
@@ -1,36 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class.xmlfield_InputPM.php
|
* Class XmlFormFieldTextareaPm
|
||||||
*
|
*/
|
||||||
* @package workflow.engine.classes
|
class XmlFormFieldTextAreaPm extends XmlForm_Field
|
||||||
*
|
|
||||||
* 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 $rows = 12;
|
||||||
public $cols = 40;
|
public $cols = 40;
|
||||||
@@ -50,24 +23,24 @@
|
|||||||
* @param eter string owner
|
* @param eter string owner
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function render ($value = null, $owner)
|
public function render($value = null, $owner)
|
||||||
{
|
{
|
||||||
if ($this->showVars == 1) {
|
if ($this->showVars == 1) {
|
||||||
$this->process = G::replaceDataField( $this->process, $owner->values );
|
$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;"/>';
|
$sShowVars = ' <input type="button" value="' . $this->symbol . '" onclick="showDynaformsFormVars(\'form[' . $this->name . ']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;"/>';
|
||||||
} else {
|
} else {
|
||||||
$sShowVars = '';
|
$sShowVars = '';
|
||||||
}
|
}
|
||||||
if ($this->mode === 'edit') {
|
if ($this->mode === 'edit') {
|
||||||
if ($this->readOnly) {
|
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;
|
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 {
|
} 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;
|
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') {
|
} 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>';
|
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 {
|
} 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>';
|
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>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,34 +53,31 @@
|
|||||||
* @param eter string owner
|
* @param eter string owner
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function renderGrid ($owner, $values = null)
|
public function renderGrid($owner, $values = null)
|
||||||
{
|
{
|
||||||
$result = array ();
|
$result = array();
|
||||||
$r = 1;
|
$r = 1;
|
||||||
foreach ($values as $v) {
|
foreach ($values as $v) {
|
||||||
if ($this->showVars == 1) {
|
if ($this->showVars == 1) {
|
||||||
$this->process = G::replaceDataField( $this->process, $owner->values );
|
$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;"/>';
|
$sShowVars = ' <input type="button" value="' . $this->symbol . '" onclick="showDynaformsFormVars(\'form[' . $owner->name . '][' . $r . '][' . $this->name . ']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;"/>';
|
||||||
} else {
|
} else {
|
||||||
$sShowVars = '';
|
$sShowVars = '';
|
||||||
}
|
}
|
||||||
if ($this->mode === 'edit') {
|
if ($this->mode === 'edit') {
|
||||||
if ($this->readOnly) {
|
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;
|
$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 {
|
} 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;
|
$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') {
|
} elseif ($this->mode === 'view') {
|
||||||
if (stristr( $_SERVER['HTTP_USER_AGENT'], 'iPhone' )) {
|
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');
|
||||||
$result[] = $this->htmlentities( $v, ENT_COMPAT, 'utf-8' );
|
|
||||||
} else {
|
} 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');
|
||||||
$result[] = $this->htmlentities( $v, ENT_COMPAT, 'utf-8' );
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$result[] = $this->htmlentities( $v, ENT_COMPAT, 'utf-8' );
|
$result[] = $this->htmlentities($v, ENT_COMPAT, 'utf-8');
|
||||||
}
|
}
|
||||||
$r ++;
|
$r ++;
|
||||||
}
|
}
|
||||||
120
workflow/engine/classes/XmlFormFieldTextPm.php
Normal file
120
workflow/engine/classes/XmlFormFieldTextPm.php
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class XmlFormFieldTextPm 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)
|
||||||
|
{
|
||||||
|
//NOTE: string functions must be in G class
|
||||||
|
if ($this->strTo === 'UPPER') {
|
||||||
|
$value = strtoupper($value);
|
||||||
|
}
|
||||||
|
if ($this->strTo === 'LOWER') {
|
||||||
|
$value = strtolower($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 = ' <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 = ' <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() . ");";
|
||||||
|
}
|
||||||
|
}
|
||||||
48
workflow/engine/classes/XmlFormFieldToolBar.php
Normal file
48
workflow/engine/classes/XmlFormFieldToolBar.php
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ToolBar - ToolBar
|
||||||
|
* XmlFormFieldToolBar - XmlFormFieldToolBar class
|
||||||
|
*
|
||||||
|
* @package workflow.engine.ProcessMaker
|
||||||
|
*/
|
||||||
|
class XmlFormFieldToolBar 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 XmlFormFieldToolBar($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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,40 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class.toolBar.php
|
* ToolBar - ToolBar
|
||||||
|
* XmlFormFieldToolButton - XmlFormFieldToolButton class
|
||||||
*
|
*
|
||||||
* @package workflow.engine.ProcessMaker
|
* @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 XmlFormFieldToolButton extends XmlForm_Field
|
||||||
/**
|
|
||||||
* ToolBar - ToolBar
|
|
||||||
/**
|
|
||||||
* XmlForm_Field_toolButton - XmlForm_Field_toolButton class
|
|
||||||
*
|
|
||||||
* @package workflow.engine.ProcessMaker
|
|
||||||
*/class XmlForm_Field_toolButton extends XmlForm_Field
|
|
||||||
{
|
{
|
||||||
|
|
||||||
public $file = '';
|
public $file = '';
|
||||||
public $fileAlt = '';
|
public $fileAlt = '';
|
||||||
public $url = '';
|
public $url = '';
|
||||||
@@ -95,8 +68,6 @@
|
|||||||
break;
|
break;
|
||||||
case 'html':
|
case 'html':
|
||||||
$html = '<div ' . ' onmouseover=\'backImage(this,"url(' . htmlentities($urlAlt, ENT_QUOTES, 'utf-8') . ') no-repeat")\' onmouseout=\'backImage(this,"")\' style="width:25px;height:25px;margin-bottom:3px">' . $this->label . '</div>';
|
$html = '<div ' . ' onmouseover=\'backImage(this,"url(' . htmlentities($urlAlt, ENT_QUOTES, 'utf-8') . ') no-repeat")\' onmouseout=\'backImage(this,"")\' style="width:25px;height:25px;margin-bottom:3px">' . $this->label . '</div>';
|
||||||
|
|
||||||
//$html=$this->label;
|
|
||||||
break;
|
break;
|
||||||
case 'image/text':
|
case 'image/text':
|
||||||
$html = '<img src="' . htmlentities($url, ENT_QUOTES, 'utf-8') . '"' . (($this->style) ? ' style="' . $this->style . '"' : '') . '/><br/>' . $this->htmlentities($this->label, ENT_QUOTES, 'utf-8');
|
$html = '<img src="' . htmlentities($url, ENT_QUOTES, 'utf-8') . '"' . (($this->style) ? ' style="' . $this->style . '"' : '') . '/><br/>' . $this->htmlentities($this->label, ENT_QUOTES, 'utf-8');
|
||||||
@@ -107,7 +78,6 @@
|
|||||||
case 'dropdown':
|
case 'dropdown':
|
||||||
$html = '';
|
$html = '';
|
||||||
if (isset($this->owner->values['PRO_UID'])) {
|
if (isset($this->owner->values['PRO_UID'])) {
|
||||||
|
|
||||||
$criteria = ProcessMap::getDynaformsCriteria($this->owner->values['PRO_UID']);
|
$criteria = ProcessMap::getDynaformsCriteria($this->owner->values['PRO_UID']);
|
||||||
$dataset = DynaformPeer::doSelectRS($criteria);
|
$dataset = DynaformPeer::doSelectRS($criteria);
|
||||||
if ($dataset->getRecordCount() > 0) {
|
if ($dataset->getRecordCount() > 0) {
|
||||||
@@ -1,181 +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.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() . ");";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
<?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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
/*--------------------------------------------------
|
|
||||||
|
/* --------------------------------------------------
|
||||||
* TAR/GZIP/BZIP2/ZIP ARCHIVE CLASSES 2.1
|
* TAR/GZIP/BZIP2/ZIP ARCHIVE CLASSES 2.1
|
||||||
* By Devin Doucette
|
* By Devin Doucette
|
||||||
* Copyright (c) 2005 Devin Doucette
|
* Copyright (c) 2005 Devin Doucette
|
||||||
* Email: darksnoopy@shaw.ca
|
* Email: darksnoopy@shaw.ca
|
||||||
*--------------------------------------------------
|
* --------------------------------------------------
|
||||||
* Email bugs/suggestions to darksnoopy@shaw.ca
|
* Email bugs/suggestions to darksnoopy@shaw.ca
|
||||||
*--------------------------------------------------
|
* --------------------------------------------------
|
||||||
* This script has been created and released under
|
* This script has been created and released under
|
||||||
* the GNU GPL and is free to use and redistribute
|
* the GNU GPL and is free to use and redistribute
|
||||||
* only if this copyright statement is not removed
|
* only if this copyright statement is not removed
|
||||||
*--------------------------------------------------*/
|
* -------------------------------------------------- */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is derived from the class archive, is imployed to use files .
|
* This class is derived from the class archive, is imployed to use files .
|
||||||
@@ -18,10 +19,9 @@
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes
|
* @package workflow.engine.classes
|
||||||
*/
|
*/
|
||||||
class zip_file extends Archive
|
class ZipFile extends Archive
|
||||||
{
|
{
|
||||||
|
public function ZipFile($name)
|
||||||
public function zip_file($name)
|
|
||||||
{
|
{
|
||||||
$this->archive($name);
|
$this->archive($name);
|
||||||
$this->options['type'] = "zip";
|
$this->options['type'] = "zip";
|
||||||
Reference in New Issue
Block a user