* modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('faq');
class htmlFaqanswers
{
    function DisplayForm($obj = '')
    {
        global $dcl_info, $g_oSec;
        $isEdit = is_object($obj);
        if (!$g_oSec->HasPerm(DCL_ENTITY_FAQANSWER, $isEdit ? DCL_PERM_MODIFY : DCL_PERM_ADD)) {
            return PrintPermissionDenied();
        }
        $t =& CreateSmarty();
        $t->assign('IS_EDIT', $isEdit);
        if ($isEdit) {
            $t->assign('VAL_ANSWERTEXT', $obj->answertext);
            $t->assign('VAL_ANSWERID', $obj->answerid);
            $t->assign('VAL_QUESTIONID', $obj->questionid);
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('sev');
class htmlSeverities
{
    function GetCombo($default = 0, $cbName = 'severity', $longShort = 'name', $size = 0, $activeOnly = true, $setid = 0)
    {
        $query = "SELECT a.id,a.{$longShort} FROM severities a";
        if ($setid > 0) {
            $query .= ",attributesetsmap b WHERE a.id=b.keyid AND b.typeid=3 AND b.setid={$setid}";
            if ($activeOnly) {
                $query .= ' AND a.active=\'Y\'';
            }
            $query .= ' ORDER BY b.weight';
        } else {
            if ($activeOnly) {
                $query .= ' WHERE a.active=\'Y\'';
            }
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('attr');
class htmlAttributesetdetail
{
    function Show($obj)
    {
        global $dcl_info, $g_oSec;
        if (!$g_oSec->HasPerm(DCL_ENTITY_ATTRIBUTESETS, DCL_PERM_VIEW)) {
            return PrintPermissionDenied();
        }
        if (!is_object($obj)) {
            trigger_error('[htmlAttributesets::Show] ' . STR_ATTR_OBJECTNOTPASSED);
            return;
        }
        $t = CreateSmarty();
        $t->assign('VAL_ATTRIBUTESETNAME', $obj->name);
        SmartyDisplay($t, 'htmlAttributesetdetail.tpl');
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('prj');
LoadStringResource('wo');
class htmlProjectsform
{
    function Show($obj = '')
    {
        global $dcl_info, $g_oSec;
        $isEdit = is_object($obj);
        if (!$g_oSec->HasPerm(DCL_ENTITY_PROJECT, $isEdit ? DCL_PERM_MODIFY : DCL_PERM_ADD)) {
            return PrintPermissionDenied();
        }
        $t = CreateSmarty();
        $objPrj = CreateObject('dcl.htmlProjects');
        $objHTMLPersonnel = CreateObject('dcl.htmlPersonnel');
        $oStatus = CreateObject('dcl.htmlStatuses');
        if ($isEdit) {
            $t->assign('VAL_PROJECTID', $obj->projectid);
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('vw');
class htmlView
{
    var $sColumnTitle;
    var $bColumnSort;
    var $bShowPager;
    var $sPagingMenuAction;
    var $Template;
    var $oDB;
    var $bNeedsHeader;
    var $oView;
    var $aGroups;
    var $aSumCols;
    function htmlView()
    {
        $this->oDB = CreateObject('dcl.dbWorkorders');
function commonHeader($formValidateSrc = '', $onLoad = '')
{
    if (defined('HTML_HEADER_GENERATED')) {
        return;
    }
    header('Content-Type: text/html; charset=iso-8859-1');
    header('Expires: Fri, 11 Oct 1991 17:01:00 GMT');
    header('Cache-Control: no-cache, must-revalidate');
    global $phpgw, $dcl_info, $dcl_domain, $dcl_domain_info;
    define('HTML_HEADER_GENERATED', 1);
    $bHideMenu = isset($_REQUEST['hideMenu']) && $_REQUEST['hideMenu'] == 'true';
    $title = '[' . $dcl_domain_info[$dcl_domain]['name'] . ' / ' . $GLOBALS['DCLNAME'] . ']';
    if ($dcl_info['DCL_HTML_TITLE'] != '') {
        $title .= ' - ' . $dcl_info['DCL_HTML_TITLE'];
    }
    if (!$bHideMenu) {
        LoadStringResource('menu');
        buildMenuArray();
    }
    $t =& CreateSmarty();
    $t->assign('VAL_TITLE', $title);
    SmartyDisplay($t, 'index.tpl');
    $sTemplateSet = GetDefaultTemplateSet();
    if (!$bHideMenu && file_exists(DCL_ROOT . 'templates/' . $sTemplateSet . '/menu.php')) {
        include DCL_ROOT . 'templates/' . $sTemplateSet . '/menu.php';
        renderDCLMenu();
    }
}
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 *
 * License Note:
 *
 * format_html contains some code from WIKIPLAM.  The original WIKIPLAM source is covered
 * by the Free Art License (http://artlibre.org/licence.php/lalgb.html)
 */
LoadStringResource('wiki');
class htmlWiki
{
    var $t;
    var $aLockedPages;
    function htmlWiki()
    {
        $this->t = CreateTemplate(array('hForm' => 'htmlWiki.tpl'));
        $this->t->set_block('hForm', 'display', 'hDisplay');
        $this->t->set_block('hForm', 'edit', 'hEdit');
        $this->t->set_block('hForm', 'editlink', 'hEditlink');
        $this->t->set_block('hForm', 'noedit', 'hNoedit');
        $this->t->set_block('hForm', 'wiki', 'hWiki');
        $this->t->set_var('hDisplay', '');
        $this->t->set_var('hEdit', '');
        $this->t->set_var('hEditlink', '');
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('wo');
LoadStringResource('tck');
LoadStringResource('menu');
// If we're framed, this isn't loaded every time
class htmlAgg
{
    var $group;
    var $sub;
    var $_aTypeInfo;
    function htmlAgg()
    {
        $this->group = isset($_REQUEST['group']) ? $_REQUEST['group'] : '';
        $this->sub = isset($_REQUEST['sub']) ? $_REQUEST['sub'] : '';
        $this->_aTypeInfo = array('workorders' => array('__title__' => DCL_MENU_WORKORDERS, 'account' => array('dcl_wo_account', 'Organizations', 'a.account_id', 'ac.name', 'ac.org_id', ''), 'assigned' => array('personnel', STR_WO_RESPONSIBLE, 'w.responsible', 'a.short', 'a.id', ''), 'reportto' => array('personnel', 'My Minions', 'w.responsible', 'a.short', 'a.id', 'a.reportto = ' . $GLOBALS['DCLID']), 'product' => array('products', STR_WO_PRODUCT, 'w.product', 'a.name', 'a.id', ''), 'priority' => array('priorities', STR_WO_PRIORITY, 'w.priority', 'a.name', 'a.id', ''), 'severity' => array('severities', STR_WO_SEVERITY, 'w.severity', 'a.name', 'a.id', ''), 'wo_type_id' => array('dcl_wo_type', STR_WO_TYPE, 'w.wo_type_id', 'a.type_name', 'a.wo_type_id', '')), 'tickets' => array('__title__' => DCL_MENU_TICKETS, 'account' => array('dcl_org', 'Organizations', 'w.account', 'a.name', 'a.org_id', ''), 'assigned' => array('personnel', STR_TCK_RESPONSIBLE, 'w.responsible', 'a.short', 'a.id', ''), 'reportto' => array('personnel', 'My Minions', 'w.responsible', 'a.short', 'a.id', 'a.reportto = ' . $GLOBALS['DCLID']), 'product' => array('products', STR_TCK_PRODUCT, 'w.product', 'a.name', 'a.id', ''), 'priority' => array('priorities', STR_TCK_PRIORITY, 'w.priority', 'a.name', 'a.id', ''), 'severity' => array('severities', STR_TCK_TYPE, 'w.severity', 'a.name', 'a.id', '')));
    }
    function GetBox()
    {
    }
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('bm');
class htmlBuildManagerVersionView
{
    var $productid;
    function htmlBuildManagerVersionView()
    {
        $this->productid = 0;
    }
    function Render($oView)
    {
        global $dcl_info, $g_oSec, $g_oSession;
        commonHeader();
        if (!$g_oSec->HasPerm(DCL_ENTITY_BUILDMANAGER, DCL_PERM_VIEW)) {
            return PrintPermissionDenied();
        }
        $oDB = CreateObject('dcl.dbBuildManager');
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('wost');
class scheduleByPerson
{
    function SetNextWorkDay(&$thisDate)
    {
        $oneDay = 86400;
        $thisDate += $oneDay;
        while (date('w', $thisDate) == 0 || date('w', $thisDate) == 6) {
            $thisDate += $oneDay;
        }
    }
    function ScheduleTask(&$startDate, &$endDate, $etcHours, $hoursInDay, &$hoursLeftInDay)
    {
        if ($hoursLeftInDay <= 0) {
            $this->SetNextWorkDay($startDate);
            $hoursLeftInDay = $hoursInDay;
示例#11
0
     if (strlen($dcl_session_id) != 32) {
         Refresh(DCL_WWW_ROOT . 'logout.php?cd=2');
     }
     if (!$g_oSession->conn) {
         Refresh(DCL_WWW_ROOT . 'logout.php?cd=3');
     }
     if ($g_oSession->Load($dcl_session_id) == false) {
         Refresh(DCL_WWW_ROOT . 'logout.php?cd=2');
     }
     if (!$g_oSession->conn) {
         Refresh(DCL_WWW_ROOT . 'logout.php?cd=3');
     }
     if (!$g_oSession->IsValidSession()) {
         Refresh(DCL_WWW_ROOT . 'logout.php?cd=2');
     }
     LoadStringResource('cmmn');
 } else {
     $obj = GetAuthenticator();
     $aAuthInfo = array();
     if ($obj->IsValidLogin($aAuthInfo)) {
         $oConfig = CreateObject('dcl.dbConfig');
         $dcl_info = array();
         $oConfig->Load();
         $g_oSession = CreateObject('dcl.dbSession');
         if (!$g_oSession->conn) {
             Refresh('logout.php?cd=3');
         }
         $g_oSession->personnel_id = $aAuthInfo['id'];
         $g_oSession->Add();
         $oPreferences = CreateObject('dcl.dbPreferences');
         $oPreferences->Load($aAuthInfo['id']);
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('bm');
LoadStringResource('prod');
class htmlBuildManagerReleaseForm
{
    var $oSmarty;
    var $eState;
    function htmlBuildManagerReleaseForm()
    {
        $this->oSmarty =& CreateSmarty();
        $this->eState = DCL_FORM_ADD;
    }
    function Show()
    {
        global $dcl_info, $g_oSec;
        commonHeader();
        if (!$g_oSec->HasPerm(DCL_ENTITY_BUILDMANAGER, DCL_PERM_MODIFY)) {
            return PrintPermissionDenied();
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('actn');
class htmlActions
{
    function GetCombo($default = 0, $cbName = 'action', $longShort = 'name', $size = 0, $activeOnly = true, $setid = 0)
    {
        $query = "SELECT a.id,a.{$longShort} FROM actions a ";
        if ($setid > 0) {
            $query .= ",attributesetsmap b WHERE a.id=b.keyid AND b.typeid=1 AND b.setid={$setid} ";
            if ($activeOnly) {
                $query .= ' AND a.active=\'Y\' ';
            }
        } else {
            if ($activeOnly) {
                $query .= 'WHERE a.active=\'Y\' ';
            }
        }
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('ver');
class htmlVersion
{
    function displayversioninfo()
    {
        global $dcl_info;
        if (!empty($_SERVER)) {
            extract($_SERVER);
        }
        commonHeader();
        $Template = CreateTemplate(array('hForm' => 'htmlVersion.tpl'));
        $Template->set_var('TXT_TITLE', STR_VER_TITLE);
        $Template->set_var('TXT_YOURVER', STR_VER_YOURVER);
        $Template->set_var('TXT_DCL', STR_VER_DCL);
        $Template->set_var('TXT_SERVEROS', STR_VER_SERVEROS);
        $Template->set_var('TXT_SERVERNAME', STR_VER_SERVERNAME);
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('prio');
class htmlPriorities
{
    function GetCombo($default = 0, $cbName = 'priority', $longShort = 'name', $size = 0, $activeOnly = true, $setid = 0)
    {
        $query = "SELECT a.id,a.{$longShort} FROM priorities a";
        if ($setid > 0) {
            $query .= ",attributesetsmap b WHERE a.id=b.keyid AND b.typeid=2 AND b.setid={$setid}";
            if ($activeOnly) {
                $query .= ' AND a.active=\'Y\'';
            }
            $query .= ' ORDER BY b.weight';
        } else {
            if ($activeOnly) {
                $query .= ' WHERE a.active=\'Y\'';
            }
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('usr');
class htmlPersonnelBrowse
{
    var $oSmarty;
    var $oView;
    var $oDB;
    function htmlPersonnelBrowse()
    {
        $this->oSmarty =& CreateSmarty();
        $this->oView =& CreateObject('dcl.boView');
        $this->oDB = new dclDB();
    }
    function show()
    {
        global $dcl_info, $g_oSec;
        commonHeader();
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('lkp');
class htmlLookup
{
    var $id;
    var $active;
    var $name;
    var $mode;
    function htmlLookup()
    {
        $this->id = 0;
        $this->active = 'Y';
        $this->name = '';
        $this->mode = DCL_MODE_ADD;
    }
    function Show($obj = '')
    {
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('vw');
LoadStringResource('prj');
class htmlProjectsBrowse
{
    var $sPagingMenuAction;
    var $oView;
    var $oDB;
    function htmlProjectsBrowse()
    {
        $this->sPagingMenuAction = 'htmlProjectsBrowse.Page';
        $this->oView = null;
        $this->oDB = CreateObject('dcl.dbProjects');
    }
    function Render(&$oView)
    {
        global $dcl_info, $g_oSec;
        if (!is_object($oView)) {
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('admin');
class htmlOrgType
{
    var $public;
    function htmlOrgType()
    {
        $this->public = array('add', 'modify', 'delete', 'submitAdd', 'submitModify', 'submitDelete', 'ShowAll');
    }
    function GetCombo($default = 0, $cbName = 'org_type_id', $size = 0, $activeOnly = true)
    {
        $filter = '';
        $table = 'dcl_org_type';
        $order = 'org_type_name';
        $obj = CreateObject('dcl.htmlSelect');
        $obj->SetOptionsFromDb($table, 'org_type_id', 'org_type_name', $filter, $order);
        $obj->vDefault = $default;
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('wo');
LoadStringResource('cfg');
class htmlEmailType
{
    var $public;
    function htmlEmailType()
    {
        $this->public = array('add', 'modify', 'delete', 'submitAdd', 'submitModify', 'submitDelete', 'PrintAll');
    }
    function GetCombo($default = 0, $cbName = 'email_type_id', $size = 0, $activeOnly = true)
    {
        $filter = '';
        $table = 'dcl_email_type';
        $order = 'email_type_name';
        $obj = CreateObject('dcl.htmlSelect');
        $obj->SetOptionsFromDb($table, 'email_type_id', 'email_type_name', $filter, $order);
        $obj->vDefault = $default;
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('wtch');
class htmlWatches
{
    var $objW;
    var $objT;
    var $oMeta;
    function htmlWatches()
    {
        $this->oMeta =& CreateObject('dcl.DCL_MetadataDisplay');
        $this->objW = CreateObject('dcl.dbWorkorders');
        $this->objT = CreateObject('dcl.dbTickets');
    }
    function GetCombo($default = 1, $id = 'actions')
    {
        $obj = CreateObject('dcl.dbWatches');
        $retVal = "<select id=\"{$id}\" name=\"{$id}\">";
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('chk');
import('htmlView');
class htmlChecklistTplView extends htmlView
{
    function htmlChecklistTplView()
    {
        parent::htmlView();
        $this->sColumnTitle = STR_CMMN_OPTIONS;
        $this->sSortAction = 'htmlChecklistTplView.execurl';
    }
    function _SetActionFormOptions()
    {
        global $g_oSec;
        $aLinks = array();
        if ($g_oSec->HasPerm(DCL_ENTITY_FORMS, DCL_PERM_VIEW)) {
            $aLinks[STR_CMMN_BROWSE] = menuLink('', 'menuAction=boChecklists.show');
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('dept');
class htmlDepartments
{
    function GetCombo($default = 0, $cbName = 'department', $longShort = 'name', $size = 0, $activeOnly = true, $bHidden = false)
    {
        $query = "SELECT id,{$longShort} FROM departments ";
        if ($activeOnly) {
            $query .= 'WHERE active=\'Y\' ';
        }
        $query .= "ORDER BY {$longShort}";
        $oSelect = CreateObject('dcl.htmlSelect');
        $oSelect->vDefault = $default;
        $oSelect->sName = $cbName;
        $oSelect->iSize = $size;
        $oSelect->sZeroOption = STR_CMMN_SELECTONE;
        $oSelect->bHidden = $bHidden;
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('vw');
LoadStringResource('tck');
class htmlTicketBrowse
{
    var $sPagingMenuAction;
    var $oView;
    var $oDB;
    function htmlTicketBrowse()
    {
        $this->sPagingMenuAction = 'htmlTicketBrowse.Page';
        $this->oView = null;
        $this->oDB = CreateObject('dcl.dbTickets');
    }
    function Render(&$oView)
    {
        global $dcl_info, $g_oSec;
        if (!is_object($oView)) {
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('stat');
class htmlStatuses
{
    function GetCombo($default = 0, $cbName = 'status', $longShort = 'name', $size = 0, $activeOnly = true, $setid = 0)
    {
        $query = "SELECT a.id,a.{$longShort} FROM statuses a ";
        if ($setid > 0) {
            $query .= ",attributesetsmap b WHERE a.id=b.keyid AND b.typeid=4 AND b.setid={$setid} ";
            if ($activeOnly) {
                $query .= ' AND a.active=\'Y\' ';
            }
        } else {
            if ($activeOnly) {
                $query .= 'WHERE a.active=\'Y\' ';
            }
        }
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('db');
class dbContactType extends dclDB
{
    function dbContactType()
    {
        parent::dclDB();
        $this->TableName = 'dcl_contact_type';
        LoadSchema($this->TableName);
        parent::Clear();
    }
    function ListByContact($contact_id)
    {
        if (($contact_id = DCL_Sanitize::ToInt($contact_id)) === null) {
            trigger_error('Data sanitize failed.');
            return -1;
        }
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('pm');
class htmlProjectmap
{
    function _display($jcn, $seq, $menuAction, $sFunction)
    {
        global $dcl_info, $g_oSec;
        if (!$g_oSec->HasPerm(DCL_ENTITY_PROJECT, DCL_PERM_ADDTASK)) {
            return PrintPermissionDenied();
        }
        $objProject = CreateObject('dcl.htmlProjects');
        $t =& CreateSmarty();
        $t->assign('TXT_FUNCTION', $sFunction);
        $t->assign('menuAction', $menuAction);
        $t->assign('CMB_PROJECT', $objProject->GetCombo(0, 'projectid', 0, 0, -1, true));
        $t->assign('jcn', $jcn);
        $t->assign('seq', $seq);
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Double Choco Latte is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('bo');
import('boAdminObject');
class boOrgContact extends boAdminObject
{
    function boOrgContact()
    {
        parent::boAdminObject();
        $this->oDB =& CreateObject('dcl.dbOrgContact');
        $this->Entity = DCL_ENTITY_ORG;
        $this->sKeyField = '';
        $this->sCreatedDateField = 'created_on';
        $this->sCreatedByField = 'created_by';
    }
    function add($aSource)
    {
        global $g_oSec;
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Select License Info from the Help menu to view the terms and conditions of this license.
 */
LoadStringResource('sec');
class boSecAudit
{
    var $objDB;
    function boSecAudit()
    {
    }
    function Show($needHdr = true)
    {
        global $g_oSec;
        if ($needHdr == true) {
            commonHeader();
        }
        if (!$g_oSec->HasPerm(DCL_ENTITY_ADMIN, DCL_PERM_MODIFY)) {
            return PrintPermissionDenied();
        }