Changeset 720
- Timestamp:
- Mar 9, 2020 3:14:25 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/module_maker/skel/adm_list.ihtml
r664 r720 32 32 <?php for ($i = 0; $i <= $page->last_item - $page->first_item && $page->total_items > 0; $i++) { ?> 33 33 <tr> 34 <td class="sc-padleft sc-nowrap"><a title="<?php printf(_("Edit %s"), oTxt($list[$i]['__///__'])) ?>" href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=edit&%PRIMARY_KEY%=' . $list[$i]['%PRIMARY_KEY%']); ?>"><i mg src="/admin/i/pen.gif" alt="Edit" width="12" height="12" border="0" /></a></td>35 <td class="sc-padleft sc-nowrap"><a title="<?php printf(_("Versions of %s"), oTxt($list[$i]['__///__'])) ?>" href="<?php echo $app->oHREF('/admin/versions.php?record_table=%DB_TBL%&record_key=%PRIMARY_KEY%&boomerang=true&record_val=' . $list[$i]['%PRIMARY_KEY%']); ?>"><i mg src="/admin/i/multiple.png" alt="" width="12" height="12" border="0" /></a></td>34 <td class="sc-padleft sc-nowrap"><a title="<?php printf(_("Edit %s"), oTxt($list[$i]['__///__'])) ?>" href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=edit&%PRIMARY_KEY%=' . $list[$i]['%PRIMARY_KEY%']); ?>"><i class="fa fa-pencil-square-o fa-fw"></i></a></td> 35 <td class="sc-padleft sc-nowrap"><a title="<?php printf(_("Versions of %s"), oTxt($list[$i]['__///__'])) ?>" href="<?php echo $app->oHREF('/admin/versions.php?record_table=%DB_TBL%&record_key=%PRIMARY_KEY%&boomerang=true&record_val=' . $list[$i]['%PRIMARY_KEY%']); ?>"><i class="fa fa-clone fa-fw"></a></td> 36 36 %ADM_LIST_ROWS% 37 <td class="sc-padleft sc-nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['__///__'])) ?>" href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . "?op=del&%PRIMARY_KEY%=" . $list[$i]['%PRIMARY_KEY%']); ?>" onclick="javascript:return confirm('<?php printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt($list[$i]['__///__'])) ?>');"><i mg src="/admin/i/trash.gif" alt="Delete" width="10" height="10" border="0" /></a></td>37 <td class="sc-padleft sc-nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['__///__'])) ?>" href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . "?op=del&%PRIMARY_KEY%=" . $list[$i]['%PRIMARY_KEY%']); ?>" onclick="javascript:return confirm('<?php printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt($list[$i]['__///__'])) ?>');"><i class="fa fa-trash fa-fw"></i></a></td> 38 38 </tr> 39 39 <?php } ?> -
trunk/css/reset.inc.css
r635 r720 1 /* http://meyerweb.com/eric/tools/css/reset/ 2 v2.0 | 20110126 3 License: none (public domain) 4 */ 5 6 html, body, div, span, applet, object, iframe, 7 h1, h2, h3, h4, h5, h6, p, blockquote, pre, 8 a, abbr, acronym, address, big, cite, code, 9 del, dfn, em, img, ins, kbd, q, s, samp, 10 small, strike, strong, sub, sup, tt, var, 11 b, u, i, center, 12 dl, dt, dd, ol, ul, li, 13 fieldset, form, label, legend, 14 table, caption, tbody, tfoot, thead, tr, th, td, 15 article, aside, canvas, details, embed, 16 figure, figcaption, footer, header, hgroup, 17 menu, nav, output, ruby, section, summary, 18 time, mark, audio, video { 19 margin: 0; 20 padding: 0; 21 border: 0; 22 font-size: 100%; 23 font: inherit; 24 vertical-align: baseline; 1 /* https://github.com/hankchizljaw/modern-css-reset */ 2 *,*::before,*::after { 3 box-sizing: border-box 25 4 } 26 /* HTML5 display-role reset for older browsers */ 27 article, aside, details, figcaption, figure, 28 footer, header, hgroup, menu, nav, section { 29 display: block; 5 ul[class],ol[class] { 6 padding: 0 7 } 8 body,h1,h2,h3,h4,p,ul[class],ol[class],figure,blockquote,dl,dd { 9 margin: 0 30 10 } 31 11 body { 32 line-height: 1; 12 /* min-height: 100vh; */ 13 scroll-behavior: smooth; 14 text-rendering: optimizeSpeed; 15 line-height: 1.4 33 16 } 34 ol, ul{35 list-style: none; 17 ul[class],ol[class] { 18 list-style: none 36 19 } 37 blockquote, q{38 quotes: none; 20 a:not([class]) { 21 text-decoration-skip-ink: auto 39 22 } 40 blockquote:before, blockquote:after, 41 q:before, q:after { 42 content: ''; 43 content: none; 23 img:not([class]) { 24 max-width: 100%; 25 display: block 26 } 27 article>*+* { 28 margin-top: 1em 44 29 } 45 30 table { … … 47 32 border-spacing: 0; 48 33 } 34 input,button,textarea,select { 35 font: inherit 36 } 37 @media(prefers-reduced-motion:reduce) { 38 * { 39 animation-duration: .01ms !important; 40 animation-iteration-count: 1 !important; 41 transition-duration: .01ms !important; 42 scroll-behavior: auto !important 43 } 44 } -
trunk/lib/App.inc.php
r711 r720 302 302 303 303 case 'session_use_cookies': 304 ini_set('session.use_cookies', $val); 304 if (session_status() !== PHP_SESSION_ACTIVE) { 305 ini_set('session.use_cookies', $val); 306 } else { 307 $this->logMsg('Unable to set session_use_cookies; session is already active', LOG_NOTICE, __FILE__, __LINE__); 308 } 305 309 return true; 306 310 -
trunk/services/templates/versions_list.ihtml
r502 r720 8 8 <?php $app->printHiddenSession() ?> 9 9 <div class="row"> 10 <div class=" large-12 columns">10 <div class="small-12 columns"> 11 11 <table> 12 12 <thead> 13 13 <tr> 14 14 <th></th> 15 <th ><?php echo _("ID"); ?></th>16 <th ><?php echo _("Date"); ?></th>17 <th ><?php echo _("By"); ?></th>15 <th class="sc-padleft"><?php echo _("ID"); ?></th> 16 <th class="sc-padleft"><?php echo _("Date"); ?></th> 17 <th class="sc-padleft"><?php echo _("By"); ?></th> 18 18 </tr> 19 19 </thead> … … 48 48 </tbody> 49 49 </table> 50 <div class="sc-help"><?php printf(_("When there are more than %s versions, those over %s days old are deleted."), $version->getParam('min_qty'), $version->getParam('min_days')); ?></div> 50 <p class="sc-help"><?php printf(_("When there are more than %s versions, those over %s days old are deleted."), $version->getParam('min_qty'), $version->getParam('min_days')); ?></p> 51 </div> 52 </div> 53 <div class="row"> 54 <div class="small-12 columns"> 51 55 <?php 52 56 // Buttons. -
trunk/tests/AppTest.php
r547 r720 54 54 { 55 55 $thisapp =& App::getInstance(); 56 $this->assertTrue( serialize($thisapp) === serialize($this->App), 'Objects do not match across instantiations.');56 $this->assertTrue($thisapp === $this->App, 'Objects do not match across instantiations.'); 57 57 } 58 58 … … 80 80 $this->App->stop(); 81 81 $this->App->start(); 82 83 82 $this->assertEquals(ini_get('error_reporting'), E_ALL, 'Error reporting not set to E_ALL.'); 84 $this->assertTrue($this->App->db->dbh && is_resource($this->App->db->dbh), 'DB handler not a resource');85 83 $this->assertTrue(isset($_SESSION), '$_SESSION is not set.'); 86 84 $_SESSION['sess_test_value'] = 'okay'; … … 115 113 $app =& App::getInstance(); 116 114 ob_start(); 117 $this->test_raisemsg(); //had to add this line for phpunit ver. 3.7 ///115 $this->test_raisemsg(); //had to add this line for phpunit ver. 3.7 118 116 $app->printraisedmessages(); 119 117 $result = ob_get_clean(); … … 137 135 { 138 136 $app =& App::getInstance(); 139 $_ GET['arg1'] = 'A';137 $_REQUEST['arg1'] = 'A'; 140 138 $result = $app->ohref('/some/url.php', array('arg1'), true); 141 139 $this->assertContains(session_name(), $result, 'SSID not found in URL.'); -
trunk/tests/FormValidatorTest.php
r468 r720 4 4 * For details visit the project site: <http://trac.strangecode.com/codebase/> 5 5 * Copyright 2001-2012 Strangecode, LLC 6 * 6 * 7 7 * This file is part of The Strangecode Codebase. 8 8 * … … 11 11 * Free Software Foundation, either version 3 of the License, or (at your option) 12 12 * any later version. 13 * 13 * 14 14 * The Strangecode Codebase is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16 16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 17 * details. 18 * 18 * 19 19 * You should have received a copy of the GNU General Public License along with 20 20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 97 97 { 98 98 // This should not generate any error. 99 $_POST['some_field'] = 'a non empty string'; 99 $_REQUEST['some_field'] = 'a non empty string'; 100 $this->FormValidator->notEmpty('some_field', _("Error message")); 101 $this->assertFalse($this->FormValidator->anyerrors()); 102 103 // This one is an error! 104 $_REQUEST['some_field'] = ''; 100 105 $this->FormValidator->isempty('some_field', _("Error message")); 101 $this->assertFalse($this->FormValidator->anyerrors()); 102 103 // This one is an error! 104 $_POST['some_field'] = ''; 106 $this->assertTrue($this->FormValidator->anyerrors()); 107 } 108 109 function test_isempty() 110 { 111 // This should not generate any error. 112 $_REQUEST['some_field'] = 'a non empty string'; 105 113 $this->FormValidator->isempty('some_field', _("Error message")); 106 $this->assertTrue($this->FormValidator->anyerrors()); 107 } 108 109 function test_isempty() 110 { 111 // This should not generate any error. 112 $_POST['some_field'] = 'a non empty string'; 114 $this->assertFalse($this->FormValidator->anyerrors()); 115 116 // This one is an error! 117 $_REQUEST['some_field'] = ''; 113 118 $this->FormValidator->isempty('some_field', _("Error message")); 114 $this->assertFalse($this->FormValidator->anyerrors());115 116 // This one is an error!117 $_POST['some_field'] = '';118 $this->FormValidator->isempty('some_field', _("Error message"));119 119 $this->assertTrue($this->FormValidator->anyerrors()); 120 120 } … … 123 123 { 124 124 // This should not generate any error. 125 $_ POST['some_field'] = 'this is a string';125 $_REQUEST['some_field'] = 'this is a string'; 126 126 $this->FormValidator->isstring('some_field', _("Error message")); 127 127 $this->assertFalse($this->FormValidator->anyerrors()); 128 129 // This one is an error! 130 $_ POST['some_field'] = 12.3248; // not a string.128 129 // This one is an error! 130 $_REQUEST['some_field'] = 12.3248; // not a string. 131 131 $this->FormValidator->isstring('some_field', _("Error message")); 132 132 $this->assertTrue($this->FormValidator->anyerrors()); … … 136 136 { 137 137 // This should not generate any error. 138 $_ POST['some_field'] = '1234.453';138 $_REQUEST['some_field'] = '1234.453'; 139 139 $this->FormValidator->isnumber('some_field', _("Error message")); 140 140 $this->assertFalse($this->FormValidator->anyerrors()); 141 142 // This one is an error! 143 $_ POST['some_field'] = 'not a number';141 142 // This one is an error! 143 $_REQUEST['some_field'] = 'not a number'; 144 144 $this->FormValidator->isnumber('some_field', _("Error message")); 145 145 $this->assertTrue($this->FormValidator->anyerrors()); … … 149 149 { 150 150 // This should not generate any error. 151 $_ POST['some_field'] = '1234';151 $_REQUEST['some_field'] = '1234'; 152 152 $this->FormValidator->isinteger('some_field', _("Error message")); 153 153 $this->assertFalse($this->FormValidator->anyerrors()); 154 155 // This one is an error! 156 $_ POST['some_field'] = '1234.1';154 155 // This one is an error! 156 $_REQUEST['some_field'] = '1234.1'; 157 157 $this->FormValidator->isinteger('some_field', _("Error message")); 158 158 $this->assertTrue($this->FormValidator->anyerrors()); … … 162 162 { 163 163 // This should not generate any error. 164 $_ POST['some_field'] = '123.1234';164 $_REQUEST['some_field'] = '123.1234'; 165 165 $this->FormValidator->isfloat('some_field', _("Error message")); 166 166 $this->assertFalse($this->FormValidator->anyerrors()); 167 168 // This one is an error! 169 $_ POST['some_field'] = 'some falsity';167 168 // This one is an error! 169 $_REQUEST['some_field'] = 'some falsity'; 170 170 $this->FormValidator->isfloat('some_field', _("Error message")); 171 171 $this->assertTrue($this->FormValidator->anyerrors()); … … 175 175 { 176 176 // This should not generate any error. 177 $_ POST['some_field'] = array('asdf', 123);177 $_REQUEST['some_field'] = array('asdf', 123); 178 178 $this->FormValidator->isarray('some_field', _("Error message")); 179 179 $this->assertFalse($this->FormValidator->anyerrors()); 180 181 // This one is an error! 182 $_ POST['some_field'] = 'some falsity';180 181 // This one is an error! 182 $_REQUEST['some_field'] = 'some falsity'; 183 183 $this->FormValidator->isarray('some_field', _("Error message")); 184 184 $this->assertTrue($this->FormValidator->anyerrors()); … … 188 188 { 189 189 // This should not generate any error. 190 $_ POST['some_field'] = '1234abcd';190 $_REQUEST['some_field'] = '1234abcd'; 191 191 $this->FormValidator->checkregex('some_field', '/\d{4}[a-d]{4}/', true, _("Error message")); 192 192 $this->assertFalse($this->FormValidator->anyerrors()); 193 194 // This should not generate any error. 195 $_ POST['some_field'] = 'no digits here';193 194 // This should not generate any error. 195 $_REQUEST['some_field'] = 'no digits here'; 196 196 $this->FormValidator->checkregex('some_field', '/\d/', false, _("Error message")); 197 197 $this->assertFalse($this->FormValidator->anyerrors()); 198 199 // This one is an error! 200 $_ POST['some_field'] = 'oops, a d1git';198 199 // This one is an error! 200 $_REQUEST['some_field'] = 'oops, a d1git'; 201 201 $this->FormValidator->checkregex('some_field', '/\d/', false, _("Error message")); 202 202 $this->assertTrue($this->FormValidator->anyerrors()); … … 206 206 { 207 207 // This should not generate any error. 208 $_ POST['some_field'] = 'some truth';208 $_REQUEST['some_field'] = 'some truth'; 209 209 $this->FormValidator->stringLength('some_field', 0, 255, _("Error message")); 210 210 $this->assertFalse($this->FormValidator->anyerrors()); 211 212 // This one is an error! 213 $_ POST['some_field'] = 'some falsity';211 212 // This one is an error! 213 $_REQUEST['some_field'] = 'some falsity'; 214 214 $this->FormValidator->stringLength('some_field', 0, 4, _("Error message")); 215 215 $this->assertTrue($this->FormValidator->anyerrors()); … … 219 219 { 220 220 // This should not generate any error. 221 $_ POST['some_field'] = '12';221 $_REQUEST['some_field'] = '12'; 222 222 $this->FormValidator->numericrange('some_field', 3, 22, _("Error message")); 223 223 $this->assertFalse($this->FormValidator->anyerrors()); 224 225 // This one is an error! 226 $_ POST['some_field'] = '12';224 225 // This one is an error! 226 $_REQUEST['some_field'] = '12'; 227 227 $this->FormValidator->numericrange('some_field', 300, 2200, _("Error message")); 228 228 $this->assertTrue($this->FormValidator->anyerrors()); … … 232 232 { 233 233 // This should not generate any error. 234 $_ POST['some_field'] = 'Quinn the Kook <quinn@strangecode.com>';234 $_REQUEST['some_field'] = 'Quinn the Kook <quinn@strangecode.com>'; 235 235 $this->FormValidator->validateemail('some_field', _("Error message")); 236 236 $this->assertFalse($this->FormValidator->anyerrors()); 237 238 // This one is an error! 239 $_ POST['some_field'] = 'quinn@kook.com.';237 238 // This one is an error! 239 $_REQUEST['some_field'] = 'quinn@kook.com.'; 240 240 $this->FormValidator->validateemail('some_field', _("Error message")); 241 241 $this->assertTrue($this->FormValidator->anyerrors()); … … 245 245 { 246 246 // This should not generate any error. 247 $_ POST['some_field'] = '+1 (530) 555-1212';247 $_REQUEST['some_field'] = '+1 (530) 555-1212'; 248 248 $this->FormValidator->validatephone('some_field', _("Error message")); 249 249 $this->assertFalse($this->FormValidator->anyerrors()); 250 251 // This one is an error! 252 $_ POST['some_field'] = 'd321/654*9875 ';250 251 // This one is an error! 252 $_REQUEST['some_field'] = 'd321/654*9875 '; 253 253 $this->FormValidator->validatephone('some_field', _("Error message")); 254 254 $this->assertTrue($this->FormValidator->anyerrors()); … … 258 258 { 259 259 // This should not generate any error. 260 $_ POST['some_field'] = 'next tuesday';260 $_REQUEST['some_field'] = 'next tuesday'; 261 261 $this->FormValidator->validatestrdate('some_field', _("Error message")); 262 262 $this->assertFalse($this->FormValidator->anyerrors()); 263 264 // This one is an error! 265 $_ POST['some_field'] = 'in a galaxy far far away';263 264 // This one is an error! 265 $_REQUEST['some_field'] = 'in a galaxy far far away'; 266 266 $this->FormValidator->validatestrdate('some_field', _("Error message")); 267 267 $this->assertTrue($this->FormValidator->anyerrors()); … … 271 271 { 272 272 // This should not generate any error. 273 $_ POST['some_field'] = '2323-2005-7766-3554';273 $_REQUEST['some_field'] = '2323-2005-7766-3554'; 274 274 $this->FormValidator->validateccnumber('some_field', null); 275 275 $this->assertFalse($this->FormValidator->anyerrors()); 276 277 // This one is an error! 278 $_ POST['some_field'] = '1234 1234 1234 1234';276 277 // This one is an error! 278 $_REQUEST['some_field'] = '1234 1234 1234 1234'; 279 279 $this->FormValidator->validateccnumber('some_field', null); 280 280 $this->assertTrue($this->FormValidator->anyerrors()); -
trunk/tests/VersionTest.php
r695 r720 111 111 { 112 112 $result = $this->Version->create('test_user_tbl', 'user_id', '1', 'Test User', 'First version of user'); 113 $this->assertSame( 1, $result);113 $this->assertSame('1', $result); 114 114 } 115 115
Note: See TracChangeset
for help on using the changeset viewer.