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

(-)a/acqui/acqui-home.pl (+9 lines)
Lines 66-71 my $totspent_active = 0; Link Here
66
my $totordered_active   = 0;
66
my $totordered_active   = 0;
67
my $totavail_active     = 0;
67
my $totavail_active     = 0;
68
68
69
my $budgets = GetBudgetPeriod(1);
70
if ($budgets > 0){
71
    my $stepfund = 2;
72
    $template->param( stepfund => $stepfund );
73
} else  {
74
    my $stepfund = 1;
75
    $template->param( stepfund => $stepfund );
76
}
77
69
my @budget_loop;
78
my @budget_loop;
70
foreach my $budget ( @{$budget_arr} ) {
79
foreach my $budget ( @{$budget_arr} ) {
71
    next unless (CanUserUseBudget($loggedinuser, $budget, $userflags));
80
    next unless (CanUserUseBudget($loggedinuser, $budget, $userflags));
(-)a/admin/aqbudgetperiods.pl (-2 / +6 lines)
Lines 113-126 if ( $op eq 'add_form' ) { Link Here
113
elsif ( $op eq 'add_validate' ) {
113
elsif ( $op eq 'add_validate' ) {
114
## add or modify a budget period (confirmation)
114
## add or modify a budget period (confirmation)
115
115
116
    ## update budget period data
116
## update budget period data
117
	if ( $budget_period_id ne '' ) {
117
	if ( $budget_period_id ne '' ) {
118
		$$budget_period_hashref{$_}||=0 for qw(budget_period_active budget_period_locked);
118
		$$budget_period_hashref{$_}||=0 for qw(budget_period_active budget_period_locked);
119
		my $status=ModBudgetPeriod($budget_period_hashref);
119
		my $status=ModBudgetPeriod($budget_period_hashref);
120
	} 
120
	} 
121
	else {    # ELSE ITS AN ADD
121
	else {    # ELSE ITS AN ADD
122
		my $budget_period_id=AddBudgetPeriod($budget_period_hashref);
122
		my $budget_period_id=AddBudgetPeriod($budget_period_hashref);
123
	}
123
    my $stepfund = $input->param( 'step' );
124
    $template->param( stepfund => $stepfund );
125
    print $input->redirect("/cgi-bin/koha/acqui/acqui-home.pl");
126
    exit;
127
}
124
	$op='else';
128
	$op='else';
125
}
129
}
126
130
(-)a/admin/aqbudgets.pl (+5 lines)
Lines 180-185 if ($op eq 'add_form') { Link Here
180
                                                    # END $OP eq ADD_FORM
180
                                                    # END $OP eq ADD_FORM
181
#---------------------- DEFAULT DISPLAY BELOW ---------------------
181
#---------------------- DEFAULT DISPLAY BELOW ---------------------
182
182
183
183
# called by default form, used to confirm deletion of data in DB
184
# called by default form, used to confirm deletion of data in DB
184
} elsif ($op eq 'delete_confirm') {
185
} elsif ($op eq 'delete_confirm') {
185
186
Lines 221-226 if ($op eq 'add_form') { Link Here
221
        $budget_hash->{budget_id} = AddBudget( $budget_hash );
222
        $budget_hash->{budget_id} = AddBudget( $budget_hash );
222
        ModBudgetUsers($budget_hash->{budget_id}, @budgetusersid);
223
        ModBudgetUsers($budget_hash->{budget_id}, @budgetusersid);
223
        $budget_modified = 1;
224
        $budget_modified = 1;
225
226
        print $input->redirect("/cgi-bin/koha/acqui/acqui-home.pl");
227
        exit;
228
224
    }
229
    }
225
230
226
    my $set_owner_to_children = $input->param('set_owner_to_children');
231
    my $set_owner_to_children = $input->param('set_owner_to_children');
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude.inc (-52 / +45 lines)
Lines 1-7 Link Here
1
[% USE Koha %]
2
[% USE KohaDates %]
3
[% USE Branches %]
4
5
<style type="text/css">
1
<style type="text/css">
6
 #onboardingModal{
2
 #onboardingModal{
7
     z-index:1;
3
     z-index:1;
Lines 14-74 Link Here
14
     top:auto;
10
     top:auto;
15
     right:auto;
11
     right:auto;
16
     bottom:auto;
12
     bottom:auto;
17
            border-radius:25px;
13
     border-radius:25px;
18
}
14
}
19
</style>
15
</style>
16
    <div id="onboardingModal">
17
        <span class="close">&times;</span><br><br>
18
    [% IF  displayonboardscreen == "acquisitions" %]
19
        <h2> Create a budget</h2>
20
        <form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post">
21
            <fieldset class="rows">
22
                <input type="hidden" name="op" value="add_validate" />
23
                <input type="hidden" name="step" value="2"/>
24
                <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
25
                <ol>
26
                    <li>
27
                        <label class="required" for="from">Start date: </label>
28
                        <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" />
29
                        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
30
                    </li>
20
31
21
[% step = 1 %]
32
                    <li>
22
33
                        <label class="required" for="to">End date: </label>
23
<div id="onboardingModal">
34
                        <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" />
24
     <span class="close">&times;</span><br><br>
35
                        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
25
[% IF  displayonboardscreen == "acquisitions" %]
36
                    </li>
26
     <h2> Create a budget</h2>
27
     <form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post">
28
        <fieldset class="rows">
29
            <input type="hidden" name="op" value="add_validate" />
30
            <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
31
            <ol>
32
                <li>
33
                    <label class="required" for="from">Start date: </label>
34
                    <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" />
35
                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
36
                </li>
37
38
                <li>
39
                    <label class="required" for="to">End date: </label>
40
                    <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" />
41
                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
42
                </li>
43
37
44
                <li>
38
                    <li>
45
                    <label class="required" for="budget_period_description">Description: </label>
39
                        <label class="required" for="budget_period_description">Description: </label>
46
                    <input type="text" id="budget_period_description" name="budget_period_description"
40
                        <input type="text" id="budget_period_description" name="budget_period_description" size="48" maxlength="80" value="[% budget_period_description %]" />
47
                    size="48" maxlength="80" value="[% budget_period_description %]" />
41
                    </li>
48
                </li>
49
42
50
                <li>
43
                    <li>
51
                    <label for="budget_period_total">Total amount: </label>
44
                        <label for="budget_period_total">Total amount: </label>
52
                    <input type="text" id="budget_period_total" name="budget_period_total"
45
                        <input type="text" id="budget_period_total" name="budget_period_total" size="10" maxlength="80" value="[% budget_period_total | $Price on_editing => 1 %]" />
53
                    size="10" maxlength="80" value="[% budget_period_total | $Price on_editing => 1 %]" />
46
                    </li>
54
                </li>
55
47
56
                <li>
48
                    <li>
57
                    <label for="budget_period_active">Make budget active: </label>
49
                        <label for="budget_period_active">Make budget active: </label>
58
                    [% IF ( budget_period_active ) %]<input type="checkbox" checked="checked" id="budget_period_active" name="budget_period_a    ctive" value="1" />[% ELSE %]  <input type="checkbox" id="budget_period_active" name="budget_period_active" value="1"/> [% END %]
50
                        [% IF ( budget_period_active ) %]<input type="checkbox" checked="checked" id="budget_period_active" name="budget_period_active" value="1" />[% ELSE %]  <input type="checkbox" id="budget_period_active" name="budget_period_active" value="1"/> [% END %]
59
                </li>
51
                    </li>
60
            </ol>
52
                </ol>
61
        </fielset>
53
            </fieldset>
54
            <fieldset class="action">
55
                <a href = "/cgi-bin/koha/acqui/acqui-home.pl">
56
                <input type="submit" class="action" value="Submit" />
57
                </a>
58
            </fieldset>
59
        </form>
60
    </div>
61
    [% ELSIF displayonboardscreen == "label" %]
62
<h2>testing</h2>
62
63
63
        <fieldset class="action">
64
            <input type="button" value="Save" onclick="Check(this.form)" />
65
            <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl" class="cancel">Cancel</a>
66
        </fielset>
67
    </form>
68
</div>
69
[% ELSIF displayonboardscreen == "label" %]
70
64
71
65
72
66
73
<h2>testing</h2>
67
    [% END %]
74
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude2.inc (+62 lines)
Line 0 Link Here
1
<style type="text/css">
2
  #onboardingModal{
3
      z-index:1;
4
      background-color:#5bad3f;
5
      padding:20px;
6
      width:80%;
7
      height:60%;
8
      position:fixed;
9
      left:auto;
10
      top:auto;
11
      right:auto;
12
      bottom:auto;
13
      border-radius:25px;
14
   }
