コード例 #1
0
 public function executesettheme($eventData)
 {
     $userCfg = new UserSettings(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess(), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getUserId());
     $userCfg->setKey('wui-theme', $eventData['theme']);
     if (User::isAdminUser(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getUserName(), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDomainId())) {
         $domainCfg = new DomainSettings(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess());
         $domainCfg->EditKey('wui-theme', $eventData['theme']);
     }
     $wui = \Innomatic\Wui\Wui::instance('\\Innomatic\\Wui\\Wui');
     $wui->setTheme($eventData['theme']);
     \Innomatic\Webapp\WebAppContainer::instance('\\Innomatic\\Webapp\\WebAppContainer')->getProcessor()->getResponse()->addHeader('Location', WuiEventsCall::buildEventsCallString('', array(array('view', 'default', ''), array('action', 'settheme2', ''))));
 }
コード例 #2
0
function main_editclipping($eventData)
{
    global $gXml_def, $gLocale, $customers;
    $innowork_clipping = new InnoworkClipping(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess(), $eventData['id']);
    $clipping_data = $innowork_clipping->GetItem();
    $headers[0]['label'] = $gLocale->getStr('editclipping.header');
    $gXml_def = '
    <horizgroup>
      <children>
    
        <table>
          <args>
            <headers type="array">' . WuiXml::encode($headers) . '</headers>
          </args>
          <children>
    
            <form row="0" col="0"><name>editclipping</name>
              <args>
                    <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'default'), array('action', 'editclipping', array('id' => $eventData['id']))))) . '</action>
              </args>
              <children>
                <grid>
                  <children>
    
                    <label row="0" col="0">
                      <args>
                        <label type="encoded">' . urlencode($gLocale->getStr('name.label')) . '</label>
                      </args>
                    </label>
    
                    <string row="0" col="1"><name>name</name>
                      <args>
                        <disp>action</disp>
                        <size>20</size>
                        <value type="encoded">' . urlencode($clipping_data['name']) . '</value>
                      </args>
                    </string>
    
                    <label row="1" col="0">
                      <args>
                        <label type="encoded">' . urlencode($gLocale->getStr('description.label')) . '</label>
                      </args>
                    </label>
    
                    <text row="1" col="1"><name>description</name>
                      <args>
                        <disp>action</disp>
                        <rows>5</rows>
                        <cols>40</cols>
                        <value type="encoded">' . urlencode($clipping_data['description']) . '</value>
                      </args>
                    </text>
    
                  </children>
                </grid>
              </children>
            </form>
    
            <horizgroup row="1" col="0">
              <children>
    
                <button>
                  <args>
                    <themeimage>buttonok</themeimage>
                    <label type="encoded">' . urlencode($gLocale->getStr('edit_clipping.button')) . '</label>
                    <formsubmit>editclipping</formsubmit>
                    <frame>false</frame>
                    <horiz>true</horiz>
                    <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'default'), array('action', 'editclipping', array('id' => $eventData['id']))))) . '</action>
                  </args>
                </button>
    
              </children>
            </horizgroup>
    
          </children>
        </table>
    
      <innoworkitemacl><name>itemacl</name>
        <args>
          <itemtype>clipping</itemtype>
          <itemid>' . $eventData['id'] . '</itemid>
          <itemownerid>' . $clipping_data['ownerid'] . '</itemownerid>
          <defaultaction type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'editclipping', array('id' => $eventData['id']))))) . '</defaultaction>
        </args>
      </innoworkitemacl>
    
    
      </children>
    </horizgroup>';
}
コード例 #3
0
function main_stats($eventData)
{
    global $gPage_title, $gPage_content, $gLocale;
    $stats_ok = false;
    require_once 'innomatic/locale/LocaleCountry.php';
    $locale_country = new LocaleCountry(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getCountry());
    if (isset($eventData['statsfrom']) and isset($eventData['statsto'])) {
        //$stats_ok = true;
        $from_date = $locale_country->GetDateArrayFromShortDateStamp($eventData['statsfrom']);
        $from_ts = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->GetTimestampFromDateArray($from_date);
        $from_secs = mktime(0, 0, 0, $from_date['mon'], $from_date['mday'], $from_date['year']);
        $to_date = $locale_country->GetDateArrayFromShortDateStamp($eventData['statsto']);
        $to_date['hours'] = 23;
        $to_date['minutes'] = 59;
        $to_date['seconds'] = 59;
        $to_ts = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->GetTimestampFromDateArray($to_date);
        $to_secs = mktime(23, 59, 59, $to_date['mon'], $to_date['mday'], $to_date['year']);
        $stats_query = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->execute('SELECT * ' . 'FROM innowork_core_itemslog ' . 'WHERE eventtime>=' . \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->formatText($from_ts) . ' ' . 'AND eventtime<=' . \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->formatText($to_ts));
        $users_stats_query = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->execute('SELECT username,count(username) AS count ' . 'FROM innowork_core_itemslog ' . 'WHERE eventtime>=' . \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->formatText($from_ts) . ' ' . 'AND eventtime<=' . \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->formatText($to_ts) . ' ' . 'GROUP BY username');
        $stats_data = $_stats_data = array();
        while (!$stats_query->eof) {
            $tmp_date = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->GetDateArrayFromTimestamp($stats_query->getFields('eventtime'));
            if (!isset($_stats_data[$tmp_date['year'] . $tmp_date['mon'] . $tmp_date['mday']])) {
                $_stats_data[$tmp_date['year'] . $tmp_date['mon'] . $tmp_date['mday']]['changes'] = 1;
            } else {
                $_stats_data[$tmp_date['year'] . $tmp_date['mon'] . $tmp_date['mday']]['changes']++;
            }
            $_stats_data[$tmp_date['year'] . $tmp_date['mon'] . $tmp_date['mday']]['day'] = $tmp_date['mday'];
            $stats_query->MoveNext();
        }
        for ($i = $from_secs; $i <= $to_secs; $i += 60 * 60 * 24) {
            $tmp_date_array = $locale_country->GetDateArrayFromUnixTimestamp($i);
            if (!isset($_stats_data[$tmp_date_array['year'] . $tmp_date_array['mon'] . $tmp_date_array['mday']])) {
                $_stats_data[$tmp_date_array['year'] . $tmp_date_array['mon'] . $tmp_date_array['mday']]['changes'] = 0;
                $_stats_data[$tmp_date_array['year'] . $tmp_date_array['mon'] . $tmp_date_array['mday']]['day'] = $tmp_date_array['mday'];
            }
        }
        ksort($_stats_data);
        $x_array = $y_array = array();
        $cont = 1;
        foreach ($_stats_data as $id => $value) {
            $x_array[] = $cont++;
            $y_array[] = $value['changes'];
        }
        reset($_stats_data);
        require_once 'phplot/PHPlot.php';
        $regression_data = phplot_regression($x_array, $y_array);
        $cont = 0;
        foreach ($_stats_data as $value) {
            $stats_data[] = array($value['day'], $value['changes'], $regression_data[$cont++][2]);
        }
        $users_stats_data = array();
        while (!$users_stats_query->eof) {
            if (strpos($users_stats_query->getFields('username'), '@')) {
                $username = substr($users_stats_query->getFields('username'), 0, strpos($users_stats_query->getFields('username'), '@'));
            } else {
                $username = $users_stats_query->getFields('username');
            }
            $users_stats_data[] = array(ucfirst($username), $users_stats_query->getFields('count'));
            $users_stats_query->MoveNext();
        }
        $stats_ok = true;
    } else {
        $from_date = $locale_country->getDateArrayFromSafeTimestamp($locale_country->SafeFormatTimestamp(time() - 60 * 60 * 24 * 30));
        $to_date = $locale_country->getDateArrayFromSafeTimestamp($locale_country->SafeFormatTimestamp());
    }
    require_once 'innomatic/wui/dispatch/WuiEventsCall.php';
    $xml_def = '
    <vertgroup>
      <children>

        <form><name>stats</name>
          <args>
                    <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'stats')))) . '</action>
          </args>
          <children>

            <horizgroup>
              <args>
                <align>middle</align>
              </args>
              <children>

                <label>
                  <args>
                    <label type="encoded">' . urlencode($gLocale->getStr('stats_from.label')) . '</label>
                  </args>
                </label>

                <date><name>statsfrom</name>
                  <args>
                    <disp>view</disp>
                    <value type="array">' . WuiXml::encode($from_date) . '</value>
                  </args>
                </date>

                <label>
                  <args>
                    <label type="encoded">' . urlencode($gLocale->getStr('stats_to.label')) . '</label>
                  </args>
                </label>

                <date><name>statsto</name>
                  <args>
                    <disp>view</disp>
                    <value type="array">' . WuiXml::encode($to_date) . '</value>
                  </args>
                </date>

                <button>
                  <args>
                    <themeimage>buttonok</themeimage>
                    <horiz>true</horiz>
                    <label type="encoded">' . urlencode($gLocale->getStr('get_stats.button')) . '</label>
                    <formsubmit>stats</formsubmit>
                    <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'stats')))) . '</action>
                  </args>
                </button>

              </children>
            </horizgroup>

          </children>
        </form>';
    if ($stats_ok) {
        $legend = array($gLocale->getStr('activites_legend.label'), $gLocale->getStr('trend_legend.label'));
        $xml_def .= '<horizbar/>

        <phplot>
          <args>
            <data type="array">' . WuiXml::encode($stats_data) . '</data>
            <width>600</width>
            <height>350</height>
            <title type="encoded">' . urlencode($gLocale->getStr('statistics.title')) . '</title>
            <legend type="array">' . WuiXml::encode($legend) . '</legend>
            <pointsize>1</pointsize>
          </args>
        </phplot>

        <phplot>
          <args>
            <data type="array">' . WuiXml::encode($users_stats_data) . '</data>
            <width>600</width>
            <height>350</height>
            <title type="encoded">' . urlencode($gLocale->getStr('statistics_users.title')) . '</title>
            <plottype>bars</plottype>
            <pointsize>1</pointsize>
          </args>
        </phplot>';
    }
    $xml_def .= '  </children>
    </vertgroup>';
    $gPage_content = new WuiXml('page', array('definition' => $xml_def));
    $gPage_title = $gLocale->getStr('statistics.title');
}
コード例 #4
0
 function _FillDefinition()
 {
     $result = true;
     require_once 'innomatic/locale/LocaleCatalog.php';
     require_once 'innomatic/locale/LocaleCountry.php';
     $row = 0;
     $this->mDefinition = '
                 <vertgroup><name>searchresult</name><children>';
     while (list($type, $results) = each($this->mSearchResult)) {
         if (count($results)) {
             $tmp_locale = new LocaleCatalog($this->mSummaries[$type]['catalog'], \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getLanguage());
             /*
                             $itemtype_call = new WuiEventsCall( $val['domainpanel'] );
                             $itemtype_call->addEvent( new WuiEvent( 'view', 'default', '' ) );
                     <button>
                       <name>itemtypeimage</name>
                       <args><themeimage>'.$val['icon'].'</themeimage><themeimagetype>'.$val['icontype'].'</themeimagetype><action>'.$itemtype_call->getEventsCallString().'</action></args>
                     </button>
             */
             $this->mDefinition .= '<button><name>type</name>
                                   <args>
                                     <themeimage>' . $this->mSummaries[$type]['icon'] . '</themeimage>
                                     <themeimagetype>' . $this->mSummaries[$type]['icontype'] . '</themeimagetype>
                                     <action>' . WuiXml::cdata(WuiEventsCall::buildEventsCallString($this->mSummaries[$type]['domainpanel'], array(array('view', 'default', '')))) . '</action>
                                     <label type="encoded">' . WuiXml::cdata(urlencode($this->mSummaries[$type]['label'])) . '</label>
                                     <horiz>true</horiz>
                                   </args>
                                 </button>';
             $headers = array();
             $header_count = 1;
             $locale_country = new LocaleCountry(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getCountry());
             while (list(, $keyname) = each($this->mSummaries[$type]['viewablesearchresultkeys'])) {
                 $headers[$header_count++]['label'] = $tmp_locale->getStr($keyname);
             }
             $this->mDefinition .= '<table><name>searchresult</name><args><headers type="array">' . WuiXml::encode($headers) . '</headers></args><children>';
             $row = 0;
             //$col = 1;
             while (list($id, $result) = each($results)) {
                 $col = 1;
                 switch ($result['_acl']['type']) {
                     case InnoworkAcl::TYPE_PRIVATE:
                         $image = 'user';
                         break;
                     case InnoworkAcl::TYPE_PUBLIC:
                     case InnoworkAcl::TYPE_ACL:
                         $image = 'useradd';
                         break;
                 }
                 $this->mDefinition .= '<button row="' . $row . '" col="0"><name>acl</name>
                                           <args>
                                             <themeimage>' . $image . '</themeimage>
                                             <themeimagetype>mini</themeimagetype>
                                             <compact>true</compact>
                                             <action>' . WuiXml::cdata(WuiEventsCall::buildEventsCallString($this->mSummaries[$type]['domainpanel'], array(array($this->mSummaries[$type]['showdispatcher'], $this->mSummaries[$type]['showevent'], array('id' => $result['id']))))) . '</action>
                                           </args>
                                         </button>';
                 foreach ($this->mSummaries[$type]['viewablesearchresultkeys'] as $key) {
                     $value = $result[$key];
                     if ($col == 1) {
                         $this->mDefinition .= '<link row="' . $row . '" col="' . $col . '"><name>key</name>
                                                           <args>
                                                             <compact>true</compact>
                                                             <link>' . WuiXml::cdata(WuiEventsCall::buildEventsCallString($this->mSummaries[$type]['domainpanel'], array(array($this->mSummaries[$type]['showdispatcher'], $this->mSummaries[$type]['showevent'], array('id' => $result['id']))))) . '</link>
                                                             <label type="encoded">' . WuiXml::cdata(strlen($value) > 35 ? urlencode(substr($value, 0, 32)) . '...' : urlencode($value)) . '</label>
                                                             <title type="encoded">' . WuiXml::cdata(urlencode(str_replace('"', '', $value))) . '</title>
                                                           </args>
                                                         </link>';
                     } else {
                         $key_type = explode(':', $this->mSummaries[$type]['keys'][$key]);
                         switch ($key_type[0]) {
                             case 'text':
                                 $value = strlen($value) > 35 ? substr($value, 0, 32) . '...' : $value;
                                 break;
                             case 'timestamp':
                                 $value = $locale_country->FormatShortArrayDate(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->GetDateArrayFromTimestamp($value));
                                 break;
                             case 'boolean':
                                 if ($value == \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->fmttrue) {
                                     $value = 'true';
                                 } else {
                                     $value = 'false';
                                 }
                                 break;
                             case 'table':
                                 if (strlen($value)) {
                                     $tmp_query = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->execute('SELECT ' . $key_type[2] . ' FROM ' . $key_type[1] . ' WHERE id=' . $value);
                                     if ($tmp_query->getNumberRows()) {
                                         $value = $tmp_query->getFields($key_type[2]);
                                     } else {
                                         $value = '';
                                     }
                                     $tmp_query->Free();
                                 } else {
                                     $value = '';
                                 }
                                 break;
                             case 'userid':
                                 if (strlen($value)) {
                                     $tmp_query = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->execute('SELECT id,username,fname,lname FROM domain_users WHERE id=' . $value);
                                     if ($tmp_query->getNumberRows()) {
                                         $value = $tmp_query->getFields('fname') . ' ' . $tmp_query->getFields('lname');
                                     } else {
                                         $value = '';
                                     }
                                     $tmp_query->Free();
                                 } else {
                                     $value = '';
                                 }
                                 break;
                             default:
                                 break;
                         }
                         $this->mDefinition .= '<label row="' . $row . '" col="' . $col . '"><name>key</name>
                                                           <args>
                                                             <compact>true</compact>
                         									<nowrap>false</nowrap>
                                                             <label type="encoded">' . WuiXml::cdata(urlencode($value)) . '</label>
                                                           </args>
                                                         </label>';
                     }
                     $col++;
                 }
                 if ($this->mTrashcan == 'true') {
                     $locale = new LocaleCatalog('innowork-core::misc', \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getLanguage());
                     $this->mDefinition .= '<button row="' . $row . '" col="' . $col . '"><name>restore</name>
                                                   <args>
                                                     <label type="encoded">' . WuiXml::cdata(urlencode($locale->getStr('restore.button'))) . '</label>
                                                     <horiz>true</horiz>
                                                     <frame>false</frame>
                                                     <themeimagetype>mini</themeimagetype>
                                                     <themeimage>undo</themeimage>
                                                              <action>' . WuiXml::cdata(WuiEventsCall::buildEventsCallString('1innoworkcore', array(array('view', 'trashcan'), array('action', 'restore_item', array('itemtype' => $type, 'itemid' => $result['id']))))) . '</action>
                                                   </args>
                                                 </button>';
                 }
                 if ($this->mClipping == 'true' and $this->mClippingId) {
                     $locale = new LocaleCatalog('innowork-core::misc', \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getLanguage());
                     $this->mDefinition .= '<button row="' . $row . '" col="' . $col . '"><name>remove</name>
                                                   <args>
                                                     <label type="encoded">' . WuiXml::cdata(urlencode($locale->getStr('remove_from_clipping.button'))) . '</label>
                                                     <horiz>true</horiz>
                                                     <frame>false</frame>
                                                     <themeimagetype>mini</themeimagetype>
                                                     <themeimage>editdelete</themeimage>
                                                              <action>' . WuiXml::cdata(WuiEventsCall::buildEventsCallString('innoworkclippings', array(array('view', 'showclipping', array('id' => $this->mClippingId)), array('action', 'remove_item', array('id' => $this->mClippingId, 'itemtype' => $type, 'itemid' => $result['id']))))) . '</action>
                                                   </args>
                                                 </button>';
                 }
                 $row++;
             }
             $this->mDefinition .= '</children></table>';
         }
     }
     $this->mDefinition .= '</children></vertgroup>';
     return $result;
 }
