CINXE.COM

Profile

<!DOCTYPE html> <html> <head> <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta charset="UTF-8"> <meta name="format-detection" content="telephone=no"> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-EZMNMBHGXD"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-EZMNMBHGXD'); </script> <!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-5V5MNW9');</script> <!-- End Google Tag Manager --> <title>Profile</title> <!-- Dev Express CSS --> <link rel="stylesheet" href="https://cdn3.devexpress.com/jslib/22.1.3/css/dx.light.css"> <link rel="stylesheet" href="https://cdn3.devexpress.com/jslib/22.1.3/css/dx.light.compact.css"> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous"> <!-- integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" --> <link rel="stylesheet" type="text/css" href="/staticfiles/lop/assets/css/parlinfo_style.css"> <link rel="stylesheet" type="text/css" href="/staticfiles/lop/assets/css/parlinfo_header.css"> <link rel="stylesheet" type="text/css" href="/staticfiles/lop/assets/css/parlinfo_footer.css"> <link rel="stylesheet" type="text/css" href="/staticfiles/lop/assets/css/parlinfo_PageContents.css"> <link rel="stylesheet" type="text/css" href="/staticfiles/lop/assets/css/tables.css"> <link rel="stylesheet" type="text/css" href="/staticfiles/lop/assets/css/Forms.css"> <link rel="stylesheet" type="text/css" href="/staticfiles/lop/assets/css/parlinfo_responsive.css"> <link rel="stylesheet" type="text/css" href="/staticfiles/lop/assets/css/parlinfo_header_print.css" media="print"> <link rel="stylesheet" type="text/css" href="/staticfiles/lop/assets/css/parlinfo_footer_print.css" media="print"> <link rel="stylesheet" type="text/css" href="/staticfiles/lop/assets/css/parlinfo_pageContents_print.css" media="print"> <link rel="stylesheet" type="text/css" media="screen" href="/Common/Parl/Styles/ce-lop-main.min.css" /> <link rel="stylesheet" type="text/css" media="screen" href="/Common/Parl/Styles/ParlWebsite.css" /> <link rel="stylesheet" type="text/css" href="/staticfiles/lop/assets/css/parlinfo_mainsearch.css"> </head> <body> <!-- jQuery needed for DevExtreme --> <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script> <!-- JSZIP needed for the export feature of the devextreme grid --> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.7.1/jszip.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.4.0/polyfill.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/exceljs/4.1.1/exceljs.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.2/FileSaver.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.0.0/jspdf.umd.js"></script> <!-- Dev Extreme --> <script type="text/javascript" src="https://cdn3.devexpress.com/jslib/22.1.3/js/dx.all.js"></script> <!-- Localized in French --> <!--script type="text/javascript" src="https://cdn3.devexpress.com/jslib/22.1.3/js/localization/dx.messages.fr.js"></script--> <script type="text/javascript" src="/staticfiles/lop/assets/js/DevExpress/22.1.3/dx.messages.fr.js"></script> <!-- Boot strap --> <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script> <!-- integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" --> <script type="text/javascript" src="/staticfiles/lop/assets/js/vfs_fonts.js"></script> <script type="text/javascript" src="/staticfiles/lop/assets/js/CommonFunctions.js"></script> <!-- Header - Start --> <div class="LOPHeaderContainer"> <!-- Skip to Content --> <a href="#StartofContent" class="ce-lop-skipnav sr-only sr-only-focusable __web-inspector-hide-shortcut__">Skip to main content</a> <!--LOP Header English --> <div role="banner" class="ce-lop-header hidden-print"> <div class="container"> <a href="http://www.parl.ca" target="_blank" class="ce-lop-btn pull-left">Parliament of Canada</a> <ul class="pull-right"> <li role="menuitem"> <a href="https://visit.parl.ca/sites/Visit/default/en_CA" class="ce-lop-btn-visit"> <span class="hidden-xs">Visit Parliament</span> <span class="visible-xs">Visit</span> </a> </li> <li role="menuitem"> <a id="parlwebsite-language-link" href="/sites/ParlInfo/default/fr_CA/Personnes/Profil?personId=20220" class="ce-lop-btn-visit"> <span class="hidden-xs">Fran&ccedil;ais</span> <span class="visible-xs">FR</span> </a> </li> </ul> </div> </div> <!-- Parl Navigation --> <nav role="navigation" class="ce-lop-nav hidden-print"> <div class="container"> <div class="row"> <div class="col-sm-12"> <ul class="ce-lop-nav-list"> <li><a href="https://www.sencanada.ca/en" target="_blank" class="ce-lop-nav-senate-link">Senate</a></li> <li><a href="http://www.ourcommons.ca" target="_blank" class="ce-lop-nav-hoc-link">House of Commons</a></li> </ul> </div> </div> </div> </nav> </div><!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5V5MNW9" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --><!-- Header - End --> <div id="parlinfo_headerrow2" class="clearfix"> <div class="container"> <h1 class="pull-left"><a href="/sites/ParlInfo/default/en_CA/">Parlinfo</a></h1> </div> </div> <div class="clearfix"></div> <nav class="navbar navbar-default"> <div class="container container-fluid"> <div> <ul class="hidden-sm hidden-xs nav navbar-nav parlinfo_defaultfontbs"> <li class="dropdown active"><a class="dropdown-toggle" href="/sites/ParlInfo/default/en_CA/People">People</a> <ul class="dropdown-menu parlinfo_defaultfontsm"> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/People/governorGeneral">Governors General</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/People/primeMinisters">Prime Ministers of Canada</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/People/PMOLeadership">Leadership of the Prime Minister's Office</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/People/LeadersOfficialOpposition">Leaders of the Official Opposition</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/People/parliamentarians">Parliamentarians</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/People/committeeMembers">Parliamentary Committee Membership</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/People/Salaries">Indemnities, Salaries and Allowances</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/People/senatorsPrimeMinisters">Senators appointed on the advice of the Prime Minister</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/People/Cabinet">Size of Ministries</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/People/OfficersParliament">Officers and Officials of Parliament</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/People/visitors">Visiting Dignitaries</a> </li> </ul> </li> <li class="dropdown "><a class="dropdown-toggle" href="/sites/ParlInfo/default/en_CA/Parliament">Parliament</a> <ul class="dropdown-menu parlinfo_defaultfontsm"> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/Parliament/Parliaments">Parliaments</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/Parliament/parliamentsSessions">Parliaments and Sessions</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/Parliament/SittingsByYear">Sittings by Calendar Year</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/Parliament/throneSpeech">Speeches from the Throne</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/Parliament/budgets">Budgets</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/Parliament/defeatsElection">Votes in the House of Commons That Led to a Federal Election</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/Parliament/recordedVotes">Recorded Votes in the House of Commons</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/People/OfficersParliament">Officers and Officials of Parliament</a> </li> </ul> </li> <li class="dropdown "><a class="dropdown-toggle" href="/sites/ParlInfo/default/en_CA/Federal">Departments and Committees</a> <ul class="dropdown-menu parlinfo_defaultfontsm"> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/Federal/areasResponsibility">Departments and Roles 1867 - Today</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/People/committeeMembers">Parliamentary Committee Membership</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/Federal/committeeReports">Select List of Substantive Committee Reports</a> </li> </ul> </li> <li class="dropdown "><a class="dropdown-toggle" href="/sites/ParlInfo/default/en_CA/Parties">Political Parties</a> <ul class="dropdown-menu parlinfo_defaultfontsm"> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/Parties/politicalPartiesLeaders">Political Parties and Leaders</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/Parties/partyOfficersExecutives">Officers of Party Caucuses and Executives of Federal Political Parties</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/Parties/partyStandings">Current Party Standings</a> </li> </ul> </li> <li class="dropdown "><a class="dropdown-toggle" href="/sites/ParlInfo/default/en_CA/legislation">Legislation</a> <ul class="dropdown-menu parlinfo_defaultfontsm"> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/legislation/TableOfLegislation">Table of Legislation</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/legislation/privateMembersBills">Private Members' Public Bills Passed by Parliament</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/legislation/billsAmendedSenate">Bills Introduced in the House of Commons and Amended by the Senate</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/legislation/senateBillsNotPassed">Senate bills not passed by Senate</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/legislation/royalConsent">Royal Consent to Bills</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/legislation/backToWork">Federal Back-to-Work Legislation</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/legislation/preStudy">Pre-Study of House of Commons Bills by Senate Committees</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/legislation/legalMeasuresDistricts">Legal Measures Governing Changes in Federal Electoral Districts </a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/legislation/otherNoRoyalAssent">Bills Sent to Other House that did not Receive Royal Assent</a> </li> </ul> </li> <li class="dropdown "><a class="dropdown-toggle" href="/sites/ParlInfo/default/en_CA/ElectionsRidings">Elections and Ridings</a> <ul class="dropdown-menu parlinfo_defaultfontsm"> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/ElectionsRidings/Elections">Elections and Candidates</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/ElectionsRidings/electionsElectedCandidates">Elections and Elected Candidates</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/ElectionsRidings/womenCandidatesOverview">Women Candidates in General Elections - Overview</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/ElectionsRidings/womenCandidates">Women Candidates in General Elections</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/ElectionsRidings/womenVote">Women's Right to Vote in Canada</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/ElectionsRidings/incumbentsRan">Incumbents who did seek re-election at the next General Election</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/ElectionsRidings/IncumentsDidNoSeek">Incumbents who did not seek re-election at the next General Election</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/ElectionsRidings/Ridings">Ridings</a> </li> <li class="dropdown-submenu"> <a class="dropdown-toggle" target="_self" href="/sites/ParlInfo/default/en_CA/legislation/legalMeasuresDistricts">Legal Measures Governing Changes in Federal Electoral Districts</a> </li> </ul> </li> </ul> <!-- Mobile MENU --> <div class="mobile visible-sm visible-xs" ><a class="hamburger-menu" href="#"><img src="/staticfiles/PublicWebsite/assets/images/Header/icon-mobile-menu.png" /></a></div> <ul class="mobile visible-sm visible-xs nav float-left navbar-nav parlinfo_defaultfontsm"> <li class="mobile-menu-item" style="display:none"><a class="" href="/sites/ParlInfo/default/en_CA/People">People</a></li> <li class="mobile-menu-item" style="display:none"><a class="" href="/sites/ParlInfo/default/en_CA/Parliament">Parliament</a></li> <li class="mobile-menu-item" style="display:none"><a class="" href="/sites/ParlInfo/default/en_CA/Federal">Departments and Committees</a></li> <li class="mobile-menu-item" style="display:none"><a class="" href="/sites/ParlInfo/default/en_CA/Parties">Political Parties</a></li> <li class="mobile-menu-item" style="display:none"><a class="" href="/sites/ParlInfo/default/en_CA/legislation">Legislation</a></li> <li class="mobile-menu-item" style="display:none"><a class="" href="/sites/ParlInfo/default/en_CA/ElectionsRidings">Elections and Ridings</a></li> </ul> </div> </div> </nav> <script type="text/javascript"> $(document).ready(function () { //Toggle Search and Share Bars from the Menubar $('.hamburger-menu').on('click', function () { $(".mobile-menu-item").slideToggle(); }); //prevent click on a with no-link $('a.no-link').on('click', function (e) { e.preventDefault(); }); var link = !!document.querySelector("link[rel='canonical']") ? document.querySelector("link[rel='canonical']") : document.createElement('link'); link.setAttribute('rel', 'canonical'); link.setAttribute('href', window.location.href); document.head.appendChild(link); }); </script> <div class="breadcrumb_container"> <ol class="breadcrumb"> <li > <a href="/sites/ParlInfo/default/en_CA/">Home</a> </li> <li > <a href="/sites/ParlInfo/default/en_CA/People">People</a> </li> <li class="active">Profile</li> </ol> </div> <div style="clear:left">&nbsp;</div> <div id="parlinfo_contentwrapper_wide"> <div id="parlinfo_middlesection"> <div class="parlinfo_contentplaceholder"> <div class="row"> <div class="col-sm-12 col-md-12"> <div id="lopi_middlesection"> <script type="text/javascript"> var envURL = "http://lopdev.parl.ca"; var envEnglish = "en_CA"; var envFrench = "fr_CA"; var envLanguage = envEnglish; //Get Environment if (window.location.href.toLowerCase().indexOf("lopdev.") !== -1 || window.location.href.toLowerCase().indexOf("lpbpwemdev") !== -1) { envURL = "https://lopdev.parl.ca"; } else if (window.location.href.toLowerCase().indexOf("bdpdev.") !== -1) { envURL = "https://bdpdev.parl.ca"; } else if (window.location.href.toLowerCase().indexOf("loptest.") !== -1 || window.location.href.toLowerCase().indexOf("lpbpwemtest") !== -1) { envURL = "https://loptest.parl.ca"; } else if (window.location.href.toLowerCase().indexOf("bdptest.") !== -1) { envURL = "https://bdptest.parl.ca"; } else if (window.location.href.toLowerCase().indexOf("lop.") !== -1 || window.location.href.toLowerCase().indexOf("lpbpwem") !== -1) { envURL = "https://lop.parl.ca"; } else if (window.location.href.toLowerCase().indexOf("bdp.") !== -1) { envURL = "https://bdp.parl.ca"; } else if (window.location.href.toLowerCase().indexOf("librarydev") !== -1) { envURL = "https://librarydev.parl.gc.ca"; } else if (window.location.href.toLowerCase().indexOf("librarytest") !== -1) { envURL = "https://librarytest.parl.gc.ca"; } else if (window.location.href.toLowerCase().indexOf("library") !== -1) { envURL = "https://library.parl.gc.ca"; } else if (window.location.href.toLowerCase().indexOf("biblio") !== -1) { envURL = "https://biblio.parl.gc.ca"; } //Get Current Language if (window.location.href.toLowerCase().indexOf(envFrench.toLowerCase()) !== -1) { var envLanguage = envFrench; } /*******************************************************/ //Get a QueryStringParameter /*******************************************************/ function getQuerystringParameter(param) { var queryParams = window.location.search.substr(1).split('&').reduce(function (q, query) { var chunks = query.split('='); var key = chunks[0]; var value = chunks[1]; return (q[key] = value, q); }, {}); var myParam = queryParams[param]; if (myParam != undefined) { return decodeURIComponent(myParam.toLowerCase()); } else { return ""; } } /*******************************************************/ //Get a value based on the current Language /*******************************************************/ function getLocalizedValue(en, fr) { if (envLanguage == envFrench) { return fr; } return en; } /*******************************************************/ //Check if the client is a search bot /*******************************************************/ function botCheck(){ var botPattern = "(googlebot\/|Googlebot-Mobile|Googlebot-Image|Google favicon|Mediapartners-Google|bingbot|slurp|java|wget|curl|Commons-HttpClient|Python-urllib|libwww|httpunit|nutch|phpcrawl|msnbot|jyxobot|FAST-WebCrawler|FAST Enterprise Crawler|biglotron|teoma|convera|seekbot|gigablast|exabot|ngbot|ia_archiver|GingerCrawler|webmon |httrack|webcrawler|grub.org|UsineNouvelleCrawler|antibot|netresearchserver|speedy|fluffy|bibnum.bnf|findlink|msrbot|panscient|yacybot|AISearchBot|IOI|ips-agent|tagoobot|MJ12bot|dotbot|woriobot|yanga|buzzbot|mlbot|yandexbot|purebot|Linguee Bot|Voyager|CyberPatrol|voilabot|baiduspider|citeseerxbot|spbot|twengabot|postrank|turnitinbot|scribdbot|page2rss|sitebot|linkdex|Adidxbot|blekkobot|ezooms|dotbot|Mail.RU_Bot|discobot|heritrix|findthatfile|europarchive.org|NerdByNature.Bot|sistrix crawler|ahrefsbot|Aboundex|domaincrawler|wbsearchbot|summify|ccbot|edisterbot|seznambot|ec2linkfinder|gslfbot|aihitbot|intelium_bot|facebookexternalhit|yeti|RetrevoPageAnalyzer|lb-spider|sogou|lssbot|careerbot|wotbox|wocbot|ichiro|DuckDuckBot|lssrocketcrawler|drupact|webcompanycrawler|acoonbot|openindexspider|gnam gnam spider|web-archive-net.com.bot|backlinkcrawler|coccoc|integromedb|content crawler spider|toplistbot|seokicks-robot|it2media-domain-crawler|ip-web-crawler.com|siteexplorer.info|elisabot|proximic|changedetection|blexbot|arabot|WeSEE:Search|niki-bot|CrystalSemanticsBot|rogerbot|360Spider|psbot|InterfaxScanBot|Lipperhey SEO Service|CC Metadata Scaper|g00g1e.net|GrapeshotCrawler|urlappendbot|brainobot|fr-crawler|binlar|SimpleCrawler|Livelapbot|Twitterbot|cXensebot|smtbot|bnf.fr_bot|A6-Indexer|ADmantX|Facebot|Twitterbot|OrangeBot|memorybot|AdvBot|MegaIndex|SemanticScholarBot|ltx71|nerdybot|xovibot|BUbiNG|Qwantify|archive.org_bot|Applebot|TweetmemeBot|crawler4j|findxbot|SemrushBot|yoozBot|lipperhey|y!j-asr|Domain Re-Animator Bot|AddThis)"; var re = new RegExp(botPattern, 'i'); var userAgent = navigator.userAgent; if (re.test(userAgent)) { return true; }else{ return false; } } </script> <link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet"> <script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script> <style> #PersonPic > img { position: relative; /*max-width: 230px; min-width: 230px; min-height: 330px; max-height: 330px; */ object-fit: cover; } #PersonPic { /*min-height: 330px; margin-bottom: 30px; */ position: relative; /*max-height: 370px; */ overflow: hidden; } /*Hide the Refresh Button for some Grid*/ #gridAdditionalInfo .dx-toolbar-button:nth-of-type(1), #gridFamily .dx-toolbar-button:nth-of-type(1) { width: 0px !important; height: 0px !important; padding: 0px !important; visibility: hidden !important; } </style> <div class="container"> <div class="row"> <div class="tab-content" id="PersonContent"> <div class="col-md-3 col-sm-4 col-xs-8" id="PersonPic">&nbsp;</div> <div class="col-md-9 col-sm-8 col-xs-12" id="PersonTitle">&nbsp;</div> <div class="col-md-6 col-sm-8 col-xs-12" id="PersonInfo">&nbsp;</div> <div class="col-md-3 hidden-sm hidden-xs" id="PersonLinks">&nbsp;</div> <div class="col-sm-12 col-xs-12"> <div style="padding-bottom: 5px; float: right;"><input data-off="Show All" data-on="Hide All" data-toggle="toggle" id="ViewCompleteFile" type="checkbox"></div> </div> <div class="col-sm-12 col-xs-12"> <div class="panel-group" id="accordion"> <div class="panel panel-default" id="ContactSection" style="display: none; margin-bottom: 10px;"> <div class="panel-heading" id="headingTen"> <h2 class="panel-title"><a aria-controls="collapseTen" aria-expanded="false" class="collapsed" data-toggle="collapse" href="#collapseTen" role="button">Contact Information </a></h2> </div> <div class="panel-collapse collapse" id="collapseTen"> <div class="panel-body"> <div id="ContactInfo">&nbsp;</div> </div> </div> </div> <div class="panel panel-default" id="FederalSection" style="display: none; margin-bottom: 10px;"> <div class="panel-heading" id="headingTwo"> <h2 class="panel-title"><a aria-controls="collapseTwo" aria-expanded="false" class="collapsed" data-toggle="collapse" href="#collapseTwo" role="button">Federal Political Experience </a></h2> </div> <div class="panel-collapse collapse" id="collapseTwo"> <div class="panel-body"> <div class="row"> <div class="col-sm-12 col-xs-12"> <div style="padding-bottom: 5px; float: right;"><input data-off="Parliament View" data-on="Role View" data-toggle="toggle" data-width="200" id="ViewFederalExperience" type="checkbox"></div> </div> </div> <div class="gridContainer" id="gridFederalExperienceList">&nbsp;</div> <div class="gridContainer" id="gridFederalExperience" style="display: none;">&nbsp;</div> </div> </div> </div> <div class="panel panel-default" id="FederalPublicOfficeSection" style="display: none; margin-bottom: 10px;"> <div class="panel-heading" id="headingEleven"> <h2 class="panel-title"><a aria-controls="collapseEleven" aria-expanded="false" class="collapsed" data-toggle="collapse" href="#collapseEleven" role="button">Federal Public Office </a></h2> </div> <div class="panel-collapse collapse" id="collapseEleven"> <div class="panel-body"> <div class="gridContainer" id="gridFederalPublicOffice">&nbsp;</div> </div> </div> </div> <div class="panel panel-default" id="CommitteeMembershipSection" style="display: none; margin-bottom: 10px;"> <div class="panel-heading" id="headingThree"> <h2 class="panel-title"><a aria-controls="collapseThree" aria-expanded="false" class="collapsed" data-toggle="collapse" href="#collapseThree" role="button">Committee </a></h2> </div> <div class="panel-collapse collapse" id="collapseThree"> <div class="panel-body"> <div class="rounded-info-block"> <p>Committee membership is shown below by session. All members who served on a committee at any time during a session are listed.</p> </div> <div class="gridContainer" id="gridCommitteeMembership">&nbsp;</div> </div> </div> </div> <div class="panel panel-default" id="ElectoralHistorySection" style="display: none; margin-bottom: 10px;"> <div class="panel-heading" id="headingOne"> <h2 class="panel-title"><a aria-controls="collapseOne" aria-expanded="false" class="collapsed" data-toggle="collapse" href="#collapseOne" role="button">Electoral History </a></h2> </div> <div class="panel-collapse collapse" id="collapseOne"> <div class="panel-body"> <div class="gridContainer" id="gridCandidates">&nbsp;</div> </div> </div> </div> <div class="panel panel-default" id="ProvincialSection" style="display: none; margin-bottom: 10px;"> <div class="panel-heading" id="headingFour"> <h2 class="panel-title"><a aria-controls="collapseFour" aria-expanded="false" class="collapsed" data-toggle="collapse" href="#collapseFour" role="button">Provincial / Territorial Experience </a></h2> </div> <div class="panel-collapse collapse" id="collapseFour"> <div class="panel-body"> <div class="gridContainer" id="gridProvincialExperience">&nbsp;</div> </div> </div> </div> <div class="panel panel-default" id="MunicipalSection" style="display: none; margin-bottom: 10px;"> <div class="panel-heading" id="headingFive"> <h2 class="panel-title"><a aria-controls="collapseFive" aria-expanded="false" class="collapsed" data-toggle="collapse" href="#collapseFive" role="button">Municipal Experience </a></h2> </div> <div class="panel-collapse collapse" id="collapseFive"> <div class="panel-body"> <div class="gridContainer" id="gridMunicipalExperience">&nbsp;</div> </div> </div> </div> <div class="panel panel-default" id="FamilyTiesSection" style="display: none; margin-bottom: 10px;"> <div class="panel-heading" id="headingSeven"> <h2 class="panel-title"><a aria-controls="collapseSeven" aria-expanded="false" class="collapsed" data-toggle="collapse" href="#collapseSeven" role="button">Family Ties in Parliament </a></h2> </div> <div class="panel-collapse collapse" id="collapseSeven"> <div class="panel-body"> <div class="gridContainer" id="gridFamily">&nbsp;</div> </div> </div> </div> <div class="panel panel-default" id="MilitarySection" style="display: none; margin-bottom: 10px;"> <div class="panel-heading" id="headingSix"> <h2 class="panel-title"><a aria-controls="collapseSix" aria-expanded="false" class="collapsed" data-toggle="collapse" href="#collapseSix" role="button">Military Service </a></h2> </div> <div class="panel-collapse collapse" id="collapseSix"> <div class="panel-body"> <div class="gridContainer" id="gridMilitary">&nbsp;</div> </div> </div> </div> </div> </div> </div> </div> <div class="row"> <div class="col-sm-12 visible-sm visible-xs" id="PersonLinksSmall">&nbsp;</div> </div> </div> <script type="text/javascript"> var personId = getQuerystringParameter("personId"); var PersonAltText = "Picture of "; var selectedLinksLabel = "Selected Links"; var hocAddresss = "House of Commons<br>Ottawa, Ontario<br>K1A 0A6<br>"; var senAddresss = "Senate of Canada<br>Ottawa, Ontario<br>K1A 0A4<br>"; var currentMemberFor = "Current Member of The House of Commons -&nbsp;"; var currentSenatorFor = "Current Senator -&nbsp;"; var currentMemberFeminineFor = "Current Member of The House of Commons -&nbsp;"; var currentSenatorFeminineFor = "Current Senator -&nbsp;"; var dateOfBirthLabel = "Date of Birth (yyyy-mm-dd):&nbsp;" ; var birthPlaceLabel = "Place of Birth:&nbsp;" ; var notesLabel = "Notes" ; var professionLabel = "Profession | Occupation:&nbsp;" ; var langPrefLabel = "Language Preference:&nbsp;" ; var deathDateLabel = "Date of Death (yyyy-mm-dd):&nbsp;" ; var diedInOffice = " (Died in Office)" var placeofBurialLabel = "Place of Burial:&nbsp;" ; var causeOfDeathLabel = "Cause of Death:&nbsp;" ; var yearsOfServiceLabel = "Years of Service:&nbsp;" ; var yearsOfServiceHouseLabel = "Service in House of Commons:&nbsp;" ; var yearsOfServiceSenateLabel = "Service in Senate:&nbsp;" ; var yearsLabel = "year(s)"; var monthsLabel = "month(s)"; var daysLabel = "day(s)"; var dayLabel = "days"; var phoneLabel = "Phone:&nbsp;"; var faxLabel = "Fax:&nbsp;"; var hillAddressLabel = "Parliamentary Address"; var constAddressLabel = "Constituency Address"; var emailLabel = "Email:&nbsp;"; var heritageLabel = "Heritage Information"; var mpLabel = "MP&nbsp;"; var senatorLabel = "Senator&nbsp;"; var mpFeminineLabel = "MP&nbsp;"; var senatorFeminineLabel = "Senator&nbsp;"; var photoNotAvailable = "Photo not available"; var unofficial = "pnlFileHeaderDraftE"; var draftProfile = "Draft Profile"; var PlaquesStatuesLabel = "Plaques, Statues, etc."; var PlacesBuildingsLabel = "Places, Buildings, etc. Named After Prime Minister"; var HistoricSitesLabel = "Historic Sites"; var HistoricSitesAddInfoLabel = ""; var DetailsOfInterestLabel = "Details of Interests"; var OtherInformationLabel ="Other Information"; var gridFederalExperienceDataSource; var gridFederalExperienceListDataSource; var gridFederalPublicOfficeDataSource; var gridCandidatesDataSource; var gridMilitaryDataSource; var gridFamilyDataSource; var gridPublicationsDataSource; var gridAdditionalInfoDataSource; var gridProvincialExperienceDataSource; var gridMunicipalExperienceDataSource; var gridCommitteeMembershipDataSource; var gender = ""; if (envLanguage == envFrench) { PersonAltText = "Photo de "; selectedLinksLabel = "Liens choisis"; hocAddresss = "Chambre des communes<br>Ottawa, Ontario<br>K1A 0A6<br>"; senAddresss = "S茅nat du Canada<br>Ottawa, Ontario<br>K1A 0A4<br>"; currentMemberFor = "D茅put茅 actuel -&nbsp;"; currentSenatorFor = "S茅nateur actuel -&nbsp;"; currentMemberFeminineFor = "D茅put茅e actuelle -&nbsp;"; currentSenatorFeminineFor = "S茅natrice actuelle -&nbsp;"; dateOfBirthLabel = "Date de naissance (aaaa-mm-jj) :&nbsp;" birthPlaceLabel = "Lieu de naissance :&nbsp;" notesLabel = "Notes" professionLabel = "Profession | Occupation :&nbsp;" langPrefLabel = "Pr茅f茅rence linguistique :&nbsp;" deathDateLabel = "Date de d茅c猫s (aaaa-mm-jj) :&nbsp;" diedInOffice = " (D茅c猫s en fonction)" placeofBurialLabel = "Lieu d'inhumation :&nbsp;" causeOfDeathLabel = "Cause de d茅c猫s :&nbsp;" yearsOfServiceLabel = "Ann茅e(s) de service :&nbsp;" yearsOfServiceHouseLabel = "Service 脿 la Cdc:&nbsp;" yearsOfServiceSenateLabel = "Service au S茅nat:&nbsp;" yearsLabel = "ann茅e(s)"; monthsLabel = "mois"; daysLabel = "jour(s)"; dayLabel = "jours"; phoneLabel = "T茅l茅phone :&nbsp;"; faxLabel = "T茅l茅copieur :&nbsp;"; hillAddressLabel = "Adresse parlementaire"; constAddressLabel = "Adresse de circonscription"; emailLabel = "Courriel :&nbsp;"; heritageLabel = "Renseignements patrimoniaux"; mpLabel = "D茅put茅&nbsp;"; senatorLabel = "S茅nateur&nbsp;"; mpFeminineLabel = "D茅put茅e&nbsp;"; senatorFeminineLabel = "S茅natrice&nbsp;"; photoNotAvailable = "Photo non disponible"; unofficial = "pnlFileHeaderDraftF"; draftProfile = "Profil pr茅liminaire"; PlaquesStatuesLabel = "Plaques, Statues, etc."; PlacesBuildingsLabel = "Endroits, 茅difices, etc. nomm茅s en son honneur"; HistoricSitesLabel = "Lieux historiques"; HistoricSitesAddInfoLabel = ""; DetailsOfInterestLabel = "D茅tails int茅ressants"; OtherInformationLabel = "Autres renseignements"; } $(document).ready(function () { loadPersonProfile(personId); function loadMenu(profile) { $("#FederalSection").toggle( "slide" ); if (profile.Person.IsCurrentlyInOffice && (profile.Person.HillAddresses != null || profile.Person.ConstituencyAddresses != null)) { $("#ContactSection").toggle( "slide" ); } if (profile.PublicOfficeExperience != null) { $("#FederalPublicOfficeSection").toggle( "slide" ); } if (profile.Person.ElectionCandidates != null) { $("#ElectoralHistorySection").toggle( "slide" ); } if (profile.CommitteeMembership != null) { $("#CommitteeMembershipSection").toggle( "slide" ); } if (profile.ProvincialExperience != null) { $("#ProvincialSection").toggle( "slide" ); } if (profile.MunicipalExperience != null) { $("#MunicipalSection").toggle( "slide" ); } if (profile.MilitaryExperience != null) { $("#MilitarySection").toggle( "slide" ); } if (profile.FamilyTiesInParliament != null) { $("#FamilyTiesSection").toggle( "slide" ); } if (profile.Person.PrimeMinister != null) { $("#AdditionalInfoSection").toggle( "slide" ); } if (profile.Person.Bibliography != null) { $("#PublicationsSection").toggle( "slide" ); } if (botCheck() == true) { $("#gridFederalExperience").dxDataGrid("option","dataSource", gridFederalExperienceDataSource); $("#gridFederalExperienceList").dxDataGrid("option","dataSource", gridFederalExperienceListDataSource); $("#gridFederalPublicOffice").dxDataGrid("option","dataSource", gridFederalPublicOfficeDataSource); $("#gridProvincialExperience").dxDataGrid("option","dataSource", gridProvincialExperienceDataSource); $("#gridMunicipalExperience").dxDataGrid("option","dataSource", gridMunicipalExperienceDataSource); $("#gridMilitary").dxDataGrid("option","dataSource", gridMilitaryDataSource); $("#gridCommitteeMembership").dxDataGrid("option","dataSource", gridCommitteeMembershipDataSource); $("#gridCandidates").dxDataGrid("option","dataSource", gridCandidatesDataSource); $("#gridPublications").dxDataGrid("option","dataSource", gridPublicationsDataSource); $("#gridFamily").dxDataGrid("option","dataSource", gridFamilyDataSource); //$("#gridAdditionalInfo").dxDataGrid("option","dataSource", gridAdditionalInfoDataSource); $('#accordion .panel-collapse').collapse('show'); //Redraw Grids (bug / behavior of grid columns Auto-sizing) //$("#gridPublications").dxDataGrid("instance").refresh(false); $("#gridFederalExperience").dxDataGrid("instance").refresh(false); $("#gridFederalExperienceList").dxDataGrid("instance").refresh(false); $("#gridFederalPublicOffice").dxDataGrid("instance").refresh(false); $("#gridCommitteeMembership").dxDataGrid("instance").refresh(false); $("#gridCandidates").dxDataGrid("instance").refresh(false); $("#gridProvincialExperience").dxDataGrid("instance").refresh(false); $("#gridMunicipalExperience").dxDataGrid("instance").refresh(false); $("#gridFamily").dxDataGrid("instance").refresh(false); //$("#gridAdditionalInfo").dxDataGrid("instance").refresh(false); $("#gridMilitary").dxDataGrid("instance").refresh(false); $("#ViewCompleteFile").checked = true; } } /*Collapse All*/ $("#ViewCompleteFile").change(function() { if(this.checked == false) { $('#accordion .panel-collapse').collapse('hide'); } else { //Assing the data source. //Depending on the time required by the ajax call to get the data, sometimed the DevExpressSecondary Grid View load before causing the the grid to be empty. //This prevents the grid to be empty by assigning the datasource after the data call $("#gridFederalExperience").dxDataGrid("option","dataSource", gridFederalExperienceDataSource); $("#gridFederalExperienceList").dxDataGrid("option","dataSource", gridFederalExperienceListDataSource); $("#gridFederalPublicOffice").dxDataGrid("option","dataSource", gridFederalPublicOfficeDataSource); $("#gridProvincialExperience").dxDataGrid("option","dataSource", gridProvincialExperienceDataSource); $("#gridMunicipalExperience").dxDataGrid("option","dataSource", gridMunicipalExperienceDataSource); $("#gridMilitary").dxDataGrid("option","dataSource", gridMilitaryDataSource); $("#gridCommitteeMembership").dxDataGrid("option","dataSource", gridCommitteeMembershipDataSource); $("#gridCandidates").dxDataGrid("option","dataSource", gridCandidatesDataSource); $("#gridPublications").dxDataGrid("option","dataSource", gridPublicationsDataSource); $("#gridFamily").dxDataGrid("option","dataSource", gridFamilyDataSource); //$("#gridAdditionalInfo").dxDataGrid("option","dataSource", gridAdditionalInfoDataSource); $('#accordion .panel-collapse').collapse('show'); //Redraw Grids (bug / behavior of grid columns Auto-sizing) //$("#gridPublications").dxDataGrid("instance").refresh(false); $("#gridFederalExperience").dxDataGrid("instance").refresh(false); $("#gridFederalExperienceList").dxDataGrid("instance").refresh(false); $("#gridFederalPublicOffice").dxDataGrid("instance").refresh(false); $("#gridCommitteeMembership").dxDataGrid("instance").refresh(false); $("#gridCandidates").dxDataGrid("instance").refresh(false); $("#gridProvincialExperience").dxDataGrid("instance").refresh(false); $("#gridMunicipalExperience").dxDataGrid("instance").refresh(false); $("#gridFamily").dxDataGrid("instance").refresh(false); //$("#gridAdditionalInfo").dxDataGrid("instance").refresh(false); $("#gridMilitary").dxDataGrid("instance").refresh(false); } }); /* ViewFederalExperience */ $("#ViewFederalExperience").change(function() { if (this.checked == false) { $("#gridFederalExperienceList").show(); $("#gridFederalExperience").hide(); var ds = $("#gridFederalExperienceList").dxDataGrid("getDataSource"); if (ds == null) { $("#gridFederalExperienceList").dxDataGrid("option","dataSource", gridFederalExperienceListDataSource); } $("#gridFederalExperienceList").dxDataGrid("instance").refresh(false); } else { $("#gridFederalExperienceList").hide(); $("#gridFederalExperience").show(); var ds = $("#gridFederalExperience").dxDataGrid("getDataSource"); if (ds == null) { $("#gridFederalExperience").dxDataGrid("option","dataSource", gridFederalExperienceDataSource); } $("#gridFederalExperience").dxDataGrid("instance").refresh(false); } }); /*Refresh Grids (Force Redraw) on expand*/ $("#PublicationsSection").click(function() { var ds = $("#gridPublications").dxDataGrid("getDataSource"); if (ds == null) { $("#gridPublications").dxDataGrid("option","dataSource", gridPublicationsDataSource); } $("#gridPublications").dxDataGrid("instance").refresh(false); }); $("#FederalSection").click(function() { var ds = $("#gridFederalExperienceList").dxDataGrid("getDataSource"); if (ds == null) { $("#gridFederalExperienceList").dxDataGrid("option","dataSource", gridFederalExperienceListDataSource); } $("#gridFederalExperienceList").dxDataGrid("instance").refresh(false); }); $("#FederalPublicOfficeSection").click(function() { var ds = $("#gridFederalPublicOffice").dxDataGrid("getDataSource"); if (ds == null) { $("#gridFederalPublicOffice").dxDataGrid("option","dataSource", gridFederalPublicOfficeDataSource); } $("#gridFederalPublicOffice").dxDataGrid("instance").refresh(false); }); $("#CommitteeMembershipSection").click(function() { var ds = $("#gridCommitteeMembership").dxDataGrid("getDataSource"); if (ds == null) { $("#gridCommitteeMembership").dxDataGrid("option","dataSource", gridCommitteeMembershipDataSource); } $("#gridCommitteeMembership").dxDataGrid("instance").refresh(false); }); $("#ElectoralHistorySection").click(function() { var ds = $("#gridCandidates").dxDataGrid("getDataSource"); if (ds == null) { $("#gridCandidates").dxDataGrid("option","dataSource", gridCandidatesDataSource); } $("#gridCandidates").dxDataGrid("instance").refresh(false); }); $("#ProvincialSection").click(function() { var ds = $("#gridProvincialExperience").dxDataGrid("getDataSource"); if (ds == null) { $("#gridProvincialExperience").dxDataGrid("option","dataSource", gridProvincialExperienceDataSource); } $("#gridProvincialExperience").dxDataGrid("instance").refresh(false); }); $("#MunicipalSection").click(function() { var ds = $("#gridMunicipalExperience").dxDataGrid("getDataSource"); if (ds == null) { $("#gridMunicipalExperience").dxDataGrid("option","dataSource", gridMunicipalExperienceDataSource); } $("#gridMunicipalExperience").dxDataGrid("instance").refresh(false); }); $("#FamilyTiesSection").click(function() { var ds = $("#gridFamily").dxDataGrid("getDataSource"); if (ds == null) { $("#gridFamily").dxDataGrid("option","dataSource", gridFamilyDataSource); } $("#gridFamily").dxDataGrid("instance").refresh(false); }); /*$("#AdditionalInfoSection").click(function() { var ds = $("#gridAdditionalInfo").dxDataGrid("getDataSource"); if (ds == null) { $("#gridAdditionalInfo").dxDataGrid("option","dataSource", gridAdditionalInfoDataSource); } $("#gridAdditionalInfo").dxDataGrid("instance").refresh(false); });*/ $("#MilitarySection").click(function() { var ds = $("#gridMilitary").dxDataGrid("getDataSource"); if (ds == null) { $("#gridMilitary").dxDataGrid("option","dataSource", gridMilitaryDataSource); } $("#gridMilitary").dxDataGrid("instance").refresh(false); }); function loadPersonProfile(personId) { $.ajax({ url: envURL + "/ParlinfoWebApi/Person/GetPersonWebProfile/" + personId, dataType: "jsonp", type: "GET", xhrFields: { withCredentials: true }, data: { }, success: function displayResults(profile) { //Picture var defaultPicPath = "'/ParlInfoPic/NA.jpg'"; if (profile.PictureId != null) { var picPath = "/ParlInfoPic/" + profile.Person.PersonId + "/" + profile.PictureId + ".jpg"; } if (imageExists(picPath)) { var htmlPicture = "<img alt='" + PersonAltText + profile.Person.DisplayName + "' src='" + picPath + "' style='border: solid 1px #0000cc;' />"; var copyright = getLocalizedValue(profile.PictureCopyrightEn, profile.PictureCopyrightFr); var photoCredit = getLocalizedValue(profile.PictureCreditEn, profile.PictureCreditFr); if (copyright != null) { htmlPicture += "<br /><span style='word-wrap:break-word;' title='" + copyright + "'><span class='glyphicon glyphicon-copyright-mark'></span>&nbsp;" + copyright + "</span>" } else if (photoCredit != null) { htmlPicture += "<br /><span style='word-wrap:break-word;' title='" + photoCredit + "'><span class='glyphicon glyphicon-copyright-mark'></span>&nbsp;" + photoCredit + "</span>" } $("#PersonPic").html(htmlPicture); } else { $("#PersonPic").html("<img alt='" + photoNotAvailable + "' src=" + defaultPicPath + " style='border: solid 1px #0000cc;width:220px;height:330px;' /><br /><span style='word-wrap:break-word;' title='" + photoNotAvailable + "'>" + photoNotAvailable + "</span>"); } var isDraft = ""; if (profile.Person.IsDraftProfile == true) { //$("#PersonInfo").addClass(unofficial); isDraft = " <i style=\"color: #c1c1c1;\">(" + draftProfile + ")</i>"; } //Title var titleHTMLString = "<h2>"; titleHTMLString += getLocalizedValue(profile.DisplayTitleEn, profile.DisplayTitleFr) + isDraft + "</h2>" $("#PersonTitle").html(titleHTMLString); //Set Page Title $(document).attr("title", getLocalizedValue("Profile - ", "Profil - ") + profile.Person.DisplayName) //Set Grid Datasources gridFederalExperienceDataSource = profile.FederalExperience; gridFederalExperienceListDataSource = profile.FederalExperienceList; gridFederalPublicOfficeDataSource = profile.PublicOfficeExperience; gridProvincialExperienceDataSource = profile.ProvincialExperience; gridMunicipalExperienceDataSource = profile.MunicipalExperience; gridMilitaryDataSource = profile.MilitaryExperience; gridCommitteeMembershipDataSource = profile.CommitteeMembership; gridCandidatesDataSource = profile.Person.ElectionCandidates; gridPublicationsDataSource = profile.Person.Bibliography; gridFamilyDataSource = profile.FamilyTiesInParliament; //gridAdditionalInfoDataSource = profile.Family; setTimeout(function(){ loadMenu(profile); }, 500); //Tombstone Info var currentSenHTML=""; var currentHocHTML=""; var dateBirthHTML=""; var birthPlaceHTML=""; var deathDateHTML=""; var causeDeathHTML=""; var placeBurialHTML=""; var occupationHTML=""; var prefferedLanHTML=""; var totalYearsHTML=""; var totalYearsHouseHTML=""; var totalYearsSenHTML=""; var parlRolesHTML=""; var senRolesHTML=""; var notesHTML=""; var mainInfoHTMLString; if ( profile.Person.Gender != null ) { gender = profile.Person.Gender; } if (profile.Person.IsCurrentlySenator && profile.Person.CurrentConstituencyEn.length > 0) { if (profile.Person.Gender != "F" || !profile.Person.Gender) { currentSenHTML = "<li><span class='std-header-small' style='padding-bottom:10px;'>" + currentSenatorFor + getLocalizedValue(profile.Person.CurrentConstituencyEn, profile.Person.CurrentConstituencyFr) + "</span></li>" } else { currentSenHTML = "<li><span class='std-header-small' style='padding-bottom:10px;'>" + currentSenatorFeminineFor + getLocalizedValue(profile.Person.CurrentConstituencyEn, profile.Person.CurrentConstituencyFr) + "</span></li>" } } if (profile.Person.IsCurrentlyMP && profile.Person.CurrentConstituencyEn.length > 0) { if (profile.Person.Gender != "F" || !profile.Person.Gender) { currentHocHTML = "<li><span class='std-header-small' style='padding-bottom:10px;'>" + currentMemberFor + getLocalizedValue(profile.Person.CurrentConstituencyEn, profile.Person.CurrentConstituencyFr) + "</span></li>" } else { currentHocHTML = "<li><span class='std-header-small' style='padding-bottom:10px;'>" + currentMemberFeminineFor + getLocalizedValue(profile.Person.CurrentConstituencyEn, profile.Person.CurrentConstituencyFr) + "</span></li>" } } if ( profile.Person.DateOfBirth != null) { var dateOfBirth = ""; var month = ""; var day = ""; if (profile.Person.DateOfBirthIsApproximate) { dateOfBirth = profile.Person.DateOfBirth.substring(0,4); month = profile.Person.DateOfBirth.substring(5,7); day = profile.Person.DateOfBirth.substring(8,10); if (month != "01" || (month == "01" && day != "01")){ dateOfBirth += "-" + month; } } else { dateOfBirth = profile.Person.DateOfBirth.substring(0,10); } dateBirthHTML = "<li><label for='DateOfBirth'>" + dateOfBirthLabel + "</label><span id='DateOfBirth' class=''>" + dateOfBirth + "</span></li>" } if (profile.PlaceOfBirthEn != null) { birthPlaceHTML = "<li><label for='PlaceOfBirth'>" + birthPlaceLabel + "</label><span id='PlaceOfBirth' class=''>" + getLocalizedValue(profile.PlaceOfBirthEn, profile.PlaceOfBirthFr) + "</span></li>" } if (profile.Person.Death != null) { if (profile.Person.Death.DateOfDeath != null) { var dateOfDeath = ""; var month = ""; var day = ""; var endInfo = ""; if (profile.Person.Death.DateOfDeathIsApproximate) { dateOfDeath = profile.Person.Death.DateOfDeath.substring(0,4); month = profile.Person.Death.DateOfDeath.substring(5,7); day = profile.Person.Death.DateOfDeath.substring(8,10); if (month != "01" || (month == "01" && day != "01")){ dateOfDeath += "-" + month; } } else { dateOfDeath = profile.Person.Death.DateOfDeath.substring(0,10); } if (profile.Person.Death.DeceasedOnDuty == true) { endInfo = diedInOffice; } deathDateHTML = "<li><label for='DateOfDeath'>" + deathDateLabel + "</label><span id='DateOfDeath' class=''>" + dateOfDeath + endInfo + "</span></li>" } if (profile.Person.Death.CauseOfDeathEn != null) { causeDeathHTML = "<li><label for='CauseOfDeath'>" + causeOfDeathLabel + "</label><span id='CauseOfDeath' class=''>" + getLocalizedValue(profile.Person.Death.CauseOfDeathEn, profile.Person.Death.CauseOfDeathFr) + "</span></li>" } if (profile.Person.Death.PlaceOfBurialEn != null) { placeBurialHTML = "<li><label for='PlaceOfBurial'>" + placeofBurialLabel + "</label><span id='PlaceOfBurial' class=''>" + getLocalizedValue(profile.PlaceOfBurialEn, profile.PlaceOfBurialFr) + "</span></li>" } } if ( profile.ProfessionsEn.length > 0) { occupationHTML = "<li><label for='Occupations'>" + professionLabel + "</label><span id='Occupations' class=''>" + getLocalizedValue(profile.ProfessionsEn, profile.ProfessionsFr) + "</span></li>" } if (profile.Person.IsCurrentlyInOffice && profile.PreferredLanguageEn.length > 0) { prefferedLanHTML = "<li><label for='PreferredLanguage'>" + langPrefLabel + "</label><span id='PreferredLanguage' class=''>" + getLocalizedValue(profile.PreferredLanguageEn, profile.PreferredLanguageFr) + "</span></li>" } //Years Of Service Total totalYearsHTML += "<li><label for='YearsOfServices'>" + yearsOfServiceLabel + "</span></label><span id='YearsOfServices'>"; var returnYMD = ""; var totalDays=0; var days=0; var years=0; var months=0; var yearCount = 0; var monthCount = 0; var dayCount = 0; var dDays = 0; $.each(profile.Person.YearsOfServiceSegments, function (i, segment) { totalDays += segment.TotalDays; }); years = totalDays / 365.25; dDays = totalDays % 365.25; months = dDays / 30.4375; totalDaysDb = Math.round(dDays) % 30.4375; days = Math.round(totalDaysDb); yearCount = years; monthCount = months; dayCount = days; //Merge segments for gran total var RoundedYears = Math.round(yearCount); if (RoundedYears > yearCount) { RoundedYears--; } var RoundedMonths = Math.round(monthCount); if (RoundedMonths > monthCount) { RoundedMonths--; } returnYMD += totalDays + " " + dayLabel + " [&nbsp;" if (yearCount >= 1) { returnYMD += RoundedYears + " " +yearsLabel; } if (monthCount >= 1) { if (returnYMD != "") { returnYMD += ", "; } returnYMD += RoundedMonths + " " + monthsLabel; } if (dayCount >= 1) { if (returnYMD != "") { returnYMD += ", "; } returnYMD += dayCount + " " + daysLabel; } totalYearsHTML += returnYMD + "&nbsp;]" totalYearsHTML += "</span></li>" //Years Of Service House Of Commons var returnYMDH = ""; var totalDaysH=0; var daysH=0; var yearsH=0; var monthsH=0; var yearCountH = 0; var monthCountH = 0; var dayCountH = 0; var dDaysH = 0; $.each(profile.Person.YearsOfServiceSegmentsHouse, function (i, segment) { totalDaysH += segment.TotalDays; }); if(totalDaysH > 0) { totalYearsHouseHTML += "<li><label for='YearsOfServices'>" + yearsOfServiceHouseLabel + "</span></label><span id='YearsOfServices'>"; yearsH = totalDaysH / 365.25; dDaysH = totalDaysH % 365.25; monthsH = dDaysH / 30.4375; totalDaysDbH = Math.round(dDaysH) % 30.4375; daysH = Math.round(totalDaysDbH); yearCountH = yearsH; monthCountH = monthsH; dayCountH = daysH; //Merge segments for gran total var RoundedYearsH = Math.round(yearCountH); if (RoundedYearsH > yearCountH) { RoundedYearsH--; } var RoundedMonthsH = Math.round(monthCountH); if (RoundedMonthsH > monthCountH) { RoundedMonthsH--; } returnYMDH += totalDaysH + " " + dayLabel + " [&nbsp;" if (yearCountH >= 1) { returnYMDH += RoundedYearsH + " " +yearsLabel; } if (monthCountH >= 1) { if (returnYMDH != "") { returnYMDH += ", "; } returnYMDH += RoundedMonthsH + " " + monthsLabel; } if (dayCountH >= 1) { if (returnYMDH != "") { returnYMDH += ", "; } returnYMDH += dayCountH + " " + daysLabel; } totalYearsHouseHTML += returnYMDH + "&nbsp;]" totalYearsHouseHTML += "</span></li>" } //Years Of Service Senate var returnYMDS = ""; var totalDaysS=0; var daysS=0; var yearsS=0; var monthsS=0; var yearCountS = 0; var monthCountS = 0; var dayCountS = 0; var dDaysS = 0; $.each(profile.Person.YearsOfServiceSegmentsSenate, function (i, segment) { totalDaysS += segment.TotalDays; }); if(totalDaysS > 0) { totalYearsSenHTML += "<li><label for='YearsOfServices'>" + yearsOfServiceSenateLabel + "</span></label><span id='YearsOfServices'>"; yearsS = totalDaysS / 365.25; dDaysS = totalDaysS % 365.25; monthsS = dDaysS / 30.4375; totalDaysDbS = Math.round(dDaysS) % 30.4375; daysS = Math.round(totalDaysDbS); yearCountS = yearsS; monthCountS = monthsS; dayCountS = daysS; //Merge segments for gran total var RoundedYearsS = Math.round(yearCountS); if (RoundedYearsS > yearCountS) { RoundedYearsS--; } var RoundedMonthsS = Math.round(monthCountS); if (RoundedMonthsS > monthCountS) { RoundedMonthsS--; } returnYMDS += totalDaysS + " " + dayLabel + " [&nbsp;" if (yearCountS >= 1) { returnYMDS += RoundedYearsS + " " +yearsLabel; } if (monthCountS >= 1) { if (returnYMDS != "") { returnYMDS += ", "; } returnYMDS += RoundedMonthsS + " " + monthsLabel; } if (dayCountS >= 1) { if (returnYMDS != "") { returnYMDS += ", "; } returnYMDS += dayCountS + " " + daysLabel; } totalYearsSenHTML += returnYMDS + "&nbsp;]" totalYearsSenHTML += "</span></li>" } //Get MP and Senator Roles var parliamentarianRoles = ""; var senatorRoles = ""; var mp = []; var sen = []; var currentDate = new Date() $.each(profile.Person.Roles, function(i, segment) { if (segment.RoleId == 718) { var endDate = ""; if (segment.EndDate) { endDate = segment.EndDate; } else { endDate = currentDate; } sen.push([segment.StartDate, endDate, segment.EndDateIsApproximate]); } if (segment.RoleId == 719 && segment.OrganizationTypeId == 35) { var endDate = ""; if (segment.EndDate) { endDate = segment.EndDate; } else { endDate = currentDate; } mp.push([segment.StartDate, endDate, segment.EndDateIsApproximate]); } }); sen.sort(); for (var i = 0; i < sen.length; i++) { if (profile.Person.Gender != "F" || !profile.Person.Gender) { senatorRoles += "<li><label for=\"Senator" + i + "\">" + senatorLabel + "</label><span id=\"Senator" + i + "\">(" + sen[i][0].substring(0, 10); } else { senatorRoles += "<li><label for=\"Senator" + i + "\">" + senatorFeminineLabel + "</label><span id=\"Senator" + i + "\">(" + sen[i][0].substring(0, 10); } if (sen[i][1] != currentDate) { if (sen[i][2]){ var result = sen[i][1].substring(0,4); var month = sen[i][1].substring(5,7); var day = sen[i][1].substring(8,10); if (month != "01" || (month == "01" && day != "01")){ result += "-" + month } senatorRoles += " - " + result; } else { senatorRoles += " - " + sen[i][1].substring(0,10); } } else { senatorRoles += " - &nbsp;" } senatorRoles += ")</span></li>"; } mp.sort(); for (var i = 0; i < mp.length; i++) { if (profile.Person.Gender != "F" || !profile.Person.Gender) { parliamentarianRoles += "<li><label for=\"MP" + i + "\">" + mpLabel + "</label><span id=\"MP" + i + "\">(" + mp[i][0].substring(0, 10); } else { parliamentarianRoles += "<li><label for=\"MP" + i + "\">" + mpFeminineLabel + "</label><span id=\"MP" + i + "\">(" + mp[i][0].substring(0, 10); } if (mp[i][1] != currentDate) { if (mp[i][2]){ var result = mp[i][1].substring(0,4); var month = mp[i][1].substring(5,7); var day = mp[i][1].substring(8,10); if (month != "01" || (month == "01" && day != "01")){ result += "-" + month } parliamentarianRoles += " - " + result; } else { parliamentarianRoles += " - " + mp[i][1].substring(0,10); } } else { parliamentarianRoles += " - &nbsp;" } parliamentarianRoles += ")</span></li>"; } parlRolesHTML = parliamentarianRoles; senRolesHTML = senatorRoles; //Note Boxe if (profile.Person.ExternalNotesEn != null || profile.Person.ExternalNotesFr != null) { var externalNotesEn = profile.Person.ExternalNotesEn != null ? profile.Person.ExternalNotesEn : "" var externalNotesFr = profile.Person.ExternalNotesFr != null ? profile.Person.ExternalNotesFr : "" if (getLocalizedValue(externalNotesEn, externalNotesFr).trim() != "") { notesHTML = "<li><div class='rounded-info-block'><label for='Notes' style='width: 100%;'>" + notesLabel + "</label><br /><span id='Notes' class=''>" + getLocalizedValue(profile.Person.ExternalNotesEn, profile.Person.ExternalNotesFr) + "</span></div></li>" } } //HTML Page Builder PersonInfo mainInfoHTMLString = "<div><ul class='colNoRightLeftPadding'>"; mainInfoHTMLString += currentSenHTML; mainInfoHTMLString += currentHocHTML; mainInfoHTMLString += "&nbsp;"; mainInfoHTMLString += dateBirthHTML; mainInfoHTMLString += birthPlaceHTML; mainInfoHTMLString += deathDateHTML; mainInfoHTMLString += causeDeathHTML; mainInfoHTMLString += placeBurialHTML; mainInfoHTMLString += "&nbsp;"; mainInfoHTMLString += occupationHTML; mainInfoHTMLString += prefferedLanHTML; mainInfoHTMLString += "&nbsp;"; mainInfoHTMLString += totalYearsHTML; mainInfoHTMLString += "&nbsp;"; mainInfoHTMLString += parlRolesHTML; mainInfoHTMLString += totalYearsHouseHTML; mainInfoHTMLString += "&nbsp;"; mainInfoHTMLString += senRolesHTML; mainInfoHTMLString += totalYearsSenHTML; mainInfoHTMLString += "&nbsp;"; mainInfoHTMLString += notesHTML; mainInfoHTMLString += "</ul></div>"; //Selected Links if (profile.Person.WebLinks != null && profile.Person.WebLinks.length > 0) { var linksHTMLString = "<div class='rounded-block'>"; var linkEn = ""; var linkFr = ""; linksHTMLString += "<p><span class='std-header padding-top-10'>" + selectedLinksLabel + "</span></p><ul>"; $.each(profile.Person.WebLinks, function (i, link) { if (link.UrlEn.length > 0){ if (link.UrlEn.indexOf("~\\Documents") != -1 || link.UrlEn.indexOf("~/Documents") != -1) { linkEn = link.UrlEn; linkEn = linkEn.replace(/'/g, "&apos;"); linkEn = linkEn.replace("\\", "/"); linkEn = linkEn.replace("~/Documents", "/staticfiles/ParlInfo/Documents"); linkEn = linkEn.replace("English", "En"); linkEn = linkEn.replace("_SEN.pdf", "_sen.pdf"); linkEn = linkEn.replace("_HOC.pdf", "_hoc.pdf"); } else { linkEn = link.UrlEn; } if (link.UrlFr.indexOf("~\\Documents") != -1 || link.UrlFr.indexOf("~/Documents") != -1) { linkFr = link.UrlFr; linkFr = linkFr.replace(/'/g, "&apos;"); linkFr = linkFr.replace("\\", "/"); linkFr = linkFr.replace("~/Documents", "/staticfiles/ParlInfo/Documents"); linkFr = linkFr.replace("Francais", "Fr"); } else { linkFr = link.UrlFr; } linksHTMLString += "<li><a target=\"_blank\" href=\"" + getLocalizedValue(linkEn, linkFr) + "\">" + getLocalizedValue(link.TitleEn, link.TitleFr) + "</a></li>"; } }); linksHTMLString += "</ul></div>" } //Constituency Addresses var constituencyAddressHTMLString = ""; if (profile.Person.ConstituencyAddresses != null && profile.Person.ConstituencyAddresses.length > 0) { var phoneType; constituencyAddressHTMLString = "<div class='rounded-info-block'>" ; constituencyAddressHTMLString += "<p><span class='std-header-xsmall'>" + constAddressLabel + "</span></p>"; $.each(profile.Person.ConstituencyAddresses, function (i, address) { constituencyAddressHTMLString += "<div class='row'>"; constituencyAddressHTMLString += "<div class='col-sm-6 col-md-4' style='padding-bottom:10px;'>"; constituencyAddressHTMLString += "<span>" + getLocalizedValue(address.StreetAddresseEn, address.StreetAddresseFr) + "</span><br />"; constituencyAddressHTMLString += "<span>" + getLocalizedValue(address.CityEn, address.CityFr) + ", " + getLocalizedValue(address.ProvinceEn, address.ProvinceFr) + "</span><br />"; constituencyAddressHTMLString += "<span>" + address.PostalCode + "</span>"; constituencyAddressHTMLString += "</div>"; constituencyAddressHTMLString += "<div class='col-sm-6 col-md-8' style='padding-bottom:10px;'>"; $.each(address.Phones, function (j, phone) { phoneType = ":"; if (phone.TypeShortEn != null) { phoneType = getLocalizedValue(phone.TypeShortEn, phone.TypeShortFr); } constituencyAddressHTMLString += "<span class='glyphicon glyphicon-phone-alt'></span>&nbsp;&nbsp;" + phoneType + "&nbsp;" + phone.Number + "<br>" ; }); $.each(address.Emails, function (k, email) { if (email.AddressEn != null) { var emailLocalized = getLocalizedValue(email.AddressEn, email.AddressFr); constituencyAddressHTMLString += "<span class='glyphicon glyphicon-envelope'></span>&nbsp;&nbsp;" + emailLabel + "<a href='mailto:" + emailLocalized + "'>" + emailLocalized + "</a><br>" ; } }); constituencyAddressHTMLString += "</div>"; constituencyAddressHTMLString += "</div><hr />"; }); constituencyAddressHTMLString += "</div>" ; } //Hill Addresses var HillAddressHTMLString = "<div class='rounded-info-block'>"; HillAddressHTMLString += "<p><span class='std-header-xsmall'>" + hillAddressLabel + "</span></p>"; $.each(profile.Person.HillAddresses, function (i, address) { HillAddressHTMLString += "<div class='row'>"; HillAddressHTMLString += "<div class='col-sm-6 col-md-4' style='padding-bottom:10px;'>"; if (profile.Person.IsCurrentlyMP) { HillAddressHTMLString += hocAddresss; } else { HillAddressHTMLString += senAddresss; } HillAddressHTMLString += "</div>"; HillAddressHTMLString += "<div class='col-sm-6 col-md-8' style='padding-bottom:10px;'>"; $.each(address.Phones, function (j, phone) { phoneType = ":"; if (phone.TypeShortEn != null) { phoneType = getLocalizedValue(phone.TypeShortEn, phone.TypeShortFr); } HillAddressHTMLString += "<span class='glyphicon glyphicon-phone-alt'></span>&nbsp;&nbsp;" + phoneType + "&nbsp;" + phone.Number + "<br>" ; }); $.each(address.Emails, function (k, email) { if (email.Address != null) { HillAddressHTMLString += "<span class='glyphicon glyphicon-envelope'></span>&nbsp;&nbsp;" + emailLabel + "<a href='mailto:" + email.Address + "'>" + email.Address + "</a><br>" ; } }); HillAddressHTMLString += "</div>"; HillAddressHTMLString += "</div><hr />"; }); HillAddressHTMLString += "</div>" ; //Additional Info /*if (gridAdditionalInfoDataSource == null) { $("#BiographicalInfo").hide(); }*/ var pmHTMLString = ""; //Inject HTML $("#PersonInfo").html(mainInfoHTMLString); $("#PersonLinks").html(linksHTMLString); $("#PersonLinksSmall").html(linksHTMLString); $("#ContactInfo").html(HillAddressHTMLString + constituencyAddressHTMLString); //$("#PrimeMinisterInfo").html(pmHTMLString); }, error: function (err) { alert(err.status + ' ' + err.statusText); } }); } function imageExists(image_url){ if (image_url == null){ return false; } var http = new XMLHttpRequest(); http.open('HEAD', image_url, false); http.send(); return http.status != 404; } }); </script> <!-- gridName excludes the # sign because it is needed without the # in some places --> <div> <div id="TitleAndSummaryDiv"> </div> </div> <div id="loadPanel" ></div> <div id="gridMunicipalExperience" class="gridContainer" ></div> <div id="resetButton"></div> <div id="popup"><div class="popup"></div></div><script type="text/javascript"> var notes = {}, popup = null, popupOptions = { width: 400, height: 250, contentTemplate: function() { return $("<div />").append( $("<p>" + notes + "</p>") ); }, showTitle: true, title: "Notes", visible: false, dragEnabled: false, closeOnOutsideClick: true }; function showInfo(data) { notes = data; if(popup) { $(".popup").remove(); } var $popupContainer = $("<div />") .addClass("popup") .appendTo($("#popup")); popup = $popupContainer.dxPopup(popupOptions).dxPopup("instance"); popup.show(); }</script> <script type="text/javascript"> var url = window.window.location.href; var expandAltText = "Expand All"; var collapseAltText = "Collapse All"; var resetAltText = "Reset"; if (url.toLowerCase().indexOf("fr_ca") >= 0){ DevExpress.localization.locale("fr"); expandAltText = "D\xE9velopper"; collapseAltText = "R\xE9duire"; resetAltText = "R\xE9initialiser"; } $( window ).on( "load", function() { //Load the Controls for search var loadPanel = $("#loadPanel").dxLoadPanel({ shadingColor: "rgba(0,0,0,0.4)", visible: false, showIndicator: true, showPane: true, shading: true, closeOnOutsideClick: false }).dxLoadPanel("instance"); loadPanel.show(); //Load the Grid $("#gridMunicipalExperience").dxDataGrid({ dataSource: gridMunicipalExperienceDataSource, //gridMunicipalExperienceDataSource is SET in the main view of this page where the data call is performed allowColumnReordering: true, columns: [{dataField: 'NameEn', caption: 'Role', allowFiltering: true},{dataField: 'OrganizationLongEn', caption: 'Organization', allowFiltering: true},{dataField: 'StartDate', caption: 'Start Date', dataType: 'date', format: 'y-MM-d', sortIndex: 0, sortOrder: 'desc', hidingPriority: 1, headerFilter:{ dataSource: function(data) { data.dataSource.paginate = false; data.dataSource.postProcess = function(results) {return results.reverse();};}}, allowFiltering: true, minWidth: 95, cellTemplate: function(container, options) { if (options.data.StartDate) { if (options.data.StartDateIsApproximate){ result = options.data.StartDate.substring(0,4); month = options.data.StartDate.substring(5,7); day = options.data.StartDate.substring(8,10); if (month != "01" || (month == "01" && day != "01")){result += "-" + month} container.append("<span>" + result + "</span>"); } else { container.append("<span>" + options.data.StartDate.substring(0,10) + "</span>") } } }},{dataField: 'EndDate', caption: 'End Date', dataType: 'date', format: 'y-MM-d', hidingPriority: 0, allowFiltering: true, minWidth: 95, cellTemplate: function(container, options) { if (options.data.EndDate) { if (options.data.StartDateIsApproximate){ result = options.data.EndDate.substring(0,4); month = options.data.EndDate.substring(5,7); day = options.data.EndDate.substring(8,10); if (month != "01" || (month == "01" && day != "01")){result += "-" + month} container.append("<span>" + result + "</span>"); } else { container.append("<span>" + options.data.EndDate.substring(0,10) + "</span>") } } }}], allowColumnResizing: true, sorting: {mode: "multiple"}, filterPanel: { visible: true }, columnAutoWidth: true, columnChooser: { enabled: true, mode: "select" }, onContentReady: function (e) { var columnChooserView = e.component.getView("columnChooserView"); if (!columnChooserView._popupContainer) { columnChooserView._initializePopupContainer(); columnChooserView.render(); columnChooserView._popupContainer.option("position", { of: e.element, my: "right top", at: "right top", offset: "0 50"}); } }, filterRow: { visible: true}, headerFilter: { visible: true, allowSearch: true }, pager: { showInfo: true, showPageSizeSelector: false, allowedPageSizes: [], showNavigationButtons: true },grouping: { contextMenuEnabled: true }, groupPanel: { visible: true }, grouping: { autoExpandAll: true }, searchPanel: { visible: true }, "export": { enabled: true, fileName: "Parliamentarian Profile - Municipal Experience", allowExportSelectedData: false }, onToolbarPreparing: function(e) { var dataGrid = e.component; e.toolbarOptions.items.unshift({ location: "after", widget: "dxButton", options: { icon: "refresh", hint: resetAltText, onClick: function() { var gridinstance = $('#gridMunicipalExperience').dxDataGrid('instance'); gridinstance.state({}); } } }, { location: "after", widget: "dxButton", options: { icon: "expand", hint: expandAltText, onClick: function() { var expanded = e.component.option("grouping.autoExpandAll"); dataGrid.option("grouping.autoExpandAll", !expanded); if (expanded){ this.option("icon", "expand"); this.option("hint", expandAltText); }else{ this.option("icon", "collapse"); this.option("hint", collapseAltText); } } } }); }, stateStoring: { enabled: false, type: "localStorage", storageKey: "" },paging: { enabled: false }, grouping: { autoExpandAll: false, } }); loadPanel.hide(); }); </Script> <!-- gridName excludes the # sign because it is needed without the # in some places --> <div> <div id="TitleAndSummaryDiv"> </div> </div> <div id="loadPanel" ></div> <div id="gridCandidates" class="gridContainer" ></div> <div id="resetButton"></div> <div id="popup"><div class="popup"></div></div><script type="text/javascript"> var notes = {}, popup = null, popupOptions = { width: 400, height: 250, contentTemplate: function() { return $("<div />").append( $("<p>" + notes + "</p>") ); }, showTitle: true, title: "Notes", visible: false, dragEnabled: false, closeOnOutsideClick: true }; function showInfo(data) { notes = data; if(popup) { $(".popup").remove(); } var $popupContainer = $("<div />") .addClass("popup") .appendTo($("#popup")); popup = $popupContainer.dxPopup(popupOptions).dxPopup("instance"); popup.show(); }</script> <script type="text/javascript"> var url = window.window.location.href; var expandAltText = "Expand All"; var collapseAltText = "Collapse All"; var resetAltText = "Reset"; if (url.toLowerCase().indexOf("fr_ca") >= 0){ DevExpress.localization.locale("fr"); expandAltText = "D\xE9velopper"; collapseAltText = "R\xE9duire"; resetAltText = "R\xE9initialiser"; } $( window ).on( "load", function() { //Load the Controls for search var loadPanel = $("#loadPanel").dxLoadPanel({ shadingColor: "rgba(0,0,0,0.4)", visible: false, showIndicator: true, showPane: true, shading: true, closeOnOutsideClick: false }).dxLoadPanel("instance"); loadPanel.show(); //Load the Grid $("#gridCandidates").dxDataGrid({ dataSource: gridCandidatesDataSource, //gridCandidatesDataSource is SET in the main view of this page where the data call is performed allowColumnReordering: true, columns: [{dataField: 'ParliamentNumber', caption: 'Parliament', dataType: 'number', sortOrder: 'desc', allowFiltering: true},{dataField: 'ElectionDate', caption: 'Election Date', dataType: 'date', format: 'y-MM-d', headerFilter:{ dataSource: function(data) { data.dataSource.paginate = false; data.dataSource.postProcess = function(results) {return results.reverse();};}}, allowFiltering: true, calculateDisplayValue: function(rowData){ return (rowData.ElectionDate == null ? "" : rowData.ElectionDate.substring(0,10)) }, cellTemplate: function(element, info) { if (info.data.ElectionDate != null) { element.append("<a href=\"/sites/ParlInfo/default/en_CA/ElectionsRidings/Elections/Profile?election=" + info.data.ElectionDate.substring(0,10) + "\" target=\"_blank\">" + info.data.ElectionDate.substring(0,10) + "</a>"); } else { element.append(""); } }, encodeHtml: false},{dataField: 'IsGeneral', caption: 'Election Type', allowFiltering: true, calculateCellValue: function(rowData){ if (rowData.IsGeneral){ var type = "General"; } else { var type = "By-Election"; } return (type) }},{dataField: 'ConstituencyEn', caption: 'Constituency', allowFiltering: true, encodeHtml: false, cellTemplate: function(element, info){ var result = "<a href=\"/sites/ParlInfo/default/en_CA/ElectionsRidings/Ridings/Profile?OrganizationId=" + info.data.OrganizationId + "\" target=\"_blank\">" + info.data.ConstituencyEn + "</a>" if (info.data.NotesEn != null){ result += "<br /><br /><i>" + info.data.NotesEn + "</i>"; } element.append(result); }, calculateCellValue: function(rowData){ var result = rowData.ConstituencyEn; if (rowData.NotesEn != null){ result += "\r\n" + rowData.NotesEn; } return (result) } },{dataField: 'PartyNameEn', caption: 'Party', hidingPriority: 2, allowFiltering: true, encodeHtml: false, cellTemplate: function(element, info){ var result = info.data.PartyNameEn; if (info.data.PartyNameEn) { result = "<a href=\"/sites/ParlInfo/default/en_CA/Parties/Profile?partyId=" + info.data.PartyOrganizationId+ "\" target=\"_blank\">" + info.data.PartyNameEn+ "</a>" } element.append(result); }, calculateCellValue: function(rowData){ var result = rowData.PartyNameEn; if (rowData.PartyNameEn) { result = rowData.PartyNameEn; } return result; } },{dataField: 'ResultLongEn', caption: 'Result', allowFiltering: true, calculateCellValue: function(rowData){ if (rowData.OtherResultLongEn != null && rowData.OtherResultLongEn.length> 0){ var result= rowData.ResultLongEn + " (" + rowData.OtherResultLongEn + ")"; } else { var result= rowData.ResultLongEn; } return (result) }},{dataField: 'Votes', caption: 'Votes', dataType: 'number', headerFilter:{ dataSource: function(data) { data.dataSource.paginate = false; data.dataSource.postProcess = function(results) {return results.reverse();};}}, allowFiltering: true, calculateCellValue: function(rowData){ var result = rowData.Votes; if (result == 0){ result = ""; } return (result) }}], allowColumnResizing: true, sorting: {mode: "multiple"}, filterPanel: { visible: true }, columnAutoWidth: true, columnChooser: { enabled: true, mode: "select" }, onContentReady: function (e) { var columnChooserView = e.component.getView("columnChooserView"); if (!columnChooserView._popupContainer) { columnChooserView._initializePopupContainer(); columnChooserView.render(); columnChooserView._popupContainer.option("position", { of: e.element, my: "right top", at: "right top", offset: "0 50"}); } }, filterRow: { visible: true}, headerFilter: { visible: true, allowSearch: true }, pager: { showInfo: true, showPageSizeSelector: true, allowedPageSizes: [25,50,100], showNavigationButtons: true },grouping: { contextMenuEnabled: true }, groupPanel: { visible: true }, grouping: { autoExpandAll: true }, searchPanel: { visible: true }, "export": { enabled: true, fileName: "Parliamentarian Profile - Electoral History", allowExportSelectedData: false }, onToolbarPreparing: function(e) { var dataGrid = e.component; e.toolbarOptions.items.unshift({ location: "after", widget: "dxButton", options: { icon: "refresh", hint: resetAltText, onClick: function() { var gridinstance = $('#gridCandidates').dxDataGrid('instance'); gridinstance.state({}); } } }, { location: "after", widget: "dxButton", options: { icon: "expand", hint: expandAltText, onClick: function() { var expanded = e.component.option("grouping.autoExpandAll"); dataGrid.option("grouping.autoExpandAll", !expanded); if (expanded){ this.option("icon", "expand"); this.option("hint", expandAltText); }else{ this.option("icon", "collapse"); this.option("hint", collapseAltText); } } } }); }, stateStoring: { enabled: false, type: "localStorage", storageKey: "" },paging: { enabled: false }, wordWrapEnabled: true, grouping: { autoExpandAll: false, } }); loadPanel.hide(); }); </Script> <!-- gridName excludes the # sign because it is needed without the # in some places --> <div> <div id="TitleAndSummaryDiv"> </div> </div> <div id="loadPanel" ></div> <div id="gridFederalExperience" class="gridContainer" ></div> <div id="resetButton"></div> <div id="popup"><div class="popup"></div></div><script type="text/javascript"> var notes = {}, popup = null, popupOptions = { width: 400, height: 250, contentTemplate: function() { return $("<div />").append( $("<p>" + notes + "</p>") ); }, showTitle: true, title: "Notes", visible: false, dragEnabled: false, closeOnOutsideClick: true }; function showInfo(data) { notes = data; if(popup) { $(".popup").remove(); } var $popupContainer = $("<div />") .addClass("popup") .appendTo($("#popup")); popup = $popupContainer.dxPopup(popupOptions).dxPopup("instance"); popup.show(); }</script> <script type="text/javascript"> var url = window.window.location.href; var expandAltText = "Expand All"; var collapseAltText = "Collapse All"; var resetAltText = "Reset"; if (url.toLowerCase().indexOf("fr_ca") >= 0){ DevExpress.localization.locale("fr"); expandAltText = "D\xE9velopper"; collapseAltText = "R\xE9duire"; resetAltText = "R\xE9initialiser"; } $( window ).on( "load", function() { //Load the Controls for search var loadPanel = $("#loadPanel").dxLoadPanel({ shadingColor: "rgba(0,0,0,0.4)", visible: false, showIndicator: true, showPane: true, shading: true, closeOnOutsideClick: false }).dxLoadPanel("instance"); loadPanel.show(); //Load the Grid $("#gridFederalExperience").dxDataGrid({ dataSource: gridFederalExperienceDataSource, //gridFederalExperienceDataSource is SET in the main view of this page where the data call is performed allowColumnReordering: true, columns: [{dataField: 'ParliamentNumber', caption: 'Parliament', dataType: 'number', sortOrder: 'desc', groupIndex: 0, headerFilter:{ dataSource: function(data) { data.dataSource.paginate = false; data.dataSource.postProcess = function(results) {return results.reverse();};}}, allowFiltering: true},{dataField: 'GroupingTitleEn', caption: 'Section', allowFiltering: true},{dataField: 'NameEn', caption: 'Role', allowFiltering: true, encodeHtml: false, cellTemplate: function(element, info){ var result = info.data.NameEn; var notes = ""; if (info.data.RoleId == 719 && info.data.OrganizationTypeId == 50) { result = "Senatorial Region Member"; } if (info.data.RoleId == 719 && info.data.OrganizationTypeId == 35) { result = "MP"; } if (info.data.ToBeStyledAsEn != null && info.data.ToBeStyledAsEn.length > 0){ result = info.data.ToBeStyledAsEn; } if (info.data.IsActing){ result += "&nbsp;<i>*Acting</i>"; } if (info.data.NotesEn != null && info.data.NotesEn.length > 0){ notes = "<br /><br /><i>" + info.data.NotesEn + "</i>"; if (info.data.EndReasonTypeEn != null && info.data.EndReasonTypeEn.length > 0 && info.data.RoleId == 719) { if ((info.data.EndDate >= info.data.ParliamentStart && info.data.EndDate <= info.data.ParliamentEnd) || (info.data.EndDate < info.data.ParliamentStart && info.data.ParliamentNumber == 1)) { result += notes; } } else if (info.data.RoleId == 722) { if (info.data.StartDate >= info.data.ParliamentStart && info.data.StartDate <= info.data.ParliamentEnd) { result += notes; } else if (info.data.ParliamentNumber == 41 && info.data.OrganizationId == 4831) { result += notes; } } else if (info.data.RoleId != 719 && info.data.RoleId != 722) { result += notes; } } element.append(result); }, headerFilter: { dataSource: { postProcess: function (data) { return data .map(function(element, info){ var result = info.data.NameEn; var notes = ""; if (info.data.RoleId == 719 && info.data.OrganizationTypeId == 50) { result = "Senatorial Region Member"; } if (info.data.RoleId == 719 && info.data.OrganizationTypeId == 35) { result = "MP"; } if (info.data.ToBeStyledAsEn != null && info.data.ToBeStyledAsEn.length > 0){ result = info.data.ToBeStyledAsEn; } element.append(result); }) .filter(function(value, index, self) { return self.indexOf(value) === index; }) .sort() .map(function(x) { return { text: x, value: ["NameEn", "contains", x] }; }); }, load: function (e) { var grid = $("#gridFederalExperience").dxDataGrid('instance'); var filterExpr = grid.getCombinedFilter(); var gridDataSource = grid.getDataSource(); return gridDataSource.store().load({ filter: filterExpr }); } } }, calculateCellValue: function(rowData){ var result = rowData.NameEn; var notes = ""; if (rowData.RoleId == 719 && rowData.OrganizationTypeId == 50) { result = "Senatorial Region Member"; } if (rowData.RoleId == 719 && rowData.OrganizationTypeId == 35) { result = "MP"; } if (rowData.ToBeStyledAsEn != null && rowData.ToBeStyledAsEn.length > 0){ result = rowData.ToBeStyledAsEn; } if (rowData.IsActing){ result += "&nbsp;<i>*Acting</i>"; } if (rowData.NotesEn != null && rowData.NotesEn.length > 0){ notes = "\r\n\r\n" + rowData.NotesEn; if (rowData.EndReasonTypeEn != null && rowData.EndReasonTypeEn.length > 0 && rowData.RoleId == 719) { if ((rowData.EndDate >= rowData.ParliamentStart && rowData.EndDate <= rowData.ParliamentEnd) || (rowData.EndDate < rowData.ParliamentStart && rowData.ParliamentNumber == 1)) { result += notes; } } else if (rowData.RoleId == 722) { if (rowData.StartDate >= rowData.ParliamentStart && rowData.StartDate <= rowData.ParliamentEnd) { result += notes; } else if (rowData.ParliamentNumber == 41 && rowData.OrganizationId == 4831) { result += notes; } } else if (rowData.RoleId != 719 && rowData.RoleId != 722) { result += notes; } } return (result); }, headerFilter: { dataSource: { postProcess: function (data) { return data .map(function(rowData){ var result = rowData.NameEn; var notes = ""; if (rowData.RoleId == 719 && rowData.OrganizationTypeId == 50) { result = "Senatorial Region Member"; } if (rowData.RoleId == 719 && rowData.OrganizationTypeId == 35) { result = "MP"; } if (rowData.ToBeStyledAsEn != null && rowData.ToBeStyledAsEn.length > 0){ result = rowData.ToBeStyledAsEn; } return (result); }) .filter(function(value, index, self) { return self.indexOf(value) === index; }) .sort() .map(function(x) { return { text: x, value: ["NameEn", "contains", x] }; }); }, load: function (e) { var grid = $("#gridFederalExperience").dxDataGrid('instance'); var filterExpr = grid.getCombinedFilter(); var gridDataSource = grid.getDataSource(); return gridDataSource.store().load({ filter: filterExpr }); } } } },{dataField: 'OrganizationLongEn', caption: 'Organization', allowFiltering: true, encodeHtml: false, cellTemplate: function(element, info){ var result = info.data.OrganizationLongEn; if (info.data.OrganizationTypeId == 35) { result = "<a href=\"/sites/ParlInfo/default/en_CA/ElectionsRidings/Ridings/Profile?OrganizationId=" + info.data.OrganizationId + "\" target=\"_blank\">" + info.data.OrganizationLongEn+ "</a>" } else if (info.data.RoleId == 1408 || info.data.RoleId == 1409) { if (info.data.PortFolioEn && info.data.PortFolioEn != info.data.OrganizationLongEn && (info.data.ToBeStyledAsEn == null || info.data.ToBeStyledAsEn == "")) { result += " (" + info.data.PortFolioEn + ")"; } } element.append(result); }, calculateCellValue: function(rowData){ var result = rowData.OrganizationLongEn; if (rowData.OrganizationTypeId == 35) { result = rowData.OrganizationLongEn; } else if (rowData.RoleId == 1408 || rowData.RoleId == 1409) { if (rowData.PortFolioEn && rowData.PortFolioEn != rowData.OrganizationLongEn && (rowData.ToBeStyledAsEn == null || rowData.ToBeStyledAsEn == "")) { result += " (" + rowData.PortFolioEn + ")"; } } return (result) } },{dataField: 'PartyEn', caption: 'Political Affiliation', hidingPriority: 2, allowFiltering: true, cellTemplate: function(element, info){ var result = info.data.PartyEn; if (info.data.PartyEn) { result = "<a href=\"/sites/ParlInfo/default/en_CA/Parties/Profile?partyId=" + info.data.PartyOrganizationId + "\" target=\"_blank\">" + info.data.PartyEn+ "</a>" } element.append(result); }, calculateCellValue: function(rowData){ var result = rowData.PartyEn; if (rowData.PartyEn) { result = rowData.PartyEn; } return (result) }, encodeHtml: false},{dataField: 'StartDate', caption: 'Start Date', dataType: 'date', format: 'y-MM-d', sortIndex: 0, hidingPriority: 1, headerFilter:{ dataSource: function(data) { data.dataSource.paginate = false; data.dataSource.postProcess = function(results) {return results.reverse();};}}, allowFiltering: true, minWidth: 95, calculateDisplayValue: function(rowData){ var result = ""; if (rowData.StartDate) { if (rowData.StartDateIsApproximate){ result = rowData.StartDate.substring(0,4); month = rowData.StartDate.substring(5,7); day = rowData.StartDate.substring(8,10); if (month != "01" || (month == "01" && day != "01")){result += "-" + month;} } else { result = rowData.StartDate.substring(0,10); } if (rowData.RoleId == 127 || rowData.RoleId == 717 || rowData.RoleId == 854 || rowData.OrganizationTypeId == 26 || rowData.RoleId == 746 || rowData.GroupingOrder == 6 || rowData.GroupingOrder == 7) { return result; } else { if (rowData.ParliamentStart > rowData.StartDate && rowData.ParliamentStart >= rowData.PartyStartDate && rowData.ParliamentStart < rowData.EndDate) { return rowData.ParliamentStart.substring(0,10); } else if (rowData.PartyStartDate > rowData.StartDate && rowData.PartyStartDate < rowData.EndDate) { return rowData.PartyStartDate.substring(0,10); } else { return result; } } } }, cellTemplate: function(container, options) { var result = ""; if (options.data.StartDate) { if (options.data.StartDateIsApproximate){ result = options.data.StartDate.substring(0,4); month = options.data.StartDate.substring(5,7); day = options.data.StartDate.substring(8,10); if (month != "01" || (month == "01" && day != "01")){result += "-" + month; } } else { result = options.data.StartDate.substring(0,10); } if (options.data.RoleId == 127 || options.data.RoleId == 717 || options.data.RoleId == 854 || options.data.OrganizationTypeId == 26 || options.data.RoleId == 746 || options.data.GroupingOrder == 6 || options.data.GroupingOrder == 7) { container.append(result); } else { if (options.data.ParliamentStart > options.data.StartDate && options.data.ParliamentStart >= options.data.PartyStartDate && options.data.ParliamentStart < options.data.EndDate) { container.append(options.data.ParliamentStart.substring(0,10)); } else if (options.data.PartyStartDate > options.data.StartDate && options.data.PartyStartDate < options.data.EndDate) { container.append(options.data.PartyStartDate.substring(0,10)); } else { container.append(result); } } } } },{dataField: 'EndDate', caption: 'End Date', dataType: 'date', format: 'y-MM-d', sortOrder: 'desc', hidingPriority: 0, allowFiltering: true, minWidth: 95, calculateDisplayValue: function(rowData) { var result = ""; if (rowData.EndDate) { if (rowData.EndDateIsApproximate){ result = rowData.EndDate.substring(0,4); month = rowData.EndDate.substring(5,7); day = rowData.EndDate.substring(8,10); if (month != "01" || (month == "01" && day != "01")){result += "-" + month; } } else { result = rowData.EndDate.substring(0,10); } if (rowData.RoleId == 127 || rowData.RoleId == 717 || rowData.RoleId == 854 || rowData.RoleId == 746 || rowData.OrganizationTypeId == 26 || rowData.GroupingOrder == 6 || rowData.GroupingOrder == 7) { return result; } else { if (rowData.ParliamentEnd) { if (rowData.PartyEndDate) { if (rowData.ParliamentEnd < rowData.EndDate && rowData.ParliamentEnd <= rowData.PartyEndDate) { return rowData.ParliamentEnd.substring(0,10); } else if(rowData.PartyEndDate < rowData.EndDate) { return rowData.PartyEndDate.substring(0,10); } else { return result; } } else if (rowData.ParliamentEnd < rowData.EndDate) { return rowData.ParliamentEnd.substring(0,10); } else { return result; } } else { return result; } } } else { if (rowData.RoleId != 127 && rowData.RoleId != 717 && rowData.RoleId != 854 && rowData.RoleId != 746 && rowData.OrganizationTypeId != 26 && rowData.GroupingOrder != 6 && rowData.GroupingOrder != 7) { if (rowData.ParliamentEnd) { if (rowData.PartyEndDate < rowData.ParliamentEnd && rowData.PartyEndDate > rowData.ParliamentStart) { return rowData.PartyEndDate.substring(0,10); } else { return rowData.ParliamentEnd.substring(0,10); } } else { if (rowData.PartyEndDate) { if (rowData.ParliamentStart < rowData.PartyEndDate) { return rowData.PartyEndDate.substring(0,10); } } } } } }, cellTemplate: function(container, options) { var result = ""; if (options.data.EndDate) { if (options.data.EndDateIsApproximate){ result = options.data.EndDate.substring(0,4); month = options.data.EndDate.substring(5,7); day = options.data.EndDate.substring(8,10); if (month != "01" || (month == "01" && day != "01")){result += "-" + month; } } else { result = options.data.EndDate.substring(0,10); } if (options.data.RoleId == 127 || options.data.RoleId == 717 || options.data.RoleId == 854 || options.data.OrganizationTypeId == 26 || options.data.RoleId == 746 || options.data.GroupingOrder == 6 || options.data.GroupingOrder == 7) { container.append(result); } else { if (options.data.ParliamentEnd) { if (options.data.PartyEndDate) { if (options.data.ParliamentEnd < options.data.EndDate && options.data.ParliamentEnd <= options.data.PartyEndDate) { container.append(options.data.ParliamentEnd.substring(0,10)); } else if(options.data.PartyEndDate < options.data.EndDate) { container.append(options.data.PartyEndDate.substring(0,10)); } else { container.append(result); } } else if (options.data.ParliamentEnd < options.data.EndDate) { container.append(options.data.ParliamentEnd.substring(0,10)); } else { container.append(result); } } else { container.append(result); } } } else { if (options.data.RoleId != 127 && options.data.RoleId != 717 && options.data.RoleId != 854 && options.data.OrganizationTypeId != 26 && options.data.RoleId != 746 && options.data.GroupingOrder != 6 && options.data.GroupingOrder != 7) { if (options.data.ParliamentEnd) { if (options.data.PartyEndDate < options.data.ParliamentEnd && options.data.PartyEndDate > options.data.ParliamentStart) { container.append(options.data.PartyEndDate.substring(0,10)) } else { container.append(options.data.ParliamentEnd.substring(0,10)) } } else { if (options.data.PartyEndDate) { if (options.data.ParliamentStart < options.data.PartyEndDate) { container.append(options.data.PartyEndDate.substring(0,10)) } } } } } } }], allowColumnResizing: true, sorting: {mode: "multiple"}, filterPanel: { visible: true }, columnAutoWidth: true, columnChooser: { enabled: true, mode: "select" }, onContentReady: function (e) { var columnChooserView = e.component.getView("columnChooserView"); if (!columnChooserView._popupContainer) { columnChooserView._initializePopupContainer(); columnChooserView.render(); columnChooserView._popupContainer.option("position", { of: e.element, my: "right top", at: "right top", offset: "0 50"}); } }, filterRow: { visible: true}, headerFilter: { visible: true, allowSearch: true }, pager: { showInfo: true, showPageSizeSelector: false, allowedPageSizes: [], showNavigationButtons: true },grouping: { contextMenuEnabled: true }, groupPanel: { visible: true }, grouping: { autoExpandAll: true }, searchPanel: { visible: true }, "export": { enabled: true, fileName: "Parliamentarian Profile - Federal Experience", allowExportSelectedData: false }, onToolbarPreparing: function(e) { var dataGrid = e.component; e.toolbarOptions.items.unshift({ location: "after", widget: "dxButton", options: { icon: "refresh", hint: resetAltText, onClick: function() { var gridinstance = $('#gridFederalExperience').dxDataGrid('instance'); gridinstance.state({}); } } }, { location: "after", widget: "dxButton", options: { icon: "expand", hint: expandAltText, onClick: function() { var expanded = e.component.option("grouping.autoExpandAll"); dataGrid.option("grouping.autoExpandAll", !expanded); if (expanded){ this.option("icon", "expand"); this.option("hint", expandAltText); }else{ this.option("icon", "collapse"); this.option("hint", collapseAltText); } } } }); }, stateStoring: { enabled: false, type: "localStorage", storageKey: "" },paging: { enabled: false }, wordWrapEnabled: true, grouping: { autoExpandAll: false, } }); loadPanel.hide(); }); </Script> <!-- gridName excludes the # sign because it is needed without the # in some places --> <div> <div id="TitleAndSummaryDiv"> </div> </div> <div id="loadPanel" ></div> <div id="gridMilitary" class="gridContainer" ></div> <div id="resetButton"></div> <div id="popup"><div class="popup"></div></div><script type="text/javascript"> var notes = {}, popup = null, popupOptions = { width: 400, height: 250, contentTemplate: function() { return $("<div />").append( $("<p>" + notes + "</p>") ); }, showTitle: true, title: "Notes", visible: false, dragEnabled: false, closeOnOutsideClick: true }; function showInfo(data) { notes = data; if(popup) { $(".popup").remove(); } var $popupContainer = $("<div />") .addClass("popup") .appendTo($("#popup")); popup = $popupContainer.dxPopup(popupOptions).dxPopup("instance"); popup.show(); }</script> <script type="text/javascript"> var url = window.window.location.href; var expandAltText = "Expand All"; var collapseAltText = "Collapse All"; var resetAltText = "Reset"; if (url.toLowerCase().indexOf("fr_ca") >= 0){ DevExpress.localization.locale("fr"); expandAltText = "D\xE9velopper"; collapseAltText = "R\xE9duire"; resetAltText = "R\xE9initialiser"; } $( window ).on( "load", function() { //Load the Controls for search var loadPanel = $("#loadPanel").dxLoadPanel({ shadingColor: "rgba(0,0,0,0.4)", visible: false, showIndicator: true, showPane: true, shading: true, closeOnOutsideClick: false }).dxLoadPanel("instance"); loadPanel.show(); //Load the Grid $("#gridMilitary").dxDataGrid({ dataSource: gridMilitaryDataSource, //gridMilitaryDataSource is SET in the main view of this page where the data call is performed allowColumnReordering: true, columns: [{dataField: 'NameEn', caption: 'Role', allowFiltering: true, encodeHtml: false, calculateCellValue: function(rowData){ var result = rowData.NameEn; var notes = ""; if (rowData.ToBeStyledAsEn != null && rowData.ToBeStyledAsEn.length > 0){ result = rowData.ToBeStyledAsEn; } if (rowData.IsActing){ result += "&nbsp;<i>*Acting</i>"; } if (rowData.NotesEn != null && rowData.NotesEn.length > 0){ notes = "<br /><br /><i>" + rowData.NotesEn + "</i>"; result += notes } return (result); }},{dataField: 'OrganizationLongEn', caption: 'Organization', allowFiltering: true},{dataField: 'StartDate', caption: 'Start Date', dataType: 'date', format: 'y-MM-d', sortIndex: 0, sortOrder: 'desc', hidingPriority: 1, headerFilter:{ dataSource: function(data) { data.dataSource.paginate = false; data.dataSource.postProcess = function(results) {return results.reverse();};}}, allowFiltering: true, minWidth: 95, cellTemplate: function(container, options) { if (options.data.StartDate) { if (options.data.StartDateIsApproximate){ result = options.data.StartDate.substring(0,4); month = options.data.StartDate.substring(5,7); day = options.data.StartDate.substring(8,10); if (month != "01" || (month == "01" && day != "01")){result += "-" + month} container.append("<span>" + result + "</span>"); } else { container.append("<span>" + options.data.StartDate.substring(0,10) + "</span>") } } }},{dataField: 'EndDate', caption: 'End Date', dataType: 'date', format: 'y-MM-d', hidingPriority: 0, allowFiltering: true, minWidth: 95, cellTemplate: function(container, options) { if (options.data.EndDate) { if (options.data.StartDateIsApproximate){ result = options.data.EndDate.substring(0,4); month = options.data.EndDate.substring(5,7); day = options.data.EndDate.substring(8,10); if (month != "01" || (month == "01" && day != "01")){result += "-" + month} container.append("<span>" + result + "</span>"); } else { container.append("<span>" + options.data.EndDate.substring(0,10) + "</span>") } } }}], allowColumnResizing: true, sorting: {mode: "multiple"}, filterPanel: { visible: true }, columnAutoWidth: true, columnChooser: { enabled: true, mode: "select" }, onContentReady: function (e) { var columnChooserView = e.component.getView("columnChooserView"); if (!columnChooserView._popupContainer) { columnChooserView._initializePopupContainer(); columnChooserView.render(); columnChooserView._popupContainer.option("position", { of: e.element, my: "right top", at: "right top", offset: "0 50"}); } }, filterRow: { visible: true}, headerFilter: { visible: true, allowSearch: true }, pager: { showInfo: true, showPageSizeSelector: false, allowedPageSizes: [], showNavigationButtons: true },grouping: { contextMenuEnabled: true }, groupPanel: { visible: true }, grouping: { autoExpandAll: true }, searchPanel: { visible: true }, "export": { enabled: true, fileName: "Parliamentarian Profile - Military Experience", allowExportSelectedData: false }, onToolbarPreparing: function(e) { var dataGrid = e.component; e.toolbarOptions.items.unshift({ location: "after", widget: "dxButton", options: { icon: "refresh", hint: resetAltText, onClick: function() { var gridinstance = $('#gridMilitary').dxDataGrid('instance'); gridinstance.state({}); } } }, { location: "after", widget: "dxButton", options: { icon: "expand", hint: expandAltText, onClick: function() { var expanded = e.component.option("grouping.autoExpandAll"); dataGrid.option("grouping.autoExpandAll", !expanded); if (expanded){ this.option("icon", "expand"); this.option("hint", expandAltText); }else{ this.option("icon", "collapse"); this.option("hint", collapseAltText); } } } }); }, stateStoring: { enabled: false, type: "localStorage", storageKey: "" },paging: { enabled: false }, wordWrapEnabled: true, grouping: { autoExpandAll: false, } }); loadPanel.hide(); }); </Script> <!-- gridName excludes the # sign because it is needed without the # in some places --> <div> <div id="TitleAndSummaryDiv"> </div> </div> <div id="loadPanel" ></div> <div id="gridCommitteeMembership" class="gridContainer" ></div> <div id="resetButton"></div> <div id="popup"><div class="popup"></div></div><script type="text/javascript"> var notes = {}, popup = null, popupOptions = { width: 400, height: 250, contentTemplate: function() { return $("<div />").append( $("<p>" + notes + "</p>") ); }, showTitle: true, title: "Notes", visible: false, dragEnabled: false, closeOnOutsideClick: true }; function showInfo(data) { notes = data; if(popup) { $(".popup").remove(); } var $popupContainer = $("<div />") .addClass("popup") .appendTo($("#popup")); popup = $popupContainer.dxPopup(popupOptions).dxPopup("instance"); popup.show(); }</script> <script type="text/javascript"> var url = window.window.location.href; var expandAltText = "Expand All"; var collapseAltText = "Collapse All"; var resetAltText = "Reset"; if (url.toLowerCase().indexOf("fr_ca") >= 0){ DevExpress.localization.locale("fr"); expandAltText = "D\xE9velopper"; collapseAltText = "R\xE9duire"; resetAltText = "R\xE9initialiser"; } $( window ).on( "load", function() { //Load the Controls for search $.ExpandAll = function() { if (botCheck() == true) { return true; } else { return false; } } var loadPanel = $("#loadPanel").dxLoadPanel({ shadingColor: "rgba(0,0,0,0.4)", visible: false, showIndicator: true, showPane: true, shading: true, closeOnOutsideClick: false }).dxLoadPanel("instance"); loadPanel.show(); //Load the Grid $("#gridCommitteeMembership").dxDataGrid({ dataSource: gridCommitteeMembershipDataSource, //gridCommitteeMembershipDataSource is SET in the main view of this page where the data call is performed allowColumnReordering: true, columns: [{dataField: 'ParliamentNumber', caption: 'Parliament', dataType: 'number', sortIndex: 0, sortOrder: 'desc', groupIndex: 0, headerFilter:{ dataSource: function(data) { data.dataSource.paginate = false; data.dataSource.postProcess = function(results) {return results.reverse();};}}, allowFiltering: true},{dataField: 'SessionNumber', caption: 'Session', dataType: 'number', sortIndex: 1, sortOrder: 'desc', allowFiltering: true},{dataField: 'CompositionTypeLongEn', caption: 'Composition', allowFiltering: true},{dataField: 'CommitteeTypeEn', caption: 'Type', hidingPriority: 0, allowFiltering: true, visible: true},{dataField: 'NameEn', caption: 'Role', allowFiltering: true, encodeHtml: false, calculateCellValue: function(rowData){ var result = rowData.NameEn; if (rowData.NotesEn != null && rowData.NotesEn .length > 0){ result += "<br /><br /><i>" + rowData.NotesEn + "</i>"; } return (result); }},{dataField: 'OrganizationLongEn', caption: 'Organization', sortIndex: 2, sortOrder: 'asc', allowFiltering: true}], allowColumnResizing: true, sorting: {mode: "multiple"}, filterPanel: { visible: true }, columnAutoWidth: true, columnChooser: { enabled: true, mode: "select" }, onContentReady: function (e) { var columnChooserView = e.component.getView("columnChooserView"); if (!columnChooserView._popupContainer) { columnChooserView._initializePopupContainer(); columnChooserView.render(); columnChooserView._popupContainer.option("position", { of: e.element, my: "right top", at: "right top", offset: "0 50"}); } }, filterRow: { visible: true}, headerFilter: { visible: true, allowSearch: true }, pager: { showInfo: true, showPageSizeSelector: false, allowedPageSizes: [], showNavigationButtons: true },grouping: { contextMenuEnabled: true }, groupPanel: { visible: true }, grouping: { autoExpandAll: true }, searchPanel: { visible: true }, "export": { enabled: true, fileName: "Parliamentarian Profile - Committee Membership", allowExportSelectedData: false }, onToolbarPreparing: function(e) { var dataGrid = e.component; e.toolbarOptions.items.unshift({ location: "after", widget: "dxButton", options: { icon: "refresh", hint: resetAltText, onClick: function() { var gridinstance = $('#gridCommitteeMembership').dxDataGrid('instance'); gridinstance.state({}); } } }, { location: "after", widget: "dxButton", options: { icon: "expand", hint: expandAltText, onClick: function() { var expanded = e.component.option("grouping.autoExpandAll"); dataGrid.option("grouping.autoExpandAll", !expanded); if (expanded){ this.option("icon", "expand"); this.option("hint", expandAltText); }else{ this.option("icon", "collapse"); this.option("hint", collapseAltText); } } } }); }, stateStoring: { enabled: false, type: "localStorage", storageKey: "" },paging: { enabled: false }, wordWrapEnabled: true, grouping: { autoExpandAll: $.ExpandAll(), } }); loadPanel.hide(); }); </Script> <!-- gridName excludes the # sign because it is needed without the # in some places --> <div> <div id="TitleAndSummaryDiv"> </div> </div> <div id="loadPanel" ></div> <div id="gridProvincialExperience" class="gridContainer" ></div> <div id="resetButton"></div> <div id="popup"><div class="popup"></div></div><script type="text/javascript"> var notes = {}, popup = null, popupOptions = { width: 400, height: 250, contentTemplate: function() { return $("<div />").append( $("<p>" + notes + "</p>") ); }, showTitle: true, title: "Notes", visible: false, dragEnabled: false, closeOnOutsideClick: true }; function showInfo(data) { notes = data; if(popup) { $(".popup").remove(); } var $popupContainer = $("<div />") .addClass("popup") .appendTo($("#popup")); popup = $popupContainer.dxPopup(popupOptions).dxPopup("instance"); popup.show(); }</script> <script type="text/javascript"> var url = window.window.location.href; var expandAltText = "Expand All"; var collapseAltText = "Collapse All"; var resetAltText = "Reset"; if (url.toLowerCase().indexOf("fr_ca") >= 0){ DevExpress.localization.locale("fr"); expandAltText = "D\xE9velopper"; collapseAltText = "R\xE9duire"; resetAltText = "R\xE9initialiser"; } $( window ).on( "load", function() { //Load the Controls for search var loadPanel = $("#loadPanel").dxLoadPanel({ shadingColor: "rgba(0,0,0,0.4)", visible: false, showIndicator: true, showPane: true, shading: true, closeOnOutsideClick: false }).dxLoadPanel("instance"); loadPanel.show(); //Load the Grid $("#gridProvincialExperience").dxDataGrid({ dataSource: gridProvincialExperienceDataSource, //gridProvincialExperienceDataSource is SET in the main view of this page where the data call is performed allowColumnReordering: true, columns: [{dataField: 'OrganizationLongEn', caption: 'Organization', allowFiltering: true},{dataField: 'NameEn', caption: 'Role', allowFiltering: true},{dataField: 'PartyEn', caption: 'Political Affiliation', hidingPriority: 2, allowFiltering: true},{dataField: 'StartDate', caption: 'Start Date', dataType: 'date', format: 'y-MM-d', sortIndex: 0, sortOrder: 'desc', hidingPriority: 1, headerFilter:{ dataSource: function(data) { data.dataSource.paginate = false; data.dataSource.postProcess = function(results) {return results.reverse();};}}, allowFiltering: true, minWidth: 95, cellTemplate: function(container, options) { if (options.data.StartDate) { if (options.data.StartDateIsApproximate){ result = options.data.StartDate.substring(0,4); month = options.data.StartDate.substring(5,7); day = options.data.StartDate.substring(8,10); if (month != "01" || (month == "01" && day != "01")){result += "-" + month} container.append("<span>" + result + "</span>"); } else { container.append("<span>" + options.data.StartDate.substring(0,10) + "</span>") } } } },{dataField: 'EndDate', caption: 'End Date', dataType: 'date', format: 'y-MM-d', hidingPriority: 0, allowFiltering: true, minWidth: 95, cellTemplate: function(container, options) { if (options.data.EndDate) { if (options.data.EndDateIsApproximate){ result = options.data.EndDate.substring(0,4); month = options.data.EndDate.substring(5,7); day = options.data.EndDate.substring(8,10); if (month != "01" || (month == "01" && day != "01")){result += "-" + month} container.append("<span>" + result + "</span>"); } else { container.append("<span>" + options.data.EndDate.substring(0,10) + "</span>") } } }}], allowColumnResizing: true, sorting: {mode: "multiple"}, filterPanel: { visible: true }, columnAutoWidth: true, columnChooser: { enabled: true, mode: "select" }, onContentReady: function (e) { var columnChooserView = e.component.getView("columnChooserView"); if (!columnChooserView._popupContainer) { columnChooserView._initializePopupContainer(); columnChooserView.render(); columnChooserView._popupContainer.option("position", { of: e.element, my: "right top", at: "right top", offset: "0 50"}); } }, filterRow: { visible: true}, headerFilter: { visible: true, allowSearch: true }, pager: { showInfo: true, showPageSizeSelector: false, allowedPageSizes: [], showNavigationButtons: true },grouping: { contextMenuEnabled: true }, groupPanel: { visible: true }, grouping: { autoExpandAll: true }, searchPanel: { visible: true }, "export": { enabled: true, fileName: "Parliamentarian Profile - Provincial Experience", allowExportSelectedData: false }, onToolbarPreparing: function(e) { var dataGrid = e.component; e.toolbarOptions.items.unshift({ location: "after", widget: "dxButton", options: { icon: "refresh", hint: resetAltText, onClick: function() { var gridinstance = $('#gridProvincialExperience').dxDataGrid('instance'); gridinstance.state({}); } } }, { location: "after", widget: "dxButton", options: { icon: "expand", hint: expandAltText, onClick: function() { var expanded = e.component.option("grouping.autoExpandAll"); dataGrid.option("grouping.autoExpandAll", !expanded); if (expanded){ this.option("icon", "expand"); this.option("hint", expandAltText); }else{ this.option("icon", "collapse"); this.option("hint", collapseAltText); } } } }); }, stateStoring: { enabled: false, type: "localStorage", storageKey: "" },paging: { enabled: false }, grouping: { autoExpandAll: false, } }); loadPanel.hide(); }); </Script> <!-- gridName excludes the # sign because it is needed without the # in some places --> <div> <div id="TitleAndSummaryDiv"> </div> </div> <div id="loadPanel" ></div> <div id="gridFamily" class="gridContainer" ></div> <div id="resetButton"></div> <div id="popup"><div class="popup"></div></div><script type="text/javascript"> var notes = {}, popup = null, popupOptions = { width: 400, height: 250, contentTemplate: function() { return $("<div />").append( $("<p>" + notes + "</p>") ); }, showTitle: true, title: "Notes", visible: false, dragEnabled: false, closeOnOutsideClick: true }; function showInfo(data) { notes = data; if(popup) { $(".popup").remove(); } var $popupContainer = $("<div />") .addClass("popup") .appendTo($("#popup")); popup = $popupContainer.dxPopup(popupOptions).dxPopup("instance"); popup.show(); }</script> <script type="text/javascript"> var url = window.window.location.href; var expandAltText = "Expand All"; var collapseAltText = "Collapse All"; var resetAltText = "Reset"; if (url.toLowerCase().indexOf("fr_ca") >= 0){ DevExpress.localization.locale("fr"); expandAltText = "D\xE9velopper"; collapseAltText = "R\xE9duire"; resetAltText = "R\xE9initialiser"; } $( window ).on( "load", function() { //Load the Controls for search var loadPanel = $("#loadPanel").dxLoadPanel({ shadingColor: "rgba(0,0,0,0.4)", visible: false, showIndicator: true, showPane: true, shading: true, closeOnOutsideClick: false }).dxLoadPanel("instance"); loadPanel.show(); //Load the Grid $("#gridFamily").dxDataGrid({ dataSource: gridFamilyDataSource, //gridFamilyDataSource is SET in the main view of this page where the data call is performed allowColumnReordering: true, columns: [{dataField: 'PersonId', caption: 'PersonId', dataType: 'number', allowFiltering: true, visible: false, showInColumnChooser: false},{dataField: 'RelationNameEn', caption: 'Relative', sortOrder: 'asc', allowFiltering: true},{dataField: 'FirstName', caption: 'Name', allowFiltering: true, calculateCellValue: function(rowData){ var result = rowData.FirstName; result += " " + rowData.LastName; var link = "/sites/ParlInfo/default/en_CA/People/Profile?personId=" + rowData.PersonId; return ("<a href=\"" + link + "\" target=\"_blank\">" + result + "</a>") }, encodeHtml: false},{dataField: 'DateOfBirth', caption: 'Date Of Birth', dataType: 'date', format: 'y-MM-d', headerFilter:{ dataSource: function(data) { data.dataSource.paginate = false; data.dataSource.postProcess = function(results) {return results.reverse();};}}, allowFiltering: true, minWidth: 95, cellTemplate: function(container, options) { if (options.data.DateOfBirth) { if (options.data.DateOfBirthIsApproximate){ approxBirth = options.data.DateOfBirth.substring(0, 4); approxMonth = options.data.DateOfBirth.substring(5, 7); approxDay = options.data.DateOfBirth.substring(8, 10); if (approxMonth != "01" || approxMonth == "01" && approxDay != "01"){approxBirth += "-" + approxMonth} container.append("<span>" + approxBirth + "</span>"); }else{ container.append("<span>" + options.data.DateOfBirth.substring(0,10) + "</span>") } } }},{dataField: 'DateOfDeath', caption: 'Date Of Death', dataType: 'date', format: 'y-MM-d', allowFiltering: true, minWidth: 95, cellTemplate: function(container, options) { if (options.data.DateOfDeath) { if (options.data.DateOfDeathIsApproximate){ approxDeath = options.data.DateOfDeath.substring(0, 4); approxMonth = options.data.DateOfDeath.substring(5, 7); approxDay = options.data.DateOfDeath.substring(8, 10); if (approxMonth != "01" || approxMonth == "01" && approxDay != "01"){approxDeath += "-" + approxMonth} container.append("<span>" + approxDeath + "</span>"); }else{ container.append("<span>" + options.data.DateOfDeath.substring(0,10) + "</span>") } } }}], allowColumnResizing: true, sorting: {mode: "multiple"}, filterPanel: { visible: true }, columnAutoWidth: true, columnChooser: { enabled: true, mode: "select" }, onContentReady: function (e) { var columnChooserView = e.component.getView("columnChooserView"); if (!columnChooserView._popupContainer) { columnChooserView._initializePopupContainer(); columnChooserView.render(); columnChooserView._popupContainer.option("position", { of: e.element, my: "right top", at: "right top", offset: "0 50"}); } }, filterRow: { visible: true}, headerFilter: { visible: true, allowSearch: true }, pager: { showInfo: true, showPageSizeSelector: false, allowedPageSizes: [], showNavigationButtons: true },grouping: { contextMenuEnabled: true }, groupPanel: { visible: true }, grouping: { autoExpandAll: true }, searchPanel: { visible: true }, "export": { enabled: true, fileName: "Parliamentarian Profile - Family Ties in Parliament", allowExportSelectedData: false }, onToolbarPreparing: function(e) { var dataGrid = e.component; e.toolbarOptions.items.unshift({ location: "after", widget: "dxButton", options: { icon: "refresh", hint: resetAltText, onClick: function() { var gridinstance = $('#gridFamily').dxDataGrid('instance'); gridinstance.state({}); } } }, { location: "after", widget: "dxButton", options: { icon: "expand", hint: expandAltText, onClick: function() { var expanded = e.component.option("grouping.autoExpandAll"); dataGrid.option("grouping.autoExpandAll", !expanded); if (expanded){ this.option("icon", "expand"); this.option("hint", expandAltText); }else{ this.option("icon", "collapse"); this.option("hint", collapseAltText); } } } }); }, stateStoring: { enabled: false, type: "localStorage", storageKey: "" },filterPanel: { visible: false }, paging: { enabled: false }, grouping: { autoExpandAll: false, } }); loadPanel.hide(); }); </Script> <!-- gridName excludes the # sign because it is needed without the # in some places --> <div> <div id="TitleAndSummaryDiv"> </div> </div> <div id="loadPanel" ></div> <div id="gridFederalPublicOffice" class="gridContainer" ></div> <div id="resetButton"></div> <div id="popup"><div class="popup"></div></div><script type="text/javascript"> var notes = {}, popup = null, popupOptions = { width: 400, height: 250, contentTemplate: function() { return $("<div />").append( $("<p>" + notes + "</p>") ); }, showTitle: true, title: "Notes", visible: false, dragEnabled: false, closeOnOutsideClick: true }; function showInfo(data) { notes = data; if(popup) { $(".popup").remove(); } var $popupContainer = $("<div />") .addClass("popup") .appendTo($("#popup")); popup = $popupContainer.dxPopup(popupOptions).dxPopup("instance"); popup.show(); }</script> <script type="text/javascript"> var url = window.window.location.href; var expandAltText = "Expand All"; var collapseAltText = "Collapse All"; var resetAltText = "Reset"; if (url.toLowerCase().indexOf("fr_ca") >= 0){ DevExpress.localization.locale("fr"); expandAltText = "D\xE9velopper"; collapseAltText = "R\xE9duire"; resetAltText = "R\xE9initialiser"; } $( window ).on( "load", function() { //Load the Controls for search var loadPanel = $("#loadPanel").dxLoadPanel({ shadingColor: "rgba(0,0,0,0.4)", visible: false, showIndicator: true, showPane: true, shading: true, closeOnOutsideClick: false }).dxLoadPanel("instance"); loadPanel.show(); //Load the Grid $("#gridFederalPublicOffice").dxDataGrid({ dataSource: gridFederalPublicOfficeDataSource, //gridFederalPublicOfficeDataSource is SET in the main view of this page where the data call is performed allowColumnReordering: true, columns: [{dataField: 'NameEn', caption: 'Role', allowFiltering: true, calculateCellValue: function(rowData){ var roleName = rowData.NameEn; if (rowData.ToBeStyledAsEn != null && rowData.ToBeStyledAsEn.length > 0) { return rowData.ToBeStyledAsEn } return roleName; }},{dataField: 'OrganizationLongEn', caption: 'Organization', allowFiltering: true},{dataField: 'StartDate', caption: 'Start Date', dataType: 'date', format: 'y-MM-d', sortIndex: 0, sortOrder: 'desc', hidingPriority: 1, headerFilter:{ dataSource: function(data) { data.dataSource.paginate = false; data.dataSource.postProcess = function(results) {return results.reverse();};}}, allowFiltering: true, minWidth: 95, cellTemplate: function(container, options) { if (options.data.StartDate) { if (options.data.StartDateIsApproximate){ result = options.data.StartDate.substring(0,4); month = options.data.StartDate.substring(5,7); day = options.data.StartDate.substring(8,10); if (month != "01" || (month == "01" && day != "01")){result += "-" + month} container.append("<span>" + result + "</span>"); } else { container.append("<span>" + options.data.StartDate.substring(0,10) + "</span>") } } }},{dataField: 'EndDate', caption: 'End Date', dataType: 'date', format: 'y-MM-d', hidingPriority: 0, allowFiltering: true, minWidth: 95, cellTemplate: function(container, options) { if (options.data.EndDate) { if (options.data.EndDateIsApproximate){ result = options.data.EndDate.substring(0,4); month = options.data.EndDate.substring(5,7); day = options.data.EndDate.substring(8,10); if (month != "01" || (month == "01" && day != "01")){result += "-" + month} container.append("<span>" + result + "</span>"); } else { container.append("<span>" + options.data.EndDate.substring(0,10) + "</span>") } } }}], allowColumnResizing: true, sorting: {mode: "multiple"}, filterPanel: { visible: true }, columnAutoWidth: true, columnChooser: { enabled: true, mode: "select" }, onContentReady: function (e) { var columnChooserView = e.component.getView("columnChooserView"); if (!columnChooserView._popupContainer) { columnChooserView._initializePopupContainer(); columnChooserView.render(); columnChooserView._popupContainer.option("position", { of: e.element, my: "right top", at: "right top", offset: "0 50"}); } }, filterRow: { visible: true}, headerFilter: { visible: true, allowSearch: true }, pager: { showInfo: true, showPageSizeSelector: false, allowedPageSizes: [], showNavigationButtons: true },grouping: { contextMenuEnabled: true }, groupPanel: { visible: true }, grouping: { autoExpandAll: true }, searchPanel: { visible: true }, "export": { enabled: true, fileName: "Parliamentarian Profile - Federal Public Office", allowExportSelectedData: false }, onToolbarPreparing: function(e) { var dataGrid = e.component; e.toolbarOptions.items.unshift({ location: "after", widget: "dxButton", options: { icon: "refresh", hint: resetAltText, onClick: function() { var gridinstance = $('#gridFederalPublicOffice').dxDataGrid('instance'); gridinstance.state({}); } } }, { location: "after", widget: "dxButton", options: { icon: "expand", hint: expandAltText, onClick: function() { var expanded = e.component.option("grouping.autoExpandAll"); dataGrid.option("grouping.autoExpandAll", !expanded); if (expanded){ this.option("icon", "expand"); this.option("hint", expandAltText); }else{ this.option("icon", "collapse"); this.option("hint", collapseAltText); } } } }); }, stateStoring: { enabled: false, type: "localStorage", storageKey: "" },paging: { enabled: false }, wordWrapEnabled: true, grouping: { autoExpandAll: false, } }); loadPanel.hide(); }); </Script> <!-- gridName excludes the # sign because it is needed without the # in some places --> <div> <div id="TitleAndSummaryDiv"> </div> </div> <div id="loadPanel" ></div> <div id="gridFederalExperienceList" class="gridContainer" ></div> <div id="resetButton"></div> <div id="popup"><div class="popup"></div></div><script type="text/javascript"> var notes = {}, popup = null, popupOptions = { width: 400, height: 250, contentTemplate: function() { return $("<div />").append( $("<p>" + notes + "</p>") ); }, showTitle: true, title: "Notes", visible: false, dragEnabled: false, closeOnOutsideClick: true }; function showInfo(data) { notes = data; if(popup) { $(".popup").remove(); } var $popupContainer = $("<div />") .addClass("popup") .appendTo($("#popup")); popup = $popupContainer.dxPopup(popupOptions).dxPopup("instance"); popup.show(); }</script> <script type="text/javascript"> var url = window.window.location.href; var expandAltText = "Expand All"; var collapseAltText = "Collapse All"; var resetAltText = "Reset"; if (url.toLowerCase().indexOf("fr_ca") >= 0){ DevExpress.localization.locale("fr"); expandAltText = "D\xE9velopper"; collapseAltText = "R\xE9duire"; resetAltText = "R\xE9initialiser"; } $( window ).on( "load", function() { //Load the Controls for search var loadPanel = $("#loadPanel").dxLoadPanel({ shadingColor: "rgba(0,0,0,0.4)", visible: false, showIndicator: true, showPane: true, shading: true, closeOnOutsideClick: false }).dxLoadPanel("instance"); loadPanel.show(); //Load the Grid $("#gridFederalExperienceList").dxDataGrid({ dataSource: gridFederalExperienceListDataSource, //gridFederalExperienceListDataSource is SET in the main view of this page where the data call is performed allowColumnReordering: true, columns: [{dataField: 'GroupingTitleEn', caption: 'Section', allowFiltering: true},{dataField: 'NameEn', caption: 'Role', allowFiltering: true, encodeHtml: false, cellTemplate: function(element, info){ var result = info.data.NameEn; var notes = ""; if (info.data.RoleId == 719 && info.data.OrganizationTypeId == 50) { result = "Senatorial Region Member"; } if (info.data.RoleId == 719 && info.data.OrganizationTypeId == 35) { result = "MP"; } if (info.data.ToBeStyledAsEn != null && info.data.ToBeStyledAsEn.length > 0){ result = info.data.ToBeStyledAsEn; } if (info.data.IsActing){ result += "&nbsp;<i>*Acting</i>"; } if (info.data.NotesEn != null && info.data.NotesEn.length > 0){ notes = "<br /><br /><i>" + info.data.NotesEn + "</i>"; if (info.data.EndReasonTypeFr != null && info.data.EndReasonTypeFr.length > 0 && info.data.RoleId == 719) { if (info.data.EndDate >= info.data.ParliamentStart && info.data.EndDate <= info.data.ParliamentEnd) { result += notes; } } else if (info.data.RoleId == 722) { if (info.data.StartDate >= info.data.ParliamentStart && info.data.StartDate <= info.data.ParliamentEnd) { result += notes; } else if (info.data.ParliamentNumber == 41 && info.data.OrganizationId == 4831) { result += notes; } } else if (info.data.RoleId != 719 && info.data.RoleId != 722) { result += notes; } } element.append(result); }, headerFilter: { dataSource: { postProcess: function (data) { return data .map(function(element, info){ var result = info.data.NameEn; var notes = ""; if (info.data.RoleId == 719 && info.data.OrganizationTypeId == 50) { result = "Senatorial Region Member"; } if (info.data.RoleId == 719 && info.data.OrganizationTypeId == 35) { result = "MP"; } if (info.data.ToBeStyledAsEn != null && info.data.ToBeStyledAsEn.length > 0){ result = info.data.ToBeStyledAsEn; } element.append(result); }) .filter(function(value, index, self) { return self.indexOf(value) === index; }) .sort() .map(function(x) { return { text: x, value: ["NameEn", "contains", x] }; }); }, load: function (e) { var grid = $("#gridFederalExperienceList").dxDataGrid('instance'); var filterExpr = grid.getCombinedFilter(); var gridDataSource = grid.getDataSource(); return gridDataSource.store().load({ filter: filterExpr }); } } }, calculateCellValue: function(rowData){ var result = rowData.NameEn; var notes = ""; if (rowData.RoleId == 719 && rowData.OrganizationTypeId == 50) { result = "Senatorial Region Member"; } if (rowData.RoleId == 719 && rowData.OrganizationTypeId == 35) { result = "MP"; } if (rowData.ToBeStyledAsEn != null && rowData.ToBeStyledAsEn.length > 0){ result = rowData.ToBeStyledAsEn; } if (rowData.IsActing){ result += "&nbsp;<i>*Acting</i>"; } if (rowData.NotesEn != null && rowData.NotesEn.length > 0){ notes = "\r\n\r\n" + rowData.NotesEn; if (rowData.EndReasonTypeFr != null && rowData.EndReasonTypeFr.length > 0 && rowData.RoleId == 719) { if (rowData.EndDate >= rowData.ParliamentStart && rowData.EndDate <= rowData.ParliamentEnd) { result += notes; } } else if (rowData.RoleId == 722) { if (rowData.StartDate >= rowData.ParliamentStart && rowData.StartDate <= rowData.ParliamentEnd) { result += notes; } else if (rowData.ParliamentNumber == 41 && rowData.OrganizationId == 4831) { result += notes; } } else if (rowData.RoleId != 719 && rowData.RoleId != 722) { result += notes; } } return (result); }, headerFilter: { dataSource: { postProcess: function (data) { return data .map(function(rowData){ var result = rowData.NameEn; var notes = ""; if (rowData.RoleId == 719 && rowData.OrganizationTypeId == 50) { result = "Senatorial Region Member"; } if (rowData.RoleId == 719 && rowData.OrganizationTypeId == 35) { result = "MP"; } if (rowData.ToBeStyledAsEn != null && rowData.ToBeStyledAsEn.length > 0){ result = rowData.ToBeStyledAsEn; } return (result); }) .filter(function(value, index, self) { return self.indexOf(value) === index; }) .sort() .map(function(x) { return { text: x, value: ["NameEn", "contains", x] }; }); }, load: function (e) { var grid = $("#gridFederalExperienceList").dxDataGrid('instance'); var filterExpr = grid.getCombinedFilter(); var gridDataSource = grid.getDataSource(); return gridDataSource.store().load({ filter: filterExpr }); } } } },{dataField: 'OrganizationLongEn', caption: 'Organization', allowFiltering: true, encodeHtml: false, cellTemplate: function(element, info){ var result = info.data.OrganizationLongEn; if (info.data.OrganizationTypeId == 35) { result = "<a href=\"/sites/ParlInfo/default/en_CA/ElectionsRidings/Ridings/Profile?OrganizationId=" + info.data.OrganizationId + "\" target=\"_blank\">" + info.data.OrganizationLongEn+ "</a>" } else if (info.data.RoleId == 1408 || info.data.RoleId == 1409) { if (info.data.PortFolioEn && info.data.PortFolioEn != info.data.OrganizationLongEn && (info.data.ToBeStyledAsEn == null || info.data.ToBeStyledAsEn == "")) { result += " (" + info.data.PortFolioEn + ")"; } } element.append(result); }, calculateCellValue: function(rowData){ var result = rowData.OrganizationLongEn; if (rowData.OrganizationTypeId == 35) { result = rowData.OrganizationLongEn; } else if (rowData.RoleId == 1408 || rowData.RoleId == 1409) { if (rowData.PortFolioEn && rowData.PortFolioEn != rowData.OrganizationLongEn && (rowData.ToBeStyledAsEn == null || rowData.ToBeStyledAsEn == "")) { result += " (" + rowData.PortFolioEn + ")"; } } return (result) }},{dataField: 'PartyEn', caption: 'Political Affiliation', allowFiltering: true, cellTemplate: function(element, info){ var result = info.data.PartyEn; if (info.data.PartyEn) { result = "<a href=\"/sites/ParlInfo/default/en_CA/Parties/Profile?partyId=" + info.data.PartyOrganizationId + "\" target=\"_blank\">" + info.data.PartyEn+ "</a>" } element.append(result); }, calculateCellValue: function(rowData){ var result = rowData.PartyEn; if (rowData.PartyEn) { result = rowData.PartyEn; } return (result) }, encodeHtml: false},{dataField: 'StartDate', caption: 'Start Date', dataType: 'date', format: 'y-MM-d', headerFilter:{ dataSource: function(data) { data.dataSource.paginate = false; data.dataSource.postProcess = function(results) {return results.reverse();};}}, allowFiltering: true, minWidth: 95, calculateDisplayValue: function(rowData){ var result = ""; if (rowData.StartDate) { if (rowData.StartDateIsApproximate){ result = rowData.StartDate.substring(0,4); month = rowData.StartDate.substring(5,7); day = rowData.StartDate.substring(8,10); if (month != "01" || (month == "01" && day != "01")){result += "-" + month;} } else { result = rowData.StartDate.substring(0,10); } if (rowData.RoleId == 127 || rowData.RoleId == 717 || rowData.RoleId == 854 || rowData.OrganizationTypeId == 26 || rowData.GroupingOrder == 6 || rowData.GroupingOrder == 7) { return result; } else { if (rowData.PartyStartDate > rowData.StartDate) { return rowData.PartyStartDate.substring(0,10); } else { return result; } } } }, cellTemplate: function(container, options) { var result = ""; if (options.data.StartDate) { if (options.data.StartDateIsApproximate){ result = options.data.StartDate.substring(0,4); month = options.data.StartDate.substring(5,7); day = options.data.StartDate.substring(8,10); if (month != "01" || (month == "01" && day != "01")){result += "-" + month; } } else { result = options.data.StartDate.substring(0,10); } if (options.data.RoleId == 127 || options.data.RoleId == 717 || options.data.RoleId == 854 || options.data.OrganizationTypeId == 26 || options.data.GroupingOrder == 6 || options.data.GroupingOrder == 7) { container.append(result); } else { if (options.data.PartyStartDate > options.data.StartDate) { container.append(options.data.PartyStartDate.substring(0,10)); } else { container.append(result); } } } } },{dataField: 'EndDate', caption: 'End Date', dataType: 'date', format: 'y-MM-d', sortIndex: 0, sortOrder: 'desc', allowFiltering: true, minWidth: 95, calculateDisplayValue: function(rowData) { var result = ""; if (rowData.EndDate) { if (rowData.EndDateIsApproximate){ result = rowData.EndDate.substring(0,4); month = rowData.EndDate.substring(5,7); day = rowData.EndDate.substring(8,10); if (month != "01" || (month == "01" && day != "01")){result += "-" + month; } } else { result = rowData.EndDate.substring(0,10); } if (rowData.RoleId == 127 || rowData.RoleId == 717 || rowData.RoleId == 854 || rowData.OrganizationTypeId == 26 || rowData.GroupingOrder == 6 || rowData.GroupingOrder == 7) { return result; } else { if (rowData.PartyEndDate) { if (rowData.PartyEndDate < rowData.EndDate && rowData.StartDate <= rowData.PartyEndDate) { return rowData.PartyEndDate.substring(0,10); } else { return result; } } else { return result; } } } else { if (rowData.RoleId != 127 && rowData.RoleId != 717 && rowData.RoleId != 854 && rowData.OrganizationTypeId != 26 && rowData.GroupingOrder != 6 && rowData.GroupingOrder != 7) { if (rowData.PartyEndDate) { if (rowData.PartyEndDate > rowData.StartDate) { return rowData.PartyEndDate.substring(0,10); } } } } }, cellTemplate: function(container, options) { var result = ""; if (options.data.EndDate) { if (options.data.EndDateIsApproximate){ result = options.data.EndDate.substring(0,4); month = options.data.EndDate.substring(5,7); day = options.data.EndDate.substring(8,10); if (month != "01" || (month == "01" && day != "01")){result += "-" + month; } } else { result = options.data.EndDate.substring(0,10); } if (options.data.RoleId == 127 || options.data.RoleId == 717 || options.data.RoleId == 854 || options.data.OrganizationTypeId == 26 || options.data.GroupingOrder == 6 || options.data.GroupingOrder == 7) { container.append(result); } else { if (options.data.PartyEndDate) { if (options.data.PartyEndDate < options.data.EndDate && options.data.StartDate <= options.data.PartyEndDate) { container.append(options.data.PartyEndDate.substring(0,10)); } else { container.append(result); } } else { container.append(result); } } } else { if (options.data.RoleId != 127 && options.data.RoleId != 717 && options.data.RoleId != 854 && options.data.OrganizationTypeId != 26 && options.data.GroupingOrder != 6 && options.data.GroupingOrder != 7) { if (options.data.PartyEndDate) { if (options.data.PartyEndDate > options.data.StartDate) { container.append(options.data.PartyEndDate.substring(0,10)) } } } } } }], allowColumnResizing: true, sorting: {mode: "multiple"}, filterPanel: { visible: true }, columnAutoWidth: true, columnChooser: { enabled: true, mode: "select" }, onContentReady: function (e) { var columnChooserView = e.component.getView("columnChooserView"); if (!columnChooserView._popupContainer) { columnChooserView._initializePopupContainer(); columnChooserView.render(); columnChooserView._popupContainer.option("position", { of: e.element, my: "right top", at: "right top", offset: "0 50"}); } }, filterRow: { visible: true}, headerFilter: { visible: true, allowSearch: true }, pager: { showInfo: true, showPageSizeSelector: false, allowedPageSizes: [], showNavigationButtons: true },grouping: { contextMenuEnabled: true }, groupPanel: { visible: true }, grouping: { autoExpandAll: true }, searchPanel: { visible: true }, "export": { enabled: true, fileName: "Parliamentarian Profile - Federal Experience without Parliament", allowExportSelectedData: false }, onToolbarPreparing: function(e) { var dataGrid = e.component; e.toolbarOptions.items.unshift({ location: "after", widget: "dxButton", options: { icon: "refresh", hint: resetAltText, onClick: function() { var gridinstance = $('#gridFederalExperienceList').dxDataGrid('instance'); gridinstance.state({}); } } }, { location: "after", widget: "dxButton", options: { icon: "expand", hint: expandAltText, onClick: function() { var expanded = e.component.option("grouping.autoExpandAll"); dataGrid.option("grouping.autoExpandAll", !expanded); if (expanded){ this.option("icon", "expand"); this.option("hint", expandAltText); }else{ this.option("icon", "collapse"); this.option("hint", collapseAltText); } } } }); }, stateStoring: { enabled: false, type: "localStorage", storageKey: "" },paging: { enabled: false }, wordWrapEnabled: true, grouping: { autoExpandAll: false, } }); loadPanel.hide(); }); </Script> </div> </div> </div> </div> </div> </div> <div id="parlinfo_footer_wrapper"> <div id="parlinfo_footer_basic"> <ul class="footerlist"> <li>&copy; Library of Parliament</li> <li><a href="/sites/ParlInfo/default/en_CA/SiteInformation/SiteMap" target="_self">PARLINFO Site Map</a></li> <li><a href="/sites/PublicWebsite/default/en_CA/ContactUs" target="_self">Contact Us</a></li> </ul> </div> <footer class="ce-lop-footer hidden-print" role="contentinfo"> <div class="ce-lop-footer-top"> <div class="container"> <div class="row ce-lop-footer-vc"> <div class="col-md-4 text-center col-md-push-4 ce-lop-footer-emblem"> <img src="/Common/Parl/Images/ce-parl-emblem-e.png" alt="" /> </div> <div class="col-md-4 col-md-pull-4"> <ul class="ce-lop-footer-external-links"> <li> <a href="https://www.sencanada.ca/en" class="ce-lop-footer-senate-link" target="_blank">Senate</a> </li> <li> <a href="http://www.ourcommons.ca/en" class="ce-lop-footer-hoc-link" target="_blank">House of Commons</a> </li> <li> <a href="https://lop.parl.ca" class="ce-lop-footer-lop-link">Library of Parliament</a> </li> <li> <a id="" class="" title="" href="https://pps.parl.ca/" target="_blank"><span>Parliamentary Protective Service</span></a> </li> <li> <a href="http://jobs-emplois.parl.ca/?Language=E" class="" target="_blank">Employment at Parliament</a> </li> </ul> </div> <div class="col-md-4 ce-lop-footer-stay-connected"> <div class="ce-lop-footer-stay-connected-header"> <a href="/sites/PublicWebsite/default/en_CA/About/Social"> <p> <b>Stay Connected</b> <br><br> <img src="/staticfiles/PublicWebsite/assets/images/Footer/icon-connect-twitter.png" alt="Connect with Twitter"> <img src="/staticfiles/PublicWebsite/assets/images/Footer/icon-connect-linkedin.png" alt="Connect with LinkedIn"> <img src="/staticfiles/PublicWebsite/assets/images/Footer/icon-connect-instagram.png" alt="Connect with Instagram"> <img src="/staticfiles/PublicWebsite/assets/images/Footer/icon-connect-facebook5.png" alt="Connect with Facebook"> <img src="/staticfiles/PublicWebsite/assets/images/Footer/icon-connect-youtube.png" alt="Connect with Youtube"> <img src="/staticfiles/PublicWebsite/assets/images/Footer/icon-connect-flickr.png" alt="Connect with Flickr"> </p> </a> </div> </div> </div> </div> </div> <div class="ce-lop-footer-bottom"> <div class="container"> <div class="row"> <div class="col-sm-12 text-center"> <ul class="ce-lop-footer-bottom-links"> <li> <a href="/sites/PublicWebsite/default/en_CA/Notices">Important Notices</a> </li> <li> <a href="/sites/ParlInfo/default/en_CA/SiteInformation/atoz">A to Z Index</a> </li> </ul> </div> </div> </div> </div> </footer></div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10