From: <wis...@us...> - 2016-11-20 14:45:46
|
Revision: 13222 http://sourceforge.net/p/xoops/svn/13222 Author: wishcraft Date: 2016-11-20 14:45:43 +0000 (Sun, 20 Nov 2016) Log Message: ----------- please email ticketer a bit more coded\! Modified Paths: -------------- XoopsModules/please/trunk/class/departments.php XoopsModules/please/trunk/class/objects.php XoopsModules/please/trunk/class/tickets.php XoopsModules/please/trunk/include/install.php XoopsModules/please/trunk/include/uninstall.php XoopsModules/please/trunk/language/english/admin.php XoopsModules/please/trunk/language/english/errors.php XoopsModules/please/trunk/language/english/modinfo.php XoopsModules/please/trunk/language/english/release.nfo XoopsModules/please/trunk/templates/admin/index.html XoopsModules/please/trunk/templates/groups.php.tpl Added Paths: ----------- XoopsModules/please/trunk/admin/about.php XoopsModules/please/trunk/admin/add-departments.php XoopsModules/please/trunk/admin/departments.php XoopsModules/please/trunk/admin/edit-departments.php XoopsModules/please/trunk/admin/footer.php XoopsModules/please/trunk/admin/header.php XoopsModules/please/trunk/admin/index.php XoopsModules/please/trunk/admin/menu.php XoopsModules/please/trunk/admin/permissions.php XoopsModules/please/trunk/include/formloader.php XoopsModules/please/trunk/include/formselectenumerator.php XoopsModules/please/trunk/templates/admin/about.html XoopsModules/please/trunk/templates/admin/add-departments.html XoopsModules/please/trunk/templates/admin/departments.html XoopsModules/please/trunk/templates/admin/edit-departments.html Added: XoopsModules/please/trunk/admin/about.php =================================================================== --- XoopsModules/please/trunk/admin/about.php (rev 0) +++ XoopsModules/please/trunk/admin/about.php 2016-11-20 14:45:43 UTC (rev 13222) @@ -0,0 +1,39 @@ +<?php +/** + * Please Email Ticketer of Batch Group & User Emails +* +* You may not change or alter any portion of this comment or credits +* of supporting developers from this source code or any supporting source code +* which is considered copyrighted (c) material of the original comment or credit authors. +* 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. +* +* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ +* @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) +* @author Simon Roberts (wishcraft) <wis...@us...> +* @subpackage language +* @description Email Ticking for Support/Faults/Management of Batch Group & User managed emails tickets +* @version 1.0.5 +* @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.5/Modules/please +* @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.6/Modules/please +* @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/please +* @link http://internetfounder.wordpress.com +*/ + +$GLOBALS['template'] = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . str_replace('.php', '.html', basename(__FILE__)); +include_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php'; +include_once __DIR__ . '/header.php'; +xoops_cp_header(); +$module_info = $module_handler->get($xoopsModule->getVar('mid')); +$aboutAdmin = new ModuleAdmin(); +$GLOBALS['xoopsTpl']->assign('nav', $aboutAdmin->addNavigation(basename(__FILE__))); +$about = $aboutAdmin->renderAbout('ZZZXXX7777888', false); +$replace = '<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> + <input type="hidden" name="cmd" value="_s-xclick"> + <input type="hidden" name="hosted_button_id" value="ZZZXXX7777888"> + <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" style="background-color:transparent;"> + <img alt="" border="0" src="https://www.paypal.com/fr_FR/i/scr/pixel.gif" width="1" height="1"> + </form>'; +$GLOBALS['xoopsTpl']->assign('about', str_replace($replace, _AM_PLEASE_ADMIN_DONATE, $about)); +include_once __DIR__ . '/footer.php'; Added: XoopsModules/please/trunk/admin/add-departments.php =================================================================== --- XoopsModules/please/trunk/admin/add-departments.php (rev 0) +++ XoopsModules/please/trunk/admin/add-departments.php 2016-11-20 14:45:43 UTC (rev 13222) @@ -0,0 +1,32 @@ +<?php +/** + * Please Email Ticketer of Batch Group & User Emails +* +* You may not change or alter any portion of this comment or credits +* of supporting developers from this source code or any supporting source code +* which is considered copyrighted (c) material of the original comment or credit authors. +* 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. +* +* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ +* @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) +* @author Simon Roberts (wishcraft) <wis...@us...> +* @subpackage language +* @description Email Ticking for Support/Faults/Management of Batch Group & User managed emails tickets +* @version 1.0.5 +* @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.5/Modules/please +* @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.6/Modules/please +* @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/please +* @link http://internetfounder.wordpress.com +*/ + +$GLOBALS['template'] = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . str_replace('.php', '.html', basename(__FILE__)); +global $xoopsModule, $xoopsTpl, $thisModuleDir; +include_once __DIR__ . '/header.php'; +xoops_cp_header(); +$indexAdmin = new ModuleAdmin(); +$GLOBALS['xoopsTpl']->assign('nav',$indexAdmin->addNavigation('departments.php')); +$departments_handler = xoops_getModuleHandler('departments', $thisModuleDir); +$GLOBALS['xoopsTpl']->assign('form', $departments_handler->getAddFormAdmin()); +include_once __DIR__ . '/footer.php'; Added: XoopsModules/please/trunk/admin/departments.php =================================================================== --- XoopsModules/please/trunk/admin/departments.php (rev 0) +++ XoopsModules/please/trunk/admin/departments.php 2016-11-20 14:45:43 UTC (rev 13222) @@ -0,0 +1,66 @@ +<?php +/** + * Please Email Ticketer of Batch Group & User Emails +* +* You may not change or alter any portion of this comment or credits +* of supporting developers from this source code or any supporting source code +* which is considered copyrighted (c) material of the original comment or credit authors. +* 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. +* +* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ +* @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) +* @author Simon Roberts (wishcraft) <wis...@us...> +* @subpackage language +* @description Email Ticking for Support/Faults/Management of Batch Group & User managed emails tickets +* @version 1.0.5 +* @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.5/Modules/please +* @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.6/Modules/please +* @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/please +* @link http://internetfounder.wordpress.com +*/ + +$GLOBALS['template'] = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . str_replace('.php', '.html', basename(__FILE__)); +global $xoopsModule, $xoopsTpl, $thisModuleDir; + +include_once __DIR__ . '/header.php'; +xoops_cp_header(); + +$indexAdmin = new ModuleAdmin(); +$indexAdmin->addItemButton(_AM_PLEASE_ADMIN_DEPARTMENTS_ADD, 'add-department.php', 'add', ''); +$GLOBALS['xoopsTpl']->assign('nav',$indexAdmin->addNavigation(basename(__FILE__))); +$GLOBALS['xoopsTpl']->assign('buttons',$indexAdmin->renderButton('right', '')); +$departments_handler = xoops_getModuleHandler('departments', $thisModuleDir); +if (!isset($GLOBALS['sort'])||empty($GLOBALS['sort'])) + $GLOBALS['sort'] = $departments_handler->getDefaultSort('admin'); +$criteria = new Criteria(1, 1); +if (isset($GLOBALS['sort']) && !empty($GLOBALS['sort'])) + $criteria->setSort($GLOBALS['sort']); +if (isset($GLOBALS['order']) && !empty($GLOBALS['order'])) + $criteria->setOrder($GLOBALS['order']); +$pagenav = new XoopsPageNav($ttlitems = $departments_handler->count($criteria), $GLOBALS['limit'], $GLOBALS['start'], 'start', 'limit='.$GLOBALS['limit'].(isset($GLOBALS['op'])&&!empty($GLOBALS['op'])?'&op='.$GLOBALS['op']:"").(isset($GLOBALS['sort'])&&!empty($GLOBALS['sort'])?'&sort='.$GLOBALS['sort']:"").(isset($GLOBALS['order'])&&!empty($GLOBALS['order'])?'&order='.$GLOBALS['order']:"")); +$GLOBALS['xoopsTpl']->assign('pagenav',$pagenav->renderNav(_AM_PLEASE_ADMIN_PAGENAV_OFFSET)); +$criteria->setStart($GLOBALS['start']); +$criteria->setLimit($GLOBALS['limit']); +if ($ttlitems==0) +{ + redirect_header(XOOPS_URL . '/modules/' . $thisModuleDir . '/admin/add-department.php', 4, _ERR_PLEASE_ADMIN_NODEPARTMENTS); + exit(0); +} +if ($departments = $departments_handler->getObjects($criteria, true, false)) +{ + $GLOBALS['xoopsTpl']->assign('tableheaders', $departments_handler->getAdminListFormHeader()); + foreach($departments as $id => $department) + { + $GLOBALS['xoopsTpl']->append('departments', $department->getAdminListFormItems()); + } +} else { + if ($GLOBALS['start']>0 && $GLOBALS['start'] > $GLOBALS['limit']) + $GLOBALS['start'] = $GLOBALS['start'] - $GLOBALS['limit']; + else + $GLOBALS['start'] = 0; + redirect_header(XOOPS_URL . '/modules/' . $thisModuleDir . '/admin/'.basename(__FILE__).'?start='.$GLOBALS['start'].'&limit='.$GLOBALS['limit'].(isset($GLOBALS['op'])&&!empty($GLOBALS['op'])?'&op='.$GLOBALS['op']:"").(isset($GLOBALS['sort'])&&!empty($GLOBALS['sort'])?'&sort='.$GLOBALS['sort']:"").(isset($GLOBALS['order'])&&!empty($GLOBALS['order'])?'&order='.$GLOBALS['order']:""), 4, _ERR_PLEASE_ADMIN_LISTRANGEEXCEEDED); + exit(0); +} +include_once __DIR__ . '/footer.php'; Added: XoopsModules/please/trunk/admin/edit-departments.php =================================================================== --- XoopsModules/please/trunk/admin/edit-departments.php (rev 0) +++ XoopsModules/please/trunk/admin/edit-departments.php 2016-11-20 14:45:43 UTC (rev 13222) @@ -0,0 +1,38 @@ +<?php +/** + * Please Email Ticketer of Batch Group & User Emails +* +* You may not change or alter any portion of this comment or credits +* of supporting developers from this source code or any supporting source code +* which is considered copyrighted (c) material of the original comment or credit authors. +* 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. +* +* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ +* @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) +* @author Simon Roberts (wishcraft) <wis...@us...> +* @subpackage language +* @description Email Ticking for Support/Faults/Management of Batch Group & User managed emails tickets +* @version 1.0.5 +* @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.5/Modules/please +* @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.6/Modules/please +* @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/please +* @link http://internetfounder.wordpress.com +*/ + +$GLOBALS['template'] = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . str_replace('.php', '.html', basename(__FILE__)); +global $xoopsModule, $xoopsTpl, $thisModuleDir; +include_once __DIR__ . '/header.php'; +xoops_cp_header(); +$indexAdmin = new ModuleAdmin(); +$GLOBALS['xoopsTpl']->assign('nav',$indexAdmin->addNavigation('departments.php')); +$departments_handler = xoops_getModuleHandler('departments', $thisModuleDir); +$department = $departments_handler->getMD5($GLOBALS['id']); +if (is_object($department) && !empty($department)) + $GLOBALS['xoopsTpl']->assign('form', $department->getEditFormAdmin()); +else { + redirect_header(XOOPS_URL . '/modules/' . $thisModuleDir . '/admin/departments.php', 4, _ERR_PLEASE_ADMIN_INVALIDHASH); + exit(0); +} +include_once __DIR__ . '/footer.php'; \ No newline at end of file Added: XoopsModules/please/trunk/admin/footer.php =================================================================== --- XoopsModules/please/trunk/admin/footer.php (rev 0) +++ XoopsModules/please/trunk/admin/footer.php 2016-11-20 14:45:43 UTC (rev 13222) @@ -0,0 +1,29 @@ +<?php +/** + * Please Email Ticketer of Batch Group & User Emails +* +* You may not change or alter any portion of this comment or credits +* of supporting developers from this source code or any supporting source code +* which is considered copyrighted (c) material of the original comment or credit authors. +* 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. +* +* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ +* @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) +* @author Simon Roberts (wishcraft) <wis...@us...> +* @subpackage language +* @description Email Ticking for Support/Faults/Management of Batch Group & User managed emails tickets +* @version 1.0.5 +* @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.5/Modules/please +* @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.6/Modules/please +* @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/please +* @link http://internetfounder.wordpress.com +*/ +if (!empty($GLOBALS['template'])) + $GLOBALS['xoopsTpl']->assign('footer',$footer="<div class='adminfooter'>\n" . " <div style='text-align: center;'>\n" . " <a href='http://www.xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n" . " </div>\n" . ' ' . _AM_PLEASE_ADMIN_FOOTER . "\n" . '</div>'); +if (!empty($GLOBALS['template'])) + $GLOBALS['xoopsTpl']->display($GLOBALS['template']); +if (empty($GLOBALS['template'])) + echo $footer; +xoops_cp_footer(); Added: XoopsModules/please/trunk/admin/header.php =================================================================== --- XoopsModules/please/trunk/admin/header.php (rev 0) +++ XoopsModules/please/trunk/admin/header.php 2016-11-20 14:45:43 UTC (rev 13222) @@ -0,0 +1,94 @@ +<?php +/** + * Please Email Ticketer of Batch Group & User Emails +* +* You may not change or alter any portion of this comment or credits +* of supporting developers from this source code or any supporting source code +* which is considered copyrighted (c) material of the original comment or credit authors. +* 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. +* +* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ +* @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) +* @author Simon Roberts (wishcraft) <wis...@us...> +* @subpackage language +* @description Email Ticking for Support/Faults/Management of Batch Group & User managed emails tickets +* @version 1.0.5 +* @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.5/Modules/please +* @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.6/Modules/please +* @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/please +* @link http://internetfounder.wordpress.com +*/ + +$path = dirname(dirname(dirname(__DIR__))); +include_once $path . '/mainfile.php'; +include_once $path . '/include/cp_functions.php'; +require_once $path . '/include/cp_header.php'; + +global $xoopsModule, $xoopsTpl, $thisModuleDir; + +$thisModuleDir = $GLOBALS['xoopsModule']->getVar('dirname'); + +//if functions.php file exist +//require_once dirname(__DIR__) . '/include/functions.php'; + +// Load language files +xoops_loadLanguage('errors', $thisModuleDir); +xoops_loadLanguage('admin', $thisModuleDir); +xoops_loadLanguage('modinfo', $thisModuleDir); +xoops_loadLanguage('main', $thisModuleDir); +xoops_load('pagenav'); + +$pathIcon16 = '../' . $xoopsModule->getInfo('icons16'); +$pathIcon32 = '../' . $xoopsModule->getInfo('icons32'); +$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin'); + +$myts = MyTextSanitizer::getInstance(); + +if (!isset($xoopsTpl) || !is_object($xoopsTpl)) { + include_once XOOPS_ROOT_PATH . '/class/template.php'; + $xoopsTpl = new XoopsTpl(); +} + +include_once $GLOBALS['xoops']->path($pathModuleAdmin . '/moduleadmin.php'); + +xoops_loadLanguage('user'); +if (!isset($GLOBALS['xoopsTpl']) || !is_object($GLOBALS['xoopsTpl'])) { + include_once $GLOBALS['xoops']->path('/class/template.php'); + $GLOBALS['xoopsTpl'] = new XoopsTpl(); +} + +if (isset($GLOBALS['xoopsTpl'])) +{ + $GLOBALS['xoopsTpl']->assign('dirname', $thisModuleDir); +} +if (isset($_REQUEST['start'])&&!empty($_REQUEST['start'])) + $GLOBALS['start'] = $_REQUEST['start']; +else + $GLOBALS['start'] = 0; + +if (isset($_REQUEST['limit'])&&!empty($_REQUEST['limit'])) + $GLOBALS['limit'] = $_REQUEST['limit']; +else + $GLOBALS['limit'] = _AM_PLEASE_ADMIN_LIMIT_ITEMS; + +if (isset($_REQUEST['sort'])&&!empty($_REQUEST['sort'])) + $GLOBALS['sort'] = $_REQUEST['sort']; +else + $GLOBALS['sort'] = ''; + +if (isset($_REQUEST['order'])&&!empty($_REQUEST['order'])) + $GLOBALS['order'] = $_REQUEST['order']; +else + $GLOBALS['order'] = 'ASC'; + +if (isset($_REQUEST['op'])&&!empty($_REQUEST['op'])) + $GLOBALS['op'] = $_REQUEST['op']; +else + $GLOBALS['op'] = ''; + +if (isset($_REQUEST['id'])&&!empty($_REQUEST['id'])) + $GLOBALS['id'] = $_REQUEST['id']; +else + $GLOBALS['id'] = ''; Added: XoopsModules/please/trunk/admin/index.php =================================================================== --- XoopsModules/please/trunk/admin/index.php (rev 0) +++ XoopsModules/please/trunk/admin/index.php 2016-11-20 14:45:43 UTC (rev 13222) @@ -0,0 +1,48 @@ +<?php +/** + * Please Email Ticketer of Batch Group & User Emails +* +* You may not change or alter any portion of this comment or credits +* of supporting developers from this source code or any supporting source code +* which is considered copyrighted (c) material of the original comment or credit authors. +* 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. +* +* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ +* @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) +* @author Simon Roberts (wishcraft) <wis...@us...> +* @subpackage language +* @description Email Ticking for Support/Faults/Management of Batch Group & User managed emails tickets +* @version 1.0.5 +* @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.5/Modules/please +* @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.6/Modules/please +* @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/please +* @link http://internetfounder.wordpress.com +*/ + +$GLOBALS['template'] = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . str_replace('.php', '.html', basename(__FILE__)); + +include_once __DIR__ . '/header.php'; +xoops_cp_header(); + +$indexAdmin = new ModuleAdmin(); +//----------------------- +// $xpPartnerHandler = xoops_getModuleHandler('partners', $xoopsModule->getVar('dirname')); + +// $totalPartners = $xpPartnerHandler->getCount(); +// $totalNonActivePartners = $xpPartnerHandler->getCount(new Criteria('status', 0, '=')); +// $totalActivePartners = $totalPartners - $totalNonActivePartners; + +// $indexAdmin->addInfoBox(_MD_XPARTNERS_DASHBOARD); + +// $indexAdmin->addInfoBoxLine(_MD_XPARTNERS_DASHBOARD, "<infolabel>" ._MD_XPARTNERS_TOTALACTIVE. "</infolabel>", $totalActivePartners, 'Green'); +// $indexAdmin->addInfoBoxLine(_MD_XPARTNERS_DASHBOARD, "<infolabel>" ._MD_XPARTNERS_TOTALNONACTIVE. "</infolabel>", $totalNonActivePartners, 'Red'); +// $indexAdmin->addInfoBoxLine(_MD_XPARTNERS_DASHBOARD, "<infolabel>" ._MD_XPARTNERS_TOTALPARTNERS. "</infolabel><infotext>", $totalPartners."</infotext>"); +//---------------------------- + +$GLOBALS['xoopsTpl']->assign('nav',$indexAdmin->addNavigation(basename(__FILE__))); +$GLOBALS['xoopsTpl']->assign('index',$indexAdmin->renderIndex()); + +include_once __DIR__ . '/footer.php'; +//xoops_cp_footer(); Added: XoopsModules/please/trunk/admin/menu.php =================================================================== --- XoopsModules/please/trunk/admin/menu.php (rev 0) +++ XoopsModules/please/trunk/admin/menu.php 2016-11-20 14:45:43 UTC (rev 13222) @@ -0,0 +1,85 @@ +<?php +/** + * Please Email Ticketer of Batch Group & User Emails +* +* You may not change or alter any portion of this comment or credits +* of supporting developers from this source code or any supporting source code +* which is considered copyrighted (c) material of the original comment or credit authors. +* 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. +* +* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ +* @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) +* @author Simon Roberts (wishcraft) <wis...@us...> +* @subpackage language +* @description Email Ticking for Support/Faults/Management of Batch Group & User managed emails tickets +* @version 1.0.5 +* @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.5/Modules/please +* @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.6/Modules/please +* @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/please +* @link http://internetfounder.wordpress.com +*/ + +$path = dirname(dirname(dirname(__DIR__))); +include_once $path . '/mainfile.php'; + +$dirname = basename(dirname(__DIR__)); +$module_handler = xoops_getHandler('module'); +$module = $module_handler->getByDirname($dirname); +$pathIcon32 = $module->getInfo('icons32'); +$pathModuleAdmin = $module->getInfo('dirmoduleadmin'); +$pathLanguage = $path . $pathModuleAdmin; + +if (!file_exists($fileinc = $pathLanguage . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/' . 'main.php')) { + $fileinc = $pathLanguage . '/language/english/main.php'; +} + +include_once $fileinc; + +$adminmenu = array(); + +$i = 1; +$adminmenu[$i]['title'] = _MI_PLEASE_ADMINMENU_HOME; +$adminmenu[$i]['link'] = 'admin/index.php'; +$adminmenu[$i]['icon'] = $pathIcon32 . '/home.png'; +++$i; +$adminmenu[$i]['title'] = _MI_PLEASE_ADMINMENU_DEPARTMENTS; +$adminmenu[$i]['link'] = 'admin/departments.php'; +$adminmenu[$i]['icon'] = $pathIcon32 . '/users.png'; +++$i; +$adminmenu[$i]['title'] = _MI_PLEASE_ADMINMENU_ESCALATION; +$adminmenu[$i]['link'] = 'admin/escalations.php'; +$adminmenu[$i]['icon'] = $pathIcon32 . '/security.png'; +++$i; +$adminmenu[$i]['title'] = _MI_PLEASE_ADMINMENU_USERS; +$adminmenu[$i]['link'] = 'admin/users.php'; +$adminmenu[$i]['icon'] = $pathIcon32 . '/users.png'; +++$i; +$adminmenu[$i]['title'] = _MI_PLEASE_ADMINMENU_FILES; +$adminmenu[$i]['link'] = 'admin/files.php'; +$adminmenu[$i]['icon'] = $pathIcon32 . '/fileshare.png'; +++$i; +$adminmenu[$i]['title'] = _MI_PLEASE_ADMINMENU_MIMETYPES; +$adminmenu[$i]['link'] = 'admin/mimetypes.php'; +$adminmenu[$i]['icon'] = $pathIcon32 . '/upload.png'; +++$i; +$adminmenu[$i]['title'] = _MI_PLEASE_ADMINMENU_TICKETS; +$adminmenu[$i]['link'] = 'admin/tickets.php'; +$adminmenu[$i]['icon'] = $pathIcon32 . '/event.png'; +++$i; +$adminmenu[$i]['title'] = _MI_PLEASE_ADMINMENU_KEYWQRDS; +$adminmenu[$i]['link'] = 'admin/keywords.php'; +$adminmenu[$i]['icon'] = $pathIcon32 . '/highlight.png'; +++$i; +$adminmenu[$i]['title'] = _MI_PLEASE_ADMINMENU_REPORTS; +$adminmenu[$i]['link'] = 'admin/reports.php'; +$adminmenu[$i]['icon'] = $pathIcon32 . '/newsletter.png'; +++$i; +$adminmenu[$i]['title'] = _MI_PLEASE_ADMINMENU_PERMISSIONS; +$adminmenu[$i]['link'] = 'admin/permissions.php'; +$adminmenu[$i]['icon'] = $pathIcon32 . '/permissions.png'; +++$i; +$adminmenu[$i]['title'] = _MI_PLEASE_ADMINMENU_ABOUT; +$adminmenu[$i]['link'] = 'admin/about.php'; +$adminmenu[$i]['icon'] = $pathIcon32 . '/about.png'; Added: XoopsModules/please/trunk/admin/permissions.php =================================================================== --- XoopsModules/please/trunk/admin/permissions.php (rev 0) +++ XoopsModules/please/trunk/admin/permissions.php 2016-11-20 14:45:43 UTC (rev 13222) @@ -0,0 +1,112 @@ +<?php +/** + * Please Email Ticketer of Batch Group & User Emails +* +* You may not change or alter any portion of this comment or credits +* of supporting developers from this source code or any supporting source code +* which is considered copyrighted (c) material of the original comment or credit authors. +* 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. +* +* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ +* @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) +* @author Simon Roberts (wishcraft) <wis...@us...> +* @subpackage language +* @description Email Ticking for Support/Faults/Management of Batch Group & User managed emails tickets +* @version 1.0.5 +* @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.5/Modules/please +* @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.6/Modules/please +* @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/please +* @link http://internetfounder.wordpress.com +*/ + +include_once __DIR__ . '/admin_header.php'; +xoops_cp_header(); +$indexAdmin = new ModuleAdmin(); +echo $indexAdmin->addNavigation(basename(__FILE__)); + +$op = \Xmf\Request::getCmd('op', 'edit'); + +$perm_desc = ''; +switch ($op) { + case 'visibility': + //redirect_header("visibility.php", 0, _PROFILE_AM_PROF_VISIBLE); + header('Location: visibility.php'); + break; + + case 'edit': + $title_of_form = _PROFILE_AM_PROF_EDITABLE; + $perm_name = 'profile_edit'; + $restriction = 'field_edit'; + $anonymous = false; + break; + + case 'search': + $title_of_form = _PROFILE_AM_PROF_SEARCH; + $perm_name = 'profile_search'; + $restriction = ''; + $anonymous = true; + break; + + case 'access': + $title_of_form = _PROFILE_AM_PROF_ACCESS; + $perm_name = 'profile_access'; + $perm_desc = _PROFILE_AM_PROF_ACCESS_DESC; + $restriction = ''; + $anonymous = true; + break; +} + +include_once $GLOBALS['xoops']->path('/class/xoopsformloader.php'); +$opform = new XoopsSimpleForm('', 'opform', 'permissions.php', 'get'); +$op_select = new XoopsFormSelect('', 'op', $op); +$op_select->setExtra('onchange="document.forms.opform.submit()"'); +$op_select->addOption('visibility', _PROFILE_AM_PROF_VISIBLE); +$op_select->addOption('edit', _PROFILE_AM_PROF_EDITABLE); +$op_select->addOption('search', _PROFILE_AM_PROF_SEARCH); +$op_select->addOption('access', _PROFILE_AM_PROF_ACCESS); +$opform->addElement($op_select); +$opform->display(); + +$module_id = $GLOBALS['xoopsModule']->getVar('mid'); +include_once $GLOBALS['xoops']->path('/class/xoopsform/grouppermform.php'); +$form = new XoopsGroupPermForm($title_of_form, $module_id, $perm_name, $perm_desc, 'admin/permissions.php?op=' . $op, $anonymous); +if ($op === 'access') { + $member_handler = xoops_getHandler('member'); + $glist = $member_handler->getGroupList(); + foreach (array_keys($glist) as $i) { + if ($i != XOOPS_GROUP_ANONYMOUS) { + $form->addItem($i, $glist[$i]); + } + } +} else { + $profile_handler = xoops_getModuleHandler('profile'); + $fields = $profile_handler->loadFields(); + + if ($op !== 'search') { + foreach (array_keys($fields) as $i) { + if ($restriction == '' || $fields[$i]->getVar($restriction)) { + $form->addItem($fields[$i]->getVar('field_id'), xoops_substr($fields[$i]->getVar('field_title'), 0, 25)); + } + } + } else { + $searchable_types = array( + 'textbox', + 'select', + 'radio', + 'yesno', + 'date', + 'datetime', + 'timezone', + 'language'); + foreach (array_keys($fields) as $i) { + if (in_array($fields[$i]->getVar('field_type'), $searchable_types)) { + $form->addItem($fields[$i]->getVar('field_id'), xoops_substr($fields[$i]->getVar('field_title'), 0, 25)); + } + } + } +} +$form->display(); +include_once __DIR__ . '/admin_footer.php'; +//xoops_cp_footer(); Modified: XoopsModules/please/trunk/class/departments.php =================================================================== --- XoopsModules/please/trunk/class/departments.php 2016-11-06 13:54:03 UTC (rev 13221) +++ XoopsModules/please/trunk/class/departments.php 2016-11-20 14:45:43 UTC (rev 13222) @@ -4,21 +4,21 @@ * * You may not change or alter any portion of this comment or credits * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. + * which is considered copyrighted (c) material of the original comment or credit authors . * 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. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) - * @author Simon Roberts (wishcraft) <wis...@us...> + * @copyright The XOOPS Project http : //sourceforge . net/projects/xoops/ + * @license General Public License version 3 (http : //labs . coop/briefs/legal/general-public-licence/13,3 . html) + * @author Simon Roberts (wishcraft) <wishcraft@users . sourceforge . net> * @subpackage please * @description Departments Ticking for Support/Faults/Management of Batch Group & User managed emails tickets - * @version 1.0.5 - * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.5/Modules/please - * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.6/Modules/please - * @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/please - * @link http://internetfounder.wordpress.com + * @version 1 . 0 . 5 + * @link https : //sourceforge . net/projects/chronolabs/files/XOOPS%202 . 5/Modules/please + * @link https : //sourceforge . net/projects/chronolabs/files/XOOPS%202 . 6/Modules/please + * @link https : //sourceforge . net/p/xoops/svn/HEAD/tree/XoopsModules/please + * @link http : //internetfounder . wordpress . com */ if (!defined('_MI_PLEASE_MODULE_DIRNAME')) { @@ -26,12 +26,12 @@ } //* -require_once (__DIR__ . DIRECTORY_SEPARATOR . 'objects.php'); +require_once (__DIR__ . DIRECTORY_SEPARATOR . 'objects . php'); /** * Class for Departments in Please email ticketer * - * For Table:- + * For Table : - * <code> * CREATE TABLE `please_departments` ( * `id` int(6) UNSIGNED NOT NULL AUTO_INCREMENT, @@ -59,8 +59,8 @@ * PRIMARY KEY (`id`) * ) ENGINE=InnoDB DEFAULT CHARSET=utf8; * </code> - * @author Simon Roberts (wis...@us...) - * @copyright copyright (c) 2015 labs.coop + * @author Simon Roberts (wishcraft@users . sourceforge . net) + * @copyright copyright (c) 2015 labs . coop */ class pleaseDepartments extends pleaseXoopsObject { @@ -71,7 +71,7 @@ { self::initVar('id', XOBJ_DTYPE_INT, null, false); - self::initVar('code', XOBJ_DTYPE_TXTBOX, 'AAB' + mt_rand(100, 100000), false); + self::initVar('code', XOBJ_DTYPE_TXTBOX, chr(mt_rand(ord("A"), ord("Z"))) . chr(mt_rand(ord("A"), ord("Z"))) . chr(mt_rand(ord("A"), ord("Z"))), false, 3); self::initVar('name', XOBJ_DTYPE_TXTBOX, null, false, 128); self::initVar('description', XOBJ_DTYPE_OTHER, null, false); self::initVar('mantis-uri', XOBJ_DTYPE_TXTBOX, null, false, 350); @@ -79,10 +79,10 @@ self::initVar('mantis-password', XOBJ_DTYPE_TXTBOX, null, false, 198); self::initVar('mantis-project-id', XOBJ_DTYPE_INT, null, false); self::initVar('manager-uid', XOBJ_DTYPE_INT, null, false); - self::initVar('manager-bcc', XOBJ_DTYPE_ENUM, 'none', false, false, false, getEnumeratorValues(basename(__FILE__), 'manager-bcc')); + self::initVar('manager-bcc', XOBJ_DTYPE_ENUM, 'no', false, false, false, getEnumeratorValues(basename(__FILE__), 'manager-bcc')); self::initVar('manager-mantis-username', XOBJ_DTYPE_TXTBOX, null, false, 45); self::initVar('manager-mantis-password', XOBJ_DTYPE_TXTBOX, null, false, 198); - self::initVar('mantis', XOBJ_DTYPE_ENUM, 'none', false, false, false, getEnumeratorValues(basename(__FILE__), 'mantis')); + self::initVar('mantis', XOBJ_DTYPE_ENUM, 'no', false, false, false, getEnumeratorValues(basename(__FILE__), 'mantis')); self::initVar('gid', XOBJ_DTYPE_INT, null, false); self::initVar('tickets', XOBJ_DTYPE_INT, null, false); self::initVar('staff', XOBJ_DTYPE_INT, null, false); @@ -94,12 +94,61 @@ self::initVar('created', XOBJ_DTYPE_INT, time(), false); $this->handler = __CLASS__ . 'Handler'; - if (!empty($id) && !is_null($id)) + if (!empty($id) && !is_null($id)) { $handler = new $this->handler; self::assignVars($handler->get($id)->getValues(array_keys($this->vars))); } + /** + * Gets the drill down items for the form being submitted on the admin + * control panel.. + * + * @return string + */ + function getAdminListFormItems() + { + require_once dirname(__DIR__) . DIRECTORY_SEPERATOR . 'include' . DIRECTORY_SEPERATOR . 'formloader.php'; + + $ret = array(); + $ret['id'] = (string)$this->getVar('id'); + $codetxt = new XoopsFormText('', 'code['.$ret['id'].']', 4, 3, (string)$this->getVar('code')); + $codehide = new XoopsFormHidden('old[code]['.$ret['id'].']', (string)$this->getVar('code')); + $ret['code'] = $codetxt->render() . $codehide->render(); + $nametxt = new XoopsFormText('', 'name['.$ret['id'].']', 26, 128, (string)$this->getVar('name')); + $namehide = new XoopsFormHidden('old[name]['.$ret['id'].']', (string)$this->getVar('name')); + $ret['name'] = $nametxt->render().$namehide->render(); + $mantisenum = new PleaseFormSelectEnumerator('', 'mantis['.$ret['id'].']', basename(__FILE__), 'mantis', (string)$this->getVar('name')); + $mantishide = new XoopsFormHidden('old[mantis]['.$ret['id'].']', (string)$this->getVar('mantis')); + $ret['mantis'] = $nametxt->render().$mantishide->render(); + $ret['tickets'] = (string)$this->getVar('tickets'); + $ret['staff'] = (string)$this->getVar('staff'); + $ret['clients'] = (string)$this->getVar('clients'); + $ret['raised'] = (string)$this->getVar('raised'); + $dirname = basename(dirname(__DIR__)); + $ticket_handler = xoops_getModuleHandler('tickets', $dirname); + if ($this->getVar('latest-id')>0) + { + $ticket = $ticket_handler->get($this->getVar('latest-id')); + $ret['latest'] = "<a href='" . $ticket->getAdminLink() . "' target='_blank'>" . $ticket->getVar('ticket-key') . "</a>"; + } else { + $ret['latest'] = " "; + } + if ($this->getVar('closed-id')>0) + { + $ticket = $ticket_handler->get($this->getVar('closed-id')); + $ret['closed'] = "<a href='" . $ticket->getAdminLink() . "' target='_blank'>" . $ticket->getVar('ticket-key') . "</a>"; + } else { + $ret['closed'] = " "; + } + + $module_handler = xoops_getHandler('module'); + $module = $module_handler->getByDirname($dirname); + $pathIcon16 = $module->getInfo('icons16'); + $ret['actions'] = "<a href='" . XOOPS_URL . "/modules/$dirname/admin/edit-department.php?id=" . $this->getMD5('id') . "' target='_blank'><img src='" . $pathIcon16 . "/edit.png' alt='" . sprintf(_AM_PLEASE_ADMIN_DEPARTMENTS_EDIT, $this->getVar('name')) . "' title='" . sprintf(_AM_PLEASE_ADMIN_DEPARTMENTS_EDIT, $this->getVar('name')) . "'/></a> "; + return $ret; + } + } } @@ -107,8 +156,8 @@ /** * Handler Class for Departments in Please email ticketer - * @author Simon Roberts (wis...@us...) - * @copyright copyright (c) 2015 labs.coop + * @author Simon Roberts (wishcraft@users . sourceforge . net) + * @copyright copyright (c) 2015 labs . coop */ class pleaseDepartmentsHandler extends pleaseXoopsObjectHandler { @@ -148,5 +197,131 @@ $db = $GLOBAL["xoopsDB"]; parent::__construct($db, self::$tbl, self::$child, self::$identity, self::$envalued); } + + /** + * Created the Add new Department form for the Admin Control Panel + * + * @return string + */ + function getAddFormAdmin() + { + $elements = array(); + $dirname = basename(dirname(__DIR__)); + require_once dirname(__DIR__) . DIRECTORY_SEPERATOR . 'include' . DIRECTORY_SEPERATOR . 'formloader.php'; + + $elements['code'] = new XoopsFormText(_AM_PLEASE_ADDFORM_DEPARTMENT_CODE_TITLE, 'code', 4, 3, chr(mt_rand(ord("A"), ord("Z"))) . chr(mt_rand(ord("A"), ord("Z"))) . chr(mt_rand(ord("A"), ord("Z")))); + $elements['code']->setDescription(_AM_PLEASE_ADDFORM_DEPARTMENT_CODE_DESC); + $elements['name'] = new XoopsFormText(_AM_PLEASE_ADDFORM_DEPARTMENT_NAME_TITLE, 'name', 28, 128, ''); + $elements['name']->setDescription(_AM_PLEASE_ADDFORM_DEPARTMENT_NAME_DESC); + $elements['description'] = new XoopsFormTextArea(_AM_PLEASE_ADDFORM_DEPARTMENT_DESCRIPTION_TITLE, 'description', '', 28, 8); + $elements['description']->setDescription(_AM_PLEASE_ADDFORM_DEPARTMENT_DESCRIPTION_DESC); + $elements['mantis'] = new PleaseFormSelectEnumerator(_AM_PLEASE_ADDFORM_DEPARTMENT_MANTIS_TITLE, 'mantis', basename(__FILE__), 'mantis', (string)$this->getVar('name')); + $elements['mantis']->setDescription(_AM_PLEASE_ADDFORM_DEPARTMENT_MANTIS_DESC); + $elements['mantis-uri'] = new XoopsFormText(_AM_PLEASE_ADDFORM_DEPARTMENT_MANTISURI_TITLE, 'mantis-uri', 28, 350, 'http://'); + $elements['mantis-uri']->setDescription(_AM_PLEASE_ADDFORM_DEPARTMENT_MANTISURI_DESC); + $elements['mantis-username'] = new XoopsFormText(_AM_PLEASE_ADDFORM_DEPARTMENT_MANTISUSERNAME_TITLE, 'mantis-username', 28, 45, ''); + $elements['mantis-username']->setDescription(_AM_PLEASE_ADDFORM_DEPARTMENT_MANTISUSERNAME_DESC); + $elements['mantis-password'] = new XoopsFormPassword(_AM_PLEASE_ADDFORM_DEPARTMENT_MANTISPASSWORD_TITLE, 'mantis-password', 28, 198, ''); + $elements['mantis-password']->setDescription(_AM_PLEASE_ADDFORM_DEPARTMENT_MANTISPASSWORD_DESC); + $elements['signature'] = new XoopsFormDhtmlTextArea(_AM_PLEASE_ADDFORM_DEPARTMENT_SIGNATURE_TITLE, 'signature', '', 28, 8); + $elements['signature']->setDescription(_AM_PLEASE_ADDFORM_DEPARTMENT_SIGNATURE_DESC); + $elements['manager-name'] = new XoopsFormText(_AM_PLEASE_ADDFORM_DEPARTMENT_MANAGERNAME_TITLE, 'name', 28, 128, ''); + $elements['manager-name']->setDescription(_AM_PLEASE_ADDFORM_DEPARTMENT_MANAGERNAME_DESC); + $elements['manager-email'] = new XoopsFormText(_AM_PLEASE_ADDFORM_DEPARTMENT_MANAGEREMAIL_TITLE, 'name', 28, 128, ''); + $elements['manager-email']->setDescription(_AM_PLEASE_ADDFORM_DEPARTMENT_MANAGEREMAIL_DESC); + $elements['submit'] = new XoopsFormButton('', 'submit', _SUBMIT); + + $form = new XoopsThemeForm(_AM_PLEASE_ADMIN_DEPARTMENTS_ADDFORM_TITLE, 'add-department', XOOPS_URL . '/modules/' . $dirname . '/admin/post.php?op=add-department', 'post', true); + foreach($elements as $key => $obj) + { + if (in_array($key, array('code', 'name', 'description', 'manager-name', 'manager-email'))) + $form->addElement($elements[$key], true); + else + $form->addElement($elements[$key], false); + } + + return $form->render(); + } + + /** + * Gets the admin header table constants for the admin drilldown items + * + * @return string + */ + function getAdminListFormHeader() + { + $dirname = basename(dirname(__DIR__)); + $ret = array(); + $ret['id']['name'] = _AM_PLEASE_ADMIN_DEPARTMENTS_ID; + $ret['id']['url'] = XOOPS_URL . '/modules/' . $dirname . '/admin/departments.php?start=' . $GLOBALS['start'] . '&limit=' . $GLOBALS['limit'] . (isset($GLOBALS['op']) && !empty($GLOBALS['op']) ? '&op=' . $GLOBALS['op'] : "") . '&sort=id' . (isset($GLOBALS['order']) && !empty($GLOBALS['order'] && $GLOBALS['sort'] == 'id' && $GLOBALS['order'] == 'ASC') ? '&order=DESC' : '&order=ASC'); + $ret['code']['name'] = _AM_PLEASE_ADMIN_DEPARTMENTS_CODE; + $ret['code']['url'] = XOOPS_URL . '/modules/' . $dirname . '/admin/departments.php?start=' . $GLOBALS['start'] . '&limit=' . $GLOBALS['limit'] . (isset($GLOBALS['op']) && !empty($GLOBALS['op']) ? '&op=' . $GLOBALS['op'] : "") . '&sort=code' . (isset($GLOBALS['order']) && !empty($GLOBALS['order'] && $GLOBALS['sort'] == 'code' && $GLOBALS['order'] == 'ASC') ? '&order=DESC' : '&order=ASC'); + $ret['name']['name'] = _AM_PLEASE_ADMIN_DEPARTMENTS_NAME; + $ret['name']['url'] = XOOPS_URL . '/modules/' . $dirname . '/admin/departments.php?start=' . $GLOBALS['start'] . '&limit=' . $GLOBALS['limit'] . (isset($GLOBALS['op']) && !empty($GLOBALS['op']) ? '&op=' . $GLOBALS['op'] : "") . '&sort=name' . (isset($GLOBALS['order']) && !empty($GLOBALS['order'] && $GLOBALS['sort'] == 'name' && $GLOBALS['order'] == 'ASC') ? '&order=DESC' : '&order=ASC'); + $ret['mantis']['name'] = _AM_PLEASE_ADMIN_DEPARTMENTS_MANTIS; + $ret['mantis']['url'] = XOOPS_URL . '/modules/' . $dirname . '/admin/departments.php?start=' . $GLOBALS['start'] . '&limit=' . $GLOBALS['limit'] . (isset($GLOBALS['op']) && !empty($GLOBALS['op']) ? '&op=' . $GLOBALS['op'] : "") . '&sort=mantis' . (isset($GLOBALS['order']) && !empty($GLOBALS['order'] && $GLOBALS['sort'] == 'mantis' && $GLOBALS['order'] == 'ASC') ? '&order=DESC' : '&order=ASC'); + $ret['tickets']['name'] = _AM_PLEASE_ADMIN_DEPARTMENTS_TICKETS; + $ret['tickets']['url'] = XOOPS_URL . '/modules/' . $dirname . '/admin/departments.php?start=' . $GLOBALS['start'] . '&limit=' . $GLOBALS['limit'] . (isset($GLOBALS['op']) && !empty($GLOBALS['op']) ? '&op=' . $GLOBALS['op'] : "") . '&sort=tickets' . (isset($GLOBALS['order']) && !empty($GLOBALS['order'] && $GLOBALS['sort'] == 'tickets' && $GLOBALS['order'] == 'ASC') ? '&order=DESC' : '&order=ASC'); + $ret['staff']['name'] = _AM_PLEASE_ADMIN_DEPARTMENTS_STAFF; + $ret['staff']['url'] = XOOPS_URL . '/modules/' . $dirname . '/admin/departments.php?start=' . $GLOBALS['start'] . '&limit=' . $GLOBALS['limit'] . (isset($GLOBALS['op']) && !empty($GLOBALS['op']) ? '&op=' . $GLOBALS['op'] : "") . '&sort=staff' . (isset($GLOBALS['order']) && !empty($GLOBALS['order'] && $GLOBALS['sort'] == 'staff' && $GLOBALS['order'] == 'ASC') ? '&order=DESC' : '&order=ASC'); + $ret['clients']['name'] = _AM_PLEASE_ADMIN_DEPARTMENTS_CLIENTS; + $ret['clients']['url'] = XOOPS_URL . '/modules/' . $dirname . '/admin/departments.php?start=' . $GLOBALS['start'] . '&limit=' . $GLOBALS['limit'] . (isset($GLOBALS['op']) && !empty($GLOBALS['op']) ? '&op=' . $GLOBALS['op'] : "") . '&sort=clients' . (isset($GLOBALS['order']) && !empty($GLOBALS['order'] && $GLOBALS['sort'] == 'clients' && $GLOBALS['order'] == 'ASC') ? '&order=DESC' : '&order=ASC'); + $ret['raised']['name'] = _AM_PLEASE_ADMIN_DEPARTMENTS_RAISED; + $ret['raised']['url'] = XOOPS_URL . '/modules/' . $dirname . '/admin/departments.php?start=' . $GLOBALS['start'] . '&limit=' . $GLOBALS['limit'] . (isset($GLOBALS['op']) && !empty($GLOBALS['op']) ? '&op=' . $GLOBALS['op'] : "") . '&sort=raised' . (isset($GLOBALS['order']) && !empty($GLOBALS['order'] && $GLOBALS['sort'] == 'raised' && $GLOBALS['order'] == 'ASC') ? '&order=DESC' : '&order=ASC'); + $ret['latest']['name'] = _AM_PLEASE_ADMIN_DEPARTMENTS_LATEST; + $ret['latest']['url'] = XOOPS_URL . '/modules/' . $dirname . '/admin/departments.php?start=' . $GLOBALS['start'] . '&limit=' . $GLOBALS['limit'] . (isset($GLOBALS['op']) && !empty($GLOBALS['op']) ? '&op=' . $GLOBALS['op'] : "") . '&sort=latest-id' . (isset($GLOBALS['order']) && !empty($GLOBALS['order'] && $GLOBALS['sort'] == 'latest-id' && $GLOBALS['order'] == 'ASC') ? '&order=DESC' : '&order=ASC'); + $ret['closed']['name'] = _AM_PLEASE_ADMIN_DEPARTMENTS_CLOSED; + $ret['closed']['url'] = XOOPS_URL . '/modules/' . $dirname . '/admin/departments.php?start=' . $GLOBALS['start'] . '&limit=' . $GLOBALS['limit'] . (isset($GLOBALS['op']) && !empty($GLOBALS['op']) ? '&op=' . $GLOBALS['op'] : "") . '&sort=closed-id' . (isset($GLOBALS['order']) && !empty($GLOBALS['order'] && $GLOBALS['sort'] == 'closed-id' && $GLOBALS['order'] == 'ASC') ? '&order=DESC' : '&order=ASC'); + $ret['actions']['name'] = _AM_PLEASE_ADMIN_DEPARTMENTS_ACTIONS; + $ret['actions']['url'] = ''; + + return $ret; + } + + + /** + * Get the default sort basis for criteria's + * + * @param string $location + * @return string + */ + function getDefaultSort($location = 'admin') + { + switch($location) + { + default: + case "admin": + return 'name'; + break; + case "tickets": + return 'code'; + break; + } + } + + /** + * Inserts Objects in the database + * + * {@inheritDoc} + * @see XoopsPersistableObjectHandler::insert() + */ + function insert($object = null, $force = true) + { + if (is_a($object, "pleaseDepartments")) + { + if ($object->isNew()) + { + $groups_handler =& xoops_gethandler('group'); + $group = $groups_handler->create(); + $group->setVar('name', substr(sprintf(_MI_PLEASE_GROUP_NAME_DEPARTMENT, $object->getVar('name')), 0, 99)); + $group->setVar('description', sprintf(_MI_PLEASE_GROUP_DESC_DEPARTMENT, $object->getVar('description'))); + $group->setVar('group_type', _MI_PLEASE_GROUP_TYPE_DEPARTMENT); + $object->setVar('gid', $groups_handler->insert($group, true)); + $object->setVar('created', time()); + } + return parent::insert($object, $force); + } + return false; + } } ?> \ No newline at end of file Modified: XoopsModules/please/trunk/class/objects.php =================================================================== --- XoopsModules/please/trunk/class/objects.php 2016-11-06 13:54:03 UTC (rev 13221) +++ XoopsModules/please/trunk/class/objects.php 2016-11-20 14:45:43 UTC (rev 13222) @@ -45,7 +45,7 @@ if ($this->vars[$key]['data_type'] == XOBJ_DTYPE_OTHER) { parent::assignVar($key, pleaseDecompressData($value)); } elseif (strpos($key, 'pass')||strpos($key, 'password')) { - parent::assignVar($key, pleaseDecryptPassword($value, _PLEASE_SALT_BLOWFISH . _PLEASE_SALT_WHENSET)); + parent::assignVar($key, pleaseDecryptPassword($value, PLEASE_SALT . PLEASE_SALT_WHENSET)); } else parent::assignVar($key, $value); } @@ -67,12 +67,23 @@ if ($object->vars[$field]['data_type'] == XOBJ_DTYPE_OTHER) { $object->vars[$field]['value'] = pleaseCompressData($object->vars[$field]['value']); } elseif (strpos($field, 'pass')||strpos($field, 'password')) { - $object->vars[$field]['value'] = pleaseEncryptPassword($object->vars[$field]['value'], _PLEASE_SALT_BLOWFISH . _PLEASE_SALT_WHENSET); + $object->vars[$field]['value'] = pleaseEncryptPassword($object->vars[$field]['value'], PLEASE_SALT . PLEASE_SALT_WHENSET); } } } return $ret; } + + /** + * Returns MD5 Identify hash for handler getMD5()' + * + * @param string $field + * @return string + */ + function getMD5($field = 'id') + { + return md5(PLEASE_SALT . $this->getVar($field) . PLEASE_SALT); + } } /** @@ -83,7 +94,36 @@ class pleaseXoopsObjectHandler extends XoopsPersistableObjectHandler { + /** + * Table Name without prefix used + * + * @var string + */ + var $tbl = ''; + + /** + * Child Object Handling Class + * + * @var string + */ + var $child = ''; + + /** + * Child Object Identity Key + * + * @var string + */ + var $identity = ''; + + /** + * Child Object Default Envaluing Costs + * + * @var string + */ + var $envalued = ''; + + /** * Class Constructor * @param XoopsDB $db * @param string $tbl @@ -91,10 +131,37 @@ * @param string $identity * @param string $envalued */ - function __construct(&$db, $tbl = '', $child = '', $identity = '', $envalued = '') + function __construct($db, $tbl = '', $child = '', $identity = '', $envalued = '') { if (!object($db)) - $db = $GLOBAL["xoopsDB"]; - return parent::__construct($db, $tbl, $child, $identity, $envalued); - } + $db = $GLOBAL["xoopsDB"]; + $this->tbl = $tbl; + $this->child = $child; + $this->identity = $identity; + $this->envalued = $envalued; + return parent::__construct($db, $this->tbl, $this->child, $this->identity, $this->envalued); + } + + /** + * Returns either object or identity key based on md5 passed to function + * + * @param string $md5 + * @param string $asObject + * @return XoopsObject|unknown|boolean + */ + function getMD5($md5 = '', $asObject = true) + { + $key = NULL; + $sql = "SELECT `" . $this->identity . "` FROM `" . $this->db->prefix($this->tbl) . "` WHERE MD5(CONCAT(" . $this->db->quote(PLEASE_SALT) . ", `" . $this->identity . "`, " . $this->db->quote(PLEASE_SALT) . ")) LIKE '" . $md5 . "'"; + if ($result = $this->db->queryF($sql)) + { + list($key) = $this->db->fetchRow($result); + } + if (!empty($key) && !is_null($key) && $asObject == true) + return $this->get($key); + if (!empty($key) && !is_null($key) && $asObject == false) + return $key; + return false; + } + } \ No newline at end of file Modified: XoopsModules/please/trunk/class/tickets.php =================================================================== --- XoopsModules/please/trunk/class/tickets.php 2016-11-06 13:54:03 UTC (rev 13221) +++ XoopsModules/please/trunk/class/tickets.php 2016-11-20 14:45:43 UTC (rev 13222) @@ -84,6 +84,11 @@ } + function getAdminLink() + { + $dirname = basename(dirname(__DIR__)); + return XOOPS_URL . '/modules/'.$dirname."/admin/view-ticket.php?id=" . $this->getMD5('id'); + } } Added: XoopsModules/please/trunk/include/formloader.php =================================================================== --- XoopsModules/please/trunk/include/formloader.php (rev 0) +++ XoopsModules/please/trunk/include/formloader.php 2016-11-20 14:45:43 UTC (rev 13222) @@ -0,0 +1,19 @@ +<?php +/** + * XOOPS form class loader + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * 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. + * + * @copyright (c) 2000-2016 XOOPS Project (www.xoops.org) + * @license GNU GPL 2 (http://www.gnu.org/licenses/gpl-2.0.html) + * @package kernel + * @since 2.0.0 + */ + +xoops_load('XoopsFormLoader'); +require_once __DIR__ . DIRECTORY_SEPARATOR . 'formselectenumerator.php'; Added: XoopsModules/please/trunk/include/formselectenumerator.php =================================================================== --- XoopsModules/please/trunk/include/formselectenumerator.php (rev 0) +++ XoopsModules/please/trunk/include/formselectenumerator.php 2016-11-20 14:45:43 UTC (rev 13222) @@ -0,0 +1,52 @@ +<?php +/** + * XOOPS form element + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * 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. + * + * @copyright (c) 2000-2016 XOOPS Project (www.xoops.org) + * @license GNU GPL 2 (http://www.gnu.org/licenses/gpl-2.0.html) + * @package kernel + * @subpackage form + * @since 2.0.0 + * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ + */ + +defined('XOOPS_ROOT_PATH') || exit('Restricted access'); + +xoops_load('XoopsLists'); +xoops_load('XoopsFormSelect'); + +require_once __DIR__ . DIRECTORY_SEPERATOR . 'functions.php'; + +/** + * A select box with available themes + */ +class PleaseFormSelectEnumerator extends XoopsFormSelect +{ + /** + * Constructor + * + * @param string $caption + * @param string $name + * @param mixed $value Pre-selected value (or array of them). + * @param int $size Number or rows. "1" makes a drop-down-list + */ + public function __construct($caption, $name, $classfile = '', $field = '', $value = null, $size = 1) + { + parent::__construct($caption, $name, $value, $size); + if ($values = getEnumeratorValues($classfile, $field)) + { + $ret = array(); + foreach($values as $value) + $ret[$value] = ucwords(strtolower($value)); + $this->addOptionArray($ret); + } + + } +} Modified: XoopsModules/please/trunk/include/install.php =================================================================== --- XoopsModules/please/trunk/include/install.php 2016-11-06 13:54:03 UTC (rev 13221) +++ XoopsModules/please/trunk/include/install.php 2016-11-20 14:45:43 UTC (rev 13222) @@ -110,7 +110,7 @@ if (is_file(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'groups.php')) unlink(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'groups.php'); $php = file_get_contents(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'groups.php.tpl'); - file_put_contents(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'groups.php', str_replace('%client%', $gc, str_replace('%staff%', $gs, str_replace('%manager%, $gm, $php')))); + file_put_contents(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'groups.php', str_replace('%whenset%', date("D, d M Y, H:i:s"), str_replace('%salt%', please_install_generate_salt(), str_replace('%client%', $gc, str_replace('%staff%', $gs, str_replace('%manager%, $gm, $php')))))); return true; } @@ -119,4 +119,32 @@ } +function please_install_generate_salt() +{ + $salt = ''; + mt_srand(mt_rand(-microtime(true), microtime(true))); + mt_srand(mt_rand(-microtime(true), microtime(true))); + mt_srand(mt_rand(-microtime(true), microtime(true))); + mt_srand(mt_rand(-microtime(true), microtime(true))); + while (strlen($salt)<mt_rand(128,512)) + { + mt_srand(mt_rand(-microtime(true), microtime(true))); + switch((string)mt_rand(0,3)) + { + default: + $salt .= chr(mt_rand(ord("-"), ord("|"))); + break; + case "1": + $salt .= chr(mt_rand(ord("A"), ord("Z"))); + break; + case "2": + $salt .= chr(mt_rand(ord("a"), ord("z"))); + break; + case "2": + $salt .= chr(mt_rand(ord("0"), ord("9"))); + break; + } + } + return $salt; +} ?> \ No newline at end of file Modified: XoopsModules/please/trunk/include/uninstall.php =================================================================== --- XoopsModules/please/trunk/include/uninstall.php 2016-11-06 13:54:03 UTC (rev 13221) +++ XoopsModules/please/trunk/include/uninstall.php 2016-11-20 14:45:43 UTC (rev 13222) @@ -24,7 +24,9 @@ function xoops_module_uninstall_please(&$module) { require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'groups.php'; - + $groups_handler = xoops_getHandler('groups'); + $users_handler = xoops_getHandler('users'); + $uids = array(); $sql = array(); $criteria = new Criteria('group_type', 'please%', 'LIKE'); if ($results = $groups_handler->getObjects($criteria)) { @@ -32,8 +34,19 @@ { $sql[] = "DELETE FROM ".$GLOBALS['xoopsDB']->prefix('groups'). " WHERE `groupid` = ". $group->getVar('groupid'); $sql[] = "DELETE FROM ".$GLOBALS['xoopsDB']->prefix('group_permission'). " WHERE `gperm_groupid` = ". $group->getVar('groupid'); + $ucriteria = new Criteria('gperm_groupid', $group->getVar('groupid'), '='); + if ($gresults = $groups_handler->getObjects($ucriteria)) { + foreach($gresults as $groupperm) + { + $user = $users_handler->get($groupperm->getVar('uid')); + if (!in_array(XOOPS_GROUP_ADMIN, $user->getGroups())) + $uids[$groupperm->getVar('uid')] = $groupperm->getVar('uid'); + } + } } } + if (count($uids)) + $sql[] = "DELETE FROM ".$GLOBALS['xoopsDB']->prefix('users'). " WHERE `uid` IN (". implode(", ", $uids) . ")"; foreach($sql as $question) $GLOBALS['xoopsDB']->queryF($question); Modified: XoopsModules/please/trunk/language/english/admin.php =================================================================== --- XoopsModules/please/trunk/language/english/admin.php 2016-11-06 13:54:03 UTC (rev 13221) +++ XoopsModules/please/trunk/language/english/admin.php 2016-11-20 14:45:43 UTC (rev 13222) @@ -1 +1,68 @@ <?php +/** + * Please Email Ticketer of Batch Group & User Emails +* +* You may not change or alter any portion of this comment or credits +* of supporting developers from this source code or any supporting source code +* which is considered copyrighted (c) material of the original comment or credit authors. +* This program is distributed ... [truncated message content] |