コード例 #5
0
function methods_list_action_builder($pageNumber)
{
    $tmpMainDisp = new WuiDispatcher('view');
    $eventData = $tmpMainDisp->getEventData();
    return WuiEventsCall::buildEventsCallString('', array(array('view', 'showmethods', array('methodspage' => $pageNumber, 'accountid' => $eventData['accountid']))));
}
コード例 #6
0
    public function viewMotd($eventData)
    {
        if (!\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->hasPermission('edit_motd')) {
            return $this->viewDefault();
        }
        $domain = new \Innomatic\Domain\Domain(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDomainId(), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess());
        $xmlDef = '<vertgroup><name>motd</name>
          <children>

            <form><name>motd</name>
              <args>
                <method>post</method>
                <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'motd', ''), array('action', 'setmotd', '')))) . '</action>
              </args>
              <children>

                <grid><name>motd</name>

                  <children>

                    <label row="0" col="0" halign="" valign="top"><name>label</name>
                      <args>
                        <label type="encoded">' . urlencode($this->localeCatalog->getStr('motd.label')) . '</label>
                      </args>
                    </label>

                    <text row="0" col="1"><name>motd</name>
                      <args>
                        <rows>10</rows>
                        <cols>80</cols>
                        <disp>action</disp>
                        <value type="encoded">' . urlencode($domain->getMotd()) . '</value>
                      </args>
                    </text>

                  </children>

                </grid>

              </children>
            </form>

            <horizbar><name>hb</name></horizbar>

            <button>
              <name>apply</name>
              <args>
                <horiz>true</horiz>
                <frame>false</frame>
                <themeimage>buttonok</themeimage>
                <label type="encoded">' . urlencode($this->localeCatalog->getStr('set_motd.submit')) . '</label>
                <formsubmit>motd</formsubmit>
                <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'motd', ''), array('action', 'setmotd', '')))) . '</action>
              </args>
            </button>

          </children>
        </vertgroup>';
        $this->wuiMainframe->addChild(new WuiXml('page', array('definition' => $xmlDef)));
        $this->wuiTitlebar->mTitle .= ' - ' . $this->localeCatalog->getStr('motd.title');
    }
