View | Details | Raw Unified | Return to bug 5787
Collapse All | Expand All

(-)a/C4/Auth.pm (-1 lines)
Lines 421-427 sub get_template_and_user { Link Here
421
            OPACAmazonReviews         => C4::Context->preference("OPACAmazonReviews"),
421
            OPACAmazonReviews         => C4::Context->preference("OPACAmazonReviews"),
422
            OPACFRBRizeEditions       => C4::Context->preference("OPACFRBRizeEditions"),
422
            OPACFRBRizeEditions       => C4::Context->preference("OPACFRBRizeEditions"),
423
            OpacHighlightedWords       => C4::Context->preference("OpacHighlightedWords"),
423
            OpacHighlightedWords       => C4::Context->preference("OpacHighlightedWords"),
424
            OPACItemHolds             => C4::Context->preference("OPACItemHolds"),
425
            OPACShelfBrowser          => "". C4::Context->preference("OPACShelfBrowser"),
424
            OPACShelfBrowser          => "". C4::Context->preference("OPACShelfBrowser"),
426
            OPACURLOpenInNewWindow    => "" . C4::Context->preference("OPACURLOpenInNewWindow"),
425
            OPACURLOpenInNewWindow    => "" . C4::Context->preference("OPACURLOpenInNewWindow"),
427
            OPACUserCSS               => "". C4::Context->preference("OPACUserCSS"),
426
            OPACUserCSS               => "". C4::Context->preference("OPACUserCSS"),
(-)a/C4/Reserves.pm (+55 lines)
Lines 117-122 BEGIN { Link Here
117
        &CancelExpiredReserves
117
        &CancelExpiredReserves
118
118
119
        &IsAvailableForItemLevelRequest
119
        &IsAvailableForItemLevelRequest
120
121
        &OPACItemHoldsAllowed
120
        
122
        
121
        &AlterPriority
123
        &AlterPriority
122
        &ToggleLowestPriority
124
        &ToggleLowestPriority
Lines 1794-1799 sub _ShiftPriorityByDateAndPriority { Link Here
1794
    return $new_priority;  # so the caller knows what priority they wind up receiving
1796
    return $new_priority;  # so the caller knows what priority they wind up receiving
1795
}
1797
}
1796
1798
1799
=head2 OPACItemHoldsAllowed
1800
1801
  OPACItemHoldsAllowed($item_record,$borrower_record);
1802
1803
Checks issuingrules, using the borrowers categorycode, the itemtype, and branchcode to see
1804
if specific item holds are allowed, returns true if so. 
1805
1806
=cut
1807
1808
sub OPACItemHoldsAllowed {
1809
    my ($item,$borrower) = @_;
1810
1811
    my $branchcode = $item->{homebranch} or die "No homebranch";
1812
    my $itype;
1813
    my $dbh = C4::Context->dbh;
1814
    if (C4::Context->preference('item-level_itypes')) {
1815
       # We cant trust GetItem to honour the syspref, so safest to do it ourselves
1816
       # When GetItem is fixed, we can remove this
1817
       $itype = $item->{itype};
1818
    } 
1819
    else {
1820
       my $query = "SELECT itemtype FROM biblioitems WHERE biblioitemnumber = ? ";
1821
       my $sth = $dbh->prepare($query);        
1822
       $sth->execute($item->{biblioitemnumber});
1823
       if (my $data = $sth->fetchrow_hashref()){
1824
           $itype = $data->{itemtype};
1825
       }
1826
    }
1827
1828
    my $query = "SELECT opacitemholds,categorycode,itemtype,branchcode FROM issuingrules WHERE
1829
          (issuingrules.categorycode = ? OR issuingrules.categorycode = '*')
1830
        AND
1831
          (issuingrules.itemtype = ? OR issuingrules.itemtype = '*')
1832
        AND
1833
          (issuingrules.branchcode = ? OR issuingrules.branchcode = '*')
1834
        ORDER BY
1835
          issuingrules.categorycode desc,
1836
          issuingrules.itemtype desc,
1837
          issuingrules.branchcode desc
1838
       LIMIT 1";
1839
    my $dbh = C4::Context->dbh;
1840
    my $sth = $dbh->prepare($query);
1841
    $sth->execute($borrower->{categorycode},$itype,$branchcode);
1842
    my $data = $sth->fetchrow_hashref;
1843
    if ($data->{opacitemholds}){
1844
       return 1;
1845
    }
1846
    else {
1847
       return 0;
1848
    }
1849
}
1850
1851
1797
=head1 AUTHOR
1852
=head1 AUTHOR
1798
1853
1799
Koha Development Team <http://koha-community.org/>
1854
Koha Development Team <http://koha-community.org/>
(-)a/admin/smart-rules.pl (-4 / +5 lines)
Lines 101-108 elsif ($op eq 'delete-branch-item') { Link Here
101
# save the values entered
101
# save the values entered
102
elsif ($op eq 'add') {
102
elsif ($op eq 'add') {
103
    my $sth_search = $dbh->prepare("SELECT COUNT(*) AS total FROM issuingrules WHERE branchcode=? AND categorycode=? AND itemtype=?");
103
    my $sth_search = $dbh->prepare("SELECT COUNT(*) AS total FROM issuingrules WHERE branchcode=? AND categorycode=? AND itemtype=?");
104
    my $sth_insert = $dbh->prepare("INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, reservesallowed, issuelength, hardduedate, hardduedatecompare, fine, finedays, firstremind, chargeperiod,rentaldiscount) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
104
    my $sth_insert = $dbh->prepare("INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, reservesallowed, issuelength, hardduedate, hardduedatecompare, fine, finedays, firstremind, chargeperiod, rentaldiscount, opacitemholds) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
105
    my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, reservesallowed=?, issuelength=?, hardduedate=?, hardduedatecompare=?, rentaldiscount=?  WHERE branchcode=? AND categorycode=? AND itemtype=?");
105
    my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, reservesallowed=?, issuelength=?, hardduedate=?, hardduedatecompare=?, rentaldiscount=? opacitemholds=? WHERE branchcode=? AND categorycode=? AND itemtype=?");
106
    
106
    
107
    my $br = $branch; # branch
107
    my $br = $branch; # branch
108
    my $bor  = $input->param('categorycode'); # borrower category
108
    my $bor  = $input->param('categorycode'); # borrower category
Lines 121-134 elsif ($op eq 'add') { Link Here
121
    $hardduedate = format_date_in_iso($hardduedate);
121
    $hardduedate = format_date_in_iso($hardduedate);
122
    my $hardduedatecompare = $input->param('hardduedatecompare');
122
    my $hardduedatecompare = $input->param('hardduedatecompare');
123
    my $rentaldiscount = $input->param('rentaldiscount');
123
    my $rentaldiscount = $input->param('rentaldiscount');
124
    my $opacitemholds = $input->param('opacitemholds');
124
    $debug and warn "Adding $br, $bor, $cat, $fine, $maxissueqty";
125
    $debug and warn "Adding $br, $bor, $cat, $fine, $maxissueqty";
125
126
126
    $sth_search->execute($br,$bor,$cat);
127
    $sth_search->execute($br,$bor,$cat);
127
    my $res = $sth_search->fetchrow_hashref();
128
    my $res = $sth_search->fetchrow_hashref();
128
    if ($res->{total}) {
129
    if ($res->{total}) {
129
        $sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed,$reservesallowed, $issuelength,$hardduedate,$hardduedatecompare,$rentaldiscount, $br,$bor,$cat);
130
        $sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed,$reservesallowed, $issuelength,$hardduedate,$hardduedatecompare,$rentaldiscount, $opacitemholds, $br,$bor,$cat);
130
    } else {
131
    } else {
131
        $sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed,$reservesallowed,$issuelength,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount);
132
        $sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed,$reservesallowed,$issuelength,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount, $opacitemholds);
132
    }
133
    }
133
} 
134
} 
134
elsif ($op eq "set-branch-defaults") {
135
elsif ($op eq "set-branch-defaults") {
(-)a/admin/systempreferences.pl (-1 lines)
Lines 373-379 $tabsysprefs{suggestion} = "OPAC"; Link Here
373
$tabsysprefs{OpacTopissue}         = "OPAC";
373
$tabsysprefs{OpacTopissue}         = "OPAC";
374
$tabsysprefs{OpacBrowser}          = "OPAC";
374
$tabsysprefs{OpacBrowser}          = "OPAC";
375
$tabsysprefs{OpacRenewalAllowed}   = "OPAC";
375
$tabsysprefs{OpacRenewalAllowed}   = "OPAC";
376
$tabsysprefs{OPACItemHolds}        = "OPAC";
377
$tabsysprefs{OPACGroupResults}     = "OPAC";
376
$tabsysprefs{OPACGroupResults}     = "OPAC";
378
$tabsysprefs{XSLTDetailsDisplay}   = "OPAC";
377
$tabsysprefs{XSLTDetailsDisplay}   = "OPAC";
379
$tabsysprefs{XSLTResultsDisplay}   = "OPAC";
378
$tabsysprefs{XSLTResultsDisplay}   = "OPAC";
(-)a/installer/data/mysql/de-DE/mandatory/sysprefs.sql (-1 lines)
Lines 184-190 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
184
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:archiveID','KOHA-OAI-TEST','OAI-PMH archive identification',NULL,'Free');
184
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:archiveID','KOHA-OAI-TEST','OAI-PMH archive identification',NULL,'Free');
185
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:MaxCount','50','OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries',NULL,'Integer');
185
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:MaxCount','50','OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries',NULL,'Integer');
186
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:ConfFile','','If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.',NULL,'File');
186
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:ConfFile','','If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.',NULL,'File');
187
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemHolds','1','Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy.','','YesNo');
188
187
189
INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Allow user to choose what list to pick up from when adding patrons');
188
INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Allow user to choose what list to pick up from when adding patrons');
190
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','0','Use extended patron IDs and attributes',NULL,'YesNo');
189
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','0','Use extended patron IDs and attributes',NULL,'YesNo');
(-)a/installer/data/mysql/en/mandatory/sysprefs.sql (-1 lines)
Lines 186-192 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
186
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:archiveID','KOHA-OAI-TEST','OAI-PMH archive identification',NULL,'Free');
186
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:archiveID','KOHA-OAI-TEST','OAI-PMH archive identification',NULL,'Free');
187
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:MaxCount','50','OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries',NULL,'Integer');
187
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:MaxCount','50','OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries',NULL,'Integer');
188
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:ConfFile','','If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.',NULL,'File');
188
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:ConfFile','','If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.',NULL,'File');
189
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemHolds','1','Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy.','','YesNo');
190
189
191
INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Allow user to choose what list to pick up from when adding patrons');
190
INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Allow user to choose what list to pick up from when adding patrons');
192
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','0','Use extended patron IDs and attributes',NULL,'YesNo');
191
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','0','Use extended patron IDs and attributes',NULL,'YesNo');
(-)a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql (-1 lines)
Lines 184-190 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
184
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesCalendar',"noFinesWhenClosed",'Spécifie l''utilisation  du calendrier pour le calcul des dates de retours et les amendes',"ignoreCalendar|noFinesWhenClosed",'Choice');
184
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesCalendar',"noFinesWhenClosed",'Spécifie l''utilisation  du calendrier pour le calcul des dates de retours et les amendes',"ignoreCalendar|noFinesWhenClosed",'Choice');
185
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('previousIssuesDefaultSortOrder',"asc",'Ordre d''affichage des prêts en cours sur la page de circulation hors prêts du jour',"asc|desc",'Choice');
185
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('previousIssuesDefaultSortOrder',"asc",'Ordre d''affichage des prêts en cours sur la page de circulation hors prêts du jour',"asc|desc",'Choice');
186
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('todaysIssuesDefaultSortOrder',"desc",'Ordre d''affichage des prêts en cours (prêts du jour)',"asc|desc",'Choice');
186
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('todaysIssuesDefaultSortOrder',"desc",'Ordre d''affichage des prêts en cours (prêts du jour)',"asc|desc",'Choice');
187
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemHolds','1','Si activé, les adhérents peuvent placer des réservations sur un exemplaire spécifique. Sinon, il ne peuvent que réserver le prochain disponible.','','YesNo');
188
INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Slectionner categorycode ou category_type permet d''afficher la liste des catégories ou des types de catégories à l''ajout d''un lecteur');
187
INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Slectionner categorycode ou category_type permet d''afficher la liste des catégories ou des types de catégories à l''ajout d''un lecteur');
189
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','0','Utiliser les attributs étendus pour les adhérents',NULL,'YesNo');
188
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','0','Utiliser les attributs étendus pour les adhérents',NULL,'YesNo');
190
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('RenewSerialAddsSuggestion','0','Si activé, génère une suggestion d''achat à chaque Renouvellement d''abonnement',NULL,'YesNo');
189
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('RenewSerialAddsSuggestion','0','Si activé, génère une suggestion d''achat à chaque Renouvellement d''abonnement',NULL,'YesNo');
(-)a/installer/data/mysql/it-IT/necessari/sysprefs.sql (-1 lines)
Lines 124-130 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
124
insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('OPACFRBRizeEditions','1','','Se ON, Koha farà delle richieste a uno o più ISBN web services per trovare gli ISBN associabili e li visualizzarà in un tab \'Edizioni\' nella visualizzazione dettagliata','YesNo');
124
insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('OPACFRBRizeEditions','1','','Se ON, Koha farà delle richieste a uno o più ISBN web services per trovare gli ISBN associabili e li visualizzarà in un tab \'Edizioni\' nella visualizzazione dettagliata','YesNo');
125
insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('opacheader','','70|10','Inserire qui HTML da includere come header nell\'OPAC','Textarea');
125
insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('opacheader','','70|10','Inserire qui HTML da includere come header nell\'OPAC','Textarea');
126
insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('OpacHighlightedWords','1','','Se impostato, le parole cercate nell\'OPAC vengono poi evidenziate ','YesNo');
126
insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('OpacHighlightedWords','1','','Se impostato, le parole cercate nell\'OPAC vengono poi evidenziate ','YesNo');
127
insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('OPACItemHolds','1','','Consente agli utenti dell\'OPAC di inserire prenotazioni su specifici documenti. Se INATTIVO, gli utenti possono solo richiedere la copia dopo che è tornata ad essere disponibile.','YesNo');
128
insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('OPACItemsResultsDisplay','statuses','statuses|itemdetails','statuses : mostra solo lo status dei documenti presenti nella lista del risultato. itemdisplay : mostra tutti i dati della collocazione di tali documenti (sottobiblioteca+collocazione) così come appaiono nell\'interfaccia dello staff','Choice');
127
insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('OPACItemsResultsDisplay','statuses','statuses|itemdetails','statuses : mostra solo lo status dei documenti presenti nella lista del risultato. itemdisplay : mostra tutti i dati della collocazione di tali documenti (sottobiblioteca+collocazione) così come appaiono nell\'interfaccia dello staff','Choice');
129
insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('opaclanguages','en,it-IT','','Per impostare la lingua di default dell\'OPAC.','Languages');
128
insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('opaclanguages','en,it-IT','','Per impostare la lingua di default dell\'OPAC.','Languages');
130
insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('opaclanguagesdisplay','1','','Se su ON, consente di visualizzare nell\'OPAC la funzione Modifica Lingua','YesNo');
129
insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('opaclanguagesdisplay','1','','Se su ON, consente di visualizzare nell\'OPAC la funzione Modifica Lingua','YesNo');
(-)a/installer/data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql (-1 lines)
Lines 202-208 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
202
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:archiveID','KOHA-OAI-TEST','OAI-PMH archive identification',NULL,'Free');
202
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:archiveID','KOHA-OAI-TEST','OAI-PMH archive identification',NULL,'Free');
203
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:MaxCount','50','OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries',NULL,'Integer');
203
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:MaxCount','50','OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries',NULL,'Integer');
204
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:ConfFile','','If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.',NULL,'File');
204
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:ConfFile','','If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.',NULL,'File');
205
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemHolds','1','Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy.','','YesNo');
206
205
207
INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Allow user to choose what list to pick up from when adding patrons');
206
INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Allow user to choose what list to pick up from when adding patrons');
208
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','0','Use extended patron IDs and attributes',NULL,'YesNo');
207
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','0','Use extended patron IDs and attributes',NULL,'YesNo');
(-)a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql (-1 lines)
Lines 183-189 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
183
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH','0','if ON, OAI-PMH server is enabled',NULL,'YesNo');
183
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH','0','if ON, OAI-PMH server is enabled',NULL,'YesNo');
184
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:archiveID','KOHA-OAI-TEST','OAI-PMH archive identification',NULL,'Free');
184
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:archiveID','KOHA-OAI-TEST','OAI-PMH archive identification',NULL,'Free');
185
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:MaxCount','50','OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries',NULL,'Integer');
185
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:MaxCount','50','OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries',NULL,'Integer');
186
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemHolds','1','Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy.','','YesNo');
187
186
188
INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Allow user to choose what list to pick up from when adding patrons');
187
INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Allow user to choose what list to pick up from when adding patrons');
189
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','0','Use extended patron IDs and attributes',NULL,'YesNo');
188
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','0','Use extended patron IDs and attributes',NULL,'YesNo');
(-)a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql (-1 lines)
Lines 210-216 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
210
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH','0','if ON, OAI-PMH server is enabled',NULL,'YesNo');
210
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH','0','if ON, OAI-PMH server is enabled',NULL,'YesNo');
211
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:archiveID','KOHA-OAI-TEST','OAI-PMH archive identification',NULL,'Free');
211
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:archiveID','KOHA-OAI-TEST','OAI-PMH archive identification',NULL,'Free');
212
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:MaxCount','50','OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries',NULL,'Integer');
212
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:MaxCount','50','OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries',NULL,'Integer');
213
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemHolds','1','Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy.','','YesNo');
214
213
215
INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Allow user to choose what list to pick up from when adding patrons');
214
INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Allow user to choose what list to pick up from when adding patrons');
216
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','1','Use extended patron IDs and attributes',NULL,'YesNo');
215
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','1','Use extended patron IDs and attributes',NULL,'YesNo');
(-)a/installer/data/mysql/ru-RU/mandatory/system_preferences_only_translation_updating.sql (-1 lines)
Lines 400-408 UPDATE systempreferences SET explanation='Если установлено, вы Link Here
400
-- UPDATE systempreferences SET explanation='' WHERE variable='OpacHighlightedWords';
400
-- UPDATE systempreferences SET explanation='' WHERE variable='OpacHighlightedWords';
401
-- 	If Set, then queried words are higlighted in OPAC
401
-- 	If Set, then queried words are higlighted in OPAC
402
402
403
-- UPDATE systempreferences SET explanation='' WHERE variable='OPACItemHolds';
(-)a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql (-1 lines)
Lines 235-241 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
235
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH','0','if ON, OAI-PMH server is enabled',NULL,'YesNo');
235
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH','0','if ON, OAI-PMH server is enabled',NULL,'YesNo');
236
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:archiveID','KOHA-OAI-TEST','OAI-PMH archive identification',NULL,'Free');
236
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:archiveID','KOHA-OAI-TEST','OAI-PMH archive identification',NULL,'Free');
237
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:MaxCount','50','OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries',NULL,'Integer');
237
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:MaxCount','50','OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries',NULL,'Integer');
238
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemHolds','1','Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy.','','YesNo');
239
238
240
INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Allow user to choose what list to pick up from when adding patrons');
239
INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Allow user to choose what list to pick up from when adding patrons');
241
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','1','Use extended patron IDs and attributes',NULL,'YesNo');
240
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','1','Use extended patron IDs and attributes',NULL,'YesNo');
(-)a/installer/data/mysql/uk-UA/mandatory/system_preferences_only_translation_updating.sql (-1 lines)
Lines 399-407 UPDATE systempreferences SET explanation='Якщо встановлено, ви Link Here
399
-- UPDATE systempreferences SET explanation='Якщо увімкнуто, то ' WHERE variable='OpacHighlightedWords';
399
-- UPDATE systempreferences SET explanation='Якщо увімкнуто, то ' WHERE variable='OpacHighlightedWords';
400
-- 	If Set, then queried words are higlighted in OPAC
400
-- 	If Set, then queried words are higlighted in OPAC
401
401
402
-- UPDATE systempreferences SET explanation='' WHERE variable='OPACItemHolds';
(-)a/installer/data/mysql/updatedatabase.pl (+16 lines)
Lines 4370-4375 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
4370
    SetVersion($DBversion);
4370
    SetVersion($DBversion);
4371
}
4371
}
4372
4372
4373
$DBversion = '3.05.00.XXX';
4374
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4375
    print "Upgrade to $DBversion done (Bug 5787 move OPACItemHolds system preference to circulation matrix)\n";
4376
    # First create the column
4377
    $dbh->do("ALTER TABLE issuingrules ADD opacitemholds BOOLEAN");
4378
    # Now update the column    
4379
    if (C4::Context->preference("OPACItemHolds")){
4380
       # Pref is on, set allow for all rules
4381
       $dbh->do("UPDATE issuingrules SET opacitemholds=1");
4382
    }
4383
    # If the preference is not set, leave off
4384
    # Remove from the systempreferences table
4385
    $dbh->do("DELETE FROM systempreferences WHERE variable = 'OPACItemHolds'");    
4386
    SetVersion ($DBversion);
4387
}
4388
4373
=head1 FUNCTIONS
4389
=head1 FUNCTIONS
4374
4390
4375
=head2 DropAllForeignKeys($table)
4391
=head2 DropAllForeignKeys($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-6 lines)
Lines 295-306 OPAC: Link Here
295
#              choices:
295
#              choices:
296
#            - If ON, enables subject cloud on OPAC
296
#            - If ON, enables subject cloud on OPAC
297
        -
