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

(-)a/installer/data/mysql/kohastructure.sql (-2 / +2 lines)
Lines 946-952 CREATE TABLE `deleteditems` ( Link Here
946
  `enumchron` text default NULL, -- serial enumeration/chronology for the item (MARC21 952$h)
946
  `enumchron` text default NULL, -- serial enumeration/chronology for the item (MARC21 952$h)
947
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
947
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
948
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
948
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
949
  `new` VARCHAR(32) DEFAULT NULL, -- 'new' value, you can put whatever free-text information. This field is intented to be managed by the toggle_new_status cronjob.
949
  `new` VARCHAR(32) DEFAULT NULL, -- 'new' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.
950
  PRIMARY KEY  (`itemnumber`),
950
  PRIMARY KEY  (`itemnumber`),
951
  KEY `delitembarcodeidx` (`barcode`),
951
  KEY `delitembarcodeidx` (`barcode`),
952
  KEY `delitemstocknumberidx` (`stocknumber`),
952
  KEY `delitemstocknumberidx` (`stocknumber`),
Lines 1246-1252 CREATE TABLE `items` ( -- holdings/item information Link Here
1246
  `enumchron` text default NULL, -- serial enumeration/chronology for the item (MARC21 952$h)
1246
  `enumchron` text default NULL, -- serial enumeration/chronology for the item (MARC21 952$h)
1247
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
1247
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
1248
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
1248
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
1249
  `new` VARCHAR(32) DEFAULT NULL, -- 'new' value, you can put whatever free-text information. This field is intended to be managed by the toggle_new_status cronjob.
1249
  `new` VARCHAR(32) DEFAULT NULL, -- 'new' value, you can put whatever free-text information. This field is intended to be managed by the automatic_item_modification_by_age cronjob.
1250
  PRIMARY KEY  (`itemnumber`),
1250
  PRIMARY KEY  (`itemnumber`),
1251
  UNIQUE KEY `itembarcodeidx` (`barcode`),
1251
  UNIQUE KEY `itembarcodeidx` (`barcode`),
1252
  KEY `itemstocknumberidx` (`stocknumber`),
1252
  KEY `itemstocknumberidx` (`stocknumber`),
(-)a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css (-1 / +1 lines)
Lines 2759-2765 span.onsite_checkout { Link Here
2759
    border : 1px solid #FFF2CE;
2759
    border : 1px solid #FFF2CE;
2760
}
2760
}
2761
2761
2762
/* Tools > toggle_new_status */
2762
/* Tools > automatic_item_modification_by_age */
2763
div.rules {
2763
div.rules {
2764
    display: block;
2764
    display: block;
2765
}
2765
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/toggle_new_status.tt (-1 / +1 lines)
Lines 38-44 Link Here
38
</ul>
38
</ul>
39
39
40
<h3>How to execute the cronjob script?</h3>
40
<h3>How to execute the cronjob script?</h3>
41
<p>The cronjob script is misc/cronjobs/toggle_new_status.pl.</p>
41
<p>The cronjob script is misc/cronjobs/automatic_item_modification_by_age.pl.</p>
42
<p>Try the -h parameter in order to see the help.</p>
42
<p>Try the -h parameter in order to see the help.</p>
43
<p>Without any parameter, the script will be launched in a dry-run mode. If the -c (or --confirm) flag is given, the script will apply the changes.</p>
43
<p>Without any parameter, the script will be launched in a dry-run mode. If the -c (or --confirm) flag is given, the script will apply the changes.</p>
44
44
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/toggle_new_status.tt (-5 / +5 lines)
Lines 113-122 Link Here
113
//]]>
113
//]]>
114
</script>
114
</script>
115
</head>
115
</head>
116
<body id="tools_toggle_new_status" class="tools">
116
<body id="tools_automatic_item_modification_by_age" class="tools">
117
[% INCLUDE 'header.inc' %]
117
[% INCLUDE 'header.inc' %]
118
[% INCLUDE 'cat-search.inc' %]
118
[% INCLUDE 'cat-search.inc' %]
119
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; <a href="/cgi-bin/koha/tools/toggle_new_status.pl">Automatic item modifications by age</a></div>
119
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; <a href="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl">Automatic item modifications by age</a></div>
120
120
121
<div id="doc3" class="yui-t2">
121
<div id="doc3" class="yui-t2">
122
  <div id="bd">
122
  <div id="bd">
Lines 124-130 Link Here
124
      <div class="yui-b">
124
      <div class="yui-b">
125
        <h3>Automatic item modifications by age</h3>
125
        <h3>Automatic item modifications by age</h3>
126
        <div id="toolbar" class="btn-toolbar">
126
        <div id="toolbar" class="btn-toolbar">
127
          <a class="btn btn-small" id="newentry" href="/cgi-bin/koha/tools/toggle_new_status.pl?op=edit_form"><i class="icon-plus"></i> Edit</a>
127
          <a class="btn btn-small" id="newentry" href="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl?op=edit_form"><i class="icon-plus"></i> Edit</a>
128
        </div>
128
        </div>
129
        [% FOR message IN messages %]
129
        [% FOR message IN messages %]
130
          [% IF message.type == "error" %]
130
          [% IF message.type == "error" %]
Lines 137-143 Link Here
137
        [% END %]
137
        [% END %]
138
138
139
        [% IF op == 'edit_form' %]
139
        [% IF op == 'edit_form' %]
140
          <form method="post" action="/cgi-bin/koha/tools/toggle_new_status.pl">
140
          <form method="post" action="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl">
141
            <div id="edit_rules">
141
            <div id="edit_rules">
142
              <h4>List of rules</h4>
142
              <h4>List of rules</h4>
143
                <div id="rules">
143
                <div id="rules">
Lines 200-206 Link Here
200
                </div>
200
                </div>
201
              <fieldset class="action">
201
              <fieldset class="action">
202
                <input type="hidden" name="op" value="update" />
202
                <input type="hidden" name="op" value="update" />
203
                <a class="cancel" href="/cgi-bin/koha/tools/toggle_new_status.pl">Cancel</a>
203
                <a class="cancel" href="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl">Cancel</a>
204
                <input type="submit" value="Submit theses rules" />
204
                <input type="submit" value="Submit theses rules" />
205
              </fieldset>
205
              </fieldset>
206
            </div>
206
            </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt (-1 / +1 lines)
Lines 128-134 Link Here
128
    [% END %]
128
    [% END %]
129
129
130
    [% IF ( CAN_user_tools_items_batchmod ) %]
130
    [% IF ( CAN_user_tools_items_batchmod ) %]
131
      <dt><a href="/cgi-bin/koha/tools/toggle_new_status.pl">Automatic item modifications by age</a></dt>
131
      <dt><a href="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl">Automatic item modifications by age</a></dt>
132
      <dd>Define rules to modify items by age</dd>
132
      <dd>Define rules to modify items by age</dd>
133
    [% END %]
133
    [% END %]
134
134
(-)a/misc/cronjobs/automatic_item_modification_by_age.pl (-3 / +3 lines)
Lines 21-27 pod2usage(1) if $help; Link Here
21
$verbose = 1 unless $confirm;
21
$verbose = 1 unless $confirm;
22
22
23
# Load configuration from the syspref
23
# Load configuration from the syspref
24
my $syspref_content = C4::Context->preference('toggle_new_status_configuration');
24
my $syspref_content = C4::Context->preference('automatic_item_modification_by_age_configuration');
25
my $rules = eval { JSON::from_json( $syspref_content ) };
25
my $rules = eval { JSON::from_json( $syspref_content ) };
26
pod2usage({ -message => "Unable to load the configuration : $@", -exitval => 1 })
26
pod2usage({ -message => "Unable to load the configuration : $@", -exitval => 1 })
27
    if $@;
27
    if $@;
Lines 51-61 __END__ Link Here
51
51
52
=head1 NAME
52
=head1 NAME
53
53
54
toggle_new_status.pl
54
automatic_item_modification_by_age.pl
55
55
56
=head1 SYNOPSIS
56
=head1 SYNOPSIS
57
57
58
./toggle_new_status.pl -h
58
./automatic_item_modification_by_age.pl -h
59
59
60
Toggle recent acquisitions status.
60
Toggle recent acquisitions status.
61
Use this script to delete "new" status for items.
61
Use this script to delete "new" status for items.
(-)a/tools/toggle_new_status.pl (-4 / +3 lines)
Lines 19-25 Link Here
19
19
20
=head1 NAME
20
=head1 NAME
21
21
22
toggle_new_status.pl: Update new status for items.
22
automatic_item_modification_by_age.pl: Update new status for items.
23
23
24
=cut
24
=cut
25
25
Lines 45-51 my $cgi = new CGI; Link Here
45
# open template
45
# open template
46
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
46
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
47
    {
47
    {
48
        template_name   => "tools/toggle_new_status.tt",
48
        template_name   => "tools/automatic_item_modification_by_age.tt",
49
        query           => $cgi,
49
        query           => $cgi,
50
        type            => "intranet",
50
        type            => "intranet",
51
        authnotrequired => 0,
51
        authnotrequired => 0,
Lines 55-61 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
55
55
56
my $op = $cgi->param('op') // 'show';
56
my $op = $cgi->param('op') // 'show';
57
57
58
my $syspref_name = q|toggle_new_status_configuration|;
58
my $syspref_name = q|automatic_item_modification_by_age_configuration|;
59
if ( $op eq 'update' ) {
59
if ( $op eq 'update' ) {
60
    my @rules;
60
    my @rules;
61
    my @unique_ids = $cgi->param('unique_id');
61
    my @unique_ids = $cgi->param('unique_id');
62
- 

Return to bug 11023