From 2de132793448d284ad0e191eca5ece3c2ade3d98 Mon Sep 17 00:00:00 2001 From: Rob Ostensen Date: Fri, 7 Oct 2011 06:57:43 -0500 Subject: [PATCH] more external bind changes, added a clean up button, urls now show for external collections and added a few strings for translation --- inc/ui/collection-edit.php | 11 ++++++++++- inc/ui/external-browse.php | 12 +++++++++++- po/messages.pot | 9 +++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/inc/ui/collection-edit.php b/inc/ui/collection-edit.php index 39694d29..54bfe3f3 100644 --- a/inc/ui/collection-edit.php +++ b/inc/ui/collection-edit.php @@ -132,6 +132,15 @@ if ( $editor->Available() ) { $entryqry = new AwlQuery( 'SELECT count(*) as count from caldav_data where collection_id='.$editor->Value('collection_id') ); $entryqry->Exec('admin-collection-edit'); $entries = $entryqry->Fetch(); $entries = $entries->count; + + $externalqry = new AwlQuery( 'SELECT external_url from dav_binding where bound_source_id=:id limit 1', array(':id' => $editor->Value('collection_id') ) ); + $externalqry->Exec('external-bind-url'); + $external = $externalqry->Fetch(); $external_url = $external->external_url; + if ( $external_url ) { + $external_bind = "\n " . translate('External Url') . " $external_url "; + } else { + $external_bind = ""; + } } else { $c->page_title = $editor->Title(translate('Create New Collection')); @@ -315,7 +324,7 @@ label.privilege { - + $external_bind
$prompt_collection_id: $value_id
$prompt_dav_name: $value_dav_name
$prompt_dav_name: $value_dav_name
$prompt_entries: $entries
$prompt_load_file: ##ics_file.file.60##   diff --git a/inc/ui/external-browse.php b/inc/ui/external-browse.php index 72a847ef..823f2068 100644 --- a/inc/ui/external-browse.php +++ b/inc/ui/external-browse.php @@ -4,7 +4,7 @@ param_to_global( 'external_active', '([tf])', 'active' ); $browser = new Browser(translate('External Calendars')); $browser->AddColumn( 'collection_id', translate('ID'), 'right', '##collection_link##' ); -$rowurl = $c->base_url . '/admin.php?action=edit&t=external&id='; +$rowurl = $c->base_url . '/admin.php?action=edit&t=collection&id='; $browser->AddHidden( 'collection_link', "'' || collection_id || ''" ); $browser->AddColumn( 'dav_displayname', translate('Display Name') ); $browser->AddColumn( 'refs', translate('References'),'right','','(select count(*) from dav_binding where bound_source_id=collection_id )' ); @@ -26,3 +26,13 @@ else { $page_elements[] = $browser; + +$externalqry = new AwlQuery( "SELECT count(*) as count from collection where parent_container='/.external/' and collection_id not in ( select bound_source_id from dav_binding where external_url is not null)" ); +$externalqry->Exec('external-bind-url'); +$external = $externalqry->Fetch(); +if ( $external->count > 0 ) { + $link = ''. + translate("Remove dangling external calendars").'('.$external->count.')'; + $c->stylesheets[] = 'css/edit.css'; + $page_elements[] = $link; +} diff --git a/po/messages.pot b/po/messages.pot index 40252396..28a04b8e 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -508,6 +508,9 @@ msgstr "" msgid "Expires" msgstr "" +msgid "External Url" +msgstr "" + msgid "Fail" msgstr "" @@ -657,6 +660,9 @@ msgstr "" msgid "Last used" msgstr "" +msgid "List External Calendars" +msgstr "" + msgid "List Groups" msgstr "" @@ -874,6 +880,9 @@ msgstr "" msgid "Read/Write" msgstr "" +msgid "References" +msgstr "" + msgid "Remove" msgstr ""