297
        -
298
            - pref: OPACItemHolds
299
              choices:
300
                  yes: Allow
301
                  no: "Don't allow"
302
            - patrons to place holds on specific items in the OPAC. If this is disabled, users can only put a hold on the next available item.
303
        -
304
            - pref: OpacRenewalAllowed
298
            - pref: OpacRenewalAllowed
305
              choices:
299
              choices:
306
                  yes: Allow
300
                  yes: Allow
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (+3 lines)
Lines 81-86 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde Link Here
81
                <th>Renewals Allowed (count)</th>
81
                <th>Renewals Allowed (count)</th>
82
                <th>Holds Allowed (count)</th>
82
                <th>Holds Allowed (count)</th>
83
		        <th>Rental Discount (%)</th>
83
		        <th>Rental Discount (%)</th>
84
		        <th>Allow OPAC Users to place Holds on Items</th>
84
				<th>&nbsp;</th>
85
				<th>&nbsp;</th>
85
            </tr>
86
            </tr>
86
				[% FOREACH rule IN rules %]
87
				[% FOREACH rule IN rules %]
Lines 122-127 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde Link Here
122
							<td>[% rule.renewalsallowed %]</td>
123
							<td>[% rule.renewalsallowed %]</td>
123
							<td>[% rule.reservesallowed %]</td>
