当前位置: 首页>>代码示例>>PHP>>正文


PHP Users::getChoices方法代码示例

本文整理汇总了PHP中Users::getChoices方法的典型用法代码示例。如果您正苦于以下问题:PHP Users::getChoices方法的具体用法?PHP Users::getChoices怎么用?PHP Users::getChoices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Users的用法示例。


在下文中一共展示了Users::getChoices方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: configure

 public function configure()
 {
     $this->widgetSchema['users_id'] = new sfWidgetFormChoice(array('choices' => Users::getChoices(array(), 'tickets')), array('class' => 'required'));
     $this->widgetSchema['sort_order'] = new sfWidgetFormInput(array(), array('size' => 3));
     $this->widgetSchema['active'] = new sfWidgetFormInputCheckbox(array(), array('value' => 1));
     $this->setDefault('active', 1);
     $this->widgetSchema->setLabels(array('users_id' => 'Assigned To', 'sort_order' => 'Sort Order'));
 }
开发者ID:noikiy,项目名称:qdpm,代码行数:8,代码来源:DepartmentsForm.class.php

示例2: executeTeam

 public function executeTeam()
 {
     if ($this->project->isNew()) {
         $this->in_team = array();
         $this->in_role = array();
     } else {
         $this->in_team = explode(',', $this->project->getTeam());
         $this->project_id = $this->project->getId();
     }
     $this->users_list = Users::getChoices();
 }
开发者ID:noikiy,项目名称:qdpm,代码行数:11,代码来源:components.class.php

示例3: configure

 public function configure()
 {
     $projects = $this->getOption('projects');
     $sf_user = $this->getOption('sf_user');
     $this->widgetSchema['discussions_status_id'] = new sfWidgetFormChoice(array('choices' => app::getItemsChoicesByTable('DiscussionsStatus')));
     $this->setDefault('discussions_status_id', app::getDefaultValueByTable('DiscussionsStatus'));
     $this->widgetSchema['assigned_to'] = new sfWidgetFormChoice(array('choices' => Users::getChoices(array_merge(array($sf_user->getAttribute('id')), array_filter(explode(',', $projects->getTeam()))), 'discussions'), 'expanded' => true, 'multiple' => true));
     if (Users::hasAccess('edit', 'projects', $sf_user, $projects->getId())) {
         $this->widgetSchema['users_id'] = new sfWidgetFormChoice(array('choices' => Users::getChoices(array_merge(array($sf_user->getAttribute('id')), array_filter(explode(',', $projects->getTeam()))), 'discussions_insert')));
     } else {
         $this->widgetSchema['users_id'] = new sfWidgetFormInputHidden();
     }
     $this->widgetSchema['name']->setAttributes(array('size' => '60', 'class' => 'required'));
     $this->widgetSchema['description']->setAttributes(array('class' => 'editor'));
     $this->widgetSchema['projects_id'] = new sfWidgetFormInputHidden();
     $this->widgetSchema->setLabels(array('discussions_status_id' => 'Status', 'assigned_to' => 'Assigned To', 'users_id' => 'Created By'));
 }
开发者ID:noikiy,项目名称:qdpm,代码行数:17,代码来源:DiscussionsForm.class.php

