Skip to content

Commit

Permalink
Fixes some bugs on group edition.
Browse files Browse the repository at this point in the history
  • Loading branch information
JB Lebrun committed Nov 15, 2017
1 parent 1c4ed0a commit 2e36930
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion plugin/module/Admin_Group/Admin_Group.php.inc
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class Admin_Group extends Module {
$camyks->get_adminLink( $this->name, array('mode'=>'save' )),
'POST');
$this->form->add_hidden('is_new', $this->group->is_new);
$this->form->add_hidden('users', $this->group->users);
$this->form->add_hidden('users', $this->group->users_);
if ( $this->group->is_new == 0 ) {
$this->form->add_hidden('name', $this->group->name);
}
Expand Down
38 changes: 19 additions & 19 deletions plugin/module/Admin_Group/html/admin_edit.html.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
/*
* CaMykS Engine
* Developed by : camyks.net
* Author : CaMykS Team <camyks.contact@gmail.com>
* CaMykS Version : 1.0a2
* Author : CaMykS Team <camyks.contact@gmail.com>
* CaMykS Version : 1.0
* Object Version : 1.0
* Object Type : Plugin / Module Layout
* Create Date : Mar 2007
* Last Modif Date : Mar 2009
* Object Type : Plugin / Module Layout
* Creation Date : Mar 2007
* Last Modif Date : Nov 2017
*
* Admin_Group Module Admin Layout : edit
*/
global $camyks;
?>
<?=$this->theme->get_boxHeader('width:600px;margin:0 auto;');?>
<?=$this->theme->get_boxTitleBar( $this->get_translation('group').' : '.$this->group->name );?>
<?=$this->theme->get_boxTitleBar($this->get_translation('group').' : '.$this->group->name);?>
<?=$this->theme->get_boxContent2Header()?>
<?=$this->form->display_header(); ?>
<?=$this->form->display_hiddens(); ?>
Expand All @@ -31,39 +31,39 @@ global $camyks;

<tr>
<td class="eTableLine0 eContent2">
<?= $camyks->get_translation('formitem_name'); ?>
<?= $camyks->get_translation('formitem_name'); ?>
</td>
<td class="eTableLine0 eContent1">
<?php if ( $this->group->is_new == 1 ) : ?>
<input type="text" name="name" value="<?=$this->group->name?>" maxlength="16" class="inputs"/>
<?php else : ?>
<?=$this->group->name?>
<?php endif; ?>
<?php if ( $this->group->is_new == 1 ) : ?>
<input type="text" name="name" value="<?=$this->group->name?>" maxlength="16" class="inputs"/>
<?php else : ?>
<?=$this->group->name?>
<?php endif; ?>
</td>
</tr>

<tr>
<td class="eTableLine1 eContent2">
<?= $this->get_translation('formitem_description'); ?>
<?= $this->get_translation('formitem_description'); ?>
</td>
<td class="eTableLine1 eContent1">
<input type="text" name="description" value="<?=$this->group->description?>" maxlength="64" class="inputs" />
<input type="text" name="description" value="<?=$this->group->description?>" maxlength="64" class="inputs" />
</td>
</tr>

<tr>
<td class="eTableLine0 eContent2" style="vertical-align:top;">
<?= $this->get_translation('formitem_users'); ?>
<?= $this->get_translation('formitem_users'); ?>
</td>
<td class="eTableLine0 eContent1">
<?= $this->input->display() ?>
<?= $this->input->display() ?>
</td>
</tr>

</table>
</div>
<?=$this->form->display_footer(); ?>
<?=$this->form->display_footer(); ?>
<?=$this->theme->get_boxContent2Footer();?>
<?=$this->theme->get_boxButtonsBar( $this->buttons );?>
<?=$this->theme->get_boxFooter( );?>
<?=$this->theme->get_boxButtonsBar($this->buttons);?>
<?=$this->theme->get_boxFooter();?>

5 changes: 3 additions & 2 deletions plugin/module/Admin_Group/lib/AdminGroup.php.inc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class AdminGroup {
* constructor
* @param string $name
*/
function AdminGroup ( $name = '', $parent = null) {
function AdminGroup($name = '', $parent = null) {
$this->name = $name;
$this->is_new = ( $name == '' ? 1 : 0 );
/* update generic library vars */
Expand Down Expand Up @@ -65,6 +65,7 @@ class AdminGroup {
function initialise() {
$this->description = '';
$this->users = array();
$this->users_ = '';
$this->is_new = 1;
return true;
}
Expand Down Expand Up @@ -99,7 +100,7 @@ class AdminGroup {
if ( $req = $camyks->db_conn->execute_query($sql) or $camyks->log_sqlerror( $this, $sql, __FILE__, __LINE__ ) ) {
/* get data from database */
if ( $data = $camyks->db_conn->get_queryDataLine()) {
$this->get_fromArray( $data );
$this->get_fromArray($data);
$this->is_new = 0;
return $this->get_usersFromDatabase();
} else {
Expand Down

0 comments on commit 2e36930

Please sign in to comment.