124
							<td>[% rule.reservesallowed %]</td>
124
							<td>[% rule.rentaldiscount %]</td>
125
							<td>[% rule.rentaldiscount %]</td>
126
							<td>[% IF rule.opacitemholds %]Yes[% ELSE %]No[% END %]</td>
125
							<td>
127
							<td>
126
								<a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&amp;itemtype=[% rule.itemtype %]&amp;categorycode=[% rule.categorycode %]&amp;branch=[% rule.current_branch %]">Delete</a>
128
								<a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&amp;itemtype=[% rule.itemtype %]&amp;categorycode=[% rule.categorycode %]&amp;branch=[% rule.current_branch %]">Delete</a>
127
							</td>
129
							</td>
Lines 176-181 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde Link Here
176
                    <td><input name="renewalsallowed" size="2" /></td>
178
                    <td><input name="renewalsallowed" size="2" /></td>
177
                    <td><input name="reservesallowed" size="2" /></td>
179
                    <td><input name="reservesallowed" size="2" /></td>
178
		    <td><input name="rentaldiscount" size="2" /></td>
180
		    <td><input name="rentaldiscount" size="2" /></td>
181
		    <td><input type="checkbox" name="opacitemholds" value="1" /></td>
179
                    <td><input type="hidden" name="branch" value="[% current_branch %]"/><input type="submit" value="Add" class="submit" /></td>
