Jump to content

adrian

PW-Moderators
  • Posts

    10,902
  • Joined

  • Last visited

  • Days Won

    349

Everything posted by adrian

  1. I have just added the option to define the phone output format on the Input tab of each phone field's settings. This should make it much nicer if you have separate fields for landline and mobile numbers, etc.
  2. Right - I thought about that after posting, but I wonder if it still might be better to do count first and if there is a result, then find it. if ($l) { $l = $sanitizer->selectorValue($l); $all_listings = $pages->get(1070)->children('include=all,surname^='.$l); $dups = array(); foreach ($all_listings as $a) { $selector = 'surname='.$sanitizer->selectorValue($a->surname).',tels.value='.$a->tels->implode('|','value').',tels.count>0,id!='.$a->id; $existingCount = $allr->count($selector); if ($existingCount > 0) { $existing = $allr->find($selector); $c = 0; foreach ($existing as $e) { if (!count($dups[$e->id])) $dups[$a->id][$c++] = $e->id; } } } echo print_r($dups,true); }
  3. Hi @nbcommunication and welcome to the forums. Try using ->count() instead of ->find(), eg: $existing = $allr->count('surname='.$sanitizer->selectorValue($a->surname).',tels.value='.$a->tels->implode('|','value').',tels.count>0,id!='.$a->id); But, a direct SQL query might be what you really need - it might be worth having another look at that approach.
  4. Great! What about the field specific "Extension: (Whether to ask for extension when entering phone numbers.)" checkbox - uncheck that to remove the extension input? I guess the problem is with using this in a repeater because you are using the same field. I guess the new Repeater Matrix pro field would be a good solution. Otherwise you could use a PageTable field, but obviously not as nice of a UI for this.
  5. Thanks very much for the detailed explanation about German phone formats, especially the leading (0) and also the extension - very helpful. I have fixed the bug with the "(0)" not being displayed - please let me know if the new version works for you now. If I understand you correctly, this is already possible - go to the phone field setting's Input tab and check "Output Format Override" - this will give your site editors the ability to choose from the available formats as defined in the config settings. I think I will also look into having that option for the developer to set the format per field as well though.
  6. Thanks for the prompting. The latest version should now work with the 2.7.x branch, but please let me know if you find any problems.
  7. Ok, I have now added the ability to enable Tracy for non-superusers. Users with a role that has the "tracy-debugger" permission will have access. I would recommend created a dedicated "tracy-debugger" role with just the "tracy-debugger" permission. That way you can easily give a user the required permission without giving any other users access. There is also a new "Allowed Non-Superusers" panel that warns you that you have given some non-superusers permission to view Tracy and lists the users and roles affected. For the moment I have decided not to allow everyone access when the PW debug mode is on. I see the logic in this, but Tracy provides a lot more information than what the debug mode does, so I am hesitant to enable anyone to see that information without specifically being given the appropriate permission. Please let me know what you guys think of the current version. If there are no issues, I will release this to the modules directory tomorrow. Thanks again for all the testing and feedback!
  8. @Spica, I have changed the number format to text with that pattern - I don't really see any downsides at the moment. So that should handle you leading zero issue. As for the format option. I don't really understand what you expect: {([phoneAreaCode,0,0]) } to return. PHP substr() won't return anything with this because you are starting at 0 and returning 0 characters. Does that number always need to be: 0 or will it be different? Perhaps you could also provide with with the numbers you entered in each phone component to get the results you are getting? I am also confused about your use of the extension component. At least where I am from, this is not something that is dialed initially, but is entered after the call has been connected to get a certain phone is an office. Note the other example formats where I split the main number component into parts either side of a dash. Is this what you are trying to achieve. I haven't looked at this module in a while, but I am thinking that perhaps I should make it possible to set the format for each phone field, rather than in the config settings with a user override. I think a dev override in the field settings might be more useful - this would allow for different formats for landline vs mobile(cell) numbers. Any thoughts?
  9. Debug mode in PW does two main things - it allows PHP errors/warnings to be displayed, and it shows the Debug Mode Tools in the admin. With Tracy enabled, you get the errors/warnings, whether Debug Mode is on or off, so I am finding that I no longer need it on, and it also means that I can debug a live site easily without anyone seeing the errors and $variable testing output. I agree - we need to be able to use Tracy for non-superusers - just trying to figure out the most logical way. I feel like maybe it should simply be based on the PW Debug Mode setting and a dedicated "tracy-debugger" role. So if debug mode is off, then Tracy is only for superusers, but if debug mode is on, then non-superusers with the tracy-debugger role will have full access. This way you can create a test user with the required role and simply add the tracy-debugger role to their details and things will work. Does anyone have any thoughts on this? I have replaced all icons with inline SVG - that should deal with your issue - please let me know if it looks ok now.
  10. Take a look at: https://processwire.com/talk/topic/8410-module-toolkit/ - among other things, it lets you export a module along with all its settings and install again, already configured. It is still alpha/early beta for some features, but I do hope to get it finalized soon. Back to Tracy: I have a question for you guys. With Tracy Debugger, PW's debug mode doesn't really change error reporting anymore. It is controlled by this module and is currently restricted to superusers. So I am thinking of the need to sometimes debug when logged in as a non-superuser/guest. So should I make the module work for non-superusers when PW's debug mode is on? Or maybe a separate setting altogether than turns it on for non-superusers? Or should there be a separate config setting for enabling certain users or roles to have Tracy enabled for? Would really appreciate your thoughts on this - thanks!
  11. Sorry - I didn't check non-superusers after the recent change to the Show Debugger Bar settings. The latest version (just committed) should fix that new error! PS, I'll be adding this to the modules directory in the next couple of days, so updates will be easy via the PW Upgrade module (http://modules.processwire.com/modules/process-wire-upgrade/).
  12. Sorry about that - it was due to the change in that setting from being a single checkbox to an array with two options. The error should go away after saving the config settings again, but to ease the update, I have added a check that will prevent the error.
  13. Sorry, I still really don't get the point. Using number_format to round a value with less than 4 decimal places ends up displaying blank/non significant zeros, eg: echo number_format(0.12, 4) results in: 0.1200 Why do you want to display the extra zeros? I still don't see why "round" isn't working for you. I think this is a very useful addition - stay tuned - hopefully coming soon! It doesn't allow for breakpoints and step-throughs. Its features are: Logging dump() to DOM barDump() to the debugger bar log() to file fireLog() to the console (both Chrome and Firefox) objects and arrays are presented in a fully expandable tree interface Error reporting Visualization of errors, exceptions, warning, notices etc with a full expandable and linked Call stack, which I find incredibly helpful in isolating the source of the error. Can be to DOM or debugger bar Automatic emailing of errors in production mode Timing Total execution time Logging of custom calls for sections of code System Info Details on php and apache versions Max memory allocation for the page Number of includes files, classes and traits ProcessWire Information Access to all the info from the Debug Mode Tools on the front-end via the PW panel in the debugger bar Extra sections to the PW panel with details of the current page, its template, the fields of this template Debug Mode indicator - nice reminder/warning in case you forget to turn it off once the site is live Links to various context relevant places in the admin, as well as general admin links Hope that helps to answer your question. I am looking for feature suggestions, like @matjazp's idea for showing all available variables. I will probably also add functions and classes too. I am also looking to include some other Tracy plugins, like performance monitoring panels. I haven't seen that issue with the bar taking up more than one line. I have tested in Chrome, Firefox, and Safari. What browser are you using? Can you show me the dom of the bar so I can see what might be causing that? I have added the option to disable the bar on the backend. I went with just two checkboxes, one for the frontend, and one for the backend. I think this works well and I agree, the module is often not needed in the backend, although I am really enjoying using it for module development - it's so nice to be able to dump variables to the debugger bar, or console when it would otherwise be impossible to get them to display without logging to a log file. I have changed the description for the email address - thanks for picking that up. I have also added options to disable the Methods Info panel and the DebugMode Indicator - users upgrading will need to revisit your config settings to enable these.
  14. @pkmarkosarnych - thanks for your input, but the software you are suggesting is not useful in this situation as the OP is trying to link to map file with many URL parameters and without an image file extension.
  15. Hey teppo - I like Google's translation of your role on the board of directors of Street Workout Pori ry. How do you look in a maid's uniform? PS No sexual stereotyping intended - just a lame attempt at humor PPS Maybe that translation is legitimate - just sounds strange to an English speaker as it's not a term we would use for a role on a board of directors.
  16. Hi @Spica, Interesting that no-one has reported that until now Anyway, it should be fixed in the latest version. Please let me know how it goes for you and thanks for the report. BTW - I made it so that only the "number" portion of the field is considered for the required check.
  17. A quick update - I have added a row of buttons to various parts of the PW admin at the bottom of the PW panel. The big news though is that I found out the FireLog() actually works with Chrome too. You just need this browser extension: https://github.com/MattSkala/chrome-firelogger https://chrome.google.com/webstore/detail/firelogger-for-chrome/hmagilfopmdjkeomnjpchokglfdfjfeh This is awesome for debugging AJAX calls.
  18. I understand that round() converts a number to a float before rounding, but I don't understand how you are getting a rounded result of: 1.0 for the Tracy timer - what actual value would ever get rounded to 1.0 - it should remove the decimal place completely and leave just: 1 - shouldn't it? I feel like I am missing the problem here somehow - sorry for being dumb. Do you have any suggestions on how to fix what you are seeing?
  19. Just a quick comment as there has already been lots of great info offered up. SVGs are an amazing way to make interactive data visualizations, whether you use charts, maps, or colored icons, or diagrams. They are especially cool if you using data binding techniques via something like Angular, Meteor, or React, or one of a gazillion other new JS frameworks
  20. @matjazp - can you please see what happens if you specify different sleep intervals. I am occasionally getting 1.0 etc, but changing the sleep value usually results in something with 4 decimal places. @Ipa - I expect you might have debug mode turned off. That feature currently needs it turned on, although I'll see if it makes sense (or is possible) to get that to work without it on. On another note, the current version has a new debug mode badge which I think is a very useful reminder: Also, I have dealt with the issue of incorrect location reporting when calling the TD:: or shortcut/alias methods, so location reporting is now on by default. I think it's a handy addition. For those of you who are updating, you'll need to set this manually, so check the "Show Location" checkboxes in the module config settings. This means that there is really no reason to ever call the native Tracy methods, so I have removed that info from the first post and the Github ReadMe.
  21. There are some issues with editing images via profile - https://github.com/ryancramerdesign/ProcessWire/issues/989
  22. Hi @jrtderonde and welcome to the forums. The first thing I notice is that you are uploading the file directly to the assets/files/page_id/ location. You should upload to a temp directory first, then $new->image->add('full_temp_path'), and then unlink from that temp location.
  23. New "Method Info" panel to give a quick rundown of each method and their available aliases/shortcuts:
  24. Right - it comes down to when your version is initially defined vs the one in this module. When I tested re-defining one of these shortcut methods, it was in a template file, which is after this module, which is why I added the option to disable these as needed.
  25. Thanks @tpr for the confirmation of decimal places. So am I right in assuming that you unchecked "t" from the Enabled Shortcut Methods setting and it worked as expected? Of course I could add a TD::t() option, but I feel like I might have already gone overboard here Thanks - corrected now!
×
×
  • Create New...