Jump to content

Pavel Radvan

Members
  • Posts

    50
  • Joined

  • Last visited

Everything posted by Pavel Radvan

  1. OK. That is good. I am preparing another field for contract page which should contain some crucial and personal data for contracted customer - i.e personal identification number, address and other details. So I could use PageTable for this...also i could try to switch...need to know more details...
  2. It is very nice from you. I think it is good to know that there is option to create new pages then use same already in system. At least for my project is better to have every time new page, because every new page is unique for my customer even if it has same name. He has business with Antiquities and every item from 1 contract is unique - so every time is new contract there are also new unique items on it. For example item "Vase with decoration pictures" from one contract is not same as same named vase from another contract. For this reason every item (child page) is new and unique.
  3. Hi. I tested all and I now know that inputfieldPage after save is creating new children pages in referenced page. It is working nice also with your numbering. I have condition in page template when showing on frontend, that if item has already older field with text name of item position it will use it. Otherwise will display new auto number with wireLen adjusted formatting (1 -> 01). It works nice and I will just make changes to code for handling only new pages, but it is not needed. For new chilren pages it nicely fill auto numbers. There will be testing from customer so I will see after their editing how it goes... Regarding PageTable - it is very nice - I am very considering it to integrate. Is needed to pay for whole ProFields from Ryan or is it working anyway ? Also I am not so sure if I have data to integrate it with this (lots of imported already)...
  4. I have tried hook from you and it works - so thanks very much... I have it in ready.php and it appears that it is doing what I needed. What it does more is that it puts value 1 to current existing data, but it is OK, because this numbering is only for new data. I will test it more and let you know
  5. Hi. I have to specify that example with house and floors was just to explain what I need. I hoped that it will help anyone to explain what I need. My project is more complicated but your approach is certainly right and I have to accept that I would like to have data in my project in ideal situation you noticed... For better understanding of whole context I will explain my project more and hope you will catch the idea: It is currently in development and it is system build completely on PW installed on dedicated machine on local network and primary intended for intranet use or access by VPN. Main task is evidence of my customer contracts, products, suppliers and other data. I had to import to PW quite lots of data from old system which was built on MS Access db. I exported tables from Access and imported them as child pages using module BatchChildEditor. Now I have for example page with about 1200 children(1.type of contracts) and there is corresponding another page with about 5000 children (contract specific product items). There is also another page with about 8000 children (2.type of contracts and corresponding page with about 50000 children (contract specific product items). There are also other pages with suppliers and other data. But main data are contracts and product items. I had interconnected children from contracts and product items and populated links for page reference field by script and very good advice from Ryan and Gebeer. So this is very short explanation how now system is. So I can not simply place specific contract product item children ("floors") and put them to specific contract children page( "house") now - I have already data in pages and children. If I wanted to do it the way you wrote, it could take me a lifetime to change this structure... For this reason I specified as simply as possible using that example with house and floors what now want to do. It is mainly for product item s field which is number of item in context of contract - so for example one contract has 20 items and every item has its "number", but it is not ID or unique number but just number which was entered when that item was created. Now this numbers are in data as text field like "01", "02". Reason was that it was better for import. Customer has access to admin backend to edit data, because I will not create new forms on frontend since in PW backend they are good. What I want is numbering for new items which will customer create by using PW. So for old data which are now in system it is not needed but for new I just prepare integer field and add it to template of product item children. So when new children are created in context of referenced contract I need to auto increment and populate that number in each item. It does not matter that there will be same number in field in another new items, because those items will be connected on another contract referenced children page.. Customer is using quick adding of items by entering only names on each row (Input Page List Select Multiple) and click on SAVE. Here is screenshot (it is referenced field with input type Page List Select Multiple): In that moment could be very nice that after click on save (Uložit) for each new item is populated that integer number field with auto generated numbers from 1. Regarding conflict with existing pages it is problem, because every product item which customer create for new contract is unique - so there is always needed to create new and not use existing. So when new item is created it is always needed to be unique. what do you think about it now ? Do you understand now ? Will your hook work ?
  6. Hi. I updated structure in quoted schema from you: ├── Homepage ├── Houses (template: houses) │ ├── Small House (template: house) │ ├── Medium House (template: house) │ ├── Big Mamas House (template: house) │ │ └── ref_floors: (page reference field: "parent=floors, template=floor") --> field with increment from floor template │ │ ├── 1 Basement │ │ ├── 2 1st Floor │ │ ├── 3 2nd Floor │ │ └── 4 3rd Floor │ ├── ... │ └── Super Large House (template: house) ├── Floors (template: floors) --> here in template floor is field "number" (integer) -- > need to increment from 1 for each house page │ ├── 1 Cellar (template: floor) --> format is "number" "name" (not needed in this order) │ ├── 2 Basement (template: floor) │ ├── 3 1st Floor (template: floor) │ ├── 4 2nd Floor (template: floor) │ ├── ... │ └── x Attic (template: floor) └── ... Real structure is with lots of more fields in templates, but for some base schema and functions this is main part... Is that more clear ?
  7. I need to have working some specific structure of data I did not find anywhere on forums yet. For simplicity I will specify what I would like to have working: There is a page with child pages. I could name it for example "houses". All children pages are using same template (house) with page reference field to another page children(floors). Referenced page for example "floors" has children that all are using their same specific template (floor). On this template is page title or name, other fields and integer field of floor number (floor_number). When new child of this page is created I need to have that integer field automatically populated from 1, but only in context of referenced page. So when I create house named house1 and then in editing of house1 I create for example 3 floors I would like to have floor(title of page) 1(integer field), floor 2, floor 3 but only for that house1. Name of floor could be page title or name and it is text ("floor") and number is just integer field (1,2,3). When I add more houses I could have for example have NewHouse (name of page) with basement 1 and floor 2. I could add BigHouse also with basement 1, floor 2 and floor 3 .... etc.. When creating that floors I would like to use quick creating multiple new items which allows input page select multiple - so I just want to input floors on several rows and hit save. In that moment could be nice to have all that new floors automatically numbered from 1 on that integer field (floor_number) I want to use Page Reference field with input Page List Select Multiple. How could this be accomplished ? Is there some good way how to make that integer field to increase automatically but only for specific ref.page ? Thanks very much of any idea or help with this
  8. Hi. Thanks and I tried new version v1.7.1 and now it works nice. It appears that you have two versions - 1.7.1 newest commercial (i could download from baumrock) and directly from PW is possible to update to 2.1.0 Which one is right ?
  9. Hi. This function you write is ok - I need to have already linked pages visible and option to add ONLY new to referenced page children which will be also linked. I do not need to see list from dropdown, because every children is new and always unique and others are not used for new page. Customer do not need to choose from previous created children pages of referenced page, because every new one is unique... For this reason I need only to have visible list of already linked children pages from referenced page (already done by script from imported data) and to disable that "add" button with dropdown list. Button "create new" is needed so this should be there ... Customer is creating new data by link from frontend which starts function and hook and creates new page (with predefined major data) where is that page reference field I am talking about. In this case there is no linked page and customer do not need to click and see other children pages to select (it is for him of not use) , but needs ONLY to add new, because every time it is new (no need of other items in referenced page children) When customer is editing data (again in backend) then he needs to see previously selected linked children pages from referenced page and again do not need to have option to select from others... He needs to change linked items or to create new. Do you understand now ?
  10. I have to specify that I have page for contracts and it is linked to another page to its children (products items) - so for this reason it is used page refernce field. In system I am working on is about 1200 pages for one type of contract linked to about 5000 pages of product items and about 8000 pages for other type of contract linked to about 50000 pages of product items. I hope this help to explain more the situation...
  11. It is more complex...I have pages in PW which are contracts - for more info please look here where is all explained: https://processwire.com/talk/topic/29959-link-page-with-multiple-pages-by-field-value-in-backend/ I completed import of data and linked tables (pages) with other data from pages by script. So now parent pages are linked with children pages. Parent page has its template and children page also has its template. I could use "children" tab, but part of contract page is not only children from one page, there are also other fields in template... So I need just have in parent page template field with visible linked children pages and option to add only new pages and not to show dropdown - it is not for my need it is mainly for customer request. Just to have only "create new" button and not accidentally show large dropdown by click on "add" button... Is that more clear for you ?
  12. I need reference field to have in admin pages linked and editable data for customer... Is possible to achieve same design of editing parent page with children (linked to it) other way ?
  13. Hi. Yes it is selected and that function I want to let customer add new child pages. Input field is Page/ListSelectMultiple. Here is screenshot - site is my language (Czech as default) As you could see there is selected and linked one item (child page) and that first button with dropdown is first one "Přidat" - in English it is "Add". Second one is to create new "Vytvořit novou" - this I need to have visible... I need to hide that first button with dropdown ("Přidat") Or if it is possible to have same function with same design without need of dropdown selections ??? What do you think ?
  14. Hi. I could explain. I am working on system for my customer who has contracts and in contracts are products items. Parent page is contract and child pages are product items. Every product items is unique so when customer adds new product item it is not used in other contracts then current. I had to import older data from MS Access tables and I used page reference field only for linking specific product items for parent contract page. Customer is using PW admin for editing data since I do not want to create extra forms for same functions on frontend. So now I have all in PW, but customer wants to hide that "add" button - mainly to disable dropdown, because is using only "new" button for adding only new child page. For this reason I need to hide that dropdown. So result should be only "new" button visible and that "add" hidden... If there is possible to have some permission or access rules setting to allow for some user in PW only to add new child page without dropdown of all current - it would be nice... Do you understand now ?
  15. I am little stuck on option to hide dropdown button on page reference input. I have child pages from page reference field linked and visible and they should not be addable from list of referenced pages. I need only option to add new child pages from parent page but not to show dropdown of all not linked. New child pages are every time unique so when they are added they are linked with parent Is possible to disable or hide that dropdown "add" button ? Thanks for any help...
  16. Hi. I created topic here: https://processwire.com/talk/topic/30167-rockpdf-pdf-filename-format-and-option-to-sign-documents/#comment-242526
  17. Hi. I am sorry I did not have time sooner. Regarding my questions in pub I created topic for them here. So first was about pdf filename format. I have in ready.php this: // add hook after page has been saved - pdf pro ks $wire->addHookAfter("Pages::saved(template=ks-import-hlavicka)", function ($event) { $page = $event->arguments(0); /** @var RockPdf $pdf */ $pdf = $event->wire->modules->get('RockPdf'); $pdf ->load("/site/templates/ks-tisk.php", [ // make saved page available as $page // in the loaded document file 'page' => $page, ]) ->saveToField( page: $page, field: 'pdf', filename: $page->name, append: false, ); }); $page->name is for example nz-0556-24 and when I look for file in page editor it shows this: It is filename with "." at the end. When I click on it and save it I have file named "nz-0556-24_.pdf" Is possible to eliminate that "." and "_" ???? Next question was just how to integrate some secure form of electronic sign of PDF documents. I could include image with sign but there could be nice to have some option to include digital signatures and certificates same way as is possible to normal PDF documents. I searched for mPDF about it but there is no option there. There is info that mPDF is not supporting it on github : https://github.com/mpdf/mpdf/issues/184 So for me it would be nice to have it in RockPdf but it is not crucible now. Just let me know what could be done with that filename...
  18. Hi. I saw your newsletter and you mentioned country I am from - Czech Republic - it is nice... I have to mention that last few days I implemented Rock PDF (I have subscription for Suite) and it is wonderful. I have some question about it. Since I will be using it for PDF contracts I have to create PDF file with name created from PW Page title or name - name works fine, but it creates name of file witch ends with "." When I save it, it creates file with this format PageName_.pdf How to disable that "_" on end of file? Next question is how to include some form of signage to that PDF. Do you have any plans to have option to include signatures or digital sign or for example QR codes? Thanks for answer Pavel
  19. It it here https://processwire.com/talk/messenger/5614/?do=findComment&comment=34986
  20. Thanks for reply. I am just figuring another think and it is validating data before creation of new page - it is for preparing right contract number so customer just click on new contract button on frontend and PW should prepare new page with constructed name from several parts and fields. But I need to validate if there is not already another contract number already, but before it is created. I already discussed this with @ryan, but it seems that he is quite busy. I will invite you to this and just need some small hint to figure it...
  21. It seems I find myself where is problem with script from you. This version is working for me: foreach($pages->find("template=ks-import-hlavicka") as $cp) { $polozky = $pages->find("template=polozka_ks, id_hlavicka_ks={$cp->id_hlavicka_ks}, status<" . Page::statusTrash); $cp->Polozky_ks->add($polozky); $cp->setAndSave('Polozky_ks',$polozky); } Most important is that in setAndSave is needed to specify that page field to which I need to save changes and update data... Without it there was no change in data...and no linked other pages... Regarding page reference field with single-page input, there is not needed to use "add" method. It throws error if I used it for adding data, because I had same data already on same page... I tried to add linked page with customer data to contract page and it is always only one customer for contract... So thanks for your initial hint with script and now it is working...hope this could help to others also...
  22. Hi. I did not have time to test it sooner so I did it today. I used your script which was run from tracy console and there is final variant of it : foreach($pages->find("template=ks-import-hlavicka") as $cp) { $polozky = $pages->find("template=polozka_ks, id_hlavicka_ks={$cp->id_hlavicka_ks}, status<" . Page::statusTrash); $cp->id_polozka_ks->add($polozky); $cp->setAndSave('polozky'); } where id_polozka_ks is that integer id field which is on both pages of contracts and products. As you could see in one of contract pages, there is no linked data: But system is linked to see items from products template: Script just reported that executed with 4487.67 ms, 15.1 MB What do you think of it - is there any problematic part or I need some permissions to interconnect data to pages ? Thanks for reply Pavel
  23. OK. Now I understand...so that is only github update check date...I see it is on other modules too...
×
×
  • Create New...