示例4: configure

 public function configure()
 {
     $projects = $this->getOption('projects');
     $sf_user = $this->getOption('sf_user');
     $this->widgetSchema['tasks_status_id'] = new sfWidgetFormChoice(array('choices' => app::getItemsChoicesByTable('TasksStatus')));
     $this->setDefault('tasks_status_id', app::getDefaultValueByTable('TasksStatus'));
     $this->widgetSchema['tasks_priority_id'] = new sfWidgetFormChoice(array('choices' => app::getItemsChoicesByTable('TasksPriority')));
     $this->setDefault('tasks_priority_id', app::getDefaultValueByTable('TasksPriority'));
     $this->widgetSchema['tasks_type_id'] = new sfWidgetFormChoice(array('choices' => app::getItemsChoicesByTable('TasksTypes')));
     $this->setDefault('tasks_type_id', app::getDefaultValueByTable('TasksTypes'));
     $this->widgetSchema['tasks_label_id'] = new sfWidgetFormChoice(array('choices' => app::getItemsChoicesByTable('TasksLabels')));
     $this->setDefault('tasks_label_id', app::getDefaultValueByTable('TasksLabels'));
     $this->widgetSchema['tasks_groups_id'] = new sfWidgetFormChoice(array('choices' => app::getItemsChoicesByTable('TasksGroups', true, $projects->getId())));
     $this->widgetSchema['projects_phases_id'] = new sfWidgetFormChoice(array('choices' => app::getItemsChoicesByTable('ProjectsPhases', true, $projects->getId())));
     $this->widgetSchema['versions_id'] = new sfWidgetFormChoice(array('choices' => app::getItemsChoicesByTable('Versions', true, $projects->getId())));
     $this->widgetSchema['progress'] = new sfWidgetFormChoice(array('choices' => Tasks::getProgressChoices()));
     $this->widgetSchema['assigned_to'] = new sfWidgetFormChoice(array('choices' => Users::getChoices(array_merge(array($sf_user->getAttribute('id')), array_filter(explode(',', $projects->getTeam()))), 'tasks'), 'expanded' => true, 'multiple' => true));
     if (Users::hasAccess('edit', 'projects', $sf_user, $projects->getId())) {
         $this->widgetSchema['created_by'] = new sfWidgetFormChoice(array('choices' => Users::getChoices(array_merge(array($sf_user->getAttribute('id')), array_filter(explode(',', $projects->getTeam()))), 'tasks_insert')));
     } else {
         $this->widgetSchema['created_by'] = new sfWidgetFormInputHidden();
     }
     $this->widgetSchema['name']->setAttributes(array('size' => '60', 'class' => 'required'));
     $this->widgetSchema['description']->setAttributes(array('class' => 'editor'));
     $this->widgetSchema['estimated_time']->setAttributes(array('size' => '4'));
     $this->widgetSchema['start_date'] = new sfWidgetFormInput(array(), array('class' => 'datetimepicker'));
     $this->widgetSchema['due_date'] = new sfWidgetFormInput(array(), array('class' => 'datetimepicker'));
     $this->widgetSchema['projects_id'] = new sfWidgetFormInputHidden();
     $this->widgetSchema['closed_date'] = new sfWidgetFormInputHidden();
     $this->widgetSchema['created_at'] = new sfWidgetFormInputHidden();
     $this->setDefault('created_at', date('Y-m-d H:i:s'));
     $this->widgetSchema->setLabels(array('tasks_priority_id' => 'Priority', 'tasks_type_id' => 'Type', 'tasks_label_id' => 'Label', 'projects_phases_id' => 'Phase', 'versions_id' => 'Version', 'tasks_groups_id' => 'Group', 'tasks_status_id' => 'Status', 'estimated_time' => 'Estimated Time', 'start_date' => 'Start Date', 'due_date' => 'Due Date', 'created_by' => 'Created By'));
     unset($this->widgetSchema['discussion_id']);
     unset($this->widgetSchema['tickets_id']);
     unset($this->widgetSchema['work_hours']);
     unset($this->validatorSchema['discussion_id']);
     unset($this->validatorSchema['tickets_id']);
     unset($this->validatorSchema['work_hours']);
 }
开发者ID:noikiy,项目名称:qdpm,代码行数:39,代码来源:TasksForm.class.php

