Extension ext-user for sub id tracking continued:
authorRoland Häder <roland@mxchange.org>
Mon, 8 Oct 2012 16:54:26 +0000 (16:54 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 8 Oct 2012 16:54:26 +0000 (16:54 +0000)
- Generic support for sending mails on 'add' "build list" target added
- Generic "delete build list" support
- Support for editing and deleting sub ids basicly finished
- Other small rewrites
- TODOs.txt updated

28 files changed:
.gitattributes
DOCS/TODOs.txt
inc/email-functions.php
inc/filter-functions.php
inc/filters.php
inc/functions.php
inc/language/de.php
inc/language/user_de.php
inc/libs/user_functions.php
inc/modules/admin/admin-inc.php
inc/mysql-manager.php
inc/request-functions.php
templates/de/emails/admin/admin_add_user_subids.tpl [new file with mode: 0644]
templates/de/emails/admin/admin_delete_user_subids.tpl [new file with mode: 0644]
templates/de/emails/admin/admin_edit_user_subids.tpl [new file with mode: 0644]
templates/de/emails/member/member_add_user_subids.tpl [new file with mode: 0644]
templates/de/emails/member/member_delete_user_subids.tpl [new file with mode: 0644]
templates/de/emails/member/member_edit_user_subids.tpl [new file with mode: 0644]
templates/de/html/member/member_delete_user_subids.tpl [new file with mode: 0644]
templates/de/html/member/member_delete_user_subids_row.tpl [new file with mode: 0644]
templates/de/html/member/member_edit_user_subids.tpl [new file with mode: 0644]
templates/de/html/member/member_edit_user_subids_row.tpl [new file with mode: 0644]
templates/de/html/member/member_list_user_subids.tpl
templates/xml/member/member_add_do_subid.xml
templates/xml/member/member_add_do_user_subid.xml [new file with mode: 0644]
templates/xml/member/member_delete_do_user_subid.xml [new file with mode: 0644]
templates/xml/member/member_delete_show_user_subid.xml [new file with mode: 0644]
templates/xml/member/member_edit_do_user_subid.xml [new file with mode: 0644]

index 2d0949c..4835858 100644 (file)
@@ -874,6 +874,7 @@ templates/de/emails/.htaccess svneol=native#text/plain
 templates/de/emails/add-points.tpl svneol=native#text/plain
 templates/de/emails/admin-del_links.tpl svneol=native#text/plain
 templates/de/emails/admin/.htaccess svneol=native#text/plain
+templates/de/emails/admin/admin_add_user_subids.tpl svneol=native#text/plain
 templates/de/emails/admin/admin_admin_add_all_direct.tpl svneol=native#text/plain
 templates/de/emails/admin/admin_admin_add_all_ref_referral.tpl svneol=native#text/plain
 templates/de/emails/admin/admin_admin_add_all_referral.tpl svneol=native#text/plain
@@ -896,12 +897,14 @@ templates/de/emails/admin/admin_coupon_purge.tpl svneol=native#text/plain
 templates/de/emails/admin/admin_coupon_purge_row.tpl svneol=native#text/plain
 templates/de/emails/admin/admin_del_surfbar_urls.tpl svneol=native#text/plain
 templates/de/emails/admin/admin_delete_surfbar_urls.tpl svneol=native#text/plain
+templates/de/emails/admin/admin_delete_user_subids.tpl svneol=native#text/plain
 templates/de/emails/admin/admin_earning_added.tpl svneol=native#text/plain
 templates/de/emails/admin/admin_earning_updated.tpl svneol=native#text/plain
 templates/de/emails/admin/admin_edit_forced_ads.tpl svneol=native#text/plain
 templates/de/emails/admin/admin_edit_forced_costs.tpl svneol=native#text/plain
 templates/de/emails/admin/admin_edit_points_data.tpl svneol=native#text/plain
 templates/de/emails/admin/admin_edit_surfbar_urls.tpl svneol=native#text/plain
+templates/de/emails/admin/admin_edit_user_subids.tpl svneol=native#text/plain
 templates/de/emails/admin/admin_extension_deactivated.tpl svneol=native#text/plain
 templates/de/emails/admin/admin_forced_campaign_pending_active.tpl svneol=native#text/plain
 templates/de/emails/admin/admin_holiday_deactivated.tpl svneol=native#text/plain
@@ -1009,6 +1012,7 @@ templates/de/emails/lock-user.tpl svneol=native#text/plain
 templates/de/emails/lock_sponsor.tpl svneol=native#text/plain
 templates/de/emails/member/.htaccess svneol=native#text/plain
 templates/de/emails/member/member_add_points.tpl svneol=native#text/plain
+templates/de/emails/member/member_add_user_subids.tpl svneol=native#text/plain
 templates/de/emails/member/member_admin_add_all_direct.tpl svneol=native#text/plain
 templates/de/emails/member/member_admin_add_all_ref_referral.tpl svneol=native#text/plain
 templates/de/emails/member/member_admin_add_all_referral.tpl svneol=native#text/plain
@@ -1032,10 +1036,12 @@ templates/de/emails/member/member_coupon_code.tpl svneol=native#text/plain
 templates/de/emails/member/member_del_surfbar_urls.tpl svneol=native#text/plain
 templates/de/emails/member/member_delete_links.tpl svneol=native#text/plain
 templates/de/emails/member/member_delete_surfbar_urls.tpl svneol=native#text/plain
+templates/de/emails/member/member_delete_user_subids.tpl svneol=native#text/plain
 templates/de/emails/member/member_doubler.tpl svneol=native#text/plain
 templates/de/emails/member/member_earning_added.tpl svneol=native#text/plain
 templates/de/emails/member/member_earning_updated.tpl svneol=native#text/plain
 templates/de/emails/member/member_edit_surfbar_urls.tpl svneol=native#text/plain
+templates/de/emails/member/member_edit_user_subids.tpl svneol=native#text/plain
 templates/de/emails/member/member_forced_campaign_pending_active.tpl svneol=native#text/plain
 templates/de/emails/member/member_holiday_activated.tpl svneol=native#text/plain
 templates/de/emails/member/member_holiday_removed.tpl svneol=native#text/plain
@@ -1922,6 +1928,8 @@ templates/de/html/member/member_cats_footer.tpl svneol=native#text/plain
 templates/de/html/member/member_cats_header.tpl svneol=native#text/plain
 templates/de/html/member/member_cats_row.tpl svneol=native#text/plain
 templates/de/html/member/member_content_right.tpl svneol=native#text/plain
+templates/de/html/member/member_delete_user_subids.tpl svneol=native#text/plain
+templates/de/html/member/member_delete_user_subids_row.tpl svneol=native#text/plain
 templates/de/html/member/member_doubler.tpl svneol=native#text/plain
 templates/de/html/member/member_doubler_list.tpl svneol=native#text/plain
 templates/de/html/member/member_doubler_list_rows.tpl svneol=native#text/plain
@@ -1931,6 +1939,8 @@ templates/de/html/member/member_earning_data_popup.tpl svneol=native#text/plain
 templates/de/html/member/member_earning_popup_form_row.tpl svneol=native#text/plain
 templates/de/html/member/member_earning_popup_row.tpl svneol=native#text/plain
 templates/de/html/member/member_edit_refback.tpl svneol=native#text/plain
+templates/de/html/member/member_edit_user_subids.tpl svneol=native#text/plain
+templates/de/html/member/member_edit_user_subids_row.tpl svneol=native#text/plain
 templates/de/html/member/member_footer.tpl svneol=native#text/plain
 templates/de/html/member/member_goto_top.tpl svneol=native#text/plain
 templates/de/html/member/member_header.tpl svneol=native#text/plain
index ed9e132..c48e27b 100644 (file)
@@ -9,6 +9,7 @@
 ./inc/daily/daily_beg.php:52:// @TODO This should be converted in a daily beg rallye
 ./inc/daily/daily_birthday.php:99:                     // @TODO 4 is hard-coded here, should we move it out in config?
 ./inc/email-functions.php:109: * @TODO Rewrite this to an extension 'smtp'
+./inc/email-functions.php:227:// @TODO $rawUserId is currently unused
 ./inc/expression-functions.php:170:// @TODO FILTER_COMPILE_CONFIG does not handle call-back functions so we handle it here again
 ./inc/expression-functions.php:46:     // @TODO is escapeQuotes() enougth for strings with single/double quotes?
 ./inc/extensions/ext-html_mail.php:136:                // @TODO Move these arrays into config
 ./inc/extensions/ext-rallye.php:94:            // @TODO Fix config_rallye_prices to list_rallye_prices
 ./inc/extensions/ext-yoomedia.php:121:         // @TODO Can this be moved into a database table?
 ./inc/extensions/ext-yoomedia.php:54:// @TODO Only deprecated when 'ext-network' is ready! setExtensionDeprecated('Y');
-./inc/extensions-functions.php:2040:// @TODO This should be rewrittten to allow, more development states, e.g. 'planing','alpha','beta','beta2','stable'
+./inc/extensions-functions.php:2096:// @TODO This should be rewrittten to allow, more development states, e.g. 'planing','alpha','beta','beta2','stable'
 ./inc/extensions-functions.php:424:    // @TODO This redirect is still needed to register sql_patches! Please try to avoid it
 ./inc/extensions-functions.php:440:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) )
 ./inc/extensions-functions.php:580:            // @TODO Extension is loaded, what next?
 ./inc/filter/bonus_filter.php:56:              // @TODO This query isn't right, it will only update if the user was for a longer time away!
 ./inc/filter/cache_filter.php:94:              // @TODO This should be rewritten not to load the cache file for just checking if it is there for save removal.
 ./inc/filter/forced_filter.php:73:             // @TODO This part is unfinished
