From 99b5f239fd86a7a7345f5d27ee4f1f6e3dc076bb Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 14 Nov 2003 23:35:03 +0000 Subject: [PATCH] 1. index show icons for edit, view and (new) delete entries, owner is only showed in view or edit not longer in the index (same for vcard) 2. view is a bit compacter too as owner, access and cats are shown within the table and not as extra footer --- addressbook/csv_import.php | 2 +- addressbook/inc/class.uiaddressbook.inc.php | 84 +++++++++++++-------- addressbook/setup/phpgw_de.lang | 3 + addressbook/setup/phpgw_en.lang | 3 + addressbook/templates/default/index.tpl | 10 +-- addressbook/templates/default/view.tpl | 18 ----- 6 files changed, 60 insertions(+), 60 deletions(-) diff --git a/addressbook/csv_import.php b/addressbook/csv_import.php index b83f92a69e..c6aec8015d 100644 --- a/addressbook/csv_import.php +++ b/addressbook/csv_import.php @@ -436,7 +436,7 @@ if(!$_POST['debug'] && !$empty) // dont import empty contacts { $GLOBALS['phpgw']->contacts->add( $values['owner'] ? $values['owner'] : $GLOBALS['phpgw_info']['user']['account_id'], - $values,$values['access'],$values['cat_id']); + $values); // echo "

adding: ".print_r($values)."

