$ -> Affected files
---------------------------------------Release Candidate 1-------------------------------
+09-Jun-2008 Janusz Dobrowolski
+# Some additional fixes related to last big committment
+$ /gl/gl_journal.php
+ /includes/ajax.inc
+ /includes/ui/ui_lists.inc
+ /includes/ui/ui_view.inc
+ /js/inserts.js
+ /js/utils.js
+ /sales/includes/ui/sales_order_ui.inc
+ /themes/default/default.css
+
08-Jun-2008 Joe Hunt
! Preparing for release candidate 1
$ config.php
if ($use_date_picker)
$js .= get_js_date_picker();
-set_focus('CodeID2');
+set_focus('_code_id_edit');
page(_("Journal Entry"), false, false,'', $js);
// remove not active commands
foreach ($this->aCommands as $idx => $com) {
- // display_error( $idx.':'.var_dump($com));
// If we should reload whole page content ignore all commands but the update.
// This is page repost equivalent, although header and footer are not reloaded.
+ if ($com['why'] !== true && !isset($this->triggers[$com['why']])) {
+ unset($this->aCommands[$idx]);
+// display_error('unset '.$com['t']);
+ }
+ else
if($com['n'] == 'up' && $com['t'] == '_page_body') {
$this->aCommands = array($com);
break;
}
- else
- if ($com['why'] !== true && !isset($this->triggers[$com['why']]))
- unset($this->aCommands[$idx]);
}
+// display_error(htmlentities(print_r($this->aCommands, true)));
$GLOBALS['_RESULT'] = $this->aCommands;
// exit();
}
'max' => 50,
'cells' => false, // combo displayed as 2 <td></td> cells
'search' => array(), // sql field names to search
- // if _focus is not set on next field before combo_input call
- // set this to false to avoid deadlock via onblur handler
- 'next_focus' => (!isset($_POST['_focus']) ||
- (isset($_POST["_{$name}_button"]) && $_POST['_focus']==$name)) ? false : $_POST['_focus'],
'format' => null, // format functions for regular options
'disabled' => false, // FIX todo
'box_hint' => null // box/selectors hints; null = std see below
$Ajax->activate('_page_body');
else
$Ajax->activate($name);
- set_focus($opts['next_focus']);
}
- if ($search_box && $opts['search_submit']) {
+ if ($search_box) {
// search related sql modifications
$rel = "rel='$search_box'"; // set relation to list
-
+ if ($opts['search_submit']) {
// if selected from list - set focus on next field
if (isset($_POST[$search_submit])) {
$Ajax->activate($name);
- set_focus($name);
}
if ($txt == '') {
if ($spec_option === false)
$opts['where'][] = '('. implode($opts['search'], ' OR ') . ')';
}
}
+ }
// sql completion
if (count($opts['where'])) {
$sql .= strpos($sql, 'WHERE')==false ? ' WHERE ':' AND ';
if ($search_box != false) {
$edit_entry = "<input type='text' name='$search_box' id='$search_box' size='".
$opts['size']."' maxlength='".$opts['max'].
- "' value='$txt' class='$class' rel='$name' title='"
+ "' value='$txt' class='$class' rel='$name' autocomplete='off' title='"
.$opts['box_hint']."'"
.(in_ajax() && !$by_id ? " style=display:none;":'')
.">\n";
-// default_focus($search_box);
if ($search_submit != false) {
global $_search_button;
$edit_entry .= sprintf($_search_button, user_theme(),
'format' => '_format_account' . ($show_group ? '2' : ''),
'order' => 'account_code',
'search_box' => $cells,
- 'search_submit' => true,
+ 'search_submit' => false,
'size' => 12,
'max' => 10,
'cells' => true
If $form<0 $name is element id.
*/
function set_focus($name, $form_no=0) {
+ global $Ajax;
+ $Ajax->addFocus(true, $name);
$_POST['_focus'] = $name;
}
//
-
var _focus;
function debug(msg) {
- document.getElementById('msgbox').innerHTML=
- document.getElementById('msgbox').innerHTML+'<br>'+msg
+ box = document.getElementById('msgbox')
+ box.innerHTML= box.innerHTML+'<br>'+msg
}
function progbar(container) {
}
function save_focus(e) {
-// document.getElementsByName('_focus')[0].value = e.name;
_focus = e.name||e.id;
var h = document.getElementById('hints');
if (h) {
}
function _set_combo_input(e) {
- e.onblur=function() {
-// if(!this.back) {
- var but_name = this.name.substring(0, this.name.length-4)+'button';
- var button = document.getElementsByName(but_name)[0];
- var select = document.getElementsByName(this.getAttribute('rel'))[0];
- save_focus(select);
+ e.onblur=function() {
+ var but_name = this.name.substring(0, this.name.length-4)+'button';
+ var button = document.getElementsByName(but_name)[0];
+ var select = document.getElementsByName(this.getAttribute('rel'))[0];
+ save_focus(select);
// this.style.display='none';
- if(button) { // if *_button set submit search request
- JsHttpRequest.request(but_name);
- }
- return false;
-// }
+ if(button) { // if *_button set submit search request
+ JsHttpRequest.request(but_name);
+ }
+ return false;
};
e.onkeyup = function(ev) {
var select = document.getElementsByName(this.getAttribute('rel'))[0];
}
}
};
- e.onkeydown = function(ev) {
+ e.onkeydown = function(ev) {
ev = ev||window.event;
key = ev.keyCode||ev.which;
if(key == 13) {
this.blur();
return false;
}
-// this.back = ev.shiftKey; // save shift state for onblur handler
}
}
}
function _set_combo_select(e) {
+ e.onblur = function() {
+ if(this.className=='combo')
+ _update_box(this);
+ }
e.onchange = function() {
var s = this;
}
return true;
}
-// e.onblur = function() {
-// if (this.className == 'combo')
-// _update_box(this);
-// },
e.onkeydown = function(event) {
event = event||window.event;
-// this.back = event.shiftKey; // save shift state for onblur handler
key = event.keyCode||event.which;
var box = document.getElementsByName(this.getAttribute('rel'))[0];
if (box && key == 32 && this.className == 'combo2') {
this.style.display = 'none';
box.style.display = 'inline';
box.value='';
- // Konq does not like short syntax for nonstd attr
-// this.setAttribute('back', 'true');
-// this.back=true;
setFocus(box.name);
return false;
}
// this hides search button for js enabled browsers
e.style.display = 'none';
},
- 'input.ajaxsubmit,input.editbutton,input.navibutton':
+/* 'select.combo,select.combo2':
+ function(e) {
+ var box = document.getElementsByName(e.getAttribute('rel'))[0];
+ if(box) {
+ box.style.width = 200+'px';
+ e.style.width = 200+'px';
+ debug(e.name+':'+e.style.width)
+ }
+ },
+*/ 'input.ajaxsubmit,input.editbutton,input.navibutton':
function(e) {
e.onclick = function() {
JsHttpRequest.request(this.name);
e.onfocus = function() {
save_focus(this);
};
- e.onkeydown = function(event) {
- event = event||window.event;
- this.back = event.shiftKey; // save shift state for onblur handler
- this.lastkey = event.keyCode;
- };
var c = e.className;
if (c == 'combo' || c == 'combo2')
_set_combo_select(e);
}
}
}
+ },
+ '#msgbox': function(e) {
+ // this is to avoid changing div height after ajax update in IE7
+ e.style.display = e.innerHTML.length ? 'block' : 'none';
}
/* TODO
'a.date_picker': function(e) {
// Function is called when an answer arrives.
function(result, errors) {
- // Write errors to the debug div.
- document.getElementById('msgbox').innerHTML = errors;
-
// Write the answer.
if (result) {
for(var i in result ) {
atom = result[i];
-
cmd = atom['n'];
property = atom['p'];
type = atom['c'];
} else {
errors = errors+'<br>Unknown ajax function: '+cmd;
}
- }
- Behaviour.apply();
+ }
+ // Write errors to the debug div.
+ document.getElementById('msgbox').innerHTML = errors;
+
+ Behaviour.apply();
if (errors.length>0)
window.scrollTo(0,0);
//document.getElementById('msgbox').scrollIntoView(true);
// Restore focus if we've just lost focus because of DOM element refresh
- setFocus();
+ setFocus();
}
},
false // do not disable caching
el = document.getElementById(name);
else
el = document.getElementsByName(name)[0];
+
if(el && el.focus) {
// The timeout is needed to prevent unpredictable behaviour on IE & Gecko.
// Using tmp var prevents crash on IE5
$customer_error = "";
$change_prices = 0;
- $newcust = ($order->customer_id != get_post('customer_id', -1));
- $newbranch = ($order->Branch != get_post('branch_id', -1)) || $newcust;
if (isset($order) && !$editable)
{
{
customer_list_row(_("Customer:"), 'customer_id', null, false, true);
- if ($newcust)
+ if ($order->customer_id != get_post('customer_id', -1))
{
// customer has changed
// clear the branch selection
$order->Branch = 0;
} else
{
- if($newcust || $newbranch) {
+ if( ($order->customer_id != get_post('customer_id', -1)) ||
+ ($order->Branch != get_post('branch_id', -1))) {
+
$old_order = (PHP_VERSION<5) ? $order : clone( $order );
$customer_error = get_customer_details_to_order($order, $_POST['customer_id'], $_POST['branch_id']);
border-bottom: 1px solid #8cacbb;
margin: -4px -2px -2px;
border: 1px solid #8cacbb;
-/* display: none;*/
background-color: #FFFFE0;
white-space: nowrap;
-/*
- position: absolute;
- left: 0;
- left: -900px;
- filter:alpha(opacity=0);
- -moz-opacity:0;
- border: 1px solid black;
- height: 200px;
- text-align: center;
- width:200px;
- z-index: 100;
- padding: 5px;
-*/
-}
\ No newline at end of file
+}