- further work on addressbook context menu, still not fully functional!

- moved a few more common phrases into API
This commit is contained in:
Ralf Becker 2011-04-17 21:25:01 +00:00
parent a88288abd4
commit 342799a86a
10 changed files with 56 additions and 99 deletions

View File

@ -279,7 +279,6 @@ class addressbook_ui extends addressbook_bo
'cc' => 'Cc',
'bcc' => 'Bcc',
);
//$sel_options['action'] = $this->get_legacy_actions($do_email, $content['nm']['col_filter']['tid']);
$content['nm']['actions'] = $this->get_actions($do_email, $content['nm']['col_filter']['tid']);
// if there is any export limit set, pass it on to the nextmatch, to be evaluated by the export
@ -335,7 +334,10 @@ class addressbook_ui extends addressbook_bo
/**
* Get actions / context menu items
*
* @param boolean $do_email
* @param boolean $do_email=false
* @param string $tid_filter=null
* @todo org-view uses slightly different actions
* @return array see nextmatch_widget::get_actions()
*/
private function get_actions($do_email=false, $tid_filter=null)
{
@ -354,6 +356,8 @@ class addressbook_ui extends addressbook_bo
'url' => 'menuaction=addressbook.addressbook_ui.edit&contact_id=',
'popup' => egw_link::get_registry('addressbook', 'add_popup'),
'group' => $group,
'enabled' => 'javaScript:nm_not_disableClass',
'disableClass' => 'rowNoEdit',
),
'add' => array(
'caption' => 'Add',
@ -361,7 +365,15 @@ class addressbook_ui extends addressbook_bo
'popup' => egw_link::get_registry('addressbook', 'add_popup'),
'group' => $group,
),
'select_all' => array(
'caption' => 'Whole query',
'checkbox' => true,
'onExecute' => 'javaScript:nm_select_all', // uses hint to confirm all nm_action='submit'
'hint' => 'Apply the action on the whole query, NOT only the shown contacts!!!',
'group' => ++$group,
),
);
if ($do_email)
{
$actions += array(
@ -446,6 +458,7 @@ class addressbook_ui extends addressbook_bo
'caption' => 'Merge contacts',
'confirm' => 'Merge into first or account, deletes all other!',
'hint' => 'Merge into first or account, deletes all other!',
'allowOnMultiple' => 'only',
'group' => $group,
);
@ -523,7 +536,10 @@ class addressbook_ui extends addressbook_bo
$actions['delete'] = array(
'caption' => 'Delete',
'confirm' => 'Delete this contact',
'confirm_multiple' => 'Delete these entries',
'group' => $group,
'enabled' => 'javaScript:nm_not_disableClass',
'disableClass' => 'rowNoDelete',
);
}
if($tid_filter == 'D')
@ -538,83 +554,6 @@ class addressbook_ui extends addressbook_bo
return $actions;
}
/**
* Get actions / context menu items
*
* @param boolean $do_email
*/
private function get_legacy_actions($do_email=false, $tid_filter=null)
{
$actions = array();
if ($do_email)
{
$GLOBALS['egw_info']['flags']['include_xajax'] = true;
$actions = array(
'email' => lang('Add %1',lang('business email')),
'email_home' => lang('Add %1',lang('home email')),
);
}
$actions += array(
'delete' => lang('Delete'),
);
if($tid_filter == 'D' && !$GLOBALS['egw_info']['user']['apps']['admin'] && $this->config['history'] != 'userpurge')
{
// User not allowed to purge
unset($actions['delete']);
}
// check if user is an admin or the export is not generally turned off (contact_export_limit is non-numerical, eg. no)
if (isset($GLOBALS['egw_info']['user']['apps']['admin']) || !$this->config['contact_export_limit'] || (int)$this->config['contact_export_limit'])
{
if($tid_filter == 'D')
{
$actions['undelete'] = lang('Un-delete');
}
$actions += array(
'csv' => lang('Export as CSV'),
'vcard' => lang('Export as VCard'), // ToDo: move this to importexport framework
);
}
$actions += array(
'merge' => lang('Merge into first or account, deletes all other!'),
'cat_add' => lang('Add or delete Categories'), // add a categirie to multible addresses
'infolog_add' => lang('Add a new Infolog'),
);
if ($GLOBALS['egw_info']['user']['apps']['infolog'])
{
$actions['infolog'] = lang('View linked InfoLog entries');
}
if (($move2addressbooks=$this->get_addressbooks(EGW_ACL_ADD))) // do we have addressbooks, we should
{
foreach ($move2addressbooks as $m2a_id => $m2alabel)
{
$m2a['move_to_'.$m2a_id] = $m2alabel;
}
$actions[lang('Move to addressbook:')] = $m2a;
}
if (($add_lists = $this->get_lists(EGW_ACL_EDIT))) // do we have distribution lists?
{
$lists = array();
foreach ($add_lists as $list_id => $label)
{
$lists['to_list_'.$list_id] = $label;
}
$actions[lang('Add to distribution list:')] = $lists;
unset($lists);
$actions['remove_from_list'] = lang('Remove selected contacts from distribution list');
$actions['delete_list'] = lang('Delete selected distribution list!');
}
if ($this->prefs['document_dir'])
{
$actions[lang('Insert in document').':'] = $this->get_document_actions();
}
if (!array_key_exists('importexport',$GLOBALS['egw_info']['user']['apps'])) unset($actions['export']);
//_debug_array($actions);
return $actions;
}
/**
* Email address-selection popup
*
@ -1336,8 +1275,13 @@ class addressbook_ui extends addressbook_bo
$row['type'] = 'home';
$row['type_label'] = lang('Organisation');
$readonlys["delete[$row[id]]"] = $query['filter'] && !($this->grants[(int)$query['filter']] & EGW_ACL_DELETE);
if ($query['filter'] && !($this->grants[(int)$query['filter']] & EGW_ACL_DELETE))
{
$readonlys["delete[$row[id]]"] = true;
$row['class'] .= 'rowNoDelete';
}
$readonlys["infolog[$row[id]]"] = !$GLOBALS['egw_info']['user']['apps']['infolog'];
$row['class'] .= 'rowNoEdit'; // no edit in OrgView
}
else
{
@ -1353,8 +1297,16 @@ class addressbook_ui extends addressbook_bo
{
$row['tel_prefered'] = $row[$row['tel_prefer']].' ♥';
}
$readonlys["delete[$row[id]]"] = !$this->check_perms(EGW_ACL_DELETE,$row) || (!$GLOBALS['egw_info']['user']['apps']['admin'] && $this->config['history'] != 'userpurge' && $query['col_filter']['tid'] == addressbook_so::DELETED_TYPE);
$readonlys["edit[$row[id]]"] = !$this->check_perms(EGW_ACL_EDIT,$row);
if (!$this->check_perms(EGW_ACL_DELETE,$row) || (!$GLOBALS['egw_info']['user']['apps']['admin'] && $this->config['history'] != 'userpurge' && $query['col_filter']['tid'] == addressbook_so::DELETED_TYPE))
{
$readonlys["delete[$row[id]]"] = true;
$row['class'] .= 'rowNoDelete';
}
if (!$this->check_perms(EGW_ACL_EDIT,$row))
{
$readonlys["edit[$row[id]]"] = true;
$row['class'] .= 'rowNoEdit';
}
if ($row['photo']) $photos = true;
if ($row['role']) $roles = true;

View File

@ -27,6 +27,7 @@ add business email of whole distribution list? addressbook de E-Mail geschäftl.
add custom field addressbook de Benutzerdefiniertes Feld hinzufügen
add emails of whole distribution list? addressbook de E-Mails der gesamten Verteilerliste hinzufügen?
add or delete categories addressbook de Kategorien hinzufügen oder löschen
add to distribution list addressbook de Zu Verteilerliste hinzufügen
add to distribution list: addressbook de Hinzufügen zu Verteiler:
added addressbook de hinzugefügt
added by synchronisation addressbook de Hinzugefügt über die Synchronisation
@ -263,7 +264,6 @@ in %1 days (%2) is %3's birthday. addressbook de In %1 Tagen (%2) ist der Geburt
income addressbook de Einkommen
infolog addressbook de InfoLog
insert addressbook de einfügen
insert in document addressbook de Einfügen in Dokument
insufficent rights to delete this list! addressbook de Keine Rechte vorhanden um diese Liste zu löschen!
international addressbook de International
internet addressbook de Internet
@ -290,6 +290,7 @@ locations addressbook de Standorte
main categories in their own field addressbook de Haupkategorien in einem eigenen Feld
manage mapping addressbook de Zuordnungen verwalten
mark records as private addressbook de Eintrag als Privat kennzeichnen
merge contacts addressbook de Kontakte vereinigen
merge into first or account, deletes all other! addressbook de Vereinige im ersten oder Benutzerkonto, löscht alle anderen !
merged addressbook de vereinigt
message after submitting the form addressbook de Nachricht nach dem Versenden des Formulars
@ -301,7 +302,7 @@ mobile addressbook de Mobil
mobile phone addressbook de Mobiltelefon
modem phone addressbook de Modem
more ... addressbook de Mehr ...
move to addressbook: addressbook de Verschiebe ins Adressbuch:
move to addressbook addressbook de In Adressbuch verschieben
moved addressbook de verschoben
multiple vcard addressbook de Mehrere VCards
name for the distribution list addressbook de Name für die Verteilerliste
@ -351,6 +352,7 @@ record access addressbook de Zugriffsrechte
record owner addressbook de Datensatzeigentümer
recovered addressbook de Wiederhergestellt
region addressbook de Region
remove from distribution list addressbook de Von Verteilerliste löschen
remove selected contacts from distribution list addressbook de Ausgewählte Kontakte vom Verteiler löschen
removed from distribution list addressbook de vom Verteiler gelöscht
repetition addressbook de Wiederholung

View File

@ -27,6 +27,7 @@ add business email of whole distribution list? addressbook en Add business email
add custom field addressbook en Add Custom Field
add emails of whole distribution list? addressbook en Add emails of whole distribution list?
add or delete categories addressbook en Add or delete Categories
add to distribution list addressbook en Add to distribution list
add to distribution list: addressbook en Add to distribution list:
added addressbook en added
added by synchronisation addressbook en added by synchronisation
@ -263,7 +264,6 @@ in %1 days (%2) is %3's birthday. addressbook en In %1 days (%2) is %3's birthda
income addressbook en Income
infolog addressbook en InfoLog
insert addressbook en insert
insert in document addressbook en Insert in document
insufficent rights to delete this list! addressbook en Insufficent rights to delete this list!
international addressbook en International
internet addressbook en Internet
@ -290,6 +290,7 @@ locations addressbook en locations
main categories in their own field addressbook en Main categories in their own field
manage mapping addressbook en Manage mapping
mark records as private addressbook en Mark records as private
merge contacts addressbook en Merge contacts
merge into first or account, deletes all other! addressbook en Merge into first or account, deletes all other!
merged addressbook en merged
message after submitting the form addressbook en Message after submitting the form
@ -301,7 +302,7 @@ mobile addressbook en Mobile
mobile phone addressbook en Mobile Phone
modem phone addressbook en Modem Phone
more ... addressbook en More ...
move to addressbook: addressbook en Move to addressbook:
move to addressbook addressbook en Move to addressbook
moved addressbook en moved
multiple vcard addressbook en Multiple VCard
name for the distribution list addressbook en Name for the distribution list
@ -351,6 +352,7 @@ record access addressbook en Record Access
record owner addressbook en Record owner
recovered addressbook en recovered
region addressbook en Region
remove from distribution list addressbook en Remove from distribution list
remove selected contacts from distribution list addressbook en Remove selected contacts from distribution list
removed from distribution list addressbook en Removed from distribution list
repetition addressbook en Repetition

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!-- $Id$ -->
<overlay>
<template id="addressbook.index.org_rows" template="" lang="" group="0" version="1.5.001">
<template id="addressbook.index.org_rows" template="" lang="" group="0" version="1.9.001">
<grid width="100%">
<columns>
<column/>
@ -19,7 +19,7 @@
<nextmatch-header label="Department" id="org_unit"/>
<nextmatch-header label="Business address" id="business"/>
<hbox align="center" class="noPrint">
<description value="Actions" align="center"/>
<nextmatch-header label="Actions" align="center" id="legacy_actions"/>
<button image="check" label="Check all" id="check_all" statustext="Check all" onclick="toggle_all(this.form,form::name('checked[]')); return false;" needed="1" align="right"/>
</hbox>
</row>

View File

@ -106,7 +106,7 @@
<button label="Check all" onclick="toggle_all(this.form,form::name('checked[]')); return false;" needed="1" align="right" id="check_all" image="check" statustext="Check all"/>
</hbox>
</row>
<row class="$row_cont[cat_id]" valign="top">
<row class="$row_cont[cat_id] $row_cont[class]" valign="top">
<image label="$row_cont[type_label]" align="center" no_lang="1" src="${row}[type]"/>
<vbox id="${row}[id]" options="0,0">
<description no_lang="1" id="${row}[line1]"/>
@ -220,8 +220,7 @@
<row class="noPrint" disabled="!@nm[selectcols]=/legacy_actions/">
<button label="Add" onclick="window.open(egw::link('/index.php','menuaction=addressbook.addressbook_ui.edit'),'_blank','dependent=yes,width=850,height=440,scrollbars=yes,status=yes'); return false;" id="add" statustext="Add a new contact"/>
<hbox align="right" span="all">
<checkbox label="whole query" onchange="if (this.checked==true &amp;&amp; !confirm('Apply the action on the whole query, NOT only the shown contacts!!!')) this.checked=false;" id="use_all" statustext="Apply the action on the whole query, NOT only the shown contacts!!!"/>
<button no_lang="1" id="action" statustext="Select an action or addressbook to move to" label="Select an action or addressbook to move to..." onclick="if (!egw_objectManager.executeActionImplementation(this, 'popup')) alert(egw::lang('You need to select some contacts first')); return false;;"/>
<buttononly id="legacy_actions" statustext="Select action" label="Select action" onclick="if (!egw_objectManager.executeActionImplementation(this, 'popup')) alert(egw::lang('You need to select some entries first!')); return false;;"/>
<button label="Check all" onclick="toggle_all(this.form,form::name('nm[rows][checked][]')); return false;" needed="1" id="check_all" image="arrow_ltr" statustext="Check all" class="checkAllArrow"/>
</hbox>
</row>

View File

@ -195,6 +195,7 @@ default category common de Standard-Kategorie
default height for the windows common de Vorgabewert für Höhe des Fensters
default width for the windows common de Vorgabewert für Breite des Fensters
delete common de Löschen
delete category common de Kategorie entfernen
delete row common de Zeile löschen
delete these entries common de Diese Einträge löschen
delete this entry common de Diesen Eintrag löschen
@ -342,6 +343,8 @@ indonesia common de INDONESIEN
insert all %1 addresses of the %2 contacts in %3 common de Alle %1 Adressen der %2 Kontakte in %3 einfügen
insert column after common de Spalte danach einfügen
insert column before common de Spalte davor einfügen
insert in %1 common de In %1 einfügen
insert in dokument common de In Dokument einfügen
insert row after common de Zeile danach einfügen
insert row before common de Zeile davor einfügen
international common de International

View File

@ -195,6 +195,7 @@ default category common en Default Category
default height for the windows common en Default height for the windows
default width for the windows common en Default width for the windows
delete common en Delete
delete category common en Delete category
delete row common en Delete row
delete these entries common en Delete these entries
delete this entry common en Delete this entry
@ -342,6 +343,8 @@ indonesia common en INDONESIA
insert all %1 addresses of the %2 contacts in %3 common en Insert all %1 addresses of the %2 contacts in %3
insert column after common en Insert column after
insert column before common en Insert column before
insert in %1 common en Insert in %1
insert in dokument common en Insert in dokument
insert row after common en Insert row after
insert row before common en Insert row before
international common en International

View File

@ -61,8 +61,6 @@ if you specify a document (full vfs path) here, %1 displays an extra document ic
if you specify an export definition, it will be used when you export timesheet de Wählen Sie eine Export Definition für den Export
imports entries into the timesheet from a csv file. timesheet de Importiert Einträge für den Stundenzettel aus einer CSV Datei.
insert timesheet de einfügen
insert in %1 timesheet de In %1 einfügen
insert in document timesheet de In ein Dokument einfügen
invalid field: %1 = %2, it needs to be a number. timesheet de Ungültiges Feld: %1 =%2, es muss eine Zahl sein
invalid owner id: %1. might be a bad field translation. used %2 instead. timesheet de Ungültiger Benutze ID: %1 könnte eine falsche Feldzuordnung haben. %2 wird stattdessen verwendet.
last modified timesheet de Zuletzt geändert

View File

@ -61,8 +61,6 @@ if you specify a document (full vfs path) here, %1 displays an extra document ic
if you specify an export definition, it will be used when you export timesheet en If you specify an export definition, it will be used when you export
imports entries into the timesheet from a csv file. timesheet en Imports entries into the timesheet from a CSV File.
insert timesheet en insert
insert in %1 timesheet en Insert in %1
insert in document timesheet en Insert in document
invalid field: %1 = %2, it needs to be a number. timesheet en Invalid field: %1 = %2, it needs to be a number.
invalid owner id: %1. might be a bad field translation. used %2 instead. timesheet en Invalid owner ID: %1. Might be a bad field translation. Used %2 instead.
last modified timesheet en Last modified