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

(-)a/C4/Items.pm (-3 / +3 lines)
Lines 2839-2853 sub ToggleNewStatus { Link Here
2839
        if ( defined $age ) {
2839
        if ( defined $age ) {
2840
            # Calculate item age based on hours since item last altered
2840
            # Calculate item age based on hours since item last altered
2841
            if ( defined $rule && defined $age_starting_point && $unit eq "hours" && $age_starting_point eq "itemaltered" ) {
2841
            if ( defined $rule && defined $age_starting_point && $unit eq "hours" && $age_starting_point eq "itemaltered" ) {
2842
                $query .= q| AND HOUR(TIMEDIFF(NOW(), timestamp)) >= ? |;
2842
                $query .= q| AND HOUR(TIMEDIFF(NOW(), items.timestamp)) >= ? |;
2843
                push @params, $age;
2843
                push @params, $age;
2844
            } elsif ( defined $rule && defined $age_starting_point && $unit eq "days" && $age_starting_point eq "itemaltered" ) {
2844
            } elsif ( defined $rule && defined $age_starting_point && $unit eq "days" && $age_starting_point eq "itemaltered" ) {
2845
            # Calculate item age based on days since item last altered
2845
            # Calculate item age based on days since item last altered
2846
                $query .= q| AND TO_DAYS(NOW()) - TO_DAYS(timestamp) >= ? |;
2846
                $query .= q| AND TO_DAYS(NOW()) - TO_DAYS(items.timestamp) >= ? |;
2847
                push @params, $age;
2847
                push @params, $age;
2848
            } else {
2848
            } else {
2849
            # Calculate item age based on days since item was created 
2849
            # Calculate item age based on days since item was created 
2850
                $query .= q| AND TO_DAYS(NOW()) - TO_DAYS(dateaccessioned) >= ? |;
2850
                $query .= q| AND TO_DAYS(NOW()) - TO_DAYS(items.dateaccessioned) >= ? |;
2851
                push @params, $age;
2851
                push @params, $age;
2852
            }
2852
            }
2853
        }
2853
        }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/automatic_item_modification_by_age.tt (-2 / +1 lines)
Lines 163-169 Link Here
163
            </div>
163
            </div>
164
            <div>
164
            <div>
165
              <h5>Unit</h5>
165
              <h5>Unit</h5>
166
              <p>Note: If the unit of 'Hours' is set then you cannot choose an age starting point, the item age starting point wil     default to the last item alteration event. The Age starting point selection will be hidden if you have set the unit to 'Hours'.</p>
166
              <p>Note: If the unit of 'Hours' is set then you cannot choose an age starting point, the item age starting point will default to the last item alteration event. The Age starting point selection will be hidden if you have set the unit to 'Hours'.</p>
167
              <select id="new_rule_unit" name="unit" />
167
              <select id="new_rule_unit" name="unit" />
168
               <option value="">Choose an age unit</option>
168
               <option value="">Choose an age unit</option>
169
               <option id="hours" value="hours">Hours</option>
169
               <option id="hours" value="hours">Hours</option>
170
- 

Return to bug 21173