Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 85537c4

Browse files
author
Charles Ma
committed
ENH: refs #301 Remote processing:Added Job management page
refs #316 Core: Added select item page
1 parent 9f46a0b commit 85537c4

31 files changed

+1176
-130
lines changed

core/AppController.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,16 @@ public function disableView()
298298
$this->_helper->viewRenderer->setNoRender();
299299
}
300300

301+
/** Show a jgrowl Message */
302+
public function showNotificationMessage($message)
303+
{
304+
if(!isset($this->view->json['triggerNotification']))
305+
{
306+
$this->view->json['triggerNotification'] = array();
307+
}
308+
$this->view->json['triggerNotification'][] = $message;
309+
}
310+
301311
/** check if midas needs to be upgraded */
302312
public function isUpgradeNeeded()
303313
{

core/controllers/BrowseController.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,54 @@ public function movecopyAction()
163163
$this->view->communities = $communities;
164164
}
165165

166+
/** Ajax element used to select an item*/
167+
public function selectitemAction()
168+
{
169+
if(!$this->getRequest()->isXmlHttpRequest())
170+
{
171+
throw new Zend_Exception("Why are you here ? Should be ajax.");
172+
}
173+
$this->_helper->layout->disableLayout();
174+
175+
$this->view->selectEnabled = true;
176+
177+
$communities = $this->User->getUserCommunities($this->userSession->Dao);
178+
$communities = array_merge($communities, $this->Community->getPublicCommunities());
179+
$this->view->Date = $this->Component->Date;
180+
181+
$this->Component->Sortdao->field = 'name';
182+
$this->Component->Sortdao->order = 'asc';
183+
usort($communities, array($this->Component->Sortdao, 'sortByName'));
184+
$communities = $this->Component->Sortdao->arrayUniqueDao($communities );
185+
186+
$this->view->user = $this->userSession->Dao;
187+
$this->view->communities = $communities;
188+
}
189+
190+
/** Ajax element used to select a folder*/
191+
public function selectfolderAction()
192+
{
193+
if(!$this->getRequest()->isXmlHttpRequest())
194+
{
195+
throw new Zend_Exception("Why are you here ? Should be ajax.");
196+
}
197+
$this->_helper->layout->disableLayout();
198+
199+
$this->view->selectEnabled = true;
200+
201+
$communities = $this->User->getUserCommunities($this->userSession->Dao);
202+
$communities = array_merge($communities, $this->Community->getPublicCommunities());
203+
$this->view->Date = $this->Component->Date;
204+
205+
$this->Component->Sortdao->field = 'name';
206+
$this->Component->Sortdao->order = 'asc';
207+
usort($communities, array($this->Component->Sortdao, 'sortByName'));
208+
$communities = $this->Component->Sortdao->arrayUniqueDao($communities );
209+
210+
$this->view->user = $this->userSession->Dao;
211+
$this->view->communities = $communities;
212+
}
213+
166214
/** get getfolders content (ajax function for the treetable) */
167215
public function getfolderscontentAction()
168216
{

core/public/css/browse/browse.movecopy.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@ border-right: none!important;
99

1010
table#moveTable{
1111
display: none;
12+
}
13+
14+
.treeTable .browserPrivacyInformation{
15+
right: 10px!important;
1216
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
table#moveTable{
2+
width: 420px !important;
3+
}
4+
5+
table#moveTable th.thData {
6+
width: auto!important;
7+
border-right: none!important;
8+
}
9+
10+
table#moveTable{
11+
display: none;
12+
}
13+
14+
.treeTable .browserPrivacyInformation{
15+
right: 10px!important;
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
table#moveTable{
2+
width: 420px !important;
3+
}
4+
5+
table#moveTable th.thData {
6+
width: auto!important;
7+
border-right: none!important;
8+
}
9+
10+
table#moveTable{
11+
display: none;
12+
}
13+
14+
.treeTable .browserPrivacyInformation{
15+
right: 10px!important;
16+
}

core/public/images/icons/job.png

714 Bytes
Loading

core/public/images/icons/xml.png

572 Bytes
Loading

