📄 edit_company.inc
字号:
<?php/** * @copyright Intermesh 2003 * @author Merijn Schering <mschering@intermesh.nl> * @version $Revision: 1.20 $ $Date: 2006/04/10 13:21:11 $ * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ if (isset($feedback)){ $p = new html_element('p', $feedback); $p->set_attribute('class','Error'); $tabstrip->add_html_element($p);}$maintable = new table();$mainrow = new table_row();$table = new table();$row = new table_row();$row->add_cell(new table_cell($strName.'*:'));$input = new input('text','name',$company['name']);$input->set_attribute('style','width:280px');$input->set_attribute('maxlength','50');$row->add_cell(new table_cell($input->get_html()));$table->add_row($row);$row = new table_row();$row->add_cell(new table_cell($strPhone.':'));$input = new input('text','phone', $company['phone']);$input->set_attribute('style','width:280px');$input->set_attribute('maxlength','20');$row->add_cell(new table_cell($input->get_html()));$table->add_row($row);$row = new table_row();$row->add_cell(new table_cell($strFax.':'));$input = new input('text','fax', $company['fax']);$input->set_attribute('style','width:280px');$input->set_attribute('maxlength','20');$row->add_cell(new table_cell($input->get_html()));$table->add_row($row);$row = new table_row();$row->add_cell(new table_cell($strEmail.':'));$input = new input('text','email', $company['email']);$input->set_attribute('style','width:280px');$input->set_attribute('maxlength','75');$row->add_cell(new table_cell($input->get_html()));$table->add_row($row);$row = new table_row();$cell = new table_cell($strVisitAddress);$cell->set_attribute('colspan','2');$cell->set_attribute('style','font-weight:bold;text-align:center');$row->add_cell($cell);$table->add_row($row); $row = new table_row();$row->add_cell(new table_cell($strAddress.':'));$input = new input('text','address', $company['address']);$input->set_attribute('style','width:230px');$input->set_attribute('maxlength','100');$input1 = new input('text','address_no', $company['address_no']);$input1->set_attribute('style','width:47px');$input1->set_attribute('maxlength','10');$row->add_cell(new table_cell($input->get_html().$input1->get_html()));$table->add_row($row);$row = new table_row();$row->add_cell(new table_cell($strZip.':'));$input = new input('text','zip', $company['zip']);$input->set_attribute('style','width:280px');$input->set_attribute('maxlength','20');$row->add_cell(new table_cell($input->get_html()));$table->add_row($row);$row = new table_row();$row->add_cell(new table_cell($strCity.':'));$input = new input('text','city', $company['city']);$input->set_attribute('style','width:280px');$input->set_attribute('maxlength','50');$row->add_cell(new table_cell($input->get_html()));$table->add_row($row);$row = new table_row();$row->add_cell(new table_cell($strState.':'));$input = new input('text','state', $company['state']);$input->set_attribute('style','width:280px');$input->set_attribute('maxlength','30');$row->add_cell(new table_cell($input->get_html()));$table->add_row($row);$row = new table_row();$row->add_cell(new table_cell($strCountry.':'));$input = new input('text','country', $company['country']);$input->set_attribute('style','width:280px');$input->set_attribute('maxlength','30');$row->add_cell(new table_cell($input->get_html()));$table->add_row($row);$cell = new table_cell($table->get_html());$cell->set_attribute('valign','top');$mainrow->add_cell($cell);$table = new table();$row = new table_row();$cell = new table_cell($strPostAddress);$cell->set_attribute('colspan','2');$cell->set_attribute('style','font-weight:bold;text-align:center');$row->add_cell($cell);$table->add_row($row);$row = new table_row();$row->add_cell(new table_cell($strAddress.':'));$input = new input('text','post_address', $company['post_address'], false);$input->set_attribute('style','width:230px');$input->set_attribute('maxlength','100');$input1 = new input('text','post_address_no', $company['post_address_no'], false);$input1->set_attribute('style','width:47px');$input1->set_attribute('maxlength','10');$row->add_cell(new table_cell($input->get_html().$input1->get_html()));$table->add_row($row);$row = new table_row();$row->add_cell(new table_cell($strZip.':'));$input = new input('text','post_zip', $company['post_zip'], false);$input->set_attribute('style','width:280px');$input->set_attribute('maxlength','20');$row->add_cell(new table_cell($input->get_html()));$table->add_row($row);$row = new table_row();$row->add_cell(new table_cell($strCity.':'));$input = new input('text','post_city', $company['post_city'], false);$input->set_attribute('style','width:280px');$input->set_attribute('maxlength','50');$row->add_cell(new table_cell($input->get_html()));$table->add_row($row);$row = new table_row();$row->add_cell(new table_cell($strState.':'));$input = new input('text','post_state', $company['post_state'], false);$input->set_attribute('style','width:280px');$input->set_attribute('maxlength','30');$row->add_cell(new table_cell($input->get_html()));$table->add_row($row);$row = new table_row();$row->add_cell(new table_cell($strCountry.':'));$input = new input('text','post_country', $company['post_country'], false);$input->set_attribute('style','width:280px');$input->set_attribute('maxlength','30');$row->add_cell(new table_cell($input->get_html()));$table->add_row($row);$row = new table_row();$cell = new table_cell(' ');$cell->set_attribute('colspan','2');$row->add_cell($cell);$table->add_row($row); $row = new table_row();$row->add_cell(new table_cell($strHomepage.':'));$input = new input('text','homepage', $company['homepage']);$input->set_attribute('style','width:280px');$input->set_attribute('maxlength','100');$row->add_cell(new table_cell($input->get_html()));$table->add_row($row);$row = new table_row();$row->add_cell(new table_cell($ab_bank_no.':'));$input = new input('text','bank_no', $company['bank_no']);$input->set_attribute('style','width:280px');$input->set_attribute('maxlength','20');$row->add_cell(new table_cell($input->get_html()));$table->add_row($row);$row = new table_row();$row->add_cell(new table_cell($ab_vat_no.':'));$input = new input('text','vat_no', $company['vat_no']);$input->set_attribute('style','width:280px');$input->set_attribute('maxlength','40');$row->add_cell(new table_cell($input->get_html()));$table->add_row($row); $row = new table_row();$cell = new table_cell(' ');$cell->set_attribute('colspan','2');$row->add_cell($cell);$table->add_row($row);//get all writable user addressbooks and add them to a dropdownbox$ab->get_user_addressbooks($GO_SECURITY->user_id);$subscribed_addressbooks = new select('addressbook_id', $addressbook_id);while ($ab->next_record()){ if ($GO_SECURITY->has_permission($GO_SECURITY->user_id, $ab->f('acl_write'))) { //remember the first ab that is writable if(!isset($first_writable_ab)) { $first_writable_ab = $ab->f('id'); } $subscribed_addressbooks->add_value($ab->f('id'), $ab->f('name')); }}//get the given addressbook_idif ($addressbook_id > 0){ $addressbook = $ab->get_addressbook($addressbook_id);}//if there was no or a read only addressbook given then change to the first writableif (!isset($addressbook) || !$addressbook || !$GO_SECURITY->has_permission($GO_SECURITY->user_id, $addressbook['acl_write'])){ //there is no writable addressbook so add one if (!isset($first_writable_ab)) { $ab_name = $_SESSION['GO_SESSION']['name']; $new_ab_name = $ab_name; $x = 1; while($ab->get_addressbook_by_name($new_ab_name)) { $new_ab_name = $ab_name.' ('.$x.')'; $x++; } $addressbook_id = $ab->add_addressbook($GO_SECURITY->user_id, $new_ab_name); $subscribed_addressbooks->add_value($addressbook_id, $new_ab_name); }else { $company['addressbook_id'] = $first_writable_ab; }}$row = new table_row();$row->add_cell(new table_cell($ab_addressbook.':'));$row->add_cell(new table_cell($subscribed_addressbooks->get_html()));$table->add_row($row);$cell = new table_cell($table->get_html());$cell->set_attribute('valign','top');$mainrow->add_cell($cell);$maintable->add_row($mainrow);$tabstrip->add_html_element($maintable);$tabstrip->add_html_element(new button($cmdOk, "javascript:_save('save_company','true')"));$tabstrip->add_html_element(new button($cmdApply, "javascript:_save('save_company','false')"));if($company_id > 0){ $copy_text = htmlspecialchars(addslashes(address_format($company, "\n"))); $copy_text = str_replace("\n", '\n', $copy_text); $tabstrip->add_html_element(new button($cmdCopy, "javascript:copy_clip('".$copy_text."');"));}if($popup){ $tabstrip->add_html_element(new button($cmdClose, "javascript:window.close();"));}else{ $tabstrip->add_html_element(new button($cmdClose, "javascript:document.location='".$return_to."'"));}?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -