2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
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.
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
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
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.
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.
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 ********************************************************************************/
39 <script language="javascript">
42 SUGAR.util.doWhen(function(){
43 return typeof cal_loaded != 'undefined' && cal_loaded == true && typeof dom_loaded != 'undefined' && dom_loaded == true;
45 CAL.toggle_shared_edit();
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)
57 var sel = new Array();
59 for(i = 0; i < obj.length; i++){
60 if(obj[i].selected == true) {
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;
77 var td = document.getElementById(name+'_td');
78 var obj = td.getElementsByTagName('select')[0];
79 if(obj.tagName.toLowerCase() != "select" && obj.length < 2)
81 var sel = new Array();
82 for(i=obj.length-1; i>-1; i--){
83 if(obj[i].selected == true) {
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;
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>
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">
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">
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>
122 <a onclick="up('shared_ids');">{$UP}</a><br>
123 <a onclick="down('shared_ids');">{$DOWN}</a>
130 <div class="ft" style="text-align: right;">
131 <input id="sharedCalUsersSelectBtn" 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 id="sharedCalUsersCancelBtn" 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}">