BUG 5073 Feature Case Notes "Free Notes"

This Feature allow a user to post a note at any stage of a Case and from cases lists

Conflicts:

	workflow/engine/data/mssql/schema.sql
	workflow/engine/methods/cases/casesListExtJs.php
	workflow/engine/skinEngine/base/css/pmos-xtheme-gray.css
	workflow/engine/templates/cases/casesList.js
	workflow/engine/templates/cases/open.js
This commit is contained in:
Hugo Loza
2011-07-14 10:45:20 -04:00
parent 002a0124d7
commit 0f7cae6d85
17 changed files with 3294 additions and 501 deletions

View File

@@ -1,80 +1,364 @@
Ext.namespace('Ext.ux');
Ext.ux.StatusBar = Ext.extend(Ext.Toolbar, {
textId: '',
defaultText: '',
/**
* @cfg {String} statusAlign
* The alignment of the status element within the overall StatusBar layout. When the StatusBar is rendered,
* it creates an internal div containing the status text and icon. Any additional Toolbar items added in the
* StatusBar's {@link #items} config, or added via {@link #add} or any of the supported add* methods, will be
* rendered, in added order, to the opposite side. The status element is greedy, so it will automatically
* expand to take up all sapce left over by any other items. Example usage:
* <pre><code>
// Create a left-aligned status bar containing a button,
// separator and text item that will be right-aligned (default):
new Ext.Panel({
title: 'StatusBar',
// etc.
bbar: new Ext.ux.StatusBar({
defaultText: 'Default status text',
id: 'status-id',
items: [{
text: 'A Button'
}, '-', 'Plain Text']
})
});
// By adding the statusAlign config, this will create the
// exact same toolbar, except the status and toolbar item
// layout will be reversed from the previous example:
new Ext.Panel({
title: 'StatusBar',
// etc.
bbar: new Ext.ux.StatusBar({
defaultText: 'Default status text',
id: 'status-id',
statusAlign: 'right',
items: [{
text: 'A Button'
}, '-', 'Plain Text']
})
});
</code></pre>
*/
/**
* @cfg {String} defaultText
* The default {@link #text} value. This will be used anytime the status bar is cleared with the
* <tt>useDefaults:true</tt> option (defaults to '').
*/
/**
* @cfg {String} defaultIconCls
* The default {@link #iconCls} value (see the iconCls docs for additional details about customizing the icon).
* This will be used anytime the status bar is cleared with the <tt>useDefaults:true</tt> option (defaults to '').
*/
/**
* @cfg {String} text
* A string that will be <b>initially</b> set as the status message. This string
* will be set as innerHTML (html tags are accepted) for the toolbar item.
* If not specified, the value set for <code>{@link #defaultText}</code>
* will be used.
*/
/**
* @cfg {String} iconCls
* A CSS class that will be <b>initially</b> set as the status bar icon and is
* expected to provide a background image (defaults to '').
* Example usage:<pre><code>
// Example CSS rule:
.x-statusbar .x-status-custom {
padding-left: 25px;
background: transparent url(images/custom-icon.gif) no-repeat 3px 2px;
}
// Setting a default icon:
var sb = new Ext.ux.StatusBar({
defaultIconCls: 'x-status-custom'
});
// Changing the icon:
sb.setStatus({
text: 'New status',
iconCls: 'x-status-custom'
});
</code></pre>
*/
/**
* @cfg {String} cls
* The base class applied to the containing element for this component on render (defaults to 'x-statusbar')
*/
cls : 'x-statusbar',
/**
* @cfg {String} busyIconCls
* The default <code>{@link #iconCls}</code> applied when calling
* <code>{@link #showBusy}</code> (defaults to <tt>'x-status-busy'</tt>).
* It can be overridden at any time by passing the <code>iconCls</code>
* argument into <code>{@link #showBusy}</code>.
*/
busyIconCls : 'x-status-busy',
/**
* @cfg {String} busyText
* The default <code>{@link #text}</code> applied when calling
* <code>{@link #showBusy}</code> (defaults to <tt>'Loading...'</tt>).
* It can be overridden at any time by passing the <code>text</code>
* argument into <code>{@link #showBusy}</code>.
*/
busyText : 'Loading...',
/**
* @cfg {Number} autoClear
* The number of milliseconds to wait after setting the status via
* <code>{@link #setStatus}</code> before automatically clearing the status
* text and icon (defaults to <tt>5000</tt>). Note that this only applies
* when passing the <tt>clear</tt> argument to <code>{@link #setStatus}</code>
* since that is the only way to defer clearing the status. This can
* be overridden by specifying a different <tt>wait</tt> value in
* <code>{@link #setStatus}</code>. Calls to <code>{@link #clearStatus}</code>
* always clear the status bar immediately and ignore this value.
*/
autoClear : 5000,
task: null,
/**
* @cfg {String} emptyText
* The text string to use if no text has been set. Defaults to
* <tt>'&nbsp;'</tt>). If there are no other items in the toolbar using
* an empty string (<tt>''</tt>) for this value would end up in the toolbar
* height collapsing since the empty string will not maintain the toolbar
* height. Use <tt>''</tt> if the toolbar should collapse in height
* vertically when no text is specified and there are no other items in
* the toolbar.
*/
emptyText : '&nbsp;',
// private
activeThreadId : 0,
// private
initComponent : function(){
this.textId = Ext.id();
this.defaultText = this.initialConfig.defaultText || '';
var text = this.initialConfig.text || this.defaultText;
var config = {
items: [
'<span id="'+this.textId+'">'+text+'</span>', // status text
'->' // make it greedy
]
};
if (this.initialConfig.items) {
config.items = config.items.concat(this.initialConfig.items);
delete this.initialConfig.items;
if(this.statusAlign=='right'){
this.cls += ' x-status-right';
}
Ext.apply(this, Ext.apply(this.initialConfig, config));
Ext.ux.StatusBar.superclass.initComponent.apply(this, arguments);
this.task = new Ext.util.DelayedTask(function() {
var el = Ext.get(this.textId);
var defaultText = this.defaultText;
el.fadeOut({
callback: function() {
el.update(defaultText);
el.show();
Ext.ux.StatusBar.superclass.initComponent.call(this);
},
duration: 1
// private
afterRender : function(){
Ext.ux.StatusBar.superclass.afterRender.call(this);
var right = this.statusAlign == 'right';
this.currIconCls = this.iconCls || this.defaultIconCls;
this.statusEl = new Ext.Toolbar.TextItem({
cls: 'x-status-text ' + (this.currIconCls || ''),
text: this.text || this.defaultText || ''
});
}, this);
if(right){
this.add('->');
this.add(this.statusEl);
}else{
this.insert(0, this.statusEl);
this.insert(1, '->');
}
this.doLayout();
},
onRender: function() {
Ext.ux.StatusBar.superclass.onRender.apply(this, arguments);
},
setText: function(text) {
var el = Ext.get(this.textId);
el.update(text);
},
setStatus: function(config) {
var defaults = {
/**
* Sets the status {@link #text} and/or {@link #iconCls}. Also supports automatically clearing the
* status that was set after a specified interval.
* @param {Object/String} config A config object specifying what status to set, or a string assumed
* to be the status text (and all other options are defaulted as explained below). A config
* object containing any or all of the following properties can be passed:<ul>
* <li><tt>text</tt> {String} : (optional) The status text to display. If not specified, any current
* status text will remain unchanged.</li>
* <li><tt>iconCls</tt> {String} : (optional) The CSS class used to customize the status icon (see
* {@link #iconCls} for details). If not specified, any current iconCls will remain unchanged.</li>
* <li><tt>clear</tt> {Boolean/Number/Object} : (optional) Allows you to set an internal callback that will
* automatically clear the status text and iconCls after a specified amount of time has passed. If clear is not
* specified, the new status will not be auto-cleared and will stay until updated again or cleared using
* {@link #clearStatus}. If <tt>true</tt> is passed, the status will be cleared using {@link #autoClear},
* {@link #defaultText} and {@link #defaultIconCls} via a fade out animation. If a numeric value is passed,
* it will be used as the callback interval (in milliseconds), overriding the {@link #autoClear} value.
* All other options will be defaulted as with the boolean option. To customize any other options,
* you can pass an object in the format:<ul>
* <li><tt>wait</tt> {Number} : (optional) The number of milliseconds to wait before clearing
* (defaults to {@link #autoClear}).</li>
* <li><tt>anim</tt> {Number} : (optional) False to clear the status immediately once the callback
* executes (defaults to true which fades the status out).</li>
* <li><tt>useDefaults</tt> {Number} : (optional) False to completely clear the status text and iconCls
* (defaults to true which uses {@link #defaultText} and {@link #defaultIconCls}).</li>
* </ul></li></ul>
* Example usage:<pre><code>
// Simple call to update the text
statusBar.setStatus('New status');
// Set the status and icon, auto-clearing with default options:
statusBar.setStatus({
text: 'New status',
iconCls: 'x-status-custom',
clear: true
});
// Auto-clear with custom options:
statusBar.setStatus({
text: 'New status',
iconCls: 'x-status-custom',
clear: {
wait: this.autoClear,
anim: true,
useDefaults: true
}
};
if (config.clear === true) {
delete config.clear;
}
if (!Ext.isArray(config)) {
config = {
text: config.text || ''
}
}
Ext.apply(config, defaults);
var el = Ext.get(this.textId);
el.update(config.text);
var clear = config.clear;
var defaultText = this.defaultText;
if (clear.wait) {
this.task.delay(clear.wait);
}
else {
this.task.cancel();
}
},
clearStatus: function() {
this.setText(this.defaultText);
this.task.cancel();
},
showBusy: function(msg) {
// stub for now
wait: 8000,
anim: false,
useDefaults: false
}
});
</code></pre>
* @return {Ext.ux.StatusBar} this
*/
setStatus : function(o){
o = o || {};
if(typeof o == 'string'){
o = {text:o};
}
if(o.text !== undefined){
this.setText(o.text);
}
if(o.iconCls !== undefined){
this.setIcon(o.iconCls);
}
if(o.clear){
var c = o.clear,
wait = this.autoClear,
defaults = {useDefaults: true, anim: true};
if(typeof c == 'object'){
c = Ext.applyIf(c, defaults);
if(c.wait){
wait = c.wait;
}
}else if(typeof c == 'number'){
wait = c;
c = defaults;
}else if(typeof c == 'boolean'){
c = defaults;
}
c.threadId = this.activeThreadId;
this.clearStatus.defer(wait, this, [c]);
}
return this;
},
/**
* Clears the status {@link #text} and {@link #iconCls}. Also supports clearing via an optional fade out animation.
* @param {Object} config (optional) A config object containing any or all of the following properties. If this
* object is not specified the status will be cleared using the defaults below:<ul>
* <li><tt>anim</tt> {Boolean} : (optional) True to clear the status by fading out the status element (defaults
* to false which clears immediately).</li>
* <li><tt>useDefaults</tt> {Boolean} : (optional) True to reset the text and icon using {@link #defaultText} and
* {@link #defaultIconCls} (defaults to false which sets the text to '' and removes any existing icon class).</li>
* </ul>
* @return {Ext.ux.StatusBar} this
*/
clearStatus : function(o){
o = o || {};
if(o.threadId && o.threadId !== this.activeThreadId){
// this means the current call was made internally, but a newer
// thread has set a message since this call was deferred. Since
// we don't want to overwrite a newer message just ignore.
return this;
}
var text = o.useDefaults ? this.defaultText : this.emptyText,
iconCls = o.useDefaults ? (this.defaultIconCls ? this.defaultIconCls : '') : '';
if(o.anim){
// animate the statusEl Ext.Element
this.statusEl.el.fadeOut({
remove: false,
useDisplay: true,
scope: this,
callback: function(){
this.setStatus({
text: text,
iconCls: iconCls
});
this.statusEl.el.show();
}
});
}else{
// hide/show the el to avoid jumpy text or icon
this.statusEl.hide();
this.setStatus({
text: text,
iconCls: iconCls
});
this.statusEl.show();
}
return this;
},
/**
* Convenience method for setting the status text directly. For more flexible options see {@link #setStatus}.
* @param {String} text (optional) The text to set (defaults to '')
* @return {Ext.ux.StatusBar} this
*/
setText : function(text){
this.activeThreadId++;
this.text = text || '';
if(this.rendered){
this.statusEl.setText(this.text);
}
return this;
},
/**
* Returns the current status text.
* @return {String} The status text
*/
getText : function(){
return this.text;
},
/**
* Convenience method for setting the status icon directly. For more flexible options see {@link #setStatus}.
* See {@link #iconCls} for complete details about customizing the icon.
* @param {String} iconCls (optional) The icon class to set (defaults to '', and any current icon class is removed)
* @return {Ext.ux.StatusBar} this
*/
setIcon : function(cls){
this.activeThreadId++;
cls = cls || '';
if(this.rendered){
if(this.currIconCls){
this.statusEl.removeClass(this.currIconCls);
this.currIconCls = null;
}
if(cls.length > 0){
this.statusEl.addClass(cls);
this.currIconCls = cls;
}
}else{
this.currIconCls = cls;
}
return this;
},
/**
* Convenience method for setting the status text and icon to special values that are pre-configured to indicate
* a "busy" state, usually for loading or processing activities.
* @param {Object/String} config (optional) A config object in the same format supported by {@link #setStatus}, or a
* string to use as the status text (in which case all other options for setStatus will be defaulted). Use the
* <tt>text</tt> and/or <tt>iconCls</tt> properties on the config to override the default {@link #busyText}
* and {@link #busyIconCls} settings. If the config argument is not specified, {@link #busyText} and
* {@link #busyIconCls} will be used in conjunction with all of the default options for {@link #setStatus}.
* @return {Ext.ux.StatusBar} this
*/
showBusy : function(o){
if(typeof o == 'string'){
o = {text:o};
}
o = Ext.applyIf(o || {}, {
text: this.busyText,
iconCls: this.busyIconCls
});
return this.setStatus(o);
}
});
Ext.reg('statusbar', Ext.ux.StatusBar);

View File

@@ -5394,4 +5394,39 @@ class Cases {
return $rows;
}
/*
* this function gets all users that already participated in a case
*
* @name getUsersParticipatedInCase
* @param string $sAppUid
* @return array (criteria+array)
*/
function getUsersParticipatedInCase($sAppUid) {
$c = new Criteria('workflow');
$c->addSelectColumn(AppDelegationPeer::APP_UID);
$c->addSelectColumn(AppDelegationPeer::USR_UID);
$c->addSelectColumn(UsersPeer::USR_USERNAME);
$c->addSelectColumn(UsersPeer::USR_EMAIL);
$c->add(AppDelegationPeer::APP_UID, $sAppUid, CRITERIA::EQUAL);
$c->addJoin(AppDelegationPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
$rs = AppDelegationPeer::doSelectRS($c);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rows=array();
$rs->next();
while ($row = $rs->getRow()){
$rows[$row['USR_UID']]=$row;
$rs->next();
}
$response['criteria']=$c;
$response['array']=$rows;
return $response;
}
}

View File

@@ -0,0 +1,253 @@
<?php
require_once 'classes/model/om/BaseAppNotes.php';
/**
* Skeleton subclass for representing a row from the 'APP_NOTES' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class AppNotes extends BaseAppNotes {
function getNotesList($appUid, $usrUid, $start, $limit) {
require_once ( "classes/model/Users.php" );
$Criteria = new Criteria('workflow');
$Criteria->clearSelectColumns();
$Criteria->addSelectColumn(AppNotesPeer::APP_UID);
$Criteria->addSelectColumn(AppNotesPeer::USR_UID);
$Criteria->addSelectColumn(AppNotesPeer::NOTE_DATE);
$Criteria->addSelectColumn(AppNotesPeer::NOTE_CONTENT);
$Criteria->addSelectColumn(AppNotesPeer::NOTE_TYPE);
$Criteria->addSelectColumn(AppNotesPeer::NOTE_AVAILABILITY);
$Criteria->addSelectColumn(AppNotesPeer::NOTE_ORIGIN_OBJ);
$Criteria->addSelectColumn(AppNotesPeer::NOTE_AFFECTED_OBJ1);
$Criteria->addSelectColumn(AppNotesPeer::NOTE_AFFECTED_OBJ2);
$Criteria->addSelectColumn(AppNotesPeer::NOTE_RECIPIENTS);
$Criteria->addSelectColumn(UsersPeer::USR_USERNAME);
$Criteria->addSelectColumn(UsersPeer::USR_EMAIL);
$Criteria->addJoin(AppNotesPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
$Criteria->add(appNotesPeer::APP_UID, $appUid, CRITERIA::EQUAL);
$Criteria->addDescendingOrderByColumn(AppNotesPeer::NOTE_DATE);
$response = array();
$totalCount = AppNotesPeer::doCount($Criteria);
$response['totalCount'] = $totalCount;
$response['notes'] = array();
$Criteria->setLimit($limit);
$Criteria->setOffset($start);
$oDataset = appNotesPeer::doSelectRS($Criteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$response['notes'][] = $aRow;
$oDataset->next();
}
$result['criteria'] = $Criteria;
$result['array'] = $response;
return $result;
}
function postNewNote($appUid, $usrUid, $noteContent, $notify=true, $noteAvalibility="PUBLIC", $noteRecipients="", $noteType="USER", $noteDate="now") {
if($noteRecipients==""){
$noteRecipientsA=array();
G::LoadClass('case');
$oCase = new Cases ();
$p=$oCase->getUsersParticipatedInCase($appUid);
foreach($p['array'] as $key => $userParticipated){
$noteRecipientsA[]=$key;
}
$noteRecipients=implode(",",$noteRecipientsA);
}
$this->setAppUid($appUid);
$this->setUsrUid($usrUid);
$this->setNoteDate($noteDate);
$this->setNoteContent($noteContent);
$this->setNoteType($noteType);
$this->setNoteAvailability($noteAvalibility);
$this->setNoteOriginObj('');
$this->setNoteAffectedObj1('');
$this->setNoteAffectedObj2('');
$this->setNoteRecipients($noteRecipients);
if ($this->validate()) {
// we save it, since we get no validation errors, or do whatever else you like.
$res = $this->save();
$msg = '';
} else {
// Something went wrong. We can now get the validationFailures and handle them.
$msg = '';
$validationFailuresArray = $this->getValidationFailures();
foreach ($validationFailuresArray as $objValidationFailure) {
$msg .= $objValidationFailure->getMessage() . "<br/>";
}
//return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $msg );
}
if ($msg != "") {
$response['success'] = 'failure';
$response['message'] = $msg;
} else {
$response['success'] = 'success';
$response['message'] = 'Saved...';
}
if($notify){
$this->sendNoteNotification($appUid, $usrUid, $noteContent, $noteRecipients);
}
return $response;
}
private function sendNoteNotification($appUid, $usrUid, $noteContent, $noteRecipients, $sFrom="") {
try {
require_once ('classes/model/Configuration.php');
$oConfiguration = new Configuration();
$sDelimiter = DBAdapter::getStringDelimiter();
$oCriteria = new Criteria('workflow');
$oCriteria->add(ConfigurationPeer::CFG_UID, 'Emails');
$oCriteria->add(ConfigurationPeer::OBJ_UID, '');
$oCriteria->add(ConfigurationPeer::PRO_UID, '');
$oCriteria->add(ConfigurationPeer::USR_UID, '');
$oCriteria->add(ConfigurationPeer::APP_UID, '');
if (ConfigurationPeer::doCount($oCriteria) == 0) {
$oConfiguration->create(array('CFG_UID' => 'Emails', 'OBJ_UID' => '', 'CFG_VALUE' => '', 'PRO_UID' => '', 'USR_UID' => '', 'APP_UID' => ''));
$aConfiguration = array();
} else {
$aConfiguration = $oConfiguration->load('Emails', '', '', '', '');
if ($aConfiguration['CFG_VALUE'] != '') {
$aConfiguration = unserialize($aConfiguration['CFG_VALUE']);
} else {
$aConfiguration = array();
}
}
if (!isset($aConfiguration['MESS_ENABLED']) || $aConfiguration['MESS_ENABLED'] != '1') {
return false;
}
G::LoadClass('case');
$oCase = new Cases ();
$aFields = $oCase->loadCase( $appUid );
$configNoteNotification['subject']=G::LoadTranslation('ID_MESSAGE_SUBJECT_NOTE_NOTIFICATION')." @@APP_TITLE ";
$configNoteNotification['body']=G::LoadTranslation('ID_CASE').": @@APP_TITLE<br />".G::LoadTranslation('ID_AUTHOR').": @@USR_USRNAME<br /><br />$noteContent";
if ($sFrom == '') {
$sFrom = '"ProcessMaker"';
}
if (($aConfiguration['MESS_ENGINE'] != 'MAIL') && ($aConfiguration['MESS_ACCOUNT'] != '')) {
$sFrom .= ' <' . $aConfiguration['MESS_ACCOUNT'] . '>';
} else {
if (($aConfiguration['MESS_ENGINE'] == 'MAIL')) {
$sFrom .= ' <info@' . gethostbyaddr('127.0.0.1') . '>';
} else {
if ($aConfiguration['MESS_SERVER'] != '') {
if (($sAux = @gethostbyaddr($aConfiguration['MESS_SERVER']))) {
$sFrom .= ' <info@' . $sAux . '>';
} else {
$sFrom .= ' <info@' . $aConfiguration['MESS_SERVER'] . '>';
}
} else {
$sFrom .= ' <info@processmaker.com>';
}
}
}
$sSubject = G::replaceDataField($configNoteNotification['subject'], $aFields);
//erik: new behaviour for messages
//G::loadClass('configuration');
//$oConf = new Configurations;
//$oConf->loadConfig($x, 'TAS_EXTRA_PROPERTIES', $aTaskInfo['TAS_UID'], '', '');
//$conf = $oConf->aConfig;
/*
if( isset($conf['TAS_DEF_MESSAGE_TYPE']) && isset($conf['TAS_DEF_MESSAGE_TEMPLATE'])
&& $conf['TAS_DEF_MESSAGE_TYPE'] == 'template' && $conf['TAS_DEF_MESSAGE_TEMPLATE'] != '') {
$pathEmail = PATH_DATA_SITE . 'mailTemplates' . PATH_SEP . $aTaskInfo['PRO_UID'] . PATH_SEP;
$fileTemplate = $pathEmail . $conf['TAS_DEF_MESSAGE_TEMPLATE'];
if ( ! file_exists ( $fileTemplate ) ) {
throw new Exception("Template file '$fileTemplate' does not exist.");
}
$sBody = G::replaceDataField(file_get_contents($fileTemplate), $aFields);
} else {*/
$sBody = nl2br(G::replaceDataField($configNoteNotification['body'], $aFields));
/*}*/
G::LoadClass('spool');
$oUser = new Users();
$recipientsArray=explode(",",$noteRecipients);
foreach($recipientsArray as $recipientUid){
$aUser = $oUser->load($recipientUid);
$sTo = ((($aUser['USR_FIRSTNAME'] != '') || ($aUser['USR_LASTNAME'] != '')) ? $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' ' : '') . '<' . $aUser['USR_EMAIL'] . '>';
$oSpool = new spoolRun();
$oSpool->setConfig(array('MESS_ENGINE' => $aConfiguration['MESS_ENGINE'],
'MESS_SERVER' => $aConfiguration['MESS_SERVER'],
'MESS_PORT' => $aConfiguration['MESS_PORT'],
'MESS_ACCOUNT' => $aConfiguration['MESS_ACCOUNT'],
'MESS_PASSWORD' => $aConfiguration['MESS_PASSWORD'],
'SMTPAuth' => $aConfiguration['MESS_RAUTH'] == '1' ? true : false,
'SMTPSecure' => isset($aConfiguration['SMTPSecure']) ? $aConfiguration['SMTPSecure'] : ''
));
$oSpool->create(array('msg_uid' => '',
'app_uid' => $appUid,
'del_index' => 1,
'app_msg_type' => 'DERIVATION',
'app_msg_subject' => $sSubject,
'app_msg_from' => $sFrom,
'app_msg_to' => $sTo,
'app_msg_body' => $sBody,
'app_msg_cc' => '',
'app_msg_bcc' => '',
'app_msg_attach' => '',
'app_msg_template' => '',
'app_msg_status' => 'pending'
));
if (($aConfiguration['MESS_BACKGROUND'] == '') || ($aConfiguration['MESS_TRY_SEND_INMEDIATLY'] == '1')) {
$oSpool->sendMail();
}
}
//Send derivation notification - End
} catch (Exception $oException) {
throw $oException;
}
}
}

View File

@@ -0,0 +1,23 @@
<?php
// include base peer class
require_once 'classes/model/om/BaseAppNotesPeer.php';
// include object class
include_once 'classes/model/AppNotes.php';
/**
* Skeleton subclass for performing query and update operations on the 'APP_NOTES' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class AppNotesPeer extends BaseAppNotesPeer {
} // AppNotesPeer

View File

@@ -0,0 +1,89 @@
<?php
require_once 'propel/map/MapBuilder.php';
include_once 'creole/CreoleTypes.php';
/**
* This class adds structure of 'APP_NOTES' table to 'workflow' DatabaseMap object.
*
*
*
* These statically-built map classes are used by Propel to do runtime db structure discovery.
* For example, the createSelectSql() method checks the type of a given column used in an
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
* (i.e. if it's a text column type).
*
* @package workflow.classes.model.map
*/
class AppNotesMapBuilder {
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'classes.model.map.AppNotesMapBuilder';
/**
* The database map.
*/
private $dbMap;
/**
* Tells us if this DatabaseMapBuilder is built so that we
* don't have to re-build it every time.
*
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
*/
public function isBuilt()
{
return ($this->dbMap !== null);
}
/**
* Gets the databasemap this map builder built.
*
* @return the databasemap
*/
public function getDatabaseMap()
{
return $this->dbMap;
}
/**
* The doBuild() method builds the DatabaseMap
*
* @return void
* @throws PropelException
*/
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('workflow');
$tMap = $this->dbMap->addTable('APP_NOTES');
$tMap->setPhpName('AppNotes');
$tMap->setUseIdGenerator(false);
$tMap->addColumn('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('NOTE_DATE', 'NoteDate', 'int', CreoleTypes::TIMESTAMP, true, null);
$tMap->addColumn('NOTE_CONTENT', 'NoteContent', 'string', CreoleTypes::LONGVARCHAR, true, null);
$tMap->addColumn('NOTE_TYPE', 'NoteType', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('NOTE_AVAILABILITY', 'NoteAvailability', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('NOTE_ORIGIN_OBJ', 'NoteOriginObj', 'string', CreoleTypes::VARCHAR, false, 32);
$tMap->addColumn('NOTE_AFFECTED_OBJ1', 'NoteAffectedObj1', 'string', CreoleTypes::VARCHAR, false, 32);
$tMap->addColumn('NOTE_AFFECTED_OBJ2', 'NoteAffectedObj2', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('NOTE_RECIPIENTS', 'NoteRecipients', 'string', CreoleTypes::LONGVARCHAR, false, null);
} // doBuild()
} // AppNotesMapBuilder

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,572 @@
<?php
require_once 'propel/util/BasePeer.php';
// The object class -- needed for instanceof checks in this class.
// actual class may be a subclass -- as returned by AppNotesPeer::getOMClass()
include_once 'classes/model/AppNotes.php';
/**
* Base static class for performing query and update operations on the 'APP_NOTES' table.
*
*
*
* @package workflow.classes.model.om
*/
abstract class BaseAppNotesPeer {
/** the default database name for this class */
const DATABASE_NAME = 'workflow';
/** the table name for this class */
const TABLE_NAME = 'APP_NOTES';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'classes.model.AppNotes';
/** The total number of columns. */
const NUM_COLUMNS = 10;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** the column name for the APP_UID field */
const APP_UID = 'APP_NOTES.APP_UID';
/** the column name for the USR_UID field */
const USR_UID = 'APP_NOTES.USR_UID';
/** the column name for the NOTE_DATE field */
const NOTE_DATE = 'APP_NOTES.NOTE_DATE';
/** the column name for the NOTE_CONTENT field */
const NOTE_CONTENT = 'APP_NOTES.NOTE_CONTENT';
/** the column name for the NOTE_TYPE field */
const NOTE_TYPE = 'APP_NOTES.NOTE_TYPE';
/** the column name for the NOTE_AVAILABILITY field */
const NOTE_AVAILABILITY = 'APP_NOTES.NOTE_AVAILABILITY';
/** the column name for the NOTE_ORIGIN_OBJ field */
const NOTE_ORIGIN_OBJ = 'APP_NOTES.NOTE_ORIGIN_OBJ';
/** the column name for the NOTE_AFFECTED_OBJ1 field */
const NOTE_AFFECTED_OBJ1 = 'APP_NOTES.NOTE_AFFECTED_OBJ1';
/** the column name for the NOTE_AFFECTED_OBJ2 field */
const NOTE_AFFECTED_OBJ2 = 'APP_NOTES.NOTE_AFFECTED_OBJ2';
/** the column name for the NOTE_RECIPIENTS field */
const NOTE_RECIPIENTS = 'APP_NOTES.NOTE_RECIPIENTS';
/** The PHP to DB Name Mapping */
private static $phpNameMap = null;
/**
* holds an array of fieldnames
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('AppUid', 'UsrUid', 'NoteDate', 'NoteContent', 'NoteType', 'NoteAvailability', 'NoteOriginObj', 'NoteAffectedObj1', 'NoteAffectedObj2', 'NoteRecipients', ),
BasePeer::TYPE_COLNAME => array (AppNotesPeer::APP_UID, AppNotesPeer::USR_UID, AppNotesPeer::NOTE_DATE, AppNotesPeer::NOTE_CONTENT, AppNotesPeer::NOTE_TYPE, AppNotesPeer::NOTE_AVAILABILITY, AppNotesPeer::NOTE_ORIGIN_OBJ, AppNotesPeer::NOTE_AFFECTED_OBJ1, AppNotesPeer::NOTE_AFFECTED_OBJ2, AppNotesPeer::NOTE_RECIPIENTS, ),
BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'USR_UID', 'NOTE_DATE', 'NOTE_CONTENT', 'NOTE_TYPE', 'NOTE_AVAILABILITY', 'NOTE_ORIGIN_OBJ', 'NOTE_AFFECTED_OBJ1', 'NOTE_AFFECTED_OBJ2', 'NOTE_RECIPIENTS', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
);
/**
* holds an array of keys for quick access to the fieldnames array
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'UsrUid' => 1, 'NoteDate' => 2, 'NoteContent' => 3, 'NoteType' => 4, 'NoteAvailability' => 5, 'NoteOriginObj' => 6, 'NoteAffectedObj1' => 7, 'NoteAffectedObj2' => 8, 'NoteRecipients' => 9, ),
BasePeer::TYPE_COLNAME => array (AppNotesPeer::APP_UID => 0, AppNotesPeer::USR_UID => 1, AppNotesPeer::NOTE_DATE => 2, AppNotesPeer::NOTE_CONTENT => 3, AppNotesPeer::NOTE_TYPE => 4, AppNotesPeer::NOTE_AVAILABILITY => 5, AppNotesPeer::NOTE_ORIGIN_OBJ => 6, AppNotesPeer::NOTE_AFFECTED_OBJ1 => 7, AppNotesPeer::NOTE_AFFECTED_OBJ2 => 8, AppNotesPeer::NOTE_RECIPIENTS => 9, ),
BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'USR_UID' => 1, 'NOTE_DATE' => 2, 'NOTE_CONTENT' => 3, 'NOTE_TYPE' => 4, 'NOTE_AVAILABILITY' => 5, 'NOTE_ORIGIN_OBJ' => 6, 'NOTE_AFFECTED_OBJ1' => 7, 'NOTE_AFFECTED_OBJ2' => 8, 'NOTE_RECIPIENTS' => 9, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
);
/**
* @return MapBuilder the map builder for this peer
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function getMapBuilder()
{
include_once 'classes/model/map/AppNotesMapBuilder.php';
return BasePeer::getMapBuilder('classes.model.map.AppNotesMapBuilder');
}
/**
* Gets a map (hash) of PHP names to DB column names.
*
* @return array The PHP to DB name map for this peer
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
*/
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = AppNotesPeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
/**
* Translates a fieldname to another type
*
* @param string $name field name
* @param string $fromType One of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @param string $toType One of the class type constants
* @return string translated name of the field.
*/
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
/**
* Returns an array of of field names.
*
* @param string $type The type of fieldnames to return:
* One of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @return array A list of field names
*/
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
/**
* Convenience method which changes table.column to alias.column.
*
* Using this method you can maintain SQL abstraction while using column aliases.
* <code>
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
* </code>
* @param string $alias The alias for the current table.
* @param string $column The column name for current table. (i.e. AppNotesPeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(AppNotesPeer::TABLE_NAME.'.', $alias.'.', $column);
}
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param criteria object containing the columns to add.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(AppNotesPeer::APP_UID);
$criteria->addSelectColumn(AppNotesPeer::USR_UID);
$criteria->addSelectColumn(AppNotesPeer::NOTE_DATE);
$criteria->addSelectColumn(AppNotesPeer::NOTE_CONTENT);
$criteria->addSelectColumn(AppNotesPeer::NOTE_TYPE);
$criteria->addSelectColumn(AppNotesPeer::NOTE_AVAILABILITY);
$criteria->addSelectColumn(AppNotesPeer::NOTE_ORIGIN_OBJ);
$criteria->addSelectColumn(AppNotesPeer::NOTE_AFFECTED_OBJ1);
$criteria->addSelectColumn(AppNotesPeer::NOTE_AFFECTED_OBJ2);
$criteria->addSelectColumn(AppNotesPeer::NOTE_RECIPIENTS);
}
const COUNT = 'COUNT(*)';
const COUNT_DISTINCT = 'COUNT(DISTINCT *)';
/**
* Returns the number of rows matching criteria.
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
* @param Connection $con
* @return int Number of matching rows.
*/
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// clear out anything that might confuse the ORDER BY clause
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(AppNotesPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(AppNotesPeer::COUNT);
}
// just in case we're grouping: add those columns to the select statement
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$rs = AppNotesPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
// no rows returned; we infer that means 0 matches.
return 0;
}
}
/**
* Method to select one object from the DB.
*
* @param Criteria $criteria object used to create the SELECT statement.
* @param Connection $con
* @return AppNotes
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = AppNotesPeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
/**
* Method to do selects.
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param Connection $con
* @return array Array of selected Objects
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelect(Criteria $criteria, $con = null)
{
return AppNotesPeer::populateObjects(AppNotesPeer::doSelectRS($criteria, $con));
}
/**
* Prepares the Criteria object and uses the parent doSelect()
* method to get a ResultSet.
*
* Use this method directly if you want to just get the resultset
* (instead of an array of objects).
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param Connection $con the connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return ResultSet The resultset object with numerically-indexed fields.
* @see BasePeer::doSelect()
*/
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
AppNotesPeer::addSelectColumns($criteria);
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
// BasePeer returns a Creole ResultSet, set to return
// rows indexed numerically.
return BasePeer::doSelect($criteria, $con);
}
/**
* The returned array will contain objects of the default type or
* objects that inherit from the default.
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function populateObjects(ResultSet $rs)
{
$results = array();
// set the class once to avoid overhead in the loop
$cls = AppNotesPeer::getOMClass();
$cls = Propel::import($cls);
// populate the object(s)
while($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
/**
* Returns the TableMap related to this peer.
* This method is not needed for general use but a specific application could have a need.
* @return TableMap
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
/**
* The class that the Peer will make instances of.
*
* This uses a dot-path notation which is tranalted into a path
* relative to a location on the PHP include_path.
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
*
* @return string path.to.ClassName
*/
public static function getOMClass()
{
return AppNotesPeer::CLASS_DEFAULT;
}
/**
* Method perform an INSERT on the database, given a AppNotes or Criteria object.
*
* @param mixed $values Criteria or AppNotes object containing data that is used to create the INSERT statement.
* @param Connection $con the connection to use
* @return mixed The new primary key.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} else {
$criteria = $values->buildCriteria(); // build Criteria from AppNotes object
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
try {
// use transaction because $criteria could contain info
// for more than one table (I guess, conceivably)
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch(PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
/**
* Method perform an UPDATE on the database, given a AppNotes or Criteria object.
*
* @param mixed $values Criteria or AppNotes object containing data that is used to create the UPDATE statement.
* @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
* @return int The number of affected rows (if supported by underlying database driver).
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} else { // $values is AppNotes object
$criteria = $values->buildCriteria(); // gets full criteria
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
}
// set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
/**
* Method to DELETE all rows from the APP_NOTES table.
*
* @return int The number of affected rows (if supported by underlying database driver).
*/
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->begin();
$affectedRows += BasePeer::doDeleteAll(AppNotesPeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* Method perform a DELETE on the database, given a AppNotes or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or AppNotes object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param Connection $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
* if supported by native driver or if emulated using Propel.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(AppNotesPeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} elseif ($values instanceof AppNotes) {
$criteria = $values->buildCriteria();
} else {
// it must be the primary key
$criteria = new Criteria(self::DATABASE_NAME);
// primary key is composite; we therefore, expect
// the primary key passed to be an array of pkey
// values
if(count($values) == count($values, COUNT_RECURSIVE))
{
// array is not multi-dimensional
$values = array($values);
}
$vals = array();
foreach($values as $value)
{
}
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->begin();
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* Validates all modified columns of given AppNotes object.
* If parameter $columns is either a single column name or an array of column names
* than only those columns are validated.
*
* NOTICE: This does not apply to primary or foreign keys for now.
*
* @param AppNotes $obj The object to validate.
* @param mixed $cols Column name or array of column names.
*
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
*/
public static function doValidate(AppNotes $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(AppNotesPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(AppNotesPeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
return BasePeer::doValidate(AppNotesPeer::DATABASE_NAME, AppNotesPeer::TABLE_NAME, $columns);
}
} // BaseAppNotesPeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
// the MapBuilder classes register themselves with Propel during initialization
// so we need to load them here.
try {
BaseAppNotesPeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
// even if Propel is not yet initialized, the map builder class can be registered
// now and then it will be loaded when Propel initializes.
require_once 'classes/model/map/AppNotesMapBuilder.php';
Propel::registerMapBuilder('classes.model.map.AppNotesMapBuilder');
}

View File

@@ -2717,4 +2717,36 @@
<column name="CATEGORY_NAME" type="VARCHAR" size="100" required="true" default=""/>
<column name="CATEGORY_ICON" type="VARCHAR" size="100" default=""/>
</table>
<table name="APP_NOTES">
<vendor type="mysql">
<parameter name="Name" value="APP_NOTES"/>
<parameter name="Engine" value="MyISAM"/>engi
<parameter name="Version" value="10"/>
<parameter name="Row_format" value="Dynamic"/>
<parameter name="Rows" value="129"/>
<parameter name="Avg_row_length" value="115"/>
<parameter name="Data_length" value="14860"/>
<parameter name="Max_data_length" value="281474976710655"/>
<parameter name="Index_length" value="5120"/>
<parameter name="Data_free" value="0"/>
<parameter name="Auto_increment" value=""/>
<parameter name="Create_time" value="2007-12-06 07:22:27"/>
<parameter name="Update_time" value="2007-12-09 14:08:22"/>
<parameter name="Check_time" value=""/>
<parameter name="Collation" value="utf8_general_ci"/>
<parameter name="Checksum" value=""/>
<parameter name="Create_options" value=""/>
<parameter name="Comment" value="Application Notes"/>
</vendor>
<column name="APP_UID" type="VARCHAR" size="32" required="true" default=""/>
<column name="USR_UID" type="VARCHAR" size="32" required="true" default=""/>
<column name="NOTE_DATE" type="TIMESTAMP" required="true"/>
<column name="NOTE_CONTENT" type="LONGVARCHAR" required="true"/>
<column name="NOTE_TYPE" type="VARCHAR" size="32" required="true" default="USER"/>
<column name="NOTE_AVAILABILITY" type="VARCHAR" size="32" required="true" default="PUBLIC"/>
<column name="NOTE_ORIGIN_OBJ" type="VARCHAR" size="32" default=""/>
<column name="NOTE_AFFECTED_OBJ1" type="VARCHAR" size="32" default=""/>
<column name="NOTE_AFFECTED_OBJ2" type="VARCHAR" size="32" required="true" default=""/>
<column name="NOTE_RECIPIENTS" type="LONGVARCHAR" />
</table>
</database>

View File

@@ -46,12 +46,12 @@ CREATE TABLE [APPLICATION]
[APP_INIT_DATE] CHAR(19) NOT NULL,
[APP_FINISH_DATE] CHAR(19) NOT NULL,
[APP_UPDATE_DATE] CHAR(19) NOT NULL,
[APP_DATA] VARCHAR(MAX) NULL,
[APP_PIN] VARCHAR(32) default '' NULL,
[APP_DATA] NVARCHAR(MAX) NOT NULL,
[APP_PIN] VARCHAR(32) default '' NOT NULL,
CONSTRAINT APPLICATION_PK PRIMARY KEY ([APP_UID])
);
CREATE INDEX [indexApp] ON [APPLICATION] ([PRO_UID],[APP_UID]);
CREATE INDEX [indexApp] ON [APPLICATION] ([PRO_UID],[APP_STATUS],[APP_UID]);
/* ---------------------------------------------------------------------- */
/* APP_DELEGATION */
@@ -103,11 +103,11 @@ CREATE TABLE [APP_DELEGATION]
[DEL_DURATION] FLOAT default 0 NULL,
[DEL_QUEUE_DURATION] FLOAT default 0 NULL,
[DEL_DELAY_DURATION] FLOAT default 0 NULL,
[DEL_STARTED] INT default 0 NULL,
[DEL_STARTED] TINYINT default 0 NULL,
[DEL_FINISHED] TINYINT default 0 NULL,
[DEL_DELAYED] TINYINT default 0 NULL,
[DEL_DATA] TEXT NOT NULL,
[APP_OVERDUE_PERCENTAGE] FLOAT NULL,
[DEL_DATA] NVARCHAR(MAX) NOT NULL,
[APP_OVERDUE_PERCENTAGE] FLOAT default 0 NOT NULL,
CONSTRAINT APP_DELEGATION_PK PRIMARY KEY ([APP_UID],[DEL_INDEX])
);
@@ -155,7 +155,7 @@ CREATE TABLE [APP_DOCUMENT]
[APP_DOC_INDEX] INT NOT NULL,
[FOLDER_UID] VARCHAR(32) default '' NULL,
[APP_DOC_PLUGIN] VARCHAR(150) default '' NULL,
[APP_DOC_TAGS] TEXT NULL,
[APP_DOC_TAGS] NVARCHAR(MAX) NULL,
[APP_DOC_STATUS] VARCHAR(32) default 'ACTIVE' NOT NULL,
[APP_DOC_STATUS_DATE] CHAR(19) NULL,
CONSTRAINT APP_DOCUMENT_PK PRIMARY KEY ([APP_DOC_UID],[DOC_VERSION])
@@ -201,14 +201,14 @@ CREATE TABLE [APP_MESSAGE]
[APP_MSG_TYPE] VARCHAR(100) default '' NOT NULL,
[APP_MSG_SUBJECT] VARCHAR(150) default '' NOT NULL,
[APP_MSG_FROM] VARCHAR(100) default '' NOT NULL,
[APP_MSG_TO] TEXT NOT NULL,
[APP_MSG_BODY] TEXT NOT NULL,
[APP_MSG_TO] NVARCHAR(MAX) NOT NULL,
[APP_MSG_BODY] NVARCHAR(MAX) NOT NULL,
[APP_MSG_DATE] CHAR(19) NOT NULL,
[APP_MSG_CC] TEXT NULL,
[APP_MSG_BCC] TEXT NULL,
[APP_MSG_TEMPLATE] TEXT NULL,
[APP_MSG_CC] NVARCHAR(MAX) NULL,
[APP_MSG_BCC] NVARCHAR(MAX) NULL,
[APP_MSG_TEMPLATE] NVARCHAR(MAX) NULL,
[APP_MSG_STATUS] VARCHAR(20) NULL,
[APP_MSG_ATTACH] TEXT NULL,
[APP_MSG_ATTACH] NVARCHAR(MAX) NULL,
[APP_MSG_SEND_DATE] CHAR(19) NOT NULL,
CONSTRAINT APP_MESSAGE_PK PRIMARY KEY ([APP_MSG_UID])
);
@@ -287,7 +287,7 @@ CREATE TABLE [CONFIGURATION]
(
[CFG_UID] VARCHAR(32) default '' NOT NULL,
[OBJ_UID] VARCHAR(128) default '' NOT NULL,
[CFG_VALUE] VARCHAR(MAX) NOT NULL,
[CFG_VALUE] NVARCHAR(MAX) NOT NULL,
[PRO_UID] VARCHAR(32) default '' NOT NULL,
[USR_UID] VARCHAR(32) default '' NOT NULL,
[APP_UID] VARCHAR(32) default '' NOT NULL,
@@ -331,11 +331,11 @@ CREATE TABLE [CONTENT]
[CON_PARENT] VARCHAR(32) default '' NOT NULL,
[CON_ID] VARCHAR(100) default '' NOT NULL,
[CON_LANG] VARCHAR(10) default '' NOT NULL,
[CON_VALUE] VARCHAR(MAX) NULL,
[CON_VALUE] NVARCHAR(MAX) NOT NULL,
CONSTRAINT CONTENT_PK PRIMARY KEY ([CON_CATEGORY],[CON_PARENT],[CON_ID],[CON_LANG])
);
CREATE INDEX [indexUid] ON [CONTENT] ([CON_ID]);
CREATE INDEX [indexUid] ON [CONTENT] ([CON_ID],[CON_CATEGORY],[CON_LANG]);
/* ---------------------------------------------------------------------- */
/* DEPARTMENT */
@@ -578,8 +578,8 @@ CREATE TABLE [INPUT_DOCUMENT]
[INP_DOC_ORIGINAL] VARCHAR(20) default 'COPY' NOT NULL,
[INP_DOC_PUBLISHED] VARCHAR(20) default 'PRIVATE' NOT NULL,
[INP_DOC_VERSIONING] TINYINT default 0 NOT NULL,
[INP_DOC_DESTINATION_PATH] TEXT NULL,
[INP_DOC_TAGS] TEXT NULL,
[INP_DOC_DESTINATION_PATH] NVARCHAR(MAX) NULL,
[INP_DOC_TAGS] NVARCHAR(MAX) NULL,
CONSTRAINT INPUT_DOCUMENT_PK PRIMARY KEY ([INP_DOC_UID])
);
@@ -821,18 +821,18 @@ CREATE TABLE [OUTPUT_DOCUMENT]
[OUT_DOC_UID] VARCHAR(32) default '' NOT NULL,
[PRO_UID] VARCHAR(32) default '' NOT NULL,
[OUT_DOC_LANDSCAPE] TINYINT default 0 NOT NULL,
[OUT_DOC_MEDIA] VARCHAR(50) NULL,
[OUT_DOC_LEFT_MARGIN] INT NULL,
[OUT_DOC_RIGHT_MARGIN] INT NULL,
[OUT_DOC_TOP_MARGIN] INT NULL,
[OUT_DOC_BOTTOM_MARGIN] INT NULL,
[OUT_DOC_MEDIA] VARCHAR(10) default 'Letter' NOT NULL,
[OUT_DOC_LEFT_MARGIN] INT default 30 NULL,
[OUT_DOC_RIGHT_MARGIN] INT default 15 NULL,
[OUT_DOC_TOP_MARGIN] INT default 15 NULL,
[OUT_DOC_BOTTOM_MARGIN] INT default 15 NULL,
[OUT_DOC_GENERATE] VARCHAR(10) default 'BOTH' NOT NULL,
[OUT_DOC_TYPE] VARCHAR(32) default 'HTML' NOT NULL,
[OUT_DOC_CURRENT_REVISION] INT default 0 NULL,
[OUT_DOC_FIELD_MAPPING] VARCHAR(MAX) NULL,
[OUT_DOC_FIELD_MAPPING] NVARCHAR(MAX) NULL,
[OUT_DOC_VERSIONING] TINYINT default 0 NOT NULL,
[OUT_DOC_DESTINATION_PATH] TEXT NULL,
[OUT_DOC_TAGS] TEXT NULL,
[OUT_DOC_DESTINATION_PATH] NVARCHAR(MAX) NULL,
[OUT_DOC_TAGS] NVARCHAR(MAX) NULL,
CONSTRAINT OUTPUT_DOCUMENT_PK PRIMARY KEY ([OUT_DOC_UID])
);
@@ -1064,10 +1064,10 @@ CREATE TABLE [ROUTE]
[ROU_SEND_EMAIL] VARCHAR(20) default 'TRUE' NOT NULL,
[ROU_SOURCEANCHOR] INT default 1 NULL,
[ROU_TARGETANCHOR] INT default 0 NULL,
[ROU_EVN_UID] VARCHAR(32) NULL,
[ROU_TO_PORT] INT NULL,
[ROU_FROM_PORT] INT NULL,
[GAT_UID] VARCHAR(32) NULL,
[ROU_TO_PORT] INT default 1 NOT NULL,
[ROU_FROM_PORT] INT default 2 NOT NULL,
[ROU_EVN_UID] VARCHAR(32) default '' NOT NULL,
[GAT_UID] VARCHAR(32) default '' NOT NULL,
CONSTRAINT ROUTE_PK PRIMARY KEY ([ROU_UID])
);
@@ -1109,7 +1109,7 @@ CREATE TABLE [STEP]
[TAS_UID] VARCHAR(32) default '0' NOT NULL,
[STEP_TYPE_OBJ] VARCHAR(20) default 'DYNAFORM' NOT NULL,
[STEP_UID_OBJ] VARCHAR(32) default '0' NOT NULL,
[STEP_CONDITION] TEXT NOT NULL,
[STEP_CONDITION] NVARCHAR(MAX) NOT NULL,
[STEP_POSITION] INT default 0 NOT NULL,
[STEP_MODE] VARCHAR(10) default 'EDIT' NULL,
CONSTRAINT STEP_PK PRIMARY KEY ([STEP_UID])
@@ -1195,8 +1195,9 @@ CREATE TABLE [SWIMLANES_ELEMENTS]
[SWI_TYPE] VARCHAR(20) default 'LINE' NOT NULL,
[SWI_X] INT default 0 NOT NULL,
[SWI_Y] INT default 0 NOT NULL,
[SWI_WIDTH] INT NULL,
[SWI_HEIGHT] INT NULL,
[SWI_WIDTH] INT default 0 NOT NULL,
[SWI_HEIGHT] INT default 0 NOT NULL,
[SWI_NEXT_UID] VARCHAR(32) default '' NULL,
CONSTRAINT SWIMLANES_ELEMENTS_PK PRIMARY KEY ([SWI_UID])
);
@@ -1268,11 +1269,11 @@ CREATE TABLE [TASK]
[TAS_DERIVATION] VARCHAR(100) default 'NORMAL' NOT NULL,
[TAS_POSX] INT default 0 NOT NULL,
[TAS_POSY] INT default 0 NOT NULL,
[TAS_WIDTH] INT default 110 NOT NULL,
[TAS_HEIGHT] INT default 60 NOT NULL,
[TAS_COLOR] VARCHAR(32) default '' NOT NULL,
[TAS_WIDTH] INT NULL,
[TAS_HEIGHT] INT NULL,
[TAS_EVN_UID] VARCHAR(32) NULL,
[TAS_BOUNDARY] VARCHAR(32) NULL,
[TAS_EVN_UID] VARCHAR(32) default '' NOT NULL,
[TAS_BOUNDARY] VARCHAR(32) default '' NOT NULL,
CONSTRAINT TASK_PK PRIMARY KEY ([TAS_UID])
);
@@ -1352,7 +1353,8 @@ CREATE TABLE [TRANSLATION]
[TRN_CATEGORY] VARCHAR(100) default '' NOT NULL,
[TRN_ID] VARCHAR(100) default '' NOT NULL,
[TRN_LANG] VARCHAR(10) default 'en' NOT NULL,
[TRN_VALUE] VARCHAR(200) default '' NOT NULL,
[TRN_VALUE] NVARCHAR(MAX) NOT NULL,
[TRN_UPDATE_DATE] CHAR(19) NULL,
CONSTRAINT TRANSLATION_PK PRIMARY KEY ([TRN_CATEGORY],[TRN_ID],[TRN_LANG])
);
@@ -1392,8 +1394,8 @@ CREATE TABLE [TRIGGERS]
[TRI_UID] VARCHAR(32) default '' NOT NULL,
[PRO_UID] VARCHAR(32) default '' NOT NULL,
[TRI_TYPE] VARCHAR(20) default 'SCRIPT' NOT NULL,
[TRI_WEBBOT] TEXT NOT NULL,
[TRI_PARAM] TEXT NULL,
[TRI_WEBBOT] NVARCHAR(MAX) NOT NULL,
[TRI_PARAM] NVARCHAR(MAX) NULL,
CONSTRAINT TRIGGERS_PK PRIMARY KEY ([TRI_UID])
);
@@ -1549,8 +1551,6 @@ CREATE TABLE [APP_DELAY]
CONSTRAINT APP_DELAY_PK PRIMARY KEY ([APP_DELAY_UID])
);
CREATE INDEX [indexAppUid] ON [APP_DELAY] ([APP_UID],[APP_DEL_INDEX],[APP_DELAY_UID]);
CREATE INDEX [indexAppDelay] ON [APP_DELAY] ([PRO_UID],[APP_UID],[APP_THREAD_INDEX],[APP_DEL_INDEX],[APP_NEXT_TASK],[APP_DELEGATION_USER],[APP_DISABLE_ACTION_USER]);
/* ---------------------------------------------------------------------- */
@@ -1680,7 +1680,7 @@ CREATE TABLE [DB_SOURCE]
[DBS_PASSWORD] VARCHAR(32) default '' NULL,
[DBS_PORT] INT default 0 NULL,
[DBS_ENCODE] VARCHAR(32) default '' NULL,
CONSTRAINT DB_SOURCE_PK PRIMARY KEY ([DBS_UID])
CONSTRAINT DB_SOURCE_PK PRIMARY KEY ([DBS_UID],[PRO_UID])
);
CREATE INDEX [indexDBSource] ON [DB_SOURCE] ([PRO_UID]);
@@ -1854,7 +1854,7 @@ CREATE TABLE [CASE_TRACKER_OBJECT]
[PRO_UID] VARCHAR(32) default '0' NOT NULL,
[CTO_TYPE_OBJ] VARCHAR(20) default 'DYNAFORM' NOT NULL,
[CTO_UID_OBJ] VARCHAR(32) default '0' NOT NULL,
[CTO_CONDITION] TEXT NOT NULL,
[CTO_CONDITION] NVARCHAR(MAX) NOT NULL,
[CTO_POSITION] INT default 0 NOT NULL,
CONSTRAINT CASE_TRACKER_OBJECT_PK PRIMARY KEY ([CTO_UID])
);
@@ -1944,8 +1944,8 @@ CREATE TABLE [SUB_PROCESS]
[SP_SYNCHRONOUS] INT default 0 NOT NULL,
[SP_SYNCHRONOUS_TYPE] VARCHAR(20) default '' NOT NULL,
[SP_SYNCHRONOUS_WAIT] INT default 0 NOT NULL,
[SP_VARIABLES_OUT] TEXT NOT NULL,
[SP_VARIABLES_IN] TEXT NOT NULL,
[SP_VARIABLES_OUT] NVARCHAR(MAX) NOT NULL,
[SP_VARIABLES_IN] NVARCHAR(MAX) NULL,
[SP_GRID_IN] VARCHAR(50) default '' NOT NULL,
CONSTRAINT SUB_PROCESS_PK PRIMARY KEY ([SP_UID])
);
@@ -1990,8 +1990,8 @@ CREATE TABLE [SUB_APPLICATION]
[DEL_INDEX_PARENT] INT default 0 NOT NULL,
[DEL_THREAD_PARENT] INT default 0 NOT NULL,
[SA_STATUS] VARCHAR(32) default '' NOT NULL,
[SA_VALUES_OUT] TEXT NOT NULL,
[SA_VALUES_IN] TEXT NOT NULL,
[SA_VALUES_OUT] NVARCHAR(MAX) NOT NULL,
[SA_VALUES_IN] NVARCHAR(MAX) NULL,
[SA_INIT_DATE] CHAR(19) NULL,
[SA_FINISH_DATE] CHAR(19) NULL,
CONSTRAINT SUB_APPLICATION_PK PRIMARY KEY ([APP_UID],[APP_PARENT],[DEL_INDEX_PARENT],[DEL_THREAD_PARENT])
@@ -2077,7 +2077,7 @@ CREATE TABLE [USERS_PROPERTIES]
[USR_UID] VARCHAR(32) default '' NOT NULL,
[USR_LAST_UPDATE_DATE] CHAR(19) NULL,
[USR_LOGGED_NEXT_TIME] INT default 0 NULL,
[USR_PASSWORD_HISTORY] TEXT NULL,
[USR_PASSWORD_HISTORY] NVARCHAR(MAX) NULL,
CONSTRAINT USERS_PROPERTIES_PK PRIMARY KEY ([USR_UID])
);
@@ -2117,15 +2117,19 @@ CREATE TABLE [ADDITIONAL_TABLES]
[ADD_TAB_UID] VARCHAR(32) default '' NOT NULL,
[ADD_TAB_NAME] VARCHAR(60) default '' NOT NULL,
[ADD_TAB_CLASS_NAME] VARCHAR(100) default '' NOT NULL,
[ADD_TAB_DESCRIPTION] TEXT NOT NULL,
[ADD_TAB_SDW_LOG_INSERT] TINYINT default 1 NOT NULL,
[ADD_TAB_SDW_LOG_UPDATE] TINYINT default 1 NOT NULL,
[ADD_TAB_SDW_LOG_DELETE] TINYINT default 1 NOT NULL,
[ADD_TAB_SDW_LOG_SELECT] TINYINT default 0 NOT NULL,
[ADD_TAB_SDW_MAX_LENGTH] INT default -1 NOT NULL,
[ADD_TAB_SDW_AUTO_DELETE] TINYINT default 0 NOT NULL,
[ADD_TAB_PLG_UID] VARCHAR(32) default '' NOT NULL,
[DBS_UID] VARCHAR(32) default '0' NULL,
[ADD_TAB_DESCRIPTION] NVARCHAR(MAX) NULL,
[ADD_TAB_SDW_LOG_INSERT] TINYINT default 0 NULL,
[ADD_TAB_SDW_LOG_UPDATE] TINYINT default 0 NULL,
[ADD_TAB_SDW_LOG_DELETE] TINYINT default 0 NULL,
[ADD_TAB_SDW_LOG_SELECT] TINYINT default 0 NULL,
[ADD_TAB_SDW_MAX_LENGTH] INT default 0 NULL,
[ADD_TAB_SDW_AUTO_DELETE] TINYINT default 0 NULL,
[ADD_TAB_PLG_UID] VARCHAR(32) default '' NULL,
[DBS_UID] VARCHAR(32) default '' NULL,
[PRO_UID] VARCHAR(32) default '' NULL,
[ADD_TAB_TYPE] VARCHAR(32) default '' NULL,
[ADD_TAB_GRID] VARCHAR(256) default '' NULL,
[ADD_TAB_TAG] VARCHAR(256) default '' NULL,
CONSTRAINT ADDITIONAL_TABLES_PK PRIMARY KEY ([ADD_TAB_UID])
);
@@ -2166,7 +2170,7 @@ CREATE TABLE [FIELDS]
[ADD_TAB_UID] VARCHAR(32) default '' NOT NULL,
[FLD_INDEX] INT default 1 NOT NULL,
[FLD_NAME] VARCHAR(60) default '' NOT NULL,
[FLD_DESCRIPTION] TEXT NOT NULL,
[FLD_DESCRIPTION] NVARCHAR(MAX) NOT NULL,
[FLD_TYPE] VARCHAR(10) default '' NOT NULL,
[FLD_SIZE] INT default 1 NOT NULL,
[FLD_NULL] TINYINT default 1 NOT NULL,
@@ -2174,6 +2178,9 @@ CREATE TABLE [FIELDS]
[FLD_KEY] TINYINT default 0 NOT NULL,
[FLD_FOREIGN_KEY] TINYINT default 0 NOT NULL,
[FLD_FOREIGN_KEY_TABLE] VARCHAR(32) default '' NOT NULL,
[FLD_DYN_NAME] VARCHAR(128) default '' NULL,
[FLD_DYN_UID] VARCHAR(128) default '' NULL,
[FLD_FILTER] TINYINT default 0 NULL,
CONSTRAINT FIELDS_PK PRIMARY KEY ([FLD_UID])
);
@@ -2213,7 +2220,7 @@ CREATE TABLE [SHADOW_TABLE]
[SHD_UID] VARCHAR(32) default '' NOT NULL,
[ADD_TAB_UID] VARCHAR(32) default '' NOT NULL,
[SHD_ACTION] VARCHAR(10) default '' NOT NULL,
[SHD_DETAILS] TEXT NOT NULL,
[SHD_DETAILS] NVARCHAR(MAX) NOT NULL,
[USR_UID] VARCHAR(32) default '' NOT NULL,
[APP_UID] VARCHAR(32) default '' NOT NULL,
[SHD_DATE] CHAR(19) NULL,
@@ -2267,63 +2274,24 @@ CREATE TABLE [EVENT]
[EVN_WHEN] FLOAT default 0 NOT NULL,
[EVN_MAX_ATTEMPTS] TINYINT default 3 NOT NULL,
[EVN_ACTION] VARCHAR(50) default '' NOT NULL,
[EVN_CONDITIONS] TEXT NULL,
[EVN_ACTION_PARAMETERS] TEXT NULL,
[EVN_CONDITIONS] NVARCHAR(MAX) NULL,
[EVN_ACTION_PARAMETERS] NVARCHAR(MAX) NULL,
[TRI_UID] VARCHAR(32) default '' NULL,
[EVN_POSX] INT NULL,
[EVN_POSY] INT NULL,
[EVN_TYPE] VARCHAR(32) NULL,
[TAS_EVN_UID] VARCHAR(32) NULL,
[EVN_POSX] INT default 0 NOT NULL,
[EVN_POSY] INT default 0 NOT NULL,
[EVN_TYPE] VARCHAR(32) default '' NULL,
[TAS_EVN_UID] VARCHAR(32) default '' NULL,
CONSTRAINT EVENT_PK PRIMARY KEY ([EVN_UID])
);
CREATE INDEX [indexEventTable] ON [EVENT] ([EVN_UID]);
/* ---------------------------------------------------------------------- */
/* GATEWAY */
/* ---------------------------------------------------------------------- */
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'GATEWAY')
BEGIN
DECLARE @reftable_50_1 nvarchar(60), @constraintname_50_1 nvarchar(60)
DECLARE refcursor CURSOR FOR
select reftables.name tablename, cons.name constraintname
from sysobjects tables,
sysobjects reftables,
sysobjects cons,
sysreferences ref
where tables.id = ref.rkeyid
and cons.id = ref.constid
and reftables.id = ref.fkeyid
and tables.name = 'GATEWAY'
OPEN refcursor
FETCH NEXT from refcursor into @reftable_50_1, @constraintname_50_1
while @@FETCH_STATUS = 0
BEGIN
exec ('alter table '+@reftable_50_1+' drop constraint '+@constraintname_50_1)
FETCH NEXT from refcursor into @reftable_50_1, @constraintname_50_1
END
CLOSE refcursor
DEALLOCATE refcursor
DROP TABLE [EVENT]
END
CREATE TABLE [GATEWAY]
(
[GAT_UID] VARCHAR(32) default '' NOT NULL,
[PRO_UID] VARCHAR(32) default '' NOT NULL,
[GAT_X] INTEGER default 0 NOT NULL,
[GAT_Y] INTEGER default 0 NOT NULL,
CONSTRAINT GATEWAY_PK PRIMARY KEY ([GAT_UID])
) ;
/* ---------------------------------------------------------------------- */
/* APP_EVENT */
/* ---------------------------------------------------------------------- */
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'APP_EVENT')
BEGIN
DECLARE @reftable_51 nvarchar(60), @constraintname_51 nvarchar(60)
DECLARE refcursor CURSOR FOR
@@ -2335,7 +2303,7 @@ BEGIN
where tables.id = ref.rkeyid
and cons.id = ref.constid
and reftables.id = ref.fkeyid
and tables.name = 'APP_EVENT'
and tables.name = 'GATEWAY'
OPEN refcursor
FETCH NEXT from refcursor into @reftable_51, @constraintname_51
while @@FETCH_STATUS = 0
@@ -2345,6 +2313,49 @@ BEGIN
END
CLOSE refcursor
DEALLOCATE refcursor
DROP TABLE [GATEWAY]
END
CREATE TABLE [GATEWAY]
(
[GAT_UID] VARCHAR(32) default '' NOT NULL,
[PRO_UID] VARCHAR(32) default '' NOT NULL,
[TAS_UID] VARCHAR(32) default '' NOT NULL,
[GAT_NEXT_TASK] VARCHAR(32) default '' NOT NULL,
[GAT_X] INT default 0 NOT NULL,
[GAT_Y] INT default 0 NOT NULL,
[GAT_TYPE] VARCHAR(32) default '' NOT NULL,
CONSTRAINT GATEWAY_PK PRIMARY KEY ([GAT_UID])
);
/* ---------------------------------------------------------------------- */
/* APP_EVENT */
/* ---------------------------------------------------------------------- */
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'APP_EVENT')
BEGIN
DECLARE @reftable_52 nvarchar(60), @constraintname_52 nvarchar(60)
DECLARE refcursor CURSOR FOR
select reftables.name tablename, cons.name constraintname
from sysobjects tables,
sysobjects reftables,
sysobjects cons,
sysreferences ref
where tables.id = ref.rkeyid
and cons.id = ref.constid
and reftables.id = ref.fkeyid
and tables.name = 'APP_EVENT'
OPEN refcursor
FETCH NEXT from refcursor into @reftable_52, @constraintname_52
while @@FETCH_STATUS = 0
BEGIN
exec ('alter table '+@reftable_52+' drop constraint '+@constraintname_52)
FETCH NEXT from refcursor into @reftable_52, @constraintname_52
END
CLOSE refcursor
DEALLOCATE refcursor
DROP TABLE [APP_EVENT]
END
@@ -2368,7 +2379,7 @@ CREATE TABLE [APP_EVENT]
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'APP_CACHE_VIEW')
BEGIN
DECLARE @reftable_52 nvarchar(60), @constraintname_52 nvarchar(60)
DECLARE @reftable_53 nvarchar(60), @constraintname_53 nvarchar(60)
DECLARE refcursor CURSOR FOR
select reftables.name tablename, cons.name constraintname
from sysobjects tables,
@@ -2380,11 +2391,11 @@ BEGIN
and reftables.id = ref.fkeyid
and tables.name = 'APP_CACHE_VIEW'
OPEN refcursor
FETCH NEXT from refcursor into @reftable_52, @constraintname_52
FETCH NEXT from refcursor into @reftable_53, @constraintname_53
while @@FETCH_STATUS = 0
BEGIN
exec ('alter table '+@reftable_52+' drop constraint '+@constraintname_52)
FETCH NEXT from refcursor into @reftable_52, @constraintname_52
exec ('alter table '+@reftable_53+' drop constraint '+@constraintname_53)
FETCH NEXT from refcursor into @reftable_53, @constraintname_53
END
CLOSE refcursor
DEALLOCATE refcursor
@@ -2399,27 +2410,27 @@ CREATE TABLE [APP_CACHE_VIEW]
[APP_NUMBER] INT default 0 NOT NULL,
[APP_STATUS] VARCHAR(32) default '' NOT NULL,
[USR_UID] VARCHAR(32) default '' NOT NULL,
[PREVIOUS_USR_UID] VARCHAR(32) default '' NOT NULL,
[PREVIOUS_USR_UID] VARCHAR(32) default '' NULL,
[TAS_UID] VARCHAR(32) default '' NOT NULL,
[PRO_UID] VARCHAR(32) default '' NOT NULL,
[DEL_DELEGATE_DATE] CHAR(19) NOT NULL,
[DEL_INIT_DATE] CHAR(19) NULL,
[DEL_TASK_DUE_DATE] CHAR(19) NULL,
[DEL_FINISH_DATE] CHAR(19) NULL,
[DEL_THREAD_STATUS] VARCHAR(32) default 'OPEN' NOT NULL,
[APP_THREAD_STATUS] VARCHAR(32) default 'OPEN' NOT NULL,
[DEL_THREAD_STATUS] VARCHAR(32) default 'OPEN' NULL,
[APP_THREAD_STATUS] VARCHAR(32) default 'OPEN' NULL,
[APP_TITLE] VARCHAR(255) default '' NOT NULL,
[APP_PRO_TITLE] VARCHAR(255) default '' NOT NULL,
[APP_TAS_TITLE] VARCHAR(255) default '' NOT NULL,
[APP_CURRENT_USER] VARCHAR(128) default '' NOT NULL,
[APP_DEL_PREVIOUS_USER] VARCHAR(128) default '' NOT NULL,
[APP_CURRENT_USER] VARCHAR(128) default '' NULL,
[APP_DEL_PREVIOUS_USER] VARCHAR(128) default '' NULL,
[DEL_PRIORITY] VARCHAR(32) default '3' NOT NULL,
[DEL_DURATION] FLOAT default 0 NULL,
[DEL_QUEUE_DURATION] FLOAT default 0 NULL,
[DEL_DELAY_DURATION] FLOAT default 0 NULL,
[DEL_STARTED] TINYINT default 0 NULL,
[DEL_FINISHED] TINYINT default 0 NULL,
[DEL_DELAYED] TINYINT default 0 NULL,
[DEL_STARTED] TINYINT default 0 NOT NULL,
[DEL_FINISHED] TINYINT default 0 NOT NULL,
[DEL_DELAYED] TINYINT default 0 NOT NULL,
[APP_CREATE_DATE] CHAR(19) NOT NULL,
[APP_FINISH_DATE] CHAR(19) NULL,
[APP_UPDATE_DATE] CHAR(19) NOT NULL,
@@ -2429,7 +2440,7 @@ CREATE TABLE [APP_CACHE_VIEW]
CREATE INDEX [indexAppNumber] ON [APP_CACHE_VIEW] ([APP_NUMBER]);
CREATE INDEX [indexAppUser] ON [APP_CACHE_VIEW] ([USR_UID],[PRO_UID]);
CREATE INDEX [indexAppUser] ON [APP_CACHE_VIEW] ([USR_UID],[APP_STATUS]);
/* ---------------------------------------------------------------------- */
/* DIM_TIME_DELEGATE */
@@ -2438,7 +2449,7 @@ CREATE INDEX [indexAppUser] ON [APP_CACHE_VIEW] ([USR_UID],[PRO_UID]);
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'DIM_TIME_DELEGATE')
BEGIN
DECLARE @reftable_53 nvarchar(60), @constraintname_53 nvarchar(60)
DECLARE @reftable_54 nvarchar(60), @constraintname_54 nvarchar(60)
DECLARE refcursor CURSOR FOR
select reftables.name tablename, cons.name constraintname
from sysobjects tables,
@@ -2450,11 +2461,11 @@ BEGIN
and reftables.id = ref.fkeyid
and tables.name = 'DIM_TIME_DELEGATE'
OPEN refcursor
FETCH NEXT from refcursor into @reftable_53, @constraintname_53
FETCH NEXT from refcursor into @reftable_54, @constraintname_54
while @@FETCH_STATUS = 0
BEGIN
exec ('alter table '+@reftable_53+' drop constraint '+@constraintname_53)
FETCH NEXT from refcursor into @reftable_53, @constraintname_53
exec ('alter table '+@reftable_54+' drop constraint '+@constraintname_54)
FETCH NEXT from refcursor into @reftable_54, @constraintname_54
END
CLOSE refcursor
DEALLOCATE refcursor
@@ -2482,7 +2493,7 @@ CREATE TABLE [DIM_TIME_DELEGATE]
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'DIM_TIME_COMPLETE')
BEGIN
DECLARE @reftable_54 nvarchar(60), @constraintname_54 nvarchar(60)
DECLARE @reftable_55 nvarchar(60), @constraintname_55 nvarchar(60)
DECLARE refcursor CURSOR FOR
select reftables.name tablename, cons.name constraintname
from sysobjects tables,
@@ -2494,11 +2505,11 @@ BEGIN
and reftables.id = ref.fkeyid
and tables.name = 'DIM_TIME_COMPLETE'
OPEN refcursor
FETCH NEXT from refcursor into @reftable_54, @constraintname_54
FETCH NEXT from refcursor into @reftable_55, @constraintname_55
while @@FETCH_STATUS = 0
BEGIN
exec ('alter table '+@reftable_54+' drop constraint '+@constraintname_54)
FETCH NEXT from refcursor into @reftable_54, @constraintname_54
exec ('alter table '+@reftable_55+' drop constraint '+@constraintname_55)
FETCH NEXT from refcursor into @reftable_55, @constraintname_55
END
CLOSE refcursor
DEALLOCATE refcursor
@@ -2526,7 +2537,7 @@ CREATE TABLE [DIM_TIME_COMPLETE]
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'APP_HISTORY')
BEGIN
DECLARE @reftable_55 nvarchar(60), @constraintname_55 nvarchar(60)
DECLARE @reftable_56 nvarchar(60), @constraintname_56 nvarchar(60)
DECLARE refcursor CURSOR FOR
select reftables.name tablename, cons.name constraintname
from sysobjects tables,
@@ -2538,11 +2549,11 @@ BEGIN
and reftables.id = ref.fkeyid
and tables.name = 'APP_HISTORY'
OPEN refcursor
FETCH NEXT from refcursor into @reftable_55, @constraintname_55
FETCH NEXT from refcursor into @reftable_56, @constraintname_56
while @@FETCH_STATUS = 0
BEGIN
exec ('alter table '+@reftable_55+' drop constraint '+@constraintname_55)
FETCH NEXT from refcursor into @reftable_55, @constraintname_55
exec ('alter table '+@reftable_56+' drop constraint '+@constraintname_56)
FETCH NEXT from refcursor into @reftable_56, @constraintname_56
END
CLOSE refcursor
DEALLOCATE refcursor
@@ -2560,7 +2571,7 @@ CREATE TABLE [APP_HISTORY]
[USR_UID] VARCHAR(32) default '' NOT NULL,
[APP_STATUS] VARCHAR(100) default '' NOT NULL,
[HISTORY_DATE] CHAR(19) NULL,
[HISTORY_DATA] TEXT NOT NULL
[HISTORY_DATA] NVARCHAR(MAX) NOT NULL
);
CREATE INDEX [indexAppHistory] ON [APP_HISTORY] ([APP_UID],[TAS_UID],[USR_UID]);
@@ -2572,7 +2583,7 @@ CREATE INDEX [indexAppHistory] ON [APP_HISTORY] ([APP_UID],[TAS_UID],[USR_UID]);
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'APP_FOLDER')
BEGIN
DECLARE @reftable_56 nvarchar(60), @constraintname_56 nvarchar(60)
DECLARE @reftable_57 nvarchar(60), @constraintname_57 nvarchar(60)
DECLARE refcursor CURSOR FOR
select reftables.name tablename, cons.name constraintname
from sysobjects tables,
@@ -2584,11 +2595,11 @@ BEGIN
and reftables.id = ref.fkeyid
and tables.name = 'APP_FOLDER'
OPEN refcursor
FETCH NEXT from refcursor into @reftable_56, @constraintname_56
FETCH NEXT from refcursor into @reftable_57, @constraintname_57
while @@FETCH_STATUS = 0
BEGIN
exec ('alter table '+@reftable_56+' drop constraint '+@constraintname_56)
FETCH NEXT from refcursor into @reftable_56, @constraintname_56
exec ('alter table '+@reftable_57+' drop constraint '+@constraintname_57)
FETCH NEXT from refcursor into @reftable_57, @constraintname_57
END
CLOSE refcursor
DEALLOCATE refcursor
@@ -2600,7 +2611,7 @@ CREATE TABLE [APP_FOLDER]
(
[FOLDER_UID] VARCHAR(32) default '' NOT NULL,
[FOLDER_PARENT_UID] VARCHAR(32) default '' NOT NULL,
[FOLDER_NAME] VARCHAR(MAX) NULL,
[FOLDER_NAME] NVARCHAR(MAX) NOT NULL,
[FOLDER_CREATE_DATE] CHAR(19) NOT NULL,
[FOLDER_UPDATE_DATE] CHAR(19) NOT NULL,
CONSTRAINT APP_FOLDER_PK PRIMARY KEY ([FOLDER_UID])
@@ -2613,7 +2624,7 @@ CREATE TABLE [APP_FOLDER]
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'FIELD_CONDITION')
BEGIN
DECLARE @reftable_57 nvarchar(60), @constraintname_57 nvarchar(60)
DECLARE @reftable_58 nvarchar(60), @constraintname_58 nvarchar(60)
DECLARE refcursor CURSOR FOR
select reftables.name tablename, cons.name constraintname
from sysobjects tables,
@@ -2625,11 +2636,11 @@ BEGIN
and reftables.id = ref.fkeyid
and tables.name = 'FIELD_CONDITION'
OPEN refcursor
FETCH NEXT from refcursor into @reftable_57, @constraintname_57
FETCH NEXT from refcursor into @reftable_58, @constraintname_58
while @@FETCH_STATUS = 0
BEGIN
exec ('alter table '+@reftable_57+' drop constraint '+@constraintname_57)
FETCH NEXT from refcursor into @reftable_57, @constraintname_57
exec ('alter table '+@reftable_58+' drop constraint '+@constraintname_58)
FETCH NEXT from refcursor into @reftable_58, @constraintname_58
END
CLOSE refcursor
DEALLOCATE refcursor
@@ -2641,10 +2652,10 @@ CREATE TABLE [FIELD_CONDITION]
(
[FCD_UID] VARCHAR(32) default '' NOT NULL,
[FCD_FUNCTION] VARCHAR(50) NOT NULL,
[FCD_FIELDS] TEXT NOT NULL,
[FCD_CONDITION] TEXT NOT NULL,
[FCD_EVENTS] TEXT NOT NULL,
[FCD_EVENT_OWNERS] TEXT NOT NULL,
[FCD_FIELDS] NVARCHAR(MAX) NULL,
[FCD_CONDITION] NVARCHAR(MAX) NULL,
[FCD_EVENTS] NVARCHAR(MAX) NULL,
[FCD_EVENT_OWNERS] NVARCHAR(MAX) NULL,
[FCD_STATUS] VARCHAR(10) NULL,
[FCD_DYN_UID] VARCHAR(32) NOT NULL,
CONSTRAINT FIELD_CONDITION_PK PRIMARY KEY ([FCD_UID])
@@ -2657,7 +2668,7 @@ CREATE TABLE [FIELD_CONDITION]
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'LOG_CASES_SCHEDULER')
BEGIN
DECLARE @reftable_58 nvarchar(60), @constraintname_58 nvarchar(60)
DECLARE @reftable_59 nvarchar(60), @constraintname_59 nvarchar(60)
DECLARE refcursor CURSOR FOR
select reftables.name tablename, cons.name constraintname
from sysobjects tables,
@@ -2669,11 +2680,11 @@ BEGIN
and reftables.id = ref.fkeyid
and tables.name = 'LOG_CASES_SCHEDULER'
OPEN refcursor
FETCH NEXT from refcursor into @reftable_58, @constraintname_58
FETCH NEXT from refcursor into @reftable_59, @constraintname_59
while @@FETCH_STATUS = 0
BEGIN
exec ('alter table '+@reftable_58+' drop constraint '+@constraintname_58)
FETCH NEXT from refcursor into @reftable_58, @constraintname_58
exec ('alter table '+@reftable_59+' drop constraint '+@constraintname_59)
FETCH NEXT from refcursor into @reftable_59, @constraintname_59
END
CLOSE refcursor
DEALLOCATE refcursor
@@ -2691,8 +2702,8 @@ CREATE TABLE [LOG_CASES_SCHEDULER]
[EXEC_HOUR] VARCHAR(32) default '12:00' NOT NULL,
[RESULT] VARCHAR(32) default 'SUCCESS' NOT NULL,
[SCH_UID] VARCHAR(32) default 'OPEN' NOT NULL,
[WS_CREATE_CASE_STATUS] TEXT NOT NULL,
[WS_ROUTE_CASE_STATUS] TEXT NOT NULL,
[WS_CREATE_CASE_STATUS] NVARCHAR(MAX) NOT NULL,
[WS_ROUTE_CASE_STATUS] NVARCHAR(MAX) NOT NULL,
CONSTRAINT LOG_CASES_SCHEDULER_PK PRIMARY KEY ([LOG_CASE_UID])
);
@@ -2703,7 +2714,7 @@ CREATE TABLE [LOG_CASES_SCHEDULER]
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'CASE_SCHEDULER')
BEGIN
DECLARE @reftable_59 nvarchar(60), @constraintname_59 nvarchar(60)
DECLARE @reftable_60 nvarchar(60), @constraintname_60 nvarchar(60)
DECLARE refcursor CURSOR FOR
select reftables.name tablename, cons.name constraintname
from sysobjects tables,
@@ -2715,11 +2726,11 @@ BEGIN
and reftables.id = ref.fkeyid
and tables.name = 'CASE_SCHEDULER'
OPEN refcursor
FETCH NEXT from refcursor into @reftable_59, @constraintname_59
FETCH NEXT from refcursor into @reftable_60, @constraintname_60
while @@FETCH_STATUS = 0
BEGIN
exec ('alter table '+@reftable_59+' drop constraint '+@constraintname_59)
FETCH NEXT from refcursor into @reftable_59, @constraintname_59
exec ('alter table '+@reftable_60+' drop constraint '+@constraintname_60)
FETCH NEXT from refcursor into @reftable_60, @constraintname_60
END
CLOSE refcursor
DEALLOCATE refcursor
@@ -2739,21 +2750,21 @@ CREATE TABLE [CASE_SCHEDULER]
[SCH_TIME_NEXT_RUN] CHAR(19) NOT NULL,
[SCH_LAST_RUN_TIME] CHAR(19) NULL,
[SCH_STATE] VARCHAR(15) default 'ACTIVE' NOT NULL,
[SCH_LAST_STATE] VARCHAR(60) NOT NULL,
[USR_UID] VARCHAR(32) NOT NULL,
[SCH_LAST_STATE] VARCHAR(60) default '' NOT NULL,
[USR_UID] VARCHAR(32) default '' NOT NULL,
[SCH_OPTION] TINYINT default 0 NOT NULL,
[SCH_START_TIME] CHAR(19) NOT NULL,
[SCH_START_DATE] CHAR(19) NOT NULL,
[SCH_DAYS_PERFORM_TASK] CHAR(5) NOT NULL,
[SCH_DAYS_PERFORM_TASK] CHAR(5) default '' NOT NULL,
[SCH_EVERY_DAYS] TINYINT default 0 NULL,
[SCH_WEEK_DAYS] CHAR(14) default '0|0|0|0|0|0|0' NOT NULL,
[SCH_START_DAY] CHAR(6) NOT NULL,
[SCH_START_DAY] CHAR(6) default '' NOT NULL,
[SCH_MONTHS] CHAR(24) default '0|0|0|0|0|0|0|0|0|0|0|0' NOT NULL,
[SCH_END_DATE] CHAR(19) NULL,
[SCH_REPEAT_EVERY] VARCHAR(15) NOT NULL,
[SCH_REPEAT_UNTIL] VARCHAR(15) NOT NULL,
[SCH_REPEAT_EVERY] VARCHAR(15) default '' NOT NULL,
[SCH_REPEAT_UNTIL] VARCHAR(15) default '' NOT NULL,
[SCH_REPEAT_STOP_IF_RUNNING] TINYINT default 0 NULL,
[CASE_SH_PLUGIN_UID] VARCHAR(100),
[CASE_SH_PLUGIN_UID] VARCHAR(100) NULL,
CONSTRAINT CASE_SCHEDULER_PK PRIMARY KEY ([SCH_UID])
);
@@ -2764,7 +2775,7 @@ CREATE TABLE [CASE_SCHEDULER]
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'CALENDAR_DEFINITION')
BEGIN
DECLARE @reftable_60 nvarchar(60), @constraintname_60 nvarchar(60)
DECLARE @reftable_61 nvarchar(60), @constraintname_61 nvarchar(60)
DECLARE refcursor CURSOR FOR
select reftables.name tablename, cons.name constraintname
from sysobjects tables,
@@ -2776,11 +2787,11 @@ BEGIN
and reftables.id = ref.fkeyid
and tables.name = 'CALENDAR_DEFINITION'
OPEN refcursor
FETCH NEXT from refcursor into @reftable_60, @constraintname_60
FETCH NEXT from refcursor into @reftable_61, @constraintname_61
while @@FETCH_STATUS = 0
BEGIN
exec ('alter table '+@reftable_60+' drop constraint '+@constraintname_60)
FETCH NEXT from refcursor into @reftable_60, @constraintname_60
exec ('alter table '+@reftable_61+' drop constraint '+@constraintname_61)
FETCH NEXT from refcursor into @reftable_61, @constraintname_61
END
CLOSE refcursor
DEALLOCATE refcursor
@@ -2795,7 +2806,7 @@ CREATE TABLE [CALENDAR_DEFINITION]
[CALENDAR_CREATE_DATE] CHAR(19) NOT NULL,
[CALENDAR_UPDATE_DATE] CHAR(19) NULL,
[CALENDAR_WORK_DAYS] VARCHAR(100) default '' NOT NULL,
[CALENDAR_DESCRIPTION] TEXT NOT NULL,
[CALENDAR_DESCRIPTION] NVARCHAR(MAX) NOT NULL,
[CALENDAR_STATUS] VARCHAR(8) default 'ACTIVE' NOT NULL,
CONSTRAINT CALENDAR_DEFINITION_PK PRIMARY KEY ([CALENDAR_UID])
);
@@ -2807,7 +2818,7 @@ CREATE TABLE [CALENDAR_DEFINITION]
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'CALENDAR_BUSINESS_HOURS')
BEGIN
DECLARE @reftable_61 nvarchar(60), @constraintname_61 nvarchar(60)
DECLARE @reftable_62 nvarchar(60), @constraintname_62 nvarchar(60)
DECLARE refcursor CURSOR FOR
select reftables.name tablename, cons.name constraintname
from sysobjects tables,
@@ -2819,11 +2830,11 @@ BEGIN
and reftables.id = ref.fkeyid
and tables.name = 'CALENDAR_BUSINESS_HOURS'
OPEN refcursor
FETCH NEXT from refcursor into @reftable_61, @constraintname_61
FETCH NEXT from refcursor into @reftable_62, @constraintname_62
while @@FETCH_STATUS = 0
BEGIN
exec ('alter table '+@reftable_61+' drop constraint '+@constraintname_61)
FETCH NEXT from refcursor into @reftable_61, @constraintname_61
exec ('alter table '+@reftable_62+' drop constraint '+@constraintname_62)
FETCH NEXT from refcursor into @reftable_62, @constraintname_62
END
CLOSE refcursor
DEALLOCATE refcursor
@@ -2847,7 +2858,7 @@ CREATE TABLE [CALENDAR_BUSINESS_HOURS]
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'CALENDAR_HOLIDAYS')
BEGIN
DECLARE @reftable_62 nvarchar(60), @constraintname_62 nvarchar(60)
DECLARE @reftable_63 nvarchar(60), @constraintname_63 nvarchar(60)
DECLARE refcursor CURSOR FOR
select reftables.name tablename, cons.name constraintname
from sysobjects tables,
@@ -2859,11 +2870,11 @@ BEGIN
and reftables.id = ref.fkeyid
and tables.name = 'CALENDAR_HOLIDAYS'
OPEN refcursor
FETCH NEXT from refcursor into @reftable_62, @constraintname_62
FETCH NEXT from refcursor into @reftable_63, @constraintname_63
while @@FETCH_STATUS = 0
BEGIN
exec ('alter table '+@reftable_62+' drop constraint '+@constraintname_62)
FETCH NEXT from refcursor into @reftable_62, @constraintname_62
exec ('alter table '+@reftable_63+' drop constraint '+@constraintname_63)
FETCH NEXT from refcursor into @reftable_63, @constraintname_63
END
CLOSE refcursor
DEALLOCATE refcursor
@@ -2887,7 +2898,7 @@ CREATE TABLE [CALENDAR_HOLIDAYS]
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'CALENDAR_ASSIGNMENTS')
BEGIN
DECLARE @reftable_63 nvarchar(60), @constraintname_63 nvarchar(60)
DECLARE @reftable_64 nvarchar(60), @constraintname_64 nvarchar(60)
DECLARE refcursor CURSOR FOR
select reftables.name tablename, cons.name constraintname
from sysobjects tables,
@@ -2899,11 +2910,11 @@ BEGIN
and reftables.id = ref.fkeyid
and tables.name = 'CALENDAR_ASSIGNMENTS'
OPEN refcursor
FETCH NEXT from refcursor into @reftable_63, @constraintname_63
FETCH NEXT from refcursor into @reftable_64, @constraintname_64
while @@FETCH_STATUS = 0
BEGIN
exec ('alter table '+@reftable_63+' drop constraint '+@constraintname_63)
FETCH NEXT from refcursor into @reftable_63, @constraintname_63
exec ('alter table '+@reftable_64+' drop constraint '+@constraintname_64)
FETCH NEXT from refcursor into @reftable_64, @constraintname_64
END
CLOSE refcursor
DEALLOCATE refcursor
@@ -2926,7 +2937,7 @@ CREATE TABLE [CALENDAR_ASSIGNMENTS]
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'PROCESS_CATEGORY')
BEGIN
DECLARE @reftable_64 nvarchar(60), @constraintname_64 nvarchar(60)
DECLARE @reftable_65 nvarchar(60), @constraintname_65 nvarchar(60)
DECLARE refcursor CURSOR FOR
select reftables.name tablename, cons.name constraintname
from sysobjects tables,
@@ -2938,11 +2949,11 @@ BEGIN
and reftables.id = ref.fkeyid
and tables.name = 'PROCESS_CATEGORY'
OPEN refcursor
FETCH NEXT from refcursor into @reftable_64, @constraintname_64
FETCH NEXT from refcursor into @reftable_65, @constraintname_65
while @@FETCH_STATUS = 0
BEGIN
exec ('alter table '+@reftable_64+' drop constraint '+@constraintname_64)
FETCH NEXT from refcursor into @reftable_64, @constraintname_64
exec ('alter table '+@reftable_65+' drop constraint '+@constraintname_65)
FETCH NEXT from refcursor into @reftable_65, @constraintname_65
END
CLOSE refcursor
DEALLOCATE refcursor
@@ -2958,3 +2969,48 @@ CREATE TABLE [PROCESS_CATEGORY]
[CATEGORY_ICON] VARCHAR(100) default '' NULL,
CONSTRAINT PROCESS_CATEGORY_PK PRIMARY KEY ([CATEGORY_UID])
);
/* ---------------------------------------------------------------------- */
/* APP_NOTES */
/* ---------------------------------------------------------------------- */
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'APP_NOTES')
BEGIN
DECLARE @reftable_66 nvarchar(60), @constraintname_66 nvarchar(60)
DECLARE refcursor CURSOR FOR
select reftables.name tablename, cons.name constraintname
from sysobjects tables,
sysobjects reftables,
sysobjects cons,
sysreferences ref
where tables.id = ref.rkeyid
and cons.id = ref.constid
and reftables.id = ref.fkeyid
and tables.name = 'APP_NOTES'
OPEN refcursor
FETCH NEXT from refcursor into @reftable_66, @constraintname_66
while @@FETCH_STATUS = 0
BEGIN
exec ('alter table '+@reftable_66+' drop constraint '+@constraintname_66)
FETCH NEXT from refcursor into @reftable_66, @constraintname_66
END
CLOSE refcursor
DEALLOCATE refcursor
DROP TABLE [APP_NOTES]
END
CREATE TABLE [APP_NOTES]
(
[APP_UID] VARCHAR(32) default '' NOT NULL,
[USR_UID] VARCHAR(32) default '' NOT NULL,
[NOTE_DATE] CHAR(19) NOT NULL,
[NOTE_CONTENT] NVARCHAR(MAX) NOT NULL,
[NOTE_TYPE] VARCHAR(32) default 'USER' NOT NULL,
[NOTE_AVAILABILITY] VARCHAR(32) default 'PUBLIC' NOT NULL,
[NOTE_ORIGIN_OBJ] VARCHAR(32) default '' NULL,
[NOTE_AFFECTED_OBJ1] VARCHAR(32) default '' NULL,
[NOTE_AFFECTED_OBJ2] VARCHAR(32) default '' NOT NULL,
[NOTE_RECIPIENTS] NVARCHAR(MAX) NULL
);

