Clouds on the State

LESLIE FAUGHNAN explores the likely shape and approach for government cloud

If cloud computing is so wonderful, why are our Government and state agencies so reluctant to embrace it? Narrowing it down, if cloud computing can save money across so many aspects of ICT, why has our hard-pressed state sector not been scurrying to find practical applications? If our Government is convinced that cloud offers enormous opportunities for investment and job creation, as it has been stating since it took office (and inherited this optimistic political credo), why is our own national track record so unimpressive?

The relevant commitment in the Programme for Government was: "We will make Ireland a leader in the emerging I.T. market of cloud computing by promoting greater use of cloud computing in the public sector, organising existing State supports for cloud computing into a package to promote Ireland as a progressive place for I.T. investment…" Later the Public Service Reform Plan of November 2011 stated unequivocally "…We will pilot the use of Cloud Computing in the Public Service during 2012. This approach will enable the benefits case for implementation across the Public Service to be determined."

A companion volume is the Action Plan for Jobs 2012, published in February. It manages the sub-paragraph "Positioning the public sector as a key driver in the use of Cloud" as a key facet of the ‘opportunity for Ireland’. How that is to be done is stated as: "Progress the Cloud Computing Strategy for the Public Service – Centre for Management and Organisational Development to bring the strategy to Government for consideration and approval." In fairness, that is the number one item of ‘Actions to be Undertaken in 2012′ and CMOD is expected to present that strategy plan this month.

 

advertisement

 

Foggy promise
All of which reads quite well, and there is no question that CMOD and most Department CIOs have been looking into the possibilities of cloud computing for some years, certainly long before the politicians noticed anything cumulo-nimbular with such richly foggy promise. What deserves castigation, many observers in the ICT industries would feel, is the delay in getting to this waypoint: the powerful Microsoft-Goodbody report "Cloud Computing: Ireland’s Competitiveness & Jobs Opportunity" was published in January 2011. Its estimate of 8,600 potential jobs (by 2014) has been frequently quoted. It would be tempting to call the report ‘influential’ but that is only true in regard to the number of times our political leaders have invoked it like a magic mantra without actually doing very much to implement its suggestions until recently.

CMOD will undoubtedly deliver a viable strategy, thought through and prioritised insofar as anyone can. A council of government agency CIOs has been meeting since early 2011 so the expert input has been obtained. The trouble is that it is all about two years too late in the eyes of many in the industry and perhaps in the higher councils of the multinationals that are so important to our economic future. It is also, as ever in Ireland’s political history, under the threat of disappearing into the state archives (a resource recently subject to suspiciously speedy government decision making) as yet another Report. If all the state and committee and consultant reports commissioned by Irish Governments were laid end to end…?

Like all new movements, changes and seismic/paradigm shifts, cloud computing is still going through its early development. It is still generally more a proven concept than a mature model. Cloud computing variations and classifications are already beginning to parallel the ill-chosen tropospheric basis of the metaphor, so perhaps the equivalent of cumulus congestus is public cloud, cutting through several altitude layers, while cirrus, being high altitude only, might be private cloud. But scrambling that very mixed metaphor, that leads otherwise intelligent people to talk about ‘pillars of the cloud’ and nonsense like that, is not very productive.

Cloud variants
The salient point is that there are umpteen variants of cloud computing already-public, private, hybrid geographic variants to comply with EU or national data governance laws or avoid the far-reaching implications of the US Patriot Act. XaaS delivered from any of them introduces a range of generic services from infrastructure to platform to computing power to data storage and back-up. Utility computing with almost the entire standard range of ICT delivered as a service is already with us. Choose your own device and screen, or more likely your preferred set of them, and the rest you can access or download from your cloud providers of choice.

But then that ‘cloud’ prefix is just a badge of convenience for a return to centralised computing and a remote desktop, according to Tim Willoughby. He has been one of our leading IT professionals in the public sector for many years as assistant director of the LGCSB, now merging with the LGMSB to become the LGMA.* He has just taken up leave of absence and the post of CEO in TradeFacilitate.com, an entirely cloud-based provider of an online invoicing solution that is uniquely based on global standards and EU validated. It provides users with an online ordering system, import/export documentation and links to carriers, freight forwarders, customs, customs brokers, banks, insurance providers and shipping ports.

"Cloud computing is just one driver of change in today’s ICT, together with accelerating growth of data, social networking and media of many kinds and the multiple forms of mobile ICT," Willoughby believes. "All offer new possibilities. Data is huge, in every sense. When a single flight of an Airbus 320 generates something like 4TB of data you begin to appreciate our rate of data generation." But in government and state activities, it is data that can be shared and re-used that offers enormous opportunity, he says, pointing to data like traffic monitoring, water quality, household statistics and a growing range of public data. "There are also processes that are conducted openly, say in planning and regional development."

