+
+my @authorised_value_list;
+my $authorisedvalue_categories;
+
+my $dbh=C4::Context->dbh;
+my $rqauthcategorie=$dbh->prepare("select authorised_value from marc_subfield_structure where frameworkcode=? and kohafield='items.location'");
+my $rq=$dbh->prepare("select frameworkcode from biblio_framework");
+$rq->execute;
+while (my ($fwkcode)=$rq->fetchrow){
+ $rqauthcategorie->execute($fwkcode);
+ while (my ($authcat)=$rqauthcategorie->fetchrow){
+ if ($authcat && $authorisedvalue_categories!~/\b$authcat\W/){
+ $authorisedvalue_categories.="$authcat ";
+ my $data=GetAuthorisedValues($authcat);
+ foreach my $value (@$data){
+ $value->{selected}=1 if ($value->{authorised_value} eq ($location));
+ }
+ push @authorised_value_list,@$data;
+ }
+ }
+}
+
+
+