\n"; } } diff --git a/addressbook/inc/class.uiaddressbook.inc.php b/addressbook/inc/class.uiaddressbook.inc.php index 8fab95f01c..c5c40be224 100644 --- a/addressbook/inc/class.uiaddressbook.inc.php +++ b/addressbook/inc/class.uiaddressbook.inc.php @@ -417,10 +417,7 @@ /* set basic vars and parse the header */ $GLOBALS['phpgw']->template->set_var('font',$GLOBALS['phpgw_info']['theme']['font']); - $GLOBALS['phpgw']->template->set_var('lang_view',lang('View')); - $GLOBALS['phpgw']->template->set_var('lang_vcard',lang('VCard')); - $GLOBALS['phpgw']->template->set_var('lang_edit',lang('Edit')); - $GLOBALS['phpgw']->template->set_var('lang_owner',lang('Owner')); + $GLOBALS['phpgw']->template->set_var('lang_actions',lang('Actions')); $GLOBALS['phpgw']->template->set_var('searchreturn',$noprefs . ' ' . $searchreturn); $GLOBALS['phpgw']->template->set_var('lang_showing',$lang_showing); @@ -500,31 +497,36 @@ $GLOBALS['phpgw']->template->parse('columns','column',True); } - if (1) - { - $GLOBALS['phpgw']->template->set_var('row_view_link',$GLOBALS['phpgw']->link('/index.php', - 'menuaction=addressbook.uiaddressbook.view&ab_id='.$entries[$i]['id'])); - } - else - { - $GLOBALS['phpgw']->template->set_var('row_view_link',''); - $GLOBALS['phpgw']->template->set_var('lang_view',lang('Private')); - } + $actions = ' '; - $GLOBALS['phpgw']->template->set_var('row_vcard_link',$GLOBALS['phpgw']->link('/index.php', - 'menuaction=addressbook.uivcard.out&ab_id='.$entries[$i]['id'])); - /* echo '
: ' . $contacts->grants[$myowner] . ' - ' . $myowner; */ if ($this->bo->check_perms($entries[$i],PHPGW_ACL_EDIT)) { - $GLOBALS['phpgw']->template->set_var('row_edit','' . lang('Edit') . ''); - } - else - { - $GLOBALS['phpgw']->template->set_var('row_edit',' '); + $actions .= ' '; } - $GLOBALS['phpgw']->template->set_var('row_owner',$GLOBALS['phpgw']->accounts->id2name($myowner)); + if ($this->bo->check_perms($entries[$i],PHPGW_ACL_DELETE)) + { + $actions .= ''; + } + $GLOBALS['phpgw']->template->set_var('actions',$actions); $GLOBALS['phpgw']->template->parse('rows','row',True); $GLOBALS['phpgw']->template->pparse('out','row'); @@ -907,7 +909,7 @@ } } /* Following cleans up view_row, since we were only using it to fill {cols} */ - $GLOBALS['phpgw']->template->set_var('view_row',''); + //$GLOBALS['phpgw']->template->set_var('view_row',''); $fields['cat_id'] = is_array($this->cat_id) ? implode(',',$this->cat_id) : $this->cat_id; @@ -937,16 +939,32 @@ $this->cat_id = $fields[0]['cat_id']; } } + $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); + $GLOBALS['phpgw']->template->set_var(array( + 'ref_data' => $GLOBALS['phpgw']->common->grab_owner_name($record_owner), + 'display_col' => lang('Record owner'), + 'th_bg' => $tr_color + )); + $GLOBALS['phpgw']->template->parse('cols','view_row',True); - if (!$catname) { $catname = lang('none'); } + $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); + $GLOBALS['phpgw']->template->set_var(array( + 'ref_data' => $access_check, + 'display_col' => lang('Record access'), + 'th_bg' => $tr_color + )); + $GLOBALS['phpgw']->template->parse('cols','view_row',True); - /* These are in the footer */ - $GLOBALS['phpgw']->template->set_var('lang_owner',lang('Record owner')); - $GLOBALS['phpgw']->template->set_var('owner',$GLOBALS['phpgw']->common->grab_owner_name($record_owner)); - $GLOBALS['phpgw']->template->set_var('lang_access',lang('Record access')); - $GLOBALS['phpgw']->template->set_var('access',$access_check); - $GLOBALS['phpgw']->template->set_var('lang_category',lang('Category')); - $GLOBALS['phpgw']->template->set_var('catname',$catname); + if ($catname) + { + $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); + $GLOBALS['phpgw']->template->set_var(array( + 'ref_data' => $catname, + 'display_col' => lang('Category'), + 'th_bg' => $tr_color + )); + $GLOBALS['phpgw']->template->parse('cols','view_row',True); + } if (($this->bo->grants[$record_owner] & PHPGW_ACL_EDIT) || ($record_owner == $GLOBALS['phpgw_info']['user']['account_id'])) { diff --git a/addressbook/setup/phpgw_de.lang b/addressbook/setup/phpgw_de.lang index d278ff0d64..cd846eb9ca 100644 --- a/addressbook/setup/phpgw_de.lang +++ b/addressbook/setup/phpgw_de.lang @@ -1,7 +1,9 @@ %1 records imported addressbook de %1 Datensätze importiert %1 records read (not yet imported, you may go %2back%3 and uncheck test import) addressbook de %1 Datensätze gelesen (noch nicht importiert, sie können %2zurück%3 gehen und Test-Import auschalten) +(e.g. 1969) addressbook de (zB. 1966) no conversion type <none> could be located. please choose a conversion type from the list addressbook de Kein Übersetzungstyp <none> konnte gefunden werden. Bitte wählen Sie einen Übersetzungstype aus der Liste @-eval() is only availible to admins!!! addressbook de @-eval() ist nur verfügbar für Administratoren!!! +actions addressbook de Befehle add a single entry by passing the fields. addressbook de Hinzufügen eines einzelnen Eintrags durch Übergeben der Felder. add custom field addressbook de Benutzerdefiniertes Feld hinzufügen address book common de Adressbuch @@ -37,6 +39,7 @@ charset of file addressbook de Zeichensatz der Datei city common de Stadt company common de Firma company name common de Firmenname +configuration common de Konfiguration contact common de Kontakt contact application admin de Kontakt Anwendung contact settings admin de Kontakt Einstellungen diff --git a/addressbook/setup/phpgw_en.lang b/addressbook/setup/phpgw_en.lang index 031bb4a500..3360fec078 100644 --- a/addressbook/setup/phpgw_en.lang +++ b/addressbook/setup/phpgw_en.lang @@ -1,7 +1,9 @@ %1 records imported addressbook en %1 records imported %1 records read (not yet imported, you may go %2back%3 and uncheck test import) addressbook en %1 records read (not yet imported, you may go %2back%3 and uncheck Test Import) +(e.g. 1969) addressbook en (e.g. 1969) no conversion type <none> could be located. please choose a conversion type from the list addressbook en No conversion type <none> could be located. Please choose a conversion type from the list @-eval() is only availible to admins!!! addressbook en @-eval() is only availible to admins!!! +actions addressbook en Actions add a single entry by passing the fields. addressbook en Add a single entry by passing the fields. add custom field addressbook en Add Custom Field address book common en Address Book @@ -37,6 +39,7 @@ charset of file addressbook en Charset of file city common en City company common en Company company name common en Company Name +configuration common en Configuration contact common en Contact contact application admin en Contact application contact settings admin en Contact Settings diff --git a/addressbook/templates/default/index.tpl b/addressbook/templates/default/index.tpl index 301ad5dd66..227594f1a4 100644 --- a/addressbook/templates/default/index.tpl +++ b/addressbook/templates/default/index.tpl @@ -5,10 +5,7 @@ {search_filter} {cols} - - - - + @@ -18,10 +15,7 @@ {columns} - - - - + diff --git a/addressbook/templates/default/view.tpl b/addressbook/templates/default/view.tpl index 28c8b317aa..25646b4951 100644 --- a/addressbook/templates/default/view.tpl +++ b/addressbook/templates/default/view.tpl @@ -9,24 +9,6 @@ {cols} - - - - - - - - - - - - - - - - -
{lang_view}{lang_vcard}{lang_edit}{lang_owner}{lang_actions}
{lang_view}{lang_vcard}{row_edit}{row_owner}{actions}
 
{lang_owner}{owner}
{lang_access}{access} -
{lang_category}{catname}