コード例 #7
0
function main_default($eventData)
{
    global $gXml_def;
    $example_data = array(array("80", 0.0, 20, 4, 5, 6), array("81", 2.0, 30, 5, 6, 7), array("82", 3.0, 40, 5, 7, 8), array("83", 4.0, 50, 3, 6, 3), array("84", 4.4, 40, 3, 6, 5), array("85", 5.4, 40, 5, 6, 5), array("86", 5.5, 40, 7, 6, 5), array("87", 7, 35, 0.0, 0.0, ""), array("88", 7.4, 40, 14, 16, 25), array("89", 7.6, 40, 6, 6, 5), array("90", 8.199999999999999, 40, 3, 6, 5), array("91", 8.5, 40, 8, 6, 9), array("92", 9.300000000000001, 40, 5, 6, 5), array("93", 9.6, 40, 9, 6, 7), array("94", 9.9, 40, 2, 6, 5), array("95", 10.0, 40, 3, 6, 8), array("96", 10.4, 40, 3, 6, 5), array("97", 10.5, 40, 3, 6, 5), array("98", 10.8, 40, 3, 6, 5), array("99", 11.4, 40, 3, 6, 5), array("00", 12.0, 40, 3, 7, 5), array("01", 13.4, 40, 3, 5, 3), array("02", 14.0, 30, 3, 5, 6));
    $legend = array('Prodotto A', 'Prodotto B', 'Prodotto C', 'Prodotto D', 'Prodotto E');
    $gXml_def = '<vertgroup>
  <children>

    <label>
      <args>
        <label>Grafico</label>
      </args>
    </label>

    <vertframe>
      <children>

        <phplot>
          <args>
            <data type="array">' . WuiXml::encode($example_data) . '</data>
            <width>600</width>
            <height>350</height>
            <legend type="array">' . WuiXml::encode($legend) . '</legend>
            <plottype>' . $eventData['plottype'] . '</plottype>
            <title>Elaborazione fatturato</title>
          </args>
        </phplot>

      </children>
    </vertframe>

    <horizbar/>

    <horizgroup>
      <children>

        <button>
          <args>
            <themeimage>button_ok</themeimage>
            <horiz>true</horiz>
            <themeimagetype>mini</themeimagetype>
            <label>Bars</label>
            <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'default', array('plottype' => 'bars'))))) . '</action>
          </args>
        </button>

        <button>
          <args>
            <themeimage>button_ok</themeimage>
            <horiz>true</horiz>
            <themeimagetype>mini</themeimagetype>
            <label>Lines</label>
            <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'default', array('plottype' => 'lines'))))) . '</action>
          </args>
        </button>

        <button>
          <args>
            <themeimage>button_ok</themeimage>
            <horiz>true</horiz>
            <themeimagetype>mini</themeimagetype>
            <label>Linepoints</label>
            <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'default', array('plottype' => 'linepoints'))))) . '</action>
          </args>
        </button>

        <button>
          <args>
            <themeimage>button_ok</themeimage>
            <horiz>true</horiz>
            <themeimagetype>mini</themeimagetype>
            <label>Area</label>
            <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'default', array('plottype' => 'area'))))) . '</action>
          </args>
        </button>

        <button>
          <args>
            <themeimage>button_ok</themeimage>
            <horiz>true</horiz>
            <themeimagetype>mini</themeimagetype>
            <label>Points</label>
            <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'default', array('plottype' => 'points'))))) . '</action>
          </args>
        </button>

        <button>
          <args>
            <themeimage>button_ok</themeimage>
            <horiz>true</horiz>
            <themeimagetype>mini</themeimagetype>
            <label>Pie</label>
            <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'default', array('plottype' => 'pie'))))) . '</action>
          </args>
        </button>

      </children>
    </horizgroup>

  </children>