-./inc/functions.php:1082:                      // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
-./inc/functions.php:1168:                      // @TODO Are these convertions still required?
-./inc/functions.php:1189:// @TODO Rewrite this function to use readFromFile() and writeToFile()
-./inc/functions.php:1712:      // @TODO Find a way to cache this
-./inc/functions.php:1817:      // @TODO This is still very static, rewrite it somehow
-./inc/functions.php:2021:      // @TODO Rename column data_type to e.g. mail_status
+./inc/functions.php:1090:                      // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
+./inc/functions.php:1176:                      // @TODO Are these convertions still required?
+./inc/functions.php:1197:// @TODO Rewrite this function to use readFromFile() and writeToFile()
+./inc/functions.php:1732:      // @TODO Find a way to cache this
+./inc/functions.php:1837:      // @TODO This is still very static, rewrite it somehow
+./inc/functions.php:2041:      // @TODO Rename column data_type to e.g. mail_status
 ./inc/gen_sql_patches.php:95:// @TODO Rewrite this to a filter
 ./inc/header.php:66:// @TODO Find a way to not use direct module comparison
 ./inc/install-functions.php:91:        // @TODO DEACTIVATED: changeDataInLocalConfigurationFile('OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestElement('omode'), 0);
-./inc/language/de.php:1103:    // @TODO Rewrite these two constants
-./inc/language/de.php:1119:    // @TODO Rewrite these three constants
+./inc/language/de.php:1112:    // @TODO Rewrite these two constants
+./inc/language/de.php:1128:    // @TODO Rewrite these three constants
 ./inc/language/de.php:749:// @TODO Are these constants longer used?
 ./inc/language-functions.php:255:      // @TODO These are all valid languages, again hard-coded
 ./inc/language-functions.php:44:// @TODO Rewrite all language constants to this function.
@@ -96,7 +97,6 @@
 ./inc/mails/doubler_mails.php:53:// @TODO Can this be rewritten to a filter?
 ./inc/module-functions.php:273:                        // @TODO Nothing helped???
 ./inc/module-functions.php:314:                        // @TODO Rewrite this to a filter
-./inc/modules/admin/admin-inc.php:1521:                                // @TODO If we can rewrite the EL sub-system to support more than one parameter, this call_user_func_array() can be avoided
 ./inc/modules/admin/admin-inc.php:160:         // @TODO This and the next getCurrentAdminId() call might be moved into the templates?
 ./inc/modules/admin/admin-inc.php:233:         // @TODO This can be rewritten into a filter
 ./inc/modules/admin/admin-inc.php:509:// @TODO Try to rewrite this to adminAddMenuSelectionBox()
 ./inc/modules/member/what-beg.php:54:// @TODO Can't this be moved into EL?
 ./inc/modules/member/what-beg.php:63:// @TODO No more needed? define('__BEG_USERID_TIMEOUT', createFancyTime(getBegUseridTimeout()));
 ./inc/modules/member/what-logout.php:17: * @TODO Rewrite the code to a filter                                   *
-./inc/modules/member/what-order.php:482:                       // @TODO Rewrite this to a filter
+./inc/modules/member/what-order.php:471:                       // @TODO Rewrite this to a filter
 ./inc/modules/member/what-order.php:84:                // @TODO Rewrite this to SQL_FETCHARRAY()
 ./inc/modules/member/what-payout.php:194:                                      // @TODO Rewrite this to a filter
 ./inc/modules/member/what-points.php:61:// @TODO Should we rewrite this to a filter?
 ./inc/mysql-manager.php:1437:          // @TODO Rewrite these lines to a filter
 ./inc/mysql-manager.php:1461:  // @TODO Rewrite this to a filter
 ./inc/mysql-manager.php:1717:                  // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1916:                          // @TODO If we can rewrite the EL sub-system to support more than one parameter, this call_user_func_array() can be avoided
+./inc/mysql-manager.php:2029:                  // @TODO Used generic 'userid' here
 ./inc/mysql-manager.php:398:   // @TODO Try to rewrite this to one or more functions
 ./inc/mysql-manager.php:44:// @TODO Can we cache this?
 ./inc/purge/purge-inact.php:55:        // @TODO Rewrite these if() blocks to a filter
 ./inc/template-functions.php:285:      // @TODO Remove these sanity checks if all is fine
 ./inc/template-functions.php:599:// @TODO $simple/$constants are deprecated
 ./inc/template-functions.php:697:                      // @TODO $userid is deprecated and should be removed from loadEmailTemplate() and replaced with $content[userid] in all templates
-./inc/wrapper-functions.php:3004:      // @TODO Find a way to not use direct module comparison
+./inc/wrapper-functions.php:3010:      // @TODO Find a way to not use direct module comparison
 ./inc/wrapper-functions.php:494:// @TODO Do some more sanity check here
-./inc/xml-functions.php:208:   // @TODO Handle characters
+./inc/xml-functions.php:209:   // @TODO Handle characters
 ./mailid.php:102:              // @TODO Rewrite this to a filter
 ./mailid.php:145:                                      // @TODO Rewrite this to a filter
 ./mailid_top.php:112:          // @TODO Rewrite this to a filter/function
 ./templates/de/html/why_reg.tpl:1:<!-- @DEPRECATED //-->
 ./templates/xml/admin/admin_del_do_surfbar_urls.xml:1:<!-- @DEPRECATED //-->
 ./templates/xml/admin/admin_del_show_surfbar_urls.xml:1:<!-- @DEPRECATED //-->
+./templates/xml/member/member_add_do_subid.xml:1:<!-- @DEPRECATED //-->
 ### ### template-warnings.log follows: ### ###
 PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : td in templates/de/html/menu/menu_what_end.tpl, line: 1 in 
 PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : tr in templates/de/html/menu/menu_what_end.tpl, line: 2 in 
index ced06aa..bb4f0e5 100644 (file)
@@ -223,5 +223,50 @@ function doTemplateAddExtraHtmlMailHeaders ($templateName, $clear, $extraHeaders
        return $extraHeaders;
 }
 
