new menubar for Case Open View

This commit is contained in:
Erik Amaru Ortiz
2011-02-04 15:00:20 +00:00
parent 2bbbe029c2
commit ba8adc87ce
16 changed files with 865 additions and 23 deletions

118
gulliver/js/ext/pmos-common.js Executable file
View File

@@ -0,0 +1,118 @@
PMExtJSCommon = function() {
this.version = '1.8';
this.confirm = function(title, msg, fnYes, fnNo)
{
Ext.MessageBox.confirm(title, msg, function(btn, text){
if ( btn == 'yes' )
setTimeout(fnYes, 0)
else if( fnNo != undefined )
setTimeout(fnNo, 0)
});
}
this.info = function(title, msg, fn) {
Ext.MessageBox.show({
title: title,
msg: msg,
buttons: Ext.MessageBox.OK,
animEl: 'mb9',
fn: fn != undefined ? fn: function(){},
icon: Ext.MessageBox.INFO
});
}
this.question = function(title, msg, fn) {
Ext.MessageBox.show({
title: title,
msg: msg,
buttons: Ext.MessageBox.OK,
animEl: 'mb9',
fn: fn != undefined ? fn: function(){},
icon: Ext.MessageBox.QUESTION
});
}
this.warning = function(title, msg, fn) {
Ext.MessageBox.show({
title: title,
msg: msg,
buttons: Ext.MessageBox.OK,
animEl: 'mb9',
fn: fn != undefined ? fn: function(){},
icon: Ext.MessageBox.WARNING
});
}
this.error = function(title, msg, fn) {
Ext.MessageBox.show({
title: title,
msg: msg,
buttons: Ext.MessageBox.OK,
animEl: 'mb9',
fn: fn != undefined ? fn: function(){},
icon: Ext.MessageBox.ERROR
});
}
this.notify = function(title, msg)
{
Ext.msgBoxSlider.msg(title, msg);
}
}
var PMExt = new PMExtJSCommon();
/**
* Common Ext Functions
*/
Ext.msgBoxSlider = function(){
var msgCt;
function createBox(t, s){
return [
'<div class="msg">',
'<div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>',
'<div class="x-box-ml"><div class="x-box-mr"><div id="x-box-mc-inner" class="x-box-mc"><h3>', t, '</h3>', s, '</div></div></div>',
'<div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>',
'</div>'
].join('');
}
return {
msg : function(title, format) {
if( ! msgCt ) {
msgCt = Ext.DomHelper.insertFirst(document.body, {id:'msg-div'}, true);
}
msgCt.alignTo(document, 't-t');
var s = String.format.apply(String, Array.prototype.slice.call(arguments, 1));
var m = Ext.DomHelper.append(msgCt, {html:createBox(title, s)}, true);
m.setWidth(400 );
m.position(null, 5000 );
m.alignTo(document, 't-t');
Ext.get('x-box-mc-inner' ).setStyle('background-image', 'url("<?php echo _EXT_URL ?>/images/_accept.png")');
Ext.get('x-box-mc-inner' ).setStyle('background-position', '5px 10px');
Ext.get('x-box-mc-inner' ).setStyle('background-repeat', 'no-repeat');
Ext.get('x-box-mc-inner' ).setStyle('padding-left', '35px');
m.slideIn('t').pause(3).ghost("t", {remove:true});
}
};
}();
/**
* Translator function for internationalization
*/
function _(ID_LABEL)
{
if( typeof(TRANSLATIONS) != 'undefined' ) {
if( typeof(TRANSLATIONS[ID_LABEL]) != 'undefined' ) {
trn = TRANSLATIONS[ID_LABEL];
} else {
trn = '**' + ID_LABEL + '**';
}
} else {
PMExt.error('Processmaker JS Core Error', 'The TRANSLATIONS global object is not loaded!');
trn = '';
}
return trn;
}

