• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP vtlib_getModuleNameById函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中vtlib_getModuleNameById函数的典型用法代码示例。如果您正苦于以下问题:PHP vtlib_getModuleNameById函数的具体用法?PHP vtlib_getModuleNameById怎么用?PHP vtlib_getModuleNameById使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了vtlib_getModuleNameById函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getSecondaryColumns_AdvFilterHTML

/** Function to get Secondary columns for an advanced filter
 *  This function accepts The module as an argument
 *  This generate columns of the secondary module for the advanced filter 
 *  It returns a HTML string of combo values
 */
function getSecondaryColumns_AdvFilterHTML($module, $selected = "")
{
    global $ITS4YouReports;
    global $app_list_strings;
    global $current_language;
    if ($module != "") {
        $secmodule = explode(":", $module);
        for ($i = 0; $i < count($secmodule); $i++) {
            $modulename = vtlib_getModuleNameById($secmodule[$i]);
            $mod_strings = return_module_language($current_language, $modulename);
            if (vtlib_isModuleActive($modulename)) {
                $block_listed = array();
                foreach ($ITS4YouReports->module_list[$modulename] as $key => $value) {
                    if (isset($ITS4YouReports->sec_module_columnslist[$modulename][$key]) && !$block_listed[$key]) {
                        $block_listed[$key] = true;
                        $shtml .= "<optgroup label=\"" . $app_list_strings['moduleList'][$modulename] . " " . getTranslatedString($key) . "\" class=\"select\" style=\"border:none\">";
                        foreach ($ITS4YouReports->sec_module_columnslist[$modulename][$key] as $field => $fieldlabel) {
                            if (isset($mod_strings[$fieldlabel])) {
                                if ($selected == $field) {
                                    $shtml .= "<option selected value=\"" . $field . "\">" . $mod_strings[$fieldlabel] . "</option>";
                                } else {
                                    $shtml .= "<option value=\"" . $field . "\">" . $mod_strings[$fieldlabel] . "</option>";
                                }
                            } else {
                                if ($selected == $field) {
                                    $shtml .= "<option selected value=\"" . $field . "\">" . $fieldlabel . "</option>";
                                } else {
                                    $shtml .= "<option value=\"" . $field . "\">" . $fieldlabel . "</option>";
                                }
                            }
                        }
                        $shtml .= "</optgroup>";
                    }
                }
            }
        }
    }
    return $shtml;
}
开发者ID:cin-system,项目名称:cinrepo,代码行数:44,代码来源:FilterUtils.php