示例5: configure

 public function configure()
 {
     $projects = $this->getOption('projects');
     $sf_user = $this->getOption('sf_user');
     $this->widgetSchema['departments_id'] = new sfWidgetFormChoice(array('choices' => app::getItemsChoicesByTable('Departments')), array('class' => 'required'));
     $this->widgetSchema['tickets_status_id'] = new sfWidgetFormChoice(array('choices' => app::getItemsChoicesByTable('TicketsStatus')));
     $this->setDefault('tickets_status_id', app::getDefaultValueByTable('TicketsStatus'));
     $this->widgetSchema['tickets_types_id'] = new sfWidgetFormChoice(array('choices' => app::getItemsChoicesByTable('TicketsTypes')));
     $this->setDefault('tickets_types_id', app::getDefaultValueByTable('TicketsTypes'));
     if ($projects) {
         if (Users::hasAccess('edit', 'projects', $sf_user, $projects->getId())) {
             $this->widgetSchema['users_id'] = new sfWidgetFormChoice(array('choices' => Users::getChoices(array_merge(array($sf_user->getAttribute('id')), array_filter(explode(',', $projects->getTeam()))), 'tickets_insert')));
         } else {
             $this->widgetSchema['users_id'] = new sfWidgetFormInputHidden();
         }
     }
     $this->widgetSchema['name']->setAttributes(array('size' => '60', 'class' => 'required'));
     $this->widgetSchema['description']->setAttributes(array('class' => 'editor'));
     $this->widgetSchema['projects_id'] = new sfWidgetFormInputHidden();
     $this->widgetSchema['created_at'] = new sfWidgetFormInputHidden();
     $this->setDefault('created_at', date('Y-m-d H:i:s'));
     $this->widgetSchema->setLabels(array('tickets_types_id' => 'Type', 'tickets_status_id' => 'Status', 'departments_id' => 'Department', 'name' => 'Subject', 'users_id' => 'Created By'));
 }
开发者ID:noikiy,项目名称:qdpm,代码行数:23,代码来源:TicketsForm.class.php

示例6: url_for

    
    <?php 
if ($action_name == 'index') {
    ?>
      <form action="<?php 
    echo url_for('timeReport/' . $action_name);
    ?>
" method="post">
      <table>
        <tr>
          <td><?php 
    echo __('User');
    ?>
:&nbsp;</td>
          <td><?php 
    echo select_tag('filter_by[CommentCreatedBy]', isset($filter_by['CommentCreatedBy']) ? $filter_by['CommentCreatedBy'] : '', array('choices' => Users::getChoices(array(), 'tasks_comments_insert', true)), array('onChange' => 'this.form.submit()'));
    ?>
</td>          
        </tr>
      </table>
      <?php 
    echo $sf_request->hasParameter('projects_id') ? input_hidden_tag('projects_id', $sf_request->getParameter('projects_id')) : '';
    ?>
      </form>
    <?php 
} else {
    ?>
    
      <table>
        <tr>
          <td><?php 
开发者ID:noikiy,项目名称:qdpm,代码行数:30,代码来源:_extraFilters.php

示例7: select_tag

    ?>
</td>
      </tr>
    <?php 
}
?>
    </table>
  
  </div>
  
  <?php 
if (isset($projects)) {
    ?>
  <div>
     <?php 
    echo select_tag('fields[assigned_to]', '', array('choices' => Users::getChoices(array_merge(array($sf_user->getAttribute('id')), array_filter(explode(',', $projects->getTeam()))), 'tasks'), 'expanded' => true, 'multiple' => true));
    ?>
  </div>
  <?php 
}
?>
</div>

<br>
<input type="submit" value="<?php 
echo __('Update');
?>
" class="btn">

<?php 
echo input_hidden_tag('selected_items');
开发者ID:noikiy,项目名称:qdpm,代码行数:31,代码来源:multipleEditSuccess.php

示例8: __

    ?>
                  <?php 
    echo $form['users_id'];
    ?>
                </td>
              </tr> 
              <?php 
    if ($form->getObject()->isNew()) {
        ?>
              <tr>
                <th><?php 
        echo __('Notify');
        ?>
</th>
                <td><div class="checkboxesList"><?php 
        echo select_tag('extra_notification', '', array('choices' => Users::getChoices(array_filter(explode(',', $projects->getTeam())), 'tickets'), 'multiple' => true, 'expanded' => true));
        ?>
</div></td>
              </tr> 
              <?php 
    }
    ?>
              <?php 
}
?>
             </table> 
          </div>
                              
          <div>
            <?php 
include_component('attachments', 'attachments', array('bind_type' => 'tickets', 'bind_id' => $form->getObject()->isNew() ? 0 : $form->getObject()->getId()));
开发者ID:noikiy,项目名称:qdpm,代码行数:31,代码来源:_form.php

