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

(-)a/C4/Budgets.pm (+7 lines)
Lines 146-151 sub GetPeriodsCount { Link Here
146
}
146
}
147
147
148
# -------------------------------------------------------------------
148
# -------------------------------------------------------------------
149
150
sub GetHighestBudgetPeriod{
151
    my $dbh = C4::Context->dbh;
152
    warn my $data = $dbh->selectrow_array("SELECT MAX(budget_period_id) FROM aqbudgetperiods");
153
    return $data;
154
}
155
# -------------------------------------------------------------------
149
sub CheckBudgetParent {
156
sub CheckBudgetParent {
150
    my ( $new_parent, $budget ) = @_;
157
    my ( $new_parent, $budget ) = @_;
151
    my $new_parent_id = $new_parent->{'budget_id'};
158
    my $new_parent_id = $new_parent->{'budget_id'};
(-)a/C4/Creators/Layout.pm (+13 lines)
Lines 8-13 use autouse 'Data::Dumper' => qw(Dumper); Link Here
8
use C4::Context;
8
use C4::Context;
9
use C4::Debug;
9
use C4::Debug;
10
use C4::Creators::PDF;
10
use C4::Creators::PDF;
11
use C4::Creators;
11
12
12
13
13
# FIXME: Consider this style parameter verification instead...
14
# FIXME: Consider this style parameter verification instead...
Lines 111-116 sub retrieve { Link Here
111
    return $self;
112
    return $self;
112
}
113
}
113
114
115
sub retrieve_all {
116
    my $dbh = C4::Context->dbh;
117
    my $sth = $dbh->prepare("select count(*) from creator_layouts where creator = 'Labels' group by creator");
118
    my $layout = $sth->execute();
119
    if ($layout == '0E0'){
120
        return 0;
121
    } else {
122
        return $layout;
123
    }
124
}
125
114
sub delete {
126
sub delete {
115
    my $self = {};
127
    my $self = {};
116
    my %opts = ();
128
    my %opts = ();
Lines 234-239 sub get_text_wrap_cols { Link Here
234
    return $col_count;
246
    return $col_count;
235
}
247
}
236
248
249
237
1;
250
1;
238
__END__
251
__END__
239
252
(-)a/C4/Creators/Profile.pm (+11 lines)
Lines 90-95 sub retrieve { Link Here
90
    return $self;
90
    return $self;
91
}
91
}
92
92
93
sub retrieve_all {
94
    my $dbh = C4::Context->dbh;
95
    my $sth = $dbh->prepare("select count(*) from printers_profile where creator = 'Labels' group by creator");
96
    my $profile = $sth->execute();
97
    if ($profile == '0E0'){
98
         return 0;
99
    } else {
100
         return $profile;
101
    }
102
}
103
93
sub delete {
104
sub delete {
94
    my $self = {};
105
    my $self = {};
95
    my %opts = ();
106
    my %opts = ();
(-)a/C4/Creators/Template.pm (+11 lines)
Lines 131-136 sub retrieve { Link Here
131
    return $self;
131
    return $self;
132
}
132
}
133
133
134
sub retrieve_all {
135
    my $dbh = C4::Context->dbh;
136
    my $sth = $dbh->prepare("select count(*) FROM creator_templates ct where creator = 'Labels' group by creator");
137
    my $templatecount = $sth->execute();
138
    if ($templatecount == '0E0'){
139
        return 0;
140
    } else {
141
        return $templatecount;
142
    }
143
}
144
134
sub delete {
145
sub delete {
135
    my $self = {};
146
    my $self = {};
136
    my %opts = ();
147
    my %opts = ();
(-)a/acqui/acqui-home.pl (+24 lines)
Lines 122-132 $template->param( Link Here
122
    suggestions_count   => $suggestions_count,
122
    suggestions_count   => $suggestions_count,
123
);
123
);
124
124
125
126
127
128
129
130
my $aqstep;
125
my $cur = Koha::Acquisition::Currencies->get_active;
131
my $cur = Koha::Acquisition::Currencies->get_active;
132
126
if ( $cur ) {
133
if ( $cur ) {
127
    $template->param(
134
    $template->param(
128
        currency => $cur->currency,
135
        currency => $cur->currency,
129
    );
136
    );
130
}
137
}
131
138
139
my $budget = GetPeriodsCount();
140
my $budgetid = C4::Budgets->GetHighestBudgetPeriod();
141
if (!@budget_loop){
142
if (!$cur) {
143
    $aqstep = 1;
144
    $template->param( step => $aqstep );
145
} elsif ($budget && $budgetid == 1){
146
    $aqstep = 3;
147
    $template->param( step => $aqstep );
148
} elsif ($budgetid > 1) {
149
    print $query->redirect("/cgi-bin/koha/admin/aqbudgetperiods.pl");
150
    exit;
151
} else  {
152
    $aqstep = 2;
153
    $template->param( step => $aqstep );
154
}
155
}
132
output_html_with_http_headers $query, $cookie, $template->output;
156
output_html_with_http_headers $query, $cookie, $template->output;
(-)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 (-2 / +10 lines)
Lines 76-83 my $budget_permission = $input->param('budget_permission'); Link Here
76
my $budget_users_ids          = $input->param('budget_users_ids');
76
my $budget_users_ids          = $input->param('budget_users_ids');
77
my $filter_budgetbranch       = $input->param('filter_budgetbranch') // '';
77
my $filter_budgetbranch       = $input->param('filter_budgetbranch') // '';
78
my $filter_budgetname         = $input->param('filter_budgetname');
78
my $filter_budgetname         = $input->param('filter_budgetname');
79
80
81
# ' ------- get periods stuff ------------------'
79
# ' ------- get periods stuff ------------------'
82
# IF PERIODID IS DEFINED,  GET THE PERIOD - ELSE JUST GET THE ACTIVE PERIOD BY DEFAULT
80
# IF PERIODID IS DEFINED,  GET THE PERIOD - ELSE JUST GET THE ACTIVE PERIOD BY DEFAULT
83
my $period;
81
my $period;
Lines 180-185 if ($op eq 'add_form') { Link Here
180
                                                    # END $OP eq ADD_FORM
178
                                                    # END $OP eq ADD_FORM
181
#---------------------- DEFAULT DISPLAY BELOW ---------------------
179
#---------------------- DEFAULT DISPLAY BELOW ---------------------
182
180
181
183
# called by default form, used to confirm deletion of data in DB
182
# called by default form, used to confirm deletion of data in DB
184
} elsif ($op eq 'delete_confirm') {
183
} elsif ($op eq 'delete_confirm') {
185
184
Lines 221-226 if ($op eq 'add_form') { Link Here
221
        $budget_hash->{budget_id} = AddBudget( $budget_hash );
220
        $budget_hash->{budget_id} = AddBudget( $budget_hash );
222
        ModBudgetUsers($budget_hash->{budget_id}, @budgetusersid);
221
        ModBudgetUsers($budget_hash->{budget_id}, @budgetusersid);
223
        $budget_modified = 1;
222
        $budget_modified = 1;
223
224
        my $fundcreation = $input->param('fundcreation');
225
226
        if ($fundcreation eq "onboarding"){
227
            my $step  = $input->param('step');
228
            $template->param('step' => $step);
229
            print $input->redirect("/cgi-bin/koha/acqui/acqui-home.pl");
230
            exit;
231
        }
224
    }
232
    }
225
233
226
    my $set_owner_to_children = $input->param('set_owner_to_children');
234
    my $set_owner_to_children = $input->param('set_owner_to_children');
(-)a/admin/currency.pl (+9 lines)
Lines 89-94 if ( $op eq 'add_form' ) { Link Here
89
    }
89
    }
90
    $searchfield = q||;
90
    $searchfield = q||;
91
    $op          = 'list';
91
    $op          = 'list';
92
93
    my $aqcurrency = $input->param('aqcurrency');
94
    if ($aqcurrency == 1) {
95
        my $step = $input->param( 'step' );
96
        $template->param( step => $step );
97
        print $input->redirect("/cgi-bin/koha/acqui/acqui-home.pl");
98
        exit;
99
    }
100
92
} elsif ( $op eq 'delete_confirm' ) {
101
} elsif ( $op eq 'delete_confirm' ) {
93
    my $currency = Koha::Acquisition::Currencies->find($currency_code);
102
    my $currency = Koha::Acquisition::Currencies->find($currency_code);
94
103
(-)a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css (+5 lines)
Lines 3007-3009 fieldset.rows + fieldset.action { Link Here
3007
#patron_search #filters {
3007
#patron_search #filters {
3008
    display: none;
3008
    display: none;
3009
}
3009
}
3010
div#aqhelp{
3011
    background-color:#EDF4F6;
3012
    padding:20px;
3013
    width:50%;
3014
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/budgets-active-currency.inc (-2 / +14 lines)
Lines 1-14 Link Here
1
<style type="text/css">
2
  #onboardingModal{
3
     z-index:1;
4
     background-color:#E6F0F2;
5
     position:fixed;
6
     left:auto;
7
     top:auto;
8
     right:auto;
9
     bottom:auto;
10
}
11
</style>
12
1
[% IF ( currency ) %]
13
[% IF ( currency ) %]
2
    [% IF ( not hide ) %]
