Hello,
I was wondering if anyone know how to make the Assigned to field empty by default in the cases module. We usually create the cases first and later assign them to someone, and that's usually not the person who creates the case.
Thanks
Hello,
I was wondering if anyone know how to make the Assigned to field empty by default in the cases module. We usually create the cases first and later assign them to someone, and that's usually not the person who creates the case.
Thanks
Hi Cássio
Create a custom view.edit.php for Cases module containing something like that:
PHP Code:<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
require_once('include/MVC/View/views/view.edit.php');
class CasesViewEdit extends ViewEdit {
function preDisplay() {
parent::preDisplay();
if($this->bean->id == '') {
$this->ev->focus->assigned_user_id = '';
}
}
}
?>
André Lopes
DevToolKit / Project of the Month - June 2009
Lampada Global Services- Open Source Solutions
Avenida Ipiranga, 318
Bloco B - CJ 1602
São Paulo, SP 01046-010
Brazil
Office: +55 11 3237-3110
Mobile: +55 11 7636-5859
e-mail: andre@lampadaglobal.com
Lampada Global delivers offshore software development and support services to customers around the world.
Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.
I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.
André,
Thank you for the reply. I created the view.edit.php with the code above under custom/modules/Cases/metadata and ran a repar & rebuild but it didn't clear the assigned to field for new tickets. Was that the right folder?
You need to place the view.edit.php file in custom/modules/Cases/views. And there is no need for Repair/Rebuild.
Yes that worked great! Thank you both of you.
I just tried applying the same code to the meetings module but it wouldn't work.
So I opened modules\meetings\views\view.edit.php and changed
to:Code:require_once('include/json_config.php'); require_once('include/MVC/View/views/view.edit.php'); class MeetingsViewEdit extends ViewEdit { function MeetingsViewEdit(){ parent::ViewEdit(); } /** * preDisplay * Override preDisplay to check for presence of 'status' in $_REQUEST * This is to support the "Close And Create New" operation. */ function preDisplay() { if(isset($_REQUEST['status']) && empty($_REQUEST['status'])) { $this->bean->status = ''; } //if if(!empty($_REQUEST['status']) && ($_REQUEST['status'] == 'Held')) { $this->bean->status = 'Held'; } parent::preDisplay(); } function display() { global $json; $json = getJSONobj(); $json_config = new json_config(); if (isset($this->bean->json_id) && !empty ($this->bean->json_id)) { $javascript = $json_config->get_static_json_server(false, true, 'Meetings', $this->bean->json_id); } else { $this->bean->json_id = $this->bean->id; $javascript = $json_config->get_static_json_server(false, true, 'Meetings', $this->bean->id); } $this->ss->assign('JSON_CONFIG_JAVASCRIPT', $javascript); if($this->ev->isDuplicate){ $this->bean->status = $GLOBALS['mod_strings']['LBL_DEFAULT_STATUS']; } //if parent::display(); } }
It seems to work but I don't know if it will break something else...Code:require_once('include/json_config.php'); require_once('include/MVC/View/views/view.edit.php'); class MeetingsViewEdit extends ViewEdit { function preDisplay() { parent::preDisplay(); if($this->bean->id == '') { $this->ev->focus->assigned_user_id = ''; } } } function display() { global $json; $json = getJSONobj(); $json_config = new json_config(); if (isset($this->bean->json_id) && !empty ($this->bean->json_id)) { $javascript = $json_config->get_static_json_server(false, true, 'Meetings', $this->bean->json_id); } else { $this->bean->json_id = $this->bean->id; $javascript = $json_config->get_static_json_server(false, true, 'Meetings', $this->bean->id); } $this->ss->assign('JSON_CONFIG_JAVASCRIPT', $javascript); if($this->ev->isDuplicate){ $this->bean->status = $GLOBALS['mod_strings']['LBL_DEFAULT_STATUS']; } //if parent::display(); }
Last edited by WEB11; 2009-03-31 at 07:24 PM.
André Lopes
DevToolKit / Project of the Month - June 2009
Lampada Global Services- Open Source Solutions
Avenida Ipiranga, 318
Bloco B - CJ 1602
São Paulo, SP 01046-010
Brazil
Office: +55 11 3237-3110
Mobile: +55 11 7636-5859
e-mail: andre@lampadaglobal.com
Lampada Global delivers offshore software development and support services to customers around the world.
Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.
I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.
I am trying to do the same for Tasks module, but I want to do it for the Quick Create panel. Can someone point me a direction which file to edit in order to achieve this. Thank you!
My previous suggestion should work without big deal, once Quick Create and Full Form share the same view.edit.php.
Cheers
André Lopes
DevToolKit / Project of the Month - June 2009
Lampada Global Services- Open Source Solutions
Avenida Ipiranga, 318
Bloco B - CJ 1602
São Paulo, SP 01046-010
Brazil
Office: +55 11 3237-3110
Mobile: +55 11 7636-5859
e-mail: andre@lampadaglobal.com
Lampada Global delivers offshore software development and support services to customers around the world.
Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.
I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.
Hi andopes,
Thanks for your reply. That's what I though too, but it's not working for me.
I created a file custom/modules/Tasks/views/view.edit.php with the following content:
PHP Code:<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
require_once('include/MVC/View/views/view.edit.php');
class TasksViewEdit extends ViewEdit {
function preDisplay() {
parent::preDisplay();
if($this->bean->id == '') {
$this->ev->focus->assigned_user_id = '';
}
}
}
?>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks