[Vtigercrm-commits] [vtiger-commits] r6436 - in /vtigercrm/trunk: Smarty/templates/ modules/Portal/ modules/Portal/language/ themes/blue/images/
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Thu May 25 15:28:15 EDT 2006
Author: don
Date: Thu May 25 13:27:58 2006
New Revision: 6436
Log:
new UI for Portal has been integrated
Added:
vtigercrm/trunk/Smarty/templates/MySites.tpl (with props)
vtigercrm/trunk/Smarty/templates/MySitesContents.tpl
vtigercrm/trunk/Smarty/templates/MySitesManage.tpl
vtigercrm/trunk/modules/Portal/PortalAjax.php
vtigercrm/trunk/modules/Portal/Save.php
vtigercrm/trunk/themes/blue/images/site_hdr.jpg (with props)
vtigercrm/trunk/themes/blue/images/site_sel.jpg (with props)
vtigercrm/trunk/themes/blue/images/site_unsel.jpg (with props)
Removed:
vtigercrm/trunk/Smarty/templates/Portal.tpl
Modified:
vtigercrm/trunk/modules/Portal/Delete.php
vtigercrm/trunk/modules/Portal/ListView.php
vtigercrm/trunk/modules/Portal/Popup.php
vtigercrm/trunk/modules/Portal/Portal.js
vtigercrm/trunk/modules/Portal/Portal.php
vtigercrm/trunk/modules/Portal/index.php
vtigercrm/trunk/modules/Portal/language/en_us.lang.php
Modified: vtigercrm/trunk/modules/Portal/Delete.php
==============================================================================
--- vtigercrm/trunk/modules/Portal/Delete.php (original)
+++ vtigercrm/trunk/modules/Portal/Delete.php Thu May 25 13:27:58 2006
@@ -1,22 +1,13 @@
<?php
/*********************************************************************************
- * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
- * ("License"); You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
- * the specific language governing rights and limitations under the License.
- * The Original Code is: SugarCRM Open Source
- * The Initial Developer of the Original Code is SugarCRM, Inc.
- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
- * All Rights Reserved.
- * Contributor(s): ______________________________________.
- ********************************************************************************/
-/*********************************************************************************
- * $Header$
- * Description: Deletes an Account record and then redirects the browser to the
- * defined return URL.
- ********************************************************************************/
+** The contents of this file are subject to the vtiger CRM Public License Version 1.0
+* ("License"); You may not use this file except in compliance with the License
+* The Original Code is: vtiger CRM Open Source
+* The Initial Developer of the Original Code is vtiger.
+* Portions created by vtiger are Copyright (C) vtiger.
+* All Rights Reserved.
+*
+********************************************************************************/
if(!isset($_REQUEST['record']))
@@ -25,5 +16,5 @@
DeleteEntity($_REQUEST['module'],$_REQUEST['return_module'],'',$_REQUEST['record'],'');
//code added for returning back to the current view after delete from list view
-header("Location: index.php?module=".$_REQUEST['return_module']."&action=".$_REQUEST['return_action']);
+header("Location: index.php?action=PortalAjax&module=Portal&file=ListView&mode=ajax&datamode=manage");
?>
Modified: vtigercrm/trunk/modules/Portal/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Portal/ListView.php (original)
+++ vtigercrm/trunk/modules/Portal/ListView.php Thu May 25 13:27:58 2006
@@ -16,6 +16,7 @@
global $app_strings;
global $mod_strings;
+global $currentModule;
global $current_language;
$current_module_strings = return_module_language($current_language, 'Portal');
global $adb;
@@ -34,22 +35,18 @@
$portal_info[]=$portal_array;
}
$smarty = new vtigerCRM_Smarty;
-$portal_def = Array();
-if($_REQUEST['portalid'] != '')
-{
- $query="select * from portal where portalid =".$_REQUEST['portalid'];
-}else
-{
- $query="select * from portal";
-}
- $result=$adb->query($query);
- $portal_def [] = $adb->query_result($result,0,'portalurl');
- $portal_def [] = $adb->query_result($result,0,'portalid');
- $smarty->assign("DEFPORTAL_DETAILS", $portal_def);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("PORTALS", $portal_info);
-$smarty->display("Portal.tpl");
+$smarty->assign("MODULE", $currentModule);
+$smarty->assign("CATEGORY", getParentTab());
+if($_REQUEST['datamode'] == 'data')
+ $smarty->display("MySitesContents.tpl");
+elseif($_REQUEST['datamode'] == 'manage')
+ $smarty->display("MySitesManage.tpl");
+else
+ $smarty->display("MySites.tpl");
+
?>
Modified: vtigercrm/trunk/modules/Portal/Popup.php
==============================================================================
--- vtigercrm/trunk/modules/Portal/Popup.php (original)
+++ vtigercrm/trunk/modules/Portal/Popup.php Thu May 25 13:27:58 2006
@@ -13,30 +13,44 @@
global $app_strings;
global $app_list_strings;
global $mod_strings;
+global $adb;
+if(isset($_REQUEST['record']) && $_REQUEST['record'] !='')
+{
+ $portalid = $_REQUEST['record'];
+ $query="select * from portal where portalid =$portalid";
+ $result=$adb->query($query);
+ $portalname = $adb->query_result($result,0,'portalname');
+ $portalurl = $adb->query_result($result,0,'portalurl');
+}
$portal_inputs='';
-if(isset($_REQUEST['portalurl']) && $_REQUEST['portalurl']!='')
-{
- $result=SavePortal($_REQUEST['portalname'],$_REQUEST['portalurl']);
- if($result != '')
- {
- $portal_inputs.="<script>";
- $portal_inputs.="var location_portal = window.opener.location.href;";
- $portal_inputs.="location_array = location_portal.split('&portalid=');";
- $portal_inputs.="location_portal = location_array[0]+'&portalid=".$result."';";
- $portal_inputs.="window.opener.location.href = location_portal;";
- $portal_inputs.="window.self.close();</script>";
- }
-}
+$portal_inputs.='<div style="display:block;position:relative;" id="orgLay">
+ <table border="0" cellpadding="5" cellspacing="0" width="100%">
+ <tbody><tr>
+ <td class="genHeaderSmall" align="left" width="30%">Add Bookmark</td>
+ <td align="right" width="80%"><a href="javascript:fninvsh(\'orgLay\');"><img src="../themes/blue/images/close.gif" align="absmiddle" border="0"></a></td>
+ </tr>
+ <tr><td colspan="2"><hr></td></tr>
+ <tr>
+ <td align="right"><b>Bookmark URL :</b></td>
+ <td align="left"><input name="portalurl" id="portalurl" class="txtBox" value="'.$portalurl.'" type="text"></td>
+ </tr>
+ <tr>
+ <td align="right"><b>Bookmark Name : </b></td>
+ <td align="left"><input name="portalname" id="portalname" value="'.$portalname.'" class="txtBox" type="text"></td>
+ </tr>
+ <tr><td style="border-bottom: 1px dashed rgb(204, 204, 204);" colspan="2"> </td></tr>
+
+ <tr>
+ <td colspan="2" align="center">
+ <input name="save" value=" Save " class="classBtn" onClick="SaveSite(\''.$portalid.'\')" type="button">
+ <input name="cancel" value=" Cancel " class="classBtn" onclick="fninvsh(\'orgLay\');" type="button">
+ </td>
+ </tr>
+ <tr><td colspan="2" style="border-top: 1px dashed rgb(204, 204, 204);"> </td></tr>
+ </tbody></table>
+</div>';
- $portal_inputs.='<form name="NewPortal"><input type="hidden" name="action" value="Popup"><input type="hidden" name="module" value="Portal">';
- $portal_inputs.='<table width="100%" border=0 cellspacing=2 cellpadding=2><tr><td>'.$mod_strings['LBL_ADD_PORTAL'].'</td><td></td></tr><tr><td>'.$mod_strings['LBL_NAME'].'</td><td><input type="text" name="portalname" class="textField" style="width:100%"/></td></tr>';
- $portal_inputs.='<tr><td>'.$mod_strings['LBL_SITE_URL'].'</td><td><input type="text" name="portalurl" class="textField" style="width:100%"/></td></tr>';
- $portal_inputs.='<table width="100%" border="0" cellpadding="5" cellspacing="5" class="buttonLayer"><tr>';
- $portal_inputs.='<td align=center><input type="submit" name="Button" value="Add" class="button">';
- $portal_inputs.='<input type="button" value="Cancel" class="button" onClick="window.close()"/>';
- $portal_inputs.='</td></tr></table></form>';
-
echo $portal_inputs;
Modified: vtigercrm/trunk/modules/Portal/Portal.js
==============================================================================
--- vtigercrm/trunk/modules/Portal/Portal.js (original)
+++ vtigercrm/trunk/modules/Portal/Portal.js Thu May 25 13:27:58 2006
@@ -9,35 +9,72 @@
********************************************************************************/
-/***********************************************
-* Tabbed Document Viewer script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
-* This notice MUST stay intact for legal use
-* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
-***********************************************/
-
-var selectedtablink=""
-var tcischecked=false
-
-function handlelink(aobject){
- selectedtablink=aobject.href
- tcischecked=(document.tabcontrol && document.tabcontrol.tabcheck.checked)? true : false
- if (document.getElementById && !tcischecked){
- var tabobj=document.getElementById("tablist")
- var tabobjlinks=tabobj.getElementsByTagName("A")
- for (i=0; i<tabobjlinks.length; i++)
- tabobjlinks[i].className=""
- aobject.className="current"
- document.getElementById("tabiframe").src=selectedtablink
- return false
+function fetchAddSite(id)
+{
+ show('status');
+ var ajaxObj = new Ajax(ajaxeditSiteResp);
+ url ='module=Portal&action=PortalAjax&file=Popup&record='+id;
+ ajaxObj.process("index.php?",url);
+}
+function ajaxeditSiteResp(response)
+{
+ hide('status');
+ document.getElementById('editportal_cont').innerHTML = response.responseText;
+}
+function fetchContents(mode)
+{
+ show('status');
+ if(mode == 'data')
+ {
+ fninvsh('orgLay');
+ getObj('datatab').className = 'SiteSel';
+ getObj('managetab').className = 'SiteUnSel';
}
else
- return true
+ {
+ getObj('datatab').className = 'SiteUnSel';
+ getObj('managetab').className = 'SiteSel';
+ }
+ var ajaxObj = new Ajax(ajaxfetchContentsResp);
+ url ='action=PortalAjax&mode=ajax&module=Portal&file=ListView&datamode='+mode;
+ ajaxObj.process("index.php?",url);
+}
+function ajaxfetchContentsResp(response)
+{
+ hide('status');
+ document.getElementById('portalcont').innerHTML = response.responseText;
+}
+function DeleteSite(id)
+{
+ if(confirm("Are you sure you want to delete ?"))
+ {
+ show('status');
+ var ajaxObj = new Ajax(ajaxfetchContentsResp);
+ url ='action=PortalAjax&mode=ajax&file=Delete&module=Portal&record='+id;
+ ajaxObj.process("index.php?",url);
+ }
+}
+function SaveSite(id)
+{
+ var ajaxObj = new Ajax(ajaxfetchContentsResp);
+ if (document.getElementById('portalurl').value.replace(/^\s+/g, '').replace(/\s+$/g, '').length==0) {
+ alert('Site Url cannot be empty')
+ return false;
+ }
+ if (document.getElementById('portalname').value.replace(/^\s+/g, '').replace(/\s+$/g, '').length==0) {
+ alert('Site Name cannot be empty')
+ return false;
+ }
+ fninvsh('orgLay');
+ show('status');
+ var portalurl = document.getElementById('portalurl').value;
+ var portalname = document.getElementById('portalname').value;
+ url ='action=PortalAjax&mode=ajax&file=Save&module=Portal&portalname='+portalname+'&portalurl='+portalurl+'&record='+id;
+ ajaxObj.process("index.php?",url);
+}
+function setSite(oUrllist)
+{
+ var url = oUrllist.options[oUrllist.options.selectedIndex].value;
+ document.getElementById('locatesite').src = url;
}
-function handleview(){
- tcischecked=document.tabcontrol.tabcheck.checked
- if (document.getElementById && tcischecked){
- if (selectedtablink!="")
- window.location=selectedtablink
- }
-}
Modified: vtigercrm/trunk/modules/Portal/Portal.php
==============================================================================
--- vtigercrm/trunk/modules/Portal/Portal.php (original)
+++ vtigercrm/trunk/modules/Portal/Portal.php Thu May 25 13:27:58 2006
@@ -12,13 +12,22 @@
function SavePortal($portalname,$portalurl)
{
-
global $adb;
$adb->println("just entered the SavePortal method");
-$portalid=$adb->getUniqueID('portal');
-$query="insert into portal values(".$portalid.",'".$portalname."','".$portalurl."',0)";
-$adb->println($query);
-$result=$adb->query($query);
-return $portalid;
+ $portalid=$adb->getUniqueID('portal');
+ $query="insert into portal values(".$portalid.",'".$portalname."','".$portalurl."',0)";
+ $adb->println($query);
+ $result=$adb->query($query);
+ return $portalid;
+}
+
+function UpdatePortal($portalname,$portalurl,$portalid)
+{
+ global $adb;
+ $adb->println("just entered the SavePortal method");
+ $query="update portal set portalname='$portalname' ,portalurl='$portalurl' where portalid=$portalid";
+ $adb->println($query);
+ $result=$adb->query($query);
+ return $portalid;
}
?>
Modified: vtigercrm/trunk/modules/Portal/index.php
==============================================================================
--- vtigercrm/trunk/modules/Portal/index.php (original)
+++ vtigercrm/trunk/modules/Portal/index.php Thu May 25 13:27:58 2006
@@ -1,4 +1,4 @@
-<?
+<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
Modified: vtigercrm/trunk/modules/Portal/language/en_us.lang.php
==============================================================================
--- vtigercrm/trunk/modules/Portal/language/en_us.lang.php (original)
+++ vtigercrm/trunk/modules/Portal/language/en_us.lang.php Thu May 25 13:27:58 2006
@@ -1,18 +1,24 @@
-<?
+<?php
/*********************************************************************************
- * $Header: /cvsroot/vtigercrm/vtiger_crm/modules/Portal/language/en_us.lang.php,v 1.1 2006/02/10 10:51:57 jerrydgeorge Exp $
- * Description: Defines the English language pack
- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
- * All Rights Reserved.
- * Contributor(s): ______________________________________..
- ********************************************************************************/
+** The contents of this file are subject to the vtiger CRM Public License Version 1.0
+* ("License"); You may not use this file except in compliance with the License
+* The Original Code is: vtiger CRM Open Source
+* The Initial Developer of the Original Code is vtiger.
+* Portions created by vtiger are Copyright (C) vtiger.
+* All Rights Reserved.
+*
+********************************************************************************/
+
$mod_strings = Array(
// added for 5.0 beta
-'LBL_OPEN_IN_BROWSER'=>'Open tab links in browser window instead.',
-'LBL_ADD'=>'Add',
-'LBL_ADD_PORTAL'=>'Add Website',
-'LBL_SITE_URL'=>'Site Url',
-'LBL_NAME'=>'Site Name',
+'LBL_BOOKMARKED_URL'=>"BookMarked URL's",
+'LBL_MANAGE_BOOKMARKS'=>'Manage Bookmarks',
+'LBL_BOOKMARK_LIST'=>'Bookmark List',
+'LBL_MY_BOOKMARKS'=>'My Bookmarks',
+'LBL_NEW_BOOKMARK'=>'New Bookmark',
+'LBL_SNO'=>'#',
+'LBL_BOOKMARK_NAME_URL'=>'Bookmark Name & URL',
+'LBL_TOOLS'=>'Tools',
);
?>
More information about the vtigercrm-commits
mailing list