当前位置: 首页>>代码示例>>PHP>>正文


PHP astercrm::getGroups方法代码示例

本文整理汇总了PHP中astercrm::getGroups方法的典型用法代码示例。如果您正苦于以下问题:PHP astercrm::getGroups方法的具体用法?PHP astercrm::getGroups怎么用?PHP astercrm::getGroups使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在astercrm的用法示例。


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

示例1: init

/**
*  function to init import page
*
*
*  @return $objResponse
*
*/
function init($fileName)
{
    global $locate, $config;
    $objResponse = new xajaxResponse();
    $file_list = getExistfilelist();
    $objResponse->addAssign('filelist', 'innerHTML', '');
    $objResponse->addScript("addOption('filelist','0','" . $locate->Translate('select a existent file') . "');");
    foreach ($file_list as $file) {
        $objResponse->addScript("addOption('filelist','" . $file['fileid'] . "','" . $file['originalname'] . "');");
    }
    $tableList = "<select name='sltTable' id='sltTable' onchange='selectTable(this.value);' >\n\t\t\t\t\t\t\t\t\t\t\t<option value=''>" . $locate->Translate("selecttable") . "</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value='customer'>customer</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value='contact'>contact</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value='diallist'>diallist</option>\n\t\t\t\t\t\t\t\t\t\t</select>";
    $objResponse->addAssign("divTables", "innerHTML", $tableList);
    $objResponse->addAssign("divNav", "innerHTML", common::generateManageNav($skin, $_SESSION['curuser']['country'], $_SESSION['curuser']['language']));
    $objResponse->addAssign("divGrid", "innerHTML", '');
    //$objResponse->addScript("xajax_showDivMainRight(document.getElementById('hidFileName').value);");
    //$objResponse->loadXML(showDivMainRight($fileName));
    //$objResponse->addAssign("divDiallistImport", "innerHTML", '');
    $objResponse->addAssign("divCopyright", "innerHTML", common::generateCopyright($skin));
    if ($_SESSION['curuser']['usertype'] == 'admin') {
        // add all group
        $res = astercrm::getGroups();
        while ($row = $res->fetchRow()) {
            $objResponse->addScript("addOption('groupid','" . $row['groupid'] . "','" . $row['groupname'] . "');");
        }
    } else {
        // add self
        $objResponse->addScript("addOption('groupid','" . $_SESSION['curuser']['groupid'] . "','" . $_SESSION['curuser']['group']['groupname'] . "');");
    }
    $objResponse->addScript("setCampaign();");
    $objResponse->loadXML(showDivMainRight($fileName));
    return $objResponse;
}
开发者ID:ljhcj,项目名称:IRISCC,代码行数:39,代码来源:import.server.php

示例2: formEdit

    /**
     *  Imprime la forma para editar un nuevo registro sobre el DIV identificado por "formDiv".
     *
     *	@param $id		(int)		Identificador del registro a ser editado.
     *	@return $html	(string) Devuelve una cadena de caracteres que contiene la forma con los datos 
     *									a extraidos de la base de datos para ser editados 
     */
    function formEdit($id)
    {
        global $locate;
        $remindercalls =& Customer::getRecordByID($id, 'remindercalls');
        $groupoptions = '';
        $group = astercrm::getGroups();
        if ($_SESSION['curuser']['usertype'] == 'admin') {
            $groupoptions .= '<select id="groupid" name="groupid" onchange="setAsteriskcalls();">';
            $groupoptions .= '<option value="0"></option>';
            while ($group->fetchInto($row)) {
                $groupoptions .= '<option value="' . $row['groupid'] . '"';
                if ($row['groupid'] == $remindercalls['groupid']) {
                    $groupoptions .= ' selected ';
                }
                $groupoptions .= '>' . $row['groupname'] . '</option>';
            }
            $groupoptions .= '</select>';
        } else {
            while ($group->fetchInto($row)) {
                if ($row['id'] == $_SESSION['curuser']['groupid']) {
                    $groupoptions .= $row['groupname'] . '<input type="hidden" value="' . $row['id'] . '" name="groupid" id="groupid">';
                    break;
                }
            }
        }
        $asteriskcalls = Customer::getRecordsByGroupid($remindercalls['groupid'], 'asteriskcalls');
        if ($_SESSION['curuser']['usertype'] == 'admin' || $_SESSION['curuser']['usertype'] == 'groupadmin') {
            $asteriskcallsoptions .= '<select id="asteriskcallsid" name="asteriskcallsid">';
            $asteriskcallsoptions .= "<OPTION value='0'></OPTION>";
            while ($asteriskcalls->fetchInto($row)) {
                if ($row['id'] == $remindercalls['asteriskcallsid']) {
                    $asteriskcallsoptions .= "<OPTION value='" . $row['id'] . "' selected>" . $row['asteriskcallsname'] . "</OPTION>";
                } else {
                    $asteriskcallsoptions .= "<OPTION value='" . $row['id'] . "' >" . $row['asteriskcallsname'] . "</OPTION>";
                }
            }
            $asteriskcallsoptions .= '</select>';
        } else {
            while ($group->fetchInto($row)) {
                if ($row['id'] == $remindercalls['asteriskcallsid']) {
                    $asteriskcallsoptions .= $row['asteriskcallsname'] . '<input type="hidden" value="' . $row['id'] . '" name="asteriskcallsid" id="asteriskcallsid">';
                    break;
                }
            }
        }
        $html = '
			<!-- No edit the next line -->
			<form method="post" name="f" id="f">
			
			<table border="1" width="100%" class="adminlist">
				<tr>
					<td nowrap align="left">' . $locate->Translate("Phone number") . ' *</td>
					<td align="left"><input type="text" id="phonenumber" name="phonenumber" size="30" maxlength="50" value="' . $remindercalls['phonenumber'] . '"></td>
				</tr>
				<tr>
					<td nowrap align="left">' . $locate->Translate("Note") . '</td>
					<td align="left"><input type="text" id="note" name="note" size="50" maxlength="255" value="' . $remindercalls['note'] . '"></td>
				</tr>
				<tr>
					<td nowrap align="left">' . $locate->Translate("Group") . '</td>
					<td align="left">' . $groupoptions . '</td>
				</tr>
				<tr>
					<td nowrap align="left">' . $locate->Translate("Call plan") . ' *</td>
					<td align="left">' . $asteriskcallsoptions . '</td>
				</tr>
				<tr>
					<td colspan="2" align="center"><button id="submitButton" onClick=\'xajax_save(xajax.getFormValues("f"));return false;\'>' . $locate->Translate("continue") . '</button></td>
				</tr>

			 </table>
			';
        $html .= '
			</form>
			' . $locate->Translate("obligatory_fields") . '
			';
        return $html;
    }
开发者ID:ljhcj,项目名称:IRISCC,代码行数:85,代码来源:remindercalls.grid.inc.php


注:本文中的astercrm::getGroups方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。