BUG 000 Add validation to print a dynaform

This commit is contained in:
Julio Cesar Laura
2011-12-02 00:53:49 -04:00
parent 07ee0c00ff
commit 816d40f5e5
13 changed files with 290 additions and 941 deletions

View File

@@ -15,9 +15,35 @@ class dashletOpenVSCompleted implements DashletInterface {
private $greenFrom;
private $greenTo;
public static function getAdditionalFields() {
public static function getAdditionalFields($a) {
$additionalFields = array();
$contextTimeStore = new stdclass();
$contextTimeStore->xtype = 'arraystore';
$contextTimeStore->fields = array('id', 'value');
$contextTimeStore->data = array(array('TODAY', 'Today'),
array('YESTERDAY', 'Yesterday'),
array('THIS_WEEK', 'This week'),
array('PREVIOUS_WEEK', 'Previous Week'),
array('THIS_MONTH', 'This Month'),
array('PREVIOUS_MONTH', 'Previous Month'),
array('THIS_YEAR', 'This Year'),
array('PREVIOUS_YEAR', 'Previous Year'));
$contextTime = new stdclass();
$contextTime->xtype = 'combo';
$contextTime->name = 'DAS_INS_CONTEXT_TIME';
$contextTime->fieldLabel = 'Period';
$contextTime->editable = false;
$contextTime->width = 325;
$contextTime->store = $contextTimeStore;
$contextTime->mode = 'local';
$contextTime->triggerAction = 'all';
$contextTime->value = 'TODAY';
$contextTime->valueField = 'id';
$contextTime->displayField = 'value';
$additionalFields[] = $contextTime;
$redFrom = new stdclass();
$redFrom->xtype = 'numberfield';
$redFrom->name = 'DAS_RED_FROM';

View File

@@ -12,15 +12,14 @@ class PMDashlet extends DashletInstance implements DashletInterface {
// Interface functions
public static function getAdditionalFields() {
public static function getAdditionalFields($className) {
try {
//Change this in the next release
$className = 'dashletOpenVSCompleted';
G::LoadClass($className);
eval("\$additionalFields = $className::getAdditionalFields();");
eval("\$additionalFields = $className::getAdditionalFields(\$className);");
return $additionalFields;
}
catch (Exception $error) {die('xxx');
catch (Exception $error) {
throw $error;
}
}
@@ -167,14 +166,12 @@ class PMDashlet extends DashletInstance implements DashletInterface {
$criteria = new Criteria('workflow');
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_UID);
$criteria->addSelectColumn(DashletPeer::DAS_TITLE);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_CONTEXT_TIME);
$criteria->add(DashletInstancePeer::DAS_INS_OWNER_TYPE, 'EVERYBODY');
$dataset = DashletInstancePeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
while ($row = $dataset->getRow()) {
if (!isset($dashletsInstances[$row['DAS_INS_UID']])) {
$row['DAS_TITLE'] .= ' (' . $row['DAS_INS_CONTEXT_TIME'] . ')';
$dashletsInstances[$row['DAS_INS_UID']] = $row;
}
$dataset->next();
@@ -184,7 +181,6 @@ class PMDashlet extends DashletInstance implements DashletInterface {
$criteria = new Criteria('workflow');
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_UID);
$criteria->addSelectColumn(DashletPeer::DAS_TITLE);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_CONTEXT_TIME);
$criteria->add(DashletInstancePeer::DAS_INS_OWNER_TYPE, 'USER');
$criteria->add(DashletInstancePeer::DAS_INS_OWNER_UID, $userUid);
$dataset = DashletInstancePeer::doSelectRS($criteria);
@@ -192,7 +188,6 @@ class PMDashlet extends DashletInstance implements DashletInterface {
$dataset->next();
while ($row = $dataset->getRow()) {
if (!isset($dashletsInstances[$row['DAS_INS_UID']])) {
$row['DAS_TITLE'] .= ' (' . $row['DAS_INS_CONTEXT_TIME'] . ')';
$dashletsInstances[$row['DAS_INS_UID']] = $row;
}
$dataset->next();
@@ -204,7 +199,6 @@ class PMDashlet extends DashletInstance implements DashletInterface {
$criteria = new Criteria('workflow');
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_UID);
$criteria->addSelectColumn(DashletPeer::DAS_TITLE);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_CONTEXT_TIME);
$criteria->add(DashletInstancePeer::DAS_INS_OWNER_TYPE, 'DEPARTMENT');
$criteria->add(DashletInstancePeer::DAS_INS_OWNER_UID, $depUid);
$dataset = DashletInstancePeer::doSelectRS($criteria);
@@ -212,7 +206,6 @@ class PMDashlet extends DashletInstance implements DashletInterface {
$dataset->next();
while ($row = $dataset->getRow()) {
if (!isset($dashletsInstances[$row['DAS_INS_UID']])) {
$row['DAS_TITLE'] .= ' (' . $row['DAS_INS_CONTEXT_TIME'] . ')';
$dashletsInstances[$row['DAS_INS_UID']] = $row;
}
$dataset->next();
@@ -226,7 +219,6 @@ class PMDashlet extends DashletInstance implements DashletInterface {
$criteria = new Criteria('workflow');
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_UID);
$criteria->addSelectColumn(DashletPeer::DAS_TITLE);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_CONTEXT_TIME);
$criteria->add(DashletInstancePeer::DAS_INS_OWNER_TYPE, 'GROUP');
$criteria->add(DashletInstancePeer::DAS_INS_OWNER_UID, $grpUid);
$dataset = DashletInstancePeer::doSelectRS($criteria);
@@ -234,7 +226,6 @@ class PMDashlet extends DashletInstance implements DashletInterface {
$dataset->next();
while ($row = $dataset->getRow()) {
if (!isset($dashletsInstances[$row['DAS_INS_UID']])) {
$row['DAS_TITLE'] .= ' (' . $row['DAS_INS_CONTEXT_TIME'] . ')';
$dashletsInstances[$row['DAS_INS_UID']] = $row;
}
$dataset->next();

View File

@@ -2,7 +2,7 @@
interface DashletInterface {
public static function getAdditionalFields();
public static function getAdditionalFields($className);
public function setup($dasInsUid);
public function render();

View File

@@ -16,9 +16,9 @@ require_once 'classes/model/om/BaseDashletInstance.php';
*/
class DashletInstance extends BaseDashletInstance {
private $validFields = array('DAS_INS_UID', 'DAS_UID', 'DAS_INS_TYPE', 'DAS_INS_CONTEXT_TIME', 'DAS_INS_START_DATE', 'DAS_INS_END_DATE', 'DAS_INS_OWNER_TYPE',
'DAS_INS_OWNER_UID', 'DAS_INS_PROCESSES', 'DAS_INS_TASKS', ' DAS_INS_CREATE_DATE', 'DAS_INS_UPDATE_DATE', 'DAS_INS_STATUS',
'pmos_generik', 'ys-admin-tabpanel', 'PHPSESSID');
private $filterThisFields = array('DAS_INS_UID', 'DAS_UID', 'DAS_INS_OWNER_TYPE', 'DAS_INS_OWNER_UID',
'DAS_INS_CREATE_DATE', 'DAS_INS_UPDATE_DATE', 'DAS_INS_STATUS',
'pmos_generik', 'ys-admin-tabpanel', 'PHPSESSID');
public function load($dasInsUid) {
try {
@@ -37,7 +37,7 @@ class DashletInstance extends BaseDashletInstance {
public function createOrUpdate($data) {
$additionalFields = array();
foreach ($data as $field => $value) {
if (!in_array($field, $this->validFields)) {
if (!in_array($field, $this->filterThisFields)) {
$additionalFields[$field] = $value;
unset($data[$field]);
}

View File

@@ -68,22 +68,10 @@ class DashletInstanceMapBuilder {
$tMap->addColumn('DAS_UID', 'DasUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('DAS_INS_TYPE', 'DasInsType', 'string', CreoleTypes::VARCHAR, true, 20);
$tMap->addColumn('DAS_INS_CONTEXT_TIME', 'DasInsContextTime', 'string', CreoleTypes::VARCHAR, true, 20);
$tMap->addColumn('DAS_INS_START_DATE', 'DasInsStartDate', 'int', CreoleTypes::TIMESTAMP, false, null);
$tMap->addColumn('DAS_INS_END_DATE', 'DasInsEndDate', 'int', CreoleTypes::TIMESTAMP, false, null);
$tMap->addColumn('DAS_INS_OWNER_TYPE', 'DasInsOwnerType', 'string', CreoleTypes::VARCHAR, true, 20);
$tMap->addColumn('DAS_INS_OWNER_UID', 'DasInsOwnerUid', 'string', CreoleTypes::VARCHAR, false, 32);
$tMap->addColumn('DAS_INS_PROCESSES', 'DasInsProcesses', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('DAS_INS_TASKS', 'DasInsTasks', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('DAS_INS_ADDITIONAL_PROPERTIES', 'DasInsAdditionalProperties', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('DAS_INS_CREATE_DATE', 'DasInsCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);

View File

@@ -12,7 +12,7 @@ include_once 'classes/model/DashletInstancePeer.php';
/**
* Base class that represents a row from the 'DASHLET_INSTANCE' table.
*
*
*
*
* @package workflow.classes.model.om
*/
@@ -42,34 +42,6 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
protected $das_uid = '';
/**
* The value for the das_ins_type field.
* @var string
*/
protected $das_ins_type = '';
/**
* The value for the das_ins_context_time field.
* @var string
*/
protected $das_ins_context_time = '';
/**
* The value for the das_ins_start_date field.
* @var int
*/
protected $das_ins_start_date;
/**
* The value for the das_ins_end_date field.
* @var int
*/
protected $das_ins_end_date;
/**
* The value for the das_ins_owner_type field.
* @var string
@@ -84,20 +56,6 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
protected $das_ins_owner_uid = '';
/**
* The value for the das_ins_processes field.
* @var string
*/
protected $das_ins_processes;
/**
* The value for the das_ins_tasks field.
* @var string
*/
protected $das_ins_tasks;
/**
* The value for the das_ins_additional_properties field.
* @var string
@@ -141,7 +99,7 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
/**
* Get the [das_ins_uid] column value.
*
*
* @return string
*/
public function getDasInsUid()
@@ -152,7 +110,7 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
/**
* Get the [das_uid] column value.
*
*
* @return string
*/
public function getDasUid()
@@ -161,93 +119,9 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
return $this->das_uid;
}
/**
* Get the [das_ins_type] column value.
*
* @return string
*/
public function getDasInsType()
{
return $this->das_ins_type;
}
/**
* Get the [das_ins_context_time] column value.
*
* @return string
*/
public function getDasInsContextTime()
{
return $this->das_ins_context_time;
}
/**
* Get the [optionally formatted] [das_ins_start_date] column value.
*
* @param string $format The date/time format string (either date()-style or strftime()-style).
* If format is NULL, then the integer unix timestamp will be returned.
* @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
* @throws PropelException - if unable to convert the date/time to timestamp.
*/
public function getDasInsStartDate($format = 'Y-m-d H:i:s')
{
if ($this->das_ins_start_date === null || $this->das_ins_start_date === '') {
return null;
} elseif (!is_int($this->das_ins_start_date)) {
// a non-timestamp value was set externally, so we convert it
$ts = strtotime($this->das_ins_start_date);
if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
throw new PropelException("Unable to parse value of [das_ins_start_date] as date/time value: " . var_export($this->das_ins_start_date, true));
}
} else {
$ts = $this->das_ins_start_date;
}
if ($format === null) {
return $ts;
} elseif (strpos($format, '%') !== false) {
return strftime($format, $ts);
} else {
return date($format, $ts);
}
}
/**
* Get the [optionally formatted] [das_ins_end_date] column value.
*
* @param string $format The date/time format string (either date()-style or strftime()-style).
* If format is NULL, then the integer unix timestamp will be returned.
* @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
* @throws PropelException - if unable to convert the date/time to timestamp.
*/
public function getDasInsEndDate($format = 'Y-m-d H:i:s')
{
if ($this->das_ins_end_date === null || $this->das_ins_end_date === '') {
return null;
} elseif (!is_int($this->das_ins_end_date)) {
// a non-timestamp value was set externally, so we convert it
$ts = strtotime($this->das_ins_end_date);
if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
throw new PropelException("Unable to parse value of [das_ins_end_date] as date/time value: " . var_export($this->das_ins_end_date, true));
}
} else {
$ts = $this->das_ins_end_date;
}
if ($format === null) {
return $ts;
} elseif (strpos($format, '%') !== false) {
return strftime($format, $ts);
} else {
return date($format, $ts);
}
}
/**
* Get the [das_ins_owner_type] column value.
*
*
* @return string
*/
public function getDasInsOwnerType()
@@ -258,7 +132,7 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
/**
* Get the [das_ins_owner_uid] column value.
*
*
* @return string
*/
public function getDasInsOwnerUid()
@@ -267,31 +141,9 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
return $this->das_ins_owner_uid;
}
/**
* Get the [das_ins_processes] column value.
*
* @return string
*/
public function getDasInsProcesses()
{
return $this->das_ins_processes;
}
/**
* Get the [das_ins_tasks] column value.
*
* @return string
*/
public function getDasInsTasks()
{
return $this->das_ins_tasks;
}
/**
* Get the [das_ins_additional_properties] column value.
*
*
* @return string
*/
public function getDasInsAdditionalProperties()
@@ -302,7 +154,7 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
/**
* Get the [optionally formatted] [das_ins_create_date] column value.
*
*
* @param string $format The date/time format string (either date()-style or strftime()-style).
* If format is NULL, then the integer unix timestamp will be returned.
* @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
@@ -333,7 +185,7 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
/**
* Get the [optionally formatted] [das_ins_update_date] column value.
*
*
* @param string $format The date/time format string (either date()-style or strftime()-style).
* If format is NULL, then the integer unix timestamp will be returned.
* @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
@@ -364,7 +216,7 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
/**
* Get the [das_ins_status] column value.
*
*
* @return int
*/
public function getDasInsStatus()
@@ -375,7 +227,7 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
/**
* Set the value of [das_ins_uid] column.
*
*
* @param string $v new value
* @return void
*/
@@ -385,7 +237,7 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
$v = (string) $v;
}
if ($this->das_ins_uid !== $v || $v === '') {
@@ -397,7 +249,7 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
/**
* Set the value of [das_uid] column.
*
*
* @param string $v new value
* @return void
*/
@@ -407,7 +259,7 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
$v = (string) $v;
}
if ($this->das_uid !== $v || $v === '') {
@@ -417,101 +269,9 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
} // setDasUid()
/**
* Set the value of [das_ins_type] column.
*
* @param string $v new value
* @return void
*/
public function setDasInsType($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->das_ins_type !== $v || $v === '') {
$this->das_ins_type = $v;
$this->modifiedColumns[] = DashletInstancePeer::DAS_INS_TYPE;
}
} // setDasInsType()
/**
* Set the value of [das_ins_context_time] column.
*
* @param string $v new value
* @return void
*/
public function setDasInsContextTime($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->das_ins_context_time !== $v || $v === '') {
$this->das_ins_context_time = $v;
$this->modifiedColumns[] = DashletInstancePeer::DAS_INS_CONTEXT_TIME;
}
} // setDasInsContextTime()
/**
* Set the value of [das_ins_start_date] column.
*
* @param int $v new value
* @return void
*/
public function setDasInsStartDate($v)
{
if ($v !== null && !is_int($v)) {
$ts = strtotime($v);
if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
throw new PropelException("Unable to parse date/time value for [das_ins_start_date] from input: " . var_export($v, true));
}
} else {
$ts = $v;
}
if ($this->das_ins_start_date !== $ts) {
$this->das_ins_start_date = $ts;
$this->modifiedColumns[] = DashletInstancePeer::DAS_INS_START_DATE;
}
} // setDasInsStartDate()
/**
* Set the value of [das_ins_end_date] column.
*
* @param int $v new value
* @return void
*/
public function setDasInsEndDate($v)
{
if ($v !== null && !is_int($v)) {
$ts = strtotime($v);
if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
throw new PropelException("Unable to parse date/time value for [das_ins_end_date] from input: " . var_export($v, true));
}
} else {
$ts = $v;
}
if ($this->das_ins_end_date !== $ts) {
$this->das_ins_end_date = $ts;
$this->modifiedColumns[] = DashletInstancePeer::DAS_INS_END_DATE;
}
} // setDasInsEndDate()
/**
* Set the value of [das_ins_owner_type] column.
*
*
* @param string $v new value
* @return void
*/
@@ -521,7 +281,7 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
$v = (string) $v;
}
if ($this->das_ins_owner_type !== $v || $v === '') {
@@ -533,7 +293,7 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
/**
* Set the value of [das_ins_owner_uid] column.
*
*
* @param string $v new value
* @return void
*/
@@ -543,7 +303,7 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
$v = (string) $v;
}
if ($this->das_ins_owner_uid !== $v || $v === '') {
@@ -553,53 +313,9 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
} // setDasInsOwnerUid()
/**
* Set the value of [das_ins_processes] column.
*
* @param string $v new value
* @return void
*/
public function setDasInsProcesses($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->das_ins_processes !== $v) {
$this->das_ins_processes = $v;
$this->modifiedColumns[] = DashletInstancePeer::DAS_INS_PROCESSES;
}
} // setDasInsProcesses()
/**
* Set the value of [das_ins_tasks] column.
*
* @param string $v new value
* @return void
*/
public function setDasInsTasks($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->das_ins_tasks !== $v) {
$this->das_ins_tasks = $v;
$this->modifiedColumns[] = DashletInstancePeer::DAS_INS_TASKS;
}
} // setDasInsTasks()
/**
* Set the value of [das_ins_additional_properties] column.
*
*
* @param string $v new value
* @return void
*/
@@ -609,7 +325,7 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
$v = (string) $v;
}
if ($this->das_ins_additional_properties !== $v) {
@@ -621,7 +337,7 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
/**
* Set the value of [das_ins_create_date] column.
*
*
* @param int $v new value
* @return void
*/
@@ -645,7 +361,7 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
/**
* Set the value of [das_ins_update_date] column.
*
*
* @param int $v new value
* @return void
*/
@@ -669,7 +385,7 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
/**
* Set the value of [das_ins_status] column.
*
*
* @param int $v new value
* @return void
*/
@@ -710,36 +426,24 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
$this->das_uid = $rs->getString($startcol + 1);
$this->das_ins_type = $rs->getString($startcol + 2);
$this->das_ins_owner_type = $rs->getString($startcol + 2);
$this->das_ins_context_time = $rs->getString($startcol + 3);
$this->das_ins_owner_uid = $rs->getString($startcol + 3);
$this->das_ins_start_date = $rs->getTimestamp($startcol + 4, null);
$this->das_ins_additional_properties = $rs->getString($startcol + 4);
$this->das_ins_end_date = $rs->getTimestamp($startcol + 5, null);
$this->das_ins_create_date = $rs->getTimestamp($startcol + 5, null);
$this->das_ins_owner_type = $rs->getString($startcol + 6);
$this->das_ins_update_date = $rs->getTimestamp($startcol + 6, null);
$this->das_ins_owner_uid = $rs->getString($startcol + 7);
$this->das_ins_processes = $rs->getString($startcol + 8);
$this->das_ins_tasks = $rs->getString($startcol + 9);
$this->das_ins_additional_properties = $rs->getString($startcol + 10);
$this->das_ins_create_date = $rs->getTimestamp($startcol + 11, null);
$this->das_ins_update_date = $rs->getTimestamp($startcol + 12, null);
$this->das_ins_status = $rs->getInt($startcol + 13);
$this->das_ins_status = $rs->getInt($startcol + 7);
$this->resetModified();
$this->setNew(false);
// FIXME - using NUM_COLUMNS may be clearer.
return $startcol + 14; // 14 = DashletInstancePeer::NUM_COLUMNS - DashletInstancePeer::NUM_LAZY_LOAD_COLUMNS).
return $startcol + 8; // 8 = DashletInstancePeer::NUM_COLUMNS - DashletInstancePeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating DashletInstance object", $e);
@@ -949,39 +653,21 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
return $this->getDasUid();
break;
case 2:
return $this->getDasInsType();
break;
case 3:
return $this->getDasInsContextTime();
break;
case 4:
return $this->getDasInsStartDate();
break;
case 5:
return $this->getDasInsEndDate();
break;
case 6:
return $this->getDasInsOwnerType();
break;
case 7:
case 3:
return $this->getDasInsOwnerUid();
break;
case 8:
return $this->getDasInsProcesses();
break;
case 9:
return $this->getDasInsTasks();
break;
case 10:
case 4:
return $this->getDasInsAdditionalProperties();
break;
case 11:
case 5:
return $this->getDasInsCreateDate();
break;
case 12:
case 6:
return $this->getDasInsUpdateDate();
break;
case 13:
case 7:
return $this->getDasInsStatus();
break;
default:
@@ -1006,18 +692,12 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
$result = array(
$keys[0] => $this->getDasInsUid(),
$keys[1] => $this->getDasUid(),
$keys[2] => $this->getDasInsType(),
$keys[3] => $this->getDasInsContextTime(),
$keys[4] => $this->getDasInsStartDate(),
$keys[5] => $this->getDasInsEndDate(),
$keys[6] => $this->getDasInsOwnerType(),
$keys[7] => $this->getDasInsOwnerUid(),
$keys[8] => $this->getDasInsProcesses(),
$keys[9] => $this->getDasInsTasks(),
$keys[10] => $this->getDasInsAdditionalProperties(),
$keys[11] => $this->getDasInsCreateDate(),
$keys[12] => $this->getDasInsUpdateDate(),
$keys[13] => $this->getDasInsStatus(),
$keys[2] => $this->getDasInsOwnerType(),
$keys[3] => $this->getDasInsOwnerUid(),
$keys[4] => $this->getDasInsAdditionalProperties(),
$keys[5] => $this->getDasInsCreateDate(),
$keys[6] => $this->getDasInsUpdateDate(),
$keys[7] => $this->getDasInsStatus(),
);
return $result;
}
@@ -1056,39 +736,21 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
$this->setDasUid($value);
break;
case 2:
$this->setDasInsType($value);
break;
case 3:
$this->setDasInsContextTime($value);
break;
case 4:
$this->setDasInsStartDate($value);
break;
case 5:
$this->setDasInsEndDate($value);
break;
case 6:
$this->setDasInsOwnerType($value);
break;
case 7:
case 3:
$this->setDasInsOwnerUid($value);
break;
case 8:
$this->setDasInsProcesses($value);
break;
case 9:
$this->setDasInsTasks($value);
break;
case 10:
case 4:
$this->setDasInsAdditionalProperties($value);
break;
case 11:
case 5:
$this->setDasInsCreateDate($value);
break;
case 12:
case 6:
$this->setDasInsUpdateDate($value);
break;
case 13:
case 7:
$this->setDasInsStatus($value);
break;
} // switch()
@@ -1116,18 +778,12 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
if (array_key_exists($keys[0], $arr)) $this->setDasInsUid($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setDasUid($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setDasInsType($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setDasInsContextTime($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setDasInsStartDate($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setDasInsEndDate($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setDasInsOwnerType($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setDasInsOwnerUid($arr[$keys[7]]);
if (array_key_exists($keys[8], $arr)) $this->setDasInsProcesses($arr[$keys[8]]);
if (array_key_exists($keys[9], $arr)) $this->setDasInsTasks($arr[$keys[9]]);
if (array_key_exists($keys[10], $arr)) $this->setDasInsAdditionalProperties($arr[$keys[10]]);
if (array_key_exists($keys[11], $arr)) $this->setDasInsCreateDate($arr[$keys[11]]);
if (array_key_exists($keys[12], $arr)) $this->setDasInsUpdateDate($arr[$keys[12]]);
if (array_key_exists($keys[13], $arr)) $this->setDasInsStatus($arr[$keys[13]]);
if (array_key_exists($keys[2], $arr)) $this->setDasInsOwnerType($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setDasInsOwnerUid($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setDasInsAdditionalProperties($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setDasInsCreateDate($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setDasInsUpdateDate($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setDasInsStatus($arr[$keys[7]]);
}
/**
@@ -1141,14 +797,8 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
if ($this->isColumnModified(DashletInstancePeer::DAS_INS_UID)) $criteria->add(DashletInstancePeer::DAS_INS_UID, $this->das_ins_uid);
if ($this->isColumnModified(DashletInstancePeer::DAS_UID)) $criteria->add(DashletInstancePeer::DAS_UID, $this->das_uid);
if ($this->isColumnModified(DashletInstancePeer::DAS_INS_TYPE)) $criteria->add(DashletInstancePeer::DAS_INS_TYPE, $this->das_ins_type);
if ($this->isColumnModified(DashletInstancePeer::DAS_INS_CONTEXT_TIME)) $criteria->add(DashletInstancePeer::DAS_INS_CONTEXT_TIME, $this->das_ins_context_time);
if ($this->isColumnModified(DashletInstancePeer::DAS_INS_START_DATE)) $criteria->add(DashletInstancePeer::DAS_INS_START_DATE, $this->das_ins_start_date);
if ($this->isColumnModified(DashletInstancePeer::DAS_INS_END_DATE)) $criteria->add(DashletInstancePeer::DAS_INS_END_DATE, $this->das_ins_end_date);
if ($this->isColumnModified(DashletInstancePeer::DAS_INS_OWNER_TYPE)) $criteria->add(DashletInstancePeer::DAS_INS_OWNER_TYPE, $this->das_ins_owner_type);
if ($this->isColumnModified(DashletInstancePeer::DAS_INS_OWNER_UID)) $criteria->add(DashletInstancePeer::DAS_INS_OWNER_UID, $this->das_ins_owner_uid);
if ($this->isColumnModified(DashletInstancePeer::DAS_INS_PROCESSES)) $criteria->add(DashletInstancePeer::DAS_INS_PROCESSES, $this->das_ins_processes);
if ($this->isColumnModified(DashletInstancePeer::DAS_INS_TASKS)) $criteria->add(DashletInstancePeer::DAS_INS_TASKS, $this->das_ins_tasks);
if ($this->isColumnModified(DashletInstancePeer::DAS_INS_ADDITIONAL_PROPERTIES)) $criteria->add(DashletInstancePeer::DAS_INS_ADDITIONAL_PROPERTIES, $this->das_ins_additional_properties);
if ($this->isColumnModified(DashletInstancePeer::DAS_INS_CREATE_DATE)) $criteria->add(DashletInstancePeer::DAS_INS_CREATE_DATE, $this->das_ins_create_date);
if ($this->isColumnModified(DashletInstancePeer::DAS_INS_UPDATE_DATE)) $criteria->add(DashletInstancePeer::DAS_INS_UPDATE_DATE, $this->das_ins_update_date);
@@ -1209,22 +859,10 @@ abstract class BaseDashletInstance extends BaseObject implements Persistent {
$copyObj->setDasUid($this->das_uid);
$copyObj->setDasInsType($this->das_ins_type);
$copyObj->setDasInsContextTime($this->das_ins_context_time);
$copyObj->setDasInsStartDate($this->das_ins_start_date);
$copyObj->setDasInsEndDate($this->das_ins_end_date);
$copyObj->setDasInsOwnerType($this->das_ins_owner_type);
$copyObj->setDasInsOwnerUid($this->das_ins_owner_uid);
$copyObj->setDasInsProcesses($this->das_ins_processes);
$copyObj->setDasInsTasks($this->das_ins_tasks);
$copyObj->setDasInsAdditionalProperties($this->das_ins_additional_properties);
$copyObj->setDasInsCreateDate($this->das_ins_create_date);

View File

@@ -24,7 +24,7 @@ abstract class BaseDashletInstancePeer {
const CLASS_DEFAULT = 'classes.model.DashletInstance';
/** The total number of columns. */
const NUM_COLUMNS = 14;
const NUM_COLUMNS = 8;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
@@ -36,30 +36,12 @@ abstract class BaseDashletInstancePeer {
/** the column name for the DAS_UID field */
const DAS_UID = 'DASHLET_INSTANCE.DAS_UID';
/** the column name for the DAS_INS_TYPE field */
const DAS_INS_TYPE = 'DASHLET_INSTANCE.DAS_INS_TYPE';
/** the column name for the DAS_INS_CONTEXT_TIME field */
const DAS_INS_CONTEXT_TIME = 'DASHLET_INSTANCE.DAS_INS_CONTEXT_TIME';
/** the column name for the DAS_INS_START_DATE field */
const DAS_INS_START_DATE = 'DASHLET_INSTANCE.DAS_INS_START_DATE';
/** the column name for the DAS_INS_END_DATE field */
const DAS_INS_END_DATE = 'DASHLET_INSTANCE.DAS_INS_END_DATE';
/** the column name for the DAS_INS_OWNER_TYPE field */
const DAS_INS_OWNER_TYPE = 'DASHLET_INSTANCE.DAS_INS_OWNER_TYPE';
/** the column name for the DAS_INS_OWNER_UID field */
const DAS_INS_OWNER_UID = 'DASHLET_INSTANCE.DAS_INS_OWNER_UID';
/** the column name for the DAS_INS_PROCESSES field */
const DAS_INS_PROCESSES = 'DASHLET_INSTANCE.DAS_INS_PROCESSES';
/** the column name for the DAS_INS_TASKS field */
const DAS_INS_TASKS = 'DASHLET_INSTANCE.DAS_INS_TASKS';
/** the column name for the DAS_INS_ADDITIONAL_PROPERTIES field */
const DAS_INS_ADDITIONAL_PROPERTIES = 'DASHLET_INSTANCE.DAS_INS_ADDITIONAL_PROPERTIES';
@@ -83,10 +65,10 @@ abstract class BaseDashletInstancePeer {
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DasInsUid', 'DasUid', 'DasInsType', 'DasInsContextTime', 'DasInsStartDate', 'DasInsEndDate', 'DasInsOwnerType', 'DasInsOwnerUid', 'DasInsProcesses', 'DasInsTasks', 'DasInsAdditionalProperties', 'DasInsCreateDate', 'DasInsUpdateDate', 'DasInsStatus', ),
BasePeer::TYPE_COLNAME => array (DashletInstancePeer::DAS_INS_UID, DashletInstancePeer::DAS_UID, DashletInstancePeer::DAS_INS_TYPE, DashletInstancePeer::DAS_INS_CONTEXT_TIME, DashletInstancePeer::DAS_INS_START_DATE, DashletInstancePeer::DAS_INS_END_DATE, DashletInstancePeer::DAS_INS_OWNER_TYPE, DashletInstancePeer::DAS_INS_OWNER_UID, DashletInstancePeer::DAS_INS_PROCESSES, DashletInstancePeer::DAS_INS_TASKS, DashletInstancePeer::DAS_INS_ADDITIONAL_PROPERTIES, DashletInstancePeer::DAS_INS_CREATE_DATE, DashletInstancePeer::DAS_INS_UPDATE_DATE, DashletInstancePeer::DAS_INS_STATUS, ),
BasePeer::TYPE_FIELDNAME => array ('DAS_INS_UID', 'DAS_UID', 'DAS_INS_TYPE', 'DAS_INS_CONTEXT_TIME', 'DAS_INS_START_DATE', 'DAS_INS_END_DATE', 'DAS_INS_OWNER_TYPE', 'DAS_INS_OWNER_UID', 'DAS_INS_PROCESSES', 'DAS_INS_TASKS', 'DAS_INS_ADDITIONAL_PROPERTIES', 'DAS_INS_CREATE_DATE', 'DAS_INS_UPDATE_DATE', 'DAS_INS_STATUS', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
BasePeer::TYPE_PHPNAME => array ('DasInsUid', 'DasUid', 'DasInsOwnerType', 'DasInsOwnerUid', 'DasInsAdditionalProperties', 'DasInsCreateDate', 'DasInsUpdateDate', 'DasInsStatus', ),
BasePeer::TYPE_COLNAME => array (DashletInstancePeer::DAS_INS_UID, DashletInstancePeer::DAS_UID, DashletInstancePeer::DAS_INS_OWNER_TYPE, DashletInstancePeer::DAS_INS_OWNER_UID, DashletInstancePeer::DAS_INS_ADDITIONAL_PROPERTIES, DashletInstancePeer::DAS_INS_CREATE_DATE, DashletInstancePeer::DAS_INS_UPDATE_DATE, DashletInstancePeer::DAS_INS_STATUS, ),
BasePeer::TYPE_FIELDNAME => array ('DAS_INS_UID', 'DAS_UID', 'DAS_INS_OWNER_TYPE', 'DAS_INS_OWNER_UID', 'DAS_INS_ADDITIONAL_PROPERTIES', 'DAS_INS_CREATE_DATE', 'DAS_INS_UPDATE_DATE', 'DAS_INS_STATUS', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
);
/**
@@ -96,10 +78,10 @@ abstract class BaseDashletInstancePeer {
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DasInsUid' => 0, 'DasUid' => 1, 'DasInsType' => 2, 'DasInsContextTime' => 3, 'DasInsStartDate' => 4, 'DasInsEndDate' => 5, 'DasInsOwnerType' => 6, 'DasInsOwnerUid' => 7, 'DasInsProcesses' => 8, 'DasInsTasks' => 9, 'DasInsAdditionalProperties' => 10, 'DasInsCreateDate' => 11, 'DasInsUpdateDate' => 12, 'DasInsStatus' => 13, ),
BasePeer::TYPE_COLNAME => array (DashletInstancePeer::DAS_INS_UID => 0, DashletInstancePeer::DAS_UID => 1, DashletInstancePeer::DAS_INS_TYPE => 2, DashletInstancePeer::DAS_INS_CONTEXT_TIME => 3, DashletInstancePeer::DAS_INS_START_DATE => 4, DashletInstancePeer::DAS_INS_END_DATE => 5, DashletInstancePeer::DAS_INS_OWNER_TYPE => 6, DashletInstancePeer::DAS_INS_OWNER_UID => 7, DashletInstancePeer::DAS_INS_PROCESSES => 8, DashletInstancePeer::DAS_INS_TASKS => 9, DashletInstancePeer::DAS_INS_ADDITIONAL_PROPERTIES => 10, DashletInstancePeer::DAS_INS_CREATE_DATE => 11, DashletInstancePeer::DAS_INS_UPDATE_DATE => 12, DashletInstancePeer::DAS_INS_STATUS => 13, ),
BasePeer::TYPE_FIELDNAME => array ('DAS_INS_UID' => 0, 'DAS_UID' => 1, 'DAS_INS_TYPE' => 2, 'DAS_INS_CONTEXT_TIME' => 3, 'DAS_INS_START_DATE' => 4, 'DAS_INS_END_DATE' => 5, 'DAS_INS_OWNER_TYPE' => 6, 'DAS_INS_OWNER_UID' => 7, 'DAS_INS_PROCESSES' => 8, 'DAS_INS_TASKS' => 9, 'DAS_INS_ADDITIONAL_PROPERTIES' => 10, 'DAS_INS_CREATE_DATE' => 11, 'DAS_INS_UPDATE_DATE' => 12, 'DAS_INS_STATUS' => 13, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
BasePeer::TYPE_PHPNAME => array ('DasInsUid' => 0, 'DasUid' => 1, 'DasInsOwnerType' => 2, 'DasInsOwnerUid' => 3, 'DasInsAdditionalProperties' => 4, 'DasInsCreateDate' => 5, 'DasInsUpdateDate' => 6, 'DasInsStatus' => 7, ),
BasePeer::TYPE_COLNAME => array (DashletInstancePeer::DAS_INS_UID => 0, DashletInstancePeer::DAS_UID => 1, DashletInstancePeer::DAS_INS_OWNER_TYPE => 2, DashletInstancePeer::DAS_INS_OWNER_UID => 3, DashletInstancePeer::DAS_INS_ADDITIONAL_PROPERTIES => 4, DashletInstancePeer::DAS_INS_CREATE_DATE => 5, DashletInstancePeer::DAS_INS_UPDATE_DATE => 6, DashletInstancePeer::DAS_INS_STATUS => 7, ),
BasePeer::TYPE_FIELDNAME => array ('DAS_INS_UID' => 0, 'DAS_UID' => 1, 'DAS_INS_OWNER_TYPE' => 2, 'DAS_INS_OWNER_UID' => 3, 'DAS_INS_ADDITIONAL_PROPERTIES' => 4, 'DAS_INS_CREATE_DATE' => 5, 'DAS_INS_UPDATE_DATE' => 6, 'DAS_INS_STATUS' => 7, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
);
/**
@@ -204,22 +186,10 @@ abstract class BaseDashletInstancePeer {
$criteria->addSelectColumn(DashletInstancePeer::DAS_UID);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_TYPE);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_CONTEXT_TIME);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_START_DATE);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_END_DATE);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_OWNER_TYPE);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_OWNER_UID);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_PROCESSES);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_TASKS);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_ADDITIONAL_PROPERTIES);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_CREATE_DATE);

View File

@@ -2828,14 +2828,8 @@
</vendor>
<column name="DAS_INS_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="" />
<column name="DAS_UID" type="VARCHAR" size="32" required="true" default="" />
<column name="DAS_INS_TYPE" type="VARCHAR" size="20" required="true" default="" />
<column name="DAS_INS_CONTEXT_TIME" type="VARCHAR" size="20" required="true" default="" />
<column name="DAS_INS_START_DATE" type="TIMESTAMP" required="false" />
<column name="DAS_INS_END_DATE" type="TIMESTAMP" required="false" />
<column name="DAS_INS_OWNER_TYPE" type="VARCHAR" size="20" required="true" default="" />
<column name="DAS_INS_OWNER_UID" type="VARCHAR" size="32" required="false" default="" />
<column name="DAS_INS_PROCESSES" type="LONGVARCHAR" required="false" />
<column name="DAS_INS_TASKS" type="LONGVARCHAR" required="false" />
<column name="DAS_INS_ADDITIONAL_PROPERTIES" type="LONGVARCHAR" required="false" />
<column name="DAS_INS_CREATE_DATE" type="TIMESTAMP" required="true" />
<column name="DAS_INS_UPDATE_DATE" type="TIMESTAMP" required="false" />

View File

@@ -108,14 +108,20 @@ class Dashboard extends Controller {
if (!isset($data->DAS_INS_UID)) {
$data->DAS_INS_UID = '';
}
$dashlets = $this->getDashlets();
$this->setJSVar('storeDasUID', $dashlets);
if ($data->DAS_INS_UID != '') {
$this->pmDashlet->setup($data->DAS_INS_UID);
$this->setJSVar('dashletInstance', $this->pmDashlet->getDashletInstance());
$this->setJSVar('additionaFields', $this->pmDashlet->getAdditionalFields());
$this->setJSVar('additionaFields', PMDashlet::getAdditionalFields(get_class($this->pmDashlet->getDashletObject())));
}
else {
$this->setJSVar('dashletInstance', new stdclass());
$this->setJSVar('additionaFields', $this->pmDashlet->getAdditionalFields());
$dashletInstance = new stdclass();
$dashletInstance->DAS_UID = $dashlets[0][0];
$dashlet = new Dashlet();
$dashletFields = $dashlet->load($dashletInstance->DAS_UID);
$this->setJSVar('dashletInstance', $dashletInstance);
$this->setJSVar('additionaFields', PMDashlet::getAdditionalFields($dashletFields['DAS_CLASS']));
}
G::RenderPage('publish', 'extJs');
return null;
@@ -257,10 +263,7 @@ class Dashboard extends Controller {
return $result;
}
public function getDashlets($data) {
$this->setResponseType('json');
$result = new stdclass();
$result->status = 'OK';
private function getDashlets() {
try {
require_once 'classes/model/Dashlet.php';
@@ -277,17 +280,14 @@ class Dashboard extends Controller {
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
while ($row = $dataset->getRow()) {
$dashlets[] = array('DAS_UID' => $row['DAS_UID'], 'DAS_TITLE' => $row['DAS_TITLE']);
$dashlets[] = array($row['DAS_UID'], $row['DAS_TITLE']);
$dataset->next();
}
$result->total = DashletPeer::doCount($criteria);
$result->dashlets = $dashlets;
}
catch (Exception $oException) {
$result->status = 'ERROR';
$result->message = $error->getMessage();
catch (Exception $error) {
throw $error;
}
return $result;
return $dashlets;
}
// Functions for the dasboards administration module - End

View File

@@ -200,6 +200,7 @@ $uidf=$_GET['UID'];
}
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = $aNextStep['PAGE'];
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = G::loadTranslation('ID_NEXT_STEP');
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PHPSESSID'] = @session_id();
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addScriptCode("

View File

@@ -1,446 +1,191 @@
Ext.namespace("dashletInstance");
// Declare global variables
var storeDasInsOwnerType;
var storeDasInsOwnerUID;
var hiddenDasInsUID;
var cboDasUID;
var cboDasInsOwnerType;
var cboDasInsOwnerUID;
var formFields;
var additionalFields;
var dashletInstanceFrm;
dashletInstance.form = {
init: function () {
dashletInstanceSaveProcessAjax = function () {
var myMask = new Ext.LoadMask(Ext.getBody(), {msg: "Saving. Please wait..."});
myMask.show();
Ext.Ajax.request({
url: "saveDashletInstance",
method: "POST",
params: dashletInstanceFrm.getForm().getFieldValues(),
// On ready
Ext.onReady(function() {
// Stores
storeDasInsOwnerType = new Ext.data.ArrayStore({
idIndex: 0,
fields: ['id', 'value'],
data: [['USER', 'User'], ['DEPARTMENT', 'Department'], ['GROUP', 'Group']]
});
success:function (result, request) {
myMask.hide();
var dataResponse = Ext.util.JSON.decode(result.responseText)
switch (dataResponse.status) {
case "OK": window.location.href = "dashletsList";
break;
default: Ext.MessageBox.alert("Alert", "Dashboard Instance registered failed");
break;
}
},
failure:function (result, request) {
myMask.hide();
Ext.MessageBox.alert("Alert", "Ajax communication failed");
}
});
storeDasInsOwnerUID = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: 'getOwnersByType',
method: 'POST'
}),
reader: new Ext.data.JsonReader({
totalProperty: 'total',
root: 'owners',
fields: [{name: 'OWNER_UID', type: 'string'}, {name: 'OWNER_NAME', type: 'string'}]
}),
autoLoad: true,
listeners: {
beforeload: function (store) {
storeDasInsOwnerUID.baseParams = {'option': 'OWNERTYPE', 'type': cboDasInsOwnerType.getValue()};
},
load: function (store, record, option) {
if (dashletInstance.DAS_INS_UID) {
cboDasInsOwnerUID.setValue(dashletInstance.DAS_INS_OWNER_UID);
}
else {
if (store.getAt(0)) {
cboDasInsOwnerUID.setValue(store.getAt(0).get(cboDasInsOwnerUID.valueField));
}
}
}
}
});
//------------------------------------------------------------------------------------------------------------------
var storeDasUID = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: "getDashlets",
method: "POST"
}),
// Fields
hiddenDasInsUID = new Ext.form.Hidden({
id: 'hiddenDasInsUID',
name: 'DAS_INS_UID'
});
baseParams: {"option": "DASHLST"},
reader: new Ext.data.JsonReader({
totalProperty: "total",
root: "dashlets",
fields:[{name: "DAS_UID", type: "string"},
{name: "DAS_TITLE", type: "string"}
]
}),
autoLoad: true, //First call
listeners: {
load: function (store, record, option) {
cboDasUID.setValue(store.getAt(0).get(cboDasUID.valueField));
}
cboDasUID = new Ext.form.ComboBox({
id: 'cboDasUID',
name: 'DAS_UID',
fieldLabel: 'Dashboard',
editable: false,
width: 325,
store: storeDasUID,
triggerAction: 'all',
mode: 'local',
valueField: 'DAS_UID',
displayField: 'DAS_TITLE',
listeners: {
select: function (combo, record, index) {
Ext.Ajax.request({
url: 'getAdditionalFields',
method: 'POST',
params: '',
success: function (result, request) {
var dataResponse = Ext.util.JSON.decode(result.responseText)
//
},
failure: function (result, request) {
myMask.hide();
Ext.MessageBox.alert('Alert', 'Ajax communication failed');
}
});
}
});
var storeDasInsType = new Ext.data.ArrayStore({
idIndex: 0,
fields: ["id", "value"],
data: [["OPEN_CASES", "Open Cases"]
]
});
var storeDasInsContextTime = new Ext.data.ArrayStore({
idIndex: 0,
fields: ["id", "value"],
data: [//["RANGE", "Date Ranges"],
["TODAY", "Today"],
["YESTERDAY", "Yesterday"],
["THIS_WEEK", "This Week"],
["PREVIOUS_WEEK", "Previous Week"],
["THIS_MONTH", "This Month"],
["PREVIOUS_MONTH", "Previous Month"],
//["THIS_QUARTER", "This Quarter"],
//["PREVIOUS_QUARTER", "Previous Quarter"],
["THIS_YEAR", "This Year"],
["PREVIOUS_YEAR", "Previous Year"]
]
});
var storeDasInsOwnerType = new Ext.data.ArrayStore({
idIndex: 0,
fields: ["id", "value"],
data: [["USER", "User"],
["DEPARTMENT", "Department"],
["GROUP", "Group"]
]
});
var storeDasInsOwnerUID = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: "getOwnersByType",
method: "POST"
}),
reader: new Ext.data.JsonReader({
totalProperty: "total",
root: "owners",
fields:[{name: "OWNER_UID", type: "string"},
{name: "OWNER_NAME", type: "string"}
]
}),
autoLoad: true, //First call
listeners: {
beforeload: function (store) {
storeDasInsOwnerUID.baseParams = {"option": "OWNERTYPE",
"type": cboDasInsOwnerType.getValue()
};
},
load: function (store, record, option) {
if (dashletInstance.DAS_INS_UID) {
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({
idIndex: 0,
fields: ["id", "value"],
data: [["ALL", "All"]
//,
//["SEL", "Selection"]
]
});
var storeTask = new Ext.data.ArrayStore({
idIndex: 0,
fields: ["id", "value"],
data: [["ALL", "All"]
//,
//["SEL", "Selection"]
]
});
//------------------------------------------------------------------------------------------------------------------
var hiddenDasInsUID = new Ext.form.Hidden({
id: "hiddenDasInsUID",
name: "DAS_INS_UID"
});
var cboDasUID = new Ext.form.ComboBox({
id: "cboDasUID",
name: "DAS_UID",
valueField: "DAS_UID",
displayField: "DAS_TITLE",
store: storeDasUID,
triggerAction: "all",
mode: "local",
editable: false,
width: 325,
fieldLabel: "Dashboard"
});
var cboDasInsType = new Ext.form.ComboBox({
id: "cboDasInsType",
name: "DAS_INS_TYPE",
valueField: "id",
displayField: "value",
value: "OPEN_CASES",
store: storeDasInsType,
triggerAction: "all",
mode: "local",
editable: false,
width: 325,
fieldLabel: "Type"
});
var cboDasInsContextTime = new Ext.form.ComboBox({
id: "cboDasInsContextTime",
name: "DAS_INS_CONTEXT_TIME",
valueField: "id",
displayField: "value",
value: "TODAY",
store: storeDasInsContextTime,
triggerAction: "all",
mode: "local",
editable: false,
width: 325,
fieldLabel: "Period"
});
var txtDasInsStartDate = new Ext.form.DateField({
id: "txtDasInsStartDate",
name: "DAS_INS_START_DATE",
value: new Date(2011, 0, 1), //january=0, february=1, etc
width: 100,
format: "Y/m/d",
editable: false,
fieldLabel: "Start Date"
});
var txtDasInsEndDate = new Ext.form.DateField({
id: "txtDasInsEndDate",
name: "DAS_INS_END_DATE",
value: new Date(2011, 0, 1),
width: 100,
format: "Y/m/d",
editable: false,
fieldLabel: "Finish Date"
});
var cboDasInsOwnerType = new Ext.form.ComboBox({
id: "cboDasInsOwnerType",
name: "DAS_INS_OWNER_TYPE",
valueField: "id",
displayField: "value",
value: "DEPARTMENT",
store: storeDasInsOwnerType,
triggerAction: "all",
mode: "local",
editable: false,
width: 325,
fieldLabel: "Assign To",
listeners: {
select: function (combo, record, index) {
storeDasInsOwnerUID.baseParams = {"option": "OWNERTYPE",
"type": combo.getValue()
};
dashletInstance.DAS_INS_OWNER_UID = '';
cboDasInsOwnerUID.store.removeAll();
cboDasInsOwnerUID.clearValue();
cboDasInsOwnerUID.store.reload();
}
}
});
var cboDasInsOwnerUID = new Ext.form.ComboBox({
id: "cboDasInsOwnerUID",
name: "DAS_INS_OWNER_UID",
valueField: "OWNER_UID",
displayField: "OWNER_NAME",
store: storeDasInsOwnerUID,
triggerAction: "all",
mode: "local",
editable: false,
width: 325,
fieldLabel: "Name",
allowBlank: false
});
var cboProcess = new Ext.form.ComboBox({
id: "cboProcess",
name: "DAS_INS_PROCESSES",
valueField: "id",
displayField: "value",
value: "ALL",
store: storeProcess,
triggerAction: "all",
mode: "local",
editable: false,
width: 325,
fieldLabel: "Process"
});
var cboTask = new Ext.form.ComboBox({
id: "cboTask",
name: "DAS_INS_TASKS",
valueField: "id",
displayField: "value",
value: "ALL",
store: storeTask,
triggerAction: "all",
mode: "local",
editable: false,
width: 325,
fieldLabel: "Task"
});
var sliderMaxValue = 100;
var sliderValue = [];
var additionalFieldName = [];
var additionalFieldN = additionaFields.length;
for (var i = 0; i <= additionalFieldN - 1; i++) {
additionalFieldName[i] = additionaFields[i].name;
}
for (var i = 0; i <= (additionalFieldN / 2) - 1; i++) {
sliderValue[i] = 0;
}
var sliderRangeColor = new Ext.slider.MultiSlider({
//renderTo: "id",
fieldLabel: "Range Of Colors",
width: 325,
minValue: 0,
maxValue: sliderMaxValue,
values: sliderValue,
plugins: new Ext.slider.Tip(),
listeners:{
//changecomplete(Ext.slider.MultiSlider slider, Number newValue, Ext.slider.Thumb thumb)
changecomplete: function (slider, newValue, thumb) {
var sliderAux = slider.getValues();
var index = 0;
var sw = 0;
for (var i = 0; i <= sliderAux.length - 1 && sw == 0; i++) {
if (sliderAux[i] == newValue) {
index = i;
sw = 1;
}
}
dashletInstanceFrm.getForm().findField(additionalFieldName[(index * 2) + 1]).setValue(newValue);
if (index < (additionalFieldN / 2) - 1) {
dashletInstanceFrm.getForm().findField(additionalFieldName[(index * 2) + 1 + 1]).setValue(newValue);
}
}
});
cboDasInsOwnerType = new Ext.form.ComboBox({
id: 'cboDasInsOwnerType',
name: 'DAS_INS_OWNER_TYPE',
fieldLabel: 'Assign To',
editable: false,
width: 325,
store: storeDasInsOwnerType,
triggerAction: 'all',
mode: 'local',
value: 'USER',
valueField: 'id',
displayField: 'value',
listeners: {
select: function (combo, record, index) {
storeDasInsOwnerUID.baseParams = {'option': 'OWNERTYPE', 'type': combo.getValue()};
dashletInstance.DAS_INS_OWNER_UID = '';
cboDasInsOwnerUID.store.removeAll();
cboDasInsOwnerUID.clearValue();
cboDasInsOwnerUID.store.reload();
}
}
});
cboDasInsOwnerUID = new Ext.form.ComboBox({
id: 'cboDasInsOwnerUID',
name: 'DAS_INS_OWNER_UID',
fieldLabel: 'Name',
editable: false,
width: 325,
store: storeDasInsOwnerUID,
triggerAction: 'all',
mode: 'local',
allowBlank: false,
valueField: 'OWNER_UID',
displayField: 'OWNER_NAME'
});
formFields = [
new Ext.form.FieldSet({
title: 'General',
items: [hiddenDasInsUID, cboDasUID, cboDasInsOwnerType, cboDasInsOwnerUID]
})
];
var formFields = [
new Ext.form.FieldSet({
title: "Setting",
items:[hiddenDasInsUID,
cboDasUID,
cboDasInsType,
cboDasInsContextTime,
//txtDasInsStartDate,
//txtDasInsEndDate,
cboDasInsOwnerType,
cboDasInsOwnerUID
//,
//cboProcess,
//cboTask,
]
})
];
formFields = formFields.concat([
new Ext.form.FieldSet({
title: "Configuration",
items:[sliderRangeColor,
additionaFields
]
})
]);
// Form
dashletInstanceFrm = new Ext.form.FormPanel({
id: 'dashletInstanceFrm',
labelWidth: 100,
border: true,
width: 465,
frame: true,
title: 'Dashlet Instance Configuration',
items: formFields.concat(additionaFields),
buttonAlign: 'right',
buttons: [
new Ext.Action({
id: 'btnSubmit',
text: 'Save',
handler: function () {
if (dashletInstanceFrm.getForm().isValid()) {
var myMask = new Ext.LoadMask(Ext.getBody(), {msg: 'Saving. Please wait...'});
myMask.show();
Ext.Ajax.request({
url: 'saveDashletInstance',
method: 'POST',
params: dashletInstanceFrm.getForm().getFieldValues(),
success: function (result, request) {
myMask.hide();
var dataResponse = Ext.util.JSON.decode(result.responseText)
switch (dataResponse.status) {
case 'OK':
window.location.href = 'dashletsList';
break;
default:
Ext.MessageBox.alert('Alert', 'Dashboard Instance registered failed');
break;
}
},
failure: function (result, request) {
myMask.hide();
Ext.MessageBox.alert('Alert', 'Ajax communication failed');
}
});
}
else {
Ext.MessageBox.alert('Invalid data', 'Please check the fields mark in red.');
}
}
}),
{
xtype: 'button',
id: 'btnCancel',
text: 'Cancel',
handler: function () {
window.location.href = 'dashletsList';
}
}
]
});
//------------------------------------------------------------------------------------------------------------------
var dashletInstanceFrm = new Ext.form.FormPanel({
id: "dashletInstanceFrm",
labelWidth: 100,
border: true,
width: 465,
frame: true,
title: "Dashlet Instance Configuration",
items: formFields,
buttonAlign: "right",
buttons: [new Ext.Action({
id: "btnSubmit",
text: "Save",
handler: function () {
if (dashletInstanceFrm.getForm().isValid()) {
dashletInstanceSaveProcessAjax();
}
else {
Ext.MessageBox.alert('Invalid data', 'Please check the fields mark in red.');
}
}
}),
{xtype: "button",
id: "btnCancel",
text: "Cancel",
handler: function () {
window.location.href = "dashletsList";
}
}
]
});
// Set initial values
dashletInstanceFrm.getForm().setValues(dashletInstance);
dashletInstanceFrm.getForm().setValues(dashletInstance);
///////
var frm = dashletInstanceFrm.getForm();
var n = additionalFieldN / 2;
if (dashletInstance.DAS_INS_UID) {
for (var i = 0; i <= n - 1; i++) {
//setValue(Number index, Number value, Boolean animate)
sliderRangeColor.setValue(i, frm.findField(additionalFieldName[(i * 2) + 1]).getValue(), true);
}
}
else {
var range = parseInt(sliderMaxValue / n);
var r = range;
for (var i = 0; i <= n - 1; i++) {
sliderRangeColor.setValue(i, r, true);
frm.findField(additionalFieldName[(i * 2) + 1 - 1]).setValue(r - range);
frm.findField(additionalFieldName[(i * 2) + 1]).setValue(r);
r = r + range;
}
sliderRangeColor.setValue(n - 1, sliderMaxValue, true);
frm.findField(additionalFieldName[((n - 1) * 2) + 1]).setValue(sliderMaxValue);
}
///////
dashletInstanceFrm.render(document.body);
}
}
Ext.onReady(dashletInstance.form.init, dashletInstance.form);
// Render
dashletInstanceFrm.render(document.body);
});

View File

@@ -153,8 +153,6 @@ Ext.onReady(function(){
{name : 'DAS_INS_UID'},
{name : 'DAS_TITLE'},
{name : 'DAS_VERSION'},
{name : 'DAS_INS_TYPE'},
{name : 'DAS_INS_CONTEXT_TIME'},
{name : 'DAS_INS_OWNER_TITLE'},
{name : 'DAS_INS_UPDATE_DATE'},
{name : 'DAS_INS_STATUS_LABEL'}
@@ -172,9 +170,6 @@ Ext.onReady(function(){
{header: _('ID_NAME'), dataIndex: 'DAS_TITLE', width: 200, hidden:false, align:'left'},
{header: _('ID_VERSION'), dataIndex: 'DAS_VERSION', width: 60, hidden: false, align: 'center'},
{header: _('ID_TYPE'), dataIndex: 'DAS_INS_TYPE', width: 100, hidden: false, align: 'center'},
//{header: _('ID_PERIOD'), dataIndex: 'DAS_INS_CONTEXT_TIME', width: 100, hidden: false, align: 'center'},
{header: 'Period', dataIndex: 'DAS_INS_CONTEXT_TIME', width: 100, hidden: false, align: 'center'},
//{header: _('ID_OWNER'), dataIndex: 'DAS_INS_OWNER_TITLE', width: 200, hidden: false, align: 'center'},
{header: 'Assigned To', dataIndex: 'DAS_INS_OWNER_TITLE', width: 200, hidden: false, align: 'center'},
{header: _('ID_UPDATE_DATE'), dataIndex: 'DAS_INS_UPDATE_DATE', width: 80, hidden: false, align: 'center'},
{header: _('ID_STATUS'), dataIndex: 'DAS_INS_STATUS_LABEL', width: 60, hidden: false, align: 'center'}

View File

@@ -5,7 +5,8 @@
<PREVIOUS_STEP_LABEL type="private"/>
<PREVIOUS_ACTION type="private"/>
<NEXT_ACTION type="private"/>
<PRINT_PREVIEW_ACTION type="private" defaultValue="../cases/cases_PrintView"/>
<PHPSESSID type="private"/>
<PRINT_PREVIEW_ACTION type="private" defaultValue="../cases/cases_PrintView?PHPSESSID=@#PHPSESSID"/>
<MNUP type="print" colWidth="20" title="" value='' colAlign="left" link="@#PRINT_PREVIEW_ACTION" width="800" height="600" left="0" top="0" resizable="1">
<en>Print form</en>
</MNUP>