Managing Independant branches.
librarian can edit only subscriptions on branches of his or subscription with no branch now. cannotedit is a calculated value in Mysql and transfered for process. Signed-off-by: Chris Cormack <crc@liblime.com> Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
parent
59d80a8ce0
commit
4399daf0bd
146
C4/Serials.pm
146
C4/Serials.pm
|
|
@ -244,7 +244,14 @@ sub GetSerialInformation {
|
|||
my ($serialid) = @_;
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $query = qq|
|
||||
SELECT serial.*, serial.notes as sernotes, serial.status as serstatus,subscription.*,subscription.subscriptionid as subsid
|
||||
SELECT serial.*, serial.notes as sernotes, serial.status as serstatus,subscription.*,subscription.subscriptionid as subsid|;
|
||||
if (C4::Context->preference('IndependantBranches') &&
|
||||
C4::Context->userenv &&
|
||||
C4::Context->userenv->{'flags'} != 1 && C4::Context->userenv->{'branch'}){
|
||||
$query.="
|
||||
, ((subscription.branchcode <>\"".C4::Context->userenv->{'branch'}."\") and subscription.branchcode <>\"\" and subscription.branchcode IS NOT NULL) as cannotedit ";
|
||||
}
|
||||
$query .= qq|
|
||||
FROM serial LEFT JOIN subscription ON subscription.subscriptionid=serial.subscriptionid
|
||||
WHERE serialid = ?
|
||||
|;
|
||||
|
|
@ -287,7 +294,7 @@ sub GetSerialInformation {
|
|||
return $data;
|
||||
}
|
||||
|
||||
=head2 GetSerialInformation
|
||||
=head2 AddItem2Serial
|
||||
|
||||
=over 4
|
||||
|
||||
|
|
@ -357,7 +364,14 @@ sub GetSubscription {
|
|||
aqbudget.bookfundid,
|
||||
aqbooksellers.name AS aqbooksellername,
|
||||
biblio.title AS bibliotitle,
|
||||
subscription.biblionumber as bibnum
|
||||
subscription.biblionumber as bibnum);
|
||||
if (C4::Context->preference('IndependantBranches') &&
|
||||
C4::Context->userenv &&
|
||||
C4::Context->userenv->{'flags'} != 1 && C4::Context->userenv->{'branch'}){
|
||||
$query.="
|
||||
, ((subscription.branchcode <>\"".C4::Context->userenv->{'branch'}."\") and subscription.branchcode <>\"\" and subscription.branchcode IS NOT NULL) as cannotedit ";
|
||||
}
|
||||
$query .= qq(
|
||||
FROM subscription
|
||||
LEFT JOIN subscriptionhistory ON subscription.subscriptionid=subscriptionhistory.subscriptionid
|
||||
LEFT JOIN aqbudget ON subscription.aqbudgetid=aqbudget.aqbudgetid
|
||||
|
|
@ -371,7 +385,7 @@ sub GetSubscription {
|
|||
# # warn "flags: ".C4::Context->userenv->{'flags'};
|
||||
# $query.=" AND subscription.branchcode IN ('".C4::Context->userenv->{'branch'}."',\"\")";
|
||||
# }
|
||||
# warn "query : $query";
|
||||
# warn "query : $query";
|
||||
my $sth = $dbh->prepare($query);
|
||||
# warn "subsid :$subscriptionid";
|
||||
$sth->execute($subscriptionid);
|
||||
|
|
@ -404,25 +418,26 @@ sub GetFullSubscription {
|
|||
aqbudget.bookfundid,aqbooksellers.name as aqbooksellername,
|
||||
biblio.title as bibliotitle,
|
||||
subscription.branchcode AS branchcode,
|
||||
subscription.subscriptionid AS subscriptionid
|
||||
subscription.subscriptionid AS subscriptionid |;
|
||||
if (C4::Context->preference('IndependantBranches') &&
|
||||
C4::Context->userenv &&
|
||||
C4::Context->userenv->{'flags'} != 1 && C4::Context->userenv->{'branch'}){
|
||||
$query.="
|
||||
, ((subscription.branchcode <>\"".C4::Context->userenv->{'branch'}."\") and subscription.branchcode <>\"\" and subscription.branchcode IS NOT NULL) as cannotedit ";
|
||||
}
|
||||
$query.=qq|
|
||||
FROM serial
|
||||
LEFT JOIN subscription ON
|
||||
(serial.subscriptionid=subscription.subscriptionid AND subscription.biblionumber=serial.biblionumber)
|
||||
(serial.subscriptionid=subscription.subscriptionid )
|
||||
LEFT JOIN aqbudget ON subscription.aqbudgetid=aqbudget.aqbudgetid
|
||||
LEFT JOIN aqbooksellers on subscription.aqbooksellerid=aqbooksellers.id
|
||||
LEFT JOIN biblio on biblio.biblionumber=subscription.biblionumber
|
||||
WHERE serial.subscriptionid = ? |;
|
||||
if (C4::Context->preference('IndependantBranches') &&
|
||||
C4::Context->userenv &&
|
||||
C4::Context->userenv->{'flags'} != 1){
|
||||
$query.="
|
||||
AND subscription.branchcode IN ('".C4::Context->userenv->{'branch'}."',\"''\")";
|
||||
}
|
||||
$query .=qq|
|
||||
WHERE serial.subscriptionid = ?
|
||||
ORDER BY year DESC,
|
||||
IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate) DESC,
|
||||
serial.subscriptionid
|
||||
|;
|
||||
# warn $query;
|
||||
my $sth = $dbh->prepare($query);
|
||||
$sth->execute($subscriptionid);
|
||||
my $subs = $sth->fetchall_arrayref({});
|
||||
|
|
@ -480,8 +495,8 @@ sub PrepareSerialsData{
|
|||
'bibliotitle' => $subs->{'bibliotitle'},
|
||||
'serials' => [$subs],
|
||||
'first' => $first,
|
||||
'branchcode' => $subs->{'branchcode'},
|
||||
'subscriptionid' => $subs->{'subscriptionid'},
|
||||
# 'branchcode' => $subs->{'branchcode'},
|
||||
# 'subscriptionid' => $subs->{'subscriptionid'},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -523,11 +538,11 @@ sub GetSubscriptionsFromBiblionumber {
|
|||
LEFT JOIN branches ON branches.branchcode=subscription.branchcode
|
||||
WHERE subscription.biblionumber = ?
|
||||
);
|
||||
if (C4::Context->preference('IndependantBranches') &&
|
||||
C4::Context->userenv &&
|
||||
C4::Context->userenv->{'flags'} != 1){
|
||||
$query.=" AND subscription.branchcode IN ('".C4::Context->userenv->{'branch'}."',\"\")";
|
||||
}
|
||||
# if (C4::Context->preference('IndependantBranches') &&
|
||||
# C4::Context->userenv &&
|
||||
# C4::Context->userenv->{'flags'} != 1){
|
||||
# $query.=" AND subscription.branchcode IN ('".C4::Context->userenv->{'branch'}."',\"\")";
|
||||
# }
|
||||
my $sth = $dbh->prepare($query);
|
||||
$sth->execute($biblionumber);
|
||||
my @res;
|
||||
|
|
@ -540,6 +555,11 @@ sub GetSubscriptionsFromBiblionumber {
|
|||
$subs->{ "periodicity" . $subs->{periodicity} } = 1;
|
||||
$subs->{ "numberpattern" . $subs->{numberpattern} } = 1;
|
||||
$subs->{ "status" . $subs->{'status'} } = 1;
|
||||
$subs->{'cannotedit'}=(C4::Context->preference('IndependantBranches') &&
|
||||
C4::Context->userenv &&
|
||||
C4::Context->userenv->{flags} !=1 &&
|
||||
C4::Context->userenv->{branch} && $subs->{branchcode} &&
|
||||
(C4::Context->userenv->{branch} ne $subs->{branchcode}));
|
||||
if ( $subs->{enddate} eq '0000-00-00' ) {
|
||||
$subs->{enddate} = '';
|
||||
}
|
||||
|
|
@ -578,21 +598,22 @@ sub GetFullSubscriptionsFromBiblionumber {
|
|||
aqbudget.bookfundid,aqbooksellers.name as aqbooksellername,
|
||||
biblio.title as bibliotitle,
|
||||
subscription.branchcode AS branchcode,
|
||||
subscription.subscriptionid AS subscriptionid
|
||||
subscription.subscriptionid AS subscriptionid|;
|
||||
if (C4::Context->preference('IndependantBranches') &&
|
||||
C4::Context->userenv &&
|
||||
C4::Context->userenv->{'flags'} != 1 && C4::Context->userenv->{'branch'}){
|
||||
$query.="
|
||||
, ((subscription.branchcode <>\"".C4::Context->userenv->{'branch'}."\") and subscription.branchcode <>\"\" and subscription.branchcode IS NOT NULL) as cannotedit ";
|
||||
}
|
||||
|
||||
$query.=qq|
|
||||
FROM serial
|
||||
LEFT JOIN subscription ON
|
||||
(serial.subscriptionid=subscription.subscriptionid AND subscription.biblionumber=serial.biblionumber)
|
||||
(serial.subscriptionid=subscription.subscriptionid)
|
||||
LEFT JOIN aqbudget ON subscription.aqbudgetid=aqbudget.aqbudgetid
|
||||
LEFT JOIN aqbooksellers on subscription.aqbooksellerid=aqbooksellers.id
|
||||
LEFT JOIN biblio on biblio.biblionumber=subscription.biblionumber
|
||||
WHERE subscription.biblionumber = ? |;
|
||||
if (C4::Context->preference('IndependantBranches') &&
|
||||
C4::Context->userenv &&
|
||||
C4::Context->userenv->{'flags'} != 1){
|
||||
$query.="
|
||||
AND subscription.branchcode IN ('".C4::Context->userenv->{'branch'}."',\"''\")";
|
||||
}
|
||||
$query .=qq|
|
||||
WHERE subscription.biblionumber = ?
|
||||
ORDER BY year DESC,
|
||||
IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate) DESC,
|
||||
serial.subscriptionid
|
||||
|
|
@ -629,11 +650,6 @@ sub GetSubscriptions {
|
|||
LEFT JOIN biblioitems ON biblio.biblionumber = biblioitems.biblionumber
|
||||
WHERE biblio.biblionumber=?
|
||||
);
|
||||
if (C4::Context->preference('IndependantBranches') &&
|
||||
C4::Context->userenv &&
|
||||
C4::Context->userenv->{'flags'} != 1){
|
||||
$query.=" AND subscription.branchcode IN ('".C4::Context->userenv->{'branch'}."',\"''\")";
|
||||
}
|
||||
$query.=" ORDER BY title";
|
||||
# warn "query :$query";
|
||||
$sth = $dbh->prepare($query);
|
||||
|
|
@ -642,17 +658,11 @@ sub GetSubscriptions {
|
|||
else {
|
||||
if ( $ISSN and $title ) {
|
||||
my $query = qq|
|
||||
SELECT subscription.*,biblio.title,biblioitems.issn,biblio.biblionumber
|
||||
FROM subscription
|
||||
LEFT JOIN biblio ON biblio.biblionumber = subscription.biblionumber
|
||||
LEFT JOIN biblioitems ON biblio.biblionumber = biblioitems.biblionumber
|
||||
WHERE (biblioitems.issn = ? or|. join('and ',map{"biblio.title LIKE \"%$_%\""}split (" ",$title))." )";
|
||||
|
||||
if (C4::Context->preference('IndependantBranches') &&
|
||||
C4::Context->userenv &&
|
||||
C4::Context->userenv->{'flags'} != 1){
|
||||
$query.=" AND subscription.branchcode IN ('".C4::Context->userenv->{'branch'}."',\"''\")";
|
||||
}
|
||||
SELECT subscription.*,biblio.title,biblioitems.issn,biblio.biblionumber
|
||||
FROM subscription
|
||||
LEFT JOIN biblio ON biblio.biblionumber = subscription.biblionumber
|
||||
LEFT JOIN biblioitems ON biblio.biblionumber = biblioitems.biblionumber
|
||||
WHERE (biblioitems.issn = ? or|. join('and ',map{"biblio.title LIKE \"%$_%\""}split (" ",$title))." )";
|
||||
$query.=" ORDER BY title";
|
||||
$sth = $dbh->prepare($query);
|
||||
$sth->execute( $ISSN );
|
||||
|
|
@ -660,17 +670,12 @@ sub GetSubscriptions {
|
|||
else {
|
||||
if ($ISSN) {
|
||||
my $query = qq(
|
||||
SELECT subscription.*,biblio.title,biblioitems.issn,,biblio.biblionumber
|
||||
FROM subscription
|
||||
LEFT JOIN biblio ON biblio.biblionumber = subscription.biblionumber
|
||||
LEFT JOIN biblioitems ON biblio.biblionumber = biblioitems.biblionumber
|
||||
WHERE biblioitems.issn LIKE ?
|
||||
SELECT subscription.*,biblio.title,biblioitems.issn,biblio.biblionumber
|
||||
FROM subscription
|
||||
LEFT JOIN biblio ON biblio.biblionumber = subscription.biblionumber
|
||||
LEFT JOIN biblioitems ON biblio.biblionumber = biblioitems.biblionumber
|
||||
WHERE biblioitems.issn LIKE ?
|
||||
);
|
||||
if (C4::Context->preference('IndependantBranches') &&
|
||||
C4::Context->userenv &&
|
||||
C4::Context->userenv->{'flags'} != 1){
|
||||
$query.=" AND subscription.branchcode IN ('".C4::Context->userenv->{'branch'}."',\"''\")";
|
||||
}
|
||||
$query.=" ORDER BY title";
|
||||
# warn "query :$query";
|
||||
$sth = $dbh->prepare($query);
|
||||
|
|
@ -679,19 +684,14 @@ sub GetSubscriptions {
|
|||
else {
|
||||
my $query = qq(
|
||||
SELECT subscription.*,biblio.title,biblioitems.issn,biblio.biblionumber
|
||||
FROM subscription
|
||||
LEFT JOIN biblio ON biblio.biblionumber = subscription.biblionumber
|
||||
LEFT JOIN biblioitems ON biblio.biblionumber = biblioitems.biblionumber
|
||||
WHERE 1
|
||||
).($title?" and ":""). join('and ',map{"biblio.title LIKE \"%$_%\""} split (" ",$title) );
|
||||
FROM subscription
|
||||
LEFT JOIN biblio ON biblio.biblionumber = subscription.biblionumber
|
||||
LEFT JOIN biblioitems ON biblio.biblionumber = biblioitems.biblionumber
|
||||
WHERE 1
|
||||
).($title?" and ":""). join('and ',map{"biblio.title LIKE \"%$_%\""} split (" ",$title) );
|
||||
|
||||
warn $query;
|
||||
if (C4::Context->preference('IndependantBranches') &&
|
||||
C4::Context->userenv &&
|
||||
C4::Context->userenv->{'flags'} != 1){
|
||||
$query.=" AND subscription.branchcode IN ('".C4::Context->userenv->{'branch'}."',\"''\")";
|
||||
}
|
||||
$query.=" ORDER BY title";
|
||||
# warn $query;
|
||||
$sth = $dbh->prepare($query);
|
||||
$sth->execute;
|
||||
}
|
||||
|
|
@ -711,6 +711,11 @@ sub GetSubscriptions {
|
|||
$odd = -$odd;
|
||||
$line->{toggle} = 1 if $odd == 1;
|
||||
}
|
||||
$line->{'cannotedit'}=(C4::Context->preference('IndependantBranches') &&
|
||||
C4::Context->userenv &&
|
||||
C4::Context->userenv->{flags} !=1 &&
|
||||
C4::Context->userenv->{branch} && $line->{branchcode} &&
|
||||
(C4::Context->userenv->{branch} ne $line->{branchcode}));
|
||||
push @results, $line;
|
||||
}
|
||||
return @results;
|
||||
|
|
@ -1891,7 +1896,7 @@ sub GetLateOrMissingIssues {
|
|||
claimdate
|
||||
FROM serial
|
||||
LEFT JOIN subscription ON serial.subscriptionid=subscription.subscriptionid
|
||||
LEFT JOIN biblio ON serial.biblionumber=biblio.biblionumber
|
||||
LEFT JOIN biblio ON subscription.biblionumber=biblio.biblionumber
|
||||
LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id
|
||||
WHERE subscription.subscriptionid = serial.subscriptionid
|
||||
AND (serial.STATUS = 4 OR ((planneddate < now() AND serial.STATUS =1) OR serial.STATUS = 3))
|
||||
|
|
@ -1916,13 +1921,12 @@ FROM serial
|
|||
LEFT JOIN subscription
|
||||
ON serial.subscriptionid=subscription.subscriptionid
|
||||
LEFT JOIN biblio
|
||||
ON serial.biblionumber=biblio.biblionumber
|
||||
ON subscription.biblionumber=biblio.biblionumber
|
||||
LEFT JOIN aqbooksellers
|
||||
ON subscription.aqbooksellerid = aqbooksellers.id
|
||||
WHERE
|
||||
subscription.subscriptionid = serial.subscriptionid
|
||||
AND (serial.STATUS = 4 OR ((planneddate < now() AND serial.STATUS =1) OR serial.STATUS = 3))
|
||||
AND biblio.biblionumber = subscription.biblionumber
|
||||
$byserial
|
||||
ORDER BY $order"
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
|
||||
<title>Koha › Serials › Serial Collection information for <!-- TMPL_VAR name="bibliotitle" --></title>
|
||||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
|
||||
<!-- TMPL_INCLUDE NAME="yui-toolbars.inc" -->
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
showlayer('<!-- TMPL_VAR NAME="yearmax"-->');
|
||||
|
|
@ -178,7 +179,7 @@ $(document).ready(function() {
|
|||
|
||||
|
||||
<!-- TMPL_IF NAME="years" --><form name="edition" action="serials-edit.pl">
|
||||
<div id="subscription-years">
|
||||
<div id="subscription_years" class="toptabs numbered">
|
||||
<ul>
|
||||
<!-- TMPL_LOOP NAME="years" -->
|
||||
<!-- TMPL_IF NAME="year" -->
|
||||
|
|
@ -234,23 +235,27 @@ $(document).ready(function() {
|
|||
<!-- TMPL_VAR Name="branchcode" -->
|
||||
</td>
|
||||
<td>
|
||||
<input type="hidden" name="subs" value="<!--TMPL_VAR Name="subscriptionid"-->" />
|
||||
<!--TMPL_IF Name="subscriptionexpired"-->
|
||||
<input type="checkbox" name="serialid" value="<!--TMPL_VAR Name="serialid"-->" disabled="disabled" />
|
||||
<!--TMPL_ELSE-->
|
||||
<!--TMPL_IF Name="status1"-->
|
||||
<!--TMPL_IF Name="cannotedit"-->
|
||||
disabled
|
||||
<!--TMPL_ELSE -->
|
||||
<input type="hidden" name="subs" value="<!--TMPL_VAR Name="subscriptionid"-->" />
|
||||
<!--TMPL_IF Name="subscriptionexpired"-->
|
||||
<input type="checkbox" name="serialid" value="<!--TMPL_VAR Name="serialid"-->" disabled="disabled" />
|
||||
<!--TMPL_ELSE-->
|
||||
<!--TMPL_IF Name="status1"-->
|
||||
<input type="checkbox" name="serialid" checked="checked" value="<!--TMPL_VAR Name="serialid"-->" />
|
||||
<!--TMPL_ELSE -->
|
||||
<!--TMPL_IF Name="status3"-->
|
||||
<input type="checkbox" name="serialid" checked="checked" value="<!--TMPL_VAR Name="serialid"-->" />
|
||||
<!--TMPL_ELSE -->
|
||||
<!--TMPL_IF Name="status4"-->
|
||||
<input type="checkbox" name="serialid" checked="checked" value="<!--TMPL_VAR Name="serialid"-->" />
|
||||
<!--TMPL_ELSE -->
|
||||
<input type="checkbox" name="serialid" value="<!--TMPL_VAR Name="serialid"-->" />
|
||||
<!--TMPL_IF Name="status3"-->
|
||||
<input type="checkbox" name="serialid" checked="checked" value="<!--TMPL_VAR Name="serialid"-->" />
|
||||
<!--TMPL_ELSE -->
|
||||
<!--TMPL_IF Name="status4"-->
|
||||
<input type="checkbox" name="serialid" checked="checked" value="<!--TMPL_VAR Name="serialid"-->" />
|
||||
<!--TMPL_ELSE -->
|
||||
<input type="checkbox" name="serialid" value="<!--TMPL_VAR Name="serialid"-->" />
|
||||
<!--/TMPL_IF-->
|
||||
<!--/TMPL_IF-->
|
||||
<!--/TMPL_IF-->
|
||||
<!--/TMPL_IF-->
|
||||
<!--/TMPL_IF-->
|
||||
<!--/TMPL_IF -->
|
||||
<!--/TMPL_IF -->
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ Serials updated :
|
|||
<!-- TMPL_ELSE -->
|
||||
<td>
|
||||
<!-- /TMPL_IF -->
|
||||
<a href="/cgi-bin/koha/serials/serial-issues.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->">Issue History</a>
|
||||
<a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->">Issue History</a>
|
||||
</td>
|
||||
<!-- TMPL_IF NAME="routing" -->
|
||||
<!-- TMPL_IF name="toggle" -->
|
||||
|
|
@ -129,7 +129,11 @@ Serials updated :
|
|||
<!-- TMPL_ELSE -->
|
||||
<td>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF NAME="cannotedit" -->
|
||||
|
||||
<!-- TMPL_ELSE -->
|
||||
<a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=<!-- TMPL_VAR name="subscriptionid" --><!-- TMPL_UNLESS NAME="routingedit" -->&op=new<!-- /TMPL_UNLESS -->">Routing List</a>
|
||||
<!-- /TMPL_IF -->
|
||||
</td>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="toggle" -->
|
||||
|
|
@ -137,7 +141,11 @@ Serials updated :
|
|||
<!-- TMPL_ELSE -->
|
||||
<td>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF NAME="cannotedit" -->
|
||||
|
||||
<!-- TMPL_ELSE -->
|
||||
<a href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->&serstatus=1,3">Serial receive</a>
|
||||
<!-- /TMPL_IF -->
|
||||
</td>
|
||||
</tr>
|
||||
<!-- /TMPL_LOOP -->
|
||||
|
|
|
|||
|
|
@ -831,9 +831,9 @@ window.onload = irregular_order();
|
|||
<li>
|
||||
<label for="biblionumber">Biblio: (*)</label>
|
||||
|
||||
<input type="text" name="biblionumber" id="biblionumber" value="<!-- TMPL_VAR name="biblionumber" -->" size="8" />
|
||||
<input type="text" name="biblionumber" id="biblionumber" value="<!-- TMPL_VAR name="bibnum" -->" size="8" />
|
||||
(<input type="text" name="title" value="<!-- TMPL_VAR name="bibliotitle" -->" disabled="disabled" readonly="readonly" />)
|
||||
<div class="inputnote"> <a href="#" onclick="Plugin(f)">Search for Biblio</a> | <!--TMPL_IF Name="mod"--><a href="#" onclick="addbiblioPopup(<!-- TMPL_VAR NAME="biblionumber" -->); return false;">Edit biblio</a><!-- TMPL_ELSE -->
|
||||
<div class="inputnote"> <a href="#" onclick="Plugin(f)">Search for Biblio</a> | <!--TMPL_IF Name="mod"--><a href="#" onclick="addbiblioPopup(<!-- TMPL_VAR NAME="bibnum" -->); return false;">Edit biblio</a><!-- TMPL_ELSE -->
|
||||
<a href="#" onclick="addbiblioPopup(); return false;">Create Biblio</a><!--/TMPL_IF--></div>
|
||||
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ unless (@serialids){
|
|||
unless (scalar(@serialids)){
|
||||
my $string="serials-collection.pl?subscriptionid=".join(",",@subscriptionids);
|
||||
$string=~s/,$//;
|
||||
warn $string;
|
||||
# warn $string;
|
||||
print $query->redirect($string);
|
||||
}
|
||||
my ($template, $loggedinuser, $cookie)
|
||||
|
|
@ -122,7 +122,7 @@ foreach my $tmpserialid (@serialids){
|
|||
my $data=GetSerialInformation($tmpserialid);
|
||||
$data->{publisheddate}=format_date($data->{publisheddate});
|
||||
$data->{planneddate}=format_date($data->{planneddate});
|
||||
$data->{'editdisable'}=(HasSubscriptionExpired($data->{subscriptionid})&& $data->{'status1'});
|
||||
$data->{'editdisable'}=((HasSubscriptionExpired($data->{subscriptionid})&& $data->{'status1'})||$data->{'cannotedit'});
|
||||
push @serialdatalist,$data;
|
||||
}
|
||||
my $bibdata=GetBiblioData($serialdatalist[0]->{'biblionumber'});
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
use strict;
|
||||
use CGI;
|
||||
use Date::Calc qw(Today Day_of_Year Week_Of_Year);
|
||||
use Date::Calc qw(Today Day_of_Year Week_of_Year Add_Delta_Days);
|
||||
use C4::Koha;
|
||||
use C4::Auth;
|
||||
use C4::Date;
|
||||
|
|
@ -54,7 +54,7 @@ my $weekarrayjs='';
|
|||
my $count = 0;
|
||||
my ($year, $month, $day) = Today;
|
||||
my $firstday = Day_of_Year($year,$month,$day);
|
||||
my ($wkno,$yr) = Week_Of_Year($year,$month,$day); # week starting monday
|
||||
my ($wkno,$yr) = Week_of_Year($year,$month,$day); # week starting monday
|
||||
my $weekno = $wkno;
|
||||
for(my $i=$firstday;$i<($firstday+365);$i=$i+7){
|
||||
$count = $i;
|
||||
|
|
@ -105,9 +105,15 @@ $template->param(branchloop => \@branchloop,
|
|||
);
|
||||
|
||||
if ($op eq 'mod'||$op eq 'dup') {
|
||||
|
||||
my $subscriptionid = $query->param('subscriptionid');
|
||||
# warn "irregularity :$irregularity numberpattern : $numberpattern, callnumber :$callnumber, firstacquidate :$firstacquidate";
|
||||
my $subs = &GetSubscription($subscriptionid);
|
||||
## FIXME : Check rights to edit if mod. Could/Should display an error message.
|
||||
if ($subs->{'cannotedit'} && $op eq 'mod'){
|
||||
warn "Attempt to modify subscription $subscriptionid by ".C4::Context->userenv->{'id'}." not allowed";
|
||||
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid");
|
||||
}
|
||||
$subs->{'startdate'}=format_date($subs->{'startdate'});
|
||||
$subs->{'firstacquidate'}=format_date($subs->{'firstacquidate'});
|
||||
$subs->{'histstartdate'}=format_date($subs->{'histstartdate'});
|
||||
|
|
|
|||
|
|
@ -41,14 +41,17 @@ my ($subscriptionid,$auser,$librarian,$cost,$aqbooksellerid, $aqbooksellername,$
|
|||
|
||||
$subscriptionid = $query->param('subscriptionid');
|
||||
|
||||
|
||||
my $subs = &GetSubscription($subscriptionid);
|
||||
if ($op eq 'del') {
|
||||
if ($subs->{'cannotedit'}){
|
||||
warn "Attempt to delete subscription $subscriptionid by ".C4::Context->userenv->{'id'}." not allowed";
|
||||
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid");
|
||||
}
|
||||
&DelSubscription($subscriptionid);
|
||||
print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=serials-home.pl\"></html>";
|
||||
exit;
|
||||
|
||||
}
|
||||
my $subs = &GetSubscription($subscriptionid);
|
||||
my ($routing, @routinglist) = getroutinglist($subscriptionid);
|
||||
my ($totalissues,@serialslist) = GetSerials($subscriptionid);
|
||||
$totalissues-- if $totalissues; # the -1 is to have 0 if this is a new subscription (only 1 issue)
|
||||
|
|
@ -90,6 +93,12 @@ $subs->{firstacquidate}=format_date($subs->{firstacquidate});
|
|||
$subs->{histstartdate}=format_date($subs->{histstartdate});
|
||||
$subs->{enddate}=format_date($subs->{enddate});
|
||||
$subs->{abouttoexpire}=abouttoexpire($subs->{subscriptionid});
|
||||
# Done in Serials.pm
|
||||
# $subs->{'donotedit'}=(C4::Context->preference('IndependantBranches') &&
|
||||
# C4::Context->userenv &&
|
||||
# C4::Context->userenv->{flags} !=1 &&
|
||||
# C4::Context->userenv->{branch} && $subs->{branchcode} &&
|
||||
# (C4::Context->userenv->{branch} ne $subs->{branchcode}));
|
||||
|
||||
$template->param($subs);
|
||||
|
||||
|
|
|
|||
|
|
@ -84,6 +84,10 @@ if ( $op eq "renew" ) {
|
|||
}
|
||||
|
||||
my $subscription = GetSubscription($subscriptionid);
|
||||
if ($subscription->{'cannotedit'}){
|
||||
warn "Attempt to renew subscription $subscriptionid by ".C4::Context->userenv->{'id'}." not allowed";
|
||||
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid");
|
||||
}
|
||||
|
||||
$template->param(
|
||||
startdate => format_date(
|
||||
|
|
|
|||
Loading…
Reference in New Issue