182
                    <td><input type="hidden" name="branch" value="[% current_branch %]"/><input type="submit" value="Add" class="submit" /></td>
180
                </tr>
183
                </tr>
181
            </table>
184
            </table>
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt (-47 / +27 lines)
Lines 242-250 Link Here
242
		  <th>Hold Starts on Date</th>
242
		  <th>Hold Starts on Date</th>
243
		  [% END %]
243
		  [% END %]
244
		  <th>Hold Not Needed After</th>
244
		  <th>Hold Not Needed After</th>
245
                  [% IF ( OPACItemHolds ) %]
245
          <th id="place_on_hdr" style="display:none">Place On</th>
246
                    <th id="place_on_hdr" style="display:none">Place On</th>
247
                  [% END %]
248
                  [% UNLESS ( singleBranchMode ) %]
246
                  [% UNLESS ( singleBranchMode ) %]
249
		    [% IF ( choose_branch ) %]
247
		    [% IF ( choose_branch ) %]
250
                        <th>Pickup Location</th>
248
                        <th>Pickup Location</th>
Lines 374-423 Link Here
374
      <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('expiration_date_[% bibitemloo.biblionumber %]').value='';return false;">Clear Date</a></p>
372
      <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('expiration_date_[% bibitemloo.biblionumber %]').value='';return false;">Clear Date</a></p>