14
    [% IF ( not hide ) %]
3
        <p><b>Currency = [% currency %]</b></p>
15
        <p><b>Currency = [% currency %]</b></p>
4
    [% END %]
16
    [% END %]
5
[% ELSE %]
17
[% ELSE %]
6
    <div class="dialog alert">
18
   <div class="dialog alert">
7
        <h3>No active currency is defined</h3>
19
        <h3>No active currency is defined</h3>
8
        [% IF CAN_user_parameters_parameters_remaining_permissions %]
20
        [% IF CAN_user_parameters_parameters_remaining_permissions %]
9
            <p><a href="/cgi-bin/koha/admin/currency.pl">Please specify an active currency.</a></p>
21
            <p><a href="/cgi-bin/koha/admin/currency.pl">Please specify an active currency.</a></p>
10
        [% ELSE %]
22
        [% ELSE %]
11
            <p>Your administrator must specify an active currency.</p>
23
            <p>Your administrator must specify an active currency.</p>
12
        [% END %]
24
        [% END %]
13
    </div>
25
   </div>
14
[% END %]
26
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude1.inc (+200 lines)
Line 0 Link Here
1
<style type="text/css">
2
    #onboardingModal{
3
        background-color:#EDF4F6;
4
    }
5
</style>
6
7
[% BLOCK translate_justification_types %]
8
 [%  SWITCH type %]
9
 [%   CASE 'L' %]Left
10
 [%   CASE 'C' %]Center
11
 [%   CASE 'R' %]Right
12
 [%  END %]
13
[% END %]
14
15
[% BLOCK translate_label_types %]
16
 [%  SWITCH type %]
17
 [%   CASE 'BIB'    %]Biblio
18
 [%   CASE 'BARBIB' %]Barcode/Biblio
19
 [%   CASE 'BIBBAR' %]Biblio/Barcode
