@@ -126,7 +126,6 @@ |
||
| 126 | 126 | /** |
| 127 | 127 | * create Source Object container |
| 128 | 128 | * |
| 129 | - * @param Smarty_Resource $handler Resource Handler this source object communicates with |
|
| 130 | 129 | * @param Smarty $smarty Smarty instance this source object belongs to |
| 131 | 130 | * @param string $resource full template_resource |
| 132 | 131 | * @param string $type type of resource |
@@ -11,200 +11,200 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | class Smarty_Template_Source |
| 13 | 13 | { |
| 14 | - /** |
|
| 15 | - * Unique Template ID |
|
| 16 | - * |
|
| 17 | - * @var string |
|
| 18 | - */ |
|
| 19 | - public $uid = null; |
|
| 20 | - |
|
| 21 | - /** |
|
| 22 | - * Template Resource (Smarty_Internal_Template::$template_resource) |
|
| 23 | - * |
|
| 24 | - * @var string |
|
| 25 | - */ |
|
| 26 | - public $resource = null; |
|
| 27 | - |
|
| 28 | - /** |
|
| 29 | - * Resource Type |
|
| 30 | - * |
|
| 31 | - * @var string |
|
| 32 | - */ |
|
| 33 | - public $type = null; |
|
| 34 | - |
|
| 35 | - /** |
|
| 36 | - * Resource Name |
|
| 37 | - * |
|
| 38 | - * @var string |
|
| 39 | - */ |
|
| 40 | - public $name = null; |
|
| 41 | - |
|
| 42 | - /** |
|
| 43 | - * Source Filepath |
|
| 44 | - * |
|
| 45 | - * @var string |
|
| 46 | - */ |
|
| 47 | - public $filepath = null; |
|
| 48 | - |
|
| 49 | - /** |
|
| 50 | - * Source Timestamp |
|
| 51 | - * |
|
| 52 | - * @var integer |
|
| 53 | - */ |
|
| 54 | - public $timestamp = null; |
|
| 55 | - |
|
| 56 | - /** |
|
| 57 | - * Source Existence |
|
| 58 | - * |
|
| 59 | - * @var boolean |
|
| 60 | - */ |
|
| 61 | - public $exists = false; |
|
| 62 | - |
|
| 63 | - /** |
|
| 64 | - * Source File Base name |
|
| 65 | - * |
|
| 66 | - * @var string |
|
| 67 | - */ |
|
| 68 | - public $basename = null; |
|
| 69 | - |
|
| 70 | - /** |
|
| 71 | - * The Components an extended template is made of |
|
| 72 | - * |
|
| 73 | - * @var \Smarty_Template_Source[] |
|
| 74 | - */ |
|
| 75 | - public $components = null; |
|
| 76 | - |
|
| 77 | - /** |
|
| 78 | - * Resource Handler |
|
| 79 | - * |
|
| 80 | - * @var \Smarty_Resource |
|
| 81 | - */ |
|
| 82 | - public $handler = null; |
|
| 83 | - |
|
| 84 | - /** |
|
| 85 | - * Smarty instance |
|
| 86 | - * |
|
| 87 | - * @var Smarty |
|
| 88 | - */ |
|
| 89 | - public $smarty = null; |
|
| 90 | - |
|
| 91 | - /** |
|
| 92 | - * Resource is source |
|
| 93 | - * |
|
| 94 | - * @var bool |
|
| 95 | - */ |
|
| 96 | - public $isConfig = false; |
|
| 97 | - |
|
| 98 | - /** |
|
| 99 | - * Template source content eventually set by default handler |
|
| 100 | - * |
|
| 101 | - * @var string |
|
| 102 | - */ |
|
| 103 | - public $content = null; |
|
| 104 | - |
|
| 105 | - /** |
|
| 106 | - * Name of the Class to compile this resource's contents with |
|
| 107 | - * |
|
| 108 | - * @var string |
|
| 109 | - */ |
|
| 110 | - public $compiler_class = 'Smarty_Internal_SmartyTemplateCompiler'; |
|
| 111 | - |
|
| 112 | - /** |
|
| 113 | - * Name of the Class to tokenize this resource's contents with |
|
| 114 | - * |
|
| 115 | - * @var string |
|
| 116 | - */ |
|
| 117 | - public $template_lexer_class = 'Smarty_Internal_Templatelexer'; |
|
| 118 | - |
|
| 119 | - /** |
|
| 120 | - * Name of the Class to parse this resource's contents with |
|
| 121 | - * |
|
| 122 | - * @var string |
|
| 123 | - */ |
|
| 124 | - public $template_parser_class = 'Smarty_Internal_Templateparser'; |
|
| 125 | - |
|
| 126 | - /** |
|
| 127 | - * create Source Object container |
|
| 128 | - * |
|
| 129 | - * @param Smarty_Resource $handler Resource Handler this source object communicates with |
|
| 130 | - * @param Smarty $smarty Smarty instance this source object belongs to |
|
| 131 | - * @param string $resource full template_resource |
|
| 132 | - * @param string $type type of resource |
|
| 133 | - * @param string $name resource name |
|
| 134 | - * |
|
| 135 | - */ |
|
| 136 | - public function __construct(Smarty $smarty, $resource, $type, $name) |
|
| 137 | - { |
|
| 138 | - $this->handler = |
|
| 139 | - isset($smarty->_cache[ 'resource_handlers' ][ $type ]) ? $smarty->_cache[ 'resource_handlers' ][ $type ] : |
|
| 140 | - Smarty_Resource::load($smarty, $type); |
|
| 141 | - $this->smarty = $smarty; |
|
| 142 | - $this->resource = $resource; |
|
| 143 | - $this->type = $type; |
|
| 144 | - $this->name = $name; |
|
| 145 | - } |
|
| 146 | - |
|
| 147 | - /** |
|
| 148 | - * initialize Source Object for given resource |
|
| 149 | - * Either [$_template] or [$smarty, $template_resource] must be specified |
|
| 150 | - * |
|
| 151 | - * @param Smarty_Internal_Template $_template template object |
|
| 152 | - * @param Smarty $smarty smarty object |
|
| 153 | - * @param string $template_resource resource identifier |
|
| 154 | - * |
|
| 155 | - * @return Smarty_Template_Source Source Object |
|
| 156 | - * @throws SmartyException |
|
| 157 | - */ |
|
| 158 | - public static function load(Smarty_Internal_Template $_template = null, Smarty $smarty = null, |
|
| 159 | - $template_resource = null) |
|
| 160 | - { |
|
| 161 | - if ($_template) { |
|
| 162 | - $smarty = $_template->smarty; |
|
| 163 | - $template_resource = $_template->template_resource; |
|
| 164 | - } |
|
| 165 | - if (empty($template_resource)) { |
|
| 166 | - throw new SmartyException('Source: Missing name'); |
|
| 167 | - } |
|
| 168 | - // parse resource_name, load resource handler, identify unique resource name |
|
| 169 | - if (preg_match('/^([A-Za-z0-9_\-]{2,})[:]([\s\S]*)$/', $template_resource, $match)) { |
|
| 170 | - $type = $match[ 1 ]; |
|
| 171 | - $name = $match[ 2 ]; |
|
| 172 | - } else { |
|
| 173 | - // no resource given, use default |
|
| 174 | - // or single character before the colon is not a resource type, but part of the filepath |
|
| 175 | - $type = $smarty->default_resource_type; |
|
| 176 | - $name = $template_resource; |
|
| 177 | - } |
|
| 178 | - // create new source object |
|
| 179 | - $source = new Smarty_Template_Source($smarty, $template_resource, $type, $name); |
|
| 180 | - $source->handler->populate($source, $_template); |
|
| 181 | - if (!$source->exists && isset($_template->smarty->default_template_handler_func)) { |
|
| 182 | - Smarty_Internal_Method_RegisterDefaultTemplateHandler::_getDefaultTemplate($source); |
|
| 183 | - $source->handler->populate($source, $_template); |
|
| 184 | - } |
|
| 185 | - return $source; |
|
| 186 | - } |
|
| 187 | - |
|
| 188 | - /** |
|
| 189 | - * Get source time stamp |
|
| 190 | - * |
|
| 191 | - * @return int |
|
| 192 | - */ |
|
| 193 | - public function getTimeStamp() |
|
| 194 | - { |
|
| 195 | - if (!isset($this->timestamp)) { |
|
| 196 | - $this->handler->populateTimestamp($this); |
|
| 197 | - } |
|
| 198 | - return $this->timestamp; |
|
| 199 | - } |
|
| 200 | - |
|
| 201 | - /** |
|
| 202 | - * Get source content |
|
| 203 | - * |
|
| 204 | - * @return string |
|
| 205 | - */ |
|
| 206 | - public function getContent() |
|
| 207 | - { |
|
| 208 | - return isset($this->content) ? $this->content : $this->handler->getContent($this); |
|
| 209 | - } |
|
| 14 | + /** |
|
| 15 | + * Unique Template ID |
|
| 16 | + * |
|
| 17 | + * @var string |
|
| 18 | + */ |
|
| 19 | + public $uid = null; |
|
| 20 | + |
|
| 21 | + /** |
|
| 22 | + * Template Resource (Smarty_Internal_Template::$template_resource) |
|
| 23 | + * |
|
| 24 | + * @var string |
|
| 25 | + */ |
|
| 26 | + public $resource = null; |
|
| 27 | + |
|
| 28 | + /** |
|
| 29 | + * Resource Type |
|
| 30 | + * |
|
| 31 | + * @var string |
|
| 32 | + */ |
|
| 33 | + public $type = null; |
|
| 34 | + |
|
| 35 | + /** |
|
| 36 | + * Resource Name |
|
| 37 | + * |
|
| 38 | + * @var string |
|
| 39 | + */ |
|
| 40 | + public $name = null; |
|
| 41 | + |
|
| 42 | + /** |
|
| 43 | + * Source Filepath |
|
| 44 | + * |
|
| 45 | + * @var string |
|
| 46 | + */ |
|
| 47 | + public $filepath = null; |
|
| 48 | + |
|
| 49 | + /** |
|
| 50 | + * Source Timestamp |
|
| 51 | + * |
|
| 52 | + * @var integer |
|
| 53 | + */ |
|
| 54 | + public $timestamp = null; |
|
| 55 | + |
|
| 56 | + /** |
|
| 57 | + * Source Existence |
|
| 58 | + * |
|
| 59 | + * @var boolean |
|
| 60 | + */ |
|
| 61 | + public $exists = false; |
|
| 62 | + |
|
| 63 | + /** |
|
| 64 | + * Source File Base name |
|
| 65 | + * |
|
| 66 | + * @var string |
|
| 67 | + */ |
|
| 68 | + public $basename = null; |
|
| 69 | + |
|
| 70 | + /** |
|
| 71 | + * The Components an extended template is made of |
|
| 72 | + * |
|
| 73 | + * @var \Smarty_Template_Source[] |
|
| 74 | + */ |
|
| 75 | + public $components = null; |
|
| 76 | + |
|
| 77 | + /** |
|
| 78 | + * Resource Handler |
|
| 79 | + * |
|
| 80 | + * @var \Smarty_Resource |
|
| 81 | + */ |
|
| 82 | + public $handler = null; |
|
| 83 | + |
|
| 84 | + /** |
|
| 85 | + * Smarty instance |
|
| 86 | + * |
|
| 87 | + * @var Smarty |
|
| 88 | + */ |
|
| 89 | + public $smarty = null; |
|
| 90 | + |
|
| 91 | + /** |
|
| 92 | + * Resource is source |
|
| 93 | + * |
|
| 94 | + * @var bool |
|
| 95 | + */ |
|
| 96 | + public $isConfig = false; |
|
| 97 | + |
|
| 98 | + /** |
|
| 99 | + * Template source content eventually set by default handler |
|
| 100 | + * |
|
| 101 | + * @var string |
|
| 102 | + */ |
|
| 103 | + public $content = null; |
|
| 104 | + |
|
| 105 | + /** |
|
| 106 | + * Name of the Class to compile this resource's contents with |
|
| 107 | + * |
|
| 108 | + * @var string |
|
| 109 | + */ |
|
| 110 | + public $compiler_class = 'Smarty_Internal_SmartyTemplateCompiler'; |
|
| 111 | + |
|
| 112 | + /** |
|
| 113 | + * Name of the Class to tokenize this resource's contents with |
|
| 114 | + * |
|
| 115 | + * @var string |
|
| 116 | + */ |
|
| 117 | + public $template_lexer_class = 'Smarty_Internal_Templatelexer'; |
|
| 118 | + |
|
| 119 | + /** |
|
| 120 | + * Name of the Class to parse this resource's contents with |
|
| 121 | + * |
|
| 122 | + * @var string |
|
| 123 | + */ |
|
| 124 | + public $template_parser_class = 'Smarty_Internal_Templateparser'; |
|
| 125 | + |
|
| 126 | + /** |
|
| 127 | + * create Source Object container |
|
| 128 | + * |
|
| 129 | + * @param Smarty_Resource $handler Resource Handler this source object communicates with |
|
| 130 | + * @param Smarty $smarty Smarty instance this source object belongs to |
|
| 131 | + * @param string $resource full template_resource |
|
| 132 | + * @param string $type type of resource |
|
| 133 | + * @param string $name resource name |
|
| 134 | + * |
|
| 135 | + */ |
|
| 136 | + public function __construct(Smarty $smarty, $resource, $type, $name) |
|
| 137 | + { |
|
| 138 | + $this->handler = |
|
| 139 | + isset($smarty->_cache[ 'resource_handlers' ][ $type ]) ? $smarty->_cache[ 'resource_handlers' ][ $type ] : |
|
| 140 | + Smarty_Resource::load($smarty, $type); |
|
| 141 | + $this->smarty = $smarty; |
|
| 142 | + $this->resource = $resource; |
|
| 143 | + $this->type = $type; |
|
| 144 | + $this->name = $name; |
|
| 145 | + } |
|
| 146 | + |
|
| 147 | + /** |
|
| 148 | + * initialize Source Object for given resource |
|
| 149 | + * Either [$_template] or [$smarty, $template_resource] must be specified |
|
| 150 | + * |
|
| 151 | + * @param Smarty_Internal_Template $_template template object |
|
| 152 | + * @param Smarty $smarty smarty object |
|
| 153 | + * @param string $template_resource resource identifier |
|
| 154 | + * |
|
| 155 | + * @return Smarty_Template_Source Source Object |
|
| 156 | + * @throws SmartyException |
|
| 157 | + */ |
|
| 158 | + public static function load(Smarty_Internal_Template $_template = null, Smarty $smarty = null, |
|
| 159 | + $template_resource = null) |
|
| 160 | + { |
|
| 161 | + if ($_template) { |
|
| 162 | + $smarty = $_template->smarty; |
|
| 163 | + $template_resource = $_template->template_resource; |
|
| 164 | + } |
|
| 165 | + if (empty($template_resource)) { |
|
| 166 | + throw new SmartyException('Source: Missing name'); |
|
| 167 | + } |
|
| 168 | + // parse resource_name, load resource handler, identify unique resource name |
|
| 169 | + if (preg_match('/^([A-Za-z0-9_\-]{2,})[:]([\s\S]*)$/', $template_resource, $match)) { |
|
| 170 | + $type = $match[ 1 ]; |
|
| 171 | + $name = $match[ 2 ]; |
|
| 172 | + } else { |
|
| 173 | + // no resource given, use default |
|
| 174 | + // or single character before the colon is not a resource type, but part of the filepath |
|
| 175 | + $type = $smarty->default_resource_type; |
|
| 176 | + $name = $template_resource; |
|
| 177 | + } |
|
| 178 | + // create new source object |
|
| 179 | + $source = new Smarty_Template_Source($smarty, $template_resource, $type, $name); |
|
| 180 | + $source->handler->populate($source, $_template); |
|
| 181 | + if (!$source->exists && isset($_template->smarty->default_template_handler_func)) { |
|
| 182 | + Smarty_Internal_Method_RegisterDefaultTemplateHandler::_getDefaultTemplate($source); |
|
| 183 | + $source->handler->populate($source, $_template); |
|
| 184 | + } |
|
| 185 | + return $source; |
|
| 186 | + } |
|
| 187 | + |
|
| 188 | + /** |
|
| 189 | + * Get source time stamp |
|
| 190 | + * |
|
| 191 | + * @return int |
|
| 192 | + */ |
|
| 193 | + public function getTimeStamp() |
|
| 194 | + { |
|
| 195 | + if (!isset($this->timestamp)) { |
|
| 196 | + $this->handler->populateTimestamp($this); |
|
| 197 | + } |
|
| 198 | + return $this->timestamp; |
|
| 199 | + } |
|
| 200 | + |
|
| 201 | + /** |
|
| 202 | + * Get source content |
|
| 203 | + * |
|
| 204 | + * @return string |
|
| 205 | + */ |
|
| 206 | + public function getContent() |
|
| 207 | + { |
|
| 208 | + return isset($this->content) ? $this->content : $this->handler->getContent($this); |
|
| 209 | + } |
|
| 210 | 210 | } |
@@ -136,8 +136,7 @@ discard block |
||
| 136 | 136 | public function __construct(Smarty $smarty, $resource, $type, $name) |
| 137 | 137 | { |
| 138 | 138 | $this->handler = |
| 139 | - isset($smarty->_cache[ 'resource_handlers' ][ $type ]) ? $smarty->_cache[ 'resource_handlers' ][ $type ] : |
|
| 140 | - Smarty_Resource::load($smarty, $type); |
|
| 139 | + isset($smarty->_cache['resource_handlers'][$type]) ? $smarty->_cache['resource_handlers'][$type] : Smarty_Resource::load($smarty, $type); |
|
| 141 | 140 | $this->smarty = $smarty; |
| 142 | 141 | $this->resource = $resource; |
| 143 | 142 | $this->type = $type; |
@@ -167,8 +166,8 @@ discard block |
||
| 167 | 166 | } |
| 168 | 167 | // parse resource_name, load resource handler, identify unique resource name |
| 169 | 168 | if (preg_match('/^([A-Za-z0-9_\-]{2,})[:]([\s\S]*)$/', $template_resource, $match)) { |
| 170 | - $type = $match[ 1 ]; |
|
| 171 | - $name = $match[ 2 ]; |
|
| 169 | + $type = $match[1]; |
|
| 170 | + $name = $match[2]; |
|
| 172 | 171 | } else { |
| 173 | 172 | // no resource given, use default |
| 174 | 173 | // or single character before the colon is not a resource type, but part of the filepath |
@@ -611,6 +611,7 @@ discard block |
||
| 611 | 611 | * @param integer $id - accountid |
| 612 | 612 | * @param array $parent_accounts - Array of all the parent accounts |
| 613 | 613 | * returns All the parent accounts of the given accountid in array format |
| 614 | + * @param integer[] $encountered_accounts |
|
| 614 | 615 | */ |
| 615 | 616 | public function __getParentAccounts($id, &$parent_accounts, &$encountered_accounts, $depthBase = 0) |
| 616 | 617 | { |
@@ -673,7 +674,7 @@ discard block |
||
| 673 | 674 | * Function to Recursively get all the child accounts of a given Account |
| 674 | 675 | * @param integer $id - accountid |
| 675 | 676 | * @param array $child_accounts - Array of all the child accounts |
| 676 | - * @param integer $depth - Depth at which the particular account has to be placed in the hierarchy |
|
| 677 | + * @param integer $depthBase - Depth at which the particular account has to be placed in the hierarchy |
|
| 677 | 678 | * returns All the child accounts of the given accountid in array format |
| 678 | 679 | */ |
| 679 | 680 | public function __getChildAccounts($id, &$child_accounts, $depthBase) |
@@ -99,18 +99,20 @@ discard block |
||
| 99 | 99 | vtlib_setup_modulevars($related_module, $other); |
| 100 | 100 | $singular_modname = vtlib_toSingular($related_module); |
| 101 | 101 | |
| 102 | - if ($singlepane_view == 'true') |
|
| 103 | - $returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id; |
|
| 104 | - else |
|
| 105 | - $returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id; |
|
| 102 | + if ($singlepane_view == 'true') { |
|
| 103 | + $returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id; |
|
| 104 | + } else { |
|
| 105 | + $returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id; |
|
| 106 | + } |
|
| 106 | 107 | |
| 107 | 108 | $button = ''; |
| 108 | 109 | |
| 109 | 110 | $button .= '<input type="hidden" name="email_directing_module"><input type="hidden" name="record">'; |
| 110 | 111 | |
| 111 | 112 | if ($actions) { |
| 112 | - if (is_string($actions)) |
|
| 113 | - $actions = explode(',', strtoupper($actions)); |
|
| 113 | + if (is_string($actions)) { |
|
| 114 | + $actions = explode(',', strtoupper($actions)); |
|
| 115 | + } |
|
| 114 | 116 | if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') { |
| 115 | 117 | $button .= "<input title='" . \includes\Language::translate('LBL_SELECT') . " " . \includes\Language::translate($related_module) . "' class='crmbutton small edit' type='button' onclick=\"return window.open('index.php?module=$related_module&return_module=$currentModule&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid=$id','test','width=640,height=602,resizable=0,scrollbars=0');\" value='" . \includes\Language::translate('LBL_SELECT') . " " . \includes\Language::translate($related_module) . "'> "; |
| 116 | 118 | } |
@@ -136,8 +138,9 @@ discard block |
||
| 136 | 138 | |
| 137 | 139 | $return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset); |
| 138 | 140 | |
| 139 | - if ($return_value == null) |
|
| 140 | - $return_value = []; |
|
| 141 | + if ($return_value == null) { |
|
| 142 | + $return_value = []; |
|
| 143 | + } |
|
| 141 | 144 | $return_value['CUSTOM_BUTTON'] = $button; |
| 142 | 145 | |
| 143 | 146 | $log->debug("Exiting get_campaigns method ..."); |
@@ -163,16 +166,18 @@ discard block |
||
| 163 | 166 | vtlib_setup_modulevars($related_module, $other); |
| 164 | 167 | $singular_modname = vtlib_toSingular($related_module); |
| 165 | 168 | |
| 166 | - if ($singlepane_view == 'true') |
|
| 167 | - $returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id; |
|
| 168 | - else |
|
| 169 | - $returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id; |
|
| 169 | + if ($singlepane_view == 'true') { |
|
| 170 | + $returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id; |
|
| 171 | + } else { |
|
| 172 | + $returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id; |
|
| 173 | + } |
|
| 170 | 174 | |
| 171 | 175 | $button = ''; |
| 172 | 176 | $current_user = vglobal('current_user'); |
| 173 | 177 | if ($actions && getFieldVisibilityPermission($related_module, $current_user->id, 'account_id', 'readwrite') == '0') { |
| 174 | - if (is_string($actions)) |
|
| 175 | - $actions = explode(',', strtoupper($actions)); |
|
| 178 | + if (is_string($actions)) { |
|
| 179 | + $actions = explode(',', strtoupper($actions)); |
|
| 180 | + } |
|
| 176 | 181 | if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') { |
| 177 | 182 | $button .= "<input title='" . \includes\Language::translate('LBL_SELECT') . " " . \includes\Language::translate($related_module) . "' class='crmbutton small edit' type='button' onclick=\"return window.open('index.php?module=$related_module&return_module=$currentModule&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid=$id','test','width=640,height=602,resizable=0,scrollbars=0');\" value='" . \includes\Language::translate('LBL_SELECT') . " " . \includes\Language::translate($related_module) . "'> "; |
| 178 | 183 | } |
@@ -204,8 +209,9 @@ discard block |
||
| 204 | 209 | |
| 205 | 210 | $return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset); |
| 206 | 211 | |
| 207 | - if ($return_value == null) |
|
| 208 | - $return_value = []; |
|
| 212 | + if ($return_value == null) { |
|
| 213 | + $return_value = []; |
|
| 214 | + } |
|
| 209 | 215 | $return_value['CUSTOM_BUTTON'] = $button; |
| 210 | 216 | |
| 211 | 217 | $log->debug("Exiting get_contacts method ..."); |
@@ -231,16 +237,18 @@ discard block |
||
| 231 | 237 | vtlib_setup_modulevars($related_module, $other); |
| 232 | 238 | $singular_modname = vtlib_toSingular($related_module); |
| 233 | 239 | |
| 234 | - if ($singlepane_view == 'true') |
|
| 235 | - $returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id; |
|
| 236 | - else |
|
| 237 | - $returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id; |
|
| 240 | + if ($singlepane_view == 'true') { |
|
| 241 | + $returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id; |
|
| 242 | + } else { |
|
| 243 | + $returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id; |
|
| 244 | + } |
|
| 238 | 245 | |
| 239 | 246 | $button = ''; |
| 240 | 247 | $current_user = vglobal('current_user'); |
| 241 | 248 | if ($actions && getFieldVisibilityPermission($related_module, $current_user->id, 'parent_id', 'readwrite') == '0') { |
| 242 | - if (is_string($actions)) |
|
| 243 | - $actions = explode(',', strtoupper($actions)); |
|
| 249 | + if (is_string($actions)) { |
|
| 250 | + $actions = explode(',', strtoupper($actions)); |
|
| 251 | + } |
|
| 244 | 252 | if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') { |
| 245 | 253 | $button .= "<input title='" . \includes\Language::translate('LBL_SELECT') . " " . \includes\Language::translate($related_module) . "' class='crmbutton small edit' type='button' onclick=\"return window.open('index.php?module=$related_module&return_module=$currentModule&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid=$id','test','width=640,height=602,resizable=0,scrollbars=0');\" value='" . \includes\Language::translate('LBL_SELECT') . " " . \includes\Language::translate($related_module) . "'> "; |
| 246 | 254 | } |
@@ -265,8 +273,9 @@ discard block |
||
| 265 | 273 | |
| 266 | 274 | $return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset); |
| 267 | 275 | |
| 268 | - if ($return_value == null) |
|
| 269 | - $return_value = []; |
|
| 276 | + if ($return_value == null) { |
|
| 277 | + $return_value = []; |
|
| 278 | + } |
|
| 270 | 279 | $return_value['CUSTOM_BUTTON'] = $button; |
| 271 | 280 | |
| 272 | 281 | $log->debug("Exiting get_tickets method ..."); |
@@ -292,16 +301,18 @@ discard block |
||
| 292 | 301 | vtlib_setup_modulevars($related_module, $other); |
| 293 | 302 | $singular_modname = vtlib_toSingular($related_module); |
| 294 | 303 | |
| 295 | - if ($singlepane_view == 'true') |
|
| 296 | - $returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id; |
|
| 297 | - else |
|
| 298 | - $returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id; |
|
| 304 | + if ($singlepane_view == 'true') { |
|
| 305 | + $returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id; |
|
| 306 | + } else { |
|
| 307 | + $returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id; |
|
| 308 | + } |
|
| 299 | 309 | |
| 300 | 310 | $button = ''; |
| 301 | 311 | |
| 302 | 312 | if ($actions) { |
| 303 | - if (is_string($actions)) |
|
| 304 | - $actions = explode(',', strtoupper($actions)); |
|
| 313 | + if (is_string($actions)) { |
|
| 314 | + $actions = explode(',', strtoupper($actions)); |
|
| 315 | + } |
|
| 305 | 316 | if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') { |
| 306 | 317 | $button .= "<input title='" . \includes\Language::translate('LBL_SELECT') . " " . \includes\Language::translate($related_module) . "' class='crmbutton small edit' type='button' onclick=\"return window.open('index.php?module=$related_module&return_module=$currentModule&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid=$id','test','width=640,height=602,resizable=0,scrollbars=0');\" value='" . \includes\Language::translate('LBL_SELECT') . " " . \includes\Language::translate($related_module) . "'> "; |
| 307 | 318 | } |
@@ -329,8 +340,9 @@ discard block |
||
| 329 | 340 | $query = sprintf($query, $entityIds); |
| 330 | 341 | $return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset); |
| 331 | 342 | |
| 332 | - if ($return_value == null) |
|
| 333 | - $return_value = []; |
|
| 343 | + if ($return_value == null) { |
|
| 344 | + $return_value = []; |
|
| 345 | + } |
|
| 334 | 346 | $return_value['CUSTOM_BUTTON'] = $button; |
| 335 | 347 | |
| 336 | 348 | $log->debug("Exiting get_products method ..."); |
@@ -372,10 +384,11 @@ discard block |
||
| 372 | 384 | $query .= $this->getNonAdminAccessControlQuery('Accounts', $current_user); |
| 373 | 385 | $where_auto = " vtiger_crmentity.deleted = 0 "; |
| 374 | 386 | |
| 375 | - if ($where != '') |
|
| 376 | - $query .= sprintf(' where (%s) && %s', $where, $where_auto); |
|
| 377 | - else |
|
| 378 | - $query .= sprintf(' where %s', $where_auto); |
|
| 387 | + if ($where != '') { |
|
| 388 | + $query .= sprintf(' where (%s) && %s', $where, $where_auto); |
|
| 389 | + } else { |
|
| 390 | + $query .= sprintf(' where %s', $where_auto); |
|
| 391 | + } |
|
| 379 | 392 | |
| 380 | 393 | $log->debug("Exiting create_export_query method ..."); |
| 381 | 394 | return $query; |
@@ -768,8 +781,9 @@ discard block |
||
| 768 | 781 | public function unlinkRelationship($id, $return_module, $return_id, $relatedName = false) |
| 769 | 782 | { |
| 770 | 783 | $log = vglobal('log'); |
| 771 | - if (empty($return_module) || empty($return_id)) |
|
| 772 | - return; |
|
| 784 | + if (empty($return_module) || empty($return_id)) { |
|
| 785 | + return; |
|
| 786 | + } |
|
| 773 | 787 | |
| 774 | 788 | if ($return_module == 'Campaigns') { |
| 775 | 789 | $this->db->delete('vtiger_campaign_records', 'crmid=? && campaignid=?', [$id, $return_id]); |
@@ -786,8 +800,9 @@ discard block |
||
| 786 | 800 | $db = PearDatabase::getInstance(); |
| 787 | 801 | $currentUser = Users_Record_Model::getCurrentUserModel(); |
| 788 | 802 | |
| 789 | - if (!is_array($with_crmids)) |
|
| 790 | - $with_crmids = [$with_crmids]; |
|
| 803 | + if (!is_array($with_crmids)) { |
|
| 804 | + $with_crmids = [$with_crmids]; |
|
| 805 | + } |
|
| 791 | 806 | if (!in_array($with_module, ['Products', 'Campaigns'])) { |
| 792 | 807 | parent::save_related_module($module, $crmid, $with_module, $with_crmids, $relatedName); |
| 793 | 808 | } else { |
@@ -831,8 +846,9 @@ discard block |
||
| 831 | 846 | $singular_modname = vtlib_toSingular($related_module); |
| 832 | 847 | $button = ''; |
| 833 | 848 | if ($actions) { |
| 834 | - if (is_string($actions)) |
|
| 835 | - $actions = explode(',', strtoupper($actions)); |
|
| 849 | + if (is_string($actions)) { |
|
| 850 | + $actions = explode(',', strtoupper($actions)); |
|
| 851 | + } |
|
| 836 | 852 | if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') { |
| 837 | 853 | $button .= "<input title='" . \includes\Language::translate('LBL_SELECT') . " " . \includes\Language::translate($related_module) . "' class='crmbutton small edit' type='button' onclick=\"return window.open('index.php?module=$related_module&return_module=$currentModule&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid=$id','test','width=640,height=602,resizable=0,scrollbars=0');\" value='" . \includes\Language::translate('LBL_SELECT') . " " . \includes\Language::translate($related_module) . "'> "; |
| 838 | 854 | } |
@@ -873,8 +889,9 @@ discard block |
||
| 873 | 889 | |
| 874 | 890 | $return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset); |
| 875 | 891 | |
| 876 | - if ($return_value == null) |
|
| 877 | - $return_value = []; |
|
| 892 | + if ($return_value == null) { |
|
| 893 | + $return_value = []; |
|
| 894 | + } |
|
| 878 | 895 | $return_value['CUSTOM_BUTTON'] = $button; |
| 879 | 896 | return $return_value; |
| 880 | 897 | } |
@@ -901,10 +918,12 @@ discard block |
||
| 901 | 918 | continue; |
| 902 | 919 | } |
| 903 | 920 | // Setup the default JOIN conditions if not specified |
| 904 | - if (empty($relmap[1])) |
|
| 905 | - $relmap[1] = $other->table_name; |
|
| 906 | - if (empty($relmap[2])) |
|
| 907 | - $relmap[2] = $relmap[0]; |
|
| 921 | + if (empty($relmap[1])) { |
|
| 922 | + $relmap[1] = $other->table_name; |
|
| 923 | + } |
|
| 924 | + if (empty($relmap[2])) { |
|
| 925 | + $relmap[2] = $relmap[0]; |
|
| 926 | + } |
|
| 908 | 927 | $join .= " LEFT JOIN $tname ON $tname.$relmap[0] = $relmap[1].$relmap[2]"; |
| 909 | 928 | } |
| 910 | 929 | } |
@@ -947,8 +966,9 @@ discard block |
||
| 947 | 966 | |
| 948 | 967 | $button = ''; |
| 949 | 968 | if ($actions) { |
| 950 | - if (is_string($actions)) |
|
| 951 | - $actions = explode(',', strtoupper($actions)); |
|
| 969 | + if (is_string($actions)) { |
|
| 970 | + $actions = explode(',', strtoupper($actions)); |
|
| 971 | + } |
|
| 952 | 972 | if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') { |
| 953 | 973 | $button .= "<input title='" . \includes\Language::translate('LBL_SELECT') . " " . \includes\Language::translate($related_module) . "' class='crmbutton small edit' " . |
| 954 | 974 | " type='button' onclick=\"return window.open('index.php?module=$related_module&return_module=$current_module&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid=$id','test','width=640,height=602,resizable=0,scrollbars=0');\"" . |
@@ -973,10 +993,12 @@ discard block |
||
| 973 | 993 | if (!empty($other->related_tables)) { |
| 974 | 994 | foreach ($other->related_tables as $tname => $relmap) { |
| 975 | 995 | // Setup the default JOIN conditions if not specified |
| 976 | - if (empty($relmap[1])) |
|
| 977 | - $relmap[1] = $other->table_name; |
|
| 978 | - if (empty($relmap[2])) |
|
| 979 | - $relmap[2] = $relmap[0]; |
|
| 996 | + if (empty($relmap[1])) { |
|
| 997 | + $relmap[1] = $other->table_name; |
|
| 998 | + } |
|
| 999 | + if (empty($relmap[2])) { |
|
| 1000 | + $relmap[2] = $relmap[0]; |
|
| 1001 | + } |
|
| 980 | 1002 | $more_relation .= " LEFT JOIN $tname ON $tname.$relmap[0] = $relmap[1].$relmap[2]"; |
| 981 | 1003 | } |
| 982 | 1004 | } |
@@ -998,8 +1020,9 @@ discard block |
||
| 998 | 1020 | |
| 999 | 1021 | $return_value = GetRelatedList($current_module, $related_module, $other, $query, $button, $returnset); |
| 1000 | 1022 | |
| 1001 | - if ($return_value == null) |
|
| 1002 | - $return_value = []; |
|
| 1023 | + if ($return_value == null) { |
|
| 1024 | + $return_value = []; |
|
| 1025 | + } |
|
| 1003 | 1026 | $return_value['CUSTOM_BUTTON'] = $button; |
| 1004 | 1027 | |
| 1005 | 1028 | return $return_value; |
@@ -1009,8 +1032,9 @@ discard block |
||
| 1009 | 1032 | public function getRelatedContactsIds($id = null) |
| 1010 | 1033 | { |
| 1011 | 1034 | $adb = PearDatabase::getInstance(); |
| 1012 | - if ($id == null) |
|
| 1013 | - $id = $this->id; |
|
| 1035 | + if ($id == null) { |
|
| 1036 | + $id = $this->id; |
|
| 1037 | + } |
|
| 1014 | 1038 | $entityIds = []; |
| 1015 | 1039 | $query = 'SELECT contactid FROM vtiger_contactdetails |
| 1016 | 1040 | INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid |
@@ -36,6 +36,9 @@ |
||
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | + /** |
|
| 40 | + * @param Vtiger_Widget_Model $widget |
|
| 41 | + */ |
|
| 39 | 42 | public function getData(Vtiger_Request $request, $widget) |
| 40 | 43 | { |
| 41 | 44 | $db = PearDatabase::getInstance(); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $sql = $queryGenerator->getQuery(); |
| 57 | 57 | |
| 58 | 58 | if ($securityParameter != '') |
| 59 | - $sql.= $securityParameter; |
|
| 59 | + $sql .= $securityParameter; |
|
| 60 | 60 | |
| 61 | 61 | if (!empty($assetStatus)) { |
| 62 | 62 | $assetStatus = implode("','", $assetConfig['assetstatus']); |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | $params[] = $currentUser->getId(); |
| 73 | - $sql.= ' ORDER BY vtiger_assets.dateinservice ASC LIMIT %s'; |
|
| 73 | + $sql .= ' ORDER BY vtiger_assets.dateinservice ASC LIMIT %s'; |
|
| 74 | 74 | $sql = sprintf($sql, $limit); |
| 75 | 75 | $result = $db->pquery($sql, $params); |
| 76 | 76 | $returnData = array(); |
@@ -55,8 +55,9 @@ |
||
| 55 | 55 | $queryGenerator->setFields($fields); |
| 56 | 56 | $sql = $queryGenerator->getQuery(); |
| 57 | 57 | |
| 58 | - if ($securityParameter != '') |
|
| 59 | - $sql.= $securityParameter; |
|
| 58 | + if ($securityParameter != '') { |
|
| 59 | + $sql.= $securityParameter; |
|
| 60 | + } |
|
| 60 | 61 | |
| 61 | 62 | if (!empty($assetStatus)) { |
| 62 | 63 | $assetStatus = implode("','", $assetConfig['assetstatus']); |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | /** Function to insert values in vtiger_activity_remainder table for the specified module, |
| 182 | - * @param $table_name -- table name:: Type varchar |
|
| 182 | + * @param string $table_name -- table name:: Type varchar |
|
| 183 | 183 | * @param $module -- module:: Type varchar |
| 184 | 184 | */ |
| 185 | 185 | public function insertIntoReminderTable($table_name, $module, $recurid) |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | |
| 214 | 214 | // Code included by Jaguar - starts |
| 215 | 215 | /** Function to insert values in vtiger_recurringevents table for the specified tablename,module |
| 216 | - * @param $recurObj -- Recurring Object:: Type varchar |
|
| 216 | + * @param RecurringType $recurObj -- Recurring Object:: Type varchar |
|
| 217 | 217 | */ |
| 218 | 218 | public function insertIntoRecurringTable(& $recurObj) |
| 219 | 219 | { |
@@ -710,7 +710,7 @@ discard block |
||
| 710 | 710 | |
| 711 | 711 | /** |
| 712 | 712 | * Function to get calendar query for outlookplugin |
| 713 | - * @param string $username - User name * return string $query - sql query */ |
|
| 713 | + * @param string $user_name - User name * return string $query - sql query */ |
|
| 714 | 714 | public function get_calendarsforol($user_name) |
| 715 | 715 | { |
| 716 | 716 | $adb = PearDatabase::getInstance(); |
@@ -903,6 +903,9 @@ discard block |
||
| 903 | 903 | return $query; |
| 904 | 904 | } |
| 905 | 905 | |
| 906 | + /** |
|
| 907 | + * @param null|type $tabId |
|
| 908 | + */ |
|
| 906 | 909 | protected function setupTemporaryTable($tableName, $tabId, $user, $parentRole, $userGroups) |
| 907 | 910 | { |
| 908 | 911 | $module = null; |
@@ -821,40 +821,40 @@ |
||
| 821 | 821 | $query = $this->getRelationQuery($module, $secmodule, "vtiger_activity", "activityid", $queryPlanner); |
| 822 | 822 | |
| 823 | 823 | if ($queryPlanner->requireTable("vtiger_crmentityCalendar", $matrix)) { |
| 824 | - $query .=" left join vtiger_crmentity as vtiger_crmentityCalendar on vtiger_crmentityCalendar.crmid=vtiger_activity.activityid and vtiger_crmentityCalendar.deleted=0"; |
|
| 824 | + $query .= " left join vtiger_crmentity as vtiger_crmentityCalendar on vtiger_crmentityCalendar.crmid=vtiger_activity.activityid and vtiger_crmentityCalendar.deleted=0"; |
|
| 825 | 825 | } |
| 826 | 826 | if ($queryPlanner->requireTable("vtiger_contactdetailsCalendar")) { |
| 827 | - $query .=" left join vtiger_contactdetails as vtiger_contactdetailsCalendar on vtiger_contactdetailsCalendar.contactid= vtiger_activity.link"; |
|
| 827 | + $query .= " left join vtiger_contactdetails as vtiger_contactdetailsCalendar on vtiger_contactdetailsCalendar.contactid= vtiger_activity.link"; |
|
| 828 | 828 | } |
| 829 | 829 | if ($queryPlanner->requireTable("vtiger_activitycf")) { |
| 830 | - $query .=" left join vtiger_activitycf on vtiger_activitycf.activityid = vtiger_activity.activityid"; |
|
| 830 | + $query .= " left join vtiger_activitycf on vtiger_activitycf.activityid = vtiger_activity.activityid"; |
|
| 831 | 831 | } |
| 832 | 832 | if ($queryPlanner->requireTable("vtiger_activity_reminder")) { |
| 833 | - $query .=" left join vtiger_activity_reminder on vtiger_activity_reminder.activity_id = vtiger_activity.activityid"; |
|
| 833 | + $query .= " left join vtiger_activity_reminder on vtiger_activity_reminder.activity_id = vtiger_activity.activityid"; |
|
| 834 | 834 | } |
| 835 | 835 | if ($queryPlanner->requireTable("vtiger_recurringevents")) { |
| 836 | - $query .=" left join vtiger_recurringevents on vtiger_recurringevents.activityid = vtiger_activity.activityid"; |
|
| 836 | + $query .= " left join vtiger_recurringevents on vtiger_recurringevents.activityid = vtiger_activity.activityid"; |
|
| 837 | 837 | } |
| 838 | 838 | if ($queryPlanner->requireTable("vtiger_accountRelCalendar")) { |
| 839 | - $query .=" left join vtiger_account as vtiger_accountRelCalendar on vtiger_accountRelCalendar.accountid=vtiger_activity.link"; |
|
| 839 | + $query .= " left join vtiger_account as vtiger_accountRelCalendar on vtiger_accountRelCalendar.accountid=vtiger_activity.link"; |
|
| 840 | 840 | } |
| 841 | 841 | if ($queryPlanner->requireTable("vtiger_leaddetailsRelCalendar")) { |
| 842 | - $query .=" left join vtiger_leaddetails as vtiger_leaddetailsRelCalendar on vtiger_leaddetailsRelCalendar.leadid = vtiger_activity.link"; |
|
| 842 | + $query .= " left join vtiger_leaddetails as vtiger_leaddetailsRelCalendar on vtiger_leaddetailsRelCalendar.leadid = vtiger_activity.link"; |
|
| 843 | 843 | } |
| 844 | 844 | if ($queryPlanner->requireTable("vtiger_troubleticketsRelCalendar")) { |
| 845 | - $query .=" left join vtiger_troubletickets as vtiger_troubleticketsRelCalendar on vtiger_troubleticketsRelCalendar.ticketid = vtiger_activity.process"; |
|
| 845 | + $query .= " left join vtiger_troubletickets as vtiger_troubleticketsRelCalendar on vtiger_troubleticketsRelCalendar.ticketid = vtiger_activity.process"; |
|
| 846 | 846 | } |
| 847 | 847 | if ($queryPlanner->requireTable("vtiger_campaignRelCalendar")) { |
| 848 | - $query .=" left join vtiger_campaign as vtiger_campaignRelCalendar on vtiger_campaignRelCalendar.campaignid = vtiger_activity.process"; |
|
| 848 | + $query .= " left join vtiger_campaign as vtiger_campaignRelCalendar on vtiger_campaignRelCalendar.campaignid = vtiger_activity.process"; |
|
| 849 | 849 | } |
| 850 | 850 | if ($queryPlanner->requireTable("vtiger_groupsCalendar")) { |
| 851 | - $query .=" left join vtiger_groups as vtiger_groupsCalendar on vtiger_groupsCalendar.groupid = vtiger_crmentityCalendar.smownerid"; |
|
| 851 | + $query .= " left join vtiger_groups as vtiger_groupsCalendar on vtiger_groupsCalendar.groupid = vtiger_crmentityCalendar.smownerid"; |
|
| 852 | 852 | } |
| 853 | 853 | if ($queryPlanner->requireTable("vtiger_usersCalendar")) { |
| 854 | - $query .=" left join vtiger_users as vtiger_usersCalendar on vtiger_usersCalendar.id = vtiger_crmentityCalendar.smownerid"; |
|
| 854 | + $query .= " left join vtiger_users as vtiger_usersCalendar on vtiger_usersCalendar.id = vtiger_crmentityCalendar.smownerid"; |
|
| 855 | 855 | } |
| 856 | 856 | if ($queryPlanner->requireTable("vtiger_lastModifiedByCalendar")) { |
| 857 | - $query .=" left join vtiger_users as vtiger_lastModifiedByCalendar on vtiger_lastModifiedByCalendar.id = vtiger_crmentityCalendar.modifiedby "; |
|
| 857 | + $query .= " left join vtiger_users as vtiger_lastModifiedByCalendar on vtiger_lastModifiedByCalendar.id = vtiger_crmentityCalendar.modifiedby "; |
|
| 858 | 858 | } |
| 859 | 859 | if ($queryPlanner->requireTable("vtiger_createdbyCalendar")) { |
| 860 | 860 | $query .= " left join vtiger_users as vtiger_createdbyCalendar on vtiger_createdbyCalendar.id = vtiger_crmentityCalendar.smcreatorid "; |
@@ -112,8 +112,9 @@ discard block |
||
| 112 | 112 | if (isset($this->column_fields['recurringtype']) && $this->column_fields['recurringtype'] != '' && $this->column_fields['recurringtype'] != '--None--') { |
| 113 | 113 | $recur_type = trim($this->column_fields['recurringtype']); |
| 114 | 114 | $recur_data = \vtlib\Functions::getRecurringObjValue(); |
| 115 | - if (is_object($recur_data)) |
|
| 116 | - $this->insertIntoRecurringTable($recur_data); |
|
| 115 | + if (is_object($recur_data)) { |
|
| 116 | + $this->insertIntoRecurringTable($recur_data); |
|
| 117 | + } |
|
| 117 | 118 | } |
| 118 | 119 | |
| 119 | 120 | //Insert into vtiger_activity_remainder table |
@@ -249,10 +250,10 @@ discard block |
||
| 249 | 250 | $sql = 'delete from vtiger_activity_reminder where activity_id=?'; |
| 250 | 251 | $adb->pquery($sql, array($activity_id)); |
| 251 | 252 | $flag = "false"; |
| 252 | - } else |
|
| 253 | - $flag = "false"; |
|
| 254 | - } |
|
| 255 | - else { |
|
| 253 | + } else { |
|
| 254 | + $flag = "false"; |
|
| 255 | + } |
|
| 256 | + } else { |
|
| 256 | 257 | $sql = 'delete from vtiger_activity_reminder where activity_id=?'; |
| 257 | 258 | $adb->pquery($sql, array($activity_id)); |
| 258 | 259 | $sql = 'delete from vtiger_recurringevents where activityid=?'; |
@@ -361,8 +362,9 @@ discard block |
||
| 361 | 362 | */ |
| 362 | 363 | public function getJoinClause($tableName) |
| 363 | 364 | { |
| 364 | - if ($tableName == "vtiger_activity_reminder") |
|
| 365 | - return 'LEFT JOIN'; |
|
| 365 | + if ($tableName == "vtiger_activity_reminder") { |
|
| 366 | + return 'LEFT JOIN'; |
|
| 367 | + } |
|
| 366 | 368 | return parent::getJoinClause($tableName); |
| 367 | 369 | } |
| 368 | 370 | |
@@ -375,10 +377,11 @@ discard block |
||
| 375 | 377 | { |
| 376 | 378 | $log = LoggerManager::getInstance(); |
| 377 | 379 | $log->debug('Entering getSortOrder() method ...'); |
| 378 | - if (AppRequest::has('sorder')) |
|
| 379 | - $sorder = $this->db->sql_escape_string(AppRequest::get('sorder')); |
|
| 380 | - else |
|
| 381 | - $sorder = (($_SESSION['ACTIVITIES_SORT_ORDER'] != '') ? ($_SESSION['ACTIVITIES_SORT_ORDER']) : ($this->default_sort_order)); |
|
| 380 | + if (AppRequest::has('sorder')) { |
|
| 381 | + $sorder = $this->db->sql_escape_string(AppRequest::get('sorder')); |
|
| 382 | + } else { |
|
| 383 | + $sorder = (($_SESSION['ACTIVITIES_SORT_ORDER'] != '') ? ($_SESSION['ACTIVITIES_SORT_ORDER']) : ($this->default_sort_order)); |
|
| 384 | + } |
|
| 382 | 385 | $log->debug('Exiting getSortOrder method ...'); |
| 383 | 386 | return $sorder; |
| 384 | 387 | } |
@@ -397,10 +400,11 @@ discard block |
||
| 397 | 400 | $use_default_order_by = $this->default_order_by; |
| 398 | 401 | } |
| 399 | 402 | |
| 400 | - if (AppRequest::has('order_by')) |
|
| 401 | - $order_by = $this->db->sql_escape_string(AppRequest::get('order_by')); |
|
| 402 | - else |
|
| 403 | - $order_by = (($_SESSION['ACTIVITIES_ORDER_BY'] != '') ? ($_SESSION['ACTIVITIES_ORDER_BY']) : ($use_default_order_by)); |
|
| 403 | + if (AppRequest::has('order_by')) { |
|
| 404 | + $order_by = $this->db->sql_escape_string(AppRequest::get('order_by')); |
|
| 405 | + } else { |
|
| 406 | + $order_by = (($_SESSION['ACTIVITIES_ORDER_BY'] != '') ? ($_SESSION['ACTIVITIES_ORDER_BY']) : ($use_default_order_by)); |
|
| 407 | + } |
|
| 404 | 408 | $log->debug("Exiting getOrderBy method ..."); |
| 405 | 409 | return $order_by; |
| 406 | 410 | } |
@@ -431,8 +435,9 @@ discard block |
||
| 431 | 435 | $button = ''; |
| 432 | 436 | |
| 433 | 437 | if ($actions) { |
| 434 | - if (is_string($actions)) |
|
| 435 | - $actions = explode(',', strtoupper($actions)); |
|
| 438 | + if (is_string($actions)) { |
|
| 439 | + $actions = explode(',', strtoupper($actions)); |
|
| 440 | + } |
|
| 436 | 441 | if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') { |
| 437 | 442 | $button .= "<input title='" . \includes\Language::translate('LBL_SELECT') . " " . \includes\Language::translate($related_module) . "' class='crmbutton small edit' type='button' onclick=\"return window.open('index.php?module=$related_module&return_module=$currentModule&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid=$id','test','width=640,height=602,resizable=0,scrollbars=0');\" value='" . \includes\Language::translate('LBL_SELECT') . " " . \includes\Language::translate($related_module) . "'> "; |
| 438 | 443 | } |
@@ -448,8 +453,9 @@ discard block |
||
| 448 | 453 | |
| 449 | 454 | $return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset); |
| 450 | 455 | |
| 451 | - if ($return_value == null) |
|
| 452 | - $return_value = []; |
|
| 456 | + if ($return_value == null) { |
|
| 457 | + $return_value = []; |
|
| 458 | + } |
|
| 453 | 459 | $return_value['CUSTOM_BUTTON'] = $button; |
| 454 | 460 | |
| 455 | 461 | $log->debug("Exiting get_contacts method ..."); |
@@ -478,8 +484,9 @@ discard block |
||
| 478 | 484 | $query = sprintf($query, $id); |
| 479 | 485 | $return_data = GetRelatedList('Calendar', 'Users', $focus, $query, $button, $returnset); |
| 480 | 486 | |
| 481 | - if ($return_data == null) |
|
| 482 | - $return_data = []; |
|
| 487 | + if ($return_data == null) { |
|
| 488 | + $return_data = []; |
|
| 489 | + } |
|
| 483 | 490 | $return_data['CUSTOM_BUTTON'] = $button; |
| 484 | 491 | |
| 485 | 492 | $log->debug("Exiting get_users method ..."); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | * @param $userid -- The user Id:: Type integer |
| 57 | 57 | * @param $from_datetime -- The start date Obj :: Type Array |
| 58 | 58 | * @param $to_datetime -- The end date Obj :: Type Array |
| 59 | - * @param $view -- The calendar view :: Type String |
|
| 59 | + * @param string $view -- The calendar view :: Type String |
|
| 60 | 60 | * @returns $list :: Type Array |
| 61 | 61 | */ |
| 62 | 62 | public function readAppointment($userid, &$from_datetime, &$to_datetime, $view) |
@@ -286,6 +286,9 @@ discard block |
||
| 286 | 286 | return ($a->start_time->ts < $b->start_time->ts) ? -1 : 1; |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | +/** |
|
| 290 | + * @param string $fldname |
|
| 291 | + */ |
|
| 289 | 292 | function getRoleBasesdPickList($fldname, $exist_val) |
| 290 | 293 | { |
| 291 | 294 | $adb = PearDatabase::getInstance(); |
@@ -169,7 +169,7 @@ |
||
| 169 | 169 | //Get Recurring events |
| 170 | 170 | $q = "SELECT vtiger_activity.*, vtiger_crmentity.*, case when (vtiger_users.user_name not like '') then $userNameSql else vtiger_groups.groupname end as user_name , vtiger_recurringevents.recurringid, vtiger_recurringevents.recurringdate as date_start ,vtiger_recurringevents.recurringtype,vtiger_groups.groupname from vtiger_activity inner join vtiger_crmentity on vtiger_activity.activityid = vtiger_crmentity.crmid inner join vtiger_recurringevents on vtiger_activity.activityid=vtiger_recurringevents.activityid left join vtiger_groups on vtiger_groups.groupid = vtiger_crmentity.smownerid LEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid"; |
| 171 | 171 | $q .= getNonAdminAccessControlQuery('Calendar', $current_user); |
| 172 | - $q.=" where vtiger_crmentity.deleted = 0 and vtiger_activity.activitytype not in ('Emails','Task') && (cast(concat(recurringdate, ' ', time_start) as datetime) between ? and ?) "; |
|
| 172 | + $q .= " where vtiger_crmentity.deleted = 0 and vtiger_activity.activitytype not in ('Emails','Task') && (cast(concat(recurringdate, ' ', time_start) as datetime) between ? and ?) "; |
|
| 173 | 173 | |
| 174 | 174 | // User Select Customization |
| 175 | 175 | $q .= $query_filter_prefix; |
@@ -221,13 +221,15 @@ discard block |
||
| 221 | 221 | $que = "select * from vtiger_sharedcalendar where sharedid=? and userid=?"; |
| 222 | 222 | $row = $adb->pquery($que, array($current_user->id, $act_array["smownerid"])); |
| 223 | 223 | $no = $adb->getRowCount($row); |
| 224 | - if ($no > 0) |
|
| 225 | - $this->shared = true; |
|
| 224 | + if ($no > 0) { |
|
| 225 | + $this->shared = true; |
|
| 226 | + } |
|
| 226 | 227 | } |
| 227 | 228 | } |
| 228 | 229 | $this->image_name = $act_array["activitytype"] . ".gif"; |
| 229 | - if (!empty($act_array["recurringid"]) && !empty($act_array["recurringtype"])) |
|
| 230 | - $this->recurring = "Recurring.gif"; |
|
| 230 | + if (!empty($act_array["recurringid"]) && !empty($act_array["recurringtype"])) { |
|
| 231 | + $this->recurring = "Recurring.gif"; |
|
| 232 | + } |
|
| 231 | 233 | |
| 232 | 234 | $this->record = $act_array["activityid"]; |
| 233 | 235 | $date = new DateTimeField($act_array["date_start"] . ' ' . $act_array['time_start']); |
@@ -295,8 +297,9 @@ discard block |
||
| 295 | 297 | $roleid = $current_user->roleid; |
| 296 | 298 | $roleids = Array(); |
| 297 | 299 | $subrole = getRoleSubordinates($roleid); |
| 298 | - if (count($subrole) > 0) |
|
| 299 | - $roleids = $subrole; |
|
| 300 | + if (count($subrole) > 0) { |
|
| 301 | + $roleids = $subrole; |
|
| 302 | + } |
|
| 300 | 303 | array_push($roleids, $roleid); |
| 301 | 304 | |
| 302 | 305 | //here we are checking wheather the table contains the sortorder column .If sortorder is present in the main picklist table, then the role2picklist will be applicable for this table... |
@@ -310,12 +313,14 @@ discard block |
||
| 310 | 313 | $res_val = $adb->pquery($pick_query, array($roleids)); |
| 311 | 314 | $num_val = $adb->num_rows($res_val); |
| 312 | 315 | } |
| 313 | - if ($num_val > 0) |
|
| 316 | + if ($num_val > 0) { |
|
| 317 | + $pick_val = $exist_val; |
|
| 318 | + } else { |
|
| 319 | + $pick_val = \includes\Language::translate('LBL_NOT_ACCESSIBLE'); |
|
| 320 | + } |
|
| 321 | + } else { |
|
| 314 | 322 | $pick_val = $exist_val; |
| 315 | - else |
|
| 316 | - $pick_val = \includes\Language::translate('LBL_NOT_ACCESSIBLE'); |
|
| 317 | - } else |
|
| 318 | - $pick_val = $exist_val; |
|
| 323 | + } |
|
| 319 | 324 | |
| 320 | 325 | return $pick_val; |
| 321 | 326 | } |
@@ -253,7 +253,7 @@ |
||
| 253 | 253 | |
| 254 | 254 | /** |
| 255 | 255 | * this function returns the days in a month in an array format |
| 256 | - * @param object $date_time - the date time object for the current month |
|
| 256 | + * @param vt_DateTime|null $date_time - the date time object for the current month |
|
| 257 | 257 | * @return array $result - the array containing current months days information |
| 258 | 258 | */ |
| 259 | 259 | function getCalendarDaysInMonth($date_time) |
@@ -127,10 +127,12 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | public function get_datechange_info($type) |
| 129 | 129 | { |
| 130 | - if ($type == 'next') |
|
| 131 | - $mode = 'increment'; |
|
| 132 | - if ($type == 'prev') |
|
| 133 | - $mode = 'decrment'; |
|
| 130 | + if ($type == 'next') { |
|
| 131 | + $mode = 'increment'; |
|
| 132 | + } |
|
| 133 | + if ($type == 'prev') { |
|
| 134 | + $mode = 'decrment'; |
|
| 135 | + } |
|
| 134 | 136 | switch ($this->view) { |
| 135 | 137 | case 'day': |
| 136 | 138 | $day = $this->date_time->get_changed_day($mode); |
@@ -209,8 +211,9 @@ discard block |
||
| 209 | 211 | $this->year_array[$value->formatted_datetime]->activities = array(); |
| 210 | 212 | } |
| 211 | 213 | array_push($this->year_array[$value->formatted_datetime]->activities, $value); |
| 212 | - } else |
|
| 213 | - die("view:" . $this->view . " is not defined"); |
|
| 214 | + } else { |
|
| 215 | + die("view:" . $this->view . " is not defined"); |
|
| 216 | + } |
|
| 214 | 217 | } |
| 215 | 218 | } |
| 216 | 219 | } |
@@ -233,12 +236,15 @@ discard block |
||
| 233 | 236 | { |
| 234 | 237 | $this->view = $view; |
| 235 | 238 | $this->start_time = $time; |
| 236 | - if ($view == 'month') |
|
| 237 | - $this->end_time = $this->start_time->getMonthendtime(); |
|
| 238 | - if ($view == 'day') |
|
| 239 | - $this->end_time = $this->start_time->getDayendtime(); |
|
| 240 | - if ($view == 'hour') |
|
| 241 | - $this->end_time = $this->start_time->getHourendtime(); |
|
| 239 | + if ($view == 'month') { |
|
| 240 | + $this->end_time = $this->start_time->getMonthendtime(); |
|
| 241 | + } |
|
| 242 | + if ($view == 'day') { |
|
| 243 | + $this->end_time = $this->start_time->getDayendtime(); |
|
| 244 | + } |
|
| 245 | + if ($view == 'hour') { |
|
| 246 | + $this->end_time = $this->start_time->getHourendtime(); |
|
| 247 | + } |
|
| 242 | 248 | } |
| 243 | 249 | |
| 244 | 250 | /** |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | |
| 385 | 385 | /** |
| 386 | 386 | * |
| 387 | - * @return Date |
|
| 387 | + * @return string |
|
| 388 | 388 | */ |
| 389 | 389 | public function get_DB_formatted_date() |
| 390 | 390 | { |
@@ -529,10 +529,6 @@ discard block |
||
| 529 | 529 | * This should be used whereever possible |
| 530 | 530 | * |
| 531 | 531 | * @param integer $index - number between 0 to 42 |
| 532 | - * @param string $day - date |
|
| 533 | - * @param string $month - month |
|
| 534 | - * @param string $year - year |
|
| 535 | - * return vt_DateTime obj $datetimevalue |
|
| 536 | 532 | */ |
| 537 | 533 | public function getThisMonthsDayByIndex($index) |
| 538 | 534 | { |
@@ -87,12 +87,15 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | public function getTodayDatetimebyIndex($index, $day = '', $month = '', $year = '') |
| 89 | 89 | { |
| 90 | - if ($day === '') |
|
| 91 | - $day = $this->day; |
|
| 92 | - if ($month === '') |
|
| 93 | - $month = $this->month; |
|
| 94 | - if ($year === '') |
|
| 95 | - $year = $this->year; |
|
| 90 | + if ($day === '') { |
|
| 91 | + $day = $this->day; |
|
| 92 | + } |
|
| 93 | + if ($month === '') { |
|
| 94 | + $month = $this->month; |
|
| 95 | + } |
|
| 96 | + if ($year === '') { |
|
| 97 | + $year = $this->year; |
|
| 98 | + } |
|
| 96 | 99 | $day_array = array(); |
| 97 | 100 | |
| 98 | 101 | if ($index < 0 || $index > 23) { |
@@ -140,12 +143,15 @@ discard block |
||
| 140 | 143 | */ |
| 141 | 144 | public function getThismonthDaysbyIndex($index, $day = '', $month = '', $year = '') |
| 142 | 145 | { |
| 143 | - if ($day == '') |
|
| 144 | - $day = $index + 1; |
|
| 145 | - if ($month == '') |
|
| 146 | - $month = $this->month; |
|
| 147 | - if ($year == '') |
|
| 148 | - $year = $this->year; |
|
| 146 | + if ($day == '') { |
|
| 147 | + $day = $index + 1; |
|
| 148 | + } |
|
| 149 | + if ($month == '') { |
|
| 150 | + $month = $this->month; |
|
| 151 | + } |
|
| 152 | + if ($year == '') { |
|
| 153 | + $year = $this->year; |
|
| 154 | + } |
|
| 149 | 155 | $month_array = array(); |
| 150 | 156 | $month_array['day'] = $day; |
| 151 | 157 | $month_array['month'] = $month; |
@@ -356,8 +362,9 @@ discard block |
||
| 356 | 362 | } else { |
| 357 | 363 | die("year was not set"); |
| 358 | 364 | } |
| 359 | - if (empty($hour) && $hour !== 0) |
|
| 360 | - $hour = 0; |
|
| 365 | + if (empty($hour) && $hour !== 0) { |
|
| 366 | + $hour = 0; |
|
| 367 | + } |
|
| 361 | 368 | $this->ts = mktime($hour, $minute, $second, $month, $day, $year); |
| 362 | 369 | $this->setDateTime($this->ts); |
| 363 | 370 | } |
@@ -399,10 +406,12 @@ discard block |
||
| 399 | 406 | { |
| 400 | 407 | $hour = $this->z_hour; |
| 401 | 408 | $min = $this->minute; |
| 402 | - if (empty($hour)) |
|
| 403 | - $hour = '00'; |
|
| 404 | - if (empty($min)) |
|
| 405 | - $min = '00'; |
|
| 409 | + if (empty($hour)) { |
|
| 410 | + $hour = '00'; |
|
| 411 | + } |
|
| 412 | + if (empty($min)) { |
|
| 413 | + $min = '00'; |
|
| 414 | + } |
|
| 406 | 415 | return $hour . ':' . $min; |
| 407 | 416 | } |
| 408 | 417 | |
@@ -413,10 +422,11 @@ discard block |
||
| 413 | 422 | */ |
| 414 | 423 | public function get_changed_day($mode) |
| 415 | 424 | { |
| 416 | - if ($mode == 'increment') |
|
| 417 | - $day = $this->day + 1; |
|
| 418 | - else |
|
| 419 | - $day = $this->day - 1; |
|
| 425 | + if ($mode == 'increment') { |
|
| 426 | + $day = $this->day + 1; |
|
| 427 | + } else { |
|
| 428 | + $day = $this->day - 1; |
|
| 429 | + } |
|
| 420 | 430 | $date_data = array('day' => $day, |
| 421 | 431 | 'month' => $this->month, |
| 422 | 432 | 'year' => $this->year |
@@ -432,10 +442,11 @@ discard block |
||
| 432 | 442 | public function get_first_day_of_changed_week($mode) |
| 433 | 443 | { |
| 434 | 444 | $first_day = $this->getThisweekDaysbyIndex(1); |
| 435 | - if ($mode == 'increment') |
|
| 436 | - $day = $first_day->day + 7; |
|
| 437 | - else |
|
| 438 | - $day = $first_day->day - 7; |
|
| 445 | + if ($mode == 'increment') { |
|
| 446 | + $day = $first_day->day + 7; |
|
| 447 | + } else { |
|
| 448 | + $day = $first_day->day - 7; |
|
| 449 | + } |
|
| 439 | 450 | $date_data = array('day' => $day, |
| 440 | 451 | 'month' => $first_day->month, |
| 441 | 452 | 'year' => $first_day->year |
@@ -11,6 +11,10 @@ |
||
| 11 | 11 | class VTJsonCondition |
| 12 | 12 | { |
| 13 | 13 | |
| 14 | + /** |
|
| 15 | + * @param VTEntityCache $entityCache |
|
| 16 | + * @param string $id |
|
| 17 | + */ |
|
| 14 | 18 | function evaluate($condition, $entityCache, $id) |
| 15 | 19 | { |
| 16 | 20 | $expr = \includes\utils\Json::decode($condition); |
@@ -24,8 +24,9 @@ discard block |
||
| 24 | 24 | $i = 0; |
| 25 | 25 | foreach ($expr as $cond) { |
| 26 | 26 | $conditionGroup = $cond['groupid']; |
| 27 | - if (empty($conditionGroup)) |
|
| 28 | - $conditionGroup = 0; |
|
| 27 | + if (empty($conditionGroup)) { |
|
| 28 | + $conditionGroup = 0; |
|
| 29 | + } |
|
| 29 | 30 | preg_match('/(\w+) : \((\w+)\) (\w+)/', $cond['fieldname'], $matches); |
| 30 | 31 | if (count($matches) == 0) { |
| 31 | 32 | $expressionResults[$conditionGroup][$i]['result'] = $this->checkCondition($entityData, $cond); |
@@ -117,8 +118,9 @@ discard block |
||
| 117 | 118 | $data = $entityData->getData(); |
| 118 | 119 | |
| 119 | 120 | $condition = $cond['operation']; |
| 120 | - if (empty($condition)) |
|
| 121 | - return false; |
|
| 121 | + if (empty($condition)) { |
|
| 122 | + return false; |
|
| 123 | + } |
|
| 122 | 124 | if ($cond['fieldname'] == 'date_start' || $cond['fieldname'] == 'due_date') { |
| 123 | 125 | $fieldName = $cond['fieldname']; |
| 124 | 126 | $dateTimePair = array('date_start' => 'time_start', 'due_date' => 'time_end'); |
@@ -238,8 +240,9 @@ discard block |
||
| 238 | 240 | } |
| 239 | 241 | return strpos($fieldValue, $value) !== FALSE; |
| 240 | 242 | case 'does not contain': |
| 241 | - if (empty($value)) |
|
| 242 | - unset($value); |
|
| 243 | + if (empty($value)) { |
|
| 244 | + unset($value); |
|
| 245 | + } |
|
| 243 | 246 | if (is_array($value)) { |
| 244 | 247 | return !in_array($fieldValue, $value); |
| 245 | 248 | } |
@@ -152,6 +152,9 @@ discard block |
||
| 152 | 152 | } |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | + /** |
|
| 156 | + * @param VTTaskType $taskTypeInstance |
|
| 157 | + */ |
|
| 155 | 158 | public function retrieveTemplatePath($moduleName, $taskTypeInstance) |
| 156 | 159 | { |
| 157 | 160 | $taskTemplatePath = $taskTypeInstance->get('templatepath'); |
@@ -226,6 +229,9 @@ discard block |
||
| 226 | 229 | |
| 227 | 230 | var $data; |
| 228 | 231 | |
| 232 | + /** |
|
| 233 | + * @param string $key |
|
| 234 | + */ |
|
| 229 | 235 | public function get($key) |
| 230 | 236 | { |
| 231 | 237 | return $this->data[$key]; |