+// Send mails for del/edit/lock build modes
+// @TODO $rawUserId is currently unused
+function sendGenericBuildMails ($mode, $tableName, $content, $id, $subjectPart = '', $userIdColumn = array('userid'), $rawUserId = array('userid')) {
+       // $tableName must be an array
+       if ((!is_array($tableName)) || (count($tableName) != 1)) {
+               // $tableName is no array
+               reportBug(__FUNCTION__, __LINE__, 'tableName[]=' . gettype($tableName) . '!=array: userIdColumn=' . $userIdColumn);
+       } elseif ((!is_array($userIdColumn)) || (count($userIdColumn) != 1)) {
+               // $tableName is no array
+               reportBug(__FUNCTION__, __LINE__, 'userIdColumn[]=' . gettype($userIdColumn) . '!=array: userIdColumn=' . $userIdColumn);
+       } // END - if
+
+       // Default subject is the subject part
+       $subject = $subjectPart;
+
+       // Is the subject part not set?
+       if (empty($subjectPart)) {
+               // Then use it from the mode
+               $subject = strtoupper($mode);
+       } // END - if
+
+       // Is the raw userid set?
+       if (postRequestElement($userIdColumn[0], $id) > 0) {
+               // Load email template
+               if (!empty($subjectPart)) {
+                       $mail = loadEmailTemplate('member_' . $mode . '_' . strtolower($subjectPart) . '_' . $tableName[0], $content);
+               } else {
+                       $mail = loadEmailTemplate('member_' . $mode . '_' . $tableName[0], $content);
+               }
+
+               // Send email out
+               sendEmail(postRequestElement($userIdColumn[0], $id), strtoupper('{--MEMBER_' . $subject . '_' . $tableName[0] . '_SUBJECT--}'), $mail);
+       } // END - if
+
+       // Generate subject
+       $subject = strtoupper('{--ADMIN_' . $subject . '_' . $tableName[0] . '_SUBJECT--}');
+
+       // Send admin notification out
+       if (!empty($subjectPart)) {
+               sendAdminNotification($subject, 'admin_' . $mode . '_' . strtolower($subjectPart) . '_' . $tableName[0], $content, postRequestElement($userIdColumn[0], $id));
+       } else {
+               sendAdminNotification($subject, 'admin_' . $mode . '_' . $tableName[0], $content, postRequestElement($userIdColumn[0], $id));
+       }
+}
+
 // [EOF]
 ?>
index e72170c..2048ba2 100644 (file)
@@ -197,8 +197,7 @@ ORDER BY
        registerFilter(__FUNCTION__, __LINE__, 'generate_admin_mail_links', 'GENERATE_POOL_MAIL_LINKS');
 
        // Build mails
-       registerFilter(__FUNCTION__, __LINE__, 'send_build_mail', 'SEND_ADMIN_BUILD_MAIL');
-       registerFilter(__FUNCTION__, __LINE__, 'send_build_mail', 'SEND_MEMBER_BUILD_MAIL');
+       registerFilter(__FUNCTION__, __LINE__, 'send_build_mail', 'SEND_BUILD_MAIL');
 }
 
 // "Registers" a new filter function
index f5b846c..fca3cf4 100644 (file)
@@ -1234,24 +1234,12 @@ function FILTER_INIT_SESSION ($filterData) {
 }
 
 // Filter for sending "build mail" to admin