core/public/js/browse/browse.movecopy.js

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
$("#moveTable").treeTable();
22
$("img.tableLoading").hide();
33
$("table#moveTable").show();
4-
4+
55
$('applet').hide();
6-
6+
77
if($('#selectElements')!=undefined)
88
{
99
$('#selectElements').click(function(){
@@ -16,24 +16,23 @@
1616
return false;
1717
});
1818
}
19-
19+
2020
//dependance: common/browser.js
2121
var ajaxSelectRequest='';
2222
function callbackSelect(node)
2323
{
24-
console.log(node);
2524
var selectedElement = node.find('span:eq(1)').html();
26-
25+
2726
var parent = true;
2827
var current = node;
29-
28+
3029
while(parent != null)
31-
{
32-
parent = null;
33-
var classNames = current[0].className.split(' ');
30+
{
31+
parent = null;
32+
var classNames = current[0].className.split(' ');
3433
for(key in classNames)
3534
{
36-
if(classNames[key].match("child-of-"))
35+
if(classNames[key].match("child-of-"))
3736
{
3837
parent = $("#" + classNames[key].substring(9));
3938
}
@@ -43,30 +42,30 @@
4342
selectedElement = parent.find('span:eq(1)').html()+'/'+selectedElement;
4443
current = parent;
4544
}
46-
}
47-
45+
}
46+
4847
$('#selectedDestinationHidden').val(node.attr('element'));
4948
$('#selectedDestination').html(sliceFileName(selectedElement, 40));
5049
$('#selectElements').removeAttr('disabled');
5150
$('#copyElement').removeAttr('disabled');
5251
$('#moveElements').removeAttr('disabled');
5352
}
54-
55-
53+
54+
5655
$('img.infoLoading').show();
5756
$('div.ajaxInfoElement').html('');
58-
57+
5958

