Jump to content


Photo

Products, such as adding a grid with suppliers?


  • Please log in to reply
13 replies to this topic

#1 MicoX

MicoX

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationSpain

Posted 24 June 2012 - 11:22 PM

Hello from Spain
I am evaluating your application to use and adapt it to my business.
I wonder if scalability and feasible to add a table of product suppliers.
Also if possible add a comparison between products.
I try to give better pre-attention to the buyer and advise on what else is interested.
Sory for my english.
Thank for this app.
Angeles
Agost15 serveis
@@Agost15_Serveis

#2 Guest_X2Matthew_*

Guest_X2Matthew_*
  • Guests

Posted 25 June 2012 - 09:54 AM

You can create a module for this yourself using the X2Studio tools. Go to the admin page, click "create new module", create one for Suppliers. You will then need to add whatever fields you want to it by clicking "manage fields" in the admin page. Then you design the form and view layouts for this module by clicking "form editor". Finally, add a field to Products in the field manager. Call it "suppliers" and set its type to "lookup", and select Suppliers from the list. Now you'll have a field that will link to the supplier record. If you want a grid of all products on a given supplier's page, there isn't currently a way to do that without custom programming, but we're working on it.

Note: the create module tool may be broken in the current build, if so we can send you a fixed file or you can wait till the next update.

#3 MicoX

MicoX

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationSpain

Posted 26 June 2012 - 07:15 AM

Please, if you can, I would be grateful to send me that file.Thanks
Angeles
Agost15 serveis
@@Agost15_Serveis

#4 Guest_X2Matthew_*

Guest_X2Matthew_*
  • Guests

Posted 26 June 2012 - 11:41 AM

Have you tried making the module? The issue we found will probably not happen, so give it a try and let me know if it doesn't work.

#5 MicoX

MicoX

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationSpain

Posted 26 June 2012 - 11:52 AM

Yes, I tried.
this is data:

Título de módulo *El nombre para su nuevo módulo Proveedor

Nobre de item(Opcional) Qué llamar registros individuales, por ejemplo, "crear nuevo X"


Nombre de tabla de BDOpcional (sólo alfanumérico, debe comenzar con una letra)


Is this module searchable? YES

Can this module have forms/fields edited? YES
Is this module only visible to admin? NO

this is the error:
CException
Alias "proveedor.ProveedorModule" is invalid. Make sure it points to an existing PHP file.
G:\PortableApps\wamp\www\x2engine\framework\YiiBase.php(318)
306		 if($isClass && (class_exists($className,false) || interface_exists($className,false)))
307			 return self::$_imports[$alias]=$className;
308
309		 if(($path=self::getPathOfAlias($alias))!==false)
310		 {
311			 if($isClass)
312			 {
313				 if($forceInclude)
314				 {
315					 if(is_file($path.'.php'))
316						 require($path.'.php');
317					 else
318						 throw new CException(Yii::t('yii','Alias "{alias}" is invalid. Make sure it points to an existing PHP file.',array('{alias}'=>$alias)));
319					 self::$_imports[$alias]=$className;
320				 }
321				 else
322					 self::$classMap[$className]=$path.'.php';
323				 return $className;
324			 }
325			 else  // a directory
326			 {
327				 if(self::$_includePaths===null)
328				 {
329					 self::$_includePaths=array_unique(explode(PATH_SEPARATOR,get_include_path()));
330					 if(($pos=array_search('.',self::$_includePaths,true))!==false)
Stack Trace
#0
+
G:\PortableApps\wamp\www\x2engine\framework\YiiBase.php(198): YiiBase::import("proveedor.ProveedorModule", true)
#1
+
G:\PortableApps\wamp\www\x2engine\framework\base\CModule.php(283): YiiBase::createComponent("proveedor.ProveedorModule", "proveedor", null, array())
#2
+
G:\PortableApps\wamp\www\x2engine\framework\web\CWebApplication.php(331): CModule->getModule("proveedor")
#3
+
G:\PortableApps\wamp\www\x2engine\framework\web\CWebApplication.php(270): CWebApplication->createController("proveedor/default/index")
#4
+
G:\PortableApps\wamp\www\x2engine\framework\web\CWebApplication.php(135): CWebApplication->runController("proveedor/default/index")
#5
+
G:\PortableApps\wamp\www\x2engine\framework\base\CApplication.php(162): CWebApplication->processRequest()
#6
–
G:\PortableApps\wamp\www\x2engine\index.php(63): CApplication->run()
58 defined('YII_DEBUG') or define('YII_DEBUG',true);
59 // specify how many levels of call stack should be shown in each log message
60 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
61
62 require_once($yii);
63 Yii::createWebApplication($config)->run();
2012-06-26 21:46:42 Apache/2.2.21 (Win32) PHP/5.3.10 Yii Framework/1.1.9

Angeles
Agost15 serveis
@@Agost15_Serveis

#6 X2Jake

X2Jake

    X2 Engineer

  • Administrators
  • 1275 posts
  • LocationSanta Cruz

Posted 26 June 2012 - 12:32 PM

Hi,

I'm having some trouble reproducing this bug. Could you check a couple of things for me?

1) Make sure the file permissions on your protected and protected/modules directories are at 755 or 777.

2) Check the protected/modules directory and see if a folder called "Proveedor" got made, this will tell me if the issue is just with the one file or with the copying process in general.

3) Delete the x2_proveedor table which was likely made in your database.

