Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporate my form updates #17

Closed
wants to merge 71 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
cd0866c
Update thesis form
Nov 28, 2016
6da4341
Update Thesis form with DOI and remove link mention
Jan 30, 2017
8258b43
Fix problem with State-Edition element set
May 3, 2017
b8ef7d7
Add publisher and grantor to Thesis form
May 8, 2017
e640d3c
Add several fields to Newspaper form
May 10, 2017
b00afaa
Add submission agreement link to thesis form
Jul 5, 2017
057267d
Add submission agreement link to citation form
Jul 5, 2017
2ab316a
Add delete to thesis author keyword field
Oct 31, 2017
2b02c4f
Add corporate subject option to named subjects
Nov 24, 2017
64afc8c
Fix broken newspaper issue form
Nov 27, 2017
d96099d
Fix named subjects in artwork form
Dec 5, 2017
a4ffe9a
Fix up the artwork form finally
Dec 21, 2017
16ec7ba
Fix artwork form again
Dec 22, 2017
15e46fa
Fix hierarchicalGeographic problem
Jan 22, 2018
01bc4e5
Tweak citation form
Jan 30, 2018
68df279
Make dateIssued required
Feb 8, 2018
f8eaaf4
Add CC and Rightsstatements to forms
Mar 28, 2018
62c81d0
Fix thesis form
Apr 6, 2018
1ccce51
Update bceln_basc_image_form.xml
bondjimbond Apr 25, 2018
95a5c47
add delete to citation form author keywords
Jun 12, 2018
6e6d72c
Update group author for citation form
Jun 15, 2018
31981f9
Add Book form
Aug 9, 2018
46fcc47
Fix book form date issue
Aug 29, 2018
8ae10e7
Add date qualifiers to all forms
Sep 24, 2018
4d0a5c8
Add null option to Peer Reviewed note
Oct 3, 2018
55c1c78
Merge pull request #2 from bondjimbond/citation_update
bondjimbond Oct 3, 2018
48dd4e4
Add delete to project name and id fields
Oct 5, 2018
0d7e238
fix more project field stuff
Oct 5, 2018
745a3a1
Lowercase article for marcgt
Oct 22, 2018
8141366
Change extension element in thesis form
Dec 4, 2018
3bc9ca5
Merge pull request #3 from bondjimbond/thesis_update
bondjimbond Dec 4, 2018
ef31d20
Update forms with new genre standards
Feb 4, 2019
3b94dae
Add compound object form
Feb 7, 2019
f114484
Merge pull request #4 from bondjimbond/add_compound
bondjimbond Feb 7, 2019
692e27d
add collection form
Feb 7, 2019
3316413
Merge branch '7.x' of https://github.com/bondjimbond/bcelndora into a…
Feb 7, 2019
6db9aa8
Add collection form to module
Feb 7, 2019
300a8b0
Merge pull request #5 from bondjimbond/add_collection
bondjimbond Feb 7, 2019
571bc59
Add PDF form
Feb 28, 2019
d5b0d97
Stop thesis from reading physicalDescription with authority
Mar 18, 2019
3541e2c
Fix authority issue
Mar 18, 2019
df15482
Fix incorrect location for form element
bondjimbond May 29, 2019
d20c596
Fix improperly nested subject elements
bondjimbond May 29, 2019
826ce1d
Set self-transform to strip_nameless
bondjimbond Jun 13, 2019
fefd94d
Add department to video form
Jun 17, 2019
60306c7
Merge branch '7.x' of https://github.com/bondjimbond/bcelndora into 7.x
Jun 17, 2019
aefd92e
Add e-issn to citation form
Jun 17, 2019
8f1ed09
Add identifier to video form
Jun 17, 2019
1650ad3
lowercase note for video form
Jun 17, 2019
b8e6f78
Make rights statements required
Jul 8, 2019
abd3c7b
Fix subjects on basic form
Nov 7, 2019
daebee5
Add multiple roleterms to artwork form
Nov 14, 2019
275fd60
Add multiple roles to various forms
Nov 14, 2019
b6d742d
Fix bad mods useAndReproduction
Jan 23, 2020
a96dee6
Add rights to PDF form
Apr 23, 2020
715a9d8
do not require rights statement
May 4, 2020
a123f23
Remove unnecessary copyright section from Citation form
May 29, 2020
5862367
Merge branch '7.x' of https://github.com/discoverygarden/bcelndora in…
Jul 16, 2020
d85a89d
Update citation form with decent names
Jul 27, 2020
0139862
Include dgi update to plupload
Jul 27, 2020
d4c03b9
Fix accidental duplication
Jul 27, 2020
23d7e97
Merge branch '7.x' of https://github.com/bondjimbond/bcelndora into 7.x
Jul 27, 2020
8976a75
Fix errors
Jul 27, 2020
b620456
Add maxlength to citation url field
Sep 8, 2020
d568a92
Fixes
Sep 8, 2020
e160b27
add corporate name option to artwork
Jan 27, 2021
33b6859
Merge branch '7.x' of https://github.com/bondjimbond/bcelndora into 7.x
Jan 27, 2021
5b0e82b
Merge branch '7.x' of https://github.com/bondjimbond/bcelndora into 7.x
Jan 27, 2021
2abdc13
add Project ID field
Dec 16, 2021
8748918
Merge branch '7.x' of https://github.com/bondjimbond/bcelndora into 7.x
Dec 16, 2021
6f7d984
Fix the forms
Feb 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 89 additions & 61 deletions bcelndora.module
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ function bcelndora_islandora_xml_form_builder_form_associations() {
'dsid' => 'MODS',
'title_field' => array('titleInfo', 'title'),
'transform' => 'mods_to_dc.xsl',
'self_transform' => 'islandora_cleanup_mods_extended.xsl',
'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
'bceln_pdf_form' => array(
'content_model' => 'islandora:sp_pdf',
'form_name' => 'BC ELN PDF Form',
'dsid' => 'MODS',
'title_field' => array('titleInfo', 'title'),
'transform' => 'mods_to_dc.xsl',
'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
'bceln_audio_form' => array(
Expand All @@ -24,7 +33,7 @@ function bcelndora_islandora_xml_form_builder_form_associations() {
'dsid' => 'MODS',
'title_field' => array('titleInfo', 'title'),
'transform' => 'mods_to_dc.xsl',
'self_transform' => 'islandora_cleanup_mods_extended.xsl',
'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
'bceln_basic_image_form' => array(
Expand All @@ -33,7 +42,7 @@ function bcelndora_islandora_xml_form_builder_form_associations() {
'dsid' => 'MODS',
'title_field' => array('titleInfo', 'title'),
'transform' => 'mods_to_dc.xsl',
'self_transform' => 'islandora_cleanup_mods_extended.xsl',
'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
'bceln_citation_form' => array(
Expand All @@ -42,7 +51,25 @@ function bcelndora_islandora_xml_form_builder_form_associations() {
'dsid' => 'MODS',
'title_field' => array('titleInfo', 'title'),
'transform' => 'mods_to_dc.xsl',
'self_transform' => 'islandora_cleanup_mods_extended.xsl',
'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
'bceln_compound_form' => array(
'content_model' => 'islandora:compoundCModel',
'form_name' => 'BC ELN Compound Object Form',
'dsid' => 'MODS',
'title_field' => array('titleInfo', 'title'),
'transform' => 'mods_to_dc.xsl',
'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
'bceln_collection_form' => array(
'content_model' => 'islandora:collectionCModel',
'form_name' => 'BC ELN Collection Form',
'dsid' => 'MODS',
'title_field' => array('titleInfo', 'title'),
'transform' => 'mods_to_dc.xsl',
'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
'bceln_newspaper_issue_form' => array(
Expand All @@ -51,7 +78,7 @@ function bcelndora_islandora_xml_form_builder_form_associations() {
'dsid' => 'MODS',
'title_field' => array('titleInfo', 'title'),
'transform' => 'mods_to_dc.xsl',
'self_transform' => 'islandora_cleanup_mods_extended.xsl',
'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
'bceln_thesis_form' => array(
Expand All @@ -60,7 +87,16 @@ function bcelndora_islandora_xml_form_builder_form_associations() {
'dsid' => 'MODS',
'title_field' => array('titleInfo', 'title'),
'transform' => 'mods_to_dc.xsl',
'self_transform' => 'islandora_cleanup_mods_extended.xsl',
'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
'bceln_book_form' => array(
'content_model' => 'islandora:bookCModel',
'form_name' => 'BC ELN Book Form',
'dsid' => 'MODS',
'title_field' => array('titleInfo', 'title'),
'transform' => 'mods_to_dc.xsl',
'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
'bceln_video_form' => array(
Expand All @@ -69,7 +105,7 @@ function bcelndora_islandora_xml_form_builder_form_associations() {
'dsid' => 'MODS',
'title_field' => array('titleInfo', 'title'),
'transform' => 'mods_to_dc.xsl',
'self_transform' => 'islandora_cleanup_mods_extended.xsl',
'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
'bceln_serials_form_root_serial' => array(
Expand All @@ -78,7 +114,7 @@ function bcelndora_islandora_xml_form_builder_form_associations() {
'dsid' => 'MODS',
'title_field' => array('titleInfoTab', 'titleInfoPanel', 'titleInfo'),
'transform' => 'mods_to_dc.xsl',
'self_transform' => 'islandora_cleanup_mods_extended.xsl',
'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
'bceln_serials_form_stub' => array(
Expand All @@ -87,7 +123,7 @@ function bcelndora_islandora_xml_form_builder_form_associations() {
'dsid' => 'MODS',
'title_field' => array('titleInfoTab', 'titleInfoPanel', 'titleInfo'),
'transform' => 'mods_to_dc.xsl',
'self_transform' => 'islandora_cleanup_mods_extended.xsl',
'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
'bceln_serials_form_intermediate' => array(
Expand All @@ -96,12 +132,43 @@ function bcelndora_islandora_xml_form_builder_form_associations() {
'dsid' => 'MODS',
'title_field' => array('titleInfoTab', 'titleInfoPanel', 'titleInfo'),
'transform' => 'mods_to_dc.xsl',
'self_transform' => 'islandora_cleanup_mods_extended.xsl',
'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
);
}

/**
* Implements hook_form_islandora_solr_simple_search_form_alter().
*/
function bcelndora_form_islandora_solr_simple_search_form_alter(&$form, &$form_state, $form_id) {
$form['simple']['islandora_simple_search_query']['#title_display'] = 'invisible';
}

/**
* Implementa hook_islandora_datastream_filename_alter().
*/
function bcelndora_islandora_datastream_filename_alter(&$filename, AbstractDatastream $datastream) {
// XXX: The MIME-type/mapping facilities do not really allow for multiple
// MIME-types to be mapped to a single extension... so remap here, to account.
// Essentially copypasta of https://github.com/Islandora/islandora/blob/5e88176861ce4c29e77b31f0c6e0ee4ce5cc3750/includes/datastream.inc#L54-L65
if ($datastream->mimetype === 'application/x-zip') {
module_load_include('inc', 'islandora', 'includes/mime_detect');
// Browsers will not append all extensions.
$extension = '.' . (new MimeDetect())->getExtension($datastream->mimetype);
// Prevent adding on a duplicate extension.
$label = $datastream->label;
$extension_length = strlen($extension);
$duplicate_extension_position = strlen($label) > $extension_length ?
strripos($label, $extension, -$extension_length) :
FALSE;
$filename = $label;
if ($duplicate_extension_position === FALSE) {
$filename .= $extension;
}
}
}

/**
* Implements hook_islandora_xml_form_builder_forms().
*/
Expand All @@ -114,12 +181,24 @@ function bcelndora_islandora_xml_form_builder_forms() {
'BC ELN Audio Form' => array(
'form_file' => "$module_path/xml/bceln_audio_form.xml",
),
'BC ELN Book Form' => array(
'form_file' => "$module_path/xml/bceln_book_form.xml",
),
'BC ELN Basic Image Form' => array(
'form_file' => "$module_path/xml/bceln_basc_image_form.xml",
),
'BC ELN Citation Form' => array(
'form_file' => "$module_path/xml/bceln_citation_form.xml",
),
'BC ELN Compound Object Form' => array(
'form_file' => "$module_path/xml/bceln_compound_form.xml",
),
'BC ELN Collection Form' => array(
'form_file' => "$module_path/xml/bceln_collection_form.xml",
),
'BC ELN PDF Form' => array(
'form_file' => "$module_path/xml/bceln_pdf_form.xml",
),
'BC ELN Newspaper Issue Form' => array(
'form_file' => "$module_path/xml/bceln_newspaper_issue_form.xml",
),
Expand All @@ -135,26 +214,6 @@ function bcelndora_islandora_xml_form_builder_forms() {
);
}

/**
* Implements hook_form_FORM_ID_alter().
*
* Adds autocomplete for the custom bceln citation and thesis forms.
*/
function bcelndora_form_xml_form_builder_datastream_form_alter(&$form, &$form_state, $form_id) {
if (module_exists('islandora_scholar') && module_exists('islandora_entities')) {
module_load_include('inc', 'islandora_entities', 'includes/utilities');
if (isset($form_state['association']['id'])) {
$id = $form_state['association']['id'];
if (strcmp($id, 'bceln_citation_form') == 0) {
islandora_entities_add_autocompletes_to_citation_form($form);
}
elseif (strcmp($id, 'bceln_thesis_form') == 0) {
islandora_entities_add_autocompletes_to_thesis_form($form);
}
}
}
}

/**
* Implements hook_form_FORM_ID_alter().
*
Expand All @@ -174,34 +233,3 @@ function bcelndora_form_xml_form_builder_ingest_form_alter(&$form, &$form_state,
}
}
}

/**
* Implements hook_form_islandora_solr_simple_search_form_alter().
*/
function bcelndora_form_islandora_solr_simple_search_form_alter(&$form, &$form_state, $form_id) {
$form['simple']['islandora_simple_search_query']['#title_display'] = 'invisible';
}

/**
* Implementa hook_islandora_datastream_filename_alter().
*/
function bcelndora_islandora_datastream_filename_alter(&$filename, AbstractDatastream $datastream) {
// XXX: The MIME-type/mapping facilities do not really allow for multiple
// MIME-types to be mapped to a single extension... so remap here, to account.
// Essentially copypasta of https://github.com/Islandora/islandora/blob/5e88176861ce4c29e77b31f0c6e0ee4ce5cc3750/includes/datastream.inc#L54-L65
if ($datastream->mimetype === 'application/x-zip') {
module_load_include('inc', 'islandora', 'includes/mime_detect');
// Browsers will not append all extensions.
$extension = '.' . (new MimeDetect())->getExtension($datastream->mimetype);
// Prevent adding on a duplicate extension.
$label = $datastream->label;
$extension_length = strlen($extension);
$duplicate_extension_position = strlen($label) > $extension_length ?
strripos($label, $extension, -$extension_length) :
FALSE;
$filename = $label;
if ($duplicate_extension_position === FALSE) {
$filename .= $extension;
}
}
}
Loading