Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6dbc83af

Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt

  • ID 6dbc83af32ca1bded29101903d98d8656113801e
  • Vorgänger a88e5449
  • Nachfolger bf5ce652

jqModal-Dialoge durch jQuery-UI-Dialoge ersetzen

Unterschiede anzeigen:

SL/ClientJS.pm
75 75
  off          => 3,
76 76
  one          => 3,
77 77

  
78
  # ## jqModal plugin ##
78
  # ## jQuery UI dialog plugin ## pattern: $(<TARGET>).dialog('<FUNCTION>')
79 79

  
80 80
  # Closing and removing the popup
81
  jqmClose               => 1, # $(<TARGET>).jqmClose()
81
  'dialog:close'         => 1,
82 82

  
83 83
  # ## jstree plugin ## pattern: $.jstree._reference($(<TARGET>)).<FUNCTION>(<ARGS>)
84 84

  
......
185 185
  return $self;
186 186
}
187 187

  
188
sub dialog {
189
  my ($self) = @_;
190
  $self->{_prefix} = 'dialog:';
191
  return $self;
192
}
193

  
188 194
sub flash {
189 195
  my ($self, $type, @messages) = @_;
190 196

  
......
262 268
    $js->jstree->rename_node('#tb-' . $text_block->id, $text_block->title)
263 269
       ->jstree->select_node('#tb-' . $text_block->id);
264 270

  
271
    # Close a popup opened by kivi.popup_dialog():
272
    $js->dialog->close('#jqueryui_popup_dialog');
273

  
265 274
    # Finally render the JSON response:
266 275
    $self->render($js);
267 276

  
......
324 333

  
325 334
  $controller->render(\$self->to_json, { type => 'json' });
326 335

  
336
=item C<dialog>
337

  
338
Tells C<$self> that the next action is to be called on a jQuery UI
339
dialog instance, e.g. one opened by C<kivi.popup_dialog()>. For
340
example:
341

  
342
  $js->dialog->close('#jqueryui_popup_dialog');
343

  
327 344
=item C<jstree>
328 345

  
329 346
Tells C<$self> that the next action is to be called on a jstree
SL/Form.pm
467 467
    main menu list_accounts jquery.autocomplete
468 468
    jquery.multiselect2side
469 469
    ui-lightness/jquery-ui
470
    jquery-ui.custom jqModal
470
    jquery-ui.custom
471 471
  );
472 472

  
473 473
  $layout->use_javascript("$_.js") for (qw(
474
    jquery jquery-ui jquery.cookie jqModal jquery.checkall jquery.download
474
    jquery jquery-ui jquery.cookie jquery.checkall jquery.download
475 475
    common part_selection switchmenuframe autocomplete_part
476 476
  ), "jquery/ui/i18n/jquery.ui.datepicker-$::myconfig{countrycode}");
477 477

  
SL/Template/Plugin/L.pm
434 434
  return $code;
