/**
  * 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
 }
Example #2
0
echo radio_field('attach[what]', array_var($attach_data, 'what') == 'existing_file', array('value' => 'existing_file', 'id' => 'attachFormExistingFile', 'onclick' => 'App.modules.attachToObjectForm.toggleAttachForms()'));
?>
 <label for="attachFormExistingFile" class="checkbox"><?php 
echo lang('attach existing file');
?>
</label>
  </div>
  
  <div id="attachFormExistingFileControls">
    <fieldset>
      <legend><?php 
echo lang('select file');
?>
</legend>
      <?php 
echo select_project_file('attach[file_id]', active_project(), array_var($attach_data, 'file_id'), $already_attached_file_ids, array('id' => 'attachFormSelectFile', 'style' => 'width: 300px'));
?>
    </fieldset>
  </div>
  
  <div>
    <?php 
echo radio_field('attach[what]', array_var($attach_data, 'what') != 'existing_file', array('value' => 'new_file', 'id' => 'attachFormNewFile', 'onclick' => 'App.modules.attachToObjectForm.toggleAttachForms()'));
?>
 <label for="attachFormNewFile" class="checkbox"><?php 
echo lang('upload and attach');
?>
</label>
  </div>
  
  <div id="attachFormNewFileControls">