"This is a fairly obvious area for cloud computing in the public sector. The information is public anyway and being generated initially for public purposes. Making the data sets available to any interested parties enables businesses, or indeed other agencies, to design services that utilise and build on that data, offering say analyses and reports, profiles, services to select and present sub-sets and combinations and add value."

Inhibitors
All of which leads Willoughby to point out that a lot of the inhibitions about cloud computing, in the public sector and among the public, have to do with security. "But the state’s data ranges from open, public information through to highly secret sovereign data, with what could be thousands of categories in between. Personal data, in health or social welfare for example, has to be totally confidential. But statistics and analysis and metadata need not be."

What cloud technology offers across all of this is fast, shared infrastructure to publish all of this for anyone interested to use. In a similar way, he believes, there are many public administration processes that could be federated nationally on a cloud infrastructure. "If we were to gather together all of the common local activity, for example, you could have fully integrated national systems used and applied locally as appropriate." Willoughby accepts that cloud computing is neither the answer to all of our public sector administrative needs nor an immediate solution across the board. "Cloud really brings in a new set of ICT disciplines, in all sectors, and the management and governance are still evolving. There are also key issues like ‘what kind of cloud’ and where and how and what kind of architecture and so on. A lot of the current thinking is tending towards some form of national private cloud, a state cloud, either hosted by commercial providers or perhaps based on state-owned physical infrastructure. All of that is important for core functions and shared applications and data stores. But in the meantime there are rich possibilities for better citizen services and costs savings in using cloud, even public cloud, to publish and share public data and processes that do not require high levels of confidentiality."

Other countries
The question arises, from Willoughby’s insights and generally, what do other governments do about cloud? The answer, unsurprisingly, is that most of the rest of the developed world is way ahead of us with the USA-federal and state-ahead of almost everywhere. In Europe many states are well advanced and the UK is beginning to be regarded as a leader because of its concerted G-Cloud strategy for public sector use and procurement of ICT. Harry Goddard, Deloitte consulting partner specialising in the public sector, points specifically to HMG’s ‘CloudStore’: "This is a highly visible initiative and there are already something like 1,700 ICT services available through what is effectively an online catalogue of accredited services and suppliers. That makes ICT procurement easy and low cost for the entire UK public sector, potentially."

Goddard points out that this CloudStore portal for state procurement is a very good example of a significant activity that does not require particularly high levels of security. "Security concerns are the principal inhibitor in most organisations when it comes to adopting cloud solutions, or so it would appear. But looked at objectively, cloud is no different from other ICT architectures in that security management always stems from clear and appropriate policies, carried through consistently and effectively. The actual technical mechanisms are always changing and evolving, but they are secondary."

It is possible to use Gmail and Hotmail very securely, he points out, by encrypting e-mails to whatever level seems necessary. "Deloitte has 190,000 e-mail users on a hosted solution, for example, and we can have confidence in our security because the default for every e-mail is encryption with digital signature. We can ramp the level up even higher for certain classes of communication, say between partners or between the firm and its clients. E-mail is a good example of a generic ICT activity where cloud hosting offers many benefits, including the highest levels of reliability as required by such a key communications function. Security is the main and perhaps the only area of concern. But with e-mail the real issue is always the sender-consistently following the security policy appropriately is what really counts, not the specific technology used to fulfil the requirement."

National private cloud
Goddard is another advocate of a national private cloud as the potential infrastructure for state services. "It would give security reassurance for users, public sector and citizens, for example if something like CitizenInformation.ie were the universal portal for all state services. But a national private cloud for the public sector would make it easier to ensure that appropriate development strategy and governance can be directly managed."

Right now neither governments nor private organisations are ambitious enough in taking advantage of the economics and improved service quality that cloud computing can offer, according to Doug Clark, IBM’s Cloud Leader for the UK and Ireland. An industry veteran who has worked with major clients in utilities, communications and the public sector he is part of a global team implementing cloud strategy for IBM and its clients. "There is a lot of really very impressive cloud computing activity starting to happen in the public sector, especially in areas like local government, education and specific state agencies. The UK Science and Technology Facilities Council (STFC) is a leader in scientific research, both academic and industrial, that is exploiting cloud technology to share world class resources and services."

A quite different example is Sunderland City Council, which is using cloud technology both to upgrade its own infrastructure a severe cost cutting environment and to offer and lead shared services to business in the region. It had plenty of capacity in an ambitious regional data centre built in 2001. "So it has an ambitious regional ICT regeneration plan for its own services and as a regional catalyst and cloud services provider," Clark explains. "For example, shared services in functions such as call centre, HR administration as well as IaaS are beginning to form a coherent set of municipal bureau services to make the region attractive to start-ups and knowledge businesses."

CloudStore
But overall Clark believes that cloud computing implementation in the public sector, not just in the UK, is as much about political and cultural transformation as it is about technology. "That is why the UK government CloudStore, for example, is excellent because it furthers what is possible rather than imposing things. It is not aimed at ‘standardisation’ but at allowing public organisations freedom to pick and mix ICT services but from an approved and accredited set of solutions and vendors."