375
    </td>[% END %]
373
    </td>[% END %]
376
374
377
                    [% IF ( bibitemloo.holdable ) %]
375
         [% IF ( bibitemloo.holdable ) %]
378
		    <!-- HOLD ABLE -->
376
		    <!-- HOLD ABLE -->
379
		    [% IF ( OPACItemHolds ) %]
377
		    [% IF ( bibitemloo.opacitemholds ) %]
380
		    <!-- ITEM HOLDS -->
378
		    <!-- ITEM HOLDS -->
381
                                          <td class="place_on_type" style="display:none">
379
                        <td class="place_on_type" style="display:none">
382
                                            <ul>
380
                          <ul>
383
                                                <li>
381
                              <li>
384
                                                  [% UNLESS ( bibitemloo.holdable ) %]
382
                                  <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
385
                                                    <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
383
                                         id="reqany_[% bibitemloo.biblionumber %]"
386
                                                           id="reqany_[% bibitemloo.biblionumber %]"
384
                                         class="selectany"
387
                                                           class="selectany"
385
                                         value="Any"
388
                                                           value="Any"
386
                                         checked="checked"
389
                                                           disabled="disabled"
387
                                  />
390
                                                    />
388
                                <label for="reqany_[% bibitemloo.biblionumber %]">Next available copy</label>
