From: <zy...@us...> - 2014-11-26 07:33:46
|
Revision: 12873 http://sourceforge.net/p/xoops/svn/12873 Author: zyspec Date: 2014-11-26 07:33:36 +0000 (Wed, 26 Nov 2014) Log Message: ----------- - commit files missing in previous commit Modified Paths: -------------- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/log.php Added Paths: ----------- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/blocks/ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/blocks/index.html XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/blocks/stats.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/class/formvalidatedinput.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/include/waiting.plugin.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/blocks.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/help/module_index.html XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/waiting.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/blocks/ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/blocks/contact_block_stats.tpl XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/blocks/index.html Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/log.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/log.php 2014-11-26 07:12:14 UTC (rev 12872) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/log.php 2014-11-26 07:33:36 UTC (rev 12873) @@ -75,7 +75,7 @@ $column = $contact_handler->contactCleanVars($_POST, 'column', 'contact_mail', 'string'); $valid_column = in_array(trim($column), array('contact_icq', 'contact_mail', 'contact_phone', 'contact_url')); $column = ($valid_column) ? trim($column) : 'contact_mail'; - $timestamp = $contact_handler->contactCleanVars($_POST, 'timestamp', formatTimestamp(xoops_getUserTimestamp(time()), _SHORTDATESTRING), 'string'); + $timestamp = $contact_handler->contactCleanVars($_POST, 'timestamp', formatTimestamp(xoops_getUserTimestamp(time()), 's'), 'string'); $log = $contact_handler->contactLogs($column, $timestamp); /* $timestamp = $contact_handler->contactCleanVars($_POST, 'timestamp', xoops_getUserTimestamp(time()), 'date'); Added: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/blocks/index.html =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/blocks/index.html (rev 0) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/blocks/index.html 2014-11-26 07:33:36 UTC (rev 12873) @@ -0,0 +1 @@ +<script>history.go(-1);</script> Added: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/blocks/stats.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/blocks/stats.php (rev 0) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/blocks/stats.php 2014-11-26 07:33:36 UTC (rev 12873) @@ -0,0 +1,80 @@ +<?php +/* + 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. +*/ +/** + * Contact stats.php + * + * Xoops Contact - a database driven Contact form + * Displays contact statistics in a block. + * + * @copyright:: {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license:: {@link http://www.fsf.org/copyleft/gpl.html GNU public license} + * @package:: contact + * @subpackage:: blocks + * @author:: zyspec <owners@zyspec> + * @version:: $Id: $ + * @since:: 1.82 + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +/** + * + * Show Contact Us stats block + * + * @uses xoops_getmodulehandler + * @uses CriteriaCompo + * @uses ContactContact + * @uses ContactContactHandler + * @param array $options + * + * @return array with count of noreplies, replies & total + */ +function b_contact_stats_show($options) +{ + $dirname = basename(dirname(__DIR__)); + + $block = array(); + + $contact_handler =& xoops_getmodulehandler('contact', $dirname); + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('contact_cid', 0)); + $criteria->add(new Criteria('contact_type', 'Contact')); + $criteria->setGroupby('contact_reply'); + $msgCountArray = $contact_handler->getCounts($criteria); + if ((is_array($msgCountArray) && count($msgCountArray) > 0)) { + $block['noreplies'] = (isset($msgCountArray[0])) ? $msgCountArray[0] : 0; + $block[ 'replies'] = (isset($msgCountArray[1])) ? $msgCountArray[1] : 0; + $block[ 'total'] = $block['noreplies'] + $block['replies']; + + // if using departments show number of contacts per department + include_once $GLOBALS['xoops']->path( "modules/{$dirname}/include/functions.php"); +// include_once '../include/functions.php'; + $moduleMgr = contactGetModuleManager(); + if ($moduleMgr->config['form_dept']) { +/* + $module_handler =& xoops_gethandler('module'); + $module =& $module_handler->getByDirname($dirname); + $config_handler =& xoops_gethandler('config'); + $contactConfig =& $config_handler->getConfigsByCat(0, $module->getVar('mid')); + if ($contactConfig['form_dept']) { +*/ + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('contact_cid', 0)); + $criteria->add(new Criteria('contact_type', 'Contact')); + $criteria->setGroupby('contact_department'); + $depts = $contact_handler->getCounts($criteria); + if ((is_array($depts) && count($depts) > 0)) { + $block['depts'] = $depts; + } + } + } + return $block; +} \ No newline at end of file Added: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/class/formvalidatedinput.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/class/formvalidatedinput.php (rev 0) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/class/formvalidatedinput.php 2014-11-26 07:33:36 UTC (rev 12873) @@ -0,0 +1,143 @@ +<?php +/* + 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. +*/ + +/** + * Contact form element for form input + * + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU GPL 2} + * @package contact + * @subpackage class + * @since 1.82 + * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ + * @author ZySpec <ow...@zy...> + * @version $Id: $ + */ + +defined('XOOPS_ROOT_PATH') || die('Restricted access'); + +/** + * A simple HTML5 type validated input field + */ +class ContactFormValidatedInput extends XoopsFormText +{ + + /** + * Initial type + * + * @var string + * @access private + */ + private $_type; + + /** + * Valid HTML Type array + * + * @var string + * @access private + */ + private $_htmlTypes; + + /** + * Constructor + * + * @param string $caption Caption + * @param string $name "name" attribute + * @param int $size Size + * @param int $maxlength Maximum length of text + * @param string $value Initial text + */ + function __construct($caption, $name, $size, $maxlength, $value = '', $type='text') + { + $this->_htmlTypes = array('color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'number', 'range', + 'search', 'tel', 'text', 'time', 'url', 'week'); + $this->setCaption($caption); + $this->setName($name); + $this->_size = intval($size); + $this->_maxlength = intval($maxlength); + $this->setValue($value); + $this->setType($type); + } + + function ContactFormValidatedInput(&$caption, &$name, &$size, &$maxlength, &$value = '', &$type) + { + self::__construct($caption, $name, $size, $maxlength, $value, $type); + } + + /** + * + * XoopsFormText method is included here as an override for the base class (XoopsFormText) + */ + function XoopsFormText(&$caption, &$name, &$size, &$maxlength, $value='') + { + self::__construct($caption, $name, $size, $maxlength, $value, 'text'); + } + + /** + * Get type information value + * + * @return string + */ + function getType() + { + return $this->_type; + } + + /** + * Get HTML types supported + * + * @return array + */ + function getHtmlTypes() + { + return $this->_htmlTypes; + } + + /** + * Set initial text value + * + * @param string|array $value is string, set value; value is array then keys are ('type', 'min', 'max') + */ + function setType($value) + { + if (isset($value)) { + if (is_array($value)) { + $value = isset($value['type']) ? mb_strtolower($value['type']) : 'text'; + $this->_type = in_array($value, $this->_htmlTypes) ? $value : 'text'; + if (in_array($value['type'], array('number', 'date', 'range'))) { + if (isset($value['min'])) { + $this->setExtra("min=" . $value['min']); + } + if (isset($value['max'])) { + $this->setExtra("max=" . $value['max']); + } + } + } else { + $value = isset($value) ? mb_strtolower($value) : 'text'; + $this->_type = in_array($value, $this->_htmlTypes) ? $value : 'text'; + } + } else { + $this->_type = 'text'; + } + } + + /** + * Prepare HTML for output + * + * @return string HTML + */ + function render() + { + $myClasses = $this->getClass(); + $classes = ($myClasses) ? " class='{$myClasses}'" : ""; + return "<input type='" . $this->_type . "' name='" . $this->getName() . "' title='" . $this->getTitle() . "' id='" . $this->getName() . "' size='" . $this->getSize() . "' maxlength='" . $this->getMaxlength() . "' value='" . $this->getValue() . "'" . $classes . $this->getExtra() . " />"; + } +} Added: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/include/waiting.plugin.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/include/waiting.plugin.php (rev 0) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/include/waiting.plugin.php 2014-11-26 07:33:36 UTC (rev 12873) @@ -0,0 +1,51 @@ +<?php +/* + 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. +*/ +/** + * Contact - waiting.php + * + * English language defines for Waiting Module support + * + * @copyright:: {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license:: {@link http://www.fsf.org/copyleft/gpl.html GNU public license} + * @package:: contact + * @subpackage:: plugin + * @author:: XOOPS Module Development Team + * @since:: 1.82 + * @version:: $Id: $ + */ +function b_waiting_contact() +{ +// $contactDB =& XoopsDatabaseFactory::getDatabaseConnection(); + + $block = array(); + + $module_handler =&xoops_gethandler('module'); + $contactModule =&$module_handler->getByDirname('contact'); + $config_handler =& xoops_gethandler('config'); + $contactModuleConfigs =& $config_handler->getConfigsByCat(0, $contactModule->getVar('mid')); + + //check to see if module is active, return if not... + if ($contactModule->isactive()) { + // setup the contact messages + $contact_handler = & xoops_getModuleHandler('contact', 'contact'); + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('contact_cid', 0, '=')); //don't include replies + $criteria->add(new Criteria('contact_reply', 0, '=')); // only include messages that haven't had a reply + $messageCount = $contact_handler->getCount($criteria); + if ($messageCount) { + $block = array('adminlink' => $GLOBALS['xoops']->url("www/modules/contact/admin/contact.php"), + 'pendingnum' => $messageCount, + 'lang_linkname' => _PI_CONTACT_WAITING_REPLY + ); + } + } + return $block; +} Added: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/blocks.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/blocks.php (rev 0) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/blocks.php 2014-11-26 07:33:36 UTC (rev 12873) @@ -0,0 +1,27 @@ +<?php +/* + 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. +*/ +/** + * Contact - blocks.php + * + * English language defines for Waiting Module Blocks + * + * @copyright:: {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license:: {@link http://www.fsf.org/copyleft/gpl.html GNU public license} + * @package:: contact + * @subpackage:: library + * @author:: XOOPS Module Development Team + * @since:: 1.82 + * @version:: $Id: $ + */ +define('_MB_CONTACT_REPLIES', "Replies"); +define('_MB_CONTACT_NOREPLIES', "No Replies"); +define('_MB_CONTACT_TOTAL', "Total"); +define('_MB_CONTACT_BYDEPT', "By Department"); Added: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/help/module_index.html =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/help/module_index.html (rev 0) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/help/module_index.html 2014-11-26 07:33:36 UTC (rev 12873) @@ -0,0 +1,22 @@ +<div id="help-template" class="outer"> + <h1 class="head">Help: + <a class="ui-corner-all tooltip" href="<{$xoops_url}>/modules/contact/admin/index.php" + title="Back to the administration of Contact"> Contact + <img src="<{xoAdminIcons home.png}>" + alt="Back to the Administration of Contact"/> + </a></h1> + + <h4 class="odd">Contact Module</h4> + <p style='margin: 1em 0;'>This module includes the following features:</p> + <ul> + <li style='height: 1.3em;'>Automatically emails contact form to requested contact</li> + <li style='height: 1.3em;'>Allows Administrator to reply to message from module control panel</li> + <li style='height: 1.3em;'>Stores Contact submission in database</li> + <li style='height: 1.3em;'>Allows Administrator to select type of information to collect (URL, Company Name, Location, Address, Phone, etc.) + <li style='height: 1.3em;'>Supports contacting departments</li> + <li style='height: 1.3em;'>Form Captcha based on site settings</li> + <li style='height: 1.3em;'>Ability to require anonymous users to enter email twice on form to ensure it was entered correctly</li> + <li style='height: 1.3em;'>Provides log of users who have filled out Contact form</li> + <li style='height: 1.3em;'>Allows Administrator to prune (delete) messages from the database</li> + </ul> +</div> \ No newline at end of file Added: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/waiting.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/waiting.php (rev 0) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/waiting.php 2014-11-26 07:33:36 UTC (rev 12873) @@ -0,0 +1,24 @@ +<?php +/* + 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. +*/ +/** + * Contact - waiting.php + * + * English language defines for Waiting Module support + * + * @copyright:: {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license:: {@link http://www.fsf.org/copyleft/gpl.html GNU public license} + * @package:: contact + * @subpackage:: library + * @author:: XOOPS Module Development Team + * @since:: 1.82 + * @version:: $Id: $ + */ +define('_PI_CONTACT_WAITING_REPLY', "Waiting Replies"); Added: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/blocks/contact_block_stats.tpl =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/blocks/contact_block_stats.tpl (rev 0) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/blocks/contact_block_stats.tpl 2014-11-26 07:33:36 UTC (rev 12873) @@ -0,0 +1,11 @@ +<ul> +<li><{$block.replies}> : <{$smarty.const._MB_CONTACT_REPLIES}></li> +<li><{$block.noreplies}> : <{$smarty.const._MB_CONTACT_NOREPLIES}></li> +<li><{$block.total}> : <{$smarty.const._MB_CONTACT_TOTAL}></li> +</ul> +<div class='inline bolder'><{$smarty.const._MB_CONTACT_BYDEPT}></div> +<{foreach from=$block.depts key=dept item=qty name=deptlp}> +<{if $smarty.foreach.deptlp.first}><ul><{/if}> +<li><{$dept}> : <{$qty}></li> +<{if $smarty.foreach.deptlp.last}></ul><{/if}> +<{/foreach}> Added: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/blocks/index.html =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/blocks/index.html (rev 0) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/blocks/index.html 2014-11-26 07:33:36 UTC (rev 12873) @@ -0,0 +1 @@ +<script>history.go(-1);</script> |