BUG 000 Add new wizard plugins extracted of master branch

This commit is contained in:
Julio Cesar Laura
2011-12-06 18:54:23 -04:00
committed by Erik Amaru Ortiz
parent 9ec4873f73
commit 0f20042d5a
36 changed files with 1221 additions and 323 deletions

View File

@@ -0,0 +1 @@
<div id="divMain" style="margin: 1em;"></div>

View File

@@ -0,0 +1,248 @@
Ext.namespace("{className}");
{className}.application = {
init:function(){
storeUserProcess = function (n, r, i) {
var myMask = new Ext.LoadMask(Ext.getBody(), {msg:"Load users..."});
myMask.show();
Ext.Ajax.request({
url: "{className}ApplicationAjax",
method: "POST",
params: {"option": "LST", "pageSize": n, "limit": r, "start": i},
success:function (result, request) {
storeUser.loadData(Ext.util.JSON.decode(result.responseText));
myMask.hide();
},
failure:function (result, request) {
myMask.hide();
Ext.MessageBox.alert("Alert", "Failure users load");
}
});
};
onMnuContext = function(grid, rowIndex,e) {
e.stopEvent();
var coords = e.getXY();
mnuContext.showAt([coords[0], coords[1]]);
};
//Variables declared in html file
var pageSize = parseInt(CONFIG.pageSize);
var message = CONFIG.message;
//stores
var storeUser = new Ext.data.Store({
proxy:new Ext.data.HttpProxy({
url: "{className}ApplicationAjax",
method: "POST"
}),
//baseParams: {"option": "LST", "pageSize": pageSize},
reader:new Ext.data.JsonReader({
root: "resultRoot",
totalProperty: "resultTotal",
fields: [{name: "ID"},
{name: "NAME"},
{name: "AGE"},
{name: "BALANCE"}
]
}),
//autoLoad: true, //First call
listeners:{
beforeload:function (store) {
this.baseParams = {"option": "LST", "pageSize": pageSize};
}
}
});
var storePageSize = new Ext.data.SimpleStore({
fields: ["size"],
data: [["15"], ["25"], ["35"], ["50"], ["100"]],
autoLoad: true
});
//
var btnNew = new Ext.Action({
id: "btnNew",
text: "New",
iconCls: "button_menu_ext ss_sprite ss_add",
handler: function() {
Ext.MessageBox.alert("Alert", message);
}
});
var btnEdit = new Ext.Action({
id: "btnEdit",
text: "Edit",
iconCls: "button_menu_ext ss_sprite ss_pencil",
disabled: true,
handler: function() {
Ext.MessageBox.alert("Alert", message);
}
});
var btnDelete = new Ext.Action({
id: "btnDelete",
text: "Delete",
iconCls: "button_menu_ext ss_sprite ss_delete",
disabled: true,
handler: function() {
Ext.MessageBox.alert("Alert", message);
}
});
var btnSearch = new Ext.Action({
id: "btnSearch",
text: "Search",
handler: function() {
Ext.MessageBox.alert("Alert", message);
}
});
var mnuContext = new Ext.menu.Menu({
id: "mnuContext",
items: [btnEdit, btnDelete]
});
var txtSearch = new Ext.form.TextField({
id: "txtSearch",
emptyText: "Enter search term",
width: 150,
allowBlank: true,
listeners:{
specialkey: function (f, e) {
if (e.getKey() == e.ENTER) {
Ext.MessageBox.alert("Alert", message);
}
}
}
});
var btnTextClear = new Ext.Action({
id: "btnTextClear",
text: "X",
ctCls: "pm_search_x_button",
handler: function() {
txtSearch.reset();
}
});
var cboPageSize = new Ext.form.ComboBox({
id: "cboPageSize",
mode: "local",
triggerAction: "all",
store: storePageSize,
valueField: "size",
displayField: "size",
width: 50,
editable: false,
listeners:{
select: function (combo, record, index) {
pageSize = parseInt(record.data["size"]);
pagingUser.pageSize = pageSize;
pagingUser.moveFirst();
}
}
});
var pagingUser = new Ext.PagingToolbar({
id: "pagingUser",
pageSize: pageSize,
store: storeUser,
displayInfo: true,
displayMsg: "Displaying users " + "{" + "0" + "}" + " - " + "{" + "1" + "}" + " of " + "{" + "2" + "}",
emptyMsg: "No roles to display",
items: ["-", "Page size:", cboPageSize]
});
var cmodel = new Ext.grid.ColumnModel({
defaults: {
width:50,
sortable:true
},
columns:[{id: "ID", dataIndex: "ID", hidden: true},
{header: "Name", dataIndex: "NAME", align: "left"},
{header: "Age", dataIndex: "AGE", width: 25, align: "center"},
{header: "Balance", dataIndex: "BALANCE", width: 25, align: "left"}
]
});
var smodel = new Ext.grid.RowSelectionModel({
singleSelect: true,
listeners: {
rowselect: function (sm) {
btnEdit.enable();
btnDelete.enable();
},
rowdeselect: function (sm) {
btnEdit.disable();
btnDelete.disable();
}
}
});
var grdpnlUser = new Ext.grid.GridPanel({
id: "grdpnlUser",
store: storeUser,
colModel: cmodel,
selModel: smodel,
columnLines: true,
viewConfig: {forceFit: true},
enableColumnResize: true,
enableHdMenu: true, //Menu of the column
tbar: [btnNew, "-", btnEdit, btnDelete, "-", "->", txtSearch, btnTextClear, btnSearch],
bbar: pagingUser,
style: "margin: 0 auto 0 auto;",
width: 550,
height: 450,
title: "Users",
renderTo: "divMain",
listeners:{
}
});
//Initialize events
storeUserProcess(pageSize, pageSize, 0);
grdpnlUser.on("rowcontextmenu",
function (grid, rowIndex, evt) {
var sm = grid.getSelectionModel();
sm.selectRow(rowIndex, sm.isSelected(rowIndex));
},
this
);
grdpnlUser.addListener("rowcontextmenu", onMnuContext, this);
cboPageSize.setValue(pageSize);
}
}
Ext.onReady({className}.application.init, {className}.application);

View File

@@ -0,0 +1,33 @@
<?php
/**
* welcome.php for plugin {className}
*
*
*/
try {
/* Render page */
$oHeadPublisher = &headPublisher::getSingleton();
$G_MAIN_MENU = "processmaker";
$G_ID_MENU_SELECTED = "{menuId}_MNU_01";
//$G_SUB_MENU = "setup";
//$G_ID_SUB_MENU_SELECTED = "{menuId}_02";
$config = array();
$config["pageSize"] = 15;
$config["message"] = "Hello world!";
$oHeadPublisher->addContent("{className}/{className}Application"); //Adding a html file .html
$oHeadPublisher->addExtJsScript("{className}/{className}Application", false); //Adding a javascript file .js
$oHeadPublisher->assign("CONFIG", $config);
G::RenderPage("publish", "extJs");
} catch (Exception $e) {
$G_PUBLISH = new Publisher;
$aMessage["MESSAGE"] = $e->getMessage();
$G_PUBLISH->AddContent("xmlform", "xmlform", "{className}/messageShow", "", $aMessage);
G::RenderPage("publish", "blank");
}
?>

View File

@@ -0,0 +1 @@
<div id="divMain" style="margin: 1em;"></div>

View File