20
 [%   CASE 'ALT'    %]Alternating
21
 [%   CASE 'BAR'    %]Barcode
22
 [%  END %]
23
[% END %]
24
25
[% IF displayonboarding =="acqui" %]
26
<div id="onboardingModal">
27
        <h2> Acquisition onboarding wizard</h2>
28
        <h3> This onboarding wizard will take you through the process of setting up Acquistions </h3>
29
        <p>Start by completing this form to create a currency which you will be used to create your first budget and fund.<br>
30
        A fund is the accounting value you use to create orders</p>
31
         <form action="/cgi-bin/koha/admin/currency.pl" name="Aform" method="post" class="validated">
32
           <input type="hidden" name="op" value="add_validate" />
33
           <input type="hidden" name="step" value="2"/>
34
           <input type="hidden" name="aqcurrency" value=1 />
35
           <fieldset class="rows">
36
              <legend>
37
                      New currency
38
              </legend>
39
              <ol>
40
                 <li>
41
                      [% IF currency %]
42
                          <span class="label">Currency: </span>
43
                          <input type="hidden" name="is_a_modif" value="1" />
44
                          <input type="hidden" name="currency_code" id="currency" value="[% currency.currency %]" />[% currency.currency %]
45
                      [% ELSE %]
46
                          <label for="currency_code" class="required">Currency: </label>
47
                          <input type="text" name="currency_code" id="currency_code" size="50" maxlength="50" required="required" class="required" /> <span class="required">Required</span>
48
                      [% END %]
49
                </li>
50
                <li>
51
                      <label for="rate" class="required">Rate: </label>
52
                      <input type="text" name="rate" id="rate" size="10" maxlength="10" value="[% currency.rate %]" required="required" class="required" /> <span class="required">Required</span>
53
                </li>
54
                <li>
55
                      <label for="symbol" class="required">Symbol: </label>
56
                      <input type="text" name="symbol" id="symbol" size="5" maxlength="5" value="[% currency.symbol %]" required="required" class="required" /> <span class="required">Required</span>
57
                </li>
58
                <li>
59
                      <label for="isocode">ISO code: </label>
60
                      <input type="text" name="isocode" id="isocode" size="5" maxlength="5" value="[% currency.isocode %]" />
61
                </li>
62
                <li>
63
                      <label for="active">Active: </label>
64
                      <input type="checkbox" id="active" name="active" value="1" checked="checked" />
65
                      <span id="hint" class="hint"></span>
66
                </li>
67
              </ol>
68
           </fieldset>
69
           <fieldset class="action">
70
                   <input type="submit" value="Submit" />
71
           </fieldset>
72
         </form>
73
</div>
74
75
[% ELSIF displayonboarding == "label" %]
76
<div id="onboardingModal">
77
    <form name="input" action="/cgi-bin/koha/labels/label-edit-layout.pl" method="get">
78
        <fieldset class="rows">
79
        <legend>[% IF ( layout_id ) %]Edit[% ELSE %]Create[% END %] label layout</legend>
80
        <ol>
81
            <li>
82
                <label for="layout_name">Layout name: </label>
83
                <input type="text" name="layout_name" id="layout_name" size="20" value="DEFAULT" />
84
            </li>
85
            <li>
86
                 <label for="barcode_type">Choose barcode type (encoding): </label>
87
                 <select name="barcode_type" id="barcode_type">
88
                    [% FOREACH barcode_type IN barcode_types %]
89
                        [% IF ( barcode_type.selected )     %]
90
                            <option value="[% barcode_type.type %]" selected="selected">[% barcode_type.name %]</option>
91
                        [% ELSE %]
92
                            <option value="[% barcode_type.    type %]">[% barcode_type.name %]</option>
93
                        [% END %]
94
                    [% END %]
95
                </select>
96
            </li>
97
            <li>
98
                <label for="printing_type">Choose layout type: </label>
99
                <select name="printing_type" id="printing_type">
100
                    [% FOREACH label_type IN label_types %]
101
                        [% IF ( label_type.selected ) %]
102
                            <option value="[% label_type.type %]" selected="selected">[% PROCESS translate_label_types type=label_type.type %]</option>
103
                        [% ELSE %]
104
                            <option value="[% label_type.type %]">[% PROCESS translate_label_types type=label_type.type %]</option>
105
                        [% END %]
106
                    [% END %]
107
                </select>
108
            </li>
109
            <li>
110
                   <fieldset>
111
                              <legend>Bibliographic data to print</legend>
112
                              <ol>
113
                                <li class="radio">[% IF ( layout_string ) %]
114
                                    <input type="radio" name="layout_choice" id="layout_choice_order" value="layout_table" checked="checked" /><label for="layout_choice_order">Choose order of text fields to print</label>
115
                                [% ELSE %]
116
                                    <input type="radio" name="layout_choice" id="layout_choice_order" value="layout_table" /><label for="layout_choice_order">Choose Order Of Text Fields to Print</label>
117
                                [% END %]
118
                                <div id="layout_table">
119
                                    <p>
120
                                          [% FOREACH text_field IN fields %]
121
                                                <select name="[% text_field.field_name %]" id="[% text_field.field_name |url %]">
122
                                                    <option value=""></option>
123
                                                    [% FOREACH orde IN [1..field_count] %]
124
                                                        [% IF ( orde == text_field.order ) %]
125
                                                    <option value="[% orde %]" selected="1">[% orde %]</option>
126
                                                        [% ELSE %]
127
                                                    <option value="[% orde %]">[% orde %]</option>
128
                                                        [% END %]
129
                                                    [% END %]
