commit d7a6c78a3a9ac99d192a2b2f21a525dbb9c2f039
parent 1d6512d685d424eb1f103f8b35ae38bcde434f57
Author: Jan Dankert <develop@jandankert.de>
Date: Tue, 14 May 2019 23:25:57 +0200
Gruppen-Name als Eigenschaft editierbar.
Diffstat:
10 files changed, 140 insertions(+), 66 deletions(-)
diff --git a/modules/cms-core/model/Group.class.php b/modules/cms-core/model/Group.class.php
@@ -183,7 +183,10 @@ class Group
}
- // Benutzer ermitteln, die Mitglied dieser Gruppe sind
+ /**
+ * Get all users of this group.
+ * @return array id->name
+ */
function getUsers()
{
$db = db_connection();
diff --git a/modules/cms-ui/themes/default/html/views/group/edit.php b/modules/cms-ui/themes/default/html/views/group/edit.php
@@ -1,19 +0,0 @@
-
-
-
-
- <form name="" target="_self" data-target="view" action="./" data-method="edit" data-action="group" data-id="<?php echo OR_ID ?>" method="post" enctype="application/x-www-form-urlencoded" class="or-form group" data-async="" data-autosave=""><input type="hidden" name="<?php echo REQ_PARAM_EMBED ?>" value="1" /><input type="hidden" name="<?php echo REQ_PARAM_TOKEN ?>" value="<?php echo token() ?>" /><input type="hidden" name="<?php echo REQ_PARAM_ACTION ?>" value="group" /><input type="hidden" name="<?php echo REQ_PARAM_SUBACTION ?>" value="edit" /><input type="hidden" name="<?php echo REQ_PARAM_ID ?>" value="<?php echo OR_ID ?>" />
- <div class="line">
- <div class="label">
- <label for="<?php echo REQUEST_ID ?>_name" class="label">
- <span><?php echo nl2br(encodeHtml(htmlentities(lang('GLOBAL_NAME')))); ?></span>
-
- </label>
- </div>
- <div class="input">
- <div class="inputholder"><input id="<?php echo REQUEST_ID ?>_name" name="<?php if ('') echo ''.'_' ?>name<?php if ('') echo '_disabled' ?>" type="text" maxlength="100" class="focus" value="<?php echo Text::encodeHtml(@$name) ?>" /><?php if ('') { ?><input type="hidden" name="name" value="<?php $name ?>"/><?php } ?></div>
-
- </div>
- </div>
- <div class="or-form-actionbar"><input type="submit" class="or-form-btn or-form-btn--primary" value="OK" /></div></form>
- -
\ No newline at end of file
diff --git a/modules/cms-ui/themes/default/html/views/group/edit.tpl.src.xml b/modules/cms-ui/themes/default/html/views/group/edit.tpl.src.xml
@@ -1,16 +0,0 @@
-<output xmlns="http://www.openrat.de/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.openrat.de/template ../../../../../../template-engine/components/template.xsd">
- <header views="remove"></header>
- <form method="post">
- <part class="line">
- <part class="label">
- <label for="name">
- <text text="GLOBAL_NAME"></text>
- </label>
- </part>
- <part class="input">
- <input name="name" class="focus" maxlength="100"></input>
- </part>
- </part>
- </form>
-</output>-
\ No newline at end of file
diff --git a/modules/cms-ui/themes/default/html/views/group/info.php b/modules/cms-ui/themes/default/html/views/group/info.php
@@ -0,0 +1,52 @@
+
+
+ <form name="" target="_self" data-target="view" action="./" data-method="info" data-action="group" data-id="<?php echo OR_ID ?>" method="POST" enctype="application/x-www-form-urlencoded" class="or-form group" data-async="" data-autosave=""><input type="hidden" name="<?php echo REQ_PARAM_EMBED ?>" value="1" /><input type="hidden" name="<?php echo REQ_PARAM_TOKEN ?>" value="<?php echo token() ?>" /><input type="hidden" name="<?php echo REQ_PARAM_ACTION ?>" value="group" /><input type="hidden" name="<?php echo REQ_PARAM_SUBACTION ?>" value="info" /><input type="hidden" name="<?php echo REQ_PARAM_ID ?>" value="<?php echo OR_ID ?>" />
+ <span class="headline"><?php echo nl2br(encodeHtml(htmlentities($name))); ?></span>
+
+ <div class="line">
+ <div class="label">
+ <span><?php echo nl2br(encodeHtml(htmlentities(lang('GLOBAL_NAME')))); ?></span>
+
+ </div>
+ <div class="input clickable">
+ <span><?php echo nl2br(encodeHtml(htmlentities($name))); ?></span>
+
+ <a class="or-link-btn" target="_self" data-type="edit" data-action="group" data-method="prop" data-id="<?php echo OR_ID ?>" data-extra="[]" href="<?php echo Html::url('group','prop','',array()) ?>">
+ <span><?php echo nl2br(encodeHtml(htmlentities(lang(''.'edit'.'')))); ?></span>
+
+ </a>
+
+ </div>
+ </div>
+ <div class="line">
+ <div class="label">
+ <span><?php echo nl2br(encodeHtml(htmlentities(lang('USERS')))); ?></span>
+
+ </div>
+ <div class="input">
+ <?php foreach($users as $id=>$name){ ?>
+ <div class="clickable">
+ <a target="_self" data-type="open" data-action="user" data-method="info" data-id="<?php echo $id ?>" data-extra="[]" href="<?php echo Html::url('user','',$id,array()) ?>">
+ <span><?php echo nl2br(encodeHtml(htmlentities($name))); ?></span>
+
+ </a>
+
+ <br/>
+
+ </div>
+ <?php } ?>
+ </div>
+ </div>
+ <div class="line">
+ <div class="label">
+ </div>
+ <div class="input clickable">
+ <a class="or-link-btn" target="_self" data-type="edit" data-action="group" data-method="memberships" data-id="<?php echo OR_ID ?>" data-extra="[]" href="<?php echo Html::url('group','memberships','',array()) ?>">
+ <span><?php echo nl2br(encodeHtml(htmlentities(lang(''.'edit'.'')))); ?></span>
+
+ </a>
+
+ </div>
+ </div>
+ <div class="or-form-actionbar"></div></form>
+ +
\ No newline at end of file
diff --git a/modules/cms-ui/themes/default/html/views/group/info.tpl.src.xml b/modules/cms-ui/themes/default/html/views/group/info.tpl.src.xml
@@ -0,0 +1,47 @@
+<output xmlns="http://www.openrat.de/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.openrat.de/template ../../../../../../template-engine/components/template.xsd">
+ <form readonly="true" cancel="false">
+
+ <text class="headline" var="name" />
+
+ <part class="line">
+ <part class="label">
+ <text text="GLOBAL_NAME"></text>
+ </part>
+ <part class="input clickable">
+ <text var="name"/>
+ <link class="or-link-btn" action="group" subaction="prop" type="edit">
+ <text key="edit"/>
+ </link>
+ </part>
+ </part>
+
+ <part class="line">
+ <part class="label">
+ <text text="USERS"></text>
+ </part>
+ <part class="input">
+
+ <list list="users" key="id" value="name">
+ <part class="clickable">
+ <link type="open" action="user" id="var:id">
+ <text var="name"/>
+ </link>
+ <newline/>
+ </part>
+ </list>
+ </part>
+ </part>
+
+ <part class="line">
+ <part class="label">
+ </part>
+ <part class="input clickable">
+
+ <link class="or-link-btn" action="group" subaction="memberships" type="edit">
+ <text key="edit"/>
+ </link>
+ </part>
+ </part>
+ </form>
+</output>+
\ No newline at end of file
diff --git a/modules/cms-ui/themes/default/html/views/group/listing.php b/modules/cms-ui/themes/default/html/views/group/listing.php
diff --git a/modules/cms-ui/themes/default/html/views/group/listing.tpl.src.xml b/modules/cms-ui/themes/default/html/views/group/listing.tpl.src.xml
@@ -1,26 +0,0 @@
-<output xmlns="http://www.openrat.de/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.openrat.de/template ../../../../../../template-engine/components/template.xsd">
- <header views="add" />
- <table>
- <row class="headline">
- <column>
- <text key="name"></text>
- </column>
- </row>
- <list list="el" extract="true">
- <row class="data">
- <column url="var:url">
- <image file="icon_group"></image>
- <text var="name"></text>
- </column>
- </row>
- </list>
- <row>
- <column>
- <link type="dialog" class="action" action="group" subaction="add">
- <text key="menu_group_add"></text>
- </link>
- </column>
- </row>
- </table>
-</output>-
\ No newline at end of file
diff --git a/modules/cms-ui/themes/default/html/views/group/memberships.php b/modules/cms-ui/themes/default/html/views/group/memberships.php
@@ -47,5 +47,5 @@
</div>
</td>
</tr>
- <div class="or-form-actionbar"><input type="submit" class="or-form-btn or-form-btn--primary" value="OK" /></div></form>
+ <div class="or-form-actionbar"><input type="button" class="or-form-btn or-form-btn--secondary or-form-btn--cancel" value="<?php echo lang("CANCEL") ?>" /><input type="submit" class="or-form-btn or-form-btn--primary" value="OK" /></div></form>
\ No newline at end of file
diff --git a/modules/cms-ui/themes/default/html/views/group/prop.php b/modules/cms-ui/themes/default/html/views/group/prop.php
@@ -0,0 +1,17 @@
+
+
+ <form name="" target="_self" data-target="view" action="./" data-method="prop" data-action="group" data-id="<?php echo OR_ID ?>" method="post" enctype="application/x-www-form-urlencoded" class="or-form group" data-async="" data-autosave=""><input type="hidden" name="<?php echo REQ_PARAM_EMBED ?>" value="1" /><input type="hidden" name="<?php echo REQ_PARAM_TOKEN ?>" value="<?php echo token() ?>" /><input type="hidden" name="<?php echo REQ_PARAM_ACTION ?>" value="group" /><input type="hidden" name="<?php echo REQ_PARAM_SUBACTION ?>" value="prop" /><input type="hidden" name="<?php echo REQ_PARAM_ID ?>" value="<?php echo OR_ID ?>" />
+ <div class="line">
+ <div class="label">
+ <label for="<?php echo REQUEST_ID ?>_name" class="label">
+ <span><?php echo nl2br(encodeHtml(htmlentities(lang('GLOBAL_NAME')))); ?></span>
+
+ </label>
+ </div>
+ <div class="input">
+ <div class="inputholder"><input id="<?php echo REQUEST_ID ?>_name" name="<?php if ('') echo ''.'_' ?>name<?php if ('') echo '_disabled' ?>" type="text" maxlength="100" class="name focus" value="<?php echo Text::encodeHtml(@$name) ?>" /><?php if ('') { ?><input type="hidden" name="name" value="<?php $name ?>"/><?php } ?></div>
+
+ </div>
+ </div>
+ <div class="or-form-actionbar"><input type="button" class="or-form-btn or-form-btn--secondary or-form-btn--cancel" value="<?php echo lang("CANCEL") ?>" /><input type="submit" class="or-form-btn or-form-btn--primary" value="OK" /></div></form>
+ +
\ No newline at end of file
diff --git a/modules/cms-ui/themes/default/html/views/group/prop.tpl.src.xml b/modules/cms-ui/themes/default/html/views/group/prop.tpl.src.xml
@@ -0,0 +1,15 @@
+<output xmlns="http://www.openrat.de/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.openrat.de/template ../../../../../../template-engine/components/template.xsd">
+ <form method="post">
+ <part class="line">
+ <part class="label">
+ <label for="name">
+ <text text="GLOBAL_NAME"></text>
+ </label>
+ </part>
+ <part class="input">
+ <input name="name" class="name focus" maxlength="100"></input>
+ </part>
+ </part>
+ </form>
+</output>+
\ No newline at end of file