Author: peter
Date: 2008-11-10 14:33:53 -0800 (Mon, 10 Nov 2008)
New Revision: 1546
Modified:
trunk/qubit/apps/qubit/modules/actor/actions/createAction.class.php
trunk/qubit/apps/qubit/modules/actor/actions/editAction.class.php
trunk/qubit/apps/qubit/modules/actor/actions/showAction.class.php
trunk/qubit/apps/qubit/modules/actor/actions/updateAction.class.php
trunk/qubit/apps/qubit/modules/actor/actions/updateIsaarAction.class.php
trunk/qubit/apps/qubit/modules/actor/templates/_contextMenu.php
trunk/qubit/apps/qubit/modules/actor/templates/editIsaarSuccess.php
trunk/qubit/apps/qubit/modules/actor/templates/showIsaarSuccess.php
trunk/qubit/apps/qubit/modules/informationobject/templates/editIsadSuccess.php
trunk/qubit/apps/qubit/modules/informationobject/templates/showIsadSuccess.php
trunk/qubit/config/schema.yml
trunk/qubit/data/fixtures/sampleData.yml
trunk/qubit/data/sql/lib.model.schema.sql
trunk/qubit/lib/model/QubitActor.php
trunk/qubit/lib/model/QubitInformationObject.php
trunk/qubit/lib/model/QubitTerm.php
trunk/qubit/lib/model/map/ActorI18nMapBuilder.php
trunk/qubit/lib/model/map/EventMapBuilder.php
trunk/qubit/lib/model/om/BaseActor.php
trunk/qubit/lib/model/om/BaseActorI18n.php
trunk/qubit/lib/model/om/BaseEvent.php
trunk/qubit/lib/model/om/BaseTerm.php
Log:
eliminate event.actor_role_type, move dates_of_existence from Event object to
actor.dates_of_existence
Modified: trunk/qubit/apps/qubit/modules/actor/actions/createAction.class.php
===================================================================
--- trunk/qubit/apps/qubit/modules/actor/actions/createAction.class.php
2008-11-10 22:21:31 UTC (rev 1545)
+++ trunk/qubit/apps/qubit/modules/actor/actions/createAction.class.php
2008-11-10 22:33:53 UTC (rev 1546)
@@ -47,9 +47,6 @@
$this->notes = null;
$this->noteTypes =
QubitTerm::getOptionsForSelectList(QubitTaxonomy::NOTE_TYPE_ID);
- //Events
- $this->date = new QubitEvent;
-
$this->repositoryReroute = null;
$this->informationObjectReroute = null;
Modified: trunk/qubit/apps/qubit/modules/actor/actions/editAction.class.php
===================================================================
--- trunk/qubit/apps/qubit/modules/actor/actions/editAction.class.php
2008-11-10 22:21:31 UTC (rev 1545)
+++ trunk/qubit/apps/qubit/modules/actor/actions/editAction.class.php
2008-11-10 22:33:53 UTC (rev 1546)
@@ -48,16 +48,6 @@
$this->notes = $this->actor->getActorNotes();
$this->noteTypes =
QubitTerm::getOptionsForSelectList(QubitTaxonomy::NOTE_TYPE_ID);
- //Event
- if ($this->actor->getDatesOfExistence())
- {
- $this->date = $this->actor->getDatesOfExistence();
- }
- else
- {
- $this->date = new QubitEvent;
- }
-
if ($this->getRequestParameter('repositoryReroute'))
{
$this->repositoryReroute =
$this->getRequestParameter('repositoryReroute');
Modified: trunk/qubit/apps/qubit/modules/actor/actions/showAction.class.php
===================================================================
--- trunk/qubit/apps/qubit/modules/actor/actions/showAction.class.php
2008-11-10 22:21:31 UTC (rev 1545)
+++ trunk/qubit/apps/qubit/modules/actor/actions/showAction.class.php
2008-11-10 22:33:53 UTC (rev 1546)
@@ -32,15 +32,6 @@
$this->languageCodes = $this->actor->getProperties($name =
'language_of_actor_description');
$this->scriptCodes = $this->actor->getProperties($name=
'script_of_actor_description');
- if ($this->actor->getDatesOfExistence())
- {
- $this->datesOfExistence =
$this->actor->getDatesOfExistence()->getDescription(array('cultureFallback' =>
true));
- }
- else
- {
- $this->datesOfExistence = null;
- }
-
$this->datesOfChanges = $this->actor->getDatesOfChanges();
$this->relatedActors = $this->actor->getRelatedActors();
Modified: trunk/qubit/apps/qubit/modules/actor/actions/updateAction.class.php
===================================================================
--- trunk/qubit/apps/qubit/modules/actor/actions/updateAction.class.php
2008-11-10 22:21:31 UTC (rev 1545)
+++ trunk/qubit/apps/qubit/modules/actor/actions/updateAction.class.php
2008-11-10 22:33:53 UTC (rev 1546)
@@ -94,13 +94,14 @@
}
}
// return to default edit template
- return $this->redirect(array('module' => 'actor', 'action' => 'edit', 'id'
=> $this->actor->getId()));
+ return $this->redirect(array('module' => 'actor', 'action' => 'show', 'id'
=> $this->actor->getId()));
}
} //close execute()
public function updateActorAttributes($actor)
{
$actor->setAuthorizedFormOfName($this->getRequestParameter('authorized_form_of_name'));
+
$actor->setDatesOfExistence($this->getRequestParameter('dates_of_existence'));
$actor->setCorporateBodyIdentifiers($this->getRequestParameter('corporate_body_identifiers'));
$actor->setHistory($this->getRequestParameter('history'));
$actor->setPlaces($this->getRequestParameter('places'));
Modified:
trunk/qubit/apps/qubit/modules/actor/actions/updateIsaarAction.class.php
===================================================================
--- trunk/qubit/apps/qubit/modules/actor/actions/updateIsaarAction.class.php
2008-11-10 22:21:31 UTC (rev 1545)
+++ trunk/qubit/apps/qubit/modules/actor/actions/updateIsaarAction.class.php
2008-11-10 22:33:53 UTC (rev 1546)
@@ -46,6 +46,6 @@
}
}
- return $this->redirect(array('module' => 'actor', 'action' => 'edit',
'actor_template' => 'isaar', 'id' => $this->actor->getId()));
+ return $this->redirect(array('module' => 'actor', 'action' => 'show',
'actor_template' => 'isaar', 'id' => $this->actor->getId()));
}
}
Modified: trunk/qubit/apps/qubit/modules/actor/templates/_contextMenu.php
===================================================================
--- trunk/qubit/apps/qubit/modules/actor/templates/_contextMenu.php
2008-11-10 22:21:31 UTC (rev 1545)
+++ trunk/qubit/apps/qubit/modules/actor/templates/_contextMenu.php
2008-11-10 22:33:53 UTC (rev 1546)
@@ -9,7 +9,7 @@
<?php if ($informationObjectRelations): ?>
<?php foreach ($informationObjectRelations as $relation): ?>
<div class="label">
- <?php echo $relation->getActorRole() ?>
+ <?php echo $relation->getType()->getRole() ?>
</div>
<div>
<?php echo link_to($relation->getInformationObject(),
'informationobject/show?id='.$relation->getInformationObjectId()) ?>
Modified: trunk/qubit/apps/qubit/modules/actor/templates/editIsaarSuccess.php
===================================================================
--- trunk/qubit/apps/qubit/modules/actor/templates/editIsaarSuccess.php
2008-11-10 22:21:31 UTC (rev 1545)
+++ trunk/qubit/apps/qubit/modules/actor/templates/editIsaarSuccess.php
2008-11-10 22:33:53 UTC (rev 1546)
@@ -71,22 +71,11 @@
<legend><?php echo __('description area'); ?></legend>
<div class="form-item">
- <?php if ($date) : ?>
- <?php echo input_hidden_tag('dateId', $date->getId()); ?>
- <?php endif; ?>
<label for="dates_of_existence"><?php echo __('dates of existence');
?></label>
- <table class="inline"><tr><td class="headerCell" align="center">
- <?php echo __('year'); ?></td><td class="headerCell"
align="center"><?php echo __('end year <br />(if range)'); ?></td>
- <td class="headerCell" style="width: 125px;">
- <?php echo __('date display <br />(defaults to date range)'); ?>
</td></tr>
- <tr><td><?php echo object_input_tag($date, 'getStartDate',
array('maxlength' => 4, 'style' => 'width: 35px;')) ?></td>
- <td><?php echo object_input_tag($date, 'getEndDate',
array('maxlength' => 4, 'style' => 'width: 35px;')) ?></td>
- <td>
- <?php if (strlen($sourceCultureValue =
$date->getDescription(array('sourceCulture' => 'true'))) > 0 &&
$sf_user->getCulture() != $date->getSourceCulture()): ?>
- <div class="default-translation" id="title"><?php echo
nl2br($sourceCultureValue) ?></div>
+ <?php if (strlen($sourceCultureValue =
$actor->getDatesOfExistence(array('sourceCulture' => 'true'))) > 0 &&
$sf_user->getCulture() != $actor->getSourceCulture()): ?>
+ <div class="default-translation"><?php echo nl2br($sourceCultureValue)
?></div>
<?php endif; ?>
- <?php echo object_input_tag($date, 'getDescription') ?></td></tr>
- </table>
+ <?php echo object_input_tag($actor, 'getDatesOfExistence', array('size'
=> 20)) ?>
</div>
<div class="form-item">
Modified: trunk/qubit/apps/qubit/modules/actor/templates/showIsaarSuccess.php
===================================================================
--- trunk/qubit/apps/qubit/modules/actor/templates/showIsaarSuccess.php
2008-11-10 22:21:31 UTC (rev 1545)
+++ trunk/qubit/apps/qubit/modules/actor/templates/showIsaarSuccess.php
2008-11-10 22:33:53 UTC (rev 1546)
@@ -39,10 +39,9 @@
</td></tr>
<?php endif; ?>
-<?php if ($datesOfExistence): ?>
- <tr><th>
- <?php echo __('dates of existence')?></th>
- <td><?php echo $datesOfExistence ?>
+<?php if (strlen($value = $actor->getDatesOfExistence(array('cultureFallback'
=> true))) >0): ?>
+ <tr><th><?php echo __('dates of existence')?></th>
+ <td><?php echo nl2br($value)?>
</td></tr>
<?php endif; ?>
Modified:
trunk/qubit/apps/qubit/modules/informationobject/templates/editIsadSuccess.php
===================================================================
---
trunk/qubit/apps/qubit/modules/informationobject/templates/editIsadSuccess.php
2008-11-10 22:21:31 UTC (rev 1545)
+++
trunk/qubit/apps/qubit/modules/informationobject/templates/editIsadSuccess.php
2008-11-10 22:33:53 UTC (rev 1546)
@@ -390,8 +390,8 @@
<label for="name_id"><?php echo __('name access points'); ?></label>
<?php if ($nameAccessPoints): ?>
<?php foreach ($nameAccessPoints as $name): ?>
- <?php echo $name->getActor().' ('.$name->getActorRole().')' ?>
- <?php if ($name->getActorRoleId() == QubitTerm::SUBJECT_ID): ?>
+ <?php echo $name->getActor().' ('.$name->getType()->getRole().')' ?>
+ <?php if ($name->getTypeId() == QubitTerm::SUBJECT_ID): ?>
<?php echo link_to(image_tag('delete', 'align=top'),
'informationobject/deleteEvent?eventId='.$name->getId().'&returnTemplate=isad')
?>
<?php endif; ?>
<br/>
Modified:
trunk/qubit/apps/qubit/modules/informationobject/templates/showIsadSuccess.php
===================================================================
---
trunk/qubit/apps/qubit/modules/informationobject/templates/showIsadSuccess.php
2008-11-10 22:21:31 UTC (rev 1545)
+++
trunk/qubit/apps/qubit/modules/informationobject/templates/showIsadSuccess.php
2008-11-10 22:33:53 UTC (rev 1546)
@@ -53,7 +53,7 @@
<?php endif; ?>
<?php if (count($physicalObjects) && $editCredentials): ?>
- <?php include_partial('physicalobject/show',
+ <?php include_partial('physicalobject/show',
array('informationObject'=>$informationObject,
'physicalObjects'=>$physicalObjects)); ?>
<?php endif; ?>
@@ -61,7 +61,7 @@
<tr>
<th><?php echo __('creator'); ?></th>
<td><?php echo link_to($creator, 'actor/show?id='.$creator->getId()); ?>
- <?php if ($creator->getDatesOfExistence()) echo '
('.$creator->getDatesOfExistence()->getDescription(array('cultureFallback' =>
true)).')'; ?>
+ <?php if ($creator->getDatesOfExistence()) echo '
('.$creator->getDatesOfExistence(array('cultureFallback' => true)).')'; ?>
<br />
<?php echo nl2br($creator->getHistory(array('cultureFallback' => true)));
?>
</td>
Modified: trunk/qubit/config/schema.yml
===================================================================
--- trunk/qubit/config/schema.yml 2008-11-10 22:21:31 UTC (rev 1545)
+++ trunk/qubit/config/schema.yml 2008-11-10 22:33:53 UTC (rev 1546)
@@ -55,7 +55,7 @@
name: varchar(255)
created_at:
updated_at:
-
+
property_i18n:
value: varchar(255)
@@ -130,6 +130,7 @@
actor_i18n:
authorized_form_of_name: { type: varchar(255), required: true }
+ dates_of_existence: varchar(255)
history: longvarchar
places: longvarchar
legal_status: longvarchar
@@ -260,7 +261,6 @@
end_date: bu_date
end_time: time
type_id: { type: integer, foreignTable: term, foreignReference: id }
- actor_role_id: { type: integer, foreignTable: term, foreignReference: id }
information_object_id: { type: integer, foreignTable: information_object,
foreignReference: id, onDelete: cascade }
actor_id:
created_at:
Modified: trunk/qubit/data/fixtures/sampleData.yml
===================================================================
--- trunk/qubit/data/fixtures/sampleData.yml 2008-11-10 22:21:31 UTC (rev
1545)
+++ trunk/qubit/data/fixtures/sampleData.yml 2008-11-10 22:33:53 UTC (rev
1546)
@@ -47,12 +47,6 @@
source_culture: en
id: <?php echo QubitTaxonomy::REPOSITORY_TYPE_ID."\n" ?>
name: { en: 'Repository Types', es: 'tipos de repositorios', fr: 'Types de
services d''archives', nl: 'Soorten bewaarplaatsen', pt: 'Tipos de repositório'
}
- QubitTaxonomy_9:
- created_at: '2008-04-24 09:30:11'
- updated_at: '2008-07-14 14:35:17'
- source_culture: en
- id: <?php echo QubitTaxonomy::ACTOR_ROLE_ID."\n" ?>
- name: { en: 'Actor Roles', fr: 'Rôle de l''acteur', nl: 'Rollen van
entiteiten', pt: Atribuições }
QubitTaxonomy_10:
created_at: '2008-04-24 09:30:11'
updated_at: '2008-07-14 14:35:17'
@@ -136,66 +130,6 @@
name: { en: 'RAD Title Note' }
note: { en: 'Title note types that occur specifically within the Canadian
Council on Archives' Rules for Archival Description (RAD)' }
QubitTerm:
- QubitTerm_5:
- taxonomy_id: QubitTaxonomy_9
- class_name: QubitTerm
- id: <?php echo QubitTerm::CREATOR_ID."\n" ?>
- lft: '1'
- rgt: '2'
- created_at: '2008-03-17 18:37:07'
- updated_at: '2008-08-14 09:53:17'
- source_culture: en
- name: { en: Creator, es: Produtor, fr: Producteur, nl: Vervaardiger, pt:
Produtor }
- QubitTerm_6:
- taxonomy_id: QubitTaxonomy_9
- class_name: QubitTerm
- id: <?php echo QubitTerm::CUSTODIAN_ID."\n" ?>
- lft: '3'
- rgt: '4'
- created_at: '2008-03-17 18:37:07'
- updated_at: '2008-08-14 09:53:17'
- source_culture: en
- name: { en: Custodian, es: Custodiador, fr: Détenteur, nl: Beheerder, pt:
Custodiador }
- QubitTerm_7:
- taxonomy_id: QubitTaxonomy_9
- class_name: QubitTerm
- id: <?php echo QubitTerm::PUBLISHER_ID."\n" ?>
- lft: '5'
- rgt: '6'
- created_at: '2008-03-17 18:37:07'
- updated_at: '2008-08-14 09:53:17'
- source_culture: en
- name: { en: Publisher, es: Publicador, fr: Éditeur, nl: Uitgever, pt:
Publicador }
- QubitTerm_8:
- taxonomy_id: QubitTaxonomy_9
- class_name: QubitTerm
- id: <?php echo QubitTerm::CONTRIBUTOR_ID."\n" ?>
- lft: '7'
- rgt: '8'
- created_at: '2008-03-17 18:37:07'
- updated_at: '2008-08-14 09:53:17'
- source_culture: en
- name: { en: Contributor, es: Colaborador, fr: Collaborateur, nl:
Contribuant, pt: Colaborador }
- QubitTerm_9:
- taxonomy_id: QubitTaxonomy_9
- class_name: QubitTerm
- id: <?php echo QubitTerm::SUBJECT_ID."\n" ?>
- lft: '9'
- rgt: '10'
- created_at: '2008-03-17 18:37:07'
- updated_at: '2008-08-14 09:53:17'
- source_culture: en
- name: { en: Subject, fr: Sujet, nl: Onderwerp, pt: Assunto }
- QubitTerm_10:
- taxonomy_id: QubitTaxonomy_9
- class_name: QubitTerm
- id: <?php echo QubitTerm::COLLECTOR_ID."\n" ?>
- lft: '11'
- rgt: '12'
- created_at: '2008-03-17 18:37:07'
- updated_at: '2008-08-14 09:53:17'
- source_culture: en
- name: { en: Collector, fr: Collectionneur, nl: Verzamelaar, pt: Coletor }
QubitTerm_11:
taxonomy_id: QubitTaxonomy_10
class_name: QubitTerm
@@ -209,13 +143,9 @@
QubitTerm_12:
taxonomy_id: QubitTaxonomy_10
class_name: QubitTerm
- id: <?php echo QubitTerm::EXISTENCE_ID."\n" ?>
- lft: '15'
- rgt: '16'
- created_at: '2008-03-17 18:37:07'
- updated_at: '2008-08-14 09:53:17'
+ id: <?php echo QubitTerm::SUBJECT_ID."\n" ?>
source_culture: en
- name: { en: Existence, es: Existência, fr: Existence, nl: Aanwezig, pt:
Existência }
+ name: { en: Subject, fr: Sujet, nl: Onderwerp, pt: Assunto }
QubitTerm_13:
taxonomy_id: QubitTaxonomy_10
class_name: QubitTerm
@@ -246,16 +176,6 @@
updated_at: '2008-08-14 09:53:17'
source_culture: en
name: { en: Contribution, es: Contribuição, fr: Contribution, nl:
Bijdrage, pt: Contribuição }
- QubitTerm_16:
- taxonomy_id: QubitTaxonomy_10
- class_name: QubitTerm
- id: <?php echo QubitTerm::SUBJECT_ACCESS_POINT_ID."\n" ?>
- lft: '23'
- rgt: '24'
- created_at: '2008-03-17 18:37:07'
- updated_at: '2008-08-14 09:53:17'
- source_culture: en
- name: { en: 'Subject access point', es: 'Punto de acceso', fr: 'Point
d''accès sujet', nl: Onderwerpsontsluitingsterm, pt: 'Ponto de acesso -
assunto' }
QubitTerm_17:
taxonomy_id: QubitTaxonomy_10
class_name: QubitTerm
@@ -496,41 +416,6 @@
updated_at: '2008-08-14 09:53:17'
source_culture: en
name: { en: 'has Physical Object', fr: 'contient un objet physique', nl:
'heeft fysiek object', pt: 'possui objeto físico' }
- QubitTerm_10a:
- taxonomy_id: QubitTaxonomy_9
- class_name: QubitTerm
- source_culture: en
- name: { en: 'Author' }
- QubitTerm_10b:
- taxonomy_id: QubitTaxonomy_9
- class_name: QubitTerm
- source_culture: en
- name: { en: 'Editor' }
- QubitTerm_10c:
- taxonomy_id: QubitTaxonomy_9
- class_name: QubitTerm
- source_culture: en
- name: { en: 'Translator' }
- QubitTerm_10d:
- taxonomy_id: QubitTaxonomy_9
- class_name: QubitTerm
- source_culture: en
- name: { en: 'Compiler' }
- QubitTerm_10e:
- taxonomy_id: QubitTaxonomy_9
- class_name: QubitTerm
- source_culture: en
- name: { en: 'Distributor' }
- QubitTerm_10f:
- taxonomy_id: QubitTaxonomy_9
- class_name: QubitTerm
- source_culture: en
- name: { en: 'Broadcaster' }
- QubitTerm_10g:
- taxonomy_id: QubitTaxonomy_9
- class_name: QubitTerm
- source_culture: en
- name: { en: 'Manufacturer' }
QubitTerm_17a:
taxonomy_id: QubitTaxonomy_10
class_name: QubitTerm
@@ -2098,15 +1983,6 @@
updated_at: '2008-04-24 09:42:38'
source_culture: en
date_display: { en: '1886-2003, predominant 1886-1993' }
- QubitEvent_185:
- type_id: QubitTerm_12
- actor_id: QubitActor_130
- class_name: QubitEvent
- start_date: '1886-01-01'
- created_at: '2008-04-24 09:50:31'
- updated_at: '2008-04-24 09:50:31'
- source_culture: en
- date_display: { en: 1886- }
QubitEvent_186:
type_id: QubitTerm_11
information_object_id: QubitInformationObject_135
@@ -2209,16 +2085,6 @@
updated_at: '2008-04-24 10:17:56'
source_culture: en
date_display: { en: '1897-[ca. 1990]; predominant 1919-1974' }
- QubitEvent_196:
- type_id: QubitTerm_12
- actor_id: QubitActor_131
- class_name: QubitEvent
- start_date: '1919-01-01'
- end_date: '1974-01-01'
- created_at: '2008-04-24 10:19:05'
- updated_at: '2008-04-24 10:25:16'
- source_culture: en
- date_display: { en: 1919-1974 }
QubitEvent_197:
type_id: QubitTerm_11
information_object_id: QubitInformationObject_146
@@ -2304,16 +2170,6 @@
created_at: '2008-06-16 16:07:13'
updated_at: '2008-06-16 16:07:13'
source_culture: en
- QubitEvent_206:
- type_id: QubitTerm_12
- actor_id: QubitActor_132
- class_name: QubitEvent
- start_date: '1995-01-01'
- end_date: '2002-01-01'
- created_at: '2008-04-24 12:05:03'
- updated_at: '2008-04-24 12:05:03'
- source_culture: en
- date_display: { en: 1994-2002 }
QubitEvent_207:
type_id: QubitTerm_11
information_object_id: QubitInformationObject_156
Modified: trunk/qubit/data/sql/lib.model.schema.sql
===================================================================
--- trunk/qubit/data/sql/lib.model.schema.sql 2008-11-10 22:21:31 UTC (rev
1545)
+++ trunk/qubit/data/sql/lib.model.schema.sql 2008-11-10 22:33:53 UTC (rev
1546)
@@ -440,6 +440,7 @@
CREATE TABLE `q_actor_i18n`
(
`authorized_form_of_name` VARCHAR(255) NOT NULL,
+ `dates_of_existence` VARCHAR(255),
`history` TEXT,
`places` TEXT,
`legal_status` TEXT,
@@ -866,7 +867,6 @@
`end_date` DATE,
`end_time` TIME,
`type_id` INTEGER,
- `actor_role_id` INTEGER,
`information_object_id` INTEGER,
`actor_id` INTEGER,
`created_at` DATETIME NOT NULL,
@@ -881,17 +881,13 @@
CONSTRAINT `q_event_FK_2`
FOREIGN KEY (`type_id`)
REFERENCES `q_term` (`id`),
- INDEX `q_event_FI_3` (`actor_role_id`),
+ INDEX `q_event_FI_3` (`information_object_id`),
CONSTRAINT `q_event_FK_3`
- FOREIGN KEY (`actor_role_id`)
- REFERENCES `q_term` (`id`),
- INDEX `q_event_FI_4` (`information_object_id`),
- CONSTRAINT `q_event_FK_4`
FOREIGN KEY (`information_object_id`)
REFERENCES `q_information_object` (`id`)
ON DELETE CASCADE,
- INDEX `q_event_FI_5` (`actor_id`),
- CONSTRAINT `q_event_FK_5`
+ INDEX `q_event_FI_4` (`actor_id`),
+ CONSTRAINT `q_event_FK_4`
FOREIGN KEY (`actor_id`)
REFERENCES `q_actor` (`id`)
)Type=InnoDB;
Modified: trunk/qubit/lib/model/QubitActor.php
===================================================================
--- trunk/qubit/lib/model/QubitActor.php 2008-11-10 22:21:31 UTC (rev
1545)
+++ trunk/qubit/lib/model/QubitActor.php 2008-11-10 22:33:53 UTC (rev
1546)
@@ -352,16 +352,6 @@
return QubitObjectTermRelation::get($criteria);
}
- public function getDatesOfExistence()
- {
- $criteria = new Criteria;
- $criteria->add(QubitEvent::ACTOR_ID, $this->getId());
- $criteria->add(QubitEvent::TYPE_ID, QubitTerm::EXISTENCE_ID);
- $event = QubitEvent::getOne($criteria);
-
- return $event;
- }
-
public function getDatesOfChanges()
{
//TO DO
Modified: trunk/qubit/lib/model/QubitInformationObject.php
===================================================================
--- trunk/qubit/lib/model/QubitInformationObject.php 2008-11-10 22:21:31 UTC
(rev 1545)
+++ trunk/qubit/lib/model/QubitInformationObject.php 2008-11-10 22:33:53 UTC
(rev 1546)
@@ -266,14 +266,14 @@
}
//Actor-Event Relations
- public function getActors($actorRoleTypeId = null)
+ public function getActors(array $options = array())
{
$criteria = new Criteria;
$criteria->addJoin(QubitActor::ID, QubitEvent::ACTOR_ID);
$criteria->add(QubitEvent::INFORMATION_OBJECT_ID, $this->getId());
- if ($actorRoleTypeId)
+ if (isset($options['eventTypeId']))
{
- $criteria->add(QubitEvent::ACTOR_ROLE_ID, $actorRoleTypeId);
+ $criteria->add(QubitEvent::TYPE_ID, $options['eventTypeId']);
}
$criteria->addGroupByColumn(QubitEvent::ACTOR_ID);
@@ -282,22 +282,24 @@
public function getCreators()
{
- $criteria = new Criteria;
+ return $this->getActors($options = array('eventTypeId' =>
QubitTerm::CREATION_ID));
+
+ /*$criteria = new Criteria;
$criteria->add(QubitEvent::INFORMATION_OBJECT_ID, $this->getId());
- $criteria->add(QubitEvent::ACTOR_ROLE_ID, QubitTerm::CREATOR_ID);
+ $criteria->add(QubitEvent::EVENT_TYPE_ID, QubitTerm::CREATION_ID);
$criteria->addJoin(QubitActor::ID, QubitEvent::ACTOR_ID,
Criteria::INNER_JOIN);
$actors = QubitActor::get($criteria);
- return $actors;
+ return $actors;*/
}
- public function getActorEvents($typeId = null)
+ public function getActorEvents(array $options = array())
{
$criteria = new Criteria;
$criteria->add(QubitEvent::INFORMATION_OBJECT_ID, $this->getId());
- if ($typeId)
+ if (isset($options['eventTypeId']))
{
- $criteria->add(QubitEvent::TYPE_ID, $typeId);
+ $criteria->add(QubitEvent::TYPE_ID, $options['eventTypeId']);
}
$criteria->addDescendingOrderByColumn(QubitEvent::START_DATE);
@@ -306,7 +308,9 @@
public function getCreationEvents()
{
- $criteria = new Criteria;
+ return $this->getActorEvents($options = array('eventTypeId' =>
QubitTerm::CREATION_ID));
+
+ /*$criteria = new Criteria;
$criteria->add(QubitEvent::INFORMATION_OBJECT_ID, $this->getId());
$criteria->addDescendingOrderByColumn(QubitEvent::START_DATE);
// check for Events that have a creator OR are of the type 'creation'
@@ -315,7 +319,7 @@
$crit0->addOr($crit1);
$criteria->add($crit0);
- return QubitEvent::get($criteria);
+ return QubitEvent::get($criteria);*/
}
/**
@@ -494,18 +498,18 @@
* Add a name access point to this info object
*
* @param integer $actorId primary key of actor
- * @param integer $actorRoleId foriegn key to QubitTerm for actor role
taxonomy
+ * @param integer $eventTypeId foriegn key to QubitTerm for event type
taxonomy
* @return QubitInformationObject this object
*/
- public function addNameAccessPoint($actorId, $actorRoleId)
+ public function setNameAccessPoint($actorId, $eventTypeId)
{
// Only add new related QubitEvent relation if an indentical relationship
// doesn't already exist
- if ($this->getNameAccessPoint($actorId, $actorRoleId) === null)
+ if ($this->getNameAccessPoint($actorId, $eventTypeId) === null)
{
$newNameAccessPoint = new QubitEvent;
$newNameAccessPoint->setActorId($actorId);
- $newNameAccessPoint->setActorRoleId($actorRoleId);
+ $newNameAccessPoint->setTypeId($eventTypeId);
$newNameAccessPoint->setInformationObjectId($this->getId());
$newNameAccessPoint->save();
}
@@ -532,19 +536,19 @@
}
/**
- * Get name access point by $actorId and $actorRoleId (should be unique)
+ * Get name access point by $actorId and $eventTypeId (should be unique)
*
* @param integer $actorId foreign key to QubitActor::ID
- * @param integer $actorRoleId foreign key to QubitTerm (actor role taxonomy)
+ * @param integer $eventTypeId foreign key to QubitTerm (even type taxonomy)
* @return QubitEvent object or NULL if no matching relation found
*/
- public function getNameAccessPoint($actorId, $actorRoleId)
+ public function getNameAccessPoint($actorId, $eventTypeId)
{
$criteria = new Criteria;
$criteria->add(QubitEvent::INFORMATION_OBJECT_ID, $this->getId());
$criteria->add(QubitEvent::ACTOR_ID, $actorId);
- $criteria->add(QubitEvent::ACTOR_ROLE_ID, $actorRoleId);
+ $criteria->add(QubitEvent::TYPE_ID, $eventTypeId);
return QubitEvent::getOne($criteria);
}
Modified: trunk/qubit/lib/model/QubitTerm.php
===================================================================
--- trunk/qubit/lib/model/QubitTerm.php 2008-11-10 22:21:31 UTC (rev 1545)
+++ trunk/qubit/lib/model/QubitTerm.php 2008-11-10 22:33:53 UTC (rev 1546)
@@ -24,20 +24,12 @@
//The following Term Ids are assigned constant values because they are used
//in application code and can't rely on database id values, since these
could be changed
- //ActorRole taxonomy
- const CREATOR_ID = 105;
- const CUSTODIAN_ID = 106;
- const PUBLISHER_ID = 107;
- const CONTRIBUTOR_ID = 108;
- const SUBJECT_ID = 109;
- const COLLECTOR_ID = 110;
//EventType taxonomy
const CREATION_ID = 111;
- const EXISTENCE_ID = 112;
+ const SUBJECT_ID = 112;
const CUSTODY_ID = 113;
const PUBLICATION_ID = 114;
const CONTRIBUTION_ID = 115;
- const SUBJECT_ACCESS_POINT_ID = 116;
const COLLECTION_ID = 117;
//NoteType taxonomy
const TITLE_NOTE_ID = 118;
@@ -77,12 +69,7 @@
public function isProtected()
{
//The following terms cannot be edited by users because their values are
used in application logic
- return $this->getId() == QubitTerm::CREATOR_ID ||
- $this->getId() == QubitTerm::CUSTODIAN_ID ||
- $this->getId() == QubitTerm::PUBLISHER_ID ||
- $this->getId() == QubitTerm::CONTRIBUTOR_ID ||
- $this->getId() == QubitTerm::CREATION_ID ||
- $this->getId() == QubitTerm::EXISTENCE_ID ||
+ return $this->getId() == QubitTerm::CREATION_ID ||
$this->getId() == QubitTerm::CUSTODY_ID ||
$this->getId() == QubitTerm::PUBLICATION_ID ||
$this->getId() == QubitTerm::CONTRIBUTION_ID ||
Modified: trunk/qubit/lib/model/map/ActorI18nMapBuilder.php
===================================================================
--- trunk/qubit/lib/model/map/ActorI18nMapBuilder.php 2008-11-10 22:21:31 UTC
(rev 1545)
+++ trunk/qubit/lib/model/map/ActorI18nMapBuilder.php 2008-11-10 22:33:53 UTC
(rev 1546)
@@ -34,6 +34,8 @@
$tMap->addColumn('AUTHORIZED_FORM_OF_NAME',
'AuthorizedFormOfName', 'string', CreoleTypes::VARCHAR, true, 255);
+ $tMap->addColumn('DATES_OF_EXISTENCE', 'DatesOfExistence',
'string', CreoleTypes::VARCHAR, false, 255);
+
$tMap->addColumn('HISTORY', 'History', 'string',
CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('PLACES', 'Places', 'string',
CreoleTypes::LONGVARCHAR, false, null);
Modified: trunk/qubit/lib/model/map/EventMapBuilder.php
===================================================================
--- trunk/qubit/lib/model/map/EventMapBuilder.php 2008-11-10 22:21:31 UTC
(rev 1545)
+++ trunk/qubit/lib/model/map/EventMapBuilder.php 2008-11-10 22:33:53 UTC
(rev 1546)
@@ -44,8 +44,6 @@
$tMap->addForeignKey('TYPE_ID', 'TypeId', 'int',
CreoleTypes::INTEGER, 'q_term', 'ID', false, null);
- $tMap->addForeignKey('ACTOR_ROLE_ID', 'ActorRoleId', 'int',
CreoleTypes::INTEGER, 'q_term', 'ID', false, null);
-
$tMap->addForeignKey('INFORMATION_OBJECT_ID',
'InformationObjectId', 'int', CreoleTypes::INTEGER, 'q_information_object',
'ID', false, null);
$tMap->addForeignKey('ACTOR_ID', 'ActorId', 'int',
CreoleTypes::INTEGER, 'q_actor', 'ID', false, null);
Modified: trunk/qubit/lib/model/om/BaseActor.php
===================================================================
--- trunk/qubit/lib/model/om/BaseActor.php 2008-11-10 22:21:31 UTC (rev
1545)
+++ trunk/qubit/lib/model/om/BaseActor.php 2008-11-10 22:33:53 UTC (rev
1546)
@@ -821,6 +821,24 @@
return $this;
}
+ public function getDatesOfExistence(array $options = array())
+ {
+ $datesOfExistence =
$this->getCurrentActorI18n($options)->getDatesOfExistence();
+ if (!empty($options['cultureFallback']) && strlen($datesOfExistence) < 1)
+ {
+ $datesOfExistence = $this->getCurrentActorI18n(array('sourceCulture' =>
true) + $options)->getDatesOfExistence();
+ }
+
+ return $datesOfExistence;
+ }
+
+ public function setDatesOfExistence($value, array $options = array())
+ {
+ $this->getCurrentActorI18n($options)->setDatesOfExistence($value);
+
+ return $this;
+ }
+
public function getHistory(array $options = array())
{
$history = $this->getCurrentActorI18n($options)->getHistory();
Modified: trunk/qubit/lib/model/om/BaseActorI18n.php
===================================================================
--- trunk/qubit/lib/model/om/BaseActorI18n.php 2008-11-10 22:21:31 UTC (rev
1545)
+++ trunk/qubit/lib/model/om/BaseActorI18n.php 2008-11-10 22:33:53 UTC (rev
1546)
@@ -7,6 +7,7 @@
const TABLE_NAME = 'q_actor_i18n';
const AUTHORIZED_FORM_OF_NAME = 'q_actor_i18n.AUTHORIZED_FORM_OF_NAME';
+ const DATES_OF_EXISTENCE = 'q_actor_i18n.DATES_OF_EXISTENCE';
const HISTORY = 'q_actor_i18n.HISTORY';
const PLACES = 'q_actor_i18n.PLACES';
const LEGAL_STATUS = 'q_actor_i18n.LEGAL_STATUS';
@@ -24,6 +25,7 @@
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(QubitActorI18n::AUTHORIZED_FORM_OF_NAME);
+ $criteria->addSelectColumn(QubitActorI18n::DATES_OF_EXISTENCE);
$criteria->addSelectColumn(QubitActorI18n::HISTORY);
$criteria->addSelectColumn(QubitActorI18n::PLACES);
$criteria->addSelectColumn(QubitActorI18n::LEGAL_STATUS);
@@ -45,7 +47,7 @@
public static function getFromResultSet(ResultSet $resultSet)
{
- if (!isset(self::$actorI18ns[$key =
serialize(array($resultSet->getInt(13), $resultSet->getString(14)))]))
+ if (!isset(self::$actorI18ns[$key =
serialize(array($resultSet->getInt(14), $resultSet->getString(15)))]))
{
$actorI18n = new QubitActorI18n;
$actorI18n->hydrate($resultSet);
@@ -117,6 +119,20 @@
return $this;
}
+ protected $datesOfExistence = null;
+
+ public function getDatesOfExistence()
+ {
+ return $this->datesOfExistence;
+ }
+
+ public function setDatesOfExistence($datesOfExistence)
+ {
+ $this->datesOfExistence = $datesOfExistence;
+
+ return $this;
+ }
+
protected $history = null;
public function getHistory()
@@ -313,6 +329,7 @@
protected function resetModified()
{
$this->columnValues['authorizedFormOfName'] = $this->authorizedFormOfName;
+ $this->columnValues['datesOfExistence'] = $this->datesOfExistence;
$this->columnValues['history'] = $this->history;
$this->columnValues['places'] = $this->places;
$this->columnValues['legalStatus'] = $this->legalStatus;
@@ -333,6 +350,7 @@
public function hydrate(ResultSet $results, $columnOffset = 1)
{
$this->authorizedFormOfName = $results->getString($columnOffset++);
+ $this->datesOfExistence = $results->getString($columnOffset++);
$this->history = $results->getString($columnOffset++);
$this->places = $results->getString($columnOffset++);
$this->legalStatus = $results->getString($columnOffset++);
@@ -407,6 +425,11 @@
$criteria->add(QubitActorI18n::AUTHORIZED_FORM_OF_NAME,
$this->authorizedFormOfName);
}
+ if ($this->isColumnModified('datesOfExistence'))
+ {
+ $criteria->add(QubitActorI18n::DATES_OF_EXISTENCE,
$this->datesOfExistence);
+ }
+
if ($this->isColumnModified('history'))
{
$criteria->add(QubitActorI18n::HISTORY, $this->history);
@@ -494,6 +517,11 @@
$criteria->add(QubitActorI18n::AUTHORIZED_FORM_OF_NAME,
$this->authorizedFormOfName);
}
+ if ($this->isColumnModified('datesOfExistence'))
+ {
+ $criteria->add(QubitActorI18n::DATES_OF_EXISTENCE,
$this->datesOfExistence);
+ }
+
if ($this->isColumnModified('history'))
{
$criteria->add(QubitActorI18n::HISTORY, $this->history);
Modified: trunk/qubit/lib/model/om/BaseEvent.php
===================================================================
--- trunk/qubit/lib/model/om/BaseEvent.php 2008-11-10 22:21:31 UTC (rev
1545)
+++ trunk/qubit/lib/model/om/BaseEvent.php 2008-11-10 22:33:53 UTC (rev
1546)
@@ -12,7 +12,6 @@
const END_DATE = 'q_event.END_DATE';
const END_TIME = 'q_event.END_TIME';
const TYPE_ID = 'q_event.TYPE_ID';
- const ACTOR_ROLE_ID = 'q_event.ACTOR_ROLE_ID';
const INFORMATION_OBJECT_ID = 'q_event.INFORMATION_OBJECT_ID';
const ACTOR_ID = 'q_event.ACTOR_ID';
const CREATED_AT = 'q_event.CREATED_AT';
@@ -31,7 +30,6 @@
$criteria->addSelectColumn(QubitEvent::END_DATE);
$criteria->addSelectColumn(QubitEvent::END_TIME);
$criteria->addSelectColumn(QubitEvent::TYPE_ID);
- $criteria->addSelectColumn(QubitEvent::ACTOR_ROLE_ID);
$criteria->addSelectColumn(QubitEvent::INFORMATION_OBJECT_ID);
$criteria->addSelectColumn(QubitEvent::ACTOR_ID);
$criteria->addSelectColumn(QubitEvent::CREATED_AT);
@@ -165,20 +163,6 @@
return $this;
}
- protected $actorRoleId = null;
-
- public function getActorRoleId()
- {
- return $this->actorRoleId;
- }
-
- public function setActorRoleId($actorRoleId)
- {
- $this->actorRoleId = $actorRoleId;
-
- return $this;
- }
-
protected $informationObjectId = null;
public function getInformationObjectId()
@@ -281,7 +265,6 @@
$this->columnValues['endDate'] = $this->endDate;
$this->columnValues['endTime'] = $this->endTime;
$this->columnValues['typeId'] = $this->typeId;
- $this->columnValues['actorRoleId'] = $this->actorRoleId;
$this->columnValues['informationObjectId'] = $this->informationObjectId;
$this->columnValues['actorId'] = $this->actorId;
$this->columnValues['createdAt'] = $this->createdAt;
@@ -301,7 +284,6 @@
$this->endDate = $results->getString($columnOffset++);
$this->endTime = $results->getTime($columnOffset++);
$this->typeId = $results->getInt($columnOffset++);
- $this->actorRoleId = $results->getInt($columnOffset++);
$this->informationObjectId = $results->getInt($columnOffset++);
$this->actorId = $results->getInt($columnOffset++);
$this->createdAt = $results->getTimestamp($columnOffset++, null);
@@ -386,11 +368,6 @@
$criteria->add(QubitEvent::TYPE_ID, $this->typeId);
}
- if ($this->isColumnModified('actorRoleId'))
- {
- $criteria->add(QubitEvent::ACTOR_ROLE_ID, $this->actorRoleId);
- }
-
if ($this->isColumnModified('informationObjectId'))
{
$criteria->add(QubitEvent::INFORMATION_OBJECT_ID,
$this->informationObjectId);
@@ -468,11 +445,6 @@
$criteria->add(QubitEvent::TYPE_ID, $this->typeId);
}
- if ($this->isColumnModified('actorRoleId'))
- {
- $criteria->add(QubitEvent::ACTOR_ROLE_ID, $this->actorRoleId);
- }
-
if ($this->isColumnModified('informationObjectId'))
{
$criteria->add(QubitEvent::INFORMATION_OBJECT_ID,
$this->informationObjectId);
@@ -534,25 +506,6 @@
return $this;
}
- public static function addJoinActorRoleCriteria(Criteria $criteria)
- {
- $criteria->addJoin(QubitEvent::ACTOR_ROLE_ID, QubitTerm::ID);
-
- return $criteria;
- }
-
- public function getActorRole(array $options = array())
- {
- return $this->actorRole = QubitTerm::getById($this->actorRoleId, $options);
- }
-
- public function setActorRole(QubitTerm $term)
- {
- $this->actorRoleId = $term->getId();
-
- return $this;
- }
-
public static function addJoinInformationObjectCriteria(Criteria $criteria)
{
$criteria->addJoin(QubitEvent::INFORMATION_OBJECT_ID,
QubitInformationObject::ID);
Modified: trunk/qubit/lib/model/om/BaseTerm.php
===================================================================
--- trunk/qubit/lib/model/om/BaseTerm.php 2008-11-10 22:21:31 UTC (rev
1545)
+++ trunk/qubit/lib/model/om/BaseTerm.php 2008-11-10 22:33:53 UTC (rev
1546)
@@ -1385,84 +1385,45 @@
return $this->termI18ns;
}
- public static function addEventsRelatedByTypeIdCriteriaById(Criteria
$criteria, $id)
+ public static function addEventsCriteriaById(Criteria $criteria, $id)
{
$criteria->add(QubitEvent::TYPE_ID, $id);
return $criteria;
}
- public static function getEventsRelatedByTypeIdById($id, array $options =
array())
+ public static function getEventsById($id, array $options = array())
{
$criteria = new Criteria;
- self::addEventsRelatedByTypeIdCriteriaById($criteria, $id);
+ self::addEventsCriteriaById($criteria, $id);
return QubitEvent::get($criteria, $options);
}
- public function addEventsRelatedByTypeIdCriteria(Criteria $criteria)
+ public function addEventsCriteria(Criteria $criteria)
{
- return self::addEventsRelatedByTypeIdCriteriaById($criteria, $this->id);
+ return self::addEventsCriteriaById($criteria, $this->id);
}
- protected $eventsRelatedByTypeId = null;
+ protected $events = null;
- public function getEventsRelatedByTypeId(array $options = array())
+ public function getEvents(array $options = array())
{
- if (!isset($this->eventsRelatedByTypeId))
+ if (!isset($this->events))
{
if (!isset($this->id))
{
- $this->eventsRelatedByTypeId = QubitQuery::create();
+ $this->events = QubitQuery::create();
}
else
{
- $this->eventsRelatedByTypeId =
self::getEventsRelatedByTypeIdById($this->id, array('self' => $this) +
$options);
+ $this->events = self::getEventsById($this->id, array('self' => $this)
+ $options);
}
}
- return $this->eventsRelatedByTypeId;
+ return $this->events;
}
- public static function addEventsRelatedByActorRoleIdCriteriaById(Criteria
$criteria, $id)
- {
- $criteria->add(QubitEvent::ACTOR_ROLE_ID, $id);
-
- return $criteria;
- }
-
- public static function getEventsRelatedByActorRoleIdById($id, array $options
= array())
- {
- $criteria = new Criteria;
- self::addEventsRelatedByActorRoleIdCriteriaById($criteria, $id);
-
- return QubitEvent::get($criteria, $options);
- }
-
- public function addEventsRelatedByActorRoleIdCriteria(Criteria $criteria)
- {
- return self::addEventsRelatedByActorRoleIdCriteriaById($criteria,
$this->id);
- }
-
- protected $eventsRelatedByActorRoleId = null;
-
- public function getEventsRelatedByActorRoleId(array $options = array())
- {
- if (!isset($this->eventsRelatedByActorRoleId))
- {
- if (!isset($this->id))
- {
- $this->eventsRelatedByActorRoleId = QubitQuery::create();
- }
- else
- {
- $this->eventsRelatedByActorRoleId =
self::getEventsRelatedByActorRoleIdById($this->id, array('self' => $this) +
$options);
- }
- }
-
- return $this->eventsRelatedByActorRoleId;
- }
-
public static function addSystemEventsCriteriaById(Criteria $criteria, $id)
{
$criteria->add(QubitSystemEvent::TYPE_ID, $id);
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---