/**
  * 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
 }
Beispiel #2
0
echo label_tag(lang('attach existing contact'), 'contactFormExistingContact', false, array('class' => 'checkbox'));
?>
  </div>
  
  <div id="contactFormExistingContactControls">
    <fieldset>
      <legend><?php 
echo lang('select contact');
?>
</legend>
      <div>
        <?php 
echo text_field('contact[existing][text]', array_var($existing_contact_data, 'text', lang('description')));
?>
        <?php 
echo select_contact('contact[existing][rel_object_id]', null, $already_attached_contacts_ids, array('id' => 'contactFormSelectContact', 'class' => 'combobox'));
?>
        <input type="hidden" name="contact[existing][rel_object_manager]" value="Contacts"/>
      </div>
    </fieldset>
  </div>


  <div>
    <?php 
echo radio_field('contact[what]', array_var($contact_data, 'what', 'existing') == 'new', array('value' => 'new', 'id' => 'contactFormNewContact'));
?>
    <?php 
echo label_tag(lang('new contact'), 'contactFormNewContact', false, array('class' => 'checkbox'));
?>
  </div>