Example #1
0
 function getObjectStructure()
 {
     return LocationHours::getObjectStructure();
 }
Example #2
0
 function getObjectStructure()
 {
     global $user;
     //Load Libraries for lookup values
     $library = new Library();
     $library->orderBy('displayName');
     if ($user->hasRole('libraryAdmin')) {
         $homeLibrary = Library::getPatronHomeLibrary();
         $library->libraryId = $homeLibrary->libraryId;
     }
     $library->find();
     $libraryList = array();
     while ($library->fetch()) {
         $libraryList[$library->libraryId] = $library->displayName;
     }
     //Look lookup information for display in the user interface
     $location = new Location();
     $location->orderBy('displayName');
     $location->find();
     $locationList = array();
     $locationLookupList = array();
     $locationLookupList[-1] = '<No Nearby Location>';
     while ($location->fetch()) {
         $locationLookupList[$location->locationId] = $location->displayName;
         $locationList[$location->locationId] = clone $location;
     }
     // get the structure for the location's hours
     $hoursStructure = LocationHours::getObjectStructure();
     // we don't want to make the locationId property editable
     // because it is associated with this location only
     unset($hoursStructure['locationId']);
     $facetSettingStructure = LocationFacetSetting::getObjectStructure();
     unset($facetSettingStructure['weight']);
     unset($facetSettingStructure['locationId']);
     unset($facetSettingStructure['numEntriesToShowByDefault']);
     unset($facetSettingStructure['showAsDropDown']);
     //unset($facetSettingStructure['sortMode']);
     $structure = array(array('property' => 'code', 'type' => 'text', 'label' => 'Code', 'description' => 'The code for use when communicating with Millennium'), array('property' => 'displayName', 'type' => 'text', 'label' => 'Display Name', 'description' => 'The full name of the location for display to the user', 'size' => '40'), array('property' => 'libraryId', 'type' => 'enum', 'values' => $libraryList, 'label' => 'Library', 'description' => 'A link to the library which the location belongs to'), array('property' => 'extraLocationCodesToInclude', 'type' => 'text', 'label' => 'Extra Locations To Include', 'description' => 'A list of other location codes to include in this location for indexing special collections, juvenile collections, etc.', 'size' => '40', 'hideInLists' => true), array('property' => 'nearbyLocation1', 'type' => 'enum', 'values' => $locationLookupList, 'label' => 'Nearby Location 1', 'description' => 'A secondary location which is nearby and could be used for pickup of materials.', 'hideInLists' => true), array('property' => 'nearbyLocation2', 'type' => 'enum', 'values' => $locationLookupList, 'label' => 'Nearby Location 2', 'description' => 'A tertiary location which is nearby and could be used for pickup of materials.', 'hideInLists' => true), array('property' => 'automaticTimeoutLength', 'type' => 'integer', 'label' => 'Automatic Timeout Length (logged in)', 'description' => 'The length of time before the user is automatically logged out in seconds.', 'size' => '8', 'hideInLists' => true), array('property' => 'automaticTimeoutLengthLoggedOut', 'type' => 'integer', 'label' => 'Automatic Timeout Length (logged out)', 'description' => 'The length of time before the catalog resets to the home page set to 0 to disable.', 'size' => '8', 'hideInLists' => true), array('property' => 'displaySection', 'type' => 'section', 'label' => 'Basic Display', 'hideInLists' => true, 'properties' => array(array('property' => 'homeLink', 'type' => 'text', 'label' => 'Home Link', 'description' => 'The location to send the user when they click on the home button or logo.  Use default or blank to go back to the vufind home location.', 'hideInLists' => true, 'size' => '40'), array('property' => 'homePageWidgetId', 'type' => 'integer', 'label' => 'Home Page Widget Id', 'description' => 'An id for the list widget to display on the home page', 'hideInLists' => true), array('property' => 'footerTemplate', 'type' => 'text', 'label' => 'Footer Template', 'description' => 'The name of the footer file to display in the regular interface when scoped to a single school.  Use default to display the default footer', 'hideInLists' => true, 'default' => 'default'))), array('property' => 'ilsSection', 'type' => 'section', 'label' => 'ILS/Account Integration', 'hideInLists' => true, 'properties' => array(array('property' => 'holdingBranchLabel', 'type' => 'text', 'label' => 'Holding Branch Label', 'description' => 'The label used within the holdings table in Millennium'), array('property' => 'scope', 'type' => 'text', 'label' => 'Scope', 'description' => 'The scope for the system in Millennium to refine holdings to the branch.  If there is no scope defined for the branch, this can be set to 0.'), array('property' => 'useScope', 'type' => 'checkbox', 'label' => 'Use Scope?', 'description' => 'Whether or not the scope should be used when displaying holdings.', 'hideInLists' => true), array('property' => 'defaultPType', 'type' => 'text', 'label' => 'Default P-Type', 'description' => 'The P-Type to use when accessing a subdomain if the patron is not logged in.  Use -1 to use the library default PType.'), array('property' => 'validHoldPickupBranch', 'type' => 'checkbox', 'label' => 'Valid Hold Pickup Branch?', 'description' => 'Determines if the location can be used as a pickup location if it is not the patrons home location or the location they are in.', 'hideInLists' => true), array('property' => 'showHoldButton', 'type' => 'checkbox', 'label' => 'Show Hold Button', 'description' => 'Whether or not the hold button is displayed so patrons can place holds on items', 'hideInLists' => true), array('property' => 'ptypesToAllowRenewals', 'type' => 'text', 'label' => 'PTypes that can renew', 'description' => 'A list of P-Types that can renew items or * to allow all P-Types to renew items.', 'hideInLists' => true), array('property' => 'suppressHoldings', 'type' => 'checkbox', 'label' => 'Suppress Holdings', 'description' => 'Whether or not all items for the title should be suppressed', 'hideInLists' => true))), array('property' => 'searchingSection', 'type' => 'section', 'label' => 'Searching', 'hideInLists' => true, 'properties' => array(array('property' => 'facetLabel', 'type' => 'text', 'label' => 'Facet Label', 'description' => 'The label of the facet that identifies this location.', 'hideInLists' => true, 'size' => '40'), array('property' => 'restrictSearchByLocation', 'type' => 'checkbox', 'label' => 'Restrict Search By Location', 'description' => 'Whether or not search results should only include titles from this location', 'hideInLists' => true), array('property' => 'includeDigitalCollection', 'type' => 'checkbox', 'label' => 'Include Digital Collection', 'description' => 'Whether or not titles from the digital collection should be included in searches', 'hideInLists' => true), array('property' => 'boostByLocation', 'type' => 'checkbox', 'label' => 'Boost By Location', 'description' => 'Whether or not boosting of titles owned by this location should be applied', 'hideInLists' => true), array('property' => 'recordsToBlackList', 'type' => 'textarea', 'label' => 'Records to deaccession', 'description' => 'A list of records to deaccession (hide) in search results.  Enter one record per line.', 'hideInLists' => true), array('property' => 'repeatSearchOption', 'type' => 'enum', 'values' => array('none' => 'None', 'librarySystem' => 'Library System', 'marmot' => 'Marmot'), 'label' => 'Repeat Search Options', 'description' => 'Where to allow repeating search. Valid options are: none, librarySystem, marmot, all'), array('property' => 'repeatInProspector', 'type' => 'checkbox', 'label' => 'Repeat In Prospector', 'description' => 'Turn on to allow repeat search in Prospector functionality.', 'hideInLists' => true), array('property' => 'repeatInWorldCat', 'type' => 'checkbox', 'label' => 'Repeat In WorldCat', 'description' => 'Turn on to allow repeat search in WorldCat functionality.', 'hideInLists' => true), array('property' => 'repeatInOverdrive', 'type' => 'checkbox', 'label' => 'Repeat In Overdrive', 'description' => 'Turn on to allow repeat search in Overdrive functionality.', 'hideInLists' => true), array('property' => 'systemsToRepeatIn', 'type' => 'text', 'label' => 'Systems To Repeat In', 'description' => 'A list of library codes that you would like to repeat search in separated by pipes |.', 'hideInLists' => true))), array('property' => 'enrichmentSection', 'type' => 'section', 'label' => 'Catalog Enrichment', 'hideInLists' => true, 'properties' => array(array('property' => 'showAmazonReviews', 'type' => 'checkbox', 'label' => 'Show Amazon Reviews', 'description' => 'Whether or not reviews from Amazon are displayed on the full record page.', 'hideInLists' => true), array('property' => 'showStandardReviews', 'type' => 'checkbox', 'label' => 'Show Standard Reviews', 'description' => 'Whether or not reviews from Content Cafe/Syndetics are displayed on the full record page.', 'hideInLists' => true))), array('property' => 'hours', 'type' => 'oneToMany', 'keyThis' => 'locationId', 'keyOther' => 'locationId', 'subObjectType' => 'LocationHours', 'structure' => $hoursStructure, 'label' => 'Hours', 'description' => 'Library Hours', 'sortable' => false, 'storeDb' => true), 'facets' => array('property' => 'facets', 'type' => 'oneToMany', 'label' => 'Facets', 'description' => 'A list of facets to display in search results', 'keyThis' => 'locationId', 'keyOther' => 'locationId', 'subObjectType' => 'LocationFacetSetting', 'structure' => $facetSettingStructure, 'sortable' => true, 'storeDb' => true, 'allowEdit' => true, 'canEdit' => true));
     foreach ($structure as $fieldName => $field) {
         $field['propertyOld'] = $field['property'] . 'Old';
         $structure[$fieldName] = $field;
     }
     return $structure;
 }
