Example #1
0
function form_biblio_material_types($loc)
{
    $form = "";
    //    Played with printselect function
    if (isset($postVars['materialCd'])) {
        $materialCd = $postVars['materialCd'];
    } else {
        $materialCd = '';
    }
    $fieldname = "materialCd";
    $domainTable = "material_type_dm";
    $dmQ = new DmQuery();
    $dmQ->connect();
    $dms = $dmQ->get($domainTable);
    $dmQ->close();
    $form .= "<select id=\"materialCd\" name=\"materialCd\"";
    //    Needed OnChange event here.
    $form .= " onChange=\"matCdReload()\">\n";
    $form .= "<option value=\"\" selected>" . $loc->getText("any") . "</option>";
    foreach ($dms as $dm) {
        $form .= "<option value=\"" . H($dm->getCode()) . "\"";
        $form .= ">" . H($dm->getDescription()) . "</option>";
    }
    $form .= "</select>";
    return $form;
}
Example #2
0
function dmSelect($table, $name, $value = "", $all = FALSE, $attrs = NULL)
{
    $dmQ = new DmQuery();
    $dmQ->connect();
    # Don't use getAssoc() so that we can set the default below
    $dms = $dmQ->get($table);
    $dmQ->close();
    $default = "";
    $options = array();
    if ($all) {
        $options['all'] = 'All';
    }
    foreach ($dms as $dm) {
        $options[$dm->getCode()] = $dm->getDescription();
        if ($dm->getDefaultFlg() == 'Y') {
            $default = $dm->getCode();
        }
    }
    if ($value == "") {
        $value = $default;
    }
    return inputField('select', $name, $value, $attrs, $options);
}
Example #3
0
function dmSelect($table, $name, $value = "", $all = FALSE, $attrs = NULL, $required = TRUE)
{
    $dmQ = new DmQuery();
    $dmQ->connect();
    # Don't use getAssoc() so that we can set the default below
    $dms = $dmQ->get($table);
    $dmQ->close();
    $default = "";
    $options = array();
    if ($all) {
        $options['all'] = 'All';
    }
    if (!$required) {
        // Add "Any" for the first option.
        $loc = new Localize(OBIB_LOCALE, "shared");
        $options[''] = $loc->getText("any");
    }
    foreach ($dms as $dm) {
        $options[$dm->getCode()] = $dm->getDescription();
        if ($dm->getDefaultFlg() == 'Y') {
            $default = $dm->getCode();
        }
    }
    if ($value == "") {
        $value = $default;
    }
    if (!$required) {
        // Selected on "Any" option.
        $value = "";
    }
    return inputField('select', $name, $value, $attrs, $options);
}
  <tr>
    <td nowrap="true" class="primary" valign="top">
      <?php 
echo $loc->getText("biblioCopyEditFormStatus");
?>
:
    </td>
    <td valign="top" class="primary">

