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

(-)a/admin/authorised_values.pl (+8 lines)
Lines 268-274 sub default_form { Link Here
268
    my $count = scalar(@$results);
268
    my $count = scalar(@$results);
269
	my @loop_data = ();
269
	my @loop_data = ();
270
	# builds value list
270
	# builds value list
271
    my $dbh = C4::Context->dbh;
272
    $sth = $dbh->prepare("SELECT b.branchcode, b.branchname FROM authorised_values_branches AS avb, branches AS b WHERE avb.branchcode = b.branchcode AND avb.av_id = ?");
271
	for (my $i=0; $i < $count; $i++){
273
	for (my $i=0; $i < $count; $i++){
274
        $sth->execute( $results->[$i]{id} );
275
        my @selected_branches;
276
        while ( my $branch = $sth->fetchrow_hashref ) {
277
            push @selected_branches, $branch;
278
        }
272
		my %row_data;  # get a fresh hash for the row data
279
		my %row_data;  # get a fresh hash for the row data
273
		$row_data{category}              = $results->[$i]{'category'};
280
		$row_data{category}              = $results->[$i]{'category'};
274
		$row_data{authorised_value}      = $results->[$i]{'authorised_value'};
281
		$row_data{authorised_value}      = $results->[$i]{'authorised_value'};
Lines 277-282 sub default_form { Link Here
277
		$row_data{imageurl}              = getitemtypeimagelocation( 'intranet', $results->[$i]{'imageurl'} );
284
		$row_data{imageurl}              = getitemtypeimagelocation( 'intranet', $results->[$i]{'imageurl'} );
278
		$row_data{edit}                  = "$script_name?op=add_form&amp;id=".$results->[$i]{'id'}."&amp;offset=$offset";
285
		$row_data{edit}                  = "$script_name?op=add_form&amp;id=".$results->[$i]{'id'}."&amp;offset=$offset";
279
		$row_data{delete}                = "$script_name?op=delete_confirm&amp;searchfield=$searchfield&amp;id=".$results->[$i]{'id'}."&amp;offset=$offset";
286
		$row_data{delete}                = "$script_name?op=delete_confirm&amp;searchfield=$searchfield&amp;id=".$results->[$i]{'id'}."&amp;offset=$offset";
287
        $row_data{branches}              = \@selected_branches;
280
		push(@loop_data, \%row_data);
288
		push(@loop_data, \%row_data);
281
	}
289
	}
282
290
(-)a/admin/categorie.pl (-1 / +10 lines)
Lines 233-239 if ($op eq 'add_form') { Link Here
233
	$template->param(else => 1);
233
	$template->param(else => 1);
234
	my @loop;
234
	my @loop;
235
	my ($count,$results)=StringSearch($searchfield,'web');
235
	my ($count,$results)=StringSearch($searchfield,'web');
236
    my $dbh = C4::Context->dbh;
237
    my $sth = $dbh->prepare("SELECT b.branchcode, b.branchname FROM categories_branches AS cb, branches AS b WHERE cb.branchcode = b.branchcode AND cb.categorycode = ?");
236
	for (my $i=0; $i < $count; $i++){
238
	for (my $i=0; $i < $count; $i++){
239
        $sth->execute( $results->[$i]{'categorycode'} );
240
        my @selected_branches;
241
        while ( my $branch = $sth->fetchrow_hashref ) {
242
            push @selected_branches, $branch;
243
        }
237
		my %row = (
244
		my %row = (
238
		        categorycode            => $results->[$i]{'categorycode'},
245
		        categorycode            => $results->[$i]{'categorycode'},
239
				description             => $results->[$i]{'description'},
246
				description             => $results->[$i]{'description'},
Lines 247-253 if ($op eq 'add_form') { Link Here
247
				reservefee              => sprintf("%.2f",$results->[$i]{'reservefee'}),
254
				reservefee              => sprintf("%.2f",$results->[$i]{'reservefee'}),
248
                                hidelostitems           => $results->[$i]{'hidelostitems'},
255
                                hidelostitems           => $results->[$i]{'hidelostitems'},
249
				category_type           => $results->[$i]{'category_type'},
256
				category_type           => $results->[$i]{'category_type'},
250
				"type_".$results->[$i]{'category_type'} => 1);
257
				"type_".$results->[$i]{'category_type'} => 1,
258
                branches                => \@selected_branches,
259
        );
251
        if (C4::Context->preference('EnhancedMessagingPreferences')) {
260
        if (C4::Context->preference('EnhancedMessagingPreferences')) {
252
            my $brief_prefs = _get_brief_messaging_prefs($results->[$i]{'categorycode'});
261
            my $brief_prefs = _get_brief_messaging_prefs($results->[$i]{'categorycode'});
253
            $row{messaging_prefs} = $brief_prefs if @$brief_prefs;
262
            $row{messaging_prefs} = $brief_prefs if @$brief_prefs;
(-)a/admin/patron-attr-types.pl (-2 / +6 lines)
Lines 293-307 sub patron_attribute_type_list { Link Here
293
293
294
    my @attributes_loop;
294
    my @attributes_loop;
295
    for my $class (@classes) {
295
    for my $class (@classes) {
296
        my @items;
296
        my ( @items, $branches );
297
        for my $attr (@attr_types) {
297
        for my $attr (@attr_types) {
298
            push @items, $attr if $attr->{class} eq $class
298
            next if $attr->{class} ne $class;
299
            my $attr_type = C4::Members::AttributeTypes->fetch($attr->{code});
300
            $attr->{branches} = $attr_type->branches;
301
            push @items, $attr;
299
        }
302
        }
300
        my $lib = GetAuthorisedValueByCode( 'PA_CLASS', $class ) || $class;
303
        my $lib = GetAuthorisedValueByCode( 'PA_CLASS', $class ) || $class;
301
        push @attributes_loop, {
304
        push @attributes_loop, {
302
            class => $class,
305
            class => $class,
303
            items => \@items,
306
            items => \@items,
304
            lib   => $lib,
307
            lib   => $lib,
308
            branches => $branches,
305
        };
309
        };
306
    }
310
    }
307
    $template->param(available_attribute_types => \@attributes_loop);
311
    $template->param(available_attribute_types => \@attributes_loop);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt (+12 lines)
Lines 249-254 Link Here
249
	<th>Description</th>
249
	<th>Description</th>
250
	<th>Description (OPAC)</th>
250
	<th>Description (OPAC)</th>
251
	<th>Icon</th>
251
	<th>Icon</th>
252
    <th>Branches limitations</th>
252
	<th>Edit</th>
253
	<th>Edit</th>
253
	<th>Delete</th>
254
	<th>Delete</th>
254
	</tr>
255
	</tr>
Lines 263-268 Link Here
263
	<td>[% loo.lib %]</td>
264
	<td>[% loo.lib %]</td>
264
	<td>[% loo.lib_opac %]</td>
265
	<td>[% loo.lib_opac %]</td>
265
	<td>[% IF ( loo.imageurl ) %]<img src="[% loo.imageurl %]" alt=""/>[% ELSE %]&nbsp;[% END %]</td>
266
	<td>[% IF ( loo.imageurl ) %]<img src="[% loo.imageurl %]" alt=""/>[% ELSE %]&nbsp;[% END %]</td>
267
    <td>
268
        [% IF loo.branches.size > 0 %]
269
            [% branches_str = "" %]
270
            [% FOREACH branch IN loo.branches %]
271
                [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
272
            [% END %]
273
            <a href="#" title="[% branches_str %]">[% loo.branches.size %] branches limitations</a>
274
        [% ELSE %]
275
            No limitation
276
        [% END %]
277
    </td>
266
	<td><a href="[% loo.edit %]">Edit</a></td>
278
	<td><a href="[% loo.edit %]">Edit</a></td>
267
	<td><a href="[% loo.delete %]">Delete</a></td>
279
	<td><a href="[% loo.delete %]">Delete</a></td>
268
</tr>
280
</tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt (+12 lines)
Lines 303-308 Confirm deletion of category [% categorycode |html %][% END %]</legend> Link Here
303
            [% IF ( EnhancedMessagingPreferences ) %]
303
            [% IF ( EnhancedMessagingPreferences ) %]
304
            <th scope="col">Messaging</th>
304
            <th scope="col">Messaging</th>
305
            [% END %]
305
            [% END %]
306
            <th scope="col">Branches limitations</th>
306
			<th scope="col" colspan="2">&nbsp; </th>
307
			<th scope="col" colspan="2">&nbsp; </th>
307
		</thead>
308
		</thead>
308
		[% FOREACH loo IN loop %]
309
		[% FOREACH loo IN loop %]
Lines 356-361 Confirm deletion of category [% categorycode |html %][% END %]</legend> Link Here
356
                            [% END %]
357
                            [% END %]
357
                        </td>
358
                        </td>
358
                        [% END %]
359
                        [% END %]
360
                        <td>
361
                            [% IF loo.branches.size > 0 %]
362
                                [% branches_str = "" %]
363
                                [% FOREACH branch IN loo.branches %]
364
                                    [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
365
                                [% END %]
366
                                <a href="#" title="[% branches_str %]">[% loo.branches.size %] branches limitations</a>
367
                            [% ELSE %]
368
                                No limitation
369
                            [% END %]
370
                        </td>
359
                        <td><a href="[% loo.script_name %]?op=add_form&amp;categorycode=[% loo.categorycode |url %]">Edit</a></td>
371
                        <td><a href="[% loo.script_name %]?op=add_form&amp;categorycode=[% loo.categorycode |url %]">Edit</a></td>
360
						<td><a href="[% loo.script_name %]?op=delete_confirm&amp;categorycode=[% loo.categorycode |url %]">Delete</a></td>
372
						<td><a href="[% loo.script_name %]?op=delete_confirm&amp;categorycode=[% loo.categorycode |url %]">Delete</a></td>
361
		</tr>
373
		</tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt (-1 / +12 lines)
Lines 306-311 function CheckAttributeTypeForm(f) { Link Here
306
          <th>Code</th>
306
          <th>Code</th>
307
          <th>Description</th>
307
          <th>Description</th>
308
          <th>Actions</th>
308
          <th>Actions</th>
309
          <th>Branches limitation</th>
309
        </tr>
310
        </tr>
310
      </thead>
311
      </thead>
311
      <tbody>
312
      <tbody>
Lines 314-319 function CheckAttributeTypeForm(f) { Link Here
314
            <td>[% item.code |html %]</td>
315
            <td>[% item.code |html %]</td>
315
            <td>[% item.description %]</td>
316
            <td>[% item.description %]</td>
316
            <td>
317
            <td>
318
                [% IF item.branches > 0 %]
319
                    [% branches_str = "" %]
320
                    [% FOREACH branch IN item.branches %]
321
                        [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
322
                    [% END %]
323
                    <a href="#" title="[% branches_str %]">[% item.branches.size %] branches limitations</a>
324
                [% ELSE %]
325
                    No limitation
326
                [% END %]
327
            </td>
328
            <td>
317
              <a href="[% item.script_name %]?op=edit_attribute_type&amp;code=[% item.code |html %]">Edit</a>
329
              <a href="[% item.script_name %]?op=edit_attribute_type&amp;code=[% item.code |html %]">Edit</a>
318
              <a href="[% item.script_name %]?op=delete_attribute_type&amp;code=[% item.code |html %]">Delete</a>
330
              <a href="[% item.script_name %]?op=delete_attribute_type&amp;code=[% item.code |html %]">Delete</a>
319
            </td>
331
            </td>
320
- 

Return to bug 7919