[Vtigercrm-commits] [vtiger-commits] r10147 - in /vtigercrm/branches/5.0.3/modules/Calendar: Activity.php Save.php addEventUI.php calendar_share.php script.js
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Tue Feb 6 08:01:56 EST 2007
Author: saraj
Date: Tue Feb 6 06:01:48 2007
New Revision: 10147
Log:
changes made to fix invitee related issue --Minnie
Modified:
vtigercrm/branches/5.0.3/modules/Calendar/Activity.php
vtigercrm/branches/5.0.3/modules/Calendar/Save.php
vtigercrm/branches/5.0.3/modules/Calendar/addEventUI.php
vtigercrm/branches/5.0.3/modules/Calendar/calendar_share.php
vtigercrm/branches/5.0.3/modules/Calendar/script.js
Modified: vtigercrm/branches/5.0.3/modules/Calendar/Activity.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Calendar/Activity.php (original)
+++ vtigercrm/branches/5.0.3/modules/Calendar/Activity.php Tue Feb 6 06:01:48 2007
@@ -145,12 +145,12 @@
{
$selected_users_string = $_REQUEST['inviteesid'];
$invitees_array = explode(';',$selected_users_string);
- $this->insertIntoInviteeTable('vtiger_invitees',$module,$invitees_array);
+ $this->insertIntoInviteeTable($module,$invitees_array);
}
//Inserting into sales man activity rel
- $this->insertIntoSmActivityRel($module);
+ $this->insertIntoSmActivityRel($module,$invitees_array);
@@ -313,10 +313,14 @@
* @param $module -- module:: Type varchar
* @param $invitees_array Array
*/
- function insertIntoInviteeTable($table_name,$module,$invitees_array)
+ function insertIntoInviteeTable($module,$invitees_array)
{
global $log,$adb;
- $log->debug("Entering insertIntoInviteeTable(".$table_name.",".$module.",".$invitees_array.") method ...");
+ $log->debug("Entering insertIntoInviteeTable(".$module.",".$invitees_array.") method ...");
+ if($this->mode == 'edit'){
+ $sql = "delete from vtiger_invitees where activityid=".$this->id;
+ $adb->query($sql);
+ }
foreach($invitees_array as $inviteeid)
{
if($inviteeid != '')
@@ -334,20 +338,24 @@
* @param $module -- module:: Type varchar
*/
- function insertIntoSmActivityRel($module)
+ function insertIntoSmActivityRel($module,$invitees_array)
{
global $adb;
global $current_user;
- if($this->mode == 'edit')
- {
-
- $sql = "delete from vtiger_salesmanactivityrel where activityid=".$this->id." and smid = ".$this->column_fields['assigned_user_id']."";
+ if($this->mode == 'edit'){
+ $sql = "delete from vtiger_salesmanactivityrel where activityid=".$this->id;
$adb->query($sql);
-
}
$sql_qry = "insert into vtiger_salesmanactivityrel (smid,activityid) values(".$this->column_fields['assigned_user_id'].",".$this->id.")";
+ foreach($invitees_array as $inviteeid)
+ {
+ if($inviteeid != '')
+ {
+ $query="insert into vtiger_salesmanactivityrel values(".$inviteeid.",".$this->id.")";
+ $adb->query($query);
+ }
+ }
$adb->query($sql_qry);
-
}
Modified: vtigercrm/branches/5.0.3/modules/Calendar/Save.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Calendar/Save.php (original)
+++ vtigercrm/branches/5.0.3/modules/Calendar/Save.php Tue Feb 6 06:01:48 2007
@@ -33,7 +33,6 @@
$activity_mode = $_REQUEST['activity_mode'];
$tab_type = 'Calendar';
$focus->column_fields["activitytype"] = 'Task';
-
if(isset($_REQUEST['record']))
{
$focus->id = $_REQUEST['record'];
@@ -160,6 +159,7 @@
$selected_users_string = $_REQUEST['inviteesid'];
$invitees_array = explode(';',$selected_users_string);
$subject = $_REQUEST['activity_mode'].' : '.$_REQUEST['subject'];
+ $record = $focus->id;
foreach($invitees_array as $inviteeid)
{
if($inviteeid != '')
@@ -167,9 +167,6 @@
$description=getActivityDetails($_REQUEST['description'],$inviteeid);
$to_email = getUserEmailId('id',$inviteeid);
$mail_status = send_mail('Calendar',$to_email,$current_user->user_name,'',$subject,$description);
- $record = $focus->id;
- $sql = "insert into vtiger_salesmanactivityrel values (".$inviteeid.",".$record.")";
- $adb->query($sql);
}
}
}
Modified: vtigercrm/branches/5.0.3/modules/Calendar/addEventUI.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Calendar/addEventUI.php (original)
+++ vtigercrm/branches/5.0.3/modules/Calendar/addEventUI.php Tue Feb 6 06:01:48 2007
@@ -398,8 +398,8 @@
</td>
<td width=20% align=center valign=top>
- <input type=button value="<?php echo $mod_strings['LBL_ADD_BUTTON'] ?> >>" class="crm button small save" style="width:100%" onClick="addColumn()"><br>
- <input type=button value="<< <?php echo $mod_strings['LBL_RMV_BUTTON'] ?> " class="crm button small cancel" style="width:100%" onClick="delColumn()">
+ <input type=button value="<?php echo $mod_strings['LBL_ADD_BUTTON'] ?> >>" class="crm button small save" style="width:100%" onClick="incUser('availableusers','selectedusers')"><br>
+ <input type=button value="<< <?php echo $mod_strings['LBL_RMV_BUTTON'] ?> " class="crm button small cancel" style="width:100%" onClick="rmvUser('selectedusers')">
</td>
<td width=40% align=center valign=top>
<select name="selectedusers" id="selectedusers" class=small size=5 multiple style="height:70px;width:100%">
Modified: vtigercrm/branches/5.0.3/modules/Calendar/calendar_share.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Calendar/calendar_share.php (original)
+++ vtigercrm/branches/5.0.3/modules/Calendar/calendar_share.php Tue Feb 6 06:01:48 2007
@@ -127,8 +127,8 @@
</td>
<td width=20% align=center valign=top>
- <input type=button value="<?php echo $mod_strings['LBL_ADD_BUTTON'] ?> >>" class="crm button small save" style="width:100%" onClick="addsharedColumn('available_users','selected_users')"><br>
- <input type=button value="<< <?php echo $mod_strings['LBL_RMV_BUTTON'] ?> " class="crm button small cancel" style="width:100%" onClick="delsharedColumn('selected_users')">
+ <input type=button value="<?php echo $mod_strings['LBL_ADD_BUTTON'] ?> >>" class="crm button small save" style="width:100%" onClick="incUser('available_users','selected_users')"><br>
+ <input type=button value="<< <?php echo $mod_strings['LBL_RMV_BUTTON'] ?> " class="crm button small cancel" style="width:100%" onClick="rmvUser('selected_users')">
</td>
<td>
<select name="selected_users" id="selected_users" class=small size=5 multiple style="height:70px;width:100%">
Modified: vtigercrm/branches/5.0.3/modules/Calendar/script.js
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Calendar/script.js (original)
+++ vtigercrm/branches/5.0.3/modules/Calendar/script.js Tue Feb 6 06:01:48 2007
@@ -632,12 +632,6 @@
var moveupLinkObj,moveupDisabledObj,movedownLinkObj,movedownDisabledObj;
-function setObjects()
-{
- availListObj=getObj("availableusers")
- selectedColumnsObj=getObj("selectedusers")
-
-}
function userEventSharing(selectedusrid,selcolid)
{
@@ -645,106 +639,7 @@
}
-
-
-function addColumn()
-{
- setObjects();
- var selectlength=selectedColumnsObj.length
- var availlength=availListObj.length
-
- var s=0
- for (i=0;i<selectlength;i++)
- {
- selectedColumnsObj.options[i].selected=false
- }
- for (i=0;i<availlength;i++)
- {
- if (availListObj.options[s].selected==true)
- {
-
- for (j=0;j<selectlength;j++)
- {
- if (selectedColumnsObj.options[j].value==availListObj.options[s].value)
- {
-
- var rowFound=true
- var existingObj=selectedColumnsObj.options[j]
-
- break;
- }
- }
- if (rowFound!=true)
- {
- var newColObj=document.createElement("OPTION")
- newColObj.value=availListObj.options[s].value
- if (browser_ie) newColObj.innerText=availListObj.options[s].innerText
- else if (browser_nn4 || browser_nn6) newColObj.text=availListObj.options[s].text
- selectedColumnsObj.appendChild(newColObj)
- availListObj.removeChild(availListObj.options[s])
- newColObj.selected=true
- rowFound=false
- }
- else
- {
- existingObj.selected=true
-
- }
- }
- else
- s++
- }
-}
-function delColumn()
-{
-
- setObjects();
- var selectlength=selectedColumnsObj.length
- var availlength=availListObj.length
- var s=0
- for (i=0;i<availlength;i++)
- {
- availListObj.options[i].selected=false
- }
- for (i=0;i<selectlength;i++)
- {
- if (selectedColumnsObj.options[s].selected==true)
- {
- for (j=0;j<availlength;j++)
- {
- if (availListObj.options[j].value==selectedColumnsObj.options[s].value)
- {
- var rowFound=true
- var existingObj=availListObj.options[j]
- break;
- }
- }
-
- if (rowFound!=true)
- {
- var newColObj=document.createElement("OPTION")
- newColObj.value=selectedColumnsObj.options[s].value
- if (browser_ie) newColObj.innerText=selectedColumnsObj.options[s].innerText
- else if (browser_nn4 || browser_nn6)
- newColObj.text=selectedColumnsObj.options[s].text
- availListObj.appendChild(newColObj)
- selectedColumnsObj.removeChild(selectedColumnsObj.options[s])
- newColObj.selected=true
- rowFound=false
- }
- else
- {
- existingObj.selected=true
- }
- }
- else
- s++
-
- }
-
-
-}
-function addsharedColumn(avail_users,sel_users)
+function incUser(avail_users,sel_users)
{
availListObj=getObj(avail_users)
selectedColumnsObj=getObj(sel_users)
@@ -787,7 +682,7 @@
}
}
-function delsharedColumn(sel_users)
+function rmvUser(sel_users)
{
selectedColumnsObj=getObj(sel_users)
var selectlength=selectedColumnsObj.options.length
More information about the vtigercrm-commits
mailing list