Bugzilla – Attachment 60687 Details for
Bug 18002
Aquisitions onboarding tool - to help users set up acquisitions the first time
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18002 - Created two includes onboardinginclude.inc and onboardinginclude2.inc which contain the budget and fund creation forms respectively
Bug-18002---Created-two-includes-onboardinginclude.patch (text/plain), 14.92 KB, created by
Alex Buckley
on 2017-02-26 09:07:15 UTC
(
hide
)
Description:
Bug 18002 - Created two includes onboardinginclude.inc and onboardinginclude2.inc which contain the budget and fund creation forms respectively
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2017-02-26 09:07:15 UTC
Size:
14.92 KB
patch
obsolete
>From b08101f5ec22fb94fb6550a5b2858019cd460aad Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Fri, 17 Feb 2017 01:55:00 +0000 >Subject: [PATCH] Bug 18002 - Created two includes onboardinginclude.inc and > onboardinginclude2.inc which contain the budget and fund creation forms > respectively > >Both these forms successfully insert records into the database >--- > acqui/acqui-home.pl | 9 ++ > admin/aqbudgetperiods.pl | 8 +- > admin/aqbudgets.pl | 5 ++ > .../prog/en/includes/onboardinginclude.inc | 97 ++++++++++------------ > .../prog/en/includes/onboardinginclude2.inc | 62 ++++++++++++++ > .../prog/en/modules/acqui/acqui-home.tt | 15 +++- > .../prog/en/modules/admin/aqbudgetperiods.tt | 2 +- > .../prog/en/modules/admin/aqbudgets.tt | 2 +- > 8 files changed, 142 insertions(+), 58 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude2.inc > >diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl >index fe53174..04bb261 100755 >--- a/acqui/acqui-home.pl >+++ b/acqui/acqui-home.pl >@@ -66,6 +66,15 @@ my $totspent_active = 0; > my $totordered_active = 0; > my $totavail_active = 0; > >+my $budgets = GetBudgetPeriod(1); >+if ($budgets > 0){ >+ my $stepfund = 2; >+ $template->param( stepfund => $stepfund ); >+} else { >+ my $stepfund = 1; >+ $template->param( stepfund => $stepfund ); >+} >+ > my @budget_loop; > foreach my $budget ( @{$budget_arr} ) { > next unless (CanUserUseBudget($loggedinuser, $budget, $userflags)); >diff --git a/admin/aqbudgetperiods.pl b/admin/aqbudgetperiods.pl >index 7ce5783..1935aee 100755 >--- a/admin/aqbudgetperiods.pl >+++ b/admin/aqbudgetperiods.pl >@@ -113,14 +113,18 @@ if ( $op eq 'add_form' ) { > elsif ( $op eq 'add_validate' ) { > ## add or modify a budget period (confirmation) > >- ## update budget period data >+## update budget period data > if ( $budget_period_id ne '' ) { > $$budget_period_hashref{$_}||=0 for qw(budget_period_active budget_period_locked); > my $status=ModBudgetPeriod($budget_period_hashref); > } > else { # ELSE ITS AN ADD > my $budget_period_id=AddBudgetPeriod($budget_period_hashref); >- } >+ my $stepfund = $input->param( 'step' ); >+ $template->param( stepfund => $stepfund ); >+ print $input->redirect("/cgi-bin/koha/acqui/acqui-home.pl"); >+ exit; >+} > $op='else'; > } > >diff --git a/admin/aqbudgets.pl b/admin/aqbudgets.pl >index 483ff8f..57e2bb2 100755 >--- a/admin/aqbudgets.pl >+++ b/admin/aqbudgets.pl >@@ -180,6 +180,7 @@ if ($op eq 'add_form') { > # END $OP eq ADD_FORM > #---------------------- DEFAULT DISPLAY BELOW --------------------- > >+ > # called by default form, used to confirm deletion of data in DB > } elsif ($op eq 'delete_confirm') { > >@@ -221,6 +222,10 @@ if ($op eq 'add_form') { > $budget_hash->{budget_id} = AddBudget( $budget_hash ); > ModBudgetUsers($budget_hash->{budget_id}, @budgetusersid); > $budget_modified = 1; >+ >+ print $input->redirect("/cgi-bin/koha/acqui/acqui-home.pl"); >+ exit; >+ > } > > my $set_owner_to_children = $input->param('set_owner_to_children'); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude.inc >index b26f070..b372886 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude.inc >@@ -1,7 +1,3 @@ >-[% USE Koha %] >-[% USE KohaDates %] >-[% USE Branches %] >- > <style type="text/css"> > #onboardingModal{ > z-index:1; >@@ -14,61 +10,58 @@ > top:auto; > right:auto; > bottom:auto; >- border-radius:25px; >+ border-radius:25px; > } > </style> >+ <div id="onboardingModal"> >+ <span class="close">×</span><br><br> >+ [% IF displayonboardscreen == "acquisitions" %] >+ <h2> Create a budget</h2> >+ <form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post"> >+ <fieldset class="rows"> >+ <input type="hidden" name="op" value="add_validate" /> >+ <input type="hidden" name="step" value="2"/> >+ <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" /> >+ <ol> >+ <li> >+ <label class="required" for="from">Start date: </label> >+ <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" /> >+ <div class="hint">[% INCLUDE 'date-format.inc' %]</div> >+ </li> > >-[% step = 1 %] >- >-<div id="onboardingModal"> >- <span class="close">×</span><br><br> >-[% IF displayonboardscreen == "acquisitions" %] >- <h2> Create a budget</h2> >- <form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post"> >- <fieldset class="rows"> >- <input type="hidden" name="op" value="add_validate" /> >- <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" /> >- <ol> >- <li> >- <label class="required" for="from">Start date: </label> >- <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" /> >- <div class="hint">[% INCLUDE 'date-format.inc' %]</div> >- </li> >- >- <li> >- <label class="required" for="to">End date: </label> >- <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" /> >- <div class="hint">[% INCLUDE 'date-format.inc' %]</div> >- </li> >+ <li> >+ <label class="required" for="to">End date: </label> >+ <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" /> >+ <div class="hint">[% INCLUDE 'date-format.inc' %]</div> >+ </li> > >- <li> >- <label class="required" for="budget_period_description">Description: </label> >- <input type="text" id="budget_period_description" name="budget_period_description" >- size="48" maxlength="80" value="[% budget_period_description %]" /> >- </li> >+ <li> >+ <label class="required" for="budget_period_description">Description: </label> >+ <input type="text" id="budget_period_description" name="budget_period_description" size="48" maxlength="80" value="[% budget_period_description %]" /> >+ </li> > >- <li> >- <label for="budget_period_total">Total amount: </label> >- <input type="text" id="budget_period_total" name="budget_period_total" >- size="10" maxlength="80" value="[% budget_period_total | $Price on_editing => 1 %]" /> >- </li> >+ <li> >+ <label for="budget_period_total">Total amount: </label> >+ <input type="text" id="budget_period_total" name="budget_period_total" size="10" maxlength="80" value="[% budget_period_total | $Price on_editing => 1 %]" /> >+ </li> > >- <li> >- <label for="budget_period_active">Make budget active: </label> >- [% 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 %] >- </li> >- </ol> >- </fielset> >+ <li> >+ <label for="budget_period_active">Make budget active: </label> >+ [% 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 %] >+ </li> >+ </ol> >+ </fieldset> >+ <fieldset class="action"> >+ <a href = "/cgi-bin/koha/acqui/acqui-home.pl"> >+ <input type="submit" class="action" value="Submit" /> >+ </a> >+ </fieldset> >+ </form> >+ </div> >+ [% ELSIF displayonboardscreen == "label" %] >+<h2>testing</h2> > >- <fieldset class="action"> >- <input type="button" value="Save" onclick="Check(this.form)" /> >- <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl" class="cancel">Cancel</a> >- </fielset> >- </form> >-</div> >-[% ELSIF displayonboardscreen == "label" %] > > > >-<h2>testing</h2> >-[% END %] >+ [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude2.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude2.inc >new file mode 100644 >index 0000000..51ea060 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude2.inc >@@ -0,0 +1,62 @@ >+<style type="text/css"> >+ #onboardingModal{ >+ z-index:1; >+ background-color:#5bad3f; >+ padding:20px; >+ width:80%; >+ height:60%; >+ position:fixed; >+ left:auto; >+ top:auto; >+ right:auto; >+ bottom:auto; >+ border-radius:25px; >+ } >+</style> >+ >+<div id="onboardingModal"> >+ <form action="/cgi-bin/koha/admin/aqbudgets.pl" id="edit_fund" name="Aform" method="post"> >+ <fieldset class="rows"> >+ <legend>[% IF ( budget_id ) %]Modify[% ELSE %]Add[% END %] Fund >+ [% IF ( budget_period_description ) %] >+ [% budget_name %] for Budget '[% budget_period_description %]' >+ [% END %] >+ </legend> >+ <input type="hidden" name="op" value="add_validate" /> >+ <input type="hidden" name="checked" value="0" /> >+ <ol> >+ [% budget_parent_id = 0 %] >+ <li> >+ <span class="label">Fund parent: </span> >+ [% budget_parent_name %] >+ [% budget_parent_id %] - [% budget_parent_name %] >+ <input type="hidden" name="budget_parent_id" value= NULL /> >+ </li> >+ <li> >+ <label class="required" for="budget_code">Fund code: </label> >+ <input type="text" name="budget_code" id="budget_code" value="[% budget_code %]" size="30" /> >+ </li> >+ >+ <li> >+ <label class="required" for="budget_name">Fund name: </label> >+ <input type="text" name="budget_name" id="budget_name" value="[% budget_name %]" size="60" /> >+ </li> >+ >+ <li> >+ <label style="white-space: nowrap;" for="budget_amount" class="required">Amount: </label> >+ <input type="text" name="budget_amount" id="budget_amount" value="[% budget_amount | $Price on_editing => 1 %]" size="8" /> >+ </li> >+ >+ <input type="hidden" name="budget_owner_id" id="budget_owner_id" value="0" /> >+ >+ [% IF ( budget_id ) %] >+ <input type="hidden" name="budget_id" value="[% budget_id %]" /> >+ [% END %] >+ >+ </fieldset> >+ <fieldset class="action"> >+ <input type="submit" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/admin/aqbudgets.pl">Cancel</a> >+ <input type="hidden" name="budget_period_id" value="1" /> >+ </fieldset> >+ </form> >+</div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt >index 0bc0982..ac29397 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt >@@ -1,5 +1,9 @@ > [% USE Price %] > [% USE Branches %] >+[% USE Koha %] >+[% USE KohaDates %] >+[% USE Branches %] >+ > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Acquisitions</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -9,6 +13,9 @@ > <link href="[% interface %]/lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css" rel="stylesheet" type="text/css" /> > <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/treetable/jquery.treetable.js"></script> > >+[% INCLUDE 'calendar.inc' %] >+<script type="text/javascript" src="[% interface %]/[% theme %]/js/acq.js"></script> >+ > <script type="text/javascript"> > //<![CDATA[ > >@@ -111,8 +118,12 @@ $(document).ready(function() { > [% INCLUDE 'budgets-active-currency.inc' hide = 'yes' %] > [% UNLESS ( loop_budget ) %] > [% IF ( CAN_user_acquisition_period_manage ) %] >- [% displayonboardscreen = "acquisitions" %] >- [% INCLUDE onboardinginclude.inc %] >+ [% displayonboardscreen = "acquisitions" %] >+ [% IF stepfund == 1 %] >+ [% INCLUDE onboardinginclude.inc %] >+ [% ELSE %] >+ [% INCLUDE onboardinginclude2.inc %] >+ [% END %] > [% ELSE %] > <div class="dialog alert">Your administrator must define a budget in Administration</div> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt >index a74329c..97ab4ea 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt >@@ -334,7 +334,7 @@ > <li> > <label class="required" for="from">Start date: </label> > <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" /> >- <div class="hint">[% INCLUDE 'date-format.inc' %]</div> >+ <!--<div class="hint">[% INCLUDE 'date-format.inc' %]</div>--> > </li> > <li> > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt >index a3c9ee9..6e09b87 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt >@@ -453,7 +453,7 @@ var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") > > <!-- ********************************************************************************************** --> > <!-- create add/mod entry form --> >-[% IF op == 'add_form' && !error_not_authorised_to_modify %] >+[% IF op == 'add_form' %] > <form action="/cgi-bin/koha/admin/aqbudgets.pl" id="edit_fund" name="Aform" method="post"> > <fieldset class="rows"> > <legend>[% IF ( budget_id ) %]Modify[% ELSE %]Add[% END %] Fund >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18002
:
59910
|
59911
|
59992
|
60676
|
60677
|
60678
|
60679
|
60680
|
60681
|
60682
|
60683
|
60684
|
60685
|
60686
|
60687
|
60688
|
61987
|
61988
|
63150
|
63151
|
63380
|
63456
|
64732
|
64746
|
64765
|
64947
|
66301
|
67649
|
67650
|
67651
|
68108
|
68109
|
68110