From: <wis...@us...> - 2017-08-23 20:06:32
|
Revision: 13276 http://sourceforge.net/p/xoops/svn/13276 Author: wishcraft Date: 2017-08-23 20:06:29 +0000 (Wed, 23 Aug 2017) Log Message: ----------- Cleaning up errors in SQL and defintions! Modified Paths: -------------- XoopsModules/consent/trunk/modules/consent/class/agreements.php XoopsModules/consent/trunk/modules/consent/class/callbacks.php XoopsModules/consent/trunk/modules/consent/class/emails.php XoopsModules/consent/trunk/modules/consent/class/guardians.php XoopsModules/consent/trunk/modules/consent/class/statistics.php XoopsModules/consent/trunk/modules/consent/header.php XoopsModules/consent/trunk/modules/consent/include/enumerators/response-waiting__agreements.diz XoopsModules/consent/trunk/modules/consent/include/functions.php XoopsModules/consent/trunk/modules/consent/language/english/errors.php XoopsModules/consent/trunk/modules/consent/sql/mysqli.sql XoopsModules/consent/trunk/modules/consent/templates/pdf/clientel-consent.html XoopsModules/consent/trunk/modules/consent/templates/pdf/guardian-consent.html XoopsModules/consent/trunk/modules/consent/xoops_version.php Added Paths: ----------- XoopsModules/consent/trunk/modules/consent/class/clientels.php XoopsModules/consent/trunk/modules/consent/index.php XoopsModules/consent/trunk/modules/consent/language/english/main.php XoopsModules/consent/trunk/modules/consent/templates/index-agreement-created.html XoopsModules/consent/trunk/modules/consent/templates/index-subscribe-consent.html XoopsModules/consent/trunk/modules/consent/wizard.php Modified: XoopsModules/consent/trunk/modules/consent/class/agreements.php =================================================================== --- XoopsModules/consent/trunk/modules/consent/class/agreements.php 2017-08-23 16:11:38 UTC (rev 13275) +++ XoopsModules/consent/trunk/modules/consent/class/agreements.php 2017-08-23 20:06:29 UTC (rev 13276) @@ -18,12 +18,13 @@ * @link http://internetfounder.wordpress.com */ -if (!defined('_MD_consent_MODULE_DIRNAME')) { +if (!defined('_MD_CONSENT_MODULE_DIRNAME')) { return false; } //* require_once (__DIR__ . DIRECTORY_SEPARATOR . 'objects.php'); +require_once (__DIR__ . DIRECTORY_SEPARATOR . 'xcp' . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'xcp.class.php'); /** * Database Table for Agreements in Legal Consent Module @@ -36,27 +37,27 @@ * `uid` int(13) NOT NULL DEFAULT '0', * `approval` enum('Waiting','Approved','Unapproved') NOT NULL DEFAULT 'Waiting', * `batch-id` int(20) NOT NULL DEFAULT '0', - * `gardian-id` int(20) NOT NULL DEFAULT '0', + * `guardian-id` int(20) NOT NULL DEFAULT '0', * `clientel-id` int(20) NOT NULL DEFAULT '0', * `hashkey` varchar(12) NOT NULL DEFAULT '', * `referee` varchar(18) NOT NULL DEFAULT '', * `callback-url` varchar(255) NOT NULL DEFAULT '', * `svn-paths` longtext, - * `gardian-filename-pdf` varchar(128) NOT NULL DEFAULT '', + * `guardian-filename-pdf` varchar(128) NOT NULL DEFAULT '', * `clientel-filename-pdf` varchar(128) NOT NULL DEFAULT '', - * `gardian-response-file` varchar(128) NOT NULL DEFAULT '', + * `guardian-response-file` varchar(128) NOT NULL DEFAULT '', * `clientel-response-file` varchar(128) NOT NULL DEFAULT '', - * `response-waiting` enum('Gardian','Clientel','Both') NOT NULL DEFAULT 'Both', - * `response-sourced` enum('Gardian','Clientel','Both') NOT NULL DEFAULT 'Both', + * `response-waiting` enum('Guardian','Clientel','Both','None') NOT NULL DEFAULT 'Both', + * `response-sourced` enum('Guardian','Clientel','Both') NOT NULL DEFAULT 'Both', * `response-comment` longtext, * `response-network` longtext, * `response-notified` int(11) NOT NULL DEFAULT '0', * `response-weight` int(11) NOT NULL DEFAULT '0', - * `response-gardian-weight` int(11) NOT NULL DEFAULT '0', + * `response-guardian-weight` int(11) NOT NULL DEFAULT '0', * `response-clientel-weight` int(11) NOT NULL DEFAULT '0', * `email-ids` longtext, - * `email-agreement-type` enum('None','Gardian','Clientel','Both') NOT NULL DEFAULT 'Both', - * `email-recovery-type` enum('None','Gardian','Clientel','Batch') NOT NULL DEFAULT 'None', + * `email-agreement-type` enum('None','Guardian','Clientel','Both') NOT NULL DEFAULT 'Both', + * `email-recovery-type` enum('None','Guardian','Clientel','Batch') NOT NULL DEFAULT 'None', * `email-recovery-guardian-sent` int(11) NOT NULL DEFAULT '0', * `email-recovery-clientel-sent` int(11) NOT NULL DEFAULT '0', * `email-from` varchar(64) NOT NULL DEFAULT '', @@ -64,9 +65,9 @@ * `email-sent` int(11) NOT NULL DEFAULT '0', * `email-views` int(11) NOT NULL DEFAULT '0', * `email-viewed` int(11) NOT NULL DEFAULT '0', - * `email-gardian-sent` int(11) NOT NULL DEFAULT '0', - * `email-gardian-views` int(11) NOT NULL DEFAULT '0', - * `email-gardian-viewed` int(11) NOT NULL DEFAULT '0', + * `email-guardian-sent` int(11) NOT NULL DEFAULT '0', + * `email-guardian-views` int(11) NOT NULL DEFAULT '0', + * `email-guardian-viewed` int(11) NOT NULL DEFAULT '0', * `email-clientel-sent` int(11) NOT NULL DEFAULT '0', * `email-clientel-views` int(11) NOT NULL DEFAULT '0', * `email-clientel-viewed` int(11) NOT NULL DEFAULT '0', @@ -86,7 +87,7 @@ * `reminded` int(11) NOT NULL DEFAULT '0', * `timeout` int(11) NOT NULL DEFAULT '0', * PRIMARY KEY (`id`), - * KEY `SEARCH` (`approval`,`batch-id`,`gardian-id`,`clientel-id`,`hashkey`,`email-agreement-type`,`created`,`emailed`,`response`,`reminde`,`timeout`) USING BTREE KEY_BLOCK_SIZE=32 + * KEY `SEARCH` (`approval`,`batch-id`,`guardian-id`,`clientel-id`,`hashkey`,`email-agreement-type`,`created`,`emailed`,`response`,`reminde`,`timeout`) USING BTREE KEY_BLOCK_SIZE=32 * ) ENGINE=InnoDB DEFAULT CHARSET=utf8; * </code> * @author Simon Roberts (wis...@us...) @@ -105,15 +106,15 @@ self::initVar('uid', XOBJ_DTYPE_INT, null, false); self::initVar('approval', XOBJ_DTYPE_ENUM, 'Waiting', false, false, false, consentEnumeratorValues(basename(__FILE__), 'approval')); self::initVar('batch-id', XOBJ_DTYPE_INT, null, false); - self::initVar('gardian-id', XOBJ_DTYPE_INT, null, false); + self::initVar('guardian-id', XOBJ_DTYPE_INT, null, false); self::initVar('clientel-id', XOBJ_DTYPE_INT, null, false); self::initVar('hashkey', XOBJ_DTYPE_TXTBOX, null, false, 12); self::initVar('referee', XOBJ_DTYPE_TXTBOX, null, false, 18); self::initVar('callback-url', XOBJ_DTYPE_TXTBOX, null, false, 255); self::initVar('svn-paths', XOBJ_DTYPE_ARRAY, array(), false); - self::initVar('gardian-filename-pdf', XOBJ_DTYPE_TXTBOX, null, false, 128); + self::initVar('guardian-filename-pdf', XOBJ_DTYPE_TXTBOX, null, false, 128); self::initVar('clientel-filename-pdf', XOBJ_DTYPE_TXTBOX, null, false, 128); - self::initVar('gardian-response-file', XOBJ_DTYPE_TXTBOX, null, false, 128); + self::initVar('guardian-response-file', XOBJ_DTYPE_TXTBOX, null, false, 128); self::initVar('clientel-response-file', XOBJ_DTYPE_TXTBOX, null, false, 128); self::initVar('response-waiting', XOBJ_DTYPE_ENUM, 'Both', false, false, false, consentEnumeratorValues(basename(__FILE__), 'response-waiting')); self::initVar('response-sourced', XOBJ_DTYPE_ENUM, 'Both', false, false, false, consentEnumeratorValues(basename(__FILE__), 'response-sourced')); @@ -121,7 +122,7 @@ self::initVar('response-network', XOBJ_DTYPE_ARRAY, array(), false); self::initVar('response-notified', XOBJ_DTYPE_INT, null, false); self::initVar('response-weight', XOBJ_DTYPE_INT, null, false); - self::initVar('response-gardian-weight', XOBJ_DTYPE_INT, null, false); + self::initVar('response-guardian-weight', XOBJ_DTYPE_INT, null, false); self::initVar('response-clientel-weight', XOBJ_DTYPE_INT, null, false); self::initVar('email-ids', XOBJ_DTYPE_ARRAY, array(), false); self::initVar('email-agreement-type', XOBJ_DTYPE_ENUM, 'Both', false, false, false, consentEnumeratorValues(basename(__FILE__), 'email-agreement-type')); @@ -133,9 +134,9 @@ self::initVar('email-sent', XOBJ_DTYPE_INT, null, false); self::initVar('email-views', XOBJ_DTYPE_INT, null, false); self::initVar('email-viewed', XOBJ_DTYPE_INT, null, false); - self::initVar('email-gardian-sent', XOBJ_DTYPE_INT, null, false); - self::initVar('email-gardian-views', XOBJ_DTYPE_INT, null, false); - self::initVar('email-gardian-viewed', XOBJ_DTYPE_INT, null, false); + self::initVar('email-guardian-sent', XOBJ_DTYPE_INT, null, false); + self::initVar('email-guardian-views', XOBJ_DTYPE_INT, null, false); + self::initVar('email-guardian-viewed', XOBJ_DTYPE_INT, null, false); self::initVar('email-clientel-sent', XOBJ_DTYPE_INT, null, false); self::initVar('email-clientel-views', XOBJ_DTYPE_INT, null, false); self::initVar('email-clientel-viewed', XOBJ_DTYPE_INT, null, false); @@ -173,7 +174,19 @@ */ class consentAgreementsHandler extends consentXoopsObjectHandler { - + + /** + * + * @var integer + */ + var $created = 0; + + /** + * + * @var integer + */ + var $existing = 0; + /** * Table Name without prefix used @@ -209,5 +222,193 @@ $db = $GLOBAL["xoopsDB"]; parent::__construct($db, $this->tbl, $this->child, $this->identity, $this->envalued); } + + /** + * Checks the form from a submission of the subscription form after being submited + * + * @param array $result + * @param string $errors_array + */ + static public function checkSubscriptionForm($result = array(), $errors_array = false) + { + static $errors = array(); + if (empty($errors)) + { + if (empty($result['guardian-name']) || strlen(trim($result['guardian-name'])) == 0) + $errors['guardian-name'] = _ERR_CONSENT_FORM_GUARDIAN_NAME_MISSING; + if (empty($result['guardian-phone']) || strlen(trim($result['guardian-phone'])) == 0) + $errors['guardian-phone'] = _ERR_CONSENT_FORM_GUARDIAN_PHONE_MISSING; + if (empty($result['guardian-email']) || strlen(trim($result['guardian-email'])) == 0) + $errors['guardian-email'] = _ERR_CONSENT_FORM_GUARDIAN_EMAIL_MISSING; + if (!empty($result['guardian-phone']) && strlen(consentToNumeric($result['guardian-phone'])) < 10) + $errors['guardian-phone'] = _ERR_CONSENT_FORM_GUARDIAN_PHONE_WRONGLENGTH; + if (!empty($result['guardian-name']) && count(explode(' ', $result['guardian-name'])) < 2) + $errors['guardian-name'] = _ERR_CONSENT_FORM_GUARDIAN_NAME_MALFORMED; + if (!empty($result['guardian-email']) && !checkEmail($result['guardian-email'])) + $errors['guardian-email'] = _ERR_CONSENT_FORM_GUARDIAN_EMAIL_MALFORMED; + if (empty($result['clientel-name']) || strlen(trim($result['clientel-name'])) == 0) + $errors['clientel-name'] = _ERR_CONSENT_FORM_CLIENTEL_NAME_MISSING; + if (empty($result['clientel-phone']) || strlen(trim($result['clientel-phone'])) == 0) + $errors['clientel-phone'] = _ERR_CONSENT_FORM_CLIENTEL_PHONE_MISSING; + if (empty($result['clientel-email']) || strlen(trim($result['clientel-email'])) == 0) + $errors['clientel-email'] = _ERR_CONSENT_FORM_CLIENTEL_EMAIL_MISSING; + if (!empty($result['clientel-name']) && count(explode(' ', $result['clientel-name'])) < 2) + $errors['clientel-name'] = _ERR_CONSENT_FORM_CLIENTEL_NAME_MALFORMED; + if (!empty($result['clientel-phone']) && strlen(consentToNumeric($result['clientel-phone'])) < 10) + $errors['clientel-phone'] = _ERR_CONSENT_FORM_CLIENTEL_PHONE_WRONGLENGTH; + if (!empty($result['clientel-email']) && !checkEmail($result['clientel-email'])) + $errors['clientel-email'] = _ERR_CONSENT_FORM_CLIENTEL_EMAIL_MALFORMED; + + $agreementsHandler = $this; + $guardiansHandler = xoops_getModuleHandler('guardians', _MD_CONSENT_MODULE_DIRNAME); + $clientelsHandler = xoops_getModuleHandler('clientels', _MD_CONSENT_MODULE_DIRNAME); + $guardianscriteria = new Criteria('email', $result['guardian-email']); + $clientelscriteria = new Criteria('email', $result['clientel-email']); + $guardianids = $guardiansHandler->getIds($guardianscriteria); + $clientelids = $clientelsHandler->getIds($clientelscriteria); + if (count($guardianids) > 0 && count($clientelids) > 0) + { + $criteria = new CriteriaCompo(new Criteria('guardian-id', "(" . implode(", ", $guardianids) . ')', "IN")); + $criteria->add(new Criteria('clientel-id', "(" . implode(", ", $clientelids) . ')', 'IN')); + $criteria->add(new Criteria('approval', 'Waiting')); + $criteria->add(new Criteria('response-waiting', "('Guardian','Clientel','Both')", "IN")); + $criteria->add(new Criteria('timeout', time(), ">=")); + if ($agreementsHandler->getCount($criteria) > 0) + $errors['agreements'] = _ERR_CONSENT_FORM_AGREEMENT_EXISTINGINQUEUE; + } + } + if ($errors_array == false && empty($errors)) + return true; + elseif ($errors_array == false && !empty($errors)) + return false; + else + return $errors; + } + + + /** + * Get's the error array for a form checked on submission of the subscription form + * + * @param array $result + */ + static public function errorsSubscriptionForm($result = array()) + { + return self::checkSubscriptionForm($result, true); + } + + + /** + * Get the subscription to consent form for submission + * + * @param array $result + */ + static public function getSubscriptionForm($result = array()) + { + if (!isset($result['guardian-name']) || empty($result['guardian-name']) && (!empty($_SESSION[_MD_CONSENT_MODULE_DIRNAME]['guardian']['name']) || !empty($_COOKIE[_MD_CONSENT_MODULE_DIRNAME . '-guardian-name']))) + { + if (!empty($_SESSION[_MD_CONSENT_MODULE_DIRNAME]['guardian']['name'])) + $result['guardian-name'] = $_SESSION[_MD_CONSENT_MODULE_DIRNAME]['guardian']['name']; + elseif (!empty($_COOKIE[_MD_CONSENT_MODULE_DIRNAME . '-guardian-name'])) + $result['guardian-name'] = $_COOKIE[_MD_CONSENT_MODULE_DIRNAME . '-guardian-name']; + } + if (!isset($result['guardian-phone']) || empty($result['guardian-phone']) && (!empty($_SESSION[_MD_CONSENT_MODULE_DIRNAME]['guardian']['phone']) || !empty($_COOKIE[_MD_CONSENT_MODULE_DIRNAME . '-guardian-phone']))) + { + if (!empty($_SESSION[_MD_CONSENT_MODULE_DIRNAME]['guardian']['phone'])) + $result['guardian-phone'] = $_SESSION[_MD_CONSENT_MODULE_DIRNAME]['guardian']['phone']; + elseif (!empty($_COOKIE[_MD_CONSENT_MODULE_DIRNAME . '-guardian-phone'])) + $result['guardian-phone'] = $_COOKIE[_MD_CONSENT_MODULE_DIRNAME . '-guardian-phone']; + } + if (!isset($result['guardian-email']) || empty($result['guardian-email']) && (!empty($_SESSION[_MD_CONSENT_MODULE_DIRNAME]['guardian']['email']) || !empty($_COOKIE[_MD_CONSENT_MODULE_DIRNAME . '-guardian-email']))) + { + if (!empty($_SESSION[_MD_CONSENT_MODULE_DIRNAME]['guardian']['email'])) + $result['guardian-email'] = $_SESSION[_MD_CONSENT_MODULE_DIRNAME]['guardian']['email']; + elseif (!empty($_COOKIE[_MD_CONSENT_MODULE_DIRNAME . '-guardian-email'])) + $result['guardian-email'] = $_COOKIE[_MD_CONSENT_MODULE_DIRNAME . '-guardian-email']; + } + + if (!empty($result['timeout']) && is_string($result['timeout']) && !is_numeric($result['timeout'])) + $result['timeout'] = strtotime($result['timeout'], time()); + + xoops_load('XoopsThemeForm'); + + $form = new XoopsThemeForm(_MN_CONSENT_FORM_SUBCRIPTION, _MD_CONSENT_MODULE_DIRNAME . '-subsription', $_SERVER['REQUEST_URI'], 'post'); + $form->setExtra('enctype="multipart/form-data"'); + $formobj = array(); + $eletray = array(); + $sformobj = array(); + + $formobj['guardian-name'] = new XoopsFormText(_MN_CONSENT_FORM_GUARDIAN_NAME, 'guardian-name', 35, 64, $result['guardian-name']); + $formobj['guardian-name']->setDescription(_MN_CONSENT_FORM_GUARDIAN_NAME_DESC); + $formobj['guardian-email'] = new XoopsFormText(_MN_CONSENT_FORM_GUARDIAN_EMAIL, 'guardian-email', 35, 196, $result['guardian-email']); + $formobj['guardian-email']->setDescription(_MN_CONSENT_FORM_GUARDIAN_EMAIL_DESC); + $formobj['guardian-phone'] = new XoopsFormText(_MN_CONSENT_FORM_GUARDIAN_PHONE, 'guardian-phone', 15, 20, $result['guardian-phone']); + $formobj['guardian-phone']->setDescription(_MN_CONSENT_FORM_GUARDIAN_PHONE_DESC); + $formobj['clientel-name'] = new XoopsFormText(_MN_CONSENT_FORM_CLIENTEL_NAME, 'clientel-name', 35, 64, $result['clientel-name']); + $formobj['clientel-name']->setDescription(_MN_CONSENT_FORM_CLIENTEL_NAME_DESC); + $formobj['clientel-email'] = new XoopsFormText(_MN_CONSENT_FORM_CLIENTEL_EMAIL, 'clientel-email', 35, 196, $result['clientel-email']); + $formobj['clientel-email']->setDescription(_MN_CONSENT_FORM_CLIENTEL_EMAIL_DESC); + $formobj['clientel-phone'] = new XoopsFormText(_MN_CONSENT_FORM_CLIENTEL_PHONE, 'clientel-phone', 15, 20, $result['clientel-phone']); + $formobj['clientel-phone']->setDescription(_MN_CONSENT_FORM_CLIENTEL_PHONE_DESC); + $formobj['timeout'] = new XoopsFormTextDateSelect(_MN_CONSENT_FORM_TIMEOUT, 'timeout', 15, (empty($result['timeout'])? time() + (60*60*24*14): $result['timeout'])); + $formobj['timeout']->setDescription(_MN_CONSENT_FORM_TIMEOUT_DESC); + $formobj['callback-url'] = new XoopsFormText(_MN_CONSENT_FORM_CALLBACK_URL, 'callback-url', 35, 196, $result['callback-url']); + $formobj['callback-url']->setDescription(sprintf(_MN_CONSENT_FORM_CALLBACK_URL_DESC, XOOPS_URL . '/modules/' . _MD_CONSENT_MODULE_DIRNAME . '/callback-example.php')); + $eletray['buttons'] = new XoopsFormElementTray('', ' '); + $sformobj['buttons']['save'] = new XoopsFormButton('', 'submit', _SUBMIT, 'submit'); + $eletray['buttons']->addElement($sformobj['buttons']['save']); + $formobj['buttons'] = $eletray['buttons']; + + $required = array('timeout', 'guardian-name', 'guardian-email', 'guardian-phone', 'clientel-name', 'clientel-email', 'clientel-phone'); + foreach($formobj as $id => $obj) + if (in_array($id, $required)) + $sform->addElement($formobj[$id], true); + else + $sform->addElement($formobj[$id], false); + + $form->addElement(new XoopsFormHidden('op', 'make-agreement')); + return $form->render(); + } + + + /** + * Inserts a New Agreement + * + * @param consentAgreements $object + * @param string $force + * @return unknown + */ + public static function insert(consentAgreements $object, $force = true) + { + if ($object->isNew()) + { + $criteria = new CriteriaCompo(new Criteria('guardian-id', $object->getVar('guardian-id'))); + $criteria->add(new Criteria('clientel-id', $object->getVar('clientel-id'))); + $criteria->add(new Criteria('approval', 'Waiting')); + $criteria->add(new Criteria('response-waiting', "('Guardian','Clientel','Both')", "IN")); + $criteria->add(new Criteria('timeout', time(), ">=")); + if ($this->getCount($criteria)>0) + { + $objs = $this->getObjects($criteria); + if (is_object($objs[0]) && isset($objs[0])) + { + $this->existing++; + return $objs[0]->getVar($this->identity); + } + } + $this->created++; + $object->setVar('created', time()); + $object->setVar('approval', 'Waiting'); + $crc = new xcp($data = $this->created.$object->getVar('uid').$object->getVar('created').$object->getVar('guardian-id').$object->getVar('clientel-id').$object->getVar('batch-id'), mt_rand(0,255), mt_rand(4,10)); + $object->setVar('hashkey', $crc->crc); + $criteria = new CriteriaCompo(new Criteria('1', '1')); + $object->setVar('referee', consentStripeReferee($referee = ($consentConfigsList['agreement-referee'] + $this->getCount($criteria)), 3, strlen($referee))); + if ($object->getVar('timeout') < time()) + $object->setVar('timeout', time() + (3600*24*21)); + $daysdiff = $object->getVar('timeout') - $object->getVar('created') / (3600*24); + $remind = floor($daysdiff / mt_rand(3,7)); + $object->setVar('reminded', time() + (3600*24*$remind)); + } + return parent::insert($object, $force); + } } ?> \ No newline at end of file Modified: XoopsModules/consent/trunk/modules/consent/class/callbacks.php =================================================================== --- XoopsModules/consent/trunk/modules/consent/class/callbacks.php 2017-08-23 16:11:38 UTC (rev 13275) +++ XoopsModules/consent/trunk/modules/consent/class/callbacks.php 2017-08-23 20:06:29 UTC (rev 13276) @@ -18,7 +18,7 @@ * @link http://internetfounder.wordpress.com */ -if (!defined('_MD_consent_MODULE_DIRNAME')) { +if (!defined('_MD_CONSENT_MODULE_DIRNAME')) { return false; } Added: XoopsModules/consent/trunk/modules/consent/class/clientels.php =================================================================== --- XoopsModules/consent/trunk/modules/consent/class/clientels.php (rev 0) +++ XoopsModules/consent/trunk/modules/consent/class/clientels.php 2017-08-23 20:06:29 UTC (rev 13276) @@ -0,0 +1,179 @@ +<?php +/** + * Legal Consent is a module for obtain legal guardianship consent + * + * 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://fonts2web.org.uk + * @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) + * @author Simon Roberts (wishcraft) <wis...@us...> + * @subpackage consent + * @description Legal Consent is a module for obtain legal guardianship consent + * @version 1.0.1 + * @link http://internetfounder.wordpress.com + */ + +if (!defined('_MD_CONSENT_MODULE_DIRNAME')) { + return false; +} + +//* +require_once (__DIR__ . DIRECTORY_SEPARATOR . 'objects.php'); +require_once (__DIR__ . DIRECTORY_SEPARATOR . 'xcp' . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'xcp.class.php'); + +/** + * Database Table for Clientels in Legal Consent Module + * + * For Table:- + * <code> + * CREATE TABLE `consent_clientels` ( + * `id` int(20) NOT NULL AUTO_INCREMENT, + * `uid` int(13) NOT NULL DEFAULT '0', + * `hashkey` varchar(12) NOT NULL DEFAULT '', + * `name` varchar(64) NOT NULL DEFAULT '', + * `email` varchar(196) NOT NULL DEFAULT '', + * `phone` varchar(20) NOT NULL DEFAULT '', + * `created` int(11) NOT NULL DEFAULT '0', + * `emailed` int(11) NOT NULL DEFAULT '0', + * `response` int(11) NOT NULL DEFAULT '0', + * `undelivered` int(11) NOT NULL DEFAULT '0', + * `recovered` int(11) NOT NULL DEFAULT '0', + * `recovery-id` int(20) NOT NULL DEFAULT '0', + * `agreement-ids` longtext, + * `email-views` int(11) NOT NULL DEFAULT '0', + * `email-viewed` int(11) NOT NULL DEFAULT '0', + * PRIMARY KEY (`id`), + * KEY `SEARCH` (`hashkey`,`name`,`email`,`phone`) USING BTREE KEY_BLOCK_SIZE=32 + * ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + * </code> + * @author Simon Roberts (wis...@us...) + * @copyright copyright (c) 2015 labs.coop + */ +class consentClientels extends consentXoopsObject +{ + + var $handler = 'consentClientelsHandler'; + + function __construct($id = null) + { + + self::initVar('id', XOBJ_DTYPE_INT, null, false); + self::initVar('uid', XOBJ_DTYPE_INT, null, false); + self::initVar('hashkey', XOBJ_DTYPE_TXTBOX, null, false, 12); + self::initVar('name', XOBJ_DTYPE_TXTBOX, null, false, 64); + self::initVar('email', XOBJ_DTYPE_TXTBOX, null, false, 196); + self::initVar('phone', XOBJ_DTYPE_TXTBOX, null, false, 20); + self::initVar('created', XOBJ_DTYPE_INT, null, false); + self::initVar('emailed', XOBJ_DTYPE_INT, null, false); + self::initVar('response', XOBJ_DTYPE_INT, null, false); + self::initVar('undelivered', XOBJ_DTYPE_INT, null, false); + self::initVar('recovered', XOBJ_DTYPE_INT, null, false); + self::initVar('recovery-id', XOBJ_DTYPE_INT, null, false); + self::initVar('agreement-ids', XOBJ_DTYPE_ARRAY, array(), false); + self::initVar('email-views', XOBJ_DTYPE_INT, null, false); + self::initVar('email-viewed', XOBJ_DTYPE_INT, null, false); + + if (!empty($id) && !is_null($id)) + { + $handler = new $this->handler; + self::assignVars($handler->get($id)->getValues(array_keys($this->vars))); + } + + } + +} + + +/** + * Handler Class for Clientels + * @author Simon Roberts (wis...@us...) + * @copyright copyright (c) 2015 labs.coop + */ +class consentClientelsHandler extends consentXoopsObjectHandler +{ + + /** + * + * @var integer + */ + var $created = 0; + + /** + * + * @var integer + */ + var $existing = 0; + + /** + * Table Name without prefix used + * + * @var string + */ + var $tbl = 'consent_clientels'; + + /** + * Child Object Handling Class + * + * @var string + */ + var $child = 'consentClientels'; + + /** + * Child Object Identity Key + * + * @var string + */ + var $identity = 'id'; + + /** + * Child Object Default Envaluing Costs + * + * @var string + */ + var $envalued = 'value'; + + function __construct(&$db) + { + if (!is_object($db)) + $db = $GLOBAL["xoopsDB"]; + parent::__construct($db, $this->tbl, $this->child, $this->identity, $this->envalued); + } + + /** + * Inserts a New Clientel + * + * @param consentClientels $object + * @param string $force + * @return unknown + */ + public static function insert(consentClientels $object, $force = true) + { + if ($object->isNew()) + { + $criteria = new CriteriaCompo(new Criteria('name', $object->getVar('name'))); + $criteria->add(new Criteria('email', $object->getVar('email'))); + $criteria->add(new Criteria('phone', $object->getVar('phone'))); + $criteria->add(new Criteria('uid', $object->getVar('uid'))); + if ($this->getCount($criteria)>0) + { + $objs = $this->getObjects($criteria); + if (is_object($objs[0]) && isset($objs[0])) + { + $this->existing++; + return $objs[0]->getVar($this->identity); + } + } + $this->created++; + $object->setVar('created', time()); + $crc = new xcp($data = $this->created.$object->getVar('uid').$object->getVar('created').$object->getVar('name').$object->getVar('email').$object->getVar('phone'), mt_rand(0,255), mt_rand(4,10)); + $object->setVar('hashkey', $crc->crc); + } + return parent::insert($object, $force); + } +} +?> \ No newline at end of file Property changes on: XoopsModules/consent/trunk/modules/consent/class/clientels.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Modified: XoopsModules/consent/trunk/modules/consent/class/emails.php =================================================================== --- XoopsModules/consent/trunk/modules/consent/class/emails.php 2017-08-23 16:11:38 UTC (rev 13275) +++ XoopsModules/consent/trunk/modules/consent/class/emails.php 2017-08-23 20:06:29 UTC (rev 13276) @@ -18,7 +18,7 @@ * @link http://internetfounder.wordpress.com */ -if (!defined('_MD_consent_MODULE_DIRNAME')) { +if (!defined('_MD_CONSENT_MODULE_DIRNAME')) { return false; } Modified: XoopsModules/consent/trunk/modules/consent/class/guardians.php =================================================================== --- XoopsModules/consent/trunk/modules/consent/class/guardians.php 2017-08-23 16:11:38 UTC (rev 13275) +++ XoopsModules/consent/trunk/modules/consent/class/guardians.php 2017-08-23 20:06:29 UTC (rev 13276) @@ -18,12 +18,13 @@ * @link http://internetfounder.wordpress.com */ -if (!defined('_MD_consent_MODULE_DIRNAME')) { +if (!defined('_MD_CONSENT_MODULE_DIRNAME')) { return false; } //* require_once (__DIR__ . DIRECTORY_SEPARATOR . 'objects.php'); +require_once (__DIR__ . DIRECTORY_SEPARATOR . 'xcp' . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'xcp.class.php'); /** * Database Table for Guardians in Legal Consent Module @@ -95,9 +96,19 @@ */ class consentGuardiansHandler extends consentXoopsObjectHandler { - - /** + * + * @var integer + */ + var $created = 0; + + /** + * + * @var integer + */ + var $existing = 0; + + /** * Table Name without prefix used * * @var string @@ -131,5 +142,37 @@ $db = $GLOBAL["xoopsDB"]; parent::__construct($db, $this->tbl, $this->child, $this->identity, $this->envalued); } + + /** + * Inserts a New Gardian + * + * @param consentGuardians $object + * @param string $force + * @return unknown + */ + public static function insert(consentGuardians $object, $force = true) + { + if ($object->isNew()) + { + $criteria = new CriteriaCompo(new Criteria('name', $object->getVar('name'))); + $criteria->add(new Criteria('email', $object->getVar('email'))); + $criteria->add(new Criteria('phone', $object->getVar('phone'))); + $criteria->add(new Criteria('uid', $object->getVar('uid'))); + if ($this->getCount($criteria)>0) + { + $objs = $this->getObjects($criteria); + if (is_object($objs[0]) && isset($objs[0])) + { + $this->existing++; + return $objs[0]->getVar($this->identity); + } + } + $this->created++; + $object->setVar('created', time()); + $crc = new xcp($data = $this->created.$object->getVar('uid').$object->getVar('created').$object->getVar('name').$object->getVar('email').$object->getVar('phone'), mt_rand(0,255), mt_rand(4,10)); + $object->setVar('hashkey', $crc->crc); + } + return parent::insert($object, $force); + } } ?> \ No newline at end of file Modified: XoopsModules/consent/trunk/modules/consent/class/statistics.php =================================================================== --- XoopsModules/consent/trunk/modules/consent/class/statistics.php 2017-08-23 16:11:38 UTC (rev 13275) +++ XoopsModules/consent/trunk/modules/consent/class/statistics.php 2017-08-23 20:06:29 UTC (rev 13276) @@ -18,7 +18,7 @@ * @link http://internetfounder.wordpress.com */ -if (!defined('_MD_consent_MODULE_DIRNAME')) { +if (!defined('_MD_CONSENT_MODULE_DIRNAME')) { return false; } Modified: XoopsModules/consent/trunk/modules/consent/header.php =================================================================== --- XoopsModules/consent/trunk/modules/consent/header.php 2017-08-23 16:11:38 UTC (rev 13275) +++ XoopsModules/consent/trunk/modules/consent/header.php 2017-08-23 20:06:29 UTC (rev 13276) @@ -39,8 +39,6 @@ if (empty($consentConfigsList)) { $consentConfigsList = xoops_gethandler('config')->getConfigList($consentModule->getVar('mid')); - if (!defined('_MD_CONSENT_DEFAULT_TWITTER')) - define('_MD_CONSENT_DEFAULT_TWITTER',$consentConfigsList['username']); } if (empty($consentConfigs)) { Modified: XoopsModules/consent/trunk/modules/consent/include/enumerators/response-waiting__agreements.diz =================================================================== --- XoopsModules/consent/trunk/modules/consent/include/enumerators/response-waiting__agreements.diz 2017-08-23 16:11:38 UTC (rev 13275) +++ XoopsModules/consent/trunk/modules/consent/include/enumerators/response-waiting__agreements.diz 2017-08-23 20:06:29 UTC (rev 13276) @@ -1,3 +1,4 @@ Gardian Clientel -Both \ No newline at end of file +Both +None \ No newline at end of file Modified: XoopsModules/consent/trunk/modules/consent/include/functions.php =================================================================== --- XoopsModules/consent/trunk/modules/consent/include/functions.php 2017-08-23 16:11:38 UTC (rev 13275) +++ XoopsModules/consent/trunk/modules/consent/include/functions.php 2017-08-23 20:06:29 UTC (rev 13276) @@ -17,7 +17,105 @@ * @version 1.0.1 * @link http://internetfounder.wordpress.com */ - + + + + +if (!function_exists('consentStripeReferee')) +{ + /** + * Stipes the Referee Key + * + * @param unknown $referee + * @return mixed + */ + function consentStripeReferee($referee = '', $num = 3, $length = 18) + { + $uu = 0; + $strip = floor(strlen($referee) / $num); + $strlen = strlen($referee); + $ret = ''; + for ($i = 0; $i < $strlen; ++$i) { + if ($i < $length) { + ++$uu; + if ($uu == $strip) { + $ret .= substr($referee, $i, 1) . '-'; + $uu = 0; + } else { + if (substr($referee, $i, 1) != '-') { + $ret .= substr($referee, $i, 1); + } else { + $uu--; + } + } + } + } + $ret = str_replace('--', '-', $ret); + if (substr($ret, 0, 1) == '-') { + $ret = substr($ret, 2, strlen($ret)); + } + if (substr($ret, strlen($ret) - 1, 1) == '-') { + $ret = substr($ret, 0, strlen($ret) - 1); + } + + return $ret; + } +} + +if (!function_exists('consentSEF')) +{ + + /** + * Xoops safe encoded url elements + * + * @param unknown $datab + * @param string $char + * @return string + */ + function consentSEF($datab, $char ='-') + { + $replacement_chars = array(); + $accepted = array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","m","o","p","q", + "r","s","t","u","v","w","x","y","z","0","9","8","7","6","5","4","3","2","1"); + for($i=0;$i<256;$i++){ + if (!in_array(strtolower(chr($i)),$accepted)) + $replacement_chars[] = chr($i); + } + $return_data = (str_replace($replacement_chars,$char,$datab)); + while(substr($return_data, 0, 1) == $char) + $return_data = substr($return_data, 1, strlen($return_data)-1); + while(substr($return_data, strlen($return_data)-1, 1) == $char) + $return_data = substr($return_data, 0, strlen($return_data)-1); + while(strpos($return_data, $char . $char)) + $return_data = str_replace($char . $char, $char, $return_data); + return(strtolower($return_data)); + } +} + + +if (!function_exists('consentToNumeric')) +{ + + /** + * Xoops safe encoded url elements + * + * @param unknown $datab + * @param string $char + * @return string + */ + function consentToNumeric($datab) + { + $replacement_chars = array(); + $accepted = array("0","9","8","7","6","5","4","3","2","1"); + for($i=0;$i<256;$i++){ + if (!in_array(strtolower(chr($i)),$accepted)) + $replacement_chars[] = chr($i); + } + $return_data = (str_replace($replacement_chars,'',$datab)); + return(strtolower($return_data)); + } +} + if (!function_exists("consentEnumeratorValues")) { /** * Loads a field enumerator values Added: XoopsModules/consent/trunk/modules/consent/index.php =================================================================== --- XoopsModules/consent/trunk/modules/consent/index.php (rev 0) +++ XoopsModules/consent/trunk/modules/consent/index.php 2017-08-23 20:06:29 UTC (rev 13276) @@ -0,0 +1,87 @@ +<?php +/** + * Legal Consent is a module for obtain legal guardianship consent + * + * 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://fonts2web.org.uk + * @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) + * @author Simon Roberts (wishcraft) <wis...@us...> + * @subpackage consent + * @description Legal Consent is a module for obtain legal guardianship consent + * @version 1.0.1 + * @link http://internetfounder.wordpress.com + */ + + + require_once __DIR__ . DIRECTORY_SEPARATOR . 'header.php'; + + xoops_load('XoopsSecurity'); + + $op = ((!isset($_REQUEST['op']) || empty($_REQUEST['op'])) ? 'default' : (string)$_REQUEST['op']); + + switch($op) + { + case 'make-agreement': + if (xoops_getModuleHandler('agreements', _MD_CONSENT_MODULE_DIRNAME)->checkSubscriptionForm($_REQUEST, false)) + { + $agreementsHandler = xoops_getModuleHandler('agreements', _MD_CONSENT_MODULE_DIRNAME); + $guardiansHandler = xoops_getModuleHandler('guardians', _MD_CONSENT_MODULE_DIRNAME); + $clientelsHandler = xoops_getModuleHandler('clientels', _MD_CONSENT_MODULE_DIRNAME); + + $obj = $guardiansHandler->create(); + if (is_object($GLOBALS['xoopsUser'])) + $obj->setVar('uid', $GLOBALS['xoopsUser']->getVar('uid')); + $obj->setVar('name', $_REQUEST['guardian-name']); + $obj->setVar('email', $_REQUEST['guardian-email']); + $obj->setVar('phone', $_REQUEST['guardian-phone']); + $guardian = $guardiansHandler->get($guardianid = $guardiansHandler->insert($obj)); + + setcookie(_MD_CONSENT_MODULE_DIRNAME . '-guardian-name', $_SESSION[_MD_CONSENT_MODULE_DIRNAME]['guardian']['name'] = $_REQUEST['guardian-name'], 60*60*24*14*14*9, '/', XOOPS_COOKIE_DOMAIN, true); + setcookie(_MD_CONSENT_MODULE_DIRNAME . '-guardian-email', $_SESSION[_MD_CONSENT_MODULE_DIRNAME]['guardian']['email'] = $_REQUEST['guardian-email'], 60*60*24*14*14*9, '/', XOOPS_COOKIE_DOMAIN, true); + setcookie(_MD_CONSENT_MODULE_DIRNAME . '-guardian-phone', $_SESSION[_MD_CONSENT_MODULE_DIRNAME]['guardian']['phone'] = $_REQUEST['guardian-phone'], 60*60*24*14*14*9, '/', XOOPS_COOKIE_DOMAIN, true); + + $obj = $clientelsHandler->create(); + if (is_object($GLOBALS['xoopsUser'])) + $obj->setVar('uid', $GLOBALS['xoopsUser']->getVar('uid')); + $obj->setVar('name', $_REQUEST['clientel-name']); + $obj->setVar('email', $_REQUEST['clientel-email']); + $obj->setVar('phone', $_REQUEST['clientel-phone']); + $clientel = $clientelsHandler->get($clientelid = $clientelsHandler->insert($obj)); + + $obj = $agreementsHandler->create(); + if (is_object($GLOBALS['xoopsUser'])) + $obj->setVar('uid', $GLOBALS['xoopsUser']->getVar('uid')); + $obj->setVar('guardian-id', $guardianid); + $obj->setVar('clientel-id', $clientelid); + $obj->setVar('timeout', strtotime($_REQUEST['timeout'])); + $obj->setVar('callback-url', $_REQUEST['callback-url']); + $agreement = $agreementsHandler->get($agreementid = $agreementsHandler->insert($obj, true)); + + require_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'header.php'; + if (is_object($GLOBALS['xoTheme'])) + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . '/modules/' . _MD_CONSENT_MODULE_DIRNAME . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/style.css'); + $GLOBALS['xoopsTpl']->assign('guardian', $guardian->getValues(array('name','email','phone','hashkey','id','created'))); + $GLOBALS['xoopsTpl']->assign('clientel', $clientel->getValues(array('name','email','phone','hashkey','id','created'))); + $GLOBALS['xoopsTpl']->assign('agreement', $agreement->getValues(array('hashkey','referee','created','timeout','id'))); + $GLOBALS['xoopsTpl']->display(__DIR__ . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'index-agreement-created.html'); + require_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'footer.php'; + + break; + } + default: + require_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'header.php'; + if (is_object($GLOBALS['xoTheme'])) + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . '/modules/' . _MD_CONSENT_MODULE_DIRNAME . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/style.css'); + $GLOBALS['xoopsTpl']->assign('form', xoops_getModuleHandler('agreements', _MD_CONSENT_MODULE_DIRNAME)->getSubscriptionForm($_REQUEST)); + $GLOBALS['xoopsTpl']->assign('errors', xoops_getModuleHandler('agreements', _MD_CONSENT_MODULE_DIRNAME)->errorsSubscriptionForm($_REQUEST)); + $GLOBALS['xoopsTpl']->display(__DIR__ . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'index-subscribe-consent.html'); + require_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'footer.php'; + break; + } + \ No newline at end of file Property changes on: XoopsModules/consent/trunk/modules/consent/index.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Modified: XoopsModules/consent/trunk/modules/consent/language/english/errors.php =================================================================== --- XoopsModules/consent/trunk/modules/consent/language/english/errors.php 2017-08-23 16:11:38 UTC (rev 13275) +++ XoopsModules/consent/trunk/modules/consent/language/english/errors.php 2017-08-23 20:06:29 UTC (rev 13276) @@ -21,4 +21,19 @@ */ +// Errors for Single Subscription to Consent +define('_ERR_CONSENT_FORM_GUARDIAN_NAME_MISSING','Guardian\'s Name is empty and missing'); +define('_ERR_CONSENT_FORM_GUARDIAN_PHONE_MISSING','Guardian\'s Phone is empty and missing'); +define('_ERR_CONSENT_FORM_GUARDIAN_EMAIL_MISSING','Guardian\'s eMail is empty and missing'); +define('_ERR_CONSENT_FORM_GUARDIAN_PHONE_WRONGLENGTH','Guardian\'s Phone must contain at least 10 numbers ~ include country code+area code!'); +define('_ERR_CONSENT_FORM_GUARDIAN_NAME_MALFORMED','Guardian\'s Name must consist of at least two words seperated by a space'); +define('_ERR_CONSENT_FORM_GUARDIAN_EMAIL_MALFORMED','Guardian\'s eMail is malformed and not an email address'); +define('_ERR_CONSENT_FORM_CLIENTEL_NAME_MISSING','Clientel\'s Name is empty and missing'); +define('_ERR_CONSENT_FORM_CLIENTEL_PHONE_MISSING','Clientel\'s Phone is empty and missing'); +define('_ERR_CONSENT_FORM_CLIENTEL_EMAIL_MISSING','Clientel\'s eMail is empty and missing'); +define('_ERR_CONSENT_FORM_CLIENTEL_PHONE_WRONGLENGTH','Clientel\'s Phone must contain at least 10 numbers ~ include country code+area code!'); +define('_ERR_CONSENT_FORM_CLIENTEL_NAME_MALFORMED','Clientel\'s Name must consist of at least two words seperated by a space'); +define('_ERR_CONSENT_FORM_CLIENTEL_EMAIL_MALFORMED','Clientel\'s eMail is malformed and not an email address'); +define('_ERR_CONSENT_FORM_AGREEMENT_EXISTINGINQUEUE','Guardian+Clientel is already exists in a current consent request agreements!'); + ?> \ No newline at end of file Added: XoopsModules/consent/trunk/modules/consent/language/english/main.php =================================================================== --- XoopsModules/consent/trunk/modules/consent/language/english/main.php (rev 0) +++ XoopsModules/consent/trunk/modules/consent/language/english/main.php 2017-08-23 20:06:29 UTC (rev 13276) @@ -0,0 +1,44 @@ +<?php +/** + * Legal Consent is a module for obtain legal guardianship consent + * + * 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://fonts2web.org.uk + * @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) + * @author Simon Roberts (wishcraft) <wis...@us...> + * @subpackage consent + * @description Legal Consent is a module for obtain legal guardianship consent + * @version 1.0.1 + * @link http://internetfounder.wordpress.com + */ + +// Index Consent Subscription Form +define('_MN_CONSENT_INDEX_H1','Subcription to Consent for Gardian + Clientel'); +define('_MN_CONSENT_INDEX_P1','Below is a form that you will be able to subscribe to the guardian consent agreements on this site, you will be able to fill this form out per youth or young adult you are getting or giving consent for the adult based workshops, classes or roles in this agreement, fill out the subscription form below as you see fit!'); +define('_MN_CONSENT_INDEX_H2','Errors made on Form'); +define('_MN_CONSENT_INDEX_P2','Make sure you have all the details above correct before you submit this form, it will email you the consent forms one of each for the guardian and one for the clientel to return either by email or the upload link...'); + +// Guardian+Clientel Consent Single Subscription Form +define('_MN_CONSENT_FORM_SUBCRIPTION','New Consent Agreement Subscription'); +define('_MN_CONSENT_FORM_GUARDIAN_NAME','Guardian\'s Name'); +define('_MN_CONSENT_FORM_GUARDIAN_NAME_DESC','This is at least first + last name of the guardian representing the client'); +define('_MN_CONSENT_FORM_GUARDIAN_EMAIL','Guardian\'s eMail'); +define('_MN_CONSENT_FORM_GUARDIAN_EMAIL_DESC','This is the eMail for the guardian'); +define('_MN_CONSENT_FORM_GUARDIAN_PHONE','Guardian\'s Phone'); +define('_MN_CONSENT_FORM_GUARDIAN_PHONE_DESC','This is the phone number for the guardian (min. 10 numbers)'); +define('_MN_CONSENT_FORM_CLIENTEL_NAME','Clientel\'s Name'); +define('_MN_CONSENT_FORM_CLIENTEL_NAME_DESC','This is at least first + last name of the client repesented by the guardian'); +define('_MN_CONSENT_FORM_CLIENTEL_EMAIL','Clientel\'s eMail'); +define('_MN_CONSENT_FORM_CLIENTEL_EMAIL_DESC','This is the eMail for the client that is the youth consentee'); +define('_MN_CONSENT_FORM_CLIENTEL_PHONE','Clientel\'s Phone'); +define('_MN_CONSENT_FORM_CLIENTEL_PHONE_DESC','This is the phone number for the clientel (min. 10 numbers)'); +define('_MN_CONSENT_FORM_TIMEOUT','Event Consent Timeout'); +define('_MN_CONSENT_FORM_TIMEOUT_DESC','This is the absolute date all consent forms must be returned by'); +define('_MN_CONSENT_FORM_CALLBACK_URL','URL recieving API callback notifications'); +define('_MN_CONSENT_FORM_CALLBACK_URL_DESC','This is a URL which recieves peroidically api calls for notifications to do with this agreement.<br /><br />You can see the example of the callbacks recieved with the following example: <a href="%s" target="_blank">callback-examples.php</a>!'); \ No newline at end of file Property changes on: XoopsModules/consent/trunk/modules/consent/language/english/main.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Modified: XoopsModules/consent/trunk/modules/consent/sql/mysqli.sql =================================================================== --- XoopsModules/consent/trunk/modules/consent/sql/mysqli.sql 2017-08-23 16:11:38 UTC (rev 13275) +++ XoopsModules/consent/trunk/modules/consent/sql/mysqli.sql 2017-08-23 20:06:29 UTC (rev 13276) @@ -14,8 +14,8 @@ `clientel-filename-pdf` varchar(128) NOT NULL DEFAULT '', `gardian-response-file` varchar(128) NOT NULL DEFAULT '', `clientel-response-file` varchar(128) NOT NULL DEFAULT '', - `response-waiting` enum('Gardian','Clientel','Both') NOT NULL DEFAULT 'Both', - `response-sourced` enum('Gardian','Clientel','Both') NOT NULL DEFAULT 'Both', + `response-waiting` enum('Guardian','Clientel','Both','None') NOT NULL DEFAULT 'Both', + `response-sourced` enum('Guardian','Clientel','Both') NOT NULL DEFAULT 'Both', `response-comment` longtext, `response-network` longtext, `response-notified` int(11) NOT NULL DEFAULT '0', @@ -23,8 +23,8 @@ `response-gardian-weight` int(11) NOT NULL DEFAULT '0', `response-clientel-weight` int(11) NOT NULL DEFAULT '0', `email-ids` longtext, - `email-agreement-type` enum('None','Gardian','Clientel','Both') NOT NULL DEFAULT 'Both', - `email-recovery-type` enum('None','Gardian','Clientel','Batch') NOT NULL DEFAULT 'None', + `email-agreement-type` enum('None','Guardian','Clientel','Both') NOT NULL DEFAULT 'Both', + `email-recovery-type` enum('None','Guardian','Clientel','Batch') NOT NULL DEFAULT 'None', `email-recovery-guardian-sent` int(11) NOT NULL DEFAULT '0', `email-recovery-clientel-sent` int(11) NOT NULL DEFAULT '0', `email-from` varchar(64) NOT NULL DEFAULT '', @@ -73,7 +73,7 @@ `cc` longtext, `bcc` longtext, `callback-url` varchar(255) NOT NULL DEFAULT '', - `email-agreement-type` enum('Gardian','Clientel','Both') NOT NULL DEFAULT 'Both', + `email-agreement-type` enum('Guardian','Clientel','Both') NOT NULL DEFAULT 'Both', `csv-lines` int(11) NOT NULL DEFAULT '0', `csv-bytes` int(11) NOT NULL DEFAULT '0', `csv-md5` varchar(32) NOT NULL DEFAULT ',', @@ -168,7 +168,7 @@ `id` int(32) NOT NULL AUTO_INCREMENT, `approval` enum('Delivered','Undelivered','Unknown') NOT NULL DEFAULT 'Unknown', `email-type` enum('Agreement','Reminder','Recovery','Progress','Unknown') NOT NULL DEFAULT 'Unknown', - `email-target` enum('Batch','Gardian','Clientel','Webmaster','Unknown') NOT NULL DEFAULT 'Unknown', + `email-target` enum('Batch','Guardian','Clientel','Webmaster','Unknown') NOT NULL DEFAULT 'Unknown', `agreement-id` int(20) NOT NULL DEFAULT '0', `batch-id` int(20) NOT NULL DEFAULT '0', `gardian-id` int(20) NOT NULL DEFAULT '0', Added: XoopsModules/consent/trunk/modules/consent/templates/index-agreement-created.html =================================================================== --- XoopsModules/consent/trunk/modules/consent/templates/index-agreement-created.html (rev 0) +++ XoopsModules/consent/trunk/modules/consent/templates/index-agreement-created.html 2017-08-23 20:06:29 UTC (rev 13276) @@ -0,0 +1,16 @@ +<h1><{$smarty.const._MN_CONSENT_INDEX_AGREEMENT_CREATED_H1}> #<{$agreement.referee}></h1> +<p><{$smarty.const._MN_CONSENT_INDEX_AGREEMENT_CREATED_P1}></p> +<h2><{$smarty.const._MN_CONSENT_INDEX_AGREEMENT_CREATED_H2_GUARDIAN}></h2> +<p><{$smarty.const._MN_CONSENT_INDEX_AGREEMENT_CREATED_P1_GUARDIAN}></p> +<p style="margin-left: 55px; font-size: 1.8444em; font-weight: 600; margin-top: 15px; margin-bottom: 9px;"> + <{$smarty.const._MN_CONSENT_INDEX_AGREEMENT_CREATED_GUARDIANNAME}>: <{$guardian.name}><br /> + <{$smarty.const._MN_CONSENT_INDEX_AGREEMENT_CREATED_GUARDIANEMAIL}>: <{$guardian.email}><br /> + <{$smarty.const._MN_CONSENT_INDEX_AGREEMENT_CREATED_GUARDIANPHONE}>: <{$guardian.phone}> +</p> +<h2><{$smarty.const._MN_CONSENT_INDEX_AGREEMENT_CREATED_H2_CLIENTEL}></h2> +<p><{$smarty.const._MN_CONSENT_INDEX_AGREEMENT_CREATED_P1_CLIENTEL}></p> +<p style="margin-left: 55px; font-size: 1.8444em; font-weight: 600; margin-top: 15px; margin-bottom: 9px;"> + <{$smarty.const._MN_CONSENT_INDEX_AGREEMENT_CREATED_CLIENTELNAME}>: <{$clientel.name}><br /> + <{$smarty.const._MN_CONSENT_INDEX_AGREEMENT_CREATED_CLIENTELEMAIL}>: <{$clientel.email}><br /> + <{$smarty.const._MN_CONSENT_INDEX_AGREEMENT_CREATED_CLIENTELPHONE}>: <{$clientel.phone}> +</p> \ No newline at end of file Added: XoopsModules/consent/trunk/modules/consent/templates/index-subscribe-consent.html =================================================================== --- XoopsModules/consent/trunk/modules/consent/templates/index-subscribe-consent.html (rev 0) +++ XoopsModules/consent/trunk/modules/consent/templates/index-subscribe-consent.html 2017-08-23 20:06:29 UTC (rev 13276) @@ -0,0 +1,16 @@ +<h1><{$smarty.const._MN_CONSENT_INDEX_H1}></h1> +<p><{$smarty.const._MN_CONSENT_INDEX_P1}></p> +<{if $errors}> +<h2><{$smarty.const._MN_CONSENT_INDEX_H2}></h2> +<p style="color: rgb(190,0,0); font-size: 1.2345em; font-weight: bold; padding-left: 65px; padding-right: 65px;"> + <ol> + <{foreach item=error from=$errors}> + <li><{$error}></li> + <{/foreach}> + </ol> +</p> +<{/if}> +<p style="color: rgb(0,0,0); font-size: 1.3456em; padding-left: 65px; padding-right: 65px;"> + <{$form}> +</p> +<p><{$smarty.const._MN_CONSENT_INDEX_P2}></p> \ No newline at end of file Modified: XoopsModules/consent/trunk/modules/consent/templates/pdf/clientel-consent.html =================================================================== --- XoopsModules/consent/trunk/modules/consent/templates/pdf/clientel-consent.html 2017-08-23 16:11:38 UTC (rev 13275) +++ XoopsModules/consent/trunk/modules/consent/templates/pdf/clientel-consent.html 2017-08-23 20:06:29 UTC (rev 13276) @@ -3,7 +3,7 @@ Agreement Referee: <strong>#<{$agreement.referee}></strong></p> <br /> <br /> -<p style="float: right; width: 77%; font-style: italic; font-size: 0.78em; margin-right: 39px;"><font style="font-size: 1.8444em; color: rgb(190,0,0);"><strong>Notice:</strong><br /></font>This form is a legal contract that fit into none disclosure we will never place this contract unless needed in legal waiver into the public spectrum or media, it is stored in a private location after photograph with at least a 3 mega-pixel camera or scanned it at a high resolution and either upload to the following URL: <a href="<{$agreement.upload.url.clientel}>"><{$agreement.upload.url.clientel}></a> or reply to the email containing this file making the subject line quoting the following reference text '#<{$agreement.referee}>', only from the email address of: <{$clientel.email}> to the email address of <{$agreement.email}>.</p> +<p style="float: right; width: 77%; font-style: italic; font-size: 0.78em; margin-right: 39px;"><font style="font-size: 1.8444em; color: rgb(190,0,0);"><strong>Notice:</strong><br /></font>This form is a legal contract that fit into none disclosure we will never place this contract unless needed in legal waiver into the public spectrum or media, it is stored in a private location after photograph with at least a 3 mega-pixel camera or scanned it at a high resolution and either upload to the following URL: <a href="<{$agreement.upload.url.clientel}>"><{$agreement.upload.url.clientel}></a> or reply to the email containing this file making the subject line quoting the following reference text '#<{$agreement.referee}>', only from the email address of: <{$clientel.email}> to the email address of <{$agreement.email-email-from}>.</p> <br /> <br /> <p>I, <em><{$clientel.name}></em> am the participant adult activities that require guardian consent and have the consent of my guardian: <strong><{$guardian.name}></strong> who’s phone number is <{$guardian.phone}> and email address corresponds with <{$guardian.email}>. I understand my legal responsibilities as a participant and realise this permission consent Form is for myself potentially a young adult as mentioned above to participant in adult education or activities sometime with classes, training and workshops with the facility provider.</p> Modified: XoopsModules/consent/trunk/modules/consent/templates/pdf/guardian-consent.html =================================================================== --- XoopsModules/consent/trunk/modules/consent/templates/pdf/guardian-consent.html 2017-08-23 16:11:38 UTC (rev 13275) +++ XoopsModules/consent/trunk/modules/consent/templates/pdf/guardian-consent.html 2017-08-23 20:06:29 UTC (rev 13276) @@ -3,7 +3,7 @@ Agreement Referee: <strong>#<{$agreement.referee}></strong></p> <br /> <br /> -<p style="float: right; width: 77%; font-style: italic; font-size: 0.78em; margin-right: 39px;"><font style="font-size: 1.8444em; color: rgb(190,0,0);"><strong>Notice:</strong><br /></font>This form is a legal contract that fit into none disclosure we will never place this contract unless needed in legal waiver into the public spectrum or media, it is stored in a private location after photograph with at least a 3 mega-pixel camera or scanned it at a high resolution and either upload to the following URL: <a href="<{$agreement.upload.url.guardian}>"><{$agreement.upload.url.guardian}></a> or reply to the email containing this file making the subject line quoting the following reference text '#<{$agreement.referee}>', only from the email address of: <{$guardian.email}> to the email address of <{$agreement.email}>.</p> +<p style="float: right; width: 77%; font-style: italic; font-size: 0.78em; margin-right: 39px;"><font style="font-size: 1.8444em; color: rgb(190,0,0);"><strong>Notice:</strong><br /></font>This form is a legal contract that fit into none disclosure we will never place this contract unless needed in legal waiver into the public spectrum or media, it is stored in a private location after photograph with at least a 3 mega-pixel camera or scanned it at a high resolution and either upload to the following URL: <a href="<{$agreement.upload.url.guardian}>"><{$agreement.upload.url.guardian}></a> or reply to the email containing this file making the subject line quoting the following reference text '#<{$agreement.referee}>', only from the email address of: <{$guardian.email}> to the email address of <{$agreement.email-email-from}>.</p> <br /> <br /> <p>I, <em><{$guardian.name}></em> am the legal gardian of <strong><{$clientel.name}></strong> who’s phone number is <{$clientel.phone}> and email address corresponds with <{$clientel.email}>, I understand my legal responsibilities as a gardian and realise this permission Consent Form is for this young individual as mentioned above to participate in adult education and adult related topic pertaining to this service as well as adult training and workshops with the facility provider.</p> Added: XoopsModules/consent/trunk/modules/consent/wizard.php =================================================================== --- XoopsModules/consent/trunk/modules/consent/wizard.php (rev 0) +++ XoopsModules/consent/trunk/modules/consent... [truncated message content] |