130
                                                </select>&nbsp;<label for="[% text_field.field_name |url %]">[% text_field.field_label %]</label>
131
                                            &nbsp;&nbsp;
132
                                            [% END %]
133
                                    </p>
134
                                </div>
135
                        </fieldset>
136
                </li>
137
                <li>
138
                    <label for="guidebox">Draw guide boxes: </label>
139
                    [% IF ( guidebox ) %]
140
                    <input type="checkbox" name="guidebox" id="guidebox" value="1"  checked="checked" />
141
                    [% ELSE %]
142
                    <input type="checkbox" name="guidebox" id="guidebox" value="1" />
143
                    [% END %]
144
                </li>
145
                <li>
146
                    <label for="callnum_split">Split call numbers: </label>
147
                    [% IF ( callnum_split ) %]
148
                    <input type="checkbox" name="callnum_split" id="callnum_split" value="1"  checked="checked" />
149
                    [% ELSE %]
150
                    <input type="checkbox" name="callnum_split" id="callnum_split" value="1" />
151
                    [% END %]
152
                </li>
153
                <li>
154
                     <label for="text_justify">Text justification: </label>
155
                     <select name="text_justify" id="text_justify">
156
                     [% FOREACH text_justification_type IN text_justification_types %]
157
                        [% IF ( text_justification_type.selected ) %]
158
                            <option value="[% text_justification_type.type %]" selected="selected">[% PROCESS translate_justification_types type=text_justification_type.type %]</option>
159
                        [% ELSE %]
160
                            <option value="[% text_justification_type.type %]">[% PROCESS translate_justification_types type=text_justification_type.type %]</option>
161
                        [% END %]
162
                     [% END %]
163
                     </select>
164
                </li>
165
                <li>
166
                    <label for="font">Font: </label>
167
                    <select name="font" id="font">
168
                        [% FOREACH font_type IN font_types %]
169
                        [% IF ( font_type.selected ) %]
170
                        <option value="[% font_type.type %]" selected="selected">[% font_type.name %]</option>
171
                        [% ELSE %]
172
                        <option value="[% font_type.type %]">[% font_type.name %]</option>
173
                        [% END %]
174
                        [% END %]
175
                    </select>
176
                </li>
177
                <li>
178
                    <label for="font_size">Font size: </label>
179
                    <input type="text" name="font_size" id="font_size" size="2" value="3" />
180
                </li>
181
                <li>
182
                    <label for="oblique_title">Oblique title: </label>
183
                    [% IF ( oblique_title ) %]
184
                    <input type="checkbox" name="oblique_title" id="oblique_title" value="1"  checked="checked" />
185
                    [% ELSE %]
186
                    <input type="checkbox" name="oblique_title" id="oblique_title" value="1" />
187
                    [% END %]
188
                </li>
189
            </ol>
190
        </fielset>
191
        <fieldset class="action">
192
            <input type="submit" value="Save" />
193
            <a class="cancel" href="/cgi-bin/koha/labels/label-manage.pl?label_element=layout">Cancel</a>
194
            <input type="hidden" name="op" value="save" />
195
            <input type="hidden" name="layout_id" value="[% layout_id %]" />
196
            <input type="hidden" name="layoutsubmitted" value=1 />
197
        </fieldset>
198
    </form>
199
</div>
200
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude2.inc (+162 lines)
Line 0 Link Here
1
<style type="text/css">
2
 #onboardingModal{
3
     background-color:#EDF4F6;
4
 }
5
</style>
6
<div id="onboardingModal">
7
    [% IF  displayonboarding == "acquisitions" %]
8
        <h2> Acquisition onboarding wizard</h2>
9
        <p> Create a budget which is the highest level value in acquisitions accountancy. <br>
10
        After creating this budget you will be prompted to create a fund which is what you will use to set up orders.
11
        </p>
12
        <b>If you have previously created a budget (which was subsequently deleted) then you will be redirected to the Budget Administration page after creating a budget using this form. On the Budget Administration page click Actions->Add fund to create a fund</b>
13
        <h3> Create a budget</h3>
14
        <form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post">
15
            <fieldset class="rows">
16
                <input type="hidden" name="op" value="add_validate" />
17
                <input type="hidden" name="step" value="3"/>
18
                <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
19
                <ol>
20
                    <li>
21
                        <label class="required" for="from">Start date: </label>
22
                        <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" />
23
                        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
24
                    </li>
25
26
                    <li>
27
                        <label class="required" for="to">End date: </label>
28
                        <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" />
29
                        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
30
                    </li>
31
32
                    <li>
33
                        <label class="required" for="budget_period_description">Description: </label>
34
                        <input type="text" id="budget_period_description" name="budget_period_description" size="48" maxlength="80" value="[% budget_period_description %]" />
35
                    </li>
36
37
                    <li>
38
                        <label for="budget_period_total">Total amount: </label>
39
                        <input type="text" id="budget_period_total" name="budget_period_total" size="10" maxlength="80" value="[% budget_period_total | $Price on_editing => 1 %]" />
40
                    </li>
41
42
                    <li>
43
                        <label for="budget_period_active">Make budget active: </label>
44
                        <input type="checkbox" checked="checked" id="budget_period_active" name="budget_period_active" value="1" />
45
                    </li>
46
                </ol>
47
            </fieldset>
48
            <fieldset class="action">
49
                <a href = "/cgi-bin/koha/acqui/acqui-home.pl">
50
                <input type="submit" class="action" value="Submit" />
51
                </a>
52
            </fieldset>
53
        </form>
54
 [% ELSIF displayonboarding == "label" %]