示例2: getInventoryJoinSQL

 public function getInventoryJoinSQL(&$join_array, &$columns_array)
 {
     require_once 'modules/ITS4YouReports/ITS4YouReports.php';
     $fieldid_alias = "";
     if ($this->params["fieldid"] != "") {
         $fieldid_alias = "_" . $this->params["fieldid"];
     }
     $formodule = $this->params["formodule"];
     $oth_as = "_" . $formodule;
     // show("oldo ui 10 intentory join",$formodule,$this->params);
     $uirelmodule = vtlib_getModuleNameById($formodule);
     // show("oldo ui 10 intentory join2",$uirelmodule);
     $related_focus = CRMEntity::getInstance($uirelmodule);
     $field_case = $this->getJoinSQL_UI10($join_array, $columns_array, $uirelmodule);
     // show("oldo ui 10 intentory join000",$join_array,"oldo ui 10 intentory join000 POST");
     $join_array[" vtiger_inventoryproductrel AS vtiger_inventoryproductrel" . $oth_as . $fieldid_alias . " "]["joincol"] = "vtiger_inventoryproductrel" . $oth_as . $fieldid_alias . ".id";
     $join_array[" vtiger_inventoryproductrel AS vtiger_inventoryproductrel" . $oth_as . $fieldid_alias . " "]["using"] = $related_focus->table_name . $fieldid_alias . "." . $related_focus->table_index;
     $join_array[" vtiger_products AS vtiger_products_inv" . $oth_as . $fieldid_alias . " "]["joincol"] = "vtiger_products_inv" . $oth_as . $fieldid_alias . ".productid";
     $join_array[" vtiger_products AS vtiger_products_inv" . $oth_as . $fieldid_alias . " "]["using"] = "vtiger_inventoryproductrel" . $oth_as . $fieldid_alias . ".productid";
     $join_array[" vtiger_crmentity AS vtiger_crmentity_products_inv" . $oth_as . $fieldid_alias . " "]["joincol"] = "vtiger_crmentity_products_inv" . $oth_as . $fieldid_alias . ".crmid";
     $join_array[" vtiger_crmentity AS vtiger_crmentity_products_inv" . $oth_as . $fieldid_alias . " "]["using"] = "vtiger_products_inv" . $oth_as . $fieldid_alias . ".productid AND vtiger_crmentity_products_inv" . $oth_as . $fieldid_alias . ".deleted=0 ";
     $join_array[" vtiger_service AS vtiger_service_inv" . $oth_as . $fieldid_alias . " "]["joincol"] = "vtiger_service_inv" . $oth_as . $fieldid_alias . ".serviceid";
     $join_array[" vtiger_service AS vtiger_service_inv" . $oth_as . $fieldid_alias . " "]["using"] = "vtiger_inventoryproductrel" . $oth_as . $fieldid_alias . ".productid";
     $join_array[" vtiger_crmentity AS vtiger_crmentity_service_inv" . $oth_as . $fieldid_alias . " "]["joincol"] = "vtiger_crmentity_service_inv" . $oth_as . $fieldid_alias . ".crmid";
     $join_array[" vtiger_crmentity AS vtiger_crmentity_service_inv" . $oth_as . $fieldid_alias . " "]["using"] = "vtiger_service_inv" . $oth_as . $fieldid_alias . ".serviceid AND vtiger_crmentity_service_inv" . $oth_as . $fieldid_alias . ".deleted=0 ";
     $column_tablename = "vtiger_inventoryproductrel";
     if ($this->params["columnname"] != "") {
         $column_tablename_alias = $this->params["tablename"];
         if ($column_tablename_alias == "vtiger_crmentity") {
             $column_tablename_alias = $column_tablename . "_" . strtolower($this->params["fieldmodule"]) . "_inv";
         }
         $fld_cond = $this->getInventoryColumnFldCond($this->params["columnname"], $column_tablename_alias, $oth_as . $fieldid_alias);
         $columns_array_value = $this->getColumnsArrayValue($fld_cond, $oth_as . $fieldid_alias);
         $fld_alias = $this->params["columnname"] . $fieldid_alias;
         if (!in_array(" vtiger_inventoryproductrel" . $fieldid_alias . ".lineitem_id AS lineitem_id" . $fieldid_alias . " ", $columns_array)) {
             $columns_array[] = " vtiger_inventoryproductrel" . $fieldid_alias . ".lineitem_id AS lineitem_id" . $fieldid_alias . " ";
         }
         if ($using_tablename != "" && $using_columnname != "") {
             $columns_array[] = " {$using_tablename}.{$using_columnname} AS record_id" . $fieldid_alias . " ";
         }
         $columns_array[] = $columns_array_value;
         $columns_array[$this->params["fld_string"]]["fld_alias"] = $fld_alias;
         $columns_array[$this->params["fld_string"]]["fld_sql_str"] = $columns_array_value;
         $columns_array[$this->params["fld_string"]]["fld_cond"] = $fld_cond;
         $columns_array["uitype_{$fld_alias}"] = $this->params["field_uitype"];
         $columns_array[$fld_alias] = $this->params["fld_string"];
     }
     /*
     ITS4YouReports::sshow("6-".$this->params["columnname"]);
             if ($this->params["columnname"] == 'discount') {
                 $fld_cond = " CASE WHEN (" . "vtiger_inventoryproductrel" . $oth_as . $fieldid_alias . ".discount_amount != '') THEN " . "vtiger_inventoryproductrel" . $oth_as . $fieldid_alias . ".discount_amount else ROUND((" . "vtiger_inventoryproductrel" . $oth_as . $fieldid_alias . ".listprice * " . "vtiger_inventoryproductrel" . $oth_as . $fieldid_alias . ".quantity * (" . "vtiger_inventoryproductrel" . $oth_as . $fieldid_alias . ".discount_percent/100)),3) END ";
                 $columns_array_value = $fld_cond . " AS '" . $this->params["columnname"] . $oth_as . $fieldid_alias . "'";
             } elseif ($this->params["columnname"] == "prodname") {
                 $fld_cond = " CASE WHEN (vtiger_products_inv" . $oth_as . $fieldid_alias . ".productname IS NOT NULL) THEN vtiger_products_inv" . $oth_as . $fieldid_alias . ".productname ELSE vtiger_service_inv" . $oth_as . $fieldid_alias . ".servicename END ";
                 $columns_array_value = $fld_cond . " AS prodname" . $oth_as . $fieldid_alias . " ";
             } else {
                 // $fld_cond = "vtiger_inventoryproductrel".$oth_as.$fieldid_alias.".".$this->params["columnname"];
                 $fld_cond = $this->params["columnname"];
                 $columns_array_value = $fld_cond . " AS " . $this->params["columnname"] . $oth_as . $fieldid_alias;
             }
             $fld_alias = $this->params["columnname"] . $oth_as . $fieldid_alias;
             
             if(!in_array(" vtiger_inventoryproductrel" . $fieldid_alias . ".lineitem_id AS lineitem_id" . $fieldid_alias . " ",$columns_array)){
                 $columns_array[] = " vtiger_inventoryproductrel" . $fieldid_alias . ".lineitem_id AS lineitem_id" . $fieldid_alias . " ";
             }
             if($using_tablename!="" && $using_columnname!=""){
                 $columns_array[] = " $using_tablename.$using_columnname AS record_id" . $fieldid_alias . " ";
             }
             $columns_array[] = $columns_array_value;
             $columns_array[$this->params["fld_string"]]["fld_alias"] = $fld_alias;
             $columns_array[$this->params["fld_string"]]["fld_sql_str"] = $columns_array_value;
             $columns_array[$this->params["fld_string"]]["fld_cond"] = $fld_cond;
             $columns_array["uitype_$fld_alias"] = $this->params["field_uitype"];
             $columns_array[$fld_alias] = $this->params["fld_string"];
     */
     return;
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:77,代码来源:UIType10.php


示例3: get_activities

 /**	function used to get the list of activities which are related to the Quotes
  *	@param int $id - quote id
  *	@return array - return an array which will be returned from the function GetRelatedList
  */
 function get_activities($id, $cur_tab_id, $rel_tab_id, $actions = false)
 {
     global $log, $singlepane_view, $currentModule, $current_user;
     $log->debug("Entering get_activities(" . $id . ") method ...");
     $this_module = $currentModule;
     $related_module = vtlib_getModuleNameById($rel_tab_id);
     require_once "modules/{$related_module}/Activity.php";
     $other = new Activity();
     vtlib_setup_modulevars($related_module, $other);
     $singular_modname = vtlib_toSingular($related_module);
     $parenttab = getParentTab();
     if ($singlepane_view == 'true') {
         $returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
     } else {
         $returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
     }
     $button = '';
     $button .= '<input type="hidden" name="activity_mode">';
     if ($actions) {
         if (is_string($actions)) {
             $actions = explode(',', strtoupper($actions));
         }
         if (in_array('ADD', $actions) && isPermitted($related_module, 1, '') == 'yes') {
             $button .= "<input title='" . getTranslatedString('LBL_NEW') . " " . getTranslatedString('LBL_TODO', $related_module) . "' class='crmbutton small create'" . " onclick='this.form.action.value=\"EditView\";this.form.module.value=\"{$related_module}\";this.form.return_module.value=\"{$this_module}\";this.form.activity_mode.value=\"Task\";' type='submit' name='button'" . " value='" . getTranslatedString('LBL_ADD_NEW') . " " . getTranslatedString('LBL_TODO', $related_module) . "'>&nbsp;";
         }
     }
     $query = "SELECT case when (vtiger_users.user_name not like '') then vtiger_users.user_name else vtiger_groups.groupname end as user_name, vtiger_contactdetails.contactid, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_activity.*,vtiger_seactivityrel.*,vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime,vtiger_recurringevents.recurringtype from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_cntactivityrel.contactid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_groups on vtiger_groups.groupid=vtiger_crmentity.smownerid where vtiger_seactivityrel.crmid=" . $id . " and vtiger_crmentity.deleted=0 and activitytype='Task' and (vtiger_activity.status is not NULL and vtiger_activity.status != 'Completed') and (vtiger_activity.status is not NULL and vtiger_activity.status != 'Deferred')";
     $return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
     if ($return_value == null) {
         $return_value = array();
     }
     $return_value['CUSTOM_BUTTON'] = $button;
     $log->debug("Exiting get_activities method ...");
     return $return_value;
 }
开发者ID:hardikk,项目名称:HNH,代码行数:39,代码来源:Quotes.php


示例4: get_osstimecontrol

 /**
  * Invoked when special actions are performed on the module.
  * @param String Module name
  * @param String Event Type (module.postinstall, module.disabled, module.enabled, module.preuninstall)
  */
 function get_osstimecontrol($id, $cur_tab_id, $rel_tab_id, $actions = false)
 {
     global $log, $singlepane_view, $currentModule, $current_user;
     $log->debug("Entering get_osstimecontrol(" . $id . ") method ...");
     $this_module = $currentModule;
     $related_module = vtlib_getModuleNameById($rel_tab_id);
     require_once "modules/{$related_module}/{$related_module}.php";
     $other = new $related_module();
     vtlib_setup_modulevars($related_module, $other);
     $singular_modname = vtlib_toSingular($related_module);
     $record = Vtiger_Record_Model::getInstanceById($id);
     $userId = $record->get('assigned_user_id');
     if ($singlepane_view == 'true') {
         $returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
     } else {
         $returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
     }
     $button = '';
     if ($actions && getFieldVisibilityPermission($related_module, $current_user->id, 'parent_id', 'readwrite') == '0') {
         if (is_string($actions)) {
             $actions = explode(',', strtoupper($actions));
         }
         if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') {
             $button .= "<input title='" . getTranslatedString('LBL_SELECT') . " " . getTranslatedString($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='" . getTranslatedString('LBL_SELECT') . " " . getTranslatedString($related_module) . "'>&nbsp;";
         }
         if (in_array('ADD', $actions) && isPermitted($related_module, 1, '') == 'yes') {
             $button .= "<input title='" . getTranslatedString('LBL_ADD_NEW') . " " . getTranslatedString($singular_modname) . "' class='crmbutton small create'" . " onclick='this.form.action.value=\"EditView\";this.form.module.value=\"{$related_module}\"' type='submit' name='button'" . " value='" . getTranslatedString('LBL_ADD_NEW') . " " . getTranslatedString($singular_modname) . "'>&nbsp;";
         }
     }
     $userNameSql = getSqlForNameInDisplayFormat(array('first_name' => 'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');
     $query = "SELECT case when (vtiger_users.user_name not like '') then {$userNameSql} else vtiger_groups.groupname end as user_name, vtiger_users.id,\n\t\t\t\tvtiger_osstimecontrol.name, vtiger_osstimecontrol.osstimecontrolid as crmid, vtiger_osstimecontrol.osstimecontrol_status, vtiger_osstimecontrol.payment,\n\t\t\t\tvtiger_osstimecontrol.osstimecontrol_no, vtiger_osstimecontrol.date_start, vtiger_osstimecontrol.due_date, vtiger_osstimecontrol.time_end, vtiger_osstimecontrol.sum_time, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime\n\t\t\t\tFROM vtiger_osstimecontrol\n\t\t\t\tINNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_osstimecontrol.osstimecontrolid\n\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id=vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\tWHERE  vtiger_crmentity.deleted = 0 AND vtiger_crmentity.`smownerid`= " . $userId;
     $return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
     if ($return_value == null) {
         $return_value = array();
     }
     $return_value['CUSTOM_BUTTON'] = $button;
     $log->debug("Exiting get_osstimecontrol method ...");
     return $return_value;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:44,代码来源:OSSEmployees.php


示例5: get_service_pricebooks

 /**	function used to get the list of pricebooks which are related to the service
  *	@param int $id - service id
  *	@return array - array which will be returned from the function GetRelatedList
  */
 function get_service_pricebooks($id, $cur_tab_id, $rel_tab_id, $actions = false)
 {
     global $currentModule, $log, $singlepane_view, $mod_strings;
     $log->debug("Entering get_service_pricebooks(" . $id . ") method ...");
     $related_module = vtlib_getModuleNameById($rel_tab_id);
     checkFileAccessForInclusion("modules/{$related_module}/{$related_module}.php");
     require_once "modules/{$related_module}/{$related_module}.php";
     $focus = new $related_module();
     $singular_modname = vtlib_toSingular($related_module);
     if ($singlepane_view == 'true') {
         $returnset = "&return_module={$currentModule}&return_action=DetailView&return_id={$id}";
     } else {
         $returnset = "&return_module={$currentModule}&return_action=CallRelatedList&return_id={$id}";
     }
     $button = '';
     if ($actions) {
         if (is_string($actions)) {
             $actions = explode(',', strtoupper($actions));
         }
         if (in_array('ADD', $actions) && isPermitted($related_module, 1, '') == 'yes' && isPermitted($currentModule, 'EditView', $id) == 'yes') {
             $button .= "<input title='" . getTranslatedString('LBL_ADD_TO') . " " . getTranslatedString($related_module) . "' class='crmbutton small create'" . " onclick='this.form.action.value=\"AddServiceToPriceBooks\";this.form.module.value=\"{$currentModule}\"' type='submit' name='button'" . " value='" . getTranslatedString('LBL_ADD_TO') . " " . getTranslatedString($singular_modname) . "'>&nbsp;";
         }
     }
     $query = "SELECT vtiger_crmentity.crmid,\n\t\t\tvtiger_pricebook.*,\n\t\t\tvtiger_pricebookproductrel.productid as prodid\n\t\t\tFROM vtiger_pricebook\n\t\t\tINNER JOIN vtiger_crmentity\n\t\t\t\tON vtiger_crmentity.crmid = vtiger_pricebook.pricebookid\n\t\t\tINNER JOIN vtiger_pricebookproductrel\n\t\t\t\tON vtiger_pricebookproductrel.pricebookid = vtiger_pricebook.pricebookid\n\t\t\tWHERE vtiger_crmentity.deleted = 0\n\t\t\tAND vtiger_pricebookproductrel.productid = " . $id;
     $log->debug("Exiting get_product_pricebooks method ...");
     $return_value = GetRelatedList($currentModule, $related_module, $focus, $query, $button, $returnset);
     if ($return_value == null) {
         $return_value = array();
     }
     $return_value['CUSTOM_BUTTON'] = $button;
     $log->debug("Exiting get_service_pricebooks method ...");
     return $return_value;
 }
开发者ID:mslokhat,项目名称:corebos,代码行数:37,代码来源:Services.php


示例6: get_vendors

 /**
  * Function to get Contact related vendors.
  * @param  integer   $id      - contactid
  * returns related vendor records in array format
  */
 function get_vendors($id, $cur_tab_id, $rel_tab_id, $actions = false)
 {
     global $log, $singlepane_view, $currentModule, $current_user;
     $log->debug("Entering get_vendors(" . $id . ") method ...");
     $this_module = $currentModule;
     $related_module = vtlib_getModuleNameById($rel_tab_id);
     require_once "modules/{$related_module}/{$related_module}.php";
     $other = new $related_module();
     vtlib_setup_modulevars($related_module, $other);
     $singular_modname = vtlib_toSingular($related_module);
     $parenttab = getParentTab();
     if ($singlepane_view == 'true') {
         $returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
     } else {
         $returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
     }
     $button = '';
     if ($actions) {
         if (is_string($actions)) {
             $actions = explode(',', strtoupper($actions));
         }
         if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') {
             $button .= "<input title='" . getTranslatedString('LBL_SELECT') . " " . getTranslatedString($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}&parenttab={$parenttab}','test','width=640,height=602,resizable=0,scrollbars=0');\" value='" . getTranslatedString('LBL_SELECT') . " " . getTranslatedString($related_module) . "'>&nbsp;";
         }
         if (in_array('ADD', $actions) && isPermitted($related_module, 1, '') == 'yes') {
             $button .= "<input title='" . getTranslatedString('LBL_ADD_NEW') . " " . getTranslatedString($singular_modname) . "' class='crmbutton small create'" . " onclick='this.form.action.value=\"EditView\";this.form.module.value=\"{$related_module}\"' type='submit' name='button'" . " value='" . getTranslatedString('LBL_ADD_NEW') . " " . getTranslatedString($singular_modname) . "'>&nbsp;";
         }
     }
     $userNameSql = getSqlForNameInDisplayFormat(array('first_name' => 'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');
     $query = "SELECT case when (vtiger_users.user_name not like '') then {$userNameSql} else vtiger_groups.groupname end as user_name,\n\t\t\t\tvtiger_crmentity.crmid, vtiger_vendor.*, vtiger_vendorcf.*\n\t\t\t\tfrom vtiger_vendor inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_vendor.vendorid\n\t\t\t\tINNER JOIN vtiger_vendorcontactrel on vtiger_vendorcontactrel.vendorid=vtiger_vendor.vendorid\n\t\t\t\tLEFT JOIN vtiger_vendorcf on vtiger_vendorcf.vendorid=vtiger_vendor.vendorid\n\t\t\t\tLEFT JOIN vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_groups on vtiger_groups.groupid=vtiger_crmentity.smownerid\n\t\t\t\tWHERE vtiger_crmentity.deleted=0 and vtiger_vendorcontactrel.contactid=" . $id;
     $return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
     if ($return_value == null) {
         $return_value = array();
     }
     $return_value['CUSTOM_BUTTON'] = $button;
     $log->debug("Exiting get_vendors method ...");
     return $return_value;
 }
开发者ID:jgjermeni,项目名称:corebos,代码行数:43,代码来源:Contacts.php


示例7: unlinkRelationship

 /** Function to unlink an entity with given Id from another entity */
 function unlinkRelationship($id, $return_module, $return_id)
 {
     global $log, $currentModule;
     if ($return_module == 'Accounts') {
         $focus = new $return_module();
         $entityIds = $focus->getRelatedContactsIds($return_id);
         array_push($entityIds, $return_id);
         $entityIds = implode(',', $entityIds);
         $return_modules = "'Accounts','Contacts'";
     } else {
         $entityIds = $return_id;
         $return_modules = "'" . $return_module . "'";
     }
     $query = 'DELETE FROM vtiger_crmentityrel WHERE (relcrmid=' . $id . ' AND module IN (' . $return_modules . ') AND crmid IN (' . $entityIds . ')) OR (crmid=' . $id . ' AND relmodule IN (' . $return_modules . ') AND relcrmid IN (' . $entityIds . '))';
     $this->db->pquery($query, array());
     $sql = 'SELECT tabid, tablename, columnname FROM vtiger_field WHERE fieldid IN (SELECT fieldid FROM vtiger_fieldmodulerel WHERE module=? AND relmodule IN (' . $return_modules . '))';
     $fieldRes = $this->db->pquery($sql, array($currentModule));
     $numOfFields = $this->db->num_rows($fieldRes);
     for ($i = 0; $i < $numOfFields; $i++) {
         $tabId = $this->db->query_result($fieldRes, $i, 'tabid');
         $tableName = $this->db->query_result($fieldRes, $i, 'tablename');
         $columnName = $this->db->query_result($fieldRes, $i, 'columnname');
         $relatedModule = vtlib_getModuleNameById($tabId);
         $focusObj = CRMEntity::getInstance($relatedModule);
         $updateQuery = "UPDATE {$tableName} SET {$columnName}=? WHERE {$columnName} IN ({$entityIds}) AND {$focusObj->table_index}=?";
         $updateParams = array(null, $id);
         $this->db->pquery($updateQuery, $updateParams);
     }
 }
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:30,代码来源:ServiceContracts.php


示例8: get_activities

 /**
  * Function to get Campaign related Activities
  * @param  integer   $id      - campaignid
  * returns related activities record in array format
  */
 function get_activities($id, $cur_tab_id, $rel_tab_id, $actions = false)
 {
     global $log, $singlepane_view, $currentModule, $current_user;
     $log->debug("Entering get_activities(" . $id . ") method ...");
     $this_module = $currentModule;
     $related_module = vtlib_getModuleNameById($rel_tab_id);
     require_once "modules/{$related_module}/Activity.php";
     $other = new Activity();
     vtlib_setup_modulevars($related_module, $other);
     $singular_modname = vtlib_toSingular($related_module);
     $parenttab = getParentTab();
     if ($singlepane_view == 'true') {
         $returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
     } else {
         $returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
     }
     $button = '';
     $button .= '<input type="hidden" name="activity_mode">';
     if ($actions) {
         if (is_string($actions)) {
             $actions = explode(',', strtoupper($actions));
         }
         if (in_array('ADD', $actions) && isPermitted($related_module, 1, '') == 'yes') {
             if (getFieldVisibilityPermission('Calendar', $current_user->id, 'parent_id', 'readwrite') == '0') {
                 $button .= "<input title='" . getTranslatedString('LBL_NEW') . " " . getTranslatedString('LBL_TODO', $related_module) . "' class='crmbutton small create'" . " onclick='this.form.action.value=\"EventEditView\";this.form.module.value=\"Calendar4You\";this.form.return_module.value=\"{$this_module}\";this.form.activity_mode.value=\"Task\";' type='submit' name='button'" . " value='" . getTranslatedString('LBL_ADD_NEW') . " " . getTranslatedString('LBL_TODO', $related_module) . "'>&nbsp;";
             }
             if (getFieldVisibilityPermission('Events', $current_user->id, 'parent_id', 'readwrite') == '0') {
                 $button .= "<input title='" . getTranslatedString('LBL_NEW') . " " . getTranslatedString('LBL_TODO', $related_module) . "' class='crmbutton small create'" . " onclick='this.form.action.value=\"EventEditView\";this.form.module.value=\"Calendar4You\";this.form.return_module.value=\"{$this_module}\";this.form.activity_mode.value=\"Events\";' type='submit' name='button'" . " value='" . getTranslatedString('LBL_ADD_NEW') . " " . getTranslatedString('LBL_EVENT', $related_module) . "'>";
             }
         }
     }
     $userNameSql = getSqlForNameInDisplayFormat(array('first_name' => 'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');
     $query = "SELECT vtiger_contactdetails.lastname,\n\t\t\tvtiger_contactdetails.firstname,\n\t\t\tvtiger_contactdetails.contactid,\n\t\t\tvtiger_activity.*,\n\t\t\tvtiger_seactivityrel.*,\n\t\t\tvtiger_crmentity.crmid, vtiger_crmentity.smownerid,\n\t\t\tvtiger_crmentity.modifiedtime,\n\t\t\tCASE when (vtiger_users.user_name not like '') then {$userNameSql} else vtiger_groups.groupname end as user_name,\n\t\t\tvtiger_recurringevents.recurringtype\n\t\t\tFROM vtiger_activity\n\t\t\tINNER JOIN vtiger_seactivityrel\n\t\t\t\tON vtiger_seactivityrel.activityid = vtiger_activity.activityid\n\t\t\tINNER JOIN vtiger_crmentity\n\t\t\t\tON vtiger_crmentity.crmid=vtiger_activity.activityid\n\t\t\tLEFT JOIN vtiger_cntactivityrel\n\t\t\t\tON vtiger_cntactivityrel.activityid = vtiger_activity.activityid\n\t\t\tLEFT JOIN vtiger_contactdetails\n\t\t\t\tON vtiger_contactdetails.contactid = vtiger_cntactivityrel.contactid\n\t\t\tLEFT JOIN vtiger_users\n\t\t\t\tON vtiger_users.id = vtiger_crmentity.smownerid\n\t\t\tLEFT OUTER JOIN vtiger_recurringevents\n\t\t\t\tON vtiger_recurringevents.activityid = vtiger_activity.activityid\n\t\t\tLEFT JOIN vtiger_groups\n\t\t\t\tON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\tWHERE vtiger_seactivityrel.crmid=" . $id . "\n\t\t\tAND vtiger_crmentity.deleted = 0\n\t\t\tAND (activitytype = 'Task'\n\t\t\t\tOR activitytype !='Emails')";
     $return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
     if ($return_value == null) {
         $return_value = array();
     }
     $return_value['CUSTOM_BUTTON'] = $button;
     $log->debug("Exiting get_activities method ...");
     return $return_value;
 }
开发者ID:kikojover,项目名称:corebos,代码行数:46,代码来源:Campaigns.php


示例9: array

    $ITS4YouReports->getSecModuleColumnsList($secondarymodule);
    $available_modules[] = array("id" => $ITS4YouReports->primarymoduleid, "name" => $modulename_lbl, "checked" => "checked");
    foreach ($secondarymodule_arr as $key => $value) {
        $available_modules[] = array("id" => $value["id"], "name" => $value["name"], "checked" => "");
    }
    $AV_M = Zend_JSON::encode($available_modules);
    $step5_result .= $AV_M . "(!A#V_M@M_M#A!)";
}
/*$SumOptions2 = getSecondaryColumns($SumOptions2,$secondarymodule,$ITS4YouReports);
foreach ($SumOptions2 as $key=>$value) {
	$SPSumOptions[$key]=$value;
}*/
$BLOCK1 = "";
foreach ($SPSumOptions as $module_key => $SumOptions) {
    $BLOCK2 = "";
    $r_modulename = vtlib_getModuleNameById($module_key);
    $r_modulename_lbl = getTranslatedString($r_modulename, $r_modulename);
    foreach ($SumOptions as $SumOptions_key => $SumOptions_value) {
        foreach ($SumOptions_value as $optgroup => $optionsdata) {
            if ($BLOCK2 != "") {
                $BLOCK2 .= "(|@!@|)";
            }
            $BLOCK2 .= $optgroup;
            $BLOCK2 .= "(|@|)";
            $BLOCK2 .= Zend_JSON::encode($optionsdata);
        }
        $BLOCK1 .= $module_key . "(!#_ID@ID_#!)" . $r_modulename_lbl . "(!#_ID@ID_#!)" . $BLOCK2;
    }
}
$step5_result .= $BLOCK1;
echo $step5_result;
开发者ID:cin-system,项目名称:cinrepo,代码行数:31,代码来源:getStep5SUMColumns.php


示例10: get_dependents_list

 /**
  * Default (generic) function to handle the dependents list for the module.
  * NOTE: UI type '10' is used to stored the references to other modules for a given record.
  * These dependent records can be retrieved through this function.
  * For eg: A trouble ticket can be related to an Account or a Contact.
  * From a given Contact/Account if we need to fetch all such dependent trouble tickets, get_dependents_list function can be used.
  */
 function get_dependents_list($id, $cur_tab_id, $relTabId, $actions = false)
 {
     $app_strings = vglobal('app_strings');
     $current_user = vglobal('current_user');
     $singlepane_view = vglobal('singlepane_view');
     $currentModule = vtlib_getModuleNameById($cur_tab_id);
     $relatedModule = vtlib_getModuleNameById($relTabId);
     $other = CRMEntity::getInstance($relatedModule);
     // Some standard module class doesn't have required variables
     // that are used in the query, they are defined in this generic API
     vtlib_setup_modulevars($currentModule, $this);
     vtlib_setup_modulevars($relatedModule, $other);
     $singular_modname = 'SINGLE_' . $relatedModule;
     $button = '';
     $row = [];
     // To make the edit or del link actions to return back to same view.
     if ($singlepane_view == 'true') {
         $returnset = "&return_module={$currentModule}&return_action=DetailView&return_id={$id}";
     } else {
         $returnset = "&return_module={$currentModule}&return_action=CallRelatedList&return_id={$id}";
     }
     $return_value = null;
     $dependentFieldSql = $this->db->pquery('SELECT tabid, fieldname, columnname FROM vtiger_field WHERE uitype = 10 AND' . ' fieldid IN (SELECT fieldid FROM vtiger_fieldmodulerel WHERE relmodule=? AND module=?)', [$currentModule, $relatedModule]);
     if ($dependentFieldSql->rowCount()) {
         $row = $this->db->getRow($dependentFieldSql);
     } else {
         $depProcessFieldSql = $this->db->pquery('SELECT fieldname AS `name`, fieldid AS id, fieldlabel AS label, columnname AS `column`, tablename AS `table`, vtiger_field.*  FROM vtiger_field WHERE `uitype` IN (66,67,68) AND `tabid` = ?;', [$relTabId]);
         while ($rowProc = $this->db->getRow($depProcessFieldSql)) {
             $className = Vtiger_Loader::getComponentClassName('Model', 'Field', $relatedModule);
             $fieldModel = new $className();
             foreach ($rowProc as $properName => $propertyValue) {
                 $fieldModel->{$properName} = $propertyValue;
             }
             $moduleList = $fieldModel->getUITypeModel()->getReferenceList();
             if (in_array($currentModule, $moduleList)) {
                 $row = $rowProc;
                 break;
             }
         }
     }
     if (!empty($row)) {
         $dependentColumn = $row['columnname'];
         $dependentField = $row['fieldname'];
         $button .= '<input type="hidden" name="' . $dependentColumn . '" id="' . $dependentColumn . '" value="' . $id . '">';
         $button .= '<input type="hidden" name="' . $dependentColumn . '_type" id="' . $dependentColumn . '_type" value="' . $currentModule . '">';
         if ($actions) {
             if (is_string($actions)) {
                 $actions = explode(',', strtoupper($actions));
             }
             if (in_array('ADD', $actions) && isPermitted($relatedModule, 1, '') == 'yes' && getFieldVisibilityPermission($relatedModule, $current_user->id, $dependentField, 'readwrite') == '0') {
                 $button .= "<input title='" . getTranslatedString('LBL_ADD_NEW') . " " . getTranslatedString($singular_modname, $relatedModule) . "' class='crmbutton small create'" . " onclick='this.form.action.value=\"EditView\";this.form.module.value=\"{$relatedModule}\"' type='submit' name='button'" . " value='" . getTranslatedString('LBL_ADD_NEW') . " " . getTranslatedString($singular_modname, $relatedModule) . "'>&nbsp;";
             }
         }
         $query = "SELECT vtiger_crmentity.*, {$other->table_name}.*";
         $userNameSql = getSqlForNameInDisplayFormat(array('first_name' => 'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');
         $query .= ", CASE WHEN (vtiger_users.user_name NOT LIKE '') THEN {$userNameSql} ELSE vtiger_groups.groupname END AS user_name";
         $more_relation = '';
         if (!empty($other->related_tables)) {
             foreach ($other->related_tables as $tname => $relmap) {
                 $query .= ", {$tname}.*";
                 // Setup the default JOIN conditions if not specified
                 if (empty($relmap[1])) {
                     $relmap[1] = $other->table_name;
                 }
                 if (empty($relmap[2])) {
                     $relmap[2] = $relmap[0];
                 }
                 $more_relation .= " LEFT JOIN {$tname} ON {$tname}.{$relmap['0']} = {$relmap['1']}.{$relmap['2']}";
             }
         }
         $query .= " FROM {$other->table_name}";
         $query .= " INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = {$other->table_name}.{$other->table_index}";
         $query .= " INNER  JOIN {$this->table_name}   ON {$this->table_name}.{$this->table_index} = {$other->table_name}.{$dependentColumn}";
         $query .= $more_relation;
         $query .= " LEFT  JOIN vtiger_users        ON vtiger_users.id = vtiger_crmentity.smownerid";
         $query .= " LEFT  JOIN vtiger_groups       ON vtiger_groups.groupid = vtiger_crmentity.smownerid";
         $query .= " WHERE vtiger_crmentity.deleted = 0 AND {$this->table_name}.{$this->table_index} = {$id}";
         $return_value = GetRelatedList($currentModule, $relatedModule, $other, $query, $button, $returnset);
     }
     if ($return_value == null) {
         $return_value = array();
     }
     $return_value['CUSTOM_BUTTON'] = $button;
     return $return_value;
 }
开发者ID:HoererUndFlamme,项目名称:YetiForceCRM,代码行数:92,代码来源:CRMEntity.php


示例11: getColumns

 function getColumns(Vtiger_Request $request, $is_sum = false)
 {
     $BLOCK0 = $BLOCK1 = $BLOCK2 = "";
     $selectedmodule = $request->get("selectedmodule");
     $SumOptions = array();
     $secondarymodule = '';
     $secondarymodules = array();
     $record = $request->get('record');
     $reportModel = ITS4YouReports_Record_Model::getCleanInstance($record);
     $primarymodule = $reportModel->getPrimaryModule();
     $primarymoduleid = $reportModel->getPrimaryModuleId();
     $modulename_prefix = "";
     if ($selectedmodule != $primarymoduleid && $selectedmodule != "") {
         $modulename = $selectedmodule;
         $reportModel->getSecModuleColumnsList($modulename);
         $module_array["id"] = $modulename;
         $modulename_arr = explode("x", $modulename);
         $modulename_id = $modulename_arr[0];
         if ($modulename_arr[1] != "") {
             $modulename_prefix = $modulename_arr[1];
         }
     } else {
         $module_array["module"] = $primarymodule;
         $module_array["id"] = $primarymoduleid;
         $modulename = $module_array["module"];
         $modulename_lbl = vtranslate($modulename, $modulename);
         $availModules[$module_array["id"]] = $modulename_lbl;
         $modulename_id = $module_array["id"];
     }
     $relmod_arr = explode("x", $modulename);
     if (is_numeric($relmod_arr[0])) {
         $stabid = $relmod_arr[0];
         $smodule = vtlib_getModuleNameById($stabid);
     }
     if ($is_sum) {
         $SPSumOptions[$module_array["id"]][$modulename_id] = sgetSummariesOptions($modulename);
     } else {
         if ($selectedmodule != $primarymoduleid && $selectedmodule != "") {
             $SPSumOptions[$modulename] = $reportModel->getSecondaryColumns(array(), $modulename);
         } else {
             $SPSumOptions[$module_array["id"]][$modulename_id] = $reportModel->getPrimaryColumns(array(), $modulename, true);
         }
     }
     $step5_result = "";
     if ($selectedmodule != $primarymoduleid && $selectedmodule == "") {
         $secondarymodule_arr = $reportModel->getReportRelatedModules($module_array["id"]);
         $reportModel->getSecModuleColumnsList($secondarymodule);
         $available_modules[] = array("id" => $primarymoduleid, "name" => $modulename_lbl, "checked" => "checked");
         foreach ($secondarymodule_arr as $key => $value) {
             $available_modules[] = array("id" => $value["id"], "name" => $value["name"], "checked" => "");
         }
         $AV_M = Zend_JSON::encode($available_modules);
         $step5_result .= $AV_M . "(!A#V_M@M_M#A!)";
     }
     $BLOCK1 = "";
     foreach ($SPSumOptions as $module_key => $SumOptions) {
         $BLOCK2 = "";
         $r_modulename = vtlib_getModuleNameById($module_key);
         $r_modulename_lbl = vtranslate($r_modulename, $r_modulename);
         foreach ($SumOptions as $SumOptions_key => $SumOptions_value) {
             foreach ($SumOptions_value as $optgroup => $optionsdata) {
                 if ($BLOCK2 != "") {
                     $BLOCK2 .= "(|@!@|)";
                 }
                 $BLOCK2 .= $optgroup;
                 $BLOCK2 .= "(|@|)";
                 $BLOCK2 .= Zend_JSON::encode($optionsdata);
             }
             $BLOCK1 .= $module_key . "(!#_ID@ID_#!)" . $r_modulename_lbl . "(!#_ID@ID_#!)" . $BLOCK2;
         }
     }
     $step5_result .= $BLOCK1;
     echo $step5_result;
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:74,代码来源:IndexAjax.php


示例12: get_ventas_list

    function get_ventas_list($id, $cur_tab_id, $rel_tab_id, $actions = false)
    {
        global $adb;
        $this_module = $currentModule;
        $related_module = vtlib_getModuleNameById($rel_tab_id);
        require_once "modules/{$related_module}/{$related_module}.php";
        $other = new $related_module();
        vtlib_setup_modulevars($related_module, $other);
        $singular_modname = vtlib_toSingular($related_module);
        $parenttab = getParentTab();
        if ($singlepane_view == 'true') {
            $returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
        } else {
            $returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
        }
        $button = '';
        $button .= '<input type="hidden" name="email_directing_module"><input type="hidden" name="record">';
        $sql = "SELECT registrodeventasid FROM vtiger_registrodepagos WHERE registrodepagosid = ?";
        $result = $adb->pquery($sql, array($id));
        $row = $adb->fetchByAssoc($result);
        $ventaid = $row["registrodeventasid"];
        $query = 'SELECT vtiger_crmentity.crmid,vtiger_registrodeventas.contacto, vtiger_registrodeventas.registrodeventastype, vtiger_crmentity.smownerid, vtiger_registrodeventas.registrodeventasname FROM vtiger_registrodeventas INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_registrodeventas.registrodeventasid INNER JOIN vtiger_crmentityrel ON (vtiger_crmentityrel.relcrmid = vtiger_crmentity.crmid OR vtiger_crmentityrel.crmid = vtiger_crmentity.crmid) LEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid  WHERE vtiger_crmentity.deleted = 0 AND (vtiger_crmentityrel.crmid = ' . $ventaid . ' OR vtiger_crmentityrel.relcrmid = ' . $ventaid . ')  
';
        //var_dump($query); exit;
        $return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
        return $return_value;
    }
开发者ID:jmangarret,项目名称:vtigercrm,代码行数:27,代码来源:RegistroDePagos.php


示例13: getSelectedValuesToSmarty

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP vtlib_getModuleTemplate函数代码示例发布时间:2022-05-23
下一篇:
PHP vtiger_imageurl函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap