Last changes for the release of November 15th
This commit is contained in:
@@ -4,7 +4,97 @@ require_once 'interfaces/dashletInterface.php';
|
||||
|
||||
class dashletOpenVSCompleted implements DashletInterface {
|
||||
|
||||
function setup($config) {
|
||||
private $value;
|
||||
private $open;
|
||||
private $completed;
|
||||
private $centerLabel;
|
||||
private $redFrom;
|
||||
private $redTo;
|
||||
private $yellowFrom;
|
||||
private $yellowTo;
|
||||
private $greenFrom;
|
||||
private $greenTo;
|
||||
|
||||
public static function getAdditionalFields() {
|
||||
$additionalFields = array();
|
||||
|
||||
$redFrom = new stdclass();
|
||||
$redFrom->xtype = 'numberfield';
|
||||
$redFrom->name = 'DAS_RED_FROM';
|
||||
$redFrom->fieldLabel = 'Red Starts In';
|
||||
$redFrom->width = 50;
|
||||
$redFrom->maxLength = 3;
|
||||
$redFrom->maxValue = 100;
|
||||
$redFrom->minValue = 0;
|
||||
$redFrom->allowBlank = false;
|
||||
$additionalFields[] = $redFrom;
|
||||
|
||||
$redTo = new stdclass();
|
||||
$redTo->xtype = 'numberfield';
|
||||
$redTo->name = 'DAS_RED_TO';
|
||||
$redTo->fieldLabel = 'Red Ends In';
|
||||
$redTo->width = 50;
|
||||
$redTo->maxLength = 3;
|
||||
$redTo->maxValue = 100;
|
||||
$redTo->minValue = 0;
|
||||
$redTo->allowBlank = false;
|
||||
$additionalFields[] = $redTo;
|
||||
|
||||
$yellowFrom = new stdclass();
|
||||
$yellowFrom->xtype = 'numberfield';
|
||||
$yellowFrom->name = 'DAS_YELLOW_FROM';
|
||||
$yellowFrom->fieldLabel = 'Yellow Starts In';
|
||||
$yellowFrom->width = 50;
|
||||
$yellowFrom->maxLength = 3;
|
||||
$yellowFrom->maxValue = 100;
|
||||
$yellowFrom->minValue = 0;
|
||||
$yellowFrom->allowBlank = false;
|
||||
$additionalFields[] = $yellowFrom;
|
||||
|
||||
$yellowTo = new stdclass();
|
||||
$yellowTo->xtype = 'numberfield';
|
||||
$yellowTo->name = 'DAS_YELLOW_TO';
|
||||
$yellowTo->fieldLabel = 'Yellow Ends In';
|
||||
$yellowTo->width = 50;
|
||||
$yellowTo->maxLength = 3;
|
||||
$yellowTo->maxValue = 100;
|
||||
$yellowTo->minValue = 0;
|
||||
$yellowTo->allowBlank = false;
|
||||
$additionalFields[] = $yellowTo;
|
||||
|
||||
$greenFrom = new stdclass();
|
||||
$greenFrom->xtype = 'numberfield';
|
||||
$greenFrom->name = 'DAS_GREEN_FROM';
|
||||
$greenFrom->fieldLabel = 'Green Starts In';
|
||||
$greenFrom->width = 50;
|
||||
$greenFrom->maxLength = 3;
|
||||
$greenFrom->maxValue = 100;
|
||||
$greenFrom->minValue = 0;
|
||||
$greenFrom->allowBlank = false;
|
||||
$additionalFields[] = $greenFrom;
|
||||
|
||||
$greenTo = new stdclass();
|
||||
$greenTo->xtype = 'numberfield';
|
||||
$greenTo->name = 'DAS_GREEN_TO';
|
||||
$greenTo->fieldLabel = 'Green Ends In';
|
||||
$greenTo->width = 50;
|
||||
$greenTo->maxLength = 3;
|
||||
$greenTo->maxValue = 100;
|
||||
$greenTo->minValue = 0;
|
||||
$greenTo->allowBlank = false;
|
||||
$additionalFields[] = $greenTo;
|
||||
|
||||
return $additionalFields;
|
||||
}
|
||||
|
||||
public function setup($config) {
|
||||
$this->redFrom = isset($config['DAS_RED_FROM']) ? (int) $config['DAS_RED_FROM'] : 0;
|
||||
$this->redTo = isset($config['DAS_RED_TO']) ? (int) $config['DAS_RED_TO'] : 30;
|
||||
$this->yellowFrom = isset($config['DAS_YELLOW_FROM']) ? (int) $config['DAS_YELLOW_FROM'] : 30;
|
||||
$this->yellowTo = isset($config['DAS_YELLOW_TO']) ? (int) $config['DAS_YELLOW_TO'] : 50;
|
||||
$this->greenFrom = isset($config['DAS_GREEN_FROM']) ? (int) $config['DAS_GREEN_FROM'] : 50;
|
||||
$this->greenTo = isset($config['DAS_GREEN_TO']) ? (int) $config['DAS_GREEN_TO'] : 100;
|
||||
|
||||
$thisYear = date('Y');
|
||||
$lastYear = $thisYear -1;
|
||||
$thisMonth = date('M');
|
||||
@@ -35,12 +125,10 @@ class dashletOpenVSCompleted implements DashletInterface {
|
||||
case 'YESTERDAY' : $dateIni = $yesterdayIni; $dateEnd = $yesterdayEnd; break;
|
||||
case 'THIS_WEEK' : $dateIni = $thisWeekIni; $dateEnd = $thisWeekEnd; break;
|
||||
case 'PREVIOUS_WEEK' : $dateIni = $previousWeekIni; $dateEnd = $previousWeekEnd; break;
|
||||
|
||||
case 'THIS_MONTH' : $dateIni = $todayIni; $dateEnd = $todayEnd; break;
|
||||
case 'PREVIOUS_MONTH' : $dateIni = $todayIni; $dateEnd = $todayEnd; break;
|
||||
case 'THIS_QUARTER' : $dateIni = $todayIni; $dateEnd = $todayEnd; break;
|
||||
case 'PREVIOUS_QUARTER' : $dateIni = $todayIni; $dateEnd = $todayEnd; break;
|
||||
|
||||
case 'THIS_YEAR' : $dateIni = $thisYearIni; $dateEnd = $thisYearEnd; break;
|
||||
case 'PREVIOUS_YEAR' : $dateIni = $previousYearIni; $dateEnd = $previousYearEnd; break;
|
||||
}
|
||||
@@ -85,59 +173,18 @@ class dashletOpenVSCompleted implements DashletInterface {
|
||||
return true;
|
||||
}
|
||||
|
||||
function getAdditionalFields() {
|
||||
$additionalFields = array();
|
||||
$greenFrom = new stdclass();
|
||||
$greenFrom->xtype = 'textfield';
|
||||
$greenFrom->name = 'DAS_RED_FROM';
|
||||
$greenFrom->fieldLabel = 'Red Starts In';
|
||||
$greenFrom->width = 50;
|
||||
$additionalFields[] = $greenFrom;
|
||||
$greenFrom = new stdclass();
|
||||
$greenFrom->xtype = 'textfield';
|
||||
$greenFrom->name = 'DAS_RED_TO';
|
||||
$greenFrom->fieldLabel = 'Red Ends In';
|
||||
$greenFrom->width = 50;
|
||||
$additionalFields[] = $greenFrom;
|
||||
$greenFrom = new stdclass();
|
||||
$greenFrom->xtype = 'textfield';
|
||||
$greenFrom->name = 'DAS_YELLOW_FROM';
|
||||
$greenFrom->fieldLabel = 'Yellow Starts In';
|
||||
$greenFrom->width = 50;
|
||||
$additionalFields[] = $greenFrom;
|
||||
$greenFrom = new stdclass();
|
||||
$greenFrom->xtype = 'textfield';
|
||||
$greenFrom->name = 'DAS_YELLOW_TO';
|
||||
$greenFrom->fieldLabel = 'Yellow Ends In';
|
||||
$greenFrom->width = 50;
|
||||
$additionalFields[] = $greenFrom;
|
||||
$greenFrom = new stdclass();
|
||||
$greenFrom->xtype = 'textfield';
|
||||
$greenFrom->name = 'DAS_GREEN_FROM';
|
||||
$greenFrom->fieldLabel = 'Green Starts In';
|
||||
$greenFrom->width = 50;
|
||||
$additionalFields[] = $greenFrom;
|
||||
$greenFrom = new stdclass();
|
||||
$greenFrom->xtype = 'textfield';
|
||||
$greenFrom->name = 'DAS_GREEN_TO';
|
||||
$greenFrom->fieldLabel = 'Green Ends In';
|
||||
$greenFrom->width = 50;
|
||||
$additionalFields[] = $greenFrom;
|
||||
return $additionalFields;
|
||||
}
|
||||
|
||||
function render ($width = 300) {
|
||||
public function render ($width = 300) {
|
||||
G::LoadClass('pmGauge');
|
||||
$g = new pmGauge();
|
||||
$g->w = $width;
|
||||
$g->value = $this->value;
|
||||
|
||||
$g->greenFrom = 50;
|
||||
$g->greenTo = 100;
|
||||
$g->yellowFrom = 30;
|
||||
$g->yellowTo = 50;
|
||||
$g->redFrom = 0;
|
||||
$g->redTo = 30;
|
||||
$g->redFrom = $this->redFrom;
|
||||
$g->redTo = $this->redTo;
|
||||
$g->yellowFrom = $this->yellowFrom;
|
||||
$g->yellowTo = $this->yellowTo;
|
||||
$g->greenFrom = $this->greenFrom;
|
||||
$g->greenTo = $this->greenTo;
|
||||
|
||||
$g->centerLabel = $this->centerLabel;
|
||||
$g->open = $this->open;
|
||||
|
||||
@@ -12,6 +12,19 @@ class PMDashlet extends DashletInstance implements DashletInterface {
|
||||
|
||||
// Interface functions
|
||||
|
||||
public static function getAdditionalFields() {
|
||||
try {
|
||||
//Change this in the next release
|
||||
$className = 'dashletOpenVSCompleted';
|
||||
G::LoadClass($className);
|
||||
eval("\$additionalFields = $className::getAdditionalFields();");
|
||||
return $additionalFields;
|
||||
}
|
||||
catch (Exception $error) {die('xxx');
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
|
||||
public function setup($dasInsUid) {
|
||||
try {
|
||||
$this->dashletInstance = $this->loadDashletInstance($dasInsUid);
|
||||
@@ -36,17 +49,6 @@ class PMDashlet extends DashletInstance implements DashletInterface {
|
||||
}
|
||||
}
|
||||
|
||||
public function getAdditionalFields() {
|
||||
try {
|
||||
//Change this in the next release
|
||||
G::LoadClass('dashletOpenVSCompleted');
|
||||
return dashletOpenVSCompleted::getAdditionalFields();
|
||||
}
|
||||
catch (Exception $error) {
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
|
||||
// Getter and Setters
|
||||
|
||||
public function getDashletInstance() {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
interface DashletInterface {
|
||||
|
||||
public static function getAdditionalFields();
|
||||
public function setup($dasInsUid);
|
||||
public function render();
|
||||
public function getAdditionalFields();
|
||||
|
||||
}
|
||||
@@ -46,7 +46,7 @@ class Dashboard extends Controller {
|
||||
else {
|
||||
$width = $_REQUEST['w'];
|
||||
}
|
||||
$this->pmDashlet->render( $width);
|
||||
$this->pmDashlet->render($width);
|
||||
}
|
||||
catch (Exception $error) {
|
||||
//ToDo: Render a image with the error message
|
||||
|
||||
@@ -1 +1 @@
|
||||
a:2:{i:0;a:5:{s:2:"db";s:2:"wf";s:5:"table";s:7:"DASHLET";s:4:"keys";a:1:{i:0;s:7:"DAS_UID";}s:4:"data";a:8:{i:0;a:3:{s:5:"field";s:7:"DAS_UID";s:4:"type";s:4:"text";s:5:"value";s:32:"00000000000000000000000000000001";}i:1;a:3:{s:5:"field";s:9:"DAS_CLASS";s:4:"type";s:4:"text";s:5:"value";s:22:"dashletOpenVSCompleted";}i:2;a:3:{s:5:"field";s:9:"DAS_TITLE";s:4:"type";s:4:"text";s:5:"value";s:29:"Open Cases VS Completed Cases";}i:3;a:3:{s:5:"field";s:15:"DAS_DESCRIPTION";s:4:"type";s:4:"text";s:5:"value";s:29:"Open Cases VS Completed Cases";}i:4;a:3:{s:5:"field";s:11:"DAS_VERSION";s:4:"type";s:4:"text";s:5:"value";s:3:"1.0";}i:5;a:3:{s:5:"field";s:15:"DAS_CREATE_DATE";s:4:"type";s:4:"date";s:5:"value";s:20:" 2011-10-28 00:00:00";}i:6;a:3:{s:5:"field";s:15:"DAS_UPDATE_DATE";s:4:"type";s:4:"date";s:5:"value";s:20:" 2011-10-28 00:00:00";}i:7;a:3:{s:5:"field";s:10:"DAS_STATUS";s:4:"type";s:3:"int";s:5:"value";i:1;}}s:6:"action";i:4;}i:1;a:5:{s:2:"db";s:2:"wf";s:5:"table";s:16:"DASHLET_INSTANCE";s:4:"keys";a:1:{i:0;s:11:"DAS_INS_UID";}s:4:"data";a:14:{i:0;a:3:{s:5:"field";s:11:"DAS_INS_UID";s:4:"type";s:4:"text";s:5:"value";s:32:"00000000000000000000000000000001";}i:1;a:3:{s:5:"field";s:7:"DAS_UID";s:4:"type";s:4:"text";s:5:"value";s:32:"00000000000000000000000000000001";}i:2;a:3:{s:5:"field";s:12:"DAS_INS_TYPE";s:4:"type";s:4:"text";s:5:"value";s:10:"OPEN_CASES";}i:3;a:3:{s:5:"field";s:20:"DAS_INS_CONTEXT_TIME";s:4:"type";s:4:"text";s:5:"value";s:9:"THIS_YEAR";}i:4;a:3:{s:5:"field";s:18:"DAS_INS_START_DATE";s:4:"type";s:4:"text";s:5:"value";N;}i:5;a:3:{s:5:"field";s:16:"DAS_INS_END_DATE";s:4:"type";s:4:"text";s:5:"value";N;}i:6;a:3:{s:5:"field";s:18:"DAS_INS_OWNER_TYPE";s:4:"type";s:4:"text";s:5:"value";s:4:"USER";}i:7;a:3:{s:5:"field";s:17:"DAS_INS_OWNER_UID";s:4:"type";s:4:"text";s:5:"value";s:32:"00000000000000000000000000000001";}i:8;a:3:{s:5:"field";s:17:"DAS_INS_PROCESSES";s:4:"type";s:4:"text";s:5:"value";N;}i:9;a:3:{s:5:"field";s:13:"DAS_INS_TASKS";s:4:"type";s:4:"text";s:5:"value";N;}i:10;a:3:{s:5:"field";s:29:"DAS_INS_ADDITIONAL_PROPERTIES";s:4:"type";s:4:"text";s:5:"value";N;}i:11;a:3:{s:5:"field";s:19:"DAS_INS_CREATE_DATE";s:4:"type";s:4:"date";s:5:"value";s:19:"2011-11-09 00:00:00";}i:12;a:3:{s:5:"field";s:19:"DAS_INS_UPDATE_DATE";s:4:"type";s:4:"date";s:5:"value";s:19:"2011-11-09 00:00:00";}i:13;a:3:{s:5:"field";s:14:"DAS_INS_STATUS";s:4:"type";s:3:"int";s:5:"value";i:1;}}s:6:"action";i:4;}}
|
||||
a:2:{i:0;a:5:{s:2:"db";s:2:"wf";s:5:"table";s:7:"DASHLET";s:4:"keys";a:1:{i:0;s:7:"DAS_UID";}s:4:"data";a:8:{i:0;a:3:{s:5:"field";s:7:"DAS_UID";s:4:"type";s:4:"text";s:5:"value";s:32:"00000000000000000000000000000001";}i:1;a:3:{s:5:"field";s:9:"DAS_CLASS";s:4:"type";s:4:"text";s:5:"value";s:22:"dashletOpenVSCompleted";}i:2;a:3:{s:5:"field";s:9:"DAS_TITLE";s:4:"type";s:4:"text";s:5:"value";s:29:"Open Cases VS Completed Cases";}i:3;a:3:{s:5:"field";s:15:"DAS_DESCRIPTION";s:4:"type";s:4:"text";s:5:"value";s:29:"Open Cases VS Completed Cases";}i:4;a:3:{s:5:"field";s:11:"DAS_VERSION";s:4:"type";s:4:"text";s:5:"value";s:3:"1.0";}i:5;a:3:{s:5:"field";s:15:"DAS_CREATE_DATE";s:4:"type";s:4:"date";s:5:"value";s:20:" 2011-10-28 00:00:00";}i:6;a:3:{s:5:"field";s:15:"DAS_UPDATE_DATE";s:4:"type";s:4:"date";s:5:"value";s:20:" 2011-10-28 00:00:00";}i:7;a:3:{s:5:"field";s:10:"DAS_STATUS";s:4:"type";s:3:"int";s:5:"value";i:1;}}s:6:"action";i:4;}i:1;a:5:{s:2:"db";s:2:"wf";s:5:"table";s:16:"DASHLET_INSTANCE";s:4:"keys";a:1:{i:0;s:11:"DAS_INS_UID";}s:4:"data";a:14:{i:0;a:3:{s:5:"field";s:11:"DAS_INS_UID";s:4:"type";s:4:"text";s:5:"value";s:32:"00000000000000000000000000000001";}i:1;a:3:{s:5:"field";s:7:"DAS_UID";s:4:"type";s:4:"text";s:5:"value";s:32:"00000000000000000000000000000001";}i:2;a:3:{s:5:"field";s:12:"DAS_INS_TYPE";s:4:"type";s:4:"text";s:5:"value";s:10:"OPEN_CASES";}i:3;a:3:{s:5:"field";s:20:"DAS_INS_CONTEXT_TIME";s:4:"type";s:4:"text";s:5:"value";s:9:"THIS_YEAR";}i:4;a:3:{s:5:"field";s:18:"DAS_INS_START_DATE";s:4:"type";s:4:"text";s:5:"value";N;}i:5;a:3:{s:5:"field";s:16:"DAS_INS_END_DATE";s:4:"type";s:4:"text";s:5:"value";N;}i:6;a:3:{s:5:"field";s:18:"DAS_INS_OWNER_TYPE";s:4:"type";s:4:"text";s:5:"value";s:4:"USER";}i:7;a:3:{s:5:"field";s:17:"DAS_INS_OWNER_UID";s:4:"type";s:4:"text";s:5:"value";s:32:"00000000000000000000000000000001";}i:8;a:3:{s:5:"field";s:17:"DAS_INS_PROCESSES";s:4:"type";s:4:"text";s:5:"value";N;}i:9;a:3:{s:5:"field";s:13:"DAS_INS_TASKS";s:4:"type";s:4:"text";s:5:"value";N;}i:10;a:3:{s:5:"field";s:29:"DAS_INS_ADDITIONAL_PROPERTIES";s:4:"type";s:4:"text";s:5:"value";s:160:"a:6:{s:12:"DAS_RED_FROM";i:0;s:10:"DAS_RED_TO";i:30;s:15:"DAS_YELLOW_FROM";i:30;s:13:"DAS_YELLOW_TO";i:50;s:14:"DAS_GREEN_FROM";i:50;s:12:"DAS_GREEN_TO";i:100;}";}i:11;a:3:{s:5:"field";s:19:"DAS_INS_CREATE_DATE";s:4:"type";s:4:"date";s:5:"value";s:19:"2011-11-09 00:00:00";}i:12;a:3:{s:5:"field";s:19:"DAS_INS_UPDATE_DATE";s:4:"type";s:4:"date";s:5:"value";s:19:"2011-11-09 00:00:00";}i:13;a:3:{s:5:"field";s:14:"DAS_INS_STATUS";s:4:"type";s:3:"int";s:5:"value";i:1;}}s:6:"action";i:4;}}
|
||||
@@ -118,10 +118,12 @@ dashletInstance.form = {
|
||||
cboDasInsOwnerUID.setValue(dashletInstance.DAS_INS_OWNER_UID);
|
||||
}
|
||||
else {
|
||||
if (store.getAt(0)) {
|
||||
cboDasInsOwnerUID.setValue(store.getAt(0).get(cboDasInsOwnerUID.valueField));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var storeProcess = new Ext.data.ArrayStore({
|
||||
@@ -243,7 +245,8 @@ dashletInstance.form = {
|
||||
"type": combo.getValue()
|
||||
};
|
||||
cboDasInsOwnerUID.store.removeAll();
|
||||
cboDasInsOwnerUID.store.load();
|
||||
cboDasInsOwnerUID.clearValue();
|
||||
cboDasInsOwnerUID.store.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -261,7 +264,8 @@ dashletInstance.form = {
|
||||
editable: false,
|
||||
|
||||
width: 200,
|
||||
fieldLabel: "Name"
|
||||
fieldLabel: "Name",
|
||||
allowBlank: false
|
||||
});
|
||||
|
||||
var cboProcess = new Ext.form.ComboBox({
|
||||
@@ -333,10 +337,14 @@ dashletInstance.form = {
|
||||
id: "btnSubmit",
|
||||
|
||||
text: "Save",
|
||||
//scope: this,
|
||||
handler: function () {
|
||||
if (dashletInstanceFrm.getForm().isValid()) {
|
||||
dashletInstanceSaveProcessAjax();
|
||||
}
|
||||
else {
|
||||
Ext.MessageBox.alert('Invalid data', 'Please check the fields mark in red.');
|
||||
}
|
||||
}
|
||||
}),
|
||||
|
||||
//{xtype: "button",
|
||||
|
||||
Reference in New Issue
Block a user