55
 <form name="input" action="/cgi-bin/koha/labels/label-edit-template.pl" method="get">
56
        <fieldset class="rows">
57
            <ol>
58
               <li>
59
                  <span class="label">Template ID:</span>[% IF ( template_id ) %][% template_id %][% ELSE %]N/A[% END %]
60
               </li>
61
               <li>
62
                  <label for="template_code">Template code:</label>
63
                  <input type="text" size="30" maxlength="43" name="template_code" id="template_code" value="DEFAULT TEMPLATE"/>
64
               </li>
65
               <li>
66
                  <label for="template_desc">Template description:</label>
67
                  <textarea cols="30" rows="3" id="template_desc" name="template_desc">Default description</textarea>
68
               </li>
69
               <li>
70
                  <label for="units">Units:</label>
71
                  <select id="units" name="units">
72
                  [% FOREACH unit IN units %]
73
                    [% IF ( unit.selected ) %]
74
                        <option value="[% unit.type %]" selected="selected">
75
                    [% ELSE %]
76
                        <option value="[% unit.type %]">
77
                    [% END %]
78
                    [% unit.desc %]
79
                       </option>
80
                    [% END %]
81
                   </select>
82
                </li>
83
                <li>
84
                  <label for="page_height">Page height:</label>
85
                  <input type="text" size="4" name="page_height" id="page_height" value="[% page_height %]" />
86
                </li>
87
                <li>
88
                  <label for="page_width">Page width:</label>
89
                  <input type="text" size="4" name="page_width" id="page_width" value="[% page_width %]" />
90
                </li>
91
                <li>
92
                  <label for="label_width">Label width:</label>
93
                  <input type="text" size="4" name="label_width" id="label_width" value="[% label_width %]" />
94
                </li>
95
                <li>
96
                  <label for="label_height">Label height:</label>
97
                  <input type="text" size="4" name="label_height" id="label_height" value="[% label_height %]" />
98
               </li>
99
            </ol>
100
        </fieldset>
101
        <fieldset class="rows">
102
               <ol><li>
103
                     <label for="top_margin">Top page margin:</label>
104
                     <input type="text" size="4" name="top_margin" id="top_margin" value="[% top_margin %]" />
105
                   </li>
106
                   <li>
107
                     <label for="left_margin">Left page margin:</label>
108
                     <input type="text" size="4" name="left_margin" id="left_margin" value="[% left_margin %]" />
109
                   </li>
110
                   <li>
111
                     <label for="top_text_margin">Top text margin:</label>
112
                     <input type="text" size="4" name="top_text_margin" id="top_text_margin" value="[% top_text_margin %]" />
113
                   </li>
114
                   <li>
115
                     <label for="left_text_margin">Left text margin:</label>
116
                     <input type="text" size="4" name="left_text_margin" id="left_text_margin" value="[% left_text_margin %]" />
117
                   </li>
118
                   <li>
119
                     <label for="cols">Number of columns:</label>
120
                     <input type="text" size="4" name="cols" id="cols" value="[% cols %]" />
121
                   </li>
122
                   <li>
123
                     <label for="rows">Number of rows:</label>
124
                     <input type="text" size="4" name="rows" id="rows" value="[% rows %]" />
125
                   </li>
126
                   <li>
127
                     <label for="col_gap">Gap between columns:</label>
128
                     <input type="text" size="4" name="col_gap" id="col_gap" value="[% col_gap %]" />
129
                   </li>
130
                   <li>
131
                     <label for="row_gap">Gap between rows:</label>
132
                     <input type="text" size="4" name="row_gap" id="row_gap" value="[% row_gap %]" />
133
                   </li>
134
135
                   <li>
136
                     <label for="profile_id">Profile:</label>
137
                     [% IF ( profile_list ) %]
138
                          <select id="profile_id" name="profile_id">
139
                          [% FOREACH profile_lis IN profile_list %]
140
                               [% IF ( profile_lis.selected ) %]
141
                                    <option value="[% profile_lis.profile_id %]" selected="selected">
142
                               [% ELSE %]
143
                                    <option value="[% profile_lis.profile_id %]">
144
                               [% END %]
145
                               [% profile_lis.printer_name %]/[% profile_lis.paper_bin %]
146
                                    </option>
147
                               [% END %]
148
                           </select>
149
                           [% ELSE %]
150
                               <a href="/cgi-bin/koha/labels/label-edit-profile.pl?op=new">Click here to define a printer profile.</a>
151
                           [% END %]
152
                   </li>
153
               </ol>
154
            <input type="submit" class="submit" value="Save" /><a class="cancel" href="/cgi-bin/koha/labels/label-manage.pl?label_element=template">Cancel</a>
155
            <input type="hidden" name="op" value="save" />
156
            [% IF ( template_id ) %]
157
                  <input type="hidden" name="template_id" value="[% template_id %]" />
158
            [% END %]
159
       </fieldset>
160
</form>
161
[% END %]
162
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude3.inc (+75 lines)
Line 0 Link Here
1
<style type="text/css">
2
  #onboardingModal{
3
       z-index:1;
4
       background-color:#EDF4F6;
5
       padding:20px;
6
       width:70%;
7
       position:fixed;
8
       left:auto;
9
       top:auto;
10
       right:auto;
11
       bottom:auto;
12
}
13
</style>
14
15
<div id="onboardingModal">
16
    [% IF displayonboarding == "label" %]
17
    <h2> Acquisition onboarding wizard</h2>
18
    <p> Fill out this form to create a fund which will be assigned to the budget you just created. <br>
19
    A fund is an accounting value you will use to set up orders</p>
20
    <br>
