/** * Renders attachment control based on Object type * * @param void * @return string */ function renderControl($control_name) { switch ($this->getRelObjectManager()) { case 'Companies': return select_company($control_name, $this->getRelObjectId(), array('class' => 'combobox')); break; case 'Contacts': return select_contact($control_name, $this->getRelObjectId(), null, array('class' => 'combobox')); break; case 'ProjectFiles': return select_project_file($control_name, active_project(), $this->getRelObjectId(), null, array('class' => 'combobox')); break; case 'ProjectMessages': return select_message($control_name, active_project(), $this->getRelObjectId(), array('class' => 'combobox')); break; case 'ProjectMilestones': return select_milestone($control_name, active_project(), $this->getRelObjectId(), array('class' => 'combobox')); break; case 'ProjectTasks': break; case 'ProjectTaskLists': return select_task_list($control_name, active_project(), $this->getRelObjectId(), array('class' => 'combobox')); break; case 'ProjectTickets': return select_ticket($control_name, active_project(), $this->getRelObjectId(), array('class' => 'combobox')); break; default: return ''; break; } // switch }
echo text_field('user[username]', array_var($user_data, 'username'), array('id' => $genid . 'profileFormUsername', 'tabindex' => '2000')); ?> </div> <div class="formBlock"> <?php echo label_tag(lang('company'), $genid . 'userFormCompany', true); ?> <?php $attributes = array('id' => $genid . 'userFormCompany', 'tabindex' => '2100', 'onchange' => "var d = document.getElementById('" . $genid . "options'); var n = document.getElementById('" . $genid . "userFormIsAdminNo'); if (this.value == '1') { if (d) d.style.display = 'block'; if (n) n.checked = true; } else { if (d) d.style.display = 'none'; if(n) n.checked = false; }"); if ($user->getId() == 1) { $attributes['disabled'] = 'disabled'; } ?> <?php echo select_company('user[company_id]', array_var($user_data, 'company_id'), $attributes, false); ?> </div> <div class="formBlock"> <?php echo label_tag(lang('personal project'), $genid . 'userPersonalProject', true); ?> <div class="desc"><?php echo lang('personal project desc'); ?> </div> <?php echo select_project2('user[personal_project_id]', $user->getPersonalProjectId(), $genid, false, null, Projects::getActiveProjects()); ?> </div>
} else { if (adminOption) { radioNo = document.getElementById("userFormIsAdminNo"); radioYes = document.getElementById("userFormIsAdminYes"); radioNo.checked = "checked"; radioYes.checked = ""; adminOption.style.display = "none"; } } }; </script> <?php echo label_tag(lang('company'), $genid . 'userFormCompany', true); ?> <?php echo select_company('user[company_id]', array_var($user_data, 'company_id'), array('id' => $genid . 'userFormCompany', 'tabindex' => '300', 'onchange' => "og.validateOwnerCompany(this,'{$genid}')"), false, true); ?> <a href="<?php echo get_url("company", "add_client"); ?> " target="company" class="internalLink coViewAction ico-add" title="<?php echo lang('add a new company'); ?> "><?php echo lang('add company') . '...'; ?> </a> </div> <?php } else { ?>
<div class="content"> <div> <?php echo label_tag(lang('username'), 'profileFormUsername', true); ?> <?php echo text_field('user[username]', array_var($user_data, 'username'), array('id' => 'profileFormUsername')); ?> </div> <div> <?php echo label_tag(lang('company'), 'userFormCompany', true); ?> <?php echo select_company('user[company_id]', array_var($user_data, 'company_id'), array('id' => 'userFormCompany')); ?> </div> <?php if ($company->isOwner()) { ?> <fieldset> <legend><?php echo lang('options'); ?> </legend> <div> <?php echo label_tag(lang('is administrator'), null, true);
<div> <?php echo label_tag(lang('last name'), 'contactFormLastName', false) ?> <?php echo text_field('contact[last_name]', array_var($contact_data, 'last_name'), array('class' => 'medium', 'id' => 'contactFormLastName')) ?> </div> </fieldset> <?php if (logged_user()->isAdministrator()) { ?> <?php if (!$contact->isAdministrator()) { ?> <fieldset> <legend><?php echo label_tag(lang('company'), 'contactFormCompany', true) ?></legend> <div> <?php echo radio_field('contact[company][what]', array_var(array_var($contact_data, 'company'), 'what') != 'new', array('value' => 'existing', 'id'=>'contactFormExistingCompany')); ?> <?php echo label_tag(lang('existing company'), 'contactFormExistingCompany', false, array('class' => 'checkbox')) ?> </div> <div id="contactFormExistingCompanyControls"> <?php echo select_company('contact[company_id]', array_var($contact_data, 'company_id'), array('id' => 'contactFormCompany', 'class' => 'combobox')) ?> </div> <div> <?php echo radio_field('contact[company][what]', array_var(array_var($contact_data, 'company'), 'what') == 'new', array('value' => 'new', 'id'=>'contactFormNewCompany')); ?> <?php echo label_tag(lang('new company'), 'contactFormNewCompany', false, array('class'=>'checkbox'))?> </div> <div id="contactFormNewCompanyControls"> <?php echo label_tag(lang('company name'), 'contactFormNewCompanyName', true) ?> <?php echo text_field('contact[company][name]', null, array('id' => 'contactFormNewCompanyName')) ?> <?php echo label_tag(lang('timezone'), 'contactFormNewCompanyTimezone', true)?> <?php echo select_timezone_widget('contact[company][timezone]', owner_company()->getTimezone(), array('id' => 'contactFormNewCompanyTimezone', 'class' => 'long combobox')) ?> </div> </fieldset> <?php } else { ?>
add_contact_work"> <fieldset><legend><?php echo lang('work'); ?> </legend> <div style="margin-left:12px;margin-right:12px;"> <div> <?php echo label_tag(lang('company'), $genid . 'profileFormCompany'); ?> <div id="<?php echo $genid; ?> existing_company"><?php echo select_company('contact[company_id]', array_var($contact_data, 'company_id'), array('id' => $genid . 'profileFormCompany', "class" => "og-edit-contact-select-company", 'tabindex' => '5', 'onchange' => 'og.companySelectedIndexChanged(\'' . $genid . '\')')); ?> <a href="#" class="coViewAction ico-add" title="<?php echo lang('add a new company'); ?> " onclick="og.addNewCompany('<?php echo $genid; ?> ')"><?php echo lang('add company') . '...'; ?> </a></div> <div id="<?php echo $genid; ?> new_company" style="display:none; padding:6px; margin-top:6px;margin-bottom:6px; background-color:#EEE">
<div class="desc"><?php echo lang('email address'); ?> </div> <?php echo autocomplete_emailfield('share_data[emails]', '', $allEmails, '', array('class' => 'title', 'id' => $genid . 'shareWithEmails', 'style' => 'width:370px;', 'tabindex' => '360', 'onblur' => 'og.onBlurSetComp()'), false); ?> </td><td style="padding:5px;"> <div class="desc"><?php echo lang('company'); ?> </div> <?php //echo autocomplete_emailfield('share_data[companies]', '', $allCompanies, '', echo select_company('share_data[companies]', null, array('class' => 'title', 'id' => $genid . 'shareCompanies', 'style' => 'width:150px;', 'tabindex' => '380', 'onblur' => 'og.onBlurSetComp();'), true); ?> </td><td style="padding:5px;vertical-align:bottom;"> <?php echo button(lang('add'), 'A', array('style' => 'margin-top:0px;margin-left:10px', 'id' => $genid . 'addPeople', 'tabindex' => '400', 'onclick' => 'if(og.validateCompany()) og.onAddPeopleToShare();')); ?> </td></tr></table> <br> <div class="desc"><?php echo lang('allow people edit object'); ?> </div> <?php
}); </script> <div id = "<?php echo $genid; ?> " class="access-data"> <div class="field role"> <label><?php echo lang("company"); ?> :</label> <?php echo select_company('contact[user][company_id]', owner_company()->getId(), array('style' => 'width:400px;')); ?> </div> <div class="field role" style="margin-top: 10px; min-height:25px;"> <label class="checkbox" ><?php echo lang("will this person use feng office?"); ?> </label><input class="checkbox" type="checkbox" name="contact[user][create-user]" checked ></input> </div> <div class="user-data" style="margin-bottom: 10px;"> <div class="field role"> <label><?php echo lang("user type"); ?> :</label> <?php