/**
  * Render form control
  *
  * @param string $control_name
  * @return string
  */
 function render($control_name)
 {
     $status = array();
     $config_opt = $this->getConfigOption();
     $config_opt_name = $config_opt->getName();
     if ($config_opt_name == "default_customer_status_value") {
         $status = array(array(0, "-"));
         foreach (CustomerStatusManager::instance()->findAll() as $status_obj) {
             $text = lang($status_obj->getName());
             $value = $status_obj->getId();
             $status[] = array($value, $text);
         }
     }
     if ($config_opt_name == "default_project_status_value") {
         $status = array();
         for ($i = 1; $i <= 7; $i++) {
             $status[] = array($i, lang('project_field_status' . $i));
         }
     }
     return simple_select_box($control_name, $status, $this->getRawValue());
 }
Esempio n. 2
0
    echo lang('personal project desc');
    ?>
</div>
        <?php 
    echo select_project2('user[personal_project_id]', $user->getPersonalProjectId(), $genid, false, null, Projects::getActiveProjects());
    ?>
      </div>
      

	  <!-- user type -->
	  <div class="formBlock">
	    <?php 
    echo label_tag(lang('user type'), null, true);
    ?>
	    <?php 
    echo simple_select_box('user[type]', array(array('admin', lang('admin user')), array('normal', lang('normal user')), array('guest', lang('guest user'))), array_var($user_data, 'type', 'normal'));
    ?>
	  </div>

	<input type="hidden" name="user[auto_assign]" value="0" />
    </div>
    
    </fieldset>
  </div>
<?php 
} else {
    ?>
  <div>
    <?php 
    echo label_tag(lang('username'));
    ?>
Esempio n. 3
0
			  }
		  }
	  }
	  /*Ext.get(genid + 'div_can_edit_company_data').setDisplayed(type != 'collab');
	  Ext.get(genid + 'div_can_manage_security').setDisplayed(type != 'collab');
	  Ext.get(genid + 'div_can_manage_workspaces').setDisplayed(type != 'collab');*/
	  
  };
  </script>
  <!-- user type -->
  <div>
    <?php 
echo label_tag(lang('user type'), null, true);
?>
  	<?php 
echo simple_select_box('user[type]', array(array('admin', lang('admin user')), array('normal', lang('normal user')), array('guest', lang('guest user'))), array_var($user_data, 'type', 'normal'), array('onchange' => "og.addUserTypeChange('{$genid}', this.value)"));
?>
  </div>
  
	  <?php 
$categories = array();
Hook::fire('object_add_categories', $object, $categories);
?>
	  <?php 
$cps = CustomProperties::countHiddenCustomPropertiesByObjectType('Users');
?>
	  	
	  <div style="padding-top:5px"> 
		<a href="#" class="option" onclick="og.toggleAndBolden('<?php 
echo $genid;
?>
Esempio n. 4
0
	  }
	  for(f=0; f< og.tabs_allowed[type].length;f++){
		  $('#'+genid+og.tabs_allowed[type][f]+' :input').attr('checked', true);
	  }
  };
  </script>
  <!-- user type -->
  <div>
    <?php
    echo label_tag(lang('user type'), null, true);
    $permission_groups=array();
    foreach($groups as $group){
    	$permission_groups[] = array($group->getId(), lang($group->getName()));
    }
    
    echo simple_select_box('user[type]', $permission_groups, null, array('onchange' => "og.addUserTypeChange('$genid', this.value)", 'tabindex' => "300")); 
  	?>
  </div>
  
	  <?php $categories = array(); Hook::fire('object_add_categories', $object, $categories); ?>
	  <?php $cps = CustomProperties::countHiddenCustomPropertiesByObjectType(Contacts::getObjectTypeId()); ?>
	  	
	  <div style="padding-top:5px">
		<a href="#" class="option" onclick="og.toggleAndBolden('<?php echo $genid ?>add_user_advanced', this)"><?php echo lang('advanced') ?></a> - 
		<a href="#" class="option" onclick="og.toggleAndBolden('<?php echo $genid ?>add_user_permissions', this)"><?php echo lang('permissions') ?></a>
		<?php if ($cps > 0) { ?>
			- <a href="#" class="option <?php echo $visible_cps>0 ? 'bold' : ''?>" onclick="og.toggleAndBolden('<?php echo $genid ?>add_custom_properties_div',this)"><?php echo lang('custom properties') ?></a>
		<?php } ?>
		<?php foreach ($categories as $category) { ?>
			- <a href="#" class="option" onclick="og.toggleAndBolden('<?php echo $genid . $category['name'] ?>', this)"><?php echo lang($category['name'])?></a>
		<?php } ?>
Esempio n. 5
0
</label><input class="checkbox" type="checkbox" name="contact[user][create-password]" id="create-password" ></input>
            <div class="clear"></div>
            <div class="user-data-password" style="display: none;">
                <div class="field password">
                        <label><?php 
echo lang("password");
?>
:</label><input name="contact[user][password]" type="password"></input>
                </div>
                <div class="field repeat">
                        <label><?php 
echo lang("password again");
?>
:</label><input type="password" name="contact[user][password_a]"></input>
                </div>
            </div>          
            <div class="clear"></div>
            <div class="field role">
                    <label><?php 
echo lang("user type");
?>
:</label>
                            <?php 
echo simple_select_box('contact[user][type]', $permission_groups, 4);
?>
            </div>
    </div>	
</div>


Esempio n. 6
0
</script>
  