Example #3
0
 function getObjectStructure()
 {
     global $user;
     //Load Libraries for lookup values
     $library = new Library();
     $library->orderBy('displayName');
     if ($user->hasRole('libraryAdmin') && !$user->hasRole('opacAdmin')) {
         $homeLibrary = Library::getPatronHomeLibrary();
         $library->libraryId = $homeLibrary->libraryId;
     }
     $library->find();
     $libraryList = array();
     while ($library->fetch()) {
         $libraryList[$library->libraryId] = $library->displayName;
     }
     //Look lookup information for display in the user interface
     $location = new Location();
     $location->orderBy('displayName');
     $location->find();
     $locationList = array();
     $locationLookupList = array();
     $locationLookupList[-1] = '<No Nearby Location>';
     while ($location->fetch()) {
         $locationLookupList[$location->locationId] = $location->displayName;
         $locationList[$location->locationId] = clone $location;
     }
     // get the structure for the location's hours
     $hoursStructure = LocationHours::getObjectStructure();
     // we don't want to make the locationId property editable
     // because it is associated with this location only
     unset($hoursStructure['locationId']);
     $facetSettingStructure = LocationFacetSetting::getObjectStructure();
     unset($facetSettingStructure['weight']);
     unset($facetSettingStructure['locationId']);
     unset($facetSettingStructure['numEntriesToShowByDefault']);
     unset($facetSettingStructure['showAsDropDown']);
     //unset($facetSettingStructure['sortMode']);
     $locationBrowseCategoryStructure = LocationBrowseCategory::getObjectStructure();
     unset($locationBrowseCategoryStructure['weight']);
     unset($locationBrowseCategoryStructure['locationId']);
     $locationMoreDetailsStructure = LocationMoreDetails::getObjectStructure();
     unset($locationMoreDetailsStructure['weight']);
     unset($locationMoreDetailsStructure['locationId']);
     $structure = array(array('property' => 'code', 'type' => 'text', 'label' => 'Code', 'description' => 'The code for use when communicating with Millennium'), array('property' => 'displayName', 'type' => 'text', 'label' => 'Display Name', 'description' => 'The full name of the location for display to the user', 'size' => '40'), array('property' => 'showDisplayNameInHeader', 'type' => 'checkbox', 'label' => 'Show Display Name in Header', 'description' => 'Whether or not the display name should be shown in the header next to the logo', 'hideInLists' => true, 'default' => false), array('property' => 'libraryId', 'type' => 'enum', 'values' => $libraryList, 'label' => 'Library', 'description' => 'A link to the library which the location belongs to'), array('property' => 'showInLocationsAndHoursList', 'type' => 'checkbox', 'label' => 'Show In Locations And Hours List', 'description' => 'Whether or not this location should be shown in the list of library hours and locations', 'hideInLists' => true, 'default' => true), array('property' => 'address', 'type' => 'textarea', 'label' => 'Address', 'description' => 'The address of the branch.', 'hideInLists' => true), array('property' => 'phone', 'type' => 'text', 'label' => 'Phone Number', 'description' => 'The main phone number for the site .', 'size' => '40', 'hideInLists' => true), array('property' => 'extraLocationCodesToInclude', 'type' => 'text', 'label' => 'Extra Locations To Include', 'description' => 'A list of other location codes to include in this location for indexing special collections, juvenile collections, etc.', 'size' => '40', 'hideInLists' => true), array('property' => 'nearbyLocation1', 'type' => 'enum', 'values' => $locationLookupList, 'label' => 'Nearby Location 1', 'description' => 'A secondary location which is nearby and could be used for pickup of materials.', 'hideInLists' => true), array('property' => 'nearbyLocation2', 'type' => 'enum', 'values' => $locationLookupList, 'label' => 'Nearby Location 2', 'description' => 'A tertiary location which is nearby and could be used for pickup of materials.', 'hideInLists' => true), array('property' => 'automaticTimeoutLength', 'type' => 'integer', 'label' => 'Automatic Timeout Length (logged in)', 'description' => 'The length of time before the user is automatically logged out in seconds.', 'size' => '8', 'hideInLists' => true, 'default' => 90), array('property' => 'automaticTimeoutLengthLoggedOut', 'type' => 'integer', 'label' => 'Automatic Timeout Length (logged out)', 'description' => 'The length of time before the catalog resets to the home page set to 0 to disable.', 'size' => '8', 'hideInLists' => true, 'default' => 450), array('property' => 'displaySection', 'type' => 'section', 'label' => 'Basic Display', 'hideInLists' => true, 'properties' => array(array('property' => 'homeLink', 'type' => 'text', 'label' => 'Home Link', 'description' => 'The location to send the user when they click on the home button or logo.  Use default or blank to go back to the vufind home location.', 'hideInLists' => true, 'size' => '40'), array('property' => 'additionalCss', 'type' => 'textarea', 'label' => 'Additional CSS', 'description' => 'Extra CSS to apply to the site.  Will apply to all pages.', 'hideInLists' => true), 'defaultBrowseMode' => array('property' => 'defaultBrowseMode', 'type' => 'enum', 'label' => 'Default Viewing Mode for Browse Categories', 'description' => 'Sets how browse categories will be displayed when users haven\'t chosen themselves.', 'hideInLists' => true, 'values' => array('' => null, 'covers' => 'Show Covers Only', 'grid' => 'Show as Grid')))), array('property' => 'ilsSection', 'type' => 'section', 'label' => 'ILS/Account Integration', 'hideInLists' => true, 'properties' => array(array('property' => 'holdingBranchLabel', 'type' => 'text', 'label' => 'Holding Branch Label', 'description' => 'The label used within the holdings table in Millennium'), array('property' => 'scope', 'type' => 'text', 'label' => 'Scope', 'description' => 'The scope for the system in Millennium to refine holdings to the branch.  If there is no scope defined for the branch, this can be set to 0.'), array('property' => 'useScope', 'type' => 'checkbox', 'label' => 'Use Scope?', 'description' => 'Whether or not the scope should be used when displaying holdings.', 'hideInLists' => true), array('property' => 'defaultPType', 'type' => 'text', 'label' => 'Default P-Type', 'description' => 'The P-Type to use when accessing a subdomain if the patron is not logged in.  Use -1 to use the library default PType.', 'default' => -1), array('property' => 'validHoldPickupBranch', 'type' => 'checkbox', 'label' => 'Valid Hold Pickup Branch?', 'description' => 'Determines if the location can be used as a pickup location if it is not the patrons home location or the location they are in.', 'hideInLists' => true, 'default' => true), array('property' => 'showHoldButton', 'type' => 'checkbox', 'label' => 'Show Hold Button', 'description' => 'Whether or not the hold button is displayed so patrons can place holds on items', 'hideInLists' => true, 'default' => true), array('property' => 'ptypesToAllowRenewals', 'type' => 'text', 'label' => 'PTypes that can renew', 'description' => 'A list of P-Types that can renew items or * to allow all P-Types to renew items.', 'hideInLists' => true), array('property' => 'suppressHoldings', 'type' => 'checkbox', 'label' => 'Suppress Holdings', 'description' => 'Whether or not all items for the title should be suppressed', 'hideInLists' => true, 'default' => false))), array('property' => 'searchingSection', 'type' => 'section', 'label' => 'Searching', 'hideInLists' => true, 'properties' => array(array('property' => 'facetLabel', 'type' => 'text', 'label' => 'Facet Label', 'description' => 'The label of the facet that identifies this location.', 'hideInLists' => true, 'size' => '40'), array('property' => 'restrictSearchByLocation', 'type' => 'checkbox', 'label' => 'Restrict Search By Location', 'description' => 'Whether or not search results should only include titles from this location', 'hideInLists' => true, 'default' => false), array('property' => 'econtentLocationsToInclude', 'type' => 'text', 'label' => 'eContent Locations To Include', 'description' => 'A list of eContent Locations to include within the scope.', 'size' => '40', 'hideInLists' => true), array('property' => 'boostByLocation', 'type' => 'checkbox', 'label' => 'Boost By Location', 'description' => 'Whether or not boosting of titles owned by this location should be applied', 'hideInLists' => true, 'default' => true), array('property' => 'additionalLocalBoostFactor', 'type' => 'integer', 'label' => 'Additional Local Boost Factor', 'description' => 'An additional numeric boost to apply to any locally owned and locally available titles', 'hideInLists' => true, 'default' => 1), array('property' => 'recordsToBlackList', 'type' => 'textarea', 'label' => 'Records to deaccession', 'description' => 'A list of records to deaccession (hide) in search results.  Enter one record per line.', 'hideInLists' => true), array('property' => 'availabilityToggleLabelSuperScope', 'type' => 'text', 'label' => 'SuperScope Toggle Label', 'description' => 'The label to show when viewing super scope i.e. Consortium Name / Entire Collection / Everything.  Does not show if superscope is not enabled.', 'default' => 'Entire Collection'), array('property' => 'availabilityToggleLabelLocal', 'type' => 'text', 'label' => 'Local Collection Toggle Label', 'description' => 'The label to show when viewing the local collection i.e. Library Name / Local Collection.  Leave blank to hide the button.', 'default' => '{display name}'), array('property' => 'availabilityToggleLabelAvailable', 'type' => 'text', 'label' => 'Available Toggle Label', 'description' => 'The label to show when viewing available items i.e. Available Now / Available Locally / Available Here.', 'default' => 'Available Now'), array('property' => 'repeatSearchOption', 'type' => 'enum', 'values' => array('none' => 'None', 'librarySystem' => 'Library System', 'marmot' => 'Entire Consortium'), 'label' => 'Repeat Search Options', 'description' => 'Where to allow repeating search. Valid options are: none, librarySystem, marmot, all', 'default' => 'marmot'), array('property' => 'repeatInOnlineCollection', 'type' => 'checkbox', 'label' => 'Repeat In Online Collection', 'description' => 'Turn on to allow repeat search in the Online Collection.', 'hideInLists' => true, 'default' => false), array('property' => 'repeatInProspector', 'type' => 'checkbox', 'label' => 'Repeat In Prospector', 'description' => 'Turn on to allow repeat search in Prospector functionality.', 'hideInLists' => true, 'default' => false), array('property' => 'repeatInWorldCat', 'type' => 'checkbox', 'label' => 'Repeat In WorldCat', 'description' => 'Turn on to allow repeat search in WorldCat functionality.', 'hideInLists' => true, 'default' => false), array('property' => 'repeatInOverdrive', 'type' => 'checkbox', 'label' => 'Repeat In Overdrive', 'description' => 'Turn on to allow repeat search in Overdrive functionality.', 'hideInLists' => true, 'default' => false), array('property' => 'systemsToRepeatIn', 'type' => 'text', 'label' => 'Systems To Repeat In', 'description' => 'A list of library codes that you would like to repeat search in separated by pipes |.', 'hideInLists' => true))), array('property' => 'enrichmentSection', 'type' => 'section', 'label' => 'Catalog Enrichment', 'hideInLists' => true, 'properties' => array(array('property' => 'showStandardReviews', 'type' => 'checkbox', 'label' => 'Show Standard Reviews', 'description' => 'Whether or not reviews from Content Cafe/Syndetics are displayed on the full record page.', 'hideInLists' => true, 'default' => true), array('property' => 'showGoodReadsReviews', 'type' => 'checkbox', 'label' => 'Show GoodReads Reviews', 'description' => 'Whether or not reviews from GoodReads are displayed on the full record page.', 'hideInLists' => true, 'default' => true), 'showFavorites' => array('property' => 'showFavorites', 'type' => 'checkbox', 'label' => 'Show Favorites', 'description' => 'Whether or not users can maintain favorites lists', 'hideInLists' => true, 'default' => 1))), array('property' => 'fullRecordSection', 'type' => 'section', 'label' => 'Full Record Display', 'hideInLists' => true, 'properties' => array('showTextThis' => array('property' => 'showTextThis', 'type' => 'checkbox', 'label' => 'Show Text This', 'description' => 'Whether or not the Text This link is shown', 'hideInLists' => true, 'default' => 1), 'showEmailThis' => array('property' => 'showEmailThis', 'type' => 'checkbox', 'label' => 'Show Email This', 'description' => 'Whether or not the Email This link is shown', 'hideInLists' => true, 'default' => 1), 'showShareOnExternalSites' => array('property' => 'showShareOnExternalSites', 'type' => 'checkbox', 'label' => 'Show Sharing To External Sites', 'description' => 'Whether or not sharing on external sites (Twitter, Facebook, Pinterest, etc. is shown)', 'hideInLists' => true, 'default' => 1), 'showComments' => array('property' => 'showComments', 'type' => 'checkbox', 'label' => 'Show Comments', 'description' => 'Whether or not user comments are shown (also disables adding comments)', 'hideInLists' => true, 'default' => 1), 'showQRCode' => array('property' => 'showQRCode', 'type' => 'checkbox', 'label' => 'Show QR Code', 'description' => 'Whether or not the catalog should show a QR Code in full record view', 'hideInLists' => true, 'default' => 1), array('property' => 'showStaffView', 'type' => 'checkbox', 'label' => 'Show Staff View', 'description' => 'Whether or not the staff view is displayed in full record view.', 'hideInLists' => true, 'default' => true), 'moreDetailsOptions' => array('property' => 'moreDetailsOptions', 'type' => 'oneToMany', 'label' => 'Full Record Options', 'description' => 'Record Options for the display of full record', 'keyThis' => 'locationId', 'keyOther' => 'locationId', 'subObjectType' => 'LocationMoreDetails', 'structure' => $locationMoreDetailsStructure, 'sortable' => true, 'storeDb' => true, 'allowEdit' => true, 'canEdit' => true))), array('property' => 'overdriveSection', 'type' => 'section', 'label' => 'OverDrive', 'hideInLists' => true, 'properties' => array('enableOverdriveCollection' => array('property' => 'enableOverdriveCollection', 'type' => 'checkbox', 'label' => 'Enable Overdrive Collection', 'description' => 'Whether or not titles from the Overdrive collection should be included in searches', 'hideInLists' => true, 'default' => true))), array('property' => 'hours', 'type' => 'oneToMany', 'keyThis' => 'locationId', 'keyOther' => 'locationId', 'subObjectType' => 'LocationHours', 'structure' => $hoursStructure, 'label' => 'Hours', 'description' => 'Library Hours', 'sortable' => false, 'storeDb' => true), 'facets' => array('property' => 'facets', 'type' => 'oneToMany', 'label' => 'Facets', 'description' => 'A list of facets to display in search results', 'keyThis' => 'locationId', 'keyOther' => 'locationId', 'subObjectType' => 'LocationFacetSetting', 'structure' => $facetSettingStructure, 'sortable' => true, 'storeDb' => true, 'allowEdit' => true, 'canEdit' => true), 'browseCategories' => array('property' => 'browseCategories', 'type' => 'oneToMany', 'label' => 'Browse Categories', 'description' => 'Browse Categories To Show on the Home Screen', 'keyThis' => 'locationId', 'keyOther' => 'locationId', 'subObjectType' => 'LocationBrowseCategory', 'structure' => $locationBrowseCategoryStructure, 'sortable' => true, 'storeDb' => true, 'allowEdit' => false, 'canEdit' => false));
     foreach ($structure as $fieldName => $field) {
         $field['propertyOld'] = $field['property'] . 'Old';
         $structure[$fieldName] = $field;
     }
     return $structure;
 }