| 1 |
<?PHP |
<?PHP |
| 2 |
// $Id: biblio.install,v 1.77.2.3 2009/11/02 01:45:24 rjerome Exp $ |
// $Id: biblio.install,v 1.77.2.4 2009/11/10 22:09:18 rjerome Exp $ |
| 3 |
function biblio_install() { |
function biblio_install() { |
| 4 |
$result = array(); |
$result = array(); |
| 5 |
|
|
| 764 |
), |
), |
| 765 |
'aka' => array( |
'aka' => array( |
| 766 |
'type' => 'int', |
'type' => 'int', |
| 767 |
'not null' => TRUE, |
'not null' => FALSE, |
|
'default' => 0, |
|
| 768 |
'unsigned' => TRUE, |
'unsigned' => TRUE, |
| 769 |
'description' =>'Also known as, links this author entry with others so you can have variation on the name, but listing by cid will find all other (aka) author entries', |
'description' =>'Also known as, links this author entry with others so you can have variation on the name, but listing by cid will find all other (aka) author entries', |
| 770 |
), |
), |
| 831 |
) |
) |
| 832 |
|
|
| 833 |
), |
), |
| 834 |
'primary key' => array('cid','aka'), |
'primary key' => array('cid'), |
| 835 |
'indexes' => array( |
'indexes' => array( |
| 836 |
'lastname' => array('lastname'), |
'lastname' => array('lastname'), |
| 837 |
'firstname' => array('firstname'), |
'firstname' => array('firstname'), |
| 1442 |
static $result = NULL; |
static $result = NULL; |
| 1443 |
if (!empty($build)) { //refresh cache from table |
if (!empty($build)) { //refresh cache from table |
| 1444 |
unset($result[$build['tablename']]); |
unset($result[$build['tablename']]); |
| 1445 |
$res = db_query("SELECT ".$build['name_column'].", ".$build['id_column']." FROM {".$build['tablename']."}"); |
$res = db_query("SELECT ".$build['name_column'].", ".$build['id_column']." FROM {".$build['tablename']."}",array(), array('fetch' => PDO::FETCH_ASSOC)); |
| 1446 |
foreach ($res->fetchAssoc() as $row ){ |
foreach ($res as $row ){ |
| 1447 |
$result[$build['tablename']][$row[$build['name_column']]] = $row[$build['id_column']]; |
$result[$build['tablename']][$row[$build['name_column']]] = $row[$build['id_column']]; |
| 1448 |
} |
} |
| 1449 |
return; |
return; |
| 1962 |
} |
} |
| 1963 |
*/ |
*/ |
| 1964 |
function biblio_update_7000() { |
function biblio_update_7000() { |
| 1965 |
|
$result = array(); |
| 1966 |
|
|
| 1967 |
|
db_drop_primary_key($result, 'biblio_contributor_data'); |
| 1968 |
|
db_add_primary_key($result, 'biblio_contributor_data', array('cid', 'aka')); |
| 1969 |
|
|
| 1970 |
|
return $result; |
| 1971 |
|
|
| 1972 |
} |
} |