Skip to content

Commit 0a7bfec

Browse files
committed
Merge pull request #3 from sirnone/master
update for inventory and a bugfix
2 parents d0e3196 + 33a758c commit 0a7bfec

File tree

15 files changed

+132
-463
lines changed

15 files changed

+132
-463
lines changed

adm_program/installation/db_scripts/db.sql

+1
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ create table %PREFIX%_roles
518518
rol_system boolean not null default '0',
519519
rol_visible boolean not null default '1',
520520
rol_webmaster boolean not null default '0',
521+
rol_inventory boolean not null default '0',
521522
primary key (rol_id)
522523
)
523524
engine = InnoDB

adm_program/modules/inventory/fields_new.php

+13-13
Original file line numberDiff line numberDiff line change
@@ -115,26 +115,26 @@ function setValueList() {
115115
$form->openGroupBox('gb_designation', $gL10n->get('SYS_DESIGNATION'));
116116
if($itemField->getValue('inf_system') == 1)
117117
{
118-
$form->addTextInput('inf_name', $gL10n->get('SYS_NAME'), $itemField->getValue('inf_name', 'database'), 100, FIELD_DISABLED);
118+
$form->addInput('inf_name', $gL10n->get('SYS_NAME'), $itemField->getValue('inf_name', 'database'), array('maxLength' => 100, 'property' => FIELD_DISABLED));
119119
}
120120
else
121121
{
122-
$form->addTextInput('inf_name', $gL10n->get('SYS_NAME'), $itemField->getValue('inf_name', 'database'), 100, FIELD_MANDATORY);
122+
$form->addInput('inf_name', $gL10n->get('SYS_NAME'), $itemField->getValue('inf_name', 'database'), array('maxLength' => 100, 'property' => FIELD_MANDATORY));
123123
}
124124

125125
// show internal field name for information
126126
if($getInfId > 0)
127127
{
128-
$form->addTextInput('inf_name_intern', $gL10n->get('SYS_INTERNAL_NAME'), $itemField->getValue('inf_name_intern'), 100, FIELD_DISABLED, 'text', 'SYS_INTERNAL_NAME_DESC');
128+
$form->addInput('inf_name_intern', $gL10n->get('SYS_INTERNAL_NAME'), $itemField->getValue('inf_name_intern'), array('maxLength' => 100, 'property' => FIELD_DISABLED, 'helpTextIdLabel' => 'SYS_INTERNAL_NAME_DESC'));
129129
}
130130

131131
if($itemField->getValue('inf_system') == 1)
132132
{
133-
$form->addTextInput('inf_cat_id', $gL10n->get('SYS_CATEGORY'), $itemField->getValue('cat_name'), 100, FIELD_DISABLED);
133+
$form->addInput('inf_cat_id', $gL10n->get('SYS_CATEGORY'), $itemField->getValue('cat_name'), array('maxLength' => 100, 'property' => FIELD_DISABLED));
134134
}
135135
else
136136
{
137-
$form->addSelectBoxForCategories('inf_cat_id', $gL10n->get('SYS_CATEGORY'), $gDb, 'INF', 'EDIT_CATEGORIES', FIELD_MANDATORY, $itemField->getValue('cat_name'));
137+
$form->addSelectBoxForCategories('inf_cat_id', $gL10n->get('SYS_CATEGORY'), $gDb, 'INF', 'EDIT_CATEGORIES', array( 'property' => FIELD_MANDATORY, 'defaultValue' => $itemField->getValue('cat_name')));
138138
}
139139
$form->closeGroupBox();
140140
$form->openGroupBox('gb_presentation', $gL10n->get('SYS_PRESENTATION'));
@@ -152,25 +152,25 @@ function setValueList() {
152152
if($itemField->getValue('inf_system') == 1)
153153
{
154154
// bei Systemfeldern darf der Datentyp nicht mehr veraendert werden
155-
$form->addTextInput('inf_type', $gL10n->get('ORG_DATATYPE'), $itemFieldText[$itemField->getValue('inf_type')], 30, FIELD_DISABLED);
155+
$form->addInput('inf_type', $gL10n->get('ORG_DATATYPE'), $itemFieldText[$itemField->getValue('inf_type')], array('maxLength' => 30, 'property' => FIELD_DISABLED));
156156
}
157157
else
158158
{
159159
// fuer jeden Feldtypen einen Eintrag in der Combobox anlegen
160-
$form->addSelectBox('inf_type', $gL10n->get('ORG_DATATYPE'), $itemFieldText, FIELD_MANDATORY, $itemField->getValue('inf_type'));
160+
$form->addSelectBox('inf_type', $gL10n->get('ORG_DATATYPE'), $itemFieldText, array( 'property' => FIELD_MANDATORY, 'defaultValue' => $itemField->getValue('inf_type')));
161161
}
162-
$form->addMultilineTextInput('inf_value_list', $gL10n->get('ORG_VALUE_LIST'), $itemField->getValue('inf_value_list', 'database'), 6, 0, FIELD_MANDATORY, 'ORG_VALUE_LIST_DESC');
162+
$form->addMultilineTextInput('inf_value_list', $gL10n->get('ORG_VALUE_LIST'), $itemField->getValue('inf_value_list', 'database'), 6, array('property' => FIELD_MANDATORY, 'helpTextIdLabel' => 'ORG_VALUE_LIST_DESC'));
163163
$form->closeGroupBox();
164164
$form->openGroupBox('gb_authorization', $gL10n->get('SYS_AUTHORIZATION'));
165-
$form->addCheckbox('inf_hidden', $gL10n->get('ORG_FIELD_NOT_HIDDEN'), $itemField->getValue('inf_hidden'), FIELD_DEFAULT, 'ORG_FIELD_HIDDEN_DESC', null, 'eye.png');
166-
$form->addCheckbox('inf_disabled', $gL10n->get('ORG_FIELD_DISABLED', $gL10n->get('ROL_RIGHT_EDIT_USER')), $itemField->getValue('inf_disabled'), FIELD_DEFAULT, 'ORG_FIELD_DISABLED_DESC', null, 'textfield_key.png');
167-
$form->addCheckbox('inf_mandatory', $gL10n->get('ORG_FIELD_MANDATORY'), $itemField->getValue('inf_mandatory'), FIELD_DEFAULT, 'ORG_FIELD_MANDATORY_DESC', null, 'asterisk_yellow.png');
165+
$form->addCheckbox('inf_hidden', $gL10n->get('ORG_FIELD_NOT_HIDDEN'), $itemField->getValue('inf_hidden'), array('property' => FIELD_DEFAULT, 'helpTextIdLabel' => 'ORG_FIELD_HIDDEN_DESC', 'icon' => 'eye.png'));
166+
$form->addCheckbox('inf_disabled', $gL10n->get('ORG_FIELD_DISABLED', $gL10n->get('ROL_RIGHT_EDIT_USER')), $itemField->getValue('inf_disabled'), array('property' => FIELD_DEFAULT, 'helpTextIdLabel' => 'ORG_FIELD_DISABLED_DESC', 'icon' => 'textfield_key.png'));
167+
$form->addCheckbox('inf_mandatory', $gL10n->get('ORG_FIELD_MANDATORY'), $itemField->getValue('inf_mandatory'), array('property' => FIELD_DEFAULT, 'helpTextIdLabel' => 'ORG_FIELD_MANDATORY_DESC', 'icon' => 'asterisk_yellow.png'));
168168
$form->closeGroupBox();
169169
$form->openGroupBox('gb_description', $gL10n->get('SYS_DESCRIPTION'), 'panel-editor');
170-
$form->addEditor('inf_description', null, $itemField->getValue('inf_description'), FIELD_DEFAULT, 'AdmidioDefault', '200px');
170+
$form->addEditor('inf_description', null, $itemField->getValue('inf_description'), array('property' => FIELD_DEFAULT, 'toolbar' => 'AdmidioDefault', 'height' => '200px'));
171171
$form->closeGroupBox();
172172

173-
$form->addSubmitButton('btn_save', $gL10n->get('SYS_SAVE'), THEME_PATH.'/icons/disk.png');
173+
$form->addSubmitButton('btn_save', $gL10n->get('SYS_SAVE'), array( 'icon' => THEME_PATH.'/icons/disk.png'));
174174
$form->addHtml(admFuncShowCreateChangeInfoById($itemField->getValue('inf_usr_id_create'), $itemField->getValue('inf_timestamp_create'), $itemField->getValue('inf_usr_id_change'), $itemField->getValue('inf_timestamp_change')));
175175

176176
// add form to html page and show page

adm_program/modules/inventory/inventory.php

+10-4
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626

2727
$gInventoryFields = new InventoryFields($gDb, $gCurrentOrganization->getValue('org_id'));
2828

29-
// alle Mitglieder zur Auswahl selektieren
30-
// unbestaetigte User werden dabei nicht angezeigt
29+
// alle Items zur Auswahl selektieren
3130
$sql = 'SELECT inv_id, item_name.ind_value as item_name, room_id.ind_value as room_id,
3231
COALESCE(inv_timestamp_change, inv_timestamp_create) as timestamp
3332
FROM '. TBL_INVENT. '
@@ -44,6 +43,10 @@
4443
// create html page object
4544
$page = new HtmlPage();
4645

46+
$page->addJavascript('
47+
$(".icon-link-popup").colorbox({rel:\'nofollow\', scrolling:false, onComplete:function(){$("#admButtonNo").focus();}});
48+
', true);
49+
4750
$page->addHeadline($headline);
4851

4952
// create module menu
@@ -75,7 +78,7 @@
7578
);
7679

7780
$itemsTable->setColumnAlignByArray(array('left', 'left', 'left', 'left', 'right'));
78-
$itemsTable->disableDatatablesColumnsSort(10);
81+
$itemsTable->disableDatatablesColumnsSort(5);
7982
$itemsTable->addRowHeadingByArray($columnHeading);
8083
$itemsTable->setDatatablesRowsPerPage($gPreferences['user_management_members_per_page']);
8184
$itemsTable->setMessageIfNoRowsFound('SYS_NO_ENTRIES');
@@ -86,11 +89,14 @@
8689
{
8790
$timestampChange = new DateTimeExtended($row['timestamp'], 'Y-m-d H:i:s');
8891

92+
$room = new TableRooms($gDb, $row['room_id']);
93+
$roomLink = $g_root_path. '/adm_program/system/msg_window.php?message_id=room_detail&message_title=DAT_ROOM_INFORMATIONS&message_var1='.$row['room_id'].'&inline=true';
94+
8995
// create array with all column values
9096
$columnValues = array(
9197
$irow,
9298
'<a href="'.$g_root_path.'/adm_program/modules/inventory/item.php?item_id='. $row['inv_id']. '">'. $row['item_name']. '</a>',
93-
'<a href="'.$g_root_path.'/adm_program/modules/rooms/rooms.php?room_id='. $row['room_id']. '">'. $row['room_id']. '</a>'
99+
'<a class="icon-link-popup" href="'.$roomLink.'">' . $room->getValue('room_name') . '</a>',
94100
);
95101

96102
$columnValues[] = $timestampChange->format($gPreferences['system_date'].' '.$gPreferences['system_time']);

0 commit comments

Comments
 (0)