Exemplo n.º 1
0
 /**
  * 发表新任务
  */
 public function action()
 {
     //列出用户
     $userList = \Model\Content::listContent('user');
     $this->assign('user', $userList);
     foreach ($userList as $key => $value) {
         //获取本部门的用户
         if ($value['user_department_id'] == $_SESSION['team']['user_department_id']) {
             $localUser[$value['user_id']] = $value['user_name'];
         }
         //将所有用户放到一个以用户ID的一维数组,方便查找
         $findUser[$value['user_id']] = $value['user_name'];
     }
     $this->assign('localUser', $localUser);
     $this->assign('findUser', $findUser);
     //列出部门
     foreach (\Model\Content::listContent('department') as $key => $value) {
         $department[$value['department_id']] = $value['department_name'];
     }
     $this->assign('department', $department);
     //列出项目
     $project = \Model\Content::listContent('project', array(), '', 'project_listsort ASC, project_id DESC');
     $this->assign('project', $project);
     parent::action();
 }
Exemplo n.º 2
0
 /**
  * 更新模型
  */
 public function action($jump = FALSE, $commit = TRUE)
 {
     $model = \Model\ModelManage::findModel($_POST['id']);
     parent::action($jump, $commit);
     //更新菜单
     $this->db('menu')->where('menu_name = :old_name')->update(array('menu_name' => $this->p('title'), 'noset' => array('old_name' => $model['model_title'])));
     $this->success('更新模型成功', $this->url(GROUP . '-Model-index'));
 }
Exemplo n.º 3
0
 public function action($jump = TRUE, $commit = TRUE)
 {
     if ($_POST['parent'] == '0') {
         $_POST['value'] = (string) ucfirst(strtolower($_POST['value']));
     } else {
         $controller = \Model\Content::findContent('node', $_POST['parent'], 'node_id');
         $_POST['check_value'] = GROUP . $_POST['method_type'] . $controller['node_value'] . $_POST['value'];
     }
     parent::action();
 }
Exemplo n.º 4
0
 /**
  * 部门添加/编辑
  */
 public function action()
 {
     $userList = \Model\Content::listContent('user');
     $this->assign('user', $userList);
     foreach ($userList as $key => $value) {
         $findUser[$value['user_id']] = $value['user_name'];
     }
     $this->assign('findUser', $findUser);
     parent::action();
 }
Exemplo n.º 5
0
 public function action($jump = FALSE, $commit = true)
 {
     \Model\Field::baseForm();
     parent::action($jump, $commit);
     if (empty($_GET['back_url'])) {
         $url = $this->url(GROUP . '-Model-fieldList', array('id' => $this->p('id'), 'model_id' => \Model\Field::$model['model_id']));
     } else {
         $url = base64_decode($_GET['back_url']);
     }
     $this->success('更新字段成功', $url);
 }
Exemplo n.º 6
0
 /**
  * 添加内容
  */
 public function action($jump = TRUE, $commit = TRUE)
 {
     if ($this->p('password')) {
         $password = $this->p('password');
         if ($password != $this->p('confirm_password')) {
             $this->error('两次输入的密码不一致');
         }
         $_POST['password'] = (string) \Core\Func\CoreFunc::generatePwd($this->isP('account', '请提交帐号') . $password, 'PRIVATE_KEY');
     }
     parent::action();
 }
Exemplo n.º 7
0
 public function action($jump = FALSE, $commit = FALSE)
 {
     \Model\Field::baseForm();
     parent::action($jump, $commit);
     $filedID = $this->db()->getLastInsert;
     \Model\Field::addField($filedID);
     if (empty($_GET['back_url'])) {
         $url = $this->url(GROUP . '-Model-fieldList', array('id' => $filedID, 'model_id' => \Model\Field::$model['model_id']));
     } else {
         $url = base64_decode($_GET['back_url']);
     }
     $this->success('添加字段成功', $url);
 }
Exemplo n.º 8
0
 /**
  * 更新用户
  */
 public function action($jump = TRUE, $commit = TRUE)
 {
     $user = \Model\Content::findContent('user', (int) $_POST['id'], 'user_id');
     if (empty($user)) {
         $this->error('不存在的用户');
     }
     if ($this->p('password')) {
         $password = $this->p('password');
         if ($password != $this->p('confirm_password')) {
             $this->error('两次输入的密码不一致');
         }
         $_POST['password'] = (string) \Core\Func\CoreFunc::generatePwd($this->isP('account', '请提交帐号') . $password, 'PRIVATE_KEY');
     }
     parent::action();
 }
Exemplo n.º 9
0
 /**
  * 添加模型
  */
 public function action($jump = FALSE, $commit = FALSE)
 {
     parent::action($jump, $commit);
     $modelId = $this->db()->getLastInsert;
     $modelName = $this->p('name');
     /**
      * 插入模型菜单
      */
     $addMenuResult = \Model\Menu::insertMenu(['menu_name' => $this->p('title'), 'menu_pid' => '9', 'menu_url' => GROUP . "-" . ucfirst($modelName) . "-index"]);
     if ($addMenuResult === false) {
         $this->db()->rollBack();
         $this->error('插入菜单失败');
     }
     /**
      * 插入初始化的字段
      */
     \Model\ModelManage::setInitField($modelId);
     $this->db()->commit();
     $initResult = \Model\ModelManage::initModelTable(strtolower($modelName));
     $this->success('添加模型成功', $this->url(GROUP . '-Model-index'));
 }
Exemplo n.º 10
0
 public function action()
 {
     $this->assign('topMenu', json_encode(\Model\Menu::topMenu()));
     parent::action();
 }
Exemplo n.º 11
0
 public function action()
 {
     $parent = \Model\Content::listContent('node', array('node_parent' => '0'), 'node_parent = :node_parent');
     $this->assign('parent', $parent);
     parent::action();
 }