15
</style>
16
17
<div id="onboardingModal">
18
    <form action="/cgi-bin/koha/admin/aqbudgets.pl" id="edit_fund" name="Aform" method="post">
19
        <fieldset class="rows">
20
            <legend>[% IF ( budget_id ) %]Modify[% ELSE %]Add[% END %] Fund
21
                [% IF ( budget_period_description ) %]
22
                    [% budget_name %] for Budget '[% budget_period_description %]'
23
                [% END %]
24
            </legend>
25
            <input type="hidden" name="op" value="add_validate" />
26
            <input type="hidden" name="checked" value="0" />
27
            <ol>
28
                [% budget_parent_id = 0 %]
29
                <li>
30
                     <span class="label">Fund parent: </span>
31
                     [% budget_parent_name %]
32
                     [% budget_parent_id %] - [% budget_parent_name %]
33
                     <input type="hidden" name="budget_parent_id" value= NULL />
34
                </li>
35
                <li>
36
                    <label class="required"  for="budget_code">Fund code: </label>
37
                    <input type="text" name="budget_code" id="budget_code" value="[% budget_code %]" size="30" />
38
                </li>
39
40
                <li>
41
                    <label class="required" for="budget_name">Fund name: </label>
42
                    <input type="text" name="budget_name" id="budget_name" value="[% budget_name %]" size="60" />
