1. Trang chủ
  2. » Công Nghệ Thông Tin

the definitive guide to sugarcrm

275 2,1K 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 275
Dung lượng 4,34 MB

Nội dung

SugarCRM The Definitive Guide to Companion eBook Available spine = 0.625" 280 page count The eXPeRT’s VOIce ® In OPen sOuRce The Definitive Guide to SugarCRM Better Business Applications John Mertic A hands-on guide to the #1 open source CRM platform Mertic this print for content only—size & color not accurate cYAn MAGenTA YeLLOW BLAcK PAnTOne 123 c BOOKs fOR PROfessIOnALs BY PROfessIOnALs ® The Definitive Guide to SugarCRM: Better Business Applications Dear Reader, SugarCRM is the world's leading commercial open source CRM software, serv- ing more than 500,000 users all over the world. What most people don't realize is how flexible SugarCRM is as a platform, enabling businesses of all sizes to custom build the CRM application they need. In this book, you'll learn all about SugarCRM from a developer's perspective. This book brings to light the developer side of SugarCRM, an often rather neglected topic. It provides something unique compared to all previous SugarCRM books; the insight from being a part of very talented engineering team at SugarCRM which has put endless efforts into making SugarCRM one of the premier open source web applications today. This insight will give you a deeper understanding how the internals of SugarCRM tick, and this book will be an authoritative resource for developing new applications on top of the SugarCRM platform. The Definitive Guide to SugarCRM comes in three parts. Part 1 focuses on SugarCRM itself: the company, the community, the application, and the plat- form. Here we’ll do a deep dive into everything the platform offers, from the MVC and Metadata frameworks to Web Services, and many pieces in between. Part 2 then takes this knowledge of the Sugar platform and builds upon it show- ing you how to customize the Sugar application out of the box. Part 3 takes that a step further, showing you how to build entirely new functionality on top of SugarCRM, and closes up with building an entire application on top of SugarCRM from start to finish. With this book, you’ll gain a better understanding of SugarCRM, and in doing so, you’ll be able to take SugarCRM and customize it to meet your organi- zation's needs. I truly hope you enjoy it. John Mertic Software Engineer - SugarCRM US $59.99 Shelve in E-commerce User level: Intermediate John Mertic www.apress.com SOURCE CODE ONLINE Companion eBook See last page for details on $10 eBook version ISBN 978-1-4302-2439-6 9 781430 224396 5 5 9 9 9 RELATED TITLES www.it-ebooks.info www.it-ebooks.info i The Definitive Guide to SugarCRM Better Business Applications ■ ■ ■ John Mertic www.it-ebooks.info ii The Definitive Guide to SugarCRM: Better Business Applications Copyright © 2009 by John Mertic ISBN-13 (pbk): 978-1-4302-2439-6 ISBN-13 (electronic): 978-1-4302-2440-2 Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. Lead Editor: Steve Anglin Technical Reviewer: Matt Heitzenroder, Roger Smith, Collin Lee Editorial Board: Clay Andres, Steve Anglin, Mark Beckner, Ewan Buckingham, Tony Campbell, Gary Cornell, Jonathan Gennick, Michelle Lowman, Matthew Moodie, Jeffrey Pepper, Frank Pohlmann, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh Copy Editor: Jim Markham Coordinating Editor: Katie Stence Compositor: MacPS, LLC Artist: April Milne Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders- ny@springer-sbm.com, or visit http://www.springeronline.com. For information on translations, please contact Apress directly at 2855 Telegraph Avenue, Suite 600, Berkeley, CA 94705. Phone 510-549-5939, e-mail info@apress.com, or visit http://www.apress.com. Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Special Bulk Sales–eBook Licensing web page at http://www.apress.com/info/bulksales. The information in this book is distributed on an “as is” basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. The source code for this book is available to readers at http://www.apress.com. www.it-ebooks.info iii www.it-ebooks.info iv Contents at a Glance ■Contents at a Glance iv ■Contents v ■About the Author xi ■About the Technical Reviewers xii ■Acknowledgments xiii ■Introduction xiv Part 1: The SugarCRM Platform 1 ■Chapter 1: What Is SugarCRM? 3 ■Chapter 1: MVC Architecture 11 ■Chapter 1: Metadata Layer 35 ■Chapter 1: Web Services 55 ■Chapter 1: More Platform Features 77 Part 2: Customizing SugarCRM Out of the Box 107 ■Chapter 1: Easy Customizations Using Studio 109 ■Chapter 1: Workflows and Logic Hooks 125 ■Chapter 1: Overriding Existing Code 151 Part 3: Building New Functionality on Top of SugarCRM 169 ■Chapter 1: Using Module Builder to Build Custom Modules 171 ■Chapter 1: Building a Custom Module Manually 195 ■Chapter 1: Designing a Complete Application 219 ■Index 219 www.it-ebooks.info v Contents ■Contents at a Glance iv ■Contents v ■About the Author xi ■About the Technical Reviewers xii ■Acknowledgments xiii ■Introduction xiv Part 1: The SugarCRM Platform 1 ■Chapter 1: What Is SugarCRM? 3 The Company 3 Rapid Growth—Harnessing Open Source and SaaS 4 The Product 4 The Community 7 Sugar Forums and Wiki 7 SugarExchange and SugarForge 7 Sugar Developer Zone 8 Getting SugarCRM 8 Summary 9 ■Chapter 2: MVC Architecture 11 What Is MVC? 11 MVC the Sugar Way 12 SugarApplication 13 SugarController 15 SugarView 18 www.it-ebooks.info ■ CONTENTS vi Entrypoints 21 What About the Model? 22 Bean Classes and SugarObjects 22 Vardefs 24 Fields 24 Indexes 28 Relationships 29 Database Layer 31 Sugar Before MVC 33 Summary 33 ■Chapter 3: Metadata Layer 35 DetailView and EditView 35 How the DetailView and EditView Classes Work 38 SugarFields 40 ListViews 41 Defining Search Fields 44 Field Overlays” 46 Subpanels 48 Summary 53 ■Chapter 4: Web Services 55 What Are Web Services? 55 Connectors 56 Building the Connector Source 56 Defining the Fields from the Web Service” 60 Formatters 61 Localization 63 Pulling It Together 63 Web Services API 64 SOAP 65 Make a Connection 66 Get Lists and Counts of Records 67 www.it-ebooks.info ■ CONTENTS vii Add a New Record 68  Saving and Retrieving Attachments 70 Relate Records 71 REST 72 Logging in Using REST 73 Custom Web Services 73 Create a Custom Registry 74 Provide an Implementation Class 74 Add soap.php and rest.php Files 75 Summary 75 ■Chapter 5: More Platform Features 77 User Management 77 ACL 79 Password Management 81 Tracking User Actions 82 Team Management 84 Dashlets 85 ListView Dashlet 86 Chart Dashlets 89 Iframe Dashlets 92 Custom Dashlets 93 Sugar Feeds 94 Record Importing and Exporting 98 Themes 102 Logger 104 Summary 106 Part 2: Customizing SugarCRM Out of the Box 107 ■Chapter 6: Easy Customizations Using Studio 109 Starting with Studio 109 Adding New Fields to a Module 111 Customizing View Templates 113 www.it-ebooks.info ■ CONTENTS viii Customizing Edit and Detail Views 113  Customizing ListViews 115 Editing Labels 117 Relationships, Relationships, Relationships 119 Help! My Customizations Have Gone Awry 121 Summary 123 ■Chapter 7: Workflows and Logic Hooks 125 What Are Logic Hooks? 125 Creating Your First Logic Hook 127 Point and Click Logic Hooks with Workflows 131 Creating the Workflow 132 Defining Workflow Alerts 138 Workflow Actions 141 Managing the Sequence of Workflows 142 Logic Hooks Pitfalls 143 Modifying the Bean Object 143 Conflicting Logic Hooks 147 Logic Hook Being Nullified by the Existing Code 148 Logic Hook Weaknesses 149 Summary 150 ■Chapter 8: Overriding Existing Code 151 Safety Lies in the Custom Directory 151 Customizations You Can Make 153 Altering View Actions 153 Changing the Metadata-Driven Views 156 Adding New Custom Field Types 161 Changing Language Strings 164 Tweak vardef Definitions 165 Custom Themes and Theme Customizations (Yes, They Are Different ) 166 Summary 168 www.it-ebooks.info [...]... the SugarController class which allows developers to interject logic into the handling of the request before the controller is executed After loading the controller, the following tasks are done before executing the controller: • User authentication takes place If the user is already authenticated then you’ll continue on with the request, otherwise you’ll redirect the login form so the user can authenticate... use the commercial versions of the product to power their enterprise The Community The key to SugarCRM s success lies in the large community of users and developers around the world Their feedback and contributions have helped shape the product, and have been an invaluable resource for helping SugarCRM grow SugarCRM as a company has recognized this and have built several tools for the community to interact... e-mail it to a QA engineer for verification or a team lead to know that the engineer has fixed the issue If you have no additional controller logic to add, you can simply create a mapping from the action name to the view to be called in the action_view_map.php file This file can be specified at the application level in the custom/include/MVC/Controller directory or in the module level at the root of the. .. that the bug is closed parent::post_save(); In the pre_save() method, you will save the value of the status of the bug in the private class variable $_prevStatus, and then you’ll check to see if it’s changed to 'Closed' in the post_save() method It’s important here to call the parent pre_save() and post_save() methods, since there is logic for those in the SugarController class Another use for the pre_action()... Either MySQL 5.0 or later or SQL Server 2005 or later 8 www.it-ebooks.info CHAPTER 1 ■ WHAT IS SUGARCRM To install SugarCRM, simply open a web browser and point it to the location where SugarCRM was unzipped If you unzipped it into the sugar directory in the root of the Web Server on your local machine, point your web browser to http://localhost/sugar, and then the Sugar interactive installer will guide. .. action_view_map.php to direct the called action to the view to execute Listing 2-7 shows an example action call in the controller (you’ll call it the helloworld view) Listing 2-7 action_helloworld() Controller Method public function action_helloworld() { $this->view = 'helloworld'; } The key here is to make sure the view property of the controller is set to the name of the view to call From there, you can... call the previous view, defined as a base view for the application, and specify the helloworld view with no arguments, you would have the message 'Hello World!' outputted to the display If you specify the message to display in the request variables, it would override the default message in the preDisplay() method and be output to the user in the display() method You can also add view customizations to. .. of the MVC architecture, it was not truly optimized in a way to really take advantage of it Let’s look now at how SugarCRM does MVC MVC the Sugar Way Sugar uses the MVC pattern to handle requests from the users Each request to the primary entrypoint (index.php) will specify HTTP request variables indicating the module (which maps to the MVC definition of controller) and the action (which maps to the. .. class handles much of the prerequisites needed for the Sugar application, including session checking, user authentication, setting the theme, and making the connection to the database It also handles much of the preprocess logic of the application For example, setting the user time zone on first login and letting the user know when their password is expired The class is not designed to be modified or extended... OnDemand can customize how SugarCRM works through the powerful, yet easy -to- use Module Builder and Studio tools (We’ll learn more about these in Parts 2 and 3 of 6 www.it-ebooks.info CHAPTER 1 ■ WHAT IS SUGARCRM this book.) This allows anyone using SugarCRM to customize it to meet their needs without having the burden of supporting a server and installation In addition, they can leverage both the On-Demand . SugarCRM The Definitive Guide to Companion eBook Available spine = 0.625" 280 page count The eXPeRT’s VOIce ® In OPen sOuRce The Definitive Guide to SugarCRM Better. platform. The Definitive Guide to SugarCRM comes in three parts. Part 1 focuses on SugarCRM itself: the company, the community, the application, and the plat- form. Here we’ll do a deep dive into everything. TITLES www.it-ebooks.info www.it-ebooks.info i The Definitive Guide to SugarCRM Better Business Applications ■ ■ ■ John Mertic www.it-ebooks.info ii The Definitive Guide to SugarCRM: Better

Ngày đăng: 24/04/2014, 16:10

TỪ KHÓA LIÊN QUAN