21
    <h3> Create a fund</h3>
22
    <form action="/cgi-bin/koha/admin/aqbudgets.pl" id="edit_fund" name="Aform" method="post">
23
        <input type="hidden" name="op" value="add_validate" />
24
        <input type="hidden" name="checked" value="0" />
25
        <input type="hidden" name="fundcreation" value="onboarding" />
26
        <input type="hidden" name="step" value="4" />
27
        [% IF ( budget_id ) %]
28
                <input type="hidden" name="budget_id" value="[% budget_id %]" />
29
        [% END %]
30
        [% budget_id %]
31
32
        <fieldset class="rows">
33
           <legend>[% IF ( budget_id ) %]Modify[% ELSE %]Add[% END %] Fund
34
                [% IF ( budget_period_description ) %]
35
                    [% budget_name %] for Budget '[% budget_period_description %]'
36
                [% END %]
37
           </legend>
38
        <ol>
39
                [% budget_parent_id = 0 %]
40
                <li>
41
                     <span class="label">Fund parent: </span>
42
                     [% budget_parent_name %]
43
                     [% budget_parent_id %] - [% budget_parent_name %]
44
                     <input type="hidden" name="budget_parent_id" value= NULL />
45
                </li>
46
                <li>
47
                    <label class="required"  for="budget_code">Fund code: </label>
48
                    <input type="text" name="budget_code" id="budget_code" value="[% budget_code %]" size="30" />
49
                </li>
50
51
                <li>
52
                    <label class="required" for="budget_name">Fund name: </label>
53
                    <input type="text" name="budget_name" id="budget_name" value="[% budget_name %]" size="60" />
54
                </li>
55
56
                <li>
57
                    <label style="white-space: nowrap;" for="budget_amount" class="required">Amount: </label>
58
                    <input type="text" name="budget_amount" id="budget_amount" value="[% budget_amount | $Price on_editing => 1 %]" size="8" />
59
                </li>
60
61
                <input type="hidden" name="budget_owner_id" id="budget_owner_id" value="0" />
62
63
                [% IF ( budget_id ) %]
64
                    <input type="hidden" name="budget_id" value="[% budget_id %]" />
65
                [% END %]
66
67
        </fieldset>
68
        <fieldset class="action">
69
            <input type="submit" value="Submit" />
70
            <input type="hidden" name="budget_period_id" value="1" />
71
        </fieldset>
72
    </form>
