Jump to content

antpre

Members
  • Posts

    128
  • Joined

  • Last visited

Everything posted by antpre

  1. Thanks to all for your answers. I think I will follow Martin's advice of having the users log-in with their email. I won't show them their user page name. I can create the name programmatically or I can use the adjustName option. If the users don't see the name... they won't care ;-) Have a great day
  2. Hy there, This question will certainly sound stupid. Sorry for that. Regarding user and the name field of the user template. I understand that we cannot have users with the same name (meaning system name field). I am working on an e-learning site and people could have the same name. How to handle that ? The probleme : So far I used the user the system field 'name' for the name and an other custom field for the given name. Here the chance that 2 users have the same name is not negligeable. And the second to register will not be able to register with his name. the solution I see : Like in the back end in case the name already exist add an incremental digit after the name. But that's not realy cool cause the user will not see his exact name.. An other solution I see is two have two custom fiels one for family name and an other one for given name. Thereafter I can concatenate the two values to feed the system field 'name'. their I can still implement the control mentionned above but the chance that two users have the same name is much less. These users will only acces the site through the front end and therefore will use a custom login form. I am sure that there is some best practice on how to handle this. thanks in advance.
  3. Thanks a lot. How could I miss this ?!? Are you Santa Clauss Have a great day.
  4. Hello, I am sure we all find it painfull to propagate changes made in fields/templates/configuration for development site to production site. I would very much love to have the possibility to export fields/templates/configuration from one site to another with a simple export/import function.... There has been some work in that direction but they were discountinued ( https://processwire.com/talk/topic/2117-continuous-integration-of-field-and-template-changes/). I guess it's a big wish... but its christmass after all !!! For info, Drupal 8 (or Backdrop a fork of Drupal7) comes with that in core now. Bye
  5. I there. I have been using the code posted by Diogo ( # 61) on this thread to create an edit form. It'has been working fine. I had included pagefields on the form without problems. But Lately I tried to include in the form a page field that has a custom selector (not the php selector) and there it failled. the field is displayed on the form but does not display the recorded value of the field and the drop down list doesn't display the pages I expected (the one I can see if I go to the editpage on the backend). Any Idea how to fix this thanks in advance
  6. hi, Coming back on the issue I raised in a post above regarding using Fredy to edit users. Just wanted to say that the permission control problem I mentionned above (ie edit field not appearing for user with a edit role for that page). Isn't occuring anymore. I don't know what I did differently but it's working now. Sorry for this. However the first problem I was mentioning is still there : in a form to edit a user profile, I can't target the fields I want in the edit form. with this: echo $fredi->email($student); I get a form with all the fields of the template. If I test the same on a page (not from the user template) it works fine the modal only displays the fields I targeted. Any clue ? I am running this on the latest dev (PW2.6.21, php 5.4.42).
  7. Thanks a lot. With quotes it woks well. I m still wondering why it was working without quotes in pw2.6.1 and why it is not working without quotes pw2.6.21. Is it intentionnaly done or is it a bug that appeared in bettween (in that later case i should then repport it on github) In some other CMS (drupal for instance) in the admin interface (edit page) this is working without quote like in pw2.6.1....
  8. Thanks for your answer. your are rigth spaces are repalced by %20. Its actually a link to a mp4 file in an amazon S3 bucket.The file name has spaces in it. When I copy the url with cyberduck it replaces the spaces by %. (in the url given below i ve removed the domain name). s3.amazonaws.com/1-talk/140629_PP%20Birmingham%20820710%20extrait-11.mp4 So far I had no problem with that. I use it in an other installation of PW (latest stable version) where it works. but in the latest dev version it doesnt. When I paste the url in the url field type and save the page with pw2.6.1 : I have no error message and the url in the edit page keeps the %. When I inspect the code of the page the url appears with the %. And the link works (actualy when i click on it then it appears with space I guess the browser converts the % into spaces). <source src=s3.amazonaws.com/1-talk/140629_PP%20Birmingham%20820710%20extrait-11.mp4 type='video/mp4' /> with pw26.21 : When I save the page I get an error message and the % in the url are replaced by spaces. When I inspect the code of the page. The url appears with spaces but it is considered as a link until the first space,rest of the url is not considered as a part of link (not in blue and underlined). therefore the link doesnt work. <source src=amazonaws.com/1-talk/140629_PP Birmingham 820710xtrait-11.mp4 type='video/mp4' /> Hope my explanations are clear..
  9. Hello, Running into a probleme. Any help would be appreciated. I have a url fieldtype. When I insert urls with a '%' symbol in it I get a :itemUrl: Error found - please check that it is a valid URL The url is a valid url. Once saved all the % are stripped out from the url and replaced by a spaces. This is running on PW dev version 2.6.21 and php 5.4.42 (I was on a earlier version of php, I then up dated it to 5.4.42 to see but didnt change anything) The funny thing is that I have an other test site running on PW 2.6.1 where this problem doesn't occur. Any Idea Thanks
  10. Hy, Thanks for the module. It's working on the front end for me but not on the back end. Is it normal ? Thanks
  11. Hy, Thanks a lot to take time to answer my question. Didn't have time to test it. But took time to try to understand better (had a look at the inputfieldForm module code and read about the $_server variable). Lots to learn for me as you can see. Thanks again
  12. Thanks for answering my post. My use case is a very simple elearning site where users with role 'teacher' manage a group of users with role 'student' and give them access to diferent documents (learning material). On the teachers home page. I list all the student belonging to the loged in teacher. For each student I output a link to go to a page where there is a form to edit the user profile of that student. in this link i pass as a url argument the id of the given student : <a href= "<?php echo $pages->get(1049)->url.$stid;?>" > modifier les documents </a> where $stid is the student user id. On the page with the form I get the id from the url segment with the $input variable. the rest of the code is a snipet I got from an other post on the forum. On this form Only a few fields from user template are displayed not all of them. With the different tests I did I got the idea that it was the save function that was reloading the page. As far as security is concerned, I thaught the input->urlsegment(1) was doing some sanitasation of the variable. I didn't do it now but my plan was also to include an if statment so that this page is only accessible by user with role 'teacher' and other if statment to make sure the urlsegment is a proper user id and deny acces to anything else. Here is the code. <?php $asm = $modules->get("InputfieldAsmSelect"); // Get the user you need to edit from the url argument $userId = $input->urlSegment(1); $mypage = $pages->get($userId); // Populate with the names of the fields you want to exclude OR include (see instructions below) // Leave empty to output all the fields $myfields = array('ref_package','information'); $form = $modules->get('InputfieldForm'); $fields = $mypage->getInputfields(); // If array is not empty use it to filter the fields if ($myfields){ foreach($fields as $f){ // Output all the fields minus the ones listed in the $myfields array // Instead, to output only the fields that are in the array, remove the (!) from the condition if (in_array($f->name, $myfields)){ $form->append($f); } } } // Else, include all the fields else { $form->append($fields); } // Add save button $field = $modules->get('InputfieldSubmit'); $field->attr('id+name', 'submit_save'); $field->attr('value', 'Save'); $field->label = "submit herei"; $form->append($field); // Process the form if($input->post->submit_save) { $form->processInput($input->post); if(!$form->getErrors()) { $mypage->of(false); // turn off output formatting before setting values foreach($mypage->fields as $f) { if (in_array($f->name, $myfields)){ $mypage->set($f->name,$form->get($f->name)->value); } } $mypage->save(); } } // Render the form echo $form->render(); ?> As stated earlier I am fairly new to php and PW (coming from drupal but never dared to code in this complex environement Thanks
  13. Hy there, I am fairly new to PW and php so please bare with me. I am having a form to do some front end editing (editing some fields of a selected user). I pass the user's id with a url segment to the page where the form is. it is working fine. But when the submit button is clicked the fields are processed and the page is saved ( $mypage->save() ) at this point the page reloads with its normal url (ie without the url segment passing the user's id). As a result when the page is reloaded there is an error because it cannot find the url segment. from what I understand it is the save() function that reloads the page. Is there a way to alter the way the save function reloads the page. Or simply a way to prevent the save function to reload the page or just an other way to do what I am doing... Thanks in advance
  14. Thanks for your hint. I looked into fredy module which is use to display edit form on the front end. I didn't have much time so I did a bulk copy/paste of all the css and js files included and it worked. I will take time to clean that to keep only the need css and js file for the asmselect field and I will report it back here. So that if anyone needs this information in the future... Thanks
  15. hi, Still quite new to processwire so there may be things I am not fully understanding. 1) Yes the form is build using the API. I used the code from on this post https://processwire.com/talk/topic/59-module-want-form-builder/page-4#entry11639 2) the markup seems to be ok to me <li class='Inputfield InputfieldPage Inputfield_ref_tag ui-widget InputfieldNoFocus' id='wrap_Inputfield_ref_tag'> <label class='InputfieldHeader ui-widget-header' for='Inputfield_ref_tag'>ref_tag<i class='toggle-icon fa fa-angle-down' data-to='fa-angle-down fa-angle-right'></i></label> <div class='InputfieldContent ui-widget-content'> <div class='InputfieldAsmSelect'> <select id="Inputfield_ref_tag" name="ref_tag[]" multiple="multiple"> <option value='1022'>tag1</option> <option value='1023'>tag2</option> </select> 3) I have added a bunch of js and css file taken from the admin template and from asmselect module try to make it work. Here is the list : InputfieldAsmSelect.css , jquery.asmselect.css , JqueryUI.css , inputfields.css , InputfieldAsmSelect.js , inputfields.js , jquery.asmselect.js ,JqueryUI.js thanks for your help
  16. Hy there, I have a form that I want to use to edit pages in the front end. I have a field that has an asmselect inputfield in the backend and I would like to display it with that same asmselect inputfield in this form on the front end. But it displays a standard mutli-select field. I fail to get the asmselect to show up in this form. I use a snipet of code found on the forum to create the form. It render the fields with the proper html tags (for instance this field has the <div class='InputfieldAsmSelect'>). I understood that their is a need to load specific css and js files to make it work. I tried to include some of the js and css included in the asmselect module. not working. Could some body tell me which is the correct way to do this. Thanks
  17. Martin thanks for your answer. In the first case where I get the link plus the modal window with all the fields here the changes get recorded. In the second issue when I m not logged with the superuser. There u don't see the edit link. But with that same user, if log in in admin I can make change to the users because I gave that role the right to modify users. You think in that case there could be some different control applied from the front end?
  18. Hy, Thanks for the module I ve been testing fredy with pages (ie non admin pages) and have had no problem there. But when I try to use fredy to edit users. There I encounter a strange behaviour. No matter what field I target the full user edit page appears in the modal window (with all of the users fields). Is it a normal behavior. Did I miss something ? Is there some limitation while using users. Today, I tried to dig in a bit more. Did a fresh install (dev 2.6.15) and install fredy. I encounter the same probleme discribed above. And found out also that the permission control that work with fredy for 'normal' pages doesn't work when you r triying fredy to edit user. I gave editing rigth on the user template to one role. user having this role dont see the freedy edit link. Juste in case i put an example of code I used in my test to output the fredy link. $student = $users->get(1019); echo $fredi->email($student); thanks
  19. Hello there, I have been doing a bit of testing on user groups and pagelistepermissions and (so far) I had no problem. Works as intended. Smoth and simple yet powerfull. Thanks to both of you for your work. I will dig into it further as i am trying to do my first project with PW which is a sort of elearning site. It will rely heavily on your modules. If I had a wish list concerning user groups it would be related to UI and usability. Actually it is more of a dream cause I imagine it would require lots of work. the problem is that It's a bit difficult to keep a clear picture of what pages are in each groups and which users are associated with each group. So you could have the main PW page tree on the left where all your ressources are listed (documents and users) and a user group pane on the right side (ie side by side with the PW pages tree) with the user groups listed in a hierarchal tree. On that dedicated tree view each group would display their users and documents. In that manner you could see all your groups and their associated contents in one single screen. And then you would be able to drag and drop from the left (main pages tree of PW) to the right (the user groups dedicated tree view) to add users or ressources to groups... I have seen and tested this sort of UI in Modx Revo manager (2.3). It becomes a breeze to play with user groups. Ok I may be dreaming... I don't even know if it's curently possible to handle this sort of functionnality in PW admin UI. Bye
  20. Hy, Thanks a lot for your feed back and your readyness to make it into the official PW repository It will make easier for newcomers like me to find it. It difinitively adds interesting functionalities to PW. Do you plan to add both modules (user groups and pagelistpermissions) ? Thanks again
  21. Hello everybody, I am new here (coming from Durpal and currently testing process Wire vs MODX). I would like to test processwire for one of my project. This project requieres the ability to restric page views on per user group basis. Which is the functionnality your module provides. Before diging in further I would like to know what is the status of this module : There are not much activity since one year on the forum on this subject, It is currently not referenced in the module directory of PW and lives only on Github. Is there a reason for it not been yet on the module directory ? Is the module ready for production use ? Thanks a lot for the module you created. I realy hope It is stable enough so that I can use it. Regards
×
×
  • Create New...