6059
function callbackDblClick(node)
6160
{
6261
// genericCallbackDblClick(node);
6362
}
64-
63+
6564
function callbackCheckboxes(node)
6665
{
6766
// genericCallbackCheckboxes(node);
6867
}
69-
68+
7069
function customElements(node,elements,first)
7170
{
7271
var i = 1;
@@ -87,5 +86,4 @@
8786
});
8887
return html;
8988
}
90-
91-
89+
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
$("#moveTable").treeTable();
2+
$("img.tableLoading").hide();
3+
$("table#moveTable").show();
4+
5+
$('applet').hide();
6+
7+
if($('#selectElements')!=undefined)
8+
{
9+
$('#selectElements').click(function(){
10+
$('#destinationUpload').html($('#selectedDestination').html());
11+
$('#destinationId').val($('#selectedDestinationHidden').val());
12+
$('.destinationUpload').html($('#selectedDestination').html());
13+
$('.destinationId').val($('#selectedDestinationHidden').val());
14+
$( "div.MainDialog" ).dialog('close');
15+
$('applet').show();
16+
17+
if(typeof folderSelectionCallback == 'function')
18+
{
19+
folderSelectionCallback($('#selectedDestination').html(), $('#selectedDestinationHidden').val());
20+
}
21+
return false;
22+
});
23+
}
24+
25+
//dependance: common/browser.js
26+
var ajaxSelectRequest='';
27+
function callbackSelect(node)
28+
{
29+
var selectedElement = node.find('span:eq(1)').html();
30+
31+
var parent = true;
32+
var current = node;
33+
34+
while(parent != null)
35+
{
36+
parent = null;
37+
var classNames = current[0].className.split(' ');
38+
for(key in classNames)
39+
{
40+
if(classNames[key].match("child-of-"))
41+
{
42+
parent = $("#" + classNames[key].substring(9));
43+
}
44+
}
45+
if(parent != null)
46+
{
47+
selectedElement = parent.find('span:eq(1)').html()+'/'+selectedElement;
48+
current = parent;
49+
}
50+
}
51+
52+
$('#selectedDestinationHidden').val(node.attr('element'));
53+
$('#selectedDestination').html(sliceFileName(selectedElement, 40));
54+
$('#selectElements').removeAttr('disabled');
55+
56+
}
57+
58+
$('img.infoLoading').show();
59+
$('div.ajaxInfoElement').html('');
60+
61+
62+
function callbackDblClick(node)
63+
{
64+
// genericCallbackDblClick(node);
65+
}
66+
67+
function callbackCheckboxes(node)
68+
{
69+
// genericCallbackCheckboxes(node);
70+
}
71+
72+
function customElements(node,elements,first)
73+
{
74+
var i = 1;
75+
var id=node.attr('id');
76+
elements['folders'] = jQuery.makeArray(elements['folders']);
77+
78+
var padding=parseInt(node.find('td:first').css('padding-left').slice(0,-2));
79+
var html='';
80+
81+
$.each(elements['folders'], function(index, value) {
82+
if(value['policy']!='0')
83+
{
84+
html+= "<tr id='"+id+"-"+i+"' class='parent child-of-"+id+"' ajax='"+value['folder_id']+"'type='folder' policy='"+value['policy']+"' element='"+value['folder_id']+"'>";
85+
html+= " <td><span class='folder'>"+trimName(value['name'],padding)+"</span></td>";
86+
html+= "</tr>";
87+
i++;
88+
}
89+
});
90+
91+
return html;
92+
93+
94+
}
95+
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
$("#moveTable").treeTable();
2+
$("img.tableLoading").hide();
3+
$("table#moveTable").show();
4+
5+
$('applet').hide();
6+
7+
if($('#selectElements')!=undefined)
8+
{
9+
$('#selectElements').click(function(){
10+
$('#destinationUpload').html($('#selectedDestination').html());
11+
$('#destinationId').val($('#selectedDestinationHidden').val());
12+
$('.destinationUpload').html($('#selectedDestination').html());
13+
$('.destinationId').val($('#selectedDestinationHidden').val());
14+
$( "div.MainDialog" ).dialog('close');
15+
$('applet').show();
16+
17+
if(typeof itemSelectionCallback == 'function')
18+
{
19+
itemSelectionCallback($('#selectedDestination').html(), $('#selectedDestinationHidden').val());
20+
}
21+
return false;
22+
});
23+
}
24+
25+
//dependance: common/browser.js
26+
var ajaxSelectRequest='';
27+
function callbackSelect(node)
28+
{
29+
if(node.attr('type') == 'item')
30+
{
31+
var selectedElement = node.find('span:eq(0)').html();
32+
33+
$('#selectedDestinationHidden').val(node.attr('element'));
34+
$('#selectedDestination').html(sliceFileName(selectedElement, 40));
35+
$('#selectElements').removeAttr('disabled');
36+
}
37+
}
38+
39+
$('img.infoLoading').show();
40+
$('div.ajaxInfoElement').html('');
41+
42+
43+
function callbackDblClick(node)
44+
{
45+
// genericCallbackDblClick(node);
46+
}
47+
48+
function callbackCheckboxes(node)
49+
{
50+
// genericCallbackCheckboxes(node);
51+
}
52+
53+
function customElements(node,elements,first)
54+
{
55+
var i = 1;
56+
var id=node.attr('id');
57+
elements['folders'] = jQuery.makeArray(elements['folders']);
58+
59+
var padding=parseInt(node.find('td:first').css('padding-left').slice(0,-2));
60+
var html='';
61+
62+
$.each(elements['folders'], function(index, value) {
63+
if(value['policy']!='0')
64+
{
65+
html+= "<tr id='"+id+"-"+i+"' class='parent child-of-"+id+"' ajax='"+value['folder_id']+"'type='folder' policy='"+value['policy']+"' element='"+value['folder_id']+"'>";
66+
html+= " <td><span class='folder'>"+trimName(value['name'],padding)+"</span></td>";
67+
html+= "</tr>";
68+
i++;
69+
}
70+
});
71+
72+
$.each(elements['items'], function(index, value) {
73+
74+
html+= "<tr id='"+id+"-"+i+"' class='child-of-"+id+"' privacy='"+value['privacy_status']+"' type='item' policy='"+value['policy']+"' element='"+value['item_id']+"'>";
75+
html+= " <td><span class='file'>"+trimName(value['name'],padding)+"</span></td>";
76+
html+= "</tr>";
77+
i++;
78+
});
79+
return html;
80+
81+
82+
}
83+

0 commit comments

Comments
 (0)