View File

@@ -36,6 +36,7 @@ if ((($sStatus == 'DRAFT') || ($sStatus == 'TO_DO')) && ($_SESSION['TASK'] != -1
} else {
$G_TMP_MENU->AddIdOption('INFO' , G::LoadTranslation('ID_INFORMATION'), 'javascript:showInformation();', 'absolute');
}
$G_TMP_MENU->AddIdOption('NOTES' , G::LoadTranslation('ID_NOTES'), 'javascript:showNotes();', 'absolute');

View File

@@ -0,0 +1,72 @@
<?php
if (!isset($_REQUEST ['action'])) {
$res ['success'] = 'failure';
$res ['message'] = 'You may request an action';
print json_encode($res);
die ();
}
if (!function_exists($_REQUEST ['action'])) {
$res ['success'] = 'failure';
$res ['message'] = 'The requested action doesn\'t exists';
header("Content-Type: application/json");
print json_encode($res);
die ();
}
$functionName = $_REQUEST ['action'];
$functionParams = isset($_REQUEST ['params']) ? $_REQUEST ['params'] : array();
$functionName($functionParams);
function getExtJSParams() {
$validParams = array('callback' => '', 'dir' => 'DESC', 'sort' => '', 'start' => 0, 'limit' => 25, 'filter' => '', 'search' => '', 'action' => '', 'xaction' => '', 'data' => '', 'status' => '', 'query' => '', 'fields' => "");
$result = array();
foreach ($validParams as $paramName => $paramDefault) {
$result[$paramName] = isset($_REQUEST[$paramName]) ? $_REQUEST[$paramName] : isset($_REQUEST[$paramName]) ? $_REQUEST[$paramName] : $paramDefault;
}
return $result;
}
function sendJsonResultGeneric($response, $callback) {
header("Content-Type: application/json");
$finalResponse = json_encode($response);
if ($callback != '') {
print $callback . "($finalResponse);";
} else {
print $finalResponse;
}
}
function getNotesList() {
extract(getExtJSParams());
require_once ( "classes/model/AppNotes.php" );
if ((isset($_REQUEST['appUid'])) && (trim($_REQUEST['appUid']) != "")) {
$appUid = $_REQUEST['appUid'];
} else {
$appUid = $_SESSION['APPLICATION'];
}
$usrUid = (isset($_SESSION['USER_LOGGED'])) ? $_SESSION['USER_LOGGED'] : "";
$appNotes = new AppNotes();
$response = $appNotes->getNotesList($appUid, $usrUid, $start, $limit);
sendJsonResultGeneric($response['array'], $callback);
}
function postNote() {
extract(getExtJSParams());
if ((isset($_REQUEST['appUid'])) && (trim($_REQUEST['appUid']) != "")) {
$appUid = $_REQUEST['appUid'];
} else {
$appUid = $_SESSION['APPLICATION'];
}
$usrUid = (isset($_SESSION['USER_LOGGED'])) ? $_SESSION['USER_LOGGED'] : "";
require_once ( "classes/model/AppNotes.php" );
$noteContent=addslashes($_POST['noteText']);
$appNotes=new AppNotes();
$response=$appNotes->postNewNote($appUid, $usrUid, $noteContent);
sendJsonResultGeneric($response, $callback);
}
?>

View File

@@ -110,6 +110,8 @@
$oHeadPublisher->assign( '___p34315105', $menuPerms); // user menu permissions
$oHeadPublisher->usingExtJs('ux/GridRowActions');
$oHeadPublisher->addExtJsScript('cases/caseNotes', true);
$oHeadPublisher->addExtJsScript('cases/casesList', false ); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/casesListExtJs'); //adding a html file .html.
@@ -324,6 +326,7 @@
function getToDo() {
$caseColumns = array ();
$caseColumns[] = array( 'header' => '#', 'dataIndex' => 'APP_NUMBER', 'width' => 45, 'align' => 'center');
$caseColumns[] = array( 'header' => '', 'dataIndex' => 'CASE_NOTES_COUNT', 'width' => 15, 'align' => 'center', 'sorteable'=>false);
$caseColumns[] = array( 'header' => G::LoadTranslation('ID_CASE'), 'dataIndex' => 'APP_TITLE', 'width' => 150 );
$caseColumns[] = array( 'header' => 'UserUid', 'dataIndex' => 'USR_UID', 'width' => 50 , 'hidden'=> true, 'hideable'=> false);
$caseColumns[] = array( 'header' => 'PreUsrUid', 'dataIndex' => 'PREVIOUS_USR_UID', 'width' => 50 , 'hidden'=> true, 'hideable'=> false);
@@ -352,12 +355,15 @@
$caseReaderFields[] = array( 'name' => 'APP_CURRENT_USER' );
$caseReaderFields[] = array( 'name' => 'APP_STATUS' );
$caseReaderFields[] = array( 'name' => 'CASE_NOTES_COUNT' );
return array ( 'caseColumns' => $caseColumns, 'caseReaderFields' => $caseReaderFields, 'rowsperpage' => 20, 'dateformat' => 'M d, Y' );
}
function getDraft() {
$caseColumns = array ();
$caseColumns[] = array( 'header' => '#', 'dataIndex' => 'APP_NUMBER', 'width' => 45, 'align' => 'center');
$caseColumns[] = array( 'header' => '', 'dataIndex' => 'CASE_NOTES_COUNT', 'width' => 15, 'align' => 'center', 'sorteable'=>false);
$caseColumns[] = array( 'header' => G::LoadTranslation('ID_CASE'), 'dataIndex' => 'APP_TITLE', 'width' => 150 );
$caseColumns[] = array( 'header' => 'UserUid', 'dataIndex' => 'USR_UID', 'width' => 50, 'hidden'=> true, 'hideable'=> false);
$caseColumns[] = array( 'header' => 'PreUsrUid', 'dataIndex' => 'PREVIOUS_USR_UID', 'width' => 50, 'hidden'=> true, 'hideable'=> false);
@@ -384,6 +390,7 @@
$caseReaderFields[] = array( 'name' => 'DEL_PRIORITY' );
$caseReaderFields[] = array( 'name' => 'APP_STATUS' );
$caseReaderFields[] = array( 'name' => 'APP_FINISH_DATE' );
$caseReaderFields[] = array( 'name' => 'CASE_NOTES_COUNT' );
return array ( 'caseColumns' => $caseColumns, 'caseReaderFields' => $caseReaderFields, 'rowsperpage' => 20, 'dateformat' => 'M d, Y' );
}
@@ -391,6 +398,7 @@
function getParticipated() {
$caseColumns = array ();
$caseColumns[] = array( 'header' => '#', 'dataIndex' => 'APP_NUMBER', 'width' => 45, 'align' => 'center');
$caseColumns[] = array( 'header' => '', 'dataIndex' => 'CASE_NOTES_COUNT', 'width' => 15, 'align' => 'center', 'sorteable'=>false);
$caseColumns[] = array( 'header' => G::LoadTranslation('ID_CASE'), 'dataIndex' => 'APP_TITLE', 'width' => 150 );
$caseColumns[] = array( 'header' => 'UserUid', 'dataIndex' => 'USR_UID', 'width' => 50, 'hidden'=> true, 'hideable'=> false);
$caseColumns[] = array( 'header' => 'PreUsrUid', 'dataIndex' => 'PREVIOUS_USR_UID', 'width' => 50, 'hidden'=> true, 'hideable'=> false);
@@ -418,6 +426,7 @@
$caseReaderFields[] = array( 'name' => 'DEL_PRIORITY' );
$caseReaderFields[] = array( 'name' => 'APP_STATUS' );
$caseReaderFields[] = array( 'name' => 'APP_FINISH_DATE' );
$caseReaderFields[] = array( 'name' => 'CASE_NOTES_COUNT' );
return array ( 'caseColumns' => $caseColumns, 'caseReaderFields' => $caseReaderFields, 'rowsperpage' => 20, 'dateformat' => 'M d, Y' );
@@ -455,6 +464,7 @@
$caseReaderFields[] = array( 'name' => 'DEL_PRIORITY' );
$caseReaderFields[] = array( 'name' => 'APP_STATUS' );
$caseReaderFields[] = array( 'name' => 'APP_FINISH_DATE' );
$caseReaderFields[] = array( 'name' => 'CASE_NOTES_COUNT' );
return array ( 'caseColumns' => $caseColumns, 'caseReaderFields' => $caseReaderFields, 'rowsperpage' => 20, 'dateformat' => 'M d, Y' );
}
@@ -462,6 +472,7 @@
function getUnassigned() {
$caseColumns = array ();
$caseColumns[] = array( 'header' => '#', 'dataIndex' => 'APP_NUMBER', 'width' => 40, 'align' => 'left');
$caseColumns[] = array( 'header' => '', 'dataIndex' => 'CASE_NOTES_COUNT', 'width' => 15, 'align' => 'center', 'sorteable'=>false);
$caseColumns[] = array( 'header' => G::LoadTranslation('ID_CASE'), 'dataIndex' => 'APP_TITLE', 'width' => 150 );
$caseColumns[] = array( 'header' => 'UserUid', 'dataIndex' => 'USR_UID', 'width' => 50, 'hidden'=> true, 'hideable'=> false);
$caseColumns[] = array( 'header' => 'PreUsrUid', 'dataIndex' => 'PREVIOUS_USR_UID','width' => 50, 'hidden'=> true, 'hideable'=> false);
@@ -491,6 +502,7 @@
$caseReaderFields[] = array( 'name' => 'DEL_PRIORITY' );
$caseReaderFields[] = array( 'name' => 'APP_STATUS' );
$caseReaderFields[] = array( 'name' => 'APP_FINISH_DATE' );
$caseReaderFields[] = array( 'name' => 'CASE_NOTES_COUNT' );
return array ( 'caseColumns' => $caseColumns, 'caseReaderFields' => $caseReaderFields, 'rowsperpage' => 20, 'dateformat' => 'M d, Y' );
}
@@ -498,6 +510,7 @@
function getPaused() {
$caseColumns = array ();
$caseColumns[] = array( 'header' => '#', 'dataIndex' => 'APP_NUMBER', 'width' => 45, 'align' => 'center');
$caseColumns[] = array( 'header' => '', 'dataIndex' => 'CASE_NOTES_COUNT', 'width' => 15, 'align' => 'center', 'sorteable'=>false);
$caseColumns[] = array( 'header' => G::LoadTranslation('ID_CASE'), 'dataIndex' => 'APP_TITLE', 'width' => 150 );
$caseColumns[] = array( 'header' => 'UserUid', 'dataIndex' => 'USR_UID', 'width' => 50, 'hidden'=> true, 'hideable'=> false);
$caseColumns[] = array( 'header' => 'PreUsrUid', 'dataIndex' => 'PREVIOUS_USR_UID', 'width' => 50, 'hidden'=> true, 'hideable'=> false);
@@ -529,6 +542,7 @@
$caseReaderFields[] = array( 'name' => 'APP_STATUS' );
$caseReaderFields[] = array( 'name' => 'APP_FINISH_DATE' );
$caseReaderFields[] = array( 'name' => 'APP_THREAD_INDEX' );
$caseReaderFields[] = array( 'name' => 'CASE_NOTES_COUNT' );
return array ( 'caseColumns' => $caseColumns, 'caseReaderFields' => $caseReaderFields, 'rowsperpage' => 20, 'dateformat' => 'M d, Y' );
}
@@ -536,6 +550,7 @@
function getToRevise() {
$caseColumns = array ();
$caseColumns[] = array( 'header' => '#', 'dataIndex' => 'APP_NUMBER', 'width' => 45, 'align' => 'center');
$caseColumns[] = array( 'header' => '', 'dataIndex' => 'CASE_NOTES_COUNT', 'width' => 15, 'align' => 'center', 'sorteable'=>false);
$caseColumns[] = array( 'header' => G::LoadTranslation('ID_CASE'), 'dataIndex' => 'APP_TITLE', 'width' => 150 );
$caseColumns[] = array( 'header' => 'UserUid', 'dataIndex' => 'USR_UID', 'width' => 50, 'hidden'=> true, 'hideable'=> false);
$caseColumns[] = array( 'header' => 'PreUsrUid', 'dataIndex' => 'PREVIOUS_USR_UID','width' => 50, 'hidden'=> true, 'hideable'=> false);
@@ -566,12 +581,14 @@
$caseReaderFields[] = array( 'name' => 'APP_STATUS' );
$caseReaderFields[] = array( 'name' => 'APP_FINISH_DATE' );
$caseReaderFields[] = array( 'name' => 'ID_SENT_BY' );
$caseReaderFields[] = array( 'name' => 'CASE_NOTES_COUNT' );
return array ( 'caseColumns' => $caseColumns, 'caseReaderFields' => $caseReaderFields, 'rowsperpage' => 20, 'dateformat' => 'M d, Y' );
}
function getToReassign() {
$caseColumns = array ();
$caseColumns[] = array( 'header' => '', 'dataIndex' => 'CASE_NOTES_COUNT', 'width' => 15, 'align' => 'center', 'sorteable'=>false);
$caseColumns[] = array( 'header' => 'TaskUid', 'dataIndex' => 'TAS_UID' , 'width' => 150 ,'hidden'=> true, 'hideable'=> false);
$caseColumns[] = array( 'header' => 'DelIndex', 'dataIndex' => 'DEL_INDEX' , 'width' => 150 );
$caseColumns[] = array( 'header' => 'UserUid', 'dataIndex' => 'USR_UID', 'width' => 50, 'hidden'=> true, 'hideable'=> false);
@@ -599,6 +616,7 @@
// $caseReaderFields[] = array( 'name' => 'APP_DEL_PREVIOUS_USER' );
$caseReaderFields[] = array( 'name' => 'APP_UPDATE_DATE' );
$caseReaderFields[] = array( 'name' => 'APP_STATUS' );
$caseReaderFields[] = array( 'name' => 'CASE_NOTES_COUNT' );
return array ( 'caseColumns' => $caseColumns, 'caseReaderFields' => $caseReaderFields, 'rowsperpage' => 20, 'dateformat' => 'M d, Y' );
@@ -607,6 +625,7 @@
function getGeneral() {
$caseColumns = array ();
$caseColumns[] = array( 'header' => '#', 'dataIndex' => 'APP_NUMBER', 'width' => 45, 'align' => 'center');
$caseColumns[] = array( 'header' => '', 'dataIndex' => 'CASE_NOTES_COUNT', 'width' => 15, 'align' => 'center', 'sorteable'=>false);
$caseColumns[] = array( 'header' => G::LoadTranslation('ID_CASE'), 'dataIndex' => 'APP_TITLE', 'width' => 150 );
$caseColumns[] = array( 'header' => 'UserUid', 'dataIndex' => 'USR_UID', 'width' => 50 , 'hidden'=> true, 'hideable'=> false);
$caseColumns[] = array( 'header' => 'PreUsrUid', 'dataIndex' => 'PREVIOUS_USR_UID', 'width' => 50 , 'hidden'=> true, 'hideable'=> false);
@@ -629,6 +648,7 @@
$caseReaderFields[] = array( 'name' => 'APP_DEL_PREVIOUS_USER' );
$caseReaderFields[] = array( 'name' => 'APP_UPDATE_DATE' );
$caseReaderFields[] = array( 'name' => 'APP_STATUS' );
$caseReaderFields[] = array( 'name' => 'CASE_NOTES_COUNT' );
return array ( 'caseColumns' => $caseColumns, 'caseReaderFields' => $caseReaderFields, 'rowsperpage' => 20, 'dateformat' => 'M d, Y' );
@@ -641,6 +661,7 @@
function getReassignList() {
$caseColumns = array ();
$caseColumns[] = array( 'header' => '#', 'dataIndex' => 'APP_NUMBER', 'width' => 40 );
$caseColumns[] = array( 'header' => '', 'dataIndex' => 'CASE_NOTES_COUNT', 'width' => 15, 'align' => 'center', 'sorteable'=>false);
$caseColumns[] = array( 'header' => G::LoadTranslation('ID_CASE'), 'dataIndex' => 'APP_TITLE', 'width' => 100, 'hidden'=> true);
$caseColumns[] = array( 'header' => 'CaseId', 'dataIndex' => 'APP_UID' , 'width' => 200, 'hidden'=> true, 'hideable'=> false);
$caseColumns[] = array( 'header' => 'User', 'dataIndex' => 'USR_UID' , 'width' => 200, 'hidden'=> true, 'hideable'=> false);
@@ -663,6 +684,8 @@
$caseReaderFields[] = array( 'name' => 'APP_REASSIGN_USER' );
// $caseReaderFields[] = array( 'name' => 'APP_STATUS' );
// $caseReaderFields[] = array( 'name' => 'USERS' );
$caseReaderFields[] = array( 'name' => 'CASE_NOTES_COUNT' );
return array ( 'caseColumns' => $caseColumns, 'caseReaderFields' => $caseReaderFields, 'rowsperpage' => 20, 'dateformat' => 'M d, Y' );
}

View File

@@ -39,6 +39,7 @@
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->usingExtJs('ux/miframe');
$oHeadPublisher->addExtJsScript('cases/caseNotes', true);
$oHeadPublisher->addExtJsScript('cases/open', true);
$uri = '';

View File

@@ -527,6 +527,7 @@ antes funcionaba.
.ICON_STEPS {
background-image:url(/images/steps.png) !important;
}
.ICON_ASSIGN_TASK {
background-image:url(/images/flechav1A.png) !important;
}
@@ -680,7 +681,11 @@ antes funcionaba.
width:15px !important;
height:15px !important;
}
.ICON_CASES_NOTES {
/*ss_comment*/
background-image:url( /images/icons_silk/sprites.png) !important;
background-position:0 -4501px !important
}
.ICON_ADDITIONAL_TABLES{
/*ss_database_table*/
background-image:url( /images/icons_silk/sprites.png) !important;
@@ -887,3 +892,26 @@ antes funcionaba.
list-style-type:disc;
margin-left:15px;
}
.note-item {
font:normal 11px tahoma, arial, helvetica, sans-serif;
padding:3px 3px 3px 3px;
border:1px solid #fff;
border-bottom:1px solid #eeeeee;
white-space:normal;
color:#555;
}
.note-item h3 {
display:block;
font:inherit;
font-weight:bold;
color:#222;
}
.note-item h3 span {
float: right;
font-weight:normal;
margin:0 0 5px 5px;
width:50px;
display:block;
clear:none;
}

View File

@@ -0,0 +1,246 @@
function closeCaseNotesWindow(){
if(Ext.get("caseNotesWindowPanel")){
Ext.get("caseNotesWindowPanel").destroy();
}
}
function openCaseNotesWindow(appUid,modalSw){
if(!appUid) appUid="";
var storeNotes = new Ext.data.JsonStore({
url : 'caseNotesAjax.php?action=getNotesList&appUid='+appUid,
root: 'notes',
totalProperty: 'totalCount',
fields: ['USR_USERNAME','NOTE_DATE','NOTE_CONTENT'],
baseParams:{
start:0,
limit:10
}
});
storeNotes.load();
var tplNotes = new Ext.XTemplate(
'<tpl for=".">',
'<div class="thumb-wrap">',
'<div class="thumb" >',
'<span class="x-editable"><b>{USR_USERNAME}</b></span><br>',
'<span class="x-editable">{NOTE_CONTENT}</span><br>',
'<span class="x-editable"><small><i>{NOTE_DATE}</i></small><hr /></span>',
'</div>',
'</div>',
'</tpl>',
'<div class="x-clear"></div>'
);
var panelNotes = new Ext.Panel({
id:'notesPanel',
frame:false,
autoWidth:true,
autoHeight:true,
collapsible:false,
items:[ new Ext.DataView({
store: storeNotes,
tpl: tplNotes,
autoWidth:true,
//autoHeight:true,
autoScroll:true,
multiSelect: false,
overClass:'x-view-over',
itemSelector:'div.thumb-wrap',
emptyText: _('ID_CASE_NOTES_EMPTY'),
prepareData: function(data){
//data.shortName = Ext.util.Format.ellipsis(data.name, 15);
//data.sizeString = Ext.util.Format.fileSize(data.size);
//data.dateString = data.lastmod.format("m/d/Y g:i a");
//console.log(data);
return data;
},
listeners: {
selectionchange: {
fn: function(dv,nodes){
var l = nodes.length;
var s = l != 1 ? 's' : '';
panelNotes.setTitle('Process ('+l+' item'+s+' selected)');
}
},
click: {
fn: function(dv,nodes,a){
//console.info("Click");
//console.log(dv);
//console.log(a);
}
}
}
}),{
xtype:'button',
text:_('ID_CASE_NOTES_MORE'),
align:'center',
handler:function() {
storeNotes.loadNext();
}
}]
});
var caseNotesWindow;
caseNotesWindow = new Ext.Window({
title: _('ID_CASES_NOTES'), //Title of the Window
id: 'caseNotesWindowPanel', //ID of the Window Panel
width:300, //Width of the Window
resizable: true, //Resize of the Window, if false - it cannot be resized
closable: true, //Hide close button of the Window
modal: modalSw, //When modal:true it make the window modal and mask everything behind it when displayed
iconCls: 'ICON_CASES_NOTES',
autoCreate: true,
height:400,
shadow:true,
minWidth:300,
minHeight:200,
proxyDrag: true,
keys: {
key: 27,
fn : function(){
caseNotesWindow.hide();
}
},
autoScroll:true,
items:[panelNotes],
tools:[
{
id:'refresh',
handler:function() {
storeNotes.load();
}
}
],
bbar:[
new Ext.ux.StatusBar({
defaultText : _('ID_READY'),
id : 'notesStatusPanel',
defaultIconCls: 'ICON_CASES_NOTES',
// values to set initially:
text: _('ID_READY'),
iconCls: 'ready-icon',
statusAlign: 'left',
// any standard Toolbar items:
items: []
})
],
tbar:[{
//xtype:'textfield',
xtype:'textarea',
id:'caseNoteText',
name:'caseNoteText',
hideLabel: true,
blankText:_('ID_CASES_NOTES_POST'),
//anchor:'95%',
anchor: '100% -53',
width:250,
//autoWidth:true,
grow:true,
selectOnFocus:true,
maxLenght:150,
//preventMark:true,
allowBlank:false
//multiline:true
},' ',{
text:'&nbsp;&nbsp;'+_('ID_SUBMIT_NOTE'),
iconCls: 'ICON_CASES_NOTES',
handler:function() {
var noteText = Ext.getCmp('caseNoteText').getValue();
if(noteText=="") return false;
Ext.getCmp('caseNoteText').focus();
Ext.getCmp('caseNoteText').reset();
statusBarMessage( _('ID_CASES_NOTE_POSTING'), true);
Ext.Ajax.request({
url : 'caseNotesAjax' ,
params : {
action : 'postNote',
appUid:appUid,
noteText:noteText
},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if(data.success=="success"){
statusBarMessage( _('ID_CASES_NOTE_POST_SUCCESS'), false,true);
storeNotes.load();
}else{
statusBarMessage( _('ID_CASES_NOTE_POST_ERROR'), false,false);
Ext.MessageBox.alert(_('ID_CASES_NOTE_POST_ERROR'), data.message);
}
},
failure: function ( result, request) {
statusBarMessage( _('ID_CASES_NOTE_POST_FAILED'), false,false);
Ext.MessageBox.alert(_('ID_CASES_NOTE_POST_FAILED'), result.responseText);
}
});
}
}],
listeners:{
show:function() {
this.loadMask = new Ext.LoadMask(this.body, {
msg:_('ID_LOADING')
});
},
close:function(){
//console.log(Ext.get("caseNotes"));
if(Ext.get("caseNotes")){
Ext.getCmp("caseNotes").toggle(false);
//Ext.getCmp('caseNotes').show();
}
}
}
});
caseNotesWindow.show();
}
function statusBarMessage( msg, isLoading, success ) {
// console.log("Status Bar needed");
// console.log(msg);
var statusBar = Ext.getCmp('notesStatusPanel');
if( !statusBar ) return;
// console.log("Status bar acceced: "+msg);
if( isLoading ) {
statusBar.showBusy(msg);
}
else {
//statusBar.setStatus("Done.");
statusBar.clearStatus();
if( success ) {
statusBar.setStatus({
text: '' + msg,
iconCls: 'success',
clear: true
});
//Ext.msgBoxSlider.msg('', msg );
} else {
statusBar.setStatus({
text: 'Error: ' + msg,
iconCls: 'error',
clear: true
});
//Ext.msgBoxSlider.msg('Error', msg );
}
}
}

View File

@@ -22,8 +22,19 @@ var storeReassignCases;
var grid;
var textJump;
/** */
/** */
function caseNotes(){
var rowModel = grid.getSelectionModel().getSelected();
if(rowModel){
var appUid = rowModel.data.APP_UID;
var delIndex = rowModel.data.DEL_INDEX;
var caseTitle = (rowModel.data.APP_TITLE) ? rowModel.data.APP_TITLE : rowModel.data.APP_UID;
openCaseNotesWindow(appUid,true);
}else{
msgBox('Information', TRANSLATIONS.ID_SELECT_ONE_AT_LEAST);
}
}
function openCase(){
var rowModel = grid.getSelectionModel().getSelected();
@@ -284,6 +295,11 @@ Ext.onReady ( function() {
return String.format("<span style='{1}'>{0}</span>", myDate.dateFormat(PMDateFormat), myColor );
}
function renderNote(val,p,r) {
appUid="'"+r.data['APP_UID']+"'";
return '<img src="/images/ext/default/s.gif" class="x-tree-node-icon ICON_CASES_NOTES" unselectable="off" id="extdd-17" onClick="openCaseNotesWindow('+appUid+',true)">';
}
function showField (value,p,r) {
if ( r.data['DEL_INIT_DATE'] )
return String.format("{0}", value );
@@ -299,6 +315,7 @@ Ext.onReady ( function() {
if( c.id == 'deleteLink') c.renderer = deleteLink;
if( c.id == 'viewLink') c.renderer = viewLink;
if( c.id == 'unpauseLink') c.renderer = unpauseLink;
if( c.dataIndex == 'CASE_NOTES_COUNT') c.renderer = renderNote;
}
//adding the hidden field DEL_INIT_DATE
@@ -927,6 +944,38 @@ Ext.onReady ( function() {
reassingCaseToUser = function()
{
var APP_UID = optionMenuReassignGlobal.APP_UID;
var DEL_INDEX = optionMenuReassignGlobal.DEL_INDEX;
var rowSelected = Ext.getCmp('reassignGrid').getSelectionModel().getSelected();
if( rowSelected ) {
PMExt.confirm(_('ID_CONFIRM'), _('ID_REASSIGN_CONFIRM'), function(){
Ext.Ajax.request({
url : 'casesList_Ajax' ,
params : {actionAjax : 'reassignCase', USR_UID: rowSelected.data.USR_UID, APP_UID: APP_UID, DEL_INDEX:DEL_INDEX},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.status == 0 ) {
parent.notify('', data.msg);
location.href = 'casesListExtJs';
} else {
alert(data.msg);
}
},
failure: function ( result, request) {
Ext.MessageBox.alert('Failed', result.responseText);
}
});
});
}
}
optionMenuNotes = new Ext.Action({
text: _('ID_CASES_NOTES'),
iconCls: 'ICON_CASES_NOTES',
handler: caseNotes
});
reassingCaseToUser = function()
{
var APP_UID = optionMenuReassignGlobal.APP_UID;
@@ -1073,7 +1122,7 @@ Ext.onReady ( function() {
switch(action){
case 'todo':
menuItems = [optionMenuOpen, optionMenuPause];
menuItems = [optionMenuOpen, optionMenuPause,optionMenuNotes];
if( ___p34315105.search('R') != -1 )
menuItems.push(optionMenuReassign);
@@ -1082,7 +1131,7 @@ Ext.onReady ( function() {
break;
case 'draft':
menuItems = [optionMenuOpen, optionMenuPause];
menuItems = [optionMenuOpen, optionMenuPause,optionMenuNotes];
if( ___p34315105.search('R') != -1 )
menuItems.push(optionMenuReassign);
menuItems.push(optionMenuDelete);
@@ -1090,11 +1139,11 @@ Ext.onReady ( function() {
break;
case 'paused':
menuItems = [optionMenuUnpause];
menuItems = [optionMenuUnpause,optionMenuNotes];
break;
default:
menuItems = []
menuItems = [optionMenuNotes]
}
var messageContextMenu = new Ext.menu.Menu({
@@ -1321,6 +1370,7 @@ Ext.onReady ( function() {
items: itemToolbar
});
// create the editor grid
grid = new Ext.grid.GridPanel({
region: 'center',

View File

@@ -72,6 +72,9 @@ Ext.onReady(function(){
Ext.getCmp('casesStepTree').root.reload();
Ext.getCmp('stepsMenu').show();
break;
case 'NOTES':
Ext.getCmp('caseNotes').show();
break;
case 'INFO':
//filling information menu
@@ -245,6 +248,24 @@ Ext.onReady(function(){
id: 'actionMenu',
text: _('ID_ACTIONS'),
menu: []
}, {
id: 'caseNotes',
pressed: false,
enableToggle:true,
text: '&nbsp;&nbsp;'+_('ID_CASES_NOTES'),
iconCls: 'ICON_CASES_NOTES',
tooltip: {
title: _('ID_CASES_NOTES'),
text:_('ID_SHOW_CASES_NOTES')
},
toggleHandler:function(btn, pressed){
if(pressed){
openCaseNotesWindow();
}else{
closeCaseNotesWindow();
}
}
}]
}
@@ -255,6 +276,7 @@ Ext.onReady(function(){
Ext.getCmp('stepsMenu').hide();
Ext.getCmp('caseNotes').hide();
Ext.getCmp('informationMenu').hide();
//Ext.getCmp('actionMenu').hide();