</vertgroup>';
}
コード例 #8
0
function main_default($eventData)
{
    global $gXml_def, $innowork_core, $gLocale, $gWui, $gPage_status, $gPage_title;
    $summaries = $innowork_core->GetSummaries();
    $types[''] = $gLocale->getStr('alltypes.label');
    while (list($key, $val) = each($summaries)) {
        if ($val['searchable']) {
            $types[$key] = $val['label'];
        }
    }
    reset($summaries);
    $tab_labels[0]['label'] = $gLocale->getStr('defacls.tab');
    $gXml_def = '
<vertgroup>
  <children>
    <tab>
      <name>settings</name>
      <args>
        <tabs type="array">' . WuiXml::encode($tab_labels) . '</tabs>
        <tabactionfunction>main_tab_action_handler</tabactionfunction>
        <activetab>' . (isset($eventData['maintab']) ? $eventData['maintab'] : '') . '</activetab>
      </args>
      <children>
        <!-- Default ACLs tab -->
        <vertgroup>
          <children>
            <label>
              <args>
                <bold>true</bold>
                <label type="encoded">' . urlencode($gLocale->getStr('defacls.title')) . '</label>
              </args>
            </label>
            <horizbar/>
            <horizgroup>
              <children>
                <vertgroup>
                  <children>';
    foreach ($summaries as $type => $opts) {
        $class_name = $opts['classname'];
        if (!class_exists($class_name)) {
            continue;
        }
        $tmp_class = new $class_name(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess(), 0);
        if ($type != 'defaultaclitem' and $tmp_class->mNoAcl != true and !isset($tmp_class->_mSkipAclSet) and !isset($tmp_class->_mCreationAcl)) {
            $gXml_def .= '
              <button>
                <args>
                  <label type="encoded">' . urlencode($opts['label']) . '</label>
                  <themeimage>' . $opts['icon'] . '</themeimage>
                  <themeimagetype>' . $opts['icontype'] . '</themeimagetype>
                  <horiz>true</horiz>
                  <disabled>' . ($eventData['setdefacl'] == $type ? 'true' : 'false') . '</disabled>
                  <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'default', array('setdefacl' => $type))))) . '</action>
                </args>
              </button>';
        }
    }
    $gXml_def .= '                  </children>
                </vertgroup>';
    if (isset($eventData['setdefacl'])) {
        $check_query = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->Execute('SELECT * FROM innowork_core_acls_defaults WHERE ownerid=' . \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getUserId() . ' AND itemtype=' . \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->formatText($eventData['setdefacl']));
        if ($check_query->getNumberRows()) {
            $id = $check_query->getFields('id');
        } else {
            $item = new InnoworkDefaultAclItem(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess());
            $params['itemtype'] = $eventData['setdefacl'];
            $item->Create($params);
            $id = $item->mItemId;
        }
        $gXml_def .= '
                <vertbar/>
                <vertgroup>
                  <args>
                    <align>center</align>
                  </args>
                  <children>
                    <label>
                      <args>
                        <label type="encoded">' . urlencode($summaries[$eventData['setdefacl']]['label']) . '</label>
                        <bold>true</bold>
                      </args>
                    </label>
                    <horizbar/>
      <innoworkitemacl><name>itemacl</name>
        <args>
          <itemtype>defaultaclitem</itemtype>
          <itemid>' . $id . '</itemid>
          <itemownerid>' . \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getUserId() . '</itemownerid>
          <defaultaction type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'default', array('setdefacl' => $eventData['setdefacl']))))) . '</defaultaction>
        </args>
      </innoworkitemacl>
                  </children>
                </vertgroup>
';
    }
    $gXml_def .= '              </children>
            </horizgroup>
          </children>
        </vertgroup>
      </children>
    </tab>
  </children>
</vertgroup>';
}
コード例 #9
0
 public function viewdefault($eventData)
 {
     //$app_cfg = new ApplicationSettings(
     //    'innomatic' );
     $themesQuery = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->execute('SELECT name,catalog FROM wui_themes');
     while (!$themesQuery->eof) {
         $tmpLocale = new LocaleCatalog($themesQuery->getFields('catalog'), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getLanguage());
         $elements[$themesQuery->getFields('name')] = $tmpLocale->getStr($themesQuery->getFields('name'));
         $themesQuery->moveNext();
     }
     asort($elements);
     $xmlDef = '<vertgroup><name>vgroup</name><args><halign>center</halign></args><children>
 <form><name>theme</name><args><action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'default', ''), array('action', 'settheme', '')))) . '</action></args><children>
     <grid><name>themegrid</name><children>
       <label row="0" col="0"><name>themelabel</name><args><label type="encoded">' . urlencode($this->localeCatalog->getStr('themes_label')) . '</label><bold>true</bold></args></label>
       <listbox row="1" col="0"><name>theme</name><args><elements type="array">' . WuiXml::encode($elements) . '</elements><default>' . \Innomatic\Wui\Wui::instance('\\Innomatic\\Wui\\Wui')->getThemeName() . '</default><disp>action</disp><size>10</size></args></listbox>
     </children></grid>
     <submit><name>submit</name><args><caption type="encoded">' . urlencode($this->localeCatalog->getStr('settheme_submit')) . '</caption></args></submit>
   </children></form>
 </children></vertgroup>';
     $this->wuiMainframe->addChild(new WuiXml('page', array('definition' => $xmlDef)));
     $this->wuiTitlebar->mArgs['title'] .= ' - ' . $this->localeCatalog->getStr('themes_title');
 }