EMC country manager Jason Ward, an enthusiastic cloud technology advocate from one of the leading global players in the field, is perhaps unusual in the Irish ICT industry in that he is inclined to think that our somewhat late government action on cloud computing may not be at all a bad thing. This time last year he advocated urgency in public sector adoption and government action on cloud but now says: "In many ways the Irish government and public sector may be fortunate that we did not start too early. The UK government, for example, embraced the concept of cloud quite early but it has had several failures and false starts. There is a valid view that it is only starting to reap value at a national government level now, with its CloudStore project as a leading example."

CIO council
He is confident about the cloud strategy to be presented to government in the near future. "The setting up of the public sector CIO Council last year was a very good step forward and I think CMOD has a very good opportunity to opt for technology that is proven and already recognised as ‘best practice’ elsewhere. Confidence is crucial as we move forward, in the public mind and in public sector organisations. There have been well-publicised public cloud outages and the recent Ulster Bank/RBS problems, although not cloud-related, serve to remind everyone that ‘five nines’ reliability is still the gold standard in all ICT services."

On the other hand, Ward points out, EMC and other vendors are now in a position to offer pre-built and pre-configured private cloud technology that is well proven and essentially a new generation of cloud computing. "We are probably looking to some form of national cloud, community or hybrid or whatever, as the infrastructure for e-government in its true sense as a set of public services delivered to all citizens. For the activities of government itself we are probably looking at a private cloud architecture based on open source technology, which is very flexible, transparent and adaptive.

Flexible services
"In some ways I think, until recently, government and other cloud adoption was very dependent on the large enterprises software vendors. Business processes were ‘set in stone’ to a high degree and software licensing structures were similarly inflexible. In recent times, especially in the USA, state and federal agencies have been taking web applications and simply configuring them for their specific needs, notably in relation to offering services for mobile users and multiple devices."

He also points to enormously improved efficiencies and resilience of today’s private cloud architecture. "The physical scale required in data centres is down by 70% to 80%, on the one hand, while smart active/active processing offers really strong resilience. Converged infrastructure for all state ICT based on such technology and open source software would be powerful and highly efficient in cost and performance terms. But it would also be adaptive, flexible and capable of ongoing change and development as well as scaling.

"But all of that is just technology and it is improving all the time. The real focus then can be on the SLAs, business rules, appropriate levels of performance and security and of course the many areas of governance that are so important in the public sector."

 

* Local Government Computer Services Board, Local Government Management Services Board, soon to be amalgamated as the Local Government Management Agency (LGMA) on foot of rationalisation announced in Budget 2008.