4) Attempt to make the module again and see if it was a one time issue or is something that is persisting.

Jake
Jake Houser

Software Engineer at X2Engine

jake@x2engine.com

#7 MicoX

MicoX

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationSpain

Posted 26 June 2012 - 10:53 PM

ok
1.- check it
2.- the directory is "proveedor", not "Proveedor"
3.- done
4.- i tried again and..
I need to change de name because jumped this error ->
Por favor corrija los siguientes errores de ingreso:
    Un módulo con ese título ya existe


I tried with "costes" and this is the error

CException
Alias "costes.CostesModule" is invalid. Make sure it points to an existing PHP file.
G:\PortableApps\wamp\www\x2engine\framework\YiiBase.php(318)
306		 if($isClass && (class_exists($className,false) || interface_exists($className,false)))
307			 return self::$_imports[$alias]=$className;
308
309		 if(($path=self::getPathOfAlias($alias))!==false)
310		 {
311			 if($isClass)
312			 {
313				 if($forceInclude)
314				 {
315					 if(is_file($path.'.php'))
316						 require($path.'.php');
317					 else
318						 throw new CException(Yii::t('yii','Alias "{alias}" is invalid. Make sure it points to an existing PHP file.',array('{alias}'=>$alias)));
319					 self::$_imports[$alias]=$className;
320				 }
321				 else
322					 self::$classMap[$className]=$path.'.php';
323				 return $className;
324			 }
325			 else  // a directory
326			 {
327				 if(self::$_includePaths===null)
328				 {
329					 self::$_includePaths=array_unique(explode(PATH_SEPARATOR,get_include_path()));
330					 if(($pos=array_search('.',self::$_includePaths,true))!==false)
Stack Trace
#0 
+
G:\PortableApps\wamp\www\x2engine\framework\YiiBase.php(198): YiiBase::import("costes.CostesModule", true)
#1 
+
G:\PortableApps\wamp\www\x2engine\framework\base\CModule.php(283): YiiBase::createComponent("costes.CostesModule", "costes", null, array())
#2 
+
G:\PortableApps\wamp\www\x2engine\framework\web\CWebApplication.php(331): CModule->getModule("costes")
#3 
+
G:\PortableApps\wamp\www\x2engine\framework\web\CWebApplication.php(270): CWebApplication->createController("costes/default/index")
#4 
+
G:\PortableApps\wamp\www\x2engine\framework\web\CWebApplication.php(135): CWebApplication->runController("costes/default/index")
#5 
+
G:\PortableApps\wamp\www\x2engine\framework\base\CApplication.php(162): CWebApplication->processRequest()
#6 
–
G:\PortableApps\wamp\www\x2engine\index.php(63): CApplication->run()
58 defined('YII_DEBUG') or define('YII_DEBUG',true);
59 // specify how many levels of call stack should be shown in each log message
60 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
61
62 require_once($yii);
63 Yii::createWebApplication($config)->run();

Angeles
Agost15 serveis
@@Agost15_Serveis

#8 MicoX

MicoX

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationSpain

Posted 27 June 2012 - 04:03 AM

I tried to make the module with gii but this error ->

Error 404

El sistema no ha podido encontrar la acción "module" solicitada.
Angeles
Agost15 serveis
@@Agost15_Serveis

#9 X2Jake

X2Jake

    X2 Engineer

  • Administrators
  • 1275 posts
  • LocationSanta Cruz

Posted 27 June 2012 - 08:31 AM

Alright so using Gii is going to be a bad idea as it generates default Yii modules, not X2 compatible ones. While anything you make with Gii should technically work within X2CRM, it will be missing all of our features.

As for the actual issue with our module creator, it looks like your installation is refusing to copy the module file itself over. Try putting this file in your protected/modules/proveedor folder and let me know if that resolves the issue.

Jake

Attached Files


Jake Houser

Software Engineer at X2Engine

jake@x2engine.com

#10 MicoX

MicoX

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationSpain

Posted 28 June 2012 - 08:29 AM

Works! Thanks! and now i go to investigate how to add the grid in the products view.
Angeles
Agost15 serveis
@@Agost15_Serveis

#11 MicoX

MicoX

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationSpain

Posted 03 July 2012 - 10:53 AM

I tried to find a way to add the grid but there was no way.
I find no documentation X2 or Yii .
Could you give me some idea where to start?
Thanks for all
Angeles
Agost15 serveis
@@Agost15_Serveis

#12 Guest_X2Matthew_*

Guest_X2Matthew_*
  • Guests

Posted 03 July 2012 - 04:55 PM

So if I'm following you right, you want to see all the suppliers for a given product? A good example of that kind of code is in the Accounts view (protected/modules/accounts/views/view.php), which has a grid for associated contacts:
$this->widget('application.components.X2GridView', array(
'id'=>'associated-contacts-grid',
'baseScriptUrl'=>Yii::app()->request->baseUrl.'/themes/'.Yii::app()->theme->name.'/css/gridview',
'template'=> '<h2>'.Yii::t('contacts','Associated Contacts').'</h2><div class="title-bar">'
  .CHtml::link(Yii::t('app','Clear Filters'),array($model->id,'clearFilters'=>1)) . ' | '
  .CHtml::link(Yii::t('app','Columns'),'javascript:void(0);',array('class'=>'column-selector-link'))
  .'{summary}</div>{items}{pager}',
'dataProvider'=>$contactModel->searchAccount($model->id),
// 'enableSorting'=>false,
// 'model'=>$model,
'filter'=>$contactModel,
// 'columns'=>$columns,
'modelName'=>'Contacts',
'viewName'=>'accountcontacts',
// 'columnSelectorId'=>'contacts-column-selector',
'defaultGvSettings'=>array(
  'name'=>234,
  'email'=>108,
  'leadsource'=>128,
  'assignedTo'=>115,
),
'specialColumns'=>array(
  'name'=>array(
   'name'=>'name',
   'header'=>Yii::t('contacts','Name'),
   'value'=>'CHtml::link($data->name,array("/contacts/".$data->id))',
   'type'=>'raw',
  ),
),
'enableControls'=>true,
));

You could change the names and get it to work for suppliers. One thing you'll have to change is this line:
'dataProvider'=>$contactModel->searchAccount($model->id),
which is calling a function in the Contacts model now (protected/modules/contacts/models/Contacts.php). Copy the function searchAccount() in there and put it in the Suppliers model (you may need to change the function a bit). This returns a data provider, which is how Yii likes to fill up grids with data.

Hope that puts you on the right track. Of course, you can always buy a support package and we'll provide a lot more assistance!

#13 MicoX

MicoX

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationSpain

Posted 04 July 2012 - 11:24 AM

Perfect! Work! Thanks a lot

About support, where is the cost of the assistance?
Angeles
Agost15 serveis
@@Agost15_Serveis

#14 Guest_X2Matthew_*

Guest_X2Matthew_*
  • Guests

Posted 04 July 2012 - 11:51 AM

We have a few different support packages available on the website here: http://www.x2engine.com/services/

Currently we're still focusing on perfecting the app, so we haven't put together a really solid support business model, but if you need assistance you can buy the appropriate package through our web store and we will get you set up. Alternatively, contact us through the website if you aren't sure what you need.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users