Home › Forums › Guriddo Suito PHP › Upgrading from Triband PHP to Guiddo – any docs?
Tagged: Gurrido upgrade
Hello – I have just downloaded the latest version of Guriddo 4.8 and want to upgrade from the older Triband version installed. I thought it might be a case of just replacing libraries, but the file structure seems to have changed such as where CSS is no etc and and CSS files I was using like jqgrid.css I cant find.
Can you point me towards some documentation that describes how to upgrade from the old version to the new Guriddo structure? Or the easiest way to achieve this?
I also use jqChart in my live version, so not sure how I upgrade this?
Any help my save me a lot of time – so appreciated.
Regards, Chris.
Hello – I have managed to put this all in successfully but if you do have any documentation on how to upgrade might be worth it incase I have missed anything.
All works great though!
Cheers – Chris.
Hi – I do have a problem since the upgrade getting PDF export to work. I have looked at all the documentation and examples and still cant figure it out. In your examples you require …. /tcpdf/lang/eng.php and cant see that anywhere but sure that is not the reason.
I am assuming without touching anything it will be using your tcpdf library and settings held in /External?
The error I am getting is:
<b>Strict Standards</b>: Only variables should be passed by reference in <b>/home/zipnfcuk/public_html/facilities/gridChartFramework/php/PHPSuito/jqGridExport.php</b> on line <b>764</b>
<b>Strict Standards</b>: Only variables should be passed by reference in <b>/home/zipnfcuk/public_html/facilities/gridChartFramework/php/PHPSuito/jqGridExport.php</b> on line <b>764</b>
<b>Strict Standards</b>: Only variables should be passed by reference in <b>/home/zipnfcuk/public_html/facilities/gridChartFramework/php/PHPSuito/jqGridExport.php</b> on line <b>764</b>
<b>Strict Standards</b>: Only variables should be passed by reference in <b>/home/zipnfcuk/public_html/facilities/gridChartFramework/php/PHPSuito/jqGridExport.php</b> on line <b>764</b>
<b>Strict Standards</b>: Only variables should be passed by reference in <b>/home/zipnfcuk/public_html/facilities/gridChartFramework/php/PHPSuito/jqGridExport.php</b> on line <b>764</b>
En example of the php handling the grid is:
[code][/code]
<p class=”p1″><?php</p>
<p class=”p2″><span class=”s1″>ini_set(</span>’display_errors'<span class=”s1″>, </span>’on'<span class=”s1″>);</span></p>
<p class=”p3″>error_reporting(E_ALL);</p>
<p class=”p3″><span class=”s2″>if </span>(!<span class=”s2″>isset</span>($_SESSION[<span class=”s3″>’grid_query'</span>])) {</p>
<p class=”p3″>session_start();</p>
<p class=”p3″>}</p>
<p class=”p3″>$_SESSION[<span class=”s3″>’user_type'</span>]==3 ? $editable=<span class=”s2″>false </span>: $editable = <span class=”s2″>true</span>;</p>
<p class=”p2″><span class=”s2″>include </span><span class=”s1″>__DIR__ . </span>’/../../include/jq-config.php'<span class=”s1″>;</span></p>
<p class=”p3″>$conn = <span class=”s2″>new </span>PDO(DB_DSN,DB_USER,DB_PASSWORD);</p>
<p class=”p2″><span class=”s1″>$conn->query(</span>”SET NAMES utf8″<span class=”s1″>);</span></p>
<p class=”p5″>// Create the jqGrid instance</p>
<p class=”p3″>$conn->setAttribute( PDO::<span class=”s3″>ATTR_EMULATE_PREPARES</span>, <span class=”s2″>false </span>);</p>
<p class=”p3″>$conn->setAttribute(PDO::<span class=”s3″>ATTR_ERRMODE</span>, PDO::<span class=”s3″>ERRMODE_EXCEPTION</span>);</p>
<p class=”p3″>$grid = <span class=”s2″>new </span><span class=”s4″>jqGridRender</span>($conn);</p>
<p class=”p5″>// Set the SQL Data source</p>
<p class=”p2″><span class=”s1″>$grid-></span>SelectCommand<span class=”s1″> = $_SESSION[</span>’grid_query'<span class=”s1″>]; </span></p>
<p class=”p5″>// passed by calling page</p>
<p class=”p5″>// set the ouput format to json</p>
<p class=”p2″><span class=”s1″>$grid-></span>dataType<span class=”s1″> = </span>’json'<span class=”s1″>;</span></p>
<p class=”p5″>// Let the grid create the model</p>
<p class=”p5″><span class=”s1″>$grid-></span><span class=”s3″>table</span><span class=”s1″> = </span><span class=”s3″>’tags'</span><span class=”s1″>; </span>// define the tabel used for deleting</p>
<p class=”p3″>$grid->setColModel();</p>
<p class=”p3″>$grid->setUserDate(<span class=”s3″>”d-m-Y”</span>);</p>
<p class=”p5″>// set labels in the header</p>
<p class=”p5″>/* Below will differ based on the type of report being executed*/</p>
<p class=”p5″>/* To be included so can set right columns settings for the query*/</p>
<p class=”p2″><span class=”s1″>$grid-></span>exportfile<span class=”s1″> = </span>’ZipNFC_tag_list.xls'<span class=”s1″>;</span></p>
<p class=”p3″>$grid->setGridOptions(<span class=”s2″>array</span>(</p>
<p class=”p2″>”rowNum”<span class=”s1″>=>30,</span></p>
<p class=”p3″><span class=”s3″>”rowList”</span>=><span class=”s2″>array</span>(10,20,30,50),</p>
<p class=”p2″>”sortname”<span class=”s1″>=></span>”ID”<span class=”s1″>,</span></p>
<p class=”p2″>”sortorder”<span class=”s1″>=></span>”ASC”<span class=”s1″>,</span></p>
<p class=”p2″>”hoverrows”<span class=”s1″>=></span><span class=”s2″>true</span><span class=”s1″>,</span></p>
<p class=”p2″>”toppager”<span class=”s1″>=></span><span class=”s2″>true</span></p>
<p class=”p3″>));</p>
<p class=”p6″><span class=”s1″>$myformat = </span><<<FORMATDETAILS</p>
<p class=”p2″>function MyFormatter (cellValue, options, rowdata)</p>
<p class=”p2″>{</p>
<p class=”p2″>var action_html = ‘</img>‘;</p>
<p class=”p2″>return action_html;</p>
<p class=”p2″>}</p>
<p class=”p2″>function StatusFormatter (cellValue, options, rowdata)</p>
<p class=”p2″>{</p>
<p class=”p2″>var statusString;</p>
<p class=”p2″>if(cellValue == 1){</p>
<p class=”p2″><span class=”Apple-converted-space”> </span>statusString =<span class=”Apple-converted-space”> </span>”active“;</p>
<p class=”p2″><span class=”Apple-converted-space”> </span>}</p>
<p class=”p2″>else{</p>
<p class=”p2″><span class=”Apple-converted-space”> </span>statusString =<span class=”Apple-converted-space”> </span>”inactive“;</p>
<p class=”p2″><span class=”Apple-converted-space”> </span>}</p>
<p class=”p2″>return statusString;</p>
<p class=”p2″>}</p>
<p class=”p2″>function LabelledFormatter (cellValue, options, rowdata)</p>
<p class=”p2″>{</p>
<p class=”p2″>var statusString;</p>
<p class=”p2″>if(cellValue == 1){</p>
<p class=”p2″><span class=”Apple-converted-space”> </span>statusString =<span class=”Apple-converted-space”> </span>”Yes”;</p>
<p class=”p2″><span class=”Apple-converted-space”> </span>}</p>
<p class=”p2″>else{</p>
<p class=”p2″><span class=”Apple-converted-space”> </span>statusString =<span class=”Apple-converted-space”> </span>”No”;</p>
<p class=”p2″><span class=”Apple-converted-space”> </span>}</p>
<p class=”p2″>return statusString;</p>
<p class=”p2″>}</p>
<p class=”p6″>FORMATDETAILS;</p>
<p class=”p3″>$grid->addCol(<span class=”s2″>array</span>(</p>
<p class=”p2″>”name”<span class=”s1″>=></span>”Action”<span class=”s1″>,</span></p>
<p class=”p2″>”editable”<span class=”s1″>=></span><span class=”s2″>false</span><span class=”s1″>,</span></p>
<p class=”p2″>”sortable”<span class=”s1″>=></span><span class=”s2″>false</span><span class=”s1″>,</span></p>
<p class=”p2″>”resizable”<span class=”s1″>=></span><span class=”s2″>false</span><span class=”s1″>,</span></p>
<p class=”p2″>”fixed”<span class=”s1″>=></span><span class=”s2″>true</span><span class=”s1″>,</span></p>
<p class=”p3″><span class=”s3″>”width”</span>=>30,</p>
<p class=”p2″>”search”<span class=”s1″>=></span><span class=”s2″>false</span><span class=”s1″>,</span></p>
<p class=”p2″>”align”<span class=”s1″>=></span>”center”</p>
<p class=”p2″><span class=”s1″>), </span>”first”<span class=”s1″>);</span></p>
<p class=”p2″><span class=”s1″>$grid-></span>toolbarfilter<span class=”s1″> = </span><span class=”s2″>true</span><span class=”s1″>;</span></p>
<p class=”p3″>$grid-><span class=”s3″>navigator</span> = <span class=”s2″>true</span>;</p>
<p class=”p3″>$grid->setNavOptions(<span class=”s3″>’navigator'</span>, <span class=”s2″>array</span>(<span class=”s3″>”excel”</span>=><span class=”s2″>true</span>,<span class=”s3″>”pdf”</span>=><span class=”s2″>true</span>, <span class=”s3″>”add”</span>=><span class=”s2″>false</span>,<span class=”s3″>”edit”</span>=><span class=”s2″>false</span>,<span class=”s3″>”del”</span>=>$editable,<span class=”s3″>”view”</span>=><span class=”s2″>false</span>,<span class=”s3″>”cloneToTop”</span>=><span class=”s2″>true</span>));</p>
<p class=”p2″><span class=”s1″>$grid->setUrl(</span>”./services/jqgrid/tag_list_grid.php”<span class=”s1″>);</span></p>
<p class=”p2″><span class=”s1″>$grid->setSelect(</span>”Type”<span class=”s1″>, </span>”SELECT DISTINCT tag_types.Name
,<span class=”Apple-converted-space”> </span>tag_types.Name
<span class=”Apple-converted-space”> </span>FROM tags INNER JOIN tag_types ON tags.Type = tag_types.ID where tags.Company = “<span class=”s1″>.$_SESSION[</span>’company_id'<span class=”s1″>], </span><span class=”s2″>false</span><span class=”s1″>, </span><span class=”s2″>false</span><span class=”s1″>, </span><span class=”s2″>true</span><span class=”s1″>, </span><span class=”s2″>array</span><span class=”s1″>(</span>””<span class=”s1″>=></span>”All”<span class=”s1″>));</span></p>
<p class=”p2″><span class=”s1″>$grid->setSelect(</span>”Origin”<span class=”s1”>, </span>”SELECT DISTINCT tag_origins.Name
,<span class=”Apple-converted-space”> </span>tag_origins.Name
<span class=”Apple-converted-space”> </span>FROM tags INNER JOIN tag_origins ON tags.Origin = tag_origins.ID where tags.Company = “<span class=”s1″>.$_SESSION[</span>’company_id'<span class=”s1″>], </span><span class=”s2″>false</span><span class=”s1″>, </span><span class=”s2″>false</span><span class=”s1″>, </span><span class=”s2″>true</span><span class=”s1″>, </span><span class=”s2″>array</span><span class=”s1″>(</span>””<span class=”s1″>=></span>”All”<span class=”s1″>));</span></p>
<p class=”p2″><span class=”s1″>$grid->setSelect(</span>”Location”<span class=”s1”>, </span>”SELECT DISTINCT tag_locations.Name
,<span class=”Apple-converted-space”> </span>tag_locations.Name
<span class=”Apple-converted-space”> </span>FROM tags INNER JOIN tag_locations ON tags.Location = tag_locations.ID where tags.Company = “<span class=”s1″>.$_SESSION[</span>’company_id'<span class=”s1″>].</span>” ORDER by name”<span class=”s1″>, </span><span class=”s2″>false</span><span class=”s1″>, </span><span class=”s2″>false</span><span class=”s1″>, </span><span class=”s2″>true</span><span class=”s1″>, </span><span class=”s2″>array</span><span class=”s1″>(</span>””<span class=”s1″>=></span>”All”<span class=”s1″>));</span></p>
<p class=”p2″><span class=”s1″>$grid->setColProperty(</span>’Action'<span class=”s1″>, </span><span class=”s2″>array</span><span class=”s1″>(</span>’formatter'<span class=”s1″>=></span>’js:MyFormatter'<span class=”s1″>));</span></p>
<p class=”p2″><span class=”s1″>$grid->setColProperty(</span>’status'<span class=”s1″>, </span><span class=”s2″>array</span><span class=”s1″>(</span>”label”<span class=”s1″>=></span>’Status'<span class=”s1″>,</span>’formatter'<span class=”s1″>=></span>’js:StatusFormatter'<span class=”s1″>,</span>”width”<span class=”s1″>=></span>’70′<span class=”s1″>));</span></p>
<p class=”p3″>$grid->setColProperty(<span class=”s3″>’ID'</span>, <span class=”s2″>array</span>(<span class=”s3″>”width”</span>=><span class=”s3″>’50′</span>));</p>
<p class=”p2″><span class=”s1″>$grid->setColProperty(</span>’TagRef'<span class=”s1″>, </span><span class=”s2″>array</span><span class=”s1″>(</span>”label”<span class=”s1″>=></span>’IntRef'<span class=”s1″>,</span>”width”<span class=”s1″>=></span>’50′<span class=”s1″>));</span></p>
<p class=”p3″>$grid->setColProperty(<span class=”s3″>’Latitude'</span>, <span class=”s2″>array</span>(<span class=”s3″>”width”</span>=><span class=”s3″>’50′</span>));</p>
<p class=”p3″>$grid->setColProperty(<span class=”s3″>’Longitude'</span>, <span class=”s2″>array</span>(<span class=”s3″>”width”</span>=><span class=”s3″>’50′</span>));</p>
<p class=”p2″><span class=”s1″>$grid->setColProperty(</span>’Type'<span class=”s1″>, </span><span class=”s2″>array</span><span class=”s1″>(</span>”label”<span class=”s1″>=></span>’Category'<span class=”s1″>,</span>”width”<span class=”s1″>=></span>’50′<span class=”s1″>));</span></p>
<p class=”p3″>$grid->setColProperty(<span class=”s3″>’Origin'</span>, <span class=”s2″>array</span>(<span class=”s3″>”width”</span>=><span class=”s3″>’50′</span>));</p>
<p class=”p2″><span class=”s1″>$grid->setColProperty(</span>’contract_renew_date'<span class=”s1″>, </span><span class=”s2″>array</span><span class=”s1″>(</span>”label”<span class=”s1″>=></span>’Contract Renewal'<span class=”s1″>));</span></p>
<p class=”p2″><span class=”s1″>$grid->setColProperty(</span>’serial_number'<span class=”s1″>,</span><span class=”s2″>array</span><span class=”s1″>(</span>”label”<span class=”s1″>=></span>’Serial'<span class=”s1″>));</span></p>
<p class=”p3″>$grid->setColProperty(<span class=”s3″>’contract_renew_date'</span>, <span class=”s2″>array</span>(</p>
<p class=”p2″><span class=”s1″><span class=”Apple-converted-space”> </span></span>”formatter”<span class=”s1″>=></span>’date'<span class=”s1″>,</span></p>
<p class=”p2″><span class=”s1″><span class=”Apple-converted-space”> </span></span>”formatoptions”<span class=”s1″>=></span><span class=”s2″>array</span><span class=”s1″>(</span>’srcformat'<span class=”s1″>=></span>’Y-m-d'<span class=”s1″>,</span>’newformat'<span class=”s1″>=></span>’d-m-Y'<span class=”s1″>),</span></p>
<p class=”p2″><span class=”s1″><span class=”Apple-converted-space”> </span></span>”width”<span class=”s1″>=></span>’75′</p>
<p class=”p3″>));</p>
<p class=”p2″><span class=”s1″>$grid->setColProperty(</span>’labelled'<span class=”s1″>, </span><span class=”s2″>array</span><span class=”s1″>(</span>”label”<span class=”s1″>=></span>’Label'<span class=”s1″>,</span>’formatter'<span class=”s1″>=></span>’js:LabelledFormatter'<span class=”s1″>,</span>”width”<span class=”s1″>=></span>’50′<span class=”s1″>));</span></p>
<p class=”p2″><span class=”s1″>$grid->setColProperty(</span>’nfc_tagged'<span class=”s1″>, </span><span class=”s2″>array</span><span class=”s1″>(</span>”label”<span class=”s1″>=></span>’Tagged'<span class=”s1″>,</span>’formatter'<span class=”s1″>=></span>’js:LabelledFormatter'<span class=”s1″>,</span>”width”<span class=”s1″>=></span>’50′<span class=”s1″>));</span></p>
<p class=”p3″>$grid->setJSCode($myformat);</p>
<p class=”p2″><span class=”s1″>$myStatus = </span><span class=”s2″>array</span><span class=”s1″>(</span>”1″<span class=”s1″>=></span>”Active”<span class=”s1″>, </span>”0″<span class=”s1″>=></span>”Inactive”<span class=”s1″>);</span></p>
<p class=”p3″>$grid->setSelect(<span class=”s3″>”status”</span>, $myStatus , <span class=”s2″>false</span>, <span class=”s2″>false</span>, <span class=”s2″>true</span>, <span class=”s2″>array</span>(<span class=”s3″>””</span>=><span class=”s3″>”All”</span>));</p>
<p class=”p3″>$labelYesNo = <span class=”s2″>array</span>(<span class=”s3″>”1″</span>=><span class=”s3″>”Yes”</span>, <span class=”s3″>”0″</span>=><span class=”s3″>”No”</span>);</p>
<p class=”p3″>$grid->setSelect(<span class=”s3″>”labelled”</span>, $labelYesNo , <span class=”s2″>false</span>, <span class=”s2″>false</span>, <span class=”s2″>true</span>, <span class=”s2″>array</span>(<span class=”s3″>””</span>=><span class=”s3″>”All”</span>));</p>
<p class=”p3″>$grid->setSelect(<span class=”s3″>”nfc_tagged”</span>, $labelYesNo , <span class=”s2″>false</span>, <span class=”s2″>false</span>, <span class=”s2″>true</span>, <span class=”s2″>array</span>(<span class=”s3″>””</span>=><span class=”s3″>”All”</span>));</p>
<p class=”p5″>// End of bespoke JS function</p>
<p class=”p5″>// Enjoy</p>
<p class=”p3″>$grid->renderGrid(<span class=”s3″>’#grid'</span>,<span class=”s3″>’#pager'</span>,<span class=”s2″>true</span>, <span class=”s2″>null</span>, <span class=”s2″>null</span>, <span class=”s2″>true</span>,<span class=”s2″>true</span>);</p>
<p class=”p3″>$conn = <span class=”s2″>null</span>;</p>
<span style=”line-height: 1.5;”>[\code]</span>
Hello,
Thank you for the posting.
In the downloaded package there are upgrade notes, so you can read them.
Can you please send us a test case or copy/paste it here without any additional tags?
We think we have found the problem, but we need to test it with your case.
Thank you
Kind Regards,
Will
Guriddo Support Team
Hello – well it was not working with every single grid of mine, but works fine with the 4.7 tcpdf library. If you want to ship me or send a link for the new tcpdf library – very happy to try. Here is a simple example though:
1 2 3 4 5 6 7 8 9 10 11 12 |
<!--?php $mode = ''; $type = ''; $query = ""; // Create tag query initial select statement fro all conditions $report_name = "Admin: Origins"; // Set heading description include 'include/tag_header.php'; ?--> <div id="grid_div"><!-- start of jquerygrid --> <!--?php $_SESSION['query_type']="origin_list"; $_SESSION['grid_query']='SELECT * FROM tag_origins where company_id = '.$_SESSION['company_id']; // $_SESSION['grid_query'] = "select ID, Name, Type, Location, GPS_long, GPS_lat, status from tags where Company = ".$_SESSION['company_id'].$com_list; include ('./services/jqgrid/admin/origin_list_grid.php'); ?--></div> <!--end of jquerygrid --> <!--right panel End--> <!--Container End--> <!--wrapper End--> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
<!--?php ini_set('display_errors', 'on'); error_reporting(E_ALL); if (!isset($_SESSION['grid_query'])) { session_start(); } $_SESSION['user_type']==3 ? $editable=false : $editable = true; include __DIR__ . '/../../../include/jq-config.php'; $conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD); $conn--->query("SET NAMES utf8"); // Create the jqGrid instance $conn->setAttribute( PDO::ATTR_EMULATE_PREPARES, false ); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $grid = new jqGridRender($conn); // Set the SQL Data source $grid->SelectCommand = $_SESSION['grid_query']; // passed by calling page // set the ouput format to json $grid->serialKey = true; $grid->setPrimaryKeyId('ID'); $grid->dataType = 'json'; // Let the grid create the model $grid->table = 'tag_origins'; // define the tabel used for deleting $grid->setColModel(); $grid->setUserDate("d-m-Y"); // set labels in the header /* Below will differ based on the type of report being executed*/ /* To be included so can set right columns settings for the query*/ $grid->exportfile = 'ZipNFC_tag_origins.xls'; $grid->setGridOptions(array( "rowNum"=>30, "rowList"=>array(10,20,30,50), "sortname"=>"Name", "sortorder"=>"ASC", "hoverrows"=>true, "toppager"=>true )); $grid->toolbarfilter = true; $grid->navigator = true; $grid->setNavOptions('navigator', array("excel"=>true,"pdf"=>true, "add"=>$editable,"edit"=>$editable,"del"=>false,"view"=>true,"cloneToTop"=>true)); $grid->setUrl("./services/jqgrid/admin/origin_list_grid.php"); $grid->setColProperty('ID', array("hidden"=>true)); $grid->setColProperty( 'company_id', array("hidden"=>true, "editoptions"=>array("defaultValue"=>$_SESSION['company_id']))); // End of bespoke JS function // Enjoy $grid->renderGrid('#grid','#pager',true, null, null, true,true); $conn = null; ?> |
By the way not sure what goes wrong with the post system, but on the hold php code it never formats OK – if you can look at a text view it will look fine I think. This is the same code I posted successfully on the query about the paging being on the left rather than the centre…
Also just to add this is old code that worked fine on the latest Trirand release we are using live at the moment.
Hello,
To format a code you will need to switch to Text mode. Select a text and push the code button.
In visual tab this does not function correct. It is a bug in the software we use – Sorry.
We think we have isolated a problem with pdf export and hope the fix will be availabe in the next release.
Because you use a php setting witch do this:
1 2 |
ini_set('display_errors', 'on'); error_reporting(E_ALL); |
If you comment these lines your code will work with the new tcpdf.
The problem is in our code and is common and is similar like this
The solution is described into the link
Kind Regards,
Will
Guriddo Support Team
I am sure I took that out when trying to identify the problem, but will definitely give it a try!
Have a nice weekend.
Hello,
Thanks. I will let you know when we are ready with this.
Kind Regards,
Will
Guriddo Support Team
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top