-function FILTER_SEND_ADMIN_BUILD_MAIL ($filterData) {
-       // Is the module 'admin'?
-       if (getModule() == 'admin') {
-               // Okay, then call the proper function
-               call_user_func_array('sendAdminBuildMails', $filterData);
-       } // END - if
-
-       // Return data
-       return $filterData;
-}
-
-// Filter for sending "build mail" to member
-function FILTER_SEND_MEMBER_BUILD_MAIL ($filterData) {
-       // Is the module 'login'?
-       if (getModule() == 'login') {
-               // Okay, then call the proper function
-               call_user_func_array('sendMemberBuildMails', $filterData);
-       } // END - if
+function FILTER_SEND_BUILD_MAIL ($filterData) {
+       // Was one line updated?
+       //if ($filterData['affected'] == 1) {
+               // Then call the proper function
+               call_user_func_array('sendGenericBuildMails', $filterData);
+       //} // END - if
 
        // Return data
        return $filterData;
index 47e600c..806bf7d 100644 (file)
@@ -2325,6 +2325,9 @@ function memberEditEntriesConfirm ($tableName, $columns = array(), $filterFuncti
 
        // Shall we change here or list for editing?
        if ($editNow[0] === true) {
+               // Add generic userid field
+               setPostRequestElement('userid', getMemberId());
+
                // Call generic change method
                $affected = doGenericEditEntriesConfirm($tableName, $columns, $filterFunctions, $extraValues, $timeColumns, $editNow, $idColumn, $userIdColumn, $rawUserId, $cacheFiles);
 
@@ -2342,6 +2345,48 @@ function memberEditEntriesConfirm ($tableName, $columns = array(), $filterFuncti
        }
 }
 
+// Delete rows by given id numbers
+function memberDeleteEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $deleteNow = array(false), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array()) {
+       // Do this only for members
+       assert(isMember());
+
+       // $tableName must be an array
+       if ((!is_array($tableName)) || (count($tableName) != 1)) {
+               // No tableName specified
+               reportBug(__FUNCTION__, __LINE__, 'tableName is not given. Please fix your XML,tableName[]=' . gettype($tableName) . '!=array: userIdColumn=' . $userIdColumn);
+       } elseif (!is_array($idColumn)) {
+               // $idColumn is no array
+               reportBug(__FUNCTION__, __LINE__, 'idColumn[]=' . gettype($idColumn) . '!=array: userIdColumn=' . $userIdColumn);
+       } elseif (!is_array($userIdColumn)) {
+               // $userIdColumn is no array
+               reportBug(__FUNCTION__, __LINE__, 'userIdColumn[]=' . gettype($userIdColumn) . '!=array: userIdColumn=' . $userIdColumn);
+       } elseif (!is_array($deleteNow)) {
+               // $deleteNow is no array
+               reportBug(__FUNCTION__, __LINE__, 'deleteNow[]=' . gettype($deleteNow) . '!=array: userIdColumn=' . $userIdColumn);
+       } // END - if
+
+       // Shall we delete here or list for deletion?
+       if ($deleteNow[0] === true) {
+               // Add generic userid field
+               setPostRequestElement('userid', getMemberId());
+
+               // Call generic function
+               $affected = doGenericDeleteEntriesConfirm($tableName, $columns, $filterFunctions, $extraValues, $deleteNow, $idColumn, $userIdColumn, $rawUserId, $cacheFiles);
+
+               // Was this fine?
+               if ($affected == countPostSelection($idColumn[0])) {
+                       // All deleted
+                       displayMessage('{--MEMBER_ALL_ENTRIES_REMOVED--}');
+               } else {
+                       // Some are still there :(
+                       displayMessage(sprintf(getMessage('MEMBER_SOME_ENTRIES_NOT_DELETED'), SQL_AFFECTEDROWS(), countPostSelection($idColumn[0])));
+               }
+       } else {
+               // List for deletion confirmation
+               memberListBuilder('delete', $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn);
+       }
+}
+
 // Build a special template list
 function memberListBuilder ($listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId = array('userid')) {
        // Do this only for logged in member
index 928266c..904dff7 100644 (file)
@@ -988,12 +988,16 @@ addMessages(array(
        'ADMIN_SUPPORT_CIAVC_LINK' => "Direktlink zu CIA.vc (neues Fenster)",
        'ADMIN_SUPPORT_STATS_LINK' => "Direktlink zur Commit-Statistik (neues Fenster)",
        'ADMIN_REFERRAL_LEVEL_ZERO_NOTICE' => "Die Referral-Ebene 0 ist das Mitglied selber und sollte daher auf 100% stehen. Sie sollte auch nicht ge&auml;ndert oder gel&ouml;scht werden! Dann erhalten Ihre Mitglieder keine {?POINTS?} gutgeschrieben.",
+
        'ADMIN_ALL_ENTRIES_REMOVED' => "Alle ausgew&auml;hlten Eintr&auml;ge sind gel&ouml;scht.",
        'ADMIN_SOME_ENTRIES_NOT_DELETED' => "Es wurden <span class=\"data\">%s</span> von <span class=\"data\">%s</span> ausgew&auml;hlten Eintr&auml;ge gel&ouml;scht.",
        'ADMIN_ALL_ENTRIES_EDITED' => "Alle ausgew&auml;hlten Eintr&auml;ge sind ge&auml;ndert.",
        'ADMIN_SOME_ENTRIES_NOT_EDITED' => "Es wurden <span class=\"data\">%s</span> von <span class=\"data\">%s</span> ausgew&auml;hlten Eintr&auml;ge ge&auml;ndert.",
        'MEMBER_ALL_ENTRIES_EDITED' => "Alle Ihre &Auml;nderungen wurden gespeichert.",
        'MEMBER_SOME_ENTRIES_NOT_EDITED' => "Es wurden <span class=\"data\">%s</span> von <span class=\"data\">%s</span> ausgew&auml;hlten Eintr&auml;ge ge&auml;ndert. Wenn Sie keine neuen Werte eingegeben haben, ist diese Meldung normal.",
+       'MEMBER_ALL_ENTRIES_REMOVED' => "Alle Ihre ausgew&auml;hlten Eintr&auml;ge wurden gel&ouml;scht.",
+       'MEMBER_SOME_ENTRIES_NOT_DELETED' => "Es wurden <span class=\"data\">%s</span> von <span class=\"data\">%s</span> ausgew&auml;hlten Eintr&auml;ge gel&ouml;scht.",
+
        'USER_NOT_REGISTERED' => "Anmeldung hat nicht geklappt! :-( Ist unten eine Fehlermeldung eingeblendet? Bitte beim Support melden.",
        'ADMIN_SELECTION_BOX_TITLE' => "Mitglied f&uuml;r Aktion ausw&auml;hlen",
        'ADMIN_DO_ACTION' => "Aktion ausf&uuml;hren",
index 4863c6b..2a4e394 100644 (file)
@@ -118,18 +118,36 @@ addMessages(array(
 
        // Member - sub ids
        'MEMBER_USER_SUBIDS_404' => "Sie haben noch keine Sub-Ids angelegt.",
-       'MEMBER_ADD_SUBID_TITLE' => "Neue Sub-Id anlegen",
        'MEMBER_ADD_SUBID_SUBMIT' => "Sub-Id hinzuf&uuml;gen",
        'MEMBER_ENTER_SUBID' => "Geben Sie eine Sub-Id ein:",
        'MEMBER_ADD_SUBID_LEGEND' => "Daten zur Sub-Id",
        'MEMBER_ADD_SUBID_NOTICE' => "<strong>Hinweise:</strong>Mit Sub-Ids haben Sie die M&ouml;glichkeit, die Aufrufe Ihres Referral-Linkes noch genauer zu verfolgen. Zum Beispiel k&ouml;nnen Sie jedem Besuchertausch oder fremden Paidmailer eine eigene Sub-Id vergeben, indem Sie diese hier zuerst eingeben und dann am Ende des Referral-Linkes mit <strong>&amp;subid=<em>Ihre Sub-Id</em></strong> anh&auml;ngen. Bewerben Sie nun diesen erweiterten Link. Sobald Aufrufe auf diesen erfolgen, k&ouml;nnen Sie bei der jeweiligen Sub-Id auf &quot;Aufruf-Statistik&quot; klicken, um eine detailierte Statistik zu erhalten. Leerzeichen oder Bindestrichen werden automatisch in Unterstriche umgewandelt, es wurden nur Zeichen von A-Z (klein- und grossgeschrieben) und alle Zahlenzeichen sowie Unterstriche angenommen.",
        'MEMBER_SUBID_NO_SELECTIONS' => "Sie haben keine Auswahl getroffen! Bitte navigieren Sie zur&uuml;ck, w&auml;hlen Sie mindestens eine Sub-Id aus und versuchen Sie es dann erneut.",
        'MEMBER_USER_SUBID_STATS_LINK' => "Aufrufstatistiken",
+       'MEMBER_USER_SUBID_ADDED' => "Sub-Id hinzugef&uuml;gt",
+       'MEMBER_CHANGE_USER_SUBID' => "Geben Sie eine neue ein:",
+       'MEMBER_USER_SUBIDS_CHANGE_SUBMIT' => "Sub-Ids &auml;ndern",
+       'MEMBER_USER_SUBIDS_REMOVE_SUBMIT' => "Sub-Ids l&ouml;schen",
+       'MEMBER_EDIT_USER_SUBIDS_NOTICE' => "Wenn Sie doch nichts &auml;ndern wollen, klicken Sie einfach auf <strong>{--MEMBER_USER_SUBIDS_CHANGE_SUBMIT--}</strong> oder in der Navigation <strong>{--YOU_ARE_HERE--}</strong> auf Sub-Id Tracking.",
+       'MEMBER_DELETE_USER_SUBIDS_NOTICE' => "Wollen Sie die oben aufgef&uuml;hrte(n) Sub-Id(s) wirklich l&ouml;schen? Dieses ist nicht umkehrbar! Die Statistik dazu bleibt noch eine Weile gespeichert, ist aber nicht mehr aus der Auswahl aufrufbar (Sie k&ouml;nnen sich ja den Link notieren?).",
+
+       // Member - sub ids - title
        'MEMBER_USER_SUBID_EDIT_DELETE_TITLE' => "Editieren und L&ouml;schen von Sub-Ids",
+       'MEMBER_ADD_SUBID_TITLE' => "Neue Sub-Id anlegen",
+       'MEMBER_EDIT_USER_SUBIDS_TITLE' => "Ausgew&auml;hlte Sub-Ids editieren",
+       'MEMBER_DELETE_USER_SUBIDS_TITLE' => "Ausgew&auml;hlte Sub-Ids l&ouml;schen",
+
+       // Member - sub ids - subject lines
+       'ADMIN_ADD_USER_SUBIDS_SUBJECT' => "Sub-Id wurde hinzugef&uuml;gt",
+       'ADMIN_EDIT_USER_SUBIDS_SUBJECT' => "Mitglied hat eine Sub-Id ge&auml;ndert",
+       'ADMIN_DELETE_USER_SUBIDS_SUBJECT' => "Mitglied hat eine Sub-Id gel&ouml;scht",
+       'MEMBER_ADD_USER_SUBIDS_SUBJECT' => "Neue Sub-Id hinzugef&uuml;gt",
+       'MEMBER_EDIT_USER_SUBIDS_SUBJECT' => "&Auml;nderung Ihrer Sub-Id",
+       'MEMBER_DELETE_USER_SUBIDS_SUBJECT' => "Ihre Sub-Id ist gel&ouml;scht",
 
        // Generic - subids
-       'SUBID_VALUE' => "Sub-Id",
-       'SUBID_ADDED' => "Hinzugef&uuml;gt",
+       'SUBID_VALUE' => "Sub-Id:",
+       'SUBID_ADDED' => "Hinzugef&uuml;gt:",
 ));
 
 // [EOF]
index 1168748..06d621c 100644 (file)
@@ -915,7 +915,7 @@ function doTemplateDisplayUsername ($template, $clear = false, $userid = NULL) {
 // ----------------------------------------------------------------------------
 
 // For 'doing' add subid, the column-index is required
-function addXmlSpecialMemberAddDoSubid () {
+function addXmlSpecialMemberAddDoUserSubid () {
        // So set it all here
        $GLOBALS['__COLUMN_INDEX']['doXmlCallbackFunction']  = 'column';
        $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_index'] = 'column';
index b580547..827a66f 100644 (file)
@@ -830,50 +830,6 @@ function adminChangeActivationStatus ($IDs, $table, $row, $idRow = 'id') {
        }
 }
 
-// Send mails for del/edit/lock build modes
-function sendAdminBuildMails ($mode, $tableName, $content, $id, $subjectPart = '', $userIdColumn = array('userid')) {
-       // $tableName must be an array
-       if ((!is_array($tableName)) || (count($tableName) != 1)) {
-               // $tableName is no array
-               reportBug(__FUNCTION__, __LINE__, 'tableName[]=' . gettype($tableName) . '!=array: userIdColumn=' . $userIdColumn);
-       } elseif ((!is_array($userIdColumn)) || (count($userIdColumn) != 1)) {
-               // $tableName is no array
-               reportBug(__FUNCTION__, __LINE__, 'userIdColumn[]=' . gettype($userIdColumn) . '!=array: userIdColumn=' . $userIdColumn);
-       } // END - if
-
-       // Default subject is the subject part
-       $subject = $subjectPart;
-
-       // Is the subject part not set?
-       if (empty($subjectPart)) {
-               // Then use it from the mode
-               $subject = strtoupper($mode);
-       } // END - if
-
-       // Is the raw userid set?
-       if (postRequestElement($userIdColumn[0], $id) > 0) {
-               // Load email template
-               if (!empty($subjectPart)) {
-                       $mail = loadEmailTemplate('member_' . $mode . '_' . strtolower($subjectPart) . '_' . $tableName[0], $content);
-               } else {
-                       $mail = loadEmailTemplate('member_' . $mode . '_' . $tableName[0], $content);
-               }
-
-               // Send email out
-               sendEmail(postRequestElement($userIdColumn[0], $id), strtoupper('{--MEMBER_' . $subject . '_' . $tableName[0] . '_SUBJECT--}'), $mail);
-       } // END - if
-
-       // Generate subject
-       $subject = strtoupper('{--ADMIN_' . $subject . '_' . $tableName[0] . '_SUBJECT--}');
-
-       // Send admin notification out
-       if (!empty($subjectPart)) {
-               sendAdminNotification($subject, 'admin_' . $mode . '_' . strtolower($subjectPart) . '_' . $tableName[0], $content, postRequestElement($userIdColumn[0], $id));
-       } else {
-               sendAdminNotification($subject, 'admin_' . $mode . '_' . $tableName[0], $content, postRequestElement($userIdColumn[0], $id));
-       }
-}
-
 // Build a special template list
 function adminListBuilder ($listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId = array('userid')) {
        // Call inner (general) function
@@ -972,7 +928,7 @@ function adminBuilderStatusHandler ($mode, $tableName, $columns, $filterFunction
                SQL_QUERY($sql, __FUNCTION__, __LINE__);
 
                // Send "build mails" out
-               sendAdminBuildMails($mode, $tableName, $content, $id, $statusInfo[$content[$column]], $userIdColumn);
+               sendGenericBuildMails($mode, $tableName, $content, $id, $statusInfo[$content[$column]], $userIdColumn);
        } // END - foreach
 }
 
@@ -995,41 +951,11 @@ function adminDeleteEntriesConfirm ($tableName, $columns = array(), $filterFunct
 
        // Shall we delete here or list for deletion?
        if ($deleteNow[0] === true) {
-               // The base SQL command:
-               $sql = "DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s` IN (%s)";
-
-               // Delete them all
-               $idList = '';
-               foreach (postRequestElement($idColumn[0]) as $id => $sel) {
-                       // Is there a userid?
-                       if (isPostRequestElementSet($rawUserId[0], $id)) {
-                               // Load all data from that id
-                               $result = SQL_QUERY_ESC("SELECT * FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`=%s LIMIT 1",
-                                       array(
-                                               $tableName[0],
-                                               $idColumn[0],
-                                               $id
-                                       ), __FUNCTION__, __LINE__);
-
-                               // Fetch the data
-                               $content = SQL_FETCHARRAY($result);
-
-                               // Free the result
-                               SQL_FREERESULT($result);
-
-                               // Send "build mails" out
-                               sendAdminBuildMails('delete', $tableName, $content, $id, '', $userIdColumn);
-                       } // END - if
-
-                       // Add id number
-                       $idList .= $id . ',';
-               } // END - foreach
-
-               // Run the query
-               SQL_QUERY_ESC($sql, array($tableName[0], $idColumn[0], substr($idList, 0, -1)), __FUNCTION__, __LINE__);
+               // Call generic function
+               $affected = doGenericDeleteEntriesConfirm($tableName, $columns, $filterFunctions, $extraValues, $timeColumns, $editNow, $idColumn, $userIdColumn, $rawUserId, $cacheFiles);
 
                // Was this fine?
-               if (SQL_AFFECTEDROWS() == countPostSelection($idColumn[0])) {
+               if ($affected == countPostSelection($idColumn[0])) {
                        // All deleted
                        displayMessage('{--ADMIN_ALL_ENTRIES_REMOVED--}');
                } else {
index 4b02a5f..bc4a920 100644 (file)
@@ -2011,10 +2011,30 @@ function doGenericAddEntries ($tableName, $columns = array(), $filterFunctions =
        // If all values are okay, continue
        if ($sqlValues[$key] !== false) {
                // Build the SQL query
-               $SQL = 'INSERT INTO `{?_MYSQL_PREFIX?}_' . $tableName[0] . '` (`' . implode('`,`', $sqlColumns) . "`) VALUES (" . implode(',', $sqlValues) . ')';
+               $sql = 'INSERT INTO `{?_MYSQL_PREFIX?}_' . $tableName[0] . '` (`' . implode('`,`', $sqlColumns) . "`) VALUES (" . implode(',', $sqlValues) . ')';
 
                // Run the SQL query
-               SQL_QUERY($SQL, __FUNCTION__, __LINE__);
+               SQL_QUERY($sql, __FUNCTION__, __LINE__);
+
+               // Add id
+               setPostRequestElement('id', SQL_INSERTID());
+
+               // Prepare filter data array
+               $filterData = array(
+                       'mode'          => 'add',
+                       'table_name'    => $tableName,
+                       'content'       => postRequestArray(),
+                       'id'            => SQL_INSERTID(),
+                       'subject'       => '',
+                       // @TODO Used generic 'userid' here
+                       'userid_column' => array('userid'),
+                       'raw_userid'    => array('userid'),
+                       'affected'      => SQL_AFFECTEDROWS(),
+                       'sql'           => $sql,
+               );
+
+               // Send "build mail" out
+               runFilterChain('send_build_mail', $filterData);
        } // END - if
 }
 
@@ -2077,13 +2097,19 @@ function doGenericEditEntriesConfirm ($tableName, $columns = array(), $filterFun
                } // END - foreach
 
                // Finish SQL command
-               $sql = substr($sql, 0, -1) . " WHERE `" . SQL_ESCAPE($idColumn[0]) . "`=" . bigintval($id) . " LIMIT 1";
+               $sql = substr($sql, 0, -1) . " WHERE `" . SQL_ESCAPE($idColumn[0]) . "`=" . bigintval($id);
+               if ((isset($rawUserId[0])) && (isPostRequestElementSet($rawUserId[0])) && (isset($userIdColumn[0]))) {
+                       // Add user id as well
+                       $sql .= ' AND `' . $userIdColumn[0] . '`=' . bigintval(postRequestElement($rawUserId[0]));
+               } // END - if
+               $sql .= " LIMIT 1";
 
                // Run this query
                SQL_QUERY($sql, __FUNCTION__, __LINE__);
 
                // Add affected rows
-               $affected += SQL_AFFECTEDROWS();
+               $edited = SQL_AFFECTEDROWS();
+               $affected += $edited;
 
                // Load all data from that id
                $result = SQL_QUERY_ESC("SELECT * FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`=%s LIMIT 1",
@@ -2096,9 +2122,6 @@ function doGenericEditEntriesConfirm ($tableName, $columns = array(), $filterFun
                // Fetch the data and merge it into $content
                $content = merge_array($content, SQL_FETCHARRAY($result));
 
-               // Free the result
-               SQL_FREERESULT($result);
-
                // Prepare filter data array
                $filterData = array(
                        'mode'          => 'edit',
@@ -2106,11 +2129,17 @@ function doGenericEditEntriesConfirm ($tableName, $columns = array(), $filterFun
                        'content'       => $content,
                        'id'            => $id,
                        'subject'       => '',
-                       'userid_column' => $userIdColumn
+                       'userid_column' => $userIdColumn,
+                       'raw_userid'    => $rawUserId,
+                       'affected'      => $edited,
+                       'sql'           => $sql,
                );
 
                // Send "build mail" out
                runFilterChain('send_build_mail', $filterData);
+
+               // Free the result
+               SQL_FREERESULT($result);
        } // END - foreach
 
        // Delete cache?
@@ -2135,6 +2164,51 @@ function doGenericEditEntriesConfirm ($tableName, $columns = array(), $filterFun
        return $affected;
 }
 
+// Delete rows by given id numbers
+function doGenericDeleteEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $deleteNow = array(false), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array()) {
+       // The base SQL command:
+       $sql = "DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s` IN (%s)";
+
+       // Is a user id provided?
+       if ((isset($rawUserId[0])) && (isPostRequestElementSet($rawUserId[0])) && (isset($userIdColumn[0]))) {
+               // Add user id as well
+               $sql .= ' AND `' . $userIdColumn[0] . '`=' . bigintval(postRequestElement($rawUserId[0]));
+       } // END - if
+
+       // Delete them all
+       $idList = '';
+       foreach (postRequestElement($idColumn[0]) as $id => $sel) {
+               // Is there a userid?
+               if (isPostRequestElementSet($userIdColumn[0])) {
+                       // Load all data from that id
+                       $result = SQL_QUERY_ESC("SELECT * FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`=%s LIMIT 1",
+                               array(
+                                       $tableName[0],
+                                       $idColumn[0],
+                                       $id
+                               ), __FUNCTION__, __LINE__);
+
+                       // Fetch the data
+                       $content = SQL_FETCHARRAY($result);
+
+                       // Free the result
+                       SQL_FREERESULT($result);
+
+                       // Send "build mails" out
+                       sendGenericBuildMails('delete', $tableName, $content, $id, '', $userIdColumn);
+               } // END - if
+
+               // Add id number
+               $idList .= $id . ',';
+       } // END - foreach
+
+       // Run the query
+       SQL_QUERY_ESC($sql, array($tableName[0], $idColumn[0], substr($idList, 0, -1)), __FUNCTION__, __LINE__);
+
+       // Return affected rows
+       return SQL_AFFECTEDROWS();
+}
+
 // Build a special template list
 function doGenericListBuilder ($prefix, $listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId = array('userid')) {
        // $tableName and $idColumn must bove be arrays!
index 62cdacc..e0051a1 100644 (file)
@@ -160,7 +160,7 @@ function isPostRequestElementSet ($element, $subElement = NULL) {
         * a string as numerical indexes are not wanted in POST data (in this
         * project).
         */
-       assert(is_string($element) && ((is_null($subElement)) || (is_string($subElement))));
+       assert(is_string($element) && ((is_null($subElement)) || (is_string($subElement)) || (is_int($subElement))));
 
        // Is a sub element set?
        if (is_null($subElement)) {
diff --git a/templates/de/emails/admin/admin_add_user_subids.tpl b/templates/de/emails/admin/admin_add_user_subids.tpl
new file mode 100644 (file)
index 0000000..6110817
--- /dev/null
@@ -0,0 +1,20 @@
+Hallo Administrator,
+
+das Mitglied $content[userid] hat soeben eine Sub-Id angelegt.
+
+Hier sind alle Daten dazu:
+------------------------------------------
+Sub-Id Kennung: $content[id]
+------------------------------------------
+Sub-Id: $content[subid]
+------------------------------------------
+Anrede: {%user,gender,translateGender=$content[userid]%}
+Vorname: {%user,surname=$content[userid]%}
+Nachname: {%user,family=$content[userid]%}
+Email-Adresse: {%user,email=$content[userid]%}
+------------------------------------------
+
+Mit freundlichen Gr&uuml;&szlig;en,
+  Ihr {?MAIN_TITLE?} Script
+
+{?URL?}/admin.php
diff --git a/templates/de/emails/admin/admin_delete_user_subids.tpl b/templates/de/emails/admin/admin_delete_user_subids.tpl
new file mode 100644 (file)
index 0000000..59fcea3
--- /dev/null
@@ -0,0 +1,21 @@
+Hallo Administrator,
+
+Das Mitglied $content[userid] hat soeben eine Sub-Id gel&ouml;scht.
+
+Hier sind alle Daten dazu:
+------------------------------------------
+Sub-Id Kennung: $content[id]
+------------------------------------------
+Sub-Id: $content[subid]
+------------------------------------------
+Hinzugef&uuml;gt: $content[subid_added]
+------------------------------------------
+Vorname: {%user,surname=$content[userid]%}
+Nachname: {%user,family=$content[userid]%}
+Email-Adresse: {%user,email=$content[userid]%}
+------------------------------------------
+
+Mit freundlichen Gr&uuml;&szlig;en,
+  Ihr {?MAIN_TITLE?} Script
+
+{?URL?}/admin.php
diff --git a/templates/de/emails/admin/admin_edit_user_subids.tpl b/templates/de/emails/admin/admin_edit_user_subids.tpl
new file mode 100644 (file)
index 0000000..d04ba87
--- /dev/null
@@ -0,0 +1,21 @@
+Hallo Administrator,
+
+Das Mitglied $content[userid] hat soeben eine Sub-Id ge&auml;ndert.
+
+Hier sind alle Daten dazu:
+------------------------------------------
+Sub-Id Kennung: $content[id]
+------------------------------------------
+Sub-Id: $content[subid]
+------------------------------------------
+Hinzugef&uuml;gt: $content[subid_added]
+------------------------------------------
+Vorname: {%user,surname=$content[userid]%}
+Nachname: {%user,family=$content[userid]%}
+Email-Adresse: {%user,email=$content[userid]%}
+------------------------------------------
+
+Mit freundlichen Gr&uuml;&szlig;en,
+  Ihr {?MAIN_TITLE?} Script
+
+{?URL?}/admin.php
diff --git a/templates/de/emails/member/member_add_user_subids.tpl b/templates/de/emails/member/member_add_user_subids.tpl
new file mode 100644 (file)
index 0000000..9ed385c
--- /dev/null
@@ -0,0 +1,15 @@
+Hallo {%user,gender,translateGender=$content[userid]%} {%user,surname=$content[userid]%} {%user,family=$content[userid]%},
+
+Sie haben soeben eine Sub-Id angelegt.
+
+Hier sind alle Daten dazu:
+------------------------------------------
+Sub-Id Kennung: $content[id]
+------------------------------------------
+Sub-Id: $content[subid]
+------------------------------------------
+
+Mit freundlichen Gr&uuml;&szlig;en,
+  Ihr {?MAIN_TITLE?} Team
+
+{?URL?}/login.php ({?WEBMASTER?})
diff --git a/templates/de/emails/member/member_delete_user_subids.tpl b/templates/de/emails/member/member_delete_user_subids.tpl
new file mode 100644 (file)
index 0000000..9ce7ab4
--- /dev/null
@@ -0,0 +1,17 @@
+Hallo {%user,gender,translateGender=$content[userid]%} {%user,surname=$content[userid]%} {%user,family=$content[userid]%},
+
+Sie haben soeben eine Ihrer Sub-Id gel&ouml;scht.
+
+Hier sind alle Daten dazu:
+------------------------------------------
+Sub-Id Kennung: $content[id]
+------------------------------------------
+Sub-Id: $content[subid]
+------------------------------------------
+Hinzugef&uuml;gt: $content[subid_added]
+------------------------------------------
+
+Mit freundlichen Gr&uuml;&szlig;en,
+  Ihr {?MAIN_TITLE?} Team
+
+{?URL?}/login.php ({?WEBMASTER?})
diff --git a/templates/de/emails/member/member_edit_user_subids.tpl b/templates/de/emails/member/member_edit_user_subids.tpl
new file mode 100644 (file)
index 0000000..68cd83b
--- /dev/null
@@ -0,0 +1,17 @@
+Hallo {%user,gender,translateGender=$content[userid]%} {%user,surname=$content[userid]%} {%user,family=$content[userid]%},
+
+Sie haben soeben eine Ihrer Sub-Id ge&auml;ndert.
+
+Hier sind alle Daten dazu:
+------------------------------------------
+Sub-Id Kennung: $content[id]
+------------------------------------------
+Sub-Id: $content[subid]
+------------------------------------------
+Hinzugef&uuml;gt: $content[subid_added]
+------------------------------------------
+
+Mit freundlichen Gr&uuml;&szlig;en,
+  Ihr {?MAIN_TITLE?} Team
+
+{?URL?}/login.php ({?WEBMASTER?})
diff --git a/templates/de/html/member/member_delete_user_subids.tpl b/templates/de/html/member/member_delete_user_subids.tpl
new file mode 100644 (file)
index 0000000..a9680b7
--- /dev/null
@@ -0,0 +1,22 @@
+<div align="center">
+<form accept-charset="UTF-8" action="{%url=modules.php?module=login&amp;what=subids&amp;do=delete_subids%}" method="post">
+<table border="0" cellspacing="0" cellpadding="0" class="table dashed">
+       <tr>
+               <td align="center" class="table_header bottom" height="25" colspan="4">
+                       <strong>{--MEMBER_DELETE_USER_SUBIDS_TITLE--}</strong>
+               </td>
+       </tr>
+       $content
+       <tr>
+               <td colspan="4" class="table_footer">
+                       <input type="reset" class="form_reset" value="{--CLEAR_FORM--}" />
+                       <input type="submit" class="form_delete" name="do_delete" value="{--MEMBER_USER_SUBIDS_REMOVE_SUBMIT--}" />
+               </td>
+       </tr>
+</table>
+</form>
+</div>
+
+<div class="notice">
+       {--MEMBER_DELETE_USER_SUBIDS_NOTICE--}
+</div>
diff --git a/templates/de/html/member/member_delete_user_subids_row.tpl b/templates/de/html/member/member_delete_user_subids_row.tpl
new file mode 100644 (file)
index 0000000..30a9cee
--- /dev/null
@@ -0,0 +1,11 @@
+<tr>
+       <td class="{%template,ColorSwitch%} bottom">
+               {--MEMBER_USER_SUBID_ADDED--}:<br />
+               <input type="hidden" name="id[$content[id]]" value="1" />
+               <strong>$content[subid_added]</strong>
+       </td>
+       <td class="{%template,ColorSwitch%} bottom">
+               {--SUBID_VALUE--}<br />
+               <strong>$content[subid]</strong>
+       </td>
+</tr>
diff --git a/templates/de/html/member/member_edit_user_subids.tpl b/templates/de/html/member/member_edit_user_subids.tpl
new file mode 100644 (file)
index 0000000..c9c0fd7
--- /dev/null
@@ -0,0 +1,22 @@
+<div align="center">
+<form accept-charset="UTF-8" action="{%url=modules.php?module=login&amp;what=subids&amp;do=edit_subids%}" method="post">
+<table border="0" cellspacing="0" cellpadding="0" class="table dashed">
+       <tr>
+               <td align="center" class="table_header bottom" height="25" colspan="4">
+                       <strong>{--MEMBER_EDIT_USER_SUBIDS_TITLE--}</strong>
+               </td>
+       </tr>
+       $content
+       <tr>
+               <td colspan="4" class="table_footer">
+                       <input type="reset" class="form_reset" value="{--CLEAR_FORM--}" />
+                       <input type="submit" class="form_submit" name="do_edit" value="{--MEMBER_USER_SUBIDS_CHANGE_SUBMIT--}" />
+               </td>
+       </tr>
+</table>
+</form>
+</div>
+
+<div class="notice">
+       {--MEMBER_EDIT_USER_SUBIDS_NOTICE--}
+</div>
diff --git a/templates/de/html/member/member_edit_user_subids_row.tpl b/templates/de/html/member/member_edit_user_subids_row.tpl
new file mode 100644 (file)
index 0000000..3caac1d
--- /dev/null
@@ -0,0 +1,11 @@
+<tr>
+       <td class="{%template,ColorSwitch%} bottom">
+               {--MEMBER_USER_SUBID_ADDED--}:<br />
+               <input type="hidden" name="id[$content[id]]" value="1" />
+               <strong>$content[subid_added]</strong>
+       </td>
+       <td class="{%template,ColorSwitch%} bottom">
+               {--MEMBER_CHANGE_USER_SUBID--}<br />
+               <input type="text" class="form_field" name="subid[$content[id]]" size="20" maxlength="255" value="$content[subid]" />
+       </td>
+</tr>
index 81e0b79..e22ed93 100644 (file)
@@ -8,8 +8,8 @@
        </tr>
        <tr>
                <td align="center" class="header_column bottom right" width="20"><strong>{--ID_SELECT--}</strong></td>
-               <td align="center" class="header_column bottom right" width="160"><strong>{--SUBID_VALUE--}:</strong></td>
-               <td align="center" class="header_column bottom" width="160"><strong>{--SUBID_ADDED--}:</strong></td>
+               <td align="center" class="header_column bottom right" width="160"><strong>{--SUBID_VALUE--}</strong></td>
+               <td align="center" class="header_column bottom" width="160"><strong>{--SUBID_ADDED--}</strong></td>
        </tr>
        $content
        <tr>
index 5cbce31..11f5d85 100644 (file)
@@ -1,68 +1 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-This template provides meta data for adding sub ids to the database.
-
-@author                Roland Haeder <webmaster@mxchange.org>
-@version       0.2.1-FINAL
-@copyright     (c) 2003 - 2009 by Roland Haeder
-@copyright     (c) 2009 - 2012 by Mailer Developer Team
-@license       GNU GPL 2.0 or any newer version
-@link          http://mxchange.org
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
-MA  02110-1301  USA
-//-->
-<member-entry-meta-data>
-       <!--
-       Call-back function which should all following parameter handled over
-       to. This will always be type of string but we like homogene XMLs.
-       //-->
-       <callback-function type="string" value="memberAddEntries" />
-       <!--
-       Name of the database table where the entries should be read/write from/to.
-       //-->
-       <database-table name="" type="string" value="user_subids" />
-       <!--
-       The following three lists must have the same count of list entries, else an
-       error may occur.
-       //-->
-       <!--
-       And all column names to read/write, leave this list tag empty for all (*).
-       //-->
-       <database-column-list>
-               <database-column-list-entry name="" type="string" table="" value="userid" alias="" function="" />
-               <database-column-list-entry name="" type="string" table="" value="subid" alias="" function="" />
-       </database-column-list>
-       <!--
-       "Filter" call-back functions to call back for piping the fetched data
-       through (can be left empty, no call-back function will be called)
-       //-->
-       <callback-function-list>
-               <callback-function-list-entry name="" type="string" value="bigintval" />
-               <callback-function-list-entry name="" type="string" value="prepareSubId" />
-       </callback-function-list>
-       <!--
-       Extra parameters (2nd, 3rd, ...) for above call-back functions. If an array
-       is provided, we have more than two parameters to handle over to the
-       call-back function. See function handleExtraValues() for details.
-       //-->
-       <extra-parameter-list>
-       </extra-parameter-list>
-       <!--
-       Columns for converting single time selections into a timestamp
-       //-->
-       <time-columns-list>
-       </time-columns-list>
-</member-entry-meta-data>
+<!-- @DEPRECATED //-->
diff --git a/templates/xml/member/member_add_do_user_subid.xml b/templates/xml/member/member_add_do_user_subid.xml
new file mode 100644 (file)
index 0000000..5cbce31
--- /dev/null
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+This template provides meta data for adding sub ids to the database.
+
+@author                Roland Haeder <webmaster@mxchange.org>
+@version       0.2.1-FINAL
+@copyright     (c) 2003 - 2009 by Roland Haeder
+@copyright     (c) 2009 - 2012 by Mailer Developer Team
+@license       GNU GPL 2.0 or any newer version
+@link          http://mxchange.org
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+MA  02110-1301  USA
+//-->
+<member-entry-meta-data>
+       <!--
+       Call-back function which should all following parameter handled over
+       to. This will always be type of string but we like homogene XMLs.
+       //-->
+       <callback-function type="string" value="memberAddEntries" />
+       <!--
+       Name of the database table where the entries should be read/write from/to.
+       //-->
+       <database-table name="" type="string" value="user_subids" />
+       <!--
+       The following three lists must have the same count of list entries, else an
+       error may occur.
+       //-->
+       <!--
+       And all column names to read/write, leave this list tag empty for all (*).
+       //-->
+       <database-column-list>
+               <database-column-list-entry name="" type="string" table="" value="userid" alias="" function="" />
+               <database-column-list-entry name="" type="string" table="" value="subid" alias="" function="" />
+       </database-column-list>
+       <!--
+       "Filter" call-back functions to call back for piping the fetched data
+       through (can be left empty, no call-back function will be called)
+       //-->
+       <callback-function-list>
+               <callback-function-list-entry name="" type="string" value="bigintval" />
+               <callback-function-list-entry name="" type="string" value="prepareSubId" />
+       </callback-function-list>
+       <!--
+       Extra parameters (2nd, 3rd, ...) for above call-back functions. If an array
+       is provided, we have more than two parameters to handle over to the
+       call-back function. See function handleExtraValues() for details.
+       //-->
+       <extra-parameter-list>
+       </extra-parameter-list>
+       <!--
+       Columns for converting single time selections into a timestamp
+       //-->
+       <time-columns-list>
+       </time-columns-list>
+</member-entry-meta-data>
diff --git a/templates/xml/member/member_delete_do_user_subid.xml b/templates/xml/member/member_delete_do_user_subid.xml
new file mode 100644 (file)
index 0000000..6911636
--- /dev/null
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+This template provides meta data for doing deletions on sub ids.
+
+@author                Roland Haeder <webmaster@mxchange.org>
+@version       0.2.1-FINAL
+@copyright     (c) 2003 - 2009 by Roland Haeder
+@copyright     (c) 2009 - 2012 by Mailer Developer Team
+@license       GNU GPL 2.0 or any newer version
+@link          http://mxchange.org
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+MA  02110-1301  USA
+//-->
+<member-entry-meta-data>
+       <!--
+       Call-back function which should all following parameter handled over
+       to. This will always be type of string but we like homogene XMLs.
+       //-->
+       <callback-function type="string" value="memberDeleteEntriesConfirm" />
+       <!--
+       Name of the database table where the entries should be read/write from/to.
+       //-->
+       <database-table name="" type="string" value="user_subids" />
+       <!--
+       The following three lists must have the same count of list entries, else an
+       error may occur.
+       //-->
+       <!--
+       And all column names to read/write, leave this list tag empty for all (*).
+       //-->
+       <database-column-list>
+       </database-column-list>
+       <!--
+       "Filter" call-back functions to call back for piping the fetched data
+       through (can be left empty, no call-back function will be called)
+       //-->
+       <callback-function-list>
+       </callback-function-list>
+       <!--
+       Extra parameters (2nd, 3rd, ...) for above call-back functions. If an array
+       is provided, we have more than two parameters to handle over to the
+       call-back function. See function handleExtraValues() for details.
+       //-->
+       <extra-parameter-list>
+       </extra-parameter-list>
+       <!--
+       Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+       //-->
+       <enable-modify-entries name="" type="bool" value="true" />
+       <!--
+       The table column which should be taken for the ids (see first parameter).
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <table-id-column name="" type="string" value="id" />
+       <!--
+       The table column which should be taken for user ids
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <table-userid-column name="" type="string" value="userid" />
+       <!--
+       Raw userid column ($key) to skip which is always an invalid (?) entry
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <raw-userid-column-key name="" type="string" value="userid" />
+       <!--
+       Cache file to delete
+       //-->
+       <cache-file name="" type="string" value="" />
+</member-entry-meta-data>
diff --git a/templates/xml/member/member_delete_show_user_subid.xml b/templates/xml/member/member_delete_show_user_subid.xml
new file mode 100644 (file)
index 0000000..74d6f0c
--- /dev/null
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+This template provides meta data for deleting sub ids.
+
+@author                Roland Haeder <webmaster@mxchange.org>
+@version       0.2.1-FINAL
+@copyright     (c) 2003 - 2009 by Roland Haeder
+@copyright     (c) 2009 - 2012 by Mailer Developer Team
+@license       GNU GPL 2.0 or any newer version
+@link          http://mxchange.org
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+MA  02110-1301  USA
+//-->
+<member-entry-meta-data>
+       <!--
+       Call-back function which should all following parameter handled over
+       to. This will always be type of string but we like homogene XMLs.
+       //-->
+       <callback-function type="string" value="memberDeleteEntriesConfirm" />
+       <!--
+       Name of the database table where the entries should be read/write from/to.
+       //-->
+       <database-table name="" type="string" value="user_subids" />
+       <!--
+       The following three lists must have the same count of list entries, else an
+       error may occur.
+       //-->
+       <!--
+       And all column names to read/write, leave this list tag empty for all (*).
+       //-->
+       <database-column-list>
+               <!--
+               A column name list entry. The type is always string, or do you have
+               numerical column names?
+               //-->
+               <database-column-list-entry name="" type="string" table="" value="id" alias="" function="" />
+               <database-column-list-entry name="" type="string" table="" value="userid" alias="" function="" />
+               <database-column-list-entry name="added_list" type="string" table="" value="subid_added" alias="subid_added" function="UNIX_TIMESTAMP" />
+               <database-column-list-entry name="" type="string" table="" value="subid" alias="" function="" />
+       </database-column-list>
+       <!--
+       "Filter" call-back functions to call back for piping the fetched data
+       through (can be left empty, no call-back function will be called)
+       //-->
+       <callback-function-list>
+               <!--
+               A call-back function list entry
+               //-->
+               <callback-function-list-entry name="" type="string" value="bigintval" />
+               <callback-function-list-entry name="added_list" type="string" value="generateDateTime" />
+       </callback-function-list>
+       <!--
+       Extra parameters (2nd, 3rd, ...) for above call-back functions. If an array
+       is provided, we have more than two parameters to handle over to the
+       call-back function. See function handleExtraValues() for details.
+       //-->
+       <extra-parameter-list>
+               <!--
+               A one-dimensional array with some entries
+               //-->
+               <extra-parameter-list-entry name="" type="array" value="added">
+                       <!--
+                       Our 'added' array
+                       //-->
+                       <extra-parameter-added-list>
+                               <!--
+                               A bool entry in the 'bar' array, all other types are added in a
+                               similar way.
+                               //-->
+                               <extra-parameter-added-list-entry name="" type="int" value="2" />
+                       </extra-parameter-added-list>
+               </extra-parameter-list-entry>
+       </extra-parameter-list>
+       <!--
+       Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+       //-->
+       <enable-modify-entries name="" type="bool" value="false" />
+       <!--
+       The table column which should be taken for the ids (see first parameter).
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <table-id-column name="" type="string" value="id" />
+       <!--
+       The table column which should be taken for user ids
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <table-userid-column name="" type="string" value="userid" />
+       <!--
+       Raw userid column ($key) to skip which is always an invalid (?) entry
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <raw-userid-column-key name="" type="string" value="userid" />
+</member-entry-meta-data>
diff --git a/templates/xml/member/member_edit_do_user_subid.xml b/templates/xml/member/member_edit_do_user_subid.xml
new file mode 100644 (file)
index 0000000..35d2798
--- /dev/null
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+This template provides meta data for doing edits on forced costs
+
+@author                Roland Haeder <webmaster@mxchange.org>
+@version       0.2.1-FINAL
+@copyright     (c) 2003 - 2009 by Roland Haeder
+@copyright     (c) 2009 - 2012 by Mailer Developer Team
+@license       GNU GPL 2.0 or any newer version
+@link          http://mxchange.org
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+MA  02110-1301  USA
+//-->
+<member-entry-meta-data>
+       <!--
+       Call-back function which should all following parameter handled over
+       to. This will always be type of string but we like homogene XMLs.
+       //-->
+       <callback-function type="string" value="memberEditEntriesConfirm" />
+       <!--
+       Name of the database table where the entries should be read/write from/to.
+       //-->
+       <database-table name="" type="string" value="user_subids" />
+       <!--
+       The following three lists must have the same count of list entries, else an
+       error may occur.
+       //-->
+       <!--
+       And all column names to read/write, leave this list tag empty for all (*).
+       //-->
+       <database-column-list>
+       </database-column-list>
+       <!--
+       "Filter" call-back functions to call back for piping the fetched data
+       through (can be left empty, no call-back function will be called)
+       //-->
+       <callback-function-list>
+       </callback-function-list>
+       <!--
+       Extra parameters (2nd, 3rd, ...) for above call-back functions. If an array
+       is provided, we have more than two parameters to handle over to the
+       call-back function. See function handleExtraValues() for details.
+       //-->
+       <extra-parameter-list>
+       </extra-parameter-list>
+       <!--
+       Columns for converting single time selections into a timestamp
+       //-->
+       <time-columns-list>
+       </time-columns-list>
+       <!--
+       Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+       //-->
+       <enable-modify-entries name="" type="bool" value="true" />
+       <!--
+       The table column which should be taken for the ids (see first parameter).
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <table-id-column name="" type="string" value="id" />
+       <!--
+       The table column which should be taken for user ids
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <table-userid-column name="" type="string" value="userid" />
+       <!--
+       Raw userid column ($key) to skip which is always an invalid (?) entry
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <raw-userid-column-key name="" type="string" value="userid" />
+       <!--
+       Cache file to delete
+       //-->
+       <cache-file name="" type="string" value="" />
+</member-entry-meta-data>