Exemple #1
0
 function renderInput($context = array())
 {
     global $user, $prefs;
     $smarty = TikiLib::lib('smarty');
     $value = $this->getConfiguration('value');
     $autoassign = (int) $this->getOption('autoassign');
     if (empty($value) && $autoassign == 1 || $autoassign == 2) {
         // always use $user for last mod autoassign
         $value = $user;
     }
     if ($autoassign == 0 || $this->canChangeValue()) {
         $groupIds = $this->getOption('groupIds', '');
         if ($prefs['user_selector_realnames_tracker'] === 'y' && $this->getOption('showRealname')) {
             $smarty->loadPlugin('smarty_modifier_username');
             $name = smarty_modifier_username($value);
             $realnames = 'y';
         } else {
             $name = $value;
             $realnames = 'n';
         }
         $smarty->loadPlugin('smarty_function_user_selector');
         return smarty_function_user_selector(array('user' => $name, 'id' => 'user_selector_' . $this->getConfiguration('fieldId'), 'select' => $value, 'name' => $this->getConfiguration('ins_id'), 'editable' => 'y', 'allowNone' => 'y', 'groupIds' => $groupIds, 'realnames' => $realnames), $smarty);
     } else {
         if ($this->getOption('showRealname')) {
             $smarty->loadPlugin('smarty_modifier_username');
             $out = smarty_modifier_username($value);
         } else {
             $out = $value;
         }
         return $out . '<input type="hidden" name="' . $this->getInsertId() . '" value="' . $value . '">';
     }
 }
Exemple #2
0
 function renderInput($context = array())
 {
     global $tiki_p_admin_trackers, $user;
     $smarty = TikiLib::lib('smarty');
     $value = $this->getConfiguration('value');
     $autoassign = (int) $this->getOption('autoassign');
     if (empty($value) && $autoassign == 1 || $autoassign == 2) {
         // always use $user for last mod autoassign
         $value = $user;
     }
     if ($autoassign == 0 || $tiki_p_admin_trackers === 'y') {
         $groupIds = $this->getOption('groupIds', '');
         $smarty->loadPlugin('smarty_function_user_selector');
         return smarty_function_user_selector(array('user' => $value, 'id' => 'user_selector_' . $this->getConfiguration('fieldId'), 'select' => $value, 'name' => $this->getConfiguration('ins_id'), 'editable' => 'y', 'allowNone' => $this->getConfiguration('isMandatory') === 'y' ? 'n' : 'y', 'groupIds' => $groupIds), $smarty);
     } else {
         $smarty->loadPlugin('smarty_modifier_username');
         return smarty_modifier_username($value) . '<input type="hidden" name="' . $this->getInsertId() . '" value="' . $value . '">';
     }
 }