コード例 #1
0
ファイル: discounts.php プロジェクト: notzen/exponent-cms
 public function update($params = array())
 {
     //FJD: FIXME: this is here because expRecord throughs an error in the build function when trying to run
     //strip slashes on an array.  Should probably figure out a way to tell Exp if a field is supposed to be
     //serialized, and then we can handle it all in expRecord.
     $params['group_ids'] = serialize($params['group_ids']);
     $this->startdate = datetimecontrol::parseData('startdate', $params);
     $this->startdate_time = datetimecontrol::parseData('startdate_time', $params) + $this->startdate;
     $this->enddate = datetimecontrol::parseData('enddate', $params);
     $this->enddate_time = datetimecontrol::parseData('enddate_time', $params) + $this->enddate;
     //                   eDebug($_POST);
     //eDebug($params);
     //eDebug($this, true);
     parent::update($params);
 }
コード例 #2
0
 public function update($params = array())
 {
     global $db;
     if (isset($params['id'])) {
         $product = new product($params['id']);
     }
     // Save the event info to the eventregistration table
     #	    $event = new expRecord();
     #	    $event->tablename = 'eventregistration';
     $event->eventdate = datetimecontrol::parseData('eventdate', $params);
     $event->event_starttime = datetimecontrol::parseData('event_starttime', $params) + $event->eventdate;
     $event->event_endtime = datetimecontrol::parseData('event_endtime', $params) + $event->eventdate;
     $event->signup_cutoff = datetimecontrol::parseData('signup_cutoff', $params);
     $event->id = empty($product->product_type_id) ? null : $product->product_type_id;
     if (!empty($event->id)) {
         $db->updateObject($event, 'eventregistration');
     } else {
         $event->id = $db->insertObject($event, 'eventregistration');
     }
     $params['product_type_id'] = $event->id;
     parent::update($params);
 }
コード例 #3
0
ファイル: calendar.php プロジェクト: notzen/exponent-cms
 static function update($values, $object)
 {
     $object->title = $values['title'];
     $object->body = preg_replace('/<br ?\\/>$/', '', trim($values['body']));
     $object->is_allday = isset($values['is_allday']) ? 1 : 0;
     $object->is_featured = isset($values['is_featured']) ? 1 : 0;
     $object->eventstart = datetimecontrol::parseData('eventstart', $values);
     $object->eventend = datetimecontrol::parseData('eventend', $values);
     if (!isset($object->id)) {
         global $user;
         $object->poster = $user->id;
         $object->posted = time();
     }
     return $object;
 }
コード例 #4
0
 function update($values, $object)
 {
     if (!defined('SYS_FORMS')) {
         require_once BASE . 'subsystems/forms.php';
     }
     exponent_forms_initialize();
     $object->title = $values['title'];
     $object->body = preg_replace('/<br ?\\/>$/', '', trim($values['body']));
     $object->is_allday = isset($values['is_allday']) ? 1 : 0;
     $object->eventstart = datetimecontrol::parseData('eventstart', $values);
     $object->eventend = datetimecontrol::parseData('eventend', $values);
     if (!isset($object->id)) {
         global $user;
         $object->poster = $user->id;
         $object->posted = time();
     }
     return $object;
 }
コード例 #5
0
 function update_shipping()
 {
     $order = new order($this->params['id']);
     $this->params['shipped'] = datetimecontrol::parseData('shipped', $this->params);
     $order->update($this->params);
     flash('message', gt('Shipping information updated.'));
     expHistory::back();
 }
コード例 #6
0
 static function parseData($original_name, $formvalues)
 {
     if (!isset($formvalues[$original_name])) {
         $date = yuicalendarcontrol::parseData($original_name . 'date', $formvalues);
         $time = datetimecontrol::parseData($original_name . 'time', $formvalues);
         return $date + $time;
     } else {
         return 0;
     }
     //return $time;
 }