]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Calendar/tpls/shared_users.tpl
Release 6.5.0
[Github/sugarcrm.git] / modules / Calendar / tpls / shared_users.tpl
1 {*
2 /*********************************************************************************
3  * SugarCRM Community Edition is a customer relationship management program developed by
4  * SugarCRM, Inc. Copyright (C) 2004-2012 SugarCRM Inc.
5  * 
6  * This program is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Affero General Public License version 3 as published by the
8  * Free Software Foundation with the addition of the following permission added
9  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
11  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
12  * 
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
16  * details.
17  * 
18  * You should have received a copy of the GNU Affero General Public License along with
19  * this program; if not, see http://www.gnu.org/licenses or write to the Free
20  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  * 02110-1301 USA.
22  * 
23  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
24  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
25  * 
26  * The interactive user interfaces in modified source and object code versions
27  * of this program must display Appropriate Legal Notices, as required under
28  * Section 5 of the GNU Affero General Public License version 3.
29  * 
30  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31  * these Appropriate Legal Notices must retain the display of the "Powered by
32  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
33  * technical reasons, the Appropriate Legal Notices must display the words
34  * "Powered by SugarCRM".
35  ********************************************************************************/
36
37 *}
38
39 <script language="javascript">
40 {if $edit_shared}
41         {literal}
42         SUGAR.util.doWhen(function(){
43                 return typeof cal_loaded != 'undefined' && cal_loaded == true && typeof dom_loaded != 'undefined' && dom_loaded == true;        
44         },function(){
45                 CAL.toggle_shared_edit();
46         });
47         {/literal}
48 {/if}
49
50 {literal}
51                         function up(name){
52                                 var td = document.getElementById(name+'_td');
53                                 var obj = td.getElementsByTagName('select')[0];
54                                 obj =(typeof obj == "string") ? document.getElementById(obj) : obj;
55                                 if(obj.tagName.toLowerCase() != "select" && obj.length < 2)
56                                         return false;
57                                 var sel = new Array();
58                                                         
59                                 for(i = 0; i < obj.length; i++){
60                                         if(obj[i].selected == true) {
61                                                 sel[sel.length] = i;
62                                         }
63                                 }
64                                 for(i in sel){
65                                         if(sel[i] != 0 && !obj[sel[i]-1].selected) {
66                                                 var tmp = new Array(obj[sel[i]-1].text, obj[sel[i]-1].value);
67                                                 obj[sel[i]-1].text = obj[sel[i]].text;
68                                                 obj[sel[i]-1].value = obj[sel[i]].value;
69                                                 obj[sel[i]].text = tmp[0];
70                                                 obj[sel[i]].value = tmp[1];
71                                                 obj[sel[i]-1].selected = true;
72                                                 obj[sel[i]].selected = false;
73                                         }
74                                 }
75                         }                       
76                         function down(name){
77                                 var td = document.getElementById(name+'_td');
78                                 var obj = td.getElementsByTagName('select')[0];
79                                 if(obj.tagName.toLowerCase() != "select" && obj.length < 2)
80                                         return false;
81                                 var sel = new Array();
82                                 for(i=obj.length-1; i>-1; i--){
83                                         if(obj[i].selected == true) {
84                                                 sel[sel.length] = i;
85                                         }
86                                 }
87                                 for(i in sel){
88                                         if(sel[i] != obj.length-1 && !obj[sel[i]+1].selected) {
89                                                 var tmp = new Array(obj[sel[i]+1].text, obj[sel[i]+1].value);
90                                                 obj[sel[i]+1].text = obj[sel[i]].text;
91                                                 obj[sel[i]+1].value = obj[sel[i]].value;
92                                                 obj[sel[i]].text = tmp[0];
93                                                 obj[sel[i]].value = tmp[1];
94                                                 obj[sel[i]+1].selected = true;
95                                                 obj[sel[i]].selected = false;
96                                         }
97                                 }
98                         }
99 {/literal}
100 </script>
101
102 <div id="shared_cal_edit" style="display: none; width: 400px;">
103 <form name="shared_cal" action="index.php" method="post">
104 <div class="hd">{$MOD.LBL_EDIT_USERLIST}</div>
105 <div class="bd">        
106         <input type="hidden" name="module" value="Calendar">
107         <input type="hidden" name="action" value="index">
108         <input type="hidden" name="edit_shared" value="">
109         <input type="hidden" name="view" value="shared">
110         
111         
112         <table cellpadding="0" cellspacing="3" border="0" align="center" width="100%">
113                 <tr><th valign="top" align="center" colspan="2">{$MOD.LBL_SELECT_USERS}</th></tr>
114                 <tr><td valign="top"></td><td valign="top">
115                         <table cellpadding="1" cellspacing="1" border="0" class="edit view" align="center">
116                                 <tr>
117                                         <td valign="top" nowrap=""><b>{$MOD.LBL_USERS}:</b></td>
118                                         <td valign="top" id="shared_ids_td">
119                                                 <select id="shared_ids" name="shared_ids[]" multiple size="8">{$users_options}</select>
120                                         </td>                                   
121                                         <td>
122                                                 <a onclick="up('shared_ids');">{$UP}</a><br>
123                                                 <a onclick="down('shared_ids');">{$DOWN}</a>
124                                         </td>
125                                 </tr>
126                         </table>
127                 </td></tr>
128         </table>
129 </div>
130 <div class="ft" style="text-align: right;">
131         <input class="button" type="button" title="{$APP.LBL_SELECT_BUTTON_TITLE}" accesskey="{$APP.LBL_SELECT_BUTTON_KEY}" value="{$APP.LBL_SELECT_BUTTON_LABEL}" onclick="document.shared_cal.submit();"> 
132         <input class="button" onclick="CAL.sharedDialog.cancel();" type="button" title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accesskey="{$APP.LBL_CANCEL_BUTTON_KEY}" value="{$APP.LBL_CANCEL_BUTTON_LABEL}">
133 </div>
134 </form>
135 </div>