Source for file DBMS_FIELD_DBLOOKUPPOPUPSELECT.phpclass
Documentation is available at DBMS_FIELD_DBLOOKUPPOPUPSELECT.phpclass
* Class file DBMS_FIELD_DBLOOKUPPOPUPSELECT.phpclass
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: DBMS_FIELD_DBLOOKUPPOPUPSELECT.phpclass,v 1.4 2008/08/08 02:00:42 pitlinz Exp $
* Class DBMS_FIELD_DBLOOKUPPOPUPSELECT
* handels select fields (<SELECT>) where the values are selected form the database
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: DBMS_FIELD_DBLOOKUPPOPUPSELECT.phpclass,v 1.4 2008/08/08 02:00:42 pitlinz Exp $
// ###########################################################
// OBJECT (CONST) VAR DECLARATION
// ###########################################################
* source file of the class
* @var string $classSrcFile
// ###########################################################
// OBJECT SETTINGS METHODS
// ###########################################################
* returns an array of field to bie shown in the edit form
* by using editTbl_echoForm
* the array is in the form:
* [FLDLAB] (complete html code with <td></td>)
* [FLDVAL] (complete html code with <td></td>)
$a_ret['SELECT']['FLD_RADCHKBOX']=
NULL; // unset parent value
$a_ret['DBLOOKUP']['FLD_LSTADDVALUES']=
array(
'FLDLAB'=>
"Werte hinzufügen",
'FLDVAL'=>
"<input name=\"allowAddValues\" type=\"checkbox\"".
($this->allowAddValues ?
"checked" :
"").
" value=\"1\">ja fals im Formular möglich"
$a_ret['DBLOOKUP']['FLD_LSTEDITVALUES']=
array(
'FLDLAB'=>
"Werte bearbeiten",
'FLDVAL'=>
"<input name=\"allowEditValues\" type=\"checkbox\"".
($this->allowEditValues ?
"checked" :
"").
" value=\"1\">ja fals im Formular möglich"
$a_ret['LOOKUPFORM']=
array(
'TITLE'=>
"Popup Formular",
'FLDLAB'=>
"Popup Formular"
'FLDLAB'=>
"URL <a href=\"".
$GLOBALS['OCSP']['SYSTEMURL'].
"help/templatevars.html\" target=\"_blank\">?</a>",
'FLDVAL'=>
"<input name=\"popUp_url\" value=\"".
$this->popUp_url.
"\" size=\"40\">"
'FLDLAB'=>
"Popup Größe",
width: <input name=\"popUp_width\" value=\"".
$this->popUp_width.
"\" size=\"4\"> px
height: <input name=\"popUp_height\" value=\"".
$this->popUp_height.
"\" size=\"4\"> px
$a_ret['LOOKUPFORM']['FLD_POPFORM']['FLDVAL']=
"<select name=\"popUp_frmId\" size=\"1\">\n";
$s_query=
"SELECT FRM_ID,FRM_NAME,FRM_TABLES FROM T_DBMS_FORM ORDER BY FRM_TABLES,FRM_NAME";
if ($o_cursor=
$GLOBALS['USRDB']->query($s_query)) {
while($a_row=
$o_cursor->fetchArrayFld()) {
$a_ret['LOOKUPFORM']['FLD_POPFORM']['FLDVAL'].=
"\t<option value=\"".
$a_row['FRM_ID'].
"\" title=\"".
$a_row['FRM_TABLES'].
"\"";
$a_ret['LOOKUPFORM']['FLD_POPFORM']['FLDVAL'].=
" selected";
$a_ret['LOOKUPFORM']['FLD_POPFORM']['FLDVAL'].=
">".
$a_row['FRM_NAME'].
" (".
$a_row['FRM_ID'].
")</option>\n";
$a_ret['LOOKUPFORM']['FLD_POPFORM']['FLDVAL'].=
"\t<option value=\"\" selected>[URL]</option>\n";
$a_ret['LOOKUPFORM']['FLD_POPFORM']['FLDVAL'].=
"</select>";
if ($GLOBALS['USER']->isGroupMember($GLOBALS['GROUPS']['DBMS'])) {
$a_ret['LOOKUPFORM']['FLD_POPFORM']['FLDVAL'].=
"<a onClick=\"
var frmId=getSelectedOptionByName(document.forms['frmEdit'],'popUp_frmId');
alert('Wählen Sie zuerst ein Formular aus');
var link='".
$GLOBALS['PROJECT']['ADMINURL'].
"dbms/fieldList.php?';
link=link+'&FRM_ID='+frmId;
\" title=\"Formular bearbeiten\">
<img src=\"".
$GLOBALS['OCSP']['SYSIMGURL'].
"icons-16x16/utilities.png\" border=\"0\" class=\"button\">
* save the filed definition form
* @version pk-06-02-06 popUp_frmId
// ###########################################################
// ###########################################################
// ###########################################################
// OBJECT HTML FORM METHODS
// ###########################################################
* return a javascript code sequence to popup a input or edit dialog
* if $selName isset this is used instead of $this->myName
* if $mode is different from FRM_MODE_NEW the popup must get
* the value through javascript
* see $GLOBALS['OCSP']['SYSTEMURL']."forms/popup_form.php" for details
* if !empty $setMethod popup_form.php calls this method after adding
* the option instead of selecting the option
* @param string $selName since 06-02-10 (name of the select element if different from $this->myName)
* @param string $setMethod (js method template to call instead of directly setting the value)
function getPopupLinkJs($mode=
FRM_MODE_LIST,$selName=
"",$setMethod=
"",$debug=
FALSE) {
if ($debug) echo
"<p><b>DBMS_FIELD_DBLOOKUPPOPUPSELECT::getPopupLinkJs(...)</b> (".
get_class($this).
"/".
$this->myName.
")</p>";
$s_url=
$GLOBALS['OCSP']['SYSTEMURL'].
"forms/popup_form.php?";
$a_args['FRMMODE'] =
$mode;
$a_args['ARRFLD'] =
$this->myName; // the form, data array name
$a_args['SELFLD'] =
(empty($selName) ?
$this->myName :
$selName); // optional name for use in js
$a_args['SETMETHOD']=
$setMethod;
//$a_args['OPOST'] =$_POST;
//$a_args['SHOWFIELD']=$this->lookupShowField;
//$a_args['LUWHERE'] =$this->lookupWhere;
//$a_args['KEYFIELD'] =$this->lookupField;
$s_jCmd=
"\nvar url_".
$this->myName.
"='';\n";
$s_jCmd.=
"var opt_".
$this->myName.
"='width=".
$this->popUp_width.
",height=".
$this->popUp_height.
",toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes';\n";
$s_jCmd.=
"hWnd_".
$this->myName.
".focus();\n";
if ($debug) echo
"<blockquote><pre>".
htmlspecialchars($s_jCmd).
"</pre></blockquote>";
* overwrite the parent method as we use the searchform
$s_ret =
"<!--\n\t\t _______ SEARCH VALUES BUTTON _______ \n";
$s_ret.=
"\t\t \"><img src=\"".
$GLOBALS['PROJECT']['SYSIMGURL'].
"icons-16x16/view_multicolumn.gif\" border=\"0\" alt=\"Suchen/Hinzufügen\" title=\"Suchen/Hinzufügen\" valign=\"middle\" align=\"middle\" class=\"button\">";
$s_ret.=
"\t\t _______ SEARCH VALUES BUTTON _______ \n-->";
* returns the html code for the select
* @version pk-06-02-06 popUp_frmId
function getInputTag($aValue,$arrName=
"DBVAL",$debug=
FALSE) {
if ($debug) echoDebugMethod(__FILE__
,get_class($this),"DBMS_FIELD_DBLOOKUPPOPUPSELECT::getInputTag","aValue=$aValue",0);
// ###########################################################
// ###########################################################
// ###########################################################
// OBJECT HTML FORM METHODS
// ###########################################################
// ###########################################################
// OBJECT VALUE CHECK METHODS
// ###########################################################
} // end class DBMS_FIELD_DBLOOKUPPOPUPSELECT
Documentation generated on Thu, 08 Jan 2009 17:41:02 +0100 by phpDocumentor 1.4.0a2