435 435
}
436 436

  
437
sub online_help_tag {
438
  my ($self, $tag, %params) = _hashify(2, @_);
439
  my $cc                   = $::myconfig{countrycode};
440
  my $file                 = "doc/online/$cc/$tag.html";
441
  my $text                 = $params{text} || $::locale->text('Help');
442

  
443
  die 'malformed help tag' unless $tag =~ /^[a-zA-Z0-9_]+$/;
444
  return unless -f $file;
445
  return $self->html_tag('a', $text, href => $file, class => 'jqModal')
446
}
447

  
448 437
sub dump {
449 438
  my $self = shift;
450 439
  return '<pre>' . Data::Dumper::Dumper(@_) . '</pre>';
css/kivitendo/jqModal.css
1
/* the overlayed element */
2
.jqModal_overlay {
3
  position: fixed;
4
  top: 50%;
5
  margin-top: -250px;
6
  height: 500px;
7

  
8
  left: 50%;
9
  margin-left: -400px;
10
  width: 800px;
11

  
12
  background-color: #fff;
13
  border: 1px solid #333;
14

  
15
  /* CSS3 styling for latest browsers */
16
  box-shadow: 0 0 90px 5px #000;
17
  -moz-box-shadow: 0 0 90px 5px #000;
18
  -webkit-box-shadow: 0 0 90px #000;
19

  
20
  padding: 10px;
21
}
22

  
23
.jqModal_overlay .overlay_content {
24
  width: 790px;
25
  height: 490px;
26
  overflow: auto;
27
}
28

  
29
.jqModal_overlay .close {
30
  background-image: url(../../image/dialog-close.png);
31
  position: absolute;
32
  right: -16px;
33
  top: -16px;
34
  cursor: pointer;
35
  height: 32px;
36
  width: 32px;
37
}
css/lx-office-erp/jqModal.css
1
/* the overlayed element */
2
.jqModal_overlay {
3
  position: fixed;
4
  top: 50%;
5
  margin-top: -250px;
6
  height: 500px;
7

  
8
  left: 50%;
9
  margin-left: -400px;
10
  width: 800px;
11

  
12
  background-image: url("../../image/fade.png");
13
  background-repeat: repeat-x;
14
  background-color: #fff;
15
  border: 1px solid #333;
16

  
17
  /* CSS3 styling for latest browsers */
18
  box-shadow: 0 0 90px 5px #000;
19
  -moz-box-shadow: 0 0 90px 5px #000;
20
  -webkit-box-shadow: 0 0 90px #000;
21

  
22
  padding: 10px;
23
}
24

  
25
.jqModal_overlay .overlay_content {
26
  width: 790px;
27
  height: 490px;
28
  overflow: auto;
29
}
30

  
31
.jqModal_overlay .close {
32
  background-image: url(../../image/dialog-close.png);
33
  position: absolute;
34
  right: -16px;
35
  top: -16px;
36
  cursor: pointer;
37
  height: 32px;
38
  width: 32px;
39
}
doc/online/de/add_project.pod
1
=head1 Projekte erfassen
2

  
3
Projekte sind in kivitendo nur organisatorische Einheiten. Wenn Sie Projekte
4
erfassen, können Sie C<Belegen> Projekte zuweisen, und Auswertungen hinterher
5
nach den Projekten filtern. Projekte haben ansonsten keine weitere Funktion.
6

  
7
=head1 Tips
8

  
9
=over 4
10

  
11
=item *
12

  
13
Projektnamen können in den Rechnungstemplates ausgedruckt werden, siehe
14
L<Dokumente und Druckvariablen>.
15

  
16
=back
js/autocomplete_part.js
29 29
    var timer;
30 30

  
31 31
    function open_dialog () {
32
      open_jqm_window({
32
      k.popup_dialog({
33 33
        url: 'controller.pl?action=Part/part_picker_search',
34 34
        data: $.extend({
35 35
          real_id: real_id,
36 36
        }, ajax_data($dummy.val())),
37 37
        id: 'part_selection',
38
        dialog: { title: k.t8('Part picker') }
38 39
      });
39 40
      window.clearTimeout(timer);
40 41
      return true;
......
98 99
    }
99 100

  
100 101
    function close_popup() {
101
      $('#part_selection').jqmClose()
102
      $('#part_selection').dialog('close');
102 103
    };
103 104

  
104 105
    $dummy.autocomplete({
js/client_js.js
91 91
      else if (action[0] == 'off')                  $(action[1]).off(action[2], kivi.get_function_by_name(action[3]));
92 92
      else if (action[0] == 'one')                  $(action[1]).one(action[2], kivi.get_function_by_name(action[3]));
93 93

  
94
      // ## jqModal plugin ##
94
      // ## jQuery UI dialog plugin ##
95 95

  
96 96
      // Closing and removing the popup
97
      else if (action[0] == 'jqmClose')             $(action[1]).jqmClose();
97
      else if (action[0] == 'dialog:close')         $(action[1]).dialog('close');
98 98

  
99 99
      // ## jstree plugin ##
100 100

  
js/common.js
160 160
  return false;
161 161
}
162 162

  
163
function open_jqm_window(params) {
164
  params = params || { };
165
  var id = params.id ? params.id : 'jqm_popup_dialog';
166

  
167
  $('#' + id).remove();
168
  var div     = $('<div id="' + id + '" class="jqmWindow jqModal_overlay ' + (params.class || '') + '"></div>').hide().appendTo('body');
169
  var close   = $('<div class="close"></div>').appendTo(div);
170
  var content = $('<div class="overlay_content"></div>').appendTo(div);
171

  
172
  div.jqm({ modal: true });
173
  div.jqmShow();
174
  $(close).click(function() {
175
    div.jqmClose();
176
  });
177

  
178
  $.ajax({
179
    url:     params.url,
180
    data:    params.data,
181
    type:    params.type,
182
    success: function(new_html) { $(content).html(new_html); }
183
  });
184

  
185
  return true;
186
}
187

  
188 163
$(document).ready(function () {
189 164
  // initialize all jQuery UI tab elements:
190 165
  $(".tabwidget").each(function(idx, element) {
js/jqModal/jqModal.js
1
/*
2
 * jqModal - Minimalist Modaling with jQuery
3
 *   (http://dev.iceburg.net/jquery/jqModal/)
4
 *
5
 * Copyright (c) 2007,2008 Brice Burgess <bhb@iceburg.net>
6
 * Dual licensed under the MIT and GPL licenses:
7
 *   http://www.opensource.org/licenses/mit-license.php
8
 *   http://www.gnu.org/licenses/gpl.html
9
 *
10
 * $Version: 03/01/2009 +r14
11
 */
12
(function($) {
13
$.fn.jqm=function(o){
14
var p={
15
overlay: 0,
16
overlayClass: 'jqmOverlay',
17
closeClass: 'jqmClose',
18
trigger: '.jqModal',
19
ajax: '@href',
20
ajaxText: '<img src="images/spinner.gif" alt="...">',
21
target: '#help_content',
22
modal: F,
23
toTop: F,
24
onShow: F,
25
onHide: F,
26
onLoad: F
27
};
28
return this.each(function(){if(this._jqm)return H[this._jqm].c=$.extend({},H[this._jqm].c,o);s++;this._jqm=s;
29
H[s]={c:$.extend(p,$.jqm.params,o),a:F,w:$(this).addClass('jqmID'+s),s:s};
30
if(p.trigger)$(this).jqmAddTrigger(p.trigger);
31
});};
32

  
33
$.fn.jqmAddClose=function(e){return hs(this,e,'jqmHide');};
34
$.fn.jqmAddTrigger=function(e){return hs(this,e,'jqmShow');};
35
$.fn.jqmShow=function(t){return this.each(function(){t=t||window.event;$.jqm.open(this._jqm,t);});};
36
$.fn.jqmHide=function(t){return this.each(function(){t=t||window.event;$.jqm.close(this._jqm,t)});};
37
$.fn.jqmClose=function(t){return this.each(function(){t=t||window.event;$.jqm.close(this._jqm,t);this.remove();});};
38

  
39
$.jqm = {
40
hash:{},
41
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);
42
 if(c.modal) {if(!A[0])L('bind');A.push(s);}
43
 else if(c.overlay > 0)h.w.jqmAddClose(o);
44
 else o=F;
45

  
46
 h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):F;
47

  
48
 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;
49
  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);});}
50
 else if(cc)h.w.jqmAddClose($(cc,h.w));
51

  
52
 if(c.toTop&&h.o)h.w.before('<span id="jqmP'+h.w[0]._jqm+'"></span>').insertAfter(h.o);
53
 (c.onShow)?c.onShow(h):h.w.show();f(h);return F;
54
},
55
close:function(s){var h=H[s];if(!h.a)return F;h.a=F;
56
 if(A[0]){A.pop();if(!A[0])L('unbind');}
57
 if(h.c.toTop&&h.o)$('#jqmP'+h.w[0]._jqm).after(h.w).remove();
58
 if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove();} return F;
59
},
60
params:{}};
61
var s=0,H=$.jqm.hash,A=[],F=false,
62
i=$('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0}),
63
f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(_){}},
64
L=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m);},
65
m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r)f(h);return !r;},
66
hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function() {
67
 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);});});};
