@@ -31,25 +31,25 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | class AOS_Contracts extends AOS_Contracts_sugar { |
| 33 | 33 | |
| 34 | - function __construct(){ |
|
| 34 | + function __construct() { |
|
| 35 | 35 | |
| 36 | 36 | parent::__construct(); |
| 37 | 37 | |
| 38 | 38 | //Process the default reminder date setting |
| 39 | - if($this->id == null && $this->renewal_reminder_date == null){ |
|
| 39 | + if ($this->id == null && $this->renewal_reminder_date == null) { |
|
| 40 | 40 | global $sugar_config, $timedate; |
| 41 | 41 | |
| 42 | 42 | $default_time = "12:00:00"; |
| 43 | 43 | |
| 44 | - $period = empty($sugar_config['aos'])?false:(int)$sugar_config['aos']['contracts']['renewalReminderPeriod']; |
|
| 44 | + $period = empty($sugar_config['aos']) ? false : (int)$sugar_config['aos']['contracts']['renewalReminderPeriod']; |
|
| 45 | 45 | |
| 46 | 46 | //Calculate renewal date from end_date minus $period days and format this. |
| 47 | - if($period && !empty($this->end_date)){ |
|
| 47 | + if ($period && !empty($this->end_date)) { |
|
| 48 | 48 | $renewal_date = $timedate->fromUserDate($this->end_date); |
| 49 | 49 | |
| 50 | 50 | $renewal_date->modify("-$period days"); |
| 51 | 51 | $time_value = $timedate->fromString($default_time); |
| 52 | - $renewal_date->setTime($time_value->hour,$time_value->min,$time_value->sec); |
|
| 52 | + $renewal_date->setTime($time_value->hour, $time_value->min, $time_value->sec); |
|
| 53 | 53 | |
| 54 | 54 | $renewal_date = $renewal_date->format($timedate->get_date_time_format()); |
| 55 | 55 | $this->renewal_reminder_date = $renewal_date; |
@@ -62,9 +62,9 @@ discard block |
||
| 62 | 62 | /** |
| 63 | 63 | * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead |
| 64 | 64 | */ |
| 65 | - function AOS_Contracts(){ |
|
| 65 | + function AOS_Contracts() { |
|
| 66 | 66 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 67 | - if(isset($GLOBALS['log'])) { |
|
| 67 | + if (isset($GLOBALS['log'])) { |
|
| 68 | 68 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 69 | 69 | } |
| 70 | 70 | else { |
@@ -73,14 +73,14 @@ discard block |
||
| 73 | 73 | self::__construct(); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - function save($check_notify = FALSE){ |
|
| 77 | - if (empty($this->id)){ |
|
| 76 | + function save($check_notify = FALSE) { |
|
| 77 | + if (empty($this->id)) { |
|
| 78 | 78 | unset($_POST['group_id']); |
| 79 | 79 | unset($_POST['product_id']); |
| 80 | 80 | unset($_POST['service_id']); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - if(isset($_POST['renewal_reminder_date']) && !empty($_POST['renewal_reminder_date'])){ |
|
| 83 | + if (isset($_POST['renewal_reminder_date']) && !empty($_POST['renewal_reminder_date'])) { |
|
| 84 | 84 | $this->createReminder(); |
| 85 | 85 | } |
| 86 | 86 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $productQuoteGroup = new AOS_Line_Item_Groups(); |
| 95 | 95 | $productQuoteGroup->save_groups($_POST, $this, 'group_'); |
| 96 | 96 | |
| 97 | - if(isset($_POST['renewal_reminder_date']) && !empty($_POST['renewal_reminder_date'])){ |
|
| 97 | + if (isset($_POST['renewal_reminder_date']) && !empty($_POST['renewal_reminder_date'])) { |
|
| 98 | 98 | $this->createLink(); |
| 99 | 99 | } |
| 100 | 100 | |
@@ -109,17 +109,17 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - function createReminder(){ |
|
| 112 | + function createReminder() { |
|
| 113 | 113 | require_once('modules/Calls/Call.php'); |
| 114 | 114 | $call = new call(); |
| 115 | 115 | |
| 116 | - if($this->renewal_reminder_date != 0){ |
|
| 116 | + if ($this->renewal_reminder_date != 0) { |
|
| 117 | 117 | |
| 118 | 118 | $call->id = $this->call_id; |
| 119 | 119 | $call->parent_id = $this->id; |
| 120 | 120 | $call->parent_type = 'AOS_Contracts'; |
| 121 | 121 | $call->date_start = $this->renewal_reminder_date; |
| 122 | - $call->name = $this->name . ' Contract Renewal Reminder'; |
|
| 122 | + $call->name = $this->name.' Contract Renewal Reminder'; |
|
| 123 | 123 | $call->assigned_user_id = $this->assigned_user_id; |
| 124 | 124 | $call->status = 'Planned'; |
| 125 | 125 | $call->direction = 'Outbound'; |
@@ -132,11 +132,11 @@ discard block |
||
| 132 | 132 | } |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - function createLink(){ |
|
| 135 | + function createLink() { |
|
| 136 | 136 | require_once('modules/Calls/Call.php'); |
| 137 | 137 | $call = new call(); |
| 138 | 138 | |
| 139 | - if($this->renewal_reminder_date != 0){ |
|
| 139 | + if ($this->renewal_reminder_date != 0) { |
|
| 140 | 140 | $call->id = $this->call_id; |
| 141 | 141 | $call->parent_id = $this->contract_account_id; |
| 142 | 142 | $call->parent_type = 'Accounts'; |
@@ -145,11 +145,11 @@ discard block |
||
| 145 | 145 | } |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - function deleteCall(){ |
|
| 148 | + function deleteCall() { |
|
| 149 | 149 | require_once('modules/Calls/Call.php'); |
| 150 | 150 | $call = new call(); |
| 151 | 151 | |
| 152 | - if($this->call_id != null){ |
|
| 152 | + if ($this->call_id != null) { |
|
| 153 | 153 | $call->id = $this->call_id; |
| 154 | 154 | $call->mark_deleted($call->id); |
| 155 | 155 | } |
@@ -23,8 +23,7 @@ |
||
| 23 | 23 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 24 | 24 | if(isset($GLOBALS['log'])) { |
| 25 | 25 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 26 | - } |
|
| 27 | - else { |
|
| 26 | + } else { |
|
| 28 | 27 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
| 29 | 28 | } |
| 30 | 29 | self::__construct($seed, $module, $subPanel, $options); |
@@ -46,10 +46,10 @@ discard block |
||
| 46 | 46 | /** |
| 47 | 47 | * @see SugarView::ViewEdit() |
| 48 | 48 | */ |
| 49 | - function __construct(){ |
|
| 50 | - parent::__construct(); |
|
| 51 | - $this->useForSubpanel = true; |
|
| 52 | - } |
|
| 49 | + function __construct(){ |
|
| 50 | + parent::__construct(); |
|
| 51 | + $this->useForSubpanel = true; |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | 55 | * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead |
@@ -66,121 +66,121 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
| 69 | - /** |
|
| 70 | - * @see SugarView::display() |
|
| 71 | - */ |
|
| 72 | - public function display() |
|
| 73 | - { |
|
| 74 | - global $app_list_strings, $mod_strings; |
|
| 69 | + /** |
|
| 70 | + * @see SugarView::display() |
|
| 71 | + */ |
|
| 72 | + public function display() |
|
| 73 | + { |
|
| 74 | + global $app_list_strings, $mod_strings; |
|
| 75 | 75 | |
| 76 | - $load_signed=false; |
|
| 77 | - if ((isset($_REQUEST['load_signed_id']) && !empty($_REQUEST['load_signed_id']))) { |
|
| 76 | + $load_signed=false; |
|
| 77 | + if ((isset($_REQUEST['load_signed_id']) && !empty($_REQUEST['load_signed_id']))) { |
|
| 78 | 78 | |
| 79 | - $load_signed=true; |
|
| 80 | - if (isset($_REQUEST['record'])) { |
|
| 81 | - $this->bean->related_doc_id=$_REQUEST['record']; |
|
| 82 | - } |
|
| 83 | - if (isset($_REQUEST['selected_revision_id'])) { |
|
| 84 | - $this->bean->related_doc_rev_id=$_REQUEST['selected_revision_id']; |
|
| 85 | - } |
|
| 79 | + $load_signed=true; |
|
| 80 | + if (isset($_REQUEST['record'])) { |
|
| 81 | + $this->bean->related_doc_id=$_REQUEST['record']; |
|
| 82 | + } |
|
| 83 | + if (isset($_REQUEST['selected_revision_id'])) { |
|
| 84 | + $this->bean->related_doc_rev_id=$_REQUEST['selected_revision_id']; |
|
| 85 | + } |
|
| 86 | 86 | |
| 87 | - $this->bean->id=null; |
|
| 88 | - $this->bean->document_name=null; |
|
| 89 | - $this->bean->filename=null; |
|
| 90 | - $this->bean->is_template=0; |
|
| 91 | - } //if |
|
| 87 | + $this->bean->id=null; |
|
| 88 | + $this->bean->document_name=null; |
|
| 89 | + $this->bean->filename=null; |
|
| 90 | + $this->bean->is_template=0; |
|
| 91 | + } //if |
|
| 92 | 92 | |
| 93 | - if (!empty($this->bean->id) || |
|
| 93 | + if (!empty($this->bean->id) || |
|
| 94 | 94 | (empty($this->bean->id) && !empty($_REQUEST['record']) && !empty($_REQUEST['action']) && strtolower($_REQUEST['action'])=='quickedit') |
| 95 | 95 | ) { |
| 96 | - $this->ss->assign("FILE_OR_HIDDEN", "hidden"); |
|
| 97 | - if (!$this->ev->isDuplicate) { |
|
| 98 | - $this->ss->assign("DISABLED", "disabled"); |
|
| 99 | - } |
|
| 100 | - } else { |
|
| 101 | - $this->bean->revision = 1; |
|
| 102 | - $this->ss->assign("FILE_OR_HIDDEN", "file"); |
|
| 103 | - } |
|
| 104 | - |
|
| 105 | - $popup_request_data = array( |
|
| 106 | - 'call_back_function' => 'document_set_return', |
|
| 107 | - 'form_name' => 'EditView', |
|
| 108 | - 'field_to_name_array' => array( |
|
| 109 | - 'id' => 'related_doc_id', |
|
| 110 | - 'document_name' => 'related_document_name', |
|
| 111 | - ), |
|
| 112 | - ); |
|
| 113 | - $json = getJSONobj(); |
|
| 114 | - $this->ss->assign('encoded_document_popup_request_data', $json->encode($popup_request_data)); |
|
| 115 | - |
|
| 116 | - |
|
| 117 | - //get related document name. |
|
| 118 | - if (!empty($this->bean->related_doc_id)) { |
|
| 119 | - $this->ss->assign("RELATED_DOCUMENT_NAME",Document::get_document_name($this->bean->related_doc_id)); |
|
| 120 | - $this->ss->assign("RELATED_DOCUMENT_ID",$this->bean->related_doc_id); |
|
| 121 | - if (!empty($this->bean->related_doc_rev_id)) { |
|
| 122 | - $this->ss->assign("RELATED_DOCUMENT_REVISION_OPTIONS", get_select_options_with_id(DocumentRevision::get_document_revisions($this->bean->related_doc_id), $this->bean->related_doc_rev_id)); |
|
| 123 | - } else { |
|
| 124 | - $this->ss->assign("RELATED_DOCUMENT_REVISION_OPTIONS", get_select_options_with_id(DocumentRevision::get_document_revisions($this->bean->related_doc_id), '')); |
|
| 125 | - } |
|
| 126 | - } else { |
|
| 127 | - $this->ss->assign("RELATED_DOCUMENT_REVISION_DISABLED", "disabled"); |
|
| 128 | - } |
|
| 129 | - |
|
| 130 | - |
|
| 131 | - //set parent information in the form. |
|
| 132 | - if (isset($_REQUEST['parent_id'])) { |
|
| 133 | - $this->ss->assign("PARENT_ID",$_REQUEST['parent_id']); |
|
| 134 | - } //if |
|
| 135 | - |
|
| 136 | - if (isset($_REQUEST['parent_name'])) { |
|
| 137 | - $this->ss->assign("PARENT_NAME", $_REQUEST['parent_name']); |
|
| 138 | - |
|
| 139 | - if (!empty($_REQUEST['parent_type'])) { |
|
| 140 | - switch (strtolower($_REQUEST['parent_type'])) { |
|
| 141 | - |
|
| 142 | - case "contracts" : |
|
| 143 | - $this->ss->assign("LBL_PARENT_NAME",$mod_strings['LBL_CONTRACT_NAME']); |
|
| 144 | - break; |
|
| 145 | - |
|
| 146 | - //todo remove leads case. |
|
| 147 | - case "leads" : |
|
| 148 | - $this->ss->assign("LBL_PARENT_NAME",$mod_strings['LBL_CONTRACT_NAME']); |
|
| 149 | - break; |
|
| 150 | - } //switch |
|
| 151 | - } //if |
|
| 152 | - } //if |
|
| 153 | - |
|
| 154 | - if (isset($_REQUEST['parent_type'])) { |
|
| 155 | - $this->ss->assign("PARENT_TYPE",$_REQUEST['parent_type']); |
|
| 156 | - } |
|
| 157 | - |
|
| 158 | - if ($load_signed) { |
|
| 159 | - $this->ss->assign("RELATED_DOCUMENT_REVISION_DISABLED", "disabled"); |
|
| 160 | - $this->ss->assign("RELATED_DOCUMENT_BUTTON_AVAILABILITY", "hidden"); |
|
| 161 | - $this->ss->assign("LOAD_SIGNED_ID",$_REQUEST['load_signed_id']); |
|
| 162 | - } else { |
|
| 163 | - $this->ss->assign("RELATED_DOCUMENT_BUTTON_AVAILABILITY", "button"); |
|
| 164 | - } //if-else |
|
| 165 | - |
|
| 166 | - parent::display(); |
|
| 167 | - } |
|
| 168 | - |
|
| 169 | - /** |
|
| 170 | - * @see SugarView::_getModuleTitleParams() |
|
| 171 | - */ |
|
| 172 | - protected function _getModuleTitleParams($browserTitle = false) |
|
| 173 | - { |
|
| 174 | - $params = array(); |
|
| 175 | - $params[] = $this->_getModuleTitleListParam($browserTitle); |
|
| 176 | - if(!empty($this->bean->id)){ |
|
| 177 | - $params[] = "<a href='index.php?module={$this->module}&action=DetailView&record={$this->bean->id}'>".$this->bean->document_name."</a>"; |
|
| 178 | - $params[] = $GLOBALS['app_strings']['LBL_EDIT_BUTTON_LABEL']; |
|
| 179 | - }else{ |
|
| 180 | - $params[] = $GLOBALS['app_strings']['LBL_CREATE_BUTTON_LABEL']; |
|
| 181 | - } |
|
| 182 | - |
|
| 183 | - return $params; |
|
| 96 | + $this->ss->assign("FILE_OR_HIDDEN", "hidden"); |
|
| 97 | + if (!$this->ev->isDuplicate) { |
|
| 98 | + $this->ss->assign("DISABLED", "disabled"); |
|
| 99 | + } |
|
| 100 | + } else { |
|
| 101 | + $this->bean->revision = 1; |
|
| 102 | + $this->ss->assign("FILE_OR_HIDDEN", "file"); |
|
| 103 | + } |
|
| 104 | + |
|
| 105 | + $popup_request_data = array( |
|
| 106 | + 'call_back_function' => 'document_set_return', |
|
| 107 | + 'form_name' => 'EditView', |
|
| 108 | + 'field_to_name_array' => array( |
|
| 109 | + 'id' => 'related_doc_id', |
|
| 110 | + 'document_name' => 'related_document_name', |
|
| 111 | + ), |
|
| 112 | + ); |
|
| 113 | + $json = getJSONobj(); |
|
| 114 | + $this->ss->assign('encoded_document_popup_request_data', $json->encode($popup_request_data)); |
|
| 115 | + |
|
| 116 | + |
|
| 117 | + //get related document name. |
|
| 118 | + if (!empty($this->bean->related_doc_id)) { |
|
| 119 | + $this->ss->assign("RELATED_DOCUMENT_NAME",Document::get_document_name($this->bean->related_doc_id)); |
|
| 120 | + $this->ss->assign("RELATED_DOCUMENT_ID",$this->bean->related_doc_id); |
|
| 121 | + if (!empty($this->bean->related_doc_rev_id)) { |
|
| 122 | + $this->ss->assign("RELATED_DOCUMENT_REVISION_OPTIONS", get_select_options_with_id(DocumentRevision::get_document_revisions($this->bean->related_doc_id), $this->bean->related_doc_rev_id)); |
|
| 123 | + } else { |
|
| 124 | + $this->ss->assign("RELATED_DOCUMENT_REVISION_OPTIONS", get_select_options_with_id(DocumentRevision::get_document_revisions($this->bean->related_doc_id), '')); |
|
| 125 | + } |
|
| 126 | + } else { |
|
| 127 | + $this->ss->assign("RELATED_DOCUMENT_REVISION_DISABLED", "disabled"); |
|
| 128 | + } |
|
| 129 | + |
|
| 130 | + |
|
| 131 | + //set parent information in the form. |
|
| 132 | + if (isset($_REQUEST['parent_id'])) { |
|
| 133 | + $this->ss->assign("PARENT_ID",$_REQUEST['parent_id']); |
|
| 134 | + } //if |
|
| 135 | + |
|
| 136 | + if (isset($_REQUEST['parent_name'])) { |
|
| 137 | + $this->ss->assign("PARENT_NAME", $_REQUEST['parent_name']); |
|
| 138 | + |
|
| 139 | + if (!empty($_REQUEST['parent_type'])) { |
|
| 140 | + switch (strtolower($_REQUEST['parent_type'])) { |
|
| 141 | + |
|
| 142 | + case "contracts" : |
|
| 143 | + $this->ss->assign("LBL_PARENT_NAME",$mod_strings['LBL_CONTRACT_NAME']); |
|
| 144 | + break; |
|
| 145 | + |
|
| 146 | + //todo remove leads case. |
|
| 147 | + case "leads" : |
|
| 148 | + $this->ss->assign("LBL_PARENT_NAME",$mod_strings['LBL_CONTRACT_NAME']); |
|
| 149 | + break; |
|
| 150 | + } //switch |
|
| 151 | + } //if |
|
| 152 | + } //if |
|
| 153 | + |
|
| 154 | + if (isset($_REQUEST['parent_type'])) { |
|
| 155 | + $this->ss->assign("PARENT_TYPE",$_REQUEST['parent_type']); |
|
| 156 | + } |
|
| 157 | + |
|
| 158 | + if ($load_signed) { |
|
| 159 | + $this->ss->assign("RELATED_DOCUMENT_REVISION_DISABLED", "disabled"); |
|
| 160 | + $this->ss->assign("RELATED_DOCUMENT_BUTTON_AVAILABILITY", "hidden"); |
|
| 161 | + $this->ss->assign("LOAD_SIGNED_ID",$_REQUEST['load_signed_id']); |
|
| 162 | + } else { |
|
| 163 | + $this->ss->assign("RELATED_DOCUMENT_BUTTON_AVAILABILITY", "button"); |
|
| 164 | + } //if-else |
|
| 165 | + |
|
| 166 | + parent::display(); |
|
| 167 | + } |
|
| 168 | + |
|
| 169 | + /** |
|
| 170 | + * @see SugarView::_getModuleTitleParams() |
|
| 171 | + */ |
|
| 172 | + protected function _getModuleTitleParams($browserTitle = false) |
|
| 173 | + { |
|
| 174 | + $params = array(); |
|
| 175 | + $params[] = $this->_getModuleTitleListParam($browserTitle); |
|
| 176 | + if(!empty($this->bean->id)){ |
|
| 177 | + $params[] = "<a href='index.php?module={$this->module}&action=DetailView&record={$this->bean->id}'>".$this->bean->document_name."</a>"; |
|
| 178 | + $params[] = $GLOBALS['app_strings']['LBL_EDIT_BUTTON_LABEL']; |
|
| 179 | + }else{ |
|
| 180 | + $params[] = $GLOBALS['app_strings']['LBL_CREATE_BUTTON_LABEL']; |
|
| 181 | + } |
|
| 182 | + |
|
| 183 | + return $params; |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 3 | 3 | |
| 4 | 4 | /********************************************************************************* |
| 5 | 5 | * SugarCRM Community Edition is a customer relationship management program developed by |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | /** |
| 47 | 47 | * @see SugarView::ViewEdit() |
| 48 | 48 | */ |
| 49 | - function __construct(){ |
|
| 49 | + function __construct() { |
|
| 50 | 50 | parent::__construct(); |
| 51 | 51 | $this->useForSubpanel = true; |
| 52 | 52 | } |
@@ -54,9 +54,9 @@ discard block |
||
| 54 | 54 | /** |
| 55 | 55 | * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead |
| 56 | 56 | */ |
| 57 | - function DocumentsViewEdit(){ |
|
| 57 | + function DocumentsViewEdit() { |
|
| 58 | 58 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 59 | - if(isset($GLOBALS['log'])) { |
|
| 59 | + if (isset($GLOBALS['log'])) { |
|
| 60 | 60 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 61 | 61 | } |
| 62 | 62 | else { |
@@ -73,25 +73,25 @@ discard block |
||
| 73 | 73 | { |
| 74 | 74 | global $app_list_strings, $mod_strings; |
| 75 | 75 | |
| 76 | - $load_signed=false; |
|
| 76 | + $load_signed = false; |
|
| 77 | 77 | if ((isset($_REQUEST['load_signed_id']) && !empty($_REQUEST['load_signed_id']))) { |
| 78 | 78 | |
| 79 | - $load_signed=true; |
|
| 79 | + $load_signed = true; |
|
| 80 | 80 | if (isset($_REQUEST['record'])) { |
| 81 | - $this->bean->related_doc_id=$_REQUEST['record']; |
|
| 81 | + $this->bean->related_doc_id = $_REQUEST['record']; |
|
| 82 | 82 | } |
| 83 | 83 | if (isset($_REQUEST['selected_revision_id'])) { |
| 84 | - $this->bean->related_doc_rev_id=$_REQUEST['selected_revision_id']; |
|
| 84 | + $this->bean->related_doc_rev_id = $_REQUEST['selected_revision_id']; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - $this->bean->id=null; |
|
| 88 | - $this->bean->document_name=null; |
|
| 89 | - $this->bean->filename=null; |
|
| 90 | - $this->bean->is_template=0; |
|
| 87 | + $this->bean->id = null; |
|
| 88 | + $this->bean->document_name = null; |
|
| 89 | + $this->bean->filename = null; |
|
| 90 | + $this->bean->is_template = 0; |
|
| 91 | 91 | } //if |
| 92 | 92 | |
| 93 | 93 | if (!empty($this->bean->id) || |
| 94 | - (empty($this->bean->id) && !empty($_REQUEST['record']) && !empty($_REQUEST['action']) && strtolower($_REQUEST['action'])=='quickedit') |
|
| 94 | + (empty($this->bean->id) && !empty($_REQUEST['record']) && !empty($_REQUEST['action']) && strtolower($_REQUEST['action']) == 'quickedit') |
|
| 95 | 95 | ) { |
| 96 | 96 | $this->ss->assign("FILE_OR_HIDDEN", "hidden"); |
| 97 | 97 | if (!$this->ev->isDuplicate) { |
@@ -116,8 +116,8 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | //get related document name. |
| 118 | 118 | if (!empty($this->bean->related_doc_id)) { |
| 119 | - $this->ss->assign("RELATED_DOCUMENT_NAME",Document::get_document_name($this->bean->related_doc_id)); |
|
| 120 | - $this->ss->assign("RELATED_DOCUMENT_ID",$this->bean->related_doc_id); |
|
| 119 | + $this->ss->assign("RELATED_DOCUMENT_NAME", Document::get_document_name($this->bean->related_doc_id)); |
|
| 120 | + $this->ss->assign("RELATED_DOCUMENT_ID", $this->bean->related_doc_id); |
|
| 121 | 121 | if (!empty($this->bean->related_doc_rev_id)) { |
| 122 | 122 | $this->ss->assign("RELATED_DOCUMENT_REVISION_OPTIONS", get_select_options_with_id(DocumentRevision::get_document_revisions($this->bean->related_doc_id), $this->bean->related_doc_rev_id)); |
| 123 | 123 | } else { |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | //set parent information in the form. |
| 132 | 132 | if (isset($_REQUEST['parent_id'])) { |
| 133 | - $this->ss->assign("PARENT_ID",$_REQUEST['parent_id']); |
|
| 133 | + $this->ss->assign("PARENT_ID", $_REQUEST['parent_id']); |
|
| 134 | 134 | } //if |
| 135 | 135 | |
| 136 | 136 | if (isset($_REQUEST['parent_name'])) { |
@@ -140,25 +140,25 @@ discard block |
||
| 140 | 140 | switch (strtolower($_REQUEST['parent_type'])) { |
| 141 | 141 | |
| 142 | 142 | case "contracts" : |
| 143 | - $this->ss->assign("LBL_PARENT_NAME",$mod_strings['LBL_CONTRACT_NAME']); |
|
| 143 | + $this->ss->assign("LBL_PARENT_NAME", $mod_strings['LBL_CONTRACT_NAME']); |
|
| 144 | 144 | break; |
| 145 | 145 | |
| 146 | 146 | //todo remove leads case. |
| 147 | 147 | case "leads" : |
| 148 | - $this->ss->assign("LBL_PARENT_NAME",$mod_strings['LBL_CONTRACT_NAME']); |
|
| 148 | + $this->ss->assign("LBL_PARENT_NAME", $mod_strings['LBL_CONTRACT_NAME']); |
|
| 149 | 149 | break; |
| 150 | 150 | } //switch |
| 151 | 151 | } //if |
| 152 | 152 | } //if |
| 153 | 153 | |
| 154 | 154 | if (isset($_REQUEST['parent_type'])) { |
| 155 | - $this->ss->assign("PARENT_TYPE",$_REQUEST['parent_type']); |
|
| 155 | + $this->ss->assign("PARENT_TYPE", $_REQUEST['parent_type']); |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | if ($load_signed) { |
| 159 | 159 | $this->ss->assign("RELATED_DOCUMENT_REVISION_DISABLED", "disabled"); |
| 160 | 160 | $this->ss->assign("RELATED_DOCUMENT_BUTTON_AVAILABILITY", "hidden"); |
| 161 | - $this->ss->assign("LOAD_SIGNED_ID",$_REQUEST['load_signed_id']); |
|
| 161 | + $this->ss->assign("LOAD_SIGNED_ID", $_REQUEST['load_signed_id']); |
|
| 162 | 162 | } else { |
| 163 | 163 | $this->ss->assign("RELATED_DOCUMENT_BUTTON_AVAILABILITY", "button"); |
| 164 | 164 | } //if-else |
@@ -173,10 +173,10 @@ discard block |
||
| 173 | 173 | { |
| 174 | 174 | $params = array(); |
| 175 | 175 | $params[] = $this->_getModuleTitleListParam($browserTitle); |
| 176 | - if(!empty($this->bean->id)){ |
|
| 176 | + if (!empty($this->bean->id)) { |
|
| 177 | 177 | $params[] = "<a href='index.php?module={$this->module}&action=DetailView&record={$this->bean->id}'>".$this->bean->document_name."</a>"; |
| 178 | 178 | $params[] = $GLOBALS['app_strings']['LBL_EDIT_BUTTON_LABEL']; |
| 179 | - }else{ |
|
| 179 | + } else { |
|
| 180 | 180 | $params[] = $GLOBALS['app_strings']['LBL_CREATE_BUTTON_LABEL']; |
| 181 | 181 | } |
| 182 | 182 | |
@@ -1,5 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
| 3 | + die('Not A Valid Entry Point'); |
|
| 4 | +} |
|
| 3 | 5 | |
| 4 | 6 | /********************************************************************************* |
| 5 | 7 | * SugarCRM Community Edition is a customer relationship management program developed by |
@@ -58,8 +60,7 @@ discard block |
||
| 58 | 60 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 59 | 61 | if(isset($GLOBALS['log'])) { |
| 60 | 62 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 61 | - } |
|
| 62 | - else { |
|
| 63 | + } else { |
|
| 63 | 64 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
| 64 | 65 | } |
| 65 | 66 | self::__construct(); |
@@ -176,7 +177,7 @@ discard block |
||
| 176 | 177 | if(!empty($this->bean->id)){ |
| 177 | 178 | $params[] = "<a href='index.php?module={$this->module}&action=DetailView&record={$this->bean->id}'>".$this->bean->document_name."</a>"; |
| 178 | 179 | $params[] = $GLOBALS['app_strings']['LBL_EDIT_BUTTON_LABEL']; |
| 179 | - }else{ |
|
| 180 | + } else{ |
|
| 180 | 181 | $params[] = $GLOBALS['app_strings']['LBL_CREATE_BUTTON_LABEL']; |
| 181 | 182 | } |
| 182 | 183 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 3 | 3 | /********************************************************************************* |
| 4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | parent::__construct($id, $def); |
| 52 | 52 | |
| 53 | - if(empty($def['title'])) $this->title = translate('LBL_HOMEPAGE_TITLE', 'Documents'); |
|
| 53 | + if (empty($def['title'])) $this->title = translate('LBL_HOMEPAGE_TITLE', 'Documents'); |
|
| 54 | 54 | |
| 55 | 55 | $this->searchFields = $dashletData['MyDocumentsDashlet']['searchFields']; |
| 56 | 56 | $this->columns = $dashletData['MyDocumentsDashlet']['columns']; |
@@ -61,9 +61,9 @@ discard block |
||
| 61 | 61 | /** |
| 62 | 62 | * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead |
| 63 | 63 | */ |
| 64 | - function MyDocumentsDashlet($id, $def = null){ |
|
| 64 | + function MyDocumentsDashlet($id, $def = null) { |
|
| 65 | 65 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 66 | - if(isset($GLOBALS['log'])) { |
|
| 66 | + if (isset($GLOBALS['log'])) { |
|
| 67 | 67 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 68 | 68 | } |
| 69 | 69 | else { |
@@ -1,5 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
| 3 | + die('Not A Valid Entry Point'); |
|
| 4 | +} |
|
| 3 | 5 | /********************************************************************************* |
| 4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -50,7 +52,9 @@ discard block |
||
| 50 | 52 | |
| 51 | 53 | parent::__construct($id, $def); |
| 52 | 54 | |
| 53 | - if(empty($def['title'])) $this->title = translate('LBL_HOMEPAGE_TITLE', 'Documents'); |
|
| 55 | + if(empty($def['title'])) { |
|
| 56 | + $this->title = translate('LBL_HOMEPAGE_TITLE', 'Documents'); |
|
| 57 | + } |
|
| 54 | 58 | |
| 55 | 59 | $this->searchFields = $dashletData['MyDocumentsDashlet']['searchFields']; |
| 56 | 60 | $this->columns = $dashletData['MyDocumentsDashlet']['columns']; |
@@ -65,8 +69,7 @@ discard block |
||
| 65 | 69 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 66 | 70 | if(isset($GLOBALS['log'])) { |
| 67 | 71 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 68 | - } |
|
| 69 | - else { |
|
| 72 | + } else { |
|
| 70 | 73 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
| 71 | 74 | } |
| 72 | 75 | self::__construct($id, $def); |
@@ -45,9 +45,9 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | class DocumentSoap{ |
| 47 | 47 | var $upload_file; |
| 48 | - function __construct(){ |
|
| 49 | - $this->upload_file = new UploadFile('filename_file'); |
|
| 50 | - } |
|
| 48 | + function __construct(){ |
|
| 49 | + $this->upload_file = new UploadFile('filename_file'); |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| 67 | - function saveFile($document, $portal = false){ |
|
| 67 | + function saveFile($document, $portal = false){ |
|
| 68 | 68 | global $sugar_config; |
| 69 | 69 | |
| 70 | 70 | $focus = new Document(); |
@@ -92,22 +92,22 @@ discard block |
||
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | $revision = new DocumentRevision(); |
| 95 | - $revision->filename = $this->upload_file->get_stored_file_name(); |
|
| 96 | - $revision->file_mime_type = $this->upload_file->getMimeSoap($revision->filename); |
|
| 97 | - $revision->file_ext = $this->upload_file->file_ext; |
|
| 98 | - //$revision->document_name = ; |
|
| 99 | - $revision->revision = $document['revision']; |
|
| 100 | - $revision->document_id = $document['id']; |
|
| 101 | - $revision->save(); |
|
| 102 | - |
|
| 103 | - $focus->document_revision_id = $revision->id; |
|
| 104 | - $focus->save(); |
|
| 95 | + $revision->filename = $this->upload_file->get_stored_file_name(); |
|
| 96 | + $revision->file_mime_type = $this->upload_file->getMimeSoap($revision->filename); |
|
| 97 | + $revision->file_ext = $this->upload_file->file_ext; |
|
| 98 | + //$revision->document_name = ; |
|
| 99 | + $revision->revision = $document['revision']; |
|
| 100 | + $revision->document_id = $document['id']; |
|
| 101 | + $revision->save(); |
|
| 102 | + |
|
| 103 | + $focus->document_revision_id = $revision->id; |
|
| 104 | + $focus->save(); |
|
| 105 | 105 | $return_id = $revision->id; |
| 106 | 106 | $this->upload_file->final_move($revision->id); |
| 107 | 107 | }else{ |
| 108 | 108 | return '-1'; |
| 109 | 109 | } |
| 110 | 110 | return $return_id; |
| 111 | - } |
|
| 111 | + } |
|
| 112 | 112 | } |
| 113 | 113 | ?> |
| 114 | 114 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 3 | 3 | /********************************************************************************* |
| 4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -43,18 +43,18 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | require_once('include/upload_file.php'); |
| 45 | 45 | |
| 46 | -class DocumentSoap{ |
|
| 46 | +class DocumentSoap { |
|
| 47 | 47 | var $upload_file; |
| 48 | - function __construct(){ |
|
| 48 | + function __construct() { |
|
| 49 | 49 | $this->upload_file = new UploadFile('filename_file'); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead |
| 54 | 54 | */ |
| 55 | - function DocumentSoap(){ |
|
| 55 | + function DocumentSoap() { |
|
| 56 | 56 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 57 | - if(isset($GLOBALS['log'])) { |
|
| 57 | + if (isset($GLOBALS['log'])) { |
|
| 58 | 58 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 59 | 59 | } |
| 60 | 60 | else { |
@@ -64,23 +64,23 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| 67 | - function saveFile($document, $portal = false){ |
|
| 67 | + function saveFile($document, $portal = false) { |
|
| 68 | 68 | global $sugar_config; |
| 69 | 69 | |
| 70 | 70 | $focus = new Document(); |
| 71 | 71 | |
| 72 | 72 | |
| 73 | 73 | |
| 74 | - if(!empty($document['id'])){ |
|
| 74 | + if (!empty($document['id'])) { |
|
| 75 | 75 | $focus->retrieve($document['id']); |
| 76 | - if(empty($focus->id)) { |
|
| 76 | + if (empty($focus->id)) { |
|
| 77 | 77 | return '-1'; |
| 78 | 78 | } |
| 79 | - }else{ |
|
| 79 | + } else { |
|
| 80 | 80 | return '-1'; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - if(!empty($document['file'])){ |
|
| 83 | + if (!empty($document['file'])) { |
|
| 84 | 84 | $decodedFile = base64_decode($document['file']); |
| 85 | 85 | $this->upload_file->set_for_soap($document['filename'], $decodedFile); |
| 86 | 86 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | $focus->save(); |
| 105 | 105 | $return_id = $revision->id; |
| 106 | 106 | $this->upload_file->final_move($revision->id); |
| 107 | - }else{ |
|
| 107 | + } else { |
|
| 108 | 108 | return '-1'; |
| 109 | 109 | } |
| 110 | 110 | return $return_id; |
@@ -1,5 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
| 3 | + die('Not A Valid Entry Point'); |
|
| 4 | +} |
|
| 3 | 5 | /********************************************************************************* |
| 4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -56,8 +58,7 @@ discard block |
||
| 56 | 58 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 57 | 59 | if(isset($GLOBALS['log'])) { |
| 58 | 60 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 59 | - } |
|
| 60 | - else { |
|
| 61 | + } else { |
|
| 61 | 62 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
| 62 | 63 | } |
| 63 | 64 | self::__construct(); |
@@ -76,7 +77,7 @@ discard block |
||
| 76 | 77 | if(empty($focus->id)) { |
| 77 | 78 | return '-1'; |
| 78 | 79 | } |
| 79 | - }else{ |
|
| 80 | + } else{ |
|
| 80 | 81 | return '-1'; |
| 81 | 82 | } |
| 82 | 83 | |
@@ -104,7 +105,7 @@ discard block |
||
| 104 | 105 | $focus->save(); |
| 105 | 106 | $return_id = $revision->id; |
| 106 | 107 | $this->upload_file->final_move($revision->id); |
| 107 | - }else{ |
|
| 108 | + } else{ |
|
| 108 | 109 | return '-1'; |
| 109 | 110 | } |
| 110 | 111 | return $return_id; |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | var $object_name = 'AOK_Knowledge_Base_Categories'; |
| 51 | 51 | var $table_name = 'aok_knowledge_base_categories'; |
| 52 | 52 | var $importable = false; |
| 53 | - var $disable_row_level_security = true ; // to ensure that modules created and deployed under CE will continue to function under team security if the instance is upgraded to PRO |
|
| 53 | + var $disable_row_level_security = true; // to ensure that modules created and deployed under CE will continue to function under team security if the instance is upgraded to PRO |
|
| 54 | 54 | var $id; |
| 55 | 55 | var $name; |
| 56 | 56 | var $date_entered; |
@@ -67,16 +67,16 @@ discard block |
||
| 67 | 67 | var $assigned_user_name; |
| 68 | 68 | var $assigned_user_link; |
| 69 | 69 | |
| 70 | - public function __construct(){ |
|
| 70 | + public function __construct() { |
|
| 71 | 71 | parent::__construct(); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
| 75 | 75 | * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead |
| 76 | 76 | */ |
| 77 | - public function AOK_Knowledge_Base_Categories_sugar(){ |
|
| 77 | + public function AOK_Knowledge_Base_Categories_sugar() { |
|
| 78 | 78 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 79 | - if(isset($GLOBALS['log'])) { |
|
| 79 | + if (isset($GLOBALS['log'])) { |
|
| 80 | 80 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 81 | 81 | } |
| 82 | 82 | else { |
@@ -86,8 +86,8 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
| 89 | - function bean_implements($interface){ |
|
| 90 | - switch($interface){ |
|
| 89 | + function bean_implements($interface) { |
|
| 90 | + switch ($interface) { |
|
| 91 | 91 | case 'ACL': return true; |
| 92 | 92 | } |
| 93 | 93 | return false; |
@@ -23,8 +23,7 @@ |
||
| 23 | 23 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 24 | 24 | if(isset($GLOBALS['log'])) { |
| 25 | 25 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 26 | - } |
|
| 27 | - else { |
|
| 26 | + } else { |
|
| 28 | 27 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
| 29 | 28 | } |
| 30 | 29 | self::__construct($seed, $module, $subPanel, $options); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 3 | 3 | /********************************************************************************* |
| 4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | parent::__construct($id, $def); |
| 58 | 58 | |
| 59 | - if(empty($def['title'])) $this->title = translate('LBL_HOMEPAGE_TITLE', 'AOK_Knowledge_Base_Categories'); |
|
| 59 | + if (empty($def['title'])) $this->title = translate('LBL_HOMEPAGE_TITLE', 'AOK_Knowledge_Base_Categories'); |
|
| 60 | 60 | |
| 61 | 61 | $this->searchFields = $dashletData['AOK_Knowledge_Base_CategoriesDashlet']['searchFields']; |
| 62 | 62 | $this->columns = $dashletData['AOK_Knowledge_Base_CategoriesDashlet']['columns']; |
@@ -67,9 +67,9 @@ discard block |
||
| 67 | 67 | /** |
| 68 | 68 | * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead |
| 69 | 69 | */ |
| 70 | - function AOK_Knowledge_Base_CategoriesDashlet($id, $def = null){ |
|
| 70 | + function AOK_Knowledge_Base_CategoriesDashlet($id, $def = null) { |
|
| 71 | 71 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 72 | - if(isset($GLOBALS['log'])) { |
|
| 72 | + if (isset($GLOBALS['log'])) { |
|
| 73 | 73 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 74 | 74 | } |
| 75 | 75 | else { |
@@ -1,5 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
| 3 | + die('Not A Valid Entry Point'); |
|
| 4 | +} |
|
| 3 | 5 | /********************************************************************************* |
| 4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -56,7 +58,9 @@ discard block |
||
| 56 | 58 | |
| 57 | 59 | parent::__construct($id, $def); |
| 58 | 60 | |
| 59 | - if(empty($def['title'])) $this->title = translate('LBL_HOMEPAGE_TITLE', 'AOK_Knowledge_Base_Categories'); |
|
| 61 | + if(empty($def['title'])) { |
|
| 62 | + $this->title = translate('LBL_HOMEPAGE_TITLE', 'AOK_Knowledge_Base_Categories'); |
|
| 63 | + } |
|
| 60 | 64 | |
| 61 | 65 | $this->searchFields = $dashletData['AOK_Knowledge_Base_CategoriesDashlet']['searchFields']; |
| 62 | 66 | $this->columns = $dashletData['AOK_Knowledge_Base_CategoriesDashlet']['columns']; |
@@ -71,8 +75,7 @@ discard block |
||
| 71 | 75 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 72 | 76 | if(isset($GLOBALS['log'])) { |
| 73 | 77 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 74 | - } |
|
| 75 | - else { |
|
| 78 | + } else { |
|
| 76 | 79 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
| 77 | 80 | } |
| 78 | 81 | self::__construct($id, $def); |
@@ -40,9 +40,9 @@ |
||
| 40 | 40 | require_once('modules/AM_TaskTemplates/AM_TaskTemplates_sugar.php'); |
| 41 | 41 | class AM_TaskTemplates extends AM_TaskTemplates_sugar { |
| 42 | 42 | |
| 43 | - public function __construct(){ |
|
| 44 | - parent::__construct(); |
|
| 45 | - } |
|
| 43 | + public function __construct(){ |
|
| 44 | + parent::__construct(); |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | 48 | * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead |
@@ -43,16 +43,16 @@ |
||
| 43 | 43 | require_once('modules/AOK_Knowledge_Base_Categories/AOK_Knowledge_Base_Categories_sugar.php'); |
| 44 | 44 | class AOK_Knowledge_Base_Categories extends AOK_Knowledge_Base_Categories_sugar { |
| 45 | 45 | |
| 46 | - public function __construct(){ |
|
| 46 | + public function __construct() { |
|
| 47 | 47 | parent::__construct(); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | 51 | * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead |
| 52 | 52 | */ |
| 53 | - public function AOK_Knowledge_Base_Categories(){ |
|
| 53 | + public function AOK_Knowledge_Base_Categories() { |
|
| 54 | 54 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 55 | - if(isset($GLOBALS['log'])) { |
|
| 55 | + if (isset($GLOBALS['log'])) { |
|
| 56 | 56 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 57 | 57 | } |
| 58 | 58 | else { |
@@ -23,8 +23,7 @@ |
||
| 23 | 23 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 24 | 24 | if(isset($GLOBALS['log'])) { |
| 25 | 25 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 26 | - } |
|
| 27 | - else { |
|
| 26 | + } else { |
|
| 28 | 27 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
| 29 | 28 | } |
| 30 | 29 | self::__construct($seed, $module, $subPanel, $options); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 3 | 3 | /********************************************************************************* |
| 4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | /** |
| 57 | 57 | * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead |
| 58 | 58 | */ |
| 59 | - function SugarNewsDashlet($id, $options = null){ |
|
| 59 | + function SugarNewsDashlet($id, $options = null) { |
|
| 60 | 60 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 61 | - if(isset($GLOBALS['log'])) { |
|
| 61 | + if (isset($GLOBALS['log'])) { |
|
| 62 | 62 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 63 | 63 | } |
| 64 | 64 | else { |
@@ -43,7 +43,9 @@ discard block |
||
| 43 | 43 | * Date: 06/03/15 |
| 44 | 44 | * Comments |
| 45 | 45 | */ |
| 46 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 46 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
| 47 | + die('Not A Valid Entry Point'); |
|
| 48 | +} |
|
| 47 | 49 | |
| 48 | 50 | class CasesController extends SugarController { |
| 49 | 51 | |
@@ -90,8 +92,7 @@ discard block |
||
| 90 | 92 | $count++; |
| 91 | 93 | } |
| 92 | 94 | echo '</table>'; |
| 93 | - } |
|
| 94 | - else { |
|
| 95 | + } else { |
|
| 95 | 96 | echo $mod_strings['LBL_NO_SUGGESTIONS']; |
| 96 | 97 | } |
| 97 | 98 | die(); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 3 | 3 | /********************************************************************************* |
| 4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -64,28 +64,28 @@ discard block |
||
| 64 | 64 | $this->title = $options['title']; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - if(empty($options['url'])) { |
|
| 67 | + if (empty($options['url'])) { |
|
| 68 | 68 | $this->url = $this->defaultURL; |
| 69 | 69 | $this->url = 'https://suitecrm.com/'; |
| 70 | 70 | } else { |
| 71 | 71 | $this->url = $options['url']; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if(empty($options['height']) || (int)$options['height'] < 1 ) { |
|
| 74 | + if (empty($options['height']) || (int)$options['height'] < 1) { |
|
| 75 | 75 | $this->height = 315; |
| 76 | 76 | } else { |
| 77 | 77 | $this->height = (int)$options['height']; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - if(isset($options['autoRefresh'])) $this->autoRefresh = $options['autoRefresh']; |
|
| 80 | + if (isset($options['autoRefresh'])) $this->autoRefresh = $options['autoRefresh']; |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /** |
| 84 | 84 | * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead |
| 85 | 85 | */ |
| 86 | - function iFrameDashlet($id, $options = null){ |
|
| 86 | + function iFrameDashlet($id, $options = null) { |
|
| 87 | 87 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 88 | - if(isset($GLOBALS['log'])) { |
|
| 88 | + if (isset($GLOBALS['log'])) { |
|
| 89 | 89 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 90 | 90 | } |
| 91 | 91 | else { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | protected function checkURL() |
| 98 | 98 | { |
| 99 | 99 | $scheme = parse_url($this->url, PHP_URL_SCHEME); |
| 100 | - if(!in_array($scheme, $this->allowed_schemes)) { |
|
| 100 | + if (!in_array($scheme, $this->allowed_schemes)) { |
|
| 101 | 101 | $this->url = 'about:blank'; |
| 102 | 102 | return false; |
| 103 | 103 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $ss->assign('height', $this->height); |
| 117 | 117 | $ss->assign('saveLBL', $app_strings['LBL_SAVE_BUTTON_LABEL']); |
| 118 | 118 | $ss->assign('clearLBL', $app_strings['LBL_CLEAR_BUTTON_LABEL']); |
| 119 | - if($this->isAutoRefreshable()) { |
|
| 119 | + if ($this->isAutoRefreshable()) { |
|
| 120 | 120 | $ss->assign('isRefreshable', true); |
| 121 | 121 | $ss->assign('autoRefresh', $GLOBALS['app_strings']['LBL_DASHLET_CONFIGURE_AUTOREFRESH']); |
| 122 | 122 | $ss->assign('autoRefreshOptions', $this->getAutoRefreshOptions()); |
@@ -129,13 +129,13 @@ discard block |
||
| 129 | 129 | function saveOptions($req) { |
| 130 | 130 | $options = array(); |
| 131 | 131 | |
| 132 | - if ( isset($req['title']) ) { |
|
| 132 | + if (isset($req['title'])) { |
|
| 133 | 133 | $options['title'] = $req['title']; |
| 134 | 134 | } |
| 135 | - if ( isset($req['url']) ) { |
|
| 135 | + if (isset($req['url'])) { |
|
| 136 | 136 | $options['url'] = $req['url']; |
| 137 | 137 | } |
| 138 | - if ( isset($req['height']) ) { |
|
| 138 | + if (isset($req['height'])) { |
|
| 139 | 139 | $options['height'] = (int)$req['height']; |
| 140 | 140 | } |
| 141 | 141 | $options['autoRefresh'] = empty($req['autoRefresh']) ? '0' : $req['autoRefresh']; |
@@ -143,17 +143,17 @@ discard block |
||
| 143 | 143 | return $options; |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - function display(){ |
|
| 146 | + function display() { |
|
| 147 | 147 | |
| 148 | 148 | $sugar_edition = 'COM'; |
| 149 | 149 | |
| 150 | 150 | |
| 151 | 151 | $out_url = str_replace( |
| 152 | - array('@@LANG@@','@@VER@@','@@EDITION@@'), |
|
| 153 | - array($GLOBALS['current_language'],$GLOBALS['sugar_config']['sugar_version'],$sugar_edition), |
|
| 152 | + array('@@LANG@@', '@@VER@@', '@@EDITION@@'), |
|
| 153 | + array($GLOBALS['current_language'], $GLOBALS['sugar_config']['sugar_version'], $sugar_edition), |
|
| 154 | 154 | $this->url); |
| 155 | 155 | $title = $this->title; |
| 156 | - if(empty($title)){ |
|
| 156 | + if (empty($title)) { |
|
| 157 | 157 | $title = 'empty'; |
| 158 | 158 | } |
| 159 | 159 | |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | if ($this->checkURL()) { |
| 162 | 162 | $result .= "<iframe class='teamNoticeBox' title='{$title}' src='{$out_url}' height='{$this->height}px'></iframe>"; |
| 163 | 163 | } else { |
| 164 | - $result .= '<table cellpadding="0" cellspacing="0" width="100%" border="0" class="list view"><tr height="20"><td colspan="11"><em>' . translate('LBL_DASHLET_INCORRECT_URL', 'Home') . '</em></td></tr></table>'; |
|
| 164 | + $result .= '<table cellpadding="0" cellspacing="0" width="100%" border="0" class="list view"><tr height="20"><td colspan="11"><em>'.translate('LBL_DASHLET_INCORRECT_URL', 'Home').'</em></td></tr></table>'; |
|
| 165 | 165 | } |
| 166 | 166 | return $result; |
| 167 | 167 | } |
@@ -1,5 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
| 3 | + die('Not A Valid Entry Point'); |
|
| 4 | +} |
|
| 3 | 5 | /********************************************************************************* |
| 4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -77,7 +79,9 @@ discard block |
||
| 77 | 79 | $this->height = (int)$options['height']; |
| 78 | 80 | } |
| 79 | 81 | |
| 80 | - if(isset($options['autoRefresh'])) $this->autoRefresh = $options['autoRefresh']; |
|
| 82 | + if(isset($options['autoRefresh'])) { |
|
| 83 | + $this->autoRefresh = $options['autoRefresh']; |
|
| 84 | + } |
|
| 81 | 85 | } |
| 82 | 86 | |
| 83 | 87 | /** |
@@ -87,8 +91,7 @@ discard block |
||
| 87 | 91 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 88 | 92 | if(isset($GLOBALS['log'])) { |
| 89 | 93 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 90 | - } |
|
| 91 | - else { |
|
| 94 | + } else { |
|
| 92 | 95 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
| 93 | 96 | } |
| 94 | 97 | self::__construct($id, $options); |