@@ -0,0 +1,270 @@
Ext.namespace("{className}");
{className}.application2 = {
init:function(){
var storeGraphicType = new Ext.data.ArrayStore({
idIndex: 0,
fields: ["id", "value"],
data: [["chartcol", "Column Chart"],
["chartpie", "Pie Chart"],
["chartlin", "Line Chart"]
]
});
var storeCboAppStatus = new Ext.data.ArrayStore({
idIndex: 0,
fields: ["id", "value"],
data: [["ALL", "ALL"],
["DRAFT", "DRAFT"],
["TO_DO", "TO DO"],
["COMPLETED", "COMPLETED"]
]
});
var storeCboAppdelStatus = new Ext.data.ArrayStore({
idIndex: 0,
fields: ["id", "value"],
data: [["ALL", "ALL"],
["OPEN", "OPEN"],
["CLOSED", "CLOSED"]
]
});
var storeCboOption = new Ext.data.ArrayStore({
idIndex:0,
fields: ["id", "value"],
data: [["Y", "Year"],
["m", "Month"],
["d", "Day"]
]
});
//
var cboGraphicType = new Ext.form.ComboBox({
id: "cboGraphicType",
valueField: "id",
displayField: "value",
value: "chartcol",
store: storeGraphicType,
triggerAction: "all",
mode: "local",
editable: false,
width: 150,
fieldLabel: "Graphic Type",
listeners:{select:function (combo, record, index) { Ext.MessageBox.alert("Alert", "Event select in Ext.form.ComboBox"); }}
});
var radiog1 = new Ext.form.RadioGroup({
id: "radiog1",
//fieldLabel: "Status",
items: [{name:"radiog1", inputValue:"1", checked:true, boxLabel:"Status"}, //inputValue works as string
{name:"radiog1", inputValue:"2", boxLabel:"Status Delegation"}
],
listeners: {
change:function (r, newValue) {
Ext.getCmp("pnlCboAppStatus").setVisible(false);
Ext.getCmp("pnlCboAppdelStatus").setVisible(false);
if (newValue.inputValue == 1) {
Ext.getCmp("pnlCboAppStatus").setVisible(true);
}
else {
Ext.getCmp("pnlCboAppdelStatus").setVisible(true);
}
}
}
});
var pnlCboAppStatus = new Ext.Panel({
id: "pnlCboAppStatus",
border: false,
items:[
{xtype: "form",
labelWidth: 115,
border: false,
items:[
{xtype: "combo",
id: "cboAppStatus",
valueField: "id",
displayField:"value",
value: "ALL",
store: storeCboAppStatus,
triggerAction: "all",
mode: "local",
editable: false,
width: 150,
fieldLabel: "Status"
}
]
}
]
});
var pnlCboAppdelStatus = new Ext.Panel({
id: "pnlCboAppdelStatus",
border: false,
items: [
{xtype: "form",
labelWidth: 115,
border: false,
items: [
{xtype: "combo",
id: "cboAppdelStatus",
valueField: "id",
displayField:"value",
value: "ALL",
store: storeCboAppdelStatus,
triggerAction: "all",
mode: "local",
editable: false,
width: 150,
fieldLabel: "Status Delegation"
}
]
}
]
});
var cboOption = new Ext.form.ComboBox({
id: "cboOption",
valueField: "id",
displayField: "value",
value: "m",
store: storeCboOption,
triggerAction: "all",
mode: "local",
editable: false,
width: 150,
fieldLabel: "Option",
listeners: {select:function (combo, record, index) { Ext.MessageBox.alert("Alert", "Event select in Ext.form.ComboBox"); }}
});
var txtDate = new Ext.form.DateField({
id: "txtDate",
value: new Date(2011, 0, 1), //january = 0, february = 1, ...
width: 150,
//format: "Y-m-d H:i:s",
format: "Y-m-d",
editable: false,
fieldLabel: "Date Start"
});
var btnSubmit = new Ext.Button({
id: "btnSubmit",
text: "Submit",
//anchor: "95%",
handler: function () {
Ext.MessageBox.alert("Alert", "Event handler in Ext.Button");
}
});
//------------------------------------------------------------------------------------------------------------------
var tbarMain = new Ext.Toolbar({
id: "tbarMain",
items: [{text: "< Back"},
"-",
"->", //Right
"-",
{text: "Home"}
]
});
var frmHistory = new Ext.FormPanel({
id: "frmHistory",
labelWidth: 115, //The width of labels in pixels
bodyStyle: "padding:0.5em;",
border: false,
//title: "Data",
items: [cboGraphicType, radiog1, pnlCboAppStatus, pnlCboAppdelStatus, cboOption, txtDate],
buttonAlign: "right",
buttons: [btnSubmit,
{text:"Reset",
handler: function () {
frmHistory.getForm().reset();
}
}
]
});
var pnlWest = new Ext.Panel({
id: "pnlWest",
region: "west",
collapsible: true,
split: true,
margins: {top:3, right:3, bottom:3, left:3},
width: 380,
title: "Data",
items: [frmHistory]
});
var pnlCenter = new Ext.Panel({
id: "pnlCenter",
region:"center",
margins: {top:3, right:3, bottom:3, left:0},
bodyStyle: "padding:25px 25px 25px 25px;",
html: "Application2"
//items: []
});
//------------------------------------------------------------------------------------------------------------------
Ext.getCmp("pnlCboAppStatus").setVisible(true);
Ext.getCmp("pnlCboAppdelStatus").setVisible(false);
//------------------------------------------------------------------------------------------------------------------
var pnlMain=new Ext.Panel({
id: "pnlMain",
layout: "border",
defaults: {autoScroll: true},
border: false,
title: "Application2",
tbar: tbarMain,
items: [pnlWest, pnlCenter]
});
//LOAD ALL PANELS
var viewport = new Ext.Viewport({
layout: "fit",
items:[pnlMain]
});
}
}
Ext.onReady({className}.application2.init, {className}.application2);

View File

@@ -0,0 +1,16 @@
<?php
try {
$oHeadPublisher = &headPublisher::getSingleton();
$oHeadPublisher->addContent("{className}/{className}Application2"); //Adding a html file .html.
$oHeadPublisher->addExtJsScript("{className}/{className}Application2", false); //Adding a javascript file .js
G::RenderPage("publish", "extJs");
} catch (Exception $e) {
$G_PUBLISH = new Publisher;
$aMessage["MESSAGE"] = $e->getMessage();
$G_PUBLISH->AddContent("xmlform", "xmlform", "{className}/messageShow", "", $aMessage);
G::RenderPage("publish", "blank");
}
?>

View File

@@ -0,0 +1 @@
<div id="divMain" style="margin: 1em;"></div>

View File

@@ -0,0 +1,26 @@
Ext.namespace("{className}");
{className}.application3 = {
init:function(){
var pnlCenter=new Ext.Panel({
id:"pnlCenter",
region:"center",
border: false,
title: "Application3",
html: "&nbsp;Content3"
});
var pnlMain=new Ext.Panel({
id: "pnlMain",
layout: "border",
height: 150,
items:[pnlCenter],
renderTo: "divMain"
});
}
}
Ext.onReady({className}.application3.init, {className}.application3);

View File

@@ -0,0 +1,16 @@
<?php
try {
$oHeadPublisher = &headPublisher::getSingleton();
$oHeadPublisher->addContent("{className}/{className}Application3"); //Adding a html file .html.
$oHeadPublisher->addExtJsScript("{className}/{className}Application3", false); //Adding a javascript file .js
G::RenderPage("publish", "extJs");
} catch (Exception $e) {
$G_PUBLISH = new Publisher;
$aMessage["MESSAGE"] = $e->getMessage();
$G_PUBLISH->AddContent("xmlform", "xmlform", "{className}/messageShow", "", $aMessage);
G::RenderPage("publish", "blank");
}
?>

View File

