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

@@ -5,7 +5,6 @@
*/
class {className}Class extends PMPlugin {
function __construct() {
set_include_path(
PATH_PLUGINS . '{className}' . PATH_SEPARATOR .
@@ -17,6 +16,14 @@
{
}
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() {
@@ -89,7 +96,6 @@
$chart->render();
}
<!-- END BLOCK : dashboard -->
<!-- START BLOCK : report -->
@@ -160,7 +166,6 @@
G::RenderPage('publish');
return 1;
}
<!-- END BLOCK : report -->
}
?>

View File

@@ -1,5 +1,4 @@
<?php
//to do: improve the way to pass two or more parameters in the paged-table (link)
$aux = explode('|', $_GET['id']);
@@ -31,7 +30,6 @@
$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');

View File

@@ -1,6 +1,5 @@
<?php
try {
$form = $_POST['form'];
<!-- START BLOCK : keys -->
${phpName} = $form['{name}'];
@@ -20,7 +19,6 @@
}
G::Header('location: {phpClassName}List');
}
catch (Exception $e) {
$G_PUBLISH = new Publisher;

View File

@@ -1,5 +1,4 @@
<?php
$aux = explode('|', isset($_GET['id'])? $_GET['id'] : '');
<!-- START BLOCK : keys -->
${phpName} = str_replace('"', '', $aux[{index}]);
@@ -27,7 +26,6 @@
$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');

View File

@@ -26,7 +26,6 @@
$G_PUBLISH->AddContent('propeltable', 'paged-table', '{phpFolderName}/{phpClassName}List', $Criteria, array(), '');
G::RenderPage('publish');
}
catch (Exception $e) {
$G_PUBLISH = new Publisher;

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->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');
//$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';
$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}' );
$RBAC->createPermision("PM_{className}");
<!-- END BLOCK : createPermission -->
}
}
$oPluginRegistry = &PMPluginRegistry::getSingleton();
$oPluginRegistry->registerPlugin('{className}', __FILE__);
$oPluginRegistry->registerPlugin("{className}", __FILE__);

View File

@@ -1,5 +1,5 @@
<?php
global $G_TMP_MENU;
$G_TMP_MENU->AddIdRawOption('{menuId}', '{phpClassName}/{phpClassName}List', "{className}" );
$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,5 +1,4 @@
<?php
<!-- START BLOCK : plugin -->
require_once (PATH_PLUGINS . '{pluginName}' . PATH_SEP . 'class.{pluginName}.php');
$pluginObj = new {pluginName}Class();
@@ -30,7 +29,6 @@
$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');

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

@@ -42,7 +42,6 @@
// G::SendMessageText($res['message'] , 'error');
//}
G::Header('location: {phpClassName}List');
}
catch (Exception $e) {
$G_PUBLISH = new Publisher;

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,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="{className}" width="600" mode="edit" enableTemplate="0" border="0">
<title1 type="title">
<en>Delete {className}</en>
</title1>
<!-- START BLOCK : keys -->
<LABEL_{name} type="caption" colWidth='{size}'>
<en>{label}</en>
@@ -19,5 +17,4 @@
<BTN_SUBMIT type="submit">
<en>delete</en>
</BTN_SUBMIT>
</dynaForm>

View File

@@ -1,11 +1,9 @@
<?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>
<!-- START BLOCK : keys -->
<{name} type="hidden" colWidth='{size}'>
<en>{label}</en>
@@ -27,5 +25,4 @@
<BTN_SUBMIT type="submit">
<en>save</en>
</BTN_SUBMIT>
</dynaForm>

View File

@@ -4,7 +4,6 @@
sqlConnection=""
menu="{phpFolderName}/{phpClassName}Options"
>
<!-- START BLOCK : onlyFields -->
<{name} type="text" colWidth='{size}'>
<en>{label}</en>
@@ -19,5 +18,4 @@
<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>