Skip to content

Commit

Permalink
fix(App) eliminate warnings/notice and cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
joebordes committed Jan 31, 2017
1 parent d0be9ad commit cc4da2e
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 57 deletions.
53 changes: 17 additions & 36 deletions Smarty/templates/CustomView.tpl
Expand Up @@ -8,7 +8,6 @@
********************************************************************************/
-->
<link rel="stylesheet" type="text/css" media="all" href="jscalendar/calendar-win2k-cold-1.css">
{$DATE_JS}
<script type="text/javascript" src="jscalendar/calendar.js"></script>
<script type="text/javascript" src="jscalendar/lang/calendar-{$APP.LBL_JSCALENDAR_LANG}.js"></script>
<script type="text/javascript" src="jscalendar/calendar-setup.js"></script>
Expand Down Expand Up @@ -108,22 +107,22 @@ function mandatoryCheck()
<td class="dvtCellInfo" width="10%" align="right"><span class="style1">*</span>{$MOD.LBL_VIEW_NAME}
</td>
<td class="dvtCellInfo" width="30%">
<input class="detailedViewTextBox" type="text" name='viewName' value="{$VIEWNAME}" onfocus="this.className='detailedViewTextBoxOn'" onblur="this.className='detailedViewTextBox'" size="40"/>
</td>
<td class="dvtCellInfo" width="20%">
{if $CHECKED eq 'checked'}
<input type="checkbox" name="setDefault" value="1" checked/>{$MOD.LBL_SETDEFAULT}
{else}
<input type="checkbox" name="setDefault" value="0" />{$MOD.LBL_SETDEFAULT}
{/if}
</td>
<td class="dvtCellInfo" width="20%">
{if $MCHECKED eq 'checked'}
<input type="checkbox" name="setMetrics" value="1" checked/>{$MOD.LBL_LIST_IN_METRICS}
{else}
<input type="checkbox" name="setMetrics" value="0" />{$MOD.LBL_LIST_IN_METRICS}
{/if}
</td>
<input class="detailedViewTextBox" type="text" name='viewName' value="{if isset($VIEWNAME)}{$VIEWNAME}{/if}" onfocus="this.className='detailedViewTextBoxOn'" onblur="this.className='detailedViewTextBox'" size="40"/>
</td>
<td class="dvtCellInfo" width="20%">
{if $CHECKED eq 'checked'}
<input type="checkbox" name="setDefault" value="1" checked/>{$MOD.LBL_SETDEFAULT}
{else}
<input type="checkbox" name="setDefault" value="0" />{$MOD.LBL_SETDEFAULT}
{/if}
</td>
<td class="dvtCellInfo" width="20%">
{if $MCHECKED eq 'checked'}
<input type="checkbox" name="setMetrics" value="1" checked/>{$MOD.LBL_LIST_IN_METRICS}
{else}
<input type="checkbox" name="setMetrics" value="0" />{$MOD.LBL_LIST_IN_METRICS}
{/if}
</td>
<td class="dvtCellInfo" width="20%">
{if $STATUS eq '' || $STATUS eq 1}
<input type="checkbox" name="setStatus" value="1"/>
Expand Down Expand Up @@ -158,25 +157,7 @@ function mandatoryCheck()
{foreach item=text from=$filteroption}
{assign var=option_values value=$text.text}
<option {if $SELECTEDCOLUMN[$cvselected] eq $text.value}selected{/if} value={$text.value}>
{if $MOD.$option_values neq ''}
{if $DATATYPE.0.$option_values eq 'M'}
{$MOD.$option_values} {$APP.LBL_REQUIRED_SYMBOL}
{else}
{$MOD.$option_values}
{/if}
{elseif $APP.$option_values neq ''}
{if $DATATYPE.0.$option_values eq 'M'}
{$APP.$option_values} {$APP.LBL_REQUIRED_SYMBOL}
{else}
{$APP.$option_values}
{/if}
{else}
{if $DATATYPE.0.$option_values eq 'M'}
{$option_values} {$APP.LBL_REQUIRED_SYMBOL}
{else}
{$option_values}
{/if}
{/if}
{$text.text}{if $DATATYPE.0.$option_values eq 'M'} {$APP.LBL_REQUIRED_SYMBOL}{/if}
</option>
{/foreach}
{/foreach}
Expand Down
4 changes: 2 additions & 2 deletions Smarty/templates/DetailViewFields.tpl
Expand Up @@ -82,7 +82,7 @@
{assign var=fontval value=''}
{/if}
{/foreach}
<font color="{$fontval}">{if $APP.$keyval!=''}{$APP.$keyval}{elseif $MOD.$keyval!=''}{$MOD.$keyval}{else}{$keyval}{/if}</font>
<font color="{$fontval}">{$keyval|@getTranslatedString:$MODULE}</font>
</td>
{elseif $keyid eq '33' || $keyid eq '3313' || $keyid eq '3314'}
<td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$keyfldname}">&nbsp;
Expand All @@ -106,7 +106,7 @@
<span id="dtlview_{$label}"><a href="skype:{$keyval}?call">{$keyval}</a></span>
</td>
{elseif $keyid eq '19' || $keyid eq '20'} <!--TextArea/Description-->
{if $label eq $MOD.LBL_ADD_COMMENT}
{if isset($MOD.LBL_ADD_COMMENT) && $label eq $MOD.LBL_ADD_COMMENT}
{assign var=keyval value=''}
{/if}
<td width=100% colspan="3" class="dvtCellInfo" align="left" id="mouseArea_{$keyfldname}">&nbsp;
Expand Down
2 changes: 1 addition & 1 deletion Smarty/templates/ListViewEntries.tpl
Expand Up @@ -9,7 +9,7 @@
********************************************************************************/
-->*}
{if isset($smarty.request.ajax) && $smarty.request.ajax neq ''}
&#&#&#{$ERROR}&#&#&#
&#&#&#{if isset($ERROR)}{$ERROR}{/if}&#&#&#
{/if}
<script type="text/javascript" src="include/js/ListView.js"></script>
<form name="massdelete" method="POST" id="massdelete" onsubmit="VtigerJS_DialogBox.block();">
Expand Down
2 changes: 1 addition & 1 deletion Smarty/templates/modules/RecycleBin/RecycleBinContents.tpl
Expand Up @@ -26,7 +26,7 @@
<input type="hidden" name="selected_module" id="selected_module" value="{$SELECTED_MODULE}">
<input type="hidden" name="selected_module_translated" id="selected_module_translated" value="{$SELECTED_MODULE|@getTranslatedString:$SELECTED_MODULE}">
<input class="crmbutton small edit" type="button" onclick ="massRestore();" value="{$MOD.LBL_MASS_RESTORE}">
if $IS_ADMIN eq 'true'}
{if $IS_ADMIN eq 'true'}
<input class="crmbutton small delete" type="button" onclick ="callEmptyRecyclebin();" value="{$MOD.LBL_EMPTY_RBMODULE}">
<input class="crmbutton small delete" type="button" onclick ="document.getElementById('rb_empty_conf_id').style.display = 'block';" value="{$MOD.LBL_EMPTY_RECYCLEBIN}">
{/if}
Expand Down
7 changes: 4 additions & 3 deletions include/QueryGenerator/QueryGenerator.php
Expand Up @@ -1324,7 +1324,7 @@ public function addUserSearchConditions($input) {
}
}
$this->endGroup();
} elseif($input['type']=='dbrd') {
} elseif(isset($input['type']) and $input['type']=='dbrd') {
if($this->conditionInstanceCount > 0) {
$this->startGroup(self::$AND);
} else {
Expand Down Expand Up @@ -1368,8 +1368,7 @@ public function addUserSearchConditions($input) {
if(isset($input['search_text']) && $input['search_text']!="") {
// search other characters like "|, ?, ?" by jagi
$value = $input['search_text'];
$stringConvert = function_exists(iconv) ? @iconv("UTF-8",$default_charset,$value)
: $value;
$stringConvert = function_exists('iconv') ? @iconv('UTF-8',$default_charset,$value) : $value;
if(!$this->isStringType($type)) {
$value=trim($stringConvert);
}
Expand All @@ -1391,6 +1390,8 @@ public function addUserSearchConditions($input) {
$value = $currencyField->getDBInsertedValue();
}
}
} else {
$value = '';
}
if(!empty($input['operator'])) {
$operator = $input['operator'];
Expand Down
1 change: 1 addition & 0 deletions include/utils/DetailViewUtils.php
Expand Up @@ -1668,6 +1668,7 @@ function getRelatedLists($module, $focus,$restrictedRelations=null) {
// END
$result = $adb->pquery($sql1, array($cur_tab_id));
$num_row = $adb->num_rows($result);
$focus_list = array();
for ($i = 0; $i < $num_row; $i++) {
$rel_tab_id = $adb->query_result($result, $i, "related_tabid");
$function_name = $adb->query_result($result, $i, "name");
Expand Down
2 changes: 1 addition & 1 deletion include/utils/EditViewUtils.php
Expand Up @@ -1083,7 +1083,7 @@ function getOutputHtml($uitype, $fieldname, $fieldlabel, $maxlength, $col_fields
elseif($uitype == 71 || $uitype == 72) {
$currencyField = new CurrencyField($value);
// Some of the currency fields like Unit Price, Total, Sub-total etc of Inventory modules, do not need currency conversion
if($col_fields['record_id'] != '' && $uitype == 72) {
if(!empty($col_fields['record_id']) && $uitype == 72) {
if($fieldname == 'unit_price') {
$rate_symbol = getCurrencySymbolandCRate(getProductBaseCurrency($col_fields['record_id'],$module_name));
$currencySymbol = $rate_symbol['symbol'];
Expand Down
4 changes: 2 additions & 2 deletions include/utils/SearchUtils.php
Expand Up @@ -199,7 +199,7 @@ function Search($module, $input = '')
if(isset($input['search_text']) && $input['search_text']!="") {
// search other characters like "|, ?, ?" by jagi
$search_string = $input['search_text'];
$stringConvert = function_exists(iconv) ? @iconv("UTF-8",$default_charset,$search_string) : $search_string;
$stringConvert = function_exists('iconv') ? @iconv('UTF-8',$default_charset,$search_string) : $search_string;
$search_string=trim($stringConvert);
}
if(isset($input['searchtype']) && $input['searchtype']!="") {
Expand Down Expand Up @@ -912,7 +912,7 @@ function getSearchURL($input) {
}
} else {
$value = vtlib_purify($input['search_text']);
$stringConvert = function_exists(iconv) ? @iconv("UTF-8",$default_charset,$value) : $value;
$stringConvert = function_exists('iconv') ? @iconv('UTF-8',$default_charset,$value) : $value;
$value=trim($stringConvert);
$field=vtlib_purify($input['search_field']);
$urlString = "&search_field=$field&search_text=".urlencode($value)."&searchtype=BasicSearch";
Expand Down
3 changes: 1 addition & 2 deletions modules/CustomView/CustomView.php
Expand Up @@ -349,8 +349,7 @@ function getColumnsListbyBlock($module, $block,$markMandatory = true) {
$fieldtype = explode("~", $fieldtype);
$fieldtypeofdata = $fieldtype[0];
$fieldlabel = $adb->query_result($result, $i, "fieldlabel");
$field = $moduleFieldList[$fieldname];
if (!empty($field) && $field->getFieldDataType() == 'reference') {
if (!empty($moduleFieldList[$fieldname]) && $moduleFieldList[$fieldname]->getFieldDataType() == 'reference') {
$fieldtypeofdata = 'V';
} else {
//Here we Changing the displaytype of the field. So that its criteria will be
Expand Down
8 changes: 4 additions & 4 deletions modules/CustomView/EditView.php
Expand Up @@ -22,7 +22,7 @@
require_once('modules/CustomView/CustomView.php');

$cv_module = vtlib_purify($_REQUEST['module']);
$recordid = vtlib_purify($_REQUEST['record']);
$recordid = isset($_REQUEST['record']) ? vtlib_purify($_REQUEST['record']) : '';

$smarty->assign("MOD", $mod_strings);
$smarty->assign("CATEGORY", getParentTab());
Expand Down Expand Up @@ -64,6 +64,7 @@

$smarty->assign("MANDATORYCHECK",implode(",",array_unique($oCustomView->mandatoryvalues)));
$smarty->assign("SHOWVALUES",implode(",",$oCustomView->showvalues));
$smarty->assign('EXIST','false');
$data_type[] = $oCustomView->data_type;
$smarty->assign("DATATYPE",$data_type);
} else {
Expand Down Expand Up @@ -300,10 +301,9 @@ function getStdFilterHTML($module,$selected="")
* 1 => array('value'=>$$tablename1:$colname1:$fieldname1:$fieldlabel1,'text'=>$mod_strings[$field label1],'selected'=>$selected),
* n => array('value'=>$$tablenamen:$colnamen:$fieldnamen:$fieldlabeln,'text'=>$mod_strings[$field labeln],'selected'=>$selected))
*/
function getAdvCriteriaHTML($selected="")
{
function getAdvCriteriaHTML($selected='') {
global $adv_filter_options;

$shtml = '';
foreach($adv_filter_options as $key=>$value) {
if($selected == $key)
{
Expand Down
3 changes: 2 additions & 1 deletion modules/Vtiger/DetailView.php
Expand Up @@ -47,7 +47,7 @@
$smarty->assign('USE_ASTERISK', get_use_asterisk($current_user->id));

$recordName = array_values(getEntityName($currentModule, $focus->id));
$recordName = $recordName[0];
$recordName = isset($recordName[0]) ? $recordName[0] : '';
$smarty->assign('NAME', $recordName);
$smarty->assign('UPDATEINFO',updateInfo($focus->id));

Expand Down Expand Up @@ -96,6 +96,7 @@
$open_related_modules = RelatedListViewSession::getRelatedModulesFromSession();
$smarty->assign("SELECTEDHEADERS", $open_related_modules);
} else {
$smarty->assign('RELATEDLISTS', array());
$bmapname = $currentModule.'RelatedPanes';
$cbMapid = GlobalVariable::getVariable('BusinessMapping_'.$bmapname, cbMap::getMapIdByName($bmapname));
if ($cbMapid) {
Expand Down
6 changes: 5 additions & 1 deletion modules/Vtiger/EditView.php
Expand Up @@ -153,7 +153,11 @@
$smarty->assign("MOD_SEQ_ID",$autostr);
}
} else {
$smarty->assign("MOD_SEQ_ID", $focus->column_fields[$mod_seq_field['name']]);
if (!empty($mod_seq_field) and !empty($mod_seq_field['name']) and !empty($focus->column_fields[$mod_seq_field['name']])) {
$smarty->assign('MOD_SEQ_ID', $focus->column_fields[$mod_seq_field['name']]);
} else {
$smarty->assign('MOD_SEQ_ID', '');
}
}

// Gather the help information associated with fields
Expand Down
2 changes: 1 addition & 1 deletion modules/cbupdater/dowork.php
Expand Up @@ -17,7 +17,6 @@
* Version : 5.5.0
* Author : JPL TSolucio, S. L.
*************************************************************************************************/

global $adb, $log, $mod_strings, $app_strings, $currentModule, $current_user, $theme;
require_once 'modules/cbupdater/cbupdaterHelper.php';

Expand All @@ -28,6 +27,7 @@
$smarty->assign('APP', $app_strings);
$smarty->assign('MOD', $mod_strings);
$smarty->assign('MODULE', $currentModule);
$smarty->assign('CUSTOM_MODULE', true);
$smarty->assign('SINGLE_MOD', getTranslatedString('SINGLE_'.$currentModule));
$smarty->assign('CATEGORY', $category);
$smarty->assign('IMAGE_PATH', "themes/$theme/images/");
Expand Down
1 change: 1 addition & 0 deletions modules/cbupdater/getupdates.php
Expand Up @@ -106,6 +106,7 @@
$smarty->assign('APP', $app_strings);
$smarty->assign('MOD', $mod_strings);
$smarty->assign('MODULE', $currentModule);
$smarty->assign('CUSTOM_MODULE', true);
$smarty->assign('SINGLE_MOD', getTranslatedString('SINGLE_'.$currentModule));
$smarty->assign('CATEGORY', $category);
$smarty->assign('IMAGE_PATH', "themes/$theme/images/");
Expand Down
4 changes: 2 additions & 2 deletions vtlib/Vtiger/Field.php
Expand Up @@ -54,8 +54,8 @@ function setPicklistValues($values) {
$adb->pquery("INSERT INTO vtiger_picklist (picklistid,name) VALUES(?,?)",Array($new_picklistid, $this->name));
self::log("Creating table $picklist_table ... DONE");
} else {
$new_picklistid = $adb->query_result(
$adb->pquery("SELECT picklistid FROM vtiger_picklist WHERE name=?", Array($this->name)), 0, 'picklistid');
$rs = $adb->pquery('SELECT picklistid FROM vtiger_picklist WHERE name=?', Array($this->name));
$new_picklistid = $adb->query_result($rs , 0, 'picklistid');
}

$specialNameSpacedPicklists = array(
Expand Down

0 comments on commit cc4da2e

Please sign in to comment.