File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3636class Init extends InitClass
3737{
3838
39+ /**
40+ *
41+ * @var bool
42+ */
43+ private static $ disableInit = false ;
44+
45+ public static function disableInit ()
46+ {
47+ self ::$ disableInit = true ;
48+ }
49+
3950 public function init ()
4051 {
41- $ this ->loadExtension (new Extension \Controller \DocumentStitcher ());
42- $ this ->loadExtension (new Extension \Controller \EditCliente ());
43- $ this ->loadExtension (new Extension \Model \Base \BusinessDocument ());
44- $ this ->loadExtension (new Extension \Model \Base \BusinessDocumentLine ());
52+ if (false === self ::$ disableInit ) {
53+ $ this ->loadExtension (new Extension \Controller \DocumentStitcher ());
54+ $ this ->loadExtension (new Extension \Controller \EditCliente ());
55+ $ this ->loadExtension (new Extension \Model \Base \BusinessDocument ());
56+ $ this ->loadExtension (new Extension \Model \Base \BusinessDocumentLine ());
57+ }
4558 }
4659
4760 public function update ()
Original file line number Diff line number Diff line change @@ -104,6 +104,17 @@ public function getVariant()
104104 return $ variant ;
105105 }
106106
107+ /**
108+ *
109+ * @return Producto
110+ */
111+ public function getProduct ()
112+ {
113+ $ product = new Producto ();
114+ $ product ->loadFromCode ($ this ->idproducto );
115+ return $ product ;
116+ }
117+
107118 /**
108119 *
109120 * @return string
@@ -112,7 +123,6 @@ public function install()
112123 {
113124 /// needed dependecies
114125 new Proyecto ();
115- new Producto ();
116126 new Variante ();
117127
118128 return parent ::install ();
@@ -169,6 +179,6 @@ public function test()
169179 */
170180 public function url (string $ type = 'auto ' , string $ list = 'List ' ): string
171181 {
172- return empty ($ this ->primaryColumnValue ()) ? parent ::url ($ type , $ list ) : $ this ->getVariant ()->url ();
182+ return empty ($ this ->primaryColumnValue ()) ? parent ::url ($ type , $ list ) : $ this ->getProduct ()->url ();
173183 }
174184}
You can’t perform that action at this time.
0 commit comments