@@ -0,0 +1,36 @@
<?php
function userGet($r, $i)
{ $userName = array("John", "Amy", "Dan", "Elizabeth", "Mike", "Wil", "Ernest", "Albert", "Sue", "Freddy",
"Mary", "Tom", "Paul", "Amber", "Bibi", "Boris", "Cameron", "Cesar", "Carmen", "Ben",
"Amadeo", "Angela", "Betty", "Benny", "Brenda", "Christian", "Celia", "Franklin", "Fiona", "Felix",
"Amelia", "Chelsea", "David", "Donna", "Edison", "Erika", "Ginger", "Gilbert", "Heidi", "Hans",
"Andy", "Bruce", "Corinna", "Evan", "Austin", "Flavio", "Gaby", "Gally", "Harold", "Isabella");
$user = array();
for ($ii = 0; $ii <= 50 - 1; $ii++) {
$user[] = array("ID" => $ii + 10, "NAME" => $userName[$ii], "AGE" => rand(20, 40), "BALANCE" => rand(100, 255));
}
return (array(count($user), array_slice($user, $i, $r)));
}
try {
$option = $_POST["option"];
switch ($option) {
case "LST": $pageSize = $_POST["pageSize"];
$limit = isset($_POST["limit"])? $_POST["limit"] : $pageSize;
$start = isset($_POST["start"])? $_POST["start"] : 0;
list($userNum, $user) = userGet($limit, $start);
//echo "{success: " . true . ", resultTotal: " . count($user) . ", resultRoot: " . G::json_encode($user) . "}";
echo json_encode(array("success" => true, "resultTotal" => $userNum, "resultRoot" => $user));
break;
}
} catch (Exception $e) {
echo null;
}
?>

View File

