use SL::DB::MetaSetup::Part;
use SL::DB::Manager::Part;
use SL::DB::Chart;
+use SL::DB::Helper::AttrHTML;
use SL::DB::Helper::TransNumberGenerator;
use SL::DB::Helper::CustomVariables (
module => 'IC',
__PACKAGE__->meta->initialize;
+__PACKAGE__->attr_html('notes');
+
__PACKAGE__->before_save('_before_save_set_partnumber');
sub _before_save_set_partnumber {
-# This file has been auto-generated only because it didn't exist.
-# Feel free to modify it at will; it will not be overwritten automatically.
-
package SL::DB::Translation;
use strict;
use SL::DB::MetaSetup::Translation;
+use SL::DB::Helper::AttrHTML;
__PACKAGE__->meta->initialize;
-# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
__PACKAGE__->meta->make_manager_class;
+__PACKAGE__->attr_html('longdescription');
+
1;
use SL::CVar;
use SL::DBUtils;
+use SL::HTML::Restrict;
use SL::TransNumber;
use strict;
my @values;
# connect to database, turn off AutoCommit
my $dbh = $form->get_standard_dbh;
+ my $restricter = SL::HTML::Restrict->create;
# save the part
# make up a unique handle and store in partnumber field
$form->{lastcost},
$form->{weight},
$form->{unit},
- $form->{notes},
+ $restricter->process($form->{notes}),
$form->{formel},
$form->{rop},
conv_i($form->{warehouse_id}),
$sth = $dbh->prepare($query);
foreach my $translation (@translations) {
- do_statement($form, $sth, $query, conv_i($form->{id}), conv_i($translation->{language_id}), $translation->{translation}, $translation->{longdescription});
+ do_statement($form, $sth, $query, conv_i($form->{id}), conv_i($translation->{language_id}), $translation->{translation}, $restricter->process($translation->{longdescription}));
}
$sth->finish();
use SL::CVar;
use SL::IC;
use SL::Helper::Flash;
+use SL::HTML::Util;
use SL::ReportGenerator;
#use SL::PE;
}
map { $row->{$_}{link} = $ref->{$_} } qw(drawing microfiche);
+ $row->{notes}{data} = SL::HTML::Util->strip($ref->{notes});
+
$report->add_data($row);
my $next_ref = $form->{parts}[$idx + 1];
CVar->render_inputs('variables' => $form->{CUSTOM_VARIABLES}, show_disabled_message => 1)
if (scalar @{ $form->{CUSTOM_VARIABLES} });
+ $::request->layout->use_javascript("${_}.js") for qw(ckeditor/ckeditor ckeditor/adapters/jquery);
$form->header;
#print $form->parse_html_template('ic/form_header', { ALL_PRICE_FACTORS => $form->{ALL_PRICE_FACTORS},
# ALL_UNITS => $form->{ALL_UNITS},
[%- USE T8 %]
[%- USE HTML %]
-[%- USE LxERP %][%- USE L -%]
+[%- USE LxERP %][%- USE L -%][%- USE P -%]
[% PROCESS 'common/select_warehouse_bin.html' %]
<p><div class="listtop">[% title %] [% HTML.escape(partnumber) %] [% HTML.escape(description) %]</div></p>
<th align="left">[% 'Part Notes' | $T8 %]</th>
<th align="left">[% 'Formula' | $T8 %]</th>
</tr>
- <tr>
+ <tr valign="top">
<td>
- <textarea name="notes" rows="[% HTML.escape(notes_rows) %]" cols="45" wrap="soft">[% HTML.escape(notes) %]</textarea>
+ [% L.textarea_tag("notes", P.restricted_html(notes), class="texteditor", style="width: 600px; height: 200px") %]
</td>
<td>
<ilayer>
--- /dev/null
+[%- USE T8 %]
+[%- USE HTML %][%- USE L -%][%- USE P -%]
+ <form name="Form">
+
+ <input type="hidden" name="input_name" value="[% HTML.escape(input_name) %]">
+
+ <div class="listtop">[% title %]</div>
+
+ <p>[% 'Please insert your language values below' | $T8 %]</p>
+
+ <p>
+ <table>
+ <tr class="listheading">
+ <th class="listheading"> </th>
+ [%- FOREACH col = HEADER %]
+ <th nowrap class="listheading">[% col.column_title %]</th>
+ [%- END %]
+ </tr>
+
+ [%- FOREACH row = LANGUAGES %]
+ <tr class="listrow[% loop.count % 2 %]">
+ <td>[% L.hidden_tag("id_" _ loop.count, row.id) %][% HTML.escape(row.description) %]</td>
+ <td>
+ [%- IF row.translation_area %]
+ [% L.textarea_tag("translation_" _ loop.count, row.translation, rows=row.translation_rows, cols="40", wrap="soft") %]
+ [%- ELSE %]
+ [% L.input_tag("translation_" _ loop.count, row.translation) %]
+ [%- END %]
+ </td>
+ <td>
+ [% L.textarea_tag("longdescription_" _ loop.count, P.restricted_html(row.longdescription), class="texteditor", style="width: 500px; height: 100px") %]
+ </td>
+ </tr>
+
+ [%- IF loop.last %]
+ <input type="hidden" id="rowcount" name="rowcount" value="[% loop.count %]">
+ [%- END %]
+ [%- END %]
+ </table>
+ </p>
+
+ <p>
+ <button type="button" onclick="languages_updated()">[% 'Close' | $T8 %]</button>
+ </p>
+
+ </form>
+
+ <script type="text/javascript">
+ <!--
+ function languages_updated() {
+ var languages = "";
+ for (var i = 1; i <= (document.getElementsByName("rowcount")[0].value); i++) {
+ var id = "id_" + i ;
+ var translation = "translation_" + i ;
+ var longdescription = "longdescription_" + i;
+
+ languages = languages +
+ "---+++---" + $('#id_' + i).val() +
+ "--++--" + $('#translation_' + i).val() +
+ "--++--" + $('#longdescription_' + i).val();
+ }
+ console.info(languages);
+
+ window.opener.document.getElementsByName(document.Form.input_name.value)[0].value = languages;
+
+ self.close();
+ }
+ //-->
+ </script>
<tr class="listrow" valign="top">
<td>[% HTML.escape(language.description) %]</td>
<td>[% L.input_tag("translations[].translation", translation.translation) %]</td>
- <td>[% L.textarea_tag("translations[].longdescription", translation.longdescription, id="translations_longdescription_" _ language_id, style="width: 500px; height: 100px") %]</td>
+ <td>[% L.textarea_tag("translations[].longdescription", P.restricted_html(translation.longdescription), id="translations_longdescription_" _ language_id, class="texteditor", style="width: 500px; height: 100px") %]</td>
</tr>
[%- END %]
</table>