Beispiel #1
0
	</script>
</head>
<body>
		<div id="topBar">
		<?php 
print join(" ", $this->getVar('nav')->getHTMLMenuBarAsLinkArray());
$vb_client_services = (bool) $this->request->config->get('enable_client_services');
if (!$this->request->config->get('dont_allow_registration_and_login')) {
    if ($this->request->isLoggedIn()) {
        $o_client_services_config = caGetClientServicesConfiguration();
        if ($vb_client_services && (bool) $o_client_services_config->get('enable_user_communication')) {
            //
            // Unread client communications
            //
            $t_comm = new ca_commerce_communications();
            $va_unread_messages = $t_comm->getMessages(array('unreadOnly' => true, 'user_id' => $this->request->getUserID()));
            $va_message_set_ids = array();
            foreach ($va_unread_messages as $vn_transaction_id => $va_messages) {
                $va_message_set_ids[] = $va_messages[0]['set_id'];
            }
        }
        if (!$this->request->config->get('disable_my_collections')) {
            # --- get all sets for user
            $t_set = new ca_sets();
            $va_sets = caExtractValuesByUserLocale($t_set->getSets(array('table' => 'ca_objects', 'user_id' => $this->request->getUserID())));
            if (is_array($va_sets) && sizeof($va_sets) > 1) {
                print "<div id='lightboxLink'>\n\t\t\t\t\t\t\t\t\t\t<a href='#' onclick='\$(\"#lightboxList\").toggle(0, function(){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(\$(\"#lightboxLink\").hasClass(\"lightboxLinkActive\")) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\$(\"#lightboxLink\").removeClass(\"lightboxLinkActive\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\$(\"#lightboxLink\").addClass(\"lightboxLinkActive\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});')>Lightbox</a>";
                if (is_array($va_message_set_ids) && sizeof($va_message_set_ids)) {
                    print " <img src='" . $this->request->getThemeUrlPath() . "/graphics/icons/envelope.gif' border='0'>";
                }
                print "<div id='lightboxList'><b>" . _t("your lightboxes") . ":</b><br/>";
Beispiel #2
0
 /**
  *
  */
 function Index()
 {
     if (!$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, '', 'LoginReg', 'form'));
         return;
     }
     if (!($t_set = $this->_getSet(__CA_SET_READ_ACCESS__))) {
         $t_set = new ca_sets();
     }
     JavascriptLoadManager::register('sortableUI');
     # --- get all sets for user
     $va_sets = caExtractValuesByUserLocale($t_set->getSets(array('table' => 'ca_objects', 'user_id' => $this->request->getUserID())));
     if (sizeof($va_sets) == 0) {
         # --- if there are not any sets for this user, make a new set for them
         $t_new_set = new ca_sets();
         $vn_new_set_id = null;
         $t_new_set->setMode(ACCESS_WRITE);
         $t_new_set->set('access', 0);
         $t_new_set->set('table_num', 57);
         // 57=ca_objects
         $t_list = new ca_lists();
         $vn_set_id = $t_list->getItemIDFromList('set_types', $this->request->config->get('user_set_type'));
         $t_new_set->set('type_id', $vn_set_id);
         $t_new_set->set('user_id', $this->request->getUserID());
         $t_new_set->set('set_code', $this->request->getUserID() . '_' . time());
         $t_new_set->insert();
         if (!$t_new_set->numErrors()) {
             if ($vn_new_set_id = $t_new_set->getPrimaryKey()) {
                 global $g_ui_locale_id;
                 // current locale_id for user
                 $t_new_set->addLabel(array('name' => _t("Your first lightbox")), $g_ui_locale_id, null, true);
                 // select the current set
                 $this->request->user->setVar('current_set_id', $vn_new_set_id);
                 # --- load new set
                 $t_set = new ca_sets($vn_new_set_id);
                 # --- get the sets again so the new set is included
                 $va_sets = caExtractValuesByUserLocale($t_set->getSets(array('table' => 'ca_objects', 'user_id' => $this->request->getUserID())));
             }
         }
     }
     $t_new_set = new ca_sets();
     # --- new set object used for access drop down in new set form
     $this->view->setVar('t_set', $t_set);
     $this->view->setVar('t_new_set', $t_new_set);
     $this->view->setVar('set_list', $va_sets);
     $this->view->setVar('set_name', $t_set->getLabelForDisplay());
     $this->view->setVar('set_description', $t_set->get("ca_sets.set_intro"));
     $this->view->setVar('set_access', $t_set->get("ca_sets.access"));
     if ($this->request->config->get("dont_enforce_access_settings")) {
         $va_access_values = array();
     } else {
         $va_access_values = caGetUserAccessValues($this->request);
     }
     $this->view->setVar('items', $va_items = caExtractValuesByUserLocale($t_set->getItems(array('thumbnailVersions' => array('thumbnail', 'icon'), 'checkAccess' => $va_access_values, 'user_id' => $this->request->getUserID()))));
     $va_found_item_ids = array();
     foreach ($va_items as $vn_i => $va_item) {
         $va_found_item_ids[] = $va_item['row_id'];
     }
     $t_trans = new ca_commerce_transactions();
     $t_trans->load(array('set_id' => $t_set->getPrimaryKey()));
     $vn_transaction_id = $t_trans->getPrimaryKey();
     $t_comm = new ca_commerce_communications();
     $this->view->setVar('messages', $t_comm->getMessages($this->request->getUserID(), array('transaction_id' => $vn_transaction_id)));
     $opo_result_context = new ResultContext($this->request, 'ca_objects', 'sets');
     $opo_result_context->setResultList($va_found_item_ids);
     $opo_result_context->setAsLastFind();
     $opo_result_context->saveContext();
     # --- use a different view if client services is enabled
     if ($this->request->config->get("enable_client_services")) {
         $this->render('Sets/client_services_html.php');
     } else {
         $this->render('Sets/sets_html.php');
     }
 }
 /**
  * 
  */
 public function Info()
 {
     $t_comm = new ca_commerce_communications();
     $va_unread_messages = $t_comm->getMessages($this->request->getUserID(), array("unreadOnly" => true));
     $this->view->setVar("numUnreadMessages", sizeof($va_unread_messages));
     return $this->render('widget_communications_info_html.php', true);
 }
 /**
  * 
  */
 public function ViewOrder()
 {
     if (!$this->request->isLoggedIn()) {
         return;
     }
     $pn_order_id = $this->request->getParameter('order_id', pInteger);
     $t_order = new ca_commerce_orders($pn_order_id);
     if (!$t_order->userHasAccessToOrder($this->request->getUserID())) {
         $this->notification->addNotification(_t("Invalid order_id"), __NOTIFICATION_TYPE_ERROR__);
         $this->response->setRedirect(caNavUrl($this->request, '', 'Account', 'Index'), 302);
         return;
     } else {
         if (!in_array($t_order->get('order_status'), array('AWAITING_PAYMENT', 'PROCESSED', 'PROCESSED_AWAITING_DIGITIZATION', 'COMPLETED', 'REOPENED'))) {
             $this->notification->addNotification(_t("This order is not yet available for viewing"), __NOTIFICATION_TYPE_ERROR__);
             $this->response->setRedirect(caNavUrl($this->request, '', 'Account', 'Index'), 302);
             return;
         }
         $this->view->setVar('t_order', $t_order);
         $this->view->setVar('item_list', $t_order->getItems());
         if (!$t_order->getPrimaryKey()) {
             $this->notification->addNotification(_t("Invalid order_id"), __NOTIFICATION_TYPE_ERROR__);
             $this->response->setRedirect(caNavUrl($this->request, '', 'Account', 'Index'), 302);
             return;
         } else {
             $this->view->setVar('order_id', $t_order->getPrimaryKey());
         }
         $va_months = array();
         $o_tep = new TimeExpressionParser();
         foreach ($o_tep->getMonthList() as $vn_m => $vs_month) {
             $va_months[$vs_month] = $vn_m + 1;
         }
         $o_tep = new TimeExpressionParser();
         $this->view->setVar('credit_card_exp_month_list', $va_months);
         $va_tmp = getDate();
         $vn_current_year = $va_tmp['year'];
         $vn_i = 0;
         $va_credit_card_exp_year_list = array();
         while ($vn_i < 8) {
             $va_credit_card_exp_year_list[$vn_current_year + $vn_i] = $vn_current_year + $vn_i;
             $vn_i++;
         }
         $this->view->setVar('credit_card_exp_year_list', $va_credit_card_exp_year_list);
         # --- get any messages linked to this order
         $t_comm = new ca_commerce_communications();
         $this->view->setVar('messages', $t_comm->getMessages($this->request->getUserID(), array('transaction_id' => $t_order->get("transaction_id"))));
         $this->render('Account/view_order_html.php');
     }
 }