|
539 | 539 | }, |
540 | 540 | domain: { |
541 | 541 | label: 'label.domain', |
| 542 | + isHidden: function(args) { |
| 543 | + if (isAdmin() || isDomainAdmin()) |
| 544 | + return false; |
| 545 | + else |
| 546 | + return true; |
| 547 | + }, |
542 | 548 | select: function(args) { |
543 | | - $.ajax({ |
544 | | - url: createURL("listDomains&listAll=true"), |
545 | | - success: function(json) { |
546 | | - var items = []; |
547 | | - items.push({ |
548 | | - id: "", |
549 | | - description: "" |
550 | | - }); |
551 | | - var domainObjs = json.listdomainsresponse.domain; |
552 | | - $(domainObjs).each(function() { |
| 549 | + if (isAdmin() || isDomainAdmin()) { |
| 550 | + $.ajax({ |
| 551 | + url: createURL("listDomains&listAll=true"), |
| 552 | + success: function(json) { |
| 553 | + var items = []; |
553 | 554 | items.push({ |
554 | | - id: this.id, |
555 | | - description: this.path |
| 555 | + id: "", |
| 556 | + description: "" |
556 | 557 | }); |
557 | | - }); |
558 | | - args.response.success({ |
559 | | - data: items |
560 | | - }); |
561 | | - } |
562 | | - }); |
563 | | - args.$select.change(function() { |
564 | | - var $form = $(this).closest('form'); |
565 | | - if ($(this).val() == "") { |
566 | | - $form.find('.form-item[rel=account]').hide(); |
567 | | - } else { |
568 | | - $form.find('.form-item[rel=account]').css('display', 'inline-block'); |
569 | | - } |
570 | | - }); |
| 558 | + var domainObjs = json.listdomainsresponse.domain; |
| 559 | + $(domainObjs).each(function() { |
| 560 | + items.push({ |
| 561 | + id: this.id, |
| 562 | + description: this.path |
| 563 | + }); |
| 564 | + }); |
| 565 | + args.response.success({ |
| 566 | + data: items |
| 567 | + }); |
| 568 | + } |
| 569 | + }); |
| 570 | + args.$select.change(function() { |
| 571 | + var $form = $(this).closest('form'); |
| 572 | + if ($(this).val() == "") { |
| 573 | + $form.find('.form-item[rel=account]').hide(); |
| 574 | + } else { |
| 575 | + $form.find('.form-item[rel=account]').css('display', 'inline-block'); |
| 576 | + } |
| 577 | + }); |
| 578 | + } else { |
| 579 | + args.response.success({ |
| 580 | + data: null |
| 581 | + }); |
| 582 | + } |
571 | 583 | }, |
572 | 584 | }, |
573 | 585 | account: { |
574 | 586 | label: 'label.account', |
575 | 587 | validation: { |
576 | 588 | required: true |
577 | 589 | }, |
| 590 | + isHidden: function(args) { |
| 591 | + if (isAdmin() || isDomainAdmin()) |
| 592 | + return false; |
| 593 | + else |
| 594 | + return true; |
| 595 | + } |
578 | 596 | } |
579 | 597 | } |
580 | 598 | }, |
|
0 commit comments