2010-12-02 23:34:41 +00:00
|
|
|
<?php
|
2012-10-22 15:45:47 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
/**
|
|
|
|
|
* class.popupMenu.php
|
2012-10-22 15:45:47 -04:00
|
|
|
*
|
2011-02-01 12:49:40 +00:00
|
|
|
* @package workflow.engine.ProcessMaker
|
2012-10-22 15:45:47 -04:00
|
|
|
*
|
2010-12-02 23:34:41 +00:00
|
|
|
* ProcessMaker Open Source Edition
|
2011-02-01 12:49:40 +00:00
|
|
|
* Copyright (C) 2004 - 2011 Colosa Inc.
|
2012-10-22 15:45:47 -04:00
|
|
|
*
|
2010-12-02 23:34:41 +00:00
|
|
|
* 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
|
2012-10-22 15:45:47 -04:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2010-12-02 23:34:41 +00:00
|
|
|
* GNU Affero General Public License for more details.
|
2012-10-22 15:45:47 -04:00
|
|
|
*
|
2010-12-02 23:34:41 +00:00
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
2012-10-22 15:45:47 -04:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*
|
|
|
|
|
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
2010-12-02 23:34:41 +00:00
|
|
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
2012-10-22 15:45:47 -04:00
|
|
|
*
|
2010-12-02 23:34:41 +00:00
|
|
|
*/
|
2012-10-22 15:45:47 -04:00
|
|
|
|
2017-08-11 11:10:27 -04:00
|
|
|
/**
|
|
|
|
|
* popupMenu - popupMenu
|
2010-12-02 23:34:41 +00:00
|
|
|
/**
|
|
|
|
|
* popupMenu - popupMenu class
|
2012-10-22 15:45:47 -04:00
|
|
|
*
|
2011-02-01 12:49:40 +00:00
|
|
|
* @package workflow.engine.ProcessMaker
|
2010-12-02 23:34:41 +00:00
|
|
|
* @copyright COLOSA
|
2017-08-11 11:10:27 -04:00
|
|
|
*/class popupMenu extends form
|
2010-12-02 23:34:41 +00:00
|
|
|
{
|
2012-10-22 15:45:47 -04:00
|
|
|
var $type = 'popupMenu';
|
|
|
|
|
var $theme = 'processmaker';
|
2010-12-02 23:34:41 +00:00
|
|
|
|
2012-10-22 15:45:47 -04:00
|
|
|
/**
|
|
|
|
|
* Print the popup
|
|
|
|
|
*
|
|
|
|
|
* @param string $tableId
|
|
|
|
|
* @param array $tableFields
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
|
|
|
|
function renderPopup ($tableId, $tableFields)
|
|
|
|
|
{
|
|
|
|
|
$this->name = $tableId;
|
|
|
|
|
$fields = array_keys( $tableFields );
|
|
|
|
|
foreach ($fields as $f) {
|
|
|
|
|
switch (strtolower( $tableFields[$f]['Type'] )) {
|
|
|
|
|
case 'javascript':
|
|
|
|
|
case 'button':
|
|
|
|
|
case 'private':
|
|
|
|
|
case 'hidden':
|
|
|
|
|
case 'cellmark':
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
$label = ($tableFields[$f]['Label'] != '') ? $tableFields[$f]['Label'] : $f;
|
|
|
|
|
$label = str_replace( "\n", ' ', $label );
|
|
|
|
|
$pmXmlNode = new Xml_Node( $f, 'complete', '', array ('label' => $label,'type' => 'popupOption','launch' => $tableId . '.showHideField("' . $f . '")'
|
|
|
|
|
) );
|
|
|
|
|
$this->fields[$f] = new XmlForm_Field_popupOption( $pmXmlNode );
|
|
|
|
|
$this->values[$f] = '';
|
|
|
|
|
}
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-10-22 15:45:47 -04:00
|
|
|
$scTemp = '';
|
|
|
|
|
$this->values['PAGED_TABLE_ID'] = $tableId;
|
|
|
|
|
print (parent::render( PATH_CORE . 'templates/popupMenu.html', $scTemp )) ;
|
|
|
|
|
$sc = "<script type=\"text/javascript\">\n$scTemp\n loadPopupMenu_$tableId(); \n</script>";
|
|
|
|
|
return $sc;
|
|
|
|
|
}
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|