391
                                                  [% ELSE %]
389
                              </li>
392
                                                    <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
390
                              <li>
393
                                                           id="reqany_[% bibitemloo.biblionumber %]"
391
                                  <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
394
                                                           class="selectany"
392
                                         id="reqspecific_[% bibitemloo.biblionumber %]"
395
                                                           value="Any"
393
                                         class="selectspecific"
396
                                                           checked="checked"
394
                                         value="Specific"
397
                                                    />
395
                                  />
398
                                                  [% END %]
396
                                <label for="reqspecific_[% bibitemloo.biblionumber %]">A specific copy</label>
399
                                                  <label for="reqany_[% bibitemloo.biblionumber %]">Next available copy</label>
397
                              </li>
400
                                                </li>
398
                          </ul>
401
                                                <li>
399
                        </td>
402
                                                  [% UNLESS ( bibitemloo.holdable ) %]
400
            [% END %][% END %]
403
                                                    <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
404
                                                           id="reqspecific_[% bibitemloo.biblionumber %]"
405
                                                           class="selectspecific"
406
                                                           disabled="disabled"
407
                                                           value="Specific"
408
                                                    />
409
                                                  [% ELSE %]
410
                                                    <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
411
                                                           id="reqspecific_[% bibitemloo.biblionumber %]"