68
})(jQuery);
js/locale/de.js
1 1
namespace("kivi").setupLocale({
2
"Add linked record":"Verknüpften Beleg hinzufügen",
2 3
"Are you sure?":"Sind Sie sicher?",
4
"Database Connection Test":"Test der Datenbankverbindung",
3 5
"Map":"Karte",
6
"Part picker":"Artikelauswahl",
4 7
"The description is missing.":"Die Beschreibung fehlt.",
5 8
"The name is missing.":"Der Name fehlt.",
6 9
"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.",
locale/de/all
164 164
  'Add bank account'            => 'Bankkonto erfassen',
165 165
  'Add custom variable'         => 'Benutzerdefinierte Variable erfassen',
166 166
  'Add link: select records to link with' => 'Verknüpfungen hinzufügen: zu verknüpfende Belege auswählen',
167
  'Add linked record'           => 'Verknüpften Beleg hinzufügen',
167 168
  'Add links'                   => 'Verknüpfungen hinzufügen',
168 169
  'Add new currency'            => 'Neue Währung hinzufügen',
169 170
  'Add new custom variable'     => 'Neue benutzerdefinierte Variable erfassen',
......
1007 1008
  'Hardcopy'                    => 'Seite drucken',
1008 1009
  'Has serial number'           => 'Hat eine Serienummer',
1009 1010
  'Heading'                     => 'Überschrift',
1010
  'Help'                        => 'Hilfe',
1011 1011
  'Help Template Variables'     => 'Hilfe zu Dokumenten-Variablen',
1012 1012
  'Help on column names'        => 'Hilfe zu Spaltennamen',
1013 1013
  'Here'                        => 'Hier',
scripts/locales.pl
43 43
our @lost        = ();
44 44

  
45 45
my %ignore_unused_templates = (
46
  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)
46
  map { $_ => 1 } qw(ct/testpage.html generic/autocomplete.html oe/periodic_invoices_email.txt part/testpage.html t/render.html t/render.js)
47 47
);
48 48

  
49 49
my (%referenced_html_files, %locale, %htmllocale, %alllocales, %cached, %submit, %jslocale);
......
633 633

  
634 634
  while( my $line = readline($fh) ) {
635 635
    while( $line =~ m/
636
                    kivi.t8
636
                    \bk(?:ivi)?.t8
637 637
                    \s*
638 638
                    \(
639 639
                    \s*
templates/webpages/admin/edit_client.html
123 123
  }
124 124

  
125 125
  function test_database_connectivity() {
126
    open_jqm_window({
127
      url:  'controller.pl?action=Admin/test_database_connectivity',
128
      data: $(".contains_dbsettings").serialize(),
129
      type: 'POST',
130
      id:   'test_db_connection_window'
126
    kivi.popup_dialog({
127
      url:    'controller.pl?action=Admin/test_database_connectivity',
128
      data:   $(".contains_dbsettings").serialize(),
129
      type:   'POST',
130
      id:     'test_db_connection_window',
131
      dialog: { title: kivi.t8('Database Connection Test') }
131 132
    });
132 133
    return true;
133 134
  }
templates/webpages/admin/test_db_connection.html
1 1
[%- USE HTML %][%- USE LxERP -%][%- USE L -%]
2
<div class="listtop">[% HTML.escape(title) %]</div>
3

  
4 2
[%- IF ok %]
5 3

  
6 4
 <p class="message_ok">[% LxERP.t8('The connection was established successfully.') %]</p>
......
17 15
[%- END %]
18 16

  
19 17
<div>
20
 <a href="#" onclick="$('#test_db_connection_window').jqmClose();">[% LxERP.t8("Close Window") %]</a>
18
 <a href="#" onclick="$('#test_db_connection_window').dialog('close');">[% LxERP.t8("Close Window") %]</a>
21 19
</div>
templates/webpages/common/help_overlay.html
1
[%- USE T8 %]
2
<script type="text/javascript">
3
  $().ready(function(){$('#help_div').jqm()});
4
</script>
5
<div class='jqmWindow' id='help_div'>
6
  <a href='#' style='float:right' class='jqmClose'><img src='image/close.png' border='0' alt='[% 'Close Dialog' | $T8 %]'></a>
7
  <div class='jqmContent' id='help_content'>
8
    [% 'Please wait...' | $T8 %]
9
    <img src='image/spinner.gif' alt="[% 'loading' | $T8 %]">
10
  </div>
11
</div>
templates/webpages/part/part_picker_search.html
3 3
[%- USE LxERP %]
4 4
[%- USE T8 %]
5 5

  
6
<h1>[% 'Part picker' | $T8 %]</h1>
7 6
<div style='overflow:hidden'>
8 7

  
9
[% L.input_tag('part_picker_filter', SELF.filter.all_substr__ilike, class='part_picker_filter') %]
8
[% LxERP.t8("Filter") %]: [% L.input_tag('part_picker_filter', SELF.filter.all_substr__ilike, class='part_picker_filter') %]
10 9
[% L.hidden_tag('part_picker_real_id', FORM.real_id) %]
11 10

  
12 11
<div style='clear:both'></div>
templates/webpages/presenter/record/grouped_record_list.html
18 18
 <script type="text/javascript">
19 19
  <!--
20 20
function record_links_add() {
21
  open_jqm_window({ url:  'controller.pl',
22
                    data: { action: 'RecordLinks/ajax_add_filter',
23
                            object_model: '[% JavaScript.escape(object_model) %]',
24
                            object_id: '[% JavaScript.escape(object_id) %]'
25
                          },
26
                    id:  'record_links_add' });
21
  kivi.popup_dialog({ url:     'controller.pl',
22
                      data:    { action: 'RecordLinks/ajax_add_filter',
23
                                 object_model: '[% JavaScript.escape(object_model) %]',
24
                                 object_id: '[% JavaScript.escape(object_id) %]'
25
                               },
26
                      id:     'record_links_add',
27
                      dialog: { title: kivi.t8("Add linked record") } });
27 28
  return true;
28 29
}
29 30

  
templates/webpages/project/form.html
90 90
  </div>
91 91

  
92 92
  <p>
93
   [% L.online_help_tag('add_project') %]
94 93
   [% L.hidden_tag("action", "Project/dispatch") %]
95 94
   [% L.submit_tag("action_" _  (SELF.project.id ? "update" : "create"), LxERP.t8('Save')) %]
96 95
   [%- IF SELF.project.id %]
templates/webpages/record_links/add_filter.html
46 46
  [% L.button_tag('filter_record_links()', LxERP.t8("Search")) %]
47 47
  [% L.button_tag('add_selected_record_links()', LxERP.t8("Add links"), id='add_selected_record_links_button', disabled=1) %]
48 48
  <a href="#" onclick="record_links_reset_form();">[%- LxERP.t8("Reset") %]</a>
49
  <a href="#" onclick="$('#record_links_add').jqmClose();">[% LxERP.t8("Cancel") %]</a>
49
  <a href="#" onclick="$('#record_links_add').dialog('close');">[% LxERP.t8("Cancel") %]</a>
50 50
 </p>
51 51

  
52 52
 <hr>
......
58 58
<script type="text/javascript">
59 59
<!--
60 60
$(function() {
61
  $('.jqmWindow input[name=vc_name]').focus();
61
  $('#record_links_add input[name=vc_name]').focus();
62 62
});
63 63

  
64 64
function record_links_reset_form() {
65
  $('.jqmWindow form input[type=text]').val('');
66
  $('.jqmWindow form select').prop('selectedIndex', 0);
65
  $('#record_links_add form input[type=text]').val('');
66
  $('#record_links_add form select').prop('selectedIndex', 0);
67 67
}
68 68

  
69 69
function filter_record_links() {
70
  var url="controller.pl?action=RecordLinks/ajax_add_list&" + $(".jqmWindow form").serialize();
70
  var url="controller.pl?action=RecordLinks/ajax_add_list&" + $("#record_links_add form").serialize();
71 71
  $.ajax({
72 72
    url: url,
73 73
    success: function(new_data) {
......
78 78
}
79 79

  
80 80
function add_selected_record_links() {
81
  var url="controller.pl?action=RecordLinks/ajax_add_do&" + $(".jqmWindow form").serialize();
81
  var url="controller.pl?action=RecordLinks/ajax_add_do&" + $("#record_links_add form").serialize();
82 82
  $.ajax({
83 83
    url: url,
84 84
    success: function(new_html) {
85 85
      $('#record_links_list').replaceWith(new_html);
86
      $('#record_links_add').jqmClose();
86
      $('#record_links_add').dialog('close');
87 87
    }
88 88
  });
89 89
}

Auch abrufbar als: Unified diff