| [ PHPXref.com ] | [ Generated: Sun Jul 20 20:47:44 2008 ] | [ TUTOS 1.2 ] |
| [ Index ] [ Variables ] [ Functions ] [ Classes ] [ Constants ] [ Statistics ] | ||
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * Copyright 1999 - 2003 by Gero Kohnert 4 * 5 * @modulegroup address 6 * @module address_select 7 * @package address 8 */ 9 include_once 'webelements.p3'; 10 include_once 'permission.p3'; 11 12 /* Check if user is allowed to use it */ 13 check_user(); 14 loadmodules("address","select"); 15 loadlayout(); 16 17 /** 18 * display a address selection form 19 */ 20 class address_select extends layout { 21 /** 22 * 23 */ 24 Function info() { 25 global $lang, $tutos; 26 27 echo "<br /><br /><center>\n"; 28 29 echo "<form name=\"adrsearch1\" method=\"GET\" action=\"address_overview.php\">\n"; 30 DoubleTableStart(); 31 echo "<tr>\n"; 32 if ( $this->ext == 0 ) { 33 echo "<th colspan=\"3\">". $lang['SearchForAdr'] ."</th>\n"; 34 echo "</tr><tr>\n"; 35 echo $this->showfieldc($lang['AdrName']); 36 echo "<td> <input type=\"text\" value=\"". $this->lookfor ."\" name=\"name\"> </td>\n"; 37 echo "<td><input type=\"submit\" value=\"". $lang['Search'] ."\" title=\"". $lang['SearchForAdr'] ."\"></td>\n"; 38 echo "</tr><tr>\n"; 39 echo "<td colspan=\"2\"> </td>\n"; 40 echo "<td>". makelink("address_select.php?ext=1",$lang['extended']) ."</td>\n"; 41 } else { 42 echo "<th colspan=\"3\">". $lang['SearchForAdrExt'] ."</th>\n"; 43 echo "</tr><tr>\n"; 44 echo $this->showfieldc($lang['AdrName']); 45 echo " <td> <input type=\"text\" value=\"". $this->lookfor ."\" name=\"name\"> </td>\n"; 46 echo " <td><input type=\"submit\" value=\"". $lang['Search'] ."\" title=\"". $lang['SearchForAdrExt'] ."\"></td>\n"; 47 echo "</tr><tr>\n"; 48 49 $c['name'] = ""; 50 $c['city'] = ""; 51 $c['street'] = ""; 52 $c['email'] = ""; 53 $c['desc'] = ""; 54 $c['phone'] = ""; 55 if ( isset($tutos[adrsearch]) ) { 56 @reset($tutos[adrsearch]); 57 while( list ($i,$f) = @each ($tutos[adrsearch])) { 58 $c[$f] = " checked"; 59 } 60 } 61 62 echo " <td colspan=\"3\">\n"; 63 echo " <input type=\"checkbox\" value=\"name\" name=\"ext[]\"". $c['name'] ."> ". $lang['AdrLastName'] ." & ". $lang['AdrFirstName'] ."<br />\n"; 64 echo " <input type=\"checkbox\" value=\"city\" name=\"ext[]\"". $c['city'] ."> ". $lang['City'] ."<br />\n"; 65 echo " <input type=\"checkbox\" value=\"street\" name=\"ext[]\"". $c['street'] ."> ". $lang['Street'] ."<br />\n"; 66 echo " <input type=\"checkbox\" value=\"email\" name=\"ext[]\"". $c['email'] ."> ". $lang['AdrEmail'] ."<br />\n"; 67 echo " <input type=\"checkbox\" value=\"phone\" name=\"ext[]\"". $c['phone'] ."> ". $lang['Phone'] ."/". $lang['AdrFax']."<br />\n"; 68 echo " <input type=\"checkbox\" value=\"desc\" name=\"ext[]\"". $c['desc'] ."> ". $lang['Description']."\n"; 69 echo " </td>\n"; 70 } 71 72 echo "</tr>\n"; 73 DoubleTableEnd(); 74 hiddenFormElements(); 75 echo $this->getHidden(); 76 echo "</form>\n"; 77 78 if ( defined('useldap') && $this->user->feature_ok(useldap,PERM_SEL) ) { 79 echo "<form name=\"adrsearch2\" method=\"get\" action=\"ldap/ldap_overview.php\">\n"; 80 DoubleTableStart(); 81 echo "<tr>\n"; 82 echo "<th colspan=\"3\">". $lang['SearchLdapAdr'] ."</th>\n"; 83 echo "</tr><tr>\n"; 84 echo $this->showfieldc($lang['AdrName']); 85 echo "<td> <input type=\"text\" value=\"". $this->lookfor ."\" name=\"name\"> </td>\n"; 86 echo "<td><input type=\"submit\" value=\"". $lang['Search'] ."\" title=\"". $lang['SearchLdapAdr'] ."\"></td>\n"; 87 88 if ( count($tutos[ldapserver]) > 1 ) { 89 echo "</tr><tr>\n"; 90 echo $this->showfieldc($lang['LDAPServer']); 91 echo "<td colspan=2>\n"; 92 echo "<select name=\"sv\">\n"; 93 foreach($tutos[ldapserver] as $i => $t) { 94 echo "<option value=\"". $i ."\"". ($this->ldapserver==$i ? " selected":"") .">". $t ."</option>\n"; 95 } 96 echo "</select>\n"; 97 echo "</td>\n"; 98 } else { 99 $this->addHidden("sv","0"); 100 } 101 echo "</tr>\n"; 102 DoubleTableEnd(); 103 hiddenFormElements(); 104 echo $this->getHidden(); 105 echo "</form>\n"; 106 } 107 108 echo "<form name=\"cmpsearch1\" method=\"get\" action=\"company_overview.php\">\n"; 109 DoubleTableStart(); 110 echo "<tr>\n"; 111 echo "<th colspan=\"3\">". $lang['SearchForCmp'] ."</th>\n"; 112 echo "</tr><tr>\n"; 113 echo $this->showfieldc($lang['Company']); 114 echo "<td> <input type=\"text\" value=\"". $this->lookfor ."\" name=\"name\"> </td>\n"; 115 echo "<td><input type=\"submit\" value=\"". $lang['Search'] ."\" title=\"". $lang['SearchForCmp']."\"></td>\n"; 116 echo "</tr>\n"; 117 DoubleTableEnd(); 118 hiddenFormElements(); 119 echo $this->getHidden(); 120 echo "</form>\n"; 121 echo "</center>\n"; 122 123 echo $this->setfocus("adrsearch1.name"); 124 } 125 /** 126 * 127 */ 128 Function navigate() { 129 } 130 /** 131 * preapre everything read data , parse args etc 132 */ 133 Function prepare() { 134 global $msg,$lang,$tutos; 135 $this->name = $lang['AddressSearch']; 136 137 if ( ! $this->user->feature_ok(useaddressbook,PERM_SEL) ) { 138 $msg .= sprintf($lang['Err0022'],"'". $this->name ."'"); 139 $this->stop = true; 140 } 141 142 # The extended mode fields 143 if ( isset($_SESSION['adrsearch']) ) { 144 $tutos[adrsearch] = $_SESSION['adrsearch']; 145 } 146 # The default search string 147 if ( isset($_SESSION['adrlook']) ) { 148 $this->lookfor = myentities($_SESSION['adrlook']); 149 } else { 150 $this->lookfor = ""; 151 } 152 if ( isset($_GET['ext']) ) { 153 $this->ext = $_GET['ext']; 154 } else { 155 $this->ext = 0; 156 } 157 if ( isset($_SESSION['ldapserver']) ) { 158 $this->ldapserver = $_SESSION['ldapserver']; 159 } else { 160 $this->ldapserver = 0; 161 } 162 163 # menu 164 if ( $this->user->feature_ok(useaddressbook,PERM_NEW) ) { 165 $x = array( url => "address_new.php", 166 text => $lang['NewEntry'], 167 info => $lang['AdrCreateInfo'], 168 category => array("address","new","obj") 169 ); 170 $this->addMenu($x); 171 } 172 if ( $this->user->feature_ok(useaddressbook,PERM_NEW) ) { 173 $x = array( url => "company_new.php", 174 text => $lang['CompanyCreate'], 175 info => $lang['CompanyCreateInfo'], 176 category => array("company","new","obj") 177 ); 178 $this->addMenu($x); 179 $x = array( url => "department_new.php", 180 text => $lang['DepartmentCreate'], 181 info => $lang['DepCreateInfo'], 182 category => array("department","new","obj") 183 ); 184 $this->addMenu($x); 185 } 186 } 187 } 188 189 $l = new address_select($current_user); 190 $l->display(); 191 $dbconn->Close(); 192 ?> 193 <!-- 194 CVS Info: $Id: address_select.php,v 1.36.2.1 2004/08/25 19:04:04 gokohnert Exp $ 195 $Author: gokohnert $ 196 -->
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| [ Powered by PHPXref - Served by Debian GNU/Linux ] |