412
                                                           class="selectspecific"
413
                                                           value="Specific"
414
                                                    />
415
                                                  [% END %]
416
                                                  <label for="reqspecific_[% bibitemloo.biblionumber %]">A specific copy</label>
417
                                                </li>
418
                                            </ul>
419
                                          </td>
420
                                        [% END %][% END %]
421
401
422
                    [% UNLESS ( singleBranchMode ) %]
402
                    [% UNLESS ( singleBranchMode ) %]
423
                        [% IF ( bibitemloo.holdable ) %]
403
                        [% IF ( bibitemloo.holdable ) %]
Lines 439-445 Link Here
439
                    [% END %]
419
                    [% END %]
440
                  </tr>
420
                  </tr>
441
421
442
                  [% IF ( OPACItemHolds ) %]
422
                  [% IF ( bibitemloo.opacitemholds ) %]
443
                  [% IF ( bibitemloo.holdable ) %]
423
                  [% IF ( bibitemloo.holdable ) %]
444
                    <tr class="copiesrow" id="copiesrow_[% bibitemloo.biblionumber %]">
424
                    <tr class="copiesrow" id="copiesrow_[% bibitemloo.biblionumber %]">
445
                      <td>&nbsp;</td>
425
                      <td>&nbsp;</td>
Lines 520-526 Link Here
520
                      </td>
