From 170e188f1f6adb2b37c954ca78b53eb702b921e4 Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Mon, 30 Jun 2025 12:11:05 -0700 Subject: [PATCH] Added choices `text` and `hyperlink` to option `showwebviewlink` --- src/GamCommands.txt | 8 ++++---- src/GamUpdate.txt | 6 ++++++ src/gam/__init__.py | 17 +++++++++++------ 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/GamCommands.txt b/src/GamCommands.txt index f19b2790..b08cf5c3 100644 --- a/src/GamCommands.txt +++ b/src/GamCommands.txt @@ -4817,13 +4817,13 @@ gam print shareddrives [todrive *] [teamdriveadminquery|query ] [matchname ] [orgunit|org|ou ] [fields ] [noorgunits []] - [showwebviewlink] + [showwebviewlink text|hyperlink] [formatjson [quotechar ]] gam show shareddrives [teamdriveadminquery|query ] [matchname ] [orgunit|org|ou ] [fields ] [noorgunits []] - [showwebviewlink] + [showwebviewlink text|hyperlink] [formatjson] [noorgunits []] gam print shareddriveorganizers [todrive *] @@ -4904,14 +4904,14 @@ gam print shareddrives [todrive *] [matchname ] [orgunit|org|ou ] (role|roles )* [fields ] - [showwebviewlink] + [showwebviewlink text|hyperlink] [guiroles []] [formatjson [quotechar ]] gam show shareddrives [teamdriveadminquery|query ] [matchname ] [orgunit|org|ou ] (role|roles )* [fields ] - [showwebviewlink] + [showwebviewlink text|hyperlink] [guiroles []] [formatjson] ::= diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index 990ec558..908b1f3a 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -1,3 +1,9 @@ +7.10.10 + +Added choices `text` and `hyperlink` to option `showwebviewlink` in `gam [] print|show shareddrives`. +* `showwebviewlink text` - Displays `https://drive.google.com/drive/folders/` +* `showwebviewlink hyperlink` - Dsiplays `=HYPERLINK("https://drive.google.com/drive/folders/", "") + 7.10.09 Added option `showwebviewlink` to `gam [] print|show shareddrives` that diff --git a/src/gam/__init__.py b/src/gam/__init__.py index e3ba684b..fb6c8aa6 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki """ __author__ = 'GAM Team ' -__version__ = '7.10.09' +__version__ = '7.10.10' __license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)' #pylint: disable=wrong-import-position @@ -65870,12 +65870,14 @@ SHAREDDRIVE_ACL_ROLES_MAP = { 'writer': 'writer', } +SHOWWEBVIEWLINK_CHOICES = {'text', 'hyperlink'} + # gam print shareddrives [todrive *] # [asadmin [shareddriveadminquery|query ]] # [matchname ] [orgunit|org|ou ] # (role|roles )* # [fields ] [noorgunits []] -# [showwebviewlink] +# [showwebviewlink [text|hyperlink]] # [guiroles []] [formatjson [quotechar ]] # [showitemcountonly] # gam show shareddrives @@ -65883,7 +65885,7 @@ SHAREDDRIVE_ACL_ROLES_MAP = { # [matchname ] [orgunit|org|ou ] # (role|roles )* # [fields ] [noorgunits []] -# [showwebviewlink] +# [showwebviewlink [text|hyperlink]] # [guiroles []] [formatjson] # [showitemcountonly] def printShowSharedDrives(users, useDomainAdminAccess=False): @@ -65893,7 +65895,10 @@ def printShowSharedDrives(users, useDomainAdminAccess=False): if td_ouid: shareddrive['orgUnit'] = orgUnitIdToPathMap.get(f'id:{td_ouid}', UNKNOWN) if showWebViewLink: - shareddrive['webViewLink'] = 'https://drive.google.com/drive/folders/'+shareddrive['id'] + if showWebViewLink == 'text': + shareddrive['webViewLink'] = 'https://drive.google.com/drive/folders/'+shareddrive['id'] + else: + shareddrive['webViewLink'] = '=HYPERLINK("https://drive.google.com/drive/folders/'+shareddrive['id']+'", "'+shareddrive['name']+'")' if not showFields: return shareddrive sshareddrive = {} @@ -65912,7 +65917,7 @@ def printShowSharedDrives(users, useDomainAdminAccess=False): showOrgUnitPaths = True orgUnitIdToPathMap = None guiRoles = showItemCountOnly = False - showWebViewLink = False + showWebViewLink = '' while Cmd.ArgumentsRemaining(): myarg = getArgument() if csvPF and myarg == 'todrive': @@ -65943,7 +65948,7 @@ def printShowSharedDrives(users, useDomainAdminAccess=False): elif myarg == 'guiroles': guiRoles = getBoolean() elif myarg == 'showwebviewlink': - showWebViewLink = True + showWebViewLink = getChoice(SHOWWEBVIEWLINK_CHOICES) elif myarg == 'showitemcountonly': showItemCountOnly = True showOrgUnitPaths = False