Skip to content

Commit

Permalink
Add bibsys archive
Browse files Browse the repository at this point in the history
  • Loading branch information
danmichaelo committed Oct 8, 2019
1 parent e932e0c commit fbfe762
Show file tree
Hide file tree
Showing 26 changed files with 1,075 additions and 24 deletions.
36 changes: 36 additions & 0 deletions app/Bibsys/BibsysDokument.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

namespace App\Bibsys;

use App\Record;

class BibsysDokument extends Record
{
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'dokid';

/**
* Indicates if the IDs are auto-incrementing.
*
* @var bool
*/
public $incrementing = false;

public static $prefix = 'bibsys';

/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'bibsys_dok';

public function createdBy()
{
return $this->belongsTo('App\User', 'objektid');
}
}
29 changes: 29 additions & 0 deletions app/Bibsys/BibsysObjekt.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace App\Bibsys;

use App\Record;

class BibsysObjekt extends Record
{
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'objektid';

/**
* Indicates if the IDs are auto-incrementing.
*
* @var bool
*/
public $incrementing = false;

/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'bibsys';
}
234 changes: 234 additions & 0 deletions app/Bibsys/BibsysSchema.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
<?php

namespace App\Bibsys;

use App\Schema\Schema;

class BibsysSchema extends Schema
{
public $prefix = 'bibsys';
public $primaryId = 'dokid';

protected $schema = [
'fields' => [
// Søk i alle felt
[
'key' => 'any_field_ts',
'type' => 'simple',

'displayable' => false,
'editable' => false,
'searchable' => 'simple',

'searchOptions' => [
'placeholder' => 'Du kan søke etter objektid, dokid, knyttid, avdeling, samling, tekst i MARC-posten, osv.',
'index' => ['type' => 'ts', 'ts_column' => 'any_field_ts'],
'operators' => ['eq', 'neq']
],
],
],

'groups' => [
[
'label' => 'Objektpost',
'fields' => [

[
'key' => 'objektid',
'type' => 'simple',

'searchOptions' => [
'index' => ['column' => 'lower(objektid)'],
'operators' => ['ex'],
],
'orderable' => false,
],

[
'key' => 'title_statement',
'type' => 'simple',
'orderable' => false,
'searchable' => 'advanced',
],

[
'key' => 'pub_date',
'type' => 'simple',
'orderable' => false,
'searchable' => 'advanced',
],

[
'key' => 'marc_record',
'type' => 'simple',
'orderable' => false,
'searchable' => 'advanced',
],
]
],
[
'label' => 'Dokumentpost',
'fields' => [

// Dokid
[
'key' => 'dokid',
'type' => 'simple',
'searchOptions' => [
'index' => ['column' => 'lower(dokid)'],
'operators' => ['ex'],
],
'orderable' => true,
],

// Strekkode
[
'key' => 'strekkode',
'type' => 'simple',
'orderable' => false,
'searchOptions' => [
'index' => ['column' => 'lower(strekkode)'],
'operators' => ['ex'],
],
'orderable' => false,
],

// Status
[
'key' => 'status',
'type' => 'autocomplete',
'orderable' => false,
'searchable' => 'advanced',
],

// Avdeling
[
'key' => 'avdeling',
'type' => 'autocomplete',
'orderable' => false,
],

// Samling
[
'key' => 'samling',
'type' => 'autocomplete',
'orderable' => false,
],

// Hyllesignatur
[
'key' => 'hyllesignatur',
'type' => 'simple',
'orderable' => false,
],

// Deponert
[
'key' => 'deponert',
'type' => 'simple',

'searchable' => 'advanced',
'orderable' => false,
],

[
'key' => 'lokal_anmerkning',
'type' => 'simple',

'searchable' => 'advanced',
'orderable' => false,
],

[
'key' => 'beholdning',
'type' => 'simple',

'searchable' => 'advanced',
'orderable' => false,
],

[
'key' => 'utlaanstype',
'type' => 'simple',

'searchable' => 'advanced',
'orderable' => false,
],

[
'key' => 'lisensbetingelser',
'type' => 'simple',

'searchable' => 'advanced',
'orderable' => false,
],

[
'key' => 'tilleggsplassering',
'type' => 'simple',

'searchable' => 'advanced',
'orderable' => false,
],

[
'key' => 'intern_bemerkning_aapen',
'type' => 'simple',

'searchable' => 'advanced',
'orderable' => false,
],

// [
// 'key' => 'intern_bemerkning_lukket',
// 'type' => 'simple',

// 'searchable' => 'advanced',
// ],

[
'key' => 'bestillingstype',
'type' => 'simple',

'searchable' => 'advanced',
'orderable' => false,
],

[
'key' => 'statusdato',
'type' => 'simple',

'searchable' => 'advanced',
'orderable' => false,
],

[
'key' => 'seriedokid',
'type' => 'simple',
'searchOptions' => [
'index' => ['column' => 'lower(seriedokid)'],
'operators' => ['ex'],
],
'orderable' => false,
],

[
'key' => 'har_hefter',
'type' => 'simple',

'searchable' => 'advanced',
'orderable' => false,
],

],
],
],
];

public function __construct()
{
$this->schemaOptions['autocompleteUrl'] = action('BibsysController@autocomplete');

parent::__construct();
}
}
27 changes: 27 additions & 0 deletions app/Bibsys/BibsysView.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace App\Bibsys;

class BibsysView extends BibsysObjekt
{
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'dokid';

/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'bibsys_search';

/**
* Indicates if the IDs are auto-incrementing.
*
* @var bool
*/
public $incrementing = false;
}
Loading

0 comments on commit fbfe762

Please sign in to comment.