company.php

来自「groupoffice」· PHP 代码 · 共 605 行 · 第 1/2 页

PHP
605
字号
if(isset($ignore)){	$form->add_html_element(new input('hidden','ignore','true'));}$form->add_html_element(new input('hidden','task','',false));$form->add_html_element(new input('hidden','close','false'));$form->add_html_element(new input('hidden','return_to',$return_to));$form->add_html_element(new input('hidden','link_back',$link_back));$form->add_html_element(new input('hidden','company_id',$company_id, false));$form->add_html_element(new input('hidden','goto_url','', false));if ($popup) {	$form->add_html_element(new input('hidden','popup','true'));}if ($company_id == 0 || $task == 'save_company') {	$company['name'] = isset ($_REQUEST['name']) ? smart_stripslashes($_REQUEST['name']) : '';	$company['address'] = isset ($_REQUEST['address']) ? smart_stripslashes($_REQUEST['address']) : '';	$company['address_no'] = isset ($_REQUEST['address_no']) ? smart_stripslashes($_REQUEST['address_no']) : '';	$company['zip'] = isset ($_REQUEST['zip']) ? smart_stripslashes($_REQUEST['zip']) : '';	$company['city'] = isset ($_REQUEST['city']) ? smart_stripslashes($_REQUEST['city']) : '';	if ($company['zip'] != '' && $company['address'] == '' && $company['city'] == '' && $addressinfo = $ab->get_addressinfo($company['zip'])) {		$company['address'] = $addressinfo['street'];		$company['city'] = $addressinfo['city'];	}	$company['state'] = isset ($_REQUEST['state']) ? smart_stripslashes($_REQUEST['state']) : '';	$company['country'] = isset ($_REQUEST['country']) ? smart_stripslashes($_REQUEST['country']) : '';	$company['post_address'] = 		(isset ($_REQUEST['post_address'])  && !empty($_REQUEST['post_address'])) ? 		smart_stripslashes($_REQUEST['post_address']) : $company['address'];			$company['post_address_no'] = 		(isset($_REQUEST['post_address_no']) && !empty($_REQUEST['post_address_no'])) ? 		smart_stripslashes($_REQUEST['post_address_no']) :  $company['address_no'];			$company['post_zip'] = 		(isset ($_REQUEST['post_zip']) && !empty($_REQUEST['post_zip'])) 		 ? smart_stripslashes($_REQUEST['post_zip']) : $company['zip'];		 	$company['post_city'] = 		(isset ($_REQUEST['post_city']) && !empty($_REQUEST['post_city']))			 ? smart_stripslashes($_REQUEST['post_city']) : $company['city'];	if ($company['post_zip'] != '' && $company['post_address'] == '' && $company['post_city'] == '' && $addressinfo = $ab->get_addressinfo($company['post_zip'])) {		$company['post_address'] = $addressinfo['street'];		$company['post_city'] = $addressinfo['city'];	}		$company['post_state'] = 		( isset ($_REQUEST['post_state']) && !empty($_REQUEST['post_state']))		 ? smart_stripslashes($_REQUEST['post_state']) : $company['state'];		 	$company['post_country'] = 		(isset($_REQUEST['post_country']) && !empty($_REQUEST['post_country']))	 ? smart_stripslashes($_REQUEST['post_country']) : $company['country'];		$company['email'] = isset ($_REQUEST['email']) ? smart_stripslashes($_REQUEST['email']) : '';		$company['phone'] = isset ($_REQUEST['phone']) ? smart_stripslashes($_REQUEST['phone']) : '';	$company['fax'] = isset ($_REQUEST['fax']) ? smart_stripslashes($_REQUEST['fax']) : '';	$company['homepage'] = isset ($_REQUEST['homepage']) ? smart_stripslashes($_REQUEST['homepage']) : '';	$company['bank_no'] = isset ($_REQUEST['bank_no']) ? smart_stripslashes($_REQUEST['bank_no']) : '';	$company['vat_no'] = isset ($_REQUEST['vat_no']) ? smart_stripslashes($_REQUEST['vat_no']) : '';}$GO_HEADER['head'] = '';if ($company_id > 0) {			$menu = new button_menu();					if ($company['email'] != '') 	{		$full_email = '"'.$company['name'].'" <'.$company['email'].'>';					$menu->add_button('ab_email', $ab_send_message, get_mail_to_href(addslashes($full_email), 0, $company_id));						if (isset ($GO_MODULES->modules['email']) && $GO_MODULES->modules['email']['read_permission']) {				$menu->add_button('ml_search', $ab_search_sender, 					$GO_MODULES->modules['email']['url'].'index.php?task=set_search_query&from='.$company['email'].'&return_to='.urlencode($link_back));			}	}		if ($templates_plugin) 	{		if ($tp->has_oo_templates($GO_SECURITY->user_id)) 		{			$menu->add_button('new_letter', $ab_oo_doc, 				"javascript:popup('".$GO_MODULES->url.'templates/download_oo_template.php?company_id='.$company_id."','','');");			}		if ($company['email'] != '' && $tp->get_mailing_groups($GO_SECURITY->user_id) && $write_permission) 		{			$tabstrip->add_tab('mailings', $ab_mailings);		}	}	$todos_module = isset ($GO_MODULES->modules['todos']) ? $GO_MODULES->modules['todos'] : false;	$projects_module = isset ($GO_MODULES->modules['projects']) ? $GO_MODULES->modules['projects'] : false;	$notes_module = isset ($GO_MODULES->modules['notes']) ? $GO_MODULES->modules['notes'] : false;	$calendar_module = isset ($GO_MODULES->modules['calendar']) ? $GO_MODULES->modules['calendar'] : false;	$projects_module = isset ($GO_MODULES->modules['projects']) ? $GO_MODULES->modules['projects'] : false;	$notes_module = isset ($GO_MODULES->modules['notes']) ? $GO_MODULES->modules['notes'] : false;	$calendar_module = isset ($GO_MODULES->modules['calendar']) ? $GO_MODULES->modules['calendar'] : false;	$todos_module = isset ($GO_MODULES->modules['todos']) ? $GO_MODULES->modules['todos'] : false;	if ($write_permission) 	{		if ($projects_module && $projects_module['read_permission']) 		{						$menu->add_button('pr_new_project', $strNewProject, 				'javascript:activate_linking(\''.$projects_module['url'].'project.php?company_id='.$company_id.'&return_to='.rawurlencode($link_back).'\');');					}		if ($notes_module && $notes_module['read_permission']) 		{			$menu->add_button('ab_notes', $strNewNote, 				'javascript:activate_linking(\''.$notes_module['url'].'note.php?company_id='.$company_id.'&return_to='.rawurlencode($link_back).'\');');					}		if ($calendar_module && $calendar_module['read_permission']) 		{			$menu->add_button('cal_compose', $strNewEvent, 				'javascript:activate_linking(\''.$calendar_module['url'].'index.php?company_id='.$company_id.'&link_back='.rawurlencode($link_back).'\');');					if ($todos_module && $todos_module['read_permission']) 			{				$menu->add_button(					'todos_new', 					$strNewTodo,					'javascript:activate_linking(\''.$GO_MODULES->modules['calendar']['url'].						'event.php?todo=1&company_id='.$company_id.'&return_to='.rawurlencode($link_back).'\');'				);				}		}				if (isset($GO_MODULES->modules['filesystem']) && 			$GO_MODULES->modules['filesystem']['read_permission']) {				$menu->add_button(					'upload', 					$strUpload, 					'javascript:activate_linking(\''.$GO_MODULES->modules['filesystem']['url'].						'?return_to='.rawurlencode($link_back).'\');'					);		}				$tabstrip->add_tab('links', $strLinks);				if($GO_LINKS->get_active_link())		{			$menu->add_button('link', $strCreateLink, "javascript:document.company_form.task.value='create_link';document.company_form.submit();");		}else		{			$menu->add_button('link', $strCreateLink, "javascript:document.company_form.task.value='activate_linking';document.company_form.submit();");		}				if($tabstrip->get_active_tab_id() == 'links')		{			$links_list = new links_list($company['link_id'], 'company_form', $link_back);			$GO_HEADER['head'] .= $links_list->get_header();			$menu->add_button(				'unlink', 				$cmdUnlink, 				$links_list->get_unlink_handler());											$menu->add_button(				'delete_big', 				$cmdDelete, 				$links_list->get_delete_handler());		}					}	if($tabstrip->get_active_tab_id() == 'contacts')	{		$datatable = new datatable('contacts_table', false, 'company_form');		$datatable->set_attribute('style','width:100%');				if($datatable->task == 'delete')		{			foreach($datatable->selected as $contact_id)			{				$contact['id'] = $contact_id;				$contact['company_id'] = 0;				$ab->update_contact($contact);			}		}				$empl_menu = new button_menu();		if ($write_permission) 		{				$empl_menu->add_button('add_contact', 	$ab_add_new, 				$GO_MODULES->url.'contact.php?company_id='.$company_id.				'&addressbook_id='.$addressbook_id.'&return_to='.				rawurlencode($link_back));								$empl_menu->add_button('addressbook', 	$ab_add_existing, 				$ab->select_contacts('', $GO_MODULES->url.					'add_employees.php?company_id='.$company_id, 'true', 'false', 'false', 'true', 'false', 'id'));								$empl_menu->add_button('delete_big', 	$cmdDelete, 				$datatable->get_delete_handler());		}				$form->add_html_element($empl_menu);	}else	{		$form->add_html_element($menu);	}}if($tabstrip->get_active_tab_id() == 'profile' || $tabstrip->get_active_tab_id() == ''){	$GO_HEADER['body_arguments'] = 'onload="document.company_form.name.focus();"';}$overlib = new overlib();$GO_HEADER['head'] .= $overlib->get_header();require_once ($GO_THEME->theme_path."header.inc");if ($tabstrip->get_active_tab_id() > 0) {	$catagory_id = $tabstrip->get_active_tab_id();	$active_tab_id = 'custom_fields';} else {	$active_tab_id = $tabstrip->get_active_tab_id();}switch ($active_tab_id) {	case 'mailings' :		require_once ($templates_plugin['path'].'mailing_groups.inc');		break;	case 'custom_fields' :			$form->add_html_element(new input('hidden', 'link_id', $company['link_id']));			if($cf_table = $cf->get_fields_table($tabstrip->get_active_tab_id(), $company['link_id']))			{				$tabstrip->add_html_element($cf_table);								if ($write_permission) {					$tabstrip->add_html_element(new button($cmdOk, "javascript:_save('save_custom_fields', 'true');"));					$tabstrip->add_html_element(new button($cmdApply, "javascript:_save('save_custom_fields', 'false')"));								}						}			$tabstrip->add_html_element(new button($cmdClose, "javascript:document.location='".$return_to."';"));		break;	case 'contacts' :		echo $ab->enable_contact_selector();		require_once ('company_contacts.inc');		break;	case 'links' :		$tabstrip->add_html_element($links_list);		break;	default :		if ($vcard_count > 0 && $company_id == 0) {			if ($record = $vcard->get_vcard_contact(0)) {				$company = $record['company'];				$company['addressbook_id'] = $addressbook_id;			}		}		if ($write_permission) {			require_once ('edit_company.inc');		} else {			require_once ('show_company.inc');		}		break;}$form->add_html_element($tabstrip);echo $form->get_html();?><script type="text/javascript">function _save(task, close){	document.company_form.task.value = task;	document.company_form.close.value = close;	document.company_form.submit();}function activate_linking(goto_url){	document.company_form.goto_url.value=goto_url;	document.company_form.task.value='activate_linking';	document.company_form.submit();}</script><?phprequire_once ($GO_THEME->theme_path."footer.inc");?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?