RELATED ARTICLES
#mc_embed_signup{background:#fff; false;clear:left; font:14px Helvetica,Arial,sans-serif; width: px;} /* Add your own Mailchimp form style overrides in your site stylesheet or in this style block. We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
Sign up for the
Technology Minute
(function($) {window.fnames = new Array(); window.ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]='MMERGE2';ftypes[2]='text';fnames[3]='MMERGE3';ftypes[3]='text';fnames[4]='MMERGE4';ftypes[4]='text';fnames[5]='SIGNUP';ftypes[5]='text';fnames[6]='MMERGE6';ftypes[6]='imageurl';}(jQuery));var $mcj = jQuery.noConflict(true); // SMS Phone Multi-Country Functionality if(!window.MC) { window.MC = {}; } window.MC.smsPhoneData = { defaultCountryCode: 'IE', programs: [], smsProgramDataCountryNames: [] }; function getCountryUnicodeFlag(countryCode) { return countryCode.toUpperCase().replace(/./g, (char) => String.fromCodePoint(char.charCodeAt(0) + 127397)) }; // HTML sanitization function to prevent XSS function sanitizeHtml(str) { if (typeof str !== 'string') return ''; return str .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"') .replace(/'/g, ''') .replace(/\//g, '/'); } // URL sanitization function to prevent javascript: and data: URLs function sanitizeUrl(url) { if (typeof url !== 'string') return ''; const trimmedUrl = url.trim().toLowerCase(); if (trimmedUrl.startsWith('javascript:') || trimmedUrl.startsWith('data:') || trimmedUrl.startsWith('vbscript:')) { return '#'; } return url; } const getBrowserLanguage = () => { if (!window?.navigator?.language?.split('-')[1]) { return window?.navigator?.language?.toUpperCase(); } return window?.navigator?.language?.split('-')[1]; }; // getBrowserLanguageCode() and getSmsProgramForCountryAndLanguage() are provided globally // by the external mc-sms-phone.js script loaded alongside this inline form script. function getDefaultCountryProgram(defaultCountryCode, smsProgramData) { if (!smsProgramData || smsProgramData.length === 0) { return null; } var browserCountryCode = getBrowserLanguage(); var browserLangCode = getBrowserLanguageCode(); if (browserCountryCode) { var match = getSmsProgramForCountryAndLanguage(smsProgramData, browserCountryCode, browserLangCode); if (match) { return match; } } if (defaultCountryCode) { var match = getSmsProgramForCountryAndLanguage(smsProgramData, defaultCountryCode, browserLangCode); if (match) { return match; } } return smsProgramData[0]; } function updateSmsLegalText(countryCode, fieldName) { if (!countryCode || !fieldName) { return; } var programs = window?.MC?.smsPhoneData?.programs; if (!programs || !Array.isArray(programs)) { return; } var browserLangCode = getBrowserLanguageCode(); var program = getSmsProgramForCountryAndLanguage(programs, countryCode, browserLangCode); if (!program || !program.requiredTemplate) { return; } var smsConsentHtmlRenderingFixEnabled = true; const legalTextElement = document.querySelector('#legal-text-' + fieldName); if (!legalTextElement) { return; } const divRegex = new RegExp(']*>', 'gi'); const blockWrapperRegex = new RegExp(']*>', 'gi'); const fullAnchorRegex = new RegExp('<a.*?', 'g'); const anchorRegex = new RegExp('(.*?)'); const template = smsConsentHtmlRenderingFixEnabled ? program.requiredTemplate .replace(/\s*

]*>/gi, ' ') .replace(blockWrapperRegex, '') : program.requiredTemplate.replace(divRegex, ''); legalTextElement.textContent = ''; const parts = template.split(/(.*?)/g); parts.forEach(function(part) { if (!part) { return; } const anchorMatch = part.match(/(.+?)/); if (anchorMatch) { const linkElement = document.createElement('a'); linkElement.href = sanitizeUrl(anchorMatch[1]); linkElement.target = anchorMatch[2] ? sanitizeHtml(anchorMatch[2]) : '_blank'; linkElement.rel = 'noopener noreferrer'; linkElement.textContent = sanitizeHtml(anchorMatch[3]); legalTextElement.appendChild(linkElement); } else { legalTextElement.appendChild(document.createTextNode(part)); } }); } function generateDropdownOptions(smsProgramData) { if (!smsProgramData || smsProgramData.length === 0) { return ''; } var programs = true ? smsProgramData.filter(function(p, i, arr) { return arr.findIndex(function(q) { return q.countryCode === p.countryCode; }) === i; }) : smsProgramData; return programs.map(program => { const flag = getCountryUnicodeFlag(program.countryCode); const countryName = getCountryName(program.countryCode); const callingCode = program.countryCallingCode || ''; // Sanitize all values to prevent XSS const sanitizedCountryCode = sanitizeHtml(program.countryCode || ''); const sanitizedCountryName = sanitizeHtml(countryName || ''); const sanitizedCallingCode = sanitizeHtml(callingCode || ''); return '' + sanitizedCountryName + ' ' + sanitizedCallingCode + ''; }).join(''); } function getCountryName(countryCode) { if (window.MC?.smsPhoneData?.smsProgramDataCountryNames && Array.isArray(window.MC.smsPhoneData.smsProgramDataCountryNames)) { for (let i = 0; i < window.MC.smsPhoneData.smsProgramDataCountryNames.length; i++) { if (window.MC.smsPhoneData.smsProgramDataCountryNames[i].code === countryCode) { return window.MC.smsPhoneData.smsProgramDataCountryNames[i].name; } } } return countryCode; } function getDefaultPlaceholder(countryCode) { if (!countryCode || typeof countryCode !== 'string') { return '+1 000 000 0000'; // Default US placeholder } var mockPlaceholders = [ { countryCode: 'US', placeholder: '+1 000 000 0000', helpText: 'Include the US country code +1 before the phone number', }, { countryCode: 'GB', placeholder: '+44 0000 000000', helpText: 'Include the GB country code +44 before the phone number', }, { countryCode: 'CA', placeholder: '+1 000 000 0000', helpText: 'Include the CA country code +1 before the phone number', }, { countryCode: 'AU', placeholder: '+61 000 000 000', helpText: 'Include the AU country code +61 before the phone number', }, { countryCode: 'DE', placeholder: '+49 000 0000000', helpText: 'Fügen Sie vor der Telefonnummer die DE-Ländervorwahl +49 ein', }, { countryCode: 'FR', placeholder: '+33 0 00 00 00 00', helpText: 'Incluez le code pays FR +33 avant le numéro de téléphone', }, { countryCode: 'ES', placeholder: '+34 000 000 000', helpText: 'Incluya el código de país ES +34 antes del número de teléfono', }, { countryCode: 'NL', placeholder: '+31 0 00000000', helpText: 'Voeg de NL-landcode +31 toe vóór het telefoonnummer', }, { countryCode: 'BE', placeholder: '+32 000 00 00 00', helpText: 'Incluez le code pays BE +32 avant le numéro de téléphone', }, { countryCode: 'CH', placeholder: '+41 00 000 00 00', helpText: 'Fügen Sie vor der Telefonnummer die CH-Ländervorwahl +41 ein', }, { countryCode: 'AT', placeholder: '+43 000 000 0000', helpText: 'Fügen Sie vor der Telefonnummer die AT-Ländervorwahl +43 ein', }, { countryCode: 'IE', placeholder: '+353 00 000 0000', helpText: 'Include the IE country code +353 before the phone number', }, { countryCode: 'IT', placeholder: '+39 000 000 0000', helpText: 'Includere il prefisso internazionale IT +39 prima del numero di telefono', }, { countryCode: 'NO', placeholder: '+47 000 00 000', helpText: 'Inkluder NO landskode +47 før telefonnummeret', }, { countryCode: 'SE', placeholder: '+46 00 000 00 00', helpText: 'Inkludera SE landskod +46 före telefonnumret', }, { countryCode: 'DK', placeholder: '+45 00 00 00 00', helpText: 'Inkluder DK landekode +45 før telefonnummeret', }, { countryCode: 'FI', placeholder: '+358 00 000 0000', helpText: 'Sisällytä FI-maakoodi +358 ennen puhelinnumeroa', }, { countryCode: 'EE', placeholder: '+372 0000 0000', helpText: 'Lisage EE riigikood +372 telefoninumbri ette', }, { countryCode: 'PL', placeholder: '+48 000 000 000', helpText: 'Podaj numer kierunkowy PL +48 przed numerem telefonu', }, { countryCode: 'SK', placeholder: '+421 000 000 000', helpText: 'Pred telefónne číslo uveďte kód krajiny SK +421', }, { countryCode: 'LV', placeholder: '+371 0000 0000', helpText: 'Iekļaujiet LV valsts kodu +371 pirms tālruņa numura', }, { countryCode: 'LT', placeholder: '+370 0000 0000', helpText: 'Įtraukite LT šalies kodą +370 prieš telefono numerį', }, { countryCode: 'GR', placeholder: '+30 000 000 0000', helpText: 'Συμπεριλάβετε τον κωδικό χώρας GR +30 πριν από τον αριθμό τηλεφώνου', }, { countryCode: 'PT', placeholder: '+351 000 000 000', helpText: 'Inclua o código de país PT +351 antes do número de telefone', }, { countryCode: 'HR', placeholder: '+385 00 000 0000', helpText: 'Uključite HR pozivni broj države +385 prije telefonskog broja', }, { countryCode: 'SI', placeholder: '+386 00 000 000', helpText: 'Vključite SI kodo države +386 pred telefonsko številko', }, { countryCode: 'IS', placeholder: '+354 000 0000', helpText: 'Láttu IS landsnúmer +354 fylgja á undan símanúmerinu', }, { countryCode: 'LU', placeholder: '+352 000 000 000', helpText: 'Incluez le code pays LU +352 avant le numéro de téléphone', }, { countryCode: 'MC', placeholder: '+377 00 00 00 00', helpText: 'Incluez le code pays MC +377 avant le numéro de téléphone', }, { countryCode: 'AD', placeholder: '+376 000 000', helpText: 'Incloeu el codi de país AD +376 abans del número de telèfon', }, { countryCode: 'JE', placeholder: '+44 0000 000000', helpText: 'Include the JE country code +44 before the phone number', }, { countryCode: 'IM', placeholder: '+44 0000 000000', helpText: 'Include the IM country code +44 before the phone number', }, { countryCode: 'GG', placeholder: '+44 0000 000000', helpText: 'Include the GG country code +44 before the phone number', }, { countryCode: 'AL', placeholder: '+355 00 000 0000', helpText: 'Përfshini kodin e vendit AL +355 para numrit të telefonit', }, { countryCode: 'SM', placeholder: '+378 0000 000000', helpText: 'Includere il prefisso internazionale SM +378 prima del numero di telefono', }, { countryCode: 'FO', placeholder: '+298 000000', helpText: 'Inkluder FO landekode +298 før telefonnummeret', }, { countryCode: 'MT', placeholder: '+356 0000 0000', helpText: 'Include the MT country code +356 before the phone number', }, { countryCode: 'LI', placeholder: '+423 000 0000', helpText: 'Fügen Sie vor der Telefonnummer die LI-Ländervorwahl +423 ein', }, { countryCode: 'GI', placeholder: '+350 000 00000', helpText: 'Include the GI country code +350 before the phone number', }, { countryCode: 'MD', placeholder: '+373 00 000 000', helpText: 'Includeți codul de țară MD +373 înaintea numărului de telefon', }, { countryCode: 'HU', placeholder: '+36 00 000 0000', helpText: 'A telefonszám előtt adja meg a HU országkódot +36', }, { countryCode: 'NZ', placeholder: '+64 00 000 0000', helpText: 'Include the NZ country code +64 before the phone number', }, { countryCode: 'ME', placeholder: '+382 00 000 000', helpText: 'Uključite ME pozivni broj države +382 prije telefonskog broja', }, ]; const selectedPlaceholder = mockPlaceholders.find(function(item) { return item && item.countryCode === countryCode; }); return selectedPlaceholder ? selectedPlaceholder.placeholder : mockPlaceholders[0].placeholder; } function updatePlaceholder(countryCode, fieldName) { if (!countryCode || !fieldName) { return; } const phoneInput = document.querySelector('#mce-' + fieldName); if (!phoneInput) { return; } const placeholder = getDefaultPlaceholder(countryCode); if (placeholder) { phoneInput.placeholder = placeholder; } } function updateCountryCodeInstruction(countryCode, fieldName) { updatePlaceholder(countryCode, fieldName); } function getDefaultHelpText(countryCode) { var mockPlaceholders = [ { countryCode: 'US', placeholder: '+1 000 000 0000', helpText: 'Include the US country code +1 before the phone number', }, { countryCode: 'GB', placeholder: '+44 0000 000000', helpText: 'Include the GB country code +44 before the phone number', }, { countryCode: 'CA', placeholder: '+1 000 000 0000', helpText: 'Include the CA country code +1 before the phone number', }, { countryCode: 'AU', placeholder: '+61 000 000 000', helpText: 'Include the AU country code +61 before the phone number', }, { countryCode: 'DE', placeholder: '+49 000 0000000', helpText: 'Fügen Sie vor der Telefonnummer die DE-Ländervorwahl +49 ein', }, { countryCode: 'FR', placeholder: '+33 0 00 00 00 00', helpText: 'Incluez le code pays FR +33 avant le numéro de téléphone', }, { countryCode: 'ES', placeholder: '+34 000 000 000', helpText: 'Incluya el código de país ES +34 antes del número de teléfono', }, { countryCode: 'NL', placeholder: '+31 0 00000000', helpText: 'Voeg de NL-landcode +31 toe vóór het telefoonnummer', }, { countryCode: 'BE', placeholder: '+32 000 00 00 00', helpText: 'Incluez le code pays BE +32 avant le numéro de téléphone', }, { countryCode: 'CH', placeholder: '+41 00 000 00 00', helpText: 'Fügen Sie vor der Telefonnummer die CH-Ländervorwahl +41 ein', }, { countryCode: 'AT', placeholder: '+43 000 000 0000', helpText: 'Fügen Sie vor der Telefonnummer die AT-Ländervorwahl +43 ein', }, { countryCode: 'IE', placeholder: '+353 00 000 0000', helpText: 'Include the IE country code +353 before the phone number', }, { countryCode: 'IT', placeholder: '+39 000 000 0000', helpText: 'Includere il prefisso internazionale IT +39 prima del numero di telefono', }, { countryCode: 'NO', placeholder: '+47 000 00 000', helpText: 'Inkluder NO landskode +47 før telefonnummeret', }, { countryCode: 'SE', placeholder: '+46 00 000 00 00', helpText: 'Inkludera SE landskod +46 före telefonnumret', }, { countryCode: 'DK', placeholder: '+45 00 00 00 00', helpText: 'Inkluder DK landekode +45 før telefonnummeret', }, { countryCode: 'FI', placeholder: '+358 00 000 0000', helpText: 'Sisällytä FI-maakoodi +358 ennen puhelinnumeroa', }, { countryCode: 'EE', placeholder: '+372 0000 0000', helpText: 'Lisage EE riigikood +372 telefoninumbri ette', }, { countryCode: 'PL', placeholder: '+48 000 000 000', helpText: 'Podaj numer kierunkowy PL +48 przed numerem telefonu', }, { countryCode: 'SK', placeholder: '+421 000 000 000', helpText: 'Pred telefónne číslo uveďte kód krajiny SK +421', }, { countryCode: 'LV', placeholder: '+371 0000 0000', helpText: 'Iekļaujiet LV valsts kodu +371 pirms tālruņa numura', }, { countryCode: 'LT', placeholder: '+370 0000 0000', helpText: 'Įtraukite LT šalies kodą +370 prieš telefono numerį', }, { countryCode: 'GR', placeholder: '+30 000 000 0000', helpText: 'Συμπεριλάβετε τον κωδικό χώρας GR +30 πριν από τον αριθμό τηλεφώνου', }, { countryCode: 'PT', placeholder: '+351 000 000 000', helpText: 'Inclua o código de país PT +351 antes do número de telefone', }, { countryCode: 'HR', placeholder: '+385 00 000 0000', helpText: 'Uključite HR pozivni broj države +385 prije telefonskog broja', }, { countryCode: 'SI', placeholder: '+386 00 000 000', helpText: 'Vključite SI kodo države +386 pred telefonsko številko', }, { countryCode: 'IS', placeholder: '+354 000 0000', helpText: 'Láttu IS landsnúmer +354 fylgja á undan símanúmerinu', }, { countryCode: 'LU', placeholder: '+352 000 000 000', helpText: 'Incluez le code pays LU +352 avant le numéro de téléphone', }, { countryCode: 'MC', placeholder: '+377 00 00 00 00', helpText: 'Incluez le code pays MC +377 avant le numéro de téléphone', }, { countryCode: 'AD', placeholder: '+376 000 000', helpText: 'Incloeu el codi de país AD +376 abans del número de telèfon', }, { countryCode: 'JE', placeholder: '+44 0000 000000', helpText: 'Include the JE country code +44 before the phone number', }, { countryCode: 'IM', placeholder: '+44 0000 000000', helpText: 'Include the IM country code +44 before the phone number', }, { countryCode: 'GG', placeholder: '+44 0000 000000', helpText: 'Include the GG country code +44 before the phone number', }, { countryCode: 'AL', placeholder: '+355 00 000 0000', helpText: 'Përfshini kodin e vendit AL +355 para numrit të telefonit', }, { countryCode: 'SM', placeholder: '+378 0000 000000', helpText: 'Includere il prefisso internazionale SM +378 prima del numero di telefono', }, { countryCode: 'FO', placeholder: '+298 000000', helpText: 'Inkluder FO landekode +298 før telefonnummeret', }, { countryCode: 'MT', placeholder: '+356 0000 0000', helpText: 'Include the MT country code +356 before the phone number', }, { countryCode: 'LI', placeholder: '+423 000 0000', helpText: 'Fügen Sie vor der Telefonnummer die LI-Ländervorwahl +423 ein', }, { countryCode: 'GI', placeholder: '+350 000 00000', helpText: 'Include the GI country code +350 before the phone number', }, { countryCode: 'MD', placeholder: '+373 00 000 000', helpText: 'Includeți codul de țară MD +373 înaintea numărului de telefon', }, { countryCode: 'HU', placeholder: '+36 00 000 0000', helpText: 'A telefonszám előtt adja meg a HU országkódot +36', }, { countryCode: 'NZ', placeholder: '+64 00 000 0000', helpText: 'Include the NZ country code +64 before the phone number', }, { countryCode: 'ME', placeholder: '+382 00 000 000', helpText: 'Uključite ME pozivni broj države +382 prije telefonskog broja', }, ]; if (!countryCode || typeof countryCode !== 'string') { return mockPlaceholders[0].helpText; } const selectedHelpText = mockPlaceholders.find(function(item) { return item && item.countryCode === countryCode; }); return selectedHelpText ? selectedHelpText.helpText : mockPlaceholders[0].helpText; } function setDefaultHelpText(countryCode) { const helpTextSpan = document.querySelector('#help-text'); if (!helpTextSpan) { return; } } function updateHelpTextCountryCode(countryCode, fieldName) { if (!countryCode || !fieldName) { return; } setDefaultHelpText(countryCode); } function initializeSmsPhoneDropdown(fieldName) { if (!fieldName || typeof fieldName !== 'string') { return; } const dropdown = document.querySelector('#country-select-' + fieldName); const displayFlag = document.querySelector('#flag-display-' + fieldName); if (!dropdown || !displayFlag) { return; } const smsPhoneData = window.MC?.smsPhoneData; if (smsPhoneData && smsPhoneData.programs && Array.isArray(smsPhoneData.programs)) { dropdown.innerHTML = generateDropdownOptions(smsPhoneData.programs); } const defaultProgram = getDefaultCountryProgram(smsPhoneData?.defaultCountryCode, smsPhoneData?.programs); if (defaultProgram && defaultProgram.countryCode) { dropdown.value = defaultProgram.countryCode; const flagSpan = displayFlag?.querySelector('#flag-emoji-' + fieldName); if (flagSpan) { flagSpan.textContent = getCountryUnicodeFlag(defaultProgram.countryCode); flagSpan.setAttribute('aria-label', sanitizeHtml(defaultProgram.countryCode) + ' flag'); } updateSmsLegalText(defaultProgram.countryCode, fieldName); updatePlaceholder(defaultProgram.countryCode, fieldName); updateCountryCodeInstruction(defaultProgram.countryCode, fieldName); } var smsNotRequiredRemoveCountryCodeEnabled = true; var smsField = Object.values({"EMAIL":{"name":"EMAIL","label":"Email Address","helper_text":"","type":"email","required":true,"audience_field_name":"Email Address","merge_id":0,"help_text_enabled":false,"enabled":true,"order":0,"field_type":"merge"},"FNAME":{"name":"FNAME","label":"First Name","helper_text":"","type":"text","required":false,"audience_field_name":"First Name","enabled":false,"order":null,"field_type":"merge","merge_id":1},"MMERGE2":{"name":"MMERGE2","label":"Second Name","helper_text":"","type":"text","required":false,"audience_field_name":"Second Name","enabled":false,"order":null,"field_type":"merge","merge_id":2},"MMERGE3":{"name":"MMERGE3","label":"Company Name","helper_text":"","type":"text","required":false,"audience_field_name":"Company Name","enabled":false,"order":null,"field_type":"merge","merge_id":3},"MMERGE4":{"name":"MMERGE4","label":"Job Title","helper_text":"","type":"text","required":false,"audience_field_name":"Job Title","enabled":false,"order":null,"field_type":"merge","merge_id":4},"SIGNUP":{"name":"SIGNUP","label":"Signup form location","helper_text":"","type":"text","required":false,"audience_field_name":"Signup form location","enabled":false,"order":null,"field_type":"merge","merge_id":5},"MMERGE6":{"name":"MMERGE6","label":"Image URL","helper_text":"","type":"imageurl","required":false,"audience_field_name":"Image URL","enabled":false,"order":null,"field_type":"merge","merge_id":6}}).find(function(f) { return f.name === fieldName && f.type === 'smsphone'; }); var isRequired = smsField ? smsField.required : false; var shouldAppendCountryCode = smsNotRequiredRemoveCountryCodeEnabled ? isRequired : true; var phoneInput = document.querySelector('#mce-' + fieldName); if (phoneInput && defaultProgram.countryCallingCode && shouldAppendCountryCode) { phoneInput.value = defaultProgram.countryCallingCode; } displayFlag?.addEventListener('click', function(e) { dropdown.focus(); }); dropdown?.addEventListener('change', function() { const selectedCountry = this.value; if (!selectedCountry || typeof selectedCountry !== 'string') { return; } const flagSpan = displayFlag?.querySelector('#flag-emoji-' + fieldName); if (flagSpan) { flagSpan.textContent = getCountryUnicodeFlag(selectedCountry); flagSpan.setAttribute('aria-label', sanitizeHtml(selectedCountry) + ' flag'); } const selectedProgram = window.MC?.smsPhoneData?.programs.find(function(program) { return program && program.countryCode === selectedCountry; }); var smsNotRequiredRemoveCountryCodeEnabled = true; var smsField = Object.values({"EMAIL":{"name":"EMAIL","label":"Email Address","helper_text":"","type":"email","required":true,"audience_field_name":"Email Address","merge_id":0,"help_text_enabled":false,"enabled":true,"order":0,"field_type":"merge"},"FNAME":{"name":"FNAME","label":"First Name","helper_text":"","type":"text","required":false,"audience_field_name":"First Name","enabled":false,"order":null,"field_type":"merge","merge_id":1},"MMERGE2":{"name":"MMERGE2","label":"Second Name","helper_text":"","type":"text","required":false,"audience_field_name":"Second Name","enabled":false,"order":null,"field_type":"merge","merge_id":2},"MMERGE3":{"name":"MMERGE3","label":"Company Name","helper_text":"","type":"text","required":false,"audience_field_name":"Company Name","enabled":false,"order":null,"field_type":"merge","merge_id":3},"MMERGE4":{"name":"MMERGE4","label":"Job Title","helper_text":"","type":"text","required":false,"audience_field_name":"Job Title","enabled":false,"order":null,"field_type":"merge","merge_id":4},"SIGNUP":{"name":"SIGNUP","label":"Signup form location","helper_text":"","type":"text","required":false,"audience_field_name":"Signup form location","enabled":false,"order":null,"field_type":"merge","merge_id":5},"MMERGE6":{"name":"MMERGE6","label":"Image URL","helper_text":"","type":"imageurl","required":false,"audience_field_name":"Image URL","enabled":false,"order":null,"field_type":"merge","merge_id":6}}).find(function(f) { return f.name === fieldName && f.type === 'smsphone'; }); var isRequired = smsField ? smsField.required : false; var shouldAppendCountryCode = smsNotRequiredRemoveCountryCodeEnabled ? isRequired : true; var phoneInput = document.querySelector('#mce-' + fieldName); if (phoneInput && selectedProgram.countryCallingCode && shouldAppendCountryCode) { phoneInput.value = selectedProgram.countryCallingCode; } updateSmsLegalText(selectedCountry, fieldName); updatePlaceholder(selectedCountry, fieldName); updateCountryCodeInstruction(selectedCountry, fieldName); }); } document.addEventListener('DOMContentLoaded', function() { const smsPhoneFields = document.querySelectorAll('[id^="country-select-"]'); smsPhoneFields.forEach(function(dropdown) { const fieldName = dropdown?.id.replace('country-select-', ''); initializeSmsPhoneDropdown(fieldName); }); });

- Advertisment -

Most Popular