Bugzilla – Attachment 64733 Details for
Bug 18060
Add onboarding functionality to guide users through setting up labels for the first time
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18060 - Label onboarding tool to be displayed when no labels or templates exist
Bug-18060---Label-onboarding-tool-to-be-displayed-.patch (text/plain), 45.88 KB, created by
Alex Buckley
on 2017-06-29 23:58:28 UTC
(
hide
)
Description:
Bug 18060 - Label onboarding tool to be displayed when no labels or templates exist
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2017-06-29 23:58:28 UTC
Size:
45.88 KB
patch
obsolete
>From bfc8b8e59677a98599329d7f33b6b967037032cd Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Sun, 29 Jan 2017 11:33:35 +0000 >Subject: [PATCH] Bug 18060 - Label onboarding tool to be displayed when no > labels or templates exist > >--- > C4/Budgets.pm | 7 + > C4/Creators/Layout.pm | 13 ++ > C4/Creators/Profile.pm | 11 ++ > C4/Creators/Template.pm | 11 ++ > acqui/acqui-home.pl | 24 +++ > admin/aqbudgetperiods.pl | 8 +- > admin/aqbudgets.pl | 12 +- > admin/currency.pl | 9 + > koha-tmpl/intranet-tmpl/prog/css/staff-global.css | 5 + > .../prog/en/includes/budgets-active-currency.inc | 16 +- > .../prog/en/includes/onboardinginclude1.inc | 200 +++++++++++++++++++++ > .../prog/en/includes/onboardinginclude2.inc | 162 +++++++++++++++++ > .../prog/en/includes/onboardinginclude3.inc | 75 ++++++++ > .../prog/en/modules/acqui/acqui-home.tt | 48 ++++- > .../prog/en/modules/admin/aqbudgetperiods.tt | 2 +- > .../prog/en/modules/admin/aqbudgets.tt | 3 +- > .../prog/en/modules/labels/label-home.tt | 8 +- > labels/label-edit-layout.pl | 31 +++- > labels/label-edit-template.pl | 11 +- > labels/label-home.pl | 70 ++++++++ > 20 files changed, 702 insertions(+), 24 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude1.inc > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude2.inc > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude3.inc > >diff --git a/C4/Budgets.pm b/C4/Budgets.pm >index c68fbec..13d6ecd 100644 >--- a/C4/Budgets.pm >+++ b/C4/Budgets.pm >@@ -146,6 +146,13 @@ sub GetPeriodsCount { > } > > # ------------------------------------------------------------------- >+ >+sub GetHighestBudgetPeriod{ >+ my $dbh = C4::Context->dbh; >+ warn my $data = $dbh->selectrow_array("SELECT MAX(budget_period_id) FROM aqbudgetperiods"); >+ return $data; >+} >+# ------------------------------------------------------------------- > sub CheckBudgetParent { > my ( $new_parent, $budget ) = @_; > my $new_parent_id = $new_parent->{'budget_id'}; >diff --git a/C4/Creators/Layout.pm b/C4/Creators/Layout.pm >index f1dc20e..e806499 100644 >--- a/C4/Creators/Layout.pm >+++ b/C4/Creators/Layout.pm >@@ -8,6 +8,7 @@ use autouse 'Data::Dumper' => qw(Dumper); > use C4::Context; > use C4::Debug; > use C4::Creators::PDF; >+use C4::Creators; > > > # FIXME: Consider this style parameter verification instead... >@@ -111,6 +112,17 @@ sub retrieve { > return $self; > } > >+sub retrieve_all { >+ my $dbh = C4::Context->dbh; >+ my $sth = $dbh->prepare("select count(*) from creator_layouts where creator = 'Labels' group by creator"); >+ my $layout = $sth->execute(); >+ if ($layout == '0E0'){ >+ return 0; >+ } else { >+ return $layout; >+ } >+} >+ > sub delete { > my $self = {}; > my %opts = (); >@@ -234,6 +246,7 @@ sub get_text_wrap_cols { > return $col_count; > } > >+ > 1; > __END__ > >diff --git a/C4/Creators/Profile.pm b/C4/Creators/Profile.pm >index 37512fa..ba82145 100644 >--- a/C4/Creators/Profile.pm >+++ b/C4/Creators/Profile.pm >@@ -90,6 +90,17 @@ sub retrieve { > return $self; > } > >+sub retrieve_all { >+ my $dbh = C4::Context->dbh; >+ my $sth = $dbh->prepare("select count(*) from printers_profile where creator = 'Labels' group by creator"); >+ my $profile = $sth->execute(); >+ if ($profile == '0E0'){ >+ return 0; >+ } else { >+ return $profile; >+ } >+} >+ > sub delete { > my $self = {}; > my %opts = (); >diff --git a/C4/Creators/Template.pm b/C4/Creators/Template.pm >index ee504d7..87240b9 100644 >--- a/C4/Creators/Template.pm >+++ b/C4/Creators/Template.pm >@@ -131,6 +131,17 @@ sub retrieve { > return $self; > } > >+sub retrieve_all { >+ my $dbh = C4::Context->dbh; >+ my $sth = $dbh->prepare("select count(*) FROM creator_templates ct where creator = 'Labels' group by creator"); >+ my $templatecount = $sth->execute(); >+ if ($templatecount == '0E0'){ >+ return 0; >+ } else { >+ return $templatecount; >+ } >+} >+ > sub delete { > my $self = {}; > my %opts = (); >diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl >index fe53174..56b68de 100755 >--- a/acqui/acqui-home.pl >+++ b/acqui/acqui-home.pl >@@ -122,11 +122,35 @@ $template->param( > suggestions_count => $suggestions_count, > ); > >+ >+ >+ >+ >+ >+my $aqstep; > my $cur = Koha::Acquisition::Currencies->get_active; >+ > if ( $cur ) { > $template->param( > currency => $cur->currency, > ); > } > >+my $budget = GetPeriodsCount(); >+my $budgetid = C4::Budgets->GetHighestBudgetPeriod(); >+if (!@budget_loop){ >+if (!$cur) { >+ $aqstep = 1; >+ $template->param( step => $aqstep ); >+} elsif ($budget && $budgetid == 1){ >+ $aqstep = 3; >+ $template->param( step => $aqstep ); >+} elsif ($budgetid > 1) { >+ print $query->redirect("/cgi-bin/koha/admin/aqbudgetperiods.pl"); >+ exit; >+} else { >+ $aqstep = 2; >+ $template->param( step => $aqstep ); >+} >+} > output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/admin/aqbudgetperiods.pl b/admin/aqbudgetperiods.pl >index ca2171f..26a2881 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 97664df..5e51a48 100755 >--- a/admin/aqbudgets.pl >+++ b/admin/aqbudgets.pl >@@ -76,8 +76,6 @@ my $budget_permission = $input->param('budget_permission'); > my $budget_users_ids = $input->param('budget_users_ids'); > my $filter_budgetbranch = $input->param('filter_budgetbranch') // ''; > my $filter_budgetname = $input->param('filter_budgetname'); >- >- > # ' ------- get periods stuff ------------------' > # IF PERIODID IS DEFINED, GET THE PERIOD - ELSE JUST GET THE ACTIVE PERIOD BY DEFAULT > my $period; >@@ -180,6 +178,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 +220,15 @@ if ($op eq 'add_form') { > $budget_hash->{budget_id} = AddBudget( $budget_hash ); > ModBudgetUsers($budget_hash->{budget_id}, @budgetusersid); > $budget_modified = 1; >+ >+ my $fundcreation = $input->param('fundcreation'); >+ >+ if ($fundcreation eq "onboarding"){ >+ my $step = $input->param('step'); >+ $template->param('step' => $step); >+ 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/admin/currency.pl b/admin/currency.pl >index 1c5ec3e..c1adbb3 100755 >--- a/admin/currency.pl >+++ b/admin/currency.pl >@@ -89,6 +89,15 @@ if ( $op eq 'add_form' ) { > } > $searchfield = q||; > $op = 'list'; >+ >+ my $aqcurrency = $input->param('aqcurrency'); >+ if ($aqcurrency == 1) { >+ my $step = $input->param( 'step' ); >+ $template->param( step => $step ); >+ print $input->redirect("/cgi-bin/koha/acqui/acqui-home.pl"); >+ exit; >+ } >+ > } elsif ( $op eq 'delete_confirm' ) { > my $currency = Koha::Acquisition::Currencies->find($currency_code); > >diff --git a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css >index fb09d51..65b232b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css >+++ b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css >@@ -3007,3 +3007,8 @@ fieldset.rows + fieldset.action { > #patron_search #filters { > display: none; > } >+div#aqhelp{ >+ background-color:#EDF4F6; >+ padding:20px; >+ width:50%; >+} >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/budgets-active-currency.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/budgets-active-currency.inc >index 1862059..75a018b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/budgets-active-currency.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/budgets-active-currency.inc >@@ -1,14 +1,26 @@ >+<style type="text/css"> >+ #onboardingModal{ >+ z-index:1; >+ background-color:#E6F0F2; >+ position:fixed; >+ left:auto; >+ top:auto; >+ right:auto; >+ bottom:auto; >+} >+</style> >+ > [% IF ( currency ) %] > [% IF ( not hide ) %] > <p><b>Currency = [% currency %]</b></p> > [% END %] > [% ELSE %] >- <div class="dialog alert"> >+ <div class="dialog alert"> > <h3>No active currency is defined</h3> > [% IF CAN_user_parameters_parameters_remaining_permissions %] > <p><a href="/cgi-bin/koha/admin/currency.pl">Please specify an active currency.</a></p> > [% ELSE %] > <p>Your administrator must specify an active currency.</p> > [% END %] >- </div> >+ </div> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude1.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude1.inc >new file mode 100644 >index 0000000..2d33777 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude1.inc >@@ -0,0 +1,200 @@ >+<style type="text/css"> >+ #onboardingModal{ >+ background-color:#EDF4F6; >+ } >+</style> >+ >+[% BLOCK translate_justification_types %] >+ [% SWITCH type %] >+ [% CASE 'L' %]Left >+ [% CASE 'C' %]Center >+ [% CASE 'R' %]Right >+ [% END %] >+[% END %] >+ >+[% BLOCK translate_label_types %] >+ [% SWITCH type %] >+ [% CASE 'BIB' %]Biblio >+ [% CASE 'BARBIB' %]Barcode/Biblio >+ [% CASE 'BIBBAR' %]Biblio/Barcode >+ [% CASE 'ALT' %]Alternating >+ [% CASE 'BAR' %]Barcode >+ [% END %] >+[% END %] >+ >+[% IF displayonboarding =="acqui" %] >+<div id="onboardingModal"> >+ <h2> Acquisition onboarding wizard</h2> >+ <h3> This onboarding wizard will take you through the process of setting up Acquistions </h3> >+ <p>Start by completing this form to create a currency which you will be used to create your first budget and fund.<br> >+ A fund is the accounting value you use to create orders</p> >+ <form action="/cgi-bin/koha/admin/currency.pl" name="Aform" method="post" class="validated"> >+ <input type="hidden" name="op" value="add_validate" /> >+ <input type="hidden" name="step" value="2"/> >+ <input type="hidden" name="aqcurrency" value=1 /> >+ <fieldset class="rows"> >+ <legend> >+ New currency >+ </legend> >+ <ol> >+ <li> >+ [% IF currency %] >+ <span class="label">Currency: </span> >+ <input type="hidden" name="is_a_modif" value="1" /> >+ <input type="hidden" name="currency_code" id="currency" value="[% currency.currency %]" />[% currency.currency %] >+ [% ELSE %] >+ <label for="currency_code" class="required">Currency: </label> >+ <input type="text" name="currency_code" id="currency_code" size="50" maxlength="50" required="required" class="required" /> <span class="required">Required</span> >+ [% END %] >+ </li> >+ <li> >+ <label for="rate" class="required">Rate: </label> >+ <input type="text" name="rate" id="rate" size="10" maxlength="10" value="[% currency.rate %]" required="required" class="required" /> <span class="required">Required</span> >+ </li> >+ <li> >+ <label for="symbol" class="required">Symbol: </label> >+ <input type="text" name="symbol" id="symbol" size="5" maxlength="5" value="[% currency.symbol %]" required="required" class="required" /> <span class="required">Required</span> >+ </li> >+ <li> >+ <label for="isocode">ISO code: </label> >+ <input type="text" name="isocode" id="isocode" size="5" maxlength="5" value="[% currency.isocode %]" /> >+ </li> >+ <li> >+ <label for="active">Active: </label> >+ <input type="checkbox" id="active" name="active" value="1" checked="checked" /> >+ <span id="hint" class="hint"></span> >+ </li> >+ </ol> >+ </fieldset> >+ <fieldset class="action"> >+ <input type="submit" value="Submit" /> >+ </fieldset> >+ </form> >+</div> >+ >+[% ELSIF displayonboarding == "label" %] >+<div id="onboardingModal"> >+ <form name="input" action="/cgi-bin/koha/labels/label-edit-layout.pl" method="get"> >+ <fieldset class="rows"> >+ <legend>[% IF ( layout_id ) %]Edit[% ELSE %]Create[% END %] label layout</legend> >+ <ol> >+ <li> >+ <label for="layout_name">Layout name: </label> >+ <input type="text" name="layout_name" id="layout_name" size="20" value="DEFAULT" /> >+ </li> >+ <li> >+ <label for="barcode_type">Choose barcode type (encoding): </label> >+ <select name="barcode_type" id="barcode_type"> >+ [% FOREACH barcode_type IN barcode_types %] >+ [% IF ( barcode_type.selected ) %] >+ <option value="[% barcode_type.type %]" selected="selected">[% barcode_type.name %]</option> >+ [% ELSE %] >+ <option value="[% barcode_type. type %]">[% barcode_type.name %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ </li> >+ <li> >+ <label for="printing_type">Choose layout type: </label> >+ <select name="printing_type" id="printing_type"> >+ [% FOREACH label_type IN label_types %] >+ [% IF ( label_type.selected ) %] >+ <option value="[% label_type.type %]" selected="selected">[% PROCESS translate_label_types type=label_type.type %]</option> >+ [% ELSE %] >+ <option value="[% label_type.type %]">[% PROCESS translate_label_types type=label_type.type %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ </li> >+ <li> >+ <fieldset> >+ <legend>Bibliographic data to print</legend> >+ <ol> >+ <li class="radio">[% IF ( layout_string ) %] >+ <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> >+ [% ELSE %] >+ <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> >+ [% END %] >+ <div id="layout_table"> >+ <p> >+ [% FOREACH text_field IN fields %] >+ <select name="[% text_field.field_name %]" id="[% text_field.field_name |url %]"> >+ <option value=""></option> >+ [% FOREACH orde IN [1..field_count] %] >+ [% IF ( orde == text_field.order ) %] >+ <option value="[% orde %]" selected="1">[% orde %]</option> >+ [% ELSE %] >+ <option value="[% orde %]">[% orde %]</option> >+ [% END %] >+ [% END %] >+ </select> <label for="[% text_field.field_name |url %]">[% text_field.field_label %]</label> >+ >+ [% END %] >+ </p> >+ </div> >+ </fieldset> >+ </li> >+ <li> >+ <label for="guidebox">Draw guide boxes: </label> >+ [% IF ( guidebox ) %] >+ <input type="checkbox" name="guidebox" id="guidebox" value="1" checked="checked" /> >+ [% ELSE %] >+ <input type="checkbox" name="guidebox" id="guidebox" value="1" /> >+ [% END %] >+ </li> >+ <li> >+ <label for="callnum_split">Split call numbers: </label> >+ [% IF ( callnum_split ) %] >+ <input type="checkbox" name="callnum_split" id="callnum_split" value="1" checked="checked" /> >+ [% ELSE %] >+ <input type="checkbox" name="callnum_split" id="callnum_split" value="1" /> >+ [% END %] >+ </li> >+ <li> >+ <label for="text_justify">Text justification: </label> >+ <select name="text_justify" id="text_justify"> >+ [% FOREACH text_justification_type IN text_justification_types %] >+ [% IF ( text_justification_type.selected ) %] >+ <option value="[% text_justification_type.type %]" selected="selected">[% PROCESS translate_justification_types type=text_justification_type.type %]</option> >+ [% ELSE %] >+ <option value="[% text_justification_type.type %]">[% PROCESS translate_justification_types type=text_justification_type.type %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ </li> >+ <li> >+ <label for="font">Font: </label> >+ <select name="font" id="font"> >+ [% FOREACH font_type IN font_types %] >+ [% IF ( font_type.selected ) %] >+ <option value="[% font_type.type %]" selected="selected">[% font_type.name %]</option> >+ [% ELSE %] >+ <option value="[% font_type.type %]">[% font_type.name %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ </li> >+ <li> >+ <label for="font_size">Font size: </label> >+ <input type="text" name="font_size" id="font_size" size="2" value="3" /> >+ </li> >+ <li> >+ <label for="oblique_title">Oblique title: </label> >+ [% IF ( oblique_title ) %] >+ <input type="checkbox" name="oblique_title" id="oblique_title" value="1" checked="checked" /> >+ [% ELSE %] >+ <input type="checkbox" name="oblique_title" id="oblique_title" value="1" /> >+ [% END %] >+ </li> >+ </ol> >+ </fielset> >+ <fieldset class="action"> >+ <input type="submit" value="Save" /> >+ <a class="cancel" href="/cgi-bin/koha/labels/label-manage.pl?label_element=layout">Cancel</a> >+ <input type="hidden" name="op" value="save" /> >+ <input type="hidden" name="layout_id" value="[% layout_id %]" /> >+ <input type="hidden" name="layoutsubmitted" value=1 /> >+ </fieldset> >+ </form> >+</div> >+[% 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..da4304b >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude2.inc >@@ -0,0 +1,162 @@ >+<style type="text/css"> >+ #onboardingModal{ >+ background-color:#EDF4F6; >+ } >+</style> >+<div id="onboardingModal"> >+ [% IF displayonboarding == "acquisitions" %] >+ <h2> Acquisition onboarding wizard</h2> >+ <p> Create a budget which is the highest level value in acquisitions accountancy. <br> >+ After creating this budget you will be prompted to create a fund which is what you will use to set up orders. >+ </p> >+ <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> >+ <h3> Create a budget</h3> >+ <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="3"/> >+ <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="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_active">Make budget active: </label> >+ <input type="checkbox" checked="checked" id="budget_period_active" name="budget_period_active" value="1" /> >+ </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> >+ [% ELSIF displayonboarding == "label" %] >+ <form name="input" action="/cgi-bin/koha/labels/label-edit-template.pl" method="get"> >+ <fieldset class="rows"> >+ <ol> >+ <li> >+ <span class="label">Template ID:</span>[% IF ( template_id ) %][% template_id %][% ELSE %]N/A[% END %] >+ </li> >+ <li> >+ <label for="template_code">Template code:</label> >+ <input type="text" size="30" maxlength="43" name="template_code" id="template_code" value="DEFAULT TEMPLATE"/> >+ </li> >+ <li> >+ <label for="template_desc">Template description:</label> >+ <textarea cols="30" rows="3" id="template_desc" name="template_desc">Default description</textarea> >+ </li> >+ <li> >+ <label for="units">Units:</label> >+ <select id="units" name="units"> >+ [% FOREACH unit IN units %] >+ [% IF ( unit.selected ) %] >+ <option value="[% unit.type %]" selected="selected"> >+ [% ELSE %] >+ <option value="[% unit.type %]"> >+ [% END %] >+ [% unit.desc %] >+ </option> >+ [% END %] >+ </select> >+ </li> >+ <li> >+ <label for="page_height">Page height:</label> >+ <input type="text" size="4" name="page_height" id="page_height" value="[% page_height %]" /> >+ </li> >+ <li> >+ <label for="page_width">Page width:</label> >+ <input type="text" size="4" name="page_width" id="page_width" value="[% page_width %]" /> >+ </li> >+ <li> >+ <label for="label_width">Label width:</label> >+ <input type="text" size="4" name="label_width" id="label_width" value="[% label_width %]" /> >+ </li> >+ <li> >+ <label for="label_height">Label height:</label> >+ <input type="text" size="4" name="label_height" id="label_height" value="[% label_height %]" /> >+ </li> >+ </ol> >+ </fieldset> >+ <fieldset class="rows"> >+ <ol><li> >+ <label for="top_margin">Top page margin:</label> >+ <input type="text" size="4" name="top_margin" id="top_margin" value="[% top_margin %]" /> >+ </li> >+ <li> >+ <label for="left_margin">Left page margin:</label> >+ <input type="text" size="4" name="left_margin" id="left_margin" value="[% left_margin %]" /> >+ </li> >+ <li> >+ <label for="top_text_margin">Top text margin:</label> >+ <input type="text" size="4" name="top_text_margin" id="top_text_margin" value="[% top_text_margin %]" /> >+ </li> >+ <li> >+ <label for="left_text_margin">Left text margin:</label> >+ <input type="text" size="4" name="left_text_margin" id="left_text_margin" value="[% left_text_margin %]" /> >+ </li> >+ <li> >+ <label for="cols">Number of columns:</label> >+ <input type="text" size="4" name="cols" id="cols" value="[% cols %]" /> >+ </li> >+ <li> >+ <label for="rows">Number of rows:</label> >+ <input type="text" size="4" name="rows" id="rows" value="[% rows %]" /> >+ </li> >+ <li> >+ <label for="col_gap">Gap between columns:</label> >+ <input type="text" size="4" name="col_gap" id="col_gap" value="[% col_gap %]" /> >+ </li> >+ <li> >+ <label for="row_gap">Gap between rows:</label> >+ <input type="text" size="4" name="row_gap" id="row_gap" value="[% row_gap %]" /> >+ </li> >+ >+ <li> >+ <label for="profile_id">Profile:</label> >+ [% IF ( profile_list ) %] >+ <select id="profile_id" name="profile_id"> >+ [% FOREACH profile_lis IN profile_list %] >+ [% IF ( profile_lis.selected ) %] >+ <option value="[% profile_lis.profile_id %]" selected="selected"> >+ [% ELSE %] >+ <option value="[% profile_lis.profile_id %]"> >+ [% END %] >+ [% profile_lis.printer_name %]/[% profile_lis.paper_bin %] >+ </option> >+ [% END %] >+ </select> >+ [% ELSE %] >+ <a href="/cgi-bin/koha/labels/label-edit-profile.pl?op=new">Click here to define a printer profile.</a> >+ [% END %] >+ </li> >+ </ol> >+ <input type="submit" class="submit" value="Save" /><a class="cancel" href="/cgi-bin/koha/labels/label-manage.pl?label_element=template">Cancel</a> >+ <input type="hidden" name="op" value="save" /> >+ [% IF ( template_id ) %] >+ <input type="hidden" name="template_id" value="[% template_id %]" /> >+ [% END %] >+ </fieldset> >+</form> >+[% END %] >+</div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude3.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude3.inc >new file mode 100644 >index 0000000..6097fcf >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude3.inc >@@ -0,0 +1,75 @@ >+<style type="text/css"> >+ #onboardingModal{ >+ z-index:1; >+ background-color:#EDF4F6; >+ padding:20px; >+ width:70%; >+ position:fixed; >+ left:auto; >+ top:auto; >+ right:auto; >+ bottom:auto; >+} >+</style> >+ >+<div id="onboardingModal"> >+ [% IF displayonboarding == "label" %] >+ <h2> Acquisition onboarding wizard</h2> >+ <p> Fill out this form to create a fund which will be assigned to the budget you just created. <br> >+ A fund is an accounting value you will use to set up orders</p> >+ <br> >+ <h3> Create a fund</h3> >+ <form action="/cgi-bin/koha/admin/aqbudgets.pl" id="edit_fund" name="Aform" method="post"> >+ <input type="hidden" name="op" value="add_validate" /> >+ <input type="hidden" name="checked" value="0" /> >+ <input type="hidden" name="fundcreation" value="onboarding" /> >+ <input type="hidden" name="step" value="4" /> >+ [% IF ( budget_id ) %] >+ <input type="hidden" name="budget_id" value="[% budget_id %]" /> >+ [% END %] >+ [% budget_id %] >+ >+ <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> >+ <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" /> >+ <input type="hidden" name="budget_period_id" value="1" /> >+ </fieldset> >+ </form> >+[% END %] >+</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 f64a60b..70bcd09 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,19 +1,28 @@ > [% USE Price %] > [% USE Branches %] >+[% USE Koha %] >+[% USE KohaDates %] >+[% USE Branches %] >+ > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Acquisitions</title> > [% INCLUDE 'doc-head-close.inc' %] > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> >+ > [% INCLUDE 'datatables.inc' %] > <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[ > > dt_overwrite_html_sorting_localeCompare(); > > $(document).ready(function() { >+ $("#aqhelp").hide(); > > var oTable = $("#accounts").dataTable($.extend(true, {}, dataTablesDefaults, { > "fnDrawCallback": function ( oSettings ) { >@@ -80,6 +89,10 @@ $(document).ready(function() { > }); > $("#hide_inactive").click(); > >+ $("#show").click(function(){ >+ $("#aqhelp").show(); >+ }); >+ > }); > //]]> > </script> >@@ -98,15 +111,21 @@ $(document).ready(function() { > <div class="yui-b"> > > [% INCLUDE 'acquisitions-toolbar.inc' %] >- >-<h1>Acquisitions</h1> >- [% INCLUDE 'budgets-active-currency.inc' hide = 'yes' %] > [% UNLESS ( loop_budget ) %] > [% IF ( CAN_user_acquisition_period_manage ) %] >- <div class="dialog alert"><a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">You must define a budget in Administration</a></div> >+ [% displayonboarding = "acquisitions" %] >+ [% IF step == 1 %] >+ [% INCLUDE onboardinginclude1.inc %] >+ [% ELSIF step == 2 %] >+ [% INCLUDE onboardinginclude2.inc %] >+ [% ELSIF step == 3 %] >+ [% INCLUDE onboardinginclude3.inc %] >+ [% END %] > [% ELSE %] > <div class="dialog alert">Your administrator must define a budget in Administration</div> > [% END %] >+ [% ELSE %] >+ <h1>Acquisitions</h1> > [% END %] > <div class="yui-g"> > <div class="yui-u first"> >@@ -237,6 +256,27 @@ $(document).ready(function() { > </div> > [% END %] > >+ <button type="button" id="show" onclick"unhide(aqhelp)">Show the next steps to set up Acquisitions</button> >+ <br><br> >+ <div id="aqhelp"> >+ <h1> Next steps</h1> >+ <h2> 1. Create your first vendor</h2> >+ <p> A vendor is the organisation your institution purchases items from i.e. suppliers<br> >+ You must create a vendor before you can create any orders</p> >+ <b>Click <a href="/cgi-bin/koha/acqui/supplier.pl?op=enter">here</a> to create a vendor.</b> >+ <br><br> >+ <h2> 2. Create your first basket</h2> >+ <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> >+ <b> To create a basket, click the 'New basket' button on the Vendor Information page which is displayed after you create a vendor</b> >+ <br><br> >+ <h2> 3. Create an order</h2> >+ <p> An order is a assignment of items purchased from a single vendor at a single time</p> >+ 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. >+ </p> >+ <br><br> >+ For further information about creating a vendor, basket and order go to the Koha manual: >+ <a href="http://translate.koha-community.org/manual/master/en/html/09_acquisitions.html"> Koha manual Acquisitions section</a> >+ </div> > </div> > </div> > <div class="yui-b"> >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 76f0701..acf8b97 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..87350c2 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 >@@ -464,6 +464,7 @@ var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") > > <input type="hidden" name="op" value="add_validate" /> > <input type="hidden" name="checked" value="0" /> >+ <input type="hidden" name="fundcreation" value="aqform" /> > <ol> > [% IF ( budget_parent_id ) %] > <li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-home.tt >index f5e7725..c20ccce 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-home.tt >@@ -20,7 +20,13 @@ > <div class="yui-g"> > [% INCLUDE 'labels-toolbar.inc' %] > <div class="yui-u first"> >- >+ [% IF !(layoutvalue) %] >+ [% displayonboarding = "label" %] >+ [% INCLUDE 'onboardinginclude1.inc' %] >+ [% ELSIF !(templatevalue) %] >+ [% displayonboarding = "label" %] >+ [% INCLUDE 'onboardinginclude2.inc' %] >+ [% END %] > </div> > </div> > </div> >diff --git a/labels/label-edit-layout.pl b/labels/label-edit-layout.pl >index c1aafd4..8ee664c 100755 >--- a/labels/label-edit-layout.pl >+++ b/labels/label-edit-layout.pl >@@ -123,20 +123,32 @@ elsif ($op eq 'save') { > $layout = C4::Labels::Layout->new(@params); > $layout_id = $layout->save(); > } >- print $cgi->redirect("label-manage.pl?label_element=layout" . ($layout_id == -1 ? "&element_id=$layout_id&op=$op&error=1" : '')); >- exit; >+ >+ my $layoutvalue = C4::Creators::Layout->retrieve_all(); >+ my $templatecount = C4::Creators::Template->retrieve_all(); >+ $template->param( layoutvalue => $layoutvalue, >+ templatevalue => $templatecount, >+ ); >+ >+ if ($templatecount == 0) { >+ print $cgi->redirect("/cgi-bin/koha/labels/label-home.pl"); >+ exit; >+ } else { >+ print $cgi->redirect("label-manage.pl?label_element=layout" . ($layout_id == -1 ? "&element_id=$layout_id&op=$op&error=1" : '')); >+ exit; >+ } > } > else { # if we get here, this is a new layout > $layout = C4::Labels::Layout->new(); > } > >-my $barcode_types = _set_selected(get_barcode_types(), $layout, 'barcode_type'); >-my $label_types = _set_selected(get_label_types(), $layout, 'printing_type'); >-my $font_types = _set_selected(get_font_types(), $layout, 'font'); >-my $text_justification_types = _set_selected(get_text_justification_types(), $layout, 'text_justify'); >-my ($select_text_fields, $select_text_fields_cnt) = _select_format_string($layout->get_attr('format_string')); >+ my $barcode_types = _set_selected(get_barcode_types(), $layout, 'barcode_type'); >+ my $label_types = _set_selected(get_label_types(), $layout, 'printing_type'); >+ my $font_types = _set_selected(get_font_types(), $layout, 'font'); >+ my $text_justification_types = _set_selected(get_text_justification_types(), $layout, 'text_justify'); >+ my ($select_text_fields, $select_text_fields_cnt) = _select_format_string($layout->get_attr('format_string')); > >-$template->param( >+ $template->param( > barcode_types => $barcode_types, > label_types => $label_types, > font_types => $font_types, >@@ -151,5 +163,6 @@ $template->param( > callnum_split => $layout->get_attr('callnum_split'), > format_string => $layout->get_attr('format_string'), > layout_string => 1, # FIXME: This should not be hard-coded; It should perhaps be yet another syspref... CN >-); >+ ); >+ > output_html_with_http_headers $cgi, $cookie, $template->output; >diff --git a/labels/label-edit-template.pl b/labels/label-edit-template.pl >index bcee714..d7d891b 100755 >--- a/labels/label-edit-template.pl >+++ b/labels/label-edit-template.pl >@@ -111,8 +111,15 @@ elsif ($op eq 'save') { > $profile->save(); > } > } >- print $cgi->redirect("label-manage.pl?label_element=template"); >- exit; >+ >+ my $profilevalue = C4::Creators::Profile->retrieve_all(); >+ if ($profilevalue == 0) { >+ print $cgi->redirect("label-edit-profile.pl"); >+ exit; >+ }else{ >+ print $cgi->redirect("/cgi-bin/koha/labels/label-home.pl"); >+ exit; >+ } > } > else { # if we get here, this is a new layout > $label_template = C4::Labels::Template->new(); >diff --git a/labels/label-home.pl b/labels/label-home.pl >index ca581ac..4c5645b 100755 >--- a/labels/label-home.pl >+++ b/labels/label-home.pl >@@ -22,9 +22,14 @@ use strict; > use warnings; > > use CGI qw ( -utf8 ); >+use POSIX; > > use C4::Auth qw(get_template_and_user); > use C4::Output qw(output_html_with_http_headers); >+use C4::Creators::Layout; >+use C4::Creators::Template; >+use C4::Creators; >+use C4::Labels; > > my $cgi = new CGI; > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >@@ -38,4 +43,69 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > } > ); > >+my $op = $cgi->param('op') || ''; >+my $layout_id = $cgi->param('layout_id') || $cgi->param('element_id') || ''; >+my $layout_choice = $cgi->param('layout_choice') || ''; >+my $layout = C4::Labels::Layout->new(); >+ >+sub _set_selected { >+ my ($type_list, $object, $data_type) = @_; >+ SET_SELECTED: >+ foreach my $type (@$type_list) { >+ if ($layout->get_attr($data_type)) { >+ if ($type->{'type'} eq $layout->get_attr($data_type)) { >+ $type->{'selected'} = 1; >+ } >+ } >+ else { >+ $type->{'selected'} = 1; >+ last SET_SELECTED; >+ } >+}; >+return $type_list; >+} >+ >+sub _select_format_string { # generate field table based on format_string >+ my $format_string = shift; >+ >+ my @text_fields = grep /\w/, split /\s*,\s/, $format_string; >+ my %tf = map {$_ => 1} @text_fields; >+ my @missing_fields = grep { !$tf{$_} } @{ C4::Labels::Layout->PRESET_FIELDS }; >+ my $field_count = scalar(@text_fields) + scalar( @missing_fields); >+ >+ my @fields; >+ my $field_index = 1; >+ foreach my $f (@text_fields) { >+ push @fields, {field_name => ($f . "_tbl"), field_label => $f, order => $field_index}; >+ $field_index++; >+ } >+ foreach my $f (@missing_fields) { >+ push @fields, {field_name => ($f . "_tbl"), field_label => $f}; >+ } >+ return (\@fields, $field_count); >+} >+ >+my $barcode_types = _set_selected(get_barcode_types(), $layout, 'barcode_type'); >+my $label_types = _set_selected(get_label_types(), $layout, 'printing_type'); >+my $font_types = _set_selected(get_font_types(), $layout, 'font'); >+my $text_justification_types = _set_selected(get_text_justification_types(), $layout, 'text_justify'); >+my ($select_text_fields, $select_text_fields_cnt) = _select_format_string($layout->get_attr('format_string')); >+my $units = get_unit_values(); >+ >+$template->param( >+ barcode_types => $barcode_types, >+ label_types => $label_types, >+ font_types => $font_types, >+ text_justification_types => $text_justification_types, >+ fields => $select_text_fields, >+ field_count => $select_text_fields_cnt, >+ units => $units, >+); >+ >+my $layoutvalue = C4::Creators::Layout->retrieve_all(); >+my $templatevalue = C4::Creators::Template->retrieve_all(); >+$template->param( layoutvalue => $layoutvalue, >+ templatevalue => $templatevalue, >+); >+ > output_html_with_http_headers $cgi, $cookie, $template->output; >-- >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 18060
:
63224
|
63225
|
63228
|
63229
|
63587
|
63588
|
63589
|
64733
|
64766
|
64951
|
67663