<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[rapyd forum]]></title>
	<link rel="self" href="http://www.rapyd.com/forum/posts_feed/atom/"/>
	<updated>2012-03-28T08:07:13Z</updated>
	<generator>PunBB</generator>
	<id>http://www.rapyd.com/forum/</id>
		<entry>
			<title type="html"><![CDATA[Callback on DataEdit]]></title>
			<link rel="alternate" href="http://www.rapyd.com/forum/post/132/#p132"/>
			<content type="html"><![CDATA[<p>hello<br />is there any way to have a callback method on a DataEdit ?</p><p>Ex:<br />$edit-&gt;ffSerie = new inputField(&quot;Serie&quot;, &quot;ffSerie&quot;);&nbsp; </p><p>instead of&nbsp; &#039;ffSerie&#039; which is a number, i need a word asociated to that number<br />i am using the DataEdit only on the /show page</p>]]></content>
			<author>
				<name><![CDATA[Scobee]]></name>
				<uri>http://www.rapyd.com/forum/user/1452/</uri>
			</author>
			<updated>2012-03-28T08:07:13Z</updated>
			<id>http://www.rapyd.com/forum/post/132/#p132</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Hvala - an forum module for rapyd cms b2]]></title>
			<link rel="alternate" href="http://www.rapyd.com/forum/post/131/#p131"/>
			<content type="html"><![CDATA[<p>Ok&nbsp; Thnks for contribution,<br />I&#039;ll send you the current development of forum, I stopped this development some months ago&#039;&nbsp; (frontend is 90% complete, admin istration is at 0% ),&nbsp; I hope this can give you some ideas..</p>]]></content>
			<author>
				<name><![CDATA[felix]]></name>
				<uri>http://www.rapyd.com/forum/user/2/</uri>
			</author>
			<updated>2012-03-19T11:22:58Z</updated>
			<id>http://www.rapyd.com/forum/post/131/#p131</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Dates range]]></title>
			<link rel="alternate" href="http://www.rapyd.com/forum/post/130/#p130"/>
			<content type="html"><![CDATA[<p>It worked! Thank you so much!</p>]]></content>
			<author>
				<name><![CDATA[Scobee]]></name>
				<uri>http://www.rapyd.com/forum/user/1452/</uri>
			</author>
			<updated>2012-03-18T21:36:02Z</updated>
			<id>http://www.rapyd.com/forum/post/130/#p130</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Hvala - an forum module for rapyd cms b2]]></title>
			<link rel="alternate" href="http://www.rapyd.com/forum/post/129/#p129"/>
			<content type="html"><![CDATA[<p>I am writing forum module for rapyd cms b2. It just in begining.</p><p>Code resides here:<br /><a href="http://chiselapp.com/user/severak/repository/hvala">http://chiselapp.com/user/severak/repository/hvala</a></p><p>Some ideas behind here:<br /><a href="https://manuscripts.jottit.com/">https://manuscripts.jottit.com/</a></p><p>First working example:<br /><a href="http://hvala.svita.cz">http://hvala.svita.cz</a></p><p>Note that there is no possibilty to register to the forum for now. Users have to be added manually trough user module.</p><p>When this project will be more mature, I will inform you.</p>]]></content>
			<author>
				<name><![CDATA[severak]]></name>
				<uri>http://www.rapyd.com/forum/user/31/</uri>
			</author>
			<updated>2012-03-18T20:58:39Z</updated>
			<id>http://www.rapyd.com/forum/post/129/#p129</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Dates range]]></title>
			<link rel="alternate" href="http://www.rapyd.com/forum/post/128/#p128"/>
			<content type="html"><![CDATA[<p>Ok, 0.9.6&nbsp; is versioning of the old &quot;rapyd library&quot; for CI,&nbsp; discontinued in 2008.</p><p>Since 2009 rapyd is a stand alone framework, and sometimes i release a version that works with latest CI&nbsp; as subframework.</p><p>Syntax of rapyd widgets (forms, grids, etc.. ) and crud code&nbsp; is changed alot,&nbsp; so you can&#039;t upgrade without rewrite code in your application.</p><p>However, I found some code on really old&nbsp; website i made:<br /></p><div class="codebox"><pre><code>...
    $filter-&gt;begindate = new dateField(&quot;created&quot;, &quot;created_begin&quot;,&quot;eu&quot;);
    $filter-&gt;begindate-&gt;db_name=&quot;users.created&quot;;
    $filter-&gt;begindate-&gt;clause=&quot;where&quot;;
    $filter-&gt;begindate-&gt;operator=&quot;&gt;&quot;;
    
    $filter-&gt;enddate = new dateField(&quot;created&quot;, &quot;created_end_date&quot;,&quot;eu&quot;);
    $filter-&gt;enddate-&gt;db_name=&quot;users.created&quot;;
    $filter-&gt;enddate-&gt;clause=&quot;where&quot;;
    $filter-&gt;enddate-&gt;operator=&quot;&lt;=&quot;;
    $filter-&gt;enddate-&gt;in=&quot;begindate&quot;;
...</code></pre></div><p>I&#039;m not sure it can work in your exact env.&nbsp; but,&nbsp; the concept is..<br />all you need is to fill&nbsp; &quot;db_name&quot;, &quot;clause&quot; and&nbsp; &quot;operator&quot;&nbsp; (&quot;in&quot; only make fields stay on the same output row)<br />The second param of dateField is an arbitrary alias for the field&nbsp; (you need to have 2 different alias) and you must specify the same db_name&nbsp; (the real name of date field you need to&nbsp; filter from/to)</p>]]></content>
			<author>
				<name><![CDATA[felix]]></name>
				<uri>http://www.rapyd.com/forum/user/2/</uri>
			</author>
			<updated>2012-03-14T07:57:11Z</updated>
			<id>http://www.rapyd.com/forum/post/128/#p128</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Dates range]]></title>
			<link rel="alternate" href="http://www.rapyd.com/forum/post/127/#p127"/>
			<content type="html"><![CDATA[<p>i am looking in rapyd/classes and all of them are&nbsp; * @version&nbsp; &nbsp; &nbsp; &nbsp; 0.9.6<br />common.php is&nbsp; * @version&nbsp; &nbsp; &nbsp; &nbsp; 0.9<br />and the only one that is outdated is loader.php .. wich has * @version&nbsp; &nbsp; &nbsp; &nbsp; 0.7 and&nbsp; * @version&nbsp; &nbsp; 0.6.1</p><p>and yes, you are right, i am using CI + Rapyd </p><p>the CI version is: 1.5.4 (the guys who worked at this project told me that they haven&#039;t been able to update it because of rapyd)</p><p>do you think we could be able to upgrade rapyd without screwing up everything ? a little hack so that the old code will work + we will be able to use the new code too ?</p><p>thank you</p>]]></content>
			<author>
				<name><![CDATA[Scobee]]></name>
				<uri>http://www.rapyd.com/forum/user/1452/</uri>
			</author>
			<updated>2012-03-13T09:05:00Z</updated>
			<id>http://www.rapyd.com/forum/post/127/#p127</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Dates range]]></title>
			<link rel="alternate" href="http://www.rapyd.com/forum/post/126/#p126"/>
			<content type="html"><![CDATA[<p>Hi scobee<br />if I remember (from the code you sent me&nbsp; via email)&nbsp; you&#039;re probably using&nbsp; a really old version of rapyd,&nbsp; one&nbsp; used as &quot;library of codeigniter&quot;:<br /><a href="http://codeigniter.com/wiki/Rapyd_Components">http://codeigniter.com/wiki/Rapyd_Components</a><br />I&#039;m not sure it&#039;s the 0.9 since syntax&nbsp; is with &quot;new&quot; and without chaining.</p><p>It&#039;s a bit problematic to help you with this old code but.. the&nbsp; ability to use datafilter&nbsp; with a range of date&nbsp; is&nbsp; an old stuff.</p><p>post some code..&nbsp; and try to find correct versions of&nbsp; rapyd&nbsp; (even&nbsp; pubblication date, if present) and CI (if you&#039;re using CI+rapyd)</p><p>bye</p>]]></content>
			<author>
				<name><![CDATA[felix]]></name>
				<uri>http://www.rapyd.com/forum/user/2/</uri>
			</author>
			<updated>2012-03-12T17:28:06Z</updated>
			<id>http://www.rapyd.com/forum/post/126/#p126</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Dates range]]></title>
			<link rel="alternate" href="http://www.rapyd.com/forum/post/125/#p125"/>
			<content type="html"><![CDATA[<p>Hello<br />Is there any way i can make the &quot;Dates from/to&quot; (<a href="http://test.rapyd.com/filtered_grid/index">http://test.rapyd.com/filtered_grid/index</a>) in rapyd 0.9 ?</p><p>I am modifying a project that uses rapyd 0.9 and for the moment we can&#039;t upgrade it </p><p>Thank you!</p>]]></content>
			<author>
				<name><![CDATA[Scobee]]></name>
				<uri>http://www.rapyd.com/forum/user/1452/</uri>
			</author>
			<updated>2012-03-11T18:40:56Z</updated>
			<id>http://www.rapyd.com/forum/post/125/#p125</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: extend libraries]]></title>
			<link rel="alternate" href="http://www.rapyd.com/forum/post/124/#p124"/>
			<content type="html"><![CDATA[<p>still a support case.</p><p>if i use the new acl_library in a datagrid, the active record will get mixed up.</p><p>now i use a full sql statement, but i want to know how to realise this with active records.</p>]]></content>
			<author>
				<name><![CDATA[nkrueger]]></name>
				<uri>http://www.rapyd.com/forum/user/18/</uri>
			</author>
			<updated>2012-02-07T17:06:10Z</updated>
			<id>http://www.rapyd.com/forum/post/124/#p124</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: extend libraries]]></title>
			<link rel="alternate" href="http://www.rapyd.com/forum/post/123/#p123"/>
			<content type="html"><![CDATA[<p>Hi,<br />is a code contribution or a&nbsp; support request?</p><p>if it&#039;s a code contribution can you explain the usefulness of this library?<br />from my point of view it&#039;s a good idea to extend &quot;dataedit&quot; or &quot;datamodel&quot; with something acl related</p><p>felix</p>]]></content>
			<author>
				<name><![CDATA[felix]]></name>
				<uri>http://www.rapyd.com/forum/user/2/</uri>
			</author>
			<updated>2012-02-07T11:00:26Z</updated>
			<id>http://www.rapyd.com/forum/post/123/#p123</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[extend libraries]]></title>
			<link rel="alternate" href="http://www.rapyd.com/forum/post/122/#p122"/>
			<content type="html"><![CDATA[<p>its me again <img src="http://www.rapyd.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>i want to extend the widgets with a simple acl system.</p><div class="codebox"><pre><code>class secure_datagrid_library extends datagrid_library
{
    function  __construct($config = array()) {
        $this-&gt;acl = new acl_library();
        parent::__construct($config);
    }

    public function set_column()
    {
        $column = array();
        if (func_num_args() == 3)
        {
            list($column[&#039;pattern&#039;], $column[&#039;label&#039;], $column[&#039;orderby&#039;]) = func_get_args();
        }
        if (func_num_args() == 2)
        {
            list($column[&#039;pattern&#039;], $column[&#039;label&#039;]) = func_get_args();
        }
        if (func_num_args() == 1)
        {
            $column = func_get_arg(0);
        }
        //share source with columns
        if (!isset($column[&#039;source&#039;]))
            $column[&#039;source&#039;] = $this-&gt;source;
        //detect if is a checkbox column
        if (isset($column[&#039;checkbox&#039;]))
            $this-&gt;checkbox_form = true;
        
        
        if($this-&gt;acl-&gt;allowed(&#039;item&#039;,&#039;*&#039;,&#039;*&#039;,$column[&quot;pattern&quot;]))
        {
            $column = new datagrid_column($column);
            $this-&gt;columns[] = $column;
            return $column;
        }
        else
        {
            return FALSE;
        }
    }
}</code></pre></div><div class="codebox"><pre><code>class acl_library extends rpd_auth_library
{
    function __construct()
    {
        $this-&gt;acl_model = new acl_model();
        parent::__construct();
    }

    function allowed($controller=NULL, $method=NULL, $action=NULL, $field=NULL)
    {
        if($controller === NULL)
        {
            $controller = $this-&gt;get_controller();
        }
        if($method === NULL)
        {
            $method = $this-&gt;get_method();
        }
        if($action === NULL)
        {
            $action = &#039;*&#039;;
        }
        if($field === NULL)
        {
            $field = &#039;*&#039;;
        }
        
        return $this-&gt;acl_model-&gt;_allowed($this-&gt;user(&quot;role_id&quot;), $controller, $method, $action, $field);
    }
}</code></pre></div><div class="codebox"><pre><code>class acl_model extends rpd
{
    function  __construct()
    {
        $this-&gt;db = rpd::$db;
    }
    
    function _allowed($role_id, $controller=NULL, $method=NULL, $action=NULL, $field=NULL)
    {
        //$this-&gt;$db-&gt;db_debug = true;
        $this-&gt;db-&gt;from(&#039;roles_permissions&#039;);
        $this-&gt;db-&gt;join(&quot;permissions&quot;,&quot;permissions.permission_id=roles_permissions.permission_id&quot;);
        $this-&gt;db-&gt;where(&#039;role_id&#039;, $role_id);

        $this-&gt;db-&gt;where(&#039;controller&#039;, $controller);

        $this-&gt;db-&gt;where(&#039;method&#039;, $method);
        $this-&gt;db-&gt;orwhere(&#039;method&#039;, &#039;*&#039;);

        $this-&gt;db-&gt;where(&#039;action&#039;, $action);
        $this-&gt;db-&gt;orwhere(&#039;action&#039;, &#039;*&#039;);
       
        $this-&gt;db-&gt;where(&#039;field&#039;, $field);
        $this-&gt;db-&gt;orwhere(&#039;field&#039;, &#039;*&#039;);

        $this-&gt;db-&gt;get();


        $permission = $this-&gt;db-&gt;row_object();
        //var_dump($user);
        if ($permission===false) return false;

        return $permission-&gt;access;

    }
}</code></pre></div><p>if i use the secure_datagrid, the query in _allowed will get mixed with secure_datagrid</p><div class="codebox"><pre><code>$filter = new datafilter_library();
$filter-&gt;db-&gt;select(&quot;*&quot;);
$filter-&gt;db-&gt;from(&quot;items&quot;);
$filter-&gt;db-&gt;join(&quot;users&quot;,&quot;users.user_id=items.user_id&quot;);
$filter-&gt;db-&gt;orderby(&quot;staerke,geschick,technik,speed,geschick&quot;);

....

$grid = new secure_datagrid_library();
$grid-&gt;source($filter);
$grid-&gt;db-&gt;where(&quot;state&quot;, 1);</code></pre></div><p>query in _allowed function will end up this</p><div class="codebox"><pre><code>SELECT *
FROM iv_items, iv_roles_permissions
JOIN iv_users ON iv_users.user_id=iv_items.user_id
JOIN iv_permissions ON iv_permissions.permission_id=iv_roles_permissions.permission_id
WHERE state = 1
AND role_id = &#039;1&#039;
AND controller = &#039;item&#039;
AND method = &#039;*&#039;
OR method = &#039;*&#039;
AND action = &#039;*&#039;
OR action = &#039;*&#039;
AND field = &#039;username&#039;
OR field = &#039;*&#039;
ORDER BY staerke,geschick,technik,speed,geschick</code></pre></div><p>hope 2 hear soon from u <img src="http://www.rapyd.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[nkrueger]]></name>
				<uri>http://www.rapyd.com/forum/user/18/</uri>
			</author>
			<updated>2012-02-06T22:56:31Z</updated>
			<id>http://www.rapyd.com/forum/post/122/#p122</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Grid Callback]]></title>
			<link rel="alternate" href="http://www.rapyd.com/forum/post/121/#p121"/>
			<content type="html"><![CDATA[<p>I´ll try. But i have some cases, where i do not need a field column. there it wont work.<br />i had to escape the htmlspecialchars function in datagrid class for me 2 work.</p><p>another question:<br />am i able to set a custom style of a table row? i wont to color some rows per specific conditions (e.g. a value is 0 or &gt;= 20)</p>]]></content>
			<author>
				<name><![CDATA[nkrueger]]></name>
				<uri>http://www.rapyd.com/forum/user/18/</uri>
			</author>
			<updated>2012-02-06T09:32:38Z</updated>
			<id>http://www.rapyd.com/forum/post/121/#p121</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Grid Callback]]></title>
			<link rel="alternate" href="http://www.rapyd.com/forum/post/120/#p120"/>
			<content type="html"><![CDATA[<p>try to use a field pattern instead NULL or inside return string (it will be enough to skip htmlspecialchars)</p>]]></content>
			<author>
				<name><![CDATA[felix]]></name>
				<uri>http://www.rapyd.com/forum/user/2/</uri>
			</author>
			<updated>2012-02-01T22:31:06Z</updated>
			<id>http://www.rapyd.com/forum/post/120/#p120</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Grid Callback]]></title>
			<link rel="alternate" href="http://www.rapyd.com/forum/post/119/#p119"/>
			<content type="html"><![CDATA[<p>me again.</p><p>i do need the callback <img src="http://www.rapyd.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><div class="codebox"><pre><code>...
$grid-&gt;column(NULL,&#039;&#039;)-&gt;callback(&#039;callback_free_item&#039;, $this);
...

function callback_free_item($row)
    {
        if($row[&quot;user_id&quot;] == rpd::$auth-&gt;user(&#039;user_id&#039;))
                return &#039;&lt;a href=&quot;/index.php/item/item_free/1002&quot; onclick=&quot;return confirm(\&#039;sure\&#039;)&quot;&gt;&lt;img src=&quot;/core/assets/switch.png&quot;  style=&quot;vertical-align:middle&quot; /&gt;&lt;/a&gt;&#039;;
    }
...</code></pre></div><p>i get the raw html command displayed <img src="http://www.rapyd.com/forum/img/smilies/sad.png" width="15" height="15" alt="sad" /></p>]]></content>
			<author>
				<name><![CDATA[nkrueger]]></name>
				<uri>http://www.rapyd.com/forum/user/18/</uri>
			</author>
			<updated>2012-02-01T22:06:47Z</updated>
			<id>http://www.rapyd.com/forum/post/119/#p119</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: DataGrid Sum-Field]]></title>
			<link rel="alternate" href="http://www.rapyd.com/forum/post/118/#p118"/>
			<content type="html"><![CDATA[<p>i ll play with that. thanks <img src="http://www.rapyd.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[nkrueger]]></name>
				<uri>http://www.rapyd.com/forum/user/18/</uri>
			</author>
			<updated>2012-01-31T20:22:01Z</updated>
			<id>http://www.rapyd.com/forum/post/118/#p118</id>
		</entry>
</feed>