73
[% END %]
74
</div>
75
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt (-4 / +44 lines)
Lines 1-19 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' %]
6
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
10
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
11
7
[% INCLUDE 'datatables.inc' %]
12
[% INCLUDE 'datatables.inc' %]
8
<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" />
9
<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>
10
15
16
[% INCLUDE 'calendar.inc' %]
17
<script type="text/javascript" src="[% interface %]/[% theme %]/js/acq.js"></script>
18
11
<script type="text/javascript">
19
<script type="text/javascript">
12
//<![CDATA[
20
//<![CDATA[
13
21
14
dt_overwrite_html_sorting_localeCompare();
22
dt_overwrite_html_sorting_localeCompare();
15
23
16
$(document).ready(function() {
24
$(document).ready(function() {
25
    $("#aqhelp").hide();
17
26
18
    var oTable = $("#accounts").dataTable($.extend(true, {}, dataTablesDefaults, {
27
    var oTable = $("#accounts").dataTable($.extend(true, {}, dataTablesDefaults, {
19
        "fnDrawCallback": function ( oSettings ) {
28
        "fnDrawCallback": function ( oSettings ) {
Lines 80-85 $(document).ready(function() { Link Here
80
    });
89
    });
81
    $("#hide_inactive").click();
90
    $("#hide_inactive").click();
82
91
92
    $("#show").click(function(){
93
        $("#aqhelp").show();
94
    });
95
83
});
96
});
84
//]]>
97
//]]>
85
</script>
98
</script>
Lines 98-112 $(document).ready(function() { Link Here
98
    <div class="yui-b">
111
    <div class="yui-b">
99
112
100
[% INCLUDE 'acquisitions-toolbar.inc' %]
113
[% INCLUDE 'acquisitions-toolbar.inc' %]
101
102
<h1>Acquisitions</h1>
103
    [% INCLUDE 'budgets-active-currency.inc' hide = 'yes' %]
104
    [% UNLESS ( loop_budget ) %]
114
    [% UNLESS ( loop_budget ) %]
105
        [% IF ( CAN_user_acquisition_period_manage ) %]
115
        [% IF ( CAN_user_acquisition_period_manage ) %]
106
        <div class="dialog alert"><a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">You must define a budget in Administration</a></div>
116
            [% displayonboarding = "acquisitions" %]
117
            [% IF step == 1 %]
118
                [% INCLUDE onboardinginclude1.inc %]
119
            [% ELSIF step == 2 %]
120
                [% INCLUDE onboardinginclude2.inc %]
121
            [% ELSIF step == 3 %]
122
                [% INCLUDE onboardinginclude3.inc %]
123
            [% END %]
107
        [% ELSE %]
124
        [% ELSE %]
108
        <div class="dialog alert">Your administrator must define a budget in Administration</div>
125
        <div class="dialog alert">Your administrator must define a budget in Administration</div>
109
        [% END %]
126
        [% END %]
127
    [% ELSE %]
128
        <h1>Acquisitions</h1>
110
    [% END %]
129
    [% END %]
111
<div class="yui-g">
130
<div class="yui-g">
112
<div class="yui-u first">
131
<div class="yui-u first">
Lines 237-242 $(document).ready(function() { Link Here
237
    </div>
256
    </div>
238
    [% END %]
257
    [% END %]
239
258
259
    <button type="button" id="show" onclick"unhide(aqhelp)">Show the next steps to set up Acquisitions</button>
260
    <br><br>
261
    <div id="aqhelp">
262
        <h1> Next steps</h1>
263
        <h2> 1. Create your first vendor</h2>
264
        <p> A vendor is the organisation your institution purchases items from i.e. suppliers<br>
265
        You must create a vendor before you can create any orders</p>
266
        <b>Click <a href="/cgi-bin/koha/acqui/supplier.pl?op=enter">here</a> to create a vendor.</b>
267
        <br><br>
268
        <h2> 2. Create your first basket</h2>
269
        <p> A basket is the conceptual container that holds orders. Each basket is assigned to a single vendor so you can perform multiple seperate orders from a single vendor simultaneously. Because of its reliance on vendor the basket must be created after the vendor</p>
270
        <b> To create a basket, click the 'New basket' button on the Vendor Information page which is displayed after you create a vendor</b>
271
        <br><br>
272
        <h2> 3. Create an order</h2>
273
        <p> An order is a assignment of items purchased from a single vendor at a single time</p>
274
        You create an order by clicking "Add to basket" in the Basket page. From here you can choose the item(s) you want to purchase from existing MARC records in your Koha catalogue, subscription, new item record, external source, staged file (bibliographic file in the process of being uploaded), or from popularly held items.
275
        </p>
276
        <br><br>
277
        For further information about creating a vendor, basket and order go to the Koha manual:
278
        <a href="http://translate.koha-community.org/manual/master/en/html/09_acquisitions.html"> Koha manual Acquisitions section</a>
279
    </div>
240
</div>
280
</div>
241
</div>
281
</div>
242
<div class="yui-b">
282
<div class="yui-b">
(-)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 (-1 / +2 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
Lines 464-469 var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") Link Here
464
464
465
    <input type="hidden" name="op" value="add_validate" />
465
    <input type="hidden" name="op" value="add_validate" />
466
    <input type="hidden" name="checked" value="0" />
466
    <input type="hidden" name="checked" value="0" />
467
    <input type="hidden" name="fundcreation" value="aqform" />
467
    <ol>
468
    <ol>
468
    [% IF ( budget_parent_id ) %]
469
    [% IF ( budget_parent_id ) %]
469
    <li>
470
    <li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-home.tt (-1 / +7 lines)
Lines 20-26 Link Here
20
                    <div class="yui-g">
20
                    <div class="yui-g">
21
                    [% INCLUDE 'labels-toolbar.inc' %]
21
                    [% INCLUDE 'labels-toolbar.inc' %]
22
                        <div class="yui-u first">
22
                        <div class="yui-u first">
23
23
                            [% IF !(layoutvalue) %]
24
                                [% displayonboarding = "label" %]
25
                                [% INCLUDE 'onboardinginclude1.inc' %]
26
                            [% ELSIF !(templatevalue) %]
27
                                [% displayonboarding = "label" %]
28
                                [% INCLUDE 'onboardinginclude2.inc' %]
29
                            [% END %]
24
                        </div>
30
                        </div>
25
                    </div>
31
                    </div>
26
                </div>
32
                </div>
(-)a/labels/label-edit-layout.pl (-9 / +22 lines)
Lines 123-142 elsif ($op eq 'save') { Link Here
123
        $layout = C4::Labels::Layout->new(@params);
123
        $layout = C4::Labels::Layout->new(@params);
124
        $layout_id = $layout->save();
124
        $layout_id = $layout->save();
125
    }
125
    }
126
    print $cgi->redirect("label-manage.pl?label_element=layout" . ($layout_id == -1 ? "&element_id=$layout_id&op=$op&error=1" : ''));
126
127
    exit;
127
    my $layoutvalue = C4::Creators::Layout->retrieve_all();
128
    my $templatecount = C4::Creators::Template->retrieve_all();
129
    $template->param( layoutvalue => $layoutvalue,
130
         templatevalue => $templatecount,
131
    );
132
133
    if ($templatecount == 0) {
134
        print $cgi->redirect("/cgi-bin/koha/labels/label-home.pl");
135
        exit;
136
    } else {
137
        print $cgi->redirect("label-manage.pl?label_element=layout" . ($layout_id == -1 ? "&element_id=$layout_id&op=$op&error=1" : ''));
138
        exit;
139
    }
128
}
140
}
129
else {  # if we get here, this is a new layout
141
else {  # if we get here, this is a new layout
130
    $layout = C4::Labels::Layout->new();
142
    $layout = C4::Labels::Layout->new();
131
}
143
}
132
144
133
my $barcode_types = _set_selected(get_barcode_types(), $layout, 'barcode_type');
145
    my $barcode_types = _set_selected(get_barcode_types(), $layout, 'barcode_type');
134
my $label_types = _set_selected(get_label_types(), $layout, 'printing_type');
146
    my $label_types = _set_selected(get_label_types(), $layout, 'printing_type');
135
my $font_types = _set_selected(get_font_types(), $layout, 'font');
147
    my $font_types = _set_selected(get_font_types(), $layout, 'font');
136
my $text_justification_types = _set_selected(get_text_justification_types(), $layout, 'text_justify');
148
    my $text_justification_types = _set_selected(get_text_justification_types(), $layout, 'text_justify');
137
my ($select_text_fields, $select_text_fields_cnt) = _select_format_string($layout->get_attr('format_string'));
149
    my ($select_text_fields, $select_text_fields_cnt) = _select_format_string($layout->get_attr('format_string'));
138
150
139
$template->param(
151
    $template->param(
140
        barcode_types   => $barcode_types,
152
        barcode_types   => $barcode_types,
141
        label_types     => $label_types,
153
        label_types     => $label_types,
142
        font_types      => $font_types,
154
        font_types      => $font_types,
Lines 151-155 $template->param( Link Here
151
        callnum_split   => $layout->get_attr('callnum_split'),
163
        callnum_split   => $layout->get_attr('callnum_split'),
152
        format_string   => $layout->get_attr('format_string'),
164
        format_string   => $layout->get_attr('format_string'),
153
        layout_string   => 1,   # FIXME: This should not be hard-coded; It should perhaps be yet another syspref... CN
165
        layout_string   => 1,   # FIXME: This should not be hard-coded; It should perhaps be yet another syspref... CN
154
);
166
    );
167
155
output_html_with_http_headers $cgi, $cookie, $template->output;
168
output_html_with_http_headers $cgi, $cookie, $template->output;
(-)a/labels/label-edit-template.pl (-2 / +9 lines)
Lines 111-118 elsif ($op eq 'save') { Link Here
111
            $profile->save();
111
            $profile->save();
112
        }
112
        }
113
    }
113
    }
114
    print $cgi->redirect("label-manage.pl?label_element=template");
114
115
    exit;
115
    my $profilevalue = C4::Creators::Profile->retrieve_all();
116
    if ($profilevalue == 0) {
117
        print $cgi->redirect("label-edit-profile.pl");
118
        exit;
119
    }else{
120
        print $cgi->redirect("/cgi-bin/koha/labels/label-home.pl");
121
        exit;
122
    }
116
}
123
}
117
else {  # if we get here, this is a new layout
124
else {  # if we get here, this is a new layout
118
    $label_template = C4::Labels::Template->new();
125
    $label_template = C4::Labels::Template->new();
(-)a/labels/label-home.pl (-1 / +70 lines)
Lines 22-30 use strict; Link Here
22
use warnings;
22
use warnings;
23
23
24
use CGI qw ( -utf8 );
24
use CGI qw ( -utf8 );
25
use POSIX;
25
26
26
use C4::Auth qw(get_template_and_user);
27
use C4::Auth qw(get_template_and_user);
27
use C4::Output qw(output_html_with_http_headers);
28
use C4::Output qw(output_html_with_http_headers);
29
use C4::Creators::Layout;
30
use C4::Creators::Template;
31
use C4::Creators;
32
use C4::Labels;
28
33
29
my $cgi = new CGI;
34
my $cgi = new CGI;
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
35
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Lines 38-41 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
38
    }
43
    }
39
);
44
);
40
45
46
my $op = $cgi->param('op') || '';
47
my $layout_id = $cgi->param('layout_id') || $cgi->param('element_id') || '';
48
my $layout_choice = $cgi->param('layout_choice') || '';
49
my $layout = C4::Labels::Layout->new();
50
51
sub _set_selected {
52
    my ($type_list, $object, $data_type) = @_;
53
    SET_SELECTED:
54
    foreach my $type (@$type_list) {
55
    if ($layout->get_attr($data_type)) {
56
     if ($type->{'type'} eq $layout->get_attr($data_type)) {
57
           $type->{'selected'} = 1;
58
     }
59
   }
60
   else {
61
      $type->{'selected'} = 1;
62
      last SET_SELECTED;
63
   }
64
};
65
return $type_list;
66
}
67
68
sub _select_format_string {     # generate field table based on format_string
69
   my $format_string = shift;
70
71
   my @text_fields = grep /\w/, split /\s*,\s/, $format_string;
72
  my %tf = map {$_ => 1} @text_fields;
73
   my @missing_fields = grep { !$tf{$_} } @{ C4::Labels::Layout->PRESET_FIELDS };
74
   my $field_count = scalar(@text_fields) + scalar( @missing_fields);
75
76
    my @fields;
77
    my $field_index = 1;
78
   foreach my $f (@text_fields) {
79
      push @fields, {field_name => ($f . "_tbl"), field_label => $f, order => $field_index};
80
      $field_index++;
81
   }
82
   foreach my $f (@missing_fields) {
83
      push @fields, {field_name => ($f . "_tbl"), field_label => $f};
84
   }
85
   return (\@fields, $field_count);
86
}
87
88
my $barcode_types = _set_selected(get_barcode_types(), $layout, 'barcode_type');
89
my $label_types = _set_selected(get_label_types(), $layout, 'printing_type');
90
my $font_types = _set_selected(get_font_types(), $layout, 'font');
91
my $text_justification_types = _set_selected(get_text_justification_types(), $layout, 'text_justify');
92
my ($select_text_fields, $select_text_fields_cnt) = _select_format_string($layout->get_attr('format_string'));
93
my $units = get_unit_values();
94
95
$template->param(
96
   barcode_types   => $barcode_types,
97
   label_types     => $label_types,
98
   font_types      => $font_types,
99
   text_justification_types    => $text_justification_types,
100
   fields          => $select_text_fields,
101
   field_count     => $select_text_fields_cnt,
102
   units           => $units,
103
);
104
105
my $layoutvalue = C4::Creators::Layout->retrieve_all();
106
my $templatevalue = C4::Creators::Template->retrieve_all();
107
$template->param( layoutvalue => $layoutvalue,
108
                  templatevalue => $templatevalue,
109
);
110
41
output_html_with_http_headers $cgi, $cookie, $template->output;
111
output_html_with_http_headers $cgi, $cookie, $template->output;
42
- 

Return to bug 18060