7
gulliver/js/ext/ux/miframe.js Executable file

File diff suppressed because one or more lines are too long

View File

@@ -18,6 +18,13 @@ switch($type){
$helper->serve();
break;
case 'js-translations':
$locale = $_GET['locale'];
G::LoadTranslationObject($locale);
global $translation;
print 'var TRANSLATIONS = ' . G::json_encode($translation) . ';';
break;
}

View File

@@ -1890,18 +1890,27 @@ class G
* @access public
* @parameter string msgID
* @parameter string file
* @parameter array data // erik: associative array within data input to replace for formatted string i.e "any messsage {replaced_label} that contains a replace label"
* @return string
*/
function LoadTranslation( $msgID , $lang = SYS_LANG )
function LoadTranslation( $msgID , $lang = SYS_LANG, $data = null)
{
global $translation;
if ( isset ( $translation[$msgID] ) ){
//return eregi_replace("[\n|\r|\n\r]", ' ', $translation[$msgID]);
return preg_replace("[\n|\r|\n\r]", ' ', $translation[$msgID]);
}else{
if(defined("UNTRANSLATED_MARK")){
$translationString = preg_replace("[\n|\r|\n\r]", ' ', $translation[$msgID]);
if( isset($data) && is_array($data) ) {
foreach($data as $label=>$value) {
$translationString = str_replace('{'.$label.'}', $value, $translationString);
}
}
return $translationString;
} else {
if( defined("UNTRANSLATED_MARK") ) {
$untranslatedMark = strip_tags(UNTRANSLATED_MARK);
}else{
} else {
$untranslatedMark = "**";
}
return $untranslatedMark . $msgID . $untranslatedMark;

View File

@@ -184,13 +184,10 @@ class headPublisher {
}
if ($this->disableHeaderScripts)
return '';
// die(SYS_LANG);
$this->addScriptFile ( "/js/widgets/js-calendar/lang/" . SYS_LANG . ".js" );
/*$this->addScriptFile("/js/widgets/calendar/pmcalendar.js");
/*$this->addScriptFile("/js/widgets/calendar/dhtmlSuite-common.js");
$this->addScriptFile("/js/widgets/calendar/dhtmlSuite-calendar.js");
$this->addScriptFile("/js/widgets/calendar/dhtmlSuite-dragDropSimple.js");
$this->addScriptFile("/js/widgets/calendar/neyek-abstractionCalendar.js");
*/
//$this->addScriptFile ( '/gulliver/loader?t=js-translations&locale='.SYS_LANG);
$head = '';
$head .= '<TITLE>' . $this->title . "</TITLE>\n";
@@ -282,6 +279,8 @@ class headPublisher {
$head .= " <script type='text/javascript' src='/js/ext/mootools.js'></script>\n";
$head .= " <script type='text/javascript' src='/js/ext/moocanvas.js'></script>\n";
$head .= " <script type='text/javascript' src='/js/ext/draw2d.js'></script>\n";
$head .= " <script type='text/javascript' src='/gulliver/loader?t=js-translations&locale=".SYS_LANG."'></script>\n";
$head .= " <script type='text/javascript' src='/js/ext/pmos-common.js'></script>\n";
if (! isset ( $this->extJsSkin ) || $this->extJsSkin == '') {
$this->extJsSkin = 'xtheme-gray';
@@ -307,7 +306,7 @@ class headPublisher {
//DEPRECATED, this will be removed in a future -->
//new interactive css decorator
$script .= " <link rel='stylesheet' type='text/css' href='/gulliver/decorator?t=extjs-cssExtended&s=".$this->extJsSkin."' />\n";
$script .= " <link rel='stylesheet' type='text/css' href='/gulliver/loader?t=extjs-cssExtended&s=".$this->extJsSkin."' />\n";
$script .= " <link rel='stylesheet' type='text/css' href='/images/icons_silk/sprite.css' />\n";
// Load external/plugin css