task #841 : amélioration encodage, passe d'un champs à l'autre avec TAB, la date a le focus

This commit is contained in:
Dany De Bontridder 2013-05-15 18:35:03 +00:00
parent e41a7d9db1
commit fc6fa5ccb7
9 changed files with 19 additions and 7 deletions

View file

@ -1763,6 +1763,7 @@ class Acc_Ledger extends jrn_def_sql
$w->value = (isset($jrn_concerned)) ? $jrn_concerned : "";
$ret.="Réconciliation/rapprochements : " . $w->input();
}
$ret.= create_script("$('".$wDate->id."').focus()");
return $ret;
}
@ -2305,7 +2306,7 @@ class Acc_Ledger extends jrn_def_sql
$value = 0;
return $value;
}
/**
* @brief create the invoice and saved it as attachment to the
* operation,

View file

@ -430,7 +430,7 @@ class Acc_Ledger_Fin extends Acc_Ledger
require_once('template/form_ledger_fin.php');
$r.=ob_get_contents();
ob_end_clean();
$r.= create_script("$('".$Date->id."').focus()");
return $r;
}

View file

@ -890,11 +890,13 @@ class Acc_Ledger_Purchase extends Acc_Ledger
/* Add button */
$f_add_button=new IButton('add_card');
$f_add_button->label=_('Créer une nouvelle fiche');
$f_add_button->tabindex=-1;
$f_add_button->set_attribute('ipopup','ipop_newcard');
$f_add_button->set_attribute('jrn',$this->id);
$f_add_button->javascript=" this.jrn=\$('p_jrn').value;select_card_type(this);";
$f_add_button2=new IButton('add_card2');
$f_add_button2->tabindex=-1;
$f_add_button2->label=_('Créer une nouvelle fiche');
$f_add_button2->set_attribute('ipopup','ipop_newcard');
$f_add_button2->set_attribute('filter',$this->get_all_fiche_def ());
@ -1227,6 +1229,8 @@ class Acc_Ledger_Purchase extends Acc_Ledger
{
$r.='<script> update_pj();</script>';
}
// set focus on date
$r.= create_script("$('".$Date->id."').focus()");
return $r;
}

View file

@ -1032,12 +1032,14 @@ class Acc_Ledger_Sold extends Acc_Ledger
$flag_tva=$g_parameter->MY_TVA_USE;
/* Add button */
$f_add_button=new IButton('add_card');
$f_add_button->tabindex=-1;
$f_add_button->label=_('Créer une nouvelle fiche');
$f_add_button->set_attribute('ipopup','ipop_newcard');
$f_add_button->set_attribute('jrn',$this->id);
$f_add_button->javascript="this.jrn=\$('p_jrn').value; select_card_type(this);";
$f_add_button2=new IButton('add_card2');
$f_add_button2->tabindex=-1;
$f_add_button2->label=_('Créer une nouvelle fiche');
$f_add_button2->set_attribute('ipopup','ipop_newcard');
$f_add_button2->set_attribute('filter',$this->get_all_fiche_def ());
@ -1355,7 +1357,7 @@ class Acc_Ledger_Sold extends Acc_Ledger
$r.=HtmlInput::hidden('jrn_type','VEN');
$r.=HtmlInput::button('add_item',_('Ajout article'), ' onClick="ledger_add_row()"');
$r.= create_script("$('".$Date->id."').focus()");
return $r;
}

View file

@ -219,12 +219,12 @@ class HtmlInput
}
static function infobulle($p_comment)
{
$r='<A HREF="#" style="display:inline;color:black;background-color:yellow;padding-left:4px;width:2em;padding-right:4px;text-decoration:none;" onmouseover="showBulle(\''.$p_comment.'\')" onclick="showBulle(\''.$p_comment.'\')" onmouseout="hideBulle(0)">?</A>';
$r='<A HREF="#" tabindex="-1" style="display:inline;color:black;background-color:yellow;padding-left:4px;width:2em;padding-right:4px;text-decoration:none;" onmouseover="showBulle(\''.$p_comment.'\')" onclick="showBulle(\''.$p_comment.'\')" onmouseout="hideBulle(0)">?</A>';
return $r;
}
static function warnbulle($p_comment)
{
$r='<A HREF="#" style="display:inline;color:red;background-color:white;padding-left:4px;padding-right:4px;text-decoration:none;" onmouseover="showBulle(\''.$p_comment.'\')" onclick="showBulle(\''.$p_comment.'\')" onmouseout="hideBulle(0)">&Delta;</A>';
$r='<A HREF="#" tabindex="-1" style="display:inline;color:red;background-color:white;padding-left:4px;padding-right:4px;text-decoration:none;" onmouseover="showBulle(\''.$p_comment.'\')" onclick="showBulle(\''.$p_comment.'\')" onmouseout="hideBulle(0)">&Delta;</A>';
return $r;
}
/**

View file

@ -36,8 +36,10 @@ class IButton extends HtmlInput
if ( $this->readOnly==true) return $this->display();
$extra= ( isset($this->extra))?$this->extra:"";
$this->id=($this->id=="")?$this->name:$this->id;
$tab=(isset($this->tabindex))?' tabindex="'.$this->tabindex.'"':"";
$r='<input type="BUTTON" name="'.$this->name.'"'.
' class="button" '.
$tab.
' id="'.$this->id.'"'.
' value="'.$this->label.'"'.
' onClick="'.$this->javascript.'"'.$extra.'>';
@ -46,6 +48,7 @@ class IButton extends HtmlInput
return $r;
}
/*!\brief print in html the readonly value of the widget*/
public function display()
{

View file

@ -299,7 +299,7 @@ class ICard extends HtmlInput
else
$a.="this.inp='".$this->name."';";
$a.="this.popup='ipop_card';";
$button->tabindex=-1;
$button->javascript=$a.' search_card(this)';
return $button->input();
}

View file

@ -80,7 +80,7 @@ class ITva_Popup extends HtmlInput
if ( $this->readOnly==true) return $this->display();
$str='<input type="TEXT" class="input_text" name="%s" value="%s" id="%s" size="3" %s>';
$str='<input type="TEXT" class="input_text" name="%s" value="%s" id="%s" size="3" %s>';
$r=sprintf($str,$this->name,$this->value,$this->id,$this->js);
if ($this->in_table)
@ -128,6 +128,7 @@ class ITva_Popup extends HtmlInput
// button
$bt=new IButton('bt_'.$this->id);
$bt->tabindex="-1";
$bt->label=_(' TVA ');
$bt->set_attribute('gDossier',dossier::id());
$bt->set_attribute('ctl',$this->id);

View file

@ -257,6 +257,7 @@ global $g_parameter;
{
echo create_script(" get_last_date()");
}
exit();