off => 3,
one => 3,
- # ## jqModal plugin ##
+ # ## jQuery UI dialog plugin ## pattern: $(<TARGET>).dialog('<FUNCTION>')
# Closing and removing the popup
- jqmClose => 1, # $(<TARGET>).jqmClose()
+ 'dialog:close' => 1,
# ## jstree plugin ## pattern: $.jstree._reference($(<TARGET>)).<FUNCTION>(<ARGS>)
return $self;
}
+sub dialog {
+ my ($self) = @_;
+ $self->{_prefix} = 'dialog:';
+ return $self;
+}
+
sub flash {
my ($self, $type, @messages) = @_;
$js->jstree->rename_node('#tb-' . $text_block->id, $text_block->title)
->jstree->select_node('#tb-' . $text_block->id);
+ # Close a popup opened by kivi.popup_dialog():
+ $js->dialog->close('#jqueryui_popup_dialog');
+
# Finally render the JSON response:
$self->render($js);
$controller->render(\$self->to_json, { type => 'json' });
+=item C<dialog>
+
+Tells C<$self> that the next action is to be called on a jQuery UI
+dialog instance, e.g. one opened by C<kivi.popup_dialog()>. For
+example:
+
+ $js->dialog->close('#jqueryui_popup_dialog');
+
=item C<jstree>
Tells C<$self> that the next action is to be called on a jstree
main menu list_accounts jquery.autocomplete
jquery.multiselect2side
ui-lightness/jquery-ui
- jquery-ui.custom jqModal
+ jquery-ui.custom
);
$layout->use_javascript("$_.js") for (qw(
- jquery jquery-ui jquery.cookie jqModal jquery.checkall jquery.download
+ jquery jquery-ui jquery.cookie jquery.checkall jquery.download
common part_selection switchmenuframe autocomplete_part
), "jquery/ui/i18n/jquery.ui.datepicker-$::myconfig{countrycode}");
return $code;
}
-sub online_help_tag {
- my ($self, $tag, %params) = _hashify(2, @_);
- my $cc = $::myconfig{countrycode};
- my $file = "doc/online/$cc/$tag.html";
- my $text = $params{text} || $::locale->text('Help');
-
- die 'malformed help tag' unless $tag =~ /^[a-zA-Z0-9_]+$/;
- return unless -f $file;
- return $self->html_tag('a', $text, href => $file, class => 'jqModal')
-}
-
sub dump {
my $self = shift;
return '<pre>' . Data::Dumper::Dumper(@_) . '</pre>';
+++ /dev/null
-/* the overlayed element */
-.jqModal_overlay {
- position: fixed;
- top: 50%;
- margin-top: -250px;
- height: 500px;
-
- left: 50%;
- margin-left: -400px;
- width: 800px;
-
- background-color: #fff;
- border: 1px solid #333;
-
- /* CSS3 styling for latest browsers */
- box-shadow: 0 0 90px 5px #000;
- -moz-box-shadow: 0 0 90px 5px #000;
- -webkit-box-shadow: 0 0 90px #000;
-
- padding: 10px;
-}
-
-.jqModal_overlay .overlay_content {
- width: 790px;
- height: 490px;
- overflow: auto;
-}
-
-.jqModal_overlay .close {
- background-image: url(../../image/dialog-close.png);
- position: absolute;
- right: -16px;
- top: -16px;
- cursor: pointer;
- height: 32px;
- width: 32px;
-}
+++ /dev/null
-/* the overlayed element */
-.jqModal_overlay {
- position: fixed;
- top: 50%;
- margin-top: -250px;
- height: 500px;
-
- left: 50%;
- margin-left: -400px;
- width: 800px;
-
- background-image: url("../../image/fade.png");
- background-repeat: repeat-x;
- background-color: #fff;
- border: 1px solid #333;
-
- /* CSS3 styling for latest browsers */
- box-shadow: 0 0 90px 5px #000;
- -moz-box-shadow: 0 0 90px 5px #000;
- -webkit-box-shadow: 0 0 90px #000;
-
- padding: 10px;
-}
-
-.jqModal_overlay .overlay_content {
- width: 790px;
- height: 490px;
- overflow: auto;
-}
-
-.jqModal_overlay .close {
- background-image: url(../../image/dialog-close.png);
- position: absolute;
- right: -16px;
- top: -16px;
- cursor: pointer;
- height: 32px;
- width: 32px;
-}
+++ /dev/null
-=head1 Projekte erfassen
-
-Projekte sind in kivitendo nur organisatorische Einheiten. Wenn Sie Projekte
-erfassen, können Sie C<Belegen> Projekte zuweisen, und Auswertungen hinterher
-nach den Projekten filtern. Projekte haben ansonsten keine weitere Funktion.
-
-=head1 Tips
-
-=over 4
-
-=item *
-
-Projektnamen können in den Rechnungstemplates ausgedruckt werden, siehe
-L<Dokumente und Druckvariablen>.
-
-=back
var timer;
function open_dialog () {
- open_jqm_window({
+ k.popup_dialog({
url: 'controller.pl?action=Part/part_picker_search',
data: $.extend({
real_id: real_id,
}, ajax_data($dummy.val())),
id: 'part_selection',
+ dialog: { title: k.t8('Part picker') }
});
window.clearTimeout(timer);
return true;
}
function close_popup() {
- $('#part_selection').jqmClose()
+ $('#part_selection').dialog('close');
};
$dummy.autocomplete({
else if (action[0] == 'off') $(action[1]).off(action[2], kivi.get_function_by_name(action[3]));
else if (action[0] == 'one') $(action[1]).one(action[2], kivi.get_function_by_name(action[3]));
- // ## jqModal plugin ##
+ // ## jQuery UI dialog plugin ##
// Closing and removing the popup
- else if (action[0] == 'jqmClose') $(action[1]).jqmClose();
+ else if (action[0] == 'dialog:close') $(action[1]).dialog('close');
// ## jstree plugin ##
return false;
}
-function open_jqm_window(params) {
- params = params || { };
- var id = params.id ? params.id : 'jqm_popup_dialog';
-
- $('#' + id).remove();
- var div = $('<div id="' + id + '" class="jqmWindow jqModal_overlay ' + (params.class || '') + '"></div>').hide().appendTo('body');
- var close = $('<div class="close"></div>').appendTo(div);
- var content = $('<div class="overlay_content"></div>').appendTo(div);
-
- div.jqm({ modal: true });
- div.jqmShow();
- $(close).click(function() {
- div.jqmClose();
- });
-
- $.ajax({
- url: params.url,
- data: params.data,
- type: params.type,
- success: function(new_html) { $(content).html(new_html); }
- });
-
- return true;
-}
-
$(document).ready(function () {
// initialize all jQuery UI tab elements:
$(".tabwidget").each(function(idx, element) {
+++ /dev/null
-/*
- * jqModal - Minimalist Modaling with jQuery
- * (http://dev.iceburg.net/jquery/jqModal/)
- *
- * Copyright (c) 2007,2008 Brice Burgess <bhb@iceburg.net>
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- *
- * $Version: 03/01/2009 +r14
- */
-(function($) {
-$.fn.jqm=function(o){
-var p={
-overlay: 0,
-overlayClass: 'jqmOverlay',
-closeClass: 'jqmClose',
-trigger: '.jqModal',
-ajax: '@href',
-ajaxText: '<img src="images/spinner.gif" alt="...">',
-target: '#help_content',
-modal: F,
-toTop: F,
-onShow: F,
-onHide: F,
-onLoad: F
-};
-return this.each(function(){if(this._jqm)return H[this._jqm].c=$.extend({},H[this._jqm].c,o);s++;this._jqm=s;
-H[s]={c:$.extend(p,$.jqm.params,o),a:F,w:$(this).addClass('jqmID'+s),s:s};
-if(p.trigger)$(this).jqmAddTrigger(p.trigger);
-});};
-
-$.fn.jqmAddClose=function(e){return hs(this,e,'jqmHide');};
-$.fn.jqmAddTrigger=function(e){return hs(this,e,'jqmShow');};
-$.fn.jqmShow=function(t){return this.each(function(){t=t||window.event;$.jqm.open(this._jqm,t);});};
-$.fn.jqmHide=function(t){return this.each(function(){t=t||window.event;$.jqm.close(this._jqm,t)});};
-$.fn.jqmClose=function(t){return this.each(function(){t=t||window.event;$.jqm.close(this._jqm,t);this.remove();});};
-
-$.jqm = {
-hash:{},
-open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(parseInt(h.w.css('z-index'))),z=(z>0)?z:3000,o=$('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});if(h.a)return F;h.t=t;h.a=true;h.w.css('z-index',z);
- if(c.modal) {if(!A[0])L('bind');A.push(s);}
- else if(c.overlay > 0)h.w.jqmAddClose(o);
- else o=F;
-
- h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):F;
-
- if(c.ajax) {var r=c.target||h.w,u=c.ajax,r=(typeof r == 'string')?$(r,h.w):$(r),u=(u.substr(0,1) == '@')?$(t).attr(u.substring(1)):u;
- r.html(c.ajaxText).load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));f(h);});}
- else if(cc)h.w.jqmAddClose($(cc,h.w));
-
- if(c.toTop&&h.o)h.w.before('<span id="jqmP'+h.w[0]._jqm+'"></span>').insertAfter(h.o);
- (c.onShow)?c.onShow(h):h.w.show();f(h);return F;
-},
-close:function(s){var h=H[s];if(!h.a)return F;h.a=F;
- if(A[0]){A.pop();if(!A[0])L('unbind');}
- if(h.c.toTop&&h.o)$('#jqmP'+h.w[0]._jqm).after(h.w).remove();
- if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove();} return F;
-},
-params:{}};
-var s=0,H=$.jqm.hash,A=[],F=false,
-i=$('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0}),
-f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(_){}},
-L=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m);},
-m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r)f(h);return !r;},
-hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function() {
- if(!this[c]){this[c]=[];$(this).click(function(){for(var i in {jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return F;});}this[c].push(s);});});};
-})(jQuery);
namespace("kivi").setupLocale({
+"Add linked record":"Verknüpften Beleg hinzufügen",
"Are you sure?":"Sind Sie sicher?",
+"Database Connection Test":"Test der Datenbankverbindung",
"Map":"Karte",
+"Part picker":"Artikelauswahl",
"The description is missing.":"Die Beschreibung fehlt.",
"The name is missing.":"Der Name fehlt.",
"The name must only consist of letters, numbers and underscores and start with a letter.":"Der Name darf nur aus Buchstaben (keine Umlaute), Ziffern und Unterstrichen bestehen und muss mit einem Buchstaben beginnen.",
'Add bank account' => 'Bankkonto erfassen',
'Add custom variable' => 'Benutzerdefinierte Variable erfassen',
'Add link: select records to link with' => 'Verknüpfungen hinzufügen: zu verknüpfende Belege auswählen',
+ 'Add linked record' => 'Verknüpften Beleg hinzufügen',
'Add links' => 'Verknüpfungen hinzufügen',
'Add new currency' => 'Neue Währung hinzufügen',
'Add new custom variable' => 'Neue benutzerdefinierte Variable erfassen',
'Hardcopy' => 'Seite drucken',
'Has serial number' => 'Hat eine Serienummer',
'Heading' => 'Überschrift',
- 'Help' => 'Hilfe',
'Help Template Variables' => 'Hilfe zu Dokumenten-Variablen',
'Help on column names' => 'Hilfe zu Spaltennamen',
'Here' => 'Hier',
our @lost = ();
my %ignore_unused_templates = (
- map { $_ => 1 } qw(common/help_overlay.html ct/testpage.html generic/autocomplete.html oe/periodic_invoices_email.txt part/testpage.html t/render.html t/render.js)
+ map { $_ => 1 } qw(ct/testpage.html generic/autocomplete.html oe/periodic_invoices_email.txt part/testpage.html t/render.html t/render.js)
);
my (%referenced_html_files, %locale, %htmllocale, %alllocales, %cached, %submit, %jslocale);
while( my $line = readline($fh) ) {
while( $line =~ m/
- kivi.t8
+ \bk(?:ivi)?.t8
\s*
\(
\s*
}
function test_database_connectivity() {
- open_jqm_window({
- url: 'controller.pl?action=Admin/test_database_connectivity',
- data: $(".contains_dbsettings").serialize(),
- type: 'POST',
- id: 'test_db_connection_window'
+ kivi.popup_dialog({
+ url: 'controller.pl?action=Admin/test_database_connectivity',
+ data: $(".contains_dbsettings").serialize(),
+ type: 'POST',
+ id: 'test_db_connection_window',
+ dialog: { title: kivi.t8('Database Connection Test') }
});
return true;
}
[%- USE HTML %][%- USE LxERP -%][%- USE L -%]
-<div class="listtop">[% HTML.escape(title) %]</div>
-
[%- IF ok %]
<p class="message_ok">[% LxERP.t8('The connection was established successfully.') %]</p>
[%- END %]
<div>
- <a href="#" onclick="$('#test_db_connection_window').jqmClose();">[% LxERP.t8("Close Window") %]</a>
+ <a href="#" onclick="$('#test_db_connection_window').dialog('close');">[% LxERP.t8("Close Window") %]</a>
</div>
+++ /dev/null
-[%- USE T8 %]
-<script type="text/javascript">
- $().ready(function(){$('#help_div').jqm()});
-</script>
-<div class='jqmWindow' id='help_div'>
- <a href='#' style='float:right' class='jqmClose'><img src='image/close.png' border='0' alt='[% 'Close Dialog' | $T8 %]'></a>
- <div class='jqmContent' id='help_content'>
- [% 'Please wait...' | $T8 %]
- <img src='image/spinner.gif' alt="[% 'loading' | $T8 %]">
- </div>
-</div>
[%- USE LxERP %]
[%- USE T8 %]
-<h1>[% 'Part picker' | $T8 %]</h1>
<div style='overflow:hidden'>
-[% L.input_tag('part_picker_filter', SELF.filter.all_substr__ilike, class='part_picker_filter') %]
+[% LxERP.t8("Filter") %]: [% L.input_tag('part_picker_filter', SELF.filter.all_substr__ilike, class='part_picker_filter') %]
[% L.hidden_tag('part_picker_real_id', FORM.real_id) %]
<div style='clear:both'></div>
<script type="text/javascript">
<!--
function record_links_add() {
- open_jqm_window({ url: 'controller.pl',
- data: { action: 'RecordLinks/ajax_add_filter',
- object_model: '[% JavaScript.escape(object_model) %]',
- object_id: '[% JavaScript.escape(object_id) %]'
- },
- id: 'record_links_add' });
+ kivi.popup_dialog({ url: 'controller.pl',
+ data: { action: 'RecordLinks/ajax_add_filter',
+ object_model: '[% JavaScript.escape(object_model) %]',
+ object_id: '[% JavaScript.escape(object_id) %]'
+ },
+ id: 'record_links_add',
+ dialog: { title: kivi.t8("Add linked record") } });
return true;
}
</div>
<p>
- [% L.online_help_tag('add_project') %]
[% L.hidden_tag("action", "Project/dispatch") %]
[% L.submit_tag("action_" _ (SELF.project.id ? "update" : "create"), LxERP.t8('Save')) %]
[%- IF SELF.project.id %]
[% L.button_tag('filter_record_links()', LxERP.t8("Search")) %]
[% L.button_tag('add_selected_record_links()', LxERP.t8("Add links"), id='add_selected_record_links_button', disabled=1) %]
<a href="#" onclick="record_links_reset_form();">[%- LxERP.t8("Reset") %]</a>
- <a href="#" onclick="$('#record_links_add').jqmClose();">[% LxERP.t8("Cancel") %]</a>
+ <a href="#" onclick="$('#record_links_add').dialog('close');">[% LxERP.t8("Cancel") %]</a>
</p>
<hr>
<script type="text/javascript">
<!--
$(function() {
- $('.jqmWindow input[name=vc_name]').focus();
+ $('#record_links_add input[name=vc_name]').focus();
});
function record_links_reset_form() {
- $('.jqmWindow form input[type=text]').val('');
- $('.jqmWindow form select').prop('selectedIndex', 0);
+ $('#record_links_add form input[type=text]').val('');
+ $('#record_links_add form select').prop('selectedIndex', 0);
}
function filter_record_links() {
- var url="controller.pl?action=RecordLinks/ajax_add_list&" + $(".jqmWindow form").serialize();
+ var url="controller.pl?action=RecordLinks/ajax_add_list&" + $("#record_links_add form").serialize();
$.ajax({
url: url,
success: function(new_data) {
}
function add_selected_record_links() {
- var url="controller.pl?action=RecordLinks/ajax_add_do&" + $(".jqmWindow form").serialize();
+ var url="controller.pl?action=RecordLinks/ajax_add_do&" + $("#record_links_add form").serialize();
$.ajax({
url: url,
success: function(new_html) {
$('#record_links_list').replaceWith(new_html);
- $('#record_links_add').jqmClose();
+ $('#record_links_add').dialog('close');
}
});
}