Skip to content
Snippets Groups Projects
Commit 23a69143 authored by Prasad's avatar Prasad
Browse files

Merge branch '295132_PickListDependency' into 'foreall'

E-all Settings -PickListFiledValues

See merge request !1220
parents 29ca756c cf816775
No related branches found
No related tags found
2 merge requests!1233E_ALL fixes across modules for PHP 8.x,!1220E-all Settings -PickListFiledValues
......@@ -136,7 +136,7 @@ class Vtiger_Viewer extends Smarty {
* @return <String> - Module specific template path if exists, otherwise default template path for the given template name
*/
public function getTemplatePath($templateName, $moduleName='') {
$moduleName = str_replace(':', '/', $moduleName);
$moduleName = isset($moduleName) ? str_replace(':', '/', $moduleName) : '';
$completeFilePath = $this->getTemplateDir(0). DIRECTORY_SEPARATOR . "modules/$moduleName/$templateName";
if(!empty($moduleName) && file_exists($completeFilePath)) {
return "modules/$moduleName/$templateName";
......
......@@ -58,7 +58,7 @@
</div>
</div>
</div>
{include file='ModalFooter.tpl'|@vtemplate_path:$qualifiedName}
{include file='ModalFooter.tpl'|@vtemplate_path:{(isset($qualifiedName)) ? $qualifiedName : ''}}
</form>
</div>
</div>
......
......@@ -53,7 +53,7 @@
</div>
</div>
</div>
{include file='ModalFooter.tpl'|@vtemplate_path:$qualifiedName}
{include file='ModalFooter.tpl'|@vtemplate_path:{(isset($qualifiedName)) ? $qualifiedName : ''}}
</form>
</div>
</div>
......
......@@ -26,7 +26,7 @@
<div class="col-sm-3 col-xs-3 fieldValue">
<select class="select2 inputElement" id="modulePickList" name="modulePickList">
{foreach key=PICKLIST_FIELD item=FIELD_MODEL from=$PICKLIST_FIELDS}
<option value="{$FIELD_MODEL->getId()}" {if $DEFAULT_FIELD eq $FIELD_MODEL->getName()} selected {/if}>{vtranslate($FIELD_MODEL->get('label'),$SELECTED_MODULE_NAME)}</option>
<option value="{$FIELD_MODEL->getId()}" {if isset($DEFAULT_FIELD) && $DEFAULT_FIELD eq $FIELD_MODEL->getName()} selected {/if}>{vtranslate($FIELD_MODEL->get('label'),$SELECTED_MODULE_NAME)}</option>
{/foreach}
</select>
</div>
......
......@@ -59,7 +59,8 @@ class Settings_Picklist_Module_Model extends Vtiger_Module_Model {
FROM vtiger_role2picklist left join vtiger_$pickListFieldName
on vtiger_$pickListFieldName.picklist_valueid=vtiger_role2picklist.picklistvalueid
WHERE roleid=? and picklistid=?";
$sortid = $db->query_result($db->pquery($sql, array($roleid, $picklistid)),0,'sortid');
$result = $db->pquery($sql, array($roleid, $picklistid));
$sortid = $db->query_result($result,0,'sortid');
$sql = "insert into vtiger_role2picklist values(?,?,?,?)";
$db->pquery($sql, array($roleid, $picklist_valueid, $picklistid, $sortid));
......@@ -375,6 +376,7 @@ class Settings_Picklist_Module_Model extends Vtiger_Module_Model {
}
$allLang = Vtiger_Language_Handler::getAllLanguages();
foreach ($allLang as $langKey => $langName) {
$langDir = 'languages/' . $langKey . '/custom/';
if (!file_exists($langDir)) {
......@@ -419,6 +421,7 @@ class Settings_Picklist_Module_Model extends Vtiger_Module_Model {
}
fwrite($fp, ");");
}
$jsLanguageStrings = array();
if ($jsLanguageStrings) {
fwrite($fp, "\n\$jsLanguageStrings = array(\n");
foreach ($jsLanguageStrings as $key => $value) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment