commit 7d9b1d993400a2fc54cf5cde6db4b489ad871e1e
parent 3a3d2795dc0b3f0f6ff0dc91848a60ad1e74e476
Author: Jan Dankert <devnull@localhost>
Date: Sat, 21 Jul 2018 00:16:05 +0200
Es gibt kein $project mehr in der Sitzung.
Diffstat:
2 files changed, 9 insertions(+), 69 deletions(-)
diff --git a/modules/cms-core/action/ModelAction.class.php b/modules/cms-core/action/ModelAction.class.php
@@ -113,36 +113,6 @@ class ModelAction extends Action
}
- function listingView()
- {
- global $conf_php;
- $actModel = Session::getProjectModel();
-
-// $var['act_modelid'] = $this->getSessionVar('modelid');
-
- $list = array();
- foreach( $this->project->getModelIds() as $id )
- {
- $m = new Model( $id );
- $m->load();
-
- $list[$id]['name'] = $m->name;
-
- if ( $this->userIsAdmin() )
- $list[$id]['url' ] = Html::url('model','edit',$id,
- array() );
-
- if ( ! $m->isDefault && $this->userIsAdmin() )
- $list[$id]['default_url'] = Html::url('model','setdefault',$id);
-
- if ( $actModel->modelid != $m->modelid )
- $list[$id]['select_url' ] = Html::url('index','model',$id);
- }
- $this->setTemplateVar( 'el',$list );
- $this->setTemplateVar( 'add',$this->userIsAdmin() );
- }
-
-
/**
* Bearbeiten der Variante.
* Ermitteln aller Eigenschaften der Variante.
@@ -155,29 +125,7 @@ class ModelAction extends Action
}
- function checkmenu( $menu )
- {
- switch( $menu )
- {
- case 'remove':
- $actModel = Session::getProjectModel();
- return
- !readonly() &&
- $this->userIsAdmin() &&
- is_object($this->model) &&
- count( $this->model->getAll() ) >= 2 &&
- $actModel->modelid != $this->model->modelid;
-
- case 'add':
- return
- !readonly() && $this->userIsAdmin();
-
- default:
- return true;
- }
- }
-
-
+
/**
* Liefert die Struktur zu diesem Ordner:
* - Mit den übergeordneten Ordnern und
diff --git a/modules/cms-core/action/ModellistAction.class.php b/modules/cms-core/action/ModellistAction.class.php
@@ -34,34 +34,27 @@ use Session;
class ModellistAction extends Action
{
/**
- * @var Model
+ * @var Project
*/
- public $model;
+ public $project;
public $security = SECURITY_USER;
- /**
- * @var Project
- */
- private $project;
function __construct()
{
parent::__construct();
- $this->project = new Project( $this->request->getProjectId() );
- }
+ $this->project = new Project( $this->request->getRequestId());
+ }
function showView()
{
- global $conf_php;
- $actModel = Session::getProjectModel();
+ $project = new Project( $this->project->projectid );
-// $var['act_modelid'] = $this->getSessionVar('modelid');
-
$list = array();
- foreach( $this->project->getModelIds() as $id )
+ foreach( $project->getModelIds() as $id )
{
$m = new Model( $id );
$m->load();
@@ -74,8 +67,7 @@ class ModellistAction extends Action
if ( ! $m->isDefault && $this->userIsAdmin() )
$list[$id]['default_url'] = Html::url('model','setdefault',$id);
- if ( $actModel->modelid != $m->modelid )
- $list[$id]['select_url' ] = Html::url('index','model',$id);
+ $list[$id]['select_url' ] = Html::url('index','model',$id);
}
$this->setTemplateVar( 'el',$list );
$this->setTemplateVar( 'add',$this->userIsAdmin() );
@@ -102,7 +94,7 @@ class ModellistAction extends Action
function addPost()
{
$model = new Model();
- $model->projectid = $this->project->projectid;
+ $model->projectid = $this->getRequestVar('projectid');
$model->name = $this->getRequestVar('name');
$model->add();