43
                </li>
44
45
                <li>
46
                    <label style="white-space: nowrap;" for="budget_amount" class="required">Amount: </label>
47
                    <input type="text" name="budget_amount" id="budget_amount" value="[% budget_amount | $Price on_editing => 1 %]" size="8" />
48
                </li>
49
50
                <input type="hidden" name="budget_owner_id" id="budget_owner_id" value="0" />
51
52
                [% IF ( budget_id ) %]
53
                    <input type="hidden" name="budget_id" value="[% budget_id %]" />
54
                [% END %]
55
56
        </fieldset>
57
        <fieldset class="action">
58
            <input type="submit" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/admin/aqbudgets.pl">Cancel</a>
59
            <input type="hidden" name="budget_period_id" value="1" />
60
        </fieldset>
61
    </form>
62
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt (-2 / +13 lines)
Lines 1-5 Link Here
1
[% USE Price %]
1
[% USE Price %]
2
[% USE Branches %]
2
[% USE Branches %]
3
[% USE Koha %]
4
[% USE KohaDates %]
5
[% USE Branches %]
6
3
[% INCLUDE 'doc-head-open.inc' %]
7
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Koha &rsaquo; Acquisitions</title>
8
<title>Koha &rsaquo; Acquisitions</title>
5
[% INCLUDE 'doc-head-close.inc' %]
9
[% INCLUDE 'doc-head-close.inc' %]
Lines 9-14 Link Here
9
<link href="[% interface %]/lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css" rel="stylesheet" type="text/css" />
13
<link href="[% interface %]/lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css" rel="stylesheet" type="text/css" />
10
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/treetable/jquery.treetable.js"></script>
14
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/treetable/jquery.treetable.js"></script>
11
15
16
[% INCLUDE 'calendar.inc' %]
17
<script type="text/javascript" src="[% interface %]/[% theme %]/js/acq.js"></script>
18
12
<script type="text/javascript">
19
<script type="text/javascript">
13
//<![CDATA[
20
//<![CDATA[
14
21
Lines 111-118 $(document).ready(function() { Link Here
111
    [% INCLUDE 'budgets-active-currency.inc' hide = 'yes' %]
118
    [% INCLUDE 'budgets-active-currency.inc' hide = 'yes' %]
112
    [% UNLESS ( loop_budget ) %]
119
    [% UNLESS ( loop_budget ) %]
113
        [% IF ( CAN_user_acquisition_period_manage ) %]
120
        [% IF ( CAN_user_acquisition_period_manage ) %]
114
             [% displayonboardscreen = "acquisitions" %]
121
            [% displayonboardscreen = "acquisitions" %]
115
             [% INCLUDE onboardinginclude.inc %]
122
            [% IF stepfund == 1 %]
123
                [% INCLUDE onboardinginclude.inc %]
124
            [% ELSE %]
125
                [% INCLUDE onboardinginclude2.inc %]
126
            [% END %]
116
        [% ELSE %]
127
        [% ELSE %]
117
        <div class="dialog alert">Your administrator must define a budget in Administration</div>
128
        <div class="dialog alert">Your administrator must define a budget in Administration</div>
118
        [% END %]
129
        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt (-1 / +1 lines)
Lines 334-340 Link Here
334
    <li>
334
    <li>
335
    <label class="required" for="from">Start date: </label>
335
    <label class="required" for="from">Start date: </label>
336
    <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" />
336
    <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" />
337
				<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
337
				<!--<div class="hint">[% INCLUDE 'date-format.inc' %]</div>-->
338
    </li>
338
    </li>
339
    <li>
339
    <li>
340
340
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt (-2 / +1 lines)
Lines 453-459 var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") Link Here
453
453
454
<!-- ********************************************************************************************** -->
454
<!-- ********************************************************************************************** -->
455
<!-- create add/mod entry form -->
455
<!-- create add/mod entry form -->
456
[% IF op == 'add_form' && !error_not_authorised_to_modify %]
456
[% IF op == 'add_form' %]
457
<form action="/cgi-bin/koha/admin/aqbudgets.pl" id="edit_fund" name="Aform" method="post">
457
<form action="/cgi-bin/koha/admin/aqbudgets.pl" id="edit_fund" name="Aform" method="post">
458
    <fieldset class="rows">
458
    <fieldset class="rows">
459
    <legend>[% IF ( budget_id ) %]Modify[% ELSE %]Add[% END %] Fund
459
    <legend>[% IF ( budget_id ) %]Modify[% ELSE %]Add[% END %] Fund
460
- 

Return to bug 18002