示例9: __

echo app::getReportFormFilterByTable('Status', 'user_reports[tasks_status_id]', 'TasksStatus', $form['tasks_status_id']->getValue());
?>
                    <?php 
echo app::getReportFormFilterByTable('Type', 'user_reports[tasks_type_id]', 'TasksTypes', $form['tasks_type_id']->getValue());
?>
                    <?php 
echo app::getReportFormFilterByTable('Label', 'user_reports[tasks_label_id]', 'TasksLabels', $form['tasks_label_id']->getValue());
?>
        
                  </tr>  
                </table>

                </td>
                
                <?php 
if (count($choices = Users::getChoices(array(), 'tasks')) > 0 and (Users::hasAccess('insert', 'tasks', $sf_user) or Users::hasAccess('edit', 'tasks', $sf_user))) {
    if (!is_string($v = $form['assigned_to']->getValue())) {
        $v = '';
    }
    echo '<td style="padding-right: 10px;"><b>' . __('Assigned To') . '</b><br>' . select_tag('user_reports[assigned_to]', explode(',', $v), array('choices' => $choices, 'multiple' => true), array('style' => 'height: 400px; width: 250px;')) . '</td>';
}
?>
              </tr>
            </table>
          </div>
          
          <div>
            
            <?php 
echo __('Tasks Due Date');
?>
开发者ID:noikiy,项目名称:qdpm,代码行数:31,代码来源:_form.php

示例10: getFilterMenuUsers

 public static function getFilterMenuUsers($m, $t, $title, $path, $params = false, $selected = array())
 {
     if (!is_array($selected)) {
         $selected = explode(',', $selected);
     }
     if (count($selected) > 0) {
         $ft = 'Preview';
     } else {
         $ft = '';
     }
     $has_access = '';
     switch ($t) {
         case 'TasksAssignedTo':
             $has_access = 'tasks';
             break;
         case 'TasksCreatedBy':
             $has_access = 'tasks_insert';
             break;
         case 'TicketsCreatedBy':
             $has_access = 'tickets_insert';
             break;
         case 'DiscussionsAssignedTo':
             $has_access = 'discussions';
             break;
         case 'DiscussionsCreatedBy':
             $has_access = 'discussions_insert';
             break;
     }
     $s = array();
     foreach (Users::getChoices(array(), $has_access) as $n => $g) {
         if (count($g) > 0) {
             $gk = array();
             foreach ($g as $k => $v) {
                 $gk[] = $k;
             }
             $ss = array();
             foreach ($g as $k => $v) {
                 $ss[] = array('title' => '<table><tr><td style="padding-right: 10px;"><input class="' . $t . 'Filters' . $ft . '" name="' . $t . $k . '" id="' . $t . $k . '" value="' . $k . '" ' . (in_array($k, $selected) ? 'checked="checked"' : '') . ' type="checkbox"></td><td>' . link_to($v, $path, array('query_string' => 'filter_by[' . $t . ']=' . $k . ($params ? '&' . $params : ''))) . '</td></table>');
             }
             if (count($ss) > 0) {
                 $s[] = array('title' => '<a href="' . url_for($path . '?filter_by[' . $t . ']=' . implode(',', $gk) . ($params ? '&' . $params : '')) . '">' . __($n) . '</a>', 'submenu' => $ss);
             }
         }
     }
     $s[] = array('title' => '<form id="filter_by_' . $t . '_form" action="' . url_for($path . ($params ? '?' . $params : '')) . '" method="post">' . input_hidden_tag('filter_by[' . $t . ']', '') . '<table onClick="filter_by_selected(\'' . $t . '\',\'' . $ft . '\')"><tr><td style="padding-right: 10px;">' . image_tag('icons/arrow_up.png') . '</td><td>' . __('Filter by selected') . '</td></table></form>', 'is_hr' => true);
     $m[] = array('title' => __($title), 'submenu' => $s);
     return $m;
 }
开发者ID:noikiy,项目名称:qdpm,代码行数:48,代码来源:app.class.php


注:本文中的Users::getChoices方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。