# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
use strict;
+#use warnings; FIXME - Bug 2505
use C4::Output;
use C4::Auth;
use CGI;
query => $input,
type => "intranet",
authnotrequired => 0,
- flagsrequired => { parameters => 1 },
+ flagsrequired => { parameters => 'parameters_remaining_permissions' },
debug => 1,
}
);
while ($data =$sth->fetchrow_hashref) {
my %row_data; # get a fresh hash for the row data
- $row_data{tab} = CGI::scrolling_list(-name=>'tab',
- -id=>"tab$i",
- -values =>
- [ '-1', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10' ],
- -labels => {
- '-1' => 'ignore',
- '0' => '0',
- '1' => '1',
- '2' => '2',
- '3' => '3',
- '4' => '4',
- '5' => '5',
- '6' => '6',
- '7' => '7',
- '8' => '8',
- '9' => '9',
- },
- -default=>$data->{'tab'},
- -size=>1,
- -tabindex=>'',
- -multiple=>0,
- );
- $row_data{ohidden} = CGI::scrolling_list(-name=>'ohidden',
- -id=>"ohidden$i",
- #-values=>['0','1','2'],
- #-labels => {'0'=>'Show','1'=>'Show Collapsed',
- # '2' =>'Hide',
- # },
- -values=>['0','-5'],
- -labels => {'0'=>'Show All','-5'=>'Hide All',},
- -default=>$data->{'hidden'},
- #-default=>"-5",
- -size=>1,
- -multiple=>0,
- );
+ $row_data{defaultvalue} = $data->{defaultvalue};
+ $row_data{tab} = {
+ id => "tab$i",
+ default => $data->{'tab'},
+ };
+ $row_data{ohidden} = {
+ id => "ohidden$i",
+ default => $data->{'hidden'}
+ };
#$row_data{ihidden} = CGI::scrolling_list(-name=>'ihidden',
# -id=>"ihidden$i",
# -values=>['0','1','2'],
$row_data{row} = $i;
push(@loop_data, \%row_data);
}
- $template->param('use-heading-flags-p' => 1);
- $template->param('heading-edit-subfields-p' => 1);
+ $template->param('use_heading_flags_p' => 1);
+ $template->param('heading_edit_subfields_p' => 1);
$template->param(action => "Edit subfields",
tagfield => $tagfield,
tagfieldinput => "<input type=\"hidden\" name=\"tagfield\" value=\"$tagfield\" />",
$template->param(tagfield => "$input->param('tagfield')");
# my $sth=$dbh->prepare("replace auth_subfield_structure (authtypecode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,frameworkcode,value_builder,hidden,isurl)
# values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
- my $sth_insert = $dbh->prepare("insert into auth_subfield_structure (authtypecode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,frameworkcode,value_builder,hidden,isurl)
- values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
- my $sth_update = $dbh->prepare("update auth_subfield_structure set authtypecode=?, tagfield=?, tagsubfield=?, liblibrarian=?, libopac=?, repeatable=?, mandatory=?, kohafield=?, tab=?, seealso=?, authorised_value=?, frameworkcode=?, value_builder=?, hidden=?, isurl=?
- where authtypecode=? and tagfield=? and tagsubfield=?");
+ my $sth_insert = $dbh->prepare("insert into auth_subfield_structure (authtypecode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,frameworkcode,value_builder,hidden,isurl,defaultvalue)
+ values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
+ my $sth_update = $dbh->prepare("update auth_subfield_structure set authtypecode=?, tagfield=?, tagsubfield=?, liblibrarian=?, libopac=?, repeatable=?, mandatory=?, kohafield=?, tab=?, seealso=?, authorised_value=?, frameworkcode=?, value_builder=?, hidden=?, isurl=?, defaultvalue=?
+ where authtypecode=? and tagfield=? and tagsubfield=?");
my @tagsubfield = $input->param('tagsubfield');
my @liblibrarian = $input->param('liblibrarian');
my @libopac = $input->param('libopac');
my $authtypecode = $input->param('authtypecode');
my @frameworkcodes = $input->param('frameworkcode');
my @value_builder =$input->param('value_builder');
+ my @defaultvalue = $input->param('defaultvalue');
for (my $i=0; $i<= $#tagsubfield ; $i++) {
my $tagfield =$input->param('tagfield');
my $tagsubfield =$tagsubfield[$i];
my $authorised_value =$authorised_values[$i];
my $frameworkcode =$frameworkcodes[$i];
my $value_builder=$value_builder[$i];
+ my $defaultvalue = $defaultvalue[$i];
#my $hidden = $ohidden[$i].$ihidden[$i].$ehidden[$i]; #collate from 3 hiddens;
my $hidden = $ohidden[$i]; #collate from 3 hiddens;
my $isurl = $input->param("isurl$i")?1:0;
$value_builder,
$hidden,
$isurl,
+ $defaultvalue,
(
$authtypecode,
$tagfield,
$value_builder,
$hidden,
$isurl,
+ $defaultvalue,
);
}
}