Changeset 285 for trunk/contactcenter/inc/class.ui_api.inc.php
- Timestamp:
- 05/23/08 17:10:39 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/contactcenter/inc/class.ui_api.inc.php
r284 r285 18 18 * 19 19 */ 20 20 21 21 class ui_api 22 22 { 23 23 var $commons; 24 24 var $commons_loaded = false; 25 25 26 26 function ui_api() 27 27 { 28 28 $preferences = ExecMethod('contactcenter.ui_preferences.get_preferences'); 29 29 30 30 if (!is_array($preferences)) 31 31 { … … 33 33 //$preferences['personCardPhone'] = 2; 34 34 } 35 36 $template_dir = PHPGW_SERVER_ROOT . '/contactcenter/templates/default/'; 37 $template = CreateObject('phpgwapi.Template',$template_dir); 35 36 //$template_dir = PHPGW_SERVER_ROOT . '/contactcenter/templates/default/'; 37 //$template = CreateObject('phpgwapi.Template',$template_dir); 38 $template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); 38 39 39 40 $template->set_file(array('api' => 'api_common.tpl')); 40 41 41 42 $template->set_var('cc_email_id_type', $preferences['personCardEmail']); 42 43 44 43 45 /* Messages */ 44 46 $template->set_var('cc_msg_err_invalid_catalog',lang('Unavailable or empty Catalog')); 45 $template->set_var('cc_msg_err_contacting_server',lang('Couldn\'t contact server or server response is invalid. '));47 $template->set_var('cc_msg_err_contacting_server',lang('Couldn\'t contact server or server response is invalid. Contact Admin.')); 46 48 $template->set_var('cc_msg_err_timeout',lang('Operation Timed Out.')); 47 49 $template->set_var('cc_msg_err_serialize_data_unknown',lang('Data to be serialized is of unknown type!')); … … 75 77 $template->set_var('cc_js_djswin', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/js/dJSWin/dJSWin.js'); 76 78 $template->set_var('cc_js_catalog_tree', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/cc_tree.js'); 77 79 78 80 $template->parse('out','api'); 79 81 … … 81 83 $this->commons_loaded = false; 82 84 } 83 85 84 86 /* DEPRECTED! Use get_email_win() instead */ 85 87 function ui_get_email_win() … … 91 93 { 92 94 //$search = $this->ui_get_search_win(); 93 95 94 96 $template_dir = PHPGW_SERVER_ROOT . '/contactcenter/templates/default/'; 95 97 $template = CreateObject('phpgwapi.Template', $template_dir); 96 98 97 99 $template->set_file(array('email_win' => 'email_win.tpl')); 98 100 99 101 if (!$this->commons_loaded) 100 102 { … … 106 108 $template->set_var('cc_api', ''); 107 109 } 108 110 109 111 //$template->set_var('cc_search_win', $search); 110 112 $template->set_var('cc_js_search', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/cc_search.js'); 111 113 112 114 $template->set_var('cc_email_id_type', $search); 113 115 114 116 $template->set_var('cc_email_win_title',lang('Contact Center').' - '.lang('Catalog Entries Emails')); 115 117 $template->set_var('cc_email_status',lang('Status').':'); 116 118 $template->set_var('cc_email_search_text',lang('Search').'...'); 117 119 118 120 $template->set_var('cc_choose_catalogue',lang('Choose a catalogue').'...'); 119 121 $template->set_var('cc_choose_ordinance',lang('Choose a ordinance').'...'); 120 122 121 123 $template->set_var('cc_btn_to_add',lang('To').' >>'); 122 124 $template->set_var('cc_btn_to_del','<< '.lang('To')); … … 130 132 $template->set_var('cc_btn_ok',lang('Ok')); 131 133 $template->set_var('cc_btn_cancel',lang('Cancel')); 132 134 133 135 $template->set_var('cc_label_to',lang('To').':'); 134 136 $template->set_var('cc_label_cc',lang('Cc').':'); … … 138 140 $template->set_var('cc_label_catalogue_type',lang('Type Of Catalogue').':'); 139 141 $template->set_var('cc_label_ordinance_type',lang('Type Of Ordinace').':'); 140 142 141 143 $template->set_var('phpgw_img_dir', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/images'); 142 144 143 145 $template->set_var('cc_js_email_win', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/cc_email_win.js'); 144 146 145 147 $template->parse('out','email_win'); 146 148 … … 159 161 160 162 $template->set_file(array('search' => 'search_win.tpl')); 161 163 162 164 if (!$this->commons_loaded) 163 165 { … … 169 171 $template->set_var('cc_api', ''); 170 172 } 171 173 172 174 $template->set_var('cc_search_title',lang('Contact Center - Search for Catalog Entries')); 173 175 $template->set_var('cc_search_minimize',lang('Minimize')); … … 178 180 $template->set_var('cc_search_go',lang('Go')); 179 181 $template->set_var('cc_search_cancel',lang('Cancel')); 180 182 181 183 $template->set_var('cc_js_search_win', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/cc_search_win.js'); 182 184 183 185 $template->set_var('phpgw_img_dir', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/images'); 184 186 185 187 $template->parse('out','search'); 186 188 … … 203 205 204 206 $template->set_file(array('full_add' => 'full_add.tpl')); 205 207 206 208 if (!$this->commons_loaded) 207 209 { … … 213 215 $template->set_var('cc_api', ''); 214 216 } 215 217 216 218 $template->set_var('cc_contact_title',lang('Contact Center').' - '.lang('Contacts')); 217 219 … … 221 223 $template->set_var('cc_msg_type_city',lang('Type new city here').'...'); 222 224 /* End Messages */ 223 225 224 226 /* Contact */ 225 227 $template->set_var('cc_contact_save',lang('Save')); … … 230 232 $template->set_var('cc_contact_addrs',lang('Addresses')); 231 233 $template->set_var('cc_contact_conns',lang('Connections')); 234 $template->set_var('emails_telephones', lang("E-Mails and Telephones")); 235 $template->set_var('cc_default', lang("Default")); 236 232 237 /* End Contact */ 233 238 234 239 /* Contact - Personal Data */ 235 240 $dateformat = $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']; 236 241 237 242 $j = 0; 238 243 for ($i = 0; $i < 5; $i+=2) … … 257 262 $j++; 258 263 } 259 264 260 265 $template->set_var('cc_pd_birth_size_0', "{$date[0]['size']}"); 261 266 $template->set_var('cc_pd_birth_size_1', "{$date[1]['size']}"); 262 267 $template->set_var('cc_pd_birth_size_2', "{$date[2]['size']}"); 263 268 264 269 $template->set_var('cc_pd_birthdate_0', "{$date[0]['name']}"); 265 270 $template->set_var('cc_pd_birthdate_1', "{$date[1]['name']}"); … … 268 273 $template->set_var('cc_pd_select_photo_b', lang('Browse').'...'); 269 274 $template->set_var('cc_form_photo_src', 'photo_form.html'); 270 275 271 276 $template->set_var('cc_pd_select_photo',lang('Select Photo')); 272 277 $template->set_var('cc_pd_alias',lang('Alias')); … … 286 291 $template->set_var('cc_pd_female',lang('Female')); 287 292 /* End Contact - Personal Data */ 288 293 289 294 /* Contact - Addresses */ 290 295 $template->set_var('cc_addr_types',lang('Type of Address')); … … 310 315 $template->set_var('cc_available',lang('Available')); 311 316 /* End Contact - Addresses */ 312 317 318 313 319 /* Contact - Connections */ 314 320 $template->set_var('cc_conn_type',lang('Type of Connection')); 315 321 $template->set_var('cc_conn_name',lang('Connection Name')); 316 322 $template->set_var('cc_conn_value',lang('Connection Value')); 317 323 318 324 $template->set_var('cc_new_same_type',lang('New from the same Type').'...'); 319 325 320 326 $template->set_var('cc_conn_type_none',lang('Choose Type of Connection').'...'); 321 327 /* End Contact - Connections */ 322 328 329 $template->set_var('email', lang("E-Mail")); 330 $template->set_var('telephone', lang("Telephone")); 331 $template->set_var('choose_email_telephone', lang("Choose 'E-Mail' or 'Telephone'")); 332 323 333 $template->parse('out_full', 'full_add'); 324 334 … … 332 342 333 343 $template->set_file(array('quickAdd' => 'quickAddPlugin.tpl')); 334 344 335 345 if (!$this->commons_loaded) 336 346 { … … 342 352 $template->set_var('cc_api', ''); 343 353 } 344 354 345 355 $template->set_var('ccQAPluginFile', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/ccQuickAdd-plugin.js'); 346 356 … … 350 360 $nFields = 5; 351 361 $fields = array( 352 lang('Alias'), 353 lang('Given Names'), 354 lang('Family Names'), 362 lang('Alias'), 363 lang('Given Names'), 364 lang('Family Names'), 355 365 lang('Phone'), 356 366 lang('Email') 357 367 ); 358 368 359 369 $template->set_var('ccQAnFields', $nFields); 360 370 361 371 $fieldsHTML = ''; 362 372 $fieldsTop = 10; … … 379 389 $template->set_var('ccQAWinHeight', ($i+1)*$fieldsSpace+$fieldsTop); 380 390 $template->set_var('ccQAFunctionsTop', ($fieldsTop+$i*$fieldsSpace).'px'); 381 391 382 392 /* Images Dir */ 383 393 $template->set_var('ccQACardImgRoot', $GLOBALS['phpgw_info']['server']['webserver_url'].'/contactcenter/templates/default/images/'); 384 394 385 395 /* Texts */ 386 396 $template->set_var('ccQATitle', lang('Contact Center').' - '.lang('Quick Add')); … … 388 398 $template->set_var('ccQAClear', lang('Reset')); 389 399 $template->set_var('ccQACancel', lang('Cancel')); 390 400 391 401 $template->parse('out_QA', 'quickAdd'); 392 402 393 403 return $template->get_var('out_QA'); 394 404 } 395 405 396 406 function get_add_group() 397 407 { … … 400 410 401 411 $template->set_file(array('addGroup' => 'addGroup.tpl')); 402 412 403 413 if (!$this->commons_loaded) 404 414 { … … 408 418 else 409 419 { 410 420 411 421 $template->set_var('cc_api', ''); 412 422 } 413 414 $template->set_var('ccAGFile', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/ccAddGroup.js'); 415 $template->set_var('ccAGWinHeightIE', '285'); 423 424 $template->set_var('ccAGFile', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/ccAddGroup.js'); 425 $template->set_var('ccAGWinHeightIE', '285'); 416 426 $template->set_var('ccAGWinHeightMO', '335'); 417 427 418 428 /* Images Dir */ 419 429 $template->set_var('ccAGCardImgRoot', $GLOBALS['phpgw_info']['server']['webserver_url'].'/contactcenter/templates/default/images/'); 420 430 421 431 /* Texts */ 422 432 $template->set_var('ccAGTitle', lang('Contact Center').' - '.lang('Group Add')); … … 424 434 $template->set_var('ccAGClear', lang('Reset')); 425 435 $template->set_var('ccAGCancel', lang('Cancel')); 426 $title = '<input type="text" id="title" name="title" value="'.$group['title'].'" size="50" maxlength="50"/>'; 427 428 $template->set_var('title', $title); 436 $title = '<input type="text" id="title" name="title" value="'.$group['title'].'" size="50" maxlength="50"/>'; 437 438 $template->set_var('title', $title); 429 439 // set content and label variables. 430 440 $template->set_var(array( 431 'msg_text' => lang($status), 432 'txt_title' => lang('Contact Group List'), 441 'msg_text' => lang($status), 442 'txt_title' => lang('Contact Group List'), 433 443 'txt_cancel'=> lang('cancel'), 434 'txt_add'=> lang('Add'), 444 'txt_add'=> lang('Add'), 435 445 'txt_rem'=> lang('Remove'), 436 446 'txt_personal_contacts' => lang('Personal Contacts'), 437 447 'txt_contacts_in_list' => lang("Participants"), 438 448 'txt_name' => lang('Full Name'))); 439 449 440 450 $template->parse('out_AG', 'addGroup'); 441 451 442 452 return $template->get_var('out_AG'); 443 453 }
Note: See TracChangeset
for help on using the changeset viewer.