500
                      </td>
521
                    </tr>
501
                    </tr>
522
                  [% END %]<!-- bib_available -->
502
                  [% END %]<!-- bib_available -->
523
                  [% END %]<!-- OPACItemHolds -->
503
                  [% END %]<!-- bibitemloo.opacitemholds -->
524
                [% END %]
504
                [% END %]
525
              </table><!-- bibitemloop -->
505
              </table><!-- bibitemloop -->
526
              [% END %] <!-- if message -->
506
              [% END %] <!-- if message -->
(-)a/opac/opac-reserve.pl (-5 / +9 lines)
Lines 344-349 foreach my $biblioNum (@biblionumbers) { Link Here
344
344
345
    $biblioLoopIter{itemLoop} = [];
345
    $biblioLoopIter{itemLoop} = [];
346
    my $numCopiesAvailable = 0;
346
    my $numCopiesAvailable = 0;
347
    my $numCopiesOPACAvailable = 0;
347
    foreach my $itemInfo (@{$biblioData->{itemInfos}}) {
348
    foreach my $itemInfo (@{$biblioData->{itemInfos}}) {
348
        my $itemNum = $itemInfo->{itemnumber};
349
        my $itemNum = $itemInfo->{itemnumber};
349
        my $itemLoopIter = {};
350
        my $itemLoopIter = {};
Lines 432-439 foreach my $biblioNum (@biblionumbers) { Link Here
432
            $policy_holdallowed = 0;
433
            $policy_holdallowed = 0;
433
        }
434
        }
434
435
436
        $itemLoopIter->{opacitemholds} = OPACItemHoldsAllowed( $itemInfo, $borr );
437
435
        if (IsAvailableForItemLevelRequest($itemNum) and $policy_holdallowed and CanItemBeReserved($borrowernumber,$itemNum)) {
438
        if (IsAvailableForItemLevelRequest($itemNum) and $policy_holdallowed and CanItemBeReserved($borrowernumber,$itemNum)) {
436
            $itemLoopIter->{available} = 1;
439
            if ($itemLoopIter->{opacitemholds}) {
440
                $itemLoopIter->{available} = 1;
441
                $numCopiesOPACAvailable++;
442
            }
437
            $numCopiesAvailable++;
443
            $numCopiesAvailable++;
438
        }
444
        }
439
445
Lines 459-468 foreach my $biblioNum (@biblionumbers) { Link Here
459
        $numBibsAvailable++;
465
        $numBibsAvailable++;
460
        $biblioLoopIter{bib_available} = 1;
466
        $biblioLoopIter{bib_available} = 1;
461
        $biblioLoopIter{holdable} = 1;
467
        $biblioLoopIter{holdable} = 1;
468
        $biblioLoopIter{itemholdable} = 1 if $numCopiesOPACAvailable;
462
        $anyholdable = 1;
469
        $anyholdable = 1;
463
    }
470
    }
464
    if ($biblioLoopIter{already_reserved}) {
471
    if ($biblioLoopIter{already_reserved}) {
465
        $biblioLoopIter{holdable} = undef;
472
        $biblioLoopIter{holdable} = undef;
473
        $biblioLoopIter{itemholdable} = undef;
466
        $anyholdable = undef;
474
        $anyholdable = undef;
467
    }
475
    }
468
    if(not CanBookBeReserved($borrowernumber,$biblioNum)){
476
    if(not CanBookBeReserved($borrowernumber,$biblioNum)){
Lines 478-486 if ( $numBibsAvailable == 0 || !$anyholdable) { Link Here
478
}
486
}
479
487
480
my $itemTableColspan = 7;
488
my $itemTableColspan = 7;
481
if (! $template->{VARS}->{'OPACItemHolds'}) {
482
    $itemTableColspan--;
483
}
484
if (! $template->{VARS}->{'singleBranchMode'}) {
489
if (! $template->{VARS}->{'singleBranchMode'}) {
485
    $itemTableColspan--;
490
    $itemTableColspan--;
486
}
491
}
487
- 

Return to bug 5787