<div>
<?php
	$actual_user_type = PermissionGroups::instance()->findOne(array("conditions" => "id = ".$user->getUserType()));
	$can_change_type = false;
	$permission_groups = array();
	foreach($groups as $group){
		$permission_groups[] = array($group->getId(), lang($group->getName()));
		if ($group->getId() == $actual_user_type->getId()) $can_change_type = true;
	}

	if ($can_change_type) {
		echo label_tag(lang('user type'), null, true);
		echo simple_select_box('user[type]', $permission_groups, $actual_user_type->getId(), array(
			'onchange' => "og.addUpdatePermissionsUserTypeChange('$genid', this.value)",
			'tabindex' => "300"
		));
	}
	foreach ($guest_groups as $gg) {
  		if ($actual_user_type->getId() == $gg->getId()) echo '<script>og.showHideNonGuestPermissionOptions(true);</script>';
  	}
?>
</div>

<?php
tpl_assign('genid', $genid);
//tpl_assign('disable_sysperm_inputs', true);
$this->includeTemplate(get_template_path('system_permissions', 'account'));

echo submit_button(lang('update permissions'));
?>
Esempio n. 7
0
/**
 * 
 * @author Ignacio Vazquez - elpepe.uy@gmail.com
 * @param unknown_type $table
 * @param unknown_type $column
 * @param unknown_type $name
 * @param unknown_type $selected
 * @param unknown_type $attributes
 */
function enum_select_box($manager, $column, $name, $selected = null, $attributes = null)
{
    eval('$table = ' . $manager . '::instance()->getTableName ();');
    if ($table && $column) {
        $values = get_enum_values($table, $column);
        $option_values = array(array("", "--"));
        foreach ($values as $value) {
            if ($value) {
                $option_values[] = array($value, lang($value));
            }
        }
        return simple_select_box($name, $option_values, $selected, $attributes);
    }
}
Esempio n. 8
0
		
			<div class="field name">
				<label class="label"><?php 
    echo lang("add task");
    ?>
</label>
				<input type="text" class="task-name" maxlength='255'  />
			</div>

			<div class="field assigned ">
				<label><?php 
    echo lang('assigned to');
    ?>
:</label>
				<?php 
    echo simple_select_box('task[assigned_to_contact_id]', $users, null, array('class' => 'assigned-to'));
    ?>
				
			</div>
			
			
			<div class="field due">
				<label><?php 
    echo lang('due date');
    ?>
:</label>
				<?php 
    echo pick_date_widget2('task[task_due_date]', null, $genid, 70, false, $genid . 'due_date');
    ?>
			</div>
			
?>
</label>
		<input style="float: left;" class="checkbox" type="checkbox" name="contact[user][create-user]" checked id="<?php 
echo $genid;
?>
contact[user][create-user]"></input>
	</div>
	<div class="clear"></div>
	<div class="user-data" style="margin-bottom: 10px;">
		<div class="field role">
			<label><?php 
echo lang("user type");
?>
</label>
			<div><?php 
echo simple_select_box('contact[user][type]', $permission_groups, 4, array('style' => 'max-width:300px;margin-left:0;'));
?>
</div>
		</div>
	</div>
</div>

<script>
$( "#add-person-form-show" ).one( "click", function() {
	og.load_company_combo("<?php 
echo $genid;
?>
company-combo", '<?php 
echo owner_company()->getId();
?>
');
Esempio n. 10
0
    echo label_tag(lang('username'), $genid . 'profileFormUsername', true);
    ?>
	      <?php 
    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('user type'), null, true);
    $permission_groups = array();
    foreach ($groups as $group) {
        $permission_groups[] = array($group->getId(), $group->getName());
    }
    echo simple_select_box('user[type]', $permission_groups, array_var($user_data, "type"));
    ?>
		</div>
	<?php 
} else {
    ?>
		<div>
		  <?php 
    echo label_tag(lang('username'));
    ?>
		  <?php 
    echo clean(array_var($user_data, 'username'));
    ?>
		  <input type="hidden" name="user[username]" value="<?php 
    echo clean(array_var($user_data, 'username'));
    ?>
Esempio n. 11
0
			<input class="checkbox" type="checkbox" name="notify-user" <?php if(user_config_option("sendEmailNotification",1,logged_user()->getId())){echo "checked";}?> id="notify-user"></input>
	
		<div class="clear"></div>
		<label class="checkbox" ><?php echo lang("specify password?") ?></label><input class="checkbox" type="checkbox" name="contact[user][create-password]" id="create-password"  <?php if(!user_config_option("sendEmailNotification",1,logged_user()->getId())){echo "disabled";}?>></input>
		<div class="clear"></div>
		<div class="user-data-password" style="display:<?php if(user_config_option("sendEmailNotification",1,logged_user()->getId())){echo "none";}?>;">
			<div class="field password">
				<label><?php echo lang("password")?>:</label><input name="contact[user][password]" type="password"></input>
			</div>
			<div class="field repeat">
				<label><?php echo lang("password again")?>:</label><input type="password" name="contact[user][password_a]"></input>
			</div>
		</div>          
		<div class="clear"></div>
		<div class="field role">
			<label><?php echo lang("user type")?>:</label><?php  echo simple_select_box('contact[user][type]', $permission_groups,4)?>
		</div>
	<?php if(isset($new_contact) && $new_contact){?>
		<div class="field role" style="margin-top:8px;">
			<label class="checkbox"><?php echo lang("specify username?")?></label>
			<input class="checkbox" type="checkbox" name="contact[specify_username]" id="<?php echo $genid ?>specify-username"/>
			<input id="<?php echo $genid ?>profileFormUsername" type="text" value="<?php echo array_var($contact_data, 'username')?>" name="contact[user][username]" maxlength="50" style="display: none; margin-left:5px;"/>
		</div>
		
			
	<?php }?>
	</div>	
</div>

<div class="clear"></div>