<?php 
#**************************************************************************
#*  only show status codes for valid transitions
#**************************************************************************
$dmQ = new DmQuery();
$dmQ->connect();
$dms = $dmQ->get("biblio_status_dm");
$dmQ->close();
echo "<select name=\"statusCd\"";
if (in_array($postVars["statusCd"], $disallowed)) {
    echo " disabled";
}
echo ">\n";
foreach ($dms as $dm) {
    $cd = $dm->getCode();
    # We don't normally show transitions to disallowed states, but
    # we do want to show the correct status, if it's one of those.
    if (in_array($cd, $disallowed) && $cd != $postVars["statusCd"]) {
        continue;
    }
    echo "<option value=\"" . H($dm->getCode()) . "\"";
    if ($postVars["statusCd"] == "" && $dm->getDefaultFlg() == 'Y') {
Example #5
0
/* This file is part of a copyrighted work; it is distributed with NO WARRANTY.
 * See the file COPYRIGHT.html for more details.
 */
require_once "../shared/common.php";
$tab = "admin";
$nav = "member_fields";
require_once "../classes/Dm.php";
require_once "../classes/DmQuery.php";
require_once "../functions/errorFuncs.php";
require_once "../shared/logincheck.php";
require_once "../classes/Localize.php";
$loc = new Localize(OBIB_LOCALE, $tab);
require_once "../shared/header.php";
$dmQ = new DmQuery();
$dmQ->connect();
$dms = $dmQ->get("member_fields_dm");
$dmQ->close();
?>
<a href="../admin/member_fields_new_form.php?reset=Y"><?php 
echo $loc->getText("Add new custom field");
?>
</a><br>
<h1> <?php 
echo $loc->getText("Custom Member FIelds");
?>
</h1>
<table class="primary">
  <tr>
    <th colspan="2" valign="top">
      <font class="small">*</font><?php 
echo $loc->getText("function");
?>
:
    </td>
    <td valign="top" class="primary">
<?php 
//    Played with printselect function
if (isset($postVars['materialCd'])) {
    $materialCd = $postVars['materialCd'];
} else {
    $materialCd = '';
}
$fieldname = "materialCd";
$domainTable = "material_type_dm";
$dmQ = new DmQuery();
$dmQ->connect();
$dms = $dmQ->get($domainTable);
$dmQ->close();
echo "<select id=\"materialCd\" name=\"materialCd\"";
//    Needed OnChange event here.
echo " onChange=\"matCdReload()\">\n";
foreach ($dms as $dm) {
    echo "<option value=\"" . H($dm->getCode()) . "\"";
    if ($materialCd == "" && $dm->getDefaultFlg() == 'Y') {
        $materialCd = $dm->getCode();
        echo " selected";
    } elseif ($materialCd == $dm->getCode()) {
        echo " selected";
    }
    echo ">" . H($dm->getDescription()) . "</option>\n";
}
echo "</select>\n";
$dms = $dmQ->get("collection_dm");
$dmQ->close();
foreach ($dms as $dm) {
    echo '<input type="checkbox" value="' . $dm->getCode() . '" name="collec[]"> ' . H($dm->getDescription()) . "<br>\n";
}
?>
    </td>
    <td nowrap="true" valign="top" class="primary">
<input type="checkbox" name="selectall" value="select_all"
  onclick="selectAll('material[]');"><b><?php 
echo $loc->getText("indexSearchInvert");
?>
</b><br>

<?php 
$dmQ = new DmQuery();
$dmQ->connect();
$dms = $dmQ->get("material_type_dm");
$dmQ->close();
foreach ($dms as $dm) {
    echo '<input type="checkbox" value="' . $dm->getCode() . '" name="material[]"> ' . H($dm->getDescription()) . "<br>\n";
}
?>

</td> </tr>
</font>
</table>
</form>

<?php 
include "../shared/footer.php";
Example #8
0
/* This file is part of a copyrighted work; it is distributed with NO WARRANTY.
 * See the file COPYRIGHT.html for more details.
 */
require_once "../shared/common.php";
$tab = "admin";
$nav = "copy_fields";
require_once "../classes/Dm.php";
require_once "../classes/DmQuery.php";
require_once "../functions/errorFuncs.php";
require_once "../shared/logincheck.php";
require_once "../classes/Localize.php";
$loc = new Localize(OBIB_LOCALE, $tab);
require_once "../shared/header.php";
$dmQ = new DmQuery();
$dmQ->connect();
$dms = $dmQ->get("biblio_copy_fields_dm");
$dmQ->close();
?>
<a href="../admin/copy_fields_new_form.php?reset=Y"><?php 
echo $loc->getText("Add new custom field");
?>
</a><br>
<h1> <?php 
echo $loc->getText("Custom Copy Fields");
?>
</h1>
<table class="primary">
  <tr>
    <th colspan="2" valign="top">
      <font class="small">*</font><?php 
echo $loc->getText("function");