Ejemplo n.º 1
0
 *
 * Contributor(s):
 *   Alex Pagnoni <*****@*****.**>
 *
 * ***** END LICENSE BLOCK ***** */
// ----- Initialization -----
//
require_once 'innomatic/wui/Wui.php';
require_once 'innomatic/wui/dispatch/WuiDispatcher.php';
require_once 'innomatic/locale/LocaleCatalog.php';
require_once 'innowork/core/clipping/InnoworkClipping.php';
global $gPage_status, $gLocale;
global $gLocale, $gPage_title, $gXml_def, $gPage_status, $gToolbars, $gInnowork_core, $customers;
$gInnowork_core = \Innowork\Core\InnoworkCore::instance('\\Innowork\\Core\\InnoworkCore', \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess());
$gLocale = new LocaleCatalog('innowork-core::clippings', \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getLanguage());
$gWui = Wui::instance('wui');
$gWui->LoadWidget('xml');
$gWui->LoadWidget('innomaticpage');
$gWui->LoadWidget('innomatictoolbar');
$gXml_def = $gPage_status = '';
$gPage_title = $gLocale->getStr('innoworkclippings.title');
$gCore_toolbars = $gInnowork_core->GetMainToolBar();
$gToolbars['mail'] = array('clippings' => array('label' => $gLocale->getStr('clippings.toolbar'), 'themeimage' => 'listicons', 'horiz' => 'true', 'action' => WuiEventsCall::buildEventsCallString('', array(array('view', 'default', array('done' => 'false'))))), 'newclipping' => array('label' => $gLocale->getStr('newclipping.toolbar'), 'themeimage' => 'filenew', 'horiz' => 'true', 'action' => WuiEventsCall::buildEventsCallString('', array(array('view', 'newclipping', '')))));
// ----- Action dispatcher -----
//
$gAction_disp = new WuiDispatcher('action');
$gAction_disp->addEvent('newclipping', 'action_newclipping');
function action_newclipping($eventData)
{
    global $gPage_status, $gLocale;
    $clipping = new InnoworkClipping(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess());
                                break;
                        }
                    }
                }
                break;
            case 'innoworkconvert':
                $tmp_innoworkcore = InnoworkCore::instance('\\Innowork\\Core\\InnoworkCore', \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess());
                $summaries = $tmp_innoworkcore->getSummaries();
                $class_name = $summaries[Wui::instance('wui')->parameters['wui']['wui']['evd']['aclitemtype']]['classname'];
                if (!class_exists($class_name)) {
                    break;
                }
                $tmp_class = new $class_name(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess(), Wui::instance('wui')->parameters['wui']['wui']['evd']['aclitemid']);
                if ($tmp_class->mConvertible) {
                    $tmp_data = $tmp_class->getItem(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getUserId());
                    $tmp_class->convertTo(Wui::instance('wui')->parameters['wui']['wui']['evd']['type']);
                    unset($tmp_data);
                    unset($tmp_class);
                    $GLOBALS['innoworkcore']['itemacl'][Wui::instance('wui')->parameters['wui']['wui']['evd']['aclitemtype']][Wui::instance('wui')->parameters['wui']['wui']['evd']['aclitemid']] = true;
                }
                break;
            case 'innoworkaddtoclipping':
                require_once 'innowork/core/clipping/InnoworkClipping.php';
                $tmp_innoworkclipping = new InnoworkClipping(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess(), Wui::instance('wui')->parameters['wui']['wui']['evd']['clippingid']);
                $tmp_innoworkclipping->addItem(Wui::instance('wui')->parameters['wui']['wui']['evd']['aclitemtype'], Wui::instance('wui')->parameters['wui']['wui']['evd']['aclitemid']);
                unset($tmp_innoworkclipping);
                $GLOBALS['innoworkcore']['itemacl'][Wui::instance('wui')->parameters['wui']['wui']['evd']['aclitemtype']][Wui::instance('wui')->parameters['wui']['wui']['evd']['aclitemid']] = true;
                break;
        }
    }
}