Skip to content

Commit

Permalink
Issue coral-erm#355: fix PHP Notices on Organizations index page.
Browse files Browse the repository at this point in the history
Add isset() to fix PHP Notice: Undefined index: org_orderBy
    in …/organizations/index.php on line 153
Add isset() to fix PHP Notice: Undefined index: org_numberOfRecords
    in …/organizations/index.php on line 149
Add isset() to fix PHP Notice: Undefined index: org_pageStart
    in …/organizations/index.php on line 145
Add isset() to fix PHP Notice: Undefined index: org_startWith
    in …/organizations/index.php on line 140
Add isset() to fix PHP Notice: Undefined index: org_contactName
    in …/organizations/index.php on line 95
Add isset() to fix PHP Notice: Undefined index: org_contactName
    in …/organizations/index.php on line 94
Add isset() to fix PHP Notice: Undefined index: org_organizationRoleID
    in …/organizations/index.php on line 78
Add isset() to fix PHP Notice: Undefined index: org_organizationName
    in …/organizations/index.php on line 62
Add isset() to fix PHP Notice: Undefined index: org_organizationName
    in …/organizations/index.php on line 61
Set $reset variable to fix PHP Notice: Undefined variable: reset
    in …/organizations/index.php on line 58
Add isset() to fix PHP Notice: Undefined index: ref_script
    in …/organizations/index.php on line 32
  • Loading branch information
t4k committed Jan 31, 2018
1 parent aad5c9a commit f16ace0
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions organizations/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@
//except we don't want it to retain if they press the 'index' button
//check what referring script is

if ($_SESSION['ref_script'] != "orgDetail.php"){
if (isset($_SESSION['ref_script']) && $_SESSION['ref_script'] != "orgDetail.php") {
$reset='Y';
}
else {
$reset = 'N';
}

$_SESSION['ref_script']=$currentPage;

Expand All @@ -55,8 +58,8 @@
<tr>
<td class='searchRow'><label for='searchName'><b><?php echo _("Name (contains)");?></b></label>
<br />
<input type='text' name='searchOrganizationName' id='searchOrganizationName' style='width:145px' value="<?php if ($reset != 'Y') echo $_SESSION['org_organizationName']; ?>" /><br />
<div id='div_searchName' style='<?php if ((!$_SESSION['org_organizationName']) || ($reset == 'Y')) echo "display:none;"; ?>margin-left:123px;'><input type='button' name='btn_searchOrganizationName' value='<?php echo _("go!");?>' class='searchButton' /></div>
<input type='text' name='searchOrganizationName' id='searchOrganizationName' style='width:145px' value="<?php if ($reset != 'Y' && isset($_SESSION['org_organizationName'])) echo $_SESSION['org_organizationName']; ?>" /><br />
<div id='div_searchName' style='<?php if ((!isset($_SESSION['org_organizationName'])) || ($reset == 'Y')) echo "display:none;"; ?>margin-left:123px;'><input type='button' name='btn_searchOrganizationName' value='<?php echo _("go!");?>' class='searchButton' /></div>
</td>
</tr>

Expand All @@ -72,7 +75,7 @@
$organizationRole = new OrganizationRole();

foreach($organizationRole->allAsArray() as $display) {
if (($_SESSION['org_organizationRoleID'] == $display['organizationRoleID']) && ($reset != 'Y')){
if ((isset($_SESSION['org_organizationRoleID'])) && ($_SESSION['org_organizationRoleID'] == $display['organizationRoleID']) && ($reset != 'Y')) {
echo "<option value='" . $display['organizationRoleID'] . "' selected>" . $display['shortName'] . "</option>";
}else{
echo "<option value='" . $display['organizationRoleID'] . "'>" . $display['shortName'] . "</option>";
Expand All @@ -88,8 +91,8 @@
<tr>
<td class='searchRow'><label for='searchContact'><b><?php echo _("Contact Name (contains)");?></b></label>
<br />
<input type='text' name='searchContactName' id='searchContactName' style='width:145px' value="<?php if ($reset != 'Y') echo $_SESSION['org_contactName']; ?>" /><br />
<div id='div_searchContact' style='<?php if ((!$_SESSION['org_contactName']) || ($reset == 'Y')) echo "display:none;"; ?>margin-left:123px;'><input type='button' name='btn_searchContactName' value='<?php echo _("go!");?>' class='searchButton' /></div>
<input type='text' name='searchContactName' id='searchContactName' style='width:145px' value="<?php if ($reset != 'Y' && isset($_SESSION['org_contactName'])) echo $_SESSION['org_contactName']; ?>" /><br />
<div id='div_searchContact' style='<?php if ((!isset($_SESSION['org_contactName'])) || ($reset == 'Y')) echo "display:none;"; ?>margin-left:123px;'><input type='button' name='btn_searchContactName' value='<?php echo _("go!");?>' class='searchButton' /></div>
</td>
</tr>

Expand Down Expand Up @@ -134,20 +137,20 @@
<?php
//used to default to previously selected values when back button is pressed
//if the startWith is defined set it so that it will default to the first letter picked
if (($_SESSION['org_startWith']) && ($reset != 'Y')){
if ((isset($_SESSION['org_startWith'])) && ($reset != 'Y')){
echo "startWith = '" . $_SESSION['org_startWith'] . "';";
echo "$(\"#span_letter_" . $_SESSION['org_startWith'] . "\").removeClass('searchLetter').addClass('searchLetterSelected');";
}

if (($_SESSION['org_pageStart']) && ($reset != 'Y')){
if ((isset($_SESSION['org_pageStart'])) && ($reset != 'Y')){
echo "pageStart = '" . $_SESSION['org_pageStart'] . "';";
}

if (($_SESSION['org_numberOfRecords']) && ($reset != 'Y')){
if ((isset($_SESSION['org_numberOfRecords'])) && ($reset != 'Y')){
echo "numberOfRecords = '" . $_SESSION['org_numberOfRecords'] . "';";
}

if (($_SESSION['org_orderBy']) && ($reset != 'Y')){
if ((isset($_SESSION['org_orderBy'])) && ($reset != 'Y')){
echo "orderBy = \"" . $_SESSION['org_orderBy'] . "\";";
}

Expand Down

0 comments on commit f16ace0

Please sign in to comment.