# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1335, USA.
- $main::auth->assert('config');
+ $main::auth->assert('admin');
+
+ my $defaults = SL::DB::Default->get;
+ $form->error($::locale->text('No print templates have been created for this client yet. Please do so in the client configuration.')) if !$defaults->templates;
if ($form->{"formname"} =~ m|\.\.| || $form->{"formname"} =~ m|^/|) {
$form->{"formname"} =~ s|.*/||;
if ($form->{"formname"} =~ m|\.\.| || $form->{"formname"} =~ m|^/|) {
$form->{"formname"} =~ s|.*/||;
# filter all files already set up (i.e. not already in @values)
my @other_files = grep { my $a=$_; not grep {$a eq $_->{value}} @values } @all_files;
# filter all files already set up (i.e. not already in @values)
my @other_files = grep { my $a=$_; not grep {$a eq $_->{value}} @values } @all_files;
$options{"content"} = "\n\n" if (!$options{"content"});
$options{"SHOW_SECOND_EDIT_BUTTON"} = $options{"lines"} > 25;
}
$options{"content"} = "\n\n" if (!$options{"content"});
$options{"SHOW_SECOND_EDIT_BUTTON"} = $options{"lines"} > 25;
}