@@ -4,9 +4,8 @@
*
*/
class {className}Class extends PMPlugin {
function __construct ( ) {
class {className}Class extends PMPlugin {
function __construct() {
set_include_path(
PATH_PLUGINS . '{className}' . PATH_SEPARATOR .
get_include_path()
@@ -17,37 +16,45 @@
{
}
function getFieldsForPageSetup()
{
}
function updateFieldsForPageSetup()
{
}
<!-- START BLOCK : dashboard -->
//here we are defining the available charts, the dashboard setup will call this function to know the charts
function getAvailableCharts( ) {
return array (
'{className}Chart',
);
function getAvailableCharts() {
return array(
'{className}Chart',
);
}
function getChart( $chartName ) {
function getChart($chartName) {
$prePath = '/sys' . SYS_SYS . '/' . SYS_LANG . '/blank/';
$obj = new StdClass();
switch ($chartName) {
case '{className}Chart':
$obj->title = '{className} Chart - Per Forum';
break;
}
$obj = new StdClass();
switch ($chartName) {
case '{className}Chart':
$obj->title = '{className} Chart - Per Forum';
break;
}
$obj->height = 220;
$obj->open->image = $prePath . '{className}/drawChart?chart=' . $chartName . "&u=";
return $obj;
return $obj;
}
/* definition of all charts */
/* that definition comes in two parts :
/* 1. the getXX () function to get the data from the databases
/* 2. the XX () function to draw the graph
*/
/* definition of all charts */
/* that definition comes in two parts :
/* 1. the getXX() function to get the data from the databases
/* 2. the XX() function to draw the graph
*/
/** chart {className} ***/
function get{className}Chart ( ) {
/** chart {className} ***/
function get{className}Chart() {
$dataSet = array();
$past1months = mktime(0, 0, 0, date("m") -1 , date("d"), date("Y"));
$past1months = mktime(0, 0, 0, date("m") - 1, date("d"), date("Y"));
$con = Propel::getConnection('workflow');
$sql = "select CON_VALUE, COUNT(*) AS CANT from APPLICATION LEFT JOIN CONTENT ON ( CON_CATEGORY = 'PRO_TITLE' AND CON_ID = PRO_UID AND CON_LANG = 'en' ) GROUP BY CON_VALUE" ;
@@ -55,77 +62,76 @@
$rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
while ( is_array ( $row ) ) {
if ( strlen ( trim ($row['CON_VALUE']) ) > 0 ) {
$label[] = $row['CON_VALUE'];
$data[] = $row['CANT'];
}
$rs->next();
$row = $rs->getRow();
while (is_array($row)) {
if (strlen(trim($row['CON_VALUE'])) > 0) {
$label[] = $row['CON_VALUE'];
$data[] = $row['CANT'];
}
$rs->next();
$row = $rs->getRow();
}
$dataSet['data'] = $data;
$dataSet['label'] = $label;
$max = 1;
foreach ( $dataSet['data'] as $k => $val ) if ( $val > $max ) $max = $val;
$aux = intval($max / 6 ) * 6 + 6;
$dataSet['max'] = $aux;
foreach ($dataSet['data'] as $k => $val ) if ($val > $max) $max = $val;
$aux = intval($max / 6) * 6 + 6;
$dataSet['max'] = $aux;
return $dataSet;
}
function {className}Chart( ) {
function {className}Chart() {
G::LoadThirdParty("libchart/classes", "libchart" );
$chart = new VerticalBarChart(430, 220);
$dataSet = $this->get{className}Chart();
$dataPostSet = new XYDataSet();
$dataTopicSet = new XYDataSet();
foreach ( $dataSet['label'] as $key => $label ) {
$dataPostSet->addPoint(new Point( $label, $dataSet['data'][$key] )) ;
}
$dataPostSet = new XYDataSet();
$dataTopicSet = new XYDataSet();
foreach ($dataSet['label'] as $key => $label) {
$dataPostSet->addPoint(new Point($label, $dataSet['data'][$key])) ;
}
$chart->setDataSet($dataPostSet);
$chart->setDataSet($dataPostSet);
$chart->setTitle( " Posts by Week " );
$chart->render();
}
<!-- END BLOCK : dashboard -->
<!-- START BLOCK : report -->
//here we are defining the available charts, the dashboard setup will call this function to know the charts
function getAvailableReports( ) {
return array (
array ( 'uid'=>'{className}Report_1', 'title'=>'{className} Test Report (users)' ),
//array ( 'uid'=>'{className}Report_2', 'title'=>'{className} Test Report (groups)' )
);
function getAvailableReports() {
return array (
array('uid' => '{className}Report_1', 'title' => '{className} Test Report (users)'),
//array('uid' => '{className}Report_2', 'title' => '{className} Test Report (groups)')
);
}
function getReport( $reportName ) {
$obj = new StdClass();
switch ( $reportName ) {
case '{className}Report_1':
$obj->title = '{className} Test Report (users)';
break;
case '{className}Report_2':
$obj->title = '{className} Test Report (users)';
break;
default:
$obj->title = 'default ....';
break;
}
return $obj;
function getReport($reportName) {
$obj = new StdClass();
switch ($reportName) {
case '{className}Report_1':
$obj->title = '{className} Test Report (users)';
break;
case '{className}Report_2':
$obj->title = '{className} Test Report (users)';
break;
default:
$obj->title = 'default ....';
break;
}
return $obj;
}
function {className}Report_1() {
global $G_PUBLISH;
global $G_PUBLISH;
require_once 'classes/model/Users.php';
$sDelimiter = DBAdapter::getStringDelimiter();
$aUsers = array();
$aUsers[] = array('USR_UID' => 'char',
'USR_NAME' => 'char',
'USR_FIRSTNAME' => 'char',
$aUsers[] = array('USR_UID' => 'char',
'USR_NAME' => 'char',
'USR_FIRSTNAME' => 'char',
'USR_LASTNAME' => 'char',
'USR_EMAIL' => 'char',
'USR_ROLE' => 'char',);
@@ -136,15 +142,15 @@
$rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
while ( is_array ( $row ) ) {
$aUsers[] = array('USR_UID' => $row['USR_UID'],
'USR_NAME' => $row['USR_USERNAME'],
'USR_FIRSTNAME' => $row['USR_FIRSTNAME'],
'USR_LASTNAME' => $row['USR_LASTNAME'],
'USR_EMAIL' => $row['USR_EMAIL'],
'USR_ROLE' => $row['USR_ROLE']);
$rs->next();
$row = $rs->getRow();
while (is_array($row)) {
$aUsers[] = array('USR_UID' => $row['USR_UID'],
'USR_NAME' => $row['USR_USERNAME'],
'USR_FIRSTNAME' => $row['USR_FIRSTNAME'],
'USR_LASTNAME' => $row['USR_LASTNAME'],
'USR_EMAIL' => $row['USR_EMAIL'],
'USR_ROLE' => $row['USR_ROLE']);
$rs->next();
$row = $rs->getRow();
}
global $_DBArray;
@@ -158,9 +164,8 @@
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('propeltable', 'paged-table', '{className}/report', $oCriteria);
G::RenderPage('publish');
return 1;
return 1;
}
<!-- END BLOCK : report -->
}
<!-- END BLOCK : report -->
}
?>

View File

@@ -1,38 +1,36 @@
<?php
//to do: improve the way to pass two or more parameters in the paged-table ( link )
//to do: improve the way to pass two or more parameters in the paged-table (link)
$aux = explode ( '|', $_GET['id'] );
$index=0;
$aux = explode('|', $_GET['id']);
$index = 0;
<!-- START BLOCK : keys -->
${phpName} = str_replace ( '"', '', $aux[$index++] );
${phpName} = str_replace('"', '', $aux[$index++]);
<!-- END BLOCK : keys -->
<!-- START BLOCK : plugin -->
require_once ( PATH_PLUGINS . '{pluginName}' . PATH_SEP . 'class.{pluginName}.php');
require_once (PATH_PLUGINS . '{pluginName}' . PATH_SEP . 'class.{pluginName}.php');
$pluginObj = new {pluginName}Class ();
<!-- END BLOCK : plugin -->
require_once ( "classes/model/{className}.php" );
require_once ("classes/model/{className}.php");
//if exists the row in the database propel will update it, otherwise will insert.
$tr = {className}Peer::retrieveByPK( {keylist} );
$tr = {className}Peer::retrieveByPK({keylist});
if ( ( is_object ( $tr ) && get_class ($tr) == '{className}' ) ) {
if ((is_object($tr) && get_class($tr) == '{className}')) {
<!-- START BLOCK : fields -->
$fields['{name}'] = $tr->get{phpName}();
$fields['LABEL_{name}'] = $tr->get{phpName}();
$fields['{name}'] = $tr->get{phpName}();
$fields['LABEL_{name}'] = $tr->get{phpName}();
<!-- END BLOCK : fields -->
}
else
$fields = array();
$fields = array();
$G_MAIN_MENU = '{projectName}';
$G_SUB_MENU = '{phpClassName}';
$G_ID_MENU_SELECTED = '{menuId}';
$G_ID_SUB_MENU_SELECTED = '{menuId}';
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', '{phpFolderName}/{phpClassName}Delete', '', $fields, '{phpClassName}DeleteExec' );
G::RenderPage('publish');
$G_PUBLISH->AddContent('xmlform', 'xmlform', '{phpFolderName}/{phpClassName}Delete', '', $fields, '{phpClassName}DeleteExec');
G::RenderPage('publish');
?>

View File

@@ -1,31 +1,29 @@
<?php
try {
<?php
try {
$form = $_POST['form'];
<!-- START BLOCK : keys -->
${phpName} = $form['{name}'];
<!-- END BLOCK : keys -->
<!-- END BLOCK : keys -->
<!-- START BLOCK : plugin -->
require_once ( PATH_PLUGINS . '{pluginName}' . PATH_SEP . 'class.{pluginName}.php');
$pluginObj = new {pluginName}Class ();
require_once (PATH_PLUGINS . '{pluginName}' . PATH_SEP . 'class.{pluginName}.php');
$pluginObj = new {pluginName}Class ();
<!-- END BLOCK : plugin -->
require_once ( "classes/model/{className}.php" );
require_once ("classes/model/{className}.php");
//if exists the row in the database propel will update it, otherwise will insert.
$tr = {className}Peer::retrieveByPK( {keylist} );
if ( ( is_object ( $tr ) && get_class ($tr) == '{className}' ) ) {
$tr = {className}Peer::retrieveByPK({keylist});
if ((is_object($tr) && get_class($tr) == '{className}')) {
$tr->delete();
}
G::Header('location: {phpClassName}List');
G::Header('location: {phpClassName}List');
}
catch ( Exception $e ) {
catch (Exception $e) {
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', 'blank' );
}
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
G::RenderPage('publish', 'blank');
}

View File

@@ -1,14 +1,14 @@
<?php
//header("Content-type: image/png");
$chartType = isset ( $_GET['chart']) ? $_GET['chart'] : '1' ;
$chartType = isset($_GET['chart'])? $_GET['chart'] : '1';
// use the chart class to build the chart:
include_once ( "class.{className}.php" );
//use the chart class to build the chart:
include_once ("class.{className}.php");
$chartsObj = new {className}Class();
if ( method_exists( $chartsObj, $chartType) ) {
$chartsObj->{ $chartType }();
die;
if (method_exists($chartsObj, $chartType)) {
$chartsObj->{$chartType}();
die;
}

View File

@@ -1,22 +1,21 @@
<?php
$aux = explode ( '|', isset($_GET['id']) ? $_GET['id'] : '' );
<?php
$aux = explode('|', isset($_GET['id'])? $_GET['id'] : '');
<!-- START BLOCK : keys -->
${phpName} = str_replace ( '"', '', $aux[{index}] );
${phpName} = str_replace('"', '', $aux[{index}]);
<!-- END BLOCK : keys -->
<!-- START BLOCK : plugin -->
require_once ( PATH_PLUGINS . '{pluginName}' . PATH_SEP . 'class.{pluginName}.php');
$pluginObj = new {pluginName}Class ();
require_once (PATH_PLUGINS . '{pluginName}' . PATH_SEP . 'class.{pluginName}.php');
$pluginObj = new {pluginName}Class();
<!-- END BLOCK : plugin -->
require_once ( "classes/model/{className}.php" );
require_once ("classes/model/{className}.php");
//if exists the row in the database propel will update it, otherwise will insert.
$tr = {className}Peer::retrieveByPK( {keylist} );
$tr = {className}Peer::retrieveByPK({keylist});
if ( ( is_object ( $tr ) && get_class ($tr) == '{className}' ) ) {
if ((is_object($tr) && get_class($tr) == '{className}')) {
<!-- START BLOCK : fields -->
$fields['{name}'] = $tr->get{phpName}();
$fields['{name}'] = $tr->get{phpName}();
<!-- END BLOCK : fields -->
}
else
@@ -27,8 +26,7 @@
$G_ID_MENU_SELECTED = '{menuId}';
$G_ID_SUB_MENU_SELECTED = '{menuId}';
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', '{phpFolderName}/{phpClassName}Edit', '', $fields, '{phpClassName}Save' );
G::RenderPage('publish');
$G_PUBLISH->AddContent('xmlform', 'xmlform', '{phpFolderName}/{phpClassName}Edit', '', $fields, '{phpClassName}Save');
G::RenderPage('publish');
?>

View File

@@ -1,36 +1,35 @@
<?php
try {
try {
$G_MAIN_MENU = '{projectName}';
$G_SUB_MENU = '{phpClassName}';
$G_ID_MENU_SELECTED = '{menuId}';
$G_ID_SUB_MENU_SELECTED = '{menuId}';
$G_MAIN_MENU = '{projectName}';
$G_SUB_MENU = '{phpClassName}';
$G_ID_MENU_SELECTED = '{menuId}';
$G_ID_SUB_MENU_SELECTED = '{menuId}';
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher;
<!-- START BLOCK : plugin -->
require_once ( PATH_PLUGINS . '{pluginName}' . PATH_SEP . 'class.{pluginName}.php');
$pluginObj = new {pluginName}Class ();
require_once (PATH_PLUGINS . '{pluginName}' . PATH_SEP . 'class.{pluginName}.php');
$pluginObj = new {pluginName}Class();
<!-- END BLOCK : plugin -->
require_once ( "classes/model/{className}.php" );
require_once ("classes/model/{className}.php");
$Criteria = new Criteria('workflow');
$Criteria->clearSelectColumns ( );
$Criteria = new Criteria('workflow');
$Criteria->clearSelectColumns();
<!-- START BLOCK : fields -->
$Criteria->addSelectColumn ( {className}Peer::{name} );
$Criteria->addSelectColumn({className}Peer::{name});
<!-- END BLOCK : fields -->
$Criteria->add ( {phpClassName}Peer::{firstKey}, "xx" , CRITERIA::NOT_EQUAL );
$Criteria->add({phpClassName}Peer::{firstKey}, "xx", CRITERIA::NOT_EQUAL);
$G_PUBLISH->AddContent('propeltable', 'paged-table', '{phpFolderName}/{phpClassName}List', $Criteria , array(),'');
G::RenderPage('publish');
$G_PUBLISH->AddContent('propeltable', 'paged-table', '{phpFolderName}/{phpClassName}List', $Criteria, array(), '');
G::RenderPage('publish');
}
catch ( Exception $e ) {
catch (Exception $e) {
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', 'blank' );
}
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
G::RenderPage('publish', 'blank');
}

View File

@@ -1,33 +1,36 @@
<?php
G::LoadClass('plugin');
G::LoadClass("plugin");
class {className}Plugin extends PMPlugin
{
function {className}Plugin($sNamespace, $sFilename = null) {
$res = parent::PMPlugin($sNamespace, $sFilename);
$this->sFriendlyName = '{className} Plugin';
$this->sDescription = 'Autogenerated plugin for class {className}';
$this->sPluginFolder = '{className}';
$this->sSetupPage = '{className}';
$this->iVersion = 0.78;
//$this->iPMVersion = 2425;
$this->aWorkspaces = null;
//$this->aWorkspaces = array('os');
return $res;
$res = parent::PMPlugin($sNamespace, $sFilename);
$this->sFriendlyName = "{className} Plugin";
$this->sDescription = "Autogenerated plugin for class {className}";
$this->sPluginFolder = "{className}";
$this->sSetupPage = "setup";
$this->iVersion = 1;
//$this->iPMVersion = 2425;
$this->aWorkspaces = null;
//$this->aWorkspaces = array("os");
return $res;
}
function setup() {
<!-- START BLOCK : changeLogo -->
$this->setCompanyLogo ('/plugin/{className}/{className}.png');
$this->setCompanyLogo("/plugin/{className}/{className}.png");
<!-- END BLOCK : changeLogo -->
<!-- START BLOCK : menu -->
$this->registerMenu( 'setup', 'menu{className}.php');
$this->registerMenu("processmaker", "menu{className}.php");
<!-- END BLOCK : menu -->
<!-- START BLOCK : menuCases -->
$this->registerMenu("cases", "menuCases{className}.php");
<!-- END BLOCK : menuCases -->
<!-- START BLOCK : ontransit -->
$this->registerMenu( 'processmaker', 'menu{className}OnTransit.php');
//$this->registerMenu("processmaker", "menu{className}OnTransit.php");
<!-- END BLOCK : ontransit -->
<!-- START BLOCK : externalStep -->
$this->registerStep( '{GUID}', 'step{className}', '{className} external step' );
$this->registerStep("{GUID}", "step{className}Application", "{className} external step");
<!-- END BLOCK : externalStep -->
<!-- START BLOCK : dashboard -->
$this->registerDashboard();
@@ -39,7 +42,7 @@ class {className}Plugin extends PMPlugin
$this->registerPmFunction();
<!-- END BLOCK : PmFunction -->
<!-- START BLOCK : redirectLogin -->
$this->redirectLogin( 'PROCESSMAKER_{className}', 'users/users_List' );
$this->redirectLogin("PROCESSMAKER_{className}", "users/users_List");
<!-- END BLOCK : redirectLogin -->
}
@@ -48,18 +51,18 @@ class {className}Plugin extends PMPlugin
$RBAC = RBAC::getSingleton() ;
$RBAC->initRBAC();
$roleData = array();
$roleData['ROL_UID'] = G::GenerateUniqueId();
$roleData['ROL_PARENT'] = '';
$roleData['ROL_SYSTEM'] = '00000000000000000000000000000002';
$roleData['ROL_CODE'] = 'PROCESSMAKER_{className}';
$roleData['ROL_CREATE_DATE'] = date('Y-m-d H:i:s');
$roleData['ROL_UPDATE_DATE'] = date('Y-m-d H:i:s');
$roleData['ROL_STATUS'] = '1';
$RBAC->createRole ( $roleData );
$RBAC->createPermision ('PM_{className}' );
$roleData["ROL_UID"] = G::GenerateUniqueId();
$roleData["ROL_PARENT"] = "";
$roleData["ROL_SYSTEM"] = "00000000000000000000000000000002";
$roleData["ROL_CODE"] = "PROCESSMAKER_{className}";
$roleData["ROL_CREATE_DATE"] = date("Y-m-d H:i:s");
$roleData["ROL_UPDATE_DATE"] = date("Y-m-d H:i:s");
$roleData["ROL_STATUS"] = "1";
$RBAC->createRole($roleData);
$RBAC->createPermision("PM_{className}");
<!-- END BLOCK : createPermission -->
}
}
$oPluginRegistry =& PMPluginRegistry::getSingleton();
$oPluginRegistry->registerPlugin('{className}', __FILE__);
$oPluginRegistry = &PMPluginRegistry::getSingleton();
$oPluginRegistry->registerPlugin("{className}", __FILE__);

View File

@@ -1,5 +1,5 @@
<?php
global $G_TMP_MENU;
$G_TMP_MENU->AddIdRawOption('{menuId}', '{phpClassName}/{phpClassName}List', "{className}" );
global $G_TMP_MENU;
$G_TMP_MENU->AddIdRawOption("{menuId}_MNU_01", "{phpClassName}/{phpClassName}Application", "{className} - application1");
?>

View File

@@ -0,0 +1,83 @@
<?php
global $G_TMP_MENU;
$tmpId = array();
$tmpTypes = array();
$tmpEnabled = array();
$tmpOptions = array(); //link
$tmpLabels = array();
$tmpJS = array();
$tmpIcons = array();
$tmpEClass = array();
$i = 0;
$k = 0;
foreach ($G_TMP_MENU->Id as $index => $value) {
if ($index == 3) { //Option CASES_INBOX
$tmpId[$index + $k] = "{menuId}_MNUCASE_01";
$tmpTypes[$index + $k] = "plugins";
$tmpEnabled[$index + $k] = 1;
$tmpOptions[$index + $k] = "../{phpClassName}/{phpClassName}Application"; //link
$tmpLabels[$index + $k] = "{className} application1";
$tmpJS[$index + $k] = null;
$tmpIcons[$index + $k] = null;
$tmpEClass[$index + $k] = null;
$k = 1;
}
$tmpId[$index + $k] = $G_TMP_MENU->Id[$index];
$tmpTypes[$index + $k] = $G_TMP_MENU->Types[$index];
$tmpEnabled[$index + $k] = $G_TMP_MENU->Enabled[$index];
$tmpOptions[$index + $k] = $G_TMP_MENU->Options[$index]; //link
$tmpLabels[$index + $k] = $G_TMP_MENU->Labels[$index];
$tmpJS[$index + $k] = $G_TMP_MENU->JS[$index];
$tmpIcons[$index + $k] = $G_TMP_MENU->Icons[$index];
$tmpEClass[$index + $k] = $G_TMP_MENU->ElementClass[$index];
$i = $index + $k;
}
$i = $i + 1;
$tmpId[$i] = "{menuId}_MNUCASE_02";
$tmpTypes[$i] = "blockHeader";
$tmpEnabled[$i] = 1;
$tmpOptions[$i] = null; //link
$tmpLabels[$i] = "{className} application2";
$tmpJS[$i] = null;
$tmpIcons[$i] = null;
$tmpEClass[$i] = null;
$i = $i + 1;
$tmpId[$i] = "{menuId}_MNUCASE_03";
$tmpTypes[$i] = "plugins";
$tmpEnabled[$i] = 1;
$tmpOptions[$i] = "../{phpClassName}/{phpClassName}Application2"; //link
$tmpLabels[$i] = "{className} application2";
$tmpJS[$i] = null;
$tmpIcons[$i] = null;
$tmpEClass[$i] = null;
$i = $i + 1;
$tmpId[$i] = "{menuId}_MNUCASE_04";
$tmpTypes[$i] = "blockHeaderNoChild";
$tmpEnabled[$i] = 1;
$tmpOptions[$i] = "../{phpClassName}/{phpClassName}Application3"; //link
$tmpLabels[$i] = "{className} application3";
$tmpJS[$i] = null;
$tmpIcons[$i] = null;
$tmpEClass[$i] = null;
$G_TMP_MENU->Id = $tmpId;
$G_TMP_MENU->Types = $tmpTypes;
$G_TMP_MENU->Enabled = $tmpEnabled;
$G_TMP_MENU->Options = $tmpOptions; //link
$G_TMP_MENU->Labels = $tmpLabels;
$G_TMP_MENU->JS = $tmpJS;
$G_TMP_MENU->Icons = $tmpIcons;
$G_TMP_MENU->ElementClass = $tmpEClass;
?>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm type="xmlform">
<TITLE type="title">
<en>Error</en>
</TITLE>
<MESSAGE type="caption" enableHTML="1">
<en/>
</MESSAGE>
</dynaForm>

View File

@@ -1,20 +1,19 @@
<?php
<!-- START BLOCK : plugin -->
require_once ( PATH_PLUGINS . '{pluginName}' . PATH_SEP . 'class.{pluginName}.php');
$pluginObj = new {pluginName}Class ();
require_once (PATH_PLUGINS . '{pluginName}' . PATH_SEP . 'class.{pluginName}.php');
$pluginObj = new {pluginName}Class();
<!-- END BLOCK : plugin -->
require_once ( "classes/model/{className}.php" );
require_once ("classes/model/{className}.php");
<!-- START BLOCK : dummy -->
//if exists the row in the database propel will update it, otherwise will insert.
// $tr = {phpClassName}Peer::retrieveByPK( {keylist} );
// if ( ( is_object ( $tr ) && get_class ($tr) == '{phpClassName}' ) ) {
// }
// else
// $fields = array();
// $fields['ITM_UID'] = $ItmUid;
//$tr = {phpClassName}Peer::retrieveByPK( {keylist} );
//if ((is_object($tr) && get_class($tr) == '{phpClassName}')) {
//}
//else
// $fields = array();
//$fields['ITM_UID'] = $ItmUid;
<!-- END BLOCK : dummy -->
<!-- START BLOCK : keys -->
@@ -30,8 +29,7 @@
$G_ID_MENU_SELECTED = '{menuId}';
$G_ID_SUB_MENU_SELECTED = '{menuId}';
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', '{phpFolderName}/{phpClassName}Edit', '', $fields, '{phpClassName}Save' );
G::RenderPage('publish');
$G_PUBLISH->AddContent('xmlform', 'xmlform', '{phpFolderName}/{phpClassName}Edit', '', $fields, '{phpClassName}Save');
G::RenderPage('publish');
?>

View File

@@ -2,73 +2,73 @@
<table cellpadding="0" cellspacing="0" border="0"><tr><td>
<div class="boxTop"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="pagedTableDefault">
<table id="pagedtable[{pagedTable_Id}]" name="pagedtable[{pagedTable_Name}]" border="0" cellspacing="0" cellpadding="0" class="Default">
<tr >
<td valign="top">
<span class='subtitle'>{title}</span>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<!-- START BLOCK : headerBlock -->
<tr><td class="headerContent">{content}</td></tr>
<!-- END BLOCK : headerBlock -->
</table>
<table id="table[{pagedTable_Id}]" name="table[{pagedTable_Name}]" cellspacing="0" cellpadding="0" width="100%" class="pagedTable">
<!-- END BLOCK : headBlock -->
<!-- START BLOCK : contentBlock -->
<script type="text/javascript">{pagedTable_JS}</script>
<table id="pagedtable[{pagedTable_Id}]" name="pagedtable[{pagedTable_Name}]" border="0" cellspacing="0" cellpadding="0" class="Default">
<tr>
<!-- START BLOCK : headers -->
<td class="pagedTableHeader"><img style="{displaySeparator}" src="/js/maborak/core/images/separatorTable.gif" /></td>
<td width="{width}" style="{align}" class="pagedTableHeader" >
<a href="{href}" onclick="{onclick}">{header}</a>
</td>
<!-- END BLOCK : headers -->
</tr>
<!-- START BLOCK : row -->
<tr class='{class}' onmouseover="setRowClass(this, 'RowPointer' )" onmouseout="setRowClass(this, '{class}')" >
<!-- START BLOCK : field -->
<td{classAttr}></td><td{classAttr}{alignAttr}>{value}</td>
<!-- END BLOCK : field -->
</tr>
<!-- END BLOCK : row -->
<!-- START BLOCK : rowTag -->
<!-- END BLOCK : rowTag -->
<td valign="top">
<!-- START BLOCK : norecords -->
<tr class='Row2'>
<td nowrap colspan="{columnCount}" align='center' >&nbsp;
{noRecordsFound}<br>&nbsp;
</td>
</tr>
<!-- END BLOCK : norecords -->
<span class='subtitle'>{title}</span>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<!-- START BLOCK : headerBlock -->
<tr><td class="headerContent">{content}</td></tr>
<!-- END BLOCK : headerBlock -->
</table>
<table id="table[{pagedTable_Id}]" name="table[{pagedTable_Name}]" cellspacing="0" cellpadding="0" width="100%" class="pagedTable">
<!-- END BLOCK : headBlock -->
<!-- START BLOCK : contentBlock -->
<script type="text/javascript">{pagedTable_JS}</script>
<tr>
<!-- START BLOCK : headers -->
<td class="pagedTableHeader"><img style="{displaySeparator}" src="/js/maborak/core/images/separatorTable.gif" /></td>
<td width="{width}" style="{align}" class="pagedTableHeader">
<a href="{href}" onclick="{onclick}">{header}</a>
</td>
<!-- END BLOCK : headers -->
</tr>
<!-- START BLOCK : row -->
<tr class='{class}' onmouseover="setRowClass(this, 'RowPointer')" onmouseout="setRowClass(this, '{class}')">
<!-- START BLOCK : field -->
<td{classAttr}></td><td{classAttr}{alignAttr}>{value}</td>
<!-- END BLOCK : field -->
</tr>
<!-- END BLOCK : row -->
<!-- START BLOCK : rowTag -->
<!-- END BLOCK : rowTag -->
<!-- START BLOCK : bottomFooter -->
<tr>
<td nowrap colspan="{columnCount}">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr class="pagedTableFooter">
<td width="110px" style="{indexStyle}">
{labels:ID_ROWS}&nbsp;{firstRow}-{lastRow}/{totalRows}&nbsp;
</td>
<!--<td style="text-align:center;{fastSearchStyle}"><!--{labels:ID_SEARCH}
<input type="text" class="FormField" onkeypress="if (event.keyCode===13){pagedTableId}.doFastSearch(this.value);if (event.keyCode===13)return false;" value="{fastSearchValue}" onfocus="this.select();" size="10" style="{fastSearchStyle}"/>
</td>-->
<td style="text-align:center;">
{first}{prev}{next}{last}
</td>
<td width="60px" style="text-align:right;padding-right:8px;{indexStyle}">{labels:ID_PAGE}&nbsp;{currentPage}/{totalPages}</td>
</tr>
</table>
</td>
</tr>
<!-- END BLOCK : bottomFooter -->
<!-- END BLOCK : contentBlock -->
<!-- START BLOCK : norecords -->
<tr class='Row2'>
<td nowrap colspan="{columnCount}" align='center' >&nbsp;
{noRecordsFound}<br>&nbsp;
</td>
</tr>
<!-- END BLOCK : norecords -->
<!-- START BLOCK : bottomFooter -->
<tr>
<td nowrap colspan="{columnCount}">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr class="pagedTableFooter">
<td width="110px" style="{indexStyle}">
{labels:ID_ROWS}&nbsp;{firstRow}-{lastRow}/{totalRows}&nbsp;
</td>
<!--<td style="text-align:center;{fastSearchStyle}"><!--{labels:ID_SEARCH}
<input type="text" class="FormField" onkeypress="if (event.keyCode===13){pagedTableId}.doFastSearch(this.value);if (event.keyCode===13)return false;" value="{fastSearchValue}" onfocus="this.select();" size="10" style="{fastSearchStyle}"/>
</td>-->
<td style="text-align:center;">
{first}{prev}{next}{last}
</td>
<td width="60px" style="text-align:right;padding-right:8px;{indexStyle}">{labels:ID_PAGE}&nbsp;{currentPage}/{totalPages}</td>
</tr>
</table>
</td>
</tr>
<!-- END BLOCK : bottomFooter -->
<!-- END BLOCK : contentBlock -->
<!-- START BLOCK : closeBlock -->
</table>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div class="boxBottom"><div class="a"></div><div class="b"></div><div class="c"></div></div>
</td></tr></table>

View File

@@ -26,7 +26,7 @@ propel.datadump.mapper.from = *schema.xml
propel.datadump.mapper.to = *data.xml
; builder settings
;_propel.builder.peer.class = addon.propel.builder.SfPeerBuilder
;_propel.builder.peer.class = addon.propel.builder.SfPeerBuilder
;propel.builder.object.class = addon.propel.builder.SfObjectBuilder
;propel.builder.objectstub.class = addon.propel.builder.SfExtensionObjectBuilder

View File

@@ -26,7 +26,7 @@ propel.datadump.mapper.from = *schema.xml
propel.datadump.mapper.to = *data.xml
; builder settings
;_propel.builder.peer.class = addon.propel.builder.SfPeerBuilder
;_propel.builder.peer.class = addon.propel.builder.SfPeerBuilder
;propel.builder.object.class = addon.propel.builder.SfObjectBuilder
;propel.builder.objectstub.class = addon.propel.builder.SfExtensionObjectBuilder

View File

@@ -1,12 +1,13 @@
<?xml version="1.0"?>
<dynaForm type="pagetable" >
<USR_UID type="text" align="left" colWidth="80">
<en>Uid</en>
</USR_UID>
<USR_NAME type="text" align="left" colWidth="80">
<en>Name</en>
</USR_NAME>
<USR_FIRSTNAME type="text" align="left" colWidth="80">
<en>First Name</en>
</USR_FIRSTNAME>
@@ -22,5 +23,4 @@
<USR_ROLE type="text" align="left" colWidth="80">
<en>Role</en>
</USR_ROLE>
</dynaForm>

View File

@@ -1,53 +1,52 @@
<?php
try {
$form = $_POST['form'];
<!-- START BLOCK : fields2 -->
${phpName} = $form['{name}'];
<?php
try {
$form = $_POST['form'];
<!-- START BLOCK : fields2 -->
${phpName} = $form['{name}'];
<!-- END BLOCK : fields2 -->
<!-- START BLOCK : plugin -->
require_once ( PATH_PLUGINS . '{pluginName}' . PATH_SEP . 'class.{pluginName}.php');
$pluginObj = new {pluginName}Class ();
require_once (PATH_PLUGINS . '{pluginName}' . PATH_SEP . 'class.{pluginName}.php');
$pluginObj = new {pluginName}Class();
<!-- END BLOCK : plugin -->
require_once ( "classes/model/{className}.php" );
require_once ("classes/model/{className}.php");
//if exists the row in the database propel will update it, otherwise will insert.
$tr = {className}Peer::retrieveByPK( {keylist} );
if ( ! ( is_object ( $tr ) && get_class ($tr) == '{className}' ) ) {
$tr = new {className}();
}
//if exists the row in the database propel will update it, otherwise will insert.
$tr = {className}Peer::retrieveByPK( {keylist} );
if (!(is_object($tr) && get_class($tr) == '{className}')) {
$tr = new {className}();
}
<!-- START BLOCK : fields -->
$tr->set{phpName}( ${phpName} );
$tr->set{phpName}( ${phpName} );
<!-- END BLOCK : fields -->
if ($tr->validate() ) {
// we save it, since we get no validation errors, or do whatever else you like.
$res = $tr->save();
}
else {
// Something went wrong. We can now get the validationFailures and handle them.
$msg = '';
$validationFailuresArray = $tr->getValidationFailures();
foreach($validationFailuresArray as $objValidationFailure) {
$msg .= $objValidationFailure->getMessage() . "<br/>";
}
//return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $msg );
}
//return array ( 'codError' => 0, 'rowsAffected' => $res, 'message' => '');
if ($tr->validate()) {
//we save it, since we get no validation errors, or do whatever else you like.
$res = $tr->save();
}
else {
//Something went wrong. We can now get the validationFailures and handle them.
$msg = '';
$validationFailuresArray = $tr->getValidationFailures();
foreach($validationFailuresArray as $objValidationFailure) {
$msg .= $objValidationFailure->getMessage() . "<br/>";
}
//return array('codError' => -100, 'rowsAffected' => 0, 'message' => $msg);
}
//return array('codError' => 0, 'rowsAffected' => $res, 'message' => '');
//to do: uniform coderror structures for all classes
//if ( $res['codError'] < 0 ) {
// G::SendMessageText ( $res['message'] , 'error' );
//}
G::Header('location: {phpClassName}List');
//if ($res['codError'] < 0) {
// G::SendMessageText($res['message'] , 'error');
//}
G::Header('location: {phpClassName}List');
}
catch ( Exception $e ) {
catch (Exception $e) {
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', 'blank' );
}
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
G::RenderPage('publish', 'blank');
}

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm
name="{className} Setup Form"
type="xmlform"
labelwidth="200"
width="600"
>
<TITLE1 type="title" group="1">
<en>{className} plugin setup page</en>
</TITLE1>
<SUBTITLE1 type="subtitle" group="1">
<en>Edit this page for customize the plugin</en>
</SUBTITLE1>
<BTN_SUBMIT type="submit">
<en>Save</en>
</BTN_SUBMIT>
</dynaForm>

View File

@@ -0,0 +1 @@
<div id="divMain" style="margin: 1em;"></div>

View File

@@ -0,0 +1,99 @@
Ext.namespace("step{className}");
step{className}.application = {
init:function(){
storeApplicationProcess = function () {
var myMask = new Ext.LoadMask(Ext.getBody(), {msg:"Load application data..."});
myMask.show();
Ext.Ajax.request({
url: "../{className}/step{className}ApplicationAjax",
method: "POST",
success:function (result, request) {
storeApplication.loadData(Ext.util.JSON.decode(result.responseText));
myMask.hide();
},
failure:function (result, request) {
myMask.hide();
Ext.MessageBox.alert("Alert", "Failure application data load");
}
});
};
//stores
var storeApplication = new Ext.data.Store({
proxy:new Ext.data.HttpProxy({
url: "../{className}/step{className}ApplicationAjax",
method: "POST"
}),
//baseParams: ,
reader:new Ext.data.JsonReader({
root: "resultRoot",
totalProperty: "resultTotal",
fields: [{name: "VARIABLE"},
{name: "VALUE"}
]
}),
//autoLoad: true, //First call
listeners:{
beforeload:function (store) {
}
}
});
//
var cmodel = new Ext.grid.ColumnModel({
defaults: {
width:50,
sortable:true
},
columns:[{header: "Variable", dataIndex: "VARIABLE", width: 25},
{header: "Value", dataIndex: "VALUE"}
]
});
var grdpnlApplication = new Ext.grid.GridPanel({
id: "grdpnlUser",
store: storeApplication,
colModel: cmodel,
columnLines: true,
viewConfig: {forceFit: true},
enableColumnResize: true,
enableHdMenu: false, //Menu of the column
tbar: [new Ext.Action({
text: "&nbsp;< " + CONFIG.previousStepLabel + "&nbsp;",
handler: function() {
window.location.href = CONFIG.previousStep;
}
}),
"->",
new Ext.Action({
text: "&nbsp;" + CONFIG.nextStepLabel + " >&nbsp;",
handler: function() {
window.location.href = CONFIG.nextStep;
}
})
],
style: "margin: 0 auto 0 auto;",
width: 550,
height: 350,
title: "Application data",
renderTo: "divMain"
});
//Initialize events
storeApplicationProcess();
}
}
Ext.onReady(step{className}.application.init, step{className}.application);

View File

@@ -0,0 +1,27 @@
<?php
try {
global $Fields;
$oHeadPublisher = &headPublisher::getSingleton();
//SYS_SYS //Workspace name
//PROCESS //Process UID
//APPLICATION //Case UID
//INDEX //Number delegation
$config = array();
$config["previousStep"] = $Fields["APP_DATA"]["__DYNAFORM_OPTIONS"]["PREVIOUS_STEP"];
$config["previousStepLabel"] = $Fields["APP_DATA"]["__DYNAFORM_OPTIONS"]["PREVIOUS_STEP_LABEL"];
$config["nextStep"] = $Fields["APP_DATA"]["__DYNAFORM_OPTIONS"]["NEXT_STEP"];
$config["nextStepLabel"] = $Fields["APP_DATA"]["__DYNAFORM_OPTIONS"]["NEXT_STEP_LABEL"];
$oHeadPublisher->addContent("{className}/step{className}Application"); //Adding a html file .html.
$oHeadPublisher->addExtJsScript("{className}/step{className}Application", false); //Adding a javascript file .js
$oHeadPublisher->assign("CONFIG", $config);
G::RenderPage("publish", "extJs");
exit(0);
} catch (Exception $e) {
echo $e->getMessage();
exit(0);
}
?>

View File

@@ -0,0 +1,26 @@
<?php
//require_once ("classes/model/class.case.php");
G::LoadClass("case");
try {
//SYS_SYS //Workspace name
//PROCESS //Process UID
//APPLICATION //Case UID
//INDEX //Number delegation
$oApp = new Cases();
$aFields = $oApp->loadCase($_SESSION["APPLICATION"]);
$aData = $aFields["APP_DATA"];
$aResult = array();
foreach ($aData as $index => $value) {
$aResult[] = array("VARIABLE" => $index, "VALUE" => $value);
}
//echo "{success: " . true . ", resultTotal: " . count($aResult) . ", resultRoot: " . G::json_encode($aResult) . "}";
echo json_encode(array("success" => true, "resultTotal" => count($aResult), "resultRoot" => $aResult));
} catch (Exception $e) {
echo null;
}
?>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="{className}" width="600" mode="edit" enableTemplate="0" border="0">
<title1 type="title" >
<en>{className} form</en>
</title1>
@@ -19,5 +18,4 @@
<BTN_SUBMIT type="submit" >
<en>save</en>
</BTN_SUBMIT>
</dynaForm>

View File

@@ -1,23 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="{className}" width="600" mode="edit" enableTemplate="0" border="0">
<title1 type="title" >
<title1 type="title">
<en>Delete {className}</en>
</title1>
<!-- START BLOCK : keys -->
<LABEL_{name} type="caption" colWidth='{size}' >
<LABEL_{name} type="caption" colWidth='{size}'>
<en>{label}</en>
</LABEL_{name}>
<{name} type="hidden" colWidth='{size}' >
<{name} type="hidden" colWidth='{size}'>
</{name}>
<!-- END BLOCK : keys -->
<!-- END BLOCK : keys -->
<BTN_SUBMIT type="submit" >
<BTN_SUBMIT type="submit">
<en>delete</en>
</BTN_SUBMIT>
</dynaForm>

View File

@@ -1,31 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="{className}" width="600" mode="edit" enableTemplate="0" border="0">
<title1 type="title" >
<title1 type="title">
<en>{className} form</en>
</title1>
<!-- START BLOCK : keys -->
<{name} type="hidden" colWidth='{size}' >
<{name} type="hidden" colWidth='{size}'>
<en>{label}</en>
</{name}>
<!-- END BLOCK : keys -->
<!-- START BLOCK : onlyFields -->
<{name} type="{type}" size='{size}' maxlength='{maxlength}' >
<{name} type="{type}" size='{size}' maxlength='{maxlength}'>
<en>{label}
<!-- START BLOCK : values -->
<option name="{value}">{label}</option>
<!-- END BLOCK : values -->
<!-- END BLOCK : values -->
</en>
</{name}>
<!-- END BLOCK : onlyFields -->
<!-- END BLOCK : onlyFields -->
<BTN_SUBMIT type="submit" >
<BTN_SUBMIT type="submit">
<en>save</en>
</BTN_SUBMIT>
</dynaForm>

View File

@@ -2,22 +2,20 @@
<dynaForm name="{className}" width="100%" type="pagedtable"
sql="SELECT * from {tableName} "
sqlConnection=""
menu = "{phpFolderName}/{phpClassName}Options"
menu="{phpFolderName}/{phpClassName}Options"
>
<!-- START BLOCK : onlyFields -->
<{name} type="text" colWidth='{size}' >
<{name} type="text" colWidth='{size}'>
<en>{label}</en>
</{name}>
<!-- END BLOCK : onlyFields -->
<!-- END BLOCK : onlyFields -->
<LINK type="link" colWidth="60" titleAlign="left" align="left" link='{phpClassName}Edit?id={primaryKey}' >
<LINK type="link" colWidth="60" titleAlign="left" align="left" link='{phpClassName}Edit?id={primaryKey}'>
<en>Edit</en>
</LINK >
</LINK>
<LINK2 type="link" colWidth="60" titleAlign="left" align="left" link='{phpClassName}Delete?id={primaryKey}' >
<LINK2 type="link" colWidth="60" titleAlign="left" align="left" link='{phpClassName}Delete?id={primaryKey}'>
<en>Delete</en>
</LINK2 >
</dynaForm>

View File

@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm type="xmlmenu">
<{phpClassName}New type="private" defaultValue="../{phpClassName}/{phpClassName}New"/>
<MNU_NEW type="link" label="New" value='' link="@G::encryptLink(@#{phpClassName}New)" colAlign="left" colWidth="85"></MNU_NEW>
</dynaForm>