[Vtigercrm-commits] [vtiger-commits] r4364 - in /vtigercrm/trunk: Smarty/templates/ListView.tpl Smarty/templates/ListViewEntries.tpl modules/Leads/Lead.js modules/Leads/ListView.php modules/Users/updateLeadDBStatus.php themes/blue/style.css
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Tue Mar 21 05:36:52 EST 2006
Author: saraj
Date: Tue Mar 21 03:36:37 2006
New Revision: 4364
Log:
change state operations ajaxified
Modified:
vtigercrm/trunk/Smarty/templates/ListView.tpl
vtigercrm/trunk/Smarty/templates/ListViewEntries.tpl
vtigercrm/trunk/modules/Leads/Lead.js
vtigercrm/trunk/modules/Leads/ListView.php
vtigercrm/trunk/modules/Users/updateLeadDBStatus.php
vtigercrm/trunk/themes/blue/style.css
Modified: vtigercrm/trunk/Smarty/templates/ListView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/ListView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/ListView.tpl Tue Mar 21 03:36:37 2006
@@ -281,9 +281,9 @@
{elseif $button_check eq 's_cmail'}
<input class="small" type="submit" value="{$button_label}" onclick="return massMail()"/>
{elseif $button_check eq 'c_owner'}
- <input class="small" type="submit" value="{$button_label}" onclick="this.form.change_owner.value='true'; return changeStatus()"/>
+ <input class="small" type="button" value="{$button_label}" onclick="return changeStatus(this,'changeowner')"/>
{elseif $button_check eq 'c_status'}
- <input class="small" type="submit" value="{$button_label}" onclick="this.form.change_status.value='true'; return changeStatus()"/>
+ <input class="small" type="button" value="{$button_label}" onclick="return changeStatus(this,'changestatus')"/>
{/if}
{/foreach}
@@ -330,9 +330,9 @@
{elseif $button_check eq 's_cmail'}
<input class="small" type="submit" value="{$button_label}" onclick="return massMail()"/>
{elseif $button_check eq 'c_owner'}
- <input class="small" type="submit" value="{$button_label}" onclick="this.form.change_owner.value='true'; return changeStatus()"/>
+ <input class="small" type="button" value="{$button_label}" onclick="return changeStatus(this,'changeowner')"/>
{elseif $button_check eq 'c_status'}
- <input class="small" type="submit" value="{$button_label}" onclick="this.form.change_status.value='true'; return changeStatus()"/>
+ <input class="small" type="button" value="{$button_label}" onclick="return changeStatus(this,'changestatus')"/>
{/if}
{/foreach}
@@ -364,8 +364,95 @@
</tr>
</table>
<div id="status" style="display:none;position:absolute;background-color:#bbbbbb;left:887px;top:0px;height:17px;white-space:nowrap;"">Processing Request...</div>
+
+{if $MODULE eq 'Leads'}
+
+<div id="changeowner" class="statechange">
+<table width="100%" border="0" cellpadding="3" cellspacing="0">
+<tr>
+ <td class="genHeaderSmall" align="left" style="border-bottom:1px solid #CCCCCC;" width="60%">Change Owner</td>
+ <td style="border-bottom: 1px solid rgb(204, 204, 204);"> </td>
+ <td align="right" style="border-bottom:1px solid #CCCCCC;" width="40%"><a href="javascript:fninvsh('changeowner')">Close</a></td>
+</tr>
+<tr>
+ <td colspan="3"> </td>
+</tr>
+<tr>
+ <td width="50%"><b>Transfer Ownership to</b></td>
+ <td width="2%"><b>:</b></td>
+ <td width="48%">
+ <select name="lead_owner" id="lead_owner" class="detailedViewTextBox">
+ {$CHANGE_OWNER}
+ </select>
+ </td>
+</tr>
+<tr><td colspan="3" style="border-bottom:1px dashed #CCCCCC;"> </td></tr>
+<tr>
+ <td colspan="3" align="center">
+
+ <input type="button" name="button" class="small" value="Update Owner" onClick="ajaxChangeStatus('owner')">
+</td>
+</tr>
+</table>
+</div>
+
+
+<div id="changestatus" class="statechange">
+<table width="100%" border="0" cellpadding="3" cellspacing="0">
+<tr>
+ <td class="genHeaderSmall" align="left" style="border-bottom:1px solid #CCCCCC;" width="60%">Change Status Information</td>
+ <td style="border-bottom: 1px solid rgb(204, 204, 204);"> </td>
+ <td align="right" style="border-bottom:1px solid #CCCCCC;" width="40%"><a href="javascript:fninvsh('changestatus')">Close</a></td>
+</tr>
+<tr>
+ <td colspan="3"> </td>
+</tr>
+<tr>
+ <td width="50%"><b>Select New Status</b></td>
+ <td width="2%"><b>:</b></td>
+ <td width="48%">
+ <select name="lead_status" id="lead_status" class="detailedViewTextBox">
+ {$CHANGE_STATUS}
+ </select>
+ </td>
+</tr>
+<tr><td colspan="3" style="border-bottom:1px dashed #CCCCCC;"> </td></tr>
+<tr>
+ <td colspan="3" align="center">
+
+ <input type="button" name="button" class="small" value="Update Status" onClick="ajaxChangeStatus('status')">
+</td>
+</tr>
+</table>
+</div>
+<script>
+{literal}
+function ajaxChangeStatus(statusname)
+{
+ fninvsh('changestatus');
+ fninvsh('changeowner');
+ show("status");
+ var ajaxObj = new Ajax(ajaxSaveResponse);
+ var viewid = document.massdelete.viewname.value;
+ var idstring = document.massdelete.idlist.value;
+ if(statusname == 'status')
+ {
+ var url='&leadval='+document.getElementById('lead_status').options[document.getElementById('lead_status').options.selectedIndex].value;
+ }
+ else if(statusname == 'owner')
+ {
+ var url='&user_id='+document.getElementById('lead_owner').options[document.getElementById('lead_owner').options.selectedIndex].value;
+ }
+
+
+ var urlstring ="module=Users&action=updateLeadDBStatus&return_module=Leads"+url+"&viewname="+viewid+"&idlist="+idstring;
+ ajaxObj.process("index.php?",urlstring);
+}
+</script>
+{/literal}
+{/if}
+
{if $MODULE eq 'Contacts'}
-
{literal}
<script>
function modifyimage(divid,imagename)
Modified: vtigercrm/trunk/Smarty/templates/ListViewEntries.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/ListViewEntries.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/ListViewEntries.tpl Tue Mar 21 03:36:37 2006
@@ -15,11 +15,11 @@
{elseif $button_check eq 's_mail'}
<input class="small" type="submit" value="{$button_label}" onclick="return eMail()"/>
{elseif $button_check eq 's_cmail'}
- <input class="small" type="submit" value="{$button_label}" onclick="return massMail()"/>
+ <input class="small" type="button" value="{$button_label}" onclick="return massMail()"/>
{elseif $button_check eq 'c_owner'}
- <input class="small" type="submit" value="{$button_label}" onclick="this.form.change_owner.value='true'; return changeStatus()"/>
+ <input class="small" type="button" value="{$button_label}" onclick="return changeStatus(this,'changeowner')"/>
{elseif $button_check eq 'c_status'}
- <input class="small" type="submit" value="{$button_label}" onclick="this.form.change_status.value='true'; return changeStatus()"/>
+ <input class="small" type="button" value="{$button_label}" onclick="return changeStatus(this,'changestatus')"/>
{/if}
{/foreach}
@@ -66,9 +66,9 @@
{elseif $button_check eq 's_cmail'}
<input class="small" type="submit" value="{$button_label}" onclick="return massMail()"/>
{elseif $button_check eq 'c_owner'}
- <input class="small" type="submit" value="{$button_label}" onclick="this.form.change_owner.value='true'; return changeStatus()"/>
+ <input class="small" type="button" value="{$button_label}" onclick="return changeStatus(this,'changeowner')"/>
{elseif $button_check eq 'c_status'}
- <input class="small" type="submit" value="{$button_label}" onclick="this.form.change_status.value='true'; return changeStatus()"/>
+ <input class="small" type="button" value="{$button_label}" onclick="return changeStatus(this,'changestatus')"/>
{/if}
{/foreach}
Modified: vtigercrm/trunk/modules/Leads/Lead.js
==============================================================================
--- vtigercrm/trunk/modules/Leads/Lead.js (original)
+++ vtigercrm/trunk/modules/Leads/Lead.js Tue Mar 21 03:36:37 2006
@@ -216,7 +216,7 @@
document.massdelete.action="index.php?module=CustomView&action=SendMailAction&return_module=Leads&return_action=index&viewname="+viewid;
}
-function changeStatus()
+function changeStatus(obj,divid)
{
x = document.massdelete.selected_id.length;
var viewid = document.massdelete.viewname.value;
@@ -255,9 +255,8 @@
alert("Please select atleast one entity");
return false;
}
- }
-
- document.massdelete.action="index.php?module=Users&action=massChangeStatus&parenttab=Sales&viewname="+viewid;
+ }
+ fnvshobj(obj,divid);
}
//to merge to a list of leads
Modified: vtigercrm/trunk/modules/Leads/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Leads/ListView.php (original)
+++ vtigercrm/trunk/modules/Leads/ListView.php Tue Mar 21 03:36:37 2006
@@ -67,6 +67,18 @@
$_SESSION['LEADS_SORT_ORDER'] = $sorder;
//<<<<<<<<<<<<<<<<<<< sorting - stored in session >>>>>>>>>>>>>>>>>>>>
+//for change owner and change status
+$change_status = get_select_options_with_id($comboFieldArray['leadstatus_dom'], $focus->lead_status);
+$smarty->assign("CHANGE_STATUS",$change_status);
+$result=$adb->query("select * from users");
+for($i=0;$i<$adb->num_rows($result);$i++)
+{
+ $useridlist[$i]=$adb->query_result($result,$i,'id');
+ $usernamelist[$useridlist[$i]]=$adb->query_result($result,$i,'user_name');
+}
+$change_owner = get_select_options_with_id($usernamelist, $focus->lead_owner);
+$smarty->assign("CHANGE_OWNER",$change_owner);
+
if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true')
Modified: vtigercrm/trunk/modules/Users/updateLeadDBStatus.php
==============================================================================
--- vtigercrm/trunk/modules/Users/updateLeadDBStatus.php (original)
+++ vtigercrm/trunk/modules/Users/updateLeadDBStatus.php Tue Mar 21 03:36:37 2006
@@ -11,13 +11,12 @@
********************************************************************************/
-
-
require_once('include/database/PearDatabase.php');
-$idlist= $_POST['idlist'];
-$leadstatusval = $_POST['leadval'];
+$idlist= $_REQUEST['idlist'];
+$leadstatusval = $_REQUEST['leadval'];
$idval=$_REQUEST['user_id'];
+$viewid = $_REQUEST['viewname'];
global $current_user;
global $adb;
$storearray = explode(";",$idlist);
@@ -41,6 +40,6 @@
$result1 = $adb->query($query);
}
}
-header("Location: index.php?module=Leads&action=index");
+header("Location: index.php?module=Leads&action=LeadsAjax&file=ListView&ajax=changestate&viewname=".$viewid);
?>
Modified: vtigercrm/trunk/themes/blue/style.css
==============================================================================
--- vtigercrm/trunk/themes/blue/style.css (original)
+++ vtigercrm/trunk/themes/blue/style.css Tue Mar 21 03:36:37 2006
@@ -1517,4 +1517,29 @@
border:1px solid #666666;
text-align:center;
}
-
+/*cloud css*/
+.cloudLft{
+ background-image:url(images/cloud_left_bdr.gif);
+ background-position:left top;
+ background-repeat:repeat-y;
+}
+
+.cloudRht{
+ background-image:url(images/cloud_right_bdr.gif);
+ background-position:right top;
+ background-repeat:repeat-y;
+}
+
+a.tagit{
+ font-family:Verdana, Arial, Helvetica, sans-serif;
+ color:#000066;
+ text-decoration:none;
+}
+
+a.tagit:hover{
+ font-family:Verdana, Arial, Helvetica, sans-serif;
+ color:#FFFFFF;
+ text-decoration:none;
+ background-color:#000066;
